@akemona-org/strapi-plugin-content-manager 3.7.0
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 +22 -0
- package/README.md +27 -0
- package/admin/src/InjectedComponents/ContentTypeBuilder/ConfigureViewButton/index.js +78 -0
- package/admin/src/assets/images/background_input.svg +1 -0
- package/admin/src/assets/images/icon-cross-blue.svg +1 -0
- package/admin/src/assets/images/icon_remove.svg +19 -0
- package/admin/src/assets/images/logo.svg +1 -0
- package/admin/src/components/AddDropdown/components.js +113 -0
- package/admin/src/components/AddDropdown/index.js +76 -0
- package/admin/src/components/Block/components.js +28 -0
- package/admin/src/components/Block/index.js +45 -0
- package/admin/src/components/ComponentInitializer/P.js +9 -0
- package/admin/src/components/ComponentInitializer/index.js +43 -0
- package/admin/src/components/Container/index.js +7 -0
- package/admin/src/components/CustomInputCheckbox/components.js +77 -0
- package/admin/src/components/CustomInputCheckbox/index.js +53 -0
- package/admin/src/components/CustomTable/ActionCollapse/Delete.js +14 -0
- package/admin/src/components/CustomTable/ActionCollapse/DeleteAll.js +18 -0
- package/admin/src/components/CustomTable/ActionCollapse/Wrapper.js +20 -0
- package/admin/src/components/CustomTable/ActionCollapse/index.js +38 -0
- package/admin/src/components/CustomTable/Headers/Header.js +59 -0
- package/admin/src/components/CustomTable/Headers/Thead.js +35 -0
- package/admin/src/components/CustomTable/Headers/index.js +46 -0
- package/admin/src/components/CustomTable/Row/ActionContainer.js +19 -0
- package/admin/src/components/CustomTable/Row/Cell.js +55 -0
- package/admin/src/components/CustomTable/Row/index.js +112 -0
- package/admin/src/components/CustomTable/index.js +162 -0
- package/admin/src/components/CustomTable/styledComponents.js +85 -0
- package/admin/src/components/DragLayer/index.js +102 -0
- package/admin/src/components/DraggedField/Close/index.js +10 -0
- package/admin/src/components/DraggedField/GrabWrapper.js +38 -0
- package/admin/src/components/DraggedField/Link.js +17 -0
- package/admin/src/components/DraggedField/NameWrapper.js +29 -0
- package/admin/src/components/DraggedField/RemoveWrapper.js +32 -0
- package/admin/src/components/DraggedField/SubWrapper.js +36 -0
- package/admin/src/components/DraggedField/Wrapper.js +134 -0
- package/admin/src/components/DraggedField/index.js +196 -0
- package/admin/src/components/DraggedField/utils/getColor.js +12 -0
- package/admin/src/components/DraggedField/utils/getHeight.js +3 -0
- package/admin/src/components/DraggedFieldWithPreview/Carret.js +24 -0
- package/admin/src/components/DraggedFieldWithPreview/DynamicComponent.js +70 -0
- package/admin/src/components/DraggedFieldWithPreview/DynamicZoneWrapper.js +10 -0
- package/admin/src/components/DraggedFieldWithPreview/Tooltip.js +19 -0
- package/admin/src/components/DraggedFieldWithPreview/Wrapper.js +24 -0
- package/admin/src/components/DraggedFieldWithPreview/index.js +194 -0
- package/admin/src/components/DynamicComponentCard/Wrapper.js +63 -0
- package/admin/src/components/DynamicComponentCard/index.js +49 -0
- package/admin/src/components/DynamicZone/BaselineAlignement.js +11 -0
- package/admin/src/components/DynamicZone/Button.js +31 -0
- package/admin/src/components/DynamicZone/Component/RoundCTA.js +45 -0
- package/admin/src/components/DynamicZone/Component/index.js +79 -0
- package/admin/src/components/DynamicZone/ComponentWrapper.js +44 -0
- package/admin/src/components/DynamicZone/DynamicZoneWrapper.js +12 -0
- package/admin/src/components/DynamicZone/Label.js +42 -0
- package/admin/src/components/DynamicZone/Picker/Category/Banner/Wrapper.js +78 -0
- package/admin/src/components/DynamicZone/Picker/Category/Banner/index.js +33 -0
- package/admin/src/components/DynamicZone/Picker/Category/index.js +53 -0
- package/admin/src/components/DynamicZone/Picker/Wrapper.js +32 -0
- package/admin/src/components/DynamicZone/Picker/index.js +88 -0
- package/admin/src/components/DynamicZone/Wrapper.js +34 -0
- package/admin/src/components/DynamicZone/index.js +238 -0
- package/admin/src/components/DynamicZone/utils/connect.js +12 -0
- package/admin/src/components/DynamicZone/utils/select.js +49 -0
- package/admin/src/components/FieldComponent/ComponentIcon.js +44 -0
- package/admin/src/components/FieldComponent/EmptyComponent.js +19 -0
- package/admin/src/components/FieldComponent/Label.js +10 -0
- package/admin/src/components/FieldComponent/ResetComponent.js +41 -0
- package/admin/src/components/FieldComponent/Wrapper.js +18 -0
- package/admin/src/components/FieldComponent/index.js +171 -0
- package/admin/src/components/FieldComponent/utils/connect.js +12 -0
- package/admin/src/components/FieldComponent/utils/select.js +123 -0
- package/admin/src/components/FieldsReorder/Item.js +249 -0
- package/admin/src/components/FieldsReorder/components.js +8 -0
- package/admin/src/components/FieldsReorder/index.js +102 -0
- package/admin/src/components/FilterOptionsCTA/index.js +14 -0
- package/admin/src/components/FilterPicker/components.js +56 -0
- package/admin/src/components/FilterPicker/index.js +258 -0
- package/admin/src/components/FilterPicker/init.js +25 -0
- package/admin/src/components/FilterPicker/reducer.js +58 -0
- package/admin/src/components/FilterPickerOption/Input.js +58 -0
- package/admin/src/components/FilterPickerOption/Option.js +18 -0
- package/admin/src/components/FilterPickerOption/components.js +60 -0
- package/admin/src/components/FilterPickerOption/index.js +101 -0
- package/admin/src/components/FormTitle/index.js +26 -0
- package/admin/src/components/FormWrapper/index.js +20 -0
- package/admin/src/components/InputJSON/components.js +30 -0
- package/admin/src/components/InputJSON/index.js +184 -0
- package/admin/src/components/InputJSON/jsonlint.js +424 -0
- package/admin/src/components/InputJSONWithErrors/Wrapper.js +32 -0
- package/admin/src/components/InputJSONWithErrors/index.js +168 -0
- package/admin/src/components/InputUID/InputUID.js +26 -0
- package/admin/src/components/InputUID/Options/Option.js +22 -0
- package/admin/src/components/InputUID/Options/OptionsTitle.js +12 -0
- package/admin/src/components/InputUID/Options/RightOptionLabel.js +10 -0
- package/admin/src/components/InputUID/Options/index.js +34 -0
- package/admin/src/components/InputUID/Options/wrapper.js +13 -0
- package/admin/src/components/InputUID/RegenerateButton.js +18 -0
- package/admin/src/components/InputUID/RightContent.js +14 -0
- package/admin/src/components/InputUID/RightContentLabel.js +10 -0
- package/admin/src/components/InputUID/RightLabel.js +42 -0
- package/admin/src/components/InputUID/SubLabel.js +9 -0
- package/admin/src/components/InputUID/Wrapper.js +8 -0
- package/admin/src/components/InputUID/index.js +325 -0
- package/admin/src/components/InputUID/regex.js +3 -0
- package/admin/src/components/Inputs/index.js +283 -0
- package/admin/src/components/Inputs/utils/VALIDATIONS_TO_OMIT.js +12 -0
- package/admin/src/components/Inputs/utils/connect.js +12 -0
- package/admin/src/components/Inputs/utils/generateOptions.js +19 -0
- package/admin/src/components/Inputs/utils/getInputType.js +44 -0
- package/admin/src/components/Inputs/utils/getStep.js +15 -0
- package/admin/src/components/Inputs/utils/index.js +6 -0
- package/admin/src/components/Inputs/utils/select.js +38 -0
- package/admin/src/components/LayoutTitle/index.js +19 -0
- package/admin/src/components/MediaPreviewList/StyledMediaPreviewList.js +171 -0
- package/admin/src/components/MediaPreviewList/index.js +110 -0
- package/admin/src/components/NonRepeatableComponent/index.js +73 -0
- package/admin/src/components/NonRepeatableWrapper/index.js +73 -0
- package/admin/src/components/PlusButton/index.js +52 -0
- package/admin/src/components/PopupForm/index.js +93 -0
- package/admin/src/components/PreviewCarret/components.js +27 -0
- package/admin/src/components/PreviewCarret/index.js +22 -0
- package/admin/src/components/PreviewWysiwyg/Wrapper.js +133 -0
- package/admin/src/components/PreviewWysiwyg/index.js +34 -0
- package/admin/src/components/PreviewWysiwyg/utils/mdRenderer.js +72 -0
- package/admin/src/components/PreviewWysiwyg/utils/satinizeHtml.js +16 -0
- package/admin/src/components/RelationPreviewList/CountWrapper.js +7 -0
- package/admin/src/components/RelationPreviewList/RelationPreviewTooltip.js +117 -0
- package/admin/src/components/RelationPreviewList/index.js +111 -0
- package/admin/src/components/RepeatableComponent/AddFieldButton.js +64 -0
- package/admin/src/components/RepeatableComponent/Banner.js +112 -0
- package/admin/src/components/RepeatableComponent/BannerWrapper.js +194 -0
- package/admin/src/components/RepeatableComponent/CarretTop.js +14 -0
- package/admin/src/components/RepeatableComponent/DraggedItem/index.js +245 -0
- package/admin/src/components/RepeatableComponent/DraggedItem/utils/connect.js +11 -0
- package/admin/src/components/RepeatableComponent/DraggedItem/utils/index.js +2 -0
- package/admin/src/components/RepeatableComponent/DraggedItem/utils/select.js +30 -0
- package/admin/src/components/RepeatableComponent/EmptyComponent.js +27 -0
- package/admin/src/components/RepeatableComponent/FormWrapper.js +27 -0
- package/admin/src/components/RepeatableComponent/index.js +187 -0
- package/admin/src/components/RepeatableComponent/reducer.js +73 -0
- package/admin/src/components/RepeatableComponent/utils/connect.js +11 -0
- package/admin/src/components/RepeatableComponent/utils/select.js +12 -0
- package/admin/src/components/Search/index.js +88 -0
- package/admin/src/components/SectionTitle/Title.js +11 -0
- package/admin/src/components/SectionTitle/index.js +29 -0
- package/admin/src/components/SelectMany/ListItem.js +107 -0
- package/admin/src/components/SelectMany/Relation.js +106 -0
- package/admin/src/components/SelectMany/components.js +153 -0
- package/admin/src/components/SelectMany/index.js +159 -0
- package/admin/src/components/SelectOne/SingleValue.js +58 -0
- package/admin/src/components/SelectOne/index.js +71 -0
- package/admin/src/components/SelectWrapper/ClearIndicator.js +15 -0
- package/admin/src/components/SelectWrapper/IndicatorSeparator.js +3 -0
- package/admin/src/components/SelectWrapper/Option.js +76 -0
- package/admin/src/components/SelectWrapper/components.js +14 -0
- package/admin/src/components/SelectWrapper/index.js +393 -0
- package/admin/src/components/SelectWrapper/utils/connect.js +12 -0
- package/admin/src/components/SelectWrapper/utils/index.js +3 -0
- package/admin/src/components/SelectWrapper/utils/select.js +45 -0
- package/admin/src/components/SelectWrapper/utils/styles.js +105 -0
- package/admin/src/components/Separator/index.js +9 -0
- package/admin/src/components/SettingFormWrapper/index.js +9 -0
- package/admin/src/components/SettingsViewWrapper/index.js +283 -0
- package/admin/src/components/SortWrapper/index.js +9 -0
- package/admin/src/components/SortableList/Item.js +126 -0
- package/admin/src/components/SortableList/index.js +60 -0
- package/admin/src/components/State/Wrapper.js +30 -0
- package/admin/src/components/State/index.js +26 -0
- package/admin/src/components/Truncate/index.js +5 -0
- package/admin/src/components/Truncated/index.js +10 -0
- package/admin/src/components/Wysiwyg/EditorWrapper.js +122 -0
- package/admin/src/components/Wysiwyg/MediaLib.js +71 -0
- package/admin/src/components/Wysiwyg/PreviewControlWrapper.js +30 -0
- package/admin/src/components/Wysiwyg/SelectWrapper.js +24 -0
- package/admin/src/components/Wysiwyg/ToggleModeWrapper.js +30 -0
- package/admin/src/components/Wysiwyg/constants.js +98 -0
- package/admin/src/components/Wysiwyg/customSelect.js +39 -0
- package/admin/src/components/Wysiwyg/helpers.js +116 -0
- package/admin/src/components/Wysiwyg/index.js +819 -0
- package/admin/src/components/Wysiwyg/previewControl.js +29 -0
- package/admin/src/components/Wysiwyg/toggleMode.js +44 -0
- package/admin/src/components/Wysiwyg/utils.js +70 -0
- package/admin/src/components/WysiwygBottomControls/components.js +44 -0
- package/admin/src/components/WysiwygBottomControls/index.js +33 -0
- package/admin/src/components/WysiwygDropUpload/Label.js +16 -0
- package/admin/src/components/WysiwygDropUpload/index.js +18 -0
- package/admin/src/components/WysiwygEditor/index.js +26 -0
- package/admin/src/components/WysiwygInlineControls/Button.js +77 -0
- package/admin/src/components/WysiwygInlineControls/StyledButton.js +54 -0
- package/admin/src/components/WysiwygInlineControls/Wrapper.js +25 -0
- package/admin/src/components/WysiwygInlineControls/index.js +66 -0
- package/admin/src/components/WysiwygWithErrors/Wrapper.js +38 -0
- package/admin/src/components/WysiwygWithErrors/index.js +158 -0
- package/admin/src/containers/CollectionTypeFormWrapper/index.js +376 -0
- package/admin/src/containers/CollectionTypeFormWrapper/utils/getRequestUrl.js +5 -0
- package/admin/src/containers/CollectionTypeFormWrapper/utils/index.js +2 -0
- package/admin/src/containers/CollectionTypeRecursivePath/index.js +125 -0
- package/admin/src/containers/ComponentSetttingsView/index.js +55 -0
- package/admin/src/containers/EditSettingsView/index.js +408 -0
- package/admin/src/containers/EditSettingsView/init.js +18 -0
- package/admin/src/containers/EditSettingsView/reducer.js +126 -0
- package/admin/src/containers/EditSettingsView/utils/createPossibleMainFieldsForModelsAndComponents.js +26 -0
- package/admin/src/containers/EditSettingsView/utils/getInputProps.js +30 -0
- package/admin/src/containers/EditSettingsView/utils/index.js +2 -0
- package/admin/src/containers/EditSettingsView/utils/layout.js +98 -0
- package/admin/src/containers/EditView/DeleteLink/index.js +94 -0
- package/admin/src/containers/EditView/DeleteLink/utils/connect.js +12 -0
- package/admin/src/containers/EditView/DeleteLink/utils/index.js +2 -0
- package/admin/src/containers/EditView/DeleteLink/utils/select.js +21 -0
- package/admin/src/containers/EditView/Header/index.js +258 -0
- package/admin/src/containers/EditView/Header/utils/connect.js +12 -0
- package/admin/src/containers/EditView/Header/utils/getDraftRelations.js +62 -0
- package/admin/src/containers/EditView/Header/utils/index.js +3 -0
- package/admin/src/containers/EditView/Header/utils/select.js +31 -0
- package/admin/src/containers/EditView/InformationCard.js +100 -0
- package/admin/src/containers/EditView/components.js +74 -0
- package/admin/src/containers/EditView/index.js +297 -0
- package/admin/src/containers/EditView/utils/createAttributesLayout.js +39 -0
- package/admin/src/containers/EditView/utils/getFieldsActionMatchingPermissions.js +23 -0
- package/admin/src/containers/EditView/utils/index.js +3 -0
- package/admin/src/containers/EditViewDataManagerProvider/index.js +519 -0
- package/admin/src/containers/EditViewDataManagerProvider/reducer.js +218 -0
- package/admin/src/containers/EditViewDataManagerProvider/utils/cleanData.js +88 -0
- package/admin/src/containers/EditViewDataManagerProvider/utils/getYupInnerErrors.js +17 -0
- package/admin/src/containers/EditViewDataManagerProvider/utils/index.js +3 -0
- package/admin/src/containers/EditViewDataManagerProvider/utils/schema.js +368 -0
- package/admin/src/containers/EditViewLayoutManager/Permissions.js +30 -0
- package/admin/src/containers/EditViewLayoutManager/actions.js +9 -0
- package/admin/src/containers/EditViewLayoutManager/constants.js +2 -0
- package/admin/src/containers/EditViewLayoutManager/index.js +44 -0
- package/admin/src/containers/EditViewLayoutManager/reducer.js +30 -0
- package/admin/src/containers/EditViewLayoutManager/selectors.js +5 -0
- package/admin/src/containers/LayoutDndProvider/index.js +75 -0
- package/admin/src/containers/ListSettingsView/DragWrapper.js +21 -0
- package/admin/src/containers/ListSettingsView/DropdownButton.js +8 -0
- package/admin/src/containers/ListSettingsView/Label.js +91 -0
- package/admin/src/containers/ListSettingsView/MenuDropdown.js +41 -0
- package/admin/src/containers/ListSettingsView/Toggle.js +51 -0
- package/admin/src/containers/ListSettingsView/forms.json +64 -0
- package/admin/src/containers/ListSettingsView/index.js +298 -0
- package/admin/src/containers/ListSettingsView/init.js +11 -0
- package/admin/src/containers/ListSettingsView/reducer.js +77 -0
- package/admin/src/containers/ListView/FieldPicker/ConfigureLink/StyledLink.js +28 -0
- package/admin/src/containers/ListView/FieldPicker/ConfigureLink/Wrapper.js +8 -0
- package/admin/src/containers/ListView/FieldPicker/ConfigureLink/index.js +29 -0
- package/admin/src/containers/ListView/FieldPicker/Field/Wrapper.js +15 -0
- package/admin/src/containers/ListView/FieldPicker/Field/index.js +24 -0
- package/admin/src/containers/ListView/FieldPicker/Fields/Wrapper.js +18 -0
- package/admin/src/containers/ListView/FieldPicker/Fields/index.js +27 -0
- package/admin/src/containers/ListView/FieldPicker/Header/Reset.js +8 -0
- package/admin/src/containers/ListView/FieldPicker/Header/index.js +42 -0
- package/admin/src/containers/ListView/FieldPicker/Wrapper.js +9 -0
- package/admin/src/containers/ListView/FieldPicker/index.js +46 -0
- package/admin/src/containers/ListView/Filter.js +83 -0
- package/admin/src/containers/ListView/Footer.js +60 -0
- package/admin/src/containers/ListView/actions.js +91 -0
- package/admin/src/containers/ListView/components.js +138 -0
- package/admin/src/containers/ListView/constants.js +16 -0
- package/admin/src/containers/ListView/index.js +573 -0
- package/admin/src/containers/ListView/reducer.js +182 -0
- package/admin/src/containers/ListView/selectors.js +24 -0
- package/admin/src/containers/ListView/utils/buildQueryString.js +26 -0
- package/admin/src/containers/ListView/utils/createPluginsFilter.js +13 -0
- package/admin/src/containers/ListView/utils/getAllAllowedHeaders.js +17 -0
- package/admin/src/containers/ListView/utils/getFirstSortableHeader.js +14 -0
- package/admin/src/containers/ListView/utils/index.js +3 -0
- package/admin/src/containers/ListViewLayoutManager/Permissions.js +29 -0
- package/admin/src/containers/ListViewLayoutManager/index.js +60 -0
- package/admin/src/containers/ListViewProvider/index.js +16 -0
- package/admin/src/containers/Main/actions.js +13 -0
- package/admin/src/containers/Main/constants.js +3 -0
- package/admin/src/containers/Main/index.js +100 -0
- package/admin/src/containers/Main/reducer.js +37 -0
- package/admin/src/containers/Main/selectors.js +20 -0
- package/admin/src/containers/RBACManager/actions.js +14 -0
- package/admin/src/containers/RBACManager/constants.js +2 -0
- package/admin/src/containers/RBACManager/reducer.js +32 -0
- package/admin/src/containers/RBACManager/useSyncRbac.js +28 -0
- package/admin/src/containers/SingleTypeFormWrapper/index.js +317 -0
- package/admin/src/containers/SingleTypeFormWrapper/utils/getRequestUrl.js +5 -0
- package/admin/src/containers/SingleTypeFormWrapper/utils/index.js +2 -0
- package/admin/src/containers/SingleTypeRecursivePath/index.js +84 -0
- package/admin/src/containers/WysiwygProvider/index.js +16 -0
- package/admin/src/contexts/ContentTypeLayout.js +5 -0
- package/admin/src/contexts/LayoutDnd.js +5 -0
- package/admin/src/contexts/ListView.js +5 -0
- package/admin/src/contexts/Wysiwyg.js +5 -0
- package/admin/src/contexts/index.js +4 -0
- package/admin/src/hooks/index.js +6 -0
- package/admin/src/hooks/useContentTypeLayout/index.js +19 -0
- package/admin/src/hooks/useFetchContentTypeLayout/index.js +83 -0
- package/admin/src/hooks/useFetchContentTypeLayout/reducer.js +56 -0
- package/admin/src/hooks/useFetchContentTypeLayout/utils/formatLayouts.js +235 -0
- package/admin/src/hooks/useFindRedirectionLink/index.js +14 -0
- package/admin/src/hooks/useFindRedirectionLink/selectors.js +7 -0
- package/admin/src/hooks/useFindRedirectionLink/utils/getRedirectionLink.js +45 -0
- package/admin/src/hooks/useLayoutDnd.js +6 -0
- package/admin/src/hooks/useListView.js +6 -0
- package/admin/src/hooks/useWysiwyg.js +6 -0
- package/admin/src/icons/Bold/index.js +22 -0
- package/admin/src/icons/Code/index.js +13 -0
- package/admin/src/icons/Cross/index.js +33 -0
- package/admin/src/icons/Italic/index.js +23 -0
- package/admin/src/icons/Link/index.js +21 -0
- package/admin/src/icons/Media/index.js +14 -0
- package/admin/src/icons/Na/index.js +58 -0
- package/admin/src/icons/Ol/index.js +13 -0
- package/admin/src/icons/Quote/index.js +13 -0
- package/admin/src/icons/Striked/index.js +24 -0
- package/admin/src/icons/Ul/index.js +15 -0
- package/admin/src/icons/Underline/index.js +22 -0
- package/admin/src/index.js +52 -0
- package/admin/src/lifecycles.js +19 -0
- package/admin/src/permissions.js +27 -0
- package/admin/src/pluginId.js +5 -0
- package/admin/src/reducers.js +16 -0
- package/admin/src/selectors.js +6 -0
- package/admin/src/sharedReducers/crudReducer/actions.js +44 -0
- package/admin/src/sharedReducers/crudReducer/constants.js +7 -0
- package/admin/src/sharedReducers/crudReducer/reducer.js +75 -0
- package/admin/src/sharedReducers/crudReducer/selectors.js +5 -0
- package/admin/src/testUtils/data.js +305 -0
- package/admin/src/testUtils/index.js +4 -0
- package/admin/src/translations/ar.json +94 -0
- package/admin/src/translations/cs.json +130 -0
- package/admin/src/translations/de.json +177 -0
- package/admin/src/translations/dk.json +180 -0
- package/admin/src/translations/en.json +177 -0
- package/admin/src/translations/es.json +177 -0
- package/admin/src/translations/fr.json +162 -0
- package/admin/src/translations/id.json +175 -0
- package/admin/src/translations/index.js +53 -0
- package/admin/src/translations/it.json +177 -0
- package/admin/src/translations/ja.json +94 -0
- package/admin/src/translations/ko.json +110 -0
- package/admin/src/translations/ms.json +148 -0
- package/admin/src/translations/nl.json +94 -0
- package/admin/src/translations/pl.json +142 -0
- package/admin/src/translations/pt-BR.json +94 -0
- package/admin/src/translations/pt.json +94 -0
- package/admin/src/translations/ru.json +177 -0
- package/admin/src/translations/sk.json +172 -0
- package/admin/src/translations/th.json +155 -0
- package/admin/src/translations/tr.json +177 -0
- package/admin/src/translations/uk.json +148 -0
- package/admin/src/translations/vi.json +110 -0
- package/admin/src/translations/zh-Hans.json +177 -0
- package/admin/src/translations/zh.json +94 -0
- package/admin/src/utils/ItemTypes.js +7 -0
- package/admin/src/utils/checkIfAttributeIsDisplayable.js +13 -0
- package/admin/src/utils/createDefaultForm.js +50 -0
- package/admin/src/utils/dateFormats.js +18 -0
- package/admin/src/utils/formatFiltersFromQuery.js +55 -0
- package/admin/src/utils/formatFiltersToQuery.js +27 -0
- package/admin/src/utils/formatLayoutToApi.js +44 -0
- package/admin/src/utils/generatePermissionsObject.js +20 -0
- package/admin/src/utils/getComponents.js +50 -0
- package/admin/src/utils/getDisplayedValue.js +61 -0
- package/admin/src/utils/getFieldName.js +6 -0
- package/admin/src/utils/getMaxTempKey.js +12 -0
- package/admin/src/utils/getRequestUrl.js +5 -0
- package/admin/src/utils/getTrad.js +5 -0
- package/admin/src/utils/index.js +17 -0
- package/admin/src/utils/mergeMetasWithSchema.js +20 -0
- package/admin/src/utils/removeKeyInObject.js +45 -0
- package/admin/src/utils/removePasswordFieldsFromData.js +54 -0
- package/config/admin.json +5 -0
- package/config/functions/bootstrap.js +9 -0
- package/config/policies/has-draft-and-publish.js +19 -0
- package/config/policies/hasPermissions.js +34 -0
- package/config/policies/routing.js +27 -0
- package/config/routes.json +275 -0
- package/controllers/collection-types.js +282 -0
- package/controllers/components.js +66 -0
- package/controllers/content-types.js +112 -0
- package/controllers/relations.js +63 -0
- package/controllers/single-types.js +170 -0
- package/controllers/uid.js +41 -0
- package/controllers/validation/index.js +104 -0
- package/controllers/validation/model-configuration.js +114 -0
- package/oas.yml +757 -0
- package/package.json +77 -0
- package/services/components.js +92 -0
- package/services/configuration.js +79 -0
- package/services/content-types.js +73 -0
- package/services/data-mapper.js +98 -0
- package/services/entity-manager.js +140 -0
- package/services/metrics.js +34 -0
- package/services/permission-checker.js +69 -0
- package/services/permission.js +95 -0
- package/services/uid.js +63 -0
- package/services/utils/configuration/attributes.js +175 -0
- package/services/utils/configuration/index.js +43 -0
- package/services/utils/configuration/layouts.js +185 -0
- package/services/utils/configuration/metadatas.js +142 -0
- package/services/utils/configuration/settings.js +52 -0
- package/services/utils/store.js +93 -0
- package/utils/index.js +16 -0
- package/utils/pick-writable-attributes.js +6 -0
- package/utils/wrap-bad-request.js +15 -0
- package/validation/policies/hasPermissions.js +17 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright (c) 2015-present Strapi Solutions SAS
|
|
2
|
+
|
|
3
|
+
Portions of the Strapi software are licensed as follows:
|
|
4
|
+
|
|
5
|
+
* All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined in "ee/LICENSE".
|
|
6
|
+
|
|
7
|
+
* All software outside of the above-mentioned directories or restrictions above is available under the "MIT Expat" license as set forth below.
|
|
8
|
+
|
|
9
|
+
MIT Expat License
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Strapi Content Manager
|
|
2
|
+
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
## Deprecation Warning :warning:
|
|
6
|
+
|
|
7
|
+
Hello! We have some news to share,
|
|
8
|
+
|
|
9
|
+
We’ve decided it’ll soon be time to end the support for `strapi-plugin-content-manager`.
|
|
10
|
+
|
|
11
|
+
After years of iterations, Strapi is going to V4 and we won’t maintain V3 packages when it’ll reach its end-of-support milestone (~end of Q3 2022).
|
|
12
|
+
|
|
13
|
+
If you’ve been using `strapi-plugin-content-manager` and have migrated to V4 (or if you want to), you can find the equivalent and updated version of this package at this [URL](https://github.com/strapi/strapi/tree/master/packages/core/content-manager) and with the following name on NPM: `@strapi/plugin-content-manager`.
|
|
14
|
+
|
|
15
|
+
If you’ve contributed to the development of this package, thank you again for that! We hope to see you on the V4 soon.
|
|
16
|
+
|
|
17
|
+
The Akemona team
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Description
|
|
22
|
+
|
|
23
|
+
This plugin allows you to manage your data through a UI.
|
|
24
|
+
|
|
25
|
+
## Changing the plugin logo
|
|
26
|
+
|
|
27
|
+
The plugin's logo is located in `./admin/src/assets/logo.svg` it is displayed in the marketplace (`/admin/list-plugins`)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { LayoutIcon, CheckPermissions } from 'strapi-helper-plugin';
|
|
5
|
+
import { Button as Base } from '@buffetjs/core';
|
|
6
|
+
import { useHistory } from 'react-router-dom';
|
|
7
|
+
import { useIntl } from 'react-intl';
|
|
8
|
+
import pluginPermissions from '../../../permissions';
|
|
9
|
+
import pluginId from '../../../pluginId';
|
|
10
|
+
|
|
11
|
+
const StyledButton = styled(Base)`
|
|
12
|
+
padding-left: 15px;
|
|
13
|
+
padding-right: 15px;
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
const Button = ({ isTemporary, isInContentTypeView, contentTypeKind, targetUid }) => {
|
|
17
|
+
const { formatMessage } = useIntl();
|
|
18
|
+
const { push } = useHistory();
|
|
19
|
+
const {
|
|
20
|
+
collectionTypesConfigurations,
|
|
21
|
+
componentsConfigurations,
|
|
22
|
+
singleTypesConfigurations,
|
|
23
|
+
} = pluginPermissions;
|
|
24
|
+
const icon = <LayoutIcon className="colored" fill={isTemporary ? '#B4B6BA' : '#007eff'} />;
|
|
25
|
+
const label = formatMessage({ id: 'content-type-builder.form.button.configure-view' });
|
|
26
|
+
let permissionsToApply = collectionTypesConfigurations;
|
|
27
|
+
|
|
28
|
+
const handleClick = () => {
|
|
29
|
+
if (isTemporary) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (isInContentTypeView) {
|
|
34
|
+
push(`/plugins/${pluginId}/collectionType/${targetUid}/configurations/edit`);
|
|
35
|
+
} else {
|
|
36
|
+
push(`/plugins/${pluginId}/components/${targetUid}/configurations/edit`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return false;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
if (isInContentTypeView && contentTypeKind === 'singleType') {
|
|
43
|
+
permissionsToApply = singleTypesConfigurations;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (!isInContentTypeView) {
|
|
47
|
+
permissionsToApply = componentsConfigurations;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<CheckPermissions permissions={permissionsToApply}>
|
|
52
|
+
<StyledButton
|
|
53
|
+
icon={icon}
|
|
54
|
+
label={label}
|
|
55
|
+
color="secondary"
|
|
56
|
+
onClick={handleClick}
|
|
57
|
+
style={{ marginTop: '2px' }}
|
|
58
|
+
disabled={isTemporary}
|
|
59
|
+
/>
|
|
60
|
+
</CheckPermissions>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
Button.defaultProps = {
|
|
65
|
+
contentTypeKind: 'collectionType',
|
|
66
|
+
isInContentTypeView: true,
|
|
67
|
+
isTemporary: false,
|
|
68
|
+
targetUid: '',
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
Button.propTypes = {
|
|
72
|
+
contentTypeKind: PropTypes.string,
|
|
73
|
+
isInContentTypeView: PropTypes.bool,
|
|
74
|
+
isTemporary: PropTypes.bool,
|
|
75
|
+
targetUid: PropTypes.string,
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default memo(Button);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="23" height="32" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M.018 0h20a2 2 0 012 2v28a2 2 0 01-2 2h-20V0z" fill="#FAFAFB"/><g fill-rule="nonzero" fill="#B3B5B9"><path d="M14.018 18.375a.36.36 0 01-.112.264l-2.625 2.625a.36.36 0 01-.263.111.36.36 0 01-.264-.111l-2.625-2.625a.36.36 0 01-.111-.264.36.36 0 01.111-.264.36.36 0 01.264-.111h5.25a.36.36 0 01.263.111.36.36 0 01.112.264zM8.018 15a.36.36 0 01.111-.264l2.625-2.625a.36.36 0 01.264-.111.36.36 0 01.263.111l2.625 2.625a.36.36 0 01.112.264.36.36 0 01-.112.264.36.36 0 01-.263.111h-5.25a.36.36 0 01-.264-.111.36.36 0 01-.111-.264z"/></g></g></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="8" height="8" xmlns="http://www.w3.org/2000/svg"><path d="M7.78 6.72L5.06 4l2.72-2.72a.748.748 0 0 0 0-1.06.748.748 0 0 0-1.06 0L4 2.94 1.28.22a.748.748 0 0 0-1.06 0 .748.748 0 0 0 0 1.06L2.94 4 .22 6.72a.748.748 0 0 0 0 1.06.748.748 0 0 0 1.06 0L4 5.06l2.72 2.72a.748.748 0 0 0 1.06 0 .752.752 0 0 0 0-1.06z" fill="#007EFF" fill-rule="evenodd"/></svg>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="20px" height="20px" viewBox="0 0 20 20" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<!-- Generator: Sketch 49.3 (51167) - http://www.bohemiancoding.com/sketch -->
|
|
4
|
+
<title>Icon remove</title>
|
|
5
|
+
<desc>Created with Sketch.</desc>
|
|
6
|
+
<defs></defs>
|
|
7
|
+
<g id="Pages" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
8
|
+
<g id="Content-Manager---List-view" transform="translate(-279.000000, -165.000000)">
|
|
9
|
+
<g id="Container" transform="translate(234.000000, 0.000000)">
|
|
10
|
+
<g id="Add-filters" transform="translate(0.000000, 60.000000)">
|
|
11
|
+
<g id="Icon-remove" transform="translate(45.000000, 105.000000)">
|
|
12
|
+
<rect id="Rectangle-12" stroke="#E3E9F3" x="0.5" y="0.5" width="19" height="19" rx="9.5"></rect>
|
|
13
|
+
<path d="M6,10 L14,10" id="Line-4" stroke="#007EFF" stroke-width="2" stroke-linecap="round"></path>
|
|
14
|
+
</g>
|
|
15
|
+
</g>
|
|
16
|
+
</g>
|
|
17
|
+
</g>
|
|
18
|
+
</g>
|
|
19
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="30" height="24" xmlns="http://www.w3.org/2000/svg"><text transform="translate(-20 -6)" fill="#4B515A" fill-rule="evenodd" font-size="30" font-family="AppleColorEmoji, Apple Color Emoji"><tspan x="20" y="31">📖</tspan></text></svg>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
const Wrapper = styled.div`
|
|
5
|
+
margin-left: 29px;
|
|
6
|
+
> div {
|
|
7
|
+
height: 30px;
|
|
8
|
+
width: 100%;
|
|
9
|
+
justify-content: space-between;
|
|
10
|
+
background: #ffffff;
|
|
11
|
+
color: #333740;
|
|
12
|
+
border-radius: 2px;
|
|
13
|
+
border: solid 1px #007eff;
|
|
14
|
+
|
|
15
|
+
> button {
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
padding-left: 10px !important;
|
|
18
|
+
line-height: 30px;
|
|
19
|
+
width: 100%;
|
|
20
|
+
color: #333740;
|
|
21
|
+
text-align: left;
|
|
22
|
+
background-color: #ffffff;
|
|
23
|
+
border: none;
|
|
24
|
+
font-size: 13px;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
&:focus,
|
|
27
|
+
&:active,
|
|
28
|
+
&:hover,
|
|
29
|
+
&:visited {
|
|
30
|
+
background-color: transparent !important;
|
|
31
|
+
box-shadow: none;
|
|
32
|
+
color: #333740;
|
|
33
|
+
}
|
|
34
|
+
> p {
|
|
35
|
+
position: relative;
|
|
36
|
+
height: 100%;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
text-overflow: ellipsis;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
text-align: center;
|
|
41
|
+
margin-bottom: 0;
|
|
42
|
+
margin-top: -1px;
|
|
43
|
+
color: #007eff !important;
|
|
44
|
+
font-size: 13px !important;
|
|
45
|
+
svg {
|
|
46
|
+
fill: #007eff;
|
|
47
|
+
margin-right: 7px;
|
|
48
|
+
vertical-align: initial;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
> div {
|
|
53
|
+
max-height: 180px;
|
|
54
|
+
min-width: calc(100% + 2px);
|
|
55
|
+
margin-left: -1px;
|
|
56
|
+
margin-top: -1px;
|
|
57
|
+
padding: 0;
|
|
58
|
+
border-top-left-radius: 0 !important;
|
|
59
|
+
border-top-right-radius: 0;
|
|
60
|
+
border-color: #e3e9f3 !important;
|
|
61
|
+
border-top-color: #aed4fb !important;
|
|
62
|
+
box-shadow: 0 2px 3px rgba(227, 233, 245, 0.5);
|
|
63
|
+
|
|
64
|
+
overflow: scroll;
|
|
65
|
+
|
|
66
|
+
button {
|
|
67
|
+
height: 30px;
|
|
68
|
+
padding-left: 10px !important;
|
|
69
|
+
line-height: 26px;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
font-size: 13px !important;
|
|
72
|
+
&:focus,
|
|
73
|
+
&:active,
|
|
74
|
+
&:hover {
|
|
75
|
+
background-color: #fafafb !important;
|
|
76
|
+
color: #333740;
|
|
77
|
+
outline: 0;
|
|
78
|
+
}
|
|
79
|
+
div {
|
|
80
|
+
margin: 0;
|
|
81
|
+
white-space: nowrap;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
text-overflow: ellipsis;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
${({ isOpen }) => {
|
|
90
|
+
if (isOpen) {
|
|
91
|
+
return css`
|
|
92
|
+
> div {
|
|
93
|
+
background-color: #e6f0fb !important;
|
|
94
|
+
border-color: #aed4fb !important;
|
|
95
|
+
}
|
|
96
|
+
`;
|
|
97
|
+
}
|
|
98
|
+
}}
|
|
99
|
+
|
|
100
|
+
${({ notAllowed }) => {
|
|
101
|
+
if (notAllowed) {
|
|
102
|
+
return css`
|
|
103
|
+
> div {
|
|
104
|
+
> button {
|
|
105
|
+
cursor: not-allowed !important;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
`;
|
|
109
|
+
}
|
|
110
|
+
}}
|
|
111
|
+
`;
|
|
112
|
+
|
|
113
|
+
export { Wrapper };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React, { memo, useState } from 'react';
|
|
2
|
+
import { FormattedMessage } from 'react-intl';
|
|
3
|
+
import PropTypes from 'prop-types';
|
|
4
|
+
import { Plus } from '@buffetjs/icons';
|
|
5
|
+
import {
|
|
6
|
+
ButtonDropdown,
|
|
7
|
+
DropdownToggle,
|
|
8
|
+
DropdownMenu,
|
|
9
|
+
DropdownItem,
|
|
10
|
+
} from 'reactstrap';
|
|
11
|
+
import getTrad from '../../utils/getTrad';
|
|
12
|
+
import { Wrapper } from './components';
|
|
13
|
+
|
|
14
|
+
function Add({ data, isRelation, onClick, pStyle, style }) {
|
|
15
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Wrapper isOpen={isOpen} notAllowed={data.length === 0} style={style}>
|
|
19
|
+
<ButtonDropdown
|
|
20
|
+
isOpen={isOpen}
|
|
21
|
+
toggle={() => {
|
|
22
|
+
if (data.length > 0) {
|
|
23
|
+
setIsOpen(prevState => !prevState);
|
|
24
|
+
}
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
27
|
+
<DropdownToggle>
|
|
28
|
+
<FormattedMessage
|
|
29
|
+
id={getTrad(
|
|
30
|
+
`containers.SettingPage.${
|
|
31
|
+
isRelation ? 'add.relational-field' : 'add.field'
|
|
32
|
+
}`
|
|
33
|
+
)}
|
|
34
|
+
>
|
|
35
|
+
{msg => (
|
|
36
|
+
<p style={pStyle}>
|
|
37
|
+
<Plus fill="#007eff" height="11px" width="11px" />
|
|
38
|
+
{msg}
|
|
39
|
+
</p>
|
|
40
|
+
)}
|
|
41
|
+
</FormattedMessage>
|
|
42
|
+
</DropdownToggle>
|
|
43
|
+
<DropdownMenu>
|
|
44
|
+
{data.map(item => (
|
|
45
|
+
<DropdownItem
|
|
46
|
+
key={item}
|
|
47
|
+
onClick={() => {
|
|
48
|
+
onClick(item);
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{item}
|
|
52
|
+
</DropdownItem>
|
|
53
|
+
))}
|
|
54
|
+
</DropdownMenu>
|
|
55
|
+
</ButtonDropdown>
|
|
56
|
+
</Wrapper>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
Add.defaultProps = {
|
|
61
|
+
data: [],
|
|
62
|
+
isRelation: false,
|
|
63
|
+
onClick: () => {},
|
|
64
|
+
pStyle: {},
|
|
65
|
+
style: {},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
Add.propTypes = {
|
|
69
|
+
data: PropTypes.array,
|
|
70
|
+
isRelation: PropTypes.bool,
|
|
71
|
+
onClick: PropTypes.func,
|
|
72
|
+
pStyle: PropTypes.object,
|
|
73
|
+
style: PropTypes.object,
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export default memo(Add);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
const Wrapper = styled.div`
|
|
4
|
+
margin-bottom: 35px;
|
|
5
|
+
background: #ffffff;
|
|
6
|
+
padding: 22px 28px 18px;
|
|
7
|
+
padding-bottom: 13px;
|
|
8
|
+
border-radius: 2px;
|
|
9
|
+
box-shadow: 0 2px 4px #e3e9f3;
|
|
10
|
+
-webkit-font-smoothing: antialiased;
|
|
11
|
+
`;
|
|
12
|
+
|
|
13
|
+
const Sub = styled.div`
|
|
14
|
+
padding-top: 0px;
|
|
15
|
+
line-height: 18px;
|
|
16
|
+
> p:first-child {
|
|
17
|
+
margin-bottom: 1px;
|
|
18
|
+
font-weight: 700;
|
|
19
|
+
color: #333740;
|
|
20
|
+
font-size: 1.8rem;
|
|
21
|
+
}
|
|
22
|
+
> p {
|
|
23
|
+
color: #787e8f;
|
|
24
|
+
font-size: 13px;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
|
|
28
|
+
export { Wrapper, Sub };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Block
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React, { memo } from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { FormattedMessage } from 'react-intl';
|
|
9
|
+
import { Wrapper, Sub } from './components';
|
|
10
|
+
|
|
11
|
+
const renderMsg = msg => <p>{msg}</p>;
|
|
12
|
+
|
|
13
|
+
const Block = ({ children, description, style, title }) => (
|
|
14
|
+
<div className="col-md-12">
|
|
15
|
+
<Wrapper style={style}>
|
|
16
|
+
<Sub>
|
|
17
|
+
{!!title && (
|
|
18
|
+
<p>
|
|
19
|
+
<FormattedMessage id={title} />
|
|
20
|
+
</p>
|
|
21
|
+
)}
|
|
22
|
+
{!!description && (
|
|
23
|
+
<FormattedMessage id={description}>{renderMsg}</FormattedMessage>
|
|
24
|
+
)}
|
|
25
|
+
</Sub>
|
|
26
|
+
{children}
|
|
27
|
+
</Wrapper>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
Block.defaultProps = {
|
|
32
|
+
children: null,
|
|
33
|
+
description: null,
|
|
34
|
+
style: {},
|
|
35
|
+
title: null,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
Block.propTypes = {
|
|
39
|
+
children: PropTypes.any,
|
|
40
|
+
description: PropTypes.string,
|
|
41
|
+
style: PropTypes.object,
|
|
42
|
+
title: PropTypes.string,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default memo(Block);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { FormattedMessage } from 'react-intl';
|
|
4
|
+
import { useContentManagerEditViewDataManager } from 'strapi-helper-plugin';
|
|
5
|
+
import pluginId from '../../pluginId';
|
|
6
|
+
|
|
7
|
+
import NonRepeatableWrapper from '../NonRepeatableWrapper';
|
|
8
|
+
import PlusButton from '../PlusButton';
|
|
9
|
+
import P from './P';
|
|
10
|
+
|
|
11
|
+
const ComponentInitializer = ({ componentUid, isReadOnly, name }) => {
|
|
12
|
+
const { addNonRepeatableComponentToField } = useContentManagerEditViewDataManager();
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<NonRepeatableWrapper
|
|
16
|
+
isEmpty
|
|
17
|
+
isReadOnly={isReadOnly}
|
|
18
|
+
onClick={() => {
|
|
19
|
+
if (!isReadOnly) {
|
|
20
|
+
addNonRepeatableComponentToField(name, componentUid);
|
|
21
|
+
}
|
|
22
|
+
}}
|
|
23
|
+
>
|
|
24
|
+
<PlusButton type="button" />
|
|
25
|
+
<FormattedMessage id={`${pluginId}.components.empty-repeatable`}>
|
|
26
|
+
{msg => <P style={{ paddingTop: 78 }}>{msg}</P>}
|
|
27
|
+
</FormattedMessage>
|
|
28
|
+
</NonRepeatableWrapper>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
ComponentInitializer.defaultProps = {
|
|
33
|
+
isReadOnly: false,
|
|
34
|
+
name: '',
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
ComponentInitializer.propTypes = {
|
|
38
|
+
componentUid: PropTypes.string.isRequired,
|
|
39
|
+
isReadOnly: PropTypes.bool,
|
|
40
|
+
name: PropTypes.string,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export default ComponentInitializer;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
const Label = styled.label`
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
position: relative;
|
|
7
|
+
vertical-align: middle;
|
|
8
|
+
> input {
|
|
9
|
+
display: none;
|
|
10
|
+
}
|
|
11
|
+
&:before {
|
|
12
|
+
content: '';
|
|
13
|
+
position: absolute;
|
|
14
|
+
left: 15px;
|
|
15
|
+
top: calc(50% - 8px);
|
|
16
|
+
width: 14px;
|
|
17
|
+
height: 14px;
|
|
18
|
+
border: 1px solid rgba(16, 22, 34, 0.15);
|
|
19
|
+
background-color: #fdfdfd;
|
|
20
|
+
border-radius: 3px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
${({ shouldDisplaySomeChecked }) => {
|
|
24
|
+
if (shouldDisplaySomeChecked) {
|
|
25
|
+
return css`
|
|
26
|
+
&:after {
|
|
27
|
+
content: '\f068';
|
|
28
|
+
position: absolute;
|
|
29
|
+
top: calc(50% - 8px);
|
|
30
|
+
left: 18px;
|
|
31
|
+
font-size: 10px;
|
|
32
|
+
font-family: 'FontAwesome';
|
|
33
|
+
font-weight: 100;
|
|
34
|
+
color: #1c5de7;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
}
|
|
38
|
+
}}
|
|
39
|
+
|
|
40
|
+
${({ shouldDisplayAllChecked }) => {
|
|
41
|
+
if (shouldDisplayAllChecked) {
|
|
42
|
+
return css`
|
|
43
|
+
&:after {
|
|
44
|
+
content: '\f00c';
|
|
45
|
+
position: absolute;
|
|
46
|
+
top: calc(50% - 9px);
|
|
47
|
+
left: 17px;
|
|
48
|
+
font-size: 10px;
|
|
49
|
+
font-family: 'FontAwesome';
|
|
50
|
+
font-weight: 100;
|
|
51
|
+
color: #1c5de7;
|
|
52
|
+
transition: all 0.2s;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
}}
|
|
57
|
+
|
|
58
|
+
${({ isChecked }) => {
|
|
59
|
+
if (isChecked) {
|
|
60
|
+
return css`
|
|
61
|
+
&:after {
|
|
62
|
+
content: '\f00c';
|
|
63
|
+
position: absolute;
|
|
64
|
+
top: calc(50% - 11px);
|
|
65
|
+
left: 17px;
|
|
66
|
+
font-size: 10px;
|
|
67
|
+
font-family: 'FontAwesome';
|
|
68
|
+
font-weight: 100;
|
|
69
|
+
color: #1c5de7;
|
|
70
|
+
transition: all 0.2s;
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
}
|
|
74
|
+
}}
|
|
75
|
+
`;
|
|
76
|
+
|
|
77
|
+
export { Label };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* CustomInputCheckbox
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import React, { memo } from 'react';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { Label } from './components';
|
|
9
|
+
|
|
10
|
+
function CustomInputCheckbox({ entriesToDelete, isAll, name, onChange, value }) {
|
|
11
|
+
const shouldDisplaySomeChecked = isAll && entriesToDelete.length > 0 && !value;
|
|
12
|
+
|
|
13
|
+
const shouldDisplayAllChecked = isAll && value;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<span className="form-check" style={{ marginLeft: '-15px' }}>
|
|
17
|
+
<Label
|
|
18
|
+
className="form-check-label"
|
|
19
|
+
isAll={isAll}
|
|
20
|
+
shouldDisplaySomeChecked={shouldDisplaySomeChecked}
|
|
21
|
+
shouldDisplayAllChecked={shouldDisplayAllChecked}
|
|
22
|
+
isChecked={value && !isAll}
|
|
23
|
+
htmlFor={name}
|
|
24
|
+
>
|
|
25
|
+
<input
|
|
26
|
+
className="form-check-input"
|
|
27
|
+
checked={value}
|
|
28
|
+
id={name}
|
|
29
|
+
name={name}
|
|
30
|
+
onChange={onChange}
|
|
31
|
+
type="checkbox"
|
|
32
|
+
/>
|
|
33
|
+
</Label>
|
|
34
|
+
</span>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
CustomInputCheckbox.defaultProps = {
|
|
39
|
+
entriesToDelete: [],
|
|
40
|
+
isAll: false,
|
|
41
|
+
name: '',
|
|
42
|
+
value: false,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
CustomInputCheckbox.propTypes = {
|
|
46
|
+
entriesToDelete: PropTypes.array,
|
|
47
|
+
isAll: PropTypes.bool,
|
|
48
|
+
name: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
49
|
+
onChange: PropTypes.func.isRequired,
|
|
50
|
+
value: PropTypes.bool,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export default memo(CustomInputCheckbox);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
const Delete = styled.span`
|
|
4
|
+
font-weight: 600;
|
|
5
|
+
-webkit-font-smoothing: antialiased;
|
|
6
|
+
&:after {
|
|
7
|
+
content: '—';
|
|
8
|
+
margin: 0 7px;
|
|
9
|
+
font-size: 13px;
|
|
10
|
+
font-weight: 600;
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export default Delete;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
const DeleteAll = styled.span`
|
|
4
|
+
position: absolute;
|
|
5
|
+
color: #f64d0a;
|
|
6
|
+
font-weight: 500;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
&:after {
|
|
9
|
+
position: relative;
|
|
10
|
+
top: -1px;
|
|
11
|
+
content: '\f2ed';
|
|
12
|
+
margin-left: 7px;
|
|
13
|
+
font-size: 10px;
|
|
14
|
+
font-family: FontAwesome;
|
|
15
|
+
-webkit-font-smoothing: antialiased;
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
18
|
+
export default DeleteAll;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
|
|
3
|
+
const Wrapper = styled.tr`
|
|
4
|
+
width: 100%;
|
|
5
|
+
height: 36px;
|
|
6
|
+
background: #f7f8f8;
|
|
7
|
+
|
|
8
|
+
td {
|
|
9
|
+
height: 36px;
|
|
10
|
+
line-height: 36px;
|
|
11
|
+
font-size: 1.3rem;
|
|
12
|
+
font-weight: 400;
|
|
13
|
+
color: #333740;
|
|
14
|
+
text-align: left;
|
|
15
|
+
border-collapse: collapse;
|
|
16
|
+
border-top: 1px solid #f1f1f2 !important;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export default Wrapper;
|