@webiny/app-headless-cms 5.36.2 → 5.37.0-beta.1
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/HeadlessCMS.js +3 -2
- package/HeadlessCMS.js.map +1 -1
- package/admin/components/ContentEntries/Empty/index.d.ts +9 -0
- package/admin/components/ContentEntries/Empty/index.js +42 -0
- package/admin/components/ContentEntries/Empty/index.js.map +1 -0
- package/admin/components/ContentEntries/Empty/styled.d.ts +14 -0
- package/admin/components/ContentEntries/Empty/styled.js +19 -0
- package/admin/components/ContentEntries/Empty/styled.js.map +1 -0
- package/admin/components/ContentEntries/Filters/FilterByStatus.d.ts +2 -0
- package/admin/components/ContentEntries/Filters/FilterByStatus.js +54 -0
- package/admin/components/ContentEntries/Filters/FilterByStatus.js.map +1 -0
- package/admin/components/ContentEntries/Filters/Filters.d.ts +2 -0
- package/admin/components/ContentEntries/Filters/Filters.js +32 -0
- package/admin/components/ContentEntries/Filters/Filters.js.map +1 -0
- package/admin/components/ContentEntries/Filters/index.d.ts +2 -0
- package/admin/components/ContentEntries/Filters/index.js +27 -0
- package/admin/components/ContentEntries/Filters/index.js.map +1 -0
- package/admin/components/ContentEntries/Filters/styles.d.ts +15 -0
- package/admin/components/ContentEntries/Filters/styles.js +23 -0
- package/admin/components/ContentEntries/Filters/styles.js.map +1 -0
- package/admin/components/ContentEntries/Header/ButtonFilters/ButtonFilters.d.ts +2 -0
- package/admin/components/ContentEntries/Header/ButtonFilters/ButtonFilters.js +41 -0
- package/admin/components/ContentEntries/Header/ButtonFilters/ButtonFilters.js.map +1 -0
- package/admin/components/ContentEntries/Header/ButtonFilters/index.d.ts +1 -0
- package/admin/components/ContentEntries/Header/ButtonFilters/index.js +16 -0
- package/admin/components/ContentEntries/Header/ButtonFilters/index.js.map +1 -0
- package/admin/components/ContentEntries/Header/ButtonsCreate/ButtonsCreate.d.ts +7 -0
- package/admin/components/ContentEntries/Header/ButtonsCreate/ButtonsCreate.js +34 -0
- package/admin/components/ContentEntries/Header/ButtonsCreate/ButtonsCreate.js.map +1 -0
- package/admin/components/ContentEntries/Header/ButtonsCreate/index.d.ts +1 -0
- package/admin/components/ContentEntries/Header/ButtonsCreate/index.js +16 -0
- package/admin/components/ContentEntries/Header/ButtonsCreate/index.js.map +1 -0
- package/admin/components/ContentEntries/Header/ButtonsCreate/styled.d.ts +7 -0
- package/admin/components/ContentEntries/Header/ButtonsCreate/styled.js +13 -0
- package/admin/components/ContentEntries/Header/ButtonsCreate/styled.js.map +1 -0
- package/admin/components/ContentEntries/Header/Header.d.ts +11 -0
- package/admin/components/ContentEntries/Header/Header.js +41 -0
- package/admin/components/ContentEntries/Header/Header.js.map +1 -0
- package/admin/components/ContentEntries/Header/Title/Title.d.ts +6 -0
- package/admin/components/ContentEntries/Header/Title/Title.js +20 -0
- package/admin/components/ContentEntries/Header/Title/Title.js.map +1 -0
- package/admin/components/ContentEntries/Header/Title/index.d.ts +1 -0
- package/admin/components/ContentEntries/Header/Title/index.js +16 -0
- package/admin/components/ContentEntries/Header/Title/index.js.map +1 -0
- package/admin/components/ContentEntries/Header/Title/styled.d.ts +7 -0
- package/admin/components/ContentEntries/Header/Title/styled.js +14 -0
- package/admin/components/ContentEntries/Header/Title/styled.js.map +1 -0
- package/admin/components/ContentEntries/Header/index.d.ts +1 -0
- package/admin/components/ContentEntries/Header/index.js +16 -0
- package/admin/components/ContentEntries/Header/index.js.map +1 -0
- package/admin/components/ContentEntries/Header/styled.d.ts +11 -0
- package/admin/components/ContentEntries/Header/styled.js +18 -0
- package/admin/components/ContentEntries/Header/styled.js.map +1 -0
- package/admin/components/ContentEntries/LoadMoreButton/LoadMoreButton.d.ts +10 -0
- package/admin/components/ContentEntries/LoadMoreButton/LoadMoreButton.js +30 -0
- package/admin/components/ContentEntries/LoadMoreButton/LoadMoreButton.js.map +1 -0
- package/admin/components/ContentEntries/LoadMoreButton/index.d.ts +1 -0
- package/admin/components/ContentEntries/LoadMoreButton/index.js +16 -0
- package/admin/components/ContentEntries/LoadMoreButton/index.js.map +1 -0
- package/admin/components/ContentEntries/LoadMoreButton/styled.d.ts +7 -0
- package/admin/components/ContentEntries/LoadMoreButton/styled.js +13 -0
- package/admin/components/ContentEntries/LoadMoreButton/styled.js.map +1 -0
- package/admin/components/ContentEntries/LoadingMore/index.d.ts +2 -0
- package/admin/components/ContentEntries/LoadingMore/index.js +23 -0
- package/admin/components/ContentEntries/LoadingMore/index.js.map +1 -0
- package/admin/components/ContentEntries/LoadingMore/styled.d.ts +11 -0
- package/admin/components/ContentEntries/LoadingMore/styled.js +18 -0
- package/admin/components/ContentEntries/LoadingMore/styled.js.map +1 -0
- package/admin/components/ContentEntries/Table/Row/Folder/FolderActionDelete.d.ts +6 -0
- package/admin/components/ContentEntries/Table/Row/Folder/FolderActionDelete.js +25 -0
- package/admin/components/ContentEntries/Table/Row/Folder/FolderActionDelete.js.map +1 -0
- package/admin/components/ContentEntries/Table/Row/Folder/FolderActionEdit.d.ts +6 -0
- package/admin/components/ContentEntries/Table/Row/Folder/FolderActionEdit.js +25 -0
- package/admin/components/ContentEntries/Table/Row/Folder/FolderActionEdit.js.map +1 -0
- package/admin/components/ContentEntries/Table/Row/Name.d.ts +12 -0
- package/admin/components/ContentEntries/Table/Row/Name.js +49 -0
- package/admin/components/ContentEntries/Table/Row/Name.js.map +1 -0
- package/admin/components/ContentEntries/Table/Row/Record/RecordActionDelete.d.ts +7 -0
- package/admin/{views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.js → components/ContentEntries/Table/Row/Record/RecordActionDelete.js} +45 -72
- package/admin/components/ContentEntries/Table/Row/Record/RecordActionDelete.js.map +1 -0
- package/admin/components/ContentEntries/Table/Row/Record/RecordActionEdit.d.ts +11 -0
- package/admin/components/ContentEntries/Table/Row/Record/RecordActionEdit.js +30 -0
- package/admin/components/ContentEntries/Table/Row/Record/RecordActionEdit.js.map +1 -0
- package/admin/components/ContentEntries/Table/Row/Record/RecordActionMove.d.ts +6 -0
- package/admin/components/ContentEntries/Table/Row/Record/RecordActionMove.js +25 -0
- package/admin/components/ContentEntries/Table/Row/Record/RecordActionMove.js.map +1 -0
- package/admin/components/ContentEntries/Table/Row/Record/RecordActionPublish.d.ts +17 -0
- package/admin/components/ContentEntries/Table/Row/Record/RecordActionPublish.js +94 -0
- package/admin/components/ContentEntries/Table/Row/Record/RecordActionPublish.js.map +1 -0
- package/admin/components/ContentEntries/Table/index.d.ts +13 -0
- package/admin/components/ContentEntries/Table/index.js +235 -0
- package/admin/components/ContentEntries/Table/index.js.map +1 -0
- package/admin/components/ContentEntries/Table/styled.d.ts +4 -0
- package/admin/components/ContentEntries/Table/styled.js +17 -0
- package/admin/components/ContentEntries/Table/styled.js.map +1 -0
- package/admin/components/ContentEntries/Table/types.d.ts +24 -0
- package/admin/components/ContentEntries/Table/types.js.map +1 -0
- package/admin/components/ContentEntryForm/ContentEntryForm.js +2 -2
- package/admin/components/ContentEntryForm/ContentEntryForm.js.map +1 -1
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.js +2 -2
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.js.map +1 -1
- package/admin/components/ContentEntryForm/Fields.js +2 -2
- package/admin/components/ContentEntryForm/Fields.js.map +1 -1
- package/admin/components/ContentEntryForm/Header/ContentFormOptionsMenu/ContentFormOptionsMenu.d.ts +2 -0
- package/admin/components/ContentEntryForm/Header/ContentFormOptionsMenu/ContentFormOptionsMenu.js +20 -0
- package/admin/components/ContentEntryForm/Header/ContentFormOptionsMenu/ContentFormOptionsMenu.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/ContentFormOptionsMenu/ContentFormOptionsMenu.styles.d.ts +7 -0
- package/admin/components/ContentEntryForm/Header/ContentFormOptionsMenu/ContentFormOptionsMenu.styles.js +13 -0
- package/admin/components/ContentEntryForm/Header/ContentFormOptionsMenu/ContentFormOptionsMenu.styles.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/ContentFormOptionsMenu/index.d.ts +1 -0
- package/admin/components/ContentEntryForm/Header/ContentFormOptionsMenu/index.js +16 -0
- package/admin/components/ContentEntryForm/Header/ContentFormOptionsMenu/index.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/DeleteEntry/DeleteEntry.d.ts +2 -0
- package/admin/components/ContentEntryForm/Header/DeleteEntry/DeleteEntry.js +46 -0
- package/admin/components/ContentEntryForm/Header/DeleteEntry/DeleteEntry.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/DeleteEntry/index.d.ts +1 -0
- package/admin/components/ContentEntryForm/Header/DeleteEntry/index.js +16 -0
- package/admin/components/ContentEntryForm/Header/DeleteEntry/index.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/DeleteEntry/useDeleteEntry.d.ts +9 -0
- package/admin/components/ContentEntryForm/Header/DeleteEntry/useDeleteEntry.js +85 -0
- package/admin/components/ContentEntryForm/Header/DeleteEntry/useDeleteEntry.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/Header.d.ts +2 -0
- package/admin/{views/contentEntries/ContentEntry/header → components/ContentEntryForm/Header}/Header.js +13 -7
- package/admin/components/ContentEntryForm/Header/Header.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/RevisionSelector/RevisionSelector.d.ts +2 -0
- package/admin/{views/contentEntries/ContentEntry/header/revisionSelector → components/ContentEntryForm/Header/RevisionSelector}/RevisionSelector.js +14 -33
- package/admin/components/ContentEntryForm/Header/RevisionSelector/RevisionSelector.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/RevisionSelector/RevisionSelector.styles.d.ts +36 -0
- package/admin/components/ContentEntryForm/Header/RevisionSelector/RevisionSelector.styles.js +20 -0
- package/admin/components/ContentEntryForm/Header/RevisionSelector/RevisionSelector.styles.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/RevisionSelector/index.d.ts +1 -0
- package/admin/components/ContentEntryForm/Header/RevisionSelector/index.js +16 -0
- package/admin/components/ContentEntryForm/Header/RevisionSelector/index.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/SaveAndPublishContent/SaveAndPublishContent.js +35 -0
- package/admin/components/ContentEntryForm/Header/SaveAndPublishContent/SaveAndPublishContent.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/SaveAndPublishContent/index.d.ts +1 -0
- package/admin/components/ContentEntryForm/Header/SaveAndPublishContent/index.js +16 -0
- package/admin/components/ContentEntryForm/Header/SaveAndPublishContent/index.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/SaveAndPublishContent/useSaveAndPublish.d.ts +11 -0
- package/admin/components/ContentEntryForm/Header/SaveAndPublishContent/useSaveAndPublish.js +68 -0
- package/admin/components/ContentEntryForm/Header/SaveAndPublishContent/useSaveAndPublish.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/SaveContent/SaveContent.d.ts +2 -0
- package/admin/{views/contentEntries/ContentEntry/header/saveContent → components/ContentEntryForm/Header/SaveContent}/SaveContent.js +11 -13
- package/admin/components/ContentEntryForm/Header/SaveContent/SaveContent.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/SaveContent/index.d.ts +1 -0
- package/admin/components/ContentEntryForm/Header/SaveContent/index.js +16 -0
- package/admin/components/ContentEntryForm/Header/SaveContent/index.js.map +1 -0
- package/admin/components/ContentEntryForm/Header/index.d.ts +5 -0
- package/admin/components/ContentEntryForm/Header/index.js +60 -0
- package/admin/components/ContentEntryForm/Header/index.js.map +1 -0
- package/admin/components/ContentEntryForm/Label.js.map +1 -1
- package/admin/components/ContentEntryForm/RenderFieldElement.d.ts +2 -4
- package/admin/components/ContentEntryForm/RenderFieldElement.js +15 -5
- package/admin/components/ContentEntryForm/RenderFieldElement.js.map +1 -1
- package/admin/components/ContentEntryForm/functions/getValue.js.map +1 -1
- package/admin/components/ContentEntryForm/functions/setValue.js.map +1 -1
- package/admin/components/ContentEntryForm/useBind.js.map +1 -1
- package/admin/components/ContentEntryForm/useContentEntryForm.d.ts +2 -2
- package/admin/components/ContentEntryForm/useContentEntryForm.js +47 -29
- package/admin/components/ContentEntryForm/useContentEntryForm.js.map +1 -1
- package/admin/components/ContentEntryForm/useRenderPlugins.js.map +1 -1
- package/admin/components/ContentModelEditor/ContentModelEditorProvider.js.map +1 -1
- package/admin/components/ContentModelEditor/Editor.js.map +1 -1
- package/admin/components/ContentModelEditor/FieldsSidebar.js.map +1 -1
- package/admin/components/ContentModelEditor/Header.js.map +1 -1
- package/admin/components/ContentModelEditor/PreviewTab.js.map +1 -1
- package/admin/components/ContentModelEditor/index.js.map +1 -1
- package/admin/components/ContentModelEditor/useModelEditor.js.map +1 -1
- package/admin/components/DelayedOnChange.js +9 -0
- package/admin/components/DelayedOnChange.js.map +1 -1
- package/admin/components/Dialog.js.map +1 -1
- package/admin/components/DragPreview.js.map +1 -1
- package/admin/components/Draggable.js.map +1 -1
- package/admin/components/DropZone/Center.js.map +1 -1
- package/admin/components/DropZone/Horizontal.d.ts +1 -1
- package/admin/components/DropZone/Horizontal.js.map +1 -1
- package/admin/components/DropZone/Vertical.d.ts +1 -1
- package/admin/components/DropZone/Vertical.js.map +1 -1
- package/admin/components/DropZone/index.js.map +1 -1
- package/admin/components/Droppable.d.ts +1 -1
- package/admin/components/Droppable.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.js +16 -2
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.js +3 -3
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/ValidationsSection.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsList.js +5 -5
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsList.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/getValidators.js.map +1 -1
- package/admin/components/FieldEditor/EditFieldDialog.js +4 -1
- package/admin/components/FieldEditor/EditFieldDialog.js.map +1 -1
- package/admin/components/FieldEditor/Field.js.map +1 -1
- package/admin/components/FieldEditor/FieldEditor.js.map +1 -1
- package/admin/components/FieldEditor/FieldEditorContext.d.ts +2 -14
- package/admin/components/FieldEditor/FieldEditorContext.js +4 -0
- package/admin/components/FieldEditor/FieldEditorContext.js.map +1 -1
- package/admin/components/FieldEditor/Styled.js.map +1 -1
- package/admin/components/FieldEditor/index.js.map +1 -1
- package/admin/components/FieldEditor/useModelFieldEditor.js.map +1 -1
- package/admin/components/FieldEditor/utils/deleteField.js.map +1 -1
- package/admin/components/FieldEditor/utils/getFieldPosition.js.map +1 -1
- package/admin/components/FieldEditor/utils/index.js.map +1 -1
- package/admin/components/FieldEditor/utils/moveField.js.map +1 -1
- package/admin/components/FieldEditor/utils/moveRow.js.map +1 -1
- package/admin/components/IconPicker.js.map +1 -1
- package/admin/components/LexicalCmsEditor/LexicalCmsEditor.d.ts +3 -0
- package/admin/components/LexicalCmsEditor/LexicalCmsEditor.js +45 -0
- package/admin/components/LexicalCmsEditor/LexicalCmsEditor.js.map +1 -0
- package/admin/components/LexicalCmsEditor/LexicalEditorCmsPlugin.d.ts +2 -0
- package/admin/components/LexicalCmsEditor/LexicalEditorCmsPlugin.js +98 -0
- package/admin/components/LexicalCmsEditor/LexicalEditorCmsPlugin.js.map +1 -0
- package/admin/components/LexicalCmsEditor/TypographyDropDown.d.ts +2 -0
- package/admin/components/LexicalCmsEditor/TypographyDropDown.js +105 -0
- package/admin/components/LexicalCmsEditor/TypographyDropDown.js.map +1 -0
- package/admin/components/ModelFieldProvider/ModelFieldContext.d.ts +3 -13
- package/admin/components/ModelFieldProvider/ModelFieldContext.js.map +1 -1
- package/admin/components/ModelFieldProvider/index.js.map +1 -1
- package/admin/components/ModelFieldProvider/useModelField.d.ts +4 -13
- package/admin/components/ModelFieldProvider/useModelField.js.map +1 -1
- package/admin/components/ModelProvider/ModelContext.js.map +1 -1
- package/admin/components/ModelProvider/index.js.map +1 -1
- package/admin/components/ModelProvider/useModel.js.map +1 -1
- package/admin/config/contentEntries/editor/Actions/BaseAction.d.ts +16 -0
- package/admin/config/contentEntries/editor/Actions/BaseAction.js +52 -0
- package/admin/config/contentEntries/editor/Actions/BaseAction.js.map +1 -0
- package/admin/config/contentEntries/editor/Actions/ButtonAction.d.ts +8 -0
- package/admin/config/contentEntries/editor/Actions/ButtonAction.js +20 -0
- package/admin/config/contentEntries/editor/Actions/ButtonAction.js.map +1 -0
- package/admin/config/contentEntries/editor/Actions/MenuItemAction.d.ts +8 -0
- package/admin/config/contentEntries/editor/Actions/MenuItemAction.js +20 -0
- package/admin/config/contentEntries/editor/Actions/MenuItemAction.js.map +1 -0
- package/admin/config/contentEntries/editor/Actions/index.d.ts +13 -0
- package/admin/config/contentEntries/editor/Actions/index.js +13 -0
- package/admin/config/contentEntries/editor/Actions/index.js.map +1 -0
- package/admin/config/contentEntries/editor/ContentEntryEditorConfig.d.ts +18 -0
- package/admin/config/contentEntries/editor/ContentEntryEditorConfig.js +33 -0
- package/admin/config/contentEntries/editor/ContentEntryEditorConfig.js.map +1 -0
- package/admin/config/contentEntries/editor/index.d.ts +1 -0
- package/admin/config/contentEntries/editor/index.js +16 -0
- package/admin/config/contentEntries/editor/index.js.map +1 -0
- package/admin/config/contentEntries/index.d.ts +2 -0
- package/admin/config/contentEntries/index.js +27 -0
- package/admin/config/contentEntries/index.js.map +1 -0
- package/admin/config/contentEntries/list/Browser/Filter.d.ts +20 -0
- package/admin/config/contentEntries/list/Browser/Filter.js +66 -0
- package/admin/config/contentEntries/list/Browser/Filter.js.map +1 -0
- package/admin/config/contentEntries/list/Browser/FiltersToWhere.d.ts +9 -0
- package/admin/config/contentEntries/list/Browser/FiltersToWhere.js +29 -0
- package/admin/config/contentEntries/list/Browser/FiltersToWhere.js.map +1 -0
- package/admin/config/contentEntries/list/Browser/index.d.ts +13 -0
- package/admin/config/contentEntries/list/Browser/index.js +13 -0
- package/admin/config/contentEntries/list/Browser/index.js.map +1 -0
- package/admin/config/contentEntries/list/ContentEntryListConfig.d.ts +18 -0
- package/admin/config/contentEntries/list/ContentEntryListConfig.js +32 -0
- package/admin/config/contentEntries/list/ContentEntryListConfig.js.map +1 -0
- package/admin/config/contentEntries/list/index.d.ts +1 -0
- package/admin/config/contentEntries/list/index.js +16 -0
- package/admin/config/contentEntries/list/index.js.map +1 -0
- package/admin/constants/folders.d.ts +1 -0
- package/admin/constants/folders.js +8 -0
- package/admin/constants/folders.js.map +1 -0
- package/admin/constants/statusLabels.d.ts +6 -2
- package/admin/constants/statusLabels.js +2 -3
- package/admin/constants/statusLabels.js.map +1 -1
- package/admin/constants.d.ts +3 -0
- package/admin/constants.js +17 -0
- package/admin/constants.js.map +1 -0
- package/admin/contexts/Cms/NetworkError.js.map +1 -1
- package/admin/contexts/Cms/index.d.ts +7 -12
- package/admin/contexts/Cms/index.js.map +1 -1
- package/admin/elements/ContentGroupMenuElement.js.map +1 -1
- package/admin/elements/ContentModelMenuElement.js.map +1 -1
- package/admin/elements/NothingToShowElement.js.map +1 -1
- package/admin/graphql/contentModels.js.map +1 -1
- package/admin/graphql/createFieldsList.js +0 -2
- package/admin/graphql/createFieldsList.js.map +1 -1
- package/admin/hooks/index.js.map +1 -1
- package/admin/hooks/useApolloClient.js.map +1 -1
- package/admin/hooks/useCms.js.map +1 -1
- package/admin/hooks/useContentModels.d.ts +3 -0
- package/admin/hooks/useContentModels.js +4 -2
- package/admin/hooks/useContentModels.js.map +1 -1
- package/admin/hooks/useLazyQuery.js.map +1 -1
- package/admin/hooks/useMutation.js.map +1 -1
- package/admin/hooks/usePermission.d.ts +3 -2
- package/admin/hooks/usePermission.js +131 -63
- package/admin/hooks/usePermission.js.map +1 -1
- package/admin/hooks/useQuery.js.map +1 -1
- package/admin/hooks/useQueryLocale.js.map +1 -1
- package/admin/lexicalConfig/LexicalEditorConfig.d.ts +12 -0
- package/admin/lexicalConfig/LexicalEditorConfig.js +37 -0
- package/admin/lexicalConfig/LexicalEditorConfig.js.map +1 -0
- package/admin/menus/CmsMenuLoader.js.map +1 -1
- package/admin/menus/ContentGroupsMenuItems.js.map +1 -1
- package/admin/menus/GlobalSearchPlugins.js.map +1 -1
- package/admin/menus/NothingToShowElement.js.map +1 -1
- package/admin/plugins/apiInformation/index.js.map +1 -1
- package/admin/plugins/arrayUtils.js.map +1 -1
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.js +0 -3
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.js.map +1 -1
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.js +0 -2
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.js.map +1 -1
- package/admin/plugins/editor/defaultBar/BackButton.js.map +1 -1
- package/admin/plugins/editor/defaultBar/CreateContentButton.js.map +1 -1
- package/admin/plugins/editor/defaultBar/Divider.js.map +1 -1
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.js.map +1 -1
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.js.map +1 -1
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.js.map +1 -1
- package/admin/plugins/editor/defaultBar/FormSettings/index.js.map +1 -1
- package/admin/plugins/editor/defaultBar/Name/Name.js +4 -0
- package/admin/plugins/editor/defaultBar/Name/Name.js.map +1 -1
- package/admin/plugins/editor/defaultBar/Name/NameStyled.js.map +1 -1
- package/admin/plugins/editor/defaultBar/Name/index.js.map +1 -1
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.js.map +1 -1
- package/admin/plugins/editor/defaultBar/index.js.map +1 -1
- package/admin/plugins/editor/formSettings/components/GeneralSettings.js.map +1 -1
- package/admin/plugins/editor/formSettings/components/GroupSelect.js.map +1 -1
- package/admin/plugins/editor/formSettings/index.js.map +1 -1
- package/admin/plugins/entry/DefaultOnEntryDelete.js +15 -22
- package/admin/plugins/entry/DefaultOnEntryDelete.js.map +1 -1
- package/admin/plugins/entry/DefaultOnEntryPublish.js +2 -11
- package/admin/plugins/entry/DefaultOnEntryPublish.js.map +1 -1
- package/admin/plugins/fieldRenderers/Accordion.js.map +1 -1
- package/admin/plugins/fieldRenderers/DynamicSection.js.map +1 -1
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.js.map +1 -1
- package/admin/plugins/fieldRenderers/boolean/index.d.ts +1 -1
- package/admin/plugins/fieldRenderers/boolean/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/checkboxes.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/DateOnly.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js +2 -1
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/Input.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/Select.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/Time.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/index.d.ts +1 -1
- package/admin/plugins/fieldRenderers/dateTime/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/dateTime/utils.d.ts +0 -4
- package/admin/plugins/fieldRenderers/dateTime/utils.js +1 -120
- package/admin/plugins/fieldRenderers/dateTime/utils.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/AddTemplate.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/MultiValueDynamicZone.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/SingleValueDynamicZone.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateCard.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateGallery.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateIcon.js.map +1 -1
- package/admin/plugins/fieldRenderers/dynamicZone/dynamicZoneRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/file/File.js +7 -2
- package/admin/plugins/fieldRenderers/file/File.js.map +1 -1
- package/admin/plugins/fieldRenderers/file/fileField.js +44 -7
- package/admin/plugins/fieldRenderers/file/fileField.js.map +1 -1
- package/admin/plugins/fieldRenderers/file/fileFields.d.ts +2 -2
- package/admin/plugins/fieldRenderers/file/fileFields.js +27 -4
- package/admin/plugins/fieldRenderers/file/fileFields.js.map +1 -1
- package/admin/plugins/fieldRenderers/file/index.d.ts +1 -1
- package/admin/plugins/fieldRenderers/file/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/file/utils.js +1 -1
- package/admin/plugins/fieldRenderers/file/utils.js.map +1 -1
- package/admin/plugins/fieldRenderers/lexicalText/index.d.ts +1 -0
- package/admin/plugins/fieldRenderers/lexicalText/index.js +13 -0
- package/admin/plugins/fieldRenderers/lexicalText/index.js.map +1 -0
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInput.js +53 -0
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInput.js.map +1 -0
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInputs.js +74 -0
- package/admin/plugins/fieldRenderers/lexicalText/lexicalTextInputs.js.map +1 -0
- package/admin/plugins/fieldRenderers/lexicalText/utils.d.ts +2 -0
- package/admin/plugins/fieldRenderers/lexicalText/utils.js +12 -0
- package/admin/plugins/fieldRenderers/lexicalText/utils.js.map +1 -0
- package/admin/plugins/fieldRenderers/longText/index.d.ts +1 -1
- package/admin/plugins/fieldRenderers/longText/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/longText/longText.js.map +1 -1
- package/admin/plugins/fieldRenderers/longText/longTexts.js.map +1 -1
- package/admin/plugins/fieldRenderers/number/index.d.ts +1 -1
- package/admin/plugins/fieldRenderers/number/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/number/numberInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/number/numberInputs.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/StyledComponents.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/index.d.ts +1 -1
- package/admin/plugins/fieldRenderers/object/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/multipleObjects.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/multipleObjectsAccordion.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/singleObjectAccordion.js.map +1 -1
- package/admin/plugins/fieldRenderers/object/singleObjectInline.js.map +1 -1
- package/admin/plugins/fieldRenderers/radioButtons.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/AdvancedMultipleReferenceField.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/AdvancedSingleReferenceField.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/Entries.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/Entry.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/Loader.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/NewReferencedEntryDialog.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/Options.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/ReferencesDialog.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/Search.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/dialog/Dialog.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/dialog/DialogHeader.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Box.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/CreatedBy.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Description.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Image.js +6 -2
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Image.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/ModelName.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/ModifiedBy.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/MoveDown.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/MoveUp.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Remove.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Select.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Status.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/Title.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/View.js +3 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/View.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/entry/elements/ButtonLink.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/options/OptionsModelList.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/components/options/OptionsModelListItem.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/detailedReferenceRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/detailedReferencesRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/graphql.d.ts +3 -0
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/graphql.js +2 -2
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/graphql.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/useEntries.js +5 -1
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/useEntries.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/hooks/useReferences.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/index.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/advanced/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/EntryStatus.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/MissingEntryHelpText.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/NewRefEntryFormDialog.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/createEntryUrl.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/graphql.js +5 -0
- package/admin/plugins/fieldRenderers/ref/components/graphql.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/helpers.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/renderItem.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/types.d.ts +3 -0
- package/admin/plugins/fieldRenderers/ref/components/types.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/useReference.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/components/useReferences.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntry.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntryDialog.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/index.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/refInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/refInputs.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/components/SimpleItems.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/components/SimpleMultipleRenderer.js +0 -2
- package/admin/plugins/fieldRenderers/ref/simple/components/SimpleMultipleRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/components/SimpleSingleRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/components/useContentModels.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/components/useReferences.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/index.d.ts +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/simpleMultipleRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/ref/simple/simpleSingleRenderer.js.map +1 -1
- package/admin/plugins/fieldRenderers/richText/index.d.ts +1 -2
- package/admin/plugins/fieldRenderers/richText/index.js +5 -3
- package/admin/plugins/fieldRenderers/richText/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/richText/richTextInput.js +22 -4
- package/admin/plugins/fieldRenderers/richText/richTextInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js +22 -4
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js.map +1 -1
- package/admin/plugins/fieldRenderers/richText/utils.d.ts +4 -0
- package/admin/plugins/fieldRenderers/richText/utils.js +18 -0
- package/admin/plugins/fieldRenderers/richText/utils.js.map +1 -0
- package/admin/plugins/fieldRenderers/select.js.map +1 -1
- package/admin/plugins/fieldRenderers/text/index.d.ts +1 -1
- package/admin/plugins/fieldRenderers/text/index.js.map +1 -1
- package/admin/plugins/fieldRenderers/text/textInput.js.map +1 -1
- package/admin/plugins/fieldRenderers/text/textInputs.js.map +1 -1
- package/admin/plugins/fieldValidators/date/availableValidators.js.map +1 -1
- package/admin/plugins/fieldValidators/date/createDateInputField.js.map +1 -1
- package/admin/plugins/fieldValidators/dateGte.js.map +1 -1
- package/admin/plugins/fieldValidators/dateLte.js.map +1 -1
- package/admin/plugins/fieldValidators/dynamicZone.js.map +1 -1
- package/admin/plugins/fieldValidators/gte.js.map +1 -1
- package/admin/plugins/fieldValidators/in.js.map +1 -1
- package/admin/plugins/fieldValidators/lte.js.map +1 -1
- package/admin/plugins/fieldValidators/maxLength.js.map +1 -1
- package/admin/plugins/fieldValidators/minLength.js.map +1 -1
- package/admin/plugins/fieldValidators/pattern.js.map +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/email.js.map +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.js.map +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.js.map +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.js.map +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.js.map +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/url.js.map +1 -1
- package/admin/plugins/fieldValidators/required.js.map +1 -1
- package/admin/plugins/fieldValidators/unique.js.map +1 -1
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.js.map +1 -1
- package/admin/plugins/fields/boolean.js.map +1 -1
- package/admin/plugins/fields/dateTime.js +2 -2
- package/admin/plugins/fields/dateTime.js.map +1 -1
- package/admin/plugins/fields/dynamicZone/AddTemplate.js.map +1 -1
- package/admin/plugins/fields/dynamicZone/DynamicZone.js.map +1 -1
- package/admin/plugins/fields/dynamicZone/DynamicZoneTemplate.js.map +1 -1
- package/admin/plugins/fields/dynamicZone/TemplateDialog.js.map +1 -1
- package/admin/plugins/fields/dynamicZone/commonValidators.js.map +1 -1
- package/admin/plugins/fields/dynamicZone.js.map +1 -1
- package/admin/plugins/fields/file.js.map +1 -1
- package/admin/plugins/fields/longText.js.map +1 -1
- package/admin/plugins/fields/number.js.map +1 -1
- package/admin/plugins/fields/object/ObjectFields.js.map +1 -1
- package/admin/plugins/fields/object.js.map +1 -1
- package/admin/plugins/fields/ref/graphql.js.map +1 -1
- package/admin/plugins/fields/ref/renderInfo.js.map +1 -1
- package/admin/plugins/fields/ref.js.map +1 -1
- package/admin/plugins/fields/richText.js.map +1 -1
- package/admin/plugins/fields/text.js.map +1 -1
- package/admin/plugins/getObjectId.js.map +1 -1
- package/admin/plugins/icons.js.map +1 -1
- package/admin/plugins/index.d.ts +8 -18
- package/admin/plugins/index.js +1 -2
- package/admin/plugins/index.js.map +1 -1
- package/admin/plugins/install.js +1 -1
- package/admin/plugins/install.js.map +1 -1
- package/admin/plugins/permissionRenderer/CmsPermissions.js +21 -1
- package/admin/plugins/permissionRenderer/CmsPermissions.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.d.ts +1 -0
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.js +5 -4
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.d.ts +1 -0
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.js +6 -3
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/ContentModelList.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.d.ts +1 -0
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.js +5 -3
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/PermissionSelector.d.ts +2 -0
- package/admin/plugins/permissionRenderer/components/PermissionSelector.js +7 -3
- package/admin/plugins/permissionRenderer/components/PermissionSelector.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/StyledComponents.js.map +1 -1
- package/admin/plugins/permissionRenderer/components/useCmsData.js +5 -0
- package/admin/plugins/permissionRenderer/components/useCmsData.js.map +1 -1
- package/admin/plugins/permissionRenderer/index.js.map +1 -1
- package/admin/plugins/routes.js +8 -3
- package/admin/plugins/routes.js.map +1 -1
- package/admin/plugins/transformers/dateTransformer.js.map +1 -1
- package/admin/plugins/transformers/dynamicZoneTransformer.js.map +1 -1
- package/admin/plugins/transformers/index.js.map +1 -1
- package/admin/plugins/transformers/numberTransformer.js.map +1 -1
- package/admin/plugins/welcomeScreenWidget.js.map +1 -1
- package/admin/views/contentEntries/ContentEntries.d.ts +1 -2
- package/admin/views/contentEntries/ContentEntries.js +5 -12
- package/admin/views/contentEntries/ContentEntries.js.map +1 -1
- package/admin/views/contentEntries/ContentEntriesContainer.d.ts +4 -2
- package/admin/views/contentEntries/ContentEntriesContainer.js +2 -2
- package/admin/views/contentEntries/ContentEntriesContainer.js.map +1 -1
- package/admin/views/contentEntries/ContentEntriesContext.d.ts +1 -15
- package/admin/views/contentEntries/ContentEntriesContext.js +1 -52
- package/admin/views/contentEntries/ContentEntriesContext.js.map +1 -1
- package/admin/views/contentEntries/ContentEntriesModule.js +29 -0
- package/admin/views/contentEntries/ContentEntriesModule.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.d.ts +4 -4
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js +28 -15
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/PublishEntryRevisionListItem.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.js +4 -0
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/RevisionsList.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/prepareFormData.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry/useRevision.d.ts +4 -2
- package/admin/views/contentEntries/ContentEntry/useRevision.js +15 -16
- package/admin/views/contentEntries/ContentEntry/useRevision.js.map +1 -1
- package/admin/views/contentEntries/ContentEntry.js +2 -2
- package/admin/views/contentEntries/ContentEntry.js.map +1 -1
- package/admin/views/contentEntries/Table/Main.d.ts +6 -0
- package/admin/views/contentEntries/Table/Main.js +130 -0
- package/admin/views/contentEntries/Table/Main.js.map +1 -0
- package/admin/views/contentEntries/Table/Sidebar.d.ts +6 -0
- package/admin/views/contentEntries/Table/Sidebar.js +63 -0
- package/admin/views/contentEntries/Table/Sidebar.js.map +1 -0
- package/admin/views/contentEntries/Table/index.d.ts +2 -0
- package/admin/views/contentEntries/Table/index.js +48 -0
- package/admin/views/contentEntries/Table/index.js.map +1 -0
- package/admin/views/contentEntries/Table/styled.d.ts +15 -0
- package/admin/views/contentEntries/Table/styled.js +23 -0
- package/admin/views/contentEntries/Table/styled.js.map +1 -0
- package/admin/views/contentEntries/hooks/index.js.map +1 -1
- package/admin/views/contentEntries/hooks/useContentEntries.js.map +1 -1
- package/admin/views/contentEntries/hooks/useContentEntriesList.d.ts +23 -18
- package/admin/views/contentEntries/hooks/useContentEntriesList.js +82 -116
- package/admin/views/contentEntries/hooks/useContentEntriesList.js.map +1 -1
- package/admin/views/contentEntries/hooks/useContentEntry.js.map +1 -1
- package/admin/views/contentModelGroups/ContentModelGroups.js.map +1 -1
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.js +5 -1
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.js.map +1 -1
- package/admin/views/contentModelGroups/ContentModelGroupsForm.js.map +1 -1
- package/admin/views/contentModelGroups/graphql.js +6 -0
- package/admin/views/contentModelGroups/graphql.js.map +1 -1
- package/admin/views/contentModels/CloneContentModelDialog.js.map +1 -1
- package/admin/views/contentModels/ContentModelEditor.js.map +1 -1
- package/admin/views/contentModels/ContentModels.js.map +1 -1
- package/admin/views/contentModels/ContentModelsDataList.js +13 -4
- package/admin/views/contentModels/ContentModelsDataList.js.map +1 -1
- package/admin/views/contentModels/NewContentModelDialog.js.map +1 -1
- package/admin/views/contentModels/cache.js.map +1 -1
- package/admin/views/contentModels/helpers/apiNameValidator.js.map +1 -1
- package/admin/views/contentModels/helpers/nameValidator.js.map +1 -1
- package/admin/views/utils.js.map +1 -1
- package/admin/viewsGraphql.js.map +1 -1
- package/allPlugins.d.ts +8 -18
- package/allPlugins.js +3 -2
- package/allPlugins.js.map +1 -1
- package/index.d.ts +13 -9
- package/index.js +58 -5
- package/index.js.map +1 -1
- package/package.json +30 -26
- package/types.d.ts +1 -0
- package/types.js +16 -0
- package/types.js.map +1 -0
- package/utils/CmsModelFieldValidatorConfigAdapter.d.ts +2 -2
- package/utils/CmsModelFieldValidatorConfigAdapter.js +0 -4
- package/utils/CmsModelFieldValidatorConfigAdapter.js.map +1 -1
- package/utils/acoRecordTransform.d.ts +7 -0
- package/utils/acoRecordTransform.js +46 -0
- package/utils/acoRecordTransform.js.map +1 -0
- package/utils/allowCmsLegacyRichTextInput.d.ts +1 -0
- package/utils/allowCmsLegacyRichTextInput.js +10 -0
- package/utils/allowCmsLegacyRichTextInput.js.map +1 -0
- package/utils/createTypeName.js.map +1 -1
- package/utils/createValidators.js.map +1 -1
- package/utils/getFetchPolicy.js.map +1 -1
- package/utils/getModelTitleFieldId.js.map +1 -1
- package/admin/graphql/contentEntries.d.ts +0 -146
- package/admin/graphql/contentEntries.js +0 -112
- package/admin/graphql/contentEntries.js.map +0 -1
- package/admin/views/contentEntries/ContentEntriesList.d.ts +0 -3
- package/admin/views/contentEntries/ContentEntriesList.js +0 -199
- package/admin/views/contentEntries/ContentEntriesList.js.map +0 -1
- package/admin/views/contentEntries/ContentEntry/cache.d.ts +0 -9
- package/admin/views/contentEntries/ContentEntry/cache.js +0 -198
- package/admin/views/contentEntries/ContentEntry/cache.js.map +0 -1
- package/admin/views/contentEntries/ContentEntry/header/Header.d.ts +0 -3
- package/admin/views/contentEntries/ContentEntry/header/Header.js.map +0 -1
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.d.ts +0 -3
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.js.map +0 -1
- package/admin/views/contentEntries/ContentEntry/header/index.d.ts +0 -3
- package/admin/views/contentEntries/ContentEntry/header/index.js +0 -40
- package/admin/views/contentEntries/ContentEntry/header/index.js.map +0 -1
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.d.ts +0 -3
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.js.map +0 -1
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.js +0 -80
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.js.map +0 -1
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.d.ts +0 -3
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.js.map +0 -1
- package/admin/views/contentEntries/experiment/ContentEntriesModule.js +0 -68
- package/admin/views/contentEntries/experiment/ContentEntriesModule.js.map +0 -1
- package/admin/views/contentEntries/experiment/ContentEntriesRenderer.d.ts +0 -2
- package/admin/views/contentEntries/experiment/ContentEntriesRenderer.js +0 -24
- package/admin/views/contentEntries/experiment/ContentEntriesRenderer.js.map +0 -1
- package/admin/views/contentEntries/experiment/ContentEntriesViewConfig.d.ts +0 -37
- package/admin/views/contentEntries/experiment/ContentEntriesViewConfig.js +0 -128
- package/admin/views/contentEntries/experiment/ContentEntriesViewConfig.js.map +0 -1
- package/types/index.d.ts +0 -490
- package/types/index.js +0 -38
- package/types/index.js.map +0 -1
- package/types/model.d.ts +0 -88
- package/types/model.js.map +0 -1
- package/types/shared.d.ts +0 -5
- package/types/shared.js +0 -5
- package/types/shared.js.map +0 -1
- package/types/validation.d.ts +0 -70
- package/types/validation.js +0 -5
- package/types/validation.js.map +0 -1
- /package/{types/model.js → admin/components/ContentEntries/Table/types.js} +0 -0
- /package/admin/{views/contentEntries/ContentEntry/header/saveAndPublishContent → components/ContentEntryForm/Header/SaveAndPublishContent}/SaveAndPublishContent.d.ts +0 -0
- /package/admin/views/contentEntries/{experiment/ContentEntriesModule.d.ts → ContentEntriesModule.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["t","i18n","namespace","SORTERS","label","sorters","rightAlign","css","alignItems","justifyContent","listItemMinHeight","minHeight","Icon","styled","width","height","marginRight","flex","svg","color","maxWidth","maxHeight","DisplayIcon","model","icon","split","ContentModelsDataList","canCreate","onCreate","onClone","useState","filter","setFilter","sort","setSort","useRouter","history","client","useApolloClient","useSnackbar","showSnackbar","useConfirmationDialog","dataTestId","showConfirmation","useModels","models","loading","usePermission","canDelete","canEdit","filterData","useCallback","name","toLowerCase","includes","sortData","list","deserializeSorters","sortField","sortOrderBy","orderBy","deleteRecord","item","mutate","mutation","GQL","DELETE_CONTENT_MODEL","variables","modelId","update","cache","data","error","deleteContentModel","message","title","removeModelFromListCache","removeModelFromGroupCache","removeModelFromCache","editRecord","contentModel","push","viewContentEntries","contentModelsDataListModalOverlay","useMemo","map","filteredData","contentModels","disableViewContent","fields","length","time","savedOn","plugin"],"sources":["ContentModelsDataList.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from \"react\";\n/**\n * Package timeago-react does not have types.\n */\n// @ts-ignore\nimport TimeAgo from \"timeago-react\";\nimport { css } from \"emotion\";\nimport { useRouter } from \"@webiny/react-router\";\nimport { DeleteIcon, EditIcon } from \"@webiny/ui/List/DataList/icons\";\nimport { ReactComponent as ViewListIcon } from \"../../icons/view_list.svg\";\nimport { ReactComponent as CloneIcon } from \"../../icons/clone.svg\";\nimport { useApolloClient, useModels } from \"../../hooks\";\nimport { useSnackbar } from \"@webiny/app-admin/hooks/useSnackbar\";\nimport * as UIL from \"@webiny/ui/List\";\nimport { ButtonIcon, ButtonSecondary, IconButton } from \"@webiny/ui/Button\";\nimport { Tooltip } from \"@webiny/ui/Tooltip\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport { useConfirmationDialog } from \"@webiny/app-admin/hooks/useConfirmationDialog\";\nimport { removeModelFromGroupCache, removeModelFromListCache, removeModelFromCache } from \"./cache\";\nimport * as GQL from \"../../viewsGraphql\";\nimport { ReactComponent as AddIcon } from \"@webiny/app-admin/assets/icons/add-18px.svg\";\nimport SearchUI from \"@webiny/app-admin/components/SearchUI\";\nimport { deserializeSorters } from \"../utils\";\nimport orderBy from \"lodash/orderBy\";\nimport { Cell, Grid } from \"@webiny/ui/Grid\";\nimport { Select } from \"@webiny/ui/Select\";\nimport { ReactComponent as FilterIcon } from \"@webiny/app-admin/assets/icons/filter-24px.svg\";\nimport { CmsEditorContentModel, CmsModel } from \"~/types\";\nimport {\n DeleteCmsModelMutationResponse,\n DeleteCmsModelMutationVariables\n} from \"../../viewsGraphql\";\nimport usePermission from \"~/admin/hooks/usePermission\";\nimport styled from \"@emotion/styled\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { IconProp } from \"@fortawesome/fontawesome-svg-core\";\n\nconst t = i18n.namespace(\"FormsApp.ContentModelsDataList\");\n\ninterface Sorter {\n label: string;\n sorters: string;\n}\n\nconst SORTERS: Sorter[] = [\n {\n label: t`Newest to oldest`,\n sorters: \"savedOn_DESC\"\n },\n {\n label: t`Oldest to newest`,\n sorters: \"savedOn_ASC\"\n },\n {\n label: t`Name A-Z`,\n sorters: \"name_ASC\"\n },\n {\n label: t`Name Z-A`,\n sorters: \"name_DESC\"\n }\n];\n\nconst rightAlign = css({\n alignItems: \"flex-end !important\",\n justifyContent: \"center !important\"\n});\n\nconst listItemMinHeight = css({\n minHeight: \"66px !important\"\n});\n\ninterface ContentModelsDataListProps {\n canCreate: boolean;\n onCreate: () => void;\n onClone: (contentModel: CmsEditorContentModel) => void;\n}\n\nconst Icon = styled(\"div\")({\n width: \"24px\",\n height: \"24px\",\n marginRight: \"15px\",\n flex: \"0 0 24px\",\n svg: {\n color: \"var(--mdc-theme-text-icon-on-light)\",\n width: \"100%\",\n height: \"auto\",\n maxWidth: 24,\n maxHeight: 24\n }\n});\n\ninterface IconProps {\n model: Pick<CmsModel, \"icon\">;\n}\n\nconst DisplayIcon: React.VFC<IconProps> = ({ model }) => {\n if (!model.icon) {\n return null;\n }\n return <FontAwesomeIcon icon={(model.icon || \"\").split(\"/\") as IconProp} />;\n};\n\nconst ContentModelsDataList: React.FC<ContentModelsDataListProps> = ({\n canCreate,\n onCreate,\n onClone\n}) => {\n const [filter, setFilter] = useState<string>(\"\");\n const [sort, setSort] = useState<string>(SORTERS[0].sorters);\n const { history } = useRouter();\n const client = useApolloClient();\n const { showSnackbar } = useSnackbar();\n const { showConfirmation } = useConfirmationDialog({\n dataTestId: \"cms-delete-content-model-dialog\"\n });\n const { models, loading } = useModels();\n const { canDelete, canEdit } = usePermission();\n\n const filterData = useCallback(\n ({ name }: Pick<CmsModel, \"name\">): boolean => {\n return name.toLowerCase().includes(filter);\n },\n [filter]\n );\n\n const sortData = useCallback(\n (list: CmsModel[]): CmsModel[] => {\n if (!sort) {\n return list;\n }\n const [sortField, sortOrderBy] = deserializeSorters(sort);\n return orderBy(list, [sortField], [sortOrderBy]);\n },\n [sort]\n );\n\n const deleteRecord = async (item: CmsModel): Promise<void> => {\n showConfirmation(async () => {\n await client.mutate<DeleteCmsModelMutationResponse, DeleteCmsModelMutationVariables>({\n mutation: GQL.DELETE_CONTENT_MODEL,\n variables: { modelId: item.modelId },\n update(cache, { data }) {\n if (!data) {\n showSnackbar(\"Missing data on Delete Content Model Mutation Response.\");\n return;\n }\n const { error } = data.deleteContentModel;\n\n if (error) {\n showSnackbar(error.message, {\n title: t`Something unexpected happened.`\n });\n return;\n }\n\n removeModelFromListCache(cache, item);\n removeModelFromGroupCache(cache, item);\n removeModelFromCache(client, item);\n\n showSnackbar(\n t`Content model {name} deleted successfully!.`({ name: item.name })\n );\n }\n });\n });\n };\n\n const editRecord = (contentModel: CmsModel): void => {\n history.push(\"/cms/content-models/\" + contentModel.modelId);\n };\n\n const viewContentEntries = useCallback(contentModel => {\n return () => history.push(\"/cms/content-entries/\" + contentModel.modelId);\n }, []);\n\n const contentModelsDataListModalOverlay = useMemo(\n () => (\n <UIL.DataListModalOverlay>\n <Grid>\n <Cell span={12}>\n <Select\n value={sort}\n onChange={setSort}\n label={t`Sort by`}\n description={\"Sort content models by\"}\n >\n {SORTERS.map(({ label, sorters }) => {\n return (\n <option key={label} value={sorters}>\n {label}\n </option>\n );\n })}\n </Select>\n </Cell>\n </Grid>\n </UIL.DataListModalOverlay>\n ),\n [sort]\n );\n\n const filteredData = filter === \"\" ? models : models.filter(filterData);\n const contentModels = sortData(filteredData);\n\n return (\n <UIL.DataList\n loading={loading}\n data={contentModels}\n title={t`Content Models`}\n actions={\n canCreate ? (\n <ButtonSecondary data-testid=\"new-record-button\" onClick={onCreate}>\n <ButtonIcon icon={<AddIcon />} /> {t`New Model`}\n </ButtonSecondary>\n ) : null\n }\n search={\n <SearchUI\n value={filter}\n onChange={setFilter}\n inputPlaceholder={t`Search content models`}\n />\n }\n modalOverlay={contentModelsDataListModalOverlay}\n modalOverlayAction={\n <UIL.DataListModalOverlayAction\n icon={<FilterIcon />}\n data-testid={\"default-data-list.filter\"}\n />\n }\n >\n {({ data = [] }: { data: CmsModel[] }) => (\n <UIL.List data-testid=\"default-data-list\">\n {data.map(contentModel => {\n const disableViewContent = contentModel.fields.length === 0;\n const message = disableViewContent\n ? \"To view the content, you first need to add a field and save the model\"\n : \"View content\";\n return (\n <UIL.ListItem key={contentModel.modelId} className={listItemMinHeight}>\n <Icon>\n <DisplayIcon model={contentModel} />\n </Icon>\n <UIL.ListItemText>\n {contentModel.name}\n <UIL.ListItemTextSecondary>\n {t`Last modified: {time}.`({\n time: contentModel.savedOn ? (\n <TimeAgo datetime={contentModel.savedOn} />\n ) : (\n \"N/A\"\n )\n })}\n </UIL.ListItemTextSecondary>\n </UIL.ListItemText>\n <UIL.ListItemMeta className={rightAlign}>\n <UIL.ListActions>\n {canEdit(contentModel, \"cms.contentModel\") && (\n <>\n <Tooltip\n content={t`{message}`({ message })}\n placement={\"top\"}\n >\n <IconButton\n data-testid={\n \"cms-view-content-model-button\"\n }\n icon={<ViewListIcon />}\n label={t`View entries`}\n onClick={viewContentEntries(contentModel)}\n disabled={disableViewContent}\n />\n </Tooltip>\n {contentModel.plugin ? (\n <Tooltip\n content={t`Content model is registered via a plugin.`}\n placement={\"top\"}\n >\n <EditIcon\n disabled\n data-testid={\n \"cms-edit-content-model-button\"\n }\n />\n </Tooltip>\n ) : (\n <Tooltip\n content={t`Edit content model`}\n placement={\"top\"}\n >\n <EditIcon\n onClick={() => editRecord(contentModel)}\n data-testid={\n \"cms-edit-content-model-button\"\n }\n />\n </Tooltip>\n )}\n </>\n )}\n\n <Tooltip content={\"Clone content model\"} placement={\"top\"}>\n <IconButton\n data-testid={\"cms-clone-content-model-button\"}\n icon={<CloneIcon />}\n label={t`View entries`}\n onClick={() => onClone(contentModel)}\n />\n </Tooltip>\n\n {canDelete(contentModel, \"cms.contentModel\") &&\n contentModel.plugin ? (\n <Tooltip\n content={t`Content model is registered via a plugin.`}\n placement={\"top\"}\n >\n <DeleteIcon\n disabled\n data-testid={\"cms-delete-content-model-button\"}\n />\n </Tooltip>\n ) : (\n <Tooltip\n content={t`Delete content model`}\n placement={\"top\"}\n >\n <DeleteIcon\n onClick={() => deleteRecord(contentModel)}\n data-testid={\"cms-delete-content-model-button\"}\n />\n </Tooltip>\n )}\n </UIL.ListActions>\n </UIL.ListItemMeta>\n </UIL.ListItem>\n );\n })}\n </UIL.List>\n )}\n </UIL.DataList>\n );\n};\n\nexport default ContentModelsDataList;\n"],"mappings":";;;;;;;;;;;;AAAA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAMA;AACA;AACA;AAAiE;AAGjE,IAAMA,CAAC,GAAGC,UAAI,CAACC,SAAS,CAAC,gCAAgC,CAAC;AAO1D,IAAMC,OAAiB,GAAG,CACtB;EACIC,KAAK,EAAEJ,CAAC,mGAAkB;EAC1BK,OAAO,EAAE;AACb,CAAC,EACD;EACID,KAAK,EAAEJ,CAAC,qGAAkB;EAC1BK,OAAO,EAAE;AACb,CAAC,EACD;EACID,KAAK,EAAEJ,CAAC,6FAAU;EAClBK,OAAO,EAAE;AACb,CAAC,EACD;EACID,KAAK,EAAEJ,CAAC,6FAAU;EAClBK,OAAO,EAAE;AACb,CAAC,CACJ;AAED,IAAMC,UAAU,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H,CACI,gBAEV,6BAAC,gBAAO;QACJ,OAAO,EAAEA,CAAC,yGAAqB;QAC/B,SAAS,EAAE;MAAM,gBAEjB,6BAAC,eAAQ;QACL,OAAO,EAAE;UAAA,OAAM+E,UAAU,CAACC,YAAY,CAAC;QAAA,CAAC;QACxC,eACI;MACH,EACH,CAET,CAER,eAED,6BAAC,gBAAO;QAAC,OAAO,EAAE,qBAAsB;QAAC,SAAS,EAAE;MAAM,gBACtD,6BAAC,kBAAU;QACP,eAAa,gCAAiC;QAC9C,IAAI,eAAE,6BAAC,qBAAS,OAAI;QACpB,KAAK,EAAEhF,CAAC,mGAAe;QACvB,OAAO,EAAE;UAAA,OAAM6B,OAAO,CAACmD,YAAY,CAAC;QAAA;MAAC,EACvC,CACI,EAEThC,SAAS,CAACgC,YAAY,EAAE,kBAAkB,CAAC,IAC5CA,YAAY,CAACa,MAAM,gBACf,6BAAC,gBAAO;QACJ,OAAO,EAAE7F,CAAC,gIAA4C;QACtD,SAAS,EAAE;MAAM,gBAEjB,6BAAC,iBAAU;QACP,QAAQ;QACR,eAAa;MAAkC,EACjD,CACI,gBAEV,6BAAC,gBAAO;QACJ,OAAO,EAAEA,CAAC,2GAAuB;QACjC,SAAS,EAAE;MAAM,gBAEjB,6BAAC,iBAAU;QACP,OAAO,EAAE;UAAA,OAAM6D,YAAY,CAACmB,YAAY,CAAC;QAAA,CAAC;QAC1C,eAAa;MAAkC,EACjD,CAET,CACa,CACH,CACR;IAEvB,CAAC,CAAC,CACK;EAAA,CACd,CACU;AAEvB,CAAC;AAAC,eAEatD,qBAAqB;AAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_timeagoReact","_interopRequireDefault","_emotion","_reactRouter","_icons","_view_list","_clone","_hooks","_useSnackbar2","UIL","_Button","_Tooltip","_i18n","_useConfirmationDialog","_cache","GQL","_add18px","_SearchUI","_utils","_orderBy","_Grid","_Select","_filter24px","_usePermission2","_styled","_reactFontawesome","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","_templateObject13","_templateObject14","_templateObject15","_templateObject16","_templateObject17","_templateObject18","t","i18n","namespace","SORTERS","label","_taggedTemplateLiteral2","default","sorters","rightAlign","css","alignItems","justifyContent","listItemMinHeight","minHeight","Icon","styled","target","width","height","marginRight","flex","svg","color","maxWidth","maxHeight","DisplayIcon","_ref","model","icon","createElement","FontAwesomeIcon","split","ContentModelsDataList","_ref2","canCreate","onCreate","onClone","_useState","useState","_useState2","_slicedToArray2","filter","setFilter","_useState3","_useState4","sort","setSort","_useRouter","useRouter","history","client","useApolloClient","_useSnackbar","useSnackbar","showSnackbar","_useConfirmationDialo","useConfirmationDialog","dataTestId","showConfirmation","_useModels","useModels","models","loading","refresh","_usePermission","usePermission","canDelete","canEdit","filterData","useCallback","_ref3","name","toLowerCase","includes","sortData","list","_deserializeSorters","deserializeSorters","_deserializeSorters2","sortField","sortOrderBy","orderBy","deleteRecord","_ref4","_asyncToGenerator2","_regeneratorRuntime2","mark","_callee2","item","wrap","_callee2$","_context2","prev","next","_callee","_callee$","_context","mutate","mutation","DELETE_CONTENT_MODEL","variables","modelId","update","cache","_ref6","data","error","deleteContentModel","message","title","removeModelFromListCache","removeModelFromGroupCache","removeModelFromCache","stop","_x","apply","arguments","editRecord","contentModel","push","viewContentEntries","contentModelsDataListModalOverlay","useMemo","DataListModalOverlay","Grid","Cell","span","Select","value","onChange","description","map","_ref7","key","filteredData","contentModels","onRefreshClick","DataList","actions","ButtonSecondary","onClick","ButtonIcon","ReactComponent","search","inputPlaceholder","modalOverlay","modalOverlayAction","DataListModalOverlayAction","_ref8","_ref8$data","List","disableViewContent","fields","length","ListItem","className","ListItemText","ListItemTextSecondary","time","savedOn","datetime","ListItemMeta","ListActions","Fragment","Tooltip","content","placement","IconButton","disabled","plugin","EditIcon","DeleteIcon","_default","exports"],"sources":["ContentModelsDataList.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useState } from \"react\";\n/**\n * Package timeago-react does not have types.\n */\n// @ts-ignore\nimport TimeAgo from \"timeago-react\";\nimport { css } from \"emotion\";\nimport { useRouter } from \"@webiny/react-router\";\nimport { DeleteIcon, EditIcon } from \"@webiny/ui/List/DataList/icons\";\nimport { ReactComponent as ViewListIcon } from \"../../icons/view_list.svg\";\nimport { ReactComponent as CloneIcon } from \"../../icons/clone.svg\";\nimport { useApolloClient, useModels } from \"../../hooks\";\nimport { useSnackbar } from \"@webiny/app-admin/hooks/useSnackbar\";\nimport * as UIL from \"@webiny/ui/List\";\nimport { ButtonIcon, ButtonSecondary, IconButton } from \"@webiny/ui/Button\";\nimport { Tooltip } from \"@webiny/ui/Tooltip\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport { useConfirmationDialog } from \"@webiny/app-admin/hooks/useConfirmationDialog\";\nimport { removeModelFromCache, removeModelFromGroupCache, removeModelFromListCache } from \"./cache\";\nimport * as GQL from \"../../viewsGraphql\";\nimport {\n DeleteCmsModelMutationResponse,\n DeleteCmsModelMutationVariables\n} from \"../../viewsGraphql\";\nimport { ReactComponent as AddIcon } from \"@webiny/app-admin/assets/icons/add-18px.svg\";\nimport SearchUI from \"@webiny/app-admin/components/SearchUI\";\nimport { deserializeSorters } from \"../utils\";\nimport orderBy from \"lodash/orderBy\";\nimport { Cell, Grid } from \"@webiny/ui/Grid\";\nimport { Select } from \"@webiny/ui/Select\";\nimport { ReactComponent as FilterIcon } from \"@webiny/app-admin/assets/icons/filter-24px.svg\";\nimport { CmsEditorContentModel, CmsModel } from \"~/types\";\nimport usePermission from \"~/admin/hooks/usePermission\";\nimport styled from \"@emotion/styled\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { IconProp } from \"@fortawesome/fontawesome-svg-core\";\n\nconst t = i18n.namespace(\"FormsApp.ContentModelsDataList\");\n\ninterface Sorter {\n label: string;\n sorters: string;\n}\n\nconst SORTERS: Sorter[] = [\n {\n label: t`Newest to oldest`,\n sorters: \"savedOn_DESC\"\n },\n {\n label: t`Oldest to newest`,\n sorters: \"savedOn_ASC\"\n },\n {\n label: t`Name A-Z`,\n sorters: \"name_ASC\"\n },\n {\n label: t`Name Z-A`,\n sorters: \"name_DESC\"\n }\n];\n\nconst rightAlign = css({\n alignItems: \"flex-end !important\",\n justifyContent: \"center !important\"\n});\n\nconst listItemMinHeight = css({\n minHeight: \"66px !important\"\n});\n\ninterface ContentModelsDataListProps {\n canCreate: boolean;\n onCreate: () => void;\n onClone: (contentModel: CmsEditorContentModel) => void;\n}\n\nconst Icon = styled(\"div\")({\n width: \"24px\",\n height: \"24px\",\n marginRight: \"15px\",\n flex: \"0 0 24px\",\n svg: {\n color: \"var(--mdc-theme-text-icon-on-light)\",\n width: \"100%\",\n height: \"auto\",\n maxWidth: 24,\n maxHeight: 24\n }\n});\n\ninterface IconProps {\n model: Pick<CmsModel, \"icon\">;\n}\n\nconst DisplayIcon: React.VFC<IconProps> = ({ model }) => {\n if (!model.icon) {\n return null;\n }\n return <FontAwesomeIcon icon={(model.icon || \"\").split(\"/\") as IconProp} />;\n};\n\nconst ContentModelsDataList: React.FC<ContentModelsDataListProps> = ({\n canCreate,\n onCreate,\n onClone\n}) => {\n const [filter, setFilter] = useState<string>(\"\");\n const [sort, setSort] = useState<string>(SORTERS[0].sorters);\n const { history } = useRouter();\n const client = useApolloClient();\n const { showSnackbar } = useSnackbar();\n const { showConfirmation } = useConfirmationDialog({\n dataTestId: \"cms-delete-content-model-dialog\"\n });\n const { models, loading, refresh } = useModels();\n const { canDelete, canEdit } = usePermission();\n\n const filterData = useCallback(\n ({ name }: Pick<CmsModel, \"name\">): boolean => {\n return name.toLowerCase().includes(filter);\n },\n [filter]\n );\n\n const sortData = useCallback(\n (list: CmsModel[]): CmsModel[] => {\n if (!sort) {\n return list;\n }\n const [sortField, sortOrderBy] = deserializeSorters(sort);\n return orderBy(list, [sortField], [sortOrderBy]);\n },\n [sort]\n );\n\n const deleteRecord = async (item: CmsModel): Promise<void> => {\n showConfirmation(async () => {\n await client.mutate<DeleteCmsModelMutationResponse, DeleteCmsModelMutationVariables>({\n mutation: GQL.DELETE_CONTENT_MODEL,\n variables: { modelId: item.modelId },\n update(cache, { data }) {\n if (!data) {\n showSnackbar(\"Missing data on Delete Content Model Mutation Response.\");\n return;\n }\n const { error } = data.deleteContentModel;\n\n if (error) {\n showSnackbar(error.message, {\n title: t`Something unexpected happened.`\n });\n return;\n }\n\n removeModelFromListCache(cache, item);\n removeModelFromGroupCache(cache, item);\n removeModelFromCache(client, item);\n\n showSnackbar(\n t`Content model {name} deleted successfully!.`({ name: item.name })\n );\n }\n });\n });\n };\n\n const editRecord = (contentModel: CmsModel): void => {\n history.push(\"/cms/content-models/\" + contentModel.modelId);\n };\n\n const viewContentEntries = useCallback(contentModel => {\n return () => history.push(\"/cms/content-entries/\" + contentModel.modelId);\n }, []);\n\n const contentModelsDataListModalOverlay = useMemo(\n () => (\n <UIL.DataListModalOverlay>\n <Grid>\n <Cell span={12}>\n <Select\n value={sort}\n onChange={setSort}\n label={t`Sort by`}\n description={\"Sort content models by\"}\n >\n {SORTERS.map(({ label, sorters }) => {\n return (\n <option key={label} value={sorters}>\n {label}\n </option>\n );\n })}\n </Select>\n </Cell>\n </Grid>\n </UIL.DataListModalOverlay>\n ),\n [sort]\n );\n\n const filteredData = filter === \"\" ? models : models.filter(filterData);\n const contentModels = sortData(filteredData);\n\n const onRefreshClick = useCallback(() => {\n refresh();\n }, []);\n\n return (\n <UIL.DataList\n loading={loading}\n data={contentModels}\n title={t`Content Models`}\n actions={\n canCreate ? (\n <ButtonSecondary data-testid=\"new-record-button\" onClick={onCreate}>\n <ButtonIcon icon={<AddIcon />} /> {t`New Model`}\n </ButtonSecondary>\n ) : null\n }\n search={\n <SearchUI\n value={filter}\n onChange={setFilter}\n inputPlaceholder={t`Search content models`}\n />\n }\n modalOverlay={contentModelsDataListModalOverlay}\n modalOverlayAction={\n <UIL.DataListModalOverlayAction\n icon={<FilterIcon />}\n data-testid={\"default-data-list.filter\"}\n />\n }\n refresh={onRefreshClick}\n >\n {({ data = [] }: { data: CmsModel[] }) => (\n <UIL.List data-testid=\"default-data-list\">\n {data.map(contentModel => {\n const disableViewContent = contentModel.fields.length === 0;\n const message = disableViewContent\n ? \"To view the content, you first need to add a field and save the model\"\n : \"View content\";\n return (\n <UIL.ListItem key={contentModel.modelId} className={listItemMinHeight}>\n <Icon>\n <DisplayIcon model={contentModel} />\n </Icon>\n <UIL.ListItemText>\n {contentModel.name}\n <UIL.ListItemTextSecondary>\n {t`Last modified: {time}.`({\n time: contentModel.savedOn ? (\n <TimeAgo datetime={contentModel.savedOn} />\n ) : (\n \"N/A\"\n )\n })}\n </UIL.ListItemTextSecondary>\n </UIL.ListItemText>\n <UIL.ListItemMeta className={rightAlign}>\n <UIL.ListActions>\n {canEdit(contentModel, \"cms.contentModel\") && (\n <>\n <Tooltip\n content={t`{message}`({ message })}\n placement={\"top\"}\n >\n <IconButton\n data-testid={\n \"cms-view-content-model-button\"\n }\n icon={<ViewListIcon />}\n label={t`View entries`}\n onClick={viewContentEntries(contentModel)}\n disabled={disableViewContent}\n />\n </Tooltip>\n {contentModel.plugin ? (\n <Tooltip\n content={t`Content model is registered via a plugin.`}\n placement={\"top\"}\n >\n <EditIcon\n disabled\n data-testid={\n \"cms-edit-content-model-button\"\n }\n />\n </Tooltip>\n ) : (\n <Tooltip\n content={t`Edit content model`}\n placement={\"top\"}\n >\n <EditIcon\n onClick={() => editRecord(contentModel)}\n data-testid={\n \"cms-edit-content-model-button\"\n }\n />\n </Tooltip>\n )}\n </>\n )}\n\n <Tooltip content={\"Clone content model\"} placement={\"top\"}>\n <IconButton\n data-testid={\"cms-clone-content-model-button\"}\n icon={<CloneIcon />}\n label={t`View entries`}\n onClick={() => onClone(contentModel)}\n />\n </Tooltip>\n\n {canDelete(contentModel, \"cms.contentModel\") && (\n <>\n {contentModel.plugin ? (\n <Tooltip\n content={t`Content model is registered via a plugin.`}\n placement={\"top\"}\n >\n <DeleteIcon\n disabled\n data-testid={\n \"cms-delete-content-model-button\"\n }\n />\n </Tooltip>\n ) : (\n <Tooltip\n content={t`Delete content model`}\n placement={\"top\"}\n >\n <DeleteIcon\n onClick={() =>\n deleteRecord(contentModel)\n }\n data-testid={\n \"cms-delete-content-model-button\"\n }\n />\n </Tooltip>\n )}\n </>\n )}\n </UIL.ListActions>\n </UIL.ListItemMeta>\n </UIL.ListItem>\n );\n })}\n </UIL.List>\n )}\n </UIL.DataList>\n );\n};\n\nexport default ContentModelsDataList;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,GAAA,GAAAX,uBAAA,CAAAC,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AACA,IAAAY,QAAA,GAAAZ,OAAA;AACA,IAAAa,KAAA,GAAAb,OAAA;AACA,IAAAc,sBAAA,GAAAd,OAAA;AACA,IAAAe,MAAA,GAAAf,OAAA;AACA,IAAAgB,GAAA,GAAAjB,uBAAA,CAAAC,OAAA;AAKA,IAAAiB,QAAA,GAAAjB,OAAA;AACA,IAAAkB,SAAA,GAAAhB,sBAAA,CAAAF,OAAA;AACA,IAAAmB,MAAA,GAAAnB,OAAA;AACA,IAAAoB,QAAA,GAAAlB,sBAAA,CAAAF,OAAA;AACA,IAAAqB,KAAA,GAAArB,OAAA;AACA,IAAAsB,OAAA,GAAAtB,OAAA;AACA,IAAAuB,WAAA,GAAAvB,OAAA;AAEA,IAAAwB,eAAA,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AAuB,aAAA,CAACrE,MAAA,CAAAmN,UAAU;QACP/B,OAAO,EAAE,SAAAA,QAAA;UAAA,OACL1D,YAAY,CAACoC,YAAY,CAAC;QAAA,CAC7B;QACD,eACI;MACH,CACJ,CACI,CAEf,CAEO,CACH,CACR,CAAC;IAEvB,CAAC,CACK,CAAC;EAAA,CAEL,CAAC;AAEvB,CAAC;AAAC,IAAAsD,QAAA,GAEa5I,qBAAqB;AAAA6I,OAAA,CAAAvK,OAAA,GAAAsK,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["t","i18n","ns","NewContentModelDialog","open","onClose","React","useState","loading","setLoading","useSnackbar","showSnackbar","useRouter","history","client","useApolloClient","useMutation","GQL","CREATE_CONTENT_MODEL","update","cache","data","createContentModel","model","error","message","addModelToListCache","addModelToGroupCache","push","modelId","listMenuGroupsQuery","useQuery","LIST_MENU_CONTENT_GROUPS_MODELS","skip","groups","useMemo","listContentModelGroups","contentModelGroups","map","item","value","id","label","name","models","reduce","collection","group","contentModels","nameValidator","useCallback","createNameValidator","apiNameValidator","createApiNameValidator","length","onSubmit","variables","Bind","submit","validation","create","props","ev"],"sources":["NewContentModelDialog.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { useRouter } from \"@webiny/react-router\";\nimport { Form } from \"@webiny/form\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Select } from \"@webiny/ui/Select\";\nimport { useSnackbar } from \"@webiny/app-admin/hooks/useSnackbar\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { validation } from \"@webiny/validation\";\nimport { useQuery, useMutation, useApolloClient } from \"../../hooks\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport { ButtonPrimary } from \"@webiny/ui/Button\";\nimport * as UID from \"@webiny/ui/Dialog\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { addModelToGroupCache, addModelToListCache } from \"./cache\";\nimport * as GQL from \"../../viewsGraphql\";\nimport {\n CreateCmsModelMutationResponse,\n CreateCmsModelMutationVariables,\n ListMenuCmsGroupsQueryResponse\n} from \"../../viewsGraphql\";\nimport { CmsModel } from \"~/types\";\nimport { CmsGroupOption } from \"./types\";\nimport { Dialog } from \"~/admin/components/Dialog\";\nimport { createApiNameValidator } from \"~/admin/views/contentModels/helpers/apiNameValidator\";\nimport { createNameValidator } from \"~/admin/views/contentModels/helpers/nameValidator\";\nimport { Checkbox } from \"@webiny/ui/Checkbox\";\nimport { IconPicker } from \"~/admin/components/IconPicker\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/views/content-models/new-content-model-dialog\");\n\nexport interface NewContentModelDialogProps {\n open: boolean;\n onClose: UID.DialogOnClose;\n}\n\ninterface CmsModelData {\n name: string;\n description: string;\n group: string;\n}\n\nconst NewContentModelDialog: React.FC<NewContentModelDialogProps> = ({ open, onClose }) => {\n const [loading, setLoading] = React.useState(false);\n const { showSnackbar } = useSnackbar();\n const { history } = useRouter();\n const client = useApolloClient();\n\n const [createContentModel] = useMutation<\n CreateCmsModelMutationResponse,\n CreateCmsModelMutationVariables\n >(GQL.CREATE_CONTENT_MODEL, {\n update(cache, { data }) {\n if (!data) {\n setLoading(false);\n showSnackbar(\"Missing data on Create Content Model Mutation Response.\");\n return;\n }\n const { data: model, error } = data.createContentModel;\n\n if (error) {\n setLoading(false);\n showSnackbar(error.message);\n return;\n }\n\n addModelToListCache(cache, model);\n addModelToGroupCache(cache, model);\n\n history.push(\"/cms/content-models/\" + model.modelId);\n }\n });\n\n const listMenuGroupsQuery = useQuery<ListMenuCmsGroupsQueryResponse>(\n GQL.LIST_MENU_CONTENT_GROUPS_MODELS,\n {\n skip: !open\n }\n );\n\n const groups = useMemo(() => {\n return listMenuGroupsQuery.data?.listContentModelGroups?.data || [];\n }, [listMenuGroupsQuery.data]);\n\n const contentModelGroups = useMemo(() => {\n return groups.map((item): CmsGroupOption => {\n return {\n value: item.id,\n label: item.name\n };\n });\n }, [groups]);\n\n const models = useMemo(() => {\n return groups.reduce<CmsModel[]>((collection, group) => {\n collection.push(...group.contentModels);\n return collection;\n }, []);\n }, [groups]);\n\n const nameValidator = useCallback(createNameValidator({ models }), [models]);\n\n const apiNameValidator = useCallback(createApiNameValidator({ client, models }), [\n client,\n models\n ]);\n\n const group = contentModelGroups.length > 0 ? contentModelGroups[0].value : null;\n\n const onSubmit = async (data: CmsModelData) => {\n setLoading(true);\n await createContentModel({\n variables: { data }\n });\n };\n\n return (\n <Dialog open={open} onClose={onClose} data-testid=\"cms-new-content-model-modal\">\n {open && (\n <Form\n data={{ group }}\n onSubmit={data => {\n /**\n * We are positive that data is CmsModelData.\n */\n onSubmit(data as unknown as CmsModelData);\n }}\n >\n {({ Bind, submit }) => (\n <>\n {loading && <CircularProgress label={\"Creating content model...\"} />}\n <UID.DialogTitle>{t`New Content Model`}</UID.DialogTitle>\n <UID.DialogContent>\n <Grid>\n <Cell span={12}>\n <Bind\n name={\"name\"}\n validators={[\n validation.create(\"required,maxLength:100\"),\n nameValidator\n ]}\n >\n <Input\n label={t`Name`}\n description={t`The name of the content model. Use the singular form, e.g. Author Category, not Author Categories.`}\n data-testid=\"cms.newcontentmodeldialog.name\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"singularApiName\"}\n validators={[\n validation.create(\"required,maxLength:100\"),\n apiNameValidator\n ]}\n >\n <Input\n label={t`Singular API Name`}\n description={t`The API name of the content model. For example: AuthorCategory.`}\n data-testid=\"cms.newcontentmodeldialog.singularApiName\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"pluralApiName\"}\n validators={[\n validation.create(\"required,maxLength:100\"),\n apiNameValidator\n ]}\n >\n <Input\n label={t`Plural API Name`}\n description={t`The plural API name of the content model. For example: AuthorCategories.`}\n data-testid=\"cms.newcontentmodeldialog.pluralApiName\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"group\"}\n validators={validation.create(\"required\")}\n >\n <Select\n description={t`Choose a content model group`}\n label={t`Content model group`}\n options={contentModelGroups}\n data-testid=\"cms.newcontentmodeldialog.selectgroup\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name=\"icon\">\n <IconPicker\n label={t`Icon`}\n description={t`Choose an icon to represent the model.`}\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name=\"description\">\n {props => (\n <Input\n {...props}\n rows={4}\n maxLength={200}\n characterCount\n label={t`Description`}\n data-testid=\"cms.newcontentmodeldialog.description\"\n />\n )}\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name={\"defaultFields\"} defaultValue={true}>\n <Checkbox\n description={t`Create model with default title (text), description (long text) and image (file) fields`}\n label={t`Create model with default fields`}\n data-testid=\"cms.newcontentmodeldialog.defaultfields\"\n />\n </Bind>\n </Cell>\n </Grid>\n </UID.DialogContent>\n <UID.DialogActions>\n <ButtonPrimary\n onClick={ev => {\n submit(ev);\n }}\n >\n + {t`Create Model`}\n </ButtonPrimary>\n </UID.DialogActions>\n </>\n )}\n </Form>\n )}\n </Dialog>\n );\n};\n\nexport default NewContentModelDialog;\n"],"mappings":";;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAQA;AACA;AACA;AACA;AACA;AAA2D;AAE3D,IAAMA,CAAC,GAAGC,UAAI,CAACC,EAAE,CAAC,sEAAsE,CAAC;AAazF,IAAMC,qBAA2D,GAAG,SAA9DA,qBAA2D,OAA0B;EAAA,IAApBC,IAAI,QAAJA,IAAI;IAAEC,OAAO,QAAPA,OAAO;EAChF,sBAA8BC,cAAK,CAACC,QAAQ,CAAC,KAAK,CAAC;IAAA;IAA5CC,OAAO;IAAEC,UAAU;EAC1B,mBAAyB,IAAAC,yBAAW,GAAE;IAA9BC,YAAY,gBAAZA,YAAY;EACpB,iBAAoB,IAAAC,sBAAS,GAAE;IAAvBC,OAAO,cAAPA,OAAO;EACf,IAAMC,MAAM,GAAG,IAAAC,sBAA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AC,eAEaG,qBAAqB;AAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactRouter","_form","_Input","_Select","_useSnackbar2","_Progress","_validation","_hooks","_i18n","_Button","UID","_Grid","_cache","GQL","_Dialog2","_apiNameValidator","_nameValidator","_Checkbox","_IconPicker","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","_templateObject13","_templateObject14","_templateObject15","t","i18n","ns","NewContentModelDialog","_ref","open","onClose","_React$useState","React","useState","_React$useState2","_slicedToArray2","default","loading","setLoading","_useSnackbar","useSnackbar","showSnackbar","_useRouter","useRouter","history","client","useApolloClient","_useMutation","useMutation","CREATE_CONTENT_MODEL","update","cache","_ref2","data","_data$createContentMo","createContentModel","model","error","message","addModelToListCache","addModelToGroupCache","push","modelId","_useMutation2","listMenuGroupsQuery","useQuery","LIST_MENU_CONTENT_GROUPS_MODELS","skip","groups","useMemo","_listMenuGroupsQuery$","_listMenuGroupsQuery$2","listContentModelGroups","contentModelGroups","map","item","value","id","label","name","models","reduce","collection","group","apply","_toConsumableArray2","contentModels","nameValidator","useCallback","createNameValidator","apiNameValidator","createApiNameValidator","length","onSubmit","_ref3","_asyncToGenerator2","_regeneratorRuntime2","mark","_callee","wrap","_callee$","_context","prev","next","variables","stop","_x","arguments","createElement","Dialog","Form","_ref4","Bind","submit","Fragment","CircularProgress","DialogTitle","_taggedTemplateLiteral2","DialogContent","Grid","Cell","span","validators","validation","create","Input","description","Select","options","IconPicker","props","Object","assign","rows","maxLength","characterCount","defaultValue","Checkbox","DialogActions","ButtonPrimary","onClick","ev","_default","exports"],"sources":["NewContentModelDialog.tsx"],"sourcesContent":["import React, { useCallback, useMemo } from \"react\";\nimport { useRouter } from \"@webiny/react-router\";\nimport { Form } from \"@webiny/form\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Select } from \"@webiny/ui/Select\";\nimport { useSnackbar } from \"@webiny/app-admin/hooks/useSnackbar\";\nimport { CircularProgress } from \"@webiny/ui/Progress\";\nimport { validation } from \"@webiny/validation\";\nimport { useQuery, useMutation, useApolloClient } from \"../../hooks\";\nimport { i18n } from \"@webiny/app/i18n\";\nimport { ButtonPrimary } from \"@webiny/ui/Button\";\nimport * as UID from \"@webiny/ui/Dialog\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { addModelToGroupCache, addModelToListCache } from \"./cache\";\nimport * as GQL from \"../../viewsGraphql\";\nimport {\n CreateCmsModelMutationResponse,\n CreateCmsModelMutationVariables,\n ListMenuCmsGroupsQueryResponse\n} from \"../../viewsGraphql\";\nimport { CmsModel } from \"~/types\";\nimport { CmsGroupOption } from \"./types\";\nimport { Dialog } from \"~/admin/components/Dialog\";\nimport { createApiNameValidator } from \"~/admin/views/contentModels/helpers/apiNameValidator\";\nimport { createNameValidator } from \"~/admin/views/contentModels/helpers/nameValidator\";\nimport { Checkbox } from \"@webiny/ui/Checkbox\";\nimport { IconPicker } from \"~/admin/components/IconPicker\";\n\nconst t = i18n.ns(\"app-headless-cms/admin/views/content-models/new-content-model-dialog\");\n\nexport interface NewContentModelDialogProps {\n open: boolean;\n onClose: UID.DialogOnClose;\n}\n\ninterface CmsModelData {\n name: string;\n description: string;\n group: string;\n}\n\nconst NewContentModelDialog: React.FC<NewContentModelDialogProps> = ({ open, onClose }) => {\n const [loading, setLoading] = React.useState(false);\n const { showSnackbar } = useSnackbar();\n const { history } = useRouter();\n const client = useApolloClient();\n\n const [createContentModel] = useMutation<\n CreateCmsModelMutationResponse,\n CreateCmsModelMutationVariables\n >(GQL.CREATE_CONTENT_MODEL, {\n update(cache, { data }) {\n if (!data) {\n setLoading(false);\n showSnackbar(\"Missing data on Create Content Model Mutation Response.\");\n return;\n }\n const { data: model, error } = data.createContentModel;\n\n if (error) {\n setLoading(false);\n showSnackbar(error.message);\n return;\n }\n\n addModelToListCache(cache, model);\n addModelToGroupCache(cache, model);\n\n history.push(\"/cms/content-models/\" + model.modelId);\n }\n });\n\n const listMenuGroupsQuery = useQuery<ListMenuCmsGroupsQueryResponse>(\n GQL.LIST_MENU_CONTENT_GROUPS_MODELS,\n {\n skip: !open\n }\n );\n\n const groups = useMemo(() => {\n return listMenuGroupsQuery.data?.listContentModelGroups?.data || [];\n }, [listMenuGroupsQuery.data]);\n\n const contentModelGroups = useMemo(() => {\n return groups.map((item): CmsGroupOption => {\n return {\n value: item.id,\n label: item.name\n };\n });\n }, [groups]);\n\n const models = useMemo(() => {\n return groups.reduce<CmsModel[]>((collection, group) => {\n collection.push(...group.contentModels);\n return collection;\n }, []);\n }, [groups]);\n\n const nameValidator = useCallback(createNameValidator({ models }), [models]);\n\n const apiNameValidator = useCallback(createApiNameValidator({ client, models }), [\n client,\n models\n ]);\n\n const group = contentModelGroups.length > 0 ? contentModelGroups[0].value : null;\n\n const onSubmit = async (data: CmsModelData) => {\n setLoading(true);\n await createContentModel({\n variables: { data }\n });\n };\n\n return (\n <Dialog open={open} onClose={onClose} data-testid=\"cms-new-content-model-modal\">\n {open && (\n <Form\n data={{ group }}\n onSubmit={data => {\n /**\n * We are positive that data is CmsModelData.\n */\n onSubmit(data as unknown as CmsModelData);\n }}\n >\n {({ Bind, submit }) => (\n <>\n {loading && <CircularProgress label={\"Creating content model...\"} />}\n <UID.DialogTitle>{t`New Content Model`}</UID.DialogTitle>\n <UID.DialogContent>\n <Grid>\n <Cell span={12}>\n <Bind\n name={\"name\"}\n validators={[\n validation.create(\"required,maxLength:100\"),\n nameValidator\n ]}\n >\n <Input\n label={t`Name`}\n description={t`The name of the content model. Use the singular form, e.g. Author Category, not Author Categories.`}\n data-testid=\"cms.newcontentmodeldialog.name\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"singularApiName\"}\n validators={[\n validation.create(\"required,maxLength:100\"),\n apiNameValidator\n ]}\n >\n <Input\n label={t`Singular API Name`}\n description={t`The API name of the content model. For example: AuthorCategory.`}\n data-testid=\"cms.newcontentmodeldialog.singularApiName\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"pluralApiName\"}\n validators={[\n validation.create(\"required,maxLength:100\"),\n apiNameValidator\n ]}\n >\n <Input\n label={t`Plural API Name`}\n description={t`The plural API name of the content model. For example: AuthorCategories.`}\n data-testid=\"cms.newcontentmodeldialog.pluralApiName\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind\n name={\"group\"}\n validators={validation.create(\"required\")}\n >\n <Select\n description={t`Choose a content model group`}\n label={t`Content model group`}\n options={contentModelGroups}\n data-testid=\"cms.newcontentmodeldialog.selectgroup\"\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name=\"icon\">\n <IconPicker\n label={t`Icon`}\n description={t`Choose an icon to represent the model.`}\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name=\"description\">\n {props => (\n <Input\n {...props}\n rows={4}\n maxLength={200}\n characterCount\n label={t`Description`}\n data-testid=\"cms.newcontentmodeldialog.description\"\n />\n )}\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name={\"defaultFields\"} defaultValue={true}>\n <Checkbox\n description={t`Create model with default title (text), description (long text) and image (file) fields`}\n label={t`Create model with default fields`}\n data-testid=\"cms.newcontentmodeldialog.defaultfields\"\n />\n </Bind>\n </Cell>\n </Grid>\n </UID.DialogContent>\n <UID.DialogActions>\n <ButtonPrimary\n onClick={ev => {\n submit(ev);\n }}\n >\n + {t`Create Model`}\n </ButtonPrimary>\n </UID.DialogActions>\n </>\n )}\n </Form>\n )}\n </Dialog>\n );\n};\n\nexport default NewContentModelDialog;\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OA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I,EAAE;IAAG,gBACXtI,MAAA,CAAAiD,OAAA,CAAAwE,aAAA,CAACI,IAAI;MAACjC,IAAI,EAAE,eAAgB;MAACyD,YAAY,EAAE;IAAK,gBAC5CrJ,MAAA,CAAAiD,OAAA,CAAAwE,aAAA,CAACrG,SAAA,CAAAkI,QAAQ;MACLX,WAAW,EAAEtG,CAAC,CAAAH,iBAAA,KAAAA,iBAAA,OAAAgG,uBAAA,CAAAjF,OAAA,gGAA0F;MACxG0C,KAAK,EAAEtD,CAAC,CAAAF,iBAAA,KAAAA,iBAAA,OAAA+F,uBAAA,CAAAjF,OAAA,yCAAmC;MAC3C,eAAY;IAAyC,CACxD,CACC,CACJ,CACJ,CACS,CAAC,eACpBjD,MAAA,CAAAiD,OAAA,CAAAwE,aAAA,CAAC5G,GAAG,CAAC0I,aAAa,qBACdvJ,MAAA,CAAAiD,OAAA,CAAAwE,aAAA,CAAC7G,OAAA,CAAA4I,aAAa;MACVC,OAAO,EAAE,SAAAA,QAAAC,EAAE,EAAI;QACX5B,MAAM,CAAC4B,EAAE,CAAC;MACd;IAAE,GACL,IACK,EAACrH,CAAC,CAAAD,iBAAA,KAAAA,iBAAA,OAAA8F,uBAAA,CAAAjF,OAAA,qBACO,CACA,CACrB,CAAC;EAAA,CAEL,CAEN,CAAC;AAEjB,CAAC;AAAC,IAAA0G,QAAA,GAEanH,qBAAqB;AAAAoH,OAAA,CAAA3G,OAAA,GAAA0G,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["addModelToListCache","cache","model","response","readQuery","query","LIST_CONTENT_MODELS","listContentModels","newModelIndex","data","length","writeQuery","dotProp","set","addModelToGroupCache","LIST_MENU_CONTENT_GROUPS_MODELS","listContentModelGroups","groupsList","groupIndex","findIndex","g","id","group","newGroupModelIndex","contentModels","removeModelFromCache","client","modelId","delete","Object","keys","forEach","key","startsWith","removeModelFromListCache","modelIndex","m","removeModelFromGroupCache"],"sources":["cache.ts"],"sourcesContent":["import dotProp from \"dot-prop-immutable\";\nimport { DataProxy } from \"apollo-cache\";\nimport ApolloClient from \"apollo-client\";\nimport { LIST_CONTENT_MODELS, LIST_MENU_CONTENT_GROUPS_MODELS } from \"../../viewsGraphql\";\nimport { CmsEditorContentModel } from \"~/types\";\nimport { ListCmsModelsQueryResponse, ListMenuCmsGroupsQueryResponse } from \"../../viewsGraphql\";\n\nexport const addModelToListCache = (cache: DataProxy, model: CmsEditorContentModel): void => {\n const response = cache.readQuery<ListCmsModelsQueryResponse>({\n query: LIST_CONTENT_MODELS\n });\n if (!response || !response.listContentModels) {\n return;\n }\n const { listContentModels } = response;\n const newModelIndex = listContentModels.data.length;\n\n cache.writeQuery({\n query: LIST_CONTENT_MODELS,\n data: {\n listContentModels: dotProp.set(listContentModels, `data.${newModelIndex}`, model)\n }\n });\n};\n\nexport const addModelToGroupCache = (cache: DataProxy, model: CmsEditorContentModel): void => {\n const response = cache.readQuery<ListMenuCmsGroupsQueryResponse>({\n query: LIST_MENU_CONTENT_GROUPS_MODELS\n });\n if (!response || !response.listContentModelGroups) {\n return;\n }\n\n const { listContentModelGroups: groupsList } = response;\n\n const groupIndex = groupsList.data.findIndex(g => g.id === model.group.id);\n const newGroupModelIndex = groupsList.data[groupIndex].contentModels.length;\n\n cache.writeQuery({\n query: LIST_MENU_CONTENT_GROUPS_MODELS,\n data: {\n listContentModelGroups: dotProp.set(\n groupsList,\n `data.${groupIndex}.contentModels.${newGroupModelIndex}`,\n model\n )\n }\n });\n};\n\n/**\n * This function is an ugly hack, but I don't know a better way to remove items from cache in Apollo Client v2.\n * When a Content Model is deleted, we need to remove it from cache, because a model can be recreated with the same\n * modelId, and it will cause problems, because Apollo will think that the data in cache belongs to this new model.\n */\nexport const removeModelFromCache = (\n client: ApolloClient<any>,\n model: CmsEditorContentModel\n): void => {\n const id = `CmsContentModel:${model.modelId}`;\n\n // @ts-ignore\n client.cache.data.delete(id);\n\n // @ts-ignore\n Object.keys(client.cache.data.data).forEach(key => {\n if (key.startsWith(`${id}.`) || key.startsWith(`$${id}.`)) {\n // @ts-ignore\n client.cache.data.delete(key);\n }\n });\n};\n\nexport const removeModelFromListCache = (cache: DataProxy, model: CmsEditorContentModel): void => {\n const response = cache.readQuery<ListCmsModelsQueryResponse>({\n query: LIST_CONTENT_MODELS\n });\n if (!response || !response.listContentModels) {\n return;\n }\n const { listContentModels } = response;\n const modelIndex = listContentModels.data.findIndex(m => m.modelId === model.modelId);\n\n cache.writeQuery({\n query: LIST_CONTENT_MODELS,\n data: {\n listContentModels: dotProp.delete(listContentModels, `data.${modelIndex}`)\n }\n });\n};\n\nexport const removeModelFromGroupCache = (cache: DataProxy, model: CmsEditorContentModel): void => {\n const response = cache.readQuery<ListMenuCmsGroupsQueryResponse>({\n query: LIST_MENU_CONTENT_GROUPS_MODELS\n });\n if (!response || !response.listContentModelGroups) {\n return;\n }\n const { listContentModelGroups: groupsList } = response;\n\n const groupIndex = groupsList.data.findIndex(g => g.id === model.group.id);\n if (groupIndex < 0) {\n return;\n }\n const modelIndex = groupsList.data[groupIndex].contentModels.findIndex(\n m => m.modelId === model.modelId\n );\n\n if (modelIndex < 0) {\n return;\n }\n\n cache.writeQuery({\n query: LIST_MENU_CONTENT_GROUPS_MODELS,\n data: {\n listContentModelGroups: dotProp.delete(\n groupsList,\n `data.${groupIndex}.contentModels.${modelIndex}`\n )\n }\n });\n};\n"],"mappings":";;;;;;;AAAA;AAGA;AAIO,
|
|
1
|
+
{"version":3,"names":["_dotPropImmutable","_interopRequireDefault","require","_viewsGraphql","addModelToListCache","cache","model","response","readQuery","query","LIST_CONTENT_MODELS","listContentModels","newModelIndex","data","length","writeQuery","dotProp","set","concat","exports","addModelToGroupCache","LIST_MENU_CONTENT_GROUPS_MODELS","listContentModelGroups","groupsList","groupIndex","findIndex","g","id","group","newGroupModelIndex","contentModels","removeModelFromCache","client","modelId","delete","Object","keys","forEach","key","startsWith","removeModelFromListCache","modelIndex","m","removeModelFromGroupCache"],"sources":["cache.ts"],"sourcesContent":["import dotProp from \"dot-prop-immutable\";\nimport { DataProxy } from \"apollo-cache\";\nimport ApolloClient from \"apollo-client\";\nimport { LIST_CONTENT_MODELS, LIST_MENU_CONTENT_GROUPS_MODELS } from \"../../viewsGraphql\";\nimport { CmsEditorContentModel } from \"~/types\";\nimport { ListCmsModelsQueryResponse, ListMenuCmsGroupsQueryResponse } from \"../../viewsGraphql\";\n\nexport const addModelToListCache = (cache: DataProxy, model: CmsEditorContentModel): void => {\n const response = cache.readQuery<ListCmsModelsQueryResponse>({\n query: LIST_CONTENT_MODELS\n });\n if (!response || !response.listContentModels) {\n return;\n }\n const { listContentModels } = response;\n const newModelIndex = listContentModels.data.length;\n\n cache.writeQuery({\n query: LIST_CONTENT_MODELS,\n data: {\n listContentModels: dotProp.set(listContentModels, `data.${newModelIndex}`, model)\n }\n });\n};\n\nexport const addModelToGroupCache = (cache: DataProxy, model: CmsEditorContentModel): void => {\n const response = cache.readQuery<ListMenuCmsGroupsQueryResponse>({\n query: LIST_MENU_CONTENT_GROUPS_MODELS\n });\n if (!response || !response.listContentModelGroups) {\n return;\n }\n\n const { listContentModelGroups: groupsList } = response;\n\n const groupIndex = groupsList.data.findIndex(g => g.id === model.group.id);\n const newGroupModelIndex = groupsList.data[groupIndex].contentModels.length;\n\n cache.writeQuery({\n query: LIST_MENU_CONTENT_GROUPS_MODELS,\n data: {\n listContentModelGroups: dotProp.set(\n groupsList,\n `data.${groupIndex}.contentModels.${newGroupModelIndex}`,\n model\n )\n }\n });\n};\n\n/**\n * This function is an ugly hack, but I don't know a better way to remove items from cache in Apollo Client v2.\n * When a Content Model is deleted, we need to remove it from cache, because a model can be recreated with the same\n * modelId, and it will cause problems, because Apollo will think that the data in cache belongs to this new model.\n */\nexport const removeModelFromCache = (\n client: ApolloClient<any>,\n model: CmsEditorContentModel\n): void => {\n const id = `CmsContentModel:${model.modelId}`;\n\n // @ts-ignore\n client.cache.data.delete(id);\n\n // @ts-ignore\n Object.keys(client.cache.data.data).forEach(key => {\n if (key.startsWith(`${id}.`) || key.startsWith(`$${id}.`)) {\n // @ts-ignore\n client.cache.data.delete(key);\n }\n });\n};\n\nexport const removeModelFromListCache = (cache: DataProxy, model: CmsEditorContentModel): void => {\n const response = cache.readQuery<ListCmsModelsQueryResponse>({\n query: LIST_CONTENT_MODELS\n });\n if (!response || !response.listContentModels) {\n return;\n }\n const { listContentModels } = response;\n const modelIndex = listContentModels.data.findIndex(m => m.modelId === model.modelId);\n\n cache.writeQuery({\n query: LIST_CONTENT_MODELS,\n data: {\n listContentModels: dotProp.delete(listContentModels, `data.${modelIndex}`)\n }\n });\n};\n\nexport const removeModelFromGroupCache = (cache: DataProxy, model: CmsEditorContentModel): void => {\n const response = cache.readQuery<ListMenuCmsGroupsQueryResponse>({\n query: LIST_MENU_CONTENT_GROUPS_MODELS\n });\n if (!response || !response.listContentModelGroups) {\n return;\n }\n const { listContentModelGroups: groupsList } = response;\n\n const groupIndex = groupsList.data.findIndex(g => g.id === model.group.id);\n if (groupIndex < 0) {\n return;\n }\n const modelIndex = groupsList.data[groupIndex].contentModels.findIndex(\n m => m.modelId === model.modelId\n );\n\n if (modelIndex < 0) {\n return;\n }\n\n cache.writeQuery({\n query: LIST_MENU_CONTENT_GROUPS_MODELS,\n data: {\n listContentModelGroups: dotProp.delete(\n groupsList,\n `data.${groupIndex}.contentModels.${modelIndex}`\n )\n }\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,aAAA,GAAAD,OAAA;AAIO,IAAME,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,KAAgB,EAAEC,KAA4B,EAAW;EACzF,IAAMC,QAAQ,GAAGF,KAAK,CAACG,SAAS,CAA6B;IACzDC,KAAK,EAAEC;EACX,CAAC,CAAC;EACF,IAAI,CAACH,QAAQ,IAAI,CAACA,QAAQ,CAACI,iBAAiB,EAAE;IAC1C;EACJ;EACA,IAAQA,iBAAiB,GA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AAA,CAAUuB,UAAU,CAAE;IAC7E;EACJ,CAAC,CAAC;AACN,CAAC;AAACtB,OAAA,CAAAqB,wBAAA,GAAAA,wBAAA;AAEK,IAAMG,yBAAyB,GAAG,SAA5BA,yBAAyBA,CAAItC,KAAgB,EAAEC,KAA4B,EAAW;EAC/F,IAAMC,QAAQ,GAAGF,KAAK,CAACG,SAAS,CAAiC;IAC7DC,KAAK,EAAEY;EACX,CAAC,CAAC;EACF,IAAI,CAACd,QAAQ,IAAI,CAACA,QAAQ,CAACe,sBAAsB,EAAE;IAC/C;EACJ;EACA,IAAgCC,UAAU,GAAKhB,QAAQ,CAA/Ce,sBAAsB;EAE9B,IAAME,UAAU,GAAGD,UAAU,CAACV,IAAI,CAACY,SAAS,CAAC,UAAAC,CAAC;IAAA,OAAIA,CAAC,CAACC,EAAE,KAAKrB,KAAK,CAACsB,KAAK,CAACD,EAAE;EAAA,EAAC;EAC1E,IAAIH,UAAU,GAAG,CAAC,EAAE;IAChB;EACJ;EACA,IAAMiB,UAAU,GAAGlB,UAAU,CAACV,IAAI,CAACW,UAAU,CAAC,CAACM,aAAa,CAACL,SAAS,CAClE,UAAAiB,CAAC;IAAA,OAAIA,CAAC,CAACT,OAAO,KAAK3B,KAAK,CAAC2B,OAAO;EAAA,CACpC,CAAC;EAED,IAAIQ,UAAU,GAAG,CAAC,EAAE;IAChB;EACJ;EAEApC,KAAK,CAACU,UAAU,CAAC;IACbN,KAAK,EAAEY,6CAA+B;IACtCR,IAAI,EAAE;MACFS,sBAAsB,EAAEN,yBAAO,CAACkB,MAAM,CAClCX,UAAU,UAAAL,MAAA,CACFM,UAAU,qBAAAN,MAAA,CAAkBuB,UAAU,CAClD;IACJ;EACJ,CAAC,CAAC;AACN,CAAC;AAACtB,OAAA,CAAAwB,yBAAA,GAAAA,yBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["disallowedModelIdEndingList","SCHEMA_TYPES","gql","createApiNameValidator","params","models","client","name","value","trim","Error","charAt","match","
|
|
1
|
+
{"version":3,"names":["_upperFirst","_interopRequireDefault","require","_camelCase","_graphqlTag","_templateObject","disallowedModelIdEndingList","SCHEMA_TYPES","gql","_taggedTemplateLiteral2","default","createApiNameValidator","params","models","client","_ref","_asyncToGenerator2","_regeneratorRuntime2","mark","_callee","name","value","transformed","_i","_disallowedModelIdEnd","ending","re","matched","_yield$client$query","data","types","wrap","_callee$","_context","prev","next","trim","Error","charAt","match","lodashUpperFirst","lodashCamelCase","concat","length","RegExp","abrupt","some","m","singularApiName","pluralApiName","query","fetchPolicy","sent","__schema","map","t","includes","stop","_x","apply","arguments","exports"],"sources":["apiNameValidator.ts"],"sourcesContent":["import lodashUpperFirst from \"lodash/upperFirst\";\nimport lodashCamelCase from \"lodash/camelCase\";\nimport gql from \"graphql-tag\";\nimport ApolloClient from \"apollo-client\";\nimport { CmsModel } from \"~/types\";\n\n/**\n * This list is to disallow creating models that might interfere with GraphQL schema creation.\n * Add more if required.\n */\nconst disallowedModelIdEndingList: string[] = [\"Response\", \"List\", \"Meta\", \"Input\", \"Sorter\"];\n\nconst SCHEMA_TYPES = gql`\n query ListSchemaTypes {\n __schema {\n types {\n name\n }\n }\n }\n`;\n\ninterface SchemaTypes {\n __schema: {\n types: { name: string }[];\n };\n}\n\ninterface Params {\n models: CmsModel[];\n client: ApolloClient<any>;\n}\n\nexport const createApiNameValidator = (params: Params) => {\n const { models, client } = params;\n return async (name: string): Promise<boolean> => {\n const value = (name || \"\").trim();\n if (!value) {\n throw new Error(\"The name is required.\");\n } else if (!value.charAt(0).match(/[a-zA-Z]/)) {\n throw new Error(\"The name can't start with a number.\");\n }\n\n const transformed = lodashUpperFirst(lodashCamelCase(value));\n if (transformed !== value) {\n throw new Error(\n `The name \"${value}\" must be in form of Upper First + Camel Cased word. For example: \"ArticleCategory\", \"ArticleAuthor\" or \"BlogCategories\".`\n );\n }\n /**\n * We need to check for models that might interfere with GraphQL schema creation.\n *\n * First, there are some reserved words that we need to check for.\n */\n for (const ending of disallowedModelIdEndingList) {\n const re = new RegExp(`${ending}$`, \"i\");\n const matched = value.match(re);\n if (matched === null) {\n continue;\n }\n throw new Error(`The name must not end with \"${ending}\".`);\n }\n /**\n * Then we check the GraphQL schema for types that might interfere with the model creation.\n */\n if (models.some(m => m.singularApiName === value)) {\n throw new Error(`\"${name}\" API name already exists. Please pick a different value.`);\n } else if (models.some(m => m.pluralApiName === value)) {\n throw new Error(`\"${name}\" API name already exists. Please pick a different value.`);\n }\n\n // Validate GraphQL Schema type\n const { data } = await client.query<SchemaTypes>({\n query: SCHEMA_TYPES,\n fetchPolicy: \"network-only\"\n });\n\n const types = data.__schema.types.map(t => t.name);\n\n if (types.includes(transformed)) {\n throw new Error(\n `\"${name}\" type already exists in the GraphQL schema. Please pick a different name.`\n );\n }\n\n return true;\n };\n};\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAA8B,IAAAG,eAAA;AAI9B;AACA;AACA;AACA;AACA,IAAMC,2BAAqC,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;AAE7F,IAAMC,YAAY,OAAGC,mBAAG,EAAAH,eAAA,KAAAA,eAAA,OAAAI,uBAAA,CAAAC,OAAA,wIAQvB;AAaM,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAIC,MAAc,EAAK;EACtD,IAAQC,MAAM,GAAaD,MAAM,CAAzBC,MAAM;IAAEC,MAAM,GAAKF,MAAM,CAAjBE,MAAM;EACtB;IAAA,IAAAC,IAAA,OAAAC,kBAAA,CAAAN,OAAA,oBAAAO,oBAAA,CAAAP,OAAA,IAAAQ,IAAA,CAAO,SAAAC,QAAOC,IAAY;MAAA,IAAAC,KAAA,EAAAC,WAAA,EAAAC,EAAA,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uC,EAAA;MAAA,OAAA3C,IAAA,CAAA4C,KAAA,OAAAC,SAAA;IAAA;EAAA;AACL,CAAC;AAACC,OAAA,CAAAlD,sBAAA,GAAAA,sBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createNameValidator","params","models","name","target","trim","Error","charAt","match","length","
|
|
1
|
+
{"version":3,"names":["_camelCase","_interopRequireDefault","require","createNameValidator","params","models","_ref","_asyncToGenerator2","default","_regeneratorRuntime2","mark","_callee","name","target","modelId","alreadyExists","wrap","_callee$","_context","prev","next","trim","Error","charAt","match","length","abrupt","lodashCamelCase","some","model","toLowerCase","stop","_x","apply","arguments","exports"],"sources":["nameValidator.ts"],"sourcesContent":["import lodashCamelCase from \"lodash/camelCase\";\nimport { CmsModel } from \"~/types\";\n\ninterface Params {\n models: CmsModel[];\n}\n\nexport const createNameValidator = (params: Params) => {\n const { models } = params;\n return async (name: string): Promise<boolean> => {\n const target = (name || \"\").trim();\n if (!target) {\n throw new Error(\"The name is required.\");\n } else if (!target.charAt(0).match(/[a-zA-Z]/)) {\n throw new Error(\"The name can't start with a number.\");\n } else if (models.length === 0) {\n return true;\n }\n\n const modelId = lodashCamelCase(target);\n const alreadyExists = models.some(model => {\n if (model.name.toLowerCase() === target.toLowerCase()) {\n return true;\n }\n return model.modelId.toLowerCase() === modelId.toLowerCase();\n });\n if (alreadyExists) {\n throw new Error(`This name is already taken.`);\n }\n\n return true;\n };\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAOO,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,MAAc,EAAK;EACnD,IAAQC,MAAM,GAAKD,MAAM,CAAjBC,MAAM;EACd;IAAA,IAAAC,IAAA,OAAAC,kBAAA,CAAAC,OAAA,oBAAAC,oBAAA,CAAAD,OAAA,IAAAE,IAAA,CAAO,SAAAC,QAAOC,IAAY;MAAA,IAAAC,MAAA,EAAAC,OAAA,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qB,EAAA;MAAA,OAAA1B,IAAA,CAAA2B,KAAA,OAAAC,SAAA;IAAA;EAAA;AACL,CAAC;AAACC,OAAA,CAAAhC,mBAAA,GAAAA,mBAAA"}
|
package/admin/views/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["deserializeSorters","data","split","field","orderBy","order","String","toLowerCase"],"sources":["utils.ts"],"sourcesContent":["type SortTypes = \"asc\" | \"desc\";\nexport const deserializeSorters = (data: string): [string, SortTypes] => {\n if (typeof data !== \"string\") {\n return data;\n }\n const [field, orderBy] = data.split(\"_\") as [string, SortTypes];\n const order = String(orderBy).toLowerCase() === \"asc\" ? \"asc\" : \"desc\";\n return [field, order];\n};\n"],"mappings":";;;;;;;;AACO,IAAMA,kBAAkB,GAAG,SAArBA,
|
|
1
|
+
{"version":3,"names":["deserializeSorters","data","_ref","split","_ref2","_slicedToArray2","default","field","orderBy","order","String","toLowerCase","exports"],"sources":["utils.ts"],"sourcesContent":["type SortTypes = \"asc\" | \"desc\";\nexport const deserializeSorters = (data: string): [string, SortTypes] => {\n if (typeof data !== \"string\") {\n return data;\n }\n const [field, orderBy] = data.split(\"_\") as [string, SortTypes];\n const order = String(orderBy).toLowerCase() === \"asc\" ? \"asc\" : \"desc\";\n return [field, order];\n};\n"],"mappings":";;;;;;;;AACO,IAAMA,kBAAkB,GAAG,SAArBA,kBAAkBA,CAAIC,IAAY,EAA0B;EACrE,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;IAC1B,OAAOA,IAAI;EACf;EACA,IAAAC,IAAA,GAAyBD,IAAI,CAACE,KAAK,CAAC,GAAG,CAAC;IAAAC,KAAA,OAAAC,eAAA,CAAAC,OAAA,EAAAJ,IAAA;IAAjCK,KAAK,GAAAH,KAAA;IAAEI,OAAO,GAAAJ,KAAA;EACrB,IAAMK,KAAK,GAAGC,MAAM,CAACF,OAAO,CAAC,CAACG,WAAW,CAAC,CAAC,KAAK,KAAK,GAAG,KAAK,GAAG,MAAM;EACtE,OAAO,CAACJ,KAAK,EAAEE,KAAK,CAAC;AACzB,CAAC;AAACG,OAAA,CAAAZ,kBAAA,GAAAA,kBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ERROR_FIELDS","BASE_CONTENT_MODEL_FIELDS","LIST_MENU_CONTENT_GROUPS_MODELS","gql","LIST_CONTENT_MODELS","CREATE_CONTENT_MODEL","CREATE_CONTENT_MODEL_FROM","DELETE_CONTENT_MODEL"],"sources":["viewsGraphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { CmsErrorResponse, CmsGroup, CmsModel } from \"~/types\";\n\nconst ERROR_FIELDS = `\n code\n message\n data\n`;\n\nconst BASE_CONTENT_MODEL_FIELDS = `\n description\n modelId\n singularApiName\n pluralApiName\n name\n icon\n savedOn\n plugin\n tags\n fields {\n id\n type\n fieldId\n }\n group {\n id\n name\n }\n createdBy {\n id\n displayName\n type\n }\n`;\n\n/**\n * ############################\n * List groups with models Query\n * * Fetches data needed for constructing content models list in the main menu.\n */\nexport interface ListMenuCmsGroupsQueryResponse {\n listContentModelGroups: {\n data: CmsGroup[];\n error?: CmsErrorResponse;\n };\n}\n\nexport const LIST_MENU_CONTENT_GROUPS_MODELS = gql`\n query CmsListMenuContentGroupsModels {\n listContentModelGroups {\n data {\n id\n name\n icon\n plugin\n contentModels {\n name\n modelId\n singularApiName\n pluralApiName\n plugin\n icon\n createdBy {\n id\n displayName\n type\n }\n }\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n`;\n\n/**\n * ############################\n * List Query\n */\nexport interface ListCmsModelsQueryResponse {\n listContentModels: {\n data: CmsModel[];\n error?: CmsErrorResponse;\n };\n}\n\nexport const LIST_CONTENT_MODELS = gql`\n query CmsListContentModels {\n listContentModels {\n data {\n ${BASE_CONTENT_MODEL_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n`;\n\n/**\n * ############################\n * Create Mutation\n */\nexport interface CreateCmsModelMutationResponse {\n createContentModel: {\n data: CmsModel;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CreateCmsModelMutationVariables {\n // @ts-refactor write the types.\n data: Record<string, any>;\n}\n\nexport const CREATE_CONTENT_MODEL = gql`\n mutation CmsCreateContentModel($data: CmsContentModelCreateInput!) {\n createContentModel(data: $data) {\n data {\n ${BASE_CONTENT_MODEL_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n`;\n\n/**\n * ############################\n * Create From Mutation\n */\nexport interface CreateCmsModelFromMutationResponse {\n createContentModelFrom: {\n data: CmsModel;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CreateCmsModelFromMutationVariables {\n modelId: string;\n data: CmsModel;\n}\n\nexport const CREATE_CONTENT_MODEL_FROM = gql`\n mutation CmsCreateContentModelFrom($modelId: ID!, $data: CmsContentModelCreateFromInput!) {\n createContentModelFrom(modelId: $modelId, data: $data) {\n data {\n ${BASE_CONTENT_MODEL_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n`;\n\n/**\n * ############################\n * Delete Mutation\n */\nexport interface DeleteCmsModelMutationResponse {\n deleteContentModel: {\n data: boolean;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface DeleteCmsModelMutationVariables {\n modelId: string;\n}\n\nexport const DELETE_CONTENT_MODEL = gql`\n mutation CmsDeleteContentModel($modelId: ID!) {\n deleteContentModel(modelId: $modelId) {\n data\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n`;\n"],"mappings":";;;;;;;;AAAA;AAA8B;AAG9B,
|
|
1
|
+
{"version":3,"names":["_graphqlTag","_interopRequireDefault","require","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","ERROR_FIELDS","BASE_CONTENT_MODEL_FIELDS","LIST_MENU_CONTENT_GROUPS_MODELS","gql","_taggedTemplateLiteral2","default","exports","LIST_CONTENT_MODELS","CREATE_CONTENT_MODEL","CREATE_CONTENT_MODEL_FROM","DELETE_CONTENT_MODEL"],"sources":["viewsGraphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { CmsErrorResponse, CmsGroup, CmsModel } from \"~/types\";\n\nconst ERROR_FIELDS = `\n code\n message\n data\n`;\n\nconst BASE_CONTENT_MODEL_FIELDS = `\n description\n modelId\n singularApiName\n pluralApiName\n name\n icon\n savedOn\n plugin\n tags\n fields {\n id\n type\n fieldId\n }\n group {\n id\n name\n }\n createdBy {\n id\n displayName\n type\n }\n`;\n\n/**\n * ############################\n * List groups with models Query\n * * Fetches data needed for constructing content models list in the main menu.\n */\nexport interface ListMenuCmsGroupsQueryResponse {\n listContentModelGroups: {\n data: CmsGroup[];\n error?: CmsErrorResponse;\n };\n}\n\nexport const LIST_MENU_CONTENT_GROUPS_MODELS = gql`\n query CmsListMenuContentGroupsModels {\n listContentModelGroups {\n data {\n id\n name\n icon\n plugin\n contentModels {\n name\n modelId\n singularApiName\n pluralApiName\n plugin\n icon\n createdBy {\n id\n displayName\n type\n }\n }\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n`;\n\n/**\n * ############################\n * List Query\n */\nexport interface ListCmsModelsQueryResponse {\n listContentModels: {\n data: CmsModel[];\n error?: CmsErrorResponse;\n };\n}\n\nexport const LIST_CONTENT_MODELS = gql`\n query CmsListContentModels {\n listContentModels {\n data {\n ${BASE_CONTENT_MODEL_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n`;\n\n/**\n * ############################\n * Create Mutation\n */\nexport interface CreateCmsModelMutationResponse {\n createContentModel: {\n data: CmsModel;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CreateCmsModelMutationVariables {\n // @ts-refactor write the types.\n data: Record<string, any>;\n}\n\nexport const CREATE_CONTENT_MODEL = gql`\n mutation CmsCreateContentModel($data: CmsContentModelCreateInput!) {\n createContentModel(data: $data) {\n data {\n ${BASE_CONTENT_MODEL_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n`;\n\n/**\n * ############################\n * Create From Mutation\n */\nexport interface CreateCmsModelFromMutationResponse {\n createContentModelFrom: {\n data: CmsModel;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface CreateCmsModelFromMutationVariables {\n modelId: string;\n data: CmsModel;\n}\n\nexport const CREATE_CONTENT_MODEL_FROM = gql`\n mutation CmsCreateContentModelFrom($modelId: ID!, $data: CmsContentModelCreateFromInput!) {\n createContentModelFrom(modelId: $modelId, data: $data) {\n data {\n ${BASE_CONTENT_MODEL_FIELDS}\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n`;\n\n/**\n * ############################\n * Delete Mutation\n */\nexport interface DeleteCmsModelMutationResponse {\n deleteContentModel: {\n data: boolean;\n error?: CmsErrorResponse;\n };\n}\n\nexport interface DeleteCmsModelMutationVariables {\n modelId: string;\n}\n\nexport const DELETE_CONTENT_MODEL = gql`\n mutation CmsDeleteContentModel($modelId: ID!) {\n deleteContentModel(modelId: $modelId) {\n data\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n`;\n"],"mappings":";;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8B,IAAAC,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA;AAG9B,IAAMC,YAAY,wCAIjB;AAED,IAAMC,yBAAyB,yTAwB9B;;AAED;AACA;AACA;AACA;AACA;;AAQO,IAAMC,+BAA+B,OAAGC,mBAAG,EAAAR,eAAA,KAAAA,eAAA,OAAAS,uBAAA,CAAAC,OAAA,iqBAuBhCL,YAAY,CAI7B;;AAED;AACA;AACA;AACA;AAHAM,OAAA,CAAAJ,+BAAA,GAAAA,+BAAA;AAWO,IAAMK,mBAAmB,OAAGJ,mBAAG,EAAAP,gBAAA,KAAAA,gBAAA,OAAAQ,uBAAA,CAAAC,OAAA,gNAIpBJ,yBAAyB,EAGzBD,YAAY,CAI7B;;AAED;AACA;AACA;AACA;AAHAM,OAAA,CAAAC,mBAAA,GAAAA,mBAAA;AAgBO,IAAMC,oBAAoB,OAAGL,mBAAG,EAAAN,gBAAA,KAAAA,gBAAA,OAAAO,uBAAA,CAAAC,OAAA,sQAIrBJ,yBAAyB,EAGzBD,YAAY,CAI7B;;AAED;AACA;AACA;AACA;AAHAM,OAAA,CAAAE,oBAAA,GAAAA,oBAAA;AAgBO,IAAMC,yBAAyB,OAAGN,mBAAG,EAAAL,gBAAA,KAAAA,gBAAA,OAAAM,uBAAA,CAAAC,OAAA,oTAI1BJ,yBAAyB,EAGzBD,YAAY,CAI7B;;AAED;AACA;AACA;AACA;AAHAM,OAAA,CAAAG,yBAAA,GAAAA,yBAAA;AAeO,IAAMC,oBAAoB,OAAGP,mBAAG,EAAAJ,gBAAA,KAAAA,gBAAA,OAAAK,uBAAA,CAAAC,OAAA,gNAKrBL,YAAY,CAI7B;AAACM,OAAA,CAAAI,oBAAA,GAAAA,oBAAA"}
|
package/allPlugins.d.ts
CHANGED
|
@@ -1,32 +1,22 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const _default: (import("
|
|
2
|
+
declare const _default: (import("@webiny/app-headless-cms-common/types").CmsModelFieldRegexValidatorExpressionPlugin | import("@webiny/app-headless-cms-common/types").CmsModelFieldRendererPlugin | import("@webiny/app-headless-cms-common/types").CmsModelFieldTypePlugin | import("@webiny/app-headless-cms-common/types").CmsModelFieldRendererPlugin[] | import("@webiny/app-headless-cms-common/types").CmsModelFieldValidatorPlugin<any> | (import("@webiny/app-headless-cms-common/types").CmsEditorFormSettingsPlugin | import("@webiny/app-headless-cms-common/types").CmsIconsPlugin | import("@webiny/app-admin/types").AdminInstallationPlugin | import("@webiny/app-admin/types").AdminAppPermissionRendererPlugin | import("@webiny/app-headless-cms-common/types").CmsFieldValueTransformer<{
|
|
3
3
|
id: string;
|
|
4
4
|
type: string;
|
|
5
5
|
fieldId: string;
|
|
6
6
|
storageId?: string | undefined;
|
|
7
|
-
label
|
|
7
|
+
label: string;
|
|
8
8
|
helpText?: string | undefined;
|
|
9
9
|
placeholderText?: string | undefined;
|
|
10
|
-
validation?: import("
|
|
11
|
-
listValidation?: import("
|
|
10
|
+
validation?: import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator[] | undefined;
|
|
11
|
+
listValidation?: import("@webiny/app-headless-cms-common/types").CmsModelFieldValidator[] | undefined;
|
|
12
12
|
multipleValues?: boolean | undefined;
|
|
13
|
-
predefinedValues?: import("
|
|
14
|
-
settings?:
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
defaultValue?: string | null | undefined;
|
|
17
|
-
defaultSetValue?: string | undefined;
|
|
18
|
-
type?: string | undefined;
|
|
19
|
-
fields?: any[] | undefined;
|
|
20
|
-
layout?: string[][] | undefined;
|
|
21
|
-
models?: Pick<import("./types").CmsModel, "modelId">[] | undefined;
|
|
22
|
-
templates?: import("./types").CmsDynamicZoneTemplate[] | undefined;
|
|
23
|
-
imagesOnly?: boolean | undefined;
|
|
24
|
-
} | undefined;
|
|
13
|
+
predefinedValues?: import("@webiny/app-headless-cms-common/types").CmsEditorFieldPredefinedValues | undefined;
|
|
14
|
+
settings?: import("@webiny/app-headless-cms-common/types").CmsModelFieldSettings<unknown> | undefined;
|
|
25
15
|
renderer: {
|
|
26
16
|
name: string;
|
|
27
|
-
};
|
|
17
|
+
} | ((props: import("@webiny/app-headless-cms-common/types").CmsModelFieldRendererProps) => import("react").ReactNode);
|
|
28
18
|
tags?: string[] | undefined;
|
|
29
|
-
}>[] | import("@webiny/app/types").RoutePlugin[] | import("@webiny/app").ApolloCacheObjectIdPlugin<import("@webiny/app/plugins/ApolloCacheObjectIdPlugin").ApolloCacheObject> |
|
|
19
|
+
}>[] | import("@webiny/app/types").RoutePlugin[] | import("@webiny/app").ApolloCacheObjectIdPlugin<import("@webiny/app/plugins/ApolloCacheObjectIdPlugin").ApolloCacheObject> | {
|
|
30
20
|
name: string;
|
|
31
21
|
type: string;
|
|
32
22
|
render(): JSX.Element;
|
package/allPlugins.js
CHANGED
|
@@ -18,7 +18,8 @@ var _object = _interopRequireDefault(require("./admin/plugins/fields/object"));
|
|
|
18
18
|
var _number2 = _interopRequireDefault(require("./admin/plugins/fieldRenderers/number"));
|
|
19
19
|
var _text2 = _interopRequireDefault(require("./admin/plugins/fieldRenderers/text"));
|
|
20
20
|
var _longText2 = _interopRequireDefault(require("./admin/plugins/fieldRenderers/longText"));
|
|
21
|
-
var _richText2 =
|
|
21
|
+
var _richText2 = require("./admin/plugins/fieldRenderers/richText");
|
|
22
|
+
var _lexicalText = require("./admin/plugins/fieldRenderers/lexicalText");
|
|
22
23
|
var _boolean2 = _interopRequireDefault(require("./admin/plugins/fieldRenderers/boolean"));
|
|
23
24
|
var _dateTime2 = _interopRequireDefault(require("./admin/plugins/fieldRenderers/dateTime"));
|
|
24
25
|
var _file2 = _interopRequireDefault(require("./admin/plugins/fieldRenderers/file"));
|
|
@@ -47,5 +48,5 @@ var _welcomeScreenWidget = _interopRequireDefault(require("./admin/plugins/welco
|
|
|
47
48
|
var _dynamicZone = require("./admin/plugins/fields/dynamicZone");
|
|
48
49
|
var _dynamicZoneRenderer = require("./admin/plugins/fieldRenderers/dynamicZone/dynamicZoneRenderer");
|
|
49
50
|
var _dynamicZone2 = require("./admin/plugins/fieldValidators/dynamicZone");
|
|
50
|
-
var _default = [(0, _plugins.default)(), _text.default, _longText.default, _richText.default, _number.default, _boolean.default, _dateTime.default, _file.default, _ref.default, _number2.default, _text2.default, _longText2.default, _richText2.
|
|
51
|
+
var _default = [(0, _plugins.default)(), _text.default, _longText.default, _richText.default, _number.default, _boolean.default, _dateTime.default, _file.default, (0, _lexicalText.createLexicalInput)(), _ref.default, _number2.default, _text2.default, _longText2.default, (0, _richText2.createLegacyRichTextInput)(), _boolean2.default, _dateTime2.default, _file2.default, _radioButtons.default, _select.default, _checkboxes.default, _ref2.default, _gte.default, (0, _dateGte.default)(), (0, _dateLte.default)(), _in.default, _lte.default, _required.default, (0, _unique.default)(), _minLength.default, _maxLength.default, _pattern.default, _email.default, _url.default, _lowerCase.default, _upperCase.default, _lowerCaseSpace.default, _upperCaseSpace.default, _dynamicZone2.dynamicZoneFieldValidator, _welcomeScreenWidget.default, _object.default, _object2.default, _dynamicZone.dynamicZoneField, _dynamicZoneRenderer.dynamicZoneFieldRenderer];
|
|
51
52
|
exports.default = _default;
|
package/allPlugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["headlessCmsPlugins","textField","longTextField","richTextField","numberField","booleanField","dateTimeField","fileField","refField","numberFieldRenderer","textFieldRenderer","longTextFieldRenderer","
|
|
1
|
+
{"version":3,"names":["_plugins","_interopRequireDefault","require","_text","_longText","_richText","_number","_boolean","_dateTime","_file","_ref","_object","_number2","_text2","_longText2","_richText2","_lexicalText","_boolean2","_dateTime2","_file2","_radioButtons","_select","_checkboxes","_ref2","_object2","_gte","_dateGte","_dateLte","_in","_lte","_required","_unique","_minLength","_maxLength","_pattern","_email","_url","_lowerCase","_upperCase","_lowerCaseSpace","_upperCaseSpace","_welcomeScreenWidget","_dynamicZone","_dynamicZoneRenderer","_dynamicZone2","_default","headlessCmsPlugins","textField","longTextField","richTextField","numberField","booleanField","dateTimeField","fileField","createLexicalInput","refField","numberFieldRenderer","textFieldRenderer","longTextFieldRenderer","createLegacyRichTextInput","booleanFieldRenderer","dateTimeFieldRenderer","fileFieldRenderer","radioButtonsFieldRenderer","selectFieldRenderer","checkboxesFieldRenderer","refFieldRenderer","editorGteFieldValidator","editorDateGteFieldValidator","editorDateLteFieldValidator","editorInValidatorFieldValidator","editorLteFieldValidator","editorRequiredFieldValidator","editorUniqueFieldValidator","editorMinLengthFieldValidator","editorMaxLengthFieldValidator","editorPatternFieldValidator","editorEmailFieldValidator","editorUrlFieldValidator","editorLowerCaseFieldValidator","editorUpperCaseFieldValidator","editorLowerCaseSpaceFieldValidator","editorUpperCaseSpaceFieldValidator","dynamicZoneFieldValidator","welcomeScreenWidget","objectField","objectFieldRenderer","dynamicZoneField","dynamicZoneFieldRenderer","exports","default"],"sources":["allPlugins.ts"],"sourcesContent":["import headlessCmsPlugins from \"~/admin/plugins\";\nimport textField from \"~/admin/plugins/fields/text\";\nimport longTextField from \"~/admin/plugins/fields/longText\";\nimport richTextField from \"~/admin/plugins/fields/richText\";\nimport numberField from \"~/admin/plugins/fields/number\";\nimport booleanField from \"~/admin/plugins/fields/boolean\";\nimport dateTimeField from \"~/admin/plugins/fields/dateTime\";\nimport fileField from \"~/admin/plugins/fields/file\";\nimport refField from \"~/admin/plugins/fields/ref\";\nimport objectField from \"~/admin/plugins/fields/object\";\n\nimport numberFieldRenderer from \"~/admin/plugins/fieldRenderers/number\";\nimport textFieldRenderer from \"~/admin/plugins/fieldRenderers/text\";\nimport longTextFieldRenderer from \"~/admin/plugins/fieldRenderers/longText\";\nimport { createLegacyRichTextInput } from \"~/admin/plugins/fieldRenderers/richText\";\nimport { createLexicalInput } from \"~/admin/plugins/fieldRenderers/lexicalText\";\nimport booleanFieldRenderer from \"~/admin/plugins/fieldRenderers/boolean\";\nimport dateTimeFieldRenderer from \"~/admin/plugins/fieldRenderers/dateTime\";\nimport fileFieldRenderer from \"~/admin/plugins/fieldRenderers/file\";\nimport radioButtonsFieldRenderer from \"~/admin/plugins/fieldRenderers/radioButtons\";\nimport selectFieldRenderer from \"~/admin/plugins/fieldRenderers/select\";\nimport checkboxesFieldRenderer from \"~/admin/plugins/fieldRenderers/checkboxes\";\nimport refFieldRenderer from \"~/admin/plugins/fieldRenderers/ref\";\nimport objectFieldRenderer from \"~/admin/plugins/fieldRenderers/object\";\n\nimport editorGteFieldValidator from \"~/admin/plugins/fieldValidators/gte\";\nimport editorDateGteFieldValidator from \"~/admin/plugins/fieldValidators/dateGte\";\nimport editorDateLteFieldValidator from \"~/admin/plugins/fieldValidators/dateLte\";\nimport editorInValidatorFieldValidator from \"~/admin/plugins/fieldValidators/in\";\nimport editorLteFieldValidator from \"~/admin/plugins/fieldValidators/lte\";\nimport editorRequiredFieldValidator from \"~/admin/plugins/fieldValidators/required\";\nimport editorUniqueFieldValidator from \"~/admin/plugins/fieldValidators/unique\";\nimport editorMinLengthFieldValidator from \"~/admin/plugins/fieldValidators/minLength\";\nimport editorMaxLengthFieldValidator from \"~/admin/plugins/fieldValidators/maxLength\";\nimport editorPatternFieldValidator from \"~/admin/plugins/fieldValidators/pattern\";\nimport editorEmailFieldValidator from \"~/admin/plugins/fieldValidators/patternPlugins/email\";\nimport editorUrlFieldValidator from \"~/admin/plugins/fieldValidators/patternPlugins/url\";\nimport editorLowerCaseFieldValidator from \"~/admin/plugins/fieldValidators/patternPlugins/lowerCase\";\nimport editorUpperCaseFieldValidator from \"~/admin/plugins/fieldValidators/patternPlugins/upperCase\";\nimport editorLowerCaseSpaceFieldValidator from \"~/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace\";\nimport editorUpperCaseSpaceFieldValidator from \"~/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace\";\nimport welcomeScreenWidget from \"~/admin/plugins/welcomeScreenWidget\";\nimport { dynamicZoneField } from \"~/admin/plugins/fields/dynamicZone\";\nimport { dynamicZoneFieldRenderer } from \"~/admin/plugins/fieldRenderers/dynamicZone/dynamicZoneRenderer\";\nimport { dynamicZoneFieldValidator } from \"~/admin/plugins/fieldValidators/dynamicZone\";\n\nexport default [\n headlessCmsPlugins(),\n textField,\n longTextField,\n richTextField,\n numberField,\n booleanField,\n dateTimeField,\n fileField,\n createLexicalInput(),\n refField,\n numberFieldRenderer,\n textFieldRenderer,\n longTextFieldRenderer,\n createLegacyRichTextInput(),\n booleanFieldRenderer,\n dateTimeFieldRenderer,\n fileFieldRenderer,\n radioButtonsFieldRenderer,\n selectFieldRenderer,\n checkboxesFieldRenderer,\n refFieldRenderer,\n editorGteFieldValidator,\n editorDateGteFieldValidator(),\n editorDateLteFieldValidator(),\n editorInValidatorFieldValidator,\n editorLteFieldValidator,\n editorRequiredFieldValidator,\n editorUniqueFieldValidator(),\n editorMinLengthFieldValidator,\n editorMaxLengthFieldValidator,\n editorPatternFieldValidator,\n editorEmailFieldValidator,\n editorUrlFieldValidator,\n editorLowerCaseFieldValidator,\n editorUpperCaseFieldValidator,\n editorLowerCaseSpaceFieldValidator,\n editorUpperCaseSpaceFieldValidator,\n dynamicZoneFieldValidator,\n welcomeScreenWidget,\n objectField,\n objectFieldRenderer,\n dynamicZoneField,\n dynamicZoneFieldRenderer\n];\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,OAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,QAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,KAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,IAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,OAAA,GAAAV,sBAAA,CAAAC,OAAA;AAEA,IAAAU,QAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,MAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,UAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,UAAA,GAAAb,OAAA;AACA,IAAAc,YAAA,GAAAd,OAAA;AACA,IAAAe,SAAA,GAAAhB,sBAAA,CAAAC,OAAA;AACA,IAAAgB,UAAA,GAAAjB,sBAAA,CAAAC,OAAA;AACA,IAAAiB,MAAA,GAAAlB,sBAAA,CAAAC,OAAA;AACA,IAAAkB,aAAA,GAAAnB,sBAAA,CAAAC,OAAA;AACA,IAAAmB,OAAA,GAAApB,sBAAA,CAAAC,OAAA;AACA,IAAAoB,WAAA,GAAArB,sBAAA,CAAAC,OAAA;AACA,IAAAqB,KAAA,GAAAtB,sBAAA,C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AAC,oCAAyB,EAAC,CAAC,EAC3BC,iBAAoB,EACpBC,kBAAqB,EACrBC,cAAiB,EACjBC,qBAAyB,EACzBC,eAAmB,EACnBC,mBAAuB,EACvBC,aAAgB,EAChBC,YAAuB,EACvB,IAAAC,gBAA2B,EAAC,CAAC,EAC7B,IAAAC,gBAA2B,EAAC,CAAC,EAC7BC,WAA+B,EAC/BC,YAAuB,EACvBC,iBAA4B,EAC5B,IAAAC,eAA0B,EAAC,CAAC,EAC5BC,kBAA6B,EAC7BC,kBAA6B,EAC7BC,gBAA2B,EAC3BC,cAAyB,EACzBC,YAAuB,EACvBC,kBAA6B,EAC7BC,kBAA6B,EAC7BC,uBAAkC,EAClCC,uBAAkC,EAClCC,uCAAyB,EACzBC,4BAAmB,EACnBC,eAAW,EACXC,gBAAmB,EACnBC,6BAAgB,EAChBC,6CAAwB,CAC3B;AAAAC,OAAA,CAAAC,OAAA,GAAA7C,QAAA"}
|
package/index.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
export * from "./HeadlessCMS";
|
|
3
|
+
export * from "./admin/hooks";
|
|
4
|
+
export { LexicalEditorConfig } from "./admin/lexicalConfig/LexicalEditorConfig";
|
|
5
|
+
export { RenderFieldElement } from "./admin/components/ContentEntryForm/RenderFieldElement";
|
|
6
|
+
import { ContentEntryEditorConfig, ContentEntryListConfig } from "./admin/config/contentEntries";
|
|
7
|
+
export { ContentEntryEditorConfig, ContentEntryListConfig };
|
|
2
8
|
/**
|
|
3
|
-
*
|
|
4
|
-
* The following exports are experimental and can change in the future!
|
|
5
|
-
* You CAN use them, but the API may change in the future. Migration instructions will be included
|
|
6
|
-
* with the release that breaks them, so you won't be left alone in the dark :)
|
|
7
|
-
*
|
|
8
|
-
* These exports contain components to experiment with configurable views (currently only ContentEntries view).
|
|
9
|
+
* @deprecated Use ContentEntryListConfig instead
|
|
9
10
|
*/
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
export declare const ContentEntriesViewConfig: React.FC<{}> & {
|
|
12
|
+
Filter: import("@webiny/react-composition").ComposableFC<import("./admin/config/contentEntries/list/Browser/Filter").FilterProps> & {
|
|
13
|
+
createDecorator: (decorator: import("@webiny/react-composition").Decorator<import("./admin/config/contentEntries/list/Browser/Filter").FilterProps>) => (props: import("./admin/config/contentEntries/list/Browser/Filter").CreateDecoratorParams) => JSX.Element;
|
|
14
|
+
};
|
|
15
|
+
Sorter: (props: any) => null;
|
|
16
|
+
};
|