@strapi/content-manager 0.0.0-experimental.dd3311938ac827f1fa8560c8840a9a394f5896c0 → 0.0.0-experimental.ddb35414098c2a2816cae28a6abd5be1c4d8a58a

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 (524) hide show
  1. package/LICENSE +18 -3
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js +80 -0
  3. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.map +1 -0
  4. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js +82 -0
  5. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js.map +1 -0
  6. package/dist/admin/chunks/ComponentConfigurationPage-F9hz3-8Q.js +298 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-F9hz3-8Q.js.map +1 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-Rh9EprfI.js +276 -0
  9. package/dist/admin/chunks/ComponentConfigurationPage-Rh9EprfI.js.map +1 -0
  10. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js +153 -0
  11. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.map +1 -0
  12. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js +176 -0
  13. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js.map +1 -0
  14. package/dist/admin/chunks/EditConfigurationPage-BSyU4QSr.js +180 -0
  15. package/dist/admin/chunks/EditConfigurationPage-BSyU4QSr.js.map +1 -0
  16. package/dist/admin/chunks/EditConfigurationPage-qTV90Q1w.js +158 -0
  17. package/dist/admin/chunks/EditConfigurationPage-qTV90Q1w.js.map +1 -0
  18. package/dist/admin/chunks/EditViewPage-Bg0R6Ket.js +337 -0
  19. package/dist/admin/chunks/EditViewPage-Bg0R6Ket.js.map +1 -0
  20. package/dist/admin/chunks/EditViewPage-DQJnwri9.js +314 -0
  21. package/dist/admin/chunks/EditViewPage-DQJnwri9.js.map +1 -0
  22. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js +56 -0
  23. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.map +1 -0
  24. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js +58 -0
  25. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js.map +1 -0
  26. package/dist/admin/chunks/Form-CoCZb7X4.js +955 -0
  27. package/dist/admin/chunks/Form-CoCZb7X4.js.map +1 -0
  28. package/dist/admin/chunks/Form-NF3WNWJi.js +978 -0
  29. package/dist/admin/chunks/Form-NF3WNWJi.js.map +1 -0
  30. package/dist/admin/chunks/History-D9gkCdWM.js +1380 -0
  31. package/dist/admin/chunks/History-D9gkCdWM.js.map +1 -0
  32. package/dist/admin/chunks/History-DhTXQ3vJ.js +1357 -0
  33. package/dist/admin/chunks/History-DhTXQ3vJ.js.map +1 -0
  34. package/dist/admin/chunks/Input-B-PHs6Qx.js +6762 -0
  35. package/dist/admin/chunks/Input-B-PHs6Qx.js.map +1 -0
  36. package/dist/admin/chunks/Input-BUaeK7Zs.js +6793 -0
  37. package/dist/admin/chunks/Input-BUaeK7Zs.js.map +1 -0
  38. package/dist/admin/chunks/ListConfigurationPage-C9USjNkF.js +795 -0
  39. package/dist/admin/chunks/ListConfigurationPage-C9USjNkF.js.map +1 -0
  40. package/dist/admin/chunks/ListConfigurationPage-Deuq9sl8.js +818 -0
  41. package/dist/admin/chunks/ListConfigurationPage-Deuq9sl8.js.map +1 -0
  42. package/dist/admin/chunks/ListViewPage-CRR7JZM8.js +1132 -0
  43. package/dist/admin/chunks/ListViewPage-CRR7JZM8.js.map +1 -0
  44. package/dist/admin/chunks/ListViewPage-Dykcj1kY.js +1154 -0
  45. package/dist/admin/chunks/ListViewPage-Dykcj1kY.js.map +1 -0
  46. package/dist/admin/chunks/NoContentTypePage-CKhx-nS3.js +57 -0
  47. package/dist/admin/chunks/NoContentTypePage-CKhx-nS3.js.map +1 -0
  48. package/dist/admin/chunks/NoContentTypePage-bJYP8vEF.js +59 -0
  49. package/dist/admin/chunks/NoContentTypePage-bJYP8vEF.js.map +1 -0
  50. package/dist/admin/chunks/NoPermissionsPage-BoK43tp1.js +38 -0
  51. package/dist/admin/chunks/NoPermissionsPage-BoK43tp1.js.map +1 -0
  52. package/dist/admin/chunks/NoPermissionsPage-aAytAGle.js +36 -0
  53. package/dist/admin/chunks/NoPermissionsPage-aAytAGle.js.map +1 -0
  54. package/dist/admin/chunks/Preview-BagRf65F.js +553 -0
  55. package/dist/admin/chunks/Preview-BagRf65F.js.map +1 -0
  56. package/dist/admin/chunks/Preview-DX-20QKo.js +531 -0
  57. package/dist/admin/chunks/Preview-DX-20QKo.js.map +1 -0
  58. package/dist/admin/chunks/Relations-CIVG7vfG.js +1318 -0
  59. package/dist/admin/chunks/Relations-CIVG7vfG.js.map +1 -0
  60. package/dist/admin/chunks/Relations-DRXwCu-N.js +1291 -0
  61. package/dist/admin/chunks/Relations-DRXwCu-N.js.map +1 -0
  62. package/dist/admin/chunks/ar-DckYq_WK.js +222 -0
  63. package/dist/admin/chunks/ar-DckYq_WK.js.map +1 -0
  64. package/dist/admin/chunks/ar-DeQBSsfl.js +227 -0
  65. package/dist/{_chunks/ru-BT3ybNny.js.map → admin/chunks/ar-DeQBSsfl.js.map} +1 -1
  66. package/dist/admin/chunks/ca-ClDTvatJ.js +202 -0
  67. package/dist/admin/chunks/ca-ClDTvatJ.js.map +1 -0
  68. package/dist/admin/chunks/ca-DviY7mRj.js +197 -0
  69. package/dist/{_chunks/de-CCEmbAah.js.map → admin/chunks/ca-DviY7mRj.js.map} +1 -1
  70. package/dist/admin/chunks/cs-BJFxwIWj.js +126 -0
  71. package/dist/{_chunks/ms-BuFotyP_.js.map → admin/chunks/cs-BJFxwIWj.js.map} +1 -1
  72. package/dist/admin/chunks/cs-C7OSYFQ7.js +122 -0
  73. package/dist/{_chunks/cs-CkJy6B2v.js.map → admin/chunks/cs-C7OSYFQ7.js.map} +1 -1
  74. package/dist/admin/chunks/de-5QRlDHyR.js +195 -0
  75. package/dist/{_chunks/ja-CcFe8diO.js.map → admin/chunks/de-5QRlDHyR.js.map} +1 -1
  76. package/dist/admin/chunks/de-CbImAUA5.js +200 -0
  77. package/dist/{_chunks/gu-BRmF601H.js.map → admin/chunks/de-CbImAUA5.js.map} +1 -1
  78. package/dist/admin/chunks/en-C1CjdAtC.js +313 -0
  79. package/dist/admin/chunks/en-C1CjdAtC.js.map +1 -0
  80. package/dist/admin/chunks/en-LfhocNG2.js +308 -0
  81. package/dist/admin/chunks/en-LfhocNG2.js.map +1 -0
  82. package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
  83. package/dist/admin/chunks/es-C8vLuvZL.js.map +1 -0
  84. package/dist/admin/chunks/es-DkoWSExG.js +192 -0
  85. package/dist/{_chunks/ko-woFZPmLk.js.map → admin/chunks/es-DkoWSExG.js.map} +1 -1
  86. package/dist/admin/chunks/eu-BG1xX7HK.js +198 -0
  87. package/dist/admin/chunks/eu-BG1xX7HK.js.map +1 -0
  88. package/dist/admin/chunks/eu-BJW3AvXu.js +203 -0
  89. package/dist/admin/chunks/eu-BJW3AvXu.js.map +1 -0
  90. package/dist/admin/chunks/fr-CFdRaRVj.js +215 -0
  91. package/dist/admin/chunks/fr-CFdRaRVj.js.map +1 -0
  92. package/dist/admin/chunks/fr-gQSilC7w.js +220 -0
  93. package/dist/admin/chunks/fr-gQSilC7w.js.map +1 -0
  94. package/dist/admin/chunks/gu-D5MMMXRs.js +196 -0
  95. package/dist/admin/chunks/gu-D5MMMXRs.js.map +1 -0
  96. package/dist/admin/chunks/gu-DPU4wyx7.js +201 -0
  97. package/dist/{_chunks/eu-VDH-3ovk.js.map → admin/chunks/gu-DPU4wyx7.js.map} +1 -1
  98. package/dist/admin/chunks/hi-Dp4omeBb.js +201 -0
  99. package/dist/admin/chunks/hi-Dp4omeBb.js.map +1 -0
  100. package/dist/admin/chunks/hi-lp17SCjr.js +196 -0
  101. package/dist/admin/chunks/hi-lp17SCjr.js.map +1 -0
  102. package/dist/{_chunks/hooks-BAaaKPS_.js → admin/chunks/hooks-D-sOYd1s.js} +6 -3
  103. package/dist/admin/chunks/hooks-D-sOYd1s.js.map +1 -0
  104. package/dist/admin/chunks/hooks-DMvik5y_.js +7 -0
  105. package/dist/admin/chunks/hooks-DMvik5y_.js.map +1 -0
  106. package/dist/admin/chunks/hu-CLka1U2C.js +198 -0
  107. package/dist/admin/chunks/hu-CLka1U2C.js.map +1 -0
  108. package/dist/admin/chunks/hu-CtFJuhTd.js +203 -0
  109. package/dist/admin/chunks/hu-CtFJuhTd.js.map +1 -0
  110. package/dist/admin/chunks/id-D7V5S1rB.js +161 -0
  111. package/dist/{_chunks/it-DkBIs7vD.js.map → admin/chunks/id-D7V5S1rB.js.map} +1 -1
  112. package/dist/admin/chunks/id-USfY9m1g.js +156 -0
  113. package/dist/admin/chunks/id-USfY9m1g.js.map +1 -0
  114. package/dist/admin/chunks/index-BFvBqzd6.js +5416 -0
  115. package/dist/admin/chunks/index-BFvBqzd6.js.map +1 -0
  116. package/dist/admin/chunks/index-DjnPfPx8.js +5350 -0
  117. package/dist/admin/chunks/index-DjnPfPx8.js.map +1 -0
  118. package/dist/admin/chunks/it-BAHrwmYS.js +158 -0
  119. package/dist/admin/chunks/it-BAHrwmYS.js.map +1 -0
  120. package/dist/admin/chunks/it-CQFpa_Dc.js +163 -0
  121. package/dist/{_chunks/es-EUonQTon.js.map → admin/chunks/it-CQFpa_Dc.js.map} +1 -1
  122. package/dist/admin/chunks/ja-BWKmBJFT.js +192 -0
  123. package/dist/admin/chunks/ja-BWKmBJFT.js.map +1 -0
  124. package/dist/admin/chunks/ja-jdQM-B79.js +197 -0
  125. package/dist/admin/chunks/ja-jdQM-B79.js.map +1 -0
  126. package/dist/admin/chunks/ko-CgADGBNt.js +191 -0
  127. package/dist/admin/chunks/ko-CgADGBNt.js.map +1 -0
  128. package/dist/admin/chunks/ko-k46sEyzt.js +196 -0
  129. package/dist/admin/chunks/ko-k46sEyzt.js.map +1 -0
  130. package/dist/admin/chunks/layout-BBZkZkME.js +618 -0
  131. package/dist/admin/chunks/layout-BBZkZkME.js.map +1 -0
  132. package/dist/admin/chunks/layout-DsbCNcEH.js +598 -0
  133. package/dist/admin/chunks/layout-DsbCNcEH.js.map +1 -0
  134. package/dist/admin/chunks/ml-CnhCfOn_.js +196 -0
  135. package/dist/admin/chunks/ml-CnhCfOn_.js.map +1 -0
  136. package/dist/admin/chunks/ml-DqxPwODx.js +201 -0
  137. package/dist/admin/chunks/ml-DqxPwODx.js.map +1 -0
  138. package/dist/admin/chunks/ms-Bh09NFff.js +140 -0
  139. package/dist/{_chunks/uk-C8EiqJY7.js.map → admin/chunks/ms-Bh09NFff.js.map} +1 -1
  140. package/dist/admin/chunks/ms-CvSC0OdG.js +145 -0
  141. package/dist/admin/chunks/ms-CvSC0OdG.js.map +1 -0
  142. package/dist/admin/chunks/nl-BEubhS8C.js +203 -0
  143. package/dist/admin/chunks/nl-BEubhS8C.js.map +1 -0
  144. package/dist/admin/chunks/nl-C8HYflTc.js +198 -0
  145. package/dist/admin/chunks/nl-C8HYflTc.js.map +1 -0
  146. package/dist/admin/chunks/objects-C3EebVVe.js +76 -0
  147. package/dist/admin/chunks/objects-C3EebVVe.js.map +1 -0
  148. package/dist/admin/chunks/objects-wl73iEma.js +73 -0
  149. package/dist/admin/chunks/objects-wl73iEma.js.map +1 -0
  150. package/dist/admin/chunks/pl-DWhGDzmM.js +200 -0
  151. package/dist/{_chunks/ca-Cmk45QO6.js.map → admin/chunks/pl-DWhGDzmM.js.map} +1 -1
  152. package/dist/admin/chunks/pl-MFCZJZuZ.js +195 -0
  153. package/dist/admin/chunks/pl-MFCZJZuZ.js.map +1 -0
  154. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +202 -0
  155. package/dist/admin/chunks/pt-BR-CPtAXD-4.js.map +1 -0
  156. package/dist/admin/chunks/pt-BR-CcotyBGJ.js +197 -0
  157. package/dist/{_chunks/pt-BR-BiOz37D9.js.map → admin/chunks/pt-BR-CcotyBGJ.js.map} +1 -1
  158. package/dist/admin/chunks/pt-BoPxN80n.js +96 -0
  159. package/dist/admin/chunks/pt-BoPxN80n.js.map +1 -0
  160. package/dist/admin/chunks/pt-HbmgeiYO.js +93 -0
  161. package/dist/admin/chunks/pt-HbmgeiYO.js.map +1 -0
  162. package/dist/admin/chunks/relations-CbrYJQqU.js +173 -0
  163. package/dist/admin/chunks/relations-CbrYJQqU.js.map +1 -0
  164. package/dist/admin/chunks/relations-DPq9jPO4.js +178 -0
  165. package/dist/admin/chunks/relations-DPq9jPO4.js.map +1 -0
  166. package/dist/admin/chunks/ru-C0op0ALG.js +232 -0
  167. package/dist/{_chunks/en-fbKQxLGn.js.map → admin/chunks/ru-C0op0ALG.js.map} +1 -1
  168. package/dist/admin/chunks/ru-CB4BUyQp.js +230 -0
  169. package/dist/admin/chunks/ru-CB4BUyQp.js.map +1 -0
  170. package/dist/admin/chunks/sa-B_FuPyMw.js +201 -0
  171. package/dist/admin/chunks/sa-B_FuPyMw.js.map +1 -0
  172. package/dist/admin/chunks/sa-n_aPA-pU.js +196 -0
  173. package/dist/admin/chunks/sa-n_aPA-pU.js.map +1 -0
  174. package/dist/admin/chunks/sk-D_iXML2C.js +203 -0
  175. package/dist/admin/chunks/sk-D_iXML2C.js.map +1 -0
  176. package/dist/admin/chunks/sk-tn_BDjE2.js +198 -0
  177. package/dist/admin/chunks/sk-tn_BDjE2.js.map +1 -0
  178. package/dist/admin/chunks/sv-BstBC1Yp.js +203 -0
  179. package/dist/admin/chunks/sv-BstBC1Yp.js.map +1 -0
  180. package/dist/admin/chunks/sv-cq4ZrQRd.js +198 -0
  181. package/dist/admin/chunks/sv-cq4ZrQRd.js.map +1 -0
  182. package/dist/admin/chunks/th-lXoOCqPC.js +149 -0
  183. package/dist/{_chunks/th-D9_GfAjc.js.map → admin/chunks/th-lXoOCqPC.js.map} +1 -1
  184. package/dist/admin/chunks/th-mUH7hEtc.js +144 -0
  185. package/dist/admin/chunks/th-mUH7hEtc.js.map +1 -0
  186. package/dist/admin/chunks/tr-CkS6sLIE.js +200 -0
  187. package/dist/admin/chunks/tr-CkS6sLIE.js.map +1 -0
  188. package/dist/admin/chunks/tr-Yt38daxh.js +195 -0
  189. package/dist/admin/chunks/tr-Yt38daxh.js.map +1 -0
  190. package/dist/admin/chunks/uk-B24MoTVg.js +145 -0
  191. package/dist/admin/chunks/uk-B24MoTVg.js.map +1 -0
  192. package/dist/admin/chunks/uk-Cpgmm7gE.js +140 -0
  193. package/dist/admin/chunks/uk-Cpgmm7gE.js.map +1 -0
  194. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js +247 -0
  195. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.map +1 -0
  196. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js +271 -0
  197. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +1 -0
  198. package/dist/admin/chunks/usePrev-Bjw2dhmq.js +18 -0
  199. package/dist/admin/chunks/usePrev-Bjw2dhmq.js.map +1 -0
  200. package/dist/admin/chunks/usePrev-DIYl-IAL.js +21 -0
  201. package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +1 -0
  202. package/dist/admin/chunks/vi-BGr1X_HZ.js +112 -0
  203. package/dist/admin/chunks/vi-BGr1X_HZ.js.map +1 -0
  204. package/dist/admin/chunks/vi-CvBGlTjr.js +108 -0
  205. package/dist/{_chunks/vi-CJlYDheJ.js.map → admin/chunks/vi-CvBGlTjr.js.map} +1 -1
  206. package/dist/admin/chunks/zh-BmF-sHaT.js +205 -0
  207. package/dist/admin/chunks/zh-BmF-sHaT.js.map +1 -0
  208. package/dist/admin/chunks/zh-DwFu_Kfj.js +210 -0
  209. package/dist/admin/chunks/zh-DwFu_Kfj.js.map +1 -0
  210. package/dist/admin/chunks/zh-Hans-CI0HKio3.js +934 -0
  211. package/dist/{_chunks/zh-Hans-9kOncHGw.js.map → admin/chunks/zh-Hans-CI0HKio3.js.map} +1 -1
  212. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +953 -0
  213. package/dist/{_chunks/zh-Hans-BPQcRIyH.mjs.map → admin/chunks/zh-Hans-JVK9x7xr.js.map} +1 -1
  214. package/dist/admin/index.js +25 -4
  215. package/dist/admin/index.js.map +1 -1
  216. package/dist/admin/index.mjs +16 -11
  217. package/dist/admin/index.mjs.map +1 -1
  218. package/dist/admin/src/content-manager.d.ts +3 -2
  219. package/dist/admin/src/exports.d.ts +2 -1
  220. package/dist/admin/src/history/index.d.ts +3 -0
  221. package/dist/admin/src/history/services/historyVersion.d.ts +2 -2
  222. package/dist/admin/src/hooks/useDocument.d.ts +50 -2
  223. package/dist/admin/src/index.d.ts +1 -0
  224. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  225. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +9 -4
  226. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +3 -3
  227. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  228. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  229. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +5 -0
  230. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
  231. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
  232. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +22 -1
  233. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  234. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  235. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +6 -58
  236. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +27 -0
  237. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  238. package/dist/admin/src/pages/EditView/utils/data.d.ts +1 -0
  239. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  240. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  241. package/dist/admin/src/preview/components/PreviewContent.d.ts +3 -0
  242. package/dist/admin/src/preview/components/PreviewHeader.d.ts +3 -0
  243. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  244. package/dist/admin/src/preview/index.d.ts +3 -0
  245. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  246. package/dist/admin/src/preview/routes.d.ts +3 -0
  247. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  248. package/dist/admin/src/router.d.ts +1 -1
  249. package/dist/admin/src/services/api.d.ts +1 -1
  250. package/dist/admin/src/services/components.d.ts +2 -2
  251. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  252. package/dist/admin/src/services/documents.d.ts +19 -20
  253. package/dist/admin/src/services/init.d.ts +1 -1
  254. package/dist/admin/src/services/relations.d.ts +2 -2
  255. package/dist/admin/src/services/uid.d.ts +3 -3
  256. package/dist/admin/src/utils/validation.d.ts +4 -1
  257. package/dist/server/index.js +5483 -4083
  258. package/dist/server/index.js.map +1 -1
  259. package/dist/server/index.mjs +5504 -4101
  260. package/dist/server/index.mjs.map +1 -1
  261. package/dist/server/src/bootstrap.d.ts.map +1 -1
  262. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  263. package/dist/server/src/controllers/index.d.ts.map +1 -1
  264. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  265. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  266. package/dist/server/src/controllers/utils/metadata.d.ts +17 -2
  267. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  268. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  269. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  270. package/dist/server/src/history/controllers/history-version.d.ts +1 -1
  271. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
  272. package/dist/server/src/history/services/history.d.ts +3 -3
  273. package/dist/server/src/history/services/history.d.ts.map +1 -1
  274. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  275. package/dist/server/src/history/services/utils.d.ts +8 -12
  276. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  277. package/dist/server/src/index.d.ts +7 -6
  278. package/dist/server/src/index.d.ts.map +1 -1
  279. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  280. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  281. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  282. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  283. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  284. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  285. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  286. package/dist/server/src/preview/index.d.ts +4 -0
  287. package/dist/server/src/preview/index.d.ts.map +1 -0
  288. package/dist/server/src/preview/routes/index.d.ts +8 -0
  289. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  290. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  291. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  292. package/dist/server/src/preview/services/index.d.ts +16 -0
  293. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  294. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  295. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  296. package/dist/server/src/preview/services/preview.d.ts +12 -0
  297. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  298. package/dist/server/src/preview/utils.d.ts +19 -0
  299. package/dist/server/src/preview/utils.d.ts.map +1 -0
  300. package/dist/server/src/register.d.ts.map +1 -1
  301. package/dist/server/src/routes/index.d.ts.map +1 -1
  302. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  303. package/dist/server/src/services/document-metadata.d.ts +12 -10
  304. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  305. package/dist/server/src/services/index.d.ts +7 -6
  306. package/dist/server/src/services/index.d.ts.map +1 -1
  307. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  308. package/dist/server/src/services/utils/count.d.ts +1 -1
  309. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  310. package/dist/server/src/services/utils/populate.d.ts +3 -3
  311. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  312. package/dist/server/src/utils/index.d.ts +2 -0
  313. package/dist/server/src/utils/index.d.ts.map +1 -1
  314. package/dist/shared/contracts/collection-types.d.ts +3 -2
  315. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  316. package/dist/shared/contracts/components.d.ts +0 -1
  317. package/dist/shared/contracts/content-types.d.ts +0 -1
  318. package/dist/shared/contracts/history-versions.d.ts +0 -1
  319. package/dist/shared/contracts/index.d.ts +1 -1
  320. package/dist/shared/contracts/index.d.ts.map +1 -1
  321. package/dist/shared/contracts/init.d.ts +0 -1
  322. package/dist/shared/contracts/preview.d.ts +26 -0
  323. package/dist/shared/contracts/preview.d.ts.map +1 -0
  324. package/dist/shared/contracts/relations.d.ts +1 -2
  325. package/dist/shared/contracts/relations.d.ts.map +1 -1
  326. package/dist/shared/contracts/review-workflows.d.ts +0 -1
  327. package/dist/shared/contracts/single-types.d.ts +0 -1
  328. package/dist/shared/contracts/uid.d.ts +0 -1
  329. package/dist/shared/index.d.ts +0 -1
  330. package/dist/shared/index.js +37 -22
  331. package/dist/shared/index.js.map +1 -1
  332. package/dist/shared/index.mjs +36 -23
  333. package/dist/shared/index.mjs.map +1 -1
  334. package/package.json +24 -20
  335. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
  336. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
  337. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
  338. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
  339. package/dist/_chunks/ComponentConfigurationPage-BMajAl1u.mjs +0 -236
  340. package/dist/_chunks/ComponentConfigurationPage-BMajAl1u.mjs.map +0 -1
  341. package/dist/_chunks/ComponentConfigurationPage-y_7iLdmB.js +0 -255
  342. package/dist/_chunks/ComponentConfigurationPage-y_7iLdmB.js.map +0 -1
  343. package/dist/_chunks/ComponentIcon-BXdiCGQp.js +0 -176
  344. package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +0 -1
  345. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
  346. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
  347. package/dist/_chunks/EditConfigurationPage-CPVB8Uqc.js +0 -151
  348. package/dist/_chunks/EditConfigurationPage-CPVB8Uqc.js.map +0 -1
  349. package/dist/_chunks/EditConfigurationPage-CcOoD26O.mjs +0 -132
  350. package/dist/_chunks/EditConfigurationPage-CcOoD26O.mjs.map +0 -1
  351. package/dist/_chunks/EditViewPage-CTTDHKkQ.js +0 -222
  352. package/dist/_chunks/EditViewPage-CTTDHKkQ.js.map +0 -1
  353. package/dist/_chunks/EditViewPage-DWb0DE7R.mjs +0 -203
  354. package/dist/_chunks/EditViewPage-DWb0DE7R.mjs.map +0 -1
  355. package/dist/_chunks/Field-C5Z1Ivdv.js +0 -5243
  356. package/dist/_chunks/Field-C5Z1Ivdv.js.map +0 -1
  357. package/dist/_chunks/Field-DnStdvQw.mjs +0 -5211
  358. package/dist/_chunks/Field-DnStdvQw.mjs.map +0 -1
  359. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  360. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  361. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  362. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  363. package/dist/_chunks/Form-B81OtW-k.js +0 -761
  364. package/dist/_chunks/Form-B81OtW-k.js.map +0 -1
  365. package/dist/_chunks/Form-DqGgE55Q.mjs +0 -740
  366. package/dist/_chunks/Form-DqGgE55Q.mjs.map +0 -1
  367. package/dist/_chunks/History-4NbOq2dX.js +0 -1030
  368. package/dist/_chunks/History-4NbOq2dX.js.map +0 -1
  369. package/dist/_chunks/History-DS6-HCYX.mjs +0 -1009
  370. package/dist/_chunks/History-DS6-HCYX.mjs.map +0 -1
  371. package/dist/_chunks/ListConfigurationPage-CpfstlYY.js +0 -641
  372. package/dist/_chunks/ListConfigurationPage-CpfstlYY.js.map +0 -1
  373. package/dist/_chunks/ListConfigurationPage-DQJJltko.mjs +0 -622
  374. package/dist/_chunks/ListConfigurationPage-DQJJltko.mjs.map +0 -1
  375. package/dist/_chunks/ListViewPage-CA3I75m5.js +0 -851
  376. package/dist/_chunks/ListViewPage-CA3I75m5.js.map +0 -1
  377. package/dist/_chunks/ListViewPage-nQrOQuVo.mjs +0 -827
  378. package/dist/_chunks/ListViewPage-nQrOQuVo.mjs.map +0 -1
  379. package/dist/_chunks/NoContentTypePage-DbnHE22g.mjs +0 -51
  380. package/dist/_chunks/NoContentTypePage-DbnHE22g.mjs.map +0 -1
  381. package/dist/_chunks/NoContentTypePage-Dldu-_Mx.js +0 -51
  382. package/dist/_chunks/NoContentTypePage-Dldu-_Mx.js.map +0 -1
  383. package/dist/_chunks/NoPermissionsPage-CO2MK200.js +0 -23
  384. package/dist/_chunks/NoPermissionsPage-CO2MK200.js.map +0 -1
  385. package/dist/_chunks/NoPermissionsPage-fOIkQM0v.mjs +0 -23
  386. package/dist/_chunks/NoPermissionsPage-fOIkQM0v.mjs.map +0 -1
  387. package/dist/_chunks/Relations-BDRl99Ux.mjs +0 -694
  388. package/dist/_chunks/Relations-BDRl99Ux.mjs.map +0 -1
  389. package/dist/_chunks/Relations-DG2jnOcr.js +0 -714
  390. package/dist/_chunks/Relations-DG2jnOcr.js.map +0 -1
  391. package/dist/_chunks/ar-BUUWXIYu.js +0 -226
  392. package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
  393. package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
  394. package/dist/_chunks/ar-CCEVvqGG.mjs.map +0 -1
  395. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  396. package/dist/_chunks/ca-5U32ON2v.mjs.map +0 -1
  397. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  398. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  399. package/dist/_chunks/cs-CM2aBUar.mjs.map +0 -1
  400. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  401. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  402. package/dist/_chunks/de-C72KDNOl.mjs.map +0 -1
  403. package/dist/_chunks/de-CCEmbAah.js +0 -199
  404. package/dist/_chunks/en-Ux26r5pl.mjs +0 -291
  405. package/dist/_chunks/en-Ux26r5pl.mjs.map +0 -1
  406. package/dist/_chunks/en-fbKQxLGn.js +0 -291
  407. package/dist/_chunks/es-CeXiYflN.mjs +0 -196
  408. package/dist/_chunks/es-CeXiYflN.mjs.map +0 -1
  409. package/dist/_chunks/es-EUonQTon.js +0 -196
  410. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  411. package/dist/_chunks/eu-CdALomew.mjs.map +0 -1
  412. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  413. package/dist/_chunks/fr-B7kGGg3E.js +0 -206
  414. package/dist/_chunks/fr-B7kGGg3E.js.map +0 -1
  415. package/dist/_chunks/fr-CD9VFbPM.mjs +0 -206
  416. package/dist/_chunks/fr-CD9VFbPM.mjs.map +0 -1
  417. package/dist/_chunks/gu-BRmF601H.js +0 -200
  418. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  419. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  420. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  421. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  422. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  423. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  424. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  425. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  426. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  427. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  428. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  429. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  430. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  431. package/dist/_chunks/id-B5Ser98A.js +0 -160
  432. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  433. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  434. package/dist/_chunks/id-BtwA9WJT.mjs.map +0 -1
  435. package/dist/_chunks/index-BZoNZMXL.js +0 -3956
  436. package/dist/_chunks/index-BZoNZMXL.js.map +0 -1
  437. package/dist/_chunks/index-Drt2DN7v.mjs +0 -3937
  438. package/dist/_chunks/index-Drt2DN7v.mjs.map +0 -1
  439. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  440. package/dist/_chunks/it-BrVPqaf1.mjs.map +0 -1
  441. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  442. package/dist/_chunks/ja-CcFe8diO.js +0 -196
  443. package/dist/_chunks/ja-CtsUxOvk.mjs +0 -196
  444. package/dist/_chunks/ja-CtsUxOvk.mjs.map +0 -1
  445. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  446. package/dist/_chunks/ko-HVQRlfUI.mjs.map +0 -1
  447. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  448. package/dist/_chunks/layout-BzAbmoO6.mjs +0 -458
  449. package/dist/_chunks/layout-BzAbmoO6.mjs.map +0 -1
  450. package/dist/_chunks/layout-DEYBqgF1.js +0 -476
  451. package/dist/_chunks/layout-DEYBqgF1.js.map +0 -1
  452. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  453. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  454. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  455. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  456. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  457. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  458. package/dist/_chunks/ms-m_WjyWx7.mjs.map +0 -1
  459. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  460. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  461. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  462. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  463. package/dist/_chunks/objects-gigeqt7s.js +0 -49
  464. package/dist/_chunks/objects-gigeqt7s.js.map +0 -1
  465. package/dist/_chunks/objects-mKMAmfec.mjs +0 -47
  466. package/dist/_chunks/objects-mKMAmfec.mjs.map +0 -1
  467. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  468. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  469. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  470. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  471. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  472. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  473. package/dist/_chunks/pt-BR-C71iDxnh.mjs.map +0 -1
  474. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  475. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  476. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  477. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  478. package/dist/_chunks/relations-D0eZ4VWw.js +0 -134
  479. package/dist/_chunks/relations-D0eZ4VWw.js.map +0 -1
  480. package/dist/_chunks/relations-D26zVRdi.mjs +0 -135
  481. package/dist/_chunks/relations-D26zVRdi.mjs.map +0 -1
  482. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  483. package/dist/_chunks/ru-BE6A4Exp.mjs.map +0 -1
  484. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  485. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  486. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  487. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  488. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  489. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  490. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  491. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  492. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  493. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  494. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  495. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  496. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  497. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  498. package/dist/_chunks/th-BqbI8lIT.mjs.map +0 -1
  499. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  500. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  501. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  502. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  503. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  504. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  505. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  506. package/dist/_chunks/uk-CR-zDhAY.mjs.map +0 -1
  507. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs +0 -231
  508. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +0 -1
  509. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js +0 -249
  510. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +0 -1
  511. package/dist/_chunks/usePrev-B9w_-eYc.js +0 -15
  512. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  513. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  514. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  515. package/dist/_chunks/vi-CJlYDheJ.js +0 -111
  516. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  517. package/dist/_chunks/vi-DUXIk_fw.mjs.map +0 -1
  518. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  519. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  520. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  521. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  522. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  523. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
  524. package/strapi-server.js +0 -3
@@ -1,761 +0,0 @@
1
- "use strict";
2
- const jsxRuntime = require("react/jsx-runtime");
3
- const React = require("react");
4
- const strapiAdmin = require("@strapi/admin/strapi-admin");
5
- const designSystem = require("@strapi/design-system");
6
- const fractionalIndexing = require("fractional-indexing");
7
- const pipe = require("lodash/fp/pipe");
8
- const reactIntl = require("react-intl");
9
- const index = require("./index-BZoNZMXL.js");
10
- const Icons = require("@strapi/icons");
11
- const reactDndHtml5Backend = require("react-dnd-html5-backend");
12
- const reactRouterDom = require("react-router-dom");
13
- const styledComponents = require("styled-components");
14
- const useDragAndDrop = require("./useDragAndDrop-J0TUUbR6.js");
15
- const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
16
- const yup = require("yup");
17
- const FieldTypeIcon = require("./FieldTypeIcon-Dnwq_IRF.js");
18
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
19
- function _interopNamespace(e) {
20
- if (e && e.__esModule)
21
- return e;
22
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
23
- if (e) {
24
- for (const k in e) {
25
- if (k !== "default") {
26
- const d = Object.getOwnPropertyDescriptor(e, k);
27
- Object.defineProperty(n, k, d.get ? d : {
28
- enumerable: true,
29
- get: () => e[k]
30
- });
31
- }
32
- }
33
- }
34
- n.default = e;
35
- return Object.freeze(n);
36
- }
37
- const React__namespace = /* @__PURE__ */ _interopNamespace(React);
38
- const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
39
- const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
40
- const FIELD_SCHEMA = yup__namespace.object().shape({
41
- label: yup__namespace.string().required(),
42
- description: yup__namespace.string(),
43
- editable: yup__namespace.boolean(),
44
- size: yup__namespace.number().required()
45
- });
46
- const EditFieldForm = ({ attribute, name, onClose }) => {
47
- const { formatMessage } = reactIntl.useIntl();
48
- const id = React__namespace.useId();
49
- const { toggleNotification } = strapiAdmin.useNotification();
50
- const { value, onChange } = strapiAdmin.useField(name);
51
- const { data: mainFieldOptions } = index.useGetInitialDataQuery(void 0, {
52
- selectFromResult: (res) => {
53
- if (attribute?.type !== "relation" || !res.data) {
54
- return { data: [] };
55
- }
56
- if ("targetModel" in attribute && typeof attribute.targetModel === "string") {
57
- const targetSchema = res.data.contentTypes.find(
58
- (schema) => schema.uid === attribute.targetModel
59
- );
60
- if (targetSchema) {
61
- return {
62
- data: Object.entries(targetSchema.attributes).reduce((acc, [key, attribute2]) => {
63
- if (!index.ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD.includes(attribute2.type)) {
64
- acc.push({
65
- label: key,
66
- value: key
67
- });
68
- }
69
- return acc;
70
- }, [])
71
- };
72
- }
73
- }
74
- return { data: [] };
75
- },
76
- skip: attribute?.type !== "relation"
77
- });
78
- if (!value || value.name === TEMP_FIELD_NAME || !attribute) {
79
- console.error(
80
- "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."
81
- );
82
- toggleNotification({
83
- message: formatMessage({
84
- id: "content-manager.containers.edit-settings.modal-form.error",
85
- defaultMessage: "An error occurred while trying to open the form."
86
- }),
87
- type: "danger"
88
- });
89
- return null;
90
- }
91
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalLayout, { onClose, labelledBy: id, children: /* @__PURE__ */ jsxRuntime.jsxs(
92
- strapiAdmin.Form,
93
- {
94
- method: "PUT",
95
- initialValues: value,
96
- validationSchema: FIELD_SCHEMA,
97
- onSubmit: (data) => {
98
- onChange(name, data);
99
- onClose();
100
- },
101
- children: [
102
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, children: [
103
- /* @__PURE__ */ jsxRuntime.jsx(FieldTypeIcon.FieldTypeIcon, { type: attribute.type }),
104
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", textColor: "neutral800", tag: "h2", id, children: formatMessage(
105
- {
106
- id: "content-manager.containers.edit-settings.modal-form.label",
107
- defaultMessage: "Edit {fieldName}"
108
- },
109
- { fieldName: index.capitalise(value.name) }
110
- ) })
111
- ] }) }),
112
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: [
113
- {
114
- name: "label",
115
- label: formatMessage({
116
- id: index.getTranslation("containers.edit-settings.modal-form.label"),
117
- defaultMessage: "Label"
118
- }),
119
- size: 6,
120
- type: "string"
121
- },
122
- {
123
- name: "description",
124
- label: formatMessage({
125
- id: index.getTranslation("containers.edit-settings.modal-form.description"),
126
- defaultMessage: "Description"
127
- }),
128
- size: 6,
129
- type: "string"
130
- },
131
- {
132
- name: "placeholder",
133
- label: formatMessage({
134
- id: index.getTranslation("containers.edit-settings.modal-form.placeholder"),
135
- defaultMessage: "Placeholder"
136
- }),
137
- size: 6,
138
- type: "string"
139
- },
140
- {
141
- name: "editable",
142
- label: formatMessage({
143
- id: index.getTranslation("containers.edit-settings.modal-form.editable"),
144
- defaultMessage: "Editable"
145
- }),
146
- size: 6,
147
- type: "boolean"
148
- },
149
- {
150
- name: "mainField",
151
- label: formatMessage({
152
- id: index.getTranslation("containers.edit-settings.modal-form.mainField"),
153
- defaultMessage: "Entry title"
154
- }),
155
- hint: formatMessage({
156
- id: index.getTranslation(
157
- "containers.SettingPage.edit-settings.modal-form.mainField.hint"
158
- ),
159
- defaultMessage: "Set the displayed field"
160
- }),
161
- size: 6,
162
- options: mainFieldOptions,
163
- type: "enumeration"
164
- },
165
- {
166
- name: "size",
167
- label: formatMessage({
168
- id: index.getTranslation("containers.ListSettingsView.modal-form.size"),
169
- defaultMessage: "Size"
170
- }),
171
- size: 6,
172
- options: [
173
- { value: "4", label: "33%" },
174
- { value: "6", label: "50%" },
175
- { value: "8", label: "66%" },
176
- { value: "12", label: "100%" }
177
- ],
178
- type: "enumeration"
179
- }
180
- ].filter(filterFieldsBasedOnAttributeType(attribute.type)).map(({ size, ...field }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: size, children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.InputRenderer, { ...field }) }, field.name)) }) }),
181
- /* @__PURE__ */ jsxRuntime.jsx(
182
- designSystem.ModalFooter,
183
- {
184
- startActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: onClose, variant: "tertiary", children: formatMessage({ id: "app.components.Button.cancel", defaultMessage: "Cancel" }) }),
185
- endActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { type: "submit", children: formatMessage({ id: "global.finish", defaultMessage: "Finish" }) })
186
- }
187
- )
188
- ]
189
- }
190
- ) });
191
- };
192
- const filterFieldsBasedOnAttributeType = (type) => (field) => {
193
- switch (type) {
194
- case "blocks":
195
- case "richtext":
196
- return field.name !== "size" && field.name !== "mainField";
197
- case "boolean":
198
- case "media":
199
- return field.name !== "placeholder" && field.name !== "mainField";
200
- case "component":
201
- case "dynamiczone":
202
- return field.name === "label" || field.name === "editable";
203
- case "json":
204
- return field.name !== "placeholder" && field.name !== "mainField" && field.name !== "size";
205
- case "relation":
206
- return true;
207
- default:
208
- return field.name !== "mainField";
209
- }
210
- };
211
- const Fields = ({ attributes, fieldSizes, components, metadatas = {} }) => {
212
- const { formatMessage } = reactIntl.useIntl();
213
- const layout = strapiAdmin.useForm(
214
- "Fields",
215
- (state) => state.values.layout ?? []
216
- );
217
- const onChange = strapiAdmin.useForm("Fields", (state) => state.onChange);
218
- const addFieldRow = strapiAdmin.useForm("Fields", (state) => state.addFieldRow);
219
- const removeFieldRow = strapiAdmin.useForm("Fields", (state) => state.removeFieldRow);
220
- const existingFields = layout.map((row) => row.children.map((field) => field.name)).flat();
221
- const remainingFields = Object.entries(metadatas).reduce((acc, current) => {
222
- const [name, { visible, ...field }] = current;
223
- if (!existingFields.includes(name) && visible === true) {
224
- const type = attributes[name]?.type;
225
- const size = type ? fieldSizes[type] : 12;
226
- acc.push({
227
- ...field,
228
- label: field.label ?? name,
229
- name,
230
- size
231
- });
232
- }
233
- return acc;
234
- }, []);
235
- const handleMoveField = ([newRowIndex, newFieldIndex], [currentRowIndex, currentFieldIndex]) => {
236
- const newLayout = structuredClone(layout);
237
- const [field] = newLayout[currentRowIndex].children.splice(currentFieldIndex, 1);
238
- if (!field || field.name === TEMP_FIELD_NAME) {
239
- return;
240
- }
241
- const newRow = newLayout[newRowIndex].children;
242
- const [newFieldKey] = generateNKeysBetween(newRow, 1, currentFieldIndex, newFieldIndex);
243
- newRow.splice(newFieldIndex, 0, { ...field, __temp_key__: newFieldKey });
244
- if (newLayout[newRowIndex].children.reduce((acc, curr) => acc + curr.size, 0) > 12) {
245
- const recalculatedRows = chunkArray(
246
- newLayout[newRowIndex].children.filter((field2) => field2.name !== TEMP_FIELD_NAME)
247
- );
248
- const rowKeys = generateNKeysBetween(
249
- newLayout,
250
- recalculatedRows.length,
251
- currentRowIndex,
252
- newRowIndex
253
- );
254
- newLayout.splice(
255
- newRowIndex,
256
- 1,
257
- ...recalculatedRows.map((row, index2) => ({
258
- __temp_key__: rowKeys[index2],
259
- children: row
260
- }))
261
- );
262
- }
263
- const newLayoutWithSpacers = newLayout.map((row) => ({
264
- ...row,
265
- children: row.children.filter((field2) => field2.name !== TEMP_FIELD_NAME)
266
- })).filter((row) => row.children.length > 0).map((row) => {
267
- const totalSpaceTaken = row.children.reduce((acc, curr) => acc + curr.size, 0);
268
- if (totalSpaceTaken < 12) {
269
- const [spacerKey] = fractionalIndexing.generateNKeysBetween(
270
- row.children.at(-1)?.__temp_key__,
271
- void 0,
272
- 1
273
- );
274
- return {
275
- ...row,
276
- children: [
277
- ...row.children,
278
- {
279
- name: TEMP_FIELD_NAME,
280
- size: 12 - totalSpaceTaken,
281
- __temp_key__: spacerKey
282
- }
283
- ]
284
- };
285
- }
286
- return row;
287
- });
288
- onChange("layout", newLayoutWithSpacers);
289
- };
290
- const handleRemoveField = (rowIndex, fieldIndex) => () => {
291
- if (layout[rowIndex].children.length === 1) {
292
- removeFieldRow(`layout`, rowIndex);
293
- } else {
294
- onChange(`layout.${rowIndex}.children.${fieldIndex}`, void 0);
295
- }
296
- };
297
- const handleAddField = (field) => () => {
298
- addFieldRow("layout", { children: [field] });
299
- };
300
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { paddingTop: 6, direction: "column", alignItems: "stretch", gap: 4, children: [
301
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "flex-start", direction: "column", justifyContent: "space-between", children: [
302
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", children: formatMessage({
303
- id: index.getTranslation("containers.list.displayedFields"),
304
- defaultMessage: "Displayed fields"
305
- }) }),
306
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: formatMessage({
307
- id: "containers.SettingPage.editSettings.description",
308
- defaultMessage: "Drag & drop the fields to build the layout"
309
- }) })
310
- ] }),
311
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 4, hasRadius: true, borderStyle: "dashed", borderWidth: "1px", borderColor: "neutral300", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
312
- layout.map((row, rowIndex) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 2, children: row.children.map(({ size, ...field }, fieldIndex) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: size, children: /* @__PURE__ */ jsxRuntime.jsx(
313
- Field,
314
- {
315
- attribute: attributes[field.name],
316
- components,
317
- index: [rowIndex, fieldIndex],
318
- name: `layout.${rowIndex}.children.${fieldIndex}`,
319
- onMoveField: handleMoveField,
320
- onRemoveField: handleRemoveField(rowIndex, fieldIndex)
321
- }
322
- ) }, field.name)) }, row.__temp_key__)),
323
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
324
- /* @__PURE__ */ jsxRuntime.jsx(
325
- designSystem.Menu.Trigger,
326
- {
327
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Plus, {}),
328
- endIcon: null,
329
- disabled: remainingFields.length === 0,
330
- fullWidth: true,
331
- variant: "secondary",
332
- children: formatMessage({
333
- id: index.getTranslation("containers.SettingPage.add.field"),
334
- defaultMessage: "Insert another field"
335
- })
336
- }
337
- ),
338
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Content, { children: remainingFields.map((field) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Item, { onSelect: handleAddField(field), children: field.label }, field.name)) })
339
- ] })
340
- ] }) })
341
- ] });
342
- };
343
- const generateNKeysBetween = (field, count, currInd, newInd) => {
344
- const startKey = currInd > newInd ? field[newInd - 1]?.__temp_key__ : field[newInd]?.__temp_key__;
345
- const endKey = currInd > newInd ? field[newInd]?.__temp_key__ : field[newInd + 1]?.__temp_key__;
346
- return fractionalIndexing.generateNKeysBetween(startKey, endKey, count);
347
- };
348
- const chunkArray = (array) => {
349
- const result = [];
350
- let temp = [];
351
- array.reduce((acc, field) => {
352
- if (acc + field.size > 12) {
353
- result.push(temp);
354
- temp = [field];
355
- return field.size;
356
- } else {
357
- temp.push(field);
358
- return acc + field.size;
359
- }
360
- }, 0);
361
- if (temp.length > 0) {
362
- result.push(temp);
363
- }
364
- return result;
365
- };
366
- const TEMP_FIELD_NAME = "_TEMP_";
367
- const Field = ({ attribute, components, name, index: index$1, onMoveField, onRemoveField }) => {
368
- const [isModalOpen, setIsModalOpen] = React__namespace.useState(false);
369
- const { formatMessage } = reactIntl.useIntl();
370
- const { value } = strapiAdmin.useField(name);
371
- const [{ isDragging }, objectRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop.useDragAndDrop(true, {
372
- dropSensitivity: "immediate",
373
- type: useDragAndDrop.ItemTypes.EDIT_FIELD,
374
- item: { index: index$1, label: value?.label, name },
375
- index: index$1,
376
- onMoveItem: onMoveField
377
- });
378
- React__namespace.useEffect(() => {
379
- dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
380
- }, [dragPreviewRef]);
381
- const composedRefs = designSystem.useComposedRefs(dragRef, objectRef);
382
- const handleRemoveField = (e) => {
383
- e.stopPropagation();
384
- onRemoveField(e);
385
- };
386
- const tempRefs = designSystem.useComposedRefs(dropRef, objectRef);
387
- if (!value) {
388
- return null;
389
- }
390
- if (value.name === TEMP_FIELD_NAME) {
391
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { tag: "span", height: "100%", style: { opacity: 0 }, ref: tempRefs });
392
- }
393
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
394
- /* @__PURE__ */ jsxRuntime.jsxs(
395
- designSystem.Flex,
396
- {
397
- borderColor: "neutral150",
398
- background: "neutral100",
399
- hasRadius: true,
400
- style: { opacity: isDragging ? 0.5 : 1 },
401
- ref: dropRef,
402
- gap: 3,
403
- cursor: "pointer",
404
- onClick: () => {
405
- setIsModalOpen(true);
406
- },
407
- children: [
408
- /* @__PURE__ */ jsxRuntime.jsx(
409
- DragButton,
410
- {
411
- tag: "span",
412
- withTooltip: false,
413
- label: formatMessage(
414
- {
415
- id: index.getTranslation("components.DraggableCard.move.field"),
416
- defaultMessage: "Move {item}"
417
- },
418
- { item: value.label }
419
- ),
420
- onClick: (e) => e.stopPropagation(),
421
- ref: composedRefs,
422
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, {})
423
- }
424
- ),
425
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", grow: 1, overflow: "hidden", children: [
426
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 3, justifyContent: "space-between", width: "100%", children: [
427
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, fontWeight: "bold", children: value.label }),
428
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
429
- /* @__PURE__ */ jsxRuntime.jsx(
430
- designSystem.IconButton,
431
- {
432
- borderWidth: 0,
433
- background: "transparent",
434
- onClick: (e) => {
435
- e.stopPropagation();
436
- setIsModalOpen(true);
437
- },
438
- withTooltip: false,
439
- label: formatMessage(
440
- {
441
- id: index.getTranslation("components.DraggableCard.edit.field"),
442
- defaultMessage: "Edit {item}"
443
- },
444
- { item: value.label }
445
- ),
446
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Pencil, {})
447
- }
448
- ),
449
- /* @__PURE__ */ jsxRuntime.jsx(
450
- designSystem.IconButton,
451
- {
452
- borderWidth: 0,
453
- onClick: handleRemoveField,
454
- background: "transparent",
455
- withTooltip: false,
456
- label: formatMessage(
457
- {
458
- id: index.getTranslation("components.DraggableCard.delete.field"),
459
- defaultMessage: "Delete {item}"
460
- },
461
- { item: value.label }
462
- ),
463
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Cross, {})
464
- }
465
- )
466
- ] })
467
- ] }),
468
- attribute?.type === "component" ? /* @__PURE__ */ jsxRuntime.jsxs(
469
- designSystem.Flex,
470
- {
471
- paddingTop: 3,
472
- paddingRight: 3,
473
- paddingBottom: 3,
474
- paddingLeft: 0,
475
- alignItems: "flex-start",
476
- direction: "column",
477
- gap: 2,
478
- width: "100%",
479
- children: [
480
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, width: "100%", children: components[attribute.component].layout.map(
481
- (row) => row.map(({ size, ...field }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: size, children: /* @__PURE__ */ jsxRuntime.jsx(
482
- designSystem.Flex,
483
- {
484
- alignItems: "center",
485
- background: "neutral0",
486
- paddingTop: 2,
487
- paddingBottom: 2,
488
- paddingLeft: 3,
489
- paddingRight: 3,
490
- hasRadius: true,
491
- borderColor: "neutral200",
492
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: field.name })
493
- }
494
- ) }, field.name))
495
- ) }),
496
- /* @__PURE__ */ jsxRuntime.jsx(
497
- designSystem.Link,
498
- {
499
- onClick: (e) => e.stopPropagation(),
500
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Cog, {}),
501
- tag: reactRouterDom.NavLink,
502
- to: `../components/${attribute.component}/configurations/edit`,
503
- children: formatMessage({
504
- id: index.getTranslation("components.FieldItem.linkToComponentLayout"),
505
- defaultMessage: "Set the component's layout"
506
- })
507
- }
508
- )
509
- ]
510
- }
511
- ) : null,
512
- attribute?.type === "dynamiczone" ? /* @__PURE__ */ jsxRuntime.jsx(
513
- designSystem.Flex,
514
- {
515
- paddingTop: 3,
516
- paddingRight: 3,
517
- paddingBottom: 3,
518
- paddingLeft: 0,
519
- alignItems: "flex-start",
520
- gap: 2,
521
- width: "100%",
522
- children: attribute?.components.map((uid) => /* @__PURE__ */ jsxRuntime.jsxs(
523
- ComponentLink,
524
- {
525
- onClick: (e) => e.stopPropagation(),
526
- to: `../components/${uid}/configurations/edit`,
527
- children: [
528
- /* @__PURE__ */ jsxRuntime.jsx(ComponentIcon.ComponentIcon, { icon: components[uid].settings.icon }),
529
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontSize: 1, textColor: "neutral600", fontWeight: "bold", children: components[uid].settings.displayName })
530
- ]
531
- },
532
- uid
533
- ))
534
- }
535
- ) : null
536
- ] })
537
- ]
538
- }
539
- ),
540
- isModalOpen && value.name !== TEMP_FIELD_NAME && /* @__PURE__ */ jsxRuntime.jsx(EditFieldForm, { attribute, name, onClose: () => setIsModalOpen(false) })
541
- ] });
542
- };
543
- const DragButton = styledComponents.styled(designSystem.IconButton)`
544
- height: unset;
545
- align-self: stretch;
546
- display: flex;
547
- align-items: center;
548
- padding: 0 ${({ theme }) => theme.spaces[3]};
549
- border-right: 1px solid ${({ theme }) => theme.colors.neutral150};
550
- cursor: all-scroll;
551
-
552
- svg {
553
- width: 1.2rem;
554
- height: 1.2rem;
555
- }
556
- `;
557
- const ComponentLink = styledComponents.styled(reactRouterDom.NavLink)`
558
- display: flex;
559
- flex-direction: column;
560
- align-items: center;
561
- gap: ${({ theme }) => theme.spaces[1]};
562
- padding: ${(props) => props.theme.spaces[2]};
563
- border: 1px solid ${({ theme }) => theme.colors.neutral200};
564
- background: ${({ theme }) => theme.colors.neutral0};
565
- width: 14rem;
566
- border-radius: ${({ theme }) => theme.borderRadius};
567
- text-decoration: none;
568
-
569
- &:focus,
570
- &:hover {
571
- ${({ theme }) => `
572
- background-color: ${theme.colors.primary100};
573
- border-color: ${theme.colors.primary200};
574
-
575
- ${designSystem.Typography} {
576
- color: ${theme.colors.primary600};
577
- }
578
- `}
579
-
580
- /* > ComponentIcon */
581
- > div:first-child {
582
- background: ${({ theme }) => theme.colors.primary200};
583
- color: ${({ theme }) => theme.colors.primary600};
584
-
585
- svg {
586
- path {
587
- fill: ${({ theme }) => theme.colors.primary600};
588
- }
589
- }
590
- }
591
- }
592
- `;
593
- const ConfigurationForm = ({
594
- attributes,
595
- fieldSizes,
596
- layout: editLayout,
597
- onSubmit
598
- }) => {
599
- const { components, settings, layout, metadatas } = editLayout;
600
- const { formatMessage } = reactIntl.useIntl();
601
- const initialValues = React__namespace.useMemo(() => {
602
- const transformations = pipe__default.default(
603
- flattenPanels,
604
- replaceMainFieldWithNameOnly,
605
- extractMetadata,
606
- addTmpSpaceToLayout,
607
- addTmpKeysToLayout
608
- );
609
- return {
610
- layout: transformations(layout),
611
- settings
612
- };
613
- }, [layout, settings]);
614
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Root, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Main, { children: /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Form, { initialValues, onSubmit, method: "PUT", children: [
615
- /* @__PURE__ */ jsxRuntime.jsx(Header, { name: settings.displayName ?? "" }),
616
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(
617
- designSystem.Flex,
618
- {
619
- alignItems: "stretch",
620
- background: "neutral0",
621
- direction: "column",
622
- gap: 6,
623
- hasRadius: true,
624
- shadow: "tableShadow",
625
- paddingTop: 6,
626
- paddingBottom: 6,
627
- paddingLeft: 7,
628
- paddingRight: 7,
629
- children: [
630
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", tag: "h2", children: formatMessage({
631
- id: index.getTranslation("containers.SettingPage.settings"),
632
- defaultMessage: "Settings"
633
- }) }),
634
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid, { children: [
635
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 6, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
636
- strapiAdmin.InputRenderer,
637
- {
638
- type: "enumeration",
639
- label: formatMessage({
640
- id: index.getTranslation("containers.SettingPage.editSettings.entry.title"),
641
- defaultMessage: "Entry title"
642
- }),
643
- hint: formatMessage({
644
- id: index.getTranslation(
645
- "containers.SettingPage.editSettings.entry.title.description"
646
- ),
647
- defaultMessage: "Set the display field of your entry"
648
- }),
649
- name: "settings.mainField",
650
- options: Object.entries(attributes).reduce((acc, [key, attribute]) => {
651
- if (!attribute) {
652
- return acc;
653
- }
654
- if (!index.ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD.includes(attribute.type)) {
655
- acc.push({
656
- label: key,
657
- value: key
658
- });
659
- }
660
- return acc;
661
- }, [])
662
- }
663
- ) }),
664
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { paddingTop: 6, paddingBottom: 6, col: 12, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {}) }),
665
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 12, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", tag: "h3", children: formatMessage({
666
- id: index.getTranslation("containers.SettingPage.view"),
667
- defaultMessage: "View"
668
- }) }) }),
669
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 12, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
670
- Fields,
671
- {
672
- attributes,
673
- components,
674
- fieldSizes,
675
- metadatas
676
- }
677
- ) })
678
- ] })
679
- ]
680
- }
681
- ) })
682
- ] }) }) });
683
- };
684
- const flattenPanels = (layout) => layout.flat(1);
685
- const replaceMainFieldWithNameOnly = (layout) => layout.map(
686
- (row) => row.map((field) => ({
687
- ...field,
688
- mainField: field.mainField?.name
689
- }))
690
- );
691
- const extractMetadata = (layout) => {
692
- return layout.map(
693
- (row) => row.map(({ label, disabled, hint, placeholder, size, name, mainField }) => ({
694
- label,
695
- editable: !disabled,
696
- description: hint,
697
- mainField,
698
- placeholder,
699
- size,
700
- name,
701
- __temp_key__: ""
702
- }))
703
- );
704
- };
705
- const addTmpSpaceToLayout = (layout) => [
706
- ...layout.map((row) => {
707
- const totalSpaceTaken = row.reduce((acc, field) => acc + field.size, 0);
708
- if (totalSpaceTaken < 12) {
709
- return [
710
- ...row,
711
- {
712
- name: TEMP_FIELD_NAME,
713
- size: 12 - totalSpaceTaken,
714
- __temp_key__: ""
715
- }
716
- ];
717
- }
718
- return row;
719
- })
720
- ];
721
- const addTmpKeysToLayout = (layout) => {
722
- const keys = fractionalIndexing.generateNKeysBetween(void 0, void 0, layout.length);
723
- return layout.map((row, rowIndex) => {
724
- const fieldKeys = fractionalIndexing.generateNKeysBetween(void 0, void 0, row.length);
725
- return {
726
- __temp_key__: keys[rowIndex],
727
- children: row.map((field, fieldIndex) => {
728
- return {
729
- ...field,
730
- __temp_key__: fieldKeys[fieldIndex]
731
- };
732
- })
733
- };
734
- });
735
- };
736
- const Header = ({ name }) => {
737
- const { formatMessage } = reactIntl.useIntl();
738
- const modified = strapiAdmin.useForm("Header", (state) => state.modified);
739
- const isSubmitting = strapiAdmin.useForm("Header", (state) => state.isSubmitting);
740
- return /* @__PURE__ */ jsxRuntime.jsx(
741
- strapiAdmin.Layouts.Header,
742
- {
743
- title: formatMessage(
744
- {
745
- id: index.getTranslation("components.SettingsViewWrapper.pluginHeader.title"),
746
- defaultMessage: `Configure the view - {name}`
747
- },
748
- { name: index.capitalise(name) }
749
- ),
750
- subtitle: formatMessage({
751
- id: index.getTranslation("components.SettingsViewWrapper.pluginHeader.description.edit-settings"),
752
- defaultMessage: "Customize how the edit view will look like."
753
- }),
754
- navigationAction: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {}),
755
- primaryAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { disabled: !modified, loading: isSubmitting, type: "submit", children: formatMessage({ id: "global.save", defaultMessage: "Save" }) })
756
- }
757
- );
758
- };
759
- exports.ConfigurationForm = ConfigurationForm;
760
- exports.TEMP_FIELD_NAME = TEMP_FIELD_NAME;
761
- //# sourceMappingURL=Form-B81OtW-k.js.map