payload-richtext-tiptap 0.0.74 → 0.0.75
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/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/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/styles.css +74 -74
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -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;AAEtB,OAAOC,aAAa,UAAU;AAE9B,OAAO,MAAMC,SAAkB;IAC7B;QACEC,MAAM;QACNC,OAAOH,QAAQI,CAAC,CAAC,aAAa;QAC9BC,UAAU;YACR;gBACEH,MAAM;gBACNI,OAAON,QAAQI,CAAC,CAAC,eAAe;gBAChCG,aAAYP,QAAQI,CAAC,CAAC,mBAAmB;gBACzCI,MAAMrB;gBACNsB,SAAS;oBAAC;iBAAK;gBACfC,QAAQ,CAACC;oBACPA,OAAOC,KAAK,GAAGC,KAAK,GAAGC,UAAU,CAAC;wBAAEC,OAAO;oBAAE,GAAGC,GAAG;gBACrD;YACF;YACA;gBACEd,MAAM;gBACNI,OAAON,QAAQI,CAAC,CAAC,eAAe;gBAChCG,aAAYP,QAAQI,CAAC,CAAC,mBAAmB;gBACzCI,MAAMpB;gBACNqB,SAAS;oBAAC;iBAAK;gBACfC,QAAQ,CAACC;oBACPA,OAAOC,KAAK,GAAGC,KAAK,GAAGC,UAAU,CAAC;wBAAEC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AAM;gBACNI,OAAON,QAAQI,CAAC,CAAC,gBAAgB;gBACjCG,aAAYP,QAAQI,CAAC,CAAC,oBAAoB;gBAC1CI,MAAMjB;gBACNkB,SAAS;oBAAC;iBAAY;gBACtBa,gBAAgB,CAACX,SAAWA,OAAOY,QAAQ,CAAC;gBAC5Cb,QAAQ,CAACC;oBACPA,OAAOC,KAAK,GAAGC,KAAK,GAAGa,eAAe,GAAGV,GAAG;gBAC9C;YACF;YACA;gBACEd,MAAM;gBACNI,OAAON,QAAQI,CAAC,CAAC,cAAc;gBAC/BG,aAAYP,QAAQI,CAAC,CAAC,kBAAkB;gBACxCI,MAAMT;gBACNU,SAAS;oBAAC;iBAAU;gBACpBa,gBAAgB,CAACX,SAAWA,OAAOY,QAAQ,CAAC;gBAC5Cb,QAAQ,CAACC;oBACPA,OAAOC,KAAK,GAAGC,KAAK,GAAGc,aAAa,GAAGX,GAAG;gBAC5C;YACF;YAEA;gBACEd,MAAM;gBACNI,OAAON,QAAQI,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,OAAOH,QAAQI,CAAC,CAAC,aAAa;QAC9BC,UAAU;YACR;gBACEH,MAAM;gBACNI,OAAON,QAAQI,CAAC,CAAC,eAAe;gBAChCG,aAAYP,QAAQI,CAAC,CAAC,mBAAmB;gBACzCI,MAAMnB;gBACNoB,SAAS;oBAAC;iBAAK;gBACfC,QAAQ,CAACC;oBACPA,OAAOC,KAAK,GAAGC,KAAK,GAAGC,UAAU,CAAC;wBAAEC,OAAO;oBAAE,GAAGC,GAAG;gBACrD;YACF;YACA;gBACEd,MAAM;gBACNI,OAAON,QAAQI,CAAC,CAAC,eAAe;gBAChCG,aAAYP,QAAQI,CAAC,CAAC,mBAAmB;gBACzCI,MAAMlB;gBACNmB,SAAS;oBAAC;iBAAK;gBACfC,QAAQ,CAACC;oBACPA,OAAOC,KAAK,GAAGC,KAAK,GAAGC,UAAU,CAAC;wBAAEC,OAAO;oBAAE,GAAGC,GAAG;gBACrD;YACF;YACA;gBACEd,MAAM;gBACNI,OAAON,QAAQI,C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gBACNI,OAAON,QAAQI,CAAC,CAAC,cAAc;gBAC/BG,aAAYP,QAAQI,CAAC,CAAC,kBAAkB;gBACxCI,MAAMT;gBACNU,SAAS;oBAAC;iBAAU;gBACpBW,gBAAgB,CAACT,SAAWA,OAAOU,QAAQ,CAAC;gBAC5CX,QAAQ,CAACC;oBACPA,OAAOC,KAAK,GAAGC,KAAK,GAAGY,aAAa,GAAGT,GAAG;gBAC5C;YACF;YAEA;gBACEd,MAAM;gBACNI,OAAON,QAAQI,CAAC,CAAC,aAAa;gBAC9BG,aAAYP,QAAQI,CAAC,CAAC,iBAAiB;gBACvCI,MAAMb;gBACNc,SAAS;oBAAC;iBAAS;gBACnBW,gBAAgB,CAACT,SAAWA,OAAOU,QAAQ,CAAC;gBAC5CX,QAAQ,CAACC;oBACPA,OAAOC,KAAK,GAAGC,KAAK,GAAGa,YAAY,GAAGV,GAAG;gBAC3C;YACF;SACD;IACH;CACD,CAAC;AAEF,eAAef,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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,SAAS,gBAAgB;AAShC,OAAO,MAAMC,eAAe,CAAC,EAC3BC,kBAAkB,EACA,GAAK;QAErBH;QACAlC;QACAsB;QACAD,SAASiB,SAAS,CAAC;YACjBC,QAAQ;QACV;QACAvB;QACAT,QAAQ+B,SAAS,CAAC;YAChBE,QAAQ;gBAAC;gBAAG;gBAAG;gBAAG;gBAAG;gBAAG;aAAE;QAC5B;QACA/B;QACAS,WAAWoB,SAAS,CAAC;YACnBG,UAAU;YACVC,YAAY;YACZC,SAAS;YACTC,gBAAgB;YAChBC,YAAY;YACZC,SAAS;YACTC,WAAW;QACb;QACAvB;QACAlB;QACA,cAAc;QACdP;QACA2B;QACAb,KAAKyB,SAAS,CAAC;YACbU,aAAa;QACf;QACAxC,UAAU8B,SAAS,CAAC;YAAEW,YAAY;QAAK;QACvCpB;QACA/B,eAAewC,SAAS,CAAC;YAAEY,OAAO;QAAM;QACxClB,YAAYM,SAAS,CAAC;YACpBD;QACF;QACA3B;QACAoB;QACAlC;QACAQ,YAAYkC,SAAS,CAAC;YACpBa,kBAAkB;gBAAC;gBAAa;gBAAc;gBAAa;aAAa;YACxEC,QAAQ,CAACC,eAAeC,OAAOC;gBAC7B,MAAMC,OAAOF,KAAK,CAAC,EAAE;gBACpB,CAAA;oBACCjB,mBACE,CAACoB;wBACCJ,cACGK,KAAK,GACLC,eAAe,CAAC;4BAAEJ;4BAAKK,KAAKH,MAAMI,OAAO;wBAAC,GAC1CC,KAAK,GACLC,GAAG;oBACR,GACAP,MACA;gBAEJ,CAAA;YACF;YACAQ,SAAS,CAACX,eAAeC;gBACvBA,MAAMW,OAAO,CAAC;oBACZ,MAAMC,MAAM,MAAM/B,IAAIgC,WAAW;oBAEjC,OAAOd,cACJK,KAAK,GACLC,eAAe,CAAC;wBACfJ,KAAKF,cAAce,KAAK,CAACC,SAAS,CAACC,MAAM;wBACzCV,KAAKM;oBACP,GACCJ,KAAK,GACLC,GAAG;gBACR;YACF;QACF;QACA,oBAAoB;QACpB,2BAA2B;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"}
|
|
@@ -10,7 +10,7 @@ import { Surface } from "../../ui/Surface.js";
|
|
|
10
10
|
import { Toolbar } from "../../ui/Toolbar.js";
|
|
11
11
|
import { ContentTypePicker } from "./components/ContentTypePicker.js";
|
|
12
12
|
import { EditLinkPopover } from "./components/EditLinkPopover.js";
|
|
13
|
-
import { FontFamilyPicker } from "./components/FontFamilyPicker.js";
|
|
13
|
+
// import { FontFamilyPicker } from "./components/FontFamilyPicker.js";
|
|
14
14
|
import { FontSizePicker } from "./components/FontSizePicker.js";
|
|
15
15
|
import { useTextmenuCommands } from "./hooks/useTextmenuCommands.js";
|
|
16
16
|
import { useTextmenuContentTypes } from "./hooks/useTextmenuContentTypes.js";
|
|
@@ -20,7 +20,7 @@ import i18next from "i18next";
|
|
|
20
20
|
// on every editor state change
|
|
21
21
|
const MemoButton = /*#__PURE__*/ memo(Toolbar.Button);
|
|
22
22
|
const MemoColorPicker = /*#__PURE__*/ memo(ColorPicker);
|
|
23
|
-
const MemoFontFamilyPicker =
|
|
23
|
+
// const MemoFontFamilyPicker = memo(FontFamilyPicker);
|
|
24
24
|
const MemoFontSizePicker = /*#__PURE__*/ memo(FontSizePicker);
|
|
25
25
|
const MemoContentTypePicker = /*#__PURE__*/ memo(ContentTypePicker);
|
|
26
26
|
export const TextMenu = ({ editor, dir })=>{
|
|
@@ -65,10 +65,6 @@ export const TextMenu = ({ editor, dir })=>{
|
|
|
65
65
|
/*#__PURE__*/ _jsx(MemoContentTypePicker, {
|
|
66
66
|
options: blockOptions
|
|
67
67
|
}),
|
|
68
|
-
/*#__PURE__*/ _jsx(MemoFontFamilyPicker, {
|
|
69
|
-
onChange: commands.onSetFont,
|
|
70
|
-
value: states.currentFont || ""
|
|
71
|
-
}),
|
|
72
68
|
/*#__PURE__*/ _jsx(MemoFontSizePicker, {
|
|
73
69
|
onChange: commands.onSetFontSize,
|
|
74
70
|
value: states.currentSize || ""
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.tsx"],"sourcesContent":["import * as Popover from \"@radix-ui/react-popover\";\nimport { BubbleMenu, Editor } from \"@tiptap/react\";\nimport {\n AlignCenter,\n AlignJustify,\n AlignLeft,\n AlignRight,\n Bold,\n Highlighter,\n Italic,\n MoveVertical,\n Palette,\n RemoveFormatting,\n Sparkles,\n Strikethrough,\n Subscript,\n Superscript,\n Underline,\n} from \"lucide-react\";\nimport { memo, useState } from \"react\";\nimport { AIEditorPanel } from \"../../panels/AIEditorPanel/AIEditorPanel.js\";\nimport { ColorPicker } from \"../../panels/index.js\";\nimport { Icon } from \"../../ui/Icon.js\";\nimport { Surface } from \"../../ui/Surface.js\";\nimport { Toolbar } from \"../../ui/Toolbar.js\";\nimport { ContentTypePicker } from \"./components/ContentTypePicker.js\";\nimport { EditLinkPopover } from \"./components/EditLinkPopover.js\";\nimport { FontFamilyPicker } from \"./components/FontFamilyPicker.js\";\nimport { FontSizePicker } from \"./components/FontSizePicker.js\";\nimport { useTextmenuCommands } from \"./hooks/useTextmenuCommands.js\";\nimport { useTextmenuContentTypes } from \"./hooks/useTextmenuContentTypes.js\";\nimport { useTextmenuStates } from \"./hooks/useTextmenuStates.js\";\nimport i18next from \"i18next\";\n\n// We memorize the button so each button is not rerendered\n// on every editor state change\nconst MemoButton = memo(Toolbar.Button);\nconst MemoColorPicker = memo(ColorPicker);\nconst MemoFontFamilyPicker = memo(FontFamilyPicker);\nconst MemoFontSizePicker = memo(FontSizePicker);\nconst MemoContentTypePicker = memo(ContentTypePicker);\n\nexport type TextMenuProps = {\n editor: Editor;\n dir: \"rtl\" | \"ltr\" | \"auto\";\n};\n\nexport const TextMenu = ({ editor, dir }: TextMenuProps) => {\n const commands = useTextmenuCommands(editor);\n const states = useTextmenuStates(editor);\n const blockOptions = useTextmenuContentTypes(editor);\n const [openAi, setOpenAi] = useState(false);\n\n return (\n <BubbleMenu\n tippyOptions={{\n placement: \"auto\",\n popperOptions: {\n placement: \"auto\",\n },\n onHide: () => {\n setOpenAi(false);\n },\n }}\n editor={editor}\n pluginKey=\"textMenu\"\n shouldShow={states.shouldShow}\n updateDelay={100}\n >\n {openAi ? (\n <AIEditorPanel\n editor={editor}\n onOpenChange={(value) => {\n setOpenAi(value);\n }}\n />\n ) : (\n <Toolbar.Wrapper>\n <Toolbar.Button\n className=\"text-purple-500 hover:text-purple-600 active:text-purple-600 dark:text-purple-400 dark:hover:text-purple-300 dark:active:text-purple-400\"\n activeClassname=\"text-purple-600 hover:text-purple-600 dark:text-purple-400 dark:hover:text-purple-200\"\n onClick={() => setOpenAi(true)}\n >\n <Icon icon={Sparkles} className=\"mr-1\" />\n {i18next.t(\"aiTools\") || \"AI Tools\"}\n </Toolbar.Button>\n <Toolbar.Divider />\n\n <MemoContentTypePicker options={blockOptions} />\n <MemoFontFamilyPicker\n onChange={commands.onSetFont}\n value={states.currentFont || \"\"}\n />\n <MemoFontSizePicker\n onChange={commands.onSetFontSize}\n value={states.currentSize || \"\"}\n />\n <Toolbar.Divider />\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"boldText\") || \"Bold\"}\n tooltipShortcut={[\"Mod\", \"B\"]}\n onClick={commands.onBold}\n active={states.isBold}\n >\n <Icon icon={Bold} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"italicText\") || \"Italic\"}\n tooltipShortcut={[\"Mod\", \"I\"]}\n onClick={commands.onItalic}\n active={states.isItalic}\n >\n <Icon icon={Italic} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"underlineText\") || \"Underline\"}\n tooltipShortcut={[\"Mod\", \"U\"]}\n onClick={commands.onUnderline}\n active={states.isUnderline}\n >\n <Icon icon={Underline} />\n </MemoButton>\n\n <EditLinkPopover onSetLink={commands.onLink} />\n <Popover.Root>\n <Popover.Trigger asChild>\n <MemoButton\n type=\"button\"\n active={!!states.currentHighlight}\n tooltip={i18next.t(\"highlightText\", \"Highlight text\")}\n >\n <Icon icon={Highlighter} />\n </MemoButton>\n </Popover.Trigger>\n <Popover.Content side=\"top\" sideOffset={8} asChild>\n <Surface className=\"p-1\">\n <MemoColorPicker\n color={states.currentHighlight}\n onChange={commands.onChangeHighlight}\n onClear={commands.onClearHighlight}\n />\n </Surface>\n </Popover.Content>\n </Popover.Root>\n <Popover.Root>\n <Popover.Trigger asChild>\n <MemoButton\n type=\"button\"\n active={!!states.currentColor}\n tooltip={i18next.t(\"textColor\") || \"Text color\"}\n >\n <Icon icon={Palette} />\n </MemoButton>\n </Popover.Trigger>\n <Popover.Content side=\"top\" sideOffset={8} asChild>\n <Surface className=\"p-1\">\n <MemoColorPicker\n color={states.currentColor}\n onChange={commands.onChangeColor}\n onClear={commands.onClearColor}\n />\n </Surface>\n </Popover.Content>\n </Popover.Root>\n <Popover.Root>\n <Popover.Trigger asChild>\n <MemoButton type=\"button\" tooltip={i18next.t(\"moreOptions\", \"More options\")}>\n <Icon icon={MoveVertical} />\n </MemoButton>\n </Popover.Trigger>\n <Popover.Content side=\"top\" asChild>\n <Toolbar.Wrapper>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"subscript\", \"Subscript\")}\n tooltipShortcut={[\"Mod\", \".\"]}\n onClick={commands.onSubscript}\n active={states.isSubscript}\n >\n <Icon icon={Subscript} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"superscript\", \"Superscript\")}\n tooltipShortcut={[\"Mod\", \",\"]}\n onClick={commands.onSuperscript}\n active={states.isSuperscript}\n >\n <Icon icon={Superscript} />\n </MemoButton>\n <Toolbar.Divider />\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"alignLeft\") || \"Align left\"}\n tooltipShortcut={[\"Shift\", \"Mod\", \"L\"]}\n onClick={commands.onAlignLeft}\n active={states.isAlignLeft}\n >\n <Icon icon={AlignLeft} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"alignCenter\") || \"Align center\"}\n tooltipShortcut={[\"Shift\", \"Mod\", \"E\"]}\n onClick={commands.onAlignCenter}\n active={states.isAlignCenter}\n >\n <Icon icon={AlignCenter} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"alignRight\", \"Align right\")}\n tooltipShortcut={[\"Shift\", \"Mod\", \"R\"]}\n onClick={commands.onAlignRight}\n active={states.isAlignRight}\n >\n <Icon icon={AlignRight} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"alignJustify\") || \"Justify\"}\n tooltipShortcut={[\"Shift\", \"Mod\", \"J\"]}\n onClick={commands.onAlignJustify}\n active={states.isAlignJustify}\n >\n <Icon icon={AlignJustify} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"strikethrough\", \"Strikethrough\")}\n tooltipShortcut={[\"Mod\", \"Shift\", \"S\"]}\n onClick={commands.onStrike}\n active={states.isStrike}\n >\n <Icon icon={Strikethrough} />\n </MemoButton>\n\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"clearFormatting\") || \"Clear Formatting\"}\n onClick={commands.onClearFormatting}\n >\n <Icon icon={RemoveFormatting} />\n </MemoButton>\n </Toolbar.Wrapper>\n </Popover.Content>\n </Popover.Root>\n </Toolbar.Wrapper>\n )}\n </BubbleMenu>\n );\n};\n"],"names":["Popover","BubbleMenu","AlignCenter","AlignJustify","AlignLeft","AlignRight","Bold","Highlighter","Italic","MoveVertical","Palette","RemoveFormatting","Sparkles","Strikethrough","Subscript","Superscript","Underline","memo","useState","AIEditorPanel","ColorPicker","Icon","Surface","Toolbar","ContentTypePicker","EditLinkPopover","FontFamilyPicker","FontSizePicker","useTextmenuCommands","useTextmenuContentTypes","useTextmenuStates","i18next","MemoButton","Button","MemoColorPicker","MemoFontFamilyPicker","MemoFontSizePicker","MemoContentTypePicker","TextMenu","editor","dir","commands","states","blockOptions","openAi","setOpenAi","tippyOptions","placement","popperOptions","onHide","pluginKey","shouldShow","updateDelay","onOpenChange","value","Wrapper","className","activeClassname","onClick","icon","t","Divider","options","onChange","onSetFont","currentFont","onSetFontSize","currentSize","type","tooltip","tooltipShortcut","onBold","active","isBold","onItalic","isItalic","onUnderline","isUnderline","onSetLink","onLink","Root","Trigger","asChild","currentHighlight","Content","side","sideOffset","color","onChangeHighlight","onClear","onClearHighlight","currentColor","onChangeColor","onClearColor","onSubscript","isSubscript","onSuperscript","isSuperscript","onAlignLeft","isAlignLeft","onAlignCenter","isAlignCenter","onAlignRight","isAlignRight","onAlignJustify","isAlignJustify","onStrike","isStrike","onClearFormatting"],"mappings":";AAAA,YAAYA,aAAa,0BAA0B;AACnD,SAASC,UAAU,QAAgB,gBAAgB;AACnD,SACEC,WAAW,EACXC,YAAY,EACZC,SAAS,EACTC,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,MAAM,EACNC,YAAY,EACZC,OAAO,EACPC,gBAAgB,EAChBC,QAAQ,EACRC,aAAa,EACbC,SAAS,EACTC,WAAW,EACXC,SAAS,QACJ,eAAe;AACtB,SAASC,IAAI,EAAEC,QAAQ,QAAQ,QAAQ;AACvC,SAASC,aAAa,QAAQ,8CAA8C;AAC5E,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,IAAI,QAAQ,mBAAmB;AACxC,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,OAAO,QAAQ,sBAAsB;AAC9C,SAASC,iBAAiB,QAAQ,oCAAoC;AACtE,SAASC,eAAe,QAAQ,kCAAkC;AAClE,SAASC,gBAAgB,QAAQ,mCAAmC;AACpE,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,SAASC,uBAAuB,QAAQ,qCAAqC;AAC7E,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,aAAa,UAAU;AAE9B,0DAA0D;AAC1D,+BAA+B;AAC/B,MAAMC,2BAAaf,KAAKM,QAAQU,MAAM;AACtC,MAAMC,gCAAkBjB,KAAKG;AAC7B,MAAMe,qCAAuBlB,KAAKS;AAClC,MAAMU,mCAAqBnB,KAAKU;AAChC,MAAMU,sCAAwBpB,KAAKO;AAOnC,OAAO,MAAM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,aAAa;wCAC/B5B,QAAQ9B,OAAO2D,aAAa;kDAE5B,cAAA,KAAChF;4CAAKsC,MAAMzD;;;kDAEd,KAAC8B;wCACCoC,MAAK;wCACLC,SAAStC,QAAQ6B,CAAC,CAAC,cAAc;wCACjCU,iBAAiB;4CAAC;4CAAS;4CAAO;yCAAI;wCACtCZ,SAASjB,SAAS6D,YAAY;wCAC9B9B,QAAQ9B,OAAO6D,YAAY;kDAE3B,cAAA,KAAClF;4CAAKsC,MAAMtD;;;kDAEd,KAAC2B;wCACCoC,MAAK;wCACLC,SAAStC,QAAQ6B,CAAC,CAAC,mBAAmB;wCACtCU,iBAAiB;4CAAC;4CAAS;4CAAO;yCAAI;wCACtCZ,SAASjB,SAAS+D,cAAc;wCAChChC,QAAQ9B,OAAO+D,cAAc;kDAE7B,cAAA,KAACpF;4CAAKsC,MAAMxD;;;kDAEd,KAAC6B;wCACCoC,MAAK;wCACLC,SAAStC,QAAQ6B,CAAC,CAAC,iBAAiB;wCACpCU,iBAAiB;4CAAC;4CAAO;4CAAS;yCAAI;wCACtCZ,SAASjB,SAASiE,QAAQ;wCAC1BlC,QAAQ9B,OAAOiE,QAAQ;kDAEvB,cAAA,KAACtF;4CAAKsC,MAAM9C;;;kDAGd,KAACmB;wCACCoC,MAAK;wCACLC,SAAStC,QAAQ6B,CAAC,CAAC,sBAAsB;wCACzCF,SAASjB,SAASmE,iBAAiB;kDAEnC,cAAA,KAACvF;4CAAKsC,MAAMhD;;;;;;;;;;;AAS9B,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../src/fields/TiptapEditor/features/menus/TextMenu/TextMenu.tsx"],"sourcesContent":["import * as Popover from \"@radix-ui/react-popover\";\nimport { BubbleMenu, Editor } from \"@tiptap/react\";\nimport {\n AlignCenter,\n AlignJustify,\n AlignLeft,\n AlignRight,\n Bold,\n Highlighter,\n Italic,\n MoveVertical,\n Palette,\n RemoveFormatting,\n Sparkles,\n Strikethrough,\n Subscript,\n Superscript,\n Underline,\n} from \"lucide-react\";\nimport { memo, useState } from \"react\";\nimport { AIEditorPanel } from \"../../panels/AIEditorPanel/AIEditorPanel.js\";\nimport { ColorPicker } from \"../../panels/index.js\";\nimport { Icon } from \"../../ui/Icon.js\";\nimport { Surface } from \"../../ui/Surface.js\";\nimport { Toolbar } from \"../../ui/Toolbar.js\";\nimport { ContentTypePicker } from \"./components/ContentTypePicker.js\";\nimport { EditLinkPopover } from \"./components/EditLinkPopover.js\";\n// import { FontFamilyPicker } from \"./components/FontFamilyPicker.js\";\nimport { FontSizePicker } from \"./components/FontSizePicker.js\";\nimport { useTextmenuCommands } from \"./hooks/useTextmenuCommands.js\";\nimport { useTextmenuContentTypes } from \"./hooks/useTextmenuContentTypes.js\";\nimport { useTextmenuStates } from \"./hooks/useTextmenuStates.js\";\nimport i18next from \"i18next\";\n\n// We memorize the button so each button is not rerendered\n// on every editor state change\nconst MemoButton = memo(Toolbar.Button);\nconst MemoColorPicker = memo(ColorPicker);\n// const MemoFontFamilyPicker = memo(FontFamilyPicker);\nconst MemoFontSizePicker = memo(FontSizePicker);\nconst MemoContentTypePicker = memo(ContentTypePicker);\n\nexport type TextMenuProps = {\n editor: Editor;\n dir: \"rtl\" | \"ltr\" | \"auto\";\n};\n\nexport const TextMenu = ({ editor, dir }: TextMenuProps) => {\n const commands = useTextmenuCommands(editor);\n const states = useTextmenuStates(editor);\n const blockOptions = useTextmenuContentTypes(editor);\n const [openAi, setOpenAi] = useState(false);\n\n return (\n <BubbleMenu\n tippyOptions={{\n placement: \"auto\",\n popperOptions: {\n placement: \"auto\",\n },\n onHide: () => {\n setOpenAi(false);\n },\n }}\n editor={editor}\n pluginKey=\"textMenu\"\n shouldShow={states.shouldShow}\n updateDelay={100}\n >\n {openAi ? (\n <AIEditorPanel\n editor={editor}\n onOpenChange={(value) => {\n setOpenAi(value);\n }}\n />\n ) : (\n <Toolbar.Wrapper>\n <Toolbar.Button\n className=\"text-purple-500 hover:text-purple-600 active:text-purple-600 dark:text-purple-400 dark:hover:text-purple-300 dark:active:text-purple-400\"\n activeClassname=\"text-purple-600 hover:text-purple-600 dark:text-purple-400 dark:hover:text-purple-200\"\n onClick={() => setOpenAi(true)}\n >\n <Icon icon={Sparkles} className=\"mr-1\" />\n {i18next.t(\"aiTools\") || \"AI Tools\"}\n </Toolbar.Button>\n <Toolbar.Divider />\n\n <MemoContentTypePicker options={blockOptions} />\n {/* <MemoFontFamilyPicker\n onChange={commands.onSetFont}\n value={states.currentFont || \"\"}\n /> */}\n <MemoFontSizePicker\n onChange={commands.onSetFontSize}\n value={states.currentSize || \"\"}\n />\n <Toolbar.Divider />\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"boldText\") || \"Bold\"}\n tooltipShortcut={[\"Mod\", \"B\"]}\n onClick={commands.onBold}\n active={states.isBold}\n >\n <Icon icon={Bold} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"italicText\") || \"Italic\"}\n tooltipShortcut={[\"Mod\", \"I\"]}\n onClick={commands.onItalic}\n active={states.isItalic}\n >\n <Icon icon={Italic} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"underlineText\") || \"Underline\"}\n tooltipShortcut={[\"Mod\", \"U\"]}\n onClick={commands.onUnderline}\n active={states.isUnderline}\n >\n <Icon icon={Underline} />\n </MemoButton>\n\n <EditLinkPopover onSetLink={commands.onLink} />\n <Popover.Root>\n <Popover.Trigger asChild>\n <MemoButton\n type=\"button\"\n active={!!states.currentHighlight}\n tooltip={i18next.t(\"highlightText\", \"Highlight text\")}\n >\n <Icon icon={Highlighter} />\n </MemoButton>\n </Popover.Trigger>\n <Popover.Content side=\"top\" sideOffset={8} asChild>\n <Surface className=\"p-1\">\n <MemoColorPicker\n color={states.currentHighlight}\n onChange={commands.onChangeHighlight}\n onClear={commands.onClearHighlight}\n />\n </Surface>\n </Popover.Content>\n </Popover.Root>\n <Popover.Root>\n <Popover.Trigger asChild>\n <MemoButton\n type=\"button\"\n active={!!states.currentColor}\n tooltip={i18next.t(\"textColor\") || \"Text color\"}\n >\n <Icon icon={Palette} />\n </MemoButton>\n </Popover.Trigger>\n <Popover.Content side=\"top\" sideOffset={8} asChild>\n <Surface className=\"p-1\">\n <MemoColorPicker\n color={states.currentColor}\n onChange={commands.onChangeColor}\n onClear={commands.onClearColor}\n />\n </Surface>\n </Popover.Content>\n </Popover.Root>\n <Popover.Root>\n <Popover.Trigger asChild>\n <MemoButton type=\"button\" tooltip={i18next.t(\"moreOptions\", \"More options\")}>\n <Icon icon={MoveVertical} />\n </MemoButton>\n </Popover.Trigger>\n <Popover.Content side=\"top\" asChild>\n <Toolbar.Wrapper>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"subscript\", \"Subscript\")}\n tooltipShortcut={[\"Mod\", \".\"]}\n onClick={commands.onSubscript}\n active={states.isSubscript}\n >\n <Icon icon={Subscript} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"superscript\", \"Superscript\")}\n tooltipShortcut={[\"Mod\", \",\"]}\n onClick={commands.onSuperscript}\n active={states.isSuperscript}\n >\n <Icon icon={Superscript} />\n </MemoButton>\n <Toolbar.Divider />\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"alignLeft\") || \"Align left\"}\n tooltipShortcut={[\"Shift\", \"Mod\", \"L\"]}\n onClick={commands.onAlignLeft}\n active={states.isAlignLeft}\n >\n <Icon icon={AlignLeft} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"alignCenter\") || \"Align center\"}\n tooltipShortcut={[\"Shift\", \"Mod\", \"E\"]}\n onClick={commands.onAlignCenter}\n active={states.isAlignCenter}\n >\n <Icon icon={AlignCenter} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"alignRight\", \"Align right\")}\n tooltipShortcut={[\"Shift\", \"Mod\", \"R\"]}\n onClick={commands.onAlignRight}\n active={states.isAlignRight}\n >\n <Icon icon={AlignRight} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"alignJustify\") || \"Justify\"}\n tooltipShortcut={[\"Shift\", \"Mod\", \"J\"]}\n onClick={commands.onAlignJustify}\n active={states.isAlignJustify}\n >\n <Icon icon={AlignJustify} />\n </MemoButton>\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"strikethrough\", \"Strikethrough\")}\n tooltipShortcut={[\"Mod\", \"Shift\", \"S\"]}\n onClick={commands.onStrike}\n active={states.isStrike}\n >\n <Icon icon={Strikethrough} />\n </MemoButton>\n\n <MemoButton\n type=\"button\"\n tooltip={i18next.t(\"clearFormatting\") || \"Clear Formatting\"}\n onClick={commands.onClearFormatting}\n >\n <Icon icon={RemoveFormatting} />\n </MemoButton>\n </Toolbar.Wrapper>\n </Popover.Content>\n </Popover.Root>\n </Toolbar.Wrapper>\n )}\n </BubbleMenu>\n );\n};\n"],"names":["Popover","BubbleMenu","AlignCenter","AlignJustify","AlignLeft","AlignRight","Bold","Highlighter","Italic","MoveVertical","Palette","RemoveFormatting","Sparkles","Strikethrough","Subscript","Superscript","Underline","memo","useState","AIEditorPanel","ColorPicker","Icon","Surface","Toolbar","ContentTypePicker","EditLinkPopover","FontSizePicker","useTextmenuCommands","useTextmenuContentTypes","useTextmenuStates","i18next","MemoButton","Button","MemoColorPicker","MemoFontSizePicker","MemoContentTypePicker","TextMenu","editor","dir","commands","states","blockOptions","openAi","setOpenAi","tippyOptions","placement","popperOptions","onHide","pluginKey","shouldShow","updateDelay","onOpenChange","value","Wrapper","className","activeClassname","onClick","icon","t","Divider","options","onChange","onSetFontSize","currentSize","type","tooltip","tooltipShortcut","onBold","active","isBold","onItalic","isItalic","onUnderline","isUnderline","onSetLink","onLink","Root","Trigger","asChild","currentHighlight","Content","side","sideOffset","color","onChangeHighlight","onClear","onClearHighlight","currentColor","onChangeColor","onClearColor","onSubscript","isSubscript","onSuperscript","isSuperscript","onAlignLeft","isAlignLeft","onAlignCenter","isAlignCenter","onAlignRight","isA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kDAEd,KAAC0B;wCACCiC,MAAK;wCACLC,SAASnC,QAAQ4B,CAAC,CAAC,mBAAmB;wCACtCQ,iBAAiB;4CAAC;4CAAS;4CAAO;yCAAI;wCACtCV,SAASjB,SAAS6D,cAAc;wCAChChC,QAAQ5B,OAAO6D,cAAc;kDAE7B,cAAA,KAAChF;4CAAKoC,MAAMtD;;;kDAEd,KAAC4B;wCACCiC,MAAK;wCACLC,SAASnC,QAAQ4B,CAAC,CAAC,iBAAiB;wCACpCQ,iBAAiB;4CAAC;4CAAO;4CAAS;yCAAI;wCACtCV,SAASjB,SAAS+D,QAAQ;wCAC1BlC,QAAQ5B,OAAO+D,QAAQ;kDAEvB,cAAA,KAAClF;4CAAKoC,MAAM5C;;;kDAGd,KAACkB;wCACCiC,MAAK;wCACLC,SAASnC,QAAQ4B,CAAC,CAAC,sBAAsB;wCACzCF,SAASjB,SAASiE,iBAAiB;kDAEnC,cAAA,KAACnF;4CAAKoC,MAAM9C;;;;;;;;;;;AAS9B,EAAE"}
|
|
@@ -16,7 +16,6 @@ export declare const useTextmenuCommands: (editor: Editor) => {
|
|
|
16
16
|
onClearColor: () => boolean;
|
|
17
17
|
onChangeHighlight: (color: string) => boolean;
|
|
18
18
|
onClearHighlight: () => boolean;
|
|
19
|
-
onSetFont: (font: string) => boolean;
|
|
20
19
|
onSetFontSize: (fontSize: string) => boolean;
|
|
21
20
|
onLink: (url: string, inNewTab?: boolean) => boolean;
|
|
22
21
|
onCompleteSentence: () => void;
|
package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuCommands.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTextmenuCommands.d.ts","sourceRoot":"","sources":["../../../../../../../../src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuCommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtC,eAAO,MAAM,mBAAmB,WAAY,MAAM;;;;;;;;;;;;;2BA4BtC,MAAM;;+BAMN,MAAM;;
|
|
1
|
+
{"version":3,"file":"useTextmenuCommands.d.ts","sourceRoot":"","sources":["../../../../../../../../src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuCommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAGtC,eAAO,MAAM,mBAAmB,WAAY,MAAM;;;;;;;;;;;;;2BA4BtC,MAAM;;+BAMN,MAAM;;8BA6BH,MAAM;kBApBX,MAAM,aAAa,OAAO;;;;;;;;;;;CA6FnC,CAAA"}
|
|
@@ -56,14 +56,15 @@ export const useTextmenuCommands = (editor)=>{
|
|
|
56
56
|
}).run(), [
|
|
57
57
|
editor
|
|
58
58
|
]);
|
|
59
|
-
const onSetFont = useCallback(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
]
|
|
59
|
+
// const onSetFont = useCallback(
|
|
60
|
+
// (font: string) => {
|
|
61
|
+
// if (!font || font.length === 0) {
|
|
62
|
+
// return editor.chain().focus().unsetFontFamily().run()
|
|
63
|
+
// }
|
|
64
|
+
// return editor.chain().focus().setFontFamily(font).run()
|
|
65
|
+
// },
|
|
66
|
+
// [editor],
|
|
67
|
+
// )
|
|
67
68
|
const onSetFontSize = useCallback((fontSize)=>{
|
|
68
69
|
if (!fontSize || fontSize.length === 0) {
|
|
69
70
|
return editor.chain().focus().unsetFontSize().run();
|
|
@@ -140,7 +141,7 @@ export const useTextmenuCommands = (editor)=>{
|
|
|
140
141
|
onClearColor,
|
|
141
142
|
onChangeHighlight,
|
|
142
143
|
onClearHighlight,
|
|
143
|
-
onSetFont,
|
|
144
|
+
// onSetFont,
|
|
144
145
|
onSetFontSize,
|
|
145
146
|
onLink,
|
|
146
147
|
onCompleteSentence,
|
package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuCommands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuCommands.ts"],"sourcesContent":["import { Editor } from '@tiptap/react'\nimport { useCallback } from 'react'\n\nexport const useTextmenuCommands = (editor: Editor) => {\n const onBold = useCallback(() => editor.chain().focus().toggleBold().run(), [editor])\n const onItalic = useCallback(() => editor.chain().focus().toggleItalic().run(), [editor])\n const onStrike = useCallback(() => editor.chain().focus().toggleStrike().run(), [editor])\n const onUnderline = useCallback(() => editor.chain().focus().toggleUnderline().run(), [editor])\n const onCode = useCallback(() => editor.chain().focus().toggleCode().run(), [editor])\n const onCodeBlock = useCallback(() => editor.chain().focus().toggleCodeBlock().run(), [editor])\n\n const onSubscript = useCallback(() => editor.chain().focus().toggleSubscript().run(), [editor])\n const onSuperscript = useCallback(\n () => editor.chain().focus().toggleSuperscript().run(),\n [editor],\n )\n const onAlignLeft = useCallback(() => editor.chain().focus().setTextAlign('left').run(), [editor])\n const onAlignCenter = useCallback(\n () => editor.chain().focus().setTextAlign('center').run(),\n [editor],\n )\n const onAlignRight = useCallback(\n () => editor.chain().focus().setTextAlign('right').run(),\n [editor],\n )\n const onAlignJustify = useCallback(\n () => editor.chain().focus().setTextAlign('justify').run(),\n [editor],\n )\n\n const onChangeColor = useCallback(\n (color: string) => editor.chain().setColor(color).run(),\n [editor],\n )\n const onClearColor = useCallback(() => editor.chain().focus().unsetColor().run(), [editor])\n\n const onChangeHighlight = useCallback(\n (color: string) => editor.chain().setHighlight({ color }).run(),\n [editor],\n )\n const onClearHighlight = useCallback(\n () => editor.chain().focus().unsetHighlight().run(),\n [editor],\n )\n\n const onLink = useCallback(\n (url: string, inNewTab?: boolean) =>\n editor\n .chain()\n .focus()\n .setLink({ href: url, target: inNewTab ? '_blank' : '' })\n .run(),\n [editor],\n )\n\n const onSetFont = useCallback(\n
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuCommands.ts"],"sourcesContent":["import { Editor } from '@tiptap/react'\nimport { useCallback } from 'react'\n\nexport const useTextmenuCommands = (editor: Editor) => {\n const onBold = useCallback(() => editor.chain().focus().toggleBold().run(), [editor])\n const onItalic = useCallback(() => editor.chain().focus().toggleItalic().run(), [editor])\n const onStrike = useCallback(() => editor.chain().focus().toggleStrike().run(), [editor])\n const onUnderline = useCallback(() => editor.chain().focus().toggleUnderline().run(), [editor])\n const onCode = useCallback(() => editor.chain().focus().toggleCode().run(), [editor])\n const onCodeBlock = useCallback(() => editor.chain().focus().toggleCodeBlock().run(), [editor])\n\n const onSubscript = useCallback(() => editor.chain().focus().toggleSubscript().run(), [editor])\n const onSuperscript = useCallback(\n () => editor.chain().focus().toggleSuperscript().run(),\n [editor],\n )\n const onAlignLeft = useCallback(() => editor.chain().focus().setTextAlign('left').run(), [editor])\n const onAlignCenter = useCallback(\n () => editor.chain().focus().setTextAlign('center').run(),\n [editor],\n )\n const onAlignRight = useCallback(\n () => editor.chain().focus().setTextAlign('right').run(),\n [editor],\n )\n const onAlignJustify = useCallback(\n () => editor.chain().focus().setTextAlign('justify').run(),\n [editor],\n )\n\n const onChangeColor = useCallback(\n (color: string) => editor.chain().setColor(color).run(),\n [editor],\n )\n const onClearColor = useCallback(() => editor.chain().focus().unsetColor().run(), [editor])\n\n const onChangeHighlight = useCallback(\n (color: string) => editor.chain().setHighlight({ color }).run(),\n [editor],\n )\n const onClearHighlight = useCallback(\n () => editor.chain().focus().unsetHighlight().run(),\n [editor],\n )\n\n const onLink = useCallback(\n (url: string, inNewTab?: boolean) =>\n editor\n .chain()\n .focus()\n .setLink({ href: url, target: inNewTab ? '_blank' : '' })\n .run(),\n [editor],\n )\n\n // const onSetFont = useCallback(\n // (font: string) => {\n // if (!font || font.length === 0) {\n // return editor.chain().focus().unsetFontFamily().run()\n // }\n // return editor.chain().focus().setFontFamily(font).run()\n // },\n // [editor],\n // )\n\n const onSetFontSize = useCallback(\n (fontSize: string) => {\n if (!fontSize || fontSize.length === 0) {\n return editor.chain().focus().unsetFontSize().run()\n }\n return editor.chain().focus().setFontSize(fontSize).run()\n },\n [editor],\n )\n\n // AI Commands\n const onCompleteSentence = useCallback(() => {\n // TODO\n }, [editor])\n const onEmojify = useCallback(() => {\n // TODO\n }, [editor])\n const onFixSpelling = useCallback(() => {\n // TODO\n }, [editor])\n const onMakeLonger = useCallback(() => {\n // TODO\n }, [editor])\n const onMakeShorter = useCallback(() => {\n // TODO\n }, [editor])\n const onSimplify = useCallback(() => {\n // TODO\n }, [editor])\n const onTldr = useCallback(() => {\n // TODO\n }, [editor])\n const onTone = useCallback(() => {\n // TODO\n }, [editor])\n const onTranslate = useCallback(() => {\n // TODO\n }, [editor])\n\n const onClearFormatting = useCallback(() => {\n editor.chain().focus().clearNodes().unsetAllMarks().run()\n }, [editor])\n\n return {\n onBold,\n onItalic,\n onStrike,\n onUnderline,\n onCode,\n onCodeBlock,\n onSubscript,\n onSuperscript,\n onAlignLeft,\n onAlignCenter,\n onAlignRight,\n onAlignJustify,\n onChangeColor,\n onClearColor,\n onChangeHighlight,\n onClearHighlight,\n // onSetFont,\n onSetFontSize,\n onLink,\n onCompleteSentence,\n onEmojify,\n onFixSpelling,\n onMakeLonger,\n onMakeShorter,\n onSimplify,\n onTldr,\n onTone,\n onTranslate,\n onClearFormatting,\n }\n}\n"],"names":["useCallback","useTextmenuCommands","editor","onBold","chain","focus","toggleBold","run","onItalic","toggleItalic","onStrike","toggleStrike","onUnderline","toggleUnderline","onCode","toggleCode","onCodeBlock","toggleCodeBlock","onSubscript","toggleSubscript","onSuperscript","toggleSuperscript","onAlignLeft","setTextAlign","onAlignCenter","onAlignRight","onAlignJustify","onChangeColor","color","setColor","onClearColor","unsetColor","onChangeHighlight","setHighlight","onClearHighlight","unsetHighlight","onLink","url","inNewTab","setLink","href","target","onSetFontSize","fontSize","length","unsetFontSize","setFontSize","onCompleteSentence","onEmojify","onFixSpelling","onMakeLonger","onMakeShorter","on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AM6C,qBAAqB/C,YAAY;IACrC,OAAO;IACT,GAAG;QAACE;KAAO;IACX,MAAM8C,YAAYhD,YAAY;IAC5B,OAAO;IACT,GAAG;QAACE;KAAO;IACX,MAAM+C,gBAAgBjD,YAAY;IAChC,OAAO;IACT,GAAG;QAACE;KAAO;IACX,MAAMgD,eAAelD,YAAY;IAC/B,OAAO;IACT,GAAG;QAACE;KAAO;IACX,MAAMiD,gBAAgBnD,YAAY;IAChC,OAAO;IACT,GAAG;QAACE;KAAO;IACX,MAAMkD,aAAapD,YAAY;IAC7B,OAAO;IACT,GAAG;QAACE;KAAO;IACX,MAAMmD,SAASrD,YAAY;IACzB,OAAO;IACT,GAAG;QAACE;KAAO;IACX,MAAMoD,SAAStD,YAAY;IACzB,OAAO;IACT,GAAG;QAACE;KAAO;IACX,MAAMqD,cAAcvD,YAAY;IAC9B,OAAO;IACT,GAAG;QAACE;KAAO;IAEX,MAAMsD,oBAAoBxD,YAAY;QACpCE,OAAOE,KAAK,GAAGC,KAAK,GAAGoD,UAAU,GAAGC,aAAa,GAAGnD,GAAG;IACzD,GAAG;QAACL;KAAO;IAEX,OAAO;QACLC;QACAK;QACAE;QACAE;QACAE;QACAE;QACAE;QACAE;QACAE;QACAE;QACAC;QACAC;QACAC;QACAG;QACAE;QACAE;QACA,aAAa;QACbQ;QACAN;QACAW;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;IACF;AACF,EAAC"}
|
package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuContentTypes.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
|
-
import { Pilcrow, Heading1, Heading2, Heading3
|
|
2
|
+
import { Pilcrow, Heading1, Heading2, Heading3 } from "lucide-react";
|
|
3
3
|
import i18next from "i18next";
|
|
4
4
|
export const useTextmenuContentTypes = (editor)=>{
|
|
5
5
|
const options = useMemo(()=>{
|
|
@@ -62,29 +62,6 @@ export const useTextmenuContentTypes = (editor)=>{
|
|
|
62
62
|
}),
|
|
63
63
|
label: i18next.t("heading3") || "Heading 3",
|
|
64
64
|
type: "option"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
type: "category",
|
|
68
|
-
label: i18next.t("lists") || "Lists",
|
|
69
|
-
id: "lists"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
icon: List,
|
|
73
|
-
onClick: ()=>editor.chain().focus().toggleBulletList().run(),
|
|
74
|
-
id: "bulletList",
|
|
75
|
-
disabled: ()=>!editor.can().toggleBulletList(),
|
|
76
|
-
isActive: ()=>editor.isActive("bulletList"),
|
|
77
|
-
label: i18next.t("bulletList") || "Bullet list",
|
|
78
|
-
type: "option"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
icon: ListOrdered,
|
|
82
|
-
onClick: ()=>editor.chain().focus().toggleOrderedList().run(),
|
|
83
|
-
id: "orderedList",
|
|
84
|
-
disabled: ()=>!editor.can().toggleOrderedList(),
|
|
85
|
-
isActive: ()=>editor.isActive("orderedList"),
|
|
86
|
-
label: i18next.t("numberedList") || "Numbered list",
|
|
87
|
-
type: "option"
|
|
88
65
|
}
|
|
89
66
|
];
|
|
90
67
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
package/dist/src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuContentTypes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuContentTypes.ts"],"sourcesContent":["import { Editor } from \"@tiptap/react\";\nimport { useMemo } from \"react\";\nimport { ContentPickerOptions } from \"../components/ContentTypePicker.js\";\nimport {\n Pilcrow,\n Heading1,\n Heading2,\n Heading3,\n List,\n ListOrdered,\n ListTodo,\n} from \"lucide-react\";\nimport i18next from \"i18next\";\n\nexport const useTextmenuContentTypes = (editor: Editor) => {\n const options = useMemo<ContentPickerOptions>(() => {\n return [\n {\n type: \"category\",\n label: i18next.t(\"hierarchy\") || \"Hierarchy\",\n id: \"hierarchy\",\n },\n {\n icon: Pilcrow,\n onClick: () =>\n editor\n .chain()\n .focus()\n .lift(\"taskItem\")\n .liftListItem(\"listItem\")\n .setParagraph()\n .run(),\n id: \"paragraph\",\n disabled: () => !editor.can().setParagraph(),\n isActive: () =>\n editor.isActive(\"paragraph\") &&\n !editor.isActive(\"orderedList\") &&\n !editor.isActive(\"bulletList\") &&\n !editor.isActive(\"taskList\"),\n label: i18next.t(\"paragraph\") || \"Paragraph\",\n type: \"option\",\n },\n {\n icon: Heading1,\n onClick: () =>\n editor\n .chain()\n .focus()\n .lift(\"taskItem\")\n .liftListItem(\"listItem\")\n .setHeading({ level: 1 })\n .run(),\n id: \"heading1\",\n disabled: () => !editor.can().setHeading({ level: 1 }),\n isActive: () => editor.isActive(\"heading\", { level: 1 }),\n label: i18next.t(\"heading1\") || \"Heading 1\",\n type: \"option\",\n },\n {\n icon: Heading2,\n onClick: () =>\n editor\n .chain()\n .focus()\n .lift(\"taskItem\")\n .liftListItem(\"listItem\")\n .setHeading({ level: 2 })\n .run(),\n id: \"heading2\",\n disabled: () => !editor.can().setHeading({ level: 2 }),\n isActive: () => editor.isActive(\"heading\", { level: 2 }),\n label: i18next.t(\"heading2\") || \"Heading 2\",\n type: \"option\",\n },\n {\n icon: Heading3,\n onClick: () =>\n editor\n .chain()\n .focus()\n .lift(\"taskItem\")\n .liftListItem(\"listItem\")\n .setHeading({ level: 3 })\n .run(),\n id: \"heading3\",\n disabled: () => !editor.can().setHeading({ level: 3 }),\n isActive: () => editor.isActive(\"heading\", { level: 3 }),\n label: i18next.t(\"heading3\") || \"Heading 3\",\n type: \"option\",\n },\n {\n
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../src/fields/TiptapEditor/features/menus/TextMenu/hooks/useTextmenuContentTypes.ts"],"sourcesContent":["import { Editor } from \"@tiptap/react\";\nimport { useMemo } from \"react\";\nimport { ContentPickerOptions } from \"../components/ContentTypePicker.js\";\nimport {\n Pilcrow,\n Heading1,\n Heading2,\n Heading3,\n List,\n ListOrdered,\n ListTodo,\n} from \"lucide-react\";\nimport i18next from \"i18next\";\n\nexport const useTextmenuContentTypes = (editor: Editor) => {\n const options = useMemo<ContentPickerOptions>(() => {\n return [\n {\n type: \"category\",\n label: i18next.t(\"hierarchy\") || \"Hierarchy\",\n id: \"hierarchy\",\n },\n {\n icon: Pilcrow,\n onClick: () =>\n editor\n .chain()\n .focus()\n .lift(\"taskItem\")\n .liftListItem(\"listItem\")\n .setParagraph()\n .run(),\n id: \"paragraph\",\n disabled: () => !editor.can().setParagraph(),\n isActive: () =>\n editor.isActive(\"paragraph\") &&\n !editor.isActive(\"orderedList\") &&\n !editor.isActive(\"bulletList\") &&\n !editor.isActive(\"taskList\"),\n label: i18next.t(\"paragraph\") || \"Paragraph\",\n type: \"option\",\n },\n {\n icon: Heading1,\n onClick: () =>\n editor\n .chain()\n .focus()\n .lift(\"taskItem\")\n .liftListItem(\"listItem\")\n .setHeading({ level: 1 })\n .run(),\n id: \"heading1\",\n disabled: () => !editor.can().setHeading({ level: 1 }),\n isActive: () => editor.isActive(\"heading\", { level: 1 }),\n label: i18next.t(\"heading1\") || \"Heading 1\",\n type: \"option\",\n },\n {\n icon: Heading2,\n onClick: () =>\n editor\n .chain()\n .focus()\n .lift(\"taskItem\")\n .liftListItem(\"listItem\")\n .setHeading({ level: 2 })\n .run(),\n id: \"heading2\",\n disabled: () => !editor.can().setHeading({ level: 2 }),\n isActive: () => editor.isActive(\"heading\", { level: 2 }),\n label: i18next.t(\"heading2\") || \"Heading 2\",\n type: \"option\",\n },\n {\n icon: Heading3,\n onClick: () =>\n editor\n .chain()\n .focus()\n .lift(\"taskItem\")\n .liftListItem(\"listItem\")\n .setHeading({ level: 3 })\n .run(),\n id: \"heading3\",\n disabled: () => !editor.can().setHeading({ level: 3 }),\n isActive: () => editor.isActive(\"heading\", { level: 3 }),\n label: i18next.t(\"heading3\") || \"Heading 3\",\n type: \"option\",\n },\n // {\n // type: \"category\",\n // label: i18next.t(\"lists\") || \"Lists\",\n // id: \"lists\",\n // },\n // {\n // icon: List,\n // onClick: () => editor.chain().focus().toggleBulletList().run(),\n // id: \"bulletList\",\n // disabled: () => !editor.can().toggleBulletList(),\n // isActive: () => editor.isActive(\"bulletList\"),\n // label: i18next.t(\"bulletList\") || \"Bullet list\",\n // type: \"option\",\n // },\n // {\n // icon: ListOrdered,\n // onClick: () => editor.chain().focus().toggleOrderedList().run(),\n // id: \"orderedList\",\n // disabled: () => !editor.can().toggleOrderedList(),\n // isActive: () => editor.isActive(\"orderedList\"),\n // label: i18next.t(\"numberedList\") || \"Numbered list\",\n // type: \"option\",\n // },\n // {\n // icon: ListTodo,\n // onClick: () => editor.chain().focus().toggleTaskList().run(),\n // id: 'todoList',\n // disabled: () => !editor.can().toggleTaskList(),\n // isActive: () => editor.isActive('taskList'),\n // label: 'Todo list',\n // type: 'option',\n // },\n ];\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [editor, editor.state]);\n\n return options;\n};\n"],"names":["useMemo","Pilcrow","Heading1","Heading2","Heading3","i18next","useTextmenuContentTypes","editor","options","type","label","t","id","icon","onClick","chain","focus","lift","liftListItem","setParagraph","run","disabled","can","isActive","setHeading","level","state"],"mappings":"AACA,SAASA,OAAO,QAAQ,QAAQ;AAEhC,SACEC,OAAO,EACPC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,QAIH,eAAe;AACtB,OAAOC,aAAa,UAAU;AAE9B,OAAO,MAAMC,0BAA0B,CAACC;IACtC,MAAMC,UAAUR,QAA8B;QAC5C,OAAO;YACL;gBACES,MAAM;gBACNC,OAAOL,QAAQM,CAAC,CAAC,gBAAgB;gBACjCC,IAAI;YACN;YACA;gBACEC,MAAMZ;gBACNa,SAAS,IACPP,OACGQ,KAAK,GACLC,KAAK,GACLC,IAAI,CAAC,YACLC,YAAY,CAAC,YACbC,YAAY,GACZC,GAAG;gBACRR,IAAI;g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