@maildeno/editor 0.1.0

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.
Files changed (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +426 -0
  3. package/dist/RowPreviewLegacyComponent-CXsY4P-R.js +439 -0
  4. package/dist/RowPreviewLegacyComponent-osWbuByc.js +439 -0
  5. package/dist/RowPreviewRow-D-U1mV4v.js +107 -0
  6. package/dist/RowPreviewRow-MSc_unf3.js +107 -0
  7. package/dist/adapters/index.d.ts +7 -0
  8. package/dist/adapters/localStorageAdapter.d.ts +6 -0
  9. package/dist/adapters/types.d.ts +83 -0
  10. package/dist/baseStyles.d.ts +13 -0
  11. package/dist/blocks/canvasStyleHelpers.d.ts +17 -0
  12. package/dist/blocks/definitions/anchor.d.ts +2 -0
  13. package/dist/blocks/definitions/button.d.ts +2 -0
  14. package/dist/blocks/definitions/divider.d.ts +2 -0
  15. package/dist/blocks/definitions/heading.d.ts +2 -0
  16. package/dist/blocks/definitions/image.d.ts +2 -0
  17. package/dist/blocks/definitions/list.d.ts +2 -0
  18. package/dist/blocks/definitions/menu.d.ts +2 -0
  19. package/dist/blocks/definitions/paragraph.d.ts +2 -0
  20. package/dist/blocks/definitions/socials.d.ts +2 -0
  21. package/dist/blocks/definitions/spacer.d.ts +2 -0
  22. package/dist/blocks/definitions/video.d.ts +2 -0
  23. package/dist/blocks/index.d.ts +8 -0
  24. package/dist/blocks/registry.d.ts +23 -0
  25. package/dist/blocks/types.d.ts +73 -0
  26. package/dist/composables/emailBuilder/components/useComponentStyleEditor.d.ts +72 -0
  27. package/dist/composables/emailBuilder/components/useProductRowActions.d.ts +3 -0
  28. package/dist/composables/emailBuilder/components/useProductRows.d.ts +59 -0
  29. package/dist/composables/emailBuilder/core/config/componentConfig.d.ts +29 -0
  30. package/dist/composables/emailBuilder/core/link-tags/useLinkTagInsert.d.ts +13 -0
  31. package/dist/composables/emailBuilder/core/merge-tags/mergeTagDefinitions.d.ts +64 -0
  32. package/dist/composables/emailBuilder/core/merge-tags/resolveMergeTags.d.ts +27 -0
  33. package/dist/composables/emailBuilder/core/ui/useLayerHoverScroll.d.ts +20 -0
  34. package/dist/composables/emailBuilder/core/ui/useLayoutDrag.d.ts +85 -0
  35. package/dist/composables/emailBuilder/core/ui/useRichTextEditors.d.ts +6 -0
  36. package/dist/composables/emailBuilder/core/ui/visibilityBadgeHelpers.d.ts +22 -0
  37. package/dist/composables/emailBuilder/core/useEmailBuilder.d.ts +274 -0
  38. package/dist/composables/emailBuilder/core/useEmailBuilderDefault.d.ts +507 -0
  39. package/dist/composables/emailBuilder/core/useEmailBuilderOperations.d.ts +31 -0
  40. package/dist/composables/emailBuilder/core/useEmailBuilderVisibility.d.ts +31 -0
  41. package/dist/composables/emailBuilder/export/actions/download.d.ts +24 -0
  42. package/dist/composables/emailBuilder/export/generators/html.d.ts +3 -0
  43. package/dist/composables/emailBuilder/export/generators/mjml.d.ts +6 -0
  44. package/dist/composables/emailBuilder/export/generators/react-email.d.ts +61 -0
  45. package/dist/composables/emailBuilder/export/helpers/generatorHelpers.d.ts +53 -0
  46. package/dist/composables/emailBuilder/export/logic/espLogicWrapper.d.ts +76 -0
  47. package/dist/composables/emailBuilder/export/logic/reactLogicWrapper.d.ts +31 -0
  48. package/dist/composables/emailBuilder/export/merge-tags/mergeTagMapper.d.ts +42 -0
  49. package/dist/composables/emailBuilder/export/merge-tags/reactMergeTagMapper.d.ts +26 -0
  50. package/dist/composables/emailBuilder/export/shared/containers.d.ts +18 -0
  51. package/dist/composables/emailBuilder/export/shared/styles.d.ts +12 -0
  52. package/dist/composables/emailBuilder/export/shared/tagIdentifier.d.ts +1 -0
  53. package/dist/composables/emailBuilder/export/targets/htmlExport.d.ts +20 -0
  54. package/dist/composables/emailBuilder/export/targets/jsonExport.d.ts +28 -0
  55. package/dist/composables/emailBuilder/export/targets/mjmlExport.d.ts +19 -0
  56. package/dist/composables/emailBuilder/export/targets/reactEmailExport.d.ts +20 -0
  57. package/dist/composables/emailBuilder/export/transformers/espWrapper.d.ts +2 -0
  58. package/dist/composables/emailBuilder/export/transformers/formatting.d.ts +3 -0
  59. package/dist/composables/emailBuilder/export/transformers/minify.d.ts +33 -0
  60. package/dist/composables/emailBuilder/export/transformers/tagMapper.d.ts +29 -0
  61. package/dist/composables/emailBuilder/export/types/export.d.ts +24 -0
  62. package/dist/composables/emailBuilder/export/useEmailExportEngine.d.ts +63 -0
  63. package/dist/composables/emailBuilder/export/useEmailExportMobileStyles.d.ts +3 -0
  64. package/dist/composables/emailBuilder/export/useExportSettings.d.ts +5 -0
  65. package/dist/composables/emailBuilder/health/accessibilityChecker.d.ts +64 -0
  66. package/dist/composables/emailBuilder/health/healthIndicator.d.ts +19 -0
  67. package/dist/composables/emailBuilder/history/useEmailBuilderHistory.d.ts +26 -0
  68. package/dist/composables/emailBuilder/history/useHistory.d.ts +16 -0
  69. package/dist/composables/emailBuilder/persistence/useEmailBuilderPersistence.d.ts +38 -0
  70. package/dist/composables/emailBuilder/preview/useClientPreview.d.ts +127 -0
  71. package/dist/composables/emailBuilder/transform/pipeline/hydrate.d.ts +54 -0
  72. package/dist/composables/emailBuilder/transform/pipeline/optimize.d.ts +101 -0
  73. package/dist/composables/emailBuilder/transform/pipeline/optimizeAI.d.ts +125 -0
  74. package/dist/composables/emailBuilder/types/emailBuilder.d.ts +79 -0
  75. package/dist/composables/system/useColor.d.ts +26 -0
  76. package/dist/composables/system/useDeviceDetection.d.ts +5 -0
  77. package/dist/composables/system/useGoogleFonts.d.ts +11 -0
  78. package/dist/composables/system/useImageUpload.d.ts +23 -0
  79. package/dist/composables/system/useSavedRowsPanel.d.ts +35 -0
  80. package/dist/composables/ui/useConfirm.d.ts +33 -0
  81. package/dist/composables/ui/useInfoDialog.d.ts +22 -0
  82. package/dist/composables/ui/useTeleportTarget.d.ts +49 -0
  83. package/dist/composables/ui/useToast.d.ts +32 -0
  84. package/dist/devStyleMirror.d.ts +20 -0
  85. package/dist/documentScopedStyles.d.ts +39 -0
  86. package/dist/editor.css +2411 -0
  87. package/dist/element-DN22fZmQ.js +72000 -0
  88. package/dist/element-scoped-styles.css +2411 -0
  89. package/dist/element.d.ts +6 -0
  90. package/dist/element.js +2 -0
  91. package/dist/esp/registry.d.ts +33 -0
  92. package/dist/estree-C12ASyI-.js +7993 -0
  93. package/dist/html-DGrfikay.js +7353 -0
  94. package/dist/index.d.ts +12 -0
  95. package/dist/index.js +71955 -0
  96. package/dist/init.d.ts +85 -0
  97. package/dist/init.js +130 -0
  98. package/dist/lightDom.d.ts +30 -0
  99. package/dist/merge-tags/registry.d.ts +33 -0
  100. package/dist/shadowStyles.d.ts +8 -0
  101. package/dist/standalone-Bd2oQFm3.js +3639 -0
  102. package/dist/theme.d.ts +132 -0
  103. package/dist/typescript-D-z2dDu9.js +23190 -0
  104. package/dist/utils/generateId.d.ts +1 -0
  105. package/dist/utils/shadowDom.d.ts +30 -0
  106. package/dist/vue.runtime.esm-bundler-DwQEK7WO.js +9028 -0
  107. package/package.json +99 -0
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Theming via CSS custom properties.
3
+ *
4
+ * Setting variables rather than regenerating a stylesheet is what makes this
5
+ * work in the custom-element build: the bundled shadow-root CSS is static and
6
+ * cannot be re-emitted at runtime, but a custom property set on the host
7
+ * cascades into the shadow tree and updates every rule reading it, live.
8
+ */
9
+ /**
10
+ * Every themeable token.
11
+ *
12
+ * Two layers, deliberately. Core tokens (`primary`, `surface`, `text`, …)
13
+ * re-theme the whole editor coherently. Semantic tokens (`headerBg`,
14
+ * `inputBg`, `overlayBg`, …) default to the core ones and exist for hosts
15
+ * that want to change one surface without redefining everything else.
16
+ *
17
+ * Anything left out keeps its default, so a partial theme is always coherent
18
+ * rather than half-applied — setting only `primary` cannot produce unreadable
19
+ * text, and setting only `headerBg` cannot leave the rest inconsistent.
20
+ */
21
+ export interface ThemeTokens {
22
+ /** Brand/accent colour. Drives the primary button, focus rings, selection. */
23
+ primary?: string;
24
+ primaryHover?: string;
25
+ /** Text/icon colour on top of `primary`. Set this when using a light brand
26
+ * colour, or the primary button's label will be unreadable. */
27
+ onPrimary?: string;
28
+ /** Page background behind the canvas. */
29
+ background?: string;
30
+ /** Panels, header, toolbars, popovers. */
31
+ surface?: string;
32
+ /** Subtle fills — inactive tabs, secondary buttons. */
33
+ surfaceMuted?: string;
34
+ surfaceHover?: string;
35
+ text?: string;
36
+ textMuted?: string;
37
+ textSubtle?: string;
38
+ border?: string;
39
+ borderStrong?: string;
40
+ danger?: string;
41
+ onDanger?: string;
42
+ success?: string;
43
+ warning?: string;
44
+ info?: string;
45
+ /** Focus ring colour. Defaults to `primary`. */
46
+ ring?: string;
47
+ /** Box-shadow used by popovers and dialogs. */
48
+ shadow?: string;
49
+ /** Backdrop behind modal dialogs. */
50
+ scrim?: string;
51
+ headerBg?: string;
52
+ headerText?: string;
53
+ headerBorder?: string;
54
+ sidebarBg?: string;
55
+ sidebarText?: string;
56
+ sidebarBorder?: string;
57
+ /** Selected tab / segmented-control fill. Defaults to `primary`. */
58
+ accentBg?: string;
59
+ accentText?: string;
60
+ canvasBg?: string;
61
+ inputBg?: string;
62
+ inputText?: string;
63
+ inputBorder?: string;
64
+ inputPlaceholder?: string;
65
+ /** Dialogs, toasts, dropdowns, date picker and floating toolbars. */
66
+ overlayBg?: string;
67
+ overlayText?: string;
68
+ overlayBorder?: string;
69
+ overlayShadow?: string;
70
+ toolbarBg?: string;
71
+ toolbarText?: string;
72
+ toolbarBorder?: string;
73
+ /** The Save / Update button — the most commonly branded control. */
74
+ buttonPrimaryBg?: string;
75
+ buttonPrimaryText?: string;
76
+ buttonPrimaryHoverBg?: string;
77
+ buttonSecondaryBg?: string;
78
+ buttonSecondaryText?: string;
79
+ buttonSecondaryHoverBg?: string;
80
+ successBg?: string;
81
+ successFg?: string;
82
+ successBorder?: string;
83
+ infoBg?: string;
84
+ infoFg?: string;
85
+ infoBorder?: string;
86
+ warningBg?: string;
87
+ warningFg?: string;
88
+ warningBorder?: string;
89
+ dangerBg?: string;
90
+ dangerFg?: string;
91
+ dangerBorder?: string;
92
+ }
93
+ export interface ThemeOptions extends ThemeTokens {
94
+ /** Tokens applied only in light mode. */
95
+ light?: ThemeTokens;
96
+ /**
97
+ * Tokens applied only when the editor has the `dark` class.
98
+ *
99
+ * Dark mode has its own complete set of defaults, so overriding a couple of
100
+ * tokens here is enough — you do not have to restate a whole palette.
101
+ */
102
+ dark?: ThemeTokens;
103
+ /** @deprecated Use `primary`. */
104
+ primaryColor?: string;
105
+ /** @deprecated Use `surface`. */
106
+ surfaceColor?: string;
107
+ }
108
+ /**
109
+ * Applies theme tokens.
110
+ *
111
+ * ```ts
112
+ * setEditorTheme({
113
+ * primary: "#6366f1",
114
+ * buttonPrimaryText: "#ffffff",
115
+ * dark: { primary: "#818cf8", headerBg: "#0f172a" },
116
+ * });
117
+ * ```
118
+ *
119
+ * @param target For the plain Vue build, omit — defaults to
120
+ * `document.documentElement`. For the custom-element build, pass the
121
+ * `<maildeno-editor>` element, so the properties cascade into its shadow
122
+ * tree. `handle.setTheme()` does this for you.
123
+ */
124
+ export declare function setEditorTheme(options: ThemeOptions, target?: HTMLElement): void;
125
+ /**
126
+ * Expands one hex colour into a 50–950 shade scale.
127
+ *
128
+ * The editor's own tokens no longer need this — `primary` and
129
+ * `primaryHover` are set directly — but it stays exported because hosts use
130
+ * it to derive matching shades for their own UI around the editor.
131
+ */
132
+ export declare function palette(hex: string): Record<string, string>;