@webx-ui/module-blocks 0.8.0 → 0.8.1

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/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { defineComponent as ae, computed as V, openBlock as u, createElementBlock as C, createVNode as f, unref as l, createElementVNode as B, createTextVNode as z, toDisplayString as S, Fragment as F, createCommentVNode as I, renderList as le, ref as N, onMounted as Ue, watch as te, createBlock as D, withCtx as b, onBeforeUnmount as Ze, normalizeStyle as xe, reactive as lt, normalizeClass as $e, withDirectives as ll, vShow as nl, resolveComponent as Ct, isRef as Vt, nextTick as sl, withKeys as ft, withModifiers as vt, provide as Bt, inject as Ke, useModel as ol, getCurrentInstance as al, resolveDynamicComponent as il, mergeProps as rl, mergeModels as ul } from "vue";
2
- import { useRoute as cl, useRouter as At } from "vue-router";
3
- import { useTranslate as de, useAdmin as Oe, useErrorText as Re, WxDate as dl, WxScreenHead as pl, WxRenameButton as fl, WxHelpButton as vl, WxRowMenu as ml, adminKey as hl, WxListScreen as bl } from "@webx-ui/module-admin";
4
- import { WxIcon as be, WxSkeleton as We, WxText as q, WxBadge as ue, WxButton as ce, confirm as Ge, toast as Z, useElementWidth as Qe, WxSegmented as Wt, WxCard as Be, WxPopover as gl, WxAlert as Lt, WxTabs as yl, WxTab as Ae, WxCodeEditor as He, WxFormItem as oe, WxInput as Pe, WxSelect as zt, WxTextarea as kl, WxIconPicker as wl, WxInputNumber as mt, WxTagsInput as ht, WxSwitch as _l, WxActionBar as xl, useModal as Mt, WxDialog as Dt, WxEmpty as It, WxAction as Ie, WxSortableList as $l, createModal as Nt, WxDrawer as Sl, WxSpace as El, WxSkeletonItem as qe } from "@webx-ui/core";
5
- import { WxScreenRenderer as Pt, coreTypes as Ye } from "@webx-ui/schema";
6
- import { autocompletion as Tl, snippetCompletion as me, pickedCompletion as rt, startCompletion as Cl } from "@codemirror/autocomplete";
7
- import { EditorState as Vl } from "@codemirror/state";
1
+ import { defineComponent as ae, computed as V, openBlock as u, createElementBlock as C, createVNode as f, unref as l, createElementVNode as B, createTextVNode as z, toDisplayString as S, Fragment as F, createCommentVNode as N, renderList as le, ref as I, onMounted as Ue, watch as te, createBlock as M, withCtx as b, onBeforeUnmount as Qe, normalizeStyle as xe, reactive as nt, normalizeClass as $e, withDirectives as nl, vShow as sl, resolveComponent as Vt, isRef as Bt, nextTick as ol, withKeys as vt, withModifiers as mt, provide as At, inject as Ye, useModel as al, getCurrentInstance as il, resolveDynamicComponent as rl, mergeProps as ul, mergeModels as cl } from "vue";
2
+ import { useRoute as dl, useRouter as Lt } from "vue-router";
3
+ import { useTranslate as de, useAdmin as Re, useErrorText as je, WxDate as pl, WxScreenHead as fl, WxRenameButton as vl, WxHelpButton as ml, WxRowMenu as hl, adminKey as bl, WxListScreen as gl } from "@webx-ui/module-admin";
4
+ import { WxIcon as he, WxSkeleton as Le, WxText as q, WxBadge as ue, WxButton as ce, confirm as Ze, toast as Z, useElementWidth as Xe, WxSegmented as Wt, WxCard as Be, WxPopover as yl, WxAlert as zt, WxTabs as kl, WxTab as Ae, WxCodeEditor as qe, WxFormItem as oe, WxInput as Oe, WxSelect as Dt, WxTextarea as wl, WxIconPicker as _l, WxInputNumber as ht, WxTagsInput as bt, WxSwitch as xl, WxActionBar as $l, useModal as Mt, WxDialog as Nt, WxEmpty as It, WxAction as Ne, WxSortableList as Sl, createModal as Pt, WxDrawer as El, WxSpace as Tl, WxSkeletonItem as Ke } from "@webx-ui/core";
5
+ import { WxScreenRenderer as Ot, coreTypes as Je } from "@webx-ui/schema";
6
+ import { autocompletion as Cl, snippetCompletion as me, pickedCompletion as ut, startCompletion as Vl } from "@codemirror/autocomplete";
7
+ import { EditorState as Bl } from "@codemirror/state";
8
8
  function ze(e) {
9
9
  const n = `${e.apiPath}/blocks`, t = (s) => s.data;
10
10
  return {
@@ -22,7 +22,7 @@ function ze(e) {
22
22
  restore: (s, a) => e.http.post(`${n}/${s}/versions/${a}/restore`, {}).then(t)
23
23
  };
24
24
  }
25
- const Bl = { class: "wx-block-checks" }, Al = {
25
+ const Al = { class: "wx-block-checks" }, Ll = {
26
26
  key: 0,
27
27
  class: "wx-block-checks__line is-error"
28
28
  }, Wl = /* @__PURE__ */ ae({
@@ -38,36 +38,36 @@ const Bl = { class: "wx-block-checks" }, Al = {
38
38
  const i = new Set(s.value.map((r) => r.code)), o = [];
39
39
  return n.file === "template" && (i.has("no-marker") || o.push(t("checks.ok-marker")), i.has("variables-missing") || o.push(t("checks.ok-variables"))), n.file === "styles" && (i.has("stray-selectors") || o.push(t("checks.ok-prefix", { slug: n.slug })), i.has("bare-selectors") || o.push(t("checks.ok-bare")), i.has("media-query") || o.push(t("checks.ok-container"))), o;
40
40
  });
41
- return (i, o) => (u(), C("div", Bl, [
42
- e.error ? (u(), C("div", Al, [
43
- f(l(be), { name: "close-circle" }),
41
+ return (i, o) => (u(), C("div", Al, [
42
+ e.error ? (u(), C("div", Ll, [
43
+ f(l(he), { name: "close-circle" }),
44
44
  B("span", null, [
45
45
  z(S(e.error.message) + " ", 1),
46
46
  e.error.line !== null ? (u(), C(F, { key: 0 }, [
47
47
  z(" · " + S(l(t)("page.line", { line: e.error.line })), 1)
48
- ], 64)) : I("", !0),
48
+ ], 64)) : N("", !0),
49
49
  e.error.where ? (u(), C(F, { key: 1 }, [
50
50
  z(" · " + S(e.error.where), 1)
51
- ], 64)) : I("", !0)
51
+ ], 64)) : N("", !0)
52
52
  ])
53
- ])) : I("", !0),
53
+ ])) : N("", !0),
54
54
  (u(!0), C(F, null, le(s.value, (r) => (u(), C("div", {
55
55
  key: r.code,
56
56
  class: "wx-block-checks__line is-warning"
57
57
  }, [
58
- f(l(be), { name: "warning" }),
58
+ f(l(he), { name: "warning" }),
59
59
  B("span", null, [
60
60
  z(S(r.message) + " ", 1),
61
61
  r.line !== null ? (u(), C(F, { key: 0 }, [
62
62
  z(" · " + S(l(t)("page.line", { line: r.line })), 1)
63
- ], 64)) : I("", !0)
63
+ ], 64)) : N("", !0)
64
64
  ])
65
65
  ]))), 128)),
66
66
  (u(!0), C(F, null, le(a.value, (r) => (u(), C("div", {
67
67
  key: r,
68
68
  class: "wx-block-checks__line is-ok"
69
69
  }, [
70
- f(l(be), { name: "check" }),
70
+ f(l(he), { name: "check" }),
71
71
  B("span", null, S(r), 1)
72
72
  ]))), 128))
73
73
  ]));
@@ -77,7 +77,7 @@ const Bl = { class: "wx-block-checks" }, Al = {
77
77
  for (const [s, a] of n)
78
78
  t[s] = a;
79
79
  return t;
80
- }, bt = /* @__PURE__ */ ie(Wl, [["__scopeId", "data-v-e56947a8"]]), Ll = { class: "wx-block-history" }, zl = { class: "wx-block-history__number" }, Ml = { class: "wx-block-history__who" }, Dl = /* @__PURE__ */ ae({
80
+ }, gt = /* @__PURE__ */ ie(Wl, [["__scopeId", "data-v-e56947a8"]]), zl = { class: "wx-block-history" }, Dl = { class: "wx-block-history__number" }, Ml = { class: "wx-block-history__who" }, Nl = /* @__PURE__ */ ae({
81
81
  __name: "BlockHistory",
82
82
  props: {
83
83
  block: {},
@@ -85,7 +85,7 @@ const Bl = { class: "wx-block-checks" }, Al = {
85
85
  },
86
86
  emits: ["restored"],
87
87
  setup(e, { emit: n }) {
88
- const t = e, s = n, a = Oe(), i = ze(a), o = de("webx-blocks"), r = Re(), m = N(null);
88
+ const t = e, s = n, a = Re(), i = ze(a), o = de("webx-blocks"), r = je(), m = I(null);
89
89
  async function c() {
90
90
  m.value = await i.versions(t.block.id);
91
91
  }
@@ -93,7 +93,7 @@ const Bl = { class: "wx-block-checks" }, Al = {
93
93
  return t.block.draft?.number === v.number ? "draft" : t.block.published?.number === v.number ? "live" : "replaced";
94
94
  }
95
95
  async function p(v) {
96
- if (await Ge({
96
+ if (await Ze({
97
97
  title: o("page.restore-title", { number: v.number }),
98
98
  message: o("page.restore-text"),
99
99
  confirmText: o("page.restore"),
@@ -111,8 +111,8 @@ const Bl = { class: "wx-block-checks" }, Al = {
111
111
  () => {
112
112
  c();
113
113
  }
114
- ), (v, g) => (u(), C("div", Ll, [
115
- m.value === null ? (u(), D(l(We), {
114
+ ), (v, g) => (u(), C("div", zl, [
115
+ m.value === null ? (u(), M(l(Le), {
116
116
  key: 0,
117
117
  class: "wx-block-history__ghost",
118
118
  rows: 3
@@ -120,7 +120,7 @@ const Bl = { class: "wx-block-checks" }, Al = {
120
120
  key: x.number,
121
121
  class: "wx-block-history__row"
122
122
  }, [
123
- B("code", zl, S(l(o)("page.version", { number: x.number })), 1),
123
+ B("code", Dl, S(l(o)("page.version", { number: x.number })), 1),
124
124
  B("div", Ml, [
125
125
  f(l(q), null, {
126
126
  default: b(() => [
@@ -133,19 +133,19 @@ const Bl = { class: "wx-block-checks" }, Al = {
133
133
  tone: "muted"
134
134
  }, {
135
135
  default: b(() => [
136
- x.created_at ? (u(), D(l(dl), {
136
+ x.created_at ? (u(), M(l(pl), {
137
137
  key: 0,
138
138
  value: x.created_at
139
- }, null, 8, ["value"])) : I("", !0),
139
+ }, null, 8, ["value"])) : N("", !0),
140
140
  z(" · " + S(x.author ?? l(o)(`page.source-${x.source}`)) + " ", 1),
141
141
  x.comment ? (u(), C(F, { key: 1 }, [
142
142
  z(" · " + S(x.comment), 1)
143
- ], 64)) : I("", !0)
143
+ ], 64)) : N("", !0)
144
144
  ]),
145
145
  _: 2
146
146
  }, 1024)
147
147
  ]),
148
- d(x) === "draft" ? (u(), D(l(ue), {
148
+ d(x) === "draft" ? (u(), M(l(ue), {
149
149
  key: 0,
150
150
  type: "warning",
151
151
  dot: ""
@@ -154,7 +154,7 @@ const Bl = { class: "wx-block-checks" }, Al = {
154
154
  z(S(l(o)("page.version-draft")), 1)
155
155
  ]),
156
156
  _: 1
157
- })) : d(x) === "live" ? (u(), D(l(ue), {
157
+ })) : d(x) === "live" ? (u(), M(l(ue), {
158
158
  key: 1,
159
159
  type: "success",
160
160
  dot: ""
@@ -163,8 +163,8 @@ const Bl = { class: "wx-block-checks" }, Al = {
163
163
  z(S(l(o)("page.version-live")), 1)
164
164
  ]),
165
165
  _: 1
166
- })) : I("", !0),
167
- e.canManage && d(x) === "replaced" ? (u(), D(l(ce), {
166
+ })) : N("", !0),
167
+ e.canManage && d(x) === "replaced" ? (u(), M(l(ce), {
168
168
  key: 2,
169
169
  size: "sm",
170
170
  variant: "outline",
@@ -174,11 +174,11 @@ const Bl = { class: "wx-block-checks" }, Al = {
174
174
  z(S(l(o)("page.restore")), 1)
175
175
  ]),
176
176
  _: 1
177
- }, 8, ["onClick"])) : I("", !0)
177
+ }, 8, ["onClick"])) : N("", !0)
178
178
  ]))), 128))
179
179
  ]));
180
180
  }
181
- }), Il = /* @__PURE__ */ ie(Dl, [["__scopeId", "data-v-42c6b7ad"]]), Ne = "wx-preview-selected", Je = "wx-preview-hover", gt = "wx-preview-style";
181
+ }), Il = /* @__PURE__ */ ie(Nl, [["__scopeId", "data-v-42c6b7ad"]]), Ie = "wx-preview-selected", Ge = "wx-preview-hover", yt = "wx-preview-style";
182
182
  function Ut(e, n) {
183
183
  const s = (e.ownerDocument ?? e).createTreeWalker(
184
184
  e,
@@ -195,7 +195,7 @@ function Ut(e, n) {
195
195
  }
196
196
  return null;
197
197
  }
198
- function Ot(e, n, t) {
198
+ function Rt(e, n, t) {
199
199
  const s = Ut(e, n);
200
200
  if (!s) return !1;
201
201
  const a = s.start.parentNode;
@@ -217,28 +217,28 @@ function Ot(e, n, t) {
217
217
  p.nodeType === 1 && d.mount(p);
218
218
  return !0;
219
219
  }
220
- function ut(e, n) {
220
+ function ct(e, n) {
221
221
  const t = Ut(e, n);
222
222
  if (!t) return null;
223
223
  for (let s = t.start.nextSibling; s && s !== t.end; s = s.nextSibling)
224
224
  if (s.nodeType === 1) return s;
225
225
  return null;
226
226
  }
227
- function nt(e, n) {
228
- ct(e);
229
- for (const s of Array.from(e.querySelectorAll(`.${Ne}`)))
230
- s.classList.remove(Ne);
227
+ function st(e, n) {
228
+ dt(e);
229
+ for (const s of Array.from(e.querySelectorAll(`.${Ie}`)))
230
+ s.classList.remove(Ie);
231
231
  if (n === null) return null;
232
- const t = ut(e, n);
233
- return t?.classList.add(Ne), t;
232
+ const t = ct(e, n);
233
+ return t?.classList.add(Ie), t;
234
234
  }
235
- function yt(e, n) {
236
- ct(e);
237
- for (const t of Array.from(e.querySelectorAll(`.${Je}`)))
238
- t.classList.remove(Je);
239
- n !== null && ut(e, n)?.classList.add(Je);
235
+ function kt(e, n) {
236
+ dt(e);
237
+ for (const t of Array.from(e.querySelectorAll(`.${Ge}`)))
238
+ t.classList.remove(Ge);
239
+ n !== null && ct(e, n)?.classList.add(Ge);
240
240
  }
241
- function kt(e) {
241
+ function wt(e) {
242
242
  let n = e?.nodeType === 1 ? e : e?.parentElement ?? null;
243
243
  for (; n; ) {
244
244
  let t = 0;
@@ -256,61 +256,71 @@ function kt(e) {
256
256
  }
257
257
  return null;
258
258
  }
259
- function Nl(e, n) {
260
- ct(e);
259
+ function Pl(e, n) {
260
+ dt(e);
261
261
  let t = null;
262
262
  function s(o) {
263
- he(o), n.select(kt(o.target));
263
+ const r = wt(o.target);
264
+ r === null ? Pe(o) : _e(o), n.select(r);
264
265
  }
265
266
  function a(o) {
266
- const r = kt(o.target);
267
- r !== t && (t = r, yt(e, r));
267
+ const r = wt(o.target);
268
+ r !== t && (t = r, kt(e, r));
268
269
  }
269
270
  function i() {
270
- t = null, yt(e, null);
271
+ t = null, kt(e, null);
271
272
  }
272
- return e.addEventListener("click", s, !0), e.addEventListener("auxclick", he, !0), e.addEventListener("submit", he, !0), e.addEventListener("dragstart", he, !0), e.addEventListener("mousemove", a, !0), e.addEventListener("mouseleave", i), {
273
+ return e.addEventListener("click", s, !0), e.addEventListener("auxclick", Pe, !0), e.addEventListener("submit", _e, !0), e.addEventListener("dragstart", _e, !0), e.addEventListener("mousemove", a, !0), e.addEventListener("mouseleave", i), {
273
274
  release() {
274
- e.removeEventListener("click", s, !0), e.removeEventListener("auxclick", he, !0), e.removeEventListener("submit", he, !0), e.removeEventListener("dragstart", he, !0), e.removeEventListener("mousemove", a, !0), e.removeEventListener("mouseleave", i);
275
+ e.removeEventListener("click", s, !0), e.removeEventListener("auxclick", Pe, !0), e.removeEventListener("submit", _e, !0), e.removeEventListener("dragstart", _e, !0), e.removeEventListener("mousemove", a, !0), e.removeEventListener("mouseleave", i);
275
276
  }
276
277
  };
277
278
  }
278
- function he(e) {
279
+ function _e(e) {
279
280
  e.preventDefault(), e.stopPropagation();
280
281
  }
281
- function Pl(e) {
282
- const n = ["click", "auxclick", "submit", "dragstart"];
283
- for (const t of n) e.addEventListener(t, he, !0);
282
+ function Pe(e) {
283
+ const n = e.target;
284
+ (n?.nodeType === Node.ELEMENT_NODE ? n : n?.parentElement ?? null)?.closest("a[href], area[href]") && e.preventDefault();
285
+ }
286
+ function Ol(e) {
287
+ const n = [
288
+ ["click", Pe],
289
+ ["auxclick", Pe],
290
+ ["submit", _e],
291
+ ["dragstart", _e]
292
+ ];
293
+ for (const [t, s] of n) e.addEventListener(t, s, !0);
284
294
  return {
285
295
  release() {
286
- for (const t of n) e.removeEventListener(t, he, !0);
296
+ for (const [t, s] of n) e.removeEventListener(t, s, !0);
287
297
  }
288
298
  };
289
299
  }
290
- const st = "sample", wt = "wx-stage-styles";
300
+ const ot = "sample", _t = "wx-stage-styles";
291
301
  function Ul(e, n) {
292
- let t = e.getElementById(wt);
293
- t === null && (t = e.createElement("style"), t.id = wt, (e.head ?? e.documentElement).appendChild(t)), t.textContent = n.styles;
294
- const s = `<!--wx:${st}-->`, a = n.html.trimStart().startsWith(s) ? n.html : `${s}${n.html}<!--/wx:${st}-->`;
295
- return Ot(e, st, a);
302
+ let t = e.getElementById(_t);
303
+ t === null && (t = e.createElement("style"), t.id = _t, (e.head ?? e.documentElement).appendChild(t)), t.textContent = n.styles;
304
+ const s = `<!--wx:${ot}-->`, a = n.html.trimStart().startsWith(s) ? n.html : `${s}${n.html}<!--/wx:${ot}-->`;
305
+ return Rt(e, ot, a);
296
306
  }
297
- function Ol(e, n) {
307
+ function Rl(e, n) {
298
308
  const t = e.createElement("script");
299
309
  t.textContent = n, e.body.appendChild(t);
300
310
  }
301
- function ct(e) {
302
- if (e.getElementById(gt)) return;
311
+ function dt(e) {
312
+ if (e.getElementById(yt)) return;
303
313
  const n = e.createElement("style");
304
- n.id = gt, n.textContent = `.${Ne}{outline:2px solid #427edd;outline-offset:-2px;}.${Je}:not(.${Ne}){outline:1px solid #427edd;outline-offset:-1px;cursor:pointer;}`, (e.head ?? e.documentElement).appendChild(n);
314
+ n.id = yt, n.textContent = `.${Ie}{outline:2px solid #427edd;outline-offset:-2px;}.${Ge}:not(.${Ie}){outline:1px solid #427edd;outline-offset:-1px;cursor:pointer;}`, (e.head ?? e.documentElement).appendChild(n);
305
315
  }
306
- function Rt(e) {
307
- const n = e.base ? `<base href="${_t(e.base)}">` : "", t = e.frame ? `<style>${e.frame}</style>` : "", s = e.script && e.runtime ? `<script src="${_t(e.runtime)}"><\/script><script>${e.script}<\/script>` : "";
316
+ function jt(e) {
317
+ const n = e.base ? `<base href="${xt(e.base)}">` : "", t = e.frame ? `<style>${e.frame}</style>` : "", s = e.script && e.runtime ? `<script src="${xt(e.runtime)}"><\/script><script>${e.script}<\/script>` : "";
308
318
  return `<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">${n}<style>html,body{margin:0}body{container-type:inline-size}</style>${t}<style>${e.styles}</style></head><body>${e.html}${s}</body></html>`;
309
319
  }
310
- function _t(e) {
320
+ function xt(e) {
311
321
  return e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
312
322
  }
313
- const Rl = { class: "wx-block-stage" }, jl = { class: "wx-block-stage__bar" }, Fl = ["src", "srcdoc", "title"], Hl = /* @__PURE__ */ ae({
323
+ const jl = { class: "wx-block-stage" }, Fl = { class: "wx-block-stage__bar" }, Hl = ["src", "srcdoc", "title"], ql = /* @__PURE__ */ ae({
314
324
  __name: "BlockStage",
315
325
  props: {
316
326
  html: {},
@@ -325,7 +335,7 @@ const Rl = { class: "wx-block-stage" }, jl = { class: "wx-block-stage__bar" }, F
325
335
  { value: 1280, icon: "monitor", ariaLabel: t("page.width-desktop") },
326
336
  { value: 834, icon: "tablet", ariaLabel: t("page.width-tablet") },
327
337
  { value: 390, icon: "smartphone", ariaLabel: t("page.width-phone") }
328
- ]), a = N(1280), i = N(null), o = N(null), r = Qe(i), m = N(360), c = N(!1);
338
+ ]), a = I(1280), i = I(null), o = I(null), r = Xe(i), m = I(360), c = I(!1);
329
339
  te([r, s], () => {
330
340
  if (c.value || r.value === 0) return;
331
341
  const h = s.value.find((A) => r.value / A.value >= 0.45);
@@ -335,14 +345,14 @@ const Rl = { class: "wx-block-stage" }, jl = { class: "wx-block-stage__bar" }, F
335
345
  c.value = !0, a.value = h;
336
346
  }
337
347
  const p = V(() => r.value === 0 ? 1 : Math.min(1, r.value / a.value)), v = V(
338
- () => n.stage ? void 0 : Rt({
348
+ () => n.stage ? void 0 : jt({
339
349
  html: n.html,
340
350
  styles: n.styles,
341
351
  script: n.script,
342
352
  runtime: n.runtime,
343
353
  base: typeof location > "u" ? null : location.origin + "/"
344
354
  })
345
- ), g = N(0);
355
+ ), g = I(0);
346
356
  let x = null;
347
357
  te(
348
358
  () => n.script,
@@ -361,13 +371,13 @@ const Rl = { class: "wx-block-stage" }, jl = { class: "wx-block-stage__bar" }, F
361
371
  w?.release(), w = null, y?.disconnect(), y = null;
362
372
  }
363
373
  function R(h) {
364
- n.stage && (n.script && x !== n.script && (x = n.script, Ol(h, n.script)), Ul(h, { html: n.html, styles: n.styles }));
374
+ n.stage && (n.script && x !== n.script && (x = n.script, Rl(h, n.script)), Ul(h, { html: n.html, styles: n.styles }));
365
375
  }
366
376
  function K() {
367
377
  _();
368
378
  const h = o.value?.contentDocument;
369
379
  if (!h?.body) return;
370
- n.stage && (x = null, w = Pl(h), R(h)), T();
380
+ n.stage && (x = null, w = Ol(h), R(h)), T();
371
381
  const A = h.defaultView?.ResizeObserver;
372
382
  A && (y = new A(() => T()), y.observe(h.body));
373
383
  }
@@ -379,7 +389,7 @@ const Rl = { class: "wx-block-stage" }, jl = { class: "wx-block-stage__bar" }, F
379
389
  }
380
390
  ), te(r, (h, A) => {
381
391
  h > 0 && A === 0 && setTimeout(T, 50);
382
- }), te(a, () => setTimeout(T, 50)), Ze(_);
392
+ }), te(a, () => setTimeout(T, 50)), Qe(_);
383
393
  const Y = V(() => ({
384
394
  width: `${a.value}px`,
385
395
  height: `${m.value}px`,
@@ -388,8 +398,8 @@ const Rl = { class: "wx-block-stage" }, jl = { class: "wx-block-stage__bar" }, F
388
398
  width: `${Math.round(a.value * p.value)}px`,
389
399
  height: `${Math.round(m.value * p.value)}px`
390
400
  }));
391
- return (h, A) => (u(), C("div", Rl, [
392
- B("div", jl, [
401
+ return (h, A) => (u(), C("div", jl, [
402
+ B("div", Fl, [
393
403
  f(l(Wt), {
394
404
  "model-value": a.value,
395
405
  options: s.value,
@@ -403,7 +413,7 @@ const Rl = { class: "wx-block-stage" }, jl = { class: "wx-block-stage__bar" }, F
403
413
  ref: i,
404
414
  class: "wx-block-stage__ground"
405
415
  }, [
406
- e.loading && !e.html ? (u(), D(l(We), {
416
+ e.loading && !e.html ? (u(), M(l(Le), {
407
417
  key: 0,
408
418
  rows: 3
409
419
  })) : (u(), C("div", {
@@ -422,109 +432,109 @@ const Rl = { class: "wx-block-stage" }, jl = { class: "wx-block-stage__bar" }, F
422
432
  sandbox: "allow-same-origin allow-scripts",
423
433
  title: l(t)("page.preview"),
424
434
  onLoad: K
425
- }, null, 44, Fl))
435
+ }, null, 44, Hl))
426
436
  ], 4))
427
437
  ], 512)
428
438
  ]));
429
439
  }
430
- }), ql = /* @__PURE__ */ ie(Hl, [["__scopeId", "data-v-3185ee45"]]);
431
- function jt(e) {
440
+ }), Kl = /* @__PURE__ */ ie(ql, [["__scopeId", "data-v-3185ee45"]]);
441
+ function Ft(e) {
432
442
  return typeof e == "object" && e !== null && typeof e.type == "string" && e.type !== "";
433
443
  }
434
- function Xe(e) {
435
- return Array.isArray(e) && e.length > 0 && e.every(jt);
444
+ function et(e) {
445
+ return Array.isArray(e) && e.length > 0 && e.every(Ft);
436
446
  }
437
- function at() {
447
+ function it() {
438
448
  return (typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID().replace(/-/g, "") : Math.random().toString(36).slice(2) + Math.random().toString(36).slice(2)).slice(0, 12);
439
449
  }
440
- function Kl(e, n = {}) {
441
- return { key: at(), type: e, values: n };
450
+ function Yl(e, n = {}) {
451
+ return { key: it(), type: e, values: n };
442
452
  }
443
453
  function re(e, n) {
444
- return Ft(e, n, null, null);
454
+ return Ht(e, n, null, null);
445
455
  }
446
- function Ft(e, n, t, s) {
456
+ function Ht(e, n, t, s) {
447
457
  for (let a = 0; a < e.length; a++) {
448
458
  const i = e[a];
449
459
  if (i.key === n) return { node: i, parent: t, field: s, list: e, index: a };
450
460
  for (const [o, r] of Object.entries(i.values ?? {}))
451
- if (Xe(r)) {
452
- const m = Ft(r, n, i, o);
461
+ if (et(r)) {
462
+ const m = Ht(r, n, i, o);
453
463
  if (m) return m;
454
464
  }
455
465
  }
456
466
  return null;
457
467
  }
458
- function je(e, n, t = 0, s = null) {
468
+ function Fe(e, n, t = 0, s = null) {
459
469
  for (const a of e)
460
- if (jt(a)) {
470
+ if (Ft(a)) {
461
471
  n(a, t, s);
462
472
  for (const i of Object.values(a.values ?? {}))
463
- Xe(i) && je(i, n, t + 1, a);
473
+ et(i) && Fe(i, n, t + 1, a);
464
474
  }
465
475
  }
466
- function Yl(e, n) {
476
+ function Jl(e, n) {
467
477
  let t = 0;
468
- return je(e, (s) => {
478
+ return Fe(e, (s) => {
469
479
  s.type === n && t++;
470
480
  }), t;
471
481
  }
472
- function Jl(e) {
482
+ function Gl(e) {
473
483
  let n = 0;
474
484
  for (const t of Object.values(e.values ?? {}))
475
- Xe(t) && je(t, () => n++);
485
+ et(t) && Fe(t, () => n++);
476
486
  return n;
477
487
  }
478
- function to(e) {
488
+ function lo(e) {
479
489
  const n = [];
480
- return je(e, (t) => {
490
+ return Fe(e, (t) => {
481
491
  n.includes(t.type) || n.push(t.type);
482
492
  }), n;
483
493
  }
484
- function Ht(e) {
494
+ function qt(e) {
485
495
  const n = [];
486
496
  for (const t of e)
487
- t.type === "wx-blocks" && n.push(t), t.children && n.push(...Ht(t.children));
497
+ t.type === "wx-blocks" && n.push(t), t.children && n.push(...qt(t.children));
488
498
  return n;
489
499
  }
490
- function qt(e) {
500
+ function Kt(e) {
491
501
  const n = {};
492
502
  for (const [t, s] of Object.entries(e.values ?? {}))
493
- n[t] = Xe(s) ? s.map(qt) : ge(s);
494
- return e.hidden === !0 ? { key: at(), type: e.type, hidden: !0, values: n } : { key: at(), type: e.type, values: n };
503
+ n[t] = et(s) ? s.map(Kt) : be(s);
504
+ return e.hidden === !0 ? { key: it(), type: e.type, hidden: !0, values: n } : { key: it(), type: e.type, values: n };
495
505
  }
496
- function Gl(e, n, t) {
497
- const s = ge(e), a = re(s, n);
506
+ function Zl(e, n, t) {
507
+ const s = be(e), a = re(s, n);
498
508
  return a ? (t ? a.node.hidden = !0 : delete a.node.hidden, s) : e;
499
509
  }
500
- function Zl(e, n, t) {
510
+ function Ql(e, n, t) {
501
511
  if (n === null) return e;
502
512
  const s = re(e, n);
503
513
  if (!s || t === null) return null;
504
514
  const a = s.node.values[t];
505
515
  return Array.isArray(a) || (s.node.values[t] = []), s.node.values[t];
506
516
  }
507
- function xt(e, n, t, s, a) {
508
- const i = ge(e), o = Zl(i, n, t);
517
+ function $t(e, n, t, s, a) {
518
+ const i = be(e), o = Ql(i, n, t);
509
519
  return o ? (o.splice(Math.max(0, Math.min(s, o.length)), 0, a), i) : e;
510
520
  }
511
- function Ql(e, n) {
512
- const t = ge(e), s = re(t, n);
521
+ function Xl(e, n) {
522
+ const t = be(e), s = re(t, n);
513
523
  return s ? (s.list.splice(s.index, 1), t) : e;
514
524
  }
515
- function Xl(e, n, t) {
516
- const s = ge(e), a = re(s, n);
525
+ function en(e, n, t) {
526
+ const s = be(e), a = re(s, n);
517
527
  return a ? (a.node.values = t, s) : e;
518
528
  }
519
- function en(e, n, t, s) {
520
- if (n === null) return ge(s);
521
- const a = ge(e), i = re(a, n);
522
- return !i || t === null ? e : (i.node.values[t] = ge(s), a);
529
+ function tn(e, n, t, s) {
530
+ if (n === null) return be(s);
531
+ const a = be(e), i = re(a, n);
532
+ return !i || t === null ? e : (i.node.values[t] = be(s), a);
523
533
  }
524
- function ge(e) {
534
+ function be(e) {
525
535
  return e === void 0 ? e : JSON.parse(JSON.stringify(e));
526
536
  }
527
- const tn = {
537
+ const ln = {
528
538
  module: {
529
539
  title: "Blocks"
530
540
  },
@@ -680,65 +690,65 @@ const tn = {
680
690
  "ok-container": "Width is decided by container queries.",
681
691
  "ok-variables": "Every variable of the template is a field of the schema."
682
692
  }
683
- }, $t = /* @__PURE__ */ new WeakSet();
684
- function Fe() {
693
+ }, St = /* @__PURE__ */ new WeakSet();
694
+ function He() {
685
695
  try {
686
- const { i18n: e } = Oe();
687
- $t.has(e) || (e.defaults("webx-blocks", tn), $t.add(e));
696
+ const { i18n: e } = Re();
697
+ St.has(e) || (e.defaults("webx-blocks", ln), St.add(e));
688
698
  } catch {
689
699
  }
690
700
  }
691
- function ot(e) {
701
+ function at(e) {
692
702
  return [
693
- Tl({ icons: !1 }),
694
- Vl.languageData.of(() => [{ autocomplete: e }])
703
+ Cl({ icons: !1 }),
704
+ Bl.languageData.of(() => [{ autocomplete: e }])
695
705
  ];
696
706
  }
697
- const ln = [
707
+ const nn = [
698
708
  ["block", "key, type, version, depth, value()"],
699
709
  ["entity", "the page or article the block stands on"]
700
- ], nn = ["key", "type", "version", "depth"], Kt = ["url", "alt", "title", "path"], sn = [...Kt, "thumb", "name", "extension", "mime", "size", "width", "height"], on = ["wx-media"], an = ["wx-gallery", "wx-files"];
701
- function rn({ schema: e, styles: n }) {
710
+ ], sn = ["key", "type", "version", "depth"], Yt = ["url", "alt", "title", "path"], on = [...Yt, "thumb", "name", "extension", "mime", "size", "width", "height"], an = ["wx-media"], rn = ["wx-gallery", "wx-files"];
711
+ function un({ schema: e, styles: n }) {
702
712
  return (t) => {
703
713
  const s = t.state.sliceDoc(Math.max(0, t.pos - 200), t.pos), a = /\$block->(\w*)$/.exec(s);
704
- if (a) return dn(t, a[1]);
714
+ if (a) return pn(t, a[1]);
705
715
  const i = /\$(\w+)\[\s*(['"]?)(\w*)$/.exec(s);
706
- if (i) return pn(t, i[1], i[2], i[3], e());
716
+ if (i) return fn(t, i[1], i[2], i[3], e());
707
717
  const o = /\$(\w*)$/.exec(s);
708
718
  if (o)
709
719
  return {
710
720
  from: t.pos - o[0].length,
711
- options: un(e(), t.state.doc.toString()),
721
+ options: cn(e(), t.state.doc.toString()),
712
722
  validFor: /^\$\w*$/
713
723
  };
714
724
  const r = /(\{\{|\{!!)(\s*)(\w*)$/.exec(s);
715
- if (r) return cn(t, r[1], r[2], r[3], e());
725
+ if (r) return dn(t, r[1], r[2], r[3], e());
716
726
  const m = /\bclass\s*=\s*"([^"]*)$/.exec(s);
717
- if (m) return vn(t, m[1], n());
727
+ if (m) return mn(t, m[1], n());
718
728
  const c = /(?:^|[\s>(])@(\w*)$/.exec(s);
719
729
  return c ? {
720
730
  from: t.pos - c[1].length - 1,
721
- options: mn(e()),
731
+ options: hn(e()),
722
732
  validFor: /^@\w*$/
723
733
  } : null;
724
734
  };
725
735
  }
726
- function un(e, n) {
727
- const t = Gt(e).map((s, a) => ({
736
+ function cn(e, n) {
737
+ const t = Zt(e).map((s, a) => ({
728
738
  label: `$${s.id}`,
729
739
  detail: s.type,
730
740
  info: s.label,
731
741
  type: "variable",
732
742
  boost: 50 - a
733
743
  }));
734
- for (const s of Yt(n).keys())
744
+ for (const s of Jt(n).keys())
735
745
  t.push({ label: `$${s}`, detail: "loop", type: "variable" });
736
- for (const [s, a] of ln)
746
+ for (const [s, a] of nn)
737
747
  t.push({ label: `$${s}`, detail: "given", info: a, type: "variable", boost: -10 });
738
748
  return t.push({ label: "$loop", detail: "given", info: "inside @foreach", boost: -20 }), t;
739
749
  }
740
- function cn(e, n, t, s, a) {
741
- const i = Gt(a);
750
+ function dn(e, n, t, s, a) {
751
+ const i = Zt(a);
742
752
  if (i.length === 0) return null;
743
753
  const o = n === "{{" ? "}}" : "!!}";
744
754
  return {
@@ -751,12 +761,12 @@ function cn(e, n, t, s, a) {
751
761
  type: "variable",
752
762
  boost: 50 - m,
753
763
  apply: (c, d, p, v) => {
754
- const g = c.state.sliceDoc(v, v + 8), x = new RegExp(`^\\s*${_n(o)}`).exec(g), T = x ? /^\s/.test(g) ? "" : " " : ` ${o}`, w = `${t === "" ? " " : ""}$${r.id}${T}`;
764
+ const g = c.state.sliceDoc(v, v + 8), x = new RegExp(`^\\s*${xn(o)}`).exec(g), T = x ? /^\s/.test(g) ? "" : " " : ` ${o}`, w = `${t === "" ? " " : ""}$${r.id}${T}`;
755
765
  c.dispatch({
756
766
  changes: { from: p, to: v, insert: w },
757
767
  // Past the closing braces: the echo is finished, the next thing is the markup.
758
768
  selection: { anchor: p + w.length + (x ? x[0].length : 0) },
759
- annotations: rt.of(d),
769
+ annotations: ut.of(d),
760
770
  userEvent: "input.complete"
761
771
  });
762
772
  }
@@ -764,11 +774,11 @@ function cn(e, n, t, s, a) {
764
774
  validFor: /^\w*$/
765
775
  };
766
776
  }
767
- function dn(e, n) {
777
+ function pn(e, n) {
768
778
  return {
769
779
  from: e.pos - n.length,
770
780
  options: [
771
- ...nn.map((t) => ({ label: t, type: "property" })),
781
+ ...sn.map((t) => ({ label: t, type: "property" })),
772
782
  me("value('${name}', ${default})", {
773
783
  label: "value",
774
784
  detail: "('name', default)",
@@ -778,8 +788,8 @@ function dn(e, n) {
778
788
  validFor: /^\w*$/
779
789
  };
780
790
  }
781
- function pn(e, n, t, s, a) {
782
- const i = fn(n, a, e.state.doc.toString());
791
+ function fn(e, n, t, s, a) {
792
+ const i = vn(n, a, e.state.doc.toString());
783
793
  return i.length === 0 ? null : {
784
794
  from: e.pos - s.length,
785
795
  options: i.map(([o, r]) => ({
@@ -791,7 +801,7 @@ function pn(e, n, t, s, a) {
791
801
  m.dispatch({
792
802
  changes: { from: v, to: T, insert: y },
793
803
  selection: { anchor: v + y.length + (w ? 1 : 0) },
794
- annotations: rt.of(c),
804
+ annotations: ut.of(c),
795
805
  userEvent: "input.complete"
796
806
  });
797
807
  }
@@ -799,28 +809,28 @@ function pn(e, n, t, s, a) {
799
809
  validFor: /^\w*$/
800
810
  };
801
811
  }
802
- function fn(e, n, t) {
803
- const s = Le(n).find((o) => o.id === e);
804
- if (s && on.includes(s.type)) return Kt.map((o) => [o, s.type]);
805
- const a = Yt(t).get(e), i = a ? Le(n).find((o) => o.id === a) : void 0;
806
- return i ? an.includes(i.type) ? sn.map((o) => [o, i.type]) : i.type === "wx-repeater" ? Le(i.children ?? []).map((o) => [o.id, o.type]) : [] : [];
812
+ function vn(e, n, t) {
813
+ const s = We(n).find((o) => o.id === e);
814
+ if (s && an.includes(s.type)) return Yt.map((o) => [o, s.type]);
815
+ const a = Jt(t).get(e), i = a ? We(n).find((o) => o.id === a) : void 0;
816
+ return i ? rn.includes(i.type) ? on.map((o) => [o, i.type]) : i.type === "wx-repeater" ? We(i.children ?? []).map((o) => [o.id, o.type]) : [] : [];
807
817
  }
808
- function Yt(e) {
818
+ function Jt(e) {
809
819
  const n = /* @__PURE__ */ new Map();
810
820
  for (const t of e.matchAll(/\$(\w+)\s+as\s+\$(\w+)(?:\s*=>\s*\$(\w+))?/g))
811
821
  n.set(t[3] ?? t[2], t[1]);
812
822
  return n;
813
823
  }
814
- function vn(e, n, t) {
824
+ function mn(e, n, t) {
815
825
  const s = /[\w-]*$/.exec(n)[0], a = new Set(n.split(/\s+/));
816
826
  return {
817
827
  from: e.pos - s.length,
818
- options: Jt(t).filter((i) => !a.has(i) || i === s).map((i) => ({ label: i, detail: "styles", type: "class" })),
828
+ options: Gt(t).filter((i) => !a.has(i) || i === s).map((i) => ({ label: i, detail: "styles", type: "class" })),
819
829
  validFor: /^[\w-]*$/
820
830
  };
821
831
  }
822
- function mn(e) {
823
- const n = Le(e).filter((t) => t.type === "wx-blocks");
832
+ function hn(e) {
833
+ const n = We(e).filter((t) => t.type === "wx-blocks");
824
834
  return [
825
835
  me("@if (${condition})\n ${}\n@endif", { label: "@if", type: "keyword" }),
826
836
  me("@isset(${value})\n ${}\n@endisset", { label: "@isset", type: "keyword" }),
@@ -851,13 +861,13 @@ function mn(e) {
851
861
  )
852
862
  ];
853
863
  }
854
- function hn({ slug: e, template: n }) {
864
+ function bn({ slug: e, template: n }) {
855
865
  return (t) => {
856
866
  const s = t.state.sliceDoc(Math.max(0, t.pos - 200), t.pos), a = /(?:^|[\s,>+~(}{])\.([\w-]*)$/.exec(s);
857
867
  if (!a) return null;
858
868
  const i = /[^{};]*$/.exec(s)[0];
859
869
  if (/^\s*[\w-]+\s*:\s/.test(i)) return null;
860
- const o = `b-${e()}`, r = new Set(Jt(t.state.doc.toString())), m = bn(n()), c = [o, ...m.filter((p) => p !== o)], d = c.map((p, v) => ({
870
+ const o = `b-${e()}`, r = new Set(Gt(t.state.doc.toString())), m = gn(n()), c = [o, ...m.filter((p) => p !== o)], d = c.map((p, v) => ({
861
871
  label: `.${p}`,
862
872
  // A class the template uses and nothing styles yet is the likeliest thing to write.
863
873
  detail: r.has(p) ? "template" : "template · no rule yet",
@@ -869,7 +879,7 @@ function hn({ slug: e, template: n }) {
869
879
  return { from: t.pos - a[1].length - 1, options: d, validFor: /^\.[\w-]*$/ };
870
880
  };
871
881
  }
872
- function Jt(e) {
882
+ function Gt(e) {
873
883
  const n = e.replace(/\/\*[\s\S]*?\*\//g, ""), t = /* @__PURE__ */ new Set(), s = [];
874
884
  let a = "";
875
885
  for (const i of n)
@@ -883,7 +893,7 @@ function Jt(e) {
883
893
  } else i === "}" ? (s.pop(), a = "") : i === ";" ? a = "" : a += i;
884
894
  return [...t];
885
895
  }
886
- function bn(e) {
896
+ function gn(e) {
887
897
  const n = /* @__PURE__ */ new Set();
888
898
  for (const t of e.matchAll(/\bclass\s*=\s*"([^"]*)"/g)) {
889
899
  const s = t[1].replace(/\{\{[\s\S]*?\}\}|\{!![\s\S]*?!!\}|@\w+(\([^)]*\))?/g, " ");
@@ -892,7 +902,7 @@ function bn(e) {
892
902
  }
893
903
  return [...n];
894
904
  }
895
- const gn = [
905
+ const yn = [
896
906
  { key: "id", value: '""', info: "The variable the template gets, in snake_case." },
897
907
  { key: "type", value: '""', info: "A type from the registry." },
898
908
  { key: "label", value: '""', info: "What the editor sees above the field." },
@@ -904,21 +914,21 @@ const gn = [
904
914
  { key: "slot", value: '""', info: "The parent's named slot to land in." },
905
915
  { key: "can", value: '""', info: "The permission the node needs." }
906
916
  ];
907
- function yn({ types: e }) {
917
+ function kn({ types: e }) {
908
918
  return (n) => {
909
- const t = kn(n.state.doc.toString(), n.pos);
919
+ const t = wn(n.state.doc.toString(), n.pos);
910
920
  if (!t || !t.node) return null;
911
921
  const s = t.string ? n.state.sliceDoc(t.string, n.pos) : /[\w-]*$/.exec(n.state.sliceDoc(Math.max(0, n.pos - 60), n.pos))[0];
912
922
  if (!t.string && s === "" && !n.explicit) return null;
913
923
  const a = n.pos - s.length, i = t.string !== null;
914
924
  if (t.phase === "key") {
915
- const o = gn.filter(({ key: r }) => !t.keys.has(r) || r === s).map(
925
+ const o = yn.filter(({ key: r }) => !t.keys.has(r) || r === s).map(
916
926
  ({ key: r, value: m, info: c }, d) => ({
917
927
  label: r,
918
928
  info: c,
919
929
  type: "property",
920
930
  boost: -d,
921
- apply: (p, v, g, x) => St(p, v, g, x, i, `"${r}": ${m}`, m)
931
+ apply: (p, v, g, x) => Et(p, v, g, x, i, `"${r}": ${m}`, m)
922
932
  })
923
933
  );
924
934
  return { from: a, options: o, validFor: /^[\w-]*$/ };
@@ -930,23 +940,23 @@ function yn({ types: e }) {
930
940
  type: "type",
931
941
  // Fields first: a block's schema is mostly fields, the layout only groups them.
932
942
  boost: m.kind === "field" ? 1 : 0,
933
- apply: (c, d, p, v) => St(c, d, p, v, i, `"${r}"`, "")
943
+ apply: (c, d, p, v) => Et(c, d, p, v, i, `"${r}"`, "")
934
944
  }));
935
945
  return { from: a, options: o, validFor: /^[\w-]*$/ };
936
946
  }
937
947
  return null;
938
948
  };
939
949
  }
940
- function St(e, n, t, s, a, i, o) {
950
+ function Et(e, n, t, s, a, i, o) {
941
951
  const r = a ? t - 1 : t, m = /^[\w-]*"?/.exec(e.state.sliceDoc(s, s + 60))[0], c = s + (a ? m.length : /^[\w-]*/.exec(m)[0].length), d = o === '""' || o === "{}" || o === "[]" ? 1 : 0;
942
952
  e.dispatch({
943
953
  changes: { from: r, to: c, insert: i },
944
954
  selection: { anchor: r + i.length - d },
945
- annotations: rt.of(n),
955
+ annotations: ut.of(n),
946
956
  userEvent: "input.complete"
947
- }), i.startsWith('"type"') && Cl(e);
957
+ }), i.startsWith('"type"') && Vl(e);
948
958
  }
949
- function kn(e, n) {
959
+ function wn(e, n) {
950
960
  let t = null, s = null, a = null, i = !1;
951
961
  const o = (r) => r?.kind === "object" && r.parent?.kind === "array" && (r.parent.parent === null || r.parent.under === "children");
952
962
  for (let r = 0; r <= e.length && (r === n && (s = t?.kind === "object" ? {
@@ -984,24 +994,24 @@ function kn(e, n) {
984
994
  }
985
995
  return s;
986
996
  }
987
- function Le(e) {
997
+ function We(e) {
988
998
  const n = [];
989
999
  for (const t of e)
990
- !t || typeof t != "object" || (wn.has(t.type) ? n.push(...Le(t.children ?? [])) : typeof t.id == "string" && t.id !== "" && n.push(t));
1000
+ !t || typeof t != "object" || (_n.has(t.type) ? n.push(...We(t.children ?? [])) : typeof t.id == "string" && t.id !== "" && n.push(t));
991
1001
  return n;
992
1002
  }
993
- function Gt(e) {
994
- return Le(e).filter((n) => n.type !== "wx-blocks");
1003
+ function Zt(e) {
1004
+ return We(e).filter((n) => n.type !== "wx-blocks");
995
1005
  }
996
- const wn = /* @__PURE__ */ new Set(["wx-card", "wx-tabs", "wx-tab", "wx-row", "wx-col", "wx-divider"]);
997
- function _n(e) {
1006
+ const _n = /* @__PURE__ */ new Set(["wx-card", "wx-tabs", "wx-tab", "wx-row", "wx-col", "wx-divider"]);
1007
+ function xn(e) {
998
1008
  return e.replace(/[.*+?^${}()|[\]\\!]/g, "\\$&");
999
1009
  }
1000
- const xn = ["block", "entity", "loop", "__env", "errors", "app"];
1001
- function $n(e, n, t) {
1010
+ const $n = ["block", "entity", "loop", "__env", "errors", "app"];
1011
+ function Sn(e, n, t) {
1002
1012
  const s = [];
1003
1013
  /data-wx-block\s*=/.test(n.template) || s.push({ file: "template", code: "no-marker", line: null, message: t("checks.no-marker") });
1004
- const a = Sn(n.template, n.schema);
1014
+ const a = En(n.template, n.schema);
1005
1015
  a.length > 0 && s.push({
1006
1016
  file: "template",
1007
1017
  code: "variables-missing",
@@ -1011,35 +1021,35 @@ function $n(e, n, t) {
1011
1021
  })
1012
1022
  });
1013
1023
  const i = [], o = [], r = `.b-${e}`;
1014
- for (const [d, p] of En(n.styles))
1024
+ for (const [d, p] of Tn(n.styles))
1015
1025
  d.startsWith(r) || d.startsWith("&") || (/^[a-z][a-z0-9-]*/i.test(d) ? o.push([d, p]) : i.push([d, p]));
1016
1026
  i.length > 0 && s.push({
1017
1027
  file: "styles",
1018
1028
  code: "stray-selectors",
1019
1029
  line: i[0][1],
1020
- message: t("checks.stray-selectors", { slug: e, selectors: Et(i) })
1030
+ message: t("checks.stray-selectors", { slug: e, selectors: Tt(i) })
1021
1031
  }), o.length > 0 && s.push({
1022
1032
  file: "styles",
1023
1033
  code: "bare-selectors",
1024
1034
  line: o[0][1],
1025
- message: t("checks.bare-selectors", { selectors: Et(o) })
1035
+ message: t("checks.bare-selectors", { selectors: Tt(o) })
1026
1036
  });
1027
- const m = Qt(n.styles), c = /@media\b/.exec(m);
1037
+ const m = Xt(n.styles), c = /@media\b/.exec(m);
1028
1038
  return c && s.push({
1029
1039
  file: "styles",
1030
1040
  code: "media-query",
1031
- line: Xt(m, c.index),
1041
+ line: el(m, c.index),
1032
1042
  message: t("checks.media-query")
1033
1043
  }), s;
1034
1044
  }
1035
- function Zt(e) {
1045
+ function Qt(e) {
1036
1046
  const n = [];
1037
1047
  for (const t of e)
1038
- t.id && n.push(t.id), t.children && n.push(...Zt(t.children));
1048
+ t.id && n.push(t.id), t.children && n.push(...Qt(t.children));
1039
1049
  return n;
1040
1050
  }
1041
- function Sn(e, n) {
1042
- const t = /* @__PURE__ */ new Set([...Zt(n), ...xn]);
1051
+ function En(e, n) {
1052
+ const t = /* @__PURE__ */ new Set([...Qt(n), ...$n]);
1043
1053
  for (const a of e.matchAll(/\bas\s+\$([a-zA-Z_]\w*)(?:\s*=>\s*\$([a-zA-Z_]\w*))?/g))
1044
1054
  t.add(a[1]), a[2] && t.add(a[2]);
1045
1055
  for (const a of e.matchAll(/\$([a-zA-Z_]\w*)\s*(?:=[^=]|\+\+|--|\.=|\+=|-=)/g))
@@ -1051,68 +1061,68 @@ function Sn(e, n) {
1051
1061
  }
1052
1062
  return s;
1053
1063
  }
1054
- function En(e) {
1055
- const n = Qt(e), t = [];
1064
+ function Tn(e) {
1065
+ const n = Xt(e), t = [];
1056
1066
  for (const s of n.matchAll(/([^{};]+)\{/g)) {
1057
1067
  const a = s[1], i = a.trim();
1058
1068
  if (!(i === "" || i.startsWith("@")))
1059
1069
  for (const o of a.split(",")) {
1060
1070
  const r = o.trim();
1061
- r === "" || r === "from" || r === "to" || r.endsWith("%") || t.push([r, Xt(n, s.index + a.indexOf(r))]);
1071
+ r === "" || r === "from" || r === "to" || r.endsWith("%") || t.push([r, el(n, s.index + a.indexOf(r))]);
1062
1072
  }
1063
1073
  }
1064
1074
  return t;
1065
1075
  }
1066
- function Qt(e) {
1076
+ function Xt(e) {
1067
1077
  return e.replace(/\/\*[\s\S]*?\*\//g, (n) => n.replace(/[^\n]/g, " "));
1068
1078
  }
1069
- function Xt(e, n) {
1079
+ function el(e, n) {
1070
1080
  return e.slice(0, Math.max(0, n)).split(`
1071
1081
  `).length;
1072
1082
  }
1073
- function Et(e) {
1083
+ function Tt(e) {
1074
1084
  const n = [...new Set(e.map(([t]) => t))];
1075
1085
  return n.slice(0, 3).join(", ") + (n.length > 3 ? ", …" : "");
1076
1086
  }
1077
- function dt(e) {
1087
+ function pt(e) {
1078
1088
  return e.map((n) => ({
1079
1089
  ...n,
1080
1090
  name: n.name ?? n.id,
1081
- children: n.children ? dt(n.children) : n.children
1091
+ children: n.children ? pt(n.children) : n.children
1082
1092
  }));
1083
1093
  }
1084
- function it(e, n) {
1094
+ function rt(e, n) {
1085
1095
  return e === 0 ? n("page.not-used") : e === 1 ? n("page.on-page") : n("page.on-pages", { count: e });
1086
1096
  }
1087
- function Me(e, n) {
1097
+ function De(e, n) {
1088
1098
  const t = `groups.${e}`, s = n(t);
1089
1099
  return s === t || s === `webx-blocks::${t}` ? e.charAt(0).toUpperCase() + e.slice(1) : s;
1090
1100
  }
1091
- const Tn = { class: "wx-block-editor" }, Cn = { class: "wx-block-editor__split" }, Vn = {
1101
+ const Cn = { class: "wx-block-editor" }, Vn = { class: "wx-block-editor__split" }, Bn = {
1092
1102
  type: "button",
1093
1103
  class: "wx-block-editor__uses"
1094
- }, Bn = { class: "wx-block-editor__usage" }, An = { class: "wx-block-editor__pane" }, Wn = {
1104
+ }, An = { class: "wx-block-editor__usage" }, Ln = { class: "wx-block-editor__pane" }, Wn = {
1095
1105
  key: 0,
1096
1106
  class: "wx-block-editor__pills"
1097
- }, Ln = ["disabled", "onClick", "textContent"], zn = { class: "wx-block-editor__pane" }, Mn = { class: "wx-block-editor__pane" }, Dn = { class: "wx-block-editor__note" }, In = { class: "wx-block-editor__split" }, Nn = { class: "wx-block-editor__pane" }, Pn = { class: "wx-block-editor__note" }, Un = { class: "wx-block-editor__settings" }, On = {
1107
+ }, zn = ["disabled", "onClick", "textContent"], Dn = { class: "wx-block-editor__pane" }, Mn = { class: "wx-block-editor__pane" }, Nn = { class: "wx-block-editor__note" }, In = { class: "wx-block-editor__split" }, Pn = { class: "wx-block-editor__pane" }, On = { class: "wx-block-editor__note" }, Un = { class: "wx-block-editor__settings" }, Rn = {
1098
1108
  key: 0,
1099
1109
  class: "is-wide wx-block-editor__danger"
1100
- }, Rn = /* @__PURE__ */ ae({
1110
+ }, jn = /* @__PURE__ */ ae({
1101
1111
  __name: "BlockEditorPage",
1102
1112
  props: {
1103
1113
  base: { default: "/blocks" }
1104
1114
  },
1105
1115
  setup(e) {
1106
- const n = e, t = Oe(), s = ze(t), a = cl(), i = At();
1107
- Fe();
1108
- const o = de("webx-blocks"), r = Re(), m = V(() => Number(a.params.id)), c = N(null), d = N([]), p = N(!0), v = N(!1), g = N(!1), x = N("template"), T = V(() => {
1109
- const W = t.state.manifest?.modules.find((k) => k.id === "blocks")?.meta;
1116
+ const n = e, t = Re(), s = ze(t), a = dl(), i = Lt();
1117
+ He();
1118
+ const o = de("webx-blocks"), r = je(), m = V(() => Number(a.params.id)), c = I(null), d = I([]), p = I(!0), v = I(!1), g = I(!1), x = I("template"), T = V(() => {
1119
+ const L = t.state.manifest?.modules.find((k) => k.id === "blocks")?.meta;
1110
1120
  return {
1111
- groups: W?.groups ?? [],
1112
- editing: W?.editing ?? !0,
1113
- provides: W?.provides ?? []
1121
+ groups: L?.groups ?? [],
1122
+ editing: L?.editing ?? !0,
1123
+ provides: L?.provides ?? []
1114
1124
  };
1115
- }), w = V(() => t.can("blocks.manage") && T.value.editing), y = lt({
1125
+ }), w = V(() => t.can("blocks.manage") && T.value.editing), y = nt({
1116
1126
  slug: "",
1117
1127
  title: "",
1118
1128
  description: "",
@@ -1123,96 +1133,96 @@ const Tn = { class: "wx-block-editor" }, Cn = { class: "wx-block-editor__split"
1123
1133
  allowed_in: [],
1124
1134
  max_per_entity: null,
1125
1135
  is_enabled: !0
1126
- }), _ = lt({
1136
+ }), _ = nt({
1127
1137
  schema: [],
1128
1138
  template: "",
1129
1139
  styles: "",
1130
1140
  script: null,
1131
1141
  sample: {}
1132
- }), R = N("[]"), K = N(null), Y = N(""), X = N({}), h = N(null), A = lt({
1142
+ }), R = I("[]"), K = I(null), Y = I(""), X = I({}), h = I(null), A = nt({
1133
1143
  html: "",
1134
1144
  styles: "",
1135
1145
  script: null,
1136
1146
  runtime: null,
1137
1147
  stage: null,
1138
1148
  loading: !1
1139
- }), P = V(() => JSON.stringify({ settings: y, content: _ })), J = V(() => Y.value !== "" && P.value !== Y.value), Se = V(() => $n(y.slug, _, o)), ne = {
1149
+ }), P = V(() => JSON.stringify({ settings: y, content: _ })), J = V(() => Y.value !== "" && P.value !== Y.value), Se = V(() => Sn(y.slug, _, o)), ne = {
1140
1150
  template: [
1141
- ot(
1142
- rn({ schema: () => _.schema, styles: () => _.styles })
1151
+ at(
1152
+ un({ schema: () => _.schema, styles: () => _.styles })
1143
1153
  )
1144
1154
  ],
1145
1155
  styles: [
1146
- ot(hn({ slug: () => y.slug, template: () => _.template }))
1156
+ at(bn({ slug: () => y.slug, template: () => _.template }))
1147
1157
  ],
1148
1158
  // The renderer's own types under the panel's, the same merge the sample form is drawn with.
1149
- schema: [ot(yn({ types: () => ({ ...Ye, ...t.types }) }))]
1159
+ schema: [at(kn({ types: () => ({ ...Je, ...t.types }) }))]
1150
1160
  }, pe = V(() => {
1151
- const W = [...T.value.groups];
1152
- return W.includes(y.group) || W.push(y.group), W.map((k) => ({ value: k, label: Me(k, o) }));
1153
- }), ke = V({
1161
+ const L = [...T.value.groups];
1162
+ return L.includes(y.group) || L.push(y.group), L.map((k) => ({ value: k, label: De(k, o) }));
1163
+ }), ye = V({
1154
1164
  get: () => _.sample,
1155
- set: (W) => {
1156
- _.sample = W;
1165
+ set: (L) => {
1166
+ _.sample = L;
1157
1167
  }
1158
1168
  }), Ee = V(() => Te(_.schema));
1159
- function Te(W) {
1169
+ function Te(L) {
1160
1170
  const k = [];
1161
- for (const E of W)
1171
+ for (const E of L)
1162
1172
  E.type !== "wx-blocks" && !(E.children?.length && !E.name) && k.push(E.id), E.children && k.push(...Te(E.children));
1163
1173
  return k;
1164
1174
  }
1165
- function Q(W) {
1166
- c.value = W, Object.assign(y, {
1167
- slug: W.slug,
1168
- title: W.title,
1169
- description: W.description,
1170
- icon: W.icon,
1171
- group: W.group,
1172
- sort: W.sort,
1173
- allow: W.allow ?? [],
1174
- allowed_in: W.allowed_in ?? [],
1175
- max_per_entity: W.max_per_entity,
1176
- is_enabled: W.is_enabled
1175
+ function Q(L) {
1176
+ c.value = L, Object.assign(y, {
1177
+ slug: L.slug,
1178
+ title: L.title,
1179
+ description: L.description,
1180
+ icon: L.icon,
1181
+ group: L.group,
1182
+ sort: L.sort,
1183
+ allow: L.allow ?? [],
1184
+ allowed_in: L.allowed_in ?? [],
1185
+ max_per_entity: L.max_per_entity,
1186
+ is_enabled: L.is_enabled
1177
1187
  });
1178
- const k = W.content ?? {
1188
+ const k = L.content ?? {
1179
1189
  schema: [],
1180
1190
  template: "",
1181
1191
  styles: "",
1182
1192
  script: null,
1183
1193
  sample: {}
1184
1194
  };
1185
- Object.assign(_, ge(k)), R.value = JSON.stringify(k.schema, null, 2), K.value = null, Y.value = P.value;
1195
+ Object.assign(_, be(k)), R.value = JSON.stringify(k.schema, null, 2), K.value = null, Y.value = P.value;
1186
1196
  }
1187
- async function we() {
1197
+ async function ke() {
1188
1198
  p.value = !0;
1189
1199
  try {
1190
1200
  Q(await s.get(m.value)), d.value = await s.usage(m.value);
1191
- } catch (W) {
1192
- Z.danger(r(W));
1201
+ } catch (L) {
1202
+ Z.danger(r(L));
1193
1203
  } finally {
1194
1204
  p.value = !1;
1195
1205
  }
1196
1206
  }
1197
- function Ce(W) {
1198
- R.value = W;
1207
+ function Ce(L) {
1208
+ R.value = L;
1199
1209
  try {
1200
- const k = JSON.parse(W);
1210
+ const k = JSON.parse(L);
1201
1211
  if (!Array.isArray(k)) throw new Error("not a list");
1202
1212
  _.schema = k, K.value = null;
1203
1213
  } catch (k) {
1204
1214
  K.value = o("page.schema-invalid", { error: k.message });
1205
1215
  }
1206
1216
  }
1207
- let ye, L = 0;
1208
- function U() {
1209
- clearTimeout(ye), ye = setTimeout(() => {
1217
+ let ge, W = 0;
1218
+ function O() {
1219
+ clearTimeout(ge), ge = setTimeout(() => {
1210
1220
  j();
1211
1221
  }, 250);
1212
1222
  }
1213
1223
  async function j() {
1214
1224
  if (!c.value) return;
1215
- const W = ++L;
1225
+ const L = ++W;
1216
1226
  A.loading = !0;
1217
1227
  try {
1218
1228
  const k = await s.render(c.value.id, {
@@ -1224,35 +1234,35 @@ const Tn = { class: "wx-block-editor" }, Cn = { class: "wx-block-editor__split"
1224
1234
  schema: _.schema
1225
1235
  } : void 0
1226
1236
  });
1227
- if (W !== L) return;
1237
+ if (L !== W) return;
1228
1238
  A.html = k.html, A.styles = k.styles, A.script = k.script, A.runtime = k.runtime, A.stage = k.stage ?? null;
1229
1239
  } catch (k) {
1230
- W === L && Z.danger(r(k));
1240
+ L === W && Z.danger(r(k));
1231
1241
  } finally {
1232
- W === L && (A.loading = !1);
1242
+ L === W && (A.loading = !1);
1233
1243
  }
1234
1244
  }
1235
1245
  te(
1236
1246
  () => [_.template, _.styles, _.script, _.schema, _.sample],
1237
- U,
1247
+ O,
1238
1248
  { deep: !0 }
1239
1249
  );
1240
- const G = N(null);
1241
- function fe(W) {
1242
- return `{{ $${W} }}`;
1250
+ const G = I(null);
1251
+ function fe(L) {
1252
+ return `{{ $${L} }}`;
1243
1253
  }
1244
- function _e(W) {
1254
+ function we(L) {
1245
1255
  const E = G.value?.view?.value;
1246
1256
  if (!E) {
1247
- _.template += `{{ $${W} }}`;
1257
+ _.template += `{{ $${L} }}`;
1248
1258
  return;
1249
1259
  }
1250
- E.dispatch(E.state.replaceSelection(`{{ $${W} }}`)), E.focus();
1260
+ E.dispatch(E.state.replaceSelection(`{{ $${L} }}`)), E.focus();
1251
1261
  }
1252
1262
  async function se() {
1253
1263
  if (!c.value) return;
1254
1264
  v.value = !0, X.value = {}, h.value = null;
1255
- const W = c.value.draft?.number ?? null;
1265
+ const L = c.value.draft?.number ?? null;
1256
1266
  try {
1257
1267
  const k = await s.update(c.value.id, {
1258
1268
  ...y,
@@ -1263,7 +1273,7 @@ const Tn = { class: "wx-block-editor" }, Cn = { class: "wx-block-editor__split"
1263
1273
  content: K.value ? { ..._, schema: void 0 } : _
1264
1274
  });
1265
1275
  Q(k), Z.success(
1266
- k.draft && k.draft.number !== W ? o("page.saved", { number: k.draft.number }) : o("page.unchanged")
1276
+ k.draft && k.draft.number !== L ? o("page.saved", { number: k.draft.number }) : o("page.unchanged")
1267
1277
  );
1268
1278
  } catch (k) {
1269
1279
  const E = k.body;
@@ -1273,7 +1283,7 @@ const Tn = { class: "wx-block-editor" }, Cn = { class: "wx-block-editor__split"
1273
1283
  }
1274
1284
  }
1275
1285
  async function ve() {
1276
- if (!(!c.value?.draft || (J.value && await se(), !c.value.draft) || !await Ge({
1286
+ if (!(!c.value?.draft || (J.value && await se(), !c.value.draft) || !await Ze({
1277
1287
  title: o("page.publish-title", { number: c.value.draft.number }),
1278
1288
  message: o("page.publish-text", { count: c.value.usage_count }),
1279
1289
  confirmText: o("page.publish"),
@@ -1291,7 +1301,7 @@ const Tn = { class: "wx-block-editor" }, Cn = { class: "wx-block-editor__split"
1291
1301
  }
1292
1302
  }
1293
1303
  async function Ve() {
1294
- if (!(!c.value || !await Ge({
1304
+ if (!(!c.value || !await Ze({
1295
1305
  title: o("page.delete-title", { title: c.value.title }),
1296
1306
  message: o("page.delete-text"),
1297
1307
  confirmText: o("page.delete"),
@@ -1304,7 +1314,7 @@ const Tn = { class: "wx-block-editor" }, Cn = { class: "wx-block-editor__split"
1304
1314
  Z.danger(r(k));
1305
1315
  }
1306
1316
  }
1307
- const De = V(
1317
+ const Me = V(
1308
1318
  () => h.value ? {
1309
1319
  message: h.value.errors.template?.[0] ?? h.value.message,
1310
1320
  line: h.value.line,
@@ -1312,7 +1322,7 @@ const Tn = { class: "wx-block-editor" }, Cn = { class: "wx-block-editor__split"
1312
1322
  title: h.value.entity.title ?? `#${h.value.entity.id}`
1313
1323
  }) : null
1314
1324
  } : null
1315
- ), $ = V(() => x.value === "template" || x.value === "styles"), M = V(() => [
1325
+ ), $ = V(() => x.value === "template" || x.value === "styles"), D = V(() => [
1316
1326
  {
1317
1327
  title: o("page.example-handler"),
1318
1328
  code: `el.querySelector('.b-hero__button')?.addEventListener('click', (event) => {
@@ -1335,21 +1345,21 @@ setInterval(() => el.classList.toggle('is-second'), seconds * 1000)`
1335
1345
 
1336
1346
  new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1337
1347
  }
1338
- ]), O = V(() => d.value.slice(0, 5));
1339
- function H(W) {
1340
- return X.value[W]?.[0];
1348
+ ]), U = V(() => d.value.slice(0, 5));
1349
+ function H(L) {
1350
+ return X.value[L]?.[0];
1341
1351
  }
1342
- function ee(W) {
1343
- J.value && W.preventDefault();
1352
+ function ee(L) {
1353
+ J.value && L.preventDefault();
1344
1354
  }
1345
1355
  Ue(() => {
1346
- we(), window.addEventListener("beforeunload", ee);
1347
- }), Ze(() => {
1348
- clearTimeout(ye), window.removeEventListener("beforeunload", ee);
1356
+ ke(), window.addEventListener("beforeunload", ee);
1357
+ }), Qe(() => {
1358
+ clearTimeout(ge), window.removeEventListener("beforeunload", ee);
1349
1359
  }), te(m, () => {
1350
- we();
1360
+ ke();
1351
1361
  });
1352
- const et = V(
1362
+ const tt = V(
1353
1363
  () => w.value ? [
1354
1364
  { key: "save", label: o("page.save"), loading: v.value, run: () => {
1355
1365
  se();
@@ -1366,42 +1376,42 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1366
1376
  }
1367
1377
  ] : []
1368
1378
  );
1369
- return (W, k) => (u(), C("div", Tn, [
1379
+ return (L, k) => (u(), C("div", Cn, [
1370
1380
  p.value || !c.value ? (u(), C(F, { key: 0 }, [
1371
- f(l(We), {
1381
+ f(l(Le), {
1372
1382
  class: "wx-block-editor__ghost-head",
1373
1383
  title: "",
1374
1384
  rows: 1
1375
1385
  }),
1376
- B("div", Cn, [
1386
+ B("div", Vn, [
1377
1387
  f(l(Be), null, {
1378
1388
  default: b(() => [
1379
- f(l(We), { rows: 8 })
1389
+ f(l(Le), { rows: 8 })
1380
1390
  ]),
1381
1391
  _: 1
1382
1392
  }),
1383
1393
  f(l(Be), null, {
1384
1394
  default: b(() => [
1385
- f(l(We), { rows: 4 })
1395
+ f(l(Le), { rows: 4 })
1386
1396
  ]),
1387
1397
  _: 1
1388
1398
  })
1389
1399
  ])
1390
1400
  ], 64)) : (u(), C(F, { key: 1 }, [
1391
- f(l(pl), {
1401
+ f(l(fl), {
1392
1402
  title: y.title,
1393
1403
  back: e.base,
1394
1404
  "back-label": l(o)("page.back"),
1395
- actions: et.value
1405
+ actions: tt.value
1396
1406
  }, {
1397
1407
  "title-after": b(() => [
1398
- w.value ? (u(), D(l(fl), {
1408
+ w.value ? (u(), M(l(vl), {
1399
1409
  key: 0,
1400
1410
  name: y.title,
1401
1411
  placeholder: l(o)("page.title"),
1402
1412
  onRename: k[0] || (k[0] = (E) => y.title = E)
1403
- }, null, 8, ["name", "placeholder"])) : I("", !0),
1404
- J.value ? (u(), D(l(ue), {
1413
+ }, null, 8, ["name", "placeholder"])) : N("", !0),
1414
+ J.value ? (u(), M(l(ue), {
1405
1415
  key: 1,
1406
1416
  type: "primary",
1407
1417
  dot: ""
@@ -1410,8 +1420,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1410
1420
  z(S(l(o)("page.unsaved")), 1)
1411
1421
  ]),
1412
1422
  _: 1
1413
- })) : I("", !0),
1414
- c.value.draft ? (u(), D(l(ue), {
1423
+ })) : N("", !0),
1424
+ c.value.draft ? (u(), M(l(ue), {
1415
1425
  key: 2,
1416
1426
  type: "warning",
1417
1427
  dot: ""
@@ -1420,8 +1430,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1420
1430
  z(S(l(o)("page.draft", { number: c.value.draft.number })), 1)
1421
1431
  ]),
1422
1432
  _: 1
1423
- })) : I("", !0),
1424
- c.value.published ? (u(), D(l(ue), {
1433
+ })) : N("", !0),
1434
+ c.value.published ? (u(), M(l(ue), {
1425
1435
  key: 3,
1426
1436
  type: "success",
1427
1437
  dot: ""
@@ -1430,7 +1440,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1430
1440
  z(S(l(o)("page.live", { number: c.value.published.number })), 1)
1431
1441
  ]),
1432
1442
  _: 1
1433
- })) : (u(), D(l(ue), {
1443
+ })) : (u(), M(l(ue), {
1434
1444
  key: 4,
1435
1445
  type: "default"
1436
1446
  }, {
@@ -1442,24 +1452,24 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1442
1452
  ]),
1443
1453
  subtitle: b(() => [
1444
1454
  B("code", null, S(y.slug), 1),
1445
- z(" · " + S(l(Me)(y.group, l(o))) + " · ", 1),
1446
- c.value.usage_count > 0 ? (u(), D(l(gl), {
1455
+ z(" · " + S(l(De)(y.group, l(o))) + " · ", 1),
1456
+ c.value.usage_count > 0 ? (u(), M(l(yl), {
1447
1457
  key: 0,
1448
1458
  title: l(o)("page.usage"),
1449
1459
  width: 260,
1450
1460
  align: "start"
1451
1461
  }, {
1452
1462
  trigger: b(() => [
1453
- B("button", Vn, S(l(it)(c.value.usage_count, l(o))), 1)
1463
+ B("button", Bn, S(l(rt)(c.value.usage_count, l(o))), 1)
1454
1464
  ]),
1455
1465
  default: b(() => [
1456
- B("div", Bn, [
1457
- (u(!0), C(F, null, le(O.value, (E) => (u(), C("div", {
1466
+ B("div", An, [
1467
+ (u(!0), C(F, null, le(U.value, (E) => (u(), C("div", {
1458
1468
  key: `${E.model}:${E.id}`,
1459
1469
  class: "wx-block-editor__use"
1460
1470
  }, [
1461
1471
  B("span", null, S(E.title ?? `#${E.id}`), 1),
1462
- E.published ? I("", !0) : (u(), D(l(ue), {
1472
+ E.published ? N("", !0) : (u(), M(l(ue), {
1463
1473
  key: 0,
1464
1474
  type: "warning",
1465
1475
  size: "sm"
@@ -1470,26 +1480,26 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1470
1480
  _: 1
1471
1481
  }))
1472
1482
  ]))), 128)),
1473
- d.value.length > O.value.length ? (u(), D(l(q), {
1483
+ d.value.length > U.value.length ? (u(), M(l(q), {
1474
1484
  key: 0,
1475
1485
  size: "sm",
1476
1486
  tone: "muted"
1477
1487
  }, {
1478
1488
  default: b(() => [
1479
- z(S(l(o)("page.usage-more", { count: d.value.length - O.value.length })), 1)
1489
+ z(S(l(o)("page.usage-more", { count: d.value.length - U.value.length })), 1)
1480
1490
  ]),
1481
1491
  _: 1
1482
- })) : I("", !0)
1492
+ })) : N("", !0)
1483
1493
  ])
1484
1494
  ]),
1485
1495
  _: 1
1486
1496
  }, 8, ["title"])) : (u(), C(F, { key: 1 }, [
1487
- z(S(l(it)(c.value.usage_count, l(o))), 1)
1497
+ z(S(l(rt)(c.value.usage_count, l(o))), 1)
1488
1498
  ], 64))
1489
1499
  ]),
1490
1500
  _: 1
1491
1501
  }, 8, ["title", "back", "back-label", "actions"]),
1492
- T.value.editing ? I("", !0) : (u(), D(l(Lt), {
1502
+ T.value.editing ? N("", !0) : (u(), M(l(zt), {
1493
1503
  key: 0,
1494
1504
  type: "info",
1495
1505
  variant: "soft",
@@ -1498,7 +1508,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1498
1508
  B("div", {
1499
1509
  class: $e(["wx-block-editor__columns", { "is-alone": !$.value }])
1500
1510
  }, [
1501
- f(l(yl), {
1511
+ f(l(kl), {
1502
1512
  modelValue: x.value,
1503
1513
  "onUpdate:modelValue": k[14] || (k[14] = (E) => x.value = E),
1504
1514
  "keep-alive": ""
@@ -1509,8 +1519,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1509
1519
  label: l(o)("page.tab-template")
1510
1520
  }, {
1511
1521
  default: b(() => [
1512
- B("div", An, [
1513
- f(l(He), {
1522
+ B("div", Ln, [
1523
+ f(l(qe), {
1514
1524
  ref_key: "templateEditor",
1515
1525
  ref: G,
1516
1526
  modelValue: _.template,
@@ -1537,15 +1547,15 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1537
1547
  type: "button",
1538
1548
  class: "wx-block-editor__pill",
1539
1549
  disabled: !w.value,
1540
- onClick: (tt) => _e(E),
1550
+ onClick: (lt) => we(E),
1541
1551
  textContent: S(fe(E))
1542
- }, null, 8, Ln))), 128))
1543
- ])) : I("", !0),
1544
- f(bt, {
1552
+ }, null, 8, zn))), 128))
1553
+ ])) : N("", !0),
1554
+ f(gt, {
1545
1555
  file: "template",
1546
1556
  lints: Se.value,
1547
1557
  slug: y.slug,
1548
- error: De.value
1558
+ error: Me.value
1549
1559
  }, null, 8, ["lints", "slug", "error"])
1550
1560
  ])
1551
1561
  ]),
@@ -1556,8 +1566,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1556
1566
  label: l(o)("page.tab-styles")
1557
1567
  }, {
1558
1568
  default: b(() => [
1559
- B("div", zn, [
1560
- f(l(He), {
1569
+ B("div", Dn, [
1570
+ f(l(qe), {
1561
1571
  modelValue: _.styles,
1562
1572
  "onUpdate:modelValue": k[2] || (k[2] = (E) => _.styles = E),
1563
1573
  language: "css",
@@ -1566,7 +1576,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1566
1576
  "min-height": "340px",
1567
1577
  "max-height": "70vh"
1568
1578
  }, null, 8, ["modelValue", "extensions", "readonly"]),
1569
- f(bt, {
1579
+ f(gt, {
1570
1580
  file: "styles",
1571
1581
  lints: Se.value,
1572
1582
  slug: y.slug
@@ -1581,7 +1591,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1581
1591
  }, {
1582
1592
  default: b(() => [
1583
1593
  B("div", Mn, [
1584
- f(l(He), {
1594
+ f(l(qe), {
1585
1595
  "model-value": _.script ?? "",
1586
1596
  language: "javascript",
1587
1597
  readonly: !w.value,
@@ -1589,7 +1599,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1589
1599
  "max-height": "70vh",
1590
1600
  "onUpdate:modelValue": k[3] || (k[3] = (E) => _.script = E || null)
1591
1601
  }, null, 8, ["model-value", "readonly"]),
1592
- B("div", Dn, [
1602
+ B("div", Nn, [
1593
1603
  f(l(q), {
1594
1604
  size: "sm",
1595
1605
  tone: "muted"
@@ -1615,7 +1625,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1615
1625
  title: l(o)("page.examples")
1616
1626
  }, {
1617
1627
  default: b(() => [
1618
- (u(!0), C(F, null, le(M.value, (E) => (u(), C("div", {
1628
+ (u(!0), C(F, null, le(D.value, (E) => (u(), C("div", {
1619
1629
  key: E.title,
1620
1630
  class: "wx-block-editor__example"
1621
1631
  }, [
@@ -1644,8 +1654,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1644
1654
  }, {
1645
1655
  default: b(() => [
1646
1656
  B("div", In, [
1647
- B("div", Nn, [
1648
- f(l(He), {
1657
+ B("div", Pn, [
1658
+ f(l(qe), {
1649
1659
  "model-value": R.value,
1650
1660
  language: "json",
1651
1661
  extensions: ne.schema,
@@ -1655,8 +1665,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1655
1665
  "max-height": "70vh",
1656
1666
  "onUpdate:modelValue": Ce
1657
1667
  }, null, 8, ["model-value", "extensions", "readonly"]),
1658
- B("div", Pn, [
1659
- K.value ? (u(), D(l(q), {
1668
+ B("div", On, [
1669
+ K.value ? (u(), M(l(q), {
1660
1670
  key: 0,
1661
1671
  size: "sm",
1662
1672
  tone: "danger"
@@ -1665,7 +1675,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1665
1675
  z(S(K.value), 1)
1666
1676
  ]),
1667
1677
  _: 1
1668
- })) : H("content.schema") ? (u(), D(l(q), {
1678
+ })) : H("content.schema") ? (u(), M(l(q), {
1669
1679
  key: 1,
1670
1680
  size: "sm",
1671
1681
  tone: "danger"
@@ -1674,7 +1684,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1674
1684
  z(S(H("content.schema")), 1)
1675
1685
  ]),
1676
1686
  _: 1
1677
- })) : (u(), D(l(q), {
1687
+ })) : (u(), M(l(q), {
1678
1688
  key: 2,
1679
1689
  size: "sm",
1680
1690
  tone: "muted"
@@ -1684,7 +1694,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1684
1694
  ]),
1685
1695
  _: 1
1686
1696
  })),
1687
- f(l(vl), {
1697
+ f(l(ml), {
1688
1698
  title: l(o)("help.schema-title"),
1689
1699
  body: l(o)("help.schema")
1690
1700
  }, null, 8, ["title", "body"])
@@ -1695,17 +1705,17 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1695
1705
  title: l(o)("page.sample")
1696
1706
  }, {
1697
1707
  default: b(() => [
1698
- _.schema.length ? (u(), D(l(Pt), {
1708
+ _.schema.length ? (u(), M(l(Ot), {
1699
1709
  key: 0,
1700
- modelValue: ke.value,
1701
- "onUpdate:modelValue": k[4] || (k[4] = (E) => ke.value = E),
1702
- root: l(dt)(_.schema),
1710
+ modelValue: ye.value,
1711
+ "onUpdate:modelValue": k[4] || (k[4] = (E) => ye.value = E),
1712
+ root: l(pt)(_.schema),
1703
1713
  types: l(t).types,
1704
1714
  translate: l(t).i18n.t,
1705
1715
  can: l(t).can,
1706
1716
  disabled: !w.value,
1707
1717
  size: "sm"
1708
- }, null, 8, ["modelValue", "root", "types", "translate", "can", "disabled"])) : I("", !0)
1718
+ }, null, 8, ["modelValue", "root", "types", "translate", "can", "disabled"])) : N("", !0)
1709
1719
  ]),
1710
1720
  _: 1
1711
1721
  }, 8, ["title"])
@@ -1728,7 +1738,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1728
1738
  disabled: !w.value
1729
1739
  }, {
1730
1740
  default: b(() => [
1731
- f(l(Pe), {
1741
+ f(l(Oe), {
1732
1742
  modelValue: y.slug,
1733
1743
  "onUpdate:modelValue": k[5] || (k[5] = (E) => y.slug = E)
1734
1744
  }, null, 8, ["modelValue"])
@@ -1742,7 +1752,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1742
1752
  disabled: !w.value
1743
1753
  }, {
1744
1754
  default: b(() => [
1745
- f(l(zt), {
1755
+ f(l(Dt), {
1746
1756
  modelValue: y.group,
1747
1757
  "onUpdate:modelValue": k[6] || (k[6] = (E) => y.group = E),
1748
1758
  options: pe.value
@@ -1758,7 +1768,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1758
1768
  disabled: !w.value
1759
1769
  }, {
1760
1770
  default: b(() => [
1761
- f(l(kl), {
1771
+ f(l(wl), {
1762
1772
  "model-value": y.description ?? "",
1763
1773
  rows: 2,
1764
1774
  "onUpdate:modelValue": k[7] || (k[7] = (E) => y.description = String(E ?? ""))
@@ -1772,7 +1782,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1772
1782
  disabled: !w.value
1773
1783
  }, {
1774
1784
  default: b(() => [
1775
- f(l(wl), {
1785
+ f(l(_l), {
1776
1786
  "model-value": y.icon,
1777
1787
  clearable: "",
1778
1788
  placeholder: l(o)("page.icon-search"),
@@ -1791,7 +1801,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1791
1801
  disabled: !w.value
1792
1802
  }, {
1793
1803
  default: b(() => [
1794
- f(l(mt), {
1804
+ f(l(ht), {
1795
1805
  modelValue: y.sort,
1796
1806
  "onUpdate:modelValue": k[9] || (k[9] = (E) => y.sort = E)
1797
1807
  }, null, 8, ["modelValue"])
@@ -1805,7 +1815,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1805
1815
  disabled: !w.value
1806
1816
  }, {
1807
1817
  default: b(() => [
1808
- f(l(ht), {
1818
+ f(l(bt), {
1809
1819
  modelValue: y.allow,
1810
1820
  "onUpdate:modelValue": k[10] || (k[10] = (E) => y.allow = E),
1811
1821
  "allow-create": ""
@@ -1820,7 +1830,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1820
1830
  disabled: !w.value
1821
1831
  }, {
1822
1832
  default: b(() => [
1823
- f(l(ht), {
1833
+ f(l(bt), {
1824
1834
  modelValue: y.allowed_in,
1825
1835
  "onUpdate:modelValue": k[11] || (k[11] = (E) => y.allowed_in = E),
1826
1836
  "allow-create": "",
@@ -1836,7 +1846,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1836
1846
  disabled: !w.value
1837
1847
  }, {
1838
1848
  default: b(() => [
1839
- f(l(mt), {
1849
+ f(l(ht), {
1840
1850
  "model-value": y.max_per_entity ?? void 0,
1841
1851
  min: 1,
1842
1852
  "onUpdate:modelValue": k[12] || (k[12] = (E) => y.max_per_entity = E ?? null)
@@ -1850,14 +1860,14 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1850
1860
  disabled: !w.value
1851
1861
  }, {
1852
1862
  default: b(() => [
1853
- f(l(_l), {
1863
+ f(l(xl), {
1854
1864
  modelValue: y.is_enabled,
1855
1865
  "onUpdate:modelValue": k[13] || (k[13] = (E) => y.is_enabled = E)
1856
1866
  }, null, 8, ["modelValue"])
1857
1867
  ]),
1858
1868
  _: 1
1859
1869
  }, 8, ["label", "help", "disabled"]),
1860
- w.value ? (u(), C("div", On, [
1870
+ w.value ? (u(), C("div", Rn, [
1861
1871
  f(l(ce), {
1862
1872
  type: "danger",
1863
1873
  variant: "outline",
@@ -1869,7 +1879,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1869
1879
  ]),
1870
1880
  _: 1
1871
1881
  }, 8, ["disabled"]),
1872
- c.value.usage_count > 0 ? (u(), D(l(q), {
1882
+ c.value.usage_count > 0 ? (u(), M(l(q), {
1873
1883
  key: 0,
1874
1884
  size: "sm",
1875
1885
  tone: "muted"
@@ -1878,8 +1888,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1878
1888
  z(S(c.value.usage_count === 1 ? l(o)("page.delete-used-one") : l(o)("page.delete-used", { count: c.value.usage_count })), 1)
1879
1889
  ]),
1880
1890
  _: 1
1881
- })) : I("", !0)
1882
- ])) : I("", !0)
1891
+ })) : N("", !0)
1892
+ ])) : N("", !0)
1883
1893
  ])
1884
1894
  ]),
1885
1895
  _: 1
@@ -1911,7 +1921,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1911
1921
  ]),
1912
1922
  _: 1
1913
1923
  }, 8, ["modelValue"]),
1914
- ll(f(ql, {
1924
+ nl(f(Kl, {
1915
1925
  class: "wx-block-editor__stage",
1916
1926
  html: A.html,
1917
1927
  styles: A.styles,
@@ -1920,10 +1930,10 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1920
1930
  stage: A.stage,
1921
1931
  loading: A.loading
1922
1932
  }, null, 8, ["html", "styles", "script", "runtime", "stage", "loading"]), [
1923
- [nl, $.value]
1933
+ [sl, $.value]
1924
1934
  ])
1925
1935
  ], 2),
1926
- w.value ? (u(), D(l(xl), { key: 1 }, {
1936
+ w.value ? (u(), M(l($l), { key: 1 }, {
1927
1937
  default: b(() => [
1928
1938
  f(l(ce), {
1929
1939
  variant: "outline",
@@ -1948,14 +1958,14 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1948
1958
  }, 8, ["loading", "disabled"])
1949
1959
  ]),
1950
1960
  _: 1
1951
- })) : I("", !0)
1961
+ })) : N("", !0)
1952
1962
  ], 64))
1953
1963
  ]));
1954
1964
  }
1955
- }), jn = /* @__PURE__ */ ie(Rn, [["__scopeId", "data-v-22e5f784"]]), Fn = ["srcdoc"], Hn = {
1965
+ }), Fn = /* @__PURE__ */ ie(jn, [["__scopeId", "data-v-22e5f784"]]), Hn = ["srcdoc"], qn = {
1956
1966
  key: 1,
1957
1967
  class: "wx-block-thumb__empty"
1958
- }, qn = /* @__PURE__ */ ae({
1968
+ }, Kn = /* @__PURE__ */ ae({
1959
1969
  __name: "BlockThumb",
1960
1970
  props: {
1961
1971
  thumbnail: {},
@@ -1963,8 +1973,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1963
1973
  height: { default: 120 }
1964
1974
  },
1965
1975
  setup(e) {
1966
- const n = e, t = N(null), s = Qe(t), a = V(() => s.value > 0 ? s.value / n.width : 0.2), i = V(
1967
- () => n.thumbnail ? Rt({ html: n.thumbnail.html, styles: n.thumbnail.styles }) : ""
1976
+ const n = e, t = I(null), s = Xe(t), a = V(() => s.value > 0 ? s.value / n.width : 0.2), i = V(
1977
+ () => n.thumbnail ? jt({ html: n.thumbnail.html, styles: n.thumbnail.styles }) : ""
1968
1978
  ), o = V(() => ({
1969
1979
  width: `${n.width}px`,
1970
1980
  height: `${Math.round(n.height / a.value)}px`,
@@ -1984,15 +1994,15 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1984
1994
  sandbox: "allow-same-origin",
1985
1995
  tabindex: "-1",
1986
1996
  "aria-hidden": "true"
1987
- }, null, 12, Fn)) : (u(), C("div", Hn, [
1988
- f(l(be), { name: "grid" })
1997
+ }, null, 12, Hn)) : (u(), C("div", qn, [
1998
+ f(l(he), { name: "grid" })
1989
1999
  ]))
1990
2000
  ], 4));
1991
2001
  }
1992
- }), el = /* @__PURE__ */ ie(qn, [["__scopeId", "data-v-615b818a"]]), Kn = { class: "wx-block-picker" }, Yn = {
2002
+ }), tl = /* @__PURE__ */ ie(Kn, [["__scopeId", "data-v-615b818a"]]), Yn = { class: "wx-block-picker" }, Jn = {
1993
2003
  key: 0,
1994
2004
  class: "wx-block-picker__group-title"
1995
- }, Jn = { class: "wx-block-picker__cards" }, Gn = ["disabled", "title", "onClick"], Zn = { class: "wx-block-picker__body" }, Qn = { class: "wx-block-picker__title" }, Xn = /* @__PURE__ */ ae({
2005
+ }, Gn = { class: "wx-block-picker__cards" }, Zn = ["disabled", "title", "onClick"], Qn = { class: "wx-block-picker__body" }, Xn = { class: "wx-block-picker__title" }, es = /* @__PURE__ */ ae({
1996
2006
  __name: "BlockPicker",
1997
2007
  props: {
1998
2008
  catalog: {},
@@ -2004,8 +2014,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2004
2014
  },
2005
2015
  setup(e) {
2006
2016
  const n = e, { resolve: t, dismiss: s, open: a } = Mt();
2007
- Fe();
2008
- const i = de("webx-blocks"), o = N("");
2017
+ He();
2018
+ const i = de("webx-blocks"), o = I("");
2009
2019
  function r(v) {
2010
2020
  if (n.parent === null)
2011
2021
  return v.allowed_in === null || v.allowed_in.includes("root");
@@ -2014,7 +2024,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2014
2024
  }
2015
2025
  const m = V(
2016
2026
  () => n.catalog.filter((v) => v.is_enabled && v.published !== null && r(v)).map((v) => {
2017
- const g = Yl(n.tree, v.slug), x = v.max_per_entity !== null && g >= v.max_per_entity;
2027
+ const g = Jl(n.tree, v.slug), x = v.max_per_entity !== null && g >= v.max_per_entity;
2018
2028
  return { type: v, reason: x ? i("field.limit-reached", { count: g }) : null };
2019
2029
  })
2020
2030
  ), c = V(() => {
@@ -2028,7 +2038,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2028
2038
  v.includes(T.group) || v.push(T.group);
2029
2039
  const g = v.map((T) => ({
2030
2040
  id: T,
2031
- label: Me(T, i),
2041
+ label: De(T, i),
2032
2042
  options: c.value.filter((w) => w.type.group === T)
2033
2043
  })).filter((T) => T.options.length > 0);
2034
2044
  return c.value.length <= 5 || o.value.trim() !== "" || g.length < 2 ? [{ id: "", label: "", options: c.value }] : g;
@@ -2043,10 +2053,10 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2043
2053
  return i("field.pick-empty");
2044
2054
  });
2045
2055
  return (v, g) => {
2046
- const x = Ct("router-link");
2047
- return u(), D(l(Dt), {
2056
+ const x = Vt("router-link");
2057
+ return u(), M(l(Nt), {
2048
2058
  open: l(a),
2049
- "onUpdate:open": g[2] || (g[2] = (T) => Vt(a) ? a.value = T : null),
2059
+ "onUpdate:open": g[2] || (g[2] = (T) => Bt(a) ? a.value = T : null),
2050
2060
  title: l(i)("field.pick"),
2051
2061
  width: 860
2052
2062
  }, {
@@ -2062,23 +2072,23 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2062
2072
  })
2063
2073
  ]),
2064
2074
  default: b(() => [
2065
- B("div", Kn, [
2066
- m.value.length > 0 ? (u(), D(l(Pe), {
2075
+ B("div", Yn, [
2076
+ m.value.length > 0 ? (u(), M(l(Oe), {
2067
2077
  key: 0,
2068
2078
  modelValue: o.value,
2069
2079
  "onUpdate:modelValue": g[0] || (g[0] = (T) => o.value = T),
2070
2080
  placeholder: l(i)("field.search"),
2071
2081
  clearable: "",
2072
2082
  autofocus: ""
2073
- }, null, 8, ["modelValue", "placeholder"])) : I("", !0),
2074
- c.value.length === 0 ? (u(), D(l(It), {
2083
+ }, null, 8, ["modelValue", "placeholder"])) : N("", !0),
2084
+ c.value.length === 0 ? (u(), M(l(It), {
2075
2085
  key: 1,
2076
2086
  icon: "grid",
2077
2087
  title: p.value,
2078
2088
  size: "sm"
2079
2089
  }, {
2080
2090
  default: b(() => [
2081
- e.catalog.length === 0 && e.blocksPath ? (u(), D(x, {
2091
+ e.catalog.length === 0 && e.blocksPath ? (u(), M(x, {
2082
2092
  key: 0,
2083
2093
  to: e.blocksPath
2084
2094
  }, {
@@ -2086,16 +2096,16 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2086
2096
  z(S(l(i)("field.pick-none-link")), 1)
2087
2097
  ]),
2088
2098
  _: 1
2089
- }, 8, ["to"])) : I("", !0)
2099
+ }, 8, ["to"])) : N("", !0)
2090
2100
  ]),
2091
2101
  _: 1
2092
- }, 8, ["title"])) : I("", !0),
2102
+ }, 8, ["title"])) : N("", !0),
2093
2103
  (u(!0), C(F, null, le(d.value, (T) => (u(), C("section", {
2094
2104
  key: T.id,
2095
2105
  class: "wx-block-picker__group"
2096
2106
  }, [
2097
- T.label ? (u(), C("div", Yn, S(T.label), 1)) : I("", !0),
2098
- B("div", Jn, [
2107
+ T.label ? (u(), C("div", Jn, S(T.label), 1)) : N("", !0),
2108
+ B("div", Gn, [
2099
2109
  (u(!0), C(F, null, le(T.options, (w) => (u(), C("button", {
2100
2110
  key: w.type.id,
2101
2111
  type: "button",
@@ -2104,13 +2114,13 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2104
2114
  title: w.reason ?? void 0,
2105
2115
  onClick: (y) => l(t)(w.type)
2106
2116
  }, [
2107
- f(el, {
2117
+ f(tl, {
2108
2118
  thumbnail: w.type.thumbnail,
2109
2119
  height: 96
2110
2120
  }, null, 8, ["thumbnail"]),
2111
- B("div", Zn, [
2112
- B("div", Qn, S(w.type.title), 1),
2113
- w.reason ? (u(), D(l(q), {
2121
+ B("div", Qn, [
2122
+ B("div", Xn, S(w.type.title), 1),
2123
+ w.reason ? (u(), M(l(q), {
2114
2124
  key: 0,
2115
2125
  size: "sm",
2116
2126
  tone: "warning"
@@ -2119,7 +2129,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2119
2129
  z(S(w.reason), 1)
2120
2130
  ]),
2121
2131
  _: 2
2122
- }, 1024)) : w.type.description ? (u(), D(l(q), {
2132
+ }, 1024)) : w.type.description ? (u(), M(l(q), {
2123
2133
  key: 1,
2124
2134
  size: "sm",
2125
2135
  tone: "muted"
@@ -2128,9 +2138,9 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2128
2138
  z(S(w.type.description), 1)
2129
2139
  ]),
2130
2140
  _: 2
2131
- }, 1024)) : I("", !0)
2141
+ }, 1024)) : N("", !0)
2132
2142
  ])
2133
- ], 10, Gn))), 128))
2143
+ ], 10, Zn))), 128))
2134
2144
  ])
2135
2145
  ]))), 128))
2136
2146
  ])
@@ -2139,7 +2149,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2139
2149
  }, 8, ["open", "title"]);
2140
2150
  };
2141
2151
  }
2142
- }), es = /* @__PURE__ */ ie(Xn, [["__scopeId", "data-v-99f4090e"]]), ts = { class: "wx-blocks-preview__tools" }, ls = ["src", "title"], ns = /* @__PURE__ */ ae({
2152
+ }), ts = /* @__PURE__ */ ie(es, [["__scopeId", "data-v-99f4090e"]]), ls = { class: "wx-blocks-preview__tools" }, ns = ["src", "title"], ss = /* @__PURE__ */ ae({
2143
2153
  __name: "BlocksPreview",
2144
2154
  props: {
2145
2155
  url: {},
@@ -2149,7 +2159,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2149
2159
  },
2150
2160
  emits: ["select", "edit"],
2151
2161
  setup(e, { expose: n, emit: t }) {
2152
- const s = e, a = t, i = de("webx-blocks"), o = N(null), r = N(null), m = N(null), c = Qe(m), d = N(!1), p = N(!1), v = N(null), g = N(0), x = V(() => g.value > 0), T = V(() => [
2162
+ const s = e, a = t, i = de("webx-blocks"), o = I(null), r = I(null), m = I(null), c = Xe(m), d = I(!1), p = I(!1), v = I(null), g = I(0), x = V(() => g.value > 0), T = V(() => [
2153
2163
  { value: 1280, icon: "monitor", ariaLabel: i("field.width-desktop") },
2154
2164
  { value: 834, icon: "tablet", ariaLabel: i("field.width-tablet") },
2155
2165
  { value: 390, icon: "smartphone", ariaLabel: i("field.width-phone") }
@@ -2176,89 +2186,89 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2176
2186
  }
2177
2187
  }
2178
2188
  let X = null, h = null;
2179
- function A(L) {
2180
- L.documentElement.scrollTop !== 0 && (L.documentElement.scrollTop = 0);
2189
+ function A(W) {
2190
+ W.documentElement.scrollTop !== 0 && (W.documentElement.scrollTop = 0);
2181
2191
  }
2182
2192
  function P() {
2183
- const L = Y(), U = L?.body;
2184
- if (!U || !L?.defaultView) return;
2185
- A(L);
2186
- const j = L.defaultView.getComputedStyle(U), G = (parseFloat(j.marginTop) || 0) + (parseFloat(j.marginBottom) || 0), fe = Math.ceil(U.scrollHeight + G);
2187
- fe !== g.value && (g.value = fe, ne !== null && sl(() => requestAnimationFrame(Q)));
2193
+ const W = Y(), O = W?.body;
2194
+ if (!O || !W?.defaultView) return;
2195
+ A(W);
2196
+ const j = W.defaultView.getComputedStyle(O), G = (parseFloat(j.marginTop) || 0) + (parseFloat(j.marginBottom) || 0), fe = Math.ceil(O.scrollHeight + G);
2197
+ fe !== g.value && (g.value = fe, ne !== null && ol(() => requestAnimationFrame(Q)));
2188
2198
  }
2189
- function J(L) {
2199
+ function J(W) {
2190
2200
  h?.disconnect();
2191
- const U = L.defaultView;
2192
- !U || !L.body || (h = new U.ResizeObserver(P), h.observe(L.body), P());
2201
+ const O = W.defaultView;
2202
+ !O || !W.body || (h = new O.ResizeObserver(P), h.observe(W.body), P());
2193
2203
  }
2194
2204
  function Se() {
2195
2205
  p.value = !0;
2196
- const L = Y();
2197
- L && (J(L), X?.release(), X = Nl(L, {
2206
+ const W = Y();
2207
+ W && (J(W), X?.release(), X = Pl(W, {
2198
2208
  /* No guard against answering a click with a scroll: `bring` moves nothing that is already
2199
2209
  readable, and a block clicked at the very bottom of the window, half under the action
2200
2210
  bar, is exactly the one worth moving. */
2201
- select: (U) => a("select", U)
2202
- }), nt(L, s.selected ?? null), ke(s.selected ?? null));
2211
+ select: (O) => a("select", O)
2212
+ }), st(W, s.selected ?? null), ye(s.selected ?? null));
2203
2213
  }
2204
2214
  let ne = null, pe = null;
2205
- function ke(L) {
2206
- L !== null && (ne = L, pe !== null && clearTimeout(pe), pe = window.setTimeout(() => {
2215
+ function ye(W) {
2216
+ W !== null && (ne = W, pe !== null && clearTimeout(pe), pe = window.setTimeout(() => {
2207
2217
  ne = null, pe = null;
2208
2218
  }, 400), Q());
2209
2219
  }
2210
- function Ee(L) {
2211
- const U = o.value?.getBoundingClientRect();
2212
- if (!U) return null;
2213
- const j = L.getBoundingClientRect();
2214
- return { top: U.top + j.top * y.value, height: j.height * y.value };
2220
+ function Ee(W) {
2221
+ const O = o.value?.getBoundingClientRect();
2222
+ if (!O) return null;
2223
+ const j = W.getBoundingClientRect();
2224
+ return { top: O.top + j.top * y.value, height: j.height * y.value };
2215
2225
  }
2216
2226
  function Te() {
2217
- let L = o.value?.parentElement ?? null;
2218
- for (; L; ) {
2219
- const U = getComputedStyle(L).overflowY;
2220
- if ((U === "auto" || U === "scroll") && L.scrollHeight > L.clientHeight)
2221
- return L;
2222
- L = L.parentElement;
2227
+ let W = o.value?.parentElement ?? null;
2228
+ for (; W; ) {
2229
+ const O = getComputedStyle(W).overflowY;
2230
+ if ((O === "auto" || O === "scroll") && W.scrollHeight > W.clientHeight)
2231
+ return W;
2232
+ W = W.parentElement;
2223
2233
  }
2224
2234
  return null;
2225
2235
  }
2226
2236
  function Q() {
2227
- const L = Y();
2228
- if (ne === null || !L) return;
2229
- A(L);
2230
- const U = ut(L, ne), j = U ? Ee(U) : null;
2237
+ const W = Y();
2238
+ if (ne === null || !W) return;
2239
+ A(W);
2240
+ const O = ct(W, ne), j = O ? Ee(O) : null;
2231
2241
  if (!j) return;
2232
- const G = Te(), fe = G?.getBoundingClientRect(), _e = r.value?.getBoundingClientRect().height ?? 0, se = {
2233
- top: (fe?.top ?? 0) + _e,
2234
- bottom: (fe ? fe.bottom : window.innerHeight) - _e
2235
- }, ve = j.top + j.height, Ve = j.top < se.top, De = j.height > se.bottom - se.top, $ = Ve || De ? j.top - se.top : ve > se.bottom ? ve - se.bottom : 0;
2242
+ const G = Te(), fe = G?.getBoundingClientRect(), we = r.value?.getBoundingClientRect().height ?? 0, se = {
2243
+ top: (fe?.top ?? 0) + we,
2244
+ bottom: (fe ? fe.bottom : window.innerHeight) - we
2245
+ }, ve = j.top + j.height, Ve = j.top < se.top, Me = j.height > se.bottom - se.top, $ = Ve || Me ? j.top - se.top : ve > se.bottom ? ve - se.bottom : 0;
2236
2246
  $ !== 0 && (G ?? window).scrollBy({ top: $, behavior: "smooth" });
2237
2247
  }
2238
- function we(L, U) {
2248
+ function ke(W, O) {
2239
2249
  const j = Y();
2240
2250
  if (!j || !p.value) return !1;
2241
- const G = Ot(j, L, U);
2242
- return G && nt(j, s.selected ?? null), G;
2251
+ const G = Rt(j, W, O);
2252
+ return G && st(j, s.selected ?? null), G;
2243
2253
  }
2244
2254
  function Ce() {
2245
2255
  p.value = !1, h?.disconnect(), h = null, o.value && s.url && (o.value.src = s.url);
2246
2256
  }
2247
- function ye(L) {
2248
- L.key === "Escape" && d.value && (d.value = !1, L.stopPropagation());
2257
+ function ge(W) {
2258
+ W.key === "Escape" && d.value && (d.value = !1, W.stopPropagation());
2249
2259
  }
2250
2260
  return te(
2251
2261
  () => s.selected,
2252
- (L) => {
2253
- const U = Y();
2254
- !U || !p.value || (nt(U, L ?? null), ke(L ?? null));
2262
+ (W) => {
2263
+ const O = Y();
2264
+ !O || !p.value || (st(O, W ?? null), ye(W ?? null));
2255
2265
  }
2256
2266
  ), te(() => s.reload, Ce), te(
2257
2267
  () => s.url,
2258
2268
  () => p.value = !1
2259
- ), Ue(() => window.addEventListener("keydown", ye)), Ze(() => {
2260
- window.removeEventListener("keydown", ye), pe !== null && clearTimeout(pe), h?.disconnect(), X?.release();
2261
- }), n({ replace: we, refresh: Ce, open: () => d.value = !0 }), (L, U) => (u(), C("div", {
2269
+ ), Ue(() => window.addEventListener("keydown", ge)), Qe(() => {
2270
+ window.removeEventListener("keydown", ge), pe !== null && clearTimeout(pe), h?.disconnect(), X?.release();
2271
+ }), n({ replace: ke, refresh: Ce, open: () => d.value = !0 }), (W, O) => (u(), C("div", {
2262
2272
  class: $e(["wx-blocks-preview", { "is-fullscreen": d.value, "is-grown": x.value, "is-compact": e.compact }]),
2263
2273
  style: xe({ "--wx-preview-scale": y.value })
2264
2274
  }, [
@@ -2284,18 +2294,18 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2284
2294
  options: T.value,
2285
2295
  size: "sm",
2286
2296
  "aria-label": l(i)("field.width"),
2287
- "onUpdate:modelValue": U[0] || (U[0] = (j) => v.value = Number(j))
2297
+ "onUpdate:modelValue": O[0] || (O[0] = (j) => v.value = Number(j))
2288
2298
  }, null, 8, ["model-value", "options", "aria-label"]),
2289
- B("div", ts, [
2290
- e.compact ? (u(), D(l(Ie), {
2299
+ B("div", ls, [
2300
+ e.compact ? (u(), M(l(Ne), {
2291
2301
  key: 0,
2292
2302
  size: "sm",
2293
2303
  tone: "primary",
2294
2304
  icon: "edit",
2295
2305
  title: l(i)("field.blocks"),
2296
- onClick: U[1] || (U[1] = (j) => a("edit"))
2297
- }, null, 8, ["title"])) : I("", !0),
2298
- e.url ? (u(), D(l(Ie), {
2306
+ onClick: O[1] || (O[1] = (j) => a("edit"))
2307
+ }, null, 8, ["title"])) : N("", !0),
2308
+ e.url ? (u(), M(l(Ne), {
2299
2309
  key: 1,
2300
2310
  size: "sm",
2301
2311
  icon: "external-link",
@@ -2304,13 +2314,13 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2304
2314
  href: e.url,
2305
2315
  target: "_blank",
2306
2316
  rel: "noopener"
2307
- }, null, 8, ["title", "href"])) : I("", !0),
2308
- f(l(Ie), {
2317
+ }, null, 8, ["title", "href"])) : N("", !0),
2318
+ f(l(Ne), {
2309
2319
  size: "sm",
2310
2320
  icon: d.value ? "minimize" : "maximize",
2311
2321
  tone: "neutral",
2312
2322
  title: d.value ? l(i)("field.close") : l(i)("field.fullscreen"),
2313
- onClick: U[2] || (U[2] = (j) => d.value = !d.value)
2323
+ onClick: O[2] || (O[2] = (j) => d.value = !d.value)
2314
2324
  }, null, 8, ["icon", "title"])
2315
2325
  ])
2316
2326
  ], 512),
@@ -2332,15 +2342,15 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2332
2342
  style: xe(_.value),
2333
2343
  title: l(i)("field.preview"),
2334
2344
  onLoad: Se
2335
- }, null, 44, ls)) : I("", !0)
2345
+ }, null, 44, ns)) : N("", !0)
2336
2346
  ], 4)
2337
2347
  ], 512)
2338
2348
  ], 6));
2339
2349
  }
2340
- }), ss = /* @__PURE__ */ ie(ns, [["__scopeId", "data-v-398e4cef"]]), os = { class: "wx-blocks-tree__node" }, as = ["onClick", "onKeydown"], is = { class: "wx-blocks-tree__name" }, rs = ["title"], us = ["title"], cs = ["title"], ds = ["title"], ps = {
2350
+ }), os = /* @__PURE__ */ ie(ss, [["__scopeId", "data-v-398e4cef"]]), as = { class: "wx-blocks-tree__node" }, is = ["onClick", "onKeydown"], rs = { class: "wx-blocks-tree__name" }, us = ["title"], cs = ["title"], ds = ["title"], ps = ["title"], fs = {
2341
2351
  key: 4,
2342
2352
  class: "wx-blocks-tree__actions"
2343
- }, fs = ["onClick"], vs = /* @__PURE__ */ ae({
2353
+ }, vs = ["onClick"], ms = /* @__PURE__ */ ae({
2344
2354
  __name: "BlocksTree",
2345
2355
  props: {
2346
2356
  nodes: {},
@@ -2362,7 +2372,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2362
2372
  }
2363
2373
  function r(d) {
2364
2374
  const p = i(d);
2365
- return p?.content ? Ht(p.content.schema) : [];
2375
+ return p?.content ? qt(p.content.schema) : [];
2366
2376
  }
2367
2377
  function m(d, p) {
2368
2378
  const v = d.values[p.id];
@@ -2392,8 +2402,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2392
2402
  ];
2393
2403
  }
2394
2404
  return (d, p) => {
2395
- const v = Ct("blocks-tree", !0);
2396
- return u(), D(l($l), {
2405
+ const v = Vt("blocks-tree", !0);
2406
+ return u(), M(l(Sl), {
2397
2407
  "model-value": e.nodes,
2398
2408
  "item-key": "key",
2399
2409
  "item-label": (g) => o(g),
@@ -2405,51 +2415,51 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2405
2415
  "onUpdate:modelValue": p[6] || (p[6] = (g) => s("reorder", e.parentKey, e.field, g))
2406
2416
  }, {
2407
2417
  default: b(({ item: g }) => [
2408
- B("div", os, [
2418
+ B("div", as, [
2409
2419
  B("div", {
2410
2420
  class: $e(["wx-blocks-tree__row", { "is-selected": e.selected === g.key, "is-hidden": g.hidden === !0 }]),
2411
2421
  role: "button",
2412
2422
  tabindex: "0",
2413
2423
  onClick: (x) => s("select", g.key),
2414
2424
  onKeydown: [
2415
- ft(vt((x) => s("select", g.key), ["prevent"]), ["enter"]),
2416
- ft(vt((x) => s("select", g.key), ["prevent"]), ["space"])
2425
+ vt(mt((x) => s("select", g.key), ["prevent"]), ["enter"]),
2426
+ vt(mt((x) => s("select", g.key), ["prevent"]), ["space"])
2417
2427
  ]
2418
2428
  }, [
2419
- B("span", is, S(o(g)), 1),
2429
+ B("span", rs, S(o(g)), 1),
2420
2430
  i(g) ? i(g)?.draft ? (u(), C("span", {
2421
2431
  key: 1,
2422
2432
  class: "wx-blocks-tree__flag is-warning",
2423
2433
  title: l(a)("field.draft-type")
2424
2434
  }, [
2425
- f(l(be), { name: "warning" })
2426
- ], 8, us)) : i(g)?.is_enabled === !1 ? (u(), C("span", {
2435
+ f(l(he), { name: "warning" })
2436
+ ], 8, cs)) : i(g)?.is_enabled === !1 ? (u(), C("span", {
2427
2437
  key: 2,
2428
2438
  class: "wx-blocks-tree__flag",
2429
2439
  title: l(a)("field.disabled-type")
2430
2440
  }, [
2431
- f(l(be), { name: "lock" })
2432
- ], 8, cs)) : I("", !0) : (u(), C("span", {
2441
+ f(l(he), { name: "lock" })
2442
+ ], 8, ds)) : N("", !0) : (u(), C("span", {
2433
2443
  key: 0,
2434
2444
  class: "wx-blocks-tree__flag is-danger",
2435
2445
  title: l(a)("field.unknown-type", { type: g.type })
2436
2446
  }, [
2437
- f(l(be), { name: "close-circle" })
2438
- ], 8, rs)),
2447
+ f(l(he), { name: "close-circle" })
2448
+ ], 8, us)),
2439
2449
  g.hidden === !0 ? (u(), C("span", {
2440
2450
  key: 3,
2441
2451
  class: "wx-blocks-tree__flag",
2442
2452
  title: l(a)("field.hidden-note")
2443
2453
  }, [
2444
- f(l(be), { name: "eye-off" })
2445
- ], 8, ds)) : I("", !0),
2446
- e.disabled ? I("", !0) : (u(), C("span", ps, [
2447
- f(l(ml), {
2454
+ f(l(he), { name: "eye-off" })
2455
+ ], 8, ps)) : N("", !0),
2456
+ e.disabled ? N("", !0) : (u(), C("span", fs, [
2457
+ f(l(hl), {
2448
2458
  actions: c(g),
2449
2459
  label: o(g)
2450
2460
  }, null, 8, ["actions", "label"])
2451
2461
  ]))
2452
- ], 42, as),
2462
+ ], 42, is),
2453
2463
  (u(!0), C(F, null, le(r(g), (x) => (u(), C("div", {
2454
2464
  key: x.id,
2455
2465
  class: "wx-blocks-tree__kids"
@@ -2469,7 +2479,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2469
2479
  onVisibility: p[4] || (p[4] = (T, w) => s("visibility", T, w)),
2470
2480
  onReorder: p[5] || (p[5] = (T, w, y) => s("reorder", T, w, y))
2471
2481
  }, null, 8, ["nodes", "catalog", "parent-key", "field", "selected", "disabled", "depth"]),
2472
- e.disabled ? I("", !0) : (u(), C("button", {
2482
+ e.disabled ? N("", !0) : (u(), C("button", {
2473
2483
  key: 0,
2474
2484
  type: "button",
2475
2485
  class: "wx-blocks-tree__add is-inner",
@@ -2478,8 +2488,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2478
2488
  z(" + " + S(l(a)("field.add-inside")), 1),
2479
2489
  r(g).length > 1 ? (u(), C(F, { key: 0 }, [
2480
2490
  z(" · " + S(x.label ?? x.id), 1)
2481
- ], 64)) : I("", !0)
2482
- ], 8, fs))
2491
+ ], 64)) : N("", !0)
2492
+ ], 8, vs))
2483
2493
  ]))), 128))
2484
2494
  ])
2485
2495
  ]),
@@ -2487,33 +2497,33 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2487
2497
  }, 8, ["model-value", "item-label", "disabled", "empty-text", "class"]);
2488
2498
  };
2489
2499
  }
2490
- }), ms = /* @__PURE__ */ ie(vs, [["__scopeId", "data-v-590fa1d6"]]), pt = /* @__PURE__ */ Symbol("wx-blocks-preview");
2491
- function lo(e) {
2492
- Bt(pt, e);
2500
+ }), hs = /* @__PURE__ */ ie(ms, [["__scopeId", "data-v-590fa1d6"]]), ft = /* @__PURE__ */ Symbol("wx-blocks-preview");
2501
+ function no(e) {
2502
+ At(ft, e);
2493
2503
  }
2494
- function no() {
2495
- return Ke(pt, null);
2504
+ function so() {
2505
+ return Ye(ft, null);
2496
2506
  }
2497
- const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2507
+ const Ct = /* @__PURE__ */ Symbol("wx-blocks-root"), bs = {
2498
2508
  key: 0,
2499
2509
  class: "wx-blocks-nested"
2500
- }, bs = {
2510
+ }, gs = {
2501
2511
  key: 0,
2502
2512
  class: "wx-blocks__tree"
2503
- }, gs = { class: "wx-blocks__panel-head" }, ys = { class: "wx-blocks__panel-title" }, ks = { class: "wx-blocks__tools" }, ws = {
2513
+ }, ys = { class: "wx-blocks__panel-head" }, ks = { class: "wx-blocks__panel-title" }, ws = { class: "wx-blocks__tools" }, _s = {
2504
2514
  key: 1,
2505
2515
  class: "wx-blocks__fields"
2506
- }, _s = { class: "wx-blocks__panel-head" }, xs = { class: "wx-blocks__panel-title" }, $s = {
2516
+ }, xs = { class: "wx-blocks__panel-head" }, $s = { class: "wx-blocks__panel-title" }, Ss = {
2507
2517
  key: 0,
2508
2518
  class: "wx-blocks__trail"
2509
- }, Ss = ["onClick"], Es = { class: "wx-blocks__panel-name" }, Ts = { class: "wx-blocks__panel-extra" }, Cs = { key: 0 }, Vs = { class: "wx-blocks__form" }, Bs = {
2519
+ }, Es = ["onClick"], Ts = { class: "wx-blocks__panel-name" }, Cs = { class: "wx-blocks__panel-extra" }, Vs = { key: 0 }, Bs = { class: "wx-blocks__form" }, As = {
2510
2520
  key: 0,
2511
2521
  class: "wx-blocks__preview"
2512
- }, As = /* @__PURE__ */ ae({
2522
+ }, Ls = /* @__PURE__ */ ae({
2513
2523
  name: "WxBlocks",
2514
2524
  inheritAttrs: !1,
2515
2525
  __name: "BlocksField",
2516
- props: /* @__PURE__ */ ul({
2526
+ props: /* @__PURE__ */ cl({
2517
2527
  node: { default: void 0 },
2518
2528
  context: { default: void 0 },
2519
2529
  name: { default: void 0 },
@@ -2529,19 +2539,19 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2529
2539
  }),
2530
2540
  emits: ["update:modelValue"],
2531
2541
  setup(e) {
2532
- const n = e, t = ol(e, "modelValue"), s = Ke(Tt, !1);
2533
- Bt(Tt, !0), Fe();
2534
- const a = de("webx-blocks"), i = Re(), o = Ke(hl, null);
2542
+ const n = e, t = al(e, "modelValue"), s = Ye(Ct, !1);
2543
+ At(Ct, !0), He();
2544
+ const a = de("webx-blocks"), i = je(), o = Ye(bl, null);
2535
2545
  let r = null;
2536
- const m = N([]), c = V(() => n.catalog ?? m.value), d = V(() => Array.isArray(t.value) ? t.value : []), p = N(null), v = V(() => p.value ? re(d.value, p.value) : null), g = V(
2546
+ const m = I([]), c = V(() => n.catalog ?? m.value), d = V(() => Array.isArray(t.value) ? t.value : []), p = I(null), v = V(() => p.value ? re(d.value, p.value) : null), g = V(
2537
2547
  () => v.value ? c.value.find(($) => $.slug === v.value?.node.type) ?? null : null
2538
2548
  );
2539
2549
  function x($) {
2540
- return c.value.find((M) => M.slug === $.type)?.title ?? $.type;
2550
+ return c.value.find((D) => D.slug === $.type)?.title ?? $.type;
2541
2551
  }
2542
2552
  const T = V(() => {
2543
2553
  const $ = [];
2544
- return je(d.value, (M) => $.push(M.key)), $;
2554
+ return Fe(d.value, (D) => $.push(D.key)), $;
2545
2555
  }), w = V(() => {
2546
2556
  const $ = p.value ? T.value.indexOf(p.value) : -1;
2547
2557
  return {
@@ -2550,14 +2560,14 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2550
2560
  };
2551
2561
  }), y = V(() => {
2552
2562
  const $ = [];
2553
- let M = v.value?.parent ?? null;
2554
- for (; M; )
2555
- $.unshift({ key: M.key, title: x(M) }), M = re(d.value, M.key)?.parent ?? null;
2563
+ let D = v.value?.parent ?? null;
2564
+ for (; D; )
2565
+ $.unshift({ key: D.key, title: x(D) }), D = re(d.value, D.key)?.parent ?? null;
2556
2566
  return $;
2557
- }), _ = Ke(pt, null), R = N(null), K = N(null), Y = Qe(K), X = V(() => _ !== null && _.url.value !== null), h = V(() => X.value && Y.value > 0 && Y.value <= 900), A = N(!1), P = V(() => {
2567
+ }), _ = Ye(ft, null), R = I(null), K = I(null), Y = Xe(K), X = V(() => _ !== null && _.url.value !== null), h = V(() => X.value && Y.value > 0 && Y.value <= 900), A = I(!1), P = V(() => {
2558
2568
  if (!v.value) return;
2559
2569
  const $ = g.value?.title ?? v.value.node.type;
2560
- return [...y.value.map((M) => M.title), $].join(" / ");
2570
+ return [...y.value.map((D) => D.title), $].join(" / ");
2561
2571
  }), J = V(
2562
2572
  () => h.value ? {
2563
2573
  /* Up from the bottom, and not all the way: the strip of page left above it is what
@@ -2582,58 +2592,58 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2582
2592
  } : {}
2583
2593
  ), Se = V(
2584
2594
  () => o?.state.manifest?.modules.find(($) => $.id === "blocks")?.meta?.groups ?? []
2585
- ), ne = al()?.type, pe = V(() => n.context?.types ? n.context.types : o?.types ? { ...Ye, ...o.types } : ne ? { ...Ye, "wx-blocks": { component: ne, kind: "field", nested: !0 } } : Ye), ke = V(
2595
+ ), ne = il()?.type, pe = V(() => n.context?.types ? n.context.types : o?.types ? { ...Je, ...o.types } : ne ? { ...Je, "wx-blocks": { component: ne, kind: "field", nested: !0 } } : Je), ye = V(
2586
2596
  () => n.context?.translate ?? o?.i18n.t ?? (($) => $)
2587
- ), Ee = V(() => n.context?.can ?? o?.can ?? (() => !0)), Te = Nt(es);
2597
+ ), Ee = V(() => n.context?.can ?? o?.can ?? (() => !0)), Te = Pt(ts);
2588
2598
  function Q($) {
2589
2599
  t.value = $;
2590
2600
  }
2591
- async function we($, M, O) {
2592
- const H = $ ? re(d.value, $) : null, ee = H ? c.value.find((tl) => tl.slug === H.node.type) ?? null : null, et = $ === null ? n.allow : O?.props?.allow ?? null, W = $ === null ? n.max : O?.props?.max ?? null, k = $ === null ? d.value : H && M ? H.node.values[M] ?? [] : [];
2593
- if (W != null && k.length >= W) return;
2601
+ async function ke($, D, U) {
2602
+ const H = $ ? re(d.value, $) : null, ee = H ? c.value.find((ll) => ll.slug === H.node.type) ?? null : null, tt = $ === null ? n.allow : U?.props?.allow ?? null, L = $ === null ? n.max : U?.props?.max ?? null, k = $ === null ? d.value : H && D ? H.node.values[D] ?? [] : [];
2603
+ if (L != null && k.length >= L) return;
2594
2604
  const E = await Te({
2595
2605
  catalog: c.value,
2596
2606
  parent: ee,
2597
- allow: et,
2607
+ allow: tt,
2598
2608
  tree: d.value,
2599
2609
  groups: Se.value,
2600
2610
  blocksPath: n.blocksPath
2601
2611
  });
2602
2612
  if (!E) return;
2603
- const tt = Kl(E.slug, Ce(E));
2604
- Q(xt(d.value, $, M, k.length, tt)), p.value = tt.key;
2613
+ const lt = Yl(E.slug, Ce(E));
2614
+ Q($t(d.value, $, D, k.length, lt)), p.value = lt.key;
2605
2615
  }
2606
2616
  function Ce($) {
2607
- const M = $.content?.sample ?? {}, O = {};
2608
- for (const [H, ee] of Object.entries(M))
2609
- (!Array.isArray(ee) || ee.length === 0 || typeof ee[0] != "object") && (O[H] = ee);
2610
- return O;
2611
- }
2612
- async function ye($) {
2613
- const M = re(d.value, $);
2614
- if (!M) return;
2615
- const O = Jl(M.node);
2616
- await Ge({
2617
+ const D = $.content?.sample ?? {}, U = {};
2618
+ for (const [H, ee] of Object.entries(D))
2619
+ (!Array.isArray(ee) || ee.length === 0 || typeof ee[0] != "object") && (U[H] = ee);
2620
+ return U;
2621
+ }
2622
+ async function ge($) {
2623
+ const D = re(d.value, $);
2624
+ if (!D) return;
2625
+ const U = Gl(D.node);
2626
+ await Ze({
2617
2627
  title: a("field.remove-title", {
2618
- title: c.value.find((ee) => ee.slug === M.node.type)?.title ?? M.node.type
2628
+ title: c.value.find((ee) => ee.slug === D.node.type)?.title ?? D.node.type
2619
2629
  }),
2620
- message: O > 0 ? a("field.remove-text", { count: O }) : a("field.remove-alone"),
2630
+ message: U > 0 ? a("field.remove-text", { count: U }) : a("field.remove-alone"),
2621
2631
  confirmText: a("field.remove"),
2622
2632
  cancelText: a("page.cancel"),
2623
2633
  tone: "danger"
2624
- }) && (p.value === $ && (p.value = null), Q(Ql(d.value, $)));
2634
+ }) && (p.value === $ && (p.value = null), Q(Xl(d.value, $)));
2625
2635
  }
2626
- function L($) {
2627
- const M = re(d.value, $);
2628
- if (!M) return;
2629
- const O = qt(M.node);
2630
- Q(xt(d.value, M.parent?.key ?? null, M.field, M.index + 1, O)), p.value = O.key;
2636
+ function W($) {
2637
+ const D = re(d.value, $);
2638
+ if (!D) return;
2639
+ const U = Kt(D.node);
2640
+ Q($t(d.value, D.parent?.key ?? null, D.field, D.index + 1, U)), p.value = U.key;
2631
2641
  }
2632
- function U($, M) {
2633
- Q(Gl(d.value, $, M));
2642
+ function O($, D) {
2643
+ Q(Zl(d.value, $, D));
2634
2644
  }
2635
- function j($, M, O) {
2636
- Q(en(d.value, $, M, O));
2645
+ function j($, D, U) {
2646
+ Q(tn(d.value, $, D, U));
2637
2647
  }
2638
2648
  function G($) {
2639
2649
  p.value = p.value === $ ? null : $;
@@ -2641,21 +2651,21 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2641
2651
  function fe($) {
2642
2652
  $ === null || !re(d.value, $) || (p.value = $, h.value && (A.value = !0));
2643
2653
  }
2644
- function _e() {
2654
+ function we() {
2645
2655
  p.value = null;
2646
2656
  }
2647
2657
  function se($) {
2648
- p.value && Q(Xl(d.value, p.value, $));
2658
+ p.value && Q(en(d.value, p.value, $));
2649
2659
  }
2650
2660
  let ve;
2651
2661
  te(
2652
2662
  () => v.value?.node.values,
2653
- ($, M) => {
2654
- if (!$ || !M || !g.value || !r || !_) return;
2655
- const O = p.value, H = g.value.id;
2663
+ ($, D) => {
2664
+ if (!$ || !D || !g.value || !r || !_) return;
2665
+ const U = p.value, H = g.value.id;
2656
2666
  clearTimeout(ve), ve = setTimeout(() => {
2657
- !O || !r || r.render(H, { values: $, key: O }).then((ee) => {
2658
- R.value?.replace(O, ee.html) || R.value?.refresh();
2667
+ !U || !r || r.render(H, { values: $, key: U }).then((ee) => {
2668
+ R.value?.replace(U, ee.html) || R.value?.refresh();
2659
2669
  }).catch(() => {
2660
2670
  });
2661
2671
  }, 300);
@@ -2663,7 +2673,7 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2663
2673
  { deep: !0 }
2664
2674
  );
2665
2675
  function Ve($) {
2666
- $.key === "Escape" && p.value && _e();
2676
+ $.key === "Escape" && p.value && we();
2667
2677
  }
2668
2678
  Ue(async () => {
2669
2679
  if (window.addEventListener("keydown", Ve), n.catalog === null && o) {
@@ -2674,13 +2684,13 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2674
2684
  Z.danger(i($));
2675
2685
  }
2676
2686
  } else o && (r = ze(o));
2677
- }), Ze(() => {
2687
+ }), Qe(() => {
2678
2688
  clearTimeout(ve), window.removeEventListener("keydown", Ve);
2679
2689
  });
2680
- const De = V(
2681
- () => g.value?.content ? dt(g.value.content.schema) : []
2690
+ const Me = V(
2691
+ () => g.value?.content ? pt(g.value.content.schema) : []
2682
2692
  );
2683
- return ($, M) => l(s) ? (u(), C("div", hs, [
2693
+ return ($, D) => l(s) ? (u(), C("div", bs, [
2684
2694
  f(l(q), {
2685
2695
  size: "sm",
2686
2696
  tone: "muted"
@@ -2702,11 +2712,11 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2702
2712
  "has-preview": l(_) !== null && l(_).url.value !== null
2703
2713
  }])
2704
2714
  }, [
2705
- (u(), D(il(h.value ? l(Sl) : "div"), rl(J.value, { class: "wx-blocks__side" }), {
2715
+ (u(), M(rl(h.value ? l(El) : "div"), ul(J.value, { class: "wx-blocks__side" }), {
2706
2716
  default: b(() => [
2707
- v.value ? I("", !0) : (u(), C("div", bs, [
2708
- B("div", gs, [
2709
- B("span", ys, S(l(a)("field.blocks")), 1),
2717
+ v.value ? N("", !0) : (u(), C("div", gs, [
2718
+ B("div", ys, [
2719
+ B("span", ks, S(l(a)("field.blocks")), 1),
2710
2720
  f(l(q), {
2711
2721
  size: "sm",
2712
2722
  tone: "muted"
@@ -2717,93 +2727,93 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2717
2727
  _: 1
2718
2728
  })
2719
2729
  ]),
2720
- f(ms, {
2730
+ f(hs, {
2721
2731
  nodes: d.value,
2722
2732
  catalog: c.value,
2723
2733
  selected: p.value,
2724
2734
  disabled: e.disabled,
2725
2735
  onSelect: G,
2726
- onAdd: we,
2727
- onRemove: ye,
2728
- onDuplicate: L,
2729
- onVisibility: U,
2736
+ onAdd: ke,
2737
+ onRemove: ge,
2738
+ onDuplicate: W,
2739
+ onVisibility: O,
2730
2740
  onReorder: j
2731
2741
  }, null, 8, ["nodes", "catalog", "selected", "disabled"]),
2732
- B("div", ks, [
2733
- !e.disabled && (e.max === null || d.value.length < e.max) ? (u(), D(l(ce), {
2742
+ B("div", ws, [
2743
+ !e.disabled && (e.max === null || d.value.length < e.max) ? (u(), M(l(ce), {
2734
2744
  key: 0,
2735
2745
  variant: "outline",
2736
2746
  icon: "plus",
2737
2747
  class: "wx-blocks__add",
2738
- onClick: M[0] || (M[0] = (O) => we(null, null, null))
2748
+ onClick: D[0] || (D[0] = (U) => ke(null, null, null))
2739
2749
  }, {
2740
2750
  default: b(() => [
2741
2751
  z(S(l(a)("field.add")), 1)
2742
2752
  ]),
2743
2753
  _: 1
2744
- })) : I("", !0),
2745
- !h.value && l(_) && l(_).url.value ? (u(), D(l(ce), {
2754
+ })) : N("", !0),
2755
+ !h.value && l(_) && l(_).url.value ? (u(), M(l(ce), {
2746
2756
  key: 1,
2747
2757
  variant: "outline",
2748
2758
  icon: "eye",
2749
2759
  class: "wx-blocks__preview-button",
2750
- onClick: M[1] || (M[1] = (O) => R.value?.open())
2760
+ onClick: D[1] || (D[1] = (U) => R.value?.open())
2751
2761
  }, {
2752
2762
  default: b(() => [
2753
2763
  z(S(l(a)("field.preview")), 1)
2754
2764
  ]),
2755
2765
  _: 1
2756
- })) : I("", !0)
2766
+ })) : N("", !0)
2757
2767
  ])
2758
2768
  ])),
2759
- v.value ? (u(), C("div", ws, [
2760
- B("div", _s, [
2761
- B("span", xs, [
2762
- y.value.length ? (u(), C("span", $s, [
2763
- (u(!0), C(F, null, le(y.value, (O) => (u(), C(F, {
2764
- key: O.key
2769
+ v.value ? (u(), C("div", _s, [
2770
+ B("div", xs, [
2771
+ B("span", $s, [
2772
+ y.value.length ? (u(), C("span", Ss, [
2773
+ (u(!0), C(F, null, le(y.value, (U) => (u(), C(F, {
2774
+ key: U.key
2765
2775
  }, [
2766
2776
  B("button", {
2767
2777
  type: "button",
2768
2778
  class: "wx-blocks__trail-step",
2769
- onClick: (H) => G(O.key)
2770
- }, S(O.title), 9, Ss),
2771
- f(l(be), { name: "chevron-right" })
2779
+ onClick: (H) => G(U.key)
2780
+ }, S(U.title), 9, Es),
2781
+ f(l(he), { name: "chevron-right" })
2772
2782
  ], 64))), 128))
2773
- ])) : I("", !0),
2774
- B("span", Es, S(g.value?.title ?? v.value.node.type), 1)
2783
+ ])) : N("", !0),
2784
+ B("span", Ts, S(g.value?.title ?? v.value.node.type), 1)
2775
2785
  ]),
2776
- B("span", Ts, [
2777
- h.value ? I("", !0) : (u(), C("code", Cs, S(v.value.node.type), 1)),
2778
- f(l(Ie), {
2786
+ B("span", Cs, [
2787
+ h.value ? N("", !0) : (u(), C("code", Vs, S(v.value.node.type), 1)),
2788
+ f(l(Ne), {
2779
2789
  size: "sm",
2780
2790
  tone: "neutral",
2781
2791
  icon: "chevron-up",
2782
2792
  title: l(a)("field.previous"),
2783
2793
  disabled: w.value.previous === null,
2784
- onClick: M[2] || (M[2] = (O) => w.value.previous && G(w.value.previous))
2794
+ onClick: D[2] || (D[2] = (U) => w.value.previous && G(w.value.previous))
2785
2795
  }, null, 8, ["title", "disabled"]),
2786
- f(l(Ie), {
2796
+ f(l(Ne), {
2787
2797
  size: "sm",
2788
2798
  tone: "neutral",
2789
2799
  icon: "chevron-down",
2790
2800
  title: l(a)("field.next"),
2791
2801
  disabled: w.value.next === null,
2792
- onClick: M[3] || (M[3] = (O) => w.value.next && G(w.value.next))
2802
+ onClick: D[3] || (D[3] = (U) => w.value.next && G(w.value.next))
2793
2803
  }, null, 8, ["title", "disabled"]),
2794
- !h.value && l(_) && l(_).url.value ? (u(), D(l(ce), {
2804
+ !h.value && l(_) && l(_).url.value ? (u(), M(l(ce), {
2795
2805
  key: 1,
2796
2806
  size: "sm",
2797
2807
  variant: "outline",
2798
2808
  icon: "eye",
2799
2809
  class: "wx-blocks__preview-button",
2800
2810
  "aria-label": l(a)("field.preview"),
2801
- onClick: M[4] || (M[4] = (O) => R.value?.open())
2802
- }, null, 8, ["aria-label"])) : I("", !0),
2811
+ onClick: D[4] || (D[4] = (U) => R.value?.open())
2812
+ }, null, 8, ["aria-label"])) : N("", !0),
2803
2813
  f(l(ce), {
2804
2814
  size: "sm",
2805
2815
  variant: "outline",
2806
- onClick: _e
2816
+ onClick: we
2807
2817
  }, {
2808
2818
  default: b(() => [
2809
2819
  z(S(h.value ? l(a)("field.done") : `${l(a)("field.done")} · Esc`), 1)
@@ -2812,17 +2822,17 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2812
2822
  })
2813
2823
  ])
2814
2824
  ]),
2815
- B("div", Vs, [
2816
- g.value?.content ? (u(), D(l(Pt), {
2825
+ B("div", Bs, [
2826
+ g.value?.content ? (u(), M(l(Ot), {
2817
2827
  key: v.value.node.key,
2818
2828
  "model-value": v.value.node.values,
2819
- root: De.value,
2829
+ root: Me.value,
2820
2830
  types: pe.value,
2821
- translate: ke.value,
2831
+ translate: ye.value,
2822
2832
  can: Ee.value,
2823
2833
  disabled: e.disabled,
2824
2834
  "onUpdate:modelValue": se
2825
- }, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (u(), D(l(q), {
2835
+ }, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (u(), M(l(q), {
2826
2836
  key: 1,
2827
2837
  size: "sm",
2828
2838
  tone: "danger"
@@ -2833,12 +2843,12 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2833
2843
  _: 1
2834
2844
  }))
2835
2845
  ])
2836
- ])) : I("", !0)
2846
+ ])) : N("", !0)
2837
2847
  ]),
2838
2848
  _: 1
2839
2849
  }, 16)),
2840
- l(_) && l(_).url.value ? (u(), C("div", Bs, [
2841
- f(ss, {
2850
+ l(_) && l(_).url.value ? (u(), C("div", As, [
2851
+ f(os, {
2842
2852
  ref_key: "previewEl",
2843
2853
  ref: R,
2844
2854
  url: l(_).url.value,
@@ -2846,13 +2856,13 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2846
2856
  reload: l(_).reload?.value ?? 0,
2847
2857
  compact: h.value,
2848
2858
  onSelect: fe,
2849
- onEdit: M[5] || (M[5] = (O) => A.value = !0)
2859
+ onEdit: D[5] || (D[5] = (U) => A.value = !0)
2850
2860
  }, null, 8, ["url", "selected", "reload", "compact"])
2851
- ])) : I("", !0)
2861
+ ])) : N("", !0)
2852
2862
  ], 2)
2853
2863
  ], 2));
2854
2864
  }
2855
- }), Ws = /* @__PURE__ */ ie(As, [["__scopeId", "data-v-613ad857"]]), Ls = { class: "wx-block-card__body" }, zs = { class: "wx-block-card__title" }, Ms = { class: "wx-block-card__chips" }, Ds = /* @__PURE__ */ ae({
2865
+ }), Ws = /* @__PURE__ */ ie(Ls, [["__scopeId", "data-v-613ad857"]]), zs = { class: "wx-block-card__body" }, Ds = { class: "wx-block-card__title" }, Ms = { class: "wx-block-card__chips" }, Ns = /* @__PURE__ */ ae({
2856
2866
  __name: "BlockCard",
2857
2867
  props: {
2858
2868
  block: {}
@@ -2865,24 +2875,24 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2865
2875
  class: "wx-block-card",
2866
2876
  onClick: i[0] || (i[0] = (o) => t("open", e.block))
2867
2877
  }, [
2868
- f(el, {
2878
+ f(tl, {
2869
2879
  thumbnail: e.block.thumbnail,
2870
2880
  height: 120
2871
2881
  }, null, 8, ["thumbnail"]),
2872
- B("div", Ls, [
2873
- B("div", zs, S(e.block.title), 1),
2882
+ B("div", zs, [
2883
+ B("div", Ds, S(e.block.title), 1),
2874
2884
  f(l(q), {
2875
2885
  size: "sm",
2876
2886
  tone: "muted"
2877
2887
  }, {
2878
2888
  default: b(() => [
2879
2889
  B("code", null, S(e.block.slug), 1),
2880
- z(" · " + S(l(it)(e.block.usage_count, l(s))), 1)
2890
+ z(" · " + S(l(rt)(e.block.usage_count, l(s))), 1)
2881
2891
  ]),
2882
2892
  _: 1
2883
2893
  }),
2884
2894
  B("div", Ms, [
2885
- e.block.draft ? (u(), D(l(ue), {
2895
+ e.block.draft ? (u(), M(l(ue), {
2886
2896
  key: 0,
2887
2897
  type: "warning",
2888
2898
  dot: ""
@@ -2891,8 +2901,8 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2891
2901
  z(S(l(s)("page.draft", { number: e.block.draft.number })), 1)
2892
2902
  ]),
2893
2903
  _: 1
2894
- })) : I("", !0),
2895
- e.block.published ? (u(), D(l(ue), {
2904
+ })) : N("", !0),
2905
+ e.block.published ? (u(), M(l(ue), {
2896
2906
  key: 1,
2897
2907
  type: "success",
2898
2908
  dot: ""
@@ -2901,7 +2911,7 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2901
2911
  z(S(l(s)("page.live", { number: e.block.published.number })), 1)
2902
2912
  ]),
2903
2913
  _: 1
2904
- })) : (u(), D(l(ue), {
2914
+ })) : (u(), M(l(ue), {
2905
2915
  key: 2,
2906
2916
  type: "default"
2907
2917
  }, {
@@ -2910,7 +2920,7 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2910
2920
  ]),
2911
2921
  _: 1
2912
2922
  })),
2913
- e.block.is_enabled ? I("", !0) : (u(), D(l(ue), {
2923
+ e.block.is_enabled ? N("", !0) : (u(), M(l(ue), {
2914
2924
  key: 3,
2915
2925
  type: "default",
2916
2926
  variant: "outline"
@@ -2924,13 +2934,13 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2924
2934
  ])
2925
2935
  ]));
2926
2936
  }
2927
- }), Is = /* @__PURE__ */ ie(Ds, [["__scopeId", "data-v-3d94f339"]]), Ns = { class: "wx-block-create" }, Ps = /* @__PURE__ */ ae({
2937
+ }), Is = /* @__PURE__ */ ie(Ns, [["__scopeId", "data-v-3d94f339"]]), Ps = { class: "wx-block-create" }, Os = /* @__PURE__ */ ae({
2928
2938
  __name: "BlockCreateDialog",
2929
2939
  setup(e) {
2930
- const { resolve: n, dismiss: t, open: s } = Mt(), a = Oe(), i = ze(a);
2931
- Fe();
2932
- const o = de("webx-blocks"), r = Re(), m = V(() => a.state.manifest?.modules.find((_) => _.id === "blocks")?.meta?.groups ?? ["content"]), c = N({ title: "", slug: "", group: m.value[0] ?? "content" }), d = N({}), p = N(!1), v = N(!1), g = V(
2933
- () => m.value.map((y) => ({ value: y, label: Me(y, o) }))
2940
+ const { resolve: n, dismiss: t, open: s } = Mt(), a = Re(), i = ze(a);
2941
+ He();
2942
+ const o = de("webx-blocks"), r = je(), m = V(() => a.state.manifest?.modules.find((_) => _.id === "blocks")?.meta?.groups ?? ["content"]), c = I({ title: "", slug: "", group: m.value[0] ?? "content" }), d = I({}), p = I(!1), v = I(!1), g = V(
2943
+ () => m.value.map((y) => ({ value: y, label: De(y, o) }))
2934
2944
  );
2935
2945
  function x(y) {
2936
2946
  return y.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "").slice(0, 64);
@@ -2955,14 +2965,14 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2955
2965
  p.value = !1;
2956
2966
  }
2957
2967
  }
2958
- return (y, _) => (u(), D(l(Dt), {
2968
+ return (y, _) => (u(), M(l(Nt), {
2959
2969
  open: l(s),
2960
- "onUpdate:open": _[5] || (_[5] = (R) => Vt(s) ? s.value = R : null),
2970
+ "onUpdate:open": _[5] || (_[5] = (R) => Bt(s) ? s.value = R : null),
2961
2971
  title: l(o)("page.new"),
2962
2972
  width: 520
2963
2973
  }, {
2964
2974
  footer: b(() => [
2965
- f(l(El), { size: "sm" }, {
2975
+ f(l(Tl), { size: "sm" }, {
2966
2976
  default: b(() => [
2967
2977
  f(l(ce), {
2968
2978
  variant: "outline",
@@ -2988,13 +2998,13 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
2988
2998
  })
2989
2999
  ]),
2990
3000
  default: b(() => [
2991
- B("div", Ns, [
3001
+ B("div", Ps, [
2992
3002
  f(l(oe), {
2993
3003
  label: l(o)("page.title"),
2994
3004
  error: T("title")
2995
3005
  }, {
2996
3006
  default: b(() => [
2997
- f(l(Pe), {
3007
+ f(l(Oe), {
2998
3008
  modelValue: c.value.title,
2999
3009
  "onUpdate:modelValue": _[0] || (_[0] = (R) => c.value.title = R),
3000
3010
  autofocus: ""
@@ -3008,7 +3018,7 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
3008
3018
  error: T("slug")
3009
3019
  }, {
3010
3020
  default: b(() => [
3011
- f(l(Pe), {
3021
+ f(l(Oe), {
3012
3022
  modelValue: c.value.slug,
3013
3023
  "onUpdate:modelValue": _[1] || (_[1] = (R) => c.value.slug = R),
3014
3024
  placeholder: "hero",
@@ -3023,7 +3033,7 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
3023
3033
  error: T("group")
3024
3034
  }, {
3025
3035
  default: b(() => [
3026
- f(l(zt), {
3036
+ f(l(Dt), {
3027
3037
  modelValue: c.value.group,
3028
3038
  "onUpdate:modelValue": _[3] || (_[3] = (R) => c.value.group = R),
3029
3039
  options: g.value
@@ -3036,21 +3046,21 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
3036
3046
  _: 1
3037
3047
  }, 8, ["open", "title"]));
3038
3048
  }
3039
- }), Us = /* @__PURE__ */ ie(Ps, [["__scopeId", "data-v-a4c0d44c"]]), Os = {
3049
+ }), Us = /* @__PURE__ */ ie(Os, [["__scopeId", "data-v-a4c0d44c"]]), Rs = {
3040
3050
  key: 1,
3041
3051
  class: "wx-blocks-page__toolbar"
3042
- }, Rs = { class: "wx-blocks-page__cards" }, js = { class: "wx-blocks-page__ghost-body" }, Fs = {
3052
+ }, js = { class: "wx-blocks-page__cards" }, Fs = { class: "wx-blocks-page__ghost-body" }, Hs = {
3043
3053
  key: 0,
3044
3054
  class: "wx-blocks-page__group-title"
3045
- }, Hs = { class: "wx-blocks-page__cards" }, qs = /* @__PURE__ */ ae({
3055
+ }, qs = { class: "wx-blocks-page__cards" }, Ks = /* @__PURE__ */ ae({
3046
3056
  __name: "BlocksPage",
3047
3057
  props: {
3048
3058
  base: { default: "/blocks" }
3049
3059
  },
3050
3060
  setup(e) {
3051
- const n = e, t = Oe(), s = ze(t), a = At();
3052
- Fe();
3053
- const i = de("webx-blocks"), o = Re(), r = N([]), m = N(!0), c = N(""), d = N(""), p = Nt(Us), v = V(() => {
3061
+ const n = e, t = Re(), s = ze(t), a = Lt();
3062
+ He();
3063
+ const i = de("webx-blocks"), o = je(), r = I([]), m = I(!0), c = I(""), d = I(""), p = Pt(Us), v = V(() => {
3054
3064
  const h = t.state.manifest?.modules.find((A) => A.id === "blocks")?.meta;
3055
3065
  return {
3056
3066
  groups: h?.groups ?? [],
@@ -3072,12 +3082,12 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
3072
3082
  }), y = V(
3073
3083
  () => w.value.length < 2 ? [] : [
3074
3084
  { value: "", label: i("page.all-groups") },
3075
- ...w.value.map((h) => ({ value: h, label: Me(h, i) }))
3085
+ ...w.value.map((h) => ({ value: h, label: De(h, i) }))
3076
3086
  ]
3077
3087
  ), _ = V(() => {
3078
3088
  const h = w.value.map((P) => ({
3079
3089
  id: P,
3080
- label: Me(P, i),
3090
+ label: De(P, i),
3081
3091
  blocks: T.value.filter((J) => J.group === P)
3082
3092
  })).filter((P) => P.blocks.length > 0);
3083
3093
  return d.value !== "" || T.value.length <= 5 || c.value.trim() !== "" || h.length < 2 ? [{ id: "", label: "", blocks: T.value }] : h;
@@ -3105,7 +3115,7 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
3105
3115
  Y();
3106
3116
  } }] : []
3107
3117
  );
3108
- return (h, A) => (u(), D(l(bl), {
3118
+ return (h, A) => (u(), M(l(gl), {
3109
3119
  view: d.value,
3110
3120
  "onUpdate:view": A[1] || (A[1] = (P) => d.value = P),
3111
3121
  class: "wx-blocks-page",
@@ -3114,43 +3124,43 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
3114
3124
  actions: X.value
3115
3125
  }, {
3116
3126
  default: b(() => [
3117
- v.value.editing ? I("", !0) : (u(), D(l(Lt), {
3127
+ v.value.editing ? N("", !0) : (u(), M(l(zt), {
3118
3128
  key: 0,
3119
3129
  type: "info",
3120
3130
  variant: "soft",
3121
3131
  description: l(i)("page.editing-off")
3122
3132
  }, null, 8, ["description"])),
3123
- m.value || r.value.length > 0 ? (u(), C("div", Os, [
3124
- f(l(Pe), {
3133
+ m.value || r.value.length > 0 ? (u(), C("div", Rs, [
3134
+ f(l(Oe), {
3125
3135
  modelValue: c.value,
3126
3136
  "onUpdate:modelValue": A[0] || (A[0] = (P) => c.value = P),
3127
3137
  class: "wx-blocks-page__search",
3128
3138
  placeholder: l(i)("page.search"),
3129
3139
  clearable: ""
3130
3140
  }, null, 8, ["modelValue", "placeholder"])
3131
- ])) : I("", !0),
3132
- m.value ? (u(), D(l(We), { key: 2 }, {
3141
+ ])) : N("", !0),
3142
+ m.value ? (u(), M(l(Le), { key: 2 }, {
3133
3143
  template: b(() => [
3134
- B("div", Rs, [
3144
+ B("div", js, [
3135
3145
  (u(), C(F, null, le(4, (P) => B("div", {
3136
3146
  key: P,
3137
3147
  class: "wx-blocks-page__ghost"
3138
3148
  }, [
3139
- f(l(qe), {
3149
+ f(l(Ke), {
3140
3150
  variant: "image",
3141
3151
  height: 120,
3142
3152
  class: "wx-blocks-page__ghost-thumb"
3143
3153
  }),
3144
- B("div", js, [
3145
- f(l(qe), {
3154
+ B("div", Fs, [
3155
+ f(l(Ke), {
3146
3156
  variant: "title",
3147
3157
  width: "45%"
3148
3158
  }),
3149
- f(l(qe), {
3159
+ f(l(Ke), {
3150
3160
  variant: "text",
3151
3161
  width: "70%"
3152
3162
  }),
3153
- f(l(qe), {
3163
+ f(l(Ke), {
3154
3164
  variant: "button",
3155
3165
  width: "64px",
3156
3166
  height: "22px"
@@ -3160,7 +3170,7 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
3160
3170
  ])
3161
3171
  ]),
3162
3172
  _: 1
3163
- })) : r.value.length === 0 ? (u(), D(l(It), {
3173
+ })) : r.value.length === 0 ? (u(), M(l(It), {
3164
3174
  key: 3,
3165
3175
  icon: "grid",
3166
3176
  title: l(i)("page.empty"),
@@ -3169,9 +3179,9 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
3169
3179
  key: P.id,
3170
3180
  class: "wx-blocks-page__group"
3171
3181
  }, [
3172
- P.label ? (u(), C("div", Fs, S(P.label), 1)) : I("", !0),
3173
- B("div", Hs, [
3174
- (u(!0), C(F, null, le(P.blocks, (J) => (u(), D(Is, {
3182
+ P.label ? (u(), C("div", Hs, S(P.label), 1)) : N("", !0),
3183
+ B("div", qs, [
3184
+ (u(!0), C(F, null, le(P.blocks, (J) => (u(), M(Is, {
3175
3185
  key: J.id,
3176
3186
  block: J,
3177
3187
  onOpen: K
@@ -3182,18 +3192,18 @@ const Tt = /* @__PURE__ */ Symbol("wx-blocks-root"), hs = {
3182
3192
  _: 1
3183
3193
  }, 8, ["view", "title", "views", "actions"]));
3184
3194
  }
3185
- }), Ks = /* @__PURE__ */ ie(qs, [["__scopeId", "data-v-553b680f"]]);
3186
- function so(e = {}) {
3195
+ }), Ys = /* @__PURE__ */ ie(Ks, [["__scopeId", "data-v-553b680f"]]);
3196
+ function oo(e = {}) {
3187
3197
  const n = e.path ?? "/blocks";
3188
3198
  return {
3189
3199
  id: "blocks",
3190
3200
  path: n,
3191
3201
  routes: [
3192
- { path: n, name: "webx.blocks", component: Ks, props: { base: n } },
3202
+ { path: n, name: "webx.blocks", component: Ys, props: { base: n } },
3193
3203
  {
3194
3204
  path: `${n}/:id(\\d+)`,
3195
3205
  name: "webx.blocks.edit",
3196
- component: jn,
3206
+ component: Fn,
3197
3207
  props: { base: n }
3198
3208
  }
3199
3209
  ],
@@ -3212,37 +3222,37 @@ function so(e = {}) {
3212
3222
  };
3213
3223
  }
3214
3224
  export {
3215
- jn as WxBlockEditorPage,
3216
- es as WxBlockPicker,
3217
- ql as WxBlockStage,
3218
- el as WxBlockThumb,
3225
+ Fn as WxBlockEditorPage,
3226
+ ts as WxBlockPicker,
3227
+ Kl as WxBlockStage,
3228
+ tl as WxBlockThumb,
3219
3229
  Ws as WxBlocks,
3220
- Ks as WxBlocksPage,
3221
- so as blocks,
3222
- tn as blocksMessages,
3223
- pt as blocksPreviewKey,
3224
- qt as cloneNode,
3225
- Yl as countType,
3230
+ Ys as WxBlocksPage,
3231
+ oo as blocks,
3232
+ ln as blocksMessages,
3233
+ ft as blocksPreviewKey,
3234
+ Kt as cloneNode,
3235
+ Jl as countType,
3226
3236
  ze as createBlocksApi,
3227
3237
  Ut as findRange,
3228
- dt as formSchema,
3229
- nt as highlightBlock,
3230
- xt as insertNode,
3231
- jt as isNode,
3232
- Xe as isNodeList,
3233
- $n as lintBlock,
3238
+ pt as formSchema,
3239
+ st as highlightBlock,
3240
+ $t as insertNode,
3241
+ Ft as isNode,
3242
+ et as isNodeList,
3243
+ Sn as lintBlock,
3234
3244
  re as locate,
3235
- Kl as makeNode,
3236
- at as newKey,
3237
- lo as provideBlocksPreview,
3238
- Ql as removeNode,
3239
- Ot as replaceBlock,
3240
- en as replaceList,
3241
- Rt as stageDocument,
3242
- to as typesIn,
3243
- Sn as undeclared,
3244
- Xl as updateValues,
3245
- no as useBlocksPreview,
3246
- je as walk
3245
+ Yl as makeNode,
3246
+ it as newKey,
3247
+ no as provideBlocksPreview,
3248
+ Xl as removeNode,
3249
+ Rt as replaceBlock,
3250
+ tn as replaceList,
3251
+ jt as stageDocument,
3252
+ lo as typesIn,
3253
+ En as undeclared,
3254
+ en as updateValues,
3255
+ so as useBlocksPreview,
3256
+ Fe as walk
3247
3257
  };
3248
3258
  //# sourceMappingURL=index.js.map