@webx-ui/module-pages 0.1.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/PageActions.d.ts +7 -8
- package/dist/PageEditorPage.d.ts +3 -3
- package/dist/PagesPage.d.ts +1 -3
- package/dist/index.js +707 -807
- 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
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { useAdmin as
|
|
4
|
-
import { WxCard as
|
|
5
|
-
import { provideBlocksPreview as
|
|
6
|
-
function Z(
|
|
7
|
-
const
|
|
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
|
+
import { useRouter as ye, useRoute as Xe, onBeforeRouteLeave as Ye } from "vue-router";
|
|
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
|
-
const
|
|
11
|
-
l.parent != null &&
|
|
12
|
-
const t =
|
|
13
|
-
return
|
|
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");
|
|
12
|
+
const t = s.size > 0 ? `?${s}` : "";
|
|
13
|
+
return u.http.get(`${r}${t}`).then(h);
|
|
14
14
|
},
|
|
15
|
-
get: (l) =>
|
|
16
|
-
create: (l) =>
|
|
17
|
-
save: (l,
|
|
18
|
-
move: (l,
|
|
19
|
-
duplicate: (l) =>
|
|
20
|
-
publish: (l) =>
|
|
21
|
-
unpublish: (l) =>
|
|
22
|
-
remove: (l) =>
|
|
23
|
-
restore: (l) =>
|
|
24
|
-
versions: (l) =>
|
|
25
|
-
restoreVersion: (l,
|
|
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
|
-
const
|
|
29
|
-
function
|
|
30
|
-
|
|
28
|
+
const Ee = /* @__PURE__ */ Symbol("wx-page-editor");
|
|
29
|
+
function gt(u) {
|
|
30
|
+
Oe(Ee, u);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function ke() {
|
|
33
|
+
return Le(Ee, null);
|
|
34
34
|
}
|
|
35
|
-
const
|
|
35
|
+
const vt = {
|
|
36
36
|
module: {
|
|
37
37
|
title: "Pages"
|
|
38
38
|
},
|
|
@@ -78,6 +78,7 @@ const pt = {
|
|
|
78
78
|
"move-title": "Move “:title”",
|
|
79
79
|
"move-help": "Pick the page it goes inside. Everything under it moves too, and their addresses change with it.",
|
|
80
80
|
"move-confirm": "Move",
|
|
81
|
+
"move-branch": ":count addresses change — the page and everything inside it. The old ones will redirect to the new ones.",
|
|
81
82
|
moved: "Moved. :count addresses changed; the old ones now redirect to the new ones.",
|
|
82
83
|
"moved-one": "Moved. The address changed; the old one now redirects to it.",
|
|
83
84
|
"delete-title": "Delete “:title”?",
|
|
@@ -85,6 +86,10 @@ const pt = {
|
|
|
85
86
|
"delete-branch": "The :count pages inside it go with it.",
|
|
86
87
|
deleted: "The page is in the bin.",
|
|
87
88
|
restored: "The page is back.",
|
|
89
|
+
"restore-page-title": "Bring “:title” back?",
|
|
90
|
+
"restore-page-text": "The page leaves the bin and takes its address back. One that was on the site answers again.",
|
|
91
|
+
"restore-branch": "The :count pages that went in with it come back too.",
|
|
92
|
+
"restored-branch": ":count pages are back.",
|
|
88
93
|
"copy-of": ":title (copy)",
|
|
89
94
|
duplicated: "The copy is ready, and it is not on the site.",
|
|
90
95
|
"address-copied": "The address is on the clipboard.",
|
|
@@ -97,6 +102,9 @@ const pt = {
|
|
|
97
102
|
save: "Save",
|
|
98
103
|
"save-failed": "The page was not saved.",
|
|
99
104
|
publish: "Publish",
|
|
105
|
+
"publish-title": "Put “:title” on the site?",
|
|
106
|
+
"publish-text": "It answers at :address from the moment you do, for everyone.",
|
|
107
|
+
"publish-text-nowhere": "It starts answering on the site from the moment you do, for everyone.",
|
|
100
108
|
published: "The page is on the site.",
|
|
101
109
|
preview: "Preview",
|
|
102
110
|
more: "More",
|
|
@@ -129,129 +137,126 @@ const pt = {
|
|
|
129
137
|
"restore-text": "It becomes the draft. The site keeps showing what is published until you publish this.",
|
|
130
138
|
"restored-version": "Version :number is now the draft."
|
|
131
139
|
}
|
|
132
|
-
},
|
|
133
|
-
function
|
|
140
|
+
}, Ce = /* @__PURE__ */ new WeakSet();
|
|
141
|
+
function H() {
|
|
134
142
|
try {
|
|
135
|
-
const { i18n:
|
|
136
|
-
|
|
143
|
+
const { i18n: u } = G();
|
|
144
|
+
Ce.has(u) || (u.defaults("webx-pages", vt), Ce.add(u));
|
|
137
145
|
} catch {
|
|
138
146
|
}
|
|
139
147
|
}
|
|
140
|
-
const
|
|
148
|
+
const ht = { class: "wx-page-danger" }, ft = {
|
|
141
149
|
key: 0,
|
|
142
150
|
class: "wx-page-danger__row"
|
|
143
|
-
},
|
|
151
|
+
}, mt = { class: "wx-page-danger__what" }, bt = { class: "wx-page-danger__row" }, _t = { class: "wx-page-danger__what" }, yt = /* @__PURE__ */ K({
|
|
144
152
|
name: "WxPageDanger",
|
|
145
153
|
__name: "PageDanger",
|
|
146
|
-
setup(
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
const t =
|
|
150
|
-
async function
|
|
151
|
-
const
|
|
152
|
-
if (!(
|
|
153
|
-
title: t("page.unpublish-title", { title:
|
|
154
|
+
setup(u) {
|
|
155
|
+
const r = G(), h = Z(r), l = ye(), s = ke();
|
|
156
|
+
H();
|
|
157
|
+
const t = F("webx-pages"), d = ie(), a = k(!1), c = W(() => s?.page.value ?? null), f = W(() => r.can("pages.manage"));
|
|
158
|
+
async function i() {
|
|
159
|
+
const x = c.value;
|
|
160
|
+
if (!(!x || !await O({
|
|
161
|
+
title: t("page.unpublish-title", { title: x.title }),
|
|
154
162
|
message: t("page.unpublish-text"),
|
|
155
163
|
confirmText: t("page.unpublish"),
|
|
156
164
|
cancelText: t("page.cancel"),
|
|
157
165
|
tone: "danger"
|
|
158
166
|
}))) {
|
|
159
|
-
|
|
167
|
+
a.value = !0;
|
|
160
168
|
try {
|
|
161
|
-
await
|
|
162
|
-
} catch (
|
|
163
|
-
z.danger(
|
|
169
|
+
await h.unpublish(x.id), await s?.reload(), z.success(t("page.unpublished"));
|
|
170
|
+
} catch (_) {
|
|
171
|
+
z.danger(d(_));
|
|
164
172
|
} finally {
|
|
165
|
-
|
|
173
|
+
a.value = !1;
|
|
166
174
|
}
|
|
167
175
|
}
|
|
168
176
|
}
|
|
169
|
-
async function
|
|
170
|
-
const
|
|
171
|
-
if (!(
|
|
172
|
-
title: t("page.delete-title", { title:
|
|
177
|
+
async function T() {
|
|
178
|
+
const x = c.value;
|
|
179
|
+
if (!(!x || !await O({
|
|
180
|
+
title: t("page.delete-title", { title: x.title }),
|
|
173
181
|
// The whole branch, not the level under it (§7): a catalogue with two sections and forty
|
|
174
182
|
// products is forty-two pages leaving the site at once.
|
|
175
|
-
message:
|
|
183
|
+
message: x.descendants_count > 0 ? `${t("page.delete-text")} ${t("page.delete-branch", { count: x.descendants_count })}` : t("page.delete-text"),
|
|
176
184
|
confirmText: t("page.delete"),
|
|
177
185
|
cancelText: t("page.cancel"),
|
|
178
186
|
tone: "danger"
|
|
179
187
|
}))) {
|
|
180
|
-
|
|
188
|
+
a.value = !0;
|
|
181
189
|
try {
|
|
182
|
-
await
|
|
183
|
-
} catch (
|
|
184
|
-
z.danger(
|
|
190
|
+
await h.remove(x.id), z.success(t("page.deleted")), l.push(s?.base ?? "/pages");
|
|
191
|
+
} catch (_) {
|
|
192
|
+
z.danger(d(_));
|
|
185
193
|
} finally {
|
|
186
|
-
|
|
194
|
+
a.value = !1;
|
|
187
195
|
}
|
|
188
196
|
}
|
|
189
197
|
}
|
|
190
|
-
|
|
191
|
-
return $.body?.message ?? String($);
|
|
192
|
-
}
|
|
193
|
-
return ($, T) => a.value && o.value ? (d(), x(e(Oe), {
|
|
198
|
+
return (x, C) => c.value && f.value ? (m(), V(e(at), {
|
|
194
199
|
key: 0,
|
|
195
200
|
title: e(t)("page.danger")
|
|
196
201
|
}, {
|
|
197
202
|
default: n(() => [
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
203
|
+
E("div", ht, [
|
|
204
|
+
c.value.status !== "draft" ? (m(), A("div", ft, [
|
|
205
|
+
E("div", mt, [
|
|
206
|
+
g(e(R), { weight: "medium" }, {
|
|
202
207
|
default: n(() => [
|
|
203
|
-
|
|
208
|
+
y(b(e(t)("page.unpublish")), 1)
|
|
204
209
|
]),
|
|
205
210
|
_: 1
|
|
206
211
|
}),
|
|
207
|
-
|
|
212
|
+
g(e(R), {
|
|
208
213
|
size: "sm",
|
|
209
214
|
tone: "muted"
|
|
210
215
|
}, {
|
|
211
216
|
default: n(() => [
|
|
212
|
-
|
|
217
|
+
y(b(e(t)("page.unpublish-help")), 1)
|
|
213
218
|
]),
|
|
214
219
|
_: 1
|
|
215
220
|
})
|
|
216
221
|
]),
|
|
217
|
-
|
|
222
|
+
g(e(I), {
|
|
218
223
|
variant: "outline",
|
|
219
|
-
loading:
|
|
220
|
-
onClick:
|
|
224
|
+
loading: a.value,
|
|
225
|
+
onClick: i
|
|
221
226
|
}, {
|
|
222
227
|
default: n(() => [
|
|
223
|
-
|
|
228
|
+
y(b(e(t)("page.unpublish")), 1)
|
|
224
229
|
]),
|
|
225
230
|
_: 1
|
|
226
231
|
}, 8, ["loading"])
|
|
227
|
-
])) :
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
232
|
+
])) : N("", !0),
|
|
233
|
+
E("div", bt, [
|
|
234
|
+
E("div", _t, [
|
|
235
|
+
g(e(R), { weight: "medium" }, {
|
|
231
236
|
default: n(() => [
|
|
232
|
-
|
|
237
|
+
y(b(e(t)("page.delete")), 1)
|
|
233
238
|
]),
|
|
234
239
|
_: 1
|
|
235
240
|
}),
|
|
236
|
-
|
|
241
|
+
g(e(R), {
|
|
237
242
|
size: "sm",
|
|
238
243
|
tone: "muted"
|
|
239
244
|
}, {
|
|
240
245
|
default: n(() => [
|
|
241
|
-
|
|
246
|
+
y(b(c.value.can.delete ? e(t)("page.delete-help") : e(t)("page.delete-home")), 1)
|
|
242
247
|
]),
|
|
243
248
|
_: 1
|
|
244
249
|
})
|
|
245
250
|
]),
|
|
246
|
-
|
|
251
|
+
g(e(I), {
|
|
247
252
|
type: "danger",
|
|
248
253
|
variant: "outline",
|
|
249
|
-
disabled: !
|
|
250
|
-
loading:
|
|
251
|
-
onClick:
|
|
254
|
+
disabled: !c.value.can.delete,
|
|
255
|
+
loading: a.value,
|
|
256
|
+
onClick: T
|
|
252
257
|
}, {
|
|
253
258
|
default: n(() => [
|
|
254
|
-
|
|
259
|
+
y(b(e(t)("page.delete")), 1)
|
|
255
260
|
]),
|
|
256
261
|
_: 1
|
|
257
262
|
}, 8, ["disabled", "loading"])
|
|
@@ -259,79 +264,79 @@ const gt = { class: "wx-page-danger" }, vt = {
|
|
|
259
264
|
])
|
|
260
265
|
]),
|
|
261
266
|
_: 1
|
|
262
|
-
}, 8, ["title"])) :
|
|
267
|
+
}, 8, ["title"])) : N("", !0);
|
|
263
268
|
}
|
|
264
|
-
}),
|
|
265
|
-
const
|
|
266
|
-
for (const [l,
|
|
267
|
-
|
|
268
|
-
return
|
|
269
|
-
},
|
|
269
|
+
}), re = (u, r) => {
|
|
270
|
+
const h = u.__vccOpts || u;
|
|
271
|
+
for (const [l, s] of r)
|
|
272
|
+
h[l] = s;
|
|
273
|
+
return h;
|
|
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({
|
|
270
275
|
__name: "PageEditorPage",
|
|
271
276
|
props: {
|
|
272
277
|
base: { default: "/pages" }
|
|
273
278
|
},
|
|
274
|
-
setup(
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
const a =
|
|
278
|
-
const
|
|
279
|
-
return
|
|
280
|
-
}), ve =
|
|
281
|
-
() =>
|
|
282
|
-
id:
|
|
283
|
-
label:
|
|
279
|
+
setup(u) {
|
|
280
|
+
const r = u, h = G(), l = Z(h), s = Xe(), t = ye(), d = Se();
|
|
281
|
+
H();
|
|
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
|
+
const P = x.value.title;
|
|
284
|
+
return nt(P, d.active.value, i.value?.title ?? "");
|
|
285
|
+
}), ve = W(
|
|
286
|
+
() => T.value.map((P) => ({
|
|
287
|
+
id: P.id,
|
|
288
|
+
label: P.is_home ? a("pages.home") : P.title
|
|
284
289
|
}))
|
|
285
290
|
);
|
|
286
|
-
|
|
287
|
-
page:
|
|
288
|
-
ancestors:
|
|
289
|
-
values:
|
|
290
|
-
prefixes:
|
|
291
|
-
base:
|
|
292
|
-
canManage:
|
|
291
|
+
pt({ url: W(() => _.value), reload: ue }), gt({
|
|
292
|
+
page: i,
|
|
293
|
+
ancestors: T,
|
|
294
|
+
values: x,
|
|
295
|
+
prefixes: p,
|
|
296
|
+
base: r.base,
|
|
297
|
+
canManage: M.value,
|
|
293
298
|
reload: () => J(!0),
|
|
294
|
-
save: () =>
|
|
299
|
+
save: () => v()
|
|
295
300
|
});
|
|
296
|
-
function
|
|
297
|
-
|
|
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, p.value = P.address_prefix, q.value = JSON.stringify(P.values), U.value = null;
|
|
298
303
|
}
|
|
299
|
-
async function J(
|
|
300
|
-
|
|
304
|
+
async function J(P = !1) {
|
|
305
|
+
P || (B.value = !0);
|
|
301
306
|
try {
|
|
302
|
-
|
|
303
|
-
} catch (
|
|
304
|
-
z.danger(
|
|
307
|
+
he(await l.get(f.value));
|
|
308
|
+
} catch (Y) {
|
|
309
|
+
z.danger(c(Y)), t.push(r.base);
|
|
305
310
|
} finally {
|
|
306
|
-
|
|
311
|
+
B.value = !1;
|
|
307
312
|
}
|
|
308
313
|
}
|
|
309
314
|
let Q;
|
|
310
|
-
function
|
|
311
|
-
!
|
|
312
|
-
|
|
313
|
-
},
|
|
315
|
+
function o() {
|
|
316
|
+
!M.value || U.value || !L.value || (clearTimeout(Q), Q = setTimeout(() => {
|
|
317
|
+
v();
|
|
318
|
+
}, Vt));
|
|
314
319
|
}
|
|
315
|
-
function
|
|
316
|
-
!
|
|
320
|
+
function w() {
|
|
321
|
+
!M.value || U.value || !L.value || $.value || (clearTimeout(Q), v());
|
|
317
322
|
}
|
|
318
|
-
async function
|
|
319
|
-
if (!
|
|
323
|
+
async function v() {
|
|
324
|
+
if (!i.value || $.value || !M.value) return;
|
|
320
325
|
clearTimeout(Q);
|
|
321
|
-
const
|
|
322
|
-
|
|
326
|
+
const P = te.value, Y = x.value;
|
|
327
|
+
$.value = !0, le.value = {};
|
|
323
328
|
try {
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
} catch (
|
|
327
|
-
const
|
|
328
|
-
|
|
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));
|
|
329
334
|
} finally {
|
|
330
|
-
|
|
335
|
+
$.value = !1;
|
|
331
336
|
}
|
|
332
337
|
}
|
|
333
|
-
async function
|
|
334
|
-
await
|
|
338
|
+
async function X() {
|
|
339
|
+
await O({
|
|
335
340
|
title: a("page.conflict-theirs-title"),
|
|
336
341
|
message: a("page.conflict-theirs-text"),
|
|
337
342
|
confirmText: a("page.conflict-theirs"),
|
|
@@ -339,371 +344,367 @@ const gt = { class: "wx-page-danger" }, vt = {
|
|
|
339
344
|
tone: "danger"
|
|
340
345
|
}) && await J(!0);
|
|
341
346
|
}
|
|
342
|
-
async function
|
|
343
|
-
const
|
|
344
|
-
|
|
347
|
+
async function Ie() {
|
|
348
|
+
const P = U.value;
|
|
349
|
+
P && (C.value = P.data.revision, U.value = null, await v());
|
|
345
350
|
}
|
|
346
|
-
async function
|
|
347
|
-
if (
|
|
348
|
-
|
|
351
|
+
async function Ue() {
|
|
352
|
+
if (!i.value) return;
|
|
353
|
+
const P = i.value.path === null ? null : `/${i.value.path}`;
|
|
354
|
+
if (await O({
|
|
355
|
+
title: a("page.publish-title", { title: i.value.title }),
|
|
356
|
+
message: P === null ? a("page.publish-text-nowhere") : a("page.publish-text", { address: P }),
|
|
357
|
+
confirmText: a("page.publish"),
|
|
358
|
+
cancelText: a("page.cancel")
|
|
359
|
+
}) && (L.value && await v(), !U.value)) {
|
|
360
|
+
D.value = !0;
|
|
349
361
|
try {
|
|
350
|
-
await l.publish(
|
|
351
|
-
} catch (
|
|
352
|
-
z.danger(
|
|
362
|
+
await l.publish(i.value.id), await J(!0), z.success(a("page.published"));
|
|
363
|
+
} catch (S) {
|
|
364
|
+
z.danger(c(S));
|
|
353
365
|
} finally {
|
|
354
|
-
|
|
366
|
+
D.value = !1;
|
|
355
367
|
}
|
|
356
368
|
}
|
|
357
369
|
}
|
|
358
|
-
function
|
|
359
|
-
return
|
|
360
|
-
}
|
|
361
|
-
function b() {
|
|
362
|
-
return s.value?.status === "published" ? "success" : s.value?.status === "modified" ? "warning" : "default";
|
|
370
|
+
function Re() {
|
|
371
|
+
return i.value?.status === "published" ? "success" : i.value?.status === "modified" ? "warning" : "default";
|
|
363
372
|
}
|
|
364
|
-
function
|
|
365
|
-
|
|
373
|
+
function $e(P) {
|
|
374
|
+
L.value && P.preventDefault();
|
|
366
375
|
}
|
|
367
|
-
return ae(
|
|
376
|
+
return ae(te, o), ae(f, () => {
|
|
368
377
|
J();
|
|
369
|
-
}),
|
|
370
|
-
J(), window.addEventListener("beforeunload",
|
|
371
|
-
}),
|
|
372
|
-
clearTimeout(Q), window.removeEventListener("beforeunload",
|
|
373
|
-
}),
|
|
378
|
+
}), pe(() => {
|
|
379
|
+
J(), window.addEventListener("beforeunload", $e);
|
|
380
|
+
}), Ke(() => {
|
|
381
|
+
clearTimeout(Q), window.removeEventListener("beforeunload", $e);
|
|
382
|
+
}), Ye(async () => !L.value || !M.value || (await v(), !L.value) ? !0 : await O({
|
|
374
383
|
title: a("page.leave-title"),
|
|
375
384
|
message: a("page.leave-text"),
|
|
376
385
|
confirmText: a("page.leave"),
|
|
377
386
|
cancelText: a("page.cancel"),
|
|
378
387
|
tone: "danger"
|
|
379
|
-
})), (
|
|
388
|
+
})), (P, Y) => (m(), A("div", {
|
|
380
389
|
ref_key: "root",
|
|
381
|
-
ref:
|
|
390
|
+
ref: de,
|
|
382
391
|
class: "wx-page-editor",
|
|
383
|
-
|
|
384
|
-
onFocusout: he
|
|
392
|
+
onFocusout: w
|
|
385
393
|
}, [
|
|
386
|
-
|
|
387
|
-
|
|
394
|
+
B.value || !i.value ? (m(), A(j, { key: 0 }, [
|
|
395
|
+
g(e(be), {
|
|
388
396
|
class: "wx-page-editor__ghost",
|
|
389
397
|
title: "",
|
|
390
398
|
rows: 1
|
|
391
399
|
}),
|
|
392
|
-
|
|
393
|
-
], 64)) : (
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
400
|
+
g(e(be), { rows: 8 })
|
|
401
|
+
], 64)) : (m(), A(j, { key: 1 }, [
|
|
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), {
|
|
397
410
|
size: "sm",
|
|
398
411
|
label: e(a)("page.trail")
|
|
399
412
|
}, {
|
|
400
413
|
default: n(() => [
|
|
401
|
-
|
|
414
|
+
g(e(fe), {
|
|
402
415
|
as: "router-link",
|
|
403
|
-
to:
|
|
416
|
+
to: u.base
|
|
404
417
|
}, {
|
|
405
418
|
default: n(() => [
|
|
406
|
-
|
|
419
|
+
y(b(e(a)("module.title")), 1)
|
|
407
420
|
]),
|
|
408
421
|
_: 1
|
|
409
422
|
}, 8, ["to"]),
|
|
410
|
-
(
|
|
411
|
-
key:
|
|
423
|
+
(m(!0), A(j, null, Me(ve.value, (S) => (m(), V(e(fe), {
|
|
424
|
+
key: S.id,
|
|
412
425
|
as: "router-link",
|
|
413
|
-
to: `${
|
|
426
|
+
to: `${u.base}/${S.id}`
|
|
414
427
|
}, {
|
|
415
428
|
default: n(() => [
|
|
416
|
-
|
|
429
|
+
y(b(S.label), 1)
|
|
417
430
|
]),
|
|
418
431
|
_: 2
|
|
419
432
|
}, 1032, ["to"]))), 128)),
|
|
420
|
-
|
|
433
|
+
g(e(fe), { current: "" }, {
|
|
421
434
|
default: n(() => [
|
|
422
|
-
|
|
435
|
+
y(b(i.value.is_home ? e(a)("pages.home") : ne.value), 1)
|
|
423
436
|
]),
|
|
424
437
|
_: 1
|
|
425
438
|
})
|
|
426
439
|
]),
|
|
427
440
|
_: 1
|
|
428
441
|
}, 8, ["label"]),
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
type:
|
|
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), {
|
|
445
|
+
type: Re(),
|
|
433
446
|
dot: ""
|
|
434
447
|
}, {
|
|
435
448
|
default: n(() => [
|
|
436
|
-
|
|
449
|
+
y(b(e(a)(`page.status-${i.value.status}`)), 1)
|
|
437
450
|
]),
|
|
438
451
|
_: 1
|
|
439
|
-
}, 8, ["type"])
|
|
440
|
-
f(e(O), {
|
|
441
|
-
size: "sm",
|
|
442
|
-
tone: "muted",
|
|
443
|
-
class: "wx-page-editor__state"
|
|
444
|
-
}, {
|
|
445
|
-
default: n(() => [
|
|
446
|
-
h(g(e(a)(`page.state-${ne.value}`)), 1)
|
|
447
|
-
]),
|
|
448
|
-
_: 1
|
|
449
|
-
})
|
|
452
|
+
}, 8, ["type"])
|
|
450
453
|
])
|
|
451
454
|
]),
|
|
452
|
-
|
|
453
|
-
|
|
455
|
+
E("div", Pt, [
|
|
456
|
+
ce.value ? (m(), V(e(ot), {
|
|
454
457
|
key: 0,
|
|
455
458
|
align: "end"
|
|
456
459
|
}, {
|
|
457
460
|
trigger: n(() => [
|
|
458
|
-
|
|
461
|
+
g(e(it), {
|
|
459
462
|
type: "more",
|
|
460
463
|
title: e(a)("page.more")
|
|
461
464
|
}, null, 8, ["title"])
|
|
462
465
|
]),
|
|
463
466
|
default: n(() => [
|
|
464
|
-
|
|
467
|
+
_.value ? (m(), V(e(We), {
|
|
465
468
|
key: 0,
|
|
466
469
|
icon: "eye",
|
|
467
|
-
href:
|
|
470
|
+
href: _.value,
|
|
468
471
|
target: "_blank",
|
|
469
472
|
rel: "noopener"
|
|
470
473
|
}, {
|
|
471
474
|
default: n(() => [
|
|
472
|
-
|
|
475
|
+
y(b(e(a)("page.preview")), 1)
|
|
473
476
|
]),
|
|
474
477
|
_: 1
|
|
475
|
-
}, 8, ["href"])) :
|
|
476
|
-
|
|
478
|
+
}, 8, ["href"])) : N("", !0),
|
|
479
|
+
i.value.url && i.value.status !== "draft" ? (m(), V(e(We), {
|
|
477
480
|
key: 1,
|
|
478
481
|
icon: "link",
|
|
479
|
-
href:
|
|
482
|
+
href: i.value.url,
|
|
480
483
|
target: "_blank",
|
|
481
484
|
rel: "noopener"
|
|
482
485
|
}, {
|
|
483
486
|
default: n(() => [
|
|
484
|
-
|
|
485
|
-
]),
|
|
486
|
-
_: 1
|
|
487
|
-
}, 8, ["href"])) : D("", !0),
|
|
488
|
-
I.value ? (d(), x(e(re), {
|
|
489
|
-
key: 2,
|
|
490
|
-
icon: "check",
|
|
491
|
-
disabled: !B.value,
|
|
492
|
-
onClick: K
|
|
493
|
-
}, {
|
|
494
|
-
default: n(() => [
|
|
495
|
-
h(g(e(a)("page.save")), 1)
|
|
487
|
+
y(b(e(a)("page.open-on-site")), 1)
|
|
496
488
|
]),
|
|
497
489
|
_: 1
|
|
498
|
-
}, 8, ["
|
|
490
|
+
}, 8, ["href"])) : N("", !0)
|
|
499
491
|
]),
|
|
500
492
|
_: 1
|
|
501
|
-
})) : (
|
|
502
|
-
|
|
493
|
+
})) : (m(), A(j, { key: 1 }, [
|
|
494
|
+
_.value ? (m(), V(e(I), {
|
|
503
495
|
key: 0,
|
|
504
|
-
variant: "
|
|
496
|
+
variant: "outline",
|
|
505
497
|
icon: "eye",
|
|
506
|
-
href:
|
|
498
|
+
href: _.value,
|
|
507
499
|
target: "_blank",
|
|
508
500
|
rel: "noopener"
|
|
509
501
|
}, {
|
|
510
502
|
default: n(() => [
|
|
511
|
-
|
|
503
|
+
y(b(e(a)("page.preview")), 1)
|
|
512
504
|
]),
|
|
513
505
|
_: 1
|
|
514
|
-
}, 8, ["href"])) :
|
|
515
|
-
|
|
506
|
+
}, 8, ["href"])) : N("", !0),
|
|
507
|
+
i.value.url && i.value.status !== "draft" ? (m(), V(e(I), {
|
|
516
508
|
key: 1,
|
|
517
|
-
variant: "
|
|
509
|
+
variant: "outline",
|
|
518
510
|
icon: "link",
|
|
519
|
-
href:
|
|
511
|
+
href: i.value.url,
|
|
520
512
|
target: "_blank",
|
|
521
513
|
rel: "noopener"
|
|
522
514
|
}, {
|
|
523
515
|
default: n(() => [
|
|
524
|
-
|
|
516
|
+
y(b(e(a)("page.open-on-site")), 1)
|
|
525
517
|
]),
|
|
526
518
|
_: 1
|
|
527
|
-
}, 8, ["href"])) :
|
|
528
|
-
|
|
529
|
-
key: 2,
|
|
530
|
-
variant: "outline",
|
|
531
|
-
loading: W.value,
|
|
532
|
-
disabled: !B.value,
|
|
533
|
-
onClick: K
|
|
534
|
-
}, {
|
|
535
|
-
default: n(() => [
|
|
536
|
-
h(g(e(a)("page.save")), 1)
|
|
537
|
-
]),
|
|
538
|
-
_: 1
|
|
539
|
-
}, 8, ["loading", "disabled"])) : D("", !0)
|
|
540
|
-
], 64)),
|
|
541
|
-
I.value ? (d(), x(e(R), {
|
|
542
|
-
key: 2,
|
|
543
|
-
type: "primary",
|
|
544
|
-
loading: _.value,
|
|
545
|
-
disabled: s.value.status === "published" && !B.value,
|
|
546
|
-
onClick: _e
|
|
547
|
-
}, {
|
|
548
|
-
default: n(() => [
|
|
549
|
-
h(g(e(a)("page.publish")), 1)
|
|
550
|
-
]),
|
|
551
|
-
_: 1
|
|
552
|
-
}, 8, ["loading", "disabled"])) : D("", !0)
|
|
519
|
+
}, 8, ["href"])) : N("", !0)
|
|
520
|
+
], 64))
|
|
553
521
|
])
|
|
554
522
|
]),
|
|
555
|
-
U.value ? (
|
|
523
|
+
U.value ? (m(), V(e(xe), {
|
|
556
524
|
key: 0,
|
|
557
525
|
type: "warning",
|
|
558
526
|
title: e(a)("page.conflict-title"),
|
|
559
527
|
description: U.value.message
|
|
560
528
|
}, {
|
|
561
529
|
actions: n(() => [
|
|
562
|
-
|
|
530
|
+
g(e(I), {
|
|
563
531
|
size: "sm",
|
|
564
532
|
variant: "outline",
|
|
565
|
-
onClick:
|
|
533
|
+
onClick: X
|
|
566
534
|
}, {
|
|
567
535
|
default: n(() => [
|
|
568
|
-
|
|
536
|
+
y(b(e(a)("page.conflict-theirs")), 1)
|
|
569
537
|
]),
|
|
570
538
|
_: 1
|
|
571
539
|
}),
|
|
572
|
-
|
|
540
|
+
g(e(I), {
|
|
573
541
|
size: "sm",
|
|
574
542
|
type: "primary",
|
|
575
|
-
onClick:
|
|
543
|
+
onClick: Ie
|
|
576
544
|
}, {
|
|
577
545
|
default: n(() => [
|
|
578
|
-
|
|
546
|
+
y(b(e(a)("page.conflict-mine")), 1)
|
|
579
547
|
]),
|
|
580
548
|
_: 1
|
|
581
549
|
})
|
|
582
550
|
]),
|
|
583
551
|
_: 1
|
|
584
|
-
}, 8, ["title", "description"])) :
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
modelValue:
|
|
588
|
-
"onUpdate:modelValue":
|
|
552
|
+
}, 8, ["title", "description"])) : N("", !0),
|
|
553
|
+
E("div", Wt, [
|
|
554
|
+
g(e(qe), {
|
|
555
|
+
modelValue: x.value,
|
|
556
|
+
"onUpdate:modelValue": Y[0] || (Y[0] = (S) => x.value = S),
|
|
589
557
|
name: "pages.form",
|
|
590
|
-
errors:
|
|
591
|
-
disabled: !
|
|
558
|
+
errors: le.value,
|
|
559
|
+
disabled: !M.value || D.value
|
|
592
560
|
}, null, 8, ["modelValue", "errors", "disabled"])
|
|
593
|
-
])
|
|
561
|
+
]),
|
|
562
|
+
M.value ? (m(), V(e(rt), { key: 1 }, {
|
|
563
|
+
state: n(() => [
|
|
564
|
+
g(e(R), {
|
|
565
|
+
size: "sm",
|
|
566
|
+
tone: "muted"
|
|
567
|
+
}, {
|
|
568
|
+
default: n(() => [
|
|
569
|
+
y(b(e(a)(`page.state-${ge.value}`)), 1)
|
|
570
|
+
]),
|
|
571
|
+
_: 1
|
|
572
|
+
})
|
|
573
|
+
]),
|
|
574
|
+
default: n(() => [
|
|
575
|
+
g(e(I), {
|
|
576
|
+
variant: "outline",
|
|
577
|
+
loading: $.value,
|
|
578
|
+
disabled: !L.value,
|
|
579
|
+
onClick: v
|
|
580
|
+
}, {
|
|
581
|
+
default: n(() => [
|
|
582
|
+
y(b(e(a)("page.save")), 1)
|
|
583
|
+
]),
|
|
584
|
+
_: 1
|
|
585
|
+
}, 8, ["loading", "disabled"]),
|
|
586
|
+
g(e(I), {
|
|
587
|
+
type: "primary",
|
|
588
|
+
loading: D.value,
|
|
589
|
+
disabled: i.value.status === "published" && !L.value,
|
|
590
|
+
onClick: Ue
|
|
591
|
+
}, {
|
|
592
|
+
default: n(() => [
|
|
593
|
+
y(b(e(a)("page.publish")), 1)
|
|
594
|
+
]),
|
|
595
|
+
_: 1
|
|
596
|
+
}, 8, ["loading", "disabled"])
|
|
597
|
+
]),
|
|
598
|
+
_: 1
|
|
599
|
+
})) : N("", !0)
|
|
594
600
|
], 64))
|
|
595
601
|
], 544));
|
|
596
602
|
}
|
|
597
|
-
}),
|
|
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({
|
|
598
604
|
name: "WxPageHistory",
|
|
599
605
|
__name: "PageHistory",
|
|
600
|
-
setup(
|
|
601
|
-
const
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
() =>
|
|
606
|
+
setup(u) {
|
|
607
|
+
const r = G(), h = Z(r), l = ke();
|
|
608
|
+
H();
|
|
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
|
|
605
611
|
);
|
|
606
|
-
async function
|
|
607
|
-
const
|
|
608
|
-
if (
|
|
612
|
+
async function T() {
|
|
613
|
+
const C = c.value;
|
|
614
|
+
if (C)
|
|
609
615
|
try {
|
|
610
|
-
|
|
611
|
-
} catch (
|
|
612
|
-
|
|
616
|
+
d.value = await h.versions(C.id);
|
|
617
|
+
} catch (_) {
|
|
618
|
+
d.value = [], z.danger(t(_));
|
|
613
619
|
}
|
|
614
620
|
}
|
|
615
|
-
async function
|
|
616
|
-
const
|
|
617
|
-
if (!(!
|
|
618
|
-
title:
|
|
619
|
-
message:
|
|
620
|
-
confirmText:
|
|
621
|
-
cancelText:
|
|
621
|
+
async function x(C) {
|
|
622
|
+
const _ = c.value;
|
|
623
|
+
if (!(!_ || !await O({
|
|
624
|
+
title: s("page.restore-title", { number: C.number }),
|
|
625
|
+
message: s("page.restore-text"),
|
|
626
|
+
confirmText: s("page.restore"),
|
|
627
|
+
cancelText: s("page.cancel")
|
|
622
628
|
}))) {
|
|
623
|
-
|
|
629
|
+
a.value = !0;
|
|
624
630
|
try {
|
|
625
|
-
await
|
|
626
|
-
} catch (
|
|
627
|
-
z.danger(
|
|
631
|
+
await h.restoreVersion(_.id, C.number), await l?.reload(), z.success(s("page.restored-version", { number: C.number }));
|
|
632
|
+
} catch (B) {
|
|
633
|
+
z.danger(t(B));
|
|
628
634
|
} finally {
|
|
629
|
-
|
|
635
|
+
a.value = !1;
|
|
630
636
|
}
|
|
631
637
|
}
|
|
632
638
|
}
|
|
633
|
-
function $(y) {
|
|
634
|
-
return y.created_at ? new Date(y.created_at).toLocaleString(u.i18n.state.locale) : "";
|
|
635
|
-
}
|
|
636
|
-
function T(y) {
|
|
637
|
-
return y.body?.message ?? String(y);
|
|
638
|
-
}
|
|
639
639
|
return ae(
|
|
640
|
-
() => [
|
|
640
|
+
() => [c.value?.id, c.value?.published_at, c.value?.updated_at],
|
|
641
641
|
() => {
|
|
642
|
-
|
|
642
|
+
T();
|
|
643
643
|
},
|
|
644
644
|
{
|
|
645
645
|
immediate: !0
|
|
646
646
|
}
|
|
647
|
-
), (
|
|
648
|
-
|
|
647
|
+
), (C, _) => (m(), A("div", Mt, [
|
|
648
|
+
d.value === null ? (m(), V(e(be), {
|
|
649
649
|
key: 0,
|
|
650
|
+
class: "wx-page-history__ghost",
|
|
650
651
|
rows: 3
|
|
651
|
-
})) :
|
|
652
|
+
})) : d.value.length === 0 ? (m(), V(e(ut), {
|
|
652
653
|
key: 1,
|
|
653
|
-
description: e(
|
|
654
|
-
}, null, 8, ["description"])) : (
|
|
655
|
-
key:
|
|
656
|
-
class:
|
|
654
|
+
description: e(s)("page.history-empty")
|
|
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 }])
|
|
657
658
|
}, [
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
},
|
|
666
|
-
|
|
659
|
+
E("code", Dt, b(e(s)("page.version", { number: p.number })), 1),
|
|
660
|
+
E("div", St, [
|
|
661
|
+
p.created_at ? (m(), V(e(me), {
|
|
662
|
+
key: 0,
|
|
663
|
+
value: p.created_at,
|
|
664
|
+
size: "md",
|
|
665
|
+
tone: "default"
|
|
666
|
+
}, null, 8, ["value"])) : N("", !0),
|
|
667
|
+
g(e(R), {
|
|
667
668
|
size: "sm",
|
|
668
669
|
tone: "muted"
|
|
669
670
|
}, {
|
|
670
671
|
default: n(() => [
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
], 64)) :
|
|
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)
|
|
675
|
+
], 64)) : N("", !0)
|
|
675
676
|
]),
|
|
676
677
|
_: 2
|
|
677
678
|
}, 1024)
|
|
678
679
|
]),
|
|
679
|
-
|
|
680
|
+
p.number === i.value ? (m(), V(e(we), {
|
|
680
681
|
key: 0,
|
|
681
682
|
type: "success",
|
|
682
683
|
dot: ""
|
|
683
684
|
}, {
|
|
684
685
|
default: n(() => [
|
|
685
|
-
|
|
686
|
+
y(b(e(s)("page.version-live")), 1)
|
|
686
687
|
]),
|
|
687
688
|
_: 1
|
|
688
|
-
})) :
|
|
689
|
-
|
|
689
|
+
})) : N("", !0),
|
|
690
|
+
f.value && p.number !== i.value ? (m(), V(e(I), {
|
|
690
691
|
key: 1,
|
|
691
692
|
size: "sm",
|
|
692
693
|
variant: "outline",
|
|
693
|
-
loading:
|
|
694
|
-
onClick: (
|
|
694
|
+
loading: a.value,
|
|
695
|
+
onClick: (B) => x(p)
|
|
695
696
|
}, {
|
|
696
697
|
default: n(() => [
|
|
697
|
-
|
|
698
|
+
y(b(e(s)("page.restore")), 1)
|
|
698
699
|
]),
|
|
699
700
|
_: 1
|
|
700
|
-
}, 8, ["loading", "onClick"])) :
|
|
701
|
+
}, 8, ["loading", "onClick"])) : N("", !0)
|
|
701
702
|
], 2))), 128))
|
|
702
703
|
]));
|
|
703
704
|
}
|
|
704
|
-
}), At = /* @__PURE__ */
|
|
705
|
+
}), At = /* @__PURE__ */ re(Nt, [["__scopeId", "data-v-41bcd106"]]), Te = /* @__PURE__ */ K({
|
|
705
706
|
__name: "PagePicker",
|
|
706
|
-
props: /* @__PURE__ */
|
|
707
|
+
props: /* @__PURE__ */ je({
|
|
707
708
|
exclude: { default: () => [] },
|
|
708
709
|
placeholder: { default: void 0 },
|
|
709
710
|
selected: { default: () => [] }
|
|
@@ -712,284 +713,205 @@ const gt = { class: "wx-page-danger" }, vt = {
|
|
|
712
713
|
modelModifiers: {}
|
|
713
714
|
}),
|
|
714
715
|
emits: ["update:modelValue"],
|
|
715
|
-
setup(
|
|
716
|
-
const
|
|
717
|
-
|
|
718
|
-
const t =
|
|
719
|
-
|
|
720
|
-
const
|
|
721
|
-
|
|
716
|
+
setup(u) {
|
|
717
|
+
const r = u, h = He(u, "modelValue"), l = G(), s = Z(l);
|
|
718
|
+
H();
|
|
719
|
+
const t = F("webx-pages"), d = k([]);
|
|
720
|
+
pe(async () => {
|
|
721
|
+
const f = await s.list();
|
|
722
|
+
f.home && (d.value = [
|
|
722
723
|
a(
|
|
723
|
-
|
|
724
|
-
|
|
724
|
+
f.home,
|
|
725
|
+
f.items.map((i) => a(i))
|
|
725
726
|
)
|
|
726
727
|
]);
|
|
727
728
|
});
|
|
728
|
-
function a(
|
|
729
|
+
function a(f, i) {
|
|
729
730
|
return {
|
|
730
|
-
id:
|
|
731
|
-
label:
|
|
732
|
-
disabled:
|
|
733
|
-
leaf:
|
|
734
|
-
...
|
|
731
|
+
id: f.id,
|
|
732
|
+
label: f.is_home ? t("pages.home") : f.title,
|
|
733
|
+
disabled: r.exclude.includes(f.id),
|
|
734
|
+
leaf: f.children_count === 0,
|
|
735
|
+
...i ? { children: i } : {}
|
|
735
736
|
};
|
|
736
737
|
}
|
|
737
|
-
async function
|
|
738
|
-
return (await
|
|
738
|
+
async function c(f) {
|
|
739
|
+
return (await s.list({ parent: Number(f.id) })).items.map((T) => a(T));
|
|
739
740
|
}
|
|
740
|
-
return (
|
|
741
|
-
modelValue:
|
|
742
|
-
"onUpdate:modelValue":
|
|
743
|
-
nodes:
|
|
741
|
+
return (f, i) => (m(), V(e(dt), {
|
|
742
|
+
modelValue: h.value,
|
|
743
|
+
"onUpdate:modelValue": i[0] || (i[0] = (T) => h.value = T),
|
|
744
|
+
nodes: d.value,
|
|
744
745
|
lazy: "",
|
|
745
|
-
load:
|
|
746
|
+
load: c,
|
|
746
747
|
"show-path": "",
|
|
747
748
|
clearable: "",
|
|
748
|
-
"selected-path":
|
|
749
|
-
id:
|
|
750
|
-
label:
|
|
749
|
+
"selected-path": r.selected.map((T) => ({
|
|
750
|
+
id: T.id,
|
|
751
|
+
label: T.is_home ? e(t)("pages.home") : T.title
|
|
751
752
|
})),
|
|
752
|
-
placeholder:
|
|
753
|
+
placeholder: r.placeholder ?? e(t)("page.field-parent"),
|
|
753
754
|
"aria-label": e(t)("page.field-parent"),
|
|
754
755
|
teleport: ""
|
|
755
756
|
}, null, 8, ["modelValue", "nodes", "selected-path", "placeholder", "aria-label"]));
|
|
756
757
|
}
|
|
757
|
-
}),
|
|
758
|
+
}), Et = {
|
|
758
759
|
key: 0,
|
|
759
760
|
class: "wx-page-place"
|
|
760
|
-
},
|
|
761
|
+
}, It = /* @__PURE__ */ K({
|
|
761
762
|
name: "WxPagePlace",
|
|
762
763
|
__name: "PagePlace",
|
|
763
|
-
setup(
|
|
764
|
-
const
|
|
765
|
-
|
|
766
|
-
const t =
|
|
767
|
-
const
|
|
768
|
-
return typeof
|
|
769
|
-
}),
|
|
764
|
+
setup(u) {
|
|
765
|
+
const r = G(), h = Z(r), l = ke(), s = Se();
|
|
766
|
+
H();
|
|
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(() => {
|
|
768
|
+
const _ = l?.values.value.slug;
|
|
769
|
+
return typeof _ == "string" ? _ : _?.[s.active.value] ?? "";
|
|
770
|
+
}), x = W(() => f.value?.is_home ? "/" : i.value === null || T.value === "" ? null : `/${[i.value, T.value].filter(Boolean).join("/")}`);
|
|
770
771
|
ae(
|
|
771
|
-
|
|
772
|
-
(
|
|
773
|
-
|
|
772
|
+
f,
|
|
773
|
+
(_) => {
|
|
774
|
+
c.value = _?.parent_id ?? null;
|
|
774
775
|
},
|
|
775
776
|
{ immediate: !0 }
|
|
776
777
|
);
|
|
777
|
-
async function
|
|
778
|
-
const
|
|
779
|
-
if (!
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
778
|
+
async function C(_) {
|
|
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 }),
|
|
785
|
+
confirmText: t("page.move-confirm"),
|
|
786
|
+
cancelText: t("page.cancel")
|
|
787
|
+
})) {
|
|
788
|
+
c.value = p.parent_id;
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
a.value = !0;
|
|
792
|
+
try {
|
|
793
|
+
const $ = await h.move(p.id, _, "inside");
|
|
794
|
+
z.success(
|
|
795
|
+
$.addresses_changed > 1 ? t("page.moved", { count: $.addresses_changed }) : t("page.moved-one")
|
|
796
|
+
), await l?.reload();
|
|
797
|
+
} catch ($) {
|
|
798
|
+
z.danger(d($)), c.value = p.parent_id;
|
|
799
|
+
} finally {
|
|
800
|
+
a.value = !1;
|
|
791
801
|
}
|
|
792
802
|
}
|
|
793
|
-
return (
|
|
794
|
-
|
|
803
|
+
return (_, p) => f.value ? (m(), A("div", Et, [
|
|
804
|
+
g(e(oe), {
|
|
795
805
|
label: e(t)("page.address")
|
|
796
806
|
}, {
|
|
797
807
|
default: n(() => [
|
|
798
|
-
|
|
808
|
+
x.value ? (m(), V(e(R), {
|
|
799
809
|
key: 0,
|
|
800
810
|
mono: "",
|
|
801
811
|
class: "wx-page-place__address"
|
|
802
812
|
}, {
|
|
803
813
|
default: n(() => [
|
|
804
|
-
|
|
814
|
+
y(b(x.value), 1)
|
|
805
815
|
]),
|
|
806
816
|
_: 1
|
|
807
|
-
})) : (
|
|
817
|
+
})) : (m(), V(e(R), {
|
|
808
818
|
key: 1,
|
|
809
819
|
size: "sm",
|
|
810
820
|
tone: "muted"
|
|
811
821
|
}, {
|
|
812
822
|
default: n(() => [
|
|
813
|
-
|
|
823
|
+
y(b(e(t)("page.no-address")), 1)
|
|
814
824
|
]),
|
|
815
825
|
_: 1
|
|
816
826
|
}))
|
|
817
827
|
]),
|
|
818
828
|
_: 1
|
|
819
829
|
}, 8, ["label"]),
|
|
820
|
-
|
|
821
|
-
|
|
830
|
+
f.value.can.move ? (m(), A(j, { key: 0 }, [
|
|
831
|
+
g(e(oe), {
|
|
822
832
|
label: e(t)("page.field-parent"),
|
|
823
833
|
help: e(t)("page.parent-help")
|
|
824
834
|
}, {
|
|
825
835
|
default: n(() => [
|
|
826
|
-
|
|
827
|
-
modelValue:
|
|
836
|
+
g(Te, {
|
|
837
|
+
modelValue: c.value,
|
|
828
838
|
"onUpdate:modelValue": [
|
|
829
|
-
|
|
830
|
-
|
|
839
|
+
p[0] || (p[0] = (B) => c.value = B),
|
|
840
|
+
C
|
|
831
841
|
],
|
|
832
|
-
exclude: [
|
|
842
|
+
exclude: [f.value.id],
|
|
833
843
|
selected: e(l)?.ancestors.value ?? []
|
|
834
844
|
}, null, 8, ["modelValue", "exclude", "selected"])
|
|
835
845
|
]),
|
|
836
846
|
_: 1
|
|
837
847
|
}, 8, ["label", "help"]),
|
|
838
|
-
|
|
848
|
+
g(e(xe), {
|
|
839
849
|
type: "info",
|
|
840
850
|
variant: "soft",
|
|
841
851
|
description: e(t)("page.parent-warning")
|
|
842
852
|
}, null, 8, ["description"])
|
|
843
|
-
], 64)) :
|
|
844
|
-
])) :
|
|
853
|
+
], 64)) : N("", !0)
|
|
854
|
+
])) : N("", !0);
|
|
845
855
|
}
|
|
846
|
-
}),
|
|
856
|
+
}), Ut = /* @__PURE__ */ re(It, [["__scopeId", "data-v-bf094be2"]]), Rt = /* @__PURE__ */ K({
|
|
847
857
|
__name: "PageActions",
|
|
848
858
|
props: {
|
|
849
859
|
page: {},
|
|
850
|
-
inBin: { type: Boolean, default: !1 }
|
|
851
|
-
menuOnly: { type: Boolean, default: !1 }
|
|
860
|
+
inBin: { type: Boolean, default: !1 }
|
|
852
861
|
},
|
|
853
862
|
emits: ["open", "add", "duplicate", "move", "copy", "remove", "restore"],
|
|
854
|
-
setup(
|
|
855
|
-
const
|
|
856
|
-
|
|
857
|
-
const
|
|
858
|
-
const
|
|
859
|
-
if (
|
|
863
|
+
setup(u, { emit: r }) {
|
|
864
|
+
const h = u, l = r;
|
|
865
|
+
H();
|
|
866
|
+
const s = F("webx-pages"), t = W(() => {
|
|
867
|
+
const d = h.page;
|
|
868
|
+
if (h.inBin)
|
|
860
869
|
return [
|
|
861
870
|
{
|
|
862
871
|
key: "restore",
|
|
863
|
-
type: "restore",
|
|
864
872
|
icon: "refresh",
|
|
865
|
-
label:
|
|
866
|
-
run: () => l("restore",
|
|
873
|
+
label: s("page.restore"),
|
|
874
|
+
run: () => l("restore", d)
|
|
867
875
|
}
|
|
868
876
|
];
|
|
869
877
|
const a = [
|
|
870
|
-
{
|
|
871
|
-
|
|
872
|
-
type: "edit",
|
|
873
|
-
icon: "edit",
|
|
874
|
-
label: i("page.open"),
|
|
875
|
-
run: () => l("open", c)
|
|
876
|
-
},
|
|
877
|
-
{
|
|
878
|
-
key: "add",
|
|
879
|
-
type: "add",
|
|
880
|
-
icon: "plus",
|
|
881
|
-
label: i("page.add-child"),
|
|
882
|
-
run: () => l("add", c)
|
|
883
|
-
}
|
|
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) }
|
|
884
880
|
];
|
|
885
|
-
return
|
|
881
|
+
return d.is_home || a.push({
|
|
886
882
|
key: "duplicate",
|
|
887
|
-
type: "copy",
|
|
888
883
|
icon: "copy",
|
|
889
|
-
label:
|
|
890
|
-
run: () => l("duplicate",
|
|
891
|
-
}),
|
|
892
|
-
key: "move",
|
|
893
|
-
type: "sort",
|
|
894
|
-
icon: "drag",
|
|
895
|
-
label: i("page.move"),
|
|
896
|
-
run: () => l("move", c)
|
|
897
|
-
}), a.push(
|
|
884
|
+
label: s("page.duplicate"),
|
|
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(
|
|
898
887
|
{
|
|
899
888
|
key: "copy-address",
|
|
900
|
-
type: "link",
|
|
901
889
|
icon: "link",
|
|
902
|
-
label:
|
|
903
|
-
disabled: !
|
|
904
|
-
run: () => l("copy",
|
|
890
|
+
label: s("page.copy-address"),
|
|
891
|
+
disabled: !d.url,
|
|
892
|
+
run: () => l("copy", d)
|
|
905
893
|
},
|
|
906
894
|
{
|
|
907
895
|
key: "on-site",
|
|
908
|
-
type: "goto",
|
|
909
896
|
icon: "external-link",
|
|
910
|
-
label:
|
|
911
|
-
disabled: !
|
|
912
|
-
href:
|
|
897
|
+
label: s("page.open-on-site"),
|
|
898
|
+
disabled: !d.url,
|
|
899
|
+
href: d.url ?? void 0
|
|
913
900
|
}
|
|
914
|
-
),
|
|
901
|
+
), d.can.delete && a.push({
|
|
915
902
|
key: "delete",
|
|
916
|
-
type: "remove",
|
|
917
903
|
icon: "trash",
|
|
918
|
-
label:
|
|
904
|
+
label: s("page.delete"),
|
|
919
905
|
danger: !0,
|
|
920
|
-
run: () => l("remove",
|
|
906
|
+
run: () => l("remove", d)
|
|
921
907
|
}), a;
|
|
922
908
|
});
|
|
923
|
-
return (
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
}, ["stop"]))
|
|
928
|
-
}, {
|
|
929
|
-
trigger: n(() => [
|
|
930
|
-
f(e($e), {
|
|
931
|
-
type: "more",
|
|
932
|
-
size: "sm",
|
|
933
|
-
title: p.page.title
|
|
934
|
-
}, null, 8, ["title"])
|
|
935
|
-
]),
|
|
936
|
-
default: n(() => [
|
|
937
|
-
(d(!0), M(F, null, ie(t.value, (o) => (d(), x(e(re), {
|
|
938
|
-
key: o.key,
|
|
939
|
-
icon: o.icon,
|
|
940
|
-
tone: o.danger ? "danger" : "default",
|
|
941
|
-
href: o.href,
|
|
942
|
-
target: o.href ? "_blank" : void 0,
|
|
943
|
-
disabled: o.disabled,
|
|
944
|
-
onClick: (s) => o.run?.()
|
|
945
|
-
}, {
|
|
946
|
-
default: n(() => [
|
|
947
|
-
h(g(o.label), 1)
|
|
948
|
-
]),
|
|
949
|
-
_: 2
|
|
950
|
-
}, 1032, ["icon", "tone", "href", "target", "disabled", "onClick"]))), 128))
|
|
951
|
-
]),
|
|
952
|
-
_: 1
|
|
953
|
-
})) : (d(), x(e(ot), {
|
|
954
|
-
key: 1,
|
|
955
|
-
size: "sm",
|
|
956
|
-
align: "end",
|
|
957
|
-
collapse: "",
|
|
958
|
-
"aria-label": p.page.title,
|
|
959
|
-
onClick: a[1] || (a[1] = xe(() => {
|
|
960
|
-
}, ["stop"]))
|
|
961
|
-
}, {
|
|
962
|
-
collapsed: n(() => [
|
|
963
|
-
(d(!0), M(F, null, ie(t.value, (o) => (d(), x(e(re), {
|
|
964
|
-
key: o.key,
|
|
965
|
-
icon: o.icon,
|
|
966
|
-
tone: o.danger ? "danger" : "default",
|
|
967
|
-
href: o.href,
|
|
968
|
-
target: o.href ? "_blank" : void 0,
|
|
969
|
-
disabled: o.disabled,
|
|
970
|
-
onClick: (s) => o.run?.()
|
|
971
|
-
}, {
|
|
972
|
-
default: n(() => [
|
|
973
|
-
h(g(o.label), 1)
|
|
974
|
-
]),
|
|
975
|
-
_: 2
|
|
976
|
-
}, 1032, ["icon", "tone", "href", "target", "disabled", "onClick"]))), 128))
|
|
977
|
-
]),
|
|
978
|
-
default: n(() => [
|
|
979
|
-
(d(!0), M(F, null, ie(t.value, (o) => (d(), x(e($e), {
|
|
980
|
-
key: o.key,
|
|
981
|
-
type: o.type,
|
|
982
|
-
title: o.label,
|
|
983
|
-
href: o.href,
|
|
984
|
-
target: o.href ? "_blank" : void 0,
|
|
985
|
-
disabled: o.disabled,
|
|
986
|
-
onClick: (s) => o.run?.()
|
|
987
|
-
}, null, 8, ["type", "title", "href", "target", "disabled", "onClick"]))), 128))
|
|
988
|
-
]),
|
|
989
|
-
_: 1
|
|
990
|
-
}, 8, ["aria-label"]));
|
|
909
|
+
return (d, a) => (m(), V(e(et), {
|
|
910
|
+
actions: t.value,
|
|
911
|
+
label: h.page.title
|
|
912
|
+
}, null, 8, ["actions", "label"]));
|
|
991
913
|
}
|
|
992
|
-
}),
|
|
914
|
+
}), Lt = {
|
|
993
915
|
а: "a",
|
|
994
916
|
б: "b",
|
|
995
917
|
в: "v",
|
|
@@ -1048,67 +970,67 @@ const gt = { class: "wx-page-danger" }, vt = {
|
|
|
1048
970
|
ź: "z",
|
|
1049
971
|
ż: "z"
|
|
1050
972
|
};
|
|
1051
|
-
function Ot(
|
|
1052
|
-
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, "");
|
|
1053
975
|
}
|
|
1054
|
-
const
|
|
976
|
+
const Kt = /* @__PURE__ */ K({
|
|
1055
977
|
__name: "PageCreateDialog",
|
|
1056
978
|
props: {
|
|
1057
979
|
parent: { default: null }
|
|
1058
980
|
},
|
|
1059
|
-
setup(
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1062
|
-
const a =
|
|
1063
|
-
ae(
|
|
1064
|
-
|
|
1065
|
-
}),
|
|
1066
|
-
await
|
|
981
|
+
setup(u) {
|
|
982
|
+
const r = u, { open: h, resolve: l, dismiss: s } = Ne(), t = G(), d = Z(t);
|
|
983
|
+
H();
|
|
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));
|
|
987
|
+
}), pe(async () => {
|
|
988
|
+
await Ge(), C.value?.querySelector("input")?.focus();
|
|
1067
989
|
});
|
|
1068
|
-
async function
|
|
1069
|
-
if (!(
|
|
1070
|
-
|
|
990
|
+
async function p() {
|
|
991
|
+
if (!(c.value.trim() === "" || T.value)) {
|
|
992
|
+
T.value = !0, x.value = {};
|
|
1071
993
|
try {
|
|
1072
994
|
l(
|
|
1073
|
-
await
|
|
1074
|
-
title:
|
|
1075
|
-
slug:
|
|
1076
|
-
parent_id:
|
|
995
|
+
await d.create({
|
|
996
|
+
title: c.value.trim(),
|
|
997
|
+
slug: f.value.trim(),
|
|
998
|
+
parent_id: i.value
|
|
1077
999
|
})
|
|
1078
1000
|
);
|
|
1079
|
-
} catch (
|
|
1080
|
-
|
|
1001
|
+
} catch (B) {
|
|
1002
|
+
x.value = B.body?.errors ?? {};
|
|
1081
1003
|
} finally {
|
|
1082
|
-
|
|
1004
|
+
T.value = !1;
|
|
1083
1005
|
}
|
|
1084
1006
|
}
|
|
1085
1007
|
}
|
|
1086
|
-
return (
|
|
1087
|
-
open: e(
|
|
1088
|
-
"onUpdate:open":
|
|
1008
|
+
return (B, $) => (m(), V(e(Ae), {
|
|
1009
|
+
open: e(h),
|
|
1010
|
+
"onUpdate:open": $[5] || ($[5] = (D) => De(h) ? h.value = D : null),
|
|
1089
1011
|
title: e(a)("page.new-title"),
|
|
1090
1012
|
width: 460
|
|
1091
1013
|
}, {
|
|
1092
1014
|
footer: n(() => [
|
|
1093
|
-
|
|
1015
|
+
g(e(_e), { size: "sm" }, {
|
|
1094
1016
|
default: n(() => [
|
|
1095
|
-
|
|
1017
|
+
g(e(I), {
|
|
1096
1018
|
variant: "outline",
|
|
1097
|
-
onClick:
|
|
1019
|
+
onClick: $[4] || ($[4] = (D) => e(s)())
|
|
1098
1020
|
}, {
|
|
1099
1021
|
default: n(() => [
|
|
1100
|
-
|
|
1022
|
+
y(b(e(a)("page.cancel")), 1)
|
|
1101
1023
|
]),
|
|
1102
1024
|
_: 1
|
|
1103
1025
|
}),
|
|
1104
|
-
|
|
1026
|
+
g(e(I), {
|
|
1105
1027
|
type: "primary",
|
|
1106
|
-
loading:
|
|
1107
|
-
disabled:
|
|
1108
|
-
onClick:
|
|
1028
|
+
loading: T.value,
|
|
1029
|
+
disabled: c.value.trim() === "",
|
|
1030
|
+
onClick: p
|
|
1109
1031
|
}, {
|
|
1110
1032
|
default: n(() => [
|
|
1111
|
-
|
|
1033
|
+
y(b(e(a)("page.create")), 1)
|
|
1112
1034
|
]),
|
|
1113
1035
|
_: 1
|
|
1114
1036
|
}, 8, ["loading", "disabled"])
|
|
@@ -1117,51 +1039,51 @@ const Ut = /* @__PURE__ */ H({
|
|
|
1117
1039
|
})
|
|
1118
1040
|
]),
|
|
1119
1041
|
default: n(() => [
|
|
1120
|
-
|
|
1042
|
+
g(e(oe), {
|
|
1121
1043
|
label: e(a)("page.field-title"),
|
|
1122
|
-
error:
|
|
1044
|
+
error: x.value.title?.[0],
|
|
1123
1045
|
required: ""
|
|
1124
1046
|
}, {
|
|
1125
1047
|
default: n(() => [
|
|
1126
|
-
|
|
1048
|
+
E("div", {
|
|
1127
1049
|
ref_key: "field",
|
|
1128
|
-
ref:
|
|
1050
|
+
ref: C
|
|
1129
1051
|
}, [
|
|
1130
|
-
|
|
1131
|
-
modelValue:
|
|
1132
|
-
"onUpdate:modelValue":
|
|
1052
|
+
g(e(Ve), {
|
|
1053
|
+
modelValue: c.value,
|
|
1054
|
+
"onUpdate:modelValue": $[0] || ($[0] = (D) => c.value = D),
|
|
1133
1055
|
"aria-label": e(a)("page.field-title"),
|
|
1134
|
-
onKeyup:
|
|
1056
|
+
onKeyup: Pe(p, ["enter"])
|
|
1135
1057
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1136
1058
|
], 512)
|
|
1137
1059
|
]),
|
|
1138
1060
|
_: 1
|
|
1139
1061
|
}, 8, ["label", "error"]),
|
|
1140
|
-
|
|
1062
|
+
g(e(oe), {
|
|
1141
1063
|
label: e(a)("page.field-slug"),
|
|
1142
|
-
error:
|
|
1064
|
+
error: x.value.slug?.[0],
|
|
1143
1065
|
help: e(a)("page.slug-help")
|
|
1144
1066
|
}, {
|
|
1145
1067
|
default: n(() => [
|
|
1146
|
-
|
|
1147
|
-
modelValue:
|
|
1148
|
-
"onUpdate:modelValue":
|
|
1068
|
+
g(e(Ve), {
|
|
1069
|
+
modelValue: f.value,
|
|
1070
|
+
"onUpdate:modelValue": $[1] || ($[1] = (D) => f.value = D),
|
|
1149
1071
|
"aria-label": e(a)("page.field-slug"),
|
|
1150
|
-
onInput:
|
|
1151
|
-
onKeyup:
|
|
1072
|
+
onInput: $[2] || ($[2] = (D) => _.value = !0),
|
|
1073
|
+
onKeyup: Pe(p, ["enter"])
|
|
1152
1074
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1153
1075
|
]),
|
|
1154
1076
|
_: 1
|
|
1155
1077
|
}, 8, ["label", "error", "help"]),
|
|
1156
|
-
|
|
1078
|
+
g(e(oe), {
|
|
1157
1079
|
label: e(a)("page.field-parent"),
|
|
1158
|
-
error:
|
|
1080
|
+
error: x.value.parent_id?.[0]
|
|
1159
1081
|
}, {
|
|
1160
1082
|
default: n(() => [
|
|
1161
|
-
|
|
1162
|
-
modelValue:
|
|
1163
|
-
"onUpdate:modelValue":
|
|
1164
|
-
selected:
|
|
1083
|
+
g(Te, {
|
|
1084
|
+
modelValue: i.value,
|
|
1085
|
+
"onUpdate:modelValue": $[3] || ($[3] = (D) => i.value = D),
|
|
1086
|
+
selected: r.parent ? [r.parent] : []
|
|
1165
1087
|
}, null, 8, ["modelValue", "selected"])
|
|
1166
1088
|
]),
|
|
1167
1089
|
_: 1
|
|
@@ -1170,40 +1092,40 @@ const Ut = /* @__PURE__ */ H({
|
|
|
1170
1092
|
_: 1
|
|
1171
1093
|
}, 8, ["open", "title"]));
|
|
1172
1094
|
}
|
|
1173
|
-
}),
|
|
1095
|
+
}), Ft = /* @__PURE__ */ K({
|
|
1174
1096
|
__name: "PageMoveDialog",
|
|
1175
1097
|
props: {
|
|
1176
1098
|
page: {}
|
|
1177
1099
|
},
|
|
1178
|
-
setup(
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1181
|
-
const t =
|
|
1182
|
-
return (a,
|
|
1183
|
-
open: e(
|
|
1184
|
-
"onUpdate:open":
|
|
1185
|
-
title: e(t)("page.move-title", { title:
|
|
1100
|
+
setup(u) {
|
|
1101
|
+
const r = u, { open: h, resolve: l, dismiss: s } = Ne();
|
|
1102
|
+
H();
|
|
1103
|
+
const t = F("webx-pages"), d = k(r.page.parent_id);
|
|
1104
|
+
return (a, c) => (m(), V(e(Ae), {
|
|
1105
|
+
open: e(h),
|
|
1106
|
+
"onUpdate:open": c[3] || (c[3] = (f) => De(h) ? h.value = f : null),
|
|
1107
|
+
title: e(t)("page.move-title", { title: r.page.title }),
|
|
1186
1108
|
width: 460
|
|
1187
1109
|
}, {
|
|
1188
1110
|
footer: n(() => [
|
|
1189
|
-
|
|
1111
|
+
g(e(_e), { size: "sm" }, {
|
|
1190
1112
|
default: n(() => [
|
|
1191
|
-
|
|
1113
|
+
g(e(I), {
|
|
1192
1114
|
variant: "outline",
|
|
1193
|
-
onClick:
|
|
1115
|
+
onClick: c[1] || (c[1] = (f) => e(s)())
|
|
1194
1116
|
}, {
|
|
1195
1117
|
default: n(() => [
|
|
1196
|
-
|
|
1118
|
+
y(b(e(t)("page.cancel")), 1)
|
|
1197
1119
|
]),
|
|
1198
1120
|
_: 1
|
|
1199
1121
|
}),
|
|
1200
|
-
|
|
1122
|
+
g(e(I), {
|
|
1201
1123
|
type: "primary",
|
|
1202
|
-
disabled:
|
|
1203
|
-
onClick:
|
|
1124
|
+
disabled: d.value === null || d.value === r.page.parent_id,
|
|
1125
|
+
onClick: c[2] || (c[2] = (f) => e(l)(d.value))
|
|
1204
1126
|
}, {
|
|
1205
1127
|
default: n(() => [
|
|
1206
|
-
|
|
1128
|
+
y(b(e(t)("page.move-confirm")), 1)
|
|
1207
1129
|
]),
|
|
1208
1130
|
_: 1
|
|
1209
1131
|
}, 8, ["disabled"])
|
|
@@ -1212,21 +1134,21 @@ const Ut = /* @__PURE__ */ H({
|
|
|
1212
1134
|
})
|
|
1213
1135
|
]),
|
|
1214
1136
|
default: n(() => [
|
|
1215
|
-
|
|
1137
|
+
g(e(_e), {
|
|
1216
1138
|
direction: "vertical",
|
|
1217
1139
|
size: "md",
|
|
1218
1140
|
fill: ""
|
|
1219
1141
|
}, {
|
|
1220
1142
|
default: n(() => [
|
|
1221
|
-
|
|
1143
|
+
g(e(xe), {
|
|
1222
1144
|
type: "info",
|
|
1223
1145
|
variant: "soft",
|
|
1224
1146
|
description: e(t)("page.move-help")
|
|
1225
1147
|
}, null, 8, ["description"]),
|
|
1226
|
-
|
|
1227
|
-
modelValue:
|
|
1228
|
-
"onUpdate:modelValue":
|
|
1229
|
-
exclude: [
|
|
1148
|
+
g(Te, {
|
|
1149
|
+
modelValue: d.value,
|
|
1150
|
+
"onUpdate:modelValue": c[0] || (c[0] = (f) => d.value = f),
|
|
1151
|
+
exclude: [r.page.id]
|
|
1230
1152
|
}, null, 8, ["modelValue", "exclude"])
|
|
1231
1153
|
]),
|
|
1232
1154
|
_: 1
|
|
@@ -1235,32 +1157,32 @@ const Ut = /* @__PURE__ */ H({
|
|
|
1235
1157
|
_: 1
|
|
1236
1158
|
}, 8, ["open", "title"]));
|
|
1237
1159
|
}
|
|
1238
|
-
}),
|
|
1160
|
+
}), Ht = { class: "wx-pages" }, jt = { class: "wx-pages__title" }, Gt = ["href"], Jt = /* @__PURE__ */ K({
|
|
1239
1161
|
__name: "PagesPage",
|
|
1240
1162
|
props: {
|
|
1241
1163
|
base: { default: "/pages" }
|
|
1242
1164
|
},
|
|
1243
|
-
setup(
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1246
|
-
const t =
|
|
1247
|
-
() =>
|
|
1248
|
-
),
|
|
1165
|
+
setup(u) {
|
|
1166
|
+
const r = u, h = G(), l = Z(h), s = ye();
|
|
1167
|
+
H();
|
|
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(
|
|
1169
|
+
() => h.state.manifest?.modules.find((o) => o.id === "pages")?.title ?? t("module.title")
|
|
1170
|
+
), D = W(() => [
|
|
1249
1171
|
{ value: "", label: t("page.filter-all") },
|
|
1250
1172
|
{ value: "draft", label: t("page.filter-draft") },
|
|
1251
1173
|
{ value: "published", label: t("page.filter-published") },
|
|
1252
1174
|
{ value: "modified", label: t("page.filter-modified") },
|
|
1253
1175
|
{ value: "trashed", label: t("page.bin"), icon: "trash" }
|
|
1254
|
-
]),
|
|
1255
|
-
() =>
|
|
1256
|
-
),
|
|
1176
|
+
]), le = W(
|
|
1177
|
+
() => B.value && a.value ? [{ ...a.value, children_count: 0 }, ...c.value] : c.value
|
|
1178
|
+
), U = W(() => [
|
|
1257
1179
|
{ key: "title", label: t("page.column-title"), minWidth: 200 },
|
|
1258
|
-
{ key: "path", label: t("page.column-address"), width: 200 },
|
|
1180
|
+
{ key: "path", label: t("page.column-address"), width: 200, hideBelow: 560 },
|
|
1259
1181
|
// In the bin the state of a page is not what it was published as — it is off the site either
|
|
1260
1182
|
// way — so the column says when it went in, which is what decides whether to bring it back.
|
|
1261
1183
|
{
|
|
1262
1184
|
key: "status",
|
|
1263
|
-
label:
|
|
1185
|
+
label: p.value ? t("page.column-deleted") : t("page.column-status"),
|
|
1264
1186
|
align: "center",
|
|
1265
1187
|
width: 130,
|
|
1266
1188
|
hideBelow: 620
|
|
@@ -1270,304 +1192,282 @@ const Ut = /* @__PURE__ */ H({
|
|
|
1270
1192
|
label: t("page.column-updated"),
|
|
1271
1193
|
width: 180,
|
|
1272
1194
|
hideBelow: 900,
|
|
1273
|
-
|
|
1274
|
-
hidden: _.value
|
|
1195
|
+
hidden: p.value
|
|
1275
1196
|
},
|
|
1276
|
-
{ key: "actions", label: "", width:
|
|
1277
|
-
]),
|
|
1278
|
-
() =>
|
|
1197
|
+
{ key: "actions", label: "", width: 56, align: "right" }
|
|
1198
|
+
]), q = W(
|
|
1199
|
+
() => B.value ? {
|
|
1279
1200
|
childrenKey: "children",
|
|
1280
1201
|
hasChildrenKey: "children_count",
|
|
1281
1202
|
lazy: !0,
|
|
1282
|
-
load: (
|
|
1283
|
-
draggable:
|
|
1284
|
-
allowDrag: (
|
|
1285
|
-
allowDrop:
|
|
1203
|
+
load: (o) => l.list({ parent: o.id }).then((w) => w.items),
|
|
1204
|
+
draggable: _.value,
|
|
1205
|
+
allowDrag: (o) => o.can.move,
|
|
1206
|
+
allowDrop: ue
|
|
1286
1207
|
} : void 0
|
|
1287
1208
|
);
|
|
1288
|
-
function
|
|
1289
|
-
return
|
|
1209
|
+
function ue(o, w, v) {
|
|
1210
|
+
return w.is_home ? v === "inside" : o.id !== w.id;
|
|
1290
1211
|
}
|
|
1291
|
-
async function
|
|
1292
|
-
|
|
1212
|
+
async function M() {
|
|
1213
|
+
f.value = !0;
|
|
1293
1214
|
try {
|
|
1294
|
-
const
|
|
1295
|
-
search:
|
|
1296
|
-
status:
|
|
1297
|
-
trashed:
|
|
1298
|
-
flat: T.value
|
|
1215
|
+
const o = await l.list({
|
|
1216
|
+
search: i.value.trim(),
|
|
1217
|
+
status: p.value ? "" : T.value,
|
|
1218
|
+
trashed: p.value
|
|
1299
1219
|
});
|
|
1300
|
-
|
|
1301
|
-
} catch (
|
|
1302
|
-
z.danger(
|
|
1220
|
+
a.value = o.home, c.value = o.items;
|
|
1221
|
+
} catch (o) {
|
|
1222
|
+
z.danger(d(o));
|
|
1303
1223
|
} finally {
|
|
1304
|
-
|
|
1224
|
+
f.value = !1;
|
|
1305
1225
|
}
|
|
1306
1226
|
}
|
|
1307
|
-
function
|
|
1308
|
-
|
|
1227
|
+
function de(o) {
|
|
1228
|
+
o.search !== i.value && (i.value = o.search, M());
|
|
1309
1229
|
}
|
|
1310
|
-
function
|
|
1311
|
-
const
|
|
1312
|
-
|
|
1230
|
+
function ee(o) {
|
|
1231
|
+
const w = `${r.base}/${o.id}`;
|
|
1232
|
+
s.resolve(w).matched.length > 0 && s.push(w);
|
|
1313
1233
|
}
|
|
1314
|
-
async function
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1234
|
+
async function ce(o) {
|
|
1235
|
+
const w = await x({ parent: o });
|
|
1236
|
+
w && (await M(), ee(w));
|
|
1317
1237
|
}
|
|
1318
|
-
async function
|
|
1238
|
+
async function te(o) {
|
|
1319
1239
|
try {
|
|
1320
|
-
await l.duplicate(
|
|
1321
|
-
} catch (
|
|
1322
|
-
z.danger(
|
|
1240
|
+
await l.duplicate(o.id), z.success(t("page.duplicated")), await M();
|
|
1241
|
+
} catch (w) {
|
|
1242
|
+
z.danger(d(w));
|
|
1323
1243
|
}
|
|
1324
1244
|
}
|
|
1325
|
-
async function
|
|
1326
|
-
const
|
|
1327
|
-
|
|
1245
|
+
async function L(o) {
|
|
1246
|
+
const w = await C({ page: o });
|
|
1247
|
+
w != null && await ne(o, w, "inside");
|
|
1328
1248
|
}
|
|
1329
|
-
async function
|
|
1330
|
-
|
|
1249
|
+
async function ge(o) {
|
|
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({
|
|
1252
|
+
title: t("page.move-title", { title: o.row.title }),
|
|
1253
|
+
message: t("page.move-branch", { count: v }),
|
|
1254
|
+
confirmText: t("page.move-confirm"),
|
|
1255
|
+
cancelText: t("page.cancel")
|
|
1256
|
+
})) {
|
|
1257
|
+
await M();
|
|
1258
|
+
return;
|
|
1259
|
+
}
|
|
1260
|
+
await ne(o.row, o.target.id, o.zone);
|
|
1331
1261
|
}
|
|
1332
|
-
async function
|
|
1262
|
+
async function ne(o, w, v) {
|
|
1333
1263
|
try {
|
|
1334
|
-
const
|
|
1264
|
+
const X = await l.move(o.id, w, v);
|
|
1335
1265
|
z.success(
|
|
1336
|
-
|
|
1266
|
+
X.addresses_changed > 1 ? t("page.moved", { count: X.addresses_changed }) : t("page.moved-one")
|
|
1337
1267
|
);
|
|
1338
|
-
} catch (
|
|
1339
|
-
z.danger(
|
|
1268
|
+
} catch (X) {
|
|
1269
|
+
z.danger(d(X));
|
|
1340
1270
|
} finally {
|
|
1341
|
-
await
|
|
1271
|
+
await M();
|
|
1342
1272
|
}
|
|
1343
1273
|
}
|
|
1344
|
-
async function
|
|
1345
|
-
if (await
|
|
1346
|
-
title: t("page.delete-title", { title:
|
|
1274
|
+
async function ve(o) {
|
|
1275
|
+
if (await O({
|
|
1276
|
+
title: t("page.delete-title", { title: o.title }),
|
|
1347
1277
|
message: (
|
|
1348
1278
|
// The whole branch, not the level under it: a catalogue with two sections and forty
|
|
1349
1279
|
// products is forty-two pages leaving the site, and "2" would be a comforting lie.
|
|
1350
|
-
|
|
1280
|
+
o.descendants_count > 0 ? `${t("page.delete-text")} ${t("page.delete-branch", { count: o.descendants_count })}` : t("page.delete-text")
|
|
1351
1281
|
),
|
|
1352
1282
|
confirmText: t("page.delete"),
|
|
1353
1283
|
cancelText: t("page.cancel"),
|
|
1354
1284
|
tone: "danger"
|
|
1355
1285
|
}))
|
|
1356
1286
|
try {
|
|
1357
|
-
await l.remove(
|
|
1358
|
-
} catch (
|
|
1359
|
-
z.danger(
|
|
1287
|
+
await l.remove(o.id), z.success(t("page.deleted")), await M();
|
|
1288
|
+
} catch (v) {
|
|
1289
|
+
z.danger(d(v));
|
|
1360
1290
|
}
|
|
1361
1291
|
}
|
|
1362
|
-
async function
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1292
|
+
async function he(o) {
|
|
1293
|
+
if (await O({
|
|
1294
|
+
title: t("page.restore-page-title", { title: o.title }),
|
|
1295
|
+
message: o.descendants_count > 0 ? `${t("page.restore-page-text")} ${t("page.restore-branch", { count: o.descendants_count })}` : t("page.restore-page-text"),
|
|
1296
|
+
confirmText: t("page.restore"),
|
|
1297
|
+
cancelText: t("page.cancel")
|
|
1298
|
+
}))
|
|
1299
|
+
try {
|
|
1300
|
+
const v = await l.restore(o.id);
|
|
1301
|
+
z.success(
|
|
1302
|
+
v > 1 ? t("page.restored-branch", { count: v }) : t("page.restored")
|
|
1303
|
+
), await M();
|
|
1304
|
+
} catch (v) {
|
|
1305
|
+
z.danger(d(v));
|
|
1306
|
+
}
|
|
1368
1307
|
}
|
|
1369
|
-
async function
|
|
1370
|
-
if (
|
|
1308
|
+
async function J(o) {
|
|
1309
|
+
if (o.url)
|
|
1371
1310
|
try {
|
|
1372
|
-
await navigator.clipboard.writeText(
|
|
1311
|
+
await navigator.clipboard.writeText(o.url), z.success(t("page.address-copied"));
|
|
1373
1312
|
} catch {
|
|
1374
1313
|
}
|
|
1375
1314
|
}
|
|
1376
|
-
function
|
|
1377
|
-
return
|
|
1378
|
-
}
|
|
1379
|
-
function me(r) {
|
|
1380
|
-
const b = _.value ? r.deleted_at : r.updated_at;
|
|
1381
|
-
return b ? new Date(b).toLocaleDateString() : "";
|
|
1382
|
-
}
|
|
1383
|
-
function Y(r) {
|
|
1384
|
-
return r.body?.message ?? String(r);
|
|
1385
|
-
}
|
|
1386
|
-
function _e() {
|
|
1387
|
-
L();
|
|
1315
|
+
function Q(o) {
|
|
1316
|
+
return o === "published" ? "success" : o === "modified" ? "warning" : "default";
|
|
1388
1317
|
}
|
|
1389
1318
|
return ae(T, () => {
|
|
1390
|
-
|
|
1391
|
-
}),
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
default: n(() => [
|
|
1399
|
-
h(g(U.value), 1)
|
|
1400
|
-
]),
|
|
1401
|
-
_: 1
|
|
1402
|
-
}),
|
|
1403
|
-
W.value ? (d(), x(e(R), {
|
|
1404
|
-
key: 0,
|
|
1405
|
-
type: "primary",
|
|
1406
|
-
icon: "plus",
|
|
1407
|
-
onClick: b[0] || (b[0] = (w) => ne(null))
|
|
1408
|
-
}, {
|
|
1409
|
-
default: n(() => [
|
|
1410
|
-
h(g(e(t)("page.new")), 1)
|
|
1411
|
-
]),
|
|
1412
|
-
_: 1
|
|
1413
|
-
})) : D("", !0)
|
|
1414
|
-
]),
|
|
1415
|
-
f(e(Oe), null, {
|
|
1416
|
-
header: n(() => [
|
|
1417
|
-
f(e(ut), {
|
|
1418
|
-
modelValue: C.value,
|
|
1419
|
-
"onUpdate:modelValue": b[1] || (b[1] = (w) => C.value = w),
|
|
1420
|
-
options: q.value,
|
|
1421
|
-
size: "sm",
|
|
1422
|
-
"aria-label": e(t)("page.column-status"),
|
|
1423
|
-
onChange: _e
|
|
1424
|
-
}, null, 8, ["modelValue", "options", "aria-label"])
|
|
1425
|
-
]),
|
|
1319
|
+
M();
|
|
1320
|
+
}), pe(M), (o, w) => (m(), A("div", Ht, [
|
|
1321
|
+
g(e(tt), {
|
|
1322
|
+
view: T.value,
|
|
1323
|
+
"onUpdate:view": w[2] || (w[2] = (v) => T.value = v),
|
|
1324
|
+
title: $.value,
|
|
1325
|
+
views: D.value
|
|
1326
|
+
}, Je({
|
|
1426
1327
|
default: n(() => [
|
|
1427
|
-
|
|
1428
|
-
data:
|
|
1429
|
-
columns:
|
|
1328
|
+
g(e(ct), {
|
|
1329
|
+
data: le.value,
|
|
1330
|
+
columns: U.value,
|
|
1430
1331
|
"row-key": "id",
|
|
1431
|
-
tree:
|
|
1332
|
+
tree: q.value,
|
|
1432
1333
|
searchable: "",
|
|
1433
|
-
|
|
1334
|
+
clickable: !p.value,
|
|
1335
|
+
hover: !p.value,
|
|
1434
1336
|
flush: "",
|
|
1435
1337
|
layout: "fixed",
|
|
1436
|
-
loading:
|
|
1437
|
-
"cards-below":
|
|
1338
|
+
loading: f.value,
|
|
1339
|
+
"cards-below": 0,
|
|
1438
1340
|
"search-placeholder": e(t)("page.search"),
|
|
1439
|
-
"empty-text":
|
|
1440
|
-
"aria-label":
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1341
|
+
"empty-text": p.value ? e(t)("page.empty-bin") : i.value ? e(t)("page.empty-search") : e(t)("page.empty"),
|
|
1342
|
+
"aria-label": $.value,
|
|
1343
|
+
onRowClick: ee,
|
|
1344
|
+
onStateChange: de,
|
|
1345
|
+
onNodeDrop: ge
|
|
1444
1346
|
}, {
|
|
1445
|
-
"cell-title": n(({ row:
|
|
1446
|
-
|
|
1347
|
+
"cell-title": n(({ row: v }) => [
|
|
1348
|
+
E("span", jt, b(v.is_home ? e(t)("pages.home") : v.title), 1)
|
|
1447
1349
|
]),
|
|
1448
|
-
"cell-path": n(({ row:
|
|
1449
|
-
|
|
1350
|
+
"cell-path": n(({ row: v }) => [
|
|
1351
|
+
p.value ? (m(), V(e(R), {
|
|
1450
1352
|
key: 0,
|
|
1451
1353
|
size: "sm",
|
|
1452
1354
|
tone: "muted"
|
|
1453
1355
|
}, {
|
|
1454
|
-
default: n(() => [...
|
|
1455
|
-
|
|
1356
|
+
default: n(() => [...w[3] || (w[3] = [
|
|
1357
|
+
y("—", -1)
|
|
1456
1358
|
])]),
|
|
1457
1359
|
_: 1
|
|
1458
|
-
})) :
|
|
1360
|
+
})) : v.url && v.status !== "draft" ? (m(), A("a", {
|
|
1459
1361
|
key: 1,
|
|
1460
1362
|
class: "wx-pages__address",
|
|
1461
|
-
href:
|
|
1363
|
+
href: v.url,
|
|
1462
1364
|
target: "_blank",
|
|
1463
1365
|
rel: "noopener",
|
|
1464
|
-
onClick:
|
|
1366
|
+
onClick: w[1] || (w[1] = Qe(() => {
|
|
1465
1367
|
}, ["stop"]))
|
|
1466
|
-
}, " /" +
|
|
1368
|
+
}, " /" + b(v.path), 9, Gt)) : v.path !== null ? (m(), V(e(R), {
|
|
1467
1369
|
key: 2,
|
|
1468
1370
|
mono: "",
|
|
1469
1371
|
size: "sm",
|
|
1470
1372
|
tone: "muted"
|
|
1471
1373
|
}, {
|
|
1472
1374
|
default: n(() => [
|
|
1473
|
-
|
|
1375
|
+
y("/" + b(v.path), 1)
|
|
1474
1376
|
]),
|
|
1475
1377
|
_: 2
|
|
1476
|
-
}, 1024)) : (
|
|
1378
|
+
}, 1024)) : (m(), V(e(R), {
|
|
1477
1379
|
key: 3,
|
|
1478
1380
|
size: "sm",
|
|
1479
1381
|
tone: "muted"
|
|
1480
1382
|
}, {
|
|
1481
1383
|
default: n(() => [
|
|
1482
|
-
|
|
1384
|
+
y(b(e(t)("page.no-address")), 1)
|
|
1483
1385
|
]),
|
|
1484
1386
|
_: 1
|
|
1485
1387
|
}))
|
|
1486
1388
|
]),
|
|
1487
|
-
"cell-status": n(({ row:
|
|
1488
|
-
|
|
1389
|
+
"cell-status": n(({ row: v }) => [
|
|
1390
|
+
p.value ? (m(), V(e(me), {
|
|
1489
1391
|
key: 0,
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
}, {
|
|
1493
|
-
default: n(() => [
|
|
1494
|
-
h(g(me(w)), 1)
|
|
1495
|
-
]),
|
|
1496
|
-
_: 2
|
|
1497
|
-
}, 1024)) : (d(), x(e(We), {
|
|
1392
|
+
value: v.deleted_at
|
|
1393
|
+
}, null, 8, ["value"])) : (m(), V(e(we), {
|
|
1498
1394
|
key: 1,
|
|
1499
|
-
type:
|
|
1395
|
+
type: Q(v.status),
|
|
1500
1396
|
dot: ""
|
|
1501
1397
|
}, {
|
|
1502
1398
|
default: n(() => [
|
|
1503
|
-
|
|
1399
|
+
y(b(e(t)(`page.status-${v.status}`)), 1)
|
|
1504
1400
|
]),
|
|
1505
1401
|
_: 2
|
|
1506
1402
|
}, 1032, ["type"]))
|
|
1507
1403
|
]),
|
|
1508
|
-
"cell-updated_at": n(({ row:
|
|
1509
|
-
|
|
1404
|
+
"cell-updated_at": n(({ row: v }) => [
|
|
1405
|
+
g(e(R), {
|
|
1510
1406
|
size: "sm",
|
|
1511
1407
|
tone: "muted"
|
|
1512
1408
|
}, {
|
|
1513
1409
|
default: n(() => [
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1410
|
+
g(e(me), {
|
|
1411
|
+
value: v.updated_at
|
|
1412
|
+
}, null, 8, ["value"]),
|
|
1413
|
+
v.edited_by && !p.value ? (m(), A(j, { key: 0 }, [
|
|
1414
|
+
y(", " + b(v.edited_by), 1)
|
|
1415
|
+
], 64)) : N("", !0)
|
|
1518
1416
|
]),
|
|
1519
1417
|
_: 2
|
|
1520
1418
|
}, 1024)
|
|
1521
1419
|
]),
|
|
1522
|
-
"cell-actions": n(({ row:
|
|
1523
|
-
|
|
1420
|
+
"cell-actions": n(({ row: v }) => [
|
|
1421
|
+
_.value ? (m(), V(Rt, {
|
|
1524
1422
|
key: 0,
|
|
1525
|
-
page:
|
|
1526
|
-
"in-bin":
|
|
1527
|
-
onOpen:
|
|
1528
|
-
onAdd:
|
|
1529
|
-
onDuplicate:
|
|
1530
|
-
onMove:
|
|
1531
|
-
onCopy:
|
|
1532
|
-
onRemove:
|
|
1533
|
-
onRestore:
|
|
1534
|
-
}, null, 8, ["page", "in-bin"])) :
|
|
1535
|
-
]),
|
|
1536
|
-
"card-actions": n(({ row: w }) => [
|
|
1537
|
-
W.value ? (d(), x(Ne, {
|
|
1538
|
-
key: 0,
|
|
1539
|
-
"menu-only": "",
|
|
1540
|
-
page: w,
|
|
1541
|
-
"in-bin": _.value,
|
|
1542
|
-
onOpen: B,
|
|
1543
|
-
onAdd: ne,
|
|
1544
|
-
onDuplicate: se,
|
|
1545
|
-
onMove: ve,
|
|
1546
|
-
onCopy: he,
|
|
1547
|
-
onRemove: Q,
|
|
1548
|
-
onRestore: fe
|
|
1549
|
-
}, null, 8, ["page", "in-bin"])) : D("", !0)
|
|
1423
|
+
page: v,
|
|
1424
|
+
"in-bin": p.value,
|
|
1425
|
+
onOpen: ee,
|
|
1426
|
+
onAdd: ce,
|
|
1427
|
+
onDuplicate: te,
|
|
1428
|
+
onMove: L,
|
|
1429
|
+
onCopy: J,
|
|
1430
|
+
onRemove: ve,
|
|
1431
|
+
onRestore: he
|
|
1432
|
+
}, null, 8, ["page", "in-bin"])) : N("", !0)
|
|
1550
1433
|
]),
|
|
1551
1434
|
_: 1
|
|
1552
|
-
}, 8, ["data", "columns", "tree", "loading", "search-placeholder", "empty-text", "aria-label"])
|
|
1435
|
+
}, 8, ["data", "columns", "tree", "clickable", "hover", "loading", "search-placeholder", "empty-text", "aria-label"])
|
|
1553
1436
|
]),
|
|
1554
|
-
_:
|
|
1555
|
-
}
|
|
1556
|
-
|
|
1437
|
+
_: 2
|
|
1438
|
+
}, [
|
|
1439
|
+
_.value ? {
|
|
1440
|
+
name: "actions",
|
|
1441
|
+
fn: n(() => [
|
|
1442
|
+
g(e(I), {
|
|
1443
|
+
type: "primary",
|
|
1444
|
+
icon: "plus",
|
|
1445
|
+
onClick: w[0] || (w[0] = (v) => ce(null))
|
|
1446
|
+
}, {
|
|
1447
|
+
default: n(() => [
|
|
1448
|
+
y(b(e(t)("page.new")), 1)
|
|
1449
|
+
]),
|
|
1450
|
+
_: 1
|
|
1451
|
+
})
|
|
1452
|
+
]),
|
|
1453
|
+
key: "0"
|
|
1454
|
+
} : void 0
|
|
1455
|
+
]), 1032, ["view", "title", "views"])
|
|
1456
|
+
]));
|
|
1557
1457
|
}
|
|
1558
|
-
}),
|
|
1559
|
-
function
|
|
1560
|
-
const
|
|
1458
|
+
}), Qt = /* @__PURE__ */ re(Jt, [["__scopeId", "data-v-6c1123b3"]]);
|
|
1459
|
+
function ta(u = {}) {
|
|
1460
|
+
const r = u.path ?? "/pages";
|
|
1561
1461
|
return {
|
|
1562
1462
|
id: "pages",
|
|
1563
|
-
path:
|
|
1463
|
+
path: r,
|
|
1564
1464
|
routes: [
|
|
1565
|
-
{ path:
|
|
1465
|
+
{ path: r, name: "webx.pages", component: Qt, props: { base: r } },
|
|
1566
1466
|
{
|
|
1567
|
-
path: `${
|
|
1467
|
+
path: `${r}/:id(\\d+)`,
|
|
1568
1468
|
name: "webx.pages.edit",
|
|
1569
|
-
component:
|
|
1570
|
-
props: { base:
|
|
1469
|
+
component: Bt,
|
|
1470
|
+
props: { base: r }
|
|
1571
1471
|
}
|
|
1572
1472
|
],
|
|
1573
1473
|
/*
|
|
@@ -1579,25 +1479,25 @@ function Zt(v = {}) {
|
|
|
1579
1479
|
* page from the editor above it rather than from the description.
|
|
1580
1480
|
*/
|
|
1581
1481
|
types: {
|
|
1582
|
-
"wx-page-place": { component:
|
|
1583
|
-
"wx-page-danger": { component:
|
|
1482
|
+
"wx-page-place": { component: Ut, kind: "display" },
|
|
1483
|
+
"wx-page-danger": { component: wt, kind: "display" },
|
|
1584
1484
|
"wx-page-history": { component: At, kind: "display" }
|
|
1585
1485
|
}
|
|
1586
1486
|
};
|
|
1587
1487
|
}
|
|
1588
1488
|
export {
|
|
1589
|
-
|
|
1590
|
-
|
|
1489
|
+
wt as WxPageDanger,
|
|
1490
|
+
Bt as WxPageEditorPage,
|
|
1591
1491
|
At as WxPageHistory,
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1492
|
+
Te as WxPagePicker,
|
|
1493
|
+
Ut as WxPagePlace,
|
|
1494
|
+
Qt as WxPagesPage,
|
|
1595
1495
|
Z as createPagesApi,
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1496
|
+
Ee as pageEditorKey,
|
|
1497
|
+
ta as pages,
|
|
1498
|
+
vt as pagesMessages,
|
|
1499
|
+
gt as providePageEditor,
|
|
1600
1500
|
Ot as slugify,
|
|
1601
|
-
|
|
1501
|
+
ke as usePageEditor
|
|
1602
1502
|
};
|
|
1603
1503
|
//# sourceMappingURL=index.js.map
|