Emdash source with visual editor image upload fix
Fixes: 1. media.ts: wrap placeholder generation in try-catch 2. toolbar.ts: check r.ok, display error message in popover
This commit is contained in:
98
packages/plugins/embeds/CHANGELOG.md
Normal file
98
packages/plugins/embeds/CHANGELOG.md
Normal file
@@ -0,0 +1,98 @@
|
||||
# @emdash-cms/plugin-embeds
|
||||
|
||||
## 0.1.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`e2b3c6c`](https://github.com/emdash-cms/emdash/commit/e2b3c6cd930d5fa6fc607a0b26fd796f5b0f98b2), [`7b8d496`](https://github.com/emdash-cms/emdash/commit/7b8d4964c619821937d1a738cbd6f81e98095a91), [`9dfc65c`](https://github.com/emdash-cms/emdash/commit/9dfc65c42c04c41088e0c8f5a8ca4347643e2fea), [`e0dc6fb`](https://github.com/emdash-cms/emdash/commit/e0dc6fb8adadc0e048f3f314d62bfa98d9bb48d4), [`c22fb3a`](https://github.com/emdash-cms/emdash/commit/c22fb3a10d445f12cca91620c9258d50695afa44), [`6a4e9b8`](https://github.com/emdash-cms/emdash/commit/6a4e9b8b0fa6064989224a42b14de435f487a76f), [`0ee372a`](https://github.com/emdash-cms/emdash/commit/0ee372a7f33eecce7d90e12624923d2d9c132adf), [`22a16ee`](https://github.com/emdash-cms/emdash/commit/22a16eed607a4e81391ecb6c45fe2e59aaca92fe), [`1e2b024`](https://github.com/emdash-cms/emdash/commit/1e2b02486ee0407e4f50b8342ba1a9e7d060e405), [`81662e9`](https://github.com/emdash-cms/emdash/commit/81662e98fcf1ad0ee880d4f1af96271c527d7423), [`2f22f57`](https://github.com/emdash-cms/emdash/commit/2f22f57abadf305cf6d3ce07ee78290178e032d1), [`ef3f076`](https://github.com/emdash-cms/emdash/commit/ef3f076c8112e9dffc2a87c019e5521e823f5e86), [`a9c29ea`](https://github.com/emdash-cms/emdash/commit/a9c29ea584300f6cf67206bedcb1d39f05ea1c26), [`e7df21f`](https://github.com/emdash-cms/emdash/commit/e7df21f0adca795cdb233d6e64cd543ead7e2347), [`d5f7c48`](https://github.com/emdash-cms/emdash/commit/d5f7c481a507868f470361cfd715a5828640d45a), [`8ae227c`](https://github.com/emdash-cms/emdash/commit/8ae227cceade5c9852897c7b56f89e7422ee82a1), [`e2d5d16`](https://github.com/emdash-cms/emdash/commit/e2d5d160acea4444945b1ea79c80ca9ce138965b), [`0d98c62`](https://github.com/emdash-cms/emdash/commit/0d98c620a5f407648f3b7f3cbd30b642c74be607), [`64bf5b9`](https://github.com/emdash-cms/emdash/commit/64bf5b98125ca18ec26f7e0e65a71fcbe71fd44f), [`e81aa0f`](https://github.com/emdash-cms/emdash/commit/e81aa0f717be11bacdff30ed9bbc454824268555), [`a838000`](https://github.com/emdash-cms/emdash/commit/a83800068678daf6391e02bba8acf27ff4db0e19), [`0041d76`](https://github.com/emdash-cms/emdash/commit/0041d7699b32b77b4cd2ecd77b97340f0dd3abce), [`cee403d`](https://github.com/emdash-cms/emdash/commit/cee403d5c008feb9ca60bb7201e151b828737743), [`a8bac5d`](https://github.com/emdash-cms/emdash/commit/a8bac5d7216e185b1bd9a2aaaeaa9a0306ab066e), [`5b6f059`](https://github.com/emdash-cms/emdash/commit/5b6f059d06175ae0cb740d1ba32867d1ec6b2249), [`a86ff80`](https://github.com/emdash-cms/emdash/commit/a86ff80836fed175508ff06f744c7ad6b805627c), [`d4be24f`](https://github.com/emdash-cms/emdash/commit/d4be24f478a0c8d0a7bba3c299e11105bba3ed94), [`eb6dbd0`](https://github.com/emdash-cms/emdash/commit/eb6dbd056717fd076a8b5fa807d91516a00f5f2f)]:
|
||||
- emdash@0.9.0
|
||||
- @emdash-cms/blocks@0.9.0
|
||||
|
||||
## 0.1.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`6e0e921`](https://github.com/emdash-cms/emdash/commit/6e0e9215e00f6f2e84ade30447e4c30b1812dbf5), [`493e317`](https://github.com/emdash-cms/emdash/commit/493e3172d4539d8e041e6d2bf2d7d2dc89b2a10d), [`3eca9d5`](https://github.com/emdash-cms/emdash/commit/3eca9d54be03a803d35e112f4114f85f53a23acd), [`3eca9d5`](https://github.com/emdash-cms/emdash/commit/3eca9d54be03a803d35e112f4114f85f53a23acd), [`37ada52`](https://github.com/emdash-cms/emdash/commit/37ada52a62e94f4f0581f4356ba55dc978863f49), [`0557b62`](https://github.com/emdash-cms/emdash/commit/0557b62ec646e49eeb5e28686d50b4e8746338be), [`5a581d9`](https://github.com/emdash-cms/emdash/commit/5a581d966cc1da72637a76ad42a7ac3b81ec59c3), [`0ecd3b4`](https://github.com/emdash-cms/emdash/commit/0ecd3b4901eb721825b36eb4812506032e43da14), [`3138432`](https://github.com/emdash-cms/emdash/commit/31384322537070db8c35e4f93f4ffe8225d784d6), [`70924cd`](https://github.com/emdash-cms/emdash/commit/70924cd19b4227b3a1ecfad6618f1a80530a378b), [`1f0f6f2`](https://github.com/emdash-cms/emdash/commit/1f0f6f2507d026f2b5c60c254432bfc327b3474f), [`3eca9d5`](https://github.com/emdash-cms/emdash/commit/3eca9d54be03a803d35e112f4114f85f53a23acd), [`e402890`](https://github.com/emdash-cms/emdash/commit/e402890fcd8647fdfe847bb34aa9f9e7094473dd), [`3eca9d5`](https://github.com/emdash-cms/emdash/commit/3eca9d54be03a803d35e112f4114f85f53a23acd), [`f5658f0`](https://github.com/emdash-cms/emdash/commit/f5658f052f7294039f7ea8c5eb8b49af263beb0d), [`3eca9d5`](https://github.com/emdash-cms/emdash/commit/3eca9d54be03a803d35e112f4114f85f53a23acd), [`3eca9d5`](https://github.com/emdash-cms/emdash/commit/3eca9d54be03a803d35e112f4114f85f53a23acd), [`b6cb2e6`](https://github.com/emdash-cms/emdash/commit/b6cb2e6c7001d37a0558e22953eba41013457528), [`3eca9d5`](https://github.com/emdash-cms/emdash/commit/3eca9d54be03a803d35e112f4114f85f53a23acd), [`cf1edae`](https://github.com/emdash-cms/emdash/commit/cf1edae6ac3e5cd8c72fd43a09bb80bae5cc8031), [`b352e88`](https://github.com/emdash-cms/emdash/commit/b352e881fedb7f6fdc35f9d75402f67caba7f154), [`31333dc`](https://github.com/emdash-cms/emdash/commit/31333dc593e2b9128113e4e923455209f11853fd), [`da3d065`](https://github.com/emdash-cms/emdash/commit/da3d0656a4431365176cca65dc2bedf5eca19ce3), [`3eca9d5`](https://github.com/emdash-cms/emdash/commit/3eca9d54be03a803d35e112f4114f85f53a23acd), [`3eca9d5`](https://github.com/emdash-cms/emdash/commit/3eca9d54be03a803d35e112f4114f85f53a23acd), [`3eca9d5`](https://github.com/emdash-cms/emdash/commit/3eca9d54be03a803d35e112f4114f85f53a23acd), [`47978b5`](https://github.com/emdash-cms/emdash/commit/47978b5e1b69b671d2ea5c08ee0bbf4c72d1594d), [`3eca9d5`](https://github.com/emdash-cms/emdash/commit/3eca9d54be03a803d35e112f4114f85f53a23acd)]:
|
||||
- @emdash-cms/blocks@1.0.0
|
||||
- emdash@1.0.0
|
||||
|
||||
## 0.1.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`8ebdf1a`](https://github.com/emdash-cms/emdash/commit/8ebdf1af65764cc4b72624e7758c4a666817aade), [`7186961`](https://github.com/emdash-cms/emdash/commit/7186961d3cbf706c1248e9e40b14b1a545ce8586), [`e9ecec2`](https://github.com/emdash-cms/emdash/commit/e9ecec2d2dfb20ab4c413fb593a09a9f6d0fb27e), [`e3e18aa`](https://github.com/emdash-cms/emdash/commit/e3e18aae92d31cf22efd11a0ba06110de24a076a), [`fae63bd`](https://github.com/emdash-cms/emdash/commit/fae63bdae8ff798a420379c36d3d05e54ea3628a), [`30d8fe0`](https://github.com/emdash-cms/emdash/commit/30d8fe00025e058c71c8bfcd296946bb2042c4a7), [`d4a95bf`](https://github.com/emdash-cms/emdash/commit/d4a95bf313855e97108dfec4de3ab35f1a85f8ba), [`a31db7d`](https://github.com/emdash-cms/emdash/commit/a31db7dcc6d9ddb09328eec815d255a4976ce3b8), [`adb118c`](https://github.com/emdash-cms/emdash/commit/adb118c99d867be7b17714798e1e565ccdf096e4), [`080a4f1`](https://github.com/emdash-cms/emdash/commit/080a4f1efdd793cddd49767d8b18cd53162f39e3), [`81fe93b`](https://github.com/emdash-cms/emdash/commit/81fe93bc675581ddd0161eaabbe7a3471ec76529), [`c26442b`](https://github.com/emdash-cms/emdash/commit/c26442be9887f1e3d3df37db5ccda6b260820a77)]:
|
||||
- emdash@0.7.0
|
||||
- @emdash-cms/blocks@0.7.0
|
||||
|
||||
## 0.1.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`ada4ac7`](https://github.com/emdash-cms/emdash/commit/ada4ac7105f72a96eaf4ce3d884d705d8aba0119), [`f279320`](https://github.com/emdash-cms/emdash/commit/f279320ef49c68662c8936db15e21f46cb57e82b), [`7f75193`](https://github.com/emdash-cms/emdash/commit/7f75193df49967c871acdf47a22f0e48d2e98986), [`cfd01f3`](https://github.com/emdash-cms/emdash/commit/cfd01f3bd484b38549a5a164ad006279a2024788), [`38d637b`](https://github.com/emdash-cms/emdash/commit/38d637b520f8596758939ec08a7b534bb9550967), [`31d2f4e`](https://github.com/emdash-cms/emdash/commit/31d2f4edd5e84391e23f2eb6ff833e2fd4e51077), [`445b3bf`](https://github.com/emdash-cms/emdash/commit/445b3bfecf1f4cdc109be865685eb6ae6e0c06e6), [`943d540`](https://github.com/emdash-cms/emdash/commit/943d54060eb6675dda643b09f7cdb80bbbe5d566), [`2cb3165`](https://github.com/emdash-cms/emdash/commit/2cb31658037bc2b9ebfd3c5b82e4fb709b4a1fad), [`1859347`](https://github.com/emdash-cms/emdash/commit/18593475bb8e30ce1aab55d72903d02dbf3fd0cb), [`14c923b`](https://github.com/emdash-cms/emdash/commit/14c923b5eaf23f6e601cd2559ce9fc3af2f40822), [`c5ef0f5`](https://github.com/emdash-cms/emdash/commit/c5ef0f5befda129e4040822ee341f8cd8bb5acaf), [`f839381`](https://github.com/emdash-cms/emdash/commit/f8393819e74b31c269ba6c5088eab1f40b438c62), [`002d0ac`](https://github.com/emdash-cms/emdash/commit/002d0accd87fc0b6983a3a45fd11227398837366), [`0a61ef4`](https://github.com/emdash-cms/emdash/commit/0a61ef412ef8d2643fa847caeddbe8b8933d3fc7), [`6d41fe1`](https://github.com/emdash-cms/emdash/commit/6d41fe16539d09c53916b4ca41c515a29f8e0d4f), [`b158e40`](https://github.com/emdash-cms/emdash/commit/b158e40de596e8ca3cb056495276ec97403c24d9), [`f97d6ab`](https://github.com/emdash-cms/emdash/commit/f97d6ab0f1995fe86862aeb20de65d0ee774699f), [`e67b940`](https://github.com/emdash-cms/emdash/commit/e67b94056c21c716eada0fff7350b8592c6a3c68), [`0896ec8`](https://github.com/emdash-cms/emdash/commit/0896ec81065da7fa9b93053d366500805602c8fe), [`629fe1d`](https://github.com/emdash-cms/emdash/commit/629fe1dd3094a0178c57529a455a2be805b08ad0), [`f52154d`](https://github.com/emdash-cms/emdash/commit/f52154da8afb838b1af6deccf33b5a261257ec7c), [`8221c2a`](https://github.com/emdash-cms/emdash/commit/8221c2a3a37353b550f1c2c4a188bc4e2725b914), [`8fb93eb`](https://github.com/emdash-cms/emdash/commit/8fb93eb045eb529eafd83e451ec673106f5bdb3c), [`6d7f288`](https://github.com/emdash-cms/emdash/commit/6d7f288d812b554988742c36ef7a74be67386e6d), [`4ffa141`](https://github.com/emdash-cms/emdash/commit/4ffa141c00ec7b9785bbb86f9292055e46b22a61), [`04e6cca`](https://github.com/emdash-cms/emdash/commit/04e6ccaa939f184edf4129eea0edf8ac5185d018), [`9295cc1`](https://github.com/emdash-cms/emdash/commit/9295cc199f72c9b9adff236e4a72ba412604493f)]:
|
||||
- emdash@0.6.0
|
||||
- @emdash-cms/blocks@0.6.0
|
||||
|
||||
## 0.1.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`82c6345`](https://github.com/emdash-cms/emdash/commit/82c63451ff05ddc0a8e2777c124907358814da2b), [`64f90d1`](https://github.com/emdash-cms/emdash/commit/64f90d1957af646ca200b9d70e856fa72393f001), [`598026c`](https://github.com/emdash-cms/emdash/commit/598026c99083325c281b9e7ab87e9724e11f2c8d), [`197bc1b`](https://github.com/emdash-cms/emdash/commit/197bc1bdcb16012138a95b46a1e31530bde8c5ab), [`ce873f8`](https://github.com/emdash-cms/emdash/commit/ce873f8fa618aa175598726a60230b4c36d37e2e)]:
|
||||
- emdash@0.5.0
|
||||
- @emdash-cms/blocks@0.5.0
|
||||
|
||||
## 0.1.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`5beddc3`](https://github.com/emdash-cms/emdash/commit/5beddc31785aa7de086b2b22a2a9612f9d1c8aaf), [`8ed7969`](https://github.com/emdash-cms/emdash/commit/8ed7969df2c95790d7c635ef043df20bb21b6156), [`f866c9c`](https://github.com/emdash-cms/emdash/commit/f866c9cc0dd1ac62035ef3e06bbe8d8d7d1c44a0), [`1acf174`](https://github.com/emdash-cms/emdash/commit/1acf1743e7116a5f00b11536306ebb55edbf3b2e), [`678cc8c`](https://github.com/emdash-cms/emdash/commit/678cc8c4c34a23e8a7aeda652b0ec87070983b07), [`d56f6c1`](https://github.com/emdash-cms/emdash/commit/d56f6c1d2a688eee46e96a1dbe2d8c894ffc7095), [`5d9120e`](https://github.com/emdash-cms/emdash/commit/5d9120eca846dd7c446d05f1b9c14fe1b7e394ec), [`9318c56`](https://github.com/emdash-cms/emdash/commit/9318c5684fb293f167cd3e6f9e9a3ca12f042d7b), [`2a7c68a`](https://github.com/emdash-cms/emdash/commit/2a7c68a9f6c88216eb3f599b942b63fec8e1ae31), [`6492ea2`](https://github.com/emdash-cms/emdash/commit/6492ea202c5872132c952678862eb6f564c78b7c), [`b382357`](https://github.com/emdash-cms/emdash/commit/b38235702fd075d95c04b2a6874804ca45baa721), [`5c0776d`](https://github.com/emdash-cms/emdash/commit/5c0776deee7005ba580fc7dc8f778e805ab82cef), [`1b743ac`](https://github.com/emdash-cms/emdash/commit/1b743acc35750dc36de4acdd95164c34cd7d092f)]:
|
||||
- emdash@0.4.0
|
||||
- @emdash-cms/blocks@0.4.0
|
||||
|
||||
## 0.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`f2b3973`](https://github.com/emdash-cms/emdash/commit/f2b39739c13cbef86ed16be007f08abf86b0f9ca), [`13f5ff5`](https://github.com/emdash-cms/emdash/commit/13f5ff57ffbe89e330d55b3c9c25a1907bf94394), [`a283954`](https://github.com/emdash-cms/emdash/commit/a28395455cec14cea6d382a604e2598ead097d99), [`c70f66f`](https://github.com/emdash-cms/emdash/commit/c70f66f7da66311fcf2f5922f23cdf951cdaff5f), [`0b4e61b`](https://github.com/emdash-cms/emdash/commit/0b4e61b059e40d7fc56aceb63d43004c8872005d)]:
|
||||
- emdash@0.3.0
|
||||
- @emdash-cms/blocks@0.3.0
|
||||
|
||||
## 0.1.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`156ba73`](https://github.com/emdash-cms/emdash/commit/156ba7350070400e5877e3a54d33486cd0d33640), [`80a895b`](https://github.com/emdash-cms/emdash/commit/80a895b1def1bf8794f56e151e5ad7675225fae4), [`da957ce`](https://github.com/emdash-cms/emdash/commit/da957ce8ec18953995e6e00e0a38e5d830f1a381), [`fcd8b7b`](https://github.com/emdash-cms/emdash/commit/fcd8b7bebbd4342de6ca1d782a3ae4d42d1be913), [`8ac15a4`](https://github.com/emdash-cms/emdash/commit/8ac15a4ee450552f763d3c6d9d097941c57b8300), [`ba2b020`](https://github.com/emdash-cms/emdash/commit/ba2b0204d274cf1bbf89f724a99797660733203c), [`0b108cf`](https://github.com/emdash-cms/emdash/commit/0b108cf6286e5b41c134bbeca8a6cc834756b190), [`1989e8b`](https://github.com/emdash-cms/emdash/commit/1989e8b4c432a05d022baf2196dec2680b2e2fd0), [`e190324`](https://github.com/emdash-cms/emdash/commit/e1903248e0fccb1b34d0620b33e4f06eccdfe2a6), [`724191c`](https://github.com/emdash-cms/emdash/commit/724191cf96d5d79b22528a167de8c45146fb0746), [`ed28089`](https://github.com/emdash-cms/emdash/commit/ed28089bd296e1633ea048c7ca667cb5341f6aa6), [`a293708`](https://github.com/emdash-cms/emdash/commit/a2937083f8f74e32ad1b0383d9f22b20e18d7237), [`c75cc5b`](https://github.com/emdash-cms/emdash/commit/c75cc5b82cb678c5678859b249d545e12be6fd97), [`6ebb797`](https://github.com/emdash-cms/emdash/commit/6ebb7975be00a4d756cdb56955c88395840e3fec), [`d421ee2`](https://github.com/emdash-cms/emdash/commit/d421ee2cedfe48748148912ac7766fd841757dd6), [`391caf4`](https://github.com/emdash-cms/emdash/commit/391caf4a0f404f323b97c5d7f54f4a4d96aef349), [`6474dae`](https://github.com/emdash-cms/emdash/commit/6474daee29b6d0be289c995755658755d93316b1), [`30c9a96`](https://github.com/emdash-cms/emdash/commit/30c9a96404e913ea8b3039ef4a5bc70541647eec), [`122c236`](https://github.com/emdash-cms/emdash/commit/122c2364fc4cfc9082f036f9affcee13d9b00511), [`5320321`](https://github.com/emdash-cms/emdash/commit/5320321f5ee1c1f456b1c8c054f2d0232be58ecd), [`8f44ec2`](https://github.com/emdash-cms/emdash/commit/8f44ec23a4b23f636f9689c075d29edfa4962c7c), [`b712ae3`](https://github.com/emdash-cms/emdash/commit/b712ae3e5d8aec45e4d7a0f20f273795f7122715), [`9cb5a28`](https://github.com/emdash-cms/emdash/commit/9cb5a28001cc8e6d650ec6b45c9ea091a4e9e3c2), [`7ee7d95`](https://github.com/emdash-cms/emdash/commit/7ee7d95ee32df2b1915144030569382fe97aef3d), [`e1014ef`](https://github.com/emdash-cms/emdash/commit/e1014eff18301ff68ac75d19157d3500ebe890c5), [`4d4ac53`](https://github.com/emdash-cms/emdash/commit/4d4ac536eeb664b7d0ca9f1895a51960a47ecafe), [`476cb3a`](https://github.com/emdash-cms/emdash/commit/476cb3a585d30acb2d4d172f94c5d2b4e5b6377b), [`e1349e3`](https://github.com/emdash-cms/emdash/commit/e1349e342f90227c50f253cc2c1fbda0bc288a39), [`87b0439`](https://github.com/emdash-cms/emdash/commit/87b0439927454a275833992de4244678b47b9aa3), [`dd708b1`](https://github.com/emdash-cms/emdash/commit/dd708b1c0c35d43761f89a87cba74b3c0ecb777e), [`befaeec`](https://github.com/emdash-cms/emdash/commit/befaeecfefd968d14693e96e3cdaa691ffabe7d3), [`c92e7e6`](https://github.com/emdash-cms/emdash/commit/c92e7e6907a575d134a69ebbeed531b99569d599), [`2ba1f1f`](https://github.com/emdash-cms/emdash/commit/2ba1f1f8d1ff773889f980af35391187e3705f17), [`a13c4ec`](https://github.com/emdash-cms/emdash/commit/a13c4ec6e362abecdae62abe64b1aebebc06aaae), [`a5e0603`](https://github.com/emdash-cms/emdash/commit/a5e0603b1910481d042f5a22dd19a60c76da7197)]:
|
||||
- emdash@0.2.0
|
||||
- @emdash-cms/blocks@0.2.0
|
||||
|
||||
## 0.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`422018a`](https://github.com/emdash-cms/emdash/commit/422018aeb227dffe3da7bfc772d86f9ce9c2bcd1), [`4221ba4`](https://github.com/emdash-cms/emdash/commit/4221ba48bc87ab9fa0b1bae144f6f2920beb4f5a), [`9269759`](https://github.com/emdash-cms/emdash/commit/9269759674bf254863f37d4cf1687fae56082063), [`d6cfc43`](https://github.com/emdash-cms/emdash/commit/d6cfc437f23e3e435a8862cab17d2c19363847d7), [`1bcfc50`](https://github.com/emdash-cms/emdash/commit/1bcfc502112d8756e34a720b8a170eb5486b425a), [`8c693b5`](https://github.com/emdash-cms/emdash/commit/8c693b582d7c5e29bd138161e81d9c8affb53689), [`5b3e33c`](https://github.com/emdash-cms/emdash/commit/5b3e33c26bc2eb30ab2a032960a5d57eb06f148a), [`9d10d27`](https://github.com/emdash-cms/emdash/commit/9d10d2791fe16be901d9d138e434bd79cf9335c4), [`91e31fb`](https://github.com/emdash-cms/emdash/commit/91e31fb2cab4c0470088c5d61bab6e2028821569), [`f112ac4`](https://github.com/emdash-cms/emdash/commit/f112ac48194d1c2302e93756d54b116d3d207c22), [`e9a6f7a`](https://github.com/emdash-cms/emdash/commit/e9a6f7ac3ceeaf5c2d0a557e4cf6cab5f3d7d764), [`b297fdd`](https://github.com/emdash-cms/emdash/commit/b297fdd88dadcabeb93f47abea9f24f70b7d4b71), [`d211452`](https://github.com/emdash-cms/emdash/commit/d2114523a55021f65ee46e44e11157b06334819e), [`8e28cfc`](https://github.com/emdash-cms/emdash/commit/8e28cfc5d66f58f0fb91aa35c02afdd426bb6555), [`38af118`](https://github.com/emdash-cms/emdash/commit/38af118ad517fd9aa83064368543bf64bc32c08a)]:
|
||||
- emdash@0.1.1
|
||||
|
||||
## 0.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- [#14](https://github.com/emdash-cms/emdash/pull/14) [`755b501`](https://github.com/emdash-cms/emdash/commit/755b5017906811f97f78f4c0b5a0b62e67b52ec4) Thanks [@ascorbic](https://github.com/ascorbic)! - First beta release
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`755b501`](https://github.com/emdash-cms/emdash/commit/755b5017906811f97f78f4c0b5a0b62e67b52ec4)]:
|
||||
- emdash@0.1.0
|
||||
- @emdash-cms/blocks@0.1.0
|
||||
|
||||
## 0.0.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`3c319ed`](https://github.com/emdash-cms/emdash/commit/3c319ed6411a595e6974a86bc58c2a308b91c214)]:
|
||||
- emdash@0.0.3
|
||||
|
||||
## 0.0.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`b09bfd5`](https://github.com/emdash-cms/emdash/commit/b09bfd51cece5e88fe8314668a591ab11de36b4d)]:
|
||||
- emdash@0.0.2
|
||||
42
packages/plugins/embeds/package.json
Normal file
42
packages/plugins/embeds/package.json
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "@emdash-cms/plugin-embeds",
|
||||
"version": "0.1.9",
|
||||
"description": "Embed blocks for EmDash CMS - YouTube, Vimeo, Twitter, Bluesky, Mastodon, and more",
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./astro": "./src/astro/index.ts"
|
||||
},
|
||||
"files": [
|
||||
"src"
|
||||
],
|
||||
"keywords": [
|
||||
"emdash",
|
||||
"cms",
|
||||
"plugin",
|
||||
"embed",
|
||||
"youtube",
|
||||
"vimeo",
|
||||
"twitter",
|
||||
"bluesky"
|
||||
],
|
||||
"author": "Matt Kane",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"astro": ">=6.0.0-beta.0",
|
||||
"emdash": "workspace:>=0.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@emdash-cms/blocks": "workspace:*",
|
||||
"astro-embed": "^0.12.0"
|
||||
},
|
||||
"scripts": {
|
||||
"typecheck": "tsgo --noEmit"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/emdash-cms/emdash.git",
|
||||
"directory": "packages/plugins/embeds"
|
||||
}
|
||||
}
|
||||
22
packages/plugins/embeds/src/astro/Bluesky.astro
Normal file
22
packages/plugins/embeds/src/astro/Bluesky.astro
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
/**
|
||||
* Bluesky post embed component for Portable Text
|
||||
*
|
||||
* Wraps astro-embed's BlueskyPost component, extracting props from the PT block node.
|
||||
* astro-portabletext passes `node` (not `value`) for custom type components.
|
||||
*
|
||||
* Accepts either `id` or `url` field for compatibility with different content sources.
|
||||
*/
|
||||
import { BlueskyPost } from "astro-embed";
|
||||
import type { BlueskyBlock } from "../schemas.js";
|
||||
|
||||
interface Props {
|
||||
node: BlueskyBlock & { url?: string };
|
||||
}
|
||||
|
||||
const { node } = Astro.props;
|
||||
// Support both 'id' (schema) and 'url' (admin editor) field names
|
||||
const postId = node.id || node.url;
|
||||
---
|
||||
|
||||
{postId && <BlueskyPost id={postId} />}
|
||||
19
packages/plugins/embeds/src/astro/Gist.astro
Normal file
19
packages/plugins/embeds/src/astro/Gist.astro
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
/**
|
||||
* GitHub Gist embed component for Portable Text
|
||||
*
|
||||
* Wraps astro-embed's Gist component, extracting props from the PT block node.
|
||||
* astro-portabletext passes `node` (not `value`) for custom type components.
|
||||
*/
|
||||
import { Gist as AstroGist } from "astro-embed";
|
||||
import type { GistBlock } from "../schemas.js";
|
||||
|
||||
interface Props {
|
||||
node: GistBlock;
|
||||
}
|
||||
|
||||
const { node } = Astro.props;
|
||||
const { id, file } = node;
|
||||
---
|
||||
|
||||
<AstroGist id={id} file={file} />
|
||||
19
packages/plugins/embeds/src/astro/LinkPreview.astro
Normal file
19
packages/plugins/embeds/src/astro/LinkPreview.astro
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
/**
|
||||
* Link preview (Open Graph) embed component for Portable Text
|
||||
*
|
||||
* Wraps astro-embed's LinkPreview component, extracting props from the PT block node.
|
||||
* astro-portabletext passes `node` (not `value`) for custom type components.
|
||||
*/
|
||||
import { LinkPreview as AstroLinkPreview } from "astro-embed";
|
||||
import type { LinkPreviewBlock } from "../schemas.js";
|
||||
|
||||
interface Props {
|
||||
node: LinkPreviewBlock;
|
||||
}
|
||||
|
||||
const { node } = Astro.props;
|
||||
const { id, hideMedia } = node;
|
||||
---
|
||||
|
||||
<AstroLinkPreview id={id} hideMedia={hideMedia} />
|
||||
19
packages/plugins/embeds/src/astro/Mastodon.astro
Normal file
19
packages/plugins/embeds/src/astro/Mastodon.astro
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
/**
|
||||
* Mastodon post embed component for Portable Text
|
||||
*
|
||||
* Wraps astro-embed's MastodonPost component, extracting props from the PT block node.
|
||||
* astro-portabletext passes `node` (not `value`) for custom type components.
|
||||
*/
|
||||
import { MastodonPost } from "astro-embed";
|
||||
import type { MastodonBlock } from "../schemas.js";
|
||||
|
||||
interface Props {
|
||||
node: MastodonBlock;
|
||||
}
|
||||
|
||||
const { node } = Astro.props;
|
||||
const { id } = node;
|
||||
---
|
||||
|
||||
<MastodonPost id={id} />
|
||||
19
packages/plugins/embeds/src/astro/Tweet.astro
Normal file
19
packages/plugins/embeds/src/astro/Tweet.astro
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
/**
|
||||
* Tweet embed component for Portable Text
|
||||
*
|
||||
* Wraps astro-embed's Tweet component, extracting props from the PT block node.
|
||||
* astro-portabletext passes `node` (not `value`) for custom type components.
|
||||
*/
|
||||
import { Tweet as AstroTweet } from "astro-embed";
|
||||
import type { TweetBlock } from "../schemas.js";
|
||||
|
||||
interface Props {
|
||||
node: TweetBlock;
|
||||
}
|
||||
|
||||
const { node } = Astro.props;
|
||||
const { id, theme } = node;
|
||||
---
|
||||
|
||||
<AstroTweet id={id} theme={theme} />
|
||||
25
packages/plugins/embeds/src/astro/Vimeo.astro
Normal file
25
packages/plugins/embeds/src/astro/Vimeo.astro
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
/**
|
||||
* Vimeo embed component for Portable Text
|
||||
*
|
||||
* Wraps astro-embed's Vimeo component, extracting props from the PT block node.
|
||||
* astro-portabletext passes `node` (not `value`) for custom type components.
|
||||
*/
|
||||
import { Vimeo as AstroVimeo } from "astro-embed";
|
||||
import type { VimeoBlock } from "../schemas.js";
|
||||
|
||||
interface Props {
|
||||
node: VimeoBlock;
|
||||
}
|
||||
|
||||
const { node } = Astro.props;
|
||||
const { id, poster, posterQuality, params, playlabel } = node;
|
||||
---
|
||||
|
||||
<AstroVimeo
|
||||
id={id}
|
||||
poster={poster}
|
||||
posterQuality={posterQuality}
|
||||
params={params}
|
||||
playlabel={playlabel}
|
||||
/>
|
||||
26
packages/plugins/embeds/src/astro/YouTube.astro
Normal file
26
packages/plugins/embeds/src/astro/YouTube.astro
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
/**
|
||||
* YouTube embed component for Portable Text
|
||||
*
|
||||
* Wraps astro-embed's YouTube component, extracting props from the PT block node.
|
||||
* astro-portabletext passes `node` (not `value`) for custom type components.
|
||||
*/
|
||||
import { YouTube as AstroYouTube } from "astro-embed";
|
||||
import type { YouTubeBlock } from "../schemas.js";
|
||||
|
||||
interface Props {
|
||||
node: YouTubeBlock;
|
||||
}
|
||||
|
||||
const { node } = Astro.props;
|
||||
const { id, poster, posterQuality, params, playlabel, title } = node;
|
||||
---
|
||||
|
||||
<AstroYouTube
|
||||
id={id}
|
||||
poster={poster}
|
||||
posterQuality={posterQuality}
|
||||
params={params}
|
||||
playlabel={playlabel}
|
||||
title={title}
|
||||
/>
|
||||
66
packages/plugins/embeds/src/astro/index.ts
Normal file
66
packages/plugins/embeds/src/astro/index.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* Astro components for rendering embed blocks in Portable Text
|
||||
*
|
||||
* These components are automatically registered with PortableText when
|
||||
* the embeds plugin is enabled. Manual wiring is no longer needed!
|
||||
*
|
||||
* The components are exported with lowercase names matching their block types
|
||||
* for auto-registration, plus PascalCase aliases for direct usage.
|
||||
*
|
||||
* @example Direct usage (if you need to customize)
|
||||
* ```astro
|
||||
* ---
|
||||
* import { YouTube } from "@emdash-cms/plugin-embeds/astro";
|
||||
* ---
|
||||
* <YouTube value={{ id: "dQw4w9WgXcQ", _type: "youtube", _key: "1" }} />
|
||||
* ```
|
||||
*/
|
||||
|
||||
import BlueskyComponent from "./Bluesky.astro";
|
||||
import GistComponent from "./Gist.astro";
|
||||
import LinkPreviewComponent from "./LinkPreview.astro";
|
||||
import MastodonComponent from "./Mastodon.astro";
|
||||
import TweetComponent from "./Tweet.astro";
|
||||
import VimeoComponent from "./Vimeo.astro";
|
||||
// Import all components
|
||||
import YouTubeComponent from "./YouTube.astro";
|
||||
|
||||
// Export with lowercase names (for auto-registration via virtual module)
|
||||
// These names MUST match the block type names in EMBED_BLOCK_TYPES
|
||||
export {
|
||||
YouTubeComponent as youtube,
|
||||
VimeoComponent as vimeo,
|
||||
TweetComponent as tweet,
|
||||
BlueskyComponent as bluesky,
|
||||
MastodonComponent as mastodon,
|
||||
LinkPreviewComponent as linkPreview,
|
||||
GistComponent as gist,
|
||||
};
|
||||
|
||||
// Also export with PascalCase for direct usage
|
||||
export {
|
||||
YouTubeComponent as YouTube,
|
||||
VimeoComponent as Vimeo,
|
||||
TweetComponent as Tweet,
|
||||
BlueskyComponent as Bluesky,
|
||||
MastodonComponent as Mastodon,
|
||||
LinkPreviewComponent as LinkPreview,
|
||||
GistComponent as Gist,
|
||||
};
|
||||
|
||||
/**
|
||||
* All embed components keyed by their Portable Text block type.
|
||||
* Exported as `blockComponents` for auto-registration via the virtual module,
|
||||
* and as `embedComponents` for direct usage.
|
||||
*/
|
||||
export const blockComponents = {
|
||||
youtube: YouTubeComponent,
|
||||
vimeo: VimeoComponent,
|
||||
tweet: TweetComponent,
|
||||
bluesky: BlueskyComponent,
|
||||
mastodon: MastodonComponent,
|
||||
linkPreview: LinkPreviewComponent,
|
||||
gist: GistComponent,
|
||||
} as const;
|
||||
|
||||
export { blockComponents as embedComponents };
|
||||
183
packages/plugins/embeds/src/index.ts
Normal file
183
packages/plugins/embeds/src/index.ts
Normal file
@@ -0,0 +1,183 @@
|
||||
/**
|
||||
* Embeds Plugin for EmDash CMS
|
||||
*
|
||||
* Provides Portable Text block types for embedding external content:
|
||||
* - YouTube videos
|
||||
* - Vimeo videos
|
||||
* - Twitter/X tweets
|
||||
* - Bluesky posts
|
||||
* - Mastodon posts
|
||||
* - Link previews (Open Graph)
|
||||
* - GitHub Gists
|
||||
*
|
||||
* Uses astro-embed components for high-performance, privacy-respecting embeds.
|
||||
*
|
||||
* @example
|
||||
* ```typescript
|
||||
* // live.config.ts
|
||||
* import { embedsPlugin } from "@emdash-cms/plugin-embeds";
|
||||
*
|
||||
* export default defineConfig({
|
||||
* plugins: [embedsPlugin()],
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Embed components are automatically registered with PortableText when
|
||||
* the plugin is enabled. No manual component wiring needed!
|
||||
*
|
||||
* If you need to customize rendering, you can still override specific types:
|
||||
*
|
||||
* @example
|
||||
* ```astro
|
||||
* <PortableText
|
||||
* value={content}
|
||||
* components={{
|
||||
* types: {
|
||||
* youtube: MyCustomYouTube, // Override just this one
|
||||
* },
|
||||
* }}
|
||||
* />
|
||||
* ```
|
||||
*/
|
||||
|
||||
import type { Element } from "@emdash-cms/blocks";
|
||||
import type { PluginDescriptor, ResolvedPlugin } from "emdash";
|
||||
import { definePlugin } from "emdash";
|
||||
|
||||
import { EMBED_BLOCK_TYPES } from "./schemas.js";
|
||||
|
||||
/** Rich metadata for each embed block type */
|
||||
const EMBED_BLOCK_META: Record<
|
||||
string,
|
||||
{
|
||||
label: string;
|
||||
icon?: string;
|
||||
description?: string;
|
||||
placeholder?: string;
|
||||
fields?: Element[];
|
||||
}
|
||||
> = {
|
||||
youtube: {
|
||||
label: "YouTube Video",
|
||||
icon: "video",
|
||||
placeholder: "Paste YouTube URL...",
|
||||
fields: [
|
||||
{
|
||||
type: "text_input",
|
||||
action_id: "id",
|
||||
label: "YouTube URL",
|
||||
placeholder: "https://youtube.com/watch?v=...",
|
||||
},
|
||||
{ type: "text_input", action_id: "title", label: "Title" },
|
||||
{ type: "text_input", action_id: "poster", label: "Poster Image URL" },
|
||||
{
|
||||
type: "text_input",
|
||||
action_id: "params",
|
||||
label: "Player Parameters",
|
||||
placeholder: "start=57&end=75",
|
||||
},
|
||||
],
|
||||
},
|
||||
vimeo: {
|
||||
label: "Vimeo Video",
|
||||
icon: "video",
|
||||
placeholder: "Paste Vimeo URL...",
|
||||
fields: [
|
||||
{
|
||||
type: "text_input",
|
||||
action_id: "id",
|
||||
label: "Vimeo URL",
|
||||
placeholder: "https://vimeo.com/...",
|
||||
},
|
||||
{ type: "text_input", action_id: "poster", label: "Poster Image URL" },
|
||||
{ type: "text_input", action_id: "params", label: "Player Parameters" },
|
||||
],
|
||||
},
|
||||
tweet: { label: "Tweet (X)", icon: "link", placeholder: "Paste tweet URL..." },
|
||||
bluesky: { label: "Bluesky Post", icon: "link", placeholder: "Paste Bluesky post URL..." },
|
||||
mastodon: { label: "Mastodon Post", icon: "link", placeholder: "Paste Mastodon post URL..." },
|
||||
linkPreview: {
|
||||
label: "Link Preview",
|
||||
icon: "link-external",
|
||||
placeholder: "Paste any URL...",
|
||||
},
|
||||
gist: {
|
||||
label: "GitHub Gist",
|
||||
icon: "code",
|
||||
placeholder: "Paste Gist URL...",
|
||||
fields: [
|
||||
{
|
||||
type: "text_input",
|
||||
action_id: "id",
|
||||
label: "Gist URL",
|
||||
placeholder: "https://gist.github.com/.../...",
|
||||
},
|
||||
{
|
||||
type: "text_input",
|
||||
action_id: "file",
|
||||
label: "Specific File",
|
||||
placeholder: "Optional: filename to show",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export interface EmbedsPluginOptions {
|
||||
/**
|
||||
* Which embed types to enable.
|
||||
* Defaults to all types.
|
||||
*/
|
||||
types?: Array<(typeof EMBED_BLOCK_TYPES)[number]>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the embeds plugin descriptor
|
||||
*/
|
||||
export function embedsPlugin(
|
||||
options: EmbedsPluginOptions = {},
|
||||
): PluginDescriptor<EmbedsPluginOptions> {
|
||||
return {
|
||||
id: "embeds",
|
||||
version: "0.0.1",
|
||||
entrypoint: "@emdash-cms/plugin-embeds",
|
||||
componentsEntry: "@emdash-cms/plugin-embeds/astro",
|
||||
options,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the embeds plugin
|
||||
*/
|
||||
export function createPlugin(options: EmbedsPluginOptions = {}): ResolvedPlugin {
|
||||
const _enabledTypes = options.types ?? [...EMBED_BLOCK_TYPES];
|
||||
|
||||
return definePlugin({
|
||||
id: "embeds",
|
||||
version: "0.0.1",
|
||||
|
||||
// This plugin only provides block types - no server-side capabilities needed
|
||||
capabilities: [],
|
||||
|
||||
admin: {
|
||||
portableTextBlocks: _enabledTypes.map((type) => {
|
||||
const meta = EMBED_BLOCK_META[type];
|
||||
return {
|
||||
type,
|
||||
label: meta?.label ?? type,
|
||||
icon: meta?.icon,
|
||||
description: meta?.description,
|
||||
placeholder: meta?.placeholder,
|
||||
fields: meta?.fields,
|
||||
};
|
||||
}),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// Re-export schemas for consumers who need them
|
||||
export * from "./schemas.js";
|
||||
|
||||
export default createPlugin;
|
||||
|
||||
// Re-export the enabled types for the plugin to use
|
||||
export { EMBED_BLOCK_TYPES };
|
||||
162
packages/plugins/embeds/src/schemas.ts
Normal file
162
packages/plugins/embeds/src/schemas.ts
Normal file
@@ -0,0 +1,162 @@
|
||||
/**
|
||||
* Block schemas for embed types
|
||||
*
|
||||
* These define the Portable Text block structure for each embed type.
|
||||
* The schemas match the props expected by astro-embed components.
|
||||
*/
|
||||
|
||||
import { z } from "astro/zod";
|
||||
|
||||
/** Matches http(s) scheme at start of URL */
|
||||
const HTTP_SCHEME_RE = /^https?:\/\//i;
|
||||
|
||||
/** Validates that a URL string uses http or https scheme. Rejects javascript:/data: URI XSS vectors. */
|
||||
const httpUrl = z
|
||||
.string()
|
||||
.url()
|
||||
.refine((url) => HTTP_SCHEME_RE.test(url), "URL must use http or https");
|
||||
|
||||
/**
|
||||
* YouTube embed block
|
||||
* @see https://astro-embed.netlify.app/components/youtube/
|
||||
*/
|
||||
export const youtubeBlockSchema = z.object({
|
||||
_type: z.literal("youtube"),
|
||||
_key: z.string(),
|
||||
/** YouTube video ID or URL */
|
||||
id: z.string(),
|
||||
/** Custom poster image URL */
|
||||
poster: httpUrl.optional(),
|
||||
/** Poster quality when using default YouTube thumbnail */
|
||||
posterQuality: z.enum(["max", "high", "default", "low"]).optional(),
|
||||
/** YouTube player parameters (e.g., "start=57&end=75") */
|
||||
params: z.string().optional(),
|
||||
/** Accessible label for the play button */
|
||||
playlabel: z.string().optional(),
|
||||
/** Visible title overlay */
|
||||
title: z.string().optional(),
|
||||
});
|
||||
|
||||
export type YouTubeBlock = z.infer<typeof youtubeBlockSchema>;
|
||||
|
||||
/**
|
||||
* Vimeo embed block
|
||||
* @see https://astro-embed.netlify.app/components/vimeo/
|
||||
*/
|
||||
export const vimeoBlockSchema = z.object({
|
||||
_type: z.literal("vimeo"),
|
||||
_key: z.string(),
|
||||
/** Vimeo video ID or URL */
|
||||
id: z.string(),
|
||||
/** Custom poster image URL */
|
||||
poster: httpUrl.optional(),
|
||||
/** Poster quality */
|
||||
posterQuality: z.enum(["max", "high", "default", "low"]).optional(),
|
||||
/** Vimeo player parameters */
|
||||
params: z.string().optional(),
|
||||
/** Accessible label for the play button */
|
||||
playlabel: z.string().optional(),
|
||||
});
|
||||
|
||||
export type VimeoBlock = z.infer<typeof vimeoBlockSchema>;
|
||||
|
||||
/**
|
||||
* Twitter/X tweet embed block
|
||||
* @see https://astro-embed.netlify.app/components/twitter/
|
||||
*/
|
||||
export const tweetBlockSchema = z.object({
|
||||
_type: z.literal("tweet"),
|
||||
_key: z.string(),
|
||||
/** Tweet URL or ID */
|
||||
id: z.string(),
|
||||
/** Color theme */
|
||||
theme: z.enum(["light", "dark"]).optional(),
|
||||
});
|
||||
|
||||
export type TweetBlock = z.infer<typeof tweetBlockSchema>;
|
||||
|
||||
/**
|
||||
* Bluesky post embed block
|
||||
* @see https://astro-embed.netlify.app/components/bluesky/
|
||||
*/
|
||||
export const blueskyBlockSchema = z.object({
|
||||
_type: z.literal("bluesky"),
|
||||
_key: z.string(),
|
||||
/** Bluesky post URL or AT URI */
|
||||
id: z.string(),
|
||||
});
|
||||
|
||||
export type BlueskyBlock = z.infer<typeof blueskyBlockSchema>;
|
||||
|
||||
/**
|
||||
* Mastodon post embed block
|
||||
* @see https://astro-embed.netlify.app/components/mastodon/
|
||||
*/
|
||||
export const mastodonBlockSchema = z.object({
|
||||
_type: z.literal("mastodon"),
|
||||
_key: z.string(),
|
||||
/** Mastodon post URL */
|
||||
id: z.string(),
|
||||
});
|
||||
|
||||
export type MastodonBlock = z.infer<typeof mastodonBlockSchema>;
|
||||
|
||||
/**
|
||||
* Link preview / Open Graph embed block
|
||||
* @see https://astro-embed.netlify.app/components/link-preview/
|
||||
*/
|
||||
export const linkPreviewBlockSchema = z.object({
|
||||
_type: z.literal("linkPreview"),
|
||||
_key: z.string(),
|
||||
/** URL to fetch Open Graph data from */
|
||||
id: httpUrl,
|
||||
/** Hide media (image/video) even if present in OG data */
|
||||
hideMedia: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export type LinkPreviewBlock = z.infer<typeof linkPreviewBlockSchema>;
|
||||
|
||||
/**
|
||||
* GitHub Gist embed block
|
||||
* @see https://astro-embed.netlify.app/components/gist/
|
||||
*/
|
||||
export const gistBlockSchema = z.object({
|
||||
_type: z.literal("gist"),
|
||||
_key: z.string(),
|
||||
/** Gist URL */
|
||||
id: httpUrl,
|
||||
/** Specific file to show (case-sensitive) */
|
||||
file: z.string().optional(),
|
||||
});
|
||||
|
||||
export type GistBlock = z.infer<typeof gistBlockSchema>;
|
||||
|
||||
/**
|
||||
* Union of all embed block types
|
||||
*/
|
||||
export const embedBlockSchema = z.discriminatedUnion("_type", [
|
||||
youtubeBlockSchema,
|
||||
vimeoBlockSchema,
|
||||
tweetBlockSchema,
|
||||
blueskyBlockSchema,
|
||||
mastodonBlockSchema,
|
||||
linkPreviewBlockSchema,
|
||||
gistBlockSchema,
|
||||
]);
|
||||
|
||||
export type EmbedBlock = z.infer<typeof embedBlockSchema>;
|
||||
|
||||
/**
|
||||
* Block type names for use in plugin registration
|
||||
*/
|
||||
export const EMBED_BLOCK_TYPES = [
|
||||
"youtube",
|
||||
"vimeo",
|
||||
"tweet",
|
||||
"bluesky",
|
||||
"mastodon",
|
||||
"linkPreview",
|
||||
"gist",
|
||||
] as const;
|
||||
|
||||
export type EmbedBlockType = (typeof EMBED_BLOCK_TYPES)[number];
|
||||
9
packages/plugins/embeds/tsconfig.json
Normal file
9
packages/plugins/embeds/tsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist", "src/astro"]
|
||||
}
|
||||
Reference in New Issue
Block a user