useblocks 1.3.5 → 1.3.10

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 (72) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +21 -0
  3. package/iframe/.vite/manifest.json +4 -4
  4. package/iframe/css/sandbox.css +12 -0
  5. package/iframe/{iframe-eblock.cc33bf3e.html → iframe-eblock.5455e870.html} +2 -2
  6. package/iframe/{iframe.cc33bf3e.html → iframe.5455e870.html} +2 -2
  7. package/iframe/js/elMarkupHelper.Cv72GdwF.js +279 -0
  8. package/iframe/js/{iframe-eblock.body.cc33bf3e.js → iframe-eblock.body.5455e870.js} +1 -1
  9. package/iframe/js/iframe-eblock.js +2 -2
  10. package/iframe/js/iframe.body.5455e870.js +129 -0
  11. package/iframe/js/iframe.js +2 -2
  12. package/package.json +1 -1
  13. package/runtime/react/index.js +1 -1
  14. package/static/core/{100d863a.js → 19270609.js} +1 -1
  15. package/static/core/233f23fd.js +1 -0
  16. package/static/core/{2a1ca143.js → 2cf7ee08.js} +1 -1
  17. package/static/core/32f12150.js +1 -0
  18. package/static/core/{2a88a7ce.js → 38606c7d.js} +3 -3
  19. package/static/core/{95f608ad.js → 395f9635.js} +1 -1
  20. package/static/core/4030ef2c.js +1 -0
  21. package/static/core/4274a244.js +1 -0
  22. package/static/core/{80391bda.js → 43305d10.js} +1 -1
  23. package/static/core/{c0fa9d67.js → 48def854.js} +1 -1
  24. package/static/core/{3b8edeff.js → 4de0fff7.js} +1 -1
  25. package/static/core/4fec552e.js +1 -0
  26. package/static/core/{d26051be.js → 5a290fb6.js} +1 -1
  27. package/static/core/630febfd.js +1 -0
  28. package/static/core/6539262f.js +1 -0
  29. package/static/core/{b99d703d.js → 710be2de.js} +1 -1
  30. package/static/core/{7d879bb5.js → 7774d8cb.js} +1 -1
  31. package/static/core/{43ebd972.js → 791b9022.js} +1 -1
  32. package/static/core/{7d6f6c29.js → 7a43af5d.js} +1 -1
  33. package/static/core/{d98674b7.js → 7d2c1fd4.js} +1 -1
  34. package/static/core/{87aedddb.js → 7da32d21.js} +1 -1
  35. package/static/core/84c5ed0d.js +1 -0
  36. package/static/core/8606910e.js +1 -0
  37. package/static/core/{875e46a6.js → 91017e83.js} +1 -1
  38. package/static/core/{23b6bc56.js → 97db045b.js} +1 -1
  39. package/static/core/{93382e36.js → 9ccecd4a.js} +1 -1
  40. package/static/core/9f336cc6.js +1 -0
  41. package/static/core/a802b68f.js +1 -0
  42. package/static/core/acf08b55.js +1 -0
  43. package/static/core/{66619f08.js → b1edf5c5.js} +6 -6
  44. package/static/core/bf6643b0.js +1 -0
  45. package/static/core/{2de2e937.js → c24c3d6b.js} +1 -1
  46. package/static/core/{bc6678e8.js → c41fa010.js} +1 -1
  47. package/static/core/{61af94af.js → c8cfd469.js} +2 -2
  48. package/static/core/cbfe265e.js +1 -0
  49. package/static/core/d8d10299.js +19 -0
  50. package/static/core/{f3f60a1a.js → dd82fe37.js} +1 -1
  51. package/static/core/{cb30c7d7.js → e0f9c94e.js} +1 -1
  52. package/static/core/e532cd8d.js +10 -0
  53. package/static/core/{bb91f8dd.js → e7f50492.js} +1 -1
  54. package/static/core/eeba774d.js +163 -0
  55. package/static/core/ef13a2d7.js +1 -0
  56. package/static/core/{70467601.js → f033fd82.js} +1 -1
  57. package/static/core/{ac9606f9.js → f615b5d9.js} +2 -2
  58. package/static/core/fe47306c.js +1 -0
  59. package/static/esm/{3ce60f99.js → b6a1b54a.js} +1 -1
  60. package/static/umd-runtime/runtime.C1l7PfWP.js +1 -0
  61. package/useblocks-core.5455e870.js +875 -0
  62. package/useblocks-esm.js +53 -39
  63. package/{useblocks-po.cc33bf3e.js → useblocks-po.5455e870.js} +1 -1
  64. package/useblocks.d.ts +95 -5
  65. package/useblocks.js +54 -40
  66. package/vendor/useblocks-ui-kit/package.json +1 -1
  67. package/iframe/js/elMarkupHelper.DXAm8_Hg.js +0 -278
  68. package/iframe/js/iframe.body.cc33bf3e.js +0 -129
  69. package/static/core/5d75a7d6.js +0 -1
  70. package/static/core/9a39a2dd.js +0 -28
  71. package/static/umd-runtime/runtime.CpvZ7_Hr.js +0 -1
  72. package/useblocks-core.cc33bf3e.js +0 -859
package/CHANGELOG.md CHANGED
@@ -6,6 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
6
6
 
7
7
  ---
8
8
 
9
+ ## [Unreleased]
10
+
11
+ ### Added
12
+
13
+ - "Start with a blank email" button on the canvas: appears when the email has nothing to show and brings back the scaffold, so
14
+ blocks can be inserted again
15
+
16
+ ### Changed
17
+
18
+ - An email with erased code now saves empty like any other edit: `save()` no longer refuses with `empty-content`,
19
+ `EMAIL_EMPTY_SAVE_BLOCKED` is no longer fired, and an empty snapshot goes to autosave
20
+ - New plugin email: `show()` without `code` opens the updated scaffold code, and an empty `subject` becomes the
21
+ "New email" subject in the interface language. This subject goes to `<title>` and to `getEmail()`
22
+ - The "Blank template" card creates an email without a server request and without parent blocks
23
+
9
24
  ## [1.3.5] - 2026-11-03
10
25
 
11
26
  ### Added
package/README.md CHANGED
@@ -98,6 +98,26 @@ Webpack/Vite host plugins inject **`__useblocks__ = { publicPath: '...' }`** so
98
98
 
99
99
  For **`useblocks`** the Webpack plugin class is **`UseblocksWebpackPlugin`**.
100
100
 
101
+ ## Caching after a package update
102
+
103
+ The host plugin copies the package's static files into your build, and your server serves them. To have
104
+ users get the new version right after you update the package, with no browser cache reset, split the
105
+ files into two kinds.
106
+
107
+ | Files | `Cache-Control` | Why |
108
+ | --- | --- | --- |
109
+ | Hash in the name: **`useblocks-core.<hash>.js`**, **`useblocks-po.<hash>.js`**, **`static/**/<hash>.js`**, **`iframe/iframe.<hash>.html`**, **`iframe/js/*.<hash>.js`**, **`static/media/*.<hash>.*`** | `public, max-age=31536000, immutable` | New content ships under a new name, so the old file can be kept forever. |
110
+ | No hash: **`useblocks.js`**, **`useblocks-esm.js`**, **`compat-globals.js`**, **`iframe/js/boot-guard.js`**, **`iframe/css/*.css`** and the rest | `no-cache` | The name is the same in every version. The browser keeps the file but checks it with the server before use; if it has not changed, the answer is a short `304`. |
111
+ | Your HTML pages with the editor | `no-cache` | The page has to pick up the new editor entry. |
112
+
113
+ A hash is 8 hex characters (`.f9289386.`; 20 for images and fonts) or 8 base64 characters in the
114
+ **`static/*`** and **`iframe/js`** directories (`DS2seoW7.js`). Other eight-letter names (`Checkbox.js`) are not hashes.
115
+
116
+ Do not put a long `max-age` or `expires` on files without a hash. A cached **`useblocks.js`** points to
117
+ the core and chunks of its own version: after an update the browser keeps starting the old editor, and
118
+ once the old files are removed it gets load errors. If your bundler builds the **`useblocks-esm.js`**
119
+ entry, it names that file itself — then the rule covers only the copied static files.
120
+
101
121
  # Initialization
102
122
 
103
123
  Import the plugin in application code:
@@ -487,6 +507,7 @@ Editor UI tuning. Use **`instance.setConfig`**, **`instance.updateConfig`**, **`
487
507
  | blocksEmptyEnabled | Show empty blocks. | true |
488
508
  | blocksSavedEnabled | Show saved blocks. | true |
489
509
  | blocksCommonEnabled | Show common blocks. | true |
510
+ | blocksCommonSource | Source of common blocks when blocks are stored on Go and `handleReadCommonBlocks` returned nothing: `gallery` — the product gallery, `project` — blocks of the project this plugin key belongs to (insert only). | gallery |
490
511
  | blocksTemplateEnabled | Show template blocks. | true |
491
512
  | blocksSearchEnabled | Show blocks search. | true |
492
513
  | blocksAddPanelEnabled | Show add block panel in visual editor. | true |
@@ -11,8 +11,8 @@
11
11
  "src": "../packages/html2amp/rules.json",
12
12
  "isDynamicEntry": true
13
13
  },
14
- "_elMarkupHelper.DXAm8_Hg.js": {
15
- "file": "js/elMarkupHelper.DXAm8_Hg.js",
14
+ "_elMarkupHelper.Cv72GdwF.js": {
15
+ "file": "js/elMarkupHelper.Cv72GdwF.js",
16
16
  "name": "elMarkupHelper",
17
17
  "dynamicImports": [
18
18
  "../packages/html2amp/rules.json",
@@ -26,7 +26,7 @@
26
26
  "src": "iframe-eblock.html",
27
27
  "isEntry": true,
28
28
  "imports": [
29
- "_elMarkupHelper.DXAm8_Hg.js"
29
+ "_elMarkupHelper.Cv72GdwF.js"
30
30
  ]
31
31
  },
32
32
  "iframe.html": {
@@ -35,7 +35,7 @@
35
35
  "src": "iframe.html",
36
36
  "isEntry": true,
37
37
  "imports": [
38
- "_elMarkupHelper.DXAm8_Hg.js"
38
+ "_elMarkupHelper.Cv72GdwF.js"
39
39
  ]
40
40
  },
41
41
  "js/typograf/typograf.all.js": {
@@ -335,6 +335,12 @@ td.noresp-em-mob-wrap:nth-child(even) {
335
335
  /* z-index: 999; */
336
336
  }
337
337
 
338
+ /* Подсветка элемента по команде агента: только рамка, раскладка письма не меняется. */
339
+ [em-hover='agent'] {
340
+ outline: 2px solid var(--ub-colorPrimary, #1677ff);
341
+ outline-offset: 2px;
342
+ }
343
+
338
344
  tinymce[em-hover='true'],
339
345
  tinymce *[em-hover='true'] {
340
346
  outline: none !important;
@@ -1625,6 +1631,12 @@ editor:focus {
1625
1631
  outline: none;
1626
1632
  }
1627
1633
 
1634
+ /* Редактор с блоками внутри — блочный: в строчном редакторе Chrome не оставляет курсору места в опустевшем блоке, и набор теряется.
1635
+ Внешний редактор вокруг строчной колонки или кнопки (em-inline) остаётся строчным, иначе соседи уезжают на новую строку. */
1636
+ editor:not([em-inline]):has(div, p, ul, ol, table, h1, h2, h3, h4, h5, h6, blockquote, center, pre) {
1637
+ display: block;
1638
+ }
1639
+
1628
1640
  .mce-visual-caret {
1629
1641
  display: none;
1630
1642
  }
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
5
5
  <script>var e=window.__useblocks__||(window.__useblocks__={});(function(){"use strict";e===void 0&&(window.__amdEnv={});var t=window.parent&&window.parent!==window?window.parent:null;if(!t||typeof t.postMessage!=`function`)return;var n=`em:module-body`,r=`em:module-body-ack`,i=1e3,a=6e4,o=300,s={},c={},l=0,u=!1,d=!1;function f(){u||typeof window.addEventListener!=`function`||(u=!0,window.addEventListener(`message`,function(e){var n=e&&e.data;if(n&&typeof n==`object`&&e.source===t){if(n.operationId===r){var i=c[n.for];i&&i();return}var a=s[n.operationId];a&&a(n.data)}}))}function p(e){return d?null:(f(),new Promise(function(r){l+=1;var o=`em:body:`+l,u=`em:body-error:`+l,f=!1,p=null;function m(e){f||(f=!0,p!==null&&window.clearTimeout(p),delete s[o],delete s[u],delete c[o],r(e||null))}s[o]=m,s[u]=function(){m(null)},c[o]=function(){p!==null&&window.clearTimeout(p),p=window.setTimeout(function(){m(null)},a)},p=window.setTimeout(function(){d=!0,m(null)},i),t.postMessage({operationId:n,data:{url:e},result:o,error:u},`*`)}))}window.location&&window.location.protocol===`file:`||(e.moduleTransport=p);var m=null;function h(){m=null;try{t.postMessage({mark:`__emmDiagnostics__`,type:`loader`,items:(e.loaderTimings||[]).slice()},`*`)}catch{}}e.onLoaderTiming=function(){m===null&&(m=window.setTimeout(h,o))}})(),(function(){"use strict";e===void 0&&(window.__amdEnv={}),e.bootCanvas=function(t){e.canvasBooted=!0;var n=!1;function r(){if(!n){n=!0;var e=document.createElement(`script`);e.src=t,document.head.appendChild(e)}}var i=e.moduleTransport;if(typeof i!=`function`){r();return}var a;try{a=i(t,t)}catch{a=null}if(!a||typeof a.then!=`function`){r();return}a.then(function(t){if(!t||n){r();return}n=!0;var i=URL.createObjectURL(t),a=document.createElement(`script`);a.src=i,a.onload=function(){URL.revokeObjectURL(i)},a.onerror=function(){URL.revokeObjectURL(i),e.blobBlocked=!0,n=!1,r()},document.head.appendChild(a)},r)}})();
6
- __useblocks__.bootCanvas("./js/iframe-eblock.js?v=cc33bf3e");</script>
7
- <script defer src="./js/boot-guard.js" data-entry="./js/iframe-eblock.js?v=cc33bf3e" data-ns="__useblocks__"></script>
6
+ __useblocks__.bootCanvas("./js/iframe-eblock.js?v=5455e870");</script>
7
+ <script defer src="./js/boot-guard.js" data-entry="./js/iframe-eblock.js?v=5455e870" data-ns="__useblocks__"></script>
8
8
  </head>
9
9
  <body>
10
10
  </body>
@@ -3,8 +3,8 @@
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
5
5
  <script>var e=window.__useblocks__||(window.__useblocks__={});(function(){"use strict";e===void 0&&(window.__amdEnv={});var t=window.parent&&window.parent!==window?window.parent:null;if(!t||typeof t.postMessage!=`function`)return;var n=`em:module-body`,r=`em:module-body-ack`,i=1e3,a=6e4,o=300,s={},c={},l=0,u=!1,d=!1;function f(){u||typeof window.addEventListener!=`function`||(u=!0,window.addEventListener(`message`,function(e){var n=e&&e.data;if(n&&typeof n==`object`&&e.source===t){if(n.operationId===r){var i=c[n.for];i&&i();return}var a=s[n.operationId];a&&a(n.data)}}))}function p(e){return d?null:(f(),new Promise(function(r){l+=1;var o=`em:body:`+l,u=`em:body-error:`+l,f=!1,p=null;function m(e){f||(f=!0,p!==null&&window.clearTimeout(p),delete s[o],delete s[u],delete c[o],r(e||null))}s[o]=m,s[u]=function(){m(null)},c[o]=function(){p!==null&&window.clearTimeout(p),p=window.setTimeout(function(){m(null)},a)},p=window.setTimeout(function(){d=!0,m(null)},i),t.postMessage({operationId:n,data:{url:e},result:o,error:u},`*`)}))}window.location&&window.location.protocol===`file:`||(e.moduleTransport=p);var m=null;function h(){m=null;try{t.postMessage({mark:`__emmDiagnostics__`,type:`loader`,items:(e.loaderTimings||[]).slice()},`*`)}catch{}}e.onLoaderTiming=function(){m===null&&(m=window.setTimeout(h,o))}})(),(function(){"use strict";e===void 0&&(window.__amdEnv={}),e.bootCanvas=function(t){e.canvasBooted=!0;var n=!1;function r(){if(!n){n=!0;var e=document.createElement(`script`);e.src=t,document.head.appendChild(e)}}var i=e.moduleTransport;if(typeof i!=`function`){r();return}var a;try{a=i(t,t)}catch{a=null}if(!a||typeof a.then!=`function`){r();return}a.then(function(t){if(!t||n){r();return}n=!0;var i=URL.createObjectURL(t),a=document.createElement(`script`);a.src=i,a.onload=function(){URL.revokeObjectURL(i)},a.onerror=function(){URL.revokeObjectURL(i),e.blobBlocked=!0,n=!1,r()},document.head.appendChild(a)},r)}})();
6
- __useblocks__.bootCanvas("./js/iframe.js?v=cc33bf3e");</script>
7
- <script defer src="./js/boot-guard.js" data-entry="./js/iframe.js?v=cc33bf3e" data-ns="__useblocks__"></script>
6
+ __useblocks__.bootCanvas("./js/iframe.js?v=5455e870");</script>
7
+ <script defer src="./js/boot-guard.js" data-entry="./js/iframe.js?v=5455e870" data-ns="__useblocks__"></script>
8
8
  </head>
9
9
  <body>
10
10
  </body>