@webx-ui/module-admin 0.15.0 → 0.16.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/address.d.ts +25 -0
- package/dist/categories/editor.d.ts +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +381 -359
- package/dist/index.js.map +1 -1
- package/dist/screenTypes.d.ts +4 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
- /package/dist/{categories/CategorySlug.d.ts → SlugField.d.ts} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
import { RouterLink as
|
|
3
|
-
import { WxSortableList as
|
|
4
|
-
import { watchSystemTheme as
|
|
5
|
-
import { WxScreenRenderer as
|
|
1
|
+
import { inject as ne, reactive as pe, defineComponent as N, useModel as ue, ref as W, watch as ee, computed as x, openBlock as p, createElementBlock as T, createVNode as b, unref as n, withCtx as g, createElementVNode as O, toDisplayString as L, createBlock as $, createTextVNode as V, createCommentVNode as U, mergeModels as oe, onMounted as Le, Fragment as H, renderList as Q, mergeProps as je, withModifiers as Ke, useSlots as ht, useTemplateRef as qe, normalizeClass as ae, renderSlot as F, createSlots as Ae, provide as Ye, normalizeProps as gt, guardReactiveProps as yt, resolveComponent as j, watchEffect as bt, onUnmounted as wt, isRef as Xe, createApp as xt, h as de, nextTick as Ge, withKeys as Je, onBeforeUnmount as Qe } from "vue";
|
|
2
|
+
import { RouterLink as kt, useRouter as ge, useRoute as Ze, createRouter as _t, createWebHistory as $t, onBeforeRouteLeave as Tt } from "vue-router";
|
|
3
|
+
import { WxSortableList as et, WxAction as se, WxBadge as ze, WxSelect as tt, WxSegmented as St, WxAutocomplete as Be, WxText as G, WxInput as ye, WxCheckbox as Ie, WxActions as Ct, WxDropdownItem as Wt, useElementWidth as Lt, WxHeading as At, WxButton as Z, WxIcon as Ve, WxTabs as zt, WxCard as Se, WxRichText as Vt, useLocales as at, WxAlert as be, WxResult as Et, useResponsiveShell as Ut, shellLayoutFor as Rt, WxToaster as Nt, WebxUI as Bt, dateLocaleKey as It, localesKey as Pt, useModal as Dt, WxDialog as nt, WxFormItem as Mt, WxSpace as Ft, createModal as Ot, WxSkeleton as re, WxEmpty as lt, WxTooltip as ot, toast as D, confirm as he, localizedValue as Ht, WxBreadcrumb as jt, WxBreadcrumbItem as Pe, WxActionBar as Kt, WxPopover as qt, WxAvatar as Yt, WxTextarea as De } from "@webx-ui/core";
|
|
4
|
+
import { watchSystemTheme as Xt, applyTheme as Gt, systemTheme as Jt } from "@webx-ui/tokens";
|
|
5
|
+
import { WxScreenRenderer as Qt } from "@webx-ui/schema";
|
|
6
6
|
const we = /* @__PURE__ */ Symbol("webx-i18n");
|
|
7
|
-
function
|
|
8
|
-
const e =
|
|
7
|
+
function Zt() {
|
|
8
|
+
const e = ne(we, null);
|
|
9
9
|
if (e === null)
|
|
10
10
|
throw new Error("useI18n() was called outside a panel created by createAdmin().");
|
|
11
11
|
return e;
|
|
12
12
|
}
|
|
13
13
|
function P(e) {
|
|
14
|
-
const t =
|
|
14
|
+
const t = ne(we, null);
|
|
15
15
|
return t === null ? Ee().scope(e) : t.scope(e);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function ea(e, t) {
|
|
18
18
|
e.provide(we, t);
|
|
19
19
|
}
|
|
20
20
|
function Ee(e = {}) {
|
|
@@ -37,7 +37,7 @@ function Ee(e = {}) {
|
|
|
37
37
|
const [h, m] = u.includes("::") ? u.split("::", 2) : [r, u], v = m.split("."), d = s(i.value, h, v) ?? s(l, h, v) ?? // Not an empty string: a key on screen is ugly, but it says which key, and a blank
|
|
38
38
|
// label says nothing to anybody trying to fix it.
|
|
39
39
|
u;
|
|
40
|
-
return c === void 0 ? d :
|
|
40
|
+
return c === void 0 ? d : ta(d, c);
|
|
41
41
|
}
|
|
42
42
|
return {
|
|
43
43
|
state: a,
|
|
@@ -53,7 +53,7 @@ function Ee(e = {}) {
|
|
|
53
53
|
t: (r, u) => o("", r, u)
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function ta(e, t) {
|
|
57
57
|
let a = e;
|
|
58
58
|
for (const [l, i] of Object.entries(t))
|
|
59
59
|
a = a.replaceAll(`:${l}`, String(i));
|
|
@@ -76,15 +76,15 @@ function xe(e, t) {
|
|
|
76
76
|
})
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function aa(e, t, a, l = null) {
|
|
80
80
|
const i = `${e.apiPath}/${t.replace(/^\/+|\/+$/g, "")}`;
|
|
81
81
|
return e.http.post(`${i}/reorder`, l === null ? { ids: a } : { ids: a, category: l }).then(() => {
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const na = { class: "wx-categories-field" }, la = { class: "wx-categories-field__name" }, oa = /* @__PURE__ */ N({
|
|
85
85
|
name: "WxCategoriesField",
|
|
86
86
|
__name: "CategoriesField",
|
|
87
|
-
props: /* @__PURE__ */
|
|
87
|
+
props: /* @__PURE__ */ oe({
|
|
88
88
|
source: {},
|
|
89
89
|
main: { type: Boolean, default: !0 },
|
|
90
90
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -126,8 +126,8 @@ const ta = { class: "wx-categories-field" }, aa = { class: "wx-categories-field_
|
|
|
126
126
|
function m(v) {
|
|
127
127
|
a.value = o.value.filter((d) => d !== v);
|
|
128
128
|
}
|
|
129
|
-
return (v, d) => (p(), T("div",
|
|
130
|
-
b(n(
|
|
129
|
+
return (v, d) => (p(), T("div", na, [
|
|
130
|
+
b(n(et), {
|
|
131
131
|
modelValue: u.value,
|
|
132
132
|
"onUpdate:modelValue": d[0] || (d[0] = (w) => u.value = w),
|
|
133
133
|
plain: "",
|
|
@@ -138,7 +138,7 @@ const ta = { class: "wx-categories-field" }, aa = { class: "wx-categories-field_
|
|
|
138
138
|
"empty-text": t.emptyText ?? n(i)("categories.field-empty")
|
|
139
139
|
}, {
|
|
140
140
|
default: g(({ item: w, index: f }) => [
|
|
141
|
-
O("span",
|
|
141
|
+
O("span", la, L(w.name), 1),
|
|
142
142
|
t.main && f === 0 ? (p(), $(n(ze), {
|
|
143
143
|
key: 0,
|
|
144
144
|
type: "primary"
|
|
@@ -160,7 +160,7 @@ const ta = { class: "wx-categories-field" }, aa = { class: "wx-categories-field_
|
|
|
160
160
|
]),
|
|
161
161
|
_: 1
|
|
162
162
|
}, 8, ["modelValue", "disabled", "empty-text"]),
|
|
163
|
-
b(n(
|
|
163
|
+
b(n(tt), {
|
|
164
164
|
"model-value": null,
|
|
165
165
|
options: c.value,
|
|
166
166
|
placeholder: t.addText ?? n(i)("categories.field-add"),
|
|
@@ -178,45 +178,8 @@ const ta = { class: "wx-categories-field" }, aa = { class: "wx-categories-field_
|
|
|
178
178
|
for (const [l, i] of t)
|
|
179
179
|
a[l] = i;
|
|
180
180
|
return a;
|
|
181
|
-
},
|
|
182
|
-
function
|
|
183
|
-
vt(lt, e);
|
|
184
|
-
}
|
|
185
|
-
function sa() {
|
|
186
|
-
return oe(lt, null);
|
|
187
|
-
}
|
|
188
|
-
const ia = { class: "wx-category-slug" }, ra = { class: "wx-category-slug__prefix" }, ua = /* @__PURE__ */ R({
|
|
189
|
-
name: "WxCategorySlug",
|
|
190
|
-
inheritAttrs: !1,
|
|
191
|
-
__name: "CategorySlug",
|
|
192
|
-
setup(e) {
|
|
193
|
-
const t = sa(), a = et(), l = x(() => {
|
|
194
|
-
const o = t?.prefix.value ?? "";
|
|
195
|
-
return o === "" ? "/" : `/${o}/`;
|
|
196
|
-
}), i = x(() => {
|
|
197
|
-
const o = t?.values.value.slug;
|
|
198
|
-
return typeof o == "string" ? o : o?.[a.active.value] ?? "";
|
|
199
|
-
}), s = x(() => {
|
|
200
|
-
const o = t?.category.value?.path;
|
|
201
|
-
return typeof o == "string" && i.value !== "" && `${l.value}${i.value}` != `/${o}`;
|
|
202
|
-
});
|
|
203
|
-
return (o, r) => (p(), T("div", ia, [
|
|
204
|
-
b(n(ye), ft(pt(o.$attrs)), {
|
|
205
|
-
prefix: g(() => [
|
|
206
|
-
O("span", ra, L(l.value), 1)
|
|
207
|
-
]),
|
|
208
|
-
_: 1
|
|
209
|
-
}, 16),
|
|
210
|
-
s.value && n(t) ? (p(), $(n(be), {
|
|
211
|
-
key: 0,
|
|
212
|
-
type: "info",
|
|
213
|
-
variant: "soft",
|
|
214
|
-
description: n(t).moving()
|
|
215
|
-
}, null, 8, ["description"])) : U("", !0)
|
|
216
|
-
]));
|
|
217
|
-
}
|
|
218
|
-
}), da = /* @__PURE__ */ Y(ua, [["__scopeId", "data-v-0d22193a"]]);
|
|
219
|
-
function ca() {
|
|
181
|
+
}, sa = /* @__PURE__ */ Y(oa, [["__scopeId", "data-v-640cd836"]]);
|
|
182
|
+
function ia() {
|
|
220
183
|
return {
|
|
221
184
|
target: "entity",
|
|
222
185
|
entity_type: null,
|
|
@@ -227,7 +190,7 @@ function ca() {
|
|
|
227
190
|
rel: []
|
|
228
191
|
};
|
|
229
192
|
}
|
|
230
|
-
function
|
|
193
|
+
function ra(e) {
|
|
231
194
|
const t = `${e.apiPath}/links`, a = (l) => l.data;
|
|
232
195
|
return {
|
|
233
196
|
sources: () => e.http.get(`${t}/sources`).then(a),
|
|
@@ -236,22 +199,22 @@ function ma(e) {
|
|
|
236
199
|
routes: () => e.http.get(`${t}/routes`).then(a)
|
|
237
200
|
};
|
|
238
201
|
}
|
|
239
|
-
const
|
|
202
|
+
const ua = { class: "wx-link-picker" }, da = {
|
|
240
203
|
key: 0,
|
|
241
204
|
class: "wx-link-picker__entity"
|
|
242
|
-
},
|
|
205
|
+
}, ca = {
|
|
243
206
|
key: 1,
|
|
244
207
|
class: "wx-link-picker__url"
|
|
245
|
-
},
|
|
208
|
+
}, ma = {
|
|
246
209
|
key: 2,
|
|
247
210
|
class: "wx-link-picker__hash"
|
|
248
|
-
},
|
|
211
|
+
}, va = {
|
|
249
212
|
key: 3,
|
|
250
213
|
class: "wx-link-picker__attributes"
|
|
251
|
-
},
|
|
214
|
+
}, fa = { class: "wx-link-picker__rel" }, pa = /* @__PURE__ */ N({
|
|
252
215
|
name: "WxLinkPicker",
|
|
253
216
|
__name: "LinkPicker",
|
|
254
|
-
props: /* @__PURE__ */
|
|
217
|
+
props: /* @__PURE__ */ oe({
|
|
255
218
|
allowNone: { type: Boolean, default: !0 },
|
|
256
219
|
attributes: { type: Boolean, default: !0 },
|
|
257
220
|
disabled: { type: Boolean, default: !1 }
|
|
@@ -261,9 +224,9 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
261
224
|
}),
|
|
262
225
|
emits: ["update:modelValue"],
|
|
263
226
|
setup(e) {
|
|
264
|
-
const t = e, a = ue(e, "modelValue"), l = X(), i =
|
|
227
|
+
const t = e, a = ue(e, "modelValue"), l = X(), i = Zt(), s = ra(l), o = P("webx-admin"), r = W([]), u = W([]), c = W([]), h = W(!1), m = W(null), v = W(""), d = W(null);
|
|
265
228
|
let w = null;
|
|
266
|
-
const f = x(() => a.value ??
|
|
229
|
+
const f = x(() => a.value ?? ia()), y = x(() => {
|
|
267
230
|
const _ = [
|
|
268
231
|
{ value: "entity", label: o("links.target-entity") },
|
|
269
232
|
{ value: "url", label: o("links.target-url") }
|
|
@@ -289,14 +252,14 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
289
252
|
}
|
|
290
253
|
);
|
|
291
254
|
async function S() {
|
|
292
|
-
const { entity_type: _, entity_id:
|
|
293
|
-
if (_ === null ||
|
|
255
|
+
const { entity_type: _, entity_id: R } = f.value;
|
|
256
|
+
if (_ === null || R === null) {
|
|
294
257
|
d.value = null, v.value = "";
|
|
295
258
|
return;
|
|
296
259
|
}
|
|
297
|
-
if (d.value?.id ===
|
|
260
|
+
if (d.value?.id === R)
|
|
298
261
|
return;
|
|
299
|
-
const [I] = await s.resolve([{ type: _, id:
|
|
262
|
+
const [I] = await s.resolve([{ type: _, id: R }], i.state.locale);
|
|
300
263
|
d.value = I ?? null, v.value = I?.title ?? o("links.missing"), w = v.value;
|
|
301
264
|
}
|
|
302
265
|
async function B() {
|
|
@@ -323,43 +286,43 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
323
286
|
m.value = _ == null ? null : String(_), u.value = [], C("");
|
|
324
287
|
}
|
|
325
288
|
function K(_) {
|
|
326
|
-
const
|
|
327
|
-
|
|
289
|
+
const R = u.value.find((I) => I.id === _.id);
|
|
290
|
+
R === void 0 || m.value === null || (d.value = R, v.value = R.title, a.value = { ...f.value, entity_type: m.value, entity_id: R.id });
|
|
328
291
|
}
|
|
329
|
-
function
|
|
292
|
+
function le() {
|
|
330
293
|
d.value = null, v.value = "", u.value = [], a.value = { ...f.value, entity_type: null, entity_id: null };
|
|
331
294
|
}
|
|
332
295
|
function ie(_) {
|
|
333
296
|
a.value = { ...f.value, url: _ === "" ? null : _ };
|
|
334
297
|
}
|
|
335
298
|
function te(_) {
|
|
336
|
-
const
|
|
337
|
-
a.value = { ...f.value, hash:
|
|
299
|
+
const R = (typeof _ == "string" || typeof _ == "number" ? String(_) : "").replace(/^#+/, "").trim();
|
|
300
|
+
a.value = { ...f.value, hash: R === "" ? null : R };
|
|
338
301
|
}
|
|
339
302
|
function ke(_) {
|
|
340
303
|
a.value = { ...f.value, new_tab: _ };
|
|
341
304
|
}
|
|
342
|
-
function _e(_,
|
|
305
|
+
function _e(_, R) {
|
|
343
306
|
const I = f.value.rel.filter(($e) => $e !== _);
|
|
344
|
-
a.value = { ...f.value, rel:
|
|
307
|
+
a.value = { ...f.value, rel: R ? [...I, _] : I };
|
|
345
308
|
}
|
|
346
309
|
function z(_) {
|
|
347
|
-
const
|
|
310
|
+
const R = [_.hint, _.url ?? void 0].filter(
|
|
348
311
|
(I) => typeof I == "string" && I !== ""
|
|
349
312
|
);
|
|
350
|
-
return _.available ||
|
|
313
|
+
return _.available || R.push(o("links.unavailable")), R.join(" · ");
|
|
351
314
|
}
|
|
352
315
|
const q = ["nofollow", "sponsored", "ugc"];
|
|
353
|
-
return (_,
|
|
354
|
-
b(n(
|
|
316
|
+
return (_, R) => (p(), T("div", ua, [
|
|
317
|
+
b(n(St), {
|
|
355
318
|
options: y.value,
|
|
356
319
|
"model-value": f.value.target,
|
|
357
320
|
disabled: t.disabled,
|
|
358
321
|
"aria-label": n(o)("links.target-entity"),
|
|
359
322
|
"onUpdate:modelValue": A
|
|
360
323
|
}, null, 8, ["options", "model-value", "disabled", "aria-label"]),
|
|
361
|
-
f.value.target === "entity" ? (p(), T("div",
|
|
362
|
-
k.value.length > 1 ? (p(), $(n(
|
|
324
|
+
f.value.target === "entity" ? (p(), T("div", da, [
|
|
325
|
+
k.value.length > 1 ? (p(), $(n(tt), {
|
|
363
326
|
key: 0,
|
|
364
327
|
class: "wx-link-picker__section",
|
|
365
328
|
options: k.value,
|
|
@@ -380,12 +343,12 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
380
343
|
placeholder: n(o)("links.search"),
|
|
381
344
|
"aria-label": n(o)("links.search"),
|
|
382
345
|
disabled: t.disabled,
|
|
383
|
-
"onUpdate:modelValue":
|
|
346
|
+
"onUpdate:modelValue": R[0] || (R[0] = (I) => v.value = I),
|
|
384
347
|
onSearch: C,
|
|
385
348
|
onSelect: K,
|
|
386
|
-
onClear:
|
|
349
|
+
onClear: le
|
|
387
350
|
}, null, 8, ["model-value", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
388
|
-
])) : f.value.target === "url" ? (p(), T("div",
|
|
351
|
+
])) : f.value.target === "url" ? (p(), T("div", ca, [
|
|
389
352
|
b(n(Be), {
|
|
390
353
|
"model-value": f.value.url ?? "",
|
|
391
354
|
options: J.value,
|
|
@@ -398,7 +361,7 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
398
361
|
"onUpdate:modelValue": ie
|
|
399
362
|
}, null, 8, ["model-value", "options", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
400
363
|
])) : U("", !0),
|
|
401
|
-
f.value.target !== "none" ? (p(), T("label",
|
|
364
|
+
f.value.target !== "none" ? (p(), T("label", ma, [
|
|
402
365
|
b(n(G), {
|
|
403
366
|
size: "sm",
|
|
404
367
|
tone: "muted"
|
|
@@ -408,7 +371,7 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
408
371
|
]),
|
|
409
372
|
_: 1
|
|
410
373
|
}),
|
|
411
|
-
|
|
374
|
+
R[2] || (R[2] = O("span", {
|
|
412
375
|
class: "wx-link-picker__sign",
|
|
413
376
|
"aria-hidden": "true"
|
|
414
377
|
}, "#", -1)),
|
|
@@ -421,18 +384,18 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
421
384
|
"onUpdate:modelValue": te
|
|
422
385
|
}, null, 8, ["model-value", "placeholder", "aria-label", "disabled"])
|
|
423
386
|
])) : U("", !0),
|
|
424
|
-
t.attributes && f.value.target !== "none" ? (p(), T("div",
|
|
387
|
+
t.attributes && f.value.target !== "none" ? (p(), T("div", va, [
|
|
425
388
|
b(n(Ie), {
|
|
426
389
|
"model-value": f.value.new_tab,
|
|
427
390
|
disabled: t.disabled,
|
|
428
|
-
"onUpdate:modelValue":
|
|
391
|
+
"onUpdate:modelValue": R[1] || (R[1] = (I) => ke(I))
|
|
429
392
|
}, {
|
|
430
393
|
default: g(() => [
|
|
431
394
|
V(L(n(o)("links.new-tab")), 1)
|
|
432
395
|
]),
|
|
433
396
|
_: 1
|
|
434
397
|
}, 8, ["model-value", "disabled"]),
|
|
435
|
-
O("div",
|
|
398
|
+
O("div", fa, [
|
|
436
399
|
b(n(G), {
|
|
437
400
|
size: "sm",
|
|
438
401
|
tone: "muted"
|
|
@@ -457,11 +420,11 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
457
420
|
])) : U("", !0)
|
|
458
421
|
]));
|
|
459
422
|
}
|
|
460
|
-
}),
|
|
423
|
+
}), ha = /* @__PURE__ */ Y(pa, [["__scopeId", "data-v-e54022e5"]]), ga = /* @__PURE__ */ N({
|
|
461
424
|
name: "WxLinkField",
|
|
462
425
|
inheritAttrs: !1,
|
|
463
426
|
__name: "LinkField",
|
|
464
|
-
props: /* @__PURE__ */
|
|
427
|
+
props: /* @__PURE__ */ oe({
|
|
465
428
|
allowNone: { type: Boolean, default: !0 },
|
|
466
429
|
attributes: { type: Boolean, default: !0 },
|
|
467
430
|
disabled: { type: Boolean, default: !1 }
|
|
@@ -472,7 +435,7 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
472
435
|
emits: ["update:modelValue"],
|
|
473
436
|
setup(e) {
|
|
474
437
|
const t = e, a = ue(e, "modelValue");
|
|
475
|
-
return (l, i) => (p(), $(
|
|
438
|
+
return (l, i) => (p(), $(ha, je({
|
|
476
439
|
modelValue: a.value,
|
|
477
440
|
"onUpdate:modelValue": i[0] || (i[0] = (s) => a.value = s)
|
|
478
441
|
}, l.$attrs, {
|
|
@@ -481,7 +444,7 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
481
444
|
disabled: t.disabled
|
|
482
445
|
}), null, 16, ["modelValue", "allow-none", "attributes", "disabled"]));
|
|
483
446
|
}
|
|
484
|
-
}),
|
|
447
|
+
}), ya = /* @__PURE__ */ N({
|
|
485
448
|
__name: "BackButton",
|
|
486
449
|
props: {
|
|
487
450
|
to: {},
|
|
@@ -493,17 +456,17 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
493
456
|
return (i, s) => (p(), $(n(se), {
|
|
494
457
|
icon: "arrow-left",
|
|
495
458
|
class: "wx-back-button",
|
|
496
|
-
as: n(
|
|
459
|
+
as: n(kt),
|
|
497
460
|
to: e.to,
|
|
498
461
|
title: l.value,
|
|
499
462
|
size: e.size,
|
|
500
463
|
"tooltip-side": "bottom"
|
|
501
464
|
}, null, 8, ["as", "to", "title", "size"]));
|
|
502
465
|
}
|
|
503
|
-
}),
|
|
466
|
+
}), ba = {
|
|
504
467
|
key: 0,
|
|
505
468
|
class: "wx-dropdown__divider"
|
|
506
|
-
},
|
|
469
|
+
}, wa = /* @__PURE__ */ N({
|
|
507
470
|
__name: "RowMenu",
|
|
508
471
|
props: {
|
|
509
472
|
actions: {},
|
|
@@ -518,14 +481,14 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
518
481
|
const s = l.value.find((o) => o.danger);
|
|
519
482
|
return s && l.value[0] !== s ? s.key : null;
|
|
520
483
|
});
|
|
521
|
-
return (s, o) => l.value.length > 0 ? (p(), $(n(
|
|
484
|
+
return (s, o) => l.value.length > 0 ? (p(), $(n(Ct), {
|
|
522
485
|
key: 0,
|
|
523
486
|
class: "wx-row-menu",
|
|
524
487
|
collapse: "always",
|
|
525
488
|
align: "end",
|
|
526
489
|
size: e.size,
|
|
527
490
|
"aria-label": e.label,
|
|
528
|
-
onClick: o[0] || (o[0] =
|
|
491
|
+
onClick: o[0] || (o[0] = Ke(() => {
|
|
529
492
|
}, ["stop"]))
|
|
530
493
|
}, {
|
|
531
494
|
trigger: g(() => [
|
|
@@ -539,8 +502,8 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
539
502
|
(p(!0), T(H, null, Q(l.value, (r) => (p(), T(H, {
|
|
540
503
|
key: r.key
|
|
541
504
|
}, [
|
|
542
|
-
r.key === i.value ? (p(), T("hr",
|
|
543
|
-
b(n(
|
|
505
|
+
r.key === i.value ? (p(), T("hr", ba)) : U("", !0),
|
|
506
|
+
b(n(Wt), {
|
|
544
507
|
icon: r.icon,
|
|
545
508
|
tone: r.danger ? "danger" : "default",
|
|
546
509
|
href: r.href,
|
|
@@ -558,13 +521,13 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
558
521
|
_: 1
|
|
559
522
|
}, 8, ["size", "aria-label"])) : U("", !0);
|
|
560
523
|
}
|
|
561
|
-
}), Ue = /* @__PURE__ */ Y(
|
|
524
|
+
}), Ue = /* @__PURE__ */ Y(wa, [["__scopeId", "data-v-cab01f7f"]]), xa = ["data-level"], ka = {
|
|
562
525
|
key: 0,
|
|
563
526
|
class: "wx-screen-head__trail"
|
|
564
|
-
},
|
|
527
|
+
}, _a = { class: "wx-screen-head__name" }, $a = {
|
|
565
528
|
key: 4,
|
|
566
529
|
class: "wx-screen-head__actions"
|
|
567
|
-
},
|
|
530
|
+
}, Ta = /* @__PURE__ */ N({
|
|
568
531
|
__name: "ScreenHead",
|
|
569
532
|
props: {
|
|
570
533
|
title: { default: void 0 },
|
|
@@ -578,7 +541,7 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
578
541
|
},
|
|
579
542
|
emits: ["back"],
|
|
580
543
|
setup(e, { emit: t }) {
|
|
581
|
-
const a = e, l = t, i = P("webx-admin"), s = ht(), o =
|
|
544
|
+
const a = e, l = t, i = P("webx-admin"), s = ht(), o = qe("root"), r = Lt(o), u = x(() => r.value > 0 && r.value < a.collapseBelow), c = x(() => a.actions ?? []), h = x(
|
|
582
545
|
() => c.value.find((f) => f.primary) ?? null
|
|
583
546
|
), m = x(() => u.value ? h.value ? [h.value] : [] : c.value.filter((f) => !f.menu && !f.danger)), v = x(() => u.value ? c.value.filter((f) => f !== h.value) : c.value.filter((f) => f.menu || f.danger)), d = x(
|
|
584
547
|
() => a.back && a.back !== !0 ? a.back : null
|
|
@@ -596,10 +559,10 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
596
559
|
}]),
|
|
597
560
|
"data-level": e.level
|
|
598
561
|
}, [
|
|
599
|
-
f.$slots.trail ? (p(), T("div",
|
|
562
|
+
f.$slots.trail ? (p(), T("div", ka, [
|
|
600
563
|
F(f.$slots, "trail", {}, void 0, !0)
|
|
601
564
|
])) : U("", !0),
|
|
602
|
-
d.value ? (p(), $(
|
|
565
|
+
d.value ? (p(), $(ya, {
|
|
603
566
|
key: 1,
|
|
604
567
|
class: "wx-screen-head__back",
|
|
605
568
|
to: d.value,
|
|
@@ -614,8 +577,8 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
614
577
|
title: e.backLabel ?? n(i)("editor.back"),
|
|
615
578
|
onClick: y[0] || (y[0] = (k) => l("back"))
|
|
616
579
|
}, null, 8, ["title"])) : U("", !0),
|
|
617
|
-
O("div",
|
|
618
|
-
e.title ? (p(), $(n(
|
|
580
|
+
O("div", _a, [
|
|
581
|
+
e.title ? (p(), $(n(At), {
|
|
619
582
|
key: 0,
|
|
620
583
|
level: e.level,
|
|
621
584
|
truncate: "",
|
|
@@ -642,7 +605,7 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
642
605
|
]),
|
|
643
606
|
_: 3
|
|
644
607
|
})) : U("", !0),
|
|
645
|
-
w.value ? (p(), T("div",
|
|
608
|
+
w.value ? (p(), T("div", $a, [
|
|
646
609
|
F(f.$slots, "extra", {}, void 0, !0),
|
|
647
610
|
(p(!0), T(H, null, Q(m.value, (k) => (p(), $(n(Z), {
|
|
648
611
|
key: k.key,
|
|
@@ -678,11 +641,11 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
678
641
|
label: e.title ?? n(i)("editor.more")
|
|
679
642
|
}, null, 8, ["actions", "label"])) : U("", !0)
|
|
680
643
|
])) : U("", !0)
|
|
681
|
-
], 10,
|
|
644
|
+
], 10, xa));
|
|
682
645
|
}
|
|
683
|
-
}),
|
|
646
|
+
}), st = /* @__PURE__ */ Y(Ta, [["__scopeId", "data-v-e27d184e"]]), Sa = ["data-wx-fill"], Ca = /* @__PURE__ */ N({
|
|
684
647
|
__name: "ListScreen",
|
|
685
|
-
props: /* @__PURE__ */
|
|
648
|
+
props: /* @__PURE__ */ oe({
|
|
686
649
|
title: { default: void 0 },
|
|
687
650
|
subtitle: { default: void 0 },
|
|
688
651
|
back: { default: void 0 },
|
|
@@ -704,7 +667,7 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
704
667
|
class: ae(["wx-list-screen", { "is-fill": e.fill }]),
|
|
705
668
|
"data-wx-fill": e.fill ? "" : void 0
|
|
706
669
|
}, [
|
|
707
|
-
e.title || e.actions || a.$slots.actions ? (p(), $(
|
|
670
|
+
e.title || e.actions || a.$slots.actions ? (p(), $(st, {
|
|
708
671
|
key: 0,
|
|
709
672
|
class: "wx-list-screen__head",
|
|
710
673
|
title: e.title,
|
|
@@ -722,7 +685,7 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
722
685
|
key: "0"
|
|
723
686
|
} : void 0
|
|
724
687
|
]), 1032, ["title", "subtitle", "back", "back-label", "actions"])) : U("", !0),
|
|
725
|
-
e.views && e.views.length > 0 ? (p(), $(n(
|
|
688
|
+
e.views && e.views.length > 0 ? (p(), $(n(zt), {
|
|
726
689
|
key: 1,
|
|
727
690
|
modelValue: t.value,
|
|
728
691
|
"onUpdate:modelValue": l[0] || (l[0] = (i) => t.value = i),
|
|
@@ -756,9 +719,9 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
756
719
|
_: 3
|
|
757
720
|
}, 8, ["padding"])) : F(a.$slots, "default", {}, void 0, !0, 1)
|
|
758
721
|
], 64))
|
|
759
|
-
], 10,
|
|
722
|
+
], 10, Sa));
|
|
760
723
|
}
|
|
761
|
-
}),
|
|
724
|
+
}), it = /* @__PURE__ */ Y(Ca, [["__scopeId", "data-v-8c7e5ad1"]]), Wa = /* @__PURE__ */ N({
|
|
762
725
|
name: "WxRichTextField",
|
|
763
726
|
inheritAttrs: !1,
|
|
764
727
|
__name: "RichTextField",
|
|
@@ -796,29 +759,67 @@ const va = { class: "wx-link-picker" }, fa = {
|
|
|
796
759
|
cancel: a("rich-text.cancel"),
|
|
797
760
|
uploading: a("rich-text.uploading")
|
|
798
761
|
}));
|
|
799
|
-
return (s, o) => (p(), $(n(
|
|
762
|
+
return (s, o) => (p(), $(n(Vt), je(s.$attrs, {
|
|
800
763
|
labels: i.value,
|
|
801
764
|
"pick-image": l.value
|
|
802
765
|
}), null, 16, ["labels", "pick-image"]));
|
|
803
766
|
}
|
|
804
|
-
}),
|
|
805
|
-
|
|
767
|
+
}), rt = /* @__PURE__ */ Symbol("wx-record-address");
|
|
768
|
+
function La(e) {
|
|
769
|
+
Ye(rt, e);
|
|
770
|
+
}
|
|
771
|
+
function Aa() {
|
|
772
|
+
return ne(rt, null);
|
|
773
|
+
}
|
|
774
|
+
const za = { class: "wx-slug" }, Va = { class: "wx-slug__prefix" }, Ea = /* @__PURE__ */ N({
|
|
775
|
+
name: "WxSlugField",
|
|
776
|
+
inheritAttrs: !1,
|
|
777
|
+
__name: "SlugField",
|
|
778
|
+
setup(e) {
|
|
779
|
+
const t = Aa(), a = at(), l = x(() => {
|
|
780
|
+
const o = t?.prefix.value ?? "";
|
|
781
|
+
return o === "" ? "/" : `/${o}/`;
|
|
782
|
+
}), i = x(() => {
|
|
783
|
+
const o = t?.values.value.slug;
|
|
784
|
+
return typeof o == "string" ? o : o?.[a.active.value] ?? "";
|
|
785
|
+
}), s = x(() => {
|
|
786
|
+
const o = t?.path.value;
|
|
787
|
+
return typeof o == "string" && i.value !== "" && `${l.value}${i.value}` != `/${o}`;
|
|
788
|
+
});
|
|
789
|
+
return (o, r) => (p(), T("div", za, [
|
|
790
|
+
b(n(ye), gt(yt(o.$attrs)), {
|
|
791
|
+
prefix: g(() => [
|
|
792
|
+
O("span", Va, L(l.value), 1)
|
|
793
|
+
]),
|
|
794
|
+
_: 1
|
|
795
|
+
}, 16),
|
|
796
|
+
s.value && n(t) ? (p(), $(n(be), {
|
|
797
|
+
key: 0,
|
|
798
|
+
type: "info",
|
|
799
|
+
variant: "soft",
|
|
800
|
+
description: n(t).moving()
|
|
801
|
+
}, null, 8, ["description"])) : U("", !0)
|
|
802
|
+
]));
|
|
803
|
+
}
|
|
804
|
+
}), Me = /* @__PURE__ */ Y(Ea, [["__scopeId", "data-v-5921c0dd"]]), Ua = {
|
|
805
|
+
"wx-list": { component: it, kind: "layout", labelProp: "title" },
|
|
806
806
|
// Full width: an editor shares a row with nothing, and a form of two columns would give it
|
|
807
807
|
// half a line to write a page of text in.
|
|
808
|
-
"wx-rich-text": { component:
|
|
808
|
+
"wx-rich-text": { component: Wa, kind: "field", wide: !0 },
|
|
809
809
|
// Wide as well: a row of the picker is a segmented switch, a section and a search box, and half
|
|
810
810
|
// a form's width leaves the search box too narrow to read a page title in.
|
|
811
|
-
"wx-link": { component:
|
|
812
|
-
"wx-categories": { component:
|
|
813
|
-
"wx-
|
|
814
|
-
|
|
811
|
+
"wx-link": { component: ga, kind: "field", wide: !0 },
|
|
812
|
+
"wx-categories": { component: sa, kind: "field" },
|
|
813
|
+
"wx-slug": { component: Me, kind: "field" },
|
|
814
|
+
"wx-category-slug": { component: Me, kind: "field" }
|
|
815
|
+
}, ut = /* @__PURE__ */ Symbol("webx-admin");
|
|
815
816
|
function X() {
|
|
816
|
-
const e =
|
|
817
|
+
const e = ne(ut, null);
|
|
817
818
|
if (e === null)
|
|
818
819
|
throw new Error("useAdmin() was called outside a panel created by createAdmin().");
|
|
819
820
|
return e;
|
|
820
821
|
}
|
|
821
|
-
function
|
|
822
|
+
function Ra(e) {
|
|
822
823
|
const t = pe({
|
|
823
824
|
status: "loading",
|
|
824
825
|
manifest: null,
|
|
@@ -860,7 +861,7 @@ function Ua(e) {
|
|
|
860
861
|
entries: f.get(y.id) ?? []
|
|
861
862
|
}))
|
|
862
863
|
};
|
|
863
|
-
}), i = { ...
|
|
864
|
+
}), i = { ...Ua };
|
|
864
865
|
for (const d of e.modules)
|
|
865
866
|
Object.assign(i, d.types);
|
|
866
867
|
Object.assign(i, e.types);
|
|
@@ -883,7 +884,7 @@ function Ua(e) {
|
|
|
883
884
|
const d = await e.loadManifest();
|
|
884
885
|
t.manifest = d, e.i18n.state.contentLocales = d.locales ?? [], e.i18n.state.panelLocales = d.panelLocales ?? e.i18n.state.panelLocales, d.locale !== void 0 && d.locale !== e.i18n.state.locale && await v(d.locale), t.status = "ready";
|
|
885
886
|
} catch (d) {
|
|
886
|
-
if (
|
|
887
|
+
if (Ba(d)) {
|
|
887
888
|
t.manifest = null, t.user = null, t.status = "unauthenticated";
|
|
888
889
|
return;
|
|
889
890
|
}
|
|
@@ -938,12 +939,12 @@ function Ua(e) {
|
|
|
938
939
|
};
|
|
939
940
|
}
|
|
940
941
|
function Na(e, t) {
|
|
941
|
-
e.provide(
|
|
942
|
+
e.provide(ut, t);
|
|
942
943
|
}
|
|
943
|
-
function
|
|
944
|
+
function Ba(e) {
|
|
944
945
|
return typeof e == "object" && e !== null && "status" in e && e.status === 401;
|
|
945
946
|
}
|
|
946
|
-
const
|
|
947
|
+
const Ia = /* @__PURE__ */ N({
|
|
947
948
|
__name: "AdminLanding",
|
|
948
949
|
props: {
|
|
949
950
|
landing: { default: null }
|
|
@@ -959,22 +960,27 @@ const Ba = /* @__PURE__ */ R({
|
|
|
959
960
|
o !== null && l.replace(o);
|
|
960
961
|
},
|
|
961
962
|
{ immediate: !0 }
|
|
962
|
-
), (o, r) => s.value === null && n(a).state.status === "ready" ? (p(), $(n(
|
|
963
|
+
), (o, r) => s.value === null && n(a).state.status === "ready" ? (p(), $(n(Et), {
|
|
963
964
|
key: 0,
|
|
964
965
|
status: "info",
|
|
965
966
|
title: n(i)("shell.empty-title"),
|
|
966
967
|
description: n(i)("shell.empty-description")
|
|
967
968
|
}, null, 8, ["title", "description"])) : U("", !0);
|
|
968
969
|
}
|
|
969
|
-
}),
|
|
970
|
+
}), Pa = /* @__PURE__ */ N({
|
|
970
971
|
__name: "AdminNav",
|
|
971
972
|
props: {
|
|
972
973
|
collapsed: { type: Boolean }
|
|
973
974
|
},
|
|
974
975
|
emits: ["select"],
|
|
975
976
|
setup(e, { emit: t }) {
|
|
976
|
-
const a = t, l = X(), i = P("webx-admin"), s = ge(), o =
|
|
977
|
-
|
|
977
|
+
const a = t, l = X(), i = P("webx-admin"), s = ge(), o = Ze(), r = x({
|
|
978
|
+
/*
|
|
979
|
+
* The longest path that contains this one, on a segment boundary: a section may live inside
|
|
980
|
+
* another's path (`/services/categories` under `/services`), and the first match in the order
|
|
981
|
+
* of the menu would light up the outer one.
|
|
982
|
+
*/
|
|
983
|
+
get: () => l.nav.value.filter((c) => o.path === c.path || o.path.startsWith(`${c.path}/`)).sort((c, h) => h.path.length - c.path.length)[0]?.id ?? "",
|
|
978
984
|
set: (u) => {
|
|
979
985
|
const c = l.nav.value.find((h) => h.id === u);
|
|
980
986
|
c !== void 0 && s.push(c.path);
|
|
@@ -1017,37 +1023,37 @@ const Ba = /* @__PURE__ */ R({
|
|
|
1017
1023
|
}, 8, ["modelValue", "collapsed", "label"]);
|
|
1018
1024
|
};
|
|
1019
1025
|
}
|
|
1020
|
-
}),
|
|
1026
|
+
}), Da = {
|
|
1021
1027
|
key: 0,
|
|
1022
1028
|
class: "wx-root wx-admin-plain"
|
|
1023
|
-
},
|
|
1029
|
+
}, Ma = {
|
|
1024
1030
|
key: 1,
|
|
1025
1031
|
class: "wx-root wx-admin-plain"
|
|
1026
|
-
},
|
|
1032
|
+
}, Fa = {
|
|
1027
1033
|
key: 2,
|
|
1028
1034
|
class: "wx-root wx-admin-plain"
|
|
1029
|
-
},
|
|
1035
|
+
}, Oa = ["src", "alt", "width", "height"], Ha = ["src", "alt", "width", "height"], ja = ["src", "alt"], Ka = { class: "wx-admin__user" }, qa = { class: "wx-admin__user wx-admin__user--drawer" }, Ya = /* @__PURE__ */ N({
|
|
1030
1036
|
__name: "AdminShell",
|
|
1031
1037
|
setup(e) {
|
|
1032
|
-
const t = X(), a = P("webx-admin"), l = W(null), { width: i, layout: s, collapsed: o, showAside: r, drawerOpen: u, toggle: c, close: h } =
|
|
1038
|
+
const t = X(), a = P("webx-admin"), l = W(null), { width: i, layout: s, collapsed: o, showAside: r, drawerOpen: u, toggle: c, close: h } = Ut(
|
|
1033
1039
|
l,
|
|
1034
1040
|
{ persist: "webx-admin-shell" }
|
|
1035
|
-
), m = x(() => t.state.manifest?.title ?? ""), v = x(() => t.state.manifest?.branding?.logo ?? null), d = x(() => t.state.manifest?.branding?.mark ?? null), w = x(() =>
|
|
1036
|
-
return
|
|
1041
|
+
), m = x(() => t.state.manifest?.title ?? ""), v = x(() => t.state.manifest?.branding?.logo ?? null), d = x(() => t.state.manifest?.branding?.mark ?? null), w = x(() => Rt(i.value, null));
|
|
1042
|
+
return bt(() => {
|
|
1037
1043
|
typeof document > "u" || (document.documentElement.dataset.wxShell = w.value);
|
|
1038
|
-
}),
|
|
1044
|
+
}), wt(() => {
|
|
1039
1045
|
typeof document < "u" && delete document.documentElement.dataset.wxShell;
|
|
1040
1046
|
}), (f, y) => {
|
|
1041
|
-
const k = j("router-view"), M = j("wx-loading"), J = j("wx-button"), S = j("wx-result"), B = j("wx-action"), C = j("wx-text"), A = j("wx-header"), E = j("wx-aside"), K = j("wx-main"),
|
|
1047
|
+
const k = j("router-view"), M = j("wx-loading"), J = j("wx-button"), S = j("wx-result"), B = j("wx-action"), C = j("wx-text"), A = j("wx-header"), E = j("wx-aside"), K = j("wx-main"), le = j("wx-container"), ie = j("wx-drawer");
|
|
1042
1048
|
return p(), T(H, null, [
|
|
1043
|
-
b(n(
|
|
1044
|
-
n(t).state.status === "unauthenticated" ? (p(), T("div",
|
|
1049
|
+
b(n(Nt)),
|
|
1050
|
+
n(t).state.status === "unauthenticated" ? (p(), T("div", Da, [
|
|
1045
1051
|
b(k)
|
|
1046
|
-
])) : n(t).state.status === "loading" ? (p(), T("div",
|
|
1052
|
+
])) : n(t).state.status === "loading" ? (p(), T("div", Ma, [
|
|
1047
1053
|
b(M, {
|
|
1048
1054
|
label: n(a)("shell.loading")
|
|
1049
1055
|
}, null, 8, ["label"])
|
|
1050
|
-
])) : n(t).state.status === "error" ? (p(), T("div",
|
|
1056
|
+
])) : n(t).state.status === "error" ? (p(), T("div", Fa, [
|
|
1051
1057
|
b(S, {
|
|
1052
1058
|
status: "error",
|
|
1053
1059
|
title: n(a)("shell.error-title"),
|
|
@@ -1072,7 +1078,7 @@ const Ba = /* @__PURE__ */ R({
|
|
|
1072
1078
|
ref: l,
|
|
1073
1079
|
class: ae(["wx-root wx-admin", `wx-admin--${w.value}`])
|
|
1074
1080
|
}, [
|
|
1075
|
-
b(
|
|
1081
|
+
b(le, {
|
|
1076
1082
|
direction: n(s) === "drawer" ? "vertical" : "horizontal",
|
|
1077
1083
|
"full-height": "",
|
|
1078
1084
|
class: "wx-admin__frame"
|
|
@@ -1104,7 +1110,7 @@ const Ba = /* @__PURE__ */ R({
|
|
|
1104
1110
|
alt: m.value,
|
|
1105
1111
|
width: v.value.width ?? void 0,
|
|
1106
1112
|
height: v.value.height ?? void 0
|
|
1107
|
-
}, null, 8,
|
|
1113
|
+
}, null, 8, Oa)) : (p(), $(C, {
|
|
1108
1114
|
key: 1,
|
|
1109
1115
|
weight: "semibold",
|
|
1110
1116
|
truncate: ""
|
|
@@ -1138,7 +1144,7 @@ const Ba = /* @__PURE__ */ R({
|
|
|
1138
1144
|
class: "wx-admin__mark",
|
|
1139
1145
|
src: d.value.url,
|
|
1140
1146
|
alt: m.value
|
|
1141
|
-
}, null, 8,
|
|
1147
|
+
}, null, 8, ja)) : U("", !0) : F(f.$slots, "brand", {}, () => [
|
|
1142
1148
|
v.value ? (p(), T("img", {
|
|
1143
1149
|
key: 0,
|
|
1144
1150
|
class: "wx-admin__logo",
|
|
@@ -1146,7 +1152,7 @@ const Ba = /* @__PURE__ */ R({
|
|
|
1146
1152
|
alt: m.value,
|
|
1147
1153
|
width: v.value.width ?? void 0,
|
|
1148
1154
|
height: v.value.height ?? void 0
|
|
1149
|
-
}, null, 8,
|
|
1155
|
+
}, null, 8, Ha)) : (p(), $(C, {
|
|
1150
1156
|
key: 1,
|
|
1151
1157
|
weight: "semibold",
|
|
1152
1158
|
truncate: "",
|
|
@@ -1166,7 +1172,7 @@ const Ba = /* @__PURE__ */ R({
|
|
|
1166
1172
|
], 2)
|
|
1167
1173
|
]),
|
|
1168
1174
|
bottom: g(() => [
|
|
1169
|
-
O("div",
|
|
1175
|
+
O("div", Ka, [
|
|
1170
1176
|
F(f.$slots, "user", {
|
|
1171
1177
|
expanded: !n(o)
|
|
1172
1178
|
}, void 0, !0)
|
|
@@ -1191,7 +1197,7 @@ const Ba = /* @__PURE__ */ R({
|
|
|
1191
1197
|
}, 8, ["direction"]),
|
|
1192
1198
|
b(ie, {
|
|
1193
1199
|
open: n(u),
|
|
1194
|
-
"onUpdate:open": y[1] || (y[1] = (te) =>
|
|
1200
|
+
"onUpdate:open": y[1] || (y[1] = (te) => Xe(u) ? u.value = te : null),
|
|
1195
1201
|
class: "wx-admin__drawer",
|
|
1196
1202
|
title: m.value === "" ? n(a)("nav.menu") : m.value,
|
|
1197
1203
|
side: "left",
|
|
@@ -1200,7 +1206,7 @@ const Ba = /* @__PURE__ */ R({
|
|
|
1200
1206
|
closable: ""
|
|
1201
1207
|
}, {
|
|
1202
1208
|
footer: g(() => [
|
|
1203
|
-
O("div",
|
|
1209
|
+
O("div", qa, [
|
|
1204
1210
|
F(f.$slots, "user", { expanded: !0 }, void 0, !0)
|
|
1205
1211
|
])
|
|
1206
1212
|
]),
|
|
@@ -1216,7 +1222,7 @@ const Ba = /* @__PURE__ */ R({
|
|
|
1216
1222
|
], 64);
|
|
1217
1223
|
};
|
|
1218
1224
|
}
|
|
1219
|
-
}),
|
|
1225
|
+
}), Xa = /* @__PURE__ */ Y(Ya, [["__scopeId", "data-v-309fdb9d"]]);
|
|
1220
1226
|
class Ce extends Error {
|
|
1221
1227
|
constructor(t, a, l = {}, i = null, s = null) {
|
|
1222
1228
|
super(t), this.status = a, this.errors = l, this.retryAfter = i, this.body = s, this.name = "HttpError";
|
|
@@ -1236,15 +1242,15 @@ class Ce extends Error {
|
|
|
1236
1242
|
return this.status === 429;
|
|
1237
1243
|
}
|
|
1238
1244
|
}
|
|
1239
|
-
const
|
|
1240
|
-
function
|
|
1245
|
+
const Ga = /* @__PURE__ */ new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
1246
|
+
function Ja(e = {}) {
|
|
1241
1247
|
const t = (e.baseUrl ?? "").replace(/\/$/, ""), a = e.csrfUrl ?? "/api/cms/auth/csrf-cookie", l = e.fetch ?? globalThis.fetch.bind(globalThis), i = e.onUnauthenticated, s = e.headers;
|
|
1242
1248
|
let o = !1;
|
|
1243
1249
|
async function r(c = !1) {
|
|
1244
|
-
o && !c &&
|
|
1250
|
+
o && !c && Fe("XSRF-TOKEN") !== null || (await l(a, { credentials: "same-origin" }), o = !0);
|
|
1245
1251
|
}
|
|
1246
1252
|
async function u(c, h, m, v = {}, d = !1) {
|
|
1247
|
-
const w =
|
|
1253
|
+
const w = Ga.has(c);
|
|
1248
1254
|
w && await r();
|
|
1249
1255
|
const f = {
|
|
1250
1256
|
Accept: "application/json",
|
|
@@ -1254,11 +1260,11 @@ function Ga(e = {}) {
|
|
|
1254
1260
|
...v.headers
|
|
1255
1261
|
};
|
|
1256
1262
|
if (w) {
|
|
1257
|
-
const k =
|
|
1263
|
+
const k = Fe("XSRF-TOKEN");
|
|
1258
1264
|
k !== null && (f["X-XSRF-TOKEN"] = k);
|
|
1259
1265
|
}
|
|
1260
1266
|
m !== void 0 && (f["Content-Type"] = "application/json");
|
|
1261
|
-
const y = await l(
|
|
1267
|
+
const y = await l(Za(t, h, v.query), {
|
|
1262
1268
|
method: c,
|
|
1263
1269
|
credentials: "same-origin",
|
|
1264
1270
|
headers: f,
|
|
@@ -1268,7 +1274,7 @@ function Ga(e = {}) {
|
|
|
1268
1274
|
if (y.status === 419 && w && !d)
|
|
1269
1275
|
return await r(!0), u(c, h, m, v, !0);
|
|
1270
1276
|
if (y.status === 401 && i?.(), !y.ok)
|
|
1271
|
-
throw await
|
|
1277
|
+
throw await Qa(y);
|
|
1272
1278
|
if (y.status !== 204)
|
|
1273
1279
|
return await y.json();
|
|
1274
1280
|
}
|
|
@@ -1280,7 +1286,7 @@ function Ga(e = {}) {
|
|
|
1280
1286
|
delete: (c, h) => u("DELETE", c, void 0, h)
|
|
1281
1287
|
};
|
|
1282
1288
|
}
|
|
1283
|
-
async function
|
|
1289
|
+
async function Qa(e) {
|
|
1284
1290
|
let t = null;
|
|
1285
1291
|
try {
|
|
1286
1292
|
t = await e.json();
|
|
@@ -1295,7 +1301,7 @@ async function Ja(e) {
|
|
|
1295
1301
|
t
|
|
1296
1302
|
);
|
|
1297
1303
|
}
|
|
1298
|
-
function
|
|
1304
|
+
function Za(e, t, a) {
|
|
1299
1305
|
const i = /^https?:\/\//i.test(t) ? t : `${e}/${t.replace(/^\//, "")}`;
|
|
1300
1306
|
if (a === void 0)
|
|
1301
1307
|
return i;
|
|
@@ -1305,7 +1311,7 @@ function Qa(e, t, a) {
|
|
|
1305
1311
|
const o = s.toString();
|
|
1306
1312
|
return o === "" ? i : `${i}${i.includes("?") ? "&" : "?"}${o}`;
|
|
1307
1313
|
}
|
|
1308
|
-
function
|
|
1314
|
+
function Fe(e) {
|
|
1309
1315
|
if (typeof document > "u")
|
|
1310
1316
|
return null;
|
|
1311
1317
|
for (const t of document.cookie.split(";")) {
|
|
@@ -1315,47 +1321,47 @@ function Me(e) {
|
|
|
1315
1321
|
}
|
|
1316
1322
|
return null;
|
|
1317
1323
|
}
|
|
1318
|
-
const
|
|
1319
|
-
function
|
|
1320
|
-
const e =
|
|
1324
|
+
const en = "webx.theme", dt = /* @__PURE__ */ Symbol("webx-theme");
|
|
1325
|
+
function Gn() {
|
|
1326
|
+
const e = ne(dt, null);
|
|
1321
1327
|
if (e === null)
|
|
1322
1328
|
throw new Error("useTheme() was called outside a panel created by createAdmin().");
|
|
1323
1329
|
return e;
|
|
1324
1330
|
}
|
|
1325
|
-
function
|
|
1326
|
-
e.provide(
|
|
1331
|
+
function tn(e, t) {
|
|
1332
|
+
e.provide(dt, t);
|
|
1327
1333
|
}
|
|
1328
|
-
function
|
|
1329
|
-
const t = e.storageKey === void 0 ?
|
|
1330
|
-
preference:
|
|
1334
|
+
function an(e = {}) {
|
|
1335
|
+
const t = e.storageKey === void 0 ? en : e.storageKey, a = pe({
|
|
1336
|
+
preference: nn(t) ?? "system",
|
|
1331
1337
|
resolved: "light"
|
|
1332
1338
|
});
|
|
1333
1339
|
function l() {
|
|
1334
|
-
|
|
1340
|
+
Gt(a.preference), a.resolved = a.preference === "system" ? Jt() : a.preference;
|
|
1335
1341
|
}
|
|
1336
|
-
return l(),
|
|
1342
|
+
return l(), Xt((i) => {
|
|
1337
1343
|
a.preference === "system" && (a.resolved = i);
|
|
1338
1344
|
}), {
|
|
1339
1345
|
state: a,
|
|
1340
1346
|
set(i) {
|
|
1341
|
-
a.preference = i, l(),
|
|
1347
|
+
a.preference = i, l(), Oe(t, i);
|
|
1342
1348
|
},
|
|
1343
1349
|
adopt(i) {
|
|
1344
1350
|
if (i === void 0)
|
|
1345
1351
|
return;
|
|
1346
1352
|
const s = i ?? "system";
|
|
1347
|
-
s !== a.preference && (a.preference = s, l(),
|
|
1353
|
+
s !== a.preference && (a.preference = s, l(), Oe(t, s));
|
|
1348
1354
|
}
|
|
1349
1355
|
};
|
|
1350
1356
|
}
|
|
1351
|
-
function
|
|
1357
|
+
function Oe(e, t) {
|
|
1352
1358
|
if (e !== null)
|
|
1353
1359
|
try {
|
|
1354
1360
|
localStorage.setItem(e, t);
|
|
1355
1361
|
} catch {
|
|
1356
1362
|
}
|
|
1357
1363
|
}
|
|
1358
|
-
function
|
|
1364
|
+
function nn(e) {
|
|
1359
1365
|
if (e === null)
|
|
1360
1366
|
return null;
|
|
1361
1367
|
try {
|
|
@@ -1365,7 +1371,7 @@ function an(e) {
|
|
|
1365
1371
|
return null;
|
|
1366
1372
|
}
|
|
1367
1373
|
}
|
|
1368
|
-
const
|
|
1374
|
+
const ct = {
|
|
1369
1375
|
shell: {
|
|
1370
1376
|
loading: "Loading the panel…",
|
|
1371
1377
|
"error-title": "The panel could not start",
|
|
@@ -1580,9 +1586,9 @@ const ut = {
|
|
|
1580
1586
|
"order-locked": "Clear the search and the filters to change the order — only a whole list, or one category, can be dragged.",
|
|
1581
1587
|
unknown: "One of the chosen categories is not there any more."
|
|
1582
1588
|
}
|
|
1583
|
-
},
|
|
1584
|
-
function
|
|
1585
|
-
const t = e.manifestUrl ??
|
|
1589
|
+
}, mt = "webx.locale";
|
|
1590
|
+
function Jn(e = {}) {
|
|
1591
|
+
const t = e.manifestUrl ?? dn() ?? "/api/cms/manifest", a = e.apiPath ?? t.replace(/\/manifest\/?$/, ""), l = e.basePath ?? "/cms", i = e.modules ?? [], s = [...e.routes ?? []];
|
|
1586
1592
|
for (const y of i)
|
|
1587
1593
|
s.push(...y.routes ?? []);
|
|
1588
1594
|
if (!s.some((y) => y.path === "/")) {
|
|
@@ -1590,14 +1596,14 @@ function Xn(e = {}) {
|
|
|
1590
1596
|
s.push({
|
|
1591
1597
|
path: "/",
|
|
1592
1598
|
name: "webx.home",
|
|
1593
|
-
component:
|
|
1599
|
+
component: Ia,
|
|
1594
1600
|
props: { landing: y?.path ?? y?.routes?.[0]?.path ?? null }
|
|
1595
1601
|
});
|
|
1596
1602
|
}
|
|
1597
|
-
const o =
|
|
1598
|
-
history:
|
|
1603
|
+
const o = _t({
|
|
1604
|
+
history: $t(l),
|
|
1599
1605
|
routes: s
|
|
1600
|
-
}), r = Ee({ locale: e.locale ??
|
|
1606
|
+
}), r = Ee({ locale: e.locale ?? on() }), u = an(), c = e.http ?? Ja({
|
|
1601
1607
|
baseUrl: "",
|
|
1602
1608
|
csrfUrl: `${a}/auth/csrf-cookie`,
|
|
1603
1609
|
onUnauthenticated: () => {
|
|
@@ -1609,12 +1615,12 @@ function Xn(e = {}) {
|
|
|
1609
1615
|
// signing in on a Russian sign-in screen lands in an English panel.
|
|
1610
1616
|
headers: () => ({ "X-Webx-Locale": r.state.locale })
|
|
1611
1617
|
});
|
|
1612
|
-
r.defaults("webx-admin",
|
|
1618
|
+
r.defaults("webx-admin", ct);
|
|
1613
1619
|
async function h(y) {
|
|
1614
1620
|
const k = await c.get(`${a}/translations/${y}`);
|
|
1615
|
-
r.load(k.data.namespaces, k.data.locale, k.data.fallback),
|
|
1621
|
+
r.load(k.data.namespaces, k.data.locale, k.data.fallback), sn(k.data.locale), un(k.data.locale, r.state.panelLocales);
|
|
1616
1622
|
}
|
|
1617
|
-
const m =
|
|
1623
|
+
const m = Ra({
|
|
1618
1624
|
http: c,
|
|
1619
1625
|
theme: u,
|
|
1620
1626
|
basePath: l,
|
|
@@ -1625,13 +1631,13 @@ function Xn(e = {}) {
|
|
|
1625
1631
|
types: e.types,
|
|
1626
1632
|
screens: e.screens,
|
|
1627
1633
|
loadManifest: async () => (await c.get(t)).data
|
|
1628
|
-
}), v =
|
|
1629
|
-
v.use(
|
|
1634
|
+
}), v = xt(ln(e));
|
|
1635
|
+
v.use(Bt), Na(v, m), ea(v, r), tn(v, u);
|
|
1630
1636
|
const d = W("");
|
|
1631
1637
|
v.provide(
|
|
1632
|
-
|
|
1638
|
+
It,
|
|
1633
1639
|
x(() => r.state.locale)
|
|
1634
|
-
), v.provide(
|
|
1640
|
+
), v.provide(Pt, {
|
|
1635
1641
|
list: x(
|
|
1636
1642
|
() => r.state.contentLocales.map((y) => ({
|
|
1637
1643
|
code: y.code,
|
|
@@ -1664,40 +1670,40 @@ function Xn(e = {}) {
|
|
|
1664
1670
|
y.install(w);
|
|
1665
1671
|
return v.use(o), w;
|
|
1666
1672
|
}
|
|
1667
|
-
function
|
|
1673
|
+
function ln(e) {
|
|
1668
1674
|
const t = {
|
|
1669
1675
|
// The menu is the panel's own: it is the manifest, drawn.
|
|
1670
1676
|
// The shell hands in what a choice means where it drew the menu — in the drawer it is what
|
|
1671
1677
|
// closes it, and a drawer that stays open over the section it just opened is a drawer the
|
|
1672
1678
|
// reader has to dismiss by hand.
|
|
1673
|
-
nav: (a) => de(
|
|
1679
|
+
nav: (a) => de(Pa, { collapsed: a.collapsed === !0, onSelect: a.select })
|
|
1674
1680
|
};
|
|
1675
|
-
return e.brand !== void 0 && (t.brand = () => de(e.brand)), e.userMenu !== void 0 && (t.user = (a) => de(e.userMenu, { expanded: a.expanded === !0 })), { render: () => de(
|
|
1681
|
+
return e.brand !== void 0 && (t.brand = () => de(e.brand)), e.userMenu !== void 0 && (t.user = (a) => de(e.userMenu, { expanded: a.expanded === !0 })), { render: () => de(Xa, null, t) };
|
|
1676
1682
|
}
|
|
1677
|
-
function
|
|
1678
|
-
const e =
|
|
1683
|
+
function on() {
|
|
1684
|
+
const e = rn(mt);
|
|
1679
1685
|
return e !== null ? e : typeof document < "u" && document.documentElement.lang !== "" ? document.documentElement.lang : typeof navigator > "u" ? "en" : navigator.language;
|
|
1680
1686
|
}
|
|
1681
|
-
function
|
|
1687
|
+
function sn(e) {
|
|
1682
1688
|
try {
|
|
1683
|
-
localStorage.setItem(
|
|
1689
|
+
localStorage.setItem(mt, e);
|
|
1684
1690
|
} catch {
|
|
1685
1691
|
}
|
|
1686
1692
|
}
|
|
1687
|
-
function
|
|
1693
|
+
function rn(e) {
|
|
1688
1694
|
try {
|
|
1689
1695
|
return localStorage.getItem(e);
|
|
1690
1696
|
} catch {
|
|
1691
1697
|
return null;
|
|
1692
1698
|
}
|
|
1693
1699
|
}
|
|
1694
|
-
function
|
|
1700
|
+
function un(e, t) {
|
|
1695
1701
|
typeof document > "u" || (document.documentElement.lang = e, document.documentElement.dir = t.find((a) => a.code === e)?.direction ?? "ltr");
|
|
1696
1702
|
}
|
|
1697
|
-
function
|
|
1703
|
+
function dn() {
|
|
1698
1704
|
return typeof document > "u" ? null : document.querySelector('meta[name="webx-manifest"]')?.getAttribute("content") ?? null;
|
|
1699
1705
|
}
|
|
1700
|
-
function
|
|
1706
|
+
function cn(e) {
|
|
1701
1707
|
const t = e.replace(/\r\n?/g, `
|
|
1702
1708
|
`).split(`
|
|
1703
1709
|
`), a = [];
|
|
@@ -1762,7 +1768,7 @@ function Te(e) {
|
|
|
1762
1768
|
function We(e) {
|
|
1763
1769
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1764
1770
|
}
|
|
1765
|
-
function
|
|
1771
|
+
function mn(e) {
|
|
1766
1772
|
const t = e.scope("webx-admin"), a = /* @__PURE__ */ new Map();
|
|
1767
1773
|
function l(s, o, r) {
|
|
1768
1774
|
const u = e.state.locale, c = `${u}:${s}`;
|
|
@@ -1775,7 +1781,7 @@ function cn(e) {
|
|
|
1775
1781
|
const o = fe(s);
|
|
1776
1782
|
if (o === null)
|
|
1777
1783
|
return t("dates.never");
|
|
1778
|
-
const r = /* @__PURE__ */ new Date(), u =
|
|
1784
|
+
const r = /* @__PURE__ */ new Date(), u = He(o, r);
|
|
1779
1785
|
return u === 0 ? t("dates.today", { time: i(o) }) : u === -1 ? t("dates.yesterday", { time: i(o) }) : o.getFullYear() === r.getFullYear() ? l(
|
|
1780
1786
|
"this-year",
|
|
1781
1787
|
{
|
|
@@ -1793,7 +1799,7 @@ function cn(e) {
|
|
|
1793
1799
|
if (o === null)
|
|
1794
1800
|
return t("dates.never");
|
|
1795
1801
|
const r = /* @__PURE__ */ new Date();
|
|
1796
|
-
return
|
|
1802
|
+
return He(o, r) === 0 ? i(o) : o.getFullYear() === r.getFullYear() ? l("compact", { day: "numeric", month: "short" }, o) : l("compact-earlier", { dateStyle: "short" }, o);
|
|
1797
1803
|
},
|
|
1798
1804
|
exact(s) {
|
|
1799
1805
|
const o = fe(s);
|
|
@@ -1805,13 +1811,13 @@ function cn(e) {
|
|
|
1805
1811
|
}
|
|
1806
1812
|
};
|
|
1807
1813
|
}
|
|
1808
|
-
function
|
|
1809
|
-
const e =
|
|
1810
|
-
return
|
|
1814
|
+
function vt() {
|
|
1815
|
+
const e = ne(we, null);
|
|
1816
|
+
return mn(e ?? vn());
|
|
1811
1817
|
}
|
|
1812
1818
|
let ve = null;
|
|
1813
|
-
function
|
|
1814
|
-
return ve === null && (ve = Ee(), ve.defaults("webx-admin",
|
|
1819
|
+
function vn() {
|
|
1820
|
+
return ve === null && (ve = Ee(), ve.defaults("webx-admin", ct)), ve;
|
|
1815
1821
|
}
|
|
1816
1822
|
function fe(e) {
|
|
1817
1823
|
if (e == null || e === "")
|
|
@@ -1819,14 +1825,14 @@ function fe(e) {
|
|
|
1819
1825
|
const t = e instanceof Date ? e : new Date(e);
|
|
1820
1826
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
1821
1827
|
}
|
|
1822
|
-
function
|
|
1828
|
+
function He(e, t) {
|
|
1823
1829
|
const a = (l) => Date.UTC(l.getFullYear(), l.getMonth(), l.getDate());
|
|
1824
1830
|
return Math.round((a(e) - a(t)) / 864e5);
|
|
1825
1831
|
}
|
|
1826
|
-
function
|
|
1827
|
-
const l = e instanceof Ce ? e.status :
|
|
1832
|
+
function fn(e, t, a) {
|
|
1833
|
+
const l = e instanceof Ce ? e.status : pn(e);
|
|
1828
1834
|
if (l === 422)
|
|
1829
|
-
return
|
|
1835
|
+
return hn(e) ?? a ?? t("errors.unknown");
|
|
1830
1836
|
if (l === 401) return t("errors.signed-out");
|
|
1831
1837
|
if (l === 403) return t("errors.forbidden");
|
|
1832
1838
|
if (l === 404) return t("errors.gone");
|
|
@@ -1837,19 +1843,19 @@ function vn(e, t, a) {
|
|
|
1837
1843
|
}
|
|
1838
1844
|
return l !== null && l >= 500 ? t("errors.server") : l === null ? t("errors.offline") : a ?? t("errors.unknown");
|
|
1839
1845
|
}
|
|
1840
|
-
function
|
|
1846
|
+
function Re() {
|
|
1841
1847
|
const e = P("webx-admin");
|
|
1842
|
-
return (t, a) =>
|
|
1848
|
+
return (t, a) => fn(t, e, a);
|
|
1843
1849
|
}
|
|
1844
|
-
function
|
|
1850
|
+
function pn(e) {
|
|
1845
1851
|
const t = e?.status;
|
|
1846
1852
|
return typeof t == "number" ? t : null;
|
|
1847
1853
|
}
|
|
1848
|
-
function
|
|
1854
|
+
function hn(e) {
|
|
1849
1855
|
const a = e?.body?.message;
|
|
1850
1856
|
return typeof a == "string" && a !== "" ? a : null;
|
|
1851
1857
|
}
|
|
1852
|
-
function
|
|
1858
|
+
function gn(e, t, a) {
|
|
1853
1859
|
const l = `${e.apiPath}/entities/${t}/${a}/notes`, i = (o) => `${e.apiPath}/notes/${o}`, s = (o) => o.data;
|
|
1854
1860
|
return {
|
|
1855
1861
|
list: () => e.http.get(l).then(s),
|
|
@@ -1859,32 +1865,39 @@ function hn(e, t, a) {
|
|
|
1859
1865
|
})
|
|
1860
1866
|
};
|
|
1861
1867
|
}
|
|
1862
|
-
|
|
1868
|
+
const ft = /* @__PURE__ */ Symbol("wx-category-editor");
|
|
1869
|
+
function yn(e) {
|
|
1870
|
+
Ye(ft, e);
|
|
1871
|
+
}
|
|
1872
|
+
function Qn() {
|
|
1873
|
+
return ne(ft, null);
|
|
1874
|
+
}
|
|
1875
|
+
function bn(e) {
|
|
1863
1876
|
return (e.q ?? "").trim() !== "" || e.filtered ? "locked" : e.category == null ? "all" : "category";
|
|
1864
1877
|
}
|
|
1865
|
-
function
|
|
1866
|
-
const a = X(), l = P("webx-admin"), i = x(() =>
|
|
1878
|
+
function Zn(e, t) {
|
|
1879
|
+
const a = X(), l = P("webx-admin"), i = x(() => bn(t()));
|
|
1867
1880
|
return {
|
|
1868
1881
|
mode: i,
|
|
1869
1882
|
sortable: x(() => i.value !== "locked"),
|
|
1870
1883
|
hint: x(() => l(`categories.order-${i.value}`)),
|
|
1871
|
-
move: (s) =>
|
|
1884
|
+
move: (s) => aa(a, e, s, i.value === "category" ? t().category ?? null : null)
|
|
1872
1885
|
};
|
|
1873
1886
|
}
|
|
1874
|
-
function
|
|
1887
|
+
function Ne(e = {}) {
|
|
1875
1888
|
const t = P("webx-admin");
|
|
1876
1889
|
return (a, l) => t(e[a] ?? `webx-admin::categories.${a}`, l);
|
|
1877
1890
|
}
|
|
1878
|
-
const
|
|
1891
|
+
const wn = /* @__PURE__ */ N({
|
|
1879
1892
|
name: "WxCategoryCreateDialog",
|
|
1880
1893
|
__name: "CategoryCreateDialog",
|
|
1881
1894
|
props: {
|
|
1882
1895
|
options: {}
|
|
1883
1896
|
},
|
|
1884
1897
|
setup(e) {
|
|
1885
|
-
const t = e, { open: a, resolve: l, dismiss: i } =
|
|
1898
|
+
const t = e, { open: a, resolve: l, dismiss: i } = Dt(), s = xe(X(), t.options.api), o = Ne(t.options.words), r = W(""), u = W(!1), c = W({}), h = qe("field");
|
|
1886
1899
|
Le(async () => {
|
|
1887
|
-
await
|
|
1900
|
+
await Ge(), h.value?.querySelector("input")?.focus();
|
|
1888
1901
|
});
|
|
1889
1902
|
function m(d) {
|
|
1890
1903
|
const w = Object.keys(c.value).find((f) => f === d || f.startsWith(`${d}.`));
|
|
@@ -1902,14 +1915,14 @@ const yn = /* @__PURE__ */ R({
|
|
|
1902
1915
|
}
|
|
1903
1916
|
}
|
|
1904
1917
|
}
|
|
1905
|
-
return (d, w) => (p(), $(n(
|
|
1918
|
+
return (d, w) => (p(), $(n(nt), {
|
|
1906
1919
|
open: n(a),
|
|
1907
|
-
"onUpdate:open": w[2] || (w[2] = (f) =>
|
|
1920
|
+
"onUpdate:open": w[2] || (w[2] = (f) => Xe(a) ? a.value = f : null),
|
|
1908
1921
|
title: n(o)("new"),
|
|
1909
1922
|
width: 440
|
|
1910
1923
|
}, {
|
|
1911
1924
|
footer: g(() => [
|
|
1912
|
-
b(n(
|
|
1925
|
+
b(n(Ft), { size: "sm" }, {
|
|
1913
1926
|
default: g(() => [
|
|
1914
1927
|
b(n(Z), {
|
|
1915
1928
|
variant: "outline",
|
|
@@ -1936,7 +1949,7 @@ const yn = /* @__PURE__ */ R({
|
|
|
1936
1949
|
})
|
|
1937
1950
|
]),
|
|
1938
1951
|
default: g(() => [
|
|
1939
|
-
b(n(
|
|
1952
|
+
b(n(Mt), {
|
|
1940
1953
|
label: n(o)("field-title"),
|
|
1941
1954
|
error: m("title") ?? m("slug"),
|
|
1942
1955
|
required: ""
|
|
@@ -1950,7 +1963,7 @@ const yn = /* @__PURE__ */ R({
|
|
|
1950
1963
|
modelValue: r.value,
|
|
1951
1964
|
"onUpdate:modelValue": w[0] || (w[0] = (f) => r.value = f),
|
|
1952
1965
|
"aria-label": n(o)("field-title"),
|
|
1953
|
-
onKeyup:
|
|
1966
|
+
onKeyup: Je(v, ["enter"])
|
|
1954
1967
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1955
1968
|
], 512)
|
|
1956
1969
|
]),
|
|
@@ -1960,16 +1973,16 @@ const yn = /* @__PURE__ */ R({
|
|
|
1960
1973
|
_: 1
|
|
1961
1974
|
}, 8, ["open", "title"]));
|
|
1962
1975
|
}
|
|
1963
|
-
}),
|
|
1976
|
+
}), xn = { class: "wx-category-row__name" }, kn = /* @__PURE__ */ N({
|
|
1964
1977
|
name: "WxCategoriesPage",
|
|
1965
1978
|
__name: "CategoriesPage",
|
|
1966
1979
|
props: {
|
|
1967
1980
|
options: {}
|
|
1968
1981
|
},
|
|
1969
1982
|
setup(e) {
|
|
1970
|
-
const t = e, a = X(), l = xe(a, t.options.api), i = ge(), s =
|
|
1983
|
+
const t = e, a = X(), l = xe(a, t.options.api), i = ge(), s = Ne(t.options.words), o = Re(), r = W([]), u = W(!0), c = x(() => a.can(t.options.manage)), h = x(
|
|
1971
1984
|
() => a.state.manifest?.modules.find((S) => S.id === t.options.module)?.title ?? ""
|
|
1972
|
-
), m =
|
|
1985
|
+
), m = Ot(wn), v = x(
|
|
1973
1986
|
() => c.value ? [{ key: "new", label: s("new"), icon: "plus", primary: !0, run: () => {
|
|
1974
1987
|
y();
|
|
1975
1988
|
} }] : []
|
|
@@ -2041,7 +2054,7 @@ const yn = /* @__PURE__ */ R({
|
|
|
2041
2054
|
}
|
|
2042
2055
|
return (S, B) => {
|
|
2043
2056
|
const C = j("router-link");
|
|
2044
|
-
return p(), $(
|
|
2057
|
+
return p(), $(it, {
|
|
2045
2058
|
class: "wx-categories",
|
|
2046
2059
|
title: h.value,
|
|
2047
2060
|
actions: v.value,
|
|
@@ -2052,12 +2065,12 @@ const yn = /* @__PURE__ */ R({
|
|
|
2052
2065
|
key: 0,
|
|
2053
2066
|
class: "wx-categories__loading",
|
|
2054
2067
|
rows: 5
|
|
2055
|
-
})) : r.value.length === 0 ? (p(), $(n(
|
|
2068
|
+
})) : r.value.length === 0 ? (p(), $(n(lt), {
|
|
2056
2069
|
key: 1,
|
|
2057
2070
|
title: n(s)("empty"),
|
|
2058
2071
|
description: n(s)("empty-help")
|
|
2059
2072
|
}, null, 8, ["title", "description"])) : (p(), T(H, { key: 2 }, [
|
|
2060
|
-
b(n(
|
|
2073
|
+
b(n(et), {
|
|
2061
2074
|
modelValue: r.value,
|
|
2062
2075
|
"onUpdate:modelValue": B[0] || (B[0] = (A) => r.value = A),
|
|
2063
2076
|
class: "wx-categories__list",
|
|
@@ -2073,7 +2086,7 @@ const yn = /* @__PURE__ */ R({
|
|
|
2073
2086
|
to: `${t.options.path}/${A.id}`
|
|
2074
2087
|
}, {
|
|
2075
2088
|
default: g(() => [
|
|
2076
|
-
O("span",
|
|
2089
|
+
O("span", xn, [
|
|
2077
2090
|
b(n(G), {
|
|
2078
2091
|
truncate: "",
|
|
2079
2092
|
weight: "medium"
|
|
@@ -2083,7 +2096,7 @@ const yn = /* @__PURE__ */ R({
|
|
|
2083
2096
|
]),
|
|
2084
2097
|
_: 2
|
|
2085
2098
|
}, 1024),
|
|
2086
|
-
A.is_visible ? U("", !0) : (p(), $(n(
|
|
2099
|
+
A.is_visible ? U("", !0) : (p(), $(n(ot), {
|
|
2087
2100
|
key: 0,
|
|
2088
2101
|
content: n(s)("hidden")
|
|
2089
2102
|
}, {
|
|
@@ -2139,11 +2152,11 @@ const yn = /* @__PURE__ */ R({
|
|
|
2139
2152
|
}, 8, ["title", "actions"]);
|
|
2140
2153
|
};
|
|
2141
2154
|
}
|
|
2142
|
-
}),
|
|
2155
|
+
}), _n = {
|
|
2143
2156
|
class: "wx-save-state",
|
|
2144
2157
|
role: "status",
|
|
2145
2158
|
"aria-live": "polite"
|
|
2146
|
-
},
|
|
2159
|
+
}, $n = /* @__PURE__ */ N({
|
|
2147
2160
|
__name: "SaveState",
|
|
2148
2161
|
props: {
|
|
2149
2162
|
state: {},
|
|
@@ -2163,9 +2176,9 @@ const yn = /* @__PURE__ */ R({
|
|
|
2163
2176
|
const s = x(
|
|
2164
2177
|
() => t.state === "saving" ? "saving" : l.value ? "saved" : null
|
|
2165
2178
|
);
|
|
2166
|
-
return
|
|
2179
|
+
return Qe(() => {
|
|
2167
2180
|
i !== null && clearTimeout(i);
|
|
2168
|
-
}), (o, r) => (p(), T("span",
|
|
2181
|
+
}), (o, r) => (p(), T("span", _n, [
|
|
2169
2182
|
s.value ? (p(), $(n(Ve), {
|
|
2170
2183
|
key: 0,
|
|
2171
2184
|
class: ae(["wx-save-state__mark", { "is-saved": s.value === "saved" }]),
|
|
@@ -2175,9 +2188,9 @@ const yn = /* @__PURE__ */ R({
|
|
|
2175
2188
|
}, null, 8, ["class", "name", "spin", "label"])) : U("", !0)
|
|
2176
2189
|
]));
|
|
2177
2190
|
}
|
|
2178
|
-
}),
|
|
2191
|
+
}), Tn = /* @__PURE__ */ Y($n, [["__scopeId", "data-v-216e5e44"]]), Sn = { class: "wx-screen-host" }, Cn = /* @__PURE__ */ N({
|
|
2179
2192
|
__name: "Screen",
|
|
2180
|
-
props: /* @__PURE__ */
|
|
2193
|
+
props: /* @__PURE__ */ oe({
|
|
2181
2194
|
name: {},
|
|
2182
2195
|
errors: { default: void 0 },
|
|
2183
2196
|
disabled: { type: Boolean, default: !1 },
|
|
@@ -2188,7 +2201,7 @@ const yn = /* @__PURE__ */ R({
|
|
|
2188
2201
|
modelValue: { default: () => ({}) },
|
|
2189
2202
|
modelModifiers: {}
|
|
2190
2203
|
}),
|
|
2191
|
-
emits: /* @__PURE__ */
|
|
2204
|
+
emits: /* @__PURE__ */ oe(["loaded"], ["update:modelValue"]),
|
|
2192
2205
|
setup(e, { expose: t, emit: a }) {
|
|
2193
2206
|
const l = e, i = a, s = ue(e, "modelValue"), o = X(), r = P("webx-admin"), u = W(null), c = W(null);
|
|
2194
2207
|
async function h() {
|
|
@@ -2202,7 +2215,7 @@ const yn = /* @__PURE__ */ R({
|
|
|
2202
2215
|
}
|
|
2203
2216
|
return ee([() => l.name, () => o.i18n.state.locale], () => {
|
|
2204
2217
|
h();
|
|
2205
|
-
}, { immediate: !0 }), t({ reload: h }), (m, v) => (p(), T("div",
|
|
2218
|
+
}, { immediate: !0 }), t({ reload: h }), (m, v) => (p(), T("div", Sn, [
|
|
2206
2219
|
c.value ? (p(), $(n(be), {
|
|
2207
2220
|
key: 0,
|
|
2208
2221
|
type: "danger",
|
|
@@ -2211,7 +2224,7 @@ const yn = /* @__PURE__ */ R({
|
|
|
2211
2224
|
}, null, 8, ["title", "description"])) : u.value === null ? (p(), $(n(re), {
|
|
2212
2225
|
key: 1,
|
|
2213
2226
|
rows: 4
|
|
2214
|
-
})) : (p(), $(n(
|
|
2227
|
+
})) : (p(), $(n(Qt), {
|
|
2215
2228
|
key: 2,
|
|
2216
2229
|
modelValue: s.value,
|
|
2217
2230
|
"onUpdate:modelValue": v[0] || (v[0] = (d) => s.value = d),
|
|
@@ -2228,20 +2241,25 @@ const yn = /* @__PURE__ */ R({
|
|
|
2228
2241
|
}, null, 8, ["modelValue", "root", "patch", "types", "errors", "translate", "can", "disabled", "label-position", "label-width", "size"]))
|
|
2229
2242
|
]));
|
|
2230
2243
|
}
|
|
2231
|
-
}),
|
|
2244
|
+
}), Wn = /* @__PURE__ */ N({
|
|
2232
2245
|
name: "WxCategoryEditorPage",
|
|
2233
2246
|
__name: "CategoryEditorPage",
|
|
2234
2247
|
props: {
|
|
2235
2248
|
options: {}
|
|
2236
2249
|
},
|
|
2237
2250
|
setup(e) {
|
|
2238
|
-
const t = e, a = X(), l = xe(a, t.options.api), i =
|
|
2251
|
+
const t = e, a = X(), l = xe(a, t.options.api), i = Ze(), s = ge(), o = at(), r = Ne(t.options.words), u = Re(), c = x(() => Number(i.params.id)), h = x(() => t.options.path), m = W(null), v = W({}), d = W(null), w = W(""), f = W(!0), y = W(!1), k = W({}), M = x(() => a.can(t.options.manage)), J = x(() => JSON.stringify(v.value)), S = x(() => w.value !== "" && J.value !== w.value), B = x(() => y.value ? "saving" : S.value ? "unsaved" : "saved"), C = x(
|
|
2239
2252
|
() => a.state.manifest?.modules.find((z) => z.id === t.options.module)?.title ?? ""
|
|
2240
2253
|
), A = x(() => {
|
|
2241
2254
|
const z = v.value.title;
|
|
2242
|
-
return
|
|
2255
|
+
return Ht(z, o.active.value, m.value?.name ?? "") || r("untitled");
|
|
2256
|
+
});
|
|
2257
|
+
yn({ category: m, values: v, prefix: d, moving: () => r("address-moving") }), La({
|
|
2258
|
+
values: v,
|
|
2259
|
+
prefix: d,
|
|
2260
|
+
path: x(() => m.value?.path),
|
|
2261
|
+
moving: () => r("address-moving")
|
|
2243
2262
|
});
|
|
2244
|
-
oa({ category: m, values: v, prefix: d, moving: () => r("address-moving") });
|
|
2245
2263
|
function E(z) {
|
|
2246
2264
|
m.value = z.category, v.value = z.values, d.value = z.prefix, w.value = JSON.stringify(z.values);
|
|
2247
2265
|
}
|
|
@@ -2255,7 +2273,7 @@ const yn = /* @__PURE__ */ R({
|
|
|
2255
2273
|
f.value = !1;
|
|
2256
2274
|
}
|
|
2257
2275
|
}
|
|
2258
|
-
async function
|
|
2276
|
+
async function le() {
|
|
2259
2277
|
if (!(!m.value || y.value || !M.value)) {
|
|
2260
2278
|
y.value = !0, k.value = {};
|
|
2261
2279
|
try {
|
|
@@ -2287,15 +2305,15 @@ const yn = /* @__PURE__ */ R({
|
|
|
2287
2305
|
S.value && z.preventDefault();
|
|
2288
2306
|
}
|
|
2289
2307
|
function ke(z) {
|
|
2290
|
-
(z.ctrlKey || z.metaKey) && z.key.toLowerCase() === "s" && (z.preventDefault(), S.value &&
|
|
2308
|
+
(z.ctrlKey || z.metaKey) && z.key.toLowerCase() === "s" && (z.preventDefault(), S.value && le());
|
|
2291
2309
|
}
|
|
2292
2310
|
ee(c, () => {
|
|
2293
2311
|
K();
|
|
2294
2312
|
}), Le(() => {
|
|
2295
2313
|
K(), window.addEventListener("beforeunload", te);
|
|
2296
|
-
}),
|
|
2314
|
+
}), Qe(() => {
|
|
2297
2315
|
window.removeEventListener("beforeunload", te);
|
|
2298
|
-
}),
|
|
2316
|
+
}), Tt(async () => !S.value || !M.value ? !0 : await he({
|
|
2299
2317
|
title: r("leave-title"),
|
|
2300
2318
|
message: r("leave-text"),
|
|
2301
2319
|
confirmText: r("leave"),
|
|
@@ -2332,7 +2350,7 @@ const yn = /* @__PURE__ */ R({
|
|
|
2332
2350
|
_: 1
|
|
2333
2351
|
})
|
|
2334
2352
|
], 64)) : (p(), T(H, { key: 1 }, [
|
|
2335
|
-
b(
|
|
2353
|
+
b(st, {
|
|
2336
2354
|
divider: "",
|
|
2337
2355
|
back: h.value,
|
|
2338
2356
|
"back-label": C.value,
|
|
@@ -2341,7 +2359,7 @@ const yn = /* @__PURE__ */ R({
|
|
|
2341
2359
|
actions: _e.value
|
|
2342
2360
|
}, Ae({
|
|
2343
2361
|
trail: g(() => [
|
|
2344
|
-
b(n(
|
|
2362
|
+
b(n(jt), {
|
|
2345
2363
|
size: "sm",
|
|
2346
2364
|
label: n(r)("trail")
|
|
2347
2365
|
}, {
|
|
@@ -2380,23 +2398,23 @@ const yn = /* @__PURE__ */ R({
|
|
|
2380
2398
|
key: "0"
|
|
2381
2399
|
}
|
|
2382
2400
|
]), 1032, ["back", "back-label", "title", "subtitle", "actions"]),
|
|
2383
|
-
b(
|
|
2401
|
+
b(Cn, {
|
|
2384
2402
|
modelValue: v.value,
|
|
2385
2403
|
"onUpdate:modelValue": q[0] || (q[0] = (_) => v.value = _),
|
|
2386
2404
|
name: t.options.screen,
|
|
2387
2405
|
errors: k.value,
|
|
2388
2406
|
disabled: !M.value || y.value
|
|
2389
2407
|
}, null, 8, ["modelValue", "name", "errors", "disabled"]),
|
|
2390
|
-
M.value ? (p(), $(n(
|
|
2408
|
+
M.value ? (p(), $(n(Kt), { key: 0 }, {
|
|
2391
2409
|
state: g(() => [
|
|
2392
|
-
b(
|
|
2410
|
+
b(Tn, { state: B.value }, null, 8, ["state"])
|
|
2393
2411
|
]),
|
|
2394
2412
|
default: g(() => [
|
|
2395
2413
|
b(n(Z), {
|
|
2396
2414
|
type: "primary",
|
|
2397
2415
|
loading: y.value,
|
|
2398
2416
|
disabled: !S.value,
|
|
2399
|
-
onClick:
|
|
2417
|
+
onClick: le
|
|
2400
2418
|
}, {
|
|
2401
2419
|
default: g(() => [
|
|
2402
2420
|
V(L(n(r)("save")), 1)
|
|
@@ -2409,19 +2427,19 @@ const yn = /* @__PURE__ */ R({
|
|
|
2409
2427
|
], 64))
|
|
2410
2428
|
], 32));
|
|
2411
2429
|
}
|
|
2412
|
-
}),
|
|
2413
|
-
function
|
|
2430
|
+
}), Ln = /* @__PURE__ */ Y(Wn, [["__scopeId", "data-v-86d85f8c"]]);
|
|
2431
|
+
function el(e) {
|
|
2414
2432
|
return [
|
|
2415
|
-
{ path: e.path, name: e.name, component:
|
|
2433
|
+
{ path: e.path, name: e.name, component: kn, props: { options: e } },
|
|
2416
2434
|
{
|
|
2417
2435
|
path: `${e.path}/:id(\\d+)`,
|
|
2418
2436
|
name: `${e.name}.edit`,
|
|
2419
|
-
component:
|
|
2437
|
+
component: Ln,
|
|
2420
2438
|
props: { options: e }
|
|
2421
2439
|
}
|
|
2422
2440
|
];
|
|
2423
2441
|
}
|
|
2424
|
-
const
|
|
2442
|
+
const tl = 76, al = /* @__PURE__ */ N({
|
|
2425
2443
|
__name: "FilterChips",
|
|
2426
2444
|
props: {
|
|
2427
2445
|
filters: {}
|
|
@@ -2441,7 +2459,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2441
2459
|
_: 2
|
|
2442
2460
|
}, 1032, ["onClose"]))), 128));
|
|
2443
2461
|
}
|
|
2444
|
-
}),
|
|
2462
|
+
}), An = { class: "wx-rename__footer" }, zn = /* @__PURE__ */ N({
|
|
2445
2463
|
__name: "RenameButton",
|
|
2446
2464
|
props: {
|
|
2447
2465
|
name: { default: "" },
|
|
@@ -2454,7 +2472,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2454
2472
|
setup(e, { emit: t }) {
|
|
2455
2473
|
const a = e, l = t, i = P("webx-admin"), s = W(!1), o = W(a.name), r = W(null), u = x(() => a.label ?? i("editor.rename"));
|
|
2456
2474
|
ee(s, async (h) => {
|
|
2457
|
-
h && (o.value = a.name, await
|
|
2475
|
+
h && (o.value = a.name, await Ge(), r.value?.focus(), r.value?.select());
|
|
2458
2476
|
});
|
|
2459
2477
|
function c() {
|
|
2460
2478
|
const h = o.value.trim();
|
|
@@ -2464,7 +2482,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2464
2482
|
}
|
|
2465
2483
|
l("rename", h), s.value = !1;
|
|
2466
2484
|
}
|
|
2467
|
-
return (h, m) => (p(), $(n(
|
|
2485
|
+
return (h, m) => (p(), $(n(qt), {
|
|
2468
2486
|
open: s.value,
|
|
2469
2487
|
"onUpdate:open": m[2] || (m[2] = (v) => s.value = v),
|
|
2470
2488
|
title: u.value,
|
|
@@ -2484,7 +2502,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2484
2502
|
default: g(() => [
|
|
2485
2503
|
O("form", {
|
|
2486
2504
|
class: "wx-rename",
|
|
2487
|
-
onSubmit:
|
|
2505
|
+
onSubmit: Ke(c, ["prevent"])
|
|
2488
2506
|
}, [
|
|
2489
2507
|
b(n(ye), {
|
|
2490
2508
|
ref_key: "field",
|
|
@@ -2493,9 +2511,9 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2493
2511
|
"onUpdate:modelValue": m[0] || (m[0] = (v) => o.value = v),
|
|
2494
2512
|
"aria-label": u.value,
|
|
2495
2513
|
placeholder: e.placeholder,
|
|
2496
|
-
onKeydown: m[1] || (m[1] =
|
|
2514
|
+
onKeydown: m[1] || (m[1] = Je((v) => s.value = !1, ["esc"]))
|
|
2497
2515
|
}, null, 8, ["modelValue", "aria-label", "placeholder"]),
|
|
2498
|
-
O("div",
|
|
2516
|
+
O("div", An, [
|
|
2499
2517
|
b(n(Z), {
|
|
2500
2518
|
type: "primary",
|
|
2501
2519
|
size: "sm",
|
|
@@ -2512,7 +2530,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2512
2530
|
_: 1
|
|
2513
2531
|
}, 8, ["open", "title"]));
|
|
2514
2532
|
}
|
|
2515
|
-
}),
|
|
2533
|
+
}), nl = /* @__PURE__ */ Y(zn, [["__scopeId", "data-v-d879e8d3"]]), Vn = ["innerHTML"], En = /* @__PURE__ */ N({
|
|
2516
2534
|
__name: "HelpButton",
|
|
2517
2535
|
props: {
|
|
2518
2536
|
body: {},
|
|
@@ -2522,7 +2540,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2522
2540
|
width: { default: 720 }
|
|
2523
2541
|
},
|
|
2524
2542
|
setup(e) {
|
|
2525
|
-
const t = e, a = P("webx-admin"), l = W(!1), i = x(() => t.title ?? a("help.title")), s = x(() =>
|
|
2543
|
+
const t = e, a = P("webx-admin"), l = W(!1), i = x(() => t.title ?? a("help.title")), s = x(() => cn(t.body));
|
|
2526
2544
|
return (o, r) => (p(), T(H, null, [
|
|
2527
2545
|
b(n(se), {
|
|
2528
2546
|
type: "details",
|
|
@@ -2532,7 +2550,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2532
2550
|
title: e.label ?? i.value,
|
|
2533
2551
|
onClick: r[0] || (r[0] = (u) => l.value = !0)
|
|
2534
2552
|
}, null, 8, ["size", "title"]),
|
|
2535
|
-
b(n(
|
|
2553
|
+
b(n(nt), {
|
|
2536
2554
|
open: l.value,
|
|
2537
2555
|
"onUpdate:open": r[1] || (r[1] = (u) => l.value = u),
|
|
2538
2556
|
title: i.value,
|
|
@@ -2542,13 +2560,13 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2542
2560
|
O("div", {
|
|
2543
2561
|
class: "wx-help",
|
|
2544
2562
|
innerHTML: s.value
|
|
2545
|
-
}, null, 8,
|
|
2563
|
+
}, null, 8, Vn)
|
|
2546
2564
|
]),
|
|
2547
2565
|
_: 1
|
|
2548
2566
|
}, 8, ["open", "title", "width"])
|
|
2549
2567
|
], 64));
|
|
2550
2568
|
}
|
|
2551
|
-
}),
|
|
2569
|
+
}), ll = /* @__PURE__ */ Y(En, [["__scopeId", "data-v-6c280d42"]]), pt = /* @__PURE__ */ N({
|
|
2552
2570
|
name: "WxDate",
|
|
2553
2571
|
__name: "DateText",
|
|
2554
2572
|
props: {
|
|
@@ -2558,8 +2576,8 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2558
2576
|
tone: { default: "muted" }
|
|
2559
2577
|
},
|
|
2560
2578
|
setup(e) {
|
|
2561
|
-
const t = e, a =
|
|
2562
|
-
return (o, r) => i.value ? (p(), $(n(
|
|
2579
|
+
const t = e, a = vt(), l = x(() => t.compact ? a.compact(t.value) : a.short(t.value)), i = x(() => a.exact(t.value)), s = x(() => a.iso(t.value));
|
|
2580
|
+
return (o, r) => i.value ? (p(), $(n(ot), {
|
|
2563
2581
|
key: 0,
|
|
2564
2582
|
content: i.value
|
|
2565
2583
|
}, {
|
|
@@ -2588,16 +2606,16 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2588
2606
|
_: 1
|
|
2589
2607
|
}, 8, ["size", "tone"]));
|
|
2590
2608
|
}
|
|
2591
|
-
}),
|
|
2609
|
+
}), Un = { class: "wx-notes" }, Rn = {
|
|
2592
2610
|
key: 3,
|
|
2593
2611
|
class: "wx-notes__list"
|
|
2594
|
-
},
|
|
2612
|
+
}, Nn = { class: "wx-note__body" }, Bn = { class: "wx-note__head" }, In = { class: "wx-note__buttons" }, Pn = {
|
|
2595
2613
|
key: 1,
|
|
2596
2614
|
class: "wx-note__text"
|
|
2597
|
-
},
|
|
2615
|
+
}, Dn = {
|
|
2598
2616
|
key: 4,
|
|
2599
2617
|
class: "wx-notes__new"
|
|
2600
|
-
},
|
|
2618
|
+
}, Mn = /* @__PURE__ */ N({
|
|
2601
2619
|
name: "WxNotes",
|
|
2602
2620
|
__name: "NotesFeed",
|
|
2603
2621
|
props: {
|
|
@@ -2608,7 +2626,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2608
2626
|
},
|
|
2609
2627
|
emits: ["change"],
|
|
2610
2628
|
setup(e, { emit: t }) {
|
|
2611
|
-
const a = e, l = t, i = X(), s = P("webx-admin"), o =
|
|
2629
|
+
const a = e, l = t, i = X(), s = P("webx-admin"), o = Re(), r = W([]), u = W(!0), c = W(""), h = W(!1), m = W(null), v = W(""), d = x(() => gn(i, a.type, a.id)), w = x(() => a.title ?? s("notes.title"));
|
|
2612
2630
|
async function f() {
|
|
2613
2631
|
u.value = !0;
|
|
2614
2632
|
try {
|
|
@@ -2683,7 +2701,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2683
2701
|
function B(C) {
|
|
2684
2702
|
return C.author?.name ?? s("notes.unknown-author");
|
|
2685
2703
|
}
|
|
2686
|
-
return (C, A) => (p(), T("section",
|
|
2704
|
+
return (C, A) => (p(), T("section", Un, [
|
|
2687
2705
|
w.value ? (p(), $(n(G), {
|
|
2688
2706
|
key: 0,
|
|
2689
2707
|
weight: "medium",
|
|
@@ -2697,22 +2715,22 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2697
2715
|
u.value ? (p(), $(n(re), {
|
|
2698
2716
|
key: 1,
|
|
2699
2717
|
rows: 2
|
|
2700
|
-
})) : r.value.length === 0 ? (p(), $(n(
|
|
2718
|
+
})) : r.value.length === 0 ? (p(), $(n(lt), {
|
|
2701
2719
|
key: 2,
|
|
2702
2720
|
size: "sm",
|
|
2703
2721
|
description: n(s)("notes.empty")
|
|
2704
|
-
}, null, 8, ["description"])) : (p(), T("ul",
|
|
2722
|
+
}, null, 8, ["description"])) : (p(), T("ul", Rn, [
|
|
2705
2723
|
(p(!0), T(H, null, Q(r.value, (E) => (p(), T("li", {
|
|
2706
2724
|
key: E.id,
|
|
2707
2725
|
class: "wx-note"
|
|
2708
2726
|
}, [
|
|
2709
|
-
b(n(
|
|
2727
|
+
b(n(Yt), {
|
|
2710
2728
|
name: B(E),
|
|
2711
2729
|
size: "sm",
|
|
2712
2730
|
tone: "auto"
|
|
2713
2731
|
}, null, 8, ["name"]),
|
|
2714
|
-
O("div",
|
|
2715
|
-
O("div",
|
|
2732
|
+
O("div", Nn, [
|
|
2733
|
+
O("div", Bn, [
|
|
2716
2734
|
b(n(G), {
|
|
2717
2735
|
size: "sm",
|
|
2718
2736
|
weight: "medium",
|
|
@@ -2723,7 +2741,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2723
2741
|
]),
|
|
2724
2742
|
_: 2
|
|
2725
2743
|
}, 1024),
|
|
2726
|
-
b(
|
|
2744
|
+
b(pt, {
|
|
2727
2745
|
value: E.created_at
|
|
2728
2746
|
}, null, 8, ["value"]),
|
|
2729
2747
|
b(Ue, {
|
|
@@ -2737,7 +2755,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2737
2755
|
"onUpdate:modelValue": A[0] || (A[0] = (K) => v.value = K),
|
|
2738
2756
|
autosize: { minRows: 2, maxRows: 10 }
|
|
2739
2757
|
}, null, 8, ["modelValue"]),
|
|
2740
|
-
O("div",
|
|
2758
|
+
O("div", In, [
|
|
2741
2759
|
b(n(Z), {
|
|
2742
2760
|
size: "sm",
|
|
2743
2761
|
type: "primary",
|
|
@@ -2759,11 +2777,11 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2759
2777
|
_: 1
|
|
2760
2778
|
})
|
|
2761
2779
|
])
|
|
2762
|
-
], 64)) : (p(), T("p",
|
|
2780
|
+
], 64)) : (p(), T("p", Pn, L(E.body), 1))
|
|
2763
2781
|
])
|
|
2764
2782
|
]))), 128))
|
|
2765
2783
|
])),
|
|
2766
|
-
e.can ? (p(), T("div",
|
|
2784
|
+
e.can ? (p(), T("div", Dn, [
|
|
2767
2785
|
b(n(De), {
|
|
2768
2786
|
modelValue: c.value,
|
|
2769
2787
|
"onUpdate:modelValue": A[2] || (A[2] = (E) => c.value = E),
|
|
@@ -2785,18 +2803,18 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2785
2803
|
])) : U("", !0)
|
|
2786
2804
|
]));
|
|
2787
2805
|
}
|
|
2788
|
-
}),
|
|
2806
|
+
}), ol = /* @__PURE__ */ Y(Mn, [["__scopeId", "data-v-71004c1a"]]), Fn = {
|
|
2789
2807
|
key: 1,
|
|
2790
2808
|
class: "wx-backup-note"
|
|
2791
|
-
},
|
|
2809
|
+
}, On = 48, Hn = /* @__PURE__ */ N({
|
|
2792
2810
|
name: "WxBackupNote",
|
|
2793
2811
|
__name: "BackupNote",
|
|
2794
2812
|
setup(e) {
|
|
2795
|
-
const t = X(), a =
|
|
2813
|
+
const t = X(), a = vt(), l = P("webx-admin"), i = x(() => t.state.manifest?.backup ?? null), s = x(() => i.value !== null && t.can("settings.view")), o = x(() => {
|
|
2796
2814
|
const c = i.value?.at;
|
|
2797
2815
|
if (c == null) return !0;
|
|
2798
2816
|
const h = new Date(c).getTime();
|
|
2799
|
-
return Number.isNaN(h) || Date.now() - h >
|
|
2817
|
+
return Number.isNaN(h) || Date.now() - h > On * 36e5;
|
|
2800
2818
|
}), r = x(() => {
|
|
2801
2819
|
const c = i.value?.bytes;
|
|
2802
2820
|
if (c == null) return "";
|
|
@@ -2818,7 +2836,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2818
2836
|
type: "warning",
|
|
2819
2837
|
variant: "soft",
|
|
2820
2838
|
description: u.value
|
|
2821
|
-
}, null, 8, ["description"])) : s.value ? (p(), T("p",
|
|
2839
|
+
}, null, 8, ["description"])) : s.value ? (p(), T("p", Fn, [
|
|
2822
2840
|
b(n(G), {
|
|
2823
2841
|
size: "sm",
|
|
2824
2842
|
tone: "muted"
|
|
@@ -2828,7 +2846,7 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2828
2846
|
]),
|
|
2829
2847
|
_: 1
|
|
2830
2848
|
}),
|
|
2831
|
-
b(
|
|
2849
|
+
b(pt, {
|
|
2832
2850
|
value: i.value?.at
|
|
2833
2851
|
}, null, 8, ["value"]),
|
|
2834
2852
|
r.value ? (p(), $(n(G), {
|
|
@@ -2843,65 +2861,69 @@ const Qn = 76, Zn = /* @__PURE__ */ R({
|
|
|
2843
2861
|
})) : U("", !0)
|
|
2844
2862
|
])) : U("", !0);
|
|
2845
2863
|
}
|
|
2846
|
-
}),
|
|
2864
|
+
}), sl = /* @__PURE__ */ Y(Hn, [["__scopeId", "data-v-beeee67e"]]);
|
|
2847
2865
|
export {
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2866
|
+
Ia as AdminLanding,
|
|
2867
|
+
Pa as AdminNav,
|
|
2868
|
+
Xa as AdminShell,
|
|
2851
2869
|
Ce as HttpError,
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2870
|
+
ya as WxBackButton,
|
|
2871
|
+
sl as WxBackupNote,
|
|
2872
|
+
sa as WxCategoriesField,
|
|
2873
|
+
kn as WxCategoriesPage,
|
|
2874
|
+
wn as WxCategoryCreateDialog,
|
|
2875
|
+
Ln as WxCategoryEditorPage,
|
|
2876
|
+
Me as WxCategorySlug,
|
|
2877
|
+
pt as WxDate,
|
|
2878
|
+
al as WxFilterChips,
|
|
2879
|
+
ll as WxHelpButton,
|
|
2880
|
+
ga as WxLinkField,
|
|
2881
|
+
ha as WxLinkPicker,
|
|
2882
|
+
it as WxListScreen,
|
|
2883
|
+
ol as WxNotes,
|
|
2884
|
+
nl as WxRenameButton,
|
|
2885
|
+
Wa as WxRichTextField,
|
|
2868
2886
|
Ue as WxRowMenu,
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
ut as
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2887
|
+
Tn as WxSaveState,
|
|
2888
|
+
Cn as WxScreen,
|
|
2889
|
+
st as WxScreenHead,
|
|
2890
|
+
Me as WxSlugField,
|
|
2891
|
+
ut as adminKey,
|
|
2892
|
+
ct as adminMessages,
|
|
2893
|
+
Ua as adminTypes,
|
|
2894
|
+
el as categoryRoutes,
|
|
2895
|
+
Jn as createAdmin,
|
|
2896
|
+
Ra as createAdminContext,
|
|
2878
2897
|
xe as createCategoriesApi,
|
|
2879
|
-
|
|
2880
|
-
|
|
2898
|
+
mn as createDates,
|
|
2899
|
+
Ja as createHttp,
|
|
2881
2900
|
Ee as createI18n,
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2901
|
+
ra as createLinksApi,
|
|
2902
|
+
gn as createNotesApi,
|
|
2903
|
+
an as createTheme,
|
|
2904
|
+
ia as emptyLink,
|
|
2905
|
+
fn as errorText,
|
|
2887
2906
|
we as i18nKey,
|
|
2888
|
-
|
|
2907
|
+
bn as itemOrderMode,
|
|
2889
2908
|
Na as provideAdmin,
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2909
|
+
ea as provideI18n,
|
|
2910
|
+
La as provideRecordAddress,
|
|
2911
|
+
tn as provideTheme,
|
|
2912
|
+
Fe as readCookie,
|
|
2913
|
+
rt as recordAddressKey,
|
|
2914
|
+
cn as renderMarkdown,
|
|
2915
|
+
aa as reorderItems,
|
|
2916
|
+
tl as rowMenuWidth,
|
|
2917
|
+
dt as themeKey,
|
|
2897
2918
|
X as useAdmin,
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2919
|
+
Qn as useCategoryEditor,
|
|
2920
|
+
Ne as useCategoryWords,
|
|
2921
|
+
vt as useDates,
|
|
2922
|
+
Re as useErrorText,
|
|
2923
|
+
Zt as useI18n,
|
|
2924
|
+
Zn as useItemOrder,
|
|
2925
|
+
Aa as useRecordAddress,
|
|
2926
|
+
Gn as useTheme,
|
|
2905
2927
|
P as useTranslate
|
|
2906
2928
|
};
|
|
2907
2929
|
//# sourceMappingURL=index.js.map
|