@strapi/content-manager 0.0.0-next.fc1775f7731f8999840e56e298a216b9a6c5c4ad → 0.0.0-next.fc9d26d995624dc886b29f563e1de655d47e6609

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 (443) hide show
  1. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js +80 -0
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.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-BcLDueh-.js +298 -0
  6. package/dist/admin/chunks/ComponentConfigurationPage-BcLDueh-.js.map +1 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-C2tPb7gH.js +276 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-C2tPb7gH.js.map +1 -0
  9. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js +153 -0
  10. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.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-BwmBhyl0.js +180 -0
  14. package/dist/admin/chunks/EditConfigurationPage-BwmBhyl0.js.map +1 -0
  15. package/dist/admin/chunks/EditConfigurationPage-D4Oio8m1.js +158 -0
  16. package/dist/admin/chunks/EditConfigurationPage-D4Oio8m1.js.map +1 -0
  17. package/dist/admin/chunks/EditViewPage-CzwW9usH.js +337 -0
  18. package/dist/admin/chunks/EditViewPage-CzwW9usH.js.map +1 -0
  19. package/dist/admin/chunks/EditViewPage-DUYzyJRA.js +314 -0
  20. package/dist/admin/chunks/EditViewPage-DUYzyJRA.js.map +1 -0
  21. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js +56 -0
  22. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.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-BNpDL5sM.js +955 -0
  26. package/dist/admin/chunks/Form-BNpDL5sM.js.map +1 -0
  27. package/dist/admin/chunks/Form-BhIYfGuy.js +978 -0
  28. package/dist/admin/chunks/Form-BhIYfGuy.js.map +1 -0
  29. package/dist/admin/chunks/History-B8UudJwA.js +1380 -0
  30. package/dist/admin/chunks/History-B8UudJwA.js.map +1 -0
  31. package/dist/admin/chunks/History-BIB0-AfT.js +1357 -0
  32. package/dist/admin/chunks/History-BIB0-AfT.js.map +1 -0
  33. package/dist/admin/chunks/Input-B6avNTdM.js +6755 -0
  34. package/dist/admin/chunks/Input-B6avNTdM.js.map +1 -0
  35. package/dist/admin/chunks/Input-D7x4QMoZ.js +6786 -0
  36. package/dist/admin/chunks/Input-D7x4QMoZ.js.map +1 -0
  37. package/dist/admin/chunks/ListConfigurationPage-CqNUcBK5.js +818 -0
  38. package/dist/admin/chunks/ListConfigurationPage-CqNUcBK5.js.map +1 -0
  39. package/dist/admin/chunks/ListConfigurationPage-DzIDxb_n.js +795 -0
  40. package/dist/admin/chunks/ListConfigurationPage-DzIDxb_n.js.map +1 -0
  41. package/dist/admin/chunks/ListViewPage-C2jqACsH.js +1154 -0
  42. package/dist/admin/chunks/ListViewPage-C2jqACsH.js.map +1 -0
  43. package/dist/admin/chunks/ListViewPage-CUu7nXL6.js +1132 -0
  44. package/dist/admin/chunks/ListViewPage-CUu7nXL6.js.map +1 -0
  45. package/dist/admin/chunks/NoContentTypePage-CPvNU2zt.js +57 -0
  46. package/dist/admin/chunks/NoContentTypePage-CPvNU2zt.js.map +1 -0
  47. package/dist/admin/chunks/NoContentTypePage-DP8WmGnH.js +59 -0
  48. package/dist/admin/chunks/NoContentTypePage-DP8WmGnH.js.map +1 -0
  49. package/dist/admin/chunks/NoPermissionsPage-DS4v_Wkt.js +36 -0
  50. package/dist/admin/chunks/NoPermissionsPage-DS4v_Wkt.js.map +1 -0
  51. package/dist/admin/chunks/NoPermissionsPage-DdE7dHGN.js +38 -0
  52. package/dist/admin/chunks/NoPermissionsPage-DdE7dHGN.js.map +1 -0
  53. package/dist/admin/chunks/Preview-B-Qxu3nw.js +457 -0
  54. package/dist/admin/chunks/Preview-B-Qxu3nw.js.map +1 -0
  55. package/dist/admin/chunks/Preview-DF_PNpvE.js +435 -0
  56. package/dist/admin/chunks/Preview-DF_PNpvE.js.map +1 -0
  57. package/dist/admin/chunks/Relations-BKR-Kn-x.js +827 -0
  58. package/dist/admin/chunks/Relations-BKR-Kn-x.js.map +1 -0
  59. package/dist/admin/chunks/Relations-Bc1mVCAn.js +853 -0
  60. package/dist/admin/chunks/Relations-Bc1mVCAn.js.map +1 -0
  61. package/dist/admin/chunks/ar-DckYq_WK.js +222 -0
  62. package/dist/admin/chunks/ar-DckYq_WK.js.map +1 -0
  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.js +197 -0
  68. package/dist/{_chunks/de-CCEmbAah.js.map → admin/chunks/ca-DviY7mRj.js.map} +1 -1
  69. package/dist/admin/chunks/cs-BJFxwIWj.js +126 -0
  70. package/dist/{_chunks/ms-BuFotyP_.js.map → admin/chunks/cs-BJFxwIWj.js.map} +1 -1
  71. package/dist/admin/chunks/cs-C7OSYFQ7.js +122 -0
  72. package/dist/{_chunks/cs-CkJy6B2v.js.map → admin/chunks/cs-C7OSYFQ7.js.map} +1 -1
  73. package/dist/admin/chunks/de-5QRlDHyR.js +195 -0
  74. package/dist/{_chunks/ja-7sfIbjxE.js.map → admin/chunks/de-5QRlDHyR.js.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-C1CjdAtC.js +313 -0
  78. package/dist/{_chunks/en-CSxLmrh1.mjs.map → admin/chunks/en-C1CjdAtC.js.map} +1 -1
  79. package/dist/admin/chunks/en-LfhocNG2.js +308 -0
  80. package/dist/{_chunks/en-BzQmavmK.js.map → admin/chunks/en-LfhocNG2.js.map} +1 -1
  81. package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
  82. package/dist/admin/chunks/es-C8vLuvZL.js.map +1 -0
  83. package/dist/admin/chunks/es-DkoWSExG.js +192 -0
  84. package/dist/{_chunks/ko-woFZPmLk.js.map → admin/chunks/es-DkoWSExG.js.map} +1 -1
  85. package/dist/admin/chunks/eu-BG1xX7HK.js +198 -0
  86. package/dist/admin/chunks/eu-BG1xX7HK.js.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.js +215 -0
  90. package/dist/admin/chunks/fr-CFdRaRVj.js.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.js +196 -0
  94. package/dist/admin/chunks/gu-D5MMMXRs.js.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.js +196 -0
  100. package/dist/admin/chunks/hi-lp17SCjr.js.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_.js +7 -0
  104. package/dist/admin/chunks/hooks-DMvik5y_.js.map +1 -0
  105. package/dist/admin/chunks/hu-CLka1U2C.js +198 -0
  106. package/dist/admin/chunks/hu-CLka1U2C.js.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.js +156 -0
  112. package/dist/admin/chunks/id-USfY9m1g.js.map +1 -0
  113. package/dist/admin/chunks/index-BERMAQwA.js +5416 -0
  114. package/dist/admin/chunks/index-BERMAQwA.js.map +1 -0
  115. package/dist/admin/chunks/index-Jhj6SW8H.js +5350 -0
  116. package/dist/admin/chunks/index-Jhj6SW8H.js.map +1 -0
  117. package/dist/admin/chunks/it-BAHrwmYS.js +158 -0
  118. package/dist/admin/chunks/it-BAHrwmYS.js.map +1 -0
  119. package/dist/admin/chunks/it-CQFpa_Dc.js +163 -0
  120. package/dist/{_chunks/es-9K52xZIr.js.map → admin/chunks/it-CQFpa_Dc.js.map} +1 -1
  121. package/dist/admin/chunks/ja-BWKmBJFT.js +192 -0
  122. package/dist/admin/chunks/ja-BWKmBJFT.js.map +1 -0
  123. package/dist/admin/chunks/ja-jdQM-B79.js +197 -0
  124. package/dist/admin/chunks/ja-jdQM-B79.js.map +1 -0
  125. package/dist/admin/chunks/ko-CgADGBNt.js +191 -0
  126. package/dist/admin/chunks/ko-CgADGBNt.js.map +1 -0
  127. package/dist/admin/chunks/ko-k46sEyzt.js +196 -0
  128. package/dist/admin/chunks/ko-k46sEyzt.js.map +1 -0
  129. package/dist/admin/chunks/layout-BU6D6F6_.js +618 -0
  130. package/dist/admin/chunks/layout-BU6D6F6_.js.map +1 -0
  131. package/dist/admin/chunks/layout-DYlapjb1.js +598 -0
  132. package/dist/admin/chunks/layout-DYlapjb1.js.map +1 -0
  133. package/dist/admin/chunks/ml-CnhCfOn_.js +196 -0
  134. package/dist/admin/chunks/ml-CnhCfOn_.js.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.js +140 -0
  138. package/dist/{_chunks/uk-C8EiqJY7.js.map → admin/chunks/ms-Bh09NFff.js.map} +1 -1
  139. package/dist/admin/chunks/ms-CvSC0OdG.js +145 -0
  140. package/dist/admin/chunks/ms-CvSC0OdG.js.map +1 -0
  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.js +198 -0
  144. package/dist/admin/chunks/nl-C8HYflTc.js.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.js +73 -0
  148. package/dist/admin/chunks/objects-wl73iEma.js.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.js +195 -0
  152. package/dist/admin/chunks/pl-MFCZJZuZ.js.map +1 -0
  153. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +202 -0
  154. package/dist/admin/chunks/pt-BR-CPtAXD-4.js.map +1 -0
  155. package/dist/admin/chunks/pt-BR-CcotyBGJ.js +197 -0
  156. package/dist/{_chunks/pt-BR-BiOz37D9.js.map → admin/chunks/pt-BR-CcotyBGJ.js.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.js +93 -0
  160. package/dist/admin/chunks/pt-HbmgeiYO.js.map +1 -0
  161. package/dist/admin/chunks/relations-BxOJTAJZ.js +173 -0
  162. package/dist/admin/chunks/relations-BxOJTAJZ.js.map +1 -0
  163. package/dist/admin/chunks/relations-DXceN3I-.js +178 -0
  164. package/dist/admin/chunks/relations-DXceN3I-.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.js +230 -0
  168. package/dist/admin/chunks/ru-CB4BUyQp.js.map +1 -0
  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.js +196 -0
  172. package/dist/admin/chunks/sa-n_aPA-pU.js.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.js +198 -0
  176. package/dist/admin/chunks/sk-tn_BDjE2.js.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.js +198 -0
  180. package/dist/admin/chunks/sv-cq4ZrQRd.js.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.js +144 -0
  184. package/dist/admin/chunks/th-mUH7hEtc.js.map +1 -0
  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.js +195 -0
  188. package/dist/admin/chunks/tr-Yt38daxh.js.map +1 -0
  189. package/dist/admin/chunks/uk-B24MoTVg.js +145 -0
  190. package/dist/admin/chunks/uk-B24MoTVg.js.map +1 -0
  191. package/dist/admin/chunks/uk-Cpgmm7gE.js +140 -0
  192. package/dist/admin/chunks/uk-Cpgmm7gE.js.map +1 -0
  193. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js +247 -0
  194. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.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.js +18 -0
  198. package/dist/admin/chunks/usePrev-Bjw2dhmq.js.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/admin/chunks/vi-BGr1X_HZ.js.map +1 -0
  203. package/dist/admin/chunks/vi-CvBGlTjr.js +108 -0
  204. package/dist/{_chunks/vi-CJlYDheJ.js.map → admin/chunks/vi-CvBGlTjr.js.map} +1 -1
  205. package/dist/admin/chunks/zh-BmF-sHaT.js +205 -0
  206. package/dist/admin/chunks/zh-BmF-sHaT.js.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.js +934 -0
  210. package/dist/{_chunks/zh-Hans-9kOncHGw.js.map → admin/chunks/zh-Hans-CI0HKio3.js.map} +1 -1
  211. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +953 -0
  212. package/dist/{_chunks/zh-Hans-BPQcRIyH.mjs.map → admin/chunks/zh-Hans-JVK9x7xr.js.map} +1 -1
  213. package/dist/admin/index.js +23 -4
  214. package/dist/admin/index.js.map +1 -1
  215. package/dist/admin/index.mjs +16 -13
  216. package/dist/admin/index.mjs.map +1 -1
  217. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  218. package/dist/admin/src/hooks/useDocument.d.ts +21 -4
  219. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +27 -0
  220. package/dist/admin/src/pages/EditView/utils/data.d.ts +1 -0
  221. package/dist/admin/src/preview/index.d.ts +2 -3
  222. package/dist/admin/src/preview/pages/Preview.d.ts +1 -1
  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 +13 -10
  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-BLWQy8ru.js +0 -254
  257. package/dist/_chunks/ComponentConfigurationPage-BLWQy8ru.js.map +0 -1
  258. package/dist/_chunks/ComponentConfigurationPage-CtIa3aa2.mjs +0 -236
  259. package/dist/_chunks/ComponentConfigurationPage-CtIa3aa2.mjs.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-DsPR2DVk.mjs +0 -132
  265. package/dist/_chunks/EditConfigurationPage-DsPR2DVk.mjs.map +0 -1
  266. package/dist/_chunks/EditConfigurationPage-RQkymxCy.js +0 -150
  267. package/dist/_chunks/EditConfigurationPage-RQkymxCy.js.map +0 -1
  268. package/dist/_chunks/EditViewPage-B-kExt8C.js +0 -272
  269. package/dist/_chunks/EditViewPage-B-kExt8C.js.map +0 -1
  270. package/dist/_chunks/EditViewPage-BPyVuPfM.mjs +0 -254
  271. package/dist/_chunks/EditViewPage-BPyVuPfM.mjs.map +0 -1
  272. package/dist/_chunks/Field-DPIsQRre.js +0 -5650
  273. package/dist/_chunks/Field-DPIsQRre.js.map +0 -1
  274. package/dist/_chunks/Field-Dltnt1km.mjs +0 -5618
  275. package/dist/_chunks/Field-Dltnt1km.mjs.map +0 -1
  276. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  277. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  278. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  279. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  280. package/dist/_chunks/Form-BFi4MXMT.js +0 -778
  281. package/dist/_chunks/Form-BFi4MXMT.js.map +0 -1
  282. package/dist/_chunks/Form-C1IcWm1u.mjs +0 -758
  283. package/dist/_chunks/Form-C1IcWm1u.mjs.map +0 -1
  284. package/dist/_chunks/History-04ChQ4pl.mjs +0 -999
  285. package/dist/_chunks/History-04ChQ4pl.mjs.map +0 -1
  286. package/dist/_chunks/History-wjcK4L0C.js +0 -1019
  287. package/dist/_chunks/History-wjcK4L0C.js.map +0 -1
  288. package/dist/_chunks/ListConfigurationPage-BYqPYLSU.mjs +0 -633
  289. package/dist/_chunks/ListConfigurationPage-BYqPYLSU.mjs.map +0 -1
  290. package/dist/_chunks/ListConfigurationPage-CRbxIC3J.js +0 -652
  291. package/dist/_chunks/ListConfigurationPage-CRbxIC3J.js.map +0 -1
  292. package/dist/_chunks/ListViewPage-D5NY9183.js +0 -874
  293. package/dist/_chunks/ListViewPage-D5NY9183.js.map +0 -1
  294. package/dist/_chunks/ListViewPage-FU2LBuhl.mjs +0 -851
  295. package/dist/_chunks/ListViewPage-FU2LBuhl.mjs.map +0 -1
  296. package/dist/_chunks/NoContentTypePage-BgQVE_Qb.js +0 -51
  297. package/dist/_chunks/NoContentTypePage-BgQVE_Qb.js.map +0 -1
  298. package/dist/_chunks/NoContentTypePage-DCKUkwb8.mjs +0 -51
  299. package/dist/_chunks/NoContentTypePage-DCKUkwb8.mjs.map +0 -1
  300. package/dist/_chunks/NoPermissionsPage-C5jwn70o.js +0 -23
  301. package/dist/_chunks/NoPermissionsPage-C5jwn70o.js.map +0 -1
  302. package/dist/_chunks/NoPermissionsPage-jqve7C8l.mjs +0 -23
  303. package/dist/_chunks/NoPermissionsPage-jqve7C8l.mjs.map +0 -1
  304. package/dist/_chunks/Preview-BMYN548c.mjs +0 -294
  305. package/dist/_chunks/Preview-BMYN548c.mjs.map +0 -1
  306. package/dist/_chunks/Preview-DaOihysv.js +0 -312
  307. package/dist/_chunks/Preview-DaOihysv.js.map +0 -1
  308. package/dist/_chunks/Relations-CTGM7Hv5.js +0 -747
  309. package/dist/_chunks/Relations-CTGM7Hv5.js.map +0 -1
  310. package/dist/_chunks/Relations-gscPkxjF.mjs +0 -728
  311. package/dist/_chunks/Relations-gscPkxjF.mjs.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/ar-CCEVvqGG.mjs.map +0 -1
  316. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  317. package/dist/_chunks/ca-5U32ON2v.mjs.map +0 -1
  318. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  319. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  320. package/dist/_chunks/cs-CM2aBUar.mjs.map +0 -1
  321. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  322. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  323. package/dist/_chunks/de-C72KDNOl.mjs.map +0 -1
  324. package/dist/_chunks/de-CCEmbAah.js +0 -199
  325. package/dist/_chunks/en-BzQmavmK.js +0 -310
  326. package/dist/_chunks/en-CSxLmrh1.mjs +0 -310
  327. package/dist/_chunks/es-9K52xZIr.js +0 -196
  328. package/dist/_chunks/es-D34tqjMw.mjs +0 -196
  329. package/dist/_chunks/es-D34tqjMw.mjs.map +0 -1
  330. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  331. package/dist/_chunks/eu-CdALomew.mjs.map +0 -1
  332. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  333. package/dist/_chunks/fr--pg5jUbt.mjs +0 -216
  334. package/dist/_chunks/fr--pg5jUbt.mjs.map +0 -1
  335. package/dist/_chunks/fr-B2Kyv8Z9.js +0 -216
  336. package/dist/_chunks/fr-B2Kyv8Z9.js.map +0 -1
  337. package/dist/_chunks/gu-BRmF601H.js +0 -200
  338. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  339. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  340. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  341. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  342. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  343. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  344. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  345. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  346. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  347. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  348. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  349. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  350. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  351. package/dist/_chunks/id-B5Ser98A.js +0 -160
  352. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  353. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  354. package/dist/_chunks/id-BtwA9WJT.mjs.map +0 -1
  355. package/dist/_chunks/index-Ca7YWlAA.js +0 -4303
  356. package/dist/_chunks/index-Ca7YWlAA.js.map +0 -1
  357. package/dist/_chunks/index-DqasUQ6Q.mjs +0 -4284
  358. package/dist/_chunks/index-DqasUQ6Q.mjs.map +0 -1
  359. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  360. package/dist/_chunks/it-BrVPqaf1.mjs.map +0 -1
  361. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  362. package/dist/_chunks/ja-7sfIbjxE.js +0 -196
  363. package/dist/_chunks/ja-BHqhDq4V.mjs +0 -196
  364. package/dist/_chunks/ja-BHqhDq4V.mjs.map +0 -1
  365. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  366. package/dist/_chunks/ko-HVQRlfUI.mjs.map +0 -1
  367. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  368. package/dist/_chunks/layout-BW80JSCd.js +0 -488
  369. package/dist/_chunks/layout-BW80JSCd.js.map +0 -1
  370. package/dist/_chunks/layout-W3clJSCy.mjs +0 -471
  371. package/dist/_chunks/layout-W3clJSCy.mjs.map +0 -1
  372. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  373. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  374. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  375. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  376. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  377. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  378. package/dist/_chunks/ms-m_WjyWx7.mjs.map +0 -1
  379. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  380. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  381. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  382. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  383. package/dist/_chunks/objects-BcXOv6_9.js +0 -47
  384. package/dist/_chunks/objects-BcXOv6_9.js.map +0 -1
  385. package/dist/_chunks/objects-D6yBsdmx.mjs +0 -45
  386. package/dist/_chunks/objects-D6yBsdmx.mjs.map +0 -1
  387. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  388. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  389. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  390. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  391. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  392. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  393. package/dist/_chunks/pt-BR-C71iDxnh.mjs.map +0 -1
  394. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  395. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  396. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  397. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  398. package/dist/_chunks/relations-BlDkoeWh.mjs +0 -134
  399. package/dist/_chunks/relations-BlDkoeWh.mjs.map +0 -1
  400. package/dist/_chunks/relations-C9Usz9k5.js +0 -133
  401. package/dist/_chunks/relations-C9Usz9k5.js.map +0 -1
  402. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  403. package/dist/_chunks/ru-BE6A4Exp.mjs.map +0 -1
  404. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  405. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  406. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  407. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  408. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  409. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  410. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  411. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  412. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  413. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  414. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  415. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  416. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  417. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  418. package/dist/_chunks/th-BqbI8lIT.mjs.map +0 -1
  419. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  420. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  421. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  422. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  423. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  424. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  425. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  426. package/dist/_chunks/uk-CR-zDhAY.mjs.map +0 -1
  427. package/dist/_chunks/useDebounce-CtcjDB3L.js +0 -28
  428. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +0 -1
  429. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +0 -29
  430. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +0 -1
  431. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js +0 -245
  432. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js.map +0 -1
  433. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs +0 -228
  434. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs.map +0 -1
  435. package/dist/_chunks/vi-CJlYDheJ.js +0 -111
  436. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  437. package/dist/_chunks/vi-DUXIk_fw.mjs.map +0 -1
  438. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  439. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  440. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  441. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  442. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  443. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
@@ -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-Jhj6SW8H.js';
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.js';
14
+ import { C as ComponentIcon } from './ComponentIcon-BZcTc4rj.js';
15
+ import * as yup from 'yup';
16
+ import { F as FieldTypeIcon } from './FieldTypeIcon-BY6MrVF4.js';
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-BNpDL5sM.js.map