@one-million-lines/email-builder 0.1.1 → 0.1.4

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
@@ -6,13 +6,53 @@ This project adheres to [Semantic Versioning](https://semver.org/) and the
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.4] — 2026-07-02
10
+
11
+ ### Changed
12
+ - **Dependencies upgraded to latest releases** (no public API changes):
13
+ - `@dnd-kit/core` `^6.1.0` → `^6.3.1`
14
+ - `@dnd-kit/sortable` `^8.0.0` → `^10.0.0`
15
+ - `lucide-react` `^0.460.0` → `^1.23.0`
16
+ - `zod` `^3.23.8` → `^4.4.3` (v4 is API-compatible for the schemas used here)
17
+ - `zustand` `^5.0.2` → `^5.0.14`
18
+ - **Dev dependencies upgraded to latest releases**:
19
+ - `react` / `react-dom` (dev) `^19.0.0` → `^19.2.7`
20
+ - `@types/react` `^19.0.0` → `^19.2.17`
21
+ - `@types/react-dom` `^19.0.0` → `^19.2.3`
22
+ - `@tailwindcss/vite` `^4.1.0` → `^4.3.2`
23
+ - `tailwindcss` `^4.1.0` → `^4.3.2`
24
+ - `@vitejs/plugin-react-swc` `^3.5.0` → `^4.3.1`
25
+ - `typescript` `^5.5.3` → `^6.0.3`
26
+ - `vite-plugin-dts` `^4.0.0` → `^5.0.3`
27
+ - `jsdom` `^25.0.1` → `^29.1.1`
28
+ - `eslint` `^9.x` → `^10.6.0`
29
+ - `engines.node` bumped to `>=22` in line with supported LTS range.
30
+
31
+ ## [0.1.2] — 2026-06-30
32
+
9
33
  ### Added
10
34
  - npm library build (`dist/email-builder.js` ESM, `dist/email-builder.cjs` CommonJS).
11
35
  - Generated TypeScript declarations (`dist/index.d.ts` + per-module `.d.ts`).
12
- - Compiled stylesheet at `dist/styles.css`, imported via `openpostcards-builder/styles.css`.
36
+ - Compiled stylesheet at `dist/styles.css`, imported via `@one-million-lines/email-builder/styles.css`.
13
37
  - `exports` map, `files` allowlist, and publishing metadata in `package.json`.
14
38
  - Library-only stylesheet (`src/lib.css`) that omits app `html/body/#root` globals.
15
39
 
40
+ ### Fixed
41
+ - **CSS isolation** — `src/lib.css` no longer imports Tailwind Preflight
42
+ (`@import "tailwindcss"` → `@import "tailwindcss/theme"` + `@import
43
+ "tailwindcss/utilities"`). The global CSS reset no longer leaks into the host
44
+ application.
45
+ - Added `.oml-email-builder` as the root class on the `<App>` element. All
46
+ builder styles are now nested under this class in the DOM.
47
+ - Scoped minimal reset (`box-sizing`, `button`, `input`, `img` defaults) applied
48
+ only inside `.oml-email-builder` via `@layer base`, replacing the Preflight
49
+ rules that were previously global.
50
+ - `[contenteditable="true"]:focus` selector is now scoped to
51
+ `.oml-email-builder` and no longer affects host page content.
52
+ - Replaced `h-screen w-screen` on the builder root with `h-full w-full` so the
53
+ builder fills its container rather than always taking up the full viewport. The
54
+ host is responsible for sizing the container (e.g., `height: 100vh`).
55
+
16
56
  ### Changed
17
57
  - `react` and `react-dom` are now **peer dependencies** (no longer bundled).
18
58
  - Runtime dependencies (`@dnd-kit/*`, `lucide-react`, `zod`, `zustand`) are
package/README.md CHANGED
@@ -56,15 +56,16 @@ src/
56
56
  ## Install
57
57
 
58
58
  ```bash
59
- npm install openpostcards-builder react react-dom
59
+ npm install @one-million-lines/email-builder react react-dom
60
60
  ```
61
61
 
62
62
  `react` and `react-dom` (v18 or v19) are **peer dependencies** — install them in
63
63
  your app; they are never bundled into the package.
64
64
 
65
- > **MANUAL ACTION REQUIRED:** `openpostcards-builder` is a placeholder package
66
- > name. Check availability and choose/reserve your own npm name before publishing,
67
- > then update `package.json` `name`, `repository`, `homepage`, and `bugs`.
65
+ > **MANUAL ACTION REQUIRED:** This package is configured to publish under the
66
+ > `@one-million-lines` npm scope. Before publishing, confirm you own/have publish
67
+ > access to that npm organization and that `@one-million-lines/email-builder` is
68
+ > available (or already yours). `publishConfig.access` is set to `public`.
68
69
 
69
70
  ## Getting started
70
71
 
@@ -88,8 +89,8 @@ The production build uses `/demo/email-builder/` as the Vite base path.
88
89
  React:
89
90
 
90
91
  ```tsx
91
- import { EmailBuilder } from "openpostcards-builder";
92
- import "openpostcards-builder/styles.css";
92
+ import { EmailBuilder } from "@one-million-lines/email-builder";
93
+ import "@one-million-lines/email-builder/styles.css";
93
94
 
94
95
  <EmailBuilder
95
96
  initialDocument={emailJson}
@@ -101,8 +102,8 @@ import "openpostcards-builder/styles.css";
101
102
  Vanilla JS:
102
103
 
103
104
  ```ts
104
- import { createEmailBuilder } from "openpostcards-builder";
105
- import "openpostcards-builder/styles.css";
105
+ import { createEmailBuilder } from "@one-million-lines/email-builder";
106
+ import "@one-million-lines/email-builder/styles.css";
106
107
 
107
108
  const instance = createEmailBuilder({
108
109
  container: document.getElementById("builder")!,
@@ -115,7 +116,7 @@ const instance = createEmailBuilder({
115
116
  // instance.getDocument(); instance.exportHtml(); instance.exportJson(); instance.destroy();
116
117
  ```
117
118
 
118
- Always import the stylesheet once per app: `import "openpostcards-builder/styles.css";`
119
+ Always import the stylesheet once per app: `import "@one-million-lines/email-builder/styles.css";`
119
120
 
120
121
  ### Framework integration
121
122
 
@@ -132,17 +133,58 @@ Vue and Angular mount the React-based editor through the framework-neutral
132
133
 
133
134
  ### Styling & isolation
134
135
 
135
- The stylesheet at `openpostcards-builder/styles.css` includes Tailwind
136
- **Preflight**, a global CSS reset that normalizes `margin`, `box-sizing`,
137
- headings, lists, etc. When embedding into an existing design system this can
138
- affect host styles. Mitigations:
136
+ The stylesheet at `@one-million-lines/email-builder/styles.css` is designed to
137
+ be embedded safely alongside any host design system (Tailwind, Bootstrap,
138
+ shadcn/ui, Material UI, custom CSS):
139
+
140
+ - **No Preflight** — Tailwind Preflight (global CSS reset) is excluded from the
141
+ library stylesheet. Only `theme` variables and `utilities` are imported.
142
+ - **Scoped reset** — A minimal `box-sizing`, `button`, `input`, and `img` reset
143
+ is applied only inside `.oml-email-builder` via `@layer base`.
144
+ - **Root class** — The builder's root element carries the class
145
+ `oml-email-builder`. Every builder style targets this class, so nothing leaks
146
+ to the host page.
147
+ - **`[contenteditable]` focus** — The inline focus outline is scoped to
148
+ `.oml-email-builder [contenteditable]` and never affects host page content.
149
+ - **Tailwind theme variables** — Tailwind v4 CSS custom properties
150
+ (`--color-*`, `--font-*`, `--spacing-*`, etc.) are declared on `:root` as
151
+ part of the Tailwind theme layer. They use Tailwind's own naming convention
152
+ and are unlikely to conflict with host variables; if they do, override them on
153
+ the container.
154
+
155
+ **Sizing the container:**
156
+
157
+ The builder fills its container (`h-full w-full`). Give the container explicit
158
+ dimensions before mounting:
159
+
160
+ ```html
161
+ <!-- HTML -->
162
+ <div id="builder" style="height: 100vh; width: 100%;"></div>
163
+ ```
164
+
165
+ ```tsx
166
+ // React
167
+ <div style={{ height: "100vh", width: "100%" }}>
168
+ <EmailBuilder ... />
169
+ </div>
170
+ ```
139
171
 
140
- - Load the editor in a dedicated route/page where the reset is acceptable, or
141
- - Scope/encapsulate it (e.g., render inside an iframe or a Shadow DOM host), or
142
- - Build your own Tailwind stylesheet without Preflight if your app already
143
- provides resets.
172
+ **Modals and overlays:**
144
173
 
145
- The editor root uses `h-screen w-screen`; place it in a full-size container.
174
+ The Templates modal renders with `position: fixed; z-index: 50` to cover the
175
+ viewport. This is intentional for a full-screen editing tool. If your host has
176
+ a higher `z-index` stacking context, wrap the builder container with
177
+ `isolation: isolate` and ensure your modal z-indices are coordinated.
178
+
179
+ **Host compatibility:**
180
+
181
+ | Host design system | Notes |
182
+ |---|---|
183
+ | Tailwind CSS | No conflict. The builder uses the same Tailwind theme tokens. |
184
+ | Bootstrap | No conflict. No Preflight, no overriding resets. |
185
+ | shadcn/ui | No conflict. scoped reset does not override shadcn variables. |
186
+ | Material UI | No conflict. MUI's emotion styles are not affected. |
187
+ | Custom global CSS | As long as your CSS does not target `.oml-email-builder` descendant elements, there is no conflict. |
146
188
 
147
189
  ### Server-side rendering
148
190
 
@@ -154,7 +196,7 @@ effect, or dynamically import it with SSR disabled in Next.js:
154
196
  import dynamic from "next/dynamic";
155
197
 
156
198
  const EmailBuilder = dynamic(
157
- () => import("openpostcards-builder").then((m) => m.EmailBuilder),
199
+ () => import("@one-million-lines/email-builder").then((m) => m.EmailBuilder),
158
200
  { ssr: false }
159
201
  );
160
202
  ```
@@ -181,7 +223,11 @@ npm pack # create the .tgz to test in a consumer app
181
223
  To publish (run manually):
182
224
 
183
225
  ```bash
184
- # MANUAL ACTION REQUIRED — choose a real package name first, then:
226
+ # MANUAL ACTION REQUIRED — log in to an account with publish access to the @one-million-lines scope, then:
227
+ npm version patch # 0.1.3 -> 0.1.4, bugfix
228
+ npm version minor # 0.1.3 -> 0.2.0, new feature
229
+ npm version major # 0.1.3 -> 1.0.0, breaking change
230
+
185
231
  npm login
186
232
  npm publish --access public
187
233
  ```
package/dist/App.d.ts CHANGED
@@ -1 +1 @@
1
- export declare function App(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function App(): import("react").JSX.Element;