@webx-ui/module-blog 0.4.7 → 0.5.0

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