@tager/admin-blog 0.3.28 → 0.3.29

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.
Files changed (44) hide show
  1. package/dist/constants/menu.d.ts +5 -0
  2. package/dist/constants/paths.d.ts +14 -0
  3. package/dist/constants/routes.d.ts +5 -0
  4. package/dist/constants/scopes.d.ts +11 -0
  5. package/dist/dev.d.ts +1 -0
  6. package/dist/hooks/index.d.ts +7 -0
  7. package/dist/hooks/useFetchCategories.d.ts +6 -0
  8. package/dist/hooks/useFetchCategory.d.ts +8 -0
  9. package/dist/hooks/useFetchModuleConfig.d.ts +6 -0
  10. package/dist/hooks/useFetchPosts.d.ts +6 -0
  11. package/dist/hooks/useStore.d.ts +4 -0
  12. package/dist/hooks/useUserPermission.d.ts +3 -0
  13. package/dist/hooks/useUserProfile.d.ts +3 -0
  14. package/dist/index.esm.js +73 -76
  15. package/dist/index.umd.js +73 -76
  16. package/dist/locales/en.d.ts +75 -0
  17. package/dist/locales/ru.d.ts +3 -0
  18. package/dist/main.d.ts +4 -0
  19. package/dist/router/index.d.ts +4 -0
  20. package/dist/services/requests.d.ts +58 -0
  21. package/dist/store/index.d.ts +6 -0
  22. package/dist/store/user.d.ts +14 -0
  23. package/dist/typings/common.d.ts +1 -0
  24. package/dist/typings/model.d.ts +117 -0
  25. package/dist/utils/common.d.ts +4 -0
  26. package/dist/views/Categories/CategoryForm/CategoryForm.helpers.d.ts +5 -0
  27. package/dist/views/Categories/CategoryForm/CategoryForm.vue.d.ts +109 -0
  28. package/dist/views/Categories/CategoryForm/index.d.ts +1 -0
  29. package/dist/views/Categories/CategoryList/CategoryList.helpers.d.ts +7 -0
  30. package/dist/views/Categories/CategoryList/CategoryList.vue.d.ts +59 -0
  31. package/dist/views/Categories/CategoryList/hooks/index.d.ts +1 -0
  32. package/dist/views/Categories/CategoryList/hooks/useAdvancedSearch.d.ts +16 -0
  33. package/dist/views/Categories/CategoryList/index.d.ts +1 -0
  34. package/dist/views/Posts/PostForm/PostForm.helpers.d.ts +27 -0
  35. package/dist/views/Posts/PostForm/PostForm.vue.d.ts +9382 -0
  36. package/dist/views/Posts/PostForm/components/TabList/TabList.types.d.ts +5 -0
  37. package/dist/views/Posts/PostForm/components/TabList/index.d.ts +2 -0
  38. package/dist/views/Posts/PostForm/index.d.ts +1 -0
  39. package/dist/views/Posts/PostList/PostList.helpers.d.ts +6 -0
  40. package/dist/views/Posts/PostList/PostList.vue.d.ts +69 -0
  41. package/dist/views/Posts/PostList/hooks/index.d.ts +1 -0
  42. package/dist/views/Posts/PostList/hooks/useAdvancedSearch.d.ts +22 -0
  43. package/dist/views/Posts/PostList/index.d.ts +1 -0
  44. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ import { MenuItemType } from '@tager/admin-layout';
2
+ import { TranslateFunction } from '@tager/admin-services';
3
+ export declare function getBlogMenuItem(params: {
4
+ t: TranslateFunction;
5
+ }): MenuItemType;
@@ -0,0 +1,14 @@
1
+ export declare const BLOG_ROUTE_PATHS: {
2
+ readonly POST_LIST: "/blog/posts";
3
+ readonly POST_FORM: "/blog/posts/:postId";
4
+ readonly CATEGORY_LIST: "/blog/categories";
5
+ readonly CATEGORY_FORM: "/blog/categories/:categoryId";
6
+ };
7
+ export declare function getBlogPostListUrl(): "/blog/posts";
8
+ export declare function getBlogPostFormUrl(params: {
9
+ postId: number | string;
10
+ }): string;
11
+ export declare function getBlogCategoryListUrl(): "/blog/categories";
12
+ export declare function getBlogCategoryFormUrl(params: {
13
+ categoryId: number | string;
14
+ }): string;
@@ -0,0 +1,5 @@
1
+ import { CustomRouteConfig } from '@tager/admin-layout';
2
+ export declare const BLOG_POST_LIST_ROUTE: CustomRouteConfig;
3
+ export declare const BLOG_POST_FORM_ROUTE: CustomRouteConfig;
4
+ export declare const BLOG_CATEGORY_LIST_ROUTE: CustomRouteConfig;
5
+ export declare const BLOG_CATEGORY_FORM_ROUTE: CustomRouteConfig;
@@ -0,0 +1,11 @@
1
+ export declare const Scope: {
2
+ readonly All: "*";
3
+ readonly OrdersCreate: "orders.create";
4
+ readonly OrdersView: "orders.view";
5
+ readonly OrdersDelete: "orders.delete";
6
+ readonly RbacViewRoles: "rbac.view-roles";
7
+ readonly RbacEditRoles: "rbac.edit-roles";
8
+ readonly AdministratorsView: "administrators.view";
9
+ readonly AdministratorsEdit: "administrators.edit";
10
+ readonly AdministratorsDelete: "administrators.delete";
11
+ };
package/dist/dev.d.ts ADDED
@@ -0,0 +1 @@
1
+ import '@tager/admin-ui/dist/admin-ui.css';
@@ -0,0 +1,7 @@
1
+ export { useFetchPosts } from './useFetchPosts';
2
+ export { useFetchCategory } from './useFetchCategory';
3
+ export { useFetchCategories } from './useFetchCategories';
4
+ export { useFetchModuleConfig } from './useFetchModuleConfig';
5
+ export { useStore } from './useStore';
6
+ export { useUserProfile } from './useUserProfile';
7
+ export { useUserPermission } from './useUserPermission';
@@ -0,0 +1,6 @@
1
+ import { SetupContext } from '@vue/composition-api';
2
+ import { ResourceRef } from '@tager/admin-services';
3
+ import { Category } from '@/typings/model';
4
+ export declare function useFetchCategories({ context, }: {
5
+ context: SetupContext;
6
+ }): ResourceRef<Category[]>;
@@ -0,0 +1,8 @@
1
+ import { Ref, SetupContext } from '@vue/composition-api';
2
+ import { Nullable, ResourceRef } from '@tager/admin-services';
3
+ import { Category } from '@/typings/model';
4
+ export declare function useFetchCategory({ context, categoryId, isCreation, }: {
5
+ context: SetupContext;
6
+ categoryId: Ref<string>;
7
+ isCreation: Ref<boolean>;
8
+ }): ResourceRef<Nullable<Category>>;
@@ -0,0 +1,6 @@
1
+ import { SetupContext } from '@vue/composition-api';
2
+ import { Nullable, ResourceRef } from '@tager/admin-services';
3
+ import { ModuleConfig } from '@/typings/model';
4
+ export declare function useFetchModuleConfig({ context, }: {
5
+ context: SetupContext;
6
+ }): ResourceRef<Nullable<ModuleConfig>>;
@@ -0,0 +1,6 @@
1
+ import { SetupContext } from '@vue/composition-api';
2
+ import { ResourceRef } from '@tager/admin-services';
3
+ import { PostShort } from '@/typings/model';
4
+ export declare function useFetchPosts(params: {
5
+ context: SetupContext;
6
+ }): ResourceRef<PostShort[]>;
@@ -0,0 +1,4 @@
1
+ import { Store } from 'vuex';
2
+ import { SetupContext } from '@vue/composition-api';
3
+ import { RootState } from '@/store';
4
+ export declare function useStore(context: SetupContext): Store<RootState>;
@@ -0,0 +1,3 @@
1
+ import { ComputedRef, SetupContext } from '@vue/composition-api';
2
+ import { ScopeType } from '@/typings/model';
3
+ export declare function useUserPermission(context: SetupContext, scope: ScopeType): ComputedRef<boolean>;
@@ -0,0 +1,3 @@
1
+ import { ComputedRef, SetupContext } from '@vue/composition-api';
2
+ import { UserModel } from '@/typings/model';
3
+ export declare function useUserProfile(context: SetupContext): ComputedRef<UserModel>;
package/dist/index.esm.js CHANGED
@@ -2783,10 +2783,7 @@ function convertPostList(postList, selectedCategory, languages) {
2783
2783
  .map((post) => {
2784
2784
  if (languages.length > 0) {
2785
2785
  const foundLanguage = languages.find(({ id }) => id === post.language);
2786
- return {
2787
- ...post,
2788
- language: foundLanguage ? foundLanguage.name : post.language,
2789
- };
2786
+ return Object.assign(Object.assign({}, post), { language: foundLanguage ? foundLanguage.name : post.language });
2790
2787
  }
2791
2788
  return post;
2792
2789
  });
@@ -2886,14 +2883,13 @@ function useAdvancedSearch({ context, categoryList, languageList, }) {
2886
2883
  languageFilter.value = initialLanguageFilter.value;
2887
2884
  });
2888
2885
  /** From date **/
2889
- const initialFromDateFilter = computed(() => getFilterParamAsString(context.root.$route.query, FilterTypes.FROM_DATE) ?? '');
2886
+ const initialFromDateFilter = computed(() => { var _a; return (_a = getFilterParamAsString(context.root.$route.query, FilterTypes.FROM_DATE)) !== null && _a !== void 0 ? _a : ''; });
2890
2887
  const fromDateFilter = ref(initialFromDateFilter.value);
2891
2888
  watch(initialFromDateFilter, () => {
2892
2889
  fromDateFilter.value = initialFromDateFilter.value;
2893
2890
  });
2894
2891
  /** To date **/
2895
- const initialToDateFilter = computed(() => getFilterParamAsString(context.root.$route.query, FilterTypes.TO_DATE) ??
2896
- '');
2892
+ const initialToDateFilter = computed(() => { var _a; return (_a = getFilterParamAsString(context.root.$route.query, FilterTypes.TO_DATE)) !== null && _a !== void 0 ? _a : ''; });
2897
2893
  const toDateFilter = ref(initialToDateFilter.value);
2898
2894
  watch(initialToDateFilter, () => {
2899
2895
  toDateFilter.value = initialToDateFilter.value;
@@ -2993,18 +2989,20 @@ var script = defineComponent({
2993
2989
  const { t } = useTranslation(context);
2994
2990
  const canViewAdministrators = useUserPermission(context, Scope.AdministratorsView);
2995
2991
  const categoryId = computed(() => {
2992
+ var _a;
2996
2993
  return Array.isArray(context.root.$route.query.category)
2997
- ? context.root.$route.query.category[0] ?? ''
2998
- : context.root.$route.query.category;
2994
+ ? (_a = context.root.$route.query.category[0]) !== null && _a !== void 0 ? _a : '' : context.root.$route.query.category;
2999
2995
  });
3000
2996
  /** Fetch module config **/
3001
2997
  const { data: moduleConfig, loading: isModuleConfigLoading, } = useFetchModuleConfig({ context });
3002
- const languageList = computed(() => moduleConfig.value?.languages ?? []);
2998
+ const languageList = computed(() => { var _a, _b; return (_b = (_a = moduleConfig.value) === null || _a === void 0 ? void 0 : _a.languages) !== null && _b !== void 0 ? _b : []; });
3003
2999
  /** Fetch category list **/
3004
3000
  const { data: categoryList, loading: isCategoryListLoading, } = useFetchCategories({ context });
3005
- const selectedCategory = computed(() => categoryId.value
3006
- ? categoryList.value.find(({ id }) => String(id) === String(categoryId.value)) ?? null
3007
- : null);
3001
+ const selectedCategory = computed(() => {
3002
+ var _a;
3003
+ return categoryId.value
3004
+ ? (_a = categoryList.value.find(({ id }) => String(id) === String(categoryId.value))) !== null && _a !== void 0 ? _a : null : null;
3005
+ });
3008
3006
  const pageTitle = computed(() => {
3009
3007
  return selectedCategory.value
3010
3008
  ? `${context.root.$t('blog:postsByCategory')} "${selectedCategory.value.name}"`
@@ -3019,12 +3017,7 @@ var script = defineComponent({
3019
3017
  const isLangSpecific = computed(() => languageOptionList.value.length > 1);
3020
3018
  /** Fetch Post list **/
3021
3019
  const { fetchEntityList: fetchPostList, isLoading: isPostLoading, rowData: postList, errorMessage, searchQuery, handleChange, pageNumber, pageCount, pageSize, } = useDataTable({
3022
- fetchEntityList: (params) => getPosts({
3023
- query: params.searchQuery,
3024
- pageNumber: params.pageNumber,
3025
- pageSize: params.pageSize,
3026
- ...filterParams.value,
3027
- }),
3020
+ fetchEntityList: (params) => getPosts(Object.assign({ query: params.searchQuery, pageNumber: params.pageNumber, pageSize: params.pageSize }, filterParams.value)),
3028
3021
  initialValue: [],
3029
3022
  context,
3030
3023
  resourceName: 'Blog post list',
@@ -3034,16 +3027,16 @@ var script = defineComponent({
3034
3027
  if (isModuleConfigLoading.value || isCategoryListLoading.value) {
3035
3028
  return;
3036
3029
  }
3037
- const newQuery = {
3038
- ...lodash_pick(context.root.$route.query, ['query', 'pageNumber']),
3039
- ...filterParams.value,
3040
- };
3030
+ const newQuery = Object.assign(Object.assign({}, lodash_pick(context.root.$route.query, ['query', 'pageNumber'])), filterParams.value);
3041
3031
  if (!lodash_isequal(context.root.$route.query, newQuery)) {
3042
3032
  context.root.$router.replace({ query: newQuery });
3043
3033
  fetchPostList();
3044
3034
  }
3045
3035
  });
3046
- const displayedPostList = computed(() => convertPostList(postList.value, selectedCategory.value, moduleConfig.value?.languages ?? []));
3036
+ const displayedPostList = computed(() => {
3037
+ var _a, _b;
3038
+ return convertPostList(postList.value, selectedCategory.value, (_b = (_a = moduleConfig.value) === null || _a === void 0 ? void 0 : _a.languages) !== null && _b !== void 0 ? _b : []);
3039
+ });
3047
3040
  const isRowDataLoading = computed(() => isCategoryListLoading.value ||
3048
3041
  isPostLoading.value ||
3049
3042
  isModuleConfigLoading.value);
@@ -3478,6 +3471,7 @@ __vue_render__._withStripped = true;
3478
3471
  );
3479
3472
 
3480
3473
  function convertPostToFormValues(post, languageOptionList, postOptionList, additionalFieldList) {
3474
+ var _a, _b;
3481
3475
  if (!post) {
3482
3476
  return {
3483
3477
  title: '',
@@ -3512,8 +3506,8 @@ function convertPostToFormValues(post, languageOptionList, postOptionList, addit
3512
3506
  imageMobile: post.imageMobile
3513
3507
  ? { id: createId(), file: post.imageMobile }
3514
3508
  : null,
3515
- pageTitle: post.pageTitle ?? '',
3516
- pageDescription: post.pageDescription ?? '',
3509
+ pageTitle: (_a = post.pageTitle) !== null && _a !== void 0 ? _a : '',
3510
+ pageDescription: (_b = post.pageDescription) !== null && _b !== void 0 ? _b : '',
3517
3511
  openGraphImage: post.openGraphImage
3518
3512
  ? { id: createId(), file: post.openGraphImage }
3519
3513
  : null,
@@ -3522,31 +3516,32 @@ function convertPostToFormValues(post, languageOptionList, postOptionList, addit
3522
3516
  value: category.id,
3523
3517
  label: category.name,
3524
3518
  })),
3525
- language: currentLangOption ?? null,
3519
+ language: currentLangOption !== null && currentLangOption !== void 0 ? currentLangOption : null,
3526
3520
  relatedPosts: selectedPostOptionList,
3527
3521
  tags: post.tags.join(','),
3528
3522
  additionalFields: additionalFieldList.map((fieldConfig, index) => {
3529
3523
  const postAdditionalField = post.additionalFields.find((item) => item.name === fieldConfig.name);
3530
- return universalFieldUtils.createFormField(fieldConfig, postAdditionalField?.value);
3524
+ return universalFieldUtils.createFormField(fieldConfig, postAdditionalField === null || postAdditionalField === void 0 ? void 0 : postAdditionalField.value);
3531
3525
  }),
3532
3526
  };
3533
3527
  }
3534
3528
  function convertFormValuesToCreationPayload(values) {
3529
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
3535
3530
  return {
3536
3531
  title: values.title,
3537
3532
  excerpt: values.excerpt,
3538
3533
  urlAlias: values.urlAlias,
3539
3534
  body: values.body,
3540
3535
  date: values.date,
3541
- coverImage: values.coverImage?.file.id ?? null,
3542
- image: values.image?.file.id ?? null,
3543
- imageMobile: values.imageMobile?.file.id ?? null,
3536
+ coverImage: (_b = (_a = values.coverImage) === null || _a === void 0 ? void 0 : _a.file.id) !== null && _b !== void 0 ? _b : null,
3537
+ image: (_d = (_c = values.image) === null || _c === void 0 ? void 0 : _c.file.id) !== null && _d !== void 0 ? _d : null,
3538
+ imageMobile: (_f = (_e = values.imageMobile) === null || _e === void 0 ? void 0 : _e.file.id) !== null && _f !== void 0 ? _f : null,
3544
3539
  pageTitle: values.pageTitle,
3545
3540
  pageDescription: values.pageDescription,
3546
- openGraphImage: values.openGraphImage?.file.id ?? null,
3541
+ openGraphImage: (_h = (_g = values.openGraphImage) === null || _g === void 0 ? void 0 : _g.file.id) !== null && _h !== void 0 ? _h : null,
3547
3542
  status: 'PUBLISHED',
3548
3543
  categories: values.categories.map((option) => option.value),
3549
- language: values.language?.value ?? null,
3544
+ language: (_k = (_j = values.language) === null || _j === void 0 ? void 0 : _j.value) !== null && _k !== void 0 ? _k : null,
3550
3545
  relatedPosts: values.relatedPosts.map((relatedPostOption) => relatedPostOption.value),
3551
3546
  tags: values.tags.split(',').filter((tag) => tag.trim().length > 0),
3552
3547
  additionalFields: values.additionalFields.map((field) => ({
@@ -3556,10 +3551,7 @@ function convertFormValuesToCreationPayload(values) {
3556
3551
  };
3557
3552
  }
3558
3553
  function convertFormValuesToUpdatePayload(values) {
3559
- return {
3560
- ...convertFormValuesToCreationPayload(values),
3561
- urlAlias: values.urlAlias,
3562
- };
3554
+ return Object.assign(Object.assign({}, convertFormValuesToCreationPayload(values)), { urlAlias: values.urlAlias });
3563
3555
  }
3564
3556
  function convertCategoryListToOptions(categoryList, languageId) {
3565
3557
  return categoryList
@@ -3574,12 +3566,13 @@ var script$1 = defineComponent({
3574
3566
  name: 'BlogPostForm',
3575
3567
  components: { DynamicField, ShortCodeConstructor, FormFooter },
3576
3568
  setup(props, context) {
3569
+ var _a, _b;
3577
3570
  const postId = computed(() => context.root.$route.params.postId);
3578
3571
  const isCreation = computed(() => postId.value === 'create');
3579
3572
  const urlAliasChanged = ref(false);
3580
3573
  /** Fetch module config **/
3581
3574
  const { data: moduleConfig, loading: isModuleConfigLoading, } = useFetchModuleConfig({ context });
3582
- const languageList = computed(() => moduleConfig.value?.languages ?? []);
3575
+ const languageList = computed(() => { var _a, _b; return (_b = (_a = moduleConfig.value) === null || _a === void 0 ? void 0 : _a.languages) !== null && _b !== void 0 ? _b : []; });
3583
3576
  const languageOptionList = computed(() => languageList.value.map(({ id, name }) => ({
3584
3577
  value: id,
3585
3578
  label: name,
@@ -3609,17 +3602,18 @@ var script$1 = defineComponent({
3609
3602
  context,
3610
3603
  });
3611
3604
  const postOptionList = computed(() => postList.value
3612
- .filter((relatedPost) => relatedPost.id !== post.value?.id)
3605
+ .filter((relatedPost) => { var _a; return relatedPost.id !== ((_a = post.value) === null || _a === void 0 ? void 0 : _a.id); })
3613
3606
  .map((post) => ({
3614
3607
  value: post.id,
3615
3608
  label: post.title,
3616
3609
  })));
3617
3610
  /** Form State **/
3618
3611
  const isSubmitting = ref(false);
3619
- const values = ref(convertPostToFormValues(post.value, languageOptionList.value, postOptionList.value, moduleConfig.value?.fields ?? []));
3612
+ const values = ref(convertPostToFormValues(post.value, languageOptionList.value, postOptionList.value, (_b = (_a = moduleConfig.value) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : []));
3620
3613
  const errors = ref({});
3621
3614
  watch([post, languageOptionList, postOptionList, moduleConfig], () => {
3622
- values.value = convertPostToFormValues(post.value, languageOptionList.value, postOptionList.value, moduleConfig.value?.fields ?? []);
3615
+ var _a, _b;
3616
+ values.value = convertPostToFormValues(post.value, languageOptionList.value, postOptionList.value, (_b = (_a = moduleConfig.value) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : []);
3623
3617
  });
3624
3618
  function submitForm(event) {
3625
3619
  isSubmitting.value = true;
@@ -3630,6 +3624,7 @@ var script$1 = defineComponent({
3630
3624
  : updateBlogPost(postId.value, updateBody);
3631
3625
  requestPromise
3632
3626
  .then(({ data }) => {
3627
+ var _a, _b;
3633
3628
  errors.value = {};
3634
3629
  if (event.type === 'create') {
3635
3630
  context.root.$router.push(getBlogPostFormUrl({ postId: String(data.id) }));
@@ -3643,7 +3638,7 @@ var script$1 = defineComponent({
3643
3638
  }
3644
3639
  }
3645
3640
  if (event.type === 'create_create-another') {
3646
- values.value = convertPostToFormValues(null, languageOptionList.value, postOptionList.value, moduleConfig.value?.fields ?? []);
3641
+ values.value = convertPostToFormValues(null, languageOptionList.value, postOptionList.value, (_b = (_a = moduleConfig.value) === null || _a === void 0 ? void 0 : _a.fields) !== null && _b !== void 0 ? _b : []);
3647
3642
  }
3648
3643
  context.root.$toast({
3649
3644
  variant: 'success',
@@ -3669,13 +3664,17 @@ var script$1 = defineComponent({
3669
3664
  });
3670
3665
  }
3671
3666
  /** Category Options */
3672
- const categoryOptionList = computed(() => convertCategoryListToOptions(categoryList.value, values.value.language?.value ?? null));
3667
+ const categoryOptionList = computed(() => {
3668
+ var _a, _b;
3669
+ return convertCategoryListToOptions(categoryList.value, (_b = (_a = values.value.language) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null);
3670
+ });
3673
3671
  watch([categoryOptionList, moduleConfig], () => {
3672
+ var _a;
3674
3673
  function isOptionExist(selectedCategoryOption) {
3675
3674
  return categoryOptionList.value.some((option) => option.value === selectedCategoryOption.value);
3676
3675
  }
3677
3676
  if (isCreation.value) {
3678
- if (moduleConfig?.value?.defaultCategories) {
3677
+ if ((_a = moduleConfig === null || moduleConfig === void 0 ? void 0 : moduleConfig.value) === null || _a === void 0 ? void 0 : _a.defaultCategories) {
3679
3678
  const defaultIds = moduleConfig.value.defaultCategories.map((item) => item.id);
3680
3679
  values.value.categories = categoryOptionList.value.filter((item) => {
3681
3680
  return defaultIds.indexOf(item.value) !== -1;
@@ -3690,11 +3689,13 @@ var script$1 = defineComponent({
3690
3689
  isPostListLoading.value ||
3691
3690
  isModuleConfigLoading.value);
3692
3691
  function getUploadAdapterOptions() {
3693
- return { uploadScenario: moduleConfig.value?.fileScenarios.content };
3692
+ var _a;
3693
+ return { uploadScenario: (_a = moduleConfig.value) === null || _a === void 0 ? void 0 : _a.fileScenarios.content };
3694
3694
  }
3695
3695
  const blogPagePath = computed(() => {
3696
+ var _a, _b;
3696
3697
  const origin = process.env.VUE_APP_WEBSITE_URL || window.location.origin;
3697
- return origin + (post.value?.urlTemplate ?? '');
3698
+ return origin + ((_b = (_a = post.value) === null || _a === void 0 ? void 0 : _a.urlTemplate) !== null && _b !== void 0 ? _b : '');
3698
3699
  });
3699
3700
  const tabList = computed(() => {
3700
3701
  const hasErrors = createTabErrorFinder(errors.value);
@@ -4188,10 +4189,7 @@ function convertCategoryList(categoryList, languages) {
4188
4189
  return categoryList.map((category) => {
4189
4190
  if (languages.length > 0) {
4190
4191
  const foundLanguage = languages.find(({ id }) => category.language === id);
4191
- return {
4192
- ...category,
4193
- language: foundLanguage ? foundLanguage.name : category.language,
4194
- };
4192
+ return Object.assign(Object.assign({}, category), { language: foundLanguage ? foundLanguage.name : category.language });
4195
4193
  }
4196
4194
  return category;
4197
4195
  });
@@ -4304,31 +4302,24 @@ var script$2 = defineComponent({
4304
4302
  const canViewAdministrators = useUserPermission(context, Scope.AdministratorsView);
4305
4303
  /** Fetch module config **/
4306
4304
  const { data: moduleConfig, loading: isModuleConfigLoading, } = useFetchModuleConfig({ context });
4307
- const languageList = computed(() => moduleConfig.value?.languages ?? []);
4305
+ const languageList = computed(() => { var _a, _b; return (_b = (_a = moduleConfig.value) === null || _a === void 0 ? void 0 : _a.languages) !== null && _b !== void 0 ? _b : []; });
4308
4306
  /** Advanced search **/
4309
4307
  const { languageFilter, languageOptionList, filterParams, tags, tagRemovalHandler, } = useAdvancedSearch$1({ context, languageList });
4310
4308
  const isLangSpecific = computed(() => languageOptionList.value.length > 1);
4311
4309
  /** Fetch category list */
4312
4310
  const { fetchEntityList: fetchCategoryList, isLoading: isCategoryListLoading, rowData: categoryList, errorMessage, searchQuery, handleChange, pageNumber, pageCount, pageSize, } = useDataTable({
4313
- fetchEntityList: (params) => getCategories({
4314
- query: params.searchQuery,
4315
- pageNumber: params.pageNumber,
4316
- pageSize: params.pageSize,
4317
- ...filterParams.value,
4318
- }),
4311
+ fetchEntityList: (params) => getCategories(Object.assign({ query: params.searchQuery, pageNumber: params.pageNumber, pageSize: params.pageSize }, filterParams.value)),
4319
4312
  initialValue: [],
4320
4313
  context,
4321
4314
  resourceName: 'Blog categories',
4322
4315
  pageSize: 100,
4323
4316
  });
4324
4317
  watch(filterParams, () => {
4318
+ var _a;
4325
4319
  if (isModuleConfigLoading.value || isCategoryListLoading.value) {
4326
4320
  return;
4327
4321
  }
4328
- const newQuery = {
4329
- ...filterParams.value,
4330
- query: (context.root.$route.query.query ?? ''),
4331
- };
4322
+ const newQuery = Object.assign(Object.assign({}, filterParams.value), { query: ((_a = context.root.$route.query.query) !== null && _a !== void 0 ? _a : '') });
4332
4323
  if (!lodash_isequal(context.root.$route.query, newQuery)) {
4333
4324
  context.root.$router.replace({ query: newQuery });
4334
4325
  fetchCategoryList();
@@ -4621,10 +4612,11 @@ __vue_render__$2._withStripped = true;
4621
4612
  );
4622
4613
 
4623
4614
  function convertCategoryToFormValues(category, languageOptionList) {
4624
- const currentLangOption = languageOptionList.find(({ value }) => value === category?.language);
4615
+ var _a, _b, _c, _d, _e;
4616
+ const currentLangOption = languageOptionList.find(({ value }) => value === (category === null || category === void 0 ? void 0 : category.language));
4625
4617
  if (!category) {
4626
4618
  return {
4627
- language: currentLangOption ?? null,
4619
+ language: currentLangOption !== null && currentLangOption !== void 0 ? currentLangOption : null,
4628
4620
  name: '',
4629
4621
  parent: null,
4630
4622
  urlAlias: '',
@@ -4637,32 +4629,33 @@ function convertCategoryToFormValues(category, languageOptionList) {
4637
4629
  };
4638
4630
  }
4639
4631
  return {
4640
- language: currentLangOption ?? null,
4632
+ language: currentLangOption !== null && currentLangOption !== void 0 ? currentLangOption : null,
4641
4633
  name: category.name,
4642
4634
  parent: category.parent
4643
4635
  ? { value: category.parent.id, label: category.parent.name }
4644
4636
  : null,
4645
4637
  urlAlias: category.urlAlias,
4646
- pageTitle: category.pageTitle ?? '',
4647
- pageDescription: category.pageDescription ?? '',
4648
- pageKeywords: category.pageKeywords ?? '',
4649
- openGraphTitle: category.openGraphTitle ?? '',
4650
- openGraphDescription: category.openGraphDescription ?? '',
4638
+ pageTitle: (_a = category.pageTitle) !== null && _a !== void 0 ? _a : '',
4639
+ pageDescription: (_b = category.pageDescription) !== null && _b !== void 0 ? _b : '',
4640
+ pageKeywords: (_c = category.pageKeywords) !== null && _c !== void 0 ? _c : '',
4641
+ openGraphTitle: (_d = category.openGraphTitle) !== null && _d !== void 0 ? _d : '',
4642
+ openGraphDescription: (_e = category.openGraphDescription) !== null && _e !== void 0 ? _e : '',
4651
4643
  openGraphImage: category.openGraphImage
4652
4644
  ? { id: createId(), file: category.openGraphImage }
4653
4645
  : null,
4654
4646
  };
4655
4647
  }
4656
4648
  function convertCategoryFormValuesToPayload(values) {
4649
+ var _a, _b, _c, _d, _e, _f;
4657
4650
  return {
4658
- language: values.language?.value ?? null,
4651
+ language: (_b = (_a = values.language) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null,
4659
4652
  name: values.name,
4660
- parent: values.parent?.value ?? null,
4653
+ parent: (_d = (_c = values.parent) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : null,
4661
4654
  urlAlias: values.urlAlias,
4662
4655
  isDefault: false,
4663
4656
  pageTitle: values.pageTitle,
4664
4657
  pageDescription: values.pageDescription,
4665
- openGraphImage: values.openGraphImage?.file.id ?? null,
4658
+ openGraphImage: (_f = (_e = values.openGraphImage) === null || _e === void 0 ? void 0 : _e.file.id) !== null && _f !== void 0 ? _f : null,
4666
4659
  };
4667
4660
  }
4668
4661
 
@@ -4675,10 +4668,10 @@ var script$3 = defineComponent({
4675
4668
  const isCreation = computed(() => categoryId.value === 'create');
4676
4669
  /** Fetch module config */
4677
4670
  const { data: moduleConfig, loading: isModuleConfigLoading, } = useFetchModuleConfig({ context });
4678
- const languageList = computed(() => moduleConfig.value?.languages ?? []);
4671
+ const languageList = computed(() => { var _a, _b; return (_b = (_a = moduleConfig.value) === null || _a === void 0 ? void 0 : _a.languages) !== null && _b !== void 0 ? _b : []; });
4679
4672
  const languageOptionList = computed(() => languageList.value.map(({ id, name }) => ({ value: id, label: name })));
4680
4673
  const isLangSpecific = computed(() => languageOptionList.value.length > 0);
4681
- const imageScenario = computed(() => moduleConfig.value?.fileScenarios?.openGraph ?? null);
4674
+ const imageScenario = computed(() => { var _a, _b, _c; return (_c = (_b = (_a = moduleConfig.value) === null || _a === void 0 ? void 0 : _a.fileScenarios) === null || _b === void 0 ? void 0 : _b.openGraph) !== null && _c !== void 0 ? _c : null; });
4682
4675
  /** Fetch Categories */
4683
4676
  const { data: categories, loading: isCategoriesLoading, } = useFetchCategories({ context });
4684
4677
  /** Fetch Category */
@@ -4736,13 +4729,17 @@ var script$3 = defineComponent({
4736
4729
  });
4737
4730
  }
4738
4731
  /** Category Options */
4739
- const categoryOptionList = computed(() => convertCategoryListToOptions(categories.value, values.value.language?.value ?? null));
4732
+ const categoryOptionList = computed(() => {
4733
+ var _a, _b;
4734
+ return convertCategoryListToOptions(categories.value, (_b = (_a = values.value.language) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null);
4735
+ });
4740
4736
  /** Misc */
4741
4737
  const isContentLoading = computed(() => isCategoryLoading.value ||
4742
4738
  isModuleConfigLoading.value ||
4743
4739
  isCategoriesLoading.value);
4744
4740
  const categoryPagePath = computed(() => {
4745
- return `${getWebsiteOrigin()}${category.value?.urlTemplate ?? ''}`;
4741
+ var _a, _b;
4742
+ return `${getWebsiteOrigin()}${(_b = (_a = category.value) === null || _a === void 0 ? void 0 : _a.urlTemplate) !== null && _b !== void 0 ? _b : ''}`;
4746
4743
  });
4747
4744
  /** SEO **/
4748
4745
  function handleSeoFieldGroupChange({ title, description, keywords, image, }) {