@one-million-lines/email-builder 0.4.0 → 0.6.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.
- package/CHANGELOG.md +81 -0
- package/dist/editor/RichTextToolbar.d.ts +1 -0
- package/dist/editor/richTextState.d.ts +7 -0
- package/dist/email-builder.cjs +10 -11
- package/dist/email-builder.cjs.map +1 -1
- package/dist/email-builder.js +2741 -1509
- package/dist/email-builder.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/templates/backInStock.d.ts +3 -0
- package/dist/templates/birthdayReward.d.ts +3 -0
- package/dist/templates/postPurchaseFollowUp.d.ts +3 -0
- package/dist/templates/priceDropAlert.d.ts +3 -0
- package/dist/templates/replenishmentReminder.d.ts +3 -0
- package/dist/templates/reviewRequest.d.ts +3 -0
- package/dist/templates/vipEarlyAccess.d.ts +3 -0
- package/dist/templates/winBackCampaign.d.ts +3 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,87 @@ All notable changes to this package are documented here.
|
|
|
4
4
|
This project adheres to [Semantic Versioning](https://semver.org/) and the
|
|
5
5
|
[Keep a Changelog](https://keepachangelog.com/) format.
|
|
6
6
|
|
|
7
|
+
## [0.6.0] — 2026-09-03
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **8 new email templates** covering core ecommerce lifecycle flows:
|
|
12
|
+
- `back-in-stock` — urgency-first product return notification
|
|
13
|
+
- `price-drop-alert` — 3-product grid with old/new price comparison
|
|
14
|
+
- `post-purchase-follow-up` — warm thank-you, usage tips, soft review request
|
|
15
|
+
- `review-request` — ⭐ prompt with founder personal note and CTA
|
|
16
|
+
- `replenishment-reminder` — "Running low?" reorder with subscription nudge
|
|
17
|
+
- `vip-early-access` — exclusive luxury-themed 24h early access
|
|
18
|
+
- `birthday-reward` — personalised (uses `{user.firstname}` merge tag) birthday voucher
|
|
19
|
+
- `win-back` — re-engagement with "what's new" grid and best offer
|
|
20
|
+
- **HTML preview files** for all 16 templates generated via new script
|
|
21
|
+
(`scripts/generate-previews.mjs`) to `examples/previews/<id>.html`.
|
|
22
|
+
Each preview wraps the email HTML in a minimal browser shell with a sticky
|
|
23
|
+
info bar (template name, category, description).
|
|
24
|
+
- `"generate:previews"` npm script: `npm run build && node scripts/generate-previews.mjs`.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- **Text selection loss** — `TextRender` in `Canvas.tsx` no longer uses
|
|
29
|
+
`dangerouslySetInnerHTML`. innerHTML is now synced from the store **only
|
|
30
|
+
when the element is not focused**, preventing React from clobbering
|
|
31
|
+
in-progress text selections or cursor positions during parent re-renders.
|
|
32
|
+
This was the root cause of "cursor jumps to start of block" when editing.
|
|
33
|
+
- **Bold button missing** in the rich-text toolbar — replaced lucide `Bold`,
|
|
34
|
+
`Italic`, `Underline` icons with styled `<b>B</b>`, `<i>I</i>`, `<u>U</u>`
|
|
35
|
+
text to avoid icon availability issues and to match toolbar conventions.
|
|
36
|
+
- **Link insertion** (`LinkPopover`) now correctly focuses the contenteditable
|
|
37
|
+
element and restores the saved selection range before calling `insertHTML`,
|
|
38
|
+
so links are inserted at the correct position.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- **Right sidebar** — added an **expand/narrow** toggle button (◁▷) next to
|
|
43
|
+
the existing collapse button. The sidebar now has three states:
|
|
44
|
+
- **Collapsed**: 6px strip with re-open button
|
|
45
|
+
- **Normal**: 288px (w-72) — default
|
|
46
|
+
- **Expanded**: 576px (w-[576px]) — double width, useful for complex panels
|
|
47
|
+
Smooth CSS transition between states.
|
|
48
|
+
|
|
49
|
+
## [0.5.0] — 2026-09-03
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- **Inline rich-text toolbar** — a floating, selection-aware formatting bar
|
|
54
|
+
appears whenever the cursor is inside a text element in the canvas.
|
|
55
|
+
- **Formatting**: Bold, Italic, Underline — toggle buttons that reflect the
|
|
56
|
+
current selection state via `queryCommandState`.
|
|
57
|
+
- **Font family** — email-safe font stacks: Arial, Georgia, Tahoma, Trebuchet
|
|
58
|
+
MS, Verdana, Courier New, Times New Roman. Wraps the selection in
|
|
59
|
+
`<span style="font-family:...">`.
|
|
60
|
+
- **Font size** — 10–48 px presets. Wraps the selection in
|
|
61
|
+
`<span style="font-size:...px">`.
|
|
62
|
+
- **Text colour** — 21 preset swatches plus a custom hex/name input. Uses
|
|
63
|
+
`styleWithCSS` + `execCommand('foreColor')` to produce
|
|
64
|
+
`<span style="color:...">`.
|
|
65
|
+
- **Insert link** — inline popover with a URL input and a special-link role
|
|
66
|
+
dropdown (Unsubscribe, View in browser, Manage preferences, User profile).
|
|
67
|
+
Wraps the selection in `<a href="..." data-link-type="...">` or inserts a
|
|
68
|
+
standalone linked anchor when nothing is selected.
|
|
69
|
+
- **Emoji picker** — 44 curated emojis in a compact grid; inserts at cursor.
|
|
70
|
+
- **Merge-tag inserter** — when `mergeTags` are configured, a tag dropdown
|
|
71
|
+
appears in the toolbar; selecting a tag inserts `{attribute}` at the cursor.
|
|
72
|
+
- The toolbar uses `onMouseDown + preventDefault` on all buttons so the
|
|
73
|
+
contenteditable never loses focus during formatting.
|
|
74
|
+
- New files: `src/editor/RichTextToolbar.tsx`, `src/editor/richTextState.ts`.
|
|
75
|
+
|
|
76
|
+
### Changed
|
|
77
|
+
|
|
78
|
+
- **Right sidebar — Text element panel** simplified. Removed per-selection
|
|
79
|
+
properties (font family, font size, font weight, colour, link URL, link role,
|
|
80
|
+
merge-tag inserter) which are now handled by the inline toolbar. The sidebar
|
|
81
|
+
now only shows block-level settings: default alignment, line height, letter
|
|
82
|
+
spacing, padding, and visibility (hide on mobile / desktop).
|
|
83
|
+
- `TextRender` in `Canvas.tsx` now registers/unregisters itself with
|
|
84
|
+
`useRichTextStore` on focus/blur, supplies a `data-email-text` attribute for
|
|
85
|
+
toolbar targeting, and prevents click events from bubbling when the element is
|
|
86
|
+
actively being edited (so caret repositioning clicks don't deselect the element).
|
|
87
|
+
|
|
7
88
|
## [0.4.0] — 2026-09-03
|
|
8
89
|
|
|
9
90
|
### Added
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function RichTextToolbar(): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface RichTextState {
|
|
2
|
+
/** The currently focused contenteditable element, or null. */
|
|
3
|
+
activeEl: HTMLElement | null;
|
|
4
|
+
setActiveEl: (el: HTMLElement | null) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const useRichTextStore: import('zustand').UseBoundStore<import('zustand').StoreApi<RichTextState>>;
|
|
7
|
+
export {};
|