@kodezen/editor 1.0.0-beta.0 → 1.0.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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @kodezen/editor
1
+ # @kodezen/email-builder-editor
2
2
 
3
3
  Embeddable drag-and-drop **block email editor**, extracted from Easy Mail Builder.
4
4
  A drop-in replacement for a Quill/TinyMCE editor: it produces the email HTML
@@ -10,7 +10,7 @@ required of the host) and ships **zero global CSS** (every pane is inline-styled
10
10
  Published/registry:
11
11
 
12
12
  ```bash
13
- npm install @kodezen/editor
13
+ npm install @kodezen/email-builder-editor
14
14
  ```
15
15
 
16
16
  Local (monorepo / sibling plugin) without publishing — point a `file:` dependency
@@ -19,7 +19,7 @@ at this folder:
19
19
  ```jsonc
20
20
  // consumer package.json
21
21
  "dependencies": {
22
- "@kodezen/editor": "file:../easy-mail-builder/email-builder-lib"
22
+ "@kodezen/email-builder-editor": "file:../easy-mail-builder/email-builder-lib"
23
23
  }
24
24
  ```
25
25
 
@@ -36,7 +36,7 @@ must have run `wp_enqueue_media()`.
36
36
  ## Usage
37
37
 
38
38
  ```jsx
39
- import { EmailEditor, renderContent, renderDocument, BLANK_TREE } from '@kodezen/editor';
39
+ import { EmailEditor, renderContent, renderDocument, BLANK_TREE } from '@kodezen/email-builder-editor';
40
40
 
41
41
  const ref = useRef();
42
42
 
@@ -59,16 +59,10 @@ const tree = ref.current.getTree();
59
59
 
60
60
  | Export | What |
61
61
  | --- | --- |
62
- | `EmailEditor` | The controlled editor component (forwardRef → `{ getTree, getHtml, setTree }`). Takes a `mode` prop: `"email"` (default), `"richtext"`, or `"form"`. |
63
- | `RichTextEditor` | `<EmailEditor mode="richtext" />` — the plain Quill-like rich-text surface (HTML in / HTML out). |
64
- | `FormEditor` | `<EmailEditor mode="form" />` — drag-and-drop form builder producing a semantic, responsive `<form>`. `onChange` emits `{ tree, html, schema }`. |
62
+ | `EmailEditor` | The controlled editor component (forwardRef → `{ getTree, getHtml, setTree }`). |
65
63
  | `renderDocument(tree)` | Tree → full email HTML document (doctype + MSO shell). |
66
64
  | `renderContent(tree)` | Tree → content fragment (no doctype/body) for hosts that wrap in their own email shell. |
67
- | `renderFormDocument(tree)` / `renderFormContent(tree)` | Form-mode equivalents of the two above. |
68
- | `extractSchema(tree)` | Form tree → JSON schema describing the fields (name, type, required, options). |
69
65
  | `BLANK_TREE` | Starter tree used when `initialTree` is absent. |
70
- | `treeFromHtml(html)` | Best-effort HTML → tree, for importing existing content into the editor. |
71
- | `htmlToBlocks(html)` | Lower-level HTML → block-array conversion used by `treeFromHtml`. |
72
66
  | `defaultMediaUpload` | The `wp.media`-backed default media handler. |
73
67
 
74
68
  ### `renderMode`
@@ -105,7 +99,3 @@ npm publish --prefix email-builder-lib # add --access public for a public scop
105
99
 
106
100
  After rebuilding, `file:`-dependent consumers must re-run `npm install` (and rebuild)
107
101
  to pick up the new `dist`.
108
-
109
- ## License
110
-
111
- GPL-3.0-or-later. See [`LICENSE`](./LICENSE).