payload-richtext-tiptap 0.0.74 → 0.0.76
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/src/fields/TiptapEditor/extensions/SlashCommand/groups.js +21 -25
- package/dist/src/fields/TiptapEditor/extensions/SlashCommand/groups.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockViewClientside.d.ts +33 -0
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockViewClientside.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockViewClientside.js +84 -0
- package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockViewClientside.js.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/extension-kit.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/extension-kit.js +2 -2
- package/dist/src/fields/TiptapEditor/extensions/extension-kit.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/index.js +1 -1
- package/dist/src/fields/TiptapEditor/extensions/index.js.map +1 -1
- package/dist/src/fields/TiptapEditor/extensions/serverside/ContentEmbedSupport.d.ts +4 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/ContentEmbedSupport.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/ContentEmbedSupport.js +91 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/ContentEmbedSupport.js.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/FacebookServerside.d.ts +3 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/FacebookServerside.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/FacebookServerside.js +34 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/FacebookServerside.js.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/ImageBlockServerside.d.ts +3 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/ImageBlockServerside.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/ImageBlockServerside.js +64 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/ImageBlockServerside.js.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/InstagramServerside.d.ts +3 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/InstagramServerside.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/InstagramServerside.js +34 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/InstagramServerside.js.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/LinkedinServerside.d.ts +3 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/LinkedinServerside.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/LinkedinServerside.js +34 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/LinkedinServerside.js.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/ServersideTiptapBody.d.ts +7 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/ServersideTiptapBody.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/ServersideTiptapBody.js +87 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/ServersideTiptapBody.js.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/TiktokServerside.d.ts +3 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/TiktokServerside.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/TiktokServerside.js +34 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/TiktokServerside.js.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/TwitterBlockServerside.d.ts +3 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/TwitterBlockServerside.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/TwitterBlockServerside.js +34 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/TwitterBlockServerside.js.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/VideoBlockServerside.d.ts +52 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/VideoBlockServerside.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/VideoBlockServerside.js +95 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/VideoBlockServerside.js.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/YouTubeServerside.d.ts +3 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/YouTubeServerside.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/YouTubeServerside.js +34 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/YouTubeServerside.js.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/index.d.ts +12 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/index.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/index.js +13 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/index.js.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/useAppendIdToClientsideBlocks.d.ts +2 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/useAppendIdToClientsideBlocks.d.ts.map +1 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/useAppendIdToClientsideBlocks.js +23 -0
- package/dist/src/fields/TiptapEditor/extensions/serverside/useAppendIdToClientsideBlocks.js.map +1 -0
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.js +2 -6
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuCommands.d.ts +0 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuCommands.d.ts.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuCommands.js +10 -9
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuCommands.js.map +1 -1
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuContentTypes.js +1 -24
- package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuContentTypes.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/styles.css +74 -74
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -40
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Facebook, Heading1, Heading2, Heading3, Image, Instagram,
|
|
1
|
+
import { Facebook, Heading1, Heading2, Heading3, Image, Instagram, Minus, Music, Quote, Twitter, Video, Youtube } from "lucide-react";
|
|
2
2
|
import i18next from "i18next";
|
|
3
3
|
export const GROUPS = [
|
|
4
4
|
{
|
|
@@ -47,30 +47,26 @@ export const GROUPS = [
|
|
|
47
47
|
}).run();
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
action: (editor)=>{
|
|
71
|
-
editor.chain().focus().toggleOrderedList().run();
|
|
72
|
-
}
|
|
73
|
-
},
|
|
50
|
+
// {
|
|
51
|
+
// name: "bulletList",
|
|
52
|
+
// label: i18next.t("bulletList") || 'Bullet List',
|
|
53
|
+
// description:i18next.t("bulletListDesc") || "Unordered list of items",
|
|
54
|
+
// icon: List,
|
|
55
|
+
// aliases: ["ul"],
|
|
56
|
+
// action: (editor) => {
|
|
57
|
+
// editor.chain().focus().toggleBulletList().run();
|
|
58
|
+
// },
|
|
59
|
+
// },
|
|
60
|
+
// {
|
|
61
|
+
// name: "numberedList",
|
|
62
|
+
// label: i18next.t("numberedList") || 'Numbered List',
|
|
63
|
+
// description:i18next.t("numberedListDesc") || "Ordered list of items",
|
|
64
|
+
// icon: ListOrdered,
|
|
65
|
+
// aliases: ["ol"],
|
|
66
|
+
// action: (editor) => {
|
|
67
|
+
// editor.chain().focus().toggleOrderedList().run();
|
|
68
|
+
// },
|
|
69
|
+
// },
|
|
74
70
|
{
|
|
75
71
|
name: "blockquote",
|
|
76
72
|
label: i18next.t("blockquote") || 'Blockquote',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/SlashCommand/groups.ts"],"sourcesContent":["import {\n Facebook,\n Heading1,\n Heading2,\n Heading3,\n Image,\n Instagram,\n List,\n ListOrdered,\n Minus,\n Music,\n Quote,\n Twitter,\n Video,\n Youtube,\n} from \"lucide-react\";\nimport { Group } from \"./types.js\";\nimport i18next from \"i18next\";\n\nexport const GROUPS: Group[] = [\n {\n name: \"format\",\n title: i18next.t(\"format\") || \"Format\",\n commands: [\n {\n name: \"heading1\",\n label: i18next.t(\"heading1\") || 'Heading 1',\n description:i18next.t(\"heading1Desc\") || \"High priority section title\",\n icon: Heading1,\n aliases: [\"h1\"],\n action: (editor) => {\n editor.chain().focus().setHeading({ level: 1 }).run();\n },\n },\n {\n name: \"heading2\",\n label: i18next.t(\"heading2\") || 'Heading 2',\n description:i18next.t(\"heading2Desc\") || \"Medium priority section title\",\n icon: Heading2,\n aliases: [\"h2\"],\n action: (editor) => {\n editor.chain().focus().setHeading({ level: 2 }).run();\n },\n },\n {\n name: \"heading3\",\n label: i18next.t(\"heading3\") || 'Heading 3',\n description:i18next.t(\"heading3Desc\") || \"Low priority section title\",\n icon: Heading3,\n aliases: [\"h3\"],\n action: (editor) => {\n editor.chain().focus().setHeading({ level: 3 }).run();\n },\n },\n {\n name: \"bulletList\",\n label: i18next.t(\"bulletList\") || 'Bullet List',\n description:i18next.t(\"bulletListDesc\") || \"Unordered list of items\",\n icon: List,\n aliases: [\"ul\"],\n action: (editor) => {\n editor.chain().focus().toggleBulletList().run();\n },\n },\n {\n name: \"numberedList\",\n label: i18next.t(\"numberedList\") || 'Numbered List',\n description:i18next.t(\"numberedListDesc\") || \"Ordered list of items\",\n icon: ListOrdered,\n aliases: [\"ol\"],\n action: (editor) => {\n editor.chain().focus().toggleOrderedList().run();\n },\n },\n\n {\n name: \"blockquote\",\n label: i18next.t(\"blockquote\") || 'Blockquote',\n description:i18next.t(\"blockquoteDesc\") || \"Element for quoting\",\n icon: Quote,\n action: (editor) => {\n editor.chain().focus().setBlockquote().run();\n },\n },\n ],\n },\n {\n name: \"insert\",\n title: \"Insert\",\n commands: [\n {\n name: \"image\",\n label: i18next.t(\"image\") || 'Image',\n description:i18next.t(\"imageDesc\") || \"Insert an image\",\n icon: Image,\n aliases: [\"img\"],\n action: (editor) => {\n editor.chain().focus().setImageUpload(\"image\").run();\n },\n },\n {\n name: \"video\",\n label: i18next.t(\"video\") || 'Video',\n description:i18next.t(\"videoDesc\") || \"Insert a video\",\n icon: Video,\n aliases: [\"video\"],\n action: (editor) => {\n editor.chain().focus().setImageUpload(\"video\").run();\n },\n },\n\n {\n name: \"horizontalRule\",\n label: i18next.t(\"horizontalRule\") || 'HorizontalRule',\n description:i18next.t(\"horizontalRuleDesc\") || \"Insert a horizontal divider\",\n icon: Minus,\n aliases: [\"hr\"],\n action: (editor) => {\n editor.chain().focus().setHorizontalRule().run();\n },\n },\n ],\n },\n {\n name: \"embed\",\n title: \"Embed\",\n commands: [\n {\n name: \"twitter\",\n label: i18next.t(\"twitter\") || 'Twitter',\n description:i18next.t(\"twitterDesc\") || \"Insert a Twitter embed\",\n icon: Twitter,\n aliases: [\"x\", \"twitter\"],\n shouldBeHidden: (editor) => editor.isActive(\"twitter\"),\n action: (editor) => {\n editor.chain().focus().insertTwitter().run();\n },\n },\n {\n name: \"facebook\",\n label: i18next.t(\"facebook\") || 'Facebook',\n description:i18next.t(\"facebookDesc\") || \"Insert a Facebook embed\",\n icon: Facebook,\n aliases: [\"meta\", \"facebook\"],\n shouldBeHidden: (editor) => editor.isActive(\"facebook\"),\n action: (editor) => {\n editor.chain().focus().insertFacebook().run();\n },\n },\n {\n name: \"instagram\",\n label: i18next.t(\"instagram\") || 'Instagram',\n description:i18next.t(\"instagramDesc\") || \"Insert a Instagram embed\",\n icon: Instagram,\n aliases: [\"instagram\"],\n shouldBeHidden: (editor) => editor.isActive(\"instagram\"),\n action: (editor) => {\n editor.chain().focus().insertInstagram().run();\n },\n },\n {\n name: \"youtube\",\n label: i18next.t(\"youtube\") || 'Youtube',\n description:i18next.t(\"youtubeDesc\") || \"Insert a Youtube embed\",\n icon: Youtube,\n aliases: [\"youtube\"],\n shouldBeHidden: (editor) => editor.isActive(\"youtube\"),\n action: (editor) => {\n editor.chain().focus().insertYoutube().run();\n },\n },\n\n {\n name: \"tiktok\",\n label: i18next.t(\"tiktok\") || 'Tiktok',\n description:i18next.t(\"tiktokDesc\") || \"Insert a Tiktok embed\",\n icon: Music,\n aliases: [\"tiktok\"],\n shouldBeHidden: (editor) => editor.isActive(\"tiktok\"),\n action: (editor) => {\n editor.chain().focus().insertTiktok().run();\n },\n },\n ],\n },\n];\n\nexport default GROUPS;\n"],"names":["Facebook","Heading1","Heading2","Heading3","Image","Instagram","List","ListOrdered","Minus","Music","Quote","Twitter","Video","Youtube","i18next","GROUPS","name","title","t","commands","label","description","icon","aliases","action","editor","chain","focus","setHeading","level","run","toggleBulletList","toggleOrderedList","setBlockquote","setImageUpload","setHorizontalRule","shouldBeHidden","isActive","insertTwitter","insertFacebook","insertInstagram","insertYoutube","insertTiktok"],"mappings":"AAAA,SACEA,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EACLC,SAAS,EACTC,IAAI,EACJC,WAAW,EACXC,KAAK,EACLC,KAAK,EACLC,KAAK,EACLC,OAAO,EACPC,KAAK,EACLC,OAAO,QACF,eAAe;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I,CAAC,CAAC,aAAa;gBAC9BG,aAAYP,QAAQI,CAAC,CAAC,iBAAiB;gBACvCI,MAAMb;gBACNc,SAAS;oBAAC;iBAAS;gBACnBa,gBAAgB,CAACX,SAAWA,OAAOY,QAAQ,CAAC;gBAC5Cb,QAAQ,CAACC;oBACPA,OAAOC,KAAK,GAAGC,KAAK,GAAGe,YAAY,GAAGZ,GAAG;gBAC3C;YACF;SACD;IACH;CACD,CAAC;AAEF,eAAef,OAAO"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/SlashCommand/groups.ts"],"sourcesContent":["import {\n Facebook,\n Heading1,\n Heading2,\n Heading3,\n Image,\n Instagram,\n List,\n ListOrdered,\n Minus,\n Music,\n Quote,\n Twitter,\n Video,\n Youtube,\n} from \"lucide-react\";\nimport { Group } from \"./types.js\";\nimport i18next from \"i18next\";\n\nexport const GROUPS: Group[] = [\n {\n name: \"format\",\n title: i18next.t(\"format\") || \"Format\",\n commands: [\n {\n name: \"heading1\",\n label: i18next.t(\"heading1\") || 'Heading 1',\n description:i18next.t(\"heading1Desc\") || \"High priority section title\",\n icon: Heading1,\n aliases: [\"h1\"],\n action: (editor) => {\n editor.chain().focus().setHeading({ level: 1 }).run();\n },\n },\n {\n name: \"heading2\",\n label: i18next.t(\"heading2\") || 'Heading 2',\n description:i18next.t(\"heading2Desc\") || \"Medium priority section title\",\n icon: Heading2,\n aliases: [\"h2\"],\n action: (editor) => {\n editor.chain().focus().setHeading({ level: 2 }).run();\n },\n },\n {\n name: \"heading3\",\n label: i18next.t(\"heading3\") || 'Heading 3',\n description:i18next.t(\"heading3Desc\") || \"Low priority section title\",\n icon: Heading3,\n aliases: [\"h3\"],\n action: (editor) => {\n editor.chain().focus().setHeading({ level: 3 }).run();\n },\n },\n // {\n // name: \"bulletList\",\n // label: i18next.t(\"bulletList\") || 'Bullet List',\n // description:i18next.t(\"bulletListDesc\") || \"Unordered list of items\",\n // icon: List,\n // aliases: [\"ul\"],\n // action: (editor) => {\n // editor.chain().focus().toggleBulletList().run();\n // },\n // },\n // {\n // name: \"numberedList\",\n // label: i18next.t(\"numberedList\") || 'Numbered List',\n // description:i18next.t(\"numberedListDesc\") || \"Ordered list of items\",\n // icon: ListOrdered,\n // aliases: [\"ol\"],\n // action: (editor) => {\n // editor.chain().focus().toggleOrderedList().run();\n // },\n // },\n\n {\n name: \"blockquote\",\n label: i18next.t(\"blockquote\") || 'Blockquote',\n description:i18next.t(\"blockquoteDesc\") || \"Element for quoting\",\n icon: Quote,\n action: (editor) => {\n editor.chain().focus().setBlockquote().run();\n },\n },\n ],\n },\n {\n name: \"insert\",\n title: \"Insert\",\n commands: [\n {\n name: \"image\",\n label: i18next.t(\"image\") || 'Image',\n description:i18next.t(\"imageDesc\") || \"Insert an image\",\n icon: Image,\n aliases: [\"img\"],\n action: (editor) => {\n editor.chain().focus().setImageUpload(\"image\").run();\n },\n },\n {\n name: \"video\",\n label: i18next.t(\"video\") || 'Video',\n description:i18next.t(\"videoDesc\") || \"Insert a video\",\n icon: Video,\n aliases: [\"video\"],\n action: (editor) => {\n editor.chain().focus().setImageUpload(\"video\").run();\n },\n },\n\n {\n name: \"horizontalRule\",\n label: i18next.t(\"horizontalRule\") || 'HorizontalRule',\n description:i18next.t(\"horizontalRuleDesc\") || \"Insert a horizontal divider\",\n icon: Minus,\n aliases: [\"hr\"],\n action: (editor) => {\n editor.chain().focus().setHorizontalRule().run();\n },\n },\n ],\n },\n {\n name: \"embed\",\n title: \"Embed\",\n commands: [\n {\n name: \"twitter\",\n label: i18next.t(\"twitter\") || 'Twitter',\n description:i18next.t(\"twitterDesc\") || \"Insert a Twitter embed\",\n icon: Twitter,\n aliases: [\"x\", \"twitter\"],\n shouldBeHidden: (editor) => editor.isActive(\"twitter\"),\n action: (editor) => {\n editor.chain().focus().insertTwitter().run();\n },\n },\n {\n name: \"facebook\",\n label: i18next.t(\"facebook\") || 'Facebook',\n description:i18next.t(\"facebookDesc\") || \"Insert a Facebook embed\",\n icon: Facebook,\n aliases: [\"meta\", \"facebook\"],\n shouldBeHidden: (editor) => editor.isActive(\"facebook\"),\n action: (editor) => {\n editor.chain().focus().insertFacebook().run();\n },\n },\n {\n name: \"instagram\",\n label: i18next.t(\"instagram\") || 'Instagram',\n description:i18next.t(\"instagramDesc\") || \"Insert a Instagram embed\",\n icon: Instagram,\n aliases: [\"instagram\"],\n shouldBeHidden: (editor) => editor.isActive(\"instagram\"),\n action: (editor) => {\n editor.chain().focus().insertInstagram().run();\n },\n },\n {\n name: \"youtube\",\n label: i18next.t(\"youtube\") || 'Youtube',\n description:i18next.t(\"youtubeDesc\") || \"Insert a Youtube embed\",\n icon: Youtube,\n aliases: [\"youtube\"],\n shouldBeHidden: (editor) => editor.isActive(\"youtube\"),\n action: (editor) => {\n editor.chain().focus().insertYoutube().run();\n },\n },\n\n {\n name: \"tiktok\",\n label: i18next.t(\"tiktok\") || 'Tiktok',\n description:i18next.t(\"tiktokDesc\") || \"Insert a Tiktok embed\",\n icon: Music,\n aliases: [\"tiktok\"],\n shouldBeHidden: (editor) => editor.isActive(\"tiktok\"),\n action: (editor) => {\n editor.chain().focus().insertTiktok().run();\n },\n },\n ],\n },\n];\n\nexport default GROUPS;\n"],"names":["Facebook","Heading1","Heading2","Heading3","Image","Instagram","Minus","Music","Quote","Twitter","Video","Youtube","i18next","GROUPS","name","title","t","commands","label","description","icon","aliases","action","editor","chain","focus","setHeading","level","run","setBlockquote","setImageUpload","setHorizontalRule","shouldBeHidden","isActive","insertTwitter","insertFacebook","insertInstagram","insertYoutube","insertTiktok"],"mappings":"AAAA,SACEA,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EACLC,SAAS,EAGTC,KAAK,EACLC,KAAK,EACLC,KAAK,EACLC,OAAO,EACPC,KAAK,EACLC,OAAO,QACF,eAAe;AAEtB,OAAOC,aAAa,UAAU;AAE9B,OAAO,MAAMC,SAAkB;IAC7B;QACEC,MAAM;QACNC,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/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockViewClientside.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Node } from "@tiptap/pm/model";
|
|
2
|
+
import { Editor } from "@tiptap/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
interface VideoBlockViewProps {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
getPos: () => number;
|
|
7
|
+
node: Node & {
|
|
8
|
+
attrs: {
|
|
9
|
+
src: string;
|
|
10
|
+
poster: string;
|
|
11
|
+
assetId: string;
|
|
12
|
+
playlistUrl?: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
updateAttributes: (attrs: Record<string, string>) => void;
|
|
16
|
+
}
|
|
17
|
+
export type Playlist = {
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
description: string;
|
|
21
|
+
poster: string;
|
|
22
|
+
items: Item[];
|
|
23
|
+
};
|
|
24
|
+
export type Item = {
|
|
25
|
+
src: string;
|
|
26
|
+
type: string;
|
|
27
|
+
label: string;
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
|
31
|
+
export declare const VideoBlockViewClientside: (props: VideoBlockViewProps) => React.JSX.Element;
|
|
32
|
+
export default VideoBlockViewClientside;
|
|
33
|
+
//# sourceMappingURL=VideoBlockViewClientside.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VideoBlockViewClientside.d.ts","sourceRoot":"","sources":["../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockViewClientside.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,MAAM,EAAmB,MAAM,eAAe,CAAC;AACxD,OAAO,KAAkD,MAAM,OAAO,CAAC;AAIvE,UAAU,mBAAmB;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,MAAM,CAAC;IACrB,IAAI,EAAE,IAAI,GAAG;QACX,KAAK,EAAE;YACL,GAAG,EAAE,MAAM,CAAC;YACZ,MAAM,EAAE,MAAM,CAAC;YACf,OAAO,EAAE,MAAM,CAAC;YAChB,WAAW,CAAC,EAAE,MAAM,CAAC;SACtB,CAAC;KACH,CAAC;IACF,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC;CAC3D;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,wBAAwB,UAAW,mBAAmB,sBA+FlE,CAAC;AAEF,eAAe,wBAAwB,CAAC"}
|
package/dist/src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockViewClientside.js
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { NodeViewWrapper } from "@tiptap/react";
|
|
3
|
+
import React, { useEffect, useMemo, useRef } from "react";
|
|
4
|
+
import { cn } from "../../../lib/utils/index.js";
|
|
5
|
+
import VideoPlayer from "./videojs/VideoPlayer.js";
|
|
6
|
+
export const VideoBlockViewClientside = (props)=>{
|
|
7
|
+
const { node } = props;
|
|
8
|
+
const videoWrapperRef = useRef(null);
|
|
9
|
+
const { src, poster, playlistUrl, caption } = node.attrs;
|
|
10
|
+
const [playlistContent, setPlaylistContent] = React.useState();
|
|
11
|
+
const [error, setError] = React.useState();
|
|
12
|
+
useEffect(()=>{
|
|
13
|
+
async function getPlaylistContent() {
|
|
14
|
+
const res = await fetch(playlistUrl, {
|
|
15
|
+
cache: "no-cache"
|
|
16
|
+
});
|
|
17
|
+
return await res.json();
|
|
18
|
+
}
|
|
19
|
+
if (playlistUrl) {
|
|
20
|
+
try {
|
|
21
|
+
getPlaylistContent().then((data)=>{
|
|
22
|
+
setPlaylistContent(data);
|
|
23
|
+
}).catch((err)=>{
|
|
24
|
+
setError(err);
|
|
25
|
+
});
|
|
26
|
+
} catch (error) {
|
|
27
|
+
setError(error);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, [
|
|
31
|
+
playlistUrl
|
|
32
|
+
]);
|
|
33
|
+
const wrapperClassName = cn(node.attrs.align === "left" ? "ml-0" : "ml-auto", node.attrs.align === "right" ? "mr-0" : "mr-auto", node.attrs.align === "center" && "mx-auto");
|
|
34
|
+
const videoJsOptions = useMemo(()=>{
|
|
35
|
+
if (playlistContent == undefined) return {};
|
|
36
|
+
if (playlistContent.items.some((item)=>item.type === "application/x-mpegURL" || item.type === "application/vnd.apple.mpegurl")) {
|
|
37
|
+
return {
|
|
38
|
+
sources: playlistContent.items.filter((item)=>item.type === "application/x-mpegURL" || item.type === "application/vnd.apple.mpegurl").map((item)=>({
|
|
39
|
+
src: item.src,
|
|
40
|
+
type: item.type,
|
|
41
|
+
label: item.label
|
|
42
|
+
})),
|
|
43
|
+
poster: playlistContent.poster
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
sources: playlistContent.items.map((item)=>({
|
|
48
|
+
src: item.src,
|
|
49
|
+
type: item.type,
|
|
50
|
+
label: item.label
|
|
51
|
+
})),
|
|
52
|
+
poster: playlistContent.poster
|
|
53
|
+
};
|
|
54
|
+
}, [
|
|
55
|
+
playlistContent
|
|
56
|
+
]);
|
|
57
|
+
return /*#__PURE__*/ _jsx(NodeViewWrapper, {
|
|
58
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
59
|
+
className: wrapperClassName,
|
|
60
|
+
style: {
|
|
61
|
+
width: node.attrs.width
|
|
62
|
+
},
|
|
63
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
64
|
+
contentEditable: false,
|
|
65
|
+
ref: videoWrapperRef,
|
|
66
|
+
children: [
|
|
67
|
+
error && /*#__PURE__*/ _jsx("div", {
|
|
68
|
+
children: error
|
|
69
|
+
}),
|
|
70
|
+
playlistContent && /*#__PURE__*/ _jsx(VideoPlayer, {
|
|
71
|
+
options: videoJsOptions
|
|
72
|
+
}),
|
|
73
|
+
caption && playlistContent?.title && /*#__PURE__*/ _jsx("caption", {
|
|
74
|
+
className: "text-center block text-sm text-gray-500",
|
|
75
|
+
children: playlistContent?.title
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
export default VideoBlockViewClientside;
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=VideoBlockViewClientside.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/extensions/VideoBlock/components/VideoBlockViewClientside.tsx"],"sourcesContent":["import { Node } from \"@tiptap/pm/model\";\nimport { Editor, NodeViewWrapper } from \"@tiptap/react\";\nimport React, { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { cn } from \"../../../lib/utils/index.js\";\nimport VideoPlayer from \"./videojs/VideoPlayer.js\";\n\ninterface VideoBlockViewProps {\n editor: Editor;\n getPos: () => number;\n node: Node & {\n attrs: {\n src: string;\n poster: string;\n assetId: string;\n playlistUrl?: string;\n };\n };\n updateAttributes: (attrs: Record<string, string>) => void;\n}\n\nexport type Playlist = {\n id: string;\n title: string;\n description: string;\n poster: string;\n items: Item[];\n};\n\nexport type Item = {\n src: string;\n type: string;\n label: string;\n width: number;\n height: number;\n};\n\nexport const VideoBlockViewClientside = (props: VideoBlockViewProps) => {\n const { node } = props;\n const videoWrapperRef = useRef<HTMLDivElement>(null);\n const { src, poster, playlistUrl, caption } = node.attrs;\n const [playlistContent, setPlaylistContent] = React.useState<\n Playlist | undefined\n >();\n const [error, setError] = React.useState();\n\n useEffect(() => {\n async function getPlaylistContent() {\n const res = await fetch(playlistUrl, {\n cache: \"no-cache\",\n });\n return await res.json();\n }\n\n if (playlistUrl) {\n try {\n getPlaylistContent()\n .then((data) => {\n setPlaylistContent(data);\n })\n .catch((err) => {\n setError(err);\n });\n } catch (error) {\n setError(error);\n }\n }\n }, [playlistUrl]);\n\n const wrapperClassName = cn(\n node.attrs.align === \"left\" ? \"ml-0\" : \"ml-auto\",\n node.attrs.align === \"right\" ? \"mr-0\" : \"mr-auto\",\n node.attrs.align === \"center\" && \"mx-auto\"\n );\n\n const videoJsOptions = useMemo(() => {\n if (playlistContent == undefined) return {};\n\n if (\n playlistContent.items.some(\n (item) =>\n item.type === \"application/x-mpegURL\" ||\n item.type === \"application/vnd.apple.mpegurl\"\n )\n ) {\n return {\n sources: playlistContent.items\n .filter(\n (item) =>\n item.type === \"application/x-mpegURL\" ||\n item.type === \"application/vnd.apple.mpegurl\"\n )\n .map((item) => ({\n src: item.src,\n type: item.type,\n label: item.label,\n })),\n poster: playlistContent.poster,\n };\n }\n return {\n sources: playlistContent.items.map((item) => ({\n src: item.src,\n type: item.type,\n label: item.label,\n })),\n poster: playlistContent.poster,\n };\n }, [playlistContent]);\n return (\n <NodeViewWrapper>\n <div className={wrapperClassName} style={{ width: node.attrs.width }}>\n <div contentEditable={false} ref={videoWrapperRef}>\n {error && <div>{error}</div>}\n {/* <video\n controls\n className=\"block\"\n src={src}\n poster={poster}\n title=\"\"\n onClick={onClick}\n /> */}\n {playlistContent && <VideoPlayer options={videoJsOptions} />}\n {caption && playlistContent?.title && (\n <caption className=\"text-center block text-sm text-gray-500\">\n {playlistContent?.title}\n </caption>\n )}\n </div>\n </div>\n </NodeViewWrapper>\n );\n};\n\nexport default VideoBlockViewClientside;\n"],"names":["NodeViewWrapper","React","useEffect","useMemo","useRef","cn","VideoPlayer","VideoBlockViewClientside","props","node","videoWrapperRef","src","poster","playlistUrl","caption","attrs","playlistContent","setPlaylistContent","useState","error","setError","getPlaylistContent","res","fetch","cache","json","then","data","catch","err","wrapperClassName","align","videoJsOptions","undefined","items","some","item","type","sources","filter","map","label","div","className","style","width","contentEditable","ref","options","title"],"mappings":";AACA,SAAiBA,eAAe,QAAQ,gBAAgB;AACxD,OAAOC,SAAsBC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,QAAQ;AACvE,SAASC,EAAE,QAAQ,8BAA8B;AACjD,OAAOC,iBAAiB,2BAA2B;AAgCnD,OAAO,MAAMC,2BAA2B,CAACC;IACvC,MAAM,EAAEC,IAAI,EAAE,GAAGD;IACjB,MAAME,kBAAkBN,OAAuB;IAC/C,MAAM,EAAEO,GAAG,EAAEC,MAAM,EAAEC,WAAW,EAAEC,OAAO,EAAE,GAAGL,KAAKM,KAAK;IACxD,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGhB,MAAMiB,QAAQ;IAG5D,MAAM,CAACC,OAAOC,SAAS,GAAGnB,MAAMiB,QAAQ;IAExChB,UAAU;QACR,eAAemB;YACb,MAAMC,MAAM,MAAMC,MAAMV,aAAa;gBACnCW,OAAO;YACT;YACA,OAAO,MAAMF,IAAIG,IAAI;QACvB;QAEA,IAAIZ,aAAa;YACf,IAAI;gBACFQ,qBACGK,IAAI,CAAC,CAACC;oBACLV,mBAAmBU;gBACrB,GACCC,KAAK,CAAC,CAACC;oBACNT,SAASS;gBACX;YACJ,EAAE,OAAOV,OAAO;gBACdC,SAASD;YACX;QACF;IACF,GAAG;QAACN;KAAY;IAEhB,MAAMiB,mBAAmBzB,GACvBI,KAAKM,KAAK,CAACgB,KAAK,KAAK,SAAS,SAAS,WACvCtB,KAAKM,KAAK,CAACgB,KAAK,KAAK,UAAU,SAAS,WACxCtB,KAAKM,KAAK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extensions/extension-kit.ts"],"names":[],"mappings":"AA8CA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,UAAU,iBAAiB;IACzB,kBAAkB,EAAE,eAAe,CAAC;CACrC;
|
|
1
|
+
{"version":3,"file":"extension-kit.d.ts","sourceRoot":"","sources":["../../../../../src/fields/TiptapEditor/extensions/extension-kit.ts"],"names":[],"mappings":"AA8CA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,UAAU,iBAAiB;IACzB,kBAAkB,EAAE,eAAe,CAAC;CACrC;AAGD,eAAO,MAAM,YAAY,4BAEtB,iBAAiB,+LA4GjB,CAAC;AAEJ,eAAe,YAAY,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AICommand, AudioBlock, BlockquoteFigure, CharacterCount, Color, Document, Dropcursor, Facebook, Figcaption, FileHandler, Focus,
|
|
1
|
+
import { AICommand, AudioBlock, BlockquoteFigure, CharacterCount, Color, Document, Dropcursor, Facebook, Figcaption, FileHandler, Focus, FontSize, Heading, Highlight, HorizontalRule, ImageBlock, InsideLinks, Instagram, Link, Linkedin, Placeholder, Selection, SlashCommand, StarterKit, Subscript, Superscript, TaskItem, TaskList, TextAlign, TextStyle, Tiktok, TrailingNode, Twitter, Typography, Underline, VideoBlock, Youtube } from "./index.js";
|
|
2
2
|
import { ImageUpload } from "./ImageUpload/ImageUpload.js";
|
|
3
3
|
import History from "@tiptap/extension-history";
|
|
4
4
|
import { Markdown } from "tiptap-markdown";
|
|
@@ -33,7 +33,7 @@ export const ExtensionKit = ({ openAssetHQHandler })=>[
|
|
|
33
33
|
}),
|
|
34
34
|
TextStyle,
|
|
35
35
|
FontSize,
|
|
36
|
-
FontFamily,
|
|
36
|
+
// FontFamily,
|
|
37
37
|
Color,
|
|
38
38
|
TrailingNode,
|
|
39
39
|
Link.configure({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/fields/TiptapEditor/extensions/extension-kit.ts"],"sourcesContent":["import {\n AICommand,\n AudioBlock,\n BlockquoteFigure,\n CharacterCount,\n Color,\n Document,\n Dropcursor,\n Facebook,\n Figcaption,\n FileHandler,\n Focus,\n FontFamily,\n FontSize,\n Heading,\n Highlight,\n HorizontalRule,\n ImageBlock,\n InsideLinks,\n Instagram,\n Link,\n Linkedin,\n Placeholder,\n Selection,\n SlashCommand,\n StarterKit,\n Subscript,\n Superscript,\n TaskItem,\n TaskList,\n TextAlign,\n TextStyle,\n Tiktok,\n TrailingNode,\n Twitter,\n Typography,\n Underline,\n VideoBlock,\n Youtube,\n} from \"./index.js\";\n\nimport { ImageUpload } from \"./ImageUpload/ImageUpload.js\";\n\nimport History from \"@tiptap/extension-history\";\nimport { Markdown } from \"tiptap-markdown\";\nimport API from \"../lib/api.js\";\nimport { openAssetHQType } from \"../types.js\";\nimport i18next from \"i18next\";\n\ninterface ExtensionKitProps {\n openAssetHQHandler: openAssetHQType;\n}\n\nexport const ExtensionKit = ({\n openAssetHQHandler,\n}: ExtensionKitProps) => [\n Markdown,\n Document,\n TaskList,\n TaskItem.configure({\n nested: true,\n }),\n Selection,\n Heading.configure({\n levels: [1, 2, 3, 4, 5, 6],\n }),\n HorizontalRule,\n StarterKit.configure({\n document: false,\n dropcursor: false,\n heading: false,\n horizontalRule: false,\n blockquote: false,\n history: false,\n codeBlock: false,\n }),\n TextStyle,\n FontSize,\n FontFamily,\n Color,\n TrailingNode,\n Link.configure({\n openOnClick: false,\n }),\n Highlight.configure({ multicolor: true }),\n Underline,\n CharacterCount.configure({ limit: 50000 }),\n ImageUpload.configure({\n openAssetHQHandler,\n }),\n ImageBlock,\n VideoBlock,\n AudioBlock,\n FileHandler.configure({\n allowedMimeTypes: [\"image/png\", \"image/jpeg\", \"image/gif\", \"image/webp\"],\n onDrop: (currentEditor, files, pos) => {\n const file = files[0];\n (async () => {\n openAssetHQHandler(\n (asset) => {\n currentEditor\n .chain()\n .setImageBlockAt({ pos, src: asset.fullUrl })\n .focus()\n .run();\n },\n file,\n \"image\"\n );\n })();\n },\n onPaste: (currentEditor, files) => {\n files.forEach(async () => {\n const url = await API.uploadImage();\n\n return currentEditor\n .chain()\n .setImageBlockAt({\n pos: currentEditor.state.selection.anchor,\n src: url,\n })\n .focus()\n .run();\n });\n },\n }),\n // Emoji.configure({\n // enableEmoticons: true,\n // suggestion: emojiSuggestion,\n // }),\n TextAlign.extend({\n addKeyboardShortcuts() {\n return {};\n },\n }).configure({\n types: [\"heading\", \"paragraph\"],\n }),\n Subscript,\n Superscript,\n Typography,\n Placeholder.configure({\n includeChildren: true,\n showOnlyCurrent: false,\n placeholder: () => \"\",\n }),\n SlashCommand,\n Focus,\n Figcaption,\n BlockquoteFigure,\n Dropcursor.configure({\n width: 2,\n class: \"ProseMirror-dropcursor border-black\",\n }),\n History,\n Twitter,\n Tiktok,\n Instagram,\n Facebook,\n Linkedin,\n Youtube,\n InsideLinks,\n AICommand,\n ];\n\nexport default ExtensionKit;\n"],"names":["AICommand","AudioBlock","BlockquoteFigure","CharacterCount","Color","Document","Dropcursor","Facebook","Figcaption","FileHandler","Focus","
|
|
1
|
+
{"version":3,"sources":["../../../../../src/fields/TiptapEditor/extensions/extension-kit.ts"],"sourcesContent":["import {\n AICommand,\n AudioBlock,\n BlockquoteFigure,\n CharacterCount,\n Color,\n Document,\n Dropcursor,\n Facebook,\n Figcaption,\n FileHandler,\n Focus,\n FontFamily,\n FontSize,\n Heading,\n Highlight,\n HorizontalRule,\n ImageBlock,\n InsideLinks,\n Instagram,\n Link,\n Linkedin,\n Placeholder,\n Selection,\n SlashCommand,\n StarterKit,\n Subscript,\n Superscript,\n TaskItem,\n TaskList,\n TextAlign,\n TextStyle,\n Tiktok,\n TrailingNode,\n Twitter,\n Typography,\n Underline,\n VideoBlock,\n Youtube,\n} from \"./index.js\";\n\nimport { ImageUpload } from \"./ImageUpload/ImageUpload.js\";\n\nimport History from \"@tiptap/extension-history\";\nimport { Markdown } from \"tiptap-markdown\";\nimport API from \"../lib/api.js\";\nimport { openAssetHQType } from \"../types.js\";\nimport i18next from \"i18next\";\n\ninterface ExtensionKitProps {\n openAssetHQHandler: openAssetHQType;\n}\n\n\nexport const ExtensionKit = ({\n openAssetHQHandler,\n}: ExtensionKitProps) => [\n\n Markdown,\n Document,\n TaskList,\n TaskItem.configure({\n nested: true,\n }),\n Selection,\n Heading.configure({\n levels: [1, 2, 3, 4, 5, 6],\n }),\n HorizontalRule,\n StarterKit.configure({\n document: false,\n dropcursor: false,\n heading: false,\n horizontalRule: false,\n blockquote: false,\n history: false,\n codeBlock: false,\n }),\n TextStyle,\n FontSize,\n // FontFamily,\n Color,\n TrailingNode,\n Link.configure({\n openOnClick: false,\n }),\n Highlight.configure({ multicolor: true }),\n Underline,\n CharacterCount.configure({ limit: 50000 }),\n ImageUpload.configure({\n openAssetHQHandler,\n }),\n ImageBlock,\n VideoBlock,\n AudioBlock,\n FileHandler.configure({\n allowedMimeTypes: [\"image/png\", \"image/jpeg\", \"image/gif\", \"image/webp\"],\n onDrop: (currentEditor, files, pos) => {\n const file = files[0];\n (async () => {\n openAssetHQHandler(\n (asset) => {\n currentEditor\n .chain()\n .setImageBlockAt({ pos, src: asset.fullUrl })\n .focus()\n .run();\n },\n file,\n \"image\"\n );\n })();\n },\n onPaste: (currentEditor, files) => {\n files.forEach(async () => {\n const url = await API.uploadImage();\n\n return currentEditor\n .chain()\n .setImageBlockAt({\n pos: currentEditor.state.selection.anchor,\n src: url,\n })\n .focus()\n .run();\n });\n },\n }),\n // Emoji.configure({\n // enableEmoticons: true,\n // suggestion: emojiSuggestion,\n // }),\n TextAlign.extend({\n addKeyboardShortcuts() {\n return {};\n },\n }).configure({\n types: [\"heading\", \"paragraph\"],\n }),\n Subscript,\n Superscript,\n Typography,\n Placeholder.configure({\n includeChildren: true,\n showOnlyCurrent: false,\n placeholder: () => \"\",\n }),\n SlashCommand,\n Focus,\n Figcaption,\n BlockquoteFigure,\n Dropcursor.configure({\n width: 2,\n class: \"ProseMirror-dropcursor border-black\",\n }),\n History,\n Twitter,\n Tiktok,\n Instagram,\n Facebook,\n Linkedin,\n Youtube,\n InsideLinks,\n AICommand,\n ];\n\nexport default ExtensionKit;\n"],"names":["AICommand","AudioBlock","BlockquoteFigure","CharacterCount","Color","Document","Dropcursor","Facebook","Figcaption","FileHandler","Focus","FontSize","Heading","Highlight","HorizontalRule","ImageBlock","InsideLinks","Instagram","Link","Linkedin","Placeholder","Selection","SlashCommand","StarterKit","Subscript","Superscript","TaskItem","TaskList","TextAlign","TextStyle","Tiktok","TrailingNode","Twitter","Typography","Underline","VideoBlock","Youtube","ImageUpload","History","Markdown","API","ExtensionKit","openAssetHQHandler","configure","nested","levels","document","dropcursor","heading","horizontalRule","blockquote","history","codeBlock","openOnClick","multicolor","limit","allowedMimeTypes","onDrop","currentEditor","files","pos","file","asset","chain","setImageBlockAt","src","fullUrl","focus","run","onPaste","forEach","url","uploadImage","state","selection","anchor","extend","addKeyboardShortcuts","types","includeChildren","showOnlyCurrent","placeholder","width","class"],"mappings":"AAAA,SACEA,SAAS,EACTC,UAAU,EACVC,gBAAgB,EAChBC,cAAc,EACdC,KAAK,EACLC,QAAQ,EACRC,UAAU,EACVC,QAAQ,EACRC,UAAU,EACVC,WAAW,EACXC,KAAK,EAELC,QAAQ,EACRC,OAAO,EACPC,SAAS,EACTC,cAAc,EACdC,UAAU,EACVC,WAAW,EACXC,SAAS,EACTC,IAAI,EACJC,QAAQ,EACRC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,UAAU,EACVC,SAAS,EACTC,WAAW,EACXC,QAAQ,EACRC,QAAQ,EACRC,SAAS,EACTC,SAAS,EACTC,MAAM,EACNC,YAAY,EACZC,OAAO,EACPC,UAAU,EACVC,SAAS,EACTC,UAAU,EACVC,OAAO,QACF,aAAa;AAEpB,SAASC,WAAW,QAAQ,+BAA+B;AAE3D,OAAOC,aAAa,4BAA4B;AAChD,SAASC,QAAQ,QAAQ,kBAAkB;AAC3C,OAAOC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AA2B;QAC3B,iCAAiC;QACjC,MAAM;QACNxC,UAAUgD,MAAM,CAAC;YACfC;gBACE,OAAO,CAAC;YACV;QACF,GAAGlC,SAAS,CAAC;YACXmC,OAAO;gBAAC;gBAAW;aAAY;QACjC;QACAtD;QACAC;QACAQ;QACAb,YAAYuB,SAAS,CAAC;YACpBoC,iBAAiB;YACjBC,iBAAiB;YACjBC,aAAa,IAAM;QACrB;QACA3D;QACAZ;QACAF;QACAN;QACAI,WAAWqC,SAAS,CAAC;YACnBuC,OAAO;YACPC,OAAO;QACT;QACA7C;QACAN;QACAF;QACAb;QACAV;QACAY;QACAiB;QACApB;QACAhB;KACD,CAAC;AAEJ,eAAeyC,aAAa"}
|
|
@@ -45,6 +45,6 @@ export { Columns, Column } from "./MultiColumn/index.js";
|
|
|
45
45
|
export { AICommand } from "./AICommand/AICommand.js";
|
|
46
46
|
export { Twitter, Linkedin, Tiktok, Facebook, Instagram, Youtube } from "./SocialMedia/index.js";
|
|
47
47
|
export { Paragraph } from "./Paragraph/Paragraph.js";
|
|
48
|
-
export { InsideLinks } from "./InsideLinks/insideLinks.js";
|
|
48
|
+
export { InsideLinks } from "./InsideLinks/insideLinks.js"; // export * from "./serverside/index.js";
|
|
49
49
|
|
|
50
50
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/fields/TiptapEditor/extensions/index.ts"],"sourcesContent":["// TODO: File causes circular dependency issue in ESLint\n/* eslint-disable */\nexport { StarterKit } from \"@tiptap/starter-kit\";\nexport { Highlight } from \"@tiptap/extension-highlight\";\nexport { CharacterCount } from \"@tiptap/extension-character-count\";\nexport { Underline } from \"@tiptap/extension-underline\";\nexport { Placeholder } from \"@tiptap/extension-placeholder\";\nexport { Emoji, gitHubEmojis } from \"@tiptap-pro/extension-emoji\";\nexport { TextAlign } from \"@tiptap/extension-text-align\";\nexport { TextStyle } from \"@tiptap/extension-text-style\";\nexport { FontFamily } from \"@tiptap/extension-font-family\";\nexport { Typography } from \"@tiptap/extension-typography\";\nexport { Color } from \"@tiptap/extension-color\";\nexport { FocusClasses as Focus } from \"@tiptap/extension-focus\";\nexport { Dropcursor } from \"@tiptap/extension-dropcursor\";\nexport { CollaborationCursor } from \"@tiptap/extension-collaboration-cursor\";\nexport { Subscript } from \"@tiptap/extension-subscript\";\nexport { TableOfContents } from \"@tiptap-pro/extension-table-of-contents\";\nexport { Superscript } from \"@tiptap/extension-superscript\";\nexport { CodeBlock } from \"@tiptap/extension-code-block\";\nexport { BulletList } from \"@tiptap/extension-bullet-list\";\nexport { OrderedList } from \"@tiptap/extension-ordered-list\";\nexport { Collaboration } from \"@tiptap/extension-collaboration\";\nexport { TaskItem } from \"@tiptap/extension-task-item\";\nexport { TaskList } from \"@tiptap/extension-task-list\";\nexport { FileHandler } from \"@tiptap-pro/extension-file-handler\";\n\nexport { Selection } from \"./Selection/Selection.js\";\nexport { Table, TableCell, TableHeader, TableRow } from \"./Table/index.js\";\nexport { HorizontalRule } from \"./HorizontalRule/HorizontalRule.js\";\nexport { Heading } from \"./Heading/Heading.js\";\nexport { Document } from \"./Document/Document.js\";\nexport { TrailingNode } from \"./TrailingNode/trailing-node.js\";\nexport { SlashCommand } from \"./SlashCommand/SlashCommand.js\";\nexport { FontSize } from \"./FontSize/FontSize.js\";\nexport { Figure } from \"./Figure/Figure.js\";\nexport { Figcaption } from \"./Figcaption/Figcaption.js\";\nexport { BlockquoteFigure } from \"./BlockquoteFigure/BlockquoteFigure.js\";\nexport { Quote } from \"./BlockquoteFigure/Quote/Quote.js\";\nexport { QuoteCaption } from \"./BlockquoteFigure/QuoteCaption/QuoteCaption.js\";\nexport { Link } from \"./Link/Link.js\";\nexport { ImageUpload } from \"./ImageUpload/ImageUpload.js\";\nexport { ImageBlock } from \"./ImageBlock/ImageBlock.js\";\nexport { VideoBlock } from \"./VideoBlock/VideoBlock.js\";\nexport { AudioBlock } from \"./AudioBlock/AudioBlock.js\";\n\nexport { Columns, Column } from \"./MultiColumn/index.js\";\nexport { AICommand } from \"./AICommand/AICommand.js\";\nexport {\n Twitter,\n Linkedin,\n Tiktok,\n Facebook,\n Instagram,\n Youtube,\n} from \"./SocialMedia/index.js\";\nexport { Paragraph } from \"./Paragraph/Paragraph.js\";\nexport { InsideLinks } from \"./InsideLinks/insideLinks.js\";\n"],"names":["StarterKit","Highlight","CharacterCount","Underline","Placeholder","Emoji","gitHubEmojis","TextAlign","TextStyle","FontFamily","Typography","Color","FocusClasses","Focus","Dropcursor","CollaborationCursor","Subscript","TableOfContents","Superscript","CodeBlock","BulletList","OrderedList","Collaboration","TaskItem","TaskList","FileHandler","Selection","Table","TableCell","TableHeader","TableRow","HorizontalRule","Heading","Document","TrailingNode","SlashCommand","FontSize","Figure","Figcaption","BlockquoteFigure","Quote","QuoteCaption","Link","ImageUpload","ImageBlock","VideoBlock","AudioBlock","Columns","Column","AICommand","Twitter","Linkedin","Tiktok","Facebook","Instagram","Youtube","Paragraph","InsideLinks"],"mappings":"AAAA,wDAAwD;AACxD,kBAAkB,GAClB,SAASA,UAAU,QAAQ,sBAAsB;AACjD,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,cAAc,QAAQ,oCAAoC;AACnE,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,WAAW,QAAQ,gCAAgC;AAC5D,SAASC,KAAK,EAAEC,YAAY,QAAQ,8BAA8B;AAClE,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,UAAU,QAAQ,gCAAgC;AAC3D,SAASC,UAAU,QAAQ,+BAA+B;AAC1D,SAASC,KAAK,QAAQ,0BAA0B;AAChD,SAASC,gBAAgBC,KAAK,QAAQ,0BAA0B;AAChE,SAASC,UAAU,QAAQ,+BAA+B;AAC1D,SAASC,mBAAmB,QAAQ,yCAAyC;AAC7E,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,eAAe,QAAQ,0CAA0C;AAC1E,S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ts"],"sourcesContent":["// TODO: File causes circular dependency issue in ESLint\n/* eslint-disable */\nexport { StarterKit } from \"@tiptap/starter-kit\";\nexport { Highlight } from \"@tiptap/extension-highlight\";\nexport { CharacterCount } from \"@tiptap/extension-character-count\";\nexport { Underline } from \"@tiptap/extension-underline\";\nexport { Placeholder } from \"@tiptap/extension-placeholder\";\nexport { Emoji, gitHubEmojis } from \"@tiptap-pro/extension-emoji\";\nexport { TextAlign } from \"@tiptap/extension-text-align\";\nexport { TextStyle } from \"@tiptap/extension-text-style\";\nexport { FontFamily } from \"@tiptap/extension-font-family\";\nexport { Typography } from \"@tiptap/extension-typography\";\nexport { Color } from \"@tiptap/extension-color\";\nexport { FocusClasses as Focus } from \"@tiptap/extension-focus\";\nexport { Dropcursor } from \"@tiptap/extension-dropcursor\";\nexport { CollaborationCursor } from \"@tiptap/extension-collaboration-cursor\";\nexport { Subscript } from \"@tiptap/extension-subscript\";\nexport { TableOfContents } from \"@tiptap-pro/extension-table-of-contents\";\nexport { Superscript } from \"@tiptap/extension-superscript\";\nexport { CodeBlock } from \"@tiptap/extension-code-block\";\nexport { BulletList } from \"@tiptap/extension-bullet-list\";\nexport { OrderedList } from \"@tiptap/extension-ordered-list\";\nexport { Collaboration } from \"@tiptap/extension-collaboration\";\nexport { TaskItem } from \"@tiptap/extension-task-item\";\nexport { TaskList } from \"@tiptap/extension-task-list\";\nexport { FileHandler } from \"@tiptap-pro/extension-file-handler\";\n\nexport { Selection } from \"./Selection/Selection.js\";\nexport { Table, TableCell, TableHeader, TableRow } from \"./Table/index.js\";\nexport { HorizontalRule } from \"./HorizontalRule/HorizontalRule.js\";\nexport { Heading } from \"./Heading/Heading.js\";\nexport { Document } from \"./Document/Document.js\";\nexport { TrailingNode } from \"./TrailingNode/trailing-node.js\";\nexport { SlashCommand } from \"./SlashCommand/SlashCommand.js\";\nexport { FontSize } from \"./FontSize/FontSize.js\";\nexport { Figure } from \"./Figure/Figure.js\";\nexport { Figcaption } from \"./Figcaption/Figcaption.js\";\nexport { BlockquoteFigure } from \"./BlockquoteFigure/BlockquoteFigure.js\";\nexport { Quote } from \"./BlockquoteFigure/Quote/Quote.js\";\nexport { QuoteCaption } from \"./BlockquoteFigure/QuoteCaption/QuoteCaption.js\";\nexport { Link } from \"./Link/Link.js\";\nexport { ImageUpload } from \"./ImageUpload/ImageUpload.js\";\nexport { ImageBlock } from \"./ImageBlock/ImageBlock.js\";\nexport { VideoBlock } from \"./VideoBlock/VideoBlock.js\";\nexport { AudioBlock } from \"./AudioBlock/AudioBlock.js\";\n\nexport { Columns, Column } from \"./MultiColumn/index.js\";\nexport { AICommand } from \"./AICommand/AICommand.js\";\nexport {\n Twitter,\n Linkedin,\n Tiktok,\n Facebook,\n Instagram,\n Youtube,\n} from \"./SocialMedia/index.js\";\nexport { Paragraph } from \"./Paragraph/Paragraph.js\";\nexport { InsideLinks } from \"./InsideLinks/insideLinks.js\";\n\n// export * from \"./serverside/index.js\";\n"],"names":["StarterKit","Highlight","CharacterCount","Underline","Placeholder","Emoji","gitHubEmojis","TextAlign","TextStyle","FontFamily","Typography","Color","FocusClasses","Focus","Dropcursor","CollaborationCursor","Subscript","TableOfContents","Superscript","CodeBlock","BulletList","OrderedList","Collaboration","TaskItem","TaskList","FileHandler","Selection","Table","TableCell","TableHeader","TableRow","HorizontalRule","Heading","Document","TrailingNode","SlashCommand","FontSize","Figure","Figcaption","BlockquoteFigure","Quote","QuoteCaption","Link","ImageUpload","ImageBlock","VideoBlock","AudioBlock","Columns","Column","AICommand","Twitter","Linkedin","Tiktok","Facebook","Instagram","Youtube","Paragraph","InsideLinks"],"mappings":"AAAA,wDAAwD;AACxD,kBAAkB,GAClB,SAASA,UAAU,QAAQ,sBAAsB;AACjD,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,cAAc,QAAQ,oCAAoC;AACnE,SAASC,SAAS,QAAQ,8BAA8B;AACxD,SAASC,WAAW,QAAQ,gCAAgC;AAC5D,SAASC,KAAK,EAAEC,YAAY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Q,6BAA6B;AACxD,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SAASC,UAAU,QAAQ,6BAA6B;AAExD,SAASC,OAAO,EAAEC,MAAM,QAAQ,yBAAyB;AACzD,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SACEC,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,QAAQ,EACRC,SAAS,EACTC,OAAO,QACF,yBAAyB;AAChC,SAASC,SAAS,QAAQ,2BAA2B;AACrD,SAASC,WAAW,QAAQ,+BAA+B,CAE3D,yCAAyC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentEmbedSupport.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/ContentEmbedSupport.tsx"],"names":[],"mappings":"AAgBA,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE;;CAAA,+BAyF3C"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { Portal } from "@radix-ui/react-portal";
|
|
4
|
+
import Image from "next/image.js";
|
|
5
|
+
import { useLayoutEffect, useState } from "react";
|
|
6
|
+
import { FacebookEmbed, InstagramEmbed, LinkedInEmbed, TikTokEmbed, XEmbed, YouTubeEmbed } from "react-social-media-embed";
|
|
7
|
+
import { cn } from "../../lib/utils/index.js";
|
|
8
|
+
import VideoBlockViewClientside from "../VideoBlock/components/VideoBlockViewClientside.js";
|
|
9
|
+
export function ContentEmbedSupport({ body }) {
|
|
10
|
+
const [mounted, setMounted] = useState(false);
|
|
11
|
+
useLayoutEffect(()=>{
|
|
12
|
+
setMounted(true);
|
|
13
|
+
}, []);
|
|
14
|
+
const renderContent = (content)=>{
|
|
15
|
+
// if (!content.attrs.url) return null;
|
|
16
|
+
switch(content.type){
|
|
17
|
+
case "twitter":
|
|
18
|
+
return /*#__PURE__*/ _jsx(XEmbed, {
|
|
19
|
+
url: content.attrs.url,
|
|
20
|
+
width: 325
|
|
21
|
+
});
|
|
22
|
+
case "youtube":
|
|
23
|
+
return /*#__PURE__*/ _jsx(YouTubeEmbed, {
|
|
24
|
+
url: content.attrs.url
|
|
25
|
+
});
|
|
26
|
+
case "instagram":
|
|
27
|
+
return /*#__PURE__*/ _jsx(InstagramEmbed, {
|
|
28
|
+
className: "max-w-[328px]",
|
|
29
|
+
url: content.attrs.url || "",
|
|
30
|
+
width: 328,
|
|
31
|
+
captioned: true
|
|
32
|
+
});
|
|
33
|
+
case "tiktok":
|
|
34
|
+
return /*#__PURE__*/ _jsx(TikTokEmbed, {
|
|
35
|
+
className: "max-w-[328px]",
|
|
36
|
+
url: content.attrs.url || "",
|
|
37
|
+
width: 328
|
|
38
|
+
});
|
|
39
|
+
case "imageBlock":
|
|
40
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
41
|
+
className: cn("relative object-cover", {
|
|
42
|
+
"aspect-video": !content.attrs.height
|
|
43
|
+
}),
|
|
44
|
+
style: {
|
|
45
|
+
width: content.attrs.width || "100%",
|
|
46
|
+
...content.attrs.height ? {
|
|
47
|
+
height: content.attrs.height
|
|
48
|
+
} : {}
|
|
49
|
+
},
|
|
50
|
+
children: /*#__PURE__*/ _jsx(Image, {
|
|
51
|
+
src: content.attrs.src,
|
|
52
|
+
alt: content.attrs.caption || "",
|
|
53
|
+
style: {
|
|
54
|
+
width: content.attrs.width
|
|
55
|
+
},
|
|
56
|
+
fill: true
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
case "videoBlock":
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
return /*#__PURE__*/ _jsx(VideoBlockViewClientside, {
|
|
62
|
+
node: content
|
|
63
|
+
});
|
|
64
|
+
case "facebook":
|
|
65
|
+
return /*#__PURE__*/ _jsx(FacebookEmbed, {
|
|
66
|
+
url: content.attrs.url || "",
|
|
67
|
+
width: 550
|
|
68
|
+
});
|
|
69
|
+
case "linkedin":
|
|
70
|
+
return /*#__PURE__*/ _jsx(LinkedInEmbed, {
|
|
71
|
+
url: content.attrs.url,
|
|
72
|
+
// postUrl="https://www.linkedin.com/posts/peterdiamandis_5-discoveries-the-james-webb-telescope-will-activity-6898694773406875648-z-D7"
|
|
73
|
+
width: 325,
|
|
74
|
+
height: 570
|
|
75
|
+
});
|
|
76
|
+
default:
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
if (!mounted) return null;
|
|
81
|
+
return /*#__PURE__*/ _jsx(_Fragment, {
|
|
82
|
+
children: body.content.filter((content)=>content?.attrs?.["data-id"]).map((content)=>{
|
|
83
|
+
return /*#__PURE__*/ _jsx(Portal, {
|
|
84
|
+
container: document?.querySelector(`[data-id='${content.attrs["data-id"]}']`),
|
|
85
|
+
children: renderContent(content)
|
|
86
|
+
}, `embed-content-${content.attrs["data-id"]}`);
|
|
87
|
+
})
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
//# sourceMappingURL=ContentEmbedSupport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/ContentEmbedSupport.tsx"],"sourcesContent":["\"use client\";\n\nimport { Portal } from \"@radix-ui/react-portal\";\nimport Image from \"next/image.js\";\nimport { useLayoutEffect, useState } from \"react\";\nimport {\n FacebookEmbed,\n InstagramEmbed,\n LinkedInEmbed,\n TikTokEmbed,\n XEmbed,\n YouTubeEmbed,\n} from \"react-social-media-embed\";\nimport { cn } from \"../../lib/utils/index.js\";\nimport VideoBlockViewClientside from \"../VideoBlock/components/VideoBlockViewClientside.js\";\n\nexport function ContentEmbedSupport({ body }) {\n const [mounted, setMounted] = useState(false);\n useLayoutEffect(() => {\n setMounted(true);\n }, []);\n\n const renderContent = (content) => {\n // if (!content.attrs.url) return null;\n\n switch (content.type) {\n case \"twitter\":\n return <XEmbed url={content.attrs.url} width={325} />;\n case \"youtube\":\n return <YouTubeEmbed url={content.attrs.url} />;\n case \"instagram\":\n return (\n <InstagramEmbed\n className=\"max-w-[328px]\"\n url={content.attrs.url || \"\"}\n width={328}\n captioned\n />\n );\n case \"tiktok\":\n return (\n <TikTokEmbed\n className=\"max-w-[328px]\"\n url={content.attrs.url || \"\"}\n width={328}\n />\n );\n case \"imageBlock\":\n return (\n <div\n className={cn(\"relative object-cover\", {\n \"aspect-video\": !content.attrs.height,\n })}\n style={{\n width: content.attrs.width || \"100%\",\n ...(content.attrs.height ? { height: content.attrs.height } : {}),\n }}\n >\n {/* @ts-ignore */}\n <Image\n src={content.attrs.src}\n alt={content.attrs.caption || \"\"}\n style={{ width: content.attrs.width }}\n fill\n />\n </div>\n );\n case \"videoBlock\":\n // @ts-ignore\n return <VideoBlockViewClientside node={content} />;\n case \"facebook\":\n return <FacebookEmbed url={content.attrs.url || \"\"} width={550} />;\n case \"linkedin\":\n return (\n <LinkedInEmbed\n url={content.attrs.url}\n // postUrl=\"https://www.linkedin.com/posts/peterdiamandis_5-discoveries-the-james-webb-telescope-will-activity-6898694773406875648-z-D7\"\n width={325}\n height={570}\n />\n );\n\n default:\n return null;\n }\n };\n if (!mounted) return null;\n return (\n <>\n {body.content\n .filter((content) => content?.attrs?.[\"data-id\"])\n .map((content) => {\n return (\n <Portal\n key={`embed-content-${content.attrs[\"data-id\"]}`}\n container={document?.querySelector(\n `[data-id='${content.attrs[\"data-id\"]}']`\n )}\n >\n {renderContent(content)}\n </Portal>\n );\n })}\n </>\n );\n}\n"],"names":["Portal","Image","useLayoutEffect","useState","FacebookEmbed","InstagramEmbed","LinkedInEmbed","TikTokEmbed","XEmbed","YouTubeEmbed","cn","VideoBlockViewClientside","ContentEmbedSupport","body","mounted","setMounted","renderContent","content","type","url","attrs","width","className","captioned","div","height","style","src","alt","caption","fill","node","filter","map","container","document","querySelector"],"mappings":"AAAA;;AAEA,SAASA,MAAM,QAAQ,yBAAyB;AAChD,OAAOC,WAAW,gBAAgB;AAClC,SAASC,eAAe,EAAE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,KAAK;wBAAC;wBACpCS,IAAI;;;YAIZ,KAAK;gBACH,aAAa;gBACb,qBAAO,KAACnB;oBAAyBoB,MAAMd;;YACzC,KAAK;gBACH,qBAAO,KAACb;oBAAce,KAAKF,QAAQG,KAAK,CAACD,GAAG,IAAI;oBAAIE,OAAO;;YAC7D,KAAK;gBACH,qBACE,KAACf;oBACCa,KAAKF,QAAQG,KAAK,CAACD,GAAG;oBACtB,wIAAwI;oBACxIE,OAAO;oBACPI,QAAQ;;YAId;gBACE,OAAO;QACX;IACF;IACA,IAAI,CAACX,SAAS,OAAO;IACrB,qBACE;kBACGD,KAAKI,OAAO,CACVe,MAAM,CAAC,CAACf,UAAYA,SAASG,OAAO,CAAC,UAAU,EAC/Ca,GAAG,CAAC,CAAChB;YACJ,qBACE,KAACjB;gBAECkC,WAAWC,UAAUC,cACnB,CAAC,UAAU,EAAEnB,QAAQG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC;0BAG1CJ,cAAcC;eALV,CAAC,cAAc,EAAEA,QAAQG,KAAK,CAAC,UAAU,EAAE;QAQtD;;AAGR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FacebookServerside.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/FacebookServerside.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAErD,eAAO,MAAM,kBAAkB,gBA0B7B,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Node, mergeAttributes } from '@tiptap/core';
|
|
2
|
+
export const FacebookServerside = Node.create({
|
|
3
|
+
name: 'facebook',
|
|
4
|
+
group: 'block',
|
|
5
|
+
content: 'inline*',
|
|
6
|
+
parseHTML () {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
tag: 'a[data-type="facebook"]'
|
|
10
|
+
}
|
|
11
|
+
];
|
|
12
|
+
},
|
|
13
|
+
addAttributes () {
|
|
14
|
+
return {
|
|
15
|
+
url: {
|
|
16
|
+
default: null
|
|
17
|
+
},
|
|
18
|
+
'data-id': {
|
|
19
|
+
default: null
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
renderHTML ({ HTMLAttributes }) {
|
|
24
|
+
return [
|
|
25
|
+
'a',
|
|
26
|
+
mergeAttributes(HTMLAttributes, {
|
|
27
|
+
'data-type': 'facebook'
|
|
28
|
+
}),
|
|
29
|
+
0
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=FacebookServerside.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/FacebookServerside.ts"],"sourcesContent":["import { Node, mergeAttributes } from '@tiptap/core';\n\nexport const FacebookServerside = Node.create({\n name: 'facebook',\n\n group: 'block',\n content: 'inline*',\n\n parseHTML() {\n return [\n {\n tag: 'a[data-type=\"facebook\"]',\n },\n ];\n },\n addAttributes() {\n return {\n url: { default: null },\n 'data-id': { default: null },\n };\n },\n renderHTML({ HTMLAttributes }) {\n return [\n 'a',\n mergeAttributes(HTMLAttributes, { 'data-type': 'facebook' }),\n 0,\n ];\n },\n});\n"],"names":["Node","mergeAttributes","FacebookServerside","create","name","group","content","parseHTML","tag","addAttributes","url","default","renderHTML","HTMLAttributes"],"mappings":"AAAA,SAASA,IAAI,EAAEC,eAAe,QAAQ,eAAe;AAErD,OAAO,MAAMC,qBAAqBF,KAAKG,MAAM,CAAC;IAC5CC,MAAM;IAENC,OAAO;IACPC,SAAS;IAETC;QACE,OAAO;YACL;gBACEC,KAAK;YACP;SACD;IACH;IACAC;QACE,OAAO;YACLC,KAAK;gBAAEC,SAAS;YAAK;YACrB,WAAW;gBAAEA,SAAS;YAAK;QAC7B;IACF;IACAC,YAAW,EAAEC,cAAc,EAAE;QAC3B,OAAO;YACL;YACAZ,gBAAgBY,gBAAgB;gBAAE,aAAa;YAAW;YAC1D;SACD;IACH;AACF,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageBlockServerside.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/ImageBlockServerside.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAErD,eAAO,MAAM,oBAAoB,gBA8D/B,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Node, mergeAttributes } from '@tiptap/core';
|
|
2
|
+
export const ImageBlockServerside = Node.create({
|
|
3
|
+
name: 'imageBlock',
|
|
4
|
+
group: 'block',
|
|
5
|
+
content: 'inline*',
|
|
6
|
+
parseHTML () {
|
|
7
|
+
return [
|
|
8
|
+
{
|
|
9
|
+
tag: 'img[src*="tiptap.dev"]:not([src^="data:"]), img[src*="windows.net"]:not([src^="data:"])'
|
|
10
|
+
}
|
|
11
|
+
];
|
|
12
|
+
},
|
|
13
|
+
renderHTML ({ HTMLAttributes }) {
|
|
14
|
+
return [
|
|
15
|
+
'div',
|
|
16
|
+
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
|
|
17
|
+
class: 'image-wrapper'
|
|
18
|
+
})
|
|
19
|
+
];
|
|
20
|
+
},
|
|
21
|
+
// renderHTML({ HTMLAttributes }) {
|
|
22
|
+
// return [
|
|
23
|
+
// 'img',
|
|
24
|
+
// mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
|
|
25
|
+
// ];
|
|
26
|
+
// },
|
|
27
|
+
addAttributes () {
|
|
28
|
+
return {
|
|
29
|
+
'data-id': {
|
|
30
|
+
default: null
|
|
31
|
+
},
|
|
32
|
+
src: {
|
|
33
|
+
default: '',
|
|
34
|
+
parseHTML: (element)=>element.getAttribute('src'),
|
|
35
|
+
renderHTML: (attributes)=>({
|
|
36
|
+
src: attributes.src
|
|
37
|
+
})
|
|
38
|
+
},
|
|
39
|
+
width: {
|
|
40
|
+
default: '100%',
|
|
41
|
+
parseHTML: (element)=>element.getAttribute('data-width'),
|
|
42
|
+
renderHTML: (attributes)=>({
|
|
43
|
+
'data-width': attributes.width
|
|
44
|
+
})
|
|
45
|
+
},
|
|
46
|
+
align: {
|
|
47
|
+
default: 'center',
|
|
48
|
+
parseHTML: (element)=>element.getAttribute('data-align'),
|
|
49
|
+
renderHTML: (attributes)=>({
|
|
50
|
+
'data-align': attributes.align
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
alt: {
|
|
54
|
+
default: undefined,
|
|
55
|
+
parseHTML: (element)=>element.getAttribute('alt'),
|
|
56
|
+
renderHTML: (attributes)=>({
|
|
57
|
+
alt: attributes.alt
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
//# sourceMappingURL=ImageBlockServerside.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/ImageBlockServerside.ts"],"sourcesContent":["import { Node, mergeAttributes } from '@tiptap/core';\n\nexport const ImageBlockServerside = Node.create({\n name: 'imageBlock',\n group: 'block',\n content: 'inline*',\n\n parseHTML() {\n return [\n {\n tag: 'img[src*=\"tiptap.dev\"]:not([src^=\"data:\"]), img[src*=\"windows.net\"]:not([src^=\"data:\"])',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n return [\n 'div', // Create a div wrapper\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {\n class: 'image-wrapper',\n }), // Add any desired attributes to the wrapper\n ];\n },\n\n // renderHTML({ HTMLAttributes }) {\n // return [\n // 'img',\n // mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\n // ];\n // },\n\n addAttributes() {\n return {\n 'data-id': { default: null },\n src: {\n default: '',\n parseHTML: element => element.getAttribute('src'),\n renderHTML: attributes => ({\n src: attributes.src,\n }),\n },\n width: {\n default: '100%',\n parseHTML: element => element.getAttribute('data-width'),\n renderHTML: attributes => ({\n 'data-width': attributes.width,\n }),\n },\n align: {\n default: 'center',\n parseHTML: element => element.getAttribute('data-align'),\n renderHTML: attributes => ({\n 'data-align': attributes.align,\n }),\n },\n alt: {\n default: undefined,\n parseHTML: element => element.getAttribute('alt'),\n renderHTML: attributes => ({\n alt: attributes.alt,\n }),\n },\n };\n },\n});\n"],"names":["Node","mergeAttributes","ImageBlockServerside","create","name","group","content","parseHTML","tag","renderHTML","HTMLAttributes","options","class","addAttributes","default","src","element","getAttribute","attributes","width","align","alt","undefined"],"mappings":"AAAA,SAASA,IAAI,EAAEC,eAAe,QAAQ,eAAe;AAErD,OAAO,MAAMC,uBAAuBF,KAAKG,MAAM,CAAC;IAC9CC,MAAM;IACNC,OAAO;IACPC,SAAS;IAETC;QACE,OAAO;YACL;gBACEC,KAAK;YACP;SACD;IACH;IAEAC,YAAW,EAAEC,cAAc,EAAE;QAC3B,OAAO;YACL;YACAT,gBAAgB,IAAI,CAACU,OAAO,CAACD,cAAc,EAAEA,gBAAgB;gBAC3DE,OAAO;YACT;SACD;IACH;IAEA,mCAAmC;IACnC,aAAa;IACb,aAAa;IACb,oEAAoE;IACpE,OAAO;IACP,KAAK;IAELC;QACE,OAAO;YACL,WAAW;gBAAEC,SAAS;YAAK;YAC3BC,KAAK;gBACHD,SAAS;gBACTP,WAAWS,CAAAA,UAAWA,QAAQC,YAAY,CAAC;gBAC3CR,YAAYS,CAAAA,aAAe,CAAA;wBACzBH,KAAKG,WAAWH,GAAG;oBACrB,CAAA;YACF;YACAI,OAAO;gBACLL,SAAS;gBACTP,WAAWS,CAAAA,UAAWA,QAAQC,YAAY,CAAC;gBAC3CR,YAAYS,CAAAA,aAAe,CAAA;wBACzB,cAAcA,WAAWC,KAAK;oBAChC,CAAA;YACF;YACAC,OAAO;gBACLN,SAAS;gBACTP,WAAWS,CAAAA,UAAWA,QAAQC,YAAY,CAAC;gBAC3CR,YAAYS,CAAAA,aAAe,CAAA;wBACzB,cAAcA,WAAWE,KAAK;oBAChC,CAAA;YACF;YACAC,KAAK;gBACHP,SAASQ;gBACTf,WAAWS,CAAAA,UAAWA,QAAQC,YAAY,CAAC;gBAC3CR,YAAYS,CAAAA,aAAe,CAAA;wBACzBG,KAAKH,WAAWG,GAAG;oBACrB,CAAA;YACF;QACF;IACF;AACF,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstagramServerside.d.ts","sourceRoot":"","sources":["../../../../../../src/fields/TiptapEditor/extensions/serverside/InstagramServerside.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,MAAM,cAAc,CAAC;AAErD,eAAO,MAAM,mBAAmB,gBA0B9B,CAAC"}
|