sitero 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/export/cms/client/pages/index.js +13 -13
  2. package/dist/src/cms/client/interfaces/components/resources/post/category/category-card.js +4 -4
  3. package/dist/src/cms/client/interfaces/components/resources/post/content/post-create-content.js +3 -4
  4. package/dist/src/cms/client/interfaces/components/resources/post/content/post-edit-content.js +4 -4
  5. package/dist/src/cms/client/interfaces/components/resources/post/content/post-show-content.js +4 -4
  6. package/dist/src/cms/client/interfaces/components/resources/post/content/types.js +2 -2
  7. package/dist/src/cms/client/interfaces/components/resources/post/post-card.js +4 -4
  8. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/category/_id_/edit/page.js +3 -3
  9. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/category/_id_/page.js +6 -9
  10. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/category/_id_/relations/page.js +2 -2
  11. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/category/create/page.js +4 -4
  12. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/page.js +13 -13
  13. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/post/_id_/edit/page.js +5 -7
  14. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/post/_id_/page.js +7 -10
  15. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/post/create/page.js +5 -5
  16. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/subcategory/_id_/edit/page.js +3 -3
  17. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/subcategory/_id_/page.js +6 -9
  18. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/subcategory/create/page.js +4 -4
  19. package/dist/src/config/topics.js +16 -16
  20. package/dist/src/constants/paths/cms-paths.js +3 -3
  21. package/dist/src/core/infrastructure/prisma/post/post-prisma-ports.js +1 -2
  22. package/dist/src/web/server/resources/post/actions.js +22 -25
  23. package/dist/src/web/server/seo/sitemap/get-category-items.js +3 -3
  24. package/dist/src/web/server/seo/sitemap/get-post-items.js +5 -5
  25. package/dist/src/web/server/seo/sitemap/get-subcategory-items.js +3 -3
  26. package/dist/types/export/web/server/index.d.ts +1 -1
  27. package/dist/types/export/web/server/index.d.ts.map +1 -1
  28. package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-card.d.ts +1 -1
  29. package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-card.d.ts.map +1 -1
  30. package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-create-content.d.ts.map +1 -1
  31. package/dist/types/src/cms/client/interfaces/components/resources/post/content/types.d.ts +1 -1
  32. package/dist/types/src/cms/client/interfaces/components/resources/post/content/types.d.ts.map +1 -1
  33. package/dist/types/src/cms/client/interfaces/components/resources/post/post-card.d.ts +2 -2
  34. package/dist/types/src/cms/client/interfaces/components/resources/post/post-card.d.ts.map +1 -1
  35. package/dist/types/src/cms/client/interfaces/components/resources/post/post-presentation.d.ts +1 -1
  36. package/dist/types/src/cms/client/interfaces/components/shadcn/sidebar/sidebar.d.ts.map +1 -1
  37. package/dist/types/src/cms/client/interfaces/components/shadcn/sidebar/use-mobile.d.ts.map +1 -1
  38. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/category/[id]/edit/page.d.ts.map +1 -0
  39. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/category/[id]/page.d.ts.map +1 -0
  40. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/category/[id]/relations/page.d.ts.map +1 -0
  41. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/category/create/page.d.ts.map +1 -0
  42. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/category/index.d.ts.map +1 -0
  43. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/index.d.ts.map +1 -1
  44. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/page.d.ts +1 -1
  45. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/page.d.ts.map +1 -0
  46. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/post/[id]/edit/page.d.ts.map +1 -0
  47. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/post/[id]/page.d.ts.map +1 -0
  48. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/post/[id]/relations/page.d.ts.map +1 -0
  49. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/post/create/page.d.ts.map +1 -0
  50. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/post/index.d.ts.map +1 -0
  51. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/subcategory/[id]/edit/page.d.ts.map +1 -0
  52. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/subcategory/[id]/page.d.ts.map +1 -0
  53. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/subcategory/[id]/relations/page.d.ts.map +1 -0
  54. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/subcategory/create/page.d.ts.map +1 -0
  55. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicKey]/subcategory/index.d.ts.map +1 -0
  56. package/dist/types/src/cms/client/interfaces/pages/index.d.ts +4 -4
  57. package/dist/types/src/cms/client/interfaces/pages/index.d.ts.map +1 -1
  58. package/dist/types/src/config/topics.d.ts +8 -8
  59. package/dist/types/src/config/topics.d.ts.map +1 -1
  60. package/dist/types/src/constants/paths/cms-paths.d.ts +3 -3
  61. package/dist/types/src/constants/paths/cms-paths.d.ts.map +1 -1
  62. package/dist/types/src/core/infrastructure/prisma/post/post-prisma-ports.d.ts.map +1 -1
  63. package/dist/types/src/web/server/index.d.ts +1 -1
  64. package/dist/types/src/web/server/resources/post/actions.d.ts +6 -8
  65. package/dist/types/src/web/server/resources/post/actions.d.ts.map +1 -1
  66. package/dist/types/src/web/server/seo/sitemap/get-category-items.d.ts +2 -2
  67. package/dist/types/src/web/server/seo/sitemap/get-category-items.d.ts.map +1 -1
  68. package/dist/types/src/web/server/seo/sitemap/get-post-items.d.ts +2 -2
  69. package/dist/types/src/web/server/seo/sitemap/get-post-items.d.ts.map +1 -1
  70. package/dist/types/src/web/server/seo/sitemap/get-subcategory-items.d.ts +2 -2
  71. package/dist/types/src/web/server/seo/sitemap/get-subcategory-items.d.ts.map +1 -1
  72. package/dist/types/src/web/server/types.d.ts +7 -10
  73. package/dist/types/src/web/server/types.d.ts.map +1 -1
  74. package/package.json +4 -3
  75. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/edit/page.d.ts.map +0 -1
  76. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/page.d.ts.map +0 -1
  77. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/relations/page.d.ts.map +0 -1
  78. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/create/page.d.ts.map +0 -1
  79. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/index.d.ts.map +0 -1
  80. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/page.d.ts.map +0 -1
  81. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/edit/page.d.ts.map +0 -1
  82. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/page.d.ts.map +0 -1
  83. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/relations/page.d.ts.map +0 -1
  84. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/create/page.d.ts.map +0 -1
  85. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/index.d.ts.map +0 -1
  86. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/edit/page.d.ts.map +0 -1
  87. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/page.d.ts.map +0 -1
  88. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/relations/page.d.ts.map +0 -1
  89. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/create/page.d.ts.map +0 -1
  90. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/index.d.ts.map +0 -1
  91. /package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/post/_id_/relations/page.js +0 -0
  92. /package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/{_topicSlug_ → _topicKey_}/subcategory/_id_/relations/page.js +0 -0
  93. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/category/[id]/edit/page.d.ts +0 -0
  94. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/category/[id]/page.d.ts +0 -0
  95. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/category/[id]/relations/page.d.ts +0 -0
  96. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/category/create/page.d.ts +0 -0
  97. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/category/index.d.ts +0 -0
  98. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/index.d.ts +0 -0
  99. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/post/[id]/edit/page.d.ts +0 -0
  100. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/post/[id]/page.d.ts +0 -0
  101. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/post/[id]/relations/page.d.ts +0 -0
  102. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/post/create/page.d.ts +0 -0
  103. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/post/index.d.ts +0 -0
  104. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/subcategory/[id]/edit/page.d.ts +0 -0
  105. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/subcategory/[id]/page.d.ts +0 -0
  106. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/subcategory/[id]/relations/page.d.ts +0 -0
  107. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/subcategory/create/page.d.ts +0 -0
  108. /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/{[topicSlug] → [topicKey]}/subcategory/index.d.ts +0 -0
@@ -32,19 +32,19 @@ export { createWebsitePageEditPage } from '../../../../src/cms/client/interfaces
32
32
  export { createInquiryIndexPage } from '../../../../src/cms/client/interfaces/pages/dashboard/website/inquiry/page.js';
33
33
  export { createInquiryShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/website/inquiry/_id_/page.js';
34
34
  export { createContentManagementPage as createCollectionsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/page.js';
35
- export { createTopicScopePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/page.js';
36
- export { createPostCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/create/page.js';
37
- export { createPostShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/page.js';
38
- export { createPostRelationsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/relations/page.js';
39
- export { createPostEditPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/edit/page.js';
40
- export { createCategoryCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/create/page.js';
41
- export { createCategoryShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/page.js';
42
- export { createCategoryRelationsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/relations/page.js';
43
- export { createCategoryEditPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/edit/page.js';
44
- export { createSubcategoryCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/create/page.js';
45
- export { createSubcategoryShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/page.js';
46
- export { createSubcategoryRelationsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/relations/page.js';
47
- export { createSubcategoryEditPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/edit/page.js';
35
+ export { createTopicScopePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/page.js';
36
+ export { createPostCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/post/create/page.js';
37
+ export { createPostShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/post/_id_/page.js';
38
+ export { createPostRelationsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/post/_id_/relations/page.js';
39
+ export { createPostEditPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/post/_id_/edit/page.js';
40
+ export { createCategoryCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/category/create/page.js';
41
+ export { createCategoryShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/category/_id_/page.js';
42
+ export { createCategoryRelationsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/category/_id_/relations/page.js';
43
+ export { createCategoryEditPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/category/_id_/edit/page.js';
44
+ export { createSubcategoryCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/subcategory/create/page.js';
45
+ export { createSubcategoryShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/subcategory/_id_/page.js';
46
+ export { createSubcategoryRelationsPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/subcategory/_id_/relations/page.js';
47
+ export { createSubcategoryEditPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/_topicKey_/subcategory/_id_/edit/page.js';
48
48
  export { createTagIndexPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/tag/page.js';
49
49
  export { createTagCreatePage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/tag/create/page.js';
50
50
  export { createTagShowPage } from '../../../../src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/page.js';
@@ -47,7 +47,7 @@ function createCategoryCard({
47
47
  }) {
48
48
  return function CategoryCard({
49
49
  post: category,
50
- topicSlug,
50
+ topicKey,
51
51
  isSubcategory,
52
52
  customControlFields = defaultCustomControlFields,
53
53
  usableFields,
@@ -59,19 +59,19 @@ function createCategoryCard({
59
59
  // base
60
60
  className = ""
61
61
  }) {
62
- const resolvedTopicSlug = category.topicKey ?? topicSlug;
62
+ const resolvedTopicKey = category.topicKey ?? topicKey;
63
63
  const topicT = {
64
64
  title: topics[category.topicKey ?? ""]?.title[defaultWebLocale] ?? category.topicKey ?? ""
65
65
  };
66
66
  const categoryT = findTranslation(category?.translations, defaultWebLocale);
67
67
  const href = isSubcategory ? joinUrl(
68
68
  CMS_PATHS.content["content-management"].subcategory.pathname(
69
- resolvedTopicSlug
69
+ resolvedTopicKey
70
70
  ),
71
71
  category?.id
72
72
  ) : joinUrl(
73
73
  CMS_PATHS.content["content-management"].category.pathname(
74
- resolvedTopicSlug
74
+ resolvedTopicKey
75
75
  ),
76
76
  category?.id
77
77
  );
@@ -102,8 +102,7 @@ function createPostCreateContent({
102
102
  const parentPathname = useParentPathname();
103
103
  const { admin } = useAdmin();
104
104
  const editorLocale = cmsLocale.startsWith("zh") ? "zh" : "en";
105
- const topicSlug = topicKey;
106
- const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicSlug, type, field, fieldRuleKey });
105
+ const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicKey, type, field, fieldRuleKey });
107
106
  const { formData, setFormData } = usePostCreateFormData({
108
107
  type: postType,
109
108
  admin,
@@ -230,7 +229,7 @@ function createPostCreateContent({
230
229
  {
231
230
  openNewTab: true,
232
231
  post: parent,
233
- topicSlug: topicKey,
232
+ topicKey,
234
233
  isSubcategory: isSubcategoryParent
235
234
  },
236
235
  parent.id
@@ -579,7 +578,7 @@ function createPostCreateContent({
579
578
  {
580
579
  openNewTab: true,
581
580
  post: relatedPost,
582
- topicSlug: topicKey
581
+ topicKey
583
582
  },
584
583
  relatedPost.id
585
584
  ))
@@ -101,8 +101,8 @@ function createPostEditContent({
101
101
  const editorLocale = cmsLocale.startsWith("zh") ? "zh" : "en";
102
102
  const id = post?.id ?? "";
103
103
  const slug = post?.slug;
104
- const topicSlug = post?.topicKey ?? void 0;
105
- const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicSlug, type, field, fieldRuleKey });
104
+ const topicKey = post?.topicKey ?? void 0;
105
+ const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicKey, type, field, fieldRuleKey });
106
106
  const { formData, setFormData } = usePostUpdateFormData({
107
107
  post,
108
108
  type: postType
@@ -227,7 +227,7 @@ function createPostEditContent({
227
227
  {
228
228
  openNewTab: true,
229
229
  post: parent,
230
- topicSlug: post?.topicKey ?? void 0,
230
+ topicKey: post?.topicKey ?? void 0,
231
231
  isSubcategory: isSubcategoryParent
232
232
  },
233
233
  parent.id
@@ -577,7 +577,7 @@ function createPostEditContent({
577
577
  {
578
578
  openNewTab: true,
579
579
  post: relatedPost,
580
- topicSlug: post?.topicKey ?? void 0
580
+ topicKey: post?.topicKey ?? void 0
581
581
  },
582
582
  relatedPost.id
583
583
  ))
@@ -72,10 +72,10 @@ function createPostShowContent({
72
72
  }) {
73
73
  const { t, format, locale: cmsLocale } = useTranslator();
74
74
  const type = post?.type;
75
- const topicSlug = post?.topicKey ?? void 0;
75
+ const topicKey = post?.topicKey ?? void 0;
76
76
  const categories = post?.parents;
77
77
  const parentLabelKey = subcategoryType && categories?.[0]?.type === subcategoryType ? "resources.subcategory.text" : "resources.category.text";
78
- const isFieldAllowed = (type2, field, fieldRuleKey) => allowField({ topicSlug, type: type2, field, fieldRuleKey });
78
+ const isFieldAllowed = (type2, field, fieldRuleKey) => allowField({ topicKey, type: type2, field, fieldRuleKey });
79
79
  return /* @__PURE__ */ jsx(ContentContainer, { isNotFound, children: /* @__PURE__ */ jsxs(FieldsContainer, { children: [
80
80
  /* @__PURE__ */ jsxs(MainFields, { children: [
81
81
  topChildren,
@@ -90,7 +90,7 @@ function createPostShowContent({
90
90
  CategoryCard,
91
91
  {
92
92
  post: p,
93
- topicSlug,
93
+ topicKey,
94
94
  openNewTab: true,
95
95
  isSubcategory: p.type === subcategoryType
96
96
  },
@@ -273,7 +273,7 @@ function createPostShowContent({
273
273
  PostCard,
274
274
  {
275
275
  post: p,
276
- topicSlug,
276
+ topicKey,
277
277
  openNewTab: true
278
278
  },
279
279
  p.id
@@ -1,8 +1,8 @@
1
1
  function createAllowPostField(rules) {
2
2
  const isFieldRuleKey = (key) => key in rules;
3
- return ({ topicSlug, type, field, fieldRuleKey = "default" }) => {
3
+ return ({ topicKey, type, field, fieldRuleKey = "default" }) => {
4
4
  if (!type || !field) return false;
5
- const ruleKey = topicSlug && isFieldRuleKey(topicSlug) ? topicSlug : "global";
5
+ const ruleKey = topicKey && isFieldRuleKey(topicKey) ? topicKey : "global";
6
6
  const fieldsInType = rules[ruleKey]?.[type];
7
7
  const fields = fieldsInType?.[fieldRuleKey] ?? fieldsInType?.["default"] ?? [];
8
8
  return fields.includes(field);
@@ -53,7 +53,7 @@ function createPostCard({
53
53
  }) {
54
54
  return function PostCard({
55
55
  post,
56
- topicSlug,
56
+ topicKey,
57
57
  customControlFields = defaultCustomControlFields,
58
58
  usableFields,
59
59
  // link
@@ -64,16 +64,16 @@ function createPostCard({
64
64
  // base
65
65
  className = ""
66
66
  }) {
67
- const resolvedTopicSlug = post.topicKey ?? topicSlug;
67
+ const resolvedTopicKey = post.topicKey ?? topicKey;
68
68
  const topicT = {
69
69
  title: topics[post.topicKey ?? ""]?.title[defaultWebLocale] ?? post.topicKey ?? ""
70
70
  };
71
71
  const postT = findTranslation(post.translations, defaultWebLocale);
72
- const strategy = strategies?.[post.type]?.[resolvedTopicSlug ?? ""] ?? {};
72
+ const strategy = strategies?.[post.type]?.[resolvedTopicKey ?? ""] ?? {};
73
73
  const presentation = resolvePostPresentation(postT, strategy);
74
74
  const coverImage = "coverImage" in post ? post.coverImage : null;
75
75
  const href = joinUrl(
76
- CMS_PATHS.content["content-management"].post.pathname(resolvedTopicSlug),
76
+ CMS_PATHS.content["content-management"].post.pathname(resolvedTopicKey),
77
77
  post?.id
78
78
  );
79
79
  return /* @__PURE__ */ jsx(
@@ -52,11 +52,11 @@ function createCategoryEditPage({
52
52
  }) {
53
53
  return function CategoryEditPage() {
54
54
  const { t, locale } = useTranslator();
55
- const { id, topicSlug } = useParams();
56
- const allowFieldInTopic = (params) => allowField?.({ ...params, topicSlug: params.topicSlug ?? topicSlug }) ?? false;
55
+ const { id, topicKey } = useParams();
56
+ const allowFieldInTopic = (params) => allowField?.({ ...params, topicKey: params.topicKey ?? topicKey }) ?? false;
57
57
  const categoryType = POST_TYPES.CATEGORY;
58
58
  const subcategoryType = POST_TYPES.SUBCATEGORY;
59
- const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
59
+ const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey], key: topicKey } : void 0;
60
60
  const {
61
61
  data: category,
62
62
  isFetching,
@@ -63,10 +63,10 @@ function createCategoryShowPage({
63
63
  }) {
64
64
  return function CategoryShowPage() {
65
65
  const { t, locale } = useTranslator();
66
- const { id, topicSlug } = useParams();
66
+ const { id, topicKey } = useParams();
67
67
  const router = useRouter();
68
68
  const postType = POST_TYPES.POST;
69
- const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug]} : void 0;
69
+ const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey]} : void 0;
70
70
  const {
71
71
  data: category,
72
72
  isFetching,
@@ -82,10 +82,7 @@ function createCategoryShowPage({
82
82
  () => postDeleteAction({ id }),
83
83
  {
84
84
  onSuccess: () => router.replace(
85
- joinUrl(
86
- CMS_PATHS.content["content-management"].pathname,
87
- topicSlug
88
- )
85
+ joinUrl(CMS_PATHS.content["content-management"].pathname, topicKey)
89
86
  )
90
87
  }
91
88
  );
@@ -99,7 +96,7 @@ function createCategoryShowPage({
99
96
  {
100
97
  href: joinUrl(
101
98
  CMS_PATHS.content["content-management"].pathname,
102
- topicSlug
99
+ topicKey
103
100
  )
104
101
  }
105
102
  ),
@@ -125,7 +122,7 @@ function createCategoryShowPage({
125
122
  icon: Pen,
126
123
  href: joinUrl(
127
124
  CMS_PATHS.content["content-management"].category.pathname(
128
- topicSlug
125
+ topicKey
129
126
  ),
130
127
  id,
131
128
  "edit"
@@ -184,7 +181,7 @@ function createCategoryShowPage({
184
181
  {
185
182
  href: joinUrl(
186
183
  CMS_PATHS.content["content-management"].category.pathname(
187
- topicSlug
184
+ topicKey
188
185
  ),
189
186
  id,
190
187
  "relations"
@@ -53,14 +53,14 @@ function createCategoryRelationsPage({
53
53
  postFindRelationsAction
54
54
  });
55
55
  return function CategoryRelationsPage() {
56
- const { topicSlug } = useParams();
56
+ const { topicKey } = useParams();
57
57
  const { t } = useTranslator();
58
58
  const [subcategoryStates, setSubcategoryStates] = useState({});
59
59
  const [postStates, setPostStates] = useState(
60
60
  {}
61
61
  );
62
62
  return /* @__PURE__ */ jsx(PostRelationsLayout, { children: (relations) => /* @__PURE__ */ jsxs(AccordionContainer, { children: [
63
- (contentUi ? contentUi.byTopic[topicSlug]?.hasSubcategory ?? false : true) && /* @__PURE__ */ jsx(
63
+ (contentUi ? contentUi.byTopic[topicKey]?.hasSubcategory ?? false : true) && /* @__PURE__ */ jsx(
64
64
  Accordion,
65
65
  {
66
66
  hasBorder: true,
@@ -53,15 +53,15 @@ function createCategoryCreatePage({
53
53
  }) {
54
54
  return function CategoryCreatePage() {
55
55
  const { t, locale } = useTranslator();
56
- const { topicSlug } = useParams();
57
- const allowFieldInTopic = (params) => allowField?.({ ...params, topicSlug: params.topicSlug ?? topicSlug }) ?? false;
56
+ const { topicKey } = useParams();
57
+ const allowFieldInTopic = (params) => allowField?.({ ...params, topicKey: params.topicKey ?? topicKey }) ?? false;
58
58
  const categoryType = POST_TYPES.CATEGORY;
59
59
  const subcategoryType = POST_TYPES.SUBCATEGORY;
60
60
  const returnHref = joinUrl(
61
61
  CMS_PATHS.content["content-management"].pathname,
62
- topicSlug
62
+ topicKey
63
63
  );
64
- const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
64
+ const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey], key: topicKey } : void 0;
65
65
  const { data: categories, isFetching: isFetchingControlMeta } = useCmsQuery(
66
66
  () => postFindManyAction({
67
67
  type: categoryType,
@@ -60,21 +60,21 @@ function createTopicScopePage({
60
60
  }) {
61
61
  return function ContentTopicScopePage() {
62
62
  const { t, locale } = useTranslator();
63
- const { topicSlug } = useParams();
64
- const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicSlug, type, field, fieldRuleKey });
65
- const isContentTopicScope = isContentTopic(staticTopics, topicSlug);
63
+ const { topicKey } = useParams();
64
+ const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicKey, type, field, fieldRuleKey });
65
+ const isContentTopicScope = isContentTopic(staticTopics, topicKey);
66
66
  const hasPost = isContentTopicScope;
67
67
  const hasCategory = hasTopicRole(
68
68
  staticTopics,
69
- topicSlug,
69
+ topicKey,
70
70
  POST_TYPES.CATEGORY
71
71
  );
72
72
  const hasSubcategory = hasTopicRole(
73
73
  staticTopics,
74
- topicSlug,
74
+ topicKey,
75
75
  POST_TYPES.SUBCATEGORY
76
76
  );
77
- const topic = Object.hasOwn(staticTopics, topicSlug) ? staticTopics[topicSlug] : void 0;
77
+ const topic = Object.hasOwn(staticTopics, topicKey) ? staticTopics[topicKey] : void 0;
78
78
  const topicT = { title: topic?.title[locale] ?? "" };
79
79
  const [categoryStates, setCategoryStates] = useState({});
80
80
  const [subcategoryStates, setSubcategoryStates] = useState({});
@@ -94,12 +94,12 @@ function createTopicScopePage({
94
94
  {
95
95
  usableFields: getUsableFields(POST_TYPES.POST),
96
96
  type: POST_TYPES.POST,
97
- topicKey: topic ? topicSlug : DO_NOT_FETCH_KEY,
97
+ topicKey: topic ? topicKey : DO_NOT_FETCH_KEY,
98
98
  setListItemStates: setPostStates,
99
99
  localKey: `post-${POST_TYPES.POST}`
100
100
  }
101
101
  );
102
- const websiteHref = externalHref?.(topicSlug) ?? `/${topicSlug}`;
102
+ const websiteHref = externalHref?.(topicKey) ?? `/${topicKey}`;
103
103
  return /* @__PURE__ */ jsxs(Fragment, { children: [
104
104
  /* @__PURE__ */ jsx(
105
105
  PageHeaderLayout,
@@ -117,7 +117,7 @@ function createTopicScopePage({
117
117
  icon: Plus,
118
118
  href: joinUrl(
119
119
  CMS_PATHS.content["content-management"].category.pathname(
120
- topicSlug
120
+ topicKey
121
121
  ),
122
122
  "create"
123
123
  ),
@@ -133,7 +133,7 @@ function createTopicScopePage({
133
133
  variant: "success",
134
134
  icon: Plus,
135
135
  href: joinUrl(
136
- CMS_PATHS.content["content-management"].subcategory.pathname(topicSlug),
136
+ CMS_PATHS.content["content-management"].subcategory.pathname(topicKey),
137
137
  "create"
138
138
  ),
139
139
  isDisabled: !topic || !isContentTopicScope,
@@ -149,7 +149,7 @@ function createTopicScopePage({
149
149
  icon: File,
150
150
  href: joinUrl(
151
151
  CMS_PATHS.content["content-management"].post.pathname(
152
- topicSlug
152
+ topicKey
153
153
  ),
154
154
  "create"
155
155
  ),
@@ -192,7 +192,7 @@ function createTopicScopePage({
192
192
  {
193
193
  usableFields: getUsableFields(POST_TYPES.CATEGORY),
194
194
  type: POST_TYPES.CATEGORY,
195
- topicKey: topic ? topicSlug : DO_NOT_FETCH_KEY,
195
+ topicKey: topic ? topicKey : DO_NOT_FETCH_KEY,
196
196
  setListItemStates: setCategoryStates,
197
197
  Card: (props) => /* @__PURE__ */ jsx(CategoryCard, { ...props }),
198
198
  Table: (props) => /* @__PURE__ */ jsx(CategoryTable, { ...props }),
@@ -220,7 +220,7 @@ function createTopicScopePage({
220
220
  {
221
221
  usableFields: getUsableFields(POST_TYPES.SUBCATEGORY),
222
222
  type: POST_TYPES.SUBCATEGORY,
223
- topicKey: topic ? topicSlug : DO_NOT_FETCH_KEY,
223
+ topicKey: topic ? topicKey : DO_NOT_FETCH_KEY,
224
224
  setListItemStates: setSubcategoryStates,
225
225
  Card: (props) => /* @__PURE__ */ jsx(CategoryCard, { ...props, isSubcategory: true }),
226
226
  Table: (props) => /* @__PURE__ */ jsx(CategoryTable, { ...props, isSubcategory: true }),
@@ -55,15 +55,15 @@ function createPostEditPage({
55
55
  }) {
56
56
  return function PostEditPage() {
57
57
  const { t } = useTranslator();
58
- const { id, topicSlug } = useParams();
59
- const allowFieldInTopic = (params) => allowField?.({ ...params, topicSlug: params.topicSlug ?? topicSlug }) ?? false;
58
+ const { id, topicKey } = useParams();
59
+ const allowFieldInTopic = (params) => allowField?.({ ...params, topicKey: params.topicKey ?? topicKey }) ?? false;
60
60
  const postType = POST_TYPES.POST;
61
- const roles = staticTopics[topicSlug]?.roles ?? [];
61
+ const roles = staticTopics[topicKey]?.roles ?? [];
62
62
  const hasCategory = roles.includes(POST_TYPES.CATEGORY);
63
63
  const hasSubcategory = roles.includes(POST_TYPES.SUBCATEGORY);
64
64
  const categoryType = POST_TYPES.CATEGORY;
65
65
  const subcategoryType = POST_TYPES.SUBCATEGORY;
66
- const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
66
+ const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey], key: topicKey } : void 0;
67
67
  const {
68
68
  data: post,
69
69
  isFetching,
@@ -98,9 +98,7 @@ function createPostEditPage({
98
98
  {
99
99
  useConfirm: true,
100
100
  href: joinUrl(
101
- CMS_PATHS.content["content-management"].post.pathname(
102
- topicSlug
103
- ),
101
+ CMS_PATHS.content["content-management"].post.pathname(topicKey),
104
102
  id
105
103
  )
106
104
  }
@@ -64,13 +64,13 @@ function createPostShowPage({
64
64
  }) {
65
65
  return function PostShowPage() {
66
66
  const { t } = useTranslator();
67
- const { id, topicSlug } = useParams();
67
+ const { id, topicKey } = useParams();
68
68
  const router = useRouter();
69
69
  const postType = POST_TYPES.POST;
70
- const subcategoryType = staticTopics[topicSlug]?.roles.includes(
70
+ const subcategoryType = staticTopics[topicKey]?.roles.includes(
71
71
  POST_TYPES.SUBCATEGORY
72
72
  ) ? POST_TYPES.SUBCATEGORY : void 0;
73
- const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug]} : void 0;
73
+ const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey]} : void 0;
74
74
  const {
75
75
  data: post,
76
76
  isFetching,
@@ -86,10 +86,7 @@ function createPostShowPage({
86
86
  () => postDeleteAction({ id }),
87
87
  {
88
88
  onSuccess: () => router.replace(
89
- joinUrl(
90
- CMS_PATHS.content["content-management"].pathname,
91
- topicSlug
92
- )
89
+ joinUrl(CMS_PATHS.content["content-management"].pathname, topicKey)
93
90
  )
94
91
  }
95
92
  );
@@ -103,7 +100,7 @@ function createPostShowPage({
103
100
  {
104
101
  href: joinUrl(
105
102
  CMS_PATHS.content["content-management"].pathname,
106
- topicSlug
103
+ topicKey
107
104
  )
108
105
  }
109
106
  ),
@@ -128,7 +125,7 @@ function createPostShowPage({
128
125
  icon: Pen,
129
126
  href: joinUrl(
130
127
  CMS_PATHS.content["content-management"].post.pathname(
131
- topicSlug
128
+ topicKey
132
129
  ),
133
130
  id,
134
131
  "edit"
@@ -188,7 +185,7 @@ function createPostShowPage({
188
185
  {
189
186
  href: joinUrl(
190
187
  CMS_PATHS.content["content-management"].post.pathname(
191
- topicSlug
188
+ topicKey
192
189
  ),
193
190
  id,
194
191
  "relations"
@@ -54,19 +54,19 @@ function createPostCreatePage({
54
54
  }) {
55
55
  return function PostCreatePage() {
56
56
  const { t } = useTranslator();
57
- const { topicSlug } = useParams();
58
- const allowFieldInTopic = (params) => allowField?.({ ...params, topicSlug: params.topicSlug ?? topicSlug }) ?? false;
57
+ const { topicKey } = useParams();
58
+ const allowFieldInTopic = (params) => allowField?.({ ...params, topicKey: params.topicKey ?? topicKey }) ?? false;
59
59
  const postType = POST_TYPES.POST;
60
- const roles = staticTopics[topicSlug]?.roles ?? [];
60
+ const roles = staticTopics[topicKey]?.roles ?? [];
61
61
  const hasCategory = roles.includes(POST_TYPES.CATEGORY);
62
62
  const hasSubcategory = roles.includes(POST_TYPES.SUBCATEGORY);
63
63
  const categoryType = POST_TYPES.CATEGORY;
64
64
  const subcategoryType = POST_TYPES.SUBCATEGORY;
65
65
  const returnHref = joinUrl(
66
66
  CMS_PATHS.content["content-management"].pathname,
67
- topicSlug
67
+ topicKey
68
68
  );
69
- const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
69
+ const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey], key: topicKey } : void 0;
70
70
  const { data: posts, isFetching: isFetchingControlMeta } = useCmsQuery(
71
71
  () => postFindManyAction({
72
72
  type: postType,
@@ -52,11 +52,11 @@ function createSubcategoryEditPage({
52
52
  }) {
53
53
  return function SubcategoryEditPage() {
54
54
  const { t, locale } = useTranslator();
55
- const { id, topicSlug } = useParams();
56
- const allowFieldInTopic = (params) => allowField?.({ ...params, topicSlug: params.topicSlug ?? topicSlug }) ?? false;
55
+ const { id, topicKey } = useParams();
56
+ const allowFieldInTopic = (params) => allowField?.({ ...params, topicKey: params.topicKey ?? topicKey }) ?? false;
57
57
  const categoryType = POST_TYPES.CATEGORY;
58
58
  const subcategoryType = POST_TYPES.SUBCATEGORY;
59
- const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
59
+ const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey], key: topicKey } : void 0;
60
60
  const {
61
61
  data: subcategory,
62
62
  isFetching,
@@ -63,10 +63,10 @@ function createSubcategoryShowPage({
63
63
  }) {
64
64
  return function CategoryShowPage() {
65
65
  const { t, locale } = useTranslator();
66
- const { id, topicSlug } = useParams();
66
+ const { id, topicKey } = useParams();
67
67
  const router = useRouter();
68
68
  const postType = POST_TYPES.POST;
69
- const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug]} : void 0;
69
+ const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey]} : void 0;
70
70
  const {
71
71
  data: subcategory,
72
72
  isFetching,
@@ -82,10 +82,7 @@ function createSubcategoryShowPage({
82
82
  () => postDeleteAction({ id }),
83
83
  {
84
84
  onSuccess: () => router.replace(
85
- joinUrl(
86
- CMS_PATHS.content["content-management"].pathname,
87
- topicSlug
88
- )
85
+ joinUrl(CMS_PATHS.content["content-management"].pathname, topicKey)
89
86
  )
90
87
  }
91
88
  );
@@ -99,7 +96,7 @@ function createSubcategoryShowPage({
99
96
  {
100
97
  href: joinUrl(
101
98
  CMS_PATHS.content["content-management"].pathname,
102
- topicSlug
99
+ topicKey
103
100
  )
104
101
  }
105
102
  ),
@@ -125,7 +122,7 @@ function createSubcategoryShowPage({
125
122
  icon: Pen,
126
123
  href: joinUrl(
127
124
  CMS_PATHS.content["content-management"].subcategory.pathname(
128
- topicSlug
125
+ topicKey
129
126
  ),
130
127
  id,
131
128
  "edit"
@@ -183,7 +180,7 @@ function createSubcategoryShowPage({
183
180
  PostRelationsLink,
184
181
  {
185
182
  href: joinUrl(
186
- CMS_PATHS.content["content-management"].subcategory.pathname(topicSlug),
183
+ CMS_PATHS.content["content-management"].subcategory.pathname(topicKey),
187
184
  id,
188
185
  "relations"
189
186
  )
@@ -53,15 +53,15 @@ function createSubcategoryCreatePage({
53
53
  }) {
54
54
  return function SubcategoryCreatePage() {
55
55
  const { t, locale } = useTranslator();
56
- const { topicSlug } = useParams();
57
- const allowFieldInTopic = (params) => allowField?.({ ...params, topicSlug: params.topicSlug ?? topicSlug }) ?? false;
56
+ const { topicKey } = useParams();
57
+ const allowFieldInTopic = (params) => allowField?.({ ...params, topicKey: params.topicKey ?? topicKey }) ?? false;
58
58
  const categoryType = POST_TYPES.CATEGORY;
59
59
  const subcategoryType = POST_TYPES.SUBCATEGORY;
60
60
  const returnHref = joinUrl(
61
61
  CMS_PATHS.content["content-management"].pathname,
62
- topicSlug
62
+ topicKey
63
63
  );
64
- const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
64
+ const topic = Object.hasOwn(staticTopics, topicKey) ? { ...staticTopics[topicKey], key: topicKey } : void 0;
65
65
  const { data: subcategories, isFetching: isFetchingControlMeta } = useCmsQuery(
66
66
  () => postFindManyAction({
67
67
  type: subcategoryType,