@strapi/content-type-builder 5.0.0-beta.7 → 5.0.0-beta.9

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index-CH93OgkC.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","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.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 });\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;ACJO,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,MAAM,iBAAiB;AACvB,MAAM,8BACX;AACK,MAAM,qBAAqB;AAC3B,MAAM,gBAAgB;AACtB,MAAM,wCACX;AACK,MAAM,qCACX;AACK,MAAM,eAAe;AACrB,MAAM,oBAAoB;AAC1B,MAAM,gBAAgB;AACtB,MAAM,uBAAuB;AChB9B,MAAA,+BAA+B,CACnC,YACA,sBAC6B;AAC7B,QAAM,gBAA0C,WAAW,OAAO,CAAC,KA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.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","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.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A,MAAA,qCAAA,qBAAA,CAAA,GAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,kBAAA,CAAA,GAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,kBAAA,IAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,kBAAA,CAAA,GAAA,0BAAA,MAAA,qCAAA,kBAAA,CAAA,GAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,kBAAA,CAAA,GAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,kBAAA,IAAA,0BAAA,MAAA,QAAA,QAAA,EAAA,KAAA,MAAA,QAAA,kBAAA,CAAA,GAAA,+BAAA,MAAA,qCAAA,uBAAA,CAAA,GAAA,0BAAA,MAAA,qCAAA,kBAAA,CAAA,EAAA,CAAA,GAAA,kBAAA,MAAA,OAAA,EACnC,KAAK,CAAC,EAAE,SAAS,KAAA,MAAW;AACpB,iBAAA;AAAA,YACL,MAAM,yBAAyB,MAAM,QAAQ;AAAA,YAC7C;AAAA,UAAA;AAAA,QACF,CACD,EACA,MAAM,MAAM;AACJ,iBAAA;AAAA,YACL,MAAM,CAAC;AAAA,YACP;AAAA,UAAA;AAAA,QACF,CACD;AAAA,MAAA,CACJ;AAAA,IAAA;AAGI,WAAA,QAAQ,QAAQ,aAAa;AAAA,EACtC;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -9,7 +9,7 @@ const Icons = require("@strapi/icons");
9
9
  const reactDom = require("react-dom");
10
10
  const styledComponents = require("styled-components");
11
11
  const upperFirst = require("lodash/upperFirst");
12
- const index$1 = require("./index-CH93OgkC.js");
12
+ const index$1 = require("./index-CafZdqdd.js");
13
13
  const isEqual = require("lodash/isEqual");
14
14
  const get = require("lodash/get");
15
15
  const groupBy = require("lodash/groupBy");
@@ -1723,7 +1723,6 @@ const IconPicker = ({ intlLabel, name, onChange, value = "" }) => {
1723
1723
  {
1724
1724
  ref: searchBarRef,
1725
1725
  name: "searchbar",
1726
- size: "S",
1727
1726
  placeholder: formatMessage({
1728
1727
  id: getTrad("ComponentIconPicker.search.placeholder"),
1729
1728
  defaultMessage: "Search for an icon"
@@ -1750,18 +1749,19 @@ const IconPicker = ({ intlLabel, name, onChange, value = "" }) => {
1750
1749
  {
1751
1750
  ref: searchIconRef,
1752
1751
  onClick: toggleSearch,
1753
- "aria-label": formatMessage({
1752
+ withTooltip: false,
1753
+ label: formatMessage({
1754
1754
  id: getTrad("IconPicker.search.button.label"),
1755
1755
  defaultMessage: "Search icon button"
1756
1756
  }),
1757
- icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Search, {}),
1758
- noBorder: true
1757
+ borderWidth: 0,
1758
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Search, {})
1759
1759
  }
1760
1760
  ),
1761
1761
  value && /* @__PURE__ */ jsxRuntime.jsx(
1762
1762
  designSystem.Tooltip,
1763
1763
  {
1764
- description: formatMessage({
1764
+ label: formatMessage({
1765
1765
  id: getTrad("IconPicker.remove.tooltip"),
1766
1766
  defaultMessage: "Remove the selected icon"
1767
1767
  }),
@@ -1769,12 +1769,13 @@ const IconPicker = ({ intlLabel, name, onChange, value = "" }) => {
1769
1769
  designSystem.IconButton,
1770
1770
  {
1771
1771
  onClick: removeIconSelected,
1772
- "aria-label": formatMessage({
1772
+ withTooltip: false,
1773
+ label: formatMessage({
1773
1774
  id: getTrad("IconPicker.remove.button"),
1774
- defaultMessage: "Remove the selected icon button"
1775
+ defaultMessage: "Remove the selected icon"
1775
1776
  }),
1776
- icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Trash, {}),
1777
- noBorder: true
1777
+ borderWidth: 0,
1778
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Trash, {})
1778
1779
  }
1779
1780
  )
1780
1781
  }
@@ -2037,7 +2038,7 @@ const GenericInput = ({
2037
2038
  },
2038
2039
  onClear: () => onChange({ target: { name, value: null, type } }),
2039
2040
  placeholder: formattedPlaceholder,
2040
- selectedDate: value
2041
+ value
2041
2042
  }
2042
2043
  );
2043
2044
  }
@@ -4687,7 +4688,6 @@ const forms = {
4687
4688
  ctbFormsAPI
4688
4689
  }) {
4689
4690
  const usedAttributeNames = getUsedAttributeNames(schemaAttributes, schemaData);
4690
- attributeTypes[attributeType];
4691
4691
  let attributeShape;
4692
4692
  if (attributeType === "relation") {
4693
4693
  attributeShape = attributeTypes[attributeType](
@@ -4857,9 +4857,8 @@ const forms = {
4857
4857
  });
4858
4858
  const takenCollectionNames = isEditing ? collectionNames.filter((collectionName) => {
4859
4859
  const { schema } = contentTypes[ctUid];
4860
- const currentPluralName = schema.pluralName;
4861
4860
  const currentCollectionName = schema.collectionName;
4862
- return collectionName !== currentPluralName || collectionName !== currentCollectionName;
4861
+ return collectionName !== currentCollectionName;
4863
4862
  }) : collectionNames;
4864
4863
  const contentTypeShape = createContentTypeSchema({
4865
4864
  usedContentTypeNames: takenNames,
@@ -6699,11 +6698,11 @@ const FormModalNavigationProvider = ({ children }) => {
6699
6698
  }
6700
6699
  );
6701
6700
  };
6702
- const ListView$1 = React.lazy(() => Promise.resolve().then(() => require("./ListView-BuXQ605A.js")));
6701
+ const ListView$1 = React.lazy(() => Promise.resolve().then(() => require("./ListView-ox2gEeAO.js")));
6703
6702
  const RecursivePath = () => {
6704
6703
  return /* @__PURE__ */ jsxRuntime.jsx(React.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {}), children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Routes, { children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: `/:componentUid`, element: /* @__PURE__ */ jsxRuntime.jsx(ListView$1, {}) }) }) });
6705
6704
  };
6706
- const ListView = React.lazy(() => Promise.resolve().then(() => require("./ListView-BuXQ605A.js")));
6705
+ const ListView = React.lazy(() => Promise.resolve().then(() => require("./ListView-ox2gEeAO.js")));
6707
6706
  const App = () => {
6708
6707
  const { formatMessage } = reactIntl.useIntl();
6709
6708
  const title = formatMessage({
@@ -6735,4 +6734,4 @@ exports.getTrad = getTrad;
6735
6734
  exports.index = index;
6736
6735
  exports.useDataManager = useDataManager;
6737
6736
  exports.useFormModalNavigation = useFormModalNavigation;
6738
- //# sourceMappingURL=index-2ofTO2HM.js.map
6737
+ //# sourceMappingURL=index-DT8SxJEc.js.map