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