@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,231 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
5
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
6
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
7
|
+
|
|
8
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
9
|
+
|
|
10
|
+
var _excluded = ["id"];
|
|
11
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
12
|
+
import React, { useCallback } from "react";
|
|
13
|
+
import styled from "@emotion/styled";
|
|
14
|
+
import isEmpty from "lodash/isEmpty";
|
|
15
|
+
import get from "lodash/get";
|
|
16
|
+
import pick from "lodash/pick";
|
|
17
|
+
import { Form } from "@webiny/form";
|
|
18
|
+
import { Grid, Cell } from "@webiny/ui/Grid";
|
|
19
|
+
import { Input } from "@webiny/ui/Input";
|
|
20
|
+
import { ButtonDefault, ButtonIcon, ButtonPrimary } from "@webiny/ui/Button";
|
|
21
|
+
import { CircularProgress } from "@webiny/ui/Progress";
|
|
22
|
+
import { i18n } from "@webiny/app/i18n";
|
|
23
|
+
import { validation } from "@webiny/validation";
|
|
24
|
+
import { SimpleFormHeader, SimpleForm, SimpleFormFooter, SimpleFormContent } from "@webiny/app-admin/components/SimpleForm";
|
|
25
|
+
import IconPicker from "./IconPicker";
|
|
26
|
+
import { useRouter } from "@webiny/react-router";
|
|
27
|
+
import { useSnackbar } from "@webiny/app-admin/hooks/useSnackbar";
|
|
28
|
+
import EmptyView from "@webiny/app-admin/components/EmptyView";
|
|
29
|
+
import { ReactComponent as AddIcon } from "@svgr/webpack!@webiny/app-admin/assets/icons/add-18px.svg";
|
|
30
|
+
import { useMutation, useQuery } from "../../hooks";
|
|
31
|
+
import * as GQL from "./graphql";
|
|
32
|
+
import usePermission from "../../hooks/usePermission";
|
|
33
|
+
import { Tooltip } from "@webiny/ui/Tooltip";
|
|
34
|
+
var t = i18n.ns("app-headless-cms/admin/content-model-groups/form");
|
|
35
|
+
var ButtonWrapper = /*#__PURE__*/styled("div", {
|
|
36
|
+
target: "e7xbi20",
|
|
37
|
+
label: "ButtonWrapper"
|
|
38
|
+
})({
|
|
39
|
+
display: "flex",
|
|
40
|
+
justifyContent: "space-between"
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
function ContentModelGroupsForm(_ref) {
|
|
44
|
+
var canCreate = _ref.canCreate;
|
|
45
|
+
|
|
46
|
+
var _useRouter = useRouter(),
|
|
47
|
+
location = _useRouter.location,
|
|
48
|
+
history = _useRouter.history;
|
|
49
|
+
|
|
50
|
+
var _useSnackbar = useSnackbar(),
|
|
51
|
+
showSnackbar = _useSnackbar.showSnackbar;
|
|
52
|
+
|
|
53
|
+
var _usePermission = usePermission(),
|
|
54
|
+
canEdit = _usePermission.canEdit;
|
|
55
|
+
|
|
56
|
+
var newEntry = new URLSearchParams(location.search).get("new") === "true";
|
|
57
|
+
var id = new URLSearchParams(location.search).get("id");
|
|
58
|
+
var getQuery = useQuery(GQL.GET_CONTENT_MODEL_GROUP, {
|
|
59
|
+
variables: {
|
|
60
|
+
id: id
|
|
61
|
+
},
|
|
62
|
+
skip: !id,
|
|
63
|
+
onCompleted: function onCompleted(data) {
|
|
64
|
+
if (!data) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
var error = data.contentModelGroup.error;
|
|
69
|
+
|
|
70
|
+
if (error) {
|
|
71
|
+
history.push("/cms/content-model-group");
|
|
72
|
+
showSnackbar(error.message);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}); // Create a new group and update list cache
|
|
76
|
+
|
|
77
|
+
var _useMutation = useMutation(GQL.CREATE_CONTENT_MODEL_GROUP, {
|
|
78
|
+
update: function update(cache, _ref2) {
|
|
79
|
+
var data = _ref2.data;
|
|
80
|
+
|
|
81
|
+
if (data.contentModelGroup.error) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
var gqlParams = {
|
|
86
|
+
query: GQL.LIST_CONTENT_MODEL_GROUPS
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var _cache$readQuery = cache.readQuery(gqlParams),
|
|
90
|
+
listContentModelGroups = _cache$readQuery.listContentModelGroups;
|
|
91
|
+
|
|
92
|
+
cache.writeQuery(_objectSpread(_objectSpread({}, gqlParams), {}, {
|
|
93
|
+
data: {
|
|
94
|
+
listContentModelGroups: _objectSpread(_objectSpread({}, listContentModelGroups), {}, {
|
|
95
|
+
data: [data.contentModelGroup.data].concat(_toConsumableArray(listContentModelGroups.data))
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
}),
|
|
101
|
+
_useMutation2 = _slicedToArray(_useMutation, 2),
|
|
102
|
+
create = _useMutation2[0],
|
|
103
|
+
createMutation = _useMutation2[1];
|
|
104
|
+
|
|
105
|
+
var _useMutation3 = useMutation(GQL.UPDATE_CONTENT_MODEL_GROUP),
|
|
106
|
+
_useMutation4 = _slicedToArray(_useMutation3, 2),
|
|
107
|
+
update = _useMutation4[0],
|
|
108
|
+
updateMutation = _useMutation4[1];
|
|
109
|
+
|
|
110
|
+
var loading = [getQuery, createMutation, updateMutation].find(function (item) {
|
|
111
|
+
return item.loading;
|
|
112
|
+
});
|
|
113
|
+
var onSubmit = useCallback( /*#__PURE__*/function () {
|
|
114
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3) {
|
|
115
|
+
var id, group, _ref5, _ref6, operation, args, response, _response$data$conten, data, error;
|
|
116
|
+
|
|
117
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
118
|
+
while (1) {
|
|
119
|
+
switch (_context.prev = _context.next) {
|
|
120
|
+
case 0:
|
|
121
|
+
id = _ref3.id, group = _objectWithoutProperties(_ref3, _excluded);
|
|
122
|
+
_ref5 = id ? [update, {
|
|
123
|
+
variables: {
|
|
124
|
+
id: id,
|
|
125
|
+
data: pick(group, ["name", "description", "icon"])
|
|
126
|
+
}
|
|
127
|
+
}] : [create, {
|
|
128
|
+
variables: {
|
|
129
|
+
data: pick(group, ["name", "description", "icon"])
|
|
130
|
+
}
|
|
131
|
+
}], _ref6 = _slicedToArray(_ref5, 2), operation = _ref6[0], args = _ref6[1];
|
|
132
|
+
_context.next = 4;
|
|
133
|
+
return operation(args);
|
|
134
|
+
|
|
135
|
+
case 4:
|
|
136
|
+
response = _context.sent;
|
|
137
|
+
_response$data$conten = response.data.contentModelGroup, data = _response$data$conten.data, error = _response$data$conten.error;
|
|
138
|
+
|
|
139
|
+
if (!error) {
|
|
140
|
+
_context.next = 8;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return _context.abrupt("return", showSnackbar(error.message));
|
|
145
|
+
|
|
146
|
+
case 8:
|
|
147
|
+
!id && history.push("/cms/content-model-groups?id=".concat(data.id));
|
|
148
|
+
showSnackbar(t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Content model group saved successfully!"]))));
|
|
149
|
+
|
|
150
|
+
case 10:
|
|
151
|
+
case "end":
|
|
152
|
+
return _context.stop();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}, _callee);
|
|
156
|
+
}));
|
|
157
|
+
|
|
158
|
+
return function (_x) {
|
|
159
|
+
return _ref4.apply(this, arguments);
|
|
160
|
+
};
|
|
161
|
+
}(), [id]);
|
|
162
|
+
var data = getQuery.loading ? null : get(getQuery, "data.contentModelGroup.data", null);
|
|
163
|
+
var showEmptyView = !newEntry && !loading && isEmpty(data); // Render "No content selected" view.
|
|
164
|
+
|
|
165
|
+
if (showEmptyView) {
|
|
166
|
+
return /*#__PURE__*/React.createElement(EmptyView, {
|
|
167
|
+
title: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Click on the left side list to display group details {message}"])))({
|
|
168
|
+
message: canCreate ? "or create a..." : ""
|
|
169
|
+
}),
|
|
170
|
+
action: canCreate ? /*#__PURE__*/React.createElement(ButtonDefault, {
|
|
171
|
+
"data-testid": "new-record-button",
|
|
172
|
+
onClick: function onClick() {
|
|
173
|
+
return history.push("/cms/content-model-groups?new=true");
|
|
174
|
+
}
|
|
175
|
+
}, /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
176
|
+
icon: /*#__PURE__*/React.createElement(AddIcon, null)
|
|
177
|
+
}), " ", t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["New Group"])))) : null
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
return /*#__PURE__*/React.createElement(Form, {
|
|
182
|
+
onSubmit: onSubmit,
|
|
183
|
+
data: data || {
|
|
184
|
+
icon: "fas/star"
|
|
185
|
+
}
|
|
186
|
+
}, function (_ref7) {
|
|
187
|
+
var data = _ref7.data,
|
|
188
|
+
form = _ref7.form,
|
|
189
|
+
Bind = _ref7.Bind;
|
|
190
|
+
return /*#__PURE__*/React.createElement(SimpleForm, {
|
|
191
|
+
"data-testid": "pb-content-model-groups-form"
|
|
192
|
+
}, /*#__PURE__*/React.createElement(SimpleFormHeader, {
|
|
193
|
+
title: data.name ? data.name : t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["New content model group"])))
|
|
194
|
+
}), loading && /*#__PURE__*/React.createElement(CircularProgress, null), /*#__PURE__*/React.createElement(SimpleFormContent, null, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
195
|
+
span: 12
|
|
196
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
197
|
+
name: "name",
|
|
198
|
+
validators: validation.create("required,maxLength:100")
|
|
199
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
200
|
+
label: t(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["Name"])))
|
|
201
|
+
}))), /*#__PURE__*/React.createElement(Cell, {
|
|
202
|
+
span: 12
|
|
203
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
204
|
+
name: "icon",
|
|
205
|
+
validators: validation.create("required")
|
|
206
|
+
}, /*#__PURE__*/React.createElement(IconPicker, {
|
|
207
|
+
label: t(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["Group icon"]))),
|
|
208
|
+
description: t(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["Icon that will be displayed in the main menu."])))
|
|
209
|
+
}))), /*#__PURE__*/React.createElement(Cell, {
|
|
210
|
+
span: 12
|
|
211
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
212
|
+
name: "description"
|
|
213
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
214
|
+
rows: 5,
|
|
215
|
+
label: t(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["Description"])))
|
|
216
|
+
}))))), /*#__PURE__*/React.createElement(SimpleFormFooter, null, /*#__PURE__*/React.createElement(ButtonWrapper, null, /*#__PURE__*/React.createElement(ButtonDefault, {
|
|
217
|
+
onClick: function onClick() {
|
|
218
|
+
return history.push("/cms/content-model-groups");
|
|
219
|
+
}
|
|
220
|
+
}, t(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["Cancel"])))), canEdit(data, "cms.contentModelGroup") && /*#__PURE__*/React.createElement(React.Fragment, null, !data.plugin ? /*#__PURE__*/React.createElement(ButtonPrimary, {
|
|
221
|
+
onClick: form.submit
|
|
222
|
+
}, t(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["Save content model group"])))) : /*#__PURE__*/React.createElement(Tooltip, {
|
|
223
|
+
content: "Content model group is registered via a plugin.",
|
|
224
|
+
placement: "bottom"
|
|
225
|
+
}, /*#__PURE__*/React.createElement(ButtonPrimary, {
|
|
226
|
+
disabled: true
|
|
227
|
+
}, t(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["Save content model group"])))))))));
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export default ContentModelGroupsForm;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* This component is used to wrap Input and Textarea components to optimize form re-render.
|
|
4
|
+
* These 2 are the only components that trigger form model change on each character input.
|
|
5
|
+
* This means, whenever you type a letter an entire form re-renders.
|
|
6
|
+
* On complex forms you will feel and see a significant delay if this component is not used.
|
|
7
|
+
*
|
|
8
|
+
* The logic behind this component is to serve as a middleware between Form and Input/Textarea, and only notify form of a change when
|
|
9
|
+
* a user stops typing for given period of time (400ms by default).
|
|
10
|
+
*/
|
|
11
|
+
declare class DelayedOnChange extends React.Component<any> {
|
|
12
|
+
static defaultProps: {
|
|
13
|
+
delay: number;
|
|
14
|
+
};
|
|
15
|
+
delay: any;
|
|
16
|
+
state: {
|
|
17
|
+
value: string;
|
|
18
|
+
};
|
|
19
|
+
componentDidMount(): void;
|
|
20
|
+
applyValue: (value: any, callback?: Function) => void;
|
|
21
|
+
onChange: (value: any) => void;
|
|
22
|
+
changed: () => void;
|
|
23
|
+
render(): React.DetailedReactHTMLElement<any, HTMLElement>;
|
|
24
|
+
}
|
|
25
|
+
export default DelayedOnChange;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
+
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
8
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
+
var _excluded = ["children"];
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import noop from "lodash/noop";
|
|
12
|
+
/**
|
|
13
|
+
* This component is used to wrap Input and Textarea components to optimize form re-render.
|
|
14
|
+
* These 2 are the only components that trigger form model change on each character input.
|
|
15
|
+
* This means, whenever you type a letter an entire form re-renders.
|
|
16
|
+
* On complex forms you will feel and see a significant delay if this component is not used.
|
|
17
|
+
*
|
|
18
|
+
* The logic behind this component is to serve as a middleware between Form and Input/Textarea, and only notify form of a change when
|
|
19
|
+
* a user stops typing for given period of time (400ms by default).
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
var DelayedOnChange = /*#__PURE__*/function (_React$Component) {
|
|
23
|
+
_inherits(DelayedOnChange, _React$Component);
|
|
24
|
+
|
|
25
|
+
var _super = _createSuper(DelayedOnChange);
|
|
26
|
+
|
|
27
|
+
function DelayedOnChange() {
|
|
28
|
+
var _this;
|
|
29
|
+
|
|
30
|
+
_classCallCheck(this, DelayedOnChange);
|
|
31
|
+
|
|
32
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
33
|
+
args[_key] = arguments[_key];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
37
|
+
|
|
38
|
+
_defineProperty(_assertThisInitialized(_this), "delay", null);
|
|
39
|
+
|
|
40
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
41
|
+
value: ""
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
_defineProperty(_assertThisInitialized(_this), "applyValue", function (value) {
|
|
45
|
+
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
46
|
+
_this.delay && clearTimeout(_this.delay);
|
|
47
|
+
_this.delay = null;
|
|
48
|
+
|
|
49
|
+
_this.props.onChange(value, callback);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (value) {
|
|
53
|
+
_this.setState({
|
|
54
|
+
value: value
|
|
55
|
+
}, _this.changed);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
_defineProperty(_assertThisInitialized(_this), "changed", function () {
|
|
59
|
+
_this.delay && clearTimeout(_this.delay);
|
|
60
|
+
_this.delay = null;
|
|
61
|
+
_this.delay = setTimeout(function () {
|
|
62
|
+
return _this.applyValue(_this.state.value);
|
|
63
|
+
}, _this.props.delay);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
return _this;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
_createClass(DelayedOnChange, [{
|
|
70
|
+
key: "componentDidMount",
|
|
71
|
+
value: function componentDidMount() {
|
|
72
|
+
this.setState({
|
|
73
|
+
value: this.props.value
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}, {
|
|
77
|
+
key: "render",
|
|
78
|
+
value: function render() {
|
|
79
|
+
var _this2 = this;
|
|
80
|
+
|
|
81
|
+
var _this$props = this.props,
|
|
82
|
+
children = _this$props.children,
|
|
83
|
+
other = _objectWithoutProperties(_this$props, _excluded);
|
|
84
|
+
|
|
85
|
+
var newProps = _objectSpread(_objectSpread({}, other), {}, {
|
|
86
|
+
value: this.state.value,
|
|
87
|
+
onChange: this.onChange
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
var renderProp = typeof children === "function" ? children : false;
|
|
91
|
+
var child = renderProp ? renderProp(newProps) : /*#__PURE__*/React.cloneElement(children, newProps);
|
|
92
|
+
|
|
93
|
+
var props = _objectSpread({}, child.props);
|
|
94
|
+
|
|
95
|
+
var realOnKeyDown = props.onKeyDown || noop;
|
|
96
|
+
var realOnBlur = props.onBlur || noop; // Need to apply value if input lost focus
|
|
97
|
+
|
|
98
|
+
props.onBlur = function (e) {
|
|
99
|
+
e.persist();
|
|
100
|
+
|
|
101
|
+
_this2.applyValue(e.target.value, function () {
|
|
102
|
+
return realOnBlur(e);
|
|
103
|
+
});
|
|
104
|
+
}; // Need to listen for TAB key to apply new value immediately, without delay. Otherwise validation will be triggered with old value.
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
props.onKeyDown = function (e) {
|
|
108
|
+
e.persist();
|
|
109
|
+
|
|
110
|
+
if (e.key === "Tab") {
|
|
111
|
+
_this2.applyValue(e.target.value, function () {
|
|
112
|
+
return realOnKeyDown(e);
|
|
113
|
+
});
|
|
114
|
+
} else if (e.key === "Enter" && props["data-on-enter"]) {
|
|
115
|
+
_this2.applyValue(e.target.value, function () {
|
|
116
|
+
return realOnKeyDown(e);
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
realOnKeyDown(e);
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return /*#__PURE__*/React.cloneElement(child, props);
|
|
124
|
+
}
|
|
125
|
+
}]);
|
|
126
|
+
|
|
127
|
+
return DelayedOnChange;
|
|
128
|
+
}(React.Component);
|
|
129
|
+
|
|
130
|
+
_defineProperty(DelayedOnChange, "defaultProps", {
|
|
131
|
+
delay: 400
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
export default DelayedOnChange;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { FormComponentProps } from "@webiny/ui/types";
|
|
3
|
+
declare const IconPicker: ({ value, onChange, label, description, validation }: FormComponentProps & {
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
}) => JSX.Element;
|
|
7
|
+
export default IconPicker;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { css } from "emotion";
|
|
4
|
+
import { plugins } from "@webiny/plugins";
|
|
5
|
+
import { Typography } from "@webiny/ui/Typography";
|
|
6
|
+
import { Grid } from "react-virtualized";
|
|
7
|
+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
|
8
|
+
import DelayedOnChange from "./DelayedOnChange";
|
|
9
|
+
import { Menu } from "@webiny/ui/Menu";
|
|
10
|
+
import { Input } from "@webiny/ui/Input";
|
|
11
|
+
import { FormElementMessage } from "@webiny/ui/FormElementMessage";
|
|
12
|
+
/**
|
|
13
|
+
* Controls the helper text below the checkbox.
|
|
14
|
+
* @type {string}
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
var iconPickerLabel = /*#__PURE__*/css({
|
|
18
|
+
marginBottom: 5,
|
|
19
|
+
marginLeft: 2
|
|
20
|
+
}, "label:iconPickerLabel;");
|
|
21
|
+
var MenuWrapper = /*#__PURE__*/css({
|
|
22
|
+
color: "var(--mdc-theme-text-secondary-on-background)",
|
|
23
|
+
backgroundColor: "var(--mdc-theme-on-background)",
|
|
24
|
+
padding: "16px 8px"
|
|
25
|
+
}, "label:MenuWrapper;");
|
|
26
|
+
var NoResultWrapper = /*#__PURE__*/css({
|
|
27
|
+
width: 640,
|
|
28
|
+
color: "var(--mdc-theme-text-secondary-on-background)",
|
|
29
|
+
padding: "16px 12px"
|
|
30
|
+
}, "label:NoResultWrapper;");
|
|
31
|
+
var COLUMN_COUNT = 6;
|
|
32
|
+
var gridItem = /*#__PURE__*/css({
|
|
33
|
+
display: "flex",
|
|
34
|
+
flexDirection: "column",
|
|
35
|
+
justifyContent: "flex-start",
|
|
36
|
+
boxSizing: "border-box",
|
|
37
|
+
paddingTop: 15,
|
|
38
|
+
alignItems: "center",
|
|
39
|
+
textAlign: "center",
|
|
40
|
+
cursor: "pointer",
|
|
41
|
+
transform: "translateZ(0)",
|
|
42
|
+
borderRadius: 2,
|
|
43
|
+
color: "var(--mdc-theme-text-secondary-on-background)",
|
|
44
|
+
transition: "all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1)",
|
|
45
|
+
"&::after": {
|
|
46
|
+
boxShadow: "0 0.25rem 0.125rem 0 rgba(0,0,0,0.05)",
|
|
47
|
+
transition: "opacity 0.5s cubic-bezier(0.165, 0.84, 0.44, 1)",
|
|
48
|
+
content: '""',
|
|
49
|
+
position: "absolute",
|
|
50
|
+
top: 0,
|
|
51
|
+
left: 0,
|
|
52
|
+
width: "100%",
|
|
53
|
+
height: "100%",
|
|
54
|
+
zIndex: -1,
|
|
55
|
+
opacity: 0
|
|
56
|
+
},
|
|
57
|
+
"&:hover": {
|
|
58
|
+
backgroundColor: "var(--mdc-theme-background)",
|
|
59
|
+
color: "var(--mdc-theme-text-primary-on-background)",
|
|
60
|
+
"&::after": {
|
|
61
|
+
opacity: 1
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
">svg": {
|
|
65
|
+
width: 42,
|
|
66
|
+
marginBottom: 5
|
|
67
|
+
}
|
|
68
|
+
}, "label:gridItem;");
|
|
69
|
+
var grid = /*#__PURE__*/css({
|
|
70
|
+
padding: 20
|
|
71
|
+
}, "label:grid;");
|
|
72
|
+
var pickIcon = /*#__PURE__*/css({
|
|
73
|
+
width: 50,
|
|
74
|
+
textAlign: "center",
|
|
75
|
+
cursor: "pointer"
|
|
76
|
+
}, "label:pickIcon;");
|
|
77
|
+
var searchInput = /*#__PURE__*/css({
|
|
78
|
+
input: {
|
|
79
|
+
padding: "20px 12px 20px"
|
|
80
|
+
}
|
|
81
|
+
}, "label:searchInput;");
|
|
82
|
+
var useState = React.useState,
|
|
83
|
+
useCallback = React.useCallback,
|
|
84
|
+
useMemo = React.useMemo;
|
|
85
|
+
|
|
86
|
+
var IconPicker = function IconPicker(_ref) {
|
|
87
|
+
var value = _ref.value,
|
|
88
|
+
onChange = _ref.onChange,
|
|
89
|
+
label = _ref.label,
|
|
90
|
+
description = _ref.description,
|
|
91
|
+
validation = _ref.validation;
|
|
92
|
+
|
|
93
|
+
var _useState = useState(""),
|
|
94
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
95
|
+
filter = _useState2[0],
|
|
96
|
+
setFilter = _useState2[1];
|
|
97
|
+
|
|
98
|
+
var _useState3 = useState(false),
|
|
99
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
100
|
+
mustRenderGrid = _useState4[0],
|
|
101
|
+
setMustRenderGrid = _useState4[1];
|
|
102
|
+
|
|
103
|
+
var onFilterChange = useCallback(function (value, cb) {
|
|
104
|
+
setFilter(value);
|
|
105
|
+
cb();
|
|
106
|
+
}, [filter]);
|
|
107
|
+
var allIcons = useMemo(function () {
|
|
108
|
+
var iconPlugins = plugins.byType("cms-icons");
|
|
109
|
+
return iconPlugins.reduce(function (icons, pl) {
|
|
110
|
+
return icons.concat(pl.getIcons());
|
|
111
|
+
}, []);
|
|
112
|
+
}, []);
|
|
113
|
+
var icons = useMemo(function () {
|
|
114
|
+
return filter ? allIcons.filter(function (ic) {
|
|
115
|
+
return ic.name.includes(filter);
|
|
116
|
+
}) : allIcons;
|
|
117
|
+
}, [filter]);
|
|
118
|
+
var renderCell = useCallback(function (_ref2) {
|
|
119
|
+
var closeMenu = _ref2.closeMenu;
|
|
120
|
+
return function renderCell(_ref3) {
|
|
121
|
+
var columnIndex = _ref3.columnIndex,
|
|
122
|
+
key = _ref3.key,
|
|
123
|
+
rowIndex = _ref3.rowIndex,
|
|
124
|
+
style = _ref3.style;
|
|
125
|
+
var item = icons[rowIndex * COLUMN_COUNT + columnIndex];
|
|
126
|
+
|
|
127
|
+
if (!item) {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
key: key,
|
|
133
|
+
style: style,
|
|
134
|
+
className: gridItem,
|
|
135
|
+
onClick: function onClick() {
|
|
136
|
+
onChange(item.id.join("/"));
|
|
137
|
+
closeMenu();
|
|
138
|
+
}
|
|
139
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
140
|
+
icon: item.id,
|
|
141
|
+
size: "2x"
|
|
142
|
+
}), /*#__PURE__*/React.createElement(Typography, {
|
|
143
|
+
use: "body2"
|
|
144
|
+
}, item.name));
|
|
145
|
+
};
|
|
146
|
+
}, [icons]);
|
|
147
|
+
var renderGrid = useCallback(function (_ref4) {
|
|
148
|
+
var closeMenu = _ref4.closeMenu;
|
|
149
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DelayedOnChange, {
|
|
150
|
+
value: filter,
|
|
151
|
+
onChange: onFilterChange
|
|
152
|
+
}, function (_ref5) {
|
|
153
|
+
var value = _ref5.value,
|
|
154
|
+
onChange = _ref5.onChange;
|
|
155
|
+
return /*#__PURE__*/React.createElement(Input, {
|
|
156
|
+
autoFocus: true,
|
|
157
|
+
className: searchInput,
|
|
158
|
+
value: value,
|
|
159
|
+
onChange: onChange,
|
|
160
|
+
placeholder: "Search icons..."
|
|
161
|
+
});
|
|
162
|
+
}), icons.length === 0 ? /*#__PURE__*/React.createElement("div", {
|
|
163
|
+
className: NoResultWrapper
|
|
164
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
165
|
+
use: "body1"
|
|
166
|
+
}, "No results found.")) : /*#__PURE__*/React.createElement(Grid, {
|
|
167
|
+
className: grid,
|
|
168
|
+
cellRenderer: renderCell({
|
|
169
|
+
closeMenu: closeMenu
|
|
170
|
+
}),
|
|
171
|
+
columnCount: COLUMN_COUNT,
|
|
172
|
+
columnWidth: 100,
|
|
173
|
+
height: 440,
|
|
174
|
+
rowCount: Math.ceil(icons.length / COLUMN_COUNT),
|
|
175
|
+
rowHeight: 100,
|
|
176
|
+
width: 640
|
|
177
|
+
}));
|
|
178
|
+
}, [icons]);
|
|
179
|
+
var fontAwesomeIconValue = typeof value === "string" && value.includes("/") ? value.split("/") : ["fas", "star"];
|
|
180
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, label && /*#__PURE__*/React.createElement("div", {
|
|
181
|
+
className: iconPickerLabel
|
|
182
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
183
|
+
use: "body1"
|
|
184
|
+
}, label)), /*#__PURE__*/React.createElement("div", {
|
|
185
|
+
className: MenuWrapper
|
|
186
|
+
}, /*#__PURE__*/React.createElement(Menu, {
|
|
187
|
+
onOpen: function onOpen() {
|
|
188
|
+
return setMustRenderGrid(true);
|
|
189
|
+
},
|
|
190
|
+
onClose: function onClose() {
|
|
191
|
+
return setMustRenderGrid(false);
|
|
192
|
+
},
|
|
193
|
+
handle: /*#__PURE__*/React.createElement("div", {
|
|
194
|
+
className: pickIcon
|
|
195
|
+
}, /*#__PURE__*/React.createElement(FontAwesomeIcon, {
|
|
196
|
+
icon: fontAwesomeIconValue,
|
|
197
|
+
size: "2x"
|
|
198
|
+
}))
|
|
199
|
+
}, mustRenderGrid && renderGrid)), validation.isValid === false && /*#__PURE__*/React.createElement(FormElementMessage, {
|
|
200
|
+
error: true
|
|
201
|
+
}, validation.message), validation.isValid !== false && description && /*#__PURE__*/React.createElement(FormElementMessage, null, description));
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
export default IconPicker;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const LIST_CONTENT_MODEL_GROUPS: import("graphql").DocumentNode;
|
|
2
|
+
export declare const GET_CONTENT_MODEL_GROUP: import("graphql").DocumentNode;
|
|
3
|
+
export declare const CREATE_CONTENT_MODEL_GROUP: import("graphql").DocumentNode;
|
|
4
|
+
export declare const UPDATE_CONTENT_MODEL_GROUP: import("graphql").DocumentNode;
|
|
5
|
+
export declare const DELETE_CONTENT_MODEL_GROUP: import("graphql").DocumentNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
4
|
+
|
|
5
|
+
import gql from "graphql-tag";
|
|
6
|
+
var fields = "\n id\n name\n slug\n description\n icon\n createdOn\n plugin\n createdBy {\n id\n displayName\n type\n }\n";
|
|
7
|
+
export var LIST_CONTENT_MODEL_GROUPS = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query CmsListContentModelGroups {\n listContentModelGroups {\n data {\n ", "\n contentModels {\n modelId\n name\n }\n }\n }\n }\n"])), fields);
|
|
8
|
+
export var GET_CONTENT_MODEL_GROUP = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n query CmsGetContentModelGroup($id: ID!) {\n contentModelGroup: getContentModelGroup(id: $id){\n data {\n ", "\n }\n error {\n code\n message\n }\n }\n }\n"])), fields);
|
|
9
|
+
export var CREATE_CONTENT_MODEL_GROUP = gql(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n mutation CmsCreateContentModelGroup($data: CmsContentModelGroupInput!){\n contentModelGroup: createContentModelGroup(data: $data) {\n data {\n ", "\n contentModels {\n modelId\n name\n }\n }\n error {\n code\n message\n data\n }\n }\n }\n"])), fields);
|
|
10
|
+
export var UPDATE_CONTENT_MODEL_GROUP = gql(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n mutation CmsUpdateContentModelGroup($id: ID!, $data: CmsContentModelGroupInput!){\n contentModelGroup: updateContentModelGroup(id: $id, data: $data) {\n data {\n ", "\n }\n error {\n code\n message\n data\n }\n }\n }\n"])), fields);
|
|
11
|
+
export var DELETE_CONTENT_MODEL_GROUP = gql(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n mutation CmsDeleteContentModelGroup($id: ID!) {\n deleteContentModelGroup(id: $id) {\n data\n error {\n code\n message\n }\n }\n }\n"])));
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import HTML5Backend from "react-dnd-html5-backend";
|
|
3
|
+
import { DndProvider } from "react-dnd";
|
|
4
|
+
import { Editor } from "../../components/ContentModelEditor/Editor";
|
|
5
|
+
import { useRouter } from "@webiny/react-router";
|
|
6
|
+
import { useCms } from "../../hooks";
|
|
7
|
+
import { ContentModelEditorProvider } from "../../components/ContentModelEditor/Context";
|
|
8
|
+
import Snackbar from "@webiny/app-admin/ui/views/AdminView/components/Snackbar";
|
|
9
|
+
export default function ContentModelEditorView() {
|
|
10
|
+
var _useRouter = useRouter(),
|
|
11
|
+
match = _useRouter.match;
|
|
12
|
+
|
|
13
|
+
var _useCms = useCms(),
|
|
14
|
+
apolloClient = _useCms.apolloClient;
|
|
15
|
+
|
|
16
|
+
var _ref = match.params,
|
|
17
|
+
modelId = _ref.modelId;
|
|
18
|
+
|
|
19
|
+
if (!apolloClient) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return /*#__PURE__*/React.createElement(ContentModelEditorProvider, {
|
|
24
|
+
key: modelId,
|
|
25
|
+
apolloClient: apolloClient,
|
|
26
|
+
modelId: modelId
|
|
27
|
+
}, /*#__PURE__*/React.createElement(DndProvider, {
|
|
28
|
+
backend: HTML5Backend
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Editor, null), /*#__PURE__*/React.createElement("div", {
|
|
30
|
+
style: {
|
|
31
|
+
zIndex: 10,
|
|
32
|
+
position: "absolute"
|
|
33
|
+
}
|
|
34
|
+
}, /*#__PURE__*/React.createElement(Snackbar, null))));
|
|
35
|
+
}
|