useblocks 1.1.85-dev.2 → 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.
Files changed (44) hide show
  1. package/README.md +20 -0
  2. package/iframe/.vite/manifest.json +4 -4
  3. package/iframe/js/{discussHandlers.BtCUuj58.js → discussHandlers.Cyqpdj2X.js} +2 -2
  4. package/iframe/js/iframe-eblock.body.js +1 -1
  5. package/iframe/js/iframe-eblock.js +1 -1
  6. package/iframe/js/iframe.body.js +2 -2
  7. package/iframe/js/iframe.js +1 -1
  8. package/node_modules/useblocks-ui-kit/package.json +1 -1
  9. package/package.json +2 -2
  10. package/runtime/react/index.js +1 -1
  11. package/static/core/{ef3477dd.js → 14a79b09.js} +1 -1
  12. package/static/core/{6c7df338.js → 199dc589.js} +1 -1
  13. package/static/core/{ca873214.js → 230f23ec.js} +1 -1
  14. package/static/core/{181088a9.js → 30f16e98.js} +1 -1
  15. package/static/core/{6fdfa46d.js → 34730be9.js} +1 -1
  16. package/static/core/{9b7f52a5.js → 364dcebf.js} +1 -1
  17. package/static/core/{43affb86.js → 4916b3a1.js} +1 -1
  18. package/static/core/{c789db17.js → 4f790fdc.js} +1 -1
  19. package/static/core/{d74b0853.js → 520ec797.js} +3 -3
  20. package/static/core/{2639f789.js → 57c114f0.js} +1 -1
  21. package/static/core/{cab426fa.js → 5bf994b4.js} +1 -1
  22. package/static/core/{13563d2c.js → 6541580a.js} +1 -1
  23. package/static/core/{a72f1f53.js → 79431a89.js} +1 -1
  24. package/static/core/{b502ca96.js → 8fb0fe48.js} +1 -1
  25. package/static/core/{fad0a613.js → 9a70cc1e.js} +1 -1
  26. package/static/core/{6589e3b8.js → a15ab67d.js} +1 -1
  27. package/static/core/{576452f9.js → adf6e008.js} +1 -1
  28. package/static/core/{f0f90842.js → b743a76d.js} +1 -1
  29. package/static/core/{c6d342f2.js → b97bd382.js} +6 -6
  30. package/static/core/{92e10a15.js → ddb5a35d.js} +1 -1
  31. package/static/core/{70b2c337.js → dfddbd68.js} +1 -1
  32. package/static/core/{6eeae572.js → f3eda1c7.js} +1 -1
  33. package/static/core/{5f0c0e3a.js → ffb36e93.js} +1 -1
  34. package/static/umd-runtime/runtime.js +1 -1
  35. package/{useblocks-core.4865197d.js → useblocks-core.fc97f6e8.js} +8 -8
  36. package/useblocks-esm.js +10 -10
  37. package/{useblocks-po.4865197d.js → useblocks-po.fc97f6e8.js} +1 -1
  38. package/useblocks.js +11 -11
  39. package/vite/index.cjs +100 -5
  40. package/vite/index.js +100 -5
  41. package/webpack/index.cjs +93 -0
  42. package/webpack/index.js +93 -0
  43. /package/iframe/{iframe-eblock.4865197d.html → iframe-eblock.fc97f6e8.html} +0 -0
  44. /package/iframe/{iframe.4865197d.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.BtCUuj58.js": {
15
- "file": "js/discussHandlers.BtCUuj58.js",
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.BtCUuj58.js",
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.BtCUuj58.js"
53
+ "_discussHandlers.Cyqpdj2X.js"
54
54
  ],
55
55
  "dynamicImports": [
56
56
  "_typograf.all.BbXdyfMT.js"