@daisychainapp/maily-to-core 0.0.2-2.1

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.
@@ -0,0 +1,40 @@
1
+ import { Editor, Range } from '@tiptap/core';
2
+
3
+ interface CommandProps {
4
+ editor: Editor;
5
+ range: Range;
6
+ }
7
+ type BlockItem = {
8
+ title: string;
9
+ description: string;
10
+ searchTerms: string[];
11
+ icon: JSX.Element;
12
+ shouldBeHidden?: (editor: Editor) => boolean;
13
+ command: (options: CommandProps) => void;
14
+ };
15
+
16
+ declare const button: BlockItem;
17
+ declare const linkCard: BlockItem;
18
+
19
+ declare const image: BlockItem;
20
+ declare const logo: BlockItem;
21
+
22
+ declare const columns: BlockItem;
23
+ declare const section: BlockItem;
24
+ declare const forLoop: BlockItem;
25
+ declare const spacer: BlockItem;
26
+ declare const divider: BlockItem;
27
+
28
+ declare const bulletList: BlockItem;
29
+ declare const orderedList: BlockItem;
30
+
31
+ declare const text: BlockItem;
32
+ declare const heading1: BlockItem;
33
+ declare const heading2: BlockItem;
34
+ declare const heading3: BlockItem;
35
+ declare const hardBreak: BlockItem;
36
+ declare const blockquote: BlockItem;
37
+ declare const footer: BlockItem;
38
+ declare const clearLine: BlockItem;
39
+
40
+ export { type BlockItem, blockquote, bulletList, button, clearLine, columns, divider, footer, forLoop, hardBreak, heading1, heading2, heading3, image, linkCard, logo, orderedList, section, spacer, text };
@@ -0,0 +1,40 @@
1
+ import { Editor, Range } from '@tiptap/core';
2
+
3
+ interface CommandProps {
4
+ editor: Editor;
5
+ range: Range;
6
+ }
7
+ type BlockItem = {
8
+ title: string;
9
+ description: string;
10
+ searchTerms: string[];
11
+ icon: JSX.Element;
12
+ shouldBeHidden?: (editor: Editor) => boolean;
13
+ command: (options: CommandProps) => void;
14
+ };
15
+
16
+ declare const button: BlockItem;
17
+ declare const linkCard: BlockItem;
18
+
19
+ declare const image: BlockItem;
20
+ declare const logo: BlockItem;
21
+
22
+ declare const columns: BlockItem;
23
+ declare const section: BlockItem;
24
+ declare const forLoop: BlockItem;
25
+ declare const spacer: BlockItem;
26
+ declare const divider: BlockItem;
27
+
28
+ declare const bulletList: BlockItem;
29
+ declare const orderedList: BlockItem;
30
+
31
+ declare const text: BlockItem;
32
+ declare const heading1: BlockItem;
33
+ declare const heading2: BlockItem;
34
+ declare const heading3: BlockItem;
35
+ declare const hardBreak: BlockItem;
36
+ declare const blockquote: BlockItem;
37
+ declare const footer: BlockItem;
38
+ declare const clearLine: BlockItem;
39
+
40
+ export { type BlockItem, blockquote, bulletList, button, clearLine, columns, divider, footer, forLoop, hardBreak, heading1, heading2, heading3, image, linkCard, logo, orderedList, section, spacer, text };
@@ -0,0 +1,263 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/blocks.ts
21
+ var blocks_exports = {};
22
+ __export(blocks_exports, {
23
+ blockquote: () => blockquote,
24
+ bulletList: () => bulletList,
25
+ button: () => button,
26
+ clearLine: () => clearLine,
27
+ columns: () => columns,
28
+ divider: () => divider,
29
+ footer: () => footer,
30
+ forLoop: () => forLoop,
31
+ hardBreak: () => hardBreak,
32
+ heading1: () => heading1,
33
+ heading2: () => heading2,
34
+ heading3: () => heading3,
35
+ image: () => image,
36
+ linkCard: () => linkCard,
37
+ logo: () => logo,
38
+ orderedList: () => orderedList,
39
+ section: () => section,
40
+ spacer: () => spacer,
41
+ text: () => text
42
+ });
43
+ module.exports = __toCommonJS(blocks_exports);
44
+
45
+ // src/blocks/button.tsx
46
+ var import_lucide_react = require("lucide-react");
47
+ var import_jsx_runtime = require("react/jsx-runtime");
48
+ var button = {
49
+ title: "Button",
50
+ description: "Add a call to action button to email.",
51
+ searchTerms: ["link", "button", "cta"],
52
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.MousePointer, { className: "mly-h-4 mly-w-4" }),
53
+ command: ({ editor, range }) => {
54
+ editor.chain().focus().deleteRange(range).setButton().run();
55
+ }
56
+ };
57
+ var linkCard = {
58
+ title: "Link Card",
59
+ description: "Add a link card to email.",
60
+ searchTerms: ["link", "button", "image"],
61
+ icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowUpRightSquare, { className: "mly-h-4 mly-w-4" }),
62
+ command: ({ editor, range }) => {
63
+ editor.chain().focus().deleteRange(range).setLinkCard().run();
64
+ }
65
+ };
66
+
67
+ // src/blocks/image.tsx
68
+ var import_lucide_react2 = require("lucide-react");
69
+ var import_jsx_runtime2 = require("react/jsx-runtime");
70
+ var image = {
71
+ title: "Image",
72
+ description: "Full width image",
73
+ searchTerms: ["image"],
74
+ icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.ImageIcon, { className: "mly-h-4 mly-w-4" }),
75
+ command: ({ editor, range }) => {
76
+ editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
77
+ }
78
+ };
79
+ var logo = {
80
+ title: "Logo",
81
+ description: "Add your brand logo",
82
+ searchTerms: ["image", "logo"],
83
+ icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.ImageIcon, { className: "mly-h-4 mly-w-4" }),
84
+ command: ({ editor, range }) => {
85
+ editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
86
+ }
87
+ };
88
+
89
+ // src/blocks/layout.tsx
90
+ var import_lucide_react3 = require("lucide-react");
91
+ var import_jsx_runtime3 = require("react/jsx-runtime");
92
+ var columns = {
93
+ title: "Columns",
94
+ description: "Add columns to email.",
95
+ searchTerms: ["layout", "columns"],
96
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
97
+ shouldBeHidden: (editor) => {
98
+ return editor.isActive("columns");
99
+ },
100
+ command: ({ editor, range }) => {
101
+ editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
102
+ }
103
+ };
104
+ var section = {
105
+ title: "Section",
106
+ description: "Add a section to email.",
107
+ searchTerms: ["layout", "section"],
108
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.RectangleHorizontal, { className: "mly-h-4 mly-w-4" }),
109
+ command: ({ editor, range }) => {
110
+ editor.chain().focus().deleteRange(range).setSection().run();
111
+ }
112
+ };
113
+ var forLoop = {
114
+ title: "For",
115
+ description: "Loop over an array of items.",
116
+ searchTerms: ["for", "loop"],
117
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Repeat2, { className: "mly-h-4 mly-w-4" }),
118
+ shouldBeHidden: (editor) => {
119
+ return editor.isActive("for");
120
+ },
121
+ command: ({ editor, range }) => {
122
+ editor.chain().focus().deleteRange(range).setFor().run();
123
+ }
124
+ };
125
+ var spacer = {
126
+ title: "Spacer",
127
+ description: "Add space between blocks.",
128
+ searchTerms: ["space", "gap", "divider"],
129
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.MoveVertical, { className: "mly-h-4 mly-w-4" }),
130
+ command: ({ editor, range }) => {
131
+ editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
132
+ }
133
+ };
134
+ var divider = {
135
+ title: "Divider",
136
+ description: "Add a horizontal divider.",
137
+ searchTerms: ["divider", "line"],
138
+ icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Minus, { className: "mly-h-4 mly-w-4" }),
139
+ command: ({ editor, range }) => {
140
+ editor.chain().focus().deleteRange(range).setHorizontalRule().run();
141
+ }
142
+ };
143
+
144
+ // src/blocks/list.tsx
145
+ var import_lucide_react4 = require("lucide-react");
146
+ var import_jsx_runtime4 = require("react/jsx-runtime");
147
+ var bulletList = {
148
+ title: "Bullet List",
149
+ description: "Create a simple bullet list.",
150
+ searchTerms: ["unordered", "point"],
151
+ icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.List, { className: "mly-h-4 mly-w-4" }),
152
+ command: ({ editor, range }) => {
153
+ editor.chain().focus().deleteRange(range).toggleBulletList().run();
154
+ }
155
+ };
156
+ var orderedList = {
157
+ title: "Numbered List",
158
+ description: "Create a list with numbering.",
159
+ searchTerms: ["ordered"],
160
+ icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.ListOrdered, { className: "mly-h-4 mly-w-4" }),
161
+ command: ({ editor, range }) => {
162
+ editor.chain().focus().deleteRange(range).toggleOrderedList().run();
163
+ }
164
+ };
165
+
166
+ // src/blocks/typography.tsx
167
+ var import_lucide_react5 = require("lucide-react");
168
+ var import_jsx_runtime5 = require("react/jsx-runtime");
169
+ var text = {
170
+ title: "Text",
171
+ description: "Just start typing with plain text.",
172
+ searchTerms: ["p", "paragraph"],
173
+ icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.Text, { className: "mly-h-4 mly-w-4" }),
174
+ command: ({ editor, range }) => {
175
+ editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
176
+ }
177
+ };
178
+ var heading1 = {
179
+ title: "Heading 1",
180
+ description: "Big heading.",
181
+ searchTerms: ["title", "big", "large"],
182
+ icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.Heading1, { className: "mly-h-4 mly-w-4" }),
183
+ command: ({ editor, range }) => {
184
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
185
+ }
186
+ };
187
+ var heading2 = {
188
+ title: "Heading 2",
189
+ description: "Medium heading.",
190
+ searchTerms: ["subtitle", "medium"],
191
+ icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.Heading2, { className: "mly-h-4 mly-w-4" }),
192
+ command: ({ editor, range }) => {
193
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
194
+ }
195
+ };
196
+ var heading3 = {
197
+ title: "Heading 3",
198
+ description: "Small heading.",
199
+ searchTerms: ["subtitle", "small"],
200
+ icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.Heading3, { className: "mly-h-4 mly-w-4" }),
201
+ command: ({ editor, range }) => {
202
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
203
+ }
204
+ };
205
+ var hardBreak = {
206
+ title: "Hard Break",
207
+ description: "Add a break between lines.",
208
+ searchTerms: ["break", "line"],
209
+ icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.DivideIcon, { className: "mly-h-4 mly-w-4" }),
210
+ command: ({ editor, range }) => {
211
+ editor.chain().focus().deleteRange(range).setHardBreak().run();
212
+ }
213
+ };
214
+ var blockquote = {
215
+ title: "Blockquote",
216
+ description: "Add blockquote.",
217
+ searchTerms: ["quote", "blockquote"],
218
+ icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.TextQuote, { className: "mly-h-4 mly-w-4" }),
219
+ command: ({ editor, range }) => {
220
+ editor.chain().focus().deleteRange(range).toggleBlockquote().run();
221
+ }
222
+ };
223
+ var footer = {
224
+ title: "Footer",
225
+ description: "Add a footer text to email.",
226
+ searchTerms: ["footer", "text"],
227
+ icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.FootprintsIcon, { className: "mly-h-4 mly-w-4" }),
228
+ command: ({ editor, range }) => {
229
+ editor.chain().focus().deleteRange(range).setFooter().run();
230
+ }
231
+ };
232
+ var clearLine = {
233
+ title: "Clear Line",
234
+ description: "Clear the current line.",
235
+ searchTerms: ["clear", "line"],
236
+ icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.EraserIcon, { className: "mly-h-4 mly-w-4" }),
237
+ command: ({ editor, range }) => {
238
+ editor.chain().focus().selectParentNode().deleteSelection().run();
239
+ }
240
+ };
241
+ // Annotate the CommonJS export names for ESM import in node:
242
+ 0 && (module.exports = {
243
+ blockquote,
244
+ bulletList,
245
+ button,
246
+ clearLine,
247
+ columns,
248
+ divider,
249
+ footer,
250
+ forLoop,
251
+ hardBreak,
252
+ heading1,
253
+ heading2,
254
+ heading3,
255
+ image,
256
+ linkCard,
257
+ logo,
258
+ orderedList,
259
+ section,
260
+ spacer,
261
+ text
262
+ });
263
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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};\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 forLoop: BlockItem = {\n title: 'For',\n description: 'Loop over an array of items.',\n searchTerms: ['for', 'loop'],\n icon: <Repeat2 className=\"mly-h-4 mly-w-4\" />,\n shouldBeHidden: (editor) => {\n return editor.isActive('for');\n },\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setFor().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":";;;;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ClC,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,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"]}
@@ -0,0 +1,233 @@
1
+ // src/blocks/button.tsx
2
+ import { MousePointer, ArrowUpRightSquare } from "lucide-react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ var button = {
5
+ title: "Button",
6
+ description: "Add a call to action button to email.",
7
+ searchTerms: ["link", "button", "cta"],
8
+ icon: /* @__PURE__ */ jsx(MousePointer, { className: "mly-h-4 mly-w-4" }),
9
+ command: ({ editor, range }) => {
10
+ editor.chain().focus().deleteRange(range).setButton().run();
11
+ }
12
+ };
13
+ var linkCard = {
14
+ title: "Link Card",
15
+ description: "Add a link card to email.",
16
+ searchTerms: ["link", "button", "image"],
17
+ icon: /* @__PURE__ */ jsx(ArrowUpRightSquare, { className: "mly-h-4 mly-w-4" }),
18
+ command: ({ editor, range }) => {
19
+ editor.chain().focus().deleteRange(range).setLinkCard().run();
20
+ }
21
+ };
22
+
23
+ // src/blocks/image.tsx
24
+ import { ImageIcon } from "lucide-react";
25
+ import { jsx as jsx2 } from "react/jsx-runtime";
26
+ var image = {
27
+ title: "Image",
28
+ description: "Full width image",
29
+ searchTerms: ["image"],
30
+ icon: /* @__PURE__ */ jsx2(ImageIcon, { className: "mly-h-4 mly-w-4" }),
31
+ command: ({ editor, range }) => {
32
+ editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
33
+ }
34
+ };
35
+ var logo = {
36
+ title: "Logo",
37
+ description: "Add your brand logo",
38
+ searchTerms: ["image", "logo"],
39
+ icon: /* @__PURE__ */ jsx2(ImageIcon, { className: "mly-h-4 mly-w-4" }),
40
+ command: ({ editor, range }) => {
41
+ editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
42
+ }
43
+ };
44
+
45
+ // src/blocks/layout.tsx
46
+ import {
47
+ ColumnsIcon,
48
+ Repeat2,
49
+ MoveVertical,
50
+ RectangleHorizontal,
51
+ Minus
52
+ } from "lucide-react";
53
+ import { jsx as jsx3 } from "react/jsx-runtime";
54
+ var columns = {
55
+ title: "Columns",
56
+ description: "Add columns to email.",
57
+ searchTerms: ["layout", "columns"],
58
+ icon: /* @__PURE__ */ jsx3(ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
59
+ shouldBeHidden: (editor) => {
60
+ return editor.isActive("columns");
61
+ },
62
+ command: ({ editor, range }) => {
63
+ editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
64
+ }
65
+ };
66
+ var section = {
67
+ title: "Section",
68
+ description: "Add a section to email.",
69
+ searchTerms: ["layout", "section"],
70
+ icon: /* @__PURE__ */ jsx3(RectangleHorizontal, { className: "mly-h-4 mly-w-4" }),
71
+ command: ({ editor, range }) => {
72
+ editor.chain().focus().deleteRange(range).setSection().run();
73
+ }
74
+ };
75
+ var forLoop = {
76
+ title: "For",
77
+ description: "Loop over an array of items.",
78
+ searchTerms: ["for", "loop"],
79
+ icon: /* @__PURE__ */ jsx3(Repeat2, { className: "mly-h-4 mly-w-4" }),
80
+ shouldBeHidden: (editor) => {
81
+ return editor.isActive("for");
82
+ },
83
+ command: ({ editor, range }) => {
84
+ editor.chain().focus().deleteRange(range).setFor().run();
85
+ }
86
+ };
87
+ var spacer = {
88
+ title: "Spacer",
89
+ description: "Add space between blocks.",
90
+ searchTerms: ["space", "gap", "divider"],
91
+ icon: /* @__PURE__ */ jsx3(MoveVertical, { className: "mly-h-4 mly-w-4" }),
92
+ command: ({ editor, range }) => {
93
+ editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
94
+ }
95
+ };
96
+ var divider = {
97
+ title: "Divider",
98
+ description: "Add a horizontal divider.",
99
+ searchTerms: ["divider", "line"],
100
+ icon: /* @__PURE__ */ jsx3(Minus, { className: "mly-h-4 mly-w-4" }),
101
+ command: ({ editor, range }) => {
102
+ editor.chain().focus().deleteRange(range).setHorizontalRule().run();
103
+ }
104
+ };
105
+
106
+ // src/blocks/list.tsx
107
+ import { List, ListOrdered } from "lucide-react";
108
+ import { jsx as jsx4 } from "react/jsx-runtime";
109
+ var bulletList = {
110
+ title: "Bullet List",
111
+ description: "Create a simple bullet list.",
112
+ searchTerms: ["unordered", "point"],
113
+ icon: /* @__PURE__ */ jsx4(List, { className: "mly-h-4 mly-w-4" }),
114
+ command: ({ editor, range }) => {
115
+ editor.chain().focus().deleteRange(range).toggleBulletList().run();
116
+ }
117
+ };
118
+ var orderedList = {
119
+ title: "Numbered List",
120
+ description: "Create a list with numbering.",
121
+ searchTerms: ["ordered"],
122
+ icon: /* @__PURE__ */ jsx4(ListOrdered, { className: "mly-h-4 mly-w-4" }),
123
+ command: ({ editor, range }) => {
124
+ editor.chain().focus().deleteRange(range).toggleOrderedList().run();
125
+ }
126
+ };
127
+
128
+ // src/blocks/typography.tsx
129
+ import {
130
+ Text,
131
+ Heading1,
132
+ Heading2,
133
+ Heading3,
134
+ DivideIcon,
135
+ TextQuote,
136
+ FootprintsIcon,
137
+ EraserIcon
138
+ } from "lucide-react";
139
+ import { jsx as jsx5 } from "react/jsx-runtime";
140
+ var text = {
141
+ title: "Text",
142
+ description: "Just start typing with plain text.",
143
+ searchTerms: ["p", "paragraph"],
144
+ icon: /* @__PURE__ */ jsx5(Text, { className: "mly-h-4 mly-w-4" }),
145
+ command: ({ editor, range }) => {
146
+ editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
147
+ }
148
+ };
149
+ var heading1 = {
150
+ title: "Heading 1",
151
+ description: "Big heading.",
152
+ searchTerms: ["title", "big", "large"],
153
+ icon: /* @__PURE__ */ jsx5(Heading1, { className: "mly-h-4 mly-w-4" }),
154
+ command: ({ editor, range }) => {
155
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
156
+ }
157
+ };
158
+ var heading2 = {
159
+ title: "Heading 2",
160
+ description: "Medium heading.",
161
+ searchTerms: ["subtitle", "medium"],
162
+ icon: /* @__PURE__ */ jsx5(Heading2, { className: "mly-h-4 mly-w-4" }),
163
+ command: ({ editor, range }) => {
164
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
165
+ }
166
+ };
167
+ var heading3 = {
168
+ title: "Heading 3",
169
+ description: "Small heading.",
170
+ searchTerms: ["subtitle", "small"],
171
+ icon: /* @__PURE__ */ jsx5(Heading3, { className: "mly-h-4 mly-w-4" }),
172
+ command: ({ editor, range }) => {
173
+ editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
174
+ }
175
+ };
176
+ var hardBreak = {
177
+ title: "Hard Break",
178
+ description: "Add a break between lines.",
179
+ searchTerms: ["break", "line"],
180
+ icon: /* @__PURE__ */ jsx5(DivideIcon, { className: "mly-h-4 mly-w-4" }),
181
+ command: ({ editor, range }) => {
182
+ editor.chain().focus().deleteRange(range).setHardBreak().run();
183
+ }
184
+ };
185
+ var blockquote = {
186
+ title: "Blockquote",
187
+ description: "Add blockquote.",
188
+ searchTerms: ["quote", "blockquote"],
189
+ icon: /* @__PURE__ */ jsx5(TextQuote, { className: "mly-h-4 mly-w-4" }),
190
+ command: ({ editor, range }) => {
191
+ editor.chain().focus().deleteRange(range).toggleBlockquote().run();
192
+ }
193
+ };
194
+ var footer = {
195
+ title: "Footer",
196
+ description: "Add a footer text to email.",
197
+ searchTerms: ["footer", "text"],
198
+ icon: /* @__PURE__ */ jsx5(FootprintsIcon, { className: "mly-h-4 mly-w-4" }),
199
+ command: ({ editor, range }) => {
200
+ editor.chain().focus().deleteRange(range).setFooter().run();
201
+ }
202
+ };
203
+ var clearLine = {
204
+ title: "Clear Line",
205
+ description: "Clear the current line.",
206
+ searchTerms: ["clear", "line"],
207
+ icon: /* @__PURE__ */ jsx5(EraserIcon, { className: "mly-h-4 mly-w-4" }),
208
+ command: ({ editor, range }) => {
209
+ editor.chain().focus().selectParentNode().deleteSelection().run();
210
+ }
211
+ };
212
+ export {
213
+ blockquote,
214
+ bulletList,
215
+ button,
216
+ clearLine,
217
+ columns,
218
+ divider,
219
+ footer,
220
+ forLoop,
221
+ hardBreak,
222
+ heading1,
223
+ heading2,
224
+ heading3,
225
+ image,
226
+ linkCard,
227
+ logo,
228
+ orderedList,
229
+ section,
230
+ spacer,
231
+ text
232
+ };
233
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +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};\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 forLoop: BlockItem = {\n title: 'For',\n description: 'Loop over an array of items.',\n searchTerms: ['for', 'loop'],\n icon: <Repeat2 className=\"mly-h-4 mly-w-4\" />,\n shouldBeHidden: (editor) => {\n return editor.isActive('for');\n },\n command: ({ editor, range }) => {\n // @ts-ignore\n editor.chain().focus().deleteRange(range).setFor().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,EAChD,SAAS,CAAC,EAAE,QAAQ,MAAM,MAAM;AAE9B,WAAO,MAAM,EAAE,MAAM,EAAE,YAAY,KAAK,EAAE,UAAU,EAAE,IAAI;AAAA,EAC5D;AACF;AAEO,IAAM,WAAsB;AAAA,EACjC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,aAAa,CAAC,QAAQ,UAAU,OAAO;AAAA,EACvC,MAAM,oBAAC,sBAAmB,WAAU,mBAAkB;AAAA,EACtD,SAAS,CAAC,EAAE,QAAQ,MAAM,MAAM;AAE9B,WAAO,MAAM,EAAE,MAAM,EAAE,YAAY,KAAK,EAAE,YAAY,EAAE,IAAI;AAAA,EAC9D;AACF;;;ACtBA,SAAS,iBAAiB;AAMlB,gBAAAA,YAAA;AAJD,IAAM,QAAmB;AAAA,EAC9B,OAAO;AAAA,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