@maily-to/shared 2.0.0-beta.1 → 2.0.0-beta.10

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/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { Properties } from "csstype";
2
-
3
2
  //#region src/alignment.d.ts
4
3
  declare const TEXT_ALIGNMENTS: {
5
4
  readonly LEFT: 'left';
@@ -7,26 +6,15 @@ declare const TEXT_ALIGNMENTS: {
7
6
  readonly RIGHT: 'right';
8
7
  };
9
8
  type AllowedTextAlignment = (typeof TEXT_ALIGNMENTS)[keyof typeof TEXT_ALIGNMENTS];
10
- declare const allowedTextAligns: readonly AllowedTextAlignment[];
11
9
  declare const DEFAULT_TEXT_ALIGN: AllowedTextAlignment;
12
10
  declare function isAllowedTextAlignment(value: unknown): value is AllowedTextAlignment;
13
11
  //#endregion
14
- //#region src/field-mode.d.ts
15
- /**
16
- * Controls how multi-value fields (padding, margin, border) are edited.
17
- * "none" disables the field, "uniform" links all sides to one value,
18
- * "mixed" allows independent per-side values, "preset" uses predefined
19
- * size options (e.g. small/medium/large).
20
- */
21
- declare const FIELD_MODE: {
22
- readonly NONE: 'none';
23
- readonly MIXED: 'mixed';
24
- readonly UNIFORM: 'uniform';
25
- readonly PRESET: 'preset';
26
- };
27
- type AllowedFieldMode = (typeof FIELD_MODE)[keyof typeof FIELD_MODE];
28
- declare const allowedFieldModes: readonly AllowedFieldMode[];
29
- declare function isAllowedFieldMode(mode: unknown): mode is AllowedFieldMode;
12
+ //#region src/style.d.ts
13
+ type InlineStyle = Record<string, string>;
14
+ declare function parseInlineStyles(style: string): InlineStyle;
15
+ declare function stringifyInlineStyles(style: InlineStyle): string;
16
+ declare function expandInlineStyles(style: InlineStyle): InlineStyle;
17
+ declare function mergeInlineStyles(under: InlineStyle, over: InlineStyle): InlineStyle;
30
18
  //#endregion
31
19
  //#region src/border.d.ts
32
20
  declare const BORDER_STYLES: {
@@ -36,35 +24,36 @@ declare const BORDER_STYLES: {
36
24
  };
37
25
  type AllowedBorderStyle = (typeof BORDER_STYLES)[keyof typeof BORDER_STYLES];
38
26
  declare const DEFAULT_BORDER_STYLE: AllowedBorderStyle;
39
- declare const DEFAULT_BORDER_COLOR = "#000000";
40
- /**
41
- * Full border configuration for a node. Includes border style, color,
42
- * per-side widths (top/right/bottom/left), per-corner radii, and
43
- * field modes that control whether each group is edited uniformly
44
- * or independently.
45
- */
46
- type BorderStyleConfig = {
47
- borderStyle: AllowedBorderStyle;
48
- borderColor: string;
49
- borderWidthMode: AllowedFieldMode;
50
- borderTopWidth: number;
51
- borderRightWidth: number;
52
- borderBottomWidth: number;
53
- borderLeftWidth: number;
54
- borderRadiusMode: AllowedFieldMode;
55
- borderTopLeftRadius: number;
56
- borderTopRightRadius: number;
57
- borderBottomRightRadius: number;
58
- borderBottomLeftRadius: number;
27
+ declare function isAllowedBorderStyle(value: unknown): value is AllowedBorderStyle;
28
+ type BorderParts = {
29
+ color: string | undefined;
30
+ style: string | undefined;
31
+ width: string | undefined;
59
32
  };
60
33
  /**
61
- * Converts a BorderStyleConfig into CSS properties for inline styles.
62
- * When all widths or radii are equal (or the mode is "uniform"), emits
63
- * shorthand CSS; otherwise emits per-side longhand properties.
34
+ * Reads the width, style and colour of a border from the `border` shorthand,
35
+ * letting any longhand already in the style win. The shorthand lists its
36
+ * parts in any order, so each is recognised by shape rather than position.
64
37
  */
65
- declare function getBorderStyle(config: BorderStyleConfig): Properties;
38
+ declare function getBorderParts(style: InlineStyle): BorderParts;
39
+ //#endregion
40
+ //#region src/box.d.ts
41
+ declare const BOX_SIDES: readonly ['top', 'right', 'bottom', 'left'];
42
+ type BoxSide = (typeof BOX_SIDES)[number];
43
+ type BoxSideValues = Record<BoxSide, number>;
44
+ declare const BOX_CORNERS: readonly ['topLeft', 'topRight', 'bottomRight', 'bottomLeft'];
45
+ type BoxCorner = (typeof BOX_CORNERS)[number];
46
+ type BoxCornerValues = Record<BoxCorner, number>;
47
+ declare function getBoxSides(style: InlineStyle, property: string): BoxSideValues;
48
+ declare function toBoxSides(property: string, values: BoxSideValues): Record<string, string | null>;
49
+ /**
50
+ * Radius shorthands run clockwise from the top-left corner, and repeat the
51
+ * same way box shorthands do.
52
+ */
53
+ declare function getBoxCorners(style: InlineStyle, property: string): BoxCornerValues;
54
+ declare function toBoxCorners(property: string, values: BoxCornerValues): Record<string, string | null>;
66
55
  //#endregion
67
- //#region src/button-kind.d.ts
56
+ //#region src/button.d.ts
68
57
  /**
69
58
  * Button layout kinds.
70
59
  * "tight" renders the button at its content width,
@@ -75,18 +64,22 @@ declare const BUTTON_KINDS: {
75
64
  readonly FULL_WIDTH: 'full-width';
76
65
  };
77
66
  type AllowedButtonKind = (typeof BUTTON_KINDS)[keyof typeof BUTTON_KINDS];
78
- declare const allowedButtonKinds: readonly AllowedButtonKind[];
79
67
  declare const DEFAULT_BUTTON_KIND: AllowedButtonKind;
80
68
  declare function isAllowedButtonKind(value: unknown): value is AllowedButtonKind;
81
69
  //#endregion
70
+ //#region src/column.d.ts
71
+ type ColumnWidth = number | string;
72
+ declare function getColumnWidth(value: string | null | undefined): ColumnWidth | null;
73
+ declare function getColumnWidthValue(width: ColumnWidth): string;
74
+ type ColumnWidthPercentOptions = {
75
+ containerWidth: number;
76
+ width: ColumnWidth | null | undefined;
77
+ };
78
+ declare function getColumnWidthPercent(options: ColumnWidthPercentOptions): number | null;
79
+ //#endregion
82
80
  //#region src/constants.d.ts
83
- /** HTML data attribute key used to identify node types in rendered output. */
84
81
  declare const DATA_NODE_TYPE_KEY = "data-node-type";
85
- /** HTML data attribute key used to store serialized visibility rules. */
86
- declare const DATA_VISIBILITY_RULE_KEY = "data-visibility-rule";
87
- /** Prefix prepended to all Maily error messages for easy identification. */
88
82
  declare const MAILY_ERROR_PREFIX = "[Maily Error]";
89
- /** URL for filing bug reports against the Maily repository. */
90
83
  declare const MAILY_BUG_REPORT_URL = "https://github.com/arikchakma/maily.to/issues/new";
91
84
  //#endregion
92
85
  //#region src/font.d.ts
@@ -120,31 +113,23 @@ interface FontProps {
120
113
  * loaded from the Maily CDN as woff2.
121
114
  */
122
115
  declare const DEFAULT_FONT: FontProps;
123
- /**
124
- * Injects a @font-face style element into the document head to load
125
- * the given font. Only works in browser environments.
126
- */
127
- declare function loadFont(font: FontProps): void;
116
+ declare function getFontFamilyNames(value: string): string[];
117
+ type FontFamilyValueOptions = {
118
+ fallbackFontFamily?: string | null;
119
+ fontFamily?: string | null;
120
+ };
121
+ declare function getFontFamilyValue(options: FontFamilyValueOptions): string;
128
122
  /**
129
123
  * Generates a @font-face CSS rule string for the given font configuration.
130
124
  * Includes the font family, style, weight, MSO fallback, and web font
131
125
  * source URL when available.
132
126
  */
133
127
  declare function getFontFaceStyle(font: FontProps): string;
134
- //#endregion
135
- //#region src/font-weight.d.ts
136
128
  /**
137
- * Numeric font weight values mapped to semantic names.
138
- * Normal (400), Medium (500), Semibold (600), Bold (700), Extra Bold (800).
129
+ * Injects a @font-face style element into the document head to load
130
+ * the given font. Only works in browser environments.
139
131
  */
140
- declare const FONT_WEIGHTS: {
141
- readonly NORMAL: 400;
142
- readonly MEDIUM: 500;
143
- readonly SEMIBOLD: 600;
144
- readonly BOLD: 700;
145
- readonly EXTRA_BOLD: 800;
146
- };
147
- type FontWeight = (typeof FONT_WEIGHTS)[keyof typeof FONT_WEIGHTS];
132
+ declare function loadFont(font: FontProps): void;
148
133
  //#endregion
149
134
  //#region src/font-style.d.ts
150
135
  /**
@@ -170,7 +155,6 @@ declare const FONT_STYLES: {
170
155
  readonly ITALIC: 'italic';
171
156
  };
172
157
  type FontStyleValue = (typeof FONT_STYLES)[keyof typeof FONT_STYLES];
173
- /** Preset options for the font size dropdown in the editor. */
174
158
  declare const FONT_SIZE_PRESETS: readonly [{
175
159
  readonly value: 12;
176
160
  readonly label: 'Small';
@@ -190,7 +174,6 @@ declare const FONT_SIZE_PRESETS: readonly [{
190
174
  readonly value: 32;
191
175
  readonly label: '2XL';
192
176
  }];
193
- /** Preset options for the line height dropdown in the editor. */
194
177
  declare const LINE_HEIGHT_PRESETS: readonly [{
195
178
  readonly value: 1;
196
179
  readonly label: 'Tight';
@@ -208,39 +191,24 @@ declare const LINE_HEIGHT_PRESETS: readonly [{
208
191
  readonly label: 'Loose';
209
192
  }];
210
193
  declare const DEFAULT_FONT_FAMILY: FontFamily;
211
- declare const DEFAULT_FONT_SIZE = 15;
212
- declare const DEFAULT_FONT_WEIGHT: FontWeight;
213
- declare const DEFAULT_LINE_HEIGHT = 1.75;
214
194
  declare const DEFAULT_FONT_FALLBACK: FallbackFont;
195
+ //#endregion
196
+ //#region src/font-weight.d.ts
215
197
  /**
216
- * Per-node font style overrides. Null values mean "inherit from
217
- * the theme defaults" — only non-null values produce inline CSS.
218
- */
219
- type FontStyleAttributes = {
220
- fontFamily: FontFamily | null;
221
- fontFallback: FallbackFont | null;
222
- fontSize: number | null;
223
- fontWeight: FontWeight | null;
224
- lineHeight: number | null;
225
- fontStyle: FontStyleValue | null;
226
- };
227
- /**
228
- * Baseline font values used when a node's FontStyleAttributes are null.
229
- * Each node type (paragraph, heading, button, etc.) has its own defaults
230
- * defined in the renderer theme.
198
+ * Numeric font weight values mapped to semantic names.
199
+ * Normal (400), Medium (500), Semibold (600), Bold (700), Extra Bold (800).
231
200
  */
232
- type NodeFontStyleDefaults = {
233
- fontSize: number;
234
- lineHeight: number;
235
- fontWeight: number;
236
- fontStyle?: FontStyleValue;
201
+ declare const FONT_WEIGHTS: {
202
+ readonly NORMAL: 400;
203
+ readonly MEDIUM: 500;
204
+ readonly SEMIBOLD: 600;
205
+ readonly BOLD: 700;
206
+ readonly EXTRA_BOLD: 800;
237
207
  };
238
- /**
239
- * Builds a CSS properties object from a node's font attributes,
240
- * falling back to the provided defaults for any null values.
241
- * Only includes properties that have a resolved value.
242
- */
243
- declare function getFontStyle(attrs: FontStyleAttributes, defaults?: Partial<NodeFontStyleDefaults>): Properties;
208
+ type FontWeight = (typeof FONT_WEIGHTS)[keyof typeof FONT_WEIGHTS];
209
+ //#endregion
210
+ //#region src/function.d.ts
211
+ declare function noop(): void;
244
212
  //#endregion
245
213
  //#region src/html-code-block.d.ts
246
214
  /**
@@ -254,28 +222,19 @@ declare const HTML_CODE_BLOCK_TABS: {
254
222
  type AllowedHtmlCodeBlockTab = (typeof HTML_CODE_BLOCK_TABS)[keyof typeof HTML_CODE_BLOCK_TABS];
255
223
  declare const DEFAULT_HTML_CODE_BLOCK_TAB: AllowedHtmlCodeBlockTab;
256
224
  //#endregion
257
- //#region src/margin.d.ts
258
- /**
259
- * Per-side margin configuration for a node. Includes a field mode
260
- * that controls whether margin is edited uniformly or per-side,
261
- * and individual values for each side in pixels.
262
- */
263
- type MarginStyleConfig = {
264
- marginMode: AllowedFieldMode;
265
- marginTop: number;
266
- marginRight: number;
267
- marginBottom: number;
268
- marginLeft: number;
269
- };
270
- /**
271
- * Converts a MarginStyleConfig into CSS properties for inline styles.
272
- * When all sides are equal (or mode is "uniform"), emits shorthand CSS;
273
- * otherwise emits per-side longhand properties.
274
- */
275
- declare function getMarginStyle(config: MarginStyleConfig): Properties;
225
+ //#region src/image.d.ts
226
+ type ImageWidth = number | string;
227
+ declare const MIN_IMAGE_WIDTH_PERCENTAGE = 5;
228
+ declare const MAX_IMAGE_WIDTH_PERCENTAGE = 100;
229
+ declare const DEFAULT_CONTAINER_WIDTH_PIXELS = 600;
230
+ declare function parseWidthToPercentage(width: ImageWidth | null | undefined, containerWidthPixels?: number): number;
231
+ declare function clampImageWidthPercentage(width: number): number;
232
+ //#endregion
233
+ //#region src/invariant.d.ts
234
+ declare function invariant(value: boolean, message?: string): asserts value;
235
+ declare function invariant<T>(value: T | null | undefined, message?: string): asserts value is T;
276
236
  //#endregion
277
237
  //#region src/mark.d.ts
278
- /** Registry of all inline mark type strings used in the document JSON. */
279
238
  declare const MAILY_MARK_TYPES: {
280
239
  readonly BOLD: 'bold';
281
240
  readonly ITALIC: 'italic';
@@ -285,110 +244,126 @@ declare const MAILY_MARK_TYPES: {
285
244
  readonly CODE: 'code';
286
245
  readonly TEXT_STYLE: 'textStyle';
287
246
  readonly HIGHLIGHT: 'highlight';
247
+ readonly SPAN: 'span';
288
248
  };
249
+ declare const allowedMarkTypes: ("bold" | "code" | "highlight" | "italic" | "link" | "span" | "strike" | "textStyle" | "underline")[];
289
250
  type MailyMarkType = (typeof MAILY_MARK_TYPES)[keyof typeof MAILY_MARK_TYPES];
290
- declare const allowedMarkTypes: ("bold" | "code" | "highlight" | "italic" | "link" | "strike" | "textStyle" | "underline")[];
291
- /**
292
- * Base shape shared by all inline marks. Individual mark types
293
- * narrow the type field and optionally add typed attrs.
294
- */
251
+ type MarkStyleAttributes = {
252
+ style?: string | null;
253
+ };
295
254
  type BaseMailyMark = {
255
+ attrs?: MarkStyleAttributes & Record<string, unknown>;
296
256
  type: MailyMarkType;
297
- attrs?: Record<string, any>;
298
257
  };
299
- /** Bold */
300
258
  type BoldMark = BaseMailyMark & {
301
259
  type: typeof MAILY_MARK_TYPES.BOLD;
302
260
  };
303
- /** Italic */
304
261
  type ItalicMark = BaseMailyMark & {
305
262
  type: typeof MAILY_MARK_TYPES.ITALIC;
306
263
  };
307
- /** Strike */
308
264
  type StrikeMark = BaseMailyMark & {
309
265
  type: typeof MAILY_MARK_TYPES.STRIKE;
310
266
  };
311
- /** Underline */
312
267
  type UnderlineMark = BaseMailyMark & {
313
268
  type: typeof MAILY_MARK_TYPES.UNDERLINE;
314
269
  };
315
- /** Link */
316
- type LinkAttributes = {
270
+ type LinkAttributes = MarkStyleAttributes & {
271
+ class?: string | null;
317
272
  href: string;
318
- target?: string;
273
+ rel?: string | null;
274
+ target?: string | null;
275
+ title?: string | null;
319
276
  };
320
277
  type LinkMark = BaseMailyMark & {
321
- type: typeof MAILY_MARK_TYPES.LINK;
322
278
  attrs: LinkAttributes;
279
+ type: typeof MAILY_MARK_TYPES.LINK;
323
280
  };
324
- /** Code */
325
- type CodeAttributes = {};
326
281
  type CodeMark = BaseMailyMark & {
327
282
  type: typeof MAILY_MARK_TYPES.CODE;
328
- attrs: CodeAttributes;
329
283
  };
330
- /** Text Style */
331
- type TextStyleAttributes = {
284
+ type TextStyleAttributes = MarkStyleAttributes & {
332
285
  color: string;
333
286
  };
334
287
  type TextStyleMark = BaseMailyMark & {
335
- type: typeof MAILY_MARK_TYPES.TEXT_STYLE;
336
288
  attrs: TextStyleAttributes;
289
+ type: typeof MAILY_MARK_TYPES.TEXT_STYLE;
337
290
  };
338
- /** Highlight */
339
- type HighlightAttributes = {
291
+ type HighlightAttributes = MarkStyleAttributes & {
340
292
  color: string;
341
293
  };
342
294
  type HighlightMark = BaseMailyMark & {
343
- type: typeof MAILY_MARK_TYPES.HIGHLIGHT;
344
295
  attrs: HighlightAttributes;
296
+ type: typeof MAILY_MARK_TYPES.HIGHLIGHT;
345
297
  };
346
- type AnyMailyMark = BoldMark | ItalicMark | StrikeMark | UnderlineMark | LinkMark | CodeMark | TextStyleMark | HighlightMark;
347
- //#endregion
348
- //#region src/padding.d.ts
349
- /**
350
- * Per-side padding configuration for a node. Includes a field mode
351
- * that controls whether padding is edited uniformly or per-side,
352
- * and individual values for each side in pixels.
353
- */
354
- type PaddingStyleConfig = {
355
- paddingMode: AllowedFieldMode;
356
- paddingTop: number;
357
- paddingRight: number;
358
- paddingBottom: number;
359
- paddingLeft: number;
298
+ type SpanMark = BaseMailyMark & {
299
+ attrs?: MarkStyleAttributes;
300
+ type: typeof MAILY_MARK_TYPES.SPAN;
360
301
  };
361
- /**
362
- * Converts a PaddingStyleConfig into CSS properties for inline styles.
363
- * When all sides are equal (or mode is "uniform"), emits shorthand CSS;
364
- * otherwise emits per-side longhand properties.
365
- */
366
- declare function getPaddingStyle(config: PaddingStyleConfig): Properties;
302
+ type AnyMailyMark = BoldMark | ItalicMark | StrikeMark | UnderlineMark | LinkMark | CodeMark | TextStyleMark | HighlightMark | SpanMark;
367
303
  //#endregion
368
- //#region src/text-direction.d.ts
369
- /** Text direction values matching the HTML `dir` attribute: ltr, rtl, auto. */
304
+ //#region src/direction.d.ts
370
305
  declare const TEXT_DIRECTIONS: {
371
306
  readonly LTR: 'ltr';
372
307
  readonly RTL: 'rtl';
373
308
  readonly AUTO: 'auto';
374
309
  };
375
310
  type TextDirection = (typeof TEXT_DIRECTIONS)[keyof typeof TEXT_DIRECTIONS];
376
- declare const allowedTextDirections: readonly TextDirection[];
377
311
  declare const DEFAULT_TEXT_DIRECTION: TextDirection;
378
- declare function isAllowedTextDirection(value: unknown): value is TextDirection;
379
- /**
380
- * Returns a CSS `direction` property object for the given dir value.
381
- * Returns an empty object for "auto" or nullish values, since the
382
- * browser default is sufficient in those cases.
383
- */
384
- declare function getCssDirection(dir: TextDirection | null | undefined): Record<string, Omit<TextDirection, typeof TEXT_DIRECTIONS.AUTO>>;
312
+ declare function getCssDirection(dir: TextDirection | null | undefined): {
313
+ direction: "ltr" | "rtl";
314
+ } | {
315
+ direction?: undefined;
316
+ };
317
+ //#endregion
318
+ //#region src/theme.d.ts
319
+ type NodeThemeOptions = {
320
+ blockquote?: InlineStyle;
321
+ body?: InlineStyle;
322
+ bulletList?: InlineStyle;
323
+ button?: InlineStyle;
324
+ code?: InlineStyle;
325
+ container?: InlineStyle;
326
+ footer?: InlineStyle;
327
+ h1?: InlineStyle;
328
+ h2?: InlineStyle;
329
+ h3?: InlineStyle;
330
+ heading?: InlineStyle;
331
+ horizontalRule?: InlineStyle;
332
+ htmlCodeBlock?: InlineStyle;
333
+ link?: InlineStyle;
334
+ listItem?: InlineStyle;
335
+ orderedList?: InlineStyle;
336
+ paragraph?: InlineStyle;
337
+ section?: InlineStyle;
338
+ table?: InlineStyle;
339
+ tableCell?: InlineStyle;
340
+ tableRow?: InlineStyle;
341
+ };
342
+ declare const DEFAULT_CONTAINER_MAX_WIDTH = 600;
343
+ declare const BASIC_NODE_THEME: NodeThemeOptions;
344
+ declare const MAILY_NODE_THEME: NodeThemeOptions;
345
+ type ExtendNodeThemeOptions = {
346
+ extension: NodeThemeOptions;
347
+ preset: NodeThemeOptions;
348
+ };
349
+ declare function extendNodeTheme(options: ExtendNodeThemeOptions): NodeThemeOptions;
350
+ type ThemeDeclarationsOptions = {
351
+ attrs?: Record<string, unknown> | undefined;
352
+ theme: NodeThemeOptions;
353
+ type: string;
354
+ };
355
+ declare function getThemeDeclarations(options: ThemeDeclarationsOptions): InlineStyle | undefined;
385
356
  //#endregion
386
357
  //#region src/visibility.d.ts
387
- /**
388
- * Comparison operators for conditional visibility rules.
389
- * Used to evaluate a template variable against a value
390
- * to decide whether a node should be shown or hidden.
391
- */
358
+ declare const VISIBILITY_ACTIONS: {
359
+ readonly SHOW: 'show';
360
+ readonly HIDE: 'hide';
361
+ };
362
+ type AllowedVisibilityAction = (typeof VISIBILITY_ACTIONS)[keyof typeof VISIBILITY_ACTIONS];
363
+ declare const VISIBILITY_ACTION_OPTIONS: {
364
+ label: string;
365
+ value: AllowedVisibilityAction;
366
+ }[];
392
367
  declare const VISIBILITY_OPERATORS: {
393
368
  readonly IS_TRUE: 'is_true';
394
369
  readonly IS_FALSE: 'is_false';
@@ -403,566 +378,406 @@ declare const VISIBILITY_OPERATORS: {
403
378
  };
404
379
  type AllowedVisibilityOperator = (typeof VISIBILITY_OPERATORS)[keyof typeof VISIBILITY_OPERATORS];
405
380
  declare const VISIBILITY_OPERATOR_OPTIONS: {
406
- value: AllowedVisibilityOperator;
407
- label: string;
408
- }[];
409
- /**
410
- * Unary operators that don't require a comparison value.
411
- * The UI hides the value input field when one of these is selected.
412
- */
413
- declare const OPERATORS_WITHOUT_VALUE: AllowedVisibilityOperator[];
414
- declare const VISIBILITY_ACTIONS: {
415
- readonly NONE: 'none';
416
- readonly SHOW: 'show';
417
- readonly HIDE: 'hide';
418
- };
419
- type AllowedVisibilityAction = (typeof VISIBILITY_ACTIONS)[keyof typeof VISIBILITY_ACTIONS];
420
- declare const VISIBILITY_ACTION_OPTIONS: {
421
- value: AllowedVisibilityAction;
422
381
  label: string;
382
+ value: AllowedVisibilityOperator;
423
383
  }[];
424
- /**
425
- * Defines when a node is conditionally shown or hidden based on
426
- * a template variable. Evaluated at render time by the renderer.
427
- */
428
384
  type VisibilityRule = {
429
385
  action: AllowedVisibilityAction;
430
- variable: string;
431
386
  operator: AllowedVisibilityOperator;
432
387
  value: string;
388
+ variable: string;
433
389
  };
434
- /** Mixin for nodes that support conditional visibility. */
435
390
  type WithVisibilityAttrs = {
436
391
  visibilityRule?: VisibilityRule | null;
437
392
  };
393
+ declare const DEFAULT_VISIBILITY_RULE: VisibilityRule;
394
+ declare function getVisibilityValueSupport(operator: AllowedVisibilityOperator): boolean;
395
+ type VisibilityRuleOptions = {
396
+ action: string | null | undefined;
397
+ operator: string | null | undefined;
398
+ value: string | null | undefined;
399
+ variable: string | null | undefined;
400
+ };
401
+ declare function getVisibilityRule(options: VisibilityRuleOptions): VisibilityRule | null;
438
402
  //#endregion
439
403
  //#region src/node.d.ts
440
- /**
441
- * Registry of all document node type strings. These map 1:1 to
442
- * Tiptap extension names and are used as discriminators in the
443
- * document JSON.
444
- */
445
404
  declare const MAILY_NODE_TYPES: {
446
405
  readonly DOCUMENT: 'doc';
447
- readonly PARAGRAPH: 'paragraph';
448
- readonly TEXT: 'text';
449
- readonly HEADING: 'heading';
450
- readonly VARIABLE: 'variable';
451
- readonly IMAGE: 'image';
452
- readonly SPACER: 'spacer';
406
+ readonly BODY: 'body';
407
+ readonly CONTAINER: 'container';
453
408
  readonly SECTION: 'section';
454
409
  readonly COLUMNS: 'columns';
455
410
  readonly COLUMN: 'column';
456
- readonly BULLET_LIST: 'bulletList';
457
- readonly ORDERED_LIST: 'orderedList';
458
- readonly LIST_ITEM: 'listItem';
459
- readonly HORIZONTAL_RULE: 'horizontalRule';
411
+ readonly IMAGE: 'image';
412
+ readonly INLINE_IMAGE: 'inlineImage';
413
+ readonly INLINE_SPAN: 'inlineSpan';
414
+ readonly SPACER: 'spacer';
460
415
  readonly BUTTON: 'button';
461
- readonly REPEAT: 'repeat';
462
- readonly HTML_CODE_BLOCK: 'htmlCodeBlock';
416
+ readonly FOOTER: 'footer';
417
+ readonly PARAGRAPH: 'paragraph';
418
+ readonly HEADING: 'heading';
463
419
  readonly BLOCKQUOTE: 'blockquote';
420
+ readonly HORIZONTAL_RULE: 'horizontalRule';
421
+ readonly HTML_CODE_BLOCK: 'htmlCodeBlock';
422
+ readonly REPEAT: 'repeat';
464
423
  readonly HARD_BREAK: 'hardBreak';
465
- readonly FOOTER: 'footer';
466
- readonly INLINE_IMAGE: 'inlineImage';
424
+ readonly BULLET_LIST: 'bulletList';
425
+ readonly ORDERED_LIST: 'orderedList';
426
+ readonly LIST_ITEM: 'listItem';
427
+ readonly TEXT: 'text';
428
+ readonly VARIABLE: 'variable';
429
+ readonly TABLE: 'table';
430
+ readonly TABLE_ROW: 'tableRow';
431
+ readonly TABLE_CELL: 'tableCell';
432
+ readonly TABLE_HEADER: 'tableHeader';
467
433
  readonly LINK_CARD: 'linkCard';
468
434
  };
469
- /**
470
- * Tiptap extension types that attach attributes to nodes but are
471
- * not document nodes themselves (e.g. fontStyle, visibility).
472
- */
473
435
  declare const MAILY_EXTENSION_TYPES: {
474
- readonly FONT_STYLE: 'fontStyle';
436
+ readonly STYLE: 'style';
437
+ readonly THEME: 'theme';
475
438
  readonly VISIBILITY: 'visibility';
476
439
  };
477
- declare const allowedNodeTypes: ("blockquote" | "bulletList" | "button" | "column" | "columns" | "doc" | "footer" | "hardBreak" | "heading" | "horizontalRule" | "htmlCodeBlock" | "image" | "inlineImage" | "linkCard" | "listItem" | "orderedList" | "paragraph" | "repeat" | "section" | "spacer" | "text" | "variable")[];
440
+ declare const allowedNodeTypes: ("blockquote" | "body" | "bulletList" | "button" | "column" | "columns" | "container" | "doc" | "footer" | "hardBreak" | "heading" | "horizontalRule" | "htmlCodeBlock" | "image" | "inlineImage" | "inlineSpan" | "linkCard" | "listItem" | "orderedList" | "paragraph" | "repeat" | "section" | "spacer" | "table" | "tableCell" | "tableHeader" | "tableRow" | "text" | "variable")[];
478
441
  type MailyNodeType = (typeof MAILY_NODE_TYPES)[keyof typeof MAILY_NODE_TYPES];
479
- /**
480
- * Global attributes mixed into every node by Tiptap extensions:
481
- * text direction, unique id, and conditional visibility.
482
- */
483
442
  type WithExtraAttrs = {
484
443
  dir?: TextDirection | null;
485
- id?: string | null;
486
- visibilityRule?: VisibilityRule | null;
487
444
  };
488
- /**
489
- * Base shape shared by all document nodes. Individual node types
490
- * narrow the type field, add typed attrs, and constrain content.
491
- */
492
445
  type BaseMailyNode = {
493
- type: MailyNodeType;
494
- attrs?: Record<string, any> & WithExtraAttrs;
446
+ attrs?: WithExtraAttrs & Record<string, unknown>;
495
447
  content?: AnyMailyNode[];
496
448
  marks?: AnyMailyMark[];
497
449
  text?: string;
450
+ type: MailyNodeType;
498
451
  };
499
- /** Document */
500
- type DocumentAttributes = {
452
+ type DocumentAttributes = WithExtraAttrs & {
453
+ theme?: NodeThemeOptions | null;
501
454
  version: number;
502
455
  };
503
456
  type DocumentNode = BaseMailyNode & {
504
- type: typeof MAILY_NODE_TYPES.DOCUMENT;
505
457
  attrs: DocumentAttributes;
506
- content: BaseMailyNode[];
458
+ content: AnyMailyNode[];
459
+ type: typeof MAILY_NODE_TYPES.DOCUMENT;
507
460
  };
508
- /** Paragraph */
509
- type ParagraphAttributes = {
510
- id: string;
511
- textAlign: AllowedTextAlignment;
512
- } & FontStyleAttributes;
513
- type ParagraphNode = BaseMailyNode & {
514
- type: typeof MAILY_NODE_TYPES.PARAGRAPH;
515
- attrs: ParagraphAttributes;
461
+ type BodyAttributes = WithExtraAttrs & {
462
+ style?: string | null;
516
463
  };
517
- /** Text */
518
- type TextNode = BaseMailyNode & {
519
- type: typeof MAILY_NODE_TYPES.TEXT;
520
- text: string;
464
+ type BodyNode = BaseMailyNode & {
465
+ attrs?: BodyAttributes;
466
+ content: AnyMailyNode[];
467
+ type: typeof MAILY_NODE_TYPES.BODY;
521
468
  };
522
- /** Heading */
523
- type HeadingLevel = 1 | 2 | 3;
524
- type HeadingAttributes = {
525
- id: string;
526
- level: HeadingLevel;
527
- } & FontStyleAttributes;
528
- type HeadingNode = BaseMailyNode & {
529
- type: typeof MAILY_NODE_TYPES.HEADING;
530
- attrs: HeadingAttributes;
469
+ type ContainerAttributes = WithExtraAttrs & {
470
+ style?: string | null;
531
471
  };
532
- /**
533
- * Variable
534
- * Attributes for a template variable node. The id and label must not
535
- * contain `|` characters — that delimiter is used when serializing
536
- * variable data to plain text (see serializeVariableToText).
537
- */
538
- type VariableAttributes = {
539
- /** Stored as `data-id`. Identifies which variable this node represents. */id: string | null; /** Stored as `data-label`. Display text shown in the editor instead of the id. */
540
- label?: string | null; /** Stored as `data-fallback`. Used when the variable has no value at render time. */
541
- fallback?: string | null;
542
- required?: boolean;
543
- hideDefaultValue?: boolean; /** The character that opens the variable suggestion popup (e.g. `@`). */
544
- variableSuggestionChar?: string;
472
+ type ContainerNode = BaseMailyNode & {
473
+ attrs?: ContainerAttributes;
474
+ content: AnyMailyNode[];
475
+ type: typeof MAILY_NODE_TYPES.CONTAINER;
545
476
  };
546
- type VariableNode = BaseMailyNode & {
547
- type: typeof MAILY_NODE_TYPES.VARIABLE;
548
- attrs: VariableAttributes;
549
- content: never;
477
+ type SectionAttributes = WithExtraAttrs & WithVisibilityAttrs & {
478
+ style?: string | null;
479
+ };
480
+ type SectionNode = BaseMailyNode & {
481
+ attrs?: SectionAttributes;
482
+ content: AnyMailyNode[];
483
+ type: typeof MAILY_NODE_TYPES.SECTION;
484
+ };
485
+ type RepeatAttributes = WithVisibilityAttrs & {
486
+ each: string;
487
+ };
488
+ type RepeatNode = BaseMailyNode & {
489
+ attrs: RepeatAttributes;
490
+ content: AnyMailyNode[];
491
+ type: typeof MAILY_NODE_TYPES.REPEAT;
492
+ };
493
+ type ColumnsAttributes = WithExtraAttrs & WithVisibilityAttrs & {
494
+ columnCount: number;
495
+ gap: number;
496
+ style?: string | null;
497
+ };
498
+ type ColumnsNode = BaseMailyNode & {
499
+ attrs: ColumnsAttributes;
500
+ content: ColumnNode[];
501
+ type: typeof MAILY_NODE_TYPES.COLUMNS;
502
+ };
503
+ type ColumnAttributes = WithExtraAttrs & {
504
+ verticalAlign: string;
505
+ width: ColumnWidth | null;
506
+ style?: string | null;
507
+ };
508
+ type ColumnNode = BaseMailyNode & {
509
+ attrs: ColumnAttributes;
510
+ content: AnyMailyNode[];
511
+ type: typeof MAILY_NODE_TYPES.COLUMN;
550
512
  };
551
- /** Image */
552
- type ImageAttributes = {
513
+ type ImageAttributes = WithExtraAttrs & WithVisibilityAttrs & {
514
+ align: AllowedTextAlignment;
515
+ alt?: string | null;
516
+ externalLink?: string | null;
553
517
  src: string;
554
- alt?: string;
555
- title?: string;
518
+ style?: string | null;
519
+ title?: string | null;
556
520
  width: string;
557
- align: AllowedTextAlignment;
558
- externalLink: string | null;
559
- } & BorderStyleConfig;
521
+ };
560
522
  type ImageNode = BaseMailyNode & {
561
- type: typeof MAILY_NODE_TYPES.IMAGE;
562
523
  attrs: ImageAttributes;
563
- content: never;
564
- };
565
- /** Spacer */
566
- type SpacerAttributes = {
567
- height: number;
568
- heightMode: AllowedFieldMode;
569
- };
570
- type SpacerNode = BaseMailyNode & {
571
- type: typeof MAILY_NODE_TYPES.SPACER;
572
- attrs: SpacerAttributes;
573
- content: never;
524
+ type: typeof MAILY_NODE_TYPES.IMAGE;
574
525
  };
575
- /** Section */
576
- type SectionAttributes = {
577
- backgroundColor: string;
526
+ type ButtonAttributes = WithExtraAttrs & WithVisibilityAttrs & {
578
527
  align: AllowedTextAlignment;
579
- } & BorderStyleConfig & PaddingStyleConfig & MarginStyleConfig;
580
- type SectionNode = BaseMailyNode & {
581
- type: typeof MAILY_NODE_TYPES.SECTION;
582
- attrs: SectionAttributes;
528
+ kind: AllowedButtonKind;
529
+ style?: string | null;
530
+ url: string;
531
+ };
532
+ type ButtonNode = BaseMailyNode & {
533
+ attrs: ButtonAttributes;
583
534
  content: AnyMailyNode[];
535
+ type: typeof MAILY_NODE_TYPES.BUTTON;
584
536
  };
585
- /** Bullet List */
586
- type BulletListAttributes = {
587
- id: string;
537
+ type FooterAttributes = WithExtraAttrs & {
538
+ style?: string | null;
588
539
  };
589
- type BulletListNode = BaseMailyNode & {
590
- type: typeof MAILY_NODE_TYPES.BULLET_LIST;
591
- attrs: BulletListAttributes;
540
+ type FooterNode = BaseMailyNode & {
541
+ attrs?: FooterAttributes;
592
542
  content: AnyMailyNode[];
543
+ type: typeof MAILY_NODE_TYPES.FOOTER;
593
544
  };
594
- /** Ordered List */
595
- type OrderedListAttributes = {
596
- id: string;
545
+ type InlineImageAttributes = WithExtraAttrs & {
546
+ alt?: string | null;
547
+ externalLink?: string | null;
548
+ height: number;
549
+ src: string;
550
+ style?: string | null;
551
+ title?: string | null;
552
+ width: number;
597
553
  };
598
- type OrderedListNode = BaseMailyNode & {
599
- type: typeof MAILY_NODE_TYPES.ORDERED_LIST;
600
- attrs: OrderedListAttributes;
601
- content: AnyMailyNode[];
554
+ type InlineImageNode = BaseMailyNode & {
555
+ attrs: InlineImageAttributes;
556
+ type: typeof MAILY_NODE_TYPES.INLINE_IMAGE;
602
557
  };
603
- /** List Item */
604
- type ListItemAttributes = {
605
- id: string;
558
+ type InlineSpanAttributes = WithExtraAttrs & {
559
+ style?: string | null;
606
560
  };
607
- type ListItemNode = BaseMailyNode & {
608
- type: typeof MAILY_NODE_TYPES.LIST_ITEM;
609
- attrs: ListItemAttributes;
610
- content: AnyMailyNode[];
561
+ type InlineSpanNode = BaseMailyNode & {
562
+ attrs?: InlineSpanAttributes;
563
+ type: typeof MAILY_NODE_TYPES.INLINE_SPAN;
564
+ };
565
+ type SpacerAttributes = WithExtraAttrs & WithVisibilityAttrs & {
566
+ height: number;
567
+ style?: string | null;
568
+ };
569
+ type SpacerNode = BaseMailyNode & {
570
+ attrs: SpacerAttributes;
571
+ type: typeof MAILY_NODE_TYPES.SPACER;
572
+ };
573
+ type ParagraphAttributes = WithExtraAttrs & WithVisibilityAttrs & {
574
+ style?: string | null;
575
+ };
576
+ type ParagraphNode = BaseMailyNode & {
577
+ attrs?: ParagraphAttributes;
578
+ type: typeof MAILY_NODE_TYPES.PARAGRAPH;
579
+ };
580
+ type HeadingLevel = 1 | 2 | 3;
581
+ type HeadingAttributes = WithExtraAttrs & WithVisibilityAttrs & {
582
+ level: HeadingLevel;
583
+ style?: string | null;
584
+ };
585
+ type HeadingNode = BaseMailyNode & {
586
+ attrs: HeadingAttributes;
587
+ type: typeof MAILY_NODE_TYPES.HEADING;
588
+ };
589
+ type BlockquoteAttributes = WithExtraAttrs & {
590
+ style?: string | null;
611
591
  };
612
- /** Blockquote */
613
- type BlockquoteAttributes = {
614
- id: string;
615
- } & FontStyleAttributes;
616
592
  type BlockquoteNode = BaseMailyNode & {
617
- type: typeof MAILY_NODE_TYPES.BLOCKQUOTE;
618
- attrs: BlockquoteAttributes;
593
+ attrs?: BlockquoteAttributes;
619
594
  content: AnyMailyNode[];
595
+ type: typeof MAILY_NODE_TYPES.BLOCKQUOTE;
620
596
  };
621
- /** Horizontal Rule */
622
- type HorizontalRuleAttributes = {
623
- id: string;
597
+ type HorizontalRuleAttributes = WithVisibilityAttrs & {
598
+ style?: string | null;
624
599
  };
625
600
  type HorizontalRuleNode = BaseMailyNode & {
601
+ attrs?: HorizontalRuleAttributes;
626
602
  type: typeof MAILY_NODE_TYPES.HORIZONTAL_RULE;
627
- attrs: HorizontalRuleAttributes;
628
- content: never;
629
603
  };
630
- /** Button */
631
- type ButtonAttributes = {
632
- url: string;
633
- kind: AllowedButtonKind;
634
- alignment: AllowedTextAlignment | null;
635
- backgroundColor: string | null;
636
- color: string | null;
637
- paddingMode: AllowedFieldMode;
638
- paddingTop: number;
639
- paddingRight: number;
640
- paddingBottom: number;
641
- paddingLeft: number;
642
- } & BorderStyleConfig & FontStyleAttributes;
643
- type ButtonNode = BaseMailyNode & {
644
- type: typeof MAILY_NODE_TYPES.BUTTON;
645
- attrs: ButtonAttributes;
604
+ type HardBreakNode = BaseMailyNode & {
605
+ type: typeof MAILY_NODE_TYPES.HARD_BREAK;
606
+ };
607
+ type BulletListAttributes = WithExtraAttrs & WithVisibilityAttrs & {
608
+ style?: string | null;
609
+ };
610
+ type BulletListNode = BaseMailyNode & {
611
+ attrs?: BulletListAttributes;
612
+ content: ListItemNode[];
613
+ type: typeof MAILY_NODE_TYPES.BULLET_LIST;
614
+ };
615
+ type OrderedListAttributes = WithExtraAttrs & WithVisibilityAttrs & {
616
+ start?: number;
617
+ style?: string | null;
618
+ };
619
+ type OrderedListNode = BaseMailyNode & {
620
+ attrs?: OrderedListAttributes;
621
+ content: ListItemNode[];
622
+ type: typeof MAILY_NODE_TYPES.ORDERED_LIST;
623
+ };
624
+ type ListItemAttributes = WithExtraAttrs & {
625
+ style?: string | null;
626
+ };
627
+ type ListItemNode = BaseMailyNode & {
628
+ attrs?: ListItemAttributes;
646
629
  content: AnyMailyNode[];
630
+ type: typeof MAILY_NODE_TYPES.LIST_ITEM;
647
631
  };
648
- /** HTML Code Block */
649
- type HtmlCodeBlockAttributes = {
632
+ type HtmlCodeBlockAttributes = WithExtraAttrs & WithVisibilityAttrs & {
650
633
  activeTab: AllowedHtmlCodeBlockTab;
651
634
  language: string;
635
+ style?: string | null;
652
636
  };
653
637
  type HtmlCodeBlockNode = BaseMailyNode & {
654
- type: typeof MAILY_NODE_TYPES.HTML_CODE_BLOCK;
655
638
  attrs: HtmlCodeBlockAttributes;
656
639
  content: AnyMailyNode[];
640
+ type: typeof MAILY_NODE_TYPES.HTML_CODE_BLOCK;
657
641
  };
658
- /** Repeat */
659
- type RepeatAttributes = {
660
- each: string;
661
- };
662
- type RepeatNode = BaseMailyNode & {
663
- type: typeof MAILY_NODE_TYPES.REPEAT;
664
- attrs: RepeatAttributes;
665
- content: AnyMailyNode[];
642
+ type TextNode = BaseMailyNode & {
643
+ marks?: AnyMailyMark[];
644
+ text: string;
645
+ type: typeof MAILY_NODE_TYPES.TEXT;
666
646
  };
667
- /** Columns (container for multiple columns) */
668
- type ColumnsAttributes = {
669
- columnCount: number;
670
- gap: number;
647
+ type VariableAttributes = WithExtraAttrs & {
648
+ fallback?: string | null;
649
+ /** @deprecated Use `isDefaultEditable` instead. */
650
+ hideDefaultValue?: boolean;
651
+ id: string;
652
+ isDefaultEditable?: boolean;
653
+ label?: string | null;
654
+ required?: boolean;
655
+ style?: string | null;
671
656
  };
672
- type ColumnsNode = BaseMailyNode & {
673
- type: typeof MAILY_NODE_TYPES.COLUMNS;
674
- attrs: ColumnsAttributes;
675
- content: ColumnNode[];
657
+ declare const DEFAULT_VARIABLE_ATTRIBUTES: {
658
+ fallback: null;
659
+ isDefaultEditable: true;
660
+ label: null;
661
+ required: true;
662
+ style: null;
676
663
  };
677
- /** Column (individual column within columns container) */
678
- type ColumnAttributes = {
679
- width: number | null;
680
- verticalAlign: 'top' | 'middle' | 'bottom';
664
+ type VariableNode = BaseMailyNode & {
665
+ attrs: VariableAttributes;
666
+ type: typeof MAILY_NODE_TYPES.VARIABLE;
681
667
  };
682
- type ColumnNode = BaseMailyNode & {
683
- type: typeof MAILY_NODE_TYPES.COLUMN;
684
- attrs: ColumnAttributes;
668
+ type TableAttributes = {
669
+ border?: number;
670
+ cellpadding?: number;
671
+ cellspacing?: number;
672
+ responsive: boolean;
673
+ style?: string | null;
674
+ };
675
+ type TableNode = BaseMailyNode & {
676
+ attrs: TableAttributes;
677
+ content: TableRowNode[];
678
+ type: typeof MAILY_NODE_TYPES.TABLE;
679
+ };
680
+ type TableRowAttributes = {
681
+ style?: string | null;
682
+ };
683
+ type TableRowNode = BaseMailyNode & {
684
+ attrs?: TableRowAttributes;
685
+ content: (TableCellNode | TableHeaderNode)[];
686
+ type: typeof MAILY_NODE_TYPES.TABLE_ROW;
687
+ };
688
+ type TableCellAttributes = {
689
+ colspan: number;
690
+ colwidth: number[] | null;
691
+ rowspan: number;
692
+ style?: string | null;
693
+ };
694
+ type TableCellNode = BaseMailyNode & {
695
+ attrs: TableCellAttributes;
685
696
  content: AnyMailyNode[];
697
+ type: typeof MAILY_NODE_TYPES.TABLE_CELL;
686
698
  };
687
- /** Hard Break */
688
- type HardBreakNode = BaseMailyNode & {
689
- type: typeof MAILY_NODE_TYPES.HARD_BREAK;
690
- content: never;
691
- };
692
- /** Footer */
693
- type FooterAttributes = {
694
- id: string;
695
- textAlign: AllowedTextAlignment;
696
- } & FontStyleAttributes;
697
- type FooterNode = BaseMailyNode & {
698
- type: typeof MAILY_NODE_TYPES.FOOTER;
699
- attrs: FooterAttributes;
700
- };
701
- /** Inline Image */
702
- type InlineImageAttributes = {
703
- src: string;
704
- alt?: string;
705
- title?: string;
706
- width: number;
707
- height: number;
708
- externalLink: string | null;
709
- };
710
- type InlineImageNode = BaseMailyNode & {
711
- type: typeof MAILY_NODE_TYPES.INLINE_IMAGE;
712
- attrs: InlineImageAttributes;
713
- content: never;
699
+ type TableHeaderAttributes = TableCellAttributes;
700
+ type TableHeaderNode = BaseMailyNode & {
701
+ attrs: TableHeaderAttributes;
702
+ content: AnyMailyNode[];
703
+ type: typeof MAILY_NODE_TYPES.TABLE_HEADER;
714
704
  };
715
- /** Link Card */
716
- type LinkCardAttributes = {
717
- title: string;
705
+ type LinkCardAttributes = WithExtraAttrs & WithVisibilityAttrs & {
706
+ badgeText: string;
718
707
  description: string;
708
+ image: string;
719
709
  link: string;
720
710
  linkTitle: string;
721
- image: string;
711
+ style?: string | null;
722
712
  subTitle: string;
723
- badgeText: string;
713
+ title: string;
724
714
  };
725
715
  type LinkCardNode = BaseMailyNode & {
726
- type: typeof MAILY_NODE_TYPES.LINK_CARD;
727
716
  attrs: LinkCardAttributes;
728
- content: never;
717
+ type: typeof MAILY_NODE_TYPES.LINK_CARD;
729
718
  };
730
- type AnyMailyNode = DocumentNode | ParagraphNode | TextNode | HeadingNode | VariableNode | ImageNode | SpacerNode | SectionNode | RepeatNode | ColumnsNode | ColumnNode | BulletListNode | OrderedListNode | ListItemNode | HorizontalRuleNode | ButtonNode | HtmlCodeBlockNode | BlockquoteNode | HardBreakNode | FooterNode | InlineImageNode | LinkCardNode;
731
- //#endregion
732
- //#region src/theme.d.ts
733
- /**
734
- * Shared theme properties used by both the editor and renderer.
735
- * Controls global styling for the body, container, buttons, links,
736
- * and font. Extended by EditorThemeOptions and RendererThemeOptions.
737
- */
738
- interface BaseThemeOptions {
739
- container?: Partial<{
740
- backgroundColor: string;
741
- maxWidth: number;
742
- minWidth: number;
743
- borderRadius: number;
744
- borderWidth: number;
745
- borderColor: string;
746
- paddingTop: number;
747
- paddingRight: number;
748
- paddingBottom: number;
749
- paddingLeft: number;
750
- }>;
751
- body?: Partial<{
752
- backgroundColor: string;
753
- paddingTop: number;
754
- paddingRight: number;
755
- paddingBottom: number;
756
- paddingLeft: number;
757
- }>;
758
- button?: Partial<{
759
- paddingTop: number;
760
- paddingRight: number;
761
- paddingBottom: number;
762
- paddingLeft: number;
763
- backgroundColor: string;
764
- color: string;
765
- }>;
766
- link?: Partial<{
767
- color: string;
768
- }>;
769
- font?: Pick<FontProps, 'fontFamily' | 'fallbackFontFamily' | 'webFont'> | null;
770
- listMarker?: Partial<{
771
- color: string;
772
- }>;
773
- }
774
- /**
775
- * Editor-specific theme. Currently identical to the base — the editor
776
- * does not yet support per-node color customization, which is why
777
- * it's kept separate from the renderer theme.
778
- */
779
- interface EditorThemeOptions extends BaseThemeOptions {}
780
- /** Per-node styling overrides in the renderer theme. */
781
- type NodeThemeEntry = Partial<{
782
- color: string;
783
- fontSize: number;
784
- lineHeight: number;
785
- fontWeight: number;
786
- }>;
787
- type HeadingLevelTheme = Partial<{
788
- fontSize: number;
789
- lineHeight: number;
790
- fontWeight: number;
791
- }>;
792
- /**
793
- * Renderer-specific theme. Extends the base with per-node styling
794
- * grouped by node type — each key corresponds to a node and contains
795
- * all relevant style properties for that node.
796
- */
797
- interface RendererThemeOptions extends BaseThemeOptions {
798
- paragraph?: NodeThemeEntry;
799
- heading?: Partial<{
800
- defaults: Partial<{
801
- color: string;
802
- }>;
803
- h1: HeadingLevelTheme;
804
- h2: HeadingLevelTheme;
805
- h3: HeadingLevelTheme;
806
- }>;
807
- footer?: NodeThemeEntry;
808
- blockquote?: NodeThemeEntry & Partial<{
809
- borderColor: string;
810
- fontStyle: FontStyleValue;
811
- }>;
812
- horizontalRule?: Partial<{
813
- color: string;
814
- }>;
815
- code?: Partial<{
816
- color: string;
817
- backgroundColor: string;
818
- }>;
819
- button?: BaseThemeOptions['button'] & Partial<{
820
- fontSize: number;
821
- lineHeight: number;
822
- fontWeight: number;
823
- }>;
824
- linkCard?: Partial<{
825
- titleColor: string;
826
- descriptionColor: string;
827
- badgeTextColor: string;
828
- badgeBackgroundColor: string;
829
- subTitleColor: string;
830
- borderColor: string;
831
- }>;
832
- }
833
- declare const DEFAULT_LINK_TEXT_COLOR = "#111827";
834
- declare const DEFAULT_RENDERER_THEME: RendererThemeOptions;
835
- declare const DEFAULT_EDITOR_THEME: EditorThemeOptions;
836
- /**
837
- * Resolves the baseline font defaults for a node type from the
838
- * renderer theme. Falls back to paragraph defaults for unknown types.
839
- */
840
- declare function getNodeFontStyleDefaults(nodeType: string, level?: HeadingLevel): NodeFontStyleDefaults;
841
- //#endregion
842
- //#region src/css-variables.d.ts
843
- declare module 'csstype' {
844
- interface Properties {
845
- [index: `--mly-${string}`]: any;
846
- }
847
- }
848
- /**
849
- * Returns a CSS variable object for the given name and value.
850
- * If the value is nullish or empty, returns an empty object so that
851
- * the default CSS variable value is not overridden. Numbers are
852
- * automatically suffixed with "px".
853
- */
854
- declare function getVariableValue(name: `--mly-${string}`, value: unknown): Properties;
855
- /**
856
- * Converts an EditorThemeOptions object into a flat map of Maily CSS
857
- * custom properties (--mly-*). Used to apply theme overrides as inline
858
- * styles on the editor or renderer root element. Covers body background,
859
- * container dimensions and borders, button colors, link color, and
860
- * font family settings.
861
- */
862
- declare function getMailyCssVariables(theme: EditorThemeOptions): Properties;
863
- //#endregion
864
- //#region src/image-width.d.ts
865
- /**
866
- * Represents an image width value — can be a pixel number, a percentage
867
- * string (e.g. "50%"), or the literal "auto" for full-width.
868
- */
869
- type ImageWidth = number | string;
870
- declare const MIN_IMAGE_WIDTH_PERCENTAGE = 5;
871
- declare const MAX_IMAGE_WIDTH_PERCENTAGE = 100;
872
- /**
873
- * Converts any ImageWidth value to a clamped percentage number.
874
- * Handles "auto" (→ 100), percentage strings (e.g. "50%" → 50),
875
- * and legacy pixel numbers (converted relative to maxWidthPixels).
876
- * Returns 100 for null or unrecognized values.
877
- */
878
- declare function parseWidthToPercentage(width: ImageWidth | null, maxWidthPixels?: number): number;
879
- declare function clampImageWidthPercentage(width: number): number;
880
- //#endregion
881
- //#region src/function.d.ts
882
- type Noop = () => void;
883
- /** A no-operation function. Useful as a default callback or placeholder. */
884
- declare function noop(): void;
885
- //#endregion
886
- //#region src/invariant.d.ts
887
- /**
888
- * Assertion function that throws if the value is false, null, or undefined.
889
- * Used as a development-time guard to catch impossible states early.
890
- * Logs a bug report URL before throwing to help with issue filing.
891
- */
892
- declare function invariant(value: boolean, message?: string): asserts value;
893
- declare function invariant<T>(value: T | null | undefined, message?: string): asserts value is T;
719
+ type AnyMailyNode = BodyNode | ContainerNode | BlockquoteNode | ButtonNode | ColumnNode | ColumnsNode | BulletListNode | DocumentNode | FooterNode | HardBreakNode | HeadingNode | ImageNode | InlineImageNode | InlineSpanNode | HorizontalRuleNode | HtmlCodeBlockNode | LinkCardNode | ListItemNode | OrderedListNode | ParagraphNode | RepeatNode | SectionNode | SpacerNode | TableCellNode | TableHeaderNode | TableNode | TableRowNode | TextNode | VariableNode;
894
720
  //#endregion
895
721
  //#region src/is.d.ts
896
- /**
897
- * Type guards for Maily nodes and marks. Provides narrowing functions
898
- * for every node type (is.paragraph, is.button, etc.) and mark type
899
- * (is.bold, is.link, etc.), plus structural checks like is.parent
900
- * and is.marked. Each guard narrows the input to its specific type.
901
- *
902
- * Example:
903
- * if (is.paragraph(node)) {
904
- * node.attrs.textAlign // narrowed to ParagraphNode
905
- * }
906
- */
722
+ declare function isObject(val: unknown): val is object;
907
723
  declare const is: {
908
- any(value: unknown): value is AnyMailyNode | AnyMailyMark;
724
+ node(value: unknown): value is AnyMailyNode;
725
+ mark(value: unknown): value is AnyMailyMark;
909
726
  parent(node: AnyMailyNode): node is AnyMailyNode & {
910
727
  content: AnyMailyNode[];
911
728
  };
912
729
  marked(node: AnyMailyNode): node is AnyMailyNode & {
913
730
  marks: AnyMailyMark[];
914
731
  };
915
- node(node: unknown): node is AnyMailyNode;
916
- doc: (node: AnyMailyNode | AnyMailyMark) => node is DocumentNode;
917
- paragraph: (node: AnyMailyNode | AnyMailyMark) => node is ParagraphNode;
918
- text: (node: AnyMailyNode | AnyMailyMark) => node is TextNode;
919
- heading: (node: AnyMailyNode | AnyMailyMark) => node is HeadingNode;
920
- variable: (node: AnyMailyNode | AnyMailyMark) => node is VariableNode;
921
- image: (node: AnyMailyNode | AnyMailyMark) => node is ImageNode;
922
- inlineImage: (node: AnyMailyNode | AnyMailyMark) => node is InlineImageNode;
923
- spacer: (node: AnyMailyNode | AnyMailyMark) => node is SpacerNode;
924
- section: (node: AnyMailyNode | AnyMailyMark) => node is SectionNode;
925
- button: (node: AnyMailyNode | AnyMailyMark) => node is ButtonNode;
926
- columns: (node: AnyMailyNode | AnyMailyMark) => node is ColumnsNode;
927
- column: (node: AnyMailyNode | AnyMailyMark) => node is ColumnNode;
928
- repeat: (node: AnyMailyNode | AnyMailyMark) => node is RepeatNode;
929
- bulletList: (node: AnyMailyNode | AnyMailyMark) => node is BulletListNode;
930
- orderedList: (node: AnyMailyNode | AnyMailyMark) => node is OrderedListNode;
931
- listItem: (node: AnyMailyNode | AnyMailyMark) => node is ListItemNode;
932
- horizontalRule: (node: AnyMailyNode | AnyMailyMark) => node is HorizontalRuleNode;
933
- htmlCodeBlock: (node: AnyMailyNode | AnyMailyMark) => node is HtmlCodeBlockNode;
934
- blockquote: (node: AnyMailyNode | AnyMailyMark) => node is BlockquoteNode;
935
- hardBreak: (node: AnyMailyNode | AnyMailyMark) => node is HardBreakNode;
936
- footer: (node: AnyMailyNode | AnyMailyMark) => node is FooterNode;
937
- linkCard: (node: AnyMailyNode | AnyMailyMark) => node is LinkCardNode;
938
- mark(mark: unknown): mark is AnyMailyMark;
939
- bold: (node: AnyMailyNode | AnyMailyMark) => node is BoldMark;
940
- italic: (node: AnyMailyNode | AnyMailyMark) => node is ItalicMark;
941
- strike: (node: AnyMailyNode | AnyMailyMark) => node is StrikeMark;
942
- underline: (node: AnyMailyNode | AnyMailyMark) => node is UnderlineMark;
943
- link: (node: AnyMailyNode | AnyMailyMark) => node is LinkMark;
944
- code: (node: AnyMailyNode | AnyMailyMark) => node is CodeMark;
945
- textStyle: (node: AnyMailyNode | AnyMailyMark) => node is TextStyleMark;
946
- highlight: (node: AnyMailyNode | AnyMailyMark) => node is HighlightMark;
947
- };
948
- /** Type guard that checks if a value is defined (not null or undefined). */
949
- declare function isDef<T = any>(val?: T | null): val is T;
950
- /** Type guard that checks if a value is a boolean. */
951
- declare function isBoolean(val: any): val is boolean;
952
- /** Type guard that checks if a value is a number. */
953
- declare function isNumber(val: any): val is number;
954
- /** Type guard that checks if a value is a string. */
955
- declare function isString(val: unknown): val is string;
956
- /** Type guard that checks if a value is a non-null object. */
957
- declare function isObject(val: unknown): val is object;
732
+ doc: (value: AnyMailyNode | AnyMailyMark) => value is DocumentNode;
733
+ body: (value: AnyMailyNode | AnyMailyMark) => value is BodyNode;
734
+ container: (value: AnyMailyNode | AnyMailyMark) => value is ContainerNode;
735
+ section: (value: AnyMailyNode | AnyMailyMark) => value is SectionNode;
736
+ columns: (value: AnyMailyNode | AnyMailyMark) => value is ColumnsNode;
737
+ column: (value: AnyMailyNode | AnyMailyMark) => value is ColumnNode;
738
+ image: (value: AnyMailyNode | AnyMailyMark) => value is ImageNode;
739
+ inlineImage: (value: AnyMailyNode | AnyMailyMark) => value is InlineImageNode;
740
+ inlineSpan: (value: AnyMailyNode | AnyMailyMark) => value is InlineSpanNode;
741
+ spacer: (value: AnyMailyNode | AnyMailyMark) => value is SpacerNode;
742
+ button: (value: AnyMailyNode | AnyMailyMark) => value is ButtonNode;
743
+ footer: (value: AnyMailyNode | AnyMailyMark) => value is FooterNode;
744
+ paragraph: (value: AnyMailyNode | AnyMailyMark) => value is ParagraphNode;
745
+ heading: (value: AnyMailyNode | AnyMailyMark) => value is HeadingNode;
746
+ blockquote: (value: AnyMailyNode | AnyMailyMark) => value is BlockquoteNode;
747
+ horizontalRule: (value: AnyMailyNode | AnyMailyMark) => value is HorizontalRuleNode;
748
+ hardBreak: (value: AnyMailyNode | AnyMailyMark) => value is HardBreakNode;
749
+ htmlCodeBlock: (value: AnyMailyNode | AnyMailyMark) => value is HtmlCodeBlockNode;
750
+ repeat: (value: AnyMailyNode | AnyMailyMark) => value is RepeatNode;
751
+ bulletList: (value: AnyMailyNode | AnyMailyMark) => value is BulletListNode;
752
+ orderedList: (value: AnyMailyNode | AnyMailyMark) => value is OrderedListNode;
753
+ listItem: (value: AnyMailyNode | AnyMailyMark) => value is ListItemNode;
754
+ linkCard: (value: AnyMailyNode | AnyMailyMark) => value is LinkCardNode;
755
+ text: (value: AnyMailyNode | AnyMailyMark) => value is TextNode;
756
+ variable: (value: AnyMailyNode | AnyMailyMark) => value is VariableNode;
757
+ table: (value: AnyMailyNode | AnyMailyMark) => value is TableNode;
758
+ tableRow: (value: AnyMailyNode | AnyMailyMark) => value is TableRowNode;
759
+ tableCell: (value: AnyMailyNode | AnyMailyMark) => value is TableCellNode;
760
+ tableHeader: (value: AnyMailyNode | AnyMailyMark) => value is TableHeaderNode;
761
+ bold: (value: AnyMailyNode | AnyMailyMark) => value is BoldMark;
762
+ italic: (value: AnyMailyNode | AnyMailyMark) => value is ItalicMark;
763
+ strike: (value: AnyMailyNode | AnyMailyMark) => value is StrikeMark;
764
+ underline: (value: AnyMailyNode | AnyMailyMark) => value is UnderlineMark;
765
+ link: (value: AnyMailyNode | AnyMailyMark) => value is LinkMark;
766
+ code: (value: AnyMailyNode | AnyMailyMark) => value is CodeMark;
767
+ textStyle: (value: AnyMailyNode | AnyMailyMark) => value is TextStyleMark;
768
+ highlight: (value: AnyMailyNode | AnyMailyMark) => value is HighlightMark;
769
+ span: (value: AnyMailyNode | AnyMailyMark) => value is SpanMark;
770
+ };
771
+ declare function isDef<T>(value: T | null | undefined): value is T;
958
772
  //#endregion
959
773
  //#region src/math.d.ts
960
774
  declare function clamp(value: number, [min, max]: [number, number]): number;
961
775
  declare function percentage(portion: number, total: number): number;
962
- declare function absoluteFromPercentage(percentage: number, total: number): number;
963
776
  declare function roundTo(value: number, decimals: number): number;
777
+ declare function absoluteFromPercentage(percentage: number, total: number): number;
964
778
  //#endregion
965
779
  //#region src/object.d.ts
780
+ declare function isMergeableObject(value: unknown): value is Record<string, unknown>;
966
781
  /**
967
782
  * One-level deep merge of plain objects. Nested plain objects are
968
783
  * shallow-merged; primitives, arrays, and null are replaced outright.
@@ -973,47 +788,33 @@ declare function roundTo(value: number, decimals: number): number;
973
788
  * // => { a: 1, nested: { x: 1, y: 3 } }
974
789
  */
975
790
  declare function deepMerge<T extends object>(target: T, ...sources: Partial<T>[]): T;
976
- declare function isObjectDeepEqual(first: object, second: object): boolean;
977
791
  //#endregion
978
- //#region src/promise.d.ts
979
- /** Returns a promise that resolves after the given number of milliseconds. */
980
- declare function sleep(ms: number): Promise<void>;
792
+ //#region src/spacing.d.ts
793
+ declare const BLOCK_CONTAINER_TYPES: string[];
794
+ declare const MARGIN_TOP_ABSORBER_TYPES: string[];
795
+ declare const MARGIN_BOTTOM_ABSORBER_TYPES: string[];
796
+ type NodePosition = {
797
+ isFirst: boolean;
798
+ isLast: boolean;
799
+ nextType?: string | undefined;
800
+ parentType?: string | undefined;
801
+ previousType?: string | undefined;
802
+ };
803
+ declare function getSuppressedMargins(position: NodePosition): {
804
+ marginBottom: boolean;
805
+ marginTop: boolean;
806
+ };
981
807
  //#endregion
982
808
  //#region src/variable.d.ts
983
- /** Default opening delimiter for variable placeholders in text. */
984
809
  declare const DEFAULT_VARIABLE_START_TRIGGER = "{{";
985
- /** Default closing delimiter for variable placeholders in text. */
986
810
  declare const DEFAULT_VARIABLE_END_TRIGGER = "}}";
987
- /**
988
- * Regex that matches variable placeholders like {{name}} in a string.
989
- * Uses a non-greedy match to handle multiple variables in one string.
990
- */
991
- declare const VARIABLE_PLACEHOLDER_REGEX: RegExp;
992
- /**
993
- * Delimiter used between fields inside a serialized variable string.
994
- * Format: {{id|label|required|hideDefaultValue}}.
995
- */
996
- declare const VARIABLE_TEXT_DELIMITER = "|";
997
- /**
998
- * Serializes a variable node's attributes into a delimited string.
999
- * Output format: `{{id|label|required|hideDefaultValue}}`.
1000
- * Used to represent structured variable data as a template string
1001
- * in plain text contexts.
1002
- */
1003
811
  declare function serializeVariableToText(variable: VariableAttributes): string;
1004
- /**
1005
- * Deserializes a variable string back into VariableAttributes.
1006
- * Expected input format: `{{id|label|required|hideDefaultValue}}`.
1007
- * Missing fields default to undefined; boolean fields are parsed
1008
- * from "true"/"false" strings.
1009
- */
1010
812
  declare function deserializeVariableFromText(text: string): VariableAttributes;
1011
- /**
1012
- * Parses a string containing variable placeholders (e.g. "Hello {{name}}")
1013
- * into a Tiptap-compatible document JSON with text and variable nodes.
1014
- * Splits on {{...}} boundaries and creates the appropriate node type
1015
- * for each segment.
1016
- */
813
+ type VariableSegment = {
814
+ isReference: boolean;
815
+ text: string;
816
+ };
817
+ declare function getVariableSegments(content: string): VariableSegment[];
1017
818
  declare function buildDocFromVariableText(content: string): {
1018
819
  type: "doc";
1019
820
  content: {
@@ -1029,12 +830,7 @@ declare function buildDocFromVariableText(content: string): {
1029
830
  })[];
1030
831
  }[];
1031
832
  };
1032
- /**
1033
- * Checks if a string contains at least one variable placeholder.
1034
- * Returns true for strings like "Hello {{name}}", false for plain text.
1035
- * Uses index-based scanning instead of regex for performance.
1036
- */
1037
833
  declare function hasVariableInText(text: string): boolean;
1038
834
  //#endregion
1039
- export { AllowedBorderStyle, AllowedButtonKind, AllowedFieldMode, AllowedHtmlCodeBlockTab, AllowedTextAlignment, AllowedVisibilityAction, AllowedVisibilityOperator, AnyMailyMark, AnyMailyNode, BORDER_STYLES, BUTTON_KINDS, BaseMailyMark, BaseMailyNode, BaseThemeOptions, BlockquoteAttributes, BlockquoteNode, BoldMark, BorderStyleConfig, BulletListAttributes, BulletListNode, ButtonAttributes, ButtonNode, CodeAttributes, CodeMark, ColumnAttributes, ColumnNode, ColumnsAttributes, ColumnsNode, DATA_NODE_TYPE_KEY, DATA_VISIBILITY_RULE_KEY, DEFAULT_BORDER_COLOR, DEFAULT_BORDER_STYLE, DEFAULT_BUTTON_KIND, DEFAULT_EDITOR_THEME, DEFAULT_FONT, DEFAULT_FONT_FALLBACK, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FONT_WEIGHT, DEFAULT_HTML_CODE_BLOCK_TAB, DEFAULT_LINE_HEIGHT, DEFAULT_LINK_TEXT_COLOR, DEFAULT_RENDERER_THEME, DEFAULT_TEXT_ALIGN, DEFAULT_TEXT_DIRECTION, DEFAULT_VARIABLE_END_TRIGGER, DEFAULT_VARIABLE_START_TRIGGER, DocumentAttributes, DocumentNode, EditorThemeOptions, FIELD_MODE, FONT_SIZE_PRESETS, FONT_STYLES, FONT_WEIGHTS, FallbackFont, FontFamily, FontFamilyItem, FontFormat, FontProps, FontStyleAttributes, FontStyleValue, FontWeight, FooterAttributes, FooterNode, HTML_CODE_BLOCK_TABS, HardBreakNode, HeadingAttributes, HeadingLevel, HeadingLevelTheme, HeadingNode, HighlightAttributes, HighlightMark, HorizontalRuleAttributes, HorizontalRuleNode, HtmlCodeBlockAttributes, HtmlCodeBlockNode, ImageAttributes, ImageNode, ImageWidth, InlineImageAttributes, InlineImageNode, ItalicMark, LINE_HEIGHT_PRESETS, LinkAttributes, LinkCardAttributes, LinkCardNode, LinkMark, ListItemAttributes, ListItemNode, MAILY_BUG_REPORT_URL, MAILY_ERROR_PREFIX, MAILY_EXTENSION_TYPES, MAILY_MARK_TYPES, MAILY_NODE_TYPES, MAX_IMAGE_WIDTH_PERCENTAGE, MIN_IMAGE_WIDTH_PERCENTAGE, MailyMarkType, MailyNodeType, MarginStyleConfig, NodeFontStyleDefaults, NodeThemeEntry, Noop, OPERATORS_WITHOUT_VALUE, OrderedListAttributes, OrderedListNode, PaddingStyleConfig, ParagraphAttributes, ParagraphNode, RendererThemeOptions, RepeatAttributes, RepeatNode, SectionAttributes, SectionNode, SpacerAttributes, SpacerNode, StrikeMark, TEXT_ALIGNMENTS, TEXT_DIRECTIONS, TextDirection, TextNode, TextStyleAttributes, TextStyleMark, UnderlineMark, VARIABLE_PLACEHOLDER_REGEX, VARIABLE_TEXT_DELIMITER, VISIBILITY_ACTIONS, VISIBILITY_ACTION_OPTIONS, VISIBILITY_OPERATORS, VISIBILITY_OPERATOR_OPTIONS, VariableAttributes, VariableNode, VisibilityRule, WithExtraAttrs, WithVisibilityAttrs, absoluteFromPercentage, allowedButtonKinds, allowedFallbackFonts, allowedFieldModes, allowedFontFormats, allowedMarkTypes, allowedNodeTypes, allowedTextAligns, allowedTextDirections, buildDocFromVariableText, clamp, clampImageWidthPercentage, deepMerge, deserializeVariableFromText, getBorderStyle, getCssDirection, getFontFaceStyle, getFontStyle, getMailyCssVariables, getMarginStyle, getNodeFontStyleDefaults, getPaddingStyle, getVariableValue, hasVariableInText, invariant, is, isAllowedButtonKind, isAllowedFieldMode, isAllowedTextAlignment, isAllowedTextDirection, isBoolean, isDef, isNumber, isObject, isObjectDeepEqual, isString, loadFont, noop, parseWidthToPercentage, percentage, roundTo, serializeVariableToText, sleep };
835
+ export { AllowedBorderStyle, AllowedButtonKind, AllowedHtmlCodeBlockTab, AllowedTextAlignment, AllowedVisibilityAction, AllowedVisibilityOperator, AnyMailyMark, AnyMailyNode, BASIC_NODE_THEME, BLOCK_CONTAINER_TYPES, BORDER_STYLES, BOX_CORNERS, BOX_SIDES, BUTTON_KINDS, BaseMailyMark, BaseMailyNode, BlockquoteAttributes, BlockquoteNode, BodyAttributes, BodyNode, BoldMark, BorderParts, BoxCorner, BoxCornerValues, BoxSide, BoxSideValues, BulletListAttributes, BulletListNode, ButtonAttributes, ButtonNode, CodeMark, ColumnAttributes, ColumnNode, ColumnWidth, ColumnsAttributes, ColumnsNode, ContainerAttributes, ContainerNode, DATA_NODE_TYPE_KEY, DEFAULT_BORDER_STYLE, DEFAULT_BUTTON_KIND, DEFAULT_CONTAINER_MAX_WIDTH, DEFAULT_CONTAINER_WIDTH_PIXELS, DEFAULT_FONT, DEFAULT_FONT_FALLBACK, DEFAULT_FONT_FAMILIES, DEFAULT_FONT_FAMILY, DEFAULT_HTML_CODE_BLOCK_TAB, DEFAULT_TEXT_ALIGN, DEFAULT_TEXT_DIRECTION, DEFAULT_VARIABLE_ATTRIBUTES, DEFAULT_VARIABLE_END_TRIGGER, DEFAULT_VARIABLE_START_TRIGGER, DEFAULT_VISIBILITY_RULE, DocumentAttributes, DocumentNode, ExtendNodeThemeOptions, FONT_SIZE_PRESETS, FONT_STYLES, FONT_WEIGHTS, FallbackFont, FontFamily, FontFamilyItem, FontFamilyValueOptions, FontFormat, FontProps, FontStyleValue, FontWeight, FooterAttributes, FooterNode, HTML_CODE_BLOCK_TABS, HardBreakNode, HeadingAttributes, HeadingLevel, HeadingNode, HighlightAttributes, HighlightMark, HorizontalRuleAttributes, HorizontalRuleNode, HtmlCodeBlockAttributes, HtmlCodeBlockNode, ImageAttributes, ImageNode, ImageWidth, InlineImageAttributes, InlineImageNode, InlineSpanAttributes, InlineSpanNode, InlineStyle, ItalicMark, LINE_HEIGHT_PRESETS, LinkAttributes, LinkCardAttributes, LinkCardNode, LinkMark, ListItemAttributes, ListItemNode, MAILY_BUG_REPORT_URL, MAILY_ERROR_PREFIX, MAILY_EXTENSION_TYPES, MAILY_MARK_TYPES, MAILY_NODE_THEME, MAILY_NODE_TYPES, MARGIN_BOTTOM_ABSORBER_TYPES, MARGIN_TOP_ABSORBER_TYPES, MAX_IMAGE_WIDTH_PERCENTAGE, MIN_IMAGE_WIDTH_PERCENTAGE, MailyMarkType, MailyNodeType, MarkStyleAttributes, NodePosition, NodeThemeOptions, OrderedListAttributes, OrderedListNode, ParagraphAttributes, ParagraphNode, RepeatAttributes, RepeatNode, SectionAttributes, SectionNode, SpacerAttributes, SpacerNode, SpanMark, StrikeMark, TEXT_ALIGNMENTS, TEXT_DIRECTIONS, TableAttributes, TableCellAttributes, TableCellNode, TableHeaderAttributes, TableHeaderNode, TableNode, TableRowAttributes, TableRowNode, TextDirection, TextNode, TextStyleAttributes, TextStyleMark, ThemeDeclarationsOptions, UnderlineMark, VISIBILITY_ACTIONS, VISIBILITY_ACTION_OPTIONS, VISIBILITY_OPERATORS, VISIBILITY_OPERATOR_OPTIONS, VariableAttributes, VariableNode, VisibilityRule, WithExtraAttrs, WithVisibilityAttrs, absoluteFromPercentage, allowedFallbackFonts, allowedMarkTypes, allowedNodeTypes, buildDocFromVariableText, clamp, clampImageWidthPercentage, deepMerge, deserializeVariableFromText, expandInlineStyles, extendNodeTheme, getBorderParts, getBoxCorners, getBoxSides, getColumnWidth, getColumnWidthPercent, getColumnWidthValue, getCssDirection, getFontFaceStyle, getFontFamilyNames, getFontFamilyValue, getSuppressedMargins, getThemeDeclarations, getVariableSegments, getVisibilityRule, getVisibilityValueSupport, hasVariableInText, invariant, is, isAllowedBorderStyle, isAllowedButtonKind, isAllowedTextAlignment, isDef, isMergeableObject, isObject, loadFont, mergeInlineStyles, noop, parseInlineStyles, parseWidthToPercentage, percentage, roundTo, serializeVariableToText, stringifyInlineStyles, toBoxCorners, toBoxSides };
1040
836
  //# sourceMappingURL=index.d.mts.map