@webiny/app-headless-cms 0.0.0-mt-3 → 0.0.0-unstable.2af142b57e
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.d.ts +13 -0
- package/HeadlessCMS.js +45 -0
- package/HeadlessCMS.js.map +1 -0
- package/admin/components/ContentEntryForm/ContentEntryForm.d.ts +2 -2
- package/admin/components/ContentEntryForm/ContentEntryForm.js +129 -48
- package/admin/components/ContentEntryForm/ContentEntryForm.js.map +1 -0
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.d.ts +2 -2
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.js +42 -19
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.js.map +1 -0
- package/admin/components/ContentEntryForm/Fields.d.ts +5 -6
- package/admin/components/ContentEntryForm/Fields.js +21 -15
- package/admin/components/ContentEntryForm/Fields.js.map +1 -0
- package/admin/components/ContentEntryForm/Label.d.ts +2 -4
- package/admin/components/ContentEntryForm/Label.js +18 -12
- package/admin/components/ContentEntryForm/Label.js.map +1 -0
- package/admin/components/ContentEntryForm/RenderFieldElement.d.ts +6 -5
- package/admin/components/ContentEntryForm/RenderFieldElement.js +29 -24
- package/admin/components/ContentEntryForm/RenderFieldElement.js.map +1 -0
- package/admin/components/ContentEntryForm/functions/getValue.d.ts +9 -5
- package/admin/components/ContentEntryForm/functions/getValue.js +12 -9
- package/admin/components/ContentEntryForm/functions/getValue.js.map +1 -0
- package/admin/components/ContentEntryForm/functions/setValue.d.ts +10 -6
- package/admin/components/ContentEntryForm/functions/setValue.js +15 -9
- package/admin/components/ContentEntryForm/functions/setValue.js.map +1 -0
- package/admin/components/ContentEntryForm/useBind.d.ts +7 -7
- package/admin/components/ContentEntryForm/useBind.js +61 -39
- package/admin/components/ContentEntryForm/useBind.js.map +1 -0
- package/admin/components/ContentEntryForm/useContentEntryForm.d.ts +4 -6
- package/admin/components/ContentEntryForm/useContentEntryForm.js +396 -294
- package/admin/components/ContentEntryForm/useContentEntryForm.js.map +1 -0
- package/admin/components/ContentEntryForm/useRenderPlugins.js +11 -5
- package/admin/components/ContentEntryForm/useRenderPlugins.js.map +1 -0
- package/admin/components/ContentModelEditor/ContentModelEditorProvider.d.ts +40 -0
- package/admin/components/ContentModelEditor/ContentModelEditorProvider.js +260 -0
- package/admin/components/ContentModelEditor/ContentModelEditorProvider.js.map +1 -0
- package/admin/components/ContentModelEditor/Editor.d.ts +3 -2
- package/admin/components/ContentModelEditor/Editor.js +69 -65
- package/admin/components/ContentModelEditor/Editor.js.map +1 -0
- package/admin/components/ContentModelEditor/FieldsSidebar.d.ts +6 -4
- package/admin/components/ContentModelEditor/FieldsSidebar.js +37 -31
- package/admin/components/ContentModelEditor/FieldsSidebar.js.map +1 -0
- package/admin/components/ContentModelEditor/Header.d.ts +3 -2
- package/admin/components/ContentModelEditor/Header.js +20 -11
- package/admin/components/ContentModelEditor/Header.js.map +1 -0
- package/admin/components/ContentModelEditor/PreviewTab.js +25 -21
- package/admin/components/ContentModelEditor/PreviewTab.js.map +1 -0
- package/admin/components/ContentModelEditor/index.d.ts +2 -0
- package/admin/components/ContentModelEditor/index.js +27 -0
- package/admin/components/ContentModelEditor/index.js.map +1 -0
- package/admin/components/ContentModelEditor/useModelEditor.d.ts +1 -0
- package/admin/components/ContentModelEditor/useModelEditor.js +16 -0
- package/admin/components/ContentModelEditor/useModelEditor.js.map +1 -0
- package/admin/components/DelayedOnChange.d.ts +42 -0
- package/admin/components/DelayedOnChange.js +110 -0
- package/admin/components/DelayedOnChange.js.map +1 -0
- package/admin/components/Dialog.d.ts +4 -0
- package/admin/components/Dialog.js +28 -0
- package/admin/components/Dialog.js.map +1 -0
- package/admin/components/DragPreview.d.ts +3 -2
- package/admin/components/DragPreview.js +42 -38
- package/admin/components/DragPreview.js.map +1 -0
- package/admin/components/Draggable.d.ts +9 -6
- package/admin/components/Draggable.js +45 -40
- package/admin/components/Draggable.js.map +1 -0
- package/admin/components/DropZone/Center.d.ts +7 -6
- package/admin/components/DropZone/Center.js +50 -52
- package/admin/components/DropZone/Center.js.map +1 -0
- package/admin/components/DropZone/Horizontal.d.ts +7 -5
- package/admin/components/DropZone/Horizontal.js +29 -26
- package/admin/components/DropZone/Horizontal.js.map +1 -0
- package/admin/components/DropZone/Vertical.d.ts +4 -4
- package/admin/components/DropZone/Vertical.js +28 -24
- package/admin/components/DropZone/Vertical.js.map +1 -0
- package/admin/components/DropZone/index.js +27 -4
- package/admin/components/DropZone/index.js.map +1 -0
- package/admin/components/Droppable.d.ts +23 -12
- package/admin/components/Droppable.js +48 -34
- package/admin/components/Droppable.js.map +1 -0
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.d.ts +1 -1
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.js +54 -46
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.js.map +1 -0
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.d.ts +1 -8
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.js +88 -69
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.js.map +1 -0
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.d.ts +3 -5
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.js +61 -35
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.js.map +1 -0
- package/admin/components/FieldEditor/EditFieldDialog/ValidationsSection.d.ts +10 -0
- package/admin/components/FieldEditor/EditFieldDialog/ValidationsSection.js +34 -0
- package/admin/components/FieldEditor/EditFieldDialog/ValidationsSection.js.map +1 -0
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsList.d.ts +8 -0
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsList.js +189 -0
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsList.js.map +1 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.d.ts +7 -5
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.js +14 -10
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.js.map +1 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.d.ts +8 -6
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.js +17 -14
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.js.map +1 -0
- package/admin/components/FieldEditor/EditFieldDialog/getValidators.d.ts +13 -0
- package/admin/components/FieldEditor/EditFieldDialog/getValidators.js +91 -0
- package/admin/components/FieldEditor/EditFieldDialog/getValidators.js.map +1 -0
- package/admin/components/FieldEditor/EditFieldDialog.d.ts +8 -8
- package/admin/components/FieldEditor/EditFieldDialog.js +133 -220
- package/admin/components/FieldEditor/EditFieldDialog.js.map +1 -0
- package/admin/components/FieldEditor/Field.d.ts +8 -1
- package/admin/components/FieldEditor/Field.js +117 -106
- package/admin/components/FieldEditor/Field.js.map +1 -0
- package/admin/components/FieldEditor/FieldEditor.d.ts +6 -6
- package/admin/components/FieldEditor/FieldEditor.js +126 -81
- package/admin/components/FieldEditor/FieldEditor.js.map +1 -0
- package/admin/components/FieldEditor/FieldEditorContext.d.ts +79 -30
- package/admin/components/FieldEditor/FieldEditorContext.js +150 -124
- package/admin/components/FieldEditor/FieldEditorContext.js.map +1 -0
- package/admin/components/FieldEditor/Styled.d.ts +4 -2
- package/admin/components/FieldEditor/Styled.js +23 -20
- package/admin/components/FieldEditor/Styled.js.map +1 -0
- package/admin/components/FieldEditor/index.d.ts +1 -1
- package/admin/components/FieldEditor/index.js +19 -2
- package/admin/components/FieldEditor/index.js.map +1 -0
- package/admin/components/FieldEditor/useModelFieldEditor.d.ts +2 -0
- package/admin/components/FieldEditor/useModelFieldEditor.js +15 -0
- package/admin/components/FieldEditor/useModelFieldEditor.js.map +1 -0
- package/admin/components/FieldEditor/utils/deleteField.d.ts +6 -8
- package/admin/components/FieldEditor/utils/deleteField.js +21 -12
- package/admin/components/FieldEditor/utils/deleteField.js.map +1 -0
- package/admin/components/FieldEditor/utils/getFieldPosition.d.ts +6 -5
- package/admin/components/FieldEditor/utils/getFieldPosition.js +14 -9
- package/admin/components/FieldEditor/utils/getFieldPosition.js.map +1 -0
- package/admin/components/FieldEditor/utils/index.js +34 -4
- package/admin/components/FieldEditor/utils/index.js.map +1 -0
- package/admin/components/FieldEditor/utils/moveField.d.ts +6 -5
- package/admin/components/FieldEditor/utils/moveField.js +37 -31
- package/admin/components/FieldEditor/utils/moveField.js.map +1 -0
- package/admin/components/FieldEditor/utils/moveRow.d.ts +5 -6
- package/admin/components/FieldEditor/utils/moveRow.js +16 -8
- package/admin/components/FieldEditor/utils/moveRow.js.map +1 -0
- package/admin/components/IconPicker.d.ts +7 -0
- package/admin/components/IconPicker.js +213 -0
- package/admin/components/IconPicker.js.map +1 -0
- package/admin/components/ModelFieldProvider/ModelFieldContext.d.ts +36 -0
- package/admin/components/ModelFieldProvider/ModelFieldContext.js +18 -0
- package/admin/components/ModelFieldProvider/ModelFieldContext.js.map +1 -0
- package/admin/components/ModelFieldProvider/index.d.ts +2 -0
- package/admin/components/ModelFieldProvider/index.js +27 -0
- package/admin/components/ModelFieldProvider/index.js.map +1 -0
- package/admin/components/ModelFieldProvider/useModelField.d.ts +35 -0
- package/admin/components/ModelFieldProvider/useModelField.js +33 -0
- package/admin/components/ModelFieldProvider/useModelField.js.map +1 -0
- package/admin/components/ModelProvider/ModelContext.d.ts +9 -0
- package/admin/components/ModelProvider/ModelContext.js +18 -0
- package/admin/components/ModelProvider/ModelContext.js.map +1 -0
- package/admin/components/ModelProvider/index.d.ts +2 -0
- package/admin/components/ModelProvider/index.js +27 -0
- package/admin/components/ModelProvider/index.js.map +1 -0
- package/admin/components/ModelProvider/useModel.d.ts +9 -0
- package/admin/components/ModelProvider/useModel.js +20 -0
- package/admin/components/ModelProvider/useModel.js.map +1 -0
- package/admin/constants/statusLabels.d.ts +2 -8
- package/admin/constants/statusLabels.js +17 -12
- package/admin/constants/statusLabels.js.map +1 -0
- package/admin/contexts/Cms/NetworkError.js +10 -5
- package/admin/contexts/Cms/NetworkError.js.map +1 -0
- package/admin/contexts/Cms/index.d.ts +64 -5
- package/admin/contexts/Cms/index.js +117 -32
- package/admin/contexts/Cms/index.js.map +1 -0
- package/admin/elements/ContentGroupMenuElement.js +19 -13
- package/admin/elements/ContentGroupMenuElement.js.map +1 -0
- package/admin/elements/ContentModelMenuElement.js +19 -13
- package/admin/elements/ContentModelMenuElement.js.map +1 -0
- package/admin/elements/NothingToShowElement.d.ts +1 -1
- package/admin/elements/NothingToShowElement.js +36 -39
- package/admin/elements/NothingToShowElement.js.map +1 -0
- package/admin/graphql/contentEntries.d.ts +145 -11
- package/admin/graphql/contentEntries.js +103 -56
- package/admin/graphql/contentEntries.js.map +1 -0
- package/admin/graphql/contentModels.d.ts +29 -1
- package/admin/graphql/contentModels.js +25 -6
- package/admin/graphql/contentModels.js.map +1 -0
- package/admin/graphql/createFieldsList.d.ts +7 -2
- package/admin/graphql/createFieldsList.js +16 -8
- package/admin/graphql/createFieldsList.js.map +1 -0
- package/admin/hooks/index.d.ts +6 -0
- package/admin/hooks/index.js +100 -5
- package/admin/hooks/index.js.map +1 -0
- package/admin/hooks/useApolloClient.d.ts +2 -1
- package/admin/hooks/useApolloClient.js +11 -6
- package/admin/hooks/useApolloClient.js.map +1 -0
- package/admin/hooks/useCms.d.ts +2 -2
- package/admin/hooks/useCms.js +10 -7
- package/admin/hooks/useCms.js.map +1 -0
- package/admin/hooks/useLazyQuery.d.ts +4 -1
- package/admin/hooks/useLazyQuery.js +14 -10
- package/admin/hooks/useLazyQuery.js.map +1 -0
- package/admin/hooks/useMutation.d.ts +4 -1
- package/admin/hooks/useMutation.js +14 -10
- package/admin/hooks/useMutation.js.map +1 -0
- package/admin/hooks/usePermission.d.ts +19 -20
- package/admin/hooks/usePermission.js +60 -114
- package/admin/hooks/usePermission.js.map +1 -0
- package/admin/hooks/useQuery.d.ts +4 -1
- package/admin/hooks/useQuery.js +14 -10
- package/admin/hooks/useQuery.js.map +1 -0
- package/admin/hooks/useQueryLocale.d.ts +4 -0
- package/admin/hooks/useQueryLocale.js +21 -0
- package/admin/hooks/useQueryLocale.js.map +1 -0
- package/admin/icons/clone.svg +14 -0
- package/admin/icons/draft.svg +3 -0
- package/admin/icons/published.svg +3 -0
- package/admin/icons/unpublished.svg +3 -0
- package/admin/menus/CmsMenuLoader.d.ts +2 -0
- package/admin/menus/CmsMenuLoader.js +46 -0
- package/admin/menus/CmsMenuLoader.js.map +1 -0
- package/admin/menus/ContentGroupsMenuItems.d.ts +2 -0
- package/admin/menus/ContentGroupsMenuItems.js +85 -0
- package/admin/menus/ContentGroupsMenuItems.js.map +1 -0
- package/admin/{plugins/menus → menus}/GlobalSearchPlugins.d.ts +2 -1
- package/admin/menus/GlobalSearchPlugins.js +59 -0
- package/admin/menus/GlobalSearchPlugins.js.map +1 -0
- package/admin/menus/NothingToShowElement.d.ts +2 -0
- package/admin/menus/NothingToShowElement.js +53 -0
- package/admin/menus/NothingToShowElement.js.map +1 -0
- package/admin/plugins/apiInformation/index.js +21 -16
- package/admin/plugins/apiInformation/index.js.map +1 -0
- package/admin/plugins/arrayUtils.d.ts +12 -0
- package/admin/plugins/arrayUtils.js +45 -0
- package/admin/plugins/arrayUtils.js.map +1 -0
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.js +24 -26
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.js.map +1 -0
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.js +23 -24
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.js.map +1 -0
- package/admin/plugins/editor/defaultBar/BackButton.d.ts +1 -1
- package/admin/plugins/editor/defaultBar/BackButton.js +21 -12
- package/admin/plugins/editor/defaultBar/BackButton.js.map +1 -0
- package/admin/plugins/editor/defaultBar/CreateContentButton.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/CreateContentButton.js +29 -27
- package/admin/plugins/editor/defaultBar/CreateContentButton.js.map +1 -0
- package/admin/plugins/editor/defaultBar/Divider.d.ts +3 -1
- package/admin/plugins/editor/defaultBar/Divider.js +11 -3
- package/admin/plugins/editor/defaultBar/Divider.js.map +1 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.d.ts +4 -4
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.js +67 -56
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.js.map +1 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.js +23 -17
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.js.map +1 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.d.ts +3 -2
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.js +23 -10
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.js.map +1 -0
- package/admin/plugins/editor/defaultBar/FormSettings/index.js +13 -1
- package/admin/plugins/editor/defaultBar/FormSettings/index.js.map +1 -0
- package/admin/plugins/editor/defaultBar/Name/Name.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/Name/Name.js +45 -42
- package/admin/plugins/editor/defaultBar/Name/Name.js.map +1 -0
- package/admin/plugins/editor/defaultBar/Name/NameStyled.d.ts +5 -3
- package/admin/plugins/editor/defaultBar/Name/NameStyled.js +18 -7
- package/admin/plugins/editor/defaultBar/Name/NameStyled.js.map +1 -0
- package/admin/plugins/editor/defaultBar/Name/index.js +12 -1
- package/admin/plugins/editor/defaultBar/Name/index.js.map +1 -0
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.js +59 -59
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.js.map +1 -0
- package/admin/plugins/editor/defaultBar/index.js +23 -15
- package/admin/plugins/editor/defaultBar/index.js.map +1 -0
- package/admin/plugins/editor/formSettings/components/GeneralSettings.js +33 -20
- package/admin/plugins/editor/formSettings/components/GeneralSettings.js.map +1 -0
- package/admin/plugins/editor/formSettings/components/GroupSelect.js +21 -15
- package/admin/plugins/editor/formSettings/components/GroupSelect.js.map +1 -0
- package/admin/plugins/editor/formSettings/index.js +15 -6
- package/admin/plugins/editor/formSettings/index.js.map +1 -0
- package/admin/plugins/entry/DefaultOnEntryDelete.d.ts +2 -0
- package/admin/plugins/entry/DefaultOnEntryDelete.js +157 -0
- package/admin/plugins/entry/DefaultOnEntryDelete.js.map +1 -0
- package/admin/plugins/entry/DefaultOnEntryPublish.d.ts +2 -0
- package/admin/plugins/entry/DefaultOnEntryPublish.js +134 -0
- package/admin/plugins/entry/DefaultOnEntryPublish.js.map +1 -0
- package/admin/plugins/fieldRenderers/Accordion.d.ts +5 -6
- package/admin/plugins/fieldRenderers/Accordion.js +44 -35
- package/admin/plugins/fieldRenderers/Accordion.js.map +1 -0
- package/admin/plugins/fieldRenderers/DynamicSection.d.ts +17 -7
- package/admin/plugins/fieldRenderers/DynamicSection.js +44 -43
- package/admin/plugins/fieldRenderers/DynamicSection.js.map +1 -0
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.js +22 -15
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.js.map +1 -0
- package/admin/plugins/fieldRenderers/boolean/index.js +10 -2
- package/admin/plugins/fieldRenderers/boolean/index.js.map +1 -0
- package/admin/plugins/fieldRenderers/checkboxes.js +42 -28
- package/admin/plugins/fieldRenderers/checkboxes.js.map +1 -0
- package/admin/plugins/fieldRenderers/dateTime/DateOnly.d.ts +10 -0
- package/admin/plugins/fieldRenderers/dateTime/DateOnly.js +68 -0
- package/admin/plugins/fieldRenderers/dateTime/DateOnly.js.map +1 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.d.ts +6 -6
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js +130 -95
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js.map +1 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.d.ts +6 -5
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.js +117 -79
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.js.map +1 -0
- package/admin/plugins/fieldRenderers/dateTime/Input.d.ts +8 -9
- package/admin/plugins/fieldRenderers/dateTime/Input.js +16 -11
- package/admin/plugins/fieldRenderers/dateTime/Input.js.map +1 -0
- package/admin/plugins/fieldRenderers/dateTime/Select.d.ts +10 -3
- package/admin/plugins/fieldRenderers/dateTime/Select.js +12 -6
- package/admin/plugins/fieldRenderers/dateTime/Select.js.map +1 -0
- package/admin/plugins/fieldRenderers/dateTime/Time.d.ts +3 -3
- package/admin/plugins/fieldRenderers/dateTime/Time.js +60 -8
- package/admin/plugins/fieldRenderers/dateTime/Time.js.map +1 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.js +31 -30
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.js.map +1 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.js +47 -45
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.js.map +1 -0
- package/admin/plugins/fieldRenderers/dateTime/index.js +11 -3
- package/admin/plugins/fieldRenderers/dateTime/index.js.map +1 -0
- package/admin/plugins/fieldRenderers/dateTime/utils.d.ts +12 -9
- package/admin/plugins/fieldRenderers/dateTime/utils.js +66 -22
- package/admin/plugins/fieldRenderers/dateTime/utils.js.map +1 -0
- package/admin/plugins/fieldRenderers/dynamicZone/AddTemplate.d.ts +12 -0
- package/admin/plugins/fieldRenderers/dynamicZone/AddTemplate.js +85 -0
- package/admin/plugins/fieldRenderers/dynamicZone/AddTemplate.js.map +1 -0
- package/admin/plugins/fieldRenderers/dynamicZone/MultiValueDynamicZone.d.ts +11 -0
- package/admin/plugins/fieldRenderers/dynamicZone/MultiValueDynamicZone.js +114 -0
- package/admin/plugins/fieldRenderers/dynamicZone/MultiValueDynamicZone.js.map +1 -0
- package/admin/plugins/fieldRenderers/dynamicZone/SingleValueDynamicZone.d.ts +11 -0
- package/admin/plugins/fieldRenderers/dynamicZone/SingleValueDynamicZone.js +54 -0
- package/admin/plugins/fieldRenderers/dynamicZone/SingleValueDynamicZone.js.map +1 -0
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateCard.d.ts +8 -0
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateCard.js +54 -0
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateCard.js.map +1 -0
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateGallery.d.ts +8 -0
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateGallery.js +40 -0
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateGallery.js.map +1 -0
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateIcon.d.ts +6 -0
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateIcon.js +17 -0
- package/admin/plugins/fieldRenderers/dynamicZone/TemplateIcon.js.map +1 -0
- package/admin/plugins/fieldRenderers/dynamicZone/dynamicZoneRenderer.d.ts +2 -0
- package/admin/plugins/fieldRenderers/dynamicZone/dynamicZoneRenderer.js +56 -0
- package/admin/plugins/fieldRenderers/dynamicZone/dynamicZoneRenderer.js.map +1 -0
- package/admin/plugins/fieldRenderers/file/File.d.ts +5 -5
- package/admin/plugins/fieldRenderers/file/File.js +38 -29
- package/admin/plugins/fieldRenderers/file/File.js.map +1 -0
- package/admin/plugins/fieldRenderers/file/fileField.js +43 -43
- package/admin/plugins/fieldRenderers/file/fileField.js.map +1 -0
- package/admin/plugins/fieldRenderers/file/fileFields.js +86 -75
- package/admin/plugins/fieldRenderers/file/fileFields.js.map +1 -0
- package/admin/plugins/fieldRenderers/file/index.js +11 -3
- package/admin/plugins/fieldRenderers/file/index.js.map +1 -0
- package/admin/plugins/fieldRenderers/file/utils.d.ts +9 -4
- package/admin/plugins/fieldRenderers/file/utils.js +23 -17
- package/admin/plugins/fieldRenderers/file/utils.js.map +1 -0
- package/admin/plugins/fieldRenderers/longText/index.js +11 -3
- package/admin/plugins/fieldRenderers/longText/index.js.map +1 -0
- package/admin/plugins/fieldRenderers/longText/longText.js +22 -15
- package/admin/plugins/fieldRenderers/longText/longText.js.map +1 -0
- package/admin/plugins/fieldRenderers/longText/longTexts.js +24 -18
- package/admin/plugins/fieldRenderers/longText/longTexts.js.map +1 -0
- package/admin/plugins/fieldRenderers/number/index.js +11 -3
- package/admin/plugins/fieldRenderers/number/index.js.map +1 -0
- package/admin/plugins/fieldRenderers/number/numberInput.js +22 -15
- package/admin/plugins/fieldRenderers/number/numberInput.js.map +1 -0
- package/admin/plugins/fieldRenderers/number/numberInputs.js +24 -19
- package/admin/plugins/fieldRenderers/number/numberInputs.js.map +1 -0
- package/admin/plugins/fieldRenderers/object/StyledComponents.d.ts +5 -0
- package/admin/plugins/fieldRenderers/object/StyledComponents.js +48 -5
- package/admin/plugins/fieldRenderers/object/StyledComponents.js.map +1 -0
- package/admin/plugins/fieldRenderers/object/arrow_drop_down.svg +1 -0
- package/admin/plugins/fieldRenderers/object/arrow_drop_up.svg +1 -0
- package/admin/plugins/fieldRenderers/object/index.js +13 -3
- package/admin/plugins/fieldRenderers/object/index.js.map +1 -0
- package/admin/plugins/fieldRenderers/object/multipleObjects.js +116 -60
- package/admin/plugins/fieldRenderers/object/multipleObjects.js.map +1 -0
- package/admin/plugins/fieldRenderers/object/multipleObjectsAccordion.js +122 -0
- package/admin/plugins/fieldRenderers/object/multipleObjectsAccordion.js.map +1 -0
- package/admin/plugins/fieldRenderers/object/singleObjectAccordion.d.ts +3 -0
- package/admin/plugins/fieldRenderers/object/singleObjectAccordion.js +45 -0
- package/admin/plugins/fieldRenderers/object/singleObjectAccordion.js.map +1 -0
- package/admin/plugins/fieldRenderers/object/singleObjectInline.d.ts +3 -0
- package/admin/plugins/fieldRenderers/object/singleObjectInline.js +52 -0
- package/admin/plugins/fieldRenderers/object/singleObjectInline.js.map +1 -0
- package/admin/plugins/fieldRenderers/radioButtons.js +35 -23
- package/admin/plugins/fieldRenderers/radioButtons.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.d.ts +8 -5
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.js +108 -43
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.d.ts +8 -5
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.js +87 -46
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/components/EntryStatus.d.ts +10 -0
- package/admin/plugins/fieldRenderers/ref/components/EntryStatus.js +56 -0
- package/admin/plugins/fieldRenderers/ref/components/EntryStatus.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/components/MissingEntryHelpText.d.ts +7 -0
- package/admin/plugins/fieldRenderers/ref/components/MissingEntryHelpText.js +41 -0
- package/admin/plugins/fieldRenderers/ref/components/MissingEntryHelpText.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/components/NewRefEntryFormDialog.d.ts +10 -0
- package/admin/plugins/fieldRenderers/ref/components/NewRefEntryFormDialog.js +152 -0
- package/admin/plugins/fieldRenderers/ref/components/NewRefEntryFormDialog.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/components/createEntryUrl.d.ts +6 -0
- package/admin/plugins/fieldRenderers/ref/components/createEntryUrl.js +16 -0
- package/admin/plugins/fieldRenderers/ref/components/createEntryUrl.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/components/graphql.d.ts +59 -1
- package/admin/plugins/fieldRenderers/ref/components/graphql.js +30 -8
- package/admin/plugins/fieldRenderers/ref/components/graphql.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/components/helpers.d.ts +6 -0
- package/admin/plugins/fieldRenderers/ref/components/helpers.js +47 -0
- package/admin/plugins/fieldRenderers/ref/components/helpers.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/components/renderItem.d.ts +10 -2
- package/admin/plugins/fieldRenderers/ref/components/renderItem.js +36 -8
- package/admin/plugins/fieldRenderers/ref/components/renderItem.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/components/types.d.ts +26 -0
- package/admin/plugins/fieldRenderers/ref/components/types.js +5 -0
- package/admin/plugins/fieldRenderers/ref/components/types.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/components/useReference.d.ts +8 -13
- package/admin/plugins/fieldRenderers/ref/components/useReference.js +153 -163
- package/admin/plugins/fieldRenderers/ref/components/useReference.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/components/useReferences.d.ts +11 -14
- package/admin/plugins/fieldRenderers/ref/components/useReferences.js +144 -122
- package/admin/plugins/fieldRenderers/ref/components/useReferences.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntry.d.ts +12 -0
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntry.js +59 -0
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntry.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntryDialog.d.ts +8 -0
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntryDialog.js +41 -0
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntryDialog.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/index.js +11 -3
- package/admin/plugins/fieldRenderers/ref/index.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/refInput.js +19 -12
- package/admin/plugins/fieldRenderers/ref/refInput.js.map +1 -0
- package/admin/plugins/fieldRenderers/ref/refInputs.js +20 -15
- package/admin/plugins/fieldRenderers/ref/refInputs.js.map +1 -0
- package/admin/plugins/fieldRenderers/richText/index.js +11 -3
- package/admin/plugins/fieldRenderers/richText/index.js.map +1 -0
- package/admin/plugins/fieldRenderers/richText/richTextInput.js +31 -20
- package/admin/plugins/fieldRenderers/richText/richTextInput.js.map +1 -0
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js +38 -27
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js.map +1 -0
- package/admin/plugins/fieldRenderers/select.js +41 -18
- package/admin/plugins/fieldRenderers/select.js.map +1 -0
- package/admin/plugins/fieldRenderers/text/index.js +11 -3
- package/admin/plugins/fieldRenderers/text/index.js.map +1 -0
- package/admin/plugins/fieldRenderers/text/textInput.js +22 -15
- package/admin/plugins/fieldRenderers/text/textInput.js.map +1 -0
- package/admin/plugins/fieldRenderers/text/textInputs.js +24 -19
- package/admin/plugins/fieldRenderers/text/textInputs.js.map +1 -0
- package/admin/plugins/fieldValidators/date/availableValidators.js +9 -4
- package/admin/plugins/fieldValidators/date/availableValidators.js.map +1 -0
- package/admin/plugins/fieldValidators/date/createDateInputField.d.ts +3 -2
- package/admin/plugins/fieldValidators/date/createDateInputField.js +24 -21
- package/admin/plugins/fieldValidators/date/createDateInputField.js.map +1 -0
- package/admin/plugins/fieldValidators/dateGte.d.ts +2 -2
- package/admin/plugins/fieldValidators/dateGte.js +77 -31
- package/admin/plugins/fieldValidators/dateGte.js.map +1 -0
- package/admin/plugins/fieldValidators/dateLte.d.ts +2 -2
- package/admin/plugins/fieldValidators/dateLte.js +77 -31
- package/admin/plugins/fieldValidators/dateLte.js.map +1 -0
- package/admin/plugins/fieldValidators/dynamicZone.d.ts +2 -0
- package/admin/plugins/fieldValidators/dynamicZone.js +163 -0
- package/admin/plugins/fieldValidators/dynamicZone.js.map +1 -0
- package/admin/plugins/fieldValidators/gte.d.ts +3 -3
- package/admin/plugins/fieldValidators/gte.js +51 -14
- package/admin/plugins/fieldValidators/gte.js.map +1 -0
- package/admin/plugins/fieldValidators/in.d.ts +3 -3
- package/admin/plugins/fieldValidators/in.js +51 -14
- package/admin/plugins/fieldValidators/in.js.map +1 -0
- package/admin/plugins/fieldValidators/lte.d.ts +3 -3
- package/admin/plugins/fieldValidators/lte.js +51 -14
- package/admin/plugins/fieldValidators/lte.js.map +1 -0
- package/admin/plugins/fieldValidators/maxLength.d.ts +3 -3
- package/admin/plugins/fieldValidators/maxLength.js +62 -15
- package/admin/plugins/fieldValidators/maxLength.js.map +1 -0
- package/admin/plugins/fieldValidators/minLength.d.ts +3 -3
- package/admin/plugins/fieldValidators/minLength.js +62 -15
- package/admin/plugins/fieldValidators/minLength.js.map +1 -0
- package/admin/plugins/fieldValidators/pattern.d.ts +3 -3
- package/admin/plugins/fieldValidators/pattern.js +125 -63
- package/admin/plugins/fieldValidators/pattern.js.map +1 -0
- package/admin/plugins/fieldValidators/patternPlugins/email.d.ts +3 -3
- package/admin/plugins/fieldValidators/patternPlugins/email.js +16 -6
- package/admin/plugins/fieldValidators/patternPlugins/email.js.map +1 -0
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.d.ts +3 -3
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.js +15 -5
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.js.map +1 -0
- package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.js +19 -0
- package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.js.map +1 -0
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.d.ts +3 -3
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.js +15 -5
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.js.map +1 -0
- package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.js +19 -0
- package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.js.map +1 -0
- package/admin/plugins/fieldValidators/patternPlugins/url.d.ts +3 -3
- package/admin/plugins/fieldValidators/patternPlugins/url.js +15 -5
- package/admin/plugins/fieldValidators/patternPlugins/url.js.map +1 -0
- package/admin/plugins/fieldValidators/required.d.ts +3 -3
- package/admin/plugins/fieldValidators/required.js +16 -4
- package/admin/plugins/fieldValidators/required.js.map +1 -0
- package/admin/plugins/fieldValidators/unique.js +39 -0
- package/admin/plugins/fieldValidators/unique.js.map +1 -0
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.d.ts +7 -5
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.js +109 -71
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.js.map +1 -0
- package/admin/plugins/fields/boolean.d.ts +2 -2
- package/admin/plugins/fields/boolean.js +35 -12
- package/admin/plugins/fields/boolean.js.map +1 -0
- package/admin/plugins/fields/dateTime.d.ts +2 -2
- package/admin/plugins/fields/dateTime.js +72 -52
- package/admin/plugins/fields/dateTime.js.map +1 -0
- package/admin/plugins/fields/dynamicZone/AddTemplate.d.ts +11 -0
- package/admin/plugins/fields/dynamicZone/AddTemplate.js +91 -0
- package/admin/plugins/fields/dynamicZone/AddTemplate.js.map +1 -0
- package/admin/plugins/fields/dynamicZone/DynamicZone.d.ts +2 -0
- package/admin/plugins/fields/dynamicZone/DynamicZone.js +62 -0
- package/admin/plugins/fields/dynamicZone/DynamicZone.js.map +1 -0
- package/admin/plugins/fields/dynamicZone/DynamicZoneTemplate.d.ts +11 -0
- package/admin/plugins/fields/dynamicZone/DynamicZoneTemplate.js +104 -0
- package/admin/plugins/fields/dynamicZone/DynamicZoneTemplate.js.map +1 -0
- package/admin/plugins/fields/dynamicZone/TemplateDialog.d.ts +9 -0
- package/admin/plugins/fields/dynamicZone/TemplateDialog.js +141 -0
- package/admin/plugins/fields/dynamicZone/TemplateDialog.js.map +1 -0
- package/admin/plugins/fields/dynamicZone/commonValidators.d.ts +2 -0
- package/admin/plugins/fields/dynamicZone/commonValidators.js +26 -0
- package/admin/plugins/fields/dynamicZone/commonValidators.js.map +1 -0
- package/admin/plugins/fields/dynamicZone.d.ts +2 -0
- package/admin/plugins/fields/dynamicZone.js +83 -0
- package/admin/plugins/fields/dynamicZone.js.map +1 -0
- package/admin/plugins/fields/file.d.ts +2 -2
- package/admin/plugins/fields/file.js +26 -20
- package/admin/plugins/fields/file.js.map +1 -0
- package/admin/plugins/fields/longText.d.ts +2 -2
- package/admin/plugins/fields/longText.js +26 -20
- package/admin/plugins/fields/longText.js.map +1 -0
- package/admin/plugins/fields/number.d.ts +2 -2
- package/admin/plugins/fields/number.js +31 -25
- package/admin/plugins/fields/number.js.map +1 -0
- package/admin/plugins/fields/object/ObjectFields.d.ts +7 -4
- package/admin/plugins/fields/object/ObjectFields.js +25 -18
- package/admin/plugins/fields/object/ObjectFields.js.map +1 -0
- package/admin/plugins/fields/object.d.ts +2 -2
- package/admin/plugins/fields/object.js +27 -16
- package/admin/plugins/fields/object.js.map +1 -0
- package/admin/plugins/fields/ref.d.ts +2 -2
- package/admin/plugins/fields/ref.js +116 -115
- package/admin/plugins/fields/ref.js.map +1 -0
- package/admin/plugins/fields/richText.d.ts +2 -2
- package/admin/plugins/fields/richText.js +26 -21
- package/admin/plugins/fields/richText.js.map +1 -0
- package/admin/plugins/fields/text.d.ts +2 -2
- package/admin/plugins/fields/text.js +30 -24
- package/admin/plugins/fields/text.js.map +1 -0
- package/admin/plugins/getObjectId.d.ts +3 -3
- package/admin/plugins/getObjectId.js +14 -11
- package/admin/plugins/getObjectId.js.map +1 -0
- package/admin/plugins/icons.js +24 -12
- package/admin/plugins/icons.js.map +1 -0
- package/admin/plugins/index.d.ts +28 -7
- package/admin/plugins/index.js +20 -14
- package/admin/plugins/index.js.map +1 -0
- package/admin/plugins/install.d.ts +22 -0
- package/admin/plugins/install.js +107 -83
- package/admin/plugins/install.js.map +1 -0
- package/admin/plugins/permissionRenderer/CmsPermissions.d.ts +11 -5
- package/admin/plugins/permissionRenderer/CmsPermissions.js +81 -107
- package/admin/plugins/permissionRenderer/CmsPermissions.js.map +1 -0
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.d.ts +12 -8
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.js +61 -60
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.js.map +1 -0
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.d.ts +11 -8
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.js +48 -42
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.js.map +1 -0
- package/admin/plugins/permissionRenderer/components/ContentModelList.d.ts +8 -6
- package/admin/plugins/permissionRenderer/components/ContentModelList.js +33 -28
- package/admin/plugins/permissionRenderer/components/ContentModelList.js.map +1 -0
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.d.ts +14 -10
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.js +65 -58
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.js.map +1 -0
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.d.ts +10 -5
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.js +26 -13
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.js.map +1 -0
- package/admin/plugins/permissionRenderer/components/PermissionSelector.d.ts +12 -27
- package/admin/plugins/permissionRenderer/components/PermissionSelector.js +51 -34
- package/admin/plugins/permissionRenderer/components/PermissionSelector.js.map +1 -0
- package/admin/plugins/permissionRenderer/components/StyledComponents.d.ts +3 -1
- package/admin/plugins/permissionRenderer/components/StyledComponents.js +11 -3
- package/admin/plugins/permissionRenderer/components/StyledComponents.js.map +1 -0
- package/admin/plugins/permissionRenderer/components/types.d.ts +16 -0
- package/admin/plugins/permissionRenderer/components/types.js +5 -0
- package/admin/plugins/permissionRenderer/components/types.js.map +1 -0
- package/admin/plugins/permissionRenderer/components/useCmsData.d.ts +17 -1
- package/admin/plugins/permissionRenderer/components/useCmsData.js +92 -64
- package/admin/plugins/permissionRenderer/components/useCmsData.js.map +1 -0
- package/admin/plugins/permissionRenderer/index.d.ts +2 -2
- package/admin/plugins/permissionRenderer/index.js +18 -9
- package/admin/plugins/permissionRenderer/index.js.map +1 -0
- package/admin/plugins/routes.js +51 -42
- package/admin/plugins/routes.js.map +1 -0
- package/admin/plugins/transformers/dateTransformer.d.ts +1 -2
- package/admin/plugins/transformers/dateTransformer.js +119 -30
- package/admin/plugins/transformers/dateTransformer.js.map +1 -0
- package/admin/plugins/transformers/dynamicZoneTransformer.d.ts +2 -0
- package/admin/plugins/transformers/dynamicZoneTransformer.js +36 -0
- package/admin/plugins/transformers/dynamicZoneTransformer.js.map +1 -0
- package/admin/plugins/transformers/index.js +13 -5
- package/admin/plugins/transformers/index.js.map +1 -0
- package/admin/plugins/transformers/numberTransformer.d.ts +1 -2
- package/admin/plugins/transformers/numberTransformer.js +9 -3
- package/admin/plugins/transformers/numberTransformer.js.map +1 -0
- package/admin/plugins/upgrades/5.19.0/UpgradeItemsInfo.d.ts +7 -0
- package/admin/plugins/upgrades/5.19.0/UpgradeItemsInfo.js +51 -0
- package/admin/plugins/upgrades/5.19.0/UpgradeItemsInfo.js.map +1 -0
- package/admin/plugins/upgrades/5.19.0/createCmsApolloClient.d.ts +7 -0
- package/admin/plugins/upgrades/5.19.0/createCmsApolloClient.js +54 -0
- package/admin/plugins/upgrades/5.19.0/createCmsApolloClient.js.map +1 -0
- package/admin/plugins/upgrades/5.19.0/createListEntriesQuery.d.ts +2 -0
- package/admin/plugins/upgrades/5.19.0/createListEntriesQuery.js +18 -0
- package/admin/plugins/upgrades/5.19.0/createListEntriesQuery.js.map +1 -0
- package/admin/plugins/upgrades/5.19.0/createListModelsQuery.d.ts +1 -0
- package/admin/plugins/upgrades/5.19.0/createListModelsQuery.js +14 -0
- package/admin/plugins/upgrades/5.19.0/createListModelsQuery.js.map +1 -0
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.d.ts +2 -0
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.js +16 -0
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.js.map +1 -0
- package/admin/plugins/upgrades/5.19.0/createUpgradeMutation.d.ts +1 -0
- package/admin/plugins/upgrades/5.19.0/createUpgradeMutation.js +14 -0
- package/admin/plugins/upgrades/5.19.0/createUpgradeMutation.js.map +1 -0
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.d.ts +7 -0
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.js +108 -0
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.js.map +1 -0
- package/admin/plugins/upgrades/5.19.0/types.d.ts +47 -0
- package/admin/plugins/upgrades/5.19.0/types.js +5 -0
- package/admin/plugins/upgrades/5.19.0/types.js.map +1 -0
- package/admin/plugins/upgrades/5.33.0/locales.d.ts +7 -0
- package/admin/plugins/upgrades/5.33.0/locales.js +48 -0
- package/admin/plugins/upgrades/5.33.0/locales.js.map +1 -0
- package/admin/plugins/upgrades/5.33.0/types.d.ts +7 -0
- package/admin/plugins/upgrades/5.33.0/types.js +5 -0
- package/admin/plugins/upgrades/5.33.0/types.js.map +1 -0
- package/admin/plugins/upgrades/5.33.0/upgrade.d.ts +8 -0
- package/admin/plugins/upgrades/5.33.0/upgrade.js +59 -0
- package/admin/plugins/upgrades/5.33.0/upgrade.js.map +1 -0
- package/admin/plugins/upgrades/v5.0.0.js +66 -69
- package/admin/plugins/upgrades/v5.0.0.js.map +1 -0
- package/admin/plugins/upgrades/v5.19.0.d.ts +5 -0
- package/admin/plugins/upgrades/v5.19.0.js +538 -0
- package/admin/plugins/upgrades/v5.19.0.js.map +1 -0
- package/admin/plugins/upgrades/v5.33.0.d.ts +6 -0
- package/admin/plugins/upgrades/v5.33.0.js +162 -0
- package/admin/plugins/upgrades/v5.33.0.js.map +1 -0
- package/admin/plugins/upgrades/v5.5.0.js +66 -69
- package/admin/plugins/upgrades/v5.5.0.js.map +1 -0
- package/admin/plugins/upgrades/v5.8.0.js +66 -69
- package/admin/plugins/upgrades/v5.8.0.js.map +1 -0
- package/admin/plugins/welcomeScreenWidget.js +17 -9
- package/admin/plugins/welcomeScreenWidget.js.map +1 -0
- package/admin/views/contentEntries/ContentEntries.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntries.js +66 -62
- package/admin/views/contentEntries/ContentEntries.js.map +1 -0
- package/admin/views/contentEntries/ContentEntriesContext.d.ts +19 -15
- package/admin/views/contentEntries/ContentEntriesContext.js +56 -44
- package/admin/views/contentEntries/ContentEntriesContext.js.map +1 -0
- package/admin/views/contentEntries/ContentEntriesList.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntriesList.js +138 -118
- package/admin/views/contentEntries/ContentEntriesList.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.d.ts +19 -14
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js +124 -74
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/PublishEntryRevisionListItem.d.ts +1 -0
- package/admin/views/contentEntries/ContentEntry/PublishEntryRevisionListItem.js +23 -0
- package/admin/views/contentEntries/ContentEntry/PublishEntryRevisionListItem.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.d.ts +4 -4
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.js +114 -117
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/RevisionsList.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/RevisionsList.js +29 -26
- package/admin/views/contentEntries/ContentEntry/RevisionsList.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/cache.d.ts +9 -7
- package/admin/views/contentEntries/ContentEntry/cache.js +111 -96
- package/admin/views/contentEntries/ContentEntry/cache.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/header/Header.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/Header.js +24 -18
- package/admin/views/contentEntries/ContentEntry/header/Header.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.js +100 -117
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/header/index.js +19 -24
- package/admin/views/contentEntries/ContentEntry/header/index.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.js +47 -42
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.d.ts +1 -3
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.js +71 -75
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.js +24 -23
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/prepareFormData.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/prepareFormData.js +92 -56
- package/admin/views/contentEntries/ContentEntry/prepareFormData.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry/useRevision.d.ts +23 -9
- package/admin/views/contentEntries/ContentEntry/useRevision.js +206 -295
- package/admin/views/contentEntries/ContentEntry/useRevision.js.map +1 -0
- package/admin/views/contentEntries/ContentEntry.d.ts +1 -2
- package/admin/views/contentEntries/ContentEntry.js +51 -53
- package/admin/views/contentEntries/ContentEntry.js.map +1 -0
- package/admin/views/contentEntries/experiment/ContentEntriesModule.d.ts +2 -0
- package/admin/views/contentEntries/experiment/ContentEntriesModule.js +68 -0
- package/admin/views/contentEntries/experiment/ContentEntriesModule.js.map +1 -0
- package/admin/views/contentEntries/experiment/ContentEntriesRenderer.d.ts +2 -0
- package/admin/views/contentEntries/experiment/ContentEntriesRenderer.js +24 -0
- package/admin/views/contentEntries/experiment/ContentEntriesRenderer.js.map +1 -0
- package/admin/views/contentEntries/experiment/ContentEntriesViewConfig.d.ts +35 -0
- package/admin/views/contentEntries/experiment/ContentEntriesViewConfig.js +131 -0
- package/admin/views/contentEntries/experiment/ContentEntriesViewConfig.js.map +1 -0
- package/admin/views/contentEntries/experiment/Property.d.ts +34 -0
- package/admin/views/contentEntries/experiment/Property.js +200 -0
- package/admin/views/contentEntries/experiment/Property.js.map +1 -0
- package/admin/views/contentEntries/hooks/useContentEntries.js +14 -4
- package/admin/views/contentEntries/hooks/useContentEntries.js.map +1 -0
- package/admin/views/contentEntries/hooks/useContentEntriesList.d.ts +4 -7
- package/admin/views/contentEntries/hooks/useContentEntriesList.js +79 -81
- package/admin/views/contentEntries/hooks/useContentEntriesList.js.map +1 -0
- package/admin/views/contentEntries/hooks/useContentEntry.js +14 -4
- package/admin/views/contentEntries/hooks/useContentEntry.js.map +1 -0
- package/admin/views/contentModelGroups/ContentModelGroups.d.ts +2 -2
- package/admin/views/contentModelGroups/ContentModelGroups.js +26 -22
- package/admin/views/contentModelGroups/ContentModelGroups.js.map +1 -0
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.d.ts +4 -4
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.js +151 -173
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.js.map +1 -0
- package/admin/views/contentModelGroups/ContentModelGroupsForm.d.ts +4 -4
- package/admin/views/contentModelGroups/ContentModelGroupsForm.js +177 -166
- package/admin/views/contentModelGroups/ContentModelGroupsForm.js.map +1 -0
- package/admin/views/contentModelGroups/graphql.d.ts +68 -0
- package/admin/views/contentModelGroups/graphql.js +36 -8
- package/admin/views/contentModelGroups/graphql.js.map +1 -0
- package/admin/views/contentModels/CloneContentModelDialog.d.ts +11 -0
- package/admin/views/contentModels/CloneContentModelDialog.js +230 -0
- package/admin/views/contentModels/CloneContentModelDialog.js.map +1 -0
- package/admin/views/contentModels/ContentModelEditor.d.ts +3 -2
- package/admin/views/contentModels/ContentModelEditor.js +27 -28
- package/admin/views/contentModels/ContentModelEditor.js.map +1 -0
- package/admin/views/contentModels/ContentModels.d.ts +2 -2
- package/admin/views/contentModels/ContentModels.js +59 -37
- package/admin/views/contentModels/ContentModels.js.map +1 -0
- package/admin/views/contentModels/ContentModelsDataList.d.ts +6 -4
- package/admin/views/contentModels/ContentModelsDataList.js +180 -189
- package/admin/views/contentModels/ContentModelsDataList.js.map +1 -0
- package/admin/views/contentModels/NewContentModelDialog.d.ts +2 -2
- package/admin/views/contentModels/NewContentModelDialog.js +194 -160
- package/admin/views/contentModels/NewContentModelDialog.js.map +1 -0
- package/admin/views/contentModels/cache.d.ts +12 -4
- package/admin/views/contentModels/cache.js +79 -33
- package/admin/views/contentModels/cache.js.map +1 -0
- package/admin/views/contentModels/types.d.ts +4 -0
- package/admin/views/contentModels/types.js +5 -0
- package/admin/views/contentModels/types.js.map +1 -0
- package/admin/views/utils.d.ts +3 -2
- package/admin/views/utils.js +16 -23
- package/admin/views/utils.js.map +1 -0
- package/admin/viewsGraphql.d.ts +63 -0
- package/admin/viewsGraphql.js +43 -9
- package/admin/viewsGraphql.js.map +1 -0
- package/allPlugins.d.ts +34 -0
- package/allPlugins.js +51 -0
- package/allPlugins.js.map +1 -0
- package/index.d.ts +12 -0
- package/index.js +39 -0
- package/index.js.map +1 -0
- package/package.json +49 -50
- package/{types.d.ts → types/index.d.ts} +130 -146
- package/types/index.js +38 -0
- package/types/index.js.map +1 -0
- package/types/model.d.ts +83 -0
- package/types/model.js +5 -0
- package/types/model.js.map +1 -0
- package/types/shared.d.ts +5 -0
- package/types/shared.js +5 -0
- package/types/shared.js.map +1 -0
- package/types/validation.d.ts +70 -0
- package/types/validation.js +5 -0
- package/types/validation.js.map +1 -0
- package/utils/CmsModelFieldValidatorConfigAdapter.d.ts +15 -0
- package/utils/CmsModelFieldValidatorConfigAdapter.js +79 -0
- package/utils/CmsModelFieldValidatorConfigAdapter.js.map +1 -0
- package/utils/createTypeName.d.ts +1 -0
- package/utils/createTypeName.js +13 -0
- package/utils/createTypeName.js.map +1 -0
- package/utils/createValidators.d.ts +3 -0
- package/utils/createValidators.js +76 -0
- package/utils/createValidators.js.map +1 -0
- package/utils/getFetchPolicy.d.ts +6 -0
- package/utils/getFetchPolicy.js +17 -0
- package/utils/getFetchPolicy.js.map +1 -0
- package/utils/getModelTitleFieldId.d.ts +2 -0
- package/utils/getModelTitleFieldId.js +13 -0
- package/utils/getModelTitleFieldId.js.map +1 -0
- package/admin/components/ContentEntryForm/functions/createValidators.d.ts +0 -1
- package/admin/components/ContentEntryForm/functions/createValidators.js +0 -58
- package/admin/components/ContentModelEditor/Context.d.ts +0 -23
- package/admin/components/ContentModelEditor/Context.js +0 -218
- package/admin/components/ContentModelEditor/useContentModelEditor.d.ts +0 -1
- package/admin/components/ContentModelEditor/useContentModelEditor.js +0 -11
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsTab.d.ts +0 -10
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsTab.js +0 -121
- package/admin/components/FieldEditor/useFieldEditor.d.ts +0 -1
- package/admin/components/FieldEditor/useFieldEditor.js +0 -5
- package/admin/plugins/fieldRenderers/object/singleObject.js +0 -45
- package/admin/plugins/fieldRenderers/ref/components/getOptions.d.ts +0 -1
- package/admin/plugins/fieldRenderers/ref/components/getOptions.js +0 -21
- package/admin/plugins/menus/CmsMenuLoader.d.ts +0 -7
- package/admin/plugins/menus/CmsMenuLoader.js +0 -76
- package/admin/plugins/menus/ContentGroupsMenuItems.d.ts +0 -6
- package/admin/plugins/menus/ContentGroupsMenuItems.js +0 -154
- package/admin/plugins/menus/GlobalSearchPlugins.js +0 -53
- package/admin/plugins/menus.d.ts +0 -4
- package/admin/plugins/menus.js +0 -19
- package/admin/plugins/validators/dateGte.js +0 -23
- package/admin/plugins/validators/dateLte.d.ts +0 -3
- package/admin/plugins/validators/dateLte.js +0 -23
- package/admin/plugins/validators/gte.d.ts +0 -3
- package/admin/plugins/validators/gte.js +0 -15
- package/admin/plugins/validators/in.d.ts +0 -3
- package/admin/plugins/validators/in.js +0 -15
- package/admin/plugins/validators/lte.d.ts +0 -3
- package/admin/plugins/validators/lte.js +0 -15
- package/admin/plugins/validators/maxLength.d.ts +0 -3
- package/admin/plugins/validators/maxLength.js +0 -15
- package/admin/plugins/validators/minLength.d.ts +0 -3
- package/admin/plugins/validators/minLength.js +0 -15
- package/admin/plugins/validators/pattern.d.ts +0 -9
- package/admin/plugins/validators/pattern.js +0 -34
- package/admin/plugins/validators/patternPlugins/email.d.ts +0 -10
- package/admin/plugins/validators/patternPlugins/email.js +0 -9
- package/admin/plugins/validators/patternPlugins/lowerCase.d.ts +0 -10
- package/admin/plugins/validators/patternPlugins/lowerCase.js +0 -9
- package/admin/plugins/validators/patternPlugins/upperCase.d.ts +0 -10
- package/admin/plugins/validators/patternPlugins/upperCase.js +0 -9
- package/admin/plugins/validators/patternPlugins/url.d.ts +0 -10
- package/admin/plugins/validators/patternPlugins/url.js +0 -9
- package/admin/plugins/validators/required.d.ts +0 -3
- package/admin/plugins/validators/required.js +0 -11
- package/admin/plugins/validators/timeGte.d.ts +0 -3
- package/admin/plugins/validators/timeGte.js +0 -19
- package/admin/plugins/validators/timeLte.d.ts +0 -3
- package/admin/plugins/validators/timeLte.js +0 -19
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/RequestChanges.d.ts +0 -3
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/RequestChanges.js +0 -67
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/rule-24px.svg +0 -1
- package/admin/views/contentEntries/ContentEntry/header/requestReview/RequestReview.d.ts +0 -3
- package/admin/views/contentEntries/ContentEntry/header/requestReview/RequestReview.js +0 -69
- package/admin/views/contentEntries/ContentEntry/header/requestReview/emoji_people-24px.svg +0 -1
- package/admin/views/contentModelGroups/DelayedOnChange.d.ts +0 -25
- package/admin/views/contentModelGroups/DelayedOnChange.js +0 -134
- package/admin/views/contentModelGroups/IconPicker.d.ts +0 -7
- package/admin/views/contentModelGroups/IconPicker.js +0 -204
- package/types.js +0 -1
- /package/admin/plugins/fieldRenderers/object/{singleObject.d.ts → multipleObjectsAccordion.d.ts} +0 -0
- /package/admin/plugins/{validators/dateGte.d.ts → fieldValidators/unique.d.ts} +0 -0
|
@@ -1,120 +1,139 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { useEffect, useCallback, useRef, useMemo } from "react";
|
|
3
|
-
import { Input } from "@webiny/ui/Input";
|
|
4
|
-
import { Switch } from "@webiny/ui/Switch";
|
|
5
|
-
import { Grid, Cell } from "@webiny/ui/Grid";
|
|
6
|
-
import { validation } from "@webiny/validation";
|
|
7
|
-
import { useFieldEditor } from "./..";
|
|
8
|
-
import { useContentModelEditor } from "../../ContentModelEditor/useContentModelEditor";
|
|
1
|
+
"use strict";
|
|
9
2
|
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _camelCase2 = _interopRequireDefault(require("lodash/camelCase"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _Input = require("@webiny/ui/Input");
|
|
12
|
+
var _Switch = require("@webiny/ui/Switch");
|
|
13
|
+
var _Grid = require("@webiny/ui/Grid");
|
|
14
|
+
var _validation = require("@webiny/validation");
|
|
15
|
+
var _Tags = require("@webiny/ui/Tags");
|
|
16
|
+
var _form = require("@webiny/form");
|
|
17
|
+
var _ = require("./..");
|
|
18
|
+
var _hooks = require("../../../hooks");
|
|
19
|
+
var GeneralTab = function GeneralTab() {
|
|
20
|
+
var form = (0, _form.useForm)();
|
|
21
|
+
var _useModelField = (0, _hooks.useModelField)(),
|
|
22
|
+
field = _useModelField.field,
|
|
23
|
+
fieldPlugin = _useModelField.fieldPlugin;
|
|
24
|
+
var inputRef = (0, _react.useRef)(null);
|
|
25
|
+
var _useModelEditor = (0, _hooks.useModelEditor)(),
|
|
26
|
+
contentModel = _useModelEditor.data;
|
|
27
|
+
var _useModelFieldEditor = (0, _.useModelFieldEditor)(),
|
|
28
|
+
getField = _useModelFieldEditor.getField;
|
|
17
29
|
|
|
18
|
-
|
|
19
|
-
data = _useContentModelEdito.data;
|
|
20
|
-
|
|
21
|
-
var _useFieldEditor = useFieldEditor(),
|
|
22
|
-
getField = _useFieldEditor.getField; // Had problems with auto-focusing the "label" field. A couple of comments on this.
|
|
30
|
+
// Had problems with auto-focusing the "label" field. A couple of comments on this.
|
|
23
31
|
// 1. It's probably caused by the Tabs component which wraps this component.
|
|
24
32
|
// 2. It seems that the "autoFocus" prop on the Input doesn't work. I can't see it attached in the actual DOM.
|
|
25
33
|
// 3. This works, but it's not 100%. Visually, the cursor is frozen, and that's probably caused by a bug / design
|
|
26
34
|
// in the RMWC / Material library. If you were to click somewhere on screen, and then apply focus, then
|
|
27
35
|
// it seems it's behaving correctly. ¯\_(ツ)_/¯
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
useEffect(function () {
|
|
36
|
+
(0, _react.useEffect)(function () {
|
|
31
37
|
setTimeout(function () {
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
if (!inputRef.current) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
inputRef.current.focus();
|
|
42
|
+
}, /* The value of 400 was determined by manual testing. */400);
|
|
34
43
|
}, []);
|
|
35
|
-
var afterChangeLabel = useCallback(function (value) {
|
|
36
|
-
setValue("fieldId",
|
|
44
|
+
var afterChangeLabel = (0, _react.useCallback)(function (value) {
|
|
45
|
+
form.setValue("fieldId", (0, _camelCase2.default)(value));
|
|
37
46
|
}, []);
|
|
38
|
-
var beforeChangeFieldId = useCallback(function (value, baseOnChange) {
|
|
39
|
-
|
|
40
|
-
baseOnChange(newValue);
|
|
47
|
+
var beforeChangeFieldId = (0, _react.useCallback)(function (value, baseOnChange) {
|
|
48
|
+
baseOnChange(value.trim());
|
|
41
49
|
}, []);
|
|
42
|
-
var fieldIdValidator = useCallback(function (fieldId) {
|
|
50
|
+
var fieldIdValidator = (0, _react.useCallback)(function (fieldId) {
|
|
43
51
|
if (fieldId.trim().toLowerCase() !== "id") {
|
|
44
52
|
return true;
|
|
45
53
|
}
|
|
46
|
-
|
|
47
54
|
throw new Error("Cannot use \"id\" as Field ID.");
|
|
48
|
-
},
|
|
49
|
-
var uniqueFieldIdValidator = useCallback(function (fieldId) {
|
|
55
|
+
}, []);
|
|
56
|
+
var uniqueFieldIdValidator = (0, _react.useCallback)(function (fieldId) {
|
|
50
57
|
var existingField = getField({
|
|
51
58
|
fieldId: fieldId
|
|
52
59
|
});
|
|
53
|
-
|
|
54
60
|
if (!existingField) {
|
|
55
|
-
return;
|
|
61
|
+
return false;
|
|
56
62
|
}
|
|
57
|
-
|
|
58
63
|
if (existingField.id === field.id) {
|
|
59
64
|
return true;
|
|
60
65
|
}
|
|
61
|
-
|
|
62
66
|
throw new Error("Please enter a unique Field ID.");
|
|
63
|
-
},
|
|
67
|
+
}, []);
|
|
64
68
|
var additionalSettings = null;
|
|
65
|
-
|
|
66
69
|
if (typeof fieldPlugin.field.renderSettings === "function") {
|
|
67
70
|
additionalSettings = fieldPlugin.field.renderSettings({
|
|
68
|
-
form: form,
|
|
69
71
|
afterChangeLabel: afterChangeLabel,
|
|
70
72
|
uniqueFieldIdValidator: uniqueFieldIdValidator,
|
|
71
|
-
contentModel:
|
|
73
|
+
contentModel: contentModel
|
|
72
74
|
});
|
|
73
75
|
}
|
|
74
|
-
|
|
75
|
-
var predefinedValuesEnabled = useMemo(function () {
|
|
76
|
+
var predefinedValuesEnabled = (0, _react.useMemo)(function () {
|
|
76
77
|
return fieldPlugin.field.allowPredefinedValues && typeof fieldPlugin.field.renderPredefinedValues === "function";
|
|
77
78
|
}, [field.fieldId]);
|
|
78
|
-
return /*#__PURE__*/
|
|
79
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
79
80
|
span: 6
|
|
80
|
-
}, /*#__PURE__*/
|
|
81
|
+
}, /*#__PURE__*/_react.default.createElement(_form.Bind, {
|
|
81
82
|
name: "label",
|
|
82
|
-
validators: validation.create("required"),
|
|
83
|
-
afterChange:
|
|
84
|
-
|
|
83
|
+
validators: _validation.validation.create("required"),
|
|
84
|
+
afterChange: function afterChange(value) {
|
|
85
|
+
if (field.id) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
afterChangeLabel(value);
|
|
89
|
+
}
|
|
90
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
85
91
|
label: "Label",
|
|
86
|
-
inputRef: inputRef
|
|
87
|
-
|
|
92
|
+
inputRef: inputRef,
|
|
93
|
+
"data-testid": "cms.editor.field.settings.general.label"
|
|
94
|
+
}))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
88
95
|
span: 6
|
|
89
|
-
}, /*#__PURE__*/
|
|
96
|
+
}, /*#__PURE__*/_react.default.createElement(_form.Bind, {
|
|
90
97
|
name: "fieldId",
|
|
91
|
-
validators: [validation.create("required"), uniqueFieldIdValidator, fieldIdValidator],
|
|
98
|
+
validators: [_validation.validation.create("required"), uniqueFieldIdValidator, fieldIdValidator],
|
|
92
99
|
beforeChange: beforeChangeFieldId
|
|
93
|
-
}, /*#__PURE__*/
|
|
100
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
94
101
|
label: "Field ID",
|
|
95
|
-
|
|
96
|
-
}))), /*#__PURE__*/
|
|
102
|
+
"data-testid": "cms.editor.field.settings.general.label-".concat(field.id)
|
|
103
|
+
}))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
97
104
|
span: 6
|
|
98
|
-
}, /*#__PURE__*/
|
|
105
|
+
}, /*#__PURE__*/_react.default.createElement(_form.Bind, {
|
|
99
106
|
name: "multipleValues"
|
|
100
|
-
}, /*#__PURE__*/
|
|
107
|
+
}, /*#__PURE__*/_react.default.createElement(_Switch.Switch, {
|
|
101
108
|
label: fieldPlugin.field.multipleValuesLabel,
|
|
102
|
-
disabled: !fieldPlugin.field.allowMultipleValues
|
|
103
|
-
|
|
109
|
+
disabled: !fieldPlugin.field.allowMultipleValues,
|
|
110
|
+
"data-testid": "cms.editor.field.settings.general.switch-multiplevalues"
|
|
111
|
+
}))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
104
112
|
span: 6
|
|
105
|
-
}, /*#__PURE__*/
|
|
113
|
+
}, /*#__PURE__*/_react.default.createElement(_form.Bind, {
|
|
106
114
|
name: "predefinedValues.enabled"
|
|
107
|
-
}, /*#__PURE__*/
|
|
115
|
+
}, /*#__PURE__*/_react.default.createElement(_Switch.Switch, {
|
|
108
116
|
label: "Use predefined values",
|
|
109
|
-
disabled: !predefinedValuesEnabled
|
|
110
|
-
|
|
117
|
+
disabled: !predefinedValuesEnabled,
|
|
118
|
+
"data-testid": "cms.editor.field.settings.general.switch-predefinedvalues"
|
|
119
|
+
}))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
111
120
|
span: 12
|
|
112
|
-
}, /*#__PURE__*/
|
|
121
|
+
}, /*#__PURE__*/_react.default.createElement(_form.Bind, {
|
|
113
122
|
name: "helpText"
|
|
114
|
-
}, /*#__PURE__*/
|
|
123
|
+
}, /*#__PURE__*/_react.default.createElement(_Input.Input, {
|
|
115
124
|
label: "Help text",
|
|
116
|
-
description: "Help text (optional)"
|
|
125
|
+
description: "Help text (optional)",
|
|
126
|
+
"data-testid": "cms.editor.field.settings.general.helptext"
|
|
127
|
+
}))), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
128
|
+
span: 12
|
|
129
|
+
}, /*#__PURE__*/_react.default.createElement(_form.Bind, {
|
|
130
|
+
name: "tags"
|
|
131
|
+
}, /*#__PURE__*/_react.default.createElement(_Tags.Tags, {
|
|
132
|
+
label: "Tags",
|
|
133
|
+
protectedTags: fieldPlugin.field.tags,
|
|
134
|
+
description: "Field tags (optional)",
|
|
135
|
+
"data-testid": "cms.editor.field.settings.general.tags"
|
|
117
136
|
})))), additionalSettings);
|
|
118
137
|
};
|
|
119
|
-
|
|
120
|
-
|
|
138
|
+
var _default = GeneralTab;
|
|
139
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GeneralTab","form","useForm","useModelField","field","fieldPlugin","inputRef","useRef","useModelEditor","contentModel","data","useModelFieldEditor","getField","useEffect","setTimeout","current","focus","afterChangeLabel","useCallback","value","setValue","beforeChangeFieldId","baseOnChange","trim","fieldIdValidator","fieldId","toLowerCase","Error","uniqueFieldIdValidator","existingField","id","additionalSettings","renderSettings","predefinedValuesEnabled","useMemo","allowPredefinedValues","renderPredefinedValues","validation","create","multipleValuesLabel","allowMultipleValues","tags"],"sources":["GeneralTab.tsx"],"sourcesContent":["import React, { useEffect, useCallback, useRef, useMemo } from \"react\";\nimport { camelCase } from \"lodash\";\nimport { Input } from \"@webiny/ui/Input\";\nimport { Switch } from \"@webiny/ui/Switch\";\nimport { Grid, Cell } from \"@webiny/ui/Grid\";\nimport { validation } from \"@webiny/validation\";\nimport { Tags } from \"@webiny/ui/Tags\";\nimport { useForm, Bind } from \"@webiny/form\";\nimport { useModelFieldEditor } from \"~/admin/components/FieldEditor\";\nimport { useModelEditor } from \"~/admin/hooks\";\nimport { useModelField } from \"~/admin/hooks\";\n\nconst GeneralTab = () => {\n const form = useForm();\n const { field, fieldPlugin } = useModelField();\n const inputRef = useRef<HTMLInputElement | null>(null);\n const { data: contentModel } = useModelEditor();\n const { getField } = useModelFieldEditor();\n\n // Had problems with auto-focusing the \"label\" field. A couple of comments on this.\n // 1. It's probably caused by the Tabs component which wraps this component.\n // 2. It seems that the \"autoFocus\" prop on the Input doesn't work. I can't see it attached in the actual DOM.\n // 3. This works, but it's not 100%. Visually, the cursor is frozen, and that's probably caused by a bug / design\n // in the RMWC / Material library. If you were to click somewhere on screen, and then apply focus, then\n // it seems it's behaving correctly. ¯\\_(ツ)_/¯\n useEffect(() => {\n setTimeout(() => {\n if (!inputRef.current) {\n return;\n }\n inputRef.current.focus();\n }, /* The value of 400 was determined by manual testing. */ 400);\n }, []);\n\n const afterChangeLabel = useCallback((value: string) => {\n form.setValue(\"fieldId\", camelCase(value));\n }, []);\n\n const beforeChangeFieldId = useCallback(\n (value: string, baseOnChange: (value: string) => void) => {\n baseOnChange(value.trim());\n },\n []\n );\n\n const fieldIdValidator = useCallback(fieldId => {\n if (fieldId.trim().toLowerCase() !== \"id\") {\n return true;\n }\n\n throw new Error(`Cannot use \"id\" as Field ID.`);\n }, []);\n\n const uniqueFieldIdValidator = useCallback((fieldId: string) => {\n const existingField = getField({ fieldId });\n if (!existingField) {\n return false;\n }\n\n if (existingField.id === field.id) {\n return true;\n }\n throw new Error(\"Please enter a unique Field ID.\");\n }, []);\n\n let additionalSettings: React.ReactNode | null = null;\n if (typeof fieldPlugin.field.renderSettings === \"function\") {\n additionalSettings = fieldPlugin.field.renderSettings({\n afterChangeLabel,\n uniqueFieldIdValidator,\n contentModel\n });\n }\n\n const predefinedValuesEnabled = useMemo(\n (): boolean =>\n fieldPlugin.field.allowPredefinedValues &&\n typeof fieldPlugin.field.renderPredefinedValues === \"function\",\n [field.fieldId]\n );\n\n return (\n <>\n <Grid>\n <Cell span={6}>\n <Bind\n name={\"label\"}\n validators={validation.create(\"required\")}\n afterChange={(value: string) => {\n if (field.id) {\n return;\n }\n afterChangeLabel(value);\n }}\n >\n <Input\n label={\"Label\"}\n inputRef={inputRef}\n data-testid=\"cms.editor.field.settings.general.label\"\n />\n </Bind>\n </Cell>\n <Cell span={6}>\n <Bind\n name={\"fieldId\"}\n validators={[\n validation.create(\"required\"),\n uniqueFieldIdValidator,\n fieldIdValidator\n ]}\n beforeChange={beforeChangeFieldId}\n >\n <Input\n label={\"Field ID\"}\n data-testid={`cms.editor.field.settings.general.label-${field.id}`}\n />\n </Bind>\n </Cell>\n\n <Cell span={6}>\n <Bind name={\"multipleValues\"}>\n <Switch\n label={fieldPlugin.field.multipleValuesLabel}\n disabled={!fieldPlugin.field.allowMultipleValues}\n data-testid={`cms.editor.field.settings.general.switch-multiplevalues`}\n />\n </Bind>\n </Cell>\n <Cell span={6}>\n <Bind name={\"predefinedValues.enabled\"}>\n <Switch\n label={\"Use predefined values\"}\n disabled={!predefinedValuesEnabled}\n data-testid={`cms.editor.field.settings.general.switch-predefinedvalues`}\n />\n </Bind>\n </Cell>\n\n <Cell span={12}>\n <Bind name={\"helpText\"}>\n <Input\n label={\"Help text\"}\n description={\"Help text (optional)\"}\n data-testid={`cms.editor.field.settings.general.helptext`}\n />\n </Bind>\n </Cell>\n <Cell span={12}>\n <Bind name={\"tags\"}>\n <Tags\n label={\"Tags\"}\n protectedTags={fieldPlugin.field.tags}\n description={\"Field tags (optional)\"}\n data-testid={`cms.editor.field.settings.general.tags`}\n />\n </Bind>\n </Cell>\n </Grid>\n {additionalSettings}\n </>\n );\n};\n\nexport default GeneralTab;\n"],"mappings":";;;;;;;;;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA,IAAMA,UAAU,GAAG,SAAbA,UAAU,GAAS;EACrB,IAAMC,IAAI,GAAG,IAAAC,aAAO,GAAE;EACtB,qBAA+B,IAAAC,oBAAa,GAAE;IAAtCC,KAAK,kBAALA,KAAK;IAAEC,WAAW,kBAAXA,WAAW;EAC1B,IAAMC,QAAQ,GAAG,IAAAC,aAAM,EAA0B,IAAI,CAAC;EACtD,sBAA+B,IAAAC,qBAAc,GAAE;IAAjCC,YAAY,mBAAlBC,IAAI;EACZ,2BAAqB,IAAAC,qBAAmB,GAAE;IAAlCC,QAAQ,wBAARA,QAAQ;;EAEhB;EACA;EACA;EACA;EACA;EACA;EACA,IAAAC,gBAAS,EAAC,YAAM;IACZC,UAAU,CAAC,YAAM;MACb,IAAI,CAACR,QAAQ,CAACS,OAAO,EAAE;QACnB;MACJ;MACAT,QAAQ,CAACS,OAAO,CAACC,KAAK,EAAE;IAC5B,CAAC,EAAE,wDAAyD,GAAG,CAAC;EACpE,CAAC,EAAE,EAAE,CAAC;EAEN,IAAMC,gBAAgB,GAAG,IAAAC,kBAAW,EAAC,UAACC,KAAa,EAAK;IACpDlB,IAAI,CAACmB,QAAQ,CAAC,SAAS,EAAE,yBAAUD,KAAK,CAAC,CAAC;EAC9C,CAAC,EAAE,EAAE,CAAC;EAEN,IAAME,mBAAmB,GAAG,IAAAH,kBAAW,EACnC,UAACC,KAAa,EAAEG,YAAqC,EAAK;IACtDA,YAAY,CAACH,KAAK,CAACI,IAAI,EAAE,CAAC;EAC9B,CAAC,EACD,EAAE,CACL;EAED,IAAMC,gBAAgB,GAAG,IAAAN,kBAAW,EAAC,UAAAO,OAAO,EAAI;IAC5C,IAAIA,OAAO,CAACF,IAAI,EAAE,CAACG,WAAW,EAAE,KAAK,IAAI,EAAE;MACvC,OAAO,IAAI;IACf;IAEA,MAAM,IAAIC,KAAK,kCAAgC;EACnD,CAAC,EAAE,EAAE,CAAC;EAEN,IAAMC,sBAAsB,GAAG,IAAAV,kBAAW,EAAC,UAACO,OAAe,EAAK;IAC5D,IAAMI,aAAa,GAAGjB,QAAQ,CAAC;MAAEa,OAAO,EAAPA;IAAQ,CAAC,CAAC;IAC3C,IAAI,CAACI,aAAa,EAAE;MAChB,OAAO,KAAK;IAChB;IAEA,IAAIA,aAAa,CAACC,EAAE,KAAK1B,KAAK,CAAC0B,EAAE,EAAE;MAC/B,OAAO,IAAI;IACf;IACA,MAAM,IAAIH,KAAK,CAAC,iCAAiC,CAAC;EACtD,CAAC,EAAE,EAAE,CAAC;EAEN,IAAII,kBAA0C,GAAG,IAAI;EACrD,IAAI,OAAO1B,WAAW,CAACD,KAAK,CAAC4B,cAAc,KAAK,UAAU,EAAE;IACxDD,kBAAkB,GAAG1B,WAAW,CAACD,KAAK,CAAC4B,cAAc,CAAC;MAClDf,gBAAgB,EAAhBA,gBAAgB;MAChBW,sBAAsB,EAAtBA,sBAAsB;MACtBnB,YAAY,EAAZA;IACJ,CAAC,CAAC;EACN;EAEA,IAAMwB,uBAAuB,GAAG,IAAAC,cAAO,EACnC;IAAA,OACI7B,WAAW,CAACD,KAAK,CAAC+B,qBAAqB,IACvC,OAAO9B,WAAW,CAACD,KAAK,CAACgC,sBAAsB,KAAK,UAAU;EAAA,GAClE,CAAChC,KAAK,CAACqB,OAAO,CAAC,CAClB;EAED,oBACI,yEACI,6BAAC,UAAI,qBACD,6BAAC,UAAI;IAAC,IAAI,EAAE;EAAE,gBACV,6BAAC,UAAI;IACD,IAAI,EAAE,OAAQ;IACd,UAAU,EAAEY,sBAAU,CAACC,MAAM,CAAC,UAAU,CAAE;IAC1C,WAAW,EAAE,qBAACnB,KAAa,EAAK;MAC5B,IAAIf,KAAK,CAAC0B,EAAE,EAAE;QACV;MACJ;MACAb,gBAAgB,CAACE,KAAK,CAAC;IAC3B;EAAE,gBAEF,6BAAC,YAAK;IACF,KAAK,EAAE,OAAQ;IACf,QAAQ,EAAEb,QAAS;IACnB,eAAY;EAAyC,EACvD,CACC,CACJ,eACP,6BAAC,UAAI;IAAC,IAAI,EAAE;EAAE,gBACV,6BAAC,UAAI;IACD,IAAI,EAAE,SAAU;IAChB,UAAU,EAAE,CACR+B,sBAAU,CAACC,MAAM,CAAC,UAAU,CAAC,EAC7BV,sBAAsB,EACtBJ,gBAAgB,CAClB;IACF,YAAY,EAAEH;EAAoB,gBAElC,6BAAC,YAAK;IACF,KAAK,EAAE,UAAW;IAClB,iEAAwDjB,KAAK,CAAC0B,EAAE;EAAG,EACrE,CACC,CACJ,eAEP,6BAAC,UAAI;IAAC,IAAI,EAAE;EAAE,gBACV,6BAAC,UAAI;IAAC,IAAI,EAAE;EAAiB,gBACzB,6BAAC,cAAM;IACH,KAAK,EAAEzB,WAAW,CAACD,KAAK,CAACmC,mBAAoB;IAC7C,QAAQ,EAAE,CAAClC,WAAW,CAACD,KAAK,CAACoC,mBAAoB;IACjD;EAAuE,EACzE,CACC,CACJ,eACP,6BAAC,UAAI;IAAC,IAAI,EAAE;EAAE,gBACV,6BAAC,UAAI;IAAC,IAAI,EAAE;EAA2B,gBACnC,6BAAC,cAAM;IACH,KAAK,EAAE,uBAAwB;IAC/B,QAAQ,EAAE,CAACP,uBAAwB;IACnC;EAAyE,EAC3E,CACC,CACJ,eAEP,6BAAC,UAAI;IAAC,IAAI,EAAE;EAAG,gBACX,6BAAC,UAAI;IAAC,IAAI,EAAE;EAAW,gBACnB,6BAAC,YAAK;IACF,KAAK,EAAE,WAAY;IACnB,WAAW,EAAE,sBAAuB;IACpC;EAA0D,EAC5D,CACC,CACJ,eACP,6BAAC,UAAI;IAAC,IAAI,EAAE;EAAG,gBACX,6BAAC,UAAI;IAAC,IAAI,EAAE;EAAO,gBACf,6BAAC,UAAI;IACD,KAAK,EAAE,MAAO;IACd,aAAa,EAAE5B,WAAW,CAACD,KAAK,CAACqC,IAAK;IACtC,WAAW,EAAE,uBAAwB;IACrC;EAAsD,EACxD,CACC,CACJ,CACJ,EACNV,kBAAkB,CACpB;AAEX,CAAC;AAAC,eAEa/B,UAAU;AAAA"}
|
|
@@ -1,55 +1,81 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
|
10
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
+
var _getValue = _interopRequireDefault(require("./functions/getValue"));
|
|
14
|
+
var _setValue = _interopRequireDefault(require("./functions/setValue"));
|
|
15
|
+
var _form = require("@webiny/form");
|
|
16
|
+
var _hooks = require("../../../hooks");
|
|
17
|
+
var PredefinedValues = function PredefinedValues() {
|
|
18
|
+
var _useModelField = (0, _hooks.useModelField)(),
|
|
19
|
+
field = _useModelField.field,
|
|
20
|
+
fieldPlugin = _useModelField.fieldPlugin;
|
|
21
|
+
var memoizedBindComponents = (0, _react.useRef)({});
|
|
22
|
+
var getBind = (0, _react.useCallback)(function () {
|
|
12
23
|
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
13
24
|
var memoKey = index;
|
|
14
|
-
|
|
15
25
|
if (memoizedBindComponents.current[memoKey]) {
|
|
16
26
|
return memoizedBindComponents.current[memoKey];
|
|
17
27
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return /*#__PURE__*/React.createElement(BaseFormBind, {
|
|
28
|
+
var Bind = function Bind(_ref) {
|
|
29
|
+
var children = _ref.children,
|
|
30
|
+
name = _ref.name;
|
|
31
|
+
return /*#__PURE__*/_react.default.createElement(_form.Bind, {
|
|
23
32
|
name: "predefinedValues.values"
|
|
24
33
|
}, function (bind) {
|
|
25
|
-
var props =
|
|
26
|
-
value:
|
|
34
|
+
var props = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, bind), {}, {
|
|
35
|
+
value: (0, _getValue.default)({
|
|
27
36
|
bind: bind,
|
|
28
37
|
index: index,
|
|
29
38
|
name: name
|
|
30
39
|
}),
|
|
31
|
-
onChange: function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
onChange: function () {
|
|
41
|
+
var _onChange = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(value) {
|
|
42
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
43
|
+
while (1) switch (_context.prev = _context.next) {
|
|
44
|
+
case 0:
|
|
45
|
+
_context.next = 2;
|
|
46
|
+
return (0, _setValue.default)({
|
|
47
|
+
value: value,
|
|
48
|
+
bind: bind,
|
|
49
|
+
index: index,
|
|
50
|
+
name: name
|
|
51
|
+
});
|
|
52
|
+
case 2:
|
|
53
|
+
case "end":
|
|
54
|
+
return _context.stop();
|
|
55
|
+
}
|
|
56
|
+
}, _callee);
|
|
57
|
+
}));
|
|
58
|
+
function onChange(_x) {
|
|
59
|
+
return _onChange.apply(this, arguments);
|
|
60
|
+
}
|
|
61
|
+
return onChange;
|
|
62
|
+
}()
|
|
39
63
|
});
|
|
40
|
-
|
|
41
64
|
if (typeof children === "function") {
|
|
42
65
|
return children(props);
|
|
43
66
|
}
|
|
44
|
-
|
|
45
|
-
return /*#__PURE__*/cloneElement(children, props);
|
|
67
|
+
return /*#__PURE__*/(0, _react.cloneElement)(children, props);
|
|
46
68
|
});
|
|
47
69
|
};
|
|
48
|
-
|
|
70
|
+
memoizedBindComponents.current[memoKey] = Bind;
|
|
49
71
|
return memoizedBindComponents.current[memoKey];
|
|
50
72
|
}, []);
|
|
51
|
-
|
|
52
|
-
field: field,
|
|
73
|
+
if (!fieldPlugin.field.renderPredefinedValues) {
|
|
74
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "Missing \"field.renderPredefinedValues\" method in field type plugin: \"".concat(field.type, "\"."));
|
|
75
|
+
}
|
|
76
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, fieldPlugin.field.renderPredefinedValues({
|
|
53
77
|
getBind: getBind
|
|
54
|
-
});
|
|
55
|
-
}
|
|
78
|
+
}));
|
|
79
|
+
};
|
|
80
|
+
var _default = PredefinedValues;
|
|
81
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PredefinedValues","useModelField","field","fieldPlugin","memoizedBindComponents","useRef","getBind","useCallback","index","memoKey","current","Bind","children","name","bind","props","value","getValue","onChange","setValue","cloneElement","renderPredefinedValues","type"],"sources":["PredefinedValues.tsx"],"sourcesContent":["import React, { useCallback, useRef, cloneElement } from \"react\";\nimport getValue from \"./functions/getValue\";\nimport setValue from \"./functions/setValue\";\nimport { BindComponent, Bind as BaseFormBind } from \"@webiny/form\";\nimport { useModelField } from \"~/admin/hooks\";\n\ninterface MemoizedBindComponents {\n [key: string]: BindComponent;\n}\n\nconst PredefinedValues = () => {\n const { field, fieldPlugin } = useModelField();\n const memoizedBindComponents = useRef<MemoizedBindComponents>({});\n\n const getBind = useCallback((index = -1) => {\n const memoKey = index;\n if (memoizedBindComponents.current[memoKey]) {\n return memoizedBindComponents.current[memoKey];\n }\n\n const Bind: BindComponent = ({ children, name }) => {\n return (\n <BaseFormBind name={\"predefinedValues.values\"}>\n {bind => {\n const props = {\n ...bind,\n value: getValue({ bind, index, name }),\n onChange: async (value: string[]) => {\n await setValue({ value, bind, index, name });\n }\n };\n\n if (typeof children === \"function\") {\n return children(props);\n }\n\n return cloneElement(children as unknown as React.ReactElement, props);\n }}\n </BaseFormBind>\n );\n };\n\n memoizedBindComponents.current[memoKey] = Bind;\n\n return memoizedBindComponents.current[memoKey];\n }, []);\n if (!fieldPlugin.field.renderPredefinedValues) {\n return (\n <>{`Missing \"field.renderPredefinedValues\" method in field type plugin: \"${field.type}\".`}</>\n );\n }\n\n return <>{fieldPlugin.field.renderPredefinedValues({ getBind })}</>;\n};\n\nexport default PredefinedValues;\n"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AAMA,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgB,GAAS;EAC3B,qBAA+B,IAAAC,oBAAa,GAAE;IAAtCC,KAAK,kBAALA,KAAK;IAAEC,WAAW,kBAAXA,WAAW;EAC1B,IAAMC,sBAAsB,GAAG,IAAAC,aAAM,EAAyB,CAAC,CAAC,CAAC;EAEjE,IAAMC,OAAO,GAAG,IAAAC,kBAAW,EAAC,YAAgB;IAAA,IAAfC,KAAK,uEAAG,CAAC,CAAC;IACnC,IAAMC,OAAO,GAAGD,KAAK;IACrB,IAAIJ,sBAAsB,CAACM,OAAO,CAACD,OAAO,CAAC,EAAE;MACzC,OAAOL,sBAAsB,CAACM,OAAO,CAACD,OAAO,CAAC;IAClD;IAEA,IAAME,IAAmB,GAAG,SAAtBA,IAAmB,OAA2B;MAAA,IAArBC,QAAQ,QAARA,QAAQ;QAAEC,IAAI,QAAJA,IAAI;MACzC,oBACI,6BAAC,UAAY;QAAC,IAAI,EAAE;MAA0B,GACzC,UAAAC,IAAI,EAAI;QACL,IAAMC,KAAK,+DACJD,IAAI;UACPE,KAAK,EAAE,IAAAC,iBAAQ,EAAC;YAAEH,IAAI,EAAJA,IAAI;YAAEN,KAAK,EAALA,KAAK;YAAEK,IAAI,EAAJA;UAAK,CAAC,CAAC;UACtCK,QAAQ;YAAA,uGAAE,iBAAOF,KAAe;cAAA;gBAAA;kBAAA;oBAAA;oBAAA,OACtB,IAAAG,iBAAQ,EAAC;sBAAEH,KAAK,EAALA,KAAK;sBAAEF,IAAI,EAAJA,IAAI;sBAAEN,KAAK,EAALA,KAAK;sBAAEK,IAAI,EAAJA;oBAAK,CAAC,CAAC;kBAAA;kBAAA;oBAAA;gBAAA;cAAA;YAAA,CAC/C;YAAA;cAAA;YAAA;YAAA;UAAA;QAAA,EACJ;QAED,IAAI,OAAOD,QAAQ,KAAK,UAAU,EAAE;UAChC,OAAOA,QAAQ,CAACG,KAAK,CAAC;QAC1B;QAEA,oBAAO,IAAAK,mBAAY,EAACR,QAAQ,EAAmCG,KAAK,CAAC;MACzE,CAAC,CACU;IAEvB,CAAC;IAEDX,sBAAsB,CAACM,OAAO,CAACD,OAAO,CAAC,GAAGE,IAAI;IAE9C,OAAOP,sBAAsB,CAACM,OAAO,CAACD,OAAO,CAAC;EAClD,CAAC,EAAE,EAAE,CAAC;EACN,IAAI,CAACN,WAAW,CAACD,KAAK,CAACmB,sBAAsB,EAAE;IAC3C,oBACI,8IAA2EnB,KAAK,CAACoB,IAAI,SAAQ;EAErG;EAEA,oBAAO,4DAAGnB,WAAW,CAACD,KAAK,CAACmB,sBAAsB,CAAC;IAAEf,OAAO,EAAPA;EAAQ,CAAC,CAAC,CAAI;AACvE,CAAC;AAAC,eAEaN,gBAAgB;AAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CmsModelFieldValidatorConfigAdapter } from "../../../../utils/CmsModelFieldValidatorConfigAdapter";
|
|
3
|
+
interface ValidatorsSectionProps {
|
|
4
|
+
title: string;
|
|
5
|
+
fieldKey: "validators" | "listValidators";
|
|
6
|
+
description: string;
|
|
7
|
+
validators: CmsModelFieldValidatorConfigAdapter[];
|
|
8
|
+
}
|
|
9
|
+
export declare const ValidationsSection: ({ title, description, fieldKey, validators }: ValidatorsSectionProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ValidationsSection = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _Grid = require("@webiny/ui/Grid");
|
|
10
|
+
var _Typography = require("@webiny/ui/Typography");
|
|
11
|
+
var _ValidatorsList = require("./ValidatorsList");
|
|
12
|
+
var bindTo = {
|
|
13
|
+
validators: "validation",
|
|
14
|
+
listValidators: "listValidation"
|
|
15
|
+
};
|
|
16
|
+
var ValidationsSection = function ValidationsSection(_ref) {
|
|
17
|
+
var title = _ref.title,
|
|
18
|
+
description = _ref.description,
|
|
19
|
+
fieldKey = _ref.fieldKey,
|
|
20
|
+
validators = _ref.validators;
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_Grid.Grid, null, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
22
|
+
span: 12
|
|
23
|
+
}, /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
24
|
+
use: "headline5"
|
|
25
|
+
}, title), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement(_Typography.Typography, {
|
|
26
|
+
use: "body2"
|
|
27
|
+
}, description)), /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
28
|
+
span: 12
|
|
29
|
+
}, /*#__PURE__*/_react.default.createElement(_ValidatorsList.ValidatorsList, {
|
|
30
|
+
name: bindTo[fieldKey],
|
|
31
|
+
validators: validators
|
|
32
|
+
})));
|
|
33
|
+
};
|
|
34
|
+
exports.ValidationsSection = ValidationsSection;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["bindTo","validators","listValidators","ValidationsSection","title","description","fieldKey"],"sources":["ValidationsSection.tsx"],"sourcesContent":["import React from \"react\";\nimport { Cell, Grid } from \"@webiny/ui/Grid\";\nimport { Typography } from \"@webiny/ui/Typography\";\nimport { ValidatorsList } from \"./ValidatorsList\";\nimport { CmsModelFieldValidatorConfigAdapter } from \"~/utils/CmsModelFieldValidatorConfigAdapter\";\n\ninterface ValidatorsSectionProps {\n title: string;\n fieldKey: \"validators\" | \"listValidators\";\n description: string;\n validators: CmsModelFieldValidatorConfigAdapter[];\n}\n\nconst bindTo = {\n validators: \"validation\",\n listValidators: \"listValidation\"\n};\n\nexport const ValidationsSection = ({\n title,\n description,\n fieldKey,\n validators\n}: ValidatorsSectionProps) => {\n return (\n <Grid>\n <Cell span={12}>\n <Typography use={\"headline5\"}>{title}</Typography>\n <br />\n <Typography use={\"body2\"}>{description}</Typography>\n </Cell>\n <Cell span={12}>\n <ValidatorsList name={bindTo[fieldKey]} validators={validators} />\n </Cell>\n </Grid>\n );\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AAUA,IAAMA,MAAM,GAAG;EACXC,UAAU,EAAE,YAAY;EACxBC,cAAc,EAAE;AACpB,CAAC;AAEM,IAAMC,kBAAkB,GAAG,SAArBA,kBAAkB,OAKD;EAAA,IAJ1BC,KAAK,QAALA,KAAK;IACLC,WAAW,QAAXA,WAAW;IACXC,QAAQ,QAARA,QAAQ;IACRL,UAAU,QAAVA,UAAU;EAEV,oBACI,6BAAC,UAAI,qBACD,6BAAC,UAAI;IAAC,IAAI,EAAE;EAAG,gBACX,6BAAC,sBAAU;IAAC,GAAG,EAAE;EAAY,GAAEG,KAAK,CAAc,eAClD,wCAAM,eACN,6BAAC,sBAAU;IAAC,GAAG,EAAE;EAAQ,GAAEC,WAAW,CAAc,CACjD,eACP,6BAAC,UAAI;IAAC,IAAI,EAAE;EAAG,gBACX,6BAAC,8BAAc;IAAC,IAAI,EAAEL,MAAM,CAACM,QAAQ,CAAE;IAAC,UAAU,EAAEL;EAAW,EAAG,CAC/D,CACJ;AAEf,CAAC;AAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CmsModelFieldValidatorConfigAdapter } from "../../../../utils/CmsModelFieldValidatorConfigAdapter";
|
|
3
|
+
interface ValidatorsTabProps {
|
|
4
|
+
name: string;
|
|
5
|
+
validators: CmsModelFieldValidatorConfigAdapter[];
|
|
6
|
+
}
|
|
7
|
+
export declare const ValidatorsList: React.FC<ValidatorsTabProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.ValidatorsList = void 0;
|
|
9
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
10
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
var _debounce2 = _interopRequireDefault(require("lodash/debounce"));
|
|
12
|
+
var _cloneDeep2 = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
14
|
+
var _emotion = require("emotion");
|
|
15
|
+
var _plugins = require("@webiny/plugins");
|
|
16
|
+
var _Switch = require("@webiny/ui/Switch");
|
|
17
|
+
var _form = require("@webiny/form");
|
|
18
|
+
var _Grid = require("@webiny/ui/Grid");
|
|
19
|
+
var _validation = require("@webiny/validation");
|
|
20
|
+
var _Input = require("@webiny/ui/Input");
|
|
21
|
+
var _Accordion = require("@webiny/ui/Accordion");
|
|
22
|
+
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
23
|
+
var _Tooltip = require("@webiny/ui/Tooltip");
|
|
24
|
+
var Variable = /*#__PURE__*/(0, _styled.default)("span", {
|
|
25
|
+
label: "Variable",
|
|
26
|
+
target: "e19f04zm0"
|
|
27
|
+
})("font-weight:bold;cursor:pointer;");
|
|
28
|
+
var Comma = /*#__PURE__*/(0, _styled.default)("span", {
|
|
29
|
+
label: "Comma",
|
|
30
|
+
target: "e19f04zm1"
|
|
31
|
+
})("padding-right:5px;");
|
|
32
|
+
var noPadding = /*#__PURE__*/(0, _emotion.css)(".webiny-ui-accordion-item__content{padding:0 !important;}label:noPadding;");
|
|
33
|
+
var gridBottomPadding = /*#__PURE__*/(0, _emotion.css)(":not(:last-child){padding-bottom:0;}label:gridBottomPadding;");
|
|
34
|
+
var onEnabledChange = function onEnabledChange(params) {
|
|
35
|
+
var data = params.data,
|
|
36
|
+
validationValue = params.validationValue,
|
|
37
|
+
onChangeValidation = params.onChangeValidation,
|
|
38
|
+
validator = params.validator;
|
|
39
|
+
if (data) {
|
|
40
|
+
var index = validationValue.findIndex(function (item) {
|
|
41
|
+
return item.name === validator.getName();
|
|
42
|
+
});
|
|
43
|
+
onChangeValidation([].concat((0, _toConsumableArray2.default)(validationValue.slice(0, index)), (0, _toConsumableArray2.default)(validationValue.slice(index + 1))));
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
onChangeValidation([].concat((0, _toConsumableArray2.default)(validationValue), [{
|
|
47
|
+
name: validator.getName(),
|
|
48
|
+
settings: validator.getDefaultSettings(),
|
|
49
|
+
message: validator.getDefaultMessage()
|
|
50
|
+
}]));
|
|
51
|
+
};
|
|
52
|
+
var onFormChange = (0, _debounce2.default)(function (_ref) {
|
|
53
|
+
var data = _ref.data,
|
|
54
|
+
validationValue = _ref.validationValue,
|
|
55
|
+
onChangeValidation = _ref.onChangeValidation,
|
|
56
|
+
validatorIndex = _ref.validatorIndex;
|
|
57
|
+
var newValidationValue = (0, _cloneDeep2.default)(validationValue);
|
|
58
|
+
newValidationValue[validatorIndex] = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, newValidationValue[validatorIndex]), (0, _cloneDeep2.default)(data));
|
|
59
|
+
onChangeValidation(newValidationValue);
|
|
60
|
+
}, 200);
|
|
61
|
+
var renderEmpty = function renderEmpty() {
|
|
62
|
+
return null;
|
|
63
|
+
};
|
|
64
|
+
var getValidatorPlugin = function getValidatorPlugin(name) {
|
|
65
|
+
var plugin = _plugins.plugins.byType("cms-model-field-validator").find(function (plugin) {
|
|
66
|
+
return plugin.validator.name === name;
|
|
67
|
+
});
|
|
68
|
+
if (!plugin) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
return plugin.validator;
|
|
72
|
+
};
|
|
73
|
+
var ValidatorItem = function ValidatorItem(_ref2) {
|
|
74
|
+
var validator = _ref2.validator,
|
|
75
|
+
value = _ref2.value,
|
|
76
|
+
_onChange = _ref2.onChange;
|
|
77
|
+
var validatorName = validator.getName();
|
|
78
|
+
var plugin = getValidatorPlugin(validatorName);
|
|
79
|
+
if (!plugin) {
|
|
80
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null);
|
|
81
|
+
}
|
|
82
|
+
var validatorIndex = (value || []).findIndex(function (item) {
|
|
83
|
+
return item.name === validatorName;
|
|
84
|
+
});
|
|
85
|
+
var data = (value || [])[validatorIndex];
|
|
86
|
+
if (typeof plugin.renderCustomUi === "function") {
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, {
|
|
88
|
+
key: validatorName
|
|
89
|
+
}, plugin.renderCustomUi());
|
|
90
|
+
}
|
|
91
|
+
var renderSettings = plugin.renderSettings || renderEmpty;
|
|
92
|
+
var actions = !validator.isRequired() ? /*#__PURE__*/_react.default.createElement(_Accordion.AccordionItem.Actions, null, /*#__PURE__*/_react.default.createElement(_Switch.Switch, {
|
|
93
|
+
label: "Enabled",
|
|
94
|
+
value: validatorIndex >= 0,
|
|
95
|
+
onChange: function onChange() {
|
|
96
|
+
return onEnabledChange({
|
|
97
|
+
data: data,
|
|
98
|
+
validationValue: value,
|
|
99
|
+
onChangeValidation: _onChange,
|
|
100
|
+
validator: validator
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
})) : null;
|
|
104
|
+
var description = [/*#__PURE__*/_react.default.createElement("span", {
|
|
105
|
+
key: "msg"
|
|
106
|
+
}, "This message will be displayed to the user.")];
|
|
107
|
+
var variables = validator.getVariables();
|
|
108
|
+
if (variables.length) {
|
|
109
|
+
description.push( /*#__PURE__*/_react.default.createElement("span", {
|
|
110
|
+
key: "vars"
|
|
111
|
+
}, "\xA0Available variables:\xA0"));
|
|
112
|
+
for (var i = 0; i < variables.length; i++) {
|
|
113
|
+
var variable = variables[i];
|
|
114
|
+
description.push( /*#__PURE__*/_react.default.createElement(_Tooltip.Tooltip, {
|
|
115
|
+
key: variable.name,
|
|
116
|
+
content: variable.description,
|
|
117
|
+
placement: "bottom"
|
|
118
|
+
}, /*#__PURE__*/_react.default.createElement(Variable, {
|
|
119
|
+
dangerouslySetInnerHTML: {
|
|
120
|
+
__html: "{".concat(variable.name, "}")
|
|
121
|
+
}
|
|
122
|
+
})));
|
|
123
|
+
if (i < variables.length - 1) {
|
|
124
|
+
description.push( /*#__PURE__*/_react.default.createElement(Comma, {
|
|
125
|
+
key: "comma-".concat(i)
|
|
126
|
+
}, ","));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
description.push( /*#__PURE__*/_react.default.createElement(Comma, {
|
|
130
|
+
key: "dot"
|
|
131
|
+
}, "."));
|
|
132
|
+
}
|
|
133
|
+
return /*#__PURE__*/_react.default.createElement(_Accordion.AccordionItem, {
|
|
134
|
+
key: validator.getName(),
|
|
135
|
+
"data-testid": "cms.editor.field-validator.".concat(validator.getName()),
|
|
136
|
+
interactive: false,
|
|
137
|
+
open: !!data,
|
|
138
|
+
title: validator.getLabel(),
|
|
139
|
+
description: validator.getDescription(),
|
|
140
|
+
actions: actions,
|
|
141
|
+
className: noPadding
|
|
142
|
+
}, data && /*#__PURE__*/_react.default.createElement(_form.Form, {
|
|
143
|
+
data: data,
|
|
144
|
+
onChange: function onChange(data) {
|
|
145
|
+
return onFormChange({
|
|
146
|
+
data: data,
|
|
147
|
+
validationValue: value,
|
|
148
|
+
onChangeValidation: _onChange,
|
|
149
|
+
validatorIndex: validatorIndex
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}, function (_ref3) {
|
|
153
|
+
var Bind = _ref3.Bind;
|
|
154
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Grid.Grid, {
|
|
155
|
+
className: gridBottomPadding
|
|
156
|
+
}, /*#__PURE__*/_react.default.createElement(_Grid.Cell, {
|
|
157
|
+
span: 12
|
|
158
|
+
}, /*#__PURE__*/_react.default.createElement(Bind, {
|
|
159
|
+
name: "message",
|
|
160
|
+
validators: _validation.validation.create("required")
|
|
161
|
+
}, function (bind) {
|
|
162
|
+
return /*#__PURE__*/_react.default.createElement(_Input.Input, Object.assign({}, bind, {
|
|
163
|
+
label: "Message",
|
|
164
|
+
"data-testid": "cms.editfield.validators.required",
|
|
165
|
+
description: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, description)
|
|
166
|
+
}));
|
|
167
|
+
}))), renderSettings(validator));
|
|
168
|
+
}));
|
|
169
|
+
};
|
|
170
|
+
var ValidatorsList = function ValidatorsList(props) {
|
|
171
|
+
var name = props.name,
|
|
172
|
+
validators = props.validators;
|
|
173
|
+
return /*#__PURE__*/_react.default.createElement(_form.Bind, {
|
|
174
|
+
name: name,
|
|
175
|
+
defaultValue: []
|
|
176
|
+
}, function (bind) {
|
|
177
|
+
var value = bind.value,
|
|
178
|
+
onChange = bind.onChange;
|
|
179
|
+
return /*#__PURE__*/_react.default.createElement(_Accordion.Accordion, null, validators.map(function (validator) {
|
|
180
|
+
return /*#__PURE__*/_react.default.createElement(ValidatorItem, {
|
|
181
|
+
key: validator.getName(),
|
|
182
|
+
value: value,
|
|
183
|
+
onChange: onChange,
|
|
184
|
+
validator: validator
|
|
185
|
+
});
|
|
186
|
+
}));
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
exports.ValidatorsList = ValidatorsList;
|