@maily-to/core 2.0.0-beta.7 → 2.0.0-beta.8

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 (48) hide show
  1. package/dist/blocks/index.cjs +8 -1
  2. package/dist/blocks/index.d.cts +1 -38
  3. package/dist/blocks/index.d.mts +14 -6
  4. package/dist/blocks/index.d.mts.map +1 -1
  5. package/dist/blocks/index.mjs +2 -2
  6. package/dist/extensions/index.cjs +252 -303
  7. package/dist/extensions/index.d.cts +1 -379
  8. package/dist/extensions/index.d.mts +127 -224
  9. package/dist/extensions/index.d.mts.map +1 -1
  10. package/dist/extensions/index.mjs +238 -271
  11. package/dist/index.cjs +4423 -12618
  12. package/dist/index.d.cts +1 -165
  13. package/dist/index.d.mts +701 -121
  14. package/dist/index.d.mts.map +1 -1
  15. package/dist/index.mjs +8460 -11567
  16. package/dist/{slash-command-BmWRVPbv.d.mts → slash-command-BrwA1bHs.d.mts} +10 -11
  17. package/dist/slash-command-BrwA1bHs.d.mts.map +1 -0
  18. package/dist/theme-D1CI7_8s.d.mts +70 -0
  19. package/dist/theme-D1CI7_8s.d.mts.map +1 -0
  20. package/dist/typography-BdOKvXfQ.mjs +911 -0
  21. package/dist/typography-D-VnwOSw.cjs +970 -0
  22. package/dist/typography-DW7VApAR.cjs +1072 -0
  23. package/dist/use-maily-editor-BP6Mt8Nn.cjs +3991 -0
  24. package/dist/use-maily-editor-DFuhg38t.cjs +4939 -0
  25. package/dist/use-maily-editor-xVILP7H8.mjs +4488 -0
  26. package/package.json +82 -74
  27. package/readme.md +169 -128
  28. package/src/styles/index.css +2537 -0
  29. package/dist/blocks/index.d.cts.map +0 -1
  30. package/dist/chunk-CfYAbeIz.mjs +0 -13
  31. package/dist/extensions/index.d.cts.map +0 -1
  32. package/dist/extensions/index.mjs.map +0 -1
  33. package/dist/index.css +0 -2312
  34. package/dist/index.d.cts.map +0 -1
  35. package/dist/index.mjs.map +0 -1
  36. package/dist/slash-command-BmWRVPbv.d.mts.map +0 -1
  37. package/dist/slash-command-CK0-1FwR.d.cts +0 -39
  38. package/dist/slash-command-CK0-1FwR.d.cts.map +0 -1
  39. package/dist/spacer-DBtsr3hu.cjs +0 -5768
  40. package/dist/spacer-DzZWX-wB.mjs +0 -5456
  41. package/dist/spacer-DzZWX-wB.mjs.map +0 -1
  42. package/dist/typography-CWL13acR.cjs +0 -400
  43. package/dist/typography-DhrUe809.mjs +0 -282
  44. package/dist/typography-DhrUe809.mjs.map +0 -1
  45. package/dist/variable-C9S9ZoHv.d.cts +0 -108
  46. package/dist/variable-C9S9ZoHv.d.cts.map +0 -1
  47. package/dist/variable-DVwGrg2a.d.mts +0 -108
  48. package/dist/variable-DVwGrg2a.d.mts.map +0 -1
@@ -1,32 +1,24 @@
1
- import { t as SlashCommandGroupItem } from "../slash-command-BmWRVPbv.mjs";
2
- import { o as VariableOptions, r as Variables } from "../variable-DVwGrg2a.mjs";
3
- import { AllowedButtonKind, AllowedFieldMode, AllowedTextAlignment, BorderStyleConfig, ColumnAttributes, ColumnsAttributes, FontFamilyItem, FontStyleAttributes, FooterAttributes, HtmlCodeBlockAttributes, LinkCardAttributes, RepeatAttributes, SectionAttributes, SpacerAttributes, TextDirection, VisibilityRule } from "@maily-to/shared";
4
- import { PluginKey } from "@tiptap/pm/state";
5
- import * as _tiptap_core0 from "@tiptap/core";
6
- import { Editor, Extension, Node } from "@tiptap/core";
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
7
  import { SuggestionOptions } from "@tiptap/suggestion";
8
- import * as _tiptap_extension_blockquote0 from "@tiptap/extension-blockquote";
9
- import * as _tiptap_extension_horizontal_rule0 from "@tiptap/extension-horizontal-rule";
10
- import * as _tiptap_extension_code_block_lowlight0 from "@tiptap/extension-code-block-lowlight";
11
- import { ImageOptions } from "@tiptap/extension-image";
12
-
8
+ import { UseEditorOptions } from "@tiptap/react";
13
9
  //#region src/extensions/blockquote/blockquote.d.ts
14
- declare const BlockquoteExtension: _tiptap_core0.Node<_tiptap_extension_blockquote0.BlockquoteOptions, any>;
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>;
15
17
  //#endregion
16
18
  //#region src/extensions/button/button.d.ts
17
- type ButtonAttributes = {
18
- dir: TextDirection | null;
19
- url: string;
20
- kind: AllowedButtonKind;
21
- alignment: AllowedTextAlignment | null;
22
- backgroundColor: string | null;
23
- color: string | null;
24
- paddingMode: AllowedFieldMode;
25
- paddingTop: number;
26
- paddingRight: number;
27
- paddingBottom: number;
28
- paddingLeft: number;
29
- } & BorderStyleConfig & FontStyleAttributes;
19
+ type ButtonOptions = {
20
+ HTMLAttributes: Record<string, unknown>;
21
+ };
30
22
  declare module '@tiptap/core' {
31
23
  interface Commands<ReturnType> {
32
24
  button: {
@@ -35,12 +27,24 @@ declare module '@tiptap/core' {
35
27
  };
36
28
  }
37
29
  }
38
- declare const ButtonExtension: Node<any, any>;
30
+ declare const ButtonExtension: Node<ButtonOptions, any>;
39
31
  //#endregion
40
- //#region src/extensions/columns/column.d.ts
41
- type ColumnOptions = {
42
- HTMLAttributes: Record<string, any>;
32
+ //#region src/extensions/collaboration-attributes/collaboration-attributes.d.ts
33
+ type CollaborationAttributesOptions = {
34
+ document: Doc | null;
35
+ field: string;
43
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
44
48
  declare module '@tiptap/core' {
45
49
  interface Commands<ReturnType> {
46
50
  column: {
@@ -48,42 +52,25 @@ declare module '@tiptap/core' {
48
52
  };
49
53
  }
50
54
  }
51
- declare const ColumnExtension: Node<ColumnOptions, any>;
55
+ declare const ColumnExtension: Node<any, any>;
52
56
  //#endregion
53
57
  //#region src/extensions/columns/columns.d.ts
54
- type ColumnsOptions = {
55
- HTMLAttributes: Record<string, any>;
56
- };
57
58
  declare module '@tiptap/core' {
58
59
  interface Commands<ReturnType> {
59
60
  columns: {
60
61
  setColumns: (columnCount?: number) => ReturnType;
61
62
  updateColumns: (attrs: Partial<ColumnsAttributes>) => ReturnType;
62
- addColumn: () => ReturnType;
63
- removeColumn: () => ReturnType;
64
63
  };
65
64
  }
66
65
  }
67
- declare const ColumnsExtension: Node<ColumnsOptions, any>;
66
+ declare const ColumnsExtension: Node<any, any>;
68
67
  //#endregion
69
- //#region src/extensions/font-style/font-style.d.ts
70
- type FontStyleOptions = {
71
- types: string[];
72
- fontFamilies: FontFamilyItem[];
73
- };
74
- declare module '@tiptap/core' {
75
- interface Commands<ReturnType> {
76
- fontStyle: {
77
- setFontStyle: (attrs: Partial<FontStyleAttributes>) => ReturnType;
78
- unsetFontStyle: () => ReturnType;
79
- };
80
- }
81
- }
82
- declare const FontStyleExtension: Extension<FontStyleOptions, any>;
68
+ //#region src/extensions/container/container.d.ts
69
+ declare const ContainerExtension: Node<any, any>;
83
70
  //#endregion
84
71
  //#region src/extensions/footer/footer.d.ts
85
72
  type FooterOptions = {
86
- HTMLAttributes: Record<string, any>;
73
+ HTMLAttributes: Record<string, unknown>;
87
74
  };
88
75
  declare module '@tiptap/core' {
89
76
  interface Commands<ReturnType> {
@@ -96,20 +83,10 @@ declare module '@tiptap/core' {
96
83
  declare const FooterExtension: Node<FooterOptions, any>;
97
84
  //#endregion
98
85
  //#region src/extensions/horizontal-rule/horizontal-rule.d.ts
99
- declare const HorizontalRuleExtension: _tiptap_core0.Node<_tiptap_extension_horizontal_rule0.HorizontalRuleOptions, any>;
86
+ declare const HorizontalRuleExtension: import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>;
100
87
  //#endregion
101
- //#region src/extensions/html-code-block/html-code-block.d.ts
102
- declare module '@tiptap/core' {
103
- interface Commands<ReturnType> {
104
- htmlCodeBlock: {
105
- setHtmlCodeBlock: (attributes?: {
106
- language: string;
107
- }) => ReturnType;
108
- updateHtmlCodeBlock: (attrs: Partial<HtmlCodeBlockAttributes>) => ReturnType;
109
- };
110
- }
111
- }
112
- declare const HtmlCodeBlockExtension: _tiptap_core0.Node<_tiptap_extension_code_block_lowlight0.CodeBlockLowlightOptions, any>;
88
+ //#region src/extensions/image/image.d.ts
89
+ declare const ImageExtension: import("@tiptap/core").Node<import("@tiptap/extension-image").ImageOptions, any>;
113
90
  //#endregion
114
91
  //#region src/extensions/image-upload/image-upload.d.ts
115
92
  declare const IMAGE_UPLOAD_STATUSES: {
@@ -127,6 +104,7 @@ declare module '@tiptap/core' {
127
104
  imageUpload: ImageUploadStorage;
128
105
  }
129
106
  }
107
+ declare const ALLOWED_IMAGE_MIME_TYPES: readonly ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/svg+xml'];
130
108
  type ImageUploadContext = {
131
109
  position: number;
132
110
  removeImage: () => void;
@@ -137,31 +115,9 @@ type ImageUploadOptions = {
137
115
  };
138
116
  declare const ImageUploadExtension: Extension<ImageUploadOptions, ImageUploadStorage>;
139
117
  //#endregion
140
- //#region src/extensions/inline-image/inline-image.d.ts
141
- type InlineImageAttributes = {
142
- src: string;
143
- alt: string | null;
144
- title: string | null;
145
- width: number;
146
- height: number;
147
- externalLink: string | null;
148
- };
149
- type InlineImageOptions = {
150
- HTMLAttributes: Record<string, any>;
151
- };
152
- declare module '@tiptap/core' {
153
- interface Commands<ReturnType> {
154
- inlineImage: {
155
- setInlineImage: (attrs: Partial<InlineImageAttributes>) => ReturnType;
156
- updateInlineImageAttributes: (attrs: Partial<InlineImageAttributes>) => ReturnType;
157
- };
158
- }
159
- }
160
- declare const InlineImageExtension: Node<InlineImageOptions, any>;
161
- //#endregion
162
118
  //#region src/extensions/link-card/link-card.d.ts
163
119
  type LinkCardOptions = {
164
- HTMLAttributes: Record<string, any>;
120
+ HTMLAttributes: Record<string, unknown>;
165
121
  };
166
122
  declare module '@tiptap/core' {
167
123
  interface Commands<ReturnType> {
@@ -173,27 +129,43 @@ declare module '@tiptap/core' {
173
129
  }
174
130
  declare const LinkCardExtension: Node<LinkCardOptions, any>;
175
131
  //#endregion
176
- //#region src/extensions/repeat/repeat.d.ts
177
- type RepeatOptions = {
178
- HTMLAttributes: Record<string, any>;
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>;
179
154
  };
180
155
  declare module '@tiptap/core' {
181
156
  interface Commands<ReturnType> {
182
- repeat: {
183
- setRepeat: (attrs?: Partial<RepeatAttributes>) => ReturnType;
184
- updateRepeat: (attrs: Partial<RepeatAttributes>) => ReturnType;
157
+ inlineImage: {
158
+ setInlineImage: (attrs: Partial<InlineImageAttributes>) => ReturnType;
159
+ updateInlineImageAttributes: (attrs: Partial<InlineImageAttributes>) => ReturnType;
185
160
  };
186
161
  }
187
162
  }
188
- declare const RepeatExtension: Node<RepeatOptions, any>;
163
+ declare const InlineImageExtension: Node<InlineImageOptions, any>;
189
164
  //#endregion
190
- //#region src/extensions/resizable-image/resizable-image.d.ts
191
- declare const ResizableImageExtension: _tiptap_core0.Node<ImageOptions, any>;
165
+ //#region src/extensions/inline-span/inline-span.d.ts
166
+ declare const InlineSpanExtension: Node<any, any>;
192
167
  //#endregion
193
168
  //#region src/extensions/section/section.d.ts
194
- type SectionOptions = {
195
- HTMLAttributes: Record<string, any>;
196
- };
197
169
  declare module '@tiptap/core' {
198
170
  interface Commands<ReturnType> {
199
171
  section: {
@@ -202,178 +174,109 @@ declare module '@tiptap/core' {
202
174
  };
203
175
  }
204
176
  }
205
- declare const SectionExtension: Node<SectionOptions, any>;
177
+ declare const SectionExtension: Node<any, any>;
206
178
  //#endregion
207
179
  //#region src/extensions/slash-command/slash-command.d.ts
180
+ type SlashCommandStorage = {
181
+ commands: SlashCommandGroupItem[];
182
+ };
208
183
  declare module '@tiptap/core' {
209
184
  interface Storage {
210
185
  slashCommand: SlashCommandStorage;
211
186
  }
212
187
  }
213
- type SlashCommandStorage = {
214
- commands: SlashCommandGroupItem[];
215
- };
216
188
  type SlashCommandOptions = {
217
- suggestion: Omit<SuggestionOptions, 'editor'>;
218
189
  commands: SlashCommandGroupItem[];
190
+ suggestion: Omit<SuggestionOptions, 'editor'>;
219
191
  };
220
192
  declare const SlashCommandExtension: Extension<SlashCommandOptions, SlashCommandStorage>;
221
193
  //#endregion
194
+ //#region src/extensions/slash-command/default-slash-commands.d.ts
195
+ declare const DEFAULT_SLASH_COMMANDS: SlashCommandGroupItem[];
196
+ //#endregion
222
197
  //#region src/extensions/spacer/spacer.d.ts
223
198
  type SpacerOptions = {
224
- HTMLAttributes: Record<string, any>;
199
+ HTMLAttributes: Record<string, unknown>;
225
200
  };
226
201
  declare module '@tiptap/core' {
227
202
  interface Commands<ReturnType> {
228
203
  spacer: {
229
204
  setSpacer: (attrs?: Partial<SpacerAttributes>) => ReturnType;
230
- updateSpacerAttributes: (attrs: Partial<SpacerAttributes>) => ReturnType;
231
205
  unsetSpacer: () => ReturnType;
206
+ updateSpacerAttributes: (attrs: Partial<SpacerAttributes>) => ReturnType;
232
207
  };
233
208
  }
234
209
  }
235
210
  declare const SpacerExtension: Node<SpacerOptions, any>;
236
211
  //#endregion
237
- //#region src/extensions/variable/variable.d.ts
238
- type CoreVariableOptions = VariableOptions & {
239
- variables?: Variables;
240
- };
241
- type CoreVariableStorage = {
242
- variables?: Variables;
243
- };
244
- declare module '@tiptap/core' {
245
- interface Storage {
246
- variable: CoreVariableStorage;
247
- }
248
- }
249
- declare const VariableExtension: _tiptap_core0.Node<CoreVariableOptions, CoreVariableStorage>;
212
+ //#region src/extensions/span/span.d.ts
213
+ declare const SpanExtension: Mark<any, any>;
250
214
  //#endregion
251
- //#region src/extensions/visibility/visibility.d.ts
252
- type VisibilityAttributes = {
253
- visibilityRule: VisibilityRule | null;
254
- };
255
- type VisibilityOptions = {
256
- types: string[];
257
- };
215
+ //#region src/extensions/style/style.d.ts
216
+ declare const STYLE_SUPPORTED_TYPES: string[];
258
217
  declare module '@tiptap/core' {
259
218
  interface Commands<ReturnType> {
260
- visibility: {
261
- setVisibility: (attrs: Partial<VisibilityAttributes>) => ReturnType;
262
- unsetVisibility: () => ReturnType;
219
+ style: {
220
+ updateNodeStyle: (typeOrName: string, declarations: InlineStyle | Record<string, string | null | undefined>) => ReturnType;
263
221
  };
264
222
  }
265
223
  }
266
- declare const VisibilityExtension: Extension<VisibilityOptions, any>;
224
+ type StyleOptions = {
225
+ fontFamilies: FontFamilyItem[];
226
+ markTypes: string[];
227
+ types: string[];
228
+ };
229
+ declare const StyleExtension: Extension<StyleOptions, any>;
267
230
  //#endregion
268
- //#region ../extension-ai-actions/dist/index.d.mts
231
+ //#region src/extensions/html-code-block/html-code-block.d.ts
269
232
  declare module '@tiptap/core' {
270
233
  interface Commands<ReturnType> {
271
- aiActions: {
272
- /**
273
- * Run a named AI action on the current text selection.
274
- * The action string is forwarded to the user-provided `transform`
275
- * callback so it can decide which prompt / model to use.
276
- */
277
- runAIAction: (action: string) => ReturnType; /** Abort any in-flight AI action and reset loading state. */
278
- cancelAIAction: () => ReturnType;
234
+ htmlCodeBlock: {
235
+ setHtmlCodeBlock: (attrs?: {
236
+ language: string;
237
+ }) => ReturnType;
238
+ updateHtmlCodeBlock: (attrs: Partial<HtmlCodeBlockAttributes>) => ReturnType;
279
239
  };
280
240
  }
281
241
  }
282
- type AIActionsTransformParams = {
283
- /** The plain-text content of the current selection. */text: string; /** The action identifier passed to `runAIAction`. */
284
- action: string;
285
- };
286
- type AIActionsTransformContext = {
287
- /** Abort signal — cancelled when `cancelAIAction` is called. */signal: AbortSignal; /** The Tiptap editor instance. */
288
- editor: Editor;
289
- /**
290
- * Streaming callback — call with the **full accumulated text so far**
291
- * to progressively replace the original selection. Each call replaces
292
- * the entire range, so always pass the complete text, not a delta.
293
- */
294
- write: (text: string) => void;
295
- };
296
- type AIActionsOptions = {
297
- /**
298
- * Transform the selected text using an AI action.
299
- *
300
- * @param params - the selected text and action name
301
- * @param ctx - context with editor instance, abort signal, and
302
- * streaming `write` callback
303
- *
304
- * **Return value:**
305
- * - Return a `string` to replace the selection in one shot.
306
- * - Return `void` / `undefined` if you used `write()` for streaming
307
- * (the last `write()` value is used as the final text).
308
- */
309
- transform: (params: AIActionsTransformParams, ctx: AIActionsTransformContext) => Promise<string | void>;
310
- };
311
- type AIActionsStorage = {
312
- /** `true` while an AI action is in flight. */isLoading: boolean; /** The name of the currently running action, or `null`. */
313
- activeAction: string | null;
314
- };
315
- declare module '@tiptap/core' {
316
- interface ExtensionStorage {
317
- aiActions: AIActionsStorage;
318
- }
319
- }
320
- declare const AIActions: Extension<AIActionsOptions, AIActionsStorage>; //#endregion
242
+ declare const HtmlCodeBlockExtension: import("@tiptap/core").Node<import("@tiptap/extension-code-block-lowlight").CodeBlockLowlightOptions, any>;
321
243
  //#endregion
322
- //#region ../extension-inline-suggestion/dist/index.d.mts
323
- //#region src/inline-suggestion.d.ts
244
+ //#region src/extensions/theme/theme.d.ts
245
+ type ShellThemeUpdate = Pick<NodeThemeUpdate, ShellType>;
324
246
  declare module '@tiptap/core' {
325
247
  interface Commands<ReturnType> {
326
- inlineSuggestion: {
327
- /** Debounce-fetch a suggestion for the current node's text. */fetchSuggestion: () => ReturnType; /** Accept and insert the current suggestion into the document. */
328
- insertSuggestion: () => ReturnType; /** Dismiss the current suggestion without inserting it. */
329
- dismissSuggestion: () => ReturnType;
248
+ theme: {
249
+ setNodeTheme: (theme: NodeThemeOptions) => ReturnType;
250
+ updateNodeTheme: (theme: NodeThemeUpdate) => ReturnType;
251
+ updateShellTheme: (theme: ShellThemeUpdate) => ReturnType;
330
252
  };
331
253
  }
332
254
  }
333
- declare const inlineSuggestionPluginKey: PluginKey;
334
- type SuggestContext = {
335
- /** The Tiptap editor instance. */editor: Editor; /** Abort signal — cancelled when a newer request supersedes this one. */
336
- signal: AbortSignal;
255
+ type ThemeExtensionOptions = {
256
+ theme: NodeThemeOptions;
337
257
  };
338
- type InlineSuggestionOptions = {
339
- /**
340
- * Fetch inline suggestions.
341
- *
342
- * @param text - existing text in the current node
343
- * @param ctx - context with editor instance and abort signal
344
- * @returns the suggestion string to show
345
- */
346
- suggest: (text: string, ctx: SuggestContext) => Promise<string>;
347
- /**
348
- * Debounce time for fetching suggestions in milliseconds.
349
- * @default 250
350
- */
351
- debounceTime?: number;
352
- /**
353
- * Key that triggers fetching a suggestion.
354
- * Set to null to disable key-based triggering (use fetchSuggestion command manually).
355
- * @default " " (space)
356
- */
357
- triggerKey?: string | null;
358
- /**
359
- * Key that accepts/inserts the current suggestion.
360
- * @default "Tab"
361
- */
362
- acceptKey?: string;
363
- };
364
- type InlineSuggestionStorage = {
365
- /** The suggestion text currently shown as a ghost decoration. */currentSuggestion?: string; /** Node range (`from`/`to`) where the decoration is rendered. */
366
- nodeDetails?: {
367
- from: number;
368
- to: number;
369
- };
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[];
370
264
  };
371
265
  declare module '@tiptap/core' {
372
- interface ExtensionStorage {
373
- inlineSuggestion: InlineSuggestionStorage;
266
+ interface Commands<ReturnType> {
267
+ visibility: {
268
+ setVisibilityRule: (typeOrName: string, rule: VisibilityRule) => ReturnType;
269
+ unsetVisibilityRule: (typeOrName: string) => ReturnType;
270
+ };
374
271
  }
375
272
  }
376
- declare const InlineSuggestion: Extension<InlineSuggestionOptions, InlineSuggestionStorage>; //#endregion
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;
377
280
  //#endregion
378
- export { AIActions, type AIActionsOptions, type AIActionsStorage, type AIActionsTransformContext, type AIActionsTransformParams, BlockquoteExtension, ButtonExtension, ColumnExtension, ColumnsExtension, FontStyleExtension, FooterExtension, HorizontalRuleExtension, HtmlCodeBlockExtension, type ImageUploadContext, ImageUploadExtension, type ImageUploadOptions, InlineImageExtension, InlineSuggestion, type InlineSuggestionOptions, type InlineSuggestionStorage, LinkCardExtension, RepeatExtension, ResizableImageExtension, SectionExtension, SlashCommandExtension, SpacerExtension, VariableExtension, VisibilityExtension, inlineSuggestionPluginKey };
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 };
379
282
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":["Editor","Extension","AI_ACTIONS_PLUGIN_KEY","_0","ReturnType","Commands","aiActions","runAIAction","action","cancelAIAction","sideEffect","AIActionsTransformParams","text","AIActionsTransformContext","AbortSignal","signal","editor","write","AIActionsOptions","Promise","transform","params","ctx","AIActionsStorage","isLoading","activeAction","_1","ExtensionStorage","AIActions","Editor","Extension","PluginKey","_0","ReturnType","Commands","inlineSuggestion","fetchSuggestion","insertSuggestion","dismissSuggestion","sideEffect","inlineSuggestionPluginKey","SuggestContext","AbortSignal","editor","signal","InlineSuggestionOptions","Promise","suggest","text","ctx","debounceTime","triggerKey","acceptKey","InlineSuggestionStorage","currentSuggestion","nodeDetails","from","to","_1","ExtensionStorage","InlineSuggestion"],"sources":["../../src/extensions/blockquote/blockquote.ts","../../src/extensions/button/button.ts","../../src/extensions/columns/column.ts","../../src/extensions/columns/columns.ts","../../src/extensions/font-style/font-style.ts","../../src/extensions/footer/footer.ts","../../src/extensions/horizontal-rule/horizontal-rule.ts","../../src/extensions/html-code-block/html-code-block.ts","../../src/extensions/image-upload/image-upload.ts","../../src/extensions/inline-image/inline-image.ts","../../src/extensions/link-card/link-card.ts","../../src/extensions/repeat/repeat.ts","../../src/extensions/resizable-image/resizable-image.ts","../../src/extensions/section/section.ts","../../src/extensions/slash-command/slash-command.ts","../../src/extensions/spacer/spacer.ts","../../src/extensions/variable/variable.ts","../../src/extensions/visibility/visibility.ts","../../../extension-ai-actions/dist/index.d.mts","../../../extension-inline-suggestion/dist/index.d.mts"],"mappings":";;;;;;;;;;;;;cAIa,mBAAA,EAAmB,aAAA,CAAA,IAAA,CAc9B,6BAAA,CAd8B,iBAAA;;;KCuBpB,gBAAA;EACV,GAAA,EAAK,aAAA;EAEL,GAAA;EACA,IAAA,EAAM,iBAAA;EAEN,SAAA,EAAW,oBAAA;EAEX,eAAA;EACA,KAAA;EAEA,WAAA,EAAa,gBAAA;EACb,UAAA;EACA,YAAA;EACA,aAAA;EACA,WAAA;AAAA,IACE,iBAAA,GACF,mBAAA;AAAA;EAAA,UAGU,QAAA;IACR,MAAA;MACE,SAAA,GAAY,KAAA,GAAQ,OAAA,CAAQ,gBAAA,MAAsB,UAAA;MAClD,sBAAA,GAAyB,KAAA,EAAO,OAAA,CAAQ,gBAAA,MAAsB,UAAA;IAAA;EAAA;AAAA;AAAA,cAKvD,eAAA,EAAe,IAAA;;;KC7ChB,aAAA;EACV,cAAA,EAAgB,MAAA;AAAA;AAAA;EAAA,UAIN,QAAA;IACR,MAAA;MACE,YAAA,GAAe,KAAA,EAAO,OAAA,CAAQ,gBAAA,MAAsB,UAAA;IAAA;EAAA;AAAA;AAAA,cAK7C,eAAA,EAAe,IAAA,CAAA,aAAA;;;KCdhB,cAAA;EACV,cAAA,EAAgB,MAAA;AAAA;AAAA;EAAA,UAIN,QAAA;IACR,OAAA;MACE,UAAA,GAAa,WAAA,cAAyB,UAAA;MACtC,aAAA,GAAgB,KAAA,EAAO,OAAA,CAAQ,iBAAA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EGC,uBAAAA;ElBHH,iEkBIiEC,iBAAAA,WlBJjE;EkBKAC,WAAAA;IACEC,IAAAA;IACAC,EAAAA;EAAAA;AAAAA;AAAAA;EAAAA,UAIQE,gBAAAA;IACRxB,gBAAAA,EAAkBkB,uBAAAA;EAAAA;AAAAA;AAAAA,cAGRO,gBAAAA,EAAkB9B,SAAAA,CAAUe,uBAAAA,EAAyBQ,uBAAAA"}
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,gCA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