@strapi/content-manager 0.0.0-next.c22d1aa5024dc77092c3df7e990ad89dcd79e7b0 → 0.0.0-next.c57731c6e91ae024fa544ad986d80a3c4a489dbf

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 (221) hide show
  1. package/dist/admin/chunks/{CardDragPreview-DwuraT0K.js → CardDragPreview-DwuraT0K.mjs} +1 -1
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs.map +1 -0
  3. package/dist/admin/chunks/{ComponentConfigurationPage-Dj1bNvEF.js → ComponentConfigurationPage-BqvYunl3.js} +4 -3
  4. package/dist/admin/chunks/{ComponentConfigurationPage-Dj1bNvEF.js.map → ComponentConfigurationPage-BqvYunl3.js.map} +1 -1
  5. package/dist/admin/chunks/{ComponentConfigurationPage-Co2eC_-C.js → ComponentConfigurationPage-C9JWxciR.mjs} +9 -8
  6. package/dist/admin/chunks/ComponentConfigurationPage-C9JWxciR.mjs.map +1 -0
  7. package/dist/admin/chunks/{ComponentIcon-BZcTc4rj.js → ComponentIcon-BZcTc4rj.mjs} +1 -1
  8. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs.map +1 -0
  9. package/dist/admin/chunks/{EditConfigurationPage-Dm5woBp9.js → EditConfigurationPage-DE_FVPa6.js} +4 -3
  10. package/dist/admin/chunks/{EditConfigurationPage-Dm5woBp9.js.map → EditConfigurationPage-DE_FVPa6.js.map} +1 -1
  11. package/dist/admin/chunks/{EditConfigurationPage-zd9OLaVh.js → EditConfigurationPage-DqBbH_tt.mjs} +9 -8
  12. package/dist/admin/chunks/EditConfigurationPage-DqBbH_tt.mjs.map +1 -0
  13. package/dist/admin/chunks/{EditViewPage-DsBKmSPb.js → EditViewPage-BPrkSLuI.js} +7 -10
  14. package/dist/admin/chunks/EditViewPage-BPrkSLuI.js.map +1 -0
  15. package/dist/admin/chunks/{EditViewPage-kAIaYTg0.js → EditViewPage-CxmB65b6.mjs} +11 -14
  16. package/dist/admin/chunks/EditViewPage-CxmB65b6.mjs.map +1 -0
  17. package/dist/admin/chunks/{FieldTypeIcon-BY6MrVF4.js → FieldTypeIcon-BY6MrVF4.mjs} +1 -1
  18. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs.map +1 -0
  19. package/dist/admin/chunks/{Form-BPIhJKyf.js → Form-CnU6eQgF.js} +2 -2
  20. package/dist/admin/chunks/{Form-BPIhJKyf.js.map → Form-CnU6eQgF.js.map} +1 -1
  21. package/dist/admin/chunks/{Form-BO69oITe.js → Form-DBte52Jp.mjs} +5 -5
  22. package/dist/admin/chunks/Form-DBte52Jp.mjs.map +1 -0
  23. package/dist/admin/chunks/{History-BzvpM-Gw.js → History-BZnq2Bi2.mjs} +11 -11
  24. package/dist/admin/chunks/History-BZnq2Bi2.mjs.map +1 -0
  25. package/dist/admin/chunks/{History-DBQ96jv2.js → History-CRk6-vwW.js} +6 -6
  26. package/dist/admin/chunks/{History-DBQ96jv2.js.map → History-CRk6-vwW.js.map} +1 -1
  27. package/dist/admin/chunks/{Input-Dh1MtWno.js → Input-CoyG0mFB.js} +748 -313
  28. package/dist/admin/chunks/Input-CoyG0mFB.js.map +1 -0
  29. package/dist/admin/chunks/{Input-BlDcbhUC.js → Input-CquZCZx3.mjs} +755 -320
  30. package/dist/admin/chunks/Input-CquZCZx3.mjs.map +1 -0
  31. package/dist/admin/chunks/{ListConfigurationPage-8d3BsQIr.js → ListConfigurationPage-CyWNH3Mv.js} +3 -2
  32. package/dist/admin/chunks/{ListConfigurationPage-DK0ARecn.js.map → ListConfigurationPage-CyWNH3Mv.js.map} +1 -1
  33. package/dist/admin/chunks/{ListConfigurationPage-DK0ARecn.js → ListConfigurationPage-T4REP8DG.mjs} +8 -7
  34. package/dist/admin/chunks/ListConfigurationPage-T4REP8DG.mjs.map +1 -0
  35. package/dist/admin/chunks/{ListViewPage-CS1ED-vI.js → ListViewPage-Br5s3p1I.js} +4 -3
  36. package/dist/admin/chunks/{ListViewPage-BF2q7N6W.js.map → ListViewPage-Br5s3p1I.js.map} +1 -1
  37. package/dist/admin/chunks/{ListViewPage-BF2q7N6W.js → ListViewPage-eJAJfQ91.mjs} +6 -5
  38. package/dist/admin/chunks/ListViewPage-eJAJfQ91.mjs.map +1 -0
  39. package/dist/admin/chunks/{NoContentTypePage-C5Qxz3I4.js → NoContentTypePage-BZlQtroN.js} +3 -2
  40. package/dist/admin/chunks/{NoContentTypePage-C5Qxz3I4.js.map → NoContentTypePage-BZlQtroN.js.map} +1 -1
  41. package/dist/admin/chunks/{NoContentTypePage-DjdXr1-j.js → NoContentTypePage-Ccor5E27.mjs} +3 -2
  42. package/dist/admin/chunks/NoContentTypePage-Ccor5E27.mjs.map +1 -0
  43. package/dist/admin/chunks/{NoPermissionsPage-C5dC0MtL.js → NoPermissionsPage-BeqSJ6Je.js} +3 -2
  44. package/dist/admin/chunks/{NoPermissionsPage-BUwtKUEP.js.map → NoPermissionsPage-BeqSJ6Je.js.map} +1 -1
  45. package/dist/admin/chunks/{NoPermissionsPage-BUwtKUEP.js → NoPermissionsPage-BpCoaqBJ.mjs} +3 -2
  46. package/dist/admin/chunks/NoPermissionsPage-BpCoaqBJ.mjs.map +1 -0
  47. package/dist/admin/chunks/{Preview-DBvmhR7Q.js → Preview-DYyTSe9I.js} +236 -92
  48. package/dist/admin/chunks/Preview-DYyTSe9I.js.map +1 -0
  49. package/dist/admin/chunks/{Preview-C9kXTY6C.js → Preview-VVd4rU0x.mjs} +244 -100
  50. package/dist/admin/chunks/Preview-VVd4rU0x.mjs.map +1 -0
  51. package/dist/admin/chunks/{Relations-Cn0atFpd.js → Relations-CiBR_0b1.mjs} +471 -7
  52. package/dist/admin/chunks/Relations-CiBR_0b1.mjs.map +1 -0
  53. package/dist/admin/chunks/{Relations-XHxDKEvT.js → Relations-PF93YcFV.js} +469 -4
  54. package/dist/admin/chunks/Relations-PF93YcFV.js.map +1 -0
  55. package/dist/admin/chunks/{ar-DckYq_WK.js → ar-DckYq_WK.mjs} +1 -1
  56. package/dist/admin/chunks/ar-DckYq_WK.mjs.map +1 -0
  57. package/dist/admin/chunks/{ca-DviY7mRj.js → ca-DviY7mRj.mjs} +1 -1
  58. package/dist/admin/chunks/ca-DviY7mRj.mjs.map +1 -0
  59. package/dist/admin/chunks/{cs-C7OSYFQ7.js → cs-C7OSYFQ7.mjs} +1 -1
  60. package/dist/admin/chunks/cs-C7OSYFQ7.mjs.map +1 -0
  61. package/dist/admin/chunks/{de-5QRlDHyR.js → de-5QRlDHyR.mjs} +1 -1
  62. package/dist/admin/chunks/de-5QRlDHyR.mjs.map +1 -0
  63. package/dist/admin/chunks/{en-LfhocNG2.js → en-CImiNxXE.mjs} +3 -1
  64. package/dist/admin/chunks/en-CImiNxXE.mjs.map +1 -0
  65. package/dist/admin/chunks/{en-C1CjdAtC.js → en-CLf4SuMQ.js} +3 -1
  66. package/dist/admin/chunks/{en-LfhocNG2.js.map → en-CLf4SuMQ.js.map} +1 -1
  67. package/dist/admin/chunks/{es-DkoWSExG.js → es-DkoWSExG.mjs} +1 -1
  68. package/dist/admin/chunks/es-DkoWSExG.mjs.map +1 -0
  69. package/dist/admin/chunks/{eu-BG1xX7HK.js → eu-BG1xX7HK.mjs} +1 -1
  70. package/dist/admin/chunks/eu-BG1xX7HK.mjs.map +1 -0
  71. package/dist/admin/chunks/{fr-CFdRaRVj.js → fr-CFdRaRVj.mjs} +1 -1
  72. package/dist/admin/chunks/fr-CFdRaRVj.mjs.map +1 -0
  73. package/dist/admin/chunks/{gu-D5MMMXRs.js → gu-D5MMMXRs.mjs} +1 -1
  74. package/dist/admin/chunks/gu-D5MMMXRs.mjs.map +1 -0
  75. package/dist/admin/chunks/{hi-lp17SCjr.js → hi-lp17SCjr.mjs} +1 -1
  76. package/dist/admin/chunks/hi-lp17SCjr.mjs.map +1 -0
  77. package/dist/admin/chunks/{hooks-DMvik5y_.js → hooks-DMvik5y_.mjs} +1 -1
  78. package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +1 -0
  79. package/dist/admin/chunks/{hu-CLka1U2C.js → hu-CLka1U2C.mjs} +1 -1
  80. package/dist/admin/chunks/hu-CLka1U2C.mjs.map +1 -0
  81. package/dist/admin/chunks/{id-USfY9m1g.js → id-USfY9m1g.mjs} +1 -1
  82. package/dist/admin/chunks/id-USfY9m1g.mjs.map +1 -0
  83. package/dist/admin/chunks/{index-BczuAULz.js → index-Cv0O6gf0.js} +93 -43
  84. package/dist/admin/chunks/index-Cv0O6gf0.js.map +1 -0
  85. package/dist/admin/chunks/{index-BkyR-Bnu.js → index-Dz9dwt8b.mjs} +122 -73
  86. package/dist/admin/chunks/index-Dz9dwt8b.mjs.map +1 -0
  87. package/dist/admin/chunks/{it-BAHrwmYS.js → it-BAHrwmYS.mjs} +1 -1
  88. package/dist/admin/chunks/it-BAHrwmYS.mjs.map +1 -0
  89. package/dist/admin/chunks/{ja-BWKmBJFT.js → ja-BWKmBJFT.mjs} +1 -1
  90. package/dist/admin/chunks/ja-BWKmBJFT.mjs.map +1 -0
  91. package/dist/admin/chunks/{ko-CgADGBNt.js → ko-CgADGBNt.mjs} +1 -1
  92. package/dist/admin/chunks/ko-CgADGBNt.mjs.map +1 -0
  93. package/dist/admin/chunks/{layout-DcDoRT8g.js → layout-CzYR-gGR.js} +5 -4
  94. package/dist/admin/chunks/{layout-DcDoRT8g.js.map → layout-CzYR-gGR.js.map} +1 -1
  95. package/dist/admin/chunks/{layout-fghBgRgX.js → layout-Jq9GIk_m.mjs} +8 -7
  96. package/dist/admin/chunks/layout-Jq9GIk_m.mjs.map +1 -0
  97. package/dist/admin/chunks/{ml-CnhCfOn_.js → ml-CnhCfOn_.mjs} +1 -1
  98. package/dist/admin/chunks/ml-CnhCfOn_.mjs.map +1 -0
  99. package/dist/admin/chunks/{ms-Bh09NFff.js → ms-Bh09NFff.mjs} +1 -1
  100. package/dist/admin/chunks/ms-Bh09NFff.mjs.map +1 -0
  101. package/dist/admin/chunks/{nl-C8HYflTc.js → nl-C8HYflTc.mjs} +1 -1
  102. package/dist/admin/chunks/nl-C8HYflTc.mjs.map +1 -0
  103. package/dist/admin/chunks/{objects-wl73iEma.js → objects-wl73iEma.mjs} +1 -1
  104. package/dist/admin/chunks/objects-wl73iEma.mjs.map +1 -0
  105. package/dist/admin/chunks/{pl-MFCZJZuZ.js → pl-MFCZJZuZ.mjs} +1 -1
  106. package/dist/admin/chunks/pl-MFCZJZuZ.mjs.map +1 -0
  107. package/dist/admin/chunks/{pt-BR-CcotyBGJ.js → pt-BR-CcotyBGJ.mjs} +1 -1
  108. package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs.map +1 -0
  109. package/dist/admin/chunks/{pt-HbmgeiYO.js → pt-HbmgeiYO.mjs} +1 -1
  110. package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +1 -0
  111. package/dist/admin/chunks/{relations-CgaydhiM.js → relations-CMn4X6LA.js} +2 -2
  112. package/dist/admin/chunks/{relations-CgaydhiM.js.map → relations-CMn4X6LA.js.map} +1 -1
  113. package/dist/admin/chunks/{relations-DPVgU_rq.js → relations-Y5L4AlFb.mjs} +2 -2
  114. package/dist/admin/chunks/relations-Y5L4AlFb.mjs.map +1 -0
  115. package/dist/admin/chunks/{ru-CB4BUyQp.js → ru-CB4BUyQp.mjs} +1 -1
  116. package/dist/admin/chunks/{ru-CB4BUyQp.js.map → ru-CB4BUyQp.mjs.map} +1 -1
  117. package/dist/admin/chunks/{sa-n_aPA-pU.js → sa-n_aPA-pU.mjs} +1 -1
  118. package/dist/admin/chunks/sa-n_aPA-pU.mjs.map +1 -0
  119. package/dist/admin/chunks/{sk-tn_BDjE2.js → sk-tn_BDjE2.mjs} +1 -1
  120. package/dist/admin/chunks/sk-tn_BDjE2.mjs.map +1 -0
  121. package/dist/admin/chunks/{sv-cq4ZrQRd.js → sv-cq4ZrQRd.mjs} +1 -1
  122. package/dist/admin/chunks/sv-cq4ZrQRd.mjs.map +1 -0
  123. package/dist/admin/chunks/{th-mUH7hEtc.js → th-mUH7hEtc.mjs} +1 -1
  124. package/dist/admin/chunks/th-mUH7hEtc.mjs.map +1 -0
  125. package/dist/admin/chunks/{tr-Yt38daxh.js → tr-Yt38daxh.mjs} +1 -1
  126. package/dist/admin/chunks/tr-Yt38daxh.mjs.map +1 -0
  127. package/dist/admin/chunks/uk-BtM6WnaE.mjs +313 -0
  128. package/dist/admin/chunks/uk-BtM6WnaE.mjs.map +1 -0
  129. package/dist/admin/chunks/uk-DB6OgySY.js +318 -0
  130. package/dist/admin/chunks/{en-C1CjdAtC.js.map → uk-DB6OgySY.js.map} +1 -1
  131. package/dist/admin/chunks/{useDragAndDrop-HYwNDExe.js → useDragAndDrop-HYwNDExe.mjs} +1 -1
  132. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs.map +1 -0
  133. package/dist/admin/chunks/{usePrev-Bjw2dhmq.js → usePrev-Bjw2dhmq.mjs} +1 -1
  134. package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs.map +1 -0
  135. package/dist/admin/chunks/{vi-CvBGlTjr.js → vi-CvBGlTjr.mjs} +1 -1
  136. package/dist/admin/chunks/vi-CvBGlTjr.mjs.map +1 -0
  137. package/dist/admin/chunks/{zh-BmF-sHaT.js → zh-BmF-sHaT.mjs} +1 -1
  138. package/dist/admin/chunks/zh-BmF-sHaT.mjs.map +1 -0
  139. package/dist/admin/chunks/{zh-Hans-CI0HKio3.js → zh-Hans-CI0HKio3.mjs} +1 -1
  140. package/dist/admin/chunks/{zh-Hans-CI0HKio3.js.map → zh-Hans-CI0HKio3.mjs.map} +1 -1
  141. package/dist/admin/index.js +2 -1
  142. package/dist/admin/index.js.map +1 -1
  143. package/dist/admin/index.mjs +2 -1
  144. package/dist/admin/index.mjs.map +1 -1
  145. package/dist/admin/src/components/InjectionZone.d.ts +7 -1
  146. package/dist/admin/src/content-manager.d.ts +4 -0
  147. package/dist/admin/src/hooks/useDocument.d.ts +2 -0
  148. package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -0
  149. package/dist/admin/src/index.d.ts +1 -0
  150. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +2 -1
  151. package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
  152. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +49 -1
  153. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +2 -1
  154. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +1 -2
  155. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +2 -1
  156. package/dist/admin/src/preview/components/PreviewContent.d.ts +1 -2
  157. package/dist/admin/src/preview/pages/Preview.d.ts +4 -0
  158. package/dist/server/index.js +1 -1
  159. package/dist/server/index.js.map +1 -1
  160. package/dist/server/index.mjs +1 -1
  161. package/dist/server/index.mjs.map +1 -1
  162. package/package.json +8 -8
  163. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.map +0 -1
  164. package/dist/admin/chunks/ComponentConfigurationPage-Co2eC_-C.js.map +0 -1
  165. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.map +0 -1
  166. package/dist/admin/chunks/EditConfigurationPage-zd9OLaVh.js.map +0 -1
  167. package/dist/admin/chunks/EditViewPage-DsBKmSPb.js.map +0 -1
  168. package/dist/admin/chunks/EditViewPage-kAIaYTg0.js.map +0 -1
  169. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.map +0 -1
  170. package/dist/admin/chunks/Form-BO69oITe.js.map +0 -1
  171. package/dist/admin/chunks/History-BzvpM-Gw.js.map +0 -1
  172. package/dist/admin/chunks/Input-BlDcbhUC.js.map +0 -1
  173. package/dist/admin/chunks/Input-Dh1MtWno.js.map +0 -1
  174. package/dist/admin/chunks/ListConfigurationPage-8d3BsQIr.js.map +0 -1
  175. package/dist/admin/chunks/ListViewPage-CS1ED-vI.js.map +0 -1
  176. package/dist/admin/chunks/NoContentTypePage-DjdXr1-j.js.map +0 -1
  177. package/dist/admin/chunks/NoPermissionsPage-C5dC0MtL.js.map +0 -1
  178. package/dist/admin/chunks/Preview-C9kXTY6C.js.map +0 -1
  179. package/dist/admin/chunks/Preview-DBvmhR7Q.js.map +0 -1
  180. package/dist/admin/chunks/Relations-Cn0atFpd.js.map +0 -1
  181. package/dist/admin/chunks/Relations-XHxDKEvT.js.map +0 -1
  182. package/dist/admin/chunks/ar-DckYq_WK.js.map +0 -1
  183. package/dist/admin/chunks/ca-DviY7mRj.js.map +0 -1
  184. package/dist/admin/chunks/cs-C7OSYFQ7.js.map +0 -1
  185. package/dist/admin/chunks/de-5QRlDHyR.js.map +0 -1
  186. package/dist/admin/chunks/es-DkoWSExG.js.map +0 -1
  187. package/dist/admin/chunks/eu-BG1xX7HK.js.map +0 -1
  188. package/dist/admin/chunks/fr-CFdRaRVj.js.map +0 -1
  189. package/dist/admin/chunks/gu-D5MMMXRs.js.map +0 -1
  190. package/dist/admin/chunks/hi-lp17SCjr.js.map +0 -1
  191. package/dist/admin/chunks/hooks-DMvik5y_.js.map +0 -1
  192. package/dist/admin/chunks/hu-CLka1U2C.js.map +0 -1
  193. package/dist/admin/chunks/id-USfY9m1g.js.map +0 -1
  194. package/dist/admin/chunks/index-BczuAULz.js.map +0 -1
  195. package/dist/admin/chunks/index-BkyR-Bnu.js.map +0 -1
  196. package/dist/admin/chunks/it-BAHrwmYS.js.map +0 -1
  197. package/dist/admin/chunks/ja-BWKmBJFT.js.map +0 -1
  198. package/dist/admin/chunks/ko-CgADGBNt.js.map +0 -1
  199. package/dist/admin/chunks/layout-fghBgRgX.js.map +0 -1
  200. package/dist/admin/chunks/ml-CnhCfOn_.js.map +0 -1
  201. package/dist/admin/chunks/ms-Bh09NFff.js.map +0 -1
  202. package/dist/admin/chunks/nl-C8HYflTc.js.map +0 -1
  203. package/dist/admin/chunks/objects-wl73iEma.js.map +0 -1
  204. package/dist/admin/chunks/pl-MFCZJZuZ.js.map +0 -1
  205. package/dist/admin/chunks/pt-BR-CcotyBGJ.js.map +0 -1
  206. package/dist/admin/chunks/pt-HbmgeiYO.js.map +0 -1
  207. package/dist/admin/chunks/relations-DPVgU_rq.js.map +0 -1
  208. package/dist/admin/chunks/sa-n_aPA-pU.js.map +0 -1
  209. package/dist/admin/chunks/sk-tn_BDjE2.js.map +0 -1
  210. package/dist/admin/chunks/sv-cq4ZrQRd.js.map +0 -1
  211. package/dist/admin/chunks/th-mUH7hEtc.js.map +0 -1
  212. package/dist/admin/chunks/tr-Yt38daxh.js.map +0 -1
  213. package/dist/admin/chunks/uk-B24MoTVg.js +0 -145
  214. package/dist/admin/chunks/uk-B24MoTVg.js.map +0 -1
  215. package/dist/admin/chunks/uk-Cpgmm7gE.js +0 -140
  216. package/dist/admin/chunks/uk-Cpgmm7gE.js.map +0 -1
  217. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.map +0 -1
  218. package/dist/admin/chunks/usePrev-Bjw2dhmq.js.map +0 -1
  219. package/dist/admin/chunks/vi-CvBGlTjr.js.map +0 -1
  220. package/dist/admin/chunks/zh-BmF-sHaT.js.map +0 -1
  221. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +0 -49
@@ -12,9 +12,9 @@ var reactIntl = require('react-intl');
12
12
  var reactRouterDom = require('react-router-dom');
13
13
  var reactWindow = require('react-window');
14
14
  var styledComponents = require('styled-components');
15
- var index = require('./index-BczuAULz.js');
15
+ var index = require('./index-Cv0O6gf0.js');
16
16
  var useDragAndDrop = require('./useDragAndDrop-gcqEJMnO.js');
17
- var relations = require('./relations-CgaydhiM.js');
17
+ var relations = require('./relations-CMn4X6LA.js');
18
18
 
19
19
  function _interopNamespaceDefault(e) {
20
20
  var n = Object.create(null);
@@ -101,7 +101,189 @@ const ONE_WAY_RELATIONS = [
101
101
  * @description The relations field holds a lot of domain logic for handling relations which is rather complicated
102
102
  * At present we do not expose this to plugin developers, however, they are able to overwrite it themselves should
103
103
  * they wish to do so.
104
- */ const RelationsField = /*#__PURE__*/ React__namespace.forwardRef(({ disabled, label, ...props }, ref)=>{
104
+ */ const UnstableRelationsField = /*#__PURE__*/ React__namespace.forwardRef(({ disabled, label, ...props }, ref)=>{
105
+ const [currentPage, setCurrentPage] = React__namespace.useState(1);
106
+ const { document, model: documentModel } = index.useDoc();
107
+ const documentId = document?.documentId;
108
+ const { formatMessage } = reactIntl.useIntl();
109
+ const [{ query }] = strapiAdmin.useQueryParams();
110
+ const params = index.buildValidParams(query);
111
+ const isMorph = props.attribute.relation.toLowerCase().includes('morph');
112
+ const isDisabled = isMorph || disabled;
113
+ const { componentId, componentUID } = useComponent('RelationsField', ({ uid, id })=>({
114
+ componentId: id,
115
+ componentUID: uid
116
+ }));
117
+ const isSubmitting = strapiAdmin.useForm('RelationsList', (state)=>state.isSubmitting);
118
+ React__namespace.useEffect(()=>{
119
+ setCurrentPage(1);
120
+ }, [
121
+ isSubmitting
122
+ ]);
123
+ /**
124
+ * We'll always have a documentId in a created entry, so we look for a componentId first.
125
+ * Same with `uid` and `documentModel`.
126
+ */ const id = componentId ? componentId.toString() : documentId;
127
+ const model = componentUID ?? documentModel;
128
+ /**
129
+ * The `name` prop is a complete path to the field, e.g. `field1.field2.field3`.
130
+ * Where the above example would a nested field within two components, however
131
+ * we only require the field on the component not the complete path since we query
132
+ * individual components. Therefore we split the string and take the last item.
133
+ */ const [targetField] = props.name.split('.').slice(-1);
134
+ const { data, isLoading, isFetching } = relations.useGetRelationsQuery({
135
+ model,
136
+ targetField,
137
+ // below we don't run the query if there is no id.
138
+ id: id,
139
+ params: {
140
+ ...params,
141
+ pageSize: RELATIONS_TO_DISPLAY,
142
+ page: currentPage
143
+ }
144
+ }, {
145
+ refetchOnMountOrArgChange: true,
146
+ skip: !id,
147
+ selectFromResult: (result)=>{
148
+ return {
149
+ ...result,
150
+ data: {
151
+ ...result.data,
152
+ results: result.data?.results ? result.data.results : []
153
+ }
154
+ };
155
+ }
156
+ });
157
+ const handleLoadMore = ()=>{
158
+ setCurrentPage((prev)=>prev + 1);
159
+ };
160
+ const field = strapiAdmin.useField(props.name);
161
+ const isFetchingMoreRelations = isLoading || isFetching;
162
+ const realServerRelationsCount = 'pagination' in data && data.pagination ? data.pagination.total : 0;
163
+ /**
164
+ * Items that are already connected, but reordered would be in
165
+ * this list, so to get an accurate figure, we remove them.
166
+ */ const relationsConnected = (field.value?.connect ?? []).filter((rel)=>data.results.findIndex((relation)=>relation.id === rel.id) === -1).length ?? 0;
167
+ const relationsDisconnected = field.value?.disconnect?.length ?? 0;
168
+ const relationsCount = realServerRelationsCount + relationsConnected - relationsDisconnected;
169
+ /**
170
+ * This is it, the source of truth for reordering in conjunction with partial loading & updating
171
+ * of relations. Relations on load are given __temp_key__ when fetched, because we don't want to
172
+ * create brand new keys everytime the data updates, just keep adding them onto the newly loaded ones.
173
+ */ const relations$1 = React__namespace.useMemo(()=>{
174
+ const ctx = {
175
+ field: field.value,
176
+ // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.
177
+ href: `../${index.COLLECTION_TYPES}/${props.attribute.targetModel}`,
178
+ mainField: props.mainField
179
+ };
180
+ /**
181
+ * Tidy up our data.
182
+ */ const transformations = pipe(removeConnected(ctx), removeDisconnected(ctx), addLabelAndHref(ctx));
183
+ const transformedRels = transformations([
184
+ ...data.results
185
+ ]);
186
+ /**
187
+ * THIS IS CRUCIAL. If you don't sort by the __temp_key__ which comes from fractional indexing
188
+ * then the list will be in the wrong order.
189
+ */ return [
190
+ ...transformedRels,
191
+ ...field.value?.connect ?? []
192
+ ].sort((a, b)=>{
193
+ if (a.__temp_key__ < b.__temp_key__) return -1;
194
+ if (a.__temp_key__ > b.__temp_key__) return 1;
195
+ return 0;
196
+ });
197
+ }, [
198
+ data.results,
199
+ field.value,
200
+ // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.
201
+ props.attribute.targetModel,
202
+ props.mainField
203
+ ]);
204
+ const handleDisconnect = useHandleDisconnect(props.name, 'RelationsField');
205
+ const handleConnect = (relation)=>{
206
+ const [lastItemInList] = relations$1.slice(-1);
207
+ const item = {
208
+ id: relation.id,
209
+ apiData: {
210
+ id: relation.id,
211
+ documentId: relation.documentId,
212
+ locale: relation.locale
213
+ },
214
+ status: relation.status,
215
+ /**
216
+ * If there's a last item, that's the first key we use to generate out next one.
217
+ */ __temp_key__: fractionalIndexing.generateNKeysBetween(lastItemInList?.__temp_key__ ?? null, null, 1)[0],
218
+ // Fallback to `id` if there is no `mainField` value, which will overwrite the above `id` property with the exact same data.
219
+ [props.mainField?.name ?? 'documentId']: relation[props.mainField?.name ?? 'documentId'],
220
+ label: relations.getRelationLabel(relation, props.mainField),
221
+ // @ts-expect-error – targetModel does exist on the attribute, but it's not typed.
222
+ href: `../${index.COLLECTION_TYPES}/${props.attribute.targetModel}/${relation.documentId}?${relation.locale ? `plugins[i18n][locale]=${relation.locale}` : ''}`
223
+ };
224
+ if (ONE_WAY_RELATIONS.includes(props.attribute.relation)) {
225
+ // Remove any existing relation so they can be replaced with the new one
226
+ field.value?.connect?.forEach(handleDisconnect);
227
+ relations$1.forEach(handleDisconnect);
228
+ field.onChange(`${props.name}.connect`, [
229
+ item
230
+ ]);
231
+ } else {
232
+ field.onChange(`${props.name}.connect`, [
233
+ ...field.value?.connect ?? [],
234
+ item
235
+ ]);
236
+ }
237
+ };
238
+ return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
239
+ ref: ref,
240
+ direction: "column",
241
+ gap: 3,
242
+ justifyContent: "space-between",
243
+ alignItems: "stretch",
244
+ wrap: "wrap",
245
+ children: [
246
+ /*#__PURE__*/ jsxRuntime.jsxs(StyledFlex, {
247
+ direction: "column",
248
+ alignItems: "start",
249
+ gap: 2,
250
+ width: "100%",
251
+ children: [
252
+ /*#__PURE__*/ jsxRuntime.jsx(RelationsInput, {
253
+ disabled: isDisabled,
254
+ // NOTE: we should not default to using the documentId if the component is being created (componentUID is undefined)
255
+ id: componentUID ? componentId ? `${componentId}` : '' : documentId,
256
+ label: `${label} ${relationsCount > 0 ? `(${relationsCount})` : ''}`,
257
+ model: model,
258
+ onChange: handleConnect,
259
+ ...props
260
+ }),
261
+ 'pagination' in data && data.pagination && data.pagination.pageCount > data.pagination.page ? /*#__PURE__*/ jsxRuntime.jsx(designSystem.TextButton, {
262
+ disabled: isFetchingMoreRelations,
263
+ onClick: handleLoadMore,
264
+ loading: isFetchingMoreRelations,
265
+ startIcon: /*#__PURE__*/ jsxRuntime.jsx(Icons.ArrowClockwise, {}),
266
+ // prevent the label from line-wrapping
267
+ shrink: 0,
268
+ children: formatMessage({
269
+ id: index.getTranslation('relation.loadMore'),
270
+ defaultMessage: 'Load More'
271
+ })
272
+ }) : null
273
+ ]
274
+ }),
275
+ /*#__PURE__*/ jsxRuntime.jsx(UnstableRelationsList, {
276
+ data: relations$1,
277
+ serverData: data.results,
278
+ disabled: isDisabled,
279
+ name: props.name,
280
+ isLoading: isFetchingMoreRelations,
281
+ relationType: props.attribute.relation
282
+ })
283
+ ]
284
+ });
285
+ });
286
+ const RelationsField = /*#__PURE__*/ React__namespace.forwardRef(({ disabled, label, ...props }, ref)=>{
105
287
  const [currentPage, setCurrentPage] = React__namespace.useState(1);
106
288
  const { document, model: documentModel } = index.useDoc();
107
289
  const documentId = document?.documentId;
@@ -488,6 +670,179 @@ const ONE_WAY_RELATIONS = [
488
670
  * RelationsList
489
671
  * -----------------------------------------------------------------------------------------------*/ const RELATION_ITEM_HEIGHT = 50;
490
672
  const RELATION_GUTTER = 4;
673
+ const UnstableRelationsList = ({ data, serverData, disabled, name, isLoading, relationType })=>{
674
+ const ariaDescriptionId = React__namespace.useId();
675
+ const { formatMessage } = reactIntl.useIntl();
676
+ const listRef = React__namespace.useRef(null);
677
+ const outerListRef = React__namespace.useRef(null);
678
+ const [overflow, setOverflow] = React__namespace.useState();
679
+ const [liveText, setLiveText] = React__namespace.useState('');
680
+ const field = strapiAdmin.useField(name);
681
+ React__namespace.useEffect(()=>{
682
+ if (data.length <= RELATIONS_TO_DISPLAY) {
683
+ return setOverflow(undefined);
684
+ }
685
+ const handleNativeScroll = (e)=>{
686
+ const el = e.target;
687
+ const parentScrollContainerHeight = el.parentNode.scrollHeight;
688
+ const maxScrollBottom = el.scrollHeight - el.scrollTop;
689
+ if (el.scrollTop === 0) {
690
+ return setOverflow('bottom');
691
+ }
692
+ if (maxScrollBottom === parentScrollContainerHeight) {
693
+ return setOverflow('top');
694
+ }
695
+ return setOverflow('top-bottom');
696
+ };
697
+ const outerListRefCurrent = outerListRef?.current;
698
+ if (!isLoading && data.length > 0 && outerListRefCurrent) {
699
+ outerListRef.current.addEventListener('scroll', handleNativeScroll);
700
+ }
701
+ return ()=>{
702
+ if (outerListRefCurrent) {
703
+ outerListRefCurrent.removeEventListener('scroll', handleNativeScroll);
704
+ }
705
+ };
706
+ }, [
707
+ isLoading,
708
+ data.length
709
+ ]);
710
+ const getItemPos = (index)=>`${index + 1} of ${data.length}`;
711
+ const handleMoveItem = (newIndex, oldIndex)=>{
712
+ const item = data[oldIndex];
713
+ setLiveText(formatMessage({
714
+ id: index.getTranslation('dnd.reorder'),
715
+ defaultMessage: '{item}, moved. New position in list: {position}.'
716
+ }, {
717
+ item: item.label ?? item.documentId,
718
+ position: getItemPos(newIndex)
719
+ }));
720
+ /**
721
+ * Splicing mutates the array, so we need to create a new array
722
+ */ const newData = [
723
+ ...data
724
+ ];
725
+ const currentRow = data[oldIndex];
726
+ const startKey = oldIndex > newIndex ? newData[newIndex - 1]?.__temp_key__ : newData[newIndex]?.__temp_key__;
727
+ const endKey = oldIndex > newIndex ? newData[newIndex]?.__temp_key__ : newData[newIndex + 1]?.__temp_key__;
728
+ /**
729
+ * We're moving the relation between two other relations, so
730
+ * we need to generate a new key that keeps the order
731
+ */ const [newKey] = fractionalIndexing.generateNKeysBetween(startKey, endKey, 1);
732
+ newData.splice(oldIndex, 1);
733
+ newData.splice(newIndex, 0, {
734
+ ...currentRow,
735
+ __temp_key__: newKey
736
+ });
737
+ /**
738
+ * Now we diff against the server to understand what's different so we
739
+ * can keep the connect array nice and tidy. It also needs reversing because
740
+ * we reverse the relations from the server in the first place.
741
+ */ const connectedRelations = newData.reduce((acc, relation, currentIndex, array)=>{
742
+ const relationOnServer = serverData.find((oldRelation)=>oldRelation.id === relation.id);
743
+ const relationInFront = array[currentIndex + 1];
744
+ if (!relationOnServer || relationOnServer.__temp_key__ !== relation.__temp_key__) {
745
+ const position = relationInFront ? {
746
+ before: relationInFront.documentId,
747
+ locale: relationInFront.locale,
748
+ status: 'publishedAt' in relationInFront && relationInFront.publishedAt ? 'published' : 'draft'
749
+ } : {
750
+ end: true
751
+ };
752
+ const relationWithPosition = {
753
+ ...relation,
754
+ ...{
755
+ apiData: {
756
+ id: relation.id,
757
+ documentId: relation.documentId,
758
+ locale: relation.locale,
759
+ position
760
+ }
761
+ }
762
+ };
763
+ return [
764
+ ...acc,
765
+ relationWithPosition
766
+ ];
767
+ }
768
+ return acc;
769
+ }, []).toReversed();
770
+ field.onChange(`${name}.connect`, connectedRelations);
771
+ };
772
+ const handleGrabItem = (index$1)=>{
773
+ const item = data[index$1];
774
+ setLiveText(formatMessage({
775
+ id: index.getTranslation('dnd.grab-item'),
776
+ defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`
777
+ }, {
778
+ item: item.label ?? item.documentId,
779
+ position: getItemPos(index$1)
780
+ }));
781
+ };
782
+ const handleDropItem = (index$1)=>{
783
+ const { href: _href, label, ...item } = data[index$1];
784
+ setLiveText(formatMessage({
785
+ id: index.getTranslation('dnd.drop-item'),
786
+ defaultMessage: `{item}, dropped. Final position in list: {position}.`
787
+ }, {
788
+ item: label ?? item.documentId,
789
+ position: getItemPos(index$1)
790
+ }));
791
+ };
792
+ const handleCancel = (index$1)=>{
793
+ const item = data[index$1];
794
+ setLiveText(formatMessage({
795
+ id: index.getTranslation('dnd.cancel-item'),
796
+ defaultMessage: '{item}, dropped. Re-order cancelled.'
797
+ }, {
798
+ item: item.label ?? item.documentId
799
+ }));
800
+ };
801
+ const handleDisconnect = useHandleDisconnect(name, 'RelationsList');
802
+ /**
803
+ * These relation types will only ever have one item
804
+ * in their list, so you can't reorder a single item!
805
+ */ const canReorder = !ONE_WAY_RELATIONS.includes(relationType);
806
+ const dynamicListHeight = data.length > RELATIONS_TO_DISPLAY ? Math.min(data.length, RELATIONS_TO_DISPLAY) * (RELATION_ITEM_HEIGHT + RELATION_GUTTER) + RELATION_ITEM_HEIGHT / 2 : Math.min(data.length, RELATIONS_TO_DISPLAY) * (RELATION_ITEM_HEIGHT + RELATION_GUTTER);
807
+ return /*#__PURE__*/ jsxRuntime.jsxs(ShadowBox, {
808
+ $overflowDirection: overflow,
809
+ children: [
810
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.VisuallyHidden, {
811
+ id: ariaDescriptionId,
812
+ children: formatMessage({
813
+ id: index.getTranslation('dnd.instructions'),
814
+ defaultMessage: `Press spacebar to grab and re-order`
815
+ })
816
+ }),
817
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.VisuallyHidden, {
818
+ "aria-live": "assertive",
819
+ children: liveText
820
+ }),
821
+ /*#__PURE__*/ jsxRuntime.jsx(reactWindow.FixedSizeList, {
822
+ height: dynamicListHeight,
823
+ ref: listRef,
824
+ outerRef: outerListRef,
825
+ itemCount: data.length,
826
+ itemSize: RELATION_ITEM_HEIGHT + RELATION_GUTTER,
827
+ itemData: {
828
+ ariaDescribedBy: ariaDescriptionId,
829
+ canDrag: canReorder,
830
+ disabled,
831
+ handleCancel,
832
+ handleDropItem,
833
+ handleGrabItem,
834
+ handleMoveItem,
835
+ name,
836
+ handleDisconnect,
837
+ relations: data
838
+ },
839
+ itemKey: (index)=>data[index].id,
840
+ innerElementType: "ol",
841
+ children: UnstableListItem
842
+ })
843
+ ]
844
+ });
845
+ };
491
846
  const RelationsList = ({ data, serverData, disabled, name, isLoading, relationType })=>{
492
847
  const ariaDescriptionId = React__namespace.useId();
493
848
  const { formatMessage } = reactIntl.useIntl();
@@ -692,6 +1047,114 @@ const ShadowBox = styledComponents.styled(designSystem.Box)`
692
1047
  transition: opacity 0.2s ease-in-out;
693
1048
  }
694
1049
  `;
1050
+ const CustomTextButton = styledComponents.styled(designSystem.TextButton)`
1051
+ & > span {
1052
+ font-size: ${({ theme })=>theme.fontSizes[2]};
1053
+ }
1054
+ `;
1055
+ const UnstableListItem = ({ data, index: index$1, style })=>{
1056
+ const { ariaDescribedBy, canDrag = false, disabled = false, handleCancel, handleDisconnect, handleDropItem, handleGrabItem, handleMoveItem, name, relations } = data;
1057
+ const { formatMessage } = reactIntl.useIntl();
1058
+ const { id, label, status } = relations[index$1];
1059
+ const [{ handlerId, isDragging, handleKeyDown }, relationRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop.useDragAndDrop(canDrag && !disabled, {
1060
+ type: `${useDragAndDrop.ItemTypes.RELATION}_${name}`,
1061
+ index: index$1,
1062
+ item: {
1063
+ displayedValue: label,
1064
+ status,
1065
+ id: id,
1066
+ index: index$1
1067
+ },
1068
+ onMoveItem: handleMoveItem,
1069
+ onDropItem: handleDropItem,
1070
+ onGrabItem: handleGrabItem,
1071
+ onCancel: handleCancel,
1072
+ dropSensitivity: useDragAndDrop.DROP_SENSITIVITY.REGULAR
1073
+ });
1074
+ const composedRefs = designSystem.useComposedRefs(relationRef, dragRef);
1075
+ React__namespace.useEffect(()=>{
1076
+ dragPreviewRef(reactDndHtml5Backend.getEmptyImage());
1077
+ }, [
1078
+ dragPreviewRef
1079
+ ]);
1080
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
1081
+ style: style,
1082
+ tag: "li",
1083
+ ref: dropRef,
1084
+ "aria-describedby": ariaDescribedBy,
1085
+ cursor: canDrag ? 'all-scroll' : 'default',
1086
+ children: isDragging ? /*#__PURE__*/ jsxRuntime.jsx(RelationItemPlaceholder, {}) : /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
1087
+ paddingTop: 2,
1088
+ paddingBottom: 2,
1089
+ paddingLeft: canDrag ? 2 : 4,
1090
+ paddingRight: 4,
1091
+ hasRadius: true,
1092
+ borderColor: "neutral200",
1093
+ background: disabled ? 'neutral150' : 'neutral0',
1094
+ justifyContent: "space-between",
1095
+ ref: composedRefs,
1096
+ "data-handler-id": handlerId,
1097
+ children: [
1098
+ /*#__PURE__*/ jsxRuntime.jsxs(FlexWrapper, {
1099
+ gap: 1,
1100
+ children: [
1101
+ canDrag ? /*#__PURE__*/ jsxRuntime.jsx(designSystem.IconButton, {
1102
+ tag: "div",
1103
+ role: "button",
1104
+ tabIndex: 0,
1105
+ withTooltip: false,
1106
+ label: formatMessage({
1107
+ id: index.getTranslation('components.RelationInput.icon-button-aria-label'),
1108
+ defaultMessage: 'Drag'
1109
+ }),
1110
+ variant: "ghost",
1111
+ onKeyDown: handleKeyDown,
1112
+ disabled: disabled,
1113
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.Drag, {})
1114
+ }) : null,
1115
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
1116
+ width: "100%",
1117
+ minWidth: 0,
1118
+ justifyContent: "space-between",
1119
+ children: [
1120
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
1121
+ minWidth: 0,
1122
+ paddingTop: 1,
1123
+ paddingBottom: 1,
1124
+ paddingRight: 4,
1125
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tooltip, {
1126
+ description: label,
1127
+ children: /*#__PURE__*/ jsxRuntime.jsx(CustomTextButton, {
1128
+ onClick: ()=>console.log('OPEN MODAL'),
1129
+ children: label
1130
+ })
1131
+ })
1132
+ }),
1133
+ status ? /*#__PURE__*/ jsxRuntime.jsx(index.DocumentStatus, {
1134
+ status: status
1135
+ }) : null
1136
+ ]
1137
+ })
1138
+ ]
1139
+ }),
1140
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
1141
+ paddingLeft: 4,
1142
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.IconButton, {
1143
+ onClick: ()=>handleDisconnect(relations[index$1]),
1144
+ disabled: disabled,
1145
+ label: formatMessage({
1146
+ id: index.getTranslation('relation.disconnect'),
1147
+ defaultMessage: 'Remove'
1148
+ }),
1149
+ variant: "ghost",
1150
+ size: "S",
1151
+ children: /*#__PURE__*/ jsxRuntime.jsx(Icons.Cross, {})
1152
+ })
1153
+ })
1154
+ ]
1155
+ })
1156
+ });
1157
+ };
695
1158
  const ListItem = ({ data, index: index$1, style })=>{
696
1159
  const { ariaDescribedBy, canDrag = false, disabled = false, handleCancel, handleDisconnect, handleDropItem, handleGrabItem, handleMoveItem, name, relations } = data;
697
1160
  const { formatMessage } = reactIntl.useIntl();
@@ -843,11 +1306,13 @@ const RelationItemPlaceholder = ()=>/*#__PURE__*/ jsxRuntime.jsx(designSystem.Bo
843
1306
  height: `calc(100% - ${RELATION_GUTTER}px)`
844
1307
  });
845
1308
  const MemoizedRelationsField = /*#__PURE__*/ React__namespace.memo(RelationsField);
1309
+ const MemoizedUnstableRelationsField = /*#__PURE__*/ React__namespace.memo(UnstableRelationsField);
846
1310
 
847
1311
  exports.ComponentProvider = ComponentProvider;
848
1312
  exports.DisconnectButton = DisconnectButton;
849
1313
  exports.FlexWrapper = FlexWrapper;
850
1314
  exports.LinkEllipsis = LinkEllipsis;
851
1315
  exports.MemoizedRelationsField = MemoizedRelationsField;
1316
+ exports.MemoizedUnstableRelationsField = MemoizedUnstableRelationsField;
852
1317
  exports.useComponent = useComponent;
853
- //# sourceMappingURL=Relations-XHxDKEvT.js.map
1318
+ //# sourceMappingURL=Relations-PF93YcFV.js.map