@standhigher/react-email-editor 0.2.0 → 0.4.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode } from 'react';
2
+ import { ReactNode, ComponentType, InputHTMLAttributes, ButtonHTMLAttributes } from 'react';
3
3
 
4
4
  declare const TEXT_ALIGNS: {
5
5
  readonly left: "left";
@@ -7,17 +7,20 @@ declare const TEXT_ALIGNS: {
7
7
  readonly right: "right";
8
8
  readonly justify: "justify";
9
9
  };
10
+ /** Text alignment: left, center, right, justify. */
10
11
  type TextAlign = (typeof TEXT_ALIGNS)[keyof typeof TEXT_ALIGNS];
11
12
  declare const HORIZONTAL_ALIGNS: {
12
13
  readonly left: "left";
13
14
  readonly center: "center";
14
15
  readonly right: "right";
15
16
  };
17
+ /** Element alignment: left, center, right. */
16
18
  type HorizontalAlign = (typeof HORIZONTAL_ALIGNS)[keyof typeof HORIZONTAL_ALIGNS];
17
19
  declare const FONT_WEIGHTS: {
18
20
  readonly normal: "normal";
19
21
  readonly bold: "bold";
20
22
  };
23
+ /** Font weight: normal or bold. */
21
24
  type FontWeight = (typeof FONT_WEIGHTS)[keyof typeof FONT_WEIGHTS];
22
25
  declare const BORDER_STYLES: {
23
26
  readonly none: "none";
@@ -25,306 +28,683 @@ declare const BORDER_STYLES: {
25
28
  readonly dashed: "dashed";
26
29
  readonly dotted: "dotted";
27
30
  };
31
+ /** Border style: none, solid, dashed, dotted. */
28
32
  type BorderStyle = (typeof BORDER_STYLES)[keyof typeof BORDER_STYLES];
29
33
  declare const LINK_DECORATIONS: {
30
34
  readonly underline: "underline";
31
35
  readonly none: "none";
32
36
  };
37
+ /** Link decoration: underline or none. */
33
38
  type LinkDecoration = (typeof LINK_DECORATIONS)[keyof typeof LINK_DECORATIONS];
34
39
 
35
- declare const DOCUMENT_VERSION: 2;
36
- declare const FONT_FAMILIES: readonly FieldOption[];
37
- declare const DEFAULT_EMAIL_GLOBAL: EmailGlobalSettings;
40
+ declare const DOCUMENT_VERSION: 4;
41
+ declare const FONT_FAMILIES: readonly ControlOption[];
42
+ declare const DEFAULT_EMAIL_BODY: EmailBodySettings;
38
43
 
39
- interface EmailGlobalSettings {
44
+ /** Email body layout and inherited defaults. */
45
+ interface EmailBodySettings {
46
+ /** Default text color. */
40
47
  textColor: string;
41
- textAlign: TextAlign;
48
+ /** Centered content background; outer area is white. */
42
49
  backgroundColor: string;
50
+ /** Maximum content width in px, normalized to an integer from 320 to 900. */
43
51
  contentWidth: number;
44
- contentAlign: HorizontalAlign;
52
+ /** Default CSS font stack. */
45
53
  fontFamily: string;
54
+ /** Default font weight: normal or bold. */
46
55
  fontWeight: FontWeight;
47
- contentBackgroundColor: string;
48
- contentPadding: string;
49
- outerPadding: string;
50
- blockGap: string;
51
- defaultFontSize: string;
52
- defaultLineHeight: string;
53
- paragraphSpacing: string;
54
- listSpacing: string;
55
- listIndent: string;
56
+ /** Color of links without explicit formatting. */
56
57
  linkColor: string;
58
+ /** Default link decoration: underline or none. */
57
59
  linkDecoration: LinkDecoration;
60
+ /** CSS padding inside the content border. */
61
+ contentPadding: string;
62
+ /** CSS length between adjacent blocks. */
63
+ blockGap: string;
64
+ /** Content container border width. */
58
65
  borderWidth: string;
66
+ /** Content border style. */
59
67
  borderStyle: BorderStyle;
68
+ /** Content border color. */
60
69
  borderColor: string;
61
- borderRadius: string;
62
70
  }
71
+ /** Persistable email document; only v4 is supported. */
63
72
  interface EmailDocument {
73
+ /** Format version; must be DOCUMENT_VERSION (4). */
64
74
  version: typeof DOCUMENT_VERSION;
75
+ /** Optional subject, separate from exported HTML content. */
65
76
  subject?: string;
66
- global: EmailGlobalSettings;
77
+ /** Complete body layout and style settings. */
78
+ body: EmailBodySettings;
79
+ /** Blocks in display and export order. */
67
80
  blocks: EmailBlockNode[];
68
81
  }
82
+ /** Persisted block node without components or render functions. */
69
83
  interface EmailBlockNode {
84
+ /** Unique block identifier within the document. */
70
85
  id: string;
86
+ /** Registered plugin type. */
71
87
  type: string;
72
- fields: Record<string, unknown>;
88
+ /** Control values keyed by the plugin schema. */
89
+ controls: Record<string, unknown>;
90
+ /** Enabled block style overrides. */
73
91
  style?: EmailBlockStyle;
92
+ /** Block preview data taking precedence over global data in a shallow merge. */
74
93
  defaultData?: Record<string, unknown>;
75
94
  }
95
+ /** Container or element appearance. */
76
96
  interface EmailDecorationStyle {
97
+ /** Background color. */
77
98
  backgroundColor?: string;
99
+ /** CSS border radius. */
78
100
  borderRadius?: string;
101
+ /** CSS border width. */
79
102
  borderWidth?: string;
103
+ /** Border color. */
80
104
  borderColor?: string;
105
+ /** Border line style. */
81
106
  borderStyle?: BorderStyle;
82
107
  }
108
+ /** Typography explicitly enabled by custom blocks. */
83
109
  interface EmailTypographyStyle {
110
+ /** CSS font stack. */
84
111
  fontFamily?: string;
112
+ /** CSS font size. */
85
113
  fontSize?: string;
114
+ /** Font weight. */
86
115
  fontWeight?: FontWeight;
116
+ /** Line height, including unitless multipliers. */
87
117
  lineHeight?: string;
118
+ /** Text color. */
88
119
  color?: string;
120
+ /** Horizontal text alignment. */
89
121
  textAlign?: TextAlign;
122
+ /** Paragraph spacing. */
90
123
  paragraphSpacing?: string;
124
+ /** List item spacing. */
91
125
  listSpacing?: string;
126
+ /** List indentation. */
92
127
  listIndent?: string;
128
+ /** Default link color. */
93
129
  linkColor?: string;
130
+ /** Default link decoration. */
94
131
  linkDecoration?: LinkDecoration;
95
132
  }
96
- /** 按钮、图片和分割线自身的样式,与区块容器样式独立。 */
133
+ /** Button, image or divider styles, including appearance fields. */
97
134
  interface EmailElementStyle extends EmailDecorationStyle {
135
+ /** Element CSS padding. */
98
136
  padding?: string;
137
+ /** Element CSS width. */
99
138
  width?: string;
139
+ /** Element CSS height. */
100
140
  height?: string;
141
+ /** Element horizontal alignment within its container. */
101
142
  align?: HorizontalAlign;
102
143
  }
144
+ /** Block container dimensions and spacing. */
103
145
  interface EmailSpacingStyle {
146
+ /** Container padding. */
104
147
  padding?: string;
148
+ /** Container outer spacing. */
105
149
  margin?: string;
106
- /** 自定义区块可通过 styleFields 启用;内置区块不支持。只使用 px。 */
150
+ /** Fixed height in px for enabled custom blocks; unsupported by builtins. */
107
151
  height?: string;
108
152
  }
153
+ /** Grouped styles; only plugin-enabled controls are read. */
109
154
  interface EmailBlockStyle {
155
+ /** Container dimensions and spacing. */
110
156
  dimension?: EmailSpacingStyle;
111
- /** 自定义区块可显式启用;内置区块的文字格式存于 fields.html。 */
157
+ /** Optional custom typography; builtin text formatting lives in controls.html. */
112
158
  typography?: EmailTypographyStyle;
159
+ /** Block container appearance. */
113
160
  decorations?: EmailDecorationStyle;
161
+ /** Styles of the button, image or other inner element. */
114
162
  element?: EmailElementStyle;
115
163
  }
116
164
 
117
- type FieldType = "text" | "textarea" | "html" | "url" | "number" | "color" | "select";
118
- interface FieldOption {
165
+ /** Select or alignment control option. */
166
+ interface ControlOption {
167
+ /** Display label. */
119
168
  label: string;
169
+ /** Persisted option value. */
120
170
  value: string;
121
171
  }
122
- interface FieldConfig {
123
- type: FieldType;
172
+ /** Named runtime control definition. */
173
+ interface ControlConfig extends ControlDefinition {
174
+ /** Key in the controls object. */
124
175
  name: string;
125
- label: string;
126
- defaultValue?: unknown;
127
- placeholder?: string;
128
- options?: FieldOption[];
129
- rows?: number;
130
- min?: number;
131
- max?: number;
132
- step?: number;
133
176
  }
177
+ /** Inspector group identifier. */
134
178
  type StyleGroup = "general" | "dimension" | "typography" | "decorations";
179
+ /** Union of style input kinds. */
135
180
  type StyleControlType = "text" | "color" | "alignment" | "select" | "number" | "range" | "spacing" | "corners";
136
- interface StyleFieldConfig {
137
- /** e.g. "typography.fontSize" — which style slot this reads and writes */
181
+ /** Inspector style control declaration. */
182
+ interface StyleControlConfig {
183
+ /** Style path, e.g. dimension.padding. */
138
184
  id: string;
185
+ /** Default inspector group. */
139
186
  group: StyleGroup;
187
+ /** Display label. */
140
188
  label: string;
189
+ /** Style input kind. */
141
190
  control: StyleControlType;
142
- options?: FieldOption[];
143
- /** Unit suffix for a single-unit slider, e.g. "px". Omit for unitless values. */
191
+ /** Options for select or alignment. */
192
+ options?: ControlOption[];
193
+ /** Single unit suffix; omit for unitless values. */
144
194
  unit?: string;
145
- /** Email-safe units. A select appears only when more than one is listed. */
195
+ /** Allowed email CSS units; multiple units show a selector. */
146
196
  units?: string[];
197
+ /** Minimum numeric or range value. */
147
198
  min?: number;
199
+ /** Maximum numeric or range value. */
148
200
  max?: number;
201
+ /** Numeric increment. */
149
202
  step?: number;
203
+ /** Default style string; overridden by defaultStyle. */
150
204
  defaultValue?: string;
205
+ /** Empty input hint. */
151
206
  placeholder?: string;
152
207
  }
208
+ /** Canvas or email consumer mode; independent of template resolution. */
153
209
  type RenderMode = "canvas" | "email";
210
+ /** Normalized snapshots used by block renderers. */
154
211
  interface BlockRenderContext {
212
+ /** Block copy with normalized controls and styles. */
155
213
  block: EmailBlockNode;
156
- fields: Record<string, unknown>;
214
+ /** Values parsed by the plugin readControls. */
215
+ controls: Record<string, unknown>;
216
+ /** Normalized enabled styles. */
157
217
  style: EmailBlockStyle;
158
- /** canvas/email identify the consumer; HTML template resolution is applied by the shared renderer. */
218
+ /** Canvas or email consumer; templates are processed by the shared renderer. */
159
219
  mode: RenderMode;
160
- global: EmailGlobalSettings;
220
+ /** Copy of email body settings. */
221
+ body: EmailBodySettings;
161
222
  }
223
+ /** Rich-text features for text, heading or button. */
162
224
  type RichTextProfile = "text" | "heading" | "button";
163
- /** 显式控制检查器的分组及字段归属,分组按声明顺序展示。 */
225
+ /** Inspector section displayed in declaration order. */
164
226
  interface BlockInspectorSection {
227
+ /** Section title. */
165
228
  title: string;
166
- fieldNames?: string[];
229
+ /** Content control names in display order. */
230
+ controlNames?: string[];
231
+ /** Style control IDs in display order. */
167
232
  styleIds?: string[];
233
+ /** Style IDs inside the collapsed advanced section. */
168
234
  advancedStyleIds?: string[];
169
235
  }
236
+ /** Normalized block definition available through plugin values and registry lookups. */
170
237
  interface BlockDefinition {
238
+ /** Unique block type. */
171
239
  type: string;
240
+ /** Library title. */
172
241
  title: string;
242
+ /** Library React icon or string. */
173
243
  icon?: ReactNode | string;
244
+ /** Library description. */
174
245
  description?: string;
175
- fields?: FieldConfig[];
176
- styleFields?: StyleFieldConfig[];
246
+ /** Named controls in declaration order. */
247
+ controls?: ControlConfig[];
248
+ /** Enabled style controls. */
249
+ styleControls?: StyleControlConfig[];
250
+ /** Custom inspector sections. */
177
251
  inspectorSections?: BlockInspectorSection[];
178
- /** 只启用 styleFields,不补容器间距和装饰;渲染也只读取启用的字段。 */
179
- exactStyleFields?: boolean;
180
- defaultFields?: Record<string, unknown>;
252
+ /** Parse a raw control object into normalized values. */
253
+ readControls: (value: Record<string, unknown>) => Record<string, unknown>;
254
+ /** Allow replacing a builtin with the same type. */
255
+ override?: boolean;
256
+ /** Default styles for new nodes. */
181
257
  defaultStyle?: EmailBlockStyle;
182
- /** Sample data used to render template HTML in the editor and preview. */
258
+ /** Template preview data for new nodes. */
183
259
  defaultData?: Record<string, unknown>;
184
- /** Content is edited inline on the canvas and stored in fields.html. */
185
- inlineEdit?: boolean;
186
- inlineEditProfile?: RichTextProfile;
187
- render: (ctx: BlockRenderContext) => string;
260
+ /** Rich-text control edited by the default canvas. */
261
+ inlineControl?: string;
262
+ /** Inspector component bound to the editor context. */
263
+ inspector?: ComponentType<PluginEditorProps>;
264
+ /** Canvas component bound to the editor context. */
265
+ canvas?: ComponentType<PluginEditorProps>;
266
+ /** Render inner HTML from normalized context; email mode validates controls. */
267
+ renderEmail: (ctx: BlockRenderContext) => string;
188
268
  }
269
+ /** Insertable template variable and preview value. */
189
270
  interface Variable {
190
- /** 下拉展示并插入的变量,例如 `{{ store_name }}`。 */
271
+ /** Exact inserted token, e.g. {{ store_name }}; exact matches receive export dot normalization. */
191
272
  name: string;
192
- /** 下拉选项副文案。空字符串或不传时不渲染。 */
273
+ /** Secondary option text; hidden when absent or empty. */
193
274
  description?: string;
194
- /** 预览时替换该变量的文本。 */
275
+ /** Preview replacement text; omitted values add no preview data. */
195
276
  value?: string;
196
277
  }
197
278
 
279
+ /** Template keys mapped to preview values; nested objects and arrays support paths and loops. */
280
+ interface TemplateData {
281
+ /** Template key mapped to a scalar, object or array. */
282
+ [key: string]: unknown;
283
+ }
284
+ /** Resolves template HTML for the editor and preview while leaving stored source untouched. */
285
+ declare function renderTemplatePreview(html: string, defaultData?: TemplateData): string;
286
+
287
+ /** Complete document HTML export options. */
288
+ interface DocumentHtmlOptions {
289
+ /** Resolve templates for preview; default false. */
290
+ resolveHtmlTemplates?: boolean;
291
+ /** Exact inserted tokens and optional preview values, default []. */
292
+ variables?: Variable[];
293
+ /** Global template data; shallow precedence below block defaultData and above variables. */
294
+ templateData?: TemplateData;
295
+ }
296
+ declare function documentToHtml(document: EmailDocument, definitions?: readonly BlockDefinition[], options?: DocumentHtmlOptions): string;
297
+
298
+ declare const EMAIL_MARKUP: unique symbol;
299
+ /** Branded email HTML fragment created by email tools. */
300
+ interface EmailMarkup {
301
+ readonly [EMAIL_MARKUP]: true;
302
+ /** Fragment HTML content. */
303
+ readonly html: string;
304
+ }
305
+ /** email.image options. */
306
+ interface EmailImageOptions {
307
+ /** Image URL allowing http, https, cid or a template. */
308
+ src: string;
309
+ /** Alternative text, default empty. */
310
+ alt?: string;
311
+ /** CSS width, default 100%; invalid values use the default. */
312
+ width?: string;
313
+ }
314
+ /** email.button options. */
315
+ interface EmailButtonOptions {
316
+ /** Link URL; empty or invalid values render non-link text. */
317
+ href: string;
318
+ /** Button text, automatically escaped. */
319
+ label: string;
320
+ }
321
+ /** Email HTML helpers available in plugin renderEmail. */
322
+ interface EmailTools {
323
+ /** Tagged template strings and values; ordinary values are escaped, markup and arrays compose. */
324
+ html: (strings: TemplateStringsArray, ...values: unknown[]) => EmailMarkup;
325
+ /** Insert raw HTML without sanitization. */
326
+ raw: (html: string) => EmailMarkup;
327
+ /** Preserve rich-text formatting and apply body defaults. */
328
+ richText: (html: string) => EmailMarkup;
329
+ /** Build a presentation table from rows of EmailMarkup cells. */
330
+ table: (rows: EmailMarkup[][]) => EmailMarkup;
331
+ /** Render an image from URL, alt and width, validating protocols and escaping. */
332
+ image: (options: EmailImageOptions) => EmailMarkup;
333
+ /** Render an email table button from URL and label. */
334
+ button: (options: EmailButtonOptions) => EmailMarkup;
335
+ /** Validate a URL; image selects image protocols, default false; invalid URLs return empty. */
336
+ url: (value: string, image?: boolean) => string;
337
+ }
338
+
339
+ /** Content control kind. */
340
+ type ControlKind = "text" | "textarea" | "html" | "richText" | "url" | "image" | "number" | "color" | "select" | "boolean" | "list" | "custom";
341
+ /** Custom control props; T is the value type. */
342
+ interface ControlComponentProps<T = unknown> {
343
+ /** Detached normalized control value. */
344
+ value: T;
345
+ /** Submit the new control value. */
346
+ onChange: (value: T) => void;
347
+ /** Declared control label. */
348
+ label: string;
349
+ /** Current body settings snapshot. */
350
+ body: EmailBodySettings;
351
+ /** Insertable variable snapshots. */
352
+ variables: Variable[];
353
+ }
354
+ /** Control factory options; T is the default/edit value type. */
355
+ interface ControlOptions<T> {
356
+ /** Required display label. */
357
+ label: string;
358
+ /** Factory fallback when omitted; persisted undefined receives the default. */
359
+ defaultValue?: T;
360
+ /** Empty input hint. */
361
+ placeholder?: string;
362
+ /** Allowed select options. */
363
+ options?: ControlOption[];
364
+ /** Visible textarea or HTML editor rows. */
365
+ rows?: number;
366
+ /** Minimum number or list length. */
367
+ min?: number;
368
+ /** Maximum number or list length. */
369
+ max?: number;
370
+ /** Number input increment. */
371
+ step?: number;
372
+ /** Unit label beside a numeric input. */
373
+ unit?: string;
374
+ /** Rich-text feature profile: text, heading or button. */
375
+ profile?: RichTextProfile;
376
+ /** Edit this richText on the default canvas; multiple regions require Canvas. */
377
+ inline?: boolean;
378
+ /** Custom React control component. */
379
+ component?: ComponentType<ControlComponentProps<T>>;
380
+ /** Validate a normalized value; return an error message or undefined. */
381
+ validate?: (value: T) => string | undefined;
382
+ }
383
+ /** Factory-produced control definition; T is its parsed value type. */
384
+ interface ControlDefinition<T = unknown> extends Omit<ControlOptions<T>, "component" | "validate"> {
385
+ /** Control kind. */
386
+ kind: ControlKind;
387
+ /** Normalized default value. */
388
+ defaultValue: T;
389
+ /** Parse an unknown persisted value into T; must be pure. */
390
+ read: (value: unknown) => T;
391
+ /** Validate an already normalized value without re-reading. */
392
+ validateValue?: (value: unknown) => string | undefined;
393
+ /** Render React UI from host-normalized control props. */
394
+ renderControl?: (props: ControlComponentProps) => ReactNode;
395
+ /** Child control schema for each list row. */
396
+ itemControls?: ControlSchema;
397
+ }
398
+ /** Map from control names to definitions. */
399
+ type ControlSchema = Record<string, ControlDefinition>;
400
+ /** Infer values from each Schema control read return type. */
401
+ type ControlValues<Schema extends ControlSchema> = {
402
+ [Name in keyof Schema]: ReturnType<Schema[Name]["read"]>;
403
+ };
404
+ /** Canvas or Inspector props; Controls is the inferred value shape. */
405
+ interface PluginEditorProps<Controls = Record<string, unknown>> {
406
+ /** Detached block snapshot. */
407
+ block: EmailBlockNode;
408
+ /** Normalized control value snapshot. */
409
+ controls: Controls;
410
+ /** Current enabled styles snapshot. */
411
+ style: EmailBlockStyle;
412
+ /** Body settings snapshot. */
413
+ body: EmailBodySettings;
414
+ /** Available variable snapshots. */
415
+ variables: Variable[];
416
+ /** Whether selected; true inside Inspector. */
417
+ selected: boolean;
418
+ /** Resolved inner HTML in Canvas; empty in Inspector. */
419
+ renderedHtml: string;
420
+ /** Request selection of this block. */
421
+ select: () => void;
422
+ /** Update the named control with its typed value. */
423
+ setControl: <Name extends keyof Controls & string>(name: Name, value: Controls[Name]) => void;
424
+ /** Shallow-merge a patch in one update; replace nested values entirely. */
425
+ setControls: (patch: Partial<Controls>) => void;
426
+ /** Update a style path with a CSS string. */
427
+ setStyle: (id: string, value: string) => void;
428
+ }
429
+ /** Typed email render context; Controls contains inferred values. */
430
+ interface PluginRenderContext<Controls> extends Omit<BlockRenderContext, "controls"> {
431
+ /** Inferred normalized control values. */
432
+ controls: Controls;
433
+ /** Escaping and layout helpers for email HTML. */
434
+ email: EmailTools;
435
+ }
436
+ /** defineBlock options; Schema infers values and Type preserves the type literal. */
437
+ interface BlockPluginOptions<Schema extends ControlSchema, Type extends string> {
438
+ /** Nonempty unique type; a business prefix is recommended. */
439
+ type: Type;
440
+ /** Nonempty library title. */
441
+ title: string;
442
+ /** Library icon or string. */
443
+ icon?: ReactNode | string;
444
+ /** Library description. */
445
+ description?: string;
446
+ /** Must be true to replace a builtin. */
447
+ override?: boolean;
448
+ /** Control schema, default {}. */
449
+ controls?: Schema;
450
+ /** Container styles enabled by default; false disables all; spacing and appearance select groups. */
451
+ containerStyles?: boolean | {
452
+ /** Enable default padding and margin controls; default true. */
453
+ spacing?: boolean;
454
+ /** Enable default background and border controls; default true. */
455
+ appearance?: boolean;
456
+ };
457
+ /** Extra style controls; matching IDs replace container controls. */
458
+ styleControls?: StyleControlConfig[];
459
+ /** Ordered content and style sections. */
460
+ inspectorSections?: BlockInspectorSection[];
461
+ /** Initial styles, taking precedence over control defaultValue. */
462
+ defaultStyle?: EmailBlockStyle;
463
+ /** Template preview data for new nodes. */
464
+ defaultData?: Record<string, unknown>;
465
+ /** Optional React canvas composing multiple editing regions. */
466
+ Canvas?: ComponentType<PluginEditorProps<ControlValues<Schema>>>;
467
+ /** Optional React inspector replacing the default content editor. */
468
+ Inspector?: ComponentType<PluginEditorProps<ControlValues<Schema>>>;
469
+ /** Render inner HTML or EmailMarkup from typed context, without editor UI. */
470
+ renderEmail: (ctx: PluginRenderContext<ControlValues<Schema>>) => string | EmailMarkup;
471
+ }
472
+ /** Plugin returned by defineBlock; Schema is its schema and Type its identifier type. */
473
+ interface BlockPlugin<Schema extends ControlSchema = ControlSchema, Type extends string = string> extends BlockDefinition {
474
+ /** Block type literal. */
475
+ type: Type;
476
+ /** Detached frozen snapshot of the control schema. */
477
+ schema: Schema;
478
+ }
479
+ /** Image resource picker request. */
480
+ interface ImagePickerContext {
481
+ /** Current image URL. */
482
+ value: string;
483
+ /** Label of the requesting control. */
484
+ label: string;
485
+ /** Cancellation signal on unmount or invalidation; pass to resource requests. */
486
+ signal: AbortSignal;
487
+ }
488
+ /** Document control validation issue. */
489
+ interface ValidationIssue {
490
+ /** Invalid block ID. */
491
+ blockId: string;
492
+ /** Invalid plugin type. */
493
+ blockType: string;
494
+ /** Control path including list row indexes and child controls. */
495
+ controlPath: string;
496
+ /** Displayable error description. */
497
+ message: string;
498
+ }
499
+ /** Block registration and image resource adapter options. */
500
+ interface UseEmailEditorConfigOptions {
501
+ /** Plugins created by defineBlock, default []. */
502
+ plugins?: BlockPlugin[];
503
+ /** All by default; false hides all; arrays filter/order; hidden nodes still render. */
504
+ builtins?: false | string[];
505
+ /** Resolve a URL from context, return null to cancel, or throw to show retry. */
506
+ pickImage?: (context: ImagePickerContext) => Promise<string | null>;
507
+ }
508
+ /** Shared configuration for editing, creation and standalone export. */
509
+ interface EmailEditorConfig {
510
+ /** All registered definitions including hidden builtins. */
511
+ readonly definitions: readonly BlockPlugin[];
512
+ /** Insertable blocks in display order. */
513
+ readonly library: readonly BlockPlugin[];
514
+ /** Optional image resource picker. */
515
+ readonly pickImage?: UseEmailEditorConfigOptions["pickImage"];
516
+ /** Create a detached default node for a registered type; unknown types throw. */
517
+ createBlock: (type: string) => EmailBlockNode;
518
+ /** Export a v4 document using this configuration and optional template options. */
519
+ toHtml: (document: EmailDocument, options?: DocumentHtmlOptions) => string;
520
+ /** Return document control issues, including missing plugins. */
521
+ validate: (document: EmailDocument) => ValidationIssue[];
522
+ }
523
+
524
+ /** Independent export snapshot. */
198
525
  interface EmailEditorData {
526
+ /** Document snapshot for persistence and reloading. */
199
527
  document: EmailDocument;
528
+ /** Pretty-printed document JSON. */
200
529
  json: string;
530
+ /** Complete email HTML preserving templates. */
201
531
  html: string;
532
+ /** Complete HTML resolved with preview data. */
202
533
  renderedHtml: string;
203
534
  }
204
- interface EmailEditorHandle {
535
+ /** Stable editor instance independent of UI mounting. */
536
+ interface EmailEditorInstance {
537
+ /** Read all export formats; rendering errors throw. */
205
538
  getData: () => EmailEditorData;
539
+ /** Read a detached document snapshot. */
206
540
  getDocument: () => EmailDocument;
541
+ /** Read pretty-printed document JSON. */
207
542
  getJson: () => string;
543
+ /** Export complete email HTML preserving templates. */
208
544
  getHtml: () => string;
545
+ /** Export HTML with current preview data. */
209
546
  getRenderedHtml: () => string;
547
+ /** Replace with a v4 document, clear interaction state and notify onChange. */
548
+ setDocument: (document: EmailDocument) => void;
549
+ /** Restore initialized document and body, clear interaction state and notify. */
550
+ reset: () => void;
551
+ /** Validate controls and return issues without rendering HTML. */
552
+ validate: () => ValidationIssue[];
210
553
  }
554
+ /** Editor UI props. */
211
555
  interface EmailEditorProps {
556
+ /** Required instance created by useEmailEditor. */
557
+ editor: EmailEditorInstance;
558
+ /** Height, default 100%; numbers are px; percentages need a sized parent. */
559
+ height?: number | string;
560
+ }
561
+ type ReadonlyData<T> = T extends object ? {
562
+ readonly [Key in keyof T]: ReadonlyData<T[Key]>;
563
+ } : T;
564
+ /** Cached readonly document subscription snapshot. */
565
+ interface EmailEditorState {
566
+ /** Deeply readonly document; update through instance methods. */
567
+ readonly document: ReadonlyData<EmailDocument>;
568
+ }
569
+ /** Editor initialization and reactive options. */
570
+ interface UseEmailEditorOptions {
571
+ /** Read once; use setDocument for later replacements; defaults to empty. */
212
572
  initialDocument?: EmailDocument;
213
- /** External global settings. Incoming changes are applied to the open document. */
214
- global?: Partial<EmailGlobalSettings>;
215
- blocks?: BlockDefinition[];
573
+ /** Initial body overrides; later changes merge into the current body. */
574
+ body?: Partial<EmailBodySettings>;
575
+ /** Block/resource configuration; defaults to all builtins; updates preserve the document. */
576
+ config?: EmailEditorConfig;
577
+ /** Insertable preview variables, default []; updates affect preview/export. */
216
578
  variables?: Variable[];
217
- height?: number | string;
579
+ /** Detached document after changes, replacements, resets or effective body updates; no initial call. */
218
580
  onChange?: (document: EmailDocument) => void;
219
- onGlobalChange?: (global: EmailGlobalSettings) => void;
581
+ /** Detached body snapshot after body edits inside the editor only. */
582
+ onBodyChange?: (body: EmailBodySettings) => void;
220
583
  }
221
584
 
222
- declare const EmailEditor: react.ForwardRefExoticComponent<EmailEditorProps & react.RefAttributes<EmailEditorHandle>>;
585
+ declare function EmailEditor(props: EmailEditorProps): react.JSX.Element;
223
586
 
587
+ /** Inherited styles for the low-level rich-text toolbar. */
224
588
  interface RichTextInheritedStyle {
589
+ /** Inherited font stack. */
225
590
  fontFamily: string;
591
+ /** Inherited font size. */
226
592
  fontSize: string;
593
+ /** Inherited text color. */
227
594
  color: string;
595
+ /** Inherited font weight. */
228
596
  fontWeight: FontWeight;
597
+ /** Inherited line height. */
229
598
  lineHeight: string;
599
+ /** Inherited paragraph spacing. */
230
600
  paragraphSpacing: string;
601
+ /** Inherited list item spacing. */
231
602
  listSpacing?: string;
603
+ /** Inherited list indentation. */
232
604
  listIndent?: string;
605
+ /** Inherited link color. */
233
606
  linkColor?: string;
607
+ /** Inherited link decoration. */
234
608
  linkDecoration?: string;
235
609
  }
236
610
 
611
+ /** Low-level rich-text props; prefer EditableRichText in plugins. */
237
612
  interface RichTextProps {
613
+ /** Initial and externally synchronized HTML. */
238
614
  initialHtml: string;
615
+ /** Feature profile, default text. */
239
616
  profile?: RichTextProfile;
617
+ /** Empty hint, default Type something…. */
240
618
  placeholder?: string;
619
+ /** Variables available in the toolbar. */
241
620
  variables: Variable[];
621
+ /** Whether selected and eligible to show the toolbar. */
242
622
  selected: boolean;
623
+ /** Toolbar DOM ID; caller ensures uniqueness. */
243
624
  toolbarId: string;
625
+ /** Whether the toolbar is hidden. */
244
626
  toolbarCollapsed: boolean;
627
+ /** Inherited typography; defaults to internal typography. */
245
628
  inherited?: RichTextInheritedStyle;
629
+ /** Receive complete rich-text HTML after each edit. */
246
630
  onCommit: (html: string) => void;
631
+ /** Request selection on click or focus. */
247
632
  onSelect: () => void;
248
633
  }
249
634
  declare function RichText({ initialHtml, profile, placeholder, variables, selected, toolbarId, toolbarCollapsed, inherited, onCommit, onSelect, }: RichTextProps): react.JSX.Element;
250
635
 
251
- declare const DEFAULT_BLOCKS: BlockDefinition[];
636
+ declare const DEFAULT_BLOCKS: BlockPlugin[];
252
637
 
253
- declare function resolveEmailGlobal(global?: Partial<EmailGlobalSettings> | null): EmailGlobalSettings;
638
+ declare function resolveEmailBody(body?: Partial<EmailBodySettings> | null): EmailBodySettings;
254
639
  declare function createEmailDocument(blocks?: EmailBlockNode[]): EmailDocument;
255
640
 
256
- declare function createBlockNode(type: string, definitions?: BlockDefinition[]): EmailBlockNode | null;
641
+ declare function createBlockNode(type: string, definitions?: readonly BlockDefinition[]): EmailBlockNode | null;
257
642
 
258
- declare const DIMENSION_FIELDS: {
259
- padding: StyleFieldConfig;
260
- margin: StyleFieldConfig;
261
- height: StyleFieldConfig;
643
+ declare const DIMENSION_CONTROLS: {
644
+ padding: StyleControlConfig;
645
+ margin: StyleControlConfig;
646
+ height: StyleControlConfig;
262
647
  };
263
- declare const DECORATION_FIELDS: {
264
- backgroundColor: StyleFieldConfig;
265
- borderWidth: StyleFieldConfig;
266
- borderStyle: StyleFieldConfig;
267
- borderColor: StyleFieldConfig;
268
- borderRadius: StyleFieldConfig;
648
+ declare const DECORATION_CONTROLS: {
649
+ backgroundColor: StyleControlConfig;
650
+ borderWidth: StyleControlConfig;
651
+ borderStyle: StyleControlConfig;
652
+ borderColor: StyleControlConfig;
653
+ borderRadius: StyleControlConfig;
269
654
  };
270
- declare const TYPOGRAPHY_FIELD_MAP: {
271
- fontFamily: StyleFieldConfig;
272
- fontSize: StyleFieldConfig;
273
- fontWeight: StyleFieldConfig;
274
- lineHeight: StyleFieldConfig;
275
- color: StyleFieldConfig;
276
- textAlign: StyleFieldConfig;
277
- paragraphSpacing: StyleFieldConfig;
278
- listSpacing: StyleFieldConfig;
279
- listIndent: StyleFieldConfig;
280
- linkColor: StyleFieldConfig;
281
- linkDecoration: StyleFieldConfig;
655
+ declare const TYPOGRAPHY_CONTROL_MAP: {
656
+ fontFamily: StyleControlConfig;
657
+ fontSize: StyleControlConfig;
658
+ fontWeight: StyleControlConfig;
659
+ lineHeight: StyleControlConfig;
660
+ color: StyleControlConfig;
661
+ textAlign: StyleControlConfig;
662
+ paragraphSpacing: StyleControlConfig;
663
+ listSpacing: StyleControlConfig;
664
+ listIndent: StyleControlConfig;
665
+ linkColor: StyleControlConfig;
666
+ linkDecoration: StyleControlConfig;
282
667
  };
283
- type DimensionFieldName = keyof typeof DIMENSION_FIELDS;
284
- type DecorationFieldName = keyof typeof DECORATION_FIELDS;
285
- type TypographyFieldName = keyof typeof TYPOGRAPHY_FIELD_MAP;
286
- type StyleFieldOverrideMap<Name extends string> = Partial<Record<Name, Partial<StyleFieldConfig>>>;
287
- declare function createDimensionFields(overrides?: StyleFieldOverrideMap<DimensionFieldName>): Record<DimensionFieldName, StyleFieldConfig>;
288
- declare function createDecorationFields(overrides?: StyleFieldOverrideMap<DecorationFieldName>): Record<DecorationFieldName, StyleFieldConfig>;
289
- declare function createTypographyFields(overrides?: StyleFieldOverrideMap<TypographyFieldName>): Record<TypographyFieldName, StyleFieldConfig>;
290
- /** 容器字段按固定槽位合并。相同 id 使用调用方字段,其余字段按原顺序接在后面。返回值都是副本。 */
291
- declare function resolveBlockStyleFields(fields?: StyleFieldConfig[], exactStyleFields?: boolean): StyleFieldConfig[];
292
-
293
- interface TemplateData {
294
- [key: string]: unknown;
295
- }
296
- /** Resolves template HTML for the editor and preview while leaving stored source untouched. */
297
- declare function renderTemplatePreview(html: string, defaultData?: TemplateData): string;
298
-
299
- interface DocumentHtmlOptions {
300
- resolveHtmlTemplates?: boolean;
301
- variables?: Variable[];
302
- templateData?: TemplateData;
303
- }
304
- declare function documentToHtml(document: EmailDocument, definitions?: BlockDefinition[], options?: DocumentHtmlOptions): string;
668
+ /** Dimension names: padding, margin, height. */
669
+ type DimensionControlName = keyof typeof DIMENSION_CONTROLS;
670
+ /** Appearance control names. */
671
+ type DecorationControlName = keyof typeof DECORATION_CONTROLS;
672
+ /** Typography control names. */
673
+ type TypographyControlName = keyof typeof TYPOGRAPHY_CONTROL_MAP;
674
+ type StyleControlOverrideMap<Name extends string> = Partial<Record<Name, Partial<StyleControlConfig>>>;
675
+ declare function createDimensionControls(overrides?: StyleControlOverrideMap<DimensionControlName>): Record<DimensionControlName, StyleControlConfig>;
676
+ declare function createDecorationControls(overrides?: StyleControlOverrideMap<DecorationControlName>): Record<DecorationControlName, StyleControlConfig>;
677
+ declare function createTypographyControls(overrides?: StyleControlOverrideMap<TypographyControlName>): Record<TypographyControlName, StyleControlConfig>;
305
678
 
679
+ /** Single-block rendering options; must be an object. */
306
680
  interface BlockRenderOptions {
681
+ /** Resolve templates, default false; single-block rendering does not auto-merge variables. */
307
682
  resolveHtmlTemplate?: boolean;
683
+ /** Explicit preview data; defaults to node defaultData. */
308
684
  templateData?: TemplateData;
685
+ /** Exact token dot normalization on export; merge preview data explicitly. */
309
686
  variables?: Variable[];
310
- global?: EmailGlobalSettings;
687
+ /** Body defaults; defaults to DEFAULT_EMAIL_BODY. */
688
+ body?: EmailBodySettings;
311
689
  }
312
- type BlockRenderOptionsInput = BlockRenderOptions | boolean;
313
- /** 用变量 name 里的字段名作为键,value 作为预览替换值。 */
690
+ /** Convert variable name paths and preview values into template data. */
314
691
  declare function variablesToTemplateData(variables: Variable[]): TemplateData;
315
692
  declare function mergeTemplateData(variables: Variable[], defaultData?: TemplateData): TemplateData | undefined;
316
- declare function renderBlockContent(node: EmailBlockNode, definitions?: BlockDefinition[], mode?: RenderMode, options?: BlockRenderOptionsInput): string;
317
- declare function renderBlock(node: EmailBlockNode, definitions?: BlockDefinition[], mode?: RenderMode, global?: EmailGlobalSettings): string;
318
- declare function blockToHtml(node: EmailBlockNode, definitions?: BlockDefinition[], mode?: RenderMode, options?: BlockRenderOptionsInput): string;
693
+ declare function renderBlockContent(node: EmailBlockNode, definitions?: readonly BlockDefinition[], mode?: RenderMode, options?: BlockRenderOptions): string;
694
+ declare function renderBlock(node: EmailBlockNode, definitions?: readonly BlockDefinition[], mode?: RenderMode, body?: EmailBodySettings): string;
695
+ declare function blockToHtml(node: EmailBlockNode, definitions?: readonly BlockDefinition[], mode?: RenderMode, options?: BlockRenderOptions): string;
319
696
 
320
- declare function buildRenderContext(node: EmailBlockNode, mode: RenderMode, global?: EmailGlobalSettings, definition?: BlockDefinition | undefined): BlockRenderContext;
697
+ declare function buildRenderContext(node: EmailBlockNode, mode: RenderMode, body?: EmailBodySettings, definition?: BlockDefinition | undefined): BlockRenderContext;
321
698
 
322
- declare function getBlockDefinition(type: string, definitions?: BlockDefinition[]): BlockDefinition | undefined;
699
+ declare function getBlockDefinition(type: string, definitions?: readonly BlockDefinition[]): BlockDefinition | undefined;
323
700
 
324
701
  declare function generateId(prefix?: string): string;
325
702
 
703
+ /** Inspector group option. */
326
704
  interface StyleGroupOption {
705
+ /** Group identifier. */
327
706
  group: StyleGroup;
707
+ /** Display label. */
328
708
  label: string;
329
709
  }
330
710
  declare const STYLE_GROUPS: StyleGroupOption[];
@@ -338,6 +718,147 @@ declare const BLOCK_TYPES: {
338
718
  readonly spacer: "spacer";
339
719
  readonly html: "html";
340
720
  };
721
+ /** Union of builtin block type identifiers. */
341
722
  type BuiltinBlockType = (typeof BLOCK_TYPES)[keyof typeof BLOCK_TYPES];
342
723
 
343
- export { BLOCK_TYPES, BORDER_STYLES, type BlockDefinition, type BlockInspectorSection, type BlockRenderContext, type BlockRenderOptions, type BorderStyle, type BuiltinBlockType, DEFAULT_BLOCKS, DEFAULT_EMAIL_GLOBAL, DOCUMENT_VERSION, type DecorationFieldName, type DimensionFieldName, type DocumentHtmlOptions, type EmailBlockNode, type EmailBlockStyle, type EmailDecorationStyle, type EmailDocument, EmailEditor, type EmailEditorData, type EmailEditorHandle, type EmailEditorProps, type EmailElementStyle, type EmailGlobalSettings, type EmailSpacingStyle, type EmailTypographyStyle, FONT_FAMILIES, FONT_WEIGHTS, type FieldConfig, type FieldType, type FontWeight, HORIZONTAL_ALIGNS, type HorizontalAlign, LINK_DECORATIONS, type LinkDecoration, type RenderMode, RichText, type RichTextProfile, STYLE_GROUPS, type StyleControlType, type StyleFieldConfig, type StyleGroup, TEXT_ALIGNS, type TemplateData, type TextAlign, type TypographyFieldName, type Variable, blockToHtml, buildRenderContext, createBlockNode, createDecorationFields, createDimensionFields, createEmailDocument, createTypographyFields, documentToHtml, generateId, getBlockDefinition, mergeTemplateData, renderBlock, renderBlockContent, renderTemplatePreview, resolveBlockStyleFields, resolveEmailGlobal, variablesToTemplateData };
724
+ declare function defineBlock<Schema extends ControlSchema, const Type extends string>(input: BlockPluginOptions<Schema, Type>): BlockPlugin<Schema, Type>;
725
+
726
+ declare const EmailControls: {
727
+ text: (options: ControlOptions<string>) => ControlDefinition<string>;
728
+ textarea: (options: ControlOptions<string>) => ControlDefinition<string>;
729
+ richText: (options: ControlOptions<string>) => ControlDefinition<string>;
730
+ html: (options: ControlOptions<string>) => ControlDefinition<string>;
731
+ url: (options: ControlOptions<string>) => ControlDefinition<string>;
732
+ image: (options: ControlOptions<string>) => ControlDefinition<string>;
733
+ color: (options: ControlOptions<string>) => ControlDefinition<string>;
734
+ select: (options: ControlOptions<string>) => ControlDefinition<string>;
735
+ boolean: (options: ControlOptions<boolean>) => ControlDefinition<boolean>;
736
+ number: (options: ControlOptions<number>) => ControlDefinition<number>;
737
+ list<Schema extends ControlSchema>(options: ControlOptions<ControlValues<Schema>[]> & {
738
+ /** Controls for each list row; Schema infers row values. */
739
+ controls: Schema;
740
+ }): ControlDefinition<ControlValues<Schema>[]>;
741
+ custom<T>(options: ControlOptions<T> & {
742
+ /** Required default value; must be JSON-persistable. */
743
+ defaultValue: T;
744
+ /** Purely parse an unknown persisted value into T. */
745
+ read: (value: unknown) => T;
746
+ /** Required editing component receiving ControlComponentProps<T>. */
747
+ component: NonNullable<ControlOptions<T>["component"]>;
748
+ }): ControlDefinition<T>;
749
+ };
750
+
751
+ declare function useEmailEditorConfig(options?: UseEmailEditorConfigOptions): EmailEditorConfig;
752
+
753
+ declare function useEmailEditor(options?: UseEmailEditorOptions): EmailEditorInstance;
754
+
755
+ declare function useEmailEditorState(editor: EmailEditorInstance): EmailEditorState;
756
+
757
+ /** Rich-text region within plugin context. */
758
+ interface EditableRichTextProps {
759
+ /** Name of a declared richText control. */
760
+ control: string;
761
+ /** Override the control rich-text feature profile. */
762
+ profile?: RichTextProfile;
763
+ /** Override the empty editor hint. */
764
+ placeholder?: string;
765
+ }
766
+ declare function EditableRichText({ control, profile, placeholder }: EditableRichTextProps): react.JSX.Element;
767
+
768
+ /** Text input props; other attributes follow React input; supports ref. */
769
+ interface TextInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
770
+ /** Input type, default text; excludes checkbox and other non-text kinds. */
771
+ type?: "text" | "url" | "email" | "search" | "tel" | "password" | "number";
772
+ }
773
+ declare const TextInput: react.ForwardRefExoticComponent<TextInputProps & react.RefAttributes<HTMLInputElement>>;
774
+
775
+ /** String select props. */
776
+ interface SelectControlProps {
777
+ /** Native select DOM ID. */
778
+ id?: string;
779
+ /** Accessible name. */
780
+ label?: string;
781
+ /** Current option value. */
782
+ value: string;
783
+ /** Options in display order. */
784
+ options: readonly ControlOption[];
785
+ /** Optional empty-option label; no duplicate empty option. */
786
+ emptyLabel?: string;
787
+ /** Compact size, default false. */
788
+ compact?: boolean;
789
+ /** Whether disabled. */
790
+ disabled?: boolean;
791
+ /** Receive the new option value. */
792
+ onChange: (value: string) => void;
793
+ }
794
+ declare function SelectControl({ id, label, value, options, emptyLabel, compact, disabled, onChange }: SelectControlProps): react.JSX.Element;
795
+
796
+ /** Checkbox or switch props. */
797
+ interface CheckboxControlProps {
798
+ /** Visible and accessible label. */
799
+ label: string;
800
+ /** Current checked state. */
801
+ checked: boolean;
802
+ /** Whether disabled. */
803
+ disabled?: boolean;
804
+ /** Additional root CSS class. */
805
+ className?: string;
806
+ /** Appearance: checkbox by default, or switch. */
807
+ variant?: "checkbox" | "switch";
808
+ /** Receive the new checked state. */
809
+ onChange: (checked: boolean) => void;
810
+ }
811
+ declare function CheckboxControl({ label, checked, disabled, className, variant, onChange }: CheckboxControlProps): react.JSX.Element;
812
+
813
+ /** Color picker props. */
814
+ interface ColorControlProps {
815
+ /** Current CSS color value. */
816
+ value: string;
817
+ /** Display fallback for an empty value, default #000000. */
818
+ fallback?: string;
819
+ /** Button and dialog label, default Color. */
820
+ label?: string;
821
+ /** Value submitted on reset; defaults to fallback. */
822
+ resetTo?: string;
823
+ /** Receive the selected or reset color. */
824
+ onChange: (value: string) => void;
825
+ }
826
+ declare function ColorControl({ value, fallback, label, resetTo, onChange }: ColorControlProps): react.JSX.Element;
827
+
828
+ /** Numeric range props. */
829
+ interface RangeControlProps {
830
+ /** Native input DOM ID. */
831
+ id?: string;
832
+ /** Accessible name. */
833
+ label?: string;
834
+ /** Current numeric value. */
835
+ value: number;
836
+ /** Minimum, default 0. */
837
+ min?: number;
838
+ /** Maximum, default 100. */
839
+ max?: number;
840
+ /** Increment, default 1. */
841
+ step?: number;
842
+ /** Receive the updated number. */
843
+ onChange: (value: number) => void;
844
+ }
845
+ declare function RangeControl({ id, label, value, min, max, step, onChange, }: RangeControlProps): react.JSX.Element;
846
+
847
+ /** Button props; other attributes follow React button; type defaults to button. */
848
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
849
+ /** Appearance: default, primary, solid or icon; default is default. */
850
+ variant?: "default" | "primary" | "solid" | "icon";
851
+ /** Optional tooltip linked through aria-describedby. */
852
+ tooltip?: string;
853
+ }
854
+ declare function Button({ type, variant, className, tooltip, children, "aria-describedby": describedBy, ...props }: ButtonProps): react.JSX.Element;
855
+
856
+ /** Declared-control component props within plugin context. */
857
+ interface ControlEditorProps {
858
+ /** Declared control name; unknown names throw. */
859
+ control: string;
860
+ }
861
+ /** Reuse declared controls, image pickers and validation inside a plugin inspector. */
862
+ declare function ControlEditor({ control }: ControlEditorProps): react.JSX.Element;
863
+
864
+ export { BLOCK_TYPES, BORDER_STYLES, type BlockInspectorSection, type BlockPlugin, type BlockPluginOptions, type BlockRenderContext, type BlockRenderOptions, type BorderStyle, type BuiltinBlockType, Button, CheckboxControl, ColorControl, type ControlComponentProps, type ControlDefinition, ControlEditor, type ControlEditorProps, type ControlKind, type ControlOption, type ControlOptions, type ControlSchema, type ControlValues, DEFAULT_BLOCKS, DEFAULT_EMAIL_BODY, DOCUMENT_VERSION, type DecorationControlName, type DimensionControlName, type DocumentHtmlOptions, EditableRichText, type EditableRichTextProps, type EmailBlockNode, type EmailBlockStyle, type EmailBodySettings, EmailControls, type EmailDecorationStyle, type EmailDocument, EmailEditor, type EmailEditorConfig, type EmailEditorData, type EmailEditorInstance, type EmailEditorProps, type EmailEditorState, type EmailElementStyle, type EmailMarkup, type EmailSpacingStyle, type EmailTools, type EmailTypographyStyle, FONT_FAMILIES, FONT_WEIGHTS, type FontWeight, HORIZONTAL_ALIGNS, type HorizontalAlign, type ImagePickerContext, LINK_DECORATIONS, type LinkDecoration, type PluginEditorProps, type PluginRenderContext, RangeControl, type RenderMode, RichText, type RichTextProfile, STYLE_GROUPS, SelectControl, type StyleControlConfig, type StyleControlType, type StyleGroup, TEXT_ALIGNS, type TemplateData, type TextAlign, TextInput, type TypographyControlName, type UseEmailEditorConfigOptions, type UseEmailEditorOptions, type ValidationIssue, type Variable, blockToHtml, buildRenderContext, createBlockNode, createDecorationControls, createDimensionControls, createEmailDocument, createTypographyControls, defineBlock, documentToHtml, generateId, getBlockDefinition, mergeTemplateData, renderBlock, renderBlockContent, renderTemplatePreview, resolveEmailBody, useEmailEditor, useEmailEditorConfig, useEmailEditorState, variablesToTemplateData };