@webx-ui/module-pages 0.3.6 → 0.3.8

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,38 +1,38 @@
1
- import { inject as Ae, provide as Ie, defineComponent as F, ref as x, computed as W, openBlock as f, createBlock as C, unref as e, withCtx as i, createElementVNode as K, createElementBlock as N, createVNode as v, createTextVNode as $, toDisplayString as w, createCommentVNode as I, watch as ae, onMounted as ce, onBeforeUnmount as Ue, Fragment as Z, renderList as Ce, normalizeClass as Re, useModel as Le, mergeModels as Oe, useTemplateRef as Ke, nextTick as Fe, isRef as Me, withKeys as Pe, withModifiers as He } from "vue";
2
- import { useRouter as _e, useRoute as je, onBeforeRouteLeave as Ge } from "vue-router";
3
- import { useAdmin as Q, useTranslate as H, useErrorText as ie, WxScreenHead as Je, WxScreen as Qe, WxDate as be, WxRowMenu as Xe, rowMenuWidth as Ye, WxListScreen as Ze } from "@webx-ui/module-admin";
4
- import { WxCard as qe, WxText as U, WxButton as R, confirm as L, toast as V, useLocales as Se, localizedValue as et, WxSkeleton as ye, WxBadge as xe, WxBreadcrumb as tt, WxBreadcrumbItem as fe, WxAlert as ke, WxActionBar as at, WxEmpty as lt, WxTreeSelect as st, WxFormItem as ne, useModal as Be, WxDialog as De, WxInput as We, WxSpace as we, createModal as Ve, WxTable as nt } from "@webx-ui/core";
5
- import { provideBlocksPreview as it } from "@webx-ui/module-blocks";
1
+ import { inject as Ie, provide as Ue, defineComponent as F, ref as _, computed as W, openBlock as f, createBlock as C, unref as e, withCtx as i, createElementVNode as K, createElementBlock as N, createVNode as g, createTextVNode as $, toDisplayString as x, createCommentVNode as I, watch as ae, onMounted as ce, onBeforeUnmount as Re, Fragment as Z, renderList as Ce, normalizeClass as Le, useModel as Oe, mergeModels as Ke, useTemplateRef as Fe, nextTick as He, isRef as Me, withKeys as Pe, withModifiers as je } from "vue";
2
+ import { useRouter as _e, useRoute as Ge, onBeforeRouteLeave as Je } from "vue-router";
3
+ import { useAdmin as Q, useTranslate as H, useErrorText as ie, WxScreenHead as Qe, WxScreen as Xe, WxSaveState as Ye, WxDate as be, WxRowMenu as Ze, rowMenuWidth as qe, WxListScreen as et } from "@webx-ui/module-admin";
4
+ import { WxCard as Se, WxText as U, WxButton as R, confirm as L, toast as V, useLocales as Be, localizedValue as tt, WxSkeleton as ye, WxBadge as xe, WxBreadcrumb as at, WxBreadcrumbItem as fe, WxAlert as ke, WxActionBar as lt, WxEmpty as st, WxTreeSelect as nt, WxFormItem as ne, useModal as De, WxDialog as Ne, WxInput as We, WxSpace as we, createModal as Ve, WxTable as it } from "@webx-ui/core";
5
+ import { provideBlocksPreview as ot } from "@webx-ui/module-blocks";
6
6
  function q(u) {
7
- const o = `${u.apiPath}/pages`, g = (l) => l.data;
7
+ const o = `${u.apiPath}/pages`, v = (a) => a.data;
8
8
  return {
9
- list: (l = {}) => {
9
+ list: (a = {}) => {
10
10
  const s = new URLSearchParams();
11
- l.parent != null && s.set("parent", String(l.parent)), l.search && s.set("search", l.search), l.status && s.set("status", l.status), l.trashed && s.set("trashed", "1"), l.flat && s.set("flat", "1");
11
+ a.parent != null && s.set("parent", String(a.parent)), a.search && s.set("search", a.search), a.status && s.set("status", a.status), a.trashed && s.set("trashed", "1"), a.flat && s.set("flat", "1");
12
12
  const t = s.size > 0 ? `?${s}` : "";
13
- return u.http.get(`${o}${t}`).then(g);
13
+ return u.http.get(`${o}${t}`).then(v);
14
14
  },
15
- get: (l) => u.http.get(`${o}/${l}`).then(g),
16
- create: (l) => u.http.post(o, l).then(g),
17
- save: (l, s) => u.http.put(`${o}/${l}`, s).then(g),
18
- move: (l, s, t) => u.http.post(`${o}/${l}/move`, { target: s, zone: t }).then(g),
19
- duplicate: (l) => u.http.post(`${o}/${l}/duplicate`, {}).then(g),
20
- publish: (l) => u.http.post(`${o}/${l}/publish`, {}).then(g),
21
- unpublish: (l) => u.http.post(`${o}/${l}/unpublish`, {}).then(g),
22
- remove: (l) => u.http.delete(`${o}/${l}`).then((s) => s.data.trashed),
23
- restore: (l) => u.http.post(`${o}/${l}/restore`, {}).then((s) => s.data.restored),
24
- versions: (l) => u.http.get(`${o}/${l}/versions`).then(g),
25
- restoreVersion: (l, s) => u.http.post(`${o}/${l}/versions/${s}/restore`, {}).then(g)
15
+ get: (a) => u.http.get(`${o}/${a}`).then(v),
16
+ create: (a) => u.http.post(o, a).then(v),
17
+ save: (a, s) => u.http.put(`${o}/${a}`, s).then(v),
18
+ move: (a, s, t) => u.http.post(`${o}/${a}/move`, { target: s, zone: t }).then(v),
19
+ duplicate: (a) => u.http.post(`${o}/${a}/duplicate`, {}).then(v),
20
+ publish: (a) => u.http.post(`${o}/${a}/publish`, {}).then(v),
21
+ unpublish: (a) => u.http.post(`${o}/${a}/unpublish`, {}).then(v),
22
+ remove: (a) => u.http.delete(`${o}/${a}`).then((s) => s.data.trashed),
23
+ restore: (a) => u.http.post(`${o}/${a}/restore`, {}).then((s) => s.data.restored),
24
+ versions: (a) => u.http.get(`${o}/${a}/versions`).then(v),
25
+ restoreVersion: (a, s) => u.http.post(`${o}/${a}/versions/${s}/restore`, {}).then(v)
26
26
  };
27
27
  }
28
- const Ne = /* @__PURE__ */ Symbol("wx-page-editor");
29
- function ot(u) {
30
- Ie(Ne, u);
28
+ const Ee = /* @__PURE__ */ Symbol("wx-page-editor");
29
+ function rt(u) {
30
+ Ue(Ee, u);
31
31
  }
32
32
  function Te() {
33
- return Ae(Ne, null);
33
+ return Ie(Ee, null);
34
34
  }
35
- const rt = {
35
+ const ut = {
36
36
  module: {
37
37
  title: "Pages"
38
38
  },
@@ -96,9 +96,6 @@ const rt = {
96
96
  // The editor.
97
97
  trail: "Where this page sits",
98
98
  untitled: "Untitled",
99
- "state-saved": "Saved",
100
- "state-saving": "Saving…",
101
- "state-unsaved": "Not saved yet",
102
99
  save: "Save",
103
100
  "save-failed": "The page was not saved.",
104
101
  publish: "Publish",
@@ -141,122 +138,122 @@ const rt = {
141
138
  function j() {
142
139
  try {
143
140
  const { i18n: u } = Q();
144
- ze.has(u) || (u.defaults("webx-pages", rt), ze.add(u));
141
+ ze.has(u) || (u.defaults("webx-pages", ut), ze.add(u));
145
142
  } catch {
146
143
  }
147
144
  }
148
- const ut = { class: "wx-page-danger" }, dt = {
145
+ const dt = { class: "wx-page-danger" }, ct = {
149
146
  key: 0,
150
147
  class: "wx-page-danger__row"
151
- }, ct = { class: "wx-page-danger__what" }, pt = { class: "wx-page-danger__row" }, gt = { class: "wx-page-danger__what" }, vt = /* @__PURE__ */ F({
148
+ }, pt = { class: "wx-page-danger__what" }, gt = { class: "wx-page-danger__row" }, vt = { class: "wx-page-danger__what" }, ht = /* @__PURE__ */ F({
152
149
  name: "WxPageDanger",
153
150
  __name: "PageDanger",
154
151
  setup(u) {
155
- const o = Q(), g = q(o), l = _e(), s = Te();
152
+ const o = Q(), v = q(o), a = _e(), s = Te();
156
153
  j();
157
- const t = H("webx-pages"), d = ie(), a = x(!1), c = W(() => s?.page.value ?? null), h = W(() => o.can("pages.manage"));
154
+ const t = H("webx-pages"), d = ie(), l = _(!1), c = W(() => s?.page.value ?? null), h = W(() => o.can("pages.manage"));
158
155
  async function r() {
159
- const _ = c.value;
160
- if (!(!_ || !await L({
161
- title: t("page.unpublish-title", { title: _.title }),
156
+ const w = c.value;
157
+ if (!(!w || !await L({
158
+ title: t("page.unpublish-title", { title: w.title }),
162
159
  message: t("page.unpublish-text"),
163
160
  confirmText: t("page.unpublish"),
164
161
  cancelText: t("page.cancel"),
165
162
  tone: "danger"
166
163
  }))) {
167
- a.value = !0;
164
+ l.value = !0;
168
165
  try {
169
- await g.unpublish(_.id), await s?.reload(), V.success(t("page.unpublished"));
166
+ await v.unpublish(w.id), await s?.reload(), V.success(t("page.unpublished"));
170
167
  } catch (b) {
171
168
  V.danger(d(b));
172
169
  } finally {
173
- a.value = !1;
170
+ l.value = !1;
174
171
  }
175
172
  }
176
173
  }
177
174
  async function k() {
178
- const _ = c.value;
179
- if (!(!_ || !await L({
180
- title: t("page.delete-title", { title: _.title }),
175
+ const w = c.value;
176
+ if (!(!w || !await L({
177
+ title: t("page.delete-title", { title: w.title }),
181
178
  // The whole branch, not the level under it (§7): a catalogue with two sections and forty
182
179
  // products is forty-two pages leaving the site at once.
183
- message: _.descendants_count > 0 ? `${t("page.delete-text")} ${t("page.delete-branch", { count: _.descendants_count })}` : t("page.delete-text"),
180
+ message: w.descendants_count > 0 ? `${t("page.delete-text")} ${t("page.delete-branch", { count: w.descendants_count })}` : t("page.delete-text"),
184
181
  confirmText: t("page.delete"),
185
182
  cancelText: t("page.cancel"),
186
183
  tone: "danger"
187
184
  }))) {
188
- a.value = !0;
185
+ l.value = !0;
189
186
  try {
190
- await g.remove(_.id), V.success(t("page.deleted")), l.push(s?.base ?? "/pages");
187
+ await v.remove(w.id), V.success(t("page.deleted")), a.push(s?.base ?? "/pages");
191
188
  } catch (b) {
192
189
  V.danger(d(b));
193
190
  } finally {
194
- a.value = !1;
191
+ l.value = !1;
195
192
  }
196
193
  }
197
194
  }
198
- return (_, z) => c.value && h.value ? (f(), C(e(qe), {
195
+ return (w, z) => c.value && h.value ? (f(), C(e(Se), {
199
196
  key: 0,
200
197
  title: e(t)("page.danger")
201
198
  }, {
202
199
  default: i(() => [
203
- K("div", ut, [
204
- c.value.status !== "draft" ? (f(), N("div", dt, [
205
- K("div", ct, [
206
- v(e(U), { weight: "medium" }, {
200
+ K("div", dt, [
201
+ c.value.status !== "draft" ? (f(), N("div", ct, [
202
+ K("div", pt, [
203
+ g(e(U), { weight: "medium" }, {
207
204
  default: i(() => [
208
- $(w(e(t)("page.unpublish")), 1)
205
+ $(x(e(t)("page.unpublish")), 1)
209
206
  ]),
210
207
  _: 1
211
208
  }),
212
- v(e(U), {
209
+ g(e(U), {
213
210
  size: "sm",
214
211
  tone: "muted"
215
212
  }, {
216
213
  default: i(() => [
217
- $(w(e(t)("page.unpublish-help")), 1)
214
+ $(x(e(t)("page.unpublish-help")), 1)
218
215
  ]),
219
216
  _: 1
220
217
  })
221
218
  ]),
222
- v(e(R), {
219
+ g(e(R), {
223
220
  variant: "outline",
224
- loading: a.value,
221
+ loading: l.value,
225
222
  onClick: r
226
223
  }, {
227
224
  default: i(() => [
228
- $(w(e(t)("page.unpublish")), 1)
225
+ $(x(e(t)("page.unpublish")), 1)
229
226
  ]),
230
227
  _: 1
231
228
  }, 8, ["loading"])
232
229
  ])) : I("", !0),
233
- K("div", pt, [
234
- K("div", gt, [
235
- v(e(U), { weight: "medium" }, {
230
+ K("div", gt, [
231
+ K("div", vt, [
232
+ g(e(U), { weight: "medium" }, {
236
233
  default: i(() => [
237
- $(w(e(t)("page.delete")), 1)
234
+ $(x(e(t)("page.delete")), 1)
238
235
  ]),
239
236
  _: 1
240
237
  }),
241
- v(e(U), {
238
+ g(e(U), {
242
239
  size: "sm",
243
240
  tone: "muted"
244
241
  }, {
245
242
  default: i(() => [
246
- $(w(c.value.can.delete ? e(t)("page.delete-help") : e(t)("page.delete-home")), 1)
243
+ $(x(c.value.can.delete ? e(t)("page.delete-help") : e(t)("page.delete-home")), 1)
247
244
  ]),
248
245
  _: 1
249
246
  })
250
247
  ]),
251
- v(e(R), {
248
+ g(e(R), {
252
249
  type: "danger",
253
250
  variant: "outline",
254
251
  disabled: !c.value.can.delete,
255
- loading: a.value,
252
+ loading: l.value,
256
253
  onClick: k
257
254
  }, {
258
255
  default: i(() => [
259
- $(w(e(t)("page.delete")), 1)
256
+ $(x(e(t)("page.delete")), 1)
260
257
  ]),
261
258
  _: 1
262
259
  }, 8, ["disabled", "loading"])
@@ -267,31 +264,31 @@ const ut = { class: "wx-page-danger" }, dt = {
267
264
  }, 8, ["title"])) : I("", !0);
268
265
  }
269
266
  }), oe = (u, o) => {
270
- const g = u.__vccOpts || u;
271
- for (const [l, s] of o)
272
- g[l] = s;
273
- return g;
274
- }, ht = /* @__PURE__ */ oe(vt, [["__scopeId", "data-v-d4a9083f"]]), mt = { class: "wx-page-editor__screen" }, ft = 1200, bt = /* @__PURE__ */ F({
267
+ const v = u.__vccOpts || u;
268
+ for (const [a, s] of o)
269
+ v[a] = s;
270
+ return v;
271
+ }, mt = /* @__PURE__ */ oe(ht, [["__scopeId", "data-v-d4a9083f"]]), ft = { class: "wx-page-editor__screen" }, bt = 1200, yt = /* @__PURE__ */ F({
275
272
  __name: "PageEditorPage",
276
273
  props: {
277
274
  base: { default: "/pages" }
278
275
  },
279
276
  setup(u) {
280
- const o = u, g = Q(), l = q(g), s = je(), t = _e(), d = Se();
277
+ const o = u, v = Q(), a = q(v), s = Ge(), t = _e(), d = Be();
281
278
  j();
282
- const a = H("webx-pages"), c = ie(), h = W(() => Number(s.params.id)), r = x(null), k = x([]), _ = x({}), z = x(""), b = x(null), p = x({}), M = x(!0), P = x(!1), B = x(!1), le = x({}), A = x(null), ee = x(""), re = x(0), S = W(() => g.can("pages.manage")), te = W(() => JSON.stringify(_.value)), E = W(() => ee.value !== "" && te.value !== ee.value), ue = W(() => P.value ? "saving" : E.value ? "unsaved" : "saved"), de = W(() => {
283
- const y = _.value.title;
284
- return et(y, d.active.value, r.value?.title ?? "");
279
+ const l = H("webx-pages"), c = ie(), h = W(() => Number(s.params.id)), r = _(null), k = _([]), w = _({}), z = _(""), b = _(null), p = _({}), M = _(!0), P = _(!1), B = _(!1), le = _({}), A = _(null), ee = _(""), re = _(0), S = W(() => v.can("pages.manage")), te = W(() => JSON.stringify(w.value)), E = W(() => ee.value !== "" && te.value !== ee.value), ue = W(() => P.value ? "saving" : E.value ? "unsaved" : "saved"), de = W(() => {
280
+ const y = w.value.title;
281
+ return tt(y, d.active.value, r.value?.title ?? "");
285
282
  }), pe = W(
286
283
  () => k.value.map((y) => ({
287
284
  id: y.id,
288
- label: y.is_home ? a("pages.home") : y.title
285
+ label: y.is_home ? l("pages.home") : y.title
289
286
  }))
290
287
  );
291
- it({ url: W(() => b.value), reload: re }), ot({
288
+ ot({ url: W(() => b.value), reload: re }), rt({
292
289
  page: r,
293
290
  ancestors: k,
294
- values: _,
291
+ values: w,
295
292
  prefixes: p,
296
293
  base: o.base,
297
294
  canManage: S.value,
@@ -299,12 +296,12 @@ const ut = { class: "wx-page-danger" }, dt = {
299
296
  save: () => O()
300
297
  });
301
298
  function ge(y) {
302
- r.value = y.page, k.value = y.ancestors, _.value = y.values, z.value = y.revision, b.value = y.preview_url, p.value = y.address_prefix, ee.value = JSON.stringify(y.values), A.value = null;
299
+ r.value = y.page, k.value = y.ancestors, w.value = y.values, z.value = y.revision, b.value = y.preview_url, p.value = y.address_prefix, ee.value = JSON.stringify(y.values), A.value = null;
303
300
  }
304
301
  async function G(y = !1) {
305
302
  y || (M.value = !0);
306
303
  try {
307
- ge(await l.get(h.value));
304
+ ge(await a.get(h.value));
308
305
  } catch (Y) {
309
306
  V.danger(c(Y)), t.push(o.base);
310
307
  } finally {
@@ -315,7 +312,7 @@ const ut = { class: "wx-page-danger" }, dt = {
315
312
  function ve() {
316
313
  !S.value || A.value || !E.value || (clearTimeout(X), X = setTimeout(() => {
317
314
  O();
318
- }, ft));
315
+ }, bt));
319
316
  }
320
317
  function he() {
321
318
  !S.value || A.value || !E.value || P.value || (clearTimeout(X), O());
@@ -323,24 +320,24 @@ const ut = { class: "wx-page-danger" }, dt = {
323
320
  async function O() {
324
321
  if (!r.value || P.value || !S.value) return;
325
322
  clearTimeout(X);
326
- const y = te.value, Y = _.value;
323
+ const y = te.value, Y = w.value;
327
324
  P.value = !0, le.value = {};
328
325
  try {
329
- const D = await l.save(r.value.id, { values: Y, revision: z.value });
326
+ const D = await a.save(r.value.id, { values: Y, revision: z.value });
330
327
  r.value = D.page, k.value = D.ancestors, z.value = D.revision, b.value = D.preview_url, p.value = D.address_prefix, A.value = null, te.value === y && (ee.value = y), re.value += 1;
331
328
  } catch (D) {
332
329
  const se = D;
333
- se.status === 409 && se.body?.data ? A.value = se.body : se.body?.errors ? (le.value = se.body.errors, V.danger(a("page.save-failed"))) : V.danger(c(D));
330
+ se.status === 409 && se.body?.data ? A.value = se.body : se.body?.errors ? (le.value = se.body.errors, V.danger(l("page.save-failed"))) : V.danger(c(D));
334
331
  } finally {
335
332
  P.value = !1;
336
333
  }
337
334
  }
338
335
  async function me() {
339
336
  await L({
340
- title: a("page.conflict-theirs-title"),
341
- message: a("page.conflict-theirs-text"),
342
- confirmText: a("page.conflict-theirs"),
343
- cancelText: a("page.cancel"),
337
+ title: l("page.conflict-theirs-title"),
338
+ message: l("page.conflict-theirs-text"),
339
+ confirmText: l("page.conflict-theirs"),
340
+ cancelText: l("page.cancel"),
344
341
  tone: "danger"
345
342
  }) && await G(!0);
346
343
  }
@@ -352,14 +349,14 @@ const ut = { class: "wx-page-danger" }, dt = {
352
349
  if (!r.value) return;
353
350
  const y = r.value.path === null ? null : `/${r.value.path}`;
354
351
  if (await L({
355
- title: a("page.publish-title", { title: r.value.title }),
356
- message: y === null ? a("page.publish-text-nowhere") : a("page.publish-text", { address: y }),
357
- confirmText: a("page.publish"),
358
- cancelText: a("page.cancel")
352
+ title: l("page.publish-title", { title: r.value.title }),
353
+ message: y === null ? l("page.publish-text-nowhere") : l("page.publish-text", { address: y }),
354
+ confirmText: l("page.publish"),
355
+ cancelText: l("page.cancel")
359
356
  }) && (E.value && await O(), !A.value)) {
360
357
  B.value = !0;
361
358
  try {
362
- await l.publish(r.value.id), await G(!0), V.success(a("page.published"));
359
+ await a.publish(r.value.id), await G(!0), V.success(l("page.published"));
363
360
  } catch (D) {
364
361
  V.danger(c(D));
365
362
  } finally {
@@ -377,50 +374,55 @@ const ut = { class: "wx-page-danger" }, dt = {
377
374
  G();
378
375
  }), ce(() => {
379
376
  G(), window.addEventListener("beforeunload", J);
380
- }), Ue(() => {
377
+ }), Re(() => {
381
378
  clearTimeout(X), window.removeEventListener("beforeunload", J);
382
- }), Ge(async () => !E.value || !S.value || (await O(), !E.value) ? !0 : await L({
383
- title: a("page.leave-title"),
384
- message: a("page.leave-text"),
385
- confirmText: a("page.leave"),
386
- cancelText: a("page.cancel"),
379
+ }), Je(async () => !E.value || !S.value || (await O(), !E.value) ? !0 : await L({
380
+ title: l("page.leave-title"),
381
+ message: l("page.leave-text"),
382
+ confirmText: l("page.leave"),
383
+ cancelText: l("page.cancel"),
387
384
  tone: "danger"
388
385
  }));
389
- const Ee = W(() => {
386
+ const Ae = W(() => {
390
387
  const y = [];
391
- return b.value && y.push({ key: "preview", label: a("page.preview"), icon: "eye", href: b.value }), r.value?.url && r.value.status !== "draft" && y.push({ key: "site", label: a("page.open-on-site"), icon: "link", href: r.value.url }), y;
388
+ return b.value && y.push({ key: "preview", label: l("page.preview"), icon: "eye", href: b.value }), r.value?.url && r.value.status !== "draft" && y.push({ key: "site", label: l("page.open-on-site"), icon: "link", href: r.value.url }), y;
392
389
  });
393
390
  return (y, Y) => (f(), N("div", {
394
391
  class: "wx-page-editor",
395
392
  onFocusout: he
396
393
  }, [
397
394
  M.value || !r.value ? (f(), N(Z, { key: 0 }, [
398
- v(e(ye), {
395
+ g(e(ye), {
399
396
  class: "wx-page-editor__ghost",
400
397
  title: "",
401
398
  rows: 1
402
399
  }),
403
- v(e(ye), { rows: 8 })
400
+ g(e(Se), null, {
401
+ default: i(() => [
402
+ g(e(ye), { rows: 8 })
403
+ ]),
404
+ _: 1
405
+ })
404
406
  ], 64)) : (f(), N(Z, { key: 1 }, [
405
- v(e(Je), {
407
+ g(e(Qe), {
406
408
  divider: "",
407
409
  back: u.base,
408
- "back-label": e(a)("module.title"),
409
- title: r.value.is_home ? e(a)("pages.home") : de.value || e(a)("page.untitled"),
410
- actions: Ee.value
410
+ "back-label": e(l)("module.title"),
411
+ title: r.value.is_home ? e(l)("pages.home") : de.value || e(l)("page.untitled"),
412
+ actions: Ae.value
411
413
  }, {
412
414
  trail: i(() => [
413
- v(e(tt), {
415
+ g(e(at), {
414
416
  size: "sm",
415
- label: e(a)("page.trail")
417
+ label: e(l)("page.trail")
416
418
  }, {
417
419
  default: i(() => [
418
- v(e(fe), {
420
+ g(e(fe), {
419
421
  as: "router-link",
420
422
  to: u.base
421
423
  }, {
422
424
  default: i(() => [
423
- $(w(e(a)("module.title")), 1)
425
+ $(x(e(l)("module.title")), 1)
424
426
  ]),
425
427
  _: 1
426
428
  }, 8, ["to"]),
@@ -430,13 +432,13 @@ const ut = { class: "wx-page-danger" }, dt = {
430
432
  to: `${u.base}/${D.id}`
431
433
  }, {
432
434
  default: i(() => [
433
- $(w(D.label), 1)
435
+ $(x(D.label), 1)
434
436
  ]),
435
437
  _: 2
436
438
  }, 1032, ["to"]))), 128)),
437
- v(e(fe), { current: "" }, {
439
+ g(e(fe), { current: "" }, {
438
440
  default: i(() => [
439
- $(w(r.value.is_home ? e(a)("pages.home") : de.value), 1)
441
+ $(x(r.value.is_home ? e(l)("pages.home") : de.value), 1)
440
442
  ]),
441
443
  _: 1
442
444
  })
@@ -445,12 +447,12 @@ const ut = { class: "wx-page-danger" }, dt = {
445
447
  }, 8, ["label"])
446
448
  ]),
447
449
  "title-after": i(() => [
448
- v(e(xe), {
450
+ g(e(xe), {
449
451
  type: m(),
450
452
  dot: ""
451
453
  }, {
452
454
  default: i(() => [
453
- $(w(e(a)(`page.status-${r.value.status}`)), 1)
455
+ $(x(e(l)(`page.status-${r.value.status}`)), 1)
454
456
  ]),
455
457
  _: 1
456
458
  }, 8, ["type"])
@@ -460,74 +462,66 @@ const ut = { class: "wx-page-danger" }, dt = {
460
462
  A.value ? (f(), C(e(ke), {
461
463
  key: 0,
462
464
  type: "warning",
463
- title: e(a)("page.conflict-title"),
465
+ title: e(l)("page.conflict-title"),
464
466
  description: A.value.message
465
467
  }, {
466
468
  actions: i(() => [
467
- v(e(R), {
469
+ g(e(R), {
468
470
  size: "sm",
469
471
  variant: "outline",
470
472
  onClick: me
471
473
  }, {
472
474
  default: i(() => [
473
- $(w(e(a)("page.conflict-theirs")), 1)
475
+ $(x(e(l)("page.conflict-theirs")), 1)
474
476
  ]),
475
477
  _: 1
476
478
  }),
477
- v(e(R), {
479
+ g(e(R), {
478
480
  size: "sm",
479
481
  type: "primary",
480
482
  onClick: n
481
483
  }, {
482
484
  default: i(() => [
483
- $(w(e(a)("page.conflict-mine")), 1)
485
+ $(x(e(l)("page.conflict-mine")), 1)
484
486
  ]),
485
487
  _: 1
486
488
  })
487
489
  ]),
488
490
  _: 1
489
491
  }, 8, ["title", "description"])) : I("", !0),
490
- K("div", mt, [
491
- v(e(Qe), {
492
- modelValue: _.value,
493
- "onUpdate:modelValue": Y[0] || (Y[0] = (D) => _.value = D),
492
+ K("div", ft, [
493
+ g(e(Xe), {
494
+ modelValue: w.value,
495
+ "onUpdate:modelValue": Y[0] || (Y[0] = (D) => w.value = D),
494
496
  name: "pages.form",
495
497
  errors: le.value,
496
498
  disabled: !S.value || B.value
497
499
  }, null, 8, ["modelValue", "errors", "disabled"])
498
500
  ]),
499
- S.value ? (f(), C(e(at), { key: 1 }, {
501
+ S.value ? (f(), C(e(lt), { key: 1 }, {
500
502
  state: i(() => [
501
- v(e(U), {
502
- size: "sm",
503
- tone: "muted"
504
- }, {
505
- default: i(() => [
506
- $(w(e(a)(`page.state-${ue.value}`)), 1)
507
- ]),
508
- _: 1
509
- })
503
+ g(e(Ye), { state: ue.value }, null, 8, ["state"])
510
504
  ]),
511
505
  default: i(() => [
512
- v(e(R), {
506
+ g(e(R), {
513
507
  variant: "outline",
514
508
  loading: P.value,
515
509
  disabled: !E.value,
516
510
  onClick: O
517
511
  }, {
518
512
  default: i(() => [
519
- $(w(e(a)("page.save")), 1)
513
+ $(x(e(l)("page.save")), 1)
520
514
  ]),
521
515
  _: 1
522
516
  }, 8, ["loading", "disabled"]),
523
- v(e(R), {
517
+ g(e(R), {
524
518
  type: "primary",
525
519
  loading: B.value,
526
520
  disabled: r.value.status === "published" && !E.value,
527
521
  onClick: T
528
522
  }, {
529
523
  default: i(() => [
530
- $(w(e(a)("page.publish")), 1)
524
+ $(x(e(l)("page.publish")), 1)
531
525
  ]),
532
526
  _: 1
533
527
  }, 8, ["loading", "disabled"])
@@ -537,25 +531,25 @@ const ut = { class: "wx-page-danger" }, dt = {
537
531
  ], 64))
538
532
  ], 32));
539
533
  }
540
- }), yt = /* @__PURE__ */ oe(bt, [["__scopeId", "data-v-a68a7efb"]]), wt = { class: "wx-page-history" }, _t = { class: "wx-page-history__number" }, xt = { class: "wx-page-history__who" }, kt = /* @__PURE__ */ F({
534
+ }), wt = /* @__PURE__ */ oe(yt, [["__scopeId", "data-v-1c246b3e"]]), _t = { class: "wx-page-history" }, xt = { class: "wx-page-history__number" }, kt = { class: "wx-page-history__who" }, Tt = /* @__PURE__ */ F({
541
535
  name: "WxPageHistory",
542
536
  __name: "PageHistory",
543
537
  setup(u) {
544
- const o = Q(), g = q(o), l = Te();
538
+ const o = Q(), v = q(o), a = Te();
545
539
  j();
546
- const s = H("webx-pages"), t = ie(), d = x(null), a = x(!1), c = W(() => l?.page.value ?? null), h = W(() => o.can("pages.manage")), r = W(
540
+ const s = H("webx-pages"), t = ie(), d = _(null), l = _(!1), c = W(() => a?.page.value ?? null), h = W(() => o.can("pages.manage")), r = W(
547
541
  () => c.value?.published_at ? d.value?.[0]?.number ?? null : null
548
542
  );
549
543
  async function k() {
550
544
  const z = c.value;
551
545
  if (z)
552
546
  try {
553
- d.value = await g.versions(z.id);
547
+ d.value = await v.versions(z.id);
554
548
  } catch (b) {
555
549
  d.value = [], V.danger(t(b));
556
550
  }
557
551
  }
558
- async function _(z) {
552
+ async function w(z) {
559
553
  const b = c.value;
560
554
  if (!(!b || !await L({
561
555
  title: s("page.restore-title", { number: z.number }),
@@ -563,13 +557,13 @@ const ut = { class: "wx-page-danger" }, dt = {
563
557
  confirmText: s("page.restore"),
564
558
  cancelText: s("page.cancel")
565
559
  }))) {
566
- a.value = !0;
560
+ l.value = !0;
567
561
  try {
568
- await g.restoreVersion(b.id, z.number), await l?.reload(), V.success(s("page.restored-version", { number: z.number }));
562
+ await v.restoreVersion(b.id, z.number), await a?.reload(), V.success(s("page.restored-version", { number: z.number }));
569
563
  } catch (M) {
570
564
  V.danger(t(M));
571
565
  } finally {
572
- a.value = !1;
566
+ l.value = !1;
573
567
  }
574
568
  }
575
569
  }
@@ -581,34 +575,34 @@ const ut = { class: "wx-page-danger" }, dt = {
581
575
  {
582
576
  immediate: !0
583
577
  }
584
- ), (z, b) => (f(), N("div", wt, [
578
+ ), (z, b) => (f(), N("div", _t, [
585
579
  d.value === null ? (f(), C(e(ye), {
586
580
  key: 0,
587
581
  class: "wx-page-history__ghost",
588
582
  rows: 3
589
- })) : d.value.length === 0 ? (f(), C(e(lt), {
583
+ })) : d.value.length === 0 ? (f(), C(e(st), {
590
584
  key: 1,
591
585
  description: e(s)("page.history-empty")
592
586
  }, null, 8, ["description"])) : (f(!0), N(Z, { key: 2 }, Ce(d.value, (p) => (f(), N("div", {
593
587
  key: p.number,
594
- class: Re(["wx-page-history__row", { "is-live": p.number === r.value }])
588
+ class: Le(["wx-page-history__row", { "is-live": p.number === r.value }])
595
589
  }, [
596
- K("code", _t, w(e(s)("page.version", { number: p.number })), 1),
597
- K("div", xt, [
590
+ K("code", xt, x(e(s)("page.version", { number: p.number })), 1),
591
+ K("div", kt, [
598
592
  p.created_at ? (f(), C(e(be), {
599
593
  key: 0,
600
594
  value: p.created_at,
601
595
  size: "md",
602
596
  tone: "default"
603
597
  }, null, 8, ["value"])) : I("", !0),
604
- v(e(U), {
598
+ g(e(U), {
605
599
  size: "sm",
606
600
  tone: "muted"
607
601
  }, {
608
602
  default: i(() => [
609
- $(w(p.author ?? e(s)(`page.source-${p.source}`)) + " ", 1),
603
+ $(x(p.author ?? e(s)(`page.source-${p.source}`)) + " ", 1),
610
604
  p.comment ? (f(), N(Z, { key: 0 }, [
611
- $(" · " + w(p.comment), 1)
605
+ $(" · " + x(p.comment), 1)
612
606
  ], 64)) : I("", !0)
613
607
  ]),
614
608
  _: 2
@@ -620,7 +614,7 @@ const ut = { class: "wx-page-danger" }, dt = {
620
614
  dot: ""
621
615
  }, {
622
616
  default: i(() => [
623
- $(w(e(s)("page.version-live")), 1)
617
+ $(x(e(s)("page.version-live")), 1)
624
618
  ]),
625
619
  _: 1
626
620
  })) : I("", !0),
@@ -628,20 +622,20 @@ const ut = { class: "wx-page-danger" }, dt = {
628
622
  key: 1,
629
623
  size: "sm",
630
624
  variant: "outline",
631
- loading: a.value,
632
- onClick: (M) => _(p)
625
+ loading: l.value,
626
+ onClick: (M) => w(p)
633
627
  }, {
634
628
  default: i(() => [
635
- $(w(e(s)("page.restore")), 1)
629
+ $(x(e(s)("page.restore")), 1)
636
630
  ]),
637
631
  _: 1
638
632
  }, 8, ["loading", "onClick"])) : I("", !0)
639
633
  ], 2))), 128))
640
634
  ]));
641
635
  }
642
- }), Tt = /* @__PURE__ */ oe(kt, [["__scopeId", "data-v-41bcd106"]]), $e = /* @__PURE__ */ F({
636
+ }), $t = /* @__PURE__ */ oe(Tt, [["__scopeId", "data-v-41bcd106"]]), $e = /* @__PURE__ */ F({
643
637
  __name: "PagePicker",
644
- props: /* @__PURE__ */ Oe({
638
+ props: /* @__PURE__ */ Ke({
645
639
  exclude: { default: () => [] },
646
640
  placeholder: { default: void 0 },
647
641
  selected: { default: () => [] }
@@ -651,19 +645,19 @@ const ut = { class: "wx-page-danger" }, dt = {
651
645
  }),
652
646
  emits: ["update:modelValue"],
653
647
  setup(u) {
654
- const o = u, g = Le(u, "modelValue"), l = Q(), s = q(l);
648
+ const o = u, v = Oe(u, "modelValue"), a = Q(), s = q(a);
655
649
  j();
656
- const t = H("webx-pages"), d = x([]);
650
+ const t = H("webx-pages"), d = _([]);
657
651
  ce(async () => {
658
652
  const h = await s.list();
659
653
  h.home && (d.value = [
660
- a(
654
+ l(
661
655
  h.home,
662
- h.items.map((r) => a(r))
656
+ h.items.map((r) => l(r))
663
657
  )
664
658
  ]);
665
659
  });
666
- function a(h, r) {
660
+ function l(h, r) {
667
661
  return {
668
662
  id: h.id,
669
663
  label: h.is_home ? t("pages.home") : h.title,
@@ -673,11 +667,11 @@ const ut = { class: "wx-page-danger" }, dt = {
673
667
  };
674
668
  }
675
669
  async function c(h) {
676
- return (await s.list({ parent: Number(h.id) })).items.map((k) => a(k));
670
+ return (await s.list({ parent: Number(h.id) })).items.map((k) => l(k));
677
671
  }
678
- return (h, r) => (f(), C(e(st), {
679
- modelValue: g.value,
680
- "onUpdate:modelValue": r[0] || (r[0] = (k) => g.value = k),
672
+ return (h, r) => (f(), C(e(nt), {
673
+ modelValue: v.value,
674
+ "onUpdate:modelValue": r[0] || (r[0] = (k) => v.value = k),
681
675
  nodes: d.value,
682
676
  lazy: "",
683
677
  load: c,
@@ -692,19 +686,19 @@ const ut = { class: "wx-page-danger" }, dt = {
692
686
  teleport: ""
693
687
  }, null, 8, ["modelValue", "nodes", "selected-path", "placeholder", "aria-label"]));
694
688
  }
695
- }), $t = {
689
+ }), Pt = {
696
690
  key: 0,
697
691
  class: "wx-page-place"
698
- }, Pt = /* @__PURE__ */ F({
692
+ }, Wt = /* @__PURE__ */ F({
699
693
  name: "WxPagePlace",
700
694
  __name: "PagePlace",
701
695
  setup(u) {
702
- const o = Q(), g = q(o), l = Te(), s = Se();
696
+ const o = Q(), v = q(o), a = Te(), s = Be();
703
697
  j();
704
- const t = H("webx-pages"), d = ie(), a = x(!1), c = x(null), h = W(() => l?.page.value ?? null), r = W(() => l?.ancestors.value.length === 0 ? null : l?.prefixes.value[s.active.value] ?? null), k = W(() => {
705
- const b = l?.values.value.slug;
698
+ const t = H("webx-pages"), d = ie(), l = _(!1), c = _(null), h = W(() => a?.page.value ?? null), r = W(() => a?.ancestors.value.length === 0 ? null : a?.prefixes.value[s.active.value] ?? null), k = W(() => {
699
+ const b = a?.values.value.slug;
706
700
  return typeof b == "string" ? b : b?.[s.active.value] ?? "";
707
- }), _ = W(() => h.value?.is_home ? "/" : r.value === null || k.value === "" ? null : `/${[r.value, k.value].filter(Boolean).join("/")}`);
701
+ }), w = W(() => h.value?.is_home ? "/" : r.value === null || k.value === "" ? null : `/${[r.value, k.value].filter(Boolean).join("/")}`);
708
702
  ae(
709
703
  h,
710
704
  (b) => {
@@ -714,7 +708,7 @@ const ut = { class: "wx-page-danger" }, dt = {
714
708
  );
715
709
  async function z(b) {
716
710
  const p = h.value;
717
- if (!p || b === null || b === p.parent_id || a.value) return;
711
+ if (!p || b === null || b === p.parent_id || l.value) return;
718
712
  const M = p.descendants_count + 1;
719
713
  if (M > 1 && !await L({
720
714
  title: t("page.move-title", { title: p.title }),
@@ -725,30 +719,30 @@ const ut = { class: "wx-page-danger" }, dt = {
725
719
  c.value = p.parent_id;
726
720
  return;
727
721
  }
728
- a.value = !0;
722
+ l.value = !0;
729
723
  try {
730
- const P = await g.move(p.id, b, "inside");
724
+ const P = await v.move(p.id, b, "inside");
731
725
  V.success(
732
726
  P.addresses_changed > 1 ? t("page.moved", { count: P.addresses_changed }) : t("page.moved-one")
733
- ), await l?.reload();
727
+ ), await a?.reload();
734
728
  } catch (P) {
735
729
  V.danger(d(P)), c.value = p.parent_id;
736
730
  } finally {
737
- a.value = !1;
731
+ l.value = !1;
738
732
  }
739
733
  }
740
- return (b, p) => h.value ? (f(), N("div", $t, [
741
- v(e(ne), {
734
+ return (b, p) => h.value ? (f(), N("div", Pt, [
735
+ g(e(ne), {
742
736
  label: e(t)("page.address")
743
737
  }, {
744
738
  default: i(() => [
745
- _.value ? (f(), C(e(U), {
739
+ w.value ? (f(), C(e(U), {
746
740
  key: 0,
747
741
  mono: "",
748
742
  class: "wx-page-place__address"
749
743
  }, {
750
744
  default: i(() => [
751
- $(w(_.value), 1)
745
+ $(x(w.value), 1)
752
746
  ]),
753
747
  _: 1
754
748
  })) : (f(), C(e(U), {
@@ -757,7 +751,7 @@ const ut = { class: "wx-page-danger" }, dt = {
757
751
  tone: "muted"
758
752
  }, {
759
753
  default: i(() => [
760
- $(w(e(t)("page.no-address")), 1)
754
+ $(x(e(t)("page.no-address")), 1)
761
755
  ]),
762
756
  _: 1
763
757
  }))
@@ -765,24 +759,24 @@ const ut = { class: "wx-page-danger" }, dt = {
765
759
  _: 1
766
760
  }, 8, ["label"]),
767
761
  h.value.can.move ? (f(), N(Z, { key: 0 }, [
768
- v(e(ne), {
762
+ g(e(ne), {
769
763
  label: e(t)("page.field-parent"),
770
764
  help: e(t)("page.parent-help")
771
765
  }, {
772
766
  default: i(() => [
773
- v($e, {
767
+ g($e, {
774
768
  modelValue: c.value,
775
769
  "onUpdate:modelValue": [
776
770
  p[0] || (p[0] = (M) => c.value = M),
777
771
  z
778
772
  ],
779
773
  exclude: [h.value.id],
780
- selected: e(l)?.ancestors.value ?? []
774
+ selected: e(a)?.ancestors.value ?? []
781
775
  }, null, 8, ["modelValue", "exclude", "selected"])
782
776
  ]),
783
777
  _: 1
784
778
  }, 8, ["label", "help"]),
785
- v(e(ke), {
779
+ g(e(ke), {
786
780
  type: "info",
787
781
  variant: "soft",
788
782
  description: e(t)("page.parent-warning")
@@ -790,7 +784,7 @@ const ut = { class: "wx-page-danger" }, dt = {
790
784
  ], 64)) : I("", !0)
791
785
  ])) : I("", !0);
792
786
  }
793
- }), Wt = /* @__PURE__ */ oe(Pt, [["__scopeId", "data-v-bf094be2"]]), Vt = /* @__PURE__ */ F({
787
+ }), Vt = /* @__PURE__ */ oe(Wt, [["__scopeId", "data-v-bf094be2"]]), zt = /* @__PURE__ */ F({
794
788
  __name: "PageActions",
795
789
  props: {
796
790
  page: {},
@@ -798,35 +792,35 @@ const ut = { class: "wx-page-danger" }, dt = {
798
792
  },
799
793
  emits: ["open", "add", "duplicate", "move", "copy", "remove", "restore"],
800
794
  setup(u, { emit: o }) {
801
- const g = u, l = o;
795
+ const v = u, a = o;
802
796
  j();
803
797
  const s = H("webx-pages"), t = W(() => {
804
- const d = g.page;
805
- if (g.inBin)
798
+ const d = v.page;
799
+ if (v.inBin)
806
800
  return [
807
801
  {
808
802
  key: "restore",
809
803
  icon: "refresh",
810
804
  label: s("page.restore"),
811
- run: () => l("restore", d)
805
+ run: () => a("restore", d)
812
806
  }
813
807
  ];
814
- const a = [
815
- { key: "open", icon: "edit", label: s("page.open"), run: () => l("open", d) },
816
- { key: "add", icon: "plus", label: s("page.add-child"), run: () => l("add", d) }
808
+ const l = [
809
+ { key: "open", icon: "edit", label: s("page.open"), run: () => a("open", d) },
810
+ { key: "add", icon: "plus", label: s("page.add-child"), run: () => a("add", d) }
817
811
  ];
818
- return d.is_home || a.push({
812
+ return d.is_home || l.push({
819
813
  key: "duplicate",
820
814
  icon: "copy",
821
815
  label: s("page.duplicate"),
822
- run: () => l("duplicate", d)
823
- }), d.can.move && a.push({ key: "move", icon: "drag", label: s("page.move"), run: () => l("move", d) }), a.push(
816
+ run: () => a("duplicate", d)
817
+ }), d.can.move && l.push({ key: "move", icon: "drag", label: s("page.move"), run: () => a("move", d) }), l.push(
824
818
  {
825
819
  key: "copy-address",
826
820
  icon: "link",
827
821
  label: s("page.copy-address"),
828
822
  disabled: !d.url,
829
- run: () => l("copy", d)
823
+ run: () => a("copy", d)
830
824
  },
831
825
  {
832
826
  key: "on-site",
@@ -835,20 +829,20 @@ const ut = { class: "wx-page-danger" }, dt = {
835
829
  disabled: !d.url,
836
830
  href: d.url ?? void 0
837
831
  }
838
- ), d.can.delete && a.push({
832
+ ), d.can.delete && l.push({
839
833
  key: "delete",
840
834
  icon: "trash",
841
835
  label: s("page.delete"),
842
836
  danger: !0,
843
- run: () => l("remove", d)
844
- }), a;
837
+ run: () => a("remove", d)
838
+ }), l;
845
839
  });
846
- return (d, a) => (f(), C(e(Xe), {
840
+ return (d, l) => (f(), C(e(Ze), {
847
841
  actions: t.value,
848
- label: g.page.title
842
+ label: v.page.title
849
843
  }, null, 8, ["actions", "label"]));
850
844
  }
851
- }), zt = {
845
+ }), Ct = {
852
846
  а: "a",
853
847
  б: "b",
854
848
  в: "v",
@@ -907,28 +901,28 @@ const ut = { class: "wx-page-danger" }, dt = {
907
901
  ź: "z",
908
902
  ż: "z"
909
903
  };
910
- function Ct(u) {
911
- return u.toLowerCase().split("").map((o) => zt[o] ?? o).join("").normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
904
+ function Mt(u) {
905
+ return u.toLowerCase().split("").map((o) => Ct[o] ?? o).join("").normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
912
906
  }
913
- const Mt = /* @__PURE__ */ F({
907
+ const St = /* @__PURE__ */ F({
914
908
  __name: "PageCreateDialog",
915
909
  props: {
916
910
  parent: { default: null }
917
911
  },
918
912
  setup(u) {
919
- const o = u, { open: g, resolve: l, dismiss: s } = Be(), t = Q(), d = q(t);
913
+ const o = u, { open: v, resolve: a, dismiss: s } = De(), t = Q(), d = q(t);
920
914
  j();
921
- const a = H("webx-pages"), c = x(""), h = x(""), r = x(o.parent?.id ?? null), k = x(!1), _ = x({}), z = Ke("field"), b = x(!1);
915
+ const l = H("webx-pages"), c = _(""), h = _(""), r = _(o.parent?.id ?? null), k = _(!1), w = _({}), z = Fe("field"), b = _(!1);
922
916
  ae(c, (M) => {
923
- b.value || (h.value = Ct(M));
917
+ b.value || (h.value = Mt(M));
924
918
  }), ce(async () => {
925
- await Fe(), z.value?.querySelector("input")?.focus();
919
+ await He(), z.value?.querySelector("input")?.focus();
926
920
  });
927
921
  async function p() {
928
922
  if (!(c.value.trim() === "" || k.value)) {
929
- k.value = !0, _.value = {};
923
+ k.value = !0, w.value = {};
930
924
  try {
931
- l(
925
+ a(
932
926
  await d.create({
933
927
  title: c.value.trim(),
934
928
  slug: h.value.trim(),
@@ -936,38 +930,38 @@ const Mt = /* @__PURE__ */ F({
936
930
  })
937
931
  );
938
932
  } catch (M) {
939
- _.value = M.body?.errors ?? {};
933
+ w.value = M.body?.errors ?? {};
940
934
  } finally {
941
935
  k.value = !1;
942
936
  }
943
937
  }
944
938
  }
945
- return (M, P) => (f(), C(e(De), {
946
- open: e(g),
947
- "onUpdate:open": P[5] || (P[5] = (B) => Me(g) ? g.value = B : null),
948
- title: e(a)("page.new-title"),
939
+ return (M, P) => (f(), C(e(Ne), {
940
+ open: e(v),
941
+ "onUpdate:open": P[5] || (P[5] = (B) => Me(v) ? v.value = B : null),
942
+ title: e(l)("page.new-title"),
949
943
  width: 460
950
944
  }, {
951
945
  footer: i(() => [
952
- v(e(we), { size: "sm" }, {
946
+ g(e(we), { size: "sm" }, {
953
947
  default: i(() => [
954
- v(e(R), {
948
+ g(e(R), {
955
949
  variant: "outline",
956
950
  onClick: P[4] || (P[4] = (B) => e(s)())
957
951
  }, {
958
952
  default: i(() => [
959
- $(w(e(a)("page.cancel")), 1)
953
+ $(x(e(l)("page.cancel")), 1)
960
954
  ]),
961
955
  _: 1
962
956
  }),
963
- v(e(R), {
957
+ g(e(R), {
964
958
  type: "primary",
965
959
  loading: k.value,
966
960
  disabled: c.value.trim() === "",
967
961
  onClick: p
968
962
  }, {
969
963
  default: i(() => [
970
- $(w(e(a)("page.create")), 1)
964
+ $(x(e(l)("page.create")), 1)
971
965
  ]),
972
966
  _: 1
973
967
  }, 8, ["loading", "disabled"])
@@ -976,9 +970,9 @@ const Mt = /* @__PURE__ */ F({
976
970
  })
977
971
  ]),
978
972
  default: i(() => [
979
- v(e(ne), {
980
- label: e(a)("page.field-title"),
981
- error: _.value.title?.[0],
973
+ g(e(ne), {
974
+ label: e(l)("page.field-title"),
975
+ error: w.value.title?.[0],
982
976
  required: ""
983
977
  }, {
984
978
  default: i(() => [
@@ -986,38 +980,38 @@ const Mt = /* @__PURE__ */ F({
986
980
  ref_key: "field",
987
981
  ref: z
988
982
  }, [
989
- v(e(We), {
983
+ g(e(We), {
990
984
  modelValue: c.value,
991
985
  "onUpdate:modelValue": P[0] || (P[0] = (B) => c.value = B),
992
- "aria-label": e(a)("page.field-title"),
986
+ "aria-label": e(l)("page.field-title"),
993
987
  onKeyup: Pe(p, ["enter"])
994
988
  }, null, 8, ["modelValue", "aria-label"])
995
989
  ], 512)
996
990
  ]),
997
991
  _: 1
998
992
  }, 8, ["label", "error"]),
999
- v(e(ne), {
1000
- label: e(a)("page.field-slug"),
1001
- error: _.value.slug?.[0],
1002
- help: e(a)("page.slug-help")
993
+ g(e(ne), {
994
+ label: e(l)("page.field-slug"),
995
+ error: w.value.slug?.[0],
996
+ help: e(l)("page.slug-help")
1003
997
  }, {
1004
998
  default: i(() => [
1005
- v(e(We), {
999
+ g(e(We), {
1006
1000
  modelValue: h.value,
1007
1001
  "onUpdate:modelValue": P[1] || (P[1] = (B) => h.value = B),
1008
- "aria-label": e(a)("page.field-slug"),
1002
+ "aria-label": e(l)("page.field-slug"),
1009
1003
  onInput: P[2] || (P[2] = (B) => b.value = !0),
1010
1004
  onKeyup: Pe(p, ["enter"])
1011
1005
  }, null, 8, ["modelValue", "aria-label"])
1012
1006
  ]),
1013
1007
  _: 1
1014
1008
  }, 8, ["label", "error", "help"]),
1015
- v(e(ne), {
1016
- label: e(a)("page.field-parent"),
1017
- error: _.value.parent_id?.[0]
1009
+ g(e(ne), {
1010
+ label: e(l)("page.field-parent"),
1011
+ error: w.value.parent_id?.[0]
1018
1012
  }, {
1019
1013
  default: i(() => [
1020
- v($e, {
1014
+ g($e, {
1021
1015
  modelValue: r.value,
1022
1016
  "onUpdate:modelValue": P[3] || (P[3] = (B) => r.value = B),
1023
1017
  selected: o.parent ? [o.parent] : []
@@ -1029,40 +1023,40 @@ const Mt = /* @__PURE__ */ F({
1029
1023
  _: 1
1030
1024
  }, 8, ["open", "title"]));
1031
1025
  }
1032
- }), St = /* @__PURE__ */ F({
1026
+ }), Bt = /* @__PURE__ */ F({
1033
1027
  __name: "PageMoveDialog",
1034
1028
  props: {
1035
1029
  page: {}
1036
1030
  },
1037
1031
  setup(u) {
1038
- const o = u, { open: g, resolve: l, dismiss: s } = Be();
1032
+ const o = u, { open: v, resolve: a, dismiss: s } = De();
1039
1033
  j();
1040
- const t = H("webx-pages"), d = x(o.page.parent_id);
1041
- return (a, c) => (f(), C(e(De), {
1042
- open: e(g),
1043
- "onUpdate:open": c[3] || (c[3] = (h) => Me(g) ? g.value = h : null),
1034
+ const t = H("webx-pages"), d = _(o.page.parent_id);
1035
+ return (l, c) => (f(), C(e(Ne), {
1036
+ open: e(v),
1037
+ "onUpdate:open": c[3] || (c[3] = (h) => Me(v) ? v.value = h : null),
1044
1038
  title: e(t)("page.move-title", { title: o.page.title }),
1045
1039
  width: 460
1046
1040
  }, {
1047
1041
  footer: i(() => [
1048
- v(e(we), { size: "sm" }, {
1042
+ g(e(we), { size: "sm" }, {
1049
1043
  default: i(() => [
1050
- v(e(R), {
1044
+ g(e(R), {
1051
1045
  variant: "outline",
1052
1046
  onClick: c[1] || (c[1] = (h) => e(s)())
1053
1047
  }, {
1054
1048
  default: i(() => [
1055
- $(w(e(t)("page.cancel")), 1)
1049
+ $(x(e(t)("page.cancel")), 1)
1056
1050
  ]),
1057
1051
  _: 1
1058
1052
  }),
1059
- v(e(R), {
1053
+ g(e(R), {
1060
1054
  type: "primary",
1061
1055
  disabled: d.value === null || d.value === o.page.parent_id,
1062
- onClick: c[2] || (c[2] = (h) => e(l)(d.value))
1056
+ onClick: c[2] || (c[2] = (h) => e(a)(d.value))
1063
1057
  }, {
1064
1058
  default: i(() => [
1065
- $(w(e(t)("page.move-confirm")), 1)
1059
+ $(x(e(t)("page.move-confirm")), 1)
1066
1060
  ]),
1067
1061
  _: 1
1068
1062
  }, 8, ["disabled"])
@@ -1071,18 +1065,18 @@ const Mt = /* @__PURE__ */ F({
1071
1065
  })
1072
1066
  ]),
1073
1067
  default: i(() => [
1074
- v(e(we), {
1068
+ g(e(we), {
1075
1069
  direction: "vertical",
1076
1070
  size: "md",
1077
1071
  fill: ""
1078
1072
  }, {
1079
1073
  default: i(() => [
1080
- v(e(ke), {
1074
+ g(e(ke), {
1081
1075
  type: "info",
1082
1076
  variant: "soft",
1083
1077
  description: e(t)("page.move-help")
1084
1078
  }, null, 8, ["description"]),
1085
- v($e, {
1079
+ g($e, {
1086
1080
  modelValue: d.value,
1087
1081
  "onUpdate:modelValue": c[0] || (c[0] = (h) => d.value = h),
1088
1082
  exclude: [o.page.id]
@@ -1094,16 +1088,16 @@ const Mt = /* @__PURE__ */ F({
1094
1088
  _: 1
1095
1089
  }, 8, ["open", "title"]));
1096
1090
  }
1097
- }), Bt = { class: "wx-pages" }, Dt = { class: "wx-pages__title" }, Nt = ["href"], Et = /* @__PURE__ */ F({
1091
+ }), Dt = { class: "wx-pages" }, Nt = { class: "wx-pages__title" }, Et = ["href"], At = /* @__PURE__ */ F({
1098
1092
  __name: "PagesPage",
1099
1093
  props: {
1100
1094
  base: { default: "/pages" }
1101
1095
  },
1102
1096
  setup(u) {
1103
- const o = u, g = Q(), l = q(g), s = _e();
1097
+ const o = u, v = Q(), a = q(v), s = _e();
1104
1098
  j();
1105
- const t = H("webx-pages"), d = ie(), a = x(null), c = x([]), h = x(!0), r = x(""), k = x(""), _ = Ve(Mt), z = Ve(St), b = W(() => g.can("pages.manage")), p = W(() => k.value === "trashed"), M = W(() => !p.value && r.value.trim() === ""), P = W(
1106
- () => g.state.manifest?.modules.find((n) => n.id === "pages")?.title ?? t("module.title")
1099
+ const t = H("webx-pages"), d = ie(), l = _(null), c = _([]), h = _(!0), r = _(""), k = _(""), w = Ve(St), z = Ve(Bt), b = W(() => v.can("pages.manage")), p = W(() => k.value === "trashed"), M = W(() => !p.value && r.value.trim() === ""), P = W(
1100
+ () => v.state.manifest?.modules.find((n) => n.id === "pages")?.title ?? t("module.title")
1107
1101
  ), B = W(() => [
1108
1102
  { value: "", label: t("page.filter-all") },
1109
1103
  { value: "draft", label: t("page.filter-draft") },
@@ -1111,7 +1105,7 @@ const Mt = /* @__PURE__ */ F({
1111
1105
  { value: "modified", label: t("page.filter-modified") },
1112
1106
  { value: "trashed", label: t("page.bin"), icon: "trash" }
1113
1107
  ]), le = W(
1114
- () => M.value && a.value ? [{ ...a.value, children_count: 0 }, ...c.value] : c.value
1108
+ () => M.value && l.value ? [{ ...l.value, children_count: 0 }, ...c.value] : c.value
1115
1109
  ), A = W(() => [
1116
1110
  { key: "title", label: t("page.column-title"), minWidth: 200 },
1117
1111
  { key: "path", label: t("page.column-address"), width: 200, hideBelow: 560 },
@@ -1131,13 +1125,13 @@ const Mt = /* @__PURE__ */ F({
1131
1125
  hideBelow: 900,
1132
1126
  hidden: p.value
1133
1127
  },
1134
- { key: "actions", label: "", width: Ye, align: "right" }
1128
+ { key: "actions", label: "", width: qe, align: "right" }
1135
1129
  ]), ee = W(
1136
1130
  () => M.value ? {
1137
1131
  childrenKey: "children",
1138
1132
  hasChildrenKey: "children_count",
1139
1133
  lazy: !0,
1140
- load: (n) => l.list({ parent: n.id }).then((T) => T.items),
1134
+ load: (n) => a.list({ parent: n.id }).then((T) => T.items),
1141
1135
  draggable: b.value,
1142
1136
  allowDrag: (n) => n.can.move,
1143
1137
  allowDrop: re
@@ -1149,12 +1143,12 @@ const Mt = /* @__PURE__ */ F({
1149
1143
  async function S() {
1150
1144
  h.value = !0;
1151
1145
  try {
1152
- const n = await l.list({
1146
+ const n = await a.list({
1153
1147
  search: r.value.trim(),
1154
1148
  status: p.value ? "" : k.value,
1155
1149
  trashed: p.value
1156
1150
  });
1157
- a.value = n.home, c.value = n.items;
1151
+ l.value = n.home, c.value = n.items;
1158
1152
  } catch (n) {
1159
1153
  V.danger(d(n));
1160
1154
  } finally {
@@ -1169,12 +1163,12 @@ const Mt = /* @__PURE__ */ F({
1169
1163
  s.resolve(T).matched.length > 0 && s.push(T);
1170
1164
  }
1171
1165
  async function ue(n) {
1172
- const T = await _({ parent: n });
1166
+ const T = await w({ parent: n });
1173
1167
  T && (await S(), E(T));
1174
1168
  }
1175
1169
  async function de(n) {
1176
1170
  try {
1177
- await l.duplicate(n.id), V.success(t("page.duplicated")), await S();
1171
+ await a.duplicate(n.id), V.success(t("page.duplicated")), await S();
1178
1172
  } catch (T) {
1179
1173
  V.danger(d(T));
1180
1174
  }
@@ -1198,7 +1192,7 @@ const Mt = /* @__PURE__ */ F({
1198
1192
  }
1199
1193
  async function G(n, T, m) {
1200
1194
  try {
1201
- const J = await l.move(n.id, T, m);
1195
+ const J = await a.move(n.id, T, m);
1202
1196
  V.success(
1203
1197
  J.addresses_changed > 1 ? t("page.moved", { count: J.addresses_changed }) : t("page.moved-one")
1204
1198
  );
@@ -1221,7 +1215,7 @@ const Mt = /* @__PURE__ */ F({
1221
1215
  tone: "danger"
1222
1216
  }))
1223
1217
  try {
1224
- await l.remove(n.id), V.success(t("page.deleted")), await S();
1218
+ await a.remove(n.id), V.success(t("page.deleted")), await S();
1225
1219
  } catch (m) {
1226
1220
  V.danger(d(m));
1227
1221
  }
@@ -1234,7 +1228,7 @@ const Mt = /* @__PURE__ */ F({
1234
1228
  cancelText: t("page.cancel")
1235
1229
  }))
1236
1230
  try {
1237
- const m = await l.restore(n.id);
1231
+ const m = await a.restore(n.id);
1238
1232
  V.success(
1239
1233
  m > 1 ? t("page.restored-branch", { count: m }) : t("page.restored")
1240
1234
  ), await S();
@@ -1260,8 +1254,8 @@ const Mt = /* @__PURE__ */ F({
1260
1254
  ue(null);
1261
1255
  } }] : []
1262
1256
  );
1263
- return (n, T) => (f(), N("div", Bt, [
1264
- v(e(Ze), {
1257
+ return (n, T) => (f(), N("div", Dt, [
1258
+ g(e(et), {
1265
1259
  view: k.value,
1266
1260
  "onUpdate:view": T[1] || (T[1] = (m) => k.value = m),
1267
1261
  title: P.value,
@@ -1269,7 +1263,7 @@ const Mt = /* @__PURE__ */ F({
1269
1263
  actions: me.value
1270
1264
  }, {
1271
1265
  default: i(() => [
1272
- v(e(nt), {
1266
+ g(e(it), {
1273
1267
  data: le.value,
1274
1268
  columns: A.value,
1275
1269
  "row-key": "id",
@@ -1289,7 +1283,7 @@ const Mt = /* @__PURE__ */ F({
1289
1283
  onNodeDrop: ge
1290
1284
  }, {
1291
1285
  "cell-title": i(({ row: m }) => [
1292
- K("span", Dt, w(m.is_home ? e(t)("pages.home") : m.title), 1)
1286
+ K("span", Nt, x(m.is_home ? e(t)("pages.home") : m.title), 1)
1293
1287
  ]),
1294
1288
  "cell-path": i(({ row: m }) => [
1295
1289
  p.value ? (f(), C(e(U), {
@@ -1307,16 +1301,16 @@ const Mt = /* @__PURE__ */ F({
1307
1301
  href: m.url,
1308
1302
  target: "_blank",
1309
1303
  rel: "noopener",
1310
- onClick: T[0] || (T[0] = He(() => {
1304
+ onClick: T[0] || (T[0] = je(() => {
1311
1305
  }, ["stop"]))
1312
- }, " /" + w(m.path), 9, Nt)) : m.path !== null ? (f(), C(e(U), {
1306
+ }, " /" + x(m.path), 9, Et)) : m.path !== null ? (f(), C(e(U), {
1313
1307
  key: 2,
1314
1308
  mono: "",
1315
1309
  size: "sm",
1316
1310
  tone: "muted"
1317
1311
  }, {
1318
1312
  default: i(() => [
1319
- $("/" + w(m.path), 1)
1313
+ $("/" + x(m.path), 1)
1320
1314
  ]),
1321
1315
  _: 2
1322
1316
  }, 1024)) : (f(), C(e(U), {
@@ -1325,7 +1319,7 @@ const Mt = /* @__PURE__ */ F({
1325
1319
  tone: "muted"
1326
1320
  }, {
1327
1321
  default: i(() => [
1328
- $(w(e(t)("page.no-address")), 1)
1322
+ $(x(e(t)("page.no-address")), 1)
1329
1323
  ]),
1330
1324
  _: 1
1331
1325
  }))
@@ -1340,30 +1334,30 @@ const Mt = /* @__PURE__ */ F({
1340
1334
  dot: ""
1341
1335
  }, {
1342
1336
  default: i(() => [
1343
- $(w(e(t)(`page.status-${m.status}`)), 1)
1337
+ $(x(e(t)(`page.status-${m.status}`)), 1)
1344
1338
  ]),
1345
1339
  _: 2
1346
1340
  }, 1032, ["type"]))
1347
1341
  ]),
1348
1342
  "cell-updated_at": i(({ row: m }) => [
1349
- v(e(U), {
1343
+ g(e(U), {
1350
1344
  size: "sm",
1351
1345
  tone: "muted"
1352
1346
  }, {
1353
1347
  default: i(() => [
1354
- v(e(be), {
1348
+ g(e(be), {
1355
1349
  value: m.updated_at,
1356
1350
  compact: ""
1357
1351
  }, null, 8, ["value"]),
1358
1352
  m.edited_by && !p.value ? (f(), N(Z, { key: 0 }, [
1359
- $(", " + w(m.edited_by), 1)
1353
+ $(", " + x(m.edited_by), 1)
1360
1354
  ], 64)) : I("", !0)
1361
1355
  ]),
1362
1356
  _: 2
1363
1357
  }, 1024)
1364
1358
  ]),
1365
1359
  "cell-actions": i(({ row: m }) => [
1366
- b.value ? (f(), C(Vt, {
1360
+ b.value ? (f(), C(zt, {
1367
1361
  key: 0,
1368
1362
  page: m,
1369
1363
  "in-bin": p.value,
@@ -1383,18 +1377,18 @@ const Mt = /* @__PURE__ */ F({
1383
1377
  }, 8, ["view", "title", "views", "actions"])
1384
1378
  ]));
1385
1379
  }
1386
- }), At = /* @__PURE__ */ oe(Et, [["__scopeId", "data-v-9f11d1cb"]]);
1387
- function Kt(u = {}) {
1380
+ }), It = /* @__PURE__ */ oe(At, [["__scopeId", "data-v-9f11d1cb"]]);
1381
+ function Ft(u = {}) {
1388
1382
  const o = u.path ?? "/pages";
1389
1383
  return {
1390
1384
  id: "pages",
1391
1385
  path: o,
1392
1386
  routes: [
1393
- { path: o, name: "webx.pages", component: At, props: { base: o } },
1387
+ { path: o, name: "webx.pages", component: It, props: { base: o } },
1394
1388
  {
1395
1389
  path: `${o}/:id(\\d+)`,
1396
1390
  name: "webx.pages.edit",
1397
- component: yt,
1391
+ component: wt,
1398
1392
  props: { base: o }
1399
1393
  }
1400
1394
  ],
@@ -1407,25 +1401,25 @@ function Kt(u = {}) {
1407
1401
  * page from the editor above it rather than from the description.
1408
1402
  */
1409
1403
  types: {
1410
- "wx-page-place": { component: Wt, kind: "display" },
1411
- "wx-page-danger": { component: ht, kind: "display" },
1412
- "wx-page-history": { component: Tt, kind: "display" }
1404
+ "wx-page-place": { component: Vt, kind: "display" },
1405
+ "wx-page-danger": { component: mt, kind: "display" },
1406
+ "wx-page-history": { component: $t, kind: "display" }
1413
1407
  }
1414
1408
  };
1415
1409
  }
1416
1410
  export {
1417
- ht as WxPageDanger,
1418
- yt as WxPageEditorPage,
1419
- Tt as WxPageHistory,
1411
+ mt as WxPageDanger,
1412
+ wt as WxPageEditorPage,
1413
+ $t as WxPageHistory,
1420
1414
  $e as WxPagePicker,
1421
- Wt as WxPagePlace,
1422
- At as WxPagesPage,
1415
+ Vt as WxPagePlace,
1416
+ It as WxPagesPage,
1423
1417
  q as createPagesApi,
1424
- Ne as pageEditorKey,
1425
- Kt as pages,
1426
- rt as pagesMessages,
1427
- ot as providePageEditor,
1428
- Ct as slugify,
1418
+ Ee as pageEditorKey,
1419
+ Ft as pages,
1420
+ ut as pagesMessages,
1421
+ rt as providePageEditor,
1422
+ Mt as slugify,
1429
1423
  Te as usePageEditor
1430
1424
  };
1431
1425
  //# sourceMappingURL=index.js.map