@strapi/content-type-builder 5.16.1 → 5.17.0

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.
Files changed (57) hide show
  1. package/dist/admin/components/ApplyConditionButton.js +34 -0
  2. package/dist/admin/components/ApplyConditionButton.js.map +1 -0
  3. package/dist/admin/components/ApplyConditionButton.mjs +32 -0
  4. package/dist/admin/components/ApplyConditionButton.mjs.map +1 -0
  5. package/dist/admin/components/AttributeRow.js +58 -8
  6. package/dist/admin/components/AttributeRow.js.map +1 -1
  7. package/dist/admin/components/AttributeRow.mjs +59 -9
  8. package/dist/admin/components/AttributeRow.mjs.map +1 -1
  9. package/dist/admin/components/FormModal/FormModal.js +134 -3
  10. package/dist/admin/components/FormModal/FormModal.js.map +1 -1
  11. package/dist/admin/components/FormModal/FormModal.mjs +137 -5
  12. package/dist/admin/components/FormModal/FormModal.mjs.map +1 -1
  13. package/dist/admin/components/FormModal/attributes/ConditionForm.js +448 -0
  14. package/dist/admin/components/FormModal/attributes/ConditionForm.js.map +1 -0
  15. package/dist/admin/components/FormModal/attributes/ConditionForm.mjs +428 -0
  16. package/dist/admin/components/FormModal/attributes/ConditionForm.mjs.map +1 -0
  17. package/dist/admin/components/FormModal/attributes/advancedForm.js +55 -16
  18. package/dist/admin/components/FormModal/attributes/advancedForm.js.map +1 -1
  19. package/dist/admin/components/FormModal/attributes/advancedForm.mjs +55 -16
  20. package/dist/admin/components/FormModal/attributes/advancedForm.mjs.map +1 -1
  21. package/dist/admin/components/FormModal/forms/forms.js +3 -1
  22. package/dist/admin/components/FormModal/forms/forms.js.map +1 -1
  23. package/dist/admin/components/FormModal/forms/forms.mjs +3 -1
  24. package/dist/admin/components/FormModal/forms/forms.mjs.map +1 -1
  25. package/dist/admin/components/GenericInputs.js +5 -2
  26. package/dist/admin/components/GenericInputs.js.map +1 -1
  27. package/dist/admin/components/GenericInputs.mjs +5 -2
  28. package/dist/admin/components/GenericInputs.mjs.map +1 -1
  29. package/dist/admin/components/TabForm.js +88 -0
  30. package/dist/admin/components/TabForm.js.map +1 -1
  31. package/dist/admin/components/TabForm.mjs +89 -1
  32. package/dist/admin/components/TabForm.mjs.map +1 -1
  33. package/dist/admin/src/components/ApplyConditionButton.d.ts +8 -0
  34. package/dist/admin/src/components/FormModal/attributes/ConditionForm.d.ts +23 -0
  35. package/dist/admin/src/components/FormModal/attributes/advancedForm.d.ts +288 -8
  36. package/dist/admin/src/components/FormModal/attributes/form.d.ts +288 -8
  37. package/dist/admin/src/components/GenericInputs.d.ts +30 -3
  38. package/dist/admin/src/utils/conditions.d.ts +17 -0
  39. package/dist/admin/translations/en.json.js +24 -0
  40. package/dist/admin/translations/en.json.js.map +1 -1
  41. package/dist/admin/translations/en.json.mjs +24 -0
  42. package/dist/admin/translations/en.json.mjs.map +1 -1
  43. package/dist/admin/utils/conditions.js +61 -0
  44. package/dist/admin/utils/conditions.js.map +1 -0
  45. package/dist/admin/utils/conditions.mjs +57 -0
  46. package/dist/admin/utils/conditions.mjs.map +1 -0
  47. package/dist/server/controllers/validation/schema.js +11 -2
  48. package/dist/server/controllers/validation/schema.js.map +1 -1
  49. package/dist/server/controllers/validation/schema.mjs +11 -2
  50. package/dist/server/controllers/validation/schema.mjs.map +1 -1
  51. package/dist/server/src/controllers/validation/schema.d.ts +25728 -0
  52. package/dist/server/src/controllers/validation/schema.d.ts.map +1 -1
  53. package/dist/server/src/services/schema.d.ts +1302 -0
  54. package/dist/server/src/services/schema.d.ts.map +1 -1
  55. package/dist/server/src/utils/attributes.d.ts +210 -0
  56. package/dist/server/src/utils/attributes.d.ts.map +1 -1
  57. package/package.json +5 -5
@@ -1,7 +1,8 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
2
  import * as React from 'react';
3
- import { useStrapiApp, useNotification, useTracking } from '@strapi/admin/strapi-admin';
4
- import { Modal, Tabs, Flex, Divider, Button } from '@strapi/design-system';
3
+ import { useState } from 'react';
4
+ import { useStrapiApp, useNotification, useTracking, ConfirmDialog } from '@strapi/admin/strapi-admin';
5
+ import { Modal, Dialog, Box, Typography, Tabs, Flex, Divider, Button } from '@strapi/design-system';
5
6
  import get from 'lodash/get';
6
7
  import has from 'lodash/has';
7
8
  import isEqual from 'lodash/isEqual';
@@ -41,6 +42,7 @@ import { SelectNumber } from '../SelectNumber.mjs';
41
42
  import { SingularName } from '../SingularName.mjs';
42
43
  import { TabForm } from '../TabForm.mjs';
43
44
  import { TextareaEnum } from '../TextareaEnum.mjs';
45
+ import { ConditionForm } from './attributes/ConditionForm.mjs';
44
46
  import { forms } from './forms/forms.mjs';
45
47
  import { actions, initialState } from './reducer.mjs';
46
48
  import { canEditContentType } from './utils/canEditContentType.mjs';
@@ -69,6 +71,40 @@ const FormModal = ()=>{
69
71
  const { addAttribute, editAttribute, addCustomFieldAttribute, addCreatedComponentToDynamicZone, changeDynamicZoneComponents, contentTypes, components, createSchema, createComponentSchema, deleteComponent, deleteContentType, editCustomFieldAttribute, updateSchema, nestedComponents, sortedContentTypesList, updateComponentSchema, updateComponentUid, reservedNames } = useDataManager();
70
72
  const { componentToCreate, formErrors, initialData, isCreatingComponentWhileAddingAField, modifiedData } = reducerState;
71
73
  const type = forTarget === 'component' ? components[targetUid] : contentTypes[targetUid];
74
+ const [showWarningDialog, setShowWarningDialog] = useState(false);
75
+ const [pendingSubmit, setPendingSubmit] = useState(null);
76
+ const checkFieldNameChanges = ()=>{
77
+ // Only check when editing an attribute
78
+ if (actionType !== 'edit' || modalType !== 'attribute') {
79
+ return false;
80
+ }
81
+ const oldName = initialData.name;
82
+ const oldEnum = initialData.enum;
83
+ const newEnum = modifiedData.enum;
84
+ // Get all attributes from the content type schema
85
+ const contentTypeAttributes = type?.attributes || [];
86
+ // Find all fields that reference this field in their conditions
87
+ const referencedFields = contentTypeAttributes.filter((attr)=>{
88
+ if (!attr.conditions) return false;
89
+ const condition = attr.conditions.visible;
90
+ if (!condition) return false;
91
+ const [[, conditions]] = Object.entries(condition);
92
+ const [fieldVar, value] = conditions;
93
+ // Check if this condition references our field
94
+ if (fieldVar.var !== oldName) return false;
95
+ // If it's an enum field, also check if the value is being deleted/changed
96
+ if (oldEnum && newEnum) {
97
+ const deletedOrChangedValues = oldEnum.filter((oldValue)=>!newEnum.includes(oldValue));
98
+ return deletedOrChangedValues.includes(value);
99
+ }
100
+ return true;
101
+ });
102
+ // If any fields reference this field, return them
103
+ if (referencedFields.length > 0) {
104
+ return referencedFields;
105
+ }
106
+ return false;
107
+ };
72
108
  React.useEffect(()=>{
73
109
  if (isOpen) {
74
110
  const collectionTypesForRelation = sortedContentTypesList.filter(isAllowedContentTypesForRelations);
@@ -296,6 +332,11 @@ const FormModal = ()=>{
296
332
  let val;
297
333
  if (namesThatCanResetToNullValue.includes(name) && value === '') {
298
334
  val = null;
335
+ } else if (name === 'enum') {
336
+ // For enum values, ensure we're working with an array
337
+ val = Array.isArray(value) ? value : [
338
+ value
339
+ ];
299
340
  } else {
300
341
  val = value;
301
342
  }
@@ -321,8 +362,7 @@ const FormModal = ()=>{
321
362
  dispatch,
322
363
  formErrors
323
364
  ]);
324
- const handleSubmit = async (e, shouldContinue = isCreating)=>{
325
- e.preventDefault();
365
+ const submitForm = async (e, shouldContinue = isCreating)=>{
326
366
  try {
327
367
  await checkFormValidity();
328
368
  dispatch(actions.setErrors({
@@ -644,6 +684,20 @@ const FormModal = ()=>{
644
684
  }
645
685
  }
646
686
  };
687
+ const handleSubmit = async (e, shouldContinue = isCreating)=>{
688
+ e.preventDefault();
689
+ // Check for field name changes when clicking Finish
690
+ const referencedFields = checkFieldNameChanges();
691
+ if (referencedFields) {
692
+ setPendingSubmit({
693
+ e,
694
+ shouldContinue
695
+ });
696
+ setShowWarningDialog(true);
697
+ return;
698
+ }
699
+ await submitForm(e, shouldContinue);
700
+ };
647
701
  const handleConfirmClose = ()=>{
648
702
  // eslint-disable-next-line no-alert
649
703
  const confirm = window.confirm(formatMessage({
@@ -728,6 +782,7 @@ const FormModal = ()=>{
728
782
  'text-plural': PluralName,
729
783
  'text-singular': SingularName,
730
784
  'textarea-enum': TextareaEnum,
785
+ 'condition-form': ConditionForm,
731
786
  ...inputsFromPlugins
732
787
  },
733
788
  componentToCreate,
@@ -743,7 +798,8 @@ const FormModal = ()=>{
743
798
  naturePickerType: forTarget,
744
799
  isCreating,
745
800
  targetUid,
746
- forTarget
801
+ forTarget,
802
+ contentTypeSchema: type
747
803
  };
748
804
  const advancedForm = formToDisplay.advanced({
749
805
  data: modifiedData,
@@ -786,6 +842,82 @@ const FormModal = ()=>{
786
842
  onOpenChange: handleClosed,
787
843
  children: /*#__PURE__*/ jsxs(Modal.Content, {
788
844
  children: [
845
+ /*#__PURE__*/ jsxs(Dialog.Root, {
846
+ open: showWarningDialog,
847
+ onOpenChange: setShowWarningDialog,
848
+ children: [
849
+ /*#__PURE__*/ jsx(Dialog.Trigger, {}),
850
+ /*#__PURE__*/ jsx(ConfirmDialog, {
851
+ onConfirm: ()=>{
852
+ if (pendingSubmit) {
853
+ const { e, shouldContinue } = pendingSubmit;
854
+ setShowWarningDialog(false);
855
+ setPendingSubmit(null);
856
+ submitForm(e, shouldContinue);
857
+ }
858
+ },
859
+ onCancel: ()=>{
860
+ setShowWarningDialog(false);
861
+ setPendingSubmit(null);
862
+ },
863
+ children: (()=>{
864
+ const referencedFields = checkFieldNameChanges();
865
+ if (!referencedFields) return null;
866
+ const fieldNames = referencedFields.map((field)=>field.name).join(', ');
867
+ const isEnum = initialData.enum && modifiedData.enum;
868
+ if (isEnum) {
869
+ const oldEnum = initialData.enum;
870
+ const newEnum = modifiedData.enum;
871
+ const deletedOrChangedValues = oldEnum.filter((value)=>!newEnum.includes(value));
872
+ return /*#__PURE__*/ jsx(Box, {
873
+ children: /*#__PURE__*/ jsxs(Typography, {
874
+ children: [
875
+ formatMessage({
876
+ id: 'form.attribute.condition.enum-change-warning',
877
+ defaultMessage: 'The following fields have conditions that depend on this field: '
878
+ }),
879
+ /*#__PURE__*/ jsx(Typography, {
880
+ fontWeight: "bold",
881
+ children: fieldNames
882
+ }),
883
+ formatMessage({
884
+ id: 'form.attribute.condition.enum-change-warning-values',
885
+ defaultMessage: '. Changing or removing the enum values '
886
+ }),
887
+ /*#__PURE__*/ jsx(Typography, {
888
+ fontWeight: "bold",
889
+ children: deletedOrChangedValues.join(', ')
890
+ }),
891
+ formatMessage({
892
+ id: 'form.attribute.condition.enum-change-warning-end',
893
+ defaultMessage: ' will break these conditions. Do you want to proceed?'
894
+ })
895
+ ]
896
+ })
897
+ });
898
+ }
899
+ return /*#__PURE__*/ jsx(Box, {
900
+ children: /*#__PURE__*/ jsxs(Typography, {
901
+ children: [
902
+ formatMessage({
903
+ id: 'form.attribute.condition.field-change-warning',
904
+ defaultMessage: 'The following fields have conditions that depend on this field: '
905
+ }),
906
+ /*#__PURE__*/ jsx(Typography, {
907
+ fontWeight: "bold",
908
+ children: fieldNames
909
+ }),
910
+ formatMessage({
911
+ id: 'form.attribute.condition.field-change-warning-end',
912
+ defaultMessage: '. Renaming it will break these conditions. Do you want to proceed?'
913
+ })
914
+ ]
915
+ })
916
+ });
917
+ })()
918
+ })
919
+ ]
920
+ }),
789
921
  /*#__PURE__*/ jsx(FormModalHeader, {
790
922
  actionType: actionType,
791
923
  attributeName: attributeName,
@@ -1 +1 @@
1
- {"version":3,"file":"FormModal.mjs","sources":["../../../../admin/src/components/FormModal/FormModal.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useStrapiApp, useTracking, useNotification } from '@strapi/admin/strapi-admin';\nimport { Button, Divider, Flex, Modal, Tabs } from '@strapi/design-system';\nimport get from 'lodash/get';\nimport has from 'lodash/has';\nimport isEqual from 'lodash/isEqual';\nimport pick from 'lodash/pick';\nimport set from 'lodash/set';\nimport { useIntl } from 'react-intl';\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\nimport { useNavigate } from 'react-router-dom';\nimport { styled } from 'styled-components';\nimport * as yup from 'yup';\n\nimport { pluginId } from '../../pluginId';\nimport { getTrad, isAllowedContentTypesForRelations } from '../../utils';\nimport { findAttribute } from '../../utils/findAttribute';\nimport { getYupInnerErrors } from '../../utils/getYupInnerErrors';\n// New compos\nimport { AllowedTypesSelect } from '../AllowedTypesSelect';\nimport { IconByType } from '../AttributeIcon';\nimport { AttributeOptions } from '../AttributeOptions/AttributeOptions';\nimport { BooleanDefaultValueSelect } from '../BooleanDefaultValueSelect';\nimport { BooleanRadioGroup } from '../BooleanRadioGroup';\nimport { CheckboxWithNumberField } from '../CheckboxWithNumberField';\nimport { ContentTypeRadioGroup } from '../ContentTypeRadioGroup';\nimport { CustomRadioGroup } from '../CustomRadioGroup';\nimport { useDataManager } from '../DataManager/useDataManager';\nimport { DraftAndPublishToggle } from '../DraftAndPublishToggle';\nimport { FormModalEndActions } from '../FormModalEndActions';\nimport { FormModalHeader } from '../FormModalHeader';\nimport { useFormModalNavigation } from '../FormModalNavigation/useFormModalNavigation';\nimport { FormModalSubHeader } from '../FormModalSubHeader';\nimport { IconPicker } from '../IconPicker/IconPicker';\nimport { PluralName } from '../PluralName';\nimport { Relation } from '../Relation/Relation';\nimport { SelectCategory } from '../SelectCategory';\nimport { SelectComponent } from '../SelectComponent';\nimport { SelectComponents } from '../SelectComponents';\nimport { SelectDateType } from '../SelectDateType';\nimport { SelectNumber } from '../SelectNumber';\nimport { SingularName } from '../SingularName';\nimport { TabForm } from '../TabForm';\nimport { TextareaEnum } from '../TextareaEnum';\n\nimport { forms } from './forms/forms';\nimport { actions, initialState, type State as FormModalState } from './reducer';\nimport { canEditContentType } from './utils/canEditContentType';\nimport { createComponentUid, createUid } from './utils/createUid';\nimport { getAttributesToDisplay } from './utils/getAttributesToDisplay';\nimport { getFormInputNames } from './utils/getFormInputNames';\n\nimport type { ContentType } from '../../types';\nimport type { Internal } from '@strapi/types';\n\nconst FormComponent = styled.form`\n overflow: auto;\n`;\n\nconst selectState = (state: Record<string, unknown>) =>\n (state['content-type-builder_formModal'] || initialState) as FormModalState;\n\nexport const FormModal = () => {\n const {\n onCloseModal,\n onNavigateToChooseAttributeModal,\n onNavigateToAddCompoToDZModal,\n onNavigateToCreateComponentStep2,\n actionType,\n attributeName,\n attributeType,\n customFieldUid,\n dynamicZoneTarget,\n forTarget,\n modalType,\n isOpen,\n kind,\n step,\n targetUid,\n showBackLink,\n activeTab,\n setActiveTab,\n } = useFormModalNavigation();\n\n const getPlugin = useStrapiApp('FormModal', (state) => state.getPlugin);\n const getCustomField = useStrapiApp('FormModal', (state) => state.customFields.get);\n const customField = getCustomField(customFieldUid);\n\n const dispatch = useDispatch();\n const { toggleNotification } = useNotification();\n const reducerState = useSelector(selectState, shallowEqual);\n\n const navigate = useNavigate();\n const { trackUsage } = useTracking();\n const { formatMessage } = useIntl();\n const ctbPlugin = getPlugin(pluginId);\n const ctbFormsAPI: any = ctbPlugin?.apis.forms;\n const inputsFromPlugins = ctbFormsAPI.components.inputs;\n\n const {\n addAttribute,\n editAttribute,\n addCustomFieldAttribute,\n addCreatedComponentToDynamicZone,\n changeDynamicZoneComponents,\n contentTypes,\n components,\n createSchema,\n createComponentSchema,\n deleteComponent,\n deleteContentType,\n editCustomFieldAttribute,\n updateSchema,\n nestedComponents,\n sortedContentTypesList,\n updateComponentSchema,\n updateComponentUid,\n reservedNames,\n } = useDataManager();\n\n const {\n componentToCreate,\n formErrors,\n initialData,\n isCreatingComponentWhileAddingAField,\n modifiedData,\n } = reducerState;\n\n const type = forTarget === 'component' ? components[targetUid] : contentTypes[targetUid];\n\n React.useEffect(() => {\n if (isOpen) {\n const collectionTypesForRelation = sortedContentTypesList.filter(\n isAllowedContentTypesForRelations\n );\n\n if (actionType === 'edit' && modalType === 'attribute' && forTarget === 'contentType') {\n trackUsage('willEditFieldOfContentType');\n }\n\n // Case:\n // the user opens the modal chooseAttributes\n // selects dynamic zone => set the field name\n // then goes to step 1 (the modal is addComponentToDynamicZone) and finally reloads the app.\n // In this particular if the user tries to add components to the zone it will pop an error since the dz is unknown\n const foundDynamicZoneTarget =\n findAttribute(get(type, 'schema.attributes', []), dynamicZoneTarget) || null;\n\n // Create content type we need to add the default option draftAndPublish\n if (modalType === 'contentType' && actionType === 'create') {\n dispatch(\n actions.setDataToEdit({\n data: {\n draftAndPublish: true,\n },\n })\n );\n }\n\n // Edit content type\n if (modalType === 'contentType' && actionType === 'edit') {\n dispatch(\n actions.setDataToEdit({\n data: {\n displayName: type.info.displayName,\n draftAndPublish: type.options?.draftAndPublish,\n kind: 'kind' in type && type.kind,\n pluginOptions: type.pluginOptions,\n pluralName: 'pluralName' in type.info && type.info.pluralName,\n singularName: 'singularName' in type.info && type.info.singularName,\n },\n })\n );\n }\n\n // Edit component\n if (modalType === 'component' && actionType === 'edit') {\n dispatch(\n actions.setDataToEdit({\n data: {\n displayName: type.info.displayName,\n category: 'category' in type && type.category,\n icon: type.info.icon,\n },\n })\n );\n }\n\n // Special case for the dynamic zone\n if (modalType === 'addComponentToDynamicZone' && actionType === 'edit') {\n const attributeToEdit = {\n ...foundDynamicZoneTarget,\n // We filter the available components\n // Because this modal is only used for adding components\n components: [],\n name: dynamicZoneTarget,\n createComponent: false,\n componentToCreate: { type: 'component' },\n };\n\n dispatch(\n actions.setDynamicZoneDataSchema({\n attributeToEdit,\n })\n );\n }\n\n // Set the predefined data structure to create an attribute\n if (attributeType) {\n const attributeToEditNotFormatted = findAttribute(\n get(type, ['attributes'], []),\n attributeName\n );\n const attributeToEdit = {\n ...attributeToEditNotFormatted,\n name: attributeName,\n };\n\n // We need to set the repeatable key to false when editing a component\n // The API doesn't send this info\n if (attributeType === 'component' && actionType === 'edit') {\n if (!('repeatable' in attributeToEdit) || !attributeToEdit.repeatable) {\n set(attributeToEdit, 'repeatable', false);\n }\n }\n\n if (modalType === 'customField') {\n if (actionType === 'edit') {\n dispatch(\n actions.setCustomFieldDataSchema({\n isEditing: true,\n modifiedDataToSetForEditing: attributeToEdit,\n uid: type.uid,\n })\n );\n } else {\n dispatch(\n actions.setCustomFieldDataSchema({\n customField: pick(customField, ['type', 'options']),\n isEditing: false,\n modifiedDataToSetForEditing: attributeToEdit,\n uid: type.uid,\n })\n );\n }\n } else {\n dispatch(\n actions.setAttributeDataSchema({\n attributeType,\n nameToSetForRelation: get(collectionTypesForRelation, ['0', 'title'], 'error'),\n targetUid: get(collectionTypesForRelation, ['0', 'uid'], 'error'),\n isEditing: actionType === 'edit',\n modifiedDataToSetForEditing: attributeToEdit,\n step,\n uid: type.uid,\n })\n );\n }\n }\n } else {\n dispatch(actions.resetProps());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [actionType, attributeName, attributeType, dynamicZoneTarget, forTarget, isOpen, modalType]);\n\n const isCreatingContentType = modalType === 'contentType';\n const isCreatingComponent = modalType === 'component';\n const isCreatingAttribute = modalType === 'attribute';\n const isCreatingCustomFieldAttribute = modalType === 'customField';\n const isComponentAttribute = attributeType === 'component' && isCreatingAttribute;\n const isCreating = actionType === 'create';\n const isCreatingComponentFromAView =\n get(modifiedData, 'createComponent', false) || isCreatingComponentWhileAddingAField;\n const isInFirstComponentStep = step === '1';\n const isPickingAttribute = modalType === 'chooseAttribute';\n const uid = createUid(modifiedData.displayName || '');\n const attributes = get(type, ['attributes'], null) as {\n name: string;\n }[];\n\n const checkFormValidity = async () => {\n let schema;\n const dataToValidate =\n isCreatingComponentFromAView && step === '1'\n ? get(modifiedData, 'componentToCreate', {})\n : modifiedData;\n // Check form validity for content type\n if (isCreatingContentType) {\n schema = forms.contentType.schema(\n Object.keys(contentTypes),\n actionType === 'edit',\n // currentUID\n (type?.uid ?? null) as Internal.UID.ContentType,\n reservedNames,\n ctbFormsAPI,\n contentTypes\n );\n\n // Check form validity for component\n // This is happening when the user click on the link from the left menu\n } else if (isCreatingComponent) {\n schema = forms.component.schema(\n Object.keys(components) as Internal.UID.Component[],\n modifiedData.category || '',\n reservedNames,\n actionType === 'edit',\n components,\n modifiedData.displayName || '',\n (type?.uid ?? null) as Internal.UID.Component\n // ctbFormsAPI\n );\n } else if (isCreatingCustomFieldAttribute) {\n schema = forms.customField.schema({\n schemaAttributes: get(type, ['attributes'], []),\n attributeType: customField!.type,\n reservedNames,\n schemaData: { modifiedData, initialData },\n ctbFormsAPI,\n customFieldValidator: customField!.options?.validator,\n });\n\n // Check for validity for creating a component\n // This is happening when the user creates a component \"on the fly\"\n // Since we temporarily store the component info in another object\n // The data is set in the componentToCreate key\n } else if (isComponentAttribute && isCreatingComponentFromAView && isInFirstComponentStep) {\n schema = forms.component.schema(\n Object.keys(components) as Internal.UID.Component[],\n get(modifiedData, 'componentToCreate.category', ''),\n reservedNames,\n actionType === 'edit',\n components,\n modifiedData.componentToCreate.displayName || ''\n );\n\n // Check form validity for creating a 'common attribute'\n // We need to make sure that it is independent from the step\n } else if (isCreatingAttribute && !isInFirstComponentStep) {\n const computedAttrbiuteType = attributeType === 'relation' ? 'relation' : modifiedData.type;\n\n let alreadyTakenTargetContentTypeAttributes: any[] = [];\n\n if (computedAttrbiuteType === 'relation') {\n const targetContentTypeUID = get(modifiedData, ['target'], null);\n\n const targetContentTypeAttributes = get(\n contentTypes,\n [targetContentTypeUID, 'attributes'],\n []\n );\n\n // Create an array with all the targetContentType attributes name\n // in order to prevent the user from creating a relation with a targetAttribute\n // that may exist in the other content type\n alreadyTakenTargetContentTypeAttributes = targetContentTypeAttributes.filter(\n ({ name: attrName }: { name: string }) => {\n // Keep all the target content type attributes when creating a relation\n if (actionType !== 'edit') {\n return true;\n }\n\n // Remove the already created one when editing\n return attrName !== initialData.targetAttribute;\n }\n );\n }\n schema = forms.attribute.schema(\n type,\n computedAttrbiuteType,\n reservedNames,\n alreadyTakenTargetContentTypeAttributes,\n { modifiedData, initialData },\n ctbFormsAPI\n );\n } else {\n // The user is either in the addComponentToDynamicZone modal or\n // in step 1 of the add component (modalType=attribute&attributeType=component) but not creating a component\n // eslint-disable-next-line no-lonely-if\n if (isInFirstComponentStep && isCreatingComponentFromAView) {\n schema = forms.component.schema(\n Object.keys(components) as Internal.UID.Component[],\n get(modifiedData, 'componentToCreate.category', ''),\n reservedNames,\n actionType === 'edit',\n components,\n modifiedData.componentToCreate.displayName || ''\n );\n } else {\n // The form is valid\n // The case here is being in the addComponentToDynamicZone modal and not creating a component\n return;\n }\n }\n\n await schema.validate(dataToValidate, { abortEarly: false });\n };\n\n const handleChange = React.useCallback(\n ({\n target: { name, value, type, ...rest },\n }: {\n target: { name: string; value: string; type: string };\n }) => {\n const namesThatCanResetToNullValue = [\n 'enumName',\n 'max',\n 'min',\n 'maxLength',\n 'minLength',\n 'regex',\n 'default',\n ];\n\n let val;\n\n if (namesThatCanResetToNullValue.includes(name) && value === '') {\n val = null;\n } else {\n val = value;\n }\n\n const clonedErrors = Object.assign({}, formErrors);\n\n // Reset min error when modifying the max\n if (name === 'max') {\n delete clonedErrors.min;\n }\n\n // Same here\n if (name === 'maxLength') {\n delete clonedErrors.minLength;\n }\n\n // Since the onBlur is deactivated we remove the errors directly when changing an input\n delete clonedErrors[name];\n\n dispatch(\n actions.setErrors({\n errors: clonedErrors,\n })\n );\n\n dispatch(\n actions.onChange({\n keys: name.split('.'),\n value: val,\n })\n );\n },\n [dispatch, formErrors]\n );\n\n const handleSubmit = async (e: React.SyntheticEvent, shouldContinue = isCreating) => {\n e.preventDefault();\n\n try {\n await checkFormValidity();\n\n dispatch(\n actions.setErrors({\n errors: {},\n })\n );\n\n sendButtonAddMoreFieldEvent(shouldContinue);\n\n const ctTargetUid = targetUid;\n\n if (isCreatingContentType) {\n // Create the content type schema\n if (isCreating) {\n createSchema({\n data: {\n kind,\n displayName: modifiedData.displayName,\n draftAndPublish: modifiedData.draftAndPublish,\n pluginOptions: modifiedData.pluginOptions,\n singularName: modifiedData.singularName,\n pluralName: modifiedData.pluralName,\n },\n uid,\n });\n\n // Redirect the user to the created content type\n navigate({ pathname: `/plugins/${pluginId}/content-types/${uid}` });\n\n onCloseModal();\n } else {\n // NOTE: we have to assume we have a CT here until we refactor more\n const contentType = type as ContentType;\n // We cannot switch from collection type to single when the modal is making relations other than oneWay or manyWay\n if (canEditContentType(contentType, modifiedData)) {\n onCloseModal();\n\n await updateSchema({\n uid: contentType.uid,\n data: {\n displayName: modifiedData.displayName,\n kind: modifiedData.kind,\n draftAndPublish: modifiedData.draftAndPublish,\n pluginOptions: modifiedData.pluginOptions,\n },\n });\n } else {\n toggleNotification({\n type: 'danger',\n message: formatMessage({ id: 'notification.contentType.relations.conflict' }),\n });\n }\n\n return;\n }\n // We are creating a component using the component modal from the left menu\n } else if (modalType === 'component') {\n if (isCreating) {\n // Create the component schema\n const componentUid = createComponentUid(modifiedData.displayName, modifiedData.category);\n const { category, ...rest } = modifiedData;\n\n createComponentSchema({\n data: {\n displayName: rest.displayName,\n icon: rest.icon,\n },\n uid: componentUid,\n componentCategory: category,\n });\n\n // Redirect the user to the created component\n navigate({\n pathname: `/plugins/${pluginId}/component-categories/${category}/${componentUid}`,\n });\n\n onCloseModal();\n\n return;\n } else {\n updateComponentSchema({\n data: {\n icon: modifiedData.icon,\n displayName: modifiedData.displayName,\n },\n componentUID: targetUid,\n });\n\n if (type.status === 'NEW') {\n const componentUid = createComponentUid(\n modifiedData.displayName,\n modifiedData.category\n );\n\n updateComponentUid({\n componentUID: targetUid,\n newComponentUID: componentUid,\n });\n\n navigate({\n pathname: `/plugins/${pluginId}/component-categories/${modifiedData.category}/${componentUid}`,\n });\n }\n\n // Close the modal\n onCloseModal();\n\n return;\n }\n } else if (isCreatingCustomFieldAttribute) {\n const customFieldAttributeUpdate = {\n attributeToSet: { ...modifiedData, customField: customFieldUid },\n forTarget,\n targetUid,\n name: initialData.name,\n };\n\n if (actionType === 'edit') {\n editCustomFieldAttribute(customFieldAttributeUpdate);\n } else {\n addCustomFieldAttribute(customFieldAttributeUpdate);\n }\n\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({\n forTarget,\n targetUid: ctTargetUid,\n });\n } else {\n onCloseModal();\n }\n\n return;\n } else if (isCreatingAttribute && !isCreatingComponentFromAView) {\n const isDynamicZoneAttribute = attributeType === 'dynamiczone';\n\n // The user is creating a DZ (he had entered the name of the dz)\n if (isDynamicZoneAttribute) {\n if (actionType === 'create') {\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n } else {\n editAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n name: initialData.name,\n });\n }\n\n // Adding a component to a dynamiczone is not the same logic as creating a simple field\n // so the search is different\n if (isCreating) {\n // Step 1 of adding a component to a DZ, the user has the option to create a component\n dispatch(actions.resetPropsAndSetTheFormForAddingACompoToADz());\n\n setActiveTab('basic');\n onNavigateToAddCompoToDZModal({ dynamicZoneTarget: modifiedData.name });\n } else {\n onCloseModal();\n }\n\n return;\n }\n\n // Normal fields like boolean relations or dynamic zone\n if (!isComponentAttribute) {\n if (actionType === 'create') {\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n } else {\n editAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n name: initialData.name,\n });\n }\n\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({\n forTarget,\n targetUid: ctTargetUid,\n });\n } else {\n onCloseModal();\n }\n\n return;\n\n // Adding an existing component\n }\n // eslint-disable-next-line no-lonely-if\n if (isInFirstComponentStep) {\n // Navigate the user to step 2\n onNavigateToCreateComponentStep2();\n\n // Clear the reducer and prepare the modified data\n // This way we don't have to add some logic to re-run the useEffect\n // The first step is either needed to create a component or just to navigate\n // To the modal for adding a \"common field\"\n dispatch(\n actions.resetPropsAndSetFormForAddingAnExistingCompo({\n uid: type.uid,\n })\n );\n\n // We don't want all the props to be reset\n return;\n\n // Here we are in step 2\n // The step 2 is also use to edit an attribute that is a component\n }\n\n if (actionType === 'create') {\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n } else {\n editAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n name: initialData.name,\n });\n }\n\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({\n forTarget,\n targetUid,\n });\n } else {\n onCloseModal();\n }\n\n // We don't need to end the loop here we want the reducer to be reinitialized\n\n // Logic for creating a component without clicking on the link in\n // the left menu\n // We need to separate the logic otherwise the component would be created\n // even though the user didn't set any field\n // We need to prevent the component from being created if the user closes the modal at step 2 without any submission\n } else if (isCreatingAttribute && isCreatingComponentFromAView) {\n // Step 1\n if (isInFirstComponentStep) {\n // Here the search could be refactored since it is the same as the case from above\n // Navigate the user to step 2\n\n trackUsage('willCreateComponentFromAttributesModal');\n\n // Here we clear the reducer state but we also keep the created component\n // If we were to create the component before\n dispatch(\n actions.resetPropsAndSaveCurrentData({\n uid: type.uid,\n })\n );\n\n onNavigateToCreateComponentStep2();\n\n // Terminate because we don't want the reducer to be entirely reset\n return;\n\n // Step 2 of creating a component (which is setting the attribute name in the parent's schema)\n }\n // We are destructuring because the modifiedData object doesn't have the appropriate format to create a field\n const { category, ...rest } = componentToCreate;\n // Create a the component temp UID\n // This could be refactored but I think it's more understandable to separate the logic\n const componentUid = createComponentUid(componentToCreate.displayName, category);\n // Create the component first and add it to the components data\n createComponentSchema({\n // Component data\n data: {\n icon: rest.icon,\n displayName: rest.displayName,\n },\n uid: componentUid,\n componentCategory: category,\n });\n\n // Add the field to the schema\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n\n dispatch(actions.resetProps());\n\n // Open modal attribute for adding attr to component\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({ forTarget: 'component', targetUid: componentUid });\n } else {\n onCloseModal();\n }\n\n return;\n } else {\n // The modal is addComponentToDynamicZone\n if (isInFirstComponentStep) {\n if (isCreatingComponentFromAView) {\n const { category, type, ...rest } = modifiedData.componentToCreate;\n const componentUid = createComponentUid(\n modifiedData.componentToCreate.displayName,\n category\n );\n // Create the component first and add it to the components data\n createComponentSchema({\n data: rest,\n uid: componentUid,\n componentCategory: category,\n });\n // Add the created component to the DZ\n // We don't want to remove the old ones\n addCreatedComponentToDynamicZone({\n forTarget,\n targetUid,\n dynamicZoneTarget,\n componentsToAdd: [componentUid],\n });\n\n // The Dynamic Zone and the component is created\n // Open the modal to add fields to the created component\n onNavigateToChooseAttributeModal({ forTarget: 'component', targetUid: componentUid });\n } else {\n // Add the components to the DZ\n changeDynamicZoneComponents({\n forTarget,\n targetUid,\n dynamicZoneTarget,\n newComponents: modifiedData.components,\n });\n\n onCloseModal();\n }\n } else {\n console.error('This case is not handled');\n }\n\n return;\n }\n\n dispatch(actions.resetProps());\n } catch (err: unknown) {\n if (yup.ValidationError.isError(err)) {\n const errors = getYupInnerErrors(err);\n\n dispatch(\n actions.setErrors({\n errors,\n })\n );\n }\n }\n };\n\n const handleConfirmClose = () => {\n // eslint-disable-next-line no-alert\n const confirm = window.confirm(\n formatMessage({\n id: 'window.confirm.close-modal.file',\n defaultMessage: 'Are you sure? Your changes will be lost.',\n })\n );\n\n if (confirm) {\n onCloseModal();\n dispatch(actions.resetProps());\n }\n };\n\n const handleClosed = () => {\n // Close the modal\n if (!isEqual(modifiedData, initialData)) {\n handleConfirmClose();\n } else {\n onCloseModal();\n // Reset the reducer\n dispatch(actions.resetProps());\n }\n };\n\n const sendAdvancedTabEvent = (tab: string) => {\n if (tab !== 'advanced') {\n return;\n }\n\n if (isCreatingContentType) {\n trackUsage('didSelectContentTypeSettings');\n\n return;\n }\n\n if (forTarget === 'contentType') {\n trackUsage('didSelectContentTypeFieldSettings');\n }\n };\n\n const sendButtonAddMoreFieldEvent = (shouldContinue: boolean) => {\n if (\n modalType === 'attribute' &&\n forTarget === 'contentType' &&\n attributeType !== 'dynamiczone' &&\n shouldContinue\n ) {\n trackUsage('willAddMoreFieldToContentType');\n }\n };\n\n const shouldDisableAdvancedTab = () => {\n if (modalType === 'component') {\n return true;\n }\n\n if (has(modifiedData, 'createComponent')) {\n return true;\n }\n\n return false;\n };\n\n // Display data for the attributes picker modal\n const displayedAttributes = getAttributesToDisplay(\n forTarget,\n targetUid,\n // We need the nested components so we know when to remove the component option\n nestedComponents\n );\n\n if (!modalType) {\n return null;\n }\n\n const formToDisplay = get(forms, [modalType, 'form'], {\n advanced: () => ({\n sections: [],\n }),\n base: () => ({\n sections: [],\n }),\n });\n\n const isAddingAComponentToAnotherComponent = forTarget === 'component';\n\n const genericInputProps = {\n customInputs: {\n 'allowed-types-select': AllowedTypesSelect,\n 'boolean-radio-group': BooleanRadioGroup,\n 'checkbox-with-number-field': CheckboxWithNumberField,\n 'icon-picker': IconPicker,\n 'content-type-radio-group': ContentTypeRadioGroup,\n 'radio-group': CustomRadioGroup,\n relation: Relation,\n 'select-category': SelectCategory,\n 'select-component': SelectComponent,\n 'select-components': SelectComponents,\n 'select-default-boolean': BooleanDefaultValueSelect,\n 'select-number': SelectNumber,\n 'select-date': SelectDateType,\n 'toggle-draft-publish': DraftAndPublishToggle,\n 'text-plural': PluralName,\n 'text-singular': SingularName,\n 'textarea-enum': TextareaEnum,\n ...inputsFromPlugins,\n },\n componentToCreate,\n dynamicZoneTarget,\n formErrors,\n isAddingAComponentToAnotherComponent,\n isCreatingComponentWhileAddingAField,\n mainBoxHeader: get(type, ['info', 'displayName'], ''),\n modifiedData,\n naturePickerType: forTarget,\n isCreating,\n targetUid,\n forTarget,\n };\n\n const advancedForm = formToDisplay.advanced({\n data: modifiedData,\n type: attributeType,\n step,\n actionType,\n attributes,\n extensions: ctbFormsAPI,\n forTarget,\n contentTypeSchema: type || {},\n customField,\n }).sections;\n const baseForm = formToDisplay.base({\n data: modifiedData,\n type: attributeType,\n step,\n actionType,\n attributes,\n extensions: ctbFormsAPI,\n forTarget,\n contentTypeSchema: type || {},\n customField,\n }).sections;\n\n const baseFormInputNames = getFormInputNames(baseForm);\n\n const advancedFormInputNames = getFormInputNames(advancedForm);\n const doesBaseFormHasError = Object.keys(formErrors).some((key) =>\n baseFormInputNames.includes(key)\n );\n\n const doesAdvancedFormHasError = Object.keys(formErrors).some((key) =>\n advancedFormInputNames.includes(key)\n );\n\n const schemaKind = get(contentTypes, [targetUid, 'kind']);\n\n const checkIsEditingFieldName = () =>\n actionType === 'edit' && attributes.every(({ name }) => name !== modifiedData?.name);\n\n const handleClickFinish = () => {\n if (checkIsEditingFieldName()) {\n trackUsage('didEditFieldNameOnContentType');\n }\n };\n\n return (\n <Modal.Root open={isOpen} onOpenChange={handleClosed}>\n <Modal.Content>\n <FormModalHeader\n actionType={actionType}\n attributeName={attributeName}\n contentTypeKind={kind as IconByType}\n dynamicZoneTarget={dynamicZoneTarget}\n modalType={modalType}\n forTarget={forTarget}\n targetUid={targetUid}\n attributeType={attributeType as IconByType}\n customFieldUid={customFieldUid}\n showBackLink={showBackLink}\n />\n {isPickingAttribute && (\n <AttributeOptions\n attributes={displayedAttributes}\n forTarget={forTarget}\n kind={schemaKind || 'collectionType'}\n />\n )}\n {!isPickingAttribute && (\n <FormComponent onSubmit={handleSubmit}>\n <Modal.Body>\n <Tabs.Root\n variant=\"simple\"\n value={activeTab}\n onValueChange={(value) => {\n setActiveTab(value);\n sendAdvancedTabEvent(value);\n }}\n hasError={\n doesBaseFormHasError ? 'basic' : doesAdvancedFormHasError ? 'advanced' : undefined\n }\n >\n <Flex justifyContent=\"space-between\">\n <FormModalSubHeader\n actionType={actionType}\n forTarget={forTarget}\n kind={kind}\n step={step}\n modalType={modalType}\n attributeType={attributeType}\n attributeName={attributeName}\n customField={customField}\n />\n <Tabs.List>\n <Tabs.Trigger value=\"basic\">\n {formatMessage({\n id: getTrad('popUpForm.navContainer.base'),\n defaultMessage: 'Basic settings',\n })}\n </Tabs.Trigger>\n <Tabs.Trigger value=\"advanced\" disabled={shouldDisableAdvancedTab()}>\n {formatMessage({\n id: getTrad('popUpForm.navContainer.advanced'),\n defaultMessage: 'Advanced settings',\n })}\n </Tabs.Trigger>\n </Tabs.List>\n </Flex>\n <Divider marginBottom={6} />\n <Tabs.Content value=\"basic\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n <TabForm\n form={baseForm}\n formErrors={formErrors}\n genericInputProps={genericInputProps}\n modifiedData={modifiedData}\n onChange={handleChange}\n />\n </Flex>\n </Tabs.Content>\n <Tabs.Content value=\"advanced\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n <TabForm\n form={advancedForm}\n formErrors={formErrors}\n genericInputProps={genericInputProps}\n modifiedData={modifiedData}\n onChange={handleChange}\n />\n </Flex>\n </Tabs.Content>\n </Tabs.Root>\n </Modal.Body>\n <Modal.Footer>\n <Button\n type=\"button\"\n variant=\"tertiary\"\n onClick={(e) => {\n e.preventDefault();\n handleClosed();\n }}\n >\n {formatMessage({ id: 'app.components.Button.cancel', defaultMessage: 'Cancel' })}\n </Button>\n {/* TODO: refactor this component. Nuf said. */}\n <FormModalEndActions\n deleteContentType={() => deleteContentType(targetUid as Internal.UID.ContentType)}\n deleteComponent={() => deleteComponent(targetUid as Internal.UID.Component)}\n isAttributeModal={modalType === 'attribute'}\n isCustomFieldModal={modalType === 'customField'}\n isComponentToDzModal={modalType === 'addComponentToDynamicZone'}\n isComponentAttribute={attributeType === 'component'}\n isComponentModal={modalType === 'component'}\n isContentTypeModal={modalType === 'contentType'}\n isCreatingComponent={actionType === 'create'}\n isCreatingDz={actionType === 'create'}\n isCreatingComponentAttribute={modifiedData.createComponent || false}\n isCreatingComponentInDz={modifiedData.createComponent || false}\n isCreatingComponentWhileAddingAField={isCreatingComponentWhileAddingAField}\n isCreatingContentType={actionType === 'create'}\n isEditingAttribute={actionType === 'edit'}\n isDzAttribute={attributeType === 'dynamiczone'}\n isInFirstComponentStep={step === '1'}\n onSubmitAddComponentAttribute={handleSubmit}\n onSubmitAddComponentToDz={handleSubmit}\n onSubmitCreateComponent={handleSubmit}\n onSubmitCreateContentType={handleSubmit}\n onSubmitCreateDz={handleSubmit}\n onSubmitEditAttribute={handleSubmit}\n onSubmitEditComponent={handleSubmit}\n onSubmitEditContentType={handleSubmit}\n onSubmitEditCustomFieldAttribute={handleSubmit}\n onSubmitEditDz={handleSubmit}\n onClickFinish={handleClickFinish}\n />\n </Modal.Footer>\n </FormComponent>\n )}\n </Modal.Content>\n </Modal.Root>\n );\n};\n"],"names":["FormComponent","styled","form","selectState","state","initialState","FormModal","onCloseModal","onNavigateToChooseAttributeModal","onNavigateToAddCompoToDZModal","onNavigateToCreateComponentStep2","actionType","attributeName","attributeType","customFieldUid","dynamicZoneTarget","forTarget","modalType","isOpen","kind","step","targetUid","showBackLink","activeTab","setActiveTab","useFormModalNavigation","getPlugin","useStrapiApp","getCustomField","customFields","get","customField","dispatch","useDispatch","toggleNotification","useNotification","reducerState","useSelector","shallowEqual","navigate","useNavigate","trackUsage","useTracking","formatMessage","useIntl","ctbPlugin","pluginId","ctbFormsAPI","apis","forms","inputsFromPlugins","components","inputs","addAttribute","editAttribute","addCustomFieldAttribute","addCreatedComponentToDynamicZone","changeDynamicZoneComponents","contentTypes","createSchema","createComponentSchema","deleteComponent","deleteContentType","editCustomFieldAttribute","updateSchema","nestedComponents","sortedContentTypesList","updateComponentSchema","updateComponentUid","reservedNames","useDataManager","componentToCreate","formErrors","initialData","isCreatingComponentWhileAddingAField","modifiedData","type","React","useEffect","collectionTypesForRelation","filter","isAllowedContentTypesForRelations","foundDynamicZoneTarget","findAttribute","actions","setDataToEdit","data","draftAndPublish","displayName","info","options","pluginOptions","pluralName","singularName","category","icon","attributeToEdit","name","createComponent","setDynamicZoneDataSchema","attributeToEditNotFormatted","repeatable","set","setCustomFieldDataSchema","isEditing","modifiedDataToSetForEditing","uid","pick","setAttributeDataSchema","nameToSetForRelation","resetProps","isCreatingContentType","isCreatingComponent","isCreatingAttribute","isCreatingCustomFieldAttribute","isComponentAttribute","isCreating","isCreatingComponentFromAView","isInFirstComponentStep","isPickingAttribute","createUid","attributes","checkFormValidity","schema","dataToValidate","contentType","Object","keys","component","schemaAttributes","schemaData","customFieldValidator","validator","computedAttrbiuteType","alreadyTakenTargetContentTypeAttributes","targetContentTypeUID","targetContentTypeAttributes","attrName","targetAttribute","attribute","validate","abortEarly","handleChange","useCallback","target","value","rest","namesThatCanResetToNullValue","val","includes","clonedErrors","assign","min","minLength","setErrors","errors","onChange","split","handleSubmit","e","shouldContinue","preventDefault","sendButtonAddMoreFieldEvent","ctTargetUid","pathname","canEditContentType","message","id","componentUid","createComponentUid","componentCategory","componentUID","status","newComponentUID","customFieldAttributeUpdate","attributeToSet","isDynamicZoneAttribute","resetPropsAndSetTheFormForAddingACompoToADz","resetPropsAndSetFormForAddingAnExistingCompo","resetPropsAndSaveCurrentData","componentsToAdd","newComponents","console","error","err","yup","ValidationError","isError","getYupInnerErrors","handleConfirmClose","confirm","window","defaultMessage","handleClosed","isEqual","sendAdvancedTabEvent","tab","shouldDisableAdvancedTab","has","displayedAttributes","getAttributesToDisplay","formToDisplay","advanced","sections","base","isAddingAComponentToAnotherComponent","genericInputProps","customInputs","AllowedTypesSelect","BooleanRadioGroup","CheckboxWithNumberField","IconPicker","ContentTypeRadioGroup","CustomRadioGroup","relation","Relation","SelectCategory","SelectComponent","SelectComponents","BooleanDefaultValueSelect","SelectNumber","SelectDateType","DraftAndPublishToggle","PluralName","SingularName","TextareaEnum","mainBoxHeader","naturePickerType","advancedForm","extensions","contentTypeSchema","baseForm","baseFormInputNames","getFormInputNames","advancedFormInputNames","doesBaseFormHasError","some","key","doesAdvancedFormHasError","schemaKind","checkIsEditingFieldName","every","handleClickFinish","_jsx","Modal","Root","open","onOpenChange","_jsxs","Content","FormModalHeader","contentTypeKind","AttributeOptions","onSubmit","Body","Tabs","variant","onValueChange","hasError","undefined","Flex","justifyContent","FormModalSubHeader","List","Trigger","getTrad","disabled","Divider","marginBottom","direction","alignItems","gap","TabForm","Footer","Button","onClick","FormModalEndActions","isAttributeModal","isCustomFieldModal","isComponentToDzModal","isComponentModal","isContentTypeModal","isCreatingDz","isCreatingComponentAttribute","isCreatingComponentInDz","isEditingAttribute","isDzAttribute","onSubmitAddComponentAttribute","onSubmitAddComponentToDz","onSubmitCreateComponent","onSubmitCreateContentType","onSubmitCreateDz","onSubmitEditAttribute","onSubmitEditComponent","onSubmitEditContentType","onSubmitEditCustomFieldAttribute","onSubmitEditDz","on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A,kBAAAA,EAAoBrQ,SAAc,KAAA,aAAA;AAClCsQ,oCAAAA,oBAAAA,EAAsBtQ,SAAc,KAAA,2BAAA;AACpCkG,oCAAAA,oBAAAA,EAAsBtG,aAAkB,KAAA,WAAA;AACxC2Q,oCAAAA,gBAAAA,EAAkBvQ,SAAc,KAAA,WAAA;AAChCwQ,oCAAAA,kBAAAA,EAAoBxQ,SAAc,KAAA,aAAA;AAClC+F,oCAAAA,mBAAAA,EAAqBrG,UAAe,KAAA,QAAA;AACpC+Q,oCAAAA,YAAAA,EAAc/Q,UAAe,KAAA,QAAA;oCAC7BgR,4BAA8BhN,EAAAA,YAAAA,CAAauB,eAAe,IAAI,KAAA;oCAC9D0L,uBAAyBjN,EAAAA,YAAAA,CAAauB,eAAe,IAAI,KAAA;oCACzDxB,oCAAsCA,EAAAA,oCAAAA;AACtCqC,oCAAAA,qBAAAA,EAAuBpG,UAAe,KAAA,QAAA;AACtCkR,oCAAAA,kBAAAA,EAAoBlR,UAAe,KAAA,MAAA;AACnCmR,oCAAAA,aAAAA,EAAejR,aAAkB,KAAA,aAAA;AACjCyG,oCAAAA,sBAAAA,EAAwBlG,IAAS,KAAA,GAAA;oCACjC2Q,6BAA+BjI,EAAAA,YAAAA;oCAC/BkI,wBAA0BlI,EAAAA,YAAAA;oCAC1BmI,uBAAyBnI,EAAAA,YAAAA;oCACzBoI,yBAA2BpI,EAAAA,YAAAA;oCAC3BqI,gBAAkBrI,EAAAA,YAAAA;oCAClBsI,qBAAuBtI,EAAAA,YAAAA;oCACvBuI,qBAAuBvI,EAAAA,YAAAA;oCACvBwI,uBAAyBxI,EAAAA,YAAAA;oCACzByI,gCAAkCzI,EAAAA,YAAAA;oCAClC0I,cAAgB1I,EAAAA,YAAAA;oCAChB2I,aAAevD,EAAAA;;;;;;;;;AAQ/B;;;;"}
1
+ {"version":3,"file":"FormModal.mjs","sources":["../../../../admin/src/components/FormModal/FormModal.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useState } from 'react';\n\nimport {\n useStrapiApp,\n useTracking,\n useNotification,\n ConfirmDialog,\n} from '@strapi/admin/strapi-admin';\nimport { Button, Divider, Flex, Modal, Tabs, Box, Typography, Dialog } from '@strapi/design-system';\nimport get from 'lodash/get';\nimport has from 'lodash/has';\nimport isEqual from 'lodash/isEqual';\nimport pick from 'lodash/pick';\nimport set from 'lodash/set';\nimport { useIntl } from 'react-intl';\nimport { shallowEqual, useDispatch, useSelector } from 'react-redux';\nimport { useNavigate } from 'react-router-dom';\nimport { styled } from 'styled-components';\nimport * as yup from 'yup';\n\nimport { pluginId } from '../../pluginId';\nimport { getTrad, isAllowedContentTypesForRelations } from '../../utils';\nimport { findAttribute } from '../../utils/findAttribute';\nimport { getYupInnerErrors } from '../../utils/getYupInnerErrors';\n// New compos\nimport { AllowedTypesSelect } from '../AllowedTypesSelect';\nimport { IconByType } from '../AttributeIcon';\nimport { AttributeOptions } from '../AttributeOptions/AttributeOptions';\nimport { BooleanDefaultValueSelect } from '../BooleanDefaultValueSelect';\nimport { BooleanRadioGroup } from '../BooleanRadioGroup';\nimport { CheckboxWithNumberField } from '../CheckboxWithNumberField';\nimport { ContentTypeRadioGroup } from '../ContentTypeRadioGroup';\nimport { CustomRadioGroup } from '../CustomRadioGroup';\nimport { useDataManager } from '../DataManager/useDataManager';\nimport { DraftAndPublishToggle } from '../DraftAndPublishToggle';\nimport { FormModalEndActions } from '../FormModalEndActions';\nimport { FormModalHeader } from '../FormModalHeader';\nimport { useFormModalNavigation } from '../FormModalNavigation/useFormModalNavigation';\nimport { FormModalSubHeader } from '../FormModalSubHeader';\nimport { IconPicker } from '../IconPicker/IconPicker';\nimport { PluralName } from '../PluralName';\nimport { Relation } from '../Relation/Relation';\nimport { SelectCategory } from '../SelectCategory';\nimport { SelectComponent } from '../SelectComponent';\nimport { SelectComponents } from '../SelectComponents';\nimport { SelectDateType } from '../SelectDateType';\nimport { SelectNumber } from '../SelectNumber';\nimport { SingularName } from '../SingularName';\nimport { TabForm } from '../TabForm';\nimport { TextareaEnum } from '../TextareaEnum';\n\nimport { ConditionForm } from './attributes/ConditionForm';\nimport { forms } from './forms/forms';\nimport { actions, initialState, type State as FormModalState } from './reducer';\nimport { canEditContentType } from './utils/canEditContentType';\nimport { createComponentUid, createUid } from './utils/createUid';\nimport { getAttributesToDisplay } from './utils/getAttributesToDisplay';\nimport { getFormInputNames } from './utils/getFormInputNames';\n\nimport type { ContentType } from '../../types';\nimport type { Internal } from '@strapi/types';\n\nconst FormComponent = styled.form`\n overflow: auto;\n`;\n\nconst selectState = (state: Record<string, unknown>) =>\n (state['content-type-builder_formModal'] || initialState) as FormModalState;\n\nexport const FormModal = () => {\n const {\n onCloseModal,\n onNavigateToChooseAttributeModal,\n onNavigateToAddCompoToDZModal,\n onNavigateToCreateComponentStep2,\n actionType,\n attributeName,\n attributeType,\n customFieldUid,\n dynamicZoneTarget,\n forTarget,\n modalType,\n isOpen,\n kind,\n step,\n targetUid,\n showBackLink,\n activeTab,\n setActiveTab,\n } = useFormModalNavigation();\n\n const getPlugin = useStrapiApp('FormModal', (state) => state.getPlugin);\n const getCustomField = useStrapiApp('FormModal', (state) => state.customFields.get);\n const customField = getCustomField(customFieldUid);\n\n const dispatch = useDispatch();\n const { toggleNotification } = useNotification();\n const reducerState = useSelector(selectState, shallowEqual);\n\n const navigate = useNavigate();\n const { trackUsage } = useTracking();\n const { formatMessage } = useIntl();\n const ctbPlugin = getPlugin(pluginId);\n const ctbFormsAPI: any = ctbPlugin?.apis.forms;\n const inputsFromPlugins = ctbFormsAPI.components.inputs;\n\n const {\n addAttribute,\n editAttribute,\n addCustomFieldAttribute,\n addCreatedComponentToDynamicZone,\n changeDynamicZoneComponents,\n contentTypes,\n components,\n createSchema,\n createComponentSchema,\n deleteComponent,\n deleteContentType,\n editCustomFieldAttribute,\n updateSchema,\n nestedComponents,\n sortedContentTypesList,\n updateComponentSchema,\n updateComponentUid,\n reservedNames,\n } = useDataManager();\n\n const {\n componentToCreate,\n formErrors,\n initialData,\n isCreatingComponentWhileAddingAField,\n modifiedData,\n } = reducerState;\n\n const type = forTarget === 'component' ? components[targetUid] : contentTypes[targetUid];\n\n const [showWarningDialog, setShowWarningDialog] = useState(false);\n const [pendingSubmit, setPendingSubmit] = useState<any>(null);\n\n const checkFieldNameChanges = () => {\n // Only check when editing an attribute\n if (actionType !== 'edit' || modalType !== 'attribute') {\n return false;\n }\n\n const oldName = initialData.name;\n const oldEnum = initialData.enum;\n const newEnum = modifiedData.enum;\n\n // Get all attributes from the content type schema\n const contentTypeAttributes = type?.attributes || [];\n\n // Find all fields that reference this field in their conditions\n const referencedFields = contentTypeAttributes.filter((attr: any) => {\n if (!attr.conditions) return false;\n\n const condition = attr.conditions.visible;\n if (!condition) return false;\n\n const [[, conditions]] = Object.entries(condition);\n const [fieldVar, value] = conditions as [{ var: string }, any];\n\n // Check if this condition references our field\n if (fieldVar.var !== oldName) return false;\n\n // If it's an enum field, also check if the value is being deleted/changed\n if (oldEnum && newEnum) {\n const deletedOrChangedValues = oldEnum.filter(\n (oldValue: string) => !newEnum.includes(oldValue)\n );\n return deletedOrChangedValues.includes(value);\n }\n\n return true;\n });\n\n // If any fields reference this field, return them\n if (referencedFields.length > 0) {\n return referencedFields;\n }\n\n return false;\n };\n\n React.useEffect(() => {\n if (isOpen) {\n const collectionTypesForRelation = sortedContentTypesList.filter(\n isAllowedContentTypesForRelations\n );\n\n if (actionType === 'edit' && modalType === 'attribute' && forTarget === 'contentType') {\n trackUsage('willEditFieldOfContentType');\n }\n\n // Case:\n // the user opens the modal chooseAttributes\n // selects dynamic zone => set the field name\n // then goes to step 1 (the modal is addComponentToDynamicZone) and finally reloads the app.\n // In this particular if the user tries to add components to the zone it will pop an error since the dz is unknown\n const foundDynamicZoneTarget =\n findAttribute(get(type, 'schema.attributes', []), dynamicZoneTarget) || null;\n\n // Create content type we need to add the default option draftAndPublish\n if (modalType === 'contentType' && actionType === 'create') {\n dispatch(\n actions.setDataToEdit({\n data: {\n draftAndPublish: true,\n },\n })\n );\n }\n\n // Edit content type\n if (modalType === 'contentType' && actionType === 'edit') {\n dispatch(\n actions.setDataToEdit({\n data: {\n displayName: type.info.displayName,\n draftAndPublish: type.options?.draftAndPublish,\n kind: 'kind' in type && type.kind,\n pluginOptions: type.pluginOptions,\n pluralName: 'pluralName' in type.info && type.info.pluralName,\n singularName: 'singularName' in type.info && type.info.singularName,\n },\n })\n );\n }\n\n // Edit component\n if (modalType === 'component' && actionType === 'edit') {\n dispatch(\n actions.setDataToEdit({\n data: {\n displayName: type.info.displayName,\n category: 'category' in type && type.category,\n icon: type.info.icon,\n },\n })\n );\n }\n\n // Special case for the dynamic zone\n if (modalType === 'addComponentToDynamicZone' && actionType === 'edit') {\n const attributeToEdit = {\n ...foundDynamicZoneTarget,\n // We filter the available components\n // Because this modal is only used for adding components\n components: [],\n name: dynamicZoneTarget,\n createComponent: false,\n componentToCreate: { type: 'component' },\n };\n\n dispatch(\n actions.setDynamicZoneDataSchema({\n attributeToEdit,\n })\n );\n }\n\n // Set the predefined data structure to create an attribute\n if (attributeType) {\n const attributeToEditNotFormatted = findAttribute(\n get(type, ['attributes'], []),\n attributeName\n );\n const attributeToEdit = {\n ...attributeToEditNotFormatted,\n name: attributeName,\n };\n\n // We need to set the repeatable key to false when editing a component\n // The API doesn't send this info\n if (attributeType === 'component' && actionType === 'edit') {\n if (!('repeatable' in attributeToEdit) || !attributeToEdit.repeatable) {\n set(attributeToEdit, 'repeatable', false);\n }\n }\n\n if (modalType === 'customField') {\n if (actionType === 'edit') {\n dispatch(\n actions.setCustomFieldDataSchema({\n isEditing: true,\n modifiedDataToSetForEditing: attributeToEdit,\n uid: type.uid,\n })\n );\n } else {\n dispatch(\n actions.setCustomFieldDataSchema({\n customField: pick(customField, ['type', 'options']),\n isEditing: false,\n modifiedDataToSetForEditing: attributeToEdit,\n uid: type.uid,\n })\n );\n }\n } else {\n dispatch(\n actions.setAttributeDataSchema({\n attributeType,\n nameToSetForRelation: get(collectionTypesForRelation, ['0', 'title'], 'error'),\n targetUid: get(collectionTypesForRelation, ['0', 'uid'], 'error'),\n isEditing: actionType === 'edit',\n modifiedDataToSetForEditing: attributeToEdit,\n step,\n uid: type.uid,\n })\n );\n }\n }\n } else {\n dispatch(actions.resetProps());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [actionType, attributeName, attributeType, dynamicZoneTarget, forTarget, isOpen, modalType]);\n\n const isCreatingContentType = modalType === 'contentType';\n const isCreatingComponent = modalType === 'component';\n const isCreatingAttribute = modalType === 'attribute';\n const isCreatingCustomFieldAttribute = modalType === 'customField';\n const isComponentAttribute = attributeType === 'component' && isCreatingAttribute;\n const isCreating = actionType === 'create';\n const isCreatingComponentFromAView =\n get(modifiedData, 'createComponent', false) || isCreatingComponentWhileAddingAField;\n const isInFirstComponentStep = step === '1';\n const isPickingAttribute = modalType === 'chooseAttribute';\n const uid = createUid(modifiedData.displayName || '');\n const attributes = get(type, ['attributes'], null) as {\n name: string;\n }[];\n\n const checkFormValidity = async () => {\n let schema;\n const dataToValidate =\n isCreatingComponentFromAView && step === '1'\n ? get(modifiedData, 'componentToCreate', {})\n : modifiedData;\n // Check form validity for content type\n if (isCreatingContentType) {\n schema = forms.contentType.schema(\n Object.keys(contentTypes),\n actionType === 'edit',\n // currentUID\n (type?.uid ?? null) as Internal.UID.ContentType,\n reservedNames,\n ctbFormsAPI,\n contentTypes\n );\n\n // Check form validity for component\n // This is happening when the user click on the link from the left menu\n } else if (isCreatingComponent) {\n schema = forms.component.schema(\n Object.keys(components) as Internal.UID.Component[],\n modifiedData.category || '',\n reservedNames,\n actionType === 'edit',\n components,\n modifiedData.displayName || '',\n (type?.uid ?? null) as Internal.UID.Component\n // ctbFormsAPI\n );\n } else if (isCreatingCustomFieldAttribute) {\n schema = forms.customField.schema({\n schemaAttributes: get(type, ['attributes'], []),\n attributeType: customField!.type,\n reservedNames,\n schemaData: { modifiedData, initialData },\n ctbFormsAPI,\n customFieldValidator: customField!.options?.validator,\n });\n\n // Check for validity for creating a component\n // This is happening when the user creates a component \"on the fly\"\n // Since we temporarily store the component info in another object\n // The data is set in the componentToCreate key\n } else if (isComponentAttribute && isCreatingComponentFromAView && isInFirstComponentStep) {\n schema = forms.component.schema(\n Object.keys(components) as Internal.UID.Component[],\n get(modifiedData, 'componentToCreate.category', ''),\n reservedNames,\n actionType === 'edit',\n components,\n modifiedData.componentToCreate.displayName || ''\n );\n\n // Check form validity for creating a 'common attribute'\n // We need to make sure that it is independent from the step\n } else if (isCreatingAttribute && !isInFirstComponentStep) {\n const computedAttrbiuteType = attributeType === 'relation' ? 'relation' : modifiedData.type;\n\n let alreadyTakenTargetContentTypeAttributes: any[] = [];\n\n if (computedAttrbiuteType === 'relation') {\n const targetContentTypeUID = get(modifiedData, ['target'], null);\n\n const targetContentTypeAttributes = get(\n contentTypes,\n [targetContentTypeUID, 'attributes'],\n []\n );\n\n // Create an array with all the targetContentType attributes name\n // in order to prevent the user from creating a relation with a targetAttribute\n // that may exist in the other content type\n alreadyTakenTargetContentTypeAttributes = targetContentTypeAttributes.filter(\n ({ name: attrName }: { name: string }) => {\n // Keep all the target content type attributes when creating a relation\n if (actionType !== 'edit') {\n return true;\n }\n\n // Remove the already created one when editing\n return attrName !== initialData.targetAttribute;\n }\n );\n }\n schema = forms.attribute.schema(\n type,\n computedAttrbiuteType,\n reservedNames,\n alreadyTakenTargetContentTypeAttributes,\n { modifiedData, initialData },\n ctbFormsAPI\n );\n } else {\n // The user is either in the addComponentToDynamicZone modal or\n // in step 1 of the add component (modalType=attribute&attributeType=component) but not creating a component\n // eslint-disable-next-line no-lonely-if\n if (isInFirstComponentStep && isCreatingComponentFromAView) {\n schema = forms.component.schema(\n Object.keys(components) as Internal.UID.Component[],\n get(modifiedData, 'componentToCreate.category', ''),\n reservedNames,\n actionType === 'edit',\n components,\n modifiedData.componentToCreate.displayName || ''\n );\n } else {\n // The form is valid\n // The case here is being in the addComponentToDynamicZone modal and not creating a component\n return;\n }\n }\n\n await schema.validate(dataToValidate, { abortEarly: false });\n };\n\n const handleChange = React.useCallback(\n ({\n target: { name, value, type, ...rest },\n }: {\n target: { name: string; value: string | string[]; type: string };\n }) => {\n const namesThatCanResetToNullValue = [\n 'enumName',\n 'max',\n 'min',\n 'maxLength',\n 'minLength',\n 'regex',\n 'default',\n ];\n\n let val;\n\n if (namesThatCanResetToNullValue.includes(name) && value === '') {\n val = null;\n } else if (name === 'enum') {\n // For enum values, ensure we're working with an array\n val = Array.isArray(value) ? value : [value];\n } else {\n val = value;\n }\n\n const clonedErrors = Object.assign({}, formErrors);\n\n // Reset min error when modifying the max\n if (name === 'max') {\n delete clonedErrors.min;\n }\n\n // Same here\n if (name === 'maxLength') {\n delete clonedErrors.minLength;\n }\n\n // Since the onBlur is deactivated we remove the errors directly when changing an input\n delete clonedErrors[name];\n\n dispatch(\n actions.setErrors({\n errors: clonedErrors,\n })\n );\n\n dispatch(\n actions.onChange({\n keys: name.split('.'),\n value: val,\n })\n );\n },\n [dispatch, formErrors]\n );\n\n const submitForm = async (e: React.SyntheticEvent, shouldContinue = isCreating) => {\n try {\n await checkFormValidity();\n\n dispatch(\n actions.setErrors({\n errors: {},\n })\n );\n\n sendButtonAddMoreFieldEvent(shouldContinue);\n\n const ctTargetUid = targetUid;\n\n if (isCreatingContentType) {\n // Create the content type schema\n if (isCreating) {\n createSchema({\n data: {\n kind,\n displayName: modifiedData.displayName,\n draftAndPublish: modifiedData.draftAndPublish,\n pluginOptions: modifiedData.pluginOptions,\n singularName: modifiedData.singularName,\n pluralName: modifiedData.pluralName,\n },\n uid,\n });\n\n // Redirect the user to the created content type\n navigate({ pathname: `/plugins/${pluginId}/content-types/${uid}` });\n\n onCloseModal();\n } else {\n // NOTE: we have to assume we have a CT here until we refactor more\n const contentType = type as ContentType;\n // We cannot switch from collection type to single when the modal is making relations other than oneWay or manyWay\n if (canEditContentType(contentType, modifiedData)) {\n onCloseModal();\n\n await updateSchema({\n uid: contentType.uid,\n data: {\n displayName: modifiedData.displayName,\n kind: modifiedData.kind,\n draftAndPublish: modifiedData.draftAndPublish,\n pluginOptions: modifiedData.pluginOptions,\n },\n });\n } else {\n toggleNotification({\n type: 'danger',\n message: formatMessage({ id: 'notification.contentType.relations.conflict' }),\n });\n }\n\n return;\n }\n // We are creating a component using the component modal from the left menu\n } else if (modalType === 'component') {\n if (isCreating) {\n // Create the component schema\n const componentUid = createComponentUid(modifiedData.displayName, modifiedData.category);\n const { category, ...rest } = modifiedData;\n\n createComponentSchema({\n data: {\n displayName: rest.displayName,\n icon: rest.icon,\n },\n uid: componentUid,\n componentCategory: category,\n });\n\n // Redirect the user to the created component\n navigate({\n pathname: `/plugins/${pluginId}/component-categories/${category}/${componentUid}`,\n });\n\n onCloseModal();\n\n return;\n } else {\n updateComponentSchema({\n data: {\n icon: modifiedData.icon,\n displayName: modifiedData.displayName,\n },\n componentUID: targetUid,\n });\n\n if (type.status === 'NEW') {\n const componentUid = createComponentUid(\n modifiedData.displayName,\n modifiedData.category\n );\n\n updateComponentUid({\n componentUID: targetUid,\n newComponentUID: componentUid,\n });\n\n navigate({\n pathname: `/plugins/${pluginId}/component-categories/${modifiedData.category}/${componentUid}`,\n });\n }\n\n // Close the modal\n onCloseModal();\n\n return;\n }\n } else if (isCreatingCustomFieldAttribute) {\n const customFieldAttributeUpdate = {\n attributeToSet: { ...modifiedData, customField: customFieldUid },\n forTarget,\n targetUid,\n name: initialData.name,\n };\n\n if (actionType === 'edit') {\n editCustomFieldAttribute(customFieldAttributeUpdate);\n } else {\n addCustomFieldAttribute(customFieldAttributeUpdate);\n }\n\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({\n forTarget,\n targetUid: ctTargetUid,\n });\n } else {\n onCloseModal();\n }\n\n return;\n } else if (isCreatingAttribute && !isCreatingComponentFromAView) {\n const isDynamicZoneAttribute = attributeType === 'dynamiczone';\n\n // The user is creating a DZ (he had entered the name of the dz)\n if (isDynamicZoneAttribute) {\n if (actionType === 'create') {\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n } else {\n editAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n name: initialData.name,\n });\n }\n\n // Adding a component to a dynamiczone is not the same logic as creating a simple field\n // so the search is different\n if (isCreating) {\n // Step 1 of adding a component to a DZ, the user has the option to create a component\n dispatch(actions.resetPropsAndSetTheFormForAddingACompoToADz());\n\n setActiveTab('basic');\n onNavigateToAddCompoToDZModal({ dynamicZoneTarget: modifiedData.name });\n } else {\n onCloseModal();\n }\n\n return;\n }\n\n // Normal fields like boolean relations or dynamic zone\n if (!isComponentAttribute) {\n if (actionType === 'create') {\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n } else {\n editAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n name: initialData.name,\n });\n }\n\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({\n forTarget,\n targetUid: ctTargetUid,\n });\n } else {\n onCloseModal();\n }\n\n return;\n\n // Adding an existing component\n }\n // eslint-disable-next-line no-lonely-if\n if (isInFirstComponentStep) {\n // Navigate the user to step 2\n onNavigateToCreateComponentStep2();\n\n // Clear the reducer and prepare the modified data\n // This way we don't have to add some logic to re-run the useEffect\n // The first step is either needed to create a component or just to navigate\n // To the modal for adding a \"common field\"\n dispatch(\n actions.resetPropsAndSetFormForAddingAnExistingCompo({\n uid: type.uid,\n })\n );\n\n // We don't want all the props to be reset\n return;\n\n // Here we are in step 2\n // The step 2 is also use to edit an attribute that is a component\n }\n\n if (actionType === 'create') {\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n } else {\n editAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n name: initialData.name,\n });\n }\n\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({\n forTarget,\n targetUid,\n });\n } else {\n onCloseModal();\n }\n\n // We don't need to end the loop here we want the reducer to be reinitialized\n\n // Logic for creating a component without clicking on the link in\n // the left menu\n // We need to separate the logic otherwise the component would be created\n // even though the user didn't set any field\n // We need to prevent the component from being created if the user closes the modal at step 2 without any submission\n } else if (isCreatingAttribute && isCreatingComponentFromAView) {\n // Step 1\n if (isInFirstComponentStep) {\n // Here the search could be refactored since it is the same as the case from above\n // Navigate the user to step 2\n\n trackUsage('willCreateComponentFromAttributesModal');\n\n // Here we clear the reducer state but we also keep the created component\n // If we were to create the component before\n dispatch(\n actions.resetPropsAndSaveCurrentData({\n uid: type.uid,\n })\n );\n\n onNavigateToCreateComponentStep2();\n\n // Terminate because we don't want the reducer to be entirely reset\n return;\n\n // Step 2 of creating a component (which is setting the attribute name in the parent's schema)\n }\n // We are destructuring because the modifiedData object doesn't have the appropriate format to create a field\n const { category, ...rest } = componentToCreate;\n // Create a the component temp UID\n // This could be refactored but I think it's more understandable to separate the logic\n const componentUid = createComponentUid(componentToCreate.displayName, category);\n // Create the component first and add it to the components data\n createComponentSchema({\n // Component data\n data: {\n icon: rest.icon,\n displayName: rest.displayName,\n },\n uid: componentUid,\n componentCategory: category,\n });\n\n // Add the field to the schema\n addAttribute({\n attributeToSet: modifiedData,\n forTarget,\n targetUid,\n });\n\n dispatch(actions.resetProps());\n\n // Open modal attribute for adding attr to component\n if (shouldContinue) {\n onNavigateToChooseAttributeModal({ forTarget: 'component', targetUid: componentUid });\n } else {\n onCloseModal();\n }\n\n return;\n } else {\n // The modal is addComponentToDynamicZone\n if (isInFirstComponentStep) {\n if (isCreatingComponentFromAView) {\n const { category, type, ...rest } = modifiedData.componentToCreate;\n const componentUid = createComponentUid(\n modifiedData.componentToCreate.displayName,\n category\n );\n // Create the component first and add it to the components data\n createComponentSchema({\n data: rest,\n uid: componentUid,\n componentCategory: category,\n });\n // Add the created component to the DZ\n // We don't want to remove the old ones\n addCreatedComponentToDynamicZone({\n forTarget,\n targetUid,\n dynamicZoneTarget,\n componentsToAdd: [componentUid],\n });\n\n // The Dynamic Zone and the component is created\n // Open the modal to add fields to the created component\n onNavigateToChooseAttributeModal({ forTarget: 'component', targetUid: componentUid });\n } else {\n // Add the components to the DZ\n changeDynamicZoneComponents({\n forTarget,\n targetUid,\n dynamicZoneTarget,\n newComponents: modifiedData.components,\n });\n\n onCloseModal();\n }\n } else {\n console.error('This case is not handled');\n }\n\n return;\n }\n\n dispatch(actions.resetProps());\n } catch (err: unknown) {\n if (yup.ValidationError.isError(err)) {\n const errors = getYupInnerErrors(err);\n\n dispatch(\n actions.setErrors({\n errors,\n })\n );\n }\n }\n };\n\n const handleSubmit = async (e: React.SyntheticEvent, shouldContinue = isCreating) => {\n e.preventDefault();\n\n // Check for field name changes when clicking Finish\n const referencedFields = checkFieldNameChanges();\n if (referencedFields) {\n setPendingSubmit({ e, shouldContinue });\n setShowWarningDialog(true);\n return;\n }\n\n await submitForm(e, shouldContinue);\n };\n\n const handleConfirmClose = () => {\n // eslint-disable-next-line no-alert\n const confirm = window.confirm(\n formatMessage({\n id: 'window.confirm.close-modal.file',\n defaultMessage: 'Are you sure? Your changes will be lost.',\n })\n );\n\n if (confirm) {\n onCloseModal();\n dispatch(actions.resetProps());\n }\n };\n\n const handleClosed = () => {\n // Close the modal\n if (!isEqual(modifiedData, initialData)) {\n handleConfirmClose();\n } else {\n onCloseModal();\n // Reset the reducer\n dispatch(actions.resetProps());\n }\n };\n\n const sendAdvancedTabEvent = (tab: string) => {\n if (tab !== 'advanced') {\n return;\n }\n\n if (isCreatingContentType) {\n trackUsage('didSelectContentTypeSettings');\n\n return;\n }\n\n if (forTarget === 'contentType') {\n trackUsage('didSelectContentTypeFieldSettings');\n }\n };\n\n const sendButtonAddMoreFieldEvent = (shouldContinue: boolean) => {\n if (\n modalType === 'attribute' &&\n forTarget === 'contentType' &&\n attributeType !== 'dynamiczone' &&\n shouldContinue\n ) {\n trackUsage('willAddMoreFieldToContentType');\n }\n };\n\n const shouldDisableAdvancedTab = () => {\n if (modalType === 'component') {\n return true;\n }\n\n if (has(modifiedData, 'createComponent')) {\n return true;\n }\n\n return false;\n };\n\n // Display data for the attributes picker modal\n const displayedAttributes = getAttributesToDisplay(\n forTarget,\n targetUid,\n // We need the nested components so we know when to remove the component option\n nestedComponents\n );\n\n if (!modalType) {\n return null;\n }\n\n const formToDisplay = get(forms, [modalType, 'form'], {\n advanced: () => ({\n sections: [],\n }),\n base: () => ({\n sections: [],\n }),\n });\n\n const isAddingAComponentToAnotherComponent = forTarget === 'component';\n\n const genericInputProps = {\n customInputs: {\n 'allowed-types-select': AllowedTypesSelect,\n 'boolean-radio-group': BooleanRadioGroup,\n 'checkbox-with-number-field': CheckboxWithNumberField,\n 'icon-picker': IconPicker,\n 'content-type-radio-group': ContentTypeRadioGroup,\n 'radio-group': CustomRadioGroup,\n relation: Relation,\n 'select-category': SelectCategory,\n 'select-component': SelectComponent,\n 'select-components': SelectComponents,\n 'select-default-boolean': BooleanDefaultValueSelect,\n 'select-number': SelectNumber,\n 'select-date': SelectDateType,\n 'toggle-draft-publish': DraftAndPublishToggle,\n 'text-plural': PluralName,\n 'text-singular': SingularName,\n 'textarea-enum': TextareaEnum,\n 'condition-form': ConditionForm,\n ...inputsFromPlugins,\n },\n componentToCreate,\n dynamicZoneTarget,\n formErrors,\n isAddingAComponentToAnotherComponent,\n isCreatingComponentWhileAddingAField,\n mainBoxHeader: get(type, ['info', 'displayName'], ''),\n modifiedData,\n naturePickerType: forTarget,\n isCreating,\n targetUid,\n forTarget,\n contentTypeSchema: type,\n };\n\n const advancedForm = formToDisplay.advanced({\n data: modifiedData,\n type: attributeType,\n step,\n actionType,\n attributes,\n extensions: ctbFormsAPI,\n forTarget,\n contentTypeSchema: type || {},\n customField,\n }).sections;\n const baseForm = formToDisplay.base({\n data: modifiedData,\n type: attributeType,\n step,\n actionType,\n attributes,\n extensions: ctbFormsAPI,\n forTarget,\n contentTypeSchema: type || {},\n customField,\n }).sections;\n\n const baseFormInputNames = getFormInputNames(baseForm);\n\n const advancedFormInputNames = getFormInputNames(advancedForm);\n const doesBaseFormHasError = Object.keys(formErrors).some((key) =>\n baseFormInputNames.includes(key)\n );\n\n const doesAdvancedFormHasError = Object.keys(formErrors).some((key) =>\n advancedFormInputNames.includes(key)\n );\n\n const schemaKind = get(contentTypes, [targetUid, 'kind']);\n\n const checkIsEditingFieldName = () =>\n actionType === 'edit' && attributes.every(({ name }) => name !== modifiedData?.name);\n\n const handleClickFinish = () => {\n if (checkIsEditingFieldName()) {\n trackUsage('didEditFieldNameOnContentType');\n }\n };\n\n return (\n <Modal.Root open={isOpen} onOpenChange={handleClosed}>\n <Modal.Content>\n <Dialog.Root open={showWarningDialog} onOpenChange={setShowWarningDialog}>\n <Dialog.Trigger />\n <ConfirmDialog\n onConfirm={() => {\n if (pendingSubmit) {\n const { e, shouldContinue } = pendingSubmit;\n setShowWarningDialog(false);\n setPendingSubmit(null);\n submitForm(e, shouldContinue);\n }\n }}\n onCancel={() => {\n setShowWarningDialog(false);\n setPendingSubmit(null);\n }}\n >\n {(() => {\n const referencedFields = checkFieldNameChanges();\n if (!referencedFields) return null;\n\n const fieldNames = referencedFields.map((field: any) => field.name).join(', ');\n const isEnum = initialData.enum && modifiedData.enum;\n\n if (isEnum) {\n const oldEnum = initialData.enum;\n const newEnum = modifiedData.enum;\n const deletedOrChangedValues = oldEnum.filter(\n (value: string) => !newEnum.includes(value)\n );\n\n return (\n <Box>\n <Typography>\n {formatMessage({\n id: 'form.attribute.condition.enum-change-warning',\n defaultMessage:\n 'The following fields have conditions that depend on this field: ',\n })}\n <Typography fontWeight=\"bold\">{fieldNames}</Typography>\n {formatMessage({\n id: 'form.attribute.condition.enum-change-warning-values',\n defaultMessage: '. Changing or removing the enum values ',\n })}\n <Typography fontWeight=\"bold\">{deletedOrChangedValues.join(', ')}</Typography>\n {formatMessage({\n id: 'form.attribute.condition.enum-change-warning-end',\n defaultMessage: ' will break these conditions. Do you want to proceed?',\n })}\n </Typography>\n </Box>\n );\n }\n\n return (\n <Box>\n <Typography>\n {formatMessage({\n id: 'form.attribute.condition.field-change-warning',\n defaultMessage:\n 'The following fields have conditions that depend on this field: ',\n })}\n <Typography fontWeight=\"bold\">{fieldNames}</Typography>\n {formatMessage({\n id: 'form.attribute.condition.field-change-warning-end',\n defaultMessage:\n '. Renaming it will break these conditions. Do you want to proceed?',\n })}\n </Typography>\n </Box>\n );\n })()}\n </ConfirmDialog>\n </Dialog.Root>\n <FormModalHeader\n actionType={actionType}\n attributeName={attributeName}\n contentTypeKind={kind as IconByType}\n dynamicZoneTarget={dynamicZoneTarget}\n modalType={modalType}\n forTarget={forTarget}\n targetUid={targetUid}\n attributeType={attributeType as IconByType}\n customFieldUid={customFieldUid}\n showBackLink={showBackLink}\n />\n {isPickingAttribute && (\n <AttributeOptions\n attributes={displayedAttributes}\n forTarget={forTarget}\n kind={schemaKind || 'collectionType'}\n />\n )}\n {!isPickingAttribute && (\n <FormComponent onSubmit={handleSubmit}>\n <Modal.Body>\n <Tabs.Root\n variant=\"simple\"\n value={activeTab}\n onValueChange={(value) => {\n setActiveTab(value);\n sendAdvancedTabEvent(value);\n }}\n hasError={\n doesBaseFormHasError ? 'basic' : doesAdvancedFormHasError ? 'advanced' : undefined\n }\n >\n <Flex justifyContent=\"space-between\">\n <FormModalSubHeader\n actionType={actionType}\n forTarget={forTarget}\n kind={kind}\n step={step}\n modalType={modalType}\n attributeType={attributeType}\n attributeName={attributeName}\n customField={customField}\n />\n <Tabs.List>\n <Tabs.Trigger value=\"basic\">\n {formatMessage({\n id: getTrad('popUpForm.navContainer.base'),\n defaultMessage: 'Basic settings',\n })}\n </Tabs.Trigger>\n <Tabs.Trigger value=\"advanced\" disabled={shouldDisableAdvancedTab()}>\n {formatMessage({\n id: getTrad('popUpForm.navContainer.advanced'),\n defaultMessage: 'Advanced settings',\n })}\n </Tabs.Trigger>\n </Tabs.List>\n </Flex>\n <Divider marginBottom={6} />\n <Tabs.Content value=\"basic\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n <TabForm\n form={baseForm}\n formErrors={formErrors}\n genericInputProps={genericInputProps}\n modifiedData={modifiedData}\n onChange={handleChange}\n />\n </Flex>\n </Tabs.Content>\n <Tabs.Content value=\"advanced\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n <TabForm\n form={advancedForm}\n formErrors={formErrors}\n genericInputProps={genericInputProps}\n modifiedData={modifiedData}\n onChange={handleChange}\n />\n </Flex>\n </Tabs.Content>\n </Tabs.Root>\n </Modal.Body>\n <Modal.Footer>\n <Button\n type=\"button\"\n variant=\"tertiary\"\n onClick={(e) => {\n e.preventDefault();\n handleClosed();\n }}\n >\n {formatMessage({ id: 'app.components.Button.cancel', defaultMessage: 'Cancel' })}\n </Button>\n {/* TODO: refactor this component. Nuf said. */}\n <FormModalEndActions\n deleteContentType={() => deleteContentType(targetUid as Internal.UID.ContentType)}\n deleteComponent={() => deleteComponent(targetUid as Internal.UID.Component)}\n isAttributeModal={modalType === 'attribute'}\n isCustomFieldModal={modalType === 'customField'}\n isComponentToDzModal={modalType === 'addComponentToDynamicZone'}\n isComponentAttribute={attributeType === 'component'}\n isComponentModal={modalType === 'component'}\n isContentTypeModal={modalType === 'contentType'}\n isCreatingComponent={actionType === 'create'}\n isCreatingDz={actionType === 'create'}\n isCreatingComponentAttribute={modifiedData.createComponent || false}\n isCreatingComponentInDz={modifiedData.createComponent || false}\n isCreatingComponentWhileAddingAField={isCreatingComponentWhileAddingAField}\n isCreatingContentType={actionType === 'create'}\n isEditingAttribute={actionType === 'edit'}\n isDzAttribute={attributeType === 'dynamiczone'}\n isInFirstComponentStep={step === '1'}\n onSubmitAddComponentAttribute={handleSubmit}\n onSubmitAddComponentToDz={handleSubmit}\n onSubmitCreateComponent={handleSubmit}\n onSubmitCreateContentType={handleSubmit}\n onSubmitCreateDz={handleSubmit}\n onSubmitEditAttribute={handleSubmit}\n onSubmitEditComponent={handleSubmit}\n onSubmitEditContentType={handleSubmit}\n onSubmitEditCustomFieldAttribute={handleSubmit}\n onSubmitEditDz={handleSubmit}\n onClickFinish={handleClickFinish}\n />\n </Modal.Footer>\n </FormComponent>\n )}\n </Modal.Content>\n </Modal.Root>\n );\n};\n"],"names":["FormComponent","styled","form","selectState","state","initialState","FormModal","onCloseModal","onNavigateToChooseAttributeModal","onNavigateToAddCompoToDZModal","onNavigateToCreateComponentStep2","actionType","attributeName","attributeType","customFieldUid","dynamicZoneTarget","forTarget","modalType","isOpen","kind","step","targetUid","showBackLink","activeTab","setActiveTab","useFormModalNavigation","getPlugin","useStrapiApp","getCustomField","customFields","get","customField","dispatch","useDispatch","toggleNotification","useNotification","reducerState","useSelector","shallowEqual","navigate","useNavigate","trackUsage","useTracking","formatMessage","useIntl","ctbPlugin","pluginId","ctbFormsAPI","apis","forms","inputsFromPlugins","components","inputs","addAttribute","editAttribute","addCustomFieldAttribute","addCreatedComponentToDynamicZone","changeDynamicZoneComponents","contentTypes","createSchema","createComponentSchema","deleteComponent","deleteContentType","editCustomFieldAttribute","updateSchema","nestedComponents","sortedContentTypesList","updateComponentSchema","updateComponentUid","reservedNames","useDataManager","componentToCreate","formErrors","initialData","isCreatingComponentWhileAddingAField","modifiedData","type","showWarningDialog","setShowWarningDialog","useState","pendingSubmit","setPendingSubmit","checkFieldNameChanges","oldName","name","oldEnum","enum","newEnum","contentTypeAttributes","attributes","referencedFields","filter","attr","conditions","condition","visible","Object","entries","fieldVar","value","var","deletedOrChangedValues","oldValue","includes","length","React","useEffect","collectionTypesForRelation","isAllowedContentTypesForRelations","foundDynamicZoneTarget","findAttribute","actions","setDataToEdit","data","draftAndPublish","displayName","info","options","pluginOptions","pluralName","singularName","category","icon","attributeToEdit","createComponent","setDynamicZoneDataSchema","attributeToEditNotFormatted","repeatable","set","setCustomFieldDataSchema","isEditing","modifiedDataToSetForEditing","uid","pick","setAttributeDataSchema","nameToSetForRelation","resetProps","isCreatingContentType","isCreatingComponent","isCreatingAttribute","isCreatingCustomFieldAttribute","isComponentAttribute","isCreating","isCreatingComponentFromAView","isInFirstComponentStep","isPickingAttribute","createUid","checkFormValidity","schema","dataToValidate","contentType","keys","component","schemaAttributes","schemaData","customFieldValidator","validator","computedAttrbiuteType","alreadyTakenTargetContentTypeAttributes","targetContentTypeUID","targetContentTypeAttributes","attrName","targetAttribute","attribute","validate","abortEarly","handleChange","useCallback","target","rest","namesThatCanResetToNullValue","val","Array","isArray","clonedErrors","assign","min","minLength","setErrors","errors","onChange","split","submitForm","e","shouldContinue","sendButtonAddMoreFieldEvent","ctTargetUid","pathname","canEditContentType","message","id","componentUid","createComponentUid","componentCategory","componentUID","status","newComponentUID","customFieldAttributeUpdate","attributeToSet","isDynamicZoneAttribute","resetPropsAndSetTheFormForAddingACompoToADz","resetPropsAndSetFormForAddingAnExistingCompo","resetPropsAndSaveCurrentData","componentsToAdd","newComponents","console","error","err","yup","ValidationError","isError","getYupInnerErrors","handleSubmit","preventDefault","handleConfirmClose","confirm","window","defaultMessage","handleClosed","isEqual","sendAdvancedTabEvent","tab","shouldDisableAdvancedTab","has","displayedAttributes","getAttributesToDisplay","formToDisplay","advanced","sections","base","isAddingAComponentToAnotherComponent","genericInputProps","customInputs","AllowedTypesSelect","BooleanRadioGroup","CheckboxWithNumberField","IconPicker","ContentTypeRadioGroup","CustomRadioGroup","relation","Relation","SelectCategory","SelectComponent","SelectComponents","BooleanDefaultValueSelect","SelectNumber","SelectDateType","DraftAndPublishToggle","PluralName","SingularName","TextareaEnum","ConditionForm","mainBoxHeader","naturePickerType","contentTypeSchema","advancedForm","extensions","baseForm","baseFormInputNames","getFormInputNames","advancedFormInputNames","doesBaseFormHasError","some","key","doesAdvancedFormHasError","schemaKind","checkIsEditingFieldName","every","handleClickFinish","_jsx","Modal","Root","open","onOpenChange","_jsxs","Content","Dialog","Trigger","ConfirmDialog","onConfirm","onCancel","fieldNames","map","field","join","isEnum","Box","Typography","fontWeight","FormModalHeader","contentTypeKind","AttributeOptions","onSubmit","Body","Tabs","variant","onValueChange","hasError","undefined","Flex","justifyContent","FormModalSubHeader","List","getTrad","disabled","Divider","marginBottom","direction","alignItems","gap","TabForm","Footer","Button","onClick","FormModalEndActions","isAttributeModal","isCustomFieldModal","isComponentToDzModal","isComponentModal","isContentTypeModal","isCreatingDz","isCreatingComponentAttribute","isCreatingComponentInDz","isEditingAttribute","isDzAttribute","onSubmitAddComponentAttribute","onSubmitAddComponentToDz","onSubmitCreateComponent","onSubmitCreateContentType","onSubmitCreateDz","onSubmitEditAttribute","onSubmitEditComponent","onSubmitEditContentType","onSubmitEditCustomFieldAttribute","onSubmitEditDz","onClickFinish"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAMA,aAAAA,GAAgBC,MAAOC,CAAAA,IAAI;;AAEjC,CAAC;AAED,MAAMC,cAAc,CAACC,KAAAA,GAClBA,KAAK,CAAC,iCAAiC,IAAIC,YAAAA;MAEjCC,SAAY,GAAA,IAAA;AACvB,IAAA,MAAM,EACJC,YAAY,EACZC,gCAAgC,EAChCC,6BAA6B,EAC7BC,gCAAgC,EAChCC,UAAU,EACVC,aAAa,EACbC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,SAAS,EACTC,SAAS,EACTC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,SAAS,EACTC,YAAY,EACZC,SAAS,EACTC,YAAY,EACb,GAAGC,sBAAAA,EAAAA;AAEJ,IAAA,MAAMC,YAAYC,YAAa,CAAA,WAAA,EAAa,CAACvB,KAAAA,GAAUA,MAAMsB,SAAS,CAAA;IACtE,MAAME,cAAAA,GAAiBD,aAAa,WAAa,EAAA,CAACvB,QAAUA,KAAMyB,CAAAA,YAAY,CAACC,GAAG,CAAA;AAClF,IAAA,MAAMC,cAAcH,cAAed,CAAAA,cAAAA,CAAAA;AAEnC,IAAA,MAAMkB,QAAWC,GAAAA,WAAAA,EAAAA;IACjB,MAAM,EAAEC,kBAAkB,EAAE,GAAGC,eAAAA,EAAAA;IAC/B,MAAMC,YAAAA,GAAeC,YAAYlC,WAAamC,EAAAA,YAAAA,CAAAA;AAE9C,IAAA,MAAMC,Q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