sitero 0.5.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 +10 -10
- package/dist/src/core/infrastructure/prisma/post/lifecycle.js +108 -0
- package/dist/src/core/infrastructure/prisma/post/mappers.js +9 -6
- 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 +7 -37
- 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/content/types.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/types.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 +37 -23
- 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 +3 -2
- 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/post/types.d.ts +4 -1
- package/dist/types/src/core/infrastructure/prisma/post/types.d.ts.map +1 -1
- 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 +2 -3
- 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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createPageEditContent } from './resources/page/content/page-edit-content.js';
|
|
2
|
+
import { createPageShowContent } from './resources/page/content/page-show-content.js';
|
|
3
|
+
|
|
4
|
+
function createPageContents({
|
|
5
|
+
actions,
|
|
6
|
+
applications,
|
|
7
|
+
components,
|
|
8
|
+
constants
|
|
9
|
+
}) {
|
|
10
|
+
return {
|
|
11
|
+
resources: {
|
|
12
|
+
PageShowContent: createPageShowContent({
|
|
13
|
+
FileCard: components.resources.FileCard,
|
|
14
|
+
webLocales: constants.webLocales
|
|
15
|
+
}),
|
|
16
|
+
PageEditContent: createPageEditContent({
|
|
17
|
+
pageUpdateAction: actions.resources.page.update,
|
|
18
|
+
usePageUpdateFormData: applications.resources.usePageUpdateFormData,
|
|
19
|
+
FileCard: components.resources.FileCard,
|
|
20
|
+
FileList: components.resources.FileList,
|
|
21
|
+
Uploader: components.blobFile.Uploader,
|
|
22
|
+
webLocales: constants.webLocales
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { createPageContents };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PAGE_MEDIA_FIELDS, PAGE_TEXT_FIELDS } from 'sitero-domain';
|
|
2
|
+
|
|
3
|
+
const PAGE_FIELD_GROUPS = PAGE_MEDIA_FIELDS.map((mediaField, index) => {
|
|
4
|
+
const prefix = index === 0 ? "" : `section${index}`;
|
|
5
|
+
const textFields = PAGE_TEXT_FIELDS.filter(
|
|
6
|
+
(field) => (field.match(/^section\d+/)?.[0] ?? "") === prefix
|
|
7
|
+
);
|
|
8
|
+
return [...textFields.slice(0, 3), mediaField, ...textFields.slice(3)];
|
|
9
|
+
});
|
|
10
|
+
function getVisiblePageFieldGroups(fields) {
|
|
11
|
+
return PAGE_FIELD_GROUPS.map(
|
|
12
|
+
(group) => group.filter((field) => fields[field] !== void 0)
|
|
13
|
+
).filter((group) => group.length > 0);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { getVisiblePageFieldGroups };
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslator } from 'intor/react';
|
|
4
|
+
import { useRouter } from 'next/navigation';
|
|
5
|
+
import { Fragment } from 'react';
|
|
6
|
+
import { PAGE_MEDIA_FIELDS, PAGE_TEXT_FIELDS } from 'sitero-domain';
|
|
7
|
+
import 'mime-types';
|
|
8
|
+
import 'ua-parser-js';
|
|
9
|
+
import '../../../../../../../shared/client/react-query/client.js';
|
|
10
|
+
import '@tanstack/react-query';
|
|
11
|
+
import 'clsx';
|
|
12
|
+
import 'tailwind-merge';
|
|
13
|
+
import { createTranslationTextBinder } from '../../../../../applications/form/binders/create-translation-text-binder.js';
|
|
14
|
+
import '../../../../../../../constants/paths/redirect.js';
|
|
15
|
+
import '../../../../../../../constants/cms-locale.js';
|
|
16
|
+
import { toPageUpdateInput } from '../../../../../applications/resources/page/form-data.js';
|
|
17
|
+
import { useParentPathname } from '../../../../../applications/ui/use-parent-pathname.js';
|
|
18
|
+
import 'lucide-react';
|
|
19
|
+
import { getCmsLocalizedFieldErrors, getCmsFieldErrorMessageMap } from '../../../../../infrastructure/operation-result/presentation/message.js';
|
|
20
|
+
import { useCmsCommand } from '../../../../../infrastructure/operation-result/use-cms-command.js';
|
|
21
|
+
import '@radix-ui/react-avatar';
|
|
22
|
+
import '../../../shadcn/badge.js';
|
|
23
|
+
import '../../../shadcn/button.js';
|
|
24
|
+
import '@radix-ui/react-collapsible';
|
|
25
|
+
import '@radix-ui/react-dialog';
|
|
26
|
+
import '@radix-ui/react-dropdown-menu';
|
|
27
|
+
import '../../../shadcn/input-group.js';
|
|
28
|
+
import '@radix-ui/react-label';
|
|
29
|
+
import '@radix-ui/react-radio-group';
|
|
30
|
+
import '@radix-ui/react-select';
|
|
31
|
+
import { Separator } from '../../../shadcn/separator.js';
|
|
32
|
+
import '../../../shadcn/sidebar/sidebar.js';
|
|
33
|
+
import 'next-themes';
|
|
34
|
+
import 'sonner';
|
|
35
|
+
import '@radix-ui/react-tabs';
|
|
36
|
+
import '@radix-ui/react-tooltip';
|
|
37
|
+
import 'next/link';
|
|
38
|
+
import { ActionButtonsCard } from '../../../ui/cards/action-buttons-card.js';
|
|
39
|
+
import { Form } from '../../../ui/form/form.js';
|
|
40
|
+
import { FormField } from '../../../ui/form/form-field.js';
|
|
41
|
+
import { FieldsContainer } from '../../../ui/form/containers/fields-container.js';
|
|
42
|
+
import { MainFields } from '../../../ui/form/containers/main-fields.js';
|
|
43
|
+
import { SideFields } from '../../../ui/form/containers/side-fields.js';
|
|
44
|
+
import '../../../ui/inputs/input.js';
|
|
45
|
+
import { Textarea } from '../../../ui/inputs/textarea.js';
|
|
46
|
+
import { PickerInput } from '../../../ui/features/pick-modal/picker-input.js';
|
|
47
|
+
import 'next/image';
|
|
48
|
+
import { I18nFormField } from '../../../ui/i18n/i18n-form-field.js';
|
|
49
|
+
import '../../../ui/inputs/switch-input.js';
|
|
50
|
+
import '../../../ui/inputs/password-input.js';
|
|
51
|
+
import '../../../../../infrastructure/admin-session/admin-context.js';
|
|
52
|
+
import 'intor/next';
|
|
53
|
+
import { ContentContainer } from '../../../ui/layouts/content-container.js';
|
|
54
|
+
import { getVisiblePageFieldGroups } from './field-groups.js';
|
|
55
|
+
|
|
56
|
+
function createPageEditContent({
|
|
57
|
+
usePageUpdateFormData,
|
|
58
|
+
pageUpdateAction,
|
|
59
|
+
FileCard,
|
|
60
|
+
FileList,
|
|
61
|
+
Uploader,
|
|
62
|
+
webLocales
|
|
63
|
+
}) {
|
|
64
|
+
return function PageEditContent({
|
|
65
|
+
page,
|
|
66
|
+
pageKey,
|
|
67
|
+
isFetching,
|
|
68
|
+
isNotFound,
|
|
69
|
+
allowField,
|
|
70
|
+
fields
|
|
71
|
+
}) {
|
|
72
|
+
const { t, locale } = useTranslator();
|
|
73
|
+
const router = useRouter();
|
|
74
|
+
const parentPathname = useParentPathname();
|
|
75
|
+
const { formData, setFormData, isInitializing } = usePageUpdateFormData({
|
|
76
|
+
page
|
|
77
|
+
});
|
|
78
|
+
const bindText = createTranslationTextBinder(formData, setFormData);
|
|
79
|
+
const { execute, isPending, isRedirecting, fieldErrors } = useCmsCommand(
|
|
80
|
+
() => pageUpdateAction(
|
|
81
|
+
toPageUpdateInput({ id: page.id, pageKey, formData, allowField })
|
|
82
|
+
),
|
|
83
|
+
{ onSuccess: () => router.replace(parentPathname) }
|
|
84
|
+
);
|
|
85
|
+
const blocked = isFetching || isInitializing || isPending || isRedirecting || isNotFound;
|
|
86
|
+
const localizedErrors = getCmsLocalizedFieldErrors(
|
|
87
|
+
t,
|
|
88
|
+
locale,
|
|
89
|
+
fieldErrors
|
|
90
|
+
).map((error) => ({ ...error, path: error.path.replace(/^page\./, "") }));
|
|
91
|
+
const mediaErrors = getCmsFieldErrorMessageMap(localizedErrors);
|
|
92
|
+
const labels = {
|
|
93
|
+
title: t("resources.post.title.text"),
|
|
94
|
+
subtitle: t("resources.post.subtitle.text"),
|
|
95
|
+
description: t("resources.post.description.text"),
|
|
96
|
+
text1: `${t("resources.page.custom-text.text")} 1`,
|
|
97
|
+
text2: `${t("resources.page.custom-text.text")} 2`,
|
|
98
|
+
text3: `${t("resources.page.custom-text.text")} 3`,
|
|
99
|
+
text4: `${t("resources.page.custom-text.text")} 4`
|
|
100
|
+
};
|
|
101
|
+
const visibleGroups = getVisiblePageFieldGroups(fields);
|
|
102
|
+
return /* @__PURE__ */ jsx(ContentContainer, { isNotFound, children: /* @__PURE__ */ jsxs(
|
|
103
|
+
Form,
|
|
104
|
+
{
|
|
105
|
+
onSubmit: () => {
|
|
106
|
+
if (!blocked) void execute();
|
|
107
|
+
},
|
|
108
|
+
children: [
|
|
109
|
+
/* @__PURE__ */ jsxs(FieldsContainer, { children: [
|
|
110
|
+
/* @__PURE__ */ jsx(MainFields, { children: visibleGroups.map((group, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
111
|
+
index > 0 && /* @__PURE__ */ jsx(Separator, { className: "my-4" }),
|
|
112
|
+
group.map((field) => {
|
|
113
|
+
const config = fields[field];
|
|
114
|
+
if (!config) return null;
|
|
115
|
+
const base = field.replace(/^section\d+/, "");
|
|
116
|
+
const labelKey = base.charAt(0).toLowerCase() + base.slice(1);
|
|
117
|
+
const section = field.match(/^section(\d+)/)?.[1];
|
|
118
|
+
const mediaField = field;
|
|
119
|
+
const isMedia = PAGE_MEDIA_FIELDS.includes(field);
|
|
120
|
+
const defaultLabel = isMedia ? t("resources.page.cover-media.text") : labels[labelKey];
|
|
121
|
+
const label = config.label?.[locale] ?? (section ? `${t("resources.page.section.text")} ${section} \xB7 ${defaultLabel}` : defaultLabel);
|
|
122
|
+
if (isMedia)
|
|
123
|
+
return /* @__PURE__ */ jsx(
|
|
124
|
+
FormField,
|
|
125
|
+
{
|
|
126
|
+
controlId: mediaField,
|
|
127
|
+
label,
|
|
128
|
+
error: mediaErrors[`${mediaField}Id`],
|
|
129
|
+
children: (controlProps) => /* @__PURE__ */ jsx(
|
|
130
|
+
PickerInput,
|
|
131
|
+
{
|
|
132
|
+
title: label,
|
|
133
|
+
controlProps,
|
|
134
|
+
value: formData[mediaField],
|
|
135
|
+
onChange: (value) => setFormData((previous) => ({
|
|
136
|
+
...previous,
|
|
137
|
+
[mediaField]: value
|
|
138
|
+
})),
|
|
139
|
+
loading: isFetching,
|
|
140
|
+
disabled: blocked,
|
|
141
|
+
renderList: (props) => /* @__PURE__ */ jsx(
|
|
142
|
+
FileList,
|
|
143
|
+
{
|
|
144
|
+
...props,
|
|
145
|
+
allowedTypes: ["IMAGE", "VIDEO"]
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
renderValue: () => /* @__PURE__ */ jsx(
|
|
149
|
+
FileCard,
|
|
150
|
+
{
|
|
151
|
+
openNewTab: true,
|
|
152
|
+
file: formData[mediaField]
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
renderManagement: ({ onItemsCreated }) => /* @__PURE__ */ jsx(
|
|
156
|
+
Uploader,
|
|
157
|
+
{
|
|
158
|
+
onItemsCreated,
|
|
159
|
+
accept: "image/*,video/*"
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
)
|
|
164
|
+
},
|
|
165
|
+
field
|
|
166
|
+
);
|
|
167
|
+
if (!PAGE_TEXT_FIELDS.includes(field))
|
|
168
|
+
return null;
|
|
169
|
+
return /* @__PURE__ */ jsx(
|
|
170
|
+
I18nFormField,
|
|
171
|
+
{
|
|
172
|
+
fieldName: field,
|
|
173
|
+
label,
|
|
174
|
+
locales: webLocales,
|
|
175
|
+
translations: formData.translations,
|
|
176
|
+
errors: localizedErrors,
|
|
177
|
+
children: ({ locale: contentLocale, controlProps }) => /* @__PURE__ */ jsx(
|
|
178
|
+
Textarea,
|
|
179
|
+
{
|
|
180
|
+
placeholder: t(
|
|
181
|
+
"resources.page.text-placeholder.text"
|
|
182
|
+
),
|
|
183
|
+
...bindText(field, contentLocale),
|
|
184
|
+
...controlProps,
|
|
185
|
+
disabled: blocked
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
},
|
|
189
|
+
field
|
|
190
|
+
);
|
|
191
|
+
})
|
|
192
|
+
] }, group[0])) }),
|
|
193
|
+
/* @__PURE__ */ jsx(SideFields, { children: /* @__PURE__ */ jsx("div", { className: "max-lg:hidden", children: /* @__PURE__ */ jsx(
|
|
194
|
+
ActionButtonsCard,
|
|
195
|
+
{
|
|
196
|
+
action: "update",
|
|
197
|
+
isInitializing,
|
|
198
|
+
isProcessing: blocked
|
|
199
|
+
}
|
|
200
|
+
) }) })
|
|
201
|
+
] }),
|
|
202
|
+
/* @__PURE__ */ jsx("div", { className: "fixed bottom-3 left-1/2 z-10 -translate-x-1/2 lg:hidden", children: /* @__PURE__ */ jsx(
|
|
203
|
+
ActionButtonsCard,
|
|
204
|
+
{
|
|
205
|
+
action: "update",
|
|
206
|
+
isInitializing,
|
|
207
|
+
isProcessing: blocked
|
|
208
|
+
}
|
|
209
|
+
) })
|
|
210
|
+
]
|
|
211
|
+
}
|
|
212
|
+
) });
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export { createPageEditContent };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslator } from 'intor/react';
|
|
4
|
+
import { Fragment } from 'react';
|
|
5
|
+
import { PAGE_MEDIA_FIELDS } from 'sitero-domain';
|
|
6
|
+
import '@radix-ui/react-avatar';
|
|
7
|
+
import 'mime-types';
|
|
8
|
+
import 'ua-parser-js';
|
|
9
|
+
import '../../../../../../../shared/client/react-query/client.js';
|
|
10
|
+
import '@tanstack/react-query';
|
|
11
|
+
import 'clsx';
|
|
12
|
+
import 'tailwind-merge';
|
|
13
|
+
import '../../../shadcn/badge.js';
|
|
14
|
+
import '../../../shadcn/button.js';
|
|
15
|
+
import '@radix-ui/react-collapsible';
|
|
16
|
+
import '@radix-ui/react-dialog';
|
|
17
|
+
import 'lucide-react';
|
|
18
|
+
import '@radix-ui/react-dropdown-menu';
|
|
19
|
+
import '../../../shadcn/input-group.js';
|
|
20
|
+
import '@radix-ui/react-label';
|
|
21
|
+
import '@radix-ui/react-radio-group';
|
|
22
|
+
import '@radix-ui/react-select';
|
|
23
|
+
import { Separator } from '../../../shadcn/separator.js';
|
|
24
|
+
import '../../../shadcn/sidebar/sidebar.js';
|
|
25
|
+
import 'next-themes';
|
|
26
|
+
import 'sonner';
|
|
27
|
+
import '@radix-ui/react-tabs';
|
|
28
|
+
import '@radix-ui/react-tooltip';
|
|
29
|
+
import { Field } from '../../../ui/form/field.js';
|
|
30
|
+
import { FieldBody } from '../../../ui/form/field-body.js';
|
|
31
|
+
import { FieldsContainer } from '../../../ui/form/containers/fields-container.js';
|
|
32
|
+
import { MainFields } from '../../../ui/form/containers/main-fields.js';
|
|
33
|
+
import '../../../ui/inputs/input.js';
|
|
34
|
+
import '../../../ui/inputs/textarea.js';
|
|
35
|
+
import { I18nDisplayField } from '../../../ui/i18n/i18n-display-field.js';
|
|
36
|
+
import '../../../../../infrastructure/admin-session/admin-context.js';
|
|
37
|
+
import 'next/link';
|
|
38
|
+
import 'next/navigation';
|
|
39
|
+
import '../../../../../../../constants/paths/redirect.js';
|
|
40
|
+
import '../../../../../../../constants/cms-locale.js';
|
|
41
|
+
import 'intor/next';
|
|
42
|
+
import 'zod';
|
|
43
|
+
import { ContentContainer } from '../../../ui/layouts/content-container.js';
|
|
44
|
+
import { getVisiblePageFieldGroups } from './field-groups.js';
|
|
45
|
+
|
|
46
|
+
function createPageShowContent({
|
|
47
|
+
FileCard,
|
|
48
|
+
webLocales
|
|
49
|
+
}) {
|
|
50
|
+
return function PageShowContent({
|
|
51
|
+
page,
|
|
52
|
+
fields,
|
|
53
|
+
isFetching,
|
|
54
|
+
isNotFound
|
|
55
|
+
}) {
|
|
56
|
+
const { t, locale } = useTranslator();
|
|
57
|
+
const labels = {
|
|
58
|
+
title: t("resources.post.title.text"),
|
|
59
|
+
subtitle: t("resources.post.subtitle.text"),
|
|
60
|
+
description: t("resources.post.description.text"),
|
|
61
|
+
text1: `${t("resources.page.custom-text.text")} 1`,
|
|
62
|
+
text2: `${t("resources.page.custom-text.text")} 2`,
|
|
63
|
+
text3: `${t("resources.page.custom-text.text")} 3`,
|
|
64
|
+
text4: `${t("resources.page.custom-text.text")} 4`
|
|
65
|
+
};
|
|
66
|
+
return /* @__PURE__ */ jsx(ContentContainer, { isNotFound, children: /* @__PURE__ */ jsx(FieldsContainer, { children: /* @__PURE__ */ jsx(MainFields, { children: getVisiblePageFieldGroups(fields).map((group, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
67
|
+
index > 0 && /* @__PURE__ */ jsx(Separator, { className: "my-4" }),
|
|
68
|
+
group.map((field) => {
|
|
69
|
+
const isMedia = PAGE_MEDIA_FIELDS.includes(field);
|
|
70
|
+
const section = field.match(/^section(\d+)/)?.[1];
|
|
71
|
+
const base = field.replace(/^section\d+/, "");
|
|
72
|
+
const labelKey = base.charAt(0).toLowerCase() + base.slice(1);
|
|
73
|
+
const defaultLabel = isMedia ? t("resources.page.cover-media.text") : labels[labelKey];
|
|
74
|
+
const label = fields[field]?.label?.[locale] ?? (section ? `${t("resources.page.section.text")} ${section} \xB7 ${defaultLabel}` : defaultLabel);
|
|
75
|
+
if (isMedia)
|
|
76
|
+
return /* @__PURE__ */ jsx(Field, { label, children: /* @__PURE__ */ jsx(
|
|
77
|
+
FieldBody,
|
|
78
|
+
{
|
|
79
|
+
isLoading: isFetching,
|
|
80
|
+
isEmpty: !page?.[field],
|
|
81
|
+
children: /* @__PURE__ */ jsx(
|
|
82
|
+
FileCard,
|
|
83
|
+
{
|
|
84
|
+
file: page?.[field] ?? null,
|
|
85
|
+
openNewTab: true
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
) }, field);
|
|
90
|
+
return /* @__PURE__ */ jsx(
|
|
91
|
+
I18nDisplayField,
|
|
92
|
+
{
|
|
93
|
+
fieldName: field,
|
|
94
|
+
label,
|
|
95
|
+
locales: webLocales,
|
|
96
|
+
translations: page?.translations,
|
|
97
|
+
children: ({ value }) => /* @__PURE__ */ jsx(
|
|
98
|
+
FieldBody,
|
|
99
|
+
{
|
|
100
|
+
isLoading: isFetching,
|
|
101
|
+
isEmpty: !value,
|
|
102
|
+
className: "whitespace-pre-line",
|
|
103
|
+
children: value
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
},
|
|
107
|
+
field
|
|
108
|
+
);
|
|
109
|
+
})
|
|
110
|
+
] }, group[0])) }) }) });
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { createPageShowContent };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function resolvePageFields(rules, pageKey) {
|
|
2
|
+
return (pageKey && Object.hasOwn(rules, pageKey) ? rules[pageKey] : void 0) ?? rules.default;
|
|
3
|
+
}
|
|
4
|
+
function createAllowPageField(rules) {
|
|
5
|
+
return ({ pageKey, field }) => {
|
|
6
|
+
if (!field) return false;
|
|
7
|
+
const fields = resolvePageFields(rules, pageKey);
|
|
8
|
+
return Object.hasOwn(fields, field) && fields[field] !== void 0;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { createAllowPageField, resolvePageFields };
|
|
@@ -41,6 +41,7 @@ import { PostStateIcons } from '../post-state-icons.js';
|
|
|
41
41
|
|
|
42
42
|
const WIDTH = "200px";
|
|
43
43
|
function createCategoryCard({
|
|
44
|
+
topics = {},
|
|
44
45
|
defaultWebLocale
|
|
45
46
|
}) {
|
|
46
47
|
return function CategoryCard({
|
|
@@ -55,9 +56,10 @@ function createCategoryCard({
|
|
|
55
56
|
// base
|
|
56
57
|
className = ""
|
|
57
58
|
}) {
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
59
|
+
const resolvedTopicSlug = category.topicKey ?? topicSlug;
|
|
60
|
+
const topicT = {
|
|
61
|
+
title: topics[category.topicKey ?? ""]?.title[defaultWebLocale] ?? category.topicKey ?? ""
|
|
62
|
+
};
|
|
61
63
|
const categoryT = findTranslation(category?.translations, defaultWebLocale);
|
|
62
64
|
const href = isSubcategory ? joinUrl(
|
|
63
65
|
CMS_PATHS.content["content-management"].subcategory.pathname(
|
|
@@ -42,6 +42,7 @@ import 'next/image';
|
|
|
42
42
|
import { PostStateIcons } from '../post-state-icons.js';
|
|
43
43
|
|
|
44
44
|
function CategoryTable({
|
|
45
|
+
topics = {},
|
|
45
46
|
posts: categories,
|
|
46
47
|
contentLocale,
|
|
47
48
|
pickedItems,
|
|
@@ -60,8 +61,9 @@ function CategoryTable({
|
|
|
60
61
|
/* @__PURE__ */ jsx(TableHead, { children: t("resources.post.title.text") })
|
|
61
62
|
] }) }),
|
|
62
63
|
/* @__PURE__ */ jsx(TableBody, { children: categories.map((category) => {
|
|
63
|
-
const
|
|
64
|
-
|
|
64
|
+
const topicT = {
|
|
65
|
+
title: topics[category.topicKey ?? ""]?.title[contentLocale] ?? category.topicKey ?? ""
|
|
66
|
+
};
|
|
65
67
|
const isPicked = !!pickedItems?.some(
|
|
66
68
|
(item) => item.id === category.id
|
|
67
69
|
);
|
|
@@ -71,12 +73,12 @@ function CategoryTable({
|
|
|
71
73
|
);
|
|
72
74
|
const href = isSubcategory ? joinUrl(
|
|
73
75
|
CMS_PATHS.content["content-management"].subcategory.pathname(
|
|
74
|
-
|
|
76
|
+
category.topicKey ?? void 0
|
|
75
77
|
),
|
|
76
78
|
category?.id
|
|
77
79
|
) : joinUrl(
|
|
78
80
|
CMS_PATHS.content["content-management"].category.pathname(
|
|
79
|
-
|
|
81
|
+
category.topicKey ?? void 0
|
|
80
82
|
),
|
|
81
83
|
category?.id
|
|
82
84
|
);
|
package/dist/src/cms/client/interfaces/components/resources/post/content/post-create-content.js
CHANGED
|
@@ -89,7 +89,7 @@ function createPostCreateContent({
|
|
|
89
89
|
CategoryCard = DefaultCategoryCard,
|
|
90
90
|
CategoryTable: CategoryTable$1 = CategoryTable,
|
|
91
91
|
tagType = POST_TYPES.TAG,
|
|
92
|
-
|
|
92
|
+
topicKey,
|
|
93
93
|
// Use in post, category
|
|
94
94
|
controlMeta,
|
|
95
95
|
isFetching,
|
|
@@ -102,12 +102,12 @@ function createPostCreateContent({
|
|
|
102
102
|
const parentPathname = useParentPathname();
|
|
103
103
|
const { admin } = useAdmin();
|
|
104
104
|
const editorLocale = cmsLocale.startsWith("zh") ? "zh" : "en";
|
|
105
|
-
const topicSlug =
|
|
105
|
+
const topicSlug = topicKey;
|
|
106
106
|
const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicSlug, type, field, fieldRuleKey });
|
|
107
107
|
const { formData, setFormData } = usePostCreateFormData({
|
|
108
108
|
type: postType,
|
|
109
109
|
admin,
|
|
110
|
-
|
|
110
|
+
topicKey
|
|
111
111
|
});
|
|
112
112
|
const bindTranslationText = createTranslationTextBinder(
|
|
113
113
|
formData,
|
|
@@ -207,7 +207,7 @@ function createPostCreateContent({
|
|
|
207
207
|
)
|
|
208
208
|
],
|
|
209
209
|
type: parentType,
|
|
210
|
-
|
|
210
|
+
topicKey,
|
|
211
211
|
Card: (props) => /* @__PURE__ */ jsx(
|
|
212
212
|
CategoryCard,
|
|
213
213
|
{
|
|
@@ -230,7 +230,7 @@ function createPostCreateContent({
|
|
|
230
230
|
{
|
|
231
231
|
openNewTab: true,
|
|
232
232
|
post: parent,
|
|
233
|
-
topicSlug:
|
|
233
|
+
topicSlug: topicKey,
|
|
234
234
|
isSubcategory: isSubcategoryParent
|
|
235
235
|
},
|
|
236
236
|
parent.id
|
|
@@ -571,7 +571,7 @@ function createPostCreateContent({
|
|
|
571
571
|
)
|
|
572
572
|
],
|
|
573
573
|
type: postType,
|
|
574
|
-
|
|
574
|
+
topicKey
|
|
575
575
|
}
|
|
576
576
|
),
|
|
577
577
|
renderValue: () => formData.relatedPosts.map((relatedPost) => /* @__PURE__ */ jsx(
|
|
@@ -579,7 +579,7 @@ function createPostCreateContent({
|
|
|
579
579
|
{
|
|
580
580
|
openNewTab: true,
|
|
581
581
|
post: relatedPost,
|
|
582
|
-
topicSlug:
|
|
582
|
+
topicSlug: topicKey
|
|
583
583
|
},
|
|
584
584
|
relatedPost.id
|
|
585
585
|
))
|
|
@@ -603,7 +603,12 @@ function createPostCreateContent({
|
|
|
603
603
|
ControlFields,
|
|
604
604
|
{
|
|
605
605
|
fields: [
|
|
606
|
-
...isFieldAllowed(postType, "isActive") ? [
|
|
606
|
+
...isFieldAllowed(postType, "isActive") ? [
|
|
607
|
+
{
|
|
608
|
+
key: "isActive",
|
|
609
|
+
label: t("resources.post.is-public.text")
|
|
610
|
+
}
|
|
611
|
+
] : [],
|
|
607
612
|
...isFieldAllowed(postType, "isIndexActive") ? [{ key: "isIndexActive" }] : [],
|
|
608
613
|
...isFieldAllowed(postType, "isSlugActive") ? [{ key: "isSlugActive" }] : [],
|
|
609
614
|
...isFieldAllowed(postType, "isFeatured") ? [{ key: "isFeatured" }] : [],
|
package/dist/src/cms/client/interfaces/components/resources/post/content/post-edit-content.js
CHANGED
|
@@ -100,9 +100,8 @@ function createPostEditContent({
|
|
|
100
100
|
const parentPathname = useParentPathname();
|
|
101
101
|
const editorLocale = cmsLocale.startsWith("zh") ? "zh" : "en";
|
|
102
102
|
const id = post?.id ?? "";
|
|
103
|
-
const topic = post?.topic;
|
|
104
103
|
const slug = post?.slug;
|
|
105
|
-
const topicSlug =
|
|
104
|
+
const topicSlug = post?.topicKey ?? void 0;
|
|
106
105
|
const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicSlug, type, field, fieldRuleKey });
|
|
107
106
|
const { formData, setFormData } = usePostUpdateFormData({
|
|
108
107
|
post,
|
|
@@ -205,7 +204,7 @@ function createPostEditContent({
|
|
|
205
204
|
)
|
|
206
205
|
],
|
|
207
206
|
type: parentType,
|
|
208
|
-
|
|
207
|
+
topicKey: post?.topicKey ?? void 0,
|
|
209
208
|
Card: (props) => /* @__PURE__ */ jsx(
|
|
210
209
|
CategoryCard,
|
|
211
210
|
{
|
|
@@ -228,7 +227,7 @@ function createPostEditContent({
|
|
|
228
227
|
{
|
|
229
228
|
openNewTab: true,
|
|
230
229
|
post: parent,
|
|
231
|
-
topicSlug:
|
|
230
|
+
topicSlug: post?.topicKey ?? void 0,
|
|
232
231
|
isSubcategory: isSubcategoryParent
|
|
233
232
|
},
|
|
234
233
|
parent.id
|
|
@@ -569,7 +568,7 @@ function createPostEditContent({
|
|
|
569
568
|
)
|
|
570
569
|
],
|
|
571
570
|
type: postType,
|
|
572
|
-
|
|
571
|
+
topicKey: post?.topicKey ?? void 0,
|
|
573
572
|
excludeIds: post ? [post?.id] : void 0
|
|
574
573
|
}
|
|
575
574
|
),
|
|
@@ -578,7 +577,7 @@ function createPostEditContent({
|
|
|
578
577
|
{
|
|
579
578
|
openNewTab: true,
|
|
580
579
|
post: relatedPost,
|
|
581
|
-
topicSlug:
|
|
580
|
+
topicSlug: post?.topicKey ?? void 0
|
|
582
581
|
},
|
|
583
582
|
relatedPost.id
|
|
584
583
|
))
|
|
@@ -602,7 +601,12 @@ function createPostEditContent({
|
|
|
602
601
|
ControlFields,
|
|
603
602
|
{
|
|
604
603
|
fields: [
|
|
605
|
-
...isFieldAllowed(postType, "isActive", post?.slug) ? [
|
|
604
|
+
...isFieldAllowed(postType, "isActive", post?.slug) ? [
|
|
605
|
+
{
|
|
606
|
+
key: "isActive",
|
|
607
|
+
label: t("resources.post.is-public.text")
|
|
608
|
+
}
|
|
609
|
+
] : [],
|
|
606
610
|
...isFieldAllowed(postType, "isIndexActive", post?.slug) ? [{ key: "isIndexActive" }] : [],
|
|
607
611
|
...isFieldAllowed(postType, "isSlugActive", post?.slug) ? [{ key: "isSlugActive" }] : [],
|
|
608
612
|
...isFieldAllowed(postType, "isFeatured", post?.slug) ? [{ key: "isFeatured" }] : [],
|
package/dist/src/cms/client/interfaces/components/resources/post/content/post-show-content.js
CHANGED
|
@@ -72,7 +72,7 @@ function createPostShowContent({
|
|
|
72
72
|
}) {
|
|
73
73
|
const { t, format, locale: cmsLocale } = useTranslator();
|
|
74
74
|
const type = post?.type;
|
|
75
|
-
const topicSlug = post?.
|
|
75
|
+
const topicSlug = post?.topicKey ?? void 0;
|
|
76
76
|
const categories = post?.parents;
|
|
77
77
|
const parentLabelKey = subcategoryType && categories?.[0]?.type === subcategoryType ? "resources.subcategory.text" : "resources.category.text";
|
|
78
78
|
const isFieldAllowed = (type2, field, fieldRuleKey) => allowField({ topicSlug, type: type2, field, fieldRuleKey });
|
|
@@ -297,7 +297,12 @@ function createPostShowContent({
|
|
|
297
297
|
ControlFields,
|
|
298
298
|
{
|
|
299
299
|
fields: [
|
|
300
|
-
...isFieldAllowed(type, "isActive", post?.slug) ? [
|
|
300
|
+
...isFieldAllowed(type, "isActive", post?.slug) ? [
|
|
301
|
+
{
|
|
302
|
+
key: "isActive",
|
|
303
|
+
label: t("resources.post.is-public.text")
|
|
304
|
+
}
|
|
305
|
+
] : [],
|
|
301
306
|
...isFieldAllowed(type, "isIndexActive", post?.slug) ? [{ key: "isIndexActive" }] : [],
|
|
302
307
|
...isFieldAllowed(type, "isSlugActive", post?.slug) ? [{ key: "isSlugActive" }] : [],
|
|
303
308
|
...isFieldAllowed(type, "isFeatured", post?.slug) ? [{ key: "isFeatured" }] : [],
|
|
@@ -44,6 +44,7 @@ import { PostStateIcons } from './post-state-icons.js';
|
|
|
44
44
|
const WIDTH = "256px";
|
|
45
45
|
const HEIGHT = "256px";
|
|
46
46
|
function createPostCard({
|
|
47
|
+
topics = {},
|
|
47
48
|
SmartImage,
|
|
48
49
|
storageUrl,
|
|
49
50
|
strategies,
|
|
@@ -60,9 +61,10 @@ function createPostCard({
|
|
|
60
61
|
// base
|
|
61
62
|
className = ""
|
|
62
63
|
}) {
|
|
63
|
-
const
|
|
64
|
-
const
|
|
65
|
-
|
|
64
|
+
const resolvedTopicSlug = post.topicKey ?? topicSlug;
|
|
65
|
+
const topicT = {
|
|
66
|
+
title: topics[post.topicKey ?? ""]?.title[defaultWebLocale] ?? post.topicKey ?? ""
|
|
67
|
+
};
|
|
66
68
|
const postT = findTranslation(post.translations, defaultWebLocale);
|
|
67
69
|
const strategy = strategies?.[post.type]?.[resolvedTopicSlug ?? ""] ?? {};
|
|
68
70
|
const presentation = resolvePostPresentation(postT, strategy);
|