@maily-to/core 0.3.7 → 2.0.0-beta.10

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.
Files changed (40) hide show
  1. package/LICENSE +21 -0
  2. package/dist/blocks/index.cjs +29 -305
  3. package/dist/blocks/index.d.cts +1 -59
  4. package/dist/blocks/index.d.mts +46 -0
  5. package/dist/blocks/index.d.mts.map +1 -0
  6. package/dist/blocks/index.mjs +2 -273
  7. package/dist/extensions/index.cjs +354 -9100
  8. package/dist/extensions/index.d.cts +1 -448
  9. package/dist/extensions/index.d.mts +282 -0
  10. package/dist/extensions/index.d.mts.map +1 -0
  11. package/dist/extensions/index.mjs +322 -9052
  12. package/dist/index.cjs +10225 -12221
  13. package/dist/index.d.cts +1 -63
  14. package/dist/index.d.mts +743 -0
  15. package/dist/index.d.mts.map +1 -0
  16. package/dist/index.mjs +10103 -12273
  17. package/dist/slash-command-BrwA1bHs.d.mts +38 -0
  18. package/dist/slash-command-BrwA1bHs.d.mts.map +1 -0
  19. package/dist/theme-D1CI7_8s.d.mts +70 -0
  20. package/dist/theme-D1CI7_8s.d.mts.map +1 -0
  21. package/dist/typography-BdOKvXfQ.mjs +911 -0
  22. package/dist/typography-D-VnwOSw.cjs +970 -0
  23. package/dist/typography-DW7VApAR.cjs +1072 -0
  24. package/dist/use-maily-editor-Atvy2kSO.cjs +3993 -0
  25. package/dist/use-maily-editor-CByaDhmT.cjs +4955 -0
  26. package/dist/use-maily-editor-idL0RNsG.mjs +4504 -0
  27. package/package.json +115 -180
  28. package/readme.md +356 -195
  29. package/src/styles/index.css +2537 -0
  30. package/dist/blocks/index.cjs.map +0 -1
  31. package/dist/blocks/index.d.ts +0 -59
  32. package/dist/blocks/index.mjs.map +0 -1
  33. package/dist/extensions/index.cjs.map +0 -1
  34. package/dist/extensions/index.d.ts +0 -448
  35. package/dist/extensions/index.mjs.map +0 -1
  36. package/dist/index.cjs.map +0 -1
  37. package/dist/index.css +0 -2487
  38. package/dist/index.css.map +0 -1
  39. package/dist/index.d.ts +0 -63
  40. package/dist/index.mjs.map +0 -1
@@ -1,273 +1,2 @@
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
- render: (editor) => {
22
- return editor.extensionManager.extensions.findIndex(
23
- (ext) => ext.name === "linkCard"
24
- ) === -1 ? null : true;
25
- }
26
- };
27
-
28
- // src/blocks/code.tsx
29
- import { CodeXmlIcon } from "lucide-react";
30
- import { jsx as jsx2 } from "react/jsx-runtime";
31
- var htmlCodeBlock = {
32
- title: "Custom HTML",
33
- description: "Insert a custom HTML block",
34
- searchTerms: ["html", "code", "custom"],
35
- icon: /* @__PURE__ */ jsx2(CodeXmlIcon, { className: "mly:h-4 mly:w-4" }),
36
- command: ({ editor, range }) => {
37
- editor.chain().focus().deleteRange(range).setHtmlCodeBlock({ language: "html" }).run();
38
- }
39
- };
40
-
41
- // src/blocks/image.tsx
42
- import { TextSelection } from "@tiptap/pm/state";
43
- import { ImageIcon } from "lucide-react";
44
- import { jsx as jsx3 } from "react/jsx-runtime";
45
- var image = {
46
- title: "Image",
47
- description: "Full width image",
48
- searchTerms: ["image"],
49
- icon: /* @__PURE__ */ jsx3(ImageIcon, { className: "mly:h-4 mly:w-4" }),
50
- command: ({ editor, range }) => {
51
- editor.chain().focus().deleteRange(range).setImage({ src: "" }).run();
52
- }
53
- };
54
- var logo = {
55
- title: "Logo",
56
- description: "Add your brand logo",
57
- searchTerms: ["image", "logo"],
58
- icon: /* @__PURE__ */ jsx3(ImageIcon, { className: "mly:h-4 mly:w-4" }),
59
- command: ({ editor, range }) => {
60
- editor.chain().focus().deleteRange(range).setLogoImage({ src: "" }).run();
61
- }
62
- };
63
- var inlineImage = {
64
- title: "Inline Image",
65
- description: "Inline image",
66
- searchTerms: ["image", "inline"],
67
- icon: /* @__PURE__ */ jsx3(ImageIcon, { className: "mly:h-4 mly:w-4" }),
68
- command: ({ editor, range }) => {
69
- editor.chain().focus().deleteRange(range).setInlineImage({
70
- src: "https://maily.to/brand/logo.png"
71
- }).command((props) => {
72
- const { tr, state, view, editor: editor2 } = props;
73
- const { from } = range;
74
- const node = state.doc.nodeAt(from);
75
- if (!node) {
76
- return false;
77
- }
78
- const selection = TextSelection.create(
79
- tr.doc,
80
- from,
81
- from + node.nodeSize
82
- );
83
- tr.setSelection(selection);
84
- return true;
85
- }).run();
86
- }
87
- };
88
-
89
- // src/blocks/layout.tsx
90
- import {
91
- ColumnsIcon,
92
- Repeat2,
93
- MoveVertical,
94
- RectangleHorizontal,
95
- Minus
96
- } from "lucide-react";
97
- import { jsx as jsx4 } from "react/jsx-runtime";
98
- var columns = {
99
- title: "Columns",
100
- description: "Add columns to email.",
101
- searchTerms: ["layout", "columns"],
102
- icon: /* @__PURE__ */ jsx4(ColumnsIcon, { className: "mly:h-4 mly:w-4" }),
103
- command: ({ editor, range }) => {
104
- editor.chain().focus().deleteRange(range).setColumns().focus(editor.state.selection.head - 2).run();
105
- }
106
- };
107
- var section = {
108
- title: "Section",
109
- description: "Add a section to email.",
110
- searchTerms: ["layout", "section"],
111
- icon: /* @__PURE__ */ jsx4(RectangleHorizontal, { className: "mly:h-4 mly:w-4" }),
112
- command: ({ editor, range }) => {
113
- editor.chain().focus().deleteRange(range).setSection().run();
114
- }
115
- };
116
- var repeat = {
117
- title: "Repeat",
118
- description: "Loop over an array of items.",
119
- searchTerms: ["repeat", "for", "loop"],
120
- icon: /* @__PURE__ */ jsx4(Repeat2, { className: "mly:h-4 mly:w-4" }),
121
- command: ({ editor, range }) => {
122
- editor.chain().focus().deleteRange(range).setRepeat().run();
123
- }
124
- };
125
- var spacer = {
126
- title: "Spacer",
127
- description: "Add space between blocks.",
128
- searchTerms: ["space", "gap", "divider"],
129
- icon: /* @__PURE__ */ jsx4(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__ */ jsx4(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
- import { List, ListOrdered } from "lucide-react";
146
- import { jsx as jsx5 } from "react/jsx-runtime";
147
- var bulletList = {
148
- title: "Bullet List",
149
- description: "Create a simple bullet list.",
150
- searchTerms: ["unordered", "point"],
151
- icon: /* @__PURE__ */ jsx5(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__ */ jsx5(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
- import {
168
- Text,
169
- Heading1,
170
- Heading2,
171
- Heading3,
172
- DivideIcon,
173
- TextQuote,
174
- FootprintsIcon,
175
- EraserIcon
176
- } from "lucide-react";
177
- import { jsx as jsx6 } from "react/jsx-runtime";
178
- var text = {
179
- title: "Text",
180
- description: "Just start typing with plain text.",
181
- searchTerms: ["p", "paragraph"],
182
- icon: /* @__PURE__ */ jsx6(Text, { className: "mly:h-4 mly:w-4" }),
183
- command: ({ editor, range }) => {
184
- editor.chain().focus().deleteRange(range).toggleNode("paragraph", "paragraph").run();
185
- }
186
- };
187
- var heading1 = {
188
- title: "Heading 1",
189
- description: "Big heading.",
190
- searchTerms: ["h1", "title", "big", "large"],
191
- icon: /* @__PURE__ */ jsx6(Heading1, { className: "mly:h-4 mly:w-4" }),
192
- command: ({ editor, range }) => {
193
- editor.chain().focus().deleteRange(range).setNode("heading", { level: 1 }).run();
194
- }
195
- };
196
- var heading2 = {
197
- title: "Heading 2",
198
- description: "Medium heading.",
199
- searchTerms: ["h2", "subtitle", "medium"],
200
- icon: /* @__PURE__ */ jsx6(Heading2, { className: "mly:h-4 mly:w-4" }),
201
- command: ({ editor, range }) => {
202
- editor.chain().focus().deleteRange(range).setNode("heading", { level: 2 }).run();
203
- }
204
- };
205
- var heading3 = {
206
- title: "Heading 3",
207
- description: "Small heading.",
208
- searchTerms: ["h3", "subtitle", "small"],
209
- icon: /* @__PURE__ */ jsx6(Heading3, { className: "mly:h-4 mly:w-4" }),
210
- command: ({ editor, range }) => {
211
- editor.chain().focus().deleteRange(range).setNode("heading", { level: 3 }).run();
212
- }
213
- };
214
- var hardBreak = {
215
- title: "Hard Break",
216
- description: "Add a break between lines.",
217
- searchTerms: ["break", "line"],
218
- icon: /* @__PURE__ */ jsx6(DivideIcon, { className: "mly:h-4 mly:w-4" }),
219
- command: ({ editor, range }) => {
220
- editor.chain().focus().deleteRange(range).setHardBreak().run();
221
- }
222
- };
223
- var blockquote = {
224
- title: "Blockquote",
225
- description: "Add blockquote.",
226
- searchTerms: ["quote", "blockquote"],
227
- icon: /* @__PURE__ */ jsx6(TextQuote, { className: "mly:h-4 mly:w-4" }),
228
- command: ({ editor, range }) => {
229
- editor.chain().focus().deleteRange(range).toggleBlockquote().run();
230
- }
231
- };
232
- var footer = {
233
- title: "Footer",
234
- description: "Add a footer text to email.",
235
- searchTerms: ["footer", "text"],
236
- icon: /* @__PURE__ */ jsx6(FootprintsIcon, { className: "mly:h-4 mly:w-4" }),
237
- command: ({ editor, range }) => {
238
- editor.chain().focus().deleteRange(range).setFooter().run();
239
- }
240
- };
241
- var clearLine = {
242
- title: "Clear Line",
243
- description: "Clear the current line.",
244
- searchTerms: ["clear", "line"],
245
- icon: /* @__PURE__ */ jsx6(EraserIcon, { className: "mly:h-4 mly:w-4" }),
246
- command: ({ editor, range }) => {
247
- editor.chain().focus().selectParentNode().deleteSelection().run();
248
- }
249
- };
250
- export {
251
- blockquote,
252
- bulletList,
253
- button,
254
- clearLine,
255
- columns,
256
- divider,
257
- footer,
258
- hardBreak,
259
- heading1,
260
- heading2,
261
- heading3,
262
- htmlCodeBlock,
263
- image,
264
- inlineImage,
265
- linkCard,
266
- logo,
267
- orderedList,
268
- repeat,
269
- section,
270
- spacer,
271
- text
272
- };
273
- //# sourceMappingURL=index.mjs.map
1
+ import { C as headerLogoWithTextVertical, D as button, E as footerCopyrightText, S as headerLogoWithTextHorizontal, T as footerCompanySignature, _ as spacer, a as heading1, b as inlineImage, c as text, d as linkCard, f as columns, g as section, h as repeat, i as hardBreak, l as bulletList, m as htmlCodeBlock, n as clearLine, o as heading2, p as divider, r as footer, s as heading3, t as blockquote, u as orderedList, v as table, w as footerCommunityFeedbackCta, x as headerLogoWithCoverImage, y as image } from "../typography-BdOKvXfQ.mjs";
2
+ export { blockquote, bulletList, button, clearLine, columns, divider, footer, footerCommunityFeedbackCta, footerCompanySignature, footerCopyrightText, hardBreak, headerLogoWithCoverImage, headerLogoWithTextHorizontal, headerLogoWithTextVertical, heading1, heading2, heading3, htmlCodeBlock, image, inlineImage, linkCard, orderedList, repeat, section, spacer, table, text };