@webx-ui/module-blocks 0.6.5 → 0.7.0

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