@webiny/app-headless-cms 6.5.2-beta.1 → 6.5.2-beta.3
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 +2 -2
- package/ContentEntriesModule.js.map +1 -1
- package/HeadlessCMS.js.map +1 -1
- package/admin/RoutesConfig.js +1 -1
- package/admin/RoutesConfig.js.map +1 -1
- package/admin/components/ContentEntries/BulkActions/BulkActions.js.map +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer.js +1 -1
- package/admin/components/ContentEntries/Filters/RefFieldRenderer.js.map +1 -1
- package/admin/components/ContentEntries/Table/Cells/CellName.js.map +1 -1
- package/admin/components/ContentModelEditor/ContentModelEditorProvider.js.map +1 -1
- package/admin/components/ContentModelEditor/FieldsSidebar.js.map +1 -1
- package/admin/components/ContentModelEditor/ModelIsBeingDeletedError/ModelIsBeingDeletedError.js.map +1 -1
- package/admin/components/ContentModelEditor/PreviewTab.js.map +1 -1
- package/admin/components/Draggable.js.map +1 -1
- package/admin/components/Droppable.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/PermissionsEditor/FieldPermissionsSelection.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/RulesEditor/RulesEditor.js.map +1 -1
- package/admin/components/FieldEditor/FieldEditor.js.map +1 -1
- package/admin/components/FieldEditor/FieldEditorContext.js.map +1 -1
- package/admin/components/LexicalCmsEditor/LexicalEditor.js.map +1 -1
- package/admin/components/LexicalCmsEditor/LexicalEditorCmsPlugin.js +1 -1
- package/admin/components/LexicalCmsEditor/LexicalEditorCmsPlugin.js.map +1 -1
- package/admin/components/ModelFieldProvider/ModelFieldContext.js +1 -1
- package/admin/components/ModelFieldProvider/ModelFieldContext.js.map +1 -1
- package/admin/components/ModelProvider/ModelContext.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/AdvancedSearch/FieldRenderer.js +1 -1
- package/admin/config/contentEntries/list/Browser/AdvancedSearch/FieldRenderer.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/EntryAction.js +1 -1
- package/admin/config/contentEntries/list/Browser/EntryAction.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/Filter.js +1 -1
- package/admin/config/contentEntries/list/Browser/Filter.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/FolderAction.js +1 -1
- package/admin/config/contentEntries/list/Browser/FolderAction.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/FolderDropConfirmation.js +1 -1
- package/admin/config/contentEntries/list/Browser/FolderDropConfirmation.js.map +1 -1
- package/admin/config/contentEntries/list/Browser/Table/Column.js +2 -2
- package/admin/config/contentEntries/list/Browser/Table/Column.js.map +1 -1
- package/admin/hooks/useEntry.js.map +1 -1
- package/admin/plugins/editor/defaultBar/BackButton.js.map +1 -1
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.js.map +1 -1
- package/admin/plugins/permissionRenderer/CmsPermissions.js.map +1 -1
- package/admin/plugins/permissionRenderer/index.js +1 -1
- package/admin/plugins/permissionRenderer/index.js.map +1 -1
- package/exports/admin/cms/field-renderers/index.d.ts +1 -0
- package/exports/admin/cms/field-renderers/index.js +1 -0
- package/package.json +24 -24
- package/presentation/contentEntries/preview/resolvePreviewUrl.test.js.map +1 -1
- package/presentation/contentEntries/views/ContentEntriesListLayout.js.map +1 -1
- package/presentation/contentEntries/views/ContentEntryFormView.js.map +1 -1
- package/presentation/contentEntries/views/ListView.js.map +1 -1
- package/presentation/contentEntries/views/RevisionListItem.js.map +1 -1
- package/presentation/contentEntries/views/layout/Container.js.map +1 -1
- package/presentation/contentModels/components/ContentModelsDataList.js.map +1 -1
- package/presentation/contentModels/components/fullDelete/ModelIsBeingDeleted.js.map +1 -1
- package/presentation/contentModels/components/fullDelete/types.js.map +1 -1
- package/presentation/fieldEditor/renderers/CmsAccessControlRulesRenderer.js.map +1 -1
- package/presentation/fieldEditor/renderers/CmsConditionRulesRenderer.js.map +1 -1
- package/presentation/fieldEditor/renderers/CmsPredefinedValuesRenderer.js.map +1 -1
- package/presentation/fieldEditor/renderers/CmsRendererSelectorRenderer.js.map +1 -1
- package/presentation/fieldEditor/renderers/CmsValidatorsRenderer.js.map +1 -1
- package/presentation/fieldRenderers/abstractions.d.ts +6 -4
- package/presentation/fieldRenderers/abstractions.js.map +1 -1
- package/presentation/fieldRenderers/ref/CmsRefDetailedMultipleRenderer.js.map +1 -1
- package/presentation/fieldRenderers/ref/CmsRefDetailedSingleRenderer.js.map +1 -1
- package/presentation/fieldRenderers/ref/CmsRefInputRenderer.js.map +1 -1
- package/presentation/fieldRenderers/ref/CmsRefInputsRenderer.js.map +1 -1
- package/presentation/fieldRenderers/ref/CmsRefSimpleMultipleRenderer.js.map +1 -1
- package/presentation/fieldRenderers/ref/CmsRefSimpleSingleRenderer.js.map +1 -1
- package/presentation/fieldRenderers/ref/components/EditEntryDrawer.js.map +1 -1
- package/presentation/fieldRenderers/ref/components/NewEntryDrawer.js.map +1 -1
- package/presentation/fieldRenderers/ref/components/RefFieldOptions.js.map +1 -1
- package/presentation/fieldRenderers/ref/components/ReferencesDialog.js.map +1 -1
- package/presentation/fieldTypes/types/layout/AlertLayoutFieldType.js.map +1 -1
- package/presentation/fieldTypes/types/layout/SeparatorLayoutFieldType.js.map +1 -1
- package/presentation/fieldTypes/types/layout/TabsLayoutEditor.js.map +1 -1
- package/presentation/fieldTypes/types/ref/renderInfo.js.map +1 -1
- package/presentation/importContentModels/components/DataListGroup.js.map +1 -1
- package/presentation/importContentModels/components/Errors.js.map +1 -1
- package/presentation/importContentModels/components/Model/DataListInstructions.js.map +1 -1
- package/presentation/importContentModels/components/Model/DataListModelItem.js.map +1 -1
- package/presentation/importContentModels/components/Model/DataListModelItemError.js.map +1 -1
- package/presentation/importContentModels/components/Model/DataListModelItemInfo.js.map +1 -1
- package/presentation/importContentModels/components/Model/DataListModels.js.map +1 -1
- package/presentation/importContentModels/types.js.map +1 -1
- package/presentation/menus/CmsMenuLoader.js +1 -1
- package/presentation/menus/CmsMenuLoader.js.map +1 -1
- package/presentation/menus/GroupContentModels.js +1 -1
- package/presentation/menus/GroupContentModels.js.map +1 -1
- package/presentation/menus/GroupMenu.js +1 -1
- package/presentation/menus/GroupMenu.js.map +1 -1
package/ContentEntriesModule.js
CHANGED
|
@@ -26,8 +26,8 @@ import { DeleteEntryMenuItem } from "./presentation/contentEntries/views/actions
|
|
|
26
26
|
import { ShowRevisionListMenuItem } from "./presentation/contentEntries/views/actions/ShowRevisionListMenuItem.js";
|
|
27
27
|
import { CreateNewRevisionButton } from "./presentation/contentEntries/views/actions/CreateNewRevisionButton.js";
|
|
28
28
|
import { PublishOnlyButton } from "./presentation/contentEntries/views/actions/PublishOnlyButton.js";
|
|
29
|
-
const { Browser
|
|
30
|
-
const { Actions
|
|
29
|
+
const { Browser } = InternalContentEntryListConfig;
|
|
30
|
+
const { Actions } = InternalContentEntryEditorConfig;
|
|
31
31
|
const ContentEntriesModule = ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(AdminConfig.Dialog, {
|
|
32
32
|
name: TRASH_ENTRY_DIALOG,
|
|
33
33
|
element: /*#__PURE__*/ react.createElement(TrashEntryConfirmDialog, null)
|
|
@@ -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 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 DUPLICATE_ENTRY_DIALOG\n} from \"~/presentation/contentEntries/list/ContentEntriesPresenter.js\";\nimport { DeleteFolder, EditFolder, SetFolderPermissions } from \"@webiny/app-aco\";\nimport {\n ChangeEntryStatus,\n DeleteEntry,\n DuplicateEntry,\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 { Ref } from \"~/admin/components/ContentEntries/Filters/RefFieldRenderer.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 { DuplicateEntryConfirmDialog } from \"~/admin/components/Dialogs/DuplicateEntryConfirmDialog.js\";\nimport { DeleteRevisionConfirmDialog } from \"~/admin/components/Dialogs/DeleteRevisionConfirmDialog.js\";\nimport { EditRevisionNoteDialog } from \"~/admin/components/Dialogs/EditRevisionNoteDialog.js\";\nimport {\n DELETE_REVISION_DIALOG,\n EDIT_REVISION_NOTE_DIALOG\n} 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={DUPLICATE_ENTRY_DIALOG}\n element={<DuplicateEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={DELETE_REVISION_DIALOG}\n element={<DeleteRevisionConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={EDIT_REVISION_NOTE_DIALOG}\n element={<EditRevisionNoteDialog />}\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={\"duplicate\"} element={<DuplicateEntry />} />\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 sortable={true}\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 <Browser.AdvancedSearch.FieldRenderer\n name={\"ref\"}\n type={Browser.AdvancedSearch.FieldRenderer.FieldType.REF}\n element={<Ref />}\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","DUPLICATE_ENTRY_DIALOG","DuplicateEntryConfirmDialog","DELETE_REVISION_DIALOG","DeleteRevisionConfirmDialog","EDIT_REVISION_NOTE_DIALOG","EditRevisionNoteDialog","AdvancedSearchConfigs","IsModelPublishable","FilterByStatus","ActionPublish","ActionUnpublish","CmsTrashBin","ActionMove","ActionDelete","EditFolder","SetFolderPermissions","DeleteFolder","EditEntry","ChangeEntryStatus","MoveEntry","DuplicateEntry","DeleteEntry","CellName","CellAuthor","CellCreated","CellModified","CellStatus","CellLive","CellActions","Ref","RevisionSelector","ContentFormOptionsMenu","SaveContentButton","CreateNewRevisionButton","SaveAndPublishButton","PublishOnlyButton","DeleteEntryMenuItem","ShowRevisionListMenuItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,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;sBA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BAACxC,QAAQ,cAAc,CAAC,aAAa;QACjC,MAAM;QACN,MAAMA,QAAQ,cAAc,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG;QACxD,uBAAS,oBAACyC,KAAGA;uBAGrB,oBAACtC,kCAAgCA,MAAAA,WAAAA,GAC7B,oBAACgB,oBAAkBA,MAAAA,WAAAA,GACf,oBAACjB,QAAQ,YAAY;QACjB,MAAM;QACN,uBAAS,oBAACwC,kBAAgBA;uBAGlC,oBAACxC,QAAQ,YAAY;QAAC,MAAM;QAAe,uBAAS,oBAACyC,wBAAsBA;sBAC3E,oBAACzC,QAAQ,YAAY;QAAC,MAAM;QAAQ,uBAAS,oBAAC0C,mBAAiBA;sBAC/D,oBAACzB,oBAAkBA,MAAAA,WAAAA,GACf,oBAACjB,QAAQ,YAAY;QACjB,MAAM;QACN,uBAAS,oBAAC2C,yBAAuBA;sBAErC,oBAAC3C,QAAQ,YAAY;QAAC,MAAM;QAAW,uBAAS,oBAAC4C,sBAAoBA;sBACrE,oBAAC5C,QAAQ,YAAY;QAAC,MAAM;QAAe,uBAAS,oBAAC6C,mBAAiBA;uBAE1E,oBAAC7C,QAAQ,cAAc;QACnB,MAAM;QACN,uBAAS,oBAAC8C,qBAAmBA;QAC7B,OAAO;sBAEX,oBAAC7B,oBAAkBA,MAAAA,WAAAA,GACf,oBAACjB,QAAQ,cAAc;QACnB,MAAM;QACN,uBAAS,oBAAC+C,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 DUPLICATE_ENTRY_DIALOG\n} from \"~/presentation/contentEntries/list/ContentEntriesPresenter.js\";\nimport { DeleteFolder, EditFolder, SetFolderPermissions } from \"@webiny/app-aco\";\nimport {\n ChangeEntryStatus,\n DeleteEntry,\n DuplicateEntry,\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 { Ref } from \"~/admin/components/ContentEntries/Filters/RefFieldRenderer.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 { DuplicateEntryConfirmDialog } from \"~/admin/components/Dialogs/DuplicateEntryConfirmDialog.js\";\nimport { DeleteRevisionConfirmDialog } from \"~/admin/components/Dialogs/DeleteRevisionConfirmDialog.js\";\nimport { EditRevisionNoteDialog } from \"~/admin/components/Dialogs/EditRevisionNoteDialog.js\";\nimport {\n DELETE_REVISION_DIALOG,\n EDIT_REVISION_NOTE_DIALOG\n} 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={DUPLICATE_ENTRY_DIALOG}\n element={<DuplicateEntryConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={DELETE_REVISION_DIALOG}\n element={<DeleteRevisionConfirmDialog />}\n />\n <AdminConfig.Dialog\n name={EDIT_REVISION_NOTE_DIALOG}\n element={<EditRevisionNoteDialog />}\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={\"duplicate\"} element={<DuplicateEntry />} />\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 sortable={true}\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 <Browser.AdvancedSearch.FieldRenderer\n name={\"ref\"}\n type={Browser.AdvancedSearch.FieldRenderer.FieldType.REF}\n element={<Ref />}\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","DUPLICATE_ENTRY_DIALOG","DuplicateEntryConfirmDialog","DELETE_REVISION_DIALOG","DeleteRevisionConfirmDialog","EDIT_REVISION_NOTE_DIALOG","EditRevisionNoteDialog","AdvancedSearchConfigs","IsModelPublishable","FilterByStatus","ActionPublish","ActionUnpublish","CmsTrashBin","ActionMove","ActionDelete","EditFolder","SetFolderPermissions","DeleteFolder","EditEntry","ChangeEntryStatus","MoveEntry","DuplicateEntry","DeleteEntry","CellName","CellAuthor","CellCreated","CellModified","CellStatus","CellLive","CellActions","Ref","RevisionSelector","ContentFormOptionsMenu","SaveContentButton","CreateNewRevisionButton","SaveAndPublishButton","PublishOnlyButton","DeleteEntryMenuItem","ShowRevisionListMenuItem"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,MAAM,EAAEA,OAAO,EAAE,GAAGC;AACpB,MAAM,EAAEC,OAAO,EAAE,GAAGC;AAEb,MAAMC,uBAAuB,IACzB,WAAP,GACI,wDACI,oBAACC,aAAWA,MAAAA,WA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C,aAAWA;QAClB,MAAM;QACN,WAAW;QACX,UAAU;QACV,UAAU;QACV,WAAW;sBAEf,oBAACxC,QAAQ,cAAc,CAAC,aAAa;QACjC,MAAM;QACN,MAAMA,QAAQ,cAAc,CAAC,aAAa,CAAC,SAAS,CAAC,GAAG;QACxD,uBAAS,oBAACyC,KAAGA;uBAGrB,oBAACtC,kCAAgCA,MAAAA,WAAAA,GAC7B,oBAACgB,oBAAkBA,MAAAA,WAAAA,GACf,oBAACjB,QAAQ,YAAY;QACjB,MAAM;QACN,uBAAS,oBAACwC,kBAAgBA;uBAGlC,oBAACxC,QAAQ,YAAY;QAAC,MAAM;QAAe,uBAAS,oBAACyC,wBAAsBA;sBAC3E,oBAACzC,QAAQ,YAAY;QAAC,MAAM;QAAQ,uBAAS,oBAAC0C,mBAAiBA;sBAC/D,oBAACzB,oBAAkBA,MAAAA,WAAAA,GACf,oBAACjB,QAAQ,YAAY;QACjB,MAAM;QACN,uBAAS,oBAAC2C,yBAAuBA;sBAErC,oBAAC3C,QAAQ,YAAY;QAAC,MAAM;QAAW,uBAAS,oBAAC4C,sBAAoBA;sBACrE,oBAAC5C,QAAQ,YAAY;QAAC,MAAM;QAAe,uBAAS,oBAAC6C,mBAAiBA;uBAE1E,oBAAC7C,QAAQ,cAAc;QACnB,MAAM;QACN,uBAAS,oBAAC8C,qBAAmBA;QAC7B,OAAO;sBAEX,oBAAC7B,oBAAkBA,MAAAA,WAAAA,GACf,oBAACjB,QAAQ,cAAc;QACnB,MAAM;QACN,uBAAS,oBAAC+C,0BAAwBA"}
|
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/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,iBA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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"}
|
|
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,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;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AEf,oBAACZ,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWa;sBAEf,oBAACb,YAAY,IAAI,CAAC,aAAa;QAC3B,MAAM;QACN,WAAWc;;AAK/B;AAEO,MAAMC,cAAc,WAAdA,GAAcC,KAAK/C"}
|
package/admin/RoutesConfig.js
CHANGED
|
@@ -15,7 +15,7 @@ const Loader = ({ children, ...props })=>/*#__PURE__*/ react.createElement(Suspe
|
|
|
15
15
|
const ContentModelEditor = /*#__PURE__*/ lazy(()=>import("./views/contentModels/ContentModelEditor.js"));
|
|
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
|
-
const { Route
|
|
18
|
+
const { Route } = AdminConfig;
|
|
19
19
|
const RoutesConfig = ()=>/*#__PURE__*/ react.createElement(AdminConfig, null, /*#__PURE__*/ react.createElement(Route, {
|
|
20
20
|
route: Routes.ContentModelGroups.List,
|
|
21
21
|
element: /*#__PURE__*/ react.createElement(SecureRoute, {
|
|
@@ -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","RoutesConfig","Routes","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,
|
|
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","RoutesConfig","Routes","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,WAArBA,GAAqBC,KACvB,IACI,MAAM,CAAN;AAKR,MAAMC,oBAAoB,WAApBA,GAAoBD,KACtB,IACI,MAAM,CAAN;AAKR,MAAME,yBAAyB,WAAzBA,GAAyBF,KAC3B,IACI,MAAM,CAAN;AAMR,MAAM,EAAEG,KAAK,EAAE,GAAGC;AAEX,MAAMC,eAAe,IACjB,WAAP,GACI,oBAACD,aAAWA,MAAAA,WAAAA,GACR,oBAACD,OAAAA;QACG,OAAOG,OAAO,kBAAkB,CAAC,IAAI;QACrC,uBACI,oBAACC,aAAWA;YAAC,YAAY;yBACrB,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACC,cAAMA,MAAAA,WAAAA,GACH,oBAAC,eAAOlB,CAAC,CAAC,oBAAoB,CAAC,kBAEnC,oBAACE,QAAAA,MAAAA,WAAAA,GACG,oBAACS,wBAAAA;sBAMrB,oBAACC,OAAAA;QACG,OAAOG,OAAO,cAAc,CAAC,IAAI;QACjC,uBACI,oBAACC,aAAWA;YAAC,YAAY;yBACrB,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACC,cAAMA,MAAAA,WAAAA,GACH,oBAAC,eAAOlB,CAAC,CAAC,OAAO,CAAC,kBAEtB,oBAACmB,kBAAgBA;YAAC,MAAM;yBACpB,oBAACC,4BAA0BA;sBAM/C,oBAACR,OAAAA;QACG,OAAOG,OAAO,aAAa,CAAC,MAAM;QAClC,uBACI,oBAACC,aAAWA;YAAC,YAAY;yBACrB,oBAACE,cAAMA,MAAAA,WAAAA,GACH,oBAAC,eAAOlB,CAAC,CAAC,kBAAkB,CAAC,kBAEjC,oBAACmB,kBAAgBA;YAAC,MAAM;yBACpB,oBAACjB,QAAAA,MAAAA,WAAAA,GACG,oBAACM,oBAAAA;sBAMrB,oBAACI,OAAAA;QACG,OAAOG,OAAO,aAAa,CAAC,IAAI;QAChC,uBACI,oBAACC,aAAWA;YAAC,YAAY;yBACrB,oBAACC,aAAWA,MAAAA,WAAAA,GACR,oBAACC,cAAMA;YAAC,OAAOlB,CAAC,CAAC,cAAc,CAAC;0BAChC,oBAACE,QAAAA,MAAAA,WAAAA,GACG,oBAACQ,mBAAAA;sBAOrB,oBAACW,eAAaA,OAAAA,WAAAA,GAEd,oBAACC,eAAaA;QAAC,MAAM;qBACjB,oBAACT,YAAY,SAAS,CAAC,MAAM;QACzB,MAAK;QACL,QAAO;QACP,uBAAS,oBAACU,qBAAmBA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentEntries/BulkActions/BulkActions.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/BulkActions.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Text, IconButton, Button } from \"@webiny/admin-ui\";\nimport { ReactComponent as Close } from \"@webiny/icons/close.svg\";\nimport { Buttons, useListView } from \"@webiny/app-admin\";\n\nimport { useContentEntryListConfig } from \"~/admin/config/contentEntries/index.js\";\n\nimport { i18n } from \"@webiny/app/i18n/index.js\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/content-entries/bulk-actions\");\n\nexport const SelectAll = () => {\n const { list, actions } = useListView();\n\n if (list.selection.selectedCount === 0) {\n return null;\n }\n\n return (\n <div data-testid={\"select-all-container\"}>\n {list.selection.allSelected ? (\n <Button\n text={\"Clear selection\"}\n onClick={() => actions.selection.deselectAll()}\n size={\"sm\"}\n variant={\"ghost\"}\n />\n ) : (\n <Button\n text={\"Select all remaining entries\"}\n onClick={() => actions.selection.selectAll()}\n size={\"sm\"}\n variant={\"secondary\"}\n />\n )}\n </div>\n );\n};\n\nexport const BulkActions = () => {\n const { browser } = useContentEntryListConfig();\n const { list, actions } = useListView();\n\n const count = list.selection.selectedCount;\n const isAll = list.selection.allSelected;\n\n const headline = useMemo((): string => {\n if (isAll) {\n return t(\"All entries selected\");\n }\n\n return t`{count|count:1:entry:default:entries} selected`({\n count\n });\n }, [count, isAll]);\n\n if (count === 0) {\n return null;\n }\n\n return (\n <div className={\"w-full bg-neutral-disabled px-md py-sm\"}>\n <div className={\"flex items-center justify-between gap-sm\"}>\n <div className={\"flex items-center gap-sm\"}>\n <Text size={\"sm\"} className={\"text-neutral-strong\"}>\n {headline}\n </Text>\n <SelectAll />\n </div>\n\n <div className={\"flex items-center gap-sm\"}>\n <Buttons actions={browser.bulkActions} />\n <IconButton\n variant={\"ghost\"}\n size={\"sm\"}\n icon={<Close />}\n onClick={() => actions.selection.deselectAll()}\n />\n </div>\n </div>\n </div>\n );\n};\n"],"names":["t","i18n","SelectAll","list","actions","useListView","Button","BulkActions","browser","useContentEntryListConfig","count","isAll","headline","useMemo","Text","Buttons","IconButton","Close"],"mappings":";;;;;;AASA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAEX,MAAMC,YAAY;IACrB,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAE,GAAGC;IAE1B,IAAIF,AAAiC,MAAjCA,KAAK,SAAS,CAAC,aAAa,EAC5B,OAAO;IAGX,OAAO,WAAP,GACI,oBAAC;QAAI,eAAa;OACbA,KAAK,SAAS,CAAC,WAAW,GAAG,WAAH,GACvB,oBAACG,QAAMA;QACH,MAAM;QACN,SAAS,IAAMF,QAAQ,SAAS,CAAC,WAAW;QAC5C,MAAM;QACN,SAAS;uBAGb,oBAACE,QAAMA;QACH,MAAM;QACN,SAAS,IAAMF,QAAQ,SAAS,CAAC,SAAS;QAC1C,MAAM;QACN,SAAS;;AAK7B;AAEO,MAAMG,cAAc;IACvB,MAAM,EAAEC,OAAO,EAAE,GAAGC;IACpB,MAAM,EAAEN,IAAI,EAAEC,OAAO,EAAE,GAAGC;IAE1B,MAAMK,QAAQP,KAAK,SAAS,CAAC,aAAa;IAC1C,MAAMQ,QAAQR,KAAK,SAAS,CAAC,WAAW;IAExC,MAAMS,WAAWC,QAAQ;QACrB,IAAIF,OACA,OAAOX,EAAE;QAGb,OAAOA,CAAC,CAAC,8CAA8C,CAAC,CAAC;YACrDU;QACJ;IACJ,GAAG;QAACA;QAAOC;KAAM;IAEjB,IAAID,AAAU,MAAVA,OACA,OAAO;IAGX,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAACI,MAAIA;QAAC,MAAM;QAAM,WAAW;OACxBF,WAAAA,WAAAA,GAEL,oBAACV,
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/BulkActions/BulkActions.js","sources":["../../../../../src/admin/components/ContentEntries/BulkActions/BulkActions.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { Text, IconButton, Button } from \"@webiny/admin-ui\";\nimport { ReactComponent as Close } from \"@webiny/icons/close.svg\";\nimport { Buttons, useListView } from \"@webiny/app-admin\";\n\nimport { useContentEntryListConfig } from \"~/admin/config/contentEntries/index.js\";\n\nimport { i18n } from \"@webiny/app/i18n/index.js\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/content-entries/bulk-actions\");\n\nexport const SelectAll = () => {\n const { list, actions } = useListView();\n\n if (list.selection.selectedCount === 0) {\n return null;\n }\n\n return (\n <div data-testid={\"select-all-container\"}>\n {list.selection.allSelected ? (\n <Button\n text={\"Clear selection\"}\n onClick={() => actions.selection.deselectAll()}\n size={\"sm\"}\n variant={\"ghost\"}\n />\n ) : (\n <Button\n text={\"Select all remaining entries\"}\n onClick={() => actions.selection.selectAll()}\n size={\"sm\"}\n variant={\"secondary\"}\n />\n )}\n </div>\n );\n};\n\nexport const BulkActions = () => {\n const { browser } = useContentEntryListConfig();\n const { list, actions } = useListView();\n\n const count = list.selection.selectedCount;\n const isAll = list.selection.allSelected;\n\n const headline = useMemo((): string => {\n if (isAll) {\n return t(\"All entries selected\");\n }\n\n return t`{count|count:1:entry:default:entries} selected`({\n count\n });\n }, [count, isAll]);\n\n if (count === 0) {\n return null;\n }\n\n return (\n <div className={\"w-full bg-neutral-disabled px-md py-sm\"}>\n <div className={\"flex items-center justify-between gap-sm\"}>\n <div className={\"flex items-center gap-sm\"}>\n <Text size={\"sm\"} className={\"text-neutral-strong\"}>\n {headline}\n </Text>\n <SelectAll />\n </div>\n\n <div className={\"flex items-center gap-sm\"}>\n <Buttons actions={browser.bulkActions} />\n <IconButton\n variant={\"ghost\"}\n size={\"sm\"}\n icon={<Close />}\n onClick={() => actions.selection.deselectAll()}\n />\n </div>\n </div>\n </div>\n );\n};\n"],"names":["t","i18n","SelectAll","list","actions","useListView","Button","BulkActions","browser","useContentEntryListConfig","count","isAll","headline","useMemo","Text","Buttons","IconButton","Close"],"mappings":";;;;;;AASA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAEX,MAAMC,YAAY;IACrB,MAAM,EAAEC,IAAI,EAAEC,OAAO,EAAE,GAAGC;IAE1B,IAAIF,AAAiC,MAAjCA,KAAK,SAAS,CAAC,aAAa,EAC5B,OAAO;IAGX,OAAO,WAAP,GACI,oBAAC;QAAI,eAAa;OACbA,KAAK,SAAS,CAAC,WAAW,GAAG,WAAH,GACvB,oBAACG,QAAMA;QACH,MAAM;QACN,SAAS,IAAMF,QAAQ,SAAS,CAAC,WAAW;QAC5C,MAAM;QACN,SAAS;uBAGb,oBAACE,QAAMA;QACH,MAAM;QACN,SAAS,IAAMF,QAAQ,SAAS,CAAC,SAAS;QAC1C,MAAM;QACN,SAAS;;AAK7B;AAEO,MAAMG,cAAc;IACvB,MAAM,EAAEC,OAAO,EAAE,GAAGC;IACpB,MAAM,EAAEN,IAAI,EAAEC,OAAO,EAAE,GAAGC;IAE1B,MAAMK,QAAQP,KAAK,SAAS,CAAC,aAAa;IAC1C,MAAMQ,QAAQR,KAAK,SAAS,CAAC,WAAW;IAExC,MAAMS,WAAWC,QAAQ;QACrB,IAAIF,OACA,OAAOX,EAAE;QAGb,OAAOA,CAAC,CAAC,8CAA8C,CAAC,CAAC;YACrDU;QACJ;IACJ,GAAG;QAACA;QAAOC;KAAM;IAEjB,IAAID,AAAU,MAAVA,OACA,OAAO;IAGX,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAAC;QAAI,WAAW;qBACZ,oBAACI,MAAIA;QAAC,MAAM;QAAM,WAAW;OACxBF,WAAAA,WAAAA,GAEL,oBAACV,WAAAA,QAAAA,WAAAA,GAGL,oBAAC;QAAI,WAAW;qBACZ,oBAACa,SAAOA;QAAC,SAASP,QAAQ,WAAW;sBACrC,oBAACQ,YAAUA;QACP,SAAS;QACT,MAAM;QACN,oBAAM,oBAACC,gBAAKA;QACZ,SAAS,IAAMb,QAAQ,SAAS,CAAC,WAAW;;AAMpE"}
|
|
@@ -5,7 +5,7 @@ import { AutoComplete } from "@webiny/admin-ui";
|
|
|
5
5
|
import { DiContainerProvider, useContainer, useFeature } from "@webiny/app";
|
|
6
6
|
import { ContentEntryListConfig } from "../../../config/contentEntries/index.js";
|
|
7
7
|
import { RefSingleAutocompletePresenterFeature } from "../../../../presentation/fieldRenderers/ref/autocomplete/single/feature.js";
|
|
8
|
-
const { useInputField
|
|
8
|
+
const { useInputField } = ContentEntryListConfig.Browser.AdvancedSearch.FieldRenderer;
|
|
9
9
|
const parseValue = (value)=>{
|
|
10
10
|
if ("string" != typeof value || !value) return null;
|
|
11
11
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentEntries/Filters/RefFieldRenderer.js","sources":["../../../../../src/admin/components/ContentEntries/Filters/RefFieldRenderer.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Bind } from \"@webiny/form\";\nimport type { BindComponentRenderProp } from \"@webiny/form\";\nimport { AutoComplete } from \"@webiny/admin-ui\";\nimport { DiContainerProvider, useContainer, useFeature } from \"@webiny/app\";\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries/index.js\";\nimport { RefSingleAutocompletePresenterFeature } from \"~/presentation/fieldRenderers/ref/autocomplete/single/feature.js\";\n\nconst { useInputField } = ContentEntryListConfig.Browser.AdvancedSearch.FieldRenderer;\n\n/**\n * The advanced search filter stores the selected reference as a JSON string\n * `{ entryId, modelId }`. `GraphQLInputMapper` reads `entryId` from it to build the\n * `<fieldId>.entryId` where condition, and `modelId` is used to load the label back\n * when a saved filter is opened.\n */\ninterface RefFilterValue {\n entryId: string;\n modelId: string;\n}\n\nconst parseValue = (value: unknown): RefFilterValue | null => {\n if (typeof value !== \"string\" || !value) {\n return null;\n }\n try {\n const parsed = JSON.parse(value);\n if (!parsed?.entryId || !parsed?.modelId) {\n return null;\n }\n return { entryId: parsed.entryId, modelId: parsed.modelId };\n } catch {\n return null;\n }\n};\n\nexport const Ref = () => {\n const { name, field } = useInputField();\n const parentContainer = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = parentContainer.createChildContainer();\n RefSingleAutocompletePresenterFeature.register(child);\n return child;\n }, [field.value]);\n\n return (\n <DiContainerProvider container={scopedContainer} key={field.value}>\n <Bind name={name}>\n {bind => <RefInner bind={bind} modelIds={field.settings.modelIds} />}\n </Bind>\n </DiContainerProvider>\n );\n};\n\ninterface RefInnerProps {\n bind: BindComponentRenderProp;\n modelIds: string[];\n}\n\nconst RefInner = observer(({ bind, modelIds }: RefInnerProps) => {\n const { presenter } = useFeature(RefSingleAutocompletePresenterFeature);\n\n useEffect(() => {\n const value = parseValue(bind.value);\n presenter.init({\n modelIds,\n value: value ? { id: value.entryId, modelId: value.modelId } : null\n });\n }, []);\n\n const vm = presenter.vm;\n\n return (\n <AutoComplete\n label={\"Value\"}\n size={\"lg\"}\n loading={vm.loading}\n value={vm.value}\n options={vm.options}\n validation={bind.validation}\n shouldFilter={false}\n onValueSearch={query => presenter.search(query)}\n onValueChange={entryId => {\n if (!entryId) {\n presenter.clear();\n bind.onChange(\"\");\n return;\n }\n const ref = presenter.select(entryId);\n if (ref) {\n bind.onChange(JSON.stringify({ entryId, modelId: ref.modelId }));\n }\n }}\n onValueReset={() => {\n presenter.clear();\n bind.onChange(\"\");\n }}\n displayResetAction={vm.canReset}\n />\n );\n});\n"],"names":["useInputField","ContentEntryListConfig","parseValue","value","parsed","JSON","Ref","name","field","parentContainer","useContainer","scopedContainer","useMemo","child","RefSingleAutocompletePresenterFeature","DiContainerProvider","Bind","bind","RefInner","observer","modelIds","presenter","useFeature","useEffect","vm","AutoComplete","query","entryId","ref"],"mappings":";;;;;;;AASA,MAAM,EAAEA,
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/Filters/RefFieldRenderer.js","sources":["../../../../../src/admin/components/ContentEntries/Filters/RefFieldRenderer.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { Bind } from \"@webiny/form\";\nimport type { BindComponentRenderProp } from \"@webiny/form\";\nimport { AutoComplete } from \"@webiny/admin-ui\";\nimport { DiContainerProvider, useContainer, useFeature } from \"@webiny/app\";\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries/index.js\";\nimport { RefSingleAutocompletePresenterFeature } from \"~/presentation/fieldRenderers/ref/autocomplete/single/feature.js\";\n\nconst { useInputField } = ContentEntryListConfig.Browser.AdvancedSearch.FieldRenderer;\n\n/**\n * The advanced search filter stores the selected reference as a JSON string\n * `{ entryId, modelId }`. `GraphQLInputMapper` reads `entryId` from it to build the\n * `<fieldId>.entryId` where condition, and `modelId` is used to load the label back\n * when a saved filter is opened.\n */\ninterface RefFilterValue {\n entryId: string;\n modelId: string;\n}\n\nconst parseValue = (value: unknown): RefFilterValue | null => {\n if (typeof value !== \"string\" || !value) {\n return null;\n }\n try {\n const parsed = JSON.parse(value);\n if (!parsed?.entryId || !parsed?.modelId) {\n return null;\n }\n return { entryId: parsed.entryId, modelId: parsed.modelId };\n } catch {\n return null;\n }\n};\n\nexport const Ref = () => {\n const { name, field } = useInputField();\n const parentContainer = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = parentContainer.createChildContainer();\n RefSingleAutocompletePresenterFeature.register(child);\n return child;\n }, [field.value]);\n\n return (\n <DiContainerProvider container={scopedContainer} key={field.value}>\n <Bind name={name}>\n {bind => <RefInner bind={bind} modelIds={field.settings.modelIds} />}\n </Bind>\n </DiContainerProvider>\n );\n};\n\ninterface RefInnerProps {\n bind: BindComponentRenderProp;\n modelIds: string[];\n}\n\nconst RefInner = observer(({ bind, modelIds }: RefInnerProps) => {\n const { presenter } = useFeature(RefSingleAutocompletePresenterFeature);\n\n useEffect(() => {\n const value = parseValue(bind.value);\n presenter.init({\n modelIds,\n value: value ? { id: value.entryId, modelId: value.modelId } : null\n });\n }, []);\n\n const vm = presenter.vm;\n\n return (\n <AutoComplete\n label={\"Value\"}\n size={\"lg\"}\n loading={vm.loading}\n value={vm.value}\n options={vm.options}\n validation={bind.validation}\n shouldFilter={false}\n onValueSearch={query => presenter.search(query)}\n onValueChange={entryId => {\n if (!entryId) {\n presenter.clear();\n bind.onChange(\"\");\n return;\n }\n const ref = presenter.select(entryId);\n if (ref) {\n bind.onChange(JSON.stringify({ entryId, modelId: ref.modelId }));\n }\n }}\n onValueReset={() => {\n presenter.clear();\n bind.onChange(\"\");\n }}\n displayResetAction={vm.canReset}\n />\n );\n});\n"],"names":["useInputField","ContentEntryListConfig","parseValue","value","parsed","JSON","Ref","name","field","parentContainer","useContainer","scopedContainer","useMemo","child","RefSingleAutocompletePresenterFeature","DiContainerProvider","Bind","bind","RefInner","observer","modelIds","presenter","useFeature","useEffect","vm","AutoComplete","query","entryId","ref"],"mappings":";;;;;;;AASA,MAAM,EAAEA,aAAa,EAAE,GAAGC,uBAAuB,OAAO,CAAC,cAAc,CAAC,aAAa;AAarF,MAAMC,aAAa,CAACC;IAChB,IAAI,AAAiB,YAAjB,OAAOA,SAAsB,CAACA,OAC9B,OAAO;IAEX,IAAI;QACA,MAAMC,SAASC,KAAK,KAAK,CAACF;QAC1B,IAAI,CAACC,QAAQ,WAAW,CAACA,QAAQ,SAC7B,OAAO;QAEX,OAAO;YAAE,SAASA,OAAO,OAAO;YAAE,SAASA,OAAO,OAAO;QAAC;IAC9D,EAAE,OAAM;QACJ,OAAO;IACX;AACJ;AAEO,MAAME,MAAM;IACf,MAAM,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGR;IACxB,MAAMS,kBAAkBC;IAExB,MAAMC,kBAAkBC,QAAQ;QAC5B,MAAMC,QAAQJ,gBAAgB,oBAAoB;QAClDK,sCAAsC,QAAQ,CAACD;QAC/C,OAAOA;IACX,GAAG;QAACL,MAAM,KAAK;KAAC;IAEhB,OAAO,WAAP,GACI,oBAACO,qBAAmBA;QAAC,WAAWJ;QAAiB,KAAKH,MAAM,KAAK;qBAC7D,oBAACQ,MAAIA;QAAC,MAAMT;OACPU,CAAAA,OAAAA,WAAAA,GAAQ,oBAACC,UAAAA;YAAS,MAAMD;YAAM,UAAUT,MAAM,QAAQ,CAAC,QAAQ;;AAIhF;AAOA,MAAMU,WAAWC,SAAS,CAAC,EAAEF,IAAI,EAAEG,QAAQ,EAAiB;IACxD,MAAM,EAAEC,SAAS,EAAE,GAAGC,WAAWR;IAEjCS,UAAU;QACN,MAAMpB,QAAQD,WAAWe,KAAK,KAAK;QACnCI,UAAU,IAAI,CAAC;YACXD;YACA,OAAOjB,QAAQ;gBAAE,IAAIA,MAAM,OAAO;gBAAE,SAASA,MAAM,OAAO;YAAC,IAAI;QACnE;IACJ,GAAG,EAAE;IAEL,MAAMqB,KAAKH,UAAU,EAAE;IAEvB,OAAO,WAAP,GACI,oBAACI,cAAYA;QACT,OAAO;QACP,MAAM;QACN,SAASD,GAAG,OAAO;QACnB,OAAOA,GAAG,KAAK;QACf,SAASA,GAAG,OAAO;QACnB,YAAYP,KAAK,UAAU;QAC3B,cAAc;QACd,eAAeS,CAAAA,QAASL,UAAU,MAAM,CAACK;QACzC,eAAeC,CAAAA;YACX,IAAI,CAACA,SAAS;gBACVN,UAAU,KAAK;gBACfJ,KAAK,QAAQ,CAAC;gBACd;YACJ;YACA,MAAMW,MAAMP,UAAU,MAAM,CAACM;YAC7B,IAAIC,KACAX,KAAK,QAAQ,CAACZ,KAAK,SAAS,CAAC;gBAAEsB;gBAAS,SAASC,IAAI,OAAO;YAAC;QAErE;QACA,cAAc;YACVP,UAAU,KAAK;YACfJ,KAAK,QAAQ,CAAC;QAClB;QACA,oBAAoBO,GAAG,QAAQ;;AAG3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentEntries/Table/Cells/CellName.js","sources":["../../../../../../src/admin/components/ContentEntries/Table/Cells/CellName.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FolderDto } from \"@webiny/app-aco\";\n\nimport { Icon, Text } from \"@webiny/admin-ui\";\nimport { ReactComponent as Folder } from \"@webiny/icons/folder.svg\";\nimport { ReactComponent as FolderShared } from \"@webiny/icons/folder_shared.svg\";\nimport { ReactComponent as File } from \"@webiny/icons/description.svg\";\n\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries/index.js\";\nimport { usePermission } from \"~/admin/hooks/index.js\";\n\nimport type { CmsContentEntry } from \"~/types.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\ninterface FolderCellNameProps {\n folder: FolderDto;\n}\n\nexport const FolderCellName = ({ folder }: FolderCellNameProps) => {\n const presenter = useContentEntriesPresenter();\n\n let icon = <Folder />;\n if (folder.hasNonInheritedPermissions && folder.canManagePermissions) {\n icon = <FolderShared />;\n }\n\n return (\n <div\n className={\n \"flex items-center gap-sm truncate cursor-pointer font-semibold hover:underline\"\n }\n onClick={() => presenter.folders.selectFolder(folder.id)}\n >\n <Icon\n size={\"sm\"}\n color={\"neutral-strong\"}\n icon={icon}\n label={`Folder - ${folder.title}`}\n />\n <Text className={\"truncate min-w-0 shrink\"}>{folder.title}</Text>\n </div>\n );\n};\n\ninterface EntryCellRowTitleProps {\n entry: CmsContentEntry;\n}\n\nconst EntryCellRowTitle = ({ entry }: EntryCellRowTitleProps) => {\n return (\n <div className={\"flex items-center gap-sm truncate\"}>\n <Icon\n size={\"sm\"}\n color={\"neutral-strong\"}\n icon={<File />}\n label={`Entry - ${entry.meta.title}`}\n />\n <Text className={\"truncate min-w-0 shrink\"}>{entry.meta.title}</Text>\n </div>\n );\n};\n\ninterface EntryCellNameProps {\n entry: CmsContentEntry;\n}\n\nexport const EntryCellName = ({ entry }: EntryCellNameProps) => {\n const presenter = useContentEntriesPresenter();\n const { canEdit } = usePermission();\n\n if (!canEdit(entry, \"cms.contentEntry\")) {\n return <EntryCellRowTitle entry={entry} />;\n }\n\n return (\n <div\n className={\"truncate cursor-pointer hover:underline\"}\n onClick={() => presenter.selectEntry(entry.id)}\n >\n <EntryCellRowTitle entry={entry} />\n </div>\n );\n};\n\nexport const CellName = () => {\n const { useTableRow, isFolderRow } = ContentEntryListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n\n if (isFolderRow(row)) {\n return <FolderCellName folder={row.data} />;\n }\n\n return <EntryCellName entry={row.data} />;\n};\n"],"names":["FolderCellName","folder","presenter","useContentEntriesPresenter","icon","Folder","FolderShared","Icon","Text","EntryCellRowTitle","entry","File","EntryCellName","canEdit","usePermission","CellName","useTableRow","isFolderRow","ContentEntryListConfig","row"],"mappings":";;;;;;;;AAkBO,MAAMA,iBAAiB,CAAC,EAAEC,MAAM,EAAuB;IAC1D,MAAMC,YAAYC;IAElB,IAAIC,OAAO,WAAPA,GAAO,oBAACC,gBAAMA;IAClB,IAAIJ,OAAO,0BAA0B,IAAIA,OAAO,oBAAoB,EAChEG,OAAO,WAAPA,GAAO,oBAACE,kCAAYA;IAGxB,OAAO,WAAP,GACI,oBAAC;QACG,WACI;QAEJ,SAAS,IAAMJ,UAAU,OAAO,CAAC,YAAY,CAACD,OAAO,EAAE;qBAEvD,oBAACM,MAAIA;QACD,MAAM;QACN,OAAO;QACP,MAAMH;QACN,OAAO,CAAC,SAAS,EAAEH,OAAO,KAAK,EAAE;sBAErC,oBAACO,MAAIA;QAAC,WAAW;OAA4BP,OAAO,KAAK;AAGrE;AAMA,MAAMQ,oBAAoB,CAAC,EAAEC,KAAK,EAA0B,GACjD,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACH,MAAIA;QACD,MAAM;QACN,OAAO;QACP,oBAAM,oBAACI,gCAAIA;QACX,OAAO,CAAC,QAAQ,EAAED,MAAM,IAAI,CAAC,KAAK,EAAE;sBAExC,oBAACF,MAAIA;QAAC,WAAW;OAA4BE,MAAM,IAAI,CAAC,KAAK;AASlE,MAAME,gBAAgB,CAAC,EAAEF,KAAK,EAAsB;IACvD,MAAMR,YAAYC;IAClB,MAAM,EAAEU,OAAO,EAAE,GAAGC;IAEpB,IAAI,CAACD,QAAQH,OAAO,qBAChB,OAAO,WAAP,GAAO,oBAACD,
|
|
1
|
+
{"version":3,"file":"admin/components/ContentEntries/Table/Cells/CellName.js","sources":["../../../../../../src/admin/components/ContentEntries/Table/Cells/CellName.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FolderDto } from \"@webiny/app-aco\";\n\nimport { Icon, Text } from \"@webiny/admin-ui\";\nimport { ReactComponent as Folder } from \"@webiny/icons/folder.svg\";\nimport { ReactComponent as FolderShared } from \"@webiny/icons/folder_shared.svg\";\nimport { ReactComponent as File } from \"@webiny/icons/description.svg\";\n\nimport { ContentEntryListConfig } from \"~/admin/config/contentEntries/index.js\";\nimport { usePermission } from \"~/admin/hooks/index.js\";\n\nimport type { CmsContentEntry } from \"~/types.js\";\nimport { useContentEntriesPresenter } from \"~/presentation/contentEntries/list/useContentEntriesPresenter.js\";\n\ninterface FolderCellNameProps {\n folder: FolderDto;\n}\n\nexport const FolderCellName = ({ folder }: FolderCellNameProps) => {\n const presenter = useContentEntriesPresenter();\n\n let icon = <Folder />;\n if (folder.hasNonInheritedPermissions && folder.canManagePermissions) {\n icon = <FolderShared />;\n }\n\n return (\n <div\n className={\n \"flex items-center gap-sm truncate cursor-pointer font-semibold hover:underline\"\n }\n onClick={() => presenter.folders.selectFolder(folder.id)}\n >\n <Icon\n size={\"sm\"}\n color={\"neutral-strong\"}\n icon={icon}\n label={`Folder - ${folder.title}`}\n />\n <Text className={\"truncate min-w-0 shrink\"}>{folder.title}</Text>\n </div>\n );\n};\n\ninterface EntryCellRowTitleProps {\n entry: CmsContentEntry;\n}\n\nconst EntryCellRowTitle = ({ entry }: EntryCellRowTitleProps) => {\n return (\n <div className={\"flex items-center gap-sm truncate\"}>\n <Icon\n size={\"sm\"}\n color={\"neutral-strong\"}\n icon={<File />}\n label={`Entry - ${entry.meta.title}`}\n />\n <Text className={\"truncate min-w-0 shrink\"}>{entry.meta.title}</Text>\n </div>\n );\n};\n\ninterface EntryCellNameProps {\n entry: CmsContentEntry;\n}\n\nexport const EntryCellName = ({ entry }: EntryCellNameProps) => {\n const presenter = useContentEntriesPresenter();\n const { canEdit } = usePermission();\n\n if (!canEdit(entry, \"cms.contentEntry\")) {\n return <EntryCellRowTitle entry={entry} />;\n }\n\n return (\n <div\n className={\"truncate cursor-pointer hover:underline\"}\n onClick={() => presenter.selectEntry(entry.id)}\n >\n <EntryCellRowTitle entry={entry} />\n </div>\n );\n};\n\nexport const CellName = () => {\n const { useTableRow, isFolderRow } = ContentEntryListConfig.Browser.Table.Column;\n const { row } = useTableRow();\n\n if (isFolderRow(row)) {\n return <FolderCellName folder={row.data} />;\n }\n\n return <EntryCellName entry={row.data} />;\n};\n"],"names":["FolderCellName","folder","presenter","useContentEntriesPresenter","icon","Folder","FolderShared","Icon","Text","EntryCellRowTitle","entry","File","EntryCellName","canEdit","usePermission","CellName","useTableRow","isFolderRow","ContentEntryListConfig","row"],"mappings":";;;;;;;;AAkBO,MAAMA,iBAAiB,CAAC,EAAEC,MAAM,EAAuB;IAC1D,MAAMC,YAAYC;IAElB,IAAIC,OAAO,WAAPA,GAAO,oBAACC,gBAAMA;IAClB,IAAIJ,OAAO,0BAA0B,IAAIA,OAAO,oBAAoB,EAChEG,OAAO,WAAPA,GAAO,oBAACE,kCAAYA;IAGxB,OAAO,WAAP,GACI,oBAAC;QACG,WACI;QAEJ,SAAS,IAAMJ,UAAU,OAAO,CAAC,YAAY,CAACD,OAAO,EAAE;qBAEvD,oBAACM,MAAIA;QACD,MAAM;QACN,OAAO;QACP,MAAMH;QACN,OAAO,CAAC,SAAS,EAAEH,OAAO,KAAK,EAAE;sBAErC,oBAACO,MAAIA;QAAC,WAAW;OAA4BP,OAAO,KAAK;AAGrE;AAMA,MAAMQ,oBAAoB,CAAC,EAAEC,KAAK,EAA0B,GACjD,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACH,MAAIA;QACD,MAAM;QACN,OAAO;QACP,oBAAM,oBAACI,gCAAIA;QACX,OAAO,CAAC,QAAQ,EAAED,MAAM,IAAI,CAAC,KAAK,EAAE;sBAExC,oBAACF,MAAIA;QAAC,WAAW;OAA4BE,MAAM,IAAI,CAAC,KAAK;AASlE,MAAME,gBAAgB,CAAC,EAAEF,KAAK,EAAsB;IACvD,MAAMR,YAAYC;IAClB,MAAM,EAAEU,OAAO,EAAE,GAAGC;IAEpB,IAAI,CAACD,QAAQH,OAAO,qBAChB,OAAO,WAAP,GAAO,oBAACD,mBAAAA;QAAkB,OAAOC;;IAGrC,OAAO,WAAP,GACI,oBAAC;QACG,WAAW;QACX,SAAS,IAAMR,UAAU,WAAW,CAACQ,MAAM,EAAE;qBAE7C,oBAACD,mBAAAA;QAAkB,OAAOC;;AAGtC;AAEO,MAAMK,WAAW;IACpB,MAAM,EAAEC,WAAW,EAAEC,WAAW,EAAE,GAAGC,uBAAuB,OAAO,CAAC,KAAK,CAAC,MAAM;IAChF,MAAM,EAAEC,GAAG,EAAE,GAAGH;IAEhB,IAAIC,YAAYE,MACZ,OAAO,WAAP,GAAO,oBAACnB,gBAAAA;QAAe,QAAQmB,IAAI,IAAI;;IAG3C,OAAO,WAAP,GAAO,oBAACP,eAAAA;QAAc,OAAOO,IAAI,IAAI;;AACzC"}
|
|
@@ -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 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;YACI,OAAOF;IACf;AACJ;AAEA,MAAMI,YAAYC,cAAc;AAEhC,MAAMC,yBAAyB,CAACC,SACrBA,OAAO,GAAG,CAACC,CAAAA;QACd,MAAM,EAAEC,gBAAgB,EAAE,GAAGD;QAC7B,MAAM,EAAE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AI,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,WAA5BA,GAA4BC,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,MAAMI,YAAYC,cAAc;AAEhC,MAAMC,yBAAyB,CAACC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AwBF,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 +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 { 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,
|
|
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;Y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package/admin/components/ContentModelEditor/ModelIsBeingDeletedError/ModelIsBeingDeletedError.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentModelEditor/ModelIsBeingDeletedError/ModelIsBeingDeletedError.js","sources":["../../../../../src/admin/components/ContentModelEditor/ModelIsBeingDeletedError/ModelIsBeingDeletedError.tsx"],"sourcesContent":["import * as React from \"react\";\nimport Helmet from \"react-helmet\";\nimport { css } from \"@emotion/css\";\nimport styled from \"@emotion/styled\";\nimport { Text } from \"@webiny/admin-ui\";\nimport authErrorImg from \"./SecureRouteError.svg\";\nimport type { CmsModel } from \"@webiny/app-headless-cms-common/types/index.js\";\nimport { useRouter } from \"@webiny/app-admin\";\nimport { Routes } from \"~/routes.js\";\n\nconst ContentWrapper = styled(\"div\")({\n display: \"block\",\n paddingTop: \"15%\",\n textAlign: \"center\",\n margin: \"auto\"\n});\n\nconst styles = {\n authErrorImgStyle: css({\n width: \"192px\",\n paddingBottom: \"24px\"\n }),\n bodyStyle: css({\n color: \"var(--mdc-theme-text-primary-on-background)\",\n display: \"block\",\n \" strong\": {\n fontWeight: \"bold\"\n }\n }),\n linkStyle: css({\n cursor: \"pointer\",\n textDecoration: \"none\",\n \"&:hover\": {\n textDecoration: \"underline\"\n }\n })\n};\n\nexport interface ImageProps {\n className?: string;\n alt?: string;\n}\n\nconst Image = ({ className = styles.authErrorImgStyle, alt = \"Not Authorized\" }: ImageProps) => {\n return <img className={className} src={authErrorImg} alt={alt} />;\n};\n\nexport interface IModelIsBeingDeletedProps {\n model: Pick<CmsModel, \"name\">;\n}\n\nexport const ModelIsBeingDeletedError = (props: IModelIsBeingDeletedProps) => {\n const { goToRoute } = useRouter();\n\n const goBack = (): void => {\n goToRoute(Routes.ContentModels.List);\n };\n\n return (\n <ContentWrapper>\n <Helmet title={\"Cannot access the model!\"} />\n <Image />\n\n <Text size={\"md\"} className={styles.bodyStyle}>\n Model <strong>{props.model.name}</strong> is being deleted and cannot be accessed or\n changed.\n </Text>\n\n <p>\n <br />\n </p>\n\n <a onClick={goBack} className={styles.linkStyle}>\n Go back\n </a>\n </ContentWrapper>\n );\n};\n"],"names":["ContentWrapper","styled","styles","css","Image","className","alt","authErrorImg","ModelIsBeingDeletedError","props","goToRoute","useRouter","goBack","Routes","Helmet","Text"],"mappings":";;;;;;;;AAUA,MAAMA,iBAAiBC,OAAO,OAAO;IACjC,SAAS;IACT,YAAY;IACZ,WAAW;IACX,QAAQ;AACZ;AAEA,MAAMC,SAAS;IACX,mBAAmBC,IAAI;QACnB,OAAO;QACP,eAAe;IACnB;IACA,WAAWA,IAAI;QACX,OAAO;QACP,SAAS;QACT,WAAW;YACP,YAAY;QAChB;IACJ;IACA,WAAWA,IAAI;QACX,QAAQ;QACR,gBAAgB;QAChB,WAAW;YACP,gBAAgB;QACpB;IACJ;AACJ;AAOA,MAAMC,QAAQ,CAAC,EAAEC,YAAYH,OAAO,iBAAiB,EAAEI,MAAM,gBAAgB,EAAc,GAChF,WAAP,GAAO,sCAAC;QAAI,WAAWD;QAAW,KAAKE;QAAc,KAAKD;;AAOvD,MAAME,2BAA2B,CAACC;IACrC,MAAM,EAAEC,SAAS,EAAE,GAAGC;IAEtB,MAAMC,SAAS;QACXF,UAAUG,OAAO,aAAa,CAAC,IAAI;IACvC;IAEA,OAAO,WAAP,GACI,sCAACb,
|
|
1
|
+
{"version":3,"file":"admin/components/ContentModelEditor/ModelIsBeingDeletedError/ModelIsBeingDeletedError.js","sources":["../../../../../src/admin/components/ContentModelEditor/ModelIsBeingDeletedError/ModelIsBeingDeletedError.tsx"],"sourcesContent":["import * as React from \"react\";\nimport Helmet from \"react-helmet\";\nimport { css } from \"@emotion/css\";\nimport styled from \"@emotion/styled\";\nimport { Text } from \"@webiny/admin-ui\";\nimport authErrorImg from \"./SecureRouteError.svg\";\nimport type { CmsModel } from \"@webiny/app-headless-cms-common/types/index.js\";\nimport { useRouter } from \"@webiny/app-admin\";\nimport { Routes } from \"~/routes.js\";\n\nconst ContentWrapper = styled(\"div\")({\n display: \"block\",\n paddingTop: \"15%\",\n textAlign: \"center\",\n margin: \"auto\"\n});\n\nconst styles = {\n authErrorImgStyle: css({\n width: \"192px\",\n paddingBottom: \"24px\"\n }),\n bodyStyle: css({\n color: \"var(--mdc-theme-text-primary-on-background)\",\n display: \"block\",\n \" strong\": {\n fontWeight: \"bold\"\n }\n }),\n linkStyle: css({\n cursor: \"pointer\",\n textDecoration: \"none\",\n \"&:hover\": {\n textDecoration: \"underline\"\n }\n })\n};\n\nexport interface ImageProps {\n className?: string;\n alt?: string;\n}\n\nconst Image = ({ className = styles.authErrorImgStyle, alt = \"Not Authorized\" }: ImageProps) => {\n return <img className={className} src={authErrorImg} alt={alt} />;\n};\n\nexport interface IModelIsBeingDeletedProps {\n model: Pick<CmsModel, \"name\">;\n}\n\nexport const ModelIsBeingDeletedError = (props: IModelIsBeingDeletedProps) => {\n const { goToRoute } = useRouter();\n\n const goBack = (): void => {\n goToRoute(Routes.ContentModels.List);\n };\n\n return (\n <ContentWrapper>\n <Helmet title={\"Cannot access the model!\"} />\n <Image />\n\n <Text size={\"md\"} className={styles.bodyStyle}>\n Model <strong>{props.model.name}</strong> is being deleted and cannot be accessed or\n changed.\n </Text>\n\n <p>\n <br />\n </p>\n\n <a onClick={goBack} className={styles.linkStyle}>\n Go back\n </a>\n </ContentWrapper>\n );\n};\n"],"names":["ContentWrapper","styled","styles","css","Image","className","alt","authErrorImg","ModelIsBeingDeletedError","props","goToRoute","useRouter","goBack","Routes","Helmet","Text"],"mappings":";;;;;;;;AAUA,MAAMA,iBAAiBC,OAAO,OAAO;IACjC,SAAS;IACT,YAAY;IACZ,WAAW;IACX,QAAQ;AACZ;AAEA,MAAMC,SAAS;IACX,mBAAmBC,IAAI;QACnB,OAAO;QACP,eAAe;IACnB;IACA,WAAWA,IAAI;QACX,OAAO;QACP,SAAS;QACT,WAAW;YACP,YAAY;QAChB;IACJ;IACA,WAAWA,IAAI;QACX,QAAQ;QACR,gBAAgB;QAChB,WAAW;YACP,gBAAgB;QACpB;IACJ;AACJ;AAOA,MAAMC,QAAQ,CAAC,EAAEC,YAAYH,OAAO,iBAAiB,EAAEI,MAAM,gBAAgB,EAAc,GAChF,WAAP,GAAO,sCAAC;QAAI,WAAWD;QAAW,KAAKE;QAAc,KAAKD;;AAOvD,MAAME,2BAA2B,CAACC;IACrC,MAAM,EAAEC,SAAS,EAAE,GAAGC;IAEtB,MAAMC,SAAS;QACXF,UAAUG,OAAO,aAAa,CAAC,IAAI;IACvC;IAEA,OAAO,WAAP,GACI,sCAACb,gBAAAA,MAAAA,WAAAA,GACG,sCAACc,cAAMA;QAAC,OAAO;sBACf,sCAACV,OAAAA,OAAAA,WAAAA,GAED,sCAACW,MAAIA;QAAC,MAAM;QAAM,WAAWb,OAAO,SAAS;OAAE,wBACrC,sCAAC,gBAAQO,MAAM,KAAK,CAAC,IAAI,GAAU,uEAI7C,sCAAC,yBACG,sCAAC,4BAGL,sCAAC;QAAE,SAASG;QAAQ,WAAWV,OAAO,SAAS;OAAE;AAK7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/ContentModelEditor/PreviewTab.js","sources":["../../../../src/admin/components/ContentModelEditor/PreviewTab.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { DiContainerProvider, useContainer } from \"@webiny/app\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { FormView } from \"@webiny/app-admin/features/formModel/FormView.js\";\nimport { Button } from \"@webiny/admin-ui\";\nimport { useModelEditor } from \"~/admin/hooks/index.js\";\nimport { ContentModelFormPreviewFeature } from \"~/presentation/contentModelEditor/preview/feature.js\";\nimport { useContentModelFormPreview } from \"~/presentation/contentModelEditor/preview/useContentModelFormPreview.js\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/components/editor/tabs/preview\");\n\ninterface PreviewTabProps {\n activeTab: boolean;\n onSwitchToEdit?: () => void;\n}\n\nconst LayoutIllustration = () => (\n <svg width=\"90\" height=\"72\" viewBox=\"0 0 90 72\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect width=\"90\" height=\"72\" rx=\"4\" fill=\"white\" stroke=\"#DCE0E5\" strokeWidth=\"1\" />\n <rect width=\"90\" height=\"15\" rx=\"4\" fill=\"#F5F6F7\" />\n <rect y=\"11\" width=\"90\" height=\"4\" fill=\"#F5F6F7\" />\n <line x1=\"0\" y1=\"15\" x2=\"90\" y2=\"15\" stroke=\"#DCE0E5\" strokeWidth=\"1\" />\n <circle cx=\"9\" cy=\"7.5\" r=\"2.5\" fill=\"#FA5723\" />\n <circle cx=\"17\" cy=\"7.5\" r=\"2.5\" fill=\"#FA5723\" fillOpacity=\"0.5\" />\n <circle cx=\"25\" cy=\"7.5\" r=\"2.5\" fill=\"#FA5723\" fillOpacity=\"0.25\" />\n <rect x=\"8\" y=\"18\" width=\"23\" height=\"45\" rx=\"1.5\" fill=\"#F0F1F3\" />\n <rect x=\"36\" y=\"18\" width=\"45\" height=\"20\" rx=\"1.5\" fill=\"#F0F1F3\" />\n <rect x=\"36\" y=\"42\" width=\"21\" height=\"21\" rx=\"1.5\" fill=\"#F0F1F3\" />\n <rect x=\"61\" y=\"42\" width=\"20\" height=\"21\" rx=\"1.5\" fill=\"#F0F1F3\" />\n </svg>\n);\n\nexport const PreviewTab = ({ activeTab, onSwitchToEdit }: PreviewTabProps) => {\n const { data } = useModelEditor();\n const container = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = container.createChildContainer();\n ContentModelFormPreviewFeature.register(child);\n return child;\n }, []);\n\n if (data.fields && data.fields.length && activeTab) {\n return (\n <DiContainerProvider container={scopedContainer}>\n <PreviewForm />\n </DiContainerProvider>\n );\n }\n\n return (\n <div className={\"flex flex-col gap-md items-center justify-center pb-[216px] size-full\"}>\n <LayoutIllustration />\n <div className={\"flex flex-col gap-sm items-center text-center w-full\"}>\n <p className={\"text-lg font-semibold text-neutral-strong\"}>\n {t`Nothing to see here`}\n </p>\n <p className={\"text-sm text-neutral-strong max-w-[400px]\"}>\n {t`It looks like no field has been added to this content model yet. Switch to editor mode to add your first field.`}\n </p>\n </div>\n {onSwitchToEdit && (\n <Button variant={\"primary\"} size={\"sm\"} onClick={onSwitchToEdit}>\n {t`Switch to edit mode`}\n </Button>\n )}\n </div>\n );\n};\n\nconst PreviewForm = observer(() => {\n const { data } = useModelEditor();\n const presenter = useContentModelFormPreview();\n\n useEffect(() => {\n presenter.buildForm(data);\n\n return () => {\n presenter.reset();\n };\n }, [data]);\n\n const { form } = presenter.vm;\n\n if (!form) {\n return null;\n }\n\n return (\n <div className={\"bg-neutral-base rounded-lg p-lg\"}>\n <FormView name=\"ContentModelFormPreview\" form={form} />\n </div>\n );\n});\n"],"names":["t","i18n","LayoutIllustration","PreviewTab","activeTab","onSwitchToEdit","data","useModelEditor","container","useContainer","scopedContainer","useMemo","child","ContentModelFormPreviewFeature","DiContainerProvider","PreviewForm","Button","observer","presenter","useContentModelFormPreview","useEffect","form","FormView"],"mappings":";;;;;;;;;AAUA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAOlB,MAAMC,qBAAqB,kBACvB,oBAAC;QAAI,OAAM;QAAK,QAAO;QAAK,SAAQ;QAAY,MAAK;QAAO,OAAM;qBAC9D,oBAAC;QAAK,OAAM;QAAK,QAAO;QAAK,IAAG;QAAI,MAAK;QAAQ,QAAO;QAAU,aAAY;sBAC9E,oBAAC;QAAK,OAAM;QAAK,QAAO;QAAK,IAAG;QAAI,MAAK;sBACzC,oBAAC;QAAK,GAAE;QAAK,OAAM;QAAK,QAAO;QAAI,MAAK;sBACxC,oBAAC;QAAK,IAAG;QAAI,IAAG;QAAK,IAAG;QAAK,IAAG;QAAK,QAAO;QAAU,aAAY;sBAClE,oBAAC;QAAO,IAAG;QAAI,IAAG;QAAM,GAAE;QAAM,MAAK;sBACrC,oBAAC;QAAO,IAAG;QAAK,IAAG;QAAM,GAAE;QAAM,MAAK;QAAU,aAAY;sBAC5D,oBAAC;QAAO,IAAG;QAAK,IAAG;QAAM,GAAE;QAAM,MAAK;QAAU,aAAY;sBAC5D,oBAAC;QAAK,GAAE;QAAI,GAAE;QAAK,OAAM;QAAK,QAAO;QAAK,IAAG;QAAM,MAAK;sBACxD,oBAAC;QAAK,GAAE;QAAK,GAAE;QAAK,OAAM;QAAK,QAAO;QAAK,IAAG;QAAM,MAAK;sBACzD,oBAAC;QAAK,GAAE;QAAK,GAAE;QAAK,OAAM;QAAK,QAAO;QAAK,IAAG;QAAM,MAAK;sBACzD,oBAAC;QAAK,GAAE;QAAK,GAAE;QAAK,OAAM;QAAK,QAAO;QAAK,IAAG;QAAM,MAAK;;AAI1D,MAAMC,aAAa,CAAC,EAAEC,SAAS,EAAEC,cAAc,EAAmB;IACrE,MAAM,EAAEC,IAAI,EAAE,GAAGC;IACjB,MAAMC,YAAYC;IAElB,MAAMC,kBAAkBC,QAAQ;QAC5B,MAAMC,QAAQJ,UAAU,oBAAoB;QAC5CK,+BAA+B,QAAQ,CAACD;QACxC,OAAOA;IACX,GAAG,EAAE;IAEL,IAAIN,KAAK,MAAM,IAAIA,KAAK,MAAM,CAAC,MAAM,IAAIF,WACrC,OAAO,WAAP,GACI,oBAACU,qBAAmBA;QAAC,WAAWJ;qBAC5B,oBAACK,
|
|
1
|
+
{"version":3,"file":"admin/components/ContentModelEditor/PreviewTab.js","sources":["../../../../src/admin/components/ContentModelEditor/PreviewTab.tsx"],"sourcesContent":["import React, { useEffect, useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { DiContainerProvider, useContainer } from \"@webiny/app\";\nimport { i18n } from \"@webiny/app/i18n/index.js\";\nimport { FormView } from \"@webiny/app-admin/features/formModel/FormView.js\";\nimport { Button } from \"@webiny/admin-ui\";\nimport { useModelEditor } from \"~/admin/hooks/index.js\";\nimport { ContentModelFormPreviewFeature } from \"~/presentation/contentModelEditor/preview/feature.js\";\nimport { useContentModelFormPreview } from \"~/presentation/contentModelEditor/preview/useContentModelFormPreview.js\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/components/editor/tabs/preview\");\n\ninterface PreviewTabProps {\n activeTab: boolean;\n onSwitchToEdit?: () => void;\n}\n\nconst LayoutIllustration = () => (\n <svg width=\"90\" height=\"72\" viewBox=\"0 0 90 72\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect width=\"90\" height=\"72\" rx=\"4\" fill=\"white\" stroke=\"#DCE0E5\" strokeWidth=\"1\" />\n <rect width=\"90\" height=\"15\" rx=\"4\" fill=\"#F5F6F7\" />\n <rect y=\"11\" width=\"90\" height=\"4\" fill=\"#F5F6F7\" />\n <line x1=\"0\" y1=\"15\" x2=\"90\" y2=\"15\" stroke=\"#DCE0E5\" strokeWidth=\"1\" />\n <circle cx=\"9\" cy=\"7.5\" r=\"2.5\" fill=\"#FA5723\" />\n <circle cx=\"17\" cy=\"7.5\" r=\"2.5\" fill=\"#FA5723\" fillOpacity=\"0.5\" />\n <circle cx=\"25\" cy=\"7.5\" r=\"2.5\" fill=\"#FA5723\" fillOpacity=\"0.25\" />\n <rect x=\"8\" y=\"18\" width=\"23\" height=\"45\" rx=\"1.5\" fill=\"#F0F1F3\" />\n <rect x=\"36\" y=\"18\" width=\"45\" height=\"20\" rx=\"1.5\" fill=\"#F0F1F3\" />\n <rect x=\"36\" y=\"42\" width=\"21\" height=\"21\" rx=\"1.5\" fill=\"#F0F1F3\" />\n <rect x=\"61\" y=\"42\" width=\"20\" height=\"21\" rx=\"1.5\" fill=\"#F0F1F3\" />\n </svg>\n);\n\nexport const PreviewTab = ({ activeTab, onSwitchToEdit }: PreviewTabProps) => {\n const { data } = useModelEditor();\n const container = useContainer();\n\n const scopedContainer = useMemo(() => {\n const child = container.createChildContainer();\n ContentModelFormPreviewFeature.register(child);\n return child;\n }, []);\n\n if (data.fields && data.fields.length && activeTab) {\n return (\n <DiContainerProvider container={scopedContainer}>\n <PreviewForm />\n </DiContainerProvider>\n );\n }\n\n return (\n <div className={\"flex flex-col gap-md items-center justify-center pb-[216px] size-full\"}>\n <LayoutIllustration />\n <div className={\"flex flex-col gap-sm items-center text-center w-full\"}>\n <p className={\"text-lg font-semibold text-neutral-strong\"}>\n {t`Nothing to see here`}\n </p>\n <p className={\"text-sm text-neutral-strong max-w-[400px]\"}>\n {t`It looks like no field has been added to this content model yet. Switch to editor mode to add your first field.`}\n </p>\n </div>\n {onSwitchToEdit && (\n <Button variant={\"primary\"} size={\"sm\"} onClick={onSwitchToEdit}>\n {t`Switch to edit mode`}\n </Button>\n )}\n </div>\n );\n};\n\nconst PreviewForm = observer(() => {\n const { data } = useModelEditor();\n const presenter = useContentModelFormPreview();\n\n useEffect(() => {\n presenter.buildForm(data);\n\n return () => {\n presenter.reset();\n };\n }, [data]);\n\n const { form } = presenter.vm;\n\n if (!form) {\n return null;\n }\n\n return (\n <div className={\"bg-neutral-base rounded-lg p-lg\"}>\n <FormView name=\"ContentModelFormPreview\" form={form} />\n </div>\n );\n});\n"],"names":["t","i18n","LayoutIllustration","PreviewTab","activeTab","onSwitchToEdit","data","useModelEditor","container","useContainer","scopedContainer","useMemo","child","ContentModelFormPreviewFeature","DiContainerProvider","PreviewForm","Button","observer","presenter","useContentModelFormPreview","useEffect","form","FormView"],"mappings":";;;;;;;;;AAUA,MAAMA,IAAIC,KAAK,EAAE,CAAC;AAOlB,MAAMC,qBAAqB,kBACvB,oBAAC;QAAI,OAAM;QAAK,QAAO;QAAK,SAAQ;QAAY,MAAK;QAAO,OAAM;qBAC9D,oBAAC;QAAK,OAAM;QAAK,QAAO;QAAK,IAAG;QAAI,MAAK;QAAQ,QAAO;QAAU,aAAY;sBAC9E,oBAAC;QAAK,OAAM;QAAK,QAAO;QAAK,IAAG;QAAI,MAAK;sBACzC,oBAAC;QAAK,GAAE;QAAK,OAAM;QAAK,QAAO;QAAI,MAAK;sBACxC,oBAAC;QAAK,IAAG;QAAI,IAAG;QAAK,IAAG;QAAK,IAAG;QAAK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MA;QAAC,SAAS;QAAW,MAAM;QAAM,SAASX;OAC5CL,CAAC,CAAC,mBAAmB,CAAC;AAK3C;AAEA,MAAMe,cAAcE,SAAS;IACzB,MAAM,EAAEX,IAAI,EAAE,GAAGC;IACjB,MAAMW,YAAYC;IAElBC,UAAU;QACNF,UAAU,SAAS,CAACZ;QAEpB,OAAO;YACHY,UAAU,KAAK;QACnB;IACJ,GAAG;QAACZ;KAAK;IAET,MAAM,EAAEe,IAAI,EAAE,GAAGH,UAAU,EAAE;IAE7B,IAAI,CAACG,MACD,OAAO;IAGX,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACC,UAAQA;QAAC,MAAK;QAA0B,MAAMD;;AAG3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/Draggable.js","sources":["../../../src/admin/components/Draggable.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport React from \"react\";\nimport type { ConnectDragSource } from \"react-dnd\";\nimport { useDrag, DragPreviewImage } from \"react-dnd\";\n\nconst emptyImage = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n\ninterface DraggableChildrenFunctionParams {\n isDragging: boolean;\n drag: ConnectDragSource;\n}\nexport interface DraggableChildrenFunction {\n (params: DraggableChildrenFunctionParams): ReactElement;\n}\n\nexport interface DraggableProps {\n children: DraggableChildrenFunction;\n beginDrag?: any;\n endDrag?: any;\n target?: string[];\n}\n\nconst Draggable = (props: DraggableProps) => {\n const { children, beginDrag, endDrag } = props;\n\n const [{ isDragging }, drag, preview] = useDrag({\n type: \"element\",\n item(monitor) {\n if (typeof beginDrag === \"function\") {\n return beginDrag(props, monitor);\n }\n return beginDrag;\n },\n collect: monitor => ({\n isDragging: monitor.isDragging()\n }),\n end(item, monitor) {\n if (typeof endDrag === \"function\") {\n return endDrag(item, monitor);\n }\n return endDrag;\n }\n });\n\n return (\n <>\n <DragPreviewImage connect={preview} src={emptyImage} />\n {children({ isDragging, drag })}\n </>\n );\n};\n\nconst MemoizedDraggable: React.ComponentType<DraggableProps> = React.memo(Draggable);\nexport default MemoizedDraggable;\n"],"names":["emptyImage","Draggable","props","children","beginDrag","endDrag","isDragging","drag","preview","useDrag","monitor","item","DragPreviewImage","MemoizedDraggable","React"],"mappings":";;AAKA,MAAMA,aAAa;AAiBnB,MAAMC,YAAY,CAACC;IACf,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,OAAO,EAAE,GAAGH;IAEzC,MAAM,CAAC,EAAEI,UAAU,EAAE,EAAEC,MAAMC,QAAQ,GAAGC,QAAQ;QAC5C,MAAM;QACN,MAAKC,OAAO;YACR,IAAI,AAAqB,cAArB,OAAON,WACP,OAAOA,UAAUF,OAAOQ;YAE5B,OAAON;QACX;QACA,SAASM,CAAAA,UAAY;gBACjB,YAAYA,QAAQ,UAAU;YAClC;QACA,KAAIC,IAAI,EAAED,OAAO;YACb,IAAI,AAAmB,cAAnB,OAAOL,SACP,OAAOA,QAAQM,MAAMD;YAEzB,OAAOL;QACX;IACJ;IAEA,OAAO,WAAP,GACI,wDACI,oBAACO,kBAAgBA;QAAC,SAASJ;QAAS,KAAKR;QACxCG,SAAS;QAAEG;QAAYC;IAAK;AAGzC;AAEA,MAAMM,
|
|
1
|
+
{"version":3,"file":"admin/components/Draggable.js","sources":["../../../src/admin/components/Draggable.tsx"],"sourcesContent":["import type { ReactElement } from \"react\";\nimport React from \"react\";\nimport type { ConnectDragSource } from \"react-dnd\";\nimport { useDrag, DragPreviewImage } from \"react-dnd\";\n\nconst emptyImage = \"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==\";\n\ninterface DraggableChildrenFunctionParams {\n isDragging: boolean;\n drag: ConnectDragSource;\n}\nexport interface DraggableChildrenFunction {\n (params: DraggableChildrenFunctionParams): ReactElement;\n}\n\nexport interface DraggableProps {\n children: DraggableChildrenFunction;\n beginDrag?: any;\n endDrag?: any;\n target?: string[];\n}\n\nconst Draggable = (props: DraggableProps) => {\n const { children, beginDrag, endDrag } = props;\n\n const [{ isDragging }, drag, preview] = useDrag({\n type: \"element\",\n item(monitor) {\n if (typeof beginDrag === \"function\") {\n return beginDrag(props, monitor);\n }\n return beginDrag;\n },\n collect: monitor => ({\n isDragging: monitor.isDragging()\n }),\n end(item, monitor) {\n if (typeof endDrag === \"function\") {\n return endDrag(item, monitor);\n }\n return endDrag;\n }\n });\n\n return (\n <>\n <DragPreviewImage connect={preview} src={emptyImage} />\n {children({ isDragging, drag })}\n </>\n );\n};\n\nconst MemoizedDraggable: React.ComponentType<DraggableProps> = React.memo(Draggable);\nexport default MemoizedDraggable;\n"],"names":["emptyImage","Draggable","props","children","beginDrag","endDrag","isDragging","drag","preview","useDrag","monitor","item","DragPreviewImage","MemoizedDraggable","React"],"mappings":";;AAKA,MAAMA,aAAa;AAiBnB,MAAMC,YAAY,CAACC;IACf,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,OAAO,EAAE,GAAGH;IAEzC,MAAM,CAAC,EAAEI,UAAU,EAAE,EAAEC,MAAMC,QAAQ,GAAGC,QAAQ;QAC5C,MAAM;QACN,MAAKC,OAAO;YACR,IAAI,AAAqB,cAArB,OAAON,WACP,OAAOA,UAAUF,OAAOQ;YAE5B,OAAON;QACX;QACA,SAASM,CAAAA,UAAY;gBACjB,YAAYA,QAAQ,UAAU;YAClC;QACA,KAAIC,IAAI,EAAED,OAAO;YACb,IAAI,AAAmB,cAAnB,OAAOL,SACP,OAAOA,QAAQM,MAAMD;YAEzB,OAAOL;QACX;IACJ;IAEA,OAAO,WAAP,GACI,wDACI,oBAACO,kBAAgBA;QAAC,SAASJ;QAAS,KAAKR;QACxCG,SAAS;QAAEG;QAAYC;IAAK;AAGzC;AAEA,MAAMM,oBAAAA,WAAAA,GAAyDC,MAAAA,IAAU,CAACb;AAC1E,6BAAeY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/Droppable.js","sources":["../../../src/admin/components/Droppable.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { ConnectDropTarget } from \"react-dnd\";\nimport { useDrop } from \"react-dnd\";\nimport type { DragSource } from \"~/types.js\";\nimport { dropZoneOverState } from \"./dropZoneOverState.js\";\n\nexport interface DroppableChildrenFunctionParams {\n isDragging: boolean;\n isDroppable: boolean;\n isOver: boolean;\n item: any;\n drop: ConnectDropTarget;\n}\nexport interface DroppableChildrenFunction {\n (params: DroppableChildrenFunctionParams): React.ReactElement;\n}\n\ninterface IsVisibleParams {\n type: DragSource[\"type\"];\n item: DragSource;\n isDragging: boolean;\n}\nexport interface IsVisibleCallable {\n (params: IsVisibleParams): boolean;\n}\nexport interface OnDropCallable {\n (item: DragSource): void;\n}\nexport interface DroppableProps {\n type?: string;\n children: DroppableChildrenFunction;\n isDragging?: boolean;\n isDroppable?: (item: DragSource) => boolean;\n isVisible?: IsVisibleCallable;\n onDrop?: OnDropCallable;\n}\n\nexport type DragObject = {\n item: IsVisibleParams;\n isOver: boolean;\n};\n\nconst DroppableComponent = (props: DroppableProps) => {\n const { children, onDrop, isVisible = () => true } = props;\n\n const [{ item, isOver }, drop] = useDrop<DragSource, void, DragObject>({\n accept: \"element\",\n collect: monitor => ({\n isOver: monitor.isOver() && monitor.isOver({ shallow: true }),\n item: monitor.getItem()\n }),\n drop(item, monitor) {\n if (typeof props.isDroppable === \"function\" && !props.isDroppable(item)) {\n return;\n }\n\n if (typeof onDrop === \"function\") {\n return onDrop(monitor.getItem());\n }\n }\n });\n\n const prevIsOverRef = React.useRef(false);\n React.useEffect(() => {\n if (isOver === prevIsOverRef.current) {\n return;\n }\n dropZoneOverState.notify(isOver);\n prevIsOverRef.current = isOver;\n return () => {\n if (prevIsOverRef.current) {\n dropZoneOverState.notify(false);\n prevIsOverRef.current = false;\n }\n };\n }, [isOver]);\n\n if (item && !isVisible(item)) {\n return null;\n }\n\n let isDroppable = true;\n if (item) {\n isDroppable = props.isDroppable ? props.isDroppable(item) : isOver;\n }\n\n return children({ isDragging: Boolean(item), isOver, isDroppable, item, drop });\n};\n\nexport const Droppable: React.ComponentType<DroppableProps> = React.memo(DroppableComponent);\n"],"names":["DroppableComponent","props","children","onDrop","isVisible","item","isOver","drop","useDrop","monitor","prevIsOverRef","React","dropZoneOverState","isDroppable","Boolean","Droppable"],"mappings":";;;AA0CA,MAAMA,qBAAqB,CAACC;IACxB,MAAM,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,YAAY,IAAM,IAAI,EAAE,GAAGH;IAErD,MAAM,CAAC,EAAEI,IAAI,EAAEC,MAAM,EAAE,EAAEC,KAAK,GAAGC,QAAsC;QACnE,QAAQ;QACR,SAASC,CAAAA,UAAY;gBACjB,QAAQA,QAAQ,MAAM,MAAMA,QAAQ,MAAM,CAAC;oBAAE,SAAS;gBAAK;gBAC3D,MAAMA,QAAQ,OAAO;YACzB;QACA,MAAKJ,IAAI,EAAEI,OAAO;YACd,IAAI,AAA6B,cAA7B,OAAOR,MAAM,WAAW,IAAmB,CAACA,MAAM,WAAW,CAACI,OAC9D;YAGJ,IAAI,AAAkB,cAAlB,OAAOF,QACP,OAAOA,OAAOM,QAAQ,OAAO;QAErC;IACJ;IAEA,MAAMC,gBAAgBC,wBAAAA,MAAY,CAAC;IACnCA,wBAAAA,SAAe,CAAC;QACZ,IAAIL,WAAWI,cAAc,OAAO,EAChC;QAEJE,kBAAkB,MAAM,CAACN;QACzBI,cAAc,OAAO,GAAGJ;QACxB,OAAO;YACH,IAAII,cAAc,OAAO,EAAE;gBACvBE,kBAAkB,MAAM,CAAC;gBACzBF,cAAc,OAAO,GAAG;YAC5B;QACJ;IACJ,GAAG;QAACJ;KAAO;IAEX,IAAID,QAAQ,CAACD,UAAUC,OACnB,OAAO;IAGX,IAAIQ,cAAc;IAClB,IAAIR,MACAQ,cAAcZ,MAAM,WAAW,GAAGA,MAAM,WAAW,CAACI,QAAQC;IAGhE,OAAOJ,SAAS;QAAE,YAAYY,QAAQT;QAAOC;QAAQO;QAAaR;QAAME;IAAK;AACjF;AAEO,MAAMQ,
|
|
1
|
+
{"version":3,"file":"admin/components/Droppable.js","sources":["../../../src/admin/components/Droppable.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { ConnectDropTarget } from \"react-dnd\";\nimport { useDrop } from \"react-dnd\";\nimport type { DragSource } from \"~/types.js\";\nimport { dropZoneOverState } from \"./dropZoneOverState.js\";\n\nexport interface DroppableChildrenFunctionParams {\n isDragging: boolean;\n isDroppable: boolean;\n isOver: boolean;\n item: any;\n drop: ConnectDropTarget;\n}\nexport interface DroppableChildrenFunction {\n (params: DroppableChildrenFunctionParams): React.ReactElement;\n}\n\ninterface IsVisibleParams {\n type: DragSource[\"type\"];\n item: DragSource;\n isDragging: boolean;\n}\nexport interface IsVisibleCallable {\n (params: IsVisibleParams): boolean;\n}\nexport interface OnDropCallable {\n (item: DragSource): void;\n}\nexport interface DroppableProps {\n type?: string;\n children: DroppableChildrenFunction;\n isDragging?: boolean;\n isDroppable?: (item: DragSource) => boolean;\n isVisible?: IsVisibleCallable;\n onDrop?: OnDropCallable;\n}\n\nexport type DragObject = {\n item: IsVisibleParams;\n isOver: boolean;\n};\n\nconst DroppableComponent = (props: DroppableProps) => {\n const { children, onDrop, isVisible = () => true } = props;\n\n const [{ item, isOver }, drop] = useDrop<DragSource, void, DragObject>({\n accept: \"element\",\n collect: monitor => ({\n isOver: monitor.isOver() && monitor.isOver({ shallow: true }),\n item: monitor.getItem()\n }),\n drop(item, monitor) {\n if (typeof props.isDroppable === \"function\" && !props.isDroppable(item)) {\n return;\n }\n\n if (typeof onDrop === \"function\") {\n return onDrop(monitor.getItem());\n }\n }\n });\n\n const prevIsOverRef = React.useRef(false);\n React.useEffect(() => {\n if (isOver === prevIsOverRef.current) {\n return;\n }\n dropZoneOverState.notify(isOver);\n prevIsOverRef.current = isOver;\n return () => {\n if (prevIsOverRef.current) {\n dropZoneOverState.notify(false);\n prevIsOverRef.current = false;\n }\n };\n }, [isOver]);\n\n if (item && !isVisible(item)) {\n return null;\n }\n\n let isDroppable = true;\n if (item) {\n isDroppable = props.isDroppable ? props.isDroppable(item) : isOver;\n }\n\n return children({ isDragging: Boolean(item), isOver, isDroppable, item, drop });\n};\n\nexport const Droppable: React.ComponentType<DroppableProps> = React.memo(DroppableComponent);\n"],"names":["DroppableComponent","props","children","onDrop","isVisible","item","isOver","drop","useDrop","monitor","prevIsOverRef","React","dropZoneOverState","isDroppable","Boolean","Droppable"],"mappings":";;;AA0CA,MAAMA,qBAAqB,CAACC;IACxB,MAAM,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,YAAY,IAAM,IAAI,EAAE,GAAGH;IAErD,MAAM,CAAC,EAAEI,IAAI,EAAEC,MAAM,EAAE,EAAEC,KAAK,GAAGC,QAAsC;QACnE,QAAQ;QACR,SAASC,CAAAA,UAAY;gBACjB,QAAQA,QAAQ,MAAM,MAAMA,QAAQ,MAAM,CAAC;oBAAE,SAAS;gBAAK;gBAC3D,MAAMA,QAAQ,OAAO;YACzB;QACA,MAAKJ,IAAI,EAAEI,OAAO;YACd,IAAI,AAA6B,cAA7B,OAAOR,MAAM,WAAW,IAAmB,CAACA,MAAM,WAAW,CAACI,OAC9D;YAGJ,IAAI,AAAkB,cAAlB,OAAOF,QACP,OAAOA,OAAOM,QAAQ,OAAO;QAErC;IACJ;IAEA,MAAMC,gBAAgBC,wBAAAA,MAAY,CAAC;IACnCA,wBAAAA,SAAe,CAAC;QACZ,IAAIL,WAAWI,cAAc,OAAO,EAChC;QAEJE,kBAAkB,MAAM,CAACN;QACzBI,cAAc,OAAO,GAAGJ;QACxB,OAAO;YACH,IAAII,cAAc,OAAO,EAAE;gBACvBE,kBAAkB,MAAM,CAAC;gBACzBF,cAAc,OAAO,GAAG;YAC5B;QACJ;IACJ,GAAG;QAACJ;KAAO;IAEX,IAAID,QAAQ,CAACD,UAAUC,OACnB,OAAO;IAGX,IAAIQ,cAAc;IAClB,IAAIR,MACAQ,cAAcZ,MAAM,WAAW,GAAGA,MAAM,WAAW,CAACI,QAAQC;IAGhE,OAAOJ,SAAS;QAAE,YAAYY,QAAQT;QAAOC;QAAQO;QAAaR;QAAME;IAAK;AACjF;AAEO,MAAMQ,YAAAA,WAAAA,GAAiDJ,wBAAAA,IAAU,CAACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin/components/FieldEditor/EditFieldDialog/PermissionsEditor/FieldPermissionsSelection.js","sources":["../../../../../../src/admin/components/FieldEditor/EditFieldDialog/PermissionsEditor/FieldPermissionsSelection.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { ReactComponent as More } from \"@webiny/icons/arrow_drop_down.svg\";\nimport { Button, DropdownMenu, List, Text, Avatar } from \"@webiny/admin-ui\";\nimport type { FolderLevelPermissionsTarget } from \"@webiny/app-aco\";\nimport type { FieldRule } from \"~/types.js\";\n\nconst FIELD_ACCESS_LEVELS = [\n {\n id: \"hide\",\n label: \"No Access\",\n description: \"Hide this field from the user.\"\n },\n {\n id: \"disable\",\n label: \"Viewer (Read-only)\",\n description: \"Allow the user to read, but not edit, this field.\"\n }\n];\n\ninterface FieldPermissionsSelectionProps {\n targetsList: FolderLevelPermissionsTarget[];\n rules: FieldRule[];\n onRemoveAccess: (params: { rule: FieldRule }) => void;\n onUpdatePermission: (params: { rule: FieldRule }) => void;\n}\n\ntype Selection = Array<{ rule: FieldRule; target: FolderLevelPermissionsTarget }>;\n\ninterface ListItemGraphicProps {\n target: FolderLevelPermissionsTarget;\n}\n\nconst ListItemGraphic = ({ target }: ListItemGraphicProps) => {\n if (target.type === \"admin\") {\n return (\n <Avatar\n size={\"md\"}\n image={<Avatar.Image src={target.meta.image} alt={\"User's avatar.\"} />}\n fallback={<Avatar.Fallback delayMs={0}>{target.name.charAt(0)}</Avatar.Fallback>}\n />\n );\n }\n\n return (\n <Avatar\n size={\"md\"}\n fallback={<Avatar.Fallback delayMs={0}>{target.name.charAt(0)}</Avatar.Fallback>}\n />\n );\n};\n\ninterface ListItemTextProps {\n target: FolderLevelPermissionsTarget;\n}\n\nconst ListItemText = ({ target }: ListItemTextProps) => {\n if (target.type === \"admin\") {\n return (\n <div>\n <Text as=\"div\">{target.name}</Text>\n <Text as={\"div\"} size={\"sm\"} className={\"text-neutral-strong font-normal\"}>\n {target.meta.email || \"E-mail not available.\"}\n </Text>\n </div>\n );\n }\n\n return <>{target.name}</>;\n};\n\ninterface ListItemMetaProps {\n rule: FieldRule;\n onRemoveAccess: (params: { rule: FieldRule }) => void;\n onUpdatePermission: (params: { rule: FieldRule }) => void;\n}\n\nconst ListItemMeta = ({ rule, onRemoveAccess, onUpdatePermission }: ListItemMetaProps) => {\n const currentLevel = useMemo(() => {\n return FIELD_ACCESS_LEVELS.find(level => level.id === rule.action)!;\n }, [rule.action]);\n\n const handle = (\n <Button variant={\"ghost\"} text={currentLevel.label} icon={<More />} iconPosition={\"end\"} />\n );\n\n return (\n <DropdownMenu trigger={handle}>\n {FIELD_ACCESS_LEVELS.map(level => (\n <DropdownMenu.CheckboxItem\n key={level.id}\n checked={currentLevel.id === level.id}\n text={\n <div>\n <Text as={\"div\"}>{level.label}</Text>\n <Text as={\"div\"} size={\"sm\"} className={\"text-neutral-strong\"}>\n {level.description}\n </Text>\n </div>\n }\n onClick={() => {\n setTimeout(() => {\n onUpdatePermission({\n rule: {\n ...rule,\n action: level.id\n }\n });\n }, 75);\n }}\n />\n ))}\n <DropdownMenu.Separator />\n <DropdownMenu.Item\n onClick={() => onRemoveAccess({ rule })}\n text={\"Remove permission\"}\n />\n </DropdownMenu>\n );\n};\n\nexport const FieldPermissionsSelection = ({\n rules = [],\n targetsList,\n onRemoveAccess,\n onUpdatePermission\n}: FieldPermissionsSelectionProps) => {\n const selection = rules\n .map(rule => {\n const target = targetsList.find(u => u.target === String(rule.value));\n if (target) {\n return { rule, target };\n }\n\n return null;\n })\n .filter(Boolean) as Selection;\n\n const hasRules = selection.length > 0;\n\n return (\n <>\n {hasRules ? (\n <Text as={\"div\"} className={\"mb-md\"}>\n People and teams with access\n </Text>\n ) : null}\n <List>\n {selection?.map(item => (\n <List.Item\n key={String(item.rule.value)}\n title={<ListItemText target={item.target} />}\n icon={<ListItemGraphic target={item.target} />}\n actions={\n <ListItemMeta\n rule={item.rule}\n onRemoveAccess={onRemoveAccess}\n onUpdatePermission={onUpdatePermission}\n />\n }\n />\n ))}\n </List>\n </>\n );\n};\n"],"names":["FIELD_ACCESS_LEVELS","ListItemGraphic","target","Avatar","ListItemText","Text","ListItemMeta","rule","onRemoveAccess","onUpdatePermission","currentLevel","useMemo","level","handle","Button","More","DropdownMenu","setTimeout","FieldPermissionsSelection","rules","targetsList","selection","u","String","Boolean","hasRules","List","item"],"mappings":";;;AAMA,MAAMA,sBAAsB;IACxB;QACI,IAAI;QACJ,OAAO;QACP,aAAa;IACjB;IACA;QACI,IAAI;QACJ,OAAO;QACP,aAAa;IACjB;CACH;AAeD,MAAMC,kBAAkB,CAAC,EAAEC,MAAM,EAAwB;IACrD,IAAIA,AAAgB,YAAhBA,OAAO,IAAI,EACX,OAAO,WAAP,GACI,oBAACC,QAAMA;QACH,MAAM;QACN,qBAAO,oBAACA,OAAO,KAAK;YAAC,KAAKD,OAAO,IAAI,CAAC,KAAK;YAAE,KAAK;;QAClD,wBAAU,oBAACC,OAAO,QAAQ;YAAC,SAAS;WAAID,OAAO,IAAI,CAAC,MAAM,CAAC;;IAKvE,OAAO,WAAP,GACI,oBAACC,QAAMA;QACH,MAAM;QACN,wBAAU,oBAACA,OAAO,QAAQ;YAAC,SAAS;WAAID,OAAO,IAAI,CAAC,MAAM,CAAC;;AAGvE;AAMA,MAAME,eAAe,CAAC,EAAEF,MAAM,EAAqB;IAC/C,IAAIA,AAAgB,YAAhBA,OAAO,IAAI,EACX,OAAO,WAAP,GACI,oBAAC,2BACG,oBAACG,MAAIA;QAAC,IAAG;OAAOH,OAAO,IAAI,iBAC3B,oBAACG,MAAIA;QAAC,IAAI;QAAO,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KC,OAAOhB,KAAK,KAAK;QACnE,IAAIL,QACA,OAAO;YAAEK;YAAML;QAAO;QAG1B,OAAO;IACX,GACC,MAAM,CAACsB;IAEZ,MAAMC,WAAWJ,UAAU,MAAM,GAAG;IAEpC,OAAO,WAAP,GACI,0CACKI,WAAW,WAAXA,GACG,oBAACpB,MAAIA;QAAC,IAAI;QAAO,WAAW;OAAS,kCAGrC,oBACJ,oBAACqB,MAAIA,MACAL,WAAW,IAAIM,CAAAA,OAAAA,WAAAA,GACZ,oBAACD,KAAK,IAAI;YACN,KAAKH,OAAOI,KAAK,IAAI,CAAC,KAAK;YAC3B,qBAAO,oBAACvB,
|
|
1
|
+
{"version":3,"file":"admin/components/FieldEditor/EditFieldDialog/PermissionsEditor/FieldPermissionsSelection.js","sources":["../../../../../../src/admin/components/FieldEditor/EditFieldDialog/PermissionsEditor/FieldPermissionsSelection.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { ReactComponent as More } from \"@webiny/icons/arrow_drop_down.svg\";\nimport { Button, DropdownMenu, List, Text, Avatar } from \"@webiny/admin-ui\";\nimport type { FolderLevelPermissionsTarget } from \"@webiny/app-aco\";\nimport type { FieldRule } from \"~/types.js\";\n\nconst FIELD_ACCESS_LEVELS = [\n {\n id: \"hide\",\n label: \"No Access\",\n description: \"Hide this field from the user.\"\n },\n {\n id: \"disable\",\n label: \"Viewer (Read-only)\",\n description: \"Allow the user to read, but not edit, this field.\"\n }\n];\n\ninterface FieldPermissionsSelectionProps {\n targetsList: FolderLevelPermissionsTarget[];\n rules: FieldRule[];\n onRemoveAccess: (params: { rule: FieldRule }) => void;\n onUpdatePermission: (params: { rule: FieldRule }) => void;\n}\n\ntype Selection = Array<{ rule: FieldRule; target: FolderLevelPermissionsTarget }>;\n\ninterface ListItemGraphicProps {\n target: FolderLevelPermissionsTarget;\n}\n\nconst ListItemGraphic = ({ target }: ListItemGraphicProps) => {\n if (target.type === \"admin\") {\n return (\n <Avatar\n size={\"md\"}\n image={<Avatar.Image src={target.meta.image} alt={\"User's avatar.\"} />}\n fallback={<Avatar.Fallback delayMs={0}>{target.name.charAt(0)}</Avatar.Fallback>}\n />\n );\n }\n\n return (\n <Avatar\n size={\"md\"}\n fallback={<Avatar.Fallback delayMs={0}>{target.name.charAt(0)}</Avatar.Fallback>}\n />\n );\n};\n\ninterface ListItemTextProps {\n target: FolderLevelPermissionsTarget;\n}\n\nconst ListItemText = ({ target }: ListItemTextProps) => {\n if (target.type === \"admin\") {\n return (\n <div>\n <Text as=\"div\">{target.name}</Text>\n <Text as={\"div\"} size={\"sm\"} className={\"text-neutral-strong font-normal\"}>\n {target.meta.email || \"E-mail not available.\"}\n </Text>\n </div>\n );\n }\n\n return <>{target.name}</>;\n};\n\ninterface ListItemMetaProps {\n rule: FieldRule;\n onRemoveAccess: (params: { rule: FieldRule }) => void;\n onUpdatePermission: (params: { rule: FieldRule }) => void;\n}\n\nconst ListItemMeta = ({ rule, onRemoveAccess, onUpdatePermission }: ListItemMetaProps) => {\n const currentLevel = useMemo(() => {\n return FIELD_ACCESS_LEVELS.find(level => level.id === rule.action)!;\n }, [rule.action]);\n\n const handle = (\n <Button variant={\"ghost\"} text={currentLevel.label} icon={<More />} iconPosition={\"end\"} />\n );\n\n return (\n <DropdownMenu trigger={handle}>\n {FIELD_ACCESS_LEVELS.map(level => (\n <DropdownMenu.CheckboxItem\n key={level.id}\n checked={currentLevel.id === level.id}\n text={\n <div>\n <Text as={\"div\"}>{level.label}</Text>\n <Text as={\"div\"} size={\"sm\"} className={\"text-neutral-strong\"}>\n {level.description}\n </Text>\n </div>\n }\n onClick={() => {\n setTimeout(() => {\n onUpdatePermission({\n rule: {\n ...rule,\n action: level.id\n }\n });\n }, 75);\n }}\n />\n ))}\n <DropdownMenu.Separator />\n <DropdownMenu.Item\n onClick={() => onRemoveAccess({ rule })}\n text={\"Remove permission\"}\n />\n </DropdownMenu>\n );\n};\n\nexport const FieldPermissionsSelection = ({\n rules = [],\n targetsList,\n onRemoveAccess,\n onUpdatePermission\n}: FieldPermissionsSelectionProps) => {\n const selection = rules\n .map(rule => {\n const target = targetsList.find(u => u.target === String(rule.value));\n if (target) {\n return { rule, target };\n }\n\n return null;\n })\n .filter(Boolean) as Selection;\n\n const hasRules = selection.length > 0;\n\n return (\n <>\n {hasRules ? (\n <Text as={\"div\"} className={\"mb-md\"}>\n People and teams with access\n </Text>\n ) : null}\n <List>\n {selection?.map(item => (\n <List.Item\n key={String(item.rule.value)}\n title={<ListItemText target={item.target} />}\n icon={<ListItemGraphic target={item.target} />}\n actions={\n <ListItemMeta\n rule={item.rule}\n onRemoveAccess={onRemoveAccess}\n onUpdatePermission={onUpdatePermission}\n />\n }\n />\n ))}\n </List>\n </>\n );\n};\n"],"names":["FIELD_ACCESS_LEVELS","ListItemGraphic","target","Avatar","ListItemText","Text","ListItemMeta","rule","onRemoveAccess","onUpdatePermission","currentLevel","useMemo","level","handle","Button","More","DropdownMenu","setTimeout","FieldPermissionsSelection","rules","targetsList","selection","u","String","Boolean","hasRules","List","item"],"mappings":";;;AAMA,MAAMA,sBAAsB;IACxB;QACI,IAAI;QACJ,OAAO;QACP,aAAa;IACjB;IACA;QACI,IAAI;QACJ,OAAO;QACP,aAAa;IACjB;CACH;AAeD,MAAMC,kBAAkB,CAAC,EAAEC,MAAM,EAAwB;IACrD,IAAIA,AAAgB,YAAhBA,OAAO,IAAI,EACX,OAAO,WAAP,GACI,oBAACC,QAAMA;QACH,MAAM;QACN,qBAAO,oBAACA,OAAO,KAAK;YAAC,KAAKD,OAAO,IAAI,CAAC,KAAK;YAAE,KAAK;;QAClD,wBAAU,oBAACC,OAAO,QAAQ;YAAC,SAAS;WAAID,OAAO,IAAI,CAAC,MAAM,CAAC;;IAKvE,OAAO,WAAP,GACI,oBAACC,QAAMA;QACH,MAAM;QACN,wBAAU,oBAACA,OAAO,QAAQ;YAAC,SAAS;WAAID,OAAO,IAAI,CAAC,MAAM,CAAC;;AAGvE;AAMA,MAAME,eAAe,CAAC,EA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