@maildeno/editor 0.1.4 → 0.4.3

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 (152) hide show
  1. package/CHANGELOG.md +304 -0
  2. package/README.md +397 -381
  3. package/dist/{RowPreviewLegacyComponent-yjHSkZLz.js → RowPreviewLegacyComponent-BFvLnPiK.js} +1 -1
  4. package/dist/{RowPreviewRow-D-wmhbhZ.js → RowPreviewRow-D-6koDUR.js} +2 -2
  5. package/dist/adapters/errors.d.ts +59 -0
  6. package/dist/adapters/index.d.ts +31 -0
  7. package/dist/adapters/types.d.ts +68 -0
  8. package/dist/brand.d.ts +15 -0
  9. package/dist/components/DesktopOnlyNotice.vue.d.ts +20 -0
  10. package/dist/components/features/emailBuilder/EmailEditor.vue.d.ts +182 -0
  11. package/dist/components/features/emailBuilder/assistant/AssistantPanel.vue.d.ts +37 -0
  12. package/dist/components/features/emailBuilder/blocks/AnchorBlock.vue.d.ts +3 -0
  13. package/dist/components/features/emailBuilder/blocks/ButtonBlock.vue.d.ts +3 -0
  14. package/dist/components/features/emailBuilder/blocks/DividerBlock.vue.d.ts +3 -0
  15. package/dist/components/features/emailBuilder/blocks/HeadingBlock.vue.d.ts +3 -0
  16. package/dist/components/features/emailBuilder/blocks/ImageBlock.vue.d.ts +3 -0
  17. package/dist/components/features/emailBuilder/blocks/ListBlock.vue.d.ts +3 -0
  18. package/dist/components/features/emailBuilder/blocks/MenuBlock.vue.d.ts +3 -0
  19. package/dist/components/features/emailBuilder/blocks/ParagraphBlock.vue.d.ts +3 -0
  20. package/dist/components/features/emailBuilder/blocks/SocialsBlock.vue.d.ts +3 -0
  21. package/dist/components/features/emailBuilder/blocks/SpacerBlock.vue.d.ts +3 -0
  22. package/dist/components/features/emailBuilder/blocks/VideoBlock.vue.d.ts +3 -0
  23. package/dist/components/features/emailBuilder/canvas/Canvas.vue.d.ts +3 -0
  24. package/dist/components/features/emailBuilder/canvas/CanvasColumn.vue.d.ts +49 -0
  25. package/dist/components/features/emailBuilder/canvas/CanvasComponent.vue.d.ts +56 -0
  26. package/dist/components/features/emailBuilder/canvas/CanvasElement.vue.d.ts +21 -0
  27. package/dist/components/features/emailBuilder/canvas/CanvasRow.vue.d.ts +49 -0
  28. package/dist/components/features/emailBuilder/canvas/CanvasRowSpacer.vue.d.ts +40 -0
  29. package/dist/components/features/emailBuilder/health/HealthIndicator.vue.d.ts +3 -0
  30. package/dist/components/features/emailBuilder/layout/Header.vue.d.ts +54 -0
  31. package/dist/components/features/emailBuilder/layout/SendEmail.vue.d.ts +21 -0
  32. package/dist/components/features/emailBuilder/layout/SidebarLeft.vue.d.ts +3 -0
  33. package/dist/components/features/emailBuilder/layout/SidebarRight.vue.d.ts +3 -0
  34. package/dist/components/features/emailBuilder/panels/AnchorPanel.vue.d.ts +3 -0
  35. package/dist/components/features/emailBuilder/panels/ButtonPanel.vue.d.ts +3 -0
  36. package/dist/components/features/emailBuilder/panels/DividerPanel.vue.d.ts +3 -0
  37. package/dist/components/features/emailBuilder/panels/HeadingPanel.vue.d.ts +3 -0
  38. package/dist/components/features/emailBuilder/panels/ImagePanel.vue.d.ts +3 -0
  39. package/dist/components/features/emailBuilder/panels/ListPanel.vue.d.ts +3 -0
  40. package/dist/components/features/emailBuilder/panels/MenuPanel.vue.d.ts +3 -0
  41. package/dist/components/features/emailBuilder/panels/ParagraphPanel.vue.d.ts +3 -0
  42. package/dist/components/features/emailBuilder/panels/RowColumnPanel.vue.d.ts +13 -0
  43. package/dist/components/features/emailBuilder/panels/RowPanel.vue.d.ts +13 -0
  44. package/dist/components/features/emailBuilder/panels/RowSpacerPanel.vue.d.ts +13 -0
  45. package/dist/components/features/emailBuilder/panels/SocialsPanel.vue.d.ts +3 -0
  46. package/dist/components/features/emailBuilder/panels/SpacerPanel.vue.d.ts +3 -0
  47. package/dist/components/features/emailBuilder/panels/VideoPanel.vue.d.ts +3 -0
  48. package/dist/components/features/emailBuilder/panels/shared/DeviceTabs.vue.d.ts +19 -0
  49. package/dist/components/features/emailBuilder/panels/shared/LinkFieldMergeTags.vue.d.ts +31 -0
  50. package/dist/components/features/emailBuilder/panels/shared/OverrideBadge.vue.d.ts +9 -0
  51. package/dist/components/features/emailBuilder/panels/shared/PreviewBadge.vue.d.ts +11 -0
  52. package/dist/components/features/emailBuilder/panels/shared/TextFieldMergeTags.vue.d.ts +25 -0
  53. package/dist/components/features/emailBuilder/panels/ui/BoxStylingSection.vue.d.ts +7 -0
  54. package/dist/components/features/emailBuilder/panels/ui/PropertyAlignment.vue.d.ts +30 -0
  55. package/dist/components/features/emailBuilder/panels/ui/PropertyColor.vue.d.ts +75 -0
  56. package/dist/components/features/emailBuilder/panels/ui/PropertyGradientColor.vue.d.ts +27 -0
  57. package/dist/components/features/emailBuilder/panels/ui/PropertyNumberSlider.vue.d.ts +74 -0
  58. package/dist/components/features/emailBuilder/panels/ui/PropertySection.vue.d.ts +17 -0
  59. package/dist/components/features/emailBuilder/panels/ui/PropertySelect.vue.d.ts +74 -0
  60. package/dist/components/features/emailBuilder/panels/ui/PropertyTextStyle.vue.d.ts +52 -0
  61. package/dist/components/features/emailBuilder/panels/ui/PropertyTextStylePanel.vue.d.ts +72 -0
  62. package/dist/components/features/emailBuilder/panels/ui/PropertyToggle.vue.d.ts +45 -0
  63. package/dist/components/features/emailBuilder/panels/ui/PropertyVisibility.vue.d.ts +32 -0
  64. package/dist/components/features/emailBuilder/panels/ui/SpacingControl.vue.d.ts +19 -0
  65. package/dist/components/features/emailBuilder/panels/ui/color-picker/AlphaSlider.vue.d.ts +28 -0
  66. package/dist/components/features/emailBuilder/panels/ui/color-picker/ColorPickerPanel.vue.d.ts +31 -0
  67. package/dist/components/features/emailBuilder/panels/ui/color-picker/HueSlider.vue.d.ts +19 -0
  68. package/dist/components/features/emailBuilder/panels/ui/color-picker/RecentColors.vue.d.ts +20 -0
  69. package/dist/components/features/emailBuilder/panels/ui/color-picker/SVPanel.vue.d.ts +39 -0
  70. package/dist/components/features/emailBuilder/panels/ui/visibility-rule/Rule.vue.d.ts +28 -0
  71. package/dist/components/features/emailBuilder/preview/PreviewScreen.vue.d.ts +7 -0
  72. package/dist/components/features/emailBuilder/preview/ui/PreviewCanvas.vue.d.ts +10 -0
  73. package/dist/components/features/emailBuilder/preview/ui/PreviewCapabilityBadges.vue.d.ts +12 -0
  74. package/dist/components/features/emailBuilder/preview/ui/PreviewClientCard.vue.d.ts +20 -0
  75. package/dist/components/features/emailBuilder/preview/ui/PreviewClientList.vue.d.ts +21 -0
  76. package/dist/components/features/emailBuilder/preview/ui/PreviewClientPicker.vue.d.ts +16 -0
  77. package/dist/components/features/emailBuilder/preview/ui/PreviewComponent.vue.d.ts +10 -0
  78. package/dist/components/features/emailBuilder/preview/ui/PreviewDetailView.vue.d.ts +41 -0
  79. package/dist/components/features/emailBuilder/preview/ui/PreviewRendered.vue.d.ts +8 -0
  80. package/dist/components/features/emailBuilder/product/RowPreview.vue.d.ts +8 -0
  81. package/dist/components/features/emailBuilder/product/RowPreviewChildren.vue.d.ts +14 -0
  82. package/dist/components/features/emailBuilder/product/RowPreviewLegacyComponent.vue.d.ts +14 -0
  83. package/dist/components/features/emailBuilder/product/RowPreviewRow.vue.d.ts +9 -0
  84. package/dist/components/features/emailBuilder/product/SavedRowsPanel.vue.d.ts +3 -0
  85. package/dist/components/features/emailBuilder/product/SavedTemplatesPanel.vue.d.ts +13 -0
  86. package/dist/components/features/emailBuilder/product/VersionHistoryPanel.vue.d.ts +14 -0
  87. package/dist/components/features/emailBuilder/sidebar/SidebarBlockButton.vue.d.ts +35 -0
  88. package/dist/components/features/emailBuilder/tabs/GeneralTab.vue.d.ts +3 -0
  89. package/dist/components/features/emailBuilder/tabs/LayoutTab.vue.d.ts +3 -0
  90. package/dist/components/features/emailBuilder/tabs/content/ContentTab.vue.d.ts +3 -0
  91. package/dist/components/features/emailBuilder/tabs/content/LayersPanel.vue.d.ts +7 -0
  92. package/dist/components/features/emailBuilder/tabs/general/MergeTagsTab.vue.d.ts +3 -0
  93. package/dist/components/features/emailBuilder/tabs/general/StylesTab.vue.d.ts +3 -0
  94. package/dist/components/features/emailBuilder/tabs/general/VisibilityTab.vue.d.ts +3 -0
  95. package/dist/components/features/emailBuilder/tabs/general/VisibilityWrapESPTab.vue.d.ts +3 -0
  96. package/dist/components/features/emailBuilder/tabs/general/merge-tags/LinkTagTab.vue.d.ts +3 -0
  97. package/dist/components/features/emailBuilder/tabs/general/merge-tags/MergeTagTab.vue.d.ts +3 -0
  98. package/dist/components/features/emailBuilder/ui/LinkInputDialog.vue.d.ts +17 -0
  99. package/dist/components/features/emailBuilder/ui/canvas/CanvasRowDropZone.vue.d.ts +12 -0
  100. package/dist/components/features/emailBuilder/ui/canvas/DropZone.vue.d.ts +10 -0
  101. package/dist/components/features/emailBuilder/ui/canvas/Loader.vue.d.ts +19 -0
  102. package/dist/components/features/emailBuilder/ui/layers-panel/ComponentIcon.vue.d.ts +7 -0
  103. package/dist/components/features/emailBuilder/ui/layers-panel/LayerColumnChildren.vue.d.ts +42 -0
  104. package/dist/components/features/emailBuilder/ui/layers-panel/LayerDropLine.vue.d.ts +8 -0
  105. package/dist/components/features/emailBuilder/ui/renderers/AnchorRenderer.vue.d.ts +10 -0
  106. package/dist/components/features/emailBuilder/ui/renderers/DividerRenderer.vue.d.ts +10 -0
  107. package/dist/components/features/emailBuilder/ui/renderers/HeadingRenderer.vue.d.ts +10 -0
  108. package/dist/components/features/emailBuilder/ui/renderers/ImageRenderer.vue.d.ts +10 -0
  109. package/dist/components/features/emailBuilder/ui/renderers/ListRenderer.vue.d.ts +10 -0
  110. package/dist/components/features/emailBuilder/ui/renderers/MenuRenderer.vue.d.ts +10 -0
  111. package/dist/components/features/emailBuilder/ui/renderers/ParagraphRenderer.vue.d.ts +10 -0
  112. package/dist/components/features/emailBuilder/ui/renderers/SocialsRenderer.vue.d.ts +10 -0
  113. package/dist/components/features/emailBuilder/ui/renderers/SpacerRenderer.vue.d.ts +10 -0
  114. package/dist/components/features/emailBuilder/ui/renderers/VideoRenderer.vue.d.ts +10 -0
  115. package/dist/components/features/emailBuilder/ui/rich-text-editor/RichTextEditor.vue.d.ts +12 -0
  116. package/dist/components/features/emailBuilder/ui/rich-text-editor/pickers/MergeTagPicker.vue.d.ts +18 -0
  117. package/dist/components/features/emailBuilder/ui/rich-text-editor/pickers/RichTextColorPicker.vue.d.ts +15 -0
  118. package/dist/components/features/emailBuilder/ui/visibility/SupportBadge.vue.d.ts +10 -0
  119. package/dist/components/features/emailBuilder/ui/visibility/VisibilityPopover.vue.d.ts +45 -0
  120. package/dist/components/ui/ConfirmDialog.vue.d.ts +3 -0
  121. package/dist/components/ui/Icon.vue.d.ts +33 -0
  122. package/dist/components/ui/InfoDialog.vue.d.ts +12 -0
  123. package/dist/components/ui/Loading.vue.d.ts +6 -0
  124. package/dist/components/ui/ShadowSafeToast.vue.d.ts +3 -0
  125. package/dist/components/ui/primitives/Button.vue.d.ts +23 -0
  126. package/dist/components/ui/primitives/DatePicker.vue.d.ts +16 -0
  127. package/dist/components/ui/primitives/Dialog.vue.d.ts +34 -0
  128. package/dist/components/ui/primitives/InputText.vue.d.ts +29 -0
  129. package/dist/components/ui/primitives/Message.vue.d.ts +20 -0
  130. package/dist/components/ui/primitives/Select.vue.d.ts +22 -0
  131. package/dist/composables/emailBuilder/components/useSystemRows.d.ts +22 -0
  132. package/dist/composables/emailBuilder/core/ui/useLayerHoverScroll.d.ts +10 -10
  133. package/dist/composables/emailBuilder/core/useEmailBuilder.d.ts +18 -0
  134. package/dist/composables/emailBuilder/export/logic/espLogicWrapper.d.ts +4 -4
  135. package/dist/composables/emailBuilder/export/targets/templateSnapshot.d.ts +24 -0
  136. package/dist/composables/emailBuilder/persistence/useEmailBuilderPersistence.d.ts +1 -1
  137. package/dist/composables/system/useColorScheme.d.ts +16 -0
  138. package/dist/editor.css +2074 -1688
  139. package/dist/{element-CWjNN0lY.js → element-95RHug4F.js} +3275 -1986
  140. package/dist/element-scoped-styles.css +2074 -1688
  141. package/dist/element.d.ts +1 -1
  142. package/dist/element.js +1 -1
  143. package/dist/{html-DGrfikay.js → html-D6UnSE1C.js} +1 -1
  144. package/dist/index.d.ts +4 -2
  145. package/dist/index.js +3325 -1984
  146. package/dist/init.d.ts +95 -2
  147. package/dist/init.js +29 -3
  148. package/dist/theme.d.ts +68 -17
  149. package/dist/types/assistant.d.ts +56 -0
  150. package/dist/{vue.runtime.esm-bundler-CfYyFhW6.js → vue.runtime.esm-bundler-BaHqghYy.js} +3 -3
  151. package/package.json +6 -3
  152. package/dist/composables/emailBuilder/transform/pipeline/optimizeAI.d.ts +0 -125
package/CHANGELOG.md ADDED
@@ -0,0 +1,304 @@
1
+ # Changelog
2
+
3
+ ## 0.4.3
4
+
5
+ ### Fixed
6
+
7
+ **Every component `<style scoped>` block was missing when installing from
8
+ npm and using the `EmailEditor` Vue component.** The editor rendered
9
+ unstyled panels — `HealthIndicator`, `DesktopOnlyNotice`, the text panel,
10
+ and 29 other scoped blocks — while Tailwind, the fonts and the icons all
11
+ applied normally. `init()` and the custom element were unaffected, and
12
+ building against a local `dist/` folder never reproduced it.
13
+
14
+ 0.4.2 delivered those styles by prepending a self-executing snippet to the
15
+ entry chunk:
16
+
17
+ ```js
18
+ (function(){ /* … document.head.appendChild(style) … */ })();
19
+ import { a, c, g, … } from "./index-DhFg3uKs.js";
20
+ export { a as EmailEditor, … };
21
+ ```
22
+
23
+ `package.json` declares `sideEffects` as covering CSS files only, which
24
+ tells a consumer's bundler that every `.js` in the package is pure. Rollup
25
+ had emitted `dist/index.js` as a thin facade holding nothing but that
26
+ snippet and a set of re-exports — and a pure module whose exports can be
27
+ reached directly is one a bundler may delete outright. So consumer builds
28
+ dropped the file, the snippet went with it, and the CSS never ran.
29
+ Verified against the published 0.4.2 tarball: zero of 32 scoped selectors
30
+ survived a consumer build.
31
+
32
+ Whether Rollup emits that facade is a chunking decision, which is why the
33
+ same source built correctly in this repo and shipped broken. The styles
34
+ are now substituted into a value `baseStyles.ts` returns, so
35
+ `EmailEditor.vue` injects them on mount alongside Tailwind and the fonts.
36
+ Reachable from the component, they cannot be dropped without dropping the
37
+ component — the mechanism `shadowStyles.ts` has always used for the shadow
38
+ root. Confirmed surviving even under `sideEffects: false`.
39
+
40
+ Nothing changed in the public API, and no CSS import is needed.
41
+
42
+ ### Changed
43
+
44
+ **A missing style substitution now fails the build instead of warning.**
45
+ Both build passes error out if the placeholder cannot be found in any
46
+ chunk. A warning in a build log was not enough to catch this before
47
+ publishing.
48
+
49
+ ## 0.4.2
50
+
51
+ Docs only — no code changes. 0.4.1's `onSave` fix is confirmed working on the
52
+ `init()` path.
53
+
54
+ - **Save gating documented** in the Vanilla, React and Astro guides: `onSave`
55
+ is what reveals the Save button, and `handle.on("save", …)` only fires when
56
+ it was passed, because without it the editor never saves.
57
+ - **New "Reading the canvas" section** in the Nuxt and Vue guides, covering
58
+ `getHtml` / `getMjml` / `getReactEmail` / `getJson` via a template ref —
59
+ they are instance methods, not events or slot props, which was not written
60
+ down anywhere.
61
+
62
+ ## 0.4.1
63
+
64
+ ### Fixed
65
+
66
+ **`onSave` from `init()` never fired.** `save` was a `defineEmits` entry, and
67
+ `defineCustomElement` *replaces* `instance.emit` with a DOM-event dispatcher:
68
+
69
+ ```js
70
+ instance.emit = (event, ...args) => { dispatch(event, args); … }
71
+ ```
72
+
73
+ So `emit("save")` dispatched a CustomEvent and never called the handler the
74
+ host had passed. The Save button appeared (the prop was present) and the
75
+ callback was unreachable — while `handle.on("save", …)` worked, because that
76
+ listens for the DOM event.
77
+
78
+ `save` is no longer an emit. The handler is a prop the component calls
79
+ directly, and the component re-dispatches a `bubbles: true, composed: true`
80
+ CustomEvent alongside it so `handle.on("save", …)` keeps working.
81
+
82
+ `init()` sets it as **`saveHandler`**, not `onSave`: Vue's custom-element
83
+ wrapper routes `on*` keys to its event machinery, so `el.onSave = fn` never
84
+ reaches the component either. Vue hosts keep using `@save`.
85
+
86
+
87
+ ## 0.4.0
88
+
89
+ Gating corrections. All three came from running the editor as a guest, where
90
+ every "can the user do this?" question has a different answer.
91
+
92
+ ### Changed
93
+
94
+ **The Save button now follows an `onSave` handler**, matching how
95
+ `onSendTestEmail` reveals the Send-test button. Pass it and Save appears; omit
96
+ it and the button, the save-status indicator and the autosave timer all
97
+ disappear.
98
+
99
+ ```vue
100
+ <EmailEditor @save="onSave" /> <!-- Vue: @save IS the onSave prop -->
101
+ ```
102
+ ```ts
103
+ init({ onSave(payload) { … } })
104
+ ```
105
+
106
+ 0.3.0 gated this on the storage adapter having `saveTemplate`, which was
107
+ wrong: `mergeWithDefaults` fills every missing method from the localStorage
108
+ defaults, so `saveTemplate` is *always* present by the time anything reads it.
109
+ The check could never be false. Gating on an explicit handler is both correct
110
+ and more discoverable.
111
+
112
+ **The saved-templates panel button is hidden when the host omits
113
+ `listTemplates`.** Same before-merge reasoning. A guest would otherwise be
114
+ offered a template library backed by localStorage that they never saved to and
115
+ cannot reach anywhere else. `versions: true` forces the button on, since
116
+ version history comes from different adapter methods.
117
+
118
+ ### Guest editors
119
+
120
+ The two above make a genuine read-only editor a one-liner, and the shape
121
+ matters:
122
+
123
+ ```ts
124
+ // Right — everything unlisted falls back to localStorage
125
+ const adapter = { loadTemplate: api.loadTemplate };
126
+ ```
127
+ ```ts
128
+ // Wrong — every other method still points at authenticated endpoints,
129
+ // so saving a row 401s
130
+ const { saveTemplate, ...adapter } = api;
131
+ ```
132
+
133
+ With the first, saved rows, image uploads and drafts all keep working against
134
+ the visitor's own browser. Exports work fully. There is no Save button and no
135
+ template library.
136
+
137
+ ## 0.3.0
138
+
139
+ Four fixes from real integration, three of them things only a running app
140
+ could surface.
141
+
142
+ ### Fixed
143
+
144
+ **The editor's CSS no longer leaks into the host page.** The Vue-component
145
+ path injected ~183KB into `document.head` — bare `.grid`, `.flex`, `.hidden`,
146
+ `.block` utilities plus `html`, `body` and `h1`–`h6` element rules. In an app
147
+ that also uses Tailwind, the editor's copy was injected later and won on
148
+ source order, so the host's own layout classes started behaving like the
149
+ editor's.
150
+
151
+ Every rule is now prefixed with `:where(.md-editor-scope)` at build time by a
152
+ PostCSS pass, and the editor root carries that class. `:where()` adds no
153
+ specificity, so the cascade inside the editor is unchanged. `@font-face`,
154
+ `@property`, `@keyframes` and `@import` stay global — they are document-scoped
155
+ by nature, and `@property` in particular is what makes Tailwind's `--tw-*`
156
+ variables resolve at all. `:root`, `html` and `body` are retargeted to the
157
+ editor root rather than dropped, since some carry the editor's own background
158
+ and font stack.
159
+
160
+ Verified on a real mount: 1,121 rules scoped, zero unscoped utilities or
161
+ element rules remaining.
162
+
163
+ **Save is hidden when the host can't save.** Pass a `storageAdapter` without
164
+ `saveTemplate` and the Save button, the save-status indicator and the autosave
165
+ timer all disappear — a guest session no longer fires 401s in the background
166
+ or shows a button that always errors.
167
+
168
+ Gated on `useCanSave()` rather than checking the resolved adapter, because
169
+ `mergeWithDefaults` fills every missing method from the localStorage adapter,
170
+ so `typeof adapter.saveTemplate` is *always* a function by the time anything
171
+ reads it. The signal is computed from the host's partial before merging.
172
+ Passing no adapter at all still counts as "can save" — that is the zero-config
173
+ demo path.
174
+
175
+ ### Added
176
+
177
+ **`ready` event.** Fires once the canvas has actually painted its initial
178
+ content, not when the component mounts. Hosts showing a loading placeholder
179
+ were removing it on mount, which is before `loadTemplate` resolves and the rows
180
+ hydrate — so users watched blocks appear one at a time.
181
+
182
+ ```vue
183
+ <EmailEditor @ready="showSkeleton = false" />
184
+ ```
185
+
186
+ Emitted two ticks after the internal ready state flips, so the DOM for that
187
+ first paint exists by the time the handler runs. Fires once per mount.
188
+
189
+ ### Note on layout
190
+
191
+ The editor is built around **document scroll**: its shell is `min-h-screen`
192
+ with a `sticky top-0` header, so the canvas grows past the viewport and the
193
+ page scrolls under a pinned toolbar. Giving its container a fixed height with
194
+ `overflow: hidden` clips everything below the fold and leaves no scroll
195
+ container to reach it. Give the container a minimum height, not a maximum.
196
+
197
+ The docs previously said "the editor fills its parent; give it a real height",
198
+ which is easy to read as "one viewport tall, overflow hidden". Reworded.
199
+
200
+ ## 0.2.0
201
+
202
+ Adds the write half of the editor's API, version history, a shared row
203
+ library, and two host slots. Nothing in 0.1.x breaks.
204
+
205
+ ### Added
206
+
207
+ **Programmatic write API.** The read side (`getHtml`, `getMjml`,
208
+ `getReactEmail`, `getJson`) has always been public; these are its counterpart,
209
+ so a host can drive the canvas from its own UI without reaching into builder
210
+ internals.
211
+
212
+ ```ts
213
+ setJson(data, opts?) // opts.history: "undoable" (default) | "reset"
214
+ getSelection() // { id, type } | null — type is the block type
215
+ setSelection(id) // false if no block has that id
216
+ onChange(cb) // returns an unsubscribe function
217
+ ```
218
+
219
+ `setJson` accepts exactly what `getJson()` returns, so `setJson(getJson())`
220
+ round-trips, plus the `{ canvas, content: { rows } }` shape version APIs
221
+ typically return. It defaults to a single undoable step. Available on the Vue
222
+ component ref, on `EditorHandle` from `init()`, and on the custom element.
223
+
224
+ **Version history** — `versions` prop on the component and `init()`. Replaces
225
+ the saved-templates panel and its header button with restore / delete /
226
+ delete-all / keep. Backed by five adapter methods:
227
+
228
+ ```ts
229
+ listTemplateVersions(templateId)
230
+ getTemplateVersion(templateId, versionId)
231
+ deleteTemplateVersion(templateId, versionId)
232
+ deleteAllTemplateVersions(templateId) // kept versions survive
233
+ setTemplateVersionKept(templateId, versionId, kept)
234
+ ```
235
+
236
+ Each control appears only when its method exists, so an adapter that can list
237
+ and restore but not delete gets exactly that. `createLocalStorageAdapter`
238
+ implements all five, so this works with no backend.
239
+
240
+ **Shared saved rows** — `listSystemSavedRows()`. An optional read-only second
241
+ row library in its own tab beside the user's own. The tab appears only when
242
+ the call returns rows. Read-only by construction: there is no save/rename/delete
243
+ counterpart, because who may curate a shared library is a permissions question
244
+ the editor has no user model to answer.
245
+
246
+ **Assistant slot.** The editor supplies a drawer, its trigger, open/close
247
+ state, escape handling and focus return; the host supplies the contents.
248
+
249
+ ```vue
250
+ <EmailEditor><template #assistant="{ editor }">…</template></EmailEditor>
251
+ ```
252
+
253
+ ```ts
254
+ init({ assistant: { mount(el, editor) {…}, unmount(el) {} } })
255
+ ```
256
+
257
+ There is no AI in this package. Prompts, endpoints and diff strategy belong to
258
+ whoever is building the product. `mount` runs on first open rather than at
259
+ startup, so a drawer nobody opens costs nothing.
260
+
261
+ **`header-actions` slot.** Host controls beside Save, receiving
262
+ `{ templateId, isSaving, saveStatus }`. Renders nothing when unused.
263
+
264
+ **`brandName`** prop and `init()` option — the "Powered by" line in the
265
+ desktop-only notice. Pass `""` to hide the line entirely.
266
+
267
+ **New exports:** `EditorWriteApi`, `AssistantMount`, `TemplateSummary`,
268
+ `TemplateVersionSummary`.
269
+
270
+ ### Fixed
271
+
272
+ **Published types were broken.** `dist/index.d.ts` re-exported `EmailEditor`
273
+ from a path that was never emitted. Consumers with `skipLibCheck: true` (Nuxt's
274
+ default) got `any` — no prop typing, no autocomplete, no error on a misspelled
275
+ prop; with it off, a hard `TS2307`.
276
+
277
+ Two independent causes, both failing silently:
278
+
279
+ 1. `vite-plugin-dts` needs `processor: "vue"` to emit SFC declarations. Its own
280
+ warning only fires when the entry or an include glob contains `.vue`, and
281
+ neither did.
282
+ 2. `unplugin-dts` gets Vue support from an optional peer on
283
+ `@vue/language-core ^3.1.5`. The playground's `vue-tsc ^2.1.0` hoisted v2 to
284
+ the monorepo root, failing the range check.
285
+
286
+ Fixed by setting `processor: "vue"` and aligning the playground to
287
+ `vue-tsc ^3.3.11`. Declaration coverage went 0 → 122 files.
288
+
289
+ **The typecheck wasn't checking components.** 34 SFCs used `<script setup>`
290
+ without `lang="ts"`, so `vue-shims.d.ts` declared every `*.vue` import as
291
+ `DefineComponent<{}, {}, any>` — which untyped all 121 components as
292
+ collateral. Converted, shim removed, and the 82 latent type errors it was
293
+ hiding are fixed.
294
+
295
+ **`getSelection().type` returned `"component"`** for every block. The tree
296
+ stores the structural kind in `type` and the block kind in `componentType`;
297
+ this returns the latter, which is what the field exists for.
298
+
299
+ ### Removed
300
+
301
+ - `optimizeAI.ts` — AI-facing snapshot stripping, unreferenced and belonging to
302
+ a host rather than the editor.
303
+ - `PropertyNumber.vue` — superseded by `PropertyNumberSlider`, unreferenced.
304
+