@maily-to/core 2.0.0-beta.1 → 2.0.0-beta.11
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/LICENSE +21 -0
- package/dist/blocks/index.cjs +8 -1
- package/dist/blocks/index.d.cts +1 -38
- package/dist/blocks/index.d.mts +14 -6
- package/dist/blocks/index.d.mts.map +1 -1
- package/dist/blocks/index.mjs +2 -2
- package/dist/extensions/index.cjs +266 -286
- package/dist/extensions/index.d.cts +1 -379
- package/dist/extensions/index.d.mts +127 -224
- package/dist/extensions/index.d.mts.map +1 -1
- package/dist/extensions/index.mjs +238 -271
- package/dist/index.cjs +8717 -11689
- package/dist/index.d.cts +1 -107
- package/dist/index.d.mts +711 -73
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +8397 -11474
- package/dist/{slash-command-BmWRVPbv.d.mts → slash-command-BrwA1bHs.d.mts} +10 -11
- package/dist/slash-command-BrwA1bHs.d.mts.map +1 -0
- package/dist/theme-D1CI7_8s.d.mts +70 -0
- package/dist/theme-D1CI7_8s.d.mts.map +1 -0
- package/dist/typography-BdOKvXfQ.mjs +911 -0
- package/dist/typography-D-VnwOSw.cjs +970 -0
- package/dist/typography-DW7VApAR.cjs +1072 -0
- package/dist/use-maily-editor-Atvy2kSO.cjs +3993 -0
- package/dist/use-maily-editor-CByaDhmT.cjs +4955 -0
- package/dist/use-maily-editor-idL0RNsG.mjs +4504 -0
- package/package.json +102 -90
- package/readme.md +177 -133
- package/src/styles/index.css +2537 -0
- package/dist/blocks/index.d.cts.map +0 -1
- package/dist/chunk-CfYAbeIz.mjs +0 -13
- package/dist/extensions/index.d.cts.map +0 -1
- package/dist/extensions/index.mjs.map +0 -1
- package/dist/index.css +0 -2312
- package/dist/index.d.cts.map +0 -1
- package/dist/index.mjs.map +0 -1
- package/dist/slash-command-BmWRVPbv.d.mts.map +0 -1
- package/dist/slash-command-CK0-1FwR.d.cts +0 -39
- package/dist/slash-command-CK0-1FwR.d.cts.map +0 -1
- package/dist/spacer-DBtsr3hu.cjs +0 -5768
- package/dist/spacer-DzZWX-wB.mjs +0 -5456
- package/dist/spacer-DzZWX-wB.mjs.map +0 -1
- package/dist/typography-CWL13acR.cjs +0 -400
- package/dist/typography-DhrUe809.mjs +0 -282
- package/dist/typography-DhrUe809.mjs.map +0 -1
- package/dist/variable-C9S9ZoHv.d.cts +0 -108
- package/dist/variable-C9S9ZoHv.d.cts.map +0 -1
- package/dist/variable-DVwGrg2a.d.mts +0 -108
- package/dist/variable-DVwGrg2a.d.mts.map +0 -1
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
import { t as SlashCommandGroupItem } from "../slash-command-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
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
|
|
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:
|
|
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
|
|
18
|
-
|
|
19
|
-
|
|
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<
|
|
30
|
+
declare const ButtonExtension: Node<ButtonOptions, any>;
|
|
39
31
|
//#endregion
|
|
40
|
-
//#region src/extensions/
|
|
41
|
-
type
|
|
42
|
-
|
|
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<
|
|
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<
|
|
66
|
+
declare const ColumnsExtension: Node<any, any>;
|
|
68
67
|
//#endregion
|
|
69
|
-
//#region src/extensions/
|
|
70
|
-
|
|
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,
|
|
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:
|
|
86
|
+
declare const HorizontalRuleExtension: import("@tiptap/core").Node<import("@tiptap/extension-horizontal-rule").HorizontalRuleOptions, any>;
|
|
100
87
|
//#endregion
|
|
101
|
-
//#region src/extensions/
|
|
102
|
-
declare
|
|
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,
|
|
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/
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
183
|
-
|
|
184
|
-
|
|
157
|
+
inlineImage: {
|
|
158
|
+
setInlineImage: (attrs: Partial<InlineImageAttributes>) => ReturnType;
|
|
159
|
+
updateInlineImageAttributes: (attrs: Partial<InlineImageAttributes>) => ReturnType;
|
|
185
160
|
};
|
|
186
161
|
}
|
|
187
162
|
}
|
|
188
|
-
declare const
|
|
163
|
+
declare const InlineImageExtension: Node<InlineImageOptions, any>;
|
|
189
164
|
//#endregion
|
|
190
|
-
//#region src/extensions/
|
|
191
|
-
declare const
|
|
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<
|
|
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,
|
|
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/
|
|
238
|
-
|
|
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/
|
|
252
|
-
|
|
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
|
-
|
|
261
|
-
|
|
262
|
-
unsetVisibility: () => ReturnType;
|
|
219
|
+
style: {
|
|
220
|
+
updateNodeStyle: (typeOrName: string, declarations: InlineStyle | Record<string, string | null | undefined>) => ReturnType;
|
|
263
221
|
};
|
|
264
222
|
}
|
|
265
223
|
}
|
|
266
|
-
|
|
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
|
|
231
|
+
//#region src/extensions/html-code-block/html-code-block.d.ts
|
|
269
232
|
declare module '@tiptap/core' {
|
|
270
233
|
interface Commands<ReturnType> {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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
|
-
|
|
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
|
|
323
|
-
|
|
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
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
248
|
+
theme: {
|
|
249
|
+
setNodeTheme: (theme: NodeThemeOptions) => ReturnType;
|
|
250
|
+
updateNodeTheme: (theme: NodeThemeUpdate) => ReturnType;
|
|
251
|
+
updateShellTheme: (theme: ShellThemeUpdate) => ReturnType;
|
|
330
252
|
};
|
|
331
253
|
}
|
|
332
254
|
}
|
|
333
|
-
|
|
334
|
-
|
|
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
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
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
|
|
373
|
-
|
|
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
|
|
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 {
|
|
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":[
|
|
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,iDAAA;;;cCavB,uCAAc,uCAAA;;;cCTd;WACX;WACA;WACA;WACA;;KAGU,4BACF,oCAAoC;KAElC;EACV,SAAS,YAAY;;;YAIX;IACR,aAAa;;;cAIJ;KAQD;EACV;EACA;;KAGU;EACV,iBAAiB,MAAM,MAAM,SAAS,uBAAuB;EAC7D,sBACE,gBACA,MAAM,MACN,SAAS;;cAIA,sBAAoB,UAAA,oBAAA;;;KC1CrB;EACV,gBAAgB;;;YAIN,SAAS;IACjB;MACE,cAAc,QAAQ,QAAQ,wBAAwB;MACtD,2BACE,OAAO,QAAQ,wBACZ;;;;cAKE,mBAAiB,KAAA;;;cCbjB,wBAAsB;;;KCC9B,sBAAsB;EACzB;EACA,YAAY;;KAGT;EACH;EACA,YAAY;;;YAIF;IACR,UAAU;;;cAID,0CAAiB,KAAA,qBAAA;;;KCpBlB;EACV,gBAAgB;;;YAIN,SAAS;IACjB;MACE,iBAAiB,OAAO,QAAQ,2BAA2B;MAC3D,8BACE,OAAO,QAAQ,2BACZ;;;;cAOE,sBAAoB,KAAA;;;cCpBpB,qBAAmB;;;;YCIpB,SAAS;IACjB;MACE,kBAAkB;MAClB,gBAAgB,OAAO,QAAQ,uBAAuB;;;;cAK/C,kBAAgB;;;KCNxB;EACH,UAAU;;;YAIA;IACR,cAAc;;;KAIN;EACV,UAAU;EACV,YAAY,KAAK;;cAGN,uBAAqB,UAAA,qBAAA;;;cCYrB,wBAAwB;;;KC3BzB;EACV,gBAAgB;;;YAIN,SAAS;IACjB;MACE,YAAY,QAAQ,QAAQ,sBAAsB;MAClD,mBAAmB;MACnB,yBAAyB,OAAO,QAAQ,sBAAsB;;;;cAKvD,iBAAe,KAAA;;;cClBf,eAAa;;;cCoBb;;YAiCD,SAAS;IACjB;MACE,kBACE,oBACA,cAAc,cAAc,8CACzB;;;;KAKC;EACV,cAAc;EACd;EACA;;cAcW,gBAAc,UAAA;;;;YCnEf,SAAS;IACjB;MACE,mBAAmB;QAAU;YAAuB;MACpD,sBACE,OAAO,QAAQ,6BACZ;;;;cAKE,+CAAsB,qDAAA;;;KClBvB,mBAAmB,KAAK,iBAAiB;;YAGzC,SAAS;IACjB;MACE,eAAe,OAAO,qBAAqB;MAC3C,kBAAkB,OAAO,oBAAoB;MAC7C,mBAAmB,OAAO,qBAAqB;;;;KAKzC;EACV,OAAO;;cAqBI,gBAAc,UAAA;;;cCnCd;KAgBD;EACV;;;YAIU,SAAS;IACjB;MACE,oBACE,oBACA,MAAM,mBACH;MACL,sBAAsB,uBAAuB;;;;cAmBtC,qBAAmB,UAAA;;;cCanB,oBAAoB;;;iBCkQjB,kBAAkB"}
|