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.
- package/dist/export/cms/client/components/index.js +6 -2
- package/dist/export/cms/client/index.js +2 -0
- package/dist/export/cms/client/pages/index.js +1 -3
- package/dist/export/cms/server/index.js +1 -0
- package/dist/export/core/server/index.js +2 -0
- package/dist/export/index.js +1 -0
- package/dist/export/web/server/index.js +1 -0
- package/dist/prisma/generated/internal/class.js +4 -4
- package/dist/src/cms/client/applications/create-applications.js +5 -0
- package/dist/src/cms/client/applications/resources/page/form-data.js +56 -0
- package/dist/src/cms/client/applications/resources/page/use-page-update-form-data.js +30 -0
- package/dist/src/cms/client/applications/resources/post/use-create-form-data.js +5 -5
- package/dist/src/cms/client/applications/resources/post/use-update-form-data.js +1 -1
- package/dist/src/cms/client/applications/resources/seo-metadata/build-seo-metadata-translations.js +35 -0
- package/dist/src/cms/client/applications/resources/seo-metadata/use-upsert-form-data.js +15 -31
- package/dist/src/cms/client/applications/ui/use-nav-items.js +28 -39
- package/dist/src/cms/client/infrastructure/i18n/messages/en-US/resources/file.js +5 -4
- package/dist/src/cms/client/infrastructure/i18n/messages/en-US/resources/index.js +7 -0
- package/dist/src/cms/client/infrastructure/i18n/messages/en-US/resources/post.js +32 -1
- package/dist/src/cms/client/infrastructure/i18n/messages/en-US/ui/index.js +8 -1
- package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/file.js +6 -5
- package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/index.js +7 -0
- package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/post.js +18 -1
- package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/ui/index.js +7 -2
- package/dist/src/cms/client/infrastructure/operation-result/presentation/message.js +15 -0
- package/dist/src/cms/client/interfaces/components/create-components.js +4 -8
- package/dist/src/cms/client/interfaces/components/create-page-contents.js +28 -0
- package/dist/src/cms/client/interfaces/components/resources/page/content/field-groups.js +16 -0
- package/dist/src/cms/client/interfaces/components/resources/page/content/page-edit-content.js +216 -0
- package/dist/src/cms/client/interfaces/components/resources/page/content/page-show-content.js +114 -0
- package/dist/src/cms/client/interfaces/components/resources/page/content/types.js +12 -0
- package/dist/src/cms/client/interfaces/components/resources/post/category/category-card.js +5 -3
- package/dist/src/cms/client/interfaces/components/resources/post/category/category-table.js +6 -4
- package/dist/src/cms/client/interfaces/components/resources/post/content/post-create-content.js +13 -8
- package/dist/src/cms/client/interfaces/components/resources/post/content/post-edit-content.js +11 -7
- package/dist/src/cms/client/interfaces/components/resources/post/content/post-show-content.js +7 -2
- package/dist/src/cms/client/interfaces/components/resources/post/post-card.js +5 -3
- package/dist/src/cms/client/interfaces/components/resources/post/post-list.js +45 -10
- package/dist/src/cms/client/interfaces/components/resources/post/post-state-icons.js +17 -1
- package/dist/src/cms/client/interfaces/components/resources/post/post-table.js +8 -4
- package/dist/src/cms/client/interfaces/components/resources/post/search/control-fields-filters.js +5 -1
- package/dist/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.js +90 -67
- package/dist/src/cms/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.js +11 -1
- package/dist/src/cms/client/interfaces/components/ui/blocks/list-container/list-container.js +1 -1
- package/dist/src/cms/client/interfaces/components/ui/blocks/list-container/pagination.js +9 -9
- package/dist/src/cms/client/interfaces/components/ui/features/accordion/accordion-header.js +15 -3
- package/dist/src/cms/client/interfaces/components/ui/features/accordion/accordion.js +5 -7
- package/dist/src/cms/client/interfaces/components/ui/form/control-fields/control-fields-display.js +1 -1
- package/dist/src/cms/client/interfaces/components/ui/form/control-fields/control-fields-input.js +1 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/edit/page.js +11 -11
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/page.js +12 -16
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/relations/page.js +6 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/create/page.js +15 -16
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/page.js +18 -41
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/edit/page.js +10 -11
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/page.js +11 -16
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/relations/page.js +1 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/create/page.js +14 -16
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/edit/page.js +11 -11
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/page.js +12 -16
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/relations/page.js +1 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/create/page.js +15 -16
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/page.js +18 -32
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/edit/page.js +2 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/page.js +9 -9
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/relations/page.js +6 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/create/page.js +2 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/page.js +204 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/_id_/admin-refresh-token/page.js +1 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/_id_/page.js +1 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/_id_/relations/page.js +8 -3
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/_id_/page.js +3 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/_id_/relations/page.js +41 -30
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/delete-many/page.js +3 -3
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/page.js +1 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/trash/page.js +3 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/website/website-page/_slug_/edit/page.js +19 -11
- package/dist/src/cms/client/interfaces/pages/dashboard/website/website-page/_slug_/page.js +23 -10
- package/dist/src/cms/client/interfaces/pages/dashboard/website/website-page/page.js +7 -7
- package/dist/src/cms/server/create-cms-server.js +2 -0
- package/dist/src/cms/server/resources/page/actions.js +31 -0
- package/dist/src/cms/server/resources/post/actions.js +27 -6
- package/dist/src/cms/server/resources/seo-metadata/actions.js +7 -16
- package/dist/src/config/content-ui.js +24 -0
- package/dist/src/config/topics.js +1 -1
- package/dist/src/constants/paths/cms-paths.js +2 -2
- package/dist/src/core/infrastructure/prisma/file/include.js +44 -0
- package/dist/src/core/infrastructure/prisma/file/mappers.js +51 -3
- package/dist/src/core/infrastructure/prisma/helpers/active-file-references.js +2 -1
- package/dist/src/core/infrastructure/prisma/page/include.js +20 -0
- package/dist/src/core/infrastructure/prisma/page/mappers.js +44 -0
- package/dist/src/core/infrastructure/prisma/page/page-prisma-ports.js +91 -0
- package/dist/src/core/infrastructure/prisma/post/include.js +2 -5
- package/dist/src/core/infrastructure/prisma/post/lifecycle.js +108 -0
- package/dist/src/core/infrastructure/prisma/post/mappers.js +0 -2
- package/dist/src/core/infrastructure/prisma/post/post-prisma-ports.js +76 -24
- package/dist/src/core/infrastructure/prisma/post/read-scope.js +45 -0
- package/dist/src/core/infrastructure/prisma/seo-metadata/mappers.js +6 -1
- package/dist/src/core/infrastructure/prisma/seo-metadata/seo-metadata-prisma-ports.js +32 -11
- package/dist/src/core/seeders/page/seeder.js +9 -29
- package/dist/src/core/seeders/seed.js +0 -3
- package/dist/src/core/sitero-server/create-sitero-server.js +10 -0
- package/dist/src/web/server/create-web-server.js +5 -1
- package/dist/src/web/server/resources/page/actions.js +20 -0
- package/dist/src/web/server/resources/post/actions.js +3 -13
- package/dist/src/web/server/seo/sitemap/get-page-items.js +7 -6
- package/dist/src/web/server/seo/sitemap/get-post-items.js +2 -2
- package/dist/src/web/server/seo/sitemap/get-subcategory-items.js +1 -1
- package/dist/types/export/cms/client/components/index.d.ts +3 -0
- package/dist/types/export/cms/client/components/index.d.ts.map +1 -1
- package/dist/types/export/cms/client/index.d.ts +2 -0
- package/dist/types/export/cms/client/index.d.ts.map +1 -1
- package/dist/types/export/cms/client/pages/index.d.ts +2 -1
- package/dist/types/export/cms/client/pages/index.d.ts.map +1 -1
- package/dist/types/export/cms/server/index.d.ts +2 -1
- package/dist/types/export/cms/server/index.d.ts.map +1 -1
- package/dist/types/export/index.d.ts +1 -1
- package/dist/types/export/index.d.ts.map +1 -1
- package/dist/types/export/web/server/index.d.ts +2 -1
- package/dist/types/export/web/server/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/create-applications.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/index.d.ts +1 -0
- package/dist/types/src/cms/client/applications/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/resources/index.d.ts +1 -0
- package/dist/types/src/cms/client/applications/resources/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/resources/page/form-data.d.ts +21 -0
- package/dist/types/src/cms/client/applications/resources/page/form-data.d.ts.map +1 -0
- package/dist/types/src/cms/client/applications/resources/page/index.d.ts +3 -0
- package/dist/types/src/cms/client/applications/resources/page/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/applications/resources/page/use-page-update-form-data.d.ts +12 -0
- package/dist/types/src/cms/client/applications/resources/page/use-page-update-form-data.d.ts.map +1 -0
- package/dist/types/src/cms/client/applications/resources/post/use-create-form-data.d.ts +3 -5
- package/dist/types/src/cms/client/applications/resources/post/use-create-form-data.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/resources/post/use-update-form-data.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/resources/seo-metadata/build-seo-metadata-translations.d.ts +6 -0
- package/dist/types/src/cms/client/applications/resources/seo-metadata/build-seo-metadata-translations.d.ts.map +1 -0
- package/dist/types/src/cms/client/applications/resources/seo-metadata/use-upsert-form-data.d.ts +5 -4
- package/dist/types/src/cms/client/applications/resources/seo-metadata/use-upsert-form-data.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/types.d.ts +2 -1
- package/dist/types/src/cms/client/applications/types.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/ui/use-nav-items.d.ts +3 -4
- package/dist/types/src/cms/client/applications/ui/use-nav-items.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/index.d.ts +86 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/file.d.ts +3 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/file.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/index.d.ts +71 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/post.d.ts +51 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/post.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/ui/index.d.ts +15 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/ui/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/index.d.ts +172 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/index.d.ts +86 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/file.d.ts +3 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/file.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/index.d.ts +71 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/post.d.ts +51 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/post.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/ui/index.d.ts +15 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/ui/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/operation-result/presentation/message.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/create-components.d.ts +6 -3
- package/dist/types/src/cms/client/interfaces/components/create-components.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/create-page-contents.d.ts +30 -0
- package/dist/types/src/cms/client/interfaces/components/create-page-contents.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/index.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/field-groups.d.ts +3 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/field-groups.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/page-edit-content.d.ts +14 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/page-edit-content.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/page-show-content.d.ts +7 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/page-show-content.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/types.d.ts +27 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/content/types.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/index.d.ts +4 -0
- package/dist/types/src/cms/client/interfaces/components/resources/page/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-card.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-card.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-table.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-table.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-create-content.d.ts +3 -5
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-create-content.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-edit-content.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-show-content.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-card.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-card.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-list.d.ts +6 -3
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-list.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-state-icons.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-table.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-table.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/search/control-fields-filters.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.d.ts +5 -2
- package/dist/types/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/seo-form.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.d.ts +2 -1
- package/dist/types/src/cms/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/blocks/list-container/list-container.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/features/accordion/accordion-header.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/components/ui/features/accordion/accordion-header.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/features/accordion/accordion.d.ts +2 -1
- package/dist/types/src/cms/client/interfaces/components/ui/features/accordion/accordion.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/form/control-fields/control-fields-display.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/form/control-fields/control-fields-input.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/edit/page.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/edit/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/page.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/relations/page.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/relations/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/create/page.d.ts +4 -7
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/create/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/page.d.ts +1 -4
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/edit/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/[id]/relations/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/create/page.d.ts +4 -7
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/post/create/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/edit/page.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/edit/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/page.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/relations/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/create/page.d.ts +4 -7
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/create/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/page.d.ts +1 -3
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/[id]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/[id]/relations/page.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/[id]/relations/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/index.d.ts +2 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/page.d.ts +18 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/trash/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/access/admin/[id]/relations/page.d.ts +3 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/access/admin/[id]/relations/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/storage/file/[id]/relations/page.d.ts +5 -6
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/storage/file/[id]/relations/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/storage/trash/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/[slug]/edit/page.d.ts +7 -9
- package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/[slug]/edit/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/[slug]/page.d.ts +7 -9
- package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/[slug]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/page.d.ts +3 -3
- package/dist/types/src/cms/client/interfaces/pages/dashboard/website/website-page/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/index.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/pages/index.d.ts.map +1 -1
- package/dist/types/src/cms/contracts/resources/page/actions.d.ts +7 -0
- package/dist/types/src/cms/contracts/resources/page/actions.d.ts.map +1 -0
- package/dist/types/src/cms/contracts/resources/post/actions.d.ts +2 -0
- package/dist/types/src/cms/contracts/resources/post/actions.d.ts.map +1 -1
- package/dist/types/src/cms/contracts/resources/post/form-data.d.ts +1 -1
- package/dist/types/src/cms/contracts/resources/post/form-data.d.ts.map +1 -1
- package/dist/types/src/cms/contracts/resources/seo-metadata/form-data.d.ts +2 -2
- package/dist/types/src/cms/contracts/resources/seo-metadata/form-data.d.ts.map +1 -1
- package/dist/types/src/cms/server/create-cms-server.d.ts +7 -0
- package/dist/types/src/cms/server/create-cms-server.d.ts.map +1 -1
- package/dist/types/src/cms/server/index.d.ts +1 -1
- package/dist/types/src/cms/server/index.d.ts.map +1 -1
- package/dist/types/src/cms/server/resources/index.d.ts +1 -0
- package/dist/types/src/cms/server/resources/index.d.ts.map +1 -1
- package/dist/types/src/cms/server/resources/page/actions.d.ts +8 -0
- package/dist/types/src/cms/server/resources/page/actions.d.ts.map +1 -0
- package/dist/types/src/cms/server/resources/post/actions.d.ts +2 -0
- package/dist/types/src/cms/server/resources/post/actions.d.ts.map +1 -1
- package/dist/types/src/cms/server/resources/seo-metadata/actions.d.ts.map +1 -1
- package/dist/types/src/config/content-ui.d.ts +14 -0
- package/dist/types/src/config/content-ui.d.ts.map +1 -0
- package/dist/types/src/config/index.d.ts +2 -0
- package/dist/types/src/config/index.d.ts.map +1 -1
- package/dist/types/src/config/page.d.ts +4 -0
- package/dist/types/src/config/page.d.ts.map +1 -0
- package/dist/types/src/config/topics.d.ts +2 -2
- package/dist/types/src/config/topics.d.ts.map +1 -1
- package/dist/types/src/constants/paths/cms-paths.d.ts +3 -3
- package/dist/types/src/core/infrastructure/index.d.ts +1 -0
- package/dist/types/src/core/infrastructure/index.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/file/include.d.ts +121 -0
- package/dist/types/src/core/infrastructure/prisma/file/include.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/file/mappers.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/helpers/active-file-references.d.ts +1 -1
- package/dist/types/src/core/infrastructure/prisma/helpers/active-file-references.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/index.d.ts +1 -0
- package/dist/types/src/core/infrastructure/prisma/index.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/page/include.d.ts +63 -0
- package/dist/types/src/core/infrastructure/prisma/page/include.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/page/index.d.ts +4 -0
- package/dist/types/src/core/infrastructure/prisma/page/index.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/page/mappers.d.ts +9 -0
- package/dist/types/src/core/infrastructure/prisma/page/mappers.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/page/page-prisma-ports.d.ts +7 -0
- package/dist/types/src/core/infrastructure/prisma/page/page-prisma-ports.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/page/types.d.ts +10 -0
- package/dist/types/src/core/infrastructure/prisma/page/types.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/post/include.d.ts +0 -29
- package/dist/types/src/core/infrastructure/prisma/post/include.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/post/lifecycle.d.ts +66 -0
- package/dist/types/src/core/infrastructure/prisma/post/lifecycle.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/post/mappers.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/post/post-prisma-ports.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/post/read-scope.d.ts +271 -0
- package/dist/types/src/core/infrastructure/prisma/post/read-scope.d.ts.map +1 -0
- package/dist/types/src/core/infrastructure/prisma/seo-metadata/mappers.d.ts +1 -1
- package/dist/types/src/core/infrastructure/prisma/seo-metadata/mappers.d.ts.map +1 -1
- package/dist/types/src/core/infrastructure/prisma/seo-metadata/seo-metadata-prisma-ports.d.ts +2 -2
- package/dist/types/src/core/infrastructure/prisma/seo-metadata/seo-metadata-prisma-ports.d.ts.map +1 -1
- package/dist/types/src/core/seeders/page/seeder.d.ts +3 -3
- package/dist/types/src/core/seeders/page/seeder.d.ts.map +1 -1
- package/dist/types/src/core/seeders/seed.d.ts +2 -3
- package/dist/types/src/core/seeders/seed.d.ts.map +1 -1
- package/dist/types/src/core/sitero-server/create-sitero-server.d.ts.map +1 -1
- package/dist/types/src/core/sitero-server/types.d.ts +2 -0
- package/dist/types/src/core/sitero-server/types.d.ts.map +1 -1
- package/dist/types/src/shared/list-item.d.ts +1 -0
- package/dist/types/src/shared/list-item.d.ts.map +1 -1
- package/dist/types/src/web/contracts/index.d.ts +1 -0
- package/dist/types/src/web/contracts/index.d.ts.map +1 -1
- package/dist/types/src/web/contracts/resources/page/actions.d.ts +5 -0
- package/dist/types/src/web/contracts/resources/page/actions.d.ts.map +1 -0
- package/dist/types/src/web/contracts/resources/post/actions.d.ts +1 -1
- package/dist/types/src/web/contracts/resources/post/actions.d.ts.map +1 -1
- package/dist/types/src/web/server/create-web-server.d.ts.map +1 -1
- package/dist/types/src/web/server/index.d.ts +1 -1
- package/dist/types/src/web/server/index.d.ts.map +1 -1
- package/dist/types/src/web/server/resources/index.d.ts +1 -0
- package/dist/types/src/web/server/resources/index.d.ts.map +1 -1
- package/dist/types/src/web/server/resources/page/actions.d.ts +17 -0
- package/dist/types/src/web/server/resources/page/actions.d.ts.map +1 -0
- package/dist/types/src/web/server/resources/post/actions.d.ts +1 -6
- package/dist/types/src/web/server/resources/post/actions.d.ts.map +1 -1
- package/dist/types/src/web/server/seo/metadata/build-metadata.d.ts +5 -2
- package/dist/types/src/web/server/seo/metadata/build-metadata.d.ts.map +1 -1
- package/dist/types/src/web/server/seo/sitemap/build-entries.d.ts +2 -2
- package/dist/types/src/web/server/seo/sitemap/build-entries.d.ts.map +1 -1
- package/dist/types/src/web/server/seo/sitemap/get-page-items.d.ts +6 -2
- package/dist/types/src/web/server/seo/sitemap/get-page-items.d.ts.map +1 -1
- package/dist/types/src/web/server/seo/sitemap/get-post-items.d.ts.map +1 -1
- package/dist/types/src/web/server/seo/sitemap/get-subcategory-items.d.ts.map +1 -1
- package/dist/types/src/web/server/types.d.ts +6 -2
- package/dist/types/src/web/server/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/src/cms/client/interfaces/components/resources/post/topic/topic-card.js +0 -81
- package/dist/src/cms/client/interfaces/components/resources/post/topic/topic-table.js +0 -120
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/_id_/edit/page.js +0 -110
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/_id_/page.js +0 -161
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/page.js +0 -103
- package/dist/src/core/seeders/topic/seeder.js +0 -47
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/index.d.ts +0 -3
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/index.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-card.d.ts +0 -5
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-card.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-table.d.ts +0 -3
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-table.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/edit/page.d.ts +0 -20
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/edit/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/page.d.ts +0 -20
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/index.d.ts +0 -4
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/index.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/page.d.ts +0 -14
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/page.d.ts.map +0 -1
- package/dist/types/src/core/seeders/topic/seeder.d.ts +0 -10
- package/dist/types/src/core/seeders/topic/seeder.d.ts.map +0 -1
|
@@ -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';
|
|
@@ -47,7 +46,6 @@ import '../../../../../../../components/ui/inputs/password-input.js';
|
|
|
47
46
|
|
|
48
47
|
function createPostCreatePage({
|
|
49
48
|
topics: staticTopics,
|
|
50
|
-
postFindDetailAction,
|
|
51
49
|
postFindManyAction,
|
|
52
50
|
renderPostCreateContent,
|
|
53
51
|
PostCreateContent,
|
|
@@ -68,14 +66,14 @@ function createPostCreatePage({
|
|
|
68
66
|
CMS_PATHS.content["content-management"].pathname,
|
|
69
67
|
topicSlug
|
|
70
68
|
);
|
|
71
|
-
const
|
|
72
|
-
() => postFindDetailAction({ type: POST_TYPES.TOPIC, slug: topicSlug }),
|
|
73
|
-
["postFindDetailAction", POST_TYPES.TOPIC, topicSlug],
|
|
74
|
-
{ select: (data) => data?.post }
|
|
75
|
-
);
|
|
69
|
+
const topic = Object.hasOwn(staticTopics, topicSlug) ? { ...staticTopics[topicSlug], key: topicSlug } : void 0;
|
|
76
70
|
const { data: posts, isFetching: isFetchingControlMeta } = useCmsQuery(
|
|
77
|
-
() => postFindManyAction({
|
|
78
|
-
|
|
71
|
+
() => postFindManyAction({
|
|
72
|
+
type: postType,
|
|
73
|
+
topicKey: topic?.key,
|
|
74
|
+
deletion: "all"
|
|
75
|
+
}),
|
|
76
|
+
["postFindManyAction", postType, topic?.key, "all"],
|
|
79
77
|
{ select: (data) => data?.posts, enabled: !!topic }
|
|
80
78
|
);
|
|
81
79
|
const controlMeta = getControlMeta({ records: ensureArray(posts) });
|
|
@@ -86,14 +84,14 @@ function createPostCreatePage({
|
|
|
86
84
|
navigation: /* @__PURE__ */ jsx(ReturnButton, { useConfirm: true, href: returnHref }),
|
|
87
85
|
titleProps: {
|
|
88
86
|
title: t("resources.post.text"),
|
|
89
|
-
leftChildren: /* @__PURE__ */ jsx(Badge, {
|
|
87
|
+
leftChildren: /* @__PURE__ */ jsx(Badge, { children: topic?.title[defaultWebLocale] })
|
|
90
88
|
}
|
|
91
89
|
}
|
|
92
90
|
),
|
|
93
|
-
PostCreateContent && allowField && /* @__PURE__ */ jsx(
|
|
91
|
+
topic && PostCreateContent && allowField && /* @__PURE__ */ jsx(
|
|
94
92
|
PostCreateContent,
|
|
95
93
|
{
|
|
96
|
-
topic,
|
|
94
|
+
topicKey: topic?.key,
|
|
97
95
|
postType,
|
|
98
96
|
...hasSubcategory ? {
|
|
99
97
|
parentType: subcategoryType,
|
|
@@ -105,18 +103,18 @@ function createPostCreatePage({
|
|
|
105
103
|
parentLabelKey: "resources.category.text"
|
|
106
104
|
} : {},
|
|
107
105
|
controlMeta,
|
|
108
|
-
isFetching:
|
|
106
|
+
isFetching: isFetchingControlMeta,
|
|
109
107
|
allowField: allowFieldInTopic,
|
|
110
108
|
cancelButtonHref: returnHref
|
|
111
109
|
}
|
|
112
110
|
),
|
|
113
|
-
renderPostCreateContent && renderPostCreateContent({
|
|
114
|
-
topic,
|
|
111
|
+
topic && renderPostCreateContent && renderPostCreateContent({
|
|
112
|
+
topicKey: topic?.key,
|
|
115
113
|
postType,
|
|
116
114
|
categoryType,
|
|
117
115
|
subcategoryType,
|
|
118
116
|
controlMeta,
|
|
119
|
-
isFetching:
|
|
117
|
+
isFetching: isFetchingControlMeta,
|
|
120
118
|
cancelButtonHref: returnHref
|
|
121
119
|
})
|
|
122
120
|
] });
|
|
@@ -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 createSubcategoryEditPage({
|
|
46
|
+
topics: staticTopics,
|
|
47
47
|
postFindDetailAction,
|
|
48
48
|
postFindManyAction,
|
|
49
49
|
renderPostEditContent,
|
|
@@ -56,11 +56,7 @@ function createSubcategoryEditPage({
|
|
|
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
|
|
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: subcategory,
|
|
66
62
|
isFetching,
|
|
@@ -73,8 +69,12 @@ function createSubcategoryEditPage({
|
|
|
73
69
|
}
|
|
74
70
|
);
|
|
75
71
|
const { data: categories, isFetching: isFetchingControlMeta } = useCmsQuery(
|
|
76
|
-
() => postFindManyAction({
|
|
77
|
-
|
|
72
|
+
() => postFindManyAction({
|
|
73
|
+
type: subcategoryType,
|
|
74
|
+
topicKey: topic?.key,
|
|
75
|
+
deletion: "all"
|
|
76
|
+
}),
|
|
77
|
+
["postFindManyAction", subcategoryType, topic?.key, "all"],
|
|
78
78
|
{ select: (data) => data?.posts, enabled: !!topic }
|
|
79
79
|
);
|
|
80
80
|
const controlMeta = getControlMeta({
|
|
@@ -90,7 +90,7 @@ function createSubcategoryEditPage({
|
|
|
90
90
|
titleProps: {
|
|
91
91
|
icon: Notebook,
|
|
92
92
|
title: t("resources.subcategory.text"),
|
|
93
|
-
leftChildren: /* @__PURE__ */ jsx(Badge, {
|
|
93
|
+
leftChildren: /* @__PURE__ */ jsx(Badge, { children: topic?.title[locale] })
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
),
|
|
@@ -102,7 +102,7 @@ function createSubcategoryEditPage({
|
|
|
102
102
|
parentType: categoryType,
|
|
103
103
|
parentLabelKey: "resources.category.text",
|
|
104
104
|
controlMeta,
|
|
105
|
-
isFetching:
|
|
105
|
+
isFetching: isFetching || isFetchingControlMeta,
|
|
106
106
|
isNotFound,
|
|
107
107
|
allowField: allowFieldInTopic
|
|
108
108
|
}
|
|
@@ -112,7 +112,7 @@ function createSubcategoryEditPage({
|
|
|
112
112
|
categoryType,
|
|
113
113
|
subcategoryType,
|
|
114
114
|
controlMeta,
|
|
115
|
-
isFetching:
|
|
115
|
+
isFetching: isFetching || isFetchingControlMeta,
|
|
116
116
|
isNotFound
|
|
117
117
|
})
|
|
118
118
|
] });
|
|
@@ -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 '
|
|
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
|
|
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 createSubcategoryShowPage({
|
|
55
54
|
enableSeoMetadata,
|
|
56
55
|
externalHref,
|
|
56
|
+
topics: staticTopics,
|
|
57
57
|
postFindDetailAction,
|
|
58
58
|
postDeleteAction,
|
|
59
59
|
SeoMetadataDialog,
|
|
@@ -66,11 +66,7 @@ function createSubcategoryShowPage({
|
|
|
66
66
|
const { id, topicSlug } = useParams();
|
|
67
67
|
const router = useRouter();
|
|
68
68
|
const postType = POST_TYPES.POST;
|
|
69
|
-
const
|
|
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: subcategory,
|
|
76
72
|
isFetching,
|
|
@@ -82,7 +78,7 @@ function createSubcategoryShowPage({
|
|
|
82
78
|
select: (data) => data?.post
|
|
83
79
|
}
|
|
84
80
|
);
|
|
85
|
-
const { execute, isRedirecting } =
|
|
81
|
+
const { execute, isRedirecting } = useCmsCommand(
|
|
86
82
|
() => postDeleteAction({ id }),
|
|
87
83
|
{
|
|
88
84
|
onSuccess: () => router.replace(
|
|
@@ -110,7 +106,7 @@ function createSubcategoryShowPage({
|
|
|
110
106
|
titleProps: {
|
|
111
107
|
icon: Notebook,
|
|
112
108
|
title: t("resources.subcategory.text"),
|
|
113
|
-
leftChildren: /* @__PURE__ */ jsx(Badge, {
|
|
109
|
+
leftChildren: /* @__PURE__ */ jsx(Badge, { children: topic?.title[locale] }),
|
|
114
110
|
rightChildren: subcategory?.isLocked && /* @__PURE__ */ jsx(
|
|
115
111
|
Lock,
|
|
116
112
|
{
|
|
@@ -144,12 +140,12 @@ function createSubcategoryShowPage({
|
|
|
144
140
|
variant: "destructive",
|
|
145
141
|
icon: Trash2,
|
|
146
142
|
onClick: () => {
|
|
147
|
-
if (!confirm(t("ui.dialog.
|
|
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 || subcategory?.isLocked,
|
|
152
|
-
children: t("ui.
|
|
148
|
+
children: t("ui.move-to-trash.text")
|
|
153
149
|
}
|
|
154
150
|
)
|
|
155
151
|
] }),
|
|
@@ -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 createSubcategoryCreatePage({
|
|
49
|
-
|
|
48
|
+
topics: staticTopics,
|
|
50
49
|
postFindManyAction,
|
|
51
50
|
renderPostCreateContent,
|
|
52
51
|
PostCreateContent,
|
|
@@ -62,14 +61,14 @@ function createSubcategoryCreatePage({
|
|
|
62
61
|
CMS_PATHS.content["content-management"].pathname,
|
|
63
62
|
topicSlug
|
|
64
63
|
);
|
|
65
|
-
const
|
|
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: subcategories, isFetching: isFetchingControlMeta } = useCmsQuery(
|
|
71
|
-
() => postFindManyAction({
|
|
72
|
-
|
|
66
|
+
() => postFindManyAction({
|
|
67
|
+
type: subcategoryType,
|
|
68
|
+
topicKey: topic?.key,
|
|
69
|
+
deletion: "all"
|
|
70
|
+
}),
|
|
71
|
+
["postFindManyAction", subcategoryType, topic?.key, "all"],
|
|
73
72
|
{ select: (data) => data?.posts, enabled: !!topic }
|
|
74
73
|
);
|
|
75
74
|
const controlMeta = getControlMeta({ records: ensureArray(subcategories) });
|
|
@@ -80,29 +79,29 @@ function createSubcategoryCreatePage({
|
|
|
80
79
|
navigation: /* @__PURE__ */ jsx(ReturnButton, { useConfirm: true, href: returnHref }),
|
|
81
80
|
titleProps: {
|
|
82
81
|
title: t("resources.subcategory.text"),
|
|
83
|
-
leftChildren: /* @__PURE__ */ jsx(Badge, {
|
|
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: subcategoryType,
|
|
92
91
|
parentType: categoryType,
|
|
93
92
|
parentLabelKey: "resources.category.text",
|
|
94
93
|
controlMeta,
|
|
95
|
-
isFetching:
|
|
94
|
+
isFetching: isFetchingControlMeta,
|
|
96
95
|
allowField: allowFieldInTopic,
|
|
97
96
|
cancelButtonHref: returnHref
|
|
98
97
|
}
|
|
99
98
|
),
|
|
100
|
-
renderPostCreateContent?.({
|
|
101
|
-
topic,
|
|
99
|
+
topic && renderPostCreateContent?.({
|
|
100
|
+
topicKey: topic?.key,
|
|
102
101
|
categoryType,
|
|
103
102
|
subcategoryType,
|
|
104
103
|
controlMeta,
|
|
105
|
-
isFetching:
|
|
104
|
+
isFetching: isFetchingControlMeta,
|
|
106
105
|
cancelButtonHref: returnHref
|
|
107
106
|
})
|
|
108
107
|
] });
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useTranslator } from 'intor/react';
|
|
4
|
-
import { File
|
|
5
|
-
import { POST_TYPES } from 'sitero-domain';
|
|
4
|
+
import { File } from 'lucide-react';
|
|
6
5
|
import { isContentTopic } from '../../../../../../../config/topics.js';
|
|
7
6
|
import { CMS_PATHS } from '../../../../../../../constants/paths/cms-paths.js';
|
|
8
7
|
import '../../../../../../../constants/paths/redirect.js';
|
|
9
8
|
import '../../../../../../../constants/cms-locale.js';
|
|
10
9
|
import 'mime-types';
|
|
11
|
-
import
|
|
10
|
+
import 'sitero-domain';
|
|
12
11
|
import 'react';
|
|
13
12
|
import 'ua-parser-js';
|
|
14
13
|
import '../../../../../../../shared/client/react-query/client.js';
|
|
15
14
|
import '@tanstack/react-query';
|
|
16
|
-
import { useQuery } from '../../../../../../../shared/client/react-query/use-query.js';
|
|
17
15
|
import 'clsx';
|
|
18
16
|
import 'tailwind-merge';
|
|
19
|
-
import { ensureArray } from '../../../../../../../shared/utils/ensure-array.js';
|
|
20
17
|
import { joinUrl } from '../../../../../../../shared/utils/join-url.js';
|
|
18
|
+
import { PageHeaderLayout } from '../../../../components/ui/blocks/page-header/page-header-layout.js';
|
|
21
19
|
import '@radix-ui/react-avatar';
|
|
22
20
|
import '../../../../components/shadcn/badge.js';
|
|
23
21
|
import '../../../../components/shadcn/button.js';
|
|
@@ -32,10 +30,8 @@ import '@radix-ui/react-separator';
|
|
|
32
30
|
import '../../../../components/shadcn/sidebar/sidebar.js';
|
|
33
31
|
import 'next-themes';
|
|
34
32
|
import 'sonner';
|
|
35
|
-
import { Spinner } from '../../../../components/shadcn/spinner.js';
|
|
36
33
|
import '@radix-ui/react-tabs';
|
|
37
34
|
import '@radix-ui/react-tooltip';
|
|
38
|
-
import { PageHeaderLayout } from '../../../../components/ui/blocks/page-header/page-header-layout.js';
|
|
39
35
|
import 'next/link';
|
|
40
36
|
import { ReturnButton } from '../../../../components/ui/buttons/return-button.js';
|
|
41
37
|
import '../../../../components/ui/inputs/input.js';
|
|
@@ -50,19 +46,12 @@ import 'next/navigation';
|
|
|
50
46
|
import { ContentContainer } from '../../../../components/ui/layouts/content-container.js';
|
|
51
47
|
|
|
52
48
|
function createContentManagementPage({
|
|
53
|
-
topics: staticTopics
|
|
54
|
-
postFindManyAction
|
|
49
|
+
topics: staticTopics
|
|
55
50
|
}) {
|
|
56
51
|
return function ContentManagementPage() {
|
|
57
52
|
const { t, locale } = useTranslator();
|
|
58
|
-
const
|
|
59
|
-
() =>
|
|
60
|
-
["postFindManyAction", POST_TYPES.TOPIC],
|
|
61
|
-
{
|
|
62
|
-
select: (data) => ensureArray(data?.posts).filter(
|
|
63
|
-
(topic) => isContentTopic(staticTopics, topic.slug)
|
|
64
|
-
)
|
|
65
|
-
}
|
|
53
|
+
const topics = Object.entries(staticTopics).filter(
|
|
54
|
+
([key]) => isContentTopic(staticTopics, key)
|
|
66
55
|
);
|
|
67
56
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
57
|
/* @__PURE__ */ jsx(
|
|
@@ -75,21 +64,18 @@ function createContentManagementPage({
|
|
|
75
64
|
}
|
|
76
65
|
}
|
|
77
66
|
),
|
|
78
|
-
/* @__PURE__ */ jsx(ContentContainer, { children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap max-lg:gap-3 lg:gap-6", children:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
topic.id
|
|
91
|
-
);
|
|
92
|
-
}) }) })
|
|
67
|
+
/* @__PURE__ */ jsx(ContentContainer, { children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap max-lg:gap-3 lg:gap-6", children: topics.map(([key, topic]) => /* @__PURE__ */ jsx(
|
|
68
|
+
FeatureCard,
|
|
69
|
+
{
|
|
70
|
+
href: joinUrl(
|
|
71
|
+
CMS_PATHS.content["content-management"].pathname,
|
|
72
|
+
key
|
|
73
|
+
),
|
|
74
|
+
icon: /* @__PURE__ */ jsx(topic.icon, {}),
|
|
75
|
+
text: topic.title[locale]
|
|
76
|
+
},
|
|
77
|
+
key
|
|
78
|
+
)) }) })
|
|
93
79
|
] });
|
|
94
80
|
};
|
|
95
81
|
}
|
|
@@ -64,8 +64,8 @@ function createTagEditPage({
|
|
|
64
64
|
}
|
|
65
65
|
);
|
|
66
66
|
const { data: tags, isFetching: isFetchingControlMeta } = useCmsQuery(
|
|
67
|
-
() => postFindManyAction({ type }),
|
|
68
|
-
["postFindManyAction", type],
|
|
67
|
+
() => postFindManyAction({ type, deletion: "all" }),
|
|
68
|
+
["postFindManyAction", type, "all"],
|
|
69
69
|
{ select: (data) => data?.posts }
|
|
70
70
|
);
|
|
71
71
|
const controlMeta = getControlMeta({
|
package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/page.js
CHANGED
|
@@ -5,17 +5,16 @@ import { Tag, SquareArrowOutUpRight, Pen, Trash2 } 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 '
|
|
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';
|
|
14
|
+
import 'react';
|
|
15
|
+
import 'ua-parser-js';
|
|
16
|
+
import '../../../../../../../../../shared/client/react-query/client.js';
|
|
17
|
+
import '@tanstack/react-query';
|
|
19
18
|
import 'clsx';
|
|
20
19
|
import 'tailwind-merge';
|
|
21
20
|
import 'next/link';
|
|
@@ -32,6 +31,7 @@ import '@radix-ui/react-select';
|
|
|
32
31
|
import '@radix-ui/react-separator';
|
|
33
32
|
import '../../../../../../components/shadcn/sidebar/sidebar.js';
|
|
34
33
|
import 'next-themes';
|
|
34
|
+
import 'sonner';
|
|
35
35
|
import '@radix-ui/react-tabs';
|
|
36
36
|
import '@radix-ui/react-tooltip';
|
|
37
37
|
import { ActionButton } from '../../../../../../components/ui/buttons/action-button.js';
|
|
@@ -76,7 +76,7 @@ function createTagShowPage({
|
|
|
76
76
|
}
|
|
77
77
|
);
|
|
78
78
|
const isScopeNotFound = isNotFound || !!tag && tag.type !== type;
|
|
79
|
-
const { execute, isRedirecting } =
|
|
79
|
+
const { execute, isRedirecting } = useCmsCommand(
|
|
80
80
|
() => postDeleteAction({ id }),
|
|
81
81
|
{
|
|
82
82
|
onSuccess: () => router.replace(returnHref)
|
|
@@ -109,12 +109,12 @@ function createTagShowPage({
|
|
|
109
109
|
variant: "destructive",
|
|
110
110
|
icon: Trash2,
|
|
111
111
|
onClick: () => {
|
|
112
|
-
if (!confirm(t("ui.dialog.
|
|
112
|
+
if (!confirm(t("ui.dialog.move-to-trash.text"))) return;
|
|
113
113
|
void execute();
|
|
114
114
|
},
|
|
115
115
|
isLoading: isRedirecting,
|
|
116
116
|
isDisabled: isFetching || isScopeNotFound,
|
|
117
|
-
children: t("ui.
|
|
117
|
+
children: t("ui.move-to-trash.text")
|
|
118
118
|
}
|
|
119
119
|
)
|
|
120
120
|
] }),
|
|
@@ -43,6 +43,7 @@ import 'zod';
|
|
|
43
43
|
import 'intor/next';
|
|
44
44
|
|
|
45
45
|
function createTagRelationsPage({
|
|
46
|
+
contentUi,
|
|
46
47
|
postFindRelationsAction,
|
|
47
48
|
PostList,
|
|
48
49
|
CategoryCard,
|
|
@@ -59,12 +60,13 @@ function createTagRelationsPage({
|
|
|
59
60
|
{}
|
|
60
61
|
);
|
|
61
62
|
return /* @__PURE__ */ jsx(PostRelationsLayout, { children: (relations) => /* @__PURE__ */ jsxs(AccordionContainer, { children: [
|
|
62
|
-
/* @__PURE__ */ jsx(
|
|
63
|
+
(contentUi?.hasCategory ?? true) && /* @__PURE__ */ jsx(
|
|
63
64
|
Accordion,
|
|
64
65
|
{
|
|
65
66
|
hasBorder: true,
|
|
66
67
|
deps: [categoryStates.isFetching],
|
|
67
68
|
accordionHeaderProps: {
|
|
69
|
+
showCount: true,
|
|
68
70
|
count: categoryStates.count,
|
|
69
71
|
children: t("resources.category.text")
|
|
70
72
|
},
|
|
@@ -82,12 +84,13 @@ function createTagRelationsPage({
|
|
|
82
84
|
)
|
|
83
85
|
}
|
|
84
86
|
),
|
|
85
|
-
/* @__PURE__ */ jsx(
|
|
87
|
+
(contentUi?.hasSubcategory ?? true) && /* @__PURE__ */ jsx(
|
|
86
88
|
Accordion,
|
|
87
89
|
{
|
|
88
90
|
hasBorder: true,
|
|
89
91
|
deps: [subcategoryStates.isFetching],
|
|
90
92
|
accordionHeaderProps: {
|
|
93
|
+
showCount: true,
|
|
91
94
|
count: subcategoryStates.count,
|
|
92
95
|
children: t("resources.subcategory.text")
|
|
93
96
|
},
|
|
@@ -111,6 +114,7 @@ function createTagRelationsPage({
|
|
|
111
114
|
hasBorder: true,
|
|
112
115
|
deps: [postStates.isFetching],
|
|
113
116
|
accordionHeaderProps: {
|
|
117
|
+
showCount: true,
|
|
114
118
|
count: postStates.count,
|
|
115
119
|
children: t("resources.post.text")
|
|
116
120
|
},
|
package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/create/page.js
CHANGED
|
@@ -50,8 +50,8 @@ function createTagCreatePage({
|
|
|
50
50
|
return function TagCreatePage() {
|
|
51
51
|
const { t } = useTranslator();
|
|
52
52
|
const { data: tags, isFetching: isFetchingControlMeta } = useQuery(
|
|
53
|
-
() => postFindManyAction({ type }),
|
|
54
|
-
["postFindManyAction", type],
|
|
53
|
+
() => postFindManyAction({ type, deletion: "all" }),
|
|
54
|
+
["postFindManyAction", type, "all"],
|
|
55
55
|
{ select: (data) => data?.posts }
|
|
56
56
|
);
|
|
57
57
|
const controlMeta = getControlMeta({ records: ensureArray(tags) });
|