@daisychainapp/maily-to-core 0.2.8 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/dist/blocks/index.d.mts +0 -57
- package/dist/blocks/index.js +0 -290
- package/dist/blocks/index.js.map +0 -1
- package/dist/extensions/index.d.mts +0 -332
- package/dist/extensions/index.js +0 -5268
- package/dist/extensions/index.js.map +0 -1
- package/dist/index.d.mts +0 -82
- package/dist/index.js +0 -8348
- package/dist/index.js.map +0 -1
package/package.json
CHANGED
package/dist/blocks/index.d.mts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
render?: (editor: Editor) => JSX.Element | null | true;
|
|
13
|
-
preview?: string | ((editor: Editor) => JSX.Element | null);
|
|
14
|
-
} & ({
|
|
15
|
-
command: (options: CommandProps) => void;
|
|
16
|
-
id?: never;
|
|
17
|
-
commands?: never;
|
|
18
|
-
} | {
|
|
19
|
-
/**
|
|
20
|
-
* id to be used for the slash command query
|
|
21
|
-
* `headers.` will go inside the header subcommand
|
|
22
|
-
*/
|
|
23
|
-
id: string;
|
|
24
|
-
command?: never;
|
|
25
|
-
commands: BlockItem[];
|
|
26
|
-
});
|
|
27
|
-
type BlockGroupItem = {
|
|
28
|
-
title: string;
|
|
29
|
-
commands: BlockItem[];
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
declare const button: BlockItem;
|
|
33
|
-
declare const linkCard: BlockItem;
|
|
34
|
-
|
|
35
|
-
declare const image: BlockItem;
|
|
36
|
-
declare const logo: BlockItem;
|
|
37
|
-
declare const inlineImage: BlockItem;
|
|
38
|
-
|
|
39
|
-
declare const columns: BlockItem;
|
|
40
|
-
declare const section: BlockItem;
|
|
41
|
-
declare const repeat: BlockItem;
|
|
42
|
-
declare const spacer: BlockItem;
|
|
43
|
-
declare const divider: BlockItem;
|
|
44
|
-
|
|
45
|
-
declare const bulletList: BlockItem;
|
|
46
|
-
declare const orderedList: BlockItem;
|
|
47
|
-
|
|
48
|
-
declare const text: BlockItem;
|
|
49
|
-
declare const heading1: BlockItem;
|
|
50
|
-
declare const heading2: BlockItem;
|
|
51
|
-
declare const heading3: BlockItem;
|
|
52
|
-
declare const hardBreak: BlockItem;
|
|
53
|
-
declare const blockquote: BlockItem;
|
|
54
|
-
declare const footer: BlockItem;
|
|
55
|
-
declare const clearLine: BlockItem;
|
|
56
|
-
|
|
57
|
-
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 };
|
package/dist/blocks/index.js
DELETED
|
@@ -1,290 +0,0 @@
|
|
|
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
|
-
hardBreak: () => hardBreak,
|
|
31
|
-
heading1: () => heading1,
|
|
32
|
-
heading2: () => heading2,
|
|
33
|
-
heading3: () => heading3,
|
|
34
|
-
image: () => image,
|
|
35
|
-
inlineImage: () => inlineImage,
|
|
36
|
-
linkCard: () => linkCard,
|
|
37
|
-
logo: () => logo,
|
|
38
|
-
orderedList: () => orderedList,
|
|
39
|
-
repeat: () => repeat,
|
|
40
|
-
section: () => section,
|
|
41
|
-
spacer: () => spacer,
|
|
42
|
-
text: () => text
|
|
43
|
-
});
|
|
44
|
-
module.exports = __toCommonJS(blocks_exports);
|
|
45
|
-
|
|
46
|
-
// src/blocks/button.tsx
|
|
47
|
-
var import_lucide_react = require("lucide-react");
|
|
48
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
49
|
-
var button = {
|
|
50
|
-
title: "Button",
|
|
51
|
-
description: "Add a call to action button to email.",
|
|
52
|
-
searchTerms: ["link", "button", "cta"],
|
|
53
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.MousePointer, { className: "mly-h-4 mly-w-4" }),
|
|
54
|
-
command: ({ editor, range }) => {
|
|
55
|
-
editor.chain().focus().deleteRange(range).setButton().run();
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
var linkCard = {
|
|
59
|
-
title: "Link Card",
|
|
60
|
-
description: "Add a link card to email.",
|
|
61
|
-
searchTerms: ["link", "button", "image"],
|
|
62
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_lucide_react.ArrowUpRightSquare, { className: "mly-h-4 mly-w-4" }),
|
|
63
|
-
command: ({ editor, range }) => {
|
|
64
|
-
editor.chain().focus().deleteRange(range).setLinkCard().run();
|
|
65
|
-
},
|
|
66
|
-
render: (editor) => {
|
|
67
|
-
return editor.extensionManager.extensions.findIndex(
|
|
68
|
-
(ext) => ext.name === "linkCard"
|
|
69
|
-
) === -1 ? null : true;
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
// src/blocks/image.tsx
|
|
74
|
-
var import_state = require("@tiptap/pm/state");
|
|
75
|
-
var import_lucide_react2 = require("lucide-react");
|
|
76
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
77
|
-
var image = {
|
|
78
|
-
title: "Image",
|
|
79
|
-
description: "Full width image",
|
|
80
|
-
searchTerms: ["image"],
|
|
81
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.ImageIcon, { className: "mly-h-4 mly-w-4" }),
|
|
82
|
-
command: ({ editor, range }) => {
|
|
83
|
-
editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
var logo = {
|
|
87
|
-
title: "Logo",
|
|
88
|
-
description: "Add your brand logo",
|
|
89
|
-
searchTerms: ["image", "logo"],
|
|
90
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_lucide_react2.ImageIcon, { className: "mly-h-4 mly-w-4" }),
|
|
91
|
-
command: ({ editor, range }) => {
|
|
92
|
-
editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
|
|
93
|
-
}
|
|
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
|
-
};
|
|
120
|
-
|
|
121
|
-
// src/blocks/layout.tsx
|
|
122
|
-
var import_lucide_react3 = require("lucide-react");
|
|
123
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
124
|
-
var columns = {
|
|
125
|
-
title: "Columns",
|
|
126
|
-
description: "Add columns to email.",
|
|
127
|
-
searchTerms: ["layout", "columns"],
|
|
128
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.ColumnsIcon, { className: "mly-h-4 mly-w-4" }),
|
|
129
|
-
command: ({ editor, range }) => {
|
|
130
|
-
editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
var section = {
|
|
134
|
-
title: "Section",
|
|
135
|
-
description: "Add a section to email.",
|
|
136
|
-
searchTerms: ["layout", "section"],
|
|
137
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.RectangleHorizontal, { className: "mly-h-4 mly-w-4" }),
|
|
138
|
-
command: ({ editor, range }) => {
|
|
139
|
-
editor.chain().focus().deleteRange(range).setSection().run();
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
var repeat = {
|
|
143
|
-
title: "Repeat",
|
|
144
|
-
description: "Loop over an array of items.",
|
|
145
|
-
searchTerms: ["repeat", "for", "loop"],
|
|
146
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Repeat2, { className: "mly-h-4 mly-w-4" }),
|
|
147
|
-
command: ({ editor, range }) => {
|
|
148
|
-
editor.chain().focus().deleteRange(range).setRepeat().run();
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
var spacer = {
|
|
152
|
-
title: "Spacer",
|
|
153
|
-
description: "Add space between blocks.",
|
|
154
|
-
searchTerms: ["space", "gap", "divider"],
|
|
155
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.MoveVertical, { className: "mly-h-4 mly-w-4" }),
|
|
156
|
-
command: ({ editor, range }) => {
|
|
157
|
-
editor.chain().focus().deleteRange(range).setSpacer({ height: "sm" }).run();
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
var divider = {
|
|
161
|
-
title: "Divider",
|
|
162
|
-
description: "Add a horizontal divider.",
|
|
163
|
-
searchTerms: ["divider", "line"],
|
|
164
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react3.Minus, { className: "mly-h-4 mly-w-4" }),
|
|
165
|
-
command: ({ editor, range }) => {
|
|
166
|
-
editor.chain().focus().deleteRange(range).setHorizontalRule().run();
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
// src/blocks/list.tsx
|
|
171
|
-
var import_lucide_react4 = require("lucide-react");
|
|
172
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
173
|
-
var bulletList = {
|
|
174
|
-
title: "Bullet List",
|
|
175
|
-
description: "Create a simple bullet list.",
|
|
176
|
-
searchTerms: ["unordered", "point"],
|
|
177
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.List, { className: "mly-h-4 mly-w-4" }),
|
|
178
|
-
command: ({ editor, range }) => {
|
|
179
|
-
editor.chain().focus().deleteRange(range).toggleBulletList().run();
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
var orderedList = {
|
|
183
|
-
title: "Numbered List",
|
|
184
|
-
description: "Create a list with numbering.",
|
|
185
|
-
searchTerms: ["ordered"],
|
|
186
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_lucide_react4.ListOrdered, { className: "mly-h-4 mly-w-4" }),
|
|
187
|
-
command: ({ editor, range }) => {
|
|
188
|
-
editor.chain().focus().deleteRange(range).toggleOrderedList().run();
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
// src/blocks/typography.tsx
|
|
193
|
-
var import_lucide_react5 = require("lucide-react");
|
|
194
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
195
|
-
var text = {
|
|
196
|
-
title: "Text",
|
|
197
|
-
description: "Just start typing with plain text.",
|
|
198
|
-
searchTerms: ["p", "paragraph"],
|
|
199
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.Text, { className: "mly-h-4 mly-w-4" }),
|
|
200
|
-
command: ({ editor, range }) => {
|
|
201
|
-
editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
|
|
202
|
-
}
|
|
203
|
-
};
|
|
204
|
-
var heading1 = {
|
|
205
|
-
title: "Heading 1",
|
|
206
|
-
description: "Big heading.",
|
|
207
|
-
searchTerms: ["title", "big", "large"],
|
|
208
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.Heading1, { className: "mly-h-4 mly-w-4" }),
|
|
209
|
-
command: ({ editor, range }) => {
|
|
210
|
-
editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
var heading2 = {
|
|
214
|
-
title: "Heading 2",
|
|
215
|
-
description: "Medium heading.",
|
|
216
|
-
searchTerms: ["subtitle", "medium"],
|
|
217
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.Heading2, { className: "mly-h-4 mly-w-4" }),
|
|
218
|
-
command: ({ editor, range }) => {
|
|
219
|
-
editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
var heading3 = {
|
|
223
|
-
title: "Heading 3",
|
|
224
|
-
description: "Small heading.",
|
|
225
|
-
searchTerms: ["subtitle", "small"],
|
|
226
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.Heading3, { className: "mly-h-4 mly-w-4" }),
|
|
227
|
-
command: ({ editor, range }) => {
|
|
228
|
-
editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
|
|
229
|
-
}
|
|
230
|
-
};
|
|
231
|
-
var hardBreak = {
|
|
232
|
-
title: "Hard Break",
|
|
233
|
-
description: "Add a break between lines.",
|
|
234
|
-
searchTerms: ["break", "line"],
|
|
235
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.DivideIcon, { className: "mly-h-4 mly-w-4" }),
|
|
236
|
-
command: ({ editor, range }) => {
|
|
237
|
-
editor.chain().focus().deleteRange(range).setHardBreak().run();
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
var blockquote = {
|
|
241
|
-
title: "Blockquote",
|
|
242
|
-
description: "Add blockquote.",
|
|
243
|
-
searchTerms: ["quote", "blockquote"],
|
|
244
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.TextQuote, { className: "mly-h-4 mly-w-4" }),
|
|
245
|
-
command: ({ editor, range }) => {
|
|
246
|
-
editor.chain().focus().deleteRange(range).toggleBlockquote().run();
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
var footer = {
|
|
250
|
-
title: "Footer",
|
|
251
|
-
description: "Add a footer text to email.",
|
|
252
|
-
searchTerms: ["footer", "text"],
|
|
253
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.FootprintsIcon, { className: "mly-h-4 mly-w-4" }),
|
|
254
|
-
command: ({ editor, range }) => {
|
|
255
|
-
editor.chain().focus().deleteRange(range).setFooter().run();
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
var clearLine = {
|
|
259
|
-
title: "Clear Line",
|
|
260
|
-
description: "Clear the current line.",
|
|
261
|
-
searchTerms: ["clear", "line"],
|
|
262
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react5.EraserIcon, { className: "mly-h-4 mly-w-4" }),
|
|
263
|
-
command: ({ editor, range }) => {
|
|
264
|
-
editor.chain().focus().selectParentNode().deleteSelection().run();
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
268
|
-
0 && (module.exports = {
|
|
269
|
-
blockquote,
|
|
270
|
-
bulletList,
|
|
271
|
-
button,
|
|
272
|
-
clearLine,
|
|
273
|
-
columns,
|
|
274
|
-
divider,
|
|
275
|
-
footer,
|
|
276
|
-
hardBreak,
|
|
277
|
-
heading1,
|
|
278
|
-
heading2,
|
|
279
|
-
heading3,
|
|
280
|
-
image,
|
|
281
|
-
inlineImage,
|
|
282
|
-
linkCard,
|
|
283
|
-
logo,
|
|
284
|
-
orderedList,
|
|
285
|
-
repeat,
|
|
286
|
-
section,
|
|
287
|
-
spacer,
|
|
288
|
-
text
|
|
289
|
-
});
|
|
290
|
-
//# sourceMappingURL=index.js.map
|
package/dist/blocks/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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,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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","editor","import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime","import_lucide_react","import_jsx_runtime"]}
|