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