@strapi/content-manager 0.0.0-experimental.f0a0bc26f5ef0693aaea2a616bc6b816cfee54b6 → 0.0.0-experimental.f0ae22a92ff2c56127a7f843a3e973c934c1aab4

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 (468) hide show
  1. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs +80 -0
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs.map +1 -0
  3. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js +82 -0
  4. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js.map +1 -0
  5. package/dist/admin/chunks/ComponentConfigurationPage-Cgjg4CQj.js +299 -0
  6. package/dist/admin/chunks/ComponentConfigurationPage-Cgjg4CQj.js.map +1 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-D6mjS3eX.mjs +277 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-D6mjS3eX.mjs.map +1 -0
  9. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs +153 -0
  10. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs.map +1 -0
  11. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js +176 -0
  12. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js.map +1 -0
  13. package/dist/admin/chunks/EditConfigurationPage-C5E6D6NI.js +181 -0
  14. package/dist/admin/chunks/EditConfigurationPage-C5E6D6NI.js.map +1 -0
  15. package/dist/admin/chunks/EditConfigurationPage-DSSrKbwM.mjs +159 -0
  16. package/dist/admin/chunks/EditConfigurationPage-DSSrKbwM.mjs.map +1 -0
  17. package/dist/admin/chunks/EditViewPage-B9oaTSxh.mjs +311 -0
  18. package/dist/admin/chunks/EditViewPage-B9oaTSxh.mjs.map +1 -0
  19. package/dist/admin/chunks/EditViewPage-Cyt_AqcH.js +334 -0
  20. package/dist/admin/chunks/EditViewPage-Cyt_AqcH.js.map +1 -0
  21. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs +56 -0
  22. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs.map +1 -0
  23. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js +58 -0
  24. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js.map +1 -0
  25. package/dist/admin/chunks/Form-BynZsnG8.js +978 -0
  26. package/dist/admin/chunks/Form-BynZsnG8.js.map +1 -0
  27. package/dist/admin/chunks/Form-CiDhWFF2.mjs +955 -0
  28. package/dist/admin/chunks/Form-CiDhWFF2.mjs.map +1 -0
  29. package/dist/admin/chunks/History-BIzCrHlU.mjs +1357 -0
  30. package/dist/admin/chunks/History-BIzCrHlU.mjs.map +1 -0
  31. package/dist/admin/chunks/History-D8x3KfXk.js +1380 -0
  32. package/dist/admin/chunks/History-D8x3KfXk.js.map +1 -0
  33. package/dist/admin/chunks/Input-BrTcf7W8.mjs +7190 -0
  34. package/dist/admin/chunks/Input-BrTcf7W8.mjs.map +1 -0
  35. package/dist/admin/chunks/Input-Cx7glRRR.js +7221 -0
  36. package/dist/admin/chunks/Input-Cx7glRRR.js.map +1 -0
  37. package/dist/admin/chunks/ListConfigurationPage-C1HEB6A1.js +819 -0
  38. package/dist/admin/chunks/ListConfigurationPage-C1HEB6A1.js.map +1 -0
  39. package/dist/admin/chunks/ListConfigurationPage-JWHsiJKb.mjs +796 -0
  40. package/dist/admin/chunks/ListConfigurationPage-JWHsiJKb.mjs.map +1 -0
  41. package/dist/admin/chunks/ListViewPage-38RhQMrO.js +1155 -0
  42. package/dist/admin/chunks/ListViewPage-38RhQMrO.js.map +1 -0
  43. package/dist/admin/chunks/ListViewPage-lpuA2rS8.mjs +1133 -0
  44. package/dist/admin/chunks/ListViewPage-lpuA2rS8.mjs.map +1 -0
  45. package/dist/admin/chunks/NoContentTypePage-mxdu7QG9.mjs +58 -0
  46. package/dist/admin/chunks/NoContentTypePage-mxdu7QG9.mjs.map +1 -0
  47. package/dist/admin/chunks/NoContentTypePage-q48fU1h9.js +60 -0
  48. package/dist/admin/chunks/NoContentTypePage-q48fU1h9.js.map +1 -0
  49. package/dist/admin/chunks/NoPermissionsPage-B_p7s1uj.js +39 -0
  50. package/dist/admin/chunks/NoPermissionsPage-B_p7s1uj.js.map +1 -0
  51. package/dist/admin/chunks/NoPermissionsPage-CihsLbNC.mjs +37 -0
  52. package/dist/admin/chunks/NoPermissionsPage-CihsLbNC.mjs.map +1 -0
  53. package/dist/admin/chunks/Preview-CMoqDEKI.js +691 -0
  54. package/dist/admin/chunks/Preview-CMoqDEKI.js.map +1 -0
  55. package/dist/admin/chunks/Preview-DGQMt8XZ.mjs +669 -0
  56. package/dist/admin/chunks/Preview-DGQMt8XZ.mjs.map +1 -0
  57. package/dist/admin/chunks/Relations-BemEu63h.mjs +1291 -0
  58. package/dist/admin/chunks/Relations-BemEu63h.mjs.map +1 -0
  59. package/dist/admin/chunks/Relations-BtC_Gort.js +1318 -0
  60. package/dist/admin/chunks/Relations-BtC_Gort.js.map +1 -0
  61. package/dist/admin/chunks/ar-DckYq_WK.mjs +222 -0
  62. package/dist/{_chunks/ar-CCEVvqGG.mjs.map → admin/chunks/ar-DckYq_WK.mjs.map} +1 -1
  63. package/dist/admin/chunks/ar-DeQBSsfl.js +227 -0
  64. package/dist/{_chunks/ru-BT3ybNny.js.map → admin/chunks/ar-DeQBSsfl.js.map} +1 -1
  65. package/dist/admin/chunks/ca-ClDTvatJ.js +202 -0
  66. package/dist/admin/chunks/ca-ClDTvatJ.js.map +1 -0
  67. package/dist/admin/chunks/ca-DviY7mRj.mjs +197 -0
  68. package/dist/admin/chunks/ca-DviY7mRj.mjs.map +1 -0
  69. package/dist/admin/chunks/cs-BJFxwIWj.js +126 -0
  70. package/dist/{_chunks/cs-CkJy6B2v.js.map → admin/chunks/cs-BJFxwIWj.js.map} +1 -1
  71. package/dist/admin/chunks/cs-C7OSYFQ7.mjs +122 -0
  72. package/dist/{_chunks/cs-CM2aBUar.mjs.map → admin/chunks/cs-C7OSYFQ7.mjs.map} +1 -1
  73. package/dist/admin/chunks/de-5QRlDHyR.mjs +195 -0
  74. package/dist/{_chunks/eu-CdALomew.mjs.map → admin/chunks/de-5QRlDHyR.mjs.map} +1 -1
  75. package/dist/admin/chunks/de-CbImAUA5.js +200 -0
  76. package/dist/{_chunks/gu-BRmF601H.js.map → admin/chunks/de-CbImAUA5.js.map} +1 -1
  77. package/dist/admin/chunks/en-CImiNxXE.mjs +310 -0
  78. package/dist/{_chunks/en-Dtk_ot79.mjs.map → admin/chunks/en-CImiNxXE.mjs.map} +1 -1
  79. package/dist/admin/chunks/en-CLf4SuMQ.js +315 -0
  80. package/dist/{_chunks/en-BK8Xyl5I.js.map → admin/chunks/en-CLf4SuMQ.js.map} +1 -1
  81. package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
  82. package/dist/{_chunks/es-9K52xZIr.js.map → admin/chunks/es-C8vLuvZL.js.map} +1 -1
  83. package/dist/admin/chunks/es-DkoWSExG.mjs +192 -0
  84. package/dist/{_chunks/ja-BHqhDq4V.mjs.map → admin/chunks/es-DkoWSExG.mjs.map} +1 -1
  85. package/dist/admin/chunks/eu-BG1xX7HK.mjs +198 -0
  86. package/dist/admin/chunks/eu-BG1xX7HK.mjs.map +1 -0
  87. package/dist/admin/chunks/eu-BJW3AvXu.js +203 -0
  88. package/dist/admin/chunks/eu-BJW3AvXu.js.map +1 -0
  89. package/dist/admin/chunks/fr-CFdRaRVj.mjs +215 -0
  90. package/dist/admin/chunks/fr-CFdRaRVj.mjs.map +1 -0
  91. package/dist/admin/chunks/fr-gQSilC7w.js +220 -0
  92. package/dist/admin/chunks/fr-gQSilC7w.js.map +1 -0
  93. package/dist/admin/chunks/gu-D5MMMXRs.mjs +196 -0
  94. package/dist/admin/chunks/gu-D5MMMXRs.mjs.map +1 -0
  95. package/dist/admin/chunks/gu-DPU4wyx7.js +201 -0
  96. package/dist/{_chunks/eu-VDH-3ovk.js.map → admin/chunks/gu-DPU4wyx7.js.map} +1 -1
  97. package/dist/admin/chunks/hi-Dp4omeBb.js +201 -0
  98. package/dist/admin/chunks/hi-Dp4omeBb.js.map +1 -0
  99. package/dist/admin/chunks/hi-lp17SCjr.mjs +196 -0
  100. package/dist/admin/chunks/hi-lp17SCjr.mjs.map +1 -0
  101. package/dist/{_chunks/hooks-BAaaKPS_.js → admin/chunks/hooks-D-sOYd1s.js} +6 -3
  102. package/dist/admin/chunks/hooks-D-sOYd1s.js.map +1 -0
  103. package/dist/admin/chunks/hooks-DMvik5y_.mjs +7 -0
  104. package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +1 -0
  105. package/dist/admin/chunks/hu-CLka1U2C.mjs +198 -0
  106. package/dist/admin/chunks/hu-CLka1U2C.mjs.map +1 -0
  107. package/dist/admin/chunks/hu-CtFJuhTd.js +203 -0
  108. package/dist/admin/chunks/hu-CtFJuhTd.js.map +1 -0
  109. package/dist/admin/chunks/id-D7V5S1rB.js +161 -0
  110. package/dist/{_chunks/it-DkBIs7vD.js.map → admin/chunks/id-D7V5S1rB.js.map} +1 -1
  111. package/dist/admin/chunks/id-USfY9m1g.mjs +156 -0
  112. package/dist/{_chunks/id-BtwA9WJT.mjs.map → admin/chunks/id-USfY9m1g.mjs.map} +1 -1
  113. package/dist/admin/chunks/index-D7EkCTnw.js +5449 -0
  114. package/dist/admin/chunks/index-D7EkCTnw.js.map +1 -0
  115. package/dist/admin/chunks/index-njcS3gUl.mjs +5382 -0
  116. package/dist/admin/chunks/index-njcS3gUl.mjs.map +1 -0
  117. package/dist/admin/chunks/it-BAHrwmYS.mjs +158 -0
  118. package/dist/{_chunks/it-BrVPqaf1.mjs.map → admin/chunks/it-BAHrwmYS.mjs.map} +1 -1
  119. package/dist/admin/chunks/it-CQFpa_Dc.js +163 -0
  120. package/dist/{_chunks/ko-woFZPmLk.js.map → admin/chunks/it-CQFpa_Dc.js.map} +1 -1
  121. package/dist/admin/chunks/ja-BWKmBJFT.mjs +192 -0
  122. package/dist/{_chunks/ko-HVQRlfUI.mjs.map → admin/chunks/ja-BWKmBJFT.mjs.map} +1 -1
  123. package/dist/admin/chunks/ja-jdQM-B79.js +197 -0
  124. package/dist/{_chunks/de-CCEmbAah.js.map → admin/chunks/ja-jdQM-B79.js.map} +1 -1
  125. package/dist/admin/chunks/ko-CgADGBNt.mjs +191 -0
  126. package/dist/{_chunks/es-D34tqjMw.mjs.map → admin/chunks/ko-CgADGBNt.mjs.map} +1 -1
  127. package/dist/admin/chunks/ko-k46sEyzt.js +196 -0
  128. package/dist/{_chunks/ja-7sfIbjxE.js.map → admin/chunks/ko-k46sEyzt.js.map} +1 -1
  129. package/dist/admin/chunks/layout-Ccv9FwbI.js +619 -0
  130. package/dist/admin/chunks/layout-Ccv9FwbI.js.map +1 -0
  131. package/dist/admin/chunks/layout-os6F94Aa.mjs +599 -0
  132. package/dist/admin/chunks/layout-os6F94Aa.mjs.map +1 -0
  133. package/dist/admin/chunks/ml-CnhCfOn_.mjs +196 -0
  134. package/dist/admin/chunks/ml-CnhCfOn_.mjs.map +1 -0
  135. package/dist/admin/chunks/ml-DqxPwODx.js +201 -0
  136. package/dist/admin/chunks/ml-DqxPwODx.js.map +1 -0
  137. package/dist/admin/chunks/ms-Bh09NFff.mjs +140 -0
  138. package/dist/{_chunks/ms-m_WjyWx7.mjs.map → admin/chunks/ms-Bh09NFff.mjs.map} +1 -1
  139. package/dist/admin/chunks/ms-CvSC0OdG.js +145 -0
  140. package/dist/{_chunks/ms-BuFotyP_.js.map → admin/chunks/ms-CvSC0OdG.js.map} +1 -1
  141. package/dist/admin/chunks/nl-BEubhS8C.js +203 -0
  142. package/dist/admin/chunks/nl-BEubhS8C.js.map +1 -0
  143. package/dist/admin/chunks/nl-C8HYflTc.mjs +198 -0
  144. package/dist/admin/chunks/nl-C8HYflTc.mjs.map +1 -0
  145. package/dist/admin/chunks/objects-C3EebVVe.js +76 -0
  146. package/dist/admin/chunks/objects-C3EebVVe.js.map +1 -0
  147. package/dist/admin/chunks/objects-wl73iEma.mjs +73 -0
  148. package/dist/admin/chunks/objects-wl73iEma.mjs.map +1 -0
  149. package/dist/admin/chunks/pl-DWhGDzmM.js +200 -0
  150. package/dist/{_chunks/ca-Cmk45QO6.js.map → admin/chunks/pl-DWhGDzmM.js.map} +1 -1
  151. package/dist/admin/chunks/pl-MFCZJZuZ.mjs +195 -0
  152. package/dist/{_chunks/ca-5U32ON2v.mjs.map → admin/chunks/pl-MFCZJZuZ.mjs.map} +1 -1
  153. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +202 -0
  154. package/dist/{_chunks/pt-BR-BiOz37D9.js.map → admin/chunks/pt-BR-CPtAXD-4.js.map} +1 -1
  155. package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs +197 -0
  156. package/dist/{_chunks/pt-BR-C71iDxnh.mjs.map → admin/chunks/pt-BR-CcotyBGJ.mjs.map} +1 -1
  157. package/dist/admin/chunks/pt-BoPxN80n.js +96 -0
  158. package/dist/admin/chunks/pt-BoPxN80n.js.map +1 -0
  159. package/dist/admin/chunks/pt-HbmgeiYO.mjs +93 -0
  160. package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +1 -0
  161. package/dist/admin/chunks/relations-De8hSklO.mjs +173 -0
  162. package/dist/admin/chunks/relations-De8hSklO.mjs.map +1 -0
  163. package/dist/admin/chunks/relations-iguhDgFp.js +178 -0
  164. package/dist/admin/chunks/relations-iguhDgFp.js.map +1 -0
  165. package/dist/admin/chunks/ru-C0op0ALG.js +232 -0
  166. package/dist/admin/chunks/ru-C0op0ALG.js.map +1 -0
  167. package/dist/admin/chunks/ru-CB4BUyQp.mjs +230 -0
  168. package/dist/{_chunks/ru-BE6A4Exp.mjs.map → admin/chunks/ru-CB4BUyQp.mjs.map} +1 -1
  169. package/dist/admin/chunks/sa-B_FuPyMw.js +201 -0
  170. package/dist/admin/chunks/sa-B_FuPyMw.js.map +1 -0
  171. package/dist/admin/chunks/sa-n_aPA-pU.mjs +196 -0
  172. package/dist/admin/chunks/sa-n_aPA-pU.mjs.map +1 -0
  173. package/dist/admin/chunks/sk-D_iXML2C.js +203 -0
  174. package/dist/admin/chunks/sk-D_iXML2C.js.map +1 -0
  175. package/dist/admin/chunks/sk-tn_BDjE2.mjs +198 -0
  176. package/dist/admin/chunks/sk-tn_BDjE2.mjs.map +1 -0
  177. package/dist/admin/chunks/sv-BstBC1Yp.js +203 -0
  178. package/dist/admin/chunks/sv-BstBC1Yp.js.map +1 -0
  179. package/dist/admin/chunks/sv-cq4ZrQRd.mjs +198 -0
  180. package/dist/admin/chunks/sv-cq4ZrQRd.mjs.map +1 -0
  181. package/dist/admin/chunks/th-lXoOCqPC.js +149 -0
  182. package/dist/{_chunks/th-D9_GfAjc.js.map → admin/chunks/th-lXoOCqPC.js.map} +1 -1
  183. package/dist/admin/chunks/th-mUH7hEtc.mjs +144 -0
  184. package/dist/{_chunks/th-BqbI8lIT.mjs.map → admin/chunks/th-mUH7hEtc.mjs.map} +1 -1
  185. package/dist/admin/chunks/tr-CkS6sLIE.js +200 -0
  186. package/dist/admin/chunks/tr-CkS6sLIE.js.map +1 -0
  187. package/dist/admin/chunks/tr-Yt38daxh.mjs +195 -0
  188. package/dist/{_chunks/de-C72KDNOl.mjs.map → admin/chunks/tr-Yt38daxh.mjs.map} +1 -1
  189. package/dist/admin/chunks/uk-B24MoTVg.js +145 -0
  190. package/dist/{_chunks/uk-C8EiqJY7.js.map → admin/chunks/uk-B24MoTVg.js.map} +1 -1
  191. package/dist/admin/chunks/uk-Cpgmm7gE.mjs +140 -0
  192. package/dist/{_chunks/uk-CR-zDhAY.mjs.map → admin/chunks/uk-Cpgmm7gE.mjs.map} +1 -1
  193. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs +247 -0
  194. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs.map +1 -0
  195. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js +271 -0
  196. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +1 -0
  197. package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs +18 -0
  198. package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs.map +1 -0
  199. package/dist/admin/chunks/usePrev-DIYl-IAL.js +21 -0
  200. package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +1 -0
  201. package/dist/admin/chunks/vi-BGr1X_HZ.js +112 -0
  202. package/dist/{_chunks/vi-CJlYDheJ.js.map → admin/chunks/vi-BGr1X_HZ.js.map} +1 -1
  203. package/dist/admin/chunks/vi-CvBGlTjr.mjs +108 -0
  204. package/dist/{_chunks/vi-DUXIk_fw.mjs.map → admin/chunks/vi-CvBGlTjr.mjs.map} +1 -1
  205. package/dist/admin/chunks/zh-BmF-sHaT.mjs +205 -0
  206. package/dist/admin/chunks/zh-BmF-sHaT.mjs.map +1 -0
  207. package/dist/admin/chunks/zh-DwFu_Kfj.js +210 -0
  208. package/dist/admin/chunks/zh-DwFu_Kfj.js.map +1 -0
  209. package/dist/admin/chunks/zh-Hans-CI0HKio3.mjs +934 -0
  210. package/dist/{_chunks/zh-Hans-BPQcRIyH.mjs.map → admin/chunks/zh-Hans-CI0HKio3.mjs.map} +1 -1
  211. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +953 -0
  212. package/dist/{_chunks/zh-Hans-9kOncHGw.js.map → admin/chunks/zh-Hans-JVK9x7xr.js.map} +1 -1
  213. package/dist/admin/index.js +25 -4
  214. package/dist/admin/index.js.map +1 -1
  215. package/dist/admin/index.mjs +17 -12
  216. package/dist/admin/index.mjs.map +1 -1
  217. package/dist/admin/src/components/InjectionZone.d.ts +7 -1
  218. package/dist/admin/src/content-manager.d.ts +6 -2
  219. package/dist/admin/src/exports.d.ts +1 -0
  220. package/dist/admin/src/history/services/historyVersion.d.ts +2 -2
  221. package/dist/admin/src/hooks/useDocument.d.ts +21 -4
  222. package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -0
  223. package/dist/admin/src/index.d.ts +1 -0
  224. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +3 -2
  225. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +1 -1
  226. package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
  227. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +55 -0
  228. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  229. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
  230. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
  231. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +2 -1
  232. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +1 -2
  233. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +29 -1
  234. package/dist/admin/src/pages/EditView/utils/data.d.ts +1 -0
  235. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -1
  236. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -1
  237. package/dist/admin/src/preview/index.d.ts +2 -3
  238. package/dist/admin/src/preview/pages/Preview.d.ts +3 -1
  239. package/dist/admin/src/preview/services/preview.d.ts +1 -1
  240. package/dist/admin/src/services/api.d.ts +1 -1
  241. package/dist/admin/src/services/components.d.ts +2 -2
  242. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  243. package/dist/admin/src/services/documents.d.ts +16 -16
  244. package/dist/admin/src/services/init.d.ts +1 -1
  245. package/dist/admin/src/services/relations.d.ts +2 -2
  246. package/dist/admin/src/services/uid.d.ts +3 -3
  247. package/dist/server/index.js +5457 -4389
  248. package/dist/server/index.js.map +1 -1
  249. package/dist/server/index.mjs +5437 -4366
  250. package/dist/server/index.mjs.map +1 -1
  251. package/dist/server/src/controllers/utils/metadata.d.ts +2 -1
  252. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  253. package/dist/server/src/history/controllers/history-version.d.ts +1 -1
  254. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
  255. package/dist/server/src/history/services/history.d.ts +3 -3
  256. package/dist/server/src/history/services/history.d.ts.map +1 -1
  257. package/dist/server/src/history/services/utils.d.ts +6 -10
  258. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  259. package/dist/server/src/index.d.ts +3 -2
  260. package/dist/server/src/index.d.ts.map +1 -1
  261. package/dist/server/src/preview/index.d.ts.map +1 -1
  262. package/dist/server/src/services/document-metadata.d.ts +4 -2
  263. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  264. package/dist/server/src/services/index.d.ts +3 -2
  265. package/dist/server/src/services/index.d.ts.map +1 -1
  266. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  267. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  268. package/dist/server/src/services/utils/count.d.ts +1 -1
  269. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  270. package/dist/server/src/services/utils/populate.d.ts +3 -3
  271. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  272. package/dist/shared/contracts/collection-types.d.ts +0 -1
  273. package/dist/shared/contracts/components.d.ts +0 -1
  274. package/dist/shared/contracts/content-types.d.ts +0 -1
  275. package/dist/shared/contracts/history-versions.d.ts +0 -1
  276. package/dist/shared/contracts/index.d.ts +0 -1
  277. package/dist/shared/contracts/init.d.ts +0 -1
  278. package/dist/shared/contracts/preview.d.ts +0 -1
  279. package/dist/shared/contracts/relations.d.ts +1 -2
  280. package/dist/shared/contracts/relations.d.ts.map +1 -1
  281. package/dist/shared/contracts/review-workflows.d.ts +0 -1
  282. package/dist/shared/contracts/single-types.d.ts +0 -1
  283. package/dist/shared/contracts/uid.d.ts +0 -1
  284. package/dist/shared/index.d.ts +0 -1
  285. package/dist/shared/index.js +35 -24
  286. package/dist/shared/index.js.map +1 -1
  287. package/dist/shared/index.mjs +34 -25
  288. package/dist/shared/index.mjs.map +1 -1
  289. package/package.json +18 -14
  290. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
  291. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
  292. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
  293. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
  294. package/dist/_chunks/ComponentConfigurationPage-DhWA-JzT.mjs +0 -236
  295. package/dist/_chunks/ComponentConfigurationPage-DhWA-JzT.mjs.map +0 -1
  296. package/dist/_chunks/ComponentConfigurationPage-UduDBv3m.js +0 -255
  297. package/dist/_chunks/ComponentConfigurationPage-UduDBv3m.js.map +0 -1
  298. package/dist/_chunks/ComponentIcon-BXdiCGQp.js +0 -176
  299. package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +0 -1
  300. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
  301. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
  302. package/dist/_chunks/EditConfigurationPage-5tmx_7Hp.mjs +0 -132
  303. package/dist/_chunks/EditConfigurationPage-5tmx_7Hp.mjs.map +0 -1
  304. package/dist/_chunks/EditConfigurationPage-Cp9UzUfs.js +0 -151
  305. package/dist/_chunks/EditConfigurationPage-Cp9UzUfs.js.map +0 -1
  306. package/dist/_chunks/EditViewPage-BKoISUOu.mjs +0 -254
  307. package/dist/_chunks/EditViewPage-BKoISUOu.mjs.map +0 -1
  308. package/dist/_chunks/EditViewPage-C7l2Emuj.js +0 -273
  309. package/dist/_chunks/EditViewPage-C7l2Emuj.js.map +0 -1
  310. package/dist/_chunks/Field-BPSJpDfE.js +0 -5614
  311. package/dist/_chunks/Field-BPSJpDfE.js.map +0 -1
  312. package/dist/_chunks/Field-BZxzYf1x.mjs +0 -5582
  313. package/dist/_chunks/Field-BZxzYf1x.mjs.map +0 -1
  314. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  315. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  316. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  317. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  318. package/dist/_chunks/Form-8qyOU6YG.mjs +0 -758
  319. package/dist/_chunks/Form-8qyOU6YG.mjs.map +0 -1
  320. package/dist/_chunks/Form-DLkqDd2G.js +0 -779
  321. package/dist/_chunks/Form-DLkqDd2G.js.map +0 -1
  322. package/dist/_chunks/History-DYMicybF.js +0 -996
  323. package/dist/_chunks/History-DYMicybF.js.map +0 -1
  324. package/dist/_chunks/History-N_kRb1Yr.mjs +0 -975
  325. package/dist/_chunks/History-N_kRb1Yr.mjs.map +0 -1
  326. package/dist/_chunks/ListConfigurationPage-BM3qVxug.mjs +0 -633
  327. package/dist/_chunks/ListConfigurationPage-BM3qVxug.mjs.map +0 -1
  328. package/dist/_chunks/ListConfigurationPage-rUF9iGWq.js +0 -653
  329. package/dist/_chunks/ListConfigurationPage-rUF9iGWq.js.map +0 -1
  330. package/dist/_chunks/ListViewPage-BSLzd7cZ.js +0 -875
  331. package/dist/_chunks/ListViewPage-BSLzd7cZ.js.map +0 -1
  332. package/dist/_chunks/ListViewPage-CWilGbZb.mjs +0 -851
  333. package/dist/_chunks/ListViewPage-CWilGbZb.mjs.map +0 -1
  334. package/dist/_chunks/NoContentTypePage-CQccVhIX.js +0 -51
  335. package/dist/_chunks/NoContentTypePage-CQccVhIX.js.map +0 -1
  336. package/dist/_chunks/NoContentTypePage-VWYlePwI.mjs +0 -51
  337. package/dist/_chunks/NoContentTypePage-VWYlePwI.mjs.map +0 -1
  338. package/dist/_chunks/NoPermissionsPage-Af32Gg2m.js +0 -23
  339. package/dist/_chunks/NoPermissionsPage-Af32Gg2m.js.map +0 -1
  340. package/dist/_chunks/NoPermissionsPage-CS2tCmfr.mjs +0 -23
  341. package/dist/_chunks/NoPermissionsPage-CS2tCmfr.mjs.map +0 -1
  342. package/dist/_chunks/Preview-D4KzuJFL.js +0 -291
  343. package/dist/_chunks/Preview-D4KzuJFL.js.map +0 -1
  344. package/dist/_chunks/Preview-kPkuZbBJ.mjs +0 -272
  345. package/dist/_chunks/Preview-kPkuZbBJ.mjs.map +0 -1
  346. package/dist/_chunks/Relations-5k27Rh54.mjs +0 -730
  347. package/dist/_chunks/Relations-5k27Rh54.mjs.map +0 -1
  348. package/dist/_chunks/Relations-D_Ki5aVM.js +0 -750
  349. package/dist/_chunks/Relations-D_Ki5aVM.js.map +0 -1
  350. package/dist/_chunks/ar-BUUWXIYu.js +0 -226
  351. package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
  352. package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
  353. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  354. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  355. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  356. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  357. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  358. package/dist/_chunks/de-CCEmbAah.js +0 -199
  359. package/dist/_chunks/en-BK8Xyl5I.js +0 -305
  360. package/dist/_chunks/en-Dtk_ot79.mjs +0 -305
  361. package/dist/_chunks/es-9K52xZIr.js +0 -196
  362. package/dist/_chunks/es-D34tqjMw.mjs +0 -196
  363. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  364. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  365. package/dist/_chunks/fr--pg5jUbt.mjs +0 -216
  366. package/dist/_chunks/fr--pg5jUbt.mjs.map +0 -1
  367. package/dist/_chunks/fr-B2Kyv8Z9.js +0 -216
  368. package/dist/_chunks/fr-B2Kyv8Z9.js.map +0 -1
  369. package/dist/_chunks/gu-BRmF601H.js +0 -200
  370. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  371. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  372. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  373. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  374. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  375. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  376. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  377. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  378. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  379. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  380. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  381. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  382. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  383. package/dist/_chunks/id-B5Ser98A.js +0 -160
  384. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  385. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  386. package/dist/_chunks/index-BLPa8Dq-.mjs +0 -4204
  387. package/dist/_chunks/index-BLPa8Dq-.mjs.map +0 -1
  388. package/dist/_chunks/index-DwOsF7wF.js +0 -4224
  389. package/dist/_chunks/index-DwOsF7wF.js.map +0 -1
  390. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  391. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  392. package/dist/_chunks/ja-7sfIbjxE.js +0 -196
  393. package/dist/_chunks/ja-BHqhDq4V.mjs +0 -196
  394. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  395. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  396. package/dist/_chunks/layout-2Si0j0jO.mjs +0 -471
  397. package/dist/_chunks/layout-2Si0j0jO.mjs.map +0 -1
  398. package/dist/_chunks/layout-CN2bFL9V.js +0 -489
  399. package/dist/_chunks/layout-CN2bFL9V.js.map +0 -1
  400. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  401. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  402. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  403. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  404. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  405. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  406. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  407. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  408. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  409. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  410. package/dist/_chunks/objects-BcXOv6_9.js +0 -47
  411. package/dist/_chunks/objects-BcXOv6_9.js.map +0 -1
  412. package/dist/_chunks/objects-D6yBsdmx.mjs +0 -45
  413. package/dist/_chunks/objects-D6yBsdmx.mjs.map +0 -1
  414. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  415. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  416. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  417. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  418. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  419. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  420. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  421. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  422. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  423. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  424. package/dist/_chunks/relations-B0E0XUY7.js +0 -133
  425. package/dist/_chunks/relations-B0E0XUY7.js.map +0 -1
  426. package/dist/_chunks/relations-CAxDjUJF.mjs +0 -134
  427. package/dist/_chunks/relations-CAxDjUJF.mjs.map +0 -1
  428. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  429. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  430. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  431. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  432. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  433. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  434. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  435. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  436. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  437. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  438. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  439. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  440. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  441. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  442. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  443. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  444. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  445. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  446. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  447. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  448. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  449. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  450. package/dist/_chunks/useDebounce-CtcjDB3L.js +0 -28
  451. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +0 -1
  452. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +0 -29
  453. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +0 -1
  454. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs +0 -231
  455. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +0 -1
  456. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js +0 -249
  457. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +0 -1
  458. package/dist/_chunks/vi-CJlYDheJ.js +0 -111
  459. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  460. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  461. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  462. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  463. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  464. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  465. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
  466. package/dist/admin/src/preview/constants.d.ts +0 -1
  467. package/dist/server/src/preview/constants.d.ts +0 -2
  468. package/dist/server/src/preview/constants.d.ts.map +0 -1
@@ -0,0 +1,955 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { useNotification, useField, Form, InputRenderer, useForm, Layouts, BackButton } from '@strapi/admin/strapi-admin';
4
+ import { Modal, Flex, Grid, Button, IconButton, Typography, Box, Menu, useComposedRefs, Link, Main, Divider } from '@strapi/design-system';
5
+ import { generateNKeysBetween as generateNKeysBetween$1 } from 'fractional-indexing';
6
+ import pipe from 'lodash/fp/pipe';
7
+ import { useIntl } from 'react-intl';
8
+ import { a as useGetInitialDataQuery, E as ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD, z as capitalise, g as getTranslation } from './index-njcS3gUl.mjs';
9
+ import { Plus, Drag, Pencil, Cross, Cog } from '@strapi/icons';
10
+ import { getEmptyImage } from 'react-dnd-html5-backend';
11
+ import { NavLink } from 'react-router-dom';
12
+ import { styled } from 'styled-components';
13
+ import { u as useDragAndDrop, I as ItemTypes } from './useDragAndDrop-HYwNDExe.mjs';
14
+ import { C as ComponentIcon } from './ComponentIcon-BZcTc4rj.mjs';
15
+ import * as yup from 'yup';
16
+ import { F as FieldTypeIcon } from './FieldTypeIcon-BY6MrVF4.mjs';
17
+
18
+ /* -------------------------------------------------------------------------------------------------
19
+ * Constants
20
+ * -----------------------------------------------------------------------------------------------*/ const FIELD_SCHEMA = yup.object().shape({
21
+ label: yup.string().required().nullable(),
22
+ description: yup.string(),
23
+ editable: yup.boolean(),
24
+ size: yup.number().required()
25
+ });
26
+ const EditFieldForm = ({ attribute, name, onClose })=>{
27
+ const { formatMessage } = useIntl();
28
+ const { toggleNotification } = useNotification();
29
+ const { value, onChange } = useField(name);
30
+ const { data: mainFieldOptions } = useGetInitialDataQuery(undefined, {
31
+ selectFromResult: (res)=>{
32
+ if (attribute?.type !== 'relation' || !res.data) {
33
+ return {
34
+ data: []
35
+ };
36
+ }
37
+ if ('targetModel' in attribute && typeof attribute.targetModel === 'string') {
38
+ const targetSchema = res.data.contentTypes.find((schema)=>schema.uid === attribute.targetModel);
39
+ if (targetSchema) {
40
+ return {
41
+ data: Object.entries(targetSchema.attributes).reduce((acc, [key, attribute])=>{
42
+ /**
43
+ * Create the list of attributes from the schema as to which can
44
+ * be our `mainField` and dictate the display name of the schema
45
+ * we're editing.
46
+ */ if (!ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD.includes(attribute.type)) {
47
+ acc.push({
48
+ label: key,
49
+ value: key
50
+ });
51
+ }
52
+ return acc;
53
+ }, [])
54
+ };
55
+ }
56
+ }
57
+ return {
58
+ data: []
59
+ };
60
+ },
61
+ skip: attribute?.type !== 'relation'
62
+ });
63
+ if (!value || value.name === TEMP_FIELD_NAME || !attribute) {
64
+ // This is very unlikely to happen, but it ensures the form is not opened without a value.
65
+ console.error("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.");
66
+ toggleNotification({
67
+ message: formatMessage({
68
+ id: 'content-manager.containers.edit-settings.modal-form.error',
69
+ defaultMessage: 'An error occurred while trying to open the form.'
70
+ }),
71
+ type: 'danger'
72
+ });
73
+ return null;
74
+ }
75
+ return /*#__PURE__*/ jsx(Modal.Content, {
76
+ children: /*#__PURE__*/ jsxs(Form, {
77
+ method: "PUT",
78
+ initialValues: value,
79
+ validationSchema: FIELD_SCHEMA,
80
+ onSubmit: (data)=>{
81
+ onChange(name, data);
82
+ onClose();
83
+ },
84
+ children: [
85
+ /*#__PURE__*/ jsx(Modal.Header, {
86
+ children: /*#__PURE__*/ jsxs(Flex, {
87
+ gap: 3,
88
+ children: [
89
+ /*#__PURE__*/ jsx(FieldTypeIcon, {
90
+ type: attribute.type
91
+ }),
92
+ /*#__PURE__*/ jsx(Modal.Title, {
93
+ children: formatMessage({
94
+ id: 'content-manager.containers.edit-settings.modal-form.label',
95
+ defaultMessage: 'Edit {fieldName}'
96
+ }, {
97
+ fieldName: capitalise(value.name)
98
+ })
99
+ })
100
+ ]
101
+ })
102
+ }),
103
+ /*#__PURE__*/ jsx(Modal.Body, {
104
+ children: /*#__PURE__*/ jsx(Grid.Root, {
105
+ gap: 4,
106
+ children: [
107
+ {
108
+ name: 'label',
109
+ label: formatMessage({
110
+ id: getTranslation('containers.edit-settings.modal-form.label'),
111
+ defaultMessage: 'Label'
112
+ }),
113
+ size: 6,
114
+ type: 'string'
115
+ },
116
+ {
117
+ name: 'description',
118
+ label: formatMessage({
119
+ id: getTranslation('containers.edit-settings.modal-form.description'),
120
+ defaultMessage: 'Description'
121
+ }),
122
+ size: 6,
123
+ type: 'string'
124
+ },
125
+ {
126
+ name: 'placeholder',
127
+ label: formatMessage({
128
+ id: getTranslation('containers.edit-settings.modal-form.placeholder'),
129
+ defaultMessage: 'Placeholder'
130
+ }),
131
+ size: 6,
132
+ type: 'string'
133
+ },
134
+ {
135
+ name: 'editable',
136
+ label: formatMessage({
137
+ id: getTranslation('containers.edit-settings.modal-form.editable'),
138
+ defaultMessage: 'Editable'
139
+ }),
140
+ size: 6,
141
+ type: 'boolean'
142
+ },
143
+ {
144
+ name: 'mainField',
145
+ label: formatMessage({
146
+ id: getTranslation('containers.edit-settings.modal-form.mainField'),
147
+ defaultMessage: 'Entry title'
148
+ }),
149
+ hint: formatMessage({
150
+ id: getTranslation('containers.SettingPage.edit-settings.modal-form.mainField.hint'),
151
+ defaultMessage: 'Set the displayed field'
152
+ }),
153
+ size: 6,
154
+ options: mainFieldOptions,
155
+ type: 'enumeration'
156
+ },
157
+ {
158
+ name: 'size',
159
+ label: formatMessage({
160
+ id: getTranslation('containers.ListSettingsView.modal-form.size'),
161
+ defaultMessage: 'Size'
162
+ }),
163
+ size: 6,
164
+ options: [
165
+ {
166
+ value: '4',
167
+ label: '33%'
168
+ },
169
+ {
170
+ value: '6',
171
+ label: '50%'
172
+ },
173
+ {
174
+ value: '8',
175
+ label: '66%'
176
+ },
177
+ {
178
+ value: '12',
179
+ label: '100%'
180
+ }
181
+ ],
182
+ type: 'enumeration'
183
+ }
184
+ ].filter(filterFieldsBasedOnAttributeType(attribute.type)).map(({ size, ...field })=>/*#__PURE__*/ jsx(Grid.Item, {
185
+ col: size,
186
+ direction: "column",
187
+ alignItems: "stretch",
188
+ children: /*#__PURE__*/ jsx(InputRenderer, {
189
+ ...field
190
+ })
191
+ }, field.name))
192
+ })
193
+ }),
194
+ /*#__PURE__*/ jsxs(Modal.Footer, {
195
+ children: [
196
+ /*#__PURE__*/ jsx(Modal.Close, {
197
+ children: /*#__PURE__*/ jsx(Button, {
198
+ variant: "tertiary",
199
+ children: formatMessage({
200
+ id: 'app.components.Button.cancel',
201
+ defaultMessage: 'Cancel'
202
+ })
203
+ })
204
+ }),
205
+ /*#__PURE__*/ jsx(Button, {
206
+ type: "submit",
207
+ children: formatMessage({
208
+ id: 'global.finish',
209
+ defaultMessage: 'Finish'
210
+ })
211
+ })
212
+ ]
213
+ })
214
+ ]
215
+ })
216
+ });
217
+ };
218
+ /**
219
+ * @internal
220
+ * @description not all edit fields have the same editable properties, it depends on the type
221
+ * e.g. a dynamic zone can only change it's label.
222
+ */ const filterFieldsBasedOnAttributeType = (type)=>(field)=>{
223
+ switch(type){
224
+ case 'blocks':
225
+ case 'richtext':
226
+ return field.name !== 'size' && field.name !== 'mainField';
227
+ case 'boolean':
228
+ case 'media':
229
+ return field.name !== 'placeholder' && field.name !== 'mainField';
230
+ case 'component':
231
+ case 'dynamiczone':
232
+ return field.name === 'label' || field.name === 'editable';
233
+ case 'json':
234
+ return field.name !== 'placeholder' && field.name !== 'mainField' && field.name !== 'size';
235
+ case 'relation':
236
+ return true;
237
+ default:
238
+ return field.name !== 'mainField';
239
+ }
240
+ };
241
+
242
+ const Fields = ({ attributes, fieldSizes, components, metadatas = {} })=>{
243
+ const { formatMessage } = useIntl();
244
+ const layout = useForm('Fields', (state)=>state.values.layout ?? []);
245
+ const onChange = useForm('Fields', (state)=>state.onChange);
246
+ const addFieldRow = useForm('Fields', (state)=>state.addFieldRow);
247
+ const removeFieldRow = useForm('Fields', (state)=>state.removeFieldRow);
248
+ const existingFields = layout.map((row)=>row.children.map((field)=>field.name)).flat();
249
+ /**
250
+ * Get the fields that are not already in the layout
251
+ * But also check that they are visible before we give users
252
+ * the option to display them. e.g. `id` is not visible.
253
+ */ const remainingFields = Object.entries(metadatas).reduce((acc, current)=>{
254
+ const [name, { visible, ...field }] = current;
255
+ if (!existingFields.includes(name) && visible === true) {
256
+ const type = attributes[name]?.type;
257
+ const size = type ? fieldSizes[type] : 12;
258
+ acc.push({
259
+ ...field,
260
+ label: field.label ?? name,
261
+ name,
262
+ size
263
+ });
264
+ }
265
+ return acc;
266
+ }, []);
267
+ const handleMoveField = ([newRowIndex, newFieldIndex], [currentRowIndex, currentFieldIndex])=>{
268
+ /**
269
+ * Because this view has the constraint that the sum of field sizes cannot be greater
270
+ * than 12, we don't use the form's method to move field rows, instead, we calculate
271
+ * the new layout and set the entire form.
272
+ */ const newLayout = structuredClone(layout);
273
+ /**
274
+ * Remove field from the current layout space using splice so we have the item
275
+ */ const [field] = newLayout[currentRowIndex].children.splice(currentFieldIndex, 1);
276
+ if (!field || field.name === TEMP_FIELD_NAME) {
277
+ return;
278
+ }
279
+ const newRow = newLayout[newRowIndex].children;
280
+ const [newFieldKey] = generateNKeysBetween(newRow, 1, currentFieldIndex, newFieldIndex);
281
+ /**
282
+ * Next we inject the field into it's new row at it's specified index, we then remove the spaces
283
+ * if they exist and recalculate into potentially two arrays ONLY if the sizing is now over 12,
284
+ * the row and the rest of the row that couldn't fit.
285
+ *
286
+ * for example, if i have a row of `[{size: 4}, {size: 6}]` and i add `{size: 8}` a index 0,
287
+ * the new array will look like `[{size: 8}, {size: 4}, {size: 6}]` which breaks the limit of 12,
288
+ * so instead we make two arrays for the new rows `[[{size: 8}, {size: 4}], [{size: 6}]]` which we
289
+ * then inject at the original row point with spacers included.
290
+ */ newRow.splice(newFieldIndex, 0, {
291
+ ...field,
292
+ __temp_key__: newFieldKey
293
+ });
294
+ if (newLayout[newRowIndex].children.reduce((acc, curr)=>acc + curr.size, 0) > 12) {
295
+ const recalculatedRows = chunkArray(newLayout[newRowIndex].children.filter((field)=>field.name !== TEMP_FIELD_NAME));
296
+ const rowKeys = generateNKeysBetween(newLayout, recalculatedRows.length, currentRowIndex, newRowIndex);
297
+ newLayout.splice(newRowIndex, 1, ...recalculatedRows.map((row, index)=>({
298
+ __temp_key__: rowKeys[index],
299
+ children: row
300
+ })));
301
+ }
302
+ /**
303
+ * Now we remove our spacers from the rows so we can understand what dead rows exist:
304
+ * - if there's only spacers left
305
+ * - there's nothing in the row, e.g. a size 12 field left it.
306
+ * These rows are then filtered out.
307
+ * After that, we recalculate the spacers for the rows that need them.
308
+ */ const newLayoutWithSpacers = newLayout.map((row)=>({
309
+ ...row,
310
+ children: row.children.filter((field)=>field.name !== TEMP_FIELD_NAME)
311
+ })).filter((row)=>row.children.length > 0).map((row)=>{
312
+ const totalSpaceTaken = row.children.reduce((acc, curr)=>acc + curr.size, 0);
313
+ if (totalSpaceTaken < 12) {
314
+ const [spacerKey] = generateNKeysBetween$1(row.children.at(-1)?.__temp_key__, undefined, 1);
315
+ return {
316
+ ...row,
317
+ children: [
318
+ ...row.children,
319
+ {
320
+ name: TEMP_FIELD_NAME,
321
+ size: 12 - totalSpaceTaken,
322
+ __temp_key__: spacerKey
323
+ }
324
+ ]
325
+ };
326
+ }
327
+ return row;
328
+ });
329
+ onChange('layout', newLayoutWithSpacers);
330
+ };
331
+ const handleRemoveField = (rowIndex, fieldIndex)=>()=>{
332
+ if (layout[rowIndex].children.length === 1) {
333
+ removeFieldRow(`layout`, rowIndex);
334
+ } else {
335
+ onChange(`layout.${rowIndex}.children`, [
336
+ ...layout[rowIndex].children.slice(0, fieldIndex),
337
+ ...layout[rowIndex].children.slice(fieldIndex + 1)
338
+ ]);
339
+ }
340
+ };
341
+ const handleAddField = (field)=>()=>{
342
+ addFieldRow('layout', {
343
+ children: [
344
+ field
345
+ ]
346
+ });
347
+ };
348
+ return /*#__PURE__*/ jsxs(Flex, {
349
+ paddingTop: 6,
350
+ direction: "column",
351
+ alignItems: "stretch",
352
+ gap: 4,
353
+ children: [
354
+ /*#__PURE__*/ jsxs(Flex, {
355
+ alignItems: "flex-start",
356
+ direction: "column",
357
+ justifyContent: "space-between",
358
+ children: [
359
+ /*#__PURE__*/ jsx(Typography, {
360
+ fontWeight: "bold",
361
+ children: formatMessage({
362
+ id: getTranslation('containers.list.displayedFields'),
363
+ defaultMessage: 'Displayed fields'
364
+ })
365
+ }),
366
+ /*#__PURE__*/ jsx(Typography, {
367
+ variant: "pi",
368
+ textColor: "neutral600",
369
+ children: formatMessage({
370
+ id: 'containers.SettingPage.editSettings.description',
371
+ defaultMessage: 'Drag & drop the fields to build the layout'
372
+ })
373
+ })
374
+ ]
375
+ }),
376
+ /*#__PURE__*/ jsx(Box, {
377
+ padding: 4,
378
+ hasRadius: true,
379
+ borderStyle: "dashed",
380
+ borderWidth: "1px",
381
+ borderColor: "neutral300",
382
+ children: /*#__PURE__*/ jsxs(Flex, {
383
+ direction: "column",
384
+ alignItems: "stretch",
385
+ gap: 2,
386
+ children: [
387
+ layout.map((row, rowIndex)=>/*#__PURE__*/ jsx(Grid.Root, {
388
+ gap: 2,
389
+ children: row.children.map(({ size, ...field }, fieldIndex)=>/*#__PURE__*/ jsx(Grid.Item, {
390
+ col: size,
391
+ direction: "column",
392
+ alignItems: "stretch",
393
+ children: /*#__PURE__*/ jsx(Field, {
394
+ attribute: attributes[field.name],
395
+ components: components,
396
+ index: [
397
+ rowIndex,
398
+ fieldIndex
399
+ ],
400
+ name: `layout.${rowIndex}.children.${fieldIndex}`,
401
+ onMoveField: handleMoveField,
402
+ onRemoveField: handleRemoveField(rowIndex, fieldIndex)
403
+ })
404
+ }, field.name))
405
+ }, row.__temp_key__)),
406
+ /*#__PURE__*/ jsxs(Menu.Root, {
407
+ children: [
408
+ /*#__PURE__*/ jsx(Menu.Trigger, {
409
+ startIcon: /*#__PURE__*/ jsx(Plus, {}),
410
+ endIcon: null,
411
+ disabled: remainingFields.length === 0,
412
+ fullWidth: true,
413
+ variant: "secondary",
414
+ children: formatMessage({
415
+ id: getTranslation('containers.SettingPage.add.field'),
416
+ defaultMessage: 'Insert another field'
417
+ })
418
+ }),
419
+ /*#__PURE__*/ jsx(Menu.Content, {
420
+ children: remainingFields.map((field)=>/*#__PURE__*/ jsx(Menu.Item, {
421
+ onSelect: handleAddField(field),
422
+ children: field.label
423
+ }, field.name))
424
+ })
425
+ ]
426
+ })
427
+ ]
428
+ })
429
+ })
430
+ ]
431
+ });
432
+ };
433
+ /**
434
+ * @internal
435
+ * @description Small abstraction to solve within an array of fields where you can
436
+ * add a field to the beginning or start, move back and forth what it's index range
437
+ * should be when calculating it's new temp key
438
+ */ const generateNKeysBetween = (field, count, currInd, newInd)=>{
439
+ const startKey = currInd > newInd ? field[newInd - 1]?.__temp_key__ : field[newInd]?.__temp_key__;
440
+ const endKey = currInd > newInd ? field[newInd]?.__temp_key__ : field[newInd + 1]?.__temp_key__;
441
+ return generateNKeysBetween$1(startKey, endKey, count);
442
+ };
443
+ /**
444
+ * @internal
445
+ * @description chunks a row of layouts by the max size we allow, 12. It does not add the
446
+ * spacers again, that should be added separately.
447
+ */ const chunkArray = (array)=>{
448
+ const result = [];
449
+ let temp = [];
450
+ array.reduce((acc, field)=>{
451
+ if (acc + field.size > 12) {
452
+ result.push(temp);
453
+ temp = [
454
+ field
455
+ ];
456
+ return field.size;
457
+ } else {
458
+ temp.push(field);
459
+ return acc + field.size;
460
+ }
461
+ }, 0);
462
+ if (temp.length > 0) {
463
+ result.push(temp);
464
+ }
465
+ return result;
466
+ };
467
+ const TEMP_FIELD_NAME = '_TEMP_';
468
+ /**
469
+ * Displays a field in the layout with drag options, also
470
+ * opens a modal to edit the details of said field.
471
+ */ const Field = ({ attribute, components, name, index, onMoveField, onRemoveField })=>{
472
+ const [isModalOpen, setIsModalOpen] = React.useState(false);
473
+ const { formatMessage } = useIntl();
474
+ const { value } = useField(name);
475
+ const [{ isDragging }, objectRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop(true, {
476
+ dropSensitivity: 'immediate',
477
+ type: ItemTypes.EDIT_FIELD,
478
+ item: {
479
+ index,
480
+ label: value?.label,
481
+ name
482
+ },
483
+ index,
484
+ onMoveItem: onMoveField
485
+ });
486
+ React.useEffect(()=>{
487
+ dragPreviewRef(getEmptyImage(), {
488
+ captureDraggingState: false
489
+ });
490
+ }, [
491
+ dragPreviewRef
492
+ ]);
493
+ const composedRefs = useComposedRefs(dragRef, objectRef);
494
+ const handleRemoveField = (e)=>{
495
+ e.preventDefault();
496
+ e.stopPropagation();
497
+ onRemoveField(e);
498
+ };
499
+ const onEditFieldMeta = (e)=>{
500
+ e.preventDefault();
501
+ e.stopPropagation();
502
+ setIsModalOpen(true);
503
+ };
504
+ const tempRefs = useComposedRefs(dropRef, objectRef);
505
+ if (!value) {
506
+ return null;
507
+ }
508
+ if (value.name === TEMP_FIELD_NAME) {
509
+ return /*#__PURE__*/ jsx(Flex, {
510
+ tag: "span",
511
+ height: "100%",
512
+ style: {
513
+ opacity: 0
514
+ },
515
+ ref: tempRefs
516
+ });
517
+ }
518
+ return /*#__PURE__*/ jsxs(Modal.Root, {
519
+ open: isModalOpen,
520
+ onOpenChange: setIsModalOpen,
521
+ children: [
522
+ /*#__PURE__*/ jsxs(Flex, {
523
+ borderColor: "neutral150",
524
+ background: "neutral100",
525
+ hasRadius: true,
526
+ style: {
527
+ opacity: isDragging ? 0.5 : 1
528
+ },
529
+ ref: dropRef,
530
+ gap: 3,
531
+ cursor: "pointer",
532
+ onClick: ()=>{
533
+ setIsModalOpen(true);
534
+ },
535
+ children: [
536
+ /*#__PURE__*/ jsx(DragButton, {
537
+ tag: "span",
538
+ withTooltip: false,
539
+ label: formatMessage({
540
+ id: getTranslation('components.DraggableCard.move.field'),
541
+ defaultMessage: 'Move {item}'
542
+ }, {
543
+ item: value.label
544
+ }),
545
+ onClick: (e)=>e.stopPropagation(),
546
+ ref: composedRefs,
547
+ children: /*#__PURE__*/ jsx(Drag, {})
548
+ }),
549
+ /*#__PURE__*/ jsxs(Flex, {
550
+ direction: "column",
551
+ alignItems: "flex-start",
552
+ grow: 1,
553
+ overflow: "hidden",
554
+ children: [
555
+ /*#__PURE__*/ jsxs(Flex, {
556
+ gap: 3,
557
+ justifyContent: "space-between",
558
+ width: "100%",
559
+ children: [
560
+ /*#__PURE__*/ jsx(Typography, {
561
+ ellipsis: true,
562
+ fontWeight: "bold",
563
+ children: value.label
564
+ }),
565
+ /*#__PURE__*/ jsxs(Flex, {
566
+ children: [
567
+ /*#__PURE__*/ jsx(IconButton, {
568
+ type: "button",
569
+ variant: "ghost",
570
+ background: "transparent",
571
+ onClick: onEditFieldMeta,
572
+ withTooltip: false,
573
+ label: formatMessage({
574
+ id: getTranslation('components.DraggableCard.edit.field'),
575
+ defaultMessage: 'Edit {item}'
576
+ }, {
577
+ item: value.label
578
+ }),
579
+ children: /*#__PURE__*/ jsx(Pencil, {})
580
+ }),
581
+ /*#__PURE__*/ jsx(IconButton, {
582
+ type: "button",
583
+ variant: "ghost",
584
+ onClick: handleRemoveField,
585
+ background: "transparent",
586
+ withTooltip: false,
587
+ label: formatMessage({
588
+ id: getTranslation('components.DraggableCard.delete.field'),
589
+ defaultMessage: 'Delete {item}'
590
+ }, {
591
+ item: value.label
592
+ }),
593
+ children: /*#__PURE__*/ jsx(Cross, {})
594
+ })
595
+ ]
596
+ })
597
+ ]
598
+ }),
599
+ attribute?.type === 'component' ? /*#__PURE__*/ jsxs(Flex, {
600
+ paddingTop: 3,
601
+ paddingRight: 3,
602
+ paddingBottom: 3,
603
+ paddingLeft: 0,
604
+ alignItems: "flex-start",
605
+ direction: "column",
606
+ gap: 2,
607
+ width: "100%",
608
+ children: [
609
+ /*#__PURE__*/ jsx(Grid.Root, {
610
+ gap: 4,
611
+ width: "100%",
612
+ children: components[attribute.component].layout.map((row)=>row.map(({ size, ...field })=>/*#__PURE__*/ jsx(Grid.Item, {
613
+ col: size,
614
+ direction: "column",
615
+ alignItems: "stretch",
616
+ children: /*#__PURE__*/ jsx(Flex, {
617
+ alignItems: "center",
618
+ background: "neutral0",
619
+ paddingTop: 2,
620
+ paddingBottom: 2,
621
+ paddingLeft: 3,
622
+ paddingRight: 3,
623
+ hasRadius: true,
624
+ borderColor: "neutral200",
625
+ children: /*#__PURE__*/ jsx(Typography, {
626
+ textColor: "neutral800",
627
+ children: field.name
628
+ })
629
+ })
630
+ }, field.name)))
631
+ }),
632
+ /*#__PURE__*/ jsx(Link, {
633
+ // used to stop the edit form from appearing when we click here.
634
+ onClick: (e)=>e.stopPropagation(),
635
+ startIcon: /*#__PURE__*/ jsx(Cog, {}),
636
+ tag: NavLink,
637
+ to: `../components/${attribute.component}/configurations/edit`,
638
+ children: formatMessage({
639
+ id: getTranslation('components.FieldItem.linkToComponentLayout'),
640
+ defaultMessage: "Set the component's layout"
641
+ })
642
+ })
643
+ ]
644
+ }) : null,
645
+ attribute?.type === 'dynamiczone' ? /*#__PURE__*/ jsx(Flex, {
646
+ paddingTop: 3,
647
+ paddingRight: 3,
648
+ paddingBottom: 3,
649
+ paddingLeft: 0,
650
+ alignItems: "flex-start",
651
+ gap: 2,
652
+ width: "100%",
653
+ children: attribute?.components.map((uid)=>/*#__PURE__*/ jsxs(ComponentLink, {
654
+ // used to stop the edit form from appearing when we click here.
655
+ onClick: (e)=>e.stopPropagation(),
656
+ to: `../components/${uid}/configurations/edit`,
657
+ children: [
658
+ /*#__PURE__*/ jsx(ComponentIcon, {
659
+ icon: components[uid].settings.icon
660
+ }),
661
+ /*#__PURE__*/ jsx(Typography, {
662
+ fontSize: 1,
663
+ textColor: "neutral600",
664
+ fontWeight: "bold",
665
+ children: components[uid].settings.displayName
666
+ })
667
+ ]
668
+ }, uid))
669
+ }) : null
670
+ ]
671
+ })
672
+ ]
673
+ }),
674
+ value.name !== TEMP_FIELD_NAME && /*#__PURE__*/ jsx(EditFieldForm, {
675
+ attribute: attribute,
676
+ name: name,
677
+ onClose: ()=>setIsModalOpen(false)
678
+ })
679
+ ]
680
+ });
681
+ };
682
+ const DragButton = styled(IconButton)`
683
+ height: unset;
684
+ align-self: stretch;
685
+ display: flex;
686
+ align-items: center;
687
+ padding: 0;
688
+ border: none;
689
+ background-color: transparent;
690
+ border-radius: 0px;
691
+ border-right: 1px solid ${({ theme })=>theme.colors.neutral150};
692
+ cursor: all-scroll;
693
+
694
+ svg {
695
+ width: 1.2rem;
696
+ height: 1.2rem;
697
+ }
698
+ `;
699
+ const ComponentLink = styled(NavLink)`
700
+ display: flex;
701
+ flex-direction: column;
702
+ align-items: center;
703
+ gap: ${({ theme })=>theme.spaces[1]};
704
+ padding: ${(props)=>props.theme.spaces[2]};
705
+ border: 1px solid ${({ theme })=>theme.colors.neutral200};
706
+ background: ${({ theme })=>theme.colors.neutral0};
707
+ width: 14rem;
708
+ border-radius: ${({ theme })=>theme.borderRadius};
709
+ text-decoration: none;
710
+
711
+ &:focus,
712
+ &:hover {
713
+ ${({ theme })=>`
714
+ background-color: ${theme.colors.primary100};
715
+ border-color: ${theme.colors.primary200};
716
+
717
+ ${Typography} {
718
+ color: ${theme.colors.primary600};
719
+ }
720
+ `}
721
+
722
+ /* > ComponentIcon */
723
+ > div:first-child {
724
+ background: ${({ theme })=>theme.colors.primary200};
725
+ color: ${({ theme })=>theme.colors.primary600};
726
+
727
+ svg {
728
+ path {
729
+ fill: ${({ theme })=>theme.colors.primary600};
730
+ }
731
+ }
732
+ }
733
+ }
734
+ `;
735
+
736
+ const ConfigurationForm = ({ attributes, fieldSizes, layout: editLayout, onSubmit })=>{
737
+ const { components, settings, layout, metadatas } = editLayout;
738
+ const { formatMessage } = useIntl();
739
+ const initialValues = React.useMemo(()=>{
740
+ const transformations = pipe(flattenPanels, replaceMainFieldWithNameOnly, extractMetadata, addTmpSpaceToLayout, addTmpKeysToLayout);
741
+ return {
742
+ layout: transformations(layout),
743
+ settings
744
+ };
745
+ }, [
746
+ layout,
747
+ settings
748
+ ]);
749
+ return /*#__PURE__*/ jsx(Layouts.Root, {
750
+ children: /*#__PURE__*/ jsx(Main, {
751
+ children: /*#__PURE__*/ jsxs(Form, {
752
+ initialValues: initialValues,
753
+ onSubmit: onSubmit,
754
+ method: "PUT",
755
+ children: [
756
+ /*#__PURE__*/ jsx(Header, {
757
+ name: settings.displayName ?? ''
758
+ }),
759
+ /*#__PURE__*/ jsx(Layouts.Content, {
760
+ children: /*#__PURE__*/ jsxs(Flex, {
761
+ alignItems: "stretch",
762
+ background: "neutral0",
763
+ direction: "column",
764
+ gap: 6,
765
+ hasRadius: true,
766
+ shadow: "tableShadow",
767
+ paddingTop: 6,
768
+ paddingBottom: 6,
769
+ paddingLeft: 7,
770
+ paddingRight: 7,
771
+ children: [
772
+ /*#__PURE__*/ jsx(Typography, {
773
+ variant: "delta",
774
+ tag: "h2",
775
+ children: formatMessage({
776
+ id: getTranslation('containers.SettingPage.settings'),
777
+ defaultMessage: 'Settings'
778
+ })
779
+ }),
780
+ /*#__PURE__*/ jsxs(Grid.Root, {
781
+ children: [
782
+ /*#__PURE__*/ jsx(Grid.Item, {
783
+ col: 6,
784
+ s: 12,
785
+ direction: "column",
786
+ alignItems: "stretch",
787
+ children: /*#__PURE__*/ jsx(InputRenderer, {
788
+ type: "enumeration",
789
+ label: formatMessage({
790
+ id: getTranslation('containers.SettingPage.editSettings.entry.title'),
791
+ defaultMessage: 'Entry title'
792
+ }),
793
+ hint: formatMessage({
794
+ id: getTranslation('containers.SettingPage.editSettings.entry.title.description'),
795
+ defaultMessage: 'Set the display field of your entry'
796
+ }),
797
+ name: "settings.mainField",
798
+ options: Object.entries(attributes).reduce((acc, [key, attribute])=>{
799
+ if (!attribute) {
800
+ return acc;
801
+ }
802
+ /**
803
+ * Create the list of attributes from the schema as to which can
804
+ * be our `mainField` and dictate the display name of the schema
805
+ * we're editing.
806
+ */ if (!ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD.includes(attribute.type)) {
807
+ acc.push({
808
+ label: key,
809
+ value: key
810
+ });
811
+ }
812
+ return acc;
813
+ }, [])
814
+ })
815
+ }),
816
+ /*#__PURE__*/ jsx(Grid.Item, {
817
+ paddingTop: 6,
818
+ paddingBottom: 6,
819
+ col: 12,
820
+ s: 12,
821
+ direction: "column",
822
+ alignItems: "stretch",
823
+ children: /*#__PURE__*/ jsx(Divider, {})
824
+ }),
825
+ /*#__PURE__*/ jsx(Grid.Item, {
826
+ col: 12,
827
+ s: 12,
828
+ direction: "column",
829
+ alignItems: "stretch",
830
+ children: /*#__PURE__*/ jsx(Typography, {
831
+ variant: "delta",
832
+ tag: "h3",
833
+ children: formatMessage({
834
+ id: getTranslation('containers.SettingPage.view'),
835
+ defaultMessage: 'View'
836
+ })
837
+ })
838
+ }),
839
+ /*#__PURE__*/ jsx(Grid.Item, {
840
+ col: 12,
841
+ s: 12,
842
+ direction: "column",
843
+ alignItems: "stretch",
844
+ children: /*#__PURE__*/ jsx(Fields, {
845
+ attributes: attributes,
846
+ components: components,
847
+ fieldSizes: fieldSizes,
848
+ metadatas: metadatas
849
+ })
850
+ })
851
+ ]
852
+ })
853
+ ]
854
+ })
855
+ })
856
+ ]
857
+ })
858
+ })
859
+ });
860
+ };
861
+ /**
862
+ * @internal
863
+ * @description Panels don't exist in the layout, so we flatten by one.
864
+ */ const flattenPanels = (layout)=>layout.flat(1);
865
+ /**
866
+ * @internal
867
+ * @description We don't need the mainField object in the layout, we only need the name.
868
+ */ const replaceMainFieldWithNameOnly = (layout)=>layout.map((row)=>row.map((field)=>({
869
+ ...field,
870
+ mainField: field.mainField?.name
871
+ })));
872
+ /**
873
+ * @internal
874
+ * @description We extract the metadata values from the field layout, because these are editable by the user.
875
+ */ const extractMetadata = (layout)=>{
876
+ return layout.map((row)=>row.map(({ label, disabled, hint, placeholder, size, name, mainField })=>({
877
+ label,
878
+ editable: !disabled,
879
+ description: hint,
880
+ mainField,
881
+ placeholder,
882
+ size,
883
+ name,
884
+ __temp_key__: ''
885
+ })));
886
+ };
887
+ /**
888
+ * @internal
889
+ * @description Each row of the layout has a max size of 12 (based on bootstrap grid system)
890
+ * So in order to offer a better drop zone we add the _TEMP_ div to complete the remaining substract (12 - existing)
891
+ */ const addTmpSpaceToLayout = (layout)=>[
892
+ ...layout.map((row)=>{
893
+ const totalSpaceTaken = row.reduce((acc, field)=>acc + field.size, 0);
894
+ if (totalSpaceTaken < 12) {
895
+ return [
896
+ ...row,
897
+ {
898
+ name: TEMP_FIELD_NAME,
899
+ size: 12 - totalSpaceTaken,
900
+ __temp_key__: ''
901
+ }
902
+ ];
903
+ }
904
+ return row;
905
+ })
906
+ ];
907
+ /**
908
+ * @internal
909
+ * @description At this point of the transformations we have Field[][], but each row for the form should have a __temp_key__
910
+ * applied. This means we need to change it so `Field` is nested under the children property.
911
+ */ const addTmpKeysToLayout = (layout)=>{
912
+ const keys = generateNKeysBetween$1(undefined, undefined, layout.length);
913
+ return layout.map((row, rowIndex)=>{
914
+ const fieldKeys = generateNKeysBetween$1(undefined, undefined, row.length);
915
+ return {
916
+ __temp_key__: keys[rowIndex],
917
+ children: row.map((field, fieldIndex)=>{
918
+ return {
919
+ ...field,
920
+ __temp_key__: fieldKeys[fieldIndex]
921
+ };
922
+ })
923
+ };
924
+ });
925
+ };
926
+ const Header = ({ name })=>{
927
+ const { formatMessage } = useIntl();
928
+ const modified = useForm('Header', (state)=>state.modified);
929
+ const isSubmitting = useForm('Header', (state)=>state.isSubmitting);
930
+ return /*#__PURE__*/ jsx(Layouts.Header, {
931
+ title: formatMessage({
932
+ id: getTranslation('components.SettingsViewWrapper.pluginHeader.title'),
933
+ defaultMessage: `Configure the view - {name}`
934
+ }, {
935
+ name: capitalise(name)
936
+ }),
937
+ subtitle: formatMessage({
938
+ id: getTranslation('components.SettingsViewWrapper.pluginHeader.description.edit-settings'),
939
+ defaultMessage: 'Customize how the edit view will look like.'
940
+ }),
941
+ navigationAction: /*#__PURE__*/ jsx(BackButton, {}),
942
+ primaryAction: /*#__PURE__*/ jsx(Button, {
943
+ disabled: !modified,
944
+ loading: isSubmitting,
945
+ type: "submit",
946
+ children: formatMessage({
947
+ id: 'global.save',
948
+ defaultMessage: 'Save'
949
+ })
950
+ })
951
+ });
952
+ };
953
+
954
+ export { ConfigurationForm as C, TEMP_FIELD_NAME as T };
955
+ //# sourceMappingURL=Form-CiDhWFF2.mjs.map