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