useblocks 1.1.56 → 1.1.60

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 (31) hide show
  1. package/iframe/js/amp.BP7EklKo.js +1 -1
  2. package/iframe/js/iframe-eblock.js +1 -1
  3. package/iframe/js/iframe.js +1 -1
  4. package/iframe/js/rules.4N5s3OV-.js +1 -1
  5. package/npm-publish.manifest.json +7 -7
  6. package/package.json +1 -1
  7. package/singlepage_headless_plugin.html +1 -1
  8. package/static/core/{4d493eba.js → 161d1254.js} +268 -257
  9. package/static/core/{4dadf572.js → 40f73dfb.js} +3 -3
  10. package/static/core/{289ba982.js → 43c3f160.js} +3270 -3187
  11. package/static/core/{58c4b8d7.js → 4c39852e.js} +5 -5
  12. package/static/core/{a4c19e27.js → 4e75b331.js} +4 -4
  13. package/static/core/{87969347.js → 53463a60.js} +675 -677
  14. package/static/core/{eb23332a.js → 7a15fa8b.js} +3 -3
  15. package/static/core/{12a9aa4e.js → 8815eb5b.js} +11514 -11159
  16. package/static/core/{4a5f1756.js → ba6c356e.js} +104 -104
  17. package/static/core/{b9bb2c5f.js → c9e59b34.js} +4634 -4271
  18. package/static/core/{fa354fb5.js → d9baa55e.js} +7 -7
  19. package/static/core/{bf446743.js → dbf19c2e.js} +248 -198
  20. package/static/core/{988589a5.js → f953827c.js} +7 -7
  21. package/static/esm/2474de05.js +131 -0
  22. package/static/esm/{3cde7cb6.js → 53b688bd.js} +48 -48
  23. package/two_step_headless_plugin.html +1 -1
  24. package/useblocks-core.f6bb8947.js +673 -0
  25. package/useblocks-esm.js +892 -529
  26. package/useblocks.d.ts +8 -0
  27. package/useblocks.js +698 -330
  28. package/static/esm/550bf3cb.js +0 -127
  29. package/useblocks-core.1279854f.js +0 -643
  30. /package/iframe/{iframe-eblock.1279854f.html → iframe-eblock.f6bb8947.html} +0 -0
  31. /package/iframe/{iframe.1279854f.html → iframe.f6bb8947.html} +0 -0
@@ -1,22 +1,22 @@
1
1
  (function(){try{if(typeof document<"u"){var o=document.createElement("style");o.setAttribute("data-useblocks","true"),o.appendChild(document.createTextNode('.monaco-editor{width:100%;height:100%}.monaco-editor .monaco-hover{border-radius:6px}.monaco-editor .monaco-editor .scroll-decoration{box-shadow:none}.monaco-editor,.monaco-editor *,.monaco-editor .view-lines,.monaco-editor .view-lines *,.monaco-editor .view-lines .view-line,.monaco-editor .view-lines .monaco-mouse-cursor-text,.monaco-editor .view-line,.monaco-editor .monaco-mouse-cursor-text{font-family:var(--monaco-editor-font-family,"Source Code Pro", Consolas, "Courier New", monospace)!important}.monaco-editor .view-line,.monaco-editor .view-line span,.monaco-editor .view-line span.inline-selected-text{font-variant-ligatures:none;font-feature-settings:"liga" 0, "calt" 0;font-kerning:none;white-space:pre;font-family:var(--monaco-monospace-font,var(--monaco-editor-font-family,"Source Code Pro", Consolas, "Courier New", monospace))!important;font-size:var(--monaco-editor-font-size,14px)!important;font-weight:400!important}.monaco-editor .standalone-colorpicker-body{max-width:460px!important}.monaco-editor .standalone-colorpicker-body .colorpicker-body .saturation-wrap{flex:0 auto;max-width:280px}.blocks-app .colorpicker-body .saturation-box,.blocks-app .colorpicker-body .strip{border-radius:4px}.blocks-app .scrollbar.vertical{width:5px!important}.blocks-app .scrollbar.vertical .slider{border-radius:5px!important;width:5px!important}.blocks-app .user-cursor{z-index:10;border-left:2px solid #ff00e1;width:2px;height:20px;position:absolute}.blocks-app .cursor-hover{color:#fff;text-wrap-mode:nowrap;z-index:10000;border-radius:7px 7px 7px 0;margin-left:-2px;padding:0 5px;font-size:12px;position:absolute;top:-17px}.blocks-app .user-selection-decoration{background-color:#8080eb4d}.monaco-editor__spin{z-index:1000;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
- __useblocks__.define("static/core/988589a5.js", [
2
+ __useblocks__.define("static/core/f953827c.js", [
3
3
  "require",
4
4
  "exports",
5
5
  "module",
6
6
  "static/core/bd36b180.js",
7
- "static/core/b9bb2c5f.js",
7
+ "static/core/c9e59b34.js",
8
8
  "static/core/ec11f92f.js",
9
- "static/core/eb23332a.js",
10
- "static/core/4dadf572.js",
9
+ "static/core/7a15fa8b.js",
10
+ "static/core/40f73dfb.js",
11
11
  "static/core/17d3ee0b.js",
12
12
  "static/core/dc408d7c2.js",
13
- "static/core/a4c19e27.js",
13
+ "static/core/4e75b331.js",
14
14
  "react",
15
15
  "react/jsx-runtime"
16
16
  ], function($e, bc, Gy) {
17
- const g = $e("./bd36b180.js"), y = $e("./b9bb2c5f.js"), ue = $e("./ec11f92f.js"), ot = $e("./eb23332a.js"), sr = $e("./4dadf572.js");
17
+ const g = $e("./bd36b180.js"), y = $e("./c9e59b34.js"), ue = $e("./ec11f92f.js"), ot = $e("./7a15fa8b.js"), sr = $e("./40f73dfb.js");
18
18
  $e("./17d3ee0b.js");
19
- const Ae = $e("./dc408d7c2.js"), ge = $e("./a4c19e27.js");
19
+ const Ae = $e("./dc408d7c2.js"), ge = $e("./4e75b331.js");
20
20
  let S = $e("react"), $ = g.__toESM(S, 1);
21
21
  S = g.__toESM(S);
22
22
  let Dt = $e("react/jsx-runtime");
@@ -0,0 +1,131 @@
1
+ import { a as P, i as _ } from "./53b688bd.js";
2
+ import "useblocks/runtime/react";
3
+ function i(r) {
4
+ if (r instanceof DOMException && r.name === "AbortError") return r;
5
+ const E = r === void 0 ? "The operation was aborted." : typeof r == "string" ? r : r instanceof Error ? r.message : String(r);
6
+ return new DOMException(E, "AbortError");
7
+ }
8
+ function s(r) {
9
+ if (r?.aborted) throw i(r.reason);
10
+ }
11
+ function h(r, E) {
12
+ return E ? (s(E), new Promise((I, t) => {
13
+ const n = () => {
14
+ N(), t(i(E.reason));
15
+ }, N = () => {
16
+ E.removeEventListener("abort", n);
17
+ };
18
+ E.addEventListener("abort", n), r.then((D) => {
19
+ N(), I(D);
20
+ }, (D) => {
21
+ N(), t(D);
22
+ });
23
+ })) : r;
24
+ }
25
+ function p(r) {
26
+ return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(r) : r.replace(/([^a-zA-Z0-9_-])/g, "\\$1");
27
+ }
28
+ function c(r, E = document) {
29
+ try {
30
+ const t = E.querySelector(r);
31
+ if (t) return t;
32
+ } catch {
33
+ return null;
34
+ }
35
+ const I = E.querySelectorAll("*");
36
+ for (let t = 0; t < I.length; t++) {
37
+ const n = I[t]?.shadowRoot;
38
+ if (!n) continue;
39
+ const N = c(r, n);
40
+ if (N) return N;
41
+ }
42
+ return null;
43
+ }
44
+ function f(r, E = []) {
45
+ const I = r.querySelectorAll("*");
46
+ for (let t = 0; t < I.length; t++) {
47
+ const n = I[t]?.shadowRoot;
48
+ n && (E.push(n), f(n, E));
49
+ }
50
+ return E;
51
+ }
52
+ function M(r, E, I) {
53
+ if (r.isConnected) return r;
54
+ const t = r.id?.trim();
55
+ return t ? b(`#${p(t)}`, E, I) : Promise.reject(i("Editor mount element was disconnected and has no id — pass a CSS selector or call init() again after the host remounts the container."));
56
+ }
57
+ function b(r, E, I) {
58
+ if (s(I), typeof r < "u") {
59
+ if (typeof r == "string") {
60
+ const t = r, n = c(t);
61
+ if (n) return n;
62
+ const N = E.addDisposable(new P());
63
+ return new Promise((D, a) => {
64
+ const O = (e) => {
65
+ N.dispose(), e();
66
+ }, T = () => {
67
+ O(() => a(i(I?.reason)));
68
+ };
69
+ if (I?.aborted) {
70
+ T();
71
+ return;
72
+ }
73
+ I?.addEventListener("abort", T), N.addDispose(() => I?.removeEventListener("abort", T));
74
+ const A = document.body ?? document.documentElement;
75
+ if (!A) {
76
+ O(() => a(i("Document is not ready to observe mount element")));
77
+ return;
78
+ }
79
+ const u = /* @__PURE__ */ new Set(), L = new MutationObserver(() => {
80
+ const e = c(t);
81
+ if (e) {
82
+ O(() => D(e));
83
+ return;
84
+ }
85
+ d();
86
+ }), S = (e) => {
87
+ u.has(e) || (u.add(e), L.observe(e, {
88
+ attributes: !0,
89
+ childList: !0,
90
+ subtree: !0
91
+ }));
92
+ }, d = () => {
93
+ const e = document.documentElement;
94
+ if (e) for (const C of f(e)) S(C);
95
+ };
96
+ S(A), d(), N.addDispose(() => L.disconnect());
97
+ });
98
+ }
99
+ return r instanceof Element ? M(r, E, I) : r;
100
+ }
101
+ return r;
102
+ }
103
+ var w = /* @__PURE__ */ new Map();
104
+ _("ELEMENT_INSERT_HTML_PIPELINE");
105
+ _("BLOCK_INSERT_HTML_PIPELINE");
106
+ _("DomComponentRegistry");
107
+ _("ComponentRegistry");
108
+ function o(r) {
109
+ return _(r);
110
+ }
111
+ var R;
112
+ (function(r) {
113
+ r.BEFORE_SAVE_EMAIL = o(), r.ON_SAVEBUTTON_CLICK_ID = o(), r.ON_NEXTBUTTON_CLICK_ID = o(), r.ON_PREVIOUSBUTTON_CLICK_ID = o(), r.ON_MODEL_CHANGE = o(), r.WILL_EMAIL_INIT_ID = o(), r.ON_EMAIL_INIT_ID = o(), r.ON_BLOCK_INIT_ID = o(), r.ON_CONTENT_CHANGED_ID = o(), r.ON_PREHEADER_CHANGED_ID = o(), r.ON_SUBJECT_CHANGED_ID = o(), r.ON_EMAIL_CHANGED_ID = o(), r.ON_BLOCK_CHANGED_ID = o(), r.ON_CHUNKS_LOADED = o(), r.ON_SEND_TESTEMAIL_ID = o(), r.ON_SEND_LIVEPREVIEW_ID = o(), r.ON_SHARE_ID = o(), r.ON_SHOW_PREVIEW_ID = o(), r.ON_EMAIL_CLONE_ID = o(), r.ON_SEND_EMAIL_MODAL_ID = o(), r.ON_NOTIFICATION = o(), r.READ_LOCALE = o(), r.ON_TRANSLATE_ID = o(), r.ON_CODE_VALIDATE_ID = o(), r.UPLOAD_EVENT_ID = o(), r.PROXY_URL_EVENT_ID = o(), r.FILE_PROXY_EVENT_ID = o(), r.ON_LIMIT_ID = o(), r.ON_BROWSER_EXTENSION_DETECTED_ID = o(), r.ON_LAYOUT_CONVERT_REQUEST_ID = o(), r.ON_BROWSER_TRANSLATE_DETECTED_ID = o(), r.AI_TEXT_REQUEST_ID = o(), r.AI_IMAGE_REQUEST_ID = o(), r.AI_TEXT_PROGRESS_ID = o(), r.AI_IMAGE_PROGRESS_ID = o(), r.AI_TEXT_STREAM_ID = o();
114
+ })(R || (R = {}));
115
+ _();
116
+ _();
117
+ _("InitPipelineContext");
118
+ _();
119
+ _();
120
+ _();
121
+ _();
122
+ _();
123
+ _();
124
+ _();
125
+ _();
126
+ _("plugin.jwt.token");
127
+ _("plugin.jwt.error");
128
+ _("PluginCollection");
129
+ o("APP_LOAD_EVENT");
130
+ o("CONFIG_CHANGED_EVENT");
131
+ export { s as a, h as i, b as n, i as r, w as t };
@@ -33,10 +33,10 @@ var g = Object.defineProperty, E = (t, e) => {
33
33
  }
34
34
  }
35
35
  };
36
- function f(t) {
36
+ function _(t) {
37
37
  return `service_container_${t}`;
38
38
  }
39
- var D = class h extends d {
39
+ var I = class h extends d {
40
40
  _parent;
41
41
  _injectCallbacks = [];
42
42
  _injections = /* @__PURE__ */ Object.create(null);
@@ -82,24 +82,24 @@ var D = class h extends d {
82
82
  return typeof r == "function" ? Promise.resolve(r()) : new Promise((n) => this._onInject(e, () => n(this.getInstance(e))));
83
83
  }
84
84
  addService(e, r) {
85
- const n = f(e);
85
+ const n = _(e);
86
86
  this.injectFactory(n, (i, o = []) => o.indexOf(r) < 0 ? [...o, r] : o);
87
87
  const s = new d();
88
88
  return s.addDispose(() => {
89
- this.injectFactory(n, (i, o = []) => o.filter((u) => u !== r));
89
+ this.injectFactory(n, (i, o = []) => o.filter((c) => c !== r));
90
90
  }), s;
91
91
  }
92
92
  addServiceFactory(e, r, n) {
93
- const s = f(e);
93
+ const s = _(e);
94
94
  let i;
95
- this.injectFactory(s, (u, c = []) => (i = r(u, i), i === void 0 ? c : c.indexOf(i) < 0 ? [...c, i] : c), n);
95
+ this.injectFactory(s, (c, a = []) => (i = r(c, i), i === void 0 ? a : a.indexOf(i) < 0 ? [...a, i] : a), n);
96
96
  const o = new d();
97
97
  return o.addDispose(() => {
98
- this.injectFactory(s, (u, c = []) => i === void 0 ? c : c.filter((T) => T !== i));
98
+ this.injectFactory(s, (c, a = []) => i === void 0 ? a : a.filter((D) => D !== i));
99
99
  }), o;
100
100
  }
101
101
  getServices(e) {
102
- const r = f(e);
102
+ const r = _(e);
103
103
  return [...this.getInstance(r, !1) || [], ...this._parent?.getServices(e) || []];
104
104
  }
105
105
  createChild() {
@@ -123,41 +123,41 @@ function A(t) {
123
123
  const e = p(t), r = globalThis;
124
124
  return r[e] ??= {};
125
125
  }
126
- function C(t) {
126
+ function T(t) {
127
127
  return t != null && typeof t == "object" && typeof t.inject == "function" && typeof t.getInstance == "function";
128
128
  }
129
- function x(t) {
129
+ function C(t) {
130
130
  if (t) return p(t);
131
131
  return p("useblocks".trim());
132
132
  }
133
133
  function y(t) {
134
- const e = A(x(t));
135
- if (C(e.container)) return e.container;
136
- const r = new D(null);
134
+ const e = A(C(t));
135
+ if (T(e.container)) return e.container;
136
+ const r = new I(null);
137
137
  return e.container = r, r;
138
138
  }
139
139
  function O(t) {
140
140
  return y(t);
141
141
  }
142
- function N() {
142
+ function m() {
143
143
  let t = (/* @__PURE__ */ new Date()).getTime(), e = typeof performance < "u" && performance.now && performance.now() * 1e3 || 0;
144
144
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(r) {
145
145
  let n = Math.random() * 16;
146
146
  return t > 0 ? (n = (t + n) % 16 | 0, t = Math.floor(t / 16)) : (n = (e + n) % 16 | 0, e = Math.floor(e / 16)), (r === "x" ? n : n & 3 | 8).toString(16);
147
147
  });
148
148
  }
149
- function m() {
150
- return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : N();
149
+ function b() {
150
+ return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : m();
151
151
  }
152
- function a(t = m()) {
152
+ function f(t = b()) {
153
153
  return t;
154
154
  }
155
- function I() {
155
+ function S() {
156
156
  return "esm".trim();
157
157
  }
158
- function R(t) {
158
+ function N(t) {
159
159
  if (typeof globalThis > "u") return;
160
- const e = I(), r = globalThis[t] ?? {};
160
+ const e = S(), r = globalThis[t] ?? {};
161
161
  globalThis[t] = r;
162
162
  const n = r.__diagnostics ??= {}, s = n.diModuleEval ??= {
163
163
  evalCount: 0,
@@ -169,31 +169,31 @@ function R(t) {
169
169
  stack: (/* @__PURE__ */ new Error()).stack
170
170
  }), s.evalCount += 1;
171
171
  }
172
- function b() {
172
+ function w() {
173
173
  return `__${"useblocks".trim()}__`;
174
174
  }
175
- function M(t, e) {
176
- if (R(e), typeof globalThis > "u") return t;
177
- const r = I(), n = globalThis, s = n[e] = n[e] || {}, i = s.__diagnostics = s.__diagnostics || {}, o = i.dependencyResolver = i.dependencyResolver || { entries: [] }, u = {
175
+ function R(t, e) {
176
+ if (N(e), typeof globalThis > "u") return t;
177
+ const r = S(), n = globalThis, s = n[e] = n[e] || {}, i = s.__diagnostics = s.__diagnostics || {}, o = i.dependencyResolver = i.dependencyResolver || { entries: [] }, c = {
178
178
  container: t,
179
179
  source: "packages/runtime-core/di/index.ts",
180
180
  buildSource: r,
181
181
  timestamp: Date.now(),
182
182
  stack: (/* @__PURE__ */ new Error()).stack
183
183
  };
184
- return o.entries.push(u), t;
184
+ return o.entries.push(c), t;
185
185
  }
186
- var _;
187
- function w() {
188
- if (_) return _;
189
- const t = b();
190
- return _ = M(y(t), t), _;
186
+ var l;
187
+ function M() {
188
+ if (l) return l;
189
+ const t = w();
190
+ return l = R(y(t), t), l;
191
191
  }
192
192
  new Proxy({}, { get(t, e, r) {
193
- const n = w(), s = Reflect.get(n, e, r);
193
+ const n = M(), s = Reflect.get(n, e, r);
194
194
  return typeof s == "function" ? s.bind(n) : s;
195
195
  } });
196
- function L(t, e = "BackendError") {
196
+ function j(t, e = "BackendError") {
197
197
  switch (t) {
198
198
  case 400: return "ValidationError";
199
199
  case 401: return "AuthenticationFailed";
@@ -208,7 +208,7 @@ function L(t, e = "BackendError") {
208
208
  default: return e;
209
209
  }
210
210
  }
211
- var j = class {
211
+ var L = class {
212
212
  _plugins = /* @__PURE__ */ new Map();
213
213
  _listeners = /* @__PURE__ */ new Map();
214
214
  _getOrCreateEntry(t) {
@@ -368,20 +368,20 @@ var j = class {
368
368
  forContext() {
369
369
  return this.target().forContext();
370
370
  }
371
- }, U = "PluginRegistry";
372
- function F(t = O()) {
373
- return t.getOrCreateInstance(U, () => new j());
371
+ }, F = "PluginRegistry";
372
+ function U(t = O()) {
373
+ return t.getOrCreateInstance(F, () => new L());
374
374
  }
375
- var G = new P(() => F());
376
- function l(t) {
377
- return a(t);
375
+ var G = new P(() => U());
376
+ function u(t) {
377
+ return f(t);
378
378
  }
379
- l("HANDLE_ATOM_INSERT");
380
- l("SETTINGS_PANEL_EVENT");
381
- l("MODAL_SHOW_EVENT");
382
- l("MODAL_CLOSE_EVENT");
383
- l("MODAL_UPDATE_EVENT");
384
- var oe = /* @__PURE__ */ E({ FileManagerApiError: () => V }), V = class S extends Error {
379
+ u("HANDLE_ATOM_INSERT");
380
+ u("SETTINGS_PANEL_EVENT");
381
+ u("MODAL_SHOW_EVENT");
382
+ u("MODAL_CLOSE_EVENT");
383
+ u("MODAL_UPDATE_EVENT");
384
+ var K = /* @__PURE__ */ E({ FileManagerApiError: () => k }), k = class x extends Error {
385
385
  code;
386
386
  status;
387
387
  details;
@@ -389,7 +389,7 @@ var oe = /* @__PURE__ */ E({ FileManagerApiError: () => V }), V = class S extend
389
389
  return this.status;
390
390
  }
391
391
  constructor(e, r, n, s) {
392
- super(e), this.name = "FileManagerApiError", this.code = r, this.status = n, this.details = s, Error.captureStackTrace && Error.captureStackTrace(this, S);
392
+ super(e), this.name = "FileManagerApiError", this.code = r, this.status = n, this.details = s, Error.captureStackTrace && Error.captureStackTrace(this, x);
393
393
  }
394
- }, ae = /* @__PURE__ */ E({ mapHttpStatusToErrorCode: () => L });
395
- export { d as a, a as i, oe as n, G as r, ae as t };
394
+ }, ee = /* @__PURE__ */ E({ mapHttpStatusToErrorCode: () => j });
395
+ export { d as a, f as i, K as n, G as r, ee as t };
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="utf-8" />
5
5
  <title>Two-step flow: design → subject/preheader (headless)</title>
6
- <script id="plugin-script" type="text/javascript" src="useblocks.js?1279854f"></script>
6
+ <script id="plugin-script" type="text/javascript" src="useblocks.js?f6bb8947"></script>
7
7
  <style>
8
8
  body {
9
9
  margin: 0;