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