@maily-to/core 0.0.22 → 0.0.24

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.
@@ -0,0 +1,310 @@
1
+ import * as _tiptap_core from '@tiptap/core';
2
+ import { Extension, Editor, Range, Node } from '@tiptap/core';
3
+ import * as _tiptap_extension_link from '@tiptap/extension-link';
4
+ import { LinkOptions } from '@tiptap/extension-link';
5
+ import { SuggestionOptions } from '@tiptap/suggestion';
6
+ import { ColorOptions } from '@tiptap/extension-color';
7
+ import * as _tiptap_extension_horizontal_rule from '@tiptap/extension-horizontal-rule';
8
+ import * as _tiptap_react from '@tiptap/react';
9
+ import * as _tiptap_extension_image from '@tiptap/extension-image';
10
+ import { Node as Node$1 } from '@tiptap/pm/model';
11
+ import { PluginKey } from '@tiptap/pm/state';
12
+ import * as react from 'react';
13
+
14
+ declare module '@tiptap/core' {
15
+ interface Commands<ReturnType> {
16
+ linkCard: {
17
+ setLinkCard: () => ReturnType;
18
+ };
19
+ }
20
+ }
21
+ type LinkCardOptions = {};
22
+
23
+ type MailyKitOptions = {
24
+ linkCard?: Partial<LinkCardOptions> | false;
25
+ for?: Partial<{}> | false;
26
+ section?: Partial<{}> | false;
27
+ columns?: Partial<{}> | false;
28
+ column?: Partial<{}> | false;
29
+ button?: Partial<{}> | false;
30
+ spacer?: Partial<{}> | false;
31
+ logo?: Partial<{}> | false;
32
+ image?: Partial<{}> | false;
33
+ link?: Partial<LinkOptions> | false;
34
+ };
35
+ declare const MailyKit: Extension<MailyKitOptions, any>;
36
+
37
+ type SlashCommandOptions = {
38
+ suggestion: Omit<SuggestionOptions, 'editor'>;
39
+ };
40
+ declare const SlashCommandExtension: Extension<SlashCommandOptions, any>;
41
+
42
+ interface CommandProps {
43
+ editor: Editor;
44
+ range: Range;
45
+ }
46
+ type BlockItem = {
47
+ title: string;
48
+ description: string;
49
+ searchTerms: string[];
50
+ icon: JSX.Element;
51
+ shouldBeHidden?: (editor: Editor) => boolean;
52
+ command: (options: CommandProps) => void;
53
+ };
54
+
55
+ declare function getSlashCommandSuggestions(commands?: BlockItem[]): Omit<SuggestionOptions, 'editor'>;
56
+
57
+ type ColorStorage = {
58
+ /**
59
+ * Last 5 used colors
60
+ */
61
+ colors: Set<string>;
62
+ };
63
+ declare const Color: _tiptap_core.Extension<ColorOptions, ColorStorage>;
64
+
65
+ declare const HorizontalRule: _tiptap_core.Node<_tiptap_extension_horizontal_rule.HorizontalRuleOptions, any>;
66
+
67
+ interface FooterOptions {
68
+ HTMLAttributes: Record<string, any>;
69
+ }
70
+ declare module '@tiptap/core' {
71
+ interface Commands<ReturnType> {
72
+ footer: {
73
+ setFooter: () => ReturnType;
74
+ };
75
+ }
76
+ }
77
+ declare const Footer: Node<FooterOptions, any>;
78
+
79
+ declare const allowedSpacerSize: readonly ["sm", "md", "lg", "xl"];
80
+ type AllowedSpacerSize = (typeof allowedSpacerSize)[number];
81
+ interface SpacerOptions {
82
+ height: AllowedSpacerSize;
83
+ showIfKey: string;
84
+ HTMLAttributes: Record<string, any>;
85
+ }
86
+ declare module '@tiptap/core' {
87
+ interface Commands<ReturnType> {
88
+ spacer: {
89
+ setSpacer: (options: {
90
+ height: AllowedSpacerSize;
91
+ }) => ReturnType;
92
+ setSpacerSize: (height: AllowedSpacerSize) => ReturnType;
93
+ setSpacerShowIfKey: (showIfKey: string) => ReturnType;
94
+ unsetSpacer: () => ReturnType;
95
+ };
96
+ }
97
+ }
98
+ declare const Spacer: Node<SpacerOptions, any>;
99
+
100
+ declare const DEFAULT_COLUMNS_GAP = 8;
101
+ interface ColumnsAttributes {
102
+ showIfKey: string;
103
+ gap: number;
104
+ }
105
+ declare module '@tiptap/core' {
106
+ interface Commands<ReturnType> {
107
+ columns: {
108
+ setColumns: () => ReturnType;
109
+ updateColumns: (attrs: Partial<ColumnsAttributes>) => ReturnType;
110
+ };
111
+ }
112
+ }
113
+ declare const ColumnsExtension: Node<any, any>;
114
+
115
+ declare const DEFAULT_COLUMN_WIDTH = "auto";
116
+ type AllowedColumnVerticalAlign = 'top' | 'middle' | 'bottom';
117
+ declare const DEFAULT_COLUMN_VERTICAL_ALIGN: AllowedColumnVerticalAlign;
118
+ interface ColumnAttributes {
119
+ verticalAlign: AllowedColumnVerticalAlign;
120
+ backgroundColor: string;
121
+ borderRadius: number;
122
+ align: string;
123
+ borderWidth: number;
124
+ borderColor: string;
125
+ paddingTop: number;
126
+ paddingRight: number;
127
+ paddingBottom: number;
128
+ paddingLeft: number;
129
+ showIfKey: string;
130
+ }
131
+ declare module '@tiptap/core' {
132
+ interface Commands<ReturnType> {
133
+ column: {
134
+ updateColumn: (attrs: Partial<ColumnAttributes>) => ReturnType;
135
+ };
136
+ }
137
+ }
138
+ declare const ColumnExtension: Node<any, any>;
139
+
140
+ declare const DEFAULT_SECTION_BACKGROUND_COLOR = "#f7f7f7";
141
+ declare const DEFAULT_SECTION_ALIGN = "left";
142
+ declare const DEFAULT_SECTION_BORDER_WIDTH = 2;
143
+ declare const DEFAULT_SECTION_BORDER_COLOR = "#e2e2e2";
144
+ declare const DEFAULT_SECTION_BORDER_RADIUS = 0;
145
+ declare const DEFAULT_SECTION_MARGIN_TOP = 0;
146
+ declare const DEFAULT_SECTION_MARGIN_RIGHT = 0;
147
+ declare const DEFAULT_SECTION_MARGIN_BOTTOM = 0;
148
+ declare const DEFAULT_SECTION_MARGIN_LEFT = 0;
149
+ declare const DEFAULT_SECTION_PADDING_TOP = 5;
150
+ declare const DEFAULT_SECTION_PADDING_RIGHT = 5;
151
+ declare const DEFAULT_SECTION_PADDING_BOTTOM = 5;
152
+ declare const DEFAULT_SECTION_PADDING_LEFT = 5;
153
+ declare const DEFAULT_SECTION_SHOW_IF_KEY: null;
154
+ type SectionAttributes = {
155
+ borderRadius: number;
156
+ backgroundColor: string;
157
+ align: string;
158
+ borderWidth: number;
159
+ borderColor: string;
160
+ marginTop: number;
161
+ marginRight: number;
162
+ marginBottom: number;
163
+ marginLeft: number;
164
+ paddingTop: number;
165
+ paddingRight: number;
166
+ paddingBottom: number;
167
+ paddingLeft: number;
168
+ showIfKey: string | null;
169
+ };
170
+ declare module '@tiptap/core' {
171
+ interface Commands<ReturnType> {
172
+ section: {
173
+ setSection: () => ReturnType;
174
+ updateSection: (attrs: Partial<SectionAttributes>) => ReturnType;
175
+ };
176
+ }
177
+ }
178
+ declare const SectionExtension: Node<any, any>;
179
+
180
+ type ForAttributes = {
181
+ each: string;
182
+ isUpdatingKey: boolean;
183
+ showIfKey: string;
184
+ };
185
+ declare module '@tiptap/core' {
186
+ interface Commands<ReturnType> {
187
+ for: {
188
+ setFor: () => ReturnType;
189
+ updateFor: (attrs: Partial<ForAttributes>) => ReturnType;
190
+ };
191
+ }
192
+ }
193
+ declare const ForExtension: Node<any, any>;
194
+
195
+ declare const allowedLogoSize: readonly ["sm", "md", "lg"];
196
+ type AllowedLogoSize = (typeof allowedLogoSize)[number];
197
+ declare const allowedLogoAlignment: readonly ["left", "center", "right"];
198
+ type AllowedLogoAlignment = (typeof allowedLogoAlignment)[number];
199
+ interface LogoOptions {
200
+ src: string;
201
+ alt?: string;
202
+ title?: string;
203
+ size?: AllowedLogoSize;
204
+ alignment?: AllowedLogoAlignment;
205
+ }
206
+ interface LogoAttributes {
207
+ src?: string;
208
+ size?: AllowedLogoSize;
209
+ alignment?: AllowedLogoAlignment;
210
+ showIfKey: string;
211
+ isSrcVariable?: boolean;
212
+ }
213
+ declare module '@tiptap/core' {
214
+ interface Commands<ReturnType> {
215
+ logo: {
216
+ setLogoImage: (options: LogoOptions) => ReturnType;
217
+ setLogoAttributes: (attributes: Partial<LogoAttributes>) => ReturnType;
218
+ };
219
+ }
220
+ }
221
+ declare const DEFAULT_LOGO_SIZE: AllowedLogoSize;
222
+ declare const logoSizes: Record<AllowedLogoSize, string>;
223
+ declare const LogoExtension: _tiptap_react.Node<_tiptap_extension_image.ImageOptions, any>;
224
+
225
+ declare const DEFAULT_BUTTON_ALIGNMENT: AllowedLogoAlignment;
226
+ declare const DEFAULT_BUTTON_VARIANT: AllowedButtonVariant;
227
+ declare const DEFAULT_BUTTON_BORDER_RADIUS: AllowedButtonBorderRadius;
228
+ declare const DEFAULT_BUTTON_BACKGROUND_COLOR = "#000000";
229
+ declare const DEFAULT_BUTTON_TEXT_COLOR = "#ffffff";
230
+ declare const DEFAULT_BUTTON_PADDING_TOP = 10;
231
+ declare const DEFAULT_BUTTON_PADDING_RIGHT = 32;
232
+ declare const DEFAULT_BUTTON_PADDING_BOTTOM = 10;
233
+ declare const DEFAULT_BUTTON_PADDING_LEFT = 32;
234
+ declare const allowedButtonVariant: readonly ["filled", "outline"];
235
+ type AllowedButtonVariant = (typeof allowedButtonVariant)[number];
236
+ declare const allowedButtonBorderRadius: readonly ["sharp", "smooth", "round"];
237
+ type AllowedButtonBorderRadius = (typeof allowedButtonBorderRadius)[number];
238
+ type ButtonAttributes = {
239
+ text: string;
240
+ isTextVariable: boolean;
241
+ url: string;
242
+ isUrlVariable: boolean;
243
+ alignment: AllowedLogoAlignment;
244
+ variant: AllowedButtonVariant;
245
+ borderRadius: AllowedButtonBorderRadius;
246
+ buttonColor: string;
247
+ textColor: string;
248
+ showIfKey: string;
249
+ paddingTop: number;
250
+ paddingRight: number;
251
+ paddingBottom: number;
252
+ paddingLeft: number;
253
+ };
254
+ declare module '@tiptap/core' {
255
+ interface Commands<ReturnType> {
256
+ button: {
257
+ setButton: () => ReturnType;
258
+ updateButton: (attrs: Partial<ButtonAttributes>) => ReturnType;
259
+ };
260
+ }
261
+ }
262
+ declare const ButtonExtension: Node<any, any>;
263
+
264
+ declare const ImageExtension: _tiptap_react.Node<_tiptap_extension_image.ImageOptions, any>;
265
+
266
+ declare module '@tiptap/core' {
267
+ interface Commands<ReturnType> {
268
+ customLink: {
269
+ setIsUrlVariable: (isUrlVariable: boolean) => ReturnType;
270
+ };
271
+ }
272
+ }
273
+ declare const LinkExtension: _tiptap_core.Mark<_tiptap_extension_link.LinkOptions, any>;
274
+
275
+ type Variable = {
276
+ name: string;
277
+ required?: boolean;
278
+ valid?: boolean;
279
+ };
280
+ type VariableFunctionOptions = {
281
+ query: string;
282
+ from: 'content-variable' | 'bubble-variable' | 'for-variable';
283
+ editor: Editor;
284
+ };
285
+ type VariablesFunction = (opts: VariableFunctionOptions) => Array<Variable>;
286
+ type Variables = Array<Variable> | VariablesFunction;
287
+
288
+ type VariableOptions = {
289
+ renderLabel: (props: {
290
+ options: VariableOptions;
291
+ node: Node$1;
292
+ }) => string;
293
+ suggestion: Omit<SuggestionOptions, 'editor'>;
294
+ variables?: Variables;
295
+ triggerChar?: string;
296
+ };
297
+ declare const VariablePluginKey: PluginKey<any>;
298
+ declare const VariableExtension: Node<VariableOptions, any>;
299
+
300
+ type VariableListProps = {
301
+ command: (params: {
302
+ id: string;
303
+ required: boolean;
304
+ }) => void;
305
+ items: Variable[];
306
+ };
307
+ declare const VariableList: react.ForwardRefExoticComponent<VariableListProps & react.RefAttributes<unknown>>;
308
+ declare function getVariableSuggestions(variables?: Variables, char?: string): Omit<SuggestionOptions, 'editor'>;
309
+
310
+ export { type AllowedButtonBorderRadius, type AllowedButtonVariant, type AllowedColumnVerticalAlign, type AllowedLogoAlignment, type AllowedLogoSize, type AllowedSpacerSize, type ButtonAttributes, ButtonExtension, Color, ColumnExtension, ColumnsExtension, DEFAULT_BUTTON_ALIGNMENT, DEFAULT_BUTTON_BACKGROUND_COLOR, DEFAULT_BUTTON_BORDER_RADIUS, DEFAULT_BUTTON_PADDING_BOTTOM, DEFAULT_BUTTON_PADDING_LEFT, DEFAULT_BUTTON_PADDING_RIGHT, DEFAULT_BUTTON_PADDING_TOP, DEFAULT_BUTTON_TEXT_COLOR, DEFAULT_BUTTON_VARIANT, DEFAULT_COLUMNS_GAP, DEFAULT_COLUMN_VERTICAL_ALIGN, DEFAULT_COLUMN_WIDTH, DEFAULT_LOGO_SIZE, DEFAULT_SECTION_ALIGN, DEFAULT_SECTION_BACKGROUND_COLOR, DEFAULT_SECTION_BORDER_COLOR, DEFAULT_SECTION_BORDER_RADIUS, DEFAULT_SECTION_BORDER_WIDTH, DEFAULT_SECTION_MARGIN_BOTTOM, DEFAULT_SECTION_MARGIN_LEFT, DEFAULT_SECTION_MARGIN_RIGHT, DEFAULT_SECTION_MARGIN_TOP, DEFAULT_SECTION_PADDING_BOTTOM, DEFAULT_SECTION_PADDING_LEFT, DEFAULT_SECTION_PADDING_RIGHT, DEFAULT_SECTION_PADDING_TOP, DEFAULT_SECTION_SHOW_IF_KEY, Footer, type FooterOptions, ForExtension, HorizontalRule, ImageExtension, LinkExtension, type LogoAttributes, LogoExtension, MailyKit, type MailyKitOptions, SectionExtension, SlashCommandExtension, type SlashCommandOptions, Spacer, type SpacerOptions, VariableExtension, VariableList, type VariableOptions, VariablePluginKey, allowedButtonBorderRadius, allowedButtonVariant, allowedLogoAlignment, allowedLogoSize, allowedSpacerSize, getSlashCommandSuggestions, getVariableSuggestions, logoSizes };