sitero 0.1.0 → 0.1.2
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/editor/index.js +3 -0
- package/dist/export/cms/client/components/index.js +24 -21
- package/dist/export/cms/client/i18n/index.js +1 -0
- package/dist/export/cms/client/index.js +10 -0
- package/dist/export/cms/client/pages/index.js +10 -8
- package/dist/export/core/server/index.js +8 -1
- package/dist/export/index.js +2 -1
- package/dist/export/web/server/index.js +1 -0
- package/dist/src/cms/client/applications/create-applications.js +3 -1
- package/dist/src/cms/client/applications/ui/use-nav-items.js +202 -0
- package/dist/src/cms/client/infrastructure/i18n/intor-config.js +8 -5
- package/dist/src/cms/client/infrastructure/i18n/messages/en-US/resources/admin.js +1 -1
- package/dist/src/cms/client/infrastructure/i18n/messages/en-US/resources/index.js +1 -0
- package/dist/src/cms/client/infrastructure/i18n/messages/index.js +9 -0
- package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/admin.js +1 -1
- package/dist/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/index.js +1 -0
- package/dist/src/cms/client/interfaces/components/create-components.js +25 -24
- package/dist/src/cms/client/interfaces/components/create-post-contents.js +85 -0
- package/dist/src/cms/client/interfaces/components/resources/admin/admin-card.js +6 -2
- package/dist/src/cms/client/interfaces/components/resources/admin/admin-refresh-tokens/admin-refresh-token-card.js +3 -0
- package/dist/src/cms/client/interfaces/components/resources/admin/admin-relations-section.js +2 -3
- package/dist/src/cms/client/interfaces/components/resources/admin/admin-table.js +3 -2
- package/dist/src/cms/client/interfaces/components/resources/config/config-edit-content.js +19 -2
- package/dist/src/cms/client/interfaces/components/resources/file/file-card.js +3 -0
- package/dist/src/cms/client/interfaces/components/resources/file/file-relations-section.js +2 -3
- package/dist/src/cms/client/interfaces/components/resources/file/file-state-icons.js +1 -2
- package/dist/src/cms/client/interfaces/components/resources/file/file-table.js +0 -1
- package/dist/src/cms/client/interfaces/components/resources/file/search/is-locked-buttons.js +6 -0
- package/dist/src/cms/client/interfaces/components/resources/file/search/type-buttons.js +6 -0
- package/dist/src/cms/client/interfaces/components/resources/folder/file-manager/file-manager-header.js +1 -2
- package/dist/src/cms/client/interfaces/components/resources/folder/file-manager/file-manager-list.js +0 -1
- package/dist/src/cms/client/interfaces/components/resources/folder/folder-card.js +3 -0
- package/dist/src/cms/client/interfaces/components/resources/folder/folder-list.js +0 -1
- package/dist/src/cms/client/interfaces/components/resources/folder/folder-relations-section.js +0 -1
- package/dist/src/cms/client/interfaces/components/resources/folder/folder-state-icons.js +1 -2
- package/dist/src/cms/client/interfaces/components/resources/folder/folder-table.js +0 -1
- package/dist/src/cms/client/interfaces/components/resources/inquiry/inquiry-card.js +3 -0
- package/dist/src/cms/client/interfaces/components/resources/{category → post/category}/category-card.js +25 -19
- package/dist/src/cms/client/interfaces/components/resources/{category → post/category}/category-relations-section.js +25 -18
- package/dist/src/cms/client/interfaces/components/resources/{category → post/category}/category-table.js +27 -21
- package/dist/src/cms/client/interfaces/components/resources/post/content/post-create-content.js +462 -0
- package/dist/src/cms/client/interfaces/components/resources/post/content/post-edit-content.js +460 -0
- package/dist/src/cms/client/interfaces/components/resources/post/content/post-show-content.js +217 -0
- package/dist/src/cms/client/interfaces/components/resources/post/content/types.js +12 -0
- package/dist/src/cms/client/interfaces/components/resources/post/post-card.js +16 -71
- package/dist/src/cms/client/interfaces/components/resources/post/post-list.js +3 -6
- package/dist/src/cms/client/interfaces/components/resources/post/post-relations-section.js +0 -1
- package/dist/src/cms/client/interfaces/components/resources/post/post-table.js +0 -1
- package/dist/src/cms/client/interfaces/components/resources/post/search/control-fields-buttons.js +9 -50
- package/dist/src/cms/client/interfaces/components/resources/{tag → post/tag}/tag-card.js +18 -17
- package/dist/src/cms/client/interfaces/components/resources/{tag → post/tag}/tag-relations-section.js +13 -14
- package/dist/src/cms/client/interfaces/components/resources/{tag → post/tag}/tag-table.js +19 -17
- package/dist/src/cms/client/interfaces/components/resources/{topic → post/topic}/topic-card.js +28 -22
- package/dist/src/cms/client/interfaces/components/resources/{topic → post/topic}/topic-table.js +31 -24
- package/dist/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/fields/basic-tags.js +1 -2
- package/dist/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/fields/json-ld-tags.js +1 -2
- package/dist/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/fields/open-graph-tags.js +1 -2
- package/dist/src/cms/client/interfaces/components/resources/seo-metadata/seo-form/fields/twitter-tags.js +1 -2
- package/dist/src/cms/client/interfaces/components/resources/seo-metadata/seo-metadata-dialog.js +5 -0
- package/dist/src/cms/client/interfaces/components/ui/blocks/list-container/list-container.js +5 -0
- package/dist/src/cms/client/interfaces/components/ui/blocks/list-container/page-size-selector.js +5 -0
- package/dist/src/cms/client/interfaces/components/ui/blocks/page-header/page-header.js +6 -1
- package/dist/src/cms/client/interfaces/components/ui/blocks/page-header/presets/index.js +11 -0
- package/dist/src/cms/client/interfaces/components/ui/buttons/return-button.js +6 -0
- package/dist/src/cms/client/interfaces/components/ui/features/external-link.js +6 -0
- package/dist/src/cms/client/interfaces/components/ui/features/file/file-info/file-info.js +4 -1
- package/dist/src/cms/client/interfaces/components/ui/features/file/file-preview/file-preview-list.js +6 -0
- package/dist/src/cms/client/interfaces/components/ui/features/file/uploader.js +0 -1
- package/dist/src/cms/client/interfaces/components/ui/features/pick-modal/pick-modal-body.js +7 -4
- package/dist/src/cms/client/interfaces/components/ui/features/pick-modal/pick-modal-trigger.js +5 -0
- package/dist/src/cms/client/interfaces/components/ui/features/pick-modal/pick-modal.js +5 -0
- package/dist/src/cms/client/interfaces/components/ui/form/index-field.js +1 -0
- package/dist/src/cms/client/interfaces/components/ui/i18n/display/i18n-array-display.js +4 -1
- package/dist/src/cms/client/interfaces/components/ui/i18n/display/i18n-display.js +4 -1
- package/dist/src/cms/client/interfaces/components/ui/i18n/display/i18n-object-array-display.js +4 -1
- package/dist/src/cms/client/interfaces/components/ui/i18n/inputs/i18n-array-input.js +5 -0
- package/dist/src/cms/client/interfaces/components/ui/i18n/inputs/i18n-date-input.js +5 -0
- package/dist/src/cms/client/interfaces/components/ui/i18n/inputs/i18n-input.js +5 -0
- package/dist/src/cms/client/interfaces/components/ui/i18n/inputs/i18n-json-input.js +6 -1
- package/dist/src/cms/client/interfaces/components/ui/i18n/inputs/i18n-number-input.js +5 -0
- package/dist/src/cms/client/interfaces/components/ui/i18n/inputs/i18n-object-array-input.js +5 -0
- package/dist/src/cms/client/interfaces/components/ui/i18n/inputs/i18n-textarea.js +5 -0
- package/dist/src/cms/client/interfaces/components/ui/inputs/array-input.js +5 -0
- package/dist/src/cms/client/interfaces/components/ui/inputs/editor/base/built-in-plugins.js +1 -2
- package/dist/src/cms/client/interfaces/components/ui/inputs/editor/editor.js +0 -1
- package/dist/src/cms/client/interfaces/components/ui/inputs/editor/plugins/file-repository/upload-adapter.js +1 -2
- package/dist/src/cms/client/interfaces/components/ui/layouts/navbar/i18n-selector.js +4 -0
- package/dist/src/cms/client/interfaces/components/ui/layouts/navbar/theme-selector.js +5 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/edit/page.js +19 -4
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/_id_/page.js +42 -4
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/category/create/page.js +20 -5
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/page.js +97 -40
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/edit/page.js +33 -5
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/_id_/page.js +34 -4
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/post/create/page.js +33 -5
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/edit/page.js +114 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/_id_/page.js +169 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/_topicSlug_/subcategory/create/page.js +116 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/page.js +7 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/_id_/edit/page.js +99 -0
- package/dist/src/cms/client/interfaces/pages/dashboard/content/{tag → content-management/tag}/_id_/page.js +39 -22
- package/dist/src/cms/client/interfaces/pages/dashboard/content/{tag/_id_/edit → content-management/tag/create}/page.js +23 -26
- package/dist/src/cms/client/interfaces/pages/dashboard/content/{tag/create → content-management/tag}/page.js +42 -27
- package/dist/src/cms/client/interfaces/pages/dashboard/content/{topic → content-management/topic}/_id_/edit/page.js +31 -15
- package/dist/src/cms/client/interfaces/pages/dashboard/content/{topic → content-management/topic}/_id_/page.js +35 -36
- package/dist/src/cms/client/interfaces/pages/dashboard/content/{topic/create → content-management/topic}/page.js +40 -15
- package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/_id_/admin-refresh-token/page.js +0 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/_id_/edit/page.js +3 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/_id_/page.js +3 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/system/access/admin/create/page.js +3 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/system/access/page.js +2 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/_id_/edit/page.js +0 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/_id_/page.js +0 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/create/page.js +0 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/create-many/page.js +0 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/file/delete-many/page.js +0 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/folder/_id_/edit/page.js +0 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/folder/_id_/page.js +0 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/folder/create/page.js +0 -1
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/page.js +2 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/system/storage/trash/page.js +1 -2
- package/dist/src/cms/client/interfaces/pages/dashboard/website/website-page/_slug_/page.js +0 -1
- package/dist/src/constants/paths/cms-paths.js +7 -4
- package/dist/src/core/domain/static/topics.js +29 -0
- package/dist/src/core/server/create-core-server.js +0 -1
- package/dist/src/core/server/infrastructure/database/file/query/file-query-repository.js +1 -1
- package/dist/src/core/server/infrastructure/database/folder/query/folder-query-repository.js +1 -1
- package/dist/src/core/server/infrastructure/database/post/command/post-command-repository.js +6 -151
- package/dist/src/core/server/infrastructure/database/post/command/post-create-data.js +81 -0
- package/dist/src/core/server/infrastructure/database/post/command/post-update-data.js +86 -0
- package/dist/src/core/server/infrastructure/i18n/messages/index.js +9 -0
- package/dist/src/core/server/interfaces/actions/resources/file/commands/purge-many/file-purge-many-action.js +1 -1
- package/dist/src/core/server/interfaces/actions/resources/file/commands/soft-delete/file-soft-delete-action.js +1 -1
- package/dist/src/core/server/interfaces/actions/resources/file/commands/soft-delete-many/file-soft-delete-many-action.js +1 -1
- package/dist/src/core/server/interfaces/actions/resources/folder/commands/delete/folder-delete-action.js +1 -1
- package/dist/src/core/server/interfaces/actions/resources/folder/queries/folder-find-full-action.js +1 -1
- package/dist/src/core/server/seeders/folder/seeder.js +1 -1
- package/dist/src/web/server/applications/sitemap/get-post-items.js +46 -6
- package/dist/src/web/server/applications/sitemap/get-subcategory-items.js +34 -0
- package/dist/src/web/server/create-web-server.js +0 -1
- package/dist/src/web/server/interfaces/actions/resources/config/queries/config-find-action.js +0 -1
- package/dist/src/web/server/interfaces/actions/resources/post/queries/post-find-full-action.js +0 -1
- package/dist/src/web/server/interfaces/create-web-interfaces.js +4 -0
- package/dist/src/web/server/interfaces/loaders/load-categories.js +6 -4
- package/dist/src/web/server/interfaces/loaders/load-category.js +8 -2
- package/dist/src/web/server/interfaces/loaders/load-post.js +8 -2
- package/dist/src/web/server/interfaces/loaders/load-posts.js +7 -3
- package/dist/src/web/server/interfaces/loaders/load-subcategories.js +60 -0
- package/dist/src/web/server/interfaces/loaders/load-subcategory.js +27 -0
- package/dist/types/export/cms/client/components/index.d.ts +4 -1
- package/dist/types/export/cms/client/components/index.d.ts.map +1 -1
- package/dist/types/export/cms/client/i18n/index.d.ts +1 -1
- package/dist/types/export/cms/client/i18n/index.d.ts.map +1 -1
- package/dist/types/export/cms/client/index.d.ts +1 -1
- package/dist/types/export/cms/client/index.d.ts.map +1 -1
- package/dist/types/export/cms/client/pages/index.d.ts +1 -1
- package/dist/types/export/cms/client/pages/index.d.ts.map +1 -1
- package/dist/types/export/core/server/index.d.ts +6 -1
- package/dist/types/export/core/server/index.d.ts.map +1 -1
- package/dist/types/export/index.d.ts +2 -2
- package/dist/types/export/index.d.ts.map +1 -1
- package/dist/types/export/web/server/index.d.ts +1 -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/resources/post/use-create-form-data.d.ts +1 -1
- 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/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/index.d.ts +1 -0
- package/dist/types/src/cms/client/applications/ui/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/applications/ui/use-nav-items.d.ts +20 -0
- package/dist/types/src/cms/client/applications/ui/use-nav-items.d.ts.map +1 -0
- package/dist/types/src/cms/client/infrastructure/i18n/index.d.ts +1 -0
- package/dist/types/src/cms/client/infrastructure/i18n/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/intor-config.d.ts.map +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/index.d.ts +4 -1
- 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/admin.d.ts +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/en-US/resources/index.d.ts +4 -1
- 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/index.d.ts +1347 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/index.d.ts +4 -1
- 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/admin.d.ts +1 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/index.d.ts +4 -1
- package/dist/types/src/cms/client/infrastructure/i18n/messages/zh-TW/resources/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/create-components.d.ts +10 -5
- package/dist/types/src/cms/client/interfaces/components/create-components.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/create-post-contents.d.ts +38 -0
- package/dist/types/src/cms/client/interfaces/components/create-post-contents.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/admin/admin-card.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/admin/admin-relations-section.d.ts +1 -2
- package/dist/types/src/cms/client/interfaces/components/resources/admin/admin-relations-section.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/admin/admin-table.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/config/config-edit-content.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/config/config-edit-content.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/file/file-relations-section.d.ts +1 -2
- package/dist/types/src/cms/client/interfaces/components/resources/file/file-relations-section.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/index.d.ts +5 -4
- package/dist/types/src/cms/client/interfaces/components/resources/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-card.d.ts +8 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-card.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/{category → post/category}/category-relations-section.d.ts +4 -4
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-relations-section.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-table.d.ts +8 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/category-table.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/category/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/index.d.ts +6 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-create-content.d.ts +46 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-create-content.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-edit-content.d.ts +45 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-edit-content.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-show-content.d.ts +26 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/post-show-content.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/types.d.ts +19 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/content/types.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/index.d.ts +2 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-card.d.ts +1 -8
- 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 +4 -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-relations-section.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/post-relations-section.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/search/control-fields-buttons.d.ts +0 -2
- package/dist/types/src/cms/client/interfaces/components/resources/post/search/control-fields-buttons.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/tag/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/{tag → post/tag}/tag-card.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/tag/tag-card.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/{tag → post/tag}/tag-relations-section.d.ts +4 -4
- package/dist/types/src/cms/client/interfaces/components/resources/post/tag/tag-relations-section.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/{tag → post/tag}/tag-table.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/resources/post/tag/tag-table.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/{topic → post/topic}/topic-card.d.ts +2 -2
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-card.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/resources/{topic → post/topic}/topic-table.d.ts +2 -2
- package/dist/types/src/cms/client/interfaces/components/resources/post/topic/topic-table.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/components/ui/blocks/page-header/presets/index.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/blocks/page-header/types.d.ts +1 -0
- package/dist/types/src/cms/client/interfaces/components/ui/blocks/page-header/types.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/features/pick-modal/pick-modal.d.ts +2 -1
- package/dist/types/src/cms/client/interfaces/components/ui/features/pick-modal/pick-modal.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/form/index-field.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/i18n/display/i18n-array-display.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/i18n/display/i18n-display.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/i18n/display/i18n-object-array-display.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/i18n/inputs/i18n-json-input.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/inputs/editor/base/built-in-plugins.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/layouts/content-container.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/layouts/content-container.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/layouts/sidebar/nav-main.d.ts +1 -1
- package/dist/types/src/cms/client/interfaces/components/ui/layouts/sidebar/nav-main.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/category/[id]/edit/page.d.ts +6 -2
- 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 +6 -3
- 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/create/page.d.ts +6 -2
- 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 +3 -3
- 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 +6 -2
- 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 +7 -3
- 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/create/page.d.ts +6 -2
- 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 +24 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/edit/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/page.d.ts +27 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/[id]/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/create/page.d.ts +24 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/create/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/index.d.ts +4 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/[topicSlug]/subcategory/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/page.d.ts +3 -1
- 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]/edit/page.d.ts +20 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/[id]/edit/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/[id]/page.d.ts +23 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/[id]/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/create/page.d.ts +16 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/create/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/page.d.ts +14 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/tag/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/edit/page.d.ts +20 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/edit/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/page.d.ts +20 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/[id]/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/{topic → content-management/topic}/index.d.ts +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/index.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/page.d.ts +14 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/content-management/topic/page.d.ts.map +1 -0
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/access/admin/[id]/edit/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/access/admin/[id]/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/system/access/admin/create/page.d.ts.map +1 -1
- package/dist/types/src/cms/client/interfaces/pages/index.d.ts +3 -2
- package/dist/types/src/cms/client/interfaces/pages/index.d.ts.map +1 -1
- package/dist/types/src/constants/paths/cms-paths.d.ts +9 -6
- package/dist/types/src/constants/paths/cms-paths.d.ts.map +1 -1
- package/dist/types/src/core/domain/index.d.ts +2 -2
- package/dist/types/src/core/domain/index.d.ts.map +1 -1
- package/dist/types/src/core/domain/resources/admin/index.d.ts +0 -1
- package/dist/types/src/core/domain/resources/admin/index.d.ts.map +1 -1
- package/dist/types/src/core/domain/resources/index.d.ts +1 -1
- package/dist/types/src/core/domain/resources/index.d.ts.map +1 -1
- package/dist/types/src/core/domain/static/index.d.ts +1 -1
- package/dist/types/src/core/domain/static/index.d.ts.map +1 -1
- package/dist/types/src/core/domain/static/post.d.ts +1 -1
- package/dist/types/src/core/domain/static/post.d.ts.map +1 -1
- package/dist/types/src/core/domain/static/topics.d.ts +36 -3
- package/dist/types/src/core/domain/static/topics.d.ts.map +1 -1
- package/dist/types/src/core/server/infrastructure/database/index.d.ts +1 -1
- package/dist/types/src/core/server/infrastructure/database/index.d.ts.map +1 -1
- package/dist/types/src/core/server/infrastructure/database/post/command/index.d.ts +2 -0
- package/dist/types/src/core/server/infrastructure/database/post/command/index.d.ts.map +1 -1
- package/dist/types/src/core/server/infrastructure/database/post/command/post-command-repository.d.ts +2 -2
- package/dist/types/src/core/server/infrastructure/database/post/command/post-command-repository.d.ts.map +1 -1
- package/dist/types/src/core/server/infrastructure/database/post/command/post-create-data.d.ts +160 -0
- package/dist/types/src/core/server/infrastructure/database/post/command/post-create-data.d.ts.map +1 -0
- package/dist/types/src/core/server/infrastructure/database/post/command/post-update-data.d.ts +207 -0
- package/dist/types/src/core/server/infrastructure/database/post/command/post-update-data.d.ts.map +1 -0
- package/dist/types/src/core/server/infrastructure/database/post/index.d.ts +1 -1
- package/dist/types/src/core/server/infrastructure/database/post/index.d.ts.map +1 -1
- package/dist/types/src/core/server/infrastructure/i18n/index.d.ts +1 -0
- package/dist/types/src/core/server/infrastructure/i18n/index.d.ts.map +1 -1
- package/dist/types/src/core/server/infrastructure/i18n/messages/index.d.ts +105 -0
- package/dist/types/src/core/server/infrastructure/i18n/messages/index.d.ts.map +1 -0
- package/dist/types/src/core/server/infrastructure/index.d.ts +1 -1
- package/dist/types/src/core/server/infrastructure/index.d.ts.map +1 -1
- package/dist/types/src/shared/form/types.d.ts +2 -2
- package/dist/types/src/shared/form/types.d.ts.map +1 -1
- package/dist/types/src/web/server/applications/index.d.ts +1 -1
- package/dist/types/src/web/server/applications/index.d.ts.map +1 -1
- package/dist/types/src/web/server/applications/sitemap/get-post-items.d.ts +3 -1
- package/dist/types/src/web/server/applications/sitemap/get-post-items.d.ts.map +1 -1
- package/dist/types/src/web/server/applications/sitemap/get-subcategory-items.d.ts +18 -0
- package/dist/types/src/web/server/applications/sitemap/get-subcategory-items.d.ts.map +1 -0
- package/dist/types/src/web/server/applications/sitemap/index.d.ts +1 -0
- package/dist/types/src/web/server/applications/sitemap/index.d.ts.map +1 -1
- package/dist/types/src/web/server/index.d.ts +1 -0
- package/dist/types/src/web/server/index.d.ts.map +1 -1
- package/dist/types/src/web/server/interfaces/create-web-interfaces.d.ts.map +1 -1
- package/dist/types/src/web/server/interfaces/loaders/index.d.ts +2 -0
- package/dist/types/src/web/server/interfaces/loaders/index.d.ts.map +1 -1
- package/dist/types/src/web/server/interfaces/loaders/load-categories.d.ts.map +1 -1
- package/dist/types/src/web/server/interfaces/loaders/load-category.d.ts.map +1 -1
- package/dist/types/src/web/server/interfaces/loaders/load-post.d.ts.map +1 -1
- package/dist/types/src/web/server/interfaces/loaders/load-posts.d.ts.map +1 -1
- package/dist/types/src/web/server/interfaces/loaders/load-subcategories.d.ts +10 -0
- package/dist/types/src/web/server/interfaces/loaders/load-subcategories.d.ts.map +1 -0
- package/dist/types/src/web/server/interfaces/loaders/load-subcategory.d.ts +8 -0
- package/dist/types/src/web/server/interfaces/loaders/load-subcategory.d.ts.map +1 -0
- package/dist/types/src/web/server/interfaces/types.d.ts +3 -1
- package/dist/types/src/web/server/interfaces/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/src/cms/client/interfaces/pages/dashboard/content/tag/page.js +0 -81
- package/dist/src/cms/client/interfaces/pages/dashboard/content/topic/page.js +0 -79
- package/dist/src/core/domain/resources/admin/constants.js +0 -9
- package/dist/types/src/cms/client/interfaces/components/resources/category/category-card.d.ts +0 -3
- package/dist/types/src/cms/client/interfaces/components/resources/category/category-card.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/category/category-relations-section.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/category/category-table.d.ts +0 -3
- package/dist/types/src/cms/client/interfaces/components/resources/category/category-table.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/category/index.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/tag/index.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/tag/tag-card.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/tag/tag-relations-section.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/tag/tag-table.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/topic/index.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/topic/topic-card.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/components/resources/topic/topic-table.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/tag/[id]/edit/page.d.ts +0 -15
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/tag/[id]/edit/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/tag/[id]/page.d.ts +0 -17
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/tag/[id]/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/tag/create/page.d.ts +0 -11
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/tag/create/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/tag/index.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/tag/page.d.ts +0 -8
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/tag/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/topic/[id]/edit/page.d.ts +0 -15
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/topic/[id]/edit/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/topic/[id]/page.d.ts +0 -17
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/topic/[id]/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/topic/create/page.d.ts +0 -11
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/topic/create/page.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/topic/index.d.ts.map +0 -1
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/topic/page.d.ts +0 -12
- package/dist/types/src/cms/client/interfaces/pages/dashboard/content/topic/page.d.ts.map +0 -1
- package/dist/types/src/core/domain/resources/admin/constants.d.ts +0 -4
- package/dist/types/src/core/domain/resources/admin/constants.d.ts.map +0 -1
- package/dist/types/src/core/domain/translation.d.ts +0 -7
- package/dist/types/src/core/domain/translation.d.ts.map +0 -1
- /package/dist/types/src/cms/client/interfaces/components/resources/{category → post/category}/index.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/components/resources/{tag → post/tag}/index.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/components/resources/{topic → post/topic}/index.d.ts +0 -0
- /package/dist/types/src/cms/client/interfaces/pages/dashboard/content/{tag → content-management/tag}/index.d.ts +0 -0
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslator } from 'intor/react';
|
|
4
|
+
import { useRouter } from 'next/navigation';
|
|
5
|
+
import { POST_TYPES } from 'sitero-domain';
|
|
6
|
+
import '../../../../../../../constants/paths/redirect.js';
|
|
7
|
+
import '../../../../../../../constants/cms-locale.js';
|
|
8
|
+
import '../../../../../../../core/client/infrastructure/contexts/admin/admin.js';
|
|
9
|
+
import 'react';
|
|
10
|
+
import '../../../../../../../core/client/infrastructure/react-query/client.js';
|
|
11
|
+
import '@tanstack/react-query';
|
|
12
|
+
import { useCommand } from '../../../../../../../core/client/infrastructure/react-query/use-command.js';
|
|
13
|
+
import 'mime-types';
|
|
14
|
+
import 'clsx';
|
|
15
|
+
import 'tailwind-merge';
|
|
16
|
+
import 'zod';
|
|
17
|
+
import { getImgIdsFromHtmls } from '../../../../../applications/form/get-img-ids-from-htmls.js';
|
|
18
|
+
import { processContentHtml } from '../../../../../applications/form/process-content-html.js';
|
|
19
|
+
import { useParentPathname } from '../../../../../applications/ui/use-parent-pathname.js';
|
|
20
|
+
import 'lucide-react';
|
|
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 { Form } from '../../../ui/form/form.js';
|
|
39
|
+
import { Field } from '../../../ui/form/field.js';
|
|
40
|
+
import { FieldsContainer } from '../../../ui/form/containers/fields-container.js';
|
|
41
|
+
import { MainFields } from '../../../ui/form/containers/main-fields.js';
|
|
42
|
+
import { SideFields } from '../../../ui/form/containers/side-fields.js';
|
|
43
|
+
import { ControlFields } from '../../../ui/form/control-fields/control-fields.js';
|
|
44
|
+
import { ActionButtonsCard } from '../../../ui/cards/action-buttons-card.js';
|
|
45
|
+
import { PickModal } from '../../../ui/features/pick-modal/pick-modal.js';
|
|
46
|
+
import 'next/image';
|
|
47
|
+
import 'intor/next';
|
|
48
|
+
import { ContentContainer } from '../../../ui/layouts/content-container.js';
|
|
49
|
+
import { AdminCard } from '../../admin/admin-card.js';
|
|
50
|
+
import { CategoryCard } from '../category/category-card.js';
|
|
51
|
+
import { CategoryTable } from '../category/category-table.js';
|
|
52
|
+
import { TagCard } from '../tag/tag-card.js';
|
|
53
|
+
import { TagTable } from '../tag/tag-table.js';
|
|
54
|
+
|
|
55
|
+
function createPostEditContent({
|
|
56
|
+
usePostUpdateFormData,
|
|
57
|
+
postUpdateAction,
|
|
58
|
+
AdminList,
|
|
59
|
+
PostList,
|
|
60
|
+
PostCard,
|
|
61
|
+
FileList,
|
|
62
|
+
FileCard,
|
|
63
|
+
Uploader,
|
|
64
|
+
I18nTextarea,
|
|
65
|
+
I18nEditor,
|
|
66
|
+
I18nObjectArrayInput,
|
|
67
|
+
I18nNumberInput
|
|
68
|
+
}) {
|
|
69
|
+
return function PostEditContent({
|
|
70
|
+
postType,
|
|
71
|
+
parentType,
|
|
72
|
+
parentLabelKey,
|
|
73
|
+
isSubcategoryParent = false,
|
|
74
|
+
CategoryCard: CategoryCard$1 = CategoryCard,
|
|
75
|
+
CategoryTable: CategoryTable$1 = CategoryTable,
|
|
76
|
+
tagType = POST_TYPES.TAG,
|
|
77
|
+
post,
|
|
78
|
+
controlMeta,
|
|
79
|
+
isFetching,
|
|
80
|
+
isNotFound,
|
|
81
|
+
allowField
|
|
82
|
+
}) {
|
|
83
|
+
const { t, locale } = useTranslator();
|
|
84
|
+
const router = useRouter();
|
|
85
|
+
const parentPathname = useParentPathname();
|
|
86
|
+
const id = post?.id ?? "";
|
|
87
|
+
const topic = post?.topic;
|
|
88
|
+
const slug = post?.slug;
|
|
89
|
+
const topicSlug = topic?.slug;
|
|
90
|
+
const isFieldAllowed = (type, field, fieldRuleKey) => allowField({ topicSlug, type, field, fieldRuleKey });
|
|
91
|
+
const { formData, setFormData } = usePostUpdateFormData({
|
|
92
|
+
post,
|
|
93
|
+
type: postType
|
|
94
|
+
});
|
|
95
|
+
const { execute, isRedirecting, errors } = useCommand(
|
|
96
|
+
() => {
|
|
97
|
+
const contentImageIds = getImgIdsFromHtmls(
|
|
98
|
+
formData.translations.map((t2) => t2.content ?? "")
|
|
99
|
+
);
|
|
100
|
+
const translations = formData.translations.map((t2) => {
|
|
101
|
+
const { content, toc } = processContentHtml(t2.content);
|
|
102
|
+
return { ...t2, content, toc };
|
|
103
|
+
});
|
|
104
|
+
return postUpdateAction({
|
|
105
|
+
id,
|
|
106
|
+
formData: { ...formData, contentImageIds, translations }
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
{ onSuccess: () => router.replace(parentPathname) }
|
|
110
|
+
);
|
|
111
|
+
return /* @__PURE__ */ jsx(ContentContainer, { isNotFound, children: /* @__PURE__ */ jsxs(Form, { onSubmit: () => void execute(), children: [
|
|
112
|
+
/* @__PURE__ */ jsxs(FieldsContainer, { children: [
|
|
113
|
+
/* @__PURE__ */ jsxs(MainFields, { children: [
|
|
114
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
115
|
+
isFieldAllowed(postType, "author", slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.author.text"), children: /* @__PURE__ */ jsx(
|
|
116
|
+
PickModal,
|
|
117
|
+
{
|
|
118
|
+
fieldName: "author",
|
|
119
|
+
formData,
|
|
120
|
+
setFormData,
|
|
121
|
+
isLoading: isFetching,
|
|
122
|
+
isDisabled: isRedirecting,
|
|
123
|
+
itemList: /* @__PURE__ */ jsx(AdminList, {}),
|
|
124
|
+
pickedDisplay: /* @__PURE__ */ jsx(AdminCard, { admin: formData.author })
|
|
125
|
+
}
|
|
126
|
+
) }),
|
|
127
|
+
isFieldAllowed(postType, "parents", slug) && parentType && /* @__PURE__ */ jsx(Field, { label: t(parentLabelKey ?? "resources.category.text"), children: /* @__PURE__ */ jsx(
|
|
128
|
+
PickModal,
|
|
129
|
+
{
|
|
130
|
+
fieldName: "parents",
|
|
131
|
+
formData,
|
|
132
|
+
setFormData,
|
|
133
|
+
isLoading: isFetching,
|
|
134
|
+
isDisabled: isRedirecting,
|
|
135
|
+
isMultiPick: true,
|
|
136
|
+
itemList: /* @__PURE__ */ jsx(
|
|
137
|
+
PostList,
|
|
138
|
+
{
|
|
139
|
+
usableFields: [
|
|
140
|
+
...isFieldAllowed(parentType, "isActive") ? ["isActive"] : [],
|
|
141
|
+
...isFieldAllowed(parentType, "isIndexActive") ? ["isIndexActive"] : [],
|
|
142
|
+
...isFieldAllowed(parentType, "isSlugActive") ? ["isSlugActive"] : [],
|
|
143
|
+
...isFieldAllowed(parentType, "isFeatured") ? ["isFeatured"] : [],
|
|
144
|
+
...isFieldAllowed(parentType, "isShownOnHome") ? ["isShownOnHome"] : []
|
|
145
|
+
],
|
|
146
|
+
type: parentType,
|
|
147
|
+
topicId: topic?.id,
|
|
148
|
+
Card: (props) => /* @__PURE__ */ jsx(
|
|
149
|
+
CategoryCard$1,
|
|
150
|
+
{
|
|
151
|
+
...props,
|
|
152
|
+
isSubcategory: isSubcategoryParent
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
Table: (props) => /* @__PURE__ */ jsx(
|
|
156
|
+
CategoryTable$1,
|
|
157
|
+
{
|
|
158
|
+
...props,
|
|
159
|
+
isSubcategory: isSubcategoryParent
|
|
160
|
+
}
|
|
161
|
+
),
|
|
162
|
+
localKey: `parent-${parentType}`
|
|
163
|
+
}
|
|
164
|
+
),
|
|
165
|
+
pickedDisplay: formData.parents.map((parent) => /* @__PURE__ */ jsx(
|
|
166
|
+
CategoryCard$1,
|
|
167
|
+
{
|
|
168
|
+
post: parent,
|
|
169
|
+
isSubcategory: isSubcategoryParent
|
|
170
|
+
},
|
|
171
|
+
parent.id
|
|
172
|
+
))
|
|
173
|
+
}
|
|
174
|
+
) }),
|
|
175
|
+
isFieldAllowed(postType, "tags", slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.tag.text"), children: /* @__PURE__ */ jsx(
|
|
176
|
+
PickModal,
|
|
177
|
+
{
|
|
178
|
+
fieldName: "tags",
|
|
179
|
+
formData,
|
|
180
|
+
setFormData,
|
|
181
|
+
isLoading: isFetching,
|
|
182
|
+
isDisabled: isRedirecting,
|
|
183
|
+
isMultiPick: true,
|
|
184
|
+
itemList: /* @__PURE__ */ jsx(
|
|
185
|
+
PostList,
|
|
186
|
+
{
|
|
187
|
+
usableFields: [
|
|
188
|
+
...isFieldAllowed(tagType, "isActive") ? ["isActive"] : [],
|
|
189
|
+
...isFieldAllowed(tagType, "isIndexActive") ? ["isIndexActive"] : [],
|
|
190
|
+
...isFieldAllowed(tagType, "isSlugActive") ? ["isSlugActive"] : [],
|
|
191
|
+
...isFieldAllowed(tagType, "isFeatured") ? ["isFeatured"] : [],
|
|
192
|
+
...isFieldAllowed(tagType, "isShownOnHome") ? ["isShownOnHome"] : []
|
|
193
|
+
],
|
|
194
|
+
type: tagType,
|
|
195
|
+
Card: TagCard,
|
|
196
|
+
Table: TagTable,
|
|
197
|
+
localKey: "tag"
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
pickedDisplay: formData.tags.map((tag) => /* @__PURE__ */ jsx(TagCard, { post: tag }, tag.id))
|
|
201
|
+
}
|
|
202
|
+
) }),
|
|
203
|
+
isFieldAllowed(postType, "coverImage", slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.cover-image.text"), children: /* @__PURE__ */ jsx(
|
|
204
|
+
PickModal,
|
|
205
|
+
{
|
|
206
|
+
fieldName: "coverImage",
|
|
207
|
+
formData,
|
|
208
|
+
setFormData,
|
|
209
|
+
isLoading: isFetching,
|
|
210
|
+
isDisabled: isRedirecting,
|
|
211
|
+
itemList: /* @__PURE__ */ jsx(FileList, {}),
|
|
212
|
+
pickedDisplay: /* @__PURE__ */ jsx(FileCard, { file: formData.coverImage }),
|
|
213
|
+
aboveManagementCard: /* @__PURE__ */ jsx(Uploader, { accept: "image/*" })
|
|
214
|
+
}
|
|
215
|
+
) })
|
|
216
|
+
] }),
|
|
217
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
218
|
+
isFieldAllowed(postType, "text-content-separator", slug) && /* @__PURE__ */ jsx(Separator, { className: "my-4" }),
|
|
219
|
+
isFieldAllowed(postType, "title", slug) && /* @__PURE__ */ jsx(Field, { htmlFor: "title", label: t("resources.post.title.text"), children: /* @__PURE__ */ jsx(
|
|
220
|
+
I18nTextarea,
|
|
221
|
+
{
|
|
222
|
+
id: "title",
|
|
223
|
+
placeholder: t("resources.post.title.placeholder.text"),
|
|
224
|
+
fieldName: "title",
|
|
225
|
+
translations: formData.translations,
|
|
226
|
+
setFormData,
|
|
227
|
+
isLoading: isFetching,
|
|
228
|
+
isDisabled: isRedirecting,
|
|
229
|
+
errors
|
|
230
|
+
}
|
|
231
|
+
) }),
|
|
232
|
+
isFieldAllowed(postType, "subtitle", slug) && /* @__PURE__ */ jsx(
|
|
233
|
+
Field,
|
|
234
|
+
{
|
|
235
|
+
htmlFor: "subtitle",
|
|
236
|
+
label: t("resources.post.subtitle.text"),
|
|
237
|
+
children: /* @__PURE__ */ jsx(
|
|
238
|
+
I18nTextarea,
|
|
239
|
+
{
|
|
240
|
+
id: "subtitle",
|
|
241
|
+
fieldName: "subtitle",
|
|
242
|
+
translations: formData.translations,
|
|
243
|
+
setFormData,
|
|
244
|
+
isLoading: isFetching,
|
|
245
|
+
isDisabled: isRedirecting,
|
|
246
|
+
errors,
|
|
247
|
+
placeholder: t(
|
|
248
|
+
"resources.post.subtitle.placeholder.text"
|
|
249
|
+
)
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
}
|
|
253
|
+
),
|
|
254
|
+
isFieldAllowed(postType, "summary", slug) && /* @__PURE__ */ jsx(
|
|
255
|
+
Field,
|
|
256
|
+
{
|
|
257
|
+
htmlFor: "summary",
|
|
258
|
+
label: t("resources.post.summary.text"),
|
|
259
|
+
children: /* @__PURE__ */ jsx(
|
|
260
|
+
I18nTextarea,
|
|
261
|
+
{
|
|
262
|
+
id: "summary",
|
|
263
|
+
fieldName: "summary",
|
|
264
|
+
translations: formData.translations,
|
|
265
|
+
setFormData,
|
|
266
|
+
isLoading: isFetching,
|
|
267
|
+
isDisabled: isRedirecting,
|
|
268
|
+
errors,
|
|
269
|
+
placeholder: t("resources.post.summary.placeholder.text")
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
}
|
|
273
|
+
),
|
|
274
|
+
isFieldAllowed(postType, "description", slug) && /* @__PURE__ */ jsx(
|
|
275
|
+
Field,
|
|
276
|
+
{
|
|
277
|
+
htmlFor: "description",
|
|
278
|
+
label: t("resources.post.description.text"),
|
|
279
|
+
children: /* @__PURE__ */ jsx(
|
|
280
|
+
I18nTextarea,
|
|
281
|
+
{
|
|
282
|
+
id: "description",
|
|
283
|
+
fieldName: "description",
|
|
284
|
+
translations: formData.translations,
|
|
285
|
+
setFormData,
|
|
286
|
+
isLoading: isFetching,
|
|
287
|
+
isDisabled: isRedirecting,
|
|
288
|
+
errors,
|
|
289
|
+
placeholder: t(
|
|
290
|
+
"resources.post.description.placeholder.text"
|
|
291
|
+
)
|
|
292
|
+
}
|
|
293
|
+
)
|
|
294
|
+
}
|
|
295
|
+
),
|
|
296
|
+
isFieldAllowed(postType, "content", slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.content.text"), children: /* @__PURE__ */ jsx(
|
|
297
|
+
I18nEditor,
|
|
298
|
+
{
|
|
299
|
+
locale,
|
|
300
|
+
fieldName: "content",
|
|
301
|
+
translations: formData.translations,
|
|
302
|
+
setFormData,
|
|
303
|
+
isLoading: isFetching,
|
|
304
|
+
isDisabled: isRedirecting,
|
|
305
|
+
errors
|
|
306
|
+
}
|
|
307
|
+
) })
|
|
308
|
+
] }),
|
|
309
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
310
|
+
isFieldAllowed(postType, "better-seo-separator", slug) && /* @__PURE__ */ jsx(Separator, { className: "my-4" }),
|
|
311
|
+
isFieldAllowed(postType, "externalLinks", slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.external-links.text"), children: /* @__PURE__ */ jsx(
|
|
312
|
+
I18nObjectArrayInput,
|
|
313
|
+
{
|
|
314
|
+
fieldName: "externalLinks",
|
|
315
|
+
translations: formData.translations,
|
|
316
|
+
setFormData,
|
|
317
|
+
isLoading: isFetching,
|
|
318
|
+
isDisabled: isRedirecting,
|
|
319
|
+
errors,
|
|
320
|
+
fields: [
|
|
321
|
+
{
|
|
322
|
+
key: "name",
|
|
323
|
+
placeholder: t(
|
|
324
|
+
"resources.post.external-links.placeholder1.text"
|
|
325
|
+
)
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
key: "href",
|
|
329
|
+
placeholder: t(
|
|
330
|
+
"resources.post.external-links.placeholder2.text"
|
|
331
|
+
)
|
|
332
|
+
}
|
|
333
|
+
]
|
|
334
|
+
}
|
|
335
|
+
) }),
|
|
336
|
+
isFieldAllowed(postType, "faq", slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.faq.text"), children: /* @__PURE__ */ jsx(
|
|
337
|
+
I18nObjectArrayInput,
|
|
338
|
+
{
|
|
339
|
+
fieldName: "faq",
|
|
340
|
+
translations: formData.translations,
|
|
341
|
+
setFormData,
|
|
342
|
+
isLoading: isFetching,
|
|
343
|
+
isDisabled: isRedirecting,
|
|
344
|
+
errors,
|
|
345
|
+
fields: [
|
|
346
|
+
{
|
|
347
|
+
key: "question",
|
|
348
|
+
placeholder: t(
|
|
349
|
+
"resources.post.faq.placeholder1.text"
|
|
350
|
+
)
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
key: "answer",
|
|
354
|
+
placeholder: t(
|
|
355
|
+
"resources.post.faq.placeholder2.text"
|
|
356
|
+
)
|
|
357
|
+
}
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
) }),
|
|
361
|
+
isFieldAllowed(postType, "readTime", slug) && /* @__PURE__ */ jsx(
|
|
362
|
+
Field,
|
|
363
|
+
{
|
|
364
|
+
htmlFor: "readTime",
|
|
365
|
+
label: t("resources.post.read-time.text"),
|
|
366
|
+
children: /* @__PURE__ */ jsx(
|
|
367
|
+
I18nNumberInput,
|
|
368
|
+
{
|
|
369
|
+
id: "readTime",
|
|
370
|
+
fieldName: "readTime",
|
|
371
|
+
placeholder: t(
|
|
372
|
+
"resources.post.read-time.placeholder.text"
|
|
373
|
+
),
|
|
374
|
+
min: 0,
|
|
375
|
+
translations: formData.translations,
|
|
376
|
+
setFormData,
|
|
377
|
+
isLoading: isFetching,
|
|
378
|
+
isDisabled: isRedirecting,
|
|
379
|
+
errors
|
|
380
|
+
}
|
|
381
|
+
)
|
|
382
|
+
}
|
|
383
|
+
)
|
|
384
|
+
] }),
|
|
385
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
386
|
+
isFieldAllowed(postType, "related-posts-separator", slug) && /* @__PURE__ */ jsx(Separator, { className: "my-4" }),
|
|
387
|
+
isFieldAllowed(postType, "relatedPosts", slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.related-posts.text"), children: /* @__PURE__ */ jsx(
|
|
388
|
+
PickModal,
|
|
389
|
+
{
|
|
390
|
+
fieldName: "relatedPosts",
|
|
391
|
+
formData,
|
|
392
|
+
setFormData,
|
|
393
|
+
isLoading: isFetching,
|
|
394
|
+
isDisabled: isRedirecting,
|
|
395
|
+
isMultiPick: true,
|
|
396
|
+
itemList: /* @__PURE__ */ jsx(
|
|
397
|
+
PostList,
|
|
398
|
+
{
|
|
399
|
+
usableFields: [
|
|
400
|
+
...isFieldAllowed(postType, "isActive") ? ["isActive"] : [],
|
|
401
|
+
...isFieldAllowed(postType, "isIndexActive") ? ["isIndexActive"] : [],
|
|
402
|
+
...isFieldAllowed(postType, "isSlugActive") ? ["isSlugActive"] : [],
|
|
403
|
+
...isFieldAllowed(postType, "isFeatured") ? ["isFeatured"] : [],
|
|
404
|
+
...isFieldAllowed(postType, "isShownOnHome") ? ["isShownOnHome"] : []
|
|
405
|
+
],
|
|
406
|
+
type: postType,
|
|
407
|
+
topicId: topic?.id,
|
|
408
|
+
excludeIds: post ? [post?.id] : void 0
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
pickedDisplay: formData.relatedPosts.map(
|
|
412
|
+
(relatedPost) => /* @__PURE__ */ jsx(PostCard, { post: relatedPost }, relatedPost.id)
|
|
413
|
+
)
|
|
414
|
+
}
|
|
415
|
+
) })
|
|
416
|
+
] })
|
|
417
|
+
] }),
|
|
418
|
+
/* @__PURE__ */ jsxs(SideFields, { children: [
|
|
419
|
+
/* @__PURE__ */ jsx("div", { className: "max-lg:hidden", children: /* @__PURE__ */ jsx(
|
|
420
|
+
ActionButtonsCard,
|
|
421
|
+
{
|
|
422
|
+
action: "update",
|
|
423
|
+
isInitializing: isFetching,
|
|
424
|
+
isProcessing: isRedirecting
|
|
425
|
+
}
|
|
426
|
+
) }),
|
|
427
|
+
/* @__PURE__ */ jsx(Separator, { className: "mt-4 lg:hidden" }),
|
|
428
|
+
/* @__PURE__ */ jsx(
|
|
429
|
+
ControlFields,
|
|
430
|
+
{
|
|
431
|
+
fields: [
|
|
432
|
+
...isFieldAllowed(postType, "isActive", post?.slug) ? [{ key: "isActive" }] : [],
|
|
433
|
+
...isFieldAllowed(postType, "isIndexActive", post?.slug) ? [{ key: "isIndexActive" }] : [],
|
|
434
|
+
...isFieldAllowed(postType, "isSlugActive", post?.slug) ? [{ key: "isSlugActive" }] : [],
|
|
435
|
+
...isFieldAllowed(postType, "isFeatured", post?.slug) ? [{ key: "isFeatured" }] : [],
|
|
436
|
+
...isFieldAllowed(postType, "isShownOnHome", post?.slug) ? [{ key: "isShownOnHome" }] : []
|
|
437
|
+
],
|
|
438
|
+
controlMeta,
|
|
439
|
+
formData,
|
|
440
|
+
setFormData,
|
|
441
|
+
isLoading: isFetching,
|
|
442
|
+
isDisabled: isRedirecting,
|
|
443
|
+
errors
|
|
444
|
+
}
|
|
445
|
+
)
|
|
446
|
+
] })
|
|
447
|
+
] }),
|
|
448
|
+
/* @__PURE__ */ jsx("div", { className: "fixed bottom-3 left-1/2 z-10 -translate-x-1/2 lg:hidden", children: /* @__PURE__ */ jsx(
|
|
449
|
+
ActionButtonsCard,
|
|
450
|
+
{
|
|
451
|
+
action: "update",
|
|
452
|
+
isInitializing: isFetching,
|
|
453
|
+
isProcessing: isRedirecting
|
|
454
|
+
}
|
|
455
|
+
) })
|
|
456
|
+
] }) });
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export { createPostEditContent };
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { useTranslator } from 'intor/react';
|
|
4
|
+
import '../../../../../../../constants/paths/redirect.js';
|
|
5
|
+
import { DATE_FORMAT_OPTIONS } from '../../../../../../../constants/date.js';
|
|
6
|
+
import '../../../../../../../constants/cms-locale.js';
|
|
7
|
+
import '@radix-ui/react-avatar';
|
|
8
|
+
import 'mime-types';
|
|
9
|
+
import 'sitero-domain';
|
|
10
|
+
import 'clsx';
|
|
11
|
+
import 'tailwind-merge';
|
|
12
|
+
import 'zod';
|
|
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 { SideFields } from '../../../ui/form/containers/side-fields.js';
|
|
34
|
+
import 'react';
|
|
35
|
+
import { ControlFields } from '../../../ui/form/control-fields/control-fields.js';
|
|
36
|
+
import '../../../../../../../core/client/infrastructure/contexts/admin/admin.js';
|
|
37
|
+
import '../../../../../../../core/client/infrastructure/react-query/client.js';
|
|
38
|
+
import '@tanstack/react-query';
|
|
39
|
+
import 'next/navigation';
|
|
40
|
+
import 'intor/next';
|
|
41
|
+
import 'next/link';
|
|
42
|
+
import { ContentContainer } from '../../../ui/layouts/content-container.js';
|
|
43
|
+
import { AdminCard } from '../../admin/admin-card.js';
|
|
44
|
+
import { CategoryCard } from '../category/category-card.js';
|
|
45
|
+
import { TagCard } from '../tag/tag-card.js';
|
|
46
|
+
|
|
47
|
+
function createPostShowContent({
|
|
48
|
+
contentMaxWidth,
|
|
49
|
+
PostCard,
|
|
50
|
+
FileCard,
|
|
51
|
+
I18nDisplay,
|
|
52
|
+
I18nObjectArrayDisplay
|
|
53
|
+
}) {
|
|
54
|
+
return function PostShowContent({
|
|
55
|
+
post,
|
|
56
|
+
isFetching,
|
|
57
|
+
isNotFound,
|
|
58
|
+
children,
|
|
59
|
+
subcategoryType,
|
|
60
|
+
CategoryCard: CategoryCard$1 = CategoryCard,
|
|
61
|
+
allowField
|
|
62
|
+
}) {
|
|
63
|
+
const { t, format } = useTranslator();
|
|
64
|
+
const type = post?.type;
|
|
65
|
+
const topicSlug = post?.topic?.slug;
|
|
66
|
+
const categories = post?.parents;
|
|
67
|
+
const parentLabelKey = subcategoryType && categories?.[0]?.type === subcategoryType ? "resources.subcategory.text" : "resources.category.text";
|
|
68
|
+
const isFieldAllowed = (type2, field, fieldRuleKey) => allowField({ topicSlug, type: type2, field, fieldRuleKey });
|
|
69
|
+
return /* @__PURE__ */ jsx(ContentContainer, { isNotFound, children: /* @__PURE__ */ jsxs(FieldsContainer, { children: [
|
|
70
|
+
/* @__PURE__ */ jsxs(MainFields, { children: [
|
|
71
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72
|
+
isFieldAllowed(type, "author", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.author.text"), children: /* @__PURE__ */ jsx(FieldBody, { isLoading: isFetching, isEmpty: !post?.author, children: /* @__PURE__ */ jsx(AdminCard, { admin: post?.author || null, openNewTab: true }) }) }),
|
|
73
|
+
isFieldAllowed(type, "parents", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t(parentLabelKey), children: /* @__PURE__ */ jsx(
|
|
74
|
+
FieldBody,
|
|
75
|
+
{
|
|
76
|
+
isLoading: isFetching,
|
|
77
|
+
isEmpty: categories?.length === 0,
|
|
78
|
+
children: categories?.map((p) => /* @__PURE__ */ jsx(
|
|
79
|
+
CategoryCard$1,
|
|
80
|
+
{
|
|
81
|
+
post: p,
|
|
82
|
+
openNewTab: true,
|
|
83
|
+
isSubcategory: p.type === subcategoryType
|
|
84
|
+
},
|
|
85
|
+
p.id
|
|
86
|
+
))
|
|
87
|
+
}
|
|
88
|
+
) }),
|
|
89
|
+
isFieldAllowed(type, "tags", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.tag.text"), children: /* @__PURE__ */ jsx(
|
|
90
|
+
FieldBody,
|
|
91
|
+
{
|
|
92
|
+
isLoading: isFetching,
|
|
93
|
+
isEmpty: !post?.tags || post.tags.length === 0,
|
|
94
|
+
children: post?.tags?.map((p) => /* @__PURE__ */ jsx(TagCard, { post: p, openNewTab: true }, p.id))
|
|
95
|
+
}
|
|
96
|
+
) }),
|
|
97
|
+
isFieldAllowed(type, "coverImage", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.cover-image.text"), children: /* @__PURE__ */ jsx(FieldBody, { isLoading: isFetching, isEmpty: !post?.coverImage, children: /* @__PURE__ */ jsx(FileCard, { file: post?.coverImage || null, openNewTab: true }) }) })
|
|
98
|
+
] }),
|
|
99
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
100
|
+
isFieldAllowed(type, "text-content-separator", post?.slug) && /* @__PURE__ */ jsx(Separator, { className: "my-4" }),
|
|
101
|
+
isFieldAllowed(type, "title", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.title.text"), children: /* @__PURE__ */ jsx(
|
|
102
|
+
I18nDisplay,
|
|
103
|
+
{
|
|
104
|
+
fieldName: "title",
|
|
105
|
+
translations: post?.translations,
|
|
106
|
+
isLoading: isFetching
|
|
107
|
+
}
|
|
108
|
+
) }),
|
|
109
|
+
isFieldAllowed(type, "subtitle", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.subtitle.text"), children: /* @__PURE__ */ jsx(
|
|
110
|
+
I18nDisplay,
|
|
111
|
+
{
|
|
112
|
+
fieldName: "subtitle",
|
|
113
|
+
translations: post?.translations,
|
|
114
|
+
isLoading: isFetching
|
|
115
|
+
}
|
|
116
|
+
) }),
|
|
117
|
+
isFieldAllowed(type, "summary", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.summary.text"), children: /* @__PURE__ */ jsx(
|
|
118
|
+
I18nDisplay,
|
|
119
|
+
{
|
|
120
|
+
fieldName: "summary",
|
|
121
|
+
translations: post?.translations,
|
|
122
|
+
isLoading: isFetching
|
|
123
|
+
}
|
|
124
|
+
) }),
|
|
125
|
+
isFieldAllowed(type, "description", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.description.text"), children: /* @__PURE__ */ jsx(
|
|
126
|
+
I18nDisplay,
|
|
127
|
+
{
|
|
128
|
+
fieldName: "description",
|
|
129
|
+
translations: post?.translations,
|
|
130
|
+
isLoading: isFetching
|
|
131
|
+
}
|
|
132
|
+
) }),
|
|
133
|
+
isFieldAllowed(type, "content", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.content.text"), children: /* @__PURE__ */ jsx(
|
|
134
|
+
I18nDisplay,
|
|
135
|
+
{
|
|
136
|
+
fieldName: "content",
|
|
137
|
+
translations: post?.translations,
|
|
138
|
+
isLoading: isFetching,
|
|
139
|
+
isHtml: true,
|
|
140
|
+
style: { maxWidth: contentMaxWidth },
|
|
141
|
+
className: "mx-auto"
|
|
142
|
+
}
|
|
143
|
+
) })
|
|
144
|
+
] }),
|
|
145
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
146
|
+
isFieldAllowed(type, "better-seo-separator", post?.slug) && /* @__PURE__ */ jsx(Separator, { className: "my-4" }),
|
|
147
|
+
isFieldAllowed(type, "externalLinks", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.external-links.text"), children: /* @__PURE__ */ jsx(
|
|
148
|
+
I18nObjectArrayDisplay,
|
|
149
|
+
{
|
|
150
|
+
fieldName: "externalLinks",
|
|
151
|
+
translations: post?.translations,
|
|
152
|
+
fields: [{ key: "name" }, { key: "href", isLink: true }],
|
|
153
|
+
isLoading: isFetching
|
|
154
|
+
}
|
|
155
|
+
) }),
|
|
156
|
+
isFieldAllowed(type, "faq", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.faq.text"), children: /* @__PURE__ */ jsx(
|
|
157
|
+
I18nObjectArrayDisplay,
|
|
158
|
+
{
|
|
159
|
+
fieldName: "faq",
|
|
160
|
+
translations: post?.translations,
|
|
161
|
+
fields: [{ key: "question" }, { key: "answer" }],
|
|
162
|
+
isLoading: isFetching
|
|
163
|
+
}
|
|
164
|
+
) }),
|
|
165
|
+
isFieldAllowed(type, "readTime", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.read-time.text"), children: /* @__PURE__ */ jsx(
|
|
166
|
+
I18nDisplay,
|
|
167
|
+
{
|
|
168
|
+
fieldName: "readTime",
|
|
169
|
+
translations: post?.translations,
|
|
170
|
+
isLoading: isFetching
|
|
171
|
+
}
|
|
172
|
+
) })
|
|
173
|
+
] }),
|
|
174
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
175
|
+
isFieldAllowed(type, "related-posts-separator", post?.slug) && /* @__PURE__ */ jsx(Separator, { className: "my-4" }),
|
|
176
|
+
isFieldAllowed(type, "relatedPosts", post?.slug) && /* @__PURE__ */ jsx(Field, { label: t("resources.post.related-posts.text"), children: /* @__PURE__ */ jsx(
|
|
177
|
+
FieldBody,
|
|
178
|
+
{
|
|
179
|
+
isLoading: isFetching,
|
|
180
|
+
isEmpty: !post?.relatedPosts || post.relatedPosts.length === 0,
|
|
181
|
+
children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-3", children: post?.relatedPosts.map((p) => /* @__PURE__ */ jsx(PostCard, { post: p, openNewTab: true }, p.id)) })
|
|
182
|
+
}
|
|
183
|
+
) })
|
|
184
|
+
] }),
|
|
185
|
+
children
|
|
186
|
+
] }),
|
|
187
|
+
/* @__PURE__ */ jsxs(SideFields, { children: [
|
|
188
|
+
/* @__PURE__ */ jsx(
|
|
189
|
+
Field,
|
|
190
|
+
{
|
|
191
|
+
label: t("resources.post.created-at.text"),
|
|
192
|
+
wrapperClassName: "max-lg:hidden",
|
|
193
|
+
children: /* @__PURE__ */ jsx(FieldBody, { isLoading: isFetching, children: post?.createdAt && format.date(new Date(post?.createdAt), DATE_FORMAT_OPTIONS) })
|
|
194
|
+
}
|
|
195
|
+
),
|
|
196
|
+
/* @__PURE__ */ jsx(Separator, { className: "mt-6 lg:hidden" }),
|
|
197
|
+
/* @__PURE__ */ jsx(
|
|
198
|
+
ControlFields,
|
|
199
|
+
{
|
|
200
|
+
fields: [
|
|
201
|
+
...isFieldAllowed(type, "isActive", post?.slug) ? [{ key: "isActive" }] : [],
|
|
202
|
+
...isFieldAllowed(type, "isIndexActive", post?.slug) ? [{ key: "isIndexActive" }] : [],
|
|
203
|
+
...isFieldAllowed(type, "isSlugActive", post?.slug) ? [{ key: "isSlugActive" }] : [],
|
|
204
|
+
...isFieldAllowed(type, "isFeatured", post?.slug) ? [{ key: "isFeatured" }] : [],
|
|
205
|
+
...isFieldAllowed(type, "isShownOnHome", post?.slug) ? [{ key: "isShownOnHome" }] : []
|
|
206
|
+
],
|
|
207
|
+
formData: { ...post },
|
|
208
|
+
isDisplay: true,
|
|
209
|
+
isLoading: isFetching
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
] })
|
|
213
|
+
] }) });
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export { createPostShowContent };
|