@webx-ui/module-blocks 0.7.0 → 0.7.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,8 +1,8 @@
1
- import { defineComponent as ae, computed as T, openBlock as i, createElementBlock as S, createVNode as u, unref as e, createElementVNode as B, createTextVNode as W, toDisplayString as _, Fragment as F, createCommentVNode as P, renderList as ee, ref as M, onMounted as Ue, watch as X, createBlock as N, withCtx as c, onBeforeUnmount as Ge, normalizeStyle as $e, reactive as et, normalizeClass as Se, withDirectives as Jt, vShow as Kt, resolveComponent as xt, isRef as $t, nextTick as Yt, withKeys as ut, withModifiers as ct, provide as St, inject as qe, useModel as Gt, getCurrentInstance as Zt, resolveDynamicComponent as Qt, mergeProps as Xt, mergeModels as el } from "vue";
1
+ import { defineComponent as ae, computed as T, openBlock as i, createElementBlock as S, createVNode as u, unref as e, createElementVNode as E, createTextVNode as W, toDisplayString as _, Fragment as j, createCommentVNode as N, renderList as ee, ref as U, onMounted as Ue, watch as X, createBlock as I, withCtx as d, onBeforeUnmount as Ge, normalizeStyle as xe, reactive as Qe, normalizeClass as $e, withDirectives as Jt, vShow as Kt, resolveComponent as xt, isRef as $t, nextTick as Gt, withKeys as ut, withModifiers as ct, provide as St, inject as qe, useModel as Yt, getCurrentInstance as Zt, resolveDynamicComponent as Qt, mergeProps as Xt, mergeModels as el } from "vue";
2
2
  import { useRoute as tl, useRouter as Tt } from "vue-router";
3
3
  import { useTranslate as de, useAdmin as Me, useErrorText as De, WxDate as ll, WxScreenHead as nl, WxRenameButton as al, WxHelpButton as ol, WxRowMenu as sl, adminKey as il, WxListScreen as rl } from "@webx-ui/module-admin";
4
- import { WxIcon as ge, WxSkeleton as We, WxText as q, WxBadge as ue, WxButton as ce, confirm as Ye, toast as Y, useElementWidth as Ze, WxSegmented as Ct, WxCard as Be, WxPopover as ul, WxAlert as Vt, WxTabs as cl, WxTab as Le, WxCodeEditor as Fe, WxFormItem as ne, WxInput as Pe, WxSelect as Et, WxTextarea as dl, WxIconPicker as pl, WxInputNumber as dt, WxTagsInput as pt, WxSwitch as vl, WxActionBar as fl, useModal as Bt, WxDialog as Lt, WxEmpty as Wt, WxAction as Ie, WxSortableList as ml, createModal as At, WxDrawer as hl, WxSpace as bl, WxSkeletonItem as je } from "@webx-ui/core";
5
- import { WxScreenRenderer as zt, coreTypes as tt } from "@webx-ui/schema";
4
+ import { WxIcon as be, WxSkeleton as We, WxText as F, WxBadge as ue, WxButton as ce, confirm as Ke, toast as G, useElementWidth as Ye, WxSegmented as Ct, WxCard as Be, WxPopover as ul, WxAlert as Vt, WxTabs as cl, WxTab as Le, WxCodeEditor as je, WxFormItem as ne, WxInput as Pe, WxSelect as Et, WxTextarea as dl, WxIconPicker as pl, WxInputNumber as dt, WxTagsInput as pt, WxSwitch as vl, WxActionBar as fl, useModal as Bt, WxDialog as Lt, WxEmpty as Wt, WxAction as Ie, WxSortableList as ml, createModal as At, WxDrawer as hl, WxSpace as bl, WxSkeletonItem as Fe } from "@webx-ui/core";
5
+ import { WxScreenRenderer as zt, coreTypes as Xe } from "@webx-ui/schema";
6
6
  function Ae(t) {
7
7
  const l = `${t.apiPath}/blocks`, o = (a) => a.data;
8
8
  return {
@@ -38,35 +38,35 @@ const gl = { class: "wx-block-checks" }, kl = {
38
38
  });
39
39
  return (r, n) => (i(), S("div", gl, [
40
40
  t.error ? (i(), S("div", kl, [
41
- u(e(ge), { name: "close-circle" }),
42
- B("span", null, [
41
+ u(e(be), { name: "close-circle" }),
42
+ E("span", null, [
43
43
  W(_(t.error.message) + " ", 1),
44
- t.error.line !== null ? (i(), S(F, { key: 0 }, [
44
+ t.error.line !== null ? (i(), S(j, { key: 0 }, [
45
45
  W(" · " + _(e(o)("page.line", { line: t.error.line })), 1)
46
- ], 64)) : P("", !0),
47
- t.error.where ? (i(), S(F, { key: 1 }, [
46
+ ], 64)) : N("", !0),
47
+ t.error.where ? (i(), S(j, { key: 1 }, [
48
48
  W(" · " + _(t.error.where), 1)
49
- ], 64)) : P("", !0)
49
+ ], 64)) : N("", !0)
50
50
  ])
51
- ])) : P("", !0),
52
- (i(!0), S(F, null, ee(a.value, (b) => (i(), S("div", {
51
+ ])) : N("", !0),
52
+ (i(!0), S(j, null, ee(a.value, (b) => (i(), S("div", {
53
53
  key: b.code,
54
54
  class: "wx-block-checks__line is-warning"
55
55
  }, [
56
- u(e(ge), { name: "warning" }),
57
- B("span", null, [
56
+ u(e(be), { name: "warning" }),
57
+ E("span", null, [
58
58
  W(_(b.message) + " ", 1),
59
- b.line !== null ? (i(), S(F, { key: 0 }, [
59
+ b.line !== null ? (i(), S(j, { key: 0 }, [
60
60
  W(" · " + _(e(o)("page.line", { line: b.line })), 1)
61
- ], 64)) : P("", !0)
61
+ ], 64)) : N("", !0)
62
62
  ])
63
63
  ]))), 128)),
64
- (i(!0), S(F, null, ee(s.value, (b) => (i(), S("div", {
64
+ (i(!0), S(j, null, ee(s.value, (b) => (i(), S("div", {
65
65
  key: b,
66
66
  class: "wx-block-checks__line is-ok"
67
67
  }, [
68
- u(e(ge), { name: "check" }),
69
- B("span", null, _(b), 1)
68
+ u(e(be), { name: "check" }),
69
+ E("span", null, _(b), 1)
70
70
  ]))), 128))
71
71
  ]));
72
72
  }
@@ -83,96 +83,96 @@ const gl = { class: "wx-block-checks" }, kl = {
83
83
  },
84
84
  emits: ["restored"],
85
85
  setup(t, { emit: l }) {
86
- const o = t, a = l, s = Me(), r = Ae(s), n = de("webx-blocks"), b = De(), U = M(null);
87
- async function p() {
88
- U.value = await r.versions(o.block.id);
86
+ const o = t, a = l, s = Me(), r = Ae(s), n = de("webx-blocks"), b = De(), P = U(null);
87
+ async function v() {
88
+ P.value = await r.versions(o.block.id);
89
89
  }
90
- function d(v) {
91
- return o.block.draft?.number === v.number ? "draft" : o.block.published?.number === v.number ? "live" : "replaced";
90
+ function p(f) {
91
+ return o.block.draft?.number === f.number ? "draft" : o.block.published?.number === f.number ? "live" : "replaced";
92
92
  }
93
- async function m(v) {
94
- if (await Ye({
95
- title: n("page.restore-title", { number: v.number }),
93
+ async function g(f) {
94
+ if (await Ke({
95
+ title: n("page.restore-title", { number: f.number }),
96
96
  message: n("page.restore-text"),
97
97
  confirmText: n("page.restore"),
98
98
  cancelText: n("page.cancel")
99
99
  }))
100
100
  try {
101
- const C = await r.restore(o.block.id, v.number);
102
- Y.success(n("page.restored", { number: C.draft?.number ?? v.number })), a("restored", C), await p();
101
+ const C = await r.restore(o.block.id, f.number);
102
+ G.success(n("page.restored", { number: C.draft?.number ?? f.number })), a("restored", C), await v();
103
103
  } catch (C) {
104
- Y.danger(b(C));
104
+ G.danger(b(C));
105
105
  }
106
106
  }
107
- return Ue(p), X(
107
+ return Ue(v), X(
108
108
  () => [o.block.draft?.number, o.block.published?.number],
109
109
  () => {
110
- p();
110
+ v();
111
111
  }
112
- ), (v, g) => (i(), S("div", wl, [
113
- U.value === null ? (i(), N(e(We), {
112
+ ), (f, k) => (i(), S("div", wl, [
113
+ P.value === null ? (i(), I(e(We), {
114
114
  key: 0,
115
115
  class: "wx-block-history__ghost",
116
116
  rows: 3
117
- })) : (i(!0), S(F, { key: 1 }, ee(U.value, (C) => (i(), S("div", {
117
+ })) : (i(!0), S(j, { key: 1 }, ee(P.value, (C) => (i(), S("div", {
118
118
  key: C.number,
119
119
  class: "wx-block-history__row"
120
120
  }, [
121
- B("code", _l, _(e(n)("page.version", { number: C.number })), 1),
122
- B("div", xl, [
123
- u(e(q), null, {
124
- default: c(() => [
125
- W(_(e(n)(`page.version-${d(C)}`)), 1)
121
+ E("code", _l, _(e(n)("page.version", { number: C.number })), 1),
122
+ E("div", xl, [
123
+ u(e(F), null, {
124
+ default: d(() => [
125
+ W(_(e(n)(`page.version-${p(C)}`)), 1)
126
126
  ]),
127
127
  _: 2
128
128
  }, 1024),
129
- u(e(q), {
129
+ u(e(F), {
130
130
  size: "sm",
131
131
  tone: "muted"
132
132
  }, {
133
- default: c(() => [
134
- C.created_at ? (i(), N(e(ll), {
133
+ default: d(() => [
134
+ C.created_at ? (i(), I(e(ll), {
135
135
  key: 0,
136
136
  value: C.created_at
137
- }, null, 8, ["value"])) : P("", !0),
137
+ }, null, 8, ["value"])) : N("", !0),
138
138
  W(" · " + _(C.author ?? e(n)(`page.source-${C.source}`)) + " ", 1),
139
- C.comment ? (i(), S(F, { key: 1 }, [
139
+ C.comment ? (i(), S(j, { key: 1 }, [
140
140
  W(" · " + _(C.comment), 1)
141
- ], 64)) : P("", !0)
141
+ ], 64)) : N("", !0)
142
142
  ]),
143
143
  _: 2
144
144
  }, 1024)
145
145
  ]),
146
- d(C) === "draft" ? (i(), N(e(ue), {
146
+ p(C) === "draft" ? (i(), I(e(ue), {
147
147
  key: 0,
148
148
  type: "warning",
149
149
  dot: ""
150
150
  }, {
151
- default: c(() => [
151
+ default: d(() => [
152
152
  W(_(e(n)("page.version-draft")), 1)
153
153
  ]),
154
154
  _: 1
155
- })) : d(C) === "live" ? (i(), N(e(ue), {
155
+ })) : p(C) === "live" ? (i(), I(e(ue), {
156
156
  key: 1,
157
157
  type: "success",
158
158
  dot: ""
159
159
  }, {
160
- default: c(() => [
160
+ default: d(() => [
161
161
  W(_(e(n)("page.version-live")), 1)
162
162
  ]),
163
163
  _: 1
164
- })) : P("", !0),
165
- t.canManage && d(C) === "replaced" ? (i(), N(e(ce), {
164
+ })) : N("", !0),
165
+ t.canManage && p(C) === "replaced" ? (i(), I(e(ce), {
166
166
  key: 2,
167
167
  size: "sm",
168
168
  variant: "outline",
169
- onClick: (V) => m(C)
169
+ onClick: (V) => g(C)
170
170
  }, {
171
- default: c(() => [
171
+ default: d(() => [
172
172
  W(_(e(n)("page.restore")), 1)
173
173
  ]),
174
174
  _: 1
175
- }, 8, ["onClick"])) : P("", !0)
175
+ }, 8, ["onClick"])) : N("", !0)
176
176
  ]))), 128))
177
177
  ]));
178
178
  }
@@ -203,38 +203,38 @@ function Nt(t, l, o) {
203
203
  const n = a.end.nextSibling;
204
204
  let b = a.start;
205
205
  for (; b; ) {
206
- const m = b.nextSibling, v = b === a.end;
207
- if (s.removeChild(b), v) break;
208
- b = m;
206
+ const g = b.nextSibling, f = b === a.end;
207
+ if (s.removeChild(b), f) break;
208
+ b = g;
209
209
  }
210
- const U = r.content, p = Array.from(U.childNodes);
211
- s.insertBefore(U, n);
212
- const d = t.defaultView?.webx;
213
- if (d?.mount)
214
- for (const m of p)
215
- m.nodeType === 1 && d.mount(m);
210
+ const P = r.content, v = Array.from(P.childNodes);
211
+ s.insertBefore(P, n);
212
+ const p = t.defaultView?.webx;
213
+ if (p?.mount)
214
+ for (const g of v)
215
+ g.nodeType === 1 && p.mount(g);
216
216
  return !0;
217
217
  }
218
- function Qe(t, l) {
218
+ function at(t, l) {
219
219
  const o = It(t, l);
220
220
  if (!o) return null;
221
221
  for (let a = o.start.nextSibling; a && a !== o.end; a = a.nextSibling)
222
222
  if (a.nodeType === 1) return a;
223
223
  return null;
224
224
  }
225
- function lt(t, l) {
225
+ function et(t, l) {
226
226
  ot(t);
227
227
  for (const a of Array.from(t.querySelectorAll(`.${Ne}`)))
228
228
  a.classList.remove(Ne);
229
229
  if (l === null) return null;
230
- const o = Qe(t, l);
230
+ const o = at(t, l);
231
231
  return o?.classList.add(Ne), o;
232
232
  }
233
233
  function mt(t, l) {
234
234
  ot(t);
235
235
  for (const o of Array.from(t.querySelectorAll(`.${Je}`)))
236
236
  o.classList.remove(Je);
237
- l !== null && Qe(t, l)?.classList.add(Je);
237
+ l !== null && at(t, l)?.classList.add(Je);
238
238
  }
239
239
  function ht(t) {
240
240
  let l = t?.nodeType === 1 ? t : t?.parentElement ?? null;
@@ -258,7 +258,7 @@ function Tl(t, l) {
258
258
  ot(t);
259
259
  let o = null;
260
260
  function a(n) {
261
- be(n), l.select(ht(n.target));
261
+ he(n), l.select(ht(n.target));
262
262
  }
263
263
  function s(n) {
264
264
  const b = ht(n.target);
@@ -267,30 +267,30 @@ function Tl(t, l) {
267
267
  function r() {
268
268
  o = null, mt(t, null);
269
269
  }
270
- return t.addEventListener("click", a, !0), t.addEventListener("auxclick", be, !0), t.addEventListener("submit", be, !0), t.addEventListener("dragstart", be, !0), t.addEventListener("mousemove", s, !0), t.addEventListener("mouseleave", r), {
270
+ return t.addEventListener("click", a, !0), t.addEventListener("auxclick", he, !0), t.addEventListener("submit", he, !0), t.addEventListener("dragstart", he, !0), t.addEventListener("mousemove", s, !0), t.addEventListener("mouseleave", r), {
271
271
  release() {
272
- t.removeEventListener("click", a, !0), t.removeEventListener("auxclick", be, !0), t.removeEventListener("submit", be, !0), t.removeEventListener("dragstart", be, !0), t.removeEventListener("mousemove", s, !0), t.removeEventListener("mouseleave", r);
272
+ t.removeEventListener("click", a, !0), t.removeEventListener("auxclick", he, !0), t.removeEventListener("submit", he, !0), t.removeEventListener("dragstart", he, !0), t.removeEventListener("mousemove", s, !0), t.removeEventListener("mouseleave", r);
273
273
  }
274
274
  };
275
275
  }
276
- function be(t) {
276
+ function he(t) {
277
277
  t.preventDefault(), t.stopPropagation();
278
278
  }
279
279
  function Cl(t) {
280
280
  const l = ["click", "auxclick", "submit", "dragstart"];
281
- for (const o of l) t.addEventListener(o, be, !0);
281
+ for (const o of l) t.addEventListener(o, he, !0);
282
282
  return {
283
283
  release() {
284
- for (const o of l) t.removeEventListener(o, be, !0);
284
+ for (const o of l) t.removeEventListener(o, he, !0);
285
285
  }
286
286
  };
287
287
  }
288
- const Ke = "sample", bt = "wx-stage-styles";
288
+ const tt = "sample", bt = "wx-stage-styles";
289
289
  function Vl(t, l) {
290
290
  let o = t.getElementById(bt);
291
291
  o === null && (o = t.createElement("style"), o.id = bt, (t.head ?? t.documentElement).appendChild(o)), o.textContent = l.styles;
292
- const a = `<!--wx:${Ke}-->`, s = l.html.trimStart().startsWith(a) ? l.html : `${a}${l.html}<!--/wx:${Ke}-->`;
293
- return Nt(t, Ke, s);
292
+ const a = `<!--wx:${tt}-->`, s = l.html.trimStart().startsWith(a) ? l.html : `${a}${l.html}<!--/wx:${tt}-->`;
293
+ return Nt(t, tt, s);
294
294
  }
295
295
  function El(t, l) {
296
296
  const o = t.createElement("script");
@@ -323,16 +323,16 @@ const Bl = { class: "wx-block-stage" }, Ll = { class: "wx-block-stage__bar" }, W
323
323
  { value: 1280, icon: "monitor", ariaLabel: o("page.width-desktop") },
324
324
  { value: 834, icon: "tablet", ariaLabel: o("page.width-tablet") },
325
325
  { value: 390, icon: "smartphone", ariaLabel: o("page.width-phone") }
326
- ]), s = M(1280), r = M(null), n = M(null), b = Ze(r), U = M(360), p = M(!1);
326
+ ]), s = U(1280), r = U(null), n = U(null), b = Ye(r), P = U(360), v = U(!1);
327
327
  X([b, a], () => {
328
- if (p.value || b.value === 0) return;
329
- const k = a.value.find((A) => b.value / A.value >= 0.45);
330
- s.value = (k ?? a.value[a.value.length - 1]).value;
328
+ if (v.value || b.value === 0) return;
329
+ const c = a.value.find((B) => b.value / B.value >= 0.45);
330
+ s.value = (c ?? a.value[a.value.length - 1]).value;
331
331
  });
332
- function d(k) {
333
- p.value = !0, s.value = k;
332
+ function p(c) {
333
+ v.value = !0, s.value = c;
334
334
  }
335
- const m = T(() => b.value === 0 ? 1 : Math.min(1, b.value / s.value)), v = T(
335
+ const g = T(() => b.value === 0 ? 1 : Math.min(1, b.value / s.value)), f = T(
336
336
  () => l.stage ? void 0 : Pt({
337
337
  html: l.html,
338
338
  styles: l.styles,
@@ -340,116 +340,103 @@ const Bl = { class: "wx-block-stage" }, Ll = { class: "wx-block-stage__bar" }, W
340
340
  runtime: l.runtime,
341
341
  base: typeof location > "u" ? null : location.origin + "/"
342
342
  })
343
- ), g = M(0);
343
+ ), k = U(0);
344
344
  let C = null;
345
345
  X(
346
346
  () => l.script,
347
- (k) => {
348
- l.stage && k !== C && (g.value += 1);
347
+ (c) => {
348
+ l.stage && c !== C && (k.value += 1);
349
349
  }
350
350
  );
351
351
  function V() {
352
- const k = n.value?.contentDocument?.body;
353
- if (!k) return;
354
- const A = k.ownerDocument.defaultView, j = A && parseFloat(A.getComputedStyle(k).marginBottom) || 0, pe = k.getBoundingClientRect().bottom + j + (A?.scrollY ?? 0);
355
- U.value = Math.max(120, Math.ceil(Math.max(k.scrollHeight, pe)));
352
+ const c = n.value?.contentDocument?.body;
353
+ if (!c) return;
354
+ const B = c.ownerDocument.defaultView, D = B && parseFloat(B.getComputedStyle(c).marginBottom) || 0, K = c.getBoundingClientRect().bottom + D + (B?.scrollY ?? 0);
355
+ P.value = Math.max(120, Math.ceil(Math.max(c.scrollHeight, K)));
356
356
  }
357
- let x = null, f = null;
357
+ let x = null, m = null;
358
358
  function y() {
359
- x?.release(), x = null, f?.disconnect(), f = null;
360
- }
361
- function R(k) {
362
- l.stage && (l.script && C !== l.script && (C = l.script, El(k, l.script)), Vl(k, { html: l.html, styles: l.styles }));
359
+ x?.release(), x = null, m?.disconnect(), m = null;
363
360
  }
364
- function J(k) {
365
- const A = Qe(k, Ke), j = r.value;
366
- if (!A || !j) return;
367
- const pe = A.getBoundingClientRect().top + (k.defaultView?.scrollY ?? 0);
368
- j.scrollTop = Math.max(0, pe * m.value - 24);
361
+ function R(c) {
362
+ l.stage && (l.script && C !== l.script && (C = l.script, El(c, l.script)), Vl(c, { html: l.html, styles: l.styles }));
369
363
  }
370
- function K() {
364
+ function q() {
371
365
  y();
372
- const k = n.value?.contentDocument;
373
- if (!k?.body) return;
374
- l.stage && (C = null, x = Cl(k), R(k)), V();
375
- const A = k.defaultView?.ResizeObserver;
376
- A && (f = new A(() => V()), f.observe(k.body)), l.stage && requestAnimationFrame(() => J(k));
366
+ const c = n.value?.contentDocument;
367
+ if (!c?.body) return;
368
+ l.stage && (C = null, x = Cl(c), R(c)), V();
369
+ const B = c.defaultView?.ResizeObserver;
370
+ B && (m = new B(() => V()), m.observe(c.body));
377
371
  }
378
372
  X(
379
373
  () => [l.html, l.styles],
380
374
  () => {
381
- const k = n.value?.contentDocument;
382
- l.stage && k?.body && x !== null && R(k);
375
+ const c = n.value?.contentDocument;
376
+ l.stage && c?.body && x !== null && R(c);
383
377
  }
384
- ), X(b, (k, A) => {
385
- k > 0 && A === 0 && setTimeout(V, 50);
386
- }), X(
387
- s,
388
- () => setTimeout(() => {
389
- V();
390
- const k = n.value?.contentDocument;
391
- l.stage && k && requestAnimationFrame(() => J(k));
392
- }, 50)
393
- ), Ge(y);
394
- const Z = T(() => ({
378
+ ), X(b, (c, B) => {
379
+ c > 0 && B === 0 && setTimeout(V, 50);
380
+ }), X(s, () => setTimeout(V, 50)), Ge(y);
381
+ const J = T(() => ({
395
382
  width: `${s.value}px`,
396
- height: `${U.value}px`,
397
- transform: `scale(${m.value})`
398
- })), E = T(() => ({
399
- width: `${Math.round(s.value * m.value)}px`,
400
- height: `${Math.round(U.value * m.value)}px`
383
+ height: `${P.value}px`,
384
+ transform: `scale(${g.value})`
385
+ })), Z = T(() => ({
386
+ width: `${Math.round(s.value * g.value)}px`,
387
+ height: `${Math.round(P.value * g.value)}px`
401
388
  }));
402
- return (k, A) => (i(), S("div", Bl, [
403
- B("div", Ll, [
389
+ return (c, B) => (i(), S("div", Bl, [
390
+ E("div", Ll, [
404
391
  u(e(Ct), {
405
392
  "model-value": s.value,
406
393
  options: a.value,
407
394
  size: "sm",
408
395
  "aria-label": e(o)("page.width"),
409
- "onUpdate:modelValue": A[0] || (A[0] = (j) => d(Number(j)))
396
+ "onUpdate:modelValue": B[0] || (B[0] = (D) => p(Number(D)))
410
397
  }, null, 8, ["model-value", "options", "aria-label"])
411
398
  ]),
412
- B("div", {
399
+ E("div", {
413
400
  ref_key: "box",
414
401
  ref: r,
415
402
  class: "wx-block-stage__ground"
416
403
  }, [
417
- t.loading && !t.html ? (i(), N(e(We), {
404
+ t.loading && !t.html ? (i(), I(e(We), {
418
405
  key: 0,
419
406
  rows: 3
420
407
  })) : (i(), S("div", {
421
408
  key: 1,
422
409
  class: "wx-block-stage__clip",
423
- style: $e(E.value)
410
+ style: xe(Z.value)
424
411
  }, [
425
412
  (i(), S("iframe", {
426
413
  ref_key: "frame",
427
414
  ref: n,
428
- key: g.value,
415
+ key: k.value,
429
416
  class: "wx-block-stage__frame",
430
417
  src: t.stage ?? void 0,
431
- srcdoc: v.value,
432
- style: $e(Z.value),
418
+ srcdoc: f.value,
419
+ style: xe(J.value),
433
420
  sandbox: "allow-same-origin allow-scripts",
434
421
  title: e(o)("page.preview"),
435
- onLoad: K
422
+ onLoad: q
436
423
  }, null, 44, Wl))
437
424
  ], 4))
438
425
  ], 512)
439
426
  ]));
440
427
  }
441
- }), zl = /* @__PURE__ */ oe(Al, [["__scopeId", "data-v-443f8224"]]);
428
+ }), zl = /* @__PURE__ */ oe(Al, [["__scopeId", "data-v-3185ee45"]]);
442
429
  function Ut(t) {
443
430
  return typeof t == "object" && t !== null && typeof t.type == "string" && t.type !== "";
444
431
  }
445
- function Xe(t) {
432
+ function Ze(t) {
446
433
  return Array.isArray(t) && t.length > 0 && t.every(Ut);
447
434
  }
448
- function nt() {
435
+ function lt() {
449
436
  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);
450
437
  }
451
438
  function Il(t, l = {}) {
452
- return { key: nt(), type: t, values: l };
439
+ return { key: lt(), type: t, values: l };
453
440
  }
454
441
  function re(t, l) {
455
442
  return Mt(t, l, null, null);
@@ -459,9 +446,9 @@ function Mt(t, l, o, a) {
459
446
  const r = t[s];
460
447
  if (r.key === l) return { node: r, parent: o, field: a, list: t, index: s };
461
448
  for (const [n, b] of Object.entries(r.values ?? {}))
462
- if (Xe(b)) {
463
- const U = Mt(b, l, r, n);
464
- if (U) return U;
449
+ if (Ze(b)) {
450
+ const P = Mt(b, l, r, n);
451
+ if (P) return P;
465
452
  }
466
453
  }
467
454
  return null;
@@ -471,7 +458,7 @@ function Oe(t, l, o = 0, a = null) {
471
458
  if (Ut(s)) {
472
459
  l(s, o, a);
473
460
  for (const r of Object.values(s.values ?? {}))
474
- Xe(r) && Oe(r, l, o + 1, s);
461
+ Ze(r) && Oe(r, l, o + 1, s);
475
462
  }
476
463
  }
477
464
  function Nl(t, l) {
@@ -483,7 +470,7 @@ function Nl(t, l) {
483
470
  function Pl(t) {
484
471
  let l = 0;
485
472
  for (const o of Object.values(t.values ?? {}))
486
- Xe(o) && Oe(o, () => l++);
473
+ Ze(o) && Oe(o, () => l++);
487
474
  return l;
488
475
  }
489
476
  function wa(t) {
@@ -501,11 +488,11 @@ function Dt(t) {
501
488
  function Ot(t) {
502
489
  const l = {};
503
490
  for (const [o, a] of Object.entries(t.values ?? {}))
504
- l[o] = Xe(a) ? a.map(Ot) : ke(a);
505
- return t.hidden === !0 ? { key: nt(), type: t.type, hidden: !0, values: l } : { key: nt(), type: t.type, values: l };
491
+ l[o] = Ze(a) ? a.map(Ot) : ge(a);
492
+ return t.hidden === !0 ? { key: lt(), type: t.type, hidden: !0, values: l } : { key: lt(), type: t.type, values: l };
506
493
  }
507
494
  function Ul(t, l, o) {
508
- const a = ke(t), s = re(a, l);
495
+ const a = ge(t), s = re(a, l);
509
496
  return s ? (o ? s.node.hidden = !0 : delete s.node.hidden, a) : t;
510
497
  }
511
498
  function Ml(t, l, o) {
@@ -516,23 +503,23 @@ function Ml(t, l, o) {
516
503
  return Array.isArray(s) || (a.node.values[o] = []), a.node.values[o];
517
504
  }
518
505
  function kt(t, l, o, a, s) {
519
- const r = ke(t), n = Ml(r, l, o);
506
+ const r = ge(t), n = Ml(r, l, o);
520
507
  return n ? (n.splice(Math.max(0, Math.min(a, n.length)), 0, s), r) : t;
521
508
  }
522
509
  function Dl(t, l) {
523
- const o = ke(t), a = re(o, l);
510
+ const o = ge(t), a = re(o, l);
524
511
  return a ? (a.list.splice(a.index, 1), o) : t;
525
512
  }
526
513
  function Ol(t, l, o) {
527
- const a = ke(t), s = re(a, l);
514
+ const a = ge(t), s = re(a, l);
528
515
  return s ? (s.node.values = o, a) : t;
529
516
  }
530
517
  function Rl(t, l, o, a) {
531
- if (l === null) return ke(a);
532
- const s = ke(t), r = re(s, l);
533
- return !r || o === null ? t : (r.node.values[o] = ke(a), s);
518
+ if (l === null) return ge(a);
519
+ const s = ge(t), r = re(s, l);
520
+ return !r || o === null ? t : (r.node.values[o] = ge(a), s);
534
521
  }
535
- function ke(t) {
522
+ function ge(t) {
536
523
  return t === void 0 ? t : JSON.parse(JSON.stringify(t));
537
524
  }
538
525
  const Hl = {
@@ -699,8 +686,8 @@ function Re() {
699
686
  } catch {
700
687
  }
701
688
  }
702
- const Fl = ["block", "entity", "loop", "__env", "errors", "app"];
703
- function jl(t, l, o) {
689
+ const jl = ["block", "entity", "loop", "__env", "errors", "app"];
690
+ function Fl(t, l, o) {
704
691
  const a = [];
705
692
  /data-wx-block\s*=/.test(l.template) || a.push({ file: "template", code: "no-marker", line: null, message: o("checks.no-marker") });
706
693
  const s = ql(l.template, l.schema);
@@ -709,12 +696,12 @@ function jl(t, l, o) {
709
696
  code: "variables-missing",
710
697
  line: null,
711
698
  message: o("checks.variables-missing", {
712
- variables: s.map((d) => `$${d}`).join(", ")
699
+ variables: s.map((p) => `$${p}`).join(", ")
713
700
  })
714
701
  });
715
702
  const r = [], n = [], b = `.b-${t}`;
716
- for (const [d, m] of Jl(l.styles))
717
- d.startsWith(b) || d.startsWith("&") || (/^[a-z][a-z0-9-]*/i.test(d) ? n.push([d, m]) : r.push([d, m]));
703
+ for (const [p, g] of Jl(l.styles))
704
+ p.startsWith(b) || p.startsWith("&") || (/^[a-z][a-z0-9-]*/i.test(p) ? n.push([p, g]) : r.push([p, g]));
718
705
  r.length > 0 && a.push({
719
706
  file: "styles",
720
707
  code: "stray-selectors",
@@ -726,11 +713,11 @@ function jl(t, l, o) {
726
713
  line: n[0][1],
727
714
  message: o("checks.bare-selectors", { selectors: wt(n) })
728
715
  });
729
- const U = Ht(l.styles), p = /@media\b/.exec(U);
730
- return p && a.push({
716
+ const P = Ht(l.styles), v = /@media\b/.exec(P);
717
+ return v && a.push({
731
718
  file: "styles",
732
719
  code: "media-query",
733
- line: Ft(U, p.index),
720
+ line: jt(P, v.index),
734
721
  message: o("checks.media-query")
735
722
  }), a;
736
723
  }
@@ -741,7 +728,7 @@ function Rt(t) {
741
728
  return l;
742
729
  }
743
730
  function ql(t, l) {
744
- const o = /* @__PURE__ */ new Set([...Rt(l), ...Fl]);
731
+ const o = /* @__PURE__ */ new Set([...Rt(l), ...jl]);
745
732
  for (const s of t.matchAll(/\bas\s+\$([a-zA-Z_]\w*)(?:\s*=>\s*\$([a-zA-Z_]\w*))?/g))
746
733
  o.add(s[1]), s[2] && o.add(s[2]);
747
734
  for (const s of t.matchAll(/\$([a-zA-Z_]\w*)\s*(?:=[^=]|\+\+|--|\.=|\+=|-=)/g))
@@ -760,7 +747,7 @@ function Jl(t) {
760
747
  if (!(r === "" || r.startsWith("@")))
761
748
  for (const n of s.split(",")) {
762
749
  const b = n.trim();
763
- b === "" || b === "from" || b === "to" || b.endsWith("%") || o.push([b, Ft(l, a.index + s.indexOf(b))]);
750
+ b === "" || b === "from" || b === "to" || b.endsWith("%") || o.push([b, jt(l, a.index + s.indexOf(b))]);
764
751
  }
765
752
  }
766
753
  return o;
@@ -768,7 +755,7 @@ function Jl(t) {
768
755
  function Ht(t) {
769
756
  return t.replace(/\/\*[\s\S]*?\*\//g, (l) => l.replace(/[^\n]/g, " "));
770
757
  }
771
- function Ft(t, l) {
758
+ function jt(t, l) {
772
759
  return t.slice(0, Math.max(0, l)).split(`
773
760
  `).length;
774
761
  }
@@ -783,14 +770,14 @@ function st(t) {
783
770
  children: l.children ? st(l.children) : l.children
784
771
  }));
785
772
  }
786
- function at(t, l) {
773
+ function nt(t, l) {
787
774
  return t === 0 ? l("page.not-used") : t === 1 ? l("page.on-page") : l("page.on-pages", { count: t });
788
775
  }
789
776
  function ze(t, l) {
790
777
  const o = `groups.${t}`, a = l(o);
791
778
  return a === o || a === `webx-blocks::${o}` ? t.charAt(0).toUpperCase() + t.slice(1) : a;
792
779
  }
793
- const Kl = { class: "wx-block-editor" }, Yl = { class: "wx-block-editor__split" }, Gl = {
780
+ const Kl = { class: "wx-block-editor" }, Gl = { class: "wx-block-editor__split" }, Yl = {
794
781
  type: "button",
795
782
  class: "wx-block-editor__uses"
796
783
  }, Zl = { class: "wx-block-editor__usage" }, Ql = { class: "wx-block-editor__pane" }, Xl = {
@@ -807,14 +794,14 @@ const Kl = { class: "wx-block-editor" }, Yl = { class: "wx-block-editor__split"
807
794
  setup(t) {
808
795
  const l = t, o = Me(), a = Ae(o), s = tl(), r = Tt();
809
796
  Re();
810
- const n = de("webx-blocks"), b = De(), U = T(() => Number(s.params.id)), p = M(null), d = M([]), m = M(!0), v = M(!1), g = M(!1), C = M("template"), V = T(() => {
811
- const z = o.state.manifest?.modules.find((h) => h.id === "blocks")?.meta;
797
+ const n = de("webx-blocks"), b = De(), P = T(() => Number(s.params.id)), v = U(null), p = U([]), g = U(!0), f = U(!1), k = U(!1), C = U("template"), V = T(() => {
798
+ const A = o.state.manifest?.modules.find((h) => h.id === "blocks")?.meta;
812
799
  return {
813
- groups: z?.groups ?? [],
814
- editing: z?.editing ?? !0,
815
- provides: z?.provides ?? []
800
+ groups: A?.groups ?? [],
801
+ editing: A?.editing ?? !0,
802
+ provides: A?.provides ?? []
816
803
  };
817
- }), x = T(() => o.can("blocks.manage") && V.value.editing), f = et({
804
+ }), x = T(() => o.can("blocks.manage") && V.value.editing), m = Qe({
818
805
  slug: "",
819
806
  title: "",
820
807
  description: "",
@@ -825,88 +812,88 @@ const Kl = { class: "wx-block-editor" }, Yl = { class: "wx-block-editor__split"
825
812
  allowed_in: [],
826
813
  max_per_entity: null,
827
814
  is_enabled: !0
828
- }), y = et({
815
+ }), y = Qe({
829
816
  schema: [],
830
817
  template: "",
831
818
  styles: "",
832
819
  script: null,
833
820
  sample: {}
834
- }), R = M("[]"), J = M(null), K = M(""), Z = M({}), E = M(null), k = et({
821
+ }), R = U("[]"), q = U(null), J = U(""), Z = U({}), c = U(null), B = Qe({
835
822
  html: "",
836
823
  styles: "",
837
824
  script: null,
838
825
  runtime: null,
839
826
  stage: null,
840
827
  loading: !1
841
- }), A = T(() => JSON.stringify({ settings: f, content: y })), j = T(() => K.value !== "" && A.value !== K.value), pe = T(() => jl(f.slug, y, n)), ve = T(() => {
842
- const z = [...V.value.groups];
843
- return z.includes(f.group) || z.push(f.group), z.map((h) => ({ value: h, label: ze(h, n) }));
828
+ }), D = T(() => JSON.stringify({ settings: m, content: y })), K = T(() => J.value !== "" && D.value !== J.value), Se = T(() => Fl(m.slug, y, n)), pe = T(() => {
829
+ const A = [...V.value.groups];
830
+ return A.includes(m.group) || A.push(m.group), A.map((h) => ({ value: h, label: ze(h, n) }));
844
831
  }), se = T({
845
832
  get: () => y.sample,
846
- set: (z) => {
847
- y.sample = z;
833
+ set: (A) => {
834
+ y.sample = A;
848
835
  }
849
- }), xe = T(() => Te(y.schema));
850
- function Te(z) {
836
+ }), _e = T(() => Te(y.schema));
837
+ function Te(A) {
851
838
  const h = [];
852
- for (const $ of z)
839
+ for (const $ of A)
853
840
  $.type !== "wx-blocks" && !($.children?.length && !$.name) && h.push($.id), $.children && h.push(...Te($.children));
854
841
  return h;
855
842
  }
856
- function ye(z) {
857
- p.value = z, Object.assign(f, {
858
- slug: z.slug,
859
- title: z.title,
860
- description: z.description,
861
- icon: z.icon,
862
- group: z.group,
863
- sort: z.sort,
864
- allow: z.allow ?? [],
865
- allowed_in: z.allowed_in ?? [],
866
- max_per_entity: z.max_per_entity,
867
- is_enabled: z.is_enabled
843
+ function ke(A) {
844
+ v.value = A, Object.assign(m, {
845
+ slug: A.slug,
846
+ title: A.title,
847
+ description: A.description,
848
+ icon: A.icon,
849
+ group: A.group,
850
+ sort: A.sort,
851
+ allow: A.allow ?? [],
852
+ allowed_in: A.allowed_in ?? [],
853
+ max_per_entity: A.max_per_entity,
854
+ is_enabled: A.is_enabled
868
855
  });
869
- const h = z.content ?? {
856
+ const h = A.content ?? {
870
857
  schema: [],
871
858
  template: "",
872
859
  styles: "",
873
860
  script: null,
874
861
  sample: {}
875
862
  };
876
- Object.assign(y, ke(h)), R.value = JSON.stringify(h.schema, null, 2), J.value = null, K.value = A.value;
863
+ Object.assign(y, ge(h)), R.value = JSON.stringify(h.schema, null, 2), q.value = null, J.value = D.value;
877
864
  }
878
865
  async function te() {
879
- m.value = !0;
866
+ g.value = !0;
880
867
  try {
881
- ye(await a.get(U.value)), d.value = await a.usage(U.value);
882
- } catch (z) {
883
- Y.danger(b(z));
868
+ ke(await a.get(P.value)), p.value = await a.usage(P.value);
869
+ } catch (A) {
870
+ G.danger(b(A));
884
871
  } finally {
885
- m.value = !1;
872
+ g.value = !1;
886
873
  }
887
874
  }
888
- function Ce(z) {
889
- R.value = z;
875
+ function Ce(A) {
876
+ R.value = A;
890
877
  try {
891
- const h = JSON.parse(z);
878
+ const h = JSON.parse(A);
892
879
  if (!Array.isArray(h)) throw new Error("not a list");
893
- y.schema = h, J.value = null;
880
+ y.schema = h, q.value = null;
894
881
  } catch (h) {
895
- J.value = n("page.schema-invalid", { error: h.message });
882
+ q.value = n("page.schema-invalid", { error: h.message });
896
883
  }
897
884
  }
898
- let we, me = 0;
899
- function I() {
900
- clearTimeout(we), we = setTimeout(() => {
885
+ let ye, fe = 0;
886
+ function z() {
887
+ clearTimeout(ye), ye = setTimeout(() => {
901
888
  O();
902
889
  }, 250);
903
890
  }
904
891
  async function O() {
905
- if (!p.value) return;
906
- const z = ++me;
907
- k.loading = !0;
892
+ if (!v.value) return;
893
+ const A = ++fe;
894
+ B.loading = !0;
908
895
  try {
909
- const h = await a.render(p.value.id, {
896
+ const h = await a.render(v.value.id, {
910
897
  values: y.sample,
911
898
  content: x.value ? {
912
899
  template: y.template,
@@ -915,92 +902,92 @@ const Kl = { class: "wx-block-editor" }, Yl = { class: "wx-block-editor__split"
915
902
  schema: y.schema
916
903
  } : void 0
917
904
  });
918
- if (z !== me) return;
919
- k.html = h.html, k.styles = h.styles, k.script = h.script, k.runtime = h.runtime, k.stage = h.stage ?? null;
905
+ if (A !== fe) return;
906
+ B.html = h.html, B.styles = h.styles, B.script = h.script, B.runtime = h.runtime, B.stage = h.stage ?? null;
920
907
  } catch (h) {
921
- z === me && Y.danger(b(h));
908
+ A === fe && G.danger(b(h));
922
909
  } finally {
923
- z === me && (k.loading = !1);
910
+ A === fe && (B.loading = !1);
924
911
  }
925
912
  }
926
913
  X(
927
914
  () => [y.template, y.styles, y.script, y.schema, y.sample],
928
- I,
915
+ z,
929
916
  { deep: !0 }
930
917
  );
931
- const H = M(null);
932
- function G(z) {
933
- return `{{ $${z} }}`;
918
+ const H = U(null);
919
+ function Y(A) {
920
+ return `{{ $${A} }}`;
934
921
  }
935
- function fe(z) {
922
+ function ve(A) {
936
923
  const $ = H.value?.view?.value;
937
924
  if (!$) {
938
- y.template += `{{ $${z} }}`;
925
+ y.template += `{{ $${A} }}`;
939
926
  return;
940
927
  }
941
- $.dispatch($.state.replaceSelection(`{{ $${z} }}`)), $.focus();
928
+ $.dispatch($.state.replaceSelection(`{{ $${A} }}`)), $.focus();
942
929
  }
943
- async function he() {
944
- if (!p.value) return;
945
- v.value = !0, Z.value = {}, E.value = null;
946
- const z = p.value.draft?.number ?? null;
930
+ async function me() {
931
+ if (!v.value) return;
932
+ f.value = !0, Z.value = {}, c.value = null;
933
+ const A = v.value.draft?.number ?? null;
947
934
  try {
948
- const h = await a.update(p.value.id, {
949
- ...f,
950
- allow: f.allow.length ? f.allow : null,
951
- allowed_in: f.allowed_in.length ? f.allowed_in : null,
952
- description: f.description || null,
953
- icon: f.icon || null,
954
- content: J.value ? { ...y, schema: void 0 } : y
935
+ const h = await a.update(v.value.id, {
936
+ ...m,
937
+ allow: m.allow.length ? m.allow : null,
938
+ allowed_in: m.allowed_in.length ? m.allowed_in : null,
939
+ description: m.description || null,
940
+ icon: m.icon || null,
941
+ content: q.value ? { ...y, schema: void 0 } : y
955
942
  });
956
- ye(h), Y.success(
957
- h.draft && h.draft.number !== z ? n("page.saved", { number: h.draft.number }) : n("page.unchanged")
943
+ ke(h), G.success(
944
+ h.draft && h.draft.number !== A ? n("page.saved", { number: h.draft.number }) : n("page.unchanged")
958
945
  );
959
946
  } catch (h) {
960
947
  const $ = h.body;
961
- $?.errors ? (Z.value = $.errors, Y.danger(n("page.failed"))) : Y.danger(b(h, n("page.failed")));
948
+ $?.errors ? (Z.value = $.errors, G.danger(n("page.failed"))) : G.danger(b(h, n("page.failed")));
962
949
  } finally {
963
- v.value = !1;
950
+ f.value = !1;
964
951
  }
965
952
  }
966
953
  async function ie() {
967
- if (!(!p.value?.draft || (j.value && await he(), !p.value.draft) || !await Ye({
968
- title: n("page.publish-title", { number: p.value.draft.number }),
969
- message: n("page.publish-text", { count: p.value.usage_count }),
954
+ if (!(!v.value?.draft || (K.value && await me(), !v.value.draft) || !await Ke({
955
+ title: n("page.publish-title", { number: v.value.draft.number }),
956
+ message: n("page.publish-text", { count: v.value.usage_count }),
970
957
  confirmText: n("page.publish"),
971
958
  cancelText: n("page.cancel")
972
959
  }))) {
973
- g.value = !0, E.value = null;
960
+ k.value = !0, c.value = null;
974
961
  try {
975
- ye(await a.publish(p.value.id)), Y.success(n("page.published", { number: p.value.published?.number ?? 0 }));
962
+ ke(await a.publish(v.value.id)), G.success(n("page.published", { number: v.value.published?.number ?? 0 }));
976
963
  } catch (h) {
977
964
  const $ = h.body;
978
- $?.errors ? (E.value = $, C.value = "template", Y.danger(n("page.publish-failed"))) : Y.danger(b(h, n("page.publish-failed")));
965
+ $?.errors ? (c.value = $, C.value = "template", G.danger(n("page.publish-failed"))) : G.danger(b(h, n("page.publish-failed")));
979
966
  } finally {
980
- g.value = !1;
967
+ k.value = !1;
981
968
  }
982
969
  }
983
970
  }
984
- async function _e() {
985
- if (!(!p.value || !await Ye({
986
- title: n("page.delete-title", { title: p.value.title }),
971
+ async function we() {
972
+ if (!(!v.value || !await Ke({
973
+ title: n("page.delete-title", { title: v.value.title }),
987
974
  message: n("page.delete-text"),
988
975
  confirmText: n("page.delete"),
989
976
  cancelText: n("page.cancel"),
990
977
  tone: "danger"
991
978
  })))
992
979
  try {
993
- await a.remove(p.value.id), Y.success(n("page.deleted")), r.push(l.base);
980
+ await a.remove(v.value.id), G.success(n("page.deleted")), r.push(l.base);
994
981
  } catch (h) {
995
- Y.danger(b(h));
982
+ G.danger(b(h));
996
983
  }
997
984
  }
998
985
  const Ve = T(
999
- () => E.value ? {
1000
- message: E.value.errors.template?.[0] ?? E.value.message,
1001
- line: E.value.line,
1002
- where: E.value.entity ? n("page.failed-on", {
1003
- title: E.value.entity.title ?? `#${E.value.entity.id}`
986
+ () => c.value ? {
987
+ message: c.value.errors.template?.[0] ?? c.value.message,
988
+ line: c.value.line,
989
+ where: c.value.entity ? n("page.failed-on", {
990
+ title: c.value.entity.title ?? `#${c.value.entity.id}`
1004
991
  }) : null
1005
992
  } : null
1006
993
  ), Ee = T(() => C.value === "template" || C.value === "styles"), w = T(() => [
@@ -1026,182 +1013,182 @@ setInterval(() => el.classList.toggle('is-second'), seconds * 1000)`
1026
1013
 
1027
1014
  new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1028
1015
  }
1029
- ]), L = T(() => d.value.slice(0, 5));
1030
- function D(z) {
1031
- return Z.value[z]?.[0];
1016
+ ]), L = T(() => p.value.slice(0, 5));
1017
+ function M(A) {
1018
+ return Z.value[A]?.[0];
1032
1019
  }
1033
- function Q(z) {
1034
- j.value && z.preventDefault();
1020
+ function Q(A) {
1021
+ K.value && A.preventDefault();
1035
1022
  }
1036
1023
  Ue(() => {
1037
1024
  te(), window.addEventListener("beforeunload", Q);
1038
1025
  }), Ge(() => {
1039
- clearTimeout(we), window.removeEventListener("beforeunload", Q);
1040
- }), X(U, () => {
1026
+ clearTimeout(ye), window.removeEventListener("beforeunload", Q);
1027
+ }), X(P, () => {
1041
1028
  te();
1042
1029
  });
1043
1030
  const le = T(
1044
1031
  () => x.value ? [
1045
- { key: "save", label: n("page.save"), loading: v.value, run: () => {
1046
- he();
1032
+ { key: "save", label: n("page.save"), loading: f.value, run: () => {
1033
+ me();
1047
1034
  } },
1048
1035
  {
1049
1036
  key: "publish",
1050
1037
  label: n("page.publish"),
1051
1038
  primary: !0,
1052
- loading: g.value,
1053
- disabled: !p.value?.draft && !j.value,
1039
+ loading: k.value,
1040
+ disabled: !v.value?.draft && !K.value,
1054
1041
  run: () => {
1055
1042
  ie();
1056
1043
  }
1057
1044
  }
1058
1045
  ] : []
1059
1046
  );
1060
- return (z, h) => (i(), S("div", Kl, [
1061
- m.value || !p.value ? (i(), S(F, { key: 0 }, [
1047
+ return (A, h) => (i(), S("div", Kl, [
1048
+ g.value || !v.value ? (i(), S(j, { key: 0 }, [
1062
1049
  u(e(We), {
1063
1050
  class: "wx-block-editor__ghost-head",
1064
1051
  title: "",
1065
1052
  rows: 1
1066
1053
  }),
1067
- B("div", Yl, [
1054
+ E("div", Gl, [
1068
1055
  u(e(Be), null, {
1069
- default: c(() => [
1056
+ default: d(() => [
1070
1057
  u(e(We), { rows: 8 })
1071
1058
  ]),
1072
1059
  _: 1
1073
1060
  }),
1074
1061
  u(e(Be), null, {
1075
- default: c(() => [
1062
+ default: d(() => [
1076
1063
  u(e(We), { rows: 4 })
1077
1064
  ]),
1078
1065
  _: 1
1079
1066
  })
1080
1067
  ])
1081
- ], 64)) : (i(), S(F, { key: 1 }, [
1068
+ ], 64)) : (i(), S(j, { key: 1 }, [
1082
1069
  u(e(nl), {
1083
- title: f.title,
1070
+ title: m.title,
1084
1071
  back: t.base,
1085
1072
  "back-label": e(n)("page.back"),
1086
1073
  actions: le.value
1087
1074
  }, {
1088
- "title-after": c(() => [
1089
- x.value ? (i(), N(e(al), {
1075
+ "title-after": d(() => [
1076
+ x.value ? (i(), I(e(al), {
1090
1077
  key: 0,
1091
- name: f.title,
1078
+ name: m.title,
1092
1079
  placeholder: e(n)("page.title"),
1093
- onRename: h[0] || (h[0] = ($) => f.title = $)
1094
- }, null, 8, ["name", "placeholder"])) : P("", !0),
1095
- j.value ? (i(), N(e(ue), {
1080
+ onRename: h[0] || (h[0] = ($) => m.title = $)
1081
+ }, null, 8, ["name", "placeholder"])) : N("", !0),
1082
+ K.value ? (i(), I(e(ue), {
1096
1083
  key: 1,
1097
1084
  type: "primary",
1098
1085
  dot: ""
1099
1086
  }, {
1100
- default: c(() => [
1087
+ default: d(() => [
1101
1088
  W(_(e(n)("page.unsaved")), 1)
1102
1089
  ]),
1103
1090
  _: 1
1104
- })) : P("", !0),
1105
- p.value.draft ? (i(), N(e(ue), {
1091
+ })) : N("", !0),
1092
+ v.value.draft ? (i(), I(e(ue), {
1106
1093
  key: 2,
1107
1094
  type: "warning",
1108
1095
  dot: ""
1109
1096
  }, {
1110
- default: c(() => [
1111
- W(_(e(n)("page.draft", { number: p.value.draft.number })), 1)
1097
+ default: d(() => [
1098
+ W(_(e(n)("page.draft", { number: v.value.draft.number })), 1)
1112
1099
  ]),
1113
1100
  _: 1
1114
- })) : P("", !0),
1115
- p.value.published ? (i(), N(e(ue), {
1101
+ })) : N("", !0),
1102
+ v.value.published ? (i(), I(e(ue), {
1116
1103
  key: 3,
1117
1104
  type: "success",
1118
1105
  dot: ""
1119
1106
  }, {
1120
- default: c(() => [
1121
- W(_(e(n)("page.live", { number: p.value.published.number })), 1)
1107
+ default: d(() => [
1108
+ W(_(e(n)("page.live", { number: v.value.published.number })), 1)
1122
1109
  ]),
1123
1110
  _: 1
1124
- })) : (i(), N(e(ue), {
1111
+ })) : (i(), I(e(ue), {
1125
1112
  key: 4,
1126
1113
  type: "default"
1127
1114
  }, {
1128
- default: c(() => [
1115
+ default: d(() => [
1129
1116
  W(_(e(n)("page.never-published")), 1)
1130
1117
  ]),
1131
1118
  _: 1
1132
1119
  }))
1133
1120
  ]),
1134
- subtitle: c(() => [
1135
- B("code", null, _(f.slug), 1),
1136
- W(" · " + _(e(ze)(f.group, e(n))) + " · ", 1),
1137
- p.value.usage_count > 0 ? (i(), N(e(ul), {
1121
+ subtitle: d(() => [
1122
+ E("code", null, _(m.slug), 1),
1123
+ W(" · " + _(e(ze)(m.group, e(n))) + " · ", 1),
1124
+ v.value.usage_count > 0 ? (i(), I(e(ul), {
1138
1125
  key: 0,
1139
1126
  title: e(n)("page.usage"),
1140
1127
  width: 260,
1141
1128
  align: "start"
1142
1129
  }, {
1143
- trigger: c(() => [
1144
- B("button", Gl, _(e(at)(p.value.usage_count, e(n))), 1)
1130
+ trigger: d(() => [
1131
+ E("button", Yl, _(e(nt)(v.value.usage_count, e(n))), 1)
1145
1132
  ]),
1146
- default: c(() => [
1147
- B("div", Zl, [
1148
- (i(!0), S(F, null, ee(L.value, ($) => (i(), S("div", {
1133
+ default: d(() => [
1134
+ E("div", Zl, [
1135
+ (i(!0), S(j, null, ee(L.value, ($) => (i(), S("div", {
1149
1136
  key: `${$.model}:${$.id}`,
1150
1137
  class: "wx-block-editor__use"
1151
1138
  }, [
1152
- B("span", null, _($.title ?? `#${$.id}`), 1),
1153
- $.published ? P("", !0) : (i(), N(e(ue), {
1139
+ E("span", null, _($.title ?? `#${$.id}`), 1),
1140
+ $.published ? N("", !0) : (i(), I(e(ue), {
1154
1141
  key: 0,
1155
1142
  type: "warning",
1156
1143
  size: "sm"
1157
1144
  }, {
1158
- default: c(() => [
1145
+ default: d(() => [
1159
1146
  W(_(e(n)("page.unpublished-page")), 1)
1160
1147
  ]),
1161
1148
  _: 1
1162
1149
  }))
1163
1150
  ]))), 128)),
1164
- d.value.length > L.value.length ? (i(), N(e(q), {
1151
+ p.value.length > L.value.length ? (i(), I(e(F), {
1165
1152
  key: 0,
1166
1153
  size: "sm",
1167
1154
  tone: "muted"
1168
1155
  }, {
1169
- default: c(() => [
1170
- W(_(e(n)("page.usage-more", { count: d.value.length - L.value.length })), 1)
1156
+ default: d(() => [
1157
+ W(_(e(n)("page.usage-more", { count: p.value.length - L.value.length })), 1)
1171
1158
  ]),
1172
1159
  _: 1
1173
- })) : P("", !0)
1160
+ })) : N("", !0)
1174
1161
  ])
1175
1162
  ]),
1176
1163
  _: 1
1177
- }, 8, ["title"])) : (i(), S(F, { key: 1 }, [
1178
- W(_(e(at)(p.value.usage_count, e(n))), 1)
1164
+ }, 8, ["title"])) : (i(), S(j, { key: 1 }, [
1165
+ W(_(e(nt)(v.value.usage_count, e(n))), 1)
1179
1166
  ], 64))
1180
1167
  ]),
1181
1168
  _: 1
1182
1169
  }, 8, ["title", "back", "back-label", "actions"]),
1183
- V.value.editing ? P("", !0) : (i(), N(e(Vt), {
1170
+ V.value.editing ? N("", !0) : (i(), I(e(Vt), {
1184
1171
  key: 0,
1185
1172
  type: "info",
1186
1173
  variant: "soft",
1187
1174
  description: e(n)("page.editing-off")
1188
1175
  }, null, 8, ["description"])),
1189
- B("div", {
1190
- class: Se(["wx-block-editor__columns", { "is-alone": !Ee.value }])
1176
+ E("div", {
1177
+ class: $e(["wx-block-editor__columns", { "is-alone": !Ee.value }])
1191
1178
  }, [
1192
1179
  u(e(cl), {
1193
1180
  modelValue: C.value,
1194
1181
  "onUpdate:modelValue": h[14] || (h[14] = ($) => C.value = $),
1195
1182
  "keep-alive": ""
1196
1183
  }, {
1197
- default: c(() => [
1184
+ default: d(() => [
1198
1185
  u(e(Le), {
1199
1186
  value: "template",
1200
1187
  label: e(n)("page.tab-template")
1201
1188
  }, {
1202
- default: c(() => [
1203
- B("div", Ql, [
1204
- u(e(Fe), {
1189
+ default: d(() => [
1190
+ E("div", Ql, [
1191
+ u(e(je), {
1205
1192
  ref_key: "templateEditor",
1206
1193
  ref: H,
1207
1194
  modelValue: y.template,
@@ -1212,29 +1199,29 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1212
1199
  "max-height": "70vh",
1213
1200
  "line-wrapping": ""
1214
1201
  }, null, 8, ["modelValue", "readonly"]),
1215
- xe.value.length ? (i(), S("div", Xl, [
1216
- u(e(q), {
1202
+ _e.value.length ? (i(), S("div", Xl, [
1203
+ u(e(F), {
1217
1204
  size: "sm",
1218
1205
  tone: "muted"
1219
1206
  }, {
1220
- default: c(() => [
1207
+ default: d(() => [
1221
1208
  W(_(e(n)("page.insert-field")), 1)
1222
1209
  ]),
1223
1210
  _: 1
1224
1211
  }),
1225
- (i(!0), S(F, null, ee(xe.value, ($) => (i(), S("button", {
1212
+ (i(!0), S(j, null, ee(_e.value, ($) => (i(), S("button", {
1226
1213
  key: $,
1227
1214
  type: "button",
1228
1215
  class: "wx-block-editor__pill",
1229
1216
  disabled: !x.value,
1230
- onClick: (He) => fe($),
1231
- textContent: _(G($))
1217
+ onClick: (He) => ve($),
1218
+ textContent: _(Y($))
1232
1219
  }, null, 8, en))), 128))
1233
- ])) : P("", !0),
1220
+ ])) : N("", !0),
1234
1221
  u(vt, {
1235
1222
  file: "template",
1236
- lints: pe.value,
1237
- slug: f.slug,
1223
+ lints: Se.value,
1224
+ slug: m.slug,
1238
1225
  error: Ve.value
1239
1226
  }, null, 8, ["lints", "slug", "error"])
1240
1227
  ])
@@ -1245,9 +1232,9 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1245
1232
  value: "styles",
1246
1233
  label: e(n)("page.tab-styles")
1247
1234
  }, {
1248
- default: c(() => [
1249
- B("div", tn, [
1250
- u(e(Fe), {
1235
+ default: d(() => [
1236
+ E("div", tn, [
1237
+ u(e(je), {
1251
1238
  modelValue: y.styles,
1252
1239
  "onUpdate:modelValue": h[2] || (h[2] = ($) => y.styles = $),
1253
1240
  language: "css",
@@ -1257,8 +1244,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1257
1244
  }, null, 8, ["modelValue", "readonly"]),
1258
1245
  u(vt, {
1259
1246
  file: "styles",
1260
- lints: pe.value,
1261
- slug: f.slug
1247
+ lints: Se.value,
1248
+ slug: m.slug
1262
1249
  }, null, 8, ["lints", "slug"])
1263
1250
  ])
1264
1251
  ]),
@@ -1268,9 +1255,9 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1268
1255
  value: "script",
1269
1256
  label: e(n)("page.tab-script")
1270
1257
  }, {
1271
- default: c(() => [
1272
- B("div", ln, [
1273
- u(e(Fe), {
1258
+ default: d(() => [
1259
+ E("div", ln, [
1260
+ u(e(je), {
1274
1261
  "model-value": y.script ?? "",
1275
1262
  language: "javascript",
1276
1263
  readonly: !x.value,
@@ -1278,21 +1265,21 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1278
1265
  "max-height": "70vh",
1279
1266
  "onUpdate:modelValue": h[3] || (h[3] = ($) => y.script = $ || null)
1280
1267
  }, null, 8, ["model-value", "readonly"]),
1281
- B("div", nn, [
1282
- u(e(q), {
1268
+ E("div", nn, [
1269
+ u(e(F), {
1283
1270
  size: "sm",
1284
1271
  tone: "muted"
1285
1272
  }, {
1286
- default: c(() => [
1273
+ default: d(() => [
1287
1274
  W(_(e(n)("page.script-help")), 1)
1288
1275
  ]),
1289
1276
  _: 1
1290
1277
  }),
1291
- u(e(q), {
1278
+ u(e(F), {
1292
1279
  size: "sm",
1293
1280
  tone: "muted"
1294
1281
  }, {
1295
- default: c(() => [
1282
+ default: d(() => [
1296
1283
  W(_(V.value.provides.length ? e(n)("page.provides", { names: V.value.provides.join(", ") }) : e(n)("page.provides-none")), 1)
1297
1284
  ]),
1298
1285
  _: 1
@@ -1303,22 +1290,22 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1303
1290
  class: "wx-block-editor__examples",
1304
1291
  title: e(n)("page.examples")
1305
1292
  }, {
1306
- default: c(() => [
1307
- (i(!0), S(F, null, ee(w.value, ($) => (i(), S("div", {
1293
+ default: d(() => [
1294
+ (i(!0), S(j, null, ee(w.value, ($) => (i(), S("div", {
1308
1295
  key: $.title,
1309
1296
  class: "wx-block-editor__example"
1310
1297
  }, [
1311
- u(e(q), {
1298
+ u(e(F), {
1312
1299
  size: "sm",
1313
1300
  tone: "muted"
1314
1301
  }, {
1315
- default: c(() => [
1302
+ default: d(() => [
1316
1303
  W(_($.title), 1)
1317
1304
  ]),
1318
1305
  _: 2
1319
1306
  }, 1024),
1320
- B("pre", null, [
1321
- B("code", null, _($.code), 1)
1307
+ E("pre", null, [
1308
+ E("code", null, _($.code), 1)
1322
1309
  ])
1323
1310
  ]))), 128))
1324
1311
  ]),
@@ -1331,10 +1318,10 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1331
1318
  value: "fields",
1332
1319
  label: e(n)("page.tab-fields")
1333
1320
  }, {
1334
- default: c(() => [
1335
- B("div", an, [
1336
- B("div", on, [
1337
- u(e(Fe), {
1321
+ default: d(() => [
1322
+ E("div", an, [
1323
+ E("div", on, [
1324
+ u(e(je), {
1338
1325
  "model-value": R.value,
1339
1326
  language: "json",
1340
1327
  lint: "",
@@ -1343,31 +1330,31 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1343
1330
  "max-height": "70vh",
1344
1331
  "onUpdate:modelValue": Ce
1345
1332
  }, null, 8, ["model-value", "readonly"]),
1346
- B("div", sn, [
1347
- J.value ? (i(), N(e(q), {
1333
+ E("div", sn, [
1334
+ q.value ? (i(), I(e(F), {
1348
1335
  key: 0,
1349
1336
  size: "sm",
1350
1337
  tone: "danger"
1351
1338
  }, {
1352
- default: c(() => [
1353
- W(_(J.value), 1)
1339
+ default: d(() => [
1340
+ W(_(q.value), 1)
1354
1341
  ]),
1355
1342
  _: 1
1356
- })) : D("content.schema") ? (i(), N(e(q), {
1343
+ })) : M("content.schema") ? (i(), I(e(F), {
1357
1344
  key: 1,
1358
1345
  size: "sm",
1359
1346
  tone: "danger"
1360
1347
  }, {
1361
- default: c(() => [
1362
- W(_(D("content.schema")), 1)
1348
+ default: d(() => [
1349
+ W(_(M("content.schema")), 1)
1363
1350
  ]),
1364
1351
  _: 1
1365
- })) : (i(), N(e(q), {
1352
+ })) : (i(), I(e(F), {
1366
1353
  key: 2,
1367
1354
  size: "sm",
1368
1355
  tone: "muted"
1369
1356
  }, {
1370
- default: c(() => [
1357
+ default: d(() => [
1371
1358
  W(_(e(n)("page.fields-help")), 1)
1372
1359
  ]),
1373
1360
  _: 1
@@ -1382,8 +1369,8 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1382
1369
  class: "wx-block-editor__sample",
1383
1370
  title: e(n)("page.sample")
1384
1371
  }, {
1385
- default: c(() => [
1386
- y.schema.length ? (i(), N(e(zt), {
1372
+ default: d(() => [
1373
+ y.schema.length ? (i(), I(e(zt), {
1387
1374
  key: 0,
1388
1375
  modelValue: se.value,
1389
1376
  "onUpdate:modelValue": h[4] || (h[4] = ($) => se.value = $),
@@ -1393,7 +1380,7 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1393
1380
  can: e(o).can,
1394
1381
  disabled: !x.value,
1395
1382
  size: "sm"
1396
- }, null, 8, ["modelValue", "root", "types", "translate", "can", "disabled"])) : P("", !0)
1383
+ }, null, 8, ["modelValue", "root", "types", "translate", "can", "disabled"])) : N("", !0)
1397
1384
  ]),
1398
1385
  _: 1
1399
1386
  }, 8, ["title"])
@@ -1405,20 +1392,20 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1405
1392
  value: "settings",
1406
1393
  label: e(n)("page.tab-settings")
1407
1394
  }, {
1408
- default: c(() => [
1395
+ default: d(() => [
1409
1396
  u(e(Be), { class: "wx-block-editor__sheet" }, {
1410
- default: c(() => [
1411
- B("div", rn, [
1397
+ default: d(() => [
1398
+ E("div", rn, [
1412
1399
  u(e(ne), {
1413
1400
  label: e(n)("page.identifier"),
1414
1401
  help: e(n)("page.identifier-help"),
1415
- error: D("slug"),
1402
+ error: M("slug"),
1416
1403
  disabled: !x.value
1417
1404
  }, {
1418
- default: c(() => [
1405
+ default: d(() => [
1419
1406
  u(e(Pe), {
1420
- modelValue: f.slug,
1421
- "onUpdate:modelValue": h[5] || (h[5] = ($) => f.slug = $)
1407
+ modelValue: m.slug,
1408
+ "onUpdate:modelValue": h[5] || (h[5] = ($) => m.slug = $)
1422
1409
  }, null, 8, ["modelValue"])
1423
1410
  ]),
1424
1411
  _: 1
@@ -1426,14 +1413,14 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1426
1413
  u(e(ne), {
1427
1414
  label: e(n)("page.group"),
1428
1415
  help: e(n)("page.group-help"),
1429
- error: D("group"),
1416
+ error: M("group"),
1430
1417
  disabled: !x.value
1431
1418
  }, {
1432
- default: c(() => [
1419
+ default: d(() => [
1433
1420
  u(e(Et), {
1434
- modelValue: f.group,
1435
- "onUpdate:modelValue": h[6] || (h[6] = ($) => f.group = $),
1436
- options: ve.value
1421
+ modelValue: m.group,
1422
+ "onUpdate:modelValue": h[6] || (h[6] = ($) => m.group = $),
1423
+ options: pe.value
1437
1424
  }, null, 8, ["modelValue", "options"])
1438
1425
  ]),
1439
1426
  _: 1
@@ -1442,32 +1429,32 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1442
1429
  class: "is-wide",
1443
1430
  label: e(n)("page.description"),
1444
1431
  help: e(n)("page.description-help"),
1445
- error: D("description"),
1432
+ error: M("description"),
1446
1433
  disabled: !x.value
1447
1434
  }, {
1448
- default: c(() => [
1435
+ default: d(() => [
1449
1436
  u(e(dl), {
1450
- "model-value": f.description ?? "",
1437
+ "model-value": m.description ?? "",
1451
1438
  rows: 2,
1452
- "onUpdate:modelValue": h[7] || (h[7] = ($) => f.description = String($ ?? ""))
1439
+ "onUpdate:modelValue": h[7] || (h[7] = ($) => m.description = String($ ?? ""))
1453
1440
  }, null, 8, ["model-value"])
1454
1441
  ]),
1455
1442
  _: 1
1456
1443
  }, 8, ["label", "help", "error", "disabled"]),
1457
1444
  u(e(ne), {
1458
1445
  label: e(n)("page.icon"),
1459
- error: D("icon"),
1446
+ error: M("icon"),
1460
1447
  disabled: !x.value
1461
1448
  }, {
1462
- default: c(() => [
1449
+ default: d(() => [
1463
1450
  u(e(pl), {
1464
- "model-value": f.icon,
1451
+ "model-value": m.icon,
1465
1452
  clearable: "",
1466
1453
  placeholder: e(n)("page.icon-search"),
1467
1454
  "empty-text": e(n)("page.icon-none"),
1468
1455
  "unknown-text": e(n)("page.icon-unknown"),
1469
1456
  "clear-label": e(n)("page.icon-clear"),
1470
- "onUpdate:modelValue": h[8] || (h[8] = ($) => f.icon = $)
1457
+ "onUpdate:modelValue": h[8] || (h[8] = ($) => m.icon = $)
1471
1458
  }, null, 8, ["model-value", "placeholder", "empty-text", "unknown-text", "clear-label"])
1472
1459
  ]),
1473
1460
  _: 1
@@ -1475,13 +1462,13 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1475
1462
  u(e(ne), {
1476
1463
  label: e(n)("page.sort"),
1477
1464
  help: e(n)("page.sort-help"),
1478
- error: D("sort"),
1465
+ error: M("sort"),
1479
1466
  disabled: !x.value
1480
1467
  }, {
1481
- default: c(() => [
1468
+ default: d(() => [
1482
1469
  u(e(dt), {
1483
- modelValue: f.sort,
1484
- "onUpdate:modelValue": h[9] || (h[9] = ($) => f.sort = $)
1470
+ modelValue: m.sort,
1471
+ "onUpdate:modelValue": h[9] || (h[9] = ($) => m.sort = $)
1485
1472
  }, null, 8, ["modelValue"])
1486
1473
  ]),
1487
1474
  _: 1
@@ -1489,13 +1476,13 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1489
1476
  u(e(ne), {
1490
1477
  label: e(n)("page.allow"),
1491
1478
  help: e(n)("page.allow-help"),
1492
- error: D("allow"),
1479
+ error: M("allow"),
1493
1480
  disabled: !x.value
1494
1481
  }, {
1495
- default: c(() => [
1482
+ default: d(() => [
1496
1483
  u(e(pt), {
1497
- modelValue: f.allow,
1498
- "onUpdate:modelValue": h[10] || (h[10] = ($) => f.allow = $),
1484
+ modelValue: m.allow,
1485
+ "onUpdate:modelValue": h[10] || (h[10] = ($) => m.allow = $),
1499
1486
  "allow-create": ""
1500
1487
  }, null, 8, ["modelValue"])
1501
1488
  ]),
@@ -1504,13 +1491,13 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1504
1491
  u(e(ne), {
1505
1492
  label: e(n)("page.allowed-in"),
1506
1493
  help: e(n)("page.allowed-in-help"),
1507
- error: D("allowed_in"),
1494
+ error: M("allowed_in"),
1508
1495
  disabled: !x.value
1509
1496
  }, {
1510
- default: c(() => [
1497
+ default: d(() => [
1511
1498
  u(e(pt), {
1512
- modelValue: f.allowed_in,
1513
- "onUpdate:modelValue": h[11] || (h[11] = ($) => f.allowed_in = $),
1499
+ modelValue: m.allowed_in,
1500
+ "onUpdate:modelValue": h[11] || (h[11] = ($) => m.allowed_in = $),
1514
1501
  "allow-create": "",
1515
1502
  suggestions: ["root"]
1516
1503
  }, null, 8, ["modelValue"])
@@ -1520,14 +1507,14 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1520
1507
  u(e(ne), {
1521
1508
  label: e(n)("page.max-per-entity"),
1522
1509
  help: e(n)("page.max-per-entity-help"),
1523
- error: D("max_per_entity"),
1510
+ error: M("max_per_entity"),
1524
1511
  disabled: !x.value
1525
1512
  }, {
1526
- default: c(() => [
1513
+ default: d(() => [
1527
1514
  u(e(dt), {
1528
- "model-value": f.max_per_entity ?? void 0,
1515
+ "model-value": m.max_per_entity ?? void 0,
1529
1516
  min: 1,
1530
- "onUpdate:modelValue": h[12] || (h[12] = ($) => f.max_per_entity = $ ?? null)
1517
+ "onUpdate:modelValue": h[12] || (h[12] = ($) => m.max_per_entity = $ ?? null)
1531
1518
  }, null, 8, ["model-value"])
1532
1519
  ]),
1533
1520
  _: 1
@@ -1537,10 +1524,10 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1537
1524
  help: e(n)("page.enabled-help"),
1538
1525
  disabled: !x.value
1539
1526
  }, {
1540
- default: c(() => [
1527
+ default: d(() => [
1541
1528
  u(e(vl), {
1542
- modelValue: f.is_enabled,
1543
- "onUpdate:modelValue": h[13] || (h[13] = ($) => f.is_enabled = $)
1529
+ modelValue: m.is_enabled,
1530
+ "onUpdate:modelValue": h[13] || (h[13] = ($) => m.is_enabled = $)
1544
1531
  }, null, 8, ["modelValue"])
1545
1532
  ]),
1546
1533
  _: 1
@@ -1549,25 +1536,25 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1549
1536
  u(e(ce), {
1550
1537
  type: "danger",
1551
1538
  variant: "outline",
1552
- disabled: p.value.usage_count > 0,
1553
- onClick: _e
1539
+ disabled: v.value.usage_count > 0,
1540
+ onClick: we
1554
1541
  }, {
1555
- default: c(() => [
1542
+ default: d(() => [
1556
1543
  W(_(e(n)("page.delete")), 1)
1557
1544
  ]),
1558
1545
  _: 1
1559
1546
  }, 8, ["disabled"]),
1560
- p.value.usage_count > 0 ? (i(), N(e(q), {
1547
+ v.value.usage_count > 0 ? (i(), I(e(F), {
1561
1548
  key: 0,
1562
1549
  size: "sm",
1563
1550
  tone: "muted"
1564
1551
  }, {
1565
- default: c(() => [
1566
- W(_(p.value.usage_count === 1 ? e(n)("page.delete-used-one") : e(n)("page.delete-used", { count: p.value.usage_count })), 1)
1552
+ default: d(() => [
1553
+ W(_(v.value.usage_count === 1 ? e(n)("page.delete-used-one") : e(n)("page.delete-used", { count: v.value.usage_count })), 1)
1567
1554
  ]),
1568
1555
  _: 1
1569
- })) : P("", !0)
1570
- ])) : P("", !0)
1556
+ })) : N("", !0)
1557
+ ])) : N("", !0)
1571
1558
  ])
1572
1559
  ]),
1573
1560
  _: 1
@@ -1579,16 +1566,16 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1579
1566
  value: "history",
1580
1567
  label: e(n)("page.tab-history")
1581
1568
  }, {
1582
- default: c(() => [
1569
+ default: d(() => [
1583
1570
  u(e(Be), {
1584
1571
  class: "wx-block-editor__sheet",
1585
1572
  padding: "none"
1586
1573
  }, {
1587
- default: c(() => [
1574
+ default: d(() => [
1588
1575
  u(Sl, {
1589
- block: p.value,
1576
+ block: v.value,
1590
1577
  "can-manage": x.value,
1591
- onRestored: ye
1578
+ onRestored: ke
1592
1579
  }, null, 8, ["block", "can-manage"])
1593
1580
  ]),
1594
1581
  _: 1
@@ -1601,42 +1588,42 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1601
1588
  }, 8, ["modelValue"]),
1602
1589
  Jt(u(zl, {
1603
1590
  class: "wx-block-editor__stage",
1604
- html: k.html,
1605
- styles: k.styles,
1606
- script: k.script,
1607
- runtime: k.runtime,
1608
- stage: k.stage,
1609
- loading: k.loading
1591
+ html: B.html,
1592
+ styles: B.styles,
1593
+ script: B.script,
1594
+ runtime: B.runtime,
1595
+ stage: B.stage,
1596
+ loading: B.loading
1610
1597
  }, null, 8, ["html", "styles", "script", "runtime", "stage", "loading"]), [
1611
1598
  [Kt, Ee.value]
1612
1599
  ])
1613
1600
  ], 2),
1614
- x.value ? (i(), N(e(fl), { key: 1 }, {
1615
- default: c(() => [
1601
+ x.value ? (i(), I(e(fl), { key: 1 }, {
1602
+ default: d(() => [
1616
1603
  u(e(ce), {
1617
1604
  variant: "outline",
1618
- loading: v.value,
1619
- onClick: he
1605
+ loading: f.value,
1606
+ onClick: me
1620
1607
  }, {
1621
- default: c(() => [
1608
+ default: d(() => [
1622
1609
  W(_(e(n)("page.save")), 1)
1623
1610
  ]),
1624
1611
  _: 1
1625
1612
  }, 8, ["loading"]),
1626
1613
  u(e(ce), {
1627
1614
  type: "primary",
1628
- loading: g.value,
1629
- disabled: !p.value.draft && !j.value,
1615
+ loading: k.value,
1616
+ disabled: !v.value.draft && !K.value,
1630
1617
  onClick: ie
1631
1618
  }, {
1632
- default: c(() => [
1619
+ default: d(() => [
1633
1620
  W(_(e(n)("page.publish")), 1)
1634
1621
  ]),
1635
1622
  _: 1
1636
1623
  }, 8, ["loading", "disabled"])
1637
1624
  ]),
1638
1625
  _: 1
1639
- })) : P("", !0)
1626
+ })) : N("", !0)
1640
1627
  ], 64))
1641
1628
  ]));
1642
1629
  }
@@ -1651,33 +1638,33 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1651
1638
  height: { default: 120 }
1652
1639
  },
1653
1640
  setup(t) {
1654
- const l = t, o = M(null), a = Ze(o), s = T(() => a.value > 0 ? a.value / l.width : 0.2), r = T(
1641
+ const l = t, o = U(null), a = Ye(o), s = T(() => a.value > 0 ? a.value / l.width : 0.2), r = T(
1655
1642
  () => l.thumbnail ? Pt({ html: l.thumbnail.html, styles: l.thumbnail.styles }) : ""
1656
1643
  ), n = T(() => ({
1657
1644
  width: `${l.width}px`,
1658
1645
  height: `${Math.round(l.height / s.value)}px`,
1659
1646
  transform: `scale(${s.value})`
1660
1647
  }));
1661
- return (b, U) => (i(), S("div", {
1648
+ return (b, P) => (i(), S("div", {
1662
1649
  ref_key: "box",
1663
1650
  ref: o,
1664
1651
  class: "wx-block-thumb",
1665
- style: $e({ height: `${t.height}px` })
1652
+ style: xe({ height: `${t.height}px` })
1666
1653
  }, [
1667
1654
  t.thumbnail ? (i(), S("iframe", {
1668
1655
  key: 0,
1669
1656
  class: "wx-block-thumb__frame",
1670
1657
  srcdoc: r.value,
1671
- style: $e(n.value),
1658
+ style: xe(n.value),
1672
1659
  sandbox: "allow-same-origin",
1673
1660
  tabindex: "-1",
1674
1661
  "aria-hidden": "true"
1675
1662
  }, null, 12, pn)) : (i(), S("div", vn, [
1676
- u(e(ge), { name: "grid" })
1663
+ u(e(be), { name: "grid" })
1677
1664
  ]))
1678
1665
  ], 4));
1679
1666
  }
1680
- }), jt = /* @__PURE__ */ oe(fn, [["__scopeId", "data-v-615b818a"]]), mn = { class: "wx-block-picker" }, hn = {
1667
+ }), Ft = /* @__PURE__ */ oe(fn, [["__scopeId", "data-v-615b818a"]]), mn = { class: "wx-block-picker" }, hn = {
1681
1668
  key: 0,
1682
1669
  class: "wx-block-picker__group-title"
1683
1670
  }, bn = { class: "wx-block-picker__cards" }, gn = ["disabled", "title", "onClick"], kn = { class: "wx-block-picker__body" }, yn = { class: "wx-block-picker__title" }, wn = /* @__PURE__ */ ae({
@@ -1693,130 +1680,130 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1693
1680
  setup(t) {
1694
1681
  const l = t, { resolve: o, dismiss: a, open: s } = Bt();
1695
1682
  Re();
1696
- const r = de("webx-blocks"), n = M("");
1697
- function b(v) {
1683
+ const r = de("webx-blocks"), n = U("");
1684
+ function b(f) {
1698
1685
  if (l.parent === null)
1699
- return v.allowed_in === null || v.allowed_in.includes("root");
1700
- const g = l.allow ? l.allow.includes(v.slug) : l.parent.allow?.includes(v.slug) === !0, C = v.allowed_in === null || v.allowed_in.includes(l.parent.slug);
1701
- return g && C;
1702
- }
1703
- const U = T(
1704
- () => l.catalog.filter((v) => v.is_enabled && v.published !== null && b(v)).map((v) => {
1705
- const g = Nl(l.tree, v.slug), C = v.max_per_entity !== null && g >= v.max_per_entity;
1706
- return { type: v, reason: C ? r("field.limit-reached", { count: g }) : null };
1686
+ return f.allowed_in === null || f.allowed_in.includes("root");
1687
+ const k = l.allow ? l.allow.includes(f.slug) : l.parent.allow?.includes(f.slug) === !0, C = f.allowed_in === null || f.allowed_in.includes(l.parent.slug);
1688
+ return k && C;
1689
+ }
1690
+ const P = T(
1691
+ () => l.catalog.filter((f) => f.is_enabled && f.published !== null && b(f)).map((f) => {
1692
+ const k = Nl(l.tree, f.slug), C = f.max_per_entity !== null && k >= f.max_per_entity;
1693
+ return { type: f, reason: C ? r("field.limit-reached", { count: k }) : null };
1707
1694
  })
1708
- ), p = T(() => {
1709
- const v = n.value.trim().toLowerCase();
1710
- return v === "" ? U.value : U.value.filter(
1711
- ({ type: g }) => g.title.toLowerCase().includes(v) || g.slug.includes(v) || (g.description ?? "").toLowerCase().includes(v)
1695
+ ), v = T(() => {
1696
+ const f = n.value.trim().toLowerCase();
1697
+ return f === "" ? P.value : P.value.filter(
1698
+ ({ type: k }) => k.title.toLowerCase().includes(f) || k.slug.includes(f) || (k.description ?? "").toLowerCase().includes(f)
1712
1699
  );
1713
- }), d = T(() => {
1714
- const v = [...l.groups];
1715
- for (const { type: V } of p.value)
1716
- v.includes(V.group) || v.push(V.group);
1717
- const g = v.map((V) => ({
1700
+ }), p = T(() => {
1701
+ const f = [...l.groups];
1702
+ for (const { type: V } of v.value)
1703
+ f.includes(V.group) || f.push(V.group);
1704
+ const k = f.map((V) => ({
1718
1705
  id: V,
1719
1706
  label: ze(V, r),
1720
- options: p.value.filter((x) => x.type.group === V)
1707
+ options: v.value.filter((x) => x.type.group === V)
1721
1708
  })).filter((V) => V.options.length > 0);
1722
- return p.value.length <= 5 || n.value.trim() !== "" || g.length < 2 ? [{ id: "", label: "", options: p.value }] : g;
1723
- }), m = T(() => {
1709
+ return v.value.length <= 5 || n.value.trim() !== "" || k.length < 2 ? [{ id: "", label: "", options: v.value }] : k;
1710
+ }), g = T(() => {
1724
1711
  if (l.catalog.length === 0) return r("field.pick-none");
1725
- if (U.value.length === 0 && l.parent) {
1726
- const v = (l.allow ?? l.parent.allow ?? []).filter(
1727
- (g) => l.catalog.some((C) => C.slug === g)
1712
+ if (P.value.length === 0 && l.parent) {
1713
+ const f = (l.allow ?? l.parent.allow ?? []).filter(
1714
+ (k) => l.catalog.some((C) => C.slug === k)
1728
1715
  );
1729
- return v.length === 0 ? r("field.pick-nothing-allowed", { parent: l.parent.title }) : r("field.pick-limited", { parent: l.parent.title, types: v.join(", ") });
1716
+ return f.length === 0 ? r("field.pick-nothing-allowed", { parent: l.parent.title }) : r("field.pick-limited", { parent: l.parent.title, types: f.join(", ") });
1730
1717
  }
1731
1718
  return r("field.pick-empty");
1732
1719
  });
1733
- return (v, g) => {
1720
+ return (f, k) => {
1734
1721
  const C = xt("router-link");
1735
- return i(), N(e(Lt), {
1722
+ return i(), I(e(Lt), {
1736
1723
  open: e(s),
1737
- "onUpdate:open": g[2] || (g[2] = (V) => $t(s) ? s.value = V : null),
1724
+ "onUpdate:open": k[2] || (k[2] = (V) => $t(s) ? s.value = V : null),
1738
1725
  title: e(r)("field.pick"),
1739
1726
  width: 860
1740
1727
  }, {
1741
- footer: c(() => [
1728
+ footer: d(() => [
1742
1729
  u(e(ce), {
1743
1730
  variant: "outline",
1744
- onClick: g[1] || (g[1] = (V) => e(a)())
1731
+ onClick: k[1] || (k[1] = (V) => e(a)())
1745
1732
  }, {
1746
- default: c(() => [
1733
+ default: d(() => [
1747
1734
  W(_(e(r)("field.close")), 1)
1748
1735
  ]),
1749
1736
  _: 1
1750
1737
  })
1751
1738
  ]),
1752
- default: c(() => [
1753
- B("div", mn, [
1754
- U.value.length > 0 ? (i(), N(e(Pe), {
1739
+ default: d(() => [
1740
+ E("div", mn, [
1741
+ P.value.length > 0 ? (i(), I(e(Pe), {
1755
1742
  key: 0,
1756
1743
  modelValue: n.value,
1757
- "onUpdate:modelValue": g[0] || (g[0] = (V) => n.value = V),
1744
+ "onUpdate:modelValue": k[0] || (k[0] = (V) => n.value = V),
1758
1745
  placeholder: e(r)("field.search"),
1759
1746
  clearable: "",
1760
1747
  autofocus: ""
1761
- }, null, 8, ["modelValue", "placeholder"])) : P("", !0),
1762
- p.value.length === 0 ? (i(), N(e(Wt), {
1748
+ }, null, 8, ["modelValue", "placeholder"])) : N("", !0),
1749
+ v.value.length === 0 ? (i(), I(e(Wt), {
1763
1750
  key: 1,
1764
1751
  icon: "grid",
1765
- title: m.value,
1752
+ title: g.value,
1766
1753
  size: "sm"
1767
1754
  }, {
1768
- default: c(() => [
1769
- t.catalog.length === 0 && t.blocksPath ? (i(), N(C, {
1755
+ default: d(() => [
1756
+ t.catalog.length === 0 && t.blocksPath ? (i(), I(C, {
1770
1757
  key: 0,
1771
1758
  to: t.blocksPath
1772
1759
  }, {
1773
- default: c(() => [
1760
+ default: d(() => [
1774
1761
  W(_(e(r)("field.pick-none-link")), 1)
1775
1762
  ]),
1776
1763
  _: 1
1777
- }, 8, ["to"])) : P("", !0)
1764
+ }, 8, ["to"])) : N("", !0)
1778
1765
  ]),
1779
1766
  _: 1
1780
- }, 8, ["title"])) : P("", !0),
1781
- (i(!0), S(F, null, ee(d.value, (V) => (i(), S("section", {
1767
+ }, 8, ["title"])) : N("", !0),
1768
+ (i(!0), S(j, null, ee(p.value, (V) => (i(), S("section", {
1782
1769
  key: V.id,
1783
1770
  class: "wx-block-picker__group"
1784
1771
  }, [
1785
- V.label ? (i(), S("div", hn, _(V.label), 1)) : P("", !0),
1786
- B("div", bn, [
1787
- (i(!0), S(F, null, ee(V.options, (x) => (i(), S("button", {
1772
+ V.label ? (i(), S("div", hn, _(V.label), 1)) : N("", !0),
1773
+ E("div", bn, [
1774
+ (i(!0), S(j, null, ee(V.options, (x) => (i(), S("button", {
1788
1775
  key: x.type.id,
1789
1776
  type: "button",
1790
- class: Se(["wx-block-picker__card", { "is-disabled": x.reason !== null }]),
1777
+ class: $e(["wx-block-picker__card", { "is-disabled": x.reason !== null }]),
1791
1778
  disabled: x.reason !== null,
1792
1779
  title: x.reason ?? void 0,
1793
- onClick: (f) => e(o)(x.type)
1780
+ onClick: (m) => e(o)(x.type)
1794
1781
  }, [
1795
- u(jt, {
1782
+ u(Ft, {
1796
1783
  thumbnail: x.type.thumbnail,
1797
1784
  height: 96
1798
1785
  }, null, 8, ["thumbnail"]),
1799
- B("div", kn, [
1800
- B("div", yn, _(x.type.title), 1),
1801
- x.reason ? (i(), N(e(q), {
1786
+ E("div", kn, [
1787
+ E("div", yn, _(x.type.title), 1),
1788
+ x.reason ? (i(), I(e(F), {
1802
1789
  key: 0,
1803
1790
  size: "sm",
1804
1791
  tone: "warning"
1805
1792
  }, {
1806
- default: c(() => [
1793
+ default: d(() => [
1807
1794
  W(_(x.reason), 1)
1808
1795
  ]),
1809
1796
  _: 2
1810
- }, 1024)) : x.type.description ? (i(), N(e(q), {
1797
+ }, 1024)) : x.type.description ? (i(), I(e(F), {
1811
1798
  key: 1,
1812
1799
  size: "sm",
1813
1800
  tone: "muted"
1814
1801
  }, {
1815
- default: c(() => [
1802
+ default: d(() => [
1816
1803
  W(_(x.type.description), 1)
1817
1804
  ]),
1818
1805
  _: 2
1819
- }, 1024)) : P("", !0)
1806
+ }, 1024)) : N("", !0)
1820
1807
  ])
1821
1808
  ], 10, gn))), 128))
1822
1809
  ])
@@ -1837,18 +1824,18 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1837
1824
  },
1838
1825
  emits: ["select", "edit"],
1839
1826
  setup(t, { expose: l, emit: o }) {
1840
- const a = t, s = o, r = de("webx-blocks"), n = M(null), b = M(null), U = M(null), p = Ze(U), d = M(!1), m = M(!1), v = M(null), g = M(0), C = T(() => g.value > 0), V = T(() => [
1827
+ const a = t, s = o, r = de("webx-blocks"), n = U(null), b = U(null), P = U(null), v = Ye(P), p = U(!1), g = U(!1), f = U(null), k = U(0), C = T(() => k.value > 0), V = T(() => [
1841
1828
  { value: 1280, icon: "monitor", ariaLabel: r("field.width-desktop") },
1842
1829
  { value: 834, icon: "tablet", ariaLabel: r("field.width-tablet") },
1843
1830
  { value: 390, icon: "smartphone", ariaLabel: r("field.width-phone") }
1844
- ]), x = T(() => v.value !== null ? v.value : a.compact ? p.value > 0 && p.value < 560 ? 390 : 834 : 1280), f = T(() => p.value === 0 ? 1 : Math.min(1, p.value / x.value)), y = T(() => ({
1831
+ ]), x = T(() => f.value !== null ? f.value : a.compact ? v.value > 0 && v.value < 560 ? 390 : 834 : 1280), m = T(() => v.value === 0 ? 1 : Math.min(1, v.value / x.value)), y = T(() => ({
1845
1832
  width: `${x.value}px`,
1846
- transform: `scale(${f.value})`,
1847
- ...C.value ? { height: `${g.value}px` } : {}
1833
+ transform: `scale(${m.value})`,
1834
+ ...C.value ? { height: `${k.value}px` } : {}
1848
1835
  })), R = T(() => ({
1849
- width: `${Math.round(x.value * f.value)}px`,
1850
- ...C.value ? { height: `${Math.round(g.value * f.value)}px` } : {}
1851
- })), J = T(() => {
1836
+ width: `${Math.round(x.value * m.value)}px`,
1837
+ ...C.value ? { height: `${Math.round(k.value * m.value)}px` } : {}
1838
+ })), q = T(() => {
1852
1839
  if (!a.url) return "";
1853
1840
  try {
1854
1841
  return `${new URL(a.url, location.origin).pathname} · ${x.value} px`;
@@ -1856,113 +1843,113 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1856
1843
  return a.url;
1857
1844
  }
1858
1845
  });
1859
- function K() {
1846
+ function J() {
1860
1847
  try {
1861
1848
  return n.value?.contentDocument ?? null;
1862
1849
  } catch {
1863
1850
  return null;
1864
1851
  }
1865
1852
  }
1866
- let Z = null, E = null;
1867
- function k(I) {
1868
- I.documentElement.scrollTop !== 0 && (I.documentElement.scrollTop = 0);
1869
- }
1870
- function A() {
1871
- const I = K(), O = I?.body;
1872
- if (!O || !I?.defaultView) return;
1873
- k(I);
1874
- const H = I.defaultView.getComputedStyle(O), G = (parseFloat(H.marginTop) || 0) + (parseFloat(H.marginBottom) || 0), fe = Math.ceil(O.scrollHeight + G);
1875
- fe !== g.value && (g.value = fe, ve !== null && Yt(() => requestAnimationFrame(te)));
1876
- }
1877
- function j(I) {
1878
- E?.disconnect();
1879
- const O = I.defaultView;
1880
- !O || !I.body || (E = new O.ResizeObserver(A), E.observe(I.body), A());
1881
- }
1882
- function pe() {
1883
- m.value = !0;
1884
- const I = K();
1885
- I && (j(I), Z?.release(), Z = Tl(I, {
1853
+ let Z = null, c = null;
1854
+ function B(z) {
1855
+ z.documentElement.scrollTop !== 0 && (z.documentElement.scrollTop = 0);
1856
+ }
1857
+ function D() {
1858
+ const z = J(), O = z?.body;
1859
+ if (!O || !z?.defaultView) return;
1860
+ B(z);
1861
+ const H = z.defaultView.getComputedStyle(O), Y = (parseFloat(H.marginTop) || 0) + (parseFloat(H.marginBottom) || 0), ve = Math.ceil(O.scrollHeight + Y);
1862
+ ve !== k.value && (k.value = ve, pe !== null && Gt(() => requestAnimationFrame(te)));
1863
+ }
1864
+ function K(z) {
1865
+ c?.disconnect();
1866
+ const O = z.defaultView;
1867
+ !O || !z.body || (c = new O.ResizeObserver(D), c.observe(z.body), D());
1868
+ }
1869
+ function Se() {
1870
+ g.value = !0;
1871
+ const z = J();
1872
+ z && (K(z), Z?.release(), Z = Tl(z, {
1886
1873
  /* No guard against answering a click with a scroll: `bring` moves nothing that is already
1887
1874
  readable, and a block clicked at the very bottom of the window, half under the action
1888
1875
  bar, is exactly the one worth moving. */
1889
1876
  select: (O) => s("select", O)
1890
- }), lt(I, a.selected ?? null), xe(a.selected ?? null));
1877
+ }), et(z, a.selected ?? null), _e(a.selected ?? null));
1891
1878
  }
1892
- let ve = null, se = null;
1893
- function xe(I) {
1894
- I !== null && (ve = I, se !== null && clearTimeout(se), se = window.setTimeout(() => {
1895
- ve = null, se = null;
1879
+ let pe = null, se = null;
1880
+ function _e(z) {
1881
+ z !== null && (pe = z, se !== null && clearTimeout(se), se = window.setTimeout(() => {
1882
+ pe = null, se = null;
1896
1883
  }, 400), te());
1897
1884
  }
1898
- function Te(I) {
1885
+ function Te(z) {
1899
1886
  const O = n.value?.getBoundingClientRect();
1900
1887
  if (!O) return null;
1901
- const H = I.getBoundingClientRect();
1902
- return { top: O.top + H.top * f.value, height: H.height * f.value };
1903
- }
1904
- function ye() {
1905
- let I = n.value?.parentElement ?? null;
1906
- for (; I; ) {
1907
- const O = getComputedStyle(I).overflowY;
1908
- if ((O === "auto" || O === "scroll") && I.scrollHeight > I.clientHeight)
1909
- return I;
1910
- I = I.parentElement;
1888
+ const H = z.getBoundingClientRect();
1889
+ return { top: O.top + H.top * m.value, height: H.height * m.value };
1890
+ }
1891
+ function ke() {
1892
+ let z = n.value?.parentElement ?? null;
1893
+ for (; z; ) {
1894
+ const O = getComputedStyle(z).overflowY;
1895
+ if ((O === "auto" || O === "scroll") && z.scrollHeight > z.clientHeight)
1896
+ return z;
1897
+ z = z.parentElement;
1911
1898
  }
1912
1899
  return null;
1913
1900
  }
1914
1901
  function te() {
1915
- const I = K();
1916
- if (ve === null || !I) return;
1917
- k(I);
1918
- const O = Qe(I, ve), H = O ? Te(O) : null;
1902
+ const z = J();
1903
+ if (pe === null || !z) return;
1904
+ B(z);
1905
+ const O = at(z, pe), H = O ? Te(O) : null;
1919
1906
  if (!H) return;
1920
- const G = ye(), fe = G?.getBoundingClientRect(), he = b.value?.getBoundingClientRect().height ?? 0, ie = {
1921
- top: (fe?.top ?? 0) + he,
1922
- bottom: (fe ? fe.bottom : window.innerHeight) - he
1923
- }, _e = H.top + H.height, Ve = H.top < ie.top, Ee = H.height > ie.bottom - ie.top, w = Ve || Ee ? H.top - ie.top : _e > ie.bottom ? _e - ie.bottom : 0;
1924
- w !== 0 && (G ?? window).scrollBy({ top: w, behavior: "smooth" });
1925
- }
1926
- function Ce(I, O) {
1927
- const H = K();
1928
- if (!H || !m.value) return !1;
1929
- const G = Nt(H, I, O);
1930
- return G && lt(H, a.selected ?? null), G;
1907
+ const Y = ke(), ve = Y?.getBoundingClientRect(), me = b.value?.getBoundingClientRect().height ?? 0, ie = {
1908
+ top: (ve?.top ?? 0) + me,
1909
+ bottom: (ve ? ve.bottom : window.innerHeight) - me
1910
+ }, we = H.top + H.height, Ve = H.top < ie.top, Ee = H.height > ie.bottom - ie.top, w = Ve || Ee ? H.top - ie.top : we > ie.bottom ? we - ie.bottom : 0;
1911
+ w !== 0 && (Y ?? window).scrollBy({ top: w, behavior: "smooth" });
1912
+ }
1913
+ function Ce(z, O) {
1914
+ const H = J();
1915
+ if (!H || !g.value) return !1;
1916
+ const Y = Nt(H, z, O);
1917
+ return Y && et(H, a.selected ?? null), Y;
1931
1918
  }
1932
- function we() {
1933
- m.value = !1, E?.disconnect(), E = null, n.value && a.url && (n.value.src = a.url);
1919
+ function ye() {
1920
+ g.value = !1, c?.disconnect(), c = null, n.value && a.url && (n.value.src = a.url);
1934
1921
  }
1935
- function me(I) {
1936
- I.key === "Escape" && d.value && (d.value = !1, I.stopPropagation());
1922
+ function fe(z) {
1923
+ z.key === "Escape" && p.value && (p.value = !1, z.stopPropagation());
1937
1924
  }
1938
1925
  return X(
1939
1926
  () => a.selected,
1940
- (I) => {
1941
- const O = K();
1942
- !O || !m.value || (lt(O, I ?? null), xe(I ?? null));
1927
+ (z) => {
1928
+ const O = J();
1929
+ !O || !g.value || (et(O, z ?? null), _e(z ?? null));
1943
1930
  }
1944
- ), X(() => a.reload, we), X(
1931
+ ), X(() => a.reload, ye), X(
1945
1932
  () => a.url,
1946
- () => m.value = !1
1947
- ), Ue(() => window.addEventListener("keydown", me)), Ge(() => {
1948
- window.removeEventListener("keydown", me), se !== null && clearTimeout(se), E?.disconnect(), Z?.release();
1949
- }), l({ replace: Ce, refresh: we, open: () => d.value = !0 }), (I, O) => (i(), S("div", {
1950
- class: Se(["wx-blocks-preview", { "is-fullscreen": d.value, "is-grown": C.value, "is-compact": t.compact }]),
1951
- style: $e({ "--wx-preview-scale": f.value })
1933
+ () => g.value = !1
1934
+ ), Ue(() => window.addEventListener("keydown", fe)), Ge(() => {
1935
+ window.removeEventListener("keydown", fe), se !== null && clearTimeout(se), c?.disconnect(), Z?.release();
1936
+ }), l({ replace: Ce, refresh: ye, open: () => p.value = !0 }), (z, O) => (i(), S("div", {
1937
+ class: $e(["wx-blocks-preview", { "is-fullscreen": p.value, "is-grown": C.value, "is-compact": t.compact }]),
1938
+ style: xe({ "--wx-preview-scale": m.value })
1952
1939
  }, [
1953
- B("div", {
1940
+ E("div", {
1954
1941
  ref_key: "bar",
1955
1942
  ref: b,
1956
1943
  class: "wx-blocks-preview__bar"
1957
1944
  }, [
1958
- u(e(q), {
1945
+ u(e(F), {
1959
1946
  size: "xs",
1960
1947
  tone: "muted",
1961
1948
  class: "wx-blocks-preview__label",
1962
1949
  truncate: ""
1963
1950
  }, {
1964
- default: c(() => [
1965
- W(_(J.value), 1)
1951
+ default: d(() => [
1952
+ W(_(q.value), 1)
1966
1953
  ]),
1967
1954
  _: 1
1968
1955
  }),
@@ -1972,18 +1959,18 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1972
1959
  options: V.value,
1973
1960
  size: "sm",
1974
1961
  "aria-label": e(r)("field.width"),
1975
- "onUpdate:modelValue": O[0] || (O[0] = (H) => v.value = Number(H))
1962
+ "onUpdate:modelValue": O[0] || (O[0] = (H) => f.value = Number(H))
1976
1963
  }, null, 8, ["model-value", "options", "aria-label"]),
1977
- B("div", xn, [
1978
- t.compact ? (i(), N(e(Ie), {
1964
+ E("div", xn, [
1965
+ t.compact ? (i(), I(e(Ie), {
1979
1966
  key: 0,
1980
1967
  size: "sm",
1981
1968
  tone: "primary",
1982
1969
  icon: "edit",
1983
1970
  title: e(r)("field.blocks"),
1984
1971
  onClick: O[1] || (O[1] = (H) => s("edit"))
1985
- }, null, 8, ["title"])) : P("", !0),
1986
- t.url ? (i(), N(e(Ie), {
1972
+ }, null, 8, ["title"])) : N("", !0),
1973
+ t.url ? (i(), I(e(Ie), {
1987
1974
  key: 1,
1988
1975
  size: "sm",
1989
1976
  icon: "external-link",
@@ -1992,24 +1979,24 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
1992
1979
  href: t.url,
1993
1980
  target: "_blank",
1994
1981
  rel: "noopener"
1995
- }, null, 8, ["title", "href"])) : P("", !0),
1982
+ }, null, 8, ["title", "href"])) : N("", !0),
1996
1983
  u(e(Ie), {
1997
1984
  size: "sm",
1998
- icon: d.value ? "minimize" : "maximize",
1985
+ icon: p.value ? "minimize" : "maximize",
1999
1986
  tone: "neutral",
2000
- title: d.value ? e(r)("field.close") : e(r)("field.fullscreen"),
2001
- onClick: O[2] || (O[2] = (H) => d.value = !d.value)
1987
+ title: p.value ? e(r)("field.close") : e(r)("field.fullscreen"),
1988
+ onClick: O[2] || (O[2] = (H) => p.value = !p.value)
2002
1989
  }, null, 8, ["icon", "title"])
2003
1990
  ])
2004
1991
  ], 512),
2005
- B("div", {
1992
+ E("div", {
2006
1993
  ref_key: "box",
2007
- ref: U,
1994
+ ref: P,
2008
1995
  class: "wx-blocks-preview__ground"
2009
1996
  }, [
2010
- B("div", {
1997
+ E("div", {
2011
1998
  class: "wx-blocks-preview__clip",
2012
- style: $e(R.value)
1999
+ style: xe(R.value)
2013
2000
  }, [
2014
2001
  t.url ? (i(), S("iframe", {
2015
2002
  key: 0,
@@ -2017,10 +2004,10 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2017
2004
  ref: n,
2018
2005
  class: "wx-blocks-preview__frame",
2019
2006
  src: t.url,
2020
- style: $e(y.value),
2007
+ style: xe(y.value),
2021
2008
  title: e(r)("field.preview"),
2022
- onLoad: pe
2023
- }, null, 44, $n)) : P("", !0)
2009
+ onLoad: Se
2010
+ }, null, 44, $n)) : N("", !0)
2024
2011
  ], 4)
2025
2012
  ], 512)
2026
2013
  ], 6));
@@ -2042,131 +2029,131 @@ new Swiper(el.querySelector('.b-slider__viewport'), { loop: true })`
2042
2029
  emits: ["select", "add", "remove", "duplicate", "visibility", "reorder"],
2043
2030
  setup(t, { emit: l }) {
2044
2031
  const o = t, a = l, s = de("webx-blocks");
2045
- function r(d) {
2046
- return o.catalog.find((m) => m.slug === d.type) ?? null;
2032
+ function r(p) {
2033
+ return o.catalog.find((g) => g.slug === p.type) ?? null;
2047
2034
  }
2048
- function n(d) {
2049
- return r(d)?.title ?? d.type;
2035
+ function n(p) {
2036
+ return r(p)?.title ?? p.type;
2050
2037
  }
2051
- function b(d) {
2052
- const m = r(d);
2053
- return m?.content ? Dt(m.content.schema) : [];
2038
+ function b(p) {
2039
+ const g = r(p);
2040
+ return g?.content ? Dt(g.content.schema) : [];
2054
2041
  }
2055
- function U(d, m) {
2056
- const v = d.values[m.id];
2057
- return Array.isArray(v) ? v : [];
2042
+ function P(p, g) {
2043
+ const f = p.values[g.id];
2044
+ return Array.isArray(f) ? f : [];
2058
2045
  }
2059
- function p(d) {
2046
+ function v(p) {
2060
2047
  return [
2061
2048
  {
2062
2049
  key: "visibility",
2063
- icon: d.hidden === !0 ? "eye" : "eye-off",
2064
- label: d.hidden === !0 ? s("field.show") : s("field.hide"),
2065
- run: () => a("visibility", d.key, d.hidden !== !0)
2050
+ icon: p.hidden === !0 ? "eye" : "eye-off",
2051
+ label: p.hidden === !0 ? s("field.show") : s("field.hide"),
2052
+ run: () => a("visibility", p.key, p.hidden !== !0)
2066
2053
  },
2067
2054
  {
2068
2055
  key: "duplicate",
2069
2056
  icon: "copy",
2070
2057
  label: s("field.duplicate"),
2071
- run: () => a("duplicate", d.key)
2058
+ run: () => a("duplicate", p.key)
2072
2059
  },
2073
2060
  {
2074
2061
  key: "remove",
2075
2062
  icon: "trash",
2076
2063
  label: s("field.remove"),
2077
2064
  danger: !0,
2078
- run: () => a("remove", d.key)
2065
+ run: () => a("remove", p.key)
2079
2066
  }
2080
2067
  ];
2081
2068
  }
2082
- return (d, m) => {
2083
- const v = xt("blocks-tree", !0);
2084
- return i(), N(e(ml), {
2069
+ return (p, g) => {
2070
+ const f = xt("blocks-tree", !0);
2071
+ return i(), I(e(ml), {
2085
2072
  "model-value": t.nodes,
2086
2073
  "item-key": "key",
2087
- "item-label": (g) => n(g),
2074
+ "item-label": (k) => n(k),
2088
2075
  disabled: t.disabled,
2089
2076
  plain: "",
2090
2077
  size: "sm",
2091
2078
  "empty-text": t.depth === 0 ? e(s)("field.empty") : "",
2092
- class: Se(["wx-blocks-tree", { "is-nested": t.depth > 0 }]),
2093
- "onUpdate:modelValue": m[6] || (m[6] = (g) => a("reorder", t.parentKey, t.field, g))
2079
+ class: $e(["wx-blocks-tree", { "is-nested": t.depth > 0 }]),
2080
+ "onUpdate:modelValue": g[6] || (g[6] = (k) => a("reorder", t.parentKey, t.field, k))
2094
2081
  }, {
2095
- default: c(({ item: g }) => [
2096
- B("div", Cn, [
2097
- B("div", {
2098
- class: Se(["wx-blocks-tree__row", { "is-selected": t.selected === g.key, "is-hidden": g.hidden === !0 }]),
2082
+ default: d(({ item: k }) => [
2083
+ E("div", Cn, [
2084
+ E("div", {
2085
+ class: $e(["wx-blocks-tree__row", { "is-selected": t.selected === k.key, "is-hidden": k.hidden === !0 }]),
2099
2086
  role: "button",
2100
2087
  tabindex: "0",
2101
- onClick: (C) => a("select", g.key),
2088
+ onClick: (C) => a("select", k.key),
2102
2089
  onKeydown: [
2103
- ut(ct((C) => a("select", g.key), ["prevent"]), ["enter"]),
2104
- ut(ct((C) => a("select", g.key), ["prevent"]), ["space"])
2090
+ ut(ct((C) => a("select", k.key), ["prevent"]), ["enter"]),
2091
+ ut(ct((C) => a("select", k.key), ["prevent"]), ["space"])
2105
2092
  ]
2106
2093
  }, [
2107
- B("span", En, _(n(g)), 1),
2108
- r(g) ? r(g)?.draft ? (i(), S("span", {
2094
+ E("span", En, _(n(k)), 1),
2095
+ r(k) ? r(k)?.draft ? (i(), S("span", {
2109
2096
  key: 1,
2110
2097
  class: "wx-blocks-tree__flag is-warning",
2111
2098
  title: e(s)("field.draft-type")
2112
2099
  }, [
2113
- u(e(ge), { name: "warning" })
2114
- ], 8, Ln)) : r(g)?.is_enabled === !1 ? (i(), S("span", {
2100
+ u(e(be), { name: "warning" })
2101
+ ], 8, Ln)) : r(k)?.is_enabled === !1 ? (i(), S("span", {
2115
2102
  key: 2,
2116
2103
  class: "wx-blocks-tree__flag",
2117
2104
  title: e(s)("field.disabled-type")
2118
2105
  }, [
2119
- u(e(ge), { name: "lock" })
2120
- ], 8, Wn)) : P("", !0) : (i(), S("span", {
2106
+ u(e(be), { name: "lock" })
2107
+ ], 8, Wn)) : N("", !0) : (i(), S("span", {
2121
2108
  key: 0,
2122
2109
  class: "wx-blocks-tree__flag is-danger",
2123
- title: e(s)("field.unknown-type", { type: g.type })
2110
+ title: e(s)("field.unknown-type", { type: k.type })
2124
2111
  }, [
2125
- u(e(ge), { name: "close-circle" })
2112
+ u(e(be), { name: "close-circle" })
2126
2113
  ], 8, Bn)),
2127
- g.hidden === !0 ? (i(), S("span", {
2114
+ k.hidden === !0 ? (i(), S("span", {
2128
2115
  key: 3,
2129
2116
  class: "wx-blocks-tree__flag",
2130
2117
  title: e(s)("field.hidden-note")
2131
2118
  }, [
2132
- u(e(ge), { name: "eye-off" })
2133
- ], 8, An)) : P("", !0),
2134
- t.disabled ? P("", !0) : (i(), S("span", zn, [
2119
+ u(e(be), { name: "eye-off" })
2120
+ ], 8, An)) : N("", !0),
2121
+ t.disabled ? N("", !0) : (i(), S("span", zn, [
2135
2122
  u(e(sl), {
2136
- actions: p(g),
2137
- label: n(g)
2123
+ actions: v(k),
2124
+ label: n(k)
2138
2125
  }, null, 8, ["actions", "label"])
2139
2126
  ]))
2140
2127
  ], 42, Vn),
2141
- (i(!0), S(F, null, ee(b(g), (C) => (i(), S("div", {
2128
+ (i(!0), S(j, null, ee(b(k), (C) => (i(), S("div", {
2142
2129
  key: C.id,
2143
2130
  class: "wx-blocks-tree__kids"
2144
2131
  }, [
2145
- u(v, {
2146
- nodes: U(g, C),
2132
+ u(f, {
2133
+ nodes: P(k, C),
2147
2134
  catalog: t.catalog,
2148
- "parent-key": g.key,
2135
+ "parent-key": k.key,
2149
2136
  field: C.id,
2150
2137
  selected: t.selected,
2151
2138
  disabled: t.disabled,
2152
2139
  depth: t.depth + 1,
2153
- onSelect: m[0] || (m[0] = (V) => a("select", V)),
2154
- onAdd: m[1] || (m[1] = (V, x, f) => a("add", V, x, f)),
2155
- onRemove: m[2] || (m[2] = (V) => a("remove", V)),
2156
- onDuplicate: m[3] || (m[3] = (V) => a("duplicate", V)),
2157
- onVisibility: m[4] || (m[4] = (V, x) => a("visibility", V, x)),
2158
- onReorder: m[5] || (m[5] = (V, x, f) => a("reorder", V, x, f))
2140
+ onSelect: g[0] || (g[0] = (V) => a("select", V)),
2141
+ onAdd: g[1] || (g[1] = (V, x, m) => a("add", V, x, m)),
2142
+ onRemove: g[2] || (g[2] = (V) => a("remove", V)),
2143
+ onDuplicate: g[3] || (g[3] = (V) => a("duplicate", V)),
2144
+ onVisibility: g[4] || (g[4] = (V, x) => a("visibility", V, x)),
2145
+ onReorder: g[5] || (g[5] = (V, x, m) => a("reorder", V, x, m))
2159
2146
  }, null, 8, ["nodes", "catalog", "parent-key", "field", "selected", "disabled", "depth"]),
2160
- t.disabled ? P("", !0) : (i(), S("button", {
2147
+ t.disabled ? N("", !0) : (i(), S("button", {
2161
2148
  key: 0,
2162
2149
  type: "button",
2163
2150
  class: "wx-blocks-tree__add is-inner",
2164
- onClick: (V) => a("add", g.key, C.id, C)
2151
+ onClick: (V) => a("add", k.key, C.id, C)
2165
2152
  }, [
2166
2153
  W(" + " + _(e(s)("field.add-inside")), 1),
2167
- b(g).length > 1 ? (i(), S(F, { key: 0 }, [
2154
+ b(k).length > 1 ? (i(), S(j, { key: 0 }, [
2168
2155
  W(" · " + _(C.label ?? C.id), 1)
2169
- ], 64)) : P("", !0)
2156
+ ], 64)) : N("", !0)
2170
2157
  ], 8, In))
2171
2158
  ]))), 128))
2172
2159
  ])
@@ -2191,10 +2178,10 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2191
2178
  }, Dn = { class: "wx-blocks__panel-head" }, On = { class: "wx-blocks__panel-title" }, Rn = { class: "wx-blocks__tools" }, Hn = {
2192
2179
  key: 1,
2193
2180
  class: "wx-blocks__fields"
2194
- }, Fn = { class: "wx-blocks__panel-head" }, jn = { class: "wx-blocks__panel-title" }, qn = {
2181
+ }, jn = { class: "wx-blocks__panel-head" }, Fn = { class: "wx-blocks__panel-title" }, qn = {
2195
2182
  key: 0,
2196
2183
  class: "wx-blocks__trail"
2197
- }, Jn = ["onClick"], Kn = { class: "wx-blocks__panel-name" }, Yn = { class: "wx-blocks__panel-extra" }, Gn = { key: 0 }, Zn = { class: "wx-blocks__form" }, Qn = {
2184
+ }, Jn = ["onClick"], Kn = { class: "wx-blocks__panel-name" }, Gn = { class: "wx-blocks__panel-extra" }, Yn = { key: 0 }, Zn = { class: "wx-blocks__form" }, Qn = {
2198
2185
  key: 0,
2199
2186
  class: "wx-blocks__preview"
2200
2187
  }, Xn = /* @__PURE__ */ ae({
@@ -2217,37 +2204,37 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2217
2204
  }),
2218
2205
  emits: ["update:modelValue"],
2219
2206
  setup(t) {
2220
- const l = t, o = Gt(t, "modelValue"), a = qe(_t, !1);
2207
+ const l = t, o = Yt(t, "modelValue"), a = qe(_t, !1);
2221
2208
  St(_t, !0), Re();
2222
2209
  const s = de("webx-blocks"), r = De(), n = qe(il, null);
2223
2210
  let b = null;
2224
- const U = M([]), p = T(() => l.catalog ?? U.value), d = T(() => Array.isArray(o.value) ? o.value : []), m = M(null), v = T(() => m.value ? re(d.value, m.value) : null), g = T(
2225
- () => v.value ? p.value.find((w) => w.slug === v.value?.node.type) ?? null : null
2211
+ const P = U([]), v = T(() => l.catalog ?? P.value), p = T(() => Array.isArray(o.value) ? o.value : []), g = U(null), f = T(() => g.value ? re(p.value, g.value) : null), k = T(
2212
+ () => f.value ? v.value.find((w) => w.slug === f.value?.node.type) ?? null : null
2226
2213
  );
2227
2214
  function C(w) {
2228
- return p.value.find((L) => L.slug === w.type)?.title ?? w.type;
2215
+ return v.value.find((L) => L.slug === w.type)?.title ?? w.type;
2229
2216
  }
2230
2217
  const V = T(() => {
2231
2218
  const w = [];
2232
- return Oe(d.value, (L) => w.push(L.key)), w;
2219
+ return Oe(p.value, (L) => w.push(L.key)), w;
2233
2220
  }), x = T(() => {
2234
- const w = m.value ? V.value.indexOf(m.value) : -1;
2221
+ const w = g.value ? V.value.indexOf(g.value) : -1;
2235
2222
  return {
2236
2223
  previous: w > 0 ? V.value[w - 1] : null,
2237
2224
  next: w >= 0 && w < V.value.length - 1 ? V.value[w + 1] : null
2238
2225
  };
2239
- }), f = T(() => {
2226
+ }), m = T(() => {
2240
2227
  const w = [];
2241
- let L = v.value?.parent ?? null;
2228
+ let L = f.value?.parent ?? null;
2242
2229
  for (; L; )
2243
- w.unshift({ key: L.key, title: C(L) }), L = re(d.value, L.key)?.parent ?? null;
2230
+ w.unshift({ key: L.key, title: C(L) }), L = re(p.value, L.key)?.parent ?? null;
2244
2231
  return w;
2245
- }), y = qe(it, null), R = M(null), J = M(null), K = Ze(J), Z = T(() => y !== null && y.url.value !== null), E = T(() => Z.value && K.value > 0 && K.value <= 900), k = M(!1), A = T(() => {
2246
- if (!v.value) return;
2247
- const w = g.value?.title ?? v.value.node.type;
2248
- return [...f.value.map((L) => L.title), w].join(" / ");
2249
- }), j = T(
2250
- () => E.value ? {
2232
+ }), y = qe(it, null), R = U(null), q = U(null), J = Ye(q), Z = T(() => y !== null && y.url.value !== null), c = T(() => Z.value && J.value > 0 && J.value <= 900), B = U(!1), D = T(() => {
2233
+ if (!f.value) return;
2234
+ const w = k.value?.title ?? f.value.node.type;
2235
+ return [...m.value.map((L) => L.title), w].join(" / ");
2236
+ }), K = T(
2237
+ () => c.value ? {
2251
2238
  /* Up from the bottom, and not all the way: the strip of page left above it is what
2252
2239
  says the sheet is over the page rather than instead of it. No heading of its own —
2253
2240
  the panels inside carry theirs, and the × is the one thing the sheet has to add. */
@@ -2264,86 +2251,86 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2264
2251
  the blocks it is inside spelled out in front of it, because the trail that says so
2265
2252
  in the column is part of the heading this replaces. The tree keeps its own heading,
2266
2253
  which already says what it is and how many. */
2267
- title: A.value,
2268
- open: k.value,
2269
- "onUpdate:open": (w) => k.value = w
2254
+ title: D.value,
2255
+ open: B.value,
2256
+ "onUpdate:open": (w) => B.value = w
2270
2257
  } : {}
2271
- ), pe = T(
2258
+ ), Se = T(
2272
2259
  () => n?.state.manifest?.modules.find((w) => w.id === "blocks")?.meta?.groups ?? []
2273
- ), ve = Zt()?.type, se = T(() => l.context?.types ? l.context.types : n?.types ? { ...tt, ...n.types } : ve ? { ...tt, "wx-blocks": { component: ve, kind: "field", nested: !0 } } : tt), xe = T(
2260
+ ), pe = Zt()?.type, se = T(() => l.context?.types ? l.context.types : n?.types ? { ...Xe, ...n.types } : pe ? { ...Xe, "wx-blocks": { component: pe, kind: "field", nested: !0 } } : Xe), _e = T(
2274
2261
  () => l.context?.translate ?? n?.i18n.t ?? ((w) => w)
2275
- ), Te = T(() => l.context?.can ?? n?.can ?? (() => !0)), ye = At(_n);
2262
+ ), Te = T(() => l.context?.can ?? n?.can ?? (() => !0)), ke = At(_n);
2276
2263
  function te(w) {
2277
2264
  o.value = w;
2278
2265
  }
2279
- async function Ce(w, L, D) {
2280
- const Q = w ? re(d.value, w) : null, le = Q ? p.value.find((qt) => qt.slug === Q.node.type) ?? null : null, z = w === null ? l.allow : D?.props?.allow ?? null, h = w === null ? l.max : D?.props?.max ?? null, $ = w === null ? d.value : Q && L ? Q.node.values[L] ?? [] : [];
2266
+ async function Ce(w, L, M) {
2267
+ const Q = w ? re(p.value, w) : null, le = Q ? v.value.find((qt) => qt.slug === Q.node.type) ?? null : null, A = w === null ? l.allow : M?.props?.allow ?? null, h = w === null ? l.max : M?.props?.max ?? null, $ = w === null ? p.value : Q && L ? Q.node.values[L] ?? [] : [];
2281
2268
  if (h != null && $.length >= h) return;
2282
- const He = await ye({
2283
- catalog: p.value,
2269
+ const He = await ke({
2270
+ catalog: v.value,
2284
2271
  parent: le,
2285
- allow: z,
2286
- tree: d.value,
2287
- groups: pe.value,
2272
+ allow: A,
2273
+ tree: p.value,
2274
+ groups: Se.value,
2288
2275
  blocksPath: l.blocksPath
2289
2276
  });
2290
2277
  if (!He) return;
2291
- const rt = Il(He.slug, we(He));
2292
- te(kt(d.value, w, L, $.length, rt)), m.value = rt.key;
2278
+ const rt = Il(He.slug, ye(He));
2279
+ te(kt(p.value, w, L, $.length, rt)), g.value = rt.key;
2293
2280
  }
2294
- function we(w) {
2295
- const L = w.content?.sample ?? {}, D = {};
2281
+ function ye(w) {
2282
+ const L = w.content?.sample ?? {}, M = {};
2296
2283
  for (const [Q, le] of Object.entries(L))
2297
- (!Array.isArray(le) || le.length === 0 || typeof le[0] != "object") && (D[Q] = le);
2298
- return D;
2284
+ (!Array.isArray(le) || le.length === 0 || typeof le[0] != "object") && (M[Q] = le);
2285
+ return M;
2299
2286
  }
2300
- async function me(w) {
2301
- const L = re(d.value, w);
2287
+ async function fe(w) {
2288
+ const L = re(p.value, w);
2302
2289
  if (!L) return;
2303
- const D = Pl(L.node);
2304
- await Ye({
2290
+ const M = Pl(L.node);
2291
+ await Ke({
2305
2292
  title: s("field.remove-title", {
2306
- title: p.value.find((le) => le.slug === L.node.type)?.title ?? L.node.type
2293
+ title: v.value.find((le) => le.slug === L.node.type)?.title ?? L.node.type
2307
2294
  }),
2308
- message: D > 0 ? s("field.remove-text", { count: D }) : s("field.remove-alone"),
2295
+ message: M > 0 ? s("field.remove-text", { count: M }) : s("field.remove-alone"),
2309
2296
  confirmText: s("field.remove"),
2310
2297
  cancelText: s("page.cancel"),
2311
2298
  tone: "danger"
2312
- }) && (m.value === w && (m.value = null), te(Dl(d.value, w)));
2299
+ }) && (g.value === w && (g.value = null), te(Dl(p.value, w)));
2313
2300
  }
2314
- function I(w) {
2315
- const L = re(d.value, w);
2301
+ function z(w) {
2302
+ const L = re(p.value, w);
2316
2303
  if (!L) return;
2317
- const D = Ot(L.node);
2318
- te(kt(d.value, L.parent?.key ?? null, L.field, L.index + 1, D)), m.value = D.key;
2304
+ const M = Ot(L.node);
2305
+ te(kt(p.value, L.parent?.key ?? null, L.field, L.index + 1, M)), g.value = M.key;
2319
2306
  }
2320
2307
  function O(w, L) {
2321
- te(Ul(d.value, w, L));
2308
+ te(Ul(p.value, w, L));
2322
2309
  }
2323
- function H(w, L, D) {
2324
- te(Rl(d.value, w, L, D));
2310
+ function H(w, L, M) {
2311
+ te(Rl(p.value, w, L, M));
2325
2312
  }
2326
- function G(w) {
2327
- m.value = m.value === w ? null : w;
2313
+ function Y(w) {
2314
+ g.value = g.value === w ? null : w;
2328
2315
  }
2329
- function fe(w) {
2330
- w === null || !re(d.value, w) || (m.value = w, E.value && (k.value = !0));
2316
+ function ve(w) {
2317
+ w === null || !re(p.value, w) || (g.value = w, c.value && (B.value = !0));
2331
2318
  }
2332
- function he() {
2333
- m.value = null;
2319
+ function me() {
2320
+ g.value = null;
2334
2321
  }
2335
2322
  function ie(w) {
2336
- m.value && te(Ol(d.value, m.value, w));
2323
+ g.value && te(Ol(p.value, g.value, w));
2337
2324
  }
2338
- let _e;
2325
+ let we;
2339
2326
  X(
2340
- () => v.value?.node.values,
2327
+ () => f.value?.node.values,
2341
2328
  (w, L) => {
2342
- if (!w || !L || !g.value || !b || !y) return;
2343
- const D = m.value, Q = g.value.id;
2344
- clearTimeout(_e), _e = setTimeout(() => {
2345
- !D || !b || b.render(Q, { values: w, key: D }).then((le) => {
2346
- R.value?.replace(D, le.html) || R.value?.refresh();
2329
+ if (!w || !L || !k.value || !b || !y) return;
2330
+ const M = g.value, Q = k.value.id;
2331
+ clearTimeout(we), we = setTimeout(() => {
2332
+ !M || !b || b.render(Q, { values: w, key: M }).then((le) => {
2333
+ R.value?.replace(M, le.html) || R.value?.refresh();
2347
2334
  }).catch(() => {
2348
2335
  });
2349
2336
  }, 300);
@@ -2351,29 +2338,29 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2351
2338
  { deep: !0 }
2352
2339
  );
2353
2340
  function Ve(w) {
2354
- w.key === "Escape" && m.value && he();
2341
+ w.key === "Escape" && g.value && me();
2355
2342
  }
2356
2343
  Ue(async () => {
2357
2344
  if (window.addEventListener("keydown", Ve), l.catalog === null && n) {
2358
2345
  b = Ae(n);
2359
2346
  try {
2360
- U.value = await b.catalog();
2347
+ P.value = await b.catalog();
2361
2348
  } catch (w) {
2362
- Y.danger(r(w));
2349
+ G.danger(r(w));
2363
2350
  }
2364
2351
  } else n && (b = Ae(n));
2365
2352
  }), Ge(() => {
2366
- clearTimeout(_e), window.removeEventListener("keydown", Ve);
2353
+ clearTimeout(we), window.removeEventListener("keydown", Ve);
2367
2354
  });
2368
2355
  const Ee = T(
2369
- () => g.value?.content ? st(g.value.content.schema) : []
2356
+ () => k.value?.content ? st(k.value.content.schema) : []
2370
2357
  );
2371
2358
  return (w, L) => e(a) ? (i(), S("div", Un, [
2372
- u(e(q), {
2359
+ u(e(F), {
2373
2360
  size: "sm",
2374
2361
  tone: "muted"
2375
2362
  }, {
2376
- default: c(() => [
2363
+ default: d(() => [
2377
2364
  W(_(e(s)("field.nested-note")), 1)
2378
2365
  ]),
2379
2366
  _: 1
@@ -2381,95 +2368,95 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2381
2368
  ])) : (i(), S("div", {
2382
2369
  key: 1,
2383
2370
  ref_key: "host",
2384
- ref: J,
2385
- class: Se(["wx-blocks-host", { "is-compact": E.value }])
2371
+ ref: q,
2372
+ class: $e(["wx-blocks-host", { "is-compact": c.value }])
2386
2373
  }, [
2387
- B("div", {
2388
- class: Se(["wx-blocks", {
2389
- "is-editing": v.value !== null,
2374
+ E("div", {
2375
+ class: $e(["wx-blocks", {
2376
+ "is-editing": f.value !== null,
2390
2377
  "has-preview": e(y) !== null && e(y).url.value !== null
2391
2378
  }])
2392
2379
  }, [
2393
- (i(), N(Qt(E.value ? e(hl) : "div"), Xt(j.value, { class: "wx-blocks__side" }), {
2394
- default: c(() => [
2395
- v.value ? P("", !0) : (i(), S("div", Mn, [
2396
- B("div", Dn, [
2397
- B("span", On, _(e(s)("field.blocks")), 1),
2398
- u(e(q), {
2380
+ (i(), I(Qt(c.value ? e(hl) : "div"), Xt(K.value, { class: "wx-blocks__side" }), {
2381
+ default: d(() => [
2382
+ f.value ? N("", !0) : (i(), S("div", Mn, [
2383
+ E("div", Dn, [
2384
+ E("span", On, _(e(s)("field.blocks")), 1),
2385
+ u(e(F), {
2399
2386
  size: "sm",
2400
2387
  tone: "muted"
2401
2388
  }, {
2402
- default: c(() => [
2403
- W(_(d.value.length), 1)
2389
+ default: d(() => [
2390
+ W(_(p.value.length), 1)
2404
2391
  ]),
2405
2392
  _: 1
2406
2393
  })
2407
2394
  ]),
2408
2395
  u(Pn, {
2409
- nodes: d.value,
2410
- catalog: p.value,
2411
- selected: m.value,
2396
+ nodes: p.value,
2397
+ catalog: v.value,
2398
+ selected: g.value,
2412
2399
  disabled: t.disabled,
2413
- onSelect: G,
2400
+ onSelect: Y,
2414
2401
  onAdd: Ce,
2415
- onRemove: me,
2416
- onDuplicate: I,
2402
+ onRemove: fe,
2403
+ onDuplicate: z,
2417
2404
  onVisibility: O,
2418
2405
  onReorder: H
2419
2406
  }, null, 8, ["nodes", "catalog", "selected", "disabled"]),
2420
- B("div", Rn, [
2421
- !t.disabled && (t.max === null || d.value.length < t.max) ? (i(), N(e(ce), {
2407
+ E("div", Rn, [
2408
+ !t.disabled && (t.max === null || p.value.length < t.max) ? (i(), I(e(ce), {
2422
2409
  key: 0,
2423
2410
  variant: "outline",
2424
2411
  icon: "plus",
2425
2412
  class: "wx-blocks__add",
2426
- onClick: L[0] || (L[0] = (D) => Ce(null, null, null))
2413
+ onClick: L[0] || (L[0] = (M) => Ce(null, null, null))
2427
2414
  }, {
2428
- default: c(() => [
2415
+ default: d(() => [
2429
2416
  W(_(e(s)("field.add")), 1)
2430
2417
  ]),
2431
2418
  _: 1
2432
- })) : P("", !0),
2433
- !E.value && e(y) && e(y).url.value ? (i(), N(e(ce), {
2419
+ })) : N("", !0),
2420
+ !c.value && e(y) && e(y).url.value ? (i(), I(e(ce), {
2434
2421
  key: 1,
2435
2422
  variant: "outline",
2436
2423
  icon: "eye",
2437
2424
  class: "wx-blocks__preview-button",
2438
- onClick: L[1] || (L[1] = (D) => R.value?.open())
2425
+ onClick: L[1] || (L[1] = (M) => R.value?.open())
2439
2426
  }, {
2440
- default: c(() => [
2427
+ default: d(() => [
2441
2428
  W(_(e(s)("field.preview")), 1)
2442
2429
  ]),
2443
2430
  _: 1
2444
- })) : P("", !0)
2431
+ })) : N("", !0)
2445
2432
  ])
2446
2433
  ])),
2447
- v.value ? (i(), S("div", Hn, [
2448
- B("div", Fn, [
2449
- B("span", jn, [
2450
- f.value.length ? (i(), S("span", qn, [
2451
- (i(!0), S(F, null, ee(f.value, (D) => (i(), S(F, {
2452
- key: D.key
2434
+ f.value ? (i(), S("div", Hn, [
2435
+ E("div", jn, [
2436
+ E("span", Fn, [
2437
+ m.value.length ? (i(), S("span", qn, [
2438
+ (i(!0), S(j, null, ee(m.value, (M) => (i(), S(j, {
2439
+ key: M.key
2453
2440
  }, [
2454
- B("button", {
2441
+ E("button", {
2455
2442
  type: "button",
2456
2443
  class: "wx-blocks__trail-step",
2457
- onClick: (Q) => G(D.key)
2458
- }, _(D.title), 9, Jn),
2459
- u(e(ge), { name: "chevron-right" })
2444
+ onClick: (Q) => Y(M.key)
2445
+ }, _(M.title), 9, Jn),
2446
+ u(e(be), { name: "chevron-right" })
2460
2447
  ], 64))), 128))
2461
- ])) : P("", !0),
2462
- B("span", Kn, _(g.value?.title ?? v.value.node.type), 1)
2448
+ ])) : N("", !0),
2449
+ E("span", Kn, _(k.value?.title ?? f.value.node.type), 1)
2463
2450
  ]),
2464
- B("span", Yn, [
2465
- E.value ? P("", !0) : (i(), S("code", Gn, _(v.value.node.type), 1)),
2451
+ E("span", Gn, [
2452
+ c.value ? N("", !0) : (i(), S("code", Yn, _(f.value.node.type), 1)),
2466
2453
  u(e(Ie), {
2467
2454
  size: "sm",
2468
2455
  tone: "neutral",
2469
2456
  icon: "chevron-up",
2470
2457
  title: e(s)("field.previous"),
2471
2458
  disabled: x.value.previous === null,
2472
- onClick: L[2] || (L[2] = (D) => x.value.previous && G(x.value.previous))
2459
+ onClick: L[2] || (L[2] = (M) => x.value.previous && Y(x.value.previous))
2473
2460
  }, null, 8, ["title", "disabled"]),
2474
2461
  u(e(Ie), {
2475
2462
  size: "sm",
@@ -2477,51 +2464,51 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2477
2464
  icon: "chevron-down",
2478
2465
  title: e(s)("field.next"),
2479
2466
  disabled: x.value.next === null,
2480
- onClick: L[3] || (L[3] = (D) => x.value.next && G(x.value.next))
2467
+ onClick: L[3] || (L[3] = (M) => x.value.next && Y(x.value.next))
2481
2468
  }, null, 8, ["title", "disabled"]),
2482
- !E.value && e(y) && e(y).url.value ? (i(), N(e(ce), {
2469
+ !c.value && e(y) && e(y).url.value ? (i(), I(e(ce), {
2483
2470
  key: 1,
2484
2471
  size: "sm",
2485
2472
  variant: "outline",
2486
2473
  icon: "eye",
2487
2474
  class: "wx-blocks__preview-button",
2488
2475
  "aria-label": e(s)("field.preview"),
2489
- onClick: L[4] || (L[4] = (D) => R.value?.open())
2490
- }, null, 8, ["aria-label"])) : P("", !0),
2476
+ onClick: L[4] || (L[4] = (M) => R.value?.open())
2477
+ }, null, 8, ["aria-label"])) : N("", !0),
2491
2478
  u(e(ce), {
2492
2479
  size: "sm",
2493
2480
  variant: "outline",
2494
- onClick: he
2481
+ onClick: me
2495
2482
  }, {
2496
- default: c(() => [
2497
- W(_(E.value ? e(s)("field.done") : `${e(s)("field.done")} · Esc`), 1)
2483
+ default: d(() => [
2484
+ W(_(c.value ? e(s)("field.done") : `${e(s)("field.done")} · Esc`), 1)
2498
2485
  ]),
2499
2486
  _: 1
2500
2487
  })
2501
2488
  ])
2502
2489
  ]),
2503
- B("div", Zn, [
2504
- g.value?.content ? (i(), N(e(zt), {
2505
- key: v.value.node.key,
2506
- "model-value": v.value.node.values,
2490
+ E("div", Zn, [
2491
+ k.value?.content ? (i(), I(e(zt), {
2492
+ key: f.value.node.key,
2493
+ "model-value": f.value.node.values,
2507
2494
  root: Ee.value,
2508
2495
  types: se.value,
2509
- translate: xe.value,
2496
+ translate: _e.value,
2510
2497
  can: Te.value,
2511
2498
  disabled: t.disabled,
2512
2499
  "onUpdate:modelValue": ie
2513
- }, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (i(), N(e(q), {
2500
+ }, null, 8, ["model-value", "root", "types", "translate", "can", "disabled"])) : (i(), I(e(F), {
2514
2501
  key: 1,
2515
2502
  size: "sm",
2516
2503
  tone: "danger"
2517
2504
  }, {
2518
- default: c(() => [
2519
- W(_(e(s)("field.unknown-type", { type: v.value.node.type })), 1)
2505
+ default: d(() => [
2506
+ W(_(e(s)("field.unknown-type", { type: f.value.node.type })), 1)
2520
2507
  ]),
2521
2508
  _: 1
2522
2509
  }))
2523
2510
  ])
2524
- ])) : P("", !0)
2511
+ ])) : N("", !0)
2525
2512
  ]),
2526
2513
  _: 1
2527
2514
  }, 16)),
@@ -2530,13 +2517,13 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2530
2517
  ref_key: "previewEl",
2531
2518
  ref: R,
2532
2519
  url: e(y).url.value,
2533
- selected: m.value,
2520
+ selected: g.value,
2534
2521
  reload: e(y).reload?.value ?? 0,
2535
- compact: E.value,
2536
- onSelect: fe,
2537
- onEdit: L[5] || (L[5] = (D) => k.value = !0)
2522
+ compact: c.value,
2523
+ onSelect: ve,
2524
+ onEdit: L[5] || (L[5] = (M) => B.value = !0)
2538
2525
  }, null, 8, ["url", "selected", "reload", "compact"])
2539
- ])) : P("", !0)
2526
+ ])) : N("", !0)
2540
2527
  ], 2)
2541
2528
  ], 2));
2542
2529
  }
@@ -2553,57 +2540,57 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2553
2540
  class: "wx-block-card",
2554
2541
  onClick: r[0] || (r[0] = (n) => o("open", t.block))
2555
2542
  }, [
2556
- u(jt, {
2543
+ u(Ft, {
2557
2544
  thumbnail: t.block.thumbnail,
2558
2545
  height: 120
2559
2546
  }, null, 8, ["thumbnail"]),
2560
- B("div", ta, [
2561
- B("div", la, _(t.block.title), 1),
2562
- u(e(q), {
2547
+ E("div", ta, [
2548
+ E("div", la, _(t.block.title), 1),
2549
+ u(e(F), {
2563
2550
  size: "sm",
2564
2551
  tone: "muted"
2565
2552
  }, {
2566
- default: c(() => [
2567
- B("code", null, _(t.block.slug), 1),
2568
- W(" · " + _(e(at)(t.block.usage_count, e(a))), 1)
2553
+ default: d(() => [
2554
+ E("code", null, _(t.block.slug), 1),
2555
+ W(" · " + _(e(nt)(t.block.usage_count, e(a))), 1)
2569
2556
  ]),
2570
2557
  _: 1
2571
2558
  }),
2572
- B("div", na, [
2573
- t.block.draft ? (i(), N(e(ue), {
2559
+ E("div", na, [
2560
+ t.block.draft ? (i(), I(e(ue), {
2574
2561
  key: 0,
2575
2562
  type: "warning",
2576
2563
  dot: ""
2577
2564
  }, {
2578
- default: c(() => [
2565
+ default: d(() => [
2579
2566
  W(_(e(a)("page.draft", { number: t.block.draft.number })), 1)
2580
2567
  ]),
2581
2568
  _: 1
2582
- })) : P("", !0),
2583
- t.block.published ? (i(), N(e(ue), {
2569
+ })) : N("", !0),
2570
+ t.block.published ? (i(), I(e(ue), {
2584
2571
  key: 1,
2585
2572
  type: "success",
2586
2573
  dot: ""
2587
2574
  }, {
2588
- default: c(() => [
2575
+ default: d(() => [
2589
2576
  W(_(e(a)("page.live", { number: t.block.published.number })), 1)
2590
2577
  ]),
2591
2578
  _: 1
2592
- })) : (i(), N(e(ue), {
2579
+ })) : (i(), I(e(ue), {
2593
2580
  key: 2,
2594
2581
  type: "default"
2595
2582
  }, {
2596
- default: c(() => [
2583
+ default: d(() => [
2597
2584
  W(_(e(a)("page.never-published")), 1)
2598
2585
  ]),
2599
2586
  _: 1
2600
2587
  })),
2601
- t.block.is_enabled ? P("", !0) : (i(), N(e(ue), {
2588
+ t.block.is_enabled ? N("", !0) : (i(), I(e(ue), {
2602
2589
  key: 3,
2603
2590
  type: "default",
2604
2591
  variant: "outline"
2605
2592
  }, {
2606
- default: c(() => [
2593
+ default: d(() => [
2607
2594
  W(_(e(a)("page.hidden")), 1)
2608
2595
  ]),
2609
2596
  _: 1
@@ -2617,56 +2604,56 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2617
2604
  setup(t) {
2618
2605
  const { resolve: l, dismiss: o, open: a } = Bt(), s = Me(), r = Ae(s);
2619
2606
  Re();
2620
- const n = de("webx-blocks"), b = De(), U = T(() => s.state.manifest?.modules.find((y) => y.id === "blocks")?.meta?.groups ?? ["content"]), p = M({ title: "", slug: "", group: U.value[0] ?? "content" }), d = M({}), m = M(!1), v = M(!1), g = T(
2621
- () => U.value.map((f) => ({ value: f, label: ze(f, n) }))
2607
+ const n = de("webx-blocks"), b = De(), P = T(() => s.state.manifest?.modules.find((y) => y.id === "blocks")?.meta?.groups ?? ["content"]), v = U({ title: "", slug: "", group: P.value[0] ?? "content" }), p = U({}), g = U(!1), f = U(!1), k = T(
2608
+ () => P.value.map((m) => ({ value: m, label: ze(m, n) }))
2622
2609
  );
2623
- function C(f) {
2624
- return f.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "").slice(0, 64);
2610
+ function C(m) {
2611
+ return m.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").replace(/^[^a-z]+/, "").slice(0, 64);
2625
2612
  }
2626
2613
  X(
2627
- () => p.value.title,
2628
- (f) => {
2629
- v.value || (p.value.slug = C(f));
2614
+ () => v.value.title,
2615
+ (m) => {
2616
+ f.value || (v.value.slug = C(m));
2630
2617
  }
2631
2618
  );
2632
- function V(f) {
2633
- return d.value[f]?.[0];
2619
+ function V(m) {
2620
+ return p.value[m]?.[0];
2634
2621
  }
2635
2622
  async function x() {
2636
- m.value = !0, d.value = {};
2623
+ g.value = !0, p.value = {};
2637
2624
  try {
2638
- l(await r.create(p.value));
2639
- } catch (f) {
2640
- const y = f.body;
2641
- y?.errors ? d.value = y.errors : Y.danger(b(f, n("page.failed")));
2625
+ l(await r.create(v.value));
2626
+ } catch (m) {
2627
+ const y = m.body;
2628
+ y?.errors ? p.value = y.errors : G.danger(b(m, n("page.failed")));
2642
2629
  } finally {
2643
- m.value = !1;
2630
+ g.value = !1;
2644
2631
  }
2645
2632
  }
2646
- return (f, y) => (i(), N(e(Lt), {
2633
+ return (m, y) => (i(), I(e(Lt), {
2647
2634
  open: e(a),
2648
2635
  "onUpdate:open": y[5] || (y[5] = (R) => $t(a) ? a.value = R : null),
2649
2636
  title: e(n)("page.new"),
2650
2637
  width: 520
2651
2638
  }, {
2652
- footer: c(() => [
2639
+ footer: d(() => [
2653
2640
  u(e(bl), { size: "sm" }, {
2654
- default: c(() => [
2641
+ default: d(() => [
2655
2642
  u(e(ce), {
2656
2643
  variant: "outline",
2657
2644
  onClick: y[4] || (y[4] = (R) => e(o)())
2658
2645
  }, {
2659
- default: c(() => [
2646
+ default: d(() => [
2660
2647
  W(_(e(n)("page.cancel")), 1)
2661
2648
  ]),
2662
2649
  _: 1
2663
2650
  }),
2664
2651
  u(e(ce), {
2665
2652
  type: "primary",
2666
- loading: m.value,
2653
+ loading: g.value,
2667
2654
  onClick: x
2668
2655
  }, {
2669
- default: c(() => [
2656
+ default: d(() => [
2670
2657
  W(_(e(n)("page.create")), 1)
2671
2658
  ]),
2672
2659
  _: 1
@@ -2675,16 +2662,16 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2675
2662
  _: 1
2676
2663
  })
2677
2664
  ]),
2678
- default: c(() => [
2679
- B("div", sa, [
2665
+ default: d(() => [
2666
+ E("div", sa, [
2680
2667
  u(e(ne), {
2681
2668
  label: e(n)("page.title"),
2682
2669
  error: V("title")
2683
2670
  }, {
2684
- default: c(() => [
2671
+ default: d(() => [
2685
2672
  u(e(Pe), {
2686
- modelValue: p.value.title,
2687
- "onUpdate:modelValue": y[0] || (y[0] = (R) => p.value.title = R),
2673
+ modelValue: v.value.title,
2674
+ "onUpdate:modelValue": y[0] || (y[0] = (R) => v.value.title = R),
2688
2675
  autofocus: ""
2689
2676
  }, null, 8, ["modelValue"])
2690
2677
  ]),
@@ -2695,12 +2682,12 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2695
2682
  help: e(n)("page.identifier-help"),
2696
2683
  error: V("slug")
2697
2684
  }, {
2698
- default: c(() => [
2685
+ default: d(() => [
2699
2686
  u(e(Pe), {
2700
- modelValue: p.value.slug,
2701
- "onUpdate:modelValue": y[1] || (y[1] = (R) => p.value.slug = R),
2687
+ modelValue: v.value.slug,
2688
+ "onUpdate:modelValue": y[1] || (y[1] = (R) => v.value.slug = R),
2702
2689
  placeholder: "hero",
2703
- onInput: y[2] || (y[2] = (R) => v.value = !0)
2690
+ onInput: y[2] || (y[2] = (R) => f.value = !0)
2704
2691
  }, null, 8, ["modelValue"])
2705
2692
  ]),
2706
2693
  _: 1
@@ -2710,11 +2697,11 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2710
2697
  help: e(n)("page.group-help"),
2711
2698
  error: V("group")
2712
2699
  }, {
2713
- default: c(() => [
2700
+ default: d(() => [
2714
2701
  u(e(Et), {
2715
- modelValue: p.value.group,
2716
- "onUpdate:modelValue": y[3] || (y[3] = (R) => p.value.group = R),
2717
- options: g.value
2702
+ modelValue: v.value.group,
2703
+ "onUpdate:modelValue": y[3] || (y[3] = (R) => v.value.group = R),
2704
+ options: k.value
2718
2705
  }, null, 8, ["modelValue", "options"])
2719
2706
  ]),
2720
2707
  _: 1
@@ -2738,107 +2725,107 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2738
2725
  setup(t) {
2739
2726
  const l = t, o = Me(), a = Ae(o), s = Tt();
2740
2727
  Re();
2741
- const r = de("webx-blocks"), n = De(), b = M([]), U = M(!0), p = M(""), d = M(""), m = At(ra), v = T(() => {
2742
- const E = o.state.manifest?.modules.find((k) => k.id === "blocks")?.meta;
2728
+ const r = de("webx-blocks"), n = De(), b = U([]), P = U(!0), v = U(""), p = U(""), g = At(ra), f = T(() => {
2729
+ const c = o.state.manifest?.modules.find((B) => B.id === "blocks")?.meta;
2743
2730
  return {
2744
- groups: E?.groups ?? [],
2745
- editing: E?.editing ?? !0,
2746
- provides: E?.provides ?? []
2731
+ groups: c?.groups ?? [],
2732
+ editing: c?.editing ?? !0,
2733
+ provides: c?.provides ?? []
2747
2734
  };
2748
- }), g = T(() => o.can("blocks.manage") && v.value.editing), C = T(
2749
- () => o.state.manifest?.modules.find((E) => E.id === "blocks")?.title ?? r("module.title")
2735
+ }), k = T(() => o.can("blocks.manage") && f.value.editing), C = T(
2736
+ () => o.state.manifest?.modules.find((c) => c.id === "blocks")?.title ?? r("module.title")
2750
2737
  ), V = T(() => {
2751
- const E = p.value.trim().toLowerCase(), k = d.value === "" ? b.value : b.value.filter((A) => A.group === d.value);
2752
- return E === "" ? k : k.filter(
2753
- (A) => A.title.toLowerCase().includes(E) || A.slug.includes(E) || (A.description ?? "").toLowerCase().includes(E)
2738
+ const c = v.value.trim().toLowerCase(), B = p.value === "" ? b.value : b.value.filter((D) => D.group === p.value);
2739
+ return c === "" ? B : B.filter(
2740
+ (D) => D.title.toLowerCase().includes(c) || D.slug.includes(c) || (D.description ?? "").toLowerCase().includes(c)
2754
2741
  );
2755
2742
  }), x = T(() => {
2756
- const E = [...v.value.groups];
2757
- for (const k of b.value)
2758
- E.includes(k.group) || E.push(k.group);
2759
- return E.filter((k) => b.value.some((A) => A.group === k));
2760
- }), f = T(
2743
+ const c = [...f.value.groups];
2744
+ for (const B of b.value)
2745
+ c.includes(B.group) || c.push(B.group);
2746
+ return c.filter((B) => b.value.some((D) => D.group === B));
2747
+ }), m = T(
2761
2748
  () => x.value.length < 2 ? [] : [
2762
2749
  { value: "", label: r("page.all-groups") },
2763
- ...x.value.map((E) => ({ value: E, label: ze(E, r) }))
2750
+ ...x.value.map((c) => ({ value: c, label: ze(c, r) }))
2764
2751
  ]
2765
2752
  ), y = T(() => {
2766
- const E = x.value.map((A) => ({
2767
- id: A,
2768
- label: ze(A, r),
2769
- blocks: V.value.filter((j) => j.group === A)
2770
- })).filter((A) => A.blocks.length > 0);
2771
- return d.value !== "" || V.value.length <= 5 || p.value.trim() !== "" || E.length < 2 ? [{ id: "", label: "", blocks: V.value }] : E;
2753
+ const c = x.value.map((D) => ({
2754
+ id: D,
2755
+ label: ze(D, r),
2756
+ blocks: V.value.filter((K) => K.group === D)
2757
+ })).filter((D) => D.blocks.length > 0);
2758
+ return p.value !== "" || V.value.length <= 5 || v.value.trim() !== "" || c.length < 2 ? [{ id: "", label: "", blocks: V.value }] : c;
2772
2759
  });
2773
2760
  async function R() {
2774
- U.value = !0;
2761
+ P.value = !0;
2775
2762
  try {
2776
2763
  b.value = await a.list();
2777
- } catch (E) {
2778
- Y.danger(n(E));
2764
+ } catch (c) {
2765
+ G.danger(n(c));
2779
2766
  } finally {
2780
- U.value = !1;
2767
+ P.value = !1;
2781
2768
  }
2782
2769
  }
2783
- function J(E) {
2784
- s.push(`${l.base}/${E.id}`);
2770
+ function q(c) {
2771
+ s.push(`${l.base}/${c.id}`);
2785
2772
  }
2786
- async function K() {
2787
- const E = await m({});
2788
- E && J(E);
2773
+ async function J() {
2774
+ const c = await g({});
2775
+ c && q(c);
2789
2776
  }
2790
2777
  Ue(R);
2791
2778
  const Z = T(
2792
- () => g.value ? [{ key: "new", label: r("page.new"), icon: "plus", primary: !0, run: () => {
2793
- K();
2779
+ () => k.value ? [{ key: "new", label: r("page.new"), icon: "plus", primary: !0, run: () => {
2780
+ J();
2794
2781
  } }] : []
2795
2782
  );
2796
- return (E, k) => (i(), N(e(rl), {
2797
- view: d.value,
2798
- "onUpdate:view": k[1] || (k[1] = (A) => d.value = A),
2783
+ return (c, B) => (i(), I(e(rl), {
2784
+ view: p.value,
2785
+ "onUpdate:view": B[1] || (B[1] = (D) => p.value = D),
2799
2786
  class: "wx-blocks-page",
2800
2787
  title: C.value,
2801
- views: f.value,
2788
+ views: m.value,
2802
2789
  actions: Z.value
2803
2790
  }, {
2804
- default: c(() => [
2805
- v.value.editing ? P("", !0) : (i(), N(e(Vt), {
2791
+ default: d(() => [
2792
+ f.value.editing ? N("", !0) : (i(), I(e(Vt), {
2806
2793
  key: 0,
2807
2794
  type: "info",
2808
2795
  variant: "soft",
2809
2796
  description: e(r)("page.editing-off")
2810
2797
  }, null, 8, ["description"])),
2811
- U.value || b.value.length > 0 ? (i(), S("div", ua, [
2798
+ P.value || b.value.length > 0 ? (i(), S("div", ua, [
2812
2799
  u(e(Pe), {
2813
- modelValue: p.value,
2814
- "onUpdate:modelValue": k[0] || (k[0] = (A) => p.value = A),
2800
+ modelValue: v.value,
2801
+ "onUpdate:modelValue": B[0] || (B[0] = (D) => v.value = D),
2815
2802
  class: "wx-blocks-page__search",
2816
2803
  placeholder: e(r)("page.search"),
2817
2804
  clearable: ""
2818
2805
  }, null, 8, ["modelValue", "placeholder"])
2819
- ])) : P("", !0),
2820
- U.value ? (i(), N(e(We), { key: 2 }, {
2821
- template: c(() => [
2822
- B("div", ca, [
2823
- (i(), S(F, null, ee(4, (A) => B("div", {
2824
- key: A,
2806
+ ])) : N("", !0),
2807
+ P.value ? (i(), I(e(We), { key: 2 }, {
2808
+ template: d(() => [
2809
+ E("div", ca, [
2810
+ (i(), S(j, null, ee(4, (D) => E("div", {
2811
+ key: D,
2825
2812
  class: "wx-blocks-page__ghost"
2826
2813
  }, [
2827
- u(e(je), {
2814
+ u(e(Fe), {
2828
2815
  variant: "image",
2829
2816
  height: 120,
2830
2817
  class: "wx-blocks-page__ghost-thumb"
2831
2818
  }),
2832
- B("div", da, [
2833
- u(e(je), {
2819
+ E("div", da, [
2820
+ u(e(Fe), {
2834
2821
  variant: "title",
2835
2822
  width: "45%"
2836
2823
  }),
2837
- u(e(je), {
2824
+ u(e(Fe), {
2838
2825
  variant: "text",
2839
2826
  width: "70%"
2840
2827
  }),
2841
- u(e(je), {
2828
+ u(e(Fe), {
2842
2829
  variant: "button",
2843
2830
  width: "64px",
2844
2831
  height: "22px"
@@ -2848,21 +2835,21 @@ const _t = /* @__PURE__ */ Symbol("wx-blocks-root"), Un = {
2848
2835
  ])
2849
2836
  ]),
2850
2837
  _: 1
2851
- })) : b.value.length === 0 ? (i(), N(e(Wt), {
2838
+ })) : b.value.length === 0 ? (i(), I(e(Wt), {
2852
2839
  key: 3,
2853
2840
  icon: "grid",
2854
2841
  title: e(r)("page.empty"),
2855
2842
  description: e(r)("page.empty-help")
2856
- }, null, 8, ["title", "description"])) : (i(!0), S(F, { key: 4 }, ee(y.value, (A) => (i(), S("section", {
2857
- key: A.id,
2843
+ }, null, 8, ["title", "description"])) : (i(!0), S(j, { key: 4 }, ee(y.value, (D) => (i(), S("section", {
2844
+ key: D.id,
2858
2845
  class: "wx-blocks-page__group"
2859
2846
  }, [
2860
- A.label ? (i(), S("div", pa, _(A.label), 1)) : P("", !0),
2861
- B("div", va, [
2862
- (i(!0), S(F, null, ee(A.blocks, (j) => (i(), N(oa, {
2863
- key: j.id,
2864
- block: j,
2865
- onOpen: J
2847
+ D.label ? (i(), S("div", pa, _(D.label), 1)) : N("", !0),
2848
+ E("div", va, [
2849
+ (i(!0), S(j, null, ee(D.blocks, (K) => (i(), I(oa, {
2850
+ key: K.id,
2851
+ block: K,
2852
+ onOpen: q
2866
2853
  }, null, 8, ["block"]))), 128))
2867
2854
  ])
2868
2855
  ]))), 128))
@@ -2903,7 +2890,7 @@ export {
2903
2890
  dn as WxBlockEditorPage,
2904
2891
  _n as WxBlockPicker,
2905
2892
  zl as WxBlockStage,
2906
- jt as WxBlockThumb,
2893
+ Ft as WxBlockThumb,
2907
2894
  ea as WxBlocks,
2908
2895
  ma as WxBlocksPage,
2909
2896
  $a as blocks,
@@ -2914,14 +2901,14 @@ export {
2914
2901
  Ae as createBlocksApi,
2915
2902
  It as findRange,
2916
2903
  st as formSchema,
2917
- lt as highlightBlock,
2904
+ et as highlightBlock,
2918
2905
  kt as insertNode,
2919
2906
  Ut as isNode,
2920
- Xe as isNodeList,
2921
- jl as lintBlock,
2907
+ Ze as isNodeList,
2908
+ Fl as lintBlock,
2922
2909
  re as locate,
2923
2910
  Il as makeNode,
2924
- nt as newKey,
2911
+ lt as newKey,
2925
2912
  _a as provideBlocksPreview,
2926
2913
  Dl as removeNode,
2927
2914
  Nt as replaceBlock,