@one-million-lines/email-builder 0.4.0 → 0.5.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 CHANGED
@@ -4,6 +4,45 @@ 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.5.0] — 2026-09-03
8
+
9
+ ### Added
10
+
11
+ - **Inline rich-text toolbar** — a floating, selection-aware formatting bar
12
+ appears whenever the cursor is inside a text element in the canvas.
13
+ - **Formatting**: Bold, Italic, Underline — toggle buttons that reflect the
14
+ current selection state via `queryCommandState`.
15
+ - **Font family** — email-safe font stacks: Arial, Georgia, Tahoma, Trebuchet
16
+ MS, Verdana, Courier New, Times New Roman. Wraps the selection in
17
+ `<span style="font-family:...">`.
18
+ - **Font size** — 10–48 px presets. Wraps the selection in
19
+ `<span style="font-size:...px">`.
20
+ - **Text colour** — 21 preset swatches plus a custom hex/name input. Uses
21
+ `styleWithCSS` + `execCommand('foreColor')` to produce
22
+ `<span style="color:...">`.
23
+ - **Insert link** — inline popover with a URL input and a special-link role
24
+ dropdown (Unsubscribe, View in browser, Manage preferences, User profile).
25
+ Wraps the selection in `<a href="..." data-link-type="...">` or inserts a
26
+ standalone linked anchor when nothing is selected.
27
+ - **Emoji picker** — 44 curated emojis in a compact grid; inserts at cursor.
28
+ - **Merge-tag inserter** — when `mergeTags` are configured, a tag dropdown
29
+ appears in the toolbar; selecting a tag inserts `{attribute}` at the cursor.
30
+ - The toolbar uses `onMouseDown + preventDefault` on all buttons so the
31
+ contenteditable never loses focus during formatting.
32
+ - New files: `src/editor/RichTextToolbar.tsx`, `src/editor/richTextState.ts`.
33
+
34
+ ### Changed
35
+
36
+ - **Right sidebar — Text element panel** simplified. Removed per-selection
37
+ properties (font family, font size, font weight, colour, link URL, link role,
38
+ merge-tag inserter) which are now handled by the inline toolbar. The sidebar
39
+ now only shows block-level settings: default alignment, line height, letter
40
+ spacing, padding, and visibility (hide on mobile / desktop).
41
+ - `TextRender` in `Canvas.tsx` now registers/unregisters itself with
42
+ `useRichTextStore` on focus/blur, supplies a `data-email-text` attribute for
43
+ toolbar targeting, and prevents click events from bubbling when the element is
44
+ actively being edited (so caret repositioning clicks don't deselect the element).
45
+
7
46
  ## [0.4.0] — 2026-09-03
8
47
 
9
48
  ### 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 {};