@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,138 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
4
|
+
|
|
5
|
+
var _templateObject;
|
|
6
|
+
|
|
7
|
+
import React, { useRef, useState } from "react";
|
|
8
|
+
import { Prompt } from "@webiny/react-router";
|
|
9
|
+
import styled from "@emotion/styled";
|
|
10
|
+
import { css } from "emotion";
|
|
11
|
+
import { i18n } from "@webiny/app/i18n";
|
|
12
|
+
import { CircularProgress } from "@webiny/ui/Progress";
|
|
13
|
+
import { LeftPanel, RightPanel, SplitView } from "@webiny/app-admin/components/SplitView";
|
|
14
|
+
import { Icon } from "@webiny/ui/Icon";
|
|
15
|
+
import { Typography } from "@webiny/ui/Typography";
|
|
16
|
+
import { Tab, Tabs } from "@webiny/ui/Tabs";
|
|
17
|
+
import { ReactComponent as FormIcon } from "@svgr/webpack!./icons/round-assignment-24px.svg";
|
|
18
|
+
import { FieldsSidebar } from "./FieldsSidebar";
|
|
19
|
+
import { FieldEditor } from "../FieldEditor";
|
|
20
|
+
import { PreviewTab } from "./PreviewTab";
|
|
21
|
+
import Header from "./Header";
|
|
22
|
+
import DragPreview from "../DragPreview";
|
|
23
|
+
import { useContentModelEditor } from "./useContentModelEditor";
|
|
24
|
+
var t = i18n.ns("app-headless-cms/admin/editor");
|
|
25
|
+
var prompt = t(_templateObject || (_templateObject = _taggedTemplateLiteral(["There are some unsaved changes! Are you sure you want to navigate away and discard all changes?"])));
|
|
26
|
+
var ContentContainer = /*#__PURE__*/styled("div", {
|
|
27
|
+
target: "epn2fgg0",
|
|
28
|
+
label: "ContentContainer"
|
|
29
|
+
})({
|
|
30
|
+
paddingTop: 65
|
|
31
|
+
});
|
|
32
|
+
export var EditContainer = /*#__PURE__*/styled("div", {
|
|
33
|
+
target: "epn2fgg1",
|
|
34
|
+
label: "EditContainer"
|
|
35
|
+
})({
|
|
36
|
+
padding: 40,
|
|
37
|
+
position: "relative"
|
|
38
|
+
});
|
|
39
|
+
var LeftBarTitle = /*#__PURE__*/styled("div", {
|
|
40
|
+
target: "epn2fgg2",
|
|
41
|
+
label: "LeftBarTitle"
|
|
42
|
+
})({
|
|
43
|
+
borderBottom: "1px solid var(--mdc-theme-on-background)",
|
|
44
|
+
display: "flex",
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
padding: 25,
|
|
47
|
+
color: "var(--mdc-theme-on-surface)"
|
|
48
|
+
});
|
|
49
|
+
var titleIcon = /*#__PURE__*/css({
|
|
50
|
+
height: 24,
|
|
51
|
+
marginRight: 15,
|
|
52
|
+
color: "var(--mdc-theme-primary)"
|
|
53
|
+
}, "label:titleIcon;");
|
|
54
|
+
var LeftBarFieldList = /*#__PURE__*/styled("div", {
|
|
55
|
+
target: "epn2fgg3",
|
|
56
|
+
label: "LeftBarFieldList"
|
|
57
|
+
})({
|
|
58
|
+
padding: 40,
|
|
59
|
+
overflow: "auto",
|
|
60
|
+
height: "calc(100vh - 250px)"
|
|
61
|
+
});
|
|
62
|
+
var formTabs = /*#__PURE__*/css({
|
|
63
|
+
"&.webiny-ui-tabs": {
|
|
64
|
+
".webiny-ui-tabs__tab-bar": {
|
|
65
|
+
backgroundColor: "var(--mdc-theme-surface)"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}, "label:formTabs;");
|
|
69
|
+
export var Editor = function Editor() {
|
|
70
|
+
var _useContentModelEdito = useContentModelEditor(),
|
|
71
|
+
data = _useContentModelEdito.data,
|
|
72
|
+
setData = _useContentModelEdito.setData,
|
|
73
|
+
isPristine = _useContentModelEdito.isPristine;
|
|
74
|
+
|
|
75
|
+
var tabsRef = useRef(null);
|
|
76
|
+
|
|
77
|
+
var _useState = useState(0),
|
|
78
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
79
|
+
activeTabIndex = _useState2[0],
|
|
80
|
+
setActiveTabIndex = _useState2[1];
|
|
81
|
+
|
|
82
|
+
var onChange = function onChange(_ref) {
|
|
83
|
+
var fields = _ref.fields,
|
|
84
|
+
layout = _ref.layout;
|
|
85
|
+
setData(function (data) {
|
|
86
|
+
return _objectSpread(_objectSpread({}, data), {}, {
|
|
87
|
+
fields: fields,
|
|
88
|
+
layout: layout
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
if (!data) {
|
|
94
|
+
return /*#__PURE__*/React.createElement(CircularProgress, {
|
|
95
|
+
label: "Loading content model..."
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
100
|
+
className: "content-model-editor"
|
|
101
|
+
}, /*#__PURE__*/React.createElement(Prompt, {
|
|
102
|
+
when: !isPristine,
|
|
103
|
+
message: prompt
|
|
104
|
+
}), /*#__PURE__*/React.createElement(Header, null), /*#__PURE__*/React.createElement(ContentContainer, null, /*#__PURE__*/React.createElement(SplitView, null, /*#__PURE__*/React.createElement(LeftPanel, {
|
|
105
|
+
span: 4
|
|
106
|
+
}, /*#__PURE__*/React.createElement(LeftBarTitle, null, /*#__PURE__*/React.createElement(Icon, {
|
|
107
|
+
className: titleIcon,
|
|
108
|
+
icon: /*#__PURE__*/React.createElement(FormIcon, null)
|
|
109
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
110
|
+
use: "headline6"
|
|
111
|
+
}, "Fields")), /*#__PURE__*/React.createElement(LeftBarFieldList, null, /*#__PURE__*/React.createElement(FieldsSidebar, {
|
|
112
|
+
onFieldDragStart: function onFieldDragStart() {
|
|
113
|
+
if (tabsRef.current) {
|
|
114
|
+
tabsRef.current.switchTab(0);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}))), /*#__PURE__*/React.createElement(RightPanel, {
|
|
118
|
+
span: 8
|
|
119
|
+
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
120
|
+
className: formTabs,
|
|
121
|
+
ref: tabsRef,
|
|
122
|
+
onActivate: function onActivate(e) {
|
|
123
|
+
return setActiveTabIndex(e);
|
|
124
|
+
}
|
|
125
|
+
}, /*#__PURE__*/React.createElement(Tab, {
|
|
126
|
+
label: "Edit",
|
|
127
|
+
"data-testid": "cms.editor.tab.edit"
|
|
128
|
+
}, /*#__PURE__*/React.createElement(EditContainer, null, /*#__PURE__*/React.createElement(FieldEditor, {
|
|
129
|
+
fields: data.fields,
|
|
130
|
+
layout: data.layout,
|
|
131
|
+
onChange: onChange
|
|
132
|
+
}))), /*#__PURE__*/React.createElement(Tab, {
|
|
133
|
+
label: "Preview",
|
|
134
|
+
"data-testid": "cms.editor.tab.preview"
|
|
135
|
+
}, /*#__PURE__*/React.createElement(PreviewTab, {
|
|
136
|
+
activeTab: activeTabIndex === 1
|
|
137
|
+
})))))), /*#__PURE__*/React.createElement(DragPreview, null));
|
|
138
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { plugins } from "@webiny/plugins";
|
|
3
|
+
import styled from "@emotion/styled";
|
|
4
|
+
import { Icon } from "@webiny/ui/Icon";
|
|
5
|
+
import Draggable from "../Draggable";
|
|
6
|
+
var FieldContainer = /*#__PURE__*/styled("div", {
|
|
7
|
+
target: "e1s2p6i00",
|
|
8
|
+
label: "FieldContainer"
|
|
9
|
+
})({
|
|
10
|
+
padding: "10px 15px",
|
|
11
|
+
marginBottom: 20,
|
|
12
|
+
display: "flex",
|
|
13
|
+
width: "100%",
|
|
14
|
+
backgroundColor: "var(--mdc-theme-on-background)",
|
|
15
|
+
borderRadius: 15,
|
|
16
|
+
boxSizing: "border-box",
|
|
17
|
+
cursor: "grab",
|
|
18
|
+
opacity: 1,
|
|
19
|
+
transition: "opacity 225ms",
|
|
20
|
+
"&:hover": {
|
|
21
|
+
opacity: 0.8
|
|
22
|
+
},
|
|
23
|
+
"&:last-child": {
|
|
24
|
+
marginBottom: 0
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
var FileInfo = /*#__PURE__*/styled("div", {
|
|
28
|
+
target: "e1s2p6i01",
|
|
29
|
+
label: "FileInfo"
|
|
30
|
+
})({});
|
|
31
|
+
var FieldLabel = /*#__PURE__*/styled("div", {
|
|
32
|
+
target: "e1s2p6i02",
|
|
33
|
+
label: "FieldLabel"
|
|
34
|
+
})({
|
|
35
|
+
textTransform: "uppercase",
|
|
36
|
+
lineHeight: "145%",
|
|
37
|
+
color: "var(--mdc-theme-on-surface)"
|
|
38
|
+
});
|
|
39
|
+
var FieldDescription = /*#__PURE__*/styled("div", {
|
|
40
|
+
target: "e1s2p6i03",
|
|
41
|
+
label: "FieldDescription"
|
|
42
|
+
})({
|
|
43
|
+
fontSize: 14,
|
|
44
|
+
color: "var(--mdc-theme-text-secondary-on-background)"
|
|
45
|
+
});
|
|
46
|
+
var FieldHandle = /*#__PURE__*/styled("div", {
|
|
47
|
+
target: "e1s2p6i04",
|
|
48
|
+
label: "FieldHandle"
|
|
49
|
+
})({
|
|
50
|
+
marginRight: 15,
|
|
51
|
+
color: "var(--mdc-theme-on-surface)"
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
var Field = function Field(_ref) {
|
|
55
|
+
var onFieldDragStart = _ref.onFieldDragStart,
|
|
56
|
+
_ref$fieldType = _ref.fieldType,
|
|
57
|
+
type = _ref$fieldType.type,
|
|
58
|
+
label = _ref$fieldType.label,
|
|
59
|
+
icon = _ref$fieldType.icon,
|
|
60
|
+
description = _ref$fieldType.description;
|
|
61
|
+
return /*#__PURE__*/React.createElement(Draggable, {
|
|
62
|
+
beginDrag: {
|
|
63
|
+
type: "newField",
|
|
64
|
+
fieldType: type
|
|
65
|
+
}
|
|
66
|
+
}, function (_ref2) {
|
|
67
|
+
var drag = _ref2.drag;
|
|
68
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
69
|
+
ref: drag,
|
|
70
|
+
style: {
|
|
71
|
+
marginBottom: 10
|
|
72
|
+
},
|
|
73
|
+
"data-testid": "cms-editor-fields-field-".concat(type),
|
|
74
|
+
onDragStart: onFieldDragStart
|
|
75
|
+
}, /*#__PURE__*/React.createElement(FieldContainer, null, /*#__PURE__*/React.createElement(FieldHandle, null, /*#__PURE__*/React.createElement(Icon, {
|
|
76
|
+
icon: icon
|
|
77
|
+
})), /*#__PURE__*/React.createElement(FileInfo, null, /*#__PURE__*/React.createElement(FieldLabel, null, label), /*#__PURE__*/React.createElement(FieldDescription, null, description))));
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export var FieldsSidebar = function FieldsSidebar(_ref3) {
|
|
82
|
+
var onFieldDragStart = _ref3.onFieldDragStart;
|
|
83
|
+
var fieldTypePlugin = plugins.byType("cms-editor-field-type");
|
|
84
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, fieldTypePlugin.map(function (fieldPlugin) {
|
|
85
|
+
return /*#__PURE__*/React.createElement(Field, {
|
|
86
|
+
key: fieldPlugin.field.type,
|
|
87
|
+
fieldType: fieldPlugin.field,
|
|
88
|
+
onFieldDragStart: onFieldDragStart
|
|
89
|
+
});
|
|
90
|
+
}));
|
|
91
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TopAppBar, TopAppBarSection } from "@webiny/ui/TopAppBar";
|
|
3
|
+
import { renderPlugins } from "@webiny/app/plugins";
|
|
4
|
+
import { css } from "emotion";
|
|
5
|
+
var topBar = /*#__PURE__*/css({
|
|
6
|
+
boxShadow: "1px 0px 5px 0px rgba(128,128,128,1)"
|
|
7
|
+
}, "label:topBar;");
|
|
8
|
+
export default function EditorBar() {
|
|
9
|
+
return /*#__PURE__*/React.createElement(TopAppBar, {
|
|
10
|
+
className: topBar,
|
|
11
|
+
fixed: true,
|
|
12
|
+
"data-testid": "cms-editor-top-bar"
|
|
13
|
+
}, /*#__PURE__*/React.createElement(TopAppBarSection, {
|
|
14
|
+
style: {
|
|
15
|
+
width: "50%"
|
|
16
|
+
},
|
|
17
|
+
alignEnd: true
|
|
18
|
+
}, renderPlugins("content-model-editor-default-bar-left")), /*#__PURE__*/React.createElement(TopAppBarSection, {
|
|
19
|
+
style: {
|
|
20
|
+
width: "50%"
|
|
21
|
+
},
|
|
22
|
+
alignEnd: true
|
|
23
|
+
}, renderPlugins("content-model-editor-default-bar-right")));
|
|
24
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject;
|
|
4
|
+
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { css } from "emotion";
|
|
7
|
+
import { Elevation } from "@webiny/ui/Elevation";
|
|
8
|
+
import { i18n } from "@webiny/app/i18n";
|
|
9
|
+
import { useContentModelEditor } from "./useContentModelEditor";
|
|
10
|
+
import { ContentEntryFormPreview } from "../ContentEntryForm/ContentEntryFormPreview";
|
|
11
|
+
var t = i18n.ns("app-headless-cms/admin/components/editor/tabs/preview");
|
|
12
|
+
var formPreviewWrapper = /*#__PURE__*/css({
|
|
13
|
+
padding: 40,
|
|
14
|
+
margin: 40,
|
|
15
|
+
boxSizing: "border-box"
|
|
16
|
+
}, "label:formPreviewWrapper;");
|
|
17
|
+
var style = {
|
|
18
|
+
noFieldsMessage: /*#__PURE__*/css({
|
|
19
|
+
textAlign: "center"
|
|
20
|
+
}, "label:noFieldsMessage;")
|
|
21
|
+
};
|
|
22
|
+
export var PreviewTab = function PreviewTab(_ref) {
|
|
23
|
+
var activeTab = _ref.activeTab;
|
|
24
|
+
|
|
25
|
+
var _useContentModelEdito = useContentModelEditor(),
|
|
26
|
+
data = _useContentModelEdito.data;
|
|
27
|
+
|
|
28
|
+
return /*#__PURE__*/React.createElement(Elevation, {
|
|
29
|
+
z: 1,
|
|
30
|
+
className: formPreviewWrapper
|
|
31
|
+
}, data.fields && data.fields.length && activeTab ? /*#__PURE__*/React.createElement(ContentEntryFormPreview, {
|
|
32
|
+
contentModel: data
|
|
33
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
className: style.noFieldsMessage
|
|
35
|
+
}, t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Before previewing the form, please add at least one field to the content model."])))));
|
|
36
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" viewBox="0 0 24 24">
|
|
2
|
+
<path fill="none" d="M0 0h24v24H0V0z"/>
|
|
3
|
+
<path fill="currentColor" d="M19 3h-4.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm1 14H8c-.55 0-1-.45-1-1s.45-1 1-1h5c.55 0 1 .45 1 1s-.45 1-1 1zm3-4H8c-.55 0-1-.45-1-1s.45-1 1-1h8c.55 0 1 .45 1 1s-.45 1-1 1zm0-4H8c-.55 0-1-.45-1-1s.45-1 1-1h8c.55 0 1 .45 1 1s-.45 1-1 1z"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" viewBox="0 0 24 24">
|
|
2
|
+
<path fill="none" d="M0 0h24v24H0V0z"/>
|
|
3
|
+
<path fill="currentColor" d="M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useContentModelEditor(): import("./Context").Context;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { contentModelEditorContext } from "./Context";
|
|
3
|
+
export function useContentModelEditor() {
|
|
4
|
+
var context = React.useContext(contentModelEditorContext);
|
|
5
|
+
|
|
6
|
+
if (!context) {
|
|
7
|
+
throw new Error("useContentModelEditor must be used within a ContentModelEditorProvider");
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
return context;
|
|
11
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
import { useDragLayer } from "react-dnd";
|
|
4
|
+
var subscribedToOffsetChange = false;
|
|
5
|
+
var dragPreviewRef = null;
|
|
6
|
+
|
|
7
|
+
var onOffsetChange = function onOffsetChange(monitor) {
|
|
8
|
+
return function () {
|
|
9
|
+
if (!dragPreviewRef) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
var offset = monitor.getClientOffset();
|
|
14
|
+
|
|
15
|
+
if (!offset) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var transform = "translate(".concat(offset.x - 15, "px, ").concat(offset.y - 15, "px)");
|
|
20
|
+
dragPreviewRef.style["transform"] = transform;
|
|
21
|
+
dragPreviewRef.style["-webkit-transform"] = transform;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default function DragPreview() {
|
|
26
|
+
var _useState = useState(0),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
dragHelperOpacity = _useState2[0],
|
|
29
|
+
setDragHelperOpacity = _useState2[1];
|
|
30
|
+
|
|
31
|
+
var _useDragLayer = useDragLayer(function (monitor) {
|
|
32
|
+
if (!subscribedToOffsetChange) {
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
monitor.subscribeToOffsetChange(onOffsetChange(monitor));
|
|
35
|
+
subscribedToOffsetChange = true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
isDragging: monitor.isDragging()
|
|
40
|
+
};
|
|
41
|
+
}),
|
|
42
|
+
isDragging = _useDragLayer.isDragging;
|
|
43
|
+
|
|
44
|
+
useEffect(function () {
|
|
45
|
+
return function () {
|
|
46
|
+
subscribedToOffsetChange = false;
|
|
47
|
+
dragPreviewRef = null;
|
|
48
|
+
};
|
|
49
|
+
}, []); // We track the value of "isDragging" and apply opacity=1 (after 100ms), when it switches to true.
|
|
50
|
+
// Without this, the drag cursor would be shown in the top-left corner for a short amount of time, and then it
|
|
51
|
+
// would be repositioned correctly. Definitely looks like a glitch. This also adds a nice little fade-in effect.
|
|
52
|
+
|
|
53
|
+
useEffect(function () {
|
|
54
|
+
if (isDragging) {
|
|
55
|
+
setTimeout(function () {
|
|
56
|
+
setDragHelperOpacity(isDragging ? 1 : 0);
|
|
57
|
+
}, 100);
|
|
58
|
+
} else {
|
|
59
|
+
setDragHelperOpacity(0);
|
|
60
|
+
}
|
|
61
|
+
}, [isDragging]);
|
|
62
|
+
|
|
63
|
+
if (!isDragging) {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (!isDragging) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
style: {
|
|
73
|
+
position: "fixed",
|
|
74
|
+
pointerEvents: "none",
|
|
75
|
+
zIndex: 1001,
|
|
76
|
+
left: 0,
|
|
77
|
+
top: 0,
|
|
78
|
+
width: "100%",
|
|
79
|
+
height: "100%"
|
|
80
|
+
}
|
|
81
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
ref: function ref(el) {
|
|
83
|
+
return dragPreviewRef = el;
|
|
84
|
+
},
|
|
85
|
+
style: {
|
|
86
|
+
transition: "opacity .25s ease-in-out",
|
|
87
|
+
display: "block",
|
|
88
|
+
opacity: dragHelperOpacity
|
|
89
|
+
}
|
|
90
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
style: {
|
|
92
|
+
width: 30,
|
|
93
|
+
height: 30,
|
|
94
|
+
backgroundColor: "var(--mdc-theme-primary)",
|
|
95
|
+
borderRadius: "50%"
|
|
96
|
+
}
|
|
97
|
+
})));
|
|
98
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ReactElement } from "react";
|
|
2
|
+
import { ConnectDragSource } from "react-dnd";
|
|
3
|
+
export declare type DraggableChildrenFunction = (params: {
|
|
4
|
+
isDragging: boolean;
|
|
5
|
+
drag: ConnectDragSource;
|
|
6
|
+
}) => ReactElement;
|
|
7
|
+
export declare type DraggableProps = {
|
|
8
|
+
children: DraggableChildrenFunction;
|
|
9
|
+
beginDrag?: any;
|
|
10
|
+
endDrag?: any;
|
|
11
|
+
target?: string[];
|
|
12
|
+
};
|
|
13
|
+
declare const Draggable: React.MemoExoticComponent<(props: DraggableProps) => JSX.Element>;
|
|
14
|
+
export default Draggable;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useDrag, DragPreviewImage } from "react-dnd";
|
|
4
|
+
var emptyImage = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
|
5
|
+
var Draggable = /*#__PURE__*/React.memo(function (props) {
|
|
6
|
+
var children = props.children,
|
|
7
|
+
beginDrag = props.beginDrag,
|
|
8
|
+
endDrag = props.endDrag,
|
|
9
|
+
target = props.target;
|
|
10
|
+
|
|
11
|
+
var _useDrag = useDrag({
|
|
12
|
+
item: {
|
|
13
|
+
type: "element",
|
|
14
|
+
target: target
|
|
15
|
+
},
|
|
16
|
+
collect: function collect(monitor) {
|
|
17
|
+
return {
|
|
18
|
+
isDragging: monitor.isDragging()
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
begin: function begin(monitor) {
|
|
22
|
+
if (typeof beginDrag === "function") {
|
|
23
|
+
return beginDrag(props, monitor);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return beginDrag;
|
|
27
|
+
},
|
|
28
|
+
end: function end(item, monitor) {
|
|
29
|
+
if (typeof endDrag === "function") {
|
|
30
|
+
return endDrag(item, monitor);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return endDrag;
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
36
|
+
_useDrag2 = _slicedToArray(_useDrag, 3),
|
|
37
|
+
isDragging = _useDrag2[0].isDragging,
|
|
38
|
+
drag = _useDrag2[1],
|
|
39
|
+
preview = _useDrag2[2];
|
|
40
|
+
|
|
41
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DragPreviewImage, {
|
|
42
|
+
connect: preview,
|
|
43
|
+
src: emptyImage
|
|
44
|
+
}), children({
|
|
45
|
+
isDragging: isDragging,
|
|
46
|
+
drag: drag
|
|
47
|
+
}));
|
|
48
|
+
});
|
|
49
|
+
export default Draggable;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { CSSProperties } from "react";
|
|
2
|
+
import { DragSource } from "../FieldEditor/FieldEditorContext";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
type?: string;
|
|
5
|
+
onDrop(item: DragSource): void;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
highlight?: boolean;
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
};
|
|
11
|
+
export default function Center({ onDrop, children, style }: Props): JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import styled from "@emotion/styled";
|
|
4
|
+
import Droppable from "./../Droppable";
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
var Container = /*#__PURE__*/styled("div", {
|
|
7
|
+
target: "e14zhyp10",
|
|
8
|
+
label: "Container"
|
|
9
|
+
})(function (_ref) {
|
|
10
|
+
var isOver = _ref.isOver;
|
|
11
|
+
return {
|
|
12
|
+
backgroundColor: "transparent",
|
|
13
|
+
boxSizing: "border-box",
|
|
14
|
+
height: "100%",
|
|
15
|
+
minHeight: 100,
|
|
16
|
+
position: "relative",
|
|
17
|
+
userSelect: "none",
|
|
18
|
+
width: "100%",
|
|
19
|
+
border: isOver ? "2px dashed var(--mdc-theme-primary)" : "2px dashed var(--mdc-theme-secondary)",
|
|
20
|
+
opacity: 1
|
|
21
|
+
};
|
|
22
|
+
}); // @ts-ignore
|
|
23
|
+
|
|
24
|
+
var Add = /*#__PURE__*/styled("div", {
|
|
25
|
+
target: "e14zhyp11",
|
|
26
|
+
label: "Add"
|
|
27
|
+
})(function (_ref2) {
|
|
28
|
+
var isOver = _ref2.isOver;
|
|
29
|
+
return {
|
|
30
|
+
position: "absolute",
|
|
31
|
+
top: "50%",
|
|
32
|
+
left: "50%",
|
|
33
|
+
transform: "translate(-50%,-50%)",
|
|
34
|
+
margin: 0,
|
|
35
|
+
color: isOver ? "var(--mdc-theme-primary)" : "var(--mdc-theme-secondary)"
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
export default function Center(_ref3) {
|
|
39
|
+
var onDrop = _ref3.onDrop,
|
|
40
|
+
children = _ref3.children,
|
|
41
|
+
style = _ref3.style;
|
|
42
|
+
return /*#__PURE__*/React.createElement(Droppable, {
|
|
43
|
+
onDrop: onDrop
|
|
44
|
+
}, function (_ref4) {
|
|
45
|
+
var isOver = _ref4.isOver,
|
|
46
|
+
drop = _ref4.drop;
|
|
47
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
48
|
+
ref: drop,
|
|
49
|
+
style: _objectSpread({
|
|
50
|
+
width: "100%",
|
|
51
|
+
height: "100%"
|
|
52
|
+
}, style),
|
|
53
|
+
"data-testid": "cms-editor-first-field-area"
|
|
54
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
55
|
+
isOver: isOver
|
|
56
|
+
}, /*#__PURE__*/React.createElement(Add, {
|
|
57
|
+
isOver: isOver
|
|
58
|
+
}, children)));
|
|
59
|
+
});
|
|
60
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { DragSource } from "../FieldEditor/FieldEditorContext";
|
|
3
|
+
declare type HorizontalProps = {
|
|
4
|
+
onDrop(item: DragSource): void;
|
|
5
|
+
last?: boolean;
|
|
6
|
+
isVisible?: any;
|
|
7
|
+
};
|
|
8
|
+
declare const Horizontal: ({ last, onDrop, isVisible, ...rest }: HorizontalProps) => JSX.Element;
|
|
9
|
+
export default Horizontal;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
var _excluded = ["last", "onDrop", "isVisible"];
|
|
4
|
+
import React from "react";
|
|
5
|
+
import styled from "@emotion/styled";
|
|
6
|
+
import Droppable from "../Droppable";
|
|
7
|
+
var InnerDiv = /*#__PURE__*/styled("div", {
|
|
8
|
+
target: "e1uuull90",
|
|
9
|
+
label: "InnerDiv"
|
|
10
|
+
})({
|
|
11
|
+
height: 15,
|
|
12
|
+
width: "100%",
|
|
13
|
+
zIndex: 3,
|
|
14
|
+
borderRadius: 0,
|
|
15
|
+
boxSizing: "border-box",
|
|
16
|
+
display: "none",
|
|
17
|
+
border: "1px dashed black",
|
|
18
|
+
borderSpacing: 5
|
|
19
|
+
});
|
|
20
|
+
var BackgroundColorDiv = /*#__PURE__*/styled("div", {
|
|
21
|
+
target: "e1uuull91",
|
|
22
|
+
label: "BackgroundColorDiv"
|
|
23
|
+
})({
|
|
24
|
+
width: "100%",
|
|
25
|
+
height: "100%"
|
|
26
|
+
});
|
|
27
|
+
var OuterDiv = /*#__PURE__*/styled("div", {
|
|
28
|
+
target: "e1uuull92",
|
|
29
|
+
label: "OuterDiv"
|
|
30
|
+
})({
|
|
31
|
+
margin: 0,
|
|
32
|
+
padding: 0,
|
|
33
|
+
width: "calc(100% + 2px)",
|
|
34
|
+
zIndex: 10,
|
|
35
|
+
backgroundColor: "transparent",
|
|
36
|
+
position: "absolute",
|
|
37
|
+
display: "flex",
|
|
38
|
+
justifyContent: "center"
|
|
39
|
+
}, function (props) {
|
|
40
|
+
var _ref;
|
|
41
|
+
|
|
42
|
+
return _ref = {}, _defineProperty(_ref, props.last ? "bottom" : "top", -15), _defineProperty(_ref, InnerDiv, _defineProperty({
|
|
43
|
+
borderColor: props.isOver ? "var(--mdc-theme-primary)" : "var(--mdc-theme-secondary)",
|
|
44
|
+
display: props.isDragging ? "block" : "none"
|
|
45
|
+
}, BackgroundColorDiv, {
|
|
46
|
+
opacity: 0.5,
|
|
47
|
+
backgroundColor: props.isOver ? "var(--mdc-theme-primary)" : "var(--mdc-theme-secondary)"
|
|
48
|
+
})), _ref;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
var Horizontal = function Horizontal(_ref2) {
|
|
52
|
+
var last = _ref2.last,
|
|
53
|
+
onDrop = _ref2.onDrop,
|
|
54
|
+
isVisible = _ref2.isVisible,
|
|
55
|
+
rest = _objectWithoutProperties(_ref2, _excluded);
|
|
56
|
+
|
|
57
|
+
return /*#__PURE__*/React.createElement(Droppable, {
|
|
58
|
+
onDrop: onDrop,
|
|
59
|
+
isVisible: isVisible
|
|
60
|
+
}, function (_ref3) {
|
|
61
|
+
var _ref4;
|
|
62
|
+
|
|
63
|
+
var isOver = _ref3.isOver,
|
|
64
|
+
isDragging = _ref3.isDragging,
|
|
65
|
+
drop = _ref3.drop;
|
|
66
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
ref: drop,
|
|
68
|
+
"data-testid": rest["data-testid"],
|
|
69
|
+
style: (_ref4 = {
|
|
70
|
+
/* For dropzone debugging: border: "1px solid blue",*/
|
|
71
|
+
height: "15px",
|
|
72
|
+
width: "100%",
|
|
73
|
+
position: "absolute"
|
|
74
|
+
}, _defineProperty(_ref4, last ? "bottom" : "top", 0), _defineProperty(_ref4, "left", 0), _defineProperty(_ref4, "zIndex", isDragging ? 1000 : -1), _ref4)
|
|
75
|
+
}, /*#__PURE__*/React.createElement(OuterDiv, {
|
|
76
|
+
isOver: isOver,
|
|
77
|
+
isDragging: isDragging,
|
|
78
|
+
last: last
|
|
79
|
+
}, /*#__PURE__*/React.createElement(InnerDiv, null, /*#__PURE__*/React.createElement(BackgroundColorDiv, null))));
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export default Horizontal;
|