@maily-to/core 0.3.6 → 2.0.0-beta.1
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/dist/blocks/index.cjs +22 -305
- package/dist/blocks/index.d.cts +38 -59
- package/dist/blocks/index.d.cts.map +1 -0
- package/dist/blocks/index.d.mts +38 -0
- package/dist/blocks/index.d.mts.map +1 -0
- package/dist/blocks/index.mjs +2 -273
- package/dist/chunk-CfYAbeIz.mjs +13 -0
- package/dist/extensions/index.cjs +375 -9101
- package/dist/extensions/index.d.cts +337 -406
- package/dist/extensions/index.d.cts.map +1 -0
- package/dist/extensions/index.d.mts +379 -0
- package/dist/extensions/index.d.mts.map +1 -0
- package/dist/extensions/index.mjs +353 -9050
- package/dist/extensions/index.mjs.map +1 -1
- package/dist/index.cjs +13117 -12141
- package/dist/index.css +1301 -1479
- package/dist/index.d.cts +103 -59
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +105 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +13098 -12191
- package/dist/index.mjs.map +1 -1
- package/dist/slash-command-BmWRVPbv.d.mts +39 -0
- package/dist/slash-command-BmWRVPbv.d.mts.map +1 -0
- package/dist/slash-command-CK0-1FwR.d.cts +39 -0
- package/dist/slash-command-CK0-1FwR.d.cts.map +1 -0
- package/dist/spacer-DBtsr3hu.cjs +5768 -0
- package/dist/spacer-DzZWX-wB.mjs +5456 -0
- package/dist/spacer-DzZWX-wB.mjs.map +1 -0
- package/dist/typography-CWL13acR.cjs +400 -0
- package/dist/typography-DhrUe809.mjs +282 -0
- package/dist/typography-DhrUe809.mjs.map +1 -0
- package/dist/variable-C9S9ZoHv.d.cts +108 -0
- package/dist/variable-C9S9ZoHv.d.cts.map +1 -0
- package/dist/variable-DVwGrg2a.d.mts +108 -0
- package/dist/variable-DVwGrg2a.d.mts.map +1 -0
- package/package.json +95 -172
- package/readme.md +298 -181
- package/dist/blocks/index.cjs.map +0 -1
- package/dist/blocks/index.d.ts +0 -59
- package/dist/blocks/index.mjs.map +0 -1
- package/dist/extensions/index.cjs.map +0 -1
- package/dist/extensions/index.d.ts +0 -448
- package/dist/index.cjs.map +0 -1
- package/dist/index.css.map +0 -1
- package/dist/index.d.ts +0 -63
|
@@ -1,448 +1,379 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import * as
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { Node as Node$1 } from '@tiptap/pm/model';
|
|
13
|
-
import * as react from 'react';
|
|
14
|
-
import * as _tiptap_extension_code_block_lowlight from '@tiptap/extension-code-block-lowlight';
|
|
15
|
-
|
|
16
|
-
type ColorStorage = {
|
|
17
|
-
/**
|
|
18
|
-
* Last 5 used colors
|
|
19
|
-
*/
|
|
20
|
-
colors: Set<string>;
|
|
21
|
-
};
|
|
22
|
-
declare const Color: _tiptap_core.Extension<ColorOptions, ColorStorage>;
|
|
23
|
-
|
|
24
|
-
declare const HorizontalRule: _tiptap_core.Node<_tiptap_extension_horizontal_rule.HorizontalRuleOptions, any>;
|
|
25
|
-
|
|
26
|
-
type ImageUploadPluginOptions = {
|
|
27
|
-
editor: Editor;
|
|
28
|
-
/**
|
|
29
|
-
* Allows you to define a list of allowed mime types for dropped or pasted images.
|
|
30
|
-
* @default ['image/jpeg', 'image/png', 'image/gif', 'image/webp', 'image/svg+xml']
|
|
31
|
-
*/
|
|
32
|
-
allowedMimeTypes?: string[];
|
|
33
|
-
/**
|
|
34
|
-
* The onImageUpload callback that is called when an image is dropped or pasted.
|
|
35
|
-
* @param file the image file
|
|
36
|
-
* @returns Returns the image URL as a string.
|
|
37
|
-
*/
|
|
38
|
-
onImageUpload?: (file: Blob) => Promise<string>;
|
|
39
|
-
};
|
|
40
|
-
declare function ImageUploadPlugin(options: ImageUploadPluginOptions): Plugin<any>;
|
|
41
|
-
|
|
42
|
-
type ImageUploadOptions = Omit<ImageUploadPluginOptions, 'editor'> & {};
|
|
43
|
-
type ImageUploadStorage = {
|
|
44
|
-
placeholderImages: Set<string>;
|
|
45
|
-
};
|
|
46
|
-
declare const ImageUploadExtension: Extension<Omit<ImageUploadPluginOptions, "editor">, any>;
|
|
47
|
-
declare function useImageUploadOptions(editor: Editor): ImageUploadOptions;
|
|
1
|
+
import { t as SlashCommandGroupItem } from "../slash-command-CK0-1FwR.cjs";
|
|
2
|
+
import { o as VariableOptions, r as Variables } from "../variable-C9S9ZoHv.cjs";
|
|
3
|
+
import * as _tiptap_core0 from "@tiptap/core";
|
|
4
|
+
import { Editor, Extension, Node } from "@tiptap/core";
|
|
5
|
+
import * as _tiptap_extension_blockquote0 from "@tiptap/extension-blockquote";
|
|
6
|
+
import { AllowedButtonKind, AllowedFieldMode, AllowedTextAlignment, BorderStyleConfig, ColumnAttributes, ColumnsAttributes, FontFamilyItem, FontStyleAttributes, FooterAttributes, HtmlCodeBlockAttributes, LinkCardAttributes, RepeatAttributes, SectionAttributes, SpacerAttributes, TextDirection, VisibilityRule } from "@maily-to/shared";
|
|
7
|
+
import * as _tiptap_extension_horizontal_rule0 from "@tiptap/extension-horizontal-rule";
|
|
8
|
+
import * as _tiptap_extension_code_block_lowlight0 from "@tiptap/extension-code-block-lowlight";
|
|
9
|
+
import { ImageOptions } from "@tiptap/extension-image";
|
|
10
|
+
import { SuggestionOptions } from "@tiptap/suggestion";
|
|
11
|
+
import { PluginKey } from "@tiptap/pm/state";
|
|
48
12
|
|
|
13
|
+
//#region src/extensions/blockquote/blockquote.d.ts
|
|
14
|
+
declare const BlockquoteExtension: _tiptap_core0.Node<_tiptap_extension_blockquote0.BlockquoteOptions, any>;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#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;
|
|
49
30
|
declare module '@tiptap/core' {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
31
|
+
interface Commands<ReturnType> {
|
|
32
|
+
button: {
|
|
33
|
+
setButton: (attrs?: Partial<ButtonAttributes>) => ReturnType;
|
|
34
|
+
updateButtonAttributes: (attrs: Partial<ButtonAttributes>) => ReturnType;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
55
37
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
section?: Partial<{}> | false;
|
|
62
|
-
columns?: Partial<{}> | false;
|
|
63
|
-
column?: Partial<{}> | false;
|
|
64
|
-
button?: Partial<{}> | false;
|
|
65
|
-
spacer?: Partial<{}> | false;
|
|
66
|
-
logo?: Partial<{}> | false;
|
|
67
|
-
image?: Partial<{}> | false;
|
|
68
|
-
link?: Partial<LinkOptions> | false;
|
|
69
|
-
};
|
|
70
|
-
declare const MailyKit: Extension<MailyKitOptions, any>;
|
|
71
|
-
|
|
72
|
-
declare const PlaceholderExtension: _tiptap_core.Extension<_tiptap_extension_placeholder.PlaceholderOptions, any>;
|
|
73
|
-
|
|
74
|
-
type SlashCommandOptions = {
|
|
75
|
-
suggestion: Omit<SuggestionOptions, 'editor'>;
|
|
38
|
+
declare const ButtonExtension: Node<any, any>;
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/extensions/columns/column.d.ts
|
|
41
|
+
type ColumnOptions = {
|
|
42
|
+
HTMLAttributes: Record<string, any>;
|
|
76
43
|
};
|
|
77
|
-
declare
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
44
|
+
declare module '@tiptap/core' {
|
|
45
|
+
interface Commands<ReturnType> {
|
|
46
|
+
column: {
|
|
47
|
+
updateColumn: (attrs: Partial<ColumnAttributes>) => ReturnType;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
82
50
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
render?: (editor: Editor) => JSX.Element | null | true;
|
|
89
|
-
preview?: string | ((editor: Editor) => JSX.Element | null);
|
|
90
|
-
} & ({
|
|
91
|
-
command: (options: CommandProps) => void;
|
|
92
|
-
id?: never;
|
|
93
|
-
commands?: never;
|
|
94
|
-
} | {
|
|
95
|
-
/**
|
|
96
|
-
* id to be used for the slash command query
|
|
97
|
-
* `headers.` will go inside the header subcommand
|
|
98
|
-
*/
|
|
99
|
-
id: string;
|
|
100
|
-
command?: never;
|
|
101
|
-
commands: BlockItem[];
|
|
102
|
-
});
|
|
103
|
-
type BlockGroupItem = {
|
|
104
|
-
title: string;
|
|
105
|
-
commands: BlockItem[];
|
|
51
|
+
declare const ColumnExtension: Node<ColumnOptions, any>;
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/extensions/columns/columns.d.ts
|
|
54
|
+
type ColumnsOptions = {
|
|
55
|
+
HTMLAttributes: Record<string, any>;
|
|
106
56
|
};
|
|
107
|
-
|
|
108
|
-
declare function getSlashCommandSuggestions(groups?: BlockGroupItem[]): Omit<SuggestionOptions, 'editor'>;
|
|
109
|
-
|
|
110
|
-
declare const allowedLogoSize: readonly ["sm", "md", "lg"];
|
|
111
|
-
type AllowedLogoSize = (typeof allowedLogoSize)[number];
|
|
112
|
-
declare const allowedLogoAlignment: readonly ["left", "center", "right"];
|
|
113
|
-
type AllowedLogoAlignment = (typeof allowedLogoAlignment)[number];
|
|
114
|
-
interface LogoOptions {
|
|
115
|
-
src: string;
|
|
116
|
-
alt?: string;
|
|
117
|
-
title?: string;
|
|
118
|
-
size?: AllowedLogoSize;
|
|
119
|
-
alignment?: AllowedLogoAlignment;
|
|
120
|
-
}
|
|
121
|
-
interface LogoAttributes {
|
|
122
|
-
src?: string;
|
|
123
|
-
size?: AllowedLogoSize;
|
|
124
|
-
alignment?: AllowedLogoAlignment;
|
|
125
|
-
showIfKey: string;
|
|
126
|
-
isSrcVariable?: boolean;
|
|
127
|
-
}
|
|
128
57
|
declare module '@tiptap/core' {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
58
|
+
interface Commands<ReturnType> {
|
|
59
|
+
columns: {
|
|
60
|
+
setColumns: (columnCount?: number) => ReturnType;
|
|
61
|
+
updateColumns: (attrs: Partial<ColumnsAttributes>) => ReturnType;
|
|
62
|
+
addColumn: () => ReturnType;
|
|
63
|
+
removeColumn: () => ReturnType;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
135
66
|
}
|
|
136
|
-
declare const
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
declare const DEFAULT_BUTTON_BORDER_RADIUS: AllowedButtonBorderRadius;
|
|
143
|
-
declare const DEFAULT_BUTTON_BACKGROUND_COLOR: null;
|
|
144
|
-
declare const DEFAULT_BUTTON_TEXT_COLOR: null;
|
|
145
|
-
declare const DEFAULT_BUTTON_PADDING_TOP: null;
|
|
146
|
-
declare const DEFAULT_BUTTON_PADDING_RIGHT: null;
|
|
147
|
-
declare const DEFAULT_BUTTON_PADDING_BOTTOM: null;
|
|
148
|
-
declare const DEFAULT_BUTTON_PADDING_LEFT: null;
|
|
149
|
-
declare const allowedButtonVariant: readonly ["filled", "outline"];
|
|
150
|
-
type AllowedButtonVariant = (typeof allowedButtonVariant)[number];
|
|
151
|
-
declare const allowedButtonBorderRadius: readonly ["sharp", "smooth", "round"];
|
|
152
|
-
type AllowedButtonBorderRadius = (typeof allowedButtonBorderRadius)[number];
|
|
153
|
-
type ButtonAttributes = {
|
|
154
|
-
text: string;
|
|
155
|
-
isTextVariable: boolean;
|
|
156
|
-
url: string;
|
|
157
|
-
isUrlVariable: boolean;
|
|
158
|
-
alignment: AllowedLogoAlignment;
|
|
159
|
-
variant: AllowedButtonVariant;
|
|
160
|
-
borderRadius: AllowedButtonBorderRadius;
|
|
161
|
-
buttonColor: string;
|
|
162
|
-
textColor: string;
|
|
163
|
-
showIfKey: string;
|
|
164
|
-
paddingTop: number;
|
|
165
|
-
paddingRight: number;
|
|
166
|
-
paddingBottom: number;
|
|
167
|
-
paddingLeft: number;
|
|
67
|
+
declare const ColumnsExtension: Node<ColumnsOptions, any>;
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/extensions/font-style/font-style.d.ts
|
|
70
|
+
type FontStyleOptions = {
|
|
71
|
+
types: string[];
|
|
72
|
+
fontFamilies: FontFamilyItem[];
|
|
168
73
|
};
|
|
169
74
|
declare module '@tiptap/core' {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
75
|
+
interface Commands<ReturnType> {
|
|
76
|
+
fontStyle: {
|
|
77
|
+
setFontStyle: (attrs: Partial<FontStyleAttributes>) => ReturnType;
|
|
78
|
+
unsetFontStyle: () => ReturnType;
|
|
79
|
+
};
|
|
80
|
+
}
|
|
176
81
|
}
|
|
177
|
-
declare const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
type
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
paddingRight: number;
|
|
191
|
-
paddingBottom: number;
|
|
192
|
-
paddingLeft: number;
|
|
193
|
-
showIfKey: string;
|
|
82
|
+
declare const FontStyleExtension: Extension<FontStyleOptions, any>;
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/extensions/footer/footer.d.ts
|
|
85
|
+
type FooterOptions = {
|
|
86
|
+
HTMLAttributes: Record<string, any>;
|
|
87
|
+
};
|
|
88
|
+
declare module '@tiptap/core' {
|
|
89
|
+
interface Commands<ReturnType> {
|
|
90
|
+
footer: {
|
|
91
|
+
setFooter: () => ReturnType;
|
|
92
|
+
updateFooterAttributes: (attrs: Partial<FooterAttributes>) => ReturnType;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
194
95
|
}
|
|
96
|
+
declare const FooterExtension: Node<FooterOptions, any>;
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/extensions/horizontal-rule/horizontal-rule.d.ts
|
|
99
|
+
declare const HorizontalRuleExtension: _tiptap_core0.Node<_tiptap_extension_horizontal_rule0.HorizontalRuleOptions, any>;
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region src/extensions/html-code-block/html-code-block.d.ts
|
|
195
102
|
declare module '@tiptap/core' {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
103
|
+
interface Commands<ReturnType> {
|
|
104
|
+
htmlCodeBlock: {
|
|
105
|
+
setHtmlCodeBlock: (attributes?: {
|
|
106
|
+
language: string;
|
|
107
|
+
}) => ReturnType;
|
|
108
|
+
updateHtmlCodeBlock: (attrs: Partial<HtmlCodeBlockAttributes>) => ReturnType;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
201
111
|
}
|
|
202
|
-
declare const
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
112
|
+
declare const HtmlCodeBlockExtension: _tiptap_core0.Node<_tiptap_extension_code_block_lowlight0.CodeBlockLowlightOptions, any>;
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/extensions/image-upload/image-upload.d.ts
|
|
115
|
+
declare const IMAGE_UPLOAD_STATUSES: {
|
|
116
|
+
readonly IDLE: 'idle';
|
|
117
|
+
readonly LOADING: 'loading';
|
|
118
|
+
readonly ERROR: 'error';
|
|
119
|
+
readonly LOADED: 'loaded';
|
|
120
|
+
};
|
|
121
|
+
type ImageUploadStatus = (typeof IMAGE_UPLOAD_STATUSES)[keyof typeof IMAGE_UPLOAD_STATUSES];
|
|
122
|
+
type ImageUploadStorage = {
|
|
123
|
+
uploads: Map<string, ImageUploadStatus>;
|
|
124
|
+
};
|
|
125
|
+
declare module '@tiptap/core' {
|
|
126
|
+
interface Storage {
|
|
127
|
+
imageUpload: ImageUploadStorage;
|
|
128
|
+
}
|
|
208
129
|
}
|
|
130
|
+
type ImageUploadContext = {
|
|
131
|
+
position: number;
|
|
132
|
+
removeImage: () => void;
|
|
133
|
+
};
|
|
134
|
+
type ImageUploadOptions = {
|
|
135
|
+
onImageUpload?: (file: File, context: ImageUploadContext) => Promise<string>;
|
|
136
|
+
onImageUploadError?: (error: unknown, file: File, context: ImageUploadContext) => void;
|
|
137
|
+
};
|
|
138
|
+
declare const ImageUploadExtension: Extension<ImageUploadOptions, ImageUploadStorage>;
|
|
139
|
+
//#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
|
+
};
|
|
209
152
|
declare module '@tiptap/core' {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
153
|
+
interface Commands<ReturnType> {
|
|
154
|
+
inlineImage: {
|
|
155
|
+
setInlineImage: (attrs: Partial<InlineImageAttributes>) => ReturnType;
|
|
156
|
+
updateInlineImageAttributes: (attrs: Partial<InlineImageAttributes>) => ReturnType;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
216
159
|
}
|
|
217
|
-
declare const
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
type
|
|
160
|
+
declare const InlineImageExtension: Node<InlineImageOptions, any>;
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/extensions/link-card/link-card.d.ts
|
|
163
|
+
type LinkCardOptions = {
|
|
164
|
+
HTMLAttributes: Record<string, any>;
|
|
165
|
+
};
|
|
221
166
|
declare module '@tiptap/core' {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
}
|
|
167
|
+
interface Commands<ReturnType> {
|
|
168
|
+
linkCard: {
|
|
169
|
+
setLinkCard: (attrs?: Partial<LinkCardAttributes>) => ReturnType;
|
|
170
|
+
updateLinkCardAttributes: (attrs: Partial<LinkCardAttributes>) => ReturnType;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
227
173
|
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
174
|
+
declare const LinkCardExtension: Node<LinkCardOptions, any>;
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/extensions/repeat/repeat.d.ts
|
|
177
|
+
type RepeatOptions = {
|
|
178
|
+
HTMLAttributes: Record<string, any>;
|
|
179
|
+
};
|
|
180
|
+
declare module '@tiptap/core' {
|
|
181
|
+
interface Commands<ReturnType> {
|
|
182
|
+
repeat: {
|
|
183
|
+
setRepeat: (attrs?: Partial<RepeatAttributes>) => ReturnType;
|
|
184
|
+
updateRepeat: (attrs: Partial<RepeatAttributes>) => ReturnType;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
231
187
|
}
|
|
188
|
+
declare const RepeatExtension: Node<RepeatOptions, any>;
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/extensions/resizable-image/resizable-image.d.ts
|
|
191
|
+
declare const ResizableImageExtension: _tiptap_core0.Node<ImageOptions, any>;
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/extensions/section/section.d.ts
|
|
194
|
+
type SectionOptions = {
|
|
195
|
+
HTMLAttributes: Record<string, any>;
|
|
196
|
+
};
|
|
232
197
|
declare module '@tiptap/core' {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
198
|
+
interface Commands<ReturnType> {
|
|
199
|
+
section: {
|
|
200
|
+
setSection: () => ReturnType;
|
|
201
|
+
updateSection: (attrs: Partial<SectionAttributes>) => ReturnType;
|
|
202
|
+
};
|
|
203
|
+
}
|
|
239
204
|
}
|
|
240
|
-
declare const
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
205
|
+
declare const SectionExtension: Node<SectionOptions, any>;
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region src/extensions/slash-command/slash-command.d.ts
|
|
244
208
|
declare module '@tiptap/core' {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
};
|
|
249
|
-
}
|
|
209
|
+
interface Storage {
|
|
210
|
+
slashCommand: SlashCommandStorage;
|
|
211
|
+
}
|
|
250
212
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
213
|
+
type SlashCommandStorage = {
|
|
214
|
+
commands: SlashCommandGroupItem[];
|
|
215
|
+
};
|
|
216
|
+
type SlashCommandOptions = {
|
|
217
|
+
suggestion: Omit<SuggestionOptions, 'editor'>;
|
|
218
|
+
commands: SlashCommandGroupItem[];
|
|
219
|
+
};
|
|
220
|
+
declare const SlashCommandExtension: Extension<SlashCommandOptions, SlashCommandStorage>;
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region src/extensions/spacer/spacer.d.ts
|
|
223
|
+
type SpacerOptions = {
|
|
224
|
+
HTMLAttributes: Record<string, any>;
|
|
257
225
|
};
|
|
258
226
|
declare module '@tiptap/core' {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
227
|
+
interface Commands<ReturnType> {
|
|
228
|
+
spacer: {
|
|
229
|
+
setSpacer: (attrs?: Partial<SpacerAttributes>) => ReturnType;
|
|
230
|
+
updateSpacerAttributes: (attrs: Partial<SpacerAttributes>) => ReturnType;
|
|
231
|
+
unsetSpacer: () => ReturnType;
|
|
232
|
+
};
|
|
233
|
+
}
|
|
265
234
|
}
|
|
266
|
-
declare const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
declare const DEFAULT_SECTION_MARGIN_RIGHT = 0;
|
|
275
|
-
declare const DEFAULT_SECTION_MARGIN_BOTTOM = 0;
|
|
276
|
-
declare const DEFAULT_SECTION_MARGIN_LEFT = 0;
|
|
277
|
-
declare const DEFAULT_SECTION_PADDING_TOP = 0;
|
|
278
|
-
declare const DEFAULT_SECTION_PADDING_RIGHT = 0;
|
|
279
|
-
declare const DEFAULT_SECTION_PADDING_BOTTOM = 0;
|
|
280
|
-
declare const DEFAULT_SECTION_PADDING_LEFT = 0;
|
|
281
|
-
declare const DEFAULT_SECTION_SHOW_IF_KEY: null;
|
|
282
|
-
type SectionAttributes = {
|
|
283
|
-
borderRadius: number;
|
|
284
|
-
backgroundColor: string;
|
|
285
|
-
align: string;
|
|
286
|
-
borderWidth: number;
|
|
287
|
-
borderColor: string;
|
|
288
|
-
marginTop: number;
|
|
289
|
-
marginRight: number;
|
|
290
|
-
marginBottom: number;
|
|
291
|
-
marginLeft: number;
|
|
292
|
-
paddingTop: number;
|
|
293
|
-
paddingRight: number;
|
|
294
|
-
paddingBottom: number;
|
|
295
|
-
paddingLeft: number;
|
|
296
|
-
showIfKey: string | null;
|
|
235
|
+
declare const SpacerExtension: Node<SpacerOptions, any>;
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/extensions/variable/variable.d.ts
|
|
238
|
+
type CoreVariableOptions = VariableOptions & {
|
|
239
|
+
variables?: Variables;
|
|
240
|
+
};
|
|
241
|
+
type CoreVariableStorage = {
|
|
242
|
+
variables?: Variables;
|
|
297
243
|
};
|
|
298
244
|
declare module '@tiptap/core' {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
updateSection: (attrs: Partial<SectionAttributes>) => ReturnType;
|
|
303
|
-
};
|
|
304
|
-
}
|
|
245
|
+
interface Storage {
|
|
246
|
+
variable: CoreVariableStorage;
|
|
247
|
+
}
|
|
305
248
|
}
|
|
306
|
-
declare const
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
249
|
+
declare const VariableExtension: _tiptap_core0.Node<CoreVariableOptions, CoreVariableStorage>;
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region src/extensions/visibility/visibility.d.ts
|
|
252
|
+
type VisibilityAttributes = {
|
|
253
|
+
visibilityRule: VisibilityRule | null;
|
|
254
|
+
};
|
|
255
|
+
type VisibilityOptions = {
|
|
256
|
+
types: string[];
|
|
257
|
+
};
|
|
258
|
+
declare module '@tiptap/core' {
|
|
259
|
+
interface Commands<ReturnType> {
|
|
260
|
+
visibility: {
|
|
261
|
+
setVisibility: (attrs: Partial<VisibilityAttributes>) => ReturnType;
|
|
262
|
+
unsetVisibility: () => ReturnType;
|
|
263
|
+
};
|
|
264
|
+
}
|
|
312
265
|
}
|
|
266
|
+
declare const VisibilityExtension: Extension<VisibilityOptions, any>;
|
|
267
|
+
//#endregion
|
|
268
|
+
//#region ../extension-ai-actions/dist/index.d.mts
|
|
313
269
|
declare module '@tiptap/core' {
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
270
|
+
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;
|
|
279
|
+
};
|
|
280
|
+
}
|
|
324
281
|
}
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
type VariableSuggestionsPopoverProps = {
|
|
329
|
-
items: Variable[];
|
|
330
|
-
onSelectItem: (item: Variable) => void;
|
|
331
|
-
};
|
|
332
|
-
type VariableSuggestionsPopoverRef = {
|
|
333
|
-
moveUp: () => void;
|
|
334
|
-
moveDown: () => void;
|
|
335
|
-
select: () => void;
|
|
282
|
+
type AIActionsTransformParams = {
|
|
283
|
+
/** The plain-text content of the current selection. */text: string; /** The action identifier passed to `runAIAction`. */
|
|
284
|
+
action: string;
|
|
336
285
|
};
|
|
337
|
-
type
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
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;
|
|
345
295
|
};
|
|
346
|
-
type
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
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>;
|
|
350
310
|
};
|
|
351
|
-
type
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
declare const DEFAULT_VARIABLES: Variables;
|
|
355
|
-
declare const DEFAULT_RENDER_VARIABLE_FUNCTION: RenderVariableFunction;
|
|
356
|
-
declare const DEFAULT_VARIABLE_SUGGESTION_POPOVER: VariableSuggestionsPopoverType;
|
|
357
|
-
type RenderVariableOptions = {
|
|
358
|
-
variable: Variable;
|
|
359
|
-
fallback?: string;
|
|
360
|
-
editor: Editor;
|
|
361
|
-
from: 'content-variable' | 'bubble-variable' | 'button-variable';
|
|
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;
|
|
362
314
|
};
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* Disable input is the boolean that will be used to disable the input of the variable
|
|
387
|
-
* when the variable is selected.
|
|
388
|
-
* @default false
|
|
389
|
-
*/
|
|
390
|
-
disableInput: boolean;
|
|
315
|
+
declare module '@tiptap/core' {
|
|
316
|
+
interface ExtensionStorage {
|
|
317
|
+
aiActions: AIActionsStorage;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
declare const AIActions: Extension<AIActionsOptions, AIActionsStorage>; //#endregion
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region ../extension-inline-suggestion/dist/index.d.mts
|
|
323
|
+
//#region src/inline-suggestion.d.ts
|
|
324
|
+
declare module '@tiptap/core' {
|
|
325
|
+
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;
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
}
|
|
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;
|
|
391
337
|
};
|
|
392
|
-
type
|
|
393
|
-
|
|
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;
|
|
394
363
|
};
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
required: boolean;
|
|
402
|
-
hideDefaultValue: boolean;
|
|
403
|
-
label?: string;
|
|
404
|
-
}) => void;
|
|
405
|
-
items: Variable[];
|
|
406
|
-
} & SuggestionOptions;
|
|
407
|
-
declare const VariableList: react.ForwardRefExoticComponent<{
|
|
408
|
-
command: (params: {
|
|
409
|
-
id: string;
|
|
410
|
-
required: boolean;
|
|
411
|
-
hideDefaultValue: boolean;
|
|
412
|
-
label?: string;
|
|
413
|
-
}) => void;
|
|
414
|
-
items: Variable[];
|
|
415
|
-
} & SuggestionOptions<any, any> & react.RefAttributes<unknown>>;
|
|
416
|
-
declare function getVariableSuggestions(char?: string): Omit<SuggestionOptions, 'editor'>;
|
|
417
|
-
|
|
418
|
-
type HtmlCodeBlockAttributes = {
|
|
419
|
-
activeTab: string;
|
|
420
|
-
showIfKey: string;
|
|
421
|
-
language: string;
|
|
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
|
+
};
|
|
422
370
|
};
|
|
423
371
|
declare module '@tiptap/core' {
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
* Set a code block
|
|
428
|
-
* @param attributes Code block attributes
|
|
429
|
-
* @example editor.commands.setCodeBlock({ language: 'javascript' })
|
|
430
|
-
*/
|
|
431
|
-
setHtmlCodeBlock: (attributes?: {
|
|
432
|
-
language: string;
|
|
433
|
-
}) => ReturnType;
|
|
434
|
-
/**
|
|
435
|
-
* Toggle a code block
|
|
436
|
-
* @param attributes Code block attributes
|
|
437
|
-
* @example editor.commands.toggleCodeBlock({ language: 'javascript' })
|
|
438
|
-
*/
|
|
439
|
-
toggleHtmlCodeBlock: (attributes?: {
|
|
440
|
-
language: string;
|
|
441
|
-
}) => ReturnType;
|
|
442
|
-
updateHtmlCodeBlock: (attrs: Partial<HtmlCodeBlockAttributes>) => ReturnType;
|
|
443
|
-
};
|
|
444
|
-
}
|
|
372
|
+
interface ExtensionStorage {
|
|
373
|
+
inlineSuggestion: InlineSuggestionStorage;
|
|
374
|
+
}
|
|
445
375
|
}
|
|
446
|
-
declare const
|
|
447
|
-
|
|
448
|
-
export {
|
|
376
|
+
declare const InlineSuggestion: Extension<InlineSuggestionOptions, InlineSuggestionStorage>; //#endregion
|
|
377
|
+
//#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 };
|
|
379
|
+
//# sourceMappingURL=index.d.cts.map
|