@strapi/content-type-builder 5.12.1 → 5.12.2
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/dist/admin/components/AllowedTypesSelect.js +78 -0
- package/dist/admin/components/AllowedTypesSelect.js.map +1 -0
- package/dist/admin/components/AllowedTypesSelect.mjs +76 -0
- package/dist/admin/components/AllowedTypesSelect.mjs.map +1 -0
- package/dist/admin/components/AttributeIcon.js +72 -0
- package/dist/admin/components/AttributeIcon.js.map +1 -0
- package/dist/admin/components/AttributeIcon.mjs +70 -0
- package/dist/admin/components/AttributeIcon.mjs.map +1 -0
- package/dist/admin/components/AttributeOptions/AttributeList.js +31 -0
- package/dist/admin/components/AttributeOptions/AttributeList.js.map +1 -0
- package/dist/admin/components/AttributeOptions/AttributeList.mjs +29 -0
- package/dist/admin/components/AttributeOptions/AttributeList.mjs.map +1 -0
- package/dist/admin/components/AttributeOptions/AttributeOption.js +92 -0
- package/dist/admin/components/AttributeOptions/AttributeOption.js.map +1 -0
- package/dist/admin/components/AttributeOptions/AttributeOption.mjs +90 -0
- package/dist/admin/components/AttributeOptions/AttributeOption.mjs.map +1 -0
- package/dist/admin/components/AttributeOptions/AttributeOptions.js +71 -0
- package/dist/admin/components/AttributeOptions/AttributeOptions.js.map +1 -0
- package/dist/admin/components/AttributeOptions/AttributeOptions.mjs +69 -0
- package/dist/admin/components/AttributeOptions/AttributeOptions.mjs.map +1 -0
- package/dist/admin/components/AttributeOptions/CustomFieldOption.js +58 -0
- package/dist/admin/components/AttributeOptions/CustomFieldOption.js.map +1 -0
- package/dist/admin/components/AttributeOptions/CustomFieldOption.mjs +56 -0
- package/dist/admin/components/AttributeOptions/CustomFieldOption.mjs.map +1 -0
- package/dist/admin/components/AttributeOptions/CustomFieldsList.js +54 -0
- package/dist/admin/components/AttributeOptions/CustomFieldsList.js.map +1 -0
- package/dist/admin/components/AttributeOptions/CustomFieldsList.mjs +52 -0
- package/dist/admin/components/AttributeOptions/CustomFieldsList.mjs.map +1 -0
- package/dist/admin/components/AttributeOptions/EmptyAttributes.js +123 -0
- package/dist/admin/components/AttributeOptions/EmptyAttributes.js.map +1 -0
- package/dist/admin/components/AttributeOptions/EmptyAttributes.mjs +101 -0
- package/dist/admin/components/AttributeOptions/EmptyAttributes.mjs.map +1 -0
- package/dist/admin/components/AttributeOptions/OptionBoxWrapper.js +19 -0
- package/dist/admin/components/AttributeOptions/OptionBoxWrapper.js.map +1 -0
- package/dist/admin/components/AttributeOptions/OptionBoxWrapper.mjs +17 -0
- package/dist/admin/components/AttributeOptions/OptionBoxWrapper.mjs.map +1 -0
- package/dist/admin/components/AutoReloadOverlayBlocker.js +212 -0
- package/dist/admin/components/AutoReloadOverlayBlocker.js.map +1 -0
- package/dist/admin/components/AutoReloadOverlayBlocker.mjs +190 -0
- package/dist/admin/components/AutoReloadOverlayBlocker.mjs.map +1 -0
- package/dist/admin/components/BooleanDefaultValueSelect.js +54 -0
- package/dist/admin/components/BooleanDefaultValueSelect.js.map +1 -0
- package/dist/admin/components/BooleanDefaultValueSelect.mjs +52 -0
- package/dist/admin/components/BooleanDefaultValueSelect.mjs.map +1 -0
- package/dist/admin/components/BooleanRadioGroup.js +27 -0
- package/dist/admin/components/BooleanRadioGroup.js.map +1 -0
- package/dist/admin/components/BooleanRadioGroup.mjs +25 -0
- package/dist/admin/components/BooleanRadioGroup.mjs.map +1 -0
- package/dist/admin/components/BoxWrapper.js +44 -0
- package/dist/admin/components/BoxWrapper.js.map +1 -0
- package/dist/admin/components/BoxWrapper.mjs +42 -0
- package/dist/admin/components/BoxWrapper.mjs.map +1 -0
- package/dist/admin/components/CheckboxWithNumberField.js +86 -0
- package/dist/admin/components/CheckboxWithNumberField.js.map +1 -0
- package/dist/admin/components/CheckboxWithNumberField.mjs +84 -0
- package/dist/admin/components/CheckboxWithNumberField.mjs.map +1 -0
- package/dist/admin/components/ComponentCard/ComponentCard.js +112 -0
- package/dist/admin/components/ComponentCard/ComponentCard.js.map +1 -0
- package/dist/admin/components/ComponentCard/ComponentCard.mjs +110 -0
- package/dist/admin/components/ComponentCard/ComponentCard.mjs.map +1 -0
- package/dist/admin/components/ComponentCard/ComponentIcon/ComponentIcon.js +24 -0
- package/dist/admin/components/ComponentCard/ComponentIcon/ComponentIcon.js.map +1 -0
- package/dist/admin/components/ComponentCard/ComponentIcon/ComponentIcon.mjs +22 -0
- package/dist/admin/components/ComponentCard/ComponentIcon/ComponentIcon.mjs.map +1 -0
- package/dist/admin/components/ComponentList.js +40 -0
- package/dist/admin/components/ComponentList.js.map +1 -0
- package/dist/admin/components/ComponentList.mjs +38 -0
- package/dist/admin/components/ComponentList.mjs.map +1 -0
- package/dist/admin/components/ContentTypeBuilderNav/ContentTypeBuilderNav.js +108 -0
- package/dist/admin/components/ContentTypeBuilderNav/ContentTypeBuilderNav.js.map +1 -0
- package/dist/admin/components/ContentTypeBuilderNav/ContentTypeBuilderNav.mjs +106 -0
- package/dist/admin/components/ContentTypeBuilderNav/ContentTypeBuilderNav.mjs.map +1 -0
- package/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.js +179 -0
- package/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.js.map +1 -0
- package/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.mjs +177 -0
- package/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.mjs.map +1 -0
- package/dist/admin/components/ContentTypeRadioGroup.js +29 -0
- package/dist/admin/components/ContentTypeRadioGroup.js.map +1 -0
- package/dist/admin/components/ContentTypeRadioGroup.mjs +27 -0
- package/dist/admin/components/ContentTypeRadioGroup.mjs.map +1 -0
- package/dist/admin/components/CustomRadioGroup/CustomRadioGroup.js +79 -0
- package/dist/admin/components/CustomRadioGroup/CustomRadioGroup.js.map +1 -0
- package/dist/admin/components/CustomRadioGroup/CustomRadioGroup.mjs +77 -0
- package/dist/admin/components/CustomRadioGroup/CustomRadioGroup.mjs.map +1 -0
- package/dist/admin/components/CustomRadioGroup/Styles.js +77 -0
- package/dist/admin/components/CustomRadioGroup/Styles.js.map +1 -0
- package/dist/admin/components/CustomRadioGroup/Styles.mjs +75 -0
- package/dist/admin/components/CustomRadioGroup/Styles.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/DataManagerProvider.js +520 -0
- package/dist/admin/components/DataManagerProvider/DataManagerProvider.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/DataManagerProvider.mjs +518 -0
- package/dist/admin/components/DataManagerProvider/DataManagerProvider.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/reducer.js +583 -0
- package/dist/admin/components/DataManagerProvider/reducer.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/reducer.mjs +579 -0
- package/dist/admin/components/DataManagerProvider/reducer.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/selectors.js +20 -0
- package/dist/admin/components/DataManagerProvider/selectors.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/selectors.mjs +17 -0
- package/dist/admin/components/DataManagerProvider/selectors.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/cleanData.js +126 -0
- package/dist/admin/components/DataManagerProvider/utils/cleanData.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/cleanData.mjs +120 -0
- package/dist/admin/components/DataManagerProvider/utils/cleanData.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/createDataObject.js +9 -0
- package/dist/admin/components/DataManagerProvider/utils/createDataObject.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/createDataObject.mjs +7 -0
- package/dist/admin/components/DataManagerProvider/utils/createDataObject.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/createModifiedDataSchema.js +20 -0
- package/dist/admin/components/DataManagerProvider/utils/createModifiedDataSchema.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/createModifiedDataSchema.mjs +18 -0
- package/dist/admin/components/DataManagerProvider/utils/createModifiedDataSchema.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/formatSchemas.js +30 -0
- package/dist/admin/components/DataManagerProvider/utils/formatSchemas.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/formatSchemas.mjs +27 -0
- package/dist/admin/components/DataManagerProvider/utils/formatSchemas.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveComponentsFromSchema.js +46 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveComponentsFromSchema.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveComponentsFromSchema.mjs +44 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveComponentsFromSchema.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveComponentsThatHaveComponents.js +38 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveComponentsThatHaveComponents.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveComponentsThatHaveComponents.mjs +35 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveComponentsThatHaveComponents.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveNestedComponents.js +45 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveNestedComponents.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveNestedComponents.mjs +43 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveNestedComponents.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveSpecificInfoFromComponents.js +17 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveSpecificInfoFromComponents.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveSpecificInfoFromComponents.mjs +15 -0
- package/dist/admin/components/DataManagerProvider/utils/retrieveSpecificInfoFromComponents.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/serverRestartWatcher.js +37 -0
- package/dist/admin/components/DataManagerProvider/utils/serverRestartWatcher.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/serverRestartWatcher.mjs +35 -0
- package/dist/admin/components/DataManagerProvider/utils/serverRestartWatcher.mjs.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/validateSchema.js +9 -0
- package/dist/admin/components/DataManagerProvider/utils/validateSchema.js.map +1 -0
- package/dist/admin/components/DataManagerProvider/utils/validateSchema.mjs +7 -0
- package/dist/admin/components/DataManagerProvider/utils/validateSchema.mjs.map +1 -0
- package/dist/admin/components/DisplayedType.js +48 -0
- package/dist/admin/components/DisplayedType.js.map +1 -0
- package/dist/admin/components/DisplayedType.mjs +46 -0
- package/dist/admin/components/DisplayedType.mjs.map +1 -0
- package/dist/admin/components/DraftAndPublishToggle.js +86 -0
- package/dist/admin/components/DraftAndPublishToggle.js.map +1 -0
- package/dist/admin/components/DraftAndPublishToggle.mjs +84 -0
- package/dist/admin/components/DraftAndPublishToggle.mjs.map +1 -0
- package/dist/admin/components/DynamicZoneList.js +139 -0
- package/dist/admin/components/DynamicZoneList.js.map +1 -0
- package/dist/admin/components/DynamicZoneList.mjs +137 -0
- package/dist/admin/components/DynamicZoneList.mjs.map +1 -0
- package/dist/admin/components/FormModal/FormModal.js +931 -0
- package/dist/admin/components/FormModal/FormModal.js.map +1 -0
- package/dist/admin/components/FormModal/FormModal.mjs +910 -0
- package/dist/admin/components/FormModal/FormModal.mjs.map +1 -0
- package/dist/admin/components/FormModal/attributes/advancedForm.js +471 -0
- package/dist/admin/components/FormModal/attributes/advancedForm.js.map +1 -0
- package/dist/admin/components/FormModal/attributes/advancedForm.mjs +469 -0
- package/dist/admin/components/FormModal/attributes/advancedForm.mjs.map +1 -0
- package/dist/admin/components/FormModal/attributes/attributeOptions.js +97 -0
- package/dist/admin/components/FormModal/attributes/attributeOptions.js.map +1 -0
- package/dist/admin/components/FormModal/attributes/attributeOptions.mjs +95 -0
- package/dist/admin/components/FormModal/attributes/attributeOptions.mjs.map +1 -0
- package/dist/admin/components/FormModal/attributes/baseForm.js +482 -0
- package/dist/admin/components/FormModal/attributes/baseForm.js.map +1 -0
- package/dist/admin/components/FormModal/attributes/baseForm.mjs +480 -0
- package/dist/admin/components/FormModal/attributes/baseForm.mjs.map +1 -0
- package/dist/admin/components/FormModal/attributes/commonBaseForm.js +17 -0
- package/dist/admin/components/FormModal/attributes/commonBaseForm.js.map +1 -0
- package/dist/admin/components/FormModal/attributes/commonBaseForm.mjs +15 -0
- package/dist/admin/components/FormModal/attributes/commonBaseForm.mjs.map +1 -0
- package/dist/admin/components/FormModal/attributes/form.js +12 -0
- package/dist/admin/components/FormModal/attributes/form.js.map +1 -0
- package/dist/admin/components/FormModal/attributes/form.mjs +10 -0
- package/dist/admin/components/FormModal/attributes/form.mjs.map +1 -0
- package/dist/admin/components/FormModal/attributes/nameField.js +19 -0
- package/dist/admin/components/FormModal/attributes/nameField.js.map +1 -0
- package/dist/admin/components/FormModal/attributes/nameField.mjs +17 -0
- package/dist/admin/components/FormModal/attributes/nameField.mjs.map +1 -0
- package/dist/admin/components/FormModal/attributes/types.js +305 -0
- package/dist/admin/components/FormModal/attributes/types.js.map +1 -0
- package/dist/admin/components/FormModal/attributes/types.mjs +284 -0
- package/dist/admin/components/FormModal/attributes/types.mjs.map +1 -0
- package/dist/admin/components/FormModal/attributes/validation/common.js +129 -0
- package/dist/admin/components/FormModal/attributes/validation/common.js.map +1 -0
- package/dist/admin/components/FormModal/attributes/validation/common.mjs +103 -0
- package/dist/admin/components/FormModal/attributes/validation/common.mjs.map +1 -0
- package/dist/admin/components/FormModal/category/createCategorySchema.js +43 -0
- package/dist/admin/components/FormModal/category/createCategorySchema.js.map +1 -0
- package/dist/admin/components/FormModal/category/createCategorySchema.mjs +22 -0
- package/dist/admin/components/FormModal/category/createCategorySchema.mjs.map +1 -0
- package/dist/admin/components/FormModal/category/form.js +34 -0
- package/dist/admin/components/FormModal/category/form.js.map +1 -0
- package/dist/admin/components/FormModal/category/form.mjs +32 -0
- package/dist/admin/components/FormModal/category/form.mjs.map +1 -0
- package/dist/admin/components/FormModal/category/regex.js +6 -0
- package/dist/admin/components/FormModal/category/regex.js.map +1 -0
- package/dist/admin/components/FormModal/category/regex.mjs +4 -0
- package/dist/admin/components/FormModal/category/regex.mjs.map +1 -0
- package/dist/admin/components/FormModal/component/componentField.js +40 -0
- package/dist/admin/components/FormModal/component/componentField.js.map +1 -0
- package/dist/admin/components/FormModal/component/componentField.mjs +38 -0
- package/dist/admin/components/FormModal/component/componentField.mjs.map +1 -0
- package/dist/admin/components/FormModal/component/componentForm.js +53 -0
- package/dist/admin/components/FormModal/component/componentForm.js.map +1 -0
- package/dist/admin/components/FormModal/component/componentForm.mjs +51 -0
- package/dist/admin/components/FormModal/component/componentForm.mjs.map +1 -0
- package/dist/admin/components/FormModal/component/createComponentSchema.js +65 -0
- package/dist/admin/components/FormModal/component/createComponentSchema.js.map +1 -0
- package/dist/admin/components/FormModal/component/createComponentSchema.mjs +44 -0
- package/dist/admin/components/FormModal/component/createComponentSchema.mjs.map +1 -0
- package/dist/admin/components/FormModal/contentType/contentTypeForm.js +169 -0
- package/dist/admin/components/FormModal/contentType/contentTypeForm.js.map +1 -0
- package/dist/admin/components/FormModal/contentType/contentTypeForm.mjs +167 -0
- package/dist/admin/components/FormModal/contentType/contentTypeForm.mjs.map +1 -0
- package/dist/admin/components/FormModal/contentType/createContentTypeSchema.js +170 -0
- package/dist/admin/components/FormModal/contentType/createContentTypeSchema.js.map +1 -0
- package/dist/admin/components/FormModal/contentType/createContentTypeSchema.mjs +149 -0
- package/dist/admin/components/FormModal/contentType/createContentTypeSchema.mjs.map +1 -0
- package/dist/admin/components/FormModal/dynamiczoneForm.js +68 -0
- package/dist/admin/components/FormModal/dynamiczoneForm.js.map +1 -0
- package/dist/admin/components/FormModal/dynamiczoneForm.mjs +66 -0
- package/dist/admin/components/FormModal/dynamiczoneForm.mjs.map +1 -0
- package/dist/admin/components/FormModal/forms/forms.js +275 -0
- package/dist/admin/components/FormModal/forms/forms.js.map +1 -0
- package/dist/admin/components/FormModal/forms/forms.mjs +273 -0
- package/dist/admin/components/FormModal/forms/forms.mjs.map +1 -0
- package/dist/admin/components/FormModal/forms/utils/addItemsToFormSection.js +21 -0
- package/dist/admin/components/FormModal/forms/utils/addItemsToFormSection.js.map +1 -0
- package/dist/admin/components/FormModal/forms/utils/addItemsToFormSection.mjs +19 -0
- package/dist/admin/components/FormModal/forms/utils/addItemsToFormSection.mjs.map +1 -0
- package/dist/admin/components/FormModal/forms/utils/createCollectionName.js +13 -0
- package/dist/admin/components/FormModal/forms/utils/createCollectionName.js.map +1 -0
- package/dist/admin/components/FormModal/forms/utils/createCollectionName.mjs +11 -0
- package/dist/admin/components/FormModal/forms/utils/createCollectionName.mjs.map +1 -0
- package/dist/admin/components/FormModal/forms/utils/getUsedAttributeNames.js +10 -0
- package/dist/admin/components/FormModal/forms/utils/getUsedAttributeNames.js.map +1 -0
- package/dist/admin/components/FormModal/forms/utils/getUsedAttributeNames.mjs +8 -0
- package/dist/admin/components/FormModal/forms/utils/getUsedAttributeNames.mjs.map +1 -0
- package/dist/admin/components/FormModal/reducer.js +327 -0
- package/dist/admin/components/FormModal/reducer.js.map +1 -0
- package/dist/admin/components/FormModal/reducer.mjs +323 -0
- package/dist/admin/components/FormModal/reducer.mjs.map +1 -0
- package/dist/admin/components/FormModal/selectors.js +20 -0
- package/dist/admin/components/FormModal/selectors.js.map +1 -0
- package/dist/admin/components/FormModal/selectors.mjs +17 -0
- package/dist/admin/components/FormModal/selectors.mjs.map +1 -0
- package/dist/admin/components/FormModal/utils/canEditContentType.js +32 -0
- package/dist/admin/components/FormModal/utils/canEditContentType.js.map +1 -0
- package/dist/admin/components/FormModal/utils/canEditContentType.mjs +30 -0
- package/dist/admin/components/FormModal/utils/canEditContentType.mjs.map +1 -0
- package/dist/admin/components/FormModal/utils/createUid.js +16 -0
- package/dist/admin/components/FormModal/utils/createUid.js.map +1 -0
- package/dist/admin/components/FormModal/utils/createUid.mjs +13 -0
- package/dist/admin/components/FormModal/utils/createUid.mjs.map +1 -0
- package/dist/admin/components/FormModal/utils/customFieldDefaultOptionsReducer.js +18 -0
- package/dist/admin/components/FormModal/utils/customFieldDefaultOptionsReducer.js.map +1 -0
- package/dist/admin/components/FormModal/utils/customFieldDefaultOptionsReducer.mjs +16 -0
- package/dist/admin/components/FormModal/utils/customFieldDefaultOptionsReducer.mjs.map +1 -0
- package/dist/admin/components/FormModal/utils/getAttributesToDisplay.js +56 -0
- package/dist/admin/components/FormModal/utils/getAttributesToDisplay.js.map +1 -0
- package/dist/admin/components/FormModal/utils/getAttributesToDisplay.mjs +54 -0
- package/dist/admin/components/FormModal/utils/getAttributesToDisplay.mjs.map +1 -0
- package/dist/admin/components/FormModal/utils/getFormInputNames.js +17 -0
- package/dist/admin/components/FormModal/utils/getFormInputNames.js.map +1 -0
- package/dist/admin/components/FormModal/utils/getFormInputNames.mjs +15 -0
- package/dist/admin/components/FormModal/utils/getFormInputNames.mjs.map +1 -0
- package/dist/admin/components/FormModal/utils/relations.js +15 -0
- package/dist/admin/components/FormModal/utils/relations.js.map +1 -0
- package/dist/admin/components/FormModal/utils/relations.mjs +12 -0
- package/dist/admin/components/FormModal/utils/relations.mjs.map +1 -0
- package/dist/admin/components/FormModalEndActions.js +322 -0
- package/dist/admin/components/FormModalEndActions.js.map +1 -0
- package/dist/admin/components/FormModalEndActions.mjs +320 -0
- package/dist/admin/components/FormModalEndActions.mjs.map +1 -0
- package/dist/admin/components/FormModalHeader.js +150 -0
- package/dist/admin/components/FormModalHeader.js.map +1 -0
- package/dist/admin/components/FormModalHeader.mjs +148 -0
- package/dist/admin/components/FormModalHeader.mjs.map +1 -0
- package/dist/admin/components/FormModalNavigationProvider/FormModalNavigationProvider.js +228 -0
- package/dist/admin/components/FormModalNavigationProvider/FormModalNavigationProvider.js.map +1 -0
- package/dist/admin/components/FormModalNavigationProvider/FormModalNavigationProvider.mjs +207 -0
- package/dist/admin/components/FormModalNavigationProvider/FormModalNavigationProvider.mjs.map +1 -0
- package/dist/admin/components/FormModalNavigationProvider/constants.js +21 -0
- package/dist/admin/components/FormModalNavigationProvider/constants.js.map +1 -0
- package/dist/admin/components/FormModalNavigationProvider/constants.mjs +19 -0
- package/dist/admin/components/FormModalNavigationProvider/constants.mjs.map +1 -0
- package/dist/admin/components/FormModalSubHeader.js +70 -0
- package/dist/admin/components/FormModalSubHeader.js.map +1 -0
- package/dist/admin/components/FormModalSubHeader.mjs +67 -0
- package/dist/admin/components/FormModalSubHeader.mjs.map +1 -0
- package/dist/admin/components/GenericInputs.js +529 -0
- package/dist/admin/components/GenericInputs.js.map +1 -0
- package/dist/admin/components/GenericInputs.mjs +508 -0
- package/dist/admin/components/GenericInputs.mjs.map +1 -0
- package/dist/admin/components/IconPicker/IconPicker.js +196 -0
- package/dist/admin/components/IconPicker/IconPicker.js.map +1 -0
- package/dist/admin/components/IconPicker/IconPicker.mjs +194 -0
- package/dist/admin/components/IconPicker/IconPicker.mjs.map +1 -0
- package/dist/admin/components/IconPicker/constants.js +155 -0
- package/dist/admin/components/IconPicker/constants.js.map +1 -0
- package/dist/admin/components/IconPicker/constants.mjs +133 -0
- package/dist/admin/components/IconPicker/constants.mjs.map +1 -0
- package/dist/admin/components/List.js +243 -0
- package/dist/admin/components/List.js.map +1 -0
- package/dist/admin/components/List.mjs +241 -0
- package/dist/admin/components/List.mjs.map +1 -0
- package/dist/admin/components/ListRow.js +164 -0
- package/dist/admin/components/ListRow.js.map +1 -0
- package/dist/admin/components/ListRow.mjs +161 -0
- package/dist/admin/components/ListRow.mjs.map +1 -0
- package/dist/admin/components/NestedFooter.js +62 -0
- package/dist/admin/components/NestedFooter.js.map +1 -0
- package/dist/admin/components/NestedFooter.mjs +60 -0
- package/dist/admin/components/NestedFooter.mjs.map +1 -0
- package/dist/admin/components/PluralName.js +74 -0
- package/dist/admin/components/PluralName.js.map +1 -0
- package/dist/admin/components/PluralName.mjs +72 -0
- package/dist/admin/components/PluralName.mjs.map +1 -0
- package/dist/admin/components/Relation/Relation.js +47 -0
- package/dist/admin/components/Relation/Relation.js.map +1 -0
- package/dist/admin/components/Relation/Relation.mjs +45 -0
- package/dist/admin/components/Relation/Relation.mjs.map +1 -0
- package/dist/admin/components/Relation/RelationField/RelationField.js +52 -0
- package/dist/admin/components/Relation/RelationField/RelationField.js.map +1 -0
- package/dist/admin/components/Relation/RelationField/RelationField.mjs +50 -0
- package/dist/admin/components/Relation/RelationField/RelationField.mjs.map +1 -0
- package/dist/admin/components/Relation/RelationField/RelationTargetPicker/RelationTargetPicker.js +74 -0
- package/dist/admin/components/Relation/RelationField/RelationTargetPicker/RelationTargetPicker.js.map +1 -0
- package/dist/admin/components/Relation/RelationField/RelationTargetPicker/RelationTargetPicker.mjs +72 -0
- package/dist/admin/components/Relation/RelationField/RelationTargetPicker/RelationTargetPicker.mjs.map +1 -0
- package/dist/admin/components/Relation/RelationNaturePicker/Components.js +49 -0
- package/dist/admin/components/Relation/RelationNaturePicker/Components.js.map +1 -0
- package/dist/admin/components/Relation/RelationNaturePicker/Components.mjs +45 -0
- package/dist/admin/components/Relation/RelationNaturePicker/Components.mjs.map +1 -0
- package/dist/admin/components/Relation/RelationNaturePicker/RelationNaturePicker.js +149 -0
- package/dist/admin/components/Relation/RelationNaturePicker/RelationNaturePicker.js.map +1 -0
- package/dist/admin/components/Relation/RelationNaturePicker/RelationNaturePicker.mjs +147 -0
- package/dist/admin/components/Relation/RelationNaturePicker/RelationNaturePicker.mjs.map +1 -0
- package/dist/admin/components/SelectCategory.js +60 -0
- package/dist/admin/components/SelectCategory.js.map +1 -0
- package/dist/admin/components/SelectCategory.mjs +58 -0
- package/dist/admin/components/SelectCategory.mjs.map +1 -0
- package/dist/admin/components/SelectComponent.js +90 -0
- package/dist/admin/components/SelectComponent.js.map +1 -0
- package/dist/admin/components/SelectComponent.mjs +88 -0
- package/dist/admin/components/SelectComponent.mjs.map +1 -0
- package/dist/admin/components/SelectComponents.js +70 -0
- package/dist/admin/components/SelectComponents.js.map +1 -0
- package/dist/admin/components/SelectComponents.mjs +68 -0
- package/dist/admin/components/SelectComponents.mjs.map +1 -0
- package/dist/admin/components/SelectDateType.js +62 -0
- package/dist/admin/components/SelectDateType.js.map +1 -0
- package/dist/admin/components/SelectDateType.mjs +60 -0
- package/dist/admin/components/SelectDateType.mjs.map +1 -0
- package/dist/admin/components/SelectNumber.js +111 -0
- package/dist/admin/components/SelectNumber.js.map +1 -0
- package/dist/admin/components/SelectNumber.mjs +109 -0
- package/dist/admin/components/SelectNumber.mjs.map +1 -0
- package/dist/admin/components/SingularName.js +63 -0
- package/dist/admin/components/SingularName.js.map +1 -0
- package/dist/admin/components/SingularName.mjs +61 -0
- package/dist/admin/components/SingularName.mjs.map +1 -0
- package/dist/admin/components/TabForm.js +81 -0
- package/dist/admin/components/TabForm.js.map +1 -0
- package/dist/admin/components/TabForm.mjs +79 -0
- package/dist/admin/components/TabForm.mjs.map +1 -0
- package/dist/admin/components/TextareaEnum.js +58 -0
- package/dist/admin/components/TextareaEnum.js.map +1 -0
- package/dist/admin/components/TextareaEnum.mjs +56 -0
- package/dist/admin/components/TextareaEnum.mjs.map +1 -0
- package/dist/admin/components/Tr.js +48 -0
- package/dist/admin/components/Tr.js.map +1 -0
- package/dist/admin/components/Tr.mjs +46 -0
- package/dist/admin/components/Tr.mjs.map +1 -0
- package/dist/admin/components/UpperFirst.js +11 -0
- package/dist/admin/components/UpperFirst.js.map +1 -0
- package/dist/admin/components/UpperFirst.mjs +9 -0
- package/dist/admin/components/UpperFirst.mjs.map +1 -0
- package/dist/admin/constants.js +19 -0
- package/dist/admin/constants.js.map +1 -0
- package/dist/admin/constants.mjs +16 -0
- package/dist/admin/constants.mjs.map +1 -0
- package/dist/admin/contexts/DataManagerContext.js +9 -0
- package/dist/admin/contexts/DataManagerContext.js.map +1 -0
- package/dist/admin/contexts/DataManagerContext.mjs +7 -0
- package/dist/admin/contexts/DataManagerContext.mjs.map +1 -0
- package/dist/admin/contexts/FormModalNavigationContext.js +28 -0
- package/dist/admin/contexts/FormModalNavigationContext.js.map +1 -0
- package/dist/admin/contexts/FormModalNavigationContext.mjs +7 -0
- package/dist/admin/contexts/FormModalNavigationContext.mjs.map +1 -0
- package/dist/admin/hooks/useDataManager.js +9 -0
- package/dist/admin/hooks/useDataManager.js.map +1 -0
- package/dist/admin/hooks/useDataManager.mjs +7 -0
- package/dist/admin/hooks/useDataManager.mjs.map +1 -0
- package/dist/admin/hooks/useFormModalNavigation.js +9 -0
- package/dist/admin/hooks/useFormModalNavigation.js.map +1 -0
- package/dist/admin/hooks/useFormModalNavigation.mjs +7 -0
- package/dist/admin/hooks/useFormModalNavigation.mjs.map +1 -0
- package/dist/admin/icons/Curve.js +46 -0
- package/dist/admin/icons/Curve.js.map +1 -0
- package/dist/admin/icons/Curve.mjs +44 -0
- package/dist/admin/icons/Curve.mjs.map +1 -0
- package/dist/admin/index.js +86 -20
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +85 -17
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/pages/App/index.js +66 -0
- package/dist/admin/pages/App/index.js.map +1 -0
- package/dist/admin/pages/App/index.mjs +62 -0
- package/dist/admin/pages/App/index.mjs.map +1 -0
- package/dist/admin/pages/ListView/LinkToCMSettingsView.js +81 -0
- package/dist/admin/pages/ListView/LinkToCMSettingsView.js.map +1 -0
- package/dist/admin/pages/ListView/LinkToCMSettingsView.mjs +79 -0
- package/dist/admin/pages/ListView/LinkToCMSettingsView.mjs.map +1 -0
- package/dist/admin/pages/ListView/ListView.js +218 -0
- package/dist/admin/pages/ListView/ListView.js.map +1 -0
- package/dist/admin/pages/ListView/ListView.mjs +216 -0
- package/dist/admin/pages/ListView/ListView.mjs.map +1 -0
- package/dist/admin/pluginId.js +6 -0
- package/dist/admin/pluginId.js.map +1 -0
- package/dist/admin/pluginId.mjs +4 -0
- package/dist/admin/pluginId.mjs.map +1 -0
- package/dist/admin/reducers.js +13 -0
- package/dist/admin/reducers.js.map +1 -0
- package/dist/admin/reducers.mjs +11 -0
- package/dist/admin/reducers.mjs.map +1 -0
- package/dist/admin/{chunks/ar-Df0f0-PT.js → translations/ar.json.js} +3 -1
- package/dist/admin/translations/ar.json.js.map +1 -0
- package/dist/admin/{chunks/ar-sRW9VFC-.mjs → translations/ar.json.mjs} +1 -1
- package/dist/admin/translations/ar.json.mjs.map +1 -0
- package/dist/admin/{chunks/cs-DeTwqc7p.js → translations/cs.json.js} +3 -1
- package/dist/admin/translations/cs.json.js.map +1 -0
- package/dist/admin/{chunks/cs-BpQ26jiq.mjs → translations/cs.json.mjs} +1 -1
- package/dist/admin/translations/cs.json.mjs.map +1 -0
- package/dist/admin/{chunks/de-BJkS06jF.js → translations/de.json.js} +3 -1
- package/dist/admin/translations/de.json.js.map +1 -0
- package/dist/admin/{chunks/de-DSxx5_x-.mjs → translations/de.json.mjs} +1 -1
- package/dist/admin/translations/de.json.mjs.map +1 -0
- package/dist/admin/{chunks/dk-CGm-qVH7.js → translations/dk.json.js} +3 -1
- package/dist/admin/translations/dk.json.js.map +1 -0
- package/dist/admin/{chunks/dk-BnjVZ7A_.mjs → translations/dk.json.mjs} +1 -1
- package/dist/admin/translations/dk.json.mjs.map +1 -0
- package/dist/admin/{chunks/en-BJUu34b0.js → translations/en.json.js} +3 -1
- package/dist/admin/translations/en.json.js.map +1 -0
- package/dist/admin/{chunks/en-Bhut8Yay.mjs → translations/en.json.mjs} +1 -1
- package/dist/admin/translations/en.json.mjs.map +1 -0
- package/dist/admin/{chunks/es-J8kvHlNy.js → translations/es.json.js} +3 -1
- package/dist/admin/translations/es.json.js.map +1 -0
- package/dist/admin/{chunks/es-DG8g9igJ.mjs → translations/es.json.mjs} +1 -1
- package/dist/admin/translations/es.json.mjs.map +1 -0
- package/dist/admin/{chunks/fr-C6y35iY7.js → translations/fr.json.js} +3 -1
- package/dist/admin/translations/fr.json.js.map +1 -0
- package/dist/admin/{chunks/fr-UpV34MHY.mjs → translations/fr.json.mjs} +1 -1
- package/dist/admin/translations/fr.json.mjs.map +1 -0
- package/dist/admin/{chunks/id-BvxV6wLP.js → translations/id.json.js} +3 -1
- package/dist/admin/translations/id.json.js.map +1 -0
- package/dist/admin/{chunks/id-BWM18ljw.mjs → translations/id.json.mjs} +1 -1
- package/dist/admin/translations/id.json.mjs.map +1 -0
- package/dist/admin/{chunks/it-C_IgFU-G.js → translations/it.json.js} +3 -1
- package/dist/admin/translations/it.json.js.map +1 -0
- package/dist/admin/{chunks/it-1_vd9gV4.mjs → translations/it.json.mjs} +1 -1
- package/dist/admin/{chunks/ms-C3s4kxq6.mjs.map → translations/it.json.mjs.map} +1 -1
- package/dist/admin/{chunks/ja-CWo4Qqq6.js → translations/ja.json.js} +3 -1
- package/dist/admin/translations/ja.json.js.map +1 -0
- package/dist/admin/{chunks/ja-Cx23a2Ui.mjs → translations/ja.json.mjs} +1 -1
- package/dist/admin/translations/ja.json.mjs.map +1 -0
- package/dist/admin/{chunks/ko-BsByJNEl.js → translations/ko.json.js} +3 -1
- package/dist/admin/translations/ko.json.js.map +1 -0
- package/dist/admin/{chunks/ko-DC7paEx5.mjs → translations/ko.json.mjs} +1 -1
- package/dist/admin/translations/ko.json.mjs.map +1 -0
- package/dist/admin/{chunks/ms-DPTzS7SH.js → translations/ms.json.js} +3 -1
- package/dist/admin/translations/ms.json.js.map +1 -0
- package/dist/admin/{chunks/ms-C3s4kxq6.mjs → translations/ms.json.mjs} +1 -1
- package/dist/admin/translations/ms.json.mjs.map +1 -0
- package/dist/admin/{chunks/nl-db29QMOx.js → translations/nl.json.js} +3 -1
- package/dist/admin/translations/nl.json.js.map +1 -0
- package/dist/admin/{chunks/nl-TzvfktV_.mjs → translations/nl.json.mjs} +1 -1
- package/dist/admin/translations/nl.json.mjs.map +1 -0
- package/dist/admin/{chunks/pl-pYy1djj3.js → translations/pl.json.js} +3 -1
- package/dist/admin/translations/pl.json.js.map +1 -0
- package/dist/admin/{chunks/pl-BdvupIN_.mjs → translations/pl.json.mjs} +1 -1
- package/dist/admin/translations/pl.json.mjs.map +1 -0
- package/dist/admin/{chunks/pt-BR-CTPuXGWF.js → translations/pt-BR.json.js} +3 -1
- package/dist/admin/translations/pt-BR.json.js.map +1 -0
- package/dist/admin/{chunks/pt-BR-DPrVmKeZ.mjs → translations/pt-BR.json.mjs} +1 -1
- package/dist/admin/{chunks/dk-CGm-qVH7.js.map → translations/pt-BR.json.mjs.map} +1 -1
- package/dist/admin/{chunks/pt-BQmWcdeG.js → translations/pt.json.js} +3 -1
- package/dist/admin/translations/pt.json.js.map +1 -0
- package/dist/admin/{chunks/pt-BTLIwmCv.mjs → translations/pt.json.mjs} +1 -1
- package/dist/admin/translations/pt.json.mjs.map +1 -0
- package/dist/admin/{chunks/ru-DQiDXgUV.js → translations/ru.json.js} +3 -1
- package/dist/admin/translations/ru.json.js.map +1 -0
- package/dist/admin/{chunks/ru-D46no502.mjs → translations/ru.json.mjs} +1 -1
- package/dist/admin/translations/ru.json.mjs.map +1 -0
- package/dist/admin/{chunks/sk-DrnebmXb.js → translations/sk.json.js} +3 -1
- package/dist/admin/translations/sk.json.js.map +1 -0
- package/dist/admin/{chunks/sk-Byr_l4Jc.mjs → translations/sk.json.mjs} +1 -1
- package/dist/admin/translations/sk.json.mjs.map +1 -0
- package/dist/admin/{chunks/sv-CrWlNosi.js → translations/sv.json.js} +3 -1
- package/dist/admin/translations/sv.json.js.map +1 -0
- package/dist/admin/{chunks/sv-Bbam7IDm.mjs → translations/sv.json.mjs} +1 -1
- package/dist/admin/translations/sv.json.mjs.map +1 -0
- package/dist/admin/{chunks/th-BbrCkfgX.js → translations/th.json.js} +3 -1
- package/dist/admin/translations/th.json.js.map +1 -0
- package/dist/admin/{chunks/th-hfS0Wmk_.mjs → translations/th.json.mjs} +1 -1
- package/dist/admin/translations/th.json.mjs.map +1 -0
- package/dist/admin/{chunks/tr-CHdMj8m6.js → translations/tr.json.js} +3 -1
- package/dist/admin/translations/tr.json.js.map +1 -0
- package/dist/admin/{chunks/tr-DS7DBOhC.mjs → translations/tr.json.mjs} +1 -1
- package/dist/admin/translations/tr.json.mjs.map +1 -0
- package/dist/admin/{chunks/uk-felSA_eV.js → translations/uk.json.js} +3 -1
- package/dist/admin/translations/uk.json.js.map +1 -0
- package/dist/admin/{chunks/uk-CjzmJyt1.mjs → translations/uk.json.mjs} +1 -1
- package/dist/admin/translations/uk.json.mjs.map +1 -0
- package/dist/admin/{chunks/zh-Hans-lXbNiMp9.js → translations/zh-Hans.json.js} +3 -1
- package/dist/admin/{chunks/cs-BpQ26jiq.mjs.map → translations/zh-Hans.json.js.map} +1 -1
- package/dist/admin/{chunks/zh-Hans-BElOnuRb.mjs → translations/zh-Hans.json.mjs} +1 -1
- package/dist/admin/translations/zh-Hans.json.mjs.map +1 -0
- package/dist/admin/{chunks/zh-CWj4avQA.js → translations/zh.json.js} +3 -1
- package/dist/admin/translations/zh.json.js.map +1 -0
- package/dist/admin/{chunks/zh-BUVXH75-.mjs → translations/zh.json.mjs} +1 -1
- package/dist/admin/translations/zh.json.mjs.map +1 -0
- package/dist/admin/utils/findAttribute.js +8 -0
- package/dist/admin/utils/findAttribute.js.map +1 -0
- package/dist/admin/utils/findAttribute.mjs +6 -0
- package/dist/admin/utils/findAttribute.mjs.map +1 -0
- package/dist/admin/utils/formAPI.js +134 -0
- package/dist/admin/utils/formAPI.js.map +1 -0
- package/dist/admin/utils/formAPI.mjs +113 -0
- package/dist/admin/utils/formAPI.mjs.map +1 -0
- package/dist/admin/utils/getAttributeDisplayedType.js +32 -0
- package/dist/admin/utils/getAttributeDisplayedType.js.map +1 -0
- package/dist/admin/utils/getAttributeDisplayedType.mjs +30 -0
- package/dist/admin/utils/getAttributeDisplayedType.mjs.map +1 -0
- package/dist/admin/utils/getMaxDepth.js +74 -0
- package/dist/admin/utils/getMaxDepth.js.map +1 -0
- package/dist/admin/utils/getMaxDepth.mjs +71 -0
- package/dist/admin/utils/getMaxDepth.mjs.map +1 -0
- package/dist/admin/utils/getRelationType.js +18 -0
- package/dist/admin/utils/getRelationType.js.map +1 -0
- package/dist/admin/utils/getRelationType.mjs +16 -0
- package/dist/admin/utils/getRelationType.mjs.map +1 -0
- package/dist/admin/utils/getTrad.js +8 -0
- package/dist/admin/utils/getTrad.js.map +1 -0
- package/dist/admin/utils/getTrad.mjs +6 -0
- package/dist/admin/utils/getTrad.mjs.map +1 -0
- package/dist/admin/utils/getYupInnerErrors.js +23 -0
- package/dist/admin/utils/getYupInnerErrors.js.map +1 -0
- package/dist/admin/utils/getYupInnerErrors.mjs +21 -0
- package/dist/admin/utils/getYupInnerErrors.mjs.map +1 -0
- package/dist/admin/utils/isAllowedContentTypesForRelations.js +8 -0
- package/dist/admin/utils/isAllowedContentTypesForRelations.js.map +1 -0
- package/dist/admin/utils/isAllowedContentTypesForRelations.mjs +6 -0
- package/dist/admin/utils/isAllowedContentTypesForRelations.mjs.map +1 -0
- package/dist/admin/utils/makeUnique.js +8 -0
- package/dist/admin/utils/makeUnique.js.map +1 -0
- package/dist/admin/utils/makeUnique.mjs +6 -0
- package/dist/admin/utils/makeUnique.mjs.map +1 -0
- package/dist/admin/utils/nameToSlug.js +10 -0
- package/dist/admin/utils/nameToSlug.js.map +1 -0
- package/dist/admin/utils/nameToSlug.mjs +8 -0
- package/dist/admin/utils/nameToSlug.mjs.map +1 -0
- package/dist/admin/utils/parseDateValue.js +17 -0
- package/dist/admin/utils/parseDateValue.js.map +1 -0
- package/dist/admin/utils/parseDateValue.mjs +15 -0
- package/dist/admin/utils/parseDateValue.mjs.map +1 -0
- package/dist/admin/utils/prefixPluginTranslations.js +11 -0
- package/dist/admin/utils/prefixPluginTranslations.js.map +1 -0
- package/dist/admin/utils/prefixPluginTranslations.mjs +9 -0
- package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -0
- package/dist/admin/utils/timeFormat.js +38 -0
- package/dist/admin/utils/timeFormat.js.map +1 -0
- package/dist/admin/utils/timeFormat.mjs +35 -0
- package/dist/admin/utils/timeFormat.mjs.map +1 -0
- package/dist/admin/utils/toRegressedEnumValue.js +17 -0
- package/dist/admin/utils/toRegressedEnumValue.js.map +1 -0
- package/dist/admin/utils/toRegressedEnumValue.mjs +15 -0
- package/dist/admin/utils/toRegressedEnumValue.mjs.map +1 -0
- package/dist/server/bootstrap.js +16 -0
- package/dist/server/bootstrap.js.map +1 -0
- package/dist/server/bootstrap.mjs +14 -0
- package/dist/server/bootstrap.mjs.map +1 -0
- package/dist/server/config.js +9 -0
- package/dist/server/config.js.map +1 -0
- package/dist/server/config.mjs +7 -0
- package/dist/server/config.mjs.map +1 -0
- package/dist/server/controllers/builder.js +12 -0
- package/dist/server/controllers/builder.js.map +1 -0
- package/dist/server/controllers/builder.mjs +10 -0
- package/dist/server/controllers/builder.mjs.map +1 -0
- package/dist/server/controllers/component-categories.js +38 -0
- package/dist/server/controllers/component-categories.js.map +1 -0
- package/dist/server/controllers/component-categories.mjs +36 -0
- package/dist/server/controllers/component-categories.mjs.map +1 -0
- package/dist/server/controllers/components.js +144 -0
- package/dist/server/controllers/components.js.map +1 -0
- package/dist/server/controllers/components.mjs +142 -0
- package/dist/server/controllers/components.mjs.map +1 -0
- package/dist/server/controllers/content-types.js +142 -0
- package/dist/server/controllers/content-types.js.map +1 -0
- package/dist/server/controllers/content-types.mjs +140 -0
- package/dist/server/controllers/content-types.mjs.map +1 -0
- package/dist/server/controllers/index.js +16 -0
- package/dist/server/controllers/index.js.map +1 -0
- package/dist/server/controllers/index.mjs +14 -0
- package/dist/server/controllers/index.mjs.map +1 -0
- package/dist/server/controllers/validation/common.js +102 -0
- package/dist/server/controllers/validation/common.js.map +1 -0
- package/dist/server/controllers/validation/common.mjs +85 -0
- package/dist/server/controllers/validation/common.mjs.map +1 -0
- package/dist/server/controllers/validation/component-category.js +12 -0
- package/dist/server/controllers/validation/component-category.js.map +1 -0
- package/dist/server/controllers/validation/component-category.mjs +10 -0
- package/dist/server/controllers/validation/component-category.mjs.map +1 -0
- package/dist/server/controllers/validation/component.js +68 -0
- package/dist/server/controllers/validation/component.js.map +1 -0
- package/dist/server/controllers/validation/component.mjs +60 -0
- package/dist/server/controllers/validation/component.mjs.map +1 -0
- package/dist/server/controllers/validation/content-type.js +153 -0
- package/dist/server/controllers/validation/content-type.js.map +1 -0
- package/dist/server/controllers/validation/content-type.mjs +149 -0
- package/dist/server/controllers/validation/content-type.mjs.map +1 -0
- package/dist/server/controllers/validation/data-transform.js +27 -0
- package/dist/server/controllers/validation/data-transform.js.map +1 -0
- package/dist/server/controllers/validation/data-transform.mjs +24 -0
- package/dist/server/controllers/validation/data-transform.mjs.map +1 -0
- package/dist/server/controllers/validation/model-schema.js +90 -0
- package/dist/server/controllers/validation/model-schema.js.map +1 -0
- package/dist/server/controllers/validation/model-schema.mjs +88 -0
- package/dist/server/controllers/validation/model-schema.mjs.map +1 -0
- package/dist/server/controllers/validation/relations.js +70 -0
- package/dist/server/controllers/validation/relations.js.map +1 -0
- package/dist/server/controllers/validation/relations.mjs +68 -0
- package/dist/server/controllers/validation/relations.mjs.map +1 -0
- package/dist/server/controllers/validation/types.js +215 -0
- package/dist/server/controllers/validation/types.js.map +1 -0
- package/dist/server/controllers/validation/types.mjs +213 -0
- package/dist/server/controllers/validation/types.mjs.map +1 -0
- package/dist/server/index.js +8 -2654
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +5 -2633
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/routes/admin.js +231 -0
- package/dist/server/routes/admin.js.map +1 -0
- package/dist/server/routes/admin.mjs +229 -0
- package/dist/server/routes/admin.mjs.map +1 -0
- package/dist/server/routes/content-api.js +30 -0
- package/dist/server/routes/content-api.js.map +1 -0
- package/dist/server/routes/content-api.mjs +28 -0
- package/dist/server/routes/content-api.mjs.map +1 -0
- package/dist/server/routes/index.js +12 -0
- package/dist/server/routes/index.js.map +1 -0
- package/dist/server/routes/index.mjs +10 -0
- package/dist/server/routes/index.mjs.map +1 -0
- package/dist/server/services/api-handler.js +109 -0
- package/dist/server/services/api-handler.js.map +1 -0
- package/dist/server/services/api-handler.mjs +85 -0
- package/dist/server/services/api-handler.mjs.map +1 -0
- package/dist/server/services/builder.js +81 -0
- package/dist/server/services/builder.js.map +1 -0
- package/dist/server/services/builder.mjs +75 -0
- package/dist/server/services/builder.mjs.map +1 -0
- package/dist/server/services/component-categories.js +59 -0
- package/dist/server/services/component-categories.js.map +1 -0
- package/dist/server/services/component-categories.mjs +56 -0
- package/dist/server/services/component-categories.mjs.map +1 -0
- package/dist/server/services/components.js +79 -0
- package/dist/server/services/components.js.map +1 -0
- package/dist/server/services/components.mjs +74 -0
- package/dist/server/services/components.mjs.map +1 -0
- package/dist/server/services/constants.js +52 -0
- package/dist/server/services/constants.js.map +1 -0
- package/dist/server/services/constants.mjs +45 -0
- package/dist/server/services/constants.mjs.map +1 -0
- package/dist/server/services/content-types.js +223 -0
- package/dist/server/services/content-types.js.map +1 -0
- package/dist/server/services/content-types.mjs +213 -0
- package/dist/server/services/content-types.mjs.map +1 -0
- package/dist/server/services/index.js +18 -0
- package/dist/server/services/index.js.map +1 -0
- package/dist/server/services/index.mjs +16 -0
- package/dist/server/services/index.mjs.map +1 -0
- package/dist/server/services/schema-builder/component-builder.js +114 -0
- package/dist/server/services/schema-builder/component-builder.js.map +1 -0
- package/dist/server/services/schema-builder/component-builder.mjs +112 -0
- package/dist/server/services/schema-builder/component-builder.mjs.map +1 -0
- package/dist/server/services/schema-builder/content-type-builder.js +276 -0
- package/dist/server/services/schema-builder/content-type-builder.js.map +1 -0
- package/dist/server/services/schema-builder/content-type-builder.mjs +274 -0
- package/dist/server/services/schema-builder/content-type-builder.mjs.map +1 -0
- package/dist/server/services/schema-builder/index.js +145 -0
- package/dist/server/services/schema-builder/index.js.map +1 -0
- package/dist/server/services/schema-builder/index.mjs +143 -0
- package/dist/server/services/schema-builder/index.mjs.map +1 -0
- package/dist/server/services/schema-builder/schema-handler.js +250 -0
- package/dist/server/services/schema-builder/schema-handler.js.map +1 -0
- package/dist/server/services/schema-builder/schema-handler.mjs +248 -0
- package/dist/server/services/schema-builder/schema-handler.mjs.map +1 -0
- package/dist/server/utils/attributes.js +91 -0
- package/dist/server/utils/attributes.js.map +1 -0
- package/dist/server/utils/attributes.mjs +85 -0
- package/dist/server/utils/attributes.mjs.map +1 -0
- package/dist/server/utils/index.js +8 -0
- package/dist/server/utils/index.js.map +1 -0
- package/dist/server/utils/index.mjs +6 -0
- package/dist/server/utils/index.mjs.map +1 -0
- package/dist/server/utils/typeguards.js +8 -0
- package/dist/server/utils/typeguards.js.map +1 -0
- package/dist/server/utils/typeguards.mjs +6 -0
- package/dist/server/utils/typeguards.mjs.map +1 -0
- package/package.json +5 -5
- package/dist/admin/chunks/ListView-Cl-pbcxP.mjs +0 -1184
- package/dist/admin/chunks/ListView-Cl-pbcxP.mjs.map +0 -1
- package/dist/admin/chunks/ListView-DMZvleUI.js +0 -1186
- package/dist/admin/chunks/ListView-DMZvleUI.js.map +0 -1
- package/dist/admin/chunks/ar-Df0f0-PT.js.map +0 -1
- package/dist/admin/chunks/ar-sRW9VFC-.mjs.map +0 -1
- package/dist/admin/chunks/cs-DeTwqc7p.js.map +0 -1
- package/dist/admin/chunks/de-BJkS06jF.js.map +0 -1
- package/dist/admin/chunks/de-DSxx5_x-.mjs.map +0 -1
- package/dist/admin/chunks/dk-BnjVZ7A_.mjs.map +0 -1
- package/dist/admin/chunks/en-BJUu34b0.js.map +0 -1
- package/dist/admin/chunks/en-Bhut8Yay.mjs.map +0 -1
- package/dist/admin/chunks/es-DG8g9igJ.mjs.map +0 -1
- package/dist/admin/chunks/es-J8kvHlNy.js.map +0 -1
- package/dist/admin/chunks/fr-C6y35iY7.js.map +0 -1
- package/dist/admin/chunks/fr-UpV34MHY.mjs.map +0 -1
- package/dist/admin/chunks/id-BWM18ljw.mjs.map +0 -1
- package/dist/admin/chunks/id-BvxV6wLP.js.map +0 -1
- package/dist/admin/chunks/index-BG2mUcnk.js +0 -7788
- package/dist/admin/chunks/index-BG2mUcnk.js.map +0 -1
- package/dist/admin/chunks/index-DAXXa6S8.mjs +0 -1384
- package/dist/admin/chunks/index-DAXXa6S8.mjs.map +0 -1
- package/dist/admin/chunks/index-DWAINlnG.js +0 -1421
- package/dist/admin/chunks/index-DWAINlnG.js.map +0 -1
- package/dist/admin/chunks/index-Knq4Ti8R.mjs +0 -7761
- package/dist/admin/chunks/index-Knq4Ti8R.mjs.map +0 -1
- package/dist/admin/chunks/it-1_vd9gV4.mjs.map +0 -1
- package/dist/admin/chunks/it-C_IgFU-G.js.map +0 -1
- package/dist/admin/chunks/ja-CWo4Qqq6.js.map +0 -1
- package/dist/admin/chunks/ja-Cx23a2Ui.mjs.map +0 -1
- package/dist/admin/chunks/ko-BsByJNEl.js.map +0 -1
- package/dist/admin/chunks/ko-DC7paEx5.mjs.map +0 -1
- package/dist/admin/chunks/ms-DPTzS7SH.js.map +0 -1
- package/dist/admin/chunks/nl-TzvfktV_.mjs.map +0 -1
- package/dist/admin/chunks/nl-db29QMOx.js.map +0 -1
- package/dist/admin/chunks/pl-BdvupIN_.mjs.map +0 -1
- package/dist/admin/chunks/pl-pYy1djj3.js.map +0 -1
- package/dist/admin/chunks/pt-BQmWcdeG.js.map +0 -1
- package/dist/admin/chunks/pt-BR-CTPuXGWF.js.map +0 -1
- package/dist/admin/chunks/pt-BR-DPrVmKeZ.mjs.map +0 -1
- package/dist/admin/chunks/pt-BTLIwmCv.mjs.map +0 -1
- package/dist/admin/chunks/ru-D46no502.mjs.map +0 -1
- package/dist/admin/chunks/ru-DQiDXgUV.js.map +0 -1
- package/dist/admin/chunks/sk-Byr_l4Jc.mjs.map +0 -1
- package/dist/admin/chunks/sk-DrnebmXb.js.map +0 -1
- package/dist/admin/chunks/sv-Bbam7IDm.mjs.map +0 -1
- package/dist/admin/chunks/sv-CrWlNosi.js.map +0 -1
- package/dist/admin/chunks/th-BbrCkfgX.js.map +0 -1
- package/dist/admin/chunks/th-hfS0Wmk_.mjs.map +0 -1
- package/dist/admin/chunks/tr-CHdMj8m6.js.map +0 -1
- package/dist/admin/chunks/tr-DS7DBOhC.mjs.map +0 -1
- package/dist/admin/chunks/uk-CjzmJyt1.mjs.map +0 -1
- package/dist/admin/chunks/uk-felSA_eV.js.map +0 -1
- package/dist/admin/chunks/zh-BUVXH75-.mjs.map +0 -1
- package/dist/admin/chunks/zh-CWj4avQA.js.map +0 -1
- package/dist/admin/chunks/zh-Hans-BElOnuRb.mjs.map +0 -1
- package/dist/admin/chunks/zh-Hans-lXbNiMp9.js.map +0 -1
|
@@ -0,0 +1,910 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useStrapiApp, useNotification, useTracking } from '@strapi/admin/strapi-admin';
|
|
4
|
+
import { Modal, Tabs, Flex, Divider, Button } from '@strapi/design-system';
|
|
5
|
+
import get from 'lodash/get';
|
|
6
|
+
import has from 'lodash/has';
|
|
7
|
+
import isEqual from 'lodash/isEqual';
|
|
8
|
+
import set from 'lodash/set';
|
|
9
|
+
import toLower from 'lodash/toLower';
|
|
10
|
+
import { useIntl } from 'react-intl';
|
|
11
|
+
import { useDispatch, useSelector, shallowEqual } from 'react-redux';
|
|
12
|
+
import { useNavigate } from 'react-router-dom';
|
|
13
|
+
import { styled } from 'styled-components';
|
|
14
|
+
import { useDataManager } from '../../hooks/useDataManager.mjs';
|
|
15
|
+
import { useFormModalNavigation } from '../../hooks/useFormModalNavigation.mjs';
|
|
16
|
+
import { pluginId } from '../../pluginId.mjs';
|
|
17
|
+
import { getTrad } from '../../utils/getTrad.mjs';
|
|
18
|
+
import { isAllowedContentTypesForRelations } from '../../utils/isAllowedContentTypesForRelations.mjs';
|
|
19
|
+
import { findAttribute } from '../../utils/findAttribute.mjs';
|
|
20
|
+
import { getYupInnerErrors } from '../../utils/getYupInnerErrors.mjs';
|
|
21
|
+
import { AllowedTypesSelect } from '../AllowedTypesSelect.mjs';
|
|
22
|
+
import { AttributeOptions } from '../AttributeOptions/AttributeOptions.mjs';
|
|
23
|
+
import { BooleanDefaultValueSelect } from '../BooleanDefaultValueSelect.mjs';
|
|
24
|
+
import { BooleanRadioGroup } from '../BooleanRadioGroup.mjs';
|
|
25
|
+
import { CheckboxWithNumberField } from '../CheckboxWithNumberField.mjs';
|
|
26
|
+
import { ContentTypeRadioGroup } from '../ContentTypeRadioGroup.mjs';
|
|
27
|
+
import { CustomRadioGroup } from '../CustomRadioGroup/CustomRadioGroup.mjs';
|
|
28
|
+
import { DraftAndPublishToggle } from '../DraftAndPublishToggle.mjs';
|
|
29
|
+
import { FormModalEndActions } from '../FormModalEndActions.mjs';
|
|
30
|
+
import { FormModalHeader } from '../FormModalHeader.mjs';
|
|
31
|
+
import { FormModalSubHeader } from '../FormModalSubHeader.mjs';
|
|
32
|
+
import { IconPicker } from '../IconPicker/IconPicker.mjs';
|
|
33
|
+
import { PluralName } from '../PluralName.mjs';
|
|
34
|
+
import { Relation } from '../Relation/Relation.mjs';
|
|
35
|
+
import { SelectCategory } from '../SelectCategory.mjs';
|
|
36
|
+
import { SelectComponent } from '../SelectComponent.mjs';
|
|
37
|
+
import { SelectComponents } from '../SelectComponents.mjs';
|
|
38
|
+
import { SelectDateType } from '../SelectDateType.mjs';
|
|
39
|
+
import { SelectNumber } from '../SelectNumber.mjs';
|
|
40
|
+
import { SingularName } from '../SingularName.mjs';
|
|
41
|
+
import { TabForm } from '../TabForm.mjs';
|
|
42
|
+
import { TextareaEnum } from '../TextareaEnum.mjs';
|
|
43
|
+
import { forms } from './forms/forms.mjs';
|
|
44
|
+
import { actions } from './reducer.mjs';
|
|
45
|
+
import { makeSelectFormModal } from './selectors.mjs';
|
|
46
|
+
import { canEditContentType } from './utils/canEditContentType.mjs';
|
|
47
|
+
import { createUid, createComponentUid } from './utils/createUid.mjs';
|
|
48
|
+
import { getAttributesToDisplay } from './utils/getAttributesToDisplay.mjs';
|
|
49
|
+
import { getFormInputNames } from './utils/getFormInputNames.mjs';
|
|
50
|
+
|
|
51
|
+
/* eslint-disable indent */ /* eslint-disable react/no-array-index-key */ const FormComponent = styled.form`
|
|
52
|
+
overflow: auto;
|
|
53
|
+
`;
|
|
54
|
+
const FormModal = ()=>{
|
|
55
|
+
const { onCloseModal, onNavigateToChooseAttributeModal, onNavigateToAddCompoToDZModal, onNavigateToCreateComponentStep2, actionType, attributeName, attributeType, customFieldUid, categoryName, dynamicZoneTarget, forTarget, modalType, isOpen, kind, step, targetUid, showBackLink, activeTab, setActiveTab } = useFormModalNavigation();
|
|
56
|
+
const getPlugin = useStrapiApp('FormModal', (state)=>state.getPlugin);
|
|
57
|
+
const getCustomField = useStrapiApp('FormModal', (state)=>state.customFields.get);
|
|
58
|
+
const customField = getCustomField(customFieldUid);
|
|
59
|
+
const formModalSelector = React.useMemo(makeSelectFormModal, []);
|
|
60
|
+
const dispatch = useDispatch();
|
|
61
|
+
const { toggleNotification } = useNotification();
|
|
62
|
+
const reducerState = useSelector((state)=>formModalSelector(state), shallowEqual);
|
|
63
|
+
const navigate = useNavigate();
|
|
64
|
+
const { trackUsage } = useTracking();
|
|
65
|
+
const { formatMessage } = useIntl();
|
|
66
|
+
const ctbPlugin = getPlugin(pluginId);
|
|
67
|
+
const ctbFormsAPI = ctbPlugin?.apis.forms;
|
|
68
|
+
const inputsFromPlugins = ctbFormsAPI.components.inputs;
|
|
69
|
+
const { addAttribute, addCustomFieldAttribute, addCreatedComponentToDynamicZone, allComponentsCategories, changeDynamicZoneComponents, contentTypes, components, createSchema, deleteCategory, deleteData, editCategory, editCustomFieldAttribute, submitData, modifiedData: allDataSchema, nestedComponents, setModifiedData, sortedContentTypesList, updateSchema, reservedNames } = useDataManager();
|
|
70
|
+
const { componentToCreate, formErrors, initialData, isCreatingComponentWhileAddingAField, modifiedData } = reducerState;
|
|
71
|
+
const pathToSchema = forTarget === 'contentType' || forTarget === 'component' ? [
|
|
72
|
+
forTarget
|
|
73
|
+
] : [
|
|
74
|
+
forTarget,
|
|
75
|
+
targetUid
|
|
76
|
+
];
|
|
77
|
+
React.useEffect(()=>{
|
|
78
|
+
if (isOpen) {
|
|
79
|
+
const collectionTypesForRelation = sortedContentTypesList.filter(isAllowedContentTypesForRelations);
|
|
80
|
+
// Reset all the modification when opening the edit category modal
|
|
81
|
+
if (modalType === 'editCategory') {
|
|
82
|
+
setModifiedData();
|
|
83
|
+
}
|
|
84
|
+
if (actionType === 'edit' && modalType === 'attribute' && forTarget === 'contentType') {
|
|
85
|
+
trackUsage('willEditFieldOfContentType');
|
|
86
|
+
}
|
|
87
|
+
const pathToAttributes = [
|
|
88
|
+
...pathToSchema,
|
|
89
|
+
'schema',
|
|
90
|
+
'attributes'
|
|
91
|
+
];
|
|
92
|
+
// Case:
|
|
93
|
+
// the user opens the modal chooseAttributes
|
|
94
|
+
// selects dynamic zone => set the field name
|
|
95
|
+
// then goes to step 1 (the modal is addComponentToDynamicZone) and finally reloads the app.
|
|
96
|
+
// In this particular if the user tries to add components to the zone it will pop an error since the dz is unknown
|
|
97
|
+
const foundDynamicZoneTarget = findAttribute(get(allDataSchema, pathToAttributes, []), dynamicZoneTarget) || null;
|
|
98
|
+
// Edit category
|
|
99
|
+
if (modalType === 'editCategory' && actionType === 'edit') {
|
|
100
|
+
dispatch(actions.setDataToEdit({
|
|
101
|
+
data: {
|
|
102
|
+
name: categoryName
|
|
103
|
+
}
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
// Create content type we need to add the default option draftAndPublish
|
|
107
|
+
if (modalType === 'contentType' && actionType === 'create') {
|
|
108
|
+
dispatch(actions.setDataToEdit({
|
|
109
|
+
data: {
|
|
110
|
+
draftAndPublish: true
|
|
111
|
+
}
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
// Edit content type
|
|
115
|
+
if (modalType === 'contentType' && actionType === 'edit') {
|
|
116
|
+
const { displayName, draftAndPublish, kind, pluginOptions, pluralName, singularName } = get(allDataSchema, [
|
|
117
|
+
...pathToSchema,
|
|
118
|
+
'schema'
|
|
119
|
+
], {
|
|
120
|
+
displayName: null,
|
|
121
|
+
pluginOptions: {},
|
|
122
|
+
singularName: null,
|
|
123
|
+
pluralName: null
|
|
124
|
+
});
|
|
125
|
+
dispatch(actions.setDataToEdit({
|
|
126
|
+
data: {
|
|
127
|
+
displayName,
|
|
128
|
+
draftAndPublish,
|
|
129
|
+
kind,
|
|
130
|
+
pluginOptions,
|
|
131
|
+
pluralName,
|
|
132
|
+
singularName
|
|
133
|
+
}
|
|
134
|
+
}));
|
|
135
|
+
}
|
|
136
|
+
// Edit component
|
|
137
|
+
if (modalType === 'component' && actionType === 'edit') {
|
|
138
|
+
const data = get(allDataSchema, pathToSchema, {});
|
|
139
|
+
dispatch(actions.setDataToEdit({
|
|
140
|
+
data: {
|
|
141
|
+
displayName: data.schema.displayName,
|
|
142
|
+
category: data.category,
|
|
143
|
+
icon: data.schema.icon
|
|
144
|
+
}
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
// Special case for the dynamic zone
|
|
148
|
+
if (modalType === 'addComponentToDynamicZone' && actionType === 'edit') {
|
|
149
|
+
const attributeToEdit = {
|
|
150
|
+
...foundDynamicZoneTarget,
|
|
151
|
+
// We filter the available components
|
|
152
|
+
// Because this modal is only used for adding components
|
|
153
|
+
components: [],
|
|
154
|
+
name: dynamicZoneTarget,
|
|
155
|
+
createComponent: false,
|
|
156
|
+
componentToCreate: {
|
|
157
|
+
type: 'component'
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
dispatch(actions.setDynamicZoneDataSchema({
|
|
161
|
+
attributeToEdit
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
// Set the predefined data structure to create an attribute
|
|
165
|
+
if (attributeType) {
|
|
166
|
+
const attributeToEditNotFormatted = findAttribute(get(allDataSchema, pathToAttributes, []), attributeName);
|
|
167
|
+
const attributeToEdit = {
|
|
168
|
+
...attributeToEditNotFormatted,
|
|
169
|
+
name: attributeName
|
|
170
|
+
};
|
|
171
|
+
// We need to set the repeatable key to false when editing a component
|
|
172
|
+
// The API doesn't send this info
|
|
173
|
+
if (attributeType === 'component' && actionType === 'edit') {
|
|
174
|
+
if (!attributeToEdit.repeatable) {
|
|
175
|
+
set(attributeToEdit, 'repeatable', false);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (modalType === 'customField') {
|
|
179
|
+
if (actionType === 'edit') {
|
|
180
|
+
dispatch(actions.setCustomFieldDataSchema({
|
|
181
|
+
isEditing: true,
|
|
182
|
+
modifiedDataToSetForEditing: attributeToEdit
|
|
183
|
+
}));
|
|
184
|
+
} else {
|
|
185
|
+
dispatch(actions.setCustomFieldDataSchema({
|
|
186
|
+
customField: customField,
|
|
187
|
+
isEditing: false,
|
|
188
|
+
modifiedDataToSetForEditing: attributeToEdit
|
|
189
|
+
}));
|
|
190
|
+
}
|
|
191
|
+
} else {
|
|
192
|
+
dispatch(actions.setAttributeDataSchema({
|
|
193
|
+
attributeType,
|
|
194
|
+
nameToSetForRelation: get(collectionTypesForRelation, [
|
|
195
|
+
'0',
|
|
196
|
+
'title'
|
|
197
|
+
], 'error'),
|
|
198
|
+
targetUid: get(collectionTypesForRelation, [
|
|
199
|
+
'0',
|
|
200
|
+
'uid'
|
|
201
|
+
], 'error'),
|
|
202
|
+
isEditing: actionType === 'edit',
|
|
203
|
+
modifiedDataToSetForEditing: attributeToEdit,
|
|
204
|
+
step
|
|
205
|
+
}));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
} else {
|
|
209
|
+
dispatch(actions.resetProps());
|
|
210
|
+
}
|
|
211
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
212
|
+
}, [
|
|
213
|
+
actionType,
|
|
214
|
+
attributeName,
|
|
215
|
+
attributeType,
|
|
216
|
+
categoryName,
|
|
217
|
+
dynamicZoneTarget,
|
|
218
|
+
forTarget,
|
|
219
|
+
isOpen,
|
|
220
|
+
modalType
|
|
221
|
+
]);
|
|
222
|
+
const isCreatingContentType = modalType === 'contentType';
|
|
223
|
+
const isCreatingComponent = modalType === 'component';
|
|
224
|
+
const isCreatingAttribute = modalType === 'attribute';
|
|
225
|
+
const isCreatingCustomFieldAttribute = modalType === 'customField';
|
|
226
|
+
const isComponentAttribute = attributeType === 'component' && isCreatingAttribute;
|
|
227
|
+
const isCreating = actionType === 'create';
|
|
228
|
+
const isCreatingComponentFromAView = get(modifiedData, 'createComponent', false) || isCreatingComponentWhileAddingAField;
|
|
229
|
+
const isInFirstComponentStep = step === '1';
|
|
230
|
+
const isEditingCategory = modalType === 'editCategory';
|
|
231
|
+
const isPickingAttribute = modalType === 'chooseAttribute';
|
|
232
|
+
const uid = createUid(modifiedData.displayName || '');
|
|
233
|
+
const attributes = get(allDataSchema, [
|
|
234
|
+
...pathToSchema,
|
|
235
|
+
'schema',
|
|
236
|
+
'attributes'
|
|
237
|
+
], null);
|
|
238
|
+
const checkFormValidity = async ()=>{
|
|
239
|
+
let schema;
|
|
240
|
+
const dataToValidate = isCreatingComponentFromAView && step === '1' ? get(modifiedData, 'componentToCreate', {}) : modifiedData;
|
|
241
|
+
// Check form validity for content type
|
|
242
|
+
if (isCreatingContentType) {
|
|
243
|
+
schema = forms.contentType.schema(Object.keys(contentTypes), actionType === 'edit', // currentUID
|
|
244
|
+
get(allDataSchema, [
|
|
245
|
+
...pathToSchema,
|
|
246
|
+
'uid'
|
|
247
|
+
], null), reservedNames, ctbFormsAPI, contentTypes);
|
|
248
|
+
// Check form validity for component
|
|
249
|
+
// This is happening when the user click on the link from the left menu
|
|
250
|
+
} else if (isCreatingComponent) {
|
|
251
|
+
schema = forms.component.schema(Object.keys(components), modifiedData.category || '', reservedNames, actionType === 'edit', components, modifiedData.displayName || '', get(allDataSchema, [
|
|
252
|
+
...pathToSchema,
|
|
253
|
+
'uid'
|
|
254
|
+
], null));
|
|
255
|
+
} else if (isCreatingCustomFieldAttribute) {
|
|
256
|
+
schema = forms.customField.schema({
|
|
257
|
+
schemaAttributes: get(allDataSchema, [
|
|
258
|
+
...pathToSchema,
|
|
259
|
+
'schema',
|
|
260
|
+
'attributes'
|
|
261
|
+
], []),
|
|
262
|
+
attributeType: customField.type,
|
|
263
|
+
reservedNames,
|
|
264
|
+
schemaData: {
|
|
265
|
+
modifiedData,
|
|
266
|
+
initialData
|
|
267
|
+
},
|
|
268
|
+
ctbFormsAPI,
|
|
269
|
+
customFieldValidator: customField.options?.validator
|
|
270
|
+
});
|
|
271
|
+
// Check for validity for creating a component
|
|
272
|
+
// This is happening when the user creates a component "on the fly"
|
|
273
|
+
// Since we temporarily store the component info in another object
|
|
274
|
+
// The data is set in the componentToCreate key
|
|
275
|
+
} else if (isComponentAttribute && isCreatingComponentFromAView && isInFirstComponentStep) {
|
|
276
|
+
schema = forms.component.schema(Object.keys(components), get(modifiedData, 'componentToCreate.category', ''), reservedNames, actionType === 'edit', components, modifiedData.componentToCreate.displayName || '');
|
|
277
|
+
// Check form validity for creating a 'common attribute'
|
|
278
|
+
// We need to make sure that it is independent from the step
|
|
279
|
+
} else if (isCreatingAttribute && !isInFirstComponentStep) {
|
|
280
|
+
const type = attributeType === 'relation' ? 'relation' : modifiedData.type;
|
|
281
|
+
let alreadyTakenTargetContentTypeAttributes = [];
|
|
282
|
+
if (type === 'relation') {
|
|
283
|
+
const targetContentTypeUID = get(modifiedData, [
|
|
284
|
+
'target'
|
|
285
|
+
], null);
|
|
286
|
+
const targetContentTypeAttributes = get(contentTypes, [
|
|
287
|
+
targetContentTypeUID,
|
|
288
|
+
'schema',
|
|
289
|
+
'attributes'
|
|
290
|
+
], []);
|
|
291
|
+
// Create an array with all the targetContentType attributes name
|
|
292
|
+
// in order to prevent the user from creating a relation with a targetAttribute
|
|
293
|
+
// that may exist in the other content type
|
|
294
|
+
alreadyTakenTargetContentTypeAttributes = targetContentTypeAttributes.filter(({ name: attrName })=>{
|
|
295
|
+
// Keep all the target content type attributes when creating a relation
|
|
296
|
+
if (actionType !== 'edit') {
|
|
297
|
+
return true;
|
|
298
|
+
}
|
|
299
|
+
// Remove the already created one when editing
|
|
300
|
+
return attrName !== initialData.targetAttribute;
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
schema = forms.attribute.schema(get(allDataSchema, pathToSchema, {}), type, reservedNames, alreadyTakenTargetContentTypeAttributes, {
|
|
304
|
+
modifiedData,
|
|
305
|
+
initialData
|
|
306
|
+
}, ctbFormsAPI);
|
|
307
|
+
} else if (isEditingCategory) {
|
|
308
|
+
schema = forms.editCategory.schema(allComponentsCategories, initialData);
|
|
309
|
+
} else {
|
|
310
|
+
// The user is either in the addComponentToDynamicZone modal or
|
|
311
|
+
// in step 1 of the add component (modalType=attribute&attributeType=component) but not creating a component
|
|
312
|
+
// eslint-disable-next-line no-lonely-if
|
|
313
|
+
if (isInFirstComponentStep && isCreatingComponentFromAView) {
|
|
314
|
+
schema = forms.component.schema(Object.keys(components), get(modifiedData, 'componentToCreate.category', ''), reservedNames, actionType === 'edit', components, modifiedData.componentToCreate.displayName || '');
|
|
315
|
+
} else {
|
|
316
|
+
// The form is valid
|
|
317
|
+
// The case here is being in the addComponentToDynamicZone modal and not creating a component
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
await schema.validate(dataToValidate, {
|
|
322
|
+
abortEarly: false
|
|
323
|
+
});
|
|
324
|
+
};
|
|
325
|
+
const handleChange = React.useCallback(({ target: { name, value, type, ...rest } })=>{
|
|
326
|
+
const namesThatCanResetToNullValue = [
|
|
327
|
+
'enumName',
|
|
328
|
+
'max',
|
|
329
|
+
'min',
|
|
330
|
+
'maxLength',
|
|
331
|
+
'minLength',
|
|
332
|
+
'regex',
|
|
333
|
+
'default'
|
|
334
|
+
];
|
|
335
|
+
let val;
|
|
336
|
+
if (namesThatCanResetToNullValue.includes(name) && value === '') {
|
|
337
|
+
val = null;
|
|
338
|
+
} else {
|
|
339
|
+
val = value;
|
|
340
|
+
}
|
|
341
|
+
const clonedErrors = Object.assign({}, formErrors);
|
|
342
|
+
// Reset min error when modifying the max
|
|
343
|
+
if (name === 'max') {
|
|
344
|
+
delete clonedErrors.min;
|
|
345
|
+
}
|
|
346
|
+
// Same here
|
|
347
|
+
if (name === 'maxLength') {
|
|
348
|
+
delete clonedErrors.minLength;
|
|
349
|
+
}
|
|
350
|
+
// Since the onBlur is deactivated we remove the errors directly when changing an input
|
|
351
|
+
delete clonedErrors[name];
|
|
352
|
+
dispatch(actions.setErrors({
|
|
353
|
+
errors: clonedErrors
|
|
354
|
+
}));
|
|
355
|
+
dispatch(actions.onChange({
|
|
356
|
+
keys: name.split('.'),
|
|
357
|
+
value: val
|
|
358
|
+
}));
|
|
359
|
+
}, [
|
|
360
|
+
dispatch,
|
|
361
|
+
formErrors
|
|
362
|
+
]);
|
|
363
|
+
const handleSubmit = async (e, shouldContinue = isCreating)=>{
|
|
364
|
+
e.preventDefault();
|
|
365
|
+
try {
|
|
366
|
+
await checkFormValidity();
|
|
367
|
+
sendButtonAddMoreFieldEvent(shouldContinue);
|
|
368
|
+
const ctTargetUid = forTarget === 'components' ? targetUid : uid;
|
|
369
|
+
if (isCreatingContentType) {
|
|
370
|
+
// Create the content type schema
|
|
371
|
+
if (isCreating) {
|
|
372
|
+
createSchema({
|
|
373
|
+
...modifiedData,
|
|
374
|
+
kind
|
|
375
|
+
}, modalType, uid);
|
|
376
|
+
// Redirect the user to the created content type
|
|
377
|
+
navigate({
|
|
378
|
+
pathname: `/plugins/${pluginId}/content-types/${uid}`
|
|
379
|
+
});
|
|
380
|
+
// Navigate to the choose attribute modal
|
|
381
|
+
onNavigateToChooseAttributeModal({
|
|
382
|
+
forTarget,
|
|
383
|
+
targetUid: ctTargetUid
|
|
384
|
+
});
|
|
385
|
+
} else {
|
|
386
|
+
// We cannot switch from collection type to single when the modal is making relations other than oneWay or manyWay
|
|
387
|
+
if (canEditContentType(allDataSchema, modifiedData)) {
|
|
388
|
+
onCloseModal();
|
|
389
|
+
await submitData(modifiedData);
|
|
390
|
+
} else {
|
|
391
|
+
toggleNotification({
|
|
392
|
+
type: 'danger',
|
|
393
|
+
message: formatMessage({
|
|
394
|
+
id: 'notification.contentType.relations.conflict'
|
|
395
|
+
})
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
// We are creating a component using the component modal from the left menu
|
|
401
|
+
} else if (modalType === 'component') {
|
|
402
|
+
if (isCreating) {
|
|
403
|
+
// Create the component schema
|
|
404
|
+
const componentUid = createComponentUid(modifiedData.displayName, modifiedData.category);
|
|
405
|
+
const { category, ...rest } = modifiedData;
|
|
406
|
+
createSchema(rest, 'component', componentUid, category);
|
|
407
|
+
// Redirect the user to the created component
|
|
408
|
+
navigate({
|
|
409
|
+
pathname: `/plugins/${pluginId}/component-categories/${category}/${componentUid}`
|
|
410
|
+
});
|
|
411
|
+
// Navigate to the choose attribute modal
|
|
412
|
+
onNavigateToChooseAttributeModal({
|
|
413
|
+
forTarget,
|
|
414
|
+
targetUid: componentUid
|
|
415
|
+
});
|
|
416
|
+
} else {
|
|
417
|
+
updateSchema(modifiedData, modalType, targetUid);
|
|
418
|
+
// Close the modal
|
|
419
|
+
onCloseModal();
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
} else if (isEditingCategory) {
|
|
423
|
+
if (toLower(initialData.name) === toLower(modifiedData.name)) {
|
|
424
|
+
// Close the modal
|
|
425
|
+
onCloseModal();
|
|
426
|
+
return;
|
|
427
|
+
}
|
|
428
|
+
editCategory(initialData.name, modifiedData);
|
|
429
|
+
return;
|
|
430
|
+
// Add/edit a field to a content type
|
|
431
|
+
// Add/edit a field to a created component (the end modal is not step 2)
|
|
432
|
+
} else if (isCreatingCustomFieldAttribute) {
|
|
433
|
+
const customFieldAttributeUpdate = {
|
|
434
|
+
attributeToSet: {
|
|
435
|
+
...modifiedData,
|
|
436
|
+
customField: customFieldUid
|
|
437
|
+
},
|
|
438
|
+
forTarget,
|
|
439
|
+
targetUid,
|
|
440
|
+
initialAttribute: initialData
|
|
441
|
+
};
|
|
442
|
+
if (actionType === 'edit') {
|
|
443
|
+
editCustomFieldAttribute(customFieldAttributeUpdate);
|
|
444
|
+
} else {
|
|
445
|
+
addCustomFieldAttribute(customFieldAttributeUpdate);
|
|
446
|
+
}
|
|
447
|
+
if (shouldContinue) {
|
|
448
|
+
onNavigateToChooseAttributeModal({
|
|
449
|
+
forTarget,
|
|
450
|
+
targetUid: ctTargetUid
|
|
451
|
+
});
|
|
452
|
+
} else {
|
|
453
|
+
onCloseModal();
|
|
454
|
+
}
|
|
455
|
+
return;
|
|
456
|
+
} else if (isCreatingAttribute && !isCreatingComponentFromAView) {
|
|
457
|
+
const isDynamicZoneAttribute = attributeType === 'dynamiczone';
|
|
458
|
+
// The user is creating a DZ (he had entered the name of the dz)
|
|
459
|
+
if (isDynamicZoneAttribute) {
|
|
460
|
+
addAttribute(modifiedData, forTarget, targetUid, actionType === 'edit', initialData);
|
|
461
|
+
// Adding a component to a dynamiczone is not the same logic as creating a simple field
|
|
462
|
+
// so the search is different
|
|
463
|
+
if (isCreating) {
|
|
464
|
+
// Step 1 of adding a component to a DZ, the user has the option to create a component
|
|
465
|
+
dispatch(actions.resetPropsAndSetTheFormForAddingACompoToADz());
|
|
466
|
+
setActiveTab('basic');
|
|
467
|
+
onNavigateToAddCompoToDZModal({
|
|
468
|
+
dynamicZoneTarget: modifiedData.name
|
|
469
|
+
});
|
|
470
|
+
} else {
|
|
471
|
+
onCloseModal();
|
|
472
|
+
}
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
// Normal fields like boolean relations or dynamic zone
|
|
476
|
+
if (!isComponentAttribute) {
|
|
477
|
+
addAttribute(modifiedData, forTarget, targetUid, actionType === 'edit', initialData);
|
|
478
|
+
if (shouldContinue) {
|
|
479
|
+
onNavigateToChooseAttributeModal({
|
|
480
|
+
forTarget,
|
|
481
|
+
targetUid: ctTargetUid
|
|
482
|
+
});
|
|
483
|
+
} else {
|
|
484
|
+
onCloseModal();
|
|
485
|
+
}
|
|
486
|
+
return;
|
|
487
|
+
// Adding an existing component
|
|
488
|
+
}
|
|
489
|
+
// eslint-disable-next-line no-lonely-if
|
|
490
|
+
if (isInFirstComponentStep) {
|
|
491
|
+
// Navigate the user to step 2
|
|
492
|
+
onNavigateToCreateComponentStep2();
|
|
493
|
+
// Clear the reducer and prepare the modified data
|
|
494
|
+
// This way we don't have to add some logic to re-run the useEffect
|
|
495
|
+
// The first step is either needed to create a component or just to navigate
|
|
496
|
+
// To the modal for adding a "common field"
|
|
497
|
+
dispatch(actions.resetPropsAndSetFormForAddingAnExistingCompo({}));
|
|
498
|
+
// We don't want all the props to be reset
|
|
499
|
+
return;
|
|
500
|
+
// Here we are in step 2
|
|
501
|
+
// The step 2 is also use to edit an attribute that is a component
|
|
502
|
+
}
|
|
503
|
+
addAttribute(modifiedData, forTarget, targetUid, // This change the dispatched type
|
|
504
|
+
// either 'editAttribute' or 'addAttribute' in the DataManagerProvider
|
|
505
|
+
actionType === 'edit', // This is for the edit part
|
|
506
|
+
initialData, // Passing true will add the component to the components object
|
|
507
|
+
// This way we can add fields to the added component (if it wasn't there already)
|
|
508
|
+
true);
|
|
509
|
+
if (shouldContinue) {
|
|
510
|
+
onNavigateToChooseAttributeModal({
|
|
511
|
+
forTarget,
|
|
512
|
+
targetUid
|
|
513
|
+
});
|
|
514
|
+
} else {
|
|
515
|
+
onCloseModal();
|
|
516
|
+
}
|
|
517
|
+
// We don't need to end the loop here we want the reducer to be reinitialized
|
|
518
|
+
// Logic for creating a component without clicking on the link in
|
|
519
|
+
// the left menu
|
|
520
|
+
// We need to separate the logic otherwise the component would be created
|
|
521
|
+
// even though the user didn't set any field
|
|
522
|
+
// We need to prevent the component from being created if the user closes the modal at step 2 without any submission
|
|
523
|
+
} else if (isCreatingAttribute && isCreatingComponentFromAView) {
|
|
524
|
+
// Step 1
|
|
525
|
+
if (isInFirstComponentStep) {
|
|
526
|
+
// Here the search could be refactored since it is the same as the case from above
|
|
527
|
+
// Navigate the user to step 2
|
|
528
|
+
trackUsage('willCreateComponentFromAttributesModal');
|
|
529
|
+
// Here we clear the reducer state but we also keep the created component
|
|
530
|
+
// If we were to create the component before
|
|
531
|
+
dispatch(actions.resetPropsAndSaveCurrentData({}));
|
|
532
|
+
onNavigateToCreateComponentStep2();
|
|
533
|
+
// Terminate because we don't want the reducer to be entirely reset
|
|
534
|
+
return;
|
|
535
|
+
// Step 2 of creating a component (which is setting the attribute name in the parent's schema)
|
|
536
|
+
}
|
|
537
|
+
// We are destructuring because the modifiedData object doesn't have the appropriate format to create a field
|
|
538
|
+
const { category, type, ...rest } = componentToCreate;
|
|
539
|
+
// Create a the component temp UID
|
|
540
|
+
// This could be refactored but I think it's more understandable to separate the logic
|
|
541
|
+
const componentUid = createComponentUid(componentToCreate.displayName, category);
|
|
542
|
+
// Create the component first and add it to the components data
|
|
543
|
+
createSchema(// Component data
|
|
544
|
+
rest, // Type will always be component
|
|
545
|
+
// It will dispatch the CREATE_COMPONENT_SCHEMA action
|
|
546
|
+
// So the component will be added in the main components object
|
|
547
|
+
// This might not be needed if we don't allow navigation between entries while editing
|
|
548
|
+
type, componentUid, category, // This will add the created component in the datamanager modifiedData components key
|
|
549
|
+
// Like explained above we will be able to modify the created component structure
|
|
550
|
+
isCreatingComponentFromAView);
|
|
551
|
+
// Add the field to the schema
|
|
552
|
+
addAttribute(modifiedData, forTarget, targetUid, false);
|
|
553
|
+
dispatch(actions.resetProps());
|
|
554
|
+
// Open modal attribute for adding attr to component
|
|
555
|
+
if (shouldContinue) {
|
|
556
|
+
onNavigateToChooseAttributeModal({
|
|
557
|
+
forTarget: 'components',
|
|
558
|
+
targetUid: componentUid
|
|
559
|
+
});
|
|
560
|
+
} else {
|
|
561
|
+
onCloseModal();
|
|
562
|
+
}
|
|
563
|
+
return;
|
|
564
|
+
} else {
|
|
565
|
+
// The modal is addComponentToDynamicZone
|
|
566
|
+
if (isInFirstComponentStep) {
|
|
567
|
+
if (isCreatingComponentFromAView) {
|
|
568
|
+
const { category, type, ...rest } = modifiedData.componentToCreate;
|
|
569
|
+
const componentUid = createComponentUid(modifiedData.componentToCreate.displayName, category);
|
|
570
|
+
// Create the component first and add it to the components data
|
|
571
|
+
createSchema(// Component data
|
|
572
|
+
rest, // Type will always be component
|
|
573
|
+
// It will dispatch the CREATE_COMPONENT_SCHEMA action
|
|
574
|
+
// So the component will be added in the main components object
|
|
575
|
+
// This might not be needed if we don't allow navigation between entries while editing
|
|
576
|
+
type, componentUid, category, // This will add the created component in the datamanager modifiedData components key
|
|
577
|
+
// Like explained above we will be able to modify the created component structure
|
|
578
|
+
isCreatingComponentFromAView);
|
|
579
|
+
// Add the created component to the DZ
|
|
580
|
+
// We don't want to remove the old ones
|
|
581
|
+
addCreatedComponentToDynamicZone(dynamicZoneTarget, [
|
|
582
|
+
componentUid
|
|
583
|
+
]);
|
|
584
|
+
// The Dynamic Zone and the component is created
|
|
585
|
+
// Open the modal to add fields to the created component
|
|
586
|
+
onNavigateToChooseAttributeModal({
|
|
587
|
+
forTarget: 'components',
|
|
588
|
+
targetUid: componentUid
|
|
589
|
+
});
|
|
590
|
+
} else {
|
|
591
|
+
// Add the components to the DZ
|
|
592
|
+
changeDynamicZoneComponents(dynamicZoneTarget, modifiedData.components);
|
|
593
|
+
onCloseModal();
|
|
594
|
+
}
|
|
595
|
+
} else {
|
|
596
|
+
console.error('This case is not handled');
|
|
597
|
+
}
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
dispatch(actions.resetProps());
|
|
601
|
+
} catch (err) {
|
|
602
|
+
const errors = getYupInnerErrors(err);
|
|
603
|
+
dispatch(actions.setErrors({
|
|
604
|
+
errors
|
|
605
|
+
}));
|
|
606
|
+
}
|
|
607
|
+
};
|
|
608
|
+
const handleConfirmClose = ()=>{
|
|
609
|
+
// eslint-disable-next-line no-alert
|
|
610
|
+
const confirm = window.confirm(formatMessage({
|
|
611
|
+
id: 'window.confirm.close-modal.file',
|
|
612
|
+
defaultMessage: 'Are you sure? Your changes will be lost.'
|
|
613
|
+
}));
|
|
614
|
+
if (confirm) {
|
|
615
|
+
onCloseModal();
|
|
616
|
+
dispatch(actions.resetProps());
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
const handleClosed = ()=>{
|
|
620
|
+
// Close the modal
|
|
621
|
+
if (!isEqual(modifiedData, initialData)) {
|
|
622
|
+
handleConfirmClose();
|
|
623
|
+
} else {
|
|
624
|
+
onCloseModal();
|
|
625
|
+
// Reset the reducer
|
|
626
|
+
dispatch(actions.resetProps());
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
const sendAdvancedTabEvent = (tab)=>{
|
|
630
|
+
if (tab !== 'advanced') {
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
if (isCreatingContentType) {
|
|
634
|
+
trackUsage('didSelectContentTypeSettings');
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
if (forTarget === 'contentType') {
|
|
638
|
+
trackUsage('didSelectContentTypeFieldSettings');
|
|
639
|
+
}
|
|
640
|
+
};
|
|
641
|
+
const sendButtonAddMoreFieldEvent = (shouldContinue)=>{
|
|
642
|
+
if (modalType === 'attribute' && forTarget === 'contentType' && attributeType !== 'dynamiczone' && shouldContinue) {
|
|
643
|
+
trackUsage('willAddMoreFieldToContentType');
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
const shouldDisableAdvancedTab = ()=>{
|
|
647
|
+
if (modalType === 'editCategory') {
|
|
648
|
+
return true;
|
|
649
|
+
}
|
|
650
|
+
if (modalType === 'component') {
|
|
651
|
+
return true;
|
|
652
|
+
}
|
|
653
|
+
if (has(modifiedData, 'createComponent')) {
|
|
654
|
+
return true;
|
|
655
|
+
}
|
|
656
|
+
return false;
|
|
657
|
+
};
|
|
658
|
+
// Display data for the attributes picker modal
|
|
659
|
+
const displayedAttributes = getAttributesToDisplay(forTarget, targetUid, // We need the nested components so we know when to remove the component option
|
|
660
|
+
nestedComponents);
|
|
661
|
+
if (!modalType) {
|
|
662
|
+
return null;
|
|
663
|
+
}
|
|
664
|
+
const formToDisplay = get(forms, [
|
|
665
|
+
modalType,
|
|
666
|
+
'form'
|
|
667
|
+
], {
|
|
668
|
+
advanced: ()=>({
|
|
669
|
+
sections: []
|
|
670
|
+
}),
|
|
671
|
+
base: ()=>({
|
|
672
|
+
sections: []
|
|
673
|
+
})
|
|
674
|
+
});
|
|
675
|
+
const isAddingAComponentToAnotherComponent = forTarget === 'components' || forTarget === 'component';
|
|
676
|
+
const genericInputProps = {
|
|
677
|
+
customInputs: {
|
|
678
|
+
'allowed-types-select': AllowedTypesSelect,
|
|
679
|
+
'boolean-radio-group': BooleanRadioGroup,
|
|
680
|
+
'checkbox-with-number-field': CheckboxWithNumberField,
|
|
681
|
+
'icon-picker': IconPicker,
|
|
682
|
+
'content-type-radio-group': ContentTypeRadioGroup,
|
|
683
|
+
'radio-group': CustomRadioGroup,
|
|
684
|
+
relation: Relation,
|
|
685
|
+
'select-category': SelectCategory,
|
|
686
|
+
'select-component': SelectComponent,
|
|
687
|
+
'select-components': SelectComponents,
|
|
688
|
+
'select-default-boolean': BooleanDefaultValueSelect,
|
|
689
|
+
'select-number': SelectNumber,
|
|
690
|
+
'select-date': SelectDateType,
|
|
691
|
+
'toggle-draft-publish': DraftAndPublishToggle,
|
|
692
|
+
'text-plural': PluralName,
|
|
693
|
+
'text-singular': SingularName,
|
|
694
|
+
'textarea-enum': TextareaEnum,
|
|
695
|
+
...inputsFromPlugins
|
|
696
|
+
},
|
|
697
|
+
componentToCreate,
|
|
698
|
+
dynamicZoneTarget,
|
|
699
|
+
formErrors,
|
|
700
|
+
isAddingAComponentToAnotherComponent,
|
|
701
|
+
isCreatingComponentWhileAddingAField,
|
|
702
|
+
mainBoxHeader: get(allDataSchema, [
|
|
703
|
+
...pathToSchema,
|
|
704
|
+
'schema',
|
|
705
|
+
'displayName'
|
|
706
|
+
], ''),
|
|
707
|
+
modifiedData,
|
|
708
|
+
naturePickerType: forTarget,
|
|
709
|
+
isCreating,
|
|
710
|
+
targetUid,
|
|
711
|
+
forTarget
|
|
712
|
+
};
|
|
713
|
+
const advancedForm = formToDisplay.advanced({
|
|
714
|
+
data: modifiedData,
|
|
715
|
+
type: attributeType,
|
|
716
|
+
step,
|
|
717
|
+
actionType,
|
|
718
|
+
attributes,
|
|
719
|
+
extensions: ctbFormsAPI,
|
|
720
|
+
forTarget,
|
|
721
|
+
contentTypeSchema: allDataSchema.contentType || {},
|
|
722
|
+
customField
|
|
723
|
+
}).sections;
|
|
724
|
+
const baseForm = formToDisplay.base({
|
|
725
|
+
data: modifiedData,
|
|
726
|
+
type: attributeType,
|
|
727
|
+
step,
|
|
728
|
+
actionType,
|
|
729
|
+
attributes,
|
|
730
|
+
extensions: ctbFormsAPI,
|
|
731
|
+
forTarget,
|
|
732
|
+
contentTypeSchema: allDataSchema.contentType || {},
|
|
733
|
+
customField
|
|
734
|
+
}).sections;
|
|
735
|
+
const baseFormInputNames = getFormInputNames(baseForm);
|
|
736
|
+
const advancedFormInputNames = getFormInputNames(advancedForm);
|
|
737
|
+
const doesBaseFormHasError = Object.keys(formErrors).some((key)=>baseFormInputNames.includes(key));
|
|
738
|
+
const doesAdvancedFormHasError = Object.keys(formErrors).some((key)=>advancedFormInputNames.includes(key));
|
|
739
|
+
const schemaKind = get(contentTypes, [
|
|
740
|
+
targetUid,
|
|
741
|
+
'schema',
|
|
742
|
+
'kind'
|
|
743
|
+
]);
|
|
744
|
+
const checkIsEditingFieldName = ()=>actionType === 'edit' && attributes.every(({ name })=>name !== modifiedData?.name);
|
|
745
|
+
const handleClickFinish = ()=>{
|
|
746
|
+
if (checkIsEditingFieldName()) {
|
|
747
|
+
trackUsage('didEditFieldNameOnContentType');
|
|
748
|
+
}
|
|
749
|
+
};
|
|
750
|
+
return /*#__PURE__*/ jsx(Modal.Root, {
|
|
751
|
+
open: isOpen,
|
|
752
|
+
onOpenChange: handleClosed,
|
|
753
|
+
children: /*#__PURE__*/ jsxs(Modal.Content, {
|
|
754
|
+
children: [
|
|
755
|
+
/*#__PURE__*/ jsx(FormModalHeader, {
|
|
756
|
+
actionType: actionType,
|
|
757
|
+
attributeName: attributeName,
|
|
758
|
+
categoryName: categoryName,
|
|
759
|
+
contentTypeKind: kind,
|
|
760
|
+
dynamicZoneTarget: dynamicZoneTarget,
|
|
761
|
+
modalType: modalType,
|
|
762
|
+
forTarget: forTarget,
|
|
763
|
+
targetUid: targetUid,
|
|
764
|
+
attributeType: attributeType,
|
|
765
|
+
customFieldUid: customFieldUid,
|
|
766
|
+
showBackLink: showBackLink
|
|
767
|
+
}),
|
|
768
|
+
isPickingAttribute && /*#__PURE__*/ jsx(AttributeOptions, {
|
|
769
|
+
attributes: displayedAttributes,
|
|
770
|
+
forTarget: forTarget,
|
|
771
|
+
kind: schemaKind || 'collectionType'
|
|
772
|
+
}),
|
|
773
|
+
!isPickingAttribute && /*#__PURE__*/ jsxs(FormComponent, {
|
|
774
|
+
onSubmit: handleSubmit,
|
|
775
|
+
children: [
|
|
776
|
+
/*#__PURE__*/ jsx(Modal.Body, {
|
|
777
|
+
children: /*#__PURE__*/ jsxs(Tabs.Root, {
|
|
778
|
+
variant: "simple",
|
|
779
|
+
value: activeTab,
|
|
780
|
+
onValueChange: (value)=>{
|
|
781
|
+
setActiveTab(value);
|
|
782
|
+
sendAdvancedTabEvent(value);
|
|
783
|
+
},
|
|
784
|
+
hasError: doesBaseFormHasError ? 'basic' : doesAdvancedFormHasError ? 'advanced' : undefined,
|
|
785
|
+
children: [
|
|
786
|
+
/*#__PURE__*/ jsxs(Flex, {
|
|
787
|
+
justifyContent: "space-between",
|
|
788
|
+
children: [
|
|
789
|
+
/*#__PURE__*/ jsx(FormModalSubHeader, {
|
|
790
|
+
actionType: actionType,
|
|
791
|
+
forTarget: forTarget,
|
|
792
|
+
kind: kind,
|
|
793
|
+
step: step,
|
|
794
|
+
modalType: modalType,
|
|
795
|
+
attributeType: attributeType,
|
|
796
|
+
attributeName: attributeName,
|
|
797
|
+
customField: customField
|
|
798
|
+
}),
|
|
799
|
+
/*#__PURE__*/ jsxs(Tabs.List, {
|
|
800
|
+
children: [
|
|
801
|
+
/*#__PURE__*/ jsx(Tabs.Trigger, {
|
|
802
|
+
value: "basic",
|
|
803
|
+
children: formatMessage({
|
|
804
|
+
id: getTrad('popUpForm.navContainer.base'),
|
|
805
|
+
defaultMessage: 'Basic settings'
|
|
806
|
+
})
|
|
807
|
+
}),
|
|
808
|
+
/*#__PURE__*/ jsx(Tabs.Trigger, {
|
|
809
|
+
value: "advanced",
|
|
810
|
+
disabled: shouldDisableAdvancedTab(),
|
|
811
|
+
children: formatMessage({
|
|
812
|
+
id: getTrad('popUpForm.navContainer.advanced'),
|
|
813
|
+
defaultMessage: 'Advanced settings'
|
|
814
|
+
})
|
|
815
|
+
})
|
|
816
|
+
]
|
|
817
|
+
})
|
|
818
|
+
]
|
|
819
|
+
}),
|
|
820
|
+
/*#__PURE__*/ jsx(Divider, {
|
|
821
|
+
marginBottom: 6
|
|
822
|
+
}),
|
|
823
|
+
/*#__PURE__*/ jsx(Tabs.Content, {
|
|
824
|
+
value: "basic",
|
|
825
|
+
children: /*#__PURE__*/ jsx(Flex, {
|
|
826
|
+
direction: "column",
|
|
827
|
+
alignItems: "stretch",
|
|
828
|
+
gap: 6,
|
|
829
|
+
children: /*#__PURE__*/ jsx(TabForm, {
|
|
830
|
+
form: baseForm,
|
|
831
|
+
formErrors: formErrors,
|
|
832
|
+
genericInputProps: genericInputProps,
|
|
833
|
+
modifiedData: modifiedData,
|
|
834
|
+
onChange: handleChange
|
|
835
|
+
})
|
|
836
|
+
})
|
|
837
|
+
}),
|
|
838
|
+
/*#__PURE__*/ jsx(Tabs.Content, {
|
|
839
|
+
value: "advanced",
|
|
840
|
+
children: /*#__PURE__*/ jsx(Flex, {
|
|
841
|
+
direction: "column",
|
|
842
|
+
alignItems: "stretch",
|
|
843
|
+
gap: 6,
|
|
844
|
+
children: /*#__PURE__*/ jsx(TabForm, {
|
|
845
|
+
form: advancedForm,
|
|
846
|
+
formErrors: formErrors,
|
|
847
|
+
genericInputProps: genericInputProps,
|
|
848
|
+
modifiedData: modifiedData,
|
|
849
|
+
onChange: handleChange
|
|
850
|
+
})
|
|
851
|
+
})
|
|
852
|
+
})
|
|
853
|
+
]
|
|
854
|
+
})
|
|
855
|
+
}),
|
|
856
|
+
/*#__PURE__*/ jsxs(Modal.Footer, {
|
|
857
|
+
children: [
|
|
858
|
+
/*#__PURE__*/ jsx(Button, {
|
|
859
|
+
variant: "tertiary",
|
|
860
|
+
onClick: handleClosed,
|
|
861
|
+
children: formatMessage({
|
|
862
|
+
id: 'app.components.Button.cancel',
|
|
863
|
+
defaultMessage: 'Cancel'
|
|
864
|
+
})
|
|
865
|
+
}),
|
|
866
|
+
/*#__PURE__*/ jsx(FormModalEndActions, {
|
|
867
|
+
deleteCategory: deleteCategory,
|
|
868
|
+
deleteContentType: deleteData,
|
|
869
|
+
deleteComponent: deleteData,
|
|
870
|
+
categoryName: initialData.name,
|
|
871
|
+
isAttributeModal: modalType === 'attribute',
|
|
872
|
+
isCustomFieldModal: modalType === 'customField',
|
|
873
|
+
isComponentToDzModal: modalType === 'addComponentToDynamicZone',
|
|
874
|
+
isComponentAttribute: attributeType === 'component',
|
|
875
|
+
isComponentModal: modalType === 'component',
|
|
876
|
+
isContentTypeModal: modalType === 'contentType',
|
|
877
|
+
isCreatingComponent: actionType === 'create',
|
|
878
|
+
isCreatingDz: actionType === 'create',
|
|
879
|
+
isCreatingComponentAttribute: modifiedData.createComponent || false,
|
|
880
|
+
isCreatingComponentInDz: modifiedData.createComponent || false,
|
|
881
|
+
isCreatingComponentWhileAddingAField: isCreatingComponentWhileAddingAField,
|
|
882
|
+
isCreatingContentType: actionType === 'create',
|
|
883
|
+
isEditingAttribute: actionType === 'edit',
|
|
884
|
+
isDzAttribute: attributeType === 'dynamiczone',
|
|
885
|
+
isEditingCategory: modalType === 'editCategory',
|
|
886
|
+
isInFirstComponentStep: step === '1',
|
|
887
|
+
onSubmitAddComponentAttribute: handleSubmit,
|
|
888
|
+
onSubmitAddComponentToDz: handleSubmit,
|
|
889
|
+
onSubmitCreateComponent: handleSubmit,
|
|
890
|
+
onSubmitCreateContentType: handleSubmit,
|
|
891
|
+
onSubmitCreateDz: handleSubmit,
|
|
892
|
+
onSubmitEditAttribute: handleSubmit,
|
|
893
|
+
onSubmitEditCategory: handleSubmit,
|
|
894
|
+
onSubmitEditComponent: handleSubmit,
|
|
895
|
+
onSubmitEditContentType: handleSubmit,
|
|
896
|
+
onSubmitEditCustomFieldAttribute: handleSubmit,
|
|
897
|
+
onSubmitEditDz: handleSubmit,
|
|
898
|
+
onClickFinish: handleClickFinish
|
|
899
|
+
})
|
|
900
|
+
]
|
|
901
|
+
})
|
|
902
|
+
]
|
|
903
|
+
})
|
|
904
|
+
]
|
|
905
|
+
})
|
|
906
|
+
});
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
export { FormModal };
|
|
910
|
+
//# sourceMappingURL=FormModal.mjs.map
|