@strapi/content-manager 0.0.0-experimental.e14656d3b8681880212c13260b9a2b340c182f2d → 0.0.0-experimental.e350eaa6073e65190102b4b798c32c287053cc02

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 (198) hide show
  1. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -1
  2. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-D_M8iBw5.js → ComponentConfigurationPage-BTR_hQow.js} +5 -6
  4. package/dist/_chunks/{ComponentConfigurationPage-D_M8iBw5.js.map → ComponentConfigurationPage-BTR_hQow.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-qemkOlnj.mjs → ComponentConfigurationPage-bLQr82ce.mjs} +4 -4
  6. package/dist/_chunks/{ComponentConfigurationPage-qemkOlnj.mjs.map → ComponentConfigurationPage-bLQr82ce.mjs.map} +1 -1
  7. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js → ComponentIcon-CRbtQEUV.js} +2 -3
  8. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js.map → ComponentIcon-CRbtQEUV.js.map} +1 -1
  9. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -1
  10. package/dist/_chunks/{EditConfigurationPage-CjUrEewK.mjs → EditConfigurationPage-BhRSnUsL.mjs} +4 -4
  11. package/dist/_chunks/{EditConfigurationPage-CjUrEewK.mjs.map → EditConfigurationPage-BhRSnUsL.mjs.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-BePwPuHy.js → EditConfigurationPage-z39Wv3E6.js} +5 -6
  13. package/dist/_chunks/{EditConfigurationPage-BePwPuHy.js.map → EditConfigurationPage-z39Wv3E6.js.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-De8GyU8P.mjs → EditViewPage-BCjNxNlY.mjs} +50 -10
  15. package/dist/_chunks/EditViewPage-BCjNxNlY.mjs.map +1 -0
  16. package/dist/_chunks/{EditViewPage-B-RJeiJD.js → EditViewPage-wujOq90c.js} +50 -11
  17. package/dist/_chunks/EditViewPage-wujOq90c.js.map +1 -0
  18. package/dist/_chunks/{Field-dq8Tg1M_.js → Field-B5QXnctJ.js} +238 -153
  19. package/dist/_chunks/Field-B5QXnctJ.js.map +1 -0
  20. package/dist/_chunks/{Field-pb2o8uBe.mjs → Field-Byr3mPTl.mjs} +232 -147
  21. package/dist/_chunks/Field-Byr3mPTl.mjs.map +1 -0
  22. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
  23. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
  24. package/dist/_chunks/{Form-DJn0Dxha.mjs → Form-BZgvE8C8.mjs} +17 -9
  25. package/dist/_chunks/Form-BZgvE8C8.mjs.map +1 -0
  26. package/dist/_chunks/{Form-DGIf4jQU.js → Form-D7mexvm3.js} +19 -12
  27. package/dist/_chunks/Form-D7mexvm3.js.map +1 -0
  28. package/dist/_chunks/{History-BowL3JKP.mjs → History-CqNgxkqK.mjs} +43 -100
  29. package/dist/_chunks/History-CqNgxkqK.mjs.map +1 -0
  30. package/dist/_chunks/{History-Dh2NEHnR.js → History-DYl2A8Z_.js} +42 -100
  31. package/dist/_chunks/History-DYl2A8Z_.js.map +1 -0
  32. package/dist/_chunks/{ListConfigurationPage-BxYCWz9e.js → ListConfigurationPage-BXnu_OoY.js} +7 -7
  33. package/dist/_chunks/ListConfigurationPage-BXnu_OoY.js.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-BpVOB-hn.mjs → ListConfigurationPage-BbQjzKkQ.mjs} +7 -6
  35. package/dist/_chunks/ListConfigurationPage-BbQjzKkQ.mjs.map +1 -0
  36. package/dist/_chunks/{ListViewPage-4XsciqHZ.js → ListViewPage-BtSi8C1l.js} +103 -77
  37. package/dist/_chunks/ListViewPage-BtSi8C1l.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-CXFUjZQC.mjs → ListViewPage-D4ofkbjR.mjs} +99 -72
  39. package/dist/_chunks/ListViewPage-D4ofkbjR.mjs.map +1 -0
  40. package/dist/_chunks/{NoContentTypePage-C8OpoHeU.js → NoContentTypePage-CitJeOq4.js} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-C8OpoHeU.js.map → NoContentTypePage-CitJeOq4.js.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-DuhOTp3x.mjs → NoContentTypePage-DyUx5mXh.mjs} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-DuhOTp3x.mjs.map → NoContentTypePage-DyUx5mXh.mjs.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-DVz3mzDz.mjs → NoPermissionsPage-DhIiyWkk.mjs} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-DVz3mzDz.mjs.map → NoPermissionsPage-DhIiyWkk.mjs.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-y_r7DVA2.js → NoPermissionsPage-DzgWz0M-.js} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-y_r7DVA2.js.map → NoPermissionsPage-DzgWz0M-.js.map} +1 -1
  48. package/dist/_chunks/Preview-BaYGJ0nb.mjs +293 -0
  49. package/dist/_chunks/Preview-BaYGJ0nb.mjs.map +1 -0
  50. package/dist/_chunks/Preview-DfNx8Ke-.js +311 -0
  51. package/dist/_chunks/Preview-DfNx8Ke-.js.map +1 -0
  52. package/dist/_chunks/{Relations-CVNLrn1Y.mjs → Relations-DM2yUTST.mjs} +75 -41
  53. package/dist/_chunks/Relations-DM2yUTST.mjs.map +1 -0
  54. package/dist/_chunks/{Relations-DPFCAa7b.js → Relations-DuKCaXrv.js} +75 -42
  55. package/dist/_chunks/Relations-DuKCaXrv.js.map +1 -0
  56. package/dist/_chunks/{en-uOUIxfcQ.js → en-BK8Xyl5I.js} +28 -15
  57. package/dist/_chunks/{en-uOUIxfcQ.js.map → en-BK8Xyl5I.js.map} +1 -1
  58. package/dist/_chunks/{en-BrCTWlZv.mjs → en-Dtk_ot79.mjs} +28 -15
  59. package/dist/_chunks/{en-BrCTWlZv.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
  60. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  61. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  62. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  63. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  64. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  65. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  66. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  67. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  68. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
  69. package/dist/_chunks/{index-C3fJE-1-.js → index-BUWEmX8m.js} +1273 -996
  70. package/dist/_chunks/index-BUWEmX8m.js.map +1 -0
  71. package/dist/_chunks/{index-DiMrfcfy.mjs → index-DVAIIsOs.mjs} +1276 -999
  72. package/dist/_chunks/index-DVAIIsOs.mjs.map +1 -0
  73. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  74. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  75. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  76. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  77. package/dist/_chunks/{layout-ls3gxfpH.mjs → layout-Bxsv5mP7.mjs} +6 -5
  78. package/dist/_chunks/{layout-ls3gxfpH.mjs.map → layout-Bxsv5mP7.mjs.map} +1 -1
  79. package/dist/_chunks/{layout-C788OmNr.js → layout-C3fN7Ejz.js} +7 -7
  80. package/dist/_chunks/{layout-C788OmNr.js.map → layout-C3fN7Ejz.js.map} +1 -1
  81. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  82. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  83. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  84. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  85. package/dist/_chunks/{relations-DYeotliT.js → relations-BPZKAoEY.js} +6 -7
  86. package/dist/_chunks/relations-BPZKAoEY.js.map +1 -0
  87. package/dist/_chunks/{relations-CLcOmGO0.mjs → relations-o3pPhzY4.mjs} +6 -7
  88. package/dist/_chunks/relations-o3pPhzY4.mjs.map +1 -0
  89. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  90. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  91. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  92. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  93. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
  94. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
  95. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
  96. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
  97. package/dist/admin/index.js +2 -1
  98. package/dist/admin/index.js.map +1 -1
  99. package/dist/admin/index.mjs +4 -3
  100. package/dist/admin/src/content-manager.d.ts +3 -2
  101. package/dist/admin/src/exports.d.ts +1 -1
  102. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  103. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  104. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  105. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  106. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  107. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  108. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  109. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +0 -32
  110. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  111. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  112. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  113. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  114. package/dist/admin/src/preview/index.d.ts +4 -0
  115. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  116. package/dist/admin/src/preview/routes.d.ts +3 -0
  117. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  118. package/dist/admin/src/router.d.ts +1 -1
  119. package/dist/admin/src/services/documents.d.ts +3 -4
  120. package/dist/server/index.js +453 -201
  121. package/dist/server/index.js.map +1 -1
  122. package/dist/server/index.mjs +453 -200
  123. package/dist/server/index.mjs.map +1 -1
  124. package/dist/server/src/bootstrap.d.ts.map +1 -1
  125. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  126. package/dist/server/src/controllers/index.d.ts.map +1 -1
  127. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  128. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  129. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  130. package/dist/server/src/history/services/history.d.ts.map +1 -1
  131. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  132. package/dist/server/src/history/services/utils.d.ts +3 -3
  133. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  134. package/dist/server/src/index.d.ts +4 -4
  135. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  136. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  137. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  138. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  139. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  140. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  141. package/dist/server/src/preview/index.d.ts +4 -0
  142. package/dist/server/src/preview/index.d.ts.map +1 -0
  143. package/dist/server/src/preview/routes/index.d.ts +8 -0
  144. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  145. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  146. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  147. package/dist/server/src/preview/services/index.d.ts +16 -0
  148. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  149. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  150. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  151. package/dist/server/src/preview/services/preview.d.ts +12 -0
  152. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  153. package/dist/server/src/preview/utils.d.ts +19 -0
  154. package/dist/server/src/preview/utils.d.ts.map +1 -0
  155. package/dist/server/src/register.d.ts.map +1 -1
  156. package/dist/server/src/routes/index.d.ts.map +1 -1
  157. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  158. package/dist/server/src/services/document-metadata.d.ts +8 -8
  159. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  160. package/dist/server/src/services/index.d.ts +4 -4
  161. package/dist/server/src/services/index.d.ts.map +1 -1
  162. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  163. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  164. package/dist/server/src/utils/index.d.ts +2 -0
  165. package/dist/server/src/utils/index.d.ts.map +1 -1
  166. package/dist/shared/contracts/collection-types.d.ts +3 -1
  167. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  168. package/dist/shared/contracts/index.d.ts +1 -0
  169. package/dist/shared/contracts/index.d.ts.map +1 -1
  170. package/dist/shared/contracts/preview.d.ts +27 -0
  171. package/dist/shared/contracts/preview.d.ts.map +1 -0
  172. package/dist/shared/index.js +4 -0
  173. package/dist/shared/index.js.map +1 -1
  174. package/dist/shared/index.mjs +4 -0
  175. package/dist/shared/index.mjs.map +1 -1
  176. package/package.json +17 -15
  177. package/dist/_chunks/EditViewPage-B-RJeiJD.js.map +0 -1
  178. package/dist/_chunks/EditViewPage-De8GyU8P.mjs.map +0 -1
  179. package/dist/_chunks/Field-dq8Tg1M_.js.map +0 -1
  180. package/dist/_chunks/Field-pb2o8uBe.mjs.map +0 -1
  181. package/dist/_chunks/Form-DGIf4jQU.js.map +0 -1
  182. package/dist/_chunks/Form-DJn0Dxha.mjs.map +0 -1
  183. package/dist/_chunks/History-BowL3JKP.mjs.map +0 -1
  184. package/dist/_chunks/History-Dh2NEHnR.js.map +0 -1
  185. package/dist/_chunks/ListConfigurationPage-BpVOB-hn.mjs.map +0 -1
  186. package/dist/_chunks/ListConfigurationPage-BxYCWz9e.js.map +0 -1
  187. package/dist/_chunks/ListViewPage-4XsciqHZ.js.map +0 -1
  188. package/dist/_chunks/ListViewPage-CXFUjZQC.mjs.map +0 -1
  189. package/dist/_chunks/Relations-CVNLrn1Y.mjs.map +0 -1
  190. package/dist/_chunks/Relations-DPFCAa7b.js.map +0 -1
  191. package/dist/_chunks/index-C3fJE-1-.js.map +0 -1
  192. package/dist/_chunks/index-DiMrfcfy.mjs.map +0 -1
  193. package/dist/_chunks/relations-CLcOmGO0.mjs.map +0 -1
  194. package/dist/_chunks/relations-DYeotliT.js.map +0 -1
  195. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  196. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  197. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  198. package/strapi-server.js +0 -3
@@ -1 +1 @@
1
- {"version":3,"file":"FieldTypeIcon-CMlNO8PE.mjs","sources":["../../admin/src/components/FieldTypeIcon.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useStrapiApp } from '@strapi/admin/strapi-admin';\nimport { Box } from '@strapi/design-system';\nimport {\n BlocksField,\n BooleanField,\n ComponentField,\n DateField,\n DynamicZoneField,\n EmailField,\n EnumerationField,\n JsonField,\n MediaField,\n NumberField,\n PasswordField,\n RelationField,\n TextField,\n UidField,\n} from '@strapi/icons/symbols';\n\nimport type { Schema } from '@strapi/types';\n\nconst iconByTypes: Record<Schema.Attribute.Kind, React.ReactElement> = {\n biginteger: <NumberField />,\n boolean: <BooleanField />,\n date: <DateField />,\n datetime: <DateField />,\n decimal: <NumberField />,\n email: <EmailField />,\n enumeration: <EnumerationField />,\n float: <NumberField />,\n integer: <NumberField />,\n media: <MediaField />,\n password: <PasswordField />,\n relation: <RelationField />,\n string: <TextField />,\n text: <TextField />,\n richtext: <TextField />,\n time: <DateField />,\n timestamp: <DateField />,\n json: <JsonField />,\n uid: <UidField />,\n component: <ComponentField />,\n dynamiczone: <DynamicZoneField />,\n blocks: <BlocksField />,\n};\n\ninterface FieldTypeIconProps {\n type?: keyof typeof iconByTypes;\n customFieldUid?: string;\n}\n\nconst FieldTypeIcon = ({ type, customFieldUid }: FieldTypeIconProps) => {\n const getCustomField = useStrapiApp('FieldTypeIcon', (state) => state.customFields.get);\n\n if (!type) {\n return null;\n }\n\n let Compo = iconByTypes[type];\n\n if (customFieldUid) {\n const customField = getCustomField(customFieldUid);\n const CustomFieldIcon = customField?.icon;\n\n if (CustomFieldIcon) {\n Compo = (\n <Box marginRight={3} width={7} height={6}>\n <CustomFieldIcon />\n </Box>\n );\n }\n }\n\n if (!iconByTypes[type]) {\n return null;\n }\n\n return Compo;\n};\n\nexport { FieldTypeIcon };\n"],"names":[],"mappings":";;;;AAuBA,MAAM,cAAiE;AAAA,EACrE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MlNO8PE.mjs","sources":["../../admin/src/components/FieldTypeIcon.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useStrapiApp } from '@strapi/admin/strapi-admin';\nimport { Box } from '@strapi/design-system';\nimport {\n BlocksField,\n BooleanField,\n ComponentField,\n DateField,\n DynamicZoneField,\n EmailField,\n EnumerationField,\n JsonField,\n MediaField,\n NumberField,\n PasswordField,\n RelationField,\n TextField,\n UidField,\n} from '@strapi/icons/symbols';\n\nimport type { Schema } from '@strapi/types';\n\nconst iconByTypes: Record<Schema.Attribute.Kind, React.ReactElement> = {\n biginteger: <NumberField />,\n boolean: <BooleanField />,\n date: <DateField />,\n datetime: <DateField />,\n decimal: <NumberField />,\n email: <EmailField />,\n enumeration: <EnumerationField />,\n float: <NumberField />,\n integer: <NumberField />,\n media: <MediaField />,\n password: <PasswordField />,\n relation: <RelationField />,\n string: <TextField />,\n text: <TextField />,\n richtext: <TextField />,\n time: <DateField />,\n timestamp: <DateField />,\n json: <JsonField />,\n uid: <UidField />,\n component: <ComponentField />,\n dynamiczone: <DynamicZoneField />,\n blocks: <BlocksField />,\n};\n\ninterface FieldTypeIconProps {\n type?: keyof typeof iconByTypes;\n customFieldUid?: string;\n}\n\nconst FieldTypeIcon = ({ type, customFieldUid }: FieldTypeIconProps) => {\n const getCustomField = useStrapiApp('FieldTypeIcon', (state) => state.customFields.get);\n\n if (!type) {\n return null;\n }\n\n let Compo = iconByTypes[type];\n\n if (customFieldUid) {\n const customField = getCustomField(customFieldUid);\n const CustomFieldIcon = customField?.icon;\n\n if (CustomFieldIcon) {\n Compo = (\n <Box marginRight={3} width={7} height={6}>\n <CustomFieldIcon />\n </Box>\n );\n }\n }\n\n if (!iconByTypes[type]) {\n return null;\n }\n\n return Compo;\n};\n\nexport { FieldTypeIcon };\n"],"names":[],"mappings":";;;;AAuBA,MAAM,cAAiE;AAAA,EACrE,gCAAa,aAAY,EAAA;AAAA,EACzB,6BAAU,cAAa,EAAA;AAAA,EACvB,0BAAO,WA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cesContent":["import * as React from 'react';\n\nimport { useStrapiApp } from '@strapi/admin/strapi-admin';\nimport { Box } from '@strapi/design-system';\nimport {\n BlocksField,\n BooleanField,\n ComponentField,\n DateField,\n DynamicZoneField,\n EmailField,\n EnumerationField,\n JsonField,\n MediaField,\n NumberField,\n PasswordField,\n RelationField,\n TextField,\n UidField,\n} from '@strapi/icons/symbols';\n\nimport type { Schema } from '@strapi/types';\n\nconst iconByTypes: Record<Schema.Attribute.Kind, React.ReactElement> = {\n biginteger: <NumberField />,\n boolean: <BooleanField />,\n date: <DateField />,\n datetime: <DateField />,\n decimal: <NumberField />,\n email: <EmailField />,\n enumeration: <EnumerationField />,\n float: <NumberField />,\n integer: <NumberField />,\n media: <MediaField />,\n password: <PasswordField />,\n relation: <RelationField />,\n string: <TextField />,\n text: <TextField />,\n richtext: <TextField />,\n time: <DateField />,\n timestamp: <DateField />,\n json: <JsonField />,\n uid: <UidField />,\n component: <ComponentField />,\n dynamiczone: <DynamicZoneField />,\n blocks: <BlocksField />,\n};\n\ninterface FieldTypeIconProps {\n type?: keyof typeof iconByTypes;\n customFieldUid?: string;\n}\n\nconst FieldTypeIcon = ({ type, customFieldUid }: FieldTypeIconProps) => {\n const getCustomField = useStrapiApp('FieldTypeIcon', (state) => state.customFields.get);\n\n if (!type) {\n return null;\n }\n\n let Compo = iconByTypes[type];\n\n if (customFieldUid) {\n const customField = getCustomField(customFieldUid);\n const CustomFieldIcon = customField?.icon;\n\n if (CustomFieldIcon) {\n Compo = (\n <Box marginRight={3} width={7} height={6}>\n <CustomFieldIcon />\n </Box>\n );\n }\n }\n\n if (!iconByTypes[type]) {\n return null;\n }\n\n return Compo;\n};\n\nexport { FieldTypeIcon };\n"],"names":["NumberField","BooleanField","DateField","EmailField","EnumerationField","MediaField","PasswordField","RelationField","TextField","JsonField","UidField","ComponentField","DynamicZoneField","BlocksField","useStrapiApp","jsx","Box"],"mappings":";;;;;AAuBA,MAAM,cAAiE;AAAA,EACrE,2CAAaA,QAA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A,iBAAA,CAAA,CAAgB,EACnB,CAAA;AAAA,IAEJ;AAAA,EACF;AAEI,MAAA,CAAC,YAAY,IAAI,GAAG;AACf,WAAA;AAAA,EACT;AAEO,SAAA;AACT;;"}
1
+ {"version":3,"file":"FieldTypeIcon-Dnwq_IRF.js","sources":["../../admin/src/components/FieldTypeIcon.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useStrapiApp } from '@strapi/admin/strapi-admin';\nimport { Box } from '@strapi/design-system';\nimport {\n BlocksField,\n BooleanField,\n ComponentField,\n DateField,\n DynamicZoneField,\n EmailField,\n EnumerationField,\n JsonField,\n MediaField,\n NumberField,\n PasswordField,\n RelationField,\n TextField,\n UidField,\n} from '@strapi/icons/symbols';\n\nimport type { Schema } from '@strapi/types';\n\nconst iconByTypes: Record<Schema.Attribute.Kind, React.ReactElement> = {\n biginteger: <NumberField />,\n boolean: <BooleanField />,\n date: <DateField />,\n datetime: <DateField />,\n decimal: <NumberField />,\n email: <EmailField />,\n enumeration: <EnumerationField />,\n float: <NumberField />,\n integer: <NumberField />,\n media: <MediaField />,\n password: <PasswordField />,\n relation: <RelationField />,\n string: <TextField />,\n text: <TextField />,\n richtext: <TextField />,\n time: <DateField />,\n timestamp: <DateField />,\n json: <JsonField />,\n uid: <UidField />,\n component: <ComponentField />,\n dynamiczone: <DynamicZoneField />,\n blocks: <BlocksField />,\n};\n\ninterface FieldTypeIconProps {\n type?: keyof typeof iconByTypes;\n customFieldUid?: string;\n}\n\nconst FieldTypeIcon = ({ type, customFieldUid }: FieldTypeIconProps) => {\n const getCustomField = useStrapiApp('FieldTypeIcon', (state) => state.customFields.get);\n\n if (!type) {\n return null;\n }\n\n let Compo = iconByTypes[type];\n\n if (customFieldUid) {\n const customField = getCustomField(customFieldUid);\n const CustomFieldIcon = customField?.icon;\n\n if (CustomFieldIcon) {\n Compo = (\n <Box marginRight={3} width={7} height={6}>\n <CustomFieldIcon />\n </Box>\n );\n }\n }\n\n if (!iconByTypes[type]) {\n return null;\n }\n\n return Compo;\n};\n\nexport { FieldTypeIcon };\n"],"names":["NumberField","BooleanField","DateField","EmailField","EnumerationField","MediaField","PasswordField","RelationField","TextField","JsonField","UidField","ComponentField","DynamicZoneField","BlocksField","useStrapiApp","jsx","Box"],"mappings":";;;;;AAuBA,MAAM,cAAiE;AAAA,EACrE,2CAAaA,QAAY,aAAA,EAAA;AAAA,EACzB,wCAAUC,QAAa,cAAA,EAAA;AAAA,EACvB,qCAAOC,QAAU,WAAA,EAAA;AAAA,EACjB,yCAAWA,QAAU,WAAA,EAAA;AAAA,EACrB,wCAAUF,QAAY,aAAA,EAAA;AAAA,EACtB,sCAAQG,QAAW,YAAA,EAAA;AAAA,EACnB,4CAAcC,QAAiB,kBAAA,EAAA;AAAA,EAC/B,sCAAQJ,QAAY,aAAA,EAAA;AAAA,EACpB,wCAAUA,QAAY,aAAA,EAAA;AAAA,EACtB,sCAAQK,QAAW,YAAA,EAAA;AAAA,EACnB,yCAAWC,QAAc,eAAA,EAAA;AAAA,EACzB,yCAAWC,QAAc,eAAA,EAAA;AAAA,EACzB,uCAASC,QAAU,WAAA,EAAA;AAAA,EACnB,qCAAOA,QAAU,WAAA,EAAA;AAAA,EACjB,yCAAWA,QAAU,WAAA,EAAA;AAAA,EACrB,qCAAON,QAAU,WAAA,EAAA;AAAA,EACjB,0CAAYA,QAAU,WAAA,EAAA;AAAA,EACtB,qCAAOO,QAAU,WAAA,EAAA;AAAA,EACjB,oCAAMC,QAAS,UAAA,EAAA;AAAA,EACf,0CAAYC,QAAe,gBAAA,EAAA;AAAA,EAC3B,4CAAcC,QAAiB,kBAAA,EAAA;AAAA,EAC/B,uCAASC,QAAAA,aAAY,CAAA,CAAA;AACvB;AAOA,MAAM,gBAAgB,CAAC,EAAE,MAAM,qBAAyC;AACtE,QAAM,iBAAiBC,YAAAA,aAAa,iBAAiB,CAAC,UAAU,MAAM,aAAa,GAAG;AAEtF,MAAI,CAAC,MAAM;AACF,WAAA;AAAA,EAAA;AAGL,MAAA,QAAQ,YAAY,IAAI;AAE5B,MAAI,gBAAgB;AACZ,UAAA,cAAc,eAAe,cAAc;AACjD,UAAM,kBAAkB,aAAa;AAErC,QAAI,iBAAiB;AAEjB,cAAAC,2BAAA,IAACC,aAAI,KAAA,EAAA,aAAa,GAAG,OAAO,GAAG,QAAQ,GACrC,UAACD,2BAAAA,IAAA,iBAAA,CAAA,CAAgB,EACnB,CAAA;AAAA,IAAA;AAAA,EAEJ;AAGE,MAAA,CAAC,YAAY,IAAI,GAAG;AACf,WAAA;AAAA,EAAA;AAGF,SAAA;AACT;;"}
@@ -5,17 +5,17 @@ import { Modal, Flex, Grid, Button, IconButton, Typography, Box, Menu, useCompos
5
5
  import { generateNKeysBetween as generateNKeysBetween$1 } from "fractional-indexing";
6
6
  import pipe from "lodash/fp/pipe";
7
7
  import { useIntl } from "react-intl";
8
- import { a as useGetInitialDataQuery, A as ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD, y as capitalise, g as getTranslation } from "./index-DiMrfcfy.mjs";
8
+ import { a as useGetInitialDataQuery, A as ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD, y as capitalise, g as getTranslation } from "./index-DVAIIsOs.mjs";
9
9
  import { Plus, Drag, Pencil, Cross, Cog } from "@strapi/icons";
10
10
  import { getEmptyImage } from "react-dnd-html5-backend";
11
11
  import { NavLink } from "react-router-dom";
12
12
  import { styled } from "styled-components";
13
- import { u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DdHgKsqq.mjs";
13
+ import { u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DJ6jqvZN.mjs";
14
14
  import { C as ComponentIcon } from "./ComponentIcon-u4bIXTFY.mjs";
15
15
  import * as yup from "yup";
16
16
  import { F as FieldTypeIcon } from "./FieldTypeIcon-CMlNO8PE.mjs";
17
17
  const FIELD_SCHEMA = yup.object().shape({
18
- label: yup.string().required(),
18
+ label: yup.string().required().nullable(),
19
19
  description: yup.string(),
20
20
  editable: yup.boolean(),
21
21
  size: yup.number().required()
@@ -264,7 +264,10 @@ const Fields = ({ attributes, fieldSizes, components, metadatas = {} }) => {
264
264
  if (layout[rowIndex].children.length === 1) {
265
265
  removeFieldRow(`layout`, rowIndex);
266
266
  } else {
267
- onChange(`layout.${rowIndex}.children.${fieldIndex}`, void 0);
267
+ onChange(`layout.${rowIndex}.children`, [
268
+ ...layout[rowIndex].children.slice(0, fieldIndex),
269
+ ...layout[rowIndex].children.slice(fieldIndex + 1)
270
+ ]);
268
271
  }
269
272
  };
270
273
  const handleAddField = (field) => () => {
@@ -353,9 +356,15 @@ const Field = ({ attribute, components, name, index, onMoveField, onRemoveField
353
356
  }, [dragPreviewRef]);
354
357
  const composedRefs = useComposedRefs(dragRef, objectRef);
355
358
  const handleRemoveField = (e) => {
359
+ e.preventDefault();
356
360
  e.stopPropagation();
357
361
  onRemoveField(e);
358
362
  };
363
+ const onEditFieldMeta = (e) => {
364
+ e.preventDefault();
365
+ e.stopPropagation();
366
+ setIsModalOpen(true);
367
+ };
359
368
  const tempRefs = useComposedRefs(dropRef, objectRef);
360
369
  if (!value) {
361
370
  return null;
@@ -402,12 +411,10 @@ const Field = ({ attribute, components, name, index, onMoveField, onRemoveField
402
411
  /* @__PURE__ */ jsx(
403
412
  IconButton,
404
413
  {
414
+ type: "button",
405
415
  variant: "ghost",
406
416
  background: "transparent",
407
- onClick: (e) => {
408
- e.stopPropagation();
409
- setIsModalOpen(true);
410
- },
417
+ onClick: onEditFieldMeta,
411
418
  withTooltip: false,
412
419
  label: formatMessage(
413
420
  {
@@ -422,6 +429,7 @@ const Field = ({ attribute, components, name, index, onMoveField, onRemoveField
422
429
  /* @__PURE__ */ jsx(
423
430
  IconButton,
424
431
  {
432
+ type: "button",
425
433
  variant: "ghost",
426
434
  onClick: handleRemoveField,
427
435
  background: "transparent",
@@ -747,4 +755,4 @@ export {
747
755
  ConfigurationForm as C,
748
756
  TEMP_FIELD_NAME as T
749
757
  };
750
- //# sourceMappingURL=Form-DJn0Dxha.mjs.map
758
+ //# sourceMappingURL=Form-BZgvE8C8.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Form-BZgvE8C8.mjs","sources":["../../admin/src/components/ConfigurationForm/EditFieldForm.tsx","../../admin/src/components/ConfigurationForm/Fields.tsx","../../admin/src/components/ConfigurationForm/Form.tsx"],"sourcesContent":["import {\n useNotification,\n InputRenderer,\n Form,\n InputProps,\n useField,\n} from '@strapi/admin/strapi-admin';\nimport { Button, Flex, Grid, Modal } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport * as yup from 'yup';\n\nimport { ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD } from '../../constants/attributes';\nimport { useGetInitialDataQuery } from '../../services/init';\nimport { capitalise } from '../../utils/strings';\nimport { getTranslation } from '../../utils/translations';\nimport { FieldTypeIcon } from '../FieldTypeIcon';\n\nimport { TEMP_FIELD_NAME } from './Fields';\n\nimport type { ConfigurationFormData } from './Form';\nimport type { Schema } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * Constants\n * -----------------------------------------------------------------------------------------------*/\n\nconst FIELD_SCHEMA = yup.object().shape({\n label: yup.string().required().nullable(),\n description: yup.string(),\n editable: yup.boolean(),\n size: yup.number().required(),\n});\n\n/* -------------------------------------------------------------------------------------------------\n * EditFieldForm\n * -----------------------------------------------------------------------------------------------*/\n\ninterface EditFieldFormProps {\n attribute?: Schema.Attribute.AnyAttribute;\n name: string;\n onClose: () => void;\n}\n\nconst EditFieldForm = ({ attribute, name, onClose }: EditFieldFormProps) => {\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n\n const { value, onChange } =\n useField<ConfigurationFormData['layout'][number]['children'][number]>(name);\n\n const { data: mainFieldOptions } = useGetInitialDataQuery(undefined, {\n selectFromResult: (res) => {\n if (attribute?.type !== 'relation' || !res.data) {\n return { data: [] };\n }\n\n if ('targetModel' in attribute && typeof attribute.targetModel === 'string') {\n const targetSchema = res.data.contentTypes.find(\n (schema) => schema.uid === attribute.targetModel\n );\n\n if (targetSchema) {\n return {\n data: Object.entries(targetSchema.attributes).reduce<\n Array<{ label: string; value: string }>\n >((acc, [key, attribute]) => {\n /**\n * Create the list of attributes from the schema as to which can\n * be our `mainField` and dictate the display name of the schema\n * we're editing.\n */\n if (!ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD.includes(attribute.type)) {\n acc.push({\n label: key,\n value: key,\n });\n }\n\n return acc;\n }, []),\n };\n }\n }\n\n return { data: [] };\n },\n skip: attribute?.type !== 'relation',\n });\n\n if (!value || value.name === TEMP_FIELD_NAME || !attribute) {\n // This is very unlikely to happen, but it ensures the form is not opened without a value.\n console.error(\n \"You've opened a field to edit without it being part of the form, this is likely a bug with Strapi. Please open an issue.\"\n );\n\n toggleNotification({\n message: formatMessage({\n id: 'content-manager.containers.edit-settings.modal-form.error',\n defaultMessage: 'An error occurred while trying to open the form.',\n }),\n type: 'danger',\n });\n\n return null;\n }\n\n return (\n <Modal.Content>\n <Form\n method=\"PUT\"\n initialValues={value}\n validationSchema={FIELD_SCHEMA}\n onSubmit={(data) => {\n onChange(name, data);\n onClose();\n }}\n >\n <Modal.Header>\n <Flex gap={3}>\n <FieldTypeIcon type={attribute.type} />\n <Modal.Title>\n {formatMessage(\n {\n id: 'content-manager.containers.edit-settings.modal-form.label',\n defaultMessage: 'Edit {fieldName}',\n },\n { fieldName: capitalise(value.name) }\n )}\n </Modal.Title>\n </Flex>\n </Modal.Header>\n <Modal.Body>\n <Grid.Root gap={4}>\n {[\n {\n name: 'label',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.label'),\n defaultMessage: 'Label',\n }),\n size: 6,\n type: 'string' as const,\n },\n {\n name: 'description',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.description'),\n defaultMessage: 'Description',\n }),\n size: 6,\n type: 'string' as const,\n },\n {\n name: 'placeholder',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.placeholder'),\n defaultMessage: 'Placeholder',\n }),\n size: 6,\n type: 'string' as const,\n },\n {\n name: 'editable',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.editable'),\n defaultMessage: 'Editable',\n }),\n size: 6,\n type: 'boolean' as const,\n },\n {\n name: 'mainField',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.mainField'),\n defaultMessage: 'Entry title',\n }),\n hint: formatMessage({\n id: getTranslation(\n 'containers.SettingPage.edit-settings.modal-form.mainField.hint'\n ),\n defaultMessage: 'Set the displayed field',\n }),\n size: 6,\n options: mainFieldOptions,\n type: 'enumeration' as const,\n },\n {\n name: 'size',\n label: formatMessage({\n id: getTranslation('containers.ListSettingsView.modal-form.size'),\n defaultMessage: 'Size',\n }),\n size: 6,\n options: [\n { value: '4', label: '33%' },\n { value: '6', label: '50%' },\n { value: '8', label: '66%' },\n { value: '12', label: '100%' },\n ],\n type: 'enumeration' as const,\n },\n ]\n .filter(filterFieldsBasedOnAttributeType(attribute.type))\n .map(({ size, ...field }) => (\n <Grid.Item key={field.name} col={size} direction=\"column\" alignItems=\"stretch\">\n <InputRenderer {...field} />\n </Grid.Item>\n ))}\n </Grid.Root>\n </Modal.Body>\n <Modal.Footer>\n <Modal.Close>\n <Button variant=\"tertiary\">\n {formatMessage({ id: 'app.components.Button.cancel', defaultMessage: 'Cancel' })}\n </Button>\n </Modal.Close>\n <Button type=\"submit\">\n {formatMessage({ id: 'global.finish', defaultMessage: 'Finish' })}\n </Button>\n </Modal.Footer>\n </Form>\n </Modal.Content>\n );\n};\n\n/**\n * @internal\n * @description not all edit fields have the same editable properties, it depends on the type\n * e.g. a dynamic zone can only change it's label.\n */\nconst filterFieldsBasedOnAttributeType = (type: Schema.Attribute.Kind) => (field: InputProps) => {\n switch (type) {\n case 'blocks':\n case 'richtext':\n return field.name !== 'size' && field.name !== 'mainField';\n case 'boolean':\n case 'media':\n return field.name !== 'placeholder' && field.name !== 'mainField';\n case 'component':\n case 'dynamiczone':\n return field.name === 'label' || field.name === 'editable';\n case 'json':\n return field.name !== 'placeholder' && field.name !== 'mainField' && field.name !== 'size';\n case 'relation':\n return true;\n default:\n return field.name !== 'mainField';\n }\n};\n\nexport { EditFieldForm };\nexport type { EditFieldFormProps };\n","import * as React from 'react';\n\nimport { useField, useForm } from '@strapi/admin/strapi-admin';\nimport {\n Modal,\n Box,\n Flex,\n Grid,\n IconButton,\n IconButtonComponent,\n Typography,\n useComposedRefs,\n Link,\n Menu,\n} from '@strapi/design-system';\nimport { Cog, Cross, Drag, Pencil, Plus } from '@strapi/icons';\nimport { generateNKeysBetween as generateNKeysBetweenImpl } from 'fractional-indexing';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { ItemTypes } from '../../constants/dragAndDrop';\nimport { type UseDragAndDropOptions, useDragAndDrop } from '../../hooks/useDragAndDrop';\nimport { getTranslation } from '../../utils/translations';\nimport { ComponentIcon } from '../ComponentIcon';\n\nimport { EditFieldForm, EditFieldFormProps } from './EditFieldForm';\n\nimport type { ConfigurationFormData, EditFieldSpacerLayout } from './Form';\nimport type { EditLayout } from '../../hooks/useDocumentLayout';\n\ntype FormField = ConfigurationFormData['layout'][number]['children'][number];\ntype Field = Omit<ConfigurationFormData['layout'][number]['children'][number], '__temp_key__'>;\n\n/* -------------------------------------------------------------------------------------------------\n * Fields\n * -----------------------------------------------------------------------------------------------*/\n\ninterface FieldsProps extends Pick<EditLayout, 'metadatas'>, Pick<FieldProps, 'components'> {\n attributes: {\n [key: string]: FieldProps['attribute'];\n };\n fieldSizes: Record<string, number>;\n components: EditLayout['components'];\n}\n\nconst Fields = ({ attributes, fieldSizes, components, metadatas = {} }: FieldsProps) => {\n const { formatMessage } = useIntl();\n\n const layout = useForm<ConfigurationFormData['layout']>(\n 'Fields',\n (state) => state.values.layout ?? []\n );\n const onChange = useForm('Fields', (state) => state.onChange);\n const addFieldRow = useForm('Fields', (state) => state.addFieldRow);\n const removeFieldRow = useForm('Fields', (state) => state.removeFieldRow);\n\n const existingFields = layout.map((row) => row.children.map((field) => field.name)).flat();\n\n /**\n * Get the fields that are not already in the layout\n * But also check that they are visible before we give users\n * the option to display them. e.g. `id` is not visible.\n */\n const remainingFields = Object.entries(metadatas).reduce<Field[]>((acc, current) => {\n const [name, { visible, ...field }] = current;\n\n if (!existingFields.includes(name) && visible === true) {\n const type = attributes[name]?.type;\n const size = type ? fieldSizes[type] : 12;\n\n acc.push({\n ...field,\n label: field.label ?? name,\n name,\n size,\n });\n }\n\n return acc;\n }, []);\n\n const handleMoveField: FieldProps['onMoveField'] = (\n [newRowIndex, newFieldIndex],\n [currentRowIndex, currentFieldIndex]\n ) => {\n /**\n * Because this view has the constraint that the sum of field sizes cannot be greater\n * than 12, we don't use the form's method to move field rows, instead, we calculate\n * the new layout and set the entire form.\n */\n const newLayout = structuredClone(layout);\n\n /**\n * Remove field from the current layout space using splice so we have the item\n */\n const [field] = newLayout[currentRowIndex].children.splice(currentFieldIndex, 1);\n\n if (!field || field.name === TEMP_FIELD_NAME) {\n return;\n }\n\n const newRow = newLayout[newRowIndex].children;\n const [newFieldKey] = generateNKeysBetween(newRow, 1, currentFieldIndex, newFieldIndex);\n\n /**\n * Next we inject the field into it's new row at it's specified index, we then remove the spaces\n * if they exist and recalculate into potentially two arrays ONLY if the sizing is now over 12,\n * the row and the rest of the row that couldn't fit.\n *\n * for example, if i have a row of `[{size: 4}, {size: 6}]` and i add `{size: 8}` a index 0,\n * the new array will look like `[{size: 8}, {size: 4}, {size: 6}]` which breaks the limit of 12,\n * so instead we make two arrays for the new rows `[[{size: 8}, {size: 4}], [{size: 6}]]` which we\n * then inject at the original row point with spacers included.\n */\n newRow.splice(newFieldIndex, 0, { ...field, __temp_key__: newFieldKey });\n\n if (newLayout[newRowIndex].children.reduce((acc, curr) => acc + curr.size, 0) > 12) {\n const recalculatedRows = chunkArray(\n newLayout[newRowIndex].children.filter((field) => field.name !== TEMP_FIELD_NAME)\n );\n\n const rowKeys = generateNKeysBetween(\n newLayout,\n recalculatedRows.length,\n currentRowIndex,\n newRowIndex\n );\n\n newLayout.splice(\n newRowIndex,\n 1,\n ...recalculatedRows.map((row, index) => ({\n __temp_key__: rowKeys[index],\n children: row,\n }))\n );\n }\n\n /**\n * Now we remove our spacers from the rows so we can understand what dead rows exist:\n * - if there's only spacers left\n * - there's nothing in the row, e.g. a size 12 field left it.\n * These rows are then filtered out.\n * After that, we recalculate the spacers for the rows that need them.\n */\n const newLayoutWithSpacers = newLayout\n .map((row) => ({\n ...row,\n children: row.children.filter((field) => field.name !== TEMP_FIELD_NAME),\n }))\n .filter((row) => row.children.length > 0)\n .map((row) => {\n const totalSpaceTaken = row.children.reduce((acc, curr) => acc + curr.size, 0);\n\n if (totalSpaceTaken < 12) {\n const [spacerKey] = generateNKeysBetweenImpl(\n row.children.at(-1)?.__temp_key__,\n undefined,\n 1\n );\n\n return {\n ...row,\n children: [\n ...row.children,\n {\n name: TEMP_FIELD_NAME,\n size: 12 - totalSpaceTaken,\n __temp_key__: spacerKey,\n } satisfies EditFieldSpacerLayout,\n ],\n };\n }\n\n return row;\n });\n\n onChange('layout', newLayoutWithSpacers);\n };\n\n const handleRemoveField =\n (rowIndex: number, fieldIndex: number): FieldProps['onRemoveField'] =>\n () => {\n if (layout[rowIndex].children.length === 1) {\n removeFieldRow(`layout`, rowIndex);\n } else {\n onChange(`layout.${rowIndex}.children`, [\n ...layout[rowIndex].children.slice(0, fieldIndex),\n ...layout[rowIndex].children.slice(fieldIndex + 1),\n ]);\n }\n };\n\n const handleAddField = (field: Field) => () => {\n addFieldRow('layout', { children: [field] });\n };\n\n return (\n <Flex paddingTop={6} direction=\"column\" alignItems=\"stretch\" gap={4}>\n <Flex alignItems=\"flex-start\" direction=\"column\" justifyContent=\"space-between\">\n <Typography fontWeight=\"bold\">\n {formatMessage({\n id: getTranslation('containers.list.displayedFields'),\n defaultMessage: 'Displayed fields',\n })}\n </Typography>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {formatMessage({\n id: 'containers.SettingPage.editSettings.description',\n defaultMessage: 'Drag & drop the fields to build the layout',\n })}\n </Typography>\n </Flex>\n <Box padding={4} hasRadius borderStyle=\"dashed\" borderWidth=\"1px\" borderColor=\"neutral300\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={2}>\n {layout.map((row, rowIndex) => (\n <Grid.Root gap={2} key={row.__temp_key__}>\n {row.children.map(({ size, ...field }, fieldIndex) => (\n <Grid.Item key={field.name} col={size} direction=\"column\" alignItems=\"stretch\">\n <Field\n attribute={attributes[field.name]}\n components={components}\n index={[rowIndex, fieldIndex]}\n name={`layout.${rowIndex}.children.${fieldIndex}`}\n onMoveField={handleMoveField}\n onRemoveField={handleRemoveField(rowIndex, fieldIndex)}\n />\n </Grid.Item>\n ))}\n </Grid.Root>\n ))}\n <Menu.Root>\n <Menu.Trigger\n startIcon={<Plus />}\n endIcon={null}\n disabled={remainingFields.length === 0}\n fullWidth\n variant=\"secondary\"\n >\n {formatMessage({\n id: getTranslation('containers.SettingPage.add.field'),\n defaultMessage: 'Insert another field',\n })}\n </Menu.Trigger>\n <Menu.Content>\n {remainingFields.map((field) => (\n <Menu.Item key={field.name} onSelect={handleAddField(field)}>\n {field.label}\n </Menu.Item>\n ))}\n </Menu.Content>\n </Menu.Root>\n </Flex>\n </Box>\n </Flex>\n );\n};\n\n/**\n * @internal\n * @description Small abstraction to solve within an array of fields where you can\n * add a field to the beginning or start, move back and forth what it's index range\n * should be when calculating it's new temp key\n */\nconst generateNKeysBetween = <Field extends { __temp_key__: string }>(\n field: Field[],\n count: number,\n currInd: number,\n newInd: number\n) => {\n const startKey = currInd > newInd ? field[newInd - 1]?.__temp_key__ : field[newInd]?.__temp_key__;\n const endKey = currInd > newInd ? field[newInd]?.__temp_key__ : field[newInd + 1]?.__temp_key__;\n\n return generateNKeysBetweenImpl(startKey, endKey, count);\n};\n\n/**\n * @internal\n * @description chunks a row of layouts by the max size we allow, 12. It does not add the\n * spacers again, that should be added separately.\n */\nconst chunkArray = (array: FormField[]) => {\n const result: Array<FormField[]> = [];\n let temp: FormField[] = [];\n\n array.reduce((acc, field) => {\n if (acc + field.size > 12) {\n result.push(temp);\n temp = [field];\n return field.size;\n } else {\n temp.push(field);\n return acc + field.size;\n }\n }, 0);\n\n if (temp.length > 0) {\n result.push(temp);\n }\n\n return result;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Field\n * -----------------------------------------------------------------------------------------------*/\n\ninterface FieldProps extends Pick<EditFieldFormProps, 'name' | 'attribute'> {\n components: EditLayout['components'];\n index: [row: number, index: number];\n onMoveField: UseDragAndDropOptions<number[]>['onMoveItem'];\n onRemoveField: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nconst TEMP_FIELD_NAME = '_TEMP_';\n\n/**\n * Displays a field in the layout with drag options, also\n * opens a modal to edit the details of said field.\n */\nconst Field = ({ attribute, components, name, index, onMoveField, onRemoveField }: FieldProps) => {\n const [isModalOpen, setIsModalOpen] = React.useState(false);\n const { formatMessage } = useIntl();\n\n const { value } = useField<FormField>(name);\n\n const [{ isDragging }, objectRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop<\n Array<number>\n >(true, {\n dropSensitivity: 'immediate',\n type: ItemTypes.EDIT_FIELD,\n item: { index, label: value?.label, name },\n index,\n onMoveItem: onMoveField,\n });\n\n React.useEffect(() => {\n dragPreviewRef(getEmptyImage(), { captureDraggingState: false });\n }, [dragPreviewRef]);\n\n const composedRefs = useComposedRefs<HTMLSpanElement>(dragRef, objectRef);\n\n const handleRemoveField: React.MouseEventHandler<HTMLButtonElement> = (e) => {\n e.preventDefault();\n e.stopPropagation();\n onRemoveField(e);\n };\n\n const onEditFieldMeta: React.MouseEventHandler<HTMLButtonElement> = (e) => {\n e.preventDefault();\n e.stopPropagation();\n setIsModalOpen(true);\n };\n\n const tempRefs = useComposedRefs<HTMLSpanElement>(dropRef, objectRef);\n\n if (!value) {\n return null;\n }\n\n if (value.name === TEMP_FIELD_NAME) {\n return <Flex tag=\"span\" height=\"100%\" style={{ opacity: 0 }} ref={tempRefs} />;\n }\n\n return (\n <Modal.Root open={isModalOpen} onOpenChange={setIsModalOpen}>\n <Flex\n borderColor=\"neutral150\"\n background=\"neutral100\"\n hasRadius\n style={{ opacity: isDragging ? 0.5 : 1 }}\n ref={dropRef}\n gap={3}\n cursor=\"pointer\"\n onClick={() => {\n setIsModalOpen(true);\n }}\n >\n <DragButton\n tag=\"span\"\n withTooltip={false}\n label={formatMessage(\n {\n id: getTranslation('components.DraggableCard.move.field'),\n defaultMessage: 'Move {item}',\n },\n { item: value.label }\n )}\n onClick={(e) => e.stopPropagation()}\n ref={composedRefs}\n >\n <Drag />\n </DragButton>\n <Flex direction=\"column\" alignItems=\"flex-start\" grow={1} overflow=\"hidden\">\n <Flex gap={3} justifyContent=\"space-between\" width=\"100%\">\n <Typography ellipsis fontWeight=\"bold\">\n {value.label}\n </Typography>\n <Flex>\n <IconButton\n type=\"button\"\n variant=\"ghost\"\n background=\"transparent\"\n onClick={onEditFieldMeta}\n withTooltip={false}\n label={formatMessage(\n {\n id: getTranslation('components.DraggableCard.edit.field'),\n defaultMessage: 'Edit {item}',\n },\n { item: value.label }\n )}\n >\n <Pencil />\n </IconButton>\n <IconButton\n type=\"button\"\n variant=\"ghost\"\n onClick={handleRemoveField}\n background=\"transparent\"\n withTooltip={false}\n label={formatMessage(\n {\n id: getTranslation('components.DraggableCard.delete.field'),\n defaultMessage: 'Delete {item}',\n },\n { item: value.label }\n )}\n >\n <Cross />\n </IconButton>\n </Flex>\n </Flex>\n {attribute?.type === 'component' ? (\n <Flex\n paddingTop={3}\n paddingRight={3}\n paddingBottom={3}\n paddingLeft={0}\n alignItems=\"flex-start\"\n direction=\"column\"\n gap={2}\n width=\"100%\"\n >\n <Grid.Root gap={4} width=\"100%\">\n {components[attribute.component].layout.map((row) =>\n row.map(({ size, ...field }) => (\n <Grid.Item key={field.name} col={size} direction=\"column\" alignItems=\"stretch\">\n <Flex\n alignItems=\"center\"\n background=\"neutral0\"\n paddingTop={2}\n paddingBottom={2}\n paddingLeft={3}\n paddingRight={3}\n hasRadius\n borderColor=\"neutral200\"\n >\n <Typography textColor=\"neutral800\">{field.name}</Typography>\n </Flex>\n </Grid.Item>\n ))\n )}\n </Grid.Root>\n <Link\n // used to stop the edit form from appearing when we click here.\n onClick={(e) => e.stopPropagation()}\n startIcon={<Cog />}\n tag={NavLink}\n to={`../components/${attribute.component}/configurations/edit`}\n >\n {formatMessage({\n id: getTranslation('components.FieldItem.linkToComponentLayout'),\n defaultMessage: \"Set the component's layout\",\n })}\n </Link>\n </Flex>\n ) : null}\n {attribute?.type === 'dynamiczone' ? (\n <Flex\n paddingTop={3}\n paddingRight={3}\n paddingBottom={3}\n paddingLeft={0}\n alignItems=\"flex-start\"\n gap={2}\n width=\"100%\"\n >\n {attribute?.components.map((uid) => (\n <ComponentLink\n // used to stop the edit form from appearing when we click here.\n onClick={(e) => e.stopPropagation()}\n key={uid}\n to={`../components/${uid}/configurations/edit`}\n >\n <ComponentIcon icon={components[uid].settings.icon} />\n <Typography fontSize={1} textColor=\"neutral600\" fontWeight=\"bold\">\n {components[uid].settings.displayName}\n </Typography>\n </ComponentLink>\n ))}\n </Flex>\n ) : null}\n </Flex>\n </Flex>\n {value.name !== TEMP_FIELD_NAME && (\n <EditFieldForm attribute={attribute} name={name} onClose={() => setIsModalOpen(false)} />\n )}\n </Modal.Root>\n );\n};\n\nconst DragButton = styled<IconButtonComponent<'span'>>(IconButton)`\n height: unset;\n align-self: stretch;\n display: flex;\n align-items: center;\n padding: 0;\n border: none;\n background-color: transparent;\n border-radius: 0px;\n border-right: 1px solid ${({ theme }) => theme.colors.neutral150};\n cursor: all-scroll;\n\n svg {\n width: 1.2rem;\n height: 1.2rem;\n }\n`;\n\nconst ComponentLink = styled(NavLink)`\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: ${({ theme }) => theme.spaces[1]};\n padding: ${(props) => props.theme.spaces[2]};\n border: 1px solid ${({ theme }) => theme.colors.neutral200};\n background: ${({ theme }) => theme.colors.neutral0};\n width: 14rem;\n border-radius: ${({ theme }) => theme.borderRadius};\n text-decoration: none;\n\n &:focus,\n &:hover {\n ${({ theme }) => `\n background-color: ${theme.colors.primary100};\n border-color: ${theme.colors.primary200};\n\n ${Typography} {\n color: ${theme.colors.primary600};\n }\n `}\n\n /* > ComponentIcon */\n > div:first-child {\n background: ${({ theme }) => theme.colors.primary200};\n color: ${({ theme }) => theme.colors.primary600};\n\n svg {\n path {\n fill: ${({ theme }) => theme.colors.primary600};\n }\n }\n }\n }\n`;\n\nexport { Fields, TEMP_FIELD_NAME };\nexport type { FieldsProps };\n","import * as React from 'react';\n\nimport {\n Form,\n FormProps,\n useForm,\n InputRenderer,\n BackButton,\n Layouts,\n} from '@strapi/admin/strapi-admin';\nimport { Button, Divider, Flex, Grid, Main, Typography } from '@strapi/design-system';\nimport { generateNKeysBetween } from 'fractional-indexing';\nimport pipe from 'lodash/fp/pipe';\nimport { useIntl } from 'react-intl';\n\nimport { ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD } from '../../constants/attributes';\nimport { capitalise } from '../../utils/strings';\nimport { getTranslation } from '../../utils/translations';\n\nimport { Fields, FieldsProps, TEMP_FIELD_NAME } from './Fields';\n\nimport type { EditFieldLayout, EditLayout } from '../../hooks/useDocumentLayout';\n\n/* -------------------------------------------------------------------------------------------------\n * ConfigurationForm\n * -----------------------------------------------------------------------------------------------*/\n\ninterface ConfigurationFormProps extends Pick<FieldsProps, 'attributes' | 'fieldSizes'> {\n layout: EditLayout;\n onSubmit: FormProps<ConfigurationFormData>['onSubmit'];\n}\n\n/**\n * Every key in EditFieldLayout is turned to optional never and then we overwrite the ones we are using.\n */\n\ntype EditFieldSpacerLayout = {\n [key in keyof Omit<EditFieldLayout, 'name' | 'size'>]?: never;\n} & {\n description?: never;\n editable?: never;\n name: '_TEMP_';\n size: number;\n __temp_key__: string;\n};\n\ninterface ConfigurationFormData extends Pick<EditLayout, 'settings'> {\n layout: Array<{\n __temp_key__: string;\n children: Array<\n | (Pick<EditFieldLayout, 'label' | 'size' | 'name' | 'placeholder' | 'mainField'> & {\n description: EditFieldLayout['hint'];\n editable: EditFieldLayout['disabled'];\n __temp_key__: string;\n })\n | EditFieldSpacerLayout\n >;\n }>;\n}\n\nconst ConfigurationForm = ({\n attributes,\n fieldSizes,\n layout: editLayout,\n onSubmit,\n}: ConfigurationFormProps) => {\n const { components, settings, layout, metadatas } = editLayout;\n\n const { formatMessage } = useIntl();\n\n const initialValues: ConfigurationFormData = React.useMemo(() => {\n const transformations = pipe(\n flattenPanels,\n replaceMainFieldWithNameOnly,\n extractMetadata,\n addTmpSpaceToLayout,\n addTmpKeysToLayout\n );\n\n return {\n layout: transformations(layout),\n settings,\n };\n }, [layout, settings]);\n\n return (\n <Layouts.Root>\n <Main>\n <Form initialValues={initialValues} onSubmit={onSubmit} method=\"PUT\">\n <Header name={settings.displayName ?? ''} />\n <Layouts.Content>\n <Flex\n alignItems=\"stretch\"\n background=\"neutral0\"\n direction=\"column\"\n gap={6}\n hasRadius\n shadow=\"tableShadow\"\n paddingTop={6}\n paddingBottom={6}\n paddingLeft={7}\n paddingRight={7}\n >\n <Typography variant=\"delta\" tag=\"h2\">\n {formatMessage({\n id: getTranslation('containers.SettingPage.settings'),\n defaultMessage: 'Settings',\n })}\n </Typography>\n <Grid.Root>\n <Grid.Item col={6} s={12} direction=\"column\" alignItems=\"stretch\">\n <InputRenderer\n type=\"enumeration\"\n label={formatMessage({\n id: getTranslation('containers.SettingPage.editSettings.entry.title'),\n defaultMessage: 'Entry title',\n })}\n hint={formatMessage({\n id: getTranslation(\n 'containers.SettingPage.editSettings.entry.title.description'\n ),\n defaultMessage: 'Set the display field of your entry',\n })}\n name=\"settings.mainField\"\n options={Object.entries(attributes).reduce<\n Array<{ label: string; value: string }>\n >((acc, [key, attribute]) => {\n if (!attribute) {\n return acc;\n }\n\n /**\n * Create the list of attributes from the schema as to which can\n * be our `mainField` and dictate the display name of the schema\n * we're editing.\n */\n if (!ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD.includes(attribute.type)) {\n acc.push({\n label: key,\n value: key,\n });\n }\n\n return acc;\n }, [])}\n />\n </Grid.Item>\n <Grid.Item\n paddingTop={6}\n paddingBottom={6}\n col={12}\n s={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n <Divider />\n </Grid.Item>\n <Grid.Item col={12} s={12} direction=\"column\" alignItems=\"stretch\">\n <Typography variant=\"delta\" tag=\"h3\">\n {formatMessage({\n id: getTranslation('containers.SettingPage.view'),\n defaultMessage: 'View',\n })}\n </Typography>\n </Grid.Item>\n <Grid.Item col={12} s={12} direction=\"column\" alignItems=\"stretch\">\n <Fields\n attributes={attributes}\n components={components}\n fieldSizes={fieldSizes}\n metadatas={metadatas}\n />\n </Grid.Item>\n </Grid.Root>\n </Flex>\n </Layouts.Content>\n </Form>\n </Main>\n </Layouts.Root>\n );\n};\n\n/**\n * @internal\n * @description Panels don't exist in the layout, so we flatten by one.\n */\nconst flattenPanels = (layout: EditLayout['layout']): EditLayout['layout'][number] =>\n layout.flat(1);\n\n/**\n * @internal\n * @description We don't need the mainField object in the layout, we only need the name.\n */\nconst replaceMainFieldWithNameOnly = (layout: EditLayout['layout'][number]) =>\n layout.map((row) =>\n row.map((field) => ({\n ...field,\n mainField: field.mainField?.name,\n }))\n );\n\n/**\n * @internal\n * @description We extract the metadata values from the field layout, because these are editable by the user.\n */\nconst extractMetadata = (\n layout: EditLayout['layout'][number]\n): Array<Exclude<ConfigurationFormData['layout'], { name: '_TEMP_' }>[number]['children']> => {\n return layout.map((row) =>\n row.map(({ label, disabled, hint, placeholder, size, name, mainField }) => ({\n label,\n editable: !disabled,\n description: hint,\n mainField,\n placeholder,\n size,\n name,\n __temp_key__: '',\n }))\n );\n};\n\n/**\n * @internal\n * @description Each row of the layout has a max size of 12 (based on bootstrap grid system)\n * So in order to offer a better drop zone we add the _TEMP_ div to complete the remaining substract (12 - existing)\n */\nconst addTmpSpaceToLayout = (\n layout: ReturnType<typeof extractMetadata>\n): Array<ConfigurationFormData['layout'][number]['children']> => [\n ...layout.map((row) => {\n const totalSpaceTaken = row.reduce((acc, field) => acc + field.size, 0);\n\n if (totalSpaceTaken < 12) {\n return [\n ...row,\n {\n name: TEMP_FIELD_NAME,\n size: 12 - totalSpaceTaken,\n __temp_key__: '',\n } satisfies EditFieldSpacerLayout,\n ];\n }\n\n return row;\n }),\n];\n\n/**\n * @internal\n * @description At this point of the transformations we have Field[][], but each row for the form should have a __temp_key__\n * applied. This means we need to change it so `Field` is nested under the children property.\n */\nconst addTmpKeysToLayout = (\n layout: ReturnType<typeof addTmpSpaceToLayout>\n): ConfigurationFormData['layout'] => {\n const keys = generateNKeysBetween(undefined, undefined, layout.length);\n\n return layout.map((row, rowIndex) => {\n const fieldKeys = generateNKeysBetween(undefined, undefined, row.length);\n\n return {\n __temp_key__: keys[rowIndex],\n children: row.map((field, fieldIndex) => {\n return {\n ...field,\n __temp_key__: fieldKeys[fieldIndex],\n };\n }),\n };\n });\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Header\n * -----------------------------------------------------------------------------------------------*/\n\ninterface HeaderProps {\n name: string;\n}\n\nconst Header = ({ name }: HeaderProps) => {\n const { formatMessage } = useIntl();\n const modified = useForm('Header', (state) => state.modified);\n const isSubmitting = useForm('Header', (state) => state.isSubmitting);\n\n return (\n <Layouts.Header\n title={formatMessage(\n {\n id: getTranslation('components.SettingsViewWrapper.pluginHeader.title'),\n defaultMessage: `Configure the view - {name}`,\n },\n { name: capitalise(name) }\n )}\n subtitle={formatMessage({\n id: getTranslation('components.SettingsViewWrapper.pluginHeader.description.edit-settings'),\n defaultMessage: 'Customize how the edit view will look like.',\n })}\n navigationAction={<BackButton />}\n primaryAction={\n <Button disabled={!modified} loading={isSubmitting} type=\"submit\">\n {formatMessage({ id: 'global.save', defaultMessage: 'Save' })}\n </Button>\n }\n />\n );\n};\n\nexport { ConfigurationForm };\nexport type { ConfigurationFormProps, ConfigurationFormData, EditFieldSpacerLayout };\n"],"names":["attribute","field","generateNKeysBetweenImpl","generateNKeysBetween"],"mappings":";;;;;;;;;;;;;;;;AA0BA,MAAM,eAAe,IAAI,OAAO,EAAE,MAAM;AAAA,EACtC,OAAO,IAAI,OAAS,EAAA,SAAA,EAAW,SAAS;AAAA,EACxC,aAAa,IAAI,OAAO;AAAA,EACxB,UAAU,IAAI,QAAQ;AAAA,EACtB,MAAM,IAAI,OAAO,EAAE,SAAS;AAC9B,CAAC;AAYD,MAAM,gBAAgB,CAAC,EAAE,WAAW,MAAM,cAAkC;AACpE,QAAA,EAAE,cAAc,IAAI,QAAQ;AAC5B,QAAA,EAAE,mBAAmB,IAAI,gBAAgB;AAE/C,QAAM,EAAE,OAAO,aACb,SAAsE,IAAI;AAE5E,QAAM,EAAE,MAAM,iBAAiB,IAAI,uBAAuB,QAAW;AAAA,IACnE,kBAAkB,CAAC,QAAQ;AACzB,UAAI,WAAW,SAAS,cAAc,CAAC,IAAI,MAAM;AACxC,eAAA,EAAE,MAAM,GAAG;AAAA,MAAA;AAGpB,UAAI,iBAAiB,aAAa,OAAO,UAAU,gBAAgB,UAAU;AACrE,cAAA,eAAe,IAAI,KAAK,aAAa;AAAA,UACzC,CAAC,WAAW,OAAO,QAAQ,UAAU;AAAA,QACvC;AAEA,YAAI,cAAc;AACT,iBAAA;AAAA,YACL,MAAM,OAAO,QAAQ,aAAa,UAAU,EAAE,OAE5C,CAAC,KAAK,CAAC,KAAKA,UAAS,MAAM;AAM3B,kBAAI,CAAC,0CAA0C,SAASA,WAAU,IAAI,GAAG;AACvE,oBAAI,KAAK;AAAA,kBACP,OAAO;AAAA,kBACP,OAAO;AAAA,gBAAA,CACR;AAAA,cAAA;AAGI,qBAAA;AAAA,YAAA,GACN,CAAE,CAAA;AAAA,UACP;AAAA,QAAA;AAAA,MACF;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= require("fractional-indexing");
7
7
  const pipe = require("lodash/fp/pipe");
8
8
  const reactIntl = require("react-intl");
9
- const index = require("./index-C3fJE-1-.js");
9
+ const index = require("./index-BUWEmX8m.js");
10
10
  const Icons = require("@strapi/icons");
11
11
  const reactDndHtml5Backend = require("react-dnd-html5-backend");
12
12
  const reactRouterDom = require("react-router-dom");
13
13
  const styledComponents = require("styled-components");
14
- const useDragAndDrop = require("./useDragAndDrop-J0TUUbR6.js");
15
- const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
14
+ const useDragAndDrop = require("./useDragAndDrop-BMtgCYzL.js");
15
+ const ComponentIcon = require("./ComponentIcon-CRbtQEUV.js");
16
16
  const yup = require("yup");
17
17
  const FieldTypeIcon = require("./FieldTypeIcon-Dnwq_IRF.js");
18
18
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
19
19
  function _interopNamespace(e) {
20
- if (e && e.__esModule)
21
- return e;
20
+ if (e && e.__esModule) return e;
22
21
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
23
22
  if (e) {
24
23
  for (const k in e) {
@@ -38,7 +37,7 @@ const React__namespace = /* @__PURE__ */ _interopNamespace(React);
38
37
  const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
39
38
  const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
40
39
  const FIELD_SCHEMA = yup__namespace.object().shape({
41
- label: yup__namespace.string().required(),
40
+ label: yup__namespace.string().required().nullable(),
42
41
  description: yup__namespace.string(),
43
42
  editable: yup__namespace.boolean(),
44
43
  size: yup__namespace.number().required()
@@ -287,7 +286,10 @@ const Fields = ({ attributes, fieldSizes, components, metadatas = {} }) => {
287
286
  if (layout[rowIndex].children.length === 1) {
288
287
  removeFieldRow(`layout`, rowIndex);
289
288
  } else {
290
- onChange(`layout.${rowIndex}.children.${fieldIndex}`, void 0);
289
+ onChange(`layout.${rowIndex}.children`, [
290
+ ...layout[rowIndex].children.slice(0, fieldIndex),
291
+ ...layout[rowIndex].children.slice(fieldIndex + 1)
292
+ ]);
291
293
  }
292
294
  };
293
295
  const handleAddField = (field) => () => {
@@ -376,9 +378,15 @@ const Field = ({ attribute, components, name, index: index$1, onMoveField, onRem
376
378
  }, [dragPreviewRef]);
377
379
  const composedRefs = designSystem.useComposedRefs(dragRef, objectRef);
378
380
  const handleRemoveField = (e) => {
381
+ e.preventDefault();
379
382
  e.stopPropagation();
380
383
  onRemoveField(e);
381
384
  };
385
+ const onEditFieldMeta = (e) => {
386
+ e.preventDefault();
387
+ e.stopPropagation();
388
+ setIsModalOpen(true);
389
+ };
382
390
  const tempRefs = designSystem.useComposedRefs(dropRef, objectRef);
383
391
  if (!value) {
384
392
  return null;
@@ -425,12 +433,10 @@ const Field = ({ attribute, components, name, index: index$1, onMoveField, onRem
425
433
  /* @__PURE__ */ jsxRuntime.jsx(
426
434
  designSystem.IconButton,
427
435
  {
436
+ type: "button",
428
437
  variant: "ghost",
429
438
  background: "transparent",
430
- onClick: (e) => {
431
- e.stopPropagation();
432
- setIsModalOpen(true);
433
- },
439
+ onClick: onEditFieldMeta,
434
440
  withTooltip: false,
435
441
  label: formatMessage(
436
442
  {
@@ -445,6 +451,7 @@ const Field = ({ attribute, components, name, index: index$1, onMoveField, onRem
445
451
  /* @__PURE__ */ jsxRuntime.jsx(
446
452
  designSystem.IconButton,
447
453
  {
454
+ type: "button",
448
455
  variant: "ghost",
449
456
  onClick: handleRemoveField,
450
457
  background: "transparent",
@@ -768,4 +775,4 @@ const Header = ({ name }) => {
768
775
  };
769
776
  exports.ConfigurationForm = ConfigurationForm;
770
777
  exports.TEMP_FIELD_NAME = TEMP_FIELD_NAME;
771
- //# sourceMappingURL=Form-DGIf4jQU.js.map
778
+ //# sourceMappingURL=Form-D7mexvm3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Form-D7mexvm3.js","sources":["../../admin/src/components/ConfigurationForm/EditFieldForm.tsx","../../admin/src/components/ConfigurationForm/Fields.tsx","../../admin/src/components/ConfigurationForm/Form.tsx"],"sourcesContent":["import {\n useNotification,\n InputRenderer,\n Form,\n InputProps,\n useField,\n} from '@strapi/admin/strapi-admin';\nimport { Button, Flex, Grid, Modal } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport * as yup from 'yup';\n\nimport { ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD } from '../../constants/attributes';\nimport { useGetInitialDataQuery } from '../../services/init';\nimport { capitalise } from '../../utils/strings';\nimport { getTranslation } from '../../utils/translations';\nimport { FieldTypeIcon } from '../FieldTypeIcon';\n\nimport { TEMP_FIELD_NAME } from './Fields';\n\nimport type { ConfigurationFormData } from './Form';\nimport type { Schema } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * Constants\n * -----------------------------------------------------------------------------------------------*/\n\nconst FIELD_SCHEMA = yup.object().shape({\n label: yup.string().required().nullable(),\n description: yup.string(),\n editable: yup.boolean(),\n size: yup.number().required(),\n});\n\n/* -------------------------------------------------------------------------------------------------\n * EditFieldForm\n * -----------------------------------------------------------------------------------------------*/\n\ninterface EditFieldFormProps {\n attribute?: Schema.Attribute.AnyAttribute;\n name: string;\n onClose: () => void;\n}\n\nconst EditFieldForm = ({ attribute, name, onClose }: EditFieldFormProps) => {\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n\n const { value, onChange } =\n useField<ConfigurationFormData['layout'][number]['children'][number]>(name);\n\n const { data: mainFieldOptions } = useGetInitialDataQuery(undefined, {\n selectFromResult: (res) => {\n if (attribute?.type !== 'relation' || !res.data) {\n return { data: [] };\n }\n\n if ('targetModel' in attribute && typeof attribute.targetModel === 'string') {\n const targetSchema = res.data.contentTypes.find(\n (schema) => schema.uid === attribute.targetModel\n );\n\n if (targetSchema) {\n return {\n data: Object.entries(targetSchema.attributes).reduce<\n Array<{ label: string; value: string }>\n >((acc, [key, attribute]) => {\n /**\n * Create the list of attributes from the schema as to which can\n * be our `mainField` and dictate the display name of the schema\n * we're editing.\n */\n if (!ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD.includes(attribute.type)) {\n acc.push({\n label: key,\n value: key,\n });\n }\n\n return acc;\n }, []),\n };\n }\n }\n\n return { data: [] };\n },\n skip: attribute?.type !== 'relation',\n });\n\n if (!value || value.name === TEMP_FIELD_NAME || !attribute) {\n // This is very unlikely to happen, but it ensures the form is not opened without a value.\n console.error(\n \"You've opened a field to edit without it being part of the form, this is likely a bug with Strapi. Please open an issue.\"\n );\n\n toggleNotification({\n message: formatMessage({\n id: 'content-manager.containers.edit-settings.modal-form.error',\n defaultMessage: 'An error occurred while trying to open the form.',\n }),\n type: 'danger',\n });\n\n return null;\n }\n\n return (\n <Modal.Content>\n <Form\n method=\"PUT\"\n initialValues={value}\n validationSchema={FIELD_SCHEMA}\n onSubmit={(data) => {\n onChange(name, data);\n onClose();\n }}\n >\n <Modal.Header>\n <Flex gap={3}>\n <FieldTypeIcon type={attribute.type} />\n <Modal.Title>\n {formatMessage(\n {\n id: 'content-manager.containers.edit-settings.modal-form.label',\n defaultMessage: 'Edit {fieldName}',\n },\n { fieldName: capitalise(value.name) }\n )}\n </Modal.Title>\n </Flex>\n </Modal.Header>\n <Modal.Body>\n <Grid.Root gap={4}>\n {[\n {\n name: 'label',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.label'),\n defaultMessage: 'Label',\n }),\n size: 6,\n type: 'string' as const,\n },\n {\n name: 'description',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.description'),\n defaultMessage: 'Description',\n }),\n size: 6,\n type: 'string' as const,\n },\n {\n name: 'placeholder',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.placeholder'),\n defaultMessage: 'Placeholder',\n }),\n size: 6,\n type: 'string' as const,\n },\n {\n name: 'editable',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.editable'),\n defaultMessage: 'Editable',\n }),\n size: 6,\n type: 'boolean' as const,\n },\n {\n name: 'mainField',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.mainField'),\n defaultMessage: 'Entry title',\n }),\n hint: formatMessage({\n id: getTranslation(\n 'containers.SettingPage.edit-settings.modal-form.mainField.hint'\n ),\n defaultMessage: 'Set the displayed field',\n }),\n size: 6,\n options: mainFieldOptions,\n type: 'enumeration' as const,\n },\n {\n name: 'size',\n label: formatMessage({\n id: getTranslation('containers.ListSettingsView.modal-form.size'),\n defaultMessage: 'Size',\n }),\n size: 6,\n options: [\n { value: '4', label: '33%' },\n { value: '6', label: '50%' },\n { value: '8', label: '66%' },\n { value: '12', label: '100%' },\n ],\n type: 'enumeration' as const,\n },\n ]\n .filter(filterFieldsBasedOnAttributeType(attribute.type))\n .map(({ size, ...field }) => (\n <Grid.Item key={field.name} col={size} direction=\"column\" alignItems=\"stretch\">\n <InputRenderer {...field} />\n </Grid.Item>\n ))}\n </Grid.Root>\n </Modal.Body>\n <Modal.Footer>\n <Modal.Close>\n <Button variant=\"tertiary\">\n {formatMessage({ id: 'app.components.Button.cancel', defaultMessage: 'Cancel' })}\n </Button>\n </Modal.Close>\n <Button type=\"submit\">\n {formatMessage({ id: 'global.finish', defaultMessage: 'Finish' })}\n </Button>\n </Modal.Footer>\n </Form>\n </Modal.Content>\n );\n};\n\n/**\n * @internal\n * @description not all edit fields have the same editable properties, it depends on the type\n * e.g. a dynamic zone can only change it's label.\n */\nconst filterFieldsBasedOnAttributeType = (type: Schema.Attribute.Kind) => (field: InputProps) => {\n switch (type) {\n case 'blocks':\n case 'richtext':\n return field.name !== 'size' && field.name !== 'mainField';\n case 'boolean':\n case 'media':\n return field.name !== 'placeholder' && field.name !== 'mainField';\n case 'component':\n case 'dynamiczone':\n return field.name === 'label' || field.name === 'editable';\n case 'json':\n return field.name !== 'placeholder' && field.name !== 'mainField' && field.name !== 'size';\n case 'relation':\n return true;\n default:\n return field.name !== 'mainField';\n }\n};\n\nexport { EditFieldForm };\nexport type { EditFieldFormProps };\n","import * as React from 'react';\n\nimport { useField, useForm } from '@strapi/admin/strapi-admin';\nimport {\n Modal,\n Box,\n Flex,\n Grid,\n IconButton,\n IconButtonComponent,\n Typography,\n useComposedRefs,\n Link,\n Menu,\n} from '@strapi/design-system';\nimport { Cog, Cross, Drag, Pencil, Plus } from '@strapi/icons';\nimport { generateNKeysBetween as generateNKeysBetweenImpl } from 'fractional-indexing';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { ItemTypes } from '../../constants/dragAndDrop';\nimport { type UseDragAndDropOptions, useDragAndDrop } from '../../hooks/useDragAndDrop';\nimport { getTranslation } from '../../utils/translations';\nimport { ComponentIcon } from '../ComponentIcon';\n\nimport { EditFieldForm, EditFieldFormProps } from './EditFieldForm';\n\nimport type { ConfigurationFormData, EditFieldSpacerLayout } from './Form';\nimport type { EditLayout } from '../../hooks/useDocumentLayout';\n\ntype FormField = ConfigurationFormData['layout'][number]['children'][number];\ntype Field = Omit<ConfigurationFormData['layout'][number]['children'][number], '__temp_key__'>;\n\n/* -------------------------------------------------------------------------------------------------\n * Fields\n * -----------------------------------------------------------------------------------------------*/\n\ninterface FieldsProps extends Pick<EditLayout, 'metadatas'>, Pick<FieldProps, 'components'> {\n attributes: {\n [key: string]: FieldProps['attribute'];\n };\n fieldSizes: Record<string, number>;\n components: EditLayout['components'];\n}\n\nconst Fields = ({ attributes, fieldSizes, components, metadatas = {} }: FieldsProps) => {\n const { formatMessage } = useIntl();\n\n const layout = useForm<ConfigurationFormData['layout']>(\n 'Fields',\n (state) => state.values.layout ?? []\n );\n const onChange = useForm('Fields', (state) => state.onChange);\n const addFieldRow = useForm('Fields', (state) => state.addFieldRow);\n const removeFieldRow = useForm('Fields', (state) => state.removeFieldRow);\n\n const existingFields = layout.map((row) => row.children.map((field) => field.name)).flat();\n\n /**\n * Get the fields that are not already in the layout\n * But also check that they are visible before we give users\n * the option to display them. e.g. `id` is not visible.\n */\n const remainingFields = Object.entries(metadatas).reduce<Field[]>((acc, current) => {\n const [name, { visible, ...field }] = current;\n\n if (!existingFields.includes(name) && visible === true) {\n const type = attributes[name]?.type;\n const size = type ? fieldSizes[type] : 12;\n\n acc.push({\n ...field,\n label: field.label ?? name,\n name,\n size,\n });\n }\n\n return acc;\n }, []);\n\n const handleMoveField: FieldProps['onMoveField'] = (\n [newRowIndex, newFieldIndex],\n [currentRowIndex, currentFieldIndex]\n ) => {\n /**\n * Because this view has the constraint that the sum of field sizes cannot be greater\n * than 12, we don't use the form's method to move field rows, instead, we calculate\n * the new layout and set the entire form.\n */\n const newLayout = structuredClone(layout);\n\n /**\n * Remove field from the current layout space using splice so we have the item\n */\n const [field] = newLayout[currentRowIndex].children.splice(currentFieldIndex, 1);\n\n if (!field || field.name === TEMP_FIELD_NAME) {\n return;\n }\n\n const newRow = newLayout[newRowIndex].children;\n const [newFieldKey] = generateNKeysBetween(newRow, 1, currentFieldIndex, newFieldIndex);\n\n /**\n * Next we inject the field into it's new row at it's specified index, we then remove the spaces\n * if they exist and recalculate into potentially two arrays ONLY if the sizing is now over 12,\n * the row and the rest of the row that couldn't fit.\n *\n * for example, if i have a row of `[{size: 4}, {size: 6}]` and i add `{size: 8}` a index 0,\n * the new array will look like `[{size: 8}, {size: 4}, {size: 6}]` which breaks the limit of 12,\n * so instead we make two arrays for the new rows `[[{size: 8}, {size: 4}], [{size: 6}]]` which we\n * then inject at the original row point with spacers included.\n */\n newRow.splice(newFieldIndex, 0, { ...field, __temp_key__: newFieldKey });\n\n if (newLayout[newRowIndex].children.reduce((acc, curr) => acc + curr.size, 0) > 12) {\n const recalculatedRows = chunkArray(\n newLayout[newRowIndex].children.filter((field) => field.name !== TEMP_FIELD_NAME)\n );\n\n const rowKeys = generateNKeysBetween(\n newLayout,\n recalculatedRows.length,\n currentRowIndex,\n newRowIndex\n );\n\n newLayout.splice(\n newRowIndex,\n 1,\n ...recalculatedRows.map((row, index) => ({\n __temp_key__: rowKeys[index],\n children: row,\n }))\n );\n }\n\n /**\n * Now we remove our spacers from the rows so we can understand what dead rows exist:\n * - if there's only spacers left\n * - there's nothing in the row, e.g. a size 12 field left it.\n * These rows are then filtered out.\n * After that, we recalculate the spacers for the rows that need them.\n */\n const newLayoutWithSpacers = newLayout\n .map((row) => ({\n ...row,\n children: row.children.filter((field) => field.name !== TEMP_FIELD_NAME),\n }))\n .filter((row) => row.children.length > 0)\n .map((row) => {\n const totalSpaceTaken = row.children.reduce((acc, curr) => acc + curr.size, 0);\n\n if (totalSpaceTaken < 12) {\n const [spacerKey] = generateNKeysBetweenImpl(\n row.children.at(-1)?.__temp_key__,\n undefined,\n 1\n );\n\n return {\n ...row,\n children: [\n ...row.children,\n {\n name: TEMP_FIELD_NAME,\n size: 12 - totalSpaceTaken,\n __temp_key__: spacerKey,\n } satisfies EditFieldSpacerLayout,\n ],\n };\n }\n\n return row;\n });\n\n onChange('layout', newLayoutWithSpacers);\n };\n\n const handleRemoveField =\n (rowIndex: number, fieldIndex: number): FieldProps['onRemoveField'] =>\n () => {\n if (layout[rowIndex].children.length === 1) {\n removeFieldRow(`layout`, rowIndex);\n } else {\n onChange(`layout.${rowIndex}.children`, [\n ...layout[rowIndex].children.slice(0, fieldIndex),\n ...layout[rowIndex].children.slice(fieldIndex + 1),\n ]);\n }\n };\n\n const handleAddField = (field: Field) => () => {\n addFieldRow('layout', { children: [field] });\n };\n\n return (\n <Flex paddingTop={6} direction=\"column\" alignItems=\"stretch\" gap={4}>\n <Flex alignItems=\"flex-start\" direction=\"column\" justifyContent=\"space-between\">\n <Typography fontWeight=\"bold\">\n {formatMessage({\n id: getTranslation('containers.list.displayedFields'),\n defaultMessage: 'Displayed fields',\n })}\n </Typography>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {formatMessage({\n id: 'containers.SettingPage.editSettings.description',\n defaultMessage: 'Drag & drop the fields to build the layout',\n })}\n </Typography>\n </Flex>\n <Box padding={4} hasRadius borderStyle=\"dashed\" borderWidth=\"1px\" borderColor=\"neutral300\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={2}>\n {layout.map((row, rowIndex) => (\n <Grid.Root gap={2} key={row.__temp_key__}>\n {row.children.map(({ size, ...field }, fieldIndex) => (\n <Grid.Item key={field.name} col={size} direction=\"column\" alignItems=\"stretch\">\n <Field\n attribute={attributes[field.name]}\n components={components}\n index={[rowIndex, fieldIndex]}\n name={`layout.${rowIndex}.children.${fieldIndex}`}\n onMoveField={handleMoveField}\n onRemoveField={handleRemoveField(rowIndex, fieldIndex)}\n />\n </Grid.Item>\n ))}\n </Grid.Root>\n ))}\n <Menu.Root>\n <Menu.Trigger\n startIcon={<Plus />}\n endIcon={null}\n disabled={remainingFields.length === 0}\n fullWidth\n variant=\"secondary\"\n >\n {formatMessage({\n id: getTranslation('containers.SettingPage.add.field'),\n defaultMessage: 'Insert another field',\n })}\n </Menu.Trigger>\n <Menu.Content>\n {remainingFields.map((field) => (\n <Menu.Item key={field.name} onSelect={handleAddField(field)}>\n {field.label}\n </Menu.Item>\n ))}\n </Menu.Content>\n </Menu.Root>\n </Flex>\n </Box>\n </Flex>\n );\n};\n\n/**\n * @internal\n * @description Small abstraction to solve within an array of fields where you can\n * add a field to the beginning or start, move back and forth what it's index range\n * should be when calculating it's new temp key\n */\nconst generateNKeysBetween = <Field extends { __temp_key__: string }>(\n field: Field[],\n count: number,\n currInd: number,\n newInd: number\n) => {\n const startKey = currInd > newInd ? field[newInd - 1]?.__temp_key__ : field[newInd]?.__temp_key__;\n const endKey = currInd > newInd ? field[newInd]?.__temp_key__ : field[newInd + 1]?.__temp_key__;\n\n return generateNKeysBetweenImpl(startKey, endKey, count);\n};\n\n/**\n * @internal\n * @description chunks a row of layouts by the max size we allow, 12. It does not add the\n * spacers again, that should be added separately.\n */\nconst chunkArray = (array: FormField[]) => {\n const result: Array<FormField[]> = [];\n let temp: FormField[] = [];\n\n array.reduce((acc, field) => {\n if (acc + field.size > 12) {\n result.push(temp);\n temp = [field];\n return field.size;\n } else {\n temp.push(field);\n return acc + field.size;\n }\n }, 0);\n\n if (temp.length > 0) {\n result.push(temp);\n }\n\n return result;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Field\n * -----------------------------------------------------------------------------------------------*/\n\ninterface FieldProps extends Pick<EditFieldFormProps, 'name' | 'attribute'> {\n components: EditLayout['components'];\n index: [row: number, index: number];\n onMoveField: UseDragAndDropOptions<number[]>['onMoveItem'];\n onRemoveField: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nconst TEMP_FIELD_NAME = '_TEMP_';\n\n/**\n * Displays a field in the layout with drag options, also\n * opens a modal to edit the details of said field.\n */\nconst Field = ({ attribute, components, name, index, onMoveField, onRemoveField }: FieldProps) => {\n const [isModalOpen, setIsModalOpen] = React.useState(false);\n const { formatMessage } = useIntl();\n\n const { value } = useField<FormField>(name);\n\n const [{ isDragging }, objectRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop<\n Array<number>\n >(true, {\n dropSensitivity: 'immediate',\n type: ItemTypes.EDIT_FIELD,\n item: { index, label: value?.label, name },\n index,\n onMoveItem: onMoveField,\n });\n\n React.useEffect(() => {\n dragPreviewRef(getEmptyImage(), { captureDraggingState: false });\n }, [dragPreviewRef]);\n\n const composedRefs = useComposedRefs<HTMLSpanElement>(dragRef, objectRef);\n\n const handleRemoveField: React.MouseEventHandler<HTMLButtonElement> = (e) => {\n e.preventDefault();\n e.stopPropagation();\n onRemoveField(e);\n };\n\n const onEditFieldMeta: React.MouseEventHandler<HTMLButtonElement> = (e) => {\n e.preventDefault();\n e.stopPropagation();\n setIsModalOpen(true);\n };\n\n const tempRefs = useComposedRefs<HTMLSpanElement>(dropRef, objectRef);\n\n if (!value) {\n return null;\n }\n\n if (value.name === TEMP_FIELD_NAME) {\n return <Flex tag=\"span\" height=\"100%\" style={{ opacity: 0 }} ref={tempRefs} />;\n }\n\n return (\n <Modal.Root open={isModalOpen} onOpenChange={setIsModalOpen}>\n <Flex\n borderColor=\"neutral150\"\n background=\"neutral100\"\n hasRadius\n style={{ opacity: isDragging ? 0.5 : 1 }}\n ref={dropRef}\n gap={3}\n cursor=\"pointer\"\n onClick={() => {\n setIsModalOpen(true);\n }}\n >\n <DragButton\n tag=\"span\"\n withTooltip={false}\n label={formatMessage(\n {\n id: getTranslation('components.DraggableCard.move.field'),\n defaultMessage: 'Move {item}',\n },\n { item: value.label }\n )}\n onClick={(e) => e.stopPropagation()}\n ref={composedRefs}\n >\n <Drag />\n </DragButton>\n <Flex direction=\"column\" alignItems=\"flex-start\" grow={1} overflow=\"hidden\">\n <Flex gap={3} justifyContent=\"space-between\" width=\"100%\">\n <Typography ellipsis fontWeight=\"bold\">\n {value.label}\n </Typography>\n <Flex>\n <IconButton\n type=\"button\"\n variant=\"ghost\"\n background=\"transparent\"\n onClick={onEditFieldMeta}\n withTooltip={false}\n label={formatMessage(\n {\n id: getTranslation('components.DraggableCard.edit.field'),\n defaultMessage: 'Edit {item}',\n },\n { item: value.label }\n )}\n >\n <Pencil />\n </IconButton>\n <IconButton\n type=\"button\"\n variant=\"ghost\"\n onClick={handleRemoveField}\n background=\"transparent\"\n withTooltip={false}\n label={formatMessage(\n {\n id: getTranslation('components.DraggableCard.delete.field'),\n defaultMessage: 'Delete {item}',\n },\n { item: value.label }\n )}\n >\n <Cross />\n </IconButton>\n </Flex>\n </Flex>\n {attribute?.type === 'component' ? (\n <Flex\n paddingTop={3}\n paddingRight={3}\n paddingBottom={3}\n paddingLeft={0}\n alignItems=\"flex-start\"\n direction=\"column\"\n gap={2}\n width=\"100%\"\n >\n <Grid.Root gap={4} width=\"100%\">\n {components[attribute.component].layout.map((row) =>\n row.map(({ size, ...field }) => (\n <Grid.Item key={field.name} col={size} direction=\"column\" alignItems=\"stretch\">\n <Flex\n alignItems=\"center\"\n background=\"neutral0\"\n paddingTop={2}\n paddingBottom={2}\n paddingLeft={3}\n paddingRight={3}\n hasRadius\n borderColor=\"neutral200\"\n >\n <Typography textColor=\"neutral800\">{field.name}</Typography>\n </Flex>\n </Grid.Item>\n ))\n )}\n </Grid.Root>\n <Link\n // used to stop the edit form from appearing when we click here.\n onClick={(e) => e.stopPropagation()}\n startIcon={<Cog />}\n tag={NavLink}\n to={`../components/${attribute.component}/configurations/edit`}\n >\n {formatMessage({\n id: getTranslation('components.FieldItem.linkToComponentLayout'),\n defaultMessage: \"Set the component's layout\",\n })}\n </Link>\n </Flex>\n ) : null}\n {attribute?.type === 'dynamiczone' ? (\n <Flex\n paddingTop={3}\n paddingRight={3}\n paddingBottom={3}\n paddingLeft={0}\n alignItems=\"flex-start\"\n gap={2}\n width=\"100%\"\n >\n {attribute?.components.map((uid) => (\n <ComponentLink\n // used to stop the edit form from appearing when we click here.\n onClick={(e) => e.stopPropagation()}\n key={uid}\n to={`../components/${uid}/configurations/edit`}\n >\n <ComponentIcon icon={components[uid].settings.icon} />\n <Typography fontSize={1} textColor=\"neutral600\" fontWeight=\"bold\">\n {components[uid].settings.displayName}\n </Typography>\n </ComponentLink>\n ))}\n </Flex>\n ) : null}\n </Flex>\n </Flex>\n {value.name !== TEMP_FIELD_NAME && (\n <EditFieldForm attribute={attribute} name={name} onClose={() => setIsModalOpen(false)} />\n )}\n </Modal.Root>\n );\n};\n\nconst DragButton = styled<IconButtonComponent<'span'>>(IconButton)`\n height: unset;\n align-self: stretch;\n display: flex;\n align-items: center;\n padding: 0;\n border: none;\n background-color: transparent;\n border-radius: 0px;\n border-right: 1px solid ${({ theme }) => theme.colors.neutral150};\n cursor: all-scroll;\n\n svg {\n width: 1.2rem;\n height: 1.2rem;\n }\n`;\n\nconst ComponentLink = styled(NavLink)`\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: ${({ theme }) => theme.spaces[1]};\n padding: ${(props) => props.theme.spaces[2]};\n border: 1px solid ${({ theme }) => theme.colors.neutral200};\n background: ${({ theme }) => theme.colors.neutral0};\n width: 14rem;\n border-radius: ${({ theme }) => theme.borderRadius};\n text-decoration: none;\n\n &:focus,\n &:hover {\n ${({ theme }) => `\n background-color: ${theme.colors.primary100};\n border-color: ${theme.colors.primary200};\n\n ${Typography} {\n color: ${theme.colors.primary600};\n }\n `}\n\n /* > ComponentIcon */\n > div:first-child {\n background: ${({ theme }) => theme.colors.primary200};\n color: ${({ theme }) => theme.colors.primary600};\n\n svg {\n path {\n fill: ${({ theme }) => theme.colors.primary600};\n }\n }\n }\n }\n`;\n\nexport { Fields, TEMP_FIELD_NAME };\nexport type { FieldsProps };\n","import * as React from 'react';\n\nimport {\n Form,\n FormProps,\n useForm,\n InputRenderer,\n BackButton,\n Layouts,\n} from '@strapi/admin/strapi-admin';\nimport { Button, Divider, Flex, Grid, Main, Typography } from '@strapi/design-system';\nimport { generateNKeysBetween } from 'fractional-indexing';\nimport pipe from 'lodash/fp/pipe';\nimport { useIntl } from 'react-intl';\n\nimport { ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD } from '../../constants/attributes';\nimport { capitalise } from '../../utils/strings';\nimport { getTranslation } from '../../utils/translations';\n\nimport { Fields, FieldsProps, TEMP_FIELD_NAME } from './Fields';\n\nimport type { EditFieldLayout, EditLayout } from '../../hooks/useDocumentLayout';\n\n/* -------------------------------------------------------------------------------------------------\n * ConfigurationForm\n * -----------------------------------------------------------------------------------------------*/\n\ninterface ConfigurationFormProps extends Pick<FieldsProps, 'attributes' | 'fieldSizes'> {\n layout: EditLayout;\n onSubmit: FormProps<ConfigurationFormData>['onSubmit'];\n}\n\n/**\n * Every key in EditFieldLayout is turned to optional never and then we overwrite the ones we are using.\n */\n\ntype EditFieldSpacerLayout = {\n [key in keyof Omit<EditFieldLayout, 'name' | 'size'>]?: never;\n} & {\n description?: never;\n editable?: never;\n name: '_TEMP_';\n size: number;\n __temp_key__: string;\n};\n\ninterface ConfigurationFormData extends Pick<EditLayout, 'settings'> {\n layout: Array<{\n __temp_key__: string;\n children: Array<\n | (Pick<EditFieldLayout, 'label' | 'size' | 'name' | 'placeholder' | 'mainField'> & {\n description: EditFieldLayout['hint'];\n editable: EditFieldLayout['disabled'];\n __temp_key__: string;\n })\n | EditFieldSpacerLayout\n >;\n }>;\n}\n\nconst ConfigurationForm = ({\n attributes,\n fieldSizes,\n layout: editLayout,\n onSubmit,\n}: ConfigurationFormProps) => {\n const { components, settings, layout, metadatas } = editLayout;\n\n const { formatMessage } = useIntl();\n\n const initialValues: ConfigurationFormData = React.useMemo(() => {\n const transformations = pipe(\n flattenPanels,\n replaceMainFieldWithNameOnly,\n extractMetadata,\n addTmpSpaceToLayout,\n addTmpKeysToLayout\n );\n\n return {\n layout: transformations(layout),\n settings,\n };\n }, [layout, settings]);\n\n return (\n <Layouts.Root>\n <Main>\n <Form initialValues={initialValues} onSubmit={onSubmit} method=\"PUT\">\n <Header name={settings.displayName ?? ''} />\n <Layouts.Content>\n <Flex\n alignItems=\"stretch\"\n background=\"neutral0\"\n direction=\"column\"\n gap={6}\n hasRadius\n shadow=\"tableShadow\"\n paddingTop={6}\n paddingBottom={6}\n paddingLeft={7}\n paddingRight={7}\n >\n <Typography variant=\"delta\" tag=\"h2\">\n {formatMessage({\n id: getTranslation('containers.SettingPage.settings'),\n defaultMessage: 'Settings',\n })}\n </Typography>\n <Grid.Root>\n <Grid.Item col={6} s={12} direction=\"column\" alignItems=\"stretch\">\n <InputRenderer\n type=\"enumeration\"\n label={formatMessage({\n id: getTranslation('containers.SettingPage.editSettings.entry.title'),\n defaultMessage: 'Entry title',\n })}\n hint={formatMessage({\n id: getTranslation(\n 'containers.SettingPage.editSettings.entry.title.description'\n ),\n defaultMessage: 'Set the display field of your entry',\n })}\n name=\"settings.mainField\"\n options={Object.entries(attributes).reduce<\n Array<{ label: string; value: string }>\n >((acc, [key, attribute]) => {\n if (!attribute) {\n return acc;\n }\n\n /**\n * Create the list of attributes from the schema as to which can\n * be our `mainField` and dictate the display name of the schema\n * we're editing.\n */\n if (!ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD.includes(attribute.type)) {\n acc.push({\n label: key,\n value: key,\n });\n }\n\n return acc;\n }, [])}\n />\n </Grid.Item>\n <Grid.Item\n paddingTop={6}\n paddingBottom={6}\n col={12}\n s={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n <Divider />\n </Grid.Item>\n <Grid.Item col={12} s={12} direction=\"column\" alignItems=\"stretch\">\n <Typography variant=\"delta\" tag=\"h3\">\n {formatMessage({\n id: getTranslation('containers.SettingPage.view'),\n defaultMessage: 'View',\n })}\n </Typography>\n </Grid.Item>\n <Grid.Item col={12} s={12} direction=\"column\" alignItems=\"stretch\">\n <Fields\n attributes={attributes}\n components={components}\n fieldSizes={fieldSizes}\n metadatas={metadatas}\n />\n </Grid.Item>\n </Grid.Root>\n </Flex>\n </Layouts.Content>\n </Form>\n </Main>\n </Layouts.Root>\n );\n};\n\n/**\n * @internal\n * @description Panels don't exist in the layout, so we flatten by one.\n */\nconst flattenPanels = (layout: EditLayout['layout']): EditLayout['layout'][number] =>\n layout.flat(1);\n\n/**\n * @internal\n * @description We don't need the mainField object in the layout, we only need the name.\n */\nconst replaceMainFieldWithNameOnly = (layout: EditLayout['layout'][number]) =>\n layout.map((row) =>\n row.map((field) => ({\n ...field,\n mainField: field.mainField?.name,\n }))\n );\n\n/**\n * @internal\n * @description We extract the metadata values from the field layout, because these are editable by the user.\n */\nconst extractMetadata = (\n layout: EditLayout['layout'][number]\n): Array<Exclude<ConfigurationFormData['layout'], { name: '_TEMP_' }>[number]['children']> => {\n return layout.map((row) =>\n row.map(({ label, disabled, hint, placeholder, size, name, mainField }) => ({\n label,\n editable: !disabled,\n description: hint,\n mainField,\n placeholder,\n size,\n name,\n __temp_key__: '',\n }))\n );\n};\n\n/**\n * @internal\n * @description Each row of the layout has a max size of 12 (based on bootstrap grid system)\n * So in order to offer a better drop zone we add the _TEMP_ div to complete the remaining substract (12 - existing)\n */\nconst addTmpSpaceToLayout = (\n layout: ReturnType<typeof extractMetadata>\n): Array<ConfigurationFormData['layout'][number]['children']> => [\n ...layout.map((row) => {\n const totalSpaceTaken = row.reduce((acc, field) => acc + field.size, 0);\n\n if (totalSpaceTaken < 12) {\n return [\n ...row,\n {\n name: TEMP_FIELD_NAME,\n size: 12 - totalSpaceTaken,\n __temp_key__: '',\n } satisfies EditFieldSpacerLayout,\n ];\n }\n\n return row;\n }),\n];\n\n/**\n * @internal\n * @description At this point of the transformations we have Field[][], but each row for the form should have a __temp_key__\n * applied. This means we need to change it so `Field` is nested under the children property.\n */\nconst addTmpKeysToLayout = (\n layout: ReturnType<typeof addTmpSpaceToLayout>\n): ConfigurationFormData['layout'] => {\n const keys = generateNKeysBetween(undefined, undefined, layout.length);\n\n return layout.map((row, rowIndex) => {\n const fieldKeys = generateNKeysBetween(undefined, undefined, row.length);\n\n return {\n __temp_key__: keys[rowIndex],\n children: row.map((field, fieldIndex) => {\n return {\n ...field,\n __temp_key__: fieldKeys[fieldIndex],\n };\n }),\n };\n });\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Header\n * -----------------------------------------------------------------------------------------------*/\n\ninterface HeaderProps {\n name: string;\n}\n\nconst Header = ({ name }: HeaderProps) => {\n const { formatMessage } = useIntl();\n const modified = useForm('Header', (state) => state.modified);\n const isSubmitting = useForm('Header', (state) => state.isSubmitting);\n\n return (\n <Layouts.Header\n title={formatMessage(\n {\n id: getTranslation('components.SettingsViewWrapper.pluginHeader.title'),\n defaultMessage: `Configure the view - {name}`,\n },\n { name: capitalise(name) }\n )}\n subtitle={formatMessage({\n id: getTranslation('components.SettingsViewWrapper.pluginHeader.description.edit-settings'),\n defaultMessage: 'Customize how the edit view will look like.',\n })}\n navigationAction={<BackButton />}\n primaryAction={\n <Button disabled={!modified} loading={isSubmitting} type=\"submit\">\n {formatMessage({ id: 'global.save', defaultMessage: 'Save' })}\n </Button>\n }\n />\n );\n};\n\nexport { ConfigurationForm };\nexport type { ConfigurationFormProps, ConfigurationFormData, EditFieldSpacerLayout };\n"],"names":["yup","useIntl","useNotification","useField","useGetInitialDataQuery","attribute","ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD","jsx","Modal","jsxs","Form","Flex","FieldTypeIcon","capitalise","Grid","getTranslation","InputRenderer","Button","useForm","field","index","generateNKeysBetweenImpl","Typography","Box","Menu","Plus","React","useDragAndDrop","ItemTypes","getEmptyImage","useComposedRefs","Drag","IconButton","Pencil","Cross","Link","Cog","NavLink","ComponentIcon","styled","pipe","Layouts","Main","Divider","generateNKeysBetween","BackButton"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAM,eAAeA,eAAI,OAAO,EAAE,MAAM;AAAA,EACtC,OAAOA,eAAI,OAAS,EAAA,SAAA,EAAW,SAAS;AAAA,EACxC,aAAaA,eAAI,OAAO;AAAA,EACxB,UAAUA,eAAI,QAAQ;AAAA,EACtB,MAAMA,eAAI,OAAO,EAAE,SAAS;AAC9B,CAAC;AAYD,MAAM,gBAAgB,CAAC,EAAE,WAAW,MAAM,cAAkC;AACpE,QAAA,EAAE,cAAc,IAAIC,kBAAQ;AAC5B,QAAA,EAAE,mBAAmB,IAAIC,4BAAgB;AAE/C,QAAM,EAAE,OAAO,aACbC,YAAAA,SAAsE,IAAI;AAE5E,QAAM,EAAE,MAAM,iBAAiB,IAAIC,6BAAuB,QAAW;AAAA,IACnE,kBAAkB,CAAC,QAAQ;AACzB,UAAI,WAAW,SAAS,cAAc,CAAC,IAAI,MAAM;AACxC,eAAA,EAAE,MAAM,GAAG;AAAA,MAAA;AAGpB,UAAI,iBAAiB,aAAa,OAAO,UAAU,gBAAgB,UAAU;AACrE,cAAA,eAAe,IAAI,KAAK,aAAa;AAAA,UACzC,CAAC,WAAW,OAAO,QAAQ,UAAU;AAAA,QACvC;AAEA,YAAI,cAAc;AACT,iBAAA;AAAA,YACL,MAAM,OAAO,QAAQ,aAAa,UAAU,EAAE,OAE5C,CAAC,KAAK,CAAC,KAAKC,UAAS,MAAM;AAM3B,kBAAI,CAACC,MAAAA,0CAA0C,SAASD,WAAU,IAAI,GAAG;AACvE,oBAAI,KAAK;AAAA,kBACP,OAAO;A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