useblocks 1.1.85-dev.6 → 1.1.85-dev.8

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 (79) hide show
  1. package/README.md +17 -3
  2. package/iframe/.vite/manifest.json +4 -4
  3. package/iframe/js/{discussHandlers.Ced_gtP0.js → discussHandlers.BuuVtU3Y.js} +5 -5
  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/es/components/Custom/FormPanel/FormSection/index.js +1 -1
  9. package/node_modules/useblocks-ui-kit/es/components/Custom/Inputs/ColorPickerInput/index.js +1 -1
  10. package/node_modules/useblocks-ui-kit/es/components/Custom/Inputs/ControlFontFamily/index.js +1 -1
  11. package/node_modules/useblocks-ui-kit/es/components/Custom/Inputs/InputSelect/index.js +34 -31
  12. package/node_modules/useblocks-ui-kit/es/components/Custom/PanelForm/index.js +1 -1
  13. package/node_modules/useblocks-ui-kit/es/components/DataDisplay/Card/index.js +1 -1
  14. package/node_modules/useblocks-ui-kit/es/components/DataDisplay/Skeleton/index.js +1 -1
  15. package/node_modules/useblocks-ui-kit/es/components/DataEntry/Cascader/index.js +1 -1
  16. package/node_modules/useblocks-ui-kit/es/components/DataEntry/Checkbox/index.js +1 -1
  17. package/node_modules/useblocks-ui-kit/es/components/DataEntry/ColorPicker/index.js +1 -1
  18. package/node_modules/useblocks-ui-kit/es/components/DataEntry/DatePicker/index.js +1 -1
  19. package/node_modules/useblocks-ui-kit/es/components/DataEntry/Form/index.js +1 -1
  20. package/node_modules/useblocks-ui-kit/es/components/DataEntry/Input/index.js +1 -1
  21. package/node_modules/useblocks-ui-kit/es/components/DataEntry/InputNumber/index.js +1 -1
  22. package/node_modules/useblocks-ui-kit/es/components/DataEntry/InputOTP/index.js +1 -1
  23. package/node_modules/useblocks-ui-kit/es/components/DataEntry/Password/index.js +1 -1
  24. package/node_modules/useblocks-ui-kit/es/components/DataEntry/Radio/index.js +1 -1
  25. package/node_modules/useblocks-ui-kit/es/components/DataEntry/SearchInput/index.js +1 -1
  26. package/node_modules/useblocks-ui-kit/es/components/DataEntry/Switch/index.js +2 -2
  27. package/node_modules/useblocks-ui-kit/es/components/DataEntry/TextArea/index.js +1 -1
  28. package/node_modules/useblocks-ui-kit/es/components/Feedback/Alert/index.js +1 -1
  29. package/node_modules/useblocks-ui-kit/es/components/Feedback/Popconfirm/index.js +1 -1
  30. package/node_modules/useblocks-ui-kit/es/components/Feedback/Spin/index.js +1 -1
  31. package/node_modules/useblocks-ui-kit/es/components/Feedback/Tooltip/index.js +1 -1
  32. package/node_modules/useblocks-ui-kit/es/components/General/Button/index.js +1 -1
  33. package/node_modules/useblocks-ui-kit/es/components/Layout/Divider/index.js +1 -1
  34. package/node_modules/useblocks-ui-kit/es/components/Layout/Row/index.js +1 -1
  35. package/node_modules/useblocks-ui-kit/es/components/Layout/Space/index.js +1 -1
  36. package/node_modules/useblocks-ui-kit/es/components/Navigation/FloatButton/index.js +1 -1
  37. package/node_modules/useblocks-ui-kit/es/components/Navigation/Segmented/index.js +1 -1
  38. package/node_modules/useblocks-ui-kit/es/components/Navigation/Tabs/index.js +1 -1
  39. package/node_modules/useblocks-ui-kit/package.json +1 -1
  40. package/package.json +2 -2
  41. package/runtime/react/index.js +1 -1
  42. package/static/core/{9600caf9.js → 06d19668.js} +2 -2
  43. package/static/core/{51a46897.js → 13c7b13a.js} +1 -1
  44. package/static/core/{fdfb1e94.js → 1afe0f9c.js} +1 -1
  45. package/static/core/{8035d07f.js → 28160edc.js} +1 -1
  46. package/static/core/{6a939bac.js → 3d7934fb.js} +1 -1
  47. package/static/core/{6741eb70.js → 3df10afa.js} +8 -8
  48. package/static/core/{e2699a48.js → 41028939.js} +1 -1
  49. package/static/core/{7f91ed03.js → 45eb9af1.js} +1 -1
  50. package/static/core/{60f7aa8d.js → 48a8ba9d.js} +1 -1
  51. package/static/core/{740a4f32.js → 49a8dc9c.js} +1 -1
  52. package/static/core/{284b592e.js → 59cfe4a0.js} +1 -1
  53. package/static/core/{ec4827f1.js → 778aee63.js} +1 -1
  54. package/static/core/{c28968c1.js → 799f4d8e.js} +1 -1
  55. package/static/core/{d0eece8b.js → 7c047ede.js} +1 -1
  56. package/static/core/{9ea82ab5.js → 982730aa.js} +1 -1
  57. package/static/core/{23f020c5.js → a46eae76.js} +1 -1
  58. package/static/core/{fc390885.js → b165db74.js} +1 -1
  59. package/static/core/{991b35ff.js → cb42ad65.js} +1 -1
  60. package/static/core/{7d627bff.js → db82c42b.js} +1 -1
  61. package/static/core/{1bdeb37f.js → df189a9d.js} +1 -1
  62. package/static/core/{74c1d64b.js → f1478faf.js} +1 -1
  63. package/static/core/{6ff64eea.js → f1498d3c.js} +1 -1
  64. package/static/core/{b6c5e3be.js → f8d889a1.js} +2 -2
  65. package/static/core/{3a252a3c.js → fa60c7fb.js} +1 -1
  66. package/static/core/{d2bb1c0d.js → ff43365e.js} +1 -1
  67. package/static/esm/349f9e2c.js +1 -0
  68. package/static/umd-runtime/runtime.js +1 -1
  69. package/static/umd-runtime/ui-kit.js +2 -2
  70. package/{useblocks-core.d62ebebc.js → useblocks-core.ee20cf1c.js} +42 -42
  71. package/useblocks-esm.js +10 -10
  72. package/{useblocks-po.d62ebebc.js → useblocks-po.ee20cf1c.js} +1 -1
  73. package/useblocks.d.ts +33 -6
  74. package/useblocks.js +12 -12
  75. package/vite/index.cjs +38 -0
  76. package/vite/index.js +38 -0
  77. package/static/esm/ff1698e6.js +0 -1
  78. /package/iframe/{iframe-eblock.d62ebebc.html → iframe-eblock.ee20cf1c.html} +0 -0
  79. /package/iframe/{iframe.d62ebebc.html → iframe.ee20cf1c.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. Before `ready`:
153
+ You can store the handle, subscribe to events or call `destroy()` right away.
154
154
 
155
- | what | before ready |
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,15 @@ 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
+ Another `create()` or `init()` into the same element reuses its editor with the new options (waiting for
177
+ a start still in progress): both calls succeed and the editor belongs to the latest
178
+ one. From then on the earlier handle is not the owner: it stops receiving events, and its `destroy()` only
179
+ detaches it and leaves the editor alone. `destroy()` of the latest handle destroys the editor, even before
180
+ its `ready`.
181
+
169
182
  An initialisation error arrives as a `ready` rejection. If you create a handle and never await
170
183
  `ready`, such an error surfaces in the console as unhandled — on purpose, otherwise there is no way to
171
184
  learn the editor did not start. The exception is `destroy()` before `ready`: that rejection is
@@ -501,6 +514,7 @@ See typings (**`ExportedApi.DataMixin.Events`**) — includes for example **`han
501
514
  | handleSaveEmail | Persist email (**`SaveEventPayload`**) |
502
515
  | handleReadEmailRevisions | Autosaves / revisions |
503
516
  | handleEmailAutosave | Autosave created |
517
+ | 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
518
  | handleReadBlocks | Project blocks |
505
519
  | handleReadCommonBlocks | Shared / common blocks |
506
520
  | handleReadTemplateBlocks | Template blocks for current email |
@@ -517,7 +531,7 @@ See typings (**`ExportedApi.DataMixin.Events`**) — includes for example **`han
517
531
  | handleDestroy | Destroy lifecycle |
518
532
  | handleLoad | Instance ready hook |
519
533
  | handleLoadImage | Image upload helpers & proxies |
520
- | handleNotify | Generic notification |
534
+ | handleNotify | Generic notification. Among errors: `TEMPLATE_READ_ERROR` (`data: { templateId }`) — the template named by `templateId` could not be read and the email opened without it. Sent once per template for the editor's lifetime; the event has no title and the editor shows no toast for it — show your own if the user should know. |
521
535
  | handleError | Error toast hook |
522
536
  | handleSuccess | Success toast hook |
523
537
  | handleTestEmailSend | Send test mail |
@@ -11,8 +11,8 @@
11
11
  "src": "../packages/html2amp/rules.json",
12
12
  "isDynamicEntry": true
13
13
  },
14
- "_discussHandlers.Ced_gtP0.js": {
15
- "file": "js/discussHandlers.Ced_gtP0.js",
14
+ "_discussHandlers.BuuVtU3Y.js": {
15
+ "file": "js/discussHandlers.BuuVtU3Y.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.Ced_gtP0.js",
42
+ "_discussHandlers.BuuVtU3Y.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.Ced_gtP0.js"
53
+ "_discussHandlers.BuuVtU3Y.js"
54
54
  ],
55
55
  "dynamicImports": [
56
56
  "_typograf.all.BbXdyfMT.js"