@lit-pigeon/react 0.1.5 → 0.1.7
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 +15 -3
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -40,9 +40,21 @@ function App() {
|
|
|
40
40
|
| `onPreview` | `pigeon:preview` | `void` |
|
|
41
41
|
| `onExport` | `pigeon:export` | `void` |
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
`
|
|
43
|
+
Every element property is also a prop (`document`, `config`, `renderer`,
|
|
44
|
+
`documentToMjml`, `theme`, `themeOverrides`, `templateStorage`,
|
|
45
|
+
`assetStorage`), assigned as a DOM property rather than an attribute. Keep
|
|
46
|
+
object props stable between renders; a new `document` object reloads the
|
|
47
|
+
editor and resets undo history.
|
|
48
|
+
|
|
49
|
+
There are no props for the export, merge-tag or storage-error events, and no
|
|
50
|
+
methods on the component. Attach a `ref` (typed as `PigeonEditor` from
|
|
51
|
+
`@lit-pigeon/editor`) to call `exportHtml()`, `exportMjml()`,
|
|
52
|
+
`loadDocument()` and the rest, or to add other listeners. `pigeon:change` also
|
|
53
|
+
fires when a document is loaded and when only the selection changes.
|
|
54
|
+
|
|
55
|
+
Core types (`PigeonDocument`, `EditorConfig`, `Selection`, `ContentBlock`,
|
|
56
|
+
`RowNode`, `ColumnNode`, `BlockType`, `Spacing`) are re-exported. A full
|
|
57
|
+
example is in [Getting started](../../docs/guide/getting-started.md#react).
|
|
46
58
|
|
|
47
59
|
Part of [Lit Pigeon](https://github.com/snxstudio/lit-pigeon) — open-source drag-and-drop email editor.
|
|
48
60
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lit-pigeon/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "React wrapper for the Pigeon email editor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"
|
|
12
|
-
"
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@lit/react": "^1.0.0",
|
|
22
|
-
"@lit-pigeon/core": "^0.
|
|
23
|
-
"@lit-pigeon/editor": "^0.
|
|
22
|
+
"@lit-pigeon/core": "^0.4.0",
|
|
23
|
+
"@lit-pigeon/editor": "^0.4.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": "^18.0.0 || ^19.0.0",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@types/react": "^18.3.0",
|
|
31
31
|
"react": "^18.3.0",
|
|
32
32
|
"typescript": "^5.5.0",
|
|
33
|
-
"vite": "^
|
|
33
|
+
"vite": "^6.0.0",
|
|
34
34
|
"vite-plugin-dts": "^4.0.0"
|
|
35
35
|
},
|
|
36
36
|
"publishConfig": {
|