@one-million-lines/email-builder 0.5.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -4,6 +4,82 @@ 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.1] — 2026-09-03
8
+
9
+ ### Fixed
10
+
11
+ - **Rich-text toolbar position** — removed incorrect `window.scrollY` / `scrollX`
12
+ offsets from the `position: fixed` toolbar. `getBoundingClientRect()` already
13
+ returns viewport-relative coordinates; adding scroll offsets pushed the toolbar
14
+ far off-screen when the canvas was scrolled. Also: toolbar is now clamped to
15
+ the viewport on all four edges; all popovers (link, colour, emoji, merge-tag)
16
+ now open **upward** (`bottom-full`) instead of downward, preventing them from
17
+ falling off-screen when the toolbar is near the bottom of the visible area.
18
+ - **Color inputs show resolved hex** — `ColorInput` in the right sidebar now
19
+ displays the resolved hex value (e.g., `#FFFFFF`) in the text field instead of
20
+ the raw theme token string (e.g., `{colors.buttonText}`). The token is still
21
+ preserved in the document until the user types a custom value. The **Reset to
22
+ theme token** button tooltip was updated to show the token path.
23
+
24
+ ### Changed
25
+
26
+ - **Recommendations → opt-in plugin** — the Recommendations panel in the right
27
+ sidebar is now hidden by default and only appears when explicitly enabled.
28
+ This decouples the feature from the core editor for hosts that do not use
29
+ personalised recommendations.
30
+ - New React prop: `<EmailBuilder enableRecommendations />`.
31
+ - New plugin object: `recommendationsPlugin` (pass to `registerPlugin()`).
32
+ - New `BuilderHandle` method: `builder.registerRecommendationsPlugin()`.
33
+ - New reactive store export: `useRecommendationsStore`.
34
+ - New documentation: `src/recommendations/README.md` — covers the data
35
+ schema, algorithm catalog, activation, backend processor integration, and
36
+ the legacy Vibetrace interop shape.
37
+ - **No breaking change for existing documents** — any `module.data.recommendations`
38
+ already in saved JSON is preserved; the panel just won't be visible until
39
+ the plugin is registered.
40
+
41
+ ## [0.6.0] — 2026-09-03
42
+
43
+ ### Added
44
+
45
+ - **8 new email templates** covering core ecommerce lifecycle flows:
46
+ - `back-in-stock` — urgency-first product return notification
47
+ - `price-drop-alert` — 3-product grid with old/new price comparison
48
+ - `post-purchase-follow-up` — warm thank-you, usage tips, soft review request
49
+ - `review-request` — ⭐ prompt with founder personal note and CTA
50
+ - `replenishment-reminder` — "Running low?" reorder with subscription nudge
51
+ - `vip-early-access` — exclusive luxury-themed 24h early access
52
+ - `birthday-reward` — personalised (uses `{user.firstname}` merge tag) birthday voucher
53
+ - `win-back` — re-engagement with "what's new" grid and best offer
54
+ - **HTML preview files** for all 16 templates generated via new script
55
+ (`scripts/generate-previews.mjs`) to `examples/previews/<id>.html`.
56
+ Each preview wraps the email HTML in a minimal browser shell with a sticky
57
+ info bar (template name, category, description).
58
+ - `"generate:previews"` npm script: `npm run build && node scripts/generate-previews.mjs`.
59
+
60
+ ### Fixed
61
+
62
+ - **Text selection loss** — `TextRender` in `Canvas.tsx` no longer uses
63
+ `dangerouslySetInnerHTML`. innerHTML is now synced from the store **only
64
+ when the element is not focused**, preventing React from clobbering
65
+ in-progress text selections or cursor positions during parent re-renders.
66
+ This was the root cause of "cursor jumps to start of block" when editing.
67
+ - **Bold button missing** in the rich-text toolbar — replaced lucide `Bold`,
68
+ `Italic`, `Underline` icons with styled `<b>B</b>`, `<i>I</i>`, `<u>U</u>`
69
+ text to avoid icon availability issues and to match toolbar conventions.
70
+ - **Link insertion** (`LinkPopover`) now correctly focuses the contenteditable
71
+ element and restores the saved selection range before calling `insertHTML`,
72
+ so links are inserted at the correct position.
73
+
74
+ ### Changed
75
+
76
+ - **Right sidebar** — added an **expand/narrow** toggle button (◁▷) next to
77
+ the existing collapse button. The sidebar now has three states:
78
+ - **Collapsed**: 6px strip with re-open button
79
+ - **Normal**: 288px (w-72) — default
80
+ - **Expanded**: 576px (w-[576px]) — double width, useful for complex panels
81
+ Smooth CSS transition between states.
82
+
7
83
  ## [0.5.0] — 2026-09-03
8
84
 
9
85
  ### Added
@@ -51,6 +51,12 @@ export interface BuilderHandle {
51
51
  setAIProvider: (provider: AIProvider) => void;
52
52
  /** Configure the list of merge tags available in the text element sidebar. */
53
53
  registerMergeTags: (tags: MergeTag[]) => void;
54
+ /**
55
+ * Opt in to the recommendations engine. When called, the Recommendations
56
+ * panel appears in the right sidebar for any module that contains a
57
+ * `productGrid` element. Without this call the panel stays hidden.
58
+ */
59
+ registerRecommendationsPlugin: () => void;
54
60
  }
55
61
  export type PluginType = "modules" | "themes" | "asset-provider" | "product-provider" | "voucher-provider" | "ai-provider";
56
62
  export interface Plugin {