@tager/admin-blog 2.0.1 → 2.0.2

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.mjs CHANGED
@@ -2,13 +2,12 @@ import { i18n as Ue, request as R, useResource as te, createId as ee, notEmpty a
2
2
  import { useRoute as ge, useRouter as de } from "vue-router";
3
3
  import { onMounted as oe, watch as G, computed as r, ref as E, defineComponent as pe, resolveComponent as y, openBlock as T, createBlock as M, withCtx as A, createVNode as p, createElementVNode as Y, toDisplayString as x, createElementBlock as Q, createTextVNode as Se, createCommentVNode as B, withModifiers as Ve, Fragment as J, renderList as ra, createSlots as ia } from "vue";
4
4
  import We from "lodash.isequal";
5
- import ua from "lodash.pick";
6
- import { getFilterParamAsStringArray as ie, getFilterParamAsString as Be, getFilterParams as He, DataTable as ze, AdvancedSearch as Ye, FormFieldMultiSelect as Le, FormField as Te, BaseButton as Qe, EditIcon as Ke, ContentCopyIcon as ga, DeleteIcon as je, useDataTable as Ze, formatDateTime as da, FormFooter as Je, ShortCodeConstructor as pa, FormFieldSelect as Xe, FormFieldUrlAliasInput as _e, FormFieldCheckbox as xe, FormFieldRichTextInput as ma, FormFieldFileInput as ca, SeoFieldGroup as ea, formatDate as va, createTabErrorFinder as ba, CountButton as fa, NorthIcon as ya, SouthIcon as ha, TabList as Ca } from "@tager/admin-ui";
5
+ import { getFilterParamAsStringArray as ie, getFilterParamAsString as Be, getFilterParams as He, DataTable as ze, AdvancedSearch as Ye, FormFieldMultiSelect as Le, FormField as Te, BaseButton as Qe, EditIcon as je, ContentCopyIcon as ua, DeleteIcon as Ke, useDataTable as Ze, formatDateTime as ga, FormFooter as Je, ShortCodeConstructor as da, FormFieldSelect as Xe, FormFieldUrlAliasInput as _e, FormFieldCheckbox as xe, FormFieldRichTextInput as pa, FormFieldFileInput as ma, SeoFieldGroup as ea, formatDate as ca, createTabErrorFinder as ba, CountButton as va, NorthIcon as fa, SouthIcon as ya, TabList as ha } from "@tager/admin-ui";
7
6
  import { Page as me } from "@tager/admin-layout";
8
- import { universalFieldUtils as De, DynamicField as Fa } from "@tager/admin-dynamic-field";
7
+ import { universalFieldUtils as De, DynamicField as Ca } from "@tager/admin-dynamic-field";
9
8
  import { compile as aa } from "path-to-regexp";
10
9
  import "i18next";
11
- const Sa = {
10
+ const Fa = {
12
11
  yes: "Yes",
13
12
  no: "no",
14
13
  blog: "Blog",
@@ -99,7 +98,7 @@ const Sa = {
99
98
  sortTitleAsc: "Title - A-Z",
100
99
  sortTitleDesc: "Title - Z-A",
101
100
  sortStatus: "Status"
102
- }, Da = {
101
+ }, Sa = {
103
102
  yes: "Да",
104
103
  no: "Нет",
105
104
  blog: "Блог",
@@ -191,61 +190,61 @@ const Sa = {
191
190
  sortTitleDesc: "Заголовку - Я-А",
192
191
  sortStatus: "Статусу"
193
192
  };
194
- function Pa() {
195
- Ue.addTranslations("en", "blog", Sa), Ue.addTranslations("ru", "blog", Da);
193
+ function Da() {
194
+ Ue.addTranslations("en", "blog", Fa), Ue.addTranslations("ru", "blog", Sa);
196
195
  }
197
196
  function ta(e) {
198
197
  return R.get({ path: "/admin/blog/posts", params: e });
199
198
  }
200
- function Ot() {
199
+ function $t() {
201
200
  return R.get({ path: "/admin/blog/posts/count" });
202
201
  }
203
- function La(e) {
202
+ function Pa(e) {
204
203
  return R.get({ path: `/admin/blog/posts/${e}` });
205
204
  }
206
- function Ta(e) {
205
+ function La(e) {
207
206
  return R.post({ path: `/admin/blog/posts/${e}/clone` });
208
207
  }
209
- function Ia(e) {
208
+ function Ta(e) {
210
209
  return R.post({ path: "/admin/blog/posts", body: e });
211
210
  }
212
- function Aa(e, a) {
211
+ function Ia(e, a) {
213
212
  return R.put({ path: `/admin/blog/posts/${e}`, body: a });
214
213
  }
215
- function $a(e) {
214
+ function Aa(e) {
216
215
  return R.delete({ path: `/admin/blog/posts/${e}` });
217
216
  }
218
217
  function oa(e) {
219
218
  return R.get({ path: "/admin/blog/categories", params: e });
220
219
  }
221
- function Oa(e) {
220
+ function $a(e) {
222
221
  return R.get({ path: `/admin/blog/categories/${e}` });
223
222
  }
224
- function Ua(e) {
223
+ function Oa(e) {
225
224
  return R.post({ path: "/admin/blog/categories", body: e });
226
225
  }
227
- function Ba(e, a) {
226
+ function Ua(e, a) {
228
227
  return R.put({
229
228
  path: `/admin/blog/categories/${e}`,
230
229
  body: a
231
230
  });
232
231
  }
233
- function Ea(e) {
232
+ function Ba(e) {
234
233
  return R.delete({
235
234
  path: `/admin/blog/categories/${e}`
236
235
  });
237
236
  }
238
- function ka(e, a) {
237
+ function Ea(e, a) {
239
238
  return R.post({
240
239
  path: `/admin/blog/categories/move/${e}/${a}`
241
240
  });
242
241
  }
243
- function Ra() {
242
+ function ka() {
244
243
  return R.get({
245
244
  path: "/admin/blog/module-info"
246
245
  });
247
246
  }
248
- function wa() {
247
+ function Ra() {
249
248
  const [e, a] = te({
250
249
  fetchResource: () => ta({ pageNumber: 1, pageSize: 99999, sort: "status" }),
251
250
  initialValue: [],
@@ -255,12 +254,12 @@ function wa() {
255
254
  e();
256
255
  }), a;
257
256
  }
258
- function Ma({
257
+ function wa({
259
258
  categoryId: e,
260
259
  isCreation: a
261
260
  }) {
262
261
  const [n, o] = te({
263
- fetchResource: () => Oa(e.value),
262
+ fetchResource: () => $a(e.value),
264
263
  initialValue: null,
265
264
  resourceName: "Blog category"
266
265
  });
@@ -282,7 +281,7 @@ function Ie() {
282
281
  }
283
282
  function ce() {
284
283
  const [e, a] = te({
285
- fetchResource: Ra,
284
+ fetchResource: ka,
286
285
  initialValue: null,
287
286
  resourceName: "Module configuration"
288
287
  });
@@ -310,11 +309,11 @@ function $e(e) {
310
309
  categoryId: e.categoryId
311
310
  });
312
311
  }
313
- function Ga(e) {
312
+ function Ma(e) {
314
313
  return Array.from({ length: e }, (a, n) => n);
315
314
  }
316
315
  function ae(e, a) {
317
- return Ga(a).map(() => "—").join(" ") + " " + e;
316
+ return Ma(a).map(() => "—").join(" ") + " " + e;
318
317
  }
319
318
  const la = (e) => [
320
319
  { label: e("blog:statusPublished"), value: "PUBLISHED" },
@@ -349,7 +348,7 @@ function he(e, a, n, o, t) {
349
348
  const d = a.find(
350
349
  (s) => s.value === e.language
351
350
  ), c = n.filter(
352
- (s) => e.relatedPosts.some((v) => v.id === s.value)
351
+ (s) => e.relatedPosts.some((b) => b.id === s.value)
353
352
  ), C = t.find(({ value: s }) => s === e.status) ?? t[0];
354
353
  return {
355
354
  title: e.title,
@@ -371,12 +370,12 @@ function he(e, a, n, o, t) {
371
370
  relatedPosts: c,
372
371
  tags: e.tags.join(","),
373
372
  additionalFields: o.map((s) => {
374
- const v = e.additionalFields.find(
375
- ({ name: b }) => b === s.name
373
+ const b = e.additionalFields.find(
374
+ ({ name: v }) => v === s.name
376
375
  );
377
376
  return De.createFormField(
378
377
  s,
379
- v == null ? void 0 : v.value
378
+ b == null ? void 0 : b.value
380
379
  );
381
380
  }),
382
381
  status: C,
@@ -413,19 +412,19 @@ function na(e) {
413
412
  publishAt: e.status.value === "DRAFT" && e.statusDateEnabled && e.statusDate ? e.statusDate : null
414
413
  };
415
414
  }
416
- function Na(e) {
415
+ function Ga(e) {
417
416
  return {
418
417
  ...na(e),
419
418
  urlAlias: e.urlAlias
420
419
  };
421
420
  }
422
- function qa(e, a) {
421
+ function Na(e, a) {
423
422
  return e.filter(({ language: n }) => a ? n === a : !0).map(({ id: n, name: o, depth: t }) => ({
424
423
  value: n,
425
424
  label: ae(o, t)
426
425
  }));
427
426
  }
428
- function Va(e, a, n) {
427
+ function qa(e, a, n) {
429
428
  return e.filter(
430
429
  (o) => a ? o.categories.some(({ id: t }) => t === a.id) : !0
431
430
  ).map((o) => {
@@ -439,14 +438,14 @@ function Va(e, a, n) {
439
438
  return o;
440
439
  });
441
440
  }
442
- function Wa(e) {
441
+ function Va(e) {
443
442
  return {
444
443
  PUBLISHED: e("blog:statusPublished"),
445
444
  DRAFT: e("blog:statusDraft"),
446
445
  ARCHIVED: e("blog:statusArchived")
447
446
  };
448
447
  }
449
- function Ha(e, a) {
448
+ function Wa(e, a) {
450
449
  const n = e ? e.languages.length > 0 : !1;
451
450
  return [
452
451
  {
@@ -513,7 +512,7 @@ function Ha(e, a) {
513
512
  }
514
513
  ].filter(ke);
515
514
  }
516
- function za(e) {
515
+ function Ha(e) {
517
516
  return [
518
517
  {
519
518
  value: "datetime_desc",
@@ -538,7 +537,7 @@ function za(e) {
538
537
  ];
539
538
  }
540
539
  const re = (e) => e.split("-").reverse().join(".");
541
- function Ya({
540
+ function za({
542
541
  t: e,
543
542
  route: a,
544
543
  categoryList: n,
@@ -565,7 +564,7 @@ function Ya({
565
564
  });
566
565
  const s = r(
567
566
  () => o.value.map(({ id: l, name: m }) => ({ value: l, label: m }))
568
- ), v = r(() => {
567
+ ), b = r(() => {
569
568
  const l = ie(
570
569
  a.query,
571
570
  "language"
@@ -574,9 +573,9 @@ function Ya({
574
573
  return s.value.filter(
575
574
  ({ value: m }) => l.some(($) => $ === m)
576
575
  );
577
- }), b = E(v.value);
578
- G(v, () => {
579
- b.value = v.value;
576
+ }), v = E(b.value);
577
+ G(b, () => {
578
+ v.value = b.value;
580
579
  });
581
580
  const L = r(
582
581
  () => Be(
@@ -626,7 +625,7 @@ function Ya({
626
625
  const u = r(() => {
627
626
  const l = {
628
627
  category: C.value.map(({ value: m }) => m),
629
- language: b.value.map(({ value: m }) => m),
628
+ language: v.value.map(({ value: m }) => m),
630
629
  status: D.value.map(({ value: m }) => m)
631
630
  };
632
631
  return F.value && (l[
@@ -640,7 +639,7 @@ function Ya({
640
639
  function V(l) {
641
640
  l.name === "category" && (C.value = C.value.filter(
642
641
  ({ value: m }) => m !== l.value
643
- )), l.name === "language" && (b.value = b.value.filter(
642
+ )), l.name === "language" && (v.value = v.value.filter(
644
643
  ({ value: m }) => m !== l.value
645
644
  )), l.name === "from-date" && (F.value = "", g.value = ""), l.name === "status" && (D.value = D.value.filter(
646
645
  ({ value: m }) => m !== l.value
@@ -654,7 +653,7 @@ function Ya({
654
653
  name: "category",
655
654
  title: e("blog:category")
656
655
  })),
657
- ...b.value.map(({ value: l, label: m }) => ({
656
+ ...v.value.map(({ value: l, label: m }) => ({
658
657
  value: l,
659
658
  label: m,
660
659
  name: "language",
@@ -668,8 +667,8 @@ function Ya({
668
667
  title: e("blog:status")
669
668
  }))
670
669
  ].filter(Fe)
671
- ), W = r(() => b.value.length === 0 ? d.value : n.value.filter(
672
- ({ language: m }) => b.value.some(({ value: $ }) => $ === m)
670
+ ), W = r(() => v.value.length === 0 ? d.value : n.value.filter(
671
+ ({ language: m }) => v.value.some(({ value: $ }) => $ === m)
673
672
  ).map(({ id: m, name: $, depth: q }) => ({
674
673
  value: String(m),
675
674
  label: ae($, q)
@@ -677,7 +676,7 @@ function Ya({
677
676
  return {
678
677
  categoryFilter: C,
679
678
  categoryOptionList: W,
680
- languageFilter: b,
679
+ languageFilter: v,
681
680
  languageOptionList: s,
682
681
  fromDateFilter: F,
683
682
  toDateFilter: g,
@@ -687,12 +686,17 @@ function Ya({
687
686
  filterParams: u
688
687
  };
689
688
  }
689
+ function Ya(e, a) {
690
+ return Object.fromEntries(
691
+ Object.entries(e).filter(([n]) => a.includes(n))
692
+ );
693
+ }
690
694
  const Qa = pe({
691
695
  name: "PostList",
692
696
  components: {
693
- DeleteIcon: je,
694
- ContentCopyIcon: ga,
695
- EditIcon: Ke,
697
+ DeleteIcon: Ke,
698
+ ContentCopyIcon: ua,
699
+ EditIcon: je,
696
700
  BaseButton: Qe,
697
701
  FormField: Te,
698
702
  FormFieldMultiSelect: Le,
@@ -706,11 +710,11 @@ const Qa = pe({
706
710
  var P;
707
711
  return ((P = d.value) == null ? void 0 : P.languages) ?? [];
708
712
  }
709
- ), { data: s, loading: v } = Ie(), b = r(
713
+ ), { data: s, loading: b } = Ie(), v = r(
710
714
  () => o.value ? s.value.find(
711
715
  ({ id: P }) => String(P) === String(o.value)
712
716
  ) ?? null : null
713
- ), L = r(() => b.value ? `${e("blog:postsByCategory")} "${b.value.name}"` : e("blog:posts")), F = r(
717
+ ), L = r(() => v.value ? `${e("blog:postsByCategory")} "${v.value.name}"` : e("blog:posts")), F = r(
714
718
  () => h.value.length > 1
715
719
  ), {
716
720
  categoryFilter: I,
@@ -723,23 +727,23 @@ const Qa = pe({
723
727
  tags: w,
724
728
  tagRemovalHandler: W,
725
729
  statusFilter: l
726
- } = Ya({
730
+ } = za({
727
731
  t: e,
728
732
  route: a,
729
733
  categoryList: s,
730
734
  languageList: C,
731
735
  statusOptionList: t
732
- }), m = za(e), {
736
+ }), m = Ha(e), {
733
737
  fetchEntityList: $,
734
738
  isLoading: q,
735
- rowData: j,
739
+ rowData: K,
736
740
  errorMessage: X,
737
741
  searchQuery: U,
738
742
  handleChange: S,
739
743
  pageNumber: k,
740
744
  pageCount: _,
741
- pageSize: K,
742
- sort: be
745
+ pageSize: j,
746
+ sort: ve
743
747
  } = Ze({
744
748
  fetchEntityList: (P) => ta({
745
749
  query: P.searchQuery,
@@ -754,10 +758,10 @@ const Qa = pe({
754
758
  defaultSort: m[0].value
755
759
  });
756
760
  G(V, () => {
757
- if (c.value || v.value)
761
+ if (c.value || b.value)
758
762
  return;
759
763
  const P = {
760
- ...ua(a.query, ["query", "pageNumber", "sort"]),
764
+ ...Ya(a.query, ["query", "pageNumber", "sort"]),
761
765
  ...V.value
762
766
  };
763
767
  We(a.query, P) || (n.replace({ query: P }), $());
@@ -765,20 +769,20 @@ const Qa = pe({
765
769
  const fe = r(
766
770
  () => {
767
771
  var P;
768
- return Va(
769
- j.value,
770
- b.value,
772
+ return qa(
773
+ K.value,
774
+ v.value,
771
775
  ((P = d.value) == null ? void 0 : P.languages) ?? []
772
776
  );
773
777
  }
774
778
  ), le = r(
775
- () => v.value || q.value || c.value
779
+ () => b.value || q.value || c.value
776
780
  ), { isDeleting: ne, handleResourceDelete: se } = Re({
777
- deleteResource: $a,
781
+ deleteResource: Aa,
778
782
  resourceName: "Post",
779
783
  onSuccess: $
780
784
  }), { isCloning: i, handleResourceClone: O } = sa({
781
- cloneResource: Ta,
785
+ cloneResource: La,
782
786
  confirmMessage: e("blog:cloneConfirm"),
783
787
  successMessage: e("blog:cloneSuccess"),
784
788
  failureMessage: e("blog:cloneFailure"),
@@ -788,14 +792,14 @@ const Qa = pe({
788
792
  return ne(P) || i(P) || le.value;
789
793
  }
790
794
  const z = r(
791
- () => Ha(d.value, e)
795
+ () => Wa(d.value, e)
792
796
  );
793
797
  return {
794
798
  t: e,
795
- formatDateTime: da,
799
+ formatDateTime: ga,
796
800
  columnDefs: z,
797
801
  sortOptions: m,
798
- sortValue: be,
802
+ sortValue: ve,
799
803
  rowData: fe,
800
804
  handleResourceDelete: se,
801
805
  isDeleting: ne,
@@ -808,7 +812,7 @@ const Qa = pe({
808
812
  handleChange: S,
809
813
  pageNumber: k,
810
814
  pageCount: _,
811
- pageSize: K,
815
+ pageSize: j,
812
816
  // Advanced search
813
817
  categoryFilter: I,
814
818
  categoryOptionList: g,
@@ -821,20 +825,20 @@ const Qa = pe({
821
825
  statusOptionList: t,
822
826
  tags: w,
823
827
  tagRemovalHandler: W,
824
- getStatuses: Wa,
828
+ getStatuses: Va,
825
829
  // Clone
826
830
  handleResourceClone: O,
827
831
  isBusy: H
828
832
  };
829
833
  }
830
- }), ve = (e, a) => {
834
+ }), be = (e, a) => {
831
835
  const n = e.__vccOpts || e;
832
836
  for (const [o, t] of a)
833
837
  n[o] = t;
834
838
  return n;
835
- }, Ka = { class: "filters" }, ja = { class: "filters" }, Za = { class: "status" }, Ja = { key: 0 }, Xa = { key: 1 };
839
+ }, ja = { class: "filters" }, Ka = { class: "filters" }, Za = { class: "status" }, Ja = { key: 0 }, Xa = { key: 1 };
836
840
  function _a(e, a, n, o, t, d) {
837
- const c = y("FormFieldMultiSelect"), C = y("FormField"), s = y("AdvancedSearch"), v = y("EditIcon"), b = y("BaseButton"), L = y("ContentCopyIcon"), F = y("DeleteIcon"), I = y("DataTable"), g = y("Page");
841
+ const c = y("FormFieldMultiSelect"), C = y("FormField"), s = y("AdvancedSearch"), b = y("EditIcon"), v = y("BaseButton"), L = y("ContentCopyIcon"), F = y("DeleteIcon"), I = y("DataTable"), g = y("Page");
838
842
  return T(), M(g, {
839
843
  title: e.pageTitle,
840
844
  "header-buttons": [
@@ -867,7 +871,7 @@ function _a(e, a, n, o, t, d) {
867
871
  "onClick:tag": e.tagRemovalHandler
868
872
  }, {
869
873
  default: A(() => [
870
- Y("div", Ka, [
874
+ Y("div", ja, [
871
875
  p(c, {
872
876
  "selected-options": e.categoryFilter,
873
877
  "onUpdate:selectedOptions": a[0] || (a[0] = (f) => e.categoryFilter = f),
@@ -897,7 +901,7 @@ function _a(e, a, n, o, t, d) {
897
901
  class: "filter"
898
902
  }, null, 8, ["selected-options", "options", "label"])
899
903
  ]),
900
- Y("div", ja, [
904
+ Y("div", Ka, [
901
905
  p(C, {
902
906
  value: e.fromDateFilter,
903
907
  "onUpdate:value": a[3] || (a[3] = (f) => e.fromDateFilter = f),
@@ -933,18 +937,18 @@ function _a(e, a, n, o, t, d) {
933
937
  ])
934
938
  ]),
935
939
  "cell(actions)": A(({ row: f }) => [
936
- p(b, {
940
+ p(v, {
937
941
  variant: "icon",
938
942
  title: e.$i18n.t("blog:edit"),
939
943
  disabled: e.isBusy(f.id),
940
944
  href: e.getBlogPostFormUrl({ postId: f.id })
941
945
  }, {
942
946
  default: A(() => [
943
- p(v)
947
+ p(b)
944
948
  ]),
945
949
  _: 1
946
950
  }, 8, ["title", "disabled", "href"]),
947
- p(b, {
951
+ p(v, {
948
952
  variant: "icon",
949
953
  title: e.$i18n.t("blog:clone"),
950
954
  disabled: e.isBusy(f.id),
@@ -955,7 +959,7 @@ function _a(e, a, n, o, t, d) {
955
959
  ]),
956
960
  _: 1
957
961
  }, 8, ["title", "disabled", "onClick"]),
958
- p(b, {
962
+ p(v, {
959
963
  variant: "icon",
960
964
  title: e.$i18n.t("blog:remove"),
961
965
  disabled: e.isBusy(f.id),
@@ -973,36 +977,36 @@ function _a(e, a, n, o, t, d) {
973
977
  _: 1
974
978
  }, 8, ["title", "header-buttons"]);
975
979
  }
976
- const xa = /* @__PURE__ */ ve(Qa, [["render", _a], ["__scopeId", "data-v-7b6e97da"]]), et = pe({
980
+ const xa = /* @__PURE__ */ be(Qa, [["render", _a], ["__scopeId", "data-v-3b010d12"]]), et = pe({
977
981
  name: "BlogPostForm",
978
982
  components: {
979
983
  SeoFieldGroup: ea,
980
984
  FormFieldMultiSelect: Le,
981
- FormFieldFileInput: ca,
982
- FormFieldRichTextInput: ma,
985
+ FormFieldFileInput: ma,
986
+ FormFieldRichTextInput: pa,
983
987
  FormFieldCheckbox: xe,
984
988
  FormFieldUrlAliasInput: _e,
985
989
  FormField: Te,
986
990
  FormFieldSelect: Xe,
987
991
  Page: me,
988
- DynamicField: Fa,
989
- ShortCodeConstructor: pa,
992
+ DynamicField: Ca,
993
+ ShortCodeConstructor: da,
990
994
  FormFooter: Je
991
995
  },
992
996
  setup() {
993
997
  var se;
994
- const e = ge(), a = de(), n = we(), { t: o } = ue(), t = r(() => e.params.postId), d = r(() => t.value === "create"), c = E(!1), C = r(() => la(o)), { data: s, loading: v } = ce(), b = r(
998
+ const e = ge(), a = de(), n = we(), { t: o } = ue(), t = r(() => e.params.postId), d = r(() => t.value === "create"), c = E(!1), C = r(() => la(o)), { data: s, loading: b } = ce(), v = r(
995
999
  () => {
996
1000
  var i;
997
1001
  return ((i = s.value) == null ? void 0 : i.languages) ?? [];
998
1002
  }
999
1003
  ), L = r(
1000
- () => b.value.map(({ id: i, name: O }) => ({
1004
+ () => v.value.map(({ id: i, name: O }) => ({
1001
1005
  value: i,
1002
1006
  label: O
1003
1007
  }))
1004
1008
  ), F = r(() => L.value.length > 0), { data: I, loading: g } = Ie(), [f, { data: h, loading: D }] = te({
1005
- fetchResource: () => t.value ? La(t.value) : new Promise(() => null),
1009
+ fetchResource: () => t.value ? Pa(t.value) : new Promise(() => null),
1006
1010
  initialValue: null,
1007
1011
  resourceName: "Post"
1008
1012
  });
@@ -1011,13 +1015,13 @@ const xa = /* @__PURE__ */ ve(Qa, [["render", _a], ["__scopeId", "data-v-7b6e97d
1011
1015
  }), G(t, () => {
1012
1016
  d.value || f();
1013
1017
  });
1014
- const { data: u, loading: V } = wa(), w = r(
1018
+ const { data: u, loading: V } = Ra(), w = r(
1015
1019
  () => u.value.filter((i) => {
1016
1020
  var O;
1017
1021
  return i.id !== ((O = h.value) == null ? void 0 : O.id);
1018
1022
  }).map((i) => ({
1019
1023
  value: i.id,
1020
- label: (i.status === "ARCHIVED" ? `${o("blog:statusArchived")} - ` : i.status === "DRAFT" ? `${o("blog:statusDraft")} - ` : i.datetime ? va(new Date(i.datetime)) + " - " : "") + i.title
1024
+ label: (i.status === "ARCHIVED" ? `${o("blog:statusArchived")} - ` : i.status === "DRAFT" ? `${o("blog:statusDraft")} - ` : i.datetime ? ca(new Date(i.datetime)) + " - " : "") + i.title
1021
1025
  }))
1022
1026
  ), W = E(!1), l = E(
1023
1027
  he(
@@ -1040,8 +1044,8 @@ const xa = /* @__PURE__ */ ve(Qa, [["render", _a], ["__scopeId", "data-v-7b6e97d
1040
1044
  });
1041
1045
  function $(i) {
1042
1046
  W.value = !0;
1043
- const O = na(l.value), H = Na(l.value);
1044
- (d.value ? Ia(O) : Aa(t.value, H)).then(({ data: P }) => {
1047
+ const O = na(l.value), H = Ga(l.value);
1048
+ (d.value ? Ta(O) : Ia(t.value, H)).then(({ data: P }) => {
1045
1049
  var Z;
1046
1050
  m.value = {}, i.type === "create" && a.push(Ae({ postId: String(P.id) })), (i.type === "create_exit" || i.type === "save_exit") && Ge(a, Pe()), i.type === "create_create-another" && (l.value = he(
1047
1051
  null,
@@ -1067,7 +1071,7 @@ const xa = /* @__PURE__ */ ve(Qa, [["render", _a], ["__scopeId", "data-v-7b6e97d
1067
1071
  const q = r(
1068
1072
  () => {
1069
1073
  var i;
1070
- return qa(
1074
+ return Na(
1071
1075
  I.value,
1072
1076
  ((i = l.value.language) == null ? void 0 : i.value) ?? null
1073
1077
  );
@@ -1090,8 +1094,8 @@ const xa = /* @__PURE__ */ ve(Qa, [["render", _a], ["__scopeId", "data-v-7b6e97d
1090
1094
  }
1091
1095
  l.value.categories = l.value.categories.filter(i);
1092
1096
  });
1093
- const j = r(
1094
- () => D.value || g.value || V.value || v.value
1097
+ const K = r(
1098
+ () => D.value || g.value || V.value || b.value
1095
1099
  );
1096
1100
  function X() {
1097
1101
  var i;
@@ -1149,14 +1153,14 @@ const xa = /* @__PURE__ */ ve(Qa, [["render", _a], ["__scopeId", "data-v-7b6e97d
1149
1153
  } : null
1150
1154
  ].filter(Fe)
1151
1155
  );
1152
- function K({
1156
+ function j({
1153
1157
  title: i,
1154
1158
  description: O,
1155
1159
  image: H
1156
1160
  }) {
1157
1161
  l.value.pageTitle = i, l.value.pageDescription = O, l.value.openGraphImage = H;
1158
1162
  }
1159
- function be(i) {
1163
+ function ve(i) {
1160
1164
  d.value && c.value === !1 && (l.value.urlAlias = Me(i));
1161
1165
  }
1162
1166
  function fe() {
@@ -1194,7 +1198,7 @@ const xa = /* @__PURE__ */ ve(Qa, [["render", _a], ["__scopeId", "data-v-7b6e97d
1194
1198
  categoryOptionList: q,
1195
1199
  values: l,
1196
1200
  errors: m,
1197
- isContentLoading: j,
1201
+ isContentLoading: K,
1198
1202
  postListUrl: Pe(),
1199
1203
  submitForm: $,
1200
1204
  isLangSpecific: F,
@@ -1206,8 +1210,8 @@ const xa = /* @__PURE__ */ ve(Qa, [["render", _a], ["__scopeId", "data-v-7b6e97d
1206
1210
  tabList: S,
1207
1211
  selectedTabId: k,
1208
1212
  headerButtonList: _,
1209
- handleSeoFieldGroupChange: K,
1210
- handleTitleChange: be,
1213
+ handleSeoFieldGroupChange: j,
1214
+ handleTitleChange: ve,
1211
1215
  handleAliasChange: fe,
1212
1216
  urlAliasTemplate: le,
1213
1217
  handleCategoriesChange: ne,
@@ -1222,7 +1226,7 @@ const xa = /* @__PURE__ */ ve(Qa, [["render", _a], ["__scopeId", "data-v-7b6e97d
1222
1226
  class: "status-date"
1223
1227
  };
1224
1228
  function nt(e, a, n, o, t, d) {
1225
- const c = y("FormFieldSelect"), C = y("FormField"), s = y("FormFieldUrlAliasInput"), v = y("FormFieldCheckbox"), b = y("FormFieldRichTextInput"), L = y("ShortCodeConstructor"), F = y("FormFieldFileInput"), I = y("FormFieldMultiSelect"), g = y("DynamicField"), f = y("SeoFieldGroup"), h = y("FormFooter"), D = y("Page");
1229
+ const c = y("FormFieldSelect"), C = y("FormField"), s = y("FormFieldUrlAliasInput"), b = y("FormFieldCheckbox"), v = y("FormFieldRichTextInput"), L = y("ShortCodeConstructor"), F = y("FormFieldFileInput"), I = y("FormFieldMultiSelect"), g = y("DynamicField"), f = y("SeoFieldGroup"), h = y("FormFooter"), D = y("Page");
1226
1230
  return T(), M(D, {
1227
1231
  "tab-id": e.selectedTabId,
1228
1232
  "onUpdate:tabId": a[16] || (a[16] = (u) => e.selectedTabId = u),
@@ -1283,7 +1287,7 @@ function nt(e, a, n, o, t, d) {
1283
1287
  }, null, 8, ["value", "error", "label", "no-options-message", "options"])
1284
1288
  ]),
1285
1289
  e.values.status.value === "PUBLISHED" || e.values.status.value === "DRAFT" ? (T(), Q("div", ot, [
1286
- p(v, {
1290
+ p(b, {
1287
1291
  checked: e.values.statusDateEnabled,
1288
1292
  "onUpdate:checked": a[4] || (a[4] = (u) => e.values.statusDateEnabled = u),
1289
1293
  name: "statusDateEnabled",
@@ -1322,7 +1326,7 @@ function nt(e, a, n, o, t, d) {
1322
1326
  type: "textarea",
1323
1327
  error: e.errors.excerpt
1324
1328
  }, null, 8, ["value", "label", "error"]),
1325
- p(b, {
1329
+ p(v, {
1326
1330
  value: e.values.body,
1327
1331
  "onUpdate:value": a[8] || (a[8] = (u) => e.values.body = u),
1328
1332
  name: "body",
@@ -1419,7 +1423,7 @@ function nt(e, a, n, o, t, d) {
1419
1423
  _: 1
1420
1424
  }, 8, ["tab-id", "title", "is-content-loading", "header-buttons", "footer", "tabs"]);
1421
1425
  }
1422
- const st = /* @__PURE__ */ ve(et, [["render", nt], ["__scopeId", "data-v-66887350"]]);
1426
+ const st = /* @__PURE__ */ be(et, [["render", nt], ["__scopeId", "data-v-66887350"]]);
1423
1427
  function rt(e, a) {
1424
1428
  return e.map((n) => {
1425
1429
  if (a.length > 0) {
@@ -1485,15 +1489,15 @@ function ut(e) {
1485
1489
  }
1486
1490
  function gt({ languageList: e, route: a, t: n }) {
1487
1491
  const o = r(
1488
- () => e.value.map(({ id: v, name: b }) => ({ value: v, label: b }))
1492
+ () => e.value.map(({ id: b, name: v }) => ({ value: b, label: v }))
1489
1493
  ), t = r(() => {
1490
- const v = ie(
1494
+ const b = ie(
1491
1495
  a.query,
1492
1496
  "language"
1493
1497
  /* LANGUAGE */
1494
1498
  );
1495
1499
  return o.value.filter(
1496
- ({ value: b }) => v.some((L) => L === b)
1500
+ ({ value: v }) => b.some((L) => L === v)
1497
1501
  );
1498
1502
  }), d = E(t.value);
1499
1503
  G(t, () => {
@@ -1501,18 +1505,18 @@ function gt({ languageList: e, route: a, t: n }) {
1501
1505
  });
1502
1506
  const c = r(
1503
1507
  () => He({
1504
- language: d.value.map(({ value: v }) => v)
1508
+ language: d.value.map(({ value: b }) => b)
1505
1509
  })
1506
1510
  );
1507
- function C(v) {
1508
- v.name === "language" && (d.value = d.value.filter(
1509
- ({ value: b }) => b !== v.value
1511
+ function C(b) {
1512
+ b.name === "language" && (d.value = d.value.filter(
1513
+ ({ value: v }) => v !== b.value
1510
1514
  ));
1511
1515
  }
1512
1516
  const s = r(() => [
1513
- ...d.value.map(({ value: v, label: b }) => ({
1514
- value: v,
1515
- label: b,
1517
+ ...d.value.map(({ value: b, label: v }) => ({
1518
+ value: b,
1519
+ label: v,
1516
1520
  name: "language",
1517
1521
  title: n("blog:language")
1518
1522
  }))
@@ -1528,12 +1532,12 @@ function gt({ languageList: e, route: a, t: n }) {
1528
1532
  const dt = pe({
1529
1533
  name: "BlogCategoryList",
1530
1534
  components: {
1531
- DeleteIcon: je,
1532
- SouthIcon: ha,
1533
- NorthIcon: ya,
1534
- EditIcon: Ke,
1535
+ DeleteIcon: Ke,
1536
+ SouthIcon: ya,
1537
+ NorthIcon: fa,
1538
+ EditIcon: je,
1535
1539
  BaseButton: Qe,
1536
- CountButton: fa,
1540
+ CountButton: va,
1537
1541
  FormFieldMultiSelect: Le,
1538
1542
  AdvancedSearch: Ye,
1539
1543
  Page: me,
@@ -1549,8 +1553,8 @@ const dt = pe({
1549
1553
  languageFilter: c,
1550
1554
  languageOptionList: C,
1551
1555
  filterParams: s,
1552
- tags: v,
1553
- tagRemovalHandler: b
1556
+ tags: b,
1557
+ tagRemovalHandler: v
1554
1558
  } = gt({ languageList: d, route: a, t: e }), L = r(
1555
1559
  () => C.value.length > 1
1556
1560
  ), {
@@ -1584,12 +1588,12 @@ const dt = pe({
1584
1588
  We(a.query, U) || (n.replace({ query: U }), F());
1585
1589
  });
1586
1590
  const { isDeleting: W, handleResourceDelete: l } = Re({
1587
- deleteResource: Ea,
1591
+ deleteResource: Ba,
1588
1592
  resourceName: "Post",
1589
1593
  onSuccess: F
1590
1594
  }), m = E(!1);
1591
1595
  function $(U, S) {
1592
- m.value = !0, ka(U, S).then((k) => {
1596
+ m.value = !0, Ea(U, S).then((k) => {
1593
1597
  if (k.success)
1594
1598
  return F();
1595
1599
  }).catch(console.error).finally(() => {
@@ -1598,14 +1602,14 @@ const dt = pe({
1598
1602
  }
1599
1603
  const q = r(
1600
1604
  () => I.value || t.value
1601
- ), j = r(
1605
+ ), K = r(
1602
1606
  () => rt(g.value, d.value)
1603
1607
  );
1604
1608
  return {
1605
1609
  columnDefs: r(
1606
1610
  () => it(o.value, e)
1607
1611
  ),
1608
- rowData: j,
1612
+ rowData: K,
1609
1613
  isRowDataLoading: q,
1610
1614
  errorMessage: f,
1611
1615
  isLangSpecific: L,
@@ -1622,13 +1626,13 @@ const dt = pe({
1622
1626
  pageSize: w,
1623
1627
  languageFilter: c,
1624
1628
  languageOptionList: C,
1625
- tags: v,
1626
- tagRemovalHandler: b
1629
+ tags: b,
1630
+ tagRemovalHandler: v
1627
1631
  };
1628
1632
  }
1629
1633
  }), pt = { class: "filters" };
1630
1634
  function mt(e, a, n, o, t, d) {
1631
- const c = y("FormFieldMultiSelect"), C = y("AdvancedSearch"), s = y("CountButton"), v = y("EditIcon"), b = y("BaseButton"), L = y("NorthIcon"), F = y("SouthIcon"), I = y("DeleteIcon"), g = y("DataTable"), f = y("Page");
1635
+ const c = y("FormFieldMultiSelect"), C = y("AdvancedSearch"), s = y("CountButton"), b = y("EditIcon"), v = y("BaseButton"), L = y("NorthIcon"), F = y("SouthIcon"), I = y("DeleteIcon"), g = y("DataTable"), f = y("Page");
1632
1636
  return T(), M(f, {
1633
1637
  title: e.$i18n.t("blog:blogCategories"),
1634
1638
  "header-buttons": [
@@ -1667,18 +1671,18 @@ function mt(e, a, n, o, t, d) {
1667
1671
  }, 8, ["href", "count"])
1668
1672
  ]),
1669
1673
  "cell(actions)": A(({ row: h, rowIndex: D }) => [
1670
- p(b, {
1674
+ p(v, {
1671
1675
  variant: "icon",
1672
1676
  title: e.$i18n.t("blog:edit"),
1673
1677
  disabled: e.isDeleting(h.id),
1674
1678
  href: e.getBlogCategoryFormUrl({ categoryId: h.id })
1675
1679
  }, {
1676
1680
  default: A(() => [
1677
- p(v)
1681
+ p(b)
1678
1682
  ]),
1679
1683
  _: 1
1680
1684
  }, 8, ["title", "disabled", "href"]),
1681
- p(b, {
1685
+ p(v, {
1682
1686
  variant: "icon",
1683
1687
  title: e.$i18n.t("blog:moveUp"),
1684
1688
  disabled: D === 0 || e.isCategoryMoving,
@@ -1689,7 +1693,7 @@ function mt(e, a, n, o, t, d) {
1689
1693
  ]),
1690
1694
  _: 1
1691
1695
  }, 8, ["title", "disabled", "onClick"]),
1692
- p(b, {
1696
+ p(v, {
1693
1697
  variant: "icon",
1694
1698
  title: e.$i18n.t("blog:moveDown"),
1695
1699
  disabled: D === e.rowData.length - 1 || e.isCategoryMoving,
@@ -1700,7 +1704,7 @@ function mt(e, a, n, o, t, d) {
1700
1704
  ]),
1701
1705
  _: 1
1702
1706
  }, 8, ["title", "disabled", "onClick"]),
1703
- p(b, {
1707
+ p(v, {
1704
1708
  variant: "icon",
1705
1709
  title: e.$i18n.t("blog:remove"),
1706
1710
  disabled: e.isDeleting(h.id) || h.postsCount > 0,
@@ -1744,7 +1748,7 @@ function mt(e, a, n, o, t, d) {
1744
1748
  _: 1
1745
1749
  }, 8, ["title", "header-buttons"]);
1746
1750
  }
1747
- const ct = /* @__PURE__ */ ve(dt, [["render", mt]]);
1751
+ const ct = /* @__PURE__ */ be(dt, [["render", mt]]);
1748
1752
  function Ce(e, a, n) {
1749
1753
  const o = a.find(
1750
1754
  ({ value: t }) => t === (e == null ? void 0 : e.language)
@@ -1775,7 +1779,7 @@ function Ce(e, a, n) {
1775
1779
  openGraphImage: null
1776
1780
  };
1777
1781
  }
1778
- function vt(e) {
1782
+ function bt(e) {
1779
1783
  var a, n;
1780
1784
  return {
1781
1785
  language: ((a = e.language) == null ? void 0 : a.value) ?? null,
@@ -1788,7 +1792,7 @@ function vt(e) {
1788
1792
  openGraphImage: ((n = e.openGraphImage) == null ? void 0 : n.file.id) ?? null
1789
1793
  };
1790
1794
  }
1791
- function bt(e, a, n) {
1795
+ function vt(e, a, n) {
1792
1796
  return [
1793
1797
  { value: null, label: n("blog:noParent") },
1794
1798
  ...e.filter(({ language: o }) => a ? o === a : !0).map(({ id: o, name: t, depth: d }) => ({
@@ -1803,7 +1807,7 @@ const ft = pe({
1803
1807
  Page: me,
1804
1808
  SeoFieldGroup: ea,
1805
1809
  FormFieldCheckbox: xe,
1806
- TabList: Ca,
1810
+ TabList: ha,
1807
1811
  FormFieldUrlAliasInput: _e,
1808
1812
  FormField: Te,
1809
1813
  FormFieldSelect: Xe,
@@ -1817,45 +1821,45 @@ const ft = pe({
1817
1821
  var S;
1818
1822
  return ((S = c.value) == null ? void 0 : S.languages) ?? [];
1819
1823
  }
1820
- ), v = r(
1821
- () => s.value.map(({ id: S, name: k }) => ({ value: S, label: k }))
1822
1824
  ), b = r(
1823
- () => v.value.length > 0
1825
+ () => s.value.map(({ id: S, name: k }) => ({ value: S, label: k }))
1826
+ ), v = r(
1827
+ () => b.value.length > 0
1824
1828
  ), L = r(
1825
1829
  () => {
1826
1830
  var S, k;
1827
1831
  return ((k = (S = c.value) == null ? void 0 : S.fileScenarios) == null ? void 0 : k.openGraph) ?? null;
1828
1832
  }
1829
- ), { data: F, loading: I } = Ie(), { data: g, loading: f } = Ma({
1833
+ ), { data: F, loading: I } = Ie(), { data: g, loading: f } = wa({
1830
1834
  categoryId: t,
1831
1835
  isCreation: d
1832
1836
  }), h = E(!1), D = E(
1833
- Ce(g.value, v.value, e)
1837
+ Ce(g.value, b.value, e)
1834
1838
  ), u = E({});
1835
- G([g, v], () => {
1839
+ G([g, b], () => {
1836
1840
  D.value = Ce(
1837
1841
  g.value,
1838
- v.value,
1842
+ b.value,
1839
1843
  e
1840
1844
  );
1841
1845
  });
1842
1846
  function V(S) {
1843
1847
  h.value = !0;
1844
- const k = vt(D.value);
1845
- (d.value ? Ua(k) : Ba(t.value, k)).then(({ data: K }) => {
1848
+ const k = bt(D.value);
1849
+ (d.value ? Oa(k) : Ua(t.value, k)).then(({ data: j }) => {
1846
1850
  u.value = {}, S.type === "create" && a.push(
1847
- $e({ categoryId: String(K.id) })
1851
+ $e({ categoryId: String(j.id) })
1848
1852
  ), (S.type === "create_exit" || S.type === "save_exit") && Ge(a, Ee()), S.type === "create_create-another" && (D.value = Ce(
1849
1853
  null,
1850
- v.value,
1854
+ b.value,
1851
1855
  e
1852
1856
  )), o.show({
1853
1857
  variant: "success",
1854
1858
  title: e("blog:success"),
1855
1859
  body: d.value ? e("blog:blogCategoryWasSuccessfullyCreated") : e("blog:blogCategoryWasSuccessfullyUpdated")
1856
1860
  });
1857
- }).catch((K) => {
1858
- console.error(K), u.value = Ne(K), o.show({
1861
+ }).catch((j) => {
1862
+ console.error(j), u.value = Ne(j), o.show({
1859
1863
  variant: "danger",
1860
1864
  title: e("blog:error"),
1861
1865
  body: d.value ? e("blog:blogCategoryCreationWasFailed") : e("blog:blogCategoryUpdateWasFailed")
@@ -1867,7 +1871,7 @@ const ft = pe({
1867
1871
  const w = r(
1868
1872
  () => {
1869
1873
  var S;
1870
- return bt(
1874
+ return vt(
1871
1875
  F.value,
1872
1876
  ((S = D.value.language) == null ? void 0 : S.value) ?? null,
1873
1877
  e
@@ -1883,25 +1887,25 @@ const ft = pe({
1883
1887
  title: S,
1884
1888
  description: k,
1885
1889
  keywords: _,
1886
- image: K
1890
+ image: j
1887
1891
  }) {
1888
- D.value.pageTitle = S, D.value.pageDescription = k, D.value.pageKeywords = _, D.value.openGraphImage = K;
1892
+ D.value.pageTitle = S, D.value.pageDescription = k, D.value.pageKeywords = _, D.value.openGraphImage = j;
1889
1893
  }
1890
1894
  const $ = r(() => [
1891
1895
  { id: "common", label: e("blog:tabs.common") },
1892
1896
  { id: "seo", label: e("blog:tabs.seo") }
1893
- ]), q = E($.value[0].id), j = E(!1), X = (S) => {
1894
- d.value && !j.value && (D.value.urlAlias = Me(S));
1897
+ ]), q = E($.value[0].id), K = E(!1), X = (S) => {
1898
+ d.value && !K.value && (D.value.urlAlias = Me(S));
1895
1899
  }, U = () => {
1896
- j.value = !0;
1900
+ K.value = !0;
1897
1901
  };
1898
1902
  return {
1899
1903
  isCreation: d,
1900
1904
  isContentLoading: W,
1901
1905
  values: D,
1902
1906
  errors: u,
1903
- isLangSpecific: b,
1904
- languageOptionList: v,
1907
+ isLangSpecific: v,
1908
+ languageOptionList: b,
1905
1909
  pagePath: l,
1906
1910
  categoryListUrl: Ee(),
1907
1911
  submitForm: V,
@@ -1920,7 +1924,7 @@ const ft = pe({
1920
1924
  }
1921
1925
  });
1922
1926
  function yt(e, a, n, o, t, d) {
1923
- const c = y("FormFieldSelect"), C = y("FormField"), s = y("FormFieldUrlAliasInput"), v = y("TabList"), b = y("FormFieldCheckbox"), L = y("SeoFieldGroup"), F = y("FormFooter"), I = y("Page");
1927
+ const c = y("FormFieldSelect"), C = y("FormField"), s = y("FormFieldUrlAliasInput"), b = y("TabList"), v = y("FormFieldCheckbox"), L = y("SeoFieldGroup"), F = y("FormFooter"), I = y("Page");
1924
1928
  return T(), M(I, {
1925
1929
  title: e.isCreation ? e.$i18n.t("blog:createBlogCategory") : e.$i18n.t("blog:updateBlogCategory"),
1926
1930
  "is-content-loading": e.isContentLoading
@@ -1969,7 +1973,7 @@ function yt(e, a, n, o, t, d) {
1969
1973
  onChange: e.handleAliasChange
1970
1974
  }, null, 8, ["value", "label", "url-template", "error", "onChange"])
1971
1975
  ], 64)) : (T(), Q(J, { key: 1 }, [
1972
- p(v, {
1976
+ p(b, {
1973
1977
  "tab-id": e.selectedTabId,
1974
1978
  "onUpdate:tabId": a[4] || (a[4] = (g) => e.selectedTabId = g),
1975
1979
  "tab-list": e.tabList
@@ -1984,7 +1988,7 @@ function yt(e, a, n, o, t, d) {
1984
1988
  options: e.languageOptionList,
1985
1989
  error: e.errors.language
1986
1990
  }, null, 8, ["value", "label", "options", "error"])) : B("", !0),
1987
- p(b, {
1991
+ p(v, {
1988
1992
  checked: e.values.isDefault,
1989
1993
  "onUpdate:checked": a[6] || (a[6] = (g) => e.values.isDefault = g),
1990
1994
  name: "isDefault",
@@ -2046,7 +2050,7 @@ function yt(e, a, n, o, t, d) {
2046
2050
  _: 1
2047
2051
  }, 8, ["title", "is-content-loading"]);
2048
2052
  }
2049
- const ht = /* @__PURE__ */ ve(ft, [["render", yt]]), Ut = {
2053
+ const ht = /* @__PURE__ */ be(ft, [["render", yt]]), Ot = {
2050
2054
  path: N.POST_LIST,
2051
2055
  component: xa,
2052
2056
  name: "All posts",
@@ -2056,7 +2060,7 @@ const ht = /* @__PURE__ */ ve(ft, [["render", yt]]), Ut = {
2056
2060
  { url: N.POST_LIST, text: a("blog:allPosts") }
2057
2061
  ]
2058
2062
  }
2059
- }, Bt = {
2063
+ }, Ut = {
2060
2064
  path: N.POST_FORM,
2061
2065
  component: st,
2062
2066
  name: "Post Form",
@@ -2067,7 +2071,7 @@ const ht = /* @__PURE__ */ ve(ft, [["render", yt]]), Ut = {
2067
2071
  { url: e.path, text: a("blog:postForm") }
2068
2072
  ]
2069
2073
  }
2070
- }, Et = {
2074
+ }, Bt = {
2071
2075
  path: N.CATEGORY_LIST,
2072
2076
  component: ct,
2073
2077
  name: "All categories",
@@ -2077,7 +2081,7 @@ const ht = /* @__PURE__ */ ve(ft, [["render", yt]]), Ut = {
2077
2081
  { url: N.CATEGORY_LIST, text: a("blog:allCategories") }
2078
2082
  ]
2079
2083
  }
2080
- }, kt = {
2084
+ }, Et = {
2081
2085
  path: N.CATEGORY_FORM,
2082
2086
  component: ht,
2083
2087
  name: "Category Form",
@@ -2089,28 +2093,28 @@ const ht = /* @__PURE__ */ ve(ft, [["render", yt]]), Ut = {
2089
2093
  ]
2090
2094
  }
2091
2095
  };
2092
- Pa();
2096
+ Da();
2093
2097
  export {
2094
- kt as BLOG_CATEGORY_FORM_ROUTE,
2095
- Et as BLOG_CATEGORY_LIST_ROUTE,
2096
- Bt as BLOG_POST_FORM_ROUTE,
2097
- Ut as BLOG_POST_LIST_ROUTE,
2098
- Ta as clonePost,
2099
- Ia as createBlogPost,
2100
- Ua as createCategory,
2101
- $a as deleteBlogPost,
2102
- Ea as deleteCategory,
2098
+ Et as BLOG_CATEGORY_FORM_ROUTE,
2099
+ Bt as BLOG_CATEGORY_LIST_ROUTE,
2100
+ Ut as BLOG_POST_FORM_ROUTE,
2101
+ Ot as BLOG_POST_LIST_ROUTE,
2102
+ La as clonePost,
2103
+ Ta as createBlogPost,
2104
+ Oa as createCategory,
2105
+ Aa as deleteBlogPost,
2106
+ Ba as deleteCategory,
2103
2107
  $e as getBlogCategoryFormUrl,
2104
2108
  Ee as getBlogCategoryListUrl,
2105
- Ot as getBlogPostCount,
2109
+ $t as getBlogPostCount,
2106
2110
  Ae as getBlogPostFormUrl,
2107
2111
  Pe as getBlogPostListUrl,
2108
2112
  oa as getCategories,
2109
- Oa as getCategory,
2110
- Ra as getModuleConfig,
2111
- La as getPost,
2113
+ $a as getCategory,
2114
+ ka as getModuleConfig,
2115
+ Pa as getPost,
2112
2116
  ta as getPosts,
2113
- ka as moveCategory,
2114
- Aa as updateBlogPost,
2115
- Ba as updateCategory
2117
+ Ea as moveCategory,
2118
+ Ia as updateBlogPost,
2119
+ Ua as updateCategory
2116
2120
  };
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .filters[data-v-7b6e97da]{margin-bottom:1rem;width:100%;display:grid;gap:1rem;grid-template-columns:1fr 1fr}.filters[data-v-7b6e97da]:not(:first-child){margin-top:1rem}.status span[data-v-7b6e97da]{display:block}.status span[data-v-7b6e97da]:nth-child(2){display:block;margin-top:5px;font-size:.8rem}.status span:nth-child(2) i[data-v-7b6e97da]{display:block}.status[data-v-66887350]{display:flex;align-items:flex-end}.status-value[data-v-66887350]{flex-basis:50%}.status-checkbox[data-v-66887350]{margin-left:20px;padding-bottom:8px}.status-date[data-v-66887350]{margin-left:20px;flex:1 1 1px}
1
+ .filters[data-v-3b010d12]{margin-bottom:1rem;width:100%;display:grid;gap:1rem;grid-template-columns:1fr 1fr}.filters[data-v-3b010d12]:not(:first-child){margin-top:1rem}.status span[data-v-3b010d12]{display:block}.status span[data-v-3b010d12]:nth-child(2){display:block;margin-top:5px;font-size:.8rem}.status span:nth-child(2) i[data-v-3b010d12]{display:block}.status[data-v-66887350]{display:flex;align-items:flex-end}.status-value[data-v-66887350]{flex-basis:50%}.status-checkbox[data-v-66887350]{margin-left:20px;padding-bottom:8px}.status-date[data-v-66887350]{margin-left:20px;flex:1 1 1px}
@@ -634,7 +634,7 @@ declare const __VLS_export: import("vue").DefineComponent<{}, {
634
634
  shouldDisplayImage: boolean;
635
635
  imageLabel: string;
636
636
  imageName: string;
637
- imageScenario: string;
637
+ imageScenario: Nullable<string>;
638
638
  imageErrorMessage: string;
639
639
  }, {}, {
640
640
  FormFieldRecommendedLengthInput: import("vue").DefineComponent<{
@@ -841,7 +841,7 @@ declare const __VLS_export: import("vue").DefineComponent<{}, {
841
841
  default: string;
842
842
  };
843
843
  scenario: {
844
- type: import("vue").PropType<import("@tager/admin-services").Nullable<string>>;
844
+ type: import("vue").PropType<Nullable<string>>;
845
845
  default: null;
846
846
  };
847
847
  containerClass: {
@@ -878,7 +878,7 @@ declare const __VLS_export: import("vue").DefineComponent<{}, {
878
878
  default: string;
879
879
  };
880
880
  scenario: {
881
- type: import("vue").PropType<import("@tager/admin-services").Nullable<string>>;
881
+ type: import("vue").PropType<Nullable<string>>;
882
882
  default: null;
883
883
  };
884
884
  containerClass: {
@@ -920,7 +920,7 @@ declare const __VLS_export: import("vue").DefineComponent<{}, {
920
920
  error: string;
921
921
  description: string;
922
922
  containerClass: string;
923
- scenario: import("@tager/admin-services").Nullable<string>;
923
+ scenario: Nullable<string>;
924
924
  urlUploadEnabled: boolean;
925
925
  }, {}, {
926
926
  FormFieldWrapper: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -1099,13 +1099,13 @@ declare const __VLS_export: import("vue").DefineComponent<{}, {
1099
1099
  };
1100
1100
  id: string;
1101
1101
  }[] | null | undefined;
1102
- scenario: import("@tager/admin-services").Nullable<string>;
1102
+ scenario: Nullable<string>;
1103
1103
  fileType: "" | "image" | "archive";
1104
1104
  multiple: boolean;
1105
1105
  withCaptions: boolean;
1106
1106
  accept: string;
1107
1107
  placeholderMessage: string;
1108
- maxFileCount: import("@tager/admin-services").Nullable<number>;
1108
+ maxFileCount: Nullable<number>;
1109
1109
  urlUploadEnabled: boolean;
1110
1110
  }, {}, {
1111
1111
  BaseButton: import("vue").DefineComponent<{
@@ -19324,7 +19324,7 @@ declare const __VLS_export: import("vue").DefineComponent<{}, {
19324
19324
  shouldDisplayImage: boolean;
19325
19325
  imageLabel: string;
19326
19326
  imageName: string;
19327
- imageScenario: string;
19327
+ imageScenario: Nullable<string>;
19328
19328
  imageErrorMessage: string;
19329
19329
  }, {}, {
19330
19330
  FormFieldRecommendedLengthInput: import("vue").DefineComponent<{
@@ -19531,7 +19531,7 @@ declare const __VLS_export: import("vue").DefineComponent<{}, {
19531
19531
  default: string;
19532
19532
  };
19533
19533
  scenario: {
19534
- type: import("vue").PropType<import("@tager/admin-services").Nullable<string>>;
19534
+ type: import("vue").PropType<Nullable<string>>;
19535
19535
  default: null;
19536
19536
  };
19537
19537
  containerClass: {
@@ -19568,7 +19568,7 @@ declare const __VLS_export: import("vue").DefineComponent<{}, {
19568
19568
  default: string;
19569
19569
  };
19570
19570
  scenario: {
19571
- type: import("vue").PropType<import("@tager/admin-services").Nullable<string>>;
19571
+ type: import("vue").PropType<Nullable<string>>;
19572
19572
  default: null;
19573
19573
  };
19574
19574
  containerClass: {
@@ -19610,7 +19610,7 @@ declare const __VLS_export: import("vue").DefineComponent<{}, {
19610
19610
  error: string;
19611
19611
  description: string;
19612
19612
  containerClass: string;
19613
- scenario: import("@tager/admin-services").Nullable<string>;
19613
+ scenario: Nullable<string>;
19614
19614
  urlUploadEnabled: boolean;
19615
19615
  }, {}, {
19616
19616
  FormFieldWrapper: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -19789,13 +19789,13 @@ declare const __VLS_export: import("vue").DefineComponent<{}, {
19789
19789
  };
19790
19790
  id: string;
19791
19791
  }[] | null | undefined;
19792
- scenario: import("@tager/admin-services").Nullable<string>;
19792
+ scenario: Nullable<string>;
19793
19793
  fileType: "" | "image" | "archive";
19794
19794
  multiple: boolean;
19795
19795
  withCaptions: boolean;
19796
19796
  accept: string;
19797
19797
  placeholderMessage: string;
19798
- maxFileCount: import("@tager/admin-services").Nullable<number>;
19798
+ maxFileCount: Nullable<number>;
19799
19799
  urlUploadEnabled: boolean;
19800
19800
  }, {}, {
19801
19801
  BaseButton: import("vue").DefineComponent<{
@@ -20041,9 +20041,7 @@ declare const __VLS_export: import("vue").DefineComponent<{}, {
20041
20041
  autocomplete: string;
20042
20042
  }> & Readonly<{
20043
20043
  onChange?: ((...args: any[]) => any) | undefined;
20044
- onInput?: ((
20045
- /** @ts-ignore @type { | typeof __VLS_components.FormFieldFileInput} */
20046
- ...args: any[]) => any) | undefined;
20044
+ onInput?: ((...args: any[]) => any) | undefined;
20047
20045
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
20048
20046
  }>, {
20049
20047
  type: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tager/admin-blog",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.umd.js",
6
6
  "module": "dist/index.esm.js",
@@ -28,8 +28,7 @@
28
28
  "filesize": "^9.0.11",
29
29
  "lodash.isequal": "^4.5.0",
30
30
  "lodash.kebabcase": "^4.1.1",
31
- "lodash.pick": "^4.4.0",
32
- "path-to-regexp": "^6.1.0"
31
+ "path-to-regexp": "^6.3.0"
33
32
  },
34
33
  "devDependencies": {
35
34
  "@eslint/js": "^9.39.5",
@@ -39,7 +38,6 @@
39
38
  "@tager/admin-ui": "^2.0.8",
40
39
  "@types/filesize": "^5.0.0",
41
40
  "@types/lodash.isequal": "^4.5.6",
42
- "@types/lodash.pick": "^4.4.7",
43
41
  "@types/node": "16.x",
44
42
  "@vitejs/plugin-vue": "^5.2.4",
45
43
  "@vue/eslint-config-typescript": "^14.9.0",
@@ -128,7 +128,6 @@
128
128
  <script lang="ts">
129
129
  import {computed, defineComponent, watch} from 'vue';
130
130
  import isEqual from 'lodash.isequal';
131
- import pick from 'lodash.pick';
132
131
  import {useRoute, useRouter} from 'vue-router';
133
132
 
134
133
  import {
@@ -176,6 +175,21 @@ import {
176
175
  } from './PostList.helpers';
177
176
  import {useAdvancedSearch} from './hooks';
178
177
 
178
+ /**
179
+ * Выбрать заданные ключи из объекта.
180
+ *
181
+ * Заменяет lodash.pick: у него открытая уязвимость prototype pollution,
182
+ * и патча к ней нет — пакет не поддерживается.
183
+ */
184
+ function pickKeys<T extends Record<string, unknown>, K extends keyof T>(
185
+ source: T,
186
+ keys: ReadonlyArray<K>
187
+ ): Partial<T> {
188
+ return Object.fromEntries(
189
+ Object.entries(source).filter(([key]) => keys.includes(key as K))
190
+ ) as Partial<T>;
191
+ }
192
+
179
193
  export default defineComponent({
180
194
  name: 'PostList',
181
195
  components: {
@@ -291,7 +305,7 @@ export default defineComponent({
291
305
  }
292
306
 
293
307
  const newQuery = {
294
- ...pick(route.query, ['query', 'pageNumber', 'sort']),
308
+ ...pickKeys(route.query, ['query', 'pageNumber', 'sort']),
295
309
  ...filterParams.value,
296
310
  };
297
311