@webx-ui/module-pages 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +331 -326
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { inject as Le, provide as Oe, defineComponent as K, ref as k, computed as W, openBlock as m, createBlock as V, unref as e, withCtx as n, createElementVNode as E, createElementBlock as A, createVNode as
|
|
1
|
+
import { inject as Le, provide as Oe, defineComponent as K, ref as k, computed as W, openBlock as m, createBlock as V, unref as e, withCtx as n, createElementVNode as E, createElementBlock as A, createVNode as g, createTextVNode as y, toDisplayString as b, createCommentVNode as N, useTemplateRef as Be, watch as ae, onMounted as pe, onBeforeUnmount as Ke, Fragment as j, renderList as Me, normalizeClass as Fe, useModel as He, mergeModels as je, nextTick as Ge, isRef as De, withKeys as Pe, createSlots as Je, withModifiers as Qe } from "vue";
|
|
2
2
|
import { useRouter as ye, useRoute as Xe, onBeforeRouteLeave as Ye } from "vue-router";
|
|
3
|
-
import { useAdmin as G, useTranslate as F, useErrorText as ie,
|
|
4
|
-
import { WxCard as
|
|
5
|
-
import { provideBlocksPreview as
|
|
6
|
-
function Z(
|
|
7
|
-
const r = `${
|
|
3
|
+
import { useAdmin as G, useTranslate as F, useErrorText as ie, WxBackButton as Ze, WxScreen as qe, WxDate as me, WxRowMenu as et, WxListScreen as tt } from "@webx-ui/module-admin";
|
|
4
|
+
import { WxCard as at, WxText as R, WxButton as I, confirm as O, toast as z, useLocales as Se, useElementWidth as lt, localizedValue as nt, WxSkeleton as be, WxBreadcrumb as st, WxBreadcrumbItem as fe, WxBadge as we, WxDropdown as ot, WxDropdownItem as We, WxAction as it, WxAlert as xe, WxActionBar as rt, WxEmpty as ut, WxTreeSelect as dt, WxFormItem as oe, useModal as Ne, WxDialog as Ae, WxInput as Ve, WxSpace as _e, createModal as ze, WxTable as ct } from "@webx-ui/core";
|
|
5
|
+
import { provideBlocksPreview as pt } from "@webx-ui/module-blocks";
|
|
6
|
+
function Z(u) {
|
|
7
|
+
const r = `${u.apiPath}/pages`, h = (l) => l.data;
|
|
8
8
|
return {
|
|
9
9
|
list: (l = {}) => {
|
|
10
10
|
const s = new URLSearchParams();
|
|
11
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");
|
|
12
12
|
const t = s.size > 0 ? `?${s}` : "";
|
|
13
|
-
return
|
|
13
|
+
return u.http.get(`${r}${t}`).then(h);
|
|
14
14
|
},
|
|
15
|
-
get: (l) =>
|
|
16
|
-
create: (l) =>
|
|
17
|
-
save: (l, s) =>
|
|
18
|
-
move: (l, s, t) =>
|
|
19
|
-
duplicate: (l) =>
|
|
20
|
-
publish: (l) =>
|
|
21
|
-
unpublish: (l) =>
|
|
22
|
-
remove: (l) =>
|
|
23
|
-
restore: (l) =>
|
|
24
|
-
versions: (l) =>
|
|
25
|
-
restoreVersion: (l, s) =>
|
|
15
|
+
get: (l) => u.http.get(`${r}/${l}`).then(h),
|
|
16
|
+
create: (l) => u.http.post(r, l).then(h),
|
|
17
|
+
save: (l, s) => u.http.put(`${r}/${l}`, s).then(h),
|
|
18
|
+
move: (l, s, t) => u.http.post(`${r}/${l}/move`, { target: s, zone: t }).then(h),
|
|
19
|
+
duplicate: (l) => u.http.post(`${r}/${l}/duplicate`, {}).then(h),
|
|
20
|
+
publish: (l) => u.http.post(`${r}/${l}/publish`, {}).then(h),
|
|
21
|
+
unpublish: (l) => u.http.post(`${r}/${l}/unpublish`, {}).then(h),
|
|
22
|
+
remove: (l) => u.http.delete(`${r}/${l}`).then((s) => s.data.trashed),
|
|
23
|
+
restore: (l) => u.http.post(`${r}/${l}/restore`, {}).then((s) => s.data.restored),
|
|
24
|
+
versions: (l) => u.http.get(`${r}/${l}/versions`).then(h),
|
|
25
|
+
restoreVersion: (l, s) => u.http.post(`${r}/${l}/versions/${s}/restore`, {}).then(h)
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
const Ee = /* @__PURE__ */ Symbol("wx-page-editor");
|
|
29
|
-
function
|
|
30
|
-
Oe(Ee,
|
|
29
|
+
function gt(u) {
|
|
30
|
+
Oe(Ee, u);
|
|
31
31
|
}
|
|
32
32
|
function ke() {
|
|
33
33
|
return Le(Ee, null);
|
|
34
34
|
}
|
|
35
|
-
const
|
|
35
|
+
const vt = {
|
|
36
36
|
module: {
|
|
37
37
|
title: "Pages"
|
|
38
38
|
},
|
|
@@ -140,23 +140,23 @@ const gt = {
|
|
|
140
140
|
}, Ce = /* @__PURE__ */ new WeakSet();
|
|
141
141
|
function H() {
|
|
142
142
|
try {
|
|
143
|
-
const { i18n:
|
|
144
|
-
Ce.has(
|
|
143
|
+
const { i18n: u } = G();
|
|
144
|
+
Ce.has(u) || (u.defaults("webx-pages", vt), Ce.add(u));
|
|
145
145
|
} catch {
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
const
|
|
148
|
+
const ht = { class: "wx-page-danger" }, ft = {
|
|
149
149
|
key: 0,
|
|
150
150
|
class: "wx-page-danger__row"
|
|
151
|
-
},
|
|
151
|
+
}, mt = { class: "wx-page-danger__what" }, bt = { class: "wx-page-danger__row" }, _t = { class: "wx-page-danger__what" }, yt = /* @__PURE__ */ K({
|
|
152
152
|
name: "WxPageDanger",
|
|
153
153
|
__name: "PageDanger",
|
|
154
|
-
setup(
|
|
154
|
+
setup(u) {
|
|
155
155
|
const r = G(), h = Z(r), l = ye(), s = ke();
|
|
156
156
|
H();
|
|
157
|
-
const t = F("webx-pages"),
|
|
157
|
+
const t = F("webx-pages"), d = ie(), a = k(!1), c = W(() => s?.page.value ?? null), f = W(() => r.can("pages.manage"));
|
|
158
158
|
async function i() {
|
|
159
|
-
const x =
|
|
159
|
+
const x = c.value;
|
|
160
160
|
if (!(!x || !await O({
|
|
161
161
|
title: t("page.unpublish-title", { title: x.title }),
|
|
162
162
|
message: t("page.unpublish-text"),
|
|
@@ -168,14 +168,14 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
168
168
|
try {
|
|
169
169
|
await h.unpublish(x.id), await s?.reload(), z.success(t("page.unpublished"));
|
|
170
170
|
} catch (_) {
|
|
171
|
-
z.danger(
|
|
171
|
+
z.danger(d(_));
|
|
172
172
|
} finally {
|
|
173
173
|
a.value = !1;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
async function T() {
|
|
178
|
-
const x =
|
|
178
|
+
const x = c.value;
|
|
179
179
|
if (!(!x || !await O({
|
|
180
180
|
title: t("page.delete-title", { title: x.title }),
|
|
181
181
|
// The whole branch, not the level under it (§7): a catalogue with two sections and forty
|
|
@@ -189,27 +189,27 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
189
189
|
try {
|
|
190
190
|
await h.remove(x.id), z.success(t("page.deleted")), l.push(s?.base ?? "/pages");
|
|
191
191
|
} catch (_) {
|
|
192
|
-
z.danger(
|
|
192
|
+
z.danger(d(_));
|
|
193
193
|
} finally {
|
|
194
194
|
a.value = !1;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
|
-
return (x, C) =>
|
|
198
|
+
return (x, C) => c.value && f.value ? (m(), V(e(at), {
|
|
199
199
|
key: 0,
|
|
200
200
|
title: e(t)("page.danger")
|
|
201
201
|
}, {
|
|
202
202
|
default: n(() => [
|
|
203
|
-
E("div",
|
|
204
|
-
|
|
205
|
-
E("div",
|
|
206
|
-
|
|
203
|
+
E("div", ht, [
|
|
204
|
+
c.value.status !== "draft" ? (m(), A("div", ft, [
|
|
205
|
+
E("div", mt, [
|
|
206
|
+
g(e(R), { weight: "medium" }, {
|
|
207
207
|
default: n(() => [
|
|
208
208
|
y(b(e(t)("page.unpublish")), 1)
|
|
209
209
|
]),
|
|
210
210
|
_: 1
|
|
211
211
|
}),
|
|
212
|
-
|
|
212
|
+
g(e(R), {
|
|
213
213
|
size: "sm",
|
|
214
214
|
tone: "muted"
|
|
215
215
|
}, {
|
|
@@ -219,7 +219,7 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
219
219
|
_: 1
|
|
220
220
|
})
|
|
221
221
|
]),
|
|
222
|
-
|
|
222
|
+
g(e(I), {
|
|
223
223
|
variant: "outline",
|
|
224
224
|
loading: a.value,
|
|
225
225
|
onClick: i
|
|
@@ -230,28 +230,28 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
230
230
|
_: 1
|
|
231
231
|
}, 8, ["loading"])
|
|
232
232
|
])) : N("", !0),
|
|
233
|
-
E("div",
|
|
234
|
-
E("div",
|
|
235
|
-
|
|
233
|
+
E("div", bt, [
|
|
234
|
+
E("div", _t, [
|
|
235
|
+
g(e(R), { weight: "medium" }, {
|
|
236
236
|
default: n(() => [
|
|
237
237
|
y(b(e(t)("page.delete")), 1)
|
|
238
238
|
]),
|
|
239
239
|
_: 1
|
|
240
240
|
}),
|
|
241
|
-
|
|
241
|
+
g(e(R), {
|
|
242
242
|
size: "sm",
|
|
243
243
|
tone: "muted"
|
|
244
244
|
}, {
|
|
245
245
|
default: n(() => [
|
|
246
|
-
y(b(
|
|
246
|
+
y(b(c.value.can.delete ? e(t)("page.delete-help") : e(t)("page.delete-home")), 1)
|
|
247
247
|
]),
|
|
248
248
|
_: 1
|
|
249
249
|
})
|
|
250
250
|
]),
|
|
251
|
-
|
|
251
|
+
g(e(I), {
|
|
252
252
|
type: "danger",
|
|
253
253
|
variant: "outline",
|
|
254
|
-
disabled: !
|
|
254
|
+
disabled: !c.value.can.delete,
|
|
255
255
|
loading: a.value,
|
|
256
256
|
onClick: T
|
|
257
257
|
}, {
|
|
@@ -266,71 +266,71 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
266
266
|
_: 1
|
|
267
267
|
}, 8, ["title"])) : N("", !0);
|
|
268
268
|
}
|
|
269
|
-
}), re = (
|
|
270
|
-
const h =
|
|
269
|
+
}), re = (u, r) => {
|
|
270
|
+
const h = u.__vccOpts || u;
|
|
271
271
|
for (const [l, s] of r)
|
|
272
272
|
h[l] = s;
|
|
273
273
|
return h;
|
|
274
|
-
},
|
|
274
|
+
}, wt = /* @__PURE__ */ re(yt, [["__scopeId", "data-v-d4a9083f"]]), xt = { class: "wx-page-editor__head" }, kt = { class: "wx-page-editor__id" }, Tt = { class: "wx-page-editor__name" }, $t = { class: "wx-page-editor__title" }, Pt = { class: "wx-page-editor__actions" }, Wt = { class: "wx-page-editor__screen" }, Vt = 1200, zt = 720, Ct = /* @__PURE__ */ K({
|
|
275
275
|
__name: "PageEditorPage",
|
|
276
276
|
props: {
|
|
277
277
|
base: { default: "/pages" }
|
|
278
278
|
},
|
|
279
|
-
setup(
|
|
280
|
-
const r =
|
|
279
|
+
setup(u) {
|
|
280
|
+
const r = u, h = G(), l = Z(h), s = Xe(), t = ye(), d = Se();
|
|
281
281
|
H();
|
|
282
|
-
const a = F("webx-pages"),
|
|
282
|
+
const a = F("webx-pages"), c = ie(), f = W(() => Number(s.params.id)), i = k(null), T = k([]), x = k({}), C = k(""), _ = k(null), p = k({}), B = k(!0), $ = k(!1), D = k(!1), le = k({}), U = k(null), q = k(""), ue = k(0), M = W(() => h.can("pages.manage")), de = Be("root"), ee = lt(de), ce = W(() => ee.value > 0 && ee.value < zt), te = W(() => JSON.stringify(x.value)), L = W(() => q.value !== "" && te.value !== q.value), ge = W(() => $.value ? "saving" : L.value ? "unsaved" : "saved"), ne = W(() => {
|
|
283
283
|
const P = x.value.title;
|
|
284
|
-
return
|
|
284
|
+
return nt(P, d.active.value, i.value?.title ?? "");
|
|
285
285
|
}), ve = W(
|
|
286
286
|
() => T.value.map((P) => ({
|
|
287
287
|
id: P.id,
|
|
288
288
|
label: P.is_home ? a("pages.home") : P.title
|
|
289
289
|
}))
|
|
290
290
|
);
|
|
291
|
-
|
|
291
|
+
pt({ url: W(() => _.value), reload: ue }), gt({
|
|
292
292
|
page: i,
|
|
293
293
|
ancestors: T,
|
|
294
294
|
values: x,
|
|
295
|
-
prefixes:
|
|
295
|
+
prefixes: p,
|
|
296
296
|
base: r.base,
|
|
297
|
-
canManage:
|
|
297
|
+
canManage: M.value,
|
|
298
298
|
reload: () => J(!0),
|
|
299
|
-
save: () =>
|
|
299
|
+
save: () => v()
|
|
300
300
|
});
|
|
301
301
|
function he(P) {
|
|
302
|
-
i.value = P.page, T.value = P.ancestors, x.value = P.values, C.value = P.revision, _.value = P.preview_url,
|
|
302
|
+
i.value = P.page, T.value = P.ancestors, x.value = P.values, C.value = P.revision, _.value = P.preview_url, p.value = P.address_prefix, q.value = JSON.stringify(P.values), U.value = null;
|
|
303
303
|
}
|
|
304
304
|
async function J(P = !1) {
|
|
305
|
-
P || (
|
|
305
|
+
P || (B.value = !0);
|
|
306
306
|
try {
|
|
307
307
|
he(await l.get(f.value));
|
|
308
308
|
} catch (Y) {
|
|
309
|
-
z.danger(
|
|
309
|
+
z.danger(c(Y)), t.push(r.base);
|
|
310
310
|
} finally {
|
|
311
|
-
|
|
311
|
+
B.value = !1;
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
314
|
let Q;
|
|
315
315
|
function o() {
|
|
316
|
-
!
|
|
317
|
-
|
|
318
|
-
},
|
|
316
|
+
!M.value || U.value || !L.value || (clearTimeout(Q), Q = setTimeout(() => {
|
|
317
|
+
v();
|
|
318
|
+
}, Vt));
|
|
319
319
|
}
|
|
320
320
|
function w() {
|
|
321
|
-
!
|
|
321
|
+
!M.value || U.value || !L.value || $.value || (clearTimeout(Q), v());
|
|
322
322
|
}
|
|
323
|
-
async function
|
|
324
|
-
if (!i.value || $.value || !
|
|
323
|
+
async function v() {
|
|
324
|
+
if (!i.value || $.value || !M.value) return;
|
|
325
325
|
clearTimeout(Q);
|
|
326
326
|
const P = te.value, Y = x.value;
|
|
327
327
|
$.value = !0, le.value = {};
|
|
328
328
|
try {
|
|
329
|
-
const
|
|
330
|
-
i.value =
|
|
331
|
-
} catch (
|
|
332
|
-
const se =
|
|
333
|
-
se.status === 409 && se.body?.data ? U.value = se.body : se.body?.errors ? (le.value = se.body.errors, z.danger(a("page.save-failed"))) : z.danger(
|
|
329
|
+
const S = await l.save(i.value.id, { values: Y, revision: C.value });
|
|
330
|
+
i.value = S.page, T.value = S.ancestors, C.value = S.revision, _.value = S.preview_url, p.value = S.address_prefix, U.value = null, te.value === P && (q.value = P), ue.value += 1;
|
|
331
|
+
} catch (S) {
|
|
332
|
+
const se = S;
|
|
333
|
+
se.status === 409 && se.body?.data ? U.value = se.body : se.body?.errors ? (le.value = se.body.errors, z.danger(a("page.save-failed"))) : z.danger(c(S));
|
|
334
334
|
} finally {
|
|
335
335
|
$.value = !1;
|
|
336
336
|
}
|
|
@@ -346,7 +346,7 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
346
346
|
}
|
|
347
347
|
async function Ie() {
|
|
348
348
|
const P = U.value;
|
|
349
|
-
P && (C.value = P.data.revision, U.value = null, await
|
|
349
|
+
P && (C.value = P.data.revision, U.value = null, await v());
|
|
350
350
|
}
|
|
351
351
|
async function Ue() {
|
|
352
352
|
if (!i.value) return;
|
|
@@ -356,14 +356,14 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
356
356
|
message: P === null ? a("page.publish-text-nowhere") : a("page.publish-text", { address: P }),
|
|
357
357
|
confirmText: a("page.publish"),
|
|
358
358
|
cancelText: a("page.cancel")
|
|
359
|
-
}) && (L.value && await
|
|
360
|
-
|
|
359
|
+
}) && (L.value && await v(), !U.value)) {
|
|
360
|
+
D.value = !0;
|
|
361
361
|
try {
|
|
362
362
|
await l.publish(i.value.id), await J(!0), z.success(a("page.published"));
|
|
363
|
-
} catch (
|
|
364
|
-
z.danger(
|
|
363
|
+
} catch (S) {
|
|
364
|
+
z.danger(c(S));
|
|
365
365
|
} finally {
|
|
366
|
-
|
|
366
|
+
D.value = !1;
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
}
|
|
@@ -379,7 +379,7 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
379
379
|
J(), window.addEventListener("beforeunload", $e);
|
|
380
380
|
}), Ke(() => {
|
|
381
381
|
clearTimeout(Q), window.removeEventListener("beforeunload", $e);
|
|
382
|
-
}), Ye(async () => !L.value || !
|
|
382
|
+
}), Ye(async () => !L.value || !M.value || (await v(), !L.value) ? !0 : await O({
|
|
383
383
|
title: a("page.leave-title"),
|
|
384
384
|
message: a("page.leave-text"),
|
|
385
385
|
confirmText: a("page.leave"),
|
|
@@ -389,44 +389,48 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
389
389
|
ref_key: "root",
|
|
390
390
|
ref: de,
|
|
391
391
|
class: "wx-page-editor",
|
|
392
|
-
"data-wx-fill": "",
|
|
393
392
|
onFocusout: w
|
|
394
393
|
}, [
|
|
395
|
-
|
|
396
|
-
|
|
394
|
+
B.value || !i.value ? (m(), A(j, { key: 0 }, [
|
|
395
|
+
g(e(be), {
|
|
397
396
|
class: "wx-page-editor__ghost",
|
|
398
397
|
title: "",
|
|
399
398
|
rows: 1
|
|
400
399
|
}),
|
|
401
|
-
|
|
400
|
+
g(e(be), { rows: 8 })
|
|
402
401
|
], 64)) : (m(), A(j, { key: 1 }, [
|
|
403
|
-
E("div",
|
|
404
|
-
|
|
405
|
-
|
|
402
|
+
E("div", xt, [
|
|
403
|
+
g(e(Ze), {
|
|
404
|
+
class: "wx-page-editor__back",
|
|
405
|
+
to: u.base,
|
|
406
|
+
label: e(a)("module.title")
|
|
407
|
+
}, null, 8, ["to", "label"]),
|
|
408
|
+
E("div", kt, [
|
|
409
|
+
g(e(st), {
|
|
406
410
|
size: "sm",
|
|
407
411
|
label: e(a)("page.trail")
|
|
408
412
|
}, {
|
|
409
413
|
default: n(() => [
|
|
410
|
-
|
|
414
|
+
g(e(fe), {
|
|
411
415
|
as: "router-link",
|
|
412
|
-
to:
|
|
416
|
+
to: u.base
|
|
413
417
|
}, {
|
|
414
418
|
default: n(() => [
|
|
415
419
|
y(b(e(a)("module.title")), 1)
|
|
416
420
|
]),
|
|
417
421
|
_: 1
|
|
418
422
|
}, 8, ["to"]),
|
|
419
|
-
(m(!0), A(j, null,
|
|
420
|
-
key:
|
|
423
|
+
(m(!0), A(j, null, Me(ve.value, (S) => (m(), V(e(fe), {
|
|
424
|
+
key: S.id,
|
|
421
425
|
as: "router-link",
|
|
422
|
-
to: `${
|
|
426
|
+
to: `${u.base}/${S.id}`
|
|
423
427
|
}, {
|
|
424
428
|
default: n(() => [
|
|
425
|
-
y(b(
|
|
429
|
+
y(b(S.label), 1)
|
|
426
430
|
]),
|
|
427
431
|
_: 2
|
|
428
432
|
}, 1032, ["to"]))), 128)),
|
|
429
|
-
|
|
433
|
+
g(e(fe), { current: "" }, {
|
|
430
434
|
default: n(() => [
|
|
431
435
|
y(b(i.value.is_home ? e(a)("pages.home") : ne.value), 1)
|
|
432
436
|
]),
|
|
@@ -435,9 +439,9 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
435
439
|
]),
|
|
436
440
|
_: 1
|
|
437
441
|
}, 8, ["label"]),
|
|
438
|
-
E("div",
|
|
439
|
-
E("span",
|
|
440
|
-
|
|
442
|
+
E("div", Tt, [
|
|
443
|
+
E("span", $t, b(i.value.is_home ? e(a)("pages.home") : ne.value || e(a)("page.untitled")), 1),
|
|
444
|
+
g(e(we), {
|
|
441
445
|
type: Re(),
|
|
442
446
|
dot: ""
|
|
443
447
|
}, {
|
|
@@ -448,13 +452,13 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
448
452
|
}, 8, ["type"])
|
|
449
453
|
])
|
|
450
454
|
]),
|
|
451
|
-
E("div",
|
|
452
|
-
ce.value ? (m(), V(e(
|
|
455
|
+
E("div", Pt, [
|
|
456
|
+
ce.value ? (m(), V(e(ot), {
|
|
453
457
|
key: 0,
|
|
454
458
|
align: "end"
|
|
455
459
|
}, {
|
|
456
460
|
trigger: n(() => [
|
|
457
|
-
|
|
461
|
+
g(e(it), {
|
|
458
462
|
type: "more",
|
|
459
463
|
title: e(a)("page.more")
|
|
460
464
|
}, null, 8, ["title"])
|
|
@@ -489,7 +493,7 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
489
493
|
})) : (m(), A(j, { key: 1 }, [
|
|
490
494
|
_.value ? (m(), V(e(I), {
|
|
491
495
|
key: 0,
|
|
492
|
-
variant: "
|
|
496
|
+
variant: "outline",
|
|
493
497
|
icon: "eye",
|
|
494
498
|
href: _.value,
|
|
495
499
|
target: "_blank",
|
|
@@ -502,7 +506,7 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
502
506
|
}, 8, ["href"])) : N("", !0),
|
|
503
507
|
i.value.url && i.value.status !== "draft" ? (m(), V(e(I), {
|
|
504
508
|
key: 1,
|
|
505
|
-
variant: "
|
|
509
|
+
variant: "outline",
|
|
506
510
|
icon: "link",
|
|
507
511
|
href: i.value.url,
|
|
508
512
|
target: "_blank",
|
|
@@ -523,7 +527,7 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
523
527
|
description: U.value.message
|
|
524
528
|
}, {
|
|
525
529
|
actions: n(() => [
|
|
526
|
-
|
|
530
|
+
g(e(I), {
|
|
527
531
|
size: "sm",
|
|
528
532
|
variant: "outline",
|
|
529
533
|
onClick: X
|
|
@@ -533,7 +537,7 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
533
537
|
]),
|
|
534
538
|
_: 1
|
|
535
539
|
}),
|
|
536
|
-
|
|
540
|
+
g(e(I), {
|
|
537
541
|
size: "sm",
|
|
538
542
|
type: "primary",
|
|
539
543
|
onClick: Ie
|
|
@@ -546,18 +550,18 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
546
550
|
]),
|
|
547
551
|
_: 1
|
|
548
552
|
}, 8, ["title", "description"])) : N("", !0),
|
|
549
|
-
E("div",
|
|
550
|
-
|
|
553
|
+
E("div", Wt, [
|
|
554
|
+
g(e(qe), {
|
|
551
555
|
modelValue: x.value,
|
|
552
|
-
"onUpdate:modelValue": Y[0] || (Y[0] = (
|
|
556
|
+
"onUpdate:modelValue": Y[0] || (Y[0] = (S) => x.value = S),
|
|
553
557
|
name: "pages.form",
|
|
554
558
|
errors: le.value,
|
|
555
|
-
disabled: !
|
|
559
|
+
disabled: !M.value || D.value
|
|
556
560
|
}, null, 8, ["modelValue", "errors", "disabled"])
|
|
557
561
|
]),
|
|
558
|
-
|
|
562
|
+
M.value ? (m(), V(e(rt), { key: 1 }, {
|
|
559
563
|
state: n(() => [
|
|
560
|
-
|
|
564
|
+
g(e(R), {
|
|
561
565
|
size: "sm",
|
|
562
566
|
tone: "muted"
|
|
563
567
|
}, {
|
|
@@ -568,20 +572,20 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
568
572
|
})
|
|
569
573
|
]),
|
|
570
574
|
default: n(() => [
|
|
571
|
-
|
|
575
|
+
g(e(I), {
|
|
572
576
|
variant: "outline",
|
|
573
577
|
loading: $.value,
|
|
574
578
|
disabled: !L.value,
|
|
575
|
-
onClick:
|
|
579
|
+
onClick: v
|
|
576
580
|
}, {
|
|
577
581
|
default: n(() => [
|
|
578
582
|
y(b(e(a)("page.save")), 1)
|
|
579
583
|
]),
|
|
580
584
|
_: 1
|
|
581
585
|
}, 8, ["loading", "disabled"]),
|
|
582
|
-
|
|
586
|
+
g(e(I), {
|
|
583
587
|
type: "primary",
|
|
584
|
-
loading:
|
|
588
|
+
loading: D.value,
|
|
585
589
|
disabled: i.value.status === "published" && !L.value,
|
|
586
590
|
onClick: Ue
|
|
587
591
|
}, {
|
|
@@ -596,26 +600,26 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
596
600
|
], 64))
|
|
597
601
|
], 544));
|
|
598
602
|
}
|
|
599
|
-
}),
|
|
603
|
+
}), Bt = /* @__PURE__ */ re(Ct, [["__scopeId", "data-v-268d0501"]]), Mt = { class: "wx-page-history" }, Dt = { class: "wx-page-history__number" }, St = { class: "wx-page-history__who" }, Nt = /* @__PURE__ */ K({
|
|
600
604
|
name: "WxPageHistory",
|
|
601
605
|
__name: "PageHistory",
|
|
602
|
-
setup(
|
|
606
|
+
setup(u) {
|
|
603
607
|
const r = G(), h = Z(r), l = ke();
|
|
604
608
|
H();
|
|
605
|
-
const s = F("webx-pages"), t = ie(),
|
|
606
|
-
() =>
|
|
609
|
+
const s = F("webx-pages"), t = ie(), d = k(null), a = k(!1), c = W(() => l?.page.value ?? null), f = W(() => r.can("pages.manage")), i = W(
|
|
610
|
+
() => c.value?.published_at ? d.value?.[0]?.number ?? null : null
|
|
607
611
|
);
|
|
608
612
|
async function T() {
|
|
609
|
-
const C =
|
|
613
|
+
const C = c.value;
|
|
610
614
|
if (C)
|
|
611
615
|
try {
|
|
612
|
-
|
|
616
|
+
d.value = await h.versions(C.id);
|
|
613
617
|
} catch (_) {
|
|
614
|
-
|
|
618
|
+
d.value = [], z.danger(t(_));
|
|
615
619
|
}
|
|
616
620
|
}
|
|
617
621
|
async function x(C) {
|
|
618
|
-
const _ =
|
|
622
|
+
const _ = c.value;
|
|
619
623
|
if (!(!_ || !await O({
|
|
620
624
|
title: s("page.restore-title", { number: C.number }),
|
|
621
625
|
message: s("page.restore-text"),
|
|
@@ -625,15 +629,15 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
625
629
|
a.value = !0;
|
|
626
630
|
try {
|
|
627
631
|
await h.restoreVersion(_.id, C.number), await l?.reload(), z.success(s("page.restored-version", { number: C.number }));
|
|
628
|
-
} catch (
|
|
629
|
-
z.danger(t(
|
|
632
|
+
} catch (B) {
|
|
633
|
+
z.danger(t(B));
|
|
630
634
|
} finally {
|
|
631
635
|
a.value = !1;
|
|
632
636
|
}
|
|
633
637
|
}
|
|
634
638
|
}
|
|
635
639
|
return ae(
|
|
636
|
-
() => [
|
|
640
|
+
() => [c.value?.id, c.value?.published_at, c.value?.updated_at],
|
|
637
641
|
() => {
|
|
638
642
|
T();
|
|
639
643
|
},
|
|
@@ -641,38 +645,39 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
641
645
|
immediate: !0
|
|
642
646
|
}
|
|
643
647
|
), (C, _) => (m(), A("div", Mt, [
|
|
644
|
-
|
|
648
|
+
d.value === null ? (m(), V(e(be), {
|
|
645
649
|
key: 0,
|
|
650
|
+
class: "wx-page-history__ghost",
|
|
646
651
|
rows: 3
|
|
647
|
-
})) :
|
|
652
|
+
})) : d.value.length === 0 ? (m(), V(e(ut), {
|
|
648
653
|
key: 1,
|
|
649
654
|
description: e(s)("page.history-empty")
|
|
650
|
-
}, null, 8, ["description"])) : (m(!0), A(j, { key: 2 },
|
|
651
|
-
key:
|
|
652
|
-
class: Fe(["wx-page-history__row", { "is-live":
|
|
655
|
+
}, null, 8, ["description"])) : (m(!0), A(j, { key: 2 }, Me(d.value, (p) => (m(), A("div", {
|
|
656
|
+
key: p.number,
|
|
657
|
+
class: Fe(["wx-page-history__row", { "is-live": p.number === i.value }])
|
|
653
658
|
}, [
|
|
654
|
-
E("code", Dt, b(e(s)("page.version", { number:
|
|
659
|
+
E("code", Dt, b(e(s)("page.version", { number: p.number })), 1),
|
|
655
660
|
E("div", St, [
|
|
656
|
-
|
|
661
|
+
p.created_at ? (m(), V(e(me), {
|
|
657
662
|
key: 0,
|
|
658
|
-
value:
|
|
663
|
+
value: p.created_at,
|
|
659
664
|
size: "md",
|
|
660
665
|
tone: "default"
|
|
661
666
|
}, null, 8, ["value"])) : N("", !0),
|
|
662
|
-
|
|
667
|
+
g(e(R), {
|
|
663
668
|
size: "sm",
|
|
664
669
|
tone: "muted"
|
|
665
670
|
}, {
|
|
666
671
|
default: n(() => [
|
|
667
|
-
y(b(
|
|
668
|
-
|
|
669
|
-
y(" · " + b(
|
|
672
|
+
y(b(p.author ?? e(s)(`page.source-${p.source}`)) + " ", 1),
|
|
673
|
+
p.comment ? (m(), A(j, { key: 0 }, [
|
|
674
|
+
y(" · " + b(p.comment), 1)
|
|
670
675
|
], 64)) : N("", !0)
|
|
671
676
|
]),
|
|
672
677
|
_: 2
|
|
673
678
|
}, 1024)
|
|
674
679
|
]),
|
|
675
|
-
|
|
680
|
+
p.number === i.value ? (m(), V(e(we), {
|
|
676
681
|
key: 0,
|
|
677
682
|
type: "success",
|
|
678
683
|
dot: ""
|
|
@@ -682,12 +687,12 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
682
687
|
]),
|
|
683
688
|
_: 1
|
|
684
689
|
})) : N("", !0),
|
|
685
|
-
f.value &&
|
|
690
|
+
f.value && p.number !== i.value ? (m(), V(e(I), {
|
|
686
691
|
key: 1,
|
|
687
692
|
size: "sm",
|
|
688
693
|
variant: "outline",
|
|
689
694
|
loading: a.value,
|
|
690
|
-
onClick: (
|
|
695
|
+
onClick: (B) => x(p)
|
|
691
696
|
}, {
|
|
692
697
|
default: n(() => [
|
|
693
698
|
y(b(e(s)("page.restore")), 1)
|
|
@@ -697,7 +702,7 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
697
702
|
], 2))), 128))
|
|
698
703
|
]));
|
|
699
704
|
}
|
|
700
|
-
}),
|
|
705
|
+
}), At = /* @__PURE__ */ re(Nt, [["__scopeId", "data-v-41bcd106"]]), Te = /* @__PURE__ */ K({
|
|
701
706
|
__name: "PagePicker",
|
|
702
707
|
props: /* @__PURE__ */ je({
|
|
703
708
|
exclude: { default: () => [] },
|
|
@@ -708,13 +713,13 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
708
713
|
modelModifiers: {}
|
|
709
714
|
}),
|
|
710
715
|
emits: ["update:modelValue"],
|
|
711
|
-
setup(
|
|
712
|
-
const r =
|
|
716
|
+
setup(u) {
|
|
717
|
+
const r = u, h = He(u, "modelValue"), l = G(), s = Z(l);
|
|
713
718
|
H();
|
|
714
|
-
const t = F("webx-pages"),
|
|
719
|
+
const t = F("webx-pages"), d = k([]);
|
|
715
720
|
pe(async () => {
|
|
716
721
|
const f = await s.list();
|
|
717
|
-
f.home && (
|
|
722
|
+
f.home && (d.value = [
|
|
718
723
|
a(
|
|
719
724
|
f.home,
|
|
720
725
|
f.items.map((i) => a(i))
|
|
@@ -730,15 +735,15 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
730
735
|
...i ? { children: i } : {}
|
|
731
736
|
};
|
|
732
737
|
}
|
|
733
|
-
async function
|
|
738
|
+
async function c(f) {
|
|
734
739
|
return (await s.list({ parent: Number(f.id) })).items.map((T) => a(T));
|
|
735
740
|
}
|
|
736
|
-
return (f, i) => (m(), V(e(
|
|
741
|
+
return (f, i) => (m(), V(e(dt), {
|
|
737
742
|
modelValue: h.value,
|
|
738
743
|
"onUpdate:modelValue": i[0] || (i[0] = (T) => h.value = T),
|
|
739
|
-
nodes:
|
|
744
|
+
nodes: d.value,
|
|
740
745
|
lazy: "",
|
|
741
|
-
load:
|
|
746
|
+
load: c,
|
|
742
747
|
"show-path": "",
|
|
743
748
|
clearable: "",
|
|
744
749
|
"selected-path": r.selected.map((T) => ({
|
|
@@ -750,53 +755,53 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
750
755
|
teleport: ""
|
|
751
756
|
}, null, 8, ["modelValue", "nodes", "selected-path", "placeholder", "aria-label"]));
|
|
752
757
|
}
|
|
753
|
-
}),
|
|
758
|
+
}), Et = {
|
|
754
759
|
key: 0,
|
|
755
760
|
class: "wx-page-place"
|
|
756
|
-
},
|
|
761
|
+
}, It = /* @__PURE__ */ K({
|
|
757
762
|
name: "WxPagePlace",
|
|
758
763
|
__name: "PagePlace",
|
|
759
|
-
setup(
|
|
760
|
-
const r = G(), h = Z(r), l = ke(), s =
|
|
764
|
+
setup(u) {
|
|
765
|
+
const r = G(), h = Z(r), l = ke(), s = Se();
|
|
761
766
|
H();
|
|
762
|
-
const t = F("webx-pages"),
|
|
767
|
+
const t = F("webx-pages"), d = ie(), a = k(!1), c = k(null), f = W(() => l?.page.value ?? null), i = W(() => l?.ancestors.value.length === 0 ? null : l?.prefixes.value[s.active.value] ?? null), T = W(() => {
|
|
763
768
|
const _ = l?.values.value.slug;
|
|
764
769
|
return typeof _ == "string" ? _ : _?.[s.active.value] ?? "";
|
|
765
770
|
}), x = W(() => f.value?.is_home ? "/" : i.value === null || T.value === "" ? null : `/${[i.value, T.value].filter(Boolean).join("/")}`);
|
|
766
771
|
ae(
|
|
767
772
|
f,
|
|
768
773
|
(_) => {
|
|
769
|
-
|
|
774
|
+
c.value = _?.parent_id ?? null;
|
|
770
775
|
},
|
|
771
776
|
{ immediate: !0 }
|
|
772
777
|
);
|
|
773
778
|
async function C(_) {
|
|
774
|
-
const
|
|
775
|
-
if (!
|
|
776
|
-
const
|
|
777
|
-
if (
|
|
778
|
-
title: t("page.move-title", { title:
|
|
779
|
-
message: t("page.move-branch", { count:
|
|
779
|
+
const p = f.value;
|
|
780
|
+
if (!p || _ === null || _ === p.parent_id || a.value) return;
|
|
781
|
+
const B = p.descendants_count + 1;
|
|
782
|
+
if (B > 1 && !await O({
|
|
783
|
+
title: t("page.move-title", { title: p.title }),
|
|
784
|
+
message: t("page.move-branch", { count: B }),
|
|
780
785
|
confirmText: t("page.move-confirm"),
|
|
781
786
|
cancelText: t("page.cancel")
|
|
782
787
|
})) {
|
|
783
|
-
|
|
788
|
+
c.value = p.parent_id;
|
|
784
789
|
return;
|
|
785
790
|
}
|
|
786
791
|
a.value = !0;
|
|
787
792
|
try {
|
|
788
|
-
const $ = await h.move(
|
|
793
|
+
const $ = await h.move(p.id, _, "inside");
|
|
789
794
|
z.success(
|
|
790
795
|
$.addresses_changed > 1 ? t("page.moved", { count: $.addresses_changed }) : t("page.moved-one")
|
|
791
796
|
), await l?.reload();
|
|
792
797
|
} catch ($) {
|
|
793
|
-
z.danger(
|
|
798
|
+
z.danger(d($)), c.value = p.parent_id;
|
|
794
799
|
} finally {
|
|
795
800
|
a.value = !1;
|
|
796
801
|
}
|
|
797
802
|
}
|
|
798
|
-
return (_,
|
|
799
|
-
|
|
803
|
+
return (_, p) => f.value ? (m(), A("div", Et, [
|
|
804
|
+
g(e(oe), {
|
|
800
805
|
label: e(t)("page.address")
|
|
801
806
|
}, {
|
|
802
807
|
default: n(() => [
|
|
@@ -823,15 +828,15 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
823
828
|
_: 1
|
|
824
829
|
}, 8, ["label"]),
|
|
825
830
|
f.value.can.move ? (m(), A(j, { key: 0 }, [
|
|
826
|
-
|
|
831
|
+
g(e(oe), {
|
|
827
832
|
label: e(t)("page.field-parent"),
|
|
828
833
|
help: e(t)("page.parent-help")
|
|
829
834
|
}, {
|
|
830
835
|
default: n(() => [
|
|
831
|
-
|
|
832
|
-
modelValue:
|
|
836
|
+
g(Te, {
|
|
837
|
+
modelValue: c.value,
|
|
833
838
|
"onUpdate:modelValue": [
|
|
834
|
-
|
|
839
|
+
p[0] || (p[0] = (B) => c.value = B),
|
|
835
840
|
C
|
|
836
841
|
],
|
|
837
842
|
exclude: [f.value.id],
|
|
@@ -840,7 +845,7 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
840
845
|
]),
|
|
841
846
|
_: 1
|
|
842
847
|
}, 8, ["label", "help"]),
|
|
843
|
-
|
|
848
|
+
g(e(xe), {
|
|
844
849
|
type: "info",
|
|
845
850
|
variant: "soft",
|
|
846
851
|
description: e(t)("page.parent-warning")
|
|
@@ -848,65 +853,65 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
848
853
|
], 64)) : N("", !0)
|
|
849
854
|
])) : N("", !0);
|
|
850
855
|
}
|
|
851
|
-
}),
|
|
856
|
+
}), Ut = /* @__PURE__ */ re(It, [["__scopeId", "data-v-bf094be2"]]), Rt = /* @__PURE__ */ K({
|
|
852
857
|
__name: "PageActions",
|
|
853
858
|
props: {
|
|
854
859
|
page: {},
|
|
855
860
|
inBin: { type: Boolean, default: !1 }
|
|
856
861
|
},
|
|
857
862
|
emits: ["open", "add", "duplicate", "move", "copy", "remove", "restore"],
|
|
858
|
-
setup(
|
|
859
|
-
const h =
|
|
863
|
+
setup(u, { emit: r }) {
|
|
864
|
+
const h = u, l = r;
|
|
860
865
|
H();
|
|
861
866
|
const s = F("webx-pages"), t = W(() => {
|
|
862
|
-
const
|
|
867
|
+
const d = h.page;
|
|
863
868
|
if (h.inBin)
|
|
864
869
|
return [
|
|
865
870
|
{
|
|
866
871
|
key: "restore",
|
|
867
872
|
icon: "refresh",
|
|
868
873
|
label: s("page.restore"),
|
|
869
|
-
run: () => l("restore",
|
|
874
|
+
run: () => l("restore", d)
|
|
870
875
|
}
|
|
871
876
|
];
|
|
872
877
|
const a = [
|
|
873
|
-
{ key: "open", icon: "edit", label: s("page.open"), run: () => l("open",
|
|
874
|
-
{ key: "add", icon: "plus", label: s("page.add-child"), run: () => l("add",
|
|
878
|
+
{ key: "open", icon: "edit", label: s("page.open"), run: () => l("open", d) },
|
|
879
|
+
{ key: "add", icon: "plus", label: s("page.add-child"), run: () => l("add", d) }
|
|
875
880
|
];
|
|
876
|
-
return
|
|
881
|
+
return d.is_home || a.push({
|
|
877
882
|
key: "duplicate",
|
|
878
883
|
icon: "copy",
|
|
879
884
|
label: s("page.duplicate"),
|
|
880
|
-
run: () => l("duplicate",
|
|
881
|
-
}),
|
|
885
|
+
run: () => l("duplicate", d)
|
|
886
|
+
}), d.can.move && a.push({ key: "move", icon: "drag", label: s("page.move"), run: () => l("move", d) }), a.push(
|
|
882
887
|
{
|
|
883
888
|
key: "copy-address",
|
|
884
889
|
icon: "link",
|
|
885
890
|
label: s("page.copy-address"),
|
|
886
|
-
disabled: !
|
|
887
|
-
run: () => l("copy",
|
|
891
|
+
disabled: !d.url,
|
|
892
|
+
run: () => l("copy", d)
|
|
888
893
|
},
|
|
889
894
|
{
|
|
890
895
|
key: "on-site",
|
|
891
896
|
icon: "external-link",
|
|
892
897
|
label: s("page.open-on-site"),
|
|
893
|
-
disabled: !
|
|
894
|
-
href:
|
|
898
|
+
disabled: !d.url,
|
|
899
|
+
href: d.url ?? void 0
|
|
895
900
|
}
|
|
896
|
-
),
|
|
901
|
+
), d.can.delete && a.push({
|
|
897
902
|
key: "delete",
|
|
898
903
|
icon: "trash",
|
|
899
904
|
label: s("page.delete"),
|
|
900
905
|
danger: !0,
|
|
901
|
-
run: () => l("remove",
|
|
906
|
+
run: () => l("remove", d)
|
|
902
907
|
}), a;
|
|
903
908
|
});
|
|
904
|
-
return (
|
|
909
|
+
return (d, a) => (m(), V(e(et), {
|
|
905
910
|
actions: t.value,
|
|
906
911
|
label: h.page.title
|
|
907
912
|
}, null, 8, ["actions", "label"]));
|
|
908
913
|
}
|
|
909
|
-
}),
|
|
914
|
+
}), Lt = {
|
|
910
915
|
а: "a",
|
|
911
916
|
б: "b",
|
|
912
917
|
в: "v",
|
|
@@ -965,64 +970,64 @@ const vt = { class: "wx-page-danger" }, ht = {
|
|
|
965
970
|
ź: "z",
|
|
966
971
|
ż: "z"
|
|
967
972
|
};
|
|
968
|
-
function
|
|
969
|
-
return
|
|
973
|
+
function Ot(u) {
|
|
974
|
+
return u.toLowerCase().split("").map((r) => Lt[r] ?? r).join("").normalize("NFD").replace(/[̀-ͯ]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
970
975
|
}
|
|
971
|
-
const
|
|
976
|
+
const Kt = /* @__PURE__ */ K({
|
|
972
977
|
__name: "PageCreateDialog",
|
|
973
978
|
props: {
|
|
974
979
|
parent: { default: null }
|
|
975
980
|
},
|
|
976
|
-
setup(
|
|
977
|
-
const r =
|
|
981
|
+
setup(u) {
|
|
982
|
+
const r = u, { open: h, resolve: l, dismiss: s } = Ne(), t = G(), d = Z(t);
|
|
978
983
|
H();
|
|
979
|
-
const a = F("webx-pages"),
|
|
980
|
-
ae(
|
|
981
|
-
_.value || (f.value =
|
|
984
|
+
const a = F("webx-pages"), c = k(""), f = k(""), i = k(r.parent?.id ?? null), T = k(!1), x = k({}), C = Be("field"), _ = k(!1);
|
|
985
|
+
ae(c, (B) => {
|
|
986
|
+
_.value || (f.value = Ot(B));
|
|
982
987
|
}), pe(async () => {
|
|
983
988
|
await Ge(), C.value?.querySelector("input")?.focus();
|
|
984
989
|
});
|
|
985
|
-
async function
|
|
986
|
-
if (!(
|
|
990
|
+
async function p() {
|
|
991
|
+
if (!(c.value.trim() === "" || T.value)) {
|
|
987
992
|
T.value = !0, x.value = {};
|
|
988
993
|
try {
|
|
989
994
|
l(
|
|
990
|
-
await
|
|
991
|
-
title:
|
|
995
|
+
await d.create({
|
|
996
|
+
title: c.value.trim(),
|
|
992
997
|
slug: f.value.trim(),
|
|
993
998
|
parent_id: i.value
|
|
994
999
|
})
|
|
995
1000
|
);
|
|
996
|
-
} catch (
|
|
997
|
-
x.value =
|
|
1001
|
+
} catch (B) {
|
|
1002
|
+
x.value = B.body?.errors ?? {};
|
|
998
1003
|
} finally {
|
|
999
1004
|
T.value = !1;
|
|
1000
1005
|
}
|
|
1001
1006
|
}
|
|
1002
1007
|
}
|
|
1003
|
-
return (
|
|
1008
|
+
return (B, $) => (m(), V(e(Ae), {
|
|
1004
1009
|
open: e(h),
|
|
1005
|
-
"onUpdate:open": $[5] || ($[5] = (
|
|
1010
|
+
"onUpdate:open": $[5] || ($[5] = (D) => De(h) ? h.value = D : null),
|
|
1006
1011
|
title: e(a)("page.new-title"),
|
|
1007
1012
|
width: 460
|
|
1008
1013
|
}, {
|
|
1009
1014
|
footer: n(() => [
|
|
1010
|
-
|
|
1015
|
+
g(e(_e), { size: "sm" }, {
|
|
1011
1016
|
default: n(() => [
|
|
1012
|
-
|
|
1017
|
+
g(e(I), {
|
|
1013
1018
|
variant: "outline",
|
|
1014
|
-
onClick: $[4] || ($[4] = (
|
|
1019
|
+
onClick: $[4] || ($[4] = (D) => e(s)())
|
|
1015
1020
|
}, {
|
|
1016
1021
|
default: n(() => [
|
|
1017
1022
|
y(b(e(a)("page.cancel")), 1)
|
|
1018
1023
|
]),
|
|
1019
1024
|
_: 1
|
|
1020
1025
|
}),
|
|
1021
|
-
|
|
1026
|
+
g(e(I), {
|
|
1022
1027
|
type: "primary",
|
|
1023
1028
|
loading: T.value,
|
|
1024
|
-
disabled:
|
|
1025
|
-
onClick:
|
|
1029
|
+
disabled: c.value.trim() === "",
|
|
1030
|
+
onClick: p
|
|
1026
1031
|
}, {
|
|
1027
1032
|
default: n(() => [
|
|
1028
1033
|
y(b(e(a)("page.create")), 1)
|
|
@@ -1034,7 +1039,7 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1034
1039
|
})
|
|
1035
1040
|
]),
|
|
1036
1041
|
default: n(() => [
|
|
1037
|
-
|
|
1042
|
+
g(e(oe), {
|
|
1038
1043
|
label: e(a)("page.field-title"),
|
|
1039
1044
|
error: x.value.title?.[0],
|
|
1040
1045
|
required: ""
|
|
@@ -1044,40 +1049,40 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1044
1049
|
ref_key: "field",
|
|
1045
1050
|
ref: C
|
|
1046
1051
|
}, [
|
|
1047
|
-
|
|
1048
|
-
modelValue:
|
|
1049
|
-
"onUpdate:modelValue": $[0] || ($[0] = (
|
|
1052
|
+
g(e(Ve), {
|
|
1053
|
+
modelValue: c.value,
|
|
1054
|
+
"onUpdate:modelValue": $[0] || ($[0] = (D) => c.value = D),
|
|
1050
1055
|
"aria-label": e(a)("page.field-title"),
|
|
1051
|
-
onKeyup: Pe(
|
|
1056
|
+
onKeyup: Pe(p, ["enter"])
|
|
1052
1057
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1053
1058
|
], 512)
|
|
1054
1059
|
]),
|
|
1055
1060
|
_: 1
|
|
1056
1061
|
}, 8, ["label", "error"]),
|
|
1057
|
-
|
|
1062
|
+
g(e(oe), {
|
|
1058
1063
|
label: e(a)("page.field-slug"),
|
|
1059
1064
|
error: x.value.slug?.[0],
|
|
1060
1065
|
help: e(a)("page.slug-help")
|
|
1061
1066
|
}, {
|
|
1062
1067
|
default: n(() => [
|
|
1063
|
-
|
|
1068
|
+
g(e(Ve), {
|
|
1064
1069
|
modelValue: f.value,
|
|
1065
|
-
"onUpdate:modelValue": $[1] || ($[1] = (
|
|
1070
|
+
"onUpdate:modelValue": $[1] || ($[1] = (D) => f.value = D),
|
|
1066
1071
|
"aria-label": e(a)("page.field-slug"),
|
|
1067
|
-
onInput: $[2] || ($[2] = (
|
|
1068
|
-
onKeyup: Pe(
|
|
1072
|
+
onInput: $[2] || ($[2] = (D) => _.value = !0),
|
|
1073
|
+
onKeyup: Pe(p, ["enter"])
|
|
1069
1074
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1070
1075
|
]),
|
|
1071
1076
|
_: 1
|
|
1072
1077
|
}, 8, ["label", "error", "help"]),
|
|
1073
|
-
|
|
1078
|
+
g(e(oe), {
|
|
1074
1079
|
label: e(a)("page.field-parent"),
|
|
1075
1080
|
error: x.value.parent_id?.[0]
|
|
1076
1081
|
}, {
|
|
1077
1082
|
default: n(() => [
|
|
1078
|
-
|
|
1083
|
+
g(Te, {
|
|
1079
1084
|
modelValue: i.value,
|
|
1080
|
-
"onUpdate:modelValue": $[3] || ($[3] = (
|
|
1085
|
+
"onUpdate:modelValue": $[3] || ($[3] = (D) => i.value = D),
|
|
1081
1086
|
selected: r.parent ? [r.parent] : []
|
|
1082
1087
|
}, null, 8, ["modelValue", "selected"])
|
|
1083
1088
|
]),
|
|
@@ -1087,37 +1092,37 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1087
1092
|
_: 1
|
|
1088
1093
|
}, 8, ["open", "title"]));
|
|
1089
1094
|
}
|
|
1090
|
-
}),
|
|
1095
|
+
}), Ft = /* @__PURE__ */ K({
|
|
1091
1096
|
__name: "PageMoveDialog",
|
|
1092
1097
|
props: {
|
|
1093
1098
|
page: {}
|
|
1094
1099
|
},
|
|
1095
|
-
setup(
|
|
1096
|
-
const r =
|
|
1100
|
+
setup(u) {
|
|
1101
|
+
const r = u, { open: h, resolve: l, dismiss: s } = Ne();
|
|
1097
1102
|
H();
|
|
1098
|
-
const t = F("webx-pages"),
|
|
1099
|
-
return (a,
|
|
1103
|
+
const t = F("webx-pages"), d = k(r.page.parent_id);
|
|
1104
|
+
return (a, c) => (m(), V(e(Ae), {
|
|
1100
1105
|
open: e(h),
|
|
1101
|
-
"onUpdate:open":
|
|
1106
|
+
"onUpdate:open": c[3] || (c[3] = (f) => De(h) ? h.value = f : null),
|
|
1102
1107
|
title: e(t)("page.move-title", { title: r.page.title }),
|
|
1103
1108
|
width: 460
|
|
1104
1109
|
}, {
|
|
1105
1110
|
footer: n(() => [
|
|
1106
|
-
|
|
1111
|
+
g(e(_e), { size: "sm" }, {
|
|
1107
1112
|
default: n(() => [
|
|
1108
|
-
|
|
1113
|
+
g(e(I), {
|
|
1109
1114
|
variant: "outline",
|
|
1110
|
-
onClick:
|
|
1115
|
+
onClick: c[1] || (c[1] = (f) => e(s)())
|
|
1111
1116
|
}, {
|
|
1112
1117
|
default: n(() => [
|
|
1113
1118
|
y(b(e(t)("page.cancel")), 1)
|
|
1114
1119
|
]),
|
|
1115
1120
|
_: 1
|
|
1116
1121
|
}),
|
|
1117
|
-
|
|
1122
|
+
g(e(I), {
|
|
1118
1123
|
type: "primary",
|
|
1119
|
-
disabled:
|
|
1120
|
-
onClick:
|
|
1124
|
+
disabled: d.value === null || d.value === r.page.parent_id,
|
|
1125
|
+
onClick: c[2] || (c[2] = (f) => e(l)(d.value))
|
|
1121
1126
|
}, {
|
|
1122
1127
|
default: n(() => [
|
|
1123
1128
|
y(b(e(t)("page.move-confirm")), 1)
|
|
@@ -1129,20 +1134,20 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1129
1134
|
})
|
|
1130
1135
|
]),
|
|
1131
1136
|
default: n(() => [
|
|
1132
|
-
|
|
1137
|
+
g(e(_e), {
|
|
1133
1138
|
direction: "vertical",
|
|
1134
1139
|
size: "md",
|
|
1135
1140
|
fill: ""
|
|
1136
1141
|
}, {
|
|
1137
1142
|
default: n(() => [
|
|
1138
|
-
|
|
1143
|
+
g(e(xe), {
|
|
1139
1144
|
type: "info",
|
|
1140
1145
|
variant: "soft",
|
|
1141
1146
|
description: e(t)("page.move-help")
|
|
1142
1147
|
}, null, 8, ["description"]),
|
|
1143
|
-
|
|
1144
|
-
modelValue:
|
|
1145
|
-
"onUpdate:modelValue":
|
|
1148
|
+
g(Te, {
|
|
1149
|
+
modelValue: d.value,
|
|
1150
|
+
"onUpdate:modelValue": c[0] || (c[0] = (f) => d.value = f),
|
|
1146
1151
|
exclude: [r.page.id]
|
|
1147
1152
|
}, null, 8, ["modelValue", "exclude"])
|
|
1148
1153
|
]),
|
|
@@ -1152,24 +1157,24 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1152
1157
|
_: 1
|
|
1153
1158
|
}, 8, ["open", "title"]));
|
|
1154
1159
|
}
|
|
1155
|
-
}),
|
|
1160
|
+
}), Ht = { class: "wx-pages" }, jt = { class: "wx-pages__title" }, Gt = ["href"], Jt = /* @__PURE__ */ K({
|
|
1156
1161
|
__name: "PagesPage",
|
|
1157
1162
|
props: {
|
|
1158
1163
|
base: { default: "/pages" }
|
|
1159
1164
|
},
|
|
1160
|
-
setup(
|
|
1161
|
-
const r =
|
|
1165
|
+
setup(u) {
|
|
1166
|
+
const r = u, h = G(), l = Z(h), s = ye();
|
|
1162
1167
|
H();
|
|
1163
|
-
const t = F("webx-pages"),
|
|
1168
|
+
const t = F("webx-pages"), d = ie(), a = k(null), c = k([]), f = k(!0), i = k(""), T = k(""), x = ze(Kt), C = ze(Ft), _ = W(() => h.can("pages.manage")), p = W(() => T.value === "trashed"), B = W(() => !p.value && i.value.trim() === ""), $ = W(
|
|
1164
1169
|
() => h.state.manifest?.modules.find((o) => o.id === "pages")?.title ?? t("module.title")
|
|
1165
|
-
),
|
|
1170
|
+
), D = W(() => [
|
|
1166
1171
|
{ value: "", label: t("page.filter-all") },
|
|
1167
1172
|
{ value: "draft", label: t("page.filter-draft") },
|
|
1168
1173
|
{ value: "published", label: t("page.filter-published") },
|
|
1169
1174
|
{ value: "modified", label: t("page.filter-modified") },
|
|
1170
1175
|
{ value: "trashed", label: t("page.bin"), icon: "trash" }
|
|
1171
1176
|
]), le = W(
|
|
1172
|
-
() =>
|
|
1177
|
+
() => B.value && a.value ? [{ ...a.value, children_count: 0 }, ...c.value] : c.value
|
|
1173
1178
|
), U = W(() => [
|
|
1174
1179
|
{ key: "title", label: t("page.column-title"), minWidth: 200 },
|
|
1175
1180
|
{ key: "path", label: t("page.column-address"), width: 200, hideBelow: 560 },
|
|
@@ -1177,7 +1182,7 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1177
1182
|
// way — so the column says when it went in, which is what decides whether to bring it back.
|
|
1178
1183
|
{
|
|
1179
1184
|
key: "status",
|
|
1180
|
-
label:
|
|
1185
|
+
label: p.value ? t("page.column-deleted") : t("page.column-status"),
|
|
1181
1186
|
align: "center",
|
|
1182
1187
|
width: 130,
|
|
1183
1188
|
hideBelow: 620
|
|
@@ -1187,11 +1192,11 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1187
1192
|
label: t("page.column-updated"),
|
|
1188
1193
|
width: 180,
|
|
1189
1194
|
hideBelow: 900,
|
|
1190
|
-
hidden:
|
|
1195
|
+
hidden: p.value
|
|
1191
1196
|
},
|
|
1192
1197
|
{ key: "actions", label: "", width: 56, align: "right" }
|
|
1193
1198
|
]), q = W(
|
|
1194
|
-
() =>
|
|
1199
|
+
() => B.value ? {
|
|
1195
1200
|
childrenKey: "children",
|
|
1196
1201
|
hasChildrenKey: "children_count",
|
|
1197
1202
|
lazy: !0,
|
|
@@ -1201,26 +1206,26 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1201
1206
|
allowDrop: ue
|
|
1202
1207
|
} : void 0
|
|
1203
1208
|
);
|
|
1204
|
-
function ue(o, w,
|
|
1205
|
-
return w.is_home ?
|
|
1209
|
+
function ue(o, w, v) {
|
|
1210
|
+
return w.is_home ? v === "inside" : o.id !== w.id;
|
|
1206
1211
|
}
|
|
1207
|
-
async function
|
|
1212
|
+
async function M() {
|
|
1208
1213
|
f.value = !0;
|
|
1209
1214
|
try {
|
|
1210
1215
|
const o = await l.list({
|
|
1211
1216
|
search: i.value.trim(),
|
|
1212
|
-
status:
|
|
1213
|
-
trashed:
|
|
1217
|
+
status: p.value ? "" : T.value,
|
|
1218
|
+
trashed: p.value
|
|
1214
1219
|
});
|
|
1215
|
-
a.value = o.home,
|
|
1220
|
+
a.value = o.home, c.value = o.items;
|
|
1216
1221
|
} catch (o) {
|
|
1217
|
-
z.danger(
|
|
1222
|
+
z.danger(d(o));
|
|
1218
1223
|
} finally {
|
|
1219
1224
|
f.value = !1;
|
|
1220
1225
|
}
|
|
1221
1226
|
}
|
|
1222
1227
|
function de(o) {
|
|
1223
|
-
o.search !== i.value && (i.value = o.search,
|
|
1228
|
+
o.search !== i.value && (i.value = o.search, M());
|
|
1224
1229
|
}
|
|
1225
1230
|
function ee(o) {
|
|
1226
1231
|
const w = `${r.base}/${o.id}`;
|
|
@@ -1228,13 +1233,13 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1228
1233
|
}
|
|
1229
1234
|
async function ce(o) {
|
|
1230
1235
|
const w = await x({ parent: o });
|
|
1231
|
-
w && (await
|
|
1236
|
+
w && (await M(), ee(w));
|
|
1232
1237
|
}
|
|
1233
1238
|
async function te(o) {
|
|
1234
1239
|
try {
|
|
1235
|
-
await l.duplicate(o.id), z.success(t("page.duplicated")), await
|
|
1240
|
+
await l.duplicate(o.id), z.success(t("page.duplicated")), await M();
|
|
1236
1241
|
} catch (w) {
|
|
1237
|
-
z.danger(
|
|
1242
|
+
z.danger(d(w));
|
|
1238
1243
|
}
|
|
1239
1244
|
}
|
|
1240
1245
|
async function L(o) {
|
|
@@ -1242,28 +1247,28 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1242
1247
|
w != null && await ne(o, w, "inside");
|
|
1243
1248
|
}
|
|
1244
1249
|
async function ge(o) {
|
|
1245
|
-
const w = o.zone === "inside" ? o.target.id : o.target.parent_id,
|
|
1246
|
-
if (w !== o.row.parent_id &&
|
|
1250
|
+
const w = o.zone === "inside" ? o.target.id : o.target.parent_id, v = o.row.descendants_count + 1;
|
|
1251
|
+
if (w !== o.row.parent_id && v > 1 && !await O({
|
|
1247
1252
|
title: t("page.move-title", { title: o.row.title }),
|
|
1248
|
-
message: t("page.move-branch", { count:
|
|
1253
|
+
message: t("page.move-branch", { count: v }),
|
|
1249
1254
|
confirmText: t("page.move-confirm"),
|
|
1250
1255
|
cancelText: t("page.cancel")
|
|
1251
1256
|
})) {
|
|
1252
|
-
await
|
|
1257
|
+
await M();
|
|
1253
1258
|
return;
|
|
1254
1259
|
}
|
|
1255
1260
|
await ne(o.row, o.target.id, o.zone);
|
|
1256
1261
|
}
|
|
1257
|
-
async function ne(o, w,
|
|
1262
|
+
async function ne(o, w, v) {
|
|
1258
1263
|
try {
|
|
1259
|
-
const X = await l.move(o.id, w,
|
|
1264
|
+
const X = await l.move(o.id, w, v);
|
|
1260
1265
|
z.success(
|
|
1261
1266
|
X.addresses_changed > 1 ? t("page.moved", { count: X.addresses_changed }) : t("page.moved-one")
|
|
1262
1267
|
);
|
|
1263
1268
|
} catch (X) {
|
|
1264
|
-
z.danger(
|
|
1269
|
+
z.danger(d(X));
|
|
1265
1270
|
} finally {
|
|
1266
|
-
await
|
|
1271
|
+
await M();
|
|
1267
1272
|
}
|
|
1268
1273
|
}
|
|
1269
1274
|
async function ve(o) {
|
|
@@ -1279,9 +1284,9 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1279
1284
|
tone: "danger"
|
|
1280
1285
|
}))
|
|
1281
1286
|
try {
|
|
1282
|
-
await l.remove(o.id), z.success(t("page.deleted")), await
|
|
1283
|
-
} catch (
|
|
1284
|
-
z.danger(
|
|
1287
|
+
await l.remove(o.id), z.success(t("page.deleted")), await M();
|
|
1288
|
+
} catch (v) {
|
|
1289
|
+
z.danger(d(v));
|
|
1285
1290
|
}
|
|
1286
1291
|
}
|
|
1287
1292
|
async function he(o) {
|
|
@@ -1292,12 +1297,12 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1292
1297
|
cancelText: t("page.cancel")
|
|
1293
1298
|
}))
|
|
1294
1299
|
try {
|
|
1295
|
-
const
|
|
1300
|
+
const v = await l.restore(o.id);
|
|
1296
1301
|
z.success(
|
|
1297
|
-
|
|
1298
|
-
), await
|
|
1299
|
-
} catch (
|
|
1300
|
-
z.danger(
|
|
1302
|
+
v > 1 ? t("page.restored-branch", { count: v }) : t("page.restored")
|
|
1303
|
+
), await M();
|
|
1304
|
+
} catch (v) {
|
|
1305
|
+
z.danger(d(v));
|
|
1301
1306
|
}
|
|
1302
1307
|
}
|
|
1303
1308
|
async function J(o) {
|
|
@@ -1311,39 +1316,39 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1311
1316
|
return o === "published" ? "success" : o === "modified" ? "warning" : "default";
|
|
1312
1317
|
}
|
|
1313
1318
|
return ae(T, () => {
|
|
1314
|
-
|
|
1315
|
-
}), pe(
|
|
1316
|
-
|
|
1319
|
+
M();
|
|
1320
|
+
}), pe(M), (o, w) => (m(), A("div", Ht, [
|
|
1321
|
+
g(e(tt), {
|
|
1317
1322
|
view: T.value,
|
|
1318
|
-
"onUpdate:view": w[2] || (w[2] = (
|
|
1323
|
+
"onUpdate:view": w[2] || (w[2] = (v) => T.value = v),
|
|
1319
1324
|
title: $.value,
|
|
1320
|
-
views:
|
|
1325
|
+
views: D.value
|
|
1321
1326
|
}, Je({
|
|
1322
1327
|
default: n(() => [
|
|
1323
|
-
|
|
1328
|
+
g(e(ct), {
|
|
1324
1329
|
data: le.value,
|
|
1325
1330
|
columns: U.value,
|
|
1326
1331
|
"row-key": "id",
|
|
1327
1332
|
tree: q.value,
|
|
1328
1333
|
searchable: "",
|
|
1329
|
-
clickable: !
|
|
1330
|
-
hover: !
|
|
1334
|
+
clickable: !p.value,
|
|
1335
|
+
hover: !p.value,
|
|
1331
1336
|
flush: "",
|
|
1332
1337
|
layout: "fixed",
|
|
1333
1338
|
loading: f.value,
|
|
1334
1339
|
"cards-below": 0,
|
|
1335
1340
|
"search-placeholder": e(t)("page.search"),
|
|
1336
|
-
"empty-text":
|
|
1341
|
+
"empty-text": p.value ? e(t)("page.empty-bin") : i.value ? e(t)("page.empty-search") : e(t)("page.empty"),
|
|
1337
1342
|
"aria-label": $.value,
|
|
1338
1343
|
onRowClick: ee,
|
|
1339
1344
|
onStateChange: de,
|
|
1340
1345
|
onNodeDrop: ge
|
|
1341
1346
|
}, {
|
|
1342
|
-
"cell-title": n(({ row:
|
|
1343
|
-
E("span",
|
|
1347
|
+
"cell-title": n(({ row: v }) => [
|
|
1348
|
+
E("span", jt, b(v.is_home ? e(t)("pages.home") : v.title), 1)
|
|
1344
1349
|
]),
|
|
1345
|
-
"cell-path": n(({ row:
|
|
1346
|
-
|
|
1350
|
+
"cell-path": n(({ row: v }) => [
|
|
1351
|
+
p.value ? (m(), V(e(R), {
|
|
1347
1352
|
key: 0,
|
|
1348
1353
|
size: "sm",
|
|
1349
1354
|
tone: "muted"
|
|
@@ -1352,22 +1357,22 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1352
1357
|
y("—", -1)
|
|
1353
1358
|
])]),
|
|
1354
1359
|
_: 1
|
|
1355
|
-
})) :
|
|
1360
|
+
})) : v.url && v.status !== "draft" ? (m(), A("a", {
|
|
1356
1361
|
key: 1,
|
|
1357
1362
|
class: "wx-pages__address",
|
|
1358
|
-
href:
|
|
1363
|
+
href: v.url,
|
|
1359
1364
|
target: "_blank",
|
|
1360
1365
|
rel: "noopener",
|
|
1361
1366
|
onClick: w[1] || (w[1] = Qe(() => {
|
|
1362
1367
|
}, ["stop"]))
|
|
1363
|
-
}, " /" + b(
|
|
1368
|
+
}, " /" + b(v.path), 9, Gt)) : v.path !== null ? (m(), V(e(R), {
|
|
1364
1369
|
key: 2,
|
|
1365
1370
|
mono: "",
|
|
1366
1371
|
size: "sm",
|
|
1367
1372
|
tone: "muted"
|
|
1368
1373
|
}, {
|
|
1369
1374
|
default: n(() => [
|
|
1370
|
-
y("/" + b(
|
|
1375
|
+
y("/" + b(v.path), 1)
|
|
1371
1376
|
]),
|
|
1372
1377
|
_: 2
|
|
1373
1378
|
}, 1024)) : (m(), V(e(R), {
|
|
@@ -1381,42 +1386,42 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1381
1386
|
_: 1
|
|
1382
1387
|
}))
|
|
1383
1388
|
]),
|
|
1384
|
-
"cell-status": n(({ row:
|
|
1385
|
-
|
|
1389
|
+
"cell-status": n(({ row: v }) => [
|
|
1390
|
+
p.value ? (m(), V(e(me), {
|
|
1386
1391
|
key: 0,
|
|
1387
|
-
value:
|
|
1392
|
+
value: v.deleted_at
|
|
1388
1393
|
}, null, 8, ["value"])) : (m(), V(e(we), {
|
|
1389
1394
|
key: 1,
|
|
1390
|
-
type: Q(
|
|
1395
|
+
type: Q(v.status),
|
|
1391
1396
|
dot: ""
|
|
1392
1397
|
}, {
|
|
1393
1398
|
default: n(() => [
|
|
1394
|
-
y(b(e(t)(`page.status-${
|
|
1399
|
+
y(b(e(t)(`page.status-${v.status}`)), 1)
|
|
1395
1400
|
]),
|
|
1396
1401
|
_: 2
|
|
1397
1402
|
}, 1032, ["type"]))
|
|
1398
1403
|
]),
|
|
1399
|
-
"cell-updated_at": n(({ row:
|
|
1400
|
-
|
|
1404
|
+
"cell-updated_at": n(({ row: v }) => [
|
|
1405
|
+
g(e(R), {
|
|
1401
1406
|
size: "sm",
|
|
1402
1407
|
tone: "muted"
|
|
1403
1408
|
}, {
|
|
1404
1409
|
default: n(() => [
|
|
1405
|
-
|
|
1406
|
-
value:
|
|
1410
|
+
g(e(me), {
|
|
1411
|
+
value: v.updated_at
|
|
1407
1412
|
}, null, 8, ["value"]),
|
|
1408
|
-
|
|
1409
|
-
y(", " + b(
|
|
1413
|
+
v.edited_by && !p.value ? (m(), A(j, { key: 0 }, [
|
|
1414
|
+
y(", " + b(v.edited_by), 1)
|
|
1410
1415
|
], 64)) : N("", !0)
|
|
1411
1416
|
]),
|
|
1412
1417
|
_: 2
|
|
1413
1418
|
}, 1024)
|
|
1414
1419
|
]),
|
|
1415
|
-
"cell-actions": n(({ row:
|
|
1416
|
-
_.value ? (m(), V(
|
|
1420
|
+
"cell-actions": n(({ row: v }) => [
|
|
1421
|
+
_.value ? (m(), V(Rt, {
|
|
1417
1422
|
key: 0,
|
|
1418
|
-
page:
|
|
1419
|
-
"in-bin":
|
|
1423
|
+
page: v,
|
|
1424
|
+
"in-bin": p.value,
|
|
1420
1425
|
onOpen: ee,
|
|
1421
1426
|
onAdd: ce,
|
|
1422
1427
|
onDuplicate: te,
|
|
@@ -1434,10 +1439,10 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1434
1439
|
_.value ? {
|
|
1435
1440
|
name: "actions",
|
|
1436
1441
|
fn: n(() => [
|
|
1437
|
-
|
|
1442
|
+
g(e(I), {
|
|
1438
1443
|
type: "primary",
|
|
1439
1444
|
icon: "plus",
|
|
1440
|
-
onClick: w[0] || (w[0] = (
|
|
1445
|
+
onClick: w[0] || (w[0] = (v) => ce(null))
|
|
1441
1446
|
}, {
|
|
1442
1447
|
default: n(() => [
|
|
1443
1448
|
y(b(e(t)("page.new")), 1)
|
|
@@ -1450,18 +1455,18 @@ const Ot = /* @__PURE__ */ K({
|
|
|
1450
1455
|
]), 1032, ["view", "title", "views"])
|
|
1451
1456
|
]));
|
|
1452
1457
|
}
|
|
1453
|
-
}),
|
|
1454
|
-
function
|
|
1455
|
-
const r =
|
|
1458
|
+
}), Qt = /* @__PURE__ */ re(Jt, [["__scopeId", "data-v-6c1123b3"]]);
|
|
1459
|
+
function ta(u = {}) {
|
|
1460
|
+
const r = u.path ?? "/pages";
|
|
1456
1461
|
return {
|
|
1457
1462
|
id: "pages",
|
|
1458
1463
|
path: r,
|
|
1459
1464
|
routes: [
|
|
1460
|
-
{ path: r, name: "webx.pages", component:
|
|
1465
|
+
{ path: r, name: "webx.pages", component: Qt, props: { base: r } },
|
|
1461
1466
|
{
|
|
1462
1467
|
path: `${r}/:id(\\d+)`,
|
|
1463
1468
|
name: "webx.pages.edit",
|
|
1464
|
-
component:
|
|
1469
|
+
component: Bt,
|
|
1465
1470
|
props: { base: r }
|
|
1466
1471
|
}
|
|
1467
1472
|
],
|
|
@@ -1474,25 +1479,25 @@ function ea(p = {}) {
|
|
|
1474
1479
|
* page from the editor above it rather than from the description.
|
|
1475
1480
|
*/
|
|
1476
1481
|
types: {
|
|
1477
|
-
"wx-page-place": { component:
|
|
1478
|
-
"wx-page-danger": { component:
|
|
1479
|
-
"wx-page-history": { component:
|
|
1482
|
+
"wx-page-place": { component: Ut, kind: "display" },
|
|
1483
|
+
"wx-page-danger": { component: wt, kind: "display" },
|
|
1484
|
+
"wx-page-history": { component: At, kind: "display" }
|
|
1480
1485
|
}
|
|
1481
1486
|
};
|
|
1482
1487
|
}
|
|
1483
1488
|
export {
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1489
|
+
wt as WxPageDanger,
|
|
1490
|
+
Bt as WxPageEditorPage,
|
|
1491
|
+
At as WxPageHistory,
|
|
1487
1492
|
Te as WxPagePicker,
|
|
1488
|
-
|
|
1489
|
-
|
|
1493
|
+
Ut as WxPagePlace,
|
|
1494
|
+
Qt as WxPagesPage,
|
|
1490
1495
|
Z as createPagesApi,
|
|
1491
1496
|
Ee as pageEditorKey,
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1497
|
+
ta as pages,
|
|
1498
|
+
vt as pagesMessages,
|
|
1499
|
+
gt as providePageEditor,
|
|
1500
|
+
Ot as slugify,
|
|
1496
1501
|
ke as usePageEditor
|
|
1497
1502
|
};
|
|
1498
1503
|
//# sourceMappingURL=index.js.map
|