@strapi/content-type-builder 5.50.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/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/Messages/Message.d.ts +1 -2
- 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/BooleanDefaultValueSelect.d.ts +3 -3
- package/dist/admin/src/components/BooleanRadioGroup.d.ts +2 -2
- 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/ContentTypeRadioGroup.d.ts +3 -2
- package/dist/admin/src/components/CustomRadioGroup/CustomRadioGroup.d.ts +3 -2
- package/dist/admin/src/components/DataManager/DataManagerContext.d.ts +13 -11
- package/dist/admin/src/components/DataManager/reducer.d.ts +14 -10
- package/dist/admin/src/components/DataManager/utils/cleanData.d.ts +8 -8
- 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/validation/common.d.ts +3 -1
- package/dist/admin/src/components/FormModal/forms/forms.d.ts +59 -26
- 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 -1
- 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/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/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/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/parseNumberInputValue.d.ts +1 -0
- 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/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/package.json +7 -7
|
@@ -50,9 +50,9 @@ declare const stateToRequestData: ({ components, contentTypes, }: {
|
|
|
50
50
|
comment?: string;
|
|
51
51
|
version?: string;
|
|
52
52
|
draftAndPublish?: boolean;
|
|
53
|
-
modelType?: "component" | undefined;
|
|
54
53
|
uid: `${string}.${string}` | `admin::${string}` | `strapi::${string}`;
|
|
55
54
|
options?: import("@strapi/types/dist/struct").SchemaOptions | undefined;
|
|
55
|
+
modelType?: "component" | undefined;
|
|
56
56
|
category: string | undefined;
|
|
57
57
|
modelName?: string | undefined;
|
|
58
58
|
globalId?: string | undefined;
|
|
@@ -84,9 +84,9 @@ declare const stateToRequestData: ({ components, contentTypes, }: {
|
|
|
84
84
|
comment?: string;
|
|
85
85
|
version?: string;
|
|
86
86
|
draftAndPublish?: boolean;
|
|
87
|
-
modelType?: "component" | undefined;
|
|
88
87
|
uid: `${string}.${string}` | `admin::${string}` | `strapi::${string}`;
|
|
89
88
|
options?: import("@strapi/types/dist/struct").SchemaOptions | undefined;
|
|
89
|
+
modelType?: "component" | undefined;
|
|
90
90
|
category: string | undefined;
|
|
91
91
|
modelName?: string | undefined;
|
|
92
92
|
globalId?: string | undefined;
|
|
@@ -117,9 +117,9 @@ declare const stateToRequestData: ({ components, contentTypes, }: {
|
|
|
117
117
|
version?: string;
|
|
118
118
|
draftAndPublish?: boolean;
|
|
119
119
|
kind?: import("@strapi/types/dist/struct").ContentTypeKind | undefined;
|
|
120
|
-
modelType?: "contentType" | undefined;
|
|
121
120
|
uid: `${string}.${string}` | `admin::${string}` | `strapi::${string}`;
|
|
122
121
|
options?: import("@strapi/types/dist/struct").SchemaOptions | undefined;
|
|
122
|
+
modelType?: "contentType" | undefined;
|
|
123
123
|
modelName?: string | undefined;
|
|
124
124
|
globalId?: string | undefined;
|
|
125
125
|
pluginOptions?: import("@strapi/types/dist/struct").SchemaPluginOptions | undefined;
|
|
@@ -156,9 +156,9 @@ declare const stateToRequestData: ({ components, contentTypes, }: {
|
|
|
156
156
|
version?: string;
|
|
157
157
|
draftAndPublish?: boolean;
|
|
158
158
|
kind?: import("@strapi/types/dist/struct").ContentTypeKind | undefined;
|
|
159
|
-
modelType?: "contentType" | undefined;
|
|
160
159
|
uid: `${string}.${string}` | `admin::${string}` | `strapi::${string}`;
|
|
161
160
|
options?: import("@strapi/types/dist/struct").SchemaOptions | undefined;
|
|
161
|
+
modelType?: "contentType" | undefined;
|
|
162
162
|
modelName?: string | undefined;
|
|
163
163
|
globalId?: string | undefined;
|
|
164
164
|
pluginOptions?: import("@strapi/types/dist/struct").SchemaPluginOptions | undefined;
|
|
@@ -196,9 +196,9 @@ declare const stateToRequestData: ({ components, contentTypes, }: {
|
|
|
196
196
|
comment?: string;
|
|
197
197
|
version?: string;
|
|
198
198
|
draftAndPublish?: boolean;
|
|
199
|
-
modelType?: "component" | undefined;
|
|
200
199
|
uid: `${string}.${string}` | `admin::${string}` | `strapi::${string}`;
|
|
201
200
|
options?: import("@strapi/types/dist/struct").SchemaOptions | undefined;
|
|
201
|
+
modelType?: "component" | undefined;
|
|
202
202
|
category: string | undefined;
|
|
203
203
|
modelName?: string | undefined;
|
|
204
204
|
globalId?: string | undefined;
|
|
@@ -230,9 +230,9 @@ declare const stateToRequestData: ({ components, contentTypes, }: {
|
|
|
230
230
|
comment?: string;
|
|
231
231
|
version?: string;
|
|
232
232
|
draftAndPublish?: boolean;
|
|
233
|
-
modelType?: "component" | undefined;
|
|
234
233
|
uid: `${string}.${string}` | `admin::${string}` | `strapi::${string}`;
|
|
235
234
|
options?: import("@strapi/types/dist/struct").SchemaOptions | undefined;
|
|
235
|
+
modelType?: "component" | undefined;
|
|
236
236
|
category: string | undefined;
|
|
237
237
|
modelName?: string | undefined;
|
|
238
238
|
globalId?: string | undefined;
|
|
@@ -263,9 +263,9 @@ declare const stateToRequestData: ({ components, contentTypes, }: {
|
|
|
263
263
|
version?: string;
|
|
264
264
|
draftAndPublish?: boolean;
|
|
265
265
|
kind?: import("@strapi/types/dist/struct").ContentTypeKind | undefined;
|
|
266
|
-
modelType?: "contentType" | undefined;
|
|
267
266
|
uid: `${string}.${string}` | `admin::${string}` | `strapi::${string}`;
|
|
268
267
|
options?: import("@strapi/types/dist/struct").SchemaOptions | undefined;
|
|
268
|
+
modelType?: "contentType" | undefined;
|
|
269
269
|
modelName?: string | undefined;
|
|
270
270
|
globalId?: string | undefined;
|
|
271
271
|
pluginOptions?: import("@strapi/types/dist/struct").SchemaPluginOptions | undefined;
|
|
@@ -302,9 +302,9 @@ declare const stateToRequestData: ({ components, contentTypes, }: {
|
|
|
302
302
|
version?: string;
|
|
303
303
|
draftAndPublish?: boolean;
|
|
304
304
|
kind?: import("@strapi/types/dist/struct").ContentTypeKind | undefined;
|
|
305
|
-
modelType?: "contentType" | undefined;
|
|
306
305
|
uid: `${string}.${string}` | `admin::${string}` | `strapi::${string}`;
|
|
307
306
|
options?: import("@strapi/types/dist/struct").SchemaOptions | undefined;
|
|
307
|
+
modelType?: "contentType" | undefined;
|
|
308
308
|
modelName?: string | undefined;
|
|
309
309
|
globalId?: string | undefined;
|
|
310
310
|
pluginOptions?: import("@strapi/types/dist/struct").SchemaPluginOptions | undefined;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
1
|
+
import type { AnyAttribute } from '../../../types';
|
|
2
|
+
type AttributeInput = Omit<AnyAttribute, 'name'>;
|
|
3
|
+
export declare const formatSchema: <TSchema extends {
|
|
4
|
+
attributes: Record<string, AttributeInput>;
|
|
5
|
+
}>(schema: TSchema) => TSchema & {
|
|
6
|
+
attributes: AnyAttribute[];
|
|
7
|
+
};
|
|
8
|
+
export declare const toAttributesArray: (attributes: Record<string, AttributeInput>) => AnyAttribute[];
|
|
9
|
+
export {};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Components } from '../../../types';
|
|
2
|
+
export declare const retrieveSpecificInfoFromComponents: (allComponents: Components, keysToRetrieve: string[]) => string[];
|
|
@@ -4,13 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
import type { IntlLabel } from '../types';
|
|
7
|
-
interface Description {
|
|
8
|
-
id: string;
|
|
9
|
-
defaultMessage: string;
|
|
10
|
-
values?: Record<string, any>;
|
|
11
|
-
}
|
|
12
7
|
interface DraftAndPublishToggleProps {
|
|
13
|
-
description?:
|
|
8
|
+
description?: IntlLabel;
|
|
14
9
|
disabled?: boolean;
|
|
15
10
|
intlLabel: IntlLabel;
|
|
16
11
|
isCreating: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ComponentType } from 'react';
|
|
1
|
+
import { type ComponentType } from 'react';
|
|
2
2
|
import type { Internal, Struct } from '@strapi/types';
|
|
3
3
|
interface DynamicZoneListProps {
|
|
4
4
|
addComponent: (name?: string) => void;
|
|
5
5
|
components: Array<Internal.UID.Component>;
|
|
6
|
-
customRowComponent?: ComponentType<
|
|
6
|
+
customRowComponent?: ComponentType<Record<string, unknown>>;
|
|
7
7
|
name?: string;
|
|
8
8
|
forTarget: Struct.ModelType;
|
|
9
9
|
targetUid: Internal.UID.Schema;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { AttributeConditions } from '../../../types';
|
|
1
2
|
interface ConditionFormProps {
|
|
2
3
|
name: string;
|
|
3
|
-
value
|
|
4
|
+
value?: AttributeConditions | null;
|
|
4
5
|
onChange: (e: {
|
|
5
6
|
target: {
|
|
6
7
|
name: string;
|
|
7
|
-
value
|
|
8
|
+
value?: AttributeConditions | null;
|
|
8
9
|
};
|
|
9
10
|
}) => void;
|
|
10
11
|
onDelete: () => void;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
declare const NAME_REGEX: RegExp;
|
|
3
3
|
declare const alreadyUsedAttributeNames: (usedNames: Array<string>) => yup.TestConfig<string | undefined, Record<string, unknown>>;
|
|
4
|
-
declare const getUsedContentTypeAttributeNames: (ctShema:
|
|
4
|
+
declare const getUsedContentTypeAttributeNames: (ctShema: {
|
|
5
|
+
attributes?: Record<string, unknown>;
|
|
6
|
+
}, isEdition: boolean, attributeNameToEdit: string) => string[];
|
|
5
7
|
declare const isNameAllowed: (reservedNames: Array<string>) => yup.TestConfig<string | undefined, Record<string, unknown>>;
|
|
6
8
|
declare const validators: {
|
|
7
9
|
default: () => yup.default<string | null | undefined, Record<string, any>, string | null | undefined>;
|
|
@@ -1,48 +1,75 @@
|
|
|
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
71
|
advanced({ data, type, step, extensions, ...rest }: Base<"advanced">): {
|
|
45
|
-
sections:
|
|
72
|
+
sections: FormTypeOptions;
|
|
46
73
|
};
|
|
47
74
|
base({ data, type, step, attributes }: Base<"base">): {
|
|
48
75
|
sections: {
|
|
@@ -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;
|
|
@@ -4,7 +4,22 @@ type FormModalNavigationProviderProps = {
|
|
|
4
4
|
};
|
|
5
5
|
export type Tab = 'basic' | 'advanced';
|
|
6
6
|
export type ModalType = 'chooseAttribute' | 'edit' | 'attribute' | 'customField' | 'addComponentToDynamicZone' | 'contentType' | 'component';
|
|
7
|
-
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
|
+
};
|
|
8
23
|
export declare const INITIAL_STATE_DATA: State;
|
|
9
24
|
export type SelectCustomFieldPayload = {
|
|
10
25
|
attributeType: string;
|
|
@@ -49,5 +64,6 @@ export type NavigateToChooseAttributeModalPayload = {
|
|
|
49
64
|
export type NavigateToAddCompoToDZModalPayload = {
|
|
50
65
|
dynamicZoneTarget: string;
|
|
51
66
|
};
|
|
67
|
+
export type OpenModalCreateSchemaPayload = Pick<State, 'actionType' | 'forTarget' | 'kind' | 'modalType'>;
|
|
52
68
|
export declare const FormModalNavigationProvider: ({ children }: FormModalNavigationProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
69
|
export {};
|