@webiny/app-headless-cms 0.0.0-mt-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +18 -0
- package/admin/components/ContentEntryForm/ContentEntryForm.d.ts +8 -0
- package/admin/components/ContentEntryForm/ContentEntryForm.js +68 -0
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.d.ts +7 -0
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.js +43 -0
- package/admin/components/ContentEntryForm/Fields.d.ts +12 -0
- package/admin/components/ContentEntryForm/Fields.js +33 -0
- package/admin/components/ContentEntryForm/Label.d.ts +5 -0
- package/admin/components/ContentEntryForm/Label.js +20 -0
- package/admin/components/ContentEntryForm/RenderFieldElement.d.ts +8 -0
- package/admin/components/ContentEntryForm/RenderFieldElement.js +40 -0
- package/admin/components/ContentEntryForm/functions/createValidators.d.ts +1 -0
- package/admin/components/ContentEntryForm/functions/createValidators.js +58 -0
- package/admin/components/ContentEntryForm/functions/getValue.d.ts +5 -0
- package/admin/components/ContentEntryForm/functions/getValue.js +20 -0
- package/admin/components/ContentEntryForm/functions/setValue.d.ts +6 -0
- package/admin/components/ContentEntryForm/functions/setValue.js +20 -0
- package/admin/components/ContentEntryForm/useBind.d.ts +10 -0
- package/admin/components/ContentEntryForm/useBind.js +76 -0
- package/admin/components/ContentEntryForm/useContentEntryForm.d.ts +22 -0
- package/admin/components/ContentEntryForm/useContentEntryForm.js +338 -0
- package/admin/components/ContentEntryForm/useRenderPlugins.d.ts +2 -0
- package/admin/components/ContentEntryForm/useRenderPlugins.js +7 -0
- package/admin/components/ContentModelEditor/Context.d.ts +23 -0
- package/admin/components/ContentModelEditor/Context.js +218 -0
- package/admin/components/ContentModelEditor/Editor.d.ts +3 -0
- package/admin/components/ContentModelEditor/Editor.js +138 -0
- package/admin/components/ContentModelEditor/FieldsSidebar.d.ts +4 -0
- package/admin/components/ContentModelEditor/FieldsSidebar.js +91 -0
- package/admin/components/ContentModelEditor/Header.d.ts +2 -0
- package/admin/components/ContentModelEditor/Header.js +24 -0
- package/admin/components/ContentModelEditor/PreviewTab.d.ts +2 -0
- package/admin/components/ContentModelEditor/PreviewTab.js +36 -0
- package/admin/components/ContentModelEditor/icons/round-assignment-24px.svg +4 -0
- package/admin/components/ContentModelEditor/icons/round-drag_indicator-24px.svg +4 -0
- package/admin/components/ContentModelEditor/useContentModelEditor.d.ts +1 -0
- package/admin/components/ContentModelEditor/useContentModelEditor.js +11 -0
- package/admin/components/DragPreview.d.ts +2 -0
- package/admin/components/DragPreview.js +98 -0
- package/admin/components/Draggable.d.ts +14 -0
- package/admin/components/Draggable.js +49 -0
- package/admin/components/DropZone/Center.d.ts +12 -0
- package/admin/components/DropZone/Center.js +60 -0
- package/admin/components/DropZone/Horizontal.d.ts +9 -0
- package/admin/components/DropZone/Horizontal.js +83 -0
- package/admin/components/DropZone/Vertical.d.ts +10 -0
- package/admin/components/DropZone/Vertical.js +79 -0
- package/admin/components/DropZone/index.d.ts +4 -0
- package/admin/components/DropZone/index.js +4 -0
- package/admin/components/Droppable.d.ts +23 -0
- package/admin/components/Droppable.js +45 -0
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.d.ts +3 -0
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.js +83 -0
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.d.ts +10 -0
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.js +120 -0
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.d.ts +5 -0
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.js +55 -0
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsTab.d.ts +10 -0
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsTab.js +121 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.d.ts +6 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.js +16 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.d.ts +7 -0
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.js +21 -0
- package/admin/components/FieldEditor/EditFieldDialog.d.ts +9 -0
- package/admin/components/FieldEditor/EditFieldDialog.js +231 -0
- package/admin/components/FieldEditor/Field.d.ts +3 -0
- package/admin/components/FieldEditor/Field.js +179 -0
- package/admin/components/FieldEditor/FieldEditor.d.ts +12 -0
- package/admin/components/FieldEditor/FieldEditor.js +166 -0
- package/admin/components/FieldEditor/FieldEditorContext.d.ts +53 -0
- package/admin/components/FieldEditor/FieldEditorContext.js +330 -0
- package/admin/components/FieldEditor/Styled.d.ts +6 -0
- package/admin/components/FieldEditor/Styled.js +54 -0
- package/admin/components/FieldEditor/index.d.ts +2 -0
- package/admin/components/FieldEditor/index.js +2 -0
- package/admin/components/FieldEditor/useFieldEditor.d.ts +1 -0
- package/admin/components/FieldEditor/useFieldEditor.js +5 -0
- package/admin/components/FieldEditor/utils/deleteField.d.ts +10 -0
- package/admin/components/FieldEditor/utils/deleteField.js +34 -0
- package/admin/components/FieldEditor/utils/getFieldPosition.d.ts +6 -0
- package/admin/components/FieldEditor/utils/getFieldPosition.js +20 -0
- package/admin/components/FieldEditor/utils/index.d.ts +4 -0
- package/admin/components/FieldEditor/utils/index.js +4 -0
- package/admin/components/FieldEditor/utils/moveField.d.ts +7 -0
- package/admin/components/FieldEditor/utils/moveField.js +51 -0
- package/admin/components/FieldEditor/utils/moveRow.d.ts +9 -0
- package/admin/components/FieldEditor/utils/moveRow.js +10 -0
- package/admin/constants/statusLabels.d.ts +8 -0
- package/admin/constants/statusLabels.js +13 -0
- package/admin/contexts/Cms/NetworkError.d.ts +2 -0
- package/admin/contexts/Cms/NetworkError.js +7 -0
- package/admin/contexts/Cms/index.d.ts +16 -0
- package/admin/contexts/Cms/index.js +43 -0
- package/admin/elements/ContentGroupMenuElement.d.ts +3 -0
- package/admin/elements/ContentGroupMenuElement.js +17 -0
- package/admin/elements/ContentModelMenuElement.d.ts +3 -0
- package/admin/elements/ContentModelMenuElement.js +17 -0
- package/admin/elements/NothingToShowElement.d.ts +15 -0
- package/admin/elements/NothingToShowElement.js +88 -0
- package/admin/graphql/contentEntries.d.ts +12 -0
- package/admin/graphql/contentEntries.js +68 -0
- package/admin/graphql/contentModels.d.ts +4 -0
- package/admin/graphql/contentModels.js +9 -0
- package/admin/graphql/createFieldsList.d.ts +2 -0
- package/admin/graphql/createFieldsList.js +21 -0
- package/admin/hooks/index.d.ts +5 -0
- package/admin/hooks/index.js +5 -0
- package/admin/hooks/useApolloClient.d.ts +2 -0
- package/admin/hooks/useApolloClient.js +10 -0
- package/admin/hooks/useCms.d.ts +3 -0
- package/admin/hooks/useCms.js +14 -0
- package/admin/hooks/useLazyQuery.d.ts +2 -0
- package/admin/hooks/useLazyQuery.js +16 -0
- package/admin/hooks/useMutation.d.ts +2 -0
- package/admin/hooks/useMutation.js +16 -0
- package/admin/hooks/usePermission.d.ts +27 -0
- package/admin/hooks/usePermission.js +218 -0
- package/admin/hooks/useQuery.d.ts +2 -0
- package/admin/hooks/useQuery.js +17 -0
- package/admin/icons/add.svg +5 -0
- package/admin/icons/arrow_forward-24px.svg +1 -0
- package/admin/icons/baseline-autorenew-24px.svg +4 -0
- package/admin/icons/beenhere.svg +1 -0
- package/admin/icons/call_split-24px.svg +4 -0
- package/admin/icons/close.svg +13 -0
- package/admin/icons/delete.svg +12 -0
- package/admin/icons/devices_other-black-24px.svg +1 -0
- package/admin/icons/done-24px.svg +1 -0
- package/admin/icons/edit.svg +17 -0
- package/admin/icons/emoji_people-24px.svg +1 -0
- package/admin/icons/gesture.svg +1 -0
- package/admin/icons/help_outline.svg +1 -0
- package/admin/icons/how_to_vote-24px.svg +4 -0
- package/admin/icons/info.svg +1 -0
- package/admin/icons/lock.svg +1 -0
- package/admin/icons/more_vert.svg +12 -0
- package/admin/icons/publish.svg +1 -0
- package/admin/icons/round-arrow_drop_down-24px.svg +12 -0
- package/admin/icons/round-drag_indicator-24px.svg +4 -0
- package/admin/icons/round-translate-24px.svg +4 -0
- package/admin/icons/rule-24px.svg +1 -0
- package/admin/icons/title-24px.svg +1 -0
- package/admin/icons/unpublish.svg +4 -0
- package/admin/icons/view_list.svg +1 -0
- package/admin/icons/visibility.svg +16 -0
- package/admin/plugins/apiInformation/index.d.ts +3 -0
- package/admin/plugins/apiInformation/index.js +59 -0
- package/admin/plugins/apiInformation/placeholder.manage.graphql +18 -0
- package/admin/plugins/apiInformation/placeholder.preview.graphql +15 -0
- package/admin/plugins/apiInformation/placeholder.read.graphql +16 -0
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.d.ts +21 -0
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.js +61 -0
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.d.ts +10 -0
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.js +36 -0
- package/admin/plugins/editor/defaultBar/BackButton.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/BackButton.js +21 -0
- package/admin/plugins/editor/defaultBar/CreateContentButton.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/CreateContentButton.js +46 -0
- package/admin/plugins/editor/defaultBar/Divider.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/Divider.js +11 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.d.ts +6 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.js +90 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.js +27 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.d.ts +6 -0
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.js +42 -0
- package/admin/plugins/editor/defaultBar/FormSettings/index.d.ts +1 -0
- package/admin/plugins/editor/defaultBar/FormSettings/index.js +1 -0
- package/admin/plugins/editor/defaultBar/Name/Name.d.ts +7 -0
- package/admin/plugins/editor/defaultBar/Name/Name.js +80 -0
- package/admin/plugins/editor/defaultBar/Name/NameStyled.d.ts +5 -0
- package/admin/plugins/editor/defaultBar/Name/NameStyled.js +48 -0
- package/admin/plugins/editor/defaultBar/Name/index.d.ts +1 -0
- package/admin/plugins/editor/defaultBar/Name/index.js +1 -0
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.d.ts +3 -0
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.js +63 -0
- package/admin/plugins/editor/defaultBar/icons/more_vert.svg +12 -0
- package/admin/plugins/editor/defaultBar/icons/round-arrow_back-24px.svg +13 -0
- package/admin/plugins/editor/defaultBar/icons/round-arrow_drop_down-24px.svg +12 -0
- package/admin/plugins/editor/defaultBar/icons/settings.svg +25 -0
- package/admin/plugins/editor/defaultBar/index.d.ts +7 -0
- package/admin/plugins/editor/defaultBar/index.js +44 -0
- package/admin/plugins/editor/formSettings/components/GeneralSettings.d.ts +7 -0
- package/admin/plugins/editor/formSettings/components/GeneralSettings.js +37 -0
- package/admin/plugins/editor/formSettings/components/GroupSelect.d.ts +3 -0
- package/admin/plugins/editor/formSettings/components/GroupSelect.js +30 -0
- package/admin/plugins/editor/formSettings/icons/round-settings-24px.svg +1 -0
- package/admin/plugins/editor/formSettings/index.d.ts +3 -0
- package/admin/plugins/editor/formSettings/index.js +14 -0
- package/admin/plugins/fieldRenderers/Accordion.d.ts +10 -0
- package/admin/plugins/fieldRenderers/Accordion.js +125 -0
- package/admin/plugins/fieldRenderers/DynamicSection.d.ts +14 -0
- package/admin/plugins/fieldRenderers/DynamicSection.js +103 -0
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.d.ts +3 -0
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.js +34 -0
- package/admin/plugins/fieldRenderers/boolean/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/boolean/index.js +2 -0
- package/admin/plugins/fieldRenderers/checkboxes.d.ts +3 -0
- package/admin/plugins/fieldRenderers/checkboxes.js +45 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.d.ts +9 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js +148 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.d.ts +8 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.js +115 -0
- package/admin/plugins/fieldRenderers/dateTime/Input.d.ts +16 -0
- package/admin/plugins/fieldRenderers/dateTime/Input.js +26 -0
- package/admin/plugins/fieldRenderers/dateTime/Select.d.ts +3 -0
- package/admin/plugins/fieldRenderers/dateTime/Select.js +13 -0
- package/admin/plugins/fieldRenderers/dateTime/Time.d.ts +3 -0
- package/admin/plugins/fieldRenderers/dateTime/Time.js +13 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.d.ts +3 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.js +59 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.d.ts +3 -0
- package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.js +84 -0
- package/admin/plugins/fieldRenderers/dateTime/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/dateTime/index.js +3 -0
- package/admin/plugins/fieldRenderers/dateTime/utils.d.ts +15 -0
- package/admin/plugins/fieldRenderers/dateTime/utils.js +153 -0
- package/admin/plugins/fieldRenderers/file/File.d.ts +15 -0
- package/admin/plugins/fieldRenderers/file/File.js +79 -0
- package/admin/plugins/fieldRenderers/file/fileField.d.ts +3 -0
- package/admin/plugins/fieldRenderers/file/fileField.js +64 -0
- package/admin/plugins/fieldRenderers/file/fileFields.d.ts +3 -0
- package/admin/plugins/fieldRenderers/file/fileFields.js +125 -0
- package/admin/plugins/fieldRenderers/file/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/file/index.js +3 -0
- package/admin/plugins/fieldRenderers/file/utils.d.ts +7 -0
- package/admin/plugins/fieldRenderers/file/utils.js +51 -0
- package/admin/plugins/fieldRenderers/longText/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/longText/index.js +3 -0
- package/admin/plugins/fieldRenderers/longText/longText.d.ts +3 -0
- package/admin/plugins/fieldRenderers/longText/longText.js +36 -0
- package/admin/plugins/fieldRenderers/longText/longTexts.d.ts +3 -0
- package/admin/plugins/fieldRenderers/longText/longTexts.js +43 -0
- package/admin/plugins/fieldRenderers/number/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/number/index.js +3 -0
- package/admin/plugins/fieldRenderers/number/numberInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/number/numberInput.js +39 -0
- package/admin/plugins/fieldRenderers/number/numberInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/number/numberInputs.js +50 -0
- package/admin/plugins/fieldRenderers/object/StyledComponents.d.ts +4 -0
- package/admin/plugins/fieldRenderers/object/StyledComponents.js +5 -0
- package/admin/plugins/fieldRenderers/object/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/object/index.js +3 -0
- package/admin/plugins/fieldRenderers/object/multipleObjects.d.ts +3 -0
- package/admin/plugins/fieldRenderers/object/multipleObjects.js +72 -0
- package/admin/plugins/fieldRenderers/object/singleObject.d.ts +3 -0
- package/admin/plugins/fieldRenderers/object/singleObject.js +45 -0
- package/admin/plugins/fieldRenderers/radioButtons.d.ts +3 -0
- package/admin/plugins/fieldRenderers/radioButtons.js +45 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.d.ts +6 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.js +54 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.d.ts +6 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.js +65 -0
- package/admin/plugins/fieldRenderers/ref/components/getOptions.d.ts +1 -0
- package/admin/plugins/fieldRenderers/ref/components/getOptions.js +21 -0
- package/admin/plugins/fieldRenderers/ref/components/graphql.d.ts +4 -0
- package/admin/plugins/fieldRenderers/ref/components/graphql.js +10 -0
- package/admin/plugins/fieldRenderers/ref/components/renderItem.d.ts +2 -0
- package/admin/plugins/fieldRenderers/ref/components/renderItem.js +14 -0
- package/admin/plugins/fieldRenderers/ref/components/useReference.d.ts +22 -0
- package/admin/plugins/fieldRenderers/ref/components/useReference.js +240 -0
- package/admin/plugins/fieldRenderers/ref/components/useReferences.d.ts +19 -0
- package/admin/plugins/fieldRenderers/ref/components/useReferences.js +180 -0
- package/admin/plugins/fieldRenderers/ref/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/ref/index.js +3 -0
- package/admin/plugins/fieldRenderers/ref/refInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/ref/refInput.js +30 -0
- package/admin/plugins/fieldRenderers/ref/refInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/ref/refInputs.js +37 -0
- package/admin/plugins/fieldRenderers/richText/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/richText/index.js +3 -0
- package/admin/plugins/fieldRenderers/richText/richTextInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/richText/richTextInput.js +50 -0
- package/admin/plugins/fieldRenderers/richText/richTextInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js +79 -0
- package/admin/plugins/fieldRenderers/select.d.ts +3 -0
- package/admin/plugins/fieldRenderers/select.js +34 -0
- package/admin/plugins/fieldRenderers/text/index.d.ts +2 -0
- package/admin/plugins/fieldRenderers/text/index.js +3 -0
- package/admin/plugins/fieldRenderers/text/textInput.d.ts +3 -0
- package/admin/plugins/fieldRenderers/text/textInput.js +35 -0
- package/admin/plugins/fieldRenderers/text/textInputs.d.ts +3 -0
- package/admin/plugins/fieldRenderers/text/textInputs.js +46 -0
- package/admin/plugins/fieldValidators/date/availableValidators.d.ts +1 -0
- package/admin/plugins/fieldValidators/date/availableValidators.js +11 -0
- package/admin/plugins/fieldValidators/date/createDateInputField.d.ts +3 -0
- package/admin/plugins/fieldValidators/date/createDateInputField.js +33 -0
- package/admin/plugins/fieldValidators/dateGte.d.ts +3 -0
- package/admin/plugins/fieldValidators/dateGte.js +40 -0
- package/admin/plugins/fieldValidators/dateLte.d.ts +3 -0
- package/admin/plugins/fieldValidators/dateLte.js +40 -0
- package/admin/plugins/fieldValidators/gte.d.ts +3 -0
- package/admin/plugins/fieldValidators/gte.js +27 -0
- package/admin/plugins/fieldValidators/in.d.ts +3 -0
- package/admin/plugins/fieldValidators/in.js +26 -0
- package/admin/plugins/fieldValidators/lte.d.ts +3 -0
- package/admin/plugins/fieldValidators/lte.js +27 -0
- package/admin/plugins/fieldValidators/maxLength.d.ts +3 -0
- package/admin/plugins/fieldValidators/maxLength.js +27 -0
- package/admin/plugins/fieldValidators/minLength.d.ts +3 -0
- package/admin/plugins/fieldValidators/minLength.js +27 -0
- package/admin/plugins/fieldValidators/pattern.d.ts +3 -0
- package/admin/plugins/fieldValidators/pattern.js +74 -0
- package/admin/plugins/fieldValidators/patternPlugins/email.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/email.js +9 -0
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.js +9 -0
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.js +9 -0
- package/admin/plugins/fieldValidators/patternPlugins/url.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/url.js +9 -0
- package/admin/plugins/fieldValidators/required.d.ts +3 -0
- package/admin/plugins/fieldValidators/required.js +10 -0
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.d.ts +6 -0
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.js +108 -0
- package/admin/plugins/fields/boolean.d.ts +3 -0
- package/admin/plugins/fields/boolean.js +31 -0
- package/admin/plugins/fields/dateTime.d.ts +3 -0
- package/admin/plugins/fields/dateTime.js +77 -0
- package/admin/plugins/fields/file.d.ts +3 -0
- package/admin/plugins/fields/file.js +46 -0
- package/admin/plugins/fields/icons/ballot_black_24dp.svg +1 -0
- package/admin/plugins/fields/icons/dropdown-icon.svg +16 -0
- package/admin/plugins/fields/icons/notes-black-24px.svg +1 -0
- package/admin/plugins/fields/icons/round-check_box-24px.svg +4 -0
- package/admin/plugins/fields/icons/round-link-24px.svg +1 -0
- package/admin/plugins/fields/icons/round-looks_3-24px.svg +4 -0
- package/admin/plugins/fields/icons/round-notes.svg +1 -0
- package/admin/plugins/fields/icons/round-radio_button_checked-24px.svg +5 -0
- package/admin/plugins/fields/icons/round-short_text.svg +1 -0
- package/admin/plugins/fields/icons/round-subject.svg +1 -0
- package/admin/plugins/fields/icons/round-text_fields-24px.svg +4 -0
- package/admin/plugins/fields/icons/round-visibility_off-24px.svg +4 -0
- package/admin/plugins/fields/icons/round_insert_drive_file-24px.svg +1 -0
- package/admin/plugins/fields/icons/schedule-black-24px.svg +1 -0
- package/admin/plugins/fields/icons/title-black-24px.svg +1 -0
- package/admin/plugins/fields/icons/toggle_on-black-24px.svg +1 -0
- package/admin/plugins/fields/longText.d.ts +3 -0
- package/admin/plugins/fields/longText.js +46 -0
- package/admin/plugins/fields/number.d.ts +3 -0
- package/admin/plugins/fields/number.js +63 -0
- package/admin/plugins/fields/object/ObjectFields.d.ts +4 -0
- package/admin/plugins/fields/object/ObjectFields.js +32 -0
- package/admin/plugins/fields/object.d.ts +3 -0
- package/admin/plugins/fields/object.js +46 -0
- package/admin/plugins/fields/ref.d.ts +3 -0
- package/admin/plugins/fields/ref.js +144 -0
- package/admin/plugins/fields/richText.d.ts +3 -0
- package/admin/plugins/fields/richText.js +45 -0
- package/admin/plugins/fields/text.d.ts +3 -0
- package/admin/plugins/fields/text.js +51 -0
- package/admin/plugins/getObjectId.d.ts +3 -0
- package/admin/plugins/getObjectId.js +13 -0
- package/admin/plugins/icons.d.ts +3 -0
- package/admin/plugins/icons.js +40 -0
- package/admin/plugins/index.d.ts +13 -0
- package/admin/plugins/index.js +14 -0
- package/admin/plugins/install.d.ts +3 -0
- package/admin/plugins/install.js +127 -0
- package/admin/plugins/menus/CmsMenuLoader.d.ts +7 -0
- package/admin/plugins/menus/CmsMenuLoader.js +76 -0
- package/admin/plugins/menus/ContentGroupsMenuItems.d.ts +6 -0
- package/admin/plugins/menus/ContentGroupsMenuItems.js +154 -0
- package/admin/plugins/menus/GlobalSearchPlugins.d.ts +8 -0
- package/admin/plugins/menus/GlobalSearchPlugins.js +53 -0
- package/admin/plugins/menus.d.ts +4 -0
- package/admin/plugins/menus.js +19 -0
- package/admin/plugins/permissionRenderer/CmsPermissions.d.ts +5 -0
- package/admin/plugins/permissionRenderer/CmsPermissions.js +340 -0
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.d.ts +8 -0
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.js +117 -0
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.d.ts +9 -0
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.js +77 -0
- package/admin/plugins/permissionRenderer/components/ContentModelList.d.ts +7 -0
- package/admin/plugins/permissionRenderer/components/ContentModelList.js +53 -0
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.d.ts +10 -0
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.js +104 -0
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.d.ts +5 -0
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.js +28 -0
- package/admin/plugins/permissionRenderer/components/PermissionSelector.d.ts +34 -0
- package/admin/plugins/permissionRenderer/components/PermissionSelector.js +66 -0
- package/admin/plugins/permissionRenderer/components/StyledComponents.d.ts +2 -0
- package/admin/plugins/permissionRenderer/components/StyledComponents.js +10 -0
- package/admin/plugins/permissionRenderer/components/useCmsData.d.ts +1 -0
- package/admin/plugins/permissionRenderer/components/useCmsData.js +79 -0
- package/admin/plugins/permissionRenderer/index.d.ts +3 -0
- package/admin/plugins/permissionRenderer/index.js +16 -0
- package/admin/plugins/routes.d.ts +3 -0
- package/admin/plugins/routes.js +88 -0
- package/admin/plugins/transformers/dateTransformer.d.ts +3 -0
- package/admin/plugins/transformers/dateTransformer.js +44 -0
- package/admin/plugins/transformers/index.d.ts +3 -0
- package/admin/plugins/transformers/index.js +5 -0
- package/admin/plugins/transformers/numberTransformer.d.ts +3 -0
- package/admin/plugins/transformers/numberTransformer.js +14 -0
- package/admin/plugins/upgrades/v5.0.0.d.ts +5 -0
- package/admin/plugins/upgrades/v5.0.0.js +85 -0
- package/admin/plugins/upgrades/v5.5.0.d.ts +5 -0
- package/admin/plugins/upgrades/v5.5.0.js +85 -0
- package/admin/plugins/upgrades/v5.8.0.d.ts +5 -0
- package/admin/plugins/upgrades/v5.8.0.js +85 -0
- package/admin/plugins/validators/dateGte.d.ts +3 -0
- package/admin/plugins/validators/dateGte.js +23 -0
- package/admin/plugins/validators/dateLte.d.ts +3 -0
- package/admin/plugins/validators/dateLte.js +23 -0
- package/admin/plugins/validators/gte.d.ts +3 -0
- package/admin/plugins/validators/gte.js +15 -0
- package/admin/plugins/validators/in.d.ts +3 -0
- package/admin/plugins/validators/in.js +15 -0
- package/admin/plugins/validators/lte.d.ts +3 -0
- package/admin/plugins/validators/lte.js +15 -0
- package/admin/plugins/validators/maxLength.d.ts +3 -0
- package/admin/plugins/validators/maxLength.js +15 -0
- package/admin/plugins/validators/minLength.d.ts +3 -0
- package/admin/plugins/validators/minLength.js +15 -0
- package/admin/plugins/validators/pattern.d.ts +9 -0
- package/admin/plugins/validators/pattern.js +34 -0
- package/admin/plugins/validators/patternPlugins/email.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/email.js +9 -0
- package/admin/plugins/validators/patternPlugins/lowerCase.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/lowerCase.js +9 -0
- package/admin/plugins/validators/patternPlugins/upperCase.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/upperCase.js +9 -0
- package/admin/plugins/validators/patternPlugins/url.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/url.js +9 -0
- package/admin/plugins/validators/required.d.ts +3 -0
- package/admin/plugins/validators/required.js +11 -0
- package/admin/plugins/validators/timeGte.d.ts +3 -0
- package/admin/plugins/validators/timeGte.js +19 -0
- package/admin/plugins/validators/timeLte.d.ts +3 -0
- package/admin/plugins/validators/timeLte.js +19 -0
- package/admin/plugins/welcomeScreenWidget.d.ts +3 -0
- package/admin/plugins/welcomeScreenWidget.js +29 -0
- package/admin/views/contentEntries/ContentEntries.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntries.js +73 -0
- package/admin/views/contentEntries/ContentEntriesContext.d.ts +24 -0
- package/admin/views/contentEntries/ContentEntriesContext.js +78 -0
- package/admin/views/contentEntries/ContentEntriesList.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntriesList.js +180 -0
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.d.ts +28 -0
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js +113 -0
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.d.ts +7 -0
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.js +152 -0
- package/admin/views/contentEntries/ContentEntry/RevisionsList.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/RevisionsList.js +59 -0
- package/admin/views/contentEntries/ContentEntry/cache.d.ts +7 -0
- package/admin/views/contentEntries/ContentEntry/cache.js +183 -0
- package/admin/views/contentEntries/ContentEntry/header/Header.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/Header.js +32 -0
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.js +141 -0
- package/admin/views/contentEntries/ContentEntry/header/index.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/index.js +45 -0
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/RequestChanges.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/RequestChanges.js +67 -0
- package/admin/views/contentEntries/ContentEntry/header/requestChanges/rule-24px.svg +1 -0
- package/admin/views/contentEntries/ContentEntry/header/requestReview/RequestReview.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/requestReview/RequestReview.js +69 -0
- package/admin/views/contentEntries/ContentEntry/header/requestReview/emoji_people-24px.svg +1 -0
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.js +75 -0
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.js +84 -0
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.d.ts +3 -0
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.js +32 -0
- package/admin/views/contentEntries/ContentEntry/prepareFormData.d.ts +2 -0
- package/admin/views/contentEntries/ContentEntry/prepareFormData.js +79 -0
- package/admin/views/contentEntries/ContentEntry/useRevision.d.ts +13 -0
- package/admin/views/contentEntries/ContentEntry/useRevision.js +335 -0
- package/admin/views/contentEntries/ContentEntry.d.ts +12 -0
- package/admin/views/contentEntries/ContentEntry.js +99 -0
- package/admin/views/contentEntries/hooks/useContentEntries.d.ts +1 -0
- package/admin/views/contentEntries/hooks/useContentEntries.js +5 -0
- package/admin/views/contentEntries/hooks/useContentEntriesList.d.ts +21 -0
- package/admin/views/contentEntries/hooks/useContentEntriesList.js +152 -0
- package/admin/views/contentEntries/hooks/useContentEntry.d.ts +1 -0
- package/admin/views/contentEntries/hooks/useContentEntry.js +5 -0
- package/admin/views/contentModelGroups/ContentModelGroups.d.ts +3 -0
- package/admin/views/contentModelGroups/ContentModelGroups.js +35 -0
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.d.ts +6 -0
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.js +242 -0
- package/admin/views/contentModelGroups/ContentModelGroupsForm.d.ts +6 -0
- package/admin/views/contentModelGroups/ContentModelGroupsForm.js +231 -0
- package/admin/views/contentModelGroups/DelayedOnChange.d.ts +25 -0
- package/admin/views/contentModelGroups/DelayedOnChange.js +134 -0
- package/admin/views/contentModelGroups/IconPicker.d.ts +7 -0
- package/admin/views/contentModelGroups/IconPicker.js +204 -0
- package/admin/views/contentModelGroups/graphql.d.ts +5 -0
- package/admin/views/contentModelGroups/graphql.js +11 -0
- package/admin/views/contentModels/ContentModelEditor.d.ts +2 -0
- package/admin/views/contentModels/ContentModelEditor.js +35 -0
- package/admin/views/contentModels/ContentModels.d.ts +3 -0
- package/admin/views/contentModels/ContentModels.js +82 -0
- package/admin/views/contentModels/ContentModelsDataList.d.ts +7 -0
- package/admin/views/contentModels/ContentModelsDataList.js +281 -0
- package/admin/views/contentModels/NewContentModelDialog.d.ts +8 -0
- package/admin/views/contentModels/NewContentModelDialog.js +196 -0
- package/admin/views/contentModels/cache.d.ts +5 -0
- package/admin/views/contentModels/cache.js +68 -0
- package/admin/views/utils.d.ts +2 -0
- package/admin/views/utils.js +27 -0
- package/admin/viewsGraphql.d.ts +4 -0
- package/admin/viewsGraphql.js +12 -0
- package/package.json +109 -0
- package/types.d.ts +484 -0
- package/types.js +1 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DragSource } from "../FieldEditor/FieldEditorContext";
|
|
3
|
+
declare type VerticalProps = {
|
|
4
|
+
depth?: number;
|
|
5
|
+
onDrop(item: DragSource): void;
|
|
6
|
+
last?: boolean;
|
|
7
|
+
isVisible?: any;
|
|
8
|
+
};
|
|
9
|
+
declare const Vertical: ({ depth, last, onDrop, isVisible }: VerticalProps) => JSX.Element;
|
|
10
|
+
export default Vertical;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import styled from "@emotion/styled";
|
|
4
|
+
import Droppable from "../Droppable";
|
|
5
|
+
var InnerDivVertical = /*#__PURE__*/styled("div", {
|
|
6
|
+
target: "e1yx4w3z0",
|
|
7
|
+
label: "InnerDivVertical"
|
|
8
|
+
})({
|
|
9
|
+
position: "absolute",
|
|
10
|
+
width: 10,
|
|
11
|
+
height: "100%",
|
|
12
|
+
zIndex: 3,
|
|
13
|
+
borderRadius: 0,
|
|
14
|
+
display: "none",
|
|
15
|
+
boxSizing: "border-box",
|
|
16
|
+
border: "1px dashed black",
|
|
17
|
+
borderSpacing: 5
|
|
18
|
+
});
|
|
19
|
+
var BackgroundColorDiv = /*#__PURE__*/styled("div", {
|
|
20
|
+
target: "e1yx4w3z1",
|
|
21
|
+
label: "BackgroundColorDiv"
|
|
22
|
+
})({
|
|
23
|
+
width: "100%",
|
|
24
|
+
height: "100%"
|
|
25
|
+
});
|
|
26
|
+
var OuterDivVertical = /*#__PURE__*/styled("div", {
|
|
27
|
+
target: "e1yx4w3z2",
|
|
28
|
+
label: "OuterDivVertical"
|
|
29
|
+
})({
|
|
30
|
+
position: "absolute",
|
|
31
|
+
width: "30%",
|
|
32
|
+
top: 0,
|
|
33
|
+
height: "100%",
|
|
34
|
+
zIndex: 10,
|
|
35
|
+
backgroundColor: "transparent"
|
|
36
|
+
}, function (props) {
|
|
37
|
+
var _InnerDivVertical, _ref;
|
|
38
|
+
|
|
39
|
+
return _ref = {}, _defineProperty(_ref, props.last ? "right" : "left", -9), _defineProperty(_ref, "textAlign", props.last ? "right" : "left"), _defineProperty(_ref, InnerDivVertical, (_InnerDivVertical = {
|
|
40
|
+
borderColor: props.isOver ? "var(--mdc-theme-primary)" : "var(--mdc-theme-secondary)"
|
|
41
|
+
}, _defineProperty(_InnerDivVertical, props.last ? "right" : "left", -2), _defineProperty(_InnerDivVertical, "display", props.isDragging ? "block" : "none"), _defineProperty(_InnerDivVertical, BackgroundColorDiv, {
|
|
42
|
+
opacity: 0.5,
|
|
43
|
+
backgroundColor: props.isOver ? "var(--mdc-theme-primary)" : "var(--mdc-theme-secondary)"
|
|
44
|
+
}), _InnerDivVertical)), _ref;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
var Vertical = function Vertical(_ref2) {
|
|
48
|
+
var depth = _ref2.depth,
|
|
49
|
+
last = _ref2.last,
|
|
50
|
+
onDrop = _ref2.onDrop,
|
|
51
|
+
isVisible = _ref2.isVisible;
|
|
52
|
+
return /*#__PURE__*/React.createElement(Droppable, {
|
|
53
|
+
onDrop: onDrop,
|
|
54
|
+
isVisible: isVisible
|
|
55
|
+
}, function (_ref3) {
|
|
56
|
+
var _ref4;
|
|
57
|
+
|
|
58
|
+
var isOver = _ref3.isOver,
|
|
59
|
+
isDragging = _ref3.isDragging,
|
|
60
|
+
drop = _ref3.drop;
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
ref: drop,
|
|
63
|
+
style: (_ref4 = {
|
|
64
|
+
/* For dropzone debugging: border: "1px solid blue",*/
|
|
65
|
+
width: "30%",
|
|
66
|
+
maxWidth: "100px",
|
|
67
|
+
height: "100%",
|
|
68
|
+
position: "absolute",
|
|
69
|
+
top: 0
|
|
70
|
+
}, _defineProperty(_ref4, last ? "right" : "left", 0), _defineProperty(_ref4, "zIndex", isDragging ? 1000 + depth : -1), _ref4)
|
|
71
|
+
}, /*#__PURE__*/React.createElement(OuterDivVertical, {
|
|
72
|
+
isOver: isOver,
|
|
73
|
+
isDragging: isDragging,
|
|
74
|
+
last: last
|
|
75
|
+
}, /*#__PURE__*/React.createElement(InnerDivVertical, null, /*#__PURE__*/React.createElement(BackgroundColorDiv, null))));
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default Vertical;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ConnectDropTarget } from "react-dnd";
|
|
3
|
+
import { DragSource } from "./FieldEditor/FieldEditorContext";
|
|
4
|
+
export declare type DroppableChildrenFunction = (params: {
|
|
5
|
+
isDragging: boolean;
|
|
6
|
+
isOver: boolean;
|
|
7
|
+
item: any;
|
|
8
|
+
drop: ConnectDropTarget;
|
|
9
|
+
}) => React.ReactElement;
|
|
10
|
+
export declare type DroppableProps = {
|
|
11
|
+
type?: string;
|
|
12
|
+
children: DroppableChildrenFunction;
|
|
13
|
+
isDragging?: boolean;
|
|
14
|
+
isDroppable?: (item: any) => boolean;
|
|
15
|
+
isVisible?: (params: {
|
|
16
|
+
type: string;
|
|
17
|
+
item: any;
|
|
18
|
+
isDragging: boolean;
|
|
19
|
+
}) => boolean;
|
|
20
|
+
onDrop?: (item: DragSource) => void;
|
|
21
|
+
};
|
|
22
|
+
declare const Droppable: React.MemoExoticComponent<(props: DroppableProps) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>>;
|
|
23
|
+
export default Droppable;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { useDrop } from "react-dnd";
|
|
4
|
+
var Droppable = /*#__PURE__*/React.memo(function (props) {
|
|
5
|
+
var children = props.children,
|
|
6
|
+
onDrop = props.onDrop,
|
|
7
|
+
_props$isVisible = props.isVisible,
|
|
8
|
+
isVisible = _props$isVisible === void 0 ? function () {
|
|
9
|
+
return true;
|
|
10
|
+
} : _props$isVisible;
|
|
11
|
+
|
|
12
|
+
var _useDrop = useDrop({
|
|
13
|
+
accept: "element",
|
|
14
|
+
collect: function collect(monitor) {
|
|
15
|
+
return {
|
|
16
|
+
isOver: monitor.isOver() && monitor.isOver({
|
|
17
|
+
shallow: true
|
|
18
|
+
}),
|
|
19
|
+
item: monitor.getItem()
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
drop: function drop(_, monitor) {
|
|
23
|
+
if (typeof onDrop === "function") {
|
|
24
|
+
return onDrop(monitor.getItem());
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}),
|
|
28
|
+
_useDrop2 = _slicedToArray(_useDrop, 2),
|
|
29
|
+
_useDrop2$ = _useDrop2[0],
|
|
30
|
+
item = _useDrop2$.item,
|
|
31
|
+
isOver = _useDrop2$.isOver,
|
|
32
|
+
drop = _useDrop2[1];
|
|
33
|
+
|
|
34
|
+
if (item && !isVisible(item)) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return children({
|
|
39
|
+
isDragging: Boolean(item),
|
|
40
|
+
isOver: isOver,
|
|
41
|
+
item: item,
|
|
42
|
+
drop: drop
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
export default Droppable;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
|
+
|
|
5
|
+
import React, { useEffect } from "react";
|
|
6
|
+
import { plugins } from "@webiny/plugins";
|
|
7
|
+
import { Grid, Cell } from "@webiny/ui/Grid";
|
|
8
|
+
import { i18n } from "@webiny/app/i18n";
|
|
9
|
+
import { Radio, RadioGroup } from "@webiny/ui/Radio";
|
|
10
|
+
import { Typography } from "@webiny/ui/Typography";
|
|
11
|
+
import { css } from "emotion";
|
|
12
|
+
import { validation } from "@webiny/validation";
|
|
13
|
+
var t = i18n.ns("app-headless-cms/admin/views/components/editor/tabs/edit-field-dialog/appearance-tab");
|
|
14
|
+
var style = {
|
|
15
|
+
topLabel: /*#__PURE__*/css({
|
|
16
|
+
marginBottom: 25
|
|
17
|
+
}, "label:topLabel;"),
|
|
18
|
+
noComponentsMessage: /*#__PURE__*/css({
|
|
19
|
+
textAlign: "center",
|
|
20
|
+
padding: 25
|
|
21
|
+
}, "label:noComponentsMessage;"),
|
|
22
|
+
radioContainer: /*#__PURE__*/css({
|
|
23
|
+
marginBottom: 10
|
|
24
|
+
}, "label:radioContainer;")
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var AppearanceTab = function AppearanceTab(props) {
|
|
28
|
+
var field = props.field,
|
|
29
|
+
form = props.form;
|
|
30
|
+
var renderPlugins = plugins.byType("cms-editor-field-renderer").filter(function (item) {
|
|
31
|
+
return item.renderer.canUse({
|
|
32
|
+
field: field
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
// If the currently selected render plugin is no longer available, select the first available one.
|
|
37
|
+
var currentlySelectedRenderAvailable = renderPlugins.find(function (item) {
|
|
38
|
+
return item.renderer.rendererName === field.renderer.name;
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
if (!currentlySelectedRenderAvailable) {
|
|
42
|
+
if (renderPlugins[0]) {
|
|
43
|
+
form.setValue("renderer.name", renderPlugins[0].renderer.rendererName);
|
|
44
|
+
} else {
|
|
45
|
+
console.log("No renderers for field ".concat(field.fieldId, " found."), field);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
if (renderPlugins.length === 0) {
|
|
51
|
+
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
52
|
+
span: 12,
|
|
53
|
+
className: style.noComponentsMessage
|
|
54
|
+
}, t(_templateObject || (_templateObject = _taggedTemplateLiteral(["There are no components that can render this field."])))));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
var Bind = form.Bind;
|
|
58
|
+
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
59
|
+
span: 12
|
|
60
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: style.topLabel
|
|
62
|
+
}, t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Choose a component that will render the field:"])))), /*#__PURE__*/React.createElement(Bind, {
|
|
63
|
+
name: "renderer.name",
|
|
64
|
+
validate: validation.create("required")
|
|
65
|
+
}, /*#__PURE__*/React.createElement(RadioGroup, null, function (_ref) {
|
|
66
|
+
var onChange = _ref.onChange,
|
|
67
|
+
getValue = _ref.getValue;
|
|
68
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderPlugins.map(function (item) {
|
|
69
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
key: item.name,
|
|
71
|
+
className: style.radioContainer
|
|
72
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
73
|
+
value: getValue(item.renderer.rendererName),
|
|
74
|
+
onChange: onChange(item.renderer.rendererName),
|
|
75
|
+
label: /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, item.renderer.name), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Typography, {
|
|
76
|
+
use: "caption"
|
|
77
|
+
}, item.renderer.description)))
|
|
78
|
+
}));
|
|
79
|
+
}));
|
|
80
|
+
}))));
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export default AppearanceTab;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CmsEditorField, CmsEditorFieldTypePlugin } from "../../../../types";
|
|
3
|
+
import { FormRenderPropParams } from "@webiny/form/types";
|
|
4
|
+
declare type GeneralTabProps = {
|
|
5
|
+
field: CmsEditorField;
|
|
6
|
+
form: FormRenderPropParams;
|
|
7
|
+
fieldPlugin: CmsEditorFieldTypePlugin;
|
|
8
|
+
};
|
|
9
|
+
declare const GeneralTab: ({ field, form, fieldPlugin }: GeneralTabProps) => JSX.Element;
|
|
10
|
+
export default GeneralTab;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import _camelCase from "lodash/camelCase";
|
|
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";
|
|
9
|
+
|
|
10
|
+
var GeneralTab = function GeneralTab(_ref) {
|
|
11
|
+
var field = _ref.field,
|
|
12
|
+
form = _ref.form,
|
|
13
|
+
fieldPlugin = _ref.fieldPlugin;
|
|
14
|
+
var Bind = form.Bind,
|
|
15
|
+
setValue = form.setValue;
|
|
16
|
+
var inputRef = useRef(null);
|
|
17
|
+
|
|
18
|
+
var _useContentModelEdito = useContentModelEditor(),
|
|
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.
|
|
23
|
+
// 1. It's probably caused by the Tabs component which wraps this component.
|
|
24
|
+
// 2. It seems that the "autoFocus" prop on the Input doesn't work. I can't see it attached in the actual DOM.
|
|
25
|
+
// 3. This works, but it's not 100%. Visually, the cursor is frozen, and that's probably caused by a bug / design
|
|
26
|
+
// in the RMWC / Material library. If you were to click somewhere on screen, and then apply focus, then
|
|
27
|
+
// it seems it's behaving correctly. ¯\_(ツ)_/¯
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
useEffect(function () {
|
|
31
|
+
setTimeout(function () {
|
|
32
|
+
inputRef.current && inputRef.current.focus();
|
|
33
|
+
}, 200);
|
|
34
|
+
}, []);
|
|
35
|
+
var afterChangeLabel = useCallback(function (value) {
|
|
36
|
+
setValue("fieldId", _camelCase(value));
|
|
37
|
+
}, []);
|
|
38
|
+
var beforeChangeFieldId = useCallback(function (value, baseOnChange) {
|
|
39
|
+
var newValue = value.trim();
|
|
40
|
+
baseOnChange(newValue);
|
|
41
|
+
}, []);
|
|
42
|
+
var fieldIdValidator = useCallback(function (fieldId) {
|
|
43
|
+
if (fieldId.trim().toLowerCase() !== "id") {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
throw new Error("Cannot use \"id\" as Field ID.");
|
|
48
|
+
}, undefined);
|
|
49
|
+
var uniqueFieldIdValidator = useCallback(function (fieldId) {
|
|
50
|
+
var existingField = getField({
|
|
51
|
+
fieldId: fieldId
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (!existingField) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (existingField.id === field.id) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
throw new Error("Please enter a unique Field ID.");
|
|
63
|
+
}, undefined);
|
|
64
|
+
var additionalSettings = null;
|
|
65
|
+
|
|
66
|
+
if (typeof fieldPlugin.field.renderSettings === "function") {
|
|
67
|
+
additionalSettings = fieldPlugin.field.renderSettings({
|
|
68
|
+
form: form,
|
|
69
|
+
afterChangeLabel: afterChangeLabel,
|
|
70
|
+
uniqueFieldIdValidator: uniqueFieldIdValidator,
|
|
71
|
+
contentModel: data
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
var predefinedValuesEnabled = useMemo(function () {
|
|
76
|
+
return fieldPlugin.field.allowPredefinedValues && typeof fieldPlugin.field.renderPredefinedValues === "function";
|
|
77
|
+
}, [field.fieldId]);
|
|
78
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
79
|
+
span: 6
|
|
80
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
81
|
+
name: "label",
|
|
82
|
+
validators: validation.create("required"),
|
|
83
|
+
afterChange: !field.id && afterChangeLabel
|
|
84
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
85
|
+
label: "Label",
|
|
86
|
+
inputRef: inputRef
|
|
87
|
+
}))), /*#__PURE__*/React.createElement(Cell, {
|
|
88
|
+
span: 6
|
|
89
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
90
|
+
name: "fieldId",
|
|
91
|
+
validators: [validation.create("required"), uniqueFieldIdValidator, fieldIdValidator],
|
|
92
|
+
beforeChange: beforeChangeFieldId
|
|
93
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
94
|
+
label: "Field ID",
|
|
95
|
+
disabled: !!field.id
|
|
96
|
+
}))), /*#__PURE__*/React.createElement(Cell, {
|
|
97
|
+
span: 6
|
|
98
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
99
|
+
name: "multipleValues"
|
|
100
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
101
|
+
label: fieldPlugin.field.multipleValuesLabel,
|
|
102
|
+
disabled: !fieldPlugin.field.allowMultipleValues
|
|
103
|
+
}))), /*#__PURE__*/React.createElement(Cell, {
|
|
104
|
+
span: 6
|
|
105
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
106
|
+
name: "predefinedValues.enabled"
|
|
107
|
+
}, /*#__PURE__*/React.createElement(Switch, {
|
|
108
|
+
label: "Use predefined values",
|
|
109
|
+
disabled: !predefinedValuesEnabled
|
|
110
|
+
}))), /*#__PURE__*/React.createElement(Cell, {
|
|
111
|
+
span: 12
|
|
112
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
113
|
+
name: "helpText"
|
|
114
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
115
|
+
label: "Help text",
|
|
116
|
+
description: "Help text (optional)"
|
|
117
|
+
})))), additionalSettings);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export default GeneralTab;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import React, { useCallback, useRef, cloneElement } from "react";
|
|
3
|
+
import getValue from "./functions/getValue";
|
|
4
|
+
import setValue from "./functions/setValue";
|
|
5
|
+
export default function PredefinedValues(_ref) {
|
|
6
|
+
var field = _ref.field,
|
|
7
|
+
fieldPlugin = _ref.fieldPlugin,
|
|
8
|
+
form = _ref.form;
|
|
9
|
+
var memoizedBindComponents = useRef({});
|
|
10
|
+
var BaseFormBind = form.Bind;
|
|
11
|
+
var getBind = useCallback(function () {
|
|
12
|
+
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
13
|
+
var memoKey = index;
|
|
14
|
+
|
|
15
|
+
if (memoizedBindComponents.current[memoKey]) {
|
|
16
|
+
return memoizedBindComponents.current[memoKey];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
memoizedBindComponents.current[memoKey] = function Bind(_ref2) {
|
|
20
|
+
var children = _ref2.children,
|
|
21
|
+
name = _ref2.name;
|
|
22
|
+
return /*#__PURE__*/React.createElement(BaseFormBind, {
|
|
23
|
+
name: "predefinedValues.values"
|
|
24
|
+
}, function (bind) {
|
|
25
|
+
var props = _objectSpread(_objectSpread({}, bind), {}, {
|
|
26
|
+
value: getValue({
|
|
27
|
+
bind: bind,
|
|
28
|
+
index: index,
|
|
29
|
+
name: name
|
|
30
|
+
}),
|
|
31
|
+
onChange: function onChange(value) {
|
|
32
|
+
setValue({
|
|
33
|
+
value: value,
|
|
34
|
+
bind: bind,
|
|
35
|
+
index: index,
|
|
36
|
+
name: name
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
if (typeof children === "function") {
|
|
42
|
+
return children(props);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return /*#__PURE__*/cloneElement(children, props);
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return memoizedBindComponents.current[memoKey];
|
|
50
|
+
}, []);
|
|
51
|
+
return fieldPlugin.field.renderPredefinedValues({
|
|
52
|
+
field: field,
|
|
53
|
+
getBind: getBind
|
|
54
|
+
});
|
|
55
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CmsEditorField } from "../../../../types";
|
|
3
|
+
interface ValidatorsTabProps {
|
|
4
|
+
name: string;
|
|
5
|
+
validators: any[];
|
|
6
|
+
form: any;
|
|
7
|
+
field: CmsEditorField;
|
|
8
|
+
}
|
|
9
|
+
declare const ValidatorsTab: React.FunctionComponent<ValidatorsTabProps>;
|
|
10
|
+
export default ValidatorsTab;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
import _debounce from "lodash/debounce";
|
|
4
|
+
import _cloneDeep from "lodash/cloneDeep";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { css } from "emotion";
|
|
7
|
+
import { Switch } from "@webiny/ui/Switch";
|
|
8
|
+
import { SimpleForm, SimpleFormContent, SimpleFormHeader } from "@webiny/app-admin/components/SimpleForm";
|
|
9
|
+
import { Form } from "@webiny/form";
|
|
10
|
+
import { Grid, Cell } from "@webiny/ui/Grid";
|
|
11
|
+
import { validation } from "@webiny/validation";
|
|
12
|
+
import { Input } from "@webiny/ui/Input";
|
|
13
|
+
|
|
14
|
+
var onEnabledChange = function onEnabledChange(_ref) {
|
|
15
|
+
var data = _ref.data,
|
|
16
|
+
validationValue = _ref.validationValue,
|
|
17
|
+
onChangeValidation = _ref.onChangeValidation,
|
|
18
|
+
validator = _ref.validator;
|
|
19
|
+
|
|
20
|
+
if (data) {
|
|
21
|
+
var index = validationValue.findIndex(function (item) {
|
|
22
|
+
return item.name === validator.name;
|
|
23
|
+
});
|
|
24
|
+
onChangeValidation([].concat(_toConsumableArray(validationValue.slice(0, index)), _toConsumableArray(validationValue.slice(index + 1))));
|
|
25
|
+
} else {
|
|
26
|
+
onChangeValidation([].concat(_toConsumableArray(validationValue), [{
|
|
27
|
+
name: validator.name,
|
|
28
|
+
settings: validator.defaultSettings,
|
|
29
|
+
message: validator.defaultMessage
|
|
30
|
+
}]));
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var onFormChange = _debounce(function (_ref2) {
|
|
35
|
+
var data = _ref2.data,
|
|
36
|
+
validationValue = _ref2.validationValue,
|
|
37
|
+
onChangeValidation = _ref2.onChangeValidation,
|
|
38
|
+
validatorIndex = _ref2.validatorIndex;
|
|
39
|
+
|
|
40
|
+
var newValidationValue = _cloneDeep(validationValue);
|
|
41
|
+
|
|
42
|
+
newValidationValue[validatorIndex] = _objectSpread(_objectSpread({}, newValidationValue[validatorIndex]), _cloneDeep(data));
|
|
43
|
+
onChangeValidation(newValidationValue);
|
|
44
|
+
}, 200);
|
|
45
|
+
|
|
46
|
+
var noMargin = /*#__PURE__*/css({
|
|
47
|
+
margin: "0 !important"
|
|
48
|
+
}, "label:noMargin;");
|
|
49
|
+
|
|
50
|
+
var ValidatorsTab = function ValidatorsTab(props) {
|
|
51
|
+
var field = props.field,
|
|
52
|
+
name = props.name,
|
|
53
|
+
validators = props.validators,
|
|
54
|
+
Bind = props.form.Bind;
|
|
55
|
+
return /*#__PURE__*/React.createElement(Bind, {
|
|
56
|
+
name: name,
|
|
57
|
+
defaultValue: []
|
|
58
|
+
}, function (_ref3) {
|
|
59
|
+
var validationValue = _ref3.value,
|
|
60
|
+
onChangeValidation = _ref3.onChange;
|
|
61
|
+
return validators.map(function (_ref4) {
|
|
62
|
+
var optional = _ref4.optional,
|
|
63
|
+
validator = _ref4.validator;
|
|
64
|
+
var validatorIndex = (validationValue || []).findIndex(function (item) {
|
|
65
|
+
return item.name === validator.name;
|
|
66
|
+
});
|
|
67
|
+
var data = (validationValue || [])[validatorIndex];
|
|
68
|
+
return /*#__PURE__*/React.createElement(SimpleForm, {
|
|
69
|
+
key: validator.name,
|
|
70
|
+
noElevation: true,
|
|
71
|
+
className: noMargin,
|
|
72
|
+
"data-testid": "cms.editor.field-validator.".concat(validator.name)
|
|
73
|
+
}, /*#__PURE__*/React.createElement(SimpleFormHeader, {
|
|
74
|
+
title: validator.label
|
|
75
|
+
}, optional && /*#__PURE__*/React.createElement(Switch, {
|
|
76
|
+
label: "Enabled",
|
|
77
|
+
value: validatorIndex >= 0,
|
|
78
|
+
onChange: function onChange() {
|
|
79
|
+
return onEnabledChange({
|
|
80
|
+
data: data,
|
|
81
|
+
validationValue: validationValue,
|
|
82
|
+
onChangeValidation: onChangeValidation,
|
|
83
|
+
validator: validator
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
})), data && /*#__PURE__*/React.createElement(Form, {
|
|
87
|
+
data: data,
|
|
88
|
+
onChange: function onChange(data) {
|
|
89
|
+
return onFormChange({
|
|
90
|
+
data: data,
|
|
91
|
+
validationValue: validationValue,
|
|
92
|
+
onChangeValidation: onChangeValidation,
|
|
93
|
+
validatorIndex: validatorIndex
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}, function (_ref5) {
|
|
97
|
+
var Bind = _ref5.Bind,
|
|
98
|
+
setValue = _ref5.setValue;
|
|
99
|
+
return /*#__PURE__*/React.createElement(SimpleFormContent, null, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
100
|
+
span: 12
|
|
101
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
102
|
+
name: "message",
|
|
103
|
+
validators: validation.create("required")
|
|
104
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
105
|
+
label: "Message",
|
|
106
|
+
description: "This message will be displayed to the user"
|
|
107
|
+
})))), typeof validator.renderSettings === "function" && validator.renderSettings({
|
|
108
|
+
field: field,
|
|
109
|
+
setValue: setValue,
|
|
110
|
+
setMessage: function setMessage(message) {
|
|
111
|
+
setValue("message", message);
|
|
112
|
+
},
|
|
113
|
+
data: data,
|
|
114
|
+
Bind: Bind
|
|
115
|
+
}));
|
|
116
|
+
}));
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export default ValidatorsTab;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import get from "lodash/get";
|
|
2
|
+
|
|
3
|
+
var getValue = function getValue(_ref) {
|
|
4
|
+
var bind = _ref.bind,
|
|
5
|
+
index = _ref.index,
|
|
6
|
+
name = _ref.name;
|
|
7
|
+
var value = bind.value || [];
|
|
8
|
+
|
|
9
|
+
if (index >= 0) {
|
|
10
|
+
return get(value, "".concat(index, ".").concat(name));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return value;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default getValue;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import set from "lodash/set";
|
|
3
|
+
|
|
4
|
+
var setValue = function setValue(_ref) {
|
|
5
|
+
var value = _ref.value,
|
|
6
|
+
bind = _ref.bind,
|
|
7
|
+
index = _ref.index,
|
|
8
|
+
name = _ref.name;
|
|
9
|
+
|
|
10
|
+
var newValue = _toConsumableArray(bind.value || []);
|
|
11
|
+
|
|
12
|
+
if (index >= 0) {
|
|
13
|
+
set(newValue, "".concat(index, ".").concat(name), value);
|
|
14
|
+
} else {
|
|
15
|
+
newValue = value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
bind.onChange(newValue);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default setValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CmsEditorField } from "../../../types";
|
|
3
|
+
declare type EditFieldDialogProps = {
|
|
4
|
+
field: CmsEditorField;
|
|
5
|
+
onClose: Function;
|
|
6
|
+
onSubmit: (data: any) => void;
|
|
7
|
+
};
|
|
8
|
+
declare const EditFieldDialog: ({ field, onSubmit, ...props }: EditFieldDialogProps) => JSX.Element;
|
|
9
|
+
export default EditFieldDialog;
|