useblocks 1.1.109 → 1.2.3
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 +58 -0
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/{iframe-eblock.1f8831da.html → iframe-eblock.0f8a7cdc.html} +2 -2
- package/iframe/{iframe.1f8831da.html → iframe.0f8a7cdc.html} +2 -2
- package/iframe/js/elMarkupHelper.CVRl29u5.js +277 -0
- package/iframe/js/iframe-eblock.body.0f8a7cdc.js +9 -0
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/iframe.body.0f8a7cdc.js +129 -0
- package/iframe/js/iframe.js +2 -2
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/{68d98113.js → 14db5918.js} +1 -1
- package/static/core/{4b44806a.js → 23bd4db7.js} +1 -1
- package/static/core/{6013e7a8.js → 24514bff.js} +1 -1
- package/static/core/423b60ed.js +28 -0
- package/static/core/{ff82b68b.js → 4714d568.js} +1 -1
- package/static/core/{af8ca6d5.js → 4bcf1434.js} +1 -1
- package/static/core/{86b09d55.js → 4c6480d1.js} +1 -1
- package/static/core/{68988386.js → 50e5a944.js} +1 -1
- package/static/core/5f9e49c5.js +4 -0
- package/static/core/{153e784a.js → 730b266e.js} +1 -1
- package/static/core/{e8220aa2.js → 772dbf26.js} +1 -1
- package/static/core/{da0597fc.js → 7bcc8e64.js} +2 -2
- package/static/core/{52516069.js → 7bdd0086.js} +2 -2
- package/static/core/{30d6bd8a.js → 962d3bd3.js} +1 -1
- package/static/core/{7e41a4b3.js → 97fd2a9c.js} +1 -1
- package/static/core/{7f08c9cf.js → 980125d2.js} +10 -10
- package/static/core/{dee88720.js → 9f02da15.js} +1 -1
- package/static/core/{eef2226c.js → af791cc2.js} +1 -1
- package/static/core/{28ed1e25.js → b5ce7e85.js} +1 -1
- package/static/core/{77e5a03d.js → b870ed7e.js} +1 -1
- package/static/core/{d4abafdb.js → cc6447d7.js} +1 -1
- package/static/core/{fe5390c8.js → ce15bbe4.js} +1 -1
- package/static/core/{7d027ebc.js → d19c0f8b.js} +1 -1
- package/static/core/d4984fc6.js +1 -0
- package/static/core/{6547f1cd.js → d894dc76.js} +1 -1
- package/static/core/{78a82c80.js → de1624b4.js} +1 -1
- package/static/core/{40119ab2.js → e56fc965.js} +1 -1
- package/static/core/{271ebf42.js → ec5c9b68.js} +10 -10
- package/static/esm/73935695.js +1 -0
- package/static/umd-runtime/runtime.DKIA3Mo3.js +1 -0
- package/useblocks-core.0f8a7cdc.js +859 -0
- package/useblocks-esm.js +11 -11
- package/{useblocks-po.1f8831da.js → useblocks-po.0f8a7cdc.js} +1 -1
- package/useblocks.d.ts +254 -3
- package/useblocks.js +12 -12
- package/vendor/useblocks-ui-kit/package.json +1 -1
- package/iframe/js/elMarkupHelper.BMa_Fy58.js +0 -279
- package/iframe/js/iframe-eblock.body.1f8831da.js +0 -9
- package/iframe/js/iframe.body.1f8831da.js +0 -129
- package/static/core/73f5e024.js +0 -28
- package/static/core/b1a3c563.js +0 -4
- package/static/core/e18b6b9e.js +0 -1
- package/static/esm/1e463a71.js +0 -1
- package/static/umd-runtime/runtime.ISFTauyN.js +0 -1
- package/useblocks-core.1f8831da.js +0 -859
package/README.md
CHANGED
|
@@ -448,8 +448,11 @@ Editor UI tuning. Use **`instance.setConfig`**, **`instance.updateConfig`**, **`
|
|
|
448
448
|
| nextButtonText | Text on secondary button. | '' |
|
|
449
449
|
| saveButtonEnabled | Show primary button. | true |
|
|
450
450
|
| saveButtonText | Text on primary button. | '' |
|
|
451
|
+
| saveHotkeyEnabled | Save by Ctrl+S / Cmd+S. `false` turns it off; the browser's "Save page" dialog still does not open. | true |
|
|
451
452
|
| commandButtonsEnabled | Show primary and secondary buttons. | true |
|
|
452
453
|
| | | |
|
|
454
|
+
| lockEditor | Read-only mode: the email cannot be changed. Locks the canvas, the code editor, the subject and preheader fields, import, undo/redo (buttons and hotkeys), the version history, email settings and UTM parameters, the AI chat, layout conversion and Gmail annotations. Buttons stay in place but are disabled; the AI icon next to the subject and preheader is hidden. API methods (`show`, `setEmail`, undo via the API) are not locked. Can be switched with `setConfig`. | false |
|
|
455
|
+
| | | |
|
|
453
456
|
| sidePanelFloating | Floating side panel. | true |
|
|
454
457
|
| desktopMobileSwitchRule | Modes switch bar. | true |
|
|
455
458
|
| desktopMobileSwitchPanel | Modes switch panel. | false |
|
|
@@ -645,6 +648,8 @@ See typings (**`ExportedApi.DataMixin.Events`**) — includes for example **`han
|
|
|
645
648
|
| handleEmailAutosave | Autosave created (**`EmailRevision`** with **`autosave: true`**); store it as is |
|
|
646
649
|
| handleEmailInit | The email is shown on the canvas. Fires at start and on every `show()` that changes what is shown: another email; an email without `id` (each such show is a new draft); the same email with any passed field different — code, subject, preheader, common styles — even when the canvas is not reloaded; `show({ reload: true })`. Does not fire when a `show()` with the same `id` passes exactly what is already shown (fields left out are not compared), nor on an internal canvas reload. If the email was edited in the editor, repeating `show()` with the earlier code refills it and fires the event. Do not build one-off actions ("save on first open") on it. |
|
|
647
650
|
| handleReadBlocks | Project blocks |
|
|
651
|
+
| handleValidate | Errors of the code editor (**`CodeError[]`**), the ones it underlines. Fires after the editor checks its text: on every edit while there are errors, and once when they are gone; no event when there were none and still are none. Only after the code mode has been opened. To validate the email on demand use **`validateCode()`**. |
|
|
652
|
+
| handleImportValidate | Errors of an imported file's own markup (**`{ errors: CodeError[], fileName }`**), found before the browser parses it: the browser silently repairs broken markup, so the editor no longer sees the errors. The file is checked only while someone listens to this event. The import is neither delayed nor cancelled; for a clean file **`errors`** is empty. |
|
|
648
653
|
| handleReadCommonBlocks | Shared / common blocks |
|
|
649
654
|
| handleReadTemplateBlocks | Template blocks for current email |
|
|
650
655
|
| handleSaveBlock | Save block (**`SaveEventPayload`**) |
|
|
@@ -665,6 +670,57 @@ See typings (**`ExportedApi.DataMixin.Events`**) — includes for example **`han
|
|
|
665
670
|
| handleSuccess | Success toast hook |
|
|
666
671
|
| handleTestEmailSend | Send test mail |
|
|
667
672
|
| handleTestEmailModal | Test send modal opened |
|
|
673
|
+
| handleAnalyticsEvent | A user action in the editor, for your analytics; see below |
|
|
674
|
+
|
|
675
|
+
#### Analytics: `handleAnalyticsEvent`
|
|
676
|
+
|
|
677
|
+
The editor reports user actions for your analytics (Amplitude, GA and the like). An event is
|
|
678
|
+
**`{ name, properties }`**:
|
|
679
|
+
|
|
680
|
+
- **`name`** follows `editor_<object>_<action>`: `editor_email_saved`, `editor_layout_convert_succeeded`;
|
|
681
|
+
- **`properties`** hold only closed lists of values, numbers and flags. Events carry no ids, names, email
|
|
682
|
+
text or addresses. Linking an event to your email or user is up to you: add your own id when you pass
|
|
683
|
+
the event to your analytics.
|
|
684
|
+
|
|
685
|
+
The handler is not awaited: its result is ignored, and an exception in it does not affect the editor.
|
|
686
|
+
Events come regardless of **`pushToGTM`**. Frequent events — an element setting being edited, the canvas
|
|
687
|
+
width — come as one, after a pause.
|
|
688
|
+
|
|
689
|
+
```javascript
|
|
690
|
+
emailmaker.init({
|
|
691
|
+
element: '#editor',
|
|
692
|
+
content: { email: { id: '1' } },
|
|
693
|
+
getAuthToken,
|
|
694
|
+
handleAnalyticsEvent: ({ name, properties }) => {
|
|
695
|
+
amplitude.track(name, { ...properties, letter_id: currentLetterId });
|
|
696
|
+
},
|
|
697
|
+
});
|
|
698
|
+
```
|
|
699
|
+
|
|
700
|
+
Converting third-party layouts (BeeFree, Stripo and others):
|
|
701
|
+
|
|
702
|
+
| Event | When | Properties |
|
|
703
|
+
| --- | --- | --- |
|
|
704
|
+
| `editor_layout_convert_offered` | The conversion offer was shown | `source`, `trigger` |
|
|
705
|
+
| `editor_layout_convert_declined` | The offer was dismissed | `source`, `trigger`, `never_suggest` |
|
|
706
|
+
| `editor_layout_convert_started` | An attempt started | `source`, `method`, `trigger` |
|
|
707
|
+
| `editor_layout_convert_succeeded` | The result is in the editor | `source`, `method`, `trigger`, `duration_ms`, `fallback_to_ai` |
|
|
708
|
+
| `editor_layout_convert_failed` | The attempt failed | `source`, `method`, `trigger`, `duration_ms`, `error_code` |
|
|
709
|
+
|
|
710
|
+
`source` — `beefree` / `stripo` / `unknown`; `method` — `algorithm` / `ai`; `trigger` — `prompt` (the offer on
|
|
711
|
+
opening the email), `import`, `menu`, `retry`.
|
|
712
|
+
|
|
713
|
+
Other events:
|
|
714
|
+
|
|
715
|
+
| Area | Events |
|
|
716
|
+
| --- | --- |
|
|
717
|
+
| Email and block | `editor_email_saved`, `editor_block_saved`, `editor_back_clicked`, `editor_email_deleted`, `editor_email_delete_clicked`, `editor_email_delete_modal_opened`, `editor_email_duplicate_clicked`, `editor_email_duplicated`, `editor_email_import_clicked`, `editor_email_imported`, `editor_email_exported`, `editor_email_locked`, `editor_email_unlocked`, `editor_block_locked`, `editor_block_unlocked` |
|
|
718
|
+
| Canvas and panels | `editor_element_added`, `editor_element_setting_changed`, `editor_canvas_resized`, `editor_pane_tab_opened`, `editor_config_mode_changed`, `editor_mode_changed`, `editor_code_mode_activated`, `editor_breadcrumb_clicked` |
|
|
719
|
+
| Checks and preview | `editor_code_checked`, `editor_links_checked`, `editor_images_checked`, `editor_spam_checked`, `editor_preview_opened`, `editor_test_email_modal_opened`, `editor_test_email_sent`, `editor_email_shared`, `editor_inbox_tests_opened`, `editor_version_history_opened`, `editor_web_version_opened` |
|
|
720
|
+
| AI and discussion | `editor_ai_message_sent`, `editor_ai_reply_received`, `editor_ai_role_selected`, `editor_ai_subject_inserted`, `editor_ai_preheader_inserted`, `editor_comment_sent`, `editor_ai_image_generation_started` |
|
|
721
|
+
|
|
722
|
+
Properties of each event and their values are in **`emailmaker.d.ts`**, **`ExportedApi.DataMixin.AnalyticsEventMap`**.
|
|
723
|
+
An event comes only if the feature behind it is enabled in the configuration.
|
|
668
724
|
|
|
669
725
|
#### Autosave recovery
|
|
670
726
|
|
|
@@ -772,6 +828,7 @@ The section also accepts `compressMaxSize` and `compressMaxWidthOrHeight` — th
|
|
|
772
828
|
| `trashPath` | `string` | Path to trash/recycle bin folder | - |
|
|
773
829
|
| `tempPath` | `string` | Path to temporary folder for uploads | - |
|
|
774
830
|
| `useSoftDelete` | `boolean` | Enable client-side soft delete | `false` |
|
|
831
|
+
| `trashSupportsFolders` | `boolean` | Trash can hold folders (with `useSoftDelete`) | `true` |
|
|
775
832
|
| `ensureFolderTrailingSlash` | boolean | Add a trailing slash to folder paths | `true` |
|
|
776
833
|
| `validateDuplicates` | `boolean` | Client-side check for existing files or folders | - |
|
|
777
834
|
|
|
@@ -811,6 +868,7 @@ The section also accepts `compressMaxSize` and `compressMaxWidthOrHeight` — th
|
|
|
811
868
|
##### Important Notes
|
|
812
869
|
|
|
813
870
|
- **Soft Delete**: When `useSoftDelete=true`, delete operations move items to `trashPath`
|
|
871
|
+
- **Trash without folders**: If your backend cannot keep folders in the trash, set `trashSupportsFolders=false`: deleting a folder moves the files of its whole subtree to the trash as a flat list (a clashing name gets a number, `photo (1).png`, if `renameItem` is implemented) and deletes the emptied folders permanently. If any file fails to move, the folder is kept
|
|
814
872
|
- **Root Folder**: Use `rootId` or empty string for root operations
|
|
815
873
|
- **Path Resolution**: `trashPath` and `tempPath` are resolved to actual folder IDs
|
|
816
874
|
- **URL Upload**: Should check if file already exists on current server
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"src": "../packages/html2amp/rules.json",
|
|
12
12
|
"isDynamicEntry": true
|
|
13
13
|
},
|
|
14
|
-
"_elMarkupHelper.
|
|
15
|
-
"file": "js/elMarkupHelper.
|
|
14
|
+
"_elMarkupHelper.CVRl29u5.js": {
|
|
15
|
+
"file": "js/elMarkupHelper.CVRl29u5.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.
|
|
29
|
+
"_elMarkupHelper.CVRl29u5.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.
|
|
38
|
+
"_elMarkupHelper.CVRl29u5.js"
|
|
39
39
|
]
|
|
40
40
|
},
|
|
41
41
|
"js/typograf/typograf.all.js": {
|
|
@@ -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=
|
|
7
|
-
<script defer src="./js/boot-guard.js" data-entry="./js/iframe-eblock.js?v=
|
|
6
|
+
__useblocks__.bootCanvas("./js/iframe-eblock.js?v=0f8a7cdc");</script>
|
|
7
|
+
<script defer src="./js/boot-guard.js" data-entry="./js/iframe-eblock.js?v=0f8a7cdc" 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=
|
|
7
|
-
<script defer src="./js/boot-guard.js" data-entry="./js/iframe.js?v=
|
|
6
|
+
__useblocks__.bootCanvas("./js/iframe.js?v=0f8a7cdc");</script>
|
|
7
|
+
<script defer src="./js/boot-guard.js" data-entry="./js/iframe.js?v=0f8a7cdc" data-ns="__useblocks__"></script>
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
</body>
|