@webx-ui/module-blocks 0.8.0 → 0.8.2

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