@maily-to/core 0.0.27 → 0.1.0

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.
@@ -6,11 +6,26 @@ interface CommandProps {
6
6
  }
7
7
  type BlockItem = {
8
8
  title: string;
9
- description: string;
9
+ description?: string;
10
10
  searchTerms: string[];
11
- icon: JSX.Element;
12
- shouldBeHidden?: (editor: Editor) => boolean;
11
+ icon?: JSX.Element;
12
+ render?: (editor: Editor) => JSX.Element | null | true;
13
+ } & ({
13
14
  command: (options: CommandProps) => void;
15
+ id?: never;
16
+ commands?: never;
17
+ } | {
18
+ /**
19
+ * id to be used for the slash command query
20
+ * `headers.` will go inside the header subcommand
21
+ */
22
+ id: string;
23
+ command?: never;
24
+ commands: BlockItem[];
25
+ });
26
+ type BlockGroupItem = {
27
+ title: string;
28
+ commands: BlockItem[];
14
29
  };
15
30
 
16
31
  declare const button: BlockItem;
@@ -18,6 +33,7 @@ declare const linkCard: BlockItem;
18
33
 
19
34
  declare const image: BlockItem;
20
35
  declare const logo: BlockItem;
36
+ declare const inlineImage: BlockItem;
21
37
 
22
38
  declare const columns: BlockItem;
23
39
  declare const section: BlockItem;
@@ -37,4 +53,4 @@ declare const blockquote: BlockItem;
37
53
  declare const footer: BlockItem;
38
54
  declare const clearLine: BlockItem;
39
55
 
40
- export { type BlockItem, blockquote, bulletList, button, clearLine, columns, divider, footer, hardBreak, heading1, heading2, heading3, image, linkCard, logo, orderedList, repeat, section, spacer, text };
56
+ export { type BlockGroupItem, type BlockItem, blockquote, bulletList, button, clearLine, columns, divider, footer, hardBreak, heading1, heading2, heading3, image, inlineImage, linkCard, logo, orderedList, repeat, section, spacer, text };
@@ -6,11 +6,26 @@ interface CommandProps {
6
6
  }
7
7
  type BlockItem = {
8
8
  title: string;
9
- description: string;
9
+ description?: string;
10
10
  searchTerms: string[];
11
- icon: JSX.Element;
12
- shouldBeHidden?: (editor: Editor) => boolean;
11
+ icon?: JSX.Element;
12
+ render?: (editor: Editor) => JSX.Element | null | true;
13
+ } & ({
13
14
  command: (options: CommandProps) => void;
15
+ id?: never;
16
+ commands?: never;
17
+ } | {
18
+ /**
19
+ * id to be used for the slash command query
20
+ * `headers.` will go inside the header subcommand
21
+ */
22
+ id: string;
23
+ command?: never;
24
+ commands: BlockItem[];
25
+ });
26
+ type BlockGroupItem = {
27
+ title: string;
28
+ commands: BlockItem[];
14
29
  };
15
30
 
16
31
  declare const button: BlockItem;
@@ -18,6 +33,7 @@ declare const linkCard: BlockItem;
18
33
 
19
34
  declare const image: BlockItem;
20
35
  declare const logo: BlockItem;
36
+ declare const inlineImage: BlockItem;
21
37
 
22
38
  declare const columns: BlockItem;
23
39
  declare const section: BlockItem;
@@ -37,4 +53,4 @@ declare const blockquote: BlockItem;
37
53
  declare const footer: BlockItem;
38
54
  declare const clearLine: BlockItem;
39
55
 
40
- export { type BlockItem, blockquote, bulletList, button, clearLine, columns, divider, footer, hardBreak, heading1, heading2, heading3, image, linkCard, logo, orderedList, repeat, section, spacer, text };
56
+ export { type BlockGroupItem, type BlockItem, blockquote, bulletList, button, clearLine, columns, divider, footer, hardBreak, heading1, heading2, heading3, image, inlineImage, linkCard, logo, orderedList, repeat, section, spacer, text };
@@ -32,6 +32,7 @@ __export(blocks_exports, {
32
32
  heading2: () => heading2,
33
33
  heading3: () => heading3,
34
34
  image: () => image,
35
+ inlineImage: () => inlineImage,
35
36
  linkCard: () => linkCard,
36
37
  logo: () => logo,
37
38
  orderedList: () => orderedList,
@@ -62,14 +63,15 @@ var linkCard = {
62
63
  command: ({ editor, range }) => {
63
64
  editor.chain().focus().deleteRange(range).setLinkCard().run();
64
65
  },
65
- shouldBeHidden: (editor) => {
66
+ render: (editor) => {
66
67
  return editor.extensionManager.extensions.findIndex(
67
68
  (ext) => ext.name === "linkCard"
68
- ) === -1;
69
+ ) === -1 ? null : true;
69
70
  }
70
71
  };
71
72
 
72
73
  // src/blocks/image.tsx
74
+ var import_state = require("@tiptap/pm/state");
73
75
  var import_lucide_react2 = require("lucide-react");
74
76
  var import_jsx_runtime2 = require("react/jsx-runtime");
75
77
  var image = {
@@ -90,6 +92,31 @@ var logo = {
90
92
  editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
91
93
  }
92
94
  };
95
+ var inlineImage = {
96
+ title: "Inline Image",
97
+ description: "Inline image",
98
+ searchTerms: ["image", "inline"],
99
+ icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.ImageIcon, { className: "mly-h-4 mly-w-4" }),
100
+ command: ({ editor, range }) => {
101
+ editor.chain().focus().deleteRange(range).setInlineImage({
102
+ src: ""
103
+ }).command((props) => {
104
+ const { tr, state, view, editor: editor2 } = props;
105
+ const { from } = range;
106
+ const node = state.doc.nodeAt(from);
107
+ if (!node) {
108
+ return false;
109
+ }
110
+ const selection = import_state.TextSelection.create(
111
+ tr.doc,
112
+ from,
113
+ from + node.nodeSize
114
+ );
115
+ tr.setSelection(selection);
116
+ return true;
117
+ }).run();
118
+ }
119
+ };
93
120
 
94
121
  // src/blocks/layout.tsx
95
122
  var import_lucide_react3 = require("lucide-react");
@@ -99,9 +126,6 @@ var columns = {
99
126
  description: "Add columns to email.",
100
127
  searchTerms: ["layout", "columns"],
101
128
  icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
102
- shouldBeHidden: (editor) => {
103
- return editor.isActive("columns");
104
- },
105
129
  command: ({ editor, range }) => {
106
130
  editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
107
131
  }
@@ -120,9 +144,6 @@ var repeat = {
120
144
  description: "Loop over an array of items.",
121
145
  searchTerms: ["repeat", "for", "loop"],
122
146
  icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Repeat2, { className: "mly-h-4 mly-w-4" }),
123
- shouldBeHidden: (editor) => {
124
- return editor.isActive("repeat");
125
- },
126
147
  command: ({ editor, range }) => {
127
148
  editor.chain().focus().deleteRange(range).setRepeat().run();
128
149
  }
@@ -257,6 +278,7 @@ var clearLine = {
257
278
  heading2,
258
279
  heading3,
259
280
  image,
281
+ inlineImage,
260
282
  linkCard,
261
283
  logo,
262
284
  orderedList,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/blocks.ts","../../src/blocks/button.tsx","../../src/blocks/image.tsx","../../src/blocks/layout.tsx","../../src/blocks/list.tsx","../../src/blocks/typography.tsx"],"sourcesContent":["export * from './blocks/button';\nexport * from './blocks/image';\nexport * from './blocks/layout';\nexport * from './blocks/list';\nexport * from './blocks/typography';\nexport * from './blocks/types';\n","import type { BlockItem } from './types';\nimport { MousePointer, ArrowUpRightSquare } from 'lucide-react';\n\nexport const button: BlockItem = {\n title: 'Button',\n description: 'Add a call to action button to email.',\n searchTerms: ['link', 'button', 'cta'],\n icon: <MousePointer className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setButton().run();\n },\n};\n\nexport const linkCard: BlockItem = {\n title: 'Link Card',\n description: 'Add a link card to email.',\n searchTerms: ['link', 'button', 'image'],\n icon: <ArrowUpRightSquare className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setLinkCard().run();\n },\n shouldBeHidden: (editor) => {\n return (\n editor.extensionManager.extensions.findIndex(\n (ext) => ext.name === 'linkCard'\n ) === -1\n );\n },\n};\n","import type { BlockItem } from './types';\nimport { ImageIcon } from 'lucide-react';\n\nexport const image: BlockItem = {\n title: 'Image',\n description: 'Full width image',\n searchTerms: ['image'],\n icon: <ImageIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setImage({ src: '' }).run();\n },\n};\n\nexport const logo: BlockItem = {\n title: 'Logo',\n description: 'Add your brand logo',\n searchTerms: ['image', 'logo'],\n icon: <ImageIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setLogoImage({ src: '' }).run();\n },\n};\n","import type { BlockItem } from './types';\nimport {\n ColumnsIcon,\n Repeat2,\n MoveVertical,\n RectangleHorizontal,\n Minus,\n} from 'lucide-react';\n\nexport const columns: BlockItem = {\n title: 'Columns',\n description: 'Add columns to email.',\n searchTerms: ['layout', 'columns'],\n icon: <ColumnsIcon className=\"mly-h-4 mly-w-4\" />,\n shouldBeHidden: (editor) => {\n return editor.isActive('columns');\n },\n command: ({ editor, range }) => {\n // @ts-ignore\n editor\n .chain()\n .focus()\n .deleteRange(range)\n // @ts-ignore\n .setColumns()\n .focus(editor.state.selection.head - 2)\n .run();\n },\n};\n\nexport const section: BlockItem = {\n title: 'Section',\n description: 'Add a section to email.',\n searchTerms: ['layout', 'section'],\n icon: <RectangleHorizontal className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setSection().run();\n },\n};\n\nexport const repeat: BlockItem = {\n title: 'Repeat',\n description: 'Loop over an array of items.',\n searchTerms: ['repeat', 'for', 'loop'],\n icon: <Repeat2 className=\"mly-h-4 mly-w-4\" />,\n shouldBeHidden: (editor) => {\n return editor.isActive('repeat');\n },\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setRepeat().run();\n },\n};\n\nexport const spacer: BlockItem = {\n title: 'Spacer',\n description: 'Add space between blocks.',\n searchTerms: ['space', 'gap', 'divider'],\n icon: <MoveVertical className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setSpacer({ height: 'sm' }).run();\n },\n};\n\nexport const divider: BlockItem = {\n title: 'Divider',\n description: 'Add a horizontal divider.',\n searchTerms: ['divider', 'line'],\n icon: <Minus className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setHorizontalRule().run();\n },\n};\n","import type { BlockItem } from './types';\nimport { List, ListOrdered } from 'lucide-react';\n\nexport const bulletList: BlockItem = {\n title: 'Bullet List',\n description: 'Create a simple bullet list.',\n searchTerms: ['unordered', 'point'],\n icon: <List className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).toggleBulletList().run();\n },\n};\n\nexport const orderedList: BlockItem = {\n title: 'Numbered List',\n description: 'Create a list with numbering.',\n searchTerms: ['ordered'],\n icon: <ListOrdered className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).toggleOrderedList().run();\n },\n};\n","import type { BlockItem } from './types';\nimport {\n Text,\n Heading1,\n Heading2,\n Heading3,\n DivideIcon,\n TextQuote,\n FootprintsIcon,\n EraserIcon,\n} from 'lucide-react';\n\nexport const text: BlockItem = {\n title: 'Text',\n description: 'Just start typing with plain text.',\n searchTerms: ['p', 'paragraph'],\n icon: <Text className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .toggleNode('paragraph', 'paragraph')\n .run();\n },\n};\n\nexport const heading1: BlockItem = {\n title: 'Heading 1',\n description: 'Big heading.',\n searchTerms: ['title', 'big', 'large'],\n icon: <Heading1 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', { level: 1 })\n .run();\n },\n};\n\nexport const heading2: BlockItem = {\n title: 'Heading 2',\n description: 'Medium heading.',\n searchTerms: ['subtitle', 'medium'],\n icon: <Heading2 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', { level: 2 })\n .run();\n },\n};\n\nexport const heading3: BlockItem = {\n title: 'Heading 3',\n description: 'Small heading.',\n searchTerms: ['subtitle', 'small'],\n icon: <Heading3 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', { level: 3 })\n .run();\n },\n};\n\nexport const hardBreak: BlockItem = {\n title: 'Hard Break',\n description: 'Add a break between lines.',\n searchTerms: ['break', 'line'],\n icon: <DivideIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setHardBreak().run();\n },\n};\n\nexport const blockquote: BlockItem = {\n title: 'Blockquote',\n description: 'Add blockquote.',\n searchTerms: ['quote', 'blockquote'],\n icon: <TextQuote className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).toggleBlockquote().run();\n },\n};\n\nexport const footer: BlockItem = {\n title: 'Footer',\n description: 'Add a footer text to email.',\n searchTerms: ['footer', 'text'],\n icon: <FootprintsIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setFooter().run();\n },\n};\n\nexport const clearLine: BlockItem = {\n title: 'Clear Line',\n description: 'Clear the current line.',\n searchTerms: ['clear', 'line'],\n icon: <EraserIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().selectParentNode().deleteSelection().run();\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,0BAAiD;AAMzC;AAJD,IAAM,SAAoB;AAAA,EAC/B,OAAO;AAAA,EACP,aAAa;AAAA,EACb,aAAa,CAAC,QAAQ,UAAU,KAAK;AAAA,EACrC,MAAM,4CAAC,oCAAa,WAAU,mBAAkB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AAM,EAAE,YAAY,KAAK,EAAE,aAAa,EAAE,IAAI;AAAA,EAC/D;AACF;AAEO,IAAM,aAAwB;AAAA,EACnC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,aAAa,CAAC,SAAS,YAAY;AAAA,EACnC,MAAM,6CAAC,kCAAU,WAAU,mBAAkB;AAAA,EAC7C,SAAS,CAAC,EAAE,QAAQ,MAAM,MAAM;AAE9B,WAAO,MAAM,EAAE,MAAM,EAAE,YAAY,KAAK,EAAE,iBAAiB,EAAE,IAAI;AAAA,EACnE;AACF;AAEO,IAAM,SAAoB;AAAA,EAC/B,OAAO;AAAA,EACP,aAAa;AAAA,EACb,aAAa,CAAC,UAAU,MAAM;AAAA,EAC9B,MAAM,6CAAC,uCAAe,WAAU,mBAAkB;AAAA,EAClD,SAAS,CAAC,EAAE,QAAQ,MAAM,MAAM;AAE9B,WAAO,MAAM,EAAE,MAAM,EAAE,YAAY,KAAK,EAAE,UAAU,EAAE,IAAI;AAAA,EAC5D;AACF;AAEO,IAAM,YAAuB;AAAA,EAClC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,aAAa,CAAC,SAAS,MAAM;AAAA,EAC7B,MAAM,6CAAC,mCAAW,WAAU,mBAAkB;AAAA,EAC9C,SAAS,CAAC,EAAE,QAAQ,MAAM,MAAM;AAE9B,WAAO,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,IAAI;AAAA,EAClE;AACF;","names":["import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime"]}
1
+ {"version":3,"sources":["../../src/blocks.ts","../../src/blocks/button.tsx","../../src/blocks/image.tsx","../../src/blocks/layout.tsx","../../src/blocks/list.tsx","../../src/blocks/typography.tsx"],"sourcesContent":["export * from './blocks/button';\nexport * from './blocks/image';\nexport * from './blocks/layout';\nexport * from './blocks/list';\nexport * from './blocks/typography';\nexport * from './blocks/types';\n","import type { BlockItem } from './types';\nimport { MousePointer, ArrowUpRightSquare } from 'lucide-react';\n\nexport const button: BlockItem = {\n title: 'Button',\n description: 'Add a call to action button to email.',\n searchTerms: ['link', 'button', 'cta'],\n icon: <MousePointer className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setButton().run();\n },\n};\n\nexport const linkCard: BlockItem = {\n title: 'Link Card',\n description: 'Add a link card to email.',\n searchTerms: ['link', 'button', 'image'],\n icon: <ArrowUpRightSquare className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setLinkCard().run();\n },\n render: (editor) => {\n return editor.extensionManager.extensions.findIndex(\n (ext) => ext.name === 'linkCard'\n ) === -1\n ? null\n : true;\n },\n};\n","import { NodeSelection, Selection, TextSelection } from '@tiptap/pm/state';\nimport type { BlockItem } from './types';\nimport { ImageIcon } from 'lucide-react';\n\nexport const image: BlockItem = {\n title: 'Image',\n description: 'Full width image',\n searchTerms: ['image'],\n icon: <ImageIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setImage({ src: '' }).run();\n },\n};\n\nexport const logo: BlockItem = {\n title: 'Logo',\n description: 'Add your brand logo',\n searchTerms: ['image', 'logo'],\n icon: <ImageIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setLogoImage({ src: '' }).run();\n },\n};\n\nexport const inlineImage: BlockItem = {\n title: 'Inline Image',\n description: 'Inline image',\n searchTerms: ['image', 'inline'],\n icon: <ImageIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor\n .chain()\n .focus()\n .deleteRange(range)\n // @ts-ignore\n .setInlineImage({\n src: '',\n })\n // @ts-ignore\n .command((props) => {\n const { tr, state, view, editor } = props;\n const { from } = range;\n\n const node = state.doc.nodeAt(from);\n if (!node) {\n return false;\n }\n\n const selection = TextSelection.create(\n tr.doc,\n from,\n from + node.nodeSize\n );\n tr.setSelection(selection);\n return true;\n })\n .run();\n },\n};\n","import type { BlockItem } from './types';\nimport {\n ColumnsIcon,\n Repeat2,\n MoveVertical,\n RectangleHorizontal,\n Minus,\n} from 'lucide-react';\n\nexport const columns: BlockItem = {\n title: 'Columns',\n description: 'Add columns to email.',\n searchTerms: ['layout', 'columns'],\n icon: <ColumnsIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor\n .chain()\n .focus()\n .deleteRange(range)\n // @ts-ignore\n .setColumns()\n .focus(editor.state.selection.head - 2)\n .run();\n },\n};\n\nexport const section: BlockItem = {\n title: 'Section',\n description: 'Add a section to email.',\n searchTerms: ['layout', 'section'],\n icon: <RectangleHorizontal className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setSection().run();\n },\n};\n\nexport const repeat: BlockItem = {\n title: 'Repeat',\n description: 'Loop over an array of items.',\n searchTerms: ['repeat', 'for', 'loop'],\n icon: <Repeat2 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setRepeat().run();\n },\n};\n\nexport const spacer: BlockItem = {\n title: 'Spacer',\n description: 'Add space between blocks.',\n searchTerms: ['space', 'gap', 'divider'],\n icon: <MoveVertical className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setSpacer({ height: 'sm' }).run();\n },\n};\n\nexport const divider: BlockItem = {\n title: 'Divider',\n description: 'Add a horizontal divider.',\n searchTerms: ['divider', 'line'],\n icon: <Minus className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setHorizontalRule().run();\n },\n};\n","import type { BlockItem } from './types';\nimport { List, ListOrdered } from 'lucide-react';\n\nexport const bulletList: BlockItem = {\n title: 'Bullet List',\n description: 'Create a simple bullet list.',\n searchTerms: ['unordered', 'point'],\n icon: <List className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).toggleBulletList().run();\n },\n};\n\nexport const orderedList: BlockItem = {\n title: 'Numbered List',\n description: 'Create a list with numbering.',\n searchTerms: ['ordered'],\n icon: <ListOrdered className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).toggleOrderedList().run();\n },\n};\n","import type { BlockItem } from './types';\nimport {\n Text,\n Heading1,\n Heading2,\n Heading3,\n DivideIcon,\n TextQuote,\n FootprintsIcon,\n EraserIcon,\n} from 'lucide-react';\n\nexport const text: BlockItem = {\n title: 'Text',\n description: 'Just start typing with plain text.',\n searchTerms: ['p', 'paragraph'],\n icon: <Text className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .toggleNode('paragraph', 'paragraph')\n .run();\n },\n};\n\nexport const heading1: BlockItem = {\n title: 'Heading 1',\n description: 'Big heading.',\n searchTerms: ['title', 'big', 'large'],\n icon: <Heading1 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', { level: 1 })\n .run();\n },\n};\n\nexport const heading2: BlockItem = {\n title: 'Heading 2',\n description: 'Medium heading.',\n searchTerms: ['subtitle', 'medium'],\n icon: <Heading2 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', { level: 2 })\n .run();\n },\n};\n\nexport const heading3: BlockItem = {\n title: 'Heading 3',\n description: 'Small heading.',\n searchTerms: ['subtitle', 'small'],\n icon: <Heading3 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', { level: 3 })\n .run();\n },\n};\n\nexport const hardBreak: BlockItem = {\n title: 'Hard Break',\n description: 'Add a break between lines.',\n searchTerms: ['break', 'line'],\n icon: <DivideIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setHardBreak().run();\n },\n};\n\nexport const blockquote: BlockItem = {\n title: 'Blockquote',\n description: 'Add blockquote.',\n searchTerms: ['quote', 'blockquote'],\n icon: <TextQuote className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).toggleBlockquote().run();\n },\n};\n\nexport const footer: BlockItem = {\n title: 'Footer',\n description: 'Add a footer text to email.',\n searchTerms: ['footer', 'text'],\n icon: <FootprintsIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setFooter().run();\n },\n};\n\nexport const clearLine: BlockItem = {\n title: 'Clear Line',\n description: 'Clear the current line.',\n searchTerms: ['clear', 'line'],\n icon: <EraserIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().selectParentNode().deleteSelection().run();\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACCA,0BAAiD;AAMzC;AAJD,IAAM,SAAoB;AAAA,EAC/B,OAAO;AAAA,EACP,aAAa;AAAA,EACb,aAAa,CAAC,QAAQ,UAAU,KAAK;AAAA,EACrC,MAAM,4CAAC,oCAAa,WAAU,mBAAkB;AAAA,EAChD,SAAS,CAAC,EAAE,QAAQ,MAAM,MAAM;AAE9B,WA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,SAAS,CAAC,EAAE,QAAQ,MAAM,MAAM;AAE9B,WAAO,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,IAAI;AAAA,EAClE;AACF;","names":["import_lucide_react","import_jsx_runtime","editor","import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime"]}
@@ -18,14 +18,15 @@ var linkCard = {
18
18
  command: ({ editor, range }) => {
19
19
  editor.chain().focus().deleteRange(range).setLinkCard().run();
20
20
  },
21
- shouldBeHidden: (editor) => {
21
+ render: (editor) => {
22
22
  return editor.extensionManager.extensions.findIndex(
23
23
  (ext) => ext.name === "linkCard"
24
- ) === -1;
24
+ ) === -1 ? null : true;
25
25
  }
26
26
  };
27
27
 
28
28
  // src/blocks/image.tsx
29
+ import { TextSelection } from "@tiptap/pm/state";
29
30
  import { ImageIcon } from "lucide-react";
30
31
  import { jsx as jsx2 } from "react/jsx-runtime";
31
32
  var image = {
@@ -46,6 +47,31 @@ var logo = {
46
47
  editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
47
48
  }
48
49
  };
50
+ var inlineImage = {
51
+ title: "Inline Image",
52
+ description: "Inline image",
53
+ searchTerms: ["image", "inline"],
54
+ icon: /* @__PURE__ */ jsx2(ImageIcon, { className: "mly-h-4 mly-w-4" }),
55
+ command: ({ editor, range }) => {
56
+ editor.chain().focus().deleteRange(range).setInlineImage({
57
+ src: ""
58
+ }).command((props) => {
59
+ const { tr, state, view, editor: editor2 } = props;
60
+ const { from } = range;
61
+ const node = state.doc.nodeAt(from);
62
+ if (!node) {
63
+ return false;
64
+ }
65
+ const selection = TextSelection.create(
66
+ tr.doc,
67
+ from,
68
+ from + node.nodeSize
69
+ );
70
+ tr.setSelection(selection);
71
+ return true;
72
+ }).run();
73
+ }
74
+ };
49
75
 
50
76
  // src/blocks/layout.tsx
51
77
  import {
@@ -61,9 +87,6 @@ var columns = {
61
87
  description: "Add columns to email.",
62
88
  searchTerms: ["layout", "columns"],
63
89
  icon: /* @__PURE__ */ jsx3(ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
64
- shouldBeHidden: (editor) => {
65
- return editor.isActive("columns");
66
- },
67
90
  command: ({ editor, range }) => {
68
91
  editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
69
92
  }
@@ -82,9 +105,6 @@ var repeat = {
82
105
  description: "Loop over an array of items.",
83
106
  searchTerms: ["repeat", "for", "loop"],
84
107
  icon: /* @__PURE__ */ jsx3(Repeat2, { className: "mly-h-4 mly-w-4" }),
85
- shouldBeHidden: (editor) => {
86
- return editor.isActive("repeat");
87
- },
88
108
  command: ({ editor, range }) => {
89
109
  editor.chain().focus().deleteRange(range).setRepeat().run();
90
110
  }
@@ -227,6 +247,7 @@ export {
227
247
  heading2,
228
248
  heading3,
229
249
  image,
250
+ inlineImage,
230
251
  linkCard,
231
252
  logo,
232
253
  orderedList,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/blocks/button.tsx","../../src/blocks/image.tsx","../../src/blocks/layout.tsx","../../src/blocks/list.tsx","../../src/blocks/typography.tsx"],"sourcesContent":["import type { BlockItem } from './types';\nimport { MousePointer, ArrowUpRightSquare } from 'lucide-react';\n\nexport const button: BlockItem = {\n title: 'Button',\n description: 'Add a call to action button to email.',\n searchTerms: ['link', 'button', 'cta'],\n icon: <MousePointer className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setButton().run();\n },\n};\n\nexport const linkCard: BlockItem = {\n title: 'Link Card',\n description: 'Add a link card to email.',\n searchTerms: ['link', 'button', 'image'],\n icon: <ArrowUpRightSquare className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setLinkCard().run();\n },\n shouldBeHidden: (editor) => {\n return (\n editor.extensionManager.extensions.findIndex(\n (ext) => ext.name === 'linkCard'\n ) === -1\n );\n },\n};\n","import type { BlockItem } from './types';\nimport { ImageIcon } from 'lucide-react';\n\nexport const image: BlockItem = {\n title: 'Image',\n description: 'Full width image',\n searchTerms: ['image'],\n icon: <ImageIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setImage({ src: '' }).run();\n },\n};\n\nexport const logo: BlockItem = {\n title: 'Logo',\n description: 'Add your brand logo',\n searchTerms: ['image', 'logo'],\n icon: <ImageIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setLogoImage({ src: '' }).run();\n },\n};\n","import type { BlockItem } from './types';\nimport {\n ColumnsIcon,\n Repeat2,\n MoveVertical,\n RectangleHorizontal,\n Minus,\n} from 'lucide-react';\n\nexport const columns: BlockItem = {\n title: 'Columns',\n description: 'Add columns to email.',\n searchTerms: ['layout', 'columns'],\n icon: <ColumnsIcon className=\"mly-h-4 mly-w-4\" />,\n shouldBeHidden: (editor) => {\n return editor.isActive('columns');\n },\n command: ({ editor, range }) => {\n // @ts-ignore\n editor\n .chain()\n .focus()\n .deleteRange(range)\n // @ts-ignore\n .setColumns()\n .focus(editor.state.selection.head - 2)\n .run();\n },\n};\n\nexport const section: BlockItem = {\n title: 'Section',\n description: 'Add a section to email.',\n searchTerms: ['layout', 'section'],\n icon: <RectangleHorizontal className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setSection().run();\n },\n};\n\nexport const repeat: BlockItem = {\n title: 'Repeat',\n description: 'Loop over an array of items.',\n searchTerms: ['repeat', 'for', 'loop'],\n icon: <Repeat2 className=\"mly-h-4 mly-w-4\" />,\n shouldBeHidden: (editor) => {\n return editor.isActive('repeat');\n },\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setRepeat().run();\n },\n};\n\nexport const spacer: BlockItem = {\n title: 'Spacer',\n description: 'Add space between blocks.',\n searchTerms: ['space', 'gap', 'divider'],\n icon: <MoveVertical className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setSpacer({ height: 'sm' }).run();\n },\n};\n\nexport const divider: BlockItem = {\n title: 'Divider',\n description: 'Add a horizontal divider.',\n searchTerms: ['divider', 'line'],\n icon: <Minus className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setHorizontalRule().run();\n },\n};\n","import type { BlockItem } from './types';\nimport { List, ListOrdered } from 'lucide-react';\n\nexport const bulletList: BlockItem = {\n title: 'Bullet List',\n description: 'Create a simple bullet list.',\n searchTerms: ['unordered', 'point'],\n icon: <List className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).toggleBulletList().run();\n },\n};\n\nexport const orderedList: BlockItem = {\n title: 'Numbered List',\n description: 'Create a list with numbering.',\n searchTerms: ['ordered'],\n icon: <ListOrdered className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).toggleOrderedList().run();\n },\n};\n","import type { BlockItem } from './types';\nimport {\n Text,\n Heading1,\n Heading2,\n Heading3,\n DivideIcon,\n TextQuote,\n FootprintsIcon,\n EraserIcon,\n} from 'lucide-react';\n\nexport const text: BlockItem = {\n title: 'Text',\n description: 'Just start typing with plain text.',\n searchTerms: ['p', 'paragraph'],\n icon: <Text className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .toggleNode('paragraph', 'paragraph')\n .run();\n },\n};\n\nexport const heading1: BlockItem = {\n title: 'Heading 1',\n description: 'Big heading.',\n searchTerms: ['title', 'big', 'large'],\n icon: <Heading1 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', { level: 1 })\n .run();\n },\n};\n\nexport const heading2: BlockItem = {\n title: 'Heading 2',\n description: 'Medium heading.',\n searchTerms: ['subtitle', 'medium'],\n icon: <Heading2 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', { level: 2 })\n .run();\n },\n};\n\nexport const heading3: BlockItem = {\n title: 'Heading 3',\n description: 'Small heading.',\n searchTerms: ['subtitle', 'small'],\n icon: <Heading3 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', { level: 3 })\n .run();\n },\n};\n\nexport const hardBreak: BlockItem = {\n title: 'Hard Break',\n description: 'Add a break between lines.',\n searchTerms: ['break', 'line'],\n icon: <DivideIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setHardBreak().run();\n },\n};\n\nexport const blockquote: BlockItem = {\n title: 'Blockquote',\n description: 'Add blockquote.',\n searchTerms: ['quote', 'blockquote'],\n icon: <TextQuote className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).toggleBlockquote().run();\n },\n};\n\nexport const footer: BlockItem = {\n title: 'Footer',\n description: 'Add a footer text to email.',\n searchTerms: ['footer', 'text'],\n icon: <FootprintsIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setFooter().run();\n },\n};\n\nexport const clearLine: BlockItem = {\n title: 'Clear Line',\n description: 'Clear the current line.',\n searchTerms: ['clear', 'line'],\n icon: <EraserIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().selectParentNode().deleteSelection().run();\n },\n};\n"],"mappings":";AACA,SAAS,cAAc,0BAA0B;AAMz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EAAE,iBAAiB,EAAE,gBAAgB,EAAE,IAAI;AAAA,EAClE;AACF;","names":["jsx","jsx","jsx","jsx"]}
1
+ {"version":3,"sources":["../../src/blocks/button.tsx","../../src/blocks/image.tsx","../../src/blocks/layout.tsx","../../src/blocks/list.tsx","../../src/blocks/typography.tsx"],"sourcesContent":["import type { BlockItem } from './types';\nimport { MousePointer, ArrowUpRightSquare } from 'lucide-react';\n\nexport const button: BlockItem = {\n title: 'Button',\n description: 'Add a call to action button to email.',\n searchTerms: ['link', 'button', 'cta'],\n icon: <MousePointer className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setButton().run();\n },\n};\n\nexport const linkCard: BlockItem = {\n title: 'Link Card',\n description: 'Add a link card to email.',\n searchTerms: ['link', 'button', 'image'],\n icon: <ArrowUpRightSquare className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setLinkCard().run();\n },\n render: (editor) => {\n return editor.extensionManager.extensions.findIndex(\n (ext) => ext.name === 'linkCard'\n ) === -1\n ? null\n : true;\n },\n};\n","import { NodeSelection, Selection, TextSelection } from '@tiptap/pm/state';\nimport type { BlockItem } from './types';\nimport { ImageIcon } from 'lucide-react';\n\nexport const image: BlockItem = {\n title: 'Image',\n description: 'Full width image',\n searchTerms: ['image'],\n icon: <ImageIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setImage({ src: '' }).run();\n },\n};\n\nexport const logo: BlockItem = {\n title: 'Logo',\n description: 'Add your brand logo',\n searchTerms: ['image', 'logo'],\n icon: <ImageIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setLogoImage({ src: '' }).run();\n },\n};\n\nexport const inlineImage: BlockItem = {\n title: 'Inline Image',\n description: 'Inline image',\n searchTerms: ['image', 'inline'],\n icon: <ImageIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor\n .chain()\n .focus()\n .deleteRange(range)\n // @ts-ignore\n .setInlineImage({\n src: '',\n })\n // @ts-ignore\n .command((props) => {\n const { tr, state, view, editor } = props;\n const { from } = range;\n\n const node = state.doc.nodeAt(from);\n if (!node) {\n return false;\n }\n\n const selection = TextSelection.create(\n tr.doc,\n from,\n from + node.nodeSize\n );\n tr.setSelection(selection);\n return true;\n })\n .run();\n },\n};\n","import type { BlockItem } from './types';\nimport {\n ColumnsIcon,\n Repeat2,\n MoveVertical,\n RectangleHorizontal,\n Minus,\n} from 'lucide-react';\n\nexport const columns: BlockItem = {\n title: 'Columns',\n description: 'Add columns to email.',\n searchTerms: ['layout', 'columns'],\n icon: <ColumnsIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor\n .chain()\n .focus()\n .deleteRange(range)\n // @ts-ignore\n .setColumns()\n .focus(editor.state.selection.head - 2)\n .run();\n },\n};\n\nexport const section: BlockItem = {\n title: 'Section',\n description: 'Add a section to email.',\n searchTerms: ['layout', 'section'],\n icon: <RectangleHorizontal className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setSection().run();\n },\n};\n\nexport const repeat: BlockItem = {\n title: 'Repeat',\n description: 'Loop over an array of items.',\n searchTerms: ['repeat', 'for', 'loop'],\n icon: <Repeat2 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setRepeat().run();\n },\n};\n\nexport const spacer: BlockItem = {\n title: 'Spacer',\n description: 'Add space between blocks.',\n searchTerms: ['space', 'gap', 'divider'],\n icon: <MoveVertical className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setSpacer({ height: 'sm' }).run();\n },\n};\n\nexport const divider: BlockItem = {\n title: 'Divider',\n description: 'Add a horizontal divider.',\n searchTerms: ['divider', 'line'],\n icon: <Minus className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setHorizontalRule().run();\n },\n};\n","import type { BlockItem } from './types';\nimport { List, ListOrdered } from 'lucide-react';\n\nexport const bulletList: BlockItem = {\n title: 'Bullet List',\n description: 'Create a simple bullet list.',\n searchTerms: ['unordered', 'point'],\n icon: <List className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).toggleBulletList().run();\n },\n};\n\nexport const orderedList: BlockItem = {\n title: 'Numbered List',\n description: 'Create a list with numbering.',\n searchTerms: ['ordered'],\n icon: <ListOrdered className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).toggleOrderedList().run();\n },\n};\n","import type { BlockItem } from './types';\nimport {\n Text,\n Heading1,\n Heading2,\n Heading3,\n DivideIcon,\n TextQuote,\n FootprintsIcon,\n EraserIcon,\n} from 'lucide-react';\n\nexport const text: BlockItem = {\n title: 'Text',\n description: 'Just start typing with plain text.',\n searchTerms: ['p', 'paragraph'],\n icon: <Text className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .toggleNode('paragraph', 'paragraph')\n .run();\n },\n};\n\nexport const heading1: BlockItem = {\n title: 'Heading 1',\n description: 'Big heading.',\n searchTerms: ['title', 'big', 'large'],\n icon: <Heading1 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', { level: 1 })\n .run();\n },\n};\n\nexport const heading2: BlockItem = {\n title: 'Heading 2',\n description: 'Medium heading.',\n searchTerms: ['subtitle', 'medium'],\n icon: <Heading2 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', { level: 2 })\n .run();\n },\n};\n\nexport const heading3: BlockItem = {\n title: 'Heading 3',\n description: 'Small heading.',\n searchTerms: ['subtitle', 'small'],\n icon: <Heading3 className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n editor\n .chain()\n .focus()\n .deleteRange(range)\n .setNode('heading', { level: 3 })\n .run();\n },\n};\n\nexport const hardBreak: BlockItem = {\n title: 'Hard Break',\n description: 'Add a break between lines.',\n searchTerms: ['break', 'line'],\n icon: <DivideIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setHardBreak().run();\n },\n};\n\nexport const blockquote: BlockItem = {\n title: 'Blockquote',\n description: 'Add blockquote.',\n searchTerms: ['quote', 'blockquote'],\n icon: <TextQuote className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).toggleBlockquote().run();\n },\n};\n\nexport const footer: BlockItem = {\n title: 'Footer',\n description: 'Add a footer text to email.',\n searchTerms: ['footer', 'text'],\n icon: <FootprintsIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setFooter().run();\n },\n};\n\nexport const clearLine: BlockItem = {\n title: 'Clear Line',\n description: 'Clear the current line.',\n searchTerms: ['clear', 'line'],\n icon: <EraserIcon className=\"mly-h-4 mly-w-4\" />,\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().selectParentNode().deleteSelection().run();\n },\n};\n"],"mappings":";AACA,SAAS,cAAc,0BAA0B;AAMzC;AAJD,IAAM,SAAoB;AAAA,EAC/B,OAAO;AAAA,EACP,aAAa;AAAA,EACb,aAAa,CAAC,QAAQ,UAAU,KAAK;AAAA,EACrC,MAAM,oBAAC,gBAAa,WAAU,mBAAkB;AAAA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WAAU,mBAAkB;AAAA,EAClD,SAAS,CAAC,EAAE,QAAQ,MAAM,MAAM;AAE9B,WAAO,MAAM,EAAE,MAAM,EAAE,YAAY,KAAK,EAAE,UAAU,EAAE,IAAI;AAAA,EAC5D;AACF;AAEO,IAAM,YAAuB;AAAA,EAClC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,aAAa,CAAC,SAAS,MAAM;AAAA,EAC7B,MAAM,gBAAAA,KAAC,cAAW,WAAU,mBAAkB;AAAA,EAC9C,SAAS,CAAC,EAAE,QAAQ,MAAM,MAAM;AAE9B,WAAO,MAAM,EAAE,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,IAAI;AAAA,EAClE;AACF;","names":["jsx","editor","jsx","jsx","jsx"]}
@@ -11,6 +11,7 @@ import { Node as Node$1 } from '@tiptap/pm/model';
11
11
  import { PluginKey } from '@tiptap/pm/state';
12
12
  import * as react from 'react';
13
13
  import { ComponentType } from 'react';
14
+ import * as _tiptap_extension_placeholder from '@tiptap/extension-placeholder';
14
15
 
15
16
  declare module '@tiptap/core' {
16
17
  interface Commands<ReturnType> {
@@ -46,14 +47,29 @@ interface CommandProps {
46
47
  }
47
48
  type BlockItem = {
48
49
  title: string;
49
- description: string;
50
+ description?: string;
50
51
  searchTerms: string[];
51
- icon: JSX.Element;
52
- shouldBeHidden?: (editor: Editor) => boolean;
52
+ icon?: JSX.Element;
53
+ render?: (editor: Editor) => JSX.Element | null | true;
54
+ } & ({
53
55
  command: (options: CommandProps) => void;
56
+ id?: never;
57
+ commands?: never;
58
+ } | {
59
+ /**
60
+ * id to be used for the slash command query
61
+ * `headers.` will go inside the header subcommand
62
+ */
63
+ id: string;
64
+ command?: never;
65
+ commands: BlockItem[];
66
+ });
67
+ type BlockGroupItem = {
68
+ title: string;
69
+ commands: BlockItem[];
54
70
  };
55
71
 
56
- declare function getSlashCommandSuggestions(commands?: BlockItem[]): Omit<SuggestionOptions, 'editor'>;
72
+ declare function getSlashCommandSuggestions(groups?: BlockGroupItem[]): Omit<SuggestionOptions, 'editor'>;
57
73
 
58
74
  type ColorStorage = {
59
75
  /**
@@ -77,10 +93,8 @@ declare module '@tiptap/core' {
77
93
  }
78
94
  declare const Footer: Node<FooterOptions, any>;
79
95
 
80
- declare const allowedSpacerSize: readonly ["sm", "md", "lg", "xl"];
81
- type AllowedSpacerSize = (typeof allowedSpacerSize)[number];
82
96
  interface SpacerOptions {
83
- height: AllowedSpacerSize;
97
+ height: number;
84
98
  showIfKey: string;
85
99
  HTMLAttributes: Record<string, any>;
86
100
  }
@@ -88,14 +102,15 @@ declare module '@tiptap/core' {
88
102
  interface Commands<ReturnType> {
89
103
  spacer: {
90
104
  setSpacer: (options: {
91
- height: AllowedSpacerSize;
105
+ height: number;
92
106
  }) => ReturnType;
93
- setSpacerSize: (height: AllowedSpacerSize) => ReturnType;
107
+ setSpacerSize: (height: number) => ReturnType;
94
108
  setSpacerShowIfKey: (showIfKey: string) => ReturnType;
95
109
  unsetSpacer: () => ReturnType;
96
110
  };
97
111
  }
98
112
  }
113
+ declare const DEFAULT_SPACER_HEIGHT = 8;
99
114
  declare const Spacer: Node<SpacerOptions, any>;
100
115
 
101
116
  declare const DEFAULT_COLUMNS_GAP = 8;
@@ -295,8 +310,11 @@ type VariableOptions = {
295
310
  variables?: Variables;
296
311
  triggerChar?: string;
297
312
  };
313
+ type VariableStorage = {
314
+ popover: boolean;
315
+ };
298
316
  declare const VariablePluginKey: PluginKey<any>;
299
- declare const VariableExtension: Node<VariableOptions, any>;
317
+ declare const VariableExtension: Node<VariableOptions, VariableStorage>;
300
318
 
301
319
  type VariableListProps = {
302
320
  command: (params: {
@@ -308,4 +326,6 @@ type VariableListProps = {
308
326
  declare const VariableList: react.ForwardRefExoticComponent<VariableListProps & react.RefAttributes<unknown>>;
309
327
  declare function getVariableSuggestions(variables?: Variables, char?: string, variableListComponent?: ComponentType<VariableListProps>): Omit<SuggestionOptions, 'editor'>;
310
328
 
311
- export { type AllowedButtonBorderRadius, type AllowedButtonVariant, type AllowedColumnVerticalAlign, type AllowedLogoAlignment, type AllowedLogoSize, type AllowedSpacerSize, type ButtonAttributes, ButtonExtension, Color, ColumnExtension, ColumnsExtension, DEFAULT_BUTTON_ALIGNMENT, DEFAULT_BUTTON_BACKGROUND_COLOR, DEFAULT_BUTTON_BORDER_RADIUS, DEFAULT_BUTTON_PADDING_BOTTOM, DEFAULT_BUTTON_PADDING_LEFT, DEFAULT_BUTTON_PADDING_RIGHT, DEFAULT_BUTTON_PADDING_TOP, DEFAULT_BUTTON_TEXT_COLOR, DEFAULT_BUTTON_VARIANT, DEFAULT_COLUMNS_GAP, DEFAULT_COLUMN_VERTICAL_ALIGN, DEFAULT_COLUMN_WIDTH, DEFAULT_LOGO_SIZE, DEFAULT_SECTION_ALIGN, DEFAULT_SECTION_BACKGROUND_COLOR, DEFAULT_SECTION_BORDER_COLOR, DEFAULT_SECTION_BORDER_RADIUS, DEFAULT_SECTION_BORDER_WIDTH, DEFAULT_SECTION_MARGIN_BOTTOM, DEFAULT_SECTION_MARGIN_LEFT, DEFAULT_SECTION_MARGIN_RIGHT, DEFAULT_SECTION_MARGIN_TOP, DEFAULT_SECTION_PADDING_BOTTOM, DEFAULT_SECTION_PADDING_LEFT, DEFAULT_SECTION_PADDING_RIGHT, DEFAULT_SECTION_PADDING_TOP, DEFAULT_SECTION_SHOW_IF_KEY, Footer, type FooterOptions, HorizontalRule, ImageExtension, LinkExtension, type LogoAttributes, LogoExtension, MailyKit, type MailyKitOptions, RepeatExtension, SectionExtension, SlashCommandExtension, type SlashCommandOptions, Spacer, type SpacerOptions, VariableExtension, VariableList, type VariableListProps, type VariableOptions, VariablePluginKey, allowedButtonBorderRadius, allowedButtonVariant, allowedLogoAlignment, allowedLogoSize, allowedSpacerSize, getSlashCommandSuggestions, getVariableSuggestions, logoSizes };
329
+ declare const PlaceholderExtension: _tiptap_core.Extension<_tiptap_extension_placeholder.PlaceholderOptions, any>;
330
+
331
+ export { type AllowedButtonBorderRadius, type AllowedButtonVariant, type AllowedColumnVerticalAlign, type AllowedLogoAlignment, type AllowedLogoSize, type ButtonAttributes, ButtonExtension, Color, ColumnExtension, ColumnsExtension, DEFAULT_BUTTON_ALIGNMENT, DEFAULT_BUTTON_BACKGROUND_COLOR, DEFAULT_BUTTON_BORDER_RADIUS, DEFAULT_BUTTON_PADDING_BOTTOM, DEFAULT_BUTTON_PADDING_LEFT, DEFAULT_BUTTON_PADDING_RIGHT, DEFAULT_BUTTON_PADDING_TOP, DEFAULT_BUTTON_TEXT_COLOR, DEFAULT_BUTTON_VARIANT, DEFAULT_COLUMNS_GAP, DEFAULT_COLUMN_VERTICAL_ALIGN, DEFAULT_COLUMN_WIDTH, DEFAULT_LOGO_SIZE, DEFAULT_SECTION_ALIGN, DEFAULT_SECTION_BACKGROUND_COLOR, DEFAULT_SECTION_BORDER_COLOR, DEFAULT_SECTION_BORDER_RADIUS, DEFAULT_SECTION_BORDER_WIDTH, DEFAULT_SECTION_MARGIN_BOTTOM, DEFAULT_SECTION_MARGIN_LEFT, DEFAULT_SECTION_MARGIN_RIGHT, DEFAULT_SECTION_MARGIN_TOP, DEFAULT_SECTION_PADDING_BOTTOM, DEFAULT_SECTION_PADDING_LEFT, DEFAULT_SECTION_PADDING_RIGHT, DEFAULT_SECTION_PADDING_TOP, DEFAULT_SECTION_SHOW_IF_KEY, DEFAULT_SPACER_HEIGHT, Footer, type FooterOptions, HorizontalRule, ImageExtension, LinkExtension, type LogoAttributes, LogoExtension, MailyKit, type MailyKitOptions, PlaceholderExtension, RepeatExtension, SectionExtension, SlashCommandExtension, type SlashCommandOptions, Spacer, type SpacerOptions, VariableExtension, VariableList, type VariableListProps, type VariableOptions, VariablePluginKey, type VariableStorage, allowedButtonBorderRadius, allowedButtonVariant, allowedLogoAlignment, allowedLogoSize, getSlashCommandSuggestions, getVariableSuggestions, logoSizes };
@@ -11,6 +11,7 @@ import { Node as Node$1 } from '@tiptap/pm/model';
11
11
  import { PluginKey } from '@tiptap/pm/state';
12
12
  import * as react from 'react';
13
13
  import { ComponentType } from 'react';
14
+ import * as _tiptap_extension_placeholder from '@tiptap/extension-placeholder';
14
15
 
15
16
  declare module '@tiptap/core' {
16
17
  interface Commands<ReturnType> {
@@ -46,14 +47,29 @@ interface CommandProps {
46
47
  }
47
48
  type BlockItem = {
48
49
  title: string;
49
- description: string;
50
+ description?: string;
50
51
  searchTerms: string[];
51
- icon: JSX.Element;
52
- shouldBeHidden?: (editor: Editor) => boolean;
52
+ icon?: JSX.Element;
53
+ render?: (editor: Editor) => JSX.Element | null | true;
54
+ } & ({
53
55
  command: (options: CommandProps) => void;
56
+ id?: never;
57
+ commands?: never;
58
+ } | {
59
+ /**
60
+ * id to be used for the slash command query
61
+ * `headers.` will go inside the header subcommand
62
+ */
63
+ id: string;
64
+ command?: never;
65
+ commands: BlockItem[];
66
+ });
67
+ type BlockGroupItem = {
68
+ title: string;
69
+ commands: BlockItem[];
54
70
  };
55
71
 
56
- declare function getSlashCommandSuggestions(commands?: BlockItem[]): Omit<SuggestionOptions, 'editor'>;
72
+ declare function getSlashCommandSuggestions(groups?: BlockGroupItem[]): Omit<SuggestionOptions, 'editor'>;
57
73
 
58
74
  type ColorStorage = {
59
75
  /**
@@ -77,10 +93,8 @@ declare module '@tiptap/core' {
77
93
  }
78
94
  declare const Footer: Node<FooterOptions, any>;
79
95
 
80
- declare const allowedSpacerSize: readonly ["sm", "md", "lg", "xl"];
81
- type AllowedSpacerSize = (typeof allowedSpacerSize)[number];
82
96
  interface SpacerOptions {
83
- height: AllowedSpacerSize;
97
+ height: number;
84
98
  showIfKey: string;
85
99
  HTMLAttributes: Record<string, any>;
86
100
  }
@@ -88,14 +102,15 @@ declare module '@tiptap/core' {
88
102
  interface Commands<ReturnType> {
89
103
  spacer: {
90
104
  setSpacer: (options: {
91
- height: AllowedSpacerSize;
105
+ height: number;
92
106
  }) => ReturnType;
93
- setSpacerSize: (height: AllowedSpacerSize) => ReturnType;
107
+ setSpacerSize: (height: number) => ReturnType;
94
108
  setSpacerShowIfKey: (showIfKey: string) => ReturnType;
95
109
  unsetSpacer: () => ReturnType;
96
110
  };
97
111
  }
98
112
  }
113
+ declare const DEFAULT_SPACER_HEIGHT = 8;
99
114
  declare const Spacer: Node<SpacerOptions, any>;
100
115
 
101
116
  declare const DEFAULT_COLUMNS_GAP = 8;
@@ -295,8 +310,11 @@ type VariableOptions = {
295
310
  variables?: Variables;
296
311
  triggerChar?: string;
297
312
  };
313
+ type VariableStorage = {
314
+ popover: boolean;
315
+ };
298
316
  declare const VariablePluginKey: PluginKey<any>;
299
- declare const VariableExtension: Node<VariableOptions, any>;
317
+ declare const VariableExtension: Node<VariableOptions, VariableStorage>;
300
318
 
301
319
  type VariableListProps = {
302
320
  command: (params: {
@@ -308,4 +326,6 @@ type VariableListProps = {
308
326
  declare const VariableList: react.ForwardRefExoticComponent<VariableListProps & react.RefAttributes<unknown>>;
309
327
  declare function getVariableSuggestions(variables?: Variables, char?: string, variableListComponent?: ComponentType<VariableListProps>): Omit<SuggestionOptions, 'editor'>;
310
328
 
311
- export { type AllowedButtonBorderRadius, type AllowedButtonVariant, type AllowedColumnVerticalAlign, type AllowedLogoAlignment, type AllowedLogoSize, type AllowedSpacerSize, type ButtonAttributes, ButtonExtension, Color, ColumnExtension, ColumnsExtension, DEFAULT_BUTTON_ALIGNMENT, DEFAULT_BUTTON_BACKGROUND_COLOR, DEFAULT_BUTTON_BORDER_RADIUS, DEFAULT_BUTTON_PADDING_BOTTOM, DEFAULT_BUTTON_PADDING_LEFT, DEFAULT_BUTTON_PADDING_RIGHT, DEFAULT_BUTTON_PADDING_TOP, DEFAULT_BUTTON_TEXT_COLOR, DEFAULT_BUTTON_VARIANT, DEFAULT_COLUMNS_GAP, DEFAULT_COLUMN_VERTICAL_ALIGN, DEFAULT_COLUMN_WIDTH, DEFAULT_LOGO_SIZE, DEFAULT_SECTION_ALIGN, DEFAULT_SECTION_BACKGROUND_COLOR, DEFAULT_SECTION_BORDER_COLOR, DEFAULT_SECTION_BORDER_RADIUS, DEFAULT_SECTION_BORDER_WIDTH, DEFAULT_SECTION_MARGIN_BOTTOM, DEFAULT_SECTION_MARGIN_LEFT, DEFAULT_SECTION_MARGIN_RIGHT, DEFAULT_SECTION_MARGIN_TOP, DEFAULT_SECTION_PADDING_BOTTOM, DEFAULT_SECTION_PADDING_LEFT, DEFAULT_SECTION_PADDING_RIGHT, DEFAULT_SECTION_PADDING_TOP, DEFAULT_SECTION_SHOW_IF_KEY, Footer, type FooterOptions, HorizontalRule, ImageExtension, LinkExtension, type LogoAttributes, LogoExtension, MailyKit, type MailyKitOptions, RepeatExtension, SectionExtension, SlashCommandExtension, type SlashCommandOptions, Spacer, type SpacerOptions, VariableExtension, VariableList, type VariableListProps, type VariableOptions, VariablePluginKey, allowedButtonBorderRadius, allowedButtonVariant, allowedLogoAlignment, allowedLogoSize, allowedSpacerSize, getSlashCommandSuggestions, getVariableSuggestions, logoSizes };
329
+ declare const PlaceholderExtension: _tiptap_core.Extension<_tiptap_extension_placeholder.PlaceholderOptions, any>;
330
+
331
+ export { type AllowedButtonBorderRadius, type AllowedButtonVariant, type AllowedColumnVerticalAlign, type AllowedLogoAlignment, type AllowedLogoSize, type ButtonAttributes, ButtonExtension, Color, ColumnExtension, ColumnsExtension, DEFAULT_BUTTON_ALIGNMENT, DEFAULT_BUTTON_BACKGROUND_COLOR, DEFAULT_BUTTON_BORDER_RADIUS, DEFAULT_BUTTON_PADDING_BOTTOM, DEFAULT_BUTTON_PADDING_LEFT, DEFAULT_BUTTON_PADDING_RIGHT, DEFAULT_BUTTON_PADDING_TOP, DEFAULT_BUTTON_TEXT_COLOR, DEFAULT_BUTTON_VARIANT, DEFAULT_COLUMNS_GAP, DEFAULT_COLUMN_VERTICAL_ALIGN, DEFAULT_COLUMN_WIDTH, DEFAULT_LOGO_SIZE, DEFAULT_SECTION_ALIGN, DEFAULT_SECTION_BACKGROUND_COLOR, DEFAULT_SECTION_BORDER_COLOR, DEFAULT_SECTION_BORDER_RADIUS, DEFAULT_SECTION_BORDER_WIDTH, DEFAULT_SECTION_MARGIN_BOTTOM, DEFAULT_SECTION_MARGIN_LEFT, DEFAULT_SECTION_MARGIN_RIGHT, DEFAULT_SECTION_MARGIN_TOP, DEFAULT_SECTION_PADDING_BOTTOM, DEFAULT_SECTION_PADDING_LEFT, DEFAULT_SECTION_PADDING_RIGHT, DEFAULT_SECTION_PADDING_TOP, DEFAULT_SECTION_SHOW_IF_KEY, DEFAULT_SPACER_HEIGHT, Footer, type FooterOptions, HorizontalRule, ImageExtension, LinkExtension, type LogoAttributes, LogoExtension, MailyKit, type MailyKitOptions, PlaceholderExtension, RepeatExtension, SectionExtension, SlashCommandExtension, type SlashCommandOptions, Spacer, type SpacerOptions, VariableExtension, VariableList, type VariableListProps, type VariableOptions, VariablePluginKey, type VariableStorage, allowedButtonBorderRadius, allowedButtonVariant, allowedLogoAlignment, allowedLogoSize, getSlashCommandSuggestions, getVariableSuggestions, logoSizes };