@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,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface Props {
|
|
3
|
+
url: string;
|
|
4
|
+
onRemove: Function;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
styles?: Record<string, any>;
|
|
7
|
+
showFileManager?: Function;
|
|
8
|
+
validation?: {
|
|
9
|
+
isValid?: boolean;
|
|
10
|
+
message?: string;
|
|
11
|
+
};
|
|
12
|
+
description?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const File: React.FunctionComponent<Props>;
|
|
15
|
+
export default File;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
|
+
import { Image } from "@webiny/app/components";
|
|
3
|
+
import * as Ui from "@webiny/ui/ImageUpload";
|
|
4
|
+
import { createRenderImagePreview, imageExtensions } from "./utils";
|
|
5
|
+
import fileIcon from "../../fields/icons/round_insert_drive_file-24px.svg";
|
|
6
|
+
import { FormElementMessage } from "@webiny/ui/FormElementMessage";
|
|
7
|
+
var imagePreviewProps = {
|
|
8
|
+
transform: {
|
|
9
|
+
width: 300
|
|
10
|
+
},
|
|
11
|
+
style: {
|
|
12
|
+
width: "100%",
|
|
13
|
+
height: 232,
|
|
14
|
+
objectFit: "cover"
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var defaultStyles = {
|
|
18
|
+
width: "100%",
|
|
19
|
+
height: "auto"
|
|
20
|
+
};
|
|
21
|
+
var defaultValidation = {
|
|
22
|
+
isValid: null,
|
|
23
|
+
message: null
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
var File = function File(props) {
|
|
27
|
+
var url = props.url,
|
|
28
|
+
onRemove = props.onRemove,
|
|
29
|
+
placeholder = props.placeholder,
|
|
30
|
+
showFileManager = props.showFileManager,
|
|
31
|
+
description = props.description;
|
|
32
|
+
var styles = props.styles || defaultStyles;
|
|
33
|
+
var validation = props.validation || defaultValidation;
|
|
34
|
+
var isImage = useCallback(function (url) {
|
|
35
|
+
return imageExtensions.some(function (extension) {
|
|
36
|
+
return url.includes(extension);
|
|
37
|
+
});
|
|
38
|
+
}, []);
|
|
39
|
+
var getImageSrc = useCallback(function (url) {
|
|
40
|
+
if (url && isImage(url)) {
|
|
41
|
+
return url;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return fileIcon;
|
|
45
|
+
}, []);
|
|
46
|
+
|
|
47
|
+
var defaultRenderImagePreview = function defaultRenderImagePreview(renderImageProps) {
|
|
48
|
+
return /*#__PURE__*/React.createElement(Image, Object.assign({}, renderImageProps, imagePreviewProps));
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var renderImagePreview = function renderImagePreview(url) {
|
|
52
|
+
if (url && !isImage(url)) {
|
|
53
|
+
return createRenderImagePreview({
|
|
54
|
+
value: url,
|
|
55
|
+
imagePreviewProps: imagePreviewProps
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return defaultRenderImagePreview;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Ui.Image, {
|
|
63
|
+
renderImagePreview: renderImagePreview(url),
|
|
64
|
+
style: styles,
|
|
65
|
+
value: url ? {
|
|
66
|
+
src: getImageSrc(url)
|
|
67
|
+
} : null,
|
|
68
|
+
uploadImage: showFileManager,
|
|
69
|
+
removeImage: onRemove,
|
|
70
|
+
placeholder: placeholder,
|
|
71
|
+
containerStyle: {
|
|
72
|
+
height: "auto"
|
|
73
|
+
}
|
|
74
|
+
}), validation.isValid === false && /*#__PURE__*/React.createElement(FormElementMessage, {
|
|
75
|
+
error: true
|
|
76
|
+
}, validation.message || "Invalid value."), validation.isValid !== false && description && /*#__PURE__*/React.createElement(FormElementMessage, null, description));
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default File;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
|
+
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { i18n } from "@webiny/app/i18n";
|
|
7
|
+
import { Cell, Grid } from "@webiny/ui/Grid";
|
|
8
|
+
import { FileManager } from "@webiny/app-admin/components";
|
|
9
|
+
import File from "./File";
|
|
10
|
+
import { FormElementMessage } from "@webiny/ui/FormElementMessage";
|
|
11
|
+
var t = i18n.ns("app-headless-cms/admin/fields/file");
|
|
12
|
+
var plugin = {
|
|
13
|
+
type: "cms-editor-field-renderer",
|
|
14
|
+
name: "cms-editor-field-renderer-file",
|
|
15
|
+
renderer: {
|
|
16
|
+
rendererName: "file-input",
|
|
17
|
+
name: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["File Input"]))),
|
|
18
|
+
description: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Enables selecting a single file via File Manager."]))),
|
|
19
|
+
canUse: function canUse(_ref) {
|
|
20
|
+
var field = _ref.field;
|
|
21
|
+
return field.type === "file" && !field.multipleValues;
|
|
22
|
+
},
|
|
23
|
+
render: function render(_ref2) {
|
|
24
|
+
var field = _ref2.field,
|
|
25
|
+
getBind = _ref2.getBind,
|
|
26
|
+
Label = _ref2.Label;
|
|
27
|
+
var Bind = getBind();
|
|
28
|
+
var imagesOnly = field.settings && field.settings.imagesOnly;
|
|
29
|
+
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
30
|
+
span: 12
|
|
31
|
+
}, /*#__PURE__*/React.createElement(Label, null, field.label), /*#__PURE__*/React.createElement(Bind, null, function (bind) {
|
|
32
|
+
var value = bind.value,
|
|
33
|
+
onChange = bind.onChange;
|
|
34
|
+
return /*#__PURE__*/React.createElement(FileManager, {
|
|
35
|
+
multiple: false,
|
|
36
|
+
images: imagesOnly
|
|
37
|
+
}, function (_ref3) {
|
|
38
|
+
var showFileManager = _ref3.showFileManager;
|
|
39
|
+
|
|
40
|
+
var selectFile = function selectFile() {
|
|
41
|
+
showFileManager(function (newFile) {
|
|
42
|
+
if (newFile === null) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
onChange(newFile.src);
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
return /*#__PURE__*/React.createElement(File, Object.assign({}, bind, {
|
|
51
|
+
url: value,
|
|
52
|
+
onRemove: function onRemove() {
|
|
53
|
+
return onChange(null);
|
|
54
|
+
},
|
|
55
|
+
showFileManager: selectFile,
|
|
56
|
+
placeholder: field.placeholderText,
|
|
57
|
+
description: field.helpText
|
|
58
|
+
}));
|
|
59
|
+
});
|
|
60
|
+
}), field.helpText && /*#__PURE__*/React.createElement(FormElementMessage, null, field.helpText)));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
export default plugin;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
|
+
|
|
4
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
5
|
+
|
|
6
|
+
import React from "react";
|
|
7
|
+
import dotProp from "dot-prop-immutable";
|
|
8
|
+
import { i18n } from "@webiny/app/i18n";
|
|
9
|
+
import { Cell, GridInner } from "@webiny/ui/Grid";
|
|
10
|
+
import { imageWrapperStyles } from "./utils";
|
|
11
|
+
import { FileManager } from "@webiny/app-admin/components";
|
|
12
|
+
import styled from "@emotion/styled";
|
|
13
|
+
import File from "./File";
|
|
14
|
+
var t = i18n.ns("app-headless-cms/admin/fields/file");
|
|
15
|
+
var FileUploadWrapper = /*#__PURE__*/styled("div", {
|
|
16
|
+
target: "eq80mh0",
|
|
17
|
+
label: "FileUploadWrapper"
|
|
18
|
+
})({
|
|
19
|
+
position: "relative",
|
|
20
|
+
".disabled": {
|
|
21
|
+
opacity: 0.75,
|
|
22
|
+
pointerEvents: "none"
|
|
23
|
+
},
|
|
24
|
+
".mdc-text-field-helper-text": {
|
|
25
|
+
color: "var(--mdc-theme-text-secondary-on-background)"
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
function FieldRenderer(_ref) {
|
|
30
|
+
var getBind = _ref.getBind,
|
|
31
|
+
Label = _ref.Label,
|
|
32
|
+
field = _ref.field;
|
|
33
|
+
var Bind = getBind();
|
|
34
|
+
var imagesOnly = field.settings && field.settings.imagesOnly;
|
|
35
|
+
return /*#__PURE__*/React.createElement(Bind, null, function (bind) {
|
|
36
|
+
var value = bind.value,
|
|
37
|
+
onChange = bind.onChange;
|
|
38
|
+
return /*#__PURE__*/React.createElement(FileUploadWrapper, {
|
|
39
|
+
className: imageWrapperStyles
|
|
40
|
+
}, /*#__PURE__*/React.createElement(FileManager, {
|
|
41
|
+
multiple: true,
|
|
42
|
+
images: imagesOnly
|
|
43
|
+
}, function (_ref2) {
|
|
44
|
+
var showFileManager = _ref2.showFileManager;
|
|
45
|
+
|
|
46
|
+
var selectFiles = function selectFiles() {
|
|
47
|
+
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
48
|
+
showFileManager(function (files) {
|
|
49
|
+
if (!files) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
var urls = files.map(function (f) {
|
|
54
|
+
return f.src;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (index === -1) {
|
|
58
|
+
onChange([].concat(_toConsumableArray(value || []), _toConsumableArray(urls)));
|
|
59
|
+
} else {
|
|
60
|
+
onChange([].concat(_toConsumableArray(value.slice(0, index)), _toConsumableArray(urls), _toConsumableArray(value.slice(index + 1))));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return /*#__PURE__*/React.createElement(GridInner, null, /*#__PURE__*/React.createElement(Cell, {
|
|
66
|
+
span: 12
|
|
67
|
+
}, /*#__PURE__*/React.createElement(Label, null, field.label)), value.map(function (url, index) {
|
|
68
|
+
return /*#__PURE__*/React.createElement(Cell, {
|
|
69
|
+
span: 3,
|
|
70
|
+
key: url
|
|
71
|
+
}, /*#__PURE__*/React.createElement(File, {
|
|
72
|
+
url: url,
|
|
73
|
+
showFileManager: function showFileManager() {
|
|
74
|
+
return selectFiles(index);
|
|
75
|
+
},
|
|
76
|
+
onRemove: function onRemove() {
|
|
77
|
+
return onChange(dotProp.delete(value, index));
|
|
78
|
+
},
|
|
79
|
+
placeholder: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Select a file\""])))
|
|
80
|
+
}));
|
|
81
|
+
}), /*#__PURE__*/React.createElement(Cell, {
|
|
82
|
+
span: 3
|
|
83
|
+
}, /*#__PURE__*/React.createElement(File, Object.assign({}, bind, {
|
|
84
|
+
showFileManager: function showFileManager() {
|
|
85
|
+
return selectFiles();
|
|
86
|
+
},
|
|
87
|
+
placeholder: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Select a file\""])))
|
|
88
|
+
}))));
|
|
89
|
+
}));
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
FieldRenderer.defaultProps = {
|
|
94
|
+
validation: {
|
|
95
|
+
isValid: null
|
|
96
|
+
},
|
|
97
|
+
styles: {
|
|
98
|
+
width: "100%",
|
|
99
|
+
height: "auto"
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
var plugin = {
|
|
103
|
+
type: "cms-editor-field-renderer",
|
|
104
|
+
name: "cms-editor-field-renderer-files",
|
|
105
|
+
renderer: {
|
|
106
|
+
rendererName: "file-inputs",
|
|
107
|
+
name: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["File Inputs"]))),
|
|
108
|
+
description: t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["Enables selecting multiple files via File Manager."]))),
|
|
109
|
+
canUse: function canUse(_ref3) {
|
|
110
|
+
var field = _ref3.field;
|
|
111
|
+
return field.type === "file" && field.multipleValues;
|
|
112
|
+
},
|
|
113
|
+
render: function render(_ref4) {
|
|
114
|
+
var field = _ref4.field,
|
|
115
|
+
getBind = _ref4.getBind,
|
|
116
|
+
Label = _ref4.Label;
|
|
117
|
+
return /*#__PURE__*/React.createElement(FieldRenderer, {
|
|
118
|
+
field: field,
|
|
119
|
+
getBind: getBind,
|
|
120
|
+
Label: Label
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
export default plugin;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const imageExtensions: string[];
|
|
3
|
+
export declare const imageWrapperStyles: string;
|
|
4
|
+
export declare const createRenderImagePreview: ({ value, imagePreviewProps }: {
|
|
5
|
+
value: any;
|
|
6
|
+
imagePreviewProps: any;
|
|
7
|
+
}) => (renderImageProps: any) => JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { css } from "emotion";
|
|
3
|
+
import { ReactComponent as FileIcon } from "@svgr/webpack!../../fields/icons/round_insert_drive_file-24px.svg";
|
|
4
|
+
export var imageExtensions = [".jpg", ".jpeg", ".gif", ".png", ".svg"];
|
|
5
|
+
export var imageWrapperStyles = /*#__PURE__*/css({
|
|
6
|
+
height: "auto"
|
|
7
|
+
}, "label:imageWrapperStyles;");
|
|
8
|
+
var fileLabel = /*#__PURE__*/css({
|
|
9
|
+
padding: "10px",
|
|
10
|
+
whiteSpace: "nowrap",
|
|
11
|
+
overflow: "hidden",
|
|
12
|
+
textOverflow: "ellipsis",
|
|
13
|
+
fontSize: "0.8rem",
|
|
14
|
+
color: "var(--mdc-theme-on-surface)",
|
|
15
|
+
backgroundColor: "var(--mdc-theme-on-background)"
|
|
16
|
+
}, "label:fileLabel;");
|
|
17
|
+
var IconWrapperStyle = /*#__PURE__*/css({
|
|
18
|
+
display: "flex",
|
|
19
|
+
justifyContent: "center",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
height: 200
|
|
22
|
+
}, "label:IconWrapperStyle;");
|
|
23
|
+
var IconStyle = /*#__PURE__*/css({
|
|
24
|
+
width: 64,
|
|
25
|
+
height: 64
|
|
26
|
+
}, "label:IconStyle;");
|
|
27
|
+
export var createRenderImagePreview = function createRenderImagePreview(_ref) {
|
|
28
|
+
var value = _ref.value,
|
|
29
|
+
imagePreviewProps = _ref.imagePreviewProps;
|
|
30
|
+
var fileName = getFileName(value);
|
|
31
|
+
|
|
32
|
+
var renderImagePreview = function renderImagePreview(renderImageProps) {
|
|
33
|
+
return /*#__PURE__*/React.createElement("div", Object.assign({}, renderImageProps, imagePreviewProps), /*#__PURE__*/React.createElement("div", {
|
|
34
|
+
className: IconWrapperStyle
|
|
35
|
+
}, /*#__PURE__*/React.createElement(FileIcon, {
|
|
36
|
+
className: IconStyle
|
|
37
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: fileLabel
|
|
39
|
+
}, fileName));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return renderImagePreview;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
var getFileName = function getFileName(value) {
|
|
46
|
+
if (!value) {
|
|
47
|
+
return "";
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return value.split("/").pop();
|
|
51
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
|
+
|
|
5
|
+
import React from "react";
|
|
6
|
+
import get from "lodash/get";
|
|
7
|
+
import { Input } from "@webiny/ui/Input";
|
|
8
|
+
import { i18n } from "@webiny/app/i18n";
|
|
9
|
+
var t = i18n.ns("app-headless-cms/admin/fields/text");
|
|
10
|
+
var plugin = {
|
|
11
|
+
type: "cms-editor-field-renderer",
|
|
12
|
+
name: "cms-editor-field-renderer-long-text-textarea",
|
|
13
|
+
renderer: {
|
|
14
|
+
rendererName: "long-text-text-area",
|
|
15
|
+
name: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Text Area"]))),
|
|
16
|
+
description: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Renders a simple text area, suitable for larger amounts of text."]))),
|
|
17
|
+
canUse: function canUse(_ref) {
|
|
18
|
+
var field = _ref.field;
|
|
19
|
+
return field.type === "long-text" && !field.multipleValues && !get(field, "predefinedValues.enabled");
|
|
20
|
+
},
|
|
21
|
+
render: function render(_ref2) {
|
|
22
|
+
var field = _ref2.field,
|
|
23
|
+
getBind = _ref2.getBind;
|
|
24
|
+
var Bind = getBind();
|
|
25
|
+
return /*#__PURE__*/React.createElement(Bind, null, function (bind) {
|
|
26
|
+
return /*#__PURE__*/React.createElement(Input, Object.assign({}, bind, {
|
|
27
|
+
rows: 5,
|
|
28
|
+
label: field.label,
|
|
29
|
+
placeholder: field.placeholderText,
|
|
30
|
+
description: field.helpText
|
|
31
|
+
}));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export default plugin;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
4
|
+
|
|
5
|
+
import React from "react";
|
|
6
|
+
import get from "lodash/get";
|
|
7
|
+
import { Input } from "@webiny/ui/Input";
|
|
8
|
+
import { i18n } from "@webiny/app/i18n";
|
|
9
|
+
import { ReactComponent as DeleteIcon } from "@svgr/webpack!../../../icons/close.svg";
|
|
10
|
+
import DynamicSection from "../DynamicSection";
|
|
11
|
+
var t = i18n.ns("app-headless-cms/admin/fields/text");
|
|
12
|
+
var plugin = {
|
|
13
|
+
type: "cms-editor-field-renderer",
|
|
14
|
+
name: "cms-editor-field-renderer-long-text-inputs",
|
|
15
|
+
renderer: {
|
|
16
|
+
rendererName: "long-text-inputs",
|
|
17
|
+
name: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Text Areas"]))),
|
|
18
|
+
description: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Renders a simple list of text areas."]))),
|
|
19
|
+
canUse: function canUse(_ref) {
|
|
20
|
+
var field = _ref.field;
|
|
21
|
+
return field.type === "long-text" && field.multipleValues && !get(field, "predefinedValues.enabled");
|
|
22
|
+
},
|
|
23
|
+
render: function render(props) {
|
|
24
|
+
return /*#__PURE__*/React.createElement(DynamicSection, props, function (_ref2) {
|
|
25
|
+
var bind = _ref2.bind,
|
|
26
|
+
index = _ref2.index;
|
|
27
|
+
return /*#__PURE__*/React.createElement(Input, Object.assign({}, bind.index, {
|
|
28
|
+
rows: 5,
|
|
29
|
+
label: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Value {number}"])))({
|
|
30
|
+
number: index + 1
|
|
31
|
+
}),
|
|
32
|
+
trailingIcon: index > 0 && {
|
|
33
|
+
icon: /*#__PURE__*/React.createElement(DeleteIcon, null),
|
|
34
|
+
onClick: function onClick() {
|
|
35
|
+
return bind.field.removeValue(index);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export default plugin;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
|
+
|
|
5
|
+
import React from "react";
|
|
6
|
+
import get from "lodash/get";
|
|
7
|
+
import { Input } from "@webiny/ui/Input";
|
|
8
|
+
import { i18n } from "@webiny/app/i18n";
|
|
9
|
+
var t = i18n.ns("app-headless-cms/admin/fields/number");
|
|
10
|
+
var plugin = {
|
|
11
|
+
type: "cms-editor-field-renderer",
|
|
12
|
+
name: "cms-editor-field-renderer-number",
|
|
13
|
+
renderer: {
|
|
14
|
+
rendererName: "number-input",
|
|
15
|
+
name: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Number Input"]))),
|
|
16
|
+
description: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Renders a simple input with its type set to \"number\"."]))),
|
|
17
|
+
canUse: function canUse(_ref) {
|
|
18
|
+
var field = _ref.field;
|
|
19
|
+
return field.type === "number" && !field.multipleValues && !get(field, "predefinedValues.enabled");
|
|
20
|
+
},
|
|
21
|
+
render: function render(_ref2) {
|
|
22
|
+
var field = _ref2.field,
|
|
23
|
+
getBind = _ref2.getBind;
|
|
24
|
+
var Bind = getBind();
|
|
25
|
+
return /*#__PURE__*/React.createElement(Bind, null, function (bindProps) {
|
|
26
|
+
return /*#__PURE__*/React.createElement(Input, Object.assign({}, bindProps, {
|
|
27
|
+
onChange: function onChange(value) {
|
|
28
|
+
return bindProps.onChange(value);
|
|
29
|
+
},
|
|
30
|
+
label: field.label,
|
|
31
|
+
placeholder: field.placeholderText,
|
|
32
|
+
description: field.helpText,
|
|
33
|
+
type: "number"
|
|
34
|
+
}));
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export default plugin;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
4
|
+
|
|
5
|
+
import React from "react";
|
|
6
|
+
import get from "lodash/get";
|
|
7
|
+
import { Input } from "@webiny/ui/Input";
|
|
8
|
+
import { i18n } from "@webiny/app/i18n";
|
|
9
|
+
import { ReactComponent as DeleteIcon } from "@svgr/webpack!../../../icons/close.svg";
|
|
10
|
+
import DynamicSection from "../DynamicSection";
|
|
11
|
+
var t = i18n.ns("app-headless-cms/admin/fields/text");
|
|
12
|
+
var plugin = {
|
|
13
|
+
type: "cms-editor-field-renderer",
|
|
14
|
+
name: "cms-editor-field-renderer-number-inputs",
|
|
15
|
+
renderer: {
|
|
16
|
+
rendererName: "number-inputs",
|
|
17
|
+
name: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Number Inputs"]))),
|
|
18
|
+
description: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Renders a simple list of number inputs."]))),
|
|
19
|
+
canUse: function canUse(_ref) {
|
|
20
|
+
var field = _ref.field;
|
|
21
|
+
return field.type === "number" && field.multipleValues && !get(field, "predefinedValues.enabled");
|
|
22
|
+
},
|
|
23
|
+
render: function render(props) {
|
|
24
|
+
return /*#__PURE__*/React.createElement(DynamicSection, props, function (_ref2) {
|
|
25
|
+
var bind = _ref2.bind,
|
|
26
|
+
index = _ref2.index;
|
|
27
|
+
return /*#__PURE__*/React.createElement(Input, Object.assign({}, bind.index, {
|
|
28
|
+
onChange: function onChange(value) {
|
|
29
|
+
return bind.index.onChange(value);
|
|
30
|
+
},
|
|
31
|
+
autoFocus: true,
|
|
32
|
+
onEnter: function onEnter() {
|
|
33
|
+
return bind.field.appendValue("");
|
|
34
|
+
},
|
|
35
|
+
label: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Value {number}"])))({
|
|
36
|
+
number: index + 1
|
|
37
|
+
}),
|
|
38
|
+
type: "number",
|
|
39
|
+
trailingIcon: index > 0 && {
|
|
40
|
+
icon: /*#__PURE__*/React.createElement(DeleteIcon, null),
|
|
41
|
+
onClick: function onClick() {
|
|
42
|
+
return bind.field.removeValue(index);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
export default plugin;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { css } from "emotion";
|
|
2
|
+
export var fieldsWrapperStyle = /*#__PURE__*/css("border-left:2px solid var(--mdc-theme-on-background);padding-left:16px;&:focus-within{border-color:var(--mdc-theme-primary);}label:fieldsWrapperStyle;");
|
|
3
|
+
export var dynamicSectionTitleStyle = /*#__PURE__*/css("margin-top:24px;label:dynamicSectionTitleStyle;");
|
|
4
|
+
export var dynamicSectionGridStyle = /*#__PURE__*/css("& > .mdc-layout-grid__inner{grid-gap:8px;}label:dynamicSectionGridStyle;");
|
|
5
|
+
export var fieldsGridStyle = /*#__PURE__*/css("&.mdc-layout-grid{padding:8px;}label:fieldsGridStyle;");
|