@ampless/plugin-youtube 1.0.0-alpha.5 → 1.0.0-alpha.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/editor.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Node } from '@tiptap/core';
2
+ import { TiptapNodeMarkdownAdapters } from 'ampless';
2
3
 
3
4
  declare module '@tiptap/core' {
4
5
  interface Commands<ReturnType> {
@@ -35,4 +36,16 @@ declare const youtubeEditor: {
35
36
  */
36
37
  declare const editorExtension: Node<any, any>;
37
38
 
38
- export { AmplessYoutubeNode, editorExtension, youtubeEditor };
39
+ /**
40
+ * tiptap → markdown adapter map. Serialises `amplessYoutube` nodes back
41
+ * to a bare `https://youtu.be/<videoId>` URL line so the admin's
42
+ * "format: tiptap → markdown" body switch is lossless. The reverse
43
+ * direction (URL → embed node on paste) is handled by the existing paste
44
+ * rule + `extractSingleUrl` path in the runtime.
45
+ *
46
+ * `update-ampless` reads this export (via namespace import `* as`) and
47
+ * wires it into `installAdminTiptapNodeMarkdown`.
48
+ */
49
+ declare const tiptapNodeToMarkdown: TiptapNodeMarkdownAdapters;
50
+
51
+ export { AmplessYoutubeNode, editorExtension, tiptapNodeToMarkdown, youtubeEditor };
package/dist/editor.js CHANGED
@@ -96,8 +96,16 @@ var youtubeEditor = {
96
96
  extension: AmplessYoutubeNode
97
97
  };
98
98
  var editorExtension = AmplessYoutubeNode;
99
+ var tiptapNodeToMarkdown = {
100
+ amplessYoutube: (node) => {
101
+ const videoId = String(node.attrs?.videoId ?? "").trim();
102
+ if (!videoId) return null;
103
+ return `https://youtu.be/${videoId}`;
104
+ }
105
+ };
99
106
  export {
100
107
  AmplessYoutubeNode,
101
108
  editorExtension,
109
+ tiptapNodeToMarkdown,
102
110
  youtubeEditor
103
111
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampless/plugin-youtube",
3
- "version": "1.0.0-alpha.5",
3
+ "version": "1.0.0-alpha.6",
4
4
  "description": "YouTube embed plugin for ampless — renders youtube.com / youtu.be URLs inline as iframes in tiptap + markdown posts",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "peerDependencies": {
33
33
  "@tiptap/core": "^3",
34
34
  "react": "^18 || ^19",
35
- "ampless": "1.0.0-alpha.44"
35
+ "ampless": "1.0.0-alpha.45"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@tiptap/core": "^3.23.6",