@webx-ui/module-blog 0.3.0 → 0.4.1

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