@strapi/content-type-builder 5.49.0 → 5.50.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/components/AIChat/Chat.js +2 -4
- package/dist/admin/components/AIChat/Chat.js.map +1 -1
- package/dist/admin/components/AIChat/Chat.mjs +2 -4
- package/dist/admin/components/AIChat/Chat.mjs.map +1 -1
- package/dist/admin/components/AIChat/UploadFigmaModal.js +1 -1
- package/dist/admin/components/AIChat/UploadFigmaModal.js.map +1 -1
- package/dist/admin/components/AIChat/UploadFigmaModal.mjs +1 -1
- package/dist/admin/components/AIChat/UploadFigmaModal.mjs.map +1 -1
- package/dist/admin/components/AIChat/components/Messages/Message.js +8 -3
- package/dist/admin/components/AIChat/components/Messages/Message.js.map +1 -1
- package/dist/admin/components/AIChat/components/Messages/Message.mjs +8 -3
- package/dist/admin/components/AIChat/components/Messages/Message.mjs.map +1 -1
- package/dist/admin/components/AIChat/lib/aiClient.js +8 -2
- package/dist/admin/components/AIChat/lib/aiClient.js.map +1 -1
- package/dist/admin/components/AIChat/lib/aiClient.mjs +8 -2
- package/dist/admin/components/AIChat/lib/aiClient.mjs.map +1 -1
- package/dist/admin/components/AIChat/lib/transforms/schemas/fromCTB.js +0 -3
- package/dist/admin/components/AIChat/lib/transforms/schemas/fromCTB.js.map +1 -1
- package/dist/admin/components/AIChat/lib/transforms/schemas/fromCTB.mjs +0 -3
- package/dist/admin/components/AIChat/lib/transforms/schemas/fromCTB.mjs.map +1 -1
- package/dist/admin/components/AIChat/lib/transforms/schemas/toCTB.js +9 -7
- package/dist/admin/components/AIChat/lib/transforms/schemas/toCTB.js.map +1 -1
- package/dist/admin/components/AIChat/lib/transforms/schemas/toCTB.mjs +9 -7
- package/dist/admin/components/AIChat/lib/transforms/schemas/toCTB.mjs.map +1 -1
- package/dist/admin/components/AIChat/providers/SchemaProvider.js +1 -1
- package/dist/admin/components/AIChat/providers/SchemaProvider.js.map +1 -1
- package/dist/admin/components/AIChat/providers/SchemaProvider.mjs +1 -1
- package/dist/admin/components/AIChat/providers/SchemaProvider.mjs.map +1 -1
- package/dist/admin/components/AllowedTypesSelect.js.map +1 -1
- package/dist/admin/components/AllowedTypesSelect.mjs.map +1 -1
- package/dist/admin/components/AttributeIcon.js +1 -1
- package/dist/admin/components/AttributeIcon.js.map +1 -1
- package/dist/admin/components/AttributeIcon.mjs +1 -1
- package/dist/admin/components/AttributeIcon.mjs.map +1 -1
- package/dist/admin/components/BooleanDefaultValueSelect.js +3 -2
- package/dist/admin/components/BooleanDefaultValueSelect.js.map +1 -1
- package/dist/admin/components/BooleanDefaultValueSelect.mjs +3 -2
- package/dist/admin/components/BooleanDefaultValueSelect.mjs.map +1 -1
- package/dist/admin/components/BooleanRadioGroup.js.map +1 -1
- package/dist/admin/components/BooleanRadioGroup.mjs.map +1 -1
- package/dist/admin/components/CTBSession/useCTBTracking.js +3 -3
- package/dist/admin/components/CTBSession/useCTBTracking.js.map +1 -1
- package/dist/admin/components/CTBSession/useCTBTracking.mjs +3 -3
- package/dist/admin/components/CTBSession/useCTBTracking.mjs.map +1 -1
- package/dist/admin/components/CheckboxWithNumberField.js +3 -2
- package/dist/admin/components/CheckboxWithNumberField.js.map +1 -1
- package/dist/admin/components/CheckboxWithNumberField.mjs +3 -2
- package/dist/admin/components/CheckboxWithNumberField.mjs.map +1 -1
- package/dist/admin/components/ComponentCard/ComponentCard.js.map +1 -1
- package/dist/admin/components/ComponentCard/ComponentCard.mjs.map +1 -1
- package/dist/admin/components/ContentTypeBuilderNav/ContentTypeBuilderNav.js +160 -162
- package/dist/admin/components/ContentTypeBuilderNav/ContentTypeBuilderNav.js.map +1 -1
- package/dist/admin/components/ContentTypeBuilderNav/ContentTypeBuilderNav.mjs +160 -162
- package/dist/admin/components/ContentTypeBuilderNav/ContentTypeBuilderNav.mjs.map +1 -1
- package/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.js +1 -1
- package/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.js.map +1 -1
- package/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.mjs +1 -1
- package/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.mjs.map +1 -1
- package/dist/admin/components/ContentTypeRadioGroup.js.map +1 -1
- package/dist/admin/components/ContentTypeRadioGroup.mjs.map +1 -1
- package/dist/admin/components/CustomRadioGroup/CustomRadioGroup.js +6 -5
- package/dist/admin/components/CustomRadioGroup/CustomRadioGroup.js.map +1 -1
- package/dist/admin/components/CustomRadioGroup/CustomRadioGroup.mjs +6 -5
- package/dist/admin/components/CustomRadioGroup/CustomRadioGroup.mjs.map +1 -1
- package/dist/admin/components/CustomRadioGroup/Styles.js.map +1 -1
- package/dist/admin/components/CustomRadioGroup/Styles.mjs.map +1 -1
- package/dist/admin/components/DataManager/DataManagerContext.js.map +1 -1
- package/dist/admin/components/DataManager/DataManagerContext.mjs.map +1 -1
- package/dist/admin/components/DataManager/DataManagerProvider.js +16 -4
- package/dist/admin/components/DataManager/DataManagerProvider.js.map +1 -1
- package/dist/admin/components/DataManager/DataManagerProvider.mjs +16 -4
- package/dist/admin/components/DataManager/DataManagerProvider.mjs.map +1 -1
- package/dist/admin/components/DataManager/reducer.js +2 -2
- package/dist/admin/components/DataManager/reducer.js.map +1 -1
- package/dist/admin/components/DataManager/reducer.mjs +2 -2
- package/dist/admin/components/DataManager/reducer.mjs.map +1 -1
- package/dist/admin/components/DataManager/useServerRestartWatcher.js.map +1 -1
- package/dist/admin/components/DataManager/useServerRestartWatcher.mjs.map +1 -1
- package/dist/admin/components/DataManager/utils/retrieveSpecificInfoFromComponents.js.map +1 -1
- package/dist/admin/components/DataManager/utils/retrieveSpecificInfoFromComponents.mjs.map +1 -1
- package/dist/admin/components/DraftAndPublishToggle.js.map +1 -1
- package/dist/admin/components/DraftAndPublishToggle.mjs.map +1 -1
- package/dist/admin/components/DynamicZoneList.js.map +1 -1
- package/dist/admin/components/DynamicZoneList.mjs.map +1 -1
- package/dist/admin/components/FormModal/FormModal.js +91 -71
- package/dist/admin/components/FormModal/FormModal.js.map +1 -1
- package/dist/admin/components/FormModal/FormModal.mjs +91 -70
- package/dist/admin/components/FormModal/FormModal.mjs.map +1 -1
- package/dist/admin/components/FormModal/attributes/ConditionForm.js +20 -17
- package/dist/admin/components/FormModal/attributes/ConditionForm.js.map +1 -1
- package/dist/admin/components/FormModal/attributes/ConditionForm.mjs +20 -17
- package/dist/admin/components/FormModal/attributes/ConditionForm.mjs.map +1 -1
- package/dist/admin/components/FormModal/attributes/validation/common.js.map +1 -1
- package/dist/admin/components/FormModal/attributes/validation/common.mjs.map +1 -1
- package/dist/admin/components/FormModal/component/createComponentSchema.js +1 -1
- package/dist/admin/components/FormModal/component/createComponentSchema.js.map +1 -1
- package/dist/admin/components/FormModal/component/createComponentSchema.mjs +1 -1
- package/dist/admin/components/FormModal/component/createComponentSchema.mjs.map +1 -1
- package/dist/admin/components/FormModal/forms/forms.js +4 -6
- package/dist/admin/components/FormModal/forms/forms.js.map +1 -1
- package/dist/admin/components/FormModal/forms/forms.mjs +4 -6
- package/dist/admin/components/FormModal/forms/forms.mjs.map +1 -1
- package/dist/admin/components/FormModal/forms/utils/getUsedAttributeNames.js.map +1 -1
- package/dist/admin/components/FormModal/forms/utils/getUsedAttributeNames.mjs.map +1 -1
- package/dist/admin/components/FormModal/reducer.js +9 -6
- package/dist/admin/components/FormModal/reducer.js.map +1 -1
- package/dist/admin/components/FormModal/reducer.mjs +9 -6
- package/dist/admin/components/FormModal/reducer.mjs.map +1 -1
- package/dist/admin/components/FormModal/utils/customFieldDefaultOptionsReducer.js +3 -3
- package/dist/admin/components/FormModal/utils/customFieldDefaultOptionsReducer.js.map +1 -1
- package/dist/admin/components/FormModal/utils/customFieldDefaultOptionsReducer.mjs +3 -3
- package/dist/admin/components/FormModal/utils/customFieldDefaultOptionsReducer.mjs.map +1 -1
- package/dist/admin/components/FormModal/utils/getFormInputNames.js +1 -1
- package/dist/admin/components/FormModal/utils/getFormInputNames.js.map +1 -1
- package/dist/admin/components/FormModal/utils/getFormInputNames.mjs +1 -1
- package/dist/admin/components/FormModal/utils/getFormInputNames.mjs.map +1 -1
- package/dist/admin/components/FormModal/utils/relations.js +2 -2
- package/dist/admin/components/FormModal/utils/relations.js.map +1 -1
- package/dist/admin/components/FormModal/utils/relations.mjs +2 -2
- package/dist/admin/components/FormModal/utils/relations.mjs.map +1 -1
- package/dist/admin/components/FormModalHeader.js.map +1 -1
- package/dist/admin/components/FormModalHeader.mjs.map +1 -1
- package/dist/admin/components/FormModalNavigation/FormModalNavigationContext.js.map +1 -1
- package/dist/admin/components/FormModalNavigation/FormModalNavigationContext.mjs.map +1 -1
- package/dist/admin/components/FormModalNavigation/FormModalNavigationProvider.js +13 -13
- package/dist/admin/components/FormModalNavigation/FormModalNavigationProvider.js.map +1 -1
- package/dist/admin/components/FormModalNavigation/FormModalNavigationProvider.mjs +13 -13
- package/dist/admin/components/FormModalNavigation/FormModalNavigationProvider.mjs.map +1 -1
- package/dist/admin/components/GenericInputs.js +24 -12
- package/dist/admin/components/GenericInputs.js.map +1 -1
- package/dist/admin/components/GenericInputs.mjs +24 -12
- package/dist/admin/components/GenericInputs.mjs.map +1 -1
- package/dist/admin/components/IconPicker/IconPicker.js.map +1 -1
- package/dist/admin/components/IconPicker/IconPicker.mjs.map +1 -1
- package/dist/admin/components/PluralName.js.map +1 -1
- package/dist/admin/components/PluralName.mjs.map +1 -1
- package/dist/admin/components/Relation/Relation.js +3 -3
- package/dist/admin/components/Relation/Relation.js.map +1 -1
- package/dist/admin/components/Relation/Relation.mjs +3 -3
- package/dist/admin/components/Relation/Relation.mjs.map +1 -1
- package/dist/admin/components/Relation/RelationField/RelationField.js +1 -1
- package/dist/admin/components/Relation/RelationField/RelationField.js.map +1 -1
- package/dist/admin/components/Relation/RelationField/RelationField.mjs +1 -1
- package/dist/admin/components/Relation/RelationField/RelationField.mjs.map +1 -1
- package/dist/admin/components/SelectCategory.js +6 -0
- package/dist/admin/components/SelectCategory.js.map +1 -1
- package/dist/admin/components/SelectCategory.mjs +6 -0
- package/dist/admin/components/SelectCategory.mjs.map +1 -1
- package/dist/admin/components/SelectComponent.js +1 -1
- package/dist/admin/components/SelectComponent.js.map +1 -1
- package/dist/admin/components/SelectComponent.mjs +1 -1
- package/dist/admin/components/SelectComponent.mjs.map +1 -1
- package/dist/admin/components/SingularName.js.map +1 -1
- package/dist/admin/components/SingularName.mjs.map +1 -1
- package/dist/admin/components/TabForm.js +50 -51
- package/dist/admin/components/TabForm.js.map +1 -1
- package/dist/admin/components/TabForm.mjs +51 -52
- package/dist/admin/components/TabForm.mjs.map +1 -1
- package/dist/admin/src/components/AIChat/components/AnimatedBox.d.ts +4 -5
- package/dist/admin/src/components/AIChat/components/Attachments/AttachmentPreview.d.ts +1 -1
- package/dist/admin/src/components/AIChat/components/Dropzone.d.ts +0 -1
- package/dist/admin/src/components/AIChat/components/FloatingPanel.d.ts +0 -1
- package/dist/admin/src/components/AIChat/components/Input.d.ts +2 -3
- package/dist/admin/src/components/AIChat/components/Messages/Message.d.ts +1 -2
- package/dist/admin/src/components/AIChat/components/ResizableTextArea.d.ts +0 -1
- package/dist/admin/src/components/AIChat/components/SimpleMenu.d.ts +9 -9
- package/dist/admin/src/components/AIChat/components/icons/FigmaIcon.d.ts +0 -1
- package/dist/admin/src/components/AIChat/components/icons/StopIcon.d.ts +0 -1
- package/dist/admin/src/components/AIChat/hooks/useAIFetch.d.ts +5 -5
- package/dist/admin/src/components/AIChat/lib/aiClient.d.ts +1 -1
- package/dist/admin/src/components/AIChat/lib/transforms/schemas/fromCTB.d.ts +6 -2
- package/dist/admin/src/components/AIChat/lib/transforms/schemas/toCTB.d.ts +1 -1
- package/dist/admin/src/components/AIChat/lib/types/schema.d.ts +5 -5
- package/dist/admin/src/components/AllowedTypesSelect.d.ts +3 -3
- package/dist/admin/src/components/AttributeOptions/OptionBoxWrapper.d.ts +2 -3
- package/dist/admin/src/components/AttributeRow.d.ts +7 -8
- package/dist/admin/src/components/BooleanDefaultValueSelect.d.ts +3 -3
- package/dist/admin/src/components/BooleanRadioGroup.d.ts +2 -2
- package/dist/admin/src/components/CTBSession/sessionContext.d.ts +0 -1
- package/dist/admin/src/components/CTBSession/useCTBTracking.d.ts +1 -1
- package/dist/admin/src/components/CheckboxWithNumberField.d.ts +6 -4
- package/dist/admin/src/components/ComponentRow.d.ts +6 -7
- package/dist/admin/src/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.d.ts +0 -1
- package/dist/admin/src/components/ContentTypeRadioGroup.d.ts +3 -2
- package/dist/admin/src/components/CustomRadioGroup/CustomRadioGroup.d.ts +3 -2
- package/dist/admin/src/components/CustomRadioGroup/Styles.d.ts +3 -4
- package/dist/admin/src/components/DataManager/DataManagerContext.d.ts +13 -12
- package/dist/admin/src/components/DataManager/reducer.d.ts +16 -12
- package/dist/admin/src/components/DataManager/utils/cleanData.d.ts +64 -64
- package/dist/admin/src/components/DataManager/utils/formatSchemas.d.ts +9 -3
- package/dist/admin/src/components/DataManager/utils/retrieveSpecificInfoFromComponents.d.ts +2 -1
- package/dist/admin/src/components/DraftAndPublishToggle.d.ts +1 -6
- package/dist/admin/src/components/DynamicZoneList.d.ts +2 -2
- package/dist/admin/src/components/FormModal/attributes/ConditionForm.d.ts +3 -2
- package/dist/admin/src/components/FormModal/attributes/form.d.ts +3 -3
- package/dist/admin/src/components/FormModal/attributes/validation/common.d.ts +4 -2
- package/dist/admin/src/components/FormModal/forms/forms.d.ts +61 -28
- package/dist/admin/src/components/FormModal/forms/utils/getUsedAttributeNames.d.ts +12 -2
- package/dist/admin/src/components/FormModal/reducer.d.ts +104 -32
- package/dist/admin/src/components/FormModal/utils/customFieldDefaultOptionsReducer.d.ts +11 -1
- package/dist/admin/src/components/FormModal/utils/getFormInputNames.d.ts +8 -1
- package/dist/admin/src/components/FormModal/utils/relations.d.ts +2 -2
- package/dist/admin/src/components/FormModalHeader.d.ts +5 -8
- package/dist/admin/src/components/FormModalNavigation/FormModalNavigationContext.d.ts +2 -2
- package/dist/admin/src/components/FormModalNavigation/FormModalNavigationProvider.d.ts +17 -2
- package/dist/admin/src/components/GenericInputs.d.ts +12 -7
- package/dist/admin/src/components/IconPicker/IconPicker.d.ts +2 -7
- package/dist/admin/src/components/List.d.ts +2 -3
- package/dist/admin/src/components/PluralName.d.ts +6 -14
- package/dist/admin/src/components/Relation/Relation.d.ts +12 -3
- package/dist/admin/src/components/Relation/RelationField/RelationField.d.ts +3 -2
- package/dist/admin/src/components/Relation/RelationNaturePicker/Components.d.ts +6 -7
- package/dist/admin/src/components/SelectCategory.d.ts +3 -12
- package/dist/admin/src/components/SelectComponent.d.ts +8 -7
- package/dist/admin/src/components/SingularName.d.ts +5 -8
- package/dist/admin/src/components/TabForm.d.ts +38 -7
- package/dist/admin/src/pages/ListView/LinkToCMSettingsView.d.ts +0 -1
- package/dist/admin/src/types.d.ts +20 -12
- package/dist/admin/src/utils/conditions.d.ts +13 -4
- package/dist/admin/src/utils/formAPI.d.ts +38 -33
- package/dist/admin/src/utils/getRelationType.d.ts +1 -1
- package/dist/admin/src/utils/isAllowedContentTypesForRelations.d.ts +1 -1
- package/dist/admin/src/utils/parseNumberInputValue.d.ts +1 -0
- package/dist/admin/translations/en.json.js +1 -0
- package/dist/admin/translations/en.json.js.map +1 -1
- package/dist/admin/translations/en.json.mjs +1 -0
- package/dist/admin/translations/en.json.mjs.map +1 -1
- package/dist/admin/translations/ja.json.js +109 -50
- package/dist/admin/translations/ja.json.js.map +1 -1
- package/dist/admin/translations/ja.json.mjs +109 -50
- package/dist/admin/translations/ja.json.mjs.map +1 -1
- package/dist/admin/utils/conditions.js +38 -28
- package/dist/admin/utils/conditions.js.map +1 -1
- package/dist/admin/utils/conditions.mjs +37 -28
- package/dist/admin/utils/conditions.mjs.map +1 -1
- package/dist/admin/utils/formAPI.js +9 -6
- package/dist/admin/utils/formAPI.js.map +1 -1
- package/dist/admin/utils/formAPI.mjs +9 -6
- package/dist/admin/utils/formAPI.mjs.map +1 -1
- package/dist/admin/utils/getRelationType.js +3 -0
- package/dist/admin/utils/getRelationType.js.map +1 -1
- package/dist/admin/utils/getRelationType.mjs +3 -0
- package/dist/admin/utils/getRelationType.mjs.map +1 -1
- package/dist/admin/utils/getYupInnerErrors.js +6 -4
- package/dist/admin/utils/getYupInnerErrors.js.map +1 -1
- package/dist/admin/utils/getYupInnerErrors.mjs +6 -4
- package/dist/admin/utils/getYupInnerErrors.mjs.map +1 -1
- package/dist/admin/utils/parseNumberInputValue.js +15 -0
- package/dist/admin/utils/parseNumberInputValue.js.map +1 -0
- package/dist/admin/utils/parseNumberInputValue.mjs +13 -0
- package/dist/admin/utils/parseNumberInputValue.mjs.map +1 -0
- package/dist/server/controllers/validation/common.js +1 -1
- package/dist/server/controllers/validation/common.js.map +1 -1
- package/dist/server/controllers/validation/common.mjs +1 -1
- package/dist/server/controllers/validation/common.mjs.map +1 -1
- package/dist/server/controllers/validation/relations.js +1 -1
- package/dist/server/controllers/validation/relations.js.map +1 -1
- package/dist/server/controllers/validation/relations.mjs +1 -1
- package/dist/server/controllers/validation/relations.mjs.map +1 -1
- package/dist/server/controllers/validation/types.js +4 -3
- package/dist/server/controllers/validation/types.js.map +1 -1
- package/dist/server/controllers/validation/types.mjs +4 -3
- package/dist/server/controllers/validation/types.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/common.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/component-category.d.ts +1 -1
- package/dist/server/src/controllers/validation/component.d.ts +1 -1
- package/dist/server/src/controllers/validation/component.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/content-type.d.ts +1 -1
- package/dist/server/src/controllers/validation/content-type.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/data-transform.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/model-schema.d.ts +1 -1
- package/dist/server/src/controllers/validation/model-schema.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/schema.d.ts +1 -1
- package/dist/server/src/controllers/validation/types.d.ts.map +1 -1
- package/dist/server/src/middlewares/is-development-mode.d.ts.map +1 -1
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/services/builder.d.ts.map +1 -1
- package/dist/server/src/services/component-categories.d.ts.map +1 -1
- package/dist/server/src/services/components.d.ts.map +1 -1
- package/dist/server/src/services/content-types.d.ts +1 -1
- package/dist/server/src/services/content-types.d.ts.map +1 -1
- package/dist/server/src/services/schema-builder/component-builder.d.ts +12 -12
- package/dist/server/src/services/schema-builder/component-builder.d.ts.map +1 -1
- package/dist/server/src/services/schema-builder/content-type-builder.d.ts +14 -14
- package/dist/server/src/services/schema-builder/content-type-builder.d.ts.map +1 -1
- package/dist/server/src/services/schema-builder/index.d.ts +27 -27
- package/dist/server/src/services/schema-builder/index.d.ts.map +1 -1
- package/dist/server/src/services/schema-builder/schema-handler.d.ts +12 -12
- package/dist/server/src/services/schema-builder/schema-handler.d.ts.map +1 -1
- package/dist/server/src/services/schema.d.ts +66 -66
- package/dist/server/src/services/schema.d.ts.map +1 -1
- package/dist/server/src/utils/attributes.d.ts +2 -2
- package/dist/server/src/utils/attributes.d.ts.map +1 -1
- package/dist/server/src/utils/helpers.d.ts.map +1 -1
- package/dist/server/src/utils/typeguards.d.ts.map +1 -1
- package/package.json +13 -9
|
@@ -1,50 +1,77 @@
|
|
|
1
1
|
import { attributesForm } from '../attributes/form';
|
|
2
2
|
import { attributeTypes } from '../attributes/types';
|
|
3
|
-
import { FormTypeOptions } from './utils/addItemsToFormSection';
|
|
3
|
+
import { addItemsToFormSection, FormTypeOptions } from './utils/addItemsToFormSection';
|
|
4
4
|
import { Attribute, SchemaData } from './utils/getUsedAttributeNames';
|
|
5
|
-
import type { ContentType } from '../../../types';
|
|
5
|
+
import type { Component, ContentType } from '../../../types';
|
|
6
|
+
import type { FormAPI } from '../../../utils/formAPI';
|
|
7
|
+
import type { FormModalData } from '../reducer';
|
|
6
8
|
import type { Internal } from '@strapi/types';
|
|
9
|
+
type AttributeType = keyof typeof attributeTypes;
|
|
10
|
+
type CustomFieldFormOptions = Parameters<typeof addItemsToFormSection>[0];
|
|
11
|
+
type CustomFieldValidator = Parameters<FormAPI['makeCustomFieldValidator']>[1];
|
|
12
|
+
type CustomField = {
|
|
13
|
+
type: AttributeType;
|
|
14
|
+
options?: {
|
|
15
|
+
base?: CustomFieldFormOptions;
|
|
16
|
+
advanced?: CustomFieldFormOptions;
|
|
17
|
+
validator?: CustomFieldValidator;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
7
20
|
export type SchemaParams = {
|
|
8
|
-
schemaAttributes:
|
|
9
|
-
attributeType:
|
|
10
|
-
customFieldValidator:
|
|
21
|
+
schemaAttributes: Attribute[];
|
|
22
|
+
attributeType: AttributeType;
|
|
23
|
+
customFieldValidator: CustomFieldValidator;
|
|
11
24
|
reservedNames: {
|
|
12
25
|
attributes: Array<string>;
|
|
13
26
|
};
|
|
14
|
-
schemaData:
|
|
15
|
-
ctbFormsAPI:
|
|
27
|
+
schemaData: SchemaData;
|
|
28
|
+
ctbFormsAPI: FormAPI;
|
|
16
29
|
};
|
|
17
30
|
type Base<TAttributesFormType extends 'base' | 'advanced'> = {
|
|
18
|
-
data:
|
|
31
|
+
data: FormModalData;
|
|
19
32
|
type: keyof (typeof attributesForm)[TAttributesFormType];
|
|
20
|
-
step: string;
|
|
21
|
-
attributes:
|
|
22
|
-
extensions:
|
|
33
|
+
step: string | null;
|
|
34
|
+
attributes: Attribute[];
|
|
35
|
+
extensions: FormAPI;
|
|
23
36
|
forTarget: string;
|
|
24
37
|
};
|
|
38
|
+
type CustomFieldFormParams = {
|
|
39
|
+
customField: CustomField;
|
|
40
|
+
data?: FormModalData;
|
|
41
|
+
step?: string | null;
|
|
42
|
+
extensions: FormAPI;
|
|
43
|
+
} & Record<string, unknown>;
|
|
25
44
|
export declare const forms: {
|
|
26
45
|
customField: {
|
|
27
|
-
schema({ schemaAttributes, attributeType, customFieldValidator, reservedNames, schemaData, ctbFormsAPI, }: SchemaParams): any
|
|
46
|
+
schema({ schemaAttributes, attributeType, customFieldValidator, reservedNames, schemaData, ctbFormsAPI, }: SchemaParams): import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, Record<string, any>, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
28
47
|
form: {
|
|
29
|
-
base({ customField }:
|
|
48
|
+
base({ customField }: Pick<CustomFieldFormParams, "customField">): {
|
|
30
49
|
sections: FormTypeOptions;
|
|
31
50
|
};
|
|
32
|
-
advanced({ customField, data, step, extensions, ...rest }:
|
|
51
|
+
advanced({ customField, data, step, extensions, ...rest }: CustomFieldFormParams): {
|
|
33
52
|
sections: FormTypeOptions;
|
|
34
53
|
};
|
|
35
54
|
};
|
|
36
55
|
};
|
|
37
56
|
attribute: {
|
|
38
|
-
schema(currentSchema:
|
|
57
|
+
schema(currentSchema: {
|
|
58
|
+
attributes?: Attribute[];
|
|
59
|
+
} | null | undefined, attributeType: AttributeType, reservedNames: {
|
|
39
60
|
attributes: Array<string>;
|
|
40
61
|
}, alreadyTakenTargetContentTypeAttributes: Array<Attribute>, options: SchemaData, extensions: {
|
|
41
|
-
makeValidator:
|
|
42
|
-
}): any
|
|
62
|
+
makeValidator: FormAPI["makeValidator"];
|
|
63
|
+
}): import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, Record<string, any>, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>> | import("yup/lib/object").OptionalObjectSchema<{
|
|
64
|
+
name: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
65
|
+
type: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
66
|
+
}, Record<string, any>, import("yup/lib/object").TypeOfShape<{
|
|
67
|
+
name: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
68
|
+
type: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
69
|
+
}>>;
|
|
43
70
|
form: {
|
|
44
|
-
advanced({ data, type, step, extensions, ...rest }: Base<
|
|
45
|
-
sections:
|
|
71
|
+
advanced({ data, type, step, extensions, ...rest }: Base<"advanced">): {
|
|
72
|
+
sections: FormTypeOptions;
|
|
46
73
|
};
|
|
47
|
-
base({ data, type, step, attributes }: Base<
|
|
74
|
+
base({ data, type, step, attributes }: Base<"base">): {
|
|
48
75
|
sections: {
|
|
49
76
|
sectionTitle: null;
|
|
50
77
|
items: {
|
|
@@ -61,10 +88,12 @@ export declare const forms: {
|
|
|
61
88
|
};
|
|
62
89
|
contentType: {
|
|
63
90
|
schema(alreadyTakenNames: Array<string>, isEditing: boolean, ctUid: Internal.UID.ContentType, reservedNames: {
|
|
64
|
-
models:
|
|
65
|
-
}, extensions:
|
|
91
|
+
models: string[];
|
|
92
|
+
}, extensions: FormAPI, contentTypes: Record<Internal.UID.ContentType, ContentType>): import("yup/lib/object").OptionalObjectSchema<import("yup/lib/object").ObjectShape, Record<string, any>, import("yup/lib/object").TypeOfShape<import("yup/lib/object").ObjectShape>>;
|
|
66
93
|
form: {
|
|
67
|
-
base({ actionType }:
|
|
94
|
+
base({ actionType }: {
|
|
95
|
+
actionType?: string;
|
|
96
|
+
}): {
|
|
68
97
|
sections: {
|
|
69
98
|
sectionTitle: null;
|
|
70
99
|
items: ({
|
|
@@ -98,17 +127,19 @@ export declare const forms: {
|
|
|
98
127
|
})[];
|
|
99
128
|
}[];
|
|
100
129
|
};
|
|
101
|
-
advanced({ extensions }:
|
|
130
|
+
advanced({ extensions }: {
|
|
131
|
+
extensions: FormAPI;
|
|
132
|
+
}): {
|
|
102
133
|
sections: {
|
|
103
|
-
items:
|
|
134
|
+
items: unknown[];
|
|
104
135
|
}[];
|
|
105
136
|
};
|
|
106
137
|
};
|
|
107
138
|
};
|
|
108
139
|
component: {
|
|
109
140
|
schema(alreadyTakenAttributes: Array<Internal.UID.Component>, componentCategory: string, reservedNames: {
|
|
110
|
-
models:
|
|
111
|
-
}, isEditing: boolean | undefined, components: Record<
|
|
141
|
+
models: string[];
|
|
142
|
+
}, isEditing: boolean | undefined, components: Record<Internal.UID.Component, Component>, componentDisplayName: string, compoUid?: Internal.UID.Component | null): import("yup/lib/object").OptionalObjectSchema<{
|
|
112
143
|
displayName: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
113
144
|
category: import("yup/lib/string").RequiredStringSchema<string | undefined, Record<string, any>>;
|
|
114
145
|
icon: import("yup").StringSchema<string | undefined, Record<string, any>, string | undefined>;
|
|
@@ -152,7 +183,9 @@ export declare const forms: {
|
|
|
152
183
|
advanced(): {
|
|
153
184
|
sections: unknown[];
|
|
154
185
|
};
|
|
155
|
-
base({ data }:
|
|
186
|
+
base({ data }: {
|
|
187
|
+
data: FormModalData;
|
|
188
|
+
}): {
|
|
156
189
|
sections: {
|
|
157
190
|
sectionTitle: null;
|
|
158
191
|
items: {
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
export type SchemaData = {
|
|
2
2
|
initialData: {
|
|
3
3
|
name?: string;
|
|
4
|
-
targetAttribute?:
|
|
4
|
+
targetAttribute?: string | null;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
modifiedData: {
|
|
8
|
+
createComponent?: boolean;
|
|
9
|
+
enum?: string[];
|
|
10
|
+
name?: string;
|
|
11
|
+
relation?: string;
|
|
12
|
+
repeatable?: boolean;
|
|
13
|
+
targetAttribute?: string | null;
|
|
14
|
+
targetField?: string;
|
|
15
|
+
type?: string;
|
|
5
16
|
[key: string]: unknown;
|
|
6
17
|
};
|
|
7
|
-
modifiedData: object;
|
|
8
18
|
};
|
|
9
19
|
export type Attribute = {
|
|
10
20
|
name: string;
|
|
@@ -1,16 +1,65 @@
|
|
|
1
1
|
import { type PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import type { Schema, UID } from '@strapi/types';
|
|
2
|
+
import type { Schema, Struct, UID } from '@strapi/types';
|
|
3
|
+
import type { MessageDescriptor, PrimitiveType } from 'react-intl';
|
|
4
|
+
type FormModalError = MessageDescriptor & {
|
|
5
|
+
values?: Record<string, PrimitiveType>;
|
|
6
|
+
};
|
|
7
|
+
export type ComponentToCreateData = Record<string, unknown> & {
|
|
8
|
+
type?: 'component';
|
|
9
|
+
displayName?: string;
|
|
10
|
+
icon?: string;
|
|
11
|
+
category?: string;
|
|
12
|
+
};
|
|
13
|
+
export type FormModalData = Record<string, unknown> & {
|
|
14
|
+
allowedTypes?: string[];
|
|
15
|
+
category?: string;
|
|
16
|
+
component?: UID.Component;
|
|
17
|
+
components?: UID.Component[];
|
|
18
|
+
componentToCreate?: ComponentToCreateData;
|
|
19
|
+
conditions?: unknown;
|
|
20
|
+
createComponent?: boolean;
|
|
21
|
+
default?: unknown;
|
|
22
|
+
displayName?: string;
|
|
23
|
+
draftAndPublish?: boolean;
|
|
24
|
+
enum?: string[];
|
|
25
|
+
icon?: string;
|
|
26
|
+
kind?: Struct.ContentTypeKind;
|
|
27
|
+
multiple?: boolean;
|
|
28
|
+
name?: string;
|
|
29
|
+
options?: object;
|
|
30
|
+
pluralName?: string;
|
|
31
|
+
pluginOptions?: object;
|
|
32
|
+
relation?: Schema.Attribute.RelationKind.Any;
|
|
33
|
+
repeatable?: boolean;
|
|
34
|
+
required?: boolean;
|
|
35
|
+
singularName?: string;
|
|
36
|
+
target?: string | null;
|
|
37
|
+
targetAttribute?: string | null;
|
|
38
|
+
type?: string;
|
|
39
|
+
};
|
|
40
|
+
type CustomFieldOption = {
|
|
41
|
+
items?: CustomFieldOption[];
|
|
42
|
+
name?: string;
|
|
43
|
+
defaultValue?: unknown;
|
|
44
|
+
};
|
|
45
|
+
type CustomField = {
|
|
46
|
+
type: string;
|
|
47
|
+
options?: {
|
|
48
|
+
base?: CustomFieldOption[];
|
|
49
|
+
advanced?: CustomFieldOption[];
|
|
50
|
+
};
|
|
51
|
+
};
|
|
3
52
|
export type State = {
|
|
4
|
-
formErrors: Record<string,
|
|
5
|
-
modifiedData:
|
|
6
|
-
initialData:
|
|
7
|
-
componentToCreate:
|
|
53
|
+
formErrors: Record<string, FormModalError>;
|
|
54
|
+
modifiedData: FormModalData;
|
|
55
|
+
initialData: FormModalData;
|
|
56
|
+
componentToCreate: ComponentToCreateData;
|
|
8
57
|
isCreatingComponentWhileAddingAField: boolean;
|
|
9
58
|
};
|
|
10
59
|
declare const initialState: State;
|
|
11
60
|
type OnChangePayload = {
|
|
12
61
|
keys: string[];
|
|
13
|
-
value:
|
|
62
|
+
value: unknown;
|
|
14
63
|
};
|
|
15
64
|
type OnChangeRelationTargetPayload = {
|
|
16
65
|
target: {
|
|
@@ -28,45 +77,45 @@ type OnChangeRelationTypePayload = {
|
|
|
28
77
|
};
|
|
29
78
|
type ResetPropsAndSetFormForAddingAnExistingCompoPayload = {
|
|
30
79
|
uid: UID.Schema;
|
|
31
|
-
options?: Record<string,
|
|
80
|
+
options?: Record<string, unknown>;
|
|
32
81
|
};
|
|
33
82
|
type ResetPropsAndSaveCurrentDataPayload = {
|
|
34
83
|
uid: UID.Schema;
|
|
35
|
-
options?: Record<string,
|
|
84
|
+
options?: Record<string, unknown>;
|
|
36
85
|
};
|
|
37
86
|
type SetDataToEditPayload = {
|
|
38
|
-
data:
|
|
87
|
+
data: FormModalData;
|
|
39
88
|
};
|
|
40
89
|
type SetAttributeDataSchemaPayload = {
|
|
41
90
|
isEditing: true;
|
|
42
|
-
modifiedDataToSetForEditing:
|
|
91
|
+
modifiedDataToSetForEditing: FormModalData;
|
|
43
92
|
uid: UID.Schema;
|
|
44
93
|
} | {
|
|
45
94
|
isEditing: false;
|
|
46
|
-
modifiedDataToSetForEditing:
|
|
95
|
+
modifiedDataToSetForEditing: FormModalData;
|
|
47
96
|
attributeType: string;
|
|
48
97
|
nameToSetForRelation: string;
|
|
49
98
|
targetUid: string;
|
|
50
99
|
step: string | null;
|
|
51
|
-
options?: Record<string,
|
|
100
|
+
options?: Record<string, unknown>;
|
|
52
101
|
uid: UID.Schema;
|
|
53
102
|
};
|
|
54
103
|
type SetCustomFieldDataSchemaPayload = {
|
|
55
104
|
isEditing: true;
|
|
56
|
-
modifiedDataToSetForEditing:
|
|
105
|
+
modifiedDataToSetForEditing: FormModalData;
|
|
57
106
|
uid: UID.Schema;
|
|
58
107
|
} | {
|
|
59
108
|
isEditing: false;
|
|
60
|
-
modifiedDataToSetForEditing:
|
|
61
|
-
customField:
|
|
62
|
-
options?: Record<string,
|
|
109
|
+
modifiedDataToSetForEditing: FormModalData;
|
|
110
|
+
customField: CustomField;
|
|
111
|
+
options?: Record<string, unknown>;
|
|
63
112
|
uid: UID.Schema;
|
|
64
113
|
};
|
|
65
114
|
type SetDynamicZoneDataSchemaPayload = {
|
|
66
|
-
attributeToEdit:
|
|
115
|
+
attributeToEdit: FormModalData;
|
|
67
116
|
};
|
|
68
117
|
type SetErrorsPayload = {
|
|
69
|
-
errors: Record<string,
|
|
118
|
+
errors: Record<string, FormModalError>;
|
|
70
119
|
};
|
|
71
120
|
export { initialState };
|
|
72
121
|
export declare const actions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
@@ -77,35 +126,58 @@ export declare const actions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
|
77
126
|
resetPropsAndSetFormForAddingAnExistingCompo: (state: import("immer/dist/internal.js").WritableDraft<State>, action: PayloadAction<ResetPropsAndSetFormForAddingAnExistingCompoPayload>) => {
|
|
78
127
|
modifiedData: {
|
|
79
128
|
type: string;
|
|
80
|
-
repeatable:
|
|
129
|
+
repeatable: true;
|
|
81
130
|
};
|
|
82
|
-
formErrors: Record<string,
|
|
83
|
-
initialData:
|
|
84
|
-
componentToCreate:
|
|
131
|
+
formErrors: Record<string, FormModalError>;
|
|
132
|
+
initialData: FormModalData;
|
|
133
|
+
componentToCreate: ComponentToCreateData;
|
|
85
134
|
isCreatingComponentWhileAddingAField: boolean;
|
|
86
135
|
};
|
|
87
|
-
resetPropsAndSaveCurrentData: (state: import("immer/dist/internal.js").WritableDraft<State>, action: PayloadAction<ResetPropsAndSaveCurrentDataPayload>) => {
|
|
88
|
-
componentToCreate:
|
|
136
|
+
resetPropsAndSaveCurrentData: (state: import("immer/dist/internal.js").WritableDraft<State>, action: PayloadAction<ResetPropsAndSaveCurrentDataPayload>) => State | {
|
|
137
|
+
componentToCreate: import("immer/dist/internal.js").WritableDraft<ComponentToCreateData>;
|
|
89
138
|
modifiedData: {
|
|
90
139
|
component: `${string}.${string}`;
|
|
91
|
-
displayName:
|
|
140
|
+
displayName: string;
|
|
92
141
|
type: string;
|
|
93
142
|
repeatable: boolean;
|
|
94
143
|
};
|
|
95
|
-
isCreatingComponentWhileAddingAField:
|
|
96
|
-
formErrors: Record<string,
|
|
97
|
-
initialData:
|
|
144
|
+
isCreatingComponentWhileAddingAField: boolean;
|
|
145
|
+
formErrors: Record<string, FormModalError>;
|
|
146
|
+
initialData: FormModalData;
|
|
98
147
|
};
|
|
99
148
|
resetPropsAndSetTheFormForAddingACompoToADz: (state: import("immer/dist/internal.js").WritableDraft<State>) => {
|
|
100
149
|
modifiedData: {
|
|
101
150
|
createComponent: boolean;
|
|
102
151
|
componentToCreate: {
|
|
103
|
-
type:
|
|
152
|
+
type: "component";
|
|
104
153
|
};
|
|
154
|
+
allowedTypes?: string[] | undefined;
|
|
155
|
+
category?: string | undefined;
|
|
156
|
+
component?: UID.Component | undefined;
|
|
157
|
+
components?: UID.Component[] | undefined;
|
|
158
|
+
conditions?: unknown;
|
|
159
|
+
default?: unknown;
|
|
160
|
+
displayName?: string | undefined;
|
|
161
|
+
draftAndPublish?: boolean | undefined;
|
|
162
|
+
enum?: string[] | undefined;
|
|
163
|
+
icon?: string | undefined;
|
|
164
|
+
kind?: Struct.ContentTypeKind | undefined;
|
|
165
|
+
multiple?: boolean | undefined;
|
|
166
|
+
name?: string | undefined;
|
|
167
|
+
options?: object | undefined;
|
|
168
|
+
pluralName?: string | undefined;
|
|
169
|
+
pluginOptions?: object | undefined;
|
|
170
|
+
relation?: Schema.Attribute.RelationKind.Any | undefined;
|
|
171
|
+
repeatable?: boolean | undefined;
|
|
172
|
+
required?: boolean | undefined;
|
|
173
|
+
singularName?: string | undefined;
|
|
174
|
+
target?: string | null | undefined;
|
|
175
|
+
targetAttribute?: string | null | undefined;
|
|
176
|
+
type?: string | undefined;
|
|
105
177
|
};
|
|
106
|
-
formErrors: Record<string,
|
|
107
|
-
initialData:
|
|
108
|
-
componentToCreate:
|
|
178
|
+
formErrors: Record<string, FormModalError>;
|
|
179
|
+
initialData: FormModalData;
|
|
180
|
+
componentToCreate: ComponentToCreateData;
|
|
109
181
|
isCreatingComponentWhileAddingAField: boolean;
|
|
110
182
|
};
|
|
111
183
|
setDataToEdit: (state: import("immer/dist/internal.js").WritableDraft<State>, action: PayloadAction<SetDataToEditPayload>) => void;
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
type CustomFieldDefaultOption = {
|
|
2
|
+
name: string;
|
|
3
|
+
defaultValue: unknown;
|
|
4
|
+
};
|
|
5
|
+
type CustomFieldOption = {
|
|
6
|
+
items?: CustomFieldOption[];
|
|
7
|
+
name?: string;
|
|
8
|
+
defaultValue?: unknown;
|
|
9
|
+
};
|
|
10
|
+
export declare const customFieldDefaultOptionsReducer: (acc: CustomFieldDefaultOption[], option: CustomFieldOption) => CustomFieldDefaultOption[];
|
|
11
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Schema } from '@strapi/types';
|
|
2
|
-
declare const shouldPluralizeName: (nature
|
|
3
|
-
declare const shouldPluralizeTargetAttribute: (nature
|
|
2
|
+
declare const shouldPluralizeName: (nature?: Schema.Attribute.RelationKind.Any) => 2 | 1;
|
|
3
|
+
declare const shouldPluralizeTargetAttribute: (nature?: Schema.Attribute.RelationKind.Any) => 2 | 1;
|
|
4
4
|
export { shouldPluralizeName, shouldPluralizeTargetAttribute };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IconByType } from './AttributeIcon';
|
|
2
|
-
import type { Internal } from '@strapi/types';
|
|
2
|
+
import type { Internal, Struct } from '@strapi/types';
|
|
3
3
|
type BaseProps = {
|
|
4
4
|
actionType?: string | null;
|
|
5
5
|
attributeName: string;
|
|
@@ -10,12 +10,9 @@ type BaseProps = {
|
|
|
10
10
|
customFieldUid?: string | null;
|
|
11
11
|
showBackLink?: boolean;
|
|
12
12
|
};
|
|
13
|
-
type FormModalHeaderProps = BaseProps &
|
|
14
|
-
forTarget:
|
|
15
|
-
targetUid: Internal.UID.
|
|
16
|
-
}
|
|
17
|
-
forTarget: 'contentType';
|
|
18
|
-
targetUid: Internal.UID.ContentType;
|
|
19
|
-
});
|
|
13
|
+
type FormModalHeaderProps = BaseProps & {
|
|
14
|
+
forTarget: Struct.ModelType;
|
|
15
|
+
targetUid: Internal.UID.Schema;
|
|
16
|
+
};
|
|
20
17
|
export declare const FormModalHeader: ({ actionType, attributeName, attributeType, contentTypeKind, dynamicZoneTarget, forTarget, modalType, targetUid, customFieldUid, showBackLink, }: FormModalHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
18
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { State, SelectFieldPayload, SelectCustomFieldPayload, NavigateToChooseAttributeModalPayload, NavigateToAddCompoToDZModalPayload, OpenModalAddComponentsToDZPayload, OpenModalEditFieldPayload, OpenModalEditCustomFieldPayload, OpenModalEditSchemaPayload, OpenModalAddFieldPayload } from './FormModalNavigationProvider';
|
|
2
|
+
import type { State, SelectFieldPayload, SelectCustomFieldPayload, NavigateToChooseAttributeModalPayload, NavigateToAddCompoToDZModalPayload, OpenModalAddComponentsToDZPayload, OpenModalEditFieldPayload, OpenModalEditCustomFieldPayload, OpenModalEditSchemaPayload, OpenModalAddFieldPayload, OpenModalCreateSchemaPayload } from './FormModalNavigationProvider';
|
|
3
3
|
export type FormModalNavigationContextValue = State & {
|
|
4
4
|
onCloseModal: () => void;
|
|
5
5
|
onOpenModalAddField: (options: OpenModalAddFieldPayload) => void;
|
|
@@ -9,7 +9,7 @@ export type FormModalNavigationContextValue = State & {
|
|
|
9
9
|
onNavigateToAddCompoToDZModal: (options: NavigateToAddCompoToDZModalPayload) => void;
|
|
10
10
|
onOpenModalAddComponentsToDZ: (options: OpenModalAddComponentsToDZPayload) => void;
|
|
11
11
|
onNavigateToCreateComponentStep2: () => void;
|
|
12
|
-
onOpenModalCreateSchema: (options:
|
|
12
|
+
onOpenModalCreateSchema: (options: OpenModalCreateSchemaPayload) => void;
|
|
13
13
|
onOpenModalEditField: (options: OpenModalEditFieldPayload) => void;
|
|
14
14
|
onOpenModalEditCustomField: (options: OpenModalEditCustomFieldPayload) => void;
|
|
15
15
|
onOpenModalEditSchema: (options: OpenModalEditSchemaPayload) => void;
|
|
@@ -1,11 +1,25 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { Internal, Struct } from '@strapi/types';
|
|
3
2
|
type FormModalNavigationProviderProps = {
|
|
4
3
|
children: React.ReactNode;
|
|
5
4
|
};
|
|
6
5
|
export type Tab = 'basic' | 'advanced';
|
|
7
6
|
export type ModalType = 'chooseAttribute' | 'edit' | 'attribute' | 'customField' | 'addComponentToDynamicZone' | 'contentType' | 'component';
|
|
8
|
-
export type
|
|
7
|
+
export type ActionType = 'create' | 'edit' | null;
|
|
8
|
+
export type State = {
|
|
9
|
+
actionType: Exclude<ActionType, null>;
|
|
10
|
+
attributeName: string;
|
|
11
|
+
attributeType: string;
|
|
12
|
+
dynamicZoneTarget: string;
|
|
13
|
+
forTarget: Struct.ModelType;
|
|
14
|
+
modalType: ModalType | null;
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
showBackLink: boolean;
|
|
17
|
+
kind: Struct.ContentTypeKind;
|
|
18
|
+
step: string | null;
|
|
19
|
+
targetUid: Internal.UID.Schema;
|
|
20
|
+
customFieldUid: string;
|
|
21
|
+
activeTab: Tab;
|
|
22
|
+
};
|
|
9
23
|
export declare const INITIAL_STATE_DATA: State;
|
|
10
24
|
export type SelectCustomFieldPayload = {
|
|
11
25
|
attributeType: string;
|
|
@@ -50,5 +64,6 @@ export type NavigateToChooseAttributeModalPayload = {
|
|
|
50
64
|
export type NavigateToAddCompoToDZModalPayload = {
|
|
51
65
|
dynamicZoneTarget: string;
|
|
52
66
|
};
|
|
67
|
+
export type OpenModalCreateSchemaPayload = Pick<State, 'actionType' | 'forTarget' | 'kind' | 'modalType'>;
|
|
53
68
|
export declare const FormModalNavigationProvider: ({ children }: FormModalNavigationProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
69
|
export {};
|
|
@@ -18,6 +18,11 @@ interface InputOption {
|
|
|
18
18
|
key: string;
|
|
19
19
|
value: string;
|
|
20
20
|
}
|
|
21
|
+
type ConditionField = {
|
|
22
|
+
name: string;
|
|
23
|
+
type: string;
|
|
24
|
+
enum?: string[];
|
|
25
|
+
};
|
|
21
26
|
interface CustomInputProps<TAttribute extends Schema.Attribute.AnyAttribute = Schema.Attribute.AnyAttribute> {
|
|
22
27
|
attribute?: TAttribute;
|
|
23
28
|
autoComplete?: string;
|
|
@@ -31,7 +36,7 @@ interface CustomInputProps<TAttribute extends Schema.Attribute.AnyAttribute = Sc
|
|
|
31
36
|
onChange: (payload: {
|
|
32
37
|
target: {
|
|
33
38
|
name: string;
|
|
34
|
-
value
|
|
39
|
+
value?: unknown;
|
|
35
40
|
type?: string;
|
|
36
41
|
};
|
|
37
42
|
}, shouldSetInitialValue?: boolean) => void;
|
|
@@ -41,10 +46,10 @@ interface CustomInputProps<TAttribute extends Schema.Attribute.AnyAttribute = Sc
|
|
|
41
46
|
required?: boolean;
|
|
42
47
|
step?: number;
|
|
43
48
|
type: string;
|
|
44
|
-
value?:
|
|
49
|
+
value?: unknown;
|
|
45
50
|
autoFocus?: boolean;
|
|
46
51
|
attributeName?: string;
|
|
47
|
-
conditionFields?:
|
|
52
|
+
conditionFields?: ConditionField[];
|
|
48
53
|
}
|
|
49
54
|
interface GenericInputProps<TAttribute extends Schema.Attribute.AnyAttribute = Schema.Attribute.AnyAttribute> {
|
|
50
55
|
attribute?: TAttribute;
|
|
@@ -59,7 +64,7 @@ interface GenericInputProps<TAttribute extends Schema.Attribute.AnyAttribute = S
|
|
|
59
64
|
onChange: (payload: {
|
|
60
65
|
target: {
|
|
61
66
|
name: string;
|
|
62
|
-
value
|
|
67
|
+
value?: unknown;
|
|
63
68
|
type?: string;
|
|
64
69
|
};
|
|
65
70
|
}, shouldSetInitialValue?: boolean) => void;
|
|
@@ -69,17 +74,17 @@ interface GenericInputProps<TAttribute extends Schema.Attribute.AnyAttribute = S
|
|
|
69
74
|
required?: boolean;
|
|
70
75
|
step?: number;
|
|
71
76
|
type: string;
|
|
72
|
-
value?:
|
|
77
|
+
value?: unknown;
|
|
73
78
|
isNullable?: boolean;
|
|
74
79
|
autoFocus?: boolean;
|
|
75
80
|
attributeName?: string;
|
|
76
|
-
conditionFields?:
|
|
81
|
+
conditionFields?: ConditionField[];
|
|
77
82
|
}
|
|
78
83
|
/**
|
|
79
84
|
* we've memoized this component because we use a context to store all the data in our form in the content-manager.
|
|
80
85
|
* This then causes _every_ component to re-render because there are no selects incurring performance issues
|
|
81
86
|
* in content-types as the content-type gets more complicated.
|
|
82
87
|
*/
|
|
83
|
-
declare const MemoizedGenericInput: React.MemoExoticComponent<({ autoComplete, customInputs, description, disabled, intlLabel, labelAction, error, name, onChange, onDelete, options, placeholder, required, step, type, value: defaultValue, isNullable, autoFocus, attribute, attributeName, conditionFields, ...rest }: GenericInputProps) => import("react/jsx-runtime").JSX.Element>;
|
|
88
|
+
declare const MemoizedGenericInput: React.MemoExoticComponent<({ autoComplete, customInputs, description, disabled, intlLabel, labelAction, error, name, onChange, onDelete, options, placeholder, required, step, type, value: defaultValue, isNullable: _isNullable, autoFocus, attribute, attributeName, conditionFields, ...rest }: GenericInputProps) => import("react/jsx-runtime").JSX.Element>;
|
|
84
89
|
export type { GenericInputProps, CustomInputProps };
|
|
85
90
|
export { MemoizedGenericInput as GenericInput };
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import type { IntlLabel } from '../../types';
|
|
1
|
+
import type { FormChangeHandler, IntlLabel } from '../../types';
|
|
2
2
|
export interface IconPickerProps {
|
|
3
3
|
intlLabel: IntlLabel;
|
|
4
4
|
name: string;
|
|
5
|
-
onChange:
|
|
6
|
-
target: {
|
|
7
|
-
name: string;
|
|
8
|
-
value: string;
|
|
9
|
-
};
|
|
10
|
-
}) => void;
|
|
5
|
+
onChange: FormChangeHandler<string>;
|
|
11
6
|
value?: string;
|
|
12
7
|
}
|
|
13
8
|
export declare const IconPicker: ({ intlLabel, name, onChange, value }: IconPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import type { Component, ContentType } from '../types';
|
|
3
2
|
import type { UID } from '@strapi/types';
|
|
4
3
|
export declare const ListGrid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<import("@strapi/design-system").TransientBoxProps & {
|
|
5
|
-
children?:
|
|
4
|
+
children?: React.ReactNode;
|
|
6
5
|
} & import("@strapi/design-system/dist/types").AsProp<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>> & Omit<Omit<any, "ref">, "children" | keyof import("@strapi/design-system/dist/types").AsProp<C> | keyof import("@strapi/design-system").TransientBoxProps> & {
|
|
7
6
|
ref?: any;
|
|
8
7
|
}, "ref"> & {
|
|
9
8
|
ref?: any;
|
|
10
9
|
}, never> & Partial<Pick<Omit<import("@strapi/design-system").TransientBoxProps & {
|
|
11
|
-
children?:
|
|
10
|
+
children?: React.ReactNode;
|
|
12
11
|
} & import("@strapi/design-system/dist/types").AsProp<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>> & Omit<Omit<any, "ref">, "children" | keyof import("@strapi/design-system/dist/types").AsProp<C> | keyof import("@strapi/design-system").TransientBoxProps> & {
|
|
13
12
|
ref?: any;
|
|
14
13
|
}, "ref"> & {
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import type { IntlLabel } from '../types';
|
|
2
|
-
interface Description {
|
|
3
|
-
id: string;
|
|
4
|
-
defaultMessage: string;
|
|
5
|
-
values?: Record<string, any>;
|
|
6
|
-
}
|
|
1
|
+
import type { FormChangeHandler, IntlLabel } from '../types';
|
|
7
2
|
interface PluralNameProps {
|
|
8
|
-
description?:
|
|
3
|
+
description?: IntlLabel;
|
|
9
4
|
error?: string;
|
|
10
5
|
intlLabel: IntlLabel;
|
|
11
|
-
modifiedData:
|
|
6
|
+
modifiedData: {
|
|
7
|
+
displayName?: string;
|
|
8
|
+
};
|
|
12
9
|
name: string;
|
|
13
|
-
onChange:
|
|
14
|
-
target: {
|
|
15
|
-
name: string;
|
|
16
|
-
value: string;
|
|
17
|
-
};
|
|
18
|
-
}) => void;
|
|
10
|
+
onChange: FormChangeHandler<string>;
|
|
19
11
|
value?: string;
|
|
20
12
|
}
|
|
21
13
|
export declare const PluralName: ({ description, error, intlLabel, modifiedData, name, onChange, value, }: PluralNameProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
import type { FormChangeHandler } from '../../types';
|
|
2
|
+
import type { Schema } from '@strapi/types';
|
|
1
3
|
interface RelationProps {
|
|
2
|
-
formErrors: Record<string,
|
|
4
|
+
formErrors: Record<string, {
|
|
5
|
+
id?: string;
|
|
6
|
+
} | undefined>;
|
|
3
7
|
mainBoxHeader: string;
|
|
4
|
-
modifiedData:
|
|
5
|
-
|
|
8
|
+
modifiedData: {
|
|
9
|
+
name?: string;
|
|
10
|
+
relation?: Schema.Attribute.RelationKind.Any;
|
|
11
|
+
target?: string;
|
|
12
|
+
targetAttribute?: string | null;
|
|
13
|
+
};
|
|
14
|
+
onChange: FormChangeHandler;
|
|
6
15
|
naturePickerType: string;
|
|
7
16
|
targetUid: string;
|
|
8
17
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import type { FormChangeHandler } from '../../../types';
|
|
1
2
|
import type { Internal } from '@strapi/types';
|
|
2
3
|
interface RelationFormBoxProps {
|
|
3
4
|
disabled?: boolean;
|
|
4
|
-
error?:
|
|
5
|
+
error?: string | null;
|
|
5
6
|
header?: string;
|
|
6
7
|
isMain?: boolean;
|
|
7
8
|
name: string;
|
|
8
|
-
onChange:
|
|
9
|
+
onChange: FormChangeHandler;
|
|
9
10
|
oneThatIsCreatingARelationWithAnother?: string;
|
|
10
11
|
target?: Internal.UID.ContentType;
|
|
11
12
|
value?: string;
|