useblocks 1.1.85-dev.3 → 1.1.85-dev.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/README.md +20 -0
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/js/{discussHandlers.BxlCsZ-4.js → discussHandlers.Cyqpdj2X.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/umd-runtime/runtime.js +1 -1
- package/{useblocks-core.168aeeb1.js → useblocks-core.fc97f6e8.js} +1 -1
- package/useblocks-esm.js +9 -9
- package/{useblocks-po.168aeeb1.js → useblocks-po.fc97f6e8.js} +1 -1
- package/useblocks.js +10 -10
- package/vite/index.cjs +1 -2
- package/vite/index.js +1 -2
- /package/iframe/{iframe-eblock.168aeeb1.html → iframe-eblock.fc97f6e8.html} +0 -0
- /package/iframe/{iframe.168aeeb1.html → iframe.fc97f6e8.html} +0 -0
package/README.md
CHANGED
|
@@ -208,6 +208,26 @@ is our job, not yours.
|
|
|
208
208
|
| metadata and document state | yes |
|
|
209
209
|
| the email markup | replaced by whatever you pass in `content` |
|
|
210
210
|
|
|
211
|
+
### Tear-down with more than one owner
|
|
212
|
+
|
|
213
|
+
One container outlives several owners: a page starts the editor, the next page enters the same
|
|
214
|
+
container and gets the same instance. This happens without you arranging it — React unmounts the
|
|
215
|
+
previous page **after** mounting the new one, and StrictMode invokes the effect twice.
|
|
216
|
+
|
|
217
|
+
So `destroy()` tears the editor down only for the latest owner. An earlier owner's tear-down means
|
|
218
|
+
"I no longer hold it" and leaves the running instance alone:
|
|
219
|
+
|
|
220
|
+
```javascript
|
|
221
|
+
const first = await emailmaker.init({ element: '#editor', content });
|
|
222
|
+
const second = await emailmaker.init({ element: '#editor', content }); // the same editor
|
|
223
|
+
|
|
224
|
+
first.destroy(); // destroys nothing: second owns it now
|
|
225
|
+
second.destroy(); // destroys it
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Keep what the **latest** `init()` returned. Previously a late tear-down killed the editor under the
|
|
229
|
+
new page, and the next show failed with `DestroyedInstanceError`.
|
|
230
|
+
|
|
211
231
|
### Content
|
|
212
232
|
|
|
213
233
|
Possible shapes:
|
|
@@ -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.Cyqpdj2X.js": {
|
|
15
|
+
"file": "js/discussHandlers.Cyqpdj2X.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.Cyqpdj2X.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.Cyqpdj2X.js"
|
|
54
54
|
],
|
|
55
55
|
"dynamicImports": [
|
|
56
56
|
"_typograf.all.BbXdyfMT.js"
|