@strapi/content-type-builder 5.0.0-beta.9 → 5.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -3
- package/dist/_chunks/{ListView-Cno8sA_Y.mjs → ListView-CYfzT9Ss.mjs} +2 -2
- package/dist/_chunks/{ListView-Cno8sA_Y.mjs.map → ListView-CYfzT9Ss.mjs.map} +1 -1
- package/dist/_chunks/{ListView-ox2gEeAO.js → ListView-DVskSF0B.js} +2 -2
- package/dist/_chunks/{ListView-ox2gEeAO.js.map → ListView-DVskSF0B.js.map} +1 -1
- package/dist/_chunks/{en-BnToboMV.js → en-CXG5y_vo.js} +2 -2
- package/dist/_chunks/{en-BnToboMV.js.map → en-CXG5y_vo.js.map} +1 -1
- package/dist/_chunks/{en-BbczxQBr.mjs → en-jBwb53yg.mjs} +2 -2
- package/dist/_chunks/{en-BbczxQBr.mjs.map → en-jBwb53yg.mjs.map} +1 -1
- package/dist/_chunks/{index-BvIMb5nJ.mjs → index-4pWiYAr9.mjs} +12 -14
- package/dist/_chunks/index-4pWiYAr9.mjs.map +1 -0
- package/dist/_chunks/{index-DT8SxJEc.js → index-DcOZkn-n.js} +342 -319
- package/dist/_chunks/index-DcOZkn-n.js.map +1 -0
- package/dist/_chunks/{index-V_IPu6ZX.mjs → index-KxDs8xjD.mjs} +344 -321
- package/dist/_chunks/index-KxDs8xjD.mjs.map +1 -0
- package/dist/_chunks/{index-CafZdqdd.js → index-vzttgmyT.js} +12 -14
- package/dist/_chunks/index-vzttgmyT.js.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/AttributeOptions/OptionBoxWrapper.d.ts +7 -3
- package/dist/admin/src/components/BoxWrapper.d.ts +7 -3
- package/dist/admin/src/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.d.ts +1 -0
- package/dist/admin/src/components/DataManagerProvider/utils/retrieveComponentsThatHaveComponents.d.ts +11 -3
- package/dist/admin/src/components/DataManagerProvider/utils/retrieveNestedComponents.d.ts +8 -1
- package/dist/admin/src/components/FormModal/utils/getAttributesToDisplay.d.ts +2 -1
- package/dist/admin/src/components/ListRow.d.ts +7 -3
- package/dist/admin/src/components/Relation/RelationNaturePicker/Components.d.ts +12 -4
- package/dist/admin/src/components/SelectCategory.d.ts +2 -1
- package/dist/admin/src/components/SelectComponent.d.ts +2 -1
- package/dist/admin/src/constants.d.ts +1 -0
- package/dist/admin/src/utils/getMaxDepth.d.ts +23 -0
- package/dist/server/index.js +3 -22
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +3 -22
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/validation/types.d.ts.map +1 -1
- package/dist/server/src/utils/attributes.d.ts +1 -2
- package/dist/server/src/utils/attributes.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/_chunks/index-BvIMb5nJ.mjs.map +0 -1
- package/dist/_chunks/index-CafZdqdd.js.map +0 -1
- package/dist/_chunks/index-DT8SxJEc.js.map +0 -1
- package/dist/_chunks/index-V_IPu6ZX.mjs.map +0 -1
|
@@ -45,7 +45,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
|
45
45
|
});
|
|
46
46
|
};
|
|
47
47
|
const name$1 = "@strapi/content-type-builder";
|
|
48
|
-
const version = "5.0.0-
|
|
48
|
+
const version = "5.0.0-rc.0";
|
|
49
49
|
const description = "Create and manage content types";
|
|
50
50
|
const repository = {
|
|
51
51
|
type: "git",
|
|
@@ -103,10 +103,10 @@ const scripts = {
|
|
|
103
103
|
const dependencies = {
|
|
104
104
|
"@reduxjs/toolkit": "1.9.7",
|
|
105
105
|
"@sindresorhus/slugify": "1.1.0",
|
|
106
|
-
"@strapi/design-system": "2.0.0-beta.
|
|
107
|
-
"@strapi/generators": "5.0.0-
|
|
108
|
-
"@strapi/icons": "2.0.0-beta.
|
|
109
|
-
"@strapi/utils": "5.0.0-
|
|
106
|
+
"@strapi/design-system": "2.0.0-beta.6",
|
|
107
|
+
"@strapi/generators": "5.0.0-rc.0",
|
|
108
|
+
"@strapi/icons": "2.0.0-beta.6",
|
|
109
|
+
"@strapi/utils": "5.0.0-rc.0",
|
|
110
110
|
"date-fns": "2.30.0",
|
|
111
111
|
"fs-extra": "11.2.0",
|
|
112
112
|
immer: "9.0.21",
|
|
@@ -118,9 +118,9 @@ const dependencies = {
|
|
|
118
118
|
yup: "0.32.9"
|
|
119
119
|
};
|
|
120
120
|
const devDependencies = {
|
|
121
|
-
"@strapi/admin": "5.0.0-
|
|
121
|
+
"@strapi/admin": "5.0.0-rc.0",
|
|
122
122
|
"@strapi/pack-up": "5.0.0",
|
|
123
|
-
"@strapi/types": "5.0.0-
|
|
123
|
+
"@strapi/types": "5.0.0-rc.0",
|
|
124
124
|
"@testing-library/react": "15.0.7",
|
|
125
125
|
"@testing-library/user-event": "14.5.2",
|
|
126
126
|
"@types/fs-extra": "11.0.4",
|
|
@@ -176,6 +176,7 @@ const PERMISSIONS = {
|
|
|
176
176
|
// plugin directly in the browser
|
|
177
177
|
main: [{ action: "plugin::content-type-builder.read", subject: null }]
|
|
178
178
|
};
|
|
179
|
+
const MAX_COMPONENT_DEPTH = 6;
|
|
179
180
|
const pluginId = pluginPkg.name.replace(/^@strapi\//i, "");
|
|
180
181
|
const getRelationType = (relation, targetAttribute) => {
|
|
181
182
|
const hasNotTargetAttribute = targetAttribute === void 0 || targetAttribute === null;
|
|
@@ -607,10 +608,6 @@ const reducer$1 = (state = initialState$1, action) => produce__default.default(s
|
|
|
607
608
|
draftState.initialData = draftState.modifiedData;
|
|
608
609
|
break;
|
|
609
610
|
}
|
|
610
|
-
case UPDATE_INITIAL_STATE: {
|
|
611
|
-
draftState.initialData = draftState.modifiedData;
|
|
612
|
-
break;
|
|
613
|
-
}
|
|
614
611
|
case DELETE_NOT_SAVED_TYPE: {
|
|
615
612
|
draftState.contentTypes = state.initialContentTypes;
|
|
616
613
|
draftState.components = state.initialComponents;
|
|
@@ -1134,7 +1131,7 @@ const index = {
|
|
|
1134
1131
|
defaultMessage: "Content Types Builder"
|
|
1135
1132
|
},
|
|
1136
1133
|
permissions: PERMISSIONS.main,
|
|
1137
|
-
Component: () => Promise.resolve().then(() => require("./index-
|
|
1134
|
+
Component: () => Promise.resolve().then(() => require("./index-DcOZkn-n.js")).then((n) => n.index),
|
|
1138
1135
|
position: 5
|
|
1139
1136
|
});
|
|
1140
1137
|
app.registerPlugin({
|
|
@@ -1151,7 +1148,7 @@ const index = {
|
|
|
1151
1148
|
async registerTrads({ locales }) {
|
|
1152
1149
|
const importedTrads = await Promise.all(
|
|
1153
1150
|
locales.map((locale) => {
|
|
1154
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-OCxhAFUy.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-Ci3js5EC.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-DnlblIOh.js")), "./translations/dk.json": () => Promise.resolve().then(() => require("./dk-D3XnOjYz.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-
|
|
1151
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-OCxhAFUy.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-Ci3js5EC.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-DnlblIOh.js")), "./translations/dk.json": () => Promise.resolve().then(() => require("./dk-D3XnOjYz.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-CXG5y_vo.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-DL8lez9W.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-DnTxugIo.js")), "./translations/id.json": () => Promise.resolve().then(() => require("./id-DYuTgqcc.js")), "./translations/it.json": () => Promise.resolve().then(() => require("./it-DS4sM3km.js")), "./translations/ja.json": () => Promise.resolve().then(() => require("./ja-BjouJgZf.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-D_71Pdfn.js")), "./translations/ms.json": () => Promise.resolve().then(() => require("./ms-Re1pSHmx.js")), "./translations/nl.json": () => Promise.resolve().then(() => require("./nl-DQjrDEw0.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-BGwXgwH7.js")), "./translations/pt-BR.json": () => Promise.resolve().then(() => require("./pt-BR-DPd5nRnl.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-CJoUDTHQ.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-C8A_4j0w.js")), "./translations/sk.json": () => Promise.resolve().then(() => require("./sk-raWRcmPT.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("./sv-BNN71SFE.js")), "./translations/th.json": () => Promise.resolve().then(() => require("./th-C83Bb_kR.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-BW20CfcO.js")), "./translations/uk.json": () => Promise.resolve().then(() => require("./uk-VwB0oiuV.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-CLTLm_nt.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-BiOCwPJu.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
|
|
1155
1152
|
return {
|
|
1156
1153
|
data: prefixPluginTranslations(data, pluginId),
|
|
1157
1154
|
locale
|
|
@@ -1177,6 +1174,7 @@ exports.DELETE_NOT_SAVED_TYPE = DELETE_NOT_SAVED_TYPE;
|
|
|
1177
1174
|
exports.EDIT_ATTRIBUTE = EDIT_ATTRIBUTE;
|
|
1178
1175
|
exports.EDIT_CUSTOM_FIELD_ATTRIBUTE = EDIT_CUSTOM_FIELD_ATTRIBUTE;
|
|
1179
1176
|
exports.GET_DATA_SUCCEEDED = GET_DATA_SUCCEEDED;
|
|
1177
|
+
exports.MAX_COMPONENT_DEPTH = MAX_COMPONENT_DEPTH;
|
|
1180
1178
|
exports.ON_CHANGE = ON_CHANGE;
|
|
1181
1179
|
exports.ON_CHANGE_RELATION_TARGET = ON_CHANGE_RELATION_TARGET;
|
|
1182
1180
|
exports.ON_CHANGE_RELATION_TYPE = ON_CHANGE_RELATION_TYPE;
|
|
@@ -1207,4 +1205,4 @@ exports.makeUnique = makeUnique;
|
|
|
1207
1205
|
exports.nameToSlug = nameToSlug;
|
|
1208
1206
|
exports.pluginId = pluginId;
|
|
1209
1207
|
exports.retrieveComponentsFromSchema = retrieveComponentsFromSchema;
|
|
1210
|
-
//# sourceMappingURL=index-
|
|
1208
|
+
//# sourceMappingURL=index-vzttgmyT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-vzttgmyT.js","sources":["../../admin/src/constants.ts","../../admin/src/pluginId.ts","../../admin/src/utils/getRelationType.ts","../../admin/src/utils/makeUnique.ts","../../admin/src/components/DataManagerProvider/constants.ts","../../admin/src/components/DataManagerProvider/utils/retrieveComponentsFromSchema.ts","../../admin/src/components/DataManagerProvider/reducer.ts","../../admin/src/utils/nameToSlug.ts","../../admin/src/components/FormModal/constants.ts","../../admin/src/components/FormModal/utils/createUid.ts","../../admin/src/components/FormModal/utils/customFieldDefaultOptionsReducer.ts","../../admin/src/components/FormModal/utils/relations.ts","../../admin/src/components/FormModal/reducer.ts","../../admin/src/reducers.ts","../../admin/src/utils/formAPI.ts","../../admin/src/utils/prefixPluginTranslations.ts","../../admin/src/index.ts"],"sourcesContent":["export const PERMISSIONS = {\n // This permission regards the main component (App) and is used to tell\n // If the plugin link should be displayed in the menu\n // And also if the plugin is accessible. This use case is found when a user types the url of the\n // plugin directly in the browser\n main: [{ action: 'plugin::content-type-builder.read', subject: null }],\n};\n\nexport const MAX_COMPONENT_DEPTH = 6;\n","import pluginPkg from '../../package.json';\n\nexport const pluginId = pluginPkg.name.replace(/^@strapi\\//i, '');\n","import type { Schema } from '@strapi/types';\n\n/**\n *\n * Retrieves the relation type\n */\nexport const getRelationType = (\n relation: Schema.Attribute.RelationKind.WithTarget | undefined,\n targetAttribute?: string | null\n) => {\n const hasNotTargetAttribute = targetAttribute === undefined || targetAttribute === null;\n\n if (relation === 'oneToOne' && hasNotTargetAttribute) {\n return 'oneWay';\n }\n\n if (relation === 'oneToMany' && hasNotTargetAttribute) {\n return 'manyWay';\n }\n\n return relation;\n};\n","const makeUnique = <T extends string>(array: T[]): T[] => [...new Set(array)];\n\nexport { makeUnique };\n","export const ADD_ATTRIBUTE = 'ContentTypeBuilder/DataManagerProvider/ADD_ATTRIBUTE';\nexport const ADD_CUSTOM_FIELD_ATTRIBUTE =\n 'ContentTypeBuilder/DataManagerProvider/ADD_CUSTOM_FIELD_ATTRIBUTE';\nexport const ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE =\n 'ContentTypeBuilder/DataManagerProvider/ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE';\nexport const CHANGE_DYNAMIC_ZONE_COMPONENTS =\n 'ContentTypeBuilder/DataManagerProvider/CHANGE_DYNAMIC_ZONE_COMPONENTS';\nexport const CREATE_SCHEMA = 'ContentTypeBuilder/DataManagerProvider/CREATE_SCHEMA';\nexport const CREATE_COMPONENT_SCHEMA =\n 'ContentTypeBuilder/DataManagerProvider/CREATE_COMPONENT_SCHEMA';\nexport const DELETE_NOT_SAVED_TYPE = 'ContentTypeBuilder/DataManagerProvider/DELETE_NOT_SAVED_TYPE';\nexport const EDIT_ATTRIBUTE = 'ContentTypeBuilder/DataManagerProvider/EDIT_ATTRIBUTE';\nexport const EDIT_CUSTOM_FIELD_ATTRIBUTE =\n 'ContentTypeBuilder/DataManagerProvider/EDIT_CUSTOM_FIELD_ATTRIBUTE';\nexport const GET_DATA_SUCCEEDED = 'ContentTypeBuilder/DataManagerProvider/GET_DATA_SUCCEEDED';\nexport const RELOAD_PLUGIN = 'ContentTypeBuilder/DataManagerProvider/RELOAD_PLUGIN';\nexport const REMOVE_FIELD_FROM_DISPLAYED_COMPONENT =\n 'ContentTypeBuilder/DataManagerProvider/REMOVE_FIELD_FROM_DISPLAYED_COMPONENT';\nexport const REMOVE_COMPONENT_FROM_DYNAMIC_ZONE =\n 'ContentTypeBuilder/DataManagerProvider/REMOVE_COMPONENT_FROM_DYNAMIC_ZONE';\nexport const REMOVE_FIELD = 'ContentTypeBuilder/DataManagerProvider/REMOVE_FIELD';\nexport const SET_MODIFIED_DATA = 'ContentTypeBuilder/DataManagerProvider/SET_MODIFIED_DATA';\nexport const UPDATE_SCHEMA = 'ContentTypeBuilder/DataManagerProvider/UPDATE_SCHEMA';\nexport const UPDATE_INITIAL_STATE = 'ContentTypeBuilder/DataManagerProvider/UPDATE_INITIAL_STATE';\n","import get from 'lodash/get';\n\nimport { makeUnique } from '../../../utils/makeUnique';\n\nimport type { AttributeType, Components } from '../../../types';\nimport type { Internal } from '@strapi/types';\n\nconst retrieveComponentsFromSchema = (\n attributes: AttributeType[],\n allComponentsData: Components\n): Internal.UID.Component[] => {\n const allComponents: Internal.UID.Component[] = attributes.reduce((acc: any, current) => {\n const type = current.type;\n if (type === 'component') {\n const currentComponentName = current.component;\n // Push the existing compo\n acc.push(currentComponentName);\n\n const currentComponentAttributes = get(\n allComponentsData,\n [currentComponentName, 'schema', 'attributes'],\n []\n );\n\n // Retrieve the nested ones\n acc.push(...retrieveComponentsFromSchema(currentComponentAttributes, allComponentsData));\n }\n\n if (type === 'dynamiczone') {\n const dynamicZoneComponents = current.components;\n const componentsFromDZComponents = dynamicZoneComponents.reduce((acc2: any, currentUid) => {\n const compoAttrs = get(allComponentsData, [currentUid, 'schema', 'attributes'], []);\n\n return [...acc2, ...retrieveComponentsFromSchema(compoAttrs, allComponentsData)];\n }, []);\n\n return [...acc, ...dynamicZoneComponents, ...componentsFromDZComponents];\n }\n\n return acc;\n }, []);\n\n return makeUnique<Internal.UID.Component>(allComponents);\n};\n\nexport { retrieveComponentsFromSchema };\n","import produce, { current } from 'immer';\nimport get from 'lodash/get';\nimport set from 'lodash/set';\n\nimport { getRelationType } from '../../utils/getRelationType';\nimport { makeUnique } from '../../utils/makeUnique';\n\nimport * as actions from './constants';\nimport { retrieveComponentsFromSchema } from './utils/retrieveComponentsFromSchema';\n\nimport type { DataManagerStateType, ContentType, AttributeType, Component } from '../../types';\nimport type { Internal, Schema } from '@strapi/types';\n\n// TODO: Define all possible actions based on type\nexport type Action = {\n type: string;\n uid?: string;\n mainDataKey: 'component' | 'components' | 'contentTypes' | 'contentType';\n schemaType: 'component' | 'contentType';\n attributeToRemoveName?: string;\n [key: string]: any;\n};\n\nconst initialState: DataManagerStateType = {\n components: {},\n contentTypes: {},\n initialComponents: {},\n initialContentTypes: {},\n initialData: {},\n modifiedData: {\n components: {},\n contentTypes: {},\n },\n reservedNames: {},\n isLoading: true,\n isLoadingForDataToBeSet: true,\n};\n\nconst ONE_SIDE_RELATIONS = ['oneWay', 'manyWay'];\n\nconst getOppositeRelation = (originalRelation?: Schema.Attribute.RelationKind.WithTarget) => {\n if (originalRelation === 'manyToOne') {\n return 'oneToMany';\n }\n\n if (originalRelation === 'oneToMany') {\n return 'manyToOne';\n }\n\n return originalRelation;\n};\n\nconst findAttributeIndex = (schema: any, attributeToFind?: string) => {\n return schema.schema.attributes.findIndex(\n ({ name }: { name: string }) => name === attributeToFind\n );\n};\n\nconst reducer = (state = initialState, action: Action) =>\n produce(state, (draftState: any) => {\n switch (action.type) {\n case actions.ADD_ATTRIBUTE: {\n const {\n attributeToSet: { name, ...rest },\n forTarget,\n targetUid,\n } = action;\n delete rest.createComponent;\n\n const pathToDataToEdit = ['component', 'contentType'].includes(forTarget)\n ? [forTarget]\n : [forTarget, targetUid];\n\n const currentAttributes = get(\n state,\n ['modifiedData', ...pathToDataToEdit, 'schema', 'attributes'],\n []\n ).slice();\n\n // Add the createdAttribute\n const updatedAttributes = [...currentAttributes, { ...rest, name }];\n\n set(\n draftState,\n ['modifiedData', ...pathToDataToEdit, 'schema', 'attributes'],\n updatedAttributes\n );\n\n if (action.shouldAddComponentToData) {\n const componentToAddUID = rest.component;\n const componentToAdd = state.components[componentToAddUID];\n const isTemporaryComponent = componentToAdd?.isTemporary;\n const hasComponentAlreadyBeenAdded =\n state.modifiedData.components?.[componentToAddUID] !== undefined;\n\n if (isTemporaryComponent || hasComponentAlreadyBeenAdded) {\n break;\n }\n\n // Initialize modifiedData.components if it is undefined\n if (!draftState.modifiedData.components) {\n draftState.modifiedData.components = {};\n }\n\n // Add the added component to the modifiedData.components\n draftState.modifiedData.components[componentToAddUID] = componentToAdd;\n\n const nestedComponents = retrieveComponentsFromSchema(\n componentToAdd.schema.attributes as AttributeType[],\n state.components\n );\n\n // We dont' need to set the already added components otherwise all modifications will be lost so we need to only add the not modified ones\n const nestedComponentsToAddInModifiedData = nestedComponents.filter(\n (compoUID: Internal.UID.Component) => {\n return get(state, ['modifiedData', 'components', compoUID]) === undefined;\n }\n );\n\n nestedComponentsToAddInModifiedData.forEach((compoUID: Internal.UID.Component) => {\n const compoSchema = get(state, ['components', compoUID], {}) as Component;\n const isTemporary = compoSchema.isTemporary || false;\n\n // If the nested component has not been saved we don't need to add them as they are already in the state\n if (!isTemporary) {\n if (!draftState.modifiedData.components) {\n draftState.modifiedData.components = {};\n }\n draftState.modifiedData.components[compoUID] = compoSchema;\n }\n });\n\n break;\n }\n\n const isCreatingRelationAttribute = rest.type === 'relation';\n\n if (isCreatingRelationAttribute) {\n const target = rest.target;\n const targetAttribute = rest.targetAttribute || null;\n const relation = rest.relation;\n const relationType = getRelationType(relation, targetAttribute);\n const currentUid = get(state, ['modifiedData', ...pathToDataToEdit, 'uid']);\n\n // When the user in creating a relation with the same content type we need to create another attribute\n // that is the opposite of the created one\n if (\n rest.type === 'relation' &&\n relationType !== 'oneWay' &&\n relationType !== 'manyWay' &&\n target === currentUid\n ) {\n const oppositeAttribute = {\n name: targetAttribute,\n relation: getOppositeRelation(relationType),\n target,\n targetAttribute: name,\n type: 'relation',\n } as AttributeType;\n\n if (rest.private) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n oppositeAttribute.private = rest.private;\n }\n\n const attributesToSet = [...updatedAttributes, oppositeAttribute];\n\n set(\n draftState,\n ['modifiedData', ...pathToDataToEdit, 'schema', 'attributes'],\n attributesToSet\n );\n }\n }\n\n break;\n }\n case actions.ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE: {\n const { dynamicZoneTarget, componentsToAdd } = action;\n\n const dzAttributeIndex = findAttributeIndex(\n state.modifiedData.contentType,\n dynamicZoneTarget\n );\n\n componentsToAdd.forEach((componentUid: Internal.UID.Component) => {\n if (\n !draftState.modifiedData.contentType?.schema.attributes[dzAttributeIndex].components\n ) {\n draftState.modifiedData.contentType.schema.attributes[dzAttributeIndex].components = [];\n }\n draftState.modifiedData.contentType.schema.attributes[dzAttributeIndex].components.push(\n componentUid\n );\n });\n\n break;\n }\n case actions.ADD_CUSTOM_FIELD_ATTRIBUTE: {\n const {\n attributeToSet: { name, ...rest },\n forTarget,\n targetUid,\n } = action;\n\n const pathToDataToEdit = ['component', 'contentType'].includes(forTarget)\n ? [forTarget]\n : [forTarget, targetUid];\n\n const currentAttributes = get(\n state,\n ['modifiedData', ...pathToDataToEdit, 'schema', 'attributes'],\n []\n ).slice();\n\n // Add the createdAttribute\n const updatedAttributes = [...currentAttributes, { ...rest, name }];\n\n set(\n draftState,\n ['modifiedData', ...pathToDataToEdit, 'schema', 'attributes'],\n updatedAttributes\n );\n\n break;\n }\n case actions.CHANGE_DYNAMIC_ZONE_COMPONENTS: {\n const { dynamicZoneTarget, newComponents } = action;\n\n const dzAttributeIndex = findAttributeIndex(\n state.modifiedData.contentType,\n dynamicZoneTarget\n );\n\n const currentDZComponents =\n (state.modifiedData.contentType?.schema.attributes[dzAttributeIndex]).components;\n\n const updatedComponents = makeUnique([...currentDZComponents, ...newComponents]);\n\n (draftState.modifiedData.contentType?.schema.attributes[dzAttributeIndex]).components =\n updatedComponents;\n\n // Retrieve all the components that needs to be added to the modifiedData.components\n const nestedComponents = retrieveComponentsFromSchema(\n current(draftState.modifiedData.contentType.schema.attributes),\n state.components\n );\n\n // We dont' need to set the already added components otherwise all modifications will be lost so we need to only add the not modified ones\n const nestedComponentsToAddInModifiedData = nestedComponents.filter((compoUID) => {\n return get(state, ['modifiedData', 'components', compoUID]) === undefined;\n });\n\n nestedComponentsToAddInModifiedData.forEach((compoUID: Internal.UID.Component) => {\n const compoSchema = get(state, ['components', compoUID], {}) as Component;\n const isTemporary = compoSchema.isTemporary || false;\n\n // If the nested component has not been saved we don't need to add them as they are already in the state\n if (!isTemporary) {\n if (!draftState.modifiedData.components) {\n draftState.modifiedData.components = {};\n }\n draftState.modifiedData.components[compoUID] = compoSchema;\n }\n });\n\n break;\n }\n case actions.CREATE_COMPONENT_SCHEMA: {\n const newSchema: Component = {\n uid: action.uid as Internal.UID.Component,\n isTemporary: true,\n category: action.componentCategory,\n schema: {\n ...action.data,\n attributes: [],\n },\n };\n draftState.components[action.uid as string] = newSchema;\n\n if (action.shouldAddComponentToData) {\n draftState.modifiedData.components[action.uid as string] = newSchema;\n }\n\n break;\n }\n case actions.CREATE_SCHEMA: {\n const newSchema: ContentType = {\n uid: action.uid as Internal.UID.ContentType,\n isTemporary: true,\n schema: {\n ...action.data,\n attributes: [],\n },\n };\n\n draftState.contentTypes[action.uid as string] = newSchema;\n\n break;\n }\n case actions.EDIT_ATTRIBUTE: {\n const {\n attributeToSet: { name, ...rest },\n forTarget,\n targetUid,\n initialAttribute,\n } = action;\n\n const initialAttributeName = initialAttribute.name;\n const pathToDataToEdit = ['component', 'contentType'].includes(forTarget)\n ? [forTarget]\n : [forTarget, targetUid];\n\n const initialAttributeIndex = findAttributeIndex(\n get(state, ['modifiedData', ...pathToDataToEdit]),\n initialAttributeName\n );\n\n const isEditingRelation = rest.type === 'relation';\n\n if (!isEditingRelation) {\n set(\n draftState,\n ['modifiedData', ...pathToDataToEdit, 'schema', 'attributes', initialAttributeIndex],\n action.attributeToSet\n );\n\n break;\n }\n\n const updatedAttributes: AttributeType[] = get(state, [\n 'modifiedData',\n ...pathToDataToEdit,\n 'schema',\n 'attributes',\n ]).slice();\n\n // First create the current relation attribute updated\n const toSet = {\n name,\n relation: rest.relation,\n target: rest.target,\n targetAttribute: rest.targetAttribute,\n type: 'relation',\n } as AttributeType;\n\n if (rest.private) {\n toSet.private = rest.private;\n }\n\n if (rest.pluginOptions) {\n toSet.pluginOptions = rest.pluginOptions;\n }\n\n const currentAttributeIndex = updatedAttributes.findIndex((value: AttributeType) => {\n return value.name !== undefined && value.name === initialAttribute.name;\n });\n\n // First set it in the updatedAttributes\n if (currentAttributeIndex !== -1) {\n updatedAttributes.splice(currentAttributeIndex, 1, toSet);\n }\n\n let oppositeAttributeNameToRemove: string | null = null;\n let oppositeAttributeNameToUpdate: string | null = null;\n let oppositeAttributeToCreate: AttributeType | null = null;\n let initialOppositeAttribute = null;\n\n const currentUid = get(state, ['modifiedData', ...pathToDataToEdit, 'uid']);\n const didChangeTargetRelation = initialAttribute.target !== rest.target;\n const didCreateInternalRelation = rest.target === currentUid;\n const relationType = getRelationType(rest.relation, rest.targetAttribute);\n const initialRelationType = getRelationType(\n initialAttribute.relation,\n initialAttribute.targetAttribute\n );\n const hadInternalRelation = initialAttribute.target === currentUid;\n const didChangeRelationType = initialRelationType !== relationType;\n const shouldRemoveOppositeAttributeBecauseOfTargetChange =\n didChangeTargetRelation &&\n !didCreateInternalRelation &&\n hadInternalRelation &&\n isEditingRelation;\n const shouldRemoveOppositeAttributeBecauseOfRelationTypeChange =\n didChangeRelationType &&\n hadInternalRelation &&\n ['oneWay', 'manyWay'].includes(relationType!) &&\n isEditingRelation;\n const shouldUpdateOppositeAttributeBecauseOfRelationTypeChange =\n !ONE_SIDE_RELATIONS.includes(initialRelationType!) &&\n !ONE_SIDE_RELATIONS.includes(relationType!) &&\n hadInternalRelation &&\n didCreateInternalRelation &&\n isEditingRelation;\n const shouldCreateOppositeAttributeBecauseOfRelationTypeChange =\n ONE_SIDE_RELATIONS.includes(initialRelationType!) &&\n !ONE_SIDE_RELATIONS.includes(relationType!) &&\n hadInternalRelation &&\n didCreateInternalRelation &&\n isEditingRelation;\n const shouldCreateOppositeAttributeBecauseOfTargetChange =\n didChangeTargetRelation &&\n didCreateInternalRelation &&\n !ONE_SIDE_RELATIONS.includes(relationType!);\n\n // Store opposite attribute name to remove at the end of the loop\n if (\n shouldRemoveOppositeAttributeBecauseOfTargetChange ||\n shouldRemoveOppositeAttributeBecauseOfRelationTypeChange\n ) {\n oppositeAttributeNameToRemove = initialAttribute.targetAttribute;\n }\n\n // In case of oneWay or manyWay relation there isn't an opposite attribute\n if (oppositeAttributeNameToRemove) {\n const indexToRemove = updatedAttributes.findIndex(\n (value) => value.name === oppositeAttributeNameToRemove\n );\n\n updatedAttributes.splice(indexToRemove, 1);\n }\n\n // In order to preserve plugin options need to get the initial opposite attribute settings\n if (!shouldRemoveOppositeAttributeBecauseOfTargetChange) {\n const initialTargetContentType = get(state, [\n 'initialContentTypes',\n initialAttribute.target,\n ]);\n\n if (initialTargetContentType) {\n const oppositeAttributeIndex = findAttributeIndex(\n initialTargetContentType,\n initialAttribute.targetAttribute\n );\n\n initialOppositeAttribute = get(state, [\n 'initialContentTypes',\n initialAttribute.target,\n 'schema',\n 'attributes',\n oppositeAttributeIndex,\n ]);\n }\n }\n\n // Create the opposite attribute\n if (\n shouldCreateOppositeAttributeBecauseOfRelationTypeChange ||\n shouldCreateOppositeAttributeBecauseOfTargetChange\n ) {\n oppositeAttributeToCreate = {\n name: rest.targetAttribute,\n relation: getOppositeRelation(relationType),\n target: rest.target,\n targetAttribute: name,\n type: 'relation',\n } as AttributeType;\n\n if (rest.private) {\n oppositeAttributeToCreate.private = rest.private;\n }\n\n if (initialOppositeAttribute && initialOppositeAttribute.pluginOptions) {\n oppositeAttributeToCreate.pluginOptions = initialOppositeAttribute.pluginOptions;\n }\n\n const indexOfInitialAttribute = updatedAttributes.findIndex(\n ({ name }) => name === initialAttribute.name\n );\n const indexOfUpdatedAttribute = updatedAttributes.findIndex(\n ({ name: attrName }) => name === attrName\n );\n\n const indexToInsert =\n (indexOfInitialAttribute === -1 ? indexOfUpdatedAttribute : indexOfInitialAttribute) +\n 1;\n\n updatedAttributes.splice(indexToInsert, 0, oppositeAttributeToCreate);\n }\n\n if (shouldUpdateOppositeAttributeBecauseOfRelationTypeChange) {\n oppositeAttributeNameToUpdate = initialAttribute.targetAttribute;\n\n oppositeAttributeToCreate = {\n name: rest.targetAttribute,\n relation: getOppositeRelation(relationType),\n target: rest.target,\n targetAttribute: name,\n type: 'relation',\n } as AttributeType;\n\n if (rest.private) {\n oppositeAttributeToCreate.private = rest.private;\n }\n\n if (initialOppositeAttribute && initialOppositeAttribute.pluginOptions) {\n oppositeAttributeToCreate.pluginOptions = initialOppositeAttribute.pluginOptions;\n }\n\n if (oppositeAttributeNameToUpdate) {\n const indexToUpdate = updatedAttributes.findIndex(\n ({ name }) => name === oppositeAttributeNameToUpdate\n );\n\n updatedAttributes.splice(indexToUpdate, 1, oppositeAttributeToCreate);\n }\n }\n\n set(\n draftState,\n ['modifiedData', ...pathToDataToEdit, 'schema', 'attributes'],\n updatedAttributes\n );\n\n break;\n }\n case actions.EDIT_CUSTOM_FIELD_ATTRIBUTE: {\n const { forTarget, targetUid, initialAttribute, attributeToSet } = action;\n\n const initialAttributeName = initialAttribute.name;\n const pathToDataToEdit = ['component', 'contentType'].includes(forTarget)\n ? [forTarget]\n : [forTarget, targetUid];\n\n const initialAttributeIndex = findAttributeIndex(\n get(state, ['modifiedData', ...pathToDataToEdit]),\n initialAttributeName\n );\n\n set(\n draftState,\n ['modifiedData', ...pathToDataToEdit, 'schema', 'attributes', initialAttributeIndex],\n attributeToSet\n );\n\n break;\n }\n case actions.GET_DATA_SUCCEEDED: {\n draftState.components = action.components;\n draftState.initialComponents = action.components;\n draftState.initialContentTypes = action.contentTypes;\n draftState.contentTypes = action.contentTypes;\n draftState.reservedNames = action.reservedNames;\n draftState.isLoading = false;\n break;\n }\n case actions.UPDATE_INITIAL_STATE: {\n draftState.initialData = draftState.modifiedData;\n\n break;\n }\n case actions.DELETE_NOT_SAVED_TYPE: {\n // Doing so will also reset the modified and the initial data\n draftState.contentTypes = state.initialContentTypes;\n draftState.components = state.initialComponents;\n\n break;\n }\n case actions.RELOAD_PLUGIN: {\n return initialState;\n }\n case actions.REMOVE_COMPONENT_FROM_DYNAMIC_ZONE: {\n const dzAttributeIndex = findAttributeIndex(state.modifiedData.contentType, action.dzName);\n draftState.modifiedData.contentType.schema.attributes[dzAttributeIndex].components.splice(\n action.componentToRemoveIndex,\n 1\n );\n\n break;\n }\n case actions.REMOVE_FIELD: {\n const { mainDataKey, attributeToRemoveName } = action;\n const pathToAttributes = ['modifiedData', mainDataKey, 'schema', 'attributes'];\n const attributeToRemoveIndex = findAttributeIndex(\n state.modifiedData[mainDataKey],\n attributeToRemoveName\n );\n\n const pathToAttributeToRemove = [...pathToAttributes, attributeToRemoveIndex];\n const attributeToRemoveData = get(state, pathToAttributeToRemove);\n const isRemovingRelationAttribute = attributeToRemoveData.type === 'relation';\n // Only content types can have relations with themselves since\n // components can only have oneWay or manyWay relations\n const canTheAttributeToRemoveHaveARelationWithItself = mainDataKey === 'contentType';\n\n if (isRemovingRelationAttribute && canTheAttributeToRemoveHaveARelationWithItself) {\n const { target, relation, targetAttribute } = attributeToRemoveData;\n const relationType = getRelationType(relation, targetAttribute);\n\n const uid = state.modifiedData.contentType?.uid;\n const shouldRemoveOppositeAttribute =\n target === uid && !ONE_SIDE_RELATIONS.includes(relationType!);\n\n if (shouldRemoveOppositeAttribute) {\n const attributes: AttributeType[] =\n state.modifiedData[mainDataKey]?.schema.attributes.slice();\n const nextAttributes = attributes.filter((attribute) => {\n if (attribute.name === attributeToRemoveName) {\n return false;\n }\n\n if (attribute.target === uid && attribute.targetAttribute === attributeToRemoveName) {\n return false;\n }\n\n return true;\n });\n\n draftState.modifiedData[mainDataKey].schema.attributes = nextAttributes;\n\n break;\n }\n }\n\n // Find all uid fields that have the targetField set to the field we are removing\n\n const uidFieldsToUpdate: string[] = state.modifiedData[\n mainDataKey\n ]!.schema.attributes.slice().reduce((acc: string[], current: AttributeType) => {\n if (current.type !== 'uid') {\n return acc;\n }\n\n if (current.targetField !== attributeToRemoveName) {\n return acc;\n }\n\n acc.push(current.name as string);\n\n return acc;\n }, []);\n\n uidFieldsToUpdate.forEach((fieldName) => {\n const fieldIndex = findAttributeIndex(state.modifiedData[mainDataKey], fieldName);\n\n delete draftState.modifiedData[mainDataKey]?.schema.attributes[fieldIndex].targetField;\n });\n\n draftState.modifiedData[mainDataKey]?.schema.attributes.splice(attributeToRemoveIndex, 1);\n\n break;\n }\n case actions.REMOVE_FIELD_FROM_DISPLAYED_COMPONENT: {\n const { attributeToRemoveName, componentUid } = action;\n\n const attributeToRemoveIndex = findAttributeIndex(\n state.modifiedData.components?.[componentUid],\n attributeToRemoveName\n );\n\n draftState.modifiedData.components?.[componentUid]?.schema?.attributes?.splice(\n attributeToRemoveIndex,\n 1\n );\n\n break;\n }\n case actions.SET_MODIFIED_DATA: {\n draftState.isLoadingForDataToBeSet = false;\n draftState.initialData = action.schemaToSet;\n draftState.modifiedData = action.schemaToSet;\n\n // Reset the state with the initial data\n // All created components and content types will be lost\n if (!action.hasJustCreatedSchema) {\n draftState.components = state.initialComponents;\n draftState.contentTypes = state.initialContentTypes;\n }\n\n break;\n }\n case actions.UPDATE_SCHEMA: {\n const {\n data: { displayName, category, icon, kind },\n schemaType,\n uid,\n } = action;\n\n draftState.modifiedData[schemaType].schema.displayName = displayName;\n\n if (action.schemaType === 'component') {\n draftState.modifiedData.component.category = category;\n draftState.modifiedData.component.schema.icon = icon;\n const addedComponent = current(draftState.modifiedData.component);\n draftState.components[uid as string] = addedComponent;\n\n break;\n }\n\n draftState.modifiedData.contentType.schema.kind = kind;\n\n break;\n }\n default:\n return draftState;\n }\n });\n\nexport { initialState, reducer };\n","import slugify from '@sindresorhus/slugify';\n\nexport const nameToSlug = (name: string) => slugify(name, { separator: '-' });\n","export const ON_CHANGE = 'ContentTypeBuilder/FormModal/ON_CHANGE';\nexport const ON_CHANGE_RELATION_TARGET = 'ContentTypeBuilder/FormModal/ON_CHANGE_RELATION_TARGET';\nexport const ON_CHANGE_RELATION_TYPE = 'ContentTypeBuilder/FormModal/ON_CHANGE_RELATION_TYPE';\nexport const RESET_PROPS = 'ContentTypeBuilder/FormModal/RESET_PROPS';\nexport const RESET_PROPS_AND_SET_FORM_FOR_ADDING_AN_EXISTING_COMPO =\n 'ContentTypeBuilder/FormModal/RESET_PROPS_AND_SET_FORM_FOR_ADDING_AN_EXISTING_COMPO';\nexport const RESET_PROPS_AND_SAVE_CURRENT_DATA =\n 'ContentTypeBuilder/FormModal/RESET_PROPS_AND_SAVE_CURRENT_DATA';\nexport const RESET_PROPS_AND_SET_THE_FORM_FOR_ADDING_A_COMPO_TO_A_DZ =\n 'ContentTypeBuilder/FormModal/RESET_PROPS_AND_SET_THE_FORM_FOR_ADDING_A_COMPO_TO_A_DZ';\nexport const SET_DATA_TO_EDIT = 'ContentTypeBuilder/FormModal/SET_DATA_TO_EDIT';\nexport const SET_ATTRIBUTE_DATA_SCHEMA = 'ContentTypeBuilder/FormModal/SET_ATTRIBUTE_DATA_SCHEMA';\nexport const SET_CUSTOM_FIELD_DATA_SCHEMA =\n 'ContentTypeBuilder/FormModal/SET_CUSTOM_FIELD_DATA_SCHEMA';\nexport const SET_DYNAMIC_ZONE_DATA_SCHEMA =\n 'ContentTypeBuilder/FormModal/SET_DYNAMIC_ZONE_DATA_SCHEMA';\nexport const SET_ERRORS = 'ContentTypeBuilder/FormModal/SET_ERRORS';\n","import { nameToSlug } from '../../../utils/nameToSlug';\n\nimport type { Internal } from '@strapi/types';\n\nconst createUid = (name: string): Internal.UID.ContentType => {\n const modelName = nameToSlug(name);\n return `api::${modelName}.${modelName}`;\n};\n\n// From `content-type-builder/services/Components/createComponentUid`\nconst createComponentUid = (name: string, category: string): Internal.UID.Component => {\n return `${nameToSlug(category)}.${nameToSlug(name)}`;\n};\n\nexport { createComponentUid, createUid };\n","export const customFieldDefaultOptionsReducer = (acc: any, option: any) => {\n if (option.items) {\n return option.items.reduce(customFieldDefaultOptionsReducer, acc);\n }\n\n if ('defaultValue' in option) {\n const { name, defaultValue } = option;\n acc.push({ name, defaultValue });\n }\n\n return acc;\n};\n","/* eslint-disable no-confusing-arrow */\n\nimport type { Schema } from '@strapi/types';\n\nconst shouldPluralizeName = (nature: Schema.Attribute.RelationKind.Any) =>\n ['manyToMany', 'oneToMany', 'manyWay'].includes(nature) ? 2 : 1;\n\nconst shouldPluralizeTargetAttribute = (nature: Schema.Attribute.RelationKind.Any) =>\n ['manyToMany', 'manyToOne'].includes(nature) ? 2 : 1;\n\nexport { shouldPluralizeName, shouldPluralizeTargetAttribute };\n","import { produce } from 'immer';\nimport set from 'lodash/set';\nimport snakeCase from 'lodash/snakeCase';\nimport pluralize from 'pluralize';\n\nimport { getRelationType } from '../../utils/getRelationType';\nimport { nameToSlug } from '../../utils/nameToSlug';\n\nimport * as actions from './constants';\nimport { createComponentUid } from './utils/createUid';\nimport { customFieldDefaultOptionsReducer } from './utils/customFieldDefaultOptionsReducer';\nimport { shouldPluralizeName, shouldPluralizeTargetAttribute } from './utils/relations';\n\nimport type { AnyAction } from '@reduxjs/toolkit';\n\nconst initialState: any = {\n formErrors: {},\n modifiedData: {},\n initialData: {},\n componentToCreate: {},\n isCreatingComponentWhileAddingAField: false,\n};\n\nconst reducer = (state = initialState, action: AnyAction) =>\n // eslint-disable-next-line consistent-return\n produce(state, (draftState: any) => {\n switch (action.type) {\n case actions.ON_CHANGE: {\n const { keys, value } = action;\n const obj = state.modifiedData;\n const hasDefaultValue = Boolean(obj.default);\n\n // There is no need to remove the default key if the default value isn't defined\n if (hasDefaultValue && keys.length === 1 && keys.includes('type')) {\n const previousType = obj.type;\n\n if (previousType && ['date', 'datetime', 'time'].includes(previousType)) {\n // return obj.updateIn(keys, () => value).remove('default');\n delete draftState.modifiedData.default;\n }\n }\n\n set(draftState, ['modifiedData', ...keys], value);\n\n break;\n }\n case actions.ON_CHANGE_RELATION_TARGET: {\n const {\n target: {\n oneThatIsCreatingARelationWithAnother,\n selectedContentTypeFriendlyName,\n targetContentTypeAllowedRelations,\n value,\n },\n } = action;\n // Special case for the admin user...\n let didChangeRelationTypeBecauseOfRestrictedRelation = false;\n let changedRelationType = null;\n\n set(draftState, ['modifiedData', 'target'], value);\n\n const modifiedData = state.modifiedData;\n\n // Don't change the relation type if the allowed relations are not restricted\n // TODO: replace with an obj { relation: 'x', bidirctional: true|false } when BE ready\n if (Array.isArray(targetContentTypeAllowedRelations)) {\n const currentRelationType = getRelationType(\n modifiedData.relation,\n modifiedData.targetAttribute\n );\n\n if (!targetContentTypeAllowedRelations.includes(currentRelationType)) {\n const relationToSet = targetContentTypeAllowedRelations[0];\n didChangeRelationTypeBecauseOfRestrictedRelation = true;\n changedRelationType = relationToSet;\n\n if (relationToSet === 'oneWay') {\n set(draftState, ['modifiedData', 'relation'], 'oneToOne');\n } else if (relationToSet === 'manyWay') {\n set(draftState, ['modifiedData', 'relation'], 'oneToMany');\n } else {\n set(draftState, ['modifiedData', 'relation'], relationToSet);\n }\n }\n }\n\n let nameToSet;\n\n if (didChangeRelationTypeBecauseOfRestrictedRelation) {\n nameToSet = pluralize(\n snakeCase(nameToSlug(selectedContentTypeFriendlyName)),\n shouldPluralizeName(changedRelationType)\n );\n } else {\n nameToSet = pluralize(\n snakeCase(nameToSlug(selectedContentTypeFriendlyName)),\n\n shouldPluralizeName(modifiedData.relation)\n );\n }\n\n set(draftState, ['modifiedData', 'name'], nameToSet);\n\n const currentTargetAttribute = state.modifiedData.targetAttribute;\n\n if (currentTargetAttribute === null) {\n break;\n }\n\n // Changing the target and the relation is either oneWay or manyWay\n // Case when we need to change the relation to oneWay (ex: admin user)\n if (\n didChangeRelationTypeBecauseOfRestrictedRelation &&\n ['oneWay', 'manyWay'].includes(changedRelationType)\n ) {\n set(draftState, ['modifiedData', 'targetAttribute'], null);\n\n break;\n }\n\n const targetAttributeToSet = pluralize(\n snakeCase(nameToSlug(oneThatIsCreatingARelationWithAnother)),\n shouldPluralizeTargetAttribute(modifiedData.relation)\n );\n\n set(draftState, ['modifiedData', 'targetAttribute'], targetAttributeToSet);\n\n break;\n }\n case actions.ON_CHANGE_RELATION_TYPE: {\n const {\n target: { oneThatIsCreatingARelationWithAnother, value },\n } = action;\n\n const currentName = state.modifiedData.name;\n\n // Switching from oneWay\n if (!['oneWay', 'manyWay'].includes(value)) {\n set(draftState, ['modifiedData', 'relation'], value);\n const currentTargetAttribute = state.modifiedData.targetAttribute;\n\n set(\n draftState,\n ['modifiedData', 'name'],\n pluralize(snakeCase(nameToSlug(currentName)), shouldPluralizeName(value))\n );\n\n set(\n draftState,\n ['modifiedData', 'targetAttribute'],\n pluralize(\n currentTargetAttribute ||\n snakeCase(nameToSlug(oneThatIsCreatingARelationWithAnother)),\n shouldPluralizeTargetAttribute(value)\n )\n );\n\n break;\n }\n\n if (value === 'oneWay') {\n set(draftState, ['modifiedData', 'relation'], 'oneToOne');\n set(draftState, ['modifiedData', 'targetAttribute'], null);\n set(draftState, ['modifiedData', 'name'], pluralize(snakeCase(currentName), 1));\n\n break;\n }\n\n // manyWay\n set(draftState, ['modifiedData', 'relation'], 'oneToMany');\n set(draftState, ['modifiedData', 'targetAttribute'], null);\n set(draftState, ['modifiedData', 'name'], pluralize(snakeCase(currentName), 2));\n\n break;\n }\n\n case actions.RESET_PROPS:\n return initialState;\n case actions.RESET_PROPS_AND_SET_FORM_FOR_ADDING_AN_EXISTING_COMPO: {\n // This is run when the user doesn't want to create a new component\n\n const nextState = {\n ...initialState,\n modifiedData: {\n type: 'component',\n repeatable: true,\n ...action.options,\n },\n };\n\n return nextState;\n }\n case actions.RESET_PROPS_AND_SAVE_CURRENT_DATA: {\n // This is run when the user has created a new component\n const componentToCreate = state.modifiedData.componentToCreate;\n const modifiedData = {\n displayName: componentToCreate.displayName,\n type: 'component',\n repeatable: false,\n ...action.options,\n component: createComponentUid(componentToCreate.displayName, componentToCreate.category),\n };\n\n const nextState = {\n ...initialState,\n componentToCreate,\n modifiedData,\n isCreatingComponentWhileAddingAField: state.modifiedData.createComponent,\n };\n\n return nextState;\n }\n case actions.RESET_PROPS_AND_SET_THE_FORM_FOR_ADDING_A_COMPO_TO_A_DZ: {\n const createdDZ = state.modifiedData;\n const dataToSet = {\n ...createdDZ,\n createComponent: true,\n componentToCreate: { type: 'component' },\n };\n\n return { ...initialState, modifiedData: dataToSet };\n }\n case actions.SET_DATA_TO_EDIT: {\n draftState.modifiedData = action.data;\n draftState.initialData = action.data;\n break;\n }\n case actions.SET_ATTRIBUTE_DATA_SCHEMA: {\n const {\n attributeType,\n isEditing,\n modifiedDataToSetForEditing,\n nameToSetForRelation,\n targetUid,\n step,\n options = {},\n } = action;\n\n if (isEditing) {\n draftState.modifiedData = modifiedDataToSetForEditing;\n draftState.initialData = modifiedDataToSetForEditing;\n\n break;\n }\n\n let dataToSet;\n\n if (attributeType === 'component') {\n if (step === '1') {\n dataToSet = {\n type: 'component',\n createComponent: true,\n componentToCreate: { type: 'component' },\n };\n } else {\n dataToSet = {\n ...options,\n type: 'component',\n repeatable: true,\n };\n }\n } else if (attributeType === 'dynamiczone') {\n dataToSet = {\n ...options,\n type: 'dynamiczone',\n components: [],\n };\n } else if (attributeType === 'text') {\n dataToSet = { ...options, type: 'string' };\n } else if (attributeType === 'number' || attributeType === 'date') {\n dataToSet = options;\n } else if (attributeType === 'media') {\n dataToSet = {\n allowedTypes: ['images', 'files', 'videos', 'audios'],\n type: 'media',\n multiple: true,\n ...options,\n };\n } else if (attributeType === 'enumeration') {\n dataToSet = { ...options, type: 'enumeration', enum: [] };\n } else if (attributeType === 'relation') {\n dataToSet = {\n name: snakeCase(nameToSetForRelation),\n relation: 'oneToOne',\n targetAttribute: null,\n target: targetUid,\n type: 'relation',\n };\n } else {\n dataToSet = { ...options, type: attributeType, default: null };\n }\n\n draftState.modifiedData = dataToSet;\n\n break;\n }\n case actions.SET_CUSTOM_FIELD_DATA_SCHEMA: {\n const { customField, isEditing, modifiedDataToSetForEditing, options = {} } = action;\n\n if (isEditing) {\n draftState.modifiedData = modifiedDataToSetForEditing;\n draftState.initialData = modifiedDataToSetForEditing;\n\n break;\n }\n\n draftState.modifiedData = { ...options, type: customField.type };\n\n const allOptions = [\n ...(customField?.options?.base || []),\n ...(customField?.options?.advanced || []),\n ];\n\n const optionDefaults = allOptions.reduce(customFieldDefaultOptionsReducer, []);\n\n if (optionDefaults.length) {\n optionDefaults.forEach(({ name, defaultValue }: { name: string; defaultValue: string }) =>\n set(draftState.modifiedData, name, defaultValue)\n );\n }\n\n break;\n }\n case actions.SET_DYNAMIC_ZONE_DATA_SCHEMA: {\n draftState.modifiedData = action.attributeToEdit;\n draftState.initialData = action.attributeToEdit;\n break;\n }\n case actions.SET_ERRORS: {\n draftState.formErrors = action.errors;\n break;\n }\n default:\n return draftState;\n }\n });\n\nexport { initialState, reducer };\n","import { reducer } from './components/DataManagerProvider/reducer';\nimport { reducer as formModalReducer } from './components/FormModal/reducer';\nimport { pluginId } from './pluginId';\n\nexport const reducers = {\n [`${pluginId}_formModal`]: formModalReducer,\n [`${pluginId}_dataManagerProvider`]: reducer,\n};\n","import cloneDeep from 'lodash/cloneDeep';\nimport get from 'lodash/get';\nimport * as yup from 'yup';\n// TODO V5 Convert any into real types\nexport const formsAPI: any = {\n components: {\n inputs: {} as Record<string, any>,\n add({ id, component }: { id: string; component: any }) {\n if (!this.inputs[id]) {\n this.inputs[id] = component;\n }\n },\n },\n types: {\n attribute: {\n // test: {\n // validators: [],\n // form: {\n // advanced: [\n // /* cb */\n // ],\n // base: [\n // /* cb */\n // ],\n // },\n // },\n },\n contentType: {\n validators: [],\n form: {\n advanced: [],\n base: [],\n },\n },\n component: {\n validators: [],\n form: {\n advanced: [],\n base: [],\n },\n },\n },\n contentTypeSchemaMutations: [],\n addContentTypeSchemaMutation(cb: any) {\n this.contentTypeSchemaMutations.push(cb);\n },\n extendContentType({ validator, form: { advanced, base } }: any) {\n const { contentType } = this.types;\n\n contentType.validators.push(validator);\n contentType.form.advanced.push(advanced);\n contentType.form.base.push(base);\n },\n extendFields(fields: any, { validator, form: { advanced, base } }: any) {\n const formType = this.types.attribute;\n\n fields.forEach((field: any) => {\n if (!formType[field]) {\n formType[field] = {\n validators: [],\n form: {\n advanced: [\n /* cb */\n ],\n base: [\n /* cb */\n ],\n },\n };\n }\n\n formType[field].validators.push(validator);\n formType[field].form.advanced.push(advanced);\n formType[field].form.base.push(base);\n });\n },\n\n getAdvancedForm(target: any, props = null) {\n const sectionsToAdd = get(this.types, [...target, 'form', 'advanced'], []).reduce(\n (acc: any, current: any) => {\n const sections = current(props);\n\n return [...acc, ...sections];\n },\n []\n );\n\n return sectionsToAdd;\n },\n\n makeCustomFieldValidator(attributeShape: any, validator: any, ...validatorArgs: any) {\n // When no validator, return the attribute shape\n if (!validator) return attributeShape;\n\n // Otherwise extend the shape with the provided validator\n return attributeShape.shape({ options: yup.object().shape(validator(validatorArgs)) });\n },\n\n makeValidator(target: any, initShape: any, ...args: any) {\n const validators = get(this.types, [...target, 'validators'], []);\n\n const pluginOptionsShape = validators.reduce((acc: any, current: any) => {\n const pluginOptionShape = current(args);\n\n return { ...acc, ...pluginOptionShape };\n }, {});\n\n return initShape.shape({ pluginOptions: yup.object().shape(pluginOptionsShape) });\n },\n mutateContentTypeSchema(data: Record<string, unknown>, initialData: Record<string, unknown>) {\n let enhancedData: any = cloneDeep(data);\n\n const refData: any = cloneDeep(initialData);\n\n this.contentTypeSchemaMutations.forEach((cb: any) => {\n enhancedData = cb(enhancedData, refData);\n });\n\n return enhancedData;\n },\n};\n","type TradOptions = Record<string, string>;\n\nconst prefixPluginTranslations = (trad: TradOptions, pluginId: string): TradOptions => {\n if (!pluginId) {\n throw new TypeError(\"pluginId can't be empty\");\n }\n return Object.keys(trad).reduce((acc, current) => {\n acc[`${pluginId}.${current}`] = trad[current];\n return acc;\n }, {} as TradOptions);\n};\n\nexport { prefixPluginTranslations };\n","import { Layout } from '@strapi/icons';\n\nimport pluginPkg from '../../package.json';\n\nimport { PERMISSIONS } from './constants';\nimport { pluginId } from './pluginId';\nimport { reducers } from './reducers';\nimport { formsAPI } from './utils/formAPI';\nimport { prefixPluginTranslations } from './utils/prefixPluginTranslations';\n\nconst name = pluginPkg.strapi.name;\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n register(app: any) {\n app.addReducers(reducers);\n app.addMenuLink({\n to: `plugins/${pluginId}`,\n icon: Layout,\n intlLabel: {\n id: `${pluginId}.plugin.name`,\n defaultMessage: 'Content Types Builder',\n },\n permissions: PERMISSIONS.main,\n Component: () => import('./pages/App'),\n position: 5,\n });\n\n app.registerPlugin({\n id: pluginId,\n name,\n // Internal APIs exposed by the CTB for the other plugins to use\n apis: {\n forms: formsAPI,\n },\n });\n },\n bootstrap() {},\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, pluginId),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n"],"names":["get","initialState","name","reducer","produce","actions.ADD_ATTRIBUTE","set","actions.ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE","actions.ADD_CUSTOM_FIELD_ATTRIBUTE","actions.CHANGE_DYNAMIC_ZONE_COMPONENTS","current","actions.CREATE_COMPONENT_SCHEMA","actions.CREATE_SCHEMA","actions.EDIT_ATTRIBUTE","actions.EDIT_CUSTOM_FIELD_ATTRIBUTE","actions.GET_DATA_SUCCEEDED","actions.UPDATE_INITIAL_STATE","actions.DELETE_NOT_SAVED_TYPE","actions.RELOAD_PLUGIN","actions.REMOVE_COMPONENT_FROM_DYNAMIC_ZONE","actions.REMOVE_FIELD","actions.REMOVE_FIELD_FROM_DISPLAYED_COMPONENT","actions.SET_MODIFIED_DATA","actions.UPDATE_SCHEMA","slugify","actions.ON_CHANGE","actions.ON_CHANGE_RELATION_TARGET","pluralize","snakeCase","actions.ON_CHANGE_RELATION_TYPE","actions.RESET_PROPS","actions.RESET_PROPS_AND_SET_FORM_FOR_ADDING_AN_EXISTING_COMPO","actions.RESET_PROPS_AND_SAVE_CURRENT_DATA","actions.RESET_PROPS_AND_SET_THE_FORM_FOR_ADDING_A_COMPO_TO_A_DZ","actions.SET_DATA_TO_EDIT","actions.SET_ATTRIBUTE_DATA_SCHEMA","actions.SET_CUSTOM_FIELD_DATA_SCHEMA","actions.SET_DYNAMIC_ZONE_DATA_SCHEMA","actions.SET_ERRORS","formModalReducer","yup","cloneDeep","pluginId","Layout"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA,EAKzB,MAAM,CAAC,EAAE,QAAQ,qCAAqC,SAAS,MAAM;AACvE;AAEO,MAAM,sBAAsB;ACN5B,MAAM,WAAW,UAAU,KAAK,QAAQ,eAAe,EAAE;ACInD,MAAA,kBAAkB,CAC7B,UACA,oBACG;AACG,QAAA,wBAAwB,oBAAoB,UAAa,oBAAoB;AAE/E,MAAA,aAAa,cAAc,uBAAuB;AAC7C,WAAA;AAAA,EACT;AAEI,MAAA,aAAa,eAAe,uBAAuB;AAC9C,WAAA;AAAA,EACT;AAEO,SAAA;AACT;ACrBM,MAAA,aAAa,CAAmB,UAAoB,CAAC,GAAG,IAAI,IAAI,KAAK,CAAC;ACArE,MAAM,gBAAgB;AACtB,MAAM,6BACX;AACK,MAAM,wCACX;AACK,MAAM,iCACX;AACK,MAAM,gBAAgB;AACtB,MAAM,0BACX;AACK,MAAM,wBAAwB;AAC9B,MA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A,MAAA,CACJ;AAAA,IAAA;AAGI,WAAA,QAAQ,QAAQ,aAAa;AAAA,EACtC;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const OptionBoxWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<Omit<
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
export declare const OptionBoxWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<Omit<import("@strapi/design-system").TransientBoxProps & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
} & 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> & {
|
|
5
|
+
ref?: any;
|
|
6
|
+
}, "ref"> & {
|
|
7
|
+
ref?: any;
|
|
8
|
+
}, never>> & Omit<import("@strapi/design-system").BoxComponent<"div">, keyof import("react").Component<any, {}, any>>;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const BoxWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<Omit<
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
export declare const BoxWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<Omit<import("@strapi/design-system").TransientBoxProps & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
} & 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> & {
|
|
5
|
+
ref?: any;
|
|
6
|
+
}, "ref"> & {
|
|
7
|
+
ref?: any;
|
|
8
|
+
}, never>> & Omit<import("@strapi/design-system").BoxComponent<"div">, keyof import("react").Component<any, {}, any>>;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { Component, Components } from '../../../types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { Internal } from '@strapi/types';
|
|
3
|
+
type ChildComponent = {
|
|
4
|
+
component: Internal.UID.Component;
|
|
5
|
+
};
|
|
6
|
+
export type ComponentWithChildren = {
|
|
7
|
+
component: Internal.UID.Component;
|
|
8
|
+
childComponents: ChildComponent[];
|
|
9
|
+
};
|
|
10
|
+
declare const retrieveComponentsThatHaveComponents: (allComponents: Components) => ComponentWithChildren[];
|
|
11
|
+
declare const getComponentWithChildComponents: (component: Component) => ComponentWithChildren;
|
|
12
|
+
export { getComponentWithChildComponents, retrieveComponentsThatHaveComponents };
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Components } from '../../../types';
|
|
2
|
+
import type { Internal } from '@strapi/types';
|
|
3
|
+
export type NestedComponent = {
|
|
4
|
+
component: Internal.UID.Component;
|
|
5
|
+
uidsOfAllParents?: Internal.UID.Component[];
|
|
6
|
+
parentCompoUid?: Internal.UID.Component;
|
|
7
|
+
};
|
|
8
|
+
export declare const retrieveNestedComponents: (appComponents: Components) => NestedComponent[];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { IconByType } from '../../AttributeIcon';
|
|
2
|
+
import type { NestedComponent } from '../../DataManagerProvider/utils/retrieveNestedComponents';
|
|
2
3
|
import type { Internal } from '@strapi/types';
|
|
3
|
-
export declare const getAttributesToDisplay: (dataTarget: string | undefined, targetUid: Internal.UID.Schema, nestedComponents: Array<
|
|
4
|
+
export declare const getAttributesToDisplay: (dataTarget: string | undefined, targetUid: Internal.UID.Schema, nestedComponents: Array<NestedComponent>) => IconByType[][];
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { IconByType } from './AttributeIcon';
|
|
3
|
-
export declare const BoxWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<Omit<
|
|
4
|
-
|
|
5
|
-
}
|
|
3
|
+
export declare const BoxWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<Omit<import("@strapi/design-system").TransientBoxProps & {
|
|
4
|
+
children?: import("react").ReactNode;
|
|
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> & {
|
|
6
|
+
ref?: any;
|
|
7
|
+
}, "ref"> & {
|
|
8
|
+
ref?: any;
|
|
9
|
+
}, never>> & Omit<import("@strapi/design-system").BoxComponent<"div">, keyof import("react").Component<any, {}, any>>;
|
|
6
10
|
type ListRowProps = {
|
|
7
11
|
configurable?: boolean;
|
|
8
12
|
customField?: string | null;
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { BoxComponent, FlexComponent } from '@strapi/design-system';
|
|
3
|
-
declare const Wrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<Omit<
|
|
4
|
-
|
|
3
|
+
declare const Wrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<Omit<import("@strapi/design-system").TransientBoxProps & {
|
|
4
|
+
children?: import("react").ReactNode;
|
|
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> & {
|
|
6
|
+
ref?: any;
|
|
7
|
+
}, "ref"> & {
|
|
8
|
+
ref?: any;
|
|
5
9
|
}, never>> & Omit<BoxComponent, keyof import("react").Component<any, {}, any>>;
|
|
6
|
-
declare const IconWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<Omit<
|
|
7
|
-
|
|
10
|
+
declare const IconWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<Omit<import("@strapi/design-system").TransientBoxProps & {
|
|
11
|
+
children?: import("react").ReactNode;
|
|
12
|
+
} & 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
|
+
ref?: any;
|
|
14
|
+
}, "ref"> & {
|
|
15
|
+
ref?: any;
|
|
8
16
|
}, {
|
|
9
17
|
$isSelected: boolean;
|
|
10
18
|
}>> & Omit<BoxComponent<"button">, keyof import("react").Component<any, {}, any>>;
|
|
@@ -14,6 +14,7 @@ interface SelectCategoryProps {
|
|
|
14
14
|
};
|
|
15
15
|
}) => void;
|
|
16
16
|
value?: string;
|
|
17
|
+
isCreating?: boolean;
|
|
17
18
|
}
|
|
18
|
-
export declare const SelectCategory: ({ error, intlLabel, name, onChange, value, }: SelectCategoryProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const SelectCategory: ({ error, intlLabel, name, onChange, value, isCreating, }: SelectCategoryProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
20
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Internal } from '@strapi/types';
|
|
1
2
|
interface SelectComponentProps {
|
|
2
3
|
componentToCreate?: Record<string, any> | null;
|
|
3
4
|
error?: string | null;
|
|
@@ -11,7 +12,7 @@ interface SelectComponentProps {
|
|
|
11
12
|
isCreatingComponentWhileAddingAField: boolean;
|
|
12
13
|
name: string;
|
|
13
14
|
onChange: (value: any) => void;
|
|
14
|
-
targetUid:
|
|
15
|
+
targetUid: Internal.UID.Schema;
|
|
15
16
|
value: string;
|
|
16
17
|
forTarget: string;
|
|
17
18
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComponentWithChildren } from '../components/DataManagerProvider/utils/retrieveComponentsThatHaveComponents';
|
|
2
|
+
import type { NestedComponent } from '../components/DataManagerProvider/utils/retrieveNestedComponents';
|
|
3
|
+
import type { Internal } from '@strapi/types';
|
|
4
|
+
/**
|
|
5
|
+
* Recursively calculates the maximum depth of nested child components
|
|
6
|
+
* for a given component UID.
|
|
7
|
+
*
|
|
8
|
+
* @param componentUid - The UID of the component to start from.
|
|
9
|
+
* @param components - The array of all components with their child components.
|
|
10
|
+
* @param currentDepth - The current depth of the recursion. Defaults to 0.
|
|
11
|
+
* @returns The maximum depth of the nested child components.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getChildrenMaxDepth: (componentUid: Internal.UID.Component, components: Array<ComponentWithChildren>, currentDepth?: number) => number;
|
|
14
|
+
/**
|
|
15
|
+
* Calculates the depth of a component within a nested component tree.
|
|
16
|
+
* Depth is defined as the level at which the component is nested.
|
|
17
|
+
* For example, a component at Depth 3 is the third nested component.
|
|
18
|
+
*
|
|
19
|
+
* @param component - The UID of the component to find the depth for.
|
|
20
|
+
* @param components - The array of all nested components.
|
|
21
|
+
* @returns The depth level of the component within the nested tree.
|
|
22
|
+
*/
|
|
23
|
+
export declare const getComponentDepth: (component: Internal.UID.Schema, components: Array<NestedComponent>) => number;
|
package/dist/server/index.js
CHANGED
|
@@ -46,12 +46,6 @@ const bootstrap = async ({ strapi: strapi2 }) => {
|
|
|
46
46
|
await strapi2.service("admin::permission").actionProvider.registerMany(actions);
|
|
47
47
|
};
|
|
48
48
|
const { ApplicationError: ApplicationError$3 } = utils.errors;
|
|
49
|
-
const hasComponent = (model) => {
|
|
50
|
-
const compoKeys = Object.keys(model.attributes || {}).filter((key) => {
|
|
51
|
-
return model.attributes[key].type === "component";
|
|
52
|
-
});
|
|
53
|
-
return compoKeys.length > 0;
|
|
54
|
-
};
|
|
55
49
|
const isConfigurable = (attribute) => ___default.default.get(attribute, "configurable", true);
|
|
56
50
|
const isRelation = (attribute) => attribute.type === "relation";
|
|
57
51
|
const formatAttributes = (model) => {
|
|
@@ -1397,7 +1391,7 @@ const getTypeValidator = (attribute, { types, modelType, attributes }) => {
|
|
|
1397
1391
|
...getTypeShape(attribute, { modelType, attributes })
|
|
1398
1392
|
});
|
|
1399
1393
|
};
|
|
1400
|
-
const getTypeShape = (attribute, {
|
|
1394
|
+
const getTypeShape = (attribute, { attributes } = {}) => {
|
|
1401
1395
|
switch (attribute.type) {
|
|
1402
1396
|
case "media": {
|
|
1403
1397
|
return {
|
|
@@ -1542,21 +1536,8 @@ const getTypeShape = (attribute, { modelType, attributes } = {}) => {
|
|
|
1542
1536
|
return {
|
|
1543
1537
|
required: validators.required,
|
|
1544
1538
|
repeatable: utils.yup.boolean(),
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
test(compoUID) {
|
|
1548
|
-
const targetCompo = strapi.components[compoUID];
|
|
1549
|
-
if (!targetCompo)
|
|
1550
|
-
return true;
|
|
1551
|
-
if (modelType === modelTypes.COMPONENT && hasComponent(targetCompo)) {
|
|
1552
|
-
return this.createError({
|
|
1553
|
-
path: this.path,
|
|
1554
|
-
message: `${targetCompo.modelName} already is a nested component. You cannot have more than one level of nesting inside your components.`
|
|
1555
|
-
});
|
|
1556
|
-
}
|
|
1557
|
-
return true;
|
|
1558
|
-
}
|
|
1559
|
-
}).required(),
|
|
1539
|
+
// TODO: Add correct server validation for nested components
|
|
1540
|
+
component: utils.yup.string().required(),
|
|
1560
1541
|
min: utils.yup.number(),
|
|
1561
1542
|
max: utils.yup.number()
|
|
1562
1543
|
};
|