@webiny/app-headless-cms 6.6.0-alpha.0 → 6.6.0-alpha.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/ContentEntriesModule.js +3 -3
- package/ContentEntriesModule.js.map +1 -1
- package/HeadlessCMS.js +7 -2
- package/HeadlessCMS.js.map +1 -1
- package/admin/RoutesConfig.js +14 -1
- package/admin/RoutesConfig.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/ActionDelete.d.ts +2 -2
- package/admin/components/ContentEntries/BulkActions/ActionDelete.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/ActionMove.d.ts +2 -2
- package/admin/components/ContentEntries/BulkActions/ActionMove.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/ActionPublish.d.ts +2 -2
- package/admin/components/ContentEntries/BulkActions/ActionPublish.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/ActionUnpublish.d.ts +2 -2
- package/admin/components/ContentEntries/BulkActions/ActionUnpublish.js.map +1 -1
- package/admin/components/ContentModelEditor/ContentModelEditorProvider.js +1 -0
- package/admin/components/ContentModelEditor/ContentModelEditorProvider.js.map +1 -1
- package/admin/components/ContentModelEditor/FieldsSidebar.js +12 -2
- package/admin/components/ContentModelEditor/FieldsSidebar.js.map +1 -1
- package/admin/components/ContentModelEditor/evaluateExpression.js +4 -0
- package/admin/components/ContentModelEditor/evaluateExpression.js.map +1 -1
- package/admin/components/Dialogs/PublishEntryConfirmDialog.d.ts +26 -1
- package/admin/components/Dialogs/PublishEntryConfirmDialog.js +4 -3
- package/admin/components/Dialogs/PublishEntryConfirmDialog.js.map +1 -1
- package/admin/components/Dialogs/UnpublishEntryConfirmDialog.d.ts +26 -1
- package/admin/components/Dialogs/UnpublishEntryConfirmDialog.js +4 -3
- package/admin/components/Dialogs/UnpublishEntryConfirmDialog.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/PermissionsEditor/PermissionsEditor.js +3 -3
- package/admin/components/FieldEditor/EditFieldDialog/PermissionsEditor/PermissionsEditor.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog.d.ts +2 -2
- package/admin/components/FieldEditor/EditFieldDialog.js +5 -2
- package/admin/components/FieldEditor/EditFieldDialog.js.map +1 -1
- package/admin/components/FieldEditor/Field.js +1 -1
- package/admin/components/FieldEditor/Field.js.map +1 -1
- package/admin/components/FieldEditor/FieldEditor.js +2 -2
- package/admin/components/FieldEditor/FieldEditor.js.map +1 -1
- package/admin/components/FieldEditor/FieldEditorContext.d.ts +1 -1
- package/admin/components/FieldEditor/FieldEditorContext.js +6 -1
- package/admin/components/FieldEditor/FieldEditorContext.js.map +1 -1
- package/admin/components/LexicalCmsEditor/LexicalEditor.js +10 -6
- package/admin/components/LexicalCmsEditor/LexicalEditor.js.map +1 -1
- package/admin/components/LexicalCmsEditor/TypographyDropDown.js +3 -2
- package/admin/components/LexicalCmsEditor/TypographyDropDown.js.map +1 -1
- package/admin/config/contentEntries/editor/ContentEntryEditorConfig.d.ts +60 -2
- package/admin/config/contentEntries/editor/ContentEntryEditorConfig.js +18 -5
- package/admin/config/contentEntries/editor/ContentEntryEditorConfig.js.map +1 -1
- package/admin/config/contentEntries/editor/NewEntryWizard.d.ts +8 -1
- package/admin/config/contentEntries/editor/NewEntryWizard.js +20 -5
- package/admin/config/contentEntries/editor/NewEntryWizard.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/BreadcrumbRoot.d.ts +38 -0
- package/admin/config/contentEntries/list/Browser/BreadcrumbRoot.js +23 -0
- package/admin/config/contentEntries/list/Browser/BreadcrumbRoot.js.map +1 -0
- package/admin/config/contentEntries/list/Browser/index.d.ts +21 -0
- package/admin/config/contentEntries/list/Browser/index.js +2 -0
- package/admin/config/contentEntries/list/Browser/index.js.map +1 -1
- package/admin/config/contentEntries/list/ContentEntryListConfig.d.ts +39 -0
- package/admin/config/contentEntries/list/ContentEntryListConfig.js +2 -1
- package/admin/config/contentEntries/list/ContentEntryListConfig.js.map +1 -1
- package/admin/graphql/contentModels.d.ts +1 -1
- package/admin/graphql/contentModels.js +2 -1
- package/admin/graphql/contentModels.js.map +1 -1
- package/admin/plugins/editor/formSettings/components/GeneralSettings.js +24 -1
- package/admin/plugins/editor/formSettings/components/GeneralSettings.js.map +1 -1
- package/exports/admin/cms/entry/editor.d.ts +1 -0
- package/exports/admin/cms/entry/editor.js +1 -0
- package/exports/admin/cms/entry/list.d.ts +2 -0
- package/exports/admin/cms/entry/list.js +2 -0
- package/exports/admin/cms.d.ts +2 -0
- package/exports/admin/cms.js +2 -0
- package/features/contentEntry/EntryGraphQLFields.js +1 -1
- package/features/contentEntry/EntryGraphQLFields.js.map +1 -1
- package/features/contentEntry/createEntry/CreateEntryRepository.d.ts +3 -1
- package/features/contentEntry/createEntry/CreateEntryRepository.js +10 -2
- package/features/contentEntry/createEntry/CreateEntryRepository.js.map +1 -1
- package/features/contentEntry/deleteEntry/DeleteEntryRepository.d.ts +3 -1
- package/features/contentEntry/deleteEntry/DeleteEntryRepository.js +12 -2
- package/features/contentEntry/deleteEntry/DeleteEntryRepository.js.map +1 -1
- package/features/contentEntry/refTypes.d.ts +7 -0
- package/features/contentEntry/refTypes.js.map +1 -1
- package/features/contentEntry/updateEntry/UpdateEntryRepository.d.ts +3 -1
- package/features/contentEntry/updateEntry/UpdateEntryRepository.js +10 -2
- package/features/contentEntry/updateEntry/UpdateEntryRepository.js.map +1 -1
- package/features/formModel/mappers/AssetFieldMapper.d.ts +12 -0
- package/features/formModel/mappers/AssetFieldMapper.js +13 -0
- package/features/formModel/mappers/AssetFieldMapper.js.map +1 -0
- package/features/formModel/mappers/index.js +2 -0
- package/features/formModel/mappers/index.js.map +1 -1
- package/features/model/updateModel/UpdateModelGateway.js +1 -0
- package/features/model/updateModel/UpdateModelGateway.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +24 -24
- package/presentation/contentEntries/list/ContentEntriesPresenter.test.js +4 -0
- package/presentation/contentEntries/list/ContentEntriesPresenter.test.js.map +1 -1
- package/presentation/contentEntries/preview/ComponentDiscoveryIframe.d.ts +6 -0
- package/presentation/contentEntries/preview/ComponentDiscoveryIframe.js +47 -0
- package/presentation/contentEntries/preview/ComponentDiscoveryIframe.js.map +1 -0
- package/presentation/contentEntries/preview/LivePreviewPresenter.d.ts +14 -0
- package/presentation/contentEntries/preview/LivePreviewPresenter.js +33 -0
- package/presentation/contentEntries/preview/LivePreviewPresenter.js.map +1 -0
- package/presentation/contentEntries/preview/ModelEditorComponentDiscovery.d.ts +2 -0
- package/presentation/contentEntries/preview/ModelEditorComponentDiscovery.js +27 -0
- package/presentation/contentEntries/preview/ModelEditorComponentDiscovery.js.map +1 -0
- package/presentation/contentEntries/preview/PreviewComponentsContext.d.ts +15 -0
- package/presentation/contentEntries/preview/PreviewComponentsContext.js +43 -0
- package/presentation/contentEntries/preview/PreviewComponentsContext.js.map +1 -0
- package/presentation/contentEntries/preview/PreviewDecorator.d.ts +2 -0
- package/presentation/contentEntries/preview/PreviewDecorator.js +48 -0
- package/presentation/contentEntries/preview/PreviewDecorator.js.map +1 -0
- package/presentation/contentEntries/preview/PreviewPane.d.ts +9 -0
- package/presentation/contentEntries/preview/PreviewPane.js +181 -0
- package/presentation/contentEntries/preview/PreviewPane.js.map +1 -0
- package/presentation/contentEntries/preview/abstractions.d.ts +16 -0
- package/presentation/contentEntries/preview/abstractions.js +5 -0
- package/presentation/contentEntries/preview/abstractions.js.map +1 -0
- package/presentation/contentEntries/preview/feature.d.ts +3 -0
- package/presentation/contentEntries/preview/feature.js +17 -0
- package/presentation/contentEntries/preview/feature.js.map +1 -0
- package/presentation/contentEntries/preview/resolvePreviewUrl.d.ts +5 -0
- package/presentation/contentEntries/preview/resolvePreviewUrl.js +29 -0
- package/presentation/contentEntries/preview/resolvePreviewUrl.js.map +1 -0
- package/presentation/contentEntries/preview/useLivePreviewPresenter.d.ts +1 -0
- package/presentation/contentEntries/preview/useLivePreviewPresenter.js +8 -0
- package/presentation/contentEntries/preview/useLivePreviewPresenter.js.map +1 -0
- package/presentation/contentEntries/trashBin/CmsTrashBin.d.ts +2 -2
- package/presentation/contentEntries/views/CmsAdvancedSearch.d.ts +2 -2
- package/presentation/contentEntries/views/ContentEntriesBreadcrumbs.d.ts +13 -0
- package/presentation/contentEntries/views/ContentEntriesBreadcrumbs.js +54 -0
- package/presentation/contentEntries/views/ContentEntriesBreadcrumbs.js.map +1 -0
- package/presentation/contentEntries/views/ContentEntriesListLayout.d.ts +2 -2
- package/presentation/contentEntries/views/ContentEntriesListLayout.js +3 -2
- package/presentation/contentEntries/views/ContentEntriesListLayout.js.map +1 -1
- package/presentation/contentEntries/views/ContentEntryFormView.d.ts +2 -2
- package/presentation/contentEntries/views/ContentEntryFormView.js +5 -6
- package/presentation/contentEntries/views/ContentEntryFormView.js.map +1 -1
- package/presentation/contentEntries/views/RevisionDrawer.d.ts +2 -2
- package/presentation/contentEntries/views/RevisionsList.d.ts +2 -2
- package/presentation/contentEntries/views/SingleEntryLayout.d.ts +2 -2
- package/presentation/contentEntries/views/Table/Table.d.ts +2 -2
- package/presentation/contentEntries/views/actions/CreateNewRevisionButton.d.ts +2 -2
- package/presentation/contentEntries/views/actions/DeleteEntryMenuItem.d.ts +2 -2
- package/presentation/contentEntries/views/actions/PublishOnlyButton.d.ts +2 -2
- package/presentation/contentEntries/views/actions/RevisionSelector.d.ts +2 -2
- package/presentation/contentEntries/views/actions/SaveAndPublishButton.d.ts +2 -2
- package/presentation/contentEntries/views/actions/SaveContentButton.d.ts +2 -2
- package/presentation/contentEntries/views/actions/ShowRevisionListMenuItem.d.ts +2 -2
- package/presentation/contentEntries/views/layout/ContentEntryForm.d.ts +12 -12
- package/presentation/contentEntries/views/layout/ContentEntryFormContent.d.ts +10 -6
- package/presentation/contentEntries/views/layout/ContentEntryFormContent.js +7 -2
- package/presentation/contentEntries/views/layout/ContentEntryFormContent.js.map +1 -1
- package/presentation/contentModels/components/CloneContentModelDialog.d.ts +2 -2
- package/presentation/contentModels/components/ContentModels.d.ts +2 -2
- package/presentation/contentModels/components/ContentModelsDataList.d.ts +2 -2
- package/presentation/contentModels/components/NewContentModelDialog.d.ts +2 -2
- package/presentation/contentModels/components/fullDelete/types.js.map +1 -1
- package/presentation/fieldEditor/FieldEditorPresenter.js +1 -1
- package/presentation/fieldEditor/FieldEditorPresenter.js.map +1 -1
- package/presentation/fieldEditor/groups/ValidationsGroup.js +1 -1
- package/presentation/fieldEditor/groups/ValidationsGroup.js.map +1 -1
- package/presentation/fieldEditor/renderers/CmsAccessControlRulesRenderer.js +3 -3
- package/presentation/fieldEditor/renderers/CmsAccessControlRulesRenderer.js.map +1 -1
- package/presentation/fieldRenderers/ref/CmsRefDetailedMultipleRenderer.js +8 -0
- package/presentation/fieldRenderers/ref/CmsRefDetailedMultipleRenderer.js.map +1 -1
- package/presentation/fieldRenderers/ref/CmsRefDetailedSingleRenderer.js +8 -0
- package/presentation/fieldRenderers/ref/CmsRefDetailedSingleRenderer.js.map +1 -1
- package/presentation/fieldRenderers/ref/components/EditEntryDrawer.d.ts +10 -0
- package/presentation/fieldRenderers/ref/components/EditEntryDrawer.js +94 -0
- package/presentation/fieldRenderers/ref/components/EditEntryDrawer.js.map +1 -0
- package/presentation/fieldRenderers/ref/components/EntryCard.d.ts +2 -0
- package/presentation/fieldRenderers/ref/components/EntryCard.js +13 -3
- package/presentation/fieldRenderers/ref/components/EntryCard.js.map +1 -1
- package/presentation/fieldRenderers/ref/components/RefFieldOptions.d.ts +2 -2
- package/presentation/fieldRenderers/ref/detailed/RefDetailedPresenter.d.ts +2 -1
- package/presentation/fieldRenderers/ref/detailed/RefDetailedPresenter.js +6 -0
- package/presentation/fieldRenderers/ref/detailed/RefDetailedPresenter.js.map +1 -1
- package/presentation/fieldRenderers/ref/detailed/abstractions.d.ts +2 -1
- package/presentation/fieldRenderers/ref/detailed/abstractions.js.map +1 -1
- package/presentation/fieldRenderers/ref/editEntry/EditEntryPresenter.d.ts +13 -0
- package/presentation/fieldRenderers/ref/editEntry/EditEntryPresenter.js +25 -0
- package/presentation/fieldRenderers/ref/editEntry/EditEntryPresenter.js.map +1 -0
- package/presentation/fieldRenderers/ref/editEntry/abstractions.d.ts +10 -0
- package/presentation/fieldRenderers/ref/editEntry/abstractions.js +5 -0
- package/presentation/fieldRenderers/ref/editEntry/abstractions.js.map +1 -0
- package/presentation/fieldRenderers/ref/editEntry/feature.d.ts +3 -0
- package/presentation/fieldRenderers/ref/editEntry/feature.js +17 -0
- package/presentation/fieldRenderers/ref/editEntry/feature.js.map +1 -0
- package/presentation/fieldTypes/abstractions.d.ts +12 -0
- package/presentation/fieldTypes/abstractions.js.map +1 -1
- package/presentation/fieldTypes/renderers/common/SelectBoxRenderer.js +1 -1
- package/presentation/fieldTypes/renderers/common/SelectBoxRenderer.js.map +1 -1
- package/presentation/fieldTypes/renderers/dynamicZone/DynamicZoneRenderer.js +6 -2
- package/presentation/fieldTypes/renderers/dynamicZone/DynamicZoneRenderer.js.map +1 -1
- package/presentation/fieldTypes/renderers/object/ObjectAccordionRenderer.js +2 -0
- package/presentation/fieldTypes/renderers/object/ObjectAccordionRenderer.js.map +1 -1
- package/presentation/fieldTypes/renderers/object/ObjectsAccordionRenderer.js +6 -0
- package/presentation/fieldTypes/renderers/object/ObjectsAccordionRenderer.js.map +1 -1
- package/presentation/fieldTypes/types/DynamicZoneFieldType.d.ts +3 -6
- package/presentation/fieldTypes/types/DynamicZoneFieldType.js +2 -12
- package/presentation/fieldTypes/types/DynamicZoneFieldType.js.map +1 -1
- package/presentation/fieldTypes/types/dynamicZone/TemplateDialog.js +25 -3
- package/presentation/fieldTypes/types/dynamicZone/TemplateDialog.js.map +1 -1
- package/presentation/importContentModels/ImportContentModelsDialog.d.ts +2 -2
- package/presentation/importContentModels/components/DataList.d.ts +2 -2
- package/presentation/importContentModels/components/FileUpload.d.ts +2 -2
- package/presentation/importContentModels/components/Model/DataListModels.d.ts +2 -2
- package/presentation/menus/ContentGroupsMenuItems.d.ts +2 -2
- package/presentation/modelGroup/ModelGroupPresenter.d.ts +3 -1
- package/presentation/modelGroup/ModelGroupPresenter.js +7 -9
- package/presentation/modelGroup/ModelGroupPresenter.js.map +1 -1
- package/presentation/modelGroup/components/ContentModelGroups.d.ts +2 -2
- package/presentation/modelGroup/components/ContentModelGroupsDataList.d.ts +6 -2
- package/presentation/modelGroup/components/ContentModelGroupsForm.d.ts +8 -2
package/ContentEntriesModule.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import react from "react";
|
|
2
2
|
import { AdminConfig } from "@webiny/app-admin";
|
|
3
3
|
import { AdvancedSearchConfigs } from "@webiny/app-aco/components/AdvancedSearch/AdvancedSearchConfigs";
|
|
4
|
-
import {
|
|
4
|
+
import { InternalContentEntryEditorConfig, InternalContentEntryListConfig } from "./admin/config/contentEntries/index.js";
|
|
5
5
|
import { ActionDelete, ActionMove, ActionPublish, ActionUnpublish } from "./admin/components/ContentEntries/BulkActions/index.js";
|
|
6
6
|
import { PUBLISH_ENTRY_DIALOG, TRASH_ENTRY_DIALOG, UNPUBLISH_ENTRY_DIALOG } from "./presentation/contentEntries/list/ContentEntriesPresenter.js";
|
|
7
7
|
import { DeleteFolder, EditFolder, SetFolderPermissions } from "@webiny/app-aco";
|
|
@@ -24,7 +24,7 @@ import { ShowRevisionListMenuItem } from "./presentation/contentEntries/views/ac
|
|
|
24
24
|
import { CreateNewRevisionButton } from "./presentation/contentEntries/views/actions/CreateNewRevisionButton.js";
|
|
25
25
|
import { PublishOnlyButton } from "./presentation/contentEntries/views/actions/PublishOnlyButton.js";
|
|
26
26
|
const { Browser: Browser } = InternalContentEntryListConfig;
|
|
27
|
-
const { Actions: Actions } =
|
|
27
|
+
const { Actions: Actions } = InternalContentEntryEditorConfig;
|
|
28
28
|
const ContentEntriesModule = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(AdminConfig.Dialog, {
|
|
29
29
|
name: TRASH_ENTRY_DIALOG,
|
|
30
30
|
element: /*#__PURE__*/ react.createElement(TrashEntryConfirmDialog, null)
|
|
@@ -117,7 +117,7 @@ const ContentEntriesModule = ()=>/*#__PURE__*/ react.createElement(react.Fragmen
|
|
|
117
117
|
hideable: false,
|
|
118
118
|
truncate: false,
|
|
119
119
|
className: "flex justify-center"
|
|
120
|
-
})), /*#__PURE__*/ react.createElement(
|
|
120
|
+
})), /*#__PURE__*/ react.createElement(InternalContentEntryEditorConfig, null, /*#__PURE__*/ react.createElement(IsModelPublishable, null, /*#__PURE__*/ react.createElement(Actions.ButtonAction, {
|
|
121
121
|
name: "revisionSelector",
|
|
122
122
|
element: /*#__PURE__*/ react.createElement(RevisionSelector, null)
|
|
123
123
|
})), /*#__PURE__*/ react.createElement(Actions.ButtonAction, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentEntriesModule.js","sources":["../src/ContentEntriesModule.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"@webiny/app-admin\";\nimport { AdvancedSearchConfigs } from \"@webiny/app-aco/components/AdvancedSearch/AdvancedSearchConfigs\";\nimport {\n ContentEntryEditorConfig,\n InternalContentEntryListConfig\n} from \"~/admin/config/contentEntries/index.js\";\n\nimport {\n ActionDelete,\n ActionMove,\n ActionPublish,\n ActionUnpublish\n} from \"~/admin/components/ContentEntries/BulkActions/index.js\";\n\nimport {\n TRASH_ENTRY_DIALOG,\n PUBLISH_ENTRY_DIALOG,\n UNPUBLISH_ENTRY_DIALOG\n} from \"~/presentation/contentEntries/list/ContentEntriesPresenter.js\";\nimport { DeleteFolder, EditFolder, SetFolderPermissions } from \"@webiny/app-aco\";\nimport {\n ChangeEntryStatus,\n DeleteEntry,\n EditEntry,\n MoveEntry\n} from \"~/admin/components/ContentEntries/Table/Actions/index.js\";\nimport {\n CellActions,\n CellAuthor,\n CellCreated,\n CellLive,\n CellModified,\n CellName,\n CellStatus\n} from \"~/admin/components/ContentEntries/Table/Cells/index.js\";\nimport { IsModelPublishable } from \"~/admin/components/IsModelPublishable.js\";\nimport { FilterByStatus } from \"~/admin/components/ContentEntries/FilterByStatus.js\";\nimport { CmsTrashBin } from \"~/presentation/contentEntries/trashBin/CmsTrashBin.js\";\nimport { TrashEntryConfirmDialog } from \"~/admin/components/Dialogs/TrashEntryConfirmDialog.js\";\nimport { PublishEntryConfirmDialog } from \"~/admin/components/Dialogs/PublishEntryConfirmDialog.js\";\nimport { UnpublishEntryConfirmDialog } from \"~/admin/components/Dialogs/UnpublishEntryConfirmDialog.js\";\nimport { DeleteRevisionConfirmDialog } from \"~/admin/components/Dialogs/DeleteRevisionConfirmDialog.js\";\nimport { DELETE_REVISION_DIALOG } from \"~/presentation/contentEntries/revisionsList/RevisionsListPresenter.js\";\nimport { RevisionSelector } from \"~/presentation/contentEntries/views/actions/RevisionSelector.js\";\nimport { ContentFormOptionsMenu } from \"~/presentation/contentEntries/views/actions/ContentFormOptionsMenu.js\";\nimport { SaveContentButton } from \"~/presentation/contentEntries/views/actions/SaveContentButton.js\";\nimport { SaveAndPublishButton } from \"~/presentation/contentEntries/views/actions/SaveAndPublishButton.js\";\nimport { DeleteEntryMenuItem } from \"~/presentation/contentEntries/views/actions/DeleteEntryMenuItem.js\";\nimport { ShowRevisionListMenuItem } from \"~/presentation/contentEntries/views/actions/ShowRevisionListMenuItem.js\";\nimport { CreateNewRevisionButton } from \"~/presentation/contentEntries/views/actions/CreateNewRevisionButton.js\";\nimport { PublishOnlyButton } from \"~/presentation/contentEntries/views/actions/PublishOnlyButton.js\";\n\nconst { Browser } = InternalContentEntryListConfig;\nconst { Actions } = ContentEntryEditorConfig;\n\nexport const ContentEntriesModule = () => {\n return (\n <>\n <AdminConfig>\n <AdminConfig.Dialog\n name={TRASH_ENTRY_DIALOG}\n element={<TrashEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={PUBLISH_ENTRY_DIALOG}\n element={<PublishEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={UNPUBLISH_ENTRY_DIALOG}\n element={<UnpublishEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={DELETE_REVISION_DIALOG}\n element={<DeleteRevisionConfirmDialog />}\n />\n </AdminConfig>\n <InternalContentEntryListConfig>\n <AdvancedSearchConfigs />\n <IsModelPublishable>\n <Browser.Filter name={\"status\"} element={<FilterByStatus />} />\n <Browser.BulkAction name={\"publish\"} element={<ActionPublish />} />\n <Browser.BulkAction name={\"unpublish\"} element={<ActionUnpublish />} />\n </IsModelPublishable>\n <Browser.Sidebar.Footer name={\"trashBin\"} element={<CmsTrashBin />} />\n <Browser.BulkAction name={\"move\"} element={<ActionMove />} />\n <Browser.BulkAction name={\"delete\"} element={<ActionDelete />} />\n <Browser.Folder.Action name={\"edit\"} element={<EditFolder />} />\n <Browser.Folder.Action name={\"permissions\"} element={<SetFolderPermissions />} />\n <Browser.Folder.Action name={\"delete\"} element={<DeleteFolder />} />\n <Browser.Entry.Action name={\"edit\"} element={<EditEntry />} />\n <IsModelPublishable>\n <Browser.Entry.Action name={\"status\"} element={<ChangeEntryStatus />} />\n </IsModelPublishable>\n <Browser.Entry.Action name={\"move\"} element={<MoveEntry />} />\n <Browser.Entry.Action name={\"delete\"} element={<DeleteEntry />} after={\"$last\"} />\n <Browser.Table.Column\n name={\"name\"}\n header={\"Name\"}\n cell={<CellName />}\n sortable={true}\n hideable={false}\n size={200}\n />\n <Browser.Table.Column name={\"createdBy\"} header={\"Author\"} cell={<CellAuthor />} />\n <Browser.Table.Column\n name={\"createdOn\"}\n header={\"Created\"}\n cell={<CellCreated />}\n sortable={true}\n />\n <Browser.Table.Column\n name={\"savedOn\"}\n header={\"Modified\"}\n cell={<CellModified />}\n sortable={true}\n />\n <IsModelPublishable>\n <Browser.Table.Column\n name={\"status\"}\n header={\"Status\"}\n cell={<CellStatus />}\n truncate={false}\n />\n <Browser.Table.Column\n name={\"live\"}\n header={\"Live\"}\n truncate={false}\n cell={<CellLive />}\n />\n </IsModelPublishable>\n <Browser.Table.Column\n name={\"actions\"}\n header={\"\"}\n cell={<CellActions />}\n size={56}\n resizable={false}\n hideable={false}\n truncate={false}\n className={\"flex justify-center\"}\n />\n </InternalContentEntryListConfig>\n <ContentEntryEditorConfig>\n <IsModelPublishable>\n <Actions.ButtonAction\n name={\"revisionSelector\"}\n element={<RevisionSelector />}\n />\n </IsModelPublishable>\n <Actions.ButtonAction name={\"optionsMenu\"} element={<ContentFormOptionsMenu />} />\n <Actions.ButtonAction name={\"save\"} element={<SaveContentButton />} />\n <IsModelPublishable>\n <Actions.ButtonAction\n name={\"cms/createNewRevision\"}\n element={<CreateNewRevisionButton />}\n />\n <Actions.ButtonAction name={\"publish\"} element={<SaveAndPublishButton />} />\n <Actions.ButtonAction name={\"publishOnly\"} element={<PublishOnlyButton />} />\n </IsModelPublishable>\n <Actions.MenuItemAction\n name={\"delete\"}\n element={<DeleteEntryMenuItem />}\n after={\"$last\"}\n />\n <IsModelPublishable>\n <Actions.MenuItemAction\n name={\"showRevisionsList\"}\n element={<ShowRevisionListMenuItem />}\n />\n </IsModelPublishable>\n </ContentEntryEditorConfig>\n </>\n );\n};\n"],"names":["Browser","InternalContentEntryListConfig","Actions","ContentEntryEditorConfig","ContentEntriesModule","AdminConfig","TRASH_ENTRY_DIALOG","TrashEntryConfirmDialog","PUBLISH_ENTRY_DIALOG","PublishEntryConfirmDialog","UNPUBLISH_ENTRY_DIALOG","UnpublishEntryConfirmDialog","DELETE_REVISION_DIALOG","DeleteRevisionConfirmDialog","AdvancedSearchConfigs","IsModelPublishable","FilterByStatus","ActionPublish","ActionUnpublish","CmsTrashBin","ActionMove","ActionDelete","EditFolder","SetFolderPermissions","DeleteFolder","EditEntry","ChangeEntryStatus","MoveEntry","DeleteEntry","CellName","CellAuthor","CellCreated","CellModified","CellStatus","CellLive","CellActions","RevisionSelector","ContentFormOptionsMenu","SaveContentButton","CreateNewRevisionButton","SaveAndPublishButton","PublishOnlyButton","DeleteE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QAClB,MAAM;QACN,WAAW;QACX,UAAU;QACV,UAAU;QACV,WAAW;uBAGnB,oBAAChC,0BAAwBA,MAAAA,WAAAA,GACrB,oBAACY,oBAAkBA,MAAAA,WAAAA,GACf,oBAACb,QAAQ,YAAY;QACjB,MAAM;QACN,uBAAS,oBAACkC,kBAAgBA;uBAGlC,oBAAClC,QAAQ,YAAY;QAAC,MAAM;QAAe,uBAAS,oBAACmC,wBAAsBA;sBAC3E,oBAACnC,QAAQ,YAAY;QAAC,MAAM;QAAQ,uBAAS,oBAACoC,mBAAiBA;sBAC/D,oBAACvB,oBAAkBA,MAAAA,WAAAA,GACf,oBAACb,QAAQ,YAAY;QACjB,MAAM;QACN,uBAAS,oBAACqC,yBAAuBA;sBAErC,oBAACrC,QAAQ,YAAY;QAAC,MAAM;QAAW,uBAAS,oBAACsC,sBAAoBA;sBACrE,oBAACtC,QAAQ,YAAY;QAAC,MAAM;QAAe,uBAAS,oBAACuC,mBAAiBA;uBAE1E,oBAACvC,QAAQ,cAAc;QACnB,MAAM;QACN,uBAAS,oBAACwC,qBAAmBA;QAC7B,OAAO;sBAEX,oBAAC3B,oBAAkBA,MAAAA,WAAAA,GACf,oBAACb,QAAQ,cAAc;QACnB,MAAM;QACN,uBAAS,oBAACyC,0BAAwBA"}
|
|
1
|
+
{"version":3,"file":"ContentEntriesModule.js","sources":["../src/ContentEntriesModule.tsx"],"sourcesContent":["import React from \"react\";\nimport { AdminConfig } from \"@webiny/app-admin\";\nimport { AdvancedSearchConfigs } from \"@webiny/app-aco/components/AdvancedSearch/AdvancedSearchConfigs\";\nimport {\n InternalContentEntryEditorConfig,\n InternalContentEntryListConfig\n} from \"~/admin/config/contentEntries/index.js\";\n\nimport {\n ActionDelete,\n ActionMove,\n ActionPublish,\n ActionUnpublish\n} from \"~/admin/components/ContentEntries/BulkActions/index.js\";\n\nimport {\n TRASH_ENTRY_DIALOG,\n PUBLISH_ENTRY_DIALOG,\n UNPUBLISH_ENTRY_DIALOG\n} from \"~/presentation/contentEntries/list/ContentEntriesPresenter.js\";\nimport { DeleteFolder, EditFolder, SetFolderPermissions } from \"@webiny/app-aco\";\nimport {\n ChangeEntryStatus,\n DeleteEntry,\n EditEntry,\n MoveEntry\n} from \"~/admin/components/ContentEntries/Table/Actions/index.js\";\nimport {\n CellActions,\n CellAuthor,\n CellCreated,\n CellLive,\n CellModified,\n CellName,\n CellStatus\n} from \"~/admin/components/ContentEntries/Table/Cells/index.js\";\nimport { IsModelPublishable } from \"~/admin/components/IsModelPublishable.js\";\nimport { FilterByStatus } from \"~/admin/components/ContentEntries/FilterByStatus.js\";\nimport { CmsTrashBin } from \"~/presentation/contentEntries/trashBin/CmsTrashBin.js\";\nimport { TrashEntryConfirmDialog } from \"~/admin/components/Dialogs/TrashEntryConfirmDialog.js\";\nimport { PublishEntryConfirmDialog } from \"~/admin/components/Dialogs/PublishEntryConfirmDialog.js\";\nimport { UnpublishEntryConfirmDialog } from \"~/admin/components/Dialogs/UnpublishEntryConfirmDialog.js\";\nimport { DeleteRevisionConfirmDialog } from \"~/admin/components/Dialogs/DeleteRevisionConfirmDialog.js\";\nimport { DELETE_REVISION_DIALOG } from \"~/presentation/contentEntries/revisionsList/RevisionsListPresenter.js\";\nimport { RevisionSelector } from \"~/presentation/contentEntries/views/actions/RevisionSelector.js\";\nimport { ContentFormOptionsMenu } from \"~/presentation/contentEntries/views/actions/ContentFormOptionsMenu.js\";\nimport { SaveContentButton } from \"~/presentation/contentEntries/views/actions/SaveContentButton.js\";\nimport { SaveAndPublishButton } from \"~/presentation/contentEntries/views/actions/SaveAndPublishButton.js\";\nimport { DeleteEntryMenuItem } from \"~/presentation/contentEntries/views/actions/DeleteEntryMenuItem.js\";\nimport { ShowRevisionListMenuItem } from \"~/presentation/contentEntries/views/actions/ShowRevisionListMenuItem.js\";\nimport { CreateNewRevisionButton } from \"~/presentation/contentEntries/views/actions/CreateNewRevisionButton.js\";\nimport { PublishOnlyButton } from \"~/presentation/contentEntries/views/actions/PublishOnlyButton.js\";\n\nconst { Browser } = InternalContentEntryListConfig;\nconst { Actions } = InternalContentEntryEditorConfig;\n\nexport const ContentEntriesModule = () => {\n return (\n <>\n <AdminConfig>\n <AdminConfig.Dialog\n name={TRASH_ENTRY_DIALOG}\n element={<TrashEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={PUBLISH_ENTRY_DIALOG}\n element={<PublishEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={UNPUBLISH_ENTRY_DIALOG}\n element={<UnpublishEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={DELETE_REVISION_DIALOG}\n element={<DeleteRevisionConfirmDialog />}\n />\n </AdminConfig>\n <InternalContentEntryListConfig>\n <AdvancedSearchConfigs />\n <IsModelPublishable>\n <Browser.Filter name={\"status\"} element={<FilterByStatus />} />\n <Browser.BulkAction name={\"publish\"} element={<ActionPublish />} />\n <Browser.BulkAction name={\"unpublish\"} element={<ActionUnpublish />} />\n </IsModelPublishable>\n <Browser.Sidebar.Footer name={\"trashBin\"} element={<CmsTrashBin />} />\n <Browser.BulkAction name={\"move\"} element={<ActionMove />} />\n <Browser.BulkAction name={\"delete\"} element={<ActionDelete />} />\n <Browser.Folder.Action name={\"edit\"} element={<EditFolder />} />\n <Browser.Folder.Action name={\"permissions\"} element={<SetFolderPermissions />} />\n <Browser.Folder.Action name={\"delete\"} element={<DeleteFolder />} />\n <Browser.Entry.Action name={\"edit\"} element={<EditEntry />} />\n <IsModelPublishable>\n <Browser.Entry.Action name={\"status\"} element={<ChangeEntryStatus />} />\n </IsModelPublishable>\n <Browser.Entry.Action name={\"move\"} element={<MoveEntry />} />\n <Browser.Entry.Action name={\"delete\"} element={<DeleteEntry />} after={\"$last\"} />\n <Browser.Table.Column\n name={\"name\"}\n header={\"Name\"}\n cell={<CellName />}\n sortable={true}\n hideable={false}\n size={200}\n />\n <Browser.Table.Column name={\"createdBy\"} header={\"Author\"} cell={<CellAuthor />} />\n <Browser.Table.Column\n name={\"createdOn\"}\n header={\"Created\"}\n cell={<CellCreated />}\n sortable={true}\n />\n <Browser.Table.Column\n name={\"savedOn\"}\n header={\"Modified\"}\n cell={<CellModified />}\n sortable={true}\n />\n <IsModelPublishable>\n <Browser.Table.Column\n name={\"status\"}\n header={\"Status\"}\n cell={<CellStatus />}\n truncate={false}\n />\n <Browser.Table.Column\n name={\"live\"}\n header={\"Live\"}\n truncate={false}\n cell={<CellLive />}\n />\n </IsModelPublishable>\n <Browser.Table.Column\n name={\"actions\"}\n header={\"\"}\n cell={<CellActions />}\n size={56}\n resizable={false}\n hideable={false}\n truncate={false}\n className={\"flex justify-center\"}\n />\n </InternalContentEntryListConfig>\n <InternalContentEntryEditorConfig>\n <IsModelPublishable>\n <Actions.ButtonAction\n name={\"revisionSelector\"}\n element={<RevisionSelector />}\n />\n </IsModelPublishable>\n <Actions.ButtonAction name={\"optionsMenu\"} element={<ContentFormOptionsMenu />} />\n <Actions.ButtonAction name={\"save\"} element={<SaveContentButton />} />\n <IsModelPublishable>\n <Actions.ButtonAction\n name={\"cms/createNewRevision\"}\n element={<CreateNewRevisionButton />}\n />\n <Actions.ButtonAction name={\"publish\"} element={<SaveAndPublishButton />} />\n <Actions.ButtonAction name={\"publishOnly\"} element={<PublishOnlyButton />} />\n </IsModelPublishable>\n <Actions.MenuItemAction\n name={\"delete\"}\n element={<DeleteEntryMenuItem />}\n after={\"$last\"}\n />\n <IsModelPublishable>\n <Actions.MenuItemAction\n name={\"showRevisionsList\"}\n element={<ShowRevisionListMenuItem />}\n />\n </IsModelPublishable>\n </InternalContentEntryEditorConfig>\n </>\n );\n};\n"],"names":["Browser","InternalContentEntryListConfig","Actions","InternalContentEntryEditorConfig","ContentEntriesModule","AdminConfig","TRASH_ENTRY_DIALOG","TrashEntryConfirmDialog","PUBLISH_ENTRY_DIALOG","PublishEntryConfirmDialog","UNPUBLISH_ENTRY_DIALOG","UnpublishEntryConfirmDialog","DELETE_REVISION_DIALOG","DeleteRevisionConfirmDialog","AdvancedSearchConfigs","IsModelPublishable","FilterByStatus","ActionPublish","ActionUnpublish","CmsTrashBin","ActionMove","ActionDelete","EditFolder","SetFolderPermissions","DeleteFolder","EditEntry","ChangeEntryStatus","MoveEntry","DeleteEntry","CellName","CellAuthor","CellCreated","CellModified","CellStatus","CellLive","CellActions","RevisionSelector","ContentFormOptionsMenu","SaveContentButton","CreateNewRevisionButton","SaveAndPublishButton","PublishOnlyButton","DeleteEntryMenuItem","ShowRevisionListMenuItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAM,EAAEA,SAAAA,OAAO,EAAE,GAAGC;AACpB,MAAM,EAAEC,SAAAA,OAAO,EAAE,GAAGC;AAEb,MAAMC,uBAAuB,IACzB,WAAP,GACI,wDACI,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACA,YAAY,MAAM;QACf,MAAMC;QACN,uBAAS,oBAACC,yBAAuBA;sBAErC,oBAACF,YAAY,MAAM;QACf,MAAMG;QACN,uBAAS,oBAACC,2BAAyBA;sBAEvC,oBAACJ,YAAY,MAAM;QACf,MAAMK;QACN,uBAAS,oBAACC,6BAA2BA;sBAEzC,oBAACN,YAAY,MAAM;QACf,MAAMO;QACN,uBAAS,oBAACC,6BAA2BA;uBAG7C,oBAACZ,gCAA8BA,MAAAA,WAAAA,GAC3B,oBAACa,uBAAqBA,OAAAA,WAAAA,GACtB,oBAACC,oBAAkBA,MAAAA,WAAAA,GACf,oBAACf,QAAQ,MAAM;QAAC,MAAM;QAAU,uBAAS,oBAACgB,gBAAcA;sBACxD,oBAAChB,QAAQ,UAAU;QAAC,MAAM;QAAW,uBAAS,oBAACiB,eAAaA;sBAC5D,oBAACjB,QAAQ,UAAU;QAAC,MAAM;QAAa,uBAAS,oBAACkB,iBAAeA;uBAEpE,oBAAClB,QAAQ,OAAO,CAAC,MAAM;QAAC,MAAM;QAAY,uBAAS,oBAACmB,aAAWA;sBAC/D,oBAACnB,QAAQ,UAAU;QAAC,MAAM;QAAQ,uBA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C,MAAM;QACjB,MAAM;QACN,QAAQ;QACR,oBAAM,oBAACiC,YAAUA;QACjB,UAAU;sBAEd,oBAACjC,QAAQ,KAAK,CAAC,MAAM;QACjB,MAAM;QACN,QAAQ;QACR,UAAU;QACV,oBAAM,oBAACkC,UAAQA;uBAGvB,oBAAClC,QAAQ,KAAK,CAAC,MAAM;QACjB,MAAM;QACN,QAAQ;QACR,oBAAM,oBAACmC,aAAWA;QAClB,MAAM;QACN,WAAW;QACX,UAAU;QACV,UAAU;QACV,WAAW;uBAGnB,oBAAChC,kCAAgCA,MAAAA,WAAAA,GAC7B,oBAACY,oBAAkBA,MAAAA,WAAAA,GACf,oBAACb,QAAQ,YAAY;QACjB,MAAM;QACN,uBAAS,oBAACkC,kBAAgBA;uBAGlC,oBAAClC,QAAQ,YAAY;QAAC,MAAM;QAAe,uBAAS,oBAACmC,wBAAsBA;sBAC3E,oBAACnC,QAAQ,YAAY;QAAC,MAAM;QAAQ,uBAAS,oBAACoC,mBAAiBA;sBAC/D,oBAACvB,oBAAkBA,MAAAA,WAAAA,GACf,oBAACb,QAAQ,YAAY;QACjB,MAAM;QACN,uBAAS,oBAACqC,yBAAuBA;sBAErC,oBAACrC,QAAQ,YAAY;QAAC,MAAM;QAAW,uBAAS,oBAACsC,sBAAoBA;sBACrE,oBAACtC,QAAQ,YAAY;QAAC,MAAM;QAAe,uBAAS,oBAACuC,mBAAiBA;uBAE1E,oBAACvC,QAAQ,cAAc;QACnB,MAAM;QACN,uBAAS,oBAACwC,qBAAmBA;QAC7B,OAAO;sBAEX,oBAAC3B,oBAAkBA,MAAAA,WAAAA,GACf,oBAACb,QAAQ,cAAc;QACnB,MAAM;QACN,uBAAS,oBAACyC,0BAAwBA"}
|
package/HeadlessCMS.js
CHANGED
|
@@ -37,7 +37,10 @@ import { CmsAccessControlRulesRenderer } from "./presentation/fieldEditor/render
|
|
|
37
37
|
import { CmsConditionRulesRenderer } from "./presentation/fieldEditor/renderers/CmsConditionRulesRenderer.js";
|
|
38
38
|
import { EDIT_DZ_TEMPLATE_DIALOG, EditTemplateDialog } from "./presentation/fieldTypes/types/dynamicZone/EditTemplateDialog.js";
|
|
39
39
|
import { ContentEntriesModule } from "./ContentEntriesModule.js";
|
|
40
|
-
import { CmsPlaygroundTabsFeature } from "./admin/features/playgroundTabs/
|
|
40
|
+
import { CmsPlaygroundTabsFeature } from "./admin/features/playgroundTabs/feature.js";
|
|
41
|
+
import { PreviewDecorator } from "./presentation/contentEntries/preview/PreviewDecorator.js";
|
|
42
|
+
import { ModelEditorComponentDiscovery } from "./presentation/contentEntries/preview/ModelEditorComponentDiscovery.js";
|
|
43
|
+
import { LivePreviewFeature } from "./presentation/contentEntries/preview/feature.js";
|
|
41
44
|
const HeadlessCMSExtension = ()=>{
|
|
42
45
|
plugins.register(admin_plugins());
|
|
43
46
|
return /*#__PURE__*/ react.createElement(Fragment, null, /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
@@ -68,6 +71,8 @@ const HeadlessCMSExtension = ()=>{
|
|
|
68
71
|
feature: CmsFormModelFeature
|
|
69
72
|
}), /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
70
73
|
feature: ContentEntryFeature
|
|
74
|
+
}), /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
75
|
+
feature: LivePreviewFeature
|
|
71
76
|
}), /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
72
77
|
feature: CmsFieldRendererFeature
|
|
73
78
|
}), /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
@@ -78,7 +83,7 @@ const HeadlessCMSExtension = ()=>{
|
|
|
78
83
|
feature: CmsFieldValidatorFeature
|
|
79
84
|
}), /*#__PURE__*/ react.createElement(RegisterFeature, {
|
|
80
85
|
feature: CmsPlaygroundTabsFeature
|
|
81
|
-
}), /*#__PURE__*/ react.createElement(RoutesConfig, null), /*#__PURE__*/ react.createElement(LexicalEditorCmsPlugin, null), /*#__PURE__*/ react.createElement(CmsSecurityPermission, null), /*#__PURE__*/ react.createElement(ContentEntriesModule, null), /*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(AdminConfig.Dialog, {
|
|
86
|
+
}), /*#__PURE__*/ react.createElement(RoutesConfig, null), /*#__PURE__*/ react.createElement(LexicalEditorCmsPlugin, null), /*#__PURE__*/ react.createElement(CmsSecurityPermission, null), /*#__PURE__*/ react.createElement(ContentEntriesModule, null), /*#__PURE__*/ react.createElement(PreviewDecorator, null), /*#__PURE__*/ react.createElement(ModelEditorComponentDiscovery, null), /*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(AdminConfig.Dialog, {
|
|
82
87
|
name: EDIT_DZ_TEMPLATE_DIALOG,
|
|
83
88
|
element: /*#__PURE__*/ react.createElement(EditTemplateDialog, null)
|
|
84
89
|
}), /*#__PURE__*/ react.createElement(AdminConfig.Form.FieldRenderer, {
|
package/HeadlessCMS.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeadlessCMS.js","sources":["../src/HeadlessCMS.tsx"],"sourcesContent":["import React, { Fragment, memo } from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AdminConfig, RegisterFeature } from \"@webiny/app-admin\";\nimport headlessCmsPlugins from \"~/admin/plugins/index.js\";\nimport { LexicalEditorCmsPlugin } from \"~/admin/components/LexicalCmsEditor/LexicalEditorCmsPlugin.js\";\nimport { RoutesConfig } from \"./admin/RoutesConfig.js\";\nimport { CmsSecurityPermission } from \"~/admin/plugins/permissionRenderer/index.js\";\nimport { CmsPermissionsFeature } from \"~/features/permissions/feature.js\";\nimport { CmsGraphQLClientFeature } from \"~/features/graphQLClient/feature.js\";\nimport { ModelFeature } from \"~/features/model/feature.js\";\nimport { ListFolderPermissionsTargetsFeature } from \"~/features/listFolderPermissionsTargets/feature.js\";\nimport { ModelGroupFeature } from \"~/features/modelGroup/feature.js\";\nimport { ModelGroupPresenterFeature } from \"~/presentation/modelGroup/feature.js\";\nimport { ContentGroupsMenuPresenterFeature } from \"~/presentation/contentGroupsMenu/feature.js\";\nimport { ContentModelsPresenterFeature } from \"~/presentation/contentModels/feature.js\";\nimport { NewContentModelPresenterFeature } from \"~/presentation/newContentModel/feature.js\";\nimport { CloneContentModelPresenterFeature } from \"~/presentation/cloneContentModel/feature.js\";\nimport { ImportContentModelsPresenterFeature } from \"~/presentation/importContentModels/feature.js\";\nimport { CmsIconPickerRenderer } from \"~/presentation/fieldRenderers/CmsIconPickerRenderer.js\";\nimport { FormModelFeature } from \"@webiny/app-admin/features/formModel/feature.js\";\nimport { CmsFormModelFeature } from \"~/features/formModel/feature.js\";\nimport { ContentEntryFeature } from \"~/features/contentEntry/feature.js\";\nimport { CmsRefInputRenderer } from \"~/presentation/fieldRenderers/ref/CmsRefInputRenderer.js\";\nimport { CmsRefInputsRenderer } from \"~/presentation/fieldRenderers/ref/CmsRefInputsRenderer.js\";\nimport { CmsRefSimpleSingleRenderer } from \"~/presentation/fieldRenderers/ref/CmsRefSimpleSingleRenderer.js\";\nimport { CmsRefSimpleMultipleRenderer } from \"~/presentation/fieldRenderers/ref/CmsRefSimpleMultipleRenderer.js\";\nimport { CmsRefDetailedSingleRenderer } from \"~/presentation/fieldRenderers/ref/CmsRefDetailedSingleRenderer.js\";\nimport { CmsRefDetailedMultipleRenderer } from \"~/presentation/fieldRenderers/ref/CmsRefDetailedMultipleRenderer.js\";\nimport { CmsFieldRendererFeature } from \"~/presentation/fieldRenderers/feature.js\";\nimport { CmsFieldTypeFeature } from \"~/presentation/fieldTypes/feature.js\";\nimport { FieldEditorFeature } from \"~/presentation/fieldEditor/feature.js\";\nimport { CmsFieldValidatorFeature } from \"~/presentation/fieldValidators/feature.js\";\nimport { CmsAppearanceRenderer } from \"~/presentation/fieldEditor/renderers/CmsRendererSelectorRenderer.js\";\nimport { CmsPredefinedValuesRenderer } from \"~/presentation/fieldEditor/renderers/CmsPredefinedValuesRenderer.js\";\nimport { CmsValidatorItemRenderer } from \"~/presentation/fieldEditor/renderers/CmsValidatorsRenderer.js\";\nimport { CmsAccessControlRulesRenderer } from \"~/presentation/fieldEditor/renderers/CmsAccessControlRulesRenderer.js\";\nimport { CmsConditionRulesRenderer } from \"~/presentation/fieldEditor/renderers/CmsConditionRulesRenderer.js\";\nimport {\n EditTemplateDialog,\n EDIT_DZ_TEMPLATE_DIALOG\n} from \"~/presentation/fieldTypes/types/dynamicZone/EditTemplateDialog.js\";\nimport { ContentEntriesModule } from \"~/ContentEntriesModule.js\";\nimport { CmsPlaygroundTabsFeature } from \"~/admin/features/playgroundTabs/index.js\";\n\nconst HeadlessCMSExtension = () => {\n plugins.register(headlessCmsPlugins());\n\n return (\n <Fragment>\n <RegisterFeature feature={CmsPermissionsFeature} />\n <RegisterFeature feature={CmsGraphQLClientFeature} />\n <RegisterFeature feature={ModelFeature} />\n <RegisterFeature feature={ModelGroupFeature} />\n <RegisterFeature feature={ListFolderPermissionsTargetsFeature} />\n <RegisterFeature feature={ModelGroupPresenterFeature} />\n <RegisterFeature feature={ContentGroupsMenuPresenterFeature} />\n <RegisterFeature feature={ContentModelsPresenterFeature} />\n <RegisterFeature feature={NewContentModelPresenterFeature} />\n <RegisterFeature feature={CloneContentModelPresenterFeature} />\n <RegisterFeature feature={ImportContentModelsPresenterFeature} />\n <RegisterFeature feature={FormModelFeature} />\n <RegisterFeature feature={CmsFormModelFeature} />\n <RegisterFeature feature={ContentEntryFeature} />\n <RegisterFeature feature={CmsFieldRendererFeature} />\n <RegisterFeature feature={CmsFieldTypeFeature} />\n <RegisterFeature feature={FieldEditorFeature} />\n <RegisterFeature feature={CmsFieldValidatorFeature} />\n <RegisterFeature feature={CmsPlaygroundTabsFeature} />\n <RoutesConfig />\n <LexicalEditorCmsPlugin />\n <CmsSecurityPermission />\n <ContentEntriesModule />\n <AdminConfig>\n <AdminConfig.Dialog\n name={EDIT_DZ_TEMPLATE_DIALOG}\n element={<EditTemplateDialog />}\n />\n <AdminConfig.Form.FieldRenderer name={\"refInput\"} component={CmsRefInputRenderer} />\n <AdminConfig.Form.FieldRenderer\n name={\"refInputs\"}\n component={CmsRefInputsRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"refSimpleSingle\"}\n component={CmsRefSimpleSingleRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"refSimpleMultiple\"}\n component={CmsRefSimpleMultipleRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"refDetailedSingle\"}\n component={CmsRefDetailedSingleRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"refDetailedMultiple\"}\n component={CmsRefDetailedMultipleRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsAppearance\"}\n component={CmsAppearanceRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsPredefinedValues\"}\n component={CmsPredefinedValuesRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsValidatorItem\"}\n component={CmsValidatorItemRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsAccessControlRules\"}\n component={CmsAccessControlRulesRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsIconPicker\"}\n component={CmsIconPickerRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsConditionRules\"}\n component={CmsConditionRulesRenderer}\n />\n </AdminConfig>\n </Fragment>\n );\n};\n\nexport const HeadlessCMS = memo(HeadlessCMSExtension);\n"],"names":["HeadlessCMSExtension","plugins","headlessCmsPlugins","Fragment","RegisterFeature","CmsPermissionsFeature","CmsGraphQLClientFeature","ModelFeature","ModelGroupFeature","ListFolderPermissionsTargetsFeature","ModelGroupPresenterFeature","ContentGroupsMenuPresenterFeature","ContentModelsPresenterFeature","NewContentModelPresenterFeature","CloneContentModelPresenterFeature","ImportContentModelsPresenterFeature","FormModelFeature","CmsFormModelFeature","ContentEntryFeature","CmsFieldRendererFeature","CmsFieldTypeFeature","FieldEditorFeature","CmsFieldValidatorFeature","CmsPlaygroundTabsFeature","RoutesConfig","LexicalEditorCmsPlugin","CmsSecurityPermission","ContentEntriesModule","AdminConfig","EDIT_DZ_TEMPLATE_DIALOG","EditTemplateDialog","CmsRefInputRenderer","CmsRefInputsRenderer","CmsRefSimpleSingleRenderer","CmsRefSimpleMultipleRenderer","CmsRefDetailedSingleRenderer","CmsRefDetailedMultipleRenderer","CmsAppearanceRenderer","CmsPredefinedValuesRenderer","CmsValidatorItemRenderer","CmsAccessControlRulesRenderer","CmsIconPickerRenderer","CmsConditionRulesRenderer","HeadlessCMS","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAMA,uBAAuB;IACzBC,QAAQ,QAAQ,CAACC;IAEjB,OAAO,WAAP,GACI,oBAACC,UAAQA,MAAAA,WAAAA,GACL,oBAACC,iBAAeA;QAAC,SAASC;sBAC1B,oBAACD,iBAAeA;QAAC,SAASE;sBAC1B,oBAACF,iBAAeA;QAAC,SAASG;sBAC1B,oBAACH,iBAAeA;QAAC,SAASI;sBAC1B,oBAACJ,iBAAeA;QAAC,SAASK;sBAC1B,oBAACL,iBAAeA;QAAC,SAASM;sBAC1B,oBAACN,iBAAeA;QAAC,SAASO;sBAC1B,oBAACP,iBAAeA;QAAC,SAASQ;sBAC1B,oBAACR,iBAAeA;QAAC,SAASS;sBAC1B,oBAACT,iBAAeA;QAAC,SAASU;sBAC1B,oBAACV,iBAAeA;QAAC,SAASW;sBAC1B,oBAACX,iBAAeA;QAAC,SAASY;sBAC1B,oBAACZ,iBAAeA;QAAC,SAASa;sBAC1B,oBAACb,iBAAeA;QAAC,SAASc;sBAC1B,oBAACd,iBAAeA;QAAC,SAASe;sBAC1B,oBAACf,iBAAeA;QAAC,SAASgB;sBAC1B,oBAAChB,iBAAeA;QAAC,SAASiB;sBAC1B,oBAACjB,iBAAeA;QAAC,SAASkB;sBAC1B,oBAAClB,iBAAeA;QAAC,SAASmB;sBAC1B,oBAACC,cAAYA,OAAAA,WAAAA,GACb,oBAACC,wBAAsBA,OAAAA,WAAAA,GACvB,oBAACC,uBAAqBA,OAAAA,WAAAA,GACtB,oBAACC,sBAAoBA,OAAAA,WAAAA,GACrB,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACA,YAAY,MAAM;QACf,MAAMC;QACN,uBAAS,oBAACC,oBAAkBA;sBAEhC,oBAACF,YAAY,IAAI,CAAC,aAAa;QAAC,MAAM;QAAY,WAAWG;sBAC7D,oBAACH,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWI;sBAEf,oBAACJ,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWK;sBAEf,oBAACL,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWM;sBAEf,oBAACN,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWO;sBAEf,oBAACP,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWQ;sBAEf,oBAACR,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWS;sBAEf,oBAACT,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWU;sBAEf,oBAACV,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWW;sBAEf,oBAACX,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWY;sBAEf,oBAACZ,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWa;sBAEf,oBAACb,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWc;;AAK/B;AAEO,MAAMC,cAAc,WAAHA,GAAGC,KAAK5C"}
|
|
1
|
+
{"version":3,"file":"HeadlessCMS.js","sources":["../src/HeadlessCMS.tsx"],"sourcesContent":["import React, { Fragment, memo } from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { AdminConfig, RegisterFeature } from \"@webiny/app-admin\";\nimport headlessCmsPlugins from \"~/admin/plugins/index.js\";\nimport { LexicalEditorCmsPlugin } from \"~/admin/components/LexicalCmsEditor/LexicalEditorCmsPlugin.js\";\nimport { RoutesConfig } from \"./admin/RoutesConfig.js\";\nimport { CmsSecurityPermission } from \"~/admin/plugins/permissionRenderer/index.js\";\nimport { CmsPermissionsFeature } from \"~/features/permissions/feature.js\";\nimport { CmsGraphQLClientFeature } from \"~/features/graphQLClient/feature.js\";\nimport { ModelFeature } from \"~/features/model/feature.js\";\nimport { ListFolderPermissionsTargetsFeature } from \"~/features/listFolderPermissionsTargets/feature.js\";\nimport { ModelGroupFeature } from \"~/features/modelGroup/feature.js\";\nimport { ModelGroupPresenterFeature } from \"~/presentation/modelGroup/feature.js\";\nimport { ContentGroupsMenuPresenterFeature } from \"~/presentation/contentGroupsMenu/feature.js\";\nimport { ContentModelsPresenterFeature } from \"~/presentation/contentModels/feature.js\";\nimport { NewContentModelPresenterFeature } from \"~/presentation/newContentModel/feature.js\";\nimport { CloneContentModelPresenterFeature } from \"~/presentation/cloneContentModel/feature.js\";\nimport { ImportContentModelsPresenterFeature } from \"~/presentation/importContentModels/feature.js\";\nimport { CmsIconPickerRenderer } from \"~/presentation/fieldRenderers/CmsIconPickerRenderer.js\";\nimport { FormModelFeature } from \"@webiny/app-admin/features/formModel/feature.js\";\nimport { CmsFormModelFeature } from \"~/features/formModel/feature.js\";\nimport { ContentEntryFeature } from \"~/features/contentEntry/feature.js\";\nimport { CmsRefInputRenderer } from \"~/presentation/fieldRenderers/ref/CmsRefInputRenderer.js\";\nimport { CmsRefInputsRenderer } from \"~/presentation/fieldRenderers/ref/CmsRefInputsRenderer.js\";\nimport { CmsRefSimpleSingleRenderer } from \"~/presentation/fieldRenderers/ref/CmsRefSimpleSingleRenderer.js\";\nimport { CmsRefSimpleMultipleRenderer } from \"~/presentation/fieldRenderers/ref/CmsRefSimpleMultipleRenderer.js\";\nimport { CmsRefDetailedSingleRenderer } from \"~/presentation/fieldRenderers/ref/CmsRefDetailedSingleRenderer.js\";\nimport { CmsRefDetailedMultipleRenderer } from \"~/presentation/fieldRenderers/ref/CmsRefDetailedMultipleRenderer.js\";\nimport { CmsFieldRendererFeature } from \"~/presentation/fieldRenderers/feature.js\";\nimport { CmsFieldTypeFeature } from \"~/presentation/fieldTypes/feature.js\";\nimport { FieldEditorFeature } from \"~/presentation/fieldEditor/feature.js\";\nimport { CmsFieldValidatorFeature } from \"~/presentation/fieldValidators/feature.js\";\nimport { CmsAppearanceRenderer } from \"~/presentation/fieldEditor/renderers/CmsRendererSelectorRenderer.js\";\nimport { CmsPredefinedValuesRenderer } from \"~/presentation/fieldEditor/renderers/CmsPredefinedValuesRenderer.js\";\nimport { CmsValidatorItemRenderer } from \"~/presentation/fieldEditor/renderers/CmsValidatorsRenderer.js\";\nimport { CmsAccessControlRulesRenderer } from \"~/presentation/fieldEditor/renderers/CmsAccessControlRulesRenderer.js\";\nimport { CmsConditionRulesRenderer } from \"~/presentation/fieldEditor/renderers/CmsConditionRulesRenderer.js\";\nimport {\n EditTemplateDialog,\n EDIT_DZ_TEMPLATE_DIALOG\n} from \"~/presentation/fieldTypes/types/dynamicZone/EditTemplateDialog.js\";\nimport { ContentEntriesModule } from \"~/ContentEntriesModule.js\";\nimport { CmsPlaygroundTabsFeature } from \"~/admin/features/playgroundTabs/feature.js\";\nimport { PreviewDecorator } from \"~/presentation/contentEntries/preview/PreviewDecorator.js\";\nimport { ModelEditorComponentDiscovery } from \"~/presentation/contentEntries/preview/ModelEditorComponentDiscovery.js\";\nimport { LivePreviewFeature } from \"~/presentation/contentEntries/preview/feature.js\";\n\nconst HeadlessCMSExtension = () => {\n plugins.register(headlessCmsPlugins());\n\n return (\n <Fragment>\n <RegisterFeature feature={CmsPermissionsFeature} />\n <RegisterFeature feature={CmsGraphQLClientFeature} />\n <RegisterFeature feature={ModelFeature} />\n <RegisterFeature feature={ModelGroupFeature} />\n <RegisterFeature feature={ListFolderPermissionsTargetsFeature} />\n <RegisterFeature feature={ModelGroupPresenterFeature} />\n <RegisterFeature feature={ContentGroupsMenuPresenterFeature} />\n <RegisterFeature feature={ContentModelsPresenterFeature} />\n <RegisterFeature feature={NewContentModelPresenterFeature} />\n <RegisterFeature feature={CloneContentModelPresenterFeature} />\n <RegisterFeature feature={ImportContentModelsPresenterFeature} />\n <RegisterFeature feature={FormModelFeature} />\n <RegisterFeature feature={CmsFormModelFeature} />\n <RegisterFeature feature={ContentEntryFeature} />\n <RegisterFeature feature={LivePreviewFeature} />\n <RegisterFeature feature={CmsFieldRendererFeature} />\n <RegisterFeature feature={CmsFieldTypeFeature} />\n <RegisterFeature feature={FieldEditorFeature} />\n <RegisterFeature feature={CmsFieldValidatorFeature} />\n <RegisterFeature feature={CmsPlaygroundTabsFeature} />\n <RoutesConfig />\n <LexicalEditorCmsPlugin />\n <CmsSecurityPermission />\n <ContentEntriesModule />\n <PreviewDecorator />\n <ModelEditorComponentDiscovery />\n <AdminConfig>\n <AdminConfig.Dialog\n name={EDIT_DZ_TEMPLATE_DIALOG}\n element={<EditTemplateDialog />}\n />\n <AdminConfig.Form.FieldRenderer name={\"refInput\"} component={CmsRefInputRenderer} />\n <AdminConfig.Form.FieldRenderer\n name={\"refInputs\"}\n component={CmsRefInputsRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"refSimpleSingle\"}\n component={CmsRefSimpleSingleRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"refSimpleMultiple\"}\n component={CmsRefSimpleMultipleRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"refDetailedSingle\"}\n component={CmsRefDetailedSingleRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"refDetailedMultiple\"}\n component={CmsRefDetailedMultipleRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsAppearance\"}\n component={CmsAppearanceRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsPredefinedValues\"}\n component={CmsPredefinedValuesRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsValidatorItem\"}\n component={CmsValidatorItemRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsAccessControlRules\"}\n component={CmsAccessControlRulesRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsIconPicker\"}\n component={CmsIconPickerRenderer}\n />\n <AdminConfig.Form.FieldRenderer\n name={\"cmsConditionRules\"}\n component={CmsConditionRulesRenderer}\n />\n </AdminConfig>\n </Fragment>\n );\n};\n\nexport const HeadlessCMS = memo(HeadlessCMSExtension);\n"],"names":["HeadlessCMSExtension","plugins","headlessCmsPlugins","Fragment","RegisterFeature","CmsPermissionsFeature","CmsGraphQLClientFeature","ModelFeature","ModelGroupFeature","ListFolderPermissionsTargetsFeature","ModelGroupPresenterFeature","ContentGroupsMenuPresenterFeature","ContentModelsPresenterFeature","NewContentModelPresenterFeature","CloneContentModelPresenterFeature","ImportContentModelsPresenterFeature","FormModelFeature","CmsFormModelFeature","ContentEntryFeature","LivePreviewFeature","CmsFieldRendererFeature","CmsFieldTypeFeature","FieldEditorFeature","CmsFieldValidatorFeature","CmsPlaygroundTabsFeature","RoutesConfig","LexicalEditorCmsPlugin","CmsSecurityPermission","ContentEntriesModule","PreviewDecorator","ModelEditorComponentDiscovery","AdminConfig","EDIT_DZ_TEMPLATE_DIALOG","EditTemplateDialog","CmsRefInputRenderer","CmsRefInputsRenderer","CmsRefSimpleSingleRenderer","CmsRefSimpleMultipleRenderer","CmsRefDetailedSingleRenderer","CmsRefDetailedMultipleRenderer","CmsAppearanceRenderer","CmsPredefinedValuesRenderer","CmsValidatorItemRenderer","CmsAccessControlRulesRenderer","CmsIconPickerRenderer","CmsConditionRulesRenderer","HeadlessCMS","memo"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,MAAMA,uBAAuB;IACzBC,QAAQ,QAAQ,CAACC;IAEjB,OAAO,WAAP,GACI,oBAACC,UAAQA,MAAAA,WAAAA,GACL,oBAACC,iBAAeA;QAAC,SAASC;sBAC1B,oBAACD,i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C,aAAa;QAC3B,MAAM;QACN,WAAWM;sBAEf,oBAACN,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWO;sBAEf,oBAACP,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWQ;sBAEf,oBAACR,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWS;sBAEf,oBAACT,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWU;sBAEf,oBAACV,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWW;sBAEf,oBAACX,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWY;sBAEf,oBAACZ,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWa;sBAEf,oBAACb,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWc;;AAK/B;AAEO,MAAMC,cAAc,WAAHA,GAAGC,KAAK/C"}
|
package/admin/RoutesConfig.js
CHANGED
|
@@ -16,11 +16,21 @@ const ContentModelEditor = /*#__PURE__*/ lazy(()=>import("./views/contentModels/
|
|
|
16
16
|
const ContentModelsView = /*#__PURE__*/ lazy(()=>import("../presentation/contentModels/components/ContentModels.js"));
|
|
17
17
|
const ContentModelGroupsView = /*#__PURE__*/ lazy(()=>import("../presentation/modelGroup/components/ContentModelGroups.js"));
|
|
18
18
|
const { Route: Route } = AdminConfig;
|
|
19
|
+
const CmsBreadcrumbsRoot = ()=>/*#__PURE__*/ react.createElement(AdminConfig.Breadcrumb, {
|
|
20
|
+
name: "cms",
|
|
21
|
+
label: "Headless CMS",
|
|
22
|
+
to: {
|
|
23
|
+
route: Routes.ContentModels.List
|
|
24
|
+
}
|
|
25
|
+
});
|
|
19
26
|
const RoutesConfig = ()=>/*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(Route, {
|
|
20
27
|
route: Routes.ContentModelGroups.List,
|
|
21
28
|
element: /*#__PURE__*/ react.createElement(SecureRoute, {
|
|
22
29
|
permission: "cms.contentModelGroup"
|
|
23
|
-
}, /*#__PURE__*/ react.createElement(AdminLayout, null, /*#__PURE__*/ react.createElement(react_helmet, null, /*#__PURE__*/ react.createElement("title", null, t`Content Model Groups`)), /*#__PURE__*/ react.createElement(
|
|
30
|
+
}, /*#__PURE__*/ react.createElement(AdminLayout, null, /*#__PURE__*/ react.createElement(react_helmet, null, /*#__PURE__*/ react.createElement("title", null, t`Content Model Groups`)), /*#__PURE__*/ react.createElement(CmsBreadcrumbsRoot, null), /*#__PURE__*/ react.createElement(AdminConfig.Breadcrumb, {
|
|
31
|
+
name: "cms.groups",
|
|
32
|
+
label: "Model Groups"
|
|
33
|
+
}), /*#__PURE__*/ react.createElement(Loader, null, /*#__PURE__*/ react.createElement(ContentModelGroupsView, null))))
|
|
24
34
|
}), /*#__PURE__*/ react.createElement(Route, {
|
|
25
35
|
route: Routes.ContentEntries.List,
|
|
26
36
|
element: /*#__PURE__*/ react.createElement(SecureRoute, {
|
|
@@ -41,6 +51,9 @@ const RoutesConfig = ()=>/*#__PURE__*/ react.createElement(AdminConfig, null, /*
|
|
|
41
51
|
permission: "cms.contentModel"
|
|
42
52
|
}, /*#__PURE__*/ react.createElement(AdminLayout, null, /*#__PURE__*/ react.createElement(react_helmet, {
|
|
43
53
|
title: t`Content Models`
|
|
54
|
+
}), /*#__PURE__*/ react.createElement(CmsBreadcrumbsRoot, null), /*#__PURE__*/ react.createElement(AdminConfig.Breadcrumb, {
|
|
55
|
+
name: "cms.models",
|
|
56
|
+
label: "Models"
|
|
44
57
|
}), /*#__PURE__*/ react.createElement(Loader, null, /*#__PURE__*/ react.createElement(ContentModelsView, null))))
|
|
45
58
|
}), /*#__PURE__*/ react.createElement(CmsMenuLoader, null), /*#__PURE__*/ react.createElement(HasPermission, {
|
|
46
59
|
name: "cms.contentModel"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/RoutesConfig.js","sources":["../../src/admin/RoutesConfig.tsx"],"sourcesContent":["import React, { lazy, Suspense } from \"react\";\nimport Helmet from \"react-helmet\";\nimport { SecureRoute, HasPermission } from \"@webiny/app-admin\";\nimport { OverlayLoader } from \"@webiny/admin-ui\";\nimport { CompositionScope } from \"@webiny/react-composition\";\nimport { AdminConfig, AdminLayout } from \"@webiny/app-admin\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { ContentEntriesRouteAdapter } from \"~/presentation/contentEntries/views/ContentEntriesRouteAdapter.js\";\nimport { Routes } from \"~/routes.js\";\nimport { CmsMenuLoader } from \"~/presentation/menus/CmsMenuLoader.js\";\nimport { ContentModelsWidget } from \"~/admin/components/ContentModelsWidget.js\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/routes\");\n\ninterface LoaderProps {\n children: React.ReactNode;\n}\n\nconst Loader = ({ children, ...props }: LoaderProps) => (\n <Suspense fallback={<OverlayLoader />}>\n {React.cloneElement(children as unknown as React.ReactElement, props)}\n </Suspense>\n);\n\nconst ContentModelEditor = lazy(\n () =>\n import(\n /* webpackChunkName: \"content-model-editor\" */\n \"./views/contentModels/ContentModelEditor.js\"\n )\n);\nconst ContentModelsView = lazy(\n () =>\n import(\n /* webpackChunkName: \"content-models\" */\n \"../presentation/contentModels/components/ContentModels.js\"\n )\n);\nconst ContentModelGroupsView = lazy(\n () =>\n import(\n /* webpackChunkName: \"content-model-groups\" */\n \"../presentation/modelGroup/components/ContentModelGroups.js\"\n )\n);\n\nconst { Route } = AdminConfig;\n\nexport const RoutesConfig = () => {\n return (\n <AdminConfig>\n <Route\n route={Routes.ContentModelGroups.List}\n element={\n <SecureRoute permission={\"cms.contentModelGroup\"}>\n <AdminLayout>\n <Helmet>\n <title>{t`Content Model Groups`}</title>\n </Helmet>\n <Loader>\n <ContentModelGroupsView />\n </Loader>\n </AdminLayout>\n </SecureRoute>\n }\n />\n <Route\n route={Routes.ContentEntries.List}\n element={\n <SecureRoute permission={\"cms.contentModel\"}>\n <AdminLayout>\n <Helmet>\n <title>{t`Content`}</title>\n </Helmet>\n <CompositionScope name={\"cms\"}>\n <ContentEntriesRouteAdapter />\n </CompositionScope>\n </AdminLayout>\n </SecureRoute>\n }\n />\n <Route\n route={Routes.ContentModels.Editor}\n element={\n <SecureRoute permission={\"cms.contentModel\"}>\n <Helmet>\n <title>{t`Edit Content Model`}</title>\n </Helmet>\n <CompositionScope name={\"cms\"}>\n <Loader>\n <ContentModelEditor />\n </Loader>\n </CompositionScope>\n </SecureRoute>\n }\n />\n <Route\n route={Routes.ContentModels.List}\n element={\n <SecureRoute permission={\"cms.contentModel\"}>\n <AdminLayout>\n <Helmet title={t`Content Models`} />\n <Loader>\n <ContentModelsView />\n </Loader>\n </AdminLayout>\n </SecureRoute>\n }\n />\n\n <CmsMenuLoader />\n\n <HasPermission name={\"cms.contentModel\"}>\n <AdminConfig.Dashboard.Widget\n name=\"cms.contentModels\"\n column=\"left\"\n element={<ContentModelsWidget />}\n />\n </HasPermission>\n </AdminConfig>\n );\n};\n"],"names":["t","i18n","Loader","children","props","Suspense","OverlayLoader","React","ContentModelEditor","lazy","ContentModelsView","ContentModelGroupsView","Route","AdminConfig","
|
|
1
|
+
{"version":3,"file":"admin/RoutesConfig.js","sources":["../../src/admin/RoutesConfig.tsx"],"sourcesContent":["import React, { lazy, Suspense } from \"react\";\nimport Helmet from \"react-helmet\";\nimport { SecureRoute, HasPermission } from \"@webiny/app-admin\";\nimport { OverlayLoader } from \"@webiny/admin-ui\";\nimport { CompositionScope } from \"@webiny/react-composition\";\nimport { AdminConfig, AdminLayout } from \"@webiny/app-admin\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { ContentEntriesRouteAdapter } from \"~/presentation/contentEntries/views/ContentEntriesRouteAdapter.js\";\nimport { Routes } from \"~/routes.js\";\nimport { CmsMenuLoader } from \"~/presentation/menus/CmsMenuLoader.js\";\nimport { ContentModelsWidget } from \"~/admin/components/ContentModelsWidget.js\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/routes\");\n\ninterface LoaderProps {\n children: React.ReactNode;\n}\n\nconst Loader = ({ children, ...props }: LoaderProps) => (\n <Suspense fallback={<OverlayLoader />}>\n {React.cloneElement(children as unknown as React.ReactElement, props)}\n </Suspense>\n);\n\nconst ContentModelEditor = lazy(\n () =>\n import(\n /* webpackChunkName: \"content-model-editor\" */\n \"./views/contentModels/ContentModelEditor.js\"\n )\n);\nconst ContentModelsView = lazy(\n () =>\n import(\n /* webpackChunkName: \"content-models\" */\n \"../presentation/contentModels/components/ContentModels.js\"\n )\n);\nconst ContentModelGroupsView = lazy(\n () =>\n import(\n /* webpackChunkName: \"content-model-groups\" */\n \"../presentation/modelGroup/components/ContentModelGroups.js\"\n )\n);\n\nconst { Route } = AdminConfig;\n\n// Shared leading breadcrumb for the CMS list routes.\nconst CmsBreadcrumbsRoot = () => (\n <AdminConfig.Breadcrumb\n name={\"cms\"}\n label={\"Headless CMS\"}\n to={{ route: Routes.ContentModels.List }}\n />\n);\n\nexport const RoutesConfig = () => {\n return (\n <AdminConfig>\n <Route\n route={Routes.ContentModelGroups.List}\n element={\n <SecureRoute permission={\"cms.contentModelGroup\"}>\n <AdminLayout>\n <Helmet>\n <title>{t`Content Model Groups`}</title>\n </Helmet>\n <CmsBreadcrumbsRoot />\n <AdminConfig.Breadcrumb name={\"cms.groups\"} label={\"Model Groups\"} />\n <Loader>\n <ContentModelGroupsView />\n </Loader>\n </AdminLayout>\n </SecureRoute>\n }\n />\n <Route\n route={Routes.ContentEntries.List}\n element={\n <SecureRoute permission={\"cms.contentModel\"}>\n <AdminLayout>\n <Helmet>\n <title>{t`Content`}</title>\n </Helmet>\n {/* Breadcrumbs (Headless CMS › Model › folder path) are emitted\n dynamically from within the entries view. */}\n <CompositionScope name={\"cms\"}>\n <ContentEntriesRouteAdapter />\n </CompositionScope>\n </AdminLayout>\n </SecureRoute>\n }\n />\n <Route\n route={Routes.ContentModels.Editor}\n element={\n <SecureRoute permission={\"cms.contentModel\"}>\n <Helmet>\n <title>{t`Edit Content Model`}</title>\n </Helmet>\n <CompositionScope name={\"cms\"}>\n <Loader>\n <ContentModelEditor />\n </Loader>\n </CompositionScope>\n </SecureRoute>\n }\n />\n <Route\n route={Routes.ContentModels.List}\n element={\n <SecureRoute permission={\"cms.contentModel\"}>\n <AdminLayout>\n <Helmet title={t`Content Models`} />\n <CmsBreadcrumbsRoot />\n <AdminConfig.Breadcrumb name={\"cms.models\"} label={\"Models\"} />\n <Loader>\n <ContentModelsView />\n </Loader>\n </AdminLayout>\n </SecureRoute>\n }\n />\n\n <CmsMenuLoader />\n\n <HasPermission name={\"cms.contentModel\"}>\n <AdminConfig.Dashboard.Widget\n name=\"cms.contentModels\"\n column=\"left\"\n element={<ContentModelsWidget />}\n />\n </HasPermission>\n </AdminConfig>\n );\n};\n"],"names":["t","i18n","Loader","children","props","Suspense","OverlayLoader","React","ContentModelEditor","lazy","ContentModelsView","ContentModelGroupsView","Route","AdminConfig","CmsBreadcrumbsRoot","Routes","RoutesConfig","SecureRoute","AdminLayout","Helmet","CompositionScope","ContentEntriesRouteAdapter","CmsMenuLoader","HasPermission","ContentModelsWidget"],"mappings":";;;;;;;;;;AAYA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAMlB,MAAMC,SAAS,CAAC,EAAEC,QAAQ,EAAE,GAAGC,OAAoB,iBAC/C,oBAACC,UAAQA;QAAC,wBAAU,oBAACC,eAAaA;qBAC7BC,MAAAA,YAAkB,CAACJ,UAA2CC;AAIvE,MAAMI,qBAAqB,WAAHA,GAAGC,KACvB,IACI,MAAM,CAAN;AAKR,MAAMC,oBAAoB,WAAHA,GAAGD,KACtB,IACI,MAAM,CAAN;AAKR,MAAME,yBAAyB,WAAHA,GAAGF,KAC3B,IACI,MAAM,CAAN;AAMR,MAAM,EAAEG,OAAAA,KAAK,EAAE,GAAGC;AAGlB,MAAMC,qBAAqB,kBACvB,oBAACD,YAAY,UAAU;QACnB,MAAM;QACN,OAAO;QACP,IAAI;YAAE,OAAOE,OAA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A,GACnB,oBAACD,YAAY,UAAU;YAAC,MAAM;YAAc,OAAO;0BACnD,oBAACX,QAAMA,MAAAA,WAAAA,GACH,oBAACQ,mBAAiBA;sBAOtC,oBAACY,eAAaA,OAAAA,WAAAA,GAEd,oBAACC,eAAaA;QAAC,MAAM;qBACjB,oBAACV,YAAY,SAAS,CAAC,MAAM;QACzB,MAAK;QACL,QAAO;QACP,uBAAS,oBAACW,qBAAmBA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionDelete.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionDelete.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport { BulkDeleteFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionDelete = observer(() => {\n const toast = useToast();\n const presenter = useContentEntriesPresenter();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n const { presenter: bulkDelete } = useFeature(BulkDeleteFeature);\n\n const selection = presenter.list.vm.selection;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openDeleteEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Trash entries\",\n message: `You are about to move ${selection.label} to trash. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkDelete.execute(selectedItems, selection.allSelected);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Entries will be trashed in the background\",\n description:\n \"All entries will be moved to trash. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.\",\n dismissible: true,\n duration: Infinity\n });\n return;\n }\n\n showResultsDialog({\n results: bulkDelete.vm.results,\n title: \"Trash entries\",\n message: \"Finished moving entries to trash! See full report below:\"\n });\n }\n });\n\n return (\n <BulkActionButton\n text=\"Trash\"\n tooltipContent={`Trash ${selection.label}`}\n icon={<DeleteIcon />}\n onClick={openDeleteEntriesDialog}\n />\n );\n});\n"],"names":["ActionDelete","observer","toast","useToast","presenter","useContentEntriesPresenter","showConfirmationDialog","showResultsDialog","useBulkActionDialog","bulkDelete","useFeature","BulkDeleteFeature","selection","selectedItems","row","openDeleteEntriesDialog","Infinity","BulkActionButton","DeleteIcon"],"mappings":";;;;;;;;AAYO,MAAMA,eAAeC,SAAS;IACjC,MAAMC,QAAQC;IACd,MAAMC,YAAYC;IAClB,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IACtD,MAAM,EAAE,WAAWC,UAAU,EAAE,GAAGC,WAAWC;IAE7C,MAAMC,YAAYR,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMS,gBAAgBT,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACU,CAAAA,MACzCF,UAAU,WAAW,CAAC,GAAG,CAACE,IAAI,EAAE;IAG3C,MAAMC,0BAA0B,IAC5BT,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,sBAAsB,EAAEM,UAAU,KAAK,CAAC,6CAA6C,CAAC;YAChG,cAAc,CAAC,WAAW,EAAEA,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMH,WAAW,OAAO,CAACI,eAAeD,UAAU,WAAW;gBAC7DR,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIQ,UAAU,WAAW,EAAE,YACvBV,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aACI;oBACJ,aAAa;oBACb,UAAUc;
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionDelete.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionDelete.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport { BulkDeleteFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionDelete = observer(() => {\n const toast = useToast();\n const presenter = useContentEntriesPresenter();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n const { presenter: bulkDelete } = useFeature(BulkDeleteFeature);\n\n const selection = presenter.list.vm.selection;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openDeleteEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Trash entries\",\n message: `You are about to move ${selection.label} to trash. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkDelete.execute(selectedItems, selection.allSelected);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Entries will be trashed in the background\",\n description:\n \"All entries will be moved to trash. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.\",\n dismissible: true,\n duration: Infinity\n });\n return;\n }\n\n showResultsDialog({\n results: bulkDelete.vm.results,\n title: \"Trash entries\",\n message: \"Finished moving entries to trash! See full report below:\"\n });\n }\n });\n\n return (\n <BulkActionButton\n text=\"Trash\"\n tooltipContent={`Trash ${selection.label}`}\n icon={<DeleteIcon />}\n onClick={openDeleteEntriesDialog}\n />\n );\n});\n"],"names":["ActionDelete","observer","toast","useToast","presenter","useContentEntriesPresenter","showConfirmationDialog","showResultsDialog","useBulkActionDialog","bulkDelete","useFeature","BulkDeleteFeature","selection","selectedItems","row","openDeleteEntriesDialog","Infinity","BulkActionButton","DeleteIcon"],"mappings":";;;;;;;;AAYO,MAAMA,eAAeC,SAAS;IACjC,MAAMC,QAAQC;IACd,MAAMC,YAAYC;IAClB,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IACtD,MAAM,EAAE,WAAWC,UAAU,EAAE,GAAGC,WAAWC;IAE7C,MAAMC,YAAYR,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMS,gBAAgBT,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACU,CAAAA,MACzCF,UAAU,WAAW,CAAC,GAAG,CAACE,IAAI,EAAE;IAG3C,MAAMC,0BAA0B,IAC5BT,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,sBAAsB,EAAEM,UAAU,KAAK,CAAC,6CAA6C,CAAC;YAChG,cAAc,CAAC,WAAW,EAAEA,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMH,WAAW,OAAO,CAACI,eAAeD,UAAU,WAAW;gBAC7DR,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIQ,UAAU,WAAW,EAAE,YACvBV,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aACI;oBACJ,aAAa;oBACb,UAAUc,KAAQ;gBACtB;gBAIJT,kBAAkB;oBACd,SAASE,WAAW,EAAE,CAAC,OAAO;oBAC9B,OAAO;oBACP,SAAS;gBACb;YACJ;QACJ;IAEJ,OAAO,WAAP,GACI,oBAACQ,kBAAgBA;QACb,MAAK;QACL,gBAAgB,CAAC,MAAM,EAAEL,UAAU,KAAK,EAAE;QAC1C,oBAAM,oBAACM,gBAAUA;QACjB,SAASH;;AAGrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionMove.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionMove.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as MoveIcon } from \"@webiny/icons/exit_to_app.svg\";\nimport { useMoveToFolderDialog } from \"@webiny/app-aco\";\nimport type { NodeDto } from \"@webiny/admin-ui\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { ROOT_FOLDER } from \"~/admin/constants.js\";\nimport { BulkMoveFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionMove = observer(() => {\n const presenter = useContentEntriesPresenter();\n const { presenter: bulkMove } = useFeature(BulkMoveFeature);\n const toast = useToast();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n const { showDialog: showMoveDialog } = useMoveToFolderDialog();\n\n const selection = presenter.list.vm.selection;\n const currentFolderId = presenter.folders.vm.currentFolderId;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openWorkerDialog = useCallback(\n (folder: NodeDto) => {\n showConfirmationDialog({\n title: \"Move entries\",\n message: `You are about to move ${selection.label} to ${folder.label}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkMove.execute(selectedItems, selection.allSelected, folder.id);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Entries will be moved in the background\",\n description: `All entries will be moved to ${folder.label}. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.`,\n dismissible: true,\n duration: Infinity\n });\n\n return;\n }\n\n showResultsDialog({\n results: bulkMove.vm.results,\n title: \"Move entries\",\n message: \"Finished moving entries! See full report below:\"\n });\n }\n });\n },\n [selection.label, selection.allSelected, selectedItems]\n );\n\n const openMoveEntriesDialog = () =>\n showMoveDialog({\n title: \"Select folder\",\n message: \"Select a new location for selected entries:\",\n loadingLabel: `Processing ${selection.label}`,\n acceptLabel: \"Move\",\n focusedFolderId: currentFolderId || ROOT_FOLDER,\n async onAccept({ folder }) {\n openWorkerDialog(folder);\n }\n });\n\n return (\n <BulkActionButton\n text=\"Move\"\n tooltipContent={`Move ${selection.label}`}\n icon={<MoveIcon />}\n onClick={openMoveEntriesDialog}\n />\n );\n});\n"],"names":["ActionMove","observer","presenter","useContentEntriesPresenter","bulkMove","useFeature","BulkMoveFeature","toast","useToast","showConfirmationDialog","showResultsDialog","useBulkActionDialog","showMoveDialog","useMoveToFolderDialog","selection","currentFolderId","selectedItems","row","openWorkerDialog","useCallback","folder","Infinity","openMoveEntriesDialog","ROOT_FOLDER","BulkActionButton","MoveIcon"],"mappings":";;;;;;;;;;AAeO,MAAMA,aAAaC,SAAS;IAC/B,MAAMC,YAAYC;IAClB,MAAM,EAAE,WAAWC,QAAQ,EAAE,GAAGC,WAAWC;IAC3C,MAAMC,QAAQC;IACd,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IACtD,MAAM,EAAE,YAAYC,cAAc,EAAE,GAAGC;IAEvC,MAAMC,YAAYZ,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMa,kBAAkBb,UAAU,OAAO,CAAC,EAAE,CAAC,eAAe;IAC5D,MAAMc,gBAAgBd,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACe,CAAAA,MACzCH,UAAU,WAAW,CAAC,GAAG,CAACG,IAAI,EAAE;IAG3C,MAAMC,mBAAmBC,YACrB,CAACC;QACGX,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,sBAAsB,EAAEK,UAAU,KAAK,CAAC,IAAI,EAAEM,OAAO,KAAK,CAAC,oCAAoC,CAAC;YAC1G,cAAc,CAAC,WAAW,EAAEN,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMV,SAAS,OAAO,CAACY,eAAeF,UAAU,WAAW,EAAEM,OAAO,EAAE;gBACtElB,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIY,UAAU,WAAW,EAAE,YACvBP,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aAAa,CAAC,6BAA6B,EAAEa,OAAO,KAAK,CAAC,sJAAsJ,CAAC;oBACjN,aAAa;oBACb,UAAUC;
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionMove.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionMove.tsx"],"sourcesContent":["import React, { useCallback } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as MoveIcon } from \"@webiny/icons/exit_to_app.svg\";\nimport { useMoveToFolderDialog } from \"@webiny/app-aco\";\nimport type { NodeDto } from \"@webiny/admin-ui\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { ROOT_FOLDER } from \"~/admin/constants.js\";\nimport { BulkMoveFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionMove = observer(() => {\n const presenter = useContentEntriesPresenter();\n const { presenter: bulkMove } = useFeature(BulkMoveFeature);\n const toast = useToast();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n const { showDialog: showMoveDialog } = useMoveToFolderDialog();\n\n const selection = presenter.list.vm.selection;\n const currentFolderId = presenter.folders.vm.currentFolderId;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openWorkerDialog = useCallback(\n (folder: NodeDto) => {\n showConfirmationDialog({\n title: \"Move entries\",\n message: `You are about to move ${selection.label} to ${folder.label}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkMove.execute(selectedItems, selection.allSelected, folder.id);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Entries will be moved in the background\",\n description: `All entries will be moved to ${folder.label}. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.`,\n dismissible: true,\n duration: Infinity\n });\n\n return;\n }\n\n showResultsDialog({\n results: bulkMove.vm.results,\n title: \"Move entries\",\n message: \"Finished moving entries! See full report below:\"\n });\n }\n });\n },\n [selection.label, selection.allSelected, selectedItems]\n );\n\n const openMoveEntriesDialog = () =>\n showMoveDialog({\n title: \"Select folder\",\n message: \"Select a new location for selected entries:\",\n loadingLabel: `Processing ${selection.label}`,\n acceptLabel: \"Move\",\n focusedFolderId: currentFolderId || ROOT_FOLDER,\n async onAccept({ folder }) {\n openWorkerDialog(folder);\n }\n });\n\n return (\n <BulkActionButton\n text=\"Move\"\n tooltipContent={`Move ${selection.label}`}\n icon={<MoveIcon />}\n onClick={openMoveEntriesDialog}\n />\n );\n});\n"],"names":["ActionMove","observer","presenter","useContentEntriesPresenter","bulkMove","useFeature","BulkMoveFeature","toast","useToast","showConfirmationDialog","showResultsDialog","useBulkActionDialog","showMoveDialog","useMoveToFolderDialog","selection","currentFolderId","selectedItems","row","openWorkerDialog","useCallback","folder","Infinity","openMoveEntriesDialog","ROOT_FOLDER","BulkActionButton","MoveIcon"],"mappings":";;;;;;;;;;AAeO,MAAMA,aAAaC,SAAS;IAC/B,MAAMC,YAAYC;IAClB,MAAM,EAAE,WAAWC,QAAQ,EAAE,GAAGC,WAAWC;IAC3C,MAAMC,QAAQC;IACd,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IACtD,MAAM,EAAE,YAAYC,cAAc,EAAE,GAAGC;IAEvC,MAAMC,YAAYZ,UAAU,IAAI,CAAC,EAAE,CAAC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AQA;QACf,SAASH;;AAGrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const ActionPublish: (() => React.JSX.Element | null) & {
|
|
3
|
-
|
|
2
|
+
export declare const ActionPublish: (() => React.JSX.Element | null) & React.NamedExoticComponent<unknown> & {
|
|
3
|
+
readonly type: () => React.JSX.Element | null;
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionPublish.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionPublish.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport { ReactComponent as PublishIcon } from \"@webiny/icons/visibility.svg\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { usePermission } from \"~/admin/hooks/index.js\";\nimport { BulkPublishFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionPublish = observer(() => {\n const { canPublish } = usePermission();\n const presenter = useContentEntriesPresenter();\n const toast = useToast();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n const { presenter: bulkPublish } = useFeature(BulkPublishFeature);\n\n const selection = presenter.list.vm.selection;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openPublishEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Publish entries\",\n message: `You are about to publish ${selection.label}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkPublish.execute(selectedItems, selection.allSelected);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Publishing of entries started in the background\",\n description:\n \"All entries will be published. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.\",\n dismissible: true,\n duration: Infinity\n });\n return;\n }\n\n showResultsDialog({\n results: bulkPublish.vm.results,\n title: \"Publish entries\",\n message: \"Finished publishing entries! See full report below:\"\n });\n }\n });\n\n if (!canPublish(\"cms.contentEntry\")) {\n return null;\n }\n\n return (\n <BulkActionButton\n text=\"Publish\"\n tooltipContent={`Publish ${selection.label}`}\n icon={<PublishIcon />}\n onClick={openPublishEntriesDialog}\n />\n );\n});\n"],"names":["ActionPublish","observer","canPublish","usePermission","presenter","useContentEntriesPresenter","toast","useToast","showConfirmationDialog","showResultsDialog","useBulkActionDialog","bulkPublish","useFeature","BulkPublishFeature","selection","selectedItems","row","openPublishEntriesDialog","Infinity","BulkActionButton","PublishIcon"],"mappings":";;;;;;;;;AAaO,MAAMA,gBAAgBC,SAAS;IAClC,MAAM,EAAEC,UAAU,EAAE,GAAGC;IACvB,MAAMC,YAAYC;IAClB,MAAMC,QAAQC;IACd,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IACtD,MAAM,EAAE,WAAWC,WAAW,EAAE,GAAGC,WAAWC;IAE9C,MAAMC,YAAYV,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMW,gBAAgBX,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACY,CAAAA,MACzCF,UAAU,WAAW,CAAC,GAAG,CAACE,IAAI,EAAE;IAG3C,MAAMC,2BAA2B,IAC7BT,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,yBAAyB,EAAEM,UAAU,KAAK,CAAC,oCAAoC,CAAC;YAC1F,cAAc,CAAC,WAAW,EAAEA,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMH,YAAY,OAAO,CAACI,eAAeD,UAAU,WAAW;gBAC9DV,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIU,UAAU,WAAW,EAAE,YACvBR,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aACI;oBACJ,aAAa;oBACb,UAAUY;
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionPublish.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionPublish.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport { ReactComponent as PublishIcon } from \"@webiny/icons/visibility.svg\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { usePermission } from \"~/admin/hooks/index.js\";\nimport { BulkPublishFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionPublish = observer(() => {\n const { canPublish } = usePermission();\n const presenter = useContentEntriesPresenter();\n const toast = useToast();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n const { presenter: bulkPublish } = useFeature(BulkPublishFeature);\n\n const selection = presenter.list.vm.selection;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openPublishEntriesDialog = () =>\n showConfirmationDialog({\n title: \"Publish entries\",\n message: `You are about to publish ${selection.label}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkPublish.execute(selectedItems, selection.allSelected);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Publishing of entries started in the background\",\n description:\n \"All entries will be published. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.\",\n dismissible: true,\n duration: Infinity\n });\n return;\n }\n\n showResultsDialog({\n results: bulkPublish.vm.results,\n title: \"Publish entries\",\n message: \"Finished publishing entries! See full report below:\"\n });\n }\n });\n\n if (!canPublish(\"cms.contentEntry\")) {\n return null;\n }\n\n return (\n <BulkActionButton\n text=\"Publish\"\n tooltipContent={`Publish ${selection.label}`}\n icon={<PublishIcon />}\n onClick={openPublishEntriesDialog}\n />\n );\n});\n"],"names":["ActionPublish","observer","canPublish","usePermission","presenter","useContentEntriesPresenter","toast","useToast","showConfirmationDialog","showResultsDialog","useBulkActionDialog","bulkPublish","useFeature","BulkPublishFeature","selection","selectedItems","row","openPublishEntriesDialog","Infinity","BulkActionButton","PublishIcon"],"mappings":";;;;;;;;;AAaO,MAAMA,gBAAgBC,SAAS;IAClC,MAAM,EAAEC,UAAU,EAAE,GAAGC;IACvB,MAAMC,YAAYC;IAClB,MAAMC,QAAQC;IACd,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IACtD,MAAM,EAAE,WAAWC,WAAW,EAAE,GAAGC,WAAWC;IAE9C,MAAMC,YAAYV,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMW,gBAAgBX,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACY,CAAAA,MACzCF,UAAU,WAAW,CAAC,GAAG,CAACE,IAAI,EAAE;IAG3C,MAAMC,2BAA2B,IAC7BT,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,yBAAyB,EAAEM,UAAU,KAAK,CAAC,oCAAoC,CAAC;YAC1F,cAAc,CAAC,WAAW,EAAEA,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMH,YAAY,OAAO,CAACI,eAAeD,UAAU,WAAW;gBAC9DV,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIU,UAAU,WAAW,EAAE,YACvBR,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aACI;oBACJ,aAAa;oBACb,UAAUY,KAAQ;gBACtB;gBAIJT,kBAAkB;oBACd,SAASE,YAAY,EAAE,CAAC,OAAO;oBAC/B,OAAO;oBACP,SAAS;gBACb;YACJ;QACJ;IAEJ,IAAI,CAACT,WAAW,qBACZ,OAAO;IAGX,OAAO,WAAP,GACI,oBAACiB,kBAAgBA;QACb,MAAK;QACL,gBAAgB,CAAC,QAAQ,EAAEL,UAAU,KAAK,EAAE;QAC5C,oBAAM,oBAACM,gBAAWA;QAClB,SAASH;;AAGrB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const ActionUnpublish: (() => React.JSX.Element | null) & {
|
|
3
|
-
|
|
2
|
+
export declare const ActionUnpublish: (() => React.JSX.Element | null) & React.NamedExoticComponent<unknown> & {
|
|
3
|
+
readonly type: () => React.JSX.Element | null;
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionUnpublish.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionUnpublish.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as UnpublishIcon } from \"@webiny/icons/visibility_off.svg\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { usePermission } from \"~/admin/hooks/index.js\";\nimport { BulkUnpublishFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionUnpublish = observer(() => {\n const { canUnpublish } = usePermission();\n const presenter = useContentEntriesPresenter();\n const { presenter: bulkUnpublish } = useFeature(BulkUnpublishFeature);\n const toast = useToast();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n\n const selection = presenter.list.vm.selection;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openUnpublishEntriesDialog = () => {\n showConfirmationDialog({\n title: \"Unpublish entries\",\n message: `You are about to unpublish ${selection.label}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkUnpublish.execute(selectedItems, selection.allSelected);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Entries will be unpublished in the background\",\n description:\n \"All entries will be unpublished. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.\",\n dismissible: true,\n duration: Infinity\n });\n\n return;\n }\n\n showResultsDialog({\n results: bulkUnpublish.vm.results,\n title: \"Unpublish entries\",\n message: \"Finished unpublishing entries! See full report below:\"\n });\n }\n });\n };\n\n if (!canUnpublish(\"cms.contentEntry\")) {\n return null;\n }\n\n return (\n <BulkActionButton\n text=\"Unpublish\"\n tooltipContent={`Unpublish ${selection.label}`}\n icon={<UnpublishIcon />}\n onClick={openUnpublishEntriesDialog}\n />\n );\n});\n"],"names":["ActionUnpublish","observer","canUnpublish","usePermission","presenter","useContentEntriesPresenter","bulkUnpublish","useFeature","BulkUnpublishFeature","toast","useToast","showConfirmationDialog","showResultsDialog","useBulkActionDialog","selection","selectedItems","row","openUnpublishEntriesDialog","Infinity","BulkActionButton","UnpublishIcon"],"mappings":";;;;;;;;;AAaO,MAAMA,kBAAkBC,SAAS;IACpC,MAAM,EAAEC,YAAY,EAAE,GAAGC;IACzB,MAAMC,YAAYC;IAClB,MAAM,EAAE,WAAWC,aAAa,EAAE,GAAGC,WAAWC;IAChD,MAAMC,QAAQC;IACd,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IAEtD,MAAMC,YAAYV,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMW,gBAAgBX,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACY,CAAAA,MACzCF,UAAU,WAAW,CAAC,GAAG,CAACE,IAAI,EAAE;IAG3C,MAAMC,6BAA6B;QAC/BN,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,2BAA2B,EAAEG,UAAU,KAAK,CAAC,oCAAoC,CAAC;YAC5F,cAAc,CAAC,WAAW,EAAEA,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMR,cAAc,OAAO,CAACS,eAAeD,UAAU,WAAW;gBAChEV,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIU,UAAU,WAAW,EAAE,YACvBL,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aACI;oBACJ,aAAa;oBACb,UAAUS;
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/BulkActions/ActionUnpublish.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/ActionUnpublish.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as UnpublishIcon } from \"@webiny/icons/visibility_off.svg\";\nimport { useToast } from \"@webiny/admin-ui\";\nimport { useFeature } from \"@webiny/app\";\nimport {\n BulkActionButton,\n useBulkActionDialog\n} from \"@webiny/app-admin/components/BulkActions/index.js\";\nimport { usePermission } from \"~/admin/hooks/index.js\";\nimport { BulkUnpublishFeature } from \"~/presentation/contentEntries/bulkActions/feature.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\nexport const ActionUnpublish = observer(() => {\n const { canUnpublish } = usePermission();\n const presenter = useContentEntriesPresenter();\n const { presenter: bulkUnpublish } = useFeature(BulkUnpublishFeature);\n const toast = useToast();\n const { showConfirmationDialog, showResultsDialog } = useBulkActionDialog();\n\n const selection = presenter.list.vm.selection;\n const selectedItems = presenter.list.vm.rows.filter(row => {\n return selection.selectedIds.has(row.id);\n });\n\n const openUnpublishEntriesDialog = () => {\n showConfirmationDialog({\n title: \"Unpublish entries\",\n message: `You are about to unpublish ${selection.label}. Are you sure you want to continue?`,\n loadingLabel: `Processing ${selection.label}`,\n execute: async () => {\n await bulkUnpublish.execute(selectedItems, selection.allSelected);\n presenter.list.actions.selection.deselectAll();\n\n if (selection.allSelected) {\n toast.showSuccessToast({\n title: \"Entries will be unpublished in the background\",\n description:\n \"All entries will be unpublished. This process will be carried out in the background and may take some time. You can safely navigate away from this page while the process is running.\",\n dismissible: true,\n duration: Infinity\n });\n\n return;\n }\n\n showResultsDialog({\n results: bulkUnpublish.vm.results,\n title: \"Unpublish entries\",\n message: \"Finished unpublishing entries! See full report below:\"\n });\n }\n });\n };\n\n if (!canUnpublish(\"cms.contentEntry\")) {\n return null;\n }\n\n return (\n <BulkActionButton\n text=\"Unpublish\"\n tooltipContent={`Unpublish ${selection.label}`}\n icon={<UnpublishIcon />}\n onClick={openUnpublishEntriesDialog}\n />\n );\n});\n"],"names":["ActionUnpublish","observer","canUnpublish","usePermission","presenter","useContentEntriesPresenter","bulkUnpublish","useFeature","BulkUnpublishFeature","toast","useToast","showConfirmationDialog","showResultsDialog","useBulkActionDialog","selection","selectedItems","row","openUnpublishEntriesDialog","Infinity","BulkActionButton","UnpublishIcon"],"mappings":";;;;;;;;;AAaO,MAAMA,kBAAkBC,SAAS;IACpC,MAAM,EAAEC,YAAY,EAAE,GAAGC;IACzB,MAAMC,YAAYC;IAClB,MAAM,EAAE,WAAWC,aAAa,EAAE,GAAGC,WAAWC;IAChD,MAAMC,QAAQC;IACd,MAAM,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGC;IAEtD,MAAMC,YAAYV,UAAU,IAAI,CAAC,EAAE,CAAC,SAAS;IAC7C,MAAMW,gBAAgBX,UAAU,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAACY,CAAAA,MACzCF,UAAU,WAAW,CAAC,GAAG,CAACE,IAAI,EAAE;IAG3C,MAAMC,6BAA6B;QAC/BN,uBAAuB;YACnB,OAAO;YACP,SAAS,CAAC,2BAA2B,EAAEG,UAAU,KAAK,CAAC,oCAAoC,CAAC;YAC5F,cAAc,CAAC,WAAW,EAAEA,UAAU,KAAK,EAAE;YAC7C,SAAS;gBACL,MAAMR,cAAc,OAAO,CAACS,eAAeD,UAAU,WAAW;gBAChEV,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,WAAW;gBAE5C,IAAIU,UAAU,WAAW,EAAE,YACvBL,MAAM,gBAAgB,CAAC;oBACnB,OAAO;oBACP,aACI;oBACJ,aAAa;oBACb,UAAUS,KAAQ;gBACtB;gBAKJN,kBAAkB;oBACd,SAASN,cAAc,EAAE,CAAC,OAAO;oBACjC,OAAO;oBACP,SAAS;gBACb;YACJ;QACJ;IACJ;IAEA,IAAI,CAACJ,aAAa,qBACd,OAAO;IAGX,OAAO,WAAP,GACI,oBAACiB,kBAAgBA;QACb,MAAK;QACL,gBAAgB,CAAC,UAAU,EAAEL,UAAU,KAAK,EAAE;QAC9C,oBAAM,oBAACM,gBAAaA;QACpB,SAASH;;AAGrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentModelEditor/ContentModelEditorProvider.js","sources":["../../../../src/admin/components/ContentModelEditor/ContentModelEditorProvider.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useReducer } from \"react\";\nimport pick from \"lodash/pick.js\";\nimport { useSnackbar, useRouter } from \"@webiny/app-admin\";\nimport { useFeature } from \"@webiny/app\";\nimport type { CmsModel, CmsModelField } from \"~/types.js\";\nimport { useContainer } from \"@webiny/app\";\nimport { ModelProvider } from \"~/admin/components/ModelProvider/index.js\";\nimport { createHashing } from \"@webiny/app/utils/index.js\";\nimport { Routes } from \"~/routes.js\";\nimport type { FieldOption } from \"./fieldOptions.js\";\nimport { buildFieldOptions, buildFieldLabelPrefixes } from \"./fieldOptions.js\";\nimport { CmsLayoutFieldType } from \"~/presentation/fieldTypes/abstractions.js\";\nimport { GetModelFeature } from \"~/features/model/getModel/feature.js\";\nimport { UpdateModelFeature } from \"~/features/model/updateModel/feature.js\";\n\ntype PickedCmsModel = Pick<\n CmsModel,\n | \"layout\"\n | \"fields\"\n | \"name\"\n | \"settings\"\n | \"description\"\n | \"titleFieldId\"\n | \"descriptionFieldId\"\n | \"imageFieldId\"\n | \"group\"\n | \"tags\"\n | \"icon\"\n>;\n\nexport interface ContentModelEditorProviderContext {\n data: CmsModel;\n contentModel: CmsModel;\n isPristine: boolean;\n getContentModel: (modelId: string) => Promise<void>;\n saveContentModel: (data?: CmsModel) => Promise<{ data: CmsModel | null; error: any | null }>;\n setData: (setter: (model: CmsModel) => void, saveContentModel?: boolean) => Promise<any>;\n activeTabIndex: number;\n setActiveTabIndex: (index: number) => void;\n fieldOptions: FieldOption[];\n}\n\nexport const contentModelEditorContext = React.createContext<\n ContentModelEditorProviderContext | undefined\n>(undefined);\n\ninterface State {\n modelId: string | null;\n isPristine: boolean;\n data: CmsModel;\n activeTabIndex: number;\n}\ninterface Action {\n data: Partial<State> | Partial<CmsModel>;\n type: \"state\" | \"data\";\n}\ninterface Reducer {\n (prev: State, action: Action): State;\n}\nexport const contentModelEditorReducer: Reducer = (prev: State, action: Action): State => {\n const { data, type } = action;\n switch (type) {\n case \"state\":\n return { ...prev, ...data };\n\n case \"data\":\n return { ...prev, data: data as CmsModel };\n default:\n return prev;\n }\n};\n\nconst hashModel = createHashing(\"SHA-256\");\n\nconst cleanupModelDataFields = (fields: CmsModelField[]): CmsModelField[] => {\n return fields.map(field => {\n const { predefinedValues } = field;\n const { enabled = false, values = [] } = predefinedValues || {};\n return {\n ...field,\n predefinedValues: {\n enabled,\n values: values.map(({ label, value, selected }) => {\n return {\n label,\n selected: selected || false,\n value: String(value)\n };\n })\n }\n };\n });\n};\n\nconst cleanupModelData = (data: PickedCmsModel): PickedCmsModel => {\n return {\n ...data,\n fields: cleanupModelDataFields(data.fields)\n };\n};\n\ninterface ContentModelEditorProviderProps {\n modelId?: string;\n children: React.ReactElement;\n}\n\nconst createDefaultState = (modelId?: string): State => {\n return {\n modelId: modelId || null,\n isPristine: true,\n data: null as unknown as CmsModel,\n activeTabIndex: 0\n };\n};\n\nexport const ContentModelEditorProvider = ({\n children,\n modelId\n}: ContentModelEditorProviderProps) => {\n const { useCase: getModelUseCase } = useFeature(GetModelFeature);\n const { useCase: updateModelUseCase } = useFeature(UpdateModelFeature);\n\n const [state, dispatch] = useReducer(contentModelEditorReducer, createDefaultState(modelId));\n\n const { goToRoute } = useRouter();\n const { showSnackbar } = useSnackbar();\n\n const setPristine = (flag: boolean): void => {\n dispatch({ type: \"state\", data: { isPristine: flag } });\n };\n\n const saveContentModel = async (\n data?: CmsModel\n ): Promise<{ data: CmsModel | null; error: any | null }> => {\n if (!data) {\n data = state.data;\n }\n const modelData: PickedCmsModel = pick(data, [\n \"group\",\n \"layout\",\n \"fields\",\n \"tags\",\n \"name\",\n \"settings\",\n \"description\",\n \"titleFieldId\",\n \"descriptionFieldId\",\n \"imageFieldId\",\n \"icon\"\n ]);\n\n try {\n const result = await updateModelUseCase.execute({\n modelId: data.modelId,\n data: cleanupModelData(modelData)\n });\n\n setPristine(true);\n\n return {\n data: result,\n error: null\n };\n } catch (ex: any) {\n return {\n data: null,\n error: { message: ex.message }\n };\n }\n };\n\n const setActiveTabIndex = useCallback((activeTabIndex: number) => {\n dispatch({ type: \"state\", data: { activeTabIndex } });\n }, []);\n\n const setData = async (setter: (value: any) => any, saveModel = false): Promise<void> => {\n const data = setter(state.data);\n const existingHash = await hashModel(state.data);\n const newHash = await hashModel(data);\n if (existingHash === newHash) {\n return;\n }\n setPristine(false);\n dispatch({ type: \"data\", data });\n if (!saveModel) {\n return;\n }\n await saveContentModel(data);\n };\n\n const getContentModel = async (id: string): Promise<void> => {\n const data = await getModelUseCase.execute({ modelId: id });\n await setData(() => data, false);\n setPristine(true);\n };\n\n useEffect(() => {\n if (!modelId) {\n return;\n }\n getContentModel(modelId).catch(() => {\n goToRoute(Routes.ContentModels.List);\n showSnackbar(`Could not load content model with given ID.`);\n });\n }, [modelId]);\n\n const container = useContainer();\n const layoutFieldTypes = useMemo(() => {\n return container.resolveAll(CmsLayoutFieldType);\n }, [container]);\n\n const fieldOptions = useMemo(() => {\n const model = state.data;\n if (!model) {\n return [];\n }\n const prefixes = model.layout\n ? buildFieldLabelPrefixes(model.layout, layoutFieldTypes)\n : undefined;\n return buildFieldOptions(model.fields ?? [], \"\", \"\", prefixes, layoutFieldTypes);\n }, [state.data?.fields, state.data?.layout]);\n\n const value = useMemo<ContentModelEditorProviderContext>(\n () => ({\n data: state.data,\n contentModel: state.data,\n isPristine: state.isPristine,\n getContentModel,\n saveContentModel,\n setData,\n activeTabIndex: state.activeTabIndex,\n setActiveTabIndex,\n fieldOptions\n }),\n [state, fieldOptions]\n );\n\n const { Provider } = contentModelEditorContext;\n\n return (\n <Provider value={value}>\n <ModelProvider model={value.contentModel}>{children}</ModelProvider>\n </Provider>\n );\n};\n"],"names":["contentModelEditorContext","React","undefined","contentModelEditorReducer","prev","action","data","type","hashModel","createHashing","cleanupModelDataFields","fields","field","predefinedValues","enabled","values","label","value","selected","String","cleanupModelData","createDefaultState","modelId","ContentModelEditorProvider","children","getModelUseCase","useFeature","GetModelFeature","updateModelUseCase","UpdateModelFeature","state","dispatch","useReducer","goToRoute","useRouter","showSnackbar","useSnackbar","setPristine","flag","saveContentModel","modelData","pick","result","ex","setActiveTabIndex","useCallback","activeTabIndex","setData","setter","saveModel","existingHash","newHash","getContentModel","id","useEffect","Routes","container","useContainer","layoutFieldTypes","useMemo","CmsLayoutFieldType","fieldOptions","model","prefixes","buildFieldLabelPrefixes","buildFieldOptions","Provider","ModelProvider"],"mappings":";;;;;;;;;;;AA0CO,MAAMA,4BAA4B,WAAHA,GAAGC,MAAAA,aAAmB,CAE1DC;AAeK,MAAMC,4BAAqC,CAACC,MAAaC;IAC5D,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAE,GAAGF;IACvB,OAAQE;QACJ,KAAK;YACD,OAAO;gBAAE,GAAGH,IAAI;gBAAE,GAAGE,IAAI;YAAC;QAE9B,KAAK;YACD,OAAO;gBAAE,GAAGF,IAAI;gBAAE,MAAME;YAAiB;QAC7C;YACI,OAAOF;IACf;AACJ;AAEA,MAAM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MAAM,EAAEJ,oBACtCxD;QACN,OAAO+D,kBAAkBH,MAAM,MAAM,IAAI,EAAE,EAAE,IAAI,IAAIC,UAAUL;IACnE,GAAG;QAAC5B,MAAM,IAAI,EAAE;QAAQA,MAAM,IAAI,EAAE;KAAO;IAE3C,MAAMb,QAAQ0C,QACV,IAAO;YACH,MAAM7B,MAAM,IAAI;YAChB,cAAcA,MAAM,IAAI;YACxB,YAAYA,MAAM,UAAU;YAC5BsB;YACAb;YACAQ;YACA,gBAAgBjB,MAAM,cAAc;YACpCc;YACAiB;QACJ,IACA;QAAC/B;QAAO+B;KAAa;IAGzB,MAAM,EAAEK,QAAQ,EAAE,GAAGlE;IAErB,OAAO,WAAP,GACI,oBAACkE,UAAAA;QAAS,OAAOjD;qBACb,oBAACkD,eAAaA;QAAC,OAAOlD,MAAM,YAAY;OAAGO;AAGvD"}
|
|
1
|
+
{"version":3,"file":"admin/components/ContentModelEditor/ContentModelEditorProvider.js","sources":["../../../../src/admin/components/ContentModelEditor/ContentModelEditorProvider.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useReducer } from \"react\";\nimport pick from \"lodash/pick.js\";\nimport { useSnackbar, useRouter } from \"@webiny/app-admin\";\nimport { useFeature } from \"@webiny/app\";\nimport type { CmsModel, CmsModelField } from \"~/types.js\";\nimport { useContainer } from \"@webiny/app\";\nimport { ModelProvider } from \"~/admin/components/ModelProvider/index.js\";\nimport { createHashing } from \"@webiny/app/utils/index.js\";\nimport { Routes } from \"~/routes.js\";\nimport type { FieldOption } from \"./fieldOptions.js\";\nimport { buildFieldOptions, buildFieldLabelPrefixes } from \"./fieldOptions.js\";\nimport { CmsLayoutFieldType } from \"~/presentation/fieldTypes/abstractions.js\";\nimport { GetModelFeature } from \"~/features/model/getModel/feature.js\";\nimport { UpdateModelFeature } from \"~/features/model/updateModel/feature.js\";\n\ntype PickedCmsModel = Pick<\n CmsModel,\n | \"layout\"\n | \"fields\"\n | \"name\"\n | \"settings\"\n | \"description\"\n | \"titleFieldId\"\n | \"descriptionFieldId\"\n | \"imageFieldId\"\n | \"group\"\n | \"tags\"\n | \"icon\"\n>;\n\nexport interface ContentModelEditorProviderContext {\n data: CmsModel;\n contentModel: CmsModel;\n isPristine: boolean;\n getContentModel: (modelId: string) => Promise<void>;\n saveContentModel: (data?: CmsModel) => Promise<{ data: CmsModel | null; error: any | null }>;\n setData: (setter: (model: CmsModel) => void, saveContentModel?: boolean) => Promise<any>;\n activeTabIndex: number;\n setActiveTabIndex: (index: number) => void;\n fieldOptions: FieldOption[];\n}\n\nexport const contentModelEditorContext = React.createContext<\n ContentModelEditorProviderContext | undefined\n>(undefined);\n\ninterface State {\n modelId: string | null;\n isPristine: boolean;\n data: CmsModel;\n activeTabIndex: number;\n}\ninterface Action {\n data: Partial<State> | Partial<CmsModel>;\n type: \"state\" | \"data\";\n}\ninterface Reducer {\n (prev: State, action: Action): State;\n}\nexport const contentModelEditorReducer: Reducer = (prev: State, action: Action): State => {\n const { data, type } = action;\n switch (type) {\n case \"state\":\n return { ...prev, ...data };\n\n case \"data\":\n return { ...prev, data: data as CmsModel };\n default:\n return prev;\n }\n};\n\nconst hashModel = createHashing(\"SHA-256\");\n\nconst cleanupModelDataFields = (fields: CmsModelField[]): CmsModelField[] => {\n return fields.map(field => {\n const { predefinedValues } = field;\n const { enabled = false, values = [] } = predefinedValues || {};\n return {\n ...field,\n predefinedValues: {\n enabled,\n values: values.map(({ label, value, selected }) => {\n return {\n label,\n selected: selected || false,\n value: String(value)\n };\n })\n }\n };\n });\n};\n\nconst cleanupModelData = (data: PickedCmsModel): PickedCmsModel => {\n return {\n ...data,\n fields: cleanupModelDataFields(data.fields)\n };\n};\n\ninterface ContentModelEditorProviderProps {\n modelId?: string;\n children: React.ReactElement;\n}\n\nconst createDefaultState = (modelId?: string): State => {\n return {\n modelId: modelId || null,\n isPristine: true,\n data: null as unknown as CmsModel,\n activeTabIndex: 0\n };\n};\n\nexport const ContentModelEditorProvider = ({\n children,\n modelId\n}: ContentModelEditorProviderProps) => {\n const { useCase: getModelUseCase } = useFeature(GetModelFeature);\n const { useCase: updateModelUseCase } = useFeature(UpdateModelFeature);\n\n const [state, dispatch] = useReducer(contentModelEditorReducer, createDefaultState(modelId));\n\n const { goToRoute } = useRouter();\n const { showSnackbar } = useSnackbar();\n\n const setPristine = (flag: boolean): void => {\n dispatch({ type: \"state\", data: { isPristine: flag } });\n };\n\n const saveContentModel = async (\n data?: CmsModel\n ): Promise<{ data: CmsModel | null; error: any | null }> => {\n if (!data) {\n data = state.data;\n }\n const modelData: PickedCmsModel = pick(data, [\n \"group\",\n \"layout\",\n \"fields\",\n \"tags\",\n \"name\",\n \"settings\",\n \"description\",\n \"titleFieldId\",\n \"descriptionFieldId\",\n \"imageFieldId\",\n \"icon\"\n ]);\n\n try {\n const result = await updateModelUseCase.execute({\n modelId: data.modelId,\n data: cleanupModelData(modelData)\n });\n\n setPristine(true);\n\n return {\n data: result,\n error: null\n };\n } catch (ex: any) {\n return {\n data: null,\n error: { message: ex.message }\n };\n }\n };\n\n const setActiveTabIndex = useCallback((activeTabIndex: number) => {\n dispatch({ type: \"state\", data: { activeTabIndex } });\n }, []);\n\n const setData = async (setter: (value: any) => any, saveModel = false): Promise<void> => {\n const data = setter(state.data);\n const existingHash = await hashModel(state.data);\n const newHash = await hashModel(data);\n if (existingHash === newHash) {\n return;\n }\n setPristine(false);\n dispatch({ type: \"data\", data });\n if (!saveModel) {\n return;\n }\n await saveContentModel(data);\n };\n\n const getContentModel = async (id: string): Promise<void> => {\n const data = await getModelUseCase.execute({ modelId: id });\n data.settings = data.settings || {};\n await setData(() => data, false);\n setPristine(true);\n };\n\n useEffect(() => {\n if (!modelId) {\n return;\n }\n getContentModel(modelId).catch(() => {\n goToRoute(Routes.ContentModels.List);\n showSnackbar(`Could not load content model with given ID.`);\n });\n }, [modelId]);\n\n const container = useContainer();\n const layoutFieldTypes = useMemo(() => {\n return container.resolveAll(CmsLayoutFieldType);\n }, [container]);\n\n const fieldOptions = useMemo(() => {\n const model = state.data;\n if (!model) {\n return [];\n }\n const prefixes = model.layout\n ? buildFieldLabelPrefixes(model.layout, layoutFieldTypes)\n : undefined;\n return buildFieldOptions(model.fields ?? [], \"\", \"\", prefixes, layoutFieldTypes);\n }, [state.data?.fields, state.data?.layout]);\n\n const value = useMemo<ContentModelEditorProviderContext>(\n () => ({\n data: state.data,\n contentModel: state.data,\n isPristine: state.isPristine,\n getContentModel,\n saveContentModel,\n setData,\n activeTabIndex: state.activeTabIndex,\n setActiveTabIndex,\n fieldOptions\n }),\n [state, fieldOptions]\n );\n\n const { Provider } = contentModelEditorContext;\n\n return (\n <Provider value={value}>\n <ModelProvider model={value.contentModel}>{children}</ModelProvider>\n </Provider>\n );\n};\n"],"names":["contentModelEditorContext","React","undefined","contentModelEditorReducer","prev","action","data","type","hashModel","createHashing","cleanupModelDataFields","fields","field","predefinedValues","enabled","values","label","value","selected","String","cleanupModelData","createDefaultState","modelId","ContentModelEditorProvider","children","getModelUseCase","useFeature","GetModelFeature","updateModelUseCase","UpdateModelFeature","state","dispatch","useReducer","goToRoute","useRouter","showSnackbar","useSnackbar","setPristine","flag","saveContentModel","modelData","pick","result","ex","setActiveTabIndex","useCallback","activeTabIndex","setData","setter","saveModel","existingHash","newHash","getContentModel","id","useEffect","Routes","container","useContainer","layoutFieldTypes","useMemo","CmsLayoutFieldType","fieldOptions","model","prefixes","buildFieldLabelPrefixes","buildFieldOptions","Provider","ModelProvider"],"mappings":";;;;;;;;;;;AA0CO,MAAMA,4BAA4B,WAAHA,GAAGC,MAAAA,aAAmB,CAE1DC;AAeK,MAAMC,4BAAqC,CAACC,MAAaC;IAC5D,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAE,GAAGF;IACvB,OAAQE;QACJ,KAAK;YACD,OAAO;gBAAE,GAAGH,IAAI;gBAAE,GAAGE,IAAI;YAAC;QAE9B,KAAK;YACD,OAAO;gBAAE,GAAGF,IAAI;gBAAE,MAAME;YAAiB;QAC7C;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xB,IAAI,CAACgC,OACD,OAAO,EAAE;QAEb,MAAMC,WAAWD,MAAM,MAAM,GACvBE,wBAAwBF,MAAM,MAAM,EAAEJ,oBACtCxD;QACN,OAAO+D,kBAAkBH,MAAM,MAAM,IAAI,EAAE,EAAE,IAAI,IAAIC,UAAUL;IACnE,GAAG;QAAC5B,MAAM,IAAI,EAAE;QAAQA,MAAM,IAAI,EAAE;KAAO;IAE3C,MAAMb,QAAQ0C,QACV,IAAO;YACH,MAAM7B,MAAM,IAAI;YAChB,cAAcA,MAAM,IAAI;YACxB,YAAYA,MAAM,UAAU;YAC5BsB;YACAb;YACAQ;YACA,gBAAgBjB,MAAM,cAAc;YACpCc;YACAiB;QACJ,IACA;QAAC/B;QAAO+B;KAAa;IAGzB,MAAM,EAAEK,QAAQ,EAAE,GAAGlE;IAErB,OAAO,WAAP,GACI,oBAACkE,UAAAA;QAAS,OAAOjD;qBACb,oBAACkD,eAAaA;QAAC,OAAOlD,MAAM,YAAY;OAAGO;AAGvD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import react, { useMemo } from "react";
|
|
2
2
|
import { useContainer } from "@webiny/app";
|
|
3
|
+
import { useModelEditor } from "../../hooks/index.js";
|
|
3
4
|
import Draggable from "../Draggable.js";
|
|
4
5
|
import { IconButton } from "@webiny/admin-ui";
|
|
5
6
|
import { GridItem } from "./GridItem.js";
|
|
@@ -33,8 +34,17 @@ const LayoutFieldItem = ({ onFieldDragStart, layoutFieldType: { type, label, ico
|
|
|
33
34
|
}));
|
|
34
35
|
const FieldsSidebar = ({ onFieldDragStart, onCollapse })=>{
|
|
35
36
|
const container = useContainer();
|
|
36
|
-
const
|
|
37
|
-
|
|
37
|
+
const { data: model } = useModelEditor();
|
|
38
|
+
const fieldTypes = useMemo(()=>{
|
|
39
|
+
const existingTypes = new Set((model?.fields ?? []).map((f)=>f.type));
|
|
40
|
+
return container.resolveAll(CmsFieldType).filter((ft)=>{
|
|
41
|
+
if (ft.hideInAdmin) return false;
|
|
42
|
+
if (ft.deprecated) return existingTypes.has(ft.type);
|
|
43
|
+
return true;
|
|
44
|
+
});
|
|
45
|
+
}, [
|
|
46
|
+
container,
|
|
47
|
+
model?.fields
|
|
38
48
|
]);
|
|
39
49
|
const layoutFieldTypes = useMemo(()=>container.resolveAll(CmsLayoutFieldType), [
|
|
40
50
|
container
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentModelEditor/FieldsSidebar.js","sources":["../../../../src/admin/components/ContentModelEditor/FieldsSidebar.tsx"],"sourcesContent":["import type { DragEventHandler } from \"react\";\nimport React, { useMemo } from \"react\";\nimport { useContainer } from \"@webiny/app\";\nimport Draggable from \"../Draggable.js\";\nimport { IconButton } from \"@webiny/admin-ui\";\nimport { GridItem } from \"./GridItem.js\";\nimport { SectionHeader } from \"./SectionHeader.js\";\nimport { FieldsGrid } from \"./FieldsGrid.js\";\nimport { ReactComponent as CollapseSidebarIcon } from \"@webiny/icons/right_panel_open.svg\";\nimport { CmsFieldType, type ICmsFieldType } from \"~/presentation/fieldTypes/abstractions.js\";\nimport {\n CmsLayoutFieldType,\n type ICmsLayoutFieldType\n} from \"~/presentation/fieldTypes/abstractions.js\";\n\ninterface FieldProps {\n onFieldDragStart: DragEventHandler;\n fieldType: ICmsFieldType;\n}\n\nconst Field = ({ onFieldDragStart, fieldType }: FieldProps) => {\n return (\n <Draggable beginDrag={{ type: \"newField\", fieldType: fieldType.type }}>\n {({ drag }) => (\n <GridItem\n testId={`cms-editor-fields-field-${fieldType.type}`}\n label={fieldType.label}\n icon={fieldType.icon}\n onDragStart={onFieldDragStart}\n dragRef={element => drag(element)}\n />\n )}\n </Draggable>\n );\n};\n\ninterface LayoutFieldItemProps {\n onFieldDragStart: DragEventHandler;\n layoutFieldType: ICmsLayoutFieldType;\n}\n\nconst LayoutFieldItem = ({\n onFieldDragStart,\n layoutFieldType: { type, label, icon }\n}: LayoutFieldItemProps) => {\n return (\n <Draggable beginDrag={{ type: \"newLayoutField\", layoutFieldType: type }}>\n {({ drag }) => (\n <GridItem\n testId={`cms-editor-fields-layout-field-${type}`}\n label={label}\n icon={icon as React.ReactElement}\n onDragStart={onFieldDragStart}\n dragRef={element => drag(element)}\n />\n )}\n </Draggable>\n );\n};\n\ninterface FieldsSidebarProps {\n onFieldDragStart: DragEventHandler;\n onCollapse?: () => void;\n}\n\nexport const FieldsSidebar = ({ onFieldDragStart, onCollapse }: FieldsSidebarProps) => {\n const container = useContainer();\n\n const fieldTypes = useMemo(() => {\n return container.resolveAll(CmsFieldType).filter(ft =>
|
|
1
|
+
{"version":3,"file":"admin/components/ContentModelEditor/FieldsSidebar.js","sources":["../../../../src/admin/components/ContentModelEditor/FieldsSidebar.tsx"],"sourcesContent":["import type { DragEventHandler } from \"react\";\nimport React, { useMemo } from \"react\";\nimport { useContainer } from \"@webiny/app\";\nimport { useModelEditor } from \"~/admin/hooks/index.js\";\nimport Draggable from \"../Draggable.js\";\nimport { IconButton } from \"@webiny/admin-ui\";\nimport { GridItem } from \"./GridItem.js\";\nimport { SectionHeader } from \"./SectionHeader.js\";\nimport { FieldsGrid } from \"./FieldsGrid.js\";\nimport { ReactComponent as CollapseSidebarIcon } from \"@webiny/icons/right_panel_open.svg\";\nimport { CmsFieldType, type ICmsFieldType } from \"~/presentation/fieldTypes/abstractions.js\";\nimport {\n CmsLayoutFieldType,\n type ICmsLayoutFieldType\n} from \"~/presentation/fieldTypes/abstractions.js\";\n\ninterface FieldProps {\n onFieldDragStart: DragEventHandler;\n fieldType: ICmsFieldType;\n}\n\nconst Field = ({ onFieldDragStart, fieldType }: FieldProps) => {\n return (\n <Draggable beginDrag={{ type: \"newField\", fieldType: fieldType.type }}>\n {({ drag }) => (\n <GridItem\n testId={`cms-editor-fields-field-${fieldType.type}`}\n label={fieldType.label}\n icon={fieldType.icon}\n onDragStart={onFieldDragStart}\n dragRef={element => drag(element)}\n />\n )}\n </Draggable>\n );\n};\n\ninterface LayoutFieldItemProps {\n onFieldDragStart: DragEventHandler;\n layoutFieldType: ICmsLayoutFieldType;\n}\n\nconst LayoutFieldItem = ({\n onFieldDragStart,\n layoutFieldType: { type, label, icon }\n}: LayoutFieldItemProps) => {\n return (\n <Draggable beginDrag={{ type: \"newLayoutField\", layoutFieldType: type }}>\n {({ drag }) => (\n <GridItem\n testId={`cms-editor-fields-layout-field-${type}`}\n label={label}\n icon={icon as React.ReactElement}\n onDragStart={onFieldDragStart}\n dragRef={element => drag(element)}\n />\n )}\n </Draggable>\n );\n};\n\ninterface FieldsSidebarProps {\n onFieldDragStart: DragEventHandler;\n onCollapse?: () => void;\n}\n\nexport const FieldsSidebar = ({ onFieldDragStart, onCollapse }: FieldsSidebarProps) => {\n const container = useContainer();\n const { data: model } = useModelEditor();\n\n const fieldTypes = useMemo(() => {\n const existingTypes = new Set((model?.fields ?? []).map(f => f.type));\n return container.resolveAll(CmsFieldType).filter(ft => {\n if (ft.hideInAdmin) {\n return false;\n }\n // Deprecated field types (e.g. \"file\", superseded by \"asset\") are only\n // offered when the model already contains a field of that type, so\n // existing models stay editable while new fields use the replacement.\n if (ft.deprecated) {\n return existingTypes.has(ft.type);\n }\n return true;\n });\n }, [container, model?.fields]);\n\n const layoutFieldTypes = useMemo(() => {\n return container.resolveAll(CmsLayoutFieldType);\n }, [container]);\n\n return (\n <>\n <SectionHeader\n title={\"Fields\"}\n action={\n onCollapse && (\n <IconButton\n variant={\"ghost\"}\n size={\"xs\"}\n icon={<CollapseSidebarIcon />}\n onClick={onCollapse}\n />\n )\n }\n />\n <FieldsGrid>\n {fieldTypes.map(ft => (\n <Field key={ft.type} fieldType={ft} onFieldDragStart={onFieldDragStart} />\n ))}\n </FieldsGrid>\n {layoutFieldTypes.length > 0 && (\n <>\n <SectionHeader title={\"Layout\"} />\n <FieldsGrid>\n {layoutFieldTypes.map(lft => (\n <LayoutFieldItem\n key={lft.type}\n layoutFieldType={lft}\n onFieldDragStart={onFieldDragStart}\n />\n ))}\n </FieldsGrid>\n </>\n )}\n </>\n );\n};\n"],"names":["Field","onFieldDragStart","fieldType","Draggable","drag","GridItem","element","LayoutFieldItem","type","label","icon","FieldsSidebar","onCollapse","container","useContainer","model","useModelEditor","fieldTypes","useMemo","existingTypes","Set","f","CmsFieldType","ft","layoutFieldTypes","CmsLayoutFieldType","SectionHeader","IconButton","CollapseSidebarIcon","FieldsGrid","lft"],"mappings":";;;;;;;;;;AAqBA,MAAMA,QAAQ,CAAC,EAAEC,gBAAgB,EAAEC,SAAS,EAAc,GAC/C,WAAP,GACI,oBAACC,WAASA;QAAC,WAAW;YAAE,MAAM;YAAY,WAAWD,UAAU,IAAI;QAAC;OAC/D,CAAC,EAAEE,IAAI,EAAE,iBACN,oBAACC,UAAQA;YACL,QAAQ,CAAC,wBAAwB,EAAEH,UAAU,IAAI,EAAE;YACnD,OAAOA,UAAU,KAAK;YACtB,MAAMA,UAAU,IAAI;YACpB,aAAaD;YACb,SAASK,CAAAA,UAAWF,KAAKE;;AAY7C,MAAMC,kBAAkB,CAAC,EACrBN,gBAAgB,EAChB,iBAAiB,EAAEO,IAAI,EAAEC,KAAK,EAAEC,IAAI,EAAE,EACnB,GACZ,WAAP,GACI,oBAACP,WAASA;QAAC,WAAW;YAAE,MAAM;YAAkB,iBAAiBK;QAAK;OACjE,CAAC,EAAEJ,IAAI,EAAE,iBACN,oBAACC,UAAQA;YACL,QAAQ,CAAC,+BAA+B,EAAEG,MAAM;YAChD,OAAOC;YACP,MAAMC;YACN,aAAaT;YACb,SAASK,CAAAA,UAAWF,KAAKE;;AAYtC,MAAMK,gBAAgB,CAAC,EAAEV,gBAAgB,EAAEW,UAAU,EAAsB;IAC9E,MAAMC,YAAYC;IAClB,MAAM,EAAE,MAAMC,KAAK,EAAE,GAAGC;IAExB,MAAMC,aAAaC,QAAQ;QACvB,MAAMC,gBAAgB,IAAIC,IAAKL,AAAAA,CAAAA,OAAO,UAAU,EAAC,EAAG,GAAG,CAACM,CAAAA,IAAKA,EAAE,IAAI;QACnE,OAAOR,UAAU,UAAU,CAACS,cAAc,MAAM,CAACC,CAAAA;YAC7C,IAAIA,GAAG,WAAW,EACd,OAAO;YAKX,IAAIA,GAAG,UAAU,EACb,OAAOJ,cAAc,GAAG,CAACI,GAAG,IAAI;YAEpC,OAAO;QACX;IACJ,GAAG;QAACV;QAAWE,OAAO;KAAO;IAE7B,MAAMS,mBAAmBN,QAAQ,IACtBL,UAAU,UAAU,CAACY,qBAC7B;QAACZ;KAAU;IAEd,OAAO,WAAP,GACI,wDACI,oBAACa,eAAaA;QACV,OAAO;QACP,QACId,cAAc,WAAdA,GACI,oBAACe,YAAUA;YACP,SAAS;YACT,MAAM;YACN,oBAAM,oBAACC,gBAAmBA;YAC1B,SAAShB;;sBAKzB,oBAACiB,YAAUA,MACNZ,WAAW,GAAG,CAACM,CAAAA,KAAAA,WAAAA,GACZ,oBAACvB,OAAKA;YAAC,KAAKuB,GAAG,IAAI;YAAE,WAAWA;YAAI,kBAAkBtB;cAG7DuB,iBAAiB,MAAM,GAAG,KAAK,WAAL,GACvB,wDACI,oBAACE,eAAaA;QAAC,OAAO;sBACtB,oBAACG,YAAUA,MACNL,iBAAiB,GAAG,CAACM,CAAAA,MAAAA,WAAAA,GAClB,oBAACvB,iBAAeA;YACZ,KAAKuB,IAAI,IAAI;YACb,iBAAiBA;YACjB,kBAAkB7B;;AAQlD"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
function resolveFieldPath(fieldPath, bindParentName) {
|
|
2
2
|
if (!fieldPath.includes("$")) return fieldPath;
|
|
3
|
+
if (fieldPath.startsWith("$.")) {
|
|
4
|
+
const relative = fieldPath.slice(2);
|
|
5
|
+
return bindParentName ? `${bindParentName}.${relative}` : relative;
|
|
6
|
+
}
|
|
3
7
|
if (!bindParentName) return fieldPath.replace(/\$/g, "0");
|
|
4
8
|
const pathParts = fieldPath.split(".");
|
|
5
9
|
const parentParts = bindParentName.split(".");
|