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