@daisychainapp/maily-to-core 0.2.8 → 0.2.9

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