@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
@@ -0,0 +1,282 @@
1
+ import { t as SlashCommandGroupItem } from "../slash-command-BrwA1bHs.mjs";
2
+ import { a as Variables, c as VariableOptions, n as ShellType, t as NodeThemeUpdate } from "../theme-D1CI7_8s.mjs";
3
+ import { AnyExtension, Extension, Mark, Node } from "@tiptap/core";
4
+ import { DependencyList } from "react";
5
+ import { ButtonAttributes, ColumnAttributes, ColumnsAttributes, FontFamilyItem, FooterAttributes, HtmlCodeBlockAttributes, InlineImageAttributes, InlineStyle, LinkCardAttributes, NodeThemeOptions, SectionAttributes, SpacerAttributes, VisibilityRule } from "@maily-to/shared";
6
+ import { Doc } from "yjs";
7
+ import { SuggestionOptions } from "@tiptap/suggestion";
8
+ import { UseEditorOptions } from "@tiptap/react";
9
+ //#region src/extensions/blockquote/blockquote.d.ts
10
+ declare const BlockquoteExtension: import("@tiptap/core").Node<import("@tiptap/extension-blockquote").BlockquoteOptions, any>;
11
+ //#endregion
12
+ //#region src/extensions/body/body.d.ts
13
+ declare const BodyExtension: Node<any, any>;
14
+ //#endregion
15
+ //#region src/extensions/bold/bold.d.ts
16
+ declare const BoldExtension: import("@tiptap/core").Mark<import("@tiptap/extension-bold").BoldOptions, any>;
17
+ //#endregion
18
+ //#region src/extensions/button/button.d.ts
19
+ type ButtonOptions = {
20
+ HTMLAttributes: Record<string, unknown>;
21
+ };
22
+ declare module '@tiptap/core' {
23
+ interface Commands<ReturnType> {
24
+ button: {
25
+ setButton: (attrs?: Partial<ButtonAttributes>) => ReturnType;
26
+ updateButtonAttributes: (attrs: Partial<ButtonAttributes>) => ReturnType;
27
+ };
28
+ }
29
+ }
30
+ declare const ButtonExtension: Node<ButtonOptions, any>;
31
+ //#endregion
32
+ //#region src/extensions/collaboration-attributes/collaboration-attributes.d.ts
33
+ type CollaborationAttributesOptions = {
34
+ document: Doc | null;
35
+ field: string;
36
+ };
37
+ type CollaborationAttributesStorage = {
38
+ unobserve: (() => void) | null;
39
+ };
40
+ declare module '@tiptap/core' {
41
+ interface Storage {
42
+ collaborationAttributes: CollaborationAttributesStorage;
43
+ }
44
+ }
45
+ declare const CollaborationAttributesExtension: Extension<CollaborationAttributesOptions, CollaborationAttributesStorage>;
46
+ //#endregion
47
+ //#region src/extensions/columns/column.d.ts
48
+ declare module '@tiptap/core' {
49
+ interface Commands<ReturnType> {
50
+ column: {
51
+ updateColumn: (attrs: Partial<ColumnAttributes>) => ReturnType;
52
+ };
53
+ }
54
+ }
55
+ declare const ColumnExtension: Node<any, any>;
56
+ //#endregion
57
+ //#region src/extensions/columns/columns.d.ts
58
+ declare module '@tiptap/core' {
59
+ interface Commands<ReturnType> {
60
+ columns: {
61
+ setColumns: (columnCount?: number) => ReturnType;
62
+ updateColumns: (attrs: Partial<ColumnsAttributes>) => ReturnType;
63
+ };
64
+ }
65
+ }
66
+ declare const ColumnsExtension: Node<any, any>;
67
+ //#endregion
68
+ //#region src/extensions/container/container.d.ts
69
+ declare const ContainerExtension: Node<any, any>;
70
+ //#endregion
71
+ //#region src/extensions/footer/footer.d.ts
72
+ type FooterOptions = {
73
+ HTMLAttributes: Record<string, unknown>;
74
+ };
75
+ declare module '@tiptap/core' {
76
+ interface Commands<ReturnType> {
77
+ footer: {
78
+ setFooter: () => ReturnType;
79
+ updateFooterAttributes: (attrs: Partial<FooterAttributes>) => ReturnType;
80
+ };
81
+ }
82
+ }
83
+ declare const FooterExtension: Node<FooterOptions, any>;
84
+ //#endregion
85
+ //#region src/extensions/horizontal-rule/horizontal-rule.d.ts
86
+ declare const HorizontalRuleExtension: import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>;
87
+ //#endregion
88
+ //#region src/extensions/image/image.d.ts
89
+ declare const ImageExtension: import("@tiptap/core").Node<import("@tiptap/extension-image").ImageOptions, any>;
90
+ //#endregion
91
+ //#region src/extensions/image-upload/image-upload.d.ts
92
+ declare const IMAGE_UPLOAD_STATUSES: {
93
+ readonly IDLE: 'idle';
94
+ readonly LOADING: 'loading';
95
+ readonly ERROR: 'error';
96
+ readonly LOADED: 'loaded';
97
+ };
98
+ type ImageUploadStatus = (typeof IMAGE_UPLOAD_STATUSES)[keyof typeof IMAGE_UPLOAD_STATUSES];
99
+ type ImageUploadStorage = {
100
+ uploads: Map<string, ImageUploadStatus>;
101
+ };
102
+ declare module '@tiptap/core' {
103
+ interface Storage {
104
+ imageUpload: ImageUploadStorage;
105
+ }
106
+ }
107
+ declare const ALLOWED_IMAGE_MIME_TYPES: readonly ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/svg+xml'];
108
+ type ImageUploadContext = {
109
+ position: number;
110
+ removeImage: () => void;
111
+ };
112
+ type ImageUploadOptions = {
113
+ onImageUpload?: (file: File, context: ImageUploadContext) => Promise<string>;
114
+ onImageUploadError?: (error: unknown, file: File, context: ImageUploadContext) => void;
115
+ };
116
+ declare const ImageUploadExtension: Extension<ImageUploadOptions, ImageUploadStorage>;
117
+ //#endregion
118
+ //#region src/extensions/link-card/link-card.d.ts
119
+ type LinkCardOptions = {
120
+ HTMLAttributes: Record<string, unknown>;
121
+ };
122
+ declare module '@tiptap/core' {
123
+ interface Commands<ReturnType> {
124
+ linkCard: {
125
+ setLinkCard: (attrs?: Partial<LinkCardAttributes>) => ReturnType;
126
+ updateLinkCardAttributes: (attrs: Partial<LinkCardAttributes>) => ReturnType;
127
+ };
128
+ }
129
+ }
130
+ declare const LinkCardExtension: Node<LinkCardOptions, any>;
131
+ //#endregion
132
+ //#region src/extensions/variable/protect-variable-trigger.d.ts
133
+ declare const ProtectVariableTrigger: Extension<any, any>;
134
+ //#endregion
135
+ //#region src/extensions/variable/variable.d.ts
136
+ type CoreVariableOptions = VariableOptions & {
137
+ isIdEditable: boolean;
138
+ variables?: Variables;
139
+ };
140
+ type CoreVariableStorage = {
141
+ isIdEditable: boolean;
142
+ variables?: Variables;
143
+ };
144
+ declare module '@tiptap/core' {
145
+ interface Storage {
146
+ variable: CoreVariableStorage;
147
+ }
148
+ }
149
+ declare const VariableExtension: import("@tiptap/core").Node<CoreVariableOptions, CoreVariableStorage>;
150
+ //#endregion
151
+ //#region src/extensions/inline-image/inline-image.d.ts
152
+ type InlineImageOptions = {
153
+ HTMLAttributes: Record<string, unknown>;
154
+ };
155
+ declare module '@tiptap/core' {
156
+ interface Commands<ReturnType> {
157
+ inlineImage: {
158
+ setInlineImage: (attrs: Partial<InlineImageAttributes>) => ReturnType;
159
+ updateInlineImageAttributes: (attrs: Partial<InlineImageAttributes>) => ReturnType;
160
+ };
161
+ }
162
+ }
163
+ declare const InlineImageExtension: Node<InlineImageOptions, any>;
164
+ //#endregion
165
+ //#region src/extensions/inline-span/inline-span.d.ts
166
+ declare const InlineSpanExtension: Node<any, any>;
167
+ //#endregion
168
+ //#region src/extensions/section/section.d.ts
169
+ declare module '@tiptap/core' {
170
+ interface Commands<ReturnType> {
171
+ section: {
172
+ setSection: () => ReturnType;
173
+ updateSection: (attrs: Partial<SectionAttributes>) => ReturnType;
174
+ };
175
+ }
176
+ }
177
+ declare const SectionExtension: Node<any, any>;
178
+ //#endregion
179
+ //#region src/extensions/slash-command/slash-command.d.ts
180
+ type SlashCommandStorage = {
181
+ commands: SlashCommandGroupItem[];
182
+ };
183
+ declare module '@tiptap/core' {
184
+ interface Storage {
185
+ slashCommand: SlashCommandStorage;
186
+ }
187
+ }
188
+ type SlashCommandOptions = {
189
+ commands: SlashCommandGroupItem[];
190
+ suggestion: Omit<SuggestionOptions, 'editor'>;
191
+ };
192
+ declare const SlashCommandExtension: Extension<SlashCommandOptions, SlashCommandStorage>;
193
+ //#endregion
194
+ //#region src/extensions/slash-command/default-slash-commands.d.ts
195
+ declare const DEFAULT_SLASH_COMMANDS: SlashCommandGroupItem[];
196
+ //#endregion
197
+ //#region src/extensions/spacer/spacer.d.ts
198
+ type SpacerOptions = {
199
+ HTMLAttributes: Record<string, unknown>;
200
+ };
201
+ declare module '@tiptap/core' {
202
+ interface Commands<ReturnType> {
203
+ spacer: {
204
+ setSpacer: (attrs?: Partial<SpacerAttributes>) => ReturnType;
205
+ unsetSpacer: () => ReturnType;
206
+ updateSpacerAttributes: (attrs: Partial<SpacerAttributes>) => ReturnType;
207
+ };
208
+ }
209
+ }
210
+ declare const SpacerExtension: Node<SpacerOptions, any>;
211
+ //#endregion
212
+ //#region src/extensions/span/span.d.ts
213
+ declare const SpanExtension: Mark<any, any>;
214
+ //#endregion
215
+ //#region src/extensions/style/style.d.ts
216
+ declare const STYLE_SUPPORTED_TYPES: string[];
217
+ declare module '@tiptap/core' {
218
+ interface Commands<ReturnType> {
219
+ style: {
220
+ updateNodeStyle: (typeOrName: string, declarations: InlineStyle | Record<string, string | null | undefined>) => ReturnType;
221
+ };
222
+ }
223
+ }
224
+ type StyleOptions = {
225
+ fontFamilies: FontFamilyItem[];
226
+ markTypes: string[];
227
+ types: string[];
228
+ };
229
+ declare const StyleExtension: Extension<StyleOptions, any>;
230
+ //#endregion
231
+ //#region src/extensions/html-code-block/html-code-block.d.ts
232
+ declare module '@tiptap/core' {
233
+ interface Commands<ReturnType> {
234
+ htmlCodeBlock: {
235
+ setHtmlCodeBlock: (attrs?: {
236
+ language: string;
237
+ }) => ReturnType;
238
+ updateHtmlCodeBlock: (attrs: Partial<HtmlCodeBlockAttributes>) => ReturnType;
239
+ };
240
+ }
241
+ }
242
+ declare const HtmlCodeBlockExtension: import("@tiptap/core").Node<import("@tiptap/extension-code-block-lowlight").CodeBlockLowlightOptions, any>;
243
+ //#endregion
244
+ //#region src/extensions/theme/theme.d.ts
245
+ type ShellThemeUpdate = Pick<NodeThemeUpdate, ShellType>;
246
+ declare module '@tiptap/core' {
247
+ interface Commands<ReturnType> {
248
+ theme: {
249
+ setNodeTheme: (theme: NodeThemeOptions) => ReturnType;
250
+ updateNodeTheme: (theme: NodeThemeUpdate) => ReturnType;
251
+ updateShellTheme: (theme: ShellThemeUpdate) => ReturnType;
252
+ };
253
+ }
254
+ }
255
+ type ThemeExtensionOptions = {
256
+ theme: NodeThemeOptions;
257
+ };
258
+ declare const ThemeExtension: Extension<ThemeExtensionOptions, any>;
259
+ //#endregion
260
+ //#region src/extensions/visibility/visibility.d.ts
261
+ declare const VISIBILITY_SUPPORTED_TYPES: string[];
262
+ type VisibilityOptions = {
263
+ types: string[];
264
+ };
265
+ declare module '@tiptap/core' {
266
+ interface Commands<ReturnType> {
267
+ visibility: {
268
+ setVisibilityRule: (typeOrName: string, rule: VisibilityRule) => ReturnType;
269
+ unsetVisibilityRule: (typeOrName: string) => ReturnType;
270
+ };
271
+ }
272
+ }
273
+ declare const VisibilityExtension: Extension<VisibilityOptions, any>;
274
+ //#endregion
275
+ //#region src/hooks/use-maily-editor.d.ts
276
+ declare const DEFAULT_EXTENSIONS: AnyExtension[];
277
+ //#endregion
278
+ //#region src/utils/html.d.ts
279
+ declare function getNormalizedHtml(html: string): string;
280
+ //#endregion
281
+ export { ALLOWED_IMAGE_MIME_TYPES, BlockquoteExtension, BodyExtension, BoldExtension, ButtonExtension, CollaborationAttributesExtension, type CollaborationAttributesOptions, ColumnExtension, ColumnsExtension, ContainerExtension, DEFAULT_EXTENSIONS, DEFAULT_SLASH_COMMANDS, FooterExtension, HorizontalRuleExtension, HtmlCodeBlockExtension, IMAGE_UPLOAD_STATUSES, ImageExtension, type ImageUploadContext, ImageUploadExtension, type ImageUploadOptions, type ImageUploadStatus, InlineImageExtension, InlineSpanExtension, LinkCardExtension, type LinkCardOptions, ProtectVariableTrigger, STYLE_SUPPORTED_TYPES, SectionExtension, SlashCommandExtension, SpacerExtension, SpanExtension, StyleExtension, type StyleOptions, ThemeExtension, type ThemeExtensionOptions, VISIBILITY_SUPPORTED_TYPES, VariableExtension, VisibilityExtension, type VisibilityOptions, getNormalizedHtml };
282
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/extensions/blockquote/blockquote.ts","../../src/extensions/body/body.ts","../../src/extensions/bold/bold.ts","../../src/extensions/button/button.ts","../../src/extensions/collaboration-attributes/collaboration-attributes.ts","../../src/extensions/columns/column.ts","../../src/extensions/columns/columns.ts","../../src/extensions/container/container.ts","../../src/extensions/footer/footer.ts","../../src/extensions/horizontal-rule/horizontal-rule.ts","../../src/extensions/image/image.ts","../../src/extensions/image-upload/image-upload.ts","../../src/extensions/link-card/link-card.ts","../../src/extensions/variable/protect-variable-trigger.ts","../../src/extensions/variable/variable.ts","../../src/extensions/inline-image/inline-image.ts","../../src/extensions/inline-span/inline-span.ts","../../src/extensions/section/section.ts","../../src/extensions/slash-command/slash-command.ts","../../src/extensions/slash-command/default-slash-commands.tsx","../../src/extensions/spacer/spacer.ts","../../src/extensions/span/span.ts","../../src/extensions/style/style.ts","../../src/extensions/html-code-block/html-code-block.ts","../../src/extensions/theme/theme.ts","../../src/extensions/visibility/visibility.ts","../../src/hooks/use-maily-editor.ts","../../src/utils/html.ts"],"mappings":";;;;;;;;;cAIa,4CAAmB,4CAAA;;;cCDnB,eAAa;;;cCCb,sCAAa,sCAAA;;;KCSd;EACV,gBAAgB;;;YAIN,SAAS;IACjB;MACE,YAAY,QAAQ,QAAQ,sBAAsB;MAClD,yBAAyB,OAAO,QAAQ,sBAAsB;;;;cAKvD,iBAAe,KAAA;;;KCrBhB;EACV,UAAU;EACV;;KAGG;EACH;;;YAIU;IACR,yBAAyB;;;cA0DhB,kCAAgC,UAAA,gCAAA;;;;YC1DjC,SAAS;IACjB;MACE,eAAe,OAAO,QAAQ,sBAAsB;;;;cAK7C,iBAAe;;;;YCdhB,SAAS;IACjB;MACE,aAAa,yBAAyB;MACtC,gBAAgB,OAAO,QAAQ,uBAAuB;;;;cAK/C,kBAAgB;;;cCZhB,oBAAkB;;;KCDnB;EACV,gBAAgB;;;YAIN,SAAS;IACjB;MACE,iBAAiB;MACjB,yBAAyB,OAAO,QAAQ,sBAAsB;;;;cAKvD,iBAAe,KAAA;;;cCdf,gDAAuB,iDAA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