useblocks 1.1.85-dev.6 → 1.1.85-dev.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 +14 -2
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/js/{discussHandlers.Ced_gtP0.js → discussHandlers.C5qc-xPl.js} +2 -2
- package/iframe/js/iframe-eblock.body.js +1 -1
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.body.js +2 -2
- package/iframe/js/iframe.js +1 -1
- package/node_modules/useblocks-ui-kit/package.json +1 -1
- package/package.json +2 -2
- package/runtime/react/index.js +1 -1
- package/static/core/{6741eb70.js → 53bcd609.js} +2 -2
- package/static/core/{d0eece8b.js → 77d63e01.js} +1 -1
- package/static/core/{3a252a3c.js → 78b1e678.js} +1 -1
- package/static/core/{9600caf9.js → b49f995f.js} +3 -3
- package/static/core/{b6c5e3be.js → ea93d0cd.js} +2 -2
- package/static/umd-runtime/runtime.js +1 -1
- package/{useblocks-core.d62ebebc.js → useblocks-core.46f9d75a.js} +31 -31
- package/useblocks-esm.js +10 -10
- package/{useblocks-po.d62ebebc.js → useblocks-po.46f9d75a.js} +1 -1
- package/useblocks.d.ts +26 -6
- package/useblocks.js +11 -11
- /package/iframe/{iframe-eblock.d62ebebc.html → iframe-eblock.46f9d75a.html} +0 -0
- /package/iframe/{iframe.d62ebebc.html → iframe.46f9d75a.html} +0 -0
package/README.md
CHANGED
|
@@ -150,9 +150,13 @@ const editor = emailmaker.create({
|
|
|
150
150
|
await editor.ready;
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
You can store the handle, subscribe to events or call `destroy()` right away.
|
|
153
|
+
You can store the handle, subscribe to events or call `destroy()` right away.
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
The handle is bound to the editor as soon as the editor is assembled — before the email from `content`
|
|
156
|
+
is shown — so calls made from handlers (like `compileEmail()` above) reach the editor. Once bound,
|
|
157
|
+
every call goes straight to the editor. Before binding:
|
|
158
|
+
|
|
159
|
+
| what | before binding |
|
|
156
160
|
| --- | --- |
|
|
157
161
|
| `handle*` subscriptions | kept and attached before the first event — nothing is lost |
|
|
158
162
|
| async methods (`show`, `compileEmail`, `getEmailSnapshot`, …) | wait for `ready`, then run |
|
|
@@ -166,6 +170,13 @@ After `destroy()` the handle is detached: its subscriptions are removed and its
|
|
|
166
170
|
destroyed editor's. If another owner has already reused the element, destroying the previous handle
|
|
167
171
|
leaves the editor alone and only takes its own subscriptions with it.
|
|
168
172
|
|
|
173
|
+
Between binding and `ready` the email may not be shown yet. If you need the shown document — a
|
|
174
|
+
`getEmailSnapshot()`, for example — await `ready` first.
|
|
175
|
+
|
|
176
|
+
A second `create()` or `init()` into the same element while the first one is still starting waits for
|
|
177
|
+
it and reuses its editor with the new options: both calls succeed and the editor belongs to the latest
|
|
178
|
+
one.
|
|
179
|
+
|
|
169
180
|
An initialisation error arrives as a `ready` rejection. If you create a handle and never await
|
|
170
181
|
`ready`, such an error surfaces in the console as unhandled — on purpose, otherwise there is no way to
|
|
171
182
|
learn the editor did not start. The exception is `destroy()` before `ready`: that rejection is
|
|
@@ -501,6 +512,7 @@ See typings (**`ExportedApi.DataMixin.Events`**) — includes for example **`han
|
|
|
501
512
|
| handleSaveEmail | Persist email (**`SaveEventPayload`**) |
|
|
502
513
|
| handleReadEmailRevisions | Autosaves / revisions |
|
|
503
514
|
| handleEmailAutosave | Autosave created |
|
|
515
|
+
| handleEmailInit | The email is shown on the canvas. Fires on every fill of the canvas with new content — at start and on each `show()` with another email; repeating the same show or reloading the canvas does not fire it. Do not build one-off actions ("save on first open") on it. |
|
|
504
516
|
| handleReadBlocks | Project blocks |
|
|
505
517
|
| handleReadCommonBlocks | Shared / common blocks |
|
|
506
518
|
| handleReadTemplateBlocks | Template blocks for current email |
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"src": "../packages/html2amp/rules.json",
|
|
12
12
|
"isDynamicEntry": true
|
|
13
13
|
},
|
|
14
|
-
"_discussHandlers.
|
|
15
|
-
"file": "js/discussHandlers.
|
|
14
|
+
"_discussHandlers.C5qc-xPl.js": {
|
|
15
|
+
"file": "js/discussHandlers.C5qc-xPl.js",
|
|
16
16
|
"name": "discussHandlers",
|
|
17
17
|
"imports": [
|
|
18
18
|
"_rolldown-runtime.BRlIiq3h.js"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"src": "iframe-eblock.html",
|
|
40
40
|
"isEntry": true,
|
|
41
41
|
"imports": [
|
|
42
|
-
"_discussHandlers.
|
|
42
|
+
"_discussHandlers.C5qc-xPl.js",
|
|
43
43
|
"_typograf.all.BbXdyfMT.js"
|
|
44
44
|
]
|
|
45
45
|
},
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"isEntry": true,
|
|
51
51
|
"imports": [
|
|
52
52
|
"_rolldown-runtime.BRlIiq3h.js",
|
|
53
|
-
"_discussHandlers.
|
|
53
|
+
"_discussHandlers.C5qc-xPl.js"
|
|
54
54
|
],
|
|
55
55
|
"dynamicImports": [
|
|
56
56
|
"_typograf.all.BbXdyfMT.js"
|