sitero 0.6.0 → 0.7.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 (368) hide show
  1. package/dist/export/cms/client/components/index.js +6 -2
  2. package/dist/export/cms/client/index.js +2 -0
  3. package/dist/export/cms/client/pages/index.js +1 -3
  4. package/dist/export/cms/server/index.js +1 -0
  5. package/dist/export/core/server/index.js +2 -0
  6. package/dist/export/index.js +1 -0
  7. package/dist/export/web/server/index.js +1 -0
  8. package/dist/prisma/generated/internal/class.js +4 -4
  9. package/dist/src/cms/client/applications/create-applications.js +5 -0
  10. package/dist/src/cms/client/applications/resources/page/form-data.js +56 -0
  11. package/dist/src/cms/client/applications/resources/page/use-page-update-form-data.js +30 -0
  12. package/dist/src/cms/client/applications/resources/post/use-create-form-data.js +5 -5
  13. package/dist/src/cms/client/applications/resources/post/use-update-form-data.js +1 -1
  14. package/dist/src/cms/client/applications/resources/seo-metadata/build-seo-metadata-translations.js +35 -0
  15. package/dist/src/cms/client/applications/resources/seo-metadata/use-upsert-form-data.js +15 -31
  16. package/dist/src/cms/client/applications/ui/use-nav-items.js +28 -39
  17. package/dist/src/cms/client/infrastructure/i18n/messages/en-US/resources/file.js +5 -4
  18. package/dist/src/cms/client/infrastructure/i18n/messages/en-US/resources/index.js +7 -0
  19. package/dist/src/cms/client/infrastructure/i18n/messages/en-US/resources/post.js +32 -1
  20. package/dist/src/cms/client/infrastructure/i18n/messages/en-US/ui/index.js +8 -1
  21. package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/file.js +6 -5
  22. package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/index.js +7 -0
  23. package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/post.js +18 -1
  24. package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/ui/index.js +7 -2
  25. package/dist/src/cms/client/infrastructure/operation-result/presentation/message.js +15 -0
  26. package/dist/src/cms/client/interfaces/components/create-components.js +4 -8
  27. package/dist/src/cms/client/interfaces/components/create-page-contents.js +28 -0
  28. package/dist/src/cms/client/interfaces/components/resources/page/content/field-groups.js +16 -0
  29. package/dist/src/cms/client/interfaces/components/resources/page/content/page-edit-content.js +216 -0
  30. package/dist/src/cms/client/interfaces/components/resources/page/content/page-show-content.js +114 -0
  31. package/dist/src/cms/client/interfaces/components/resources/page/content/types.js +12 -0
  32. package/dist/src/cms/client/interfaces/components/resources/post/category/category-card.js +5 -3
  33. package/dist/src/cms/client/interfaces/components/resources/post/category/category-table.js +6 -4
  34. package/dist/src/cms/client/interfaces/components/resources/post/content/post-create-content.js +13 -8
  35. package/dist/src/cms/client/interfaces/components/resources/post/content/post-edit-content.js +11 -7
  36. package/dist/src/cms/client/interfaces/components/resources/post/content/post-show-content.js +7 -2
  37. package/dist/src/cms/client/interfaces/components/resources/post/post-card.js +5 -3
  38. package/dist/src/cms/client/interfaces/components/resources/post/post-list.js +45 -10
  39. package/dist/src/cms/client/interfaces/components/resources/post/post-state-icons.js +17 -1
  40. package/dist/src/cms/client/interfaces/components/resources/post/post-table.js +8 -4
  41. package/dist/src/cms/client/interfaces/components/resources/post/search/control-fields-filters.js +5 -1
  42. package/dist/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.js +90 -67
  43. package/dist/src/cms/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.js +11 -1
  44. package/dist/src/cms/client/interfaces/components/ui/blocks/list-container/list-container.js +1 -1
  45. package/dist/src/cms/client/interfaces/components/ui/blocks/list-container/pagination.js +9 -9
  46. package/dist/src/cms/client/interfaces/components/ui/features/accordion/accordion-header.js +15 -3
  47. package/dist/src/cms/client/interfaces/components/ui/features/accordion/accordion.js +5 -7
  48. package/dist/src/cms/client/interfaces/components/ui/form/control-fields/control-fields-display.js +1 -1
  49. package/dist/src/cms/client/interfaces/components/ui/form/control-fields/control-fields-input.js +1 -1
  50. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/edit/page.js +11 -11
  51. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/page.js +12 -16
  52. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/relations/page.js +6 -2
  53. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/create/page.js +15 -16
  54. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/page.js +18 -41
  55. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/edit/page.js +10 -11
  56. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/page.js +11 -16
  57. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/relations/page.js +1 -0
  58. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/create/page.js +14 -16
  59. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/edit/page.js +11 -11
  60. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/page.js +12 -16
  61. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/relations/page.js +1 -0
  62. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/create/page.js +15 -16
  63. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/page.js +18 -32
  64. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/edit/page.js +2 -2
  65. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/page.js +9 -9
  66. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/relations/page.js +6 -2
  67. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/create/page.js +2 -2
  68. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/page.js +204 -0
  69. package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/_id_/admin-refresh-token/page.js +1 -0
  70. package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/_id_/page.js +1 -0
  71. package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/_id_/relations/page.js +8 -3
  72. package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/_id_/page.js +3 -2
  73. package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/_id_/relations/page.js +41 -30
  74. package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/delete-many/page.js +3 -3
  75. package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/page.js +1 -1
  76. package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/trash/page.js +3 -2
  77. package/dist/src/cms/client/interfaces/pages/dashboard/website/website-page/_slug_/edit/page.js +19 -11
  78. package/dist/src/cms/client/interfaces/pages/dashboard/website/website-page/_slug_/page.js +23 -10
  79. package/dist/src/cms/client/interfaces/pages/dashboard/website/website-page/page.js +7 -7
  80. package/dist/src/cms/server/create-cms-server.js +2 -0
  81. package/dist/src/cms/server/resources/page/actions.js +31 -0
  82. package/dist/src/cms/server/resources/post/actions.js +27 -6
  83. package/dist/src/cms/server/resources/seo-metadata/actions.js +7 -16
  84. package/dist/src/config/content-ui.js +24 -0
  85. package/dist/src/config/topics.js +1 -1
  86. package/dist/src/constants/paths/cms-paths.js +2 -2
  87. package/dist/src/core/infrastructure/prisma/file/include.js +44 -0
  88. package/dist/src/core/infrastructure/prisma/file/mappers.js +51 -3
  89. package/dist/src/core/infrastructure/prisma/helpers/active-file-references.js +2 -1
  90. package/dist/src/core/infrastructure/prisma/page/include.js +20 -0
  91. package/dist/src/core/infrastructure/prisma/page/mappers.js +44 -0
  92. package/dist/src/core/infrastructure/prisma/page/page-prisma-ports.js +91 -0
  93. package/dist/src/core/infrastructure/prisma/post/include.js +2 -5
  94. package/dist/src/core/infrastructure/prisma/post/lifecycle.js +108 -0
  95. package/dist/src/core/infrastructure/prisma/post/mappers.js +0 -2
  96. package/dist/src/core/infrastructure/prisma/post/post-prisma-ports.js +76 -24
  97. package/dist/src/core/infrastructure/prisma/post/read-scope.js +45 -0
  98. package/dist/src/core/infrastructure/prisma/seo-metadata/mappers.js +6 -1
  99. package/dist/src/core/infrastructure/prisma/seo-metadata/seo-metadata-prisma-ports.js +32 -11
  100. package/dist/src/core/seeders/page/seeder.js +9 -29
  101. package/dist/src/core/seeders/seed.js +0 -3
  102. package/dist/src/core/sitero-server/create-sitero-server.js +10 -0
  103. package/dist/src/web/server/create-web-server.js +5 -1
  104. package/dist/src/web/server/resources/page/actions.js +20 -0
  105. package/dist/src/web/server/resources/post/actions.js +3 -13
  106. package/dist/src/web/server/seo/sitemap/get-page-items.js +7 -6
  107. package/dist/src/web/server/seo/sitemap/get-post-items.js +2 -2
  108. package/dist/src/web/server/seo/sitemap/get-subcategory-items.js +1 -1
  109. package/dist/types/export/cms/client/components/index.d.ts +3 -0
  110. package/dist/types/export/cms/client/components/index.d.ts.map +1 -1
  111. package/dist/types/export/cms/client/index.d.ts +2 -0
  112. package/dist/types/export/cms/client/index.d.ts.map +1 -1
  113. package/dist/types/export/cms/client/pages/index.d.ts +2 -1
  114. package/dist/types/export/cms/client/pages/index.d.ts.map +1 -1
  115. package/dist/types/export/cms/server/index.d.ts +2 -1
  116. package/dist/types/export/cms/server/index.d.ts.map +1 -1
  117. package/dist/types/export/index.d.ts +1 -1
  118. package/dist/types/export/index.d.ts.map +1 -1
  119. package/dist/types/export/web/server/index.d.ts +2 -1
  120. package/dist/types/export/web/server/index.d.ts.map +1 -1
  121. package/dist/types/src/cms/client/applications/create-applications.d.ts.map +1 -1
  122. package/dist/types/src/cms/client/applications/index.d.ts +1 -0
  123. package/dist/types/src/cms/client/applications/index.d.ts.map +1 -1
  124. package/dist/types/src/cms/client/applications/resources/index.d.ts +1 -0
  125. package/dist/types/src/cms/client/applications/resources/index.d.ts.map +1 -1
  126. package/dist/types/src/cms/client/applications/resources/page/form-data.d.ts +21 -0
  127. package/dist/types/src/cms/client/applications/resources/page/form-data.d.ts.map +1 -0
  128. package/dist/types/src/cms/client/applications/resources/page/index.d.ts +3 -0
  129. package/dist/types/src/cms/client/applications/resources/page/index.d.ts.map +1 -0
  130. package/dist/types/src/cms/client/applications/resources/page/use-page-update-form-data.d.ts +12 -0
  131. package/dist/types/src/cms/client/applications/resources/page/use-page-update-form-data.d.ts.map +1 -0
  132. package/dist/types/src/cms/client/applications/resources/post/use-create-form-data.d.ts +3 -5
  133. package/dist/types/src/cms/client/applications/resources/post/use-create-form-data.d.ts.map +1 -1
  134. package/dist/types/src/cms/client/applications/resources/post/use-update-form-data.d.ts.map +1 -1
  135. package/dist/types/src/cms/client/applications/resources/seo-metadata/build-seo-metadata-translations.d.ts +6 -0
  136. package/dist/types/src/cms/client/applications/resources/seo-metadata/build-seo-metadata-translations.d.ts.map +1 -0
  137. package/dist/types/src/cms/client/applications/resources/seo-metadata/use-upsert-form-data.d.ts +5 -4
  138. package/dist/types/src/cms/client/applications/resources/seo-metadata/use-upsert-form-data.d.ts.map +1 -1
  139. package/dist/types/src/cms/client/applications/types.d.ts +2 -1
  140. package/dist/types/src/cms/client/applications/types.d.ts.map +1 -1
  141. package/dist/types/src/cms/client/applications/ui/use-nav-items.d.ts +3 -4
  142. package/dist/types/src/cms/client/applications/ui/use-nav-items.d.ts.map +1 -1
  143. package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/index.d.ts +86 -0
  144. package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/index.d.ts.map +1 -1
  145. package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/file.d.ts +3 -0
  146. package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/file.d.ts.map +1 -1
  147. package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/index.d.ts +71 -0
  148. package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/index.d.ts.map +1 -1
  149. package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/post.d.ts +51 -0
  150. package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/post.d.ts.map +1 -1
  151. package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/ui/index.d.ts +15 -0
  152. package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/ui/index.d.ts.map +1 -1
  153. package/dist/types/src/cms/client/infrastructure/i18n/messages/index.d.ts +172 -0
  154. package/dist/types/src/cms/client/infrastructure/i18n/messages/index.d.ts.map +1 -1
  155. package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/index.d.ts +86 -0
  156. package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/index.d.ts.map +1 -1
  157. package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/file.d.ts +3 -0
  158. package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/file.d.ts.map +1 -1
  159. package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/index.d.ts +71 -0
  160. package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/index.d.ts.map +1 -1
  161. package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/post.d.ts +51 -0
  162. package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/post.d.ts.map +1 -1
  163. package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/ui/index.d.ts +15 -0
  164. package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/ui/index.d.ts.map +1 -1
  165. package/dist/types/src/cms/client/infrastructure/operation-result/presentation/message.d.ts.map +1 -1
  166. package/dist/types/src/cms/client/interfaces/components/create-components.d.ts +6 -3
  167. package/dist/types/src/cms/client/interfaces/components/create-components.d.ts.map +1 -1
  168. package/dist/types/src/cms/client/interfaces/components/create-page-contents.d.ts +30 -0
  169. package/dist/types/src/cms/client/interfaces/components/create-page-contents.d.ts.map +1 -0
  170. package/dist/types/src/cms/client/interfaces/components/resources/index.d.ts +1 -1
  171. package/dist/types/src/cms/client/interfaces/components/resources/index.d.ts.map +1 -1
  172. package/dist/types/src/cms/client/interfaces/components/resources/page/content/field-groups.d.ts +3 -0
  173. package/dist/types/src/cms/client/interfaces/components/resources/page/content/field-groups.d.ts.map +1 -0
  174. package/dist/types/src/cms/client/interfaces/components/resources/page/content/page-edit-content.d.ts +14 -0
  175. package/dist/types/src/cms/client/interfaces/components/resources/page/content/page-edit-content.d.ts.map +1 -0
  176. package/dist/types/src/cms/client/interfaces/components/resources/page/content/page-show-content.d.ts +7 -0
  177. package/dist/types/src/cms/client/interfaces/components/resources/page/content/page-show-content.d.ts.map +1 -0
  178. package/dist/types/src/cms/client/interfaces/components/resources/page/content/types.d.ts +27 -0
  179. package/dist/types/src/cms/client/interfaces/components/resources/page/content/types.d.ts.map +1 -0
  180. package/dist/types/src/cms/client/interfaces/components/resources/page/index.d.ts +4 -0
  181. package/dist/types/src/cms/client/interfaces/components/resources/page/index.d.ts.map +1 -0
  182. package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-card.d.ts +3 -1
  183. package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-card.d.ts.map +1 -1
  184. package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-table.d.ts +1 -1
  185. package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-table.d.ts.map +1 -1
  186. package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-create-content.d.ts +3 -5
  187. package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-create-content.d.ts.map +1 -1
  188. package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-edit-content.d.ts.map +1 -1
  189. package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-show-content.d.ts.map +1 -1
  190. package/dist/types/src/cms/client/interfaces/components/resources/post/post-card.d.ts +3 -1
  191. package/dist/types/src/cms/client/interfaces/components/resources/post/post-card.d.ts.map +1 -1
  192. package/dist/types/src/cms/client/interfaces/components/resources/post/post-list.d.ts +6 -3
  193. package/dist/types/src/cms/client/interfaces/components/resources/post/post-list.d.ts.map +1 -1
  194. package/dist/types/src/cms/client/interfaces/components/resources/post/post-state-icons.d.ts.map +1 -1
  195. package/dist/types/src/cms/client/interfaces/components/resources/post/post-table.d.ts +3 -1
  196. package/dist/types/src/cms/client/interfaces/components/resources/post/post-table.d.ts.map +1 -1
  197. package/dist/types/src/cms/client/interfaces/components/resources/post/search/control-fields-filters.d.ts.map +1 -1
  198. package/dist/types/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.d.ts +5 -2
  199. package/dist/types/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.d.ts.map +1 -1
  200. package/dist/types/src/cms/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.d.ts +2 -1
  201. package/dist/types/src/cms/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.d.ts.map +1 -1
  202. package/dist/types/src/cms/client/interfaces/components/ui/blocks/list-container/list-container.d.ts.map +1 -1
  203. package/dist/types/src/cms/client/interfaces/components/ui/features/accordion/accordion-header.d.ts +3 -1
  204. package/dist/types/src/cms/client/interfaces/components/ui/features/accordion/accordion-header.d.ts.map +1 -1
  205. package/dist/types/src/cms/client/interfaces/components/ui/features/accordion/accordion.d.ts +2 -1
  206. package/dist/types/src/cms/client/interfaces/components/ui/features/accordion/accordion.d.ts.map +1 -1
  207. package/dist/types/src/cms/client/interfaces/components/ui/form/control-fields/control-fields-display.d.ts.map +1 -1
  208. package/dist/types/src/cms/client/interfaces/components/ui/form/control-fields/control-fields-input.d.ts.map +1 -1
  209. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/edit/page.d.ts +1 -1
  210. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/edit/page.d.ts.map +1 -1
  211. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/page.d.ts +3 -1
  212. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/page.d.ts.map +1 -1
  213. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/relations/page.d.ts +3 -1
  214. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/relations/page.d.ts.map +1 -1
  215. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/create/page.d.ts +4 -7
  216. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/create/page.d.ts.map +1 -1
  217. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/page.d.ts +1 -4
  218. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/page.d.ts.map +1 -1
  219. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/edit/page.d.ts.map +1 -1
  220. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/page.d.ts.map +1 -1
  221. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/relations/page.d.ts.map +1 -1
  222. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/create/page.d.ts +4 -7
  223. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/create/page.d.ts.map +1 -1
  224. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/edit/page.d.ts +1 -1
  225. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/edit/page.d.ts.map +1 -1
  226. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/page.d.ts +3 -1
  227. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/page.d.ts.map +1 -1
  228. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/relations/page.d.ts.map +1 -1
  229. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/create/page.d.ts +4 -7
  230. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/create/page.d.ts.map +1 -1
  231. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/page.d.ts +1 -3
  232. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/page.d.ts.map +1 -1
  233. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/[id]/page.d.ts.map +1 -1
  234. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/[id]/relations/page.d.ts +3 -1
  235. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/[id]/relations/page.d.ts.map +1 -1
  236. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/index.d.ts +2 -0
  237. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/index.d.ts.map +1 -0
  238. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/page.d.ts +18 -0
  239. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/page.d.ts.map +1 -0
  240. package/dist/types/src/cms/client/interfaces/pages/dashboard/system/access/admin/[id]/relations/page.d.ts +3 -1
  241. package/dist/types/src/cms/client/interfaces/pages/dashboard/system/access/admin/[id]/relations/page.d.ts.map +1 -1
  242. package/dist/types/src/cms/client/interfaces/pages/dashboard/system/storage/file/[id]/relations/page.d.ts +5 -6
  243. package/dist/types/src/cms/client/interfaces/pages/dashboard/system/storage/file/[id]/relations/page.d.ts.map +1 -1
  244. package/dist/types/src/cms/client/interfaces/pages/dashboard/system/storage/trash/page.d.ts.map +1 -1
  245. package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/[slug]/edit/page.d.ts +7 -9
  246. package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/[slug]/edit/page.d.ts.map +1 -1
  247. package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/[slug]/page.d.ts +7 -9
  248. package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/[slug]/page.d.ts.map +1 -1
  249. package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/page.d.ts +3 -3
  250. package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/page.d.ts.map +1 -1
  251. package/dist/types/src/cms/client/interfaces/pages/index.d.ts +1 -1
  252. package/dist/types/src/cms/client/interfaces/pages/index.d.ts.map +1 -1
  253. package/dist/types/src/cms/contracts/resources/page/actions.d.ts +7 -0
  254. package/dist/types/src/cms/contracts/resources/page/actions.d.ts.map +1 -0
  255. package/dist/types/src/cms/contracts/resources/post/actions.d.ts +2 -0
  256. package/dist/types/src/cms/contracts/resources/post/actions.d.ts.map +1 -1
  257. package/dist/types/src/cms/contracts/resources/post/form-data.d.ts +1 -1
  258. package/dist/types/src/cms/contracts/resources/post/form-data.d.ts.map +1 -1
  259. package/dist/types/src/cms/contracts/resources/seo-metadata/form-data.d.ts +2 -2
  260. package/dist/types/src/cms/contracts/resources/seo-metadata/form-data.d.ts.map +1 -1
  261. package/dist/types/src/cms/server/create-cms-server.d.ts +7 -0
  262. package/dist/types/src/cms/server/create-cms-server.d.ts.map +1 -1
  263. package/dist/types/src/cms/server/index.d.ts +1 -1
  264. package/dist/types/src/cms/server/index.d.ts.map +1 -1
  265. package/dist/types/src/cms/server/resources/index.d.ts +1 -0
  266. package/dist/types/src/cms/server/resources/index.d.ts.map +1 -1
  267. package/dist/types/src/cms/server/resources/page/actions.d.ts +8 -0
  268. package/dist/types/src/cms/server/resources/page/actions.d.ts.map +1 -0
  269. package/dist/types/src/cms/server/resources/post/actions.d.ts +2 -0
  270. package/dist/types/src/cms/server/resources/post/actions.d.ts.map +1 -1
  271. package/dist/types/src/cms/server/resources/seo-metadata/actions.d.ts.map +1 -1
  272. package/dist/types/src/config/content-ui.d.ts +14 -0
  273. package/dist/types/src/config/content-ui.d.ts.map +1 -0
  274. package/dist/types/src/config/index.d.ts +2 -0
  275. package/dist/types/src/config/index.d.ts.map +1 -1
  276. package/dist/types/src/config/page.d.ts +4 -0
  277. package/dist/types/src/config/page.d.ts.map +1 -0
  278. package/dist/types/src/config/topics.d.ts +2 -2
  279. package/dist/types/src/config/topics.d.ts.map +1 -1
  280. package/dist/types/src/constants/paths/cms-paths.d.ts +3 -3
  281. package/dist/types/src/core/infrastructure/index.d.ts +1 -0
  282. package/dist/types/src/core/infrastructure/index.d.ts.map +1 -1
  283. package/dist/types/src/core/infrastructure/prisma/file/include.d.ts +121 -0
  284. package/dist/types/src/core/infrastructure/prisma/file/include.d.ts.map +1 -1
  285. package/dist/types/src/core/infrastructure/prisma/file/mappers.d.ts.map +1 -1
  286. package/dist/types/src/core/infrastructure/prisma/helpers/active-file-references.d.ts +1 -1
  287. package/dist/types/src/core/infrastructure/prisma/helpers/active-file-references.d.ts.map +1 -1
  288. package/dist/types/src/core/infrastructure/prisma/index.d.ts +1 -0
  289. package/dist/types/src/core/infrastructure/prisma/index.d.ts.map +1 -1
  290. package/dist/types/src/core/infrastructure/prisma/page/include.d.ts +63 -0
  291. package/dist/types/src/core/infrastructure/prisma/page/include.d.ts.map +1 -0
  292. package/dist/types/src/core/infrastructure/prisma/page/index.d.ts +4 -0
  293. package/dist/types/src/core/infrastructure/prisma/page/index.d.ts.map +1 -0
  294. package/dist/types/src/core/infrastructure/prisma/page/mappers.d.ts +9 -0
  295. package/dist/types/src/core/infrastructure/prisma/page/mappers.d.ts.map +1 -0
  296. package/dist/types/src/core/infrastructure/prisma/page/page-prisma-ports.d.ts +7 -0
  297. package/dist/types/src/core/infrastructure/prisma/page/page-prisma-ports.d.ts.map +1 -0
  298. package/dist/types/src/core/infrastructure/prisma/page/types.d.ts +10 -0
  299. package/dist/types/src/core/infrastructure/prisma/page/types.d.ts.map +1 -0
  300. package/dist/types/src/core/infrastructure/prisma/post/include.d.ts +0 -29
  301. package/dist/types/src/core/infrastructure/prisma/post/include.d.ts.map +1 -1
  302. package/dist/types/src/core/infrastructure/prisma/post/lifecycle.d.ts +66 -0
  303. package/dist/types/src/core/infrastructure/prisma/post/lifecycle.d.ts.map +1 -0
  304. package/dist/types/src/core/infrastructure/prisma/post/mappers.d.ts.map +1 -1
  305. package/dist/types/src/core/infrastructure/prisma/post/post-prisma-ports.d.ts.map +1 -1
  306. package/dist/types/src/core/infrastructure/prisma/post/read-scope.d.ts +271 -0
  307. package/dist/types/src/core/infrastructure/prisma/post/read-scope.d.ts.map +1 -0
  308. package/dist/types/src/core/infrastructure/prisma/seo-metadata/mappers.d.ts +1 -1
  309. package/dist/types/src/core/infrastructure/prisma/seo-metadata/mappers.d.ts.map +1 -1
  310. package/dist/types/src/core/infrastructure/prisma/seo-metadata/seo-metadata-prisma-ports.d.ts +2 -2
  311. package/dist/types/src/core/infrastructure/prisma/seo-metadata/seo-metadata-prisma-ports.d.ts.map +1 -1
  312. package/dist/types/src/core/seeders/page/seeder.d.ts +3 -3
  313. package/dist/types/src/core/seeders/page/seeder.d.ts.map +1 -1
  314. package/dist/types/src/core/seeders/seed.d.ts +2 -3
  315. package/dist/types/src/core/seeders/seed.d.ts.map +1 -1
  316. package/dist/types/src/core/sitero-server/create-sitero-server.d.ts.map +1 -1
  317. package/dist/types/src/core/sitero-server/types.d.ts +2 -0
  318. package/dist/types/src/core/sitero-server/types.d.ts.map +1 -1
  319. package/dist/types/src/shared/list-item.d.ts +1 -0
  320. package/dist/types/src/shared/list-item.d.ts.map +1 -1
  321. package/dist/types/src/web/contracts/index.d.ts +1 -0
  322. package/dist/types/src/web/contracts/index.d.ts.map +1 -1
  323. package/dist/types/src/web/contracts/resources/page/actions.d.ts +5 -0
  324. package/dist/types/src/web/contracts/resources/page/actions.d.ts.map +1 -0
  325. package/dist/types/src/web/contracts/resources/post/actions.d.ts +1 -1
  326. package/dist/types/src/web/contracts/resources/post/actions.d.ts.map +1 -1
  327. package/dist/types/src/web/server/create-web-server.d.ts.map +1 -1
  328. package/dist/types/src/web/server/index.d.ts +1 -1
  329. package/dist/types/src/web/server/index.d.ts.map +1 -1
  330. package/dist/types/src/web/server/resources/index.d.ts +1 -0
  331. package/dist/types/src/web/server/resources/index.d.ts.map +1 -1
  332. package/dist/types/src/web/server/resources/page/actions.d.ts +17 -0
  333. package/dist/types/src/web/server/resources/page/actions.d.ts.map +1 -0
  334. package/dist/types/src/web/server/resources/post/actions.d.ts +1 -6
  335. package/dist/types/src/web/server/resources/post/actions.d.ts.map +1 -1
  336. package/dist/types/src/web/server/seo/metadata/build-metadata.d.ts +5 -2
  337. package/dist/types/src/web/server/seo/metadata/build-metadata.d.ts.map +1 -1
  338. package/dist/types/src/web/server/seo/sitemap/build-entries.d.ts +2 -2
  339. package/dist/types/src/web/server/seo/sitemap/build-entries.d.ts.map +1 -1
  340. package/dist/types/src/web/server/seo/sitemap/get-page-items.d.ts +6 -2
  341. package/dist/types/src/web/server/seo/sitemap/get-page-items.d.ts.map +1 -1
  342. package/dist/types/src/web/server/seo/sitemap/get-post-items.d.ts.map +1 -1
  343. package/dist/types/src/web/server/seo/sitemap/get-subcategory-items.d.ts.map +1 -1
  344. package/dist/types/src/web/server/types.d.ts +6 -2
  345. package/dist/types/src/web/server/types.d.ts.map +1 -1
  346. package/package.json +3 -3
  347. package/dist/src/cms/client/interfaces/components/resources/post/topic/topic-card.js +0 -81
  348. package/dist/src/cms/client/interfaces/components/resources/post/topic/topic-table.js +0 -120
  349. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/_id_/edit/page.js +0 -110
  350. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/_id_/page.js +0 -161
  351. package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/page.js +0 -103
  352. package/dist/src/core/seeders/topic/seeder.js +0 -47
  353. package/dist/types/src/cms/client/interfaces/components/resources/post/topic/index.d.ts +0 -3
  354. package/dist/types/src/cms/client/interfaces/components/resources/post/topic/index.d.ts.map +0 -1
  355. package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-card.d.ts +0 -5
  356. package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-card.d.ts.map +0 -1
  357. package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-table.d.ts +0 -3
  358. package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-table.d.ts.map +0 -1
  359. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/edit/page.d.ts +0 -20
  360. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/edit/page.d.ts.map +0 -1
  361. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/page.d.ts +0 -20
  362. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/page.d.ts.map +0 -1
  363. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/index.d.ts +0 -4
  364. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/index.d.ts.map +0 -1
  365. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/page.d.ts +0 -14
  366. package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/page.d.ts.map +0 -1
  367. package/dist/types/src/core/seeders/topic/seeder.d.ts +0 -10
  368. package/dist/types/src/core/seeders/topic/seeder.d.ts.map +0 -1
@@ -12,7 +12,6 @@ import '../../../../../../../../../../../shared/client/react-query/client.js';
12
12
  import '@tanstack/react-query';
13
13
  import { useCmsQuery } from '../../../../../../../../../infrastructure/operation-result/use-cms-query.js';
14
14
  import 'mime-types';
15
- import { findTranslation } from '../../../../../../../../../../../shared/translation/find-translation.js';
16
15
  import 'clsx';
17
16
  import 'tailwind-merge';
18
17
  import { ensureArray } from '../../../../../../../../../../../shared/utils/ensure-array.js';
@@ -44,6 +43,7 @@ import '../../../../../../../../components/ui/inputs/switch-input.js';
44
43
  import '../../../../../../../../components/ui/inputs/password-input.js';
45
44
 
46
45
  function createCategoryEditPage({
46
+ topics: staticTopics,
47
47
  postFindDetailAction,
48
48
  postFindManyAction,
49
49
  renderPostEditContent,
@@ -56,11 +56,7 @@ function createCategoryEditPage({
56
56
  const allowFieldInTopic = (params) => allowField?.({ ...params, topicSlug: params.topicSlug ?? topicSlug }) ?? false;
57
57
  const categoryType = POST_TYPES.CATEGORY;
58
58
  const subcategoryType = POST_TYPES.SUBCATEGORY;
59
- const { data: topic, isFetching: isFetchingTopic } = useCmsQuery(
60
- () => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
61
- ["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
62
- { select: (data) => data?.post }
63
- );
59
+ const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
64
60
  const {
65
61
  data: category,
66
62
  isFetching,
@@ -73,8 +69,12 @@ function createCategoryEditPage({
73
69
  }
74
70
  );
75
71
  const { data: categories, isFetching: isFetchingControlMeta } = useCmsQuery(
76
- () => postFindManyAction({ type: categoryType, topicId: topic?.id }),
77
- ["postFindManyAction", categoryType, topic?.id],
72
+ () => postFindManyAction({
73
+ type: categoryType,
74
+ topicKey: topic?.key,
75
+ deletion: "all"
76
+ }),
77
+ ["postFindManyAction", categoryType, topic?.key, "all"],
78
78
  { select: (data) => data?.posts, enabled: !!topic }
79
79
  );
80
80
  const controlMeta = getControlMeta({
@@ -90,7 +90,7 @@ function createCategoryEditPage({
90
90
  titleProps: {
91
91
  icon: Notebook,
92
92
  title: t("resources.category.text"),
93
- leftChildren: /* @__PURE__ */ jsx(Badge, { isLoading: isFetchingTopic, children: findTranslation(topic?.translations, locale)?.title })
93
+ leftChildren: /* @__PURE__ */ jsx(Badge, { children: topic?.title[locale] })
94
94
  }
95
95
  }
96
96
  ),
@@ -100,7 +100,7 @@ function createCategoryEditPage({
100
100
  post: category,
101
101
  postType: categoryType,
102
102
  controlMeta,
103
- isFetching: isFetchingTopic || isFetching || isFetchingControlMeta,
103
+ isFetching: isFetching || isFetchingControlMeta,
104
104
  isNotFound,
105
105
  allowField: allowFieldInTopic
106
106
  }
@@ -110,7 +110,7 @@ function createCategoryEditPage({
110
110
  categoryType,
111
111
  subcategoryType,
112
112
  controlMeta,
113
- isFetching: isFetchingTopic || isFetching || isFetchingControlMeta,
113
+ isFetching: isFetching || isFetchingControlMeta,
114
114
  isNotFound
115
115
  })
116
116
  ] });
@@ -5,18 +5,16 @@ import { Notebook, SquareArrowOutUpRight, Pen, Trash2, Lock } from 'lucide-react
5
5
  import { useParams, useRouter } from 'next/navigation';
6
6
  import { POST_TYPES } from 'sitero-domain';
7
7
  import 'zod';
8
- import 'sonner';
9
- import 'react';
10
- import 'ua-parser-js';
11
- import '../../../../../../../../../../shared/client/react-query/client.js';
12
- import '@tanstack/react-query';
13
- import { useCommand } from '../../../../../../../../../../shared/client/react-query/use-command.js';
8
+ import { useCmsCommand } from '../../../../../../../../infrastructure/operation-result/use-cms-command.js';
14
9
  import { useCmsQuery } from '../../../../../../../../infrastructure/operation-result/use-cms-query.js';
15
10
  import { CMS_PATHS } from '../../../../../../../../../../constants/paths/cms-paths.js';
16
11
  import '../../../../../../../../../../constants/paths/redirect.js';
17
12
  import '../../../../../../../../../../constants/cms-locale.js';
18
13
  import 'mime-types';
19
- import { findTranslation } from '../../../../../../../../../../shared/translation/find-translation.js';
14
+ import 'react';
15
+ import 'ua-parser-js';
16
+ import '../../../../../../../../../../shared/client/react-query/client.js';
17
+ import '@tanstack/react-query';
20
18
  import 'clsx';
21
19
  import 'tailwind-merge';
22
20
  import { joinUrl } from '../../../../../../../../../../shared/utils/join-url.js';
@@ -34,6 +32,7 @@ import '@radix-ui/react-select';
34
32
  import '@radix-ui/react-separator';
35
33
  import '../../../../../../../components/shadcn/sidebar/sidebar.js';
36
34
  import 'next-themes';
35
+ import 'sonner';
37
36
  import '@radix-ui/react-tabs';
38
37
  import '@radix-ui/react-tooltip';
39
38
  import { Badge } from '../../../../../../../components/ui/display/badge.js';
@@ -54,6 +53,7 @@ import 'intor/next';
54
53
  function createCategoryShowPage({
55
54
  enableSeoMetadata,
56
55
  externalHref,
56
+ topics: staticTopics,
57
57
  postFindDetailAction,
58
58
  postDeleteAction,
59
59
  SeoMetadataDialog,
@@ -66,11 +66,7 @@ function createCategoryShowPage({
66
66
  const { id, topicSlug } = useParams();
67
67
  const router = useRouter();
68
68
  const postType = POST_TYPES.POST;
69
- const { data: topic, isFetching: isFetchingTopic } = useCmsQuery(
70
- () => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
71
- ["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
72
- { select: (data) => data?.post }
73
- );
69
+ const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug]} : void 0;
74
70
  const {
75
71
  data: category,
76
72
  isFetching,
@@ -82,7 +78,7 @@ function createCategoryShowPage({
82
78
  select: (data) => data?.post
83
79
  }
84
80
  );
85
- const { execute, isRedirecting } = useCommand(
81
+ const { execute, isRedirecting } = useCmsCommand(
86
82
  () => postDeleteAction({ id }),
87
83
  {
88
84
  onSuccess: () => router.replace(
@@ -110,7 +106,7 @@ function createCategoryShowPage({
110
106
  titleProps: {
111
107
  icon: Notebook,
112
108
  title: t("resources.category.text"),
113
- leftChildren: /* @__PURE__ */ jsx(Badge, { isLoading: isFetchingTopic, children: findTranslation(topic?.translations, locale)?.title }),
109
+ leftChildren: /* @__PURE__ */ jsx(Badge, { children: topic?.title[locale] }),
114
110
  rightChildren: category?.isLocked && /* @__PURE__ */ jsx(
115
111
  Lock,
116
112
  {
@@ -144,12 +140,12 @@ function createCategoryShowPage({
144
140
  variant: "destructive",
145
141
  icon: Trash2,
146
142
  onClick: () => {
147
- if (!confirm(t("ui.dialog.confirm.text"))) return;
143
+ if (!confirm(t("ui.dialog.move-to-trash.text"))) return;
148
144
  void execute();
149
145
  },
150
146
  isLoading: isRedirecting,
151
147
  isDisabled: isFetching || category?.isLocked,
152
- children: t("ui.destroy.text")
148
+ children: t("ui.move-to-trash.text")
153
149
  }
154
150
  )
155
151
  ] }),
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from 'react/jsx-runtime';
3
3
  import { useTranslator } from 'intor/react';
4
+ import { useParams } from 'next/navigation';
4
5
  import { useState } from 'react';
5
6
  import { POST_TYPES } from 'sitero-domain';
6
7
  import 'lucide-react';
@@ -29,7 +30,6 @@ import 'next-themes';
29
30
  import 'sonner';
30
31
  import '@radix-ui/react-tabs';
31
32
  import '@radix-ui/react-tooltip';
32
- import 'next/navigation';
33
33
  import '../../../../../../../../components/ui/inputs/input.js';
34
34
  import '../../../../../../../../components/ui/inputs/textarea.js';
35
35
  import '../../../../../../../../components/ui/inputs/switch-input.js';
@@ -43,6 +43,7 @@ import 'zod';
43
43
  import 'intor/next';
44
44
 
45
45
  function createCategoryRelationsPage({
46
+ contentUi,
46
47
  postFindRelationsAction,
47
48
  PostList,
48
49
  CategoryCard,
@@ -52,18 +53,20 @@ function createCategoryRelationsPage({
52
53
  postFindRelationsAction
53
54
  });
54
55
  return function CategoryRelationsPage() {
56
+ const { topicSlug } = useParams();
55
57
  const { t } = useTranslator();
56
58
  const [subcategoryStates, setSubcategoryStates] = useState({});
57
59
  const [postStates, setPostStates] = useState(
58
60
  {}
59
61
  );
60
62
  return /* @__PURE__ */ jsx(PostRelationsLayout, { children: (relations) => /* @__PURE__ */ jsxs(AccordionContainer, { children: [
61
- /* @__PURE__ */ jsx(
63
+ (contentUi ? contentUi.byTopic[topicSlug]?.hasSubcategory ?? false : true) && /* @__PURE__ */ jsx(
62
64
  Accordion,
63
65
  {
64
66
  hasBorder: true,
65
67
  deps: [subcategoryStates.isFetching],
66
68
  accordionHeaderProps: {
69
+ showCount: true,
67
70
  count: subcategoryStates.count,
68
71
  children: t("resources.subcategory.text")
69
72
  },
@@ -87,6 +90,7 @@ function createCategoryRelationsPage({
87
90
  hasBorder: true,
88
91
  deps: [postStates.isFetching],
89
92
  accordionHeaderProps: {
93
+ showCount: true,
90
94
  count: postStates.count,
91
95
  children: t("resources.post.text")
92
96
  },
@@ -14,7 +14,6 @@ import { CMS_PATHS } from '../../../../../../../../../../constants/paths/cms-pat
14
14
  import '../../../../../../../../../../constants/paths/redirect.js';
15
15
  import '../../../../../../../../../../constants/cms-locale.js';
16
16
  import 'mime-types';
17
- import { findTranslation } from '../../../../../../../../../../shared/translation/find-translation.js';
18
17
  import 'clsx';
19
18
  import 'tailwind-merge';
20
19
  import { ensureArray } from '../../../../../../../../../../shared/utils/ensure-array.js';
@@ -46,7 +45,7 @@ import '../../../../../../../components/ui/inputs/switch-input.js';
46
45
  import '../../../../../../../components/ui/inputs/password-input.js';
47
46
 
48
47
  function createCategoryCreatePage({
49
- postFindDetailAction,
48
+ topics: staticTopics,
50
49
  postFindManyAction,
51
50
  renderPostCreateContent,
52
51
  PostCreateContent,
@@ -62,14 +61,14 @@ function createCategoryCreatePage({
62
61
  CMS_PATHS.content["content-management"].pathname,
63
62
  topicSlug
64
63
  );
65
- const { data: topic, isFetching: isFetchingTopic } = useCmsQuery(
66
- () => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
67
- ["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
68
- { select: (data) => data?.post }
69
- );
64
+ const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
70
65
  const { data: categories, isFetching: isFetchingControlMeta } = useCmsQuery(
71
- () => postFindManyAction({ type: categoryType, topicId: topic?.id }),
72
- ["postFindManyAction", categoryType, topic?.id],
66
+ () => postFindManyAction({
67
+ type: categoryType,
68
+ topicKey: topic?.key,
69
+ deletion: "all"
70
+ }),
71
+ ["postFindManyAction", categoryType, topic?.key, "all"],
73
72
  { select: (data) => data?.posts, enabled: !!topic }
74
73
  );
75
74
  const controlMeta = getControlMeta({ records: ensureArray(categories) });
@@ -80,27 +79,27 @@ function createCategoryCreatePage({
80
79
  navigation: /* @__PURE__ */ jsx(ReturnButton, { useConfirm: true, href: returnHref }),
81
80
  titleProps: {
82
81
  title: t("resources.category.text"),
83
- leftChildren: /* @__PURE__ */ jsx(Badge, { isLoading: isFetchingTopic, children: findTranslation(topic?.translations, locale)?.title })
82
+ leftChildren: /* @__PURE__ */ jsx(Badge, { children: topic?.title[locale] })
84
83
  }
85
84
  }
86
85
  ),
87
- PostCreateContent && allowField && /* @__PURE__ */ jsx(
86
+ topic && PostCreateContent && allowField && /* @__PURE__ */ jsx(
88
87
  PostCreateContent,
89
88
  {
90
- topic,
89
+ topicKey: topic?.key,
91
90
  postType: categoryType,
92
91
  controlMeta,
93
- isFetching: isFetchingTopic || isFetchingControlMeta,
92
+ isFetching: isFetchingControlMeta,
94
93
  allowField: allowFieldInTopic,
95
94
  cancelButtonHref: returnHref
96
95
  }
97
96
  ),
98
- renderPostCreateContent?.({
99
- topic,
97
+ topic && renderPostCreateContent?.({
98
+ topicKey: topic?.key,
100
99
  categoryType,
101
100
  subcategoryType,
102
101
  controlMeta,
103
- isFetching: isFetchingTopic || isFetchingControlMeta,
102
+ isFetching: isFetchingControlMeta,
104
103
  cancelButtonHref: returnHref
105
104
  })
106
105
  ] });
@@ -1,23 +1,19 @@
1
1
  "use client";
2
2
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
3
  import { useTranslator } from 'intor/react';
4
- import { SquareLibrary, SquareArrowOutUpRight, Pen, Plus, File, Notebook } from 'lucide-react';
4
+ import { SquareLibrary, SquareArrowOutUpRight, Plus, File, Notebook } from 'lucide-react';
5
5
  import { useParams } from 'next/navigation';
6
6
  import { useState } from 'react';
7
7
  import { POST_TYPES } from 'sitero-domain';
8
- import 'zod';
9
- import 'sonner';
10
- import 'ua-parser-js';
11
- import '../../../../../../../../shared/client/react-query/client.js';
12
- import '@tanstack/react-query';
13
- import { useCmsQuery } from '../../../../../../infrastructure/operation-result/use-cms-query.js';
14
8
  import { isContentTopic, hasTopicRole } from '../../../../../../../../config/topics.js';
15
9
  import { POST_CUSTOM_STATE_FIELDS } from '../../../../../../../../config/post.js';
16
10
  import { CMS_PATHS } from '../../../../../../../../constants/paths/cms-paths.js';
17
11
  import '../../../../../../../../constants/paths/redirect.js';
18
12
  import '../../../../../../../../constants/cms-locale.js';
19
13
  import 'mime-types';
20
- import { findTranslation } from '../../../../../../../../shared/translation/find-translation.js';
14
+ import 'ua-parser-js';
15
+ import '../../../../../../../../shared/client/react-query/client.js';
16
+ import '@tanstack/react-query';
21
17
  import 'clsx';
22
18
  import 'tailwind-merge';
23
19
  import { joinUrl } from '../../../../../../../../shared/utils/join-url.js';
@@ -36,7 +32,7 @@ import '@radix-ui/react-select';
36
32
  import '@radix-ui/react-separator';
37
33
  import '../../../../../components/shadcn/sidebar/sidebar.js';
38
34
  import 'next-themes';
39
- import { Spinner } from '../../../../../components/shadcn/spinner.js';
35
+ import 'sonner';
40
36
  import '@radix-ui/react-tabs';
41
37
  import '@radix-ui/react-tooltip';
42
38
  import { LinkButton } from '../../../../../components/ui/buttons/link-button.js';
@@ -52,13 +48,12 @@ import { Accordion } from '../../../../../components/ui/features/accordion/accor
52
48
  import 'next/image';
53
49
  import '../../../../../../infrastructure/admin-session/admin-context.js';
54
50
  import 'intor/next';
51
+ import 'zod';
55
52
  import { ContentContainer } from '../../../../../components/ui/layouts/content-container.js';
56
53
 
57
54
  function createTopicScopePage({
58
- enableTopic,
59
55
  topics: staticTopics,
60
56
  externalHref,
61
- postFindDetailAction,
62
57
  CategoryCard,
63
58
  PostList: PostListBase,
64
59
  allowField
@@ -79,16 +74,8 @@ function createTopicScopePage({
79
74
  topicSlug,
80
75
  POST_TYPES.SUBCATEGORY
81
76
  );
82
- const {
83
- data: topic,
84
- isFetching,
85
- isNotFound
86
- } = useCmsQuery(
87
- () => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
88
- ["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
89
- { select: (data) => data?.post }
90
- );
91
- const topicT = findTranslation(topic?.translations, locale);
77
+ const topic = Object.hasOwn(staticTopics, topicSlug) ? staticTopics[topicSlug] : void 0;
78
+ const topicT = { title: topic?.title[locale] ?? "" };
92
79
  const [categoryStates, setCategoryStates] = useState({});
93
80
  const [subcategoryStates, setSubcategoryStates] = useState({});
94
81
  const [postStates, setPostStates] = useState(
@@ -107,7 +94,7 @@ function createTopicScopePage({
107
94
  {
108
95
  usableFields: getUsableFields(POST_TYPES.POST),
109
96
  type: POST_TYPES.POST,
110
- topicId: topic?.id ?? DO_NOT_FETCH_KEY,
97
+ topicKey: topic ? topicSlug : DO_NOT_FETCH_KEY,
111
98
  setListItemStates: setPostStates,
112
99
  localKey: `post-${POST_TYPES.POST}`
113
100
  }
@@ -120,22 +107,9 @@ function createTopicScopePage({
120
107
  navigation: /* @__PURE__ */ jsx(ReturnButton, { pushToParent: true }),
121
108
  titleProps: {
122
109
  icon: SquareLibrary,
123
- title: !isFetching ? topicT.title : /* @__PURE__ */ jsx(Spinner, {})
110
+ title: topicT.title
124
111
  },
125
112
  actions: /* @__PURE__ */ jsxs(Fragment, { children: [
126
- enableTopic && /* @__PURE__ */ jsx(
127
- LinkButton,
128
- {
129
- variant: "outline",
130
- icon: Pen,
131
- href: joinUrl(
132
- CMS_PATHS.content["content-management"].topic.pathname,
133
- topic?.id
134
- ),
135
- isDisabled: isFetching || isNotFound || !isContentTopicScope,
136
- children: t("ui.setting.text")
137
- }
138
- ),
139
113
  hasCategory && /* @__PURE__ */ jsx(
140
114
  LinkButton,
141
115
  {
@@ -147,7 +121,7 @@ function createTopicScopePage({
147
121
  ),
148
122
  "create"
149
123
  ),
150
- isDisabled: isFetching || isNotFound || !isContentTopicScope,
124
+ isDisabled: !topic || !isContentTopicScope,
151
125
  children: t("ui.create-resource.text", {
152
126
  resource: t("resources.category.text")
153
127
  })
@@ -162,7 +136,7 @@ function createTopicScopePage({
162
136
  CMS_PATHS.content["content-management"].subcategory.pathname(topicSlug),
163
137
  "create"
164
138
  ),
165
- isDisabled: isFetching || isNotFound || !isContentTopicScope,
139
+ isDisabled: !topic || !isContentTopicScope,
166
140
  children: t("ui.create-resource.text", {
167
141
  resource: t("resources.subcategory.text")
168
142
  })
@@ -179,7 +153,7 @@ function createTopicScopePage({
179
153
  ),
180
154
  "create"
181
155
  ),
182
- isDisabled: isFetching || isNotFound || !isContentTopicScope,
156
+ isDisabled: !topic || !isContentTopicScope,
183
157
  children: t("ui.create-resource.text", {
184
158
  resource: t("resources.post.text")
185
159
  })
@@ -203,6 +177,7 @@ function createTopicScopePage({
203
177
  Accordion,
204
178
  {
205
179
  accordionHeaderProps: {
180
+ showCount: true,
206
181
  count: categoryStates.count,
207
182
  children: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
208
183
  /* @__PURE__ */ jsx(Notebook, { className: "size-4" }),
@@ -217,7 +192,7 @@ function createTopicScopePage({
217
192
  {
218
193
  usableFields: getUsableFields(POST_TYPES.CATEGORY),
219
194
  type: POST_TYPES.CATEGORY,
220
- topicId: topic?.id ?? DO_NOT_FETCH_KEY,
195
+ topicKey: topic ? topicSlug : DO_NOT_FETCH_KEY,
221
196
  setListItemStates: setCategoryStates,
222
197
  Card: (props) => /* @__PURE__ */ jsx(CategoryCard, { ...props }),
223
198
  Table: (props) => /* @__PURE__ */ jsx(CategoryTable, { ...props }),
@@ -230,6 +205,7 @@ function createTopicScopePage({
230
205
  Accordion,
231
206
  {
232
207
  accordionHeaderProps: {
208
+ showCount: true,
233
209
  count: subcategoryStates.count,
234
210
  children: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
235
211
  /* @__PURE__ */ jsx(Notebook, { className: "size-4" }),
@@ -244,7 +220,7 @@ function createTopicScopePage({
244
220
  {
245
221
  usableFields: getUsableFields(POST_TYPES.SUBCATEGORY),
246
222
  type: POST_TYPES.SUBCATEGORY,
247
- topicId: topic?.id ?? DO_NOT_FETCH_KEY,
223
+ topicKey: topic ? topicSlug : DO_NOT_FETCH_KEY,
248
224
  setListItemStates: setSubcategoryStates,
249
225
  Card: (props) => /* @__PURE__ */ jsx(CategoryCard, { ...props, isSubcategory: true }),
250
226
  Table: (props) => /* @__PURE__ */ jsx(CategoryTable, { ...props, isSubcategory: true }),
@@ -257,6 +233,7 @@ function createTopicScopePage({
257
233
  Accordion,
258
234
  {
259
235
  accordionHeaderProps: {
236
+ showCount: true,
260
237
  count: postStates.count,
261
238
  children: /* @__PURE__ */ jsxs("span", { className: "flex-center gap-2", children: [
262
239
  /* @__PURE__ */ jsx(File, { className: "size-4" }),
@@ -14,7 +14,6 @@ import { CMS_PATHS } from '../../../../../../../../../../../constants/paths/cms-
14
14
  import '../../../../../../../../../../../constants/paths/redirect.js';
15
15
  import '../../../../../../../../../../../constants/cms-locale.js';
16
16
  import 'mime-types';
17
- import { findTranslation } from '../../../../../../../../../../../shared/translation/find-translation.js';
18
17
  import 'clsx';
19
18
  import 'tailwind-merge';
20
19
  import { ensureArray } from '../../../../../../../../../../../shared/utils/ensure-array.js';
@@ -64,11 +63,7 @@ function createPostEditPage({
64
63
  const hasSubcategory = roles.includes(POST_TYPES.SUBCATEGORY);
65
64
  const categoryType = POST_TYPES.CATEGORY;
66
65
  const subcategoryType = POST_TYPES.SUBCATEGORY;
67
- const { data: topic, isFetching: isFetchingTopic } = useCmsQuery(
68
- () => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
69
- ["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
70
- { select: (data) => data?.post }
71
- );
66
+ const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
72
67
  const {
73
68
  data: post,
74
69
  isFetching,
@@ -81,8 +76,12 @@ function createPostEditPage({
81
76
  }
82
77
  );
83
78
  const { data: posts, isFetching: isFetchingControlMeta } = useCmsQuery(
84
- () => postFindManyAction({ type: postType, topicId: topic?.id }),
85
- ["postFindManyAction", postType, topic?.id],
79
+ () => postFindManyAction({
80
+ type: postType,
81
+ topicKey: topic?.key,
82
+ deletion: "all"
83
+ }),
84
+ ["postFindManyAction", postType, topic?.key, "all"],
86
85
  { select: (data) => data?.posts, enabled: !!topic }
87
86
  );
88
87
  const controlMeta = getControlMeta({
@@ -108,7 +107,7 @@ function createPostEditPage({
108
107
  ),
109
108
  titleProps: {
110
109
  title: t("resources.post.text"),
111
- leftChildren: /* @__PURE__ */ jsx(Badge, { isLoading: isFetching, children: findTranslation(topic?.translations, defaultWebLocale)?.title })
110
+ leftChildren: /* @__PURE__ */ jsx(Badge, { isLoading: isFetching, children: topic?.title[defaultWebLocale] })
112
111
  }
113
112
  }
114
113
  ),
@@ -127,7 +126,7 @@ function createPostEditPage({
127
126
  parentLabelKey: "resources.category.text"
128
127
  } : {},
129
128
  controlMeta,
130
- isFetching: isFetchingTopic || isFetching || isFetchingControlMeta,
129
+ isFetching: isFetching || isFetchingControlMeta,
131
130
  isNotFound,
132
131
  allowField: allowFieldInTopic
133
132
  }
@@ -138,7 +137,7 @@ function createPostEditPage({
138
137
  categoryType,
139
138
  subcategoryType,
140
139
  controlMeta,
141
- isFetching: isFetchingTopic || isFetching || isFetchingControlMeta,
140
+ isFetching: isFetching || isFetchingControlMeta,
142
141
  isNotFound
143
142
  })
144
143
  ] });
@@ -5,18 +5,16 @@ import { SquareArrowOutUpRight, Pen, Trash2, Lock } from 'lucide-react';
5
5
  import { useParams, useRouter } from 'next/navigation';
6
6
  import { POST_TYPES } from 'sitero-domain';
7
7
  import 'zod';
8
- import 'sonner';
9
- import 'react';
10
- import 'ua-parser-js';
11
- import '../../../../../../../../../../shared/client/react-query/client.js';
12
- import '@tanstack/react-query';
13
- import { useCommand } from '../../../../../../../../../../shared/client/react-query/use-command.js';
8
+ import { useCmsCommand } from '../../../../../../../../infrastructure/operation-result/use-cms-command.js';
14
9
  import { useCmsQuery } from '../../../../../../../../infrastructure/operation-result/use-cms-query.js';
15
10
  import { CMS_PATHS } from '../../../../../../../../../../constants/paths/cms-paths.js';
16
11
  import '../../../../../../../../../../constants/paths/redirect.js';
17
12
  import '../../../../../../../../../../constants/cms-locale.js';
18
13
  import 'mime-types';
19
- import { findTranslation } from '../../../../../../../../../../shared/translation/find-translation.js';
14
+ import 'react';
15
+ import 'ua-parser-js';
16
+ import '../../../../../../../../../../shared/client/react-query/client.js';
17
+ import '@tanstack/react-query';
20
18
  import 'clsx';
21
19
  import 'tailwind-merge';
22
20
  import { joinUrl } from '../../../../../../../../../../shared/utils/join-url.js';
@@ -34,6 +32,7 @@ import '@radix-ui/react-select';
34
32
  import '@radix-ui/react-separator';
35
33
  import '../../../../../../../components/shadcn/sidebar/sidebar.js';
36
34
  import 'next-themes';
35
+ import 'sonner';
37
36
  import '@radix-ui/react-tabs';
38
37
  import '@radix-ui/react-tooltip';
39
38
  import { Badge } from '../../../../../../../components/ui/display/badge.js';
@@ -71,11 +70,7 @@ function createPostShowPage({
71
70
  const subcategoryType = staticTopics[topicSlug]?.roles.includes(
72
71
  POST_TYPES.SUBCATEGORY
73
72
  ) ? POST_TYPES.SUBCATEGORY : void 0;
74
- const { data: topic, isFetching: isFetchingTopic } = useCmsQuery(
75
- () => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
76
- ["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
77
- { select: (data) => data?.post }
78
- );
73
+ const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug]} : void 0;
79
74
  const {
80
75
  data: post,
81
76
  isFetching,
@@ -87,7 +82,7 @@ function createPostShowPage({
87
82
  select: (data) => data?.post
88
83
  }
89
84
  );
90
- const { execute, isRedirecting } = useCommand(
85
+ const { execute, isRedirecting } = useCmsCommand(
91
86
  () => postDeleteAction({ id }),
92
87
  {
93
88
  onSuccess: () => router.replace(
@@ -114,7 +109,7 @@ function createPostShowPage({
114
109
  ),
115
110
  titleProps: {
116
111
  title: t("resources.post.text"),
117
- leftChildren: /* @__PURE__ */ jsx(Badge, { isLoading: isFetchingTopic, children: findTranslation(topic?.translations, defaultWebLocale)?.title }),
112
+ leftChildren: /* @__PURE__ */ jsx(Badge, { children: topic?.title[defaultWebLocale] }),
118
113
  rightChildren: post?.isLocked && /* @__PURE__ */ jsx(
119
114
  Lock,
120
115
  {
@@ -148,12 +143,12 @@ function createPostShowPage({
148
143
  variant: "destructive",
149
144
  icon: Trash2,
150
145
  onClick: () => {
151
- if (!confirm(t("ui.dialog.confirm.text"))) return;
146
+ if (!confirm(t("ui.dialog.move-to-trash.text"))) return;
152
147
  void execute();
153
148
  },
154
149
  isLoading: isRedirecting,
155
150
  isDisabled: isFetching || post?.isLocked,
156
- children: t("ui.destroy.text")
151
+ children: t("ui.move-to-trash.text")
157
152
  }
158
153
  )
159
154
  ] }),
@@ -60,6 +60,7 @@ function createPostRelationsPage({
60
60
  hasBorder: true,
61
61
  deps: [postStates.isFetching],
62
62
  accordionHeaderProps: {
63
+ showCount: true,
63
64
  count: postStates.count,
64
65
  children: t("resources.post.text")
65
66
  },