@webx-ui/module-blog 0.8.6 → 0.8.8
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/{ArticleEditorPage-Bkb5YrLy.js → ArticleEditorPage-B1kYMBEk.js} +2 -2
- package/dist/{ArticleEditorPage-Bkb5YrLy.js.map → ArticleEditorPage-B1kYMBEk.js.map} +1 -1
- package/dist/{ArticlesPage-BnHi8gF0.js → ArticlesPage-Cdb5wOyT.js} +2 -2
- package/dist/{ArticlesPage-BnHi8gF0.js.map → ArticlesPage-Cdb5wOyT.js.map} +1 -1
- package/dist/{AuthorsPage-DSLsX44M.js → AuthorsPage-Catpwado.js} +2 -2
- package/dist/{AuthorsPage-DSLsX44M.js.map → AuthorsPage-Catpwado.js.map} +1 -1
- package/dist/{TagsPage-BnLVnx5a.js → TagsPage-BxvjxFcc.js} +2 -2
- package/dist/{TagsPage-BnLVnx5a.js.map → TagsPage-BxvjxFcc.js.map} +1 -1
- package/dist/{index-ChbP89HC.js → index-C_gXxP0l.js} +208 -203
- package/dist/index-C_gXxP0l.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/dist/index-ChbP89HC.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { provide as Me, inject as Pe, defineComponent as z, useModel as
|
|
1
|
+
import { provide as Me, inject as Pe, defineComponent as z, useModel as ne, computed as $, openBlock as _, createElementBlock as U, createVNode as y, unref as e, createBlock as W, withCtx as g, createTextVNode as N, toDisplayString as C, createCommentVNode as L, mergeModels as ue, ref as A, watch as X, createElementVNode as E, Fragment as Y, renderList as ce, normalizeClass as Re, onBeforeUnmount as de, mergeProps as Ue, normalizeProps as Ie, guardReactiveProps as De, onMounted as he, createSlots as Le, useTemplateRef as ke, nextTick as $e, isRef as pe, withKeys as ie, defineAsyncComponent as le } from "vue";
|
|
2
2
|
import { useAdmin as K, useTranslate as H, useErrorText as Z, WxDate as Be, WxDrafts as Ee, useRemoveConfirm as Oe, categoryRoutes as ze, useBodyKeys as Ke, WxScreenHead as He, WxScreen as Fe, WxSaveState as je } from "@webx-ui/module-admin";
|
|
3
3
|
import { RouterLink as Ge, useRoute as Je, onBeforeRouteUpdate as Ze, onBeforeRouteLeave as Qe } from "vue-router";
|
|
4
|
-
import { WxSelect as ee, WxSkeleton as Te, WxEmpty as Xe, WxText as
|
|
4
|
+
import { WxSelect as ee, WxSkeleton as Te, WxEmpty as Xe, WxText as ge, WxBadge as q, WxButton as O, toast as P, confirm as te, WxSortableList as Ye, WxAction as qe, useLocales as Ae, WxInput as ae, WxAlert as re, WxFormItem as J, localizedValue as et, WxCard as tt, WxActionBar as at, useModal as ve, WxDialog as me, WxSpace as fe, WxIcon as lt, WxCheckbox as ot } from "@webx-ui/core";
|
|
5
5
|
const Se = /* @__PURE__ */ Symbol("wx-article-editor");
|
|
6
|
-
function Ft(
|
|
7
|
-
Me(Se,
|
|
6
|
+
function Ft(r) {
|
|
7
|
+
Me(Se, r);
|
|
8
8
|
}
|
|
9
9
|
function Q() {
|
|
10
10
|
return Pe(Se, null);
|
|
@@ -279,12 +279,12 @@ const st = {
|
|
|
279
279
|
}, _e = /* @__PURE__ */ new WeakSet();
|
|
280
280
|
function F() {
|
|
281
281
|
try {
|
|
282
|
-
const { i18n:
|
|
283
|
-
_e.has(
|
|
282
|
+
const { i18n: r } = K();
|
|
283
|
+
_e.has(r) || (r.defaults("webx-blog", st), _e.add(r));
|
|
284
284
|
} catch {
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
const it = { class: "wx-article-author" },
|
|
287
|
+
const it = { class: "wx-article-author" }, rt = /* @__PURE__ */ z({
|
|
288
288
|
name: "WxArticleAuthor",
|
|
289
289
|
__name: "ArticleAuthor",
|
|
290
290
|
props: /* @__PURE__ */ ue({
|
|
@@ -294,22 +294,22 @@ const it = { class: "wx-article-author" }, nt = /* @__PURE__ */ z({
|
|
|
294
294
|
modelModifiers: {}
|
|
295
295
|
}),
|
|
296
296
|
emits: ["update:modelValue"],
|
|
297
|
-
setup(
|
|
298
|
-
const l =
|
|
297
|
+
setup(r) {
|
|
298
|
+
const l = r, o = ne(r, "modelValue"), i = Q();
|
|
299
299
|
F();
|
|
300
|
-
const t = H("webx-blog"), a = K(),
|
|
300
|
+
const t = H("webx-blog"), a = K(), n = $(() => l.disabled || i?.disabled.value === !0), u = $(
|
|
301
301
|
() => (i?.options.value.authors ?? []).map((c) => ({
|
|
302
302
|
label: c.title,
|
|
303
303
|
value: c.id
|
|
304
304
|
}))
|
|
305
305
|
), s = $(() => {
|
|
306
306
|
if (!a.state.manifest?.modules.some((w) => w.id === "authors") || !a.can("blog.authors.manage") || o.value === null) return null;
|
|
307
|
-
const
|
|
307
|
+
const v = i?.base ?? "/blog", x = i?.options.value.authors.find((w) => w.id === o.value)?.profile;
|
|
308
308
|
return x ? {
|
|
309
|
-
to: { path: `${
|
|
309
|
+
to: { path: `${v}/authors`, query: { author: String(x) } },
|
|
310
310
|
label: t("author.profile")
|
|
311
311
|
} : {
|
|
312
|
-
to: { path: `${
|
|
312
|
+
to: { path: `${v}/authors`, query: { author: "new", account: String(o.value) } },
|
|
313
313
|
label: t("author.make-profile")
|
|
314
314
|
};
|
|
315
315
|
}), m = $({
|
|
@@ -318,13 +318,13 @@ const it = { class: "wx-article-author" }, nt = /* @__PURE__ */ z({
|
|
|
318
318
|
o.value = typeof c == "number" ? c : null;
|
|
319
319
|
}
|
|
320
320
|
});
|
|
321
|
-
return (c,
|
|
321
|
+
return (c, v) => (_(), U("div", it, [
|
|
322
322
|
y(e(ee), {
|
|
323
323
|
modelValue: m.value,
|
|
324
|
-
"onUpdate:modelValue":
|
|
324
|
+
"onUpdate:modelValue": v[0] || (v[0] = (x) => m.value = x),
|
|
325
325
|
options: u.value,
|
|
326
326
|
placeholder: e(t)("article.no-author"),
|
|
327
|
-
disabled:
|
|
327
|
+
disabled: n.value,
|
|
328
328
|
clearable: "",
|
|
329
329
|
filterable: "",
|
|
330
330
|
teleport: "",
|
|
@@ -335,76 +335,76 @@ const it = { class: "wx-article-author" }, nt = /* @__PURE__ */ z({
|
|
|
335
335
|
class: "wx-article-author__profile",
|
|
336
336
|
to: s.value.to
|
|
337
337
|
}, {
|
|
338
|
-
default:
|
|
338
|
+
default: g(() => [
|
|
339
339
|
N(C(s.value.label), 1)
|
|
340
340
|
]),
|
|
341
341
|
_: 1
|
|
342
342
|
}, 8, ["to"])) : L("", !0)
|
|
343
343
|
]));
|
|
344
344
|
}
|
|
345
|
-
}), j = (
|
|
346
|
-
const o =
|
|
345
|
+
}), j = (r, l) => {
|
|
346
|
+
const o = r.__vccOpts || r;
|
|
347
347
|
for (const [i, t] of l)
|
|
348
348
|
o[i] = t;
|
|
349
349
|
return o;
|
|
350
|
-
},
|
|
351
|
-
function G(
|
|
352
|
-
const l = `${
|
|
350
|
+
}, nt = /* @__PURE__ */ j(rt, [["__scopeId", "data-v-4b275a4c"]]);
|
|
351
|
+
function G(r) {
|
|
352
|
+
const l = `${r.apiPath}/blog/articles`, o = `${r.apiPath}/blog/tags`, i = (t) => t.data;
|
|
353
353
|
return {
|
|
354
354
|
articles: (t = {}) => {
|
|
355
355
|
const a = new URLSearchParams();
|
|
356
356
|
t.q && a.set("q", t.q), t.rubric != null && a.set("rubric", String(t.rubric)), t.tag != null && a.set("tag", String(t.tag)), t.author != null && a.set("author", String(t.author)), t.status && a.set("status", t.status), t.sort && a.set("sort", t.sort), t.trashed && a.set("trashed", "1"), t.page && t.page > 1 && a.set("page", String(t.page)), t.per_page && a.set("per_page", String(t.per_page));
|
|
357
|
-
const
|
|
358
|
-
return
|
|
357
|
+
const n = a.size > 0 ? `?${a}` : "";
|
|
358
|
+
return r.http.get(`${l}${n}`).then((u) => ({ ...u.meta, data: u.data, filters: u.filters }));
|
|
359
359
|
},
|
|
360
|
-
get: (t) =>
|
|
361
|
-
create: (t) =>
|
|
362
|
-
save: (t, a) =>
|
|
363
|
-
discard: (t) =>
|
|
364
|
-
versions: (t) =>
|
|
365
|
-
restoreVersion: (t, a) =>
|
|
360
|
+
get: (t) => r.http.get(`${l}/${t}`).then(i),
|
|
361
|
+
create: (t) => r.http.post(l, t).then(i),
|
|
362
|
+
save: (t, a) => r.http.put(`${l}/${t}`, a).then(i),
|
|
363
|
+
discard: (t) => r.http.post(`${l}/${t}/discard`, {}).then(i),
|
|
364
|
+
versions: (t) => r.http.get(`${l}/${t}/versions`).then(i),
|
|
365
|
+
restoreVersion: (t, a) => r.http.post(`${l}/${t}/versions/${a}/restore`, {}).then(i),
|
|
366
366
|
tags: (t = "") => {
|
|
367
367
|
const a = t.trim() === "" ? "" : `?q=${encodeURIComponent(t.trim())}`;
|
|
368
|
-
return
|
|
368
|
+
return r.http.get(`${o}${a}`).then(i);
|
|
369
369
|
},
|
|
370
|
-
createTag: (t) =>
|
|
371
|
-
publish: (t, a,
|
|
370
|
+
createTag: (t) => r.http.post(o, t).then(i),
|
|
371
|
+
publish: (t, a, n) => r.http.post(`${l}/${t}/publish`, {
|
|
372
372
|
...a == null ? {} : { at: a },
|
|
373
|
-
...
|
|
373
|
+
...n ? { revision: n } : {}
|
|
374
374
|
}).then(i),
|
|
375
|
-
unpublish: (t) =>
|
|
376
|
-
remove: (t) =>
|
|
375
|
+
unpublish: (t) => r.http.post(`${l}/${t}/unpublish`, {}).then(i),
|
|
376
|
+
remove: (t) => r.http.delete(`${l}/${t}`).then(() => {
|
|
377
377
|
}),
|
|
378
|
-
restore: (t) =>
|
|
378
|
+
restore: (t) => r.http.post(`${l}/${t}/restore`, {}).then(i),
|
|
379
379
|
tagsPage: (t = {}) => {
|
|
380
380
|
const a = new URLSearchParams();
|
|
381
381
|
t.q && a.set("q", t.q), t.empty && a.set("empty", "1"), t.noindex && a.set("noindex", "1"), t.sort && a.set("sort", t.sort), t.page && t.page > 1 && a.set("page", String(t.page)), t.per_page && a.set("per_page", String(t.per_page));
|
|
382
|
-
const
|
|
383
|
-
return
|
|
382
|
+
const n = a.size > 0 ? `?${a}` : "";
|
|
383
|
+
return r.http.get(`${o}${n}`).then((u) => ({ ...u.meta, data: u.data, filters: u.filters }));
|
|
384
384
|
},
|
|
385
|
-
saveTag: (t, a) =>
|
|
386
|
-
removeTag: (t) =>
|
|
385
|
+
saveTag: (t, a) => r.http.put(`${o}/${t}`, a).then(i),
|
|
386
|
+
removeTag: (t) => r.http.delete(`${o}/${t}`).then(() => {
|
|
387
387
|
}),
|
|
388
|
-
massTags: (t, a) =>
|
|
389
|
-
mergeTags: (t, a,
|
|
388
|
+
massTags: (t, a) => r.http.post(`${o}/mass`, { ids: t, action: a }).then((n) => n.data.affected),
|
|
389
|
+
mergeTags: (t, a, n) => r.http.post(`${o}/merge`, { ids: t, keep: a, redirect: n }).then(i)
|
|
390
390
|
};
|
|
391
391
|
}
|
|
392
392
|
const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-history" }, dt = { class: "wx-article-history__number" }, ht = { class: "wx-article-history__who" }, pt = /* @__PURE__ */ z({
|
|
393
393
|
name: "WxArticleHistory",
|
|
394
394
|
__name: "ArticleHistory",
|
|
395
|
-
setup(
|
|
395
|
+
setup(r) {
|
|
396
396
|
const l = K(), o = G(l), i = Q();
|
|
397
397
|
F();
|
|
398
|
-
const t = H("webx-blog"), a = Z(),
|
|
399
|
-
() => s.value?.status === "published" || s.value?.status === "modified" ?
|
|
398
|
+
const t = H("webx-blog"), a = Z(), n = A(null), u = A(!1), s = $(() => i?.article.value ?? null), m = $(() => l.can("blog.articles.manage")), c = $(
|
|
399
|
+
() => s.value?.status === "published" || s.value?.status === "modified" ? n.value?.[0]?.number ?? null : null
|
|
400
400
|
);
|
|
401
|
-
async function
|
|
401
|
+
async function v() {
|
|
402
402
|
const w = s.value;
|
|
403
403
|
if (w)
|
|
404
404
|
try {
|
|
405
|
-
|
|
405
|
+
n.value = await o.versions(w.id);
|
|
406
406
|
} catch (p) {
|
|
407
|
-
|
|
407
|
+
n.value = [], P.danger(a(p));
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
async function x(w) {
|
|
@@ -428,19 +428,19 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
428
428
|
return X(
|
|
429
429
|
() => [s.value?.id, s.value?.published_at, s.value?.updated_at],
|
|
430
430
|
() => {
|
|
431
|
-
|
|
431
|
+
v();
|
|
432
432
|
},
|
|
433
433
|
{ immediate: !0 }
|
|
434
434
|
), (w, p) => (_(), U("div", ut, [
|
|
435
435
|
E("div", ct, [
|
|
436
|
-
|
|
436
|
+
n.value === null ? (_(), W(e(Te), {
|
|
437
437
|
key: 0,
|
|
438
438
|
class: "wx-article-history__ghost",
|
|
439
439
|
rows: 3
|
|
440
|
-
})) :
|
|
440
|
+
})) : n.value.length === 0 ? (_(), W(e(Xe), {
|
|
441
441
|
key: 1,
|
|
442
442
|
description: e(t)("article.history-empty")
|
|
443
|
-
}, null, 8, ["description"])) : (_(!0), U(Y, { key: 2 }, ce(
|
|
443
|
+
}, null, 8, ["description"])) : (_(!0), U(Y, { key: 2 }, ce(n.value, (f) => (_(), U("div", {
|
|
444
444
|
key: f.number,
|
|
445
445
|
class: Re(["wx-article-history__row", { "is-live": f.number === c.value }])
|
|
446
446
|
}, [
|
|
@@ -452,11 +452,11 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
452
452
|
size: "md",
|
|
453
453
|
tone: "default"
|
|
454
454
|
}, null, 8, ["value"])) : L("", !0),
|
|
455
|
-
y(e(
|
|
455
|
+
y(e(ge), {
|
|
456
456
|
size: "sm",
|
|
457
457
|
tone: "muted"
|
|
458
458
|
}, {
|
|
459
|
-
default:
|
|
459
|
+
default: g(() => [
|
|
460
460
|
N(C(f.author ?? e(t)(`article.source-${f.source}`)) + " ", 1),
|
|
461
461
|
f.comment ? (_(), U(Y, { key: 0 }, [
|
|
462
462
|
N(" · " + C(f.comment), 1)
|
|
@@ -470,7 +470,7 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
470
470
|
type: "success",
|
|
471
471
|
dot: ""
|
|
472
472
|
}, {
|
|
473
|
-
default:
|
|
473
|
+
default: g(() => [
|
|
474
474
|
N(C(e(t)("article.version-live")), 1)
|
|
475
475
|
]),
|
|
476
476
|
_: 1
|
|
@@ -482,7 +482,7 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
482
482
|
loading: u.value,
|
|
483
483
|
onClick: (M) => x(f)
|
|
484
484
|
}, {
|
|
485
|
-
default:
|
|
485
|
+
default: g(() => [
|
|
486
486
|
N(C(e(t)("article.restore-version")), 1)
|
|
487
487
|
]),
|
|
488
488
|
_: 1
|
|
@@ -499,7 +499,7 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
499
499
|
}, null, 8, ["id", "can-restore", "stamp"])
|
|
500
500
|
]));
|
|
501
501
|
}
|
|
502
|
-
}),
|
|
502
|
+
}), gt = /* @__PURE__ */ j(pt, [["__scopeId", "data-v-0052c4f9"]]), vt = { class: "wx-article-related" }, mt = { class: "wx-article-related__name" }, ft = 250, bt = 10, wt = /* @__PURE__ */ z({
|
|
503
503
|
name: "WxArticleRelated",
|
|
504
504
|
__name: "ArticleRelated",
|
|
505
505
|
props: /* @__PURE__ */ ue({
|
|
@@ -509,10 +509,10 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
509
509
|
modelModifiers: {}
|
|
510
510
|
}),
|
|
511
511
|
emits: ["update:modelValue"],
|
|
512
|
-
setup(
|
|
513
|
-
const l =
|
|
512
|
+
setup(r) {
|
|
513
|
+
const l = r, o = ne(r, "modelValue"), i = K(), t = G(i), a = Q();
|
|
514
514
|
F();
|
|
515
|
-
const
|
|
515
|
+
const n = H("webx-blog"), u = Oe(), s = Z(), m = $(() => l.disabled || a?.disabled.value === !0), c = A(/* @__PURE__ */ new Map()), v = A([]);
|
|
516
516
|
let x;
|
|
517
517
|
X(
|
|
518
518
|
() => a?.related.value,
|
|
@@ -529,15 +529,15 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
529
529
|
o.value = d.map((k) => k.id);
|
|
530
530
|
}
|
|
531
531
|
}), p = $(
|
|
532
|
-
() =>
|
|
532
|
+
() => v.value.filter((d) => !o.value.includes(d.id)).map((d) => ({ label: d.title, value: d.id }))
|
|
533
533
|
);
|
|
534
534
|
async function f(d) {
|
|
535
535
|
const k = a?.article.value?.id;
|
|
536
536
|
try {
|
|
537
537
|
const S = await t.articles({ q: d, per_page: bt });
|
|
538
|
-
|
|
538
|
+
v.value = S.data.filter((V) => V.id !== k).map((V) => ({ id: V.id, title: V.title }));
|
|
539
539
|
const b = new Map(c.value);
|
|
540
|
-
for (const V of
|
|
540
|
+
for (const V of v.value) b.set(V.id, V.title);
|
|
541
541
|
c.value = b;
|
|
542
542
|
} catch (S) {
|
|
543
543
|
P.danger(s(S));
|
|
@@ -560,7 +560,7 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
560
560
|
f("");
|
|
561
561
|
},
|
|
562
562
|
{ immediate: !0 }
|
|
563
|
-
), de(() => clearTimeout(x)), (d, k) => (_(), U("div",
|
|
563
|
+
), de(() => clearTimeout(x)), (d, k) => (_(), U("div", vt, [
|
|
564
564
|
y(e(Ye), {
|
|
565
565
|
modelValue: w.value,
|
|
566
566
|
"onUpdate:modelValue": k[0] || (k[0] = (S) => w.value = S),
|
|
@@ -569,18 +569,18 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
569
569
|
"item-key": "id",
|
|
570
570
|
"item-label": "title",
|
|
571
571
|
disabled: m.value,
|
|
572
|
-
"empty-text": e(
|
|
573
|
-
"aria-label": e(
|
|
572
|
+
"empty-text": e(n)("article.related-empty"),
|
|
573
|
+
"aria-label": e(n)("article.related")
|
|
574
574
|
}, {
|
|
575
|
-
default:
|
|
575
|
+
default: g(({ item: S }) => [
|
|
576
576
|
E("span", mt, C(S.title), 1)
|
|
577
577
|
]),
|
|
578
|
-
actions:
|
|
578
|
+
actions: g(({ item: S }) => [
|
|
579
579
|
y(e(qe), Ue({
|
|
580
580
|
type: "remove",
|
|
581
581
|
size: "sm",
|
|
582
582
|
disabled: m.value,
|
|
583
|
-
title: e(
|
|
583
|
+
title: e(n)("article.related-remove")
|
|
584
584
|
}, e(u), {
|
|
585
585
|
onClick: (b) => D(S.id)
|
|
586
586
|
}), null, 16, ["disabled", "title", "onClick"])
|
|
@@ -590,12 +590,12 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
590
590
|
y(e(ee), {
|
|
591
591
|
"model-value": null,
|
|
592
592
|
options: p.value,
|
|
593
|
-
placeholder: e(
|
|
594
|
-
"empty-text": e(
|
|
593
|
+
placeholder: e(n)("article.related-add"),
|
|
594
|
+
"empty-text": e(n)("article.related-nothing"),
|
|
595
595
|
disabled: m.value,
|
|
596
596
|
filterable: "",
|
|
597
597
|
teleport: "",
|
|
598
|
-
"aria-label": e(
|
|
598
|
+
"aria-label": e(n)("article.related-add"),
|
|
599
599
|
onSearch: M,
|
|
600
600
|
"onUpdate:modelValue": I
|
|
601
601
|
}, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"])
|
|
@@ -605,7 +605,7 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
605
605
|
name: "WxArticleSlug",
|
|
606
606
|
inheritAttrs: !1,
|
|
607
607
|
__name: "ArticleSlug",
|
|
608
|
-
setup(
|
|
608
|
+
setup(r) {
|
|
609
609
|
const l = Q(), o = Ae();
|
|
610
610
|
F();
|
|
611
611
|
const i = H("webx-blog"), t = $(() => {
|
|
@@ -614,18 +614,18 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
614
614
|
}), a = $(() => {
|
|
615
615
|
const u = l?.values.value.slug;
|
|
616
616
|
return typeof u == "string" ? u : u?.[o.active.value] ?? "";
|
|
617
|
-
}),
|
|
617
|
+
}), n = $(() => {
|
|
618
618
|
const u = l?.article.value?.path;
|
|
619
619
|
return typeof u == "string" && a.value !== "" && `${t.value}${a.value}` != `/${u}`;
|
|
620
620
|
});
|
|
621
621
|
return (u, s) => (_(), U("div", xt, [
|
|
622
622
|
y(e(ae), Ie(De(u.$attrs)), {
|
|
623
|
-
prefix:
|
|
623
|
+
prefix: g(() => [
|
|
624
624
|
E("span", _t, C(t.value), 1)
|
|
625
625
|
]),
|
|
626
626
|
_: 1
|
|
627
627
|
}, 16),
|
|
628
|
-
|
|
628
|
+
n.value ? (_(), W(e(re), {
|
|
629
629
|
key: 0,
|
|
630
630
|
type: "info",
|
|
631
631
|
variant: "soft",
|
|
@@ -646,10 +646,10 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
646
646
|
modelModifiers: {}
|
|
647
647
|
}),
|
|
648
648
|
emits: ["update:modelValue"],
|
|
649
|
-
setup(
|
|
650
|
-
const l =
|
|
649
|
+
setup(r) {
|
|
650
|
+
const l = r, o = ne(r, "modelValue"), i = K(), t = G(i), a = Q();
|
|
651
651
|
F();
|
|
652
|
-
const
|
|
652
|
+
const n = H("webx-blog"), u = Z(), s = $(() => l.disabled || a?.disabled.value === !0), m = A(/* @__PURE__ */ new Map()), c = A([]), v = A(""), x = A(!1);
|
|
653
653
|
let w;
|
|
654
654
|
X(
|
|
655
655
|
() => a?.article.value?.tags,
|
|
@@ -666,18 +666,18 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
666
666
|
() => c.value.filter((b) => !o.value.includes(b.id)).map((b) => ({
|
|
667
667
|
// The count is part of the label rather than a column: a select draws a line of text, and
|
|
668
668
|
// the number is what the reader is choosing between two near-identical words on.
|
|
669
|
-
label:
|
|
669
|
+
label: n("article.tag-option", { title: b.title, count: b.articles_count }),
|
|
670
670
|
value: b.id
|
|
671
671
|
}))
|
|
672
672
|
), M = $(() => {
|
|
673
|
-
const b =
|
|
673
|
+
const b = v.value.trim();
|
|
674
674
|
if (b === "") return null;
|
|
675
675
|
const V = (R) => R.toLowerCase() === b.toLowerCase();
|
|
676
676
|
return c.value.some((R) => V(R.title)) ? null : b;
|
|
677
677
|
});
|
|
678
678
|
async function I() {
|
|
679
679
|
try {
|
|
680
|
-
c.value = await t.tags(
|
|
680
|
+
c.value = await t.tags(v.value);
|
|
681
681
|
const b = new Map(m.value);
|
|
682
682
|
for (const V of c.value) b.set(V.id, V.title);
|
|
683
683
|
m.value = b;
|
|
@@ -686,12 +686,12 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
686
686
|
}
|
|
687
687
|
}
|
|
688
688
|
function D(b) {
|
|
689
|
-
|
|
689
|
+
v.value = b, clearTimeout(w), w = setTimeout(() => {
|
|
690
690
|
I();
|
|
691
691
|
}, Vt);
|
|
692
692
|
}
|
|
693
693
|
function d(b) {
|
|
694
|
-
typeof b != "number" || o.value.includes(b) || (o.value = [...o.value, b],
|
|
694
|
+
typeof b != "number" || o.value.includes(b) || (o.value = [...o.value, b], v.value = "");
|
|
695
695
|
}
|
|
696
696
|
function k(b) {
|
|
697
697
|
o.value = o.value.filter((V) => V !== b);
|
|
@@ -722,21 +722,21 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
722
722
|
key: R.id,
|
|
723
723
|
type: "default",
|
|
724
724
|
closable: !s.value,
|
|
725
|
-
"close-label": e(
|
|
725
|
+
"close-label": e(n)("article.tag-remove"),
|
|
726
726
|
onClose: (oe) => k(R.id)
|
|
727
727
|
}, {
|
|
728
|
-
default:
|
|
728
|
+
default: g(() => [
|
|
729
729
|
N(C(R.title), 1)
|
|
730
730
|
]),
|
|
731
731
|
_: 2
|
|
732
732
|
}, 1032, ["closable", "close-label", "onClose"]))), 128))
|
|
733
|
-
])) : (_(), W(e(
|
|
733
|
+
])) : (_(), W(e(ge), {
|
|
734
734
|
key: 1,
|
|
735
735
|
size: "sm",
|
|
736
736
|
tone: "muted"
|
|
737
737
|
}, {
|
|
738
|
-
default:
|
|
739
|
-
N(C(e(
|
|
738
|
+
default: g(() => [
|
|
739
|
+
N(C(e(n)("article.tags-empty")), 1)
|
|
740
740
|
]),
|
|
741
741
|
_: 1
|
|
742
742
|
})),
|
|
@@ -744,12 +744,12 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
744
744
|
y(e(ee), {
|
|
745
745
|
"model-value": null,
|
|
746
746
|
options: f.value,
|
|
747
|
-
placeholder: e(
|
|
748
|
-
"empty-text": e(
|
|
747
|
+
placeholder: e(n)("article.tag-add"),
|
|
748
|
+
"empty-text": e(n)("article.tag-nothing"),
|
|
749
749
|
disabled: s.value,
|
|
750
750
|
filterable: "",
|
|
751
751
|
teleport: "",
|
|
752
|
-
"aria-label": e(
|
|
752
|
+
"aria-label": e(n)("article.tag-add"),
|
|
753
753
|
onSearch: D,
|
|
754
754
|
"onUpdate:modelValue": d
|
|
755
755
|
}, null, 8, ["options", "placeholder", "empty-text", "disabled", "aria-label"]),
|
|
@@ -761,8 +761,8 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
761
761
|
disabled: s.value,
|
|
762
762
|
onClick: S
|
|
763
763
|
}, {
|
|
764
|
-
default:
|
|
765
|
-
N(C(e(
|
|
764
|
+
default: g(() => [
|
|
765
|
+
N(C(e(n)("article.tag-create", { title: M.value })), 1)
|
|
766
766
|
]),
|
|
767
767
|
_: 1
|
|
768
768
|
}, 8, ["loading", "disabled"])) : L("", !0)
|
|
@@ -772,13 +772,13 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
772
772
|
}), Wt = /* @__PURE__ */ j(Ct, [["__scopeId", "data-v-faf5adec"]]), Nt = /* @__PURE__ */ z({
|
|
773
773
|
name: "WxArticleUnpublish",
|
|
774
774
|
__name: "ArticleUnpublish",
|
|
775
|
-
setup(
|
|
775
|
+
setup(r) {
|
|
776
776
|
const l = K(), o = G(l), i = Q();
|
|
777
777
|
F();
|
|
778
|
-
const t = H("webx-blog"), a = Z(),
|
|
778
|
+
const t = H("webx-blog"), a = Z(), n = A(!1), u = $(() => {
|
|
779
779
|
const c = i?.article.value?.status;
|
|
780
780
|
return c === "published" || c === "modified" || c === "scheduled";
|
|
781
|
-
}), s = $(() => i?.disabled.value === !0 ||
|
|
781
|
+
}), s = $(() => i?.disabled.value === !0 || n.value);
|
|
782
782
|
async function m() {
|
|
783
783
|
const c = i?.article.value;
|
|
784
784
|
if (!(!c || !await te({
|
|
@@ -788,31 +788,31 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
788
788
|
cancelText: t("panel.cancel"),
|
|
789
789
|
tone: "danger"
|
|
790
790
|
}))) {
|
|
791
|
-
|
|
791
|
+
n.value = !0;
|
|
792
792
|
try {
|
|
793
793
|
await o.unpublish(c.id), await i?.reload(), P.success(t("panel.unpublished-done"));
|
|
794
794
|
} catch (x) {
|
|
795
795
|
P.danger(a(x));
|
|
796
796
|
} finally {
|
|
797
|
-
|
|
797
|
+
n.value = !1;
|
|
798
798
|
}
|
|
799
799
|
}
|
|
800
800
|
}
|
|
801
|
-
return (c,
|
|
801
|
+
return (c, v) => u.value && e(i)?.canManage ? (_(), W(e(J), {
|
|
802
802
|
key: 0,
|
|
803
803
|
class: "wx-article-unpublish",
|
|
804
804
|
help: e(t)("article.unpublish-help")
|
|
805
805
|
}, {
|
|
806
|
-
default:
|
|
806
|
+
default: g(() => [
|
|
807
807
|
y(e(O), {
|
|
808
808
|
variant: "outline",
|
|
809
809
|
type: "danger",
|
|
810
810
|
icon: "eye-off",
|
|
811
|
-
loading:
|
|
811
|
+
loading: n.value,
|
|
812
812
|
disabled: s.value,
|
|
813
813
|
onClick: m
|
|
814
814
|
}, {
|
|
815
|
-
default:
|
|
815
|
+
default: g(() => [
|
|
816
816
|
N(C(e(t)("panel.unpublish")), 1)
|
|
817
817
|
]),
|
|
818
818
|
_: 1
|
|
@@ -822,16 +822,16 @@ const ut = { class: "wx-article-history-tab" }, ct = { class: "wx-article-histor
|
|
|
822
822
|
}, 8, ["help"])) : L("", !0);
|
|
823
823
|
}
|
|
824
824
|
}), Mt = /* @__PURE__ */ j(Nt, [["__scopeId", "data-v-c311cff2"]]);
|
|
825
|
-
function Pt(
|
|
825
|
+
function Pt(r = "/blog") {
|
|
826
826
|
return {
|
|
827
827
|
api: "blog/rubrics",
|
|
828
|
-
path: `${
|
|
828
|
+
path: `${r}/rubrics`,
|
|
829
829
|
name: "webx.blog.rubrics",
|
|
830
830
|
module: "rubrics",
|
|
831
831
|
screen: "blog.category-form",
|
|
832
832
|
manage: "blog.taxonomy.manage",
|
|
833
833
|
count: "articles_count",
|
|
834
|
-
items: (l) => ({ path: `${
|
|
834
|
+
items: (l) => ({ path: `${r}/articles`, query: { rubric: String(l) } }),
|
|
835
835
|
words: {
|
|
836
836
|
new: "webx-blog::rubric.new",
|
|
837
837
|
empty: "webx-blog::rubric.empty",
|
|
@@ -851,8 +851,8 @@ function Pt(n = "/blog") {
|
|
|
851
851
|
}
|
|
852
852
|
};
|
|
853
853
|
}
|
|
854
|
-
function jt(
|
|
855
|
-
const l =
|
|
854
|
+
function jt(r = {}) {
|
|
855
|
+
const l = r.path ?? "/blog";
|
|
856
856
|
return [
|
|
857
857
|
{
|
|
858
858
|
id: "articles",
|
|
@@ -863,13 +863,15 @@ function jt(n = {}) {
|
|
|
863
863
|
{
|
|
864
864
|
path: `${l}/articles`,
|
|
865
865
|
name: "webx.blog.articles",
|
|
866
|
-
|
|
866
|
+
meta: { help: "blog.articles" },
|
|
867
|
+
component: () => import("./ArticlesPage-Cdb5wOyT.js"),
|
|
867
868
|
props: { base: l }
|
|
868
869
|
},
|
|
869
870
|
{
|
|
870
871
|
path: `${l}/articles/:id(\\d+)`,
|
|
871
872
|
name: "webx.blog.articles.edit",
|
|
872
|
-
|
|
873
|
+
meta: { help: "blog.article-form" },
|
|
874
|
+
component: () => import("./ArticleEditorPage-B1kYMBEk.js"),
|
|
873
875
|
props: { base: l }
|
|
874
876
|
}
|
|
875
877
|
],
|
|
@@ -889,11 +891,11 @@ function jt(n = {}) {
|
|
|
889
891
|
*/
|
|
890
892
|
types: {
|
|
891
893
|
"wx-article-slug": { component: $t, kind: "field" },
|
|
892
|
-
"wx-article-author": { component:
|
|
894
|
+
"wx-article-author": { component: nt, kind: "field" },
|
|
893
895
|
"wx-article-tags": { component: Wt, kind: "field" },
|
|
894
896
|
"wx-article-related": { component: yt, kind: "field" },
|
|
895
897
|
"wx-article-unpublish": { component: Mt, kind: "display" },
|
|
896
|
-
"wx-article-history": { component:
|
|
898
|
+
"wx-article-history": { component: gt, kind: "display" }
|
|
897
899
|
}
|
|
898
900
|
},
|
|
899
901
|
{
|
|
@@ -910,7 +912,8 @@ function jt(n = {}) {
|
|
|
910
912
|
{
|
|
911
913
|
path: `${l}/tags`,
|
|
912
914
|
name: "webx.blog.tags",
|
|
913
|
-
|
|
915
|
+
meta: { help: "blog.tags" },
|
|
916
|
+
component: () => import("./TagsPage-BxvjxFcc.js"),
|
|
914
917
|
props: { base: l }
|
|
915
918
|
}
|
|
916
919
|
]
|
|
@@ -924,25 +927,26 @@ function jt(n = {}) {
|
|
|
924
927
|
{
|
|
925
928
|
path: `${l}/authors`,
|
|
926
929
|
name: "webx.blog.authors",
|
|
927
|
-
|
|
930
|
+
meta: { help: "blog.authors" },
|
|
931
|
+
component: () => import("./AuthorsPage-Catpwado.js"),
|
|
928
932
|
props: { base: l }
|
|
929
933
|
}
|
|
930
934
|
]
|
|
931
935
|
}
|
|
932
936
|
];
|
|
933
937
|
}
|
|
934
|
-
function Rt(
|
|
935
|
-
const l = `${
|
|
938
|
+
function Rt(r) {
|
|
939
|
+
const l = `${r.apiPath}/blog/authors`, o = (i) => i.data;
|
|
936
940
|
return {
|
|
937
941
|
list: (i = "") => {
|
|
938
942
|
const t = i.trim() === "" ? "" : `?q=${encodeURIComponent(i.trim())}`;
|
|
939
|
-
return
|
|
943
|
+
return r.http.get(`${l}${t}`).then(o);
|
|
940
944
|
},
|
|
941
|
-
accounts: () =>
|
|
942
|
-
get: (i) =>
|
|
943
|
-
create: (i, t) =>
|
|
944
|
-
save: (i, t) =>
|
|
945
|
-
remove: (i) =>
|
|
945
|
+
accounts: () => r.http.get(`${l}/accounts`).then(o),
|
|
946
|
+
get: (i) => r.http.get(`${l}/${i}`).then(o),
|
|
947
|
+
create: (i, t) => r.http.post(l, { user_id: i, values: t }).then(o),
|
|
948
|
+
save: (i, t) => r.http.put(`${l}/${i}`, { values: t }).then(o),
|
|
949
|
+
remove: (i) => r.http.delete(`${l}/${i}`).then(() => {
|
|
946
950
|
})
|
|
947
951
|
};
|
|
948
952
|
}
|
|
@@ -957,13 +961,13 @@ const Ut = {
|
|
|
957
961
|
inline: { type: Boolean, default: !0 }
|
|
958
962
|
},
|
|
959
963
|
emits: ["back", "saved", "created", "removed"],
|
|
960
|
-
setup(
|
|
961
|
-
const o =
|
|
964
|
+
setup(r, { emit: l }) {
|
|
965
|
+
const o = r, i = l, t = K(), a = Rt(t), n = Je(), u = Ae();
|
|
962
966
|
F();
|
|
963
|
-
const s = H("webx-blog"), m = Z(), c = A(null),
|
|
967
|
+
const s = H("webx-blog"), m = Z(), c = A(null), v = A({}), x = A(""), w = A([]), p = A(null), f = A(!0), M = A(!1), I = A({}), D = $(() => t.can("blog.authors.manage")), d = $(() => JSON.stringify(v.value)), k = $(
|
|
964
968
|
() => x.value !== "" && (d.value !== x.value || p.value !== null)
|
|
965
969
|
), S = $(() => M.value ? "saving" : k.value || o.id === null ? "unsaved" : "saved"), b = $(() => {
|
|
966
|
-
const h =
|
|
970
|
+
const h = v.value.title, T = o.id === null ? s("author.new") : c.value?.name ?? "";
|
|
967
971
|
return et(h, u.active.value, T) || s("author.untitled");
|
|
968
972
|
}), V = $(
|
|
969
973
|
() => w.value.map((h) => ({
|
|
@@ -974,12 +978,12 @@ const Ut = {
|
|
|
974
978
|
get: () => p.value,
|
|
975
979
|
set: (h) => {
|
|
976
980
|
p.value = typeof h == "number" ? h : null;
|
|
977
|
-
const T = w.value.find((Ne) => Ne.id === p.value), B =
|
|
978
|
-
T && se && !(B?.[se] ?? "").trim() && (
|
|
981
|
+
const T = w.value.find((Ne) => Ne.id === p.value), B = v.value.title, se = u.list.value[0]?.code;
|
|
982
|
+
T && se && !(B?.[se] ?? "").trim() && (v.value = { ...v.value, title: { ...B ?? {}, [se]: T.name } });
|
|
979
983
|
}
|
|
980
984
|
});
|
|
981
985
|
function oe(h) {
|
|
982
|
-
c.value = h.author,
|
|
986
|
+
c.value = h.author, v.value = h.values, x.value = JSON.stringify(h.values), p.value = null;
|
|
983
987
|
}
|
|
984
988
|
async function Ve() {
|
|
985
989
|
f.value = !0;
|
|
@@ -994,8 +998,8 @@ const Ut = {
|
|
|
994
998
|
socials: [],
|
|
995
999
|
is_public: !1
|
|
996
1000
|
};
|
|
997
|
-
|
|
998
|
-
const T = Number(
|
|
1001
|
+
v.value = h, x.value = JSON.stringify(h), w.value = await a.accounts();
|
|
1002
|
+
const T = Number(n.query.account);
|
|
999
1003
|
w.value.some((B) => B.id === T) && (R.value = T);
|
|
1000
1004
|
} else
|
|
1001
1005
|
oe(await a.get(o.id));
|
|
@@ -1014,7 +1018,7 @@ const Ut = {
|
|
|
1014
1018
|
I.value = { user_id: [s("author.account-missing")] }, P.danger(s("author.save-failed"));
|
|
1015
1019
|
return;
|
|
1016
1020
|
}
|
|
1017
|
-
const T = h ? await a.create(p.value,
|
|
1021
|
+
const T = h ? await a.create(p.value, v.value) : await a.save(o.id, v.value);
|
|
1018
1022
|
oe(T), P.success(s("author.saved")), i(h ? "created" : "saved", T.author);
|
|
1019
1023
|
} catch (h) {
|
|
1020
1024
|
const T = h.body;
|
|
@@ -1094,6 +1098,7 @@ const Ut = {
|
|
|
1094
1098
|
})) : (_(), U(Y, { key: 1 }, [
|
|
1095
1099
|
y(e(He), {
|
|
1096
1100
|
level: 3,
|
|
1101
|
+
help: "blog.author-form",
|
|
1097
1102
|
back: !o.inline,
|
|
1098
1103
|
"back-label": e(s)("author.back"),
|
|
1099
1104
|
title: b.value,
|
|
@@ -1103,9 +1108,9 @@ const Ut = {
|
|
|
1103
1108
|
}, Le({ _: 2 }, [
|
|
1104
1109
|
c.value && !c.value.open ? {
|
|
1105
1110
|
name: "title-after",
|
|
1106
|
-
fn:
|
|
1111
|
+
fn: g(() => [
|
|
1107
1112
|
y(e(q), { dot: "" }, {
|
|
1108
|
-
default:
|
|
1113
|
+
default: g(() => [
|
|
1109
1114
|
N(C(e(s)("author.page-closed")), 1)
|
|
1110
1115
|
]),
|
|
1111
1116
|
_: 1
|
|
@@ -1115,14 +1120,14 @@ const Ut = {
|
|
|
1115
1120
|
} : void 0
|
|
1116
1121
|
]), 1032, ["back", "back-label", "title", "actions"]),
|
|
1117
1122
|
o.id === null ? (_(), W(e(tt), { key: 0 }, {
|
|
1118
|
-
default:
|
|
1123
|
+
default: g(() => [
|
|
1119
1124
|
y(e(J), {
|
|
1120
1125
|
label: e(s)("author.account"),
|
|
1121
1126
|
help: w.value.length === 0 ? e(s)("author.no-accounts") : e(s)("author.account-help"),
|
|
1122
1127
|
error: I.value.user_id?.[0],
|
|
1123
1128
|
required: ""
|
|
1124
1129
|
}, {
|
|
1125
|
-
default:
|
|
1130
|
+
default: g(() => [
|
|
1126
1131
|
y(e(ee), {
|
|
1127
1132
|
modelValue: R.value,
|
|
1128
1133
|
"onUpdate:modelValue": T[1] || (T[1] = (B) => R.value = B),
|
|
@@ -1139,24 +1144,24 @@ const Ut = {
|
|
|
1139
1144
|
_: 1
|
|
1140
1145
|
})) : c.value?.user ? (_(), U("p", Ut, C(e(s)("author.account")) + ": " + C(c.value.user.name), 1)) : L("", !0),
|
|
1141
1146
|
y(e(Fe), {
|
|
1142
|
-
modelValue:
|
|
1143
|
-
"onUpdate:modelValue": T[2] || (T[2] = (B) =>
|
|
1147
|
+
modelValue: v.value,
|
|
1148
|
+
"onUpdate:modelValue": T[2] || (T[2] = (B) => v.value = B),
|
|
1144
1149
|
name: "blog.author-form",
|
|
1145
1150
|
errors: I.value,
|
|
1146
1151
|
disabled: !D.value || M.value
|
|
1147
1152
|
}, null, 8, ["modelValue", "errors", "disabled"]),
|
|
1148
1153
|
D.value ? (_(), W(e(at), { key: 2 }, {
|
|
1149
|
-
state:
|
|
1154
|
+
state: g(() => [
|
|
1150
1155
|
y(e(je), { state: S.value }, null, 8, ["state"])
|
|
1151
1156
|
]),
|
|
1152
|
-
default:
|
|
1157
|
+
default: g(() => [
|
|
1153
1158
|
y(e(O), {
|
|
1154
1159
|
type: "primary",
|
|
1155
1160
|
loading: M.value,
|
|
1156
1161
|
disabled: !k.value && o.id !== null,
|
|
1157
1162
|
onClick: be
|
|
1158
1163
|
}, {
|
|
1159
|
-
default:
|
|
1164
|
+
default: g(() => [
|
|
1160
1165
|
N(C(e(s)("author.save")), 1)
|
|
1161
1166
|
]),
|
|
1162
1167
|
_: 1
|
|
@@ -1167,14 +1172,14 @@ const Ut = {
|
|
|
1167
1172
|
], 64))
|
|
1168
1173
|
], 32));
|
|
1169
1174
|
}
|
|
1170
|
-
}), Gt = /* @__PURE__ */ j(It, [["__scopeId", "data-v-
|
|
1175
|
+
}), Gt = /* @__PURE__ */ j(It, [["__scopeId", "data-v-64eeeabe"]]), Jt = /* @__PURE__ */ z({
|
|
1171
1176
|
__name: "TagCreateDialog",
|
|
1172
|
-
setup(
|
|
1173
|
-
const { open: l, resolve: o, dismiss: i } =
|
|
1177
|
+
setup(r) {
|
|
1178
|
+
const { open: l, resolve: o, dismiss: i } = ve(), t = K(), a = G(t);
|
|
1174
1179
|
F();
|
|
1175
|
-
const
|
|
1180
|
+
const n = H("webx-blog"), u = A(""), s = A(""), m = A(!1), c = A({}), v = ke("field");
|
|
1176
1181
|
he(async () => {
|
|
1177
|
-
await $e(),
|
|
1182
|
+
await $e(), v.value?.querySelector("input")?.focus();
|
|
1178
1183
|
});
|
|
1179
1184
|
async function x() {
|
|
1180
1185
|
if (!(u.value.trim() === "" || m.value)) {
|
|
@@ -1196,18 +1201,18 @@ const Ut = {
|
|
|
1196
1201
|
return (w, p) => (_(), W(e(me), {
|
|
1197
1202
|
open: e(l),
|
|
1198
1203
|
"onUpdate:open": p[3] || (p[3] = (f) => pe(l) ? l.value = f : null),
|
|
1199
|
-
title: e(
|
|
1204
|
+
title: e(n)("tag.new-title"),
|
|
1200
1205
|
width: 440
|
|
1201
1206
|
}, {
|
|
1202
|
-
footer:
|
|
1207
|
+
footer: g(() => [
|
|
1203
1208
|
y(e(fe), { size: "sm" }, {
|
|
1204
|
-
default:
|
|
1209
|
+
default: g(() => [
|
|
1205
1210
|
y(e(O), {
|
|
1206
1211
|
variant: "outline",
|
|
1207
1212
|
onClick: p[2] || (p[2] = (f) => e(i)())
|
|
1208
1213
|
}, {
|
|
1209
|
-
default:
|
|
1210
|
-
N(C(e(
|
|
1214
|
+
default: g(() => [
|
|
1215
|
+
N(C(e(n)("tag.cancel")), 1)
|
|
1211
1216
|
]),
|
|
1212
1217
|
_: 1
|
|
1213
1218
|
}),
|
|
@@ -1217,8 +1222,8 @@ const Ut = {
|
|
|
1217
1222
|
disabled: u.value.trim() === "",
|
|
1218
1223
|
onClick: x
|
|
1219
1224
|
}, {
|
|
1220
|
-
default:
|
|
1221
|
-
N(C(e(
|
|
1225
|
+
default: g(() => [
|
|
1226
|
+
N(C(e(n)("tag.create")), 1)
|
|
1222
1227
|
]),
|
|
1223
1228
|
_: 1
|
|
1224
1229
|
}, 8, ["loading", "disabled"])
|
|
@@ -1226,21 +1231,21 @@ const Ut = {
|
|
|
1226
1231
|
_: 1
|
|
1227
1232
|
})
|
|
1228
1233
|
]),
|
|
1229
|
-
default:
|
|
1234
|
+
default: g(() => [
|
|
1230
1235
|
y(e(J), {
|
|
1231
|
-
label: e(
|
|
1236
|
+
label: e(n)("tag.field-title"),
|
|
1232
1237
|
error: c.value.title?.[0],
|
|
1233
1238
|
required: ""
|
|
1234
1239
|
}, {
|
|
1235
|
-
default:
|
|
1240
|
+
default: g(() => [
|
|
1236
1241
|
E("div", {
|
|
1237
1242
|
ref_key: "field",
|
|
1238
|
-
ref:
|
|
1243
|
+
ref: v
|
|
1239
1244
|
}, [
|
|
1240
1245
|
y(e(ae), {
|
|
1241
1246
|
modelValue: u.value,
|
|
1242
1247
|
"onUpdate:modelValue": p[0] || (p[0] = (f) => u.value = f),
|
|
1243
|
-
"aria-label": e(
|
|
1248
|
+
"aria-label": e(n)("tag.field-title"),
|
|
1244
1249
|
onKeyup: ie(x, ["enter"])
|
|
1245
1250
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1246
1251
|
], 512)
|
|
@@ -1248,15 +1253,15 @@ const Ut = {
|
|
|
1248
1253
|
_: 1
|
|
1249
1254
|
}, 8, ["label", "error"]),
|
|
1250
1255
|
y(e(J), {
|
|
1251
|
-
label: e(
|
|
1256
|
+
label: e(n)("tag.field-slug"),
|
|
1252
1257
|
error: c.value.slug?.[0],
|
|
1253
|
-
help: e(
|
|
1258
|
+
help: e(n)("tag.field-slug-help")
|
|
1254
1259
|
}, {
|
|
1255
|
-
default:
|
|
1260
|
+
default: g(() => [
|
|
1256
1261
|
y(e(ae), {
|
|
1257
1262
|
modelValue: s.value,
|
|
1258
1263
|
"onUpdate:modelValue": p[1] || (p[1] = (f) => s.value = f),
|
|
1259
|
-
"aria-label": e(
|
|
1264
|
+
"aria-label": e(n)("tag.field-slug"),
|
|
1260
1265
|
onKeyup: ie(x, ["enter"])
|
|
1261
1266
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1262
1267
|
]),
|
|
@@ -1271,12 +1276,12 @@ const Ut = {
|
|
|
1271
1276
|
props: {
|
|
1272
1277
|
tags: {}
|
|
1273
1278
|
},
|
|
1274
|
-
setup(
|
|
1275
|
-
const l =
|
|
1279
|
+
setup(r) {
|
|
1280
|
+
const l = r, { open: o, resolve: i, dismiss: t } = ve(), a = K(), n = G(a);
|
|
1276
1281
|
F();
|
|
1277
1282
|
const u = H("webx-blog"), s = Z(), m = A(
|
|
1278
1283
|
[...l.tags].sort((d, k) => k.articles_count - d.articles_count)[0]?.id ?? 0
|
|
1279
|
-
), c = A(!1),
|
|
1284
|
+
), c = A(!1), v = A(!0), x = A(null), w = $(
|
|
1280
1285
|
() => l.tags.map((d) => ({ value: d.id, label: `${d.title} · ${d.articles_count}` }))
|
|
1281
1286
|
), p = $(() => l.tags.find((d) => d.id === m.value) ?? null), f = $(() => l.tags.filter((d) => d.id !== m.value)), M = $(() => f.value.reduce((d, k) => d + k.articles_count, 0)), I = $(() => f.value.map((d) => d.path).filter(Boolean));
|
|
1282
1287
|
async function D() {
|
|
@@ -1284,10 +1289,10 @@ const Ut = {
|
|
|
1284
1289
|
c.value = !0, x.value = null;
|
|
1285
1290
|
try {
|
|
1286
1291
|
i(
|
|
1287
|
-
await
|
|
1292
|
+
await n.mergeTags(
|
|
1288
1293
|
f.value.map((d) => d.id),
|
|
1289
1294
|
m.value,
|
|
1290
|
-
|
|
1295
|
+
v.value
|
|
1291
1296
|
)
|
|
1292
1297
|
);
|
|
1293
1298
|
} catch (d) {
|
|
@@ -1303,14 +1308,14 @@ const Ut = {
|
|
|
1303
1308
|
title: e(u)("tag.merge-title"),
|
|
1304
1309
|
width: 520
|
|
1305
1310
|
}, {
|
|
1306
|
-
footer:
|
|
1311
|
+
footer: g(() => [
|
|
1307
1312
|
y(e(fe), { size: "sm" }, {
|
|
1308
|
-
default:
|
|
1313
|
+
default: g(() => [
|
|
1309
1314
|
y(e(O), {
|
|
1310
1315
|
variant: "outline",
|
|
1311
1316
|
onClick: k[2] || (k[2] = (S) => e(t)())
|
|
1312
1317
|
}, {
|
|
1313
|
-
default:
|
|
1318
|
+
default: g(() => [
|
|
1314
1319
|
N(C(e(u)("tag.cancel")), 1)
|
|
1315
1320
|
]),
|
|
1316
1321
|
_: 1
|
|
@@ -1321,7 +1326,7 @@ const Ut = {
|
|
|
1321
1326
|
disabled: f.value.length === 0,
|
|
1322
1327
|
onClick: D
|
|
1323
1328
|
}, {
|
|
1324
|
-
default:
|
|
1329
|
+
default: g(() => [
|
|
1325
1330
|
N(C(e(u)("tag.merge-confirm")), 1)
|
|
1326
1331
|
]),
|
|
1327
1332
|
_: 1
|
|
@@ -1330,7 +1335,7 @@ const Ut = {
|
|
|
1330
1335
|
_: 1
|
|
1331
1336
|
})
|
|
1332
1337
|
]),
|
|
1333
|
-
default:
|
|
1338
|
+
default: g(() => [
|
|
1334
1339
|
E("div", Dt, [
|
|
1335
1340
|
E("div", Lt, [
|
|
1336
1341
|
(_(!0), U(Y, null, ce(f.value, (S) => (_(), W(e(q), {
|
|
@@ -1338,7 +1343,7 @@ const Ut = {
|
|
|
1338
1343
|
size: "sm",
|
|
1339
1344
|
round: ""
|
|
1340
1345
|
}, {
|
|
1341
|
-
default:
|
|
1346
|
+
default: g(() => [
|
|
1342
1347
|
N(C(S.title) + " · " + C(S.articles_count), 1)
|
|
1343
1348
|
]),
|
|
1344
1349
|
_: 2
|
|
@@ -1353,7 +1358,7 @@ const Ut = {
|
|
|
1353
1358
|
size: "sm",
|
|
1354
1359
|
round: ""
|
|
1355
1360
|
}, {
|
|
1356
|
-
default:
|
|
1361
|
+
default: g(() => [
|
|
1357
1362
|
N(C(p.value.title) + " · " + C(p.value.articles_count), 1)
|
|
1358
1363
|
]),
|
|
1359
1364
|
_: 1
|
|
@@ -1362,7 +1367,7 @@ const Ut = {
|
|
|
1362
1367
|
y(e(J), {
|
|
1363
1368
|
label: e(u)("tag.merge-keep")
|
|
1364
1369
|
}, {
|
|
1365
|
-
default:
|
|
1370
|
+
default: g(() => [
|
|
1366
1371
|
y(e(ee), {
|
|
1367
1372
|
modelValue: m.value,
|
|
1368
1373
|
"onUpdate:modelValue": k[0] || (k[0] = (S) => m.value = S),
|
|
@@ -1374,21 +1379,21 @@ const Ut = {
|
|
|
1374
1379
|
}, 8, ["label"]),
|
|
1375
1380
|
E("div", Bt, [
|
|
1376
1381
|
y(e(ot), {
|
|
1377
|
-
modelValue:
|
|
1378
|
-
"onUpdate:modelValue": k[1] || (k[1] = (S) =>
|
|
1382
|
+
modelValue: v.value,
|
|
1383
|
+
"onUpdate:modelValue": k[1] || (k[1] = (S) => v.value = S),
|
|
1379
1384
|
label: e(u)("tag.merge-redirect")
|
|
1380
1385
|
}, null, 8, ["modelValue", "label"]),
|
|
1381
|
-
y(e(
|
|
1386
|
+
y(e(ge), {
|
|
1382
1387
|
size: "sm",
|
|
1383
1388
|
tone: "muted"
|
|
1384
1389
|
}, {
|
|
1385
|
-
default:
|
|
1390
|
+
default: g(() => [
|
|
1386
1391
|
N(C(I.value.length === 0 ? e(u)("tag.merge-redirect-none") : e(u)("tag.merge-redirect-help", { addresses: I.value.join(", ") })), 1)
|
|
1387
1392
|
]),
|
|
1388
1393
|
_: 1
|
|
1389
1394
|
})
|
|
1390
1395
|
]),
|
|
1391
|
-
y(e(
|
|
1396
|
+
y(e(re), {
|
|
1392
1397
|
type: "warning",
|
|
1393
1398
|
variant: "soft",
|
|
1394
1399
|
description: e(u)("tag.merge-warning", {
|
|
@@ -1397,7 +1402,7 @@ const Ut = {
|
|
|
1397
1402
|
merged: f.value.length
|
|
1398
1403
|
})
|
|
1399
1404
|
}, null, 8, ["description"]),
|
|
1400
|
-
x.value ? (_(), W(e(
|
|
1405
|
+
x.value ? (_(), W(e(re), {
|
|
1401
1406
|
key: 0,
|
|
1402
1407
|
type: "danger",
|
|
1403
1408
|
variant: "soft",
|
|
@@ -1410,14 +1415,14 @@ const Ut = {
|
|
|
1410
1415
|
}
|
|
1411
1416
|
}), Zt = /* @__PURE__ */ j(Et, [["__scopeId", "data-v-aa68b3a8"]]), Qt = /* @__PURE__ */ z({
|
|
1412
1417
|
__name: "ArticleCreateDialog",
|
|
1413
|
-
setup(
|
|
1414
|
-
const { open: l, resolve: o, dismiss: i } =
|
|
1418
|
+
setup(r) {
|
|
1419
|
+
const { open: l, resolve: o, dismiss: i } = ve(), t = K(), a = G(t);
|
|
1415
1420
|
F();
|
|
1416
|
-
const
|
|
1421
|
+
const n = H("webx-blog"), u = A(""), s = A(!1), m = A({}), c = ke("field");
|
|
1417
1422
|
he(async () => {
|
|
1418
1423
|
await $e(), c.value?.querySelector("input")?.focus();
|
|
1419
1424
|
});
|
|
1420
|
-
async function
|
|
1425
|
+
async function v() {
|
|
1421
1426
|
if (!(u.value.trim() === "" || s.value)) {
|
|
1422
1427
|
s.value = !0, m.value = {};
|
|
1423
1428
|
try {
|
|
@@ -1432,18 +1437,18 @@ const Ut = {
|
|
|
1432
1437
|
return (x, w) => (_(), W(e(me), {
|
|
1433
1438
|
open: e(l),
|
|
1434
1439
|
"onUpdate:open": w[2] || (w[2] = (p) => pe(l) ? l.value = p : null),
|
|
1435
|
-
title: e(
|
|
1440
|
+
title: e(n)("panel.new-title"),
|
|
1436
1441
|
width: 440
|
|
1437
1442
|
}, {
|
|
1438
|
-
footer:
|
|
1443
|
+
footer: g(() => [
|
|
1439
1444
|
y(e(fe), { size: "sm" }, {
|
|
1440
|
-
default:
|
|
1445
|
+
default: g(() => [
|
|
1441
1446
|
y(e(O), {
|
|
1442
1447
|
variant: "outline",
|
|
1443
1448
|
onClick: w[1] || (w[1] = (p) => e(i)())
|
|
1444
1449
|
}, {
|
|
1445
|
-
default:
|
|
1446
|
-
N(C(e(
|
|
1450
|
+
default: g(() => [
|
|
1451
|
+
N(C(e(n)("panel.cancel")), 1)
|
|
1447
1452
|
]),
|
|
1448
1453
|
_: 1
|
|
1449
1454
|
}),
|
|
@@ -1451,10 +1456,10 @@ const Ut = {
|
|
|
1451
1456
|
type: "primary",
|
|
1452
1457
|
loading: s.value,
|
|
1453
1458
|
disabled: u.value.trim() === "",
|
|
1454
|
-
onClick:
|
|
1459
|
+
onClick: v
|
|
1455
1460
|
}, {
|
|
1456
|
-
default:
|
|
1457
|
-
N(C(e(
|
|
1461
|
+
default: g(() => [
|
|
1462
|
+
N(C(e(n)("panel.create")), 1)
|
|
1458
1463
|
]),
|
|
1459
1464
|
_: 1
|
|
1460
1465
|
}, 8, ["loading", "disabled"])
|
|
@@ -1462,13 +1467,13 @@ const Ut = {
|
|
|
1462
1467
|
_: 1
|
|
1463
1468
|
})
|
|
1464
1469
|
]),
|
|
1465
|
-
default:
|
|
1470
|
+
default: g(() => [
|
|
1466
1471
|
y(e(J), {
|
|
1467
|
-
label: e(
|
|
1472
|
+
label: e(n)("panel.field-title"),
|
|
1468
1473
|
error: m.value.title?.[0] ?? m.value.slug?.[0],
|
|
1469
1474
|
required: ""
|
|
1470
1475
|
}, {
|
|
1471
|
-
default:
|
|
1476
|
+
default: g(() => [
|
|
1472
1477
|
E("div", {
|
|
1473
1478
|
ref_key: "field",
|
|
1474
1479
|
ref: c
|
|
@@ -1476,8 +1481,8 @@ const Ut = {
|
|
|
1476
1481
|
y(e(ae), {
|
|
1477
1482
|
modelValue: u.value,
|
|
1478
1483
|
"onUpdate:modelValue": w[0] || (w[0] = (p) => u.value = p),
|
|
1479
|
-
"aria-label": e(
|
|
1480
|
-
onKeyup: ie(
|
|
1484
|
+
"aria-label": e(n)("panel.field-title"),
|
|
1485
|
+
onKeyup: ie(v, ["enter"])
|
|
1481
1486
|
}, null, 8, ["modelValue", "aria-label"])
|
|
1482
1487
|
], 512)
|
|
1483
1488
|
]),
|
|
@@ -1487,7 +1492,7 @@ const Ut = {
|
|
|
1487
1492
|
_: 1
|
|
1488
1493
|
}, 8, ["open", "title"]));
|
|
1489
1494
|
}
|
|
1490
|
-
}), Xt = le(() => import("./ArticlesPage-
|
|
1495
|
+
}), Xt = le(() => import("./ArticlesPage-Cdb5wOyT.js")), Yt = le(() => import("./TagsPage-BxvjxFcc.js")), qt = le(() => import("./AuthorsPage-Catpwado.js")), ea = le(() => import("./ArticleEditorPage-B1kYMBEk.js"));
|
|
1491
1496
|
export {
|
|
1492
1497
|
Gt as A,
|
|
1493
1498
|
Zt as T,
|
|
@@ -1497,8 +1502,8 @@ export {
|
|
|
1497
1502
|
Jt as b,
|
|
1498
1503
|
G as c,
|
|
1499
1504
|
Rt as d,
|
|
1500
|
-
|
|
1501
|
-
|
|
1505
|
+
nt as e,
|
|
1506
|
+
gt as f,
|
|
1502
1507
|
yt as g,
|
|
1503
1508
|
$t as h,
|
|
1504
1509
|
Wt as i,
|
|
@@ -1514,4 +1519,4 @@ export {
|
|
|
1514
1519
|
Q as s,
|
|
1515
1520
|
F as u
|
|
1516
1521
|
};
|
|
1517
|
-
//# sourceMappingURL=index-
|
|
1522
|
+
//# sourceMappingURL=index-C_gXxP0l.js.map
|