@webx-ui/module-blog 0.4.6 → 0.5.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/api.d.ts +5 -14
- package/dist/index.d.ts +2 -5
- package/dist/index.js +1116 -1659
- package/dist/index.js.map +1 -1
- package/dist/module.d.ts +10 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +8 -31
- package/package.json +5 -5
- package/dist/ArticleRubrics.d.ts +0 -14
- package/dist/RubricDialog.d.ts +0 -34
- package/dist/RubricsPage.d.ts +0 -19
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { WxSelect as
|
|
4
|
-
import { useRoute as
|
|
5
|
-
import { provideBlocksPreview as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
8
|
-
vt(
|
|
1
|
+
import { useAdmin as le, useTranslate as J, useDates as rt, useErrorText as be, WxScreenHead as ot, WxScreen as ut, WxSaveState as ct, WxDate as Be, rowMenuWidth as Xe, WxListScreen as Ye, WxRowMenu as Ve, WxFilterChips as dt, categoryRoutes as pt } from "@webx-ui/module-admin";
|
|
2
|
+
import { provide as vt, inject as gt, defineComponent as Q, useModel as Oe, computed as h, openBlock as x, createBlock as I, unref as e, mergeModels as Le, ref as M, watch as pe, onMounted as Ue, onBeforeUnmount as Fe, createElementBlock as K, Fragment as ke, createVNode as r, withCtx as i, createTextVNode as V, toDisplayString as _, createCommentVNode as L, createElementVNode as O, renderList as Ne, normalizeClass as et, normalizeProps as ht, guardReactiveProps as ft, useTemplateRef as qe, nextTick as Ke, isRef as Ie, withKeys as ze, useId as mt, withModifiers as je } from "vue";
|
|
3
|
+
import { WxSelect as _e, useLocales as tt, localizedValue as bt, confirm as ce, WxSkeleton as Ee, WxCard as yt, WxBadge as ae, WxBreadcrumb as wt, WxBreadcrumbItem as Je, WxAlert as Me, WxButton as H, WxActionBar as at, toast as D, WxEmpty as xt, WxText as te, WxSortableList as _t, WxAction as kt, WxInput as We, WxFormItem as de, useModal as Pe, WxDialog as Re, WxSpace as De, useElementWidth as $t, createModal as Ce, WxTable as lt, WxEntityCard as Tt, WxIcon as Te, WxTooltip as it, WxCheckbox as At } from "@webx-ui/core";
|
|
4
|
+
import { useRoute as He, useRouter as Ge, onBeforeRouteLeave as St } from "vue-router";
|
|
5
|
+
import { provideBlocksPreview as Wt } from "@webx-ui/module-blocks";
|
|
6
|
+
const nt = /* @__PURE__ */ Symbol("wx-article-editor");
|
|
7
|
+
function Ct(v) {
|
|
8
|
+
vt(nt, v);
|
|
9
9
|
}
|
|
10
10
|
function Ae() {
|
|
11
|
-
return
|
|
11
|
+
return gt(nt, null);
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const Vt = {
|
|
14
14
|
module: {
|
|
15
15
|
group: "Blog",
|
|
16
16
|
articles: "Articles",
|
|
@@ -224,305 +224,298 @@ const qt = {
|
|
|
224
224
|
"merge-warning": ":count articles will carry “:tag” instead. :merged tags will be deleted, and there is no undoing it.",
|
|
225
225
|
"merge-confirm": "Merge"
|
|
226
226
|
}
|
|
227
|
-
},
|
|
228
|
-
function
|
|
227
|
+
}, Ze = /* @__PURE__ */ new WeakSet();
|
|
228
|
+
function X() {
|
|
229
229
|
try {
|
|
230
|
-
const { i18n:
|
|
231
|
-
|
|
230
|
+
const { i18n: v } = le();
|
|
231
|
+
Ze.has(v) || (v.defaults("webx-blog", Vt), Ze.add(v));
|
|
232
232
|
} catch {
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
const
|
|
235
|
+
const zt = /* @__PURE__ */ Q({
|
|
236
236
|
name: "WxArticleAuthor",
|
|
237
237
|
__name: "ArticleAuthor",
|
|
238
|
-
props: /* @__PURE__ */
|
|
238
|
+
props: /* @__PURE__ */ Le({
|
|
239
239
|
disabled: { type: Boolean, default: !1 }
|
|
240
240
|
}, {
|
|
241
241
|
modelValue: { default: null },
|
|
242
242
|
modelModifiers: {}
|
|
243
243
|
}),
|
|
244
244
|
emits: ["update:modelValue"],
|
|
245
|
-
setup(
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
() => (
|
|
250
|
-
label:
|
|
251
|
-
value:
|
|
245
|
+
setup(v) {
|
|
246
|
+
const c = v, p = Oe(v, "modelValue"), g = Ae();
|
|
247
|
+
X();
|
|
248
|
+
const a = J("webx-blog"), s = h(() => c.disabled || g?.disabled.value === !0), t = h(
|
|
249
|
+
() => (g?.options.value.authors ?? []).map((l) => ({
|
|
250
|
+
label: l.title,
|
|
251
|
+
value: l.id
|
|
252
252
|
}))
|
|
253
|
-
),
|
|
254
|
-
get: () =>
|
|
255
|
-
set: (
|
|
256
|
-
|
|
253
|
+
), o = h({
|
|
254
|
+
get: () => p.value,
|
|
255
|
+
set: (l) => {
|
|
256
|
+
p.value = typeof l == "number" ? l : null;
|
|
257
257
|
}
|
|
258
258
|
});
|
|
259
|
-
return (
|
|
260
|
-
modelValue:
|
|
261
|
-
"onUpdate:modelValue":
|
|
259
|
+
return (l, y) => (x(), I(e(_e), {
|
|
260
|
+
modelValue: o.value,
|
|
261
|
+
"onUpdate:modelValue": y[0] || (y[0] = (f) => o.value = f),
|
|
262
262
|
options: t.value,
|
|
263
|
-
placeholder: e(
|
|
264
|
-
disabled:
|
|
263
|
+
placeholder: e(a)("article.no-author"),
|
|
264
|
+
disabled: s.value,
|
|
265
265
|
clearable: "",
|
|
266
266
|
filterable: "",
|
|
267
267
|
teleport: "",
|
|
268
|
-
"aria-label": e(
|
|
268
|
+
"aria-label": e(a)("article.author")
|
|
269
269
|
}, null, 8, ["modelValue", "options", "placeholder", "disabled", "aria-label"]));
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
|
-
function re(
|
|
273
|
-
const
|
|
272
|
+
function re(v) {
|
|
273
|
+
const c = `${v.apiPath}/blog/articles`, p = `${v.apiPath}/blog/tags`, g = (a) => a.data;
|
|
274
274
|
return {
|
|
275
|
-
articles: (
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
const
|
|
279
|
-
return
|
|
275
|
+
articles: (a = {}) => {
|
|
276
|
+
const s = new URLSearchParams();
|
|
277
|
+
a.q && s.set("q", a.q), a.rubric != null && s.set("rubric", String(a.rubric)), a.tag != null && s.set("tag", String(a.tag)), a.author != null && s.set("author", String(a.author)), a.status && s.set("status", a.status), a.sort && s.set("sort", a.sort), a.trashed && s.set("trashed", "1"), a.page && a.page > 1 && s.set("page", String(a.page)), a.per_page && s.set("per_page", String(a.per_page));
|
|
278
|
+
const t = s.size > 0 ? `?${s}` : "";
|
|
279
|
+
return v.http.get(`${c}${t}`).then((o) => ({ ...o.meta, data: o.data, filters: o.filters }));
|
|
280
280
|
},
|
|
281
|
-
get: (
|
|
282
|
-
create: (
|
|
283
|
-
save: (
|
|
284
|
-
discard: (
|
|
285
|
-
versions: (
|
|
286
|
-
restoreVersion: (
|
|
287
|
-
tags: (
|
|
288
|
-
const
|
|
289
|
-
return
|
|
281
|
+
get: (a) => v.http.get(`${c}/${a}`).then(g),
|
|
282
|
+
create: (a) => v.http.post(c, a).then(g),
|
|
283
|
+
save: (a, s) => v.http.put(`${c}/${a}`, s).then(g),
|
|
284
|
+
discard: (a) => v.http.post(`${c}/${a}/discard`, {}).then(g),
|
|
285
|
+
versions: (a) => v.http.get(`${c}/${a}/versions`).then(g),
|
|
286
|
+
restoreVersion: (a, s) => v.http.post(`${c}/${a}/versions/${s}/restore`, {}).then(g),
|
|
287
|
+
tags: (a = "") => {
|
|
288
|
+
const s = a.trim() === "" ? "" : `?q=${encodeURIComponent(a.trim())}`;
|
|
289
|
+
return v.http.get(`${p}${s}`).then(g);
|
|
290
290
|
},
|
|
291
|
-
createTag: (
|
|
292
|
-
publish: (
|
|
293
|
-
unpublish: (
|
|
294
|
-
remove: (
|
|
291
|
+
createTag: (a) => v.http.post(p, a).then(g),
|
|
292
|
+
publish: (a, s) => v.http.post(`${c}/${a}/publish`, s == null ? {} : { at: s }).then(g),
|
|
293
|
+
unpublish: (a) => v.http.post(`${c}/${a}/unpublish`, {}).then(g),
|
|
294
|
+
remove: (a) => v.http.delete(`${c}/${a}`).then(() => {
|
|
295
295
|
}),
|
|
296
|
-
restore: (
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
sortRubrics: (l) => g.http.post(`${c}/reorder`, { ids: l }).then(() => {
|
|
303
|
-
}),
|
|
304
|
-
tagsPage: (l = {}) => {
|
|
305
|
-
const t = new URLSearchParams();
|
|
306
|
-
l.q && t.set("q", l.q), l.empty && t.set("empty", "1"), l.noindex && t.set("noindex", "1"), l.sort && t.set("sort", l.sort), l.page && l.page > 1 && t.set("page", String(l.page)), l.per_page && t.set("per_page", String(l.per_page));
|
|
307
|
-
const u = t.size > 0 ? `?${t}` : "";
|
|
308
|
-
return g.http.get(`${w}${u}`).then((a) => ({ ...a.meta, data: a.data, filters: a.filters }));
|
|
296
|
+
restore: (a) => v.http.post(`${c}/${a}/restore`, {}).then(g),
|
|
297
|
+
tagsPage: (a = {}) => {
|
|
298
|
+
const s = new URLSearchParams();
|
|
299
|
+
a.q && s.set("q", a.q), a.empty && s.set("empty", "1"), a.noindex && s.set("noindex", "1"), a.sort && s.set("sort", a.sort), a.page && a.page > 1 && s.set("page", String(a.page)), a.per_page && s.set("per_page", String(a.per_page));
|
|
300
|
+
const t = s.size > 0 ? `?${s}` : "";
|
|
301
|
+
return v.http.get(`${p}${t}`).then((o) => ({ ...o.meta, data: o.data, filters: o.filters }));
|
|
309
302
|
},
|
|
310
|
-
saveTag: (
|
|
311
|
-
removeTag: (
|
|
303
|
+
saveTag: (a, s) => v.http.put(`${p}/${a}`, s).then(g),
|
|
304
|
+
removeTag: (a) => v.http.delete(`${p}/${a}`).then(() => {
|
|
312
305
|
}),
|
|
313
|
-
massTags: (
|
|
314
|
-
mergeTags: (
|
|
306
|
+
massTags: (a, s) => v.http.post(`${p}/mass`, { ids: a, action: s }).then((t) => t.data.affected),
|
|
307
|
+
mergeTags: (a, s, t) => v.http.post(`${p}/merge`, { ids: a, keep: s, redirect: t }).then(g)
|
|
315
308
|
};
|
|
316
309
|
}
|
|
317
|
-
const
|
|
310
|
+
const Mt = { class: "wx-article-editor__screen" }, Ut = 1200, Nt = /* @__PURE__ */ Q({
|
|
318
311
|
__name: "ArticleEditorPage",
|
|
319
312
|
props: {
|
|
320
313
|
base: { default: "/blog" }
|
|
321
314
|
},
|
|
322
|
-
setup(
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
const
|
|
326
|
-
const
|
|
327
|
-
return
|
|
328
|
-
}),
|
|
329
|
-
const
|
|
330
|
-
return typeof
|
|
331
|
-
}),
|
|
332
|
-
if (
|
|
333
|
-
const
|
|
334
|
-
return !Number.isNaN(
|
|
335
|
-
}),
|
|
336
|
-
const
|
|
337
|
-
if (!
|
|
338
|
-
const
|
|
315
|
+
setup(v) {
|
|
316
|
+
const c = v, p = le(), g = re(p), a = He(), s = Ge(), t = tt(), o = rt();
|
|
317
|
+
X();
|
|
318
|
+
const l = J("webx-blog"), y = be(), f = h(() => Number(a.params.id)), $ = h(() => `${c.base}/articles`), m = M(null), A = M({}), z = M(""), S = M(""), B = M(null), R = M({ rubrics: [], authors: [] }), w = M([]), W = M(!0), U = M(!1), N = M(!1), k = M({}), P = M(null), E = M(""), ie = M(0), Y = h(() => p.can("blog.articles.manage")), ne = h(() => !Y.value || N.value), ge = h(() => JSON.stringify(A.value)), F = h(() => E.value !== "" && ge.value !== E.value), he = h(() => U.value ? "saving" : F.value ? "unsaved" : "saved"), ye = h(() => {
|
|
319
|
+
const b = A.value.title;
|
|
320
|
+
return bt(b, t.active.value, m.value?.title ?? "");
|
|
321
|
+
}), se = h(() => {
|
|
322
|
+
const b = A.value.published_at;
|
|
323
|
+
return typeof b == "string" && b !== "" ? b : null;
|
|
324
|
+
}), fe = h(() => {
|
|
325
|
+
if (se.value === null) return !1;
|
|
326
|
+
const b = new Date(se.value.replace(" ", "T"));
|
|
327
|
+
return !Number.isNaN(b.valueOf()) && b.valueOf() > Date.now();
|
|
328
|
+
}), Se = h(() => {
|
|
329
|
+
const b = m.value;
|
|
330
|
+
if (!b) return "";
|
|
331
|
+
const j = o.short(b.published_at);
|
|
339
332
|
return {
|
|
340
|
-
scheduled:
|
|
341
|
-
published:
|
|
342
|
-
modified:
|
|
343
|
-
}[
|
|
333
|
+
scheduled: l("article.live-scheduled", { date: j }),
|
|
334
|
+
published: l("article.live-since", { date: j }),
|
|
335
|
+
modified: l("article.live-since", { date: j })
|
|
336
|
+
}[b.status] ?? "";
|
|
344
337
|
});
|
|
345
|
-
|
|
346
|
-
article:
|
|
347
|
-
values:
|
|
348
|
-
options:
|
|
349
|
-
related:
|
|
350
|
-
prefix:
|
|
351
|
-
base:
|
|
352
|
-
canManage:
|
|
353
|
-
disabled:
|
|
354
|
-
reload: () =>
|
|
355
|
-
save: () =>
|
|
338
|
+
Wt({ url: h(() => B.value), reload: ie }), Ct({
|
|
339
|
+
article: m,
|
|
340
|
+
values: A,
|
|
341
|
+
options: R,
|
|
342
|
+
related: w,
|
|
343
|
+
prefix: S,
|
|
344
|
+
base: c.base,
|
|
345
|
+
canManage: Y.value,
|
|
346
|
+
disabled: ne,
|
|
347
|
+
reload: () => oe(!0),
|
|
348
|
+
save: () => T()
|
|
356
349
|
});
|
|
357
|
-
function
|
|
358
|
-
|
|
350
|
+
function we(b) {
|
|
351
|
+
m.value = b.article, A.value = b.values, z.value = b.revision, S.value = b.prefix, B.value = b.preview_url, R.value = b.options, w.value = b.related, E.value = JSON.stringify(b.values), P.value = null;
|
|
359
352
|
}
|
|
360
|
-
async function
|
|
361
|
-
|
|
353
|
+
async function oe(b = !1) {
|
|
354
|
+
b || (W.value = !0);
|
|
362
355
|
try {
|
|
363
|
-
|
|
364
|
-
} catch (
|
|
365
|
-
|
|
356
|
+
we(await g.get(f.value));
|
|
357
|
+
} catch (j) {
|
|
358
|
+
D.danger(y(j)), s.push($.value);
|
|
366
359
|
} finally {
|
|
367
|
-
|
|
360
|
+
W.value = !1;
|
|
368
361
|
}
|
|
369
362
|
}
|
|
370
|
-
let
|
|
371
|
-
function
|
|
372
|
-
!
|
|
373
|
-
|
|
374
|
-
},
|
|
363
|
+
let ee;
|
|
364
|
+
function ue() {
|
|
365
|
+
!Y.value || P.value || !F.value || (clearTimeout(ee), ee = setTimeout(() => {
|
|
366
|
+
T();
|
|
367
|
+
}, Ut));
|
|
375
368
|
}
|
|
376
|
-
function
|
|
377
|
-
!
|
|
369
|
+
function u() {
|
|
370
|
+
!Y.value || P.value || !F.value || U.value || (clearTimeout(ee), T());
|
|
378
371
|
}
|
|
379
|
-
async function
|
|
380
|
-
if (!
|
|
381
|
-
clearTimeout(
|
|
382
|
-
const
|
|
383
|
-
|
|
372
|
+
async function T() {
|
|
373
|
+
if (!m.value || U.value || !Y.value) return;
|
|
374
|
+
clearTimeout(ee);
|
|
375
|
+
const b = ge.value, j = A.value;
|
|
376
|
+
U.value = !0, k.value = {};
|
|
384
377
|
try {
|
|
385
|
-
const
|
|
386
|
-
|
|
387
|
-
} catch (
|
|
388
|
-
const
|
|
389
|
-
|
|
378
|
+
const Z = await g.save(m.value.id, { values: j, revision: z.value });
|
|
379
|
+
m.value = Z.article, z.value = Z.revision, S.value = Z.prefix, B.value = Z.preview_url, R.value = Z.options, w.value = Z.related, P.value = null, ge.value === b && (E.value = b), ie.value += 1;
|
|
380
|
+
} catch (Z) {
|
|
381
|
+
const $e = Z;
|
|
382
|
+
$e.status === 409 && $e.body?.data ? P.value = $e.body : $e.body?.errors ? (k.value = $e.body.errors, D.danger(l("article.save-failed"))) : D.danger(y(Z));
|
|
390
383
|
} finally {
|
|
391
|
-
|
|
384
|
+
U.value = !1;
|
|
392
385
|
}
|
|
393
386
|
}
|
|
394
|
-
async function
|
|
395
|
-
await
|
|
396
|
-
title:
|
|
397
|
-
message:
|
|
398
|
-
confirmText:
|
|
399
|
-
cancelText:
|
|
387
|
+
async function C() {
|
|
388
|
+
await ce({
|
|
389
|
+
title: l("article.conflict-theirs-title"),
|
|
390
|
+
message: l("article.conflict-theirs-text"),
|
|
391
|
+
confirmText: l("article.conflict-theirs"),
|
|
392
|
+
cancelText: l("panel.cancel"),
|
|
400
393
|
tone: "danger"
|
|
401
|
-
}) && await
|
|
402
|
-
}
|
|
403
|
-
async function
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
}
|
|
407
|
-
async function
|
|
408
|
-
if (!(!
|
|
409
|
-
title:
|
|
410
|
-
message:
|
|
411
|
-
confirmText:
|
|
412
|
-
cancelText:
|
|
394
|
+
}) && await oe(!0);
|
|
395
|
+
}
|
|
396
|
+
async function G() {
|
|
397
|
+
const b = P.value;
|
|
398
|
+
b && (z.value = b.data.revision, P.value = null, await T());
|
|
399
|
+
}
|
|
400
|
+
async function me() {
|
|
401
|
+
if (!(!m.value || !await ce({
|
|
402
|
+
title: l("article.discard-title"),
|
|
403
|
+
message: l("article.discard-text"),
|
|
404
|
+
confirmText: l("article.discard"),
|
|
405
|
+
cancelText: l("panel.cancel"),
|
|
413
406
|
tone: "danger"
|
|
414
407
|
}))) {
|
|
415
408
|
N.value = !0;
|
|
416
409
|
try {
|
|
417
|
-
|
|
418
|
-
} catch (
|
|
419
|
-
|
|
410
|
+
we(await g.discard(m.value.id)), D.success(l("article.discarded"));
|
|
411
|
+
} catch (j) {
|
|
412
|
+
D.danger(y(j));
|
|
420
413
|
} finally {
|
|
421
414
|
N.value = !1;
|
|
422
415
|
}
|
|
423
416
|
}
|
|
424
417
|
}
|
|
425
|
-
async function
|
|
426
|
-
const
|
|
427
|
-
if (!
|
|
428
|
-
const
|
|
429
|
-
if (await
|
|
430
|
-
title:
|
|
431
|
-
message:
|
|
432
|
-
confirmText:
|
|
433
|
-
cancelText:
|
|
434
|
-
}) && (
|
|
418
|
+
async function n() {
|
|
419
|
+
const b = m.value;
|
|
420
|
+
if (!b) return;
|
|
421
|
+
const j = b.path === null ? null : `/${b.path}`, Z = se.value === null ? l("article.publish-now") : o.short(se.value);
|
|
422
|
+
if (await ce({
|
|
423
|
+
title: l("article.publish-title", { title: b.title }),
|
|
424
|
+
message: fe.value ? l("article.publish-later", { date: Z }) : j === null ? l("article.publish-nowhere") : l("article.publish-text", { address: j }),
|
|
425
|
+
confirmText: fe.value ? l("article.schedule") : l("panel.publish"),
|
|
426
|
+
cancelText: l("panel.cancel")
|
|
427
|
+
}) && (F.value && await T(), !P.value)) {
|
|
435
428
|
N.value = !0;
|
|
436
429
|
try {
|
|
437
|
-
await
|
|
438
|
-
} catch (
|
|
439
|
-
|
|
430
|
+
await g.publish(b.id, se.value), await oe(!0), D.success(fe.value ? l("article.scheduled") : l("panel.published"));
|
|
431
|
+
} catch (st) {
|
|
432
|
+
D.danger(y(st));
|
|
440
433
|
} finally {
|
|
441
434
|
N.value = !1;
|
|
442
435
|
}
|
|
443
436
|
}
|
|
444
437
|
}
|
|
445
|
-
function
|
|
446
|
-
const
|
|
447
|
-
return
|
|
448
|
-
}
|
|
449
|
-
function
|
|
450
|
-
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}),
|
|
455
|
-
|
|
456
|
-
}),
|
|
457
|
-
clearTimeout(
|
|
458
|
-
}),
|
|
459
|
-
title:
|
|
460
|
-
message:
|
|
461
|
-
confirmText:
|
|
462
|
-
cancelText:
|
|
438
|
+
function q() {
|
|
439
|
+
const b = m.value?.status;
|
|
440
|
+
return b === "published" ? "success" : b === "modified" ? "warning" : b === "scheduled" ? "primary" : "default";
|
|
441
|
+
}
|
|
442
|
+
function d(b) {
|
|
443
|
+
F.value && b.preventDefault();
|
|
444
|
+
}
|
|
445
|
+
pe(ge, ue), pe(f, () => {
|
|
446
|
+
oe();
|
|
447
|
+
}), Ue(() => {
|
|
448
|
+
oe(), window.addEventListener("beforeunload", d);
|
|
449
|
+
}), Fe(() => {
|
|
450
|
+
clearTimeout(ee), window.removeEventListener("beforeunload", d);
|
|
451
|
+
}), St(async () => !F.value || !Y.value || (await T(), !F.value) ? !0 : await ce({
|
|
452
|
+
title: l("article.leave-title"),
|
|
453
|
+
message: l("article.leave-text"),
|
|
454
|
+
confirmText: l("article.leave"),
|
|
455
|
+
cancelText: l("panel.cancel"),
|
|
463
456
|
tone: "danger"
|
|
464
457
|
}));
|
|
465
|
-
const
|
|
466
|
-
const
|
|
467
|
-
return
|
|
458
|
+
const xe = h(() => {
|
|
459
|
+
const b = [];
|
|
460
|
+
return B.value && b.push({ key: "preview", label: l("article.preview"), icon: "eye", href: B.value }), m.value?.url && m.value.status !== "draft" && b.push({
|
|
468
461
|
key: "site",
|
|
469
|
-
label:
|
|
462
|
+
label: l("panel.open-on-site"),
|
|
470
463
|
icon: "link",
|
|
471
|
-
href:
|
|
472
|
-
}),
|
|
464
|
+
href: m.value.url
|
|
465
|
+
}), m.value?.status === "modified" && b.push({
|
|
473
466
|
key: "discard",
|
|
474
|
-
label:
|
|
467
|
+
label: l("article.discard"),
|
|
475
468
|
icon: "refresh",
|
|
476
469
|
danger: !0,
|
|
477
470
|
menu: !0,
|
|
478
471
|
run: () => {
|
|
479
|
-
|
|
472
|
+
me();
|
|
480
473
|
}
|
|
481
|
-
}),
|
|
474
|
+
}), b;
|
|
482
475
|
});
|
|
483
|
-
return (
|
|
476
|
+
return (b, j) => (x(), K("div", {
|
|
484
477
|
class: "wx-article-editor",
|
|
485
|
-
onFocusout:
|
|
478
|
+
onFocusout: u
|
|
486
479
|
}, [
|
|
487
|
-
|
|
488
|
-
|
|
480
|
+
W.value || !m.value ? (x(), K(ke, { key: 0 }, [
|
|
481
|
+
r(e(Ee), {
|
|
489
482
|
class: "wx-article-editor__ghost",
|
|
490
483
|
title: "",
|
|
491
484
|
rows: 1
|
|
492
485
|
}),
|
|
493
|
-
|
|
486
|
+
r(e(yt), null, {
|
|
494
487
|
default: i(() => [
|
|
495
|
-
|
|
488
|
+
r(e(Ee), { rows: 8 })
|
|
496
489
|
]),
|
|
497
490
|
_: 1
|
|
498
491
|
})
|
|
499
|
-
], 64)) : (
|
|
500
|
-
|
|
492
|
+
], 64)) : (x(), K(ke, { key: 1 }, [
|
|
493
|
+
r(e(ot), {
|
|
501
494
|
divider: "",
|
|
502
|
-
back:
|
|
503
|
-
"back-label": e(
|
|
504
|
-
title:
|
|
505
|
-
subtitle:
|
|
506
|
-
actions:
|
|
495
|
+
back: $.value,
|
|
496
|
+
"back-label": e(l)("module.articles"),
|
|
497
|
+
title: ye.value || e(l)("article.untitled"),
|
|
498
|
+
subtitle: Se.value,
|
|
499
|
+
actions: xe.value
|
|
507
500
|
}, {
|
|
508
501
|
trail: i(() => [
|
|
509
|
-
|
|
502
|
+
r(e(wt), {
|
|
510
503
|
size: "sm",
|
|
511
|
-
label: e(
|
|
504
|
+
label: e(l)("article.trail")
|
|
512
505
|
}, {
|
|
513
506
|
default: i(() => [
|
|
514
|
-
|
|
507
|
+
r(e(Je), {
|
|
515
508
|
as: "router-link",
|
|
516
|
-
to:
|
|
509
|
+
to: $.value
|
|
517
510
|
}, {
|
|
518
511
|
default: i(() => [
|
|
519
|
-
|
|
512
|
+
V(_(e(l)("module.articles")), 1)
|
|
520
513
|
]),
|
|
521
514
|
_: 1
|
|
522
515
|
}, 8, ["to"]),
|
|
523
|
-
|
|
516
|
+
r(e(Je), { current: "" }, {
|
|
524
517
|
default: i(() => [
|
|
525
|
-
|
|
518
|
+
V(_(ye.value || e(l)("article.untitled")), 1)
|
|
526
519
|
]),
|
|
527
520
|
_: 1
|
|
528
521
|
})
|
|
@@ -531,652 +524,573 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
531
524
|
}, 8, ["label"])
|
|
532
525
|
]),
|
|
533
526
|
"title-after": i(() => [
|
|
534
|
-
|
|
535
|
-
type:
|
|
527
|
+
r(e(ae), {
|
|
528
|
+
type: q(),
|
|
536
529
|
dot: ""
|
|
537
530
|
}, {
|
|
538
531
|
default: i(() => [
|
|
539
|
-
|
|
532
|
+
V(_(e(l)(`panel.status-${m.value.status}`)), 1)
|
|
540
533
|
]),
|
|
541
534
|
_: 1
|
|
542
535
|
}, 8, ["type"]),
|
|
543
|
-
|
|
536
|
+
m.value.status === "modified" ? (x(), I(e(ae), {
|
|
544
537
|
key: 0,
|
|
545
538
|
type: "primary",
|
|
546
539
|
round: ""
|
|
547
540
|
}, {
|
|
548
541
|
default: i(() => [
|
|
549
|
-
|
|
542
|
+
V(_(e(l)("panel.edits")), 1)
|
|
550
543
|
]),
|
|
551
544
|
_: 1
|
|
552
|
-
})) :
|
|
545
|
+
})) : L("", !0)
|
|
553
546
|
]),
|
|
554
547
|
_: 1
|
|
555
548
|
}, 8, ["back", "back-label", "title", "subtitle", "actions"]),
|
|
556
|
-
|
|
549
|
+
P.value ? (x(), I(e(Me), {
|
|
557
550
|
key: 0,
|
|
558
551
|
type: "warning",
|
|
559
|
-
title: e(
|
|
560
|
-
description:
|
|
552
|
+
title: e(l)("article.conflict-title"),
|
|
553
|
+
description: P.value.message
|
|
561
554
|
}, {
|
|
562
555
|
actions: i(() => [
|
|
563
|
-
|
|
556
|
+
r(e(H), {
|
|
564
557
|
size: "sm",
|
|
565
558
|
variant: "outline",
|
|
566
|
-
onClick:
|
|
559
|
+
onClick: C
|
|
567
560
|
}, {
|
|
568
561
|
default: i(() => [
|
|
569
|
-
|
|
562
|
+
V(_(e(l)("article.conflict-theirs")), 1)
|
|
570
563
|
]),
|
|
571
564
|
_: 1
|
|
572
565
|
}),
|
|
573
|
-
|
|
566
|
+
r(e(H), {
|
|
574
567
|
size: "sm",
|
|
575
568
|
type: "primary",
|
|
576
|
-
onClick:
|
|
569
|
+
onClick: G
|
|
577
570
|
}, {
|
|
578
571
|
default: i(() => [
|
|
579
|
-
|
|
572
|
+
V(_(e(l)("article.conflict-mine")), 1)
|
|
580
573
|
]),
|
|
581
574
|
_: 1
|
|
582
575
|
})
|
|
583
576
|
]),
|
|
584
577
|
_: 1
|
|
585
|
-
}, 8, ["title", "description"])) :
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
modelValue:
|
|
589
|
-
"onUpdate:modelValue":
|
|
578
|
+
}, 8, ["title", "description"])) : L("", !0),
|
|
579
|
+
O("div", Mt, [
|
|
580
|
+
r(e(ut), {
|
|
581
|
+
modelValue: A.value,
|
|
582
|
+
"onUpdate:modelValue": j[0] || (j[0] = (Z) => A.value = Z),
|
|
590
583
|
name: "blog.article-form",
|
|
591
|
-
errors:
|
|
592
|
-
disabled:
|
|
584
|
+
errors: k.value,
|
|
585
|
+
disabled: ne.value
|
|
593
586
|
}, null, 8, ["modelValue", "errors", "disabled"])
|
|
594
587
|
]),
|
|
595
|
-
|
|
588
|
+
Y.value ? (x(), I(e(at), { key: 1 }, {
|
|
596
589
|
state: i(() => [
|
|
597
|
-
|
|
590
|
+
r(e(ct), { state: he.value }, null, 8, ["state"])
|
|
598
591
|
]),
|
|
599
592
|
default: i(() => [
|
|
600
|
-
|
|
593
|
+
r(e(H), {
|
|
601
594
|
variant: "outline",
|
|
602
|
-
loading:
|
|
603
|
-
disabled: !
|
|
604
|
-
onClick:
|
|
595
|
+
loading: U.value,
|
|
596
|
+
disabled: !F.value,
|
|
597
|
+
onClick: T
|
|
605
598
|
}, {
|
|
606
599
|
default: i(() => [
|
|
607
|
-
|
|
600
|
+
V(_(e(l)("article.save")), 1)
|
|
608
601
|
]),
|
|
609
602
|
_: 1
|
|
610
603
|
}, 8, ["loading", "disabled"]),
|
|
611
|
-
|
|
604
|
+
r(e(H), {
|
|
612
605
|
type: "primary",
|
|
613
606
|
loading: N.value,
|
|
614
|
-
disabled:
|
|
615
|
-
onClick:
|
|
607
|
+
disabled: m.value.status === "published" && !F.value,
|
|
608
|
+
onClick: n
|
|
616
609
|
}, {
|
|
617
610
|
default: i(() => [
|
|
618
|
-
|
|
611
|
+
V(_(fe.value ? e(l)("article.schedule") : e(l)("panel.publish")), 1)
|
|
619
612
|
]),
|
|
620
613
|
_: 1
|
|
621
614
|
}, 8, ["loading", "disabled"])
|
|
622
615
|
]),
|
|
623
616
|
_: 1
|
|
624
|
-
})) :
|
|
617
|
+
})) : L("", !0)
|
|
625
618
|
], 64))
|
|
626
619
|
], 32));
|
|
627
620
|
}
|
|
628
|
-
}),
|
|
629
|
-
const
|
|
630
|
-
for (const [
|
|
631
|
-
|
|
632
|
-
return
|
|
633
|
-
},
|
|
621
|
+
}), ve = (v, c) => {
|
|
622
|
+
const p = v.__vccOpts || v;
|
|
623
|
+
for (const [g, a] of c)
|
|
624
|
+
p[g] = a;
|
|
625
|
+
return p;
|
|
626
|
+
}, qt = /* @__PURE__ */ ve(Nt, [["__scopeId", "data-v-d3973be7"]]), It = { class: "wx-article-history" }, Pt = { class: "wx-article-history__number" }, Rt = { class: "wx-article-history__who" }, Dt = /* @__PURE__ */ Q({
|
|
634
627
|
name: "WxArticleHistory",
|
|
635
628
|
__name: "ArticleHistory",
|
|
636
|
-
setup(
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
const
|
|
640
|
-
() =>
|
|
629
|
+
setup(v) {
|
|
630
|
+
const c = le(), p = re(c), g = Ae();
|
|
631
|
+
X();
|
|
632
|
+
const a = J("webx-blog"), s = be(), t = M(null), o = M(!1), l = h(() => g?.article.value ?? null), y = h(() => c.can("blog.articles.manage")), f = h(
|
|
633
|
+
() => l.value?.status === "published" || l.value?.status === "modified" ? t.value?.[0]?.number ?? null : null
|
|
641
634
|
);
|
|
642
|
-
async function
|
|
643
|
-
const
|
|
644
|
-
if (
|
|
635
|
+
async function $() {
|
|
636
|
+
const A = l.value;
|
|
637
|
+
if (A)
|
|
645
638
|
try {
|
|
646
|
-
t.value = await
|
|
647
|
-
} catch (
|
|
648
|
-
t.value = [],
|
|
639
|
+
t.value = await p.versions(A.id);
|
|
640
|
+
} catch (z) {
|
|
641
|
+
t.value = [], D.danger(s(z));
|
|
649
642
|
}
|
|
650
643
|
}
|
|
651
|
-
async function
|
|
652
|
-
const
|
|
653
|
-
if (!(!
|
|
654
|
-
title:
|
|
655
|
-
message:
|
|
656
|
-
confirmText:
|
|
657
|
-
cancelText:
|
|
644
|
+
async function m(A) {
|
|
645
|
+
const z = l.value;
|
|
646
|
+
if (!(!z || !await ce({
|
|
647
|
+
title: a("article.restore-title", { number: A.number }),
|
|
648
|
+
message: a("article.restore-text"),
|
|
649
|
+
confirmText: a("article.restore-version"),
|
|
650
|
+
cancelText: a("panel.cancel")
|
|
658
651
|
}))) {
|
|
659
|
-
|
|
652
|
+
o.value = !0;
|
|
660
653
|
try {
|
|
661
|
-
await
|
|
662
|
-
} catch (
|
|
663
|
-
|
|
654
|
+
await p.restoreVersion(z.id, A.number), await g?.reload(), D.success(a("article.restored-version", { number: A.number }));
|
|
655
|
+
} catch (B) {
|
|
656
|
+
D.danger(s(B));
|
|
664
657
|
} finally {
|
|
665
|
-
|
|
658
|
+
o.value = !1;
|
|
666
659
|
}
|
|
667
660
|
}
|
|
668
661
|
}
|
|
669
|
-
return
|
|
670
|
-
() => [
|
|
662
|
+
return pe(
|
|
663
|
+
() => [l.value?.id, l.value?.published_at, l.value?.updated_at],
|
|
671
664
|
() => {
|
|
672
|
-
|
|
665
|
+
$();
|
|
673
666
|
},
|
|
674
667
|
{ immediate: !0 }
|
|
675
|
-
), (
|
|
676
|
-
t.value === null ? (
|
|
668
|
+
), (A, z) => (x(), K("div", It, [
|
|
669
|
+
t.value === null ? (x(), I(e(Ee), {
|
|
677
670
|
key: 0,
|
|
678
671
|
class: "wx-article-history__ghost",
|
|
679
672
|
rows: 3
|
|
680
|
-
})) : t.value.length === 0 ? (
|
|
673
|
+
})) : t.value.length === 0 ? (x(), I(e(xt), {
|
|
681
674
|
key: 1,
|
|
682
|
-
description: e(
|
|
683
|
-
}, null, 8, ["description"])) : (
|
|
684
|
-
key:
|
|
685
|
-
class:
|
|
675
|
+
description: e(a)("article.history-empty")
|
|
676
|
+
}, null, 8, ["description"])) : (x(!0), K(ke, { key: 2 }, Ne(t.value, (S) => (x(), K("div", {
|
|
677
|
+
key: S.number,
|
|
678
|
+
class: et(["wx-article-history__row", { "is-live": S.number === f.value }])
|
|
686
679
|
}, [
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
680
|
+
O("code", Pt, _(e(a)("article.version", { number: S.number })), 1),
|
|
681
|
+
O("div", Rt, [
|
|
682
|
+
S.created_at ? (x(), I(e(Be), {
|
|
690
683
|
key: 0,
|
|
691
|
-
value:
|
|
684
|
+
value: S.created_at,
|
|
692
685
|
size: "md",
|
|
693
686
|
tone: "default"
|
|
694
|
-
}, null, 8, ["value"])) :
|
|
695
|
-
|
|
687
|
+
}, null, 8, ["value"])) : L("", !0),
|
|
688
|
+
r(e(te), {
|
|
696
689
|
size: "sm",
|
|
697
690
|
tone: "muted"
|
|
698
691
|
}, {
|
|
699
692
|
default: i(() => [
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
], 64)) :
|
|
693
|
+
V(_(S.author ?? e(a)(`article.source-${S.source}`)) + " ", 1),
|
|
694
|
+
S.comment ? (x(), K(ke, { key: 0 }, [
|
|
695
|
+
V(" · " + _(S.comment), 1)
|
|
696
|
+
], 64)) : L("", !0)
|
|
704
697
|
]),
|
|
705
698
|
_: 2
|
|
706
699
|
}, 1024)
|
|
707
700
|
]),
|
|
708
|
-
|
|
701
|
+
S.number === f.value ? (x(), I(e(ae), {
|
|
709
702
|
key: 0,
|
|
710
703
|
type: "success",
|
|
711
704
|
dot: ""
|
|
712
705
|
}, {
|
|
713
706
|
default: i(() => [
|
|
714
|
-
|
|
707
|
+
V(_(e(a)("article.version-live")), 1)
|
|
715
708
|
]),
|
|
716
709
|
_: 1
|
|
717
|
-
})) :
|
|
718
|
-
|
|
710
|
+
})) : L("", !0),
|
|
711
|
+
y.value && S.number !== f.value ? (x(), I(e(H), {
|
|
719
712
|
key: 1,
|
|
720
713
|
size: "sm",
|
|
721
714
|
variant: "outline",
|
|
722
|
-
loading:
|
|
723
|
-
onClick: (
|
|
715
|
+
loading: o.value,
|
|
716
|
+
onClick: (B) => m(S)
|
|
724
717
|
}, {
|
|
725
718
|
default: i(() => [
|
|
726
|
-
|
|
719
|
+
V(_(e(a)("article.restore-version")), 1)
|
|
727
720
|
]),
|
|
728
721
|
_: 1
|
|
729
|
-
}, 8, ["loading", "onClick"])) :
|
|
722
|
+
}, 8, ["loading", "onClick"])) : L("", !0)
|
|
730
723
|
], 2))), 128))
|
|
731
724
|
]));
|
|
732
725
|
}
|
|
733
|
-
}),
|
|
726
|
+
}), Bt = /* @__PURE__ */ ve(Dt, [["__scopeId", "data-v-0a997938"]]), Et = { class: "wx-article-related" }, Ot = { class: "wx-article-related__name" }, Lt = 250, Ft = 10, Kt = /* @__PURE__ */ Q({
|
|
734
727
|
name: "WxArticleRelated",
|
|
735
728
|
__name: "ArticleRelated",
|
|
736
|
-
props: /* @__PURE__ */
|
|
729
|
+
props: /* @__PURE__ */ Le({
|
|
737
730
|
disabled: { type: Boolean, default: !1 }
|
|
738
731
|
}, {
|
|
739
732
|
modelValue: { default: () => [] },
|
|
740
733
|
modelModifiers: {}
|
|
741
734
|
}),
|
|
742
735
|
emits: ["update:modelValue"],
|
|
743
|
-
setup(
|
|
744
|
-
const
|
|
745
|
-
|
|
746
|
-
const t =
|
|
747
|
-
let
|
|
748
|
-
|
|
749
|
-
() =>
|
|
750
|
-
(
|
|
751
|
-
const
|
|
752
|
-
for (const
|
|
753
|
-
|
|
736
|
+
setup(v) {
|
|
737
|
+
const c = v, p = Oe(v, "modelValue"), g = le(), a = re(g), s = Ae();
|
|
738
|
+
X();
|
|
739
|
+
const t = J("webx-blog"), o = be(), l = h(() => c.disabled || s?.disabled.value === !0), y = M(/* @__PURE__ */ new Map()), f = M([]);
|
|
740
|
+
let $;
|
|
741
|
+
pe(
|
|
742
|
+
() => s?.related.value,
|
|
743
|
+
(w) => {
|
|
744
|
+
const W = new Map(y.value);
|
|
745
|
+
for (const U of w ?? []) W.set(U.id, U.title);
|
|
746
|
+
y.value = W;
|
|
754
747
|
},
|
|
755
748
|
{ immediate: !0, deep: !0 }
|
|
756
749
|
);
|
|
757
|
-
const
|
|
758
|
-
get: () =>
|
|
759
|
-
set: (
|
|
760
|
-
|
|
750
|
+
const m = h({
|
|
751
|
+
get: () => p.value.map((w) => ({ id: w, title: y.value.get(w) ?? `#${w}` })),
|
|
752
|
+
set: (w) => {
|
|
753
|
+
p.value = w.map((W) => W.id);
|
|
761
754
|
}
|
|
762
|
-
}),
|
|
763
|
-
() =>
|
|
755
|
+
}), A = h(
|
|
756
|
+
() => f.value.filter((w) => !p.value.includes(w.id)).map((w) => ({ label: w.title, value: w.id }))
|
|
764
757
|
);
|
|
765
|
-
async function
|
|
766
|
-
const
|
|
758
|
+
async function z(w) {
|
|
759
|
+
const W = s?.article.value?.id;
|
|
767
760
|
try {
|
|
768
|
-
const
|
|
769
|
-
|
|
770
|
-
const N = new Map(
|
|
771
|
-
for (const
|
|
772
|
-
|
|
773
|
-
} catch (
|
|
774
|
-
|
|
761
|
+
const U = await a.articles({ q: w, per_page: Ft });
|
|
762
|
+
f.value = U.data.filter((k) => k.id !== W).map((k) => ({ id: k.id, title: k.title }));
|
|
763
|
+
const N = new Map(y.value);
|
|
764
|
+
for (const k of f.value) N.set(k.id, k.title);
|
|
765
|
+
y.value = N;
|
|
766
|
+
} catch (U) {
|
|
767
|
+
D.danger(o(U));
|
|
775
768
|
}
|
|
776
769
|
}
|
|
777
|
-
function
|
|
778
|
-
clearTimeout(
|
|
779
|
-
|
|
780
|
-
},
|
|
770
|
+
function S(w) {
|
|
771
|
+
clearTimeout($), $ = setTimeout(() => {
|
|
772
|
+
z(w);
|
|
773
|
+
}, Lt);
|
|
781
774
|
}
|
|
782
|
-
function
|
|
783
|
-
typeof
|
|
775
|
+
function B(w) {
|
|
776
|
+
typeof w != "number" || p.value.includes(w) || (p.value = [...p.value, w]);
|
|
784
777
|
}
|
|
785
|
-
function
|
|
786
|
-
|
|
778
|
+
function R(w) {
|
|
779
|
+
p.value = p.value.filter((W) => W !== w);
|
|
787
780
|
}
|
|
788
|
-
return
|
|
789
|
-
() =>
|
|
781
|
+
return pe(
|
|
782
|
+
() => s?.article.value?.id,
|
|
790
783
|
() => {
|
|
791
|
-
|
|
784
|
+
z("");
|
|
792
785
|
},
|
|
793
786
|
{ immediate: !0 }
|
|
794
|
-
),
|
|
795
|
-
|
|
796
|
-
modelValue:
|
|
797
|
-
"onUpdate:modelValue":
|
|
787
|
+
), Fe(() => clearTimeout($)), (w, W) => (x(), K("div", Et, [
|
|
788
|
+
r(e(_t), {
|
|
789
|
+
modelValue: m.value,
|
|
790
|
+
"onUpdate:modelValue": W[0] || (W[0] = (U) => m.value = U),
|
|
798
791
|
plain: "",
|
|
799
792
|
size: "sm",
|
|
800
793
|
"item-key": "id",
|
|
801
794
|
"item-label": "title",
|
|
802
|
-
disabled:
|
|
795
|
+
disabled: l.value,
|
|
803
796
|
"empty-text": e(t)("article.related-empty"),
|
|
804
797
|
"aria-label": e(t)("article.related")
|
|
805
798
|
}, {
|
|
806
|
-
default: i(({ item:
|
|
807
|
-
|
|
799
|
+
default: i(({ item: U }) => [
|
|
800
|
+
O("span", Ot, _(U.title), 1)
|
|
808
801
|
]),
|
|
809
|
-
actions: i(({ item:
|
|
810
|
-
|
|
802
|
+
actions: i(({ item: U }) => [
|
|
803
|
+
r(e(kt), {
|
|
811
804
|
type: "remove",
|
|
812
805
|
size: "sm",
|
|
813
|
-
disabled:
|
|
806
|
+
disabled: l.value,
|
|
814
807
|
title: e(t)("article.related-remove"),
|
|
815
|
-
onClick: (N) =>
|
|
808
|
+
onClick: (N) => R(U.id)
|
|
816
809
|
}, null, 8, ["disabled", "title", "onClick"])
|
|
817
810
|
]),
|
|
818
811
|
_: 1
|
|
819
812
|
}, 8, ["modelValue", "disabled", "empty-text", "aria-label"]),
|
|
820
|
-
|
|
813
|
+
r(e(_e), {
|
|
821
814
|
"model-value": null,
|
|
822
|
-
options:
|
|
815
|
+
options: A.value,
|
|
823
816
|
placeholder: e(t)("article.related-add"),
|
|
824
817
|
"empty-text": e(t)("article.related-nothing"),
|
|
825
|
-
disabled:
|
|
818
|
+
disabled: l.value,
|
|
826
819
|
filterable: "",
|
|
827
820
|
teleport: "",
|
|
828
821
|
"aria-label": e(t)("article.related-add"),
|
|
829
|
-
onSearch:
|
|
830
|
-
"onUpdate:modelValue":
|
|
822
|
+
onSearch: S,
|
|
823
|
+
"onUpdate:modelValue": B
|
|
831
824
|
}, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"])
|
|
832
825
|
]));
|
|
833
826
|
}
|
|
834
|
-
}),
|
|
835
|
-
name: "WxArticleRubrics",
|
|
836
|
-
__name: "ArticleRubrics",
|
|
837
|
-
props: /* @__PURE__ */ Pe({
|
|
838
|
-
disabled: { type: Boolean, default: !1 }
|
|
839
|
-
}, {
|
|
840
|
-
modelValue: { default: () => [] },
|
|
841
|
-
modelModifiers: {}
|
|
842
|
-
}),
|
|
843
|
-
emits: ["update:modelValue"],
|
|
844
|
-
setup(g) {
|
|
845
|
-
const o = g, c = Ie(g, "modelValue"), w = Ae();
|
|
846
|
-
Y();
|
|
847
|
-
const n = Q("webx-blog"), l = p(() => o.disabled || w?.disabled.value === !0), t = p(() => {
|
|
848
|
-
const d = /* @__PURE__ */ new Map();
|
|
849
|
-
for (const f of w?.options.value.rubrics ?? []) d.set(f.id, f.title);
|
|
850
|
-
return d;
|
|
851
|
-
}), u = p({
|
|
852
|
-
get: () => c.value.map((d) => ({ id: d, title: t.value.get(d) ?? `#${d}` })),
|
|
853
|
-
set: (d) => {
|
|
854
|
-
c.value = d.map((f) => f.id);
|
|
855
|
-
}
|
|
856
|
-
}), a = p(
|
|
857
|
-
() => (w?.options.value.rubrics ?? []).filter((d) => !c.value.includes(d.id)).map((d) => ({ label: d.title, value: d.id }))
|
|
858
|
-
);
|
|
859
|
-
function x(d) {
|
|
860
|
-
typeof d != "number" || c.value.includes(d) || (c.value = [...c.value, d]);
|
|
861
|
-
}
|
|
862
|
-
function b(d) {
|
|
863
|
-
c.value = c.value.filter((f) => f !== d);
|
|
864
|
-
}
|
|
865
|
-
return (d, f) => (h(), G("div", Xt, [
|
|
866
|
-
s(e(Xe), {
|
|
867
|
-
modelValue: u.value,
|
|
868
|
-
"onUpdate:modelValue": f[0] || (f[0] = (v) => u.value = v),
|
|
869
|
-
plain: "",
|
|
870
|
-
size: "sm",
|
|
871
|
-
"item-key": "id",
|
|
872
|
-
"item-label": "title",
|
|
873
|
-
disabled: l.value,
|
|
874
|
-
"empty-text": e(n)("article.rubrics-empty"),
|
|
875
|
-
"aria-label": e(n)("article.rubrics")
|
|
876
|
-
}, {
|
|
877
|
-
default: i(({ item: v, index: S }) => [
|
|
878
|
-
H("span", Yt, T(v.title), 1),
|
|
879
|
-
S === 0 ? (h(), M(e(se), {
|
|
880
|
-
key: 0,
|
|
881
|
-
type: "primary"
|
|
882
|
-
}, {
|
|
883
|
-
default: i(() => [
|
|
884
|
-
z(T(e(n)("article.rubric-main")), 1)
|
|
885
|
-
]),
|
|
886
|
-
_: 1
|
|
887
|
-
})) : j("", !0)
|
|
888
|
-
]),
|
|
889
|
-
actions: i(({ item: v }) => [
|
|
890
|
-
s(e(ot), {
|
|
891
|
-
type: "remove",
|
|
892
|
-
size: "sm",
|
|
893
|
-
disabled: l.value,
|
|
894
|
-
title: e(n)("article.rubric-remove"),
|
|
895
|
-
onClick: (S) => b(v.id)
|
|
896
|
-
}, null, 8, ["disabled", "title", "onClick"])
|
|
897
|
-
]),
|
|
898
|
-
_: 1
|
|
899
|
-
}, 8, ["modelValue", "disabled", "empty-text", "aria-label"]),
|
|
900
|
-
s(e(ye), {
|
|
901
|
-
"model-value": null,
|
|
902
|
-
options: a.value,
|
|
903
|
-
placeholder: e(n)("article.rubric-add"),
|
|
904
|
-
disabled: l.value || a.value.length === 0,
|
|
905
|
-
"empty-text": e(n)("article.rubric-none-left"),
|
|
906
|
-
filterable: "",
|
|
907
|
-
teleport: "",
|
|
908
|
-
"aria-label": e(n)("article.rubric-add"),
|
|
909
|
-
"onUpdate:modelValue": x
|
|
910
|
-
}, null, 8, ["options", "placeholder", "disabled", "empty-text", "aria-label"])
|
|
911
|
-
]));
|
|
912
|
-
}
|
|
913
|
-
}), ta = /* @__PURE__ */ ce(ea, [["__scopeId", "data-v-76ca7a6f"]]), aa = { class: "wx-article-slug" }, la = { class: "wx-article-slug__prefix" }, ia = /* @__PURE__ */ X({
|
|
827
|
+
}), Ht = /* @__PURE__ */ ve(Kt, [["__scopeId", "data-v-164e86fe"]]), Gt = { class: "wx-article-slug" }, jt = { class: "wx-article-slug__prefix" }, Jt = /* @__PURE__ */ Q({
|
|
914
828
|
name: "WxArticleSlug",
|
|
915
829
|
inheritAttrs: !1,
|
|
916
830
|
__name: "ArticleSlug",
|
|
917
|
-
setup(
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
const
|
|
921
|
-
const
|
|
922
|
-
return
|
|
923
|
-
}),
|
|
924
|
-
const
|
|
925
|
-
return typeof
|
|
926
|
-
}), t =
|
|
927
|
-
const
|
|
928
|
-
return typeof
|
|
831
|
+
setup(v) {
|
|
832
|
+
const c = Ae(), p = tt();
|
|
833
|
+
X();
|
|
834
|
+
const g = J("webx-blog"), a = h(() => {
|
|
835
|
+
const o = c?.prefix.value ?? "";
|
|
836
|
+
return o === "" ? "/" : `/${o}/`;
|
|
837
|
+
}), s = h(() => {
|
|
838
|
+
const o = c?.values.value.slug;
|
|
839
|
+
return typeof o == "string" ? o : o?.[p.active.value] ?? "";
|
|
840
|
+
}), t = h(() => {
|
|
841
|
+
const o = c?.article.value?.path;
|
|
842
|
+
return typeof o == "string" && s.value !== "" && `${a.value}${s.value}` != `/${o}`;
|
|
929
843
|
});
|
|
930
|
-
return (
|
|
931
|
-
|
|
844
|
+
return (o, l) => (x(), K("div", Gt, [
|
|
845
|
+
r(e(We), ht(ft(o.$attrs)), {
|
|
932
846
|
prefix: i(() => [
|
|
933
|
-
|
|
847
|
+
O("span", jt, _(a.value), 1)
|
|
934
848
|
]),
|
|
935
849
|
_: 1
|
|
936
850
|
}, 16),
|
|
937
|
-
t.value ? (
|
|
851
|
+
t.value ? (x(), I(e(Me), {
|
|
938
852
|
key: 0,
|
|
939
853
|
type: "info",
|
|
940
854
|
variant: "soft",
|
|
941
|
-
description: e(
|
|
942
|
-
}, null, 8, ["description"])) :
|
|
855
|
+
description: e(g)("article.address-moving")
|
|
856
|
+
}, null, 8, ["description"])) : L("", !0)
|
|
943
857
|
]));
|
|
944
858
|
}
|
|
945
|
-
}),
|
|
859
|
+
}), Zt = /* @__PURE__ */ ve(Jt, [["__scopeId", "data-v-5da20e5e"]]), Qt = { class: "wx-article-tags" }, Xt = {
|
|
946
860
|
key: 0,
|
|
947
861
|
class: "wx-article-tags__chips"
|
|
948
|
-
},
|
|
862
|
+
}, Yt = { class: "wx-article-tags__pick" }, ea = 250, ta = /* @__PURE__ */ Q({
|
|
949
863
|
name: "WxArticleTags",
|
|
950
864
|
__name: "ArticleTags",
|
|
951
|
-
props: /* @__PURE__ */
|
|
865
|
+
props: /* @__PURE__ */ Le({
|
|
952
866
|
disabled: { type: Boolean, default: !1 }
|
|
953
867
|
}, {
|
|
954
868
|
modelValue: { default: () => [] },
|
|
955
869
|
modelModifiers: {}
|
|
956
870
|
}),
|
|
957
871
|
emits: ["update:modelValue"],
|
|
958
|
-
setup(
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
const t =
|
|
962
|
-
let
|
|
963
|
-
|
|
964
|
-
() =>
|
|
965
|
-
(
|
|
966
|
-
const
|
|
967
|
-
for (const
|
|
968
|
-
|
|
872
|
+
setup(v) {
|
|
873
|
+
const c = v, p = Oe(v, "modelValue"), g = le(), a = re(g), s = Ae();
|
|
874
|
+
X();
|
|
875
|
+
const t = J("webx-blog"), o = be(), l = h(() => c.disabled || s?.disabled.value === !0), y = M(/* @__PURE__ */ new Map()), f = M([]), $ = M(""), m = M(!1);
|
|
876
|
+
let A;
|
|
877
|
+
pe(
|
|
878
|
+
() => s?.article.value?.tags,
|
|
879
|
+
(k) => {
|
|
880
|
+
const P = new Map(y.value);
|
|
881
|
+
for (const E of k ?? []) P.set(E.id, E.title);
|
|
882
|
+
y.value = P;
|
|
969
883
|
},
|
|
970
884
|
{ immediate: !0, deep: !0 }
|
|
971
885
|
);
|
|
972
|
-
const
|
|
973
|
-
() =>
|
|
974
|
-
),
|
|
975
|
-
() =>
|
|
886
|
+
const z = h(
|
|
887
|
+
() => p.value.map((k) => ({ id: k, title: y.value.get(k) ?? `#${k}` }))
|
|
888
|
+
), S = h(
|
|
889
|
+
() => f.value.filter((k) => !p.value.includes(k.id)).map((k) => ({
|
|
976
890
|
// The count is part of the label rather than a column: a select draws a line of text, and
|
|
977
891
|
// the number is what the reader is choosing between two near-identical words on.
|
|
978
|
-
label: t("article.tag-option", { title:
|
|
979
|
-
value:
|
|
892
|
+
label: t("article.tag-option", { title: k.title, count: k.articles_count }),
|
|
893
|
+
value: k.id
|
|
980
894
|
}))
|
|
981
|
-
),
|
|
982
|
-
const
|
|
983
|
-
if (
|
|
984
|
-
const
|
|
985
|
-
return
|
|
895
|
+
), B = h(() => {
|
|
896
|
+
const k = $.value.trim();
|
|
897
|
+
if (k === "") return null;
|
|
898
|
+
const P = (E) => E.toLowerCase() === k.toLowerCase();
|
|
899
|
+
return f.value.some((E) => P(E.title)) ? null : k;
|
|
986
900
|
});
|
|
987
|
-
async function
|
|
901
|
+
async function R() {
|
|
988
902
|
try {
|
|
989
|
-
|
|
990
|
-
const
|
|
991
|
-
for (const
|
|
992
|
-
|
|
993
|
-
} catch (
|
|
994
|
-
|
|
903
|
+
f.value = await a.tags($.value);
|
|
904
|
+
const k = new Map(y.value);
|
|
905
|
+
for (const P of f.value) k.set(P.id, P.title);
|
|
906
|
+
y.value = k;
|
|
907
|
+
} catch (k) {
|
|
908
|
+
D.danger(o(k));
|
|
995
909
|
}
|
|
996
910
|
}
|
|
997
|
-
function
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
},
|
|
911
|
+
function w(k) {
|
|
912
|
+
$.value = k, clearTimeout(A), A = setTimeout(() => {
|
|
913
|
+
R();
|
|
914
|
+
}, ea);
|
|
1001
915
|
}
|
|
1002
|
-
function
|
|
1003
|
-
typeof
|
|
916
|
+
function W(k) {
|
|
917
|
+
typeof k != "number" || p.value.includes(k) || (p.value = [...p.value, k], $.value = "");
|
|
1004
918
|
}
|
|
1005
|
-
function
|
|
1006
|
-
|
|
919
|
+
function U(k) {
|
|
920
|
+
p.value = p.value.filter((P) => P !== k);
|
|
1007
921
|
}
|
|
1008
922
|
async function N() {
|
|
1009
|
-
const
|
|
1010
|
-
if (!(
|
|
1011
|
-
|
|
923
|
+
const k = B.value;
|
|
924
|
+
if (!(k === null || m.value)) {
|
|
925
|
+
m.value = !0;
|
|
1012
926
|
try {
|
|
1013
|
-
const
|
|
1014
|
-
|
|
1015
|
-
} catch (
|
|
1016
|
-
|
|
927
|
+
const P = await a.createTag({ title: k });
|
|
928
|
+
y.value = new Map(y.value).set(P.id, P.title), f.value = [P, ...f.value], W(P.id);
|
|
929
|
+
} catch (P) {
|
|
930
|
+
D.danger(o(P));
|
|
1017
931
|
} finally {
|
|
1018
|
-
|
|
932
|
+
m.value = !1;
|
|
1019
933
|
}
|
|
1020
934
|
}
|
|
1021
935
|
}
|
|
1022
|
-
return
|
|
1023
|
-
() =>
|
|
936
|
+
return pe(
|
|
937
|
+
() => s?.article.value?.id,
|
|
1024
938
|
() => {
|
|
1025
|
-
|
|
939
|
+
R();
|
|
1026
940
|
},
|
|
1027
941
|
{ immediate: !0 }
|
|
1028
|
-
),
|
|
1029
|
-
|
|
1030
|
-
(
|
|
1031
|
-
key:
|
|
942
|
+
), Fe(() => clearTimeout(A)), (k, P) => (x(), K("div", Qt, [
|
|
943
|
+
z.value.length > 0 ? (x(), K("div", Xt, [
|
|
944
|
+
(x(!0), K(ke, null, Ne(z.value, (E) => (x(), I(e(ae), {
|
|
945
|
+
key: E.id,
|
|
1032
946
|
type: "default",
|
|
1033
|
-
closable: !
|
|
947
|
+
closable: !l.value,
|
|
1034
948
|
"close-label": e(t)("article.tag-remove"),
|
|
1035
|
-
onClose: (
|
|
949
|
+
onClose: (ie) => U(E.id)
|
|
1036
950
|
}, {
|
|
1037
951
|
default: i(() => [
|
|
1038
|
-
|
|
952
|
+
V(_(E.title), 1)
|
|
1039
953
|
]),
|
|
1040
954
|
_: 2
|
|
1041
955
|
}, 1032, ["closable", "close-label", "onClose"]))), 128))
|
|
1042
|
-
])) : (
|
|
956
|
+
])) : (x(), I(e(te), {
|
|
1043
957
|
key: 1,
|
|
1044
958
|
size: "sm",
|
|
1045
959
|
tone: "muted"
|
|
1046
960
|
}, {
|
|
1047
961
|
default: i(() => [
|
|
1048
|
-
|
|
962
|
+
V(_(e(t)("article.tags-empty")), 1)
|
|
1049
963
|
]),
|
|
1050
964
|
_: 1
|
|
1051
965
|
})),
|
|
1052
|
-
|
|
1053
|
-
|
|
966
|
+
O("div", Yt, [
|
|
967
|
+
r(e(_e), {
|
|
1054
968
|
"model-value": null,
|
|
1055
|
-
options:
|
|
969
|
+
options: S.value,
|
|
1056
970
|
placeholder: e(t)("article.tag-add"),
|
|
1057
971
|
"empty-text": e(t)("article.tag-nothing"),
|
|
1058
|
-
disabled:
|
|
972
|
+
disabled: l.value,
|
|
1059
973
|
filterable: "",
|
|
1060
974
|
teleport: "",
|
|
1061
975
|
"aria-label": e(t)("article.tag-add"),
|
|
1062
|
-
onSearch:
|
|
1063
|
-
"onUpdate:modelValue":
|
|
976
|
+
onSearch: w,
|
|
977
|
+
"onUpdate:modelValue": W
|
|
1064
978
|
}, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"]),
|
|
1065
|
-
|
|
979
|
+
B.value ? (x(), I(e(H), {
|
|
1066
980
|
key: 0,
|
|
1067
981
|
variant: "outline",
|
|
1068
982
|
icon: "plus",
|
|
1069
|
-
loading:
|
|
1070
|
-
disabled:
|
|
983
|
+
loading: m.value,
|
|
984
|
+
disabled: l.value,
|
|
1071
985
|
onClick: N
|
|
1072
986
|
}, {
|
|
1073
987
|
default: i(() => [
|
|
1074
|
-
|
|
988
|
+
V(_(e(t)("article.tag-create", { title: B.value })), 1)
|
|
1075
989
|
]),
|
|
1076
990
|
_: 1
|
|
1077
|
-
}, 8, ["loading", "disabled"])) :
|
|
991
|
+
}, 8, ["loading", "disabled"])) : L("", !0)
|
|
1078
992
|
])
|
|
1079
993
|
]));
|
|
1080
994
|
}
|
|
1081
|
-
}),
|
|
995
|
+
}), aa = /* @__PURE__ */ ve(ta, [["__scopeId", "data-v-faf5adec"]]), la = /* @__PURE__ */ Q({
|
|
1082
996
|
name: "WxArticleUnpublish",
|
|
1083
997
|
__name: "ArticleUnpublish",
|
|
1084
|
-
setup(
|
|
1085
|
-
const
|
|
1086
|
-
|
|
1087
|
-
const
|
|
1088
|
-
const
|
|
1089
|
-
return
|
|
1090
|
-
}),
|
|
1091
|
-
async function
|
|
1092
|
-
const
|
|
1093
|
-
if (!(!
|
|
1094
|
-
title:
|
|
1095
|
-
message:
|
|
1096
|
-
confirmText:
|
|
1097
|
-
cancelText:
|
|
998
|
+
setup(v) {
|
|
999
|
+
const c = le(), p = re(c), g = Ae();
|
|
1000
|
+
X();
|
|
1001
|
+
const a = J("webx-blog"), s = be(), t = M(!1), o = h(() => {
|
|
1002
|
+
const f = g?.article.value?.status;
|
|
1003
|
+
return f === "published" || f === "modified" || f === "scheduled";
|
|
1004
|
+
}), l = h(() => g?.disabled.value === !0 || t.value);
|
|
1005
|
+
async function y() {
|
|
1006
|
+
const f = g?.article.value;
|
|
1007
|
+
if (!(!f || !await ce({
|
|
1008
|
+
title: a("article.unpublish-title", { title: f.title }),
|
|
1009
|
+
message: f.status === "scheduled" ? a("article.unpublish-waiting") : a("article.unpublish-text"),
|
|
1010
|
+
confirmText: a("panel.unpublish"),
|
|
1011
|
+
cancelText: a("panel.cancel"),
|
|
1098
1012
|
tone: "danger"
|
|
1099
1013
|
}))) {
|
|
1100
1014
|
t.value = !0;
|
|
1101
1015
|
try {
|
|
1102
|
-
await
|
|
1103
|
-
} catch (
|
|
1104
|
-
|
|
1016
|
+
await p.unpublish(f.id), await g?.reload(), D.success(a("panel.unpublished-done"));
|
|
1017
|
+
} catch (m) {
|
|
1018
|
+
D.danger(s(m));
|
|
1105
1019
|
} finally {
|
|
1106
1020
|
t.value = !1;
|
|
1107
1021
|
}
|
|
1108
1022
|
}
|
|
1109
1023
|
}
|
|
1110
|
-
return (
|
|
1024
|
+
return (f, $) => o.value && e(g)?.canManage ? (x(), I(e(de), {
|
|
1111
1025
|
key: 0,
|
|
1112
1026
|
class: "wx-article-unpublish",
|
|
1113
|
-
help: e(
|
|
1027
|
+
help: e(a)("article.unpublish-help")
|
|
1114
1028
|
}, {
|
|
1115
1029
|
default: i(() => [
|
|
1116
|
-
|
|
1030
|
+
r(e(H), {
|
|
1117
1031
|
variant: "outline",
|
|
1118
1032
|
type: "danger",
|
|
1119
1033
|
icon: "eye-off",
|
|
1120
1034
|
loading: t.value,
|
|
1121
|
-
disabled:
|
|
1122
|
-
onClick:
|
|
1035
|
+
disabled: l.value,
|
|
1036
|
+
onClick: y
|
|
1123
1037
|
}, {
|
|
1124
1038
|
default: i(() => [
|
|
1125
|
-
|
|
1039
|
+
V(_(e(a)("panel.unpublish")), 1)
|
|
1126
1040
|
]),
|
|
1127
1041
|
_: 1
|
|
1128
1042
|
}, 8, ["loading", "disabled"])
|
|
1129
1043
|
]),
|
|
1130
1044
|
_: 1
|
|
1131
|
-
}, 8, ["help"])) :
|
|
1045
|
+
}, 8, ["help"])) : L("", !0);
|
|
1132
1046
|
}
|
|
1133
|
-
}),
|
|
1047
|
+
}), ia = /* @__PURE__ */ ve(la, [["__scopeId", "data-v-c311cff2"]]), na = /* @__PURE__ */ Q({
|
|
1134
1048
|
__name: "ArticleCreateDialog",
|
|
1135
|
-
setup(
|
|
1136
|
-
const { open:
|
|
1137
|
-
|
|
1138
|
-
const t =
|
|
1139
|
-
|
|
1140
|
-
await
|
|
1049
|
+
setup(v) {
|
|
1050
|
+
const { open: c, resolve: p, dismiss: g } = Pe(), a = le(), s = re(a);
|
|
1051
|
+
X();
|
|
1052
|
+
const t = J("webx-blog"), o = M(""), l = M(!1), y = M({}), f = qe("field");
|
|
1053
|
+
Ue(async () => {
|
|
1054
|
+
await Ke(), f.value?.querySelector("input")?.focus();
|
|
1141
1055
|
});
|
|
1142
|
-
async function
|
|
1143
|
-
if (!(
|
|
1144
|
-
|
|
1056
|
+
async function $() {
|
|
1057
|
+
if (!(o.value.trim() === "" || l.value)) {
|
|
1058
|
+
l.value = !0, y.value = {};
|
|
1145
1059
|
try {
|
|
1146
|
-
|
|
1147
|
-
} catch (
|
|
1148
|
-
|
|
1060
|
+
p(await s.create({ title: o.value.trim() }));
|
|
1061
|
+
} catch (m) {
|
|
1062
|
+
y.value = m.body?.errors ?? {};
|
|
1149
1063
|
} finally {
|
|
1150
|
-
|
|
1064
|
+
l.value = !1;
|
|
1151
1065
|
}
|
|
1152
1066
|
}
|
|
1153
1067
|
}
|
|
1154
|
-
return (
|
|
1155
|
-
open: e(
|
|
1156
|
-
"onUpdate:open":
|
|
1068
|
+
return (m, A) => (x(), I(e(Re), {
|
|
1069
|
+
open: e(c),
|
|
1070
|
+
"onUpdate:open": A[2] || (A[2] = (z) => Ie(c) ? c.value = z : null),
|
|
1157
1071
|
title: e(t)("panel.new-title"),
|
|
1158
1072
|
width: 440
|
|
1159
1073
|
}, {
|
|
1160
1074
|
footer: i(() => [
|
|
1161
|
-
|
|
1075
|
+
r(e(De), { size: "sm" }, {
|
|
1162
1076
|
default: i(() => [
|
|
1163
|
-
|
|
1077
|
+
r(e(H), {
|
|
1164
1078
|
variant: "outline",
|
|
1165
|
-
onClick:
|
|
1079
|
+
onClick: A[1] || (A[1] = (z) => e(g)())
|
|
1166
1080
|
}, {
|
|
1167
1081
|
default: i(() => [
|
|
1168
|
-
|
|
1082
|
+
V(_(e(t)("panel.cancel")), 1)
|
|
1169
1083
|
]),
|
|
1170
1084
|
_: 1
|
|
1171
1085
|
}),
|
|
1172
|
-
|
|
1086
|
+
r(e(H), {
|
|
1173
1087
|
type: "primary",
|
|
1174
|
-
loading:
|
|
1175
|
-
disabled:
|
|
1176
|
-
onClick:
|
|
1088
|
+
loading: l.value,
|
|
1089
|
+
disabled: o.value.trim() === "",
|
|
1090
|
+
onClick: $
|
|
1177
1091
|
}, {
|
|
1178
1092
|
default: i(() => [
|
|
1179
|
-
|
|
1093
|
+
V(_(e(t)("panel.create")), 1)
|
|
1180
1094
|
]),
|
|
1181
1095
|
_: 1
|
|
1182
1096
|
}, 8, ["loading", "disabled"])
|
|
@@ -1185,21 +1099,21 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
1185
1099
|
})
|
|
1186
1100
|
]),
|
|
1187
1101
|
default: i(() => [
|
|
1188
|
-
|
|
1102
|
+
r(e(de), {
|
|
1189
1103
|
label: e(t)("panel.field-title"),
|
|
1190
|
-
error:
|
|
1104
|
+
error: y.value.title?.[0] ?? y.value.slug?.[0],
|
|
1191
1105
|
required: ""
|
|
1192
1106
|
}, {
|
|
1193
1107
|
default: i(() => [
|
|
1194
|
-
|
|
1108
|
+
O("div", {
|
|
1195
1109
|
ref_key: "field",
|
|
1196
|
-
ref:
|
|
1110
|
+
ref: f
|
|
1197
1111
|
}, [
|
|
1198
|
-
|
|
1199
|
-
modelValue:
|
|
1200
|
-
"onUpdate:modelValue":
|
|
1112
|
+
r(e(We), {
|
|
1113
|
+
modelValue: o.value,
|
|
1114
|
+
"onUpdate:modelValue": A[0] || (A[0] = (z) => o.value = z),
|
|
1201
1115
|
"aria-label": e(t)("panel.field-title"),
|
|
1202
|
-
onKeyup:
|
|
1116
|
+
onKeyup: ze($, ["enter"])
|
|
1203
1117
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1204
1118
|
], 512)
|
|
1205
1119
|
]),
|
|
@@ -1209,42 +1123,42 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
1209
1123
|
_: 1
|
|
1210
1124
|
}, 8, ["open", "title"]));
|
|
1211
1125
|
}
|
|
1212
|
-
}),
|
|
1126
|
+
}), sa = ["src"], ra = { class: "wx-articles__name" }, oa = { class: "wx-articles__name-text" }, ua = { class: "wx-articles__title" }, ca = { class: "wx-articles__address" }, da = { class: "wx-articles__chips" }, pa = { class: "wx-articles__state" }, Qe = 640, va = /* @__PURE__ */ Q({
|
|
1213
1127
|
__name: "ArticlesPage",
|
|
1214
1128
|
props: {
|
|
1215
1129
|
base: { default: "/blog" }
|
|
1216
1130
|
},
|
|
1217
|
-
setup(
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1220
|
-
const t =
|
|
1221
|
-
() =>
|
|
1222
|
-
),
|
|
1223
|
-
get: () => typeof
|
|
1224
|
-
set: (
|
|
1225
|
-
|
|
1226
|
-
query: { ...
|
|
1131
|
+
setup(v) {
|
|
1132
|
+
const c = v, p = le(), g = re(p), a = He(), s = Ge();
|
|
1133
|
+
X();
|
|
1134
|
+
const t = J("webx-blog"), o = J("webx-admin"), l = be(), y = qe("root"), f = $t(y), $ = M(null), m = M(!0), A = Ce(na), z = h(() => p.can("blog.articles.manage")), S = h(
|
|
1135
|
+
() => p.state.manifest?.modules.find((n) => n.id === "articles")?.title ?? t("module.articles")
|
|
1136
|
+
), B = h({
|
|
1137
|
+
get: () => typeof a.query.view == "string" ? a.query.view : "",
|
|
1138
|
+
set: (n) => {
|
|
1139
|
+
s.replace({
|
|
1140
|
+
query: { ...a.query, view: n === "" ? void 0 : String(n), page: void 0 }
|
|
1227
1141
|
});
|
|
1228
1142
|
}
|
|
1229
|
-
}),
|
|
1230
|
-
q: typeof
|
|
1231
|
-
rubric:
|
|
1232
|
-
tag:
|
|
1233
|
-
author:
|
|
1234
|
-
sort: typeof
|
|
1235
|
-
page: Number(
|
|
1143
|
+
}), R = h(() => B.value === "trashed"), w = h(() => ({
|
|
1144
|
+
q: typeof a.query.q == "string" ? a.query.q : "",
|
|
1145
|
+
rubric: W(a.query.rubric),
|
|
1146
|
+
tag: W(a.query.tag),
|
|
1147
|
+
author: W(a.query.author),
|
|
1148
|
+
sort: typeof a.query.sort == "string" ? a.query.sort : null,
|
|
1149
|
+
page: Number(a.query.page ?? 1) || 1
|
|
1236
1150
|
}));
|
|
1237
|
-
function
|
|
1238
|
-
return typeof
|
|
1151
|
+
function W(n) {
|
|
1152
|
+
return typeof n == "string" && n !== "" && Number(n) || null;
|
|
1239
1153
|
}
|
|
1240
|
-
const
|
|
1154
|
+
const U = h(() => [
|
|
1241
1155
|
{ value: "", label: t("panel.view-all") },
|
|
1242
1156
|
{ value: "published", label: t("panel.view-published") },
|
|
1243
1157
|
{ value: "scheduled", label: t("panel.view-scheduled") },
|
|
1244
1158
|
{ value: "draft", label: t("panel.view-draft") },
|
|
1245
1159
|
{ value: "unpublished", label: t("panel.view-unpublished") },
|
|
1246
1160
|
{ value: "trashed", label: t("panel.bin"), icon: "trash" }
|
|
1247
|
-
]), N =
|
|
1161
|
+
]), N = h(() => $.value?.filters ?? { rubrics: [], tags: [], authors: [] }), k = h(() => f.value > 0 && f.value < Qe), P = h(() => k.value ? [{ key: "card", label: "" }] : [
|
|
1248
1162
|
{ key: "cover", label: "", width: 68 },
|
|
1249
1163
|
/* The one that takes what the others leave, and the only one without a number. */
|
|
1250
1164
|
{ key: "title", label: t("panel.column-title"), minWidth: 220 },
|
|
@@ -1252,7 +1166,7 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
1252
1166
|
{ key: "author", label: t("panel.column-author"), width: 160, hideBelow: 1200 },
|
|
1253
1167
|
{
|
|
1254
1168
|
key: "date",
|
|
1255
|
-
label:
|
|
1169
|
+
label: R.value ? t("panel.column-deleted") : t("panel.column-date"),
|
|
1256
1170
|
width: 120,
|
|
1257
1171
|
hideBelow: 700,
|
|
1258
1172
|
// "today at 16:22" is three words the table will break over two lines given half a
|
|
@@ -1260,31 +1174,31 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
1260
1174
|
cellClass: "wx-articles__when"
|
|
1261
1175
|
},
|
|
1262
1176
|
{ key: "status", label: t("panel.column-status"), width: 170 },
|
|
1263
|
-
{ key: "actions", label: "", width:
|
|
1264
|
-
]),
|
|
1265
|
-
const
|
|
1266
|
-
|
|
1177
|
+
{ key: "actions", label: "", width: Xe, align: "right" }
|
|
1178
|
+
]), E = h(() => w.value.q !== "" ? t("panel.empty-search") : R.value ? t("panel.empty-bin") : t("panel.empty")), ie = h(() => {
|
|
1179
|
+
const n = [], q = N.value.rubrics.find((b) => b.id === w.value.rubric);
|
|
1180
|
+
q && n.push({
|
|
1267
1181
|
key: "rubric",
|
|
1268
|
-
label: `${t("panel.filter-rubric")}: ${
|
|
1269
|
-
clear: () =>
|
|
1182
|
+
label: `${t("panel.filter-rubric")}: ${q.title}`,
|
|
1183
|
+
clear: () => F("rubric", void 0)
|
|
1270
1184
|
});
|
|
1271
|
-
const
|
|
1272
|
-
|
|
1185
|
+
const d = N.value.tags.find((b) => b.id === w.value.tag);
|
|
1186
|
+
d && n.push({
|
|
1273
1187
|
key: "tag",
|
|
1274
|
-
label: `${t("panel.filter-tag")}: ${
|
|
1275
|
-
clear: () =>
|
|
1188
|
+
label: `${t("panel.filter-tag")}: ${d.title}`,
|
|
1189
|
+
clear: () => F("tag", void 0)
|
|
1276
1190
|
});
|
|
1277
|
-
const
|
|
1278
|
-
return
|
|
1191
|
+
const xe = N.value.authors.find((b) => b.id === w.value.author);
|
|
1192
|
+
return xe && n.push({
|
|
1279
1193
|
key: "author",
|
|
1280
|
-
label: `${t("panel.filter-author")}: ${
|
|
1281
|
-
clear: () =>
|
|
1282
|
-
}),
|
|
1194
|
+
label: `${t("panel.filter-author")}: ${xe.title}`,
|
|
1195
|
+
clear: () => F("author", void 0)
|
|
1196
|
+
}), n;
|
|
1283
1197
|
});
|
|
1284
|
-
function
|
|
1285
|
-
|
|
1198
|
+
function Y() {
|
|
1199
|
+
s.replace({
|
|
1286
1200
|
query: {
|
|
1287
|
-
...
|
|
1201
|
+
...a.query,
|
|
1288
1202
|
rubric: void 0,
|
|
1289
1203
|
tag: void 0,
|
|
1290
1204
|
author: void 0,
|
|
@@ -1292,433 +1206,433 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
1292
1206
|
}
|
|
1293
1207
|
});
|
|
1294
1208
|
}
|
|
1295
|
-
async function
|
|
1296
|
-
|
|
1209
|
+
async function ne(n) {
|
|
1210
|
+
m.value = !0;
|
|
1297
1211
|
try {
|
|
1298
|
-
|
|
1299
|
-
q:
|
|
1300
|
-
status:
|
|
1301
|
-
trashed:
|
|
1302
|
-
rubric:
|
|
1303
|
-
tag:
|
|
1304
|
-
author:
|
|
1305
|
-
sort:
|
|
1306
|
-
page:
|
|
1307
|
-
per_page:
|
|
1212
|
+
$.value = await g.articles({
|
|
1213
|
+
q: n?.search ?? w.value.q,
|
|
1214
|
+
status: R.value ? "" : B.value,
|
|
1215
|
+
trashed: R.value,
|
|
1216
|
+
rubric: w.value.rubric,
|
|
1217
|
+
tag: w.value.tag,
|
|
1218
|
+
author: w.value.author,
|
|
1219
|
+
sort: n?.sort ? `${n.sort.order === "desc" ? "-" : ""}${n.sort.key}` : null,
|
|
1220
|
+
page: n?.page ?? w.value.page,
|
|
1221
|
+
per_page: n?.perPage
|
|
1308
1222
|
});
|
|
1309
|
-
} catch (
|
|
1310
|
-
|
|
1223
|
+
} catch (q) {
|
|
1224
|
+
D.danger(l(q));
|
|
1311
1225
|
} finally {
|
|
1312
|
-
|
|
1226
|
+
m.value = !1;
|
|
1313
1227
|
}
|
|
1314
1228
|
}
|
|
1315
|
-
function
|
|
1316
|
-
const
|
|
1317
|
-
...
|
|
1318
|
-
q:
|
|
1319
|
-
sort:
|
|
1320
|
-
page:
|
|
1229
|
+
function ge(n) {
|
|
1230
|
+
const q = {
|
|
1231
|
+
...a.query,
|
|
1232
|
+
q: n.search === "" ? void 0 : n.search,
|
|
1233
|
+
sort: n.sort === null ? void 0 : `${n.sort.order === "desc" ? "-" : ""}${n.sort.key}`,
|
|
1234
|
+
page: n.page === 1 ? void 0 : String(n.page)
|
|
1321
1235
|
};
|
|
1322
|
-
|
|
1236
|
+
s.replace({ query: q }), ne(n);
|
|
1323
1237
|
}
|
|
1324
|
-
function
|
|
1325
|
-
|
|
1238
|
+
function F(n, q) {
|
|
1239
|
+
s.replace({
|
|
1326
1240
|
query: {
|
|
1327
|
-
...
|
|
1328
|
-
[
|
|
1241
|
+
...a.query,
|
|
1242
|
+
[n]: typeof q == "number" ? String(q) : void 0,
|
|
1329
1243
|
page: void 0
|
|
1330
1244
|
}
|
|
1331
1245
|
});
|
|
1332
1246
|
}
|
|
1333
|
-
|
|
1334
|
-
() => [
|
|
1247
|
+
pe(
|
|
1248
|
+
() => [B.value, w.value.rubric, w.value.tag, w.value.author],
|
|
1335
1249
|
() => {
|
|
1336
|
-
|
|
1250
|
+
ne();
|
|
1337
1251
|
}
|
|
1338
|
-
),
|
|
1339
|
-
function
|
|
1340
|
-
const
|
|
1341
|
-
|
|
1342
|
-
}
|
|
1343
|
-
async function
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1346
|
-
}
|
|
1347
|
-
function
|
|
1348
|
-
if (!
|
|
1349
|
-
if (
|
|
1252
|
+
), ne();
|
|
1253
|
+
function he(n) {
|
|
1254
|
+
const q = `${c.base}/articles/${n.id}`;
|
|
1255
|
+
s.resolve(q).matched.length > 0 && s.push({ path: q, query: { ...a.query } });
|
|
1256
|
+
}
|
|
1257
|
+
async function ye() {
|
|
1258
|
+
const n = await A({});
|
|
1259
|
+
n && (await ne(), he(n));
|
|
1260
|
+
}
|
|
1261
|
+
function se(n) {
|
|
1262
|
+
if (!z.value) return [];
|
|
1263
|
+
if (R.value)
|
|
1350
1264
|
return [
|
|
1351
1265
|
{
|
|
1352
1266
|
key: "restore",
|
|
1353
1267
|
icon: "refresh",
|
|
1354
1268
|
label: t("panel.restore"),
|
|
1355
1269
|
run: () => {
|
|
1356
|
-
|
|
1270
|
+
ee(n);
|
|
1357
1271
|
}
|
|
1358
1272
|
}
|
|
1359
1273
|
];
|
|
1360
|
-
const
|
|
1361
|
-
{ key: "open", icon: "edit", label: t("panel.open"), run: () =>
|
|
1274
|
+
const q = [
|
|
1275
|
+
{ key: "open", icon: "edit", label: t("panel.open"), run: () => he(n) }
|
|
1362
1276
|
];
|
|
1363
|
-
return
|
|
1277
|
+
return n.url && n.status !== "draft" && q.push({
|
|
1364
1278
|
key: "site",
|
|
1365
1279
|
icon: "external-link",
|
|
1366
1280
|
label: t("panel.open-on-site"),
|
|
1367
|
-
href:
|
|
1368
|
-
}),
|
|
1281
|
+
href: n.url
|
|
1282
|
+
}), n.path !== null && q.push({
|
|
1369
1283
|
key: "copy",
|
|
1370
1284
|
icon: "copy",
|
|
1371
1285
|
label: t("panel.copy-address"),
|
|
1372
1286
|
run: () => {
|
|
1373
|
-
|
|
1287
|
+
u(n);
|
|
1374
1288
|
}
|
|
1375
|
-
}),
|
|
1289
|
+
}), q.push({
|
|
1376
1290
|
key: "pin",
|
|
1377
1291
|
icon: "star",
|
|
1378
|
-
label:
|
|
1292
|
+
label: n.pinned ? t("panel.unpin") : t("panel.pin"),
|
|
1379
1293
|
run: () => {
|
|
1380
|
-
|
|
1294
|
+
we(n, !n.pinned);
|
|
1381
1295
|
}
|
|
1382
|
-
}),
|
|
1383
|
-
|
|
1296
|
+
}), q.push(
|
|
1297
|
+
n.status === "published" || n.status === "modified" || n.status === "scheduled" ? {
|
|
1384
1298
|
key: "unpublish",
|
|
1385
1299
|
icon: "eye-off",
|
|
1386
1300
|
label: t("panel.unpublish"),
|
|
1387
1301
|
run: () => {
|
|
1388
|
-
|
|
1302
|
+
Se(n);
|
|
1389
1303
|
}
|
|
1390
1304
|
} : {
|
|
1391
1305
|
key: "publish",
|
|
1392
1306
|
icon: "upload",
|
|
1393
1307
|
label: t("panel.publish"),
|
|
1394
1308
|
run: () => {
|
|
1395
|
-
|
|
1309
|
+
fe(n);
|
|
1396
1310
|
}
|
|
1397
1311
|
}
|
|
1398
|
-
),
|
|
1312
|
+
), q.push({
|
|
1399
1313
|
key: "delete",
|
|
1400
1314
|
icon: "trash",
|
|
1401
1315
|
label: t("panel.delete"),
|
|
1402
1316
|
danger: !0,
|
|
1403
1317
|
run: () => {
|
|
1404
|
-
|
|
1318
|
+
oe(n);
|
|
1405
1319
|
}
|
|
1406
|
-
}),
|
|
1320
|
+
}), q;
|
|
1407
1321
|
}
|
|
1408
|
-
async function
|
|
1409
|
-
await
|
|
1322
|
+
async function fe(n) {
|
|
1323
|
+
await ue(() => g.publish(n.id), t("panel.published"));
|
|
1410
1324
|
}
|
|
1411
|
-
async function
|
|
1412
|
-
await
|
|
1325
|
+
async function Se(n) {
|
|
1326
|
+
await ue(() => g.unpublish(n.id), t("panel.unpublished-done"));
|
|
1413
1327
|
}
|
|
1414
|
-
async function
|
|
1415
|
-
await
|
|
1416
|
-
() =>
|
|
1417
|
-
t(
|
|
1328
|
+
async function we(n, q) {
|
|
1329
|
+
await ue(
|
|
1330
|
+
() => g.save(n.id, { values: { pinned: q }, revision: n.revision }),
|
|
1331
|
+
t(q ? "panel.pinned-done" : "panel.unpinned")
|
|
1418
1332
|
);
|
|
1419
1333
|
}
|
|
1420
|
-
async function
|
|
1421
|
-
await
|
|
1422
|
-
title: t("panel.delete-title", { title:
|
|
1334
|
+
async function oe(n) {
|
|
1335
|
+
await ce({
|
|
1336
|
+
title: t("panel.delete-title", { title: n.title }),
|
|
1423
1337
|
message: t("panel.delete-text"),
|
|
1424
1338
|
confirmText: t("panel.delete"),
|
|
1425
1339
|
cancelText: t("panel.cancel"),
|
|
1426
1340
|
tone: "danger"
|
|
1427
|
-
}) && await
|
|
1341
|
+
}) && await ue(() => g.remove(n.id), t("panel.deleted"));
|
|
1428
1342
|
}
|
|
1429
|
-
async function
|
|
1430
|
-
await
|
|
1343
|
+
async function ee(n) {
|
|
1344
|
+
await ue(() => g.restore(n.id), t("panel.restored"));
|
|
1431
1345
|
}
|
|
1432
|
-
async function
|
|
1346
|
+
async function ue(n, q) {
|
|
1433
1347
|
try {
|
|
1434
|
-
await
|
|
1435
|
-
} catch (
|
|
1436
|
-
|
|
1348
|
+
await n(), D.success(q);
|
|
1349
|
+
} catch (d) {
|
|
1350
|
+
D.danger(l(d));
|
|
1437
1351
|
} finally {
|
|
1438
|
-
await
|
|
1352
|
+
await ne();
|
|
1439
1353
|
}
|
|
1440
1354
|
}
|
|
1441
|
-
async function
|
|
1442
|
-
if (
|
|
1355
|
+
async function u(n) {
|
|
1356
|
+
if (n.url)
|
|
1443
1357
|
try {
|
|
1444
|
-
await navigator.clipboard.writeText(
|
|
1358
|
+
await navigator.clipboard.writeText(n.url), D.success(t("panel.address-copied"));
|
|
1445
1359
|
} catch {
|
|
1446
1360
|
}
|
|
1447
1361
|
}
|
|
1448
|
-
function
|
|
1449
|
-
return
|
|
1362
|
+
function T(n) {
|
|
1363
|
+
return n === "published" || n === "modified" ? "success" : n === "scheduled" ? "warning" : "default";
|
|
1450
1364
|
}
|
|
1451
|
-
function
|
|
1452
|
-
return
|
|
1365
|
+
function C(n) {
|
|
1366
|
+
return R.value ? "—" : n.path === null ? t("panel.no-address") : `/${n.path}`;
|
|
1453
1367
|
}
|
|
1454
|
-
function
|
|
1455
|
-
return
|
|
1368
|
+
function G(n) {
|
|
1369
|
+
return R.value ? n.deleted_at : n.published_at;
|
|
1456
1370
|
}
|
|
1457
|
-
const
|
|
1458
|
-
() =>
|
|
1459
|
-
|
|
1371
|
+
const me = h(
|
|
1372
|
+
() => z.value ? [{ key: "new", label: t("panel.new"), icon: "plus", primary: !0, run: () => {
|
|
1373
|
+
ye();
|
|
1460
1374
|
} }] : []
|
|
1461
1375
|
);
|
|
1462
|
-
return (
|
|
1376
|
+
return (n, q) => (x(), K("div", {
|
|
1463
1377
|
ref_key: "root",
|
|
1464
|
-
ref:
|
|
1378
|
+
ref: y,
|
|
1465
1379
|
class: "wx-articles"
|
|
1466
1380
|
}, [
|
|
1467
|
-
|
|
1468
|
-
view:
|
|
1469
|
-
"onUpdate:view":
|
|
1470
|
-
title:
|
|
1471
|
-
views:
|
|
1472
|
-
actions:
|
|
1381
|
+
r(e(Ye), {
|
|
1382
|
+
view: B.value,
|
|
1383
|
+
"onUpdate:view": q[3] || (q[3] = (d) => B.value = d),
|
|
1384
|
+
title: S.value,
|
|
1385
|
+
views: U.value,
|
|
1386
|
+
actions: me.value
|
|
1473
1387
|
}, {
|
|
1474
1388
|
default: i(() => [
|
|
1475
|
-
|
|
1476
|
-
data:
|
|
1477
|
-
columns:
|
|
1389
|
+
r(e(lt), {
|
|
1390
|
+
data: $.value,
|
|
1391
|
+
columns: P.value,
|
|
1478
1392
|
"row-key": "id",
|
|
1479
1393
|
searchable: "",
|
|
1480
|
-
clickable: !
|
|
1481
|
-
hover: !
|
|
1394
|
+
clickable: !R.value,
|
|
1395
|
+
hover: !R.value,
|
|
1482
1396
|
flush: "",
|
|
1483
|
-
loading:
|
|
1397
|
+
loading: m.value,
|
|
1484
1398
|
layout: "fixed",
|
|
1485
|
-
"cards-below":
|
|
1486
|
-
"filters-count":
|
|
1487
|
-
"filters-label": e(
|
|
1399
|
+
"cards-below": Qe,
|
|
1400
|
+
"filters-count": ie.value.length,
|
|
1401
|
+
"filters-label": e(o)("filters.title"),
|
|
1488
1402
|
"search-placeholder": e(t)("panel.search"),
|
|
1489
|
-
"empty-text":
|
|
1490
|
-
"aria-label":
|
|
1491
|
-
onRowClick:
|
|
1492
|
-
onStateChange:
|
|
1403
|
+
"empty-text": E.value,
|
|
1404
|
+
"aria-label": S.value,
|
|
1405
|
+
onRowClick: he,
|
|
1406
|
+
onStateChange: ge
|
|
1493
1407
|
}, {
|
|
1494
1408
|
filters: i(() => [
|
|
1495
|
-
|
|
1409
|
+
r(e(de), {
|
|
1496
1410
|
label: e(t)("panel.filter-rubric")
|
|
1497
1411
|
}, {
|
|
1498
1412
|
default: i(() => [
|
|
1499
|
-
|
|
1500
|
-
"model-value":
|
|
1501
|
-
options: N.value.rubrics.map((
|
|
1413
|
+
r(e(_e), {
|
|
1414
|
+
"model-value": w.value.rubric,
|
|
1415
|
+
options: N.value.rubrics.map((d) => ({ value: d.id, label: d.title })),
|
|
1502
1416
|
placeholder: e(t)("panel.any-rubric"),
|
|
1503
1417
|
clearable: "",
|
|
1504
1418
|
size: "sm",
|
|
1505
|
-
"onUpdate:modelValue":
|
|
1419
|
+
"onUpdate:modelValue": q[0] || (q[0] = (d) => F("rubric", d))
|
|
1506
1420
|
}, null, 8, ["model-value", "options", "placeholder"])
|
|
1507
1421
|
]),
|
|
1508
1422
|
_: 1
|
|
1509
1423
|
}, 8, ["label"]),
|
|
1510
|
-
|
|
1424
|
+
r(e(de), {
|
|
1511
1425
|
label: e(t)("panel.filter-tag")
|
|
1512
1426
|
}, {
|
|
1513
1427
|
default: i(() => [
|
|
1514
|
-
|
|
1515
|
-
"model-value":
|
|
1516
|
-
options: N.value.tags.map((
|
|
1428
|
+
r(e(_e), {
|
|
1429
|
+
"model-value": w.value.tag,
|
|
1430
|
+
options: N.value.tags.map((d) => ({ value: d.id, label: d.title })),
|
|
1517
1431
|
placeholder: e(t)("panel.any-tag"),
|
|
1518
1432
|
clearable: "",
|
|
1519
1433
|
filterable: "",
|
|
1520
1434
|
size: "sm",
|
|
1521
|
-
"onUpdate:modelValue":
|
|
1435
|
+
"onUpdate:modelValue": q[1] || (q[1] = (d) => F("tag", d))
|
|
1522
1436
|
}, null, 8, ["model-value", "options", "placeholder"])
|
|
1523
1437
|
]),
|
|
1524
1438
|
_: 1
|
|
1525
1439
|
}, 8, ["label"]),
|
|
1526
|
-
|
|
1440
|
+
r(e(de), {
|
|
1527
1441
|
label: e(t)("panel.filter-author")
|
|
1528
1442
|
}, {
|
|
1529
1443
|
default: i(() => [
|
|
1530
|
-
|
|
1531
|
-
"model-value":
|
|
1532
|
-
options: N.value.authors.map((
|
|
1444
|
+
r(e(_e), {
|
|
1445
|
+
"model-value": w.value.author,
|
|
1446
|
+
options: N.value.authors.map((d) => ({ value: d.id, label: d.title })),
|
|
1533
1447
|
placeholder: e(t)("panel.any-author"),
|
|
1534
1448
|
clearable: "",
|
|
1535
1449
|
size: "sm",
|
|
1536
|
-
"onUpdate:modelValue":
|
|
1450
|
+
"onUpdate:modelValue": q[2] || (q[2] = (d) => F("author", d))
|
|
1537
1451
|
}, null, 8, ["model-value", "options", "placeholder"])
|
|
1538
1452
|
]),
|
|
1539
1453
|
_: 1
|
|
1540
1454
|
}, 8, ["label"]),
|
|
1541
|
-
|
|
1455
|
+
ie.value.length > 0 ? (x(), I(e(H), {
|
|
1542
1456
|
key: 0,
|
|
1543
1457
|
variant: "text",
|
|
1544
1458
|
size: "sm",
|
|
1545
1459
|
block: "",
|
|
1546
|
-
onClick:
|
|
1460
|
+
onClick: Y
|
|
1547
1461
|
}, {
|
|
1548
1462
|
icon: i(() => [
|
|
1549
|
-
|
|
1463
|
+
r(e(Te), { name: "close" })
|
|
1550
1464
|
]),
|
|
1551
1465
|
default: i(() => [
|
|
1552
|
-
|
|
1466
|
+
V(" " + _(e(o)("filters.reset")), 1)
|
|
1553
1467
|
]),
|
|
1554
1468
|
_: 1
|
|
1555
|
-
})) :
|
|
1469
|
+
})) : L("", !0)
|
|
1556
1470
|
]),
|
|
1557
1471
|
applied: i(() => [
|
|
1558
|
-
|
|
1472
|
+
r(e(dt), { filters: ie.value }, null, 8, ["filters"])
|
|
1559
1473
|
]),
|
|
1560
|
-
"cell-cover": i(({ row:
|
|
1561
|
-
|
|
1562
|
-
class:
|
|
1474
|
+
"cell-cover": i(({ row: d }) => [
|
|
1475
|
+
O("span", {
|
|
1476
|
+
class: et(["wx-articles__cover", { "is-empty": !d.cover }])
|
|
1563
1477
|
}, [
|
|
1564
|
-
|
|
1478
|
+
d.cover?.thumb ? (x(), K("img", {
|
|
1565
1479
|
key: 0,
|
|
1566
|
-
src:
|
|
1480
|
+
src: d.cover.thumb,
|
|
1567
1481
|
alt: "",
|
|
1568
1482
|
loading: "lazy"
|
|
1569
|
-
}, null, 8,
|
|
1483
|
+
}, null, 8, sa)) : (x(), I(e(Te), {
|
|
1570
1484
|
key: 1,
|
|
1571
1485
|
name: "image",
|
|
1572
1486
|
size: "sm"
|
|
1573
1487
|
}))
|
|
1574
1488
|
], 2)
|
|
1575
1489
|
]),
|
|
1576
|
-
"cell-title": i(({ row:
|
|
1577
|
-
|
|
1578
|
-
|
|
1490
|
+
"cell-title": i(({ row: d }) => [
|
|
1491
|
+
O("div", ra, [
|
|
1492
|
+
d.pinned ? (x(), I(e(it), {
|
|
1579
1493
|
key: 0,
|
|
1580
1494
|
content: e(t)("panel.pinned")
|
|
1581
1495
|
}, {
|
|
1582
1496
|
default: i(() => [
|
|
1583
|
-
|
|
1497
|
+
r(e(Te), {
|
|
1584
1498
|
class: "wx-articles__pin",
|
|
1585
1499
|
name: "star",
|
|
1586
1500
|
size: "sm"
|
|
1587
1501
|
})
|
|
1588
1502
|
]),
|
|
1589
1503
|
_: 1
|
|
1590
|
-
}, 8, ["content"])) :
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1504
|
+
}, 8, ["content"])) : L("", !0),
|
|
1505
|
+
O("div", oa, [
|
|
1506
|
+
O("span", ua, _(d.title), 1),
|
|
1507
|
+
O("span", ca, _(C(d)), 1)
|
|
1594
1508
|
])
|
|
1595
1509
|
])
|
|
1596
1510
|
]),
|
|
1597
|
-
"cell-rubrics": i(({ row:
|
|
1598
|
-
|
|
1599
|
-
(
|
|
1600
|
-
key:
|
|
1511
|
+
"cell-rubrics": i(({ row: d }) => [
|
|
1512
|
+
O("span", da, [
|
|
1513
|
+
(x(!0), K(ke, null, Ne(d.rubrics, (xe) => (x(), I(e(ae), {
|
|
1514
|
+
key: xe.id,
|
|
1601
1515
|
size: "sm",
|
|
1602
1516
|
round: ""
|
|
1603
1517
|
}, {
|
|
1604
1518
|
default: i(() => [
|
|
1605
|
-
|
|
1519
|
+
V(_(xe.title), 1)
|
|
1606
1520
|
]),
|
|
1607
1521
|
_: 2
|
|
1608
1522
|
}, 1024))), 128))
|
|
1609
1523
|
])
|
|
1610
1524
|
]),
|
|
1611
|
-
"cell-author": i(({ row:
|
|
1612
|
-
|
|
1525
|
+
"cell-author": i(({ row: d }) => [
|
|
1526
|
+
r(e(te), {
|
|
1613
1527
|
size: "sm",
|
|
1614
1528
|
tone: "muted",
|
|
1615
1529
|
truncate: ""
|
|
1616
1530
|
}, {
|
|
1617
1531
|
default: i(() => [
|
|
1618
|
-
|
|
1532
|
+
V(_(d.author ? d.author.name : "—"), 1)
|
|
1619
1533
|
]),
|
|
1620
1534
|
_: 2
|
|
1621
1535
|
}, 1024)
|
|
1622
1536
|
]),
|
|
1623
|
-
"cell-date": i(({ row:
|
|
1624
|
-
|
|
1537
|
+
"cell-date": i(({ row: d }) => [
|
|
1538
|
+
G(d) ? (x(), I(e(Be), {
|
|
1625
1539
|
key: 0,
|
|
1626
|
-
value:
|
|
1540
|
+
value: G(d),
|
|
1627
1541
|
compact: ""
|
|
1628
|
-
}, null, 8, ["value"])) : (
|
|
1542
|
+
}, null, 8, ["value"])) : (x(), I(e(te), {
|
|
1629
1543
|
key: 1,
|
|
1630
1544
|
size: "sm",
|
|
1631
1545
|
tone: "muted"
|
|
1632
1546
|
}, {
|
|
1633
|
-
default: i(() => [...
|
|
1634
|
-
|
|
1547
|
+
default: i(() => [...q[4] || (q[4] = [
|
|
1548
|
+
V("—", -1)
|
|
1635
1549
|
])]),
|
|
1636
1550
|
_: 1
|
|
1637
1551
|
}))
|
|
1638
1552
|
]),
|
|
1639
|
-
"cell-status": i(({ row:
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
type:
|
|
1553
|
+
"cell-status": i(({ row: d }) => [
|
|
1554
|
+
O("span", pa, [
|
|
1555
|
+
r(e(ae), {
|
|
1556
|
+
type: T(d.status),
|
|
1643
1557
|
dot: "",
|
|
1644
1558
|
size: "sm"
|
|
1645
1559
|
}, {
|
|
1646
1560
|
default: i(() => [
|
|
1647
|
-
|
|
1561
|
+
V(_(e(t)(`panel.status-${d.status}`)), 1)
|
|
1648
1562
|
]),
|
|
1649
1563
|
_: 2
|
|
1650
1564
|
}, 1032, ["type"]),
|
|
1651
|
-
|
|
1565
|
+
d.status === "modified" ? (x(), I(e(ae), {
|
|
1652
1566
|
key: 0,
|
|
1653
1567
|
type: "primary",
|
|
1654
1568
|
size: "sm",
|
|
1655
1569
|
round: ""
|
|
1656
1570
|
}, {
|
|
1657
1571
|
default: i(() => [
|
|
1658
|
-
|
|
1572
|
+
V(_(e(t)("panel.edits")), 1)
|
|
1659
1573
|
]),
|
|
1660
1574
|
_: 1
|
|
1661
|
-
})) :
|
|
1575
|
+
})) : L("", !0)
|
|
1662
1576
|
])
|
|
1663
1577
|
]),
|
|
1664
|
-
"cell-card": i(({ row:
|
|
1665
|
-
|
|
1578
|
+
"cell-card": i(({ row: d }) => [
|
|
1579
|
+
r(e(Tt), {
|
|
1666
1580
|
class: "wx-articles__entity",
|
|
1667
1581
|
variant: "plain",
|
|
1668
|
-
title:
|
|
1669
|
-
image:
|
|
1582
|
+
title: d.title,
|
|
1583
|
+
image: d.cover?.thumb ?? void 0,
|
|
1670
1584
|
"image-size": "56px",
|
|
1671
1585
|
"title-lines": 2,
|
|
1672
|
-
subtitle:
|
|
1586
|
+
subtitle: C(d)
|
|
1673
1587
|
}, {
|
|
1674
1588
|
title: i(() => [
|
|
1675
|
-
|
|
1589
|
+
d.pinned ? (x(), I(e(Te), {
|
|
1676
1590
|
key: 0,
|
|
1677
1591
|
class: "wx-articles__pin",
|
|
1678
1592
|
name: "star",
|
|
1679
1593
|
size: "sm"
|
|
1680
|
-
})) :
|
|
1681
|
-
|
|
1594
|
+
})) : L("", !0),
|
|
1595
|
+
V(" " + _(d.title), 1)
|
|
1682
1596
|
]),
|
|
1683
1597
|
meta: i(() => [
|
|
1684
|
-
|
|
1598
|
+
d.rubrics[0] ? (x(), I(e(ae), {
|
|
1685
1599
|
key: 0,
|
|
1686
1600
|
size: "sm",
|
|
1687
1601
|
round: ""
|
|
1688
1602
|
}, {
|
|
1689
1603
|
default: i(() => [
|
|
1690
|
-
|
|
1604
|
+
V(_(d.rubrics[0].title), 1)
|
|
1691
1605
|
]),
|
|
1692
1606
|
_: 2
|
|
1693
|
-
}, 1024)) :
|
|
1694
|
-
|
|
1695
|
-
type:
|
|
1607
|
+
}, 1024)) : L("", !0),
|
|
1608
|
+
r(e(ae), {
|
|
1609
|
+
type: T(d.status),
|
|
1696
1610
|
dot: "",
|
|
1697
1611
|
size: "sm"
|
|
1698
1612
|
}, {
|
|
1699
1613
|
default: i(() => [
|
|
1700
|
-
|
|
1614
|
+
V(_(e(t)(`panel.status-${d.status}`)), 1)
|
|
1701
1615
|
]),
|
|
1702
1616
|
_: 2
|
|
1703
1617
|
}, 1032, ["type"]),
|
|
1704
|
-
|
|
1618
|
+
G(d) ? (x(), I(e(Be), {
|
|
1705
1619
|
key: 1,
|
|
1706
|
-
value:
|
|
1707
|
-
}, null, 8, ["value"])) :
|
|
1620
|
+
value: G(d)
|
|
1621
|
+
}, null, 8, ["value"])) : L("", !0)
|
|
1708
1622
|
]),
|
|
1709
1623
|
_: 2
|
|
1710
1624
|
}, 1032, ["title", "image", "subtitle"])
|
|
1711
1625
|
]),
|
|
1712
|
-
"card-actions": i(({ row:
|
|
1713
|
-
|
|
1714
|
-
actions:
|
|
1715
|
-
label:
|
|
1626
|
+
"card-actions": i(({ row: d }) => [
|
|
1627
|
+
r(e(Ve), {
|
|
1628
|
+
actions: se(d),
|
|
1629
|
+
label: d.title
|
|
1716
1630
|
}, null, 8, ["actions", "label"])
|
|
1717
1631
|
]),
|
|
1718
|
-
"cell-actions": i(({ row:
|
|
1719
|
-
|
|
1720
|
-
actions:
|
|
1721
|
-
label:
|
|
1632
|
+
"cell-actions": i(({ row: d }) => [
|
|
1633
|
+
r(e(Ve), {
|
|
1634
|
+
actions: se(d),
|
|
1635
|
+
label: d.title
|
|
1722
1636
|
}, null, 8, ["actions", "label"])
|
|
1723
1637
|
]),
|
|
1724
1638
|
_: 1
|
|
@@ -1728,536 +1642,58 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
1728
1642
|
}, 8, ["view", "title", "views", "actions"])
|
|
1729
1643
|
], 512));
|
|
1730
1644
|
}
|
|
1731
|
-
}),
|
|
1732
|
-
__name: "RubricDialog",
|
|
1733
|
-
props: {
|
|
1734
|
-
rubric: { default: null },
|
|
1735
|
-
prefix: { default: "" },
|
|
1736
|
-
disabled: { type: Boolean, default: !1 }
|
|
1737
|
-
},
|
|
1738
|
-
setup(g) {
|
|
1739
|
-
const o = g, { open: c, resolve: w, dismiss: n } = Re(), l = ne(), t = re(l), u = Qe();
|
|
1740
|
-
Y();
|
|
1741
|
-
const a = Q("webx-blog"), x = pe(), b = p(() => l.types["wx-media"]?.component), d = p(() => l.types["wx-seo"]?.component), f = p(
|
|
1742
|
-
() => l.types["wx-seo"]?.bind?.({ id: "seo", type: "wx-seo" }) ?? {}
|
|
1743
|
-
), v = U(L()), S = U({}), W = U(!1), O = U("content");
|
|
1744
|
-
function L() {
|
|
1745
|
-
return {
|
|
1746
|
-
title: {},
|
|
1747
|
-
slug: {},
|
|
1748
|
-
lead: {},
|
|
1749
|
-
cover: null,
|
|
1750
|
-
is_visible: !0,
|
|
1751
|
-
seo: {}
|
|
1752
|
-
};
|
|
1753
|
-
}
|
|
1754
|
-
ue(
|
|
1755
|
-
() => o.rubric,
|
|
1756
|
-
(k) => {
|
|
1757
|
-
if (S.value = {}, O.value = "content", k === null) {
|
|
1758
|
-
v.value = L();
|
|
1759
|
-
return;
|
|
1760
|
-
}
|
|
1761
|
-
v.value = {
|
|
1762
|
-
title: { ...k.title },
|
|
1763
|
-
slug: { ...k.slug },
|
|
1764
|
-
lead: { ...k.lead },
|
|
1765
|
-
cover: k.cover ? { path: k.cover.path, url: k.cover.url } : null,
|
|
1766
|
-
is_visible: k.is_visible,
|
|
1767
|
-
seo: { ...k.seo }
|
|
1768
|
-
};
|
|
1769
|
-
},
|
|
1770
|
-
{ immediate: !0 }
|
|
1771
|
-
);
|
|
1772
|
-
const $ = p(
|
|
1773
|
-
() => v.value.title[u.active.value] || o.rubric?.name || a("rubric.new")
|
|
1774
|
-
), C = p(() => {
|
|
1775
|
-
const k = v.value.slug[u.active.value] ?? "";
|
|
1776
|
-
return k === "" ? null : `/${[o.prefix, k].filter(Boolean).join("/")}`;
|
|
1777
|
-
}), q = p(() => {
|
|
1778
|
-
const k = o.rubric?.path;
|
|
1779
|
-
return typeof k == "string" && C.value !== null && C.value !== `/${k}`;
|
|
1780
|
-
}), N = {
|
|
1781
|
-
title: "content",
|
|
1782
|
-
slug: "content",
|
|
1783
|
-
lead: "content",
|
|
1784
|
-
cover: "cover",
|
|
1785
|
-
seo: "seo"
|
|
1786
|
-
};
|
|
1787
|
-
function A(k) {
|
|
1788
|
-
const P = Object.keys(S.value).find(
|
|
1789
|
-
(B) => B === k || B.startsWith(`${k}.`)
|
|
1790
|
-
);
|
|
1791
|
-
return P === void 0 ? void 0 : S.value[P]?.[0];
|
|
1792
|
-
}
|
|
1793
|
-
function E() {
|
|
1794
|
-
const k = ["content", "cover", "seo"], P = new Set(
|
|
1795
|
-
Object.keys(S.value).map((B) => N[B.split(".")[0] ?? ""]).filter((B) => B !== void 0)
|
|
1796
|
-
);
|
|
1797
|
-
return k.find((B) => P.has(B)) ?? null;
|
|
1798
|
-
}
|
|
1799
|
-
function y() {
|
|
1800
|
-
return {
|
|
1801
|
-
title: v.value.title,
|
|
1802
|
-
slug: v.value.slug,
|
|
1803
|
-
lead: v.value.lead,
|
|
1804
|
-
cover: v.value.cover === null ? null : { path: v.value.cover.path },
|
|
1805
|
-
is_visible: v.value.is_visible,
|
|
1806
|
-
// Always, now that the card is a tab of its own: an empty one is the rules being left in
|
|
1807
|
-
// charge, which is what the server stores it as (§12).
|
|
1808
|
-
seo: v.value.seo
|
|
1809
|
-
};
|
|
1810
|
-
}
|
|
1811
|
-
async function K() {
|
|
1812
|
-
W.value = !0, S.value = {};
|
|
1813
|
-
try {
|
|
1814
|
-
const k = o.rubric === null ? await t.createRubric(y()) : await t.saveRubric(o.rubric.id, y());
|
|
1815
|
-
F.success(o.rubric === null ? a("rubric.created") : a("rubric.saved")), w(k);
|
|
1816
|
-
} catch (k) {
|
|
1817
|
-
const P = k.body;
|
|
1818
|
-
P?.errors && (S.value = P.errors);
|
|
1819
|
-
const B = E();
|
|
1820
|
-
B !== null && (O.value = B), F.danger(x(k));
|
|
1821
|
-
} finally {
|
|
1822
|
-
W.value = !1;
|
|
1823
|
-
}
|
|
1824
|
-
}
|
|
1825
|
-
return (k, P) => (h(), M(e(Me), {
|
|
1826
|
-
open: e(c),
|
|
1827
|
-
"onUpdate:open": P[7] || (P[7] = (B) => Ue(c) ? c.value = B : null),
|
|
1828
|
-
class: "wx-rubric-dialog",
|
|
1829
|
-
title: $.value,
|
|
1830
|
-
width: 880,
|
|
1831
|
-
closable: "",
|
|
1832
|
-
onClose: e(n)
|
|
1833
|
-
}, {
|
|
1834
|
-
footer: i(() => [
|
|
1835
|
-
s(e(J), {
|
|
1836
|
-
variant: "outline",
|
|
1837
|
-
onClick: e(n)
|
|
1838
|
-
}, {
|
|
1839
|
-
default: i(() => [
|
|
1840
|
-
z(T(e(a)("rubric.cancel")), 1)
|
|
1841
|
-
]),
|
|
1842
|
-
_: 1
|
|
1843
|
-
}, 8, ["onClick"]),
|
|
1844
|
-
s(e(J), {
|
|
1845
|
-
type: "primary",
|
|
1846
|
-
loading: W.value,
|
|
1847
|
-
disabled: o.disabled,
|
|
1848
|
-
onClick: K
|
|
1849
|
-
}, {
|
|
1850
|
-
default: i(() => [
|
|
1851
|
-
z(T(e(a)("rubric.save")), 1)
|
|
1852
|
-
]),
|
|
1853
|
-
_: 1
|
|
1854
|
-
}, 8, ["loading", "disabled"])
|
|
1855
|
-
]),
|
|
1856
|
-
default: i(() => [
|
|
1857
|
-
s(e(Wt), {
|
|
1858
|
-
modelValue: O.value,
|
|
1859
|
-
"onUpdate:modelValue": P[6] || (P[6] = (B) => O.value = B),
|
|
1860
|
-
"keep-alive": ""
|
|
1861
|
-
}, {
|
|
1862
|
-
default: i(() => [
|
|
1863
|
-
s(e(Ke), {
|
|
1864
|
-
value: "content",
|
|
1865
|
-
label: e(a)("rubric.tab-content")
|
|
1866
|
-
}, {
|
|
1867
|
-
default: i(() => [
|
|
1868
|
-
H("div", $a, [
|
|
1869
|
-
H("div", Ta, [
|
|
1870
|
-
s(e(ie), {
|
|
1871
|
-
class: "wx-rubric-dialog__field",
|
|
1872
|
-
label: e(a)("rubric.field-title"),
|
|
1873
|
-
error: A("title"),
|
|
1874
|
-
required: ""
|
|
1875
|
-
}, {
|
|
1876
|
-
default: i(() => [
|
|
1877
|
-
s(e(Ve), {
|
|
1878
|
-
modelValue: v.value.title,
|
|
1879
|
-
"onUpdate:modelValue": P[0] || (P[0] = (B) => v.value.title = B),
|
|
1880
|
-
localized: "",
|
|
1881
|
-
disabled: o.disabled
|
|
1882
|
-
}, null, 8, ["modelValue", "disabled"])
|
|
1883
|
-
]),
|
|
1884
|
-
_: 1
|
|
1885
|
-
}, 8, ["label", "error"]),
|
|
1886
|
-
s(e(ie), {
|
|
1887
|
-
class: "wx-rubric-dialog__field",
|
|
1888
|
-
label: e(a)("rubric.field-slug"),
|
|
1889
|
-
error: A("slug"),
|
|
1890
|
-
help: C.value ?? void 0
|
|
1891
|
-
}, {
|
|
1892
|
-
default: i(() => [
|
|
1893
|
-
s(e(Ve), {
|
|
1894
|
-
modelValue: v.value.slug,
|
|
1895
|
-
"onUpdate:modelValue": P[1] || (P[1] = (B) => v.value.slug = B),
|
|
1896
|
-
localized: "",
|
|
1897
|
-
disabled: o.disabled
|
|
1898
|
-
}, null, 8, ["modelValue", "disabled"])
|
|
1899
|
-
]),
|
|
1900
|
-
_: 1
|
|
1901
|
-
}, 8, ["label", "error", "help"])
|
|
1902
|
-
]),
|
|
1903
|
-
q.value ? (h(), M(e(we), {
|
|
1904
|
-
key: 0,
|
|
1905
|
-
type: "info",
|
|
1906
|
-
variant: "soft",
|
|
1907
|
-
description: e(a)("rubric.address-moving")
|
|
1908
|
-
}, null, 8, ["description"])) : j("", !0),
|
|
1909
|
-
s(e(ie), {
|
|
1910
|
-
help: e(a)("rubric.visible-help"),
|
|
1911
|
-
wide: ""
|
|
1912
|
-
}, {
|
|
1913
|
-
default: i(() => [
|
|
1914
|
-
s(e(Ct), {
|
|
1915
|
-
modelValue: v.value.is_visible,
|
|
1916
|
-
"onUpdate:modelValue": P[2] || (P[2] = (B) => v.value.is_visible = B),
|
|
1917
|
-
label: e(a)("rubric.visible"),
|
|
1918
|
-
disabled: o.disabled
|
|
1919
|
-
}, null, 8, ["modelValue", "label", "disabled"])
|
|
1920
|
-
]),
|
|
1921
|
-
_: 1
|
|
1922
|
-
}, 8, ["help"]),
|
|
1923
|
-
s(e(ie), {
|
|
1924
|
-
label: e(a)("rubric.field-lead"),
|
|
1925
|
-
error: A("lead"),
|
|
1926
|
-
help: e(a)("rubric.lead-help"),
|
|
1927
|
-
wide: ""
|
|
1928
|
-
}, {
|
|
1929
|
-
default: i(() => [
|
|
1930
|
-
s(e(kt), {
|
|
1931
|
-
modelValue: v.value.lead,
|
|
1932
|
-
"onUpdate:modelValue": P[3] || (P[3] = (B) => v.value.lead = B),
|
|
1933
|
-
localized: "",
|
|
1934
|
-
disabled: o.disabled
|
|
1935
|
-
}, null, 8, ["modelValue", "disabled"])
|
|
1936
|
-
]),
|
|
1937
|
-
_: 1
|
|
1938
|
-
}, 8, ["label", "error", "help"])
|
|
1939
|
-
])
|
|
1940
|
-
]),
|
|
1941
|
-
_: 1
|
|
1942
|
-
}, 8, ["label"]),
|
|
1943
|
-
b.value ? (h(), M(e(Ke), {
|
|
1944
|
-
key: 0,
|
|
1945
|
-
value: "cover",
|
|
1946
|
-
label: e(a)("rubric.tab-cover")
|
|
1947
|
-
}, {
|
|
1948
|
-
default: i(() => [
|
|
1949
|
-
H("div", Va, [
|
|
1950
|
-
(h(), M(et(b.value), {
|
|
1951
|
-
modelValue: v.value.cover,
|
|
1952
|
-
"onUpdate:modelValue": P[4] || (P[4] = (B) => v.value.cover = B),
|
|
1953
|
-
class: "wx-rubric-dialog__cover",
|
|
1954
|
-
accept: "image",
|
|
1955
|
-
captions: !1,
|
|
1956
|
-
aspect: "16/9",
|
|
1957
|
-
disabled: o.disabled
|
|
1958
|
-
}, null, 8, ["modelValue", "disabled"])),
|
|
1959
|
-
s(e(we), {
|
|
1960
|
-
type: "info",
|
|
1961
|
-
description: e(a)("rubric.cover-help")
|
|
1962
|
-
}, null, 8, ["description"])
|
|
1963
|
-
])
|
|
1964
|
-
]),
|
|
1965
|
-
_: 1
|
|
1966
|
-
}, 8, ["label"])) : j("", !0),
|
|
1967
|
-
d.value ? (h(), M(e(Ke), {
|
|
1968
|
-
key: 1,
|
|
1969
|
-
value: "seo",
|
|
1970
|
-
label: e(a)("rubric.tab-seo")
|
|
1971
|
-
}, {
|
|
1972
|
-
default: i(() => [
|
|
1973
|
-
H("div", Aa, [
|
|
1974
|
-
s(e(we), {
|
|
1975
|
-
type: "info",
|
|
1976
|
-
description: e(a)("rubric.seo-help")
|
|
1977
|
-
}, null, 8, ["description"]),
|
|
1978
|
-
(h(), M(et(d.value), bt({
|
|
1979
|
-
modelValue: v.value.seo,
|
|
1980
|
-
"onUpdate:modelValue": P[5] || (P[5] = (B) => v.value.seo = B)
|
|
1981
|
-
}, f.value, {
|
|
1982
|
-
"structured-data": !1,
|
|
1983
|
-
disabled: o.disabled
|
|
1984
|
-
}), null, 16, ["modelValue", "disabled"]))
|
|
1985
|
-
])
|
|
1986
|
-
]),
|
|
1987
|
-
_: 1
|
|
1988
|
-
}, 8, ["label"])) : j("", !0)
|
|
1989
|
-
]),
|
|
1990
|
-
_: 1
|
|
1991
|
-
}, 8, ["modelValue"])
|
|
1992
|
-
]),
|
|
1993
|
-
_: 1
|
|
1994
|
-
}, 8, ["open", "title", "onClose"]));
|
|
1995
|
-
}
|
|
1996
|
-
}), Wa = /* @__PURE__ */ ce(Sa, [["__scopeId", "data-v-ff50aaf6"]]), Ca = ["onClick"], za = { class: "wx-rubric-row__name" }, Ua = /* @__PURE__ */ X({
|
|
1997
|
-
__name: "RubricsPage",
|
|
1998
|
-
props: {
|
|
1999
|
-
base: { default: "/blog" }
|
|
2000
|
-
},
|
|
2001
|
-
setup(g) {
|
|
2002
|
-
const o = g, c = ne(), w = re(c), n = Le(), l = Fe();
|
|
2003
|
-
Y();
|
|
2004
|
-
const t = Q("webx-blog"), u = pe(), a = U([]), x = U(""), b = U(!0), d = p(() => c.can("blog.taxonomy.manage")), f = p(
|
|
2005
|
-
() => c.state.manifest?.modules.find((y) => y.id === "rubrics")?.title ?? t("module.rubrics")
|
|
2006
|
-
), v = Ce(Wa), S = p(
|
|
2007
|
-
() => d.value ? [
|
|
2008
|
-
{
|
|
2009
|
-
key: "new",
|
|
2010
|
-
label: t("rubric.new"),
|
|
2011
|
-
icon: "plus",
|
|
2012
|
-
primary: !0,
|
|
2013
|
-
run: () => {
|
|
2014
|
-
C(null);
|
|
2015
|
-
}
|
|
2016
|
-
}
|
|
2017
|
-
] : []
|
|
2018
|
-
);
|
|
2019
|
-
async function W() {
|
|
2020
|
-
b.value = !0;
|
|
2021
|
-
try {
|
|
2022
|
-
const y = await w.rubrics();
|
|
2023
|
-
a.value = y.data, x.value = y.prefix;
|
|
2024
|
-
} catch (y) {
|
|
2025
|
-
F.danger(u(y));
|
|
2026
|
-
} finally {
|
|
2027
|
-
b.value = !1;
|
|
2028
|
-
}
|
|
2029
|
-
}
|
|
2030
|
-
W();
|
|
2031
|
-
let O = !1, L = null;
|
|
2032
|
-
ue(
|
|
2033
|
-
[() => n.query.rubric, b],
|
|
2034
|
-
([y, K]) => {
|
|
2035
|
-
const k = typeof y == "string" && y !== "" ? y : null;
|
|
2036
|
-
if (k === null) {
|
|
2037
|
-
L = null;
|
|
2038
|
-
return;
|
|
2039
|
-
}
|
|
2040
|
-
if (K || O || k === L) return;
|
|
2041
|
-
const P = a.value.find((B) => B.id === Number(k));
|
|
2042
|
-
P && C(P);
|
|
2043
|
-
},
|
|
2044
|
-
{ immediate: !0 }
|
|
2045
|
-
);
|
|
2046
|
-
function $(y) {
|
|
2047
|
-
const K = { ...n.query };
|
|
2048
|
-
y === null ? delete K.rubric : K.rubric = String(y), l.replace({ query: K });
|
|
2049
|
-
}
|
|
2050
|
-
async function C(y) {
|
|
2051
|
-
if (!O) {
|
|
2052
|
-
O = !0, L = y === null ? null : String(y.id), $(y?.id ?? null);
|
|
2053
|
-
try {
|
|
2054
|
-
const K = await v({ rubric: y, prefix: x.value, disabled: !d.value });
|
|
2055
|
-
if (K === void 0) {
|
|
2056
|
-
$(null);
|
|
2057
|
-
return;
|
|
2058
|
-
}
|
|
2059
|
-
await W(), L = String(K.id), $(K.id);
|
|
2060
|
-
} finally {
|
|
2061
|
-
O = !1;
|
|
2062
|
-
}
|
|
2063
|
-
}
|
|
2064
|
-
}
|
|
2065
|
-
function q(y) {
|
|
2066
|
-
l.push({ path: `${o.base}/articles`, query: { rubric: String(y.id) } });
|
|
2067
|
-
}
|
|
2068
|
-
async function N(y) {
|
|
2069
|
-
if (y.articles_count > 0) {
|
|
2070
|
-
F.warning(t("rubric.delete-blocked"));
|
|
2071
|
-
return;
|
|
2072
|
-
}
|
|
2073
|
-
if (await ve({
|
|
2074
|
-
title: t("rubric.delete-title", { name: y.name }),
|
|
2075
|
-
message: t("rubric.delete-text"),
|
|
2076
|
-
confirmText: t("rubric.delete"),
|
|
2077
|
-
cancelText: t("rubric.cancel"),
|
|
2078
|
-
tone: "danger"
|
|
2079
|
-
}))
|
|
2080
|
-
try {
|
|
2081
|
-
await w.removeRubric(y.id), F.success(t("rubric.deleted")), $(null), await W();
|
|
2082
|
-
} catch (k) {
|
|
2083
|
-
F.danger(u(k));
|
|
2084
|
-
}
|
|
2085
|
-
}
|
|
2086
|
-
function A(y) {
|
|
2087
|
-
const K = [
|
|
2088
|
-
{ key: "edit", label: t("rubric.edit"), icon: "edit", run: () => {
|
|
2089
|
-
C(y);
|
|
2090
|
-
} }
|
|
2091
|
-
];
|
|
2092
|
-
return y.articles_count > 0 && K.push({
|
|
2093
|
-
key: "articles",
|
|
2094
|
-
label: t("rubric.show-articles"),
|
|
2095
|
-
icon: "file-text",
|
|
2096
|
-
run: () => q(y)
|
|
2097
|
-
}), d.value && K.push({
|
|
2098
|
-
key: "delete",
|
|
2099
|
-
label: t("rubric.delete"),
|
|
2100
|
-
icon: "trash",
|
|
2101
|
-
danger: !0,
|
|
2102
|
-
run: () => {
|
|
2103
|
-
N(y);
|
|
2104
|
-
}
|
|
2105
|
-
}), K;
|
|
2106
|
-
}
|
|
2107
|
-
async function E() {
|
|
2108
|
-
try {
|
|
2109
|
-
await w.sortRubrics(a.value.map((y) => y.id));
|
|
2110
|
-
} catch (y) {
|
|
2111
|
-
F.danger(u(y, t("rubric.reorder-failed"))), await W();
|
|
2112
|
-
}
|
|
2113
|
-
}
|
|
2114
|
-
return (y, K) => (h(), M(e(Ze), {
|
|
2115
|
-
class: "wx-rubrics",
|
|
2116
|
-
title: f.value,
|
|
2117
|
-
actions: S.value,
|
|
2118
|
-
padding: "sm"
|
|
2119
|
-
}, {
|
|
2120
|
-
default: i(() => [
|
|
2121
|
-
b.value ? (h(), M(e(Ne), {
|
|
2122
|
-
key: 0,
|
|
2123
|
-
class: "wx-rubrics__loading",
|
|
2124
|
-
rows: 5
|
|
2125
|
-
})) : a.value.length === 0 ? (h(), M(e(rt), {
|
|
2126
|
-
key: 1,
|
|
2127
|
-
title: e(t)("rubric.empty"),
|
|
2128
|
-
description: e(t)("rubric.empty-help")
|
|
2129
|
-
}, null, 8, ["title", "description"])) : (h(), G(_e, { key: 2 }, [
|
|
2130
|
-
s(e(Xe), {
|
|
2131
|
-
modelValue: a.value,
|
|
2132
|
-
"onUpdate:modelValue": K[0] || (K[0] = (k) => a.value = k),
|
|
2133
|
-
class: "wx-rubrics__list",
|
|
2134
|
-
plain: "",
|
|
2135
|
-
"item-key": "id",
|
|
2136
|
-
"item-label": (k) => k.name,
|
|
2137
|
-
disabled: !d.value,
|
|
2138
|
-
onMove: E
|
|
2139
|
-
}, {
|
|
2140
|
-
default: i(({ item: k }) => [
|
|
2141
|
-
H("button", {
|
|
2142
|
-
type: "button",
|
|
2143
|
-
class: Ge(["wx-rubric-row", { "is-hidden": !k.is_visible }]),
|
|
2144
|
-
onClick: (P) => C(k)
|
|
2145
|
-
}, [
|
|
2146
|
-
H("span", za, [
|
|
2147
|
-
s(e(le), {
|
|
2148
|
-
truncate: "",
|
|
2149
|
-
weight: "medium"
|
|
2150
|
-
}, {
|
|
2151
|
-
default: i(() => [
|
|
2152
|
-
z(T(k.name), 1)
|
|
2153
|
-
]),
|
|
2154
|
-
_: 2
|
|
2155
|
-
}, 1024),
|
|
2156
|
-
k.is_visible ? j("", !0) : (h(), M(e(Ye), {
|
|
2157
|
-
key: 0,
|
|
2158
|
-
content: e(t)("rubric.hidden")
|
|
2159
|
-
}, {
|
|
2160
|
-
default: i(() => [
|
|
2161
|
-
s(e(Te), {
|
|
2162
|
-
name: "eye-off",
|
|
2163
|
-
size: "sm"
|
|
2164
|
-
})
|
|
2165
|
-
]),
|
|
2166
|
-
_: 1
|
|
2167
|
-
}, 8, ["content"]))
|
|
2168
|
-
]),
|
|
2169
|
-
s(e(le), {
|
|
2170
|
-
size: "sm",
|
|
2171
|
-
tone: "muted",
|
|
2172
|
-
truncate: ""
|
|
2173
|
-
}, {
|
|
2174
|
-
default: i(() => [
|
|
2175
|
-
z(T(k.path === null ? e(t)("rubric.no-address") : `/${k.path}`), 1)
|
|
2176
|
-
]),
|
|
2177
|
-
_: 2
|
|
2178
|
-
}, 1024)
|
|
2179
|
-
], 10, Ca)
|
|
2180
|
-
]),
|
|
2181
|
-
actions: i(({ item: k }) => [
|
|
2182
|
-
s(e(le), {
|
|
2183
|
-
class: "wx-rubric-row__count",
|
|
2184
|
-
size: "sm",
|
|
2185
|
-
tone: "muted"
|
|
2186
|
-
}, {
|
|
2187
|
-
default: i(() => [
|
|
2188
|
-
z(T(e(t)("rubric.articles", { count: k.articles_count })), 1)
|
|
2189
|
-
]),
|
|
2190
|
-
_: 2
|
|
2191
|
-
}, 1024),
|
|
2192
|
-
s(e(ze), {
|
|
2193
|
-
actions: A(k),
|
|
2194
|
-
label: k.name
|
|
2195
|
-
}, null, 8, ["actions", "label"])
|
|
2196
|
-
]),
|
|
2197
|
-
_: 1
|
|
2198
|
-
}, 8, ["modelValue", "item-label", "disabled"]),
|
|
2199
|
-
s(e(we), {
|
|
2200
|
-
class: "wx-rubrics__note",
|
|
2201
|
-
type: "info",
|
|
2202
|
-
description: e(t)("rubric.order")
|
|
2203
|
-
}, null, 8, ["description"])
|
|
2204
|
-
], 64))
|
|
2205
|
-
]),
|
|
2206
|
-
_: 1
|
|
2207
|
-
}, 8, ["title", "actions"]));
|
|
2208
|
-
}
|
|
2209
|
-
}), Ra = /* @__PURE__ */ X({
|
|
1645
|
+
}), ga = /* @__PURE__ */ ve(va, [["__scopeId", "data-v-2d93df26"]]), ha = /* @__PURE__ */ Q({
|
|
2210
1646
|
__name: "TagCreateDialog",
|
|
2211
|
-
setup(
|
|
2212
|
-
const { open:
|
|
2213
|
-
|
|
2214
|
-
const t =
|
|
2215
|
-
|
|
2216
|
-
await
|
|
1647
|
+
setup(v) {
|
|
1648
|
+
const { open: c, resolve: p, dismiss: g } = Pe(), a = le(), s = re(a);
|
|
1649
|
+
X();
|
|
1650
|
+
const t = J("webx-blog"), o = M(""), l = M(""), y = M(!1), f = M({}), $ = qe("field");
|
|
1651
|
+
Ue(async () => {
|
|
1652
|
+
await Ke(), $.value?.querySelector("input")?.focus();
|
|
2217
1653
|
});
|
|
2218
|
-
async function
|
|
2219
|
-
if (!(
|
|
2220
|
-
|
|
1654
|
+
async function m() {
|
|
1655
|
+
if (!(o.value.trim() === "" || y.value)) {
|
|
1656
|
+
y.value = !0, f.value = {};
|
|
2221
1657
|
try {
|
|
2222
|
-
|
|
2223
|
-
await
|
|
2224
|
-
title:
|
|
2225
|
-
...
|
|
1658
|
+
p(
|
|
1659
|
+
await s.createTag({
|
|
1660
|
+
title: o.value.trim(),
|
|
1661
|
+
...l.value.trim() === "" ? {} : { slug: l.value.trim() }
|
|
2226
1662
|
})
|
|
2227
1663
|
);
|
|
2228
|
-
} catch (
|
|
2229
|
-
|
|
1664
|
+
} catch (A) {
|
|
1665
|
+
f.value = A.body?.errors ?? {};
|
|
2230
1666
|
} finally {
|
|
2231
|
-
|
|
1667
|
+
y.value = !1;
|
|
2232
1668
|
}
|
|
2233
1669
|
}
|
|
2234
1670
|
}
|
|
2235
|
-
return (
|
|
2236
|
-
open: e(
|
|
2237
|
-
"onUpdate:open":
|
|
1671
|
+
return (A, z) => (x(), I(e(Re), {
|
|
1672
|
+
open: e(c),
|
|
1673
|
+
"onUpdate:open": z[3] || (z[3] = (S) => Ie(c) ? c.value = S : null),
|
|
2238
1674
|
title: e(t)("tag.new-title"),
|
|
2239
1675
|
width: 440
|
|
2240
1676
|
}, {
|
|
2241
1677
|
footer: i(() => [
|
|
2242
|
-
|
|
1678
|
+
r(e(De), { size: "sm" }, {
|
|
2243
1679
|
default: i(() => [
|
|
2244
|
-
|
|
1680
|
+
r(e(H), {
|
|
2245
1681
|
variant: "outline",
|
|
2246
|
-
onClick:
|
|
1682
|
+
onClick: z[2] || (z[2] = (S) => e(g)())
|
|
2247
1683
|
}, {
|
|
2248
1684
|
default: i(() => [
|
|
2249
|
-
|
|
1685
|
+
V(_(e(t)("tag.cancel")), 1)
|
|
2250
1686
|
]),
|
|
2251
1687
|
_: 1
|
|
2252
1688
|
}),
|
|
2253
|
-
|
|
1689
|
+
r(e(H), {
|
|
2254
1690
|
type: "primary",
|
|
2255
|
-
loading:
|
|
2256
|
-
disabled:
|
|
2257
|
-
onClick:
|
|
1691
|
+
loading: y.value,
|
|
1692
|
+
disabled: o.value.trim() === "",
|
|
1693
|
+
onClick: m
|
|
2258
1694
|
}, {
|
|
2259
1695
|
default: i(() => [
|
|
2260
|
-
|
|
1696
|
+
V(_(e(t)("tag.create")), 1)
|
|
2261
1697
|
]),
|
|
2262
1698
|
_: 1
|
|
2263
1699
|
}, 8, ["loading", "disabled"])
|
|
@@ -2266,37 +1702,37 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
2266
1702
|
})
|
|
2267
1703
|
]),
|
|
2268
1704
|
default: i(() => [
|
|
2269
|
-
|
|
1705
|
+
r(e(de), {
|
|
2270
1706
|
label: e(t)("tag.field-title"),
|
|
2271
|
-
error:
|
|
1707
|
+
error: f.value.title?.[0],
|
|
2272
1708
|
required: ""
|
|
2273
1709
|
}, {
|
|
2274
1710
|
default: i(() => [
|
|
2275
|
-
|
|
1711
|
+
O("div", {
|
|
2276
1712
|
ref_key: "field",
|
|
2277
|
-
ref:
|
|
1713
|
+
ref: $
|
|
2278
1714
|
}, [
|
|
2279
|
-
|
|
2280
|
-
modelValue:
|
|
2281
|
-
"onUpdate:modelValue":
|
|
1715
|
+
r(e(We), {
|
|
1716
|
+
modelValue: o.value,
|
|
1717
|
+
"onUpdate:modelValue": z[0] || (z[0] = (S) => o.value = S),
|
|
2282
1718
|
"aria-label": e(t)("tag.field-title"),
|
|
2283
|
-
onKeyup:
|
|
1719
|
+
onKeyup: ze(m, ["enter"])
|
|
2284
1720
|
}, null, 8, ["modelValue", "aria-label"])
|
|
2285
1721
|
], 512)
|
|
2286
1722
|
]),
|
|
2287
1723
|
_: 1
|
|
2288
1724
|
}, 8, ["label", "error"]),
|
|
2289
|
-
|
|
1725
|
+
r(e(de), {
|
|
2290
1726
|
label: e(t)("tag.field-slug"),
|
|
2291
|
-
error:
|
|
1727
|
+
error: f.value.slug?.[0],
|
|
2292
1728
|
help: e(t)("tag.field-slug-help")
|
|
2293
1729
|
}, {
|
|
2294
1730
|
default: i(() => [
|
|
2295
|
-
|
|
2296
|
-
modelValue:
|
|
2297
|
-
"onUpdate:modelValue":
|
|
1731
|
+
r(e(We), {
|
|
1732
|
+
modelValue: l.value,
|
|
1733
|
+
"onUpdate:modelValue": z[1] || (z[1] = (S) => l.value = S),
|
|
2298
1734
|
"aria-label": e(t)("tag.field-slug"),
|
|
2299
|
-
onKeyup:
|
|
1735
|
+
onKeyup: ze(m, ["enter"])
|
|
2300
1736
|
}, null, 8, ["modelValue", "aria-label"])
|
|
2301
1737
|
]),
|
|
2302
1738
|
_: 1
|
|
@@ -2305,54 +1741,54 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
2305
1741
|
_: 1
|
|
2306
1742
|
}, 8, ["open", "title"]));
|
|
2307
1743
|
}
|
|
2308
|
-
}),
|
|
1744
|
+
}), fa = ["id"], ma = /* @__PURE__ */ Q({
|
|
2309
1745
|
__name: "TagRenameDialog",
|
|
2310
1746
|
props: {
|
|
2311
1747
|
name: {}
|
|
2312
1748
|
},
|
|
2313
|
-
setup(
|
|
2314
|
-
const
|
|
2315
|
-
|
|
2316
|
-
const
|
|
2317
|
-
|
|
2318
|
-
await
|
|
2319
|
-
const
|
|
2320
|
-
|
|
1749
|
+
setup(v) {
|
|
1750
|
+
const c = v, { open: p, resolve: g, dismiss: a } = Pe();
|
|
1751
|
+
X();
|
|
1752
|
+
const s = J("webx-blog"), t = J("webx-admin"), o = mt(), l = M(c.name), y = qe("field");
|
|
1753
|
+
Ue(async () => {
|
|
1754
|
+
await Ke();
|
|
1755
|
+
const $ = y.value?.querySelector("input");
|
|
1756
|
+
$?.focus(), $?.select();
|
|
2321
1757
|
});
|
|
2322
|
-
function
|
|
2323
|
-
const
|
|
2324
|
-
if (
|
|
2325
|
-
|
|
1758
|
+
function f() {
|
|
1759
|
+
const $ = l.value.trim();
|
|
1760
|
+
if ($ === "" || $ === c.name) {
|
|
1761
|
+
a();
|
|
2326
1762
|
return;
|
|
2327
1763
|
}
|
|
2328
|
-
|
|
1764
|
+
g($);
|
|
2329
1765
|
}
|
|
2330
|
-
return (
|
|
2331
|
-
open: e(
|
|
2332
|
-
"onUpdate:open":
|
|
2333
|
-
title: e(
|
|
1766
|
+
return ($, m) => (x(), I(e(Re), {
|
|
1767
|
+
open: e(p),
|
|
1768
|
+
"onUpdate:open": m[2] || (m[2] = (A) => Ie(p) ? p.value = A : null),
|
|
1769
|
+
title: e(s)("tag.rename"),
|
|
2334
1770
|
width: 420
|
|
2335
1771
|
}, {
|
|
2336
1772
|
footer: i(() => [
|
|
2337
|
-
|
|
1773
|
+
r(e(De), { size: "sm" }, {
|
|
2338
1774
|
default: i(() => [
|
|
2339
|
-
|
|
1775
|
+
r(e(H), {
|
|
2340
1776
|
variant: "outline",
|
|
2341
|
-
onClick:
|
|
1777
|
+
onClick: m[1] || (m[1] = (A) => e(a)())
|
|
2342
1778
|
}, {
|
|
2343
1779
|
default: i(() => [
|
|
2344
|
-
|
|
1780
|
+
V(_(e(s)("tag.cancel")), 1)
|
|
2345
1781
|
]),
|
|
2346
1782
|
_: 1
|
|
2347
1783
|
}),
|
|
2348
|
-
|
|
1784
|
+
r(e(H), {
|
|
2349
1785
|
type: "primary",
|
|
2350
1786
|
"native-type": "submit",
|
|
2351
|
-
form: e(
|
|
2352
|
-
disabled:
|
|
1787
|
+
form: e(o),
|
|
1788
|
+
disabled: l.value.trim() === ""
|
|
2353
1789
|
}, {
|
|
2354
1790
|
default: i(() => [
|
|
2355
|
-
|
|
1791
|
+
V(_(e(t)("editor.save")), 1)
|
|
2356
1792
|
]),
|
|
2357
1793
|
_: 1
|
|
2358
1794
|
}, 8, ["form", "disabled"])
|
|
@@ -2361,88 +1797,88 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
2361
1797
|
})
|
|
2362
1798
|
]),
|
|
2363
1799
|
default: i(() => [
|
|
2364
|
-
|
|
2365
|
-
id: e(
|
|
1800
|
+
O("form", {
|
|
1801
|
+
id: e(o),
|
|
2366
1802
|
ref_key: "field",
|
|
2367
|
-
ref:
|
|
2368
|
-
onSubmit:
|
|
1803
|
+
ref: y,
|
|
1804
|
+
onSubmit: je(f, ["prevent"])
|
|
2369
1805
|
}, [
|
|
2370
|
-
|
|
2371
|
-
label: e(
|
|
1806
|
+
r(e(de), {
|
|
1807
|
+
label: e(s)("tag.field-title"),
|
|
2372
1808
|
required: ""
|
|
2373
1809
|
}, {
|
|
2374
1810
|
default: i(() => [
|
|
2375
|
-
|
|
2376
|
-
modelValue:
|
|
2377
|
-
"onUpdate:modelValue":
|
|
2378
|
-
"aria-label": e(
|
|
2379
|
-
onKeydown:
|
|
1811
|
+
r(e(We), {
|
|
1812
|
+
modelValue: l.value,
|
|
1813
|
+
"onUpdate:modelValue": m[0] || (m[0] = (A) => l.value = A),
|
|
1814
|
+
"aria-label": e(s)("tag.field-title"),
|
|
1815
|
+
onKeydown: ze(je(f, ["prevent"]), ["enter"])
|
|
2380
1816
|
}, null, 8, ["modelValue", "aria-label", "onKeydown"])
|
|
2381
1817
|
]),
|
|
2382
1818
|
_: 1
|
|
2383
1819
|
}, 8, ["label"])
|
|
2384
|
-
], 40,
|
|
1820
|
+
], 40, fa)
|
|
2385
1821
|
]),
|
|
2386
1822
|
_: 1
|
|
2387
1823
|
}, 8, ["open", "title"]));
|
|
2388
1824
|
}
|
|
2389
|
-
}),
|
|
1825
|
+
}), ba = { class: "wx-tag-merge" }, ya = { class: "wx-tag-merge__chips" }, wa = { class: "wx-tag-merge__redirect" }, xa = /* @__PURE__ */ Q({
|
|
2390
1826
|
__name: "TagMergeDialog",
|
|
2391
1827
|
props: {
|
|
2392
1828
|
tags: {}
|
|
2393
1829
|
},
|
|
2394
|
-
setup(
|
|
2395
|
-
const
|
|
2396
|
-
|
|
2397
|
-
const
|
|
2398
|
-
[...
|
|
2399
|
-
),
|
|
2400
|
-
() =>
|
|
2401
|
-
),
|
|
2402
|
-
async function
|
|
2403
|
-
if (!(
|
|
2404
|
-
|
|
1830
|
+
setup(v) {
|
|
1831
|
+
const c = v, { open: p, resolve: g, dismiss: a } = Pe(), s = le(), t = re(s);
|
|
1832
|
+
X();
|
|
1833
|
+
const o = J("webx-blog"), l = be(), y = M(
|
|
1834
|
+
[...c.tags].sort((W, U) => U.articles_count - W.articles_count)[0]?.id ?? 0
|
|
1835
|
+
), f = M(!1), $ = M(!0), m = M(null), A = h(
|
|
1836
|
+
() => c.tags.map((W) => ({ value: W.id, label: `${W.title} · ${W.articles_count}` }))
|
|
1837
|
+
), z = h(() => c.tags.find((W) => W.id === y.value) ?? null), S = h(() => c.tags.filter((W) => W.id !== y.value)), B = h(() => S.value.reduce((W, U) => W + U.articles_count, 0)), R = h(() => S.value.map((W) => W.path).filter(Boolean));
|
|
1838
|
+
async function w() {
|
|
1839
|
+
if (!(z.value === null || S.value.length === 0 || f.value)) {
|
|
1840
|
+
f.value = !0, m.value = null;
|
|
2405
1841
|
try {
|
|
2406
|
-
|
|
1842
|
+
g(
|
|
2407
1843
|
await t.mergeTags(
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
1844
|
+
S.value.map((W) => W.id),
|
|
1845
|
+
y.value,
|
|
1846
|
+
$.value
|
|
2411
1847
|
)
|
|
2412
1848
|
);
|
|
2413
|
-
} catch (
|
|
2414
|
-
|
|
1849
|
+
} catch (W) {
|
|
1850
|
+
m.value = l(W);
|
|
2415
1851
|
} finally {
|
|
2416
|
-
|
|
1852
|
+
f.value = !1;
|
|
2417
1853
|
}
|
|
2418
1854
|
}
|
|
2419
1855
|
}
|
|
2420
|
-
return (
|
|
2421
|
-
open: e(
|
|
2422
|
-
"onUpdate:open":
|
|
2423
|
-
title: e(
|
|
1856
|
+
return (W, U) => (x(), I(e(Re), {
|
|
1857
|
+
open: e(p),
|
|
1858
|
+
"onUpdate:open": U[3] || (U[3] = (N) => Ie(p) ? p.value = N : null),
|
|
1859
|
+
title: e(o)("tag.merge-title"),
|
|
2424
1860
|
width: 520
|
|
2425
1861
|
}, {
|
|
2426
1862
|
footer: i(() => [
|
|
2427
|
-
|
|
1863
|
+
r(e(De), { size: "sm" }, {
|
|
2428
1864
|
default: i(() => [
|
|
2429
|
-
|
|
1865
|
+
r(e(H), {
|
|
2430
1866
|
variant: "outline",
|
|
2431
|
-
onClick:
|
|
1867
|
+
onClick: U[2] || (U[2] = (N) => e(a)())
|
|
2432
1868
|
}, {
|
|
2433
1869
|
default: i(() => [
|
|
2434
|
-
|
|
1870
|
+
V(_(e(o)("tag.cancel")), 1)
|
|
2435
1871
|
]),
|
|
2436
1872
|
_: 1
|
|
2437
1873
|
}),
|
|
2438
|
-
|
|
1874
|
+
r(e(H), {
|
|
2439
1875
|
type: "primary",
|
|
2440
|
-
loading:
|
|
2441
|
-
disabled:
|
|
2442
|
-
onClick:
|
|
1876
|
+
loading: f.value,
|
|
1877
|
+
disabled: S.value.length === 0,
|
|
1878
|
+
onClick: w
|
|
2443
1879
|
}, {
|
|
2444
1880
|
default: i(() => [
|
|
2445
|
-
|
|
1881
|
+
V(_(e(o)("tag.merge-confirm")), 1)
|
|
2446
1882
|
]),
|
|
2447
1883
|
_: 1
|
|
2448
1884
|
}, 8, ["loading", "disabled"])
|
|
@@ -2451,105 +1887,105 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
2451
1887
|
})
|
|
2452
1888
|
]),
|
|
2453
1889
|
default: i(() => [
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
(
|
|
1890
|
+
O("div", ba, [
|
|
1891
|
+
O("div", ya, [
|
|
1892
|
+
(x(!0), K(ke, null, Ne(S.value, (N) => (x(), I(e(ae), {
|
|
2457
1893
|
key: N.id,
|
|
2458
1894
|
size: "sm",
|
|
2459
1895
|
round: ""
|
|
2460
1896
|
}, {
|
|
2461
1897
|
default: i(() => [
|
|
2462
|
-
|
|
1898
|
+
V(_(N.title) + " · " + _(N.articles_count), 1)
|
|
2463
1899
|
]),
|
|
2464
1900
|
_: 2
|
|
2465
1901
|
}, 1024))), 128)),
|
|
2466
|
-
|
|
1902
|
+
r(e(Te), {
|
|
2467
1903
|
name: "arrow-right",
|
|
2468
1904
|
size: "sm"
|
|
2469
1905
|
}),
|
|
2470
|
-
|
|
1906
|
+
z.value ? (x(), I(e(ae), {
|
|
2471
1907
|
key: 0,
|
|
2472
1908
|
type: "primary",
|
|
2473
1909
|
size: "sm",
|
|
2474
1910
|
round: ""
|
|
2475
1911
|
}, {
|
|
2476
1912
|
default: i(() => [
|
|
2477
|
-
|
|
1913
|
+
V(_(z.value.title) + " · " + _(z.value.articles_count), 1)
|
|
2478
1914
|
]),
|
|
2479
1915
|
_: 1
|
|
2480
|
-
})) :
|
|
1916
|
+
})) : L("", !0)
|
|
2481
1917
|
]),
|
|
2482
|
-
|
|
2483
|
-
label: e(
|
|
1918
|
+
r(e(de), {
|
|
1919
|
+
label: e(o)("tag.merge-keep")
|
|
2484
1920
|
}, {
|
|
2485
1921
|
default: i(() => [
|
|
2486
|
-
|
|
2487
|
-
modelValue:
|
|
2488
|
-
"onUpdate:modelValue":
|
|
2489
|
-
options:
|
|
2490
|
-
"aria-label": e(
|
|
1922
|
+
r(e(_e), {
|
|
1923
|
+
modelValue: y.value,
|
|
1924
|
+
"onUpdate:modelValue": U[0] || (U[0] = (N) => y.value = N),
|
|
1925
|
+
options: A.value,
|
|
1926
|
+
"aria-label": e(o)("tag.merge-keep")
|
|
2491
1927
|
}, null, 8, ["modelValue", "options", "aria-label"])
|
|
2492
1928
|
]),
|
|
2493
1929
|
_: 1
|
|
2494
1930
|
}, 8, ["label"]),
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
modelValue:
|
|
2498
|
-
"onUpdate:modelValue":
|
|
2499
|
-
label: e(
|
|
1931
|
+
O("div", wa, [
|
|
1932
|
+
r(e(At), {
|
|
1933
|
+
modelValue: $.value,
|
|
1934
|
+
"onUpdate:modelValue": U[1] || (U[1] = (N) => $.value = N),
|
|
1935
|
+
label: e(o)("tag.merge-redirect")
|
|
2500
1936
|
}, null, 8, ["modelValue", "label"]),
|
|
2501
|
-
|
|
1937
|
+
r(e(te), {
|
|
2502
1938
|
size: "sm",
|
|
2503
1939
|
tone: "muted"
|
|
2504
1940
|
}, {
|
|
2505
1941
|
default: i(() => [
|
|
2506
|
-
|
|
1942
|
+
V(_(R.value.length === 0 ? e(o)("tag.merge-redirect-none") : e(o)("tag.merge-redirect-help", { addresses: R.value.join(", ") })), 1)
|
|
2507
1943
|
]),
|
|
2508
1944
|
_: 1
|
|
2509
1945
|
})
|
|
2510
1946
|
]),
|
|
2511
|
-
|
|
1947
|
+
r(e(Me), {
|
|
2512
1948
|
type: "warning",
|
|
2513
1949
|
variant: "soft",
|
|
2514
|
-
description: e(
|
|
2515
|
-
count:
|
|
2516
|
-
tag:
|
|
2517
|
-
merged:
|
|
1950
|
+
description: e(o)("tag.merge-warning", {
|
|
1951
|
+
count: B.value,
|
|
1952
|
+
tag: z.value?.title ?? "",
|
|
1953
|
+
merged: S.value.length
|
|
2518
1954
|
})
|
|
2519
1955
|
}, null, 8, ["description"]),
|
|
2520
|
-
|
|
1956
|
+
m.value ? (x(), I(e(Me), {
|
|
2521
1957
|
key: 0,
|
|
2522
1958
|
type: "danger",
|
|
2523
1959
|
variant: "soft",
|
|
2524
|
-
description:
|
|
2525
|
-
}, null, 8, ["description"])) :
|
|
1960
|
+
description: m.value
|
|
1961
|
+
}, null, 8, ["description"])) : L("", !0)
|
|
2526
1962
|
])
|
|
2527
1963
|
]),
|
|
2528
1964
|
_: 1
|
|
2529
1965
|
}, 8, ["open", "title"]));
|
|
2530
1966
|
}
|
|
2531
|
-
}),
|
|
1967
|
+
}), _a = /* @__PURE__ */ ve(xa, [["__scopeId", "data-v-aa68b3a8"]]), ka = { class: "wx-tags" }, $a = /* @__PURE__ */ Q({
|
|
2532
1968
|
__name: "TagsPage",
|
|
2533
1969
|
props: {
|
|
2534
1970
|
base: { default: "/blog" }
|
|
2535
1971
|
},
|
|
2536
|
-
setup(
|
|
2537
|
-
const
|
|
2538
|
-
|
|
2539
|
-
const t =
|
|
2540
|
-
() =>
|
|
2541
|
-
),
|
|
2542
|
-
get: () => typeof
|
|
2543
|
-
set: (
|
|
2544
|
-
|
|
2545
|
-
query: { ...
|
|
1972
|
+
setup(v) {
|
|
1973
|
+
const c = v, p = le(), g = re(p), a = He(), s = Ge();
|
|
1974
|
+
X();
|
|
1975
|
+
const t = J("webx-blog"), o = be(), l = M(null), y = M(!0), f = M([]), $ = M(!1), m = Ce(ma), A = Ce(ha), z = Ce(_a), S = h(() => p.can("blog.taxonomy.manage")), B = h(
|
|
1976
|
+
() => p.state.manifest?.modules.find((u) => u.id === "tags")?.title ?? t("module.tags")
|
|
1977
|
+
), R = h({
|
|
1978
|
+
get: () => typeof a.query.view == "string" ? a.query.view : "",
|
|
1979
|
+
set: (u) => {
|
|
1980
|
+
s.replace({
|
|
1981
|
+
query: { ...a.query, view: u === "" ? void 0 : String(u), page: void 0 }
|
|
2546
1982
|
});
|
|
2547
1983
|
}
|
|
2548
|
-
}),
|
|
2549
|
-
{ value: "", label: t("tag.view-all"), badge:
|
|
2550
|
-
{ value: "empty", label: t("tag.view-empty"), badge:
|
|
2551
|
-
{ value: "noindex", label: t("tag.view-noindex"), badge:
|
|
2552
|
-
]),
|
|
1984
|
+
}), w = h(() => l.value?.filters ?? { total: 0, empty: 0, noindex: 0 }), W = h(() => [
|
|
1985
|
+
{ value: "", label: t("tag.view-all"), badge: w.value.total },
|
|
1986
|
+
{ value: "empty", label: t("tag.view-empty"), badge: w.value.empty },
|
|
1987
|
+
{ value: "noindex", label: t("tag.view-noindex"), badge: w.value.noindex }
|
|
1988
|
+
]), U = h(() => l.value?.data ?? []), N = h(() => U.value.filter((u) => f.value.includes(u.id))), k = h(() => [
|
|
2553
1989
|
{ key: "title", label: t("tag.column-title"), minWidth: 150, sortable: !0 },
|
|
2554
1990
|
// The number is what the other columns and the narrowest the title may be add up to without
|
|
2555
1991
|
// this one: below it the address is what does not fit, and a fixed table does not shrink —
|
|
@@ -2567,106 +2003,106 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
2567
2003
|
// at 180px of text, and a cell keeps 32 of its own. Narrower, the ruled row wrapped and
|
|
2568
2004
|
// stood eighteen pixels taller than the ones around it.
|
|
2569
2005
|
{ key: "indexing", label: t("tag.column-indexing"), width: 230, hideBelow: 560 },
|
|
2570
|
-
{ key: "actions", label: "", width:
|
|
2006
|
+
{ key: "actions", label: "", width: Xe, align: "right" }
|
|
2571
2007
|
]);
|
|
2572
|
-
function
|
|
2008
|
+
function P(u) {
|
|
2573
2009
|
return {
|
|
2574
|
-
q:
|
|
2575
|
-
empty:
|
|
2576
|
-
noindex:
|
|
2010
|
+
q: u?.search ?? (typeof a.query.q == "string" ? a.query.q : ""),
|
|
2011
|
+
empty: R.value === "empty",
|
|
2012
|
+
noindex: R.value === "noindex",
|
|
2577
2013
|
// Only when it is not the default: most used first is what the list is, and a query
|
|
2578
2014
|
// string that repeats the default is a link that outlives a change of mind about it.
|
|
2579
|
-
sort:
|
|
2580
|
-
page:
|
|
2581
|
-
per_page:
|
|
2015
|
+
sort: ie(u),
|
|
2016
|
+
page: u?.page ?? (Number(a.query.page ?? 1) || 1),
|
|
2017
|
+
per_page: u?.perPage
|
|
2582
2018
|
};
|
|
2583
2019
|
}
|
|
2584
|
-
async function
|
|
2585
|
-
|
|
2020
|
+
async function E(u) {
|
|
2021
|
+
y.value = !0;
|
|
2586
2022
|
try {
|
|
2587
|
-
|
|
2588
|
-
} catch (
|
|
2589
|
-
|
|
2023
|
+
l.value = await g.tagsPage(P(u));
|
|
2024
|
+
} catch (T) {
|
|
2025
|
+
D.danger(o(T));
|
|
2590
2026
|
} finally {
|
|
2591
|
-
|
|
2027
|
+
y.value = !1;
|
|
2592
2028
|
}
|
|
2593
2029
|
}
|
|
2594
|
-
function
|
|
2595
|
-
const
|
|
2596
|
-
if (!
|
|
2597
|
-
const
|
|
2598
|
-
return
|
|
2599
|
-
}
|
|
2600
|
-
function
|
|
2601
|
-
const
|
|
2602
|
-
if (
|
|
2603
|
-
const
|
|
2604
|
-
return { key: (
|
|
2605
|
-
}
|
|
2606
|
-
function
|
|
2607
|
-
const
|
|
2608
|
-
...
|
|
2609
|
-
q:
|
|
2610
|
-
sort:
|
|
2611
|
-
page:
|
|
2030
|
+
function ie(u) {
|
|
2031
|
+
const T = u?.sort ?? Y();
|
|
2032
|
+
if (!T) return;
|
|
2033
|
+
const C = T.key === "title" ? "name" : "articles", G = `${T.order === "desc" ? "-" : ""}${C}`;
|
|
2034
|
+
return G === "articles" ? void 0 : G;
|
|
2035
|
+
}
|
|
2036
|
+
function Y() {
|
|
2037
|
+
const u = typeof a.query.sort == "string" ? a.query.sort : "";
|
|
2038
|
+
if (u === "") return null;
|
|
2039
|
+
const T = u.startsWith("-");
|
|
2040
|
+
return { key: (T ? u.slice(1) : u) === "name" ? "title" : "articles_count", order: T ? "desc" : "asc" };
|
|
2041
|
+
}
|
|
2042
|
+
function ne(u) {
|
|
2043
|
+
const T = {
|
|
2044
|
+
...a.query,
|
|
2045
|
+
q: u.search === "" ? void 0 : u.search,
|
|
2046
|
+
sort: ie(u),
|
|
2047
|
+
page: u.page === 1 ? void 0 : String(u.page)
|
|
2612
2048
|
};
|
|
2613
|
-
|
|
2049
|
+
s.replace({ query: T }), E(u);
|
|
2614
2050
|
}
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
}),
|
|
2618
|
-
async function
|
|
2619
|
-
await
|
|
2051
|
+
pe(R, () => {
|
|
2052
|
+
f.value = [], E();
|
|
2053
|
+
}), E();
|
|
2054
|
+
async function ge() {
|
|
2055
|
+
await A({}) && await E();
|
|
2620
2056
|
}
|
|
2621
|
-
async function
|
|
2622
|
-
const
|
|
2623
|
-
|
|
2057
|
+
async function F(u) {
|
|
2058
|
+
const T = await m({ name: u.title });
|
|
2059
|
+
T && await ye(u, { title: T }, t("tag.renamed"));
|
|
2624
2060
|
}
|
|
2625
|
-
async function
|
|
2626
|
-
await
|
|
2061
|
+
async function he(u, T) {
|
|
2062
|
+
await ye(u, { noindex: T }, t(T ? "tag.kept-out" : "tag.indexed"));
|
|
2627
2063
|
}
|
|
2628
|
-
async function
|
|
2064
|
+
async function ye(u, T, C) {
|
|
2629
2065
|
try {
|
|
2630
|
-
const
|
|
2631
|
-
|
|
2632
|
-
...
|
|
2633
|
-
data:
|
|
2634
|
-
}),
|
|
2635
|
-
} catch (
|
|
2636
|
-
|
|
2066
|
+
const G = await g.saveTag(u.id, T);
|
|
2067
|
+
l.value && (l.value = {
|
|
2068
|
+
...l.value,
|
|
2069
|
+
data: l.value.data.map((me) => me.id === G.id ? G : me)
|
|
2070
|
+
}), D.success(C);
|
|
2071
|
+
} catch (G) {
|
|
2072
|
+
D.danger(o(G));
|
|
2637
2073
|
}
|
|
2638
2074
|
}
|
|
2639
|
-
async function
|
|
2640
|
-
if (await
|
|
2641
|
-
title: t("tag.delete-title", { title:
|
|
2642
|
-
message:
|
|
2075
|
+
async function se(u) {
|
|
2076
|
+
if (await ce({
|
|
2077
|
+
title: t("tag.delete-title", { title: u.title }),
|
|
2078
|
+
message: u.articles_count > 0 ? t("tag.delete-text-used", { count: u.articles_count }) : t("tag.delete-text"),
|
|
2643
2079
|
confirmText: t("tag.delete"),
|
|
2644
2080
|
cancelText: t("tag.cancel"),
|
|
2645
2081
|
tone: "danger"
|
|
2646
2082
|
}))
|
|
2647
2083
|
try {
|
|
2648
|
-
await
|
|
2649
|
-
} catch (
|
|
2650
|
-
|
|
2084
|
+
await g.removeTag(u.id), D.success(t("tag.deleted")), f.value = f.value.filter((C) => C !== u.id), await E();
|
|
2085
|
+
} catch (C) {
|
|
2086
|
+
D.danger(o(C));
|
|
2651
2087
|
}
|
|
2652
2088
|
}
|
|
2653
|
-
const
|
|
2089
|
+
const fe = h(() => [
|
|
2654
2090
|
{
|
|
2655
2091
|
key: "index",
|
|
2656
2092
|
icon: "eye",
|
|
2657
2093
|
label: t("tag.index"),
|
|
2658
|
-
disabled:
|
|
2094
|
+
disabled: $.value,
|
|
2659
2095
|
run: () => {
|
|
2660
|
-
|
|
2096
|
+
ee("index");
|
|
2661
2097
|
}
|
|
2662
2098
|
},
|
|
2663
2099
|
{
|
|
2664
2100
|
key: "noindex",
|
|
2665
2101
|
icon: "eye-off",
|
|
2666
2102
|
label: t("tag.noindex"),
|
|
2667
|
-
disabled:
|
|
2103
|
+
disabled: $.value,
|
|
2668
2104
|
run: () => {
|
|
2669
|
-
|
|
2105
|
+
ee("noindex");
|
|
2670
2106
|
}
|
|
2671
2107
|
},
|
|
2672
2108
|
{
|
|
@@ -2674,186 +2110,186 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
2674
2110
|
icon: "trash",
|
|
2675
2111
|
label: t("tag.delete"),
|
|
2676
2112
|
danger: !0,
|
|
2677
|
-
disabled:
|
|
2113
|
+
disabled: $.value,
|
|
2678
2114
|
run: () => {
|
|
2679
|
-
|
|
2115
|
+
ee("delete");
|
|
2680
2116
|
}
|
|
2681
2117
|
}
|
|
2682
2118
|
]);
|
|
2683
|
-
function
|
|
2684
|
-
if (!
|
|
2685
|
-
const
|
|
2119
|
+
function Se(u) {
|
|
2120
|
+
if (!S.value) return [];
|
|
2121
|
+
const T = [
|
|
2686
2122
|
{ key: "rename", icon: "edit", label: t("tag.rename"), run: () => {
|
|
2687
|
-
|
|
2123
|
+
F(u);
|
|
2688
2124
|
} }
|
|
2689
2125
|
];
|
|
2690
|
-
return
|
|
2126
|
+
return u.url && T.push({
|
|
2691
2127
|
key: "site",
|
|
2692
2128
|
icon: "external-link",
|
|
2693
2129
|
label: t("tag.open-on-site"),
|
|
2694
|
-
href:
|
|
2695
|
-
}),
|
|
2130
|
+
href: u.url
|
|
2131
|
+
}), T.push({
|
|
2696
2132
|
key: "articles",
|
|
2697
2133
|
icon: "list",
|
|
2698
2134
|
label: t("tag.show-articles"),
|
|
2699
2135
|
run: () => {
|
|
2700
|
-
|
|
2136
|
+
s.push({ path: `${c.base}/articles`, query: { tag: String(u.id) } });
|
|
2701
2137
|
}
|
|
2702
|
-
}),
|
|
2703
|
-
|
|
2138
|
+
}), T.push(
|
|
2139
|
+
u.noindex ? {
|
|
2704
2140
|
key: "index",
|
|
2705
2141
|
icon: "eye",
|
|
2706
2142
|
label: t("tag.index"),
|
|
2707
2143
|
run: () => {
|
|
2708
|
-
|
|
2144
|
+
he(u, !1);
|
|
2709
2145
|
}
|
|
2710
2146
|
} : {
|
|
2711
2147
|
key: "noindex",
|
|
2712
2148
|
icon: "eye-off",
|
|
2713
2149
|
label: t("tag.noindex"),
|
|
2714
2150
|
run: () => {
|
|
2715
|
-
|
|
2151
|
+
he(u, !0);
|
|
2716
2152
|
}
|
|
2717
2153
|
}
|
|
2718
|
-
),
|
|
2154
|
+
), T.push({
|
|
2719
2155
|
key: "delete",
|
|
2720
2156
|
icon: "trash",
|
|
2721
2157
|
label: t("tag.delete"),
|
|
2722
2158
|
danger: !0,
|
|
2723
2159
|
run: () => {
|
|
2724
|
-
|
|
2160
|
+
se(u);
|
|
2725
2161
|
}
|
|
2726
|
-
}),
|
|
2162
|
+
}), T;
|
|
2727
2163
|
}
|
|
2728
|
-
function
|
|
2729
|
-
return
|
|
2164
|
+
function we(u) {
|
|
2165
|
+
return u === "noindex" ? "muted" : "success";
|
|
2730
2166
|
}
|
|
2731
|
-
async function
|
|
2167
|
+
async function oe() {
|
|
2732
2168
|
if (N.value.length < 2) return;
|
|
2733
|
-
const
|
|
2734
|
-
|
|
2735
|
-
}
|
|
2736
|
-
async function
|
|
2737
|
-
const
|
|
2738
|
-
if (!(
|
|
2739
|
-
if (
|
|
2740
|
-
const
|
|
2741
|
-
if (!await
|
|
2742
|
-
title: t("tag.delete-many-title", { count:
|
|
2743
|
-
message:
|
|
2169
|
+
const u = await z({ tags: N.value });
|
|
2170
|
+
u && (D.success(t("tag.merged", { tag: u.tag.title, count: u.articles_count })), f.value = [], await E());
|
|
2171
|
+
}
|
|
2172
|
+
async function ee(u) {
|
|
2173
|
+
const T = N.value.map((C) => C.id);
|
|
2174
|
+
if (!(T.length === 0 || $.value)) {
|
|
2175
|
+
if (u === "delete") {
|
|
2176
|
+
const C = N.value.reduce((me, n) => me + n.articles_count, 0);
|
|
2177
|
+
if (!await ce({
|
|
2178
|
+
title: t("tag.delete-many-title", { count: T.length }),
|
|
2179
|
+
message: C > 0 ? t("tag.delete-many-text-used", { count: C }) : t("tag.delete-many-text"),
|
|
2744
2180
|
confirmText: t("tag.delete"),
|
|
2745
2181
|
cancelText: t("tag.cancel"),
|
|
2746
2182
|
tone: "danger"
|
|
2747
2183
|
})) return;
|
|
2748
2184
|
}
|
|
2749
|
-
|
|
2185
|
+
$.value = !0;
|
|
2750
2186
|
try {
|
|
2751
|
-
const
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
),
|
|
2755
|
-
} catch (
|
|
2756
|
-
|
|
2187
|
+
const C = await g.massTags(T, u);
|
|
2188
|
+
D.success(
|
|
2189
|
+
u === "delete" ? t("tag.deleted-many", { count: C }) : u === "index" ? t("tag.indexed-many", { count: C }) : t("tag.kept-out-many", { count: C })
|
|
2190
|
+
), f.value = [], await E();
|
|
2191
|
+
} catch (C) {
|
|
2192
|
+
D.danger(o(C));
|
|
2757
2193
|
} finally {
|
|
2758
|
-
|
|
2194
|
+
$.value = !1;
|
|
2759
2195
|
}
|
|
2760
2196
|
}
|
|
2761
2197
|
}
|
|
2762
|
-
const
|
|
2763
|
-
() =>
|
|
2764
|
-
|
|
2198
|
+
const ue = h(
|
|
2199
|
+
() => S.value ? [{ key: "new", label: t("tag.new"), icon: "plus", primary: !0, run: () => {
|
|
2200
|
+
ge();
|
|
2765
2201
|
} }] : []
|
|
2766
2202
|
);
|
|
2767
|
-
return (
|
|
2768
|
-
|
|
2769
|
-
view:
|
|
2770
|
-
"onUpdate:view":
|
|
2771
|
-
title:
|
|
2772
|
-
views:
|
|
2773
|
-
actions:
|
|
2203
|
+
return (u, T) => (x(), K("div", ka, [
|
|
2204
|
+
r(e(Ye), {
|
|
2205
|
+
view: R.value,
|
|
2206
|
+
"onUpdate:view": T[1] || (T[1] = (C) => R.value = C),
|
|
2207
|
+
title: B.value,
|
|
2208
|
+
views: W.value,
|
|
2209
|
+
actions: ue.value
|
|
2774
2210
|
}, {
|
|
2775
2211
|
default: i(() => [
|
|
2776
|
-
|
|
2777
|
-
selected:
|
|
2778
|
-
"onUpdate:selected":
|
|
2779
|
-
data:
|
|
2780
|
-
columns:
|
|
2212
|
+
r(e(lt), {
|
|
2213
|
+
selected: f.value,
|
|
2214
|
+
"onUpdate:selected": T[0] || (T[0] = (C) => f.value = C),
|
|
2215
|
+
data: l.value,
|
|
2216
|
+
columns: k.value,
|
|
2781
2217
|
"row-key": "id",
|
|
2782
2218
|
searchable: "",
|
|
2783
2219
|
hover: "",
|
|
2784
2220
|
flush: "",
|
|
2785
2221
|
layout: "fixed",
|
|
2786
|
-
loading:
|
|
2787
|
-
selectable:
|
|
2222
|
+
loading: y.value,
|
|
2223
|
+
selectable: S.value,
|
|
2788
2224
|
"cards-below": 0,
|
|
2789
2225
|
"search-placeholder": e(t)("tag.search"),
|
|
2790
|
-
"empty-text":
|
|
2791
|
-
"aria-label":
|
|
2792
|
-
onStateChange:
|
|
2226
|
+
"empty-text": U.value.length === 0 && !y.value ? e(t)("tag.empty") : void 0,
|
|
2227
|
+
"aria-label": B.value,
|
|
2228
|
+
onStateChange: ne
|
|
2793
2229
|
}, {
|
|
2794
|
-
"cell-title": i(({ row:
|
|
2795
|
-
|
|
2230
|
+
"cell-title": i(({ row: C }) => [
|
|
2231
|
+
r(e(te), { truncate: "" }, {
|
|
2796
2232
|
default: i(() => [
|
|
2797
|
-
|
|
2233
|
+
V(_(C.title), 1)
|
|
2798
2234
|
]),
|
|
2799
2235
|
_: 2
|
|
2800
2236
|
}, 1024)
|
|
2801
2237
|
]),
|
|
2802
|
-
"cell-path": i(({ row:
|
|
2803
|
-
|
|
2238
|
+
"cell-path": i(({ row: C }) => [
|
|
2239
|
+
r(e(te), {
|
|
2804
2240
|
size: "sm",
|
|
2805
2241
|
tone: "muted",
|
|
2806
2242
|
mono: "",
|
|
2807
2243
|
truncate: ""
|
|
2808
2244
|
}, {
|
|
2809
2245
|
default: i(() => [
|
|
2810
|
-
|
|
2246
|
+
V(_(C.path ?? e(t)("tag.no-address")), 1)
|
|
2811
2247
|
]),
|
|
2812
2248
|
_: 2
|
|
2813
2249
|
}, 1024)
|
|
2814
2250
|
]),
|
|
2815
|
-
"cell-articles_count": i(({ row:
|
|
2816
|
-
|
|
2817
|
-
tone:
|
|
2251
|
+
"cell-articles_count": i(({ row: C }) => [
|
|
2252
|
+
r(e(te), {
|
|
2253
|
+
tone: C.articles_count === 0 ? "muted" : "default"
|
|
2818
2254
|
}, {
|
|
2819
2255
|
default: i(() => [
|
|
2820
|
-
|
|
2256
|
+
V(_(C.articles_count), 1)
|
|
2821
2257
|
]),
|
|
2822
2258
|
_: 2
|
|
2823
2259
|
}, 1032, ["tone"])
|
|
2824
2260
|
]),
|
|
2825
|
-
"cell-indexing": i(({ row:
|
|
2826
|
-
|
|
2261
|
+
"cell-indexing": i(({ row: C }) => [
|
|
2262
|
+
C.indexing === "rule" ? (x(), I(e(it), {
|
|
2827
2263
|
key: 0,
|
|
2828
2264
|
content: e(t)("tag.indexing-rule-help")
|
|
2829
2265
|
}, {
|
|
2830
2266
|
default: i(() => [
|
|
2831
|
-
|
|
2267
|
+
r(e(te), {
|
|
2832
2268
|
size: "sm",
|
|
2833
|
-
tone:
|
|
2269
|
+
tone: we(C.indexing)
|
|
2834
2270
|
}, {
|
|
2835
2271
|
default: i(() => [
|
|
2836
|
-
|
|
2272
|
+
V(_(e(t)("tag.indexing-rule")), 1)
|
|
2837
2273
|
]),
|
|
2838
2274
|
_: 1
|
|
2839
2275
|
}, 8, ["tone"])
|
|
2840
2276
|
]),
|
|
2841
2277
|
_: 2
|
|
2842
|
-
}, 1032, ["content"])) : (
|
|
2278
|
+
}, 1032, ["content"])) : (x(), I(e(te), {
|
|
2843
2279
|
key: 1,
|
|
2844
2280
|
size: "sm",
|
|
2845
|
-
tone:
|
|
2281
|
+
tone: we(C.indexing)
|
|
2846
2282
|
}, {
|
|
2847
2283
|
default: i(() => [
|
|
2848
|
-
|
|
2284
|
+
V(_(e(t)(`tag.indexing-${C.indexing}`)), 1)
|
|
2849
2285
|
]),
|
|
2850
2286
|
_: 2
|
|
2851
2287
|
}, 1032, ["tone"]))
|
|
2852
2288
|
]),
|
|
2853
|
-
"cell-actions": i(({ row:
|
|
2854
|
-
|
|
2855
|
-
actions:
|
|
2856
|
-
label:
|
|
2289
|
+
"cell-actions": i(({ row: C }) => [
|
|
2290
|
+
r(e(Ve), {
|
|
2291
|
+
actions: Se(C),
|
|
2292
|
+
label: C.title
|
|
2857
2293
|
}, null, 8, ["actions", "label"])
|
|
2858
2294
|
]),
|
|
2859
2295
|
_: 1
|
|
@@ -2861,71 +2297,100 @@ const It = { class: "wx-article-editor__screen" }, Pt = 1200, Bt = /* @__PURE__
|
|
|
2861
2297
|
]),
|
|
2862
2298
|
_: 1
|
|
2863
2299
|
}, 8, ["view", "title", "views", "actions"]),
|
|
2864
|
-
N.value.length > 0 ? (
|
|
2300
|
+
N.value.length > 0 ? (x(), I(e(at), {
|
|
2865
2301
|
key: 0,
|
|
2866
2302
|
class: "wx-tags__bar",
|
|
2867
2303
|
sticky: ""
|
|
2868
2304
|
}, {
|
|
2869
2305
|
state: i(() => [
|
|
2870
|
-
|
|
2306
|
+
r(e(te), { weight: "medium" }, {
|
|
2871
2307
|
default: i(() => [
|
|
2872
|
-
|
|
2308
|
+
V(_(e(t)("tag.selected", { count: N.value.length })), 1)
|
|
2873
2309
|
]),
|
|
2874
2310
|
_: 1
|
|
2875
2311
|
})
|
|
2876
2312
|
]),
|
|
2877
2313
|
default: i(() => [
|
|
2878
|
-
|
|
2314
|
+
r(e(H), {
|
|
2879
2315
|
type: "primary",
|
|
2880
|
-
disabled: N.value.length < 2 ||
|
|
2881
|
-
onClick:
|
|
2316
|
+
disabled: N.value.length < 2 || $.value,
|
|
2317
|
+
onClick: oe
|
|
2882
2318
|
}, {
|
|
2883
2319
|
icon: i(() => [
|
|
2884
|
-
|
|
2320
|
+
r(e(Te), { name: "link" })
|
|
2885
2321
|
]),
|
|
2886
2322
|
default: i(() => [
|
|
2887
|
-
|
|
2323
|
+
V(" " + _(e(t)("tag.merge")), 1)
|
|
2888
2324
|
]),
|
|
2889
2325
|
_: 1
|
|
2890
2326
|
}, 8, ["disabled"]),
|
|
2891
|
-
|
|
2327
|
+
r(e(Ve), {
|
|
2892
2328
|
size: "lg",
|
|
2893
|
-
actions:
|
|
2329
|
+
actions: fe.value,
|
|
2894
2330
|
label: e(t)("tag.selected", { count: N.value.length })
|
|
2895
2331
|
}, null, 8, ["actions", "label"])
|
|
2896
2332
|
]),
|
|
2897
2333
|
_: 1
|
|
2898
|
-
})) :
|
|
2334
|
+
})) : L("", !0)
|
|
2899
2335
|
]));
|
|
2900
2336
|
}
|
|
2901
|
-
}),
|
|
2902
|
-
function
|
|
2903
|
-
|
|
2337
|
+
}), Ta = /* @__PURE__ */ ve($a, [["__scopeId", "data-v-beb86d88"]]);
|
|
2338
|
+
function Aa(v = "/blog") {
|
|
2339
|
+
return {
|
|
2340
|
+
api: "blog/rubrics",
|
|
2341
|
+
path: `${v}/rubrics`,
|
|
2342
|
+
name: "webx.blog.rubrics",
|
|
2343
|
+
module: "rubrics",
|
|
2344
|
+
screen: "blog.category-form",
|
|
2345
|
+
manage: "blog.taxonomy.manage",
|
|
2346
|
+
count: "articles_count",
|
|
2347
|
+
items: (c) => ({ path: `${v}/articles`, query: { rubric: String(c) } }),
|
|
2348
|
+
words: {
|
|
2349
|
+
new: "webx-blog::rubric.new",
|
|
2350
|
+
empty: "webx-blog::rubric.empty",
|
|
2351
|
+
"empty-help": "webx-blog::rubric.empty-help",
|
|
2352
|
+
order: "webx-blog::rubric.order",
|
|
2353
|
+
hidden: "webx-blog::rubric.hidden",
|
|
2354
|
+
"no-address": "webx-blog::rubric.no-address",
|
|
2355
|
+
count: "webx-blog::rubric.articles",
|
|
2356
|
+
"show-items": "webx-blog::rubric.show-articles",
|
|
2357
|
+
"delete-blocked": "webx-blog::rubric.delete-blocked",
|
|
2358
|
+
"delete-text": "webx-blog::rubric.delete-text",
|
|
2359
|
+
deleted: "webx-blog::rubric.deleted",
|
|
2360
|
+
saved: "webx-blog::rubric.saved",
|
|
2361
|
+
"field-title": "webx-blog::rubric.field-title",
|
|
2362
|
+
"field-slug": "webx-blog::rubric.field-slug",
|
|
2363
|
+
"address-moving": "webx-blog::rubric.address-moving"
|
|
2364
|
+
}
|
|
2365
|
+
};
|
|
2366
|
+
}
|
|
2367
|
+
function Ma(v = {}) {
|
|
2368
|
+
const c = v.path ?? "/blog";
|
|
2904
2369
|
return [
|
|
2905
2370
|
{
|
|
2906
2371
|
id: "articles",
|
|
2907
|
-
path: `${
|
|
2372
|
+
path: `${c}/articles`,
|
|
2908
2373
|
routes: [
|
|
2909
2374
|
// The section's own path travels as a prop, so a panel that mounted the blog somewhere
|
|
2910
2375
|
// else still links between its screens correctly.
|
|
2911
2376
|
{
|
|
2912
|
-
path: `${
|
|
2377
|
+
path: `${c}/articles`,
|
|
2913
2378
|
name: "webx.blog.articles",
|
|
2914
|
-
component:
|
|
2915
|
-
props: { base:
|
|
2379
|
+
component: ga,
|
|
2380
|
+
props: { base: c }
|
|
2916
2381
|
},
|
|
2917
2382
|
{
|
|
2918
|
-
path: `${
|
|
2383
|
+
path: `${c}/articles/:id(\\d+)`,
|
|
2919
2384
|
name: "webx.blog.articles.edit",
|
|
2920
|
-
component:
|
|
2921
|
-
props: { base:
|
|
2385
|
+
component: qt,
|
|
2386
|
+
props: { base: c }
|
|
2922
2387
|
}
|
|
2923
2388
|
],
|
|
2924
2389
|
/*
|
|
2925
2390
|
* The parts of `blog.article-form` that only this module can draw.
|
|
2926
2391
|
*
|
|
2927
2392
|
* The editor is a described screen so that a module can add a tab to it with a patch, and
|
|
2928
|
-
* the price of that is that everything on it has to be a node type.
|
|
2393
|
+
* the price of that is that everything on it has to be a node type. Four of these are
|
|
2929
2394
|
* fields — the value is ids, and the control over them is a list that can be dragged or a
|
|
2930
2395
|
* box that makes a tag — and two only draw. Each reads the article from the editor above
|
|
2931
2396
|
* it rather than from the description, because a screen is a description and not a
|
|
@@ -2936,62 +2401,54 @@ function Ja(g = {}) {
|
|
|
2936
2401
|
* description — it is configuration the editor was handed with the record.
|
|
2937
2402
|
*/
|
|
2938
2403
|
types: {
|
|
2939
|
-
"wx-article-slug": { component:
|
|
2940
|
-
"wx-article-author": { component:
|
|
2941
|
-
"wx-article-
|
|
2942
|
-
"wx-article-
|
|
2943
|
-
"wx-article-
|
|
2944
|
-
"wx-article-
|
|
2945
|
-
"wx-article-history": { component: Kt, kind: "display" }
|
|
2404
|
+
"wx-article-slug": { component: Zt, kind: "field" },
|
|
2405
|
+
"wx-article-author": { component: zt, kind: "field" },
|
|
2406
|
+
"wx-article-tags": { component: aa, kind: "field" },
|
|
2407
|
+
"wx-article-related": { component: Ht, kind: "field" },
|
|
2408
|
+
"wx-article-unpublish": { component: ia, kind: "display" },
|
|
2409
|
+
"wx-article-history": { component: Bt, kind: "display" }
|
|
2946
2410
|
}
|
|
2947
2411
|
},
|
|
2948
2412
|
{
|
|
2949
2413
|
id: "rubrics",
|
|
2950
|
-
path: `${
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
name: "webx.blog.rubrics",
|
|
2955
|
-
component: Ua,
|
|
2956
|
-
props: { base: o }
|
|
2957
|
-
}
|
|
2958
|
-
]
|
|
2414
|
+
path: `${c}/rubrics`,
|
|
2415
|
+
// The list and the page of one rubric are the panel's shared category screens (§3.6 of
|
|
2416
|
+
// the services spec); what is the blog's is the description they are handed.
|
|
2417
|
+
routes: pt(Aa(c))
|
|
2959
2418
|
},
|
|
2960
2419
|
{
|
|
2961
2420
|
id: "tags",
|
|
2962
|
-
path: `${
|
|
2421
|
+
path: `${c}/tags`,
|
|
2963
2422
|
routes: [
|
|
2964
2423
|
{
|
|
2965
|
-
path: `${
|
|
2424
|
+
path: `${c}/tags`,
|
|
2966
2425
|
name: "webx.blog.tags",
|
|
2967
|
-
component:
|
|
2968
|
-
props: { base:
|
|
2426
|
+
component: Ta,
|
|
2427
|
+
props: { base: c }
|
|
2969
2428
|
}
|
|
2970
2429
|
]
|
|
2971
2430
|
}
|
|
2972
2431
|
];
|
|
2973
2432
|
}
|
|
2974
2433
|
export {
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
ct as articleEditorKey,
|
|
2991
|
-
Ja as blog,
|
|
2992
|
-
qt as blogMessages,
|
|
2434
|
+
zt as WxArticleAuthorField,
|
|
2435
|
+
na as WxArticleCreateDialog,
|
|
2436
|
+
qt as WxArticleEditorPage,
|
|
2437
|
+
Bt as WxArticleHistory,
|
|
2438
|
+
Ht as WxArticleRelated,
|
|
2439
|
+
Zt as WxArticleSlug,
|
|
2440
|
+
aa as WxArticleTags,
|
|
2441
|
+
ia as WxArticleUnpublish,
|
|
2442
|
+
ga as WxArticlesPage,
|
|
2443
|
+
ha as WxTagCreateDialog,
|
|
2444
|
+
_a as WxTagMergeDialog,
|
|
2445
|
+
Ta as WxTagsPage,
|
|
2446
|
+
nt as articleEditorKey,
|
|
2447
|
+
Ma as blog,
|
|
2448
|
+
Vt as blogMessages,
|
|
2993
2449
|
re as createBlogApi,
|
|
2994
|
-
|
|
2450
|
+
Ct as provideArticleEditor,
|
|
2451
|
+
Aa as rubricsOptions,
|
|
2995
2452
|
Ae as useArticleEditor
|
|
2996
2453
|
};
|
|
2997
2454
|
//# sourceMappingURL=index.js.map
|