@strapi/content-manager 0.0.0-experimental.d042f6a350fa3a48d61e7c56875e2a0a7ba3c8f5 → 0.0.0-experimental.d2a56e52af31fcf0f0c582a5a2e58e310966e96b

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 (431) 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-CGn9IYeg.js +298 -0
  6. package/dist/admin/chunks/ComponentConfigurationPage-CGn9IYeg.js.map +1 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-DgYK4xW6.mjs +276 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-DgYK4xW6.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-7w_-4jF4.js +180 -0
  14. package/dist/admin/chunks/EditConfigurationPage-7w_-4jF4.js.map +1 -0
  15. package/dist/admin/chunks/EditConfigurationPage-C05SwwH-.mjs +158 -0
  16. package/dist/admin/chunks/EditConfigurationPage-C05SwwH-.mjs.map +1 -0
  17. package/dist/admin/chunks/EditViewPage-CVRJBOEv.mjs +318 -0
  18. package/dist/admin/chunks/EditViewPage-CVRJBOEv.mjs.map +1 -0
  19. package/dist/admin/chunks/EditViewPage-CuQfZJDf.js +341 -0
  20. package/dist/admin/chunks/EditViewPage-CuQfZJDf.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-BqNYRsCb.js +978 -0
  26. package/dist/admin/chunks/Form-BqNYRsCb.js.map +1 -0
  27. package/dist/admin/chunks/Form-DaEnqAeV.mjs +955 -0
  28. package/dist/admin/chunks/Form-DaEnqAeV.mjs.map +1 -0
  29. package/dist/admin/chunks/History-B7dGNfmx.mjs +1361 -0
  30. package/dist/admin/chunks/History-B7dGNfmx.mjs.map +1 -0
  31. package/dist/admin/chunks/History-CEoOna4w.js +1384 -0
  32. package/dist/admin/chunks/History-CEoOna4w.js.map +1 -0
  33. package/dist/admin/chunks/Input-B3QUS9rv.mjs +8473 -0
  34. package/dist/admin/chunks/Input-B3QUS9rv.mjs.map +1 -0
  35. package/dist/admin/chunks/Input-B8I0b9aD.js +8507 -0
  36. package/dist/admin/chunks/Input-B8I0b9aD.js.map +1 -0
  37. package/dist/admin/chunks/ListConfigurationPage-BbjJweN-.js +818 -0
  38. package/dist/admin/chunks/ListConfigurationPage-BbjJweN-.js.map +1 -0
  39. package/dist/admin/chunks/ListConfigurationPage-VtFQ5mOK.mjs +795 -0
  40. package/dist/admin/chunks/ListConfigurationPage-VtFQ5mOK.mjs.map +1 -0
  41. package/dist/admin/chunks/ListViewPage-Cg3zbT7Y.mjs +1132 -0
  42. package/dist/admin/chunks/ListViewPage-Cg3zbT7Y.mjs.map +1 -0
  43. package/dist/admin/chunks/ListViewPage-CzUm2VJN.js +1154 -0
  44. package/dist/admin/chunks/ListViewPage-CzUm2VJN.js.map +1 -0
  45. package/dist/admin/chunks/NoContentTypePage-FcLLn2Wt.js +60 -0
  46. package/dist/admin/chunks/NoContentTypePage-FcLLn2Wt.js.map +1 -0
  47. package/dist/admin/chunks/NoContentTypePage-NOf7Aq_E.mjs +58 -0
  48. package/dist/admin/chunks/NoContentTypePage-NOf7Aq_E.mjs.map +1 -0
  49. package/dist/admin/chunks/NoPermissionsPage-DmeyXtCk.js +39 -0
  50. package/dist/admin/chunks/NoPermissionsPage-DmeyXtCk.js.map +1 -0
  51. package/dist/admin/chunks/NoPermissionsPage-OVr9KG6L.mjs +37 -0
  52. package/dist/admin/chunks/NoPermissionsPage-OVr9KG6L.mjs.map +1 -0
  53. package/dist/admin/chunks/Preview-BH9l1QXk.mjs +593 -0
  54. package/dist/admin/chunks/Preview-BH9l1QXk.mjs.map +1 -0
  55. package/dist/admin/chunks/Preview-BYKkpc11.js +615 -0
  56. package/dist/admin/chunks/Preview-BYKkpc11.js.map +1 -0
  57. package/dist/admin/chunks/ar-DckYq_WK.mjs +222 -0
  58. package/dist/{_chunks/ar-CCEVvqGG.mjs.map → admin/chunks/ar-DckYq_WK.mjs.map} +1 -1
  59. package/dist/admin/chunks/ar-DeQBSsfl.js +227 -0
  60. package/dist/{_chunks/ru-BT3ybNny.js.map → admin/chunks/ar-DeQBSsfl.js.map} +1 -1
  61. package/dist/admin/chunks/ca-ClDTvatJ.js +202 -0
  62. package/dist/admin/chunks/ca-ClDTvatJ.js.map +1 -0
  63. package/dist/admin/chunks/ca-DviY7mRj.mjs +197 -0
  64. package/dist/admin/chunks/ca-DviY7mRj.mjs.map +1 -0
  65. package/dist/admin/chunks/cs-BJFxwIWj.js +126 -0
  66. package/dist/{_chunks/cs-CkJy6B2v.js.map → admin/chunks/cs-BJFxwIWj.js.map} +1 -1
  67. package/dist/admin/chunks/cs-C7OSYFQ7.mjs +122 -0
  68. package/dist/{_chunks/cs-CM2aBUar.mjs.map → admin/chunks/cs-C7OSYFQ7.mjs.map} +1 -1
  69. package/dist/admin/chunks/de-5QRlDHyR.mjs +195 -0
  70. package/dist/{_chunks/eu-CdALomew.mjs.map → admin/chunks/de-5QRlDHyR.mjs.map} +1 -1
  71. package/dist/admin/chunks/de-CbImAUA5.js +200 -0
  72. package/dist/{_chunks/gu-BRmF601H.js.map → admin/chunks/de-CbImAUA5.js.map} +1 -1
  73. package/dist/admin/chunks/en-C2zEwS3-.mjs +313 -0
  74. package/dist/{_chunks/en-D65uIF6Y.mjs.map → admin/chunks/en-C2zEwS3-.mjs.map} +1 -1
  75. package/dist/admin/chunks/en-G976DLsg.js +318 -0
  76. package/dist/{_chunks/en-BR48D_RH.js.map → admin/chunks/en-G976DLsg.js.map} +1 -1
  77. package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
  78. package/dist/{_chunks/es-9K52xZIr.js.map → admin/chunks/es-C8vLuvZL.js.map} +1 -1
  79. package/dist/admin/chunks/es-DkoWSExG.mjs +192 -0
  80. package/dist/{_chunks/ja-BHqhDq4V.mjs.map → admin/chunks/es-DkoWSExG.mjs.map} +1 -1
  81. package/dist/admin/chunks/eu-BG1xX7HK.mjs +198 -0
  82. package/dist/admin/chunks/eu-BG1xX7HK.mjs.map +1 -0
  83. package/dist/admin/chunks/eu-BJW3AvXu.js +203 -0
  84. package/dist/admin/chunks/eu-BJW3AvXu.js.map +1 -0
  85. package/dist/admin/chunks/fr-CFdRaRVj.mjs +215 -0
  86. package/dist/admin/chunks/fr-CFdRaRVj.mjs.map +1 -0
  87. package/dist/admin/chunks/fr-gQSilC7w.js +220 -0
  88. package/dist/admin/chunks/fr-gQSilC7w.js.map +1 -0
  89. package/dist/admin/chunks/gu-D5MMMXRs.mjs +196 -0
  90. package/dist/admin/chunks/gu-D5MMMXRs.mjs.map +1 -0
  91. package/dist/admin/chunks/gu-DPU4wyx7.js +201 -0
  92. package/dist/{_chunks/eu-VDH-3ovk.js.map → admin/chunks/gu-DPU4wyx7.js.map} +1 -1
  93. package/dist/admin/chunks/hi-Dp4omeBb.js +201 -0
  94. package/dist/admin/chunks/hi-Dp4omeBb.js.map +1 -0
  95. package/dist/admin/chunks/hi-lp17SCjr.mjs +196 -0
  96. package/dist/admin/chunks/hi-lp17SCjr.mjs.map +1 -0
  97. package/dist/{_chunks/hooks-BAaaKPS_.js → admin/chunks/hooks-D-sOYd1s.js} +6 -3
  98. package/dist/admin/chunks/hooks-D-sOYd1s.js.map +1 -0
  99. package/dist/admin/chunks/hooks-DMvik5y_.mjs +7 -0
  100. package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +1 -0
  101. package/dist/admin/chunks/hu-CLka1U2C.mjs +198 -0
  102. package/dist/admin/chunks/hu-CLka1U2C.mjs.map +1 -0
  103. package/dist/admin/chunks/hu-CtFJuhTd.js +203 -0
  104. package/dist/admin/chunks/hu-CtFJuhTd.js.map +1 -0
  105. package/dist/admin/chunks/id-D7V5S1rB.js +161 -0
  106. package/dist/{_chunks/it-DkBIs7vD.js.map → admin/chunks/id-D7V5S1rB.js.map} +1 -1
  107. package/dist/admin/chunks/id-USfY9m1g.mjs +156 -0
  108. package/dist/{_chunks/id-BtwA9WJT.mjs.map → admin/chunks/id-USfY9m1g.mjs.map} +1 -1
  109. package/dist/admin/chunks/index-BE7PI9Wp.mjs +5450 -0
  110. package/dist/admin/chunks/index-BE7PI9Wp.mjs.map +1 -0
  111. package/dist/admin/chunks/index-BwIhYBsG.js +5520 -0
  112. package/dist/admin/chunks/index-BwIhYBsG.js.map +1 -0
  113. package/dist/admin/chunks/it-BAHrwmYS.mjs +158 -0
  114. package/dist/{_chunks/it-BrVPqaf1.mjs.map → admin/chunks/it-BAHrwmYS.mjs.map} +1 -1
  115. package/dist/admin/chunks/it-CQFpa_Dc.js +163 -0
  116. package/dist/{_chunks/ko-woFZPmLk.js.map → admin/chunks/it-CQFpa_Dc.js.map} +1 -1
  117. package/dist/admin/chunks/ja-BWKmBJFT.mjs +192 -0
  118. package/dist/{_chunks/ko-HVQRlfUI.mjs.map → admin/chunks/ja-BWKmBJFT.mjs.map} +1 -1
  119. package/dist/admin/chunks/ja-jdQM-B79.js +197 -0
  120. package/dist/{_chunks/de-CCEmbAah.js.map → admin/chunks/ja-jdQM-B79.js.map} +1 -1
  121. package/dist/admin/chunks/ko-CgADGBNt.mjs +191 -0
  122. package/dist/{_chunks/es-D34tqjMw.mjs.map → admin/chunks/ko-CgADGBNt.mjs.map} +1 -1
  123. package/dist/admin/chunks/ko-k46sEyzt.js +196 -0
  124. package/dist/{_chunks/ja-7sfIbjxE.js.map → admin/chunks/ko-k46sEyzt.js.map} +1 -1
  125. package/dist/admin/chunks/layout-9zlUM9V3.mjs +672 -0
  126. package/dist/admin/chunks/layout-9zlUM9V3.mjs.map +1 -0
  127. package/dist/admin/chunks/layout-Cr0HaJVS.js +692 -0
  128. package/dist/admin/chunks/layout-Cr0HaJVS.js.map +1 -0
  129. package/dist/admin/chunks/ml-CnhCfOn_.mjs +196 -0
  130. package/dist/admin/chunks/ml-CnhCfOn_.mjs.map +1 -0
  131. package/dist/admin/chunks/ml-DqxPwODx.js +201 -0
  132. package/dist/admin/chunks/ml-DqxPwODx.js.map +1 -0
  133. package/dist/admin/chunks/ms-Bh09NFff.mjs +140 -0
  134. package/dist/{_chunks/ms-m_WjyWx7.mjs.map → admin/chunks/ms-Bh09NFff.mjs.map} +1 -1
  135. package/dist/admin/chunks/ms-CvSC0OdG.js +145 -0
  136. package/dist/{_chunks/ms-BuFotyP_.js.map → admin/chunks/ms-CvSC0OdG.js.map} +1 -1
  137. package/dist/admin/chunks/nl-BEubhS8C.js +203 -0
  138. package/dist/admin/chunks/nl-BEubhS8C.js.map +1 -0
  139. package/dist/admin/chunks/nl-C8HYflTc.mjs +198 -0
  140. package/dist/admin/chunks/nl-C8HYflTc.mjs.map +1 -0
  141. package/dist/admin/chunks/objects-BJTP843m.js +343 -0
  142. package/dist/admin/chunks/objects-BJTP843m.js.map +1 -0
  143. package/dist/admin/chunks/objects-D2z-IJgu.mjs +317 -0
  144. package/dist/admin/chunks/objects-D2z-IJgu.mjs.map +1 -0
  145. package/dist/admin/chunks/pl-DWhGDzmM.js +200 -0
  146. package/dist/{_chunks/ca-Cmk45QO6.js.map → admin/chunks/pl-DWhGDzmM.js.map} +1 -1
  147. package/dist/admin/chunks/pl-MFCZJZuZ.mjs +195 -0
  148. package/dist/{_chunks/ca-5U32ON2v.mjs.map → admin/chunks/pl-MFCZJZuZ.mjs.map} +1 -1
  149. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +202 -0
  150. package/dist/{_chunks/pt-BR-BiOz37D9.js.map → admin/chunks/pt-BR-CPtAXD-4.js.map} +1 -1
  151. package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs +197 -0
  152. package/dist/{_chunks/pt-BR-C71iDxnh.mjs.map → admin/chunks/pt-BR-CcotyBGJ.mjs.map} +1 -1
  153. package/dist/admin/chunks/pt-BoPxN80n.js +96 -0
  154. package/dist/admin/chunks/pt-BoPxN80n.js.map +1 -0
  155. package/dist/admin/chunks/pt-HbmgeiYO.mjs +93 -0
  156. package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +1 -0
  157. package/dist/admin/chunks/ru-C0op0ALG.js +232 -0
  158. package/dist/admin/chunks/ru-C0op0ALG.js.map +1 -0
  159. package/dist/admin/chunks/ru-CB4BUyQp.mjs +230 -0
  160. package/dist/{_chunks/ru-BE6A4Exp.mjs.map → admin/chunks/ru-CB4BUyQp.mjs.map} +1 -1
  161. package/dist/admin/chunks/sa-B_FuPyMw.js +201 -0
  162. package/dist/admin/chunks/sa-B_FuPyMw.js.map +1 -0
  163. package/dist/admin/chunks/sa-n_aPA-pU.mjs +196 -0
  164. package/dist/admin/chunks/sa-n_aPA-pU.mjs.map +1 -0
  165. package/dist/admin/chunks/sk-D_iXML2C.js +203 -0
  166. package/dist/admin/chunks/sk-D_iXML2C.js.map +1 -0
  167. package/dist/admin/chunks/sk-tn_BDjE2.mjs +198 -0
  168. package/dist/admin/chunks/sk-tn_BDjE2.mjs.map +1 -0
  169. package/dist/admin/chunks/sv-BstBC1Yp.js +203 -0
  170. package/dist/admin/chunks/sv-BstBC1Yp.js.map +1 -0
  171. package/dist/admin/chunks/sv-cq4ZrQRd.mjs +198 -0
  172. package/dist/admin/chunks/sv-cq4ZrQRd.mjs.map +1 -0
  173. package/dist/admin/chunks/th-lXoOCqPC.js +149 -0
  174. package/dist/{_chunks/th-D9_GfAjc.js.map → admin/chunks/th-lXoOCqPC.js.map} +1 -1
  175. package/dist/admin/chunks/th-mUH7hEtc.mjs +144 -0
  176. package/dist/{_chunks/uk-CR-zDhAY.mjs.map → admin/chunks/th-mUH7hEtc.mjs.map} +1 -1
  177. package/dist/admin/chunks/tr-CkS6sLIE.js +200 -0
  178. package/dist/admin/chunks/tr-CkS6sLIE.js.map +1 -0
  179. package/dist/admin/chunks/tr-Yt38daxh.mjs +195 -0
  180. package/dist/{_chunks/de-C72KDNOl.mjs.map → admin/chunks/tr-Yt38daxh.mjs.map} +1 -1
  181. package/dist/admin/chunks/uk-BtM6WnaE.mjs +313 -0
  182. package/dist/admin/chunks/uk-BtM6WnaE.mjs.map +1 -0
  183. package/dist/admin/chunks/uk-DB6OgySY.js +318 -0
  184. package/dist/admin/chunks/uk-DB6OgySY.js.map +1 -0
  185. package/dist/admin/chunks/usePrev-DgZBp9Oo.js +194 -0
  186. package/dist/admin/chunks/usePrev-DgZBp9Oo.js.map +1 -0
  187. package/dist/admin/chunks/usePrev-PisKKvhT.mjs +187 -0
  188. package/dist/admin/chunks/usePrev-PisKKvhT.mjs.map +1 -0
  189. package/dist/admin/chunks/vi-BGr1X_HZ.js +112 -0
  190. package/dist/{_chunks/vi-CJlYDheJ.js.map → admin/chunks/vi-BGr1X_HZ.js.map} +1 -1
  191. package/dist/admin/chunks/vi-CvBGlTjr.mjs +108 -0
  192. package/dist/{_chunks/vi-DUXIk_fw.mjs.map → admin/chunks/vi-CvBGlTjr.mjs.map} +1 -1
  193. package/dist/admin/chunks/zh-BmF-sHaT.mjs +205 -0
  194. package/dist/admin/chunks/zh-BmF-sHaT.mjs.map +1 -0
  195. package/dist/admin/chunks/zh-DwFu_Kfj.js +210 -0
  196. package/dist/admin/chunks/zh-DwFu_Kfj.js.map +1 -0
  197. package/dist/admin/chunks/zh-Hans-CI0HKio3.mjs +934 -0
  198. package/dist/{_chunks/zh-Hans-BPQcRIyH.mjs.map → admin/chunks/zh-Hans-CI0HKio3.mjs.map} +1 -1
  199. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +953 -0
  200. package/dist/{_chunks/zh-Hans-9kOncHGw.js.map → admin/chunks/zh-Hans-JVK9x7xr.js.map} +1 -1
  201. package/dist/admin/index.js +24 -4
  202. package/dist/admin/index.js.map +1 -1
  203. package/dist/admin/index.mjs +17 -13
  204. package/dist/admin/index.mjs.map +1 -1
  205. package/dist/admin/src/components/InjectionZone.d.ts +7 -1
  206. package/dist/admin/src/content-manager.d.ts +4 -0
  207. package/dist/admin/src/features/DocumentContext.d.ts +53 -0
  208. package/dist/admin/src/features/DocumentRBAC.d.ts +3 -2
  209. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  210. package/dist/admin/src/hooks/useDocument.d.ts +4 -2
  211. package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -0
  212. package/dist/admin/src/index.d.ts +1 -0
  213. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +2 -1
  214. package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
  215. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +49 -1
  216. package/dist/admin/src/pages/EditView/components/FormInputs/Relations/RelationModal.d.ts +8 -0
  217. package/dist/admin/src/pages/EditView/components/FormInputs/{Relations.d.ts → Relations/Relations.d.ts} +8 -2
  218. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +1 -2
  219. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +9 -3
  220. package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +7 -4
  221. package/dist/admin/src/preview/index.d.ts +2 -3
  222. package/dist/admin/src/preview/pages/Preview.d.ts +2 -0
  223. package/dist/server/index.js +5459 -4387
  224. package/dist/server/index.js.map +1 -1
  225. package/dist/server/index.mjs +5446 -4372
  226. package/dist/server/index.mjs.map +1 -1
  227. package/dist/server/src/controllers/utils/metadata.d.ts +1 -1
  228. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  229. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  230. package/dist/server/src/services/utils/count.d.ts +1 -1
  231. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  232. package/dist/server/src/services/utils/populate.d.ts +1 -1
  233. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  234. package/dist/shared/contracts/collection-types.d.ts +0 -1
  235. package/dist/shared/contracts/components.d.ts +0 -1
  236. package/dist/shared/contracts/content-types.d.ts +0 -1
  237. package/dist/shared/contracts/history-versions.d.ts +0 -1
  238. package/dist/shared/contracts/index.d.ts +0 -1
  239. package/dist/shared/contracts/init.d.ts +0 -1
  240. package/dist/shared/contracts/preview.d.ts +0 -1
  241. package/dist/shared/contracts/relations.d.ts +1 -2
  242. package/dist/shared/contracts/relations.d.ts.map +1 -1
  243. package/dist/shared/contracts/review-workflows.d.ts +0 -1
  244. package/dist/shared/contracts/single-types.d.ts +0 -1
  245. package/dist/shared/contracts/uid.d.ts +0 -1
  246. package/dist/shared/index.d.ts +0 -1
  247. package/dist/shared/index.js +35 -24
  248. package/dist/shared/index.js.map +1 -1
  249. package/dist/shared/index.mjs +34 -25
  250. package/dist/shared/index.mjs.map +1 -1
  251. package/package.json +16 -13
  252. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
  253. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
  254. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
  255. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
  256. package/dist/_chunks/ComponentConfigurationPage-9_4yUE9L.mjs +0 -236
  257. package/dist/_chunks/ComponentConfigurationPage-9_4yUE9L.mjs.map +0 -1
  258. package/dist/_chunks/ComponentConfigurationPage-DBSh-kET.js +0 -254
  259. package/dist/_chunks/ComponentConfigurationPage-DBSh-kET.js.map +0 -1
  260. package/dist/_chunks/ComponentIcon-CRbtQEUV.js +0 -175
  261. package/dist/_chunks/ComponentIcon-CRbtQEUV.js.map +0 -1
  262. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
  263. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
  264. package/dist/_chunks/EditConfigurationPage-Bl_U2JgH.js +0 -150
  265. package/dist/_chunks/EditConfigurationPage-Bl_U2JgH.js.map +0 -1
  266. package/dist/_chunks/EditConfigurationPage-COe6hjPC.mjs +0 -132
  267. package/dist/_chunks/EditConfigurationPage-COe6hjPC.mjs.map +0 -1
  268. package/dist/_chunks/EditViewPage-D4yFJET6.js +0 -209
  269. package/dist/_chunks/EditViewPage-D4yFJET6.js.map +0 -1
  270. package/dist/_chunks/EditViewPage-DrmVmYN0.mjs +0 -191
  271. package/dist/_chunks/EditViewPage-DrmVmYN0.mjs.map +0 -1
  272. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  273. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  274. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  275. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  276. package/dist/_chunks/Form-C4rSaGsz.js +0 -778
  277. package/dist/_chunks/Form-C4rSaGsz.js.map +0 -1
  278. package/dist/_chunks/Form-DamaxNpG.mjs +0 -758
  279. package/dist/_chunks/Form-DamaxNpG.mjs.map +0 -1
  280. package/dist/_chunks/History-D1PreDSY.mjs +0 -999
  281. package/dist/_chunks/History-D1PreDSY.mjs.map +0 -1
  282. package/dist/_chunks/History-DTm8UCCQ.js +0 -1019
  283. package/dist/_chunks/History-DTm8UCCQ.js.map +0 -1
  284. package/dist/_chunks/Input-B7sapvBG.js +0 -5617
  285. package/dist/_chunks/Input-B7sapvBG.js.map +0 -1
  286. package/dist/_chunks/Input-CZ1YvjHR.mjs +0 -5585
  287. package/dist/_chunks/Input-CZ1YvjHR.mjs.map +0 -1
  288. package/dist/_chunks/ListConfigurationPage-Bbi32isk.mjs +0 -633
  289. package/dist/_chunks/ListConfigurationPage-Bbi32isk.mjs.map +0 -1
  290. package/dist/_chunks/ListConfigurationPage-ysFMjKI3.js +0 -652
  291. package/dist/_chunks/ListConfigurationPage-ysFMjKI3.js.map +0 -1
  292. package/dist/_chunks/ListViewPage-Bud_jBDQ.mjs +0 -854
  293. package/dist/_chunks/ListViewPage-Bud_jBDQ.mjs.map +0 -1
  294. package/dist/_chunks/ListViewPage-DTuuxU3n.js +0 -877
  295. package/dist/_chunks/ListViewPage-DTuuxU3n.js.map +0 -1
  296. package/dist/_chunks/NoContentTypePage-CL7VVeYs.js +0 -51
  297. package/dist/_chunks/NoContentTypePage-CL7VVeYs.js.map +0 -1
  298. package/dist/_chunks/NoContentTypePage-DVhkugsf.mjs +0 -51
  299. package/dist/_chunks/NoContentTypePage-DVhkugsf.mjs.map +0 -1
  300. package/dist/_chunks/NoPermissionsPage-CMdM-dCo.mjs +0 -23
  301. package/dist/_chunks/NoPermissionsPage-CMdM-dCo.mjs.map +0 -1
  302. package/dist/_chunks/NoPermissionsPage-v7I599vC.js +0 -23
  303. package/dist/_chunks/NoPermissionsPage-v7I599vC.js.map +0 -1
  304. package/dist/_chunks/Preview-BNuU0SuQ.mjs +0 -287
  305. package/dist/_chunks/Preview-BNuU0SuQ.mjs.map +0 -1
  306. package/dist/_chunks/Preview-Cxq-uI6D.js +0 -305
  307. package/dist/_chunks/Preview-Cxq-uI6D.js.map +0 -1
  308. package/dist/_chunks/Relations-C2Ahkrdg.mjs +0 -728
  309. package/dist/_chunks/Relations-C2Ahkrdg.mjs.map +0 -1
  310. package/dist/_chunks/Relations-CWS79QQn.js +0 -747
  311. package/dist/_chunks/Relations-CWS79QQn.js.map +0 -1
  312. package/dist/_chunks/ar-BUUWXIYu.js +0 -226
  313. package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
  314. package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
  315. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  316. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  317. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  318. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  319. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  320. package/dist/_chunks/de-CCEmbAah.js +0 -199
  321. package/dist/_chunks/en-BR48D_RH.js +0 -312
  322. package/dist/_chunks/en-D65uIF6Y.mjs +0 -312
  323. package/dist/_chunks/es-9K52xZIr.js +0 -196
  324. package/dist/_chunks/es-D34tqjMw.mjs +0 -196
  325. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  326. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  327. package/dist/_chunks/fr-C43IbhA_.js +0 -219
  328. package/dist/_chunks/fr-C43IbhA_.js.map +0 -1
  329. package/dist/_chunks/fr-DBseuRuB.mjs +0 -219
  330. package/dist/_chunks/fr-DBseuRuB.mjs.map +0 -1
  331. package/dist/_chunks/gu-BRmF601H.js +0 -200
  332. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  333. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  334. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  335. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  336. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  337. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  338. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  339. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  340. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  341. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  342. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  343. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  344. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  345. package/dist/_chunks/id-B5Ser98A.js +0 -160
  346. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  347. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  348. package/dist/_chunks/index-DQsvBb_N.js +0 -4500
  349. package/dist/_chunks/index-DQsvBb_N.js.map +0 -1
  350. package/dist/_chunks/index-ZKrsjv-2.mjs +0 -4481
  351. package/dist/_chunks/index-ZKrsjv-2.mjs.map +0 -1
  352. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  353. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  354. package/dist/_chunks/ja-7sfIbjxE.js +0 -196
  355. package/dist/_chunks/ja-BHqhDq4V.mjs +0 -196
  356. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  357. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  358. package/dist/_chunks/layout-Cl0NhlQB.js +0 -488
  359. package/dist/_chunks/layout-Cl0NhlQB.js.map +0 -1
  360. package/dist/_chunks/layout-fQk1rMk9.mjs +0 -471
  361. package/dist/_chunks/layout-fQk1rMk9.mjs.map +0 -1
  362. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  363. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  364. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  365. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  366. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  367. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  368. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  369. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  370. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  371. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  372. package/dist/_chunks/objects-BcXOv6_9.js +0 -47
  373. package/dist/_chunks/objects-BcXOv6_9.js.map +0 -1
  374. package/dist/_chunks/objects-D6yBsdmx.mjs +0 -45
  375. package/dist/_chunks/objects-D6yBsdmx.mjs.map +0 -1
  376. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  377. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  378. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  379. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  380. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  381. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  382. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  383. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  384. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  385. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  386. package/dist/_chunks/relations-BRfBxVbX.js +0 -133
  387. package/dist/_chunks/relations-BRfBxVbX.js.map +0 -1
  388. package/dist/_chunks/relations-BakOFl_1.mjs +0 -134
  389. package/dist/_chunks/relations-BakOFl_1.mjs.map +0 -1
  390. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  391. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  392. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  393. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  394. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  395. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  396. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  397. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  398. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  399. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  400. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  401. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  402. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  403. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  404. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  405. package/dist/_chunks/th-BqbI8lIT.mjs.map +0 -1
  406. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  407. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  408. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  409. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  410. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  411. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  412. package/dist/_chunks/uk-C8EiqJY7.js.map +0 -1
  413. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  414. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js +0 -245
  415. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js.map +0 -1
  416. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs +0 -228
  417. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs.map +0 -1
  418. package/dist/_chunks/usePrev-CZGy2Vjf.mjs +0 -29
  419. package/dist/_chunks/usePrev-CZGy2Vjf.mjs.map +0 -1
  420. package/dist/_chunks/usePrev-D5J_2fEu.js +0 -28
  421. package/dist/_chunks/usePrev-D5J_2fEu.js.map +0 -1
  422. package/dist/_chunks/vi-CJlYDheJ.js +0 -111
  423. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  424. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  425. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  426. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  427. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  428. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  429. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
  430. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +0 -49
  431. package/dist/admin/src/preview/components/PreviewContent.d.ts +0 -2
@@ -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, K as ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD, F as capitalise, g as getTranslation } from './index-BE7PI9Wp.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 './objects-D2z-IJgu.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-DaEnqAeV.mjs.map