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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (236) 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-DXwOtpq1.js → ComponentConfigurationPage-CGn9IYeg.js} +6 -6
  4. package/dist/admin/chunks/{ComponentConfigurationPage-DXwOtpq1.js.map → ComponentConfigurationPage-CGn9IYeg.js.map} +1 -1
  5. package/dist/admin/chunks/{ComponentConfigurationPage-DhYZp4nN.js → ComponentConfigurationPage-DgYK4xW6.mjs} +9 -9
  6. package/dist/admin/chunks/ComponentConfigurationPage-DgYK4xW6.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-D0Ng758X.js → EditConfigurationPage-7w_-4jF4.js} +6 -6
  10. package/dist/admin/chunks/{EditConfigurationPage-D0Ng758X.js.map → EditConfigurationPage-7w_-4jF4.js.map} +1 -1
  11. package/dist/admin/chunks/{EditConfigurationPage-DDuPch5d.js → EditConfigurationPage-C05SwwH-.mjs} +9 -9
  12. package/dist/admin/chunks/EditConfigurationPage-C05SwwH-.mjs.map +1 -0
  13. package/dist/admin/chunks/EditViewPage-CVRJBOEv.mjs +318 -0
  14. package/dist/admin/chunks/EditViewPage-CVRJBOEv.mjs.map +1 -0
  15. package/dist/admin/chunks/EditViewPage-CuQfZJDf.js +341 -0
  16. package/dist/admin/chunks/EditViewPage-CuQfZJDf.js.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-BEqiuSvQ.js → Form-BqNYRsCb.js} +5 -5
  20. package/dist/admin/chunks/{Form-BEqiuSvQ.js.map → Form-BqNYRsCb.js.map} +1 -1
  21. package/dist/admin/chunks/{Form-CZmB6JIg.js → Form-DaEnqAeV.mjs} +5 -5
  22. package/dist/admin/chunks/Form-DaEnqAeV.mjs.map +1 -0
  23. package/dist/admin/chunks/{History-CPYXgxkS.js → History-B7dGNfmx.mjs} +68 -15
  24. package/dist/admin/chunks/History-B7dGNfmx.mjs.map +1 -0
  25. package/dist/admin/chunks/{History-BlLKDZSw.js → History-CEoOna4w.js} +67 -14
  26. package/dist/admin/chunks/History-CEoOna4w.js.map +1 -0
  27. package/dist/admin/chunks/{Input-CLX3C5DI.js → Input-B3QUS9rv.mjs} +2273 -511
  28. package/dist/admin/chunks/Input-B3QUS9rv.mjs.map +1 -0
  29. package/dist/admin/chunks/{Input-DiR2Xfa7.js → Input-B8I0b9aD.js} +2284 -519
  30. package/dist/admin/chunks/Input-B8I0b9aD.js.map +1 -0
  31. package/dist/admin/chunks/{ListConfigurationPage-DdTp-HxB.js → ListConfigurationPage-BbjJweN-.js} +7 -7
  32. package/dist/admin/chunks/{ListConfigurationPage-DdTp-HxB.js.map → ListConfigurationPage-BbjJweN-.js.map} +1 -1
  33. package/dist/admin/chunks/{ListConfigurationPage-CNvotSqe.js → ListConfigurationPage-VtFQ5mOK.mjs} +8 -8
  34. package/dist/admin/chunks/ListConfigurationPage-VtFQ5mOK.mjs.map +1 -0
  35. package/dist/admin/chunks/{ListViewPage-MJNfQTp-.js → ListViewPage-Cg3zbT7Y.mjs} +5 -5
  36. package/dist/admin/chunks/ListViewPage-Cg3zbT7Y.mjs.map +1 -0
  37. package/dist/admin/chunks/{ListViewPage-BtXYjEYz.js → ListViewPage-CzUm2VJN.js} +8 -8
  38. package/dist/admin/chunks/{ListViewPage-BtXYjEYz.js.map → ListViewPage-CzUm2VJN.js.map} +1 -1
  39. package/dist/admin/chunks/{NoContentTypePage-CVvVpwj4.js → NoContentTypePage-FcLLn2Wt.js} +3 -2
  40. package/dist/admin/chunks/{NoContentTypePage-BJrZvYPY.js.map → NoContentTypePage-FcLLn2Wt.js.map} +1 -1
  41. package/dist/admin/chunks/{NoContentTypePage-BJrZvYPY.js → NoContentTypePage-NOf7Aq_E.mjs} +3 -2
  42. package/dist/admin/chunks/NoContentTypePage-NOf7Aq_E.mjs.map +1 -0
  43. package/dist/admin/chunks/{NoPermissionsPage-C5yWg70d.js → NoPermissionsPage-DmeyXtCk.js} +3 -2
  44. package/dist/admin/chunks/{NoPermissionsPage-BulvG4hB.js.map → NoPermissionsPage-DmeyXtCk.js.map} +1 -1
  45. package/dist/admin/chunks/{NoPermissionsPage-BulvG4hB.js → NoPermissionsPage-OVr9KG6L.mjs} +3 -2
  46. package/dist/admin/chunks/NoPermissionsPage-OVr9KG6L.mjs.map +1 -0
  47. package/dist/admin/chunks/Preview-BH9l1QXk.mjs +593 -0
  48. package/dist/admin/chunks/Preview-BH9l1QXk.mjs.map +1 -0
  49. package/dist/admin/chunks/Preview-BYKkpc11.js +615 -0
  50. package/dist/admin/chunks/Preview-BYKkpc11.js.map +1 -0
  51. package/dist/admin/chunks/{ar-DckYq_WK.js → ar-DckYq_WK.mjs} +1 -1
  52. package/dist/admin/chunks/ar-DckYq_WK.mjs.map +1 -0
  53. package/dist/admin/chunks/{ca-DviY7mRj.js → ca-DviY7mRj.mjs} +1 -1
  54. package/dist/admin/chunks/ca-DviY7mRj.mjs.map +1 -0
  55. package/dist/admin/chunks/{cs-C7OSYFQ7.js → cs-C7OSYFQ7.mjs} +1 -1
  56. package/dist/admin/chunks/cs-C7OSYFQ7.mjs.map +1 -0
  57. package/dist/admin/chunks/{de-5QRlDHyR.js → de-5QRlDHyR.mjs} +1 -1
  58. package/dist/admin/chunks/de-5QRlDHyR.mjs.map +1 -0
  59. package/dist/admin/chunks/{en-LfhocNG2.js → en-C2zEwS3-.mjs} +6 -1
  60. package/dist/admin/chunks/en-C2zEwS3-.mjs.map +1 -0
  61. package/dist/admin/chunks/{en-C1CjdAtC.js → en-G976DLsg.js} +6 -1
  62. package/dist/admin/chunks/{en-LfhocNG2.js.map → en-G976DLsg.js.map} +1 -1
  63. package/dist/admin/chunks/{es-DkoWSExG.js → es-DkoWSExG.mjs} +1 -1
  64. package/dist/admin/chunks/es-DkoWSExG.mjs.map +1 -0
  65. package/dist/admin/chunks/{eu-BG1xX7HK.js → eu-BG1xX7HK.mjs} +1 -1
  66. package/dist/admin/chunks/eu-BG1xX7HK.mjs.map +1 -0
  67. package/dist/admin/chunks/{fr-CFdRaRVj.js → fr-CFdRaRVj.mjs} +1 -1
  68. package/dist/admin/chunks/fr-CFdRaRVj.mjs.map +1 -0
  69. package/dist/admin/chunks/{gu-D5MMMXRs.js → gu-D5MMMXRs.mjs} +1 -1
  70. package/dist/admin/chunks/gu-D5MMMXRs.mjs.map +1 -0
  71. package/dist/admin/chunks/{hi-lp17SCjr.js → hi-lp17SCjr.mjs} +1 -1
  72. package/dist/admin/chunks/hi-lp17SCjr.mjs.map +1 -0
  73. package/dist/admin/chunks/{hooks-DMvik5y_.js → hooks-DMvik5y_.mjs} +1 -1
  74. package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +1 -0
  75. package/dist/admin/chunks/{hu-CLka1U2C.js → hu-CLka1U2C.mjs} +1 -1
  76. package/dist/admin/chunks/hu-CLka1U2C.mjs.map +1 -0
  77. package/dist/admin/chunks/{id-USfY9m1g.js → id-USfY9m1g.mjs} +1 -1
  78. package/dist/admin/chunks/id-USfY9m1g.mjs.map +1 -0
  79. package/dist/admin/chunks/{index-BRlRBRLb.js → index-BE7PI9Wp.mjs} +273 -173
  80. package/dist/admin/chunks/index-BE7PI9Wp.mjs.map +1 -0
  81. package/dist/admin/chunks/{index-ZIwOPk6p.js → index-BwIhYBsG.js} +246 -142
  82. package/dist/admin/chunks/index-BwIhYBsG.js.map +1 -0
  83. package/dist/admin/chunks/{it-BAHrwmYS.js → it-BAHrwmYS.mjs} +1 -1
  84. package/dist/admin/chunks/it-BAHrwmYS.mjs.map +1 -0
  85. package/dist/admin/chunks/{ja-BWKmBJFT.js → ja-BWKmBJFT.mjs} +1 -1
  86. package/dist/admin/chunks/ja-BWKmBJFT.mjs.map +1 -0
  87. package/dist/admin/chunks/{ko-CgADGBNt.js → ko-CgADGBNt.mjs} +1 -1
  88. package/dist/admin/chunks/ko-CgADGBNt.mjs.map +1 -0
  89. package/dist/admin/chunks/{layout-B3-guCPG.js → layout-9zlUM9V3.mjs} +81 -7
  90. package/dist/admin/chunks/layout-9zlUM9V3.mjs.map +1 -0
  91. package/dist/admin/chunks/{layout-ameRNiAM.js → layout-Cr0HaJVS.js} +87 -13
  92. package/dist/admin/chunks/layout-Cr0HaJVS.js.map +1 -0
  93. package/dist/admin/chunks/{ml-CnhCfOn_.js → ml-CnhCfOn_.mjs} +1 -1
  94. package/dist/admin/chunks/ml-CnhCfOn_.mjs.map +1 -0
  95. package/dist/admin/chunks/{ms-Bh09NFff.js → ms-Bh09NFff.mjs} +1 -1
  96. package/dist/admin/chunks/ms-Bh09NFff.mjs.map +1 -0
  97. package/dist/admin/chunks/{nl-C8HYflTc.js → nl-C8HYflTc.mjs} +1 -1
  98. package/dist/admin/chunks/nl-C8HYflTc.mjs.map +1 -0
  99. package/dist/admin/chunks/{useDragAndDrop-gcqEJMnO.js → objects-BJTP843m.js} +73 -1
  100. package/dist/admin/chunks/objects-BJTP843m.js.map +1 -0
  101. package/dist/admin/chunks/{useDragAndDrop-HYwNDExe.js → objects-D2z-IJgu.mjs} +72 -2
  102. package/dist/admin/chunks/objects-D2z-IJgu.mjs.map +1 -0
  103. package/dist/admin/chunks/{pl-MFCZJZuZ.js → pl-MFCZJZuZ.mjs} +1 -1
  104. package/dist/admin/chunks/pl-MFCZJZuZ.mjs.map +1 -0
  105. package/dist/admin/chunks/{pt-BR-CcotyBGJ.js → pt-BR-CcotyBGJ.mjs} +1 -1
  106. package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs.map +1 -0
  107. package/dist/admin/chunks/{pt-HbmgeiYO.js → pt-HbmgeiYO.mjs} +1 -1
  108. package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +1 -0
  109. package/dist/admin/chunks/{ru-CB4BUyQp.js → ru-CB4BUyQp.mjs} +1 -1
  110. package/dist/admin/chunks/{ru-CB4BUyQp.js.map → ru-CB4BUyQp.mjs.map} +1 -1
  111. package/dist/admin/chunks/{sa-n_aPA-pU.js → sa-n_aPA-pU.mjs} +1 -1
  112. package/dist/admin/chunks/sa-n_aPA-pU.mjs.map +1 -0
  113. package/dist/admin/chunks/{sk-tn_BDjE2.js → sk-tn_BDjE2.mjs} +1 -1
  114. package/dist/admin/chunks/sk-tn_BDjE2.mjs.map +1 -0
  115. package/dist/admin/chunks/{sv-cq4ZrQRd.js → sv-cq4ZrQRd.mjs} +1 -1
  116. package/dist/admin/chunks/sv-cq4ZrQRd.mjs.map +1 -0
  117. package/dist/admin/chunks/{th-mUH7hEtc.js → th-mUH7hEtc.mjs} +1 -1
  118. package/dist/admin/chunks/th-mUH7hEtc.mjs.map +1 -0
  119. package/dist/admin/chunks/{tr-Yt38daxh.js → tr-Yt38daxh.mjs} +1 -1
  120. package/dist/admin/chunks/tr-Yt38daxh.mjs.map +1 -0
  121. package/dist/admin/chunks/uk-BtM6WnaE.mjs +313 -0
  122. package/dist/admin/chunks/uk-BtM6WnaE.mjs.map +1 -0
  123. package/dist/admin/chunks/uk-DB6OgySY.js +318 -0
  124. package/dist/admin/chunks/{en-C1CjdAtC.js.map → uk-DB6OgySY.js.map} +1 -1
  125. package/dist/admin/chunks/{relations-CmoFVrKj.js → usePrev-DgZBp9Oo.js} +18 -2
  126. package/dist/admin/chunks/usePrev-DgZBp9Oo.js.map +1 -0
  127. package/dist/admin/chunks/{relations-DYQAaXwZ.js → usePrev-PisKKvhT.mjs} +18 -4
  128. package/dist/admin/chunks/usePrev-PisKKvhT.mjs.map +1 -0
  129. package/dist/admin/chunks/{vi-CvBGlTjr.js → vi-CvBGlTjr.mjs} +1 -1
  130. package/dist/admin/chunks/vi-CvBGlTjr.mjs.map +1 -0
  131. package/dist/admin/chunks/{zh-BmF-sHaT.js → zh-BmF-sHaT.mjs} +1 -1
  132. package/dist/admin/chunks/zh-BmF-sHaT.mjs.map +1 -0
  133. package/dist/admin/chunks/{zh-Hans-CI0HKio3.js → zh-Hans-CI0HKio3.mjs} +1 -1
  134. package/dist/admin/chunks/{zh-Hans-CI0HKio3.js.map → zh-Hans-CI0HKio3.mjs.map} +1 -1
  135. package/dist/admin/index.js +2 -1
  136. package/dist/admin/index.js.map +1 -1
  137. package/dist/admin/index.mjs +2 -1
  138. package/dist/admin/index.mjs.map +1 -1
  139. package/dist/admin/src/components/InjectionZone.d.ts +7 -1
  140. package/dist/admin/src/content-manager.d.ts +4 -0
  141. package/dist/admin/src/features/DocumentContext.d.ts +53 -0
  142. package/dist/admin/src/features/DocumentRBAC.d.ts +3 -2
  143. package/dist/admin/src/hooks/useDocument.d.ts +2 -0
  144. package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -0
  145. package/dist/admin/src/index.d.ts +1 -0
  146. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +2 -1
  147. package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
  148. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +49 -0
  149. package/dist/admin/src/pages/EditView/components/FormInputs/Relations/RelationModal.d.ts +8 -0
  150. package/dist/admin/src/pages/EditView/components/FormInputs/{Relations.d.ts → Relations/Relations.d.ts} +8 -2
  151. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +1 -2
  152. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +9 -3
  153. package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +7 -4
  154. package/dist/admin/src/preview/components/PreviewHeader.d.ts +1 -2
  155. package/dist/admin/src/preview/pages/Preview.d.ts +2 -0
  156. package/dist/server/index.js +1 -1
  157. package/dist/server/index.js.map +1 -1
  158. package/dist/server/index.mjs +1 -1
  159. package/dist/server/index.mjs.map +1 -1
  160. package/package.json +8 -8
  161. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.map +0 -1
  162. package/dist/admin/chunks/ComponentConfigurationPage-DhYZp4nN.js.map +0 -1
  163. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.map +0 -1
  164. package/dist/admin/chunks/EditConfigurationPage-DDuPch5d.js.map +0 -1
  165. package/dist/admin/chunks/EditViewPage-jCZnUuCR.js +0 -265
  166. package/dist/admin/chunks/EditViewPage-jCZnUuCR.js.map +0 -1
  167. package/dist/admin/chunks/EditViewPage-zSnDwLz3.js +0 -288
  168. package/dist/admin/chunks/EditViewPage-zSnDwLz3.js.map +0 -1
  169. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.map +0 -1
  170. package/dist/admin/chunks/Form-CZmB6JIg.js.map +0 -1
  171. package/dist/admin/chunks/History-BlLKDZSw.js.map +0 -1
  172. package/dist/admin/chunks/History-CPYXgxkS.js.map +0 -1
  173. package/dist/admin/chunks/Input-CLX3C5DI.js.map +0 -1
  174. package/dist/admin/chunks/Input-DiR2Xfa7.js.map +0 -1
  175. package/dist/admin/chunks/ListConfigurationPage-CNvotSqe.js.map +0 -1
  176. package/dist/admin/chunks/ListViewPage-MJNfQTp-.js.map +0 -1
  177. package/dist/admin/chunks/NoContentTypePage-CVvVpwj4.js.map +0 -1
  178. package/dist/admin/chunks/NoPermissionsPage-C5yWg70d.js.map +0 -1
  179. package/dist/admin/chunks/Preview-DEuQgQg2.js +0 -482
  180. package/dist/admin/chunks/Preview-DEuQgQg2.js.map +0 -1
  181. package/dist/admin/chunks/Preview-H74FQ9Cq.js +0 -504
  182. package/dist/admin/chunks/Preview-H74FQ9Cq.js.map +0 -1
  183. package/dist/admin/chunks/Relations-C8jbZPVK.js +0 -827
  184. package/dist/admin/chunks/Relations-C8jbZPVK.js.map +0 -1
  185. package/dist/admin/chunks/Relations-mxOUS7TJ.js +0 -853
  186. package/dist/admin/chunks/Relations-mxOUS7TJ.js.map +0 -1
  187. package/dist/admin/chunks/ar-DckYq_WK.js.map +0 -1
  188. package/dist/admin/chunks/ca-DviY7mRj.js.map +0 -1
  189. package/dist/admin/chunks/cs-C7OSYFQ7.js.map +0 -1
  190. package/dist/admin/chunks/de-5QRlDHyR.js.map +0 -1
  191. package/dist/admin/chunks/es-DkoWSExG.js.map +0 -1
  192. package/dist/admin/chunks/eu-BG1xX7HK.js.map +0 -1
  193. package/dist/admin/chunks/fr-CFdRaRVj.js.map +0 -1
  194. package/dist/admin/chunks/gu-D5MMMXRs.js.map +0 -1
  195. package/dist/admin/chunks/hi-lp17SCjr.js.map +0 -1
  196. package/dist/admin/chunks/hooks-DMvik5y_.js.map +0 -1
  197. package/dist/admin/chunks/hu-CLka1U2C.js.map +0 -1
  198. package/dist/admin/chunks/id-USfY9m1g.js.map +0 -1
  199. package/dist/admin/chunks/index-BRlRBRLb.js.map +0 -1
  200. package/dist/admin/chunks/index-ZIwOPk6p.js.map +0 -1
  201. package/dist/admin/chunks/it-BAHrwmYS.js.map +0 -1
  202. package/dist/admin/chunks/ja-BWKmBJFT.js.map +0 -1
  203. package/dist/admin/chunks/ko-CgADGBNt.js.map +0 -1
  204. package/dist/admin/chunks/layout-B3-guCPG.js.map +0 -1
  205. package/dist/admin/chunks/layout-ameRNiAM.js.map +0 -1
  206. package/dist/admin/chunks/ml-CnhCfOn_.js.map +0 -1
  207. package/dist/admin/chunks/ms-Bh09NFff.js.map +0 -1
  208. package/dist/admin/chunks/nl-C8HYflTc.js.map +0 -1
  209. package/dist/admin/chunks/objects-C3EebVVe.js +0 -76
  210. package/dist/admin/chunks/objects-C3EebVVe.js.map +0 -1
  211. package/dist/admin/chunks/objects-wl73iEma.js +0 -73
  212. package/dist/admin/chunks/objects-wl73iEma.js.map +0 -1
  213. package/dist/admin/chunks/pl-MFCZJZuZ.js.map +0 -1
  214. package/dist/admin/chunks/pt-BR-CcotyBGJ.js.map +0 -1
  215. package/dist/admin/chunks/pt-HbmgeiYO.js.map +0 -1
  216. package/dist/admin/chunks/relations-CmoFVrKj.js.map +0 -1
  217. package/dist/admin/chunks/relations-DYQAaXwZ.js.map +0 -1
  218. package/dist/admin/chunks/sa-n_aPA-pU.js.map +0 -1
  219. package/dist/admin/chunks/sk-tn_BDjE2.js.map +0 -1
  220. package/dist/admin/chunks/sv-cq4ZrQRd.js.map +0 -1
  221. package/dist/admin/chunks/th-mUH7hEtc.js.map +0 -1
  222. package/dist/admin/chunks/tr-Yt38daxh.js.map +0 -1
  223. package/dist/admin/chunks/uk-B24MoTVg.js +0 -145
  224. package/dist/admin/chunks/uk-B24MoTVg.js.map +0 -1
  225. package/dist/admin/chunks/uk-Cpgmm7gE.js +0 -140
  226. package/dist/admin/chunks/uk-Cpgmm7gE.js.map +0 -1
  227. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.map +0 -1
  228. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +0 -1
  229. package/dist/admin/chunks/usePrev-Bjw2dhmq.js +0 -18
  230. package/dist/admin/chunks/usePrev-Bjw2dhmq.js.map +0 -1
  231. package/dist/admin/chunks/usePrev-DIYl-IAL.js +0 -21
  232. package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +0 -1
  233. package/dist/admin/chunks/vi-CvBGlTjr.js.map +0 -1
  234. package/dist/admin/chunks/zh-BmF-sHaT.js.map +0 -1
  235. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +0 -0
  236. package/dist/admin/src/preview/components/PreviewContent.d.ts +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input-B8I0b9aD.js","sources":["../../../admin/src/hooks/useLazyComponents.ts","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.ts","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/conversions.ts","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/enterKey.ts","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.tsx","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Heading.tsx","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Image.tsx","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/links.ts","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/types.ts","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Link.tsx","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/List.tsx","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Paragraph.tsx","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Quote.tsx","../../../admin/src/pages/EditView/components/EditorToolbarObserver.tsx","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksToolbar.tsx","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksContent.tsx","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.tsx","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Modifiers.tsx","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/plugins/withImages.ts","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/plugins/withLinks.ts","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/plugins/withStrapiSchema.ts","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.tsx","../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.tsx","../../../admin/src/pages/EditView/components/FormInputs/Component/Initializer.tsx","../../../admin/src/pages/EditView/components/FormInputs/ComponentContext.tsx","../../../admin/src/pages/EditView/components/FormInputs/DynamicZone/AddComponentButton.tsx","../../../admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.tsx","../../../admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentPicker.tsx","../../../admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.tsx","../../../admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicZoneLabel.tsx","../../../admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.tsx","../../../admin/src/pages/EditView/components/FormInputs/NotAllowed.tsx","../../../admin/src/pages/EditView/components/FormInputs/Relations/RelationModal.tsx","../../../admin/src/pages/EditView/components/FormInputs/Relations/Relations.tsx","../../../admin/src/services/uid.ts","../../../admin/src/pages/EditView/components/FormInputs/UID.tsx","../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/utils/mdRenderer.ts","../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.tsx","../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/utils/continueList.ts","../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/Editor.tsx","../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.tsx","../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/utils/utils.ts","../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.tsx","../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.tsx","../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.tsx","../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/Field.tsx","../../../admin/src/pages/EditView/components/InputRenderer.tsx","../../../admin/src/pages/EditView/components/FormLayout.tsx","../../../admin/src/pages/EditView/components/FormInputs/Component/NonRepeatable.tsx","../../../admin/src/pages/EditView/components/FormInputs/Component/Repeatable.tsx","../../../admin/src/pages/EditView/components/FormInputs/Component/Input.tsx"],"sourcesContent":["import { ComponentType, useCallback, useEffect, useState } from 'react';\n\nimport { StrapiAppContextValue, useStrapiApp } from '@strapi/admin/strapi-admin';\n\nconst componentStore = new Map<string, ComponentType | undefined>();\n\ntype LazyComponentStore = Record<string, ComponentType | undefined>;\n\ntype CustomField = NonNullable<ReturnType<StrapiAppContextValue['customFields']['get']>>;\n\ninterface UseLazyComponentsReturn {\n isLazyLoading: boolean;\n lazyComponentStore: LazyComponentStore;\n cleanup: () => void;\n}\n\n/**\n * @description A hook to lazy load custom field components\n */\nconst useLazyComponents = (componentUids: string[] = []): UseLazyComponentsReturn => {\n const [lazyComponentStore, setLazyComponentStore] = useState(Object.fromEntries(componentStore));\n /**\n * Start loading only if there are any components passed in\n * and there are some new to load\n */\n const newUids = componentUids.filter((uid) => !componentStore.get(uid));\n const [loading, setLoading] = useState(() => !!newUids.length);\n const getCustomField = useStrapiApp('useLazyComponents', (state) => state.customFields.get);\n\n useEffect(() => {\n const setStore = (store: Record<string, ComponentType | undefined>) => {\n setLazyComponentStore(store);\n setLoading(false);\n };\n\n const lazyLoadComponents = async (\n uids: string[],\n components: Array<ReturnType<CustomField['components']['Input']>>\n ) => {\n const modules = await Promise.all(components);\n\n uids.forEach((uid, index) => {\n componentStore.set(uid, modules[index].default);\n });\n\n setStore(Object.fromEntries(componentStore));\n };\n\n if (newUids.length > 0) {\n setLoading(true);\n\n const componentPromises = newUids.reduce<\n Array<ReturnType<CustomField['components']['Input']>>\n >((arrayOfPromises, uid) => {\n const customField = getCustomField(uid);\n\n if (customField) {\n arrayOfPromises.push(customField.components.Input());\n }\n\n return arrayOfPromises;\n }, []);\n\n if (componentPromises.length > 0) {\n lazyLoadComponents(newUids, componentPromises);\n }\n }\n }, [newUids, getCustomField]);\n\n /**\n * Wrap this in a callback so it can be used in\n * effects to cleanup the cached store if required\n */\n const cleanup = useCallback(() => {\n componentStore.clear();\n setLazyComponentStore({});\n }, []);\n\n return { isLazyLoading: loading, lazyComponentStore, cleanup };\n};\n\nexport { useLazyComponents };\nexport type { UseLazyComponentsReturn, LazyComponentStore };\n","export const codeLanguages: {\n value: string;\n label: string;\n decorate?: string;\n}[] = [\n {\n value: 'asm',\n label: 'Assembly',\n decorate: 'asmatmel',\n },\n {\n value: 'bash',\n label: 'Bash',\n },\n {\n value: 'c',\n label: 'C',\n },\n {\n value: 'clojure',\n label: 'Clojure',\n },\n {\n value: 'cobol',\n label: 'COBOL',\n },\n {\n value: 'cpp',\n label: 'C++',\n },\n {\n value: 'csharp',\n label: 'C#',\n },\n {\n value: 'css',\n label: 'CSS',\n },\n {\n value: 'dart',\n label: 'Dart',\n },\n {\n value: 'dockerfile',\n label: 'Dockerfile',\n decorate: 'docker',\n },\n {\n value: 'elixir',\n label: 'Elixir',\n },\n {\n value: 'erlang',\n label: 'Erlang',\n },\n {\n value: 'fortran',\n label: 'Fortran',\n },\n {\n value: 'fsharp',\n label: 'F#',\n },\n {\n value: 'go',\n label: 'Go',\n },\n {\n value: 'graphql',\n label: 'GraphQL',\n },\n {\n value: 'groovy',\n label: 'Groovy',\n },\n {\n value: 'haskell',\n label: 'Haskell',\n },\n {\n value: 'haxe',\n label: 'Haxe',\n },\n {\n value: 'html',\n label: 'HTML',\n },\n {\n value: 'ini',\n label: 'INI',\n },\n {\n value: 'java',\n label: 'Java',\n },\n {\n value: 'javascript',\n label: 'JavaScript',\n },\n {\n value: 'jsx',\n label: 'JavaScript (React)',\n },\n {\n value: 'json',\n label: 'JSON',\n },\n {\n value: 'julia',\n label: 'Julia',\n },\n {\n value: 'kotlin',\n label: 'Kotlin',\n },\n {\n value: 'latex',\n label: 'LaTeX',\n },\n {\n value: 'lua',\n label: 'Lua',\n },\n {\n value: 'markdown',\n label: 'Markdown',\n },\n {\n value: 'matlab',\n label: 'MATLAB',\n },\n {\n value: 'makefile',\n label: 'Makefile',\n },\n {\n value: 'objectivec',\n label: 'Objective-C',\n },\n {\n value: 'perl',\n label: 'Perl',\n },\n {\n value: 'php',\n label: 'PHP',\n },\n {\n value: 'plaintext',\n label: 'Plain text',\n },\n {\n value: 'powershell',\n label: 'PowerShell',\n },\n {\n value: 'python',\n label: 'Python',\n },\n {\n value: 'r',\n label: 'R',\n },\n {\n value: 'ruby',\n label: 'Ruby',\n },\n {\n value: 'rust',\n label: 'Rust',\n },\n {\n value: 'sas',\n label: 'SAS',\n },\n {\n value: 'scala',\n label: 'Scala',\n },\n {\n value: 'scheme',\n label: 'Scheme',\n },\n {\n value: 'shell',\n label: 'Shell',\n },\n {\n value: 'sql',\n label: 'SQL',\n },\n {\n value: 'stata',\n label: 'Stata',\n },\n {\n value: 'swift',\n label: 'Swift',\n },\n {\n value: 'typescript',\n label: 'TypeScript',\n decorate: 'ts',\n },\n {\n value: 'tsx',\n label: 'TypeScript (React)',\n },\n {\n value: 'vbnet',\n label: 'VB.NET',\n },\n {\n value: 'xml',\n label: 'XML',\n },\n {\n value: 'yaml',\n label: 'YAML',\n decorate: 'yml',\n },\n];\n","import { type Element, type Path, Editor, Transforms } from 'slate';\n\n/**\n * Extracts some logic that is common to most blocks' handleConvert functions.\n * @returns The path of the converted block\n */\nconst baseHandleConvert = <T extends Element>(\n editor: Editor,\n attributesToSet: Partial<T> & { type: T['type'] }\n): void | Path => {\n // If there is no selection, convert last inserted node\n const [_, lastNodePath] = Editor.last(editor, []);\n\n // If the selection is inside a list, split the list so that the modified block is outside of it\n Transforms.unwrapNodes(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n split: true,\n at: editor.selection ?? lastNodePath,\n });\n\n // Make sure we get a block node, not an inline node\n const [, updatedLastNodePath] = Editor.last(editor, []);\n const entry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type !== 'text' && node.type !== 'link',\n at: editor.selection ?? updatedLastNodePath,\n });\n\n if (!entry || Editor.isEditor(entry[0])) {\n return;\n }\n\n const [element, elementPath] = entry;\n\n Transforms.setNodes(\n editor,\n {\n ...getAttributesToClear(element),\n ...attributesToSet,\n } as Partial<Element>,\n { at: elementPath }\n );\n\n return elementPath;\n};\n\n/**\n * Set all attributes except type and children to null so that Slate deletes them\n */\nconst getAttributesToClear = (element: Element) => {\n const { children: _children, type: _type, ...extra } = element;\n\n const attributesToClear = Object.keys(extra).reduce(\n (currentAttributes, key) => ({ ...currentAttributes, [key]: null }),\n {}\n );\n\n return attributesToClear as Record<string, null>;\n};\n\nexport { baseHandleConvert, getAttributesToClear };\n","import { type Text, Editor, Node, Transforms } from 'slate';\n\nconst isText = (node: unknown): node is Text => {\n return Node.isNode(node) && !Editor.isEditor(node) && node.type === 'text';\n};\n\n/**\n * Inserts a line break the first time the user presses enter, and exits the node the second time.\n */\nconst pressEnterTwiceToExit = (editor: Editor) => {\n /**\n * To determine if we should break out of the node, check 2 things:\n * 1. If the cursor is at the end of the node\n * 2. If the last line of the node is empty\n */\n const nodeEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && !['link', 'text'].includes(node.type),\n });\n if (!nodeEntry || !editor.selection) {\n return;\n }\n const [node, nodePath] = nodeEntry;\n const isNodeEnd = Editor.isEnd(editor, editor.selection.anchor, nodePath);\n const lastTextNode = node.children.at(-1);\n const isEmptyLine = isText(lastTextNode) && lastTextNode.text.endsWith('\\n');\n\n if (isNodeEnd && isEmptyLine) {\n // Remove the last line break\n Transforms.delete(editor, { distance: 1, unit: 'character', reverse: true });\n // Break out of the node by creating a new paragraph\n Transforms.insertNodes(editor, {\n type: 'paragraph',\n children: [{ type: 'text', text: '' }],\n });\n return;\n }\n\n // Otherwise insert a new line within the node\n Transforms.insertText(editor, '\\n');\n\n // If there's nothing after the cursor, disable modifiers\n if (isNodeEnd) {\n ['bold', 'italic', 'underline', 'strikethrough', 'code'].forEach((modifier) => {\n Editor.removeMark(editor, modifier);\n });\n }\n};\n\nexport { pressEnterTwiceToExit };\n","import * as React from 'react';\n\nimport { Box, SingleSelect, SingleSelectOption } from '@strapi/design-system';\nimport { CodeBlock as CodeBlockIcon } from '@strapi/icons';\nimport * as Prism from 'prismjs';\nimport { useIntl } from 'react-intl';\nimport { BaseRange, Element, Editor, Node, NodeEntry, Transforms } from 'slate';\nimport { useSelected, type RenderElementProps, useFocused, ReactEditor } from 'slate-react';\nimport { styled } from 'styled-components';\n\nimport { useBlocksEditorContext, type BlocksStore } from '../BlocksEditor';\nimport { codeLanguages } from '../utils/constants';\nimport { baseHandleConvert } from '../utils/conversions';\nimport { pressEnterTwiceToExit } from '../utils/enterKey';\nimport { type Block } from '../utils/types';\n\nimport 'prismjs/themes/prism-solarizedlight.css';\nimport 'prismjs/components/prism-asmatmel';\nimport 'prismjs/components/prism-bash';\nimport 'prismjs/components/prism-basic';\nimport 'prismjs/components/prism-c';\nimport 'prismjs/components/prism-clojure';\nimport 'prismjs/components/prism-cobol';\nimport 'prismjs/components/prism-cpp';\nimport 'prismjs/components/prism-csharp';\nimport 'prismjs/components/prism-dart';\nimport 'prismjs/components/prism-docker';\nimport 'prismjs/components/prism-elixir';\nimport 'prismjs/components/prism-erlang';\nimport 'prismjs/components/prism-fortran';\nimport 'prismjs/components/prism-fsharp';\nimport 'prismjs/components/prism-go';\nimport 'prismjs/components/prism-graphql';\nimport 'prismjs/components/prism-groovy';\nimport 'prismjs/components/prism-haskell';\nimport 'prismjs/components/prism-haxe';\nimport 'prismjs/components/prism-ini';\nimport 'prismjs/components/prism-java';\nimport 'prismjs/components/prism-javascript';\nimport 'prismjs/components/prism-jsx';\nimport 'prismjs/components/prism-json';\nimport 'prismjs/components/prism-julia';\nimport 'prismjs/components/prism-kotlin';\nimport 'prismjs/components/prism-latex';\nimport 'prismjs/components/prism-lua';\nimport 'prismjs/components/prism-markdown';\nimport 'prismjs/components/prism-matlab';\nimport 'prismjs/components/prism-makefile';\nimport 'prismjs/components/prism-objectivec';\nimport 'prismjs/components/prism-perl';\nimport 'prismjs/components/prism-php';\nimport 'prismjs/components/prism-powershell';\nimport 'prismjs/components/prism-python';\nimport 'prismjs/components/prism-r';\nimport 'prismjs/components/prism-ruby';\nimport 'prismjs/components/prism-rust';\nimport 'prismjs/components/prism-sas';\nimport 'prismjs/components/prism-scala';\nimport 'prismjs/components/prism-scheme';\nimport 'prismjs/components/prism-sql';\nimport 'prismjs/components/prism-stata';\nimport 'prismjs/components/prism-swift';\nimport 'prismjs/components/prism-typescript';\nimport 'prismjs/components/prism-tsx';\nimport 'prismjs/components/prism-vbnet';\nimport 'prismjs/components/prism-yaml';\n\ntype BaseRangeCustom = BaseRange & { className: string };\n\nexport const decorateCode = ([node, path]: NodeEntry) => {\n const ranges: BaseRangeCustom[] = [];\n\n // make sure it is an Slate Element\n if (!Element.isElement(node) || node.type !== 'code') return ranges;\n // transform the Element into a string\n const text = Node.string(node);\n const language = codeLanguages.find((lang) => lang.value === node.language);\n const decorateKey = language?.decorate ?? language?.value;\n\n const selectedLanguage = Prism.languages[decorateKey || 'plaintext'];\n\n // create \"tokens\" with \"prismjs\" and put them in \"ranges\"\n const tokens = Prism.tokenize(text, selectedLanguage);\n let start = 0;\n for (const token of tokens) {\n const length = token.length;\n const end = start + length;\n if (typeof token !== 'string') {\n ranges.push({\n anchor: { path, offset: start },\n focus: { path, offset: end },\n className: `token ${token.type}`,\n });\n }\n start = end;\n }\n\n // these will be found in \"renderLeaf\" in \"leaf\" and their \"className\" will be applied\n return ranges;\n};\n\nconst CodeBlock = styled.pre`\n border-radius: ${({ theme }) => theme.borderRadius};\n background-color: ${({ theme }) => theme.colors.neutral100};\n max-width: 100%;\n overflow: auto;\n padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};\n flex-shrink: 1;\n\n & > code {\n font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas,\n monospace;\n color: ${({ theme }) => theme.colors.neutral800};\n overflow: auto;\n max-width: 100%;\n }\n`;\n\nconst CodeEditor = (props: RenderElementProps) => {\n const { editor } = useBlocksEditorContext('ImageDialog');\n const editorIsFocused = useFocused();\n const imageIsSelected = useSelected();\n const { formatMessage } = useIntl();\n const [isSelectOpen, setIsSelectOpen] = React.useState(false);\n const shouldDisplayLanguageSelect = (editorIsFocused && imageIsSelected) || isSelectOpen;\n\n return (\n <Box position=\"relative\" width=\"100%\">\n <CodeBlock {...props.attributes}>\n <code>{props.children}</code>\n </CodeBlock>\n {shouldDisplayLanguageSelect && (\n <Box\n position=\"absolute\"\n background=\"neutral0\"\n borderColor=\"neutral150\"\n borderStyle=\"solid\"\n borderWidth=\"0.5px\"\n shadow=\"tableShadow\"\n top=\"100%\"\n marginTop={1}\n right={0}\n padding={1}\n hasRadius\n >\n <SingleSelect\n onChange={(open) => {\n Transforms.setNodes(\n editor,\n { language: open.toString() },\n { match: (node) => !Editor.isEditor(node) && node.type === 'code' }\n );\n }}\n value={(props.element.type === 'code' && props.element.language) || 'plaintext'}\n onOpenChange={(open) => {\n setIsSelectOpen(open);\n\n // Focus the editor again when closing the select so the user can continue typing\n if (!open) {\n ReactEditor.focus(editor);\n }\n }}\n onCloseAutoFocus={(e) => e.preventDefault()}\n aria-label={formatMessage({\n id: 'components.Blocks.blocks.code.languageLabel',\n defaultMessage: 'Select a language',\n })}\n >\n {codeLanguages.map(({ value, label }) => (\n <SingleSelectOption value={value} key={value}>\n {label}\n </SingleSelectOption>\n ))}\n </SingleSelect>\n </Box>\n )}\n </Box>\n );\n};\n\nconst codeBlocks: Pick<BlocksStore, 'code'> = {\n code: {\n renderElement: (props) => <CodeEditor {...props} />,\n icon: CodeBlockIcon,\n label: {\n id: 'components.Blocks.blocks.code',\n defaultMessage: 'Code block',\n },\n matchNode: (node) => node.type === 'code',\n isInBlocksSelector: true,\n handleConvert(editor) {\n baseHandleConvert<Block<'code'>>(editor, { type: 'code', language: 'plaintext' });\n },\n handleEnterKey(editor) {\n pressEnterTwiceToExit(editor);\n },\n snippets: ['```'],\n },\n};\n\nexport { codeBlocks };\n","import * as React from 'react';\n\nimport { Typography, TypographyComponent } from '@strapi/design-system';\nimport {\n HeadingFive,\n HeadingFour,\n HeadingOne,\n HeadingSix,\n HeadingThree,\n HeadingTwo,\n} from '@strapi/icons';\nimport { Editor } from 'slate';\nimport { styled } from 'styled-components';\n\nimport { type BlocksStore } from '../BlocksEditor';\nimport { baseHandleConvert } from '../utils/conversions';\nimport { type Block } from '../utils/types';\n\nconst H1 = styled<TypographyComponent<'h1'>>(Typography).attrs({ tag: 'h1' })`\n font-size: 4.2rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H2 = styled<TypographyComponent<'h2'>>(Typography).attrs({ tag: 'h2' })`\n font-size: 3.5rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H3 = styled<TypographyComponent<'h3'>>(Typography).attrs({ tag: 'h3' })`\n font-size: 2.9rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H4 = styled<TypographyComponent<'h4'>>(Typography).attrs({ tag: 'h4' })`\n font-size: 2.4rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H5 = styled<TypographyComponent<'h5'>>(Typography).attrs({ tag: 'h5' })`\n font-size: 2rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H6 = styled<TypographyComponent<'h6'>>(Typography).attrs({ tag: 'h6' })`\n font-size: 1.6rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\n/**\n * Common handler for converting a node to a heading\n */\nconst handleConvertToHeading = (editor: Editor, level: Block<'heading'>['level']) => {\n baseHandleConvert<Block<'heading'>>(editor, { type: 'heading', level });\n};\n\nconst headingBlocks: Pick<\n BlocksStore,\n 'heading-one' | 'heading-two' | 'heading-three' | 'heading-four' | 'heading-five' | 'heading-six'\n> = {\n 'heading-one': {\n renderElement: (props) => <H1 {...props.attributes}>{props.children}</H1>,\n icon: HeadingOne,\n label: {\n id: 'components.Blocks.blocks.heading1',\n defaultMessage: 'Heading 1',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 1),\n matchNode: (node) => node.type === 'heading' && node.level === 1,\n isInBlocksSelector: true,\n snippets: ['#'],\n dragHandleTopMargin: '14px',\n },\n 'heading-two': {\n renderElement: (props) => <H2 {...props.attributes}>{props.children}</H2>,\n icon: HeadingTwo,\n label: {\n id: 'components.Blocks.blocks.heading2',\n defaultMessage: 'Heading 2',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 2),\n matchNode: (node) => node.type === 'heading' && node.level === 2,\n isInBlocksSelector: true,\n snippets: ['##'],\n dragHandleTopMargin: '10px',\n },\n 'heading-three': {\n renderElement: (props) => <H3 {...props.attributes}>{props.children}</H3>,\n icon: HeadingThree,\n label: {\n id: 'components.Blocks.blocks.heading3',\n defaultMessage: 'Heading 3',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 3),\n matchNode: (node) => node.type === 'heading' && node.level === 3,\n isInBlocksSelector: true,\n snippets: ['###'],\n dragHandleTopMargin: '7px',\n },\n 'heading-four': {\n renderElement: (props) => <H4 {...props.attributes}>{props.children}</H4>,\n icon: HeadingFour,\n label: {\n id: 'components.Blocks.blocks.heading4',\n defaultMessage: 'Heading 4',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 4),\n matchNode: (node) => node.type === 'heading' && node.level === 4,\n isInBlocksSelector: true,\n snippets: ['####'],\n dragHandleTopMargin: '4px',\n },\n 'heading-five': {\n renderElement: (props) => <H5 {...props.attributes}>{props.children}</H5>,\n icon: HeadingFive,\n label: {\n id: 'components.Blocks.blocks.heading5',\n defaultMessage: 'Heading 5',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 5),\n matchNode: (node) => node.type === 'heading' && node.level === 5,\n isInBlocksSelector: true,\n snippets: ['#####'],\n },\n 'heading-six': {\n renderElement: (props) => <H6 {...props.attributes}>{props.children}</H6>,\n icon: HeadingSix,\n label: {\n id: 'components.Blocks.blocks.heading6',\n defaultMessage: 'Heading 6',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 6),\n matchNode: (node) => node.type === 'heading' && node.level === 6,\n isInBlocksSelector: true,\n snippets: ['######'],\n dragHandleTopMargin: '-2px',\n },\n};\n\nexport { headingBlocks };\n","import * as React from 'react';\n\nimport { useStrapiApp } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, FlexComponent } from '@strapi/design-system';\nimport { Image as Picture } from '@strapi/icons';\nimport { type Element, Transforms, Editor } from 'slate';\nimport { useFocused, type RenderElementProps, useSelected } from 'slate-react';\nimport { styled, css } from 'styled-components';\n\nimport { prefixFileUrlWithBackendUrl } from '../../../../../../utils/urls';\nimport { useBlocksEditorContext, type BlocksStore } from '../BlocksEditor';\nimport { type Block } from '../utils/types';\n\nimport type { Schema } from '@strapi/types';\n\nconst ImageWrapper = styled<FlexComponent>(Flex)<{ $isFocused?: boolean }>`\n transition-property: box-shadow;\n transition-duration: 0.2s;\n ${(props) =>\n props.$isFocused &&\n css`\n box-shadow: ${props.theme.colors.primary600} 0px 0px 0px 3px;\n `}\n\n & > img {\n height: auto;\n // The max-height is decided with the design team, the 56px is the height of the toolbar\n max-height: calc(512px - 56px);\n max-width: 100%;\n object-fit: contain;\n }\n`;\n\nconst IMAGE_SCHEMA_FIELDS = [\n 'name',\n 'alternativeText',\n 'url',\n 'caption',\n 'width',\n 'height',\n 'formats',\n 'hash',\n 'ext',\n 'mime',\n 'size',\n 'previewUrl',\n 'provider',\n 'provider_metadata',\n 'createdAt',\n 'updatedAt',\n];\n\nconst pick = <T extends object, K extends keyof T>(object: T, keys: K[]): Pick<T, K> => {\n const entries = keys.map((key) => [key, object[key]]);\n return Object.fromEntries(entries);\n};\n\n// Type guard to force TypeScript to narrow the type of the element in Blocks component\nconst isImage = (element: Element): element is Block<'image'> => {\n return element.type === 'image';\n};\n\n// Added a background color to the image wrapper to make it easier to recognize the image block\nconst Image = ({ attributes, children, element }: RenderElementProps) => {\n const editorIsFocused = useFocused();\n const imageIsSelected = useSelected();\n\n if (!isImage(element)) {\n return null;\n }\n const { url, alternativeText, width, height } = element.image;\n\n return (\n <Box {...attributes}>\n {children}\n <ImageWrapper\n background=\"neutral100\"\n contentEditable={false}\n justifyContent=\"center\"\n $isFocused={editorIsFocused && imageIsSelected}\n hasRadius\n >\n <img src={url} alt={alternativeText} width={width} height={height} />\n </ImageWrapper>\n </Box>\n );\n};\n\nconst ImageDialog = () => {\n const [isOpen, setIsOpen] = React.useState(true);\n const { editor } = useBlocksEditorContext('ImageDialog');\n const components = useStrapiApp('ImageDialog', (state) => state.components);\n\n if (!components || !isOpen) return null;\n\n const MediaLibraryDialog = components['media-library'] as React.ComponentType<{\n allowedTypes: Schema.Attribute.MediaKind[];\n onClose: () => void;\n onSelectAssets: (_images: Schema.Attribute.MediaValue<true>) => void;\n }>;\n\n const insertImages = (images: Block<'image'>['image'][]) => {\n // If the selection is inside a list, split the list so that the modified block is outside of it\n Transforms.unwrapNodes(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n split: true,\n });\n\n // Save the path of the node that is being replaced by an image to insert the images there later\n // It's the closest full block node above the selection\n const nodeEntryBeingReplaced = Editor.above(editor, {\n match(node) {\n if (Editor.isEditor(node)) return false;\n\n const isInlineNode = ['text', 'link'].includes(node.type);\n\n return !isInlineNode;\n },\n });\n\n if (!nodeEntryBeingReplaced) return;\n const [, pathToInsert] = nodeEntryBeingReplaced;\n\n // Remove the previous node that is being replaced by an image\n Transforms.removeNodes(editor);\n\n // Convert images to nodes and insert them\n const nodesToInsert = images.map((image) => {\n const imageNode: Block<'image'> = {\n type: 'image',\n image,\n children: [{ type: 'text', text: '' }],\n };\n return imageNode;\n });\n Transforms.insertNodes(editor, nodesToInsert, { at: pathToInsert });\n\n // Set the selection on the image since it was cleared by calling removeNodes\n Transforms.select(editor, pathToInsert);\n };\n\n const handleSelectAssets = (images: Schema.Attribute.MediaValue<true>) => {\n const formattedImages = images.map((image) => {\n // Create an object with imageSchema defined and exclude unnecessary props coming from media library config\n const expectedImage = pick(image, IMAGE_SCHEMA_FIELDS);\n\n const nodeImage: Block<'image'>['image'] = {\n ...expectedImage,\n alternativeText: expectedImage.alternativeText || expectedImage.name,\n url: prefixFileUrlWithBackendUrl(image.url),\n };\n\n return nodeImage;\n });\n\n insertImages(formattedImages);\n setIsOpen(false);\n };\n\n return (\n <MediaLibraryDialog\n allowedTypes={['images']}\n onClose={() => setIsOpen(false)}\n onSelectAssets={handleSelectAssets}\n />\n );\n};\n\nconst imageBlocks: Pick<BlocksStore, 'image'> = {\n image: {\n renderElement: (props) => <Image {...props} />,\n icon: Picture,\n label: {\n id: 'components.Blocks.blocks.image',\n defaultMessage: 'Image',\n },\n matchNode: (node) => node.type === 'image',\n isInBlocksSelector: true,\n handleBackspaceKey(editor) {\n // Prevent issue where the image remains when it's the only block in the document\n if (editor.children.length === 1) {\n Transforms.setNodes(editor, {\n type: 'paragraph',\n // @ts-expect-error we're only setting image as null so that Slate deletes it\n image: null,\n children: [{ type: 'text', text: '' }],\n });\n } else {\n Transforms.removeNodes(editor);\n }\n },\n handleEnterKey(editor) {\n Transforms.insertNodes(editor, {\n type: 'paragraph',\n children: [{ type: 'text', text: '' }],\n });\n },\n handleConvert: () => {\n /**\n * All the logic is managed inside the ImageDialog component,\n * because the blocks are only created when the user selects images in the modal and submits\n * and if he closes the modal, then no changes are made to the editor\n */\n return () => <ImageDialog />;\n },\n snippets: ['!['],\n },\n};\n\nexport { imageBlocks };\n","import { Transforms, Editor, Element as SlateElement, Node, Range } from 'slate';\n\nimport { type Block } from './types';\n\nconst removeLink = (editor: Editor) => {\n Transforms.unwrapNodes(editor, {\n match: (node) => !Editor.isEditor(node) && SlateElement.isElement(node) && node.type === 'link',\n });\n};\n\nconst insertLink = (editor: Editor, { url }: { url: string }) => {\n if (editor.selection) {\n // We want to remove all link on the selection\n const linkNodes = Array.from(\n Editor.nodes(editor, {\n at: editor.selection,\n match: (node) => !Editor.isEditor(node) && node.type === 'link',\n })\n );\n\n linkNodes.forEach(([, path]) => {\n Transforms.unwrapNodes(editor, { at: path });\n });\n\n if (Range.isCollapsed(editor.selection)) {\n const link: Block<'link'> = {\n type: 'link',\n url: url ?? '',\n children: [{ type: 'text', text: url }],\n };\n\n Transforms.insertNodes(editor, link);\n } else {\n Transforms.wrapNodes(editor, { type: 'link', url: url ?? '' } as Block<'link'>, {\n split: true,\n });\n }\n }\n};\n\nconst editLink = (editor: Editor, link: { url: string; text: string }) => {\n const { url, text } = link;\n\n if (!editor.selection) {\n return;\n }\n\n const linkEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'link',\n });\n\n if (linkEntry) {\n const [, linkPath] = linkEntry;\n Transforms.setNodes(editor, { url }, { at: linkPath });\n\n // If link text is different, we remove the old text and insert the new one\n if (text !== '' && text !== Editor.string(editor, linkPath)) {\n const linkNodeChildrens = Array.from(Node.children(editor, linkPath, { reverse: true }));\n\n linkNodeChildrens.forEach(([, childPath]) => {\n Transforms.removeNodes(editor, { at: childPath });\n });\n\n Transforms.insertNodes(editor, [{ type: 'text', text }], { at: linkPath.concat(0) });\n }\n }\n};\n\nexport { insertLink, editLink, removeLink };\n","import type { Schema } from '@strapi/types';\nimport type { Element, Node } from 'slate';\n\ntype Block<T extends Element['type']> = Extract<Node, { type: T }>;\n\n// Wrap Object.entries to get the correct types\nconst getEntries = <T extends object>(object: T) =>\n Object.entries(object) as [keyof T, T[keyof T]][];\n\n// Wrap Object.keys to get the correct types\nconst getKeys = <T extends object>(object: T) => Object.keys(object) as (keyof T)[];\n\nconst isLinkNode = (element: Element): element is Schema.Attribute.LinkInlineNode => {\n return element.type === 'link';\n};\n\nconst isListNode = (element: Element): element is Schema.Attribute.ListBlockNode => {\n return element.type === 'list';\n};\n\nexport { type Block, getEntries, getKeys, isLinkNode, isListNode };\n","import * as React from 'react';\n\nimport { Box, Button, Field, Flex, Popover, useComposedRefs } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { Editor, Path, Range, Transforms } from 'slate';\nimport { type RenderElementProps, ReactEditor } from 'slate-react';\nimport { styled } from 'styled-components';\n\nimport { type BlocksStore, useBlocksEditorContext } from '../BlocksEditor';\nimport { editLink, removeLink } from '../utils/links';\nimport { isLinkNode, type Block } from '../utils/types';\n\nconst StyledLink = styled(Box)`\n text-decoration: none;\n`;\n\nconst RemoveButton = styled(Button)<{ $visible: boolean }>`\n visibility: ${(props) => (props.$visible ? 'visible' : 'hidden')};\n`;\n\ninterface LinkContentProps extends RenderElementProps {\n link: Block<'link'>;\n}\n\nconst LinkContent = React.forwardRef<HTMLAnchorElement, LinkContentProps>(\n ({ link, children, attributes }, forwardedRef) => {\n const { formatMessage } = useIntl();\n const { editor } = useBlocksEditorContext('Link');\n const path = ReactEditor.findPath(editor, link);\n const [popoverOpen, setPopoverOpen] = React.useState(\n editor.lastInsertedLinkPath ? Path.equals(path, editor.lastInsertedLinkPath) : false\n );\n const elementText = link.children.map((child) => child.text).join('');\n const [linkText, setLinkText] = React.useState(elementText);\n const [linkUrl, setLinkUrl] = React.useState(link.url);\n const linkInputRef = React.useRef<HTMLInputElement>(null);\n const isLastInsertedLink = editor.lastInsertedLinkPath\n ? !Path.equals(path, editor.lastInsertedLinkPath)\n : true;\n const [isSaveDisabled, setIsSaveDisabled] = React.useState(false);\n\n const onLinkChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n setIsSaveDisabled(false);\n setLinkUrl(e.target.value);\n\n try {\n // eslint-disable-next-line no-new\n new URL(\n e.target.value?.startsWith('/') ? `https://strapi.io${e.target.value}` : e.target.value\n );\n } catch (error) {\n setIsSaveDisabled(true);\n }\n };\n\n const handleSave: React.FormEventHandler = (e) => {\n e.stopPropagation();\n\n // If the selection is collapsed, we select the parent node because we want all the link to be replaced)\n if (editor.selection && Range.isCollapsed(editor.selection)) {\n const [, parentPath] = Editor.parent(editor, editor.selection.focus?.path);\n Transforms.select(editor, parentPath);\n }\n\n editLink(editor, { url: linkUrl, text: linkText });\n setPopoverOpen(false);\n editor.lastInsertedLinkPath = null;\n ReactEditor.focus(editor);\n };\n\n const handleClose = () => {\n if (link.url === '') {\n removeLink(editor);\n }\n\n setPopoverOpen(false);\n ReactEditor.focus(editor);\n };\n\n React.useEffect(() => {\n // Focus on the link input element when the popover opens\n if (popoverOpen) linkInputRef.current?.focus();\n }, [popoverOpen]);\n\n const inputNotDirty =\n !linkText ||\n !linkUrl ||\n (link.url && link.url === linkUrl && elementText && elementText === linkText);\n\n return (\n <Popover.Root open={popoverOpen}>\n <Popover.Trigger>\n <StyledLink\n {...attributes}\n ref={forwardedRef}\n tag=\"a\"\n href={link.url}\n onClick={() => setPopoverOpen(true)}\n color=\"primary600\"\n >\n {children}\n </StyledLink>\n </Popover.Trigger>\n <Popover.Content onPointerDownOutside={handleClose}>\n <Flex padding={4} direction=\"column\" gap={4}>\n <Field.Root width=\"368px\">\n <Flex direction=\"column\" gap={1} alignItems=\"stretch\">\n <Field.Label>\n {formatMessage({\n id: 'components.Blocks.popover.text',\n defaultMessage: 'Text',\n })}\n </Field.Label>\n <Field.Input\n name=\"text\"\n placeholder={formatMessage({\n id: 'components.Blocks.popover.text.placeholder',\n defaultMessage: 'Enter link text',\n })}\n value={linkText}\n onChange={(e) => {\n setLinkText(e.target.value);\n }}\n />\n </Flex>\n </Field.Root>\n <Field.Root width=\"368px\">\n <Flex direction=\"column\" gap={1} alignItems=\"stretch\">\n <Field.Label>\n {formatMessage({\n id: 'components.Blocks.popover.link',\n defaultMessage: 'Link',\n })}\n </Field.Label>\n <Field.Input\n ref={linkInputRef}\n name=\"url\"\n placeholder={formatMessage({\n id: 'components.Blocks.popover.link.placeholder',\n defaultMessage: 'Paste link',\n })}\n value={linkUrl}\n onChange={onLinkChange}\n />\n </Flex>\n </Field.Root>\n <Flex justifyContent=\"space-between\" width=\"100%\">\n <RemoveButton\n variant=\"danger-light\"\n onClick={() => removeLink(editor)}\n $visible={isLastInsertedLink}\n >\n {formatMessage({\n id: 'components.Blocks.popover.remove',\n defaultMessage: 'Remove',\n })}\n </RemoveButton>\n <Flex gap={2}>\n <Button variant=\"tertiary\" onClick={handleClose}>\n {formatMessage({\n id: 'global.cancel',\n defaultMessage: 'Cancel',\n })}\n </Button>\n <Button disabled={Boolean(inputNotDirty) || isSaveDisabled} onClick={handleSave}>\n {formatMessage({\n id: 'global.save',\n defaultMessage: 'Save',\n })}\n </Button>\n </Flex>\n </Flex>\n </Flex>\n </Popover.Content>\n </Popover.Root>\n );\n }\n);\n\nconst Link = React.forwardRef<HTMLAnchorElement, RenderElementProps>((props, forwardedRef) => {\n if (!isLinkNode(props.element)) {\n return null;\n }\n\n // LinkContent uses React hooks that rely on props.element being a link. If the type guard above\n // doesn't pass, those hooks would be called conditionnally, which is not allowed.\n // Hence the need for a separate component.\n return <LinkContent {...props} link={props.element} ref={forwardedRef} />;\n});\n\nconst linkBlocks: Pick<BlocksStore, 'link'> = {\n link: {\n renderElement: (props) => (\n <Link element={props.element} attributes={props.attributes}>\n {props.children}\n </Link>\n ),\n // No handleConvert here, links are created via the link button in the toolbar\n matchNode: (node) => node.type === 'link',\n isInBlocksSelector: false,\n },\n};\n\nexport { linkBlocks };\n","import * as React from 'react';\n\nimport { Typography } from '@strapi/design-system';\nimport { BulletList, NumberList } from '@strapi/icons';\nimport { type Text, Editor, Node, Transforms, Path } from 'slate';\nimport { type RenderElementProps, ReactEditor } from 'slate-react';\nimport { styled, type CSSProperties, css } from 'styled-components';\n\nimport { type BlocksStore } from '../BlocksEditor';\nimport { baseHandleConvert } from '../utils/conversions';\nimport { isListNode, type Block } from '../utils/types';\n\nconst listStyle = css`\n display: flex;\n flex-direction: column;\n gap: ${({ theme }) => theme.spaces[2]};\n margin-inline-start: ${({ theme }) => theme.spaces[0]};\n margin-inline-end: ${({ theme }) => theme.spaces[0]};\n padding-inline-start: ${({ theme }) => theme.spaces[2]};\n\n ol,\n ul {\n margin-block-start: ${({ theme }) => theme.spaces[0]};\n margin-block-end: ${({ theme }) => theme.spaces[0]};\n }\n\n li {\n margin-inline-start: ${({ theme }) => theme.spaces[3]};\n }\n`;\n\nconst Orderedlist = styled.ol<{ $listStyleType: CSSProperties['listStyleType'] }>`\n list-style-type: ${(props) => props.$listStyleType};\n ${listStyle}\n`;\n\nconst Unorderedlist = styled.ul<{ $listStyleType: CSSProperties['listStyleType'] }>`\n list-style-type: ${(props) => props.$listStyleType};\n ${listStyle}\n`;\n\nconst orderedStyles = ['decimal', 'lower-alpha', 'upper-roman'];\nconst unorderedStyles = ['disc', 'circle', 'square'];\n\nconst List = ({ attributes, children, element }: RenderElementProps) => {\n if (!isListNode(element)) {\n return null;\n }\n\n // Decide the subsequent style by referencing the given styles according to the format,\n // allowing for infinite nested lists\n const listStyles = element.format === 'ordered' ? orderedStyles : unorderedStyles;\n const nextIndex = (element.indentLevel || 0) % listStyles!.length;\n const listStyleType = listStyles![nextIndex];\n\n if (element.format === 'ordered') {\n return (\n <Orderedlist $listStyleType={listStyleType} {...attributes}>\n {children}\n </Orderedlist>\n );\n }\n\n return (\n <Unorderedlist $listStyleType={listStyleType} {...attributes}>\n {children}\n </Unorderedlist>\n );\n};\n\nconst replaceListWithEmptyBlock = (editor: Editor, currentListPath: Path) => {\n // Delete the empty list\n Transforms.removeNodes(editor, { at: currentListPath });\n\n if (currentListPath[0] === 0) {\n // If the list was the only (or first) block element then insert empty paragraph as editor needs default value\n Transforms.insertNodes(\n editor,\n {\n type: 'paragraph',\n children: [{ type: 'text', text: '' }],\n },\n { at: currentListPath }\n );\n Transforms.select(editor, currentListPath);\n }\n};\n\nconst isText = (node: unknown): node is Text => {\n return Node.isNode(node) && !Editor.isEditor(node) && node.type === 'text';\n};\n\n/**\n * Common handler for the backspace event on ordered and unordered lists\n */\nconst handleBackspaceKeyOnList = (editor: Editor, event: React.KeyboardEvent<HTMLElement>) => {\n if (!editor.selection) return;\n\n const [currentListItem, currentListItemPath] = Editor.parent(editor, editor.selection.anchor);\n const [currentList, currentListPath] = Editor.parent(editor, currentListItemPath);\n const isListEmpty =\n currentList.children.length === 1 &&\n isText(currentListItem.children[0]) &&\n currentListItem.children[0].text === '';\n const isListItemEmpty =\n currentListItem.children.length === 1 &&\n isText(currentListItem.children[0]) &&\n currentListItem.children[0].text === '';\n const isFocusAtTheBeginningOfAChild =\n editor.selection.focus.offset === 0 && editor.selection.focus.path.at(-2) === 0;\n\n if (isListEmpty) {\n const parentListEntry = Editor.above(editor, {\n at: currentListPath,\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n });\n if (!parentListEntry) {\n event.preventDefault();\n replaceListWithEmptyBlock(editor, currentListPath);\n }\n } else if (isFocusAtTheBeginningOfAChild) {\n // If the focus is at the beginning of a child node we need to replace it with a paragraph\n Transforms.liftNodes(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list-item',\n });\n Transforms.setNodes(editor, { type: 'paragraph' });\n } else if (isListItemEmpty) {\n const previousEntry = Editor.previous(editor, {\n at: currentListItemPath,\n });\n const nextEntry = Editor.next(editor, {\n at: currentListItemPath,\n });\n\n if (previousEntry && nextEntry) {\n // If previous and next nodes are lists or list-items, delete empty list item\n event.preventDefault();\n Transforms.removeNodes(editor, {\n at: currentListItemPath,\n });\n\n // If previous and next nodes are lists with same format and indent Levels, then merge the nodes\n const [previousList] = previousEntry;\n const [nextList] = nextEntry;\n if (\n !Editor.isEditor(previousList) &&\n !isText(previousList) &&\n isListNode(previousList) &&\n !Editor.isEditor(nextList) &&\n !isText(nextList) &&\n isListNode(nextList)\n ) {\n if (\n previousList.type === 'list' &&\n nextList.type === 'list' &&\n previousList.format === nextList.format &&\n previousList.indentLevel === nextList.indentLevel\n ) {\n Transforms.mergeNodes(editor, {\n at: currentListItemPath,\n });\n }\n }\n }\n }\n};\n\n/**\n * Common handler for the enter key on ordered and unordered lists\n */\nconst handleEnterKeyOnList = (editor: Editor) => {\n const currentListItemEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list-item',\n });\n\n if (!currentListItemEntry || !editor.selection) {\n return;\n }\n\n const [currentListItem, currentListItemPath] = currentListItemEntry;\n const [currentList, currentListPath] = Editor.parent(editor, currentListItemPath);\n const isListEmpty =\n currentList.children.length === 1 &&\n isText(currentListItem.children[0]) &&\n currentListItem.children[0].text === '';\n const isListItemEmpty =\n currentListItem.children.length === 1 &&\n isText(currentListItem.children[0]) &&\n currentListItem.children[0].text === '';\n const isFocusAtTheBeginningOfAChild =\n editor.selection.focus.offset === 0 && editor.selection.focus.path.at(-1) === 0;\n\n if (isListEmpty) {\n replaceListWithEmptyBlock(editor, currentListPath);\n } else if (isFocusAtTheBeginningOfAChild && !isListItemEmpty) {\n // If the focus is at the beginning of a child node, shift below the list item and create a new list-item\n const currentNode = Editor.above(editor, { at: editor.selection.anchor });\n Transforms.insertNodes(editor, { type: 'list-item', children: [{ type: 'text', text: '' }] });\n if (currentNode) {\n const path = currentNode[1];\n const updatedPath = [...path.slice(0, -1), path[path.length - 1] + 1];\n Transforms.select(editor, {\n anchor: { path: updatedPath.concat(0), offset: 0 },\n focus: { path: updatedPath.concat(0), offset: 0 },\n });\n }\n } else if (isListItemEmpty) {\n // Check if there is a list above the current list and shift list-item under it\n if (\n !Editor.isEditor(currentList) &&\n isListNode(currentList) &&\n currentList?.indentLevel &&\n currentList.indentLevel > 0\n ) {\n const previousIndentLevel = currentList.indentLevel - 1;\n\n const parentListNodeEntry = Editor.above(editor, {\n match: (node) =>\n !Editor.isEditor(node) &&\n node.type === 'list' &&\n (node.indentLevel || 0) === previousIndentLevel,\n });\n\n if (parentListNodeEntry) {\n // Get the parent list path and add 1 to it to exit from the current list\n const modifiedPath = currentListItemPath.slice(0, -1);\n if (modifiedPath.length > 0) {\n modifiedPath[modifiedPath.length - 1] += 1;\n }\n\n // Shift list-item under parent list\n Transforms.moveNodes(editor, {\n at: currentListItemPath,\n to: modifiedPath,\n });\n return;\n }\n }\n\n // Otherwise delete the empty list item and create a new paragraph below the parent list\n Transforms.removeNodes(editor, { at: currentListItemPath });\n\n const createdParagraphPath = Path.next(currentListPath);\n Transforms.insertNodes(\n editor,\n {\n type: 'paragraph',\n children: [{ type: 'text', text: '' }],\n },\n { at: createdParagraphPath }\n );\n\n // Move the selection to the newly created paragraph\n Transforms.select(editor, createdParagraphPath);\n } else {\n // Check if the cursor is at the end of the list item\n const isNodeEnd = Editor.isEnd(editor, editor.selection.anchor, currentListItemPath);\n\n if (isNodeEnd) {\n // If there was nothing after the cursor, create a fresh new list item,\n // in order to avoid carrying over the modifiers from the previous list item\n Transforms.insertNodes(editor, { type: 'list-item', children: [{ type: 'text', text: '' }] });\n } else {\n // If there is something after the cursor, split the current list item,\n // so that we keep the content and the modifiers\n Transforms.splitNodes(editor);\n }\n }\n};\n\n/**\n * Common handler for converting a node to a list\n */\nconst handleConvertToList = (editor: Editor, format: Block<'list'>['format']) => {\n const convertedPath = baseHandleConvert<Block<'list-item'>>(editor, { type: 'list-item' });\n\n if (!convertedPath) return;\n\n Transforms.wrapNodes(editor, { type: 'list', format, children: [] }, { at: convertedPath });\n};\n\n/**\n * Common handler for the tab key on ordered and unordered lists\n */\nconst handleTabOnList = (editor: Editor) => {\n const currentListItemEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list-item',\n });\n\n if (!currentListItemEntry || !editor.selection) {\n return;\n }\n\n const [currentListItem, currentListItemPath] = currentListItemEntry;\n const [currentList] = Editor.parent(editor, currentListItemPath);\n\n // Skip tabbing if list-item is the first item in the list\n if (currentListItem === currentList.children[0]) return;\n\n const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);\n const previousNode = currentList.children[currentListItemIndex - 1];\n\n // If previous node is a list block then move the list-item under it\n if (previousNode.type === 'list') {\n const nodePath = ReactEditor.findPath(editor, previousNode);\n const insertAtPath = previousNode.children.length;\n\n Transforms.moveNodes(editor, {\n at: currentListItemPath,\n to: nodePath.concat(insertAtPath),\n });\n return;\n }\n\n if (!Editor.isEditor(currentList) && isListNode(currentList)) {\n // Wrap list-item with list block on tab\n Transforms.wrapNodes(editor, {\n type: 'list',\n format: currentList.format,\n indentLevel: (currentList.indentLevel || 0) + 1,\n children: [],\n });\n }\n};\n\nconst listBlocks: Pick<BlocksStore, 'list-ordered' | 'list-unordered' | 'list-item'> = {\n 'list-ordered': {\n renderElement: (props) => <List {...props} />,\n label: {\n id: 'components.Blocks.blocks.orderedList',\n defaultMessage: 'Numbered list',\n },\n icon: NumberList,\n matchNode: (node) => node.type === 'list' && node.format === 'ordered',\n isInBlocksSelector: true,\n handleConvert: (editor) => handleConvertToList(editor, 'ordered'),\n handleEnterKey: handleEnterKeyOnList,\n handleBackspaceKey: handleBackspaceKeyOnList,\n handleTab: handleTabOnList,\n snippets: ['1.'],\n },\n 'list-unordered': {\n renderElement: (props) => <List {...props} />,\n label: {\n id: 'components.Blocks.blocks.unorderedList',\n defaultMessage: 'Bulleted list',\n },\n icon: BulletList,\n matchNode: (node) => node.type === 'list' && node.format === 'unordered',\n isInBlocksSelector: true,\n handleConvert: (editor) => handleConvertToList(editor, 'unordered'),\n handleEnterKey: handleEnterKeyOnList,\n handleBackspaceKey: handleBackspaceKeyOnList,\n handleTab: handleTabOnList,\n snippets: ['-', '*', '+'],\n },\n 'list-item': {\n renderElement: (props) => (\n <Typography tag=\"li\" {...props.attributes}>\n {props.children}\n </Typography>\n ),\n // No handleConvert, list items are created when converting to the parent list\n matchNode: (node) => node.type === 'list-item',\n isInBlocksSelector: false,\n dragHandleTopMargin: '-2px',\n },\n};\n\nexport { listBlocks };\n","import * as React from 'react';\n\nimport { Typography } from '@strapi/design-system';\nimport { Paragraph } from '@strapi/icons';\nimport { type Text, Editor, Transforms } from 'slate';\n\nimport { type BlocksStore } from '../BlocksEditor';\nimport { baseHandleConvert } from '../utils/conversions';\nimport { type Block } from '../utils/types';\n\nconst paragraphBlocks: Pick<BlocksStore, 'paragraph'> = {\n paragraph: {\n renderElement: (props) => (\n <Typography tag=\"p\" variant=\"omega\" {...props.attributes}>\n {props.children}\n </Typography>\n ),\n icon: Paragraph,\n label: {\n id: 'components.Blocks.blocks.text',\n defaultMessage: 'Text',\n },\n matchNode: (node) => node.type === 'paragraph',\n isInBlocksSelector: true,\n dragHandleTopMargin: '-2px',\n handleConvert(editor) {\n baseHandleConvert<Block<'paragraph'>>(editor, { type: 'paragraph' });\n },\n handleEnterKey(editor) {\n if (!editor.selection) {\n return;\n }\n\n // We need to keep track of the initial position of the cursor\n const anchorPathInitialPosition = editor.selection.anchor.path;\n /**\n * Split the nodes where the cursor is. This will create a new paragraph with the content\n * after the cursor, while retaining all the children, modifiers etc.\n */\n Transforms.splitNodes(editor, {\n // Makes sure we always create a new node,\n // even if there's nothing to the right of the cursor in the node.\n always: true,\n });\n\n // Check if the created node is empty (if there was no text after the cursor in the node)\n // This lets us know if we need to carry over the modifiers from the previous node\n const parentBlockEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type !== 'text',\n });\n if (!parentBlockEntry) {\n return;\n }\n const [, parentBlockPath] = parentBlockEntry;\n const isNodeEnd = Editor.isEnd(editor, editor.selection.anchor, parentBlockPath);\n\n /**\n * Delete and recreate the node that was created at the right of the cursor.\n * This is to avoid node pollution\n * (e.g. keeping the level attribute when converting a heading to a paragraph).\n * Select the parent of the selection because we want the full block, not the leaf.\n * And copy its children to make sure we keep the modifiers.\n */\n const [fragmentedNode] = Editor.parent(editor, editor.selection.anchor.path);\n Transforms.removeNodes(editor);\n\n // Check if after the current position there is another node\n const hasNextNode = editor.children.length - anchorPathInitialPosition[0] > 1;\n\n // Insert the new node at the right position.\n // The next line after the editor selection if present or otherwise at the end of the editor.\n Transforms.insertNodes(\n editor,\n {\n type: 'paragraph',\n // Don't carry over the modifiers from the previous node if there was no text after the cursor\n children: (isNodeEnd ? [{ type: 'text', text: '' }] : fragmentedNode.children) as Text[],\n },\n {\n at: hasNextNode ? [anchorPathInitialPosition[0] + 1] : [editor.children.length],\n }\n );\n\n /**\n * The new selection will by default be at the end of the created node.\n * Instead we manually move it to the start of the created node.\n * Make sure to we go to the start of the node and not the start of the leaf.\n */\n Transforms.select(editor, editor.start([anchorPathInitialPosition[0] + 1]));\n },\n },\n};\n\nexport { paragraphBlocks };\n","import { Quotes } from '@strapi/icons';\nimport { styled } from 'styled-components';\n\nimport { type BlocksStore } from '../BlocksEditor';\nimport { baseHandleConvert } from '../utils/conversions';\nimport { pressEnterTwiceToExit } from '../utils/enterKey';\nimport { type Block } from '../utils/types';\n\nconst Blockquote = styled.blockquote.attrs({ role: 'blockquote' })`\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n border-left: ${({ theme }) => `${theme.spaces[1]} solid ${theme.colors.neutral200}`};\n padding: ${({ theme }) => theme.spaces[2]} ${({ theme }) => theme.spaces[4]};\n color: ${({ theme }) => theme.colors.neutral600};\n`;\n\nconst quoteBlocks: Pick<BlocksStore, 'quote'> = {\n quote: {\n renderElement: (props) => (\n // The div is needed to make sure the padding bottom from BlocksContent is applied properly\n // when the quote is the last block in the editor\n <div>\n <Blockquote {...props.attributes}>{props.children}</Blockquote>\n </div>\n ),\n icon: Quotes,\n label: {\n id: 'components.Blocks.blocks.quote',\n defaultMessage: 'Quote',\n },\n matchNode: (node) => node.type === 'quote',\n isInBlocksSelector: true,\n handleConvert(editor) {\n baseHandleConvert<Block<'quote'>>(editor, { type: 'quote' });\n },\n handleEnterKey(editor) {\n pressEnterTwiceToExit(editor);\n },\n snippets: ['>'],\n },\n};\n\nexport { quoteBlocks };\n","import * as React from 'react';\n\nimport { useElementOnScreen } from '@strapi/admin/strapi-admin';\nimport { IconButton, Menu } from '@strapi/design-system';\nimport { More } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\n/* -------------------------------------------------------------------------------------------------\n * ObservedToolbarComponent\n * -----------------------------------------------------------------------------------------------*/\n\ninterface ObservedToolbarComponentProps {\n index: number;\n lastVisibleIndex: number;\n setLastVisibleIndex: React.Dispatch<React.SetStateAction<number>>;\n rootRef: React.RefObject<HTMLElement>;\n children: React.ReactNode;\n}\n\nconst ObservedToolbarComponent = ({\n index,\n lastVisibleIndex,\n setLastVisibleIndex,\n rootRef,\n children,\n}: ObservedToolbarComponentProps) => {\n const isVisible = index <= lastVisibleIndex;\n\n const containerRef = useElementOnScreen<HTMLDivElement>(\n (isVisible) => {\n /**\n * It's the MoreMenu's job to make an item not visible when there's not room for it.\n * But we need to react here to the element becoming visible again.\n */\n if (isVisible) {\n setLastVisibleIndex((prev) => Math.max(prev, index));\n }\n },\n { threshold: 1, root: rootRef.current }\n );\n\n return (\n <div\n ref={containerRef}\n style={{\n /**\n * Use visibility so that the element occupies the space if requires even when there's not\n * enough room for it to be visible. The empty reserved space will be clipped by the\n * overflow:hidden rule on the parent, so it doesn't affect the UI.\n * This way we can keep observing its visiblity and react to browser resize events.\n */\n visibility: isVisible ? 'visible' : 'hidden',\n }}\n >\n {children}\n </div>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * EditorToolbarObserver\n * -----------------------------------------------------------------------------------------------*/\n\nexport interface ObservedComponent {\n toolbar: React.ReactNode;\n menu: React.ReactNode;\n key: string;\n}\n\nexport const EditorToolbarObserver = ({\n observedComponents,\n menuTriggerVariant = 'ghost',\n}: {\n observedComponents: ObservedComponent[];\n menuTriggerVariant?: Menu.TriggerProps['variant'];\n}) => {\n const { formatMessage } = useIntl();\n const toolbarRef = React.useRef<HTMLElement>(null);\n\n const [lastVisibleIndex, setLastVisibleIndex] = React.useState<number>(\n observedComponents.length - 1\n );\n const hasHiddenItems = lastVisibleIndex < observedComponents.length - 1;\n const menuIndex = lastVisibleIndex + 1;\n\n const [open, setOpen] = React.useState(false);\n const isMenuOpenWithContent = open && hasHiddenItems;\n const menuTriggerRef = useElementOnScreen<HTMLButtonElement>(\n (isVisible) => {\n // We only react to the menu becoming invisible. When that happens, we hide the last item.\n if (!isVisible) {\n /**\n * If there's no room for any item, the index can be -1.\n * This is intentional, in that case only the more menu will be visible.\n **/\n setLastVisibleIndex((prev) => prev - 1);\n // Maintain the menu state if it has content\n setOpen(isMenuOpenWithContent);\n }\n },\n { threshold: 1, root: toolbarRef.current }\n );\n\n return observedComponents\n .map((component, index) => {\n return (\n <ObservedToolbarComponent\n key={component.key}\n index={index}\n lastVisibleIndex={lastVisibleIndex}\n setLastVisibleIndex={setLastVisibleIndex}\n rootRef={toolbarRef}\n >\n {component.toolbar}\n </ObservedToolbarComponent>\n );\n })\n .toSpliced(\n menuIndex,\n 0,\n <Menu.Root\n key=\"more-menu\"\n defaultOpen={false}\n open={isMenuOpenWithContent}\n onOpenChange={setOpen}\n >\n <Menu.Trigger\n paddingLeft={0}\n paddingRight={0}\n ref={menuTriggerRef}\n variant={menuTriggerVariant}\n style={{ visibility: hasHiddenItems ? 'visible' : 'hidden' }}\n label={formatMessage({ id: 'global.more', defaultMessage: 'More' })}\n tag={IconButton}\n icon={<More />}\n />\n <Menu.Content\n onCloseAutoFocus={(e) => e.preventDefault()}\n maxHeight=\"100%\"\n minWidth=\"256px\"\n popoverPlacement=\"bottom-end\"\n zIndex={2}\n >\n {observedComponents.slice(menuIndex).map((component) => (\n <React.Fragment key={component.key}>{component.menu}</React.Fragment>\n ))}\n </Menu.Content>\n </Menu.Root>\n );\n};\n","import * as React from 'react';\n\nimport * as Toolbar from '@radix-ui/react-toolbar';\nimport { useElementOnScreen } from '@strapi/admin/strapi-admin';\nimport {\n Flex,\n Tooltip,\n SingleSelect,\n SingleSelectOption,\n Box,\n FlexComponent,\n BoxComponent,\n Menu,\n IconButton,\n} from '@strapi/design-system';\nimport { Link, More } from '@strapi/icons';\nimport { MessageDescriptor, useIntl } from 'react-intl';\nimport { Editor, Transforms, Element as SlateElement, Node, type Ancestor } from 'slate';\nimport { ReactEditor } from 'slate-react';\nimport { css, styled } from 'styled-components';\n\nimport { EditorToolbarObserver } from '../../EditorToolbarObserver';\n\nimport {\n type BlocksStore,\n type SelectorBlockKey,\n isSelectorBlockKey,\n useBlocksEditorContext,\n} from './BlocksEditor';\nimport { insertLink } from './utils/links';\nimport { type Block, getEntries, getKeys } from './utils/types';\n\nconst ToolbarWrapper = styled<FlexComponent>(Flex)`\n &[aria-disabled='true'] {\n cursor: not-allowed;\n background: ${({ theme }) => theme.colors.neutral150};\n }\n`;\n\nconst ToolbarSeparator = styled(Toolbar.Separator)`\n background: ${({ theme }) => theme.colors.neutral150};\n width: 1px;\n height: 2.4rem;\n`;\n\nconst FlexButton = styled<FlexComponent<'button'>>(Flex)`\n // Inherit the not-allowed cursor from ToolbarWrapper when disabled\n &[aria-disabled] {\n cursor: not-allowed;\n }\n\n &[aria-disabled='false'] {\n cursor: pointer;\n\n // Only apply hover styles if the button is enabled\n &:hover {\n background: ${({ theme }) => theme.colors.primary100};\n }\n }\n`;\n\nconst SelectWrapper = styled<BoxComponent>(Box)`\n // Styling changes to SingleSelect component don't work, so adding wrapper to target SingleSelect\n div[role='combobox'] {\n border: none;\n cursor: pointer;\n min-height: unset;\n padding-top: 6px;\n padding-bottom: 6px;\n\n &[aria-disabled='false']:hover {\n cursor: pointer;\n background: ${({ theme }) => theme.colors.primary100};\n }\n\n &[aria-disabled] {\n background: transparent;\n cursor: inherit;\n\n // Select text and icons should also have disabled color\n span {\n color: ${({ theme }) => theme.colors.neutral600};\n }\n }\n }\n`;\n\n/**\n * Handles the modal component that may be returned by a block when converting it\n */\nfunction useConversionModal() {\n const [modalElement, setModalComponent] = React.useState<React.JSX.Element | null>(null);\n\n const handleConversionResult = (renderModal: void | (() => React.JSX.Element) | undefined) => {\n // Not all blocks return a modal\n if (renderModal) {\n // Use cloneElement to apply a key because to create a new instance of the component\n // Without the new key, the state is kept from previous times that option was picked\n setModalComponent(React.cloneElement(renderModal(), { key: Date.now() }));\n }\n };\n\n return { modalElement, handleConversionResult };\n}\n\ninterface ToolbarButtonProps {\n icon: React.ComponentType<React.SVGProps<SVGSVGElement>>;\n name: string;\n label: MessageDescriptor;\n isActive: boolean;\n disabled: boolean;\n handleClick: () => void;\n}\n\nconst ToolbarButton = ({\n icon: Icon,\n name,\n label,\n isActive,\n disabled,\n handleClick,\n}: ToolbarButtonProps) => {\n const { editor } = useBlocksEditorContext('ToolbarButton');\n const { formatMessage } = useIntl();\n const labelMessage = formatMessage(label);\n\n const enabledColor = isActive ? 'primary600' : 'neutral600';\n\n return (\n <Tooltip label={labelMessage}>\n <Toolbar.ToggleItem\n value={name}\n data-state={isActive ? 'on' : 'off'}\n onMouseDown={(e) => {\n e.preventDefault();\n handleClick();\n ReactEditor.focus(editor);\n }}\n aria-disabled={disabled}\n disabled={disabled}\n aria-label={labelMessage}\n asChild\n >\n <FlexButton\n tag=\"button\"\n background={isActive ? 'primary100' : ''}\n alignItems=\"center\"\n justifyContent=\"center\"\n width={7}\n height={7}\n hasRadius\n >\n <Icon fill={disabled ? 'neutral300' : enabledColor} />\n </FlexButton>\n </Toolbar.ToggleItem>\n </Tooltip>\n );\n};\n\nconst BlocksDropdown = () => {\n const { editor, blocks, disabled } = useBlocksEditorContext('BlocksDropdown');\n const { formatMessage } = useIntl();\n const { modalElement, handleConversionResult } = useConversionModal();\n\n const blockKeysToInclude: SelectorBlockKey[] = getEntries(blocks).reduce<\n ReturnType<typeof getEntries>\n >((currentKeys, entry) => {\n const [key, block] = entry;\n\n return block.isInBlocksSelector ? [...currentKeys, key] : currentKeys;\n }, []);\n\n const [blockSelected, setBlockSelected] = React.useState<SelectorBlockKey>('paragraph');\n\n const handleSelect = (optionKey: unknown) => {\n if (!isSelectorBlockKey(optionKey)) {\n return;\n }\n\n const editorIsEmpty =\n editor.children.length === 1 && Editor.isEmpty(editor, editor.children[0]);\n\n if (!editor.selection && !editorIsEmpty) {\n // When there is no selection, create an empty block at the end of the editor\n // so that it can be converted to the selected block\n Transforms.insertNodes(\n editor,\n {\n type: 'quote',\n children: [{ type: 'text', text: '' }],\n },\n {\n select: true,\n // Since there's no selection, Slate will automatically insert the node at the end\n }\n );\n } else if (!editor.selection && editorIsEmpty) {\n // When there is no selection and the editor is empty,\n // select the empty paragraph from Slate's initialValue so it gets converted\n Transforms.select(editor, Editor.start(editor, [0, 0]));\n }\n\n // If selection is already a list block, toggle its format\n const currentListEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n });\n\n if (currentListEntry && ['list-ordered', 'list-unordered'].includes(optionKey)) {\n const [currentList, currentListPath] = currentListEntry;\n const format = optionKey === 'list-ordered' ? 'ordered' : 'unordered';\n\n if (!Editor.isEditor(currentList) && isListNode(currentList)) {\n // Format is different, toggle list format\n if (currentList.format !== format) {\n Transforms.setNodes(editor, { format }, { at: currentListPath });\n }\n }\n return;\n }\n\n // Let the block handle the Slate conversion logic\n const maybeRenderModal = blocks[optionKey].handleConvert?.(editor);\n handleConversionResult(maybeRenderModal);\n\n setBlockSelected(optionKey);\n\n ReactEditor.focus(editor);\n };\n\n /**\n * Prevent the select from focusing itself so ReactEditor.focus(editor) can focus the editor instead.\n *\n * The editor first loses focus to a blur event when clicking the select button. However,\n * refocusing the editor is not enough since the select's default behavior is to refocus itself\n * after an option is selected.\n *\n */\n const preventSelectFocus = (e: Event) => e.preventDefault();\n\n // Listen to the selection change and update the selected block in the dropdown\n React.useEffect(() => {\n if (editor.selection) {\n let selectedNode: Ancestor;\n\n // If selection anchor is a list-item, get its parent\n const currentListEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n at: editor.selection.anchor,\n });\n\n if (currentListEntry) {\n const [currentList] = currentListEntry;\n selectedNode = currentList;\n } else {\n // Get the parent node of the anchor other than list-item\n const [anchorNode] = Editor.parent(editor, editor.selection.anchor, {\n edge: 'start',\n depth: 2,\n });\n\n // @ts-expect-error slate's delete behaviour creates an exceptional type\n if (anchorNode.type === 'list-item') {\n // When the last node in the selection is a list item,\n // slate's default delete operation leaves an empty list-item instead of converting it into a paragraph.\n // Issue: https://github.com/ianstormtaylor/slate/issues/2500\n\n Transforms.setNodes(editor, { type: 'paragraph' });\n // @ts-expect-error convert explicitly type to paragraph\n selectedNode = { ...anchorNode, type: 'paragraph' };\n } else {\n selectedNode = anchorNode;\n }\n }\n\n // Find the block key that matches the anchor node\n const anchorBlockKey = getKeys(blocks).find(\n (blockKey) => !Editor.isEditor(selectedNode) && blocks[blockKey].matchNode(selectedNode)\n );\n\n // Change the value selected in the dropdown if it doesn't match the anchor block key\n if (anchorBlockKey && anchorBlockKey !== blockSelected) {\n setBlockSelected(anchorBlockKey as SelectorBlockKey);\n }\n }\n }, [editor.selection, editor, blocks, blockSelected]);\n\n const Icon = blocks[blockSelected].icon;\n\n return (\n <>\n <SelectWrapper>\n <SingleSelect\n startIcon={<Icon />}\n onChange={handleSelect}\n placeholder={formatMessage(blocks[blockSelected].label)}\n value={blockSelected}\n onCloseAutoFocus={preventSelectFocus}\n aria-label={formatMessage({\n id: 'components.Blocks.blocks.selectBlock',\n defaultMessage: 'Select a block',\n })}\n disabled={disabled}\n >\n {blockKeysToInclude.map((key) => (\n <BlockOption\n key={key}\n value={key}\n label={blocks[key].label}\n icon={blocks[key].icon}\n blockSelected={blockSelected}\n />\n ))}\n </SingleSelect>\n </SelectWrapper>\n {modalElement}\n </>\n );\n};\n\ninterface BlockOptionProps {\n value: string;\n icon: React.ComponentType<React.SVGProps<SVGElement>>;\n label: MessageDescriptor;\n blockSelected: string;\n}\n\nconst BlockOption = ({ value, icon: Icon, label, blockSelected }: BlockOptionProps) => {\n const { formatMessage } = useIntl();\n\n const isSelected = value === blockSelected;\n\n return (\n <SingleSelectOption\n startIcon={<Icon fill={isSelected ? 'primary600' : 'neutral600'} />}\n value={value}\n >\n {formatMessage(label)}\n </SingleSelectOption>\n );\n};\n\nconst isListNode = (node: unknown): node is Block<'list'> => {\n return Node.isNode(node) && !Editor.isEditor(node) && node.type === 'list';\n};\n\ninterface ListButtonProps {\n block: BlocksStore['list-ordered'] | BlocksStore['list-unordered'];\n format: Block<'list'>['format'];\n location?: 'toolbar' | 'menu';\n}\n\nconst ListButton = ({ block, format, location = 'toolbar' }: ListButtonProps) => {\n const { editor, disabled, blocks } = useBlocksEditorContext('ListButton');\n const { formatMessage } = useIntl();\n\n const isListActive = () => {\n if (!editor.selection) return false;\n\n // Get the parent list at selection anchor node\n const currentListEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n at: editor.selection.anchor,\n });\n\n if (currentListEntry) {\n const [currentList] = currentListEntry;\n if (!Editor.isEditor(currentList) && isListNode(currentList) && currentList.format === format)\n return true;\n }\n return false;\n };\n\n /**\n * @TODO: Currently, applying list while multiple blocks are selected is not supported.\n * We should implement this feature in the future.\n */\n const isListDisabled = () => {\n // Always disabled when the whole editor is disabled\n if (disabled) {\n return true;\n }\n\n // Always enabled when there's no selection\n if (!editor.selection) {\n return false;\n }\n\n // Get the block node closest to the anchor and focus\n const anchorNodeEntry = Editor.above(editor, {\n at: editor.selection.anchor,\n match: (node) => !Editor.isEditor(node) && node.type !== 'text',\n });\n const focusNodeEntry = Editor.above(editor, {\n at: editor.selection.focus,\n match: (node) => !Editor.isEditor(node) && node.type !== 'text',\n });\n\n if (!anchorNodeEntry || !focusNodeEntry) {\n return false;\n }\n\n // Disabled if the anchor and focus are not in the same block\n return anchorNodeEntry[0] !== focusNodeEntry[0];\n };\n\n const toggleList = (format: Block<'list'>['format']) => {\n let currentListEntry;\n if (editor.selection) {\n currentListEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n });\n } else {\n // If no selection, toggle last inserted node\n const [_, lastNodePath] = Editor.last(editor, []);\n currentListEntry = Editor.above(editor, {\n match: (node) => !Editor.isEditor(node) && node.type === 'list',\n at: lastNodePath,\n });\n }\n\n if (!currentListEntry) {\n // If selection is not a list then convert it to list\n blocks[`list-${format}`].handleConvert!(editor);\n return;\n }\n\n // If selection is already a list then toggle format\n const [currentList, currentListPath] = currentListEntry;\n\n if (!Editor.isEditor(currentList) && isListNode(currentList)) {\n if (currentList.format !== format) {\n // Format is different, toggle list format\n Transforms.setNodes(editor, { format }, { at: currentListPath });\n } else {\n // Format is same, convert selected list-item to paragraph\n blocks['paragraph'].handleConvert!(editor);\n }\n }\n };\n\n if (location === 'menu') {\n const Icon = block.icon;\n\n return (\n <StyledMenuItem\n onSelect={() => toggleList(format)}\n isActive={isListActive()}\n disabled={isListDisabled()}\n >\n <Icon />\n {formatMessage(block.label)}\n </StyledMenuItem>\n );\n }\n\n return (\n <ToolbarButton\n icon={block.icon}\n name={format}\n label={block.label}\n isActive={isListActive()}\n disabled={isListDisabled()}\n handleClick={() => toggleList(format)}\n />\n );\n};\n\nconst LinkButton = ({\n disabled,\n location = 'toolbar',\n}: {\n disabled: boolean;\n location?: 'toolbar' | 'menu';\n}) => {\n const { editor } = useBlocksEditorContext('LinkButton');\n const { formatMessage } = useIntl();\n\n const isLinkActive = () => {\n const { selection } = editor;\n\n if (!selection) return false;\n\n const [match] = Array.from(\n Editor.nodes(editor, {\n at: Editor.unhangRange(editor, selection),\n match: (node) => SlateElement.isElement(node) && node.type === 'link',\n })\n );\n\n return Boolean(match);\n };\n\n const isLinkDisabled = () => {\n // Always disabled when the whole editor is disabled\n if (disabled) {\n return true;\n }\n\n // Always enabled when there's no selection\n if (!editor.selection) {\n return false;\n }\n\n // Get the block node closest to the anchor and focus\n const anchorNodeEntry = Editor.above(editor, {\n at: editor.selection.anchor,\n match: (node) => !Editor.isEditor(node) && node.type !== 'text',\n });\n const focusNodeEntry = Editor.above(editor, {\n at: editor.selection.focus,\n match: (node) => !Editor.isEditor(node) && node.type !== 'text',\n });\n\n if (!anchorNodeEntry || !focusNodeEntry) {\n return false;\n }\n\n // Disabled if the anchor and focus are not in the same block\n return anchorNodeEntry[0] !== focusNodeEntry[0];\n };\n\n const addLink = () => {\n editor.shouldSaveLinkPath = true;\n // We insert an empty anchor, so we split the DOM to have a element we can use as reference for the popover\n insertLink(editor, { url: '' });\n };\n\n const label = {\n id: 'components.Blocks.link',\n defaultMessage: 'Link',\n } as MessageDescriptor;\n\n if (location === 'menu') {\n return (\n <StyledMenuItem onSelect={addLink} isActive={isLinkActive()} disabled={isLinkDisabled()}>\n <Link />\n {formatMessage(label)}\n </StyledMenuItem>\n );\n }\n\n return (\n <ToolbarButton\n icon={Link}\n name=\"link\"\n label={label}\n isActive={isLinkActive()}\n handleClick={addLink}\n disabled={isLinkDisabled()}\n />\n );\n};\n\ninterface ObservedToolbarComponentProps {\n index: number;\n lastVisibleIndex: number;\n setLastVisibleIndex: React.Dispatch<React.SetStateAction<number>>;\n rootRef: React.RefObject<HTMLElement>;\n children: React.ReactNode;\n}\n\nconst ObservedToolbarComponent = ({\n index,\n lastVisibleIndex,\n setLastVisibleIndex,\n rootRef,\n children,\n}: ObservedToolbarComponentProps) => {\n const isVisible = index <= lastVisibleIndex;\n\n const containerRef = useElementOnScreen<HTMLDivElement>(\n (isVisible) => {\n /**\n * It's the MoreMenu's job to make an item not visible when there's not room for it.\n * But we need to react here to the element becoming visible again.\n */\n if (isVisible) {\n setLastVisibleIndex((prev) => Math.max(prev, index));\n }\n },\n { threshold: 1, root: rootRef.current }\n );\n\n return (\n <div\n ref={containerRef}\n style={{\n /**\n * Use visibility so that the element occupies the space if requires even when there's not\n * enough room for it to be visible. The empty reserved space will be clipped by the\n * overflow:hidden rule on the parent, so it doesn't affect the UI.\n * This way we can keep observing its visiblity and react to browser resize events.\n */\n visibility: isVisible ? 'visible' : 'hidden',\n }}\n >\n {children}\n </div>\n );\n};\n\ninterface ObservedComponent {\n toolbar: React.ReactNode;\n menu: React.ReactNode;\n key: string;\n}\n\ninterface MoreMenuProps {\n setLastVisibleIndex: React.Dispatch<React.SetStateAction<number>>;\n hasHiddenItems: boolean;\n rootRef: React.RefObject<HTMLElement>;\n children: React.ReactNode;\n}\n\nconst MoreMenu = ({ setLastVisibleIndex, hasHiddenItems, rootRef, children }: MoreMenuProps) => {\n const { formatMessage } = useIntl();\n const containerRef = useElementOnScreen<HTMLButtonElement>(\n (isVisible) => {\n // We only react to the menu becoming invisible. When that happens, we hide the last item.\n if (!isVisible) {\n /**\n * If there's no room for any item, the index can be -1.\n * This is intentional, in that case only the more menu will be visible.\n **/\n setLastVisibleIndex((prev) => prev - 1);\n }\n },\n { threshold: 1, root: rootRef.current }\n );\n\n return (\n <Menu.Root defaultOpen={false}>\n <Menu.Trigger\n endIcon={null}\n paddingLeft={0}\n paddingRight={0}\n ref={containerRef}\n style={{ visibility: hasHiddenItems ? 'visible' : 'hidden' }}\n >\n <IconButton\n variant=\"ghost\"\n label={formatMessage({ id: 'global.more', defaultMessage: 'More' })}\n tag=\"span\"\n >\n <More aria-hidden focusable={false} />\n </IconButton>\n </Menu.Trigger>\n <Menu.Content onCloseAutoFocus={(e) => e.preventDefault()}>{children}</Menu.Content>\n </Menu.Root>\n );\n};\n\nconst StyledMenuItem = styled(Menu.Item)<{ isActive: boolean }>`\n &:hover {\n background-color: ${({ theme }) => theme.colors.primary100};\n }\n\n ${(props) =>\n props.isActive &&\n css`\n font-weight: bold;\n background-color: ${({ theme }) => theme.colors.primary100};\n color: ${({ theme }) => theme.colors.primary600};\n font-weight: bold;\n `}\n\n > span {\n display: inline-flex;\n gap: ${({ theme }) => theme.spaces[2]};\n align-items: center;\n }\n\n svg {\n fill: ${({ theme, isActive }) =>\n isActive ? theme.colors.primary600 : theme.colors.neutral600};\n }\n`;\n\nconst BlocksToolbar = () => {\n const { editor, blocks, modifiers, disabled } = useBlocksEditorContext('BlocksToolbar');\n const { formatMessage } = useIntl();\n\n /**\n * The modifier buttons are disabled when an image is selected.\n */\n const checkButtonDisabled = () => {\n // Always disabled when the whole editor is disabled\n if (disabled) {\n return true;\n }\n\n if (!editor.selection) {\n return false;\n }\n\n const selectedNode = editor.children[editor.selection.anchor.path[0]];\n\n if (['image', 'code'].includes(selectedNode.type)) {\n return true;\n }\n\n return false;\n };\n\n const isButtonDisabled = checkButtonDisabled();\n\n /**\n * Observed components are ones that may or may not be visible in the toolbar, depending on the\n * available space. They provide two render props:\n * - renderInToolbar: for when we try to render the component in the toolbar (may be hidden)\n * - renderInMenu: for when the component didn't fit in the toolbar and is relegated\n * to the \"more\" menu\n */\n const observedComponents: ObservedComponent[] = [\n ...Object.entries(modifiers).map(([name, modifier]) => {\n const Icon = modifier.icon;\n const isActive = modifier.checkIsActive(editor);\n const handleSelect = () => modifier.handleToggle(editor);\n\n return {\n toolbar: (\n <ToolbarButton\n key={name}\n name={name}\n icon={modifier.icon}\n label={modifier.label}\n isActive={modifier.checkIsActive(editor)}\n handleClick={handleSelect}\n disabled={isButtonDisabled}\n />\n ),\n menu: (\n <StyledMenuItem onSelect={handleSelect} isActive={isActive}>\n <Icon />\n {formatMessage(modifier.label)}\n </StyledMenuItem>\n ),\n key: `modifier.${name}`,\n };\n }),\n {\n toolbar: <LinkButton disabled={isButtonDisabled} location=\"toolbar\" />,\n menu: <LinkButton disabled={isButtonDisabled} location=\"menu\" />,\n key: 'block.link',\n },\n {\n // List buttons can only be rendered together when in the toolbar\n toolbar: (\n <Flex direction=\"row\" gap={1}>\n <ToolbarSeparator />\n <Toolbar.ToggleGroup type=\"single\" asChild>\n <Flex gap={1}>\n <ListButton block={blocks['list-unordered']} format=\"unordered\" location=\"toolbar\" />\n <ListButton block={blocks['list-ordered']} format=\"ordered\" location=\"toolbar\" />\n </Flex>\n </Toolbar.ToggleGroup>\n </Flex>\n ),\n menu: (\n <>\n <Menu.Separator />\n <ListButton block={blocks['list-unordered']} format=\"unordered\" location=\"menu\" />\n <ListButton block={blocks['list-ordered']} format=\"ordered\" location=\"menu\" />\n </>\n ),\n key: 'block.list',\n },\n ];\n\n return (\n <Toolbar.Root aria-disabled={disabled} asChild>\n <ToolbarWrapper gap={2} padding={2} width=\"100%\">\n <BlocksDropdown />\n <ToolbarSeparator />\n <Toolbar.ToggleGroup type=\"multiple\" asChild>\n <Flex direction=\"row\" gap={1} grow={1} overflow=\"hidden\">\n <EditorToolbarObserver observedComponents={observedComponents} />\n </Flex>\n </Toolbar.ToggleGroup>\n </ToolbarWrapper>\n </Toolbar.Root>\n );\n};\n\nexport { BlocksToolbar, useConversionModal };\n","import * as React from 'react';\n\nimport {\n Box,\n BoxComponent,\n Flex,\n FlexComponent,\n IconButton,\n IconButtonComponent,\n useComposedRefs,\n} from '@strapi/design-system';\nimport { Drag } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { Editor, Range, Transforms } from 'slate';\nimport { ReactEditor, type RenderElementProps, type RenderLeafProps, Editable } from 'slate-react';\nimport { styled, CSSProperties, css } from 'styled-components';\n\nimport { ItemTypes } from '../../../../../constants/dragAndDrop';\nimport { useDragAndDrop, DIRECTIONS } from '../../../../../hooks/useDragAndDrop';\nimport { getTranslation } from '../../../../../utils/translations';\n\nimport { decorateCode } from './Blocks/Code';\nimport { type BlocksStore, useBlocksEditorContext } from './BlocksEditor';\nimport { useConversionModal } from './BlocksToolbar';\nimport { type ModifiersStore } from './Modifiers';\nimport { getEntries, isLinkNode, isListNode } from './utils/types';\n\nconst StyledEditable = styled(Editable)<{ isExpandedMode: boolean }>`\n // The outline style is set on the wrapper with :focus-within\n outline: none;\n display: flex;\n flex-direction: column;\n gap: ${({ theme }) => theme.spaces[3]};\n height: 100%;\n // For fullscreen align input in the center with fixed width\n width: ${(props) => (props.isExpandedMode ? '512px' : '100%')};\n margin: auto;\n\n > *:last-child {\n padding-bottom: ${({ theme }) => theme.spaces[3]};\n }\n`;\n\nconst Wrapper = styled<BoxComponent>(Box)<{ isOverDropTarget: boolean }>`\n position: ${({ isOverDropTarget }) => isOverDropTarget && 'relative'};\n`;\n\ntype DragDirection = (typeof DIRECTIONS)[keyof typeof DIRECTIONS];\n\nconst DropPlaceholder = styled<BoxComponent>(Box)<{\n dragDirection: DragDirection | null;\n placeholderMargin: 1 | 2;\n}>`\n position: absolute;\n right: 0;\n\n // Show drop placeholder 8px above or below the drop target\n ${({ dragDirection, theme, placeholderMargin }) => css`\n top: ${dragDirection === DIRECTIONS.UPWARD && `-${theme.spaces[placeholderMargin]}`};\n bottom: ${dragDirection === DIRECTIONS.DOWNWARD && `-${theme.spaces[placeholderMargin]}`};\n `}\n`;\n\nconst DragItem = styled<FlexComponent>(Flex)<{ $dragVisibility: CSSProperties['visibility'] }>`\n // Style each block rendered using renderElement()\n & > [data-slate-node='element'] {\n width: 100%;\n opacity: inherit;\n }\n\n // Set the visibility of drag button\n [role='button'] {\n visibility: ${(props) => props.$dragVisibility};\n opacity: inherit;\n }\n &[aria-disabled='true'] {\n user-drag: none;\n }\n`;\n\nconst DragIconButton = styled<IconButtonComponent<'div'>>(IconButton)<{\n $dragHandleTopMargin?: CSSProperties['marginTop'];\n}>`\n user-select: none;\n display: flex;\n align-items: center;\n justify-content: center;\n border: none;\n border-radius: ${({ theme }) => theme.borderRadius};\n padding-left: ${({ theme }) => theme.spaces[0]};\n padding-right: ${({ theme }) => theme.spaces[0]};\n padding-top: ${({ theme }) => theme.spaces[1]};\n padding-bottom: ${({ theme }) => theme.spaces[1]};\n visibility: hidden;\n cursor: grab;\n opacity: inherit;\n margin-top: ${(props) => props.$dragHandleTopMargin ?? 0};\n\n &:hover {\n background: ${({ theme }) => theme.colors.neutral100};\n }\n &:active {\n cursor: grabbing;\n background: ${({ theme }) => theme.colors.neutral150};\n }\n &[aria-disabled='true'] {\n visibility: hidden;\n }\n svg {\n min-width: ${({ theme }) => theme.spaces[3]};\n\n path {\n fill: ${({ theme }) => theme.colors.neutral500};\n }\n }\n`;\n\ntype Direction = {\n setDragDirection: (direction: DragDirection) => void;\n dragDirection: DragDirection | null;\n};\n\ntype DragAndDropElementProps = Direction & {\n children: RenderElementProps['children'];\n index: Array<number>;\n dragHandleTopMargin?: CSSProperties['marginTop'];\n};\n\nconst DragAndDropElement = ({\n children,\n index,\n setDragDirection,\n dragDirection,\n dragHandleTopMargin,\n}: DragAndDropElementProps) => {\n const { editor, disabled, name, setLiveText } = useBlocksEditorContext('drag-and-drop');\n const { formatMessage } = useIntl();\n const [dragVisibility, setDragVisibility] = React.useState<CSSProperties['visibility']>('hidden');\n\n const handleMoveBlock = React.useCallback(\n (newIndex: Array<number>, currentIndex: Array<number>) => {\n Transforms.moveNodes(editor, {\n at: currentIndex,\n to: newIndex,\n });\n\n // Add 1 to the index for the live text message\n const currentIndexPosition = [currentIndex[0] + 1, ...currentIndex.slice(1)];\n const newIndexPosition = [newIndex[0] + 1, ...newIndex.slice(1)];\n\n setLiveText(\n formatMessage(\n {\n id: getTranslation('components.Blocks.dnd.reorder'),\n defaultMessage: '{item}, moved. New position in the editor: {position}.',\n },\n {\n item: `${name}.${currentIndexPosition.join(',')}`,\n position: `${newIndexPosition.join(',')} of ${editor.children.length}`,\n }\n )\n );\n },\n [editor, formatMessage, name, setLiveText]\n );\n\n const [{ handlerId, isDragging, isOverDropTarget, direction }, blockRef, dropRef, dragRef] =\n useDragAndDrop(!disabled, {\n type: `${ItemTypes.BLOCKS}_${name}`,\n index,\n item: {\n index,\n displayedValue: children,\n },\n onDropItem(currentIndex, newIndex) {\n if (newIndex) handleMoveBlock(newIndex, currentIndex);\n },\n });\n\n const composedBoxRefs = useComposedRefs(blockRef, dropRef);\n\n // Set Drag direction before loosing state while dragging\n React.useEffect(() => {\n if (direction) {\n setDragDirection(direction);\n }\n }, [direction, setDragDirection]);\n\n // On selection change hide drag handle\n React.useEffect(() => {\n setDragVisibility('hidden');\n }, [editor.selection]);\n\n return (\n <Wrapper ref={composedBoxRefs} isOverDropTarget={isOverDropTarget}>\n {isOverDropTarget && (\n <DropPlaceholder\n borderStyle=\"solid\"\n borderColor=\"secondary200\"\n borderWidth=\"2px\"\n width=\"calc(100% - 24px)\"\n marginLeft=\"auto\"\n dragDirection={dragDirection}\n // For list items placeholder reduce the margin around\n placeholderMargin={children.props.as && children.props.as === 'li' ? 1 : 2}\n />\n )}\n {isDragging ? (\n <CloneDragItem dragHandleTopMargin={dragHandleTopMargin}>{children}</CloneDragItem>\n ) : (\n <DragItem\n ref={dragRef}\n data-handler-id={handlerId}\n gap={2}\n paddingLeft={2}\n alignItems=\"start\"\n onDragStart={(event) => {\n const target = event.target as HTMLElement;\n const currentTarget = event.currentTarget as HTMLElement;\n\n // Dragging action should only trigger drag event when button is dragged, however update styles on the whole dragItem.\n if (target.getAttribute('role') !== 'button') {\n event.preventDefault();\n } else {\n // Setting styles using dragging state is not working, so set it on current target element as nodes get dragged\n currentTarget.style.opacity = '0.5';\n }\n }}\n onDragEnd={(event) => {\n const currentTarget = event.currentTarget as HTMLElement;\n currentTarget.style.opacity = '1';\n }}\n onMouseMove={() => setDragVisibility('visible')}\n onSelect={() => setDragVisibility('visible')}\n onMouseLeave={() => setDragVisibility('hidden')}\n aria-disabled={disabled}\n $dragVisibility={dragVisibility}\n >\n <DragIconButton\n tag=\"div\"\n contentEditable={false}\n role=\"button\"\n tabIndex={0}\n withTooltip={false}\n label={formatMessage({\n id: getTranslation('components.DragHandle-label'),\n defaultMessage: 'Drag',\n })}\n onClick={(e) => e.stopPropagation()}\n aria-disabled={disabled}\n disabled={disabled}\n draggable\n // For some blocks top margin added to drag handle to align at the text level\n $dragHandleTopMargin={dragHandleTopMargin}\n >\n <Drag color=\"primary500\" />\n </DragIconButton>\n {children}\n </DragItem>\n )}\n </Wrapper>\n );\n};\n\ninterface CloneDragItemProps {\n children: RenderElementProps['children'];\n dragHandleTopMargin?: CSSProperties['marginTop'];\n}\n\n// To prevent applying opacity to the original item being dragged, display a cloned element without opacity.\nconst CloneDragItem = ({ children, dragHandleTopMargin }: CloneDragItemProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <DragItem gap={2} paddingLeft={2} alignItems=\"start\" $dragVisibility=\"visible\">\n <DragIconButton\n tag=\"div\"\n role=\"button\"\n withTooltip={false}\n label={formatMessage({\n id: getTranslation('components.DragHandle-label'),\n defaultMessage: 'Drag',\n })}\n $dragHandleTopMargin={dragHandleTopMargin}\n >\n <Drag color=\"neutral600\" />\n </DragIconButton>\n {children}\n </DragItem>\n );\n};\n\ninterface ExtendedRenderLeafProps extends RenderLeafProps {\n leaf: RenderLeafProps['leaf'] & { className?: string };\n}\n\nconst baseRenderLeaf = (props: ExtendedRenderLeafProps, modifiers: ModifiersStore) => {\n // Recursively wrap the children for each active modifier\n const wrappedChildren = getEntries(modifiers).reduce((currentChildren, modifierEntry) => {\n const [name, modifier] = modifierEntry;\n\n if (props.leaf[name]) {\n return modifier.renderLeaf(currentChildren);\n }\n\n return currentChildren;\n }, props.children);\n\n return (\n <span {...props.attributes} className={props.leaf.className}>\n {wrappedChildren}\n </span>\n );\n};\n\ntype BaseRenderElementProps = Direction & {\n props: RenderElementProps['children'];\n blocks: BlocksStore;\n editor: Editor;\n};\n\nconst baseRenderElement = ({\n props,\n blocks,\n editor,\n setDragDirection,\n dragDirection,\n}: BaseRenderElementProps) => {\n const { element } = props;\n\n const blockMatch = Object.values(blocks).find((block) => block.matchNode(element));\n const block = blockMatch || blocks.paragraph;\n const nodePath = ReactEditor.findPath(editor, element);\n\n // Link is inline block so it cannot be dragged\n // List items and nested list blocks i.e. lists with indent level higher than 0 are skipped from dragged items\n if (\n isLinkNode(element) ||\n (isListNode(element) && element.indentLevel && element.indentLevel > 0) ||\n element.type === 'list-item'\n ) {\n return block.renderElement(props);\n }\n\n return (\n <DragAndDropElement\n index={nodePath}\n setDragDirection={setDragDirection}\n dragDirection={dragDirection}\n dragHandleTopMargin={block.dragHandleTopMargin}\n >\n {block.renderElement(props)}\n </DragAndDropElement>\n );\n};\n\ninterface BlocksContentProps {\n placeholder?: string;\n ariaLabelId: string;\n}\n\nconst BlocksContent = ({ placeholder, ariaLabelId }: BlocksContentProps) => {\n const { editor, disabled, blocks, modifiers, setLiveText, isExpandedMode } =\n useBlocksEditorContext('BlocksContent');\n const blocksRef = React.useRef<HTMLDivElement>(null);\n const { formatMessage } = useIntl();\n const [dragDirection, setDragDirection] = React.useState<DragDirection | null>(null);\n const { modalElement, handleConversionResult } = useConversionModal();\n\n // Create renderLeaf function based on the modifiers store\n const renderLeaf = React.useCallback(\n (props: ExtendedRenderLeafProps) => baseRenderLeaf(props, modifiers),\n [modifiers]\n );\n\n const handleMoveBlocks = (editor: Editor, event: React.KeyboardEvent<HTMLElement>) => {\n if (!editor.selection) return;\n\n const start = Range.start(editor.selection);\n const currentIndex = [start.path[0]];\n let newIndexPosition = 0;\n\n if (event.key === 'ArrowUp') {\n newIndexPosition = currentIndex[0] > 0 ? currentIndex[0] - 1 : currentIndex[0];\n } else {\n newIndexPosition =\n currentIndex[0] < editor.children.length - 1 ? currentIndex[0] + 1 : currentIndex[0];\n }\n\n const newIndex = [newIndexPosition];\n\n if (newIndexPosition !== currentIndex[0]) {\n Transforms.moveNodes(editor, {\n at: currentIndex,\n to: newIndex,\n });\n\n setLiveText(\n formatMessage(\n {\n id: getTranslation('components.Blocks.dnd.reorder'),\n defaultMessage: '{item}, moved. New position in the editor: {position}.',\n },\n {\n item: `${name}.${currentIndex[0] + 1}`,\n position: `${newIndex[0] + 1} of ${editor.children.length}`,\n }\n )\n );\n\n event.preventDefault();\n }\n };\n\n // Create renderElement function base on the blocks store\n const renderElement = React.useCallback(\n (props: RenderElementProps) =>\n baseRenderElement({ props, blocks, editor, dragDirection, setDragDirection }),\n [blocks, editor, dragDirection, setDragDirection]\n );\n\n const checkSnippet = (event: React.KeyboardEvent<HTMLElement>) => {\n // Get current text block\n if (!editor.selection) {\n return;\n }\n\n const [textNode, textNodePath] = Editor.node(editor, editor.selection.anchor.path);\n\n // Narrow the type to a text node\n if (Editor.isEditor(textNode) || textNode.type !== 'text') {\n return;\n }\n\n // Don't check for snippets if we're not at the start of a block\n if (textNodePath.at(-1) !== 0) {\n return;\n }\n\n // Check if the text node starts with a known snippet\n const blockMatchingSnippet = Object.values(blocks).find((block) => {\n return block.snippets?.includes(textNode.text);\n });\n\n if (blockMatchingSnippet?.handleConvert) {\n // Prevent the space from being created and delete the snippet\n event.preventDefault();\n Transforms.delete(editor, {\n distance: textNode.text.length,\n unit: 'character',\n reverse: true,\n });\n\n // Convert the selected block\n const maybeRenderModal = blockMatchingSnippet.handleConvert(editor);\n handleConversionResult(maybeRenderModal);\n }\n };\n\n const handleEnter = (event: React.KeyboardEvent<HTMLElement>) => {\n if (!editor.selection) {\n return;\n }\n\n const selectedNode = editor.children[editor.selection.anchor.path[0]];\n const selectedBlock = Object.values(blocks).find((block) => block.matchNode(selectedNode));\n if (!selectedBlock) {\n return;\n }\n\n // Allow forced line breaks when shift is pressed\n if (event.shiftKey && selectedNode.type !== 'image') {\n Transforms.insertText(editor, '\\n');\n return;\n }\n\n // Check if there's an enter handler for the selected block\n if (selectedBlock.handleEnterKey) {\n selectedBlock.handleEnterKey(editor);\n } else {\n blocks.paragraph.handleEnterKey!(editor);\n }\n };\n\n const handleBackspaceEvent = (event: React.KeyboardEvent<HTMLElement>) => {\n if (!editor.selection) {\n return;\n }\n\n const selectedNode = editor.children[editor.selection.anchor.path[0]];\n const selectedBlock = Object.values(blocks).find((block) => block.matchNode(selectedNode));\n\n if (!selectedBlock) {\n return;\n }\n\n if (selectedBlock.handleBackspaceKey) {\n selectedBlock.handleBackspaceKey(editor, event);\n }\n };\n\n const handleTab = (event: React.KeyboardEvent<HTMLElement>) => {\n if (!editor.selection) {\n return;\n }\n\n const selectedNode = editor.children[editor.selection.anchor.path[0]];\n const selectedBlock = Object.values(blocks).find((block) => block.matchNode(selectedNode));\n if (!selectedBlock) {\n return;\n }\n\n if (selectedBlock.handleTab) {\n event.preventDefault();\n selectedBlock.handleTab(editor);\n }\n };\n\n const handleKeyboardShortcuts = (event: React.KeyboardEvent<HTMLElement>) => {\n const isCtrlOrCmd = event.metaKey || event.ctrlKey;\n\n if (isCtrlOrCmd) {\n // Check if there's a modifier to toggle\n Object.values(modifiers).forEach((value) => {\n if (value.isValidEventKey(event)) {\n value.handleToggle(editor);\n return;\n }\n });\n if (event.shiftKey && ['ArrowUp', 'ArrowDown'].includes(event.key)) {\n handleMoveBlocks(editor, event);\n }\n }\n };\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLElement> = (event) => {\n // Find the right block-specific handlers for enter and backspace key presses\n switch (event.key) {\n case 'Enter':\n event.preventDefault();\n return handleEnter(event);\n case 'Backspace':\n return handleBackspaceEvent(event);\n case 'Tab':\n return handleTab(event);\n case 'Escape':\n return ReactEditor.blur(editor);\n }\n\n handleKeyboardShortcuts(event);\n\n // Check if a snippet was triggered\n if (event.key === ' ') {\n checkSnippet(event);\n }\n };\n\n /**\n * scrollSelectionIntoView : Slate's default method to scroll a DOM selection into the view,\n * thats shifting layout for us when there is a overflowY:scroll on the viewport.\n * We are overriding it to check if the selection is not fully within the visible area of the editor,\n * we use scrollBy one line to the bottom\n */\n const handleScrollSelectionIntoView = () => {\n if (!editor.selection) return;\n const domRange = ReactEditor.toDOMRange(editor, editor.selection);\n const domRect = domRange.getBoundingClientRect();\n const blocksInput = blocksRef.current;\n\n if (!blocksInput) {\n return;\n }\n\n const editorRect = blocksInput.getBoundingClientRect();\n\n // Check if the selection is not fully within the visible area of the editor\n if (domRect.top < editorRect.top || domRect.bottom > editorRect.bottom) {\n // Scroll by one line to the bottom\n blocksInput.scrollBy({\n top: 28, // 20px is the line-height + 8px line gap\n behavior: 'smooth',\n });\n }\n };\n\n return (\n <Box\n ref={blocksRef}\n grow={1}\n width=\"100%\"\n overflow=\"auto\"\n fontSize={2}\n background=\"neutral0\"\n color=\"neutral800\"\n lineHeight={6}\n paddingRight={7}\n paddingTop={6}\n paddingBottom={3}\n >\n <StyledEditable\n aria-labelledby={ariaLabelId}\n readOnly={disabled}\n placeholder={placeholder}\n isExpandedMode={isExpandedMode}\n decorate={decorateCode}\n renderElement={renderElement}\n renderLeaf={renderLeaf}\n onKeyDown={handleKeyDown}\n scrollSelectionIntoView={handleScrollSelectionIntoView}\n // As we have our own handler to drag and drop the elements returing true will skip slate's own event handler\n onDrop={() => {\n return true;\n }}\n onDragStart={() => {\n return true;\n }}\n />\n {modalElement}\n </Box>\n );\n};\n\nexport { BlocksContent, BlocksContentProps };\n","import * as React from 'react';\n\nimport { Box, Flex, FocusTrap, Portal, IconButton, FlexComponent } from '@strapi/design-system';\nimport { Collapse } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { css, styled } from 'styled-components';\n\nimport { getTranslation } from '../../../../../utils/translations';\n\nimport { useBlocksEditorContext } from './BlocksEditor';\n\nconst CollapseIconButton = styled(IconButton)`\n position: absolute;\n bottom: 1.2rem;\n right: 1.2rem;\n`;\n\nconst ExpandWrapper = styled<FlexComponent>(Flex)`\n // Background with 20% opacity\n background: ${({ theme }) => `${theme.colors.neutral800}1F`};\n`;\n\ninterface EditorLayoutProps {\n children: React.ReactNode;\n error?: string;\n onCollapse: () => void;\n disabled: boolean;\n ariaDescriptionId: string;\n}\n\nconst EditorLayout = ({\n children,\n error,\n disabled,\n onCollapse,\n ariaDescriptionId,\n}: EditorLayoutProps) => {\n const { formatMessage } = useIntl();\n const { isExpandedMode } = useBlocksEditorContext('editorLayout');\n\n React.useEffect(() => {\n if (isExpandedMode) {\n document.body.classList.add('lock-body-scroll');\n }\n\n return () => {\n document.body.classList.remove('lock-body-scroll');\n };\n }, [isExpandedMode]);\n\n if (isExpandedMode) {\n return (\n <Portal role=\"dialog\" aria-modal={false}>\n <FocusTrap onEscape={onCollapse}>\n <ExpandWrapper\n position=\"fixed\"\n top={0}\n left={0}\n right={0}\n bottom={0}\n zIndex={4}\n justifyContent=\"center\"\n onClick={onCollapse}\n >\n <Box<'div'>\n background=\"neutral0\"\n hasRadius\n shadow=\"popupShadow\"\n overflow=\"hidden\"\n width=\"90%\"\n height=\"90%\"\n onClick={(e) => e.stopPropagation()}\n aria-describedby={ariaDescriptionId}\n position=\"relative\"\n >\n <Flex height=\"100%\" alignItems=\"flex-start\" direction=\"column\">\n {children}\n <CollapseIconButton\n label={formatMessage({\n id: getTranslation('components.Blocks.collapse'),\n defaultMessage: 'Collapse',\n })}\n onClick={onCollapse}\n >\n <Collapse />\n </CollapseIconButton>\n </Flex>\n </Box>\n </ExpandWrapper>\n </FocusTrap>\n </Portal>\n );\n }\n\n return (\n <InputWrapper\n direction=\"column\"\n alignItems=\"flex-start\"\n height=\"512px\"\n $disabled={disabled}\n $hasError={Boolean(error)}\n style={{ overflow: 'hidden' }}\n aria-describedby={ariaDescriptionId}\n position=\"relative\"\n >\n {children}\n </InputWrapper>\n );\n};\n\nconst InputWrapper = styled<FlexComponent>(Flex)<{ $disabled?: boolean; $hasError?: boolean }>`\n border: 1px solid\n ${({ theme, $hasError }) => ($hasError ? theme.colors.danger600 : theme.colors.neutral200)};\n border-radius: ${({ theme }) => theme.borderRadius};\n background: ${({ theme }) => theme.colors.neutral0};\n\n ${({ theme, $hasError = false }) => css`\n outline: none;\n box-shadow: 0;\n transition-property: border-color, box-shadow, fill;\n transition-duration: 0.2s;\n\n &:focus-within {\n border: 1px solid ${$hasError ? theme.colors.danger600 : theme.colors.primary600};\n box-shadow: ${$hasError ? theme.colors.danger600 : theme.colors.primary600} 0px 0px 0px 2px;\n }\n `}\n\n ${({ theme, $disabled }) =>\n $disabled\n ? css`\n color: ${theme.colors.neutral600};\n background: ${theme.colors.neutral150};\n `\n : undefined}\n`;\n\nexport { EditorLayout };\n","import * as React from 'react';\n\nimport { Typography, TypographyComponent } from '@strapi/design-system';\nimport { Bold, Italic, Underline, StrikeThrough, Code } from '@strapi/icons';\nimport { type MessageDescriptor } from 'react-intl';\nimport { Editor, Text, Transforms } from 'slate';\nimport { styled, css } from 'styled-components';\n\nconst stylesToInherit = css`\n font-size: inherit;\n color: inherit;\n line-height: inherit;\n`;\n\nconst BoldText = styled<TypographyComponent>(Typography).attrs({ fontWeight: 'bold' })`\n ${stylesToInherit}\n`;\n\nconst ItalicText = styled<TypographyComponent>(Typography)`\n font-style: italic;\n ${stylesToInherit}\n`;\n\nconst UnderlineText = styled<TypographyComponent>(Typography).attrs({\n textDecoration: 'underline',\n})`\n ${stylesToInherit}\n`;\n\nconst StrikeThroughText = styled<TypographyComponent>(Typography).attrs({\n textDecoration: 'line-through',\n})`\n ${stylesToInherit}\n`;\n\nconst InlineCode = styled.code`\n background-color: ${({ theme }) => theme.colors.neutral150};\n border-radius: ${({ theme }) => theme.borderRadius};\n padding: ${({ theme }) => `0 ${theme.spaces[2]}`};\n font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas,\n monospace;\n color: inherit;\n`;\n\ntype ModifierKey = Exclude<keyof Text, 'type' | 'text'>;\n\ntype ModifiersStore = {\n [K in ModifierKey]: {\n icon: React.ComponentType;\n isValidEventKey: (event: React.KeyboardEvent<HTMLElement>) => boolean;\n label: MessageDescriptor;\n checkIsActive: (editor: Editor) => boolean;\n handleToggle: (editor: Editor) => void;\n renderLeaf: (children: React.JSX.Element | string) => React.JSX.Element;\n };\n};\n\n/**\n * The default handler for checking if a modifier is active\n */\nconst baseCheckIsActive = (editor: Editor, name: ModifierKey) => {\n const marks = Editor.marks(editor);\n if (!marks) return false;\n\n return Boolean(marks[name]);\n};\n\n/**\n * The default handler for toggling a modifier\n */\nconst baseHandleToggle = (editor: Editor, name: ModifierKey) => {\n const marks = Editor.marks(editor);\n\n // If there is no selection, set selection to the end of line\n if (!editor.selection) {\n const endOfEditor = Editor.end(editor, []);\n Transforms.select(editor, endOfEditor);\n }\n\n // Toggle the modifier\n if (marks?.[name]) {\n Editor.removeMark(editor, name);\n } else {\n Editor.addMark(editor, name, true);\n }\n};\n\nconst modifiers: ModifiersStore = {\n bold: {\n icon: Bold,\n isValidEventKey: (event) => event.key === 'b',\n label: { id: 'components.Blocks.modifiers.bold', defaultMessage: 'Bold' },\n checkIsActive: (editor) => baseCheckIsActive(editor, 'bold'),\n handleToggle: (editor) => baseHandleToggle(editor, 'bold'),\n renderLeaf: (children) => <BoldText>{children}</BoldText>,\n },\n italic: {\n icon: Italic,\n isValidEventKey: (event) => event.key === 'i',\n label: { id: 'components.Blocks.modifiers.italic', defaultMessage: 'Italic' },\n checkIsActive: (editor) => baseCheckIsActive(editor, 'italic'),\n handleToggle: (editor) => baseHandleToggle(editor, 'italic'),\n renderLeaf: (children) => <ItalicText>{children}</ItalicText>,\n },\n underline: {\n icon: Underline,\n isValidEventKey: (event) => event.key === 'u',\n label: { id: 'components.Blocks.modifiers.underline', defaultMessage: 'Underline' },\n checkIsActive: (editor) => baseCheckIsActive(editor, 'underline'),\n handleToggle: (editor) => baseHandleToggle(editor, 'underline'),\n renderLeaf: (children) => <UnderlineText>{children}</UnderlineText>,\n },\n strikethrough: {\n icon: StrikeThrough,\n isValidEventKey: (event) => event.key === 'S' && event.shiftKey,\n label: { id: 'components.Blocks.modifiers.strikethrough', defaultMessage: 'Strikethrough' },\n checkIsActive: (editor) => baseCheckIsActive(editor, 'strikethrough'),\n handleToggle: (editor) => baseHandleToggle(editor, 'strikethrough'),\n renderLeaf: (children) => <StrikeThroughText>{children}</StrikeThroughText>,\n },\n code: {\n icon: Code,\n isValidEventKey: (event) => event.key === 'e',\n label: { id: 'components.Blocks.modifiers.code', defaultMessage: 'Inline code' },\n checkIsActive: (editor) => baseCheckIsActive(editor, 'code'),\n handleToggle: (editor) => baseHandleToggle(editor, 'code'),\n renderLeaf: (children) => <InlineCode>{children}</InlineCode>,\n },\n};\n\nexport { type ModifiersStore, modifiers };\n","import { type Editor } from 'slate';\n\n/**\n * Images are void elements. They handle the rendering of their children instead of Slate.\n * See the Slate documentation for more information:\n * - https://docs.slatejs.org/api/nodes/element#void-vs-not-void\n * - https://docs.slatejs.org/api/nodes/element#rendering-void-elements\n */\nconst withImages = (editor: Editor) => {\n const { isVoid } = editor;\n\n editor.isVoid = (element) => {\n return element.type === 'image' ? true : isVoid(element);\n };\n\n return editor;\n};\n\nexport { withImages };\n","import { type BaseEditor, Path, Transforms, Range, Point, Editor } from 'slate';\n\nimport { insertLink } from '../utils/links';\n\ninterface LinkEditor extends BaseEditor {\n lastInsertedLinkPath: Path | null;\n shouldSaveLinkPath: boolean;\n}\n\nconst withLinks = (editor: Editor) => {\n const { isInline, apply, insertText, insertData } = editor;\n\n // Links are inline elements, so we need to override the isInline method for slate\n editor.isInline = (element) => {\n return element.type === 'link' ? true : isInline(element);\n };\n\n // We keep a track of the last inserted link path\n // So we can show the popover on the link component if that link is the last one inserted\n editor.lastInsertedLinkPath = null;\n\n // We intercept the apply method, so everytime we insert a new link, we save its path\n editor.apply = (operation) => {\n if (operation.type === 'insert_node') {\n if (\n !Editor.isEditor(operation.node) &&\n operation.node.type === 'link' &&\n editor.shouldSaveLinkPath\n ) {\n editor.lastInsertedLinkPath = operation.path;\n }\n } else if (operation.type === 'move_node') {\n // We need to update the last inserted link path when link is moved\n // If link is the first word in the paragraph we dont need to update the path\n if (\n Path.hasPrevious(operation.path) &&\n editor.lastInsertedLinkPath &&\n editor.shouldSaveLinkPath\n ) {\n editor.lastInsertedLinkPath = Path.transform(editor.lastInsertedLinkPath, operation);\n }\n }\n\n apply(operation);\n };\n\n editor.insertText = (text) => {\n // When selection is at the end of a link and user types a space, we want to break the link\n if (editor.selection && Range.isCollapsed(editor.selection) && text === ' ') {\n const linksInSelection = Array.from(\n Editor.nodes(editor, {\n at: editor.selection,\n match: (node) => !Editor.isEditor(node) && node.type === 'link',\n })\n );\n\n const selectionIsInLink = editor.selection && linksInSelection.length > 0;\n const selectionIsAtEndOfLink =\n selectionIsInLink &&\n Point.equals(editor.selection.anchor, Editor.end(editor, linksInSelection[0][1]));\n\n if (selectionIsAtEndOfLink) {\n Transforms.insertNodes(\n editor,\n { text: ' ', type: 'text' },\n { at: Path.next(linksInSelection[0][1]), select: true }\n );\n\n return;\n }\n }\n\n insertText(text);\n };\n\n // Add data as a clickable link if its a valid URL\n editor.insertData = (data) => {\n const pastedText = data.getData('text/plain');\n\n if (pastedText) {\n try {\n // eslint-disable-next-line no-new\n new URL(pastedText);\n // Do not show link popup on copy-paste a link, so do not save its path\n editor.shouldSaveLinkPath = false;\n insertLink(editor, { url: pastedText });\n return;\n } catch (error) {\n // continue normal data insertion\n }\n }\n\n insertData(data);\n };\n\n return editor;\n};\n\nexport { withLinks, type LinkEditor };\n","import { type Text, Node, Editor, Element, Transforms } from 'slate';\n\nconst isText = (node: unknown): node is Text => {\n return Node.isNode(node) && !Editor.isEditor(node) && node.type === 'text';\n};\n\n/**\n * This plugin is used to normalize the Slate document to match the Strapi schema.\n */\nconst withStrapiSchema = (editor: Editor) => {\n const { normalizeNode } = editor;\n\n /**\n * On the strapi schema, we want text nodes to have type: text\n * By default, Slate add text nodes without type: text\n * So we add this normalization for the cases when Slate add text nodes automatically\n */\n editor.normalizeNode = (entry) => {\n const [node, path] = entry;\n\n if (!Element.isElement(node) && !isText(node)) {\n Transforms.setNodes(editor, { type: 'text' }, { at: path });\n\n return;\n }\n\n normalizeNode(entry);\n };\n\n return editor;\n};\n\nexport { withStrapiSchema };\n","import * as React from 'react';\n\nimport { createContext, type FieldValue } from '@strapi/admin/strapi-admin';\nimport { IconButton, Divider, VisuallyHidden } from '@strapi/design-system';\nimport { Expand } from '@strapi/icons';\nimport { MessageDescriptor, useIntl } from 'react-intl';\nimport { Editor, type Descendant, createEditor } from 'slate';\nimport { withHistory } from 'slate-history';\nimport { type RenderElementProps, Slate, withReact, ReactEditor, useSlate } from 'slate-react';\nimport { styled, type CSSProperties } from 'styled-components';\n\nimport { getTranslation } from '../../../../../utils/translations';\n\nimport { codeBlocks } from './Blocks/Code';\nimport { headingBlocks } from './Blocks/Heading';\nimport { imageBlocks } from './Blocks/Image';\nimport { linkBlocks } from './Blocks/Link';\nimport { listBlocks } from './Blocks/List';\nimport { paragraphBlocks } from './Blocks/Paragraph';\nimport { quoteBlocks } from './Blocks/Quote';\nimport { BlocksContent, type BlocksContentProps } from './BlocksContent';\nimport { BlocksToolbar } from './BlocksToolbar';\nimport { EditorLayout } from './EditorLayout';\nimport { type ModifiersStore, modifiers } from './Modifiers';\nimport { withImages } from './plugins/withImages';\nimport { withLinks } from './plugins/withLinks';\nimport { withStrapiSchema } from './plugins/withStrapiSchema';\n\nimport type { Schema } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * BlocksEditorProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface BaseBlock {\n renderElement: (props: RenderElementProps) => React.JSX.Element;\n matchNode: (node: Schema.Attribute.BlocksNode) => boolean;\n handleConvert?: (editor: Editor) => void | (() => React.JSX.Element);\n handleEnterKey?: (editor: Editor) => void;\n handleBackspaceKey?: (editor: Editor, event: React.KeyboardEvent<HTMLElement>) => void;\n handleTab?: (editor: Editor) => void;\n snippets?: string[];\n dragHandleTopMargin?: CSSProperties['marginTop'];\n}\n\ninterface NonSelectorBlock extends BaseBlock {\n isInBlocksSelector: false;\n}\n\ninterface SelectorBlock extends BaseBlock {\n isInBlocksSelector: true;\n icon: React.ComponentType;\n label: MessageDescriptor;\n}\n\ntype NonSelectorBlockKey = 'list-item' | 'link';\n\nconst selectorBlockKeys = [\n 'paragraph',\n 'heading-one',\n 'heading-two',\n 'heading-three',\n 'heading-four',\n 'heading-five',\n 'heading-six',\n 'list-ordered',\n 'list-unordered',\n 'image',\n 'quote',\n 'code',\n] as const;\n\ntype SelectorBlockKey = (typeof selectorBlockKeys)[number];\n\nconst isSelectorBlockKey = (key: unknown): key is SelectorBlockKey => {\n return typeof key === 'string' && selectorBlockKeys.includes(key as SelectorBlockKey);\n};\n\ntype BlocksStore = {\n [K in SelectorBlockKey]: SelectorBlock;\n} & {\n [K in NonSelectorBlockKey]: NonSelectorBlock;\n};\n\ninterface BlocksEditorContextValue {\n blocks: BlocksStore;\n modifiers: ModifiersStore;\n disabled: boolean;\n name: string;\n setLiveText: (text: string) => void;\n isExpandedMode: boolean;\n}\n\nconst [BlocksEditorProvider, usePartialBlocksEditorContext] =\n createContext<BlocksEditorContextValue>('BlocksEditor');\n\nfunction useBlocksEditorContext(\n consumerName: string\n): BlocksEditorContextValue & { editor: Editor } {\n const context = usePartialBlocksEditorContext(consumerName, (state) => state);\n const editor = useSlate();\n\n return {\n ...context,\n editor,\n };\n}\n\n/* -------------------------------------------------------------------------------------------------\n * BlocksEditor\n * -----------------------------------------------------------------------------------------------*/\n\nconst EditorDivider = styled(Divider)`\n background: ${({ theme }) => theme.colors.neutral200};\n`;\n\nconst ExpandIconButton = styled(IconButton)`\n position: absolute;\n bottom: 1.2rem;\n right: 1.2rem;\n box-shadow: ${({ theme }) => theme.shadows.filterShadow};\n`;\n\n/**\n * Forces an update of the Slate editor when the value prop changes from outside of Slate.\n * The root cause is that Slate is not a controlled component: https://github.com/ianstormtaylor/slate/issues/4612\n * Why not use JSON.stringify(value) as the key?\n * Because it would force a rerender of the entire editor every time the user types a character.\n * Why not use the entity id as the key, since it's unique for each locale?\n * Because it would not solve the problem when using the \"fill in from other locale\" feature\n */\nfunction useResetKey(value?: Schema.Attribute.BlocksValue): {\n key: number;\n incrementSlateUpdatesCount: () => void;\n} {\n // Keep track how many times Slate detected a change from a user interaction in the editor\n const slateUpdatesCount = React.useRef(0);\n // Keep track of how many times the value prop was updated, whether from within editor or from outside\n const valueUpdatesCount = React.useRef(0);\n // Use a key to force a rerender of the Slate editor when needed\n const [key, setKey] = React.useState(0);\n\n React.useEffect(() => {\n valueUpdatesCount.current += 1;\n\n // If the 2 refs are not equal, it means the value was updated from outside\n if (valueUpdatesCount.current !== slateUpdatesCount.current) {\n // So we change the key to force a rerender of the Slate editor,\n // which will pick up the new value through its initialValue prop\n setKey((previousKey) => previousKey + 1);\n\n // Then bring the 2 refs back in sync\n slateUpdatesCount.current = valueUpdatesCount.current;\n }\n }, [value]);\n\n return { key, incrementSlateUpdatesCount: () => (slateUpdatesCount.current += 1) };\n}\n\nconst pipe =\n (...fns: ((baseEditor: Editor) => Editor)[]) =>\n (value: Editor) =>\n fns.reduce<Editor>((prev, fn) => fn(prev), value);\n\ninterface BlocksEditorProps\n extends Pick<FieldValue<Schema.Attribute.BlocksValue>, 'onChange' | 'value' | 'error'>,\n BlocksContentProps {\n disabled?: boolean;\n name: string;\n}\n\nconst BlocksEditor = React.forwardRef<{ focus: () => void }, BlocksEditorProps>(\n ({ disabled = false, name, onChange, value, error, ...contentProps }, forwardedRef) => {\n const { formatMessage } = useIntl();\n const [editor] = React.useState(() =>\n pipe(withHistory, withImages, withStrapiSchema, withReact, withLinks)(createEditor())\n );\n const [liveText, setLiveText] = React.useState('');\n const ariaDescriptionId = React.useId();\n const [isExpandedMode, setIsExpandedMode] = React.useState(false);\n\n const handleToggleExpand = () => {\n setIsExpandedMode((prev) => !prev);\n };\n\n /**\n * Editable is not able to hold the ref, https://github.com/ianstormtaylor/slate/issues/4082\n * so with \"useImperativeHandle\" we can use ReactEditor methods to expose to the parent above\n * also not passing forwarded ref here, gives console warning.\n */\n React.useImperativeHandle(\n forwardedRef,\n () => ({\n focus() {\n ReactEditor.focus(editor);\n },\n }),\n [editor]\n );\n\n const { key, incrementSlateUpdatesCount } = useResetKey(value);\n\n const handleSlateChange = (state: Descendant[]) => {\n const isAstChange = editor.operations.some((op) => op.type !== 'set_selection');\n\n if (isAstChange) {\n incrementSlateUpdatesCount();\n\n onChange(name, state as Schema.Attribute.BlocksValue);\n }\n };\n\n const blocks: BlocksStore = {\n ...paragraphBlocks,\n ...headingBlocks,\n ...listBlocks,\n ...linkBlocks,\n ...imageBlocks,\n ...quoteBlocks,\n ...codeBlocks,\n };\n\n return (\n <>\n <VisuallyHidden id={ariaDescriptionId}>\n {formatMessage({\n id: getTranslation('components.Blocks.dnd.instruction'),\n defaultMessage: `To reorder blocks, press Command or Control along with Shift and the Up or Down arrow keys`,\n })}\n </VisuallyHidden>\n <VisuallyHidden aria-live=\"assertive\">{liveText}</VisuallyHidden>\n <Slate\n editor={editor}\n initialValue={value || [{ type: 'paragraph', children: [{ type: 'text', text: '' }] }]}\n onChange={handleSlateChange}\n key={key}\n >\n <BlocksEditorProvider\n blocks={blocks}\n modifiers={modifiers}\n disabled={disabled}\n name={name}\n setLiveText={setLiveText}\n isExpandedMode={isExpandedMode}\n >\n <EditorLayout\n error={error}\n disabled={disabled}\n onCollapse={handleToggleExpand}\n ariaDescriptionId={ariaDescriptionId}\n >\n <BlocksToolbar />\n <EditorDivider width=\"100%\" />\n <BlocksContent {...contentProps} />\n {!isExpandedMode && (\n <ExpandIconButton\n label={formatMessage({\n id: getTranslation('components.Blocks.expand'),\n defaultMessage: 'Expand',\n })}\n onClick={handleToggleExpand}\n >\n <Expand />\n </ExpandIconButton>\n )}\n </EditorLayout>\n </BlocksEditorProvider>\n </Slate>\n </>\n );\n }\n);\n\nexport {\n type BlocksStore,\n type SelectorBlockKey,\n BlocksEditor,\n BlocksEditorProvider,\n useBlocksEditorContext,\n isSelectorBlockKey,\n};\n","import * as React from 'react';\n\nimport { useField, type InputProps } from '@strapi/admin/strapi-admin';\nimport { Field, Flex } from '@strapi/design-system';\n\nimport { BlocksEditor } from './BlocksEditor';\n\nimport type { Schema } from '@strapi/types';\n\ninterface BlocksInputProps extends Omit<InputProps, 'type'> {\n labelAction?: React.ReactNode;\n type: Schema.Attribute.Blocks['type'];\n}\n\nconst BlocksInput = React.forwardRef<{ focus: () => void }, BlocksInputProps>(\n ({ label, name, required = false, hint, labelAction, ...editorProps }, forwardedRef) => {\n const id = React.useId();\n const field = useField(name);\n\n return (\n <Field.Root id={id} name={name} hint={hint} error={field.error} required={required}>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={1}>\n <Field.Label action={labelAction}>{label}</Field.Label>\n <BlocksEditor\n name={name}\n error={field.error}\n ref={forwardedRef}\n value={field.value}\n onChange={field.onChange}\n ariaLabelId={id}\n {...editorProps}\n />\n <Field.Hint />\n <Field.Error />\n </Flex>\n </Field.Root>\n );\n }\n);\n\nconst MemoizedBlocksInput = React.memo(BlocksInput);\n\nexport { MemoizedBlocksInput as BlocksInput };\n","import * as React from 'react';\n\nimport { useField } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, Typography } from '@strapi/design-system';\nimport { PlusCircle } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { getTranslation } from '../../../../../utils/translations';\n\ninterface InitializerProps {\n disabled?: boolean;\n name: string;\n onClick?: React.MouseEventHandler<HTMLButtonElement> & React.MouseEventHandler<HTMLDivElement>;\n}\n\nconst Initializer = ({ disabled, name, onClick }: InitializerProps) => {\n const { formatMessage } = useIntl();\n\n const field = useField(name);\n\n return (\n <>\n <Box\n tag=\"button\"\n background={disabled ? 'neutral150' : 'neutral100'}\n borderColor={field.error ? 'danger600' : 'neutral200'}\n hasRadius\n disabled={disabled}\n onClick={onClick}\n paddingTop={9}\n paddingBottom={9}\n type=\"button\"\n style={{ cursor: disabled ? 'not-allowed' : 'pointer' }}\n >\n <Flex direction=\"column\" gap={2}>\n <Flex justifyContent=\"center\" color={disabled ? 'neutral500' : 'primary600'}>\n <PlusCircle width=\"3.2rem\" height=\"3.2rem\" />\n </Flex>\n <Flex justifyContent=\"center\">\n <Typography\n textColor={disabled ? 'neutral600' : 'primary600'}\n variant=\"pi\"\n fontWeight=\"bold\"\n >\n {formatMessage({\n id: getTranslation('components.empty-repeatable'),\n defaultMessage: 'No entry yet. Click to add one.',\n })}\n </Typography>\n </Flex>\n </Flex>\n </Box>\n </>\n );\n};\n\nexport { Initializer };\nexport type { InitializerProps };\n","import { createContext } from '@strapi/admin/strapi-admin';\n\ninterface ComponentContextValue {\n /**\n * The id of the component. It will be undefined if the component\n * has not been created in the database yet. This could be on a new\n * or existing entry.\n */\n id?: number;\n /**\n * The level of the component. This is used to determine the nesting\n * of the component. The default is set to -1 so that the base level is 0\n * for the top level component, and increases by 1 for each level of nesting.\n */\n level: number;\n /**\n * The uid of the component. This is used to determine the type of the\n * component. Within an attribute, it is normally the `component` value.\n * It will be undefined if the hook is not called within the confines\n * of a provider.\n */\n uid?: string;\n /**\n * The type of component parent. It will be undefined if the hook\n * is not called within the confines of a provider.\n */\n type?: 'dynamiczone' | 'repeatable' | 'component';\n}\n\n/**\n * We use this component to wrap any individual component field in the Edit View,\n * this could be a component field in a dynamic zone, a component within a repeatable space,\n * or even nested components.\n *\n * We primarily need this to provide the component id to the components so that they can\n * correctly fetch their relations.\n */\nconst [ComponentProvider, useComponent] = createContext<ComponentContextValue>('ComponentContext', {\n id: undefined,\n level: -1,\n uid: undefined,\n type: undefined,\n});\n\nexport { ComponentProvider, useComponent };\n","import * as React from 'react';\n\nimport { Button, Flex, Typography, TypographyComponent } from '@strapi/design-system';\nimport { PlusCircle } from '@strapi/icons';\nimport { styled } from 'styled-components';\n\ninterface AddComponentButtonProps {\n children: React.ReactNode;\n hasError?: boolean;\n isDisabled?: boolean;\n isOpen?: boolean;\n onClick: React.MouseEventHandler<HTMLButtonElement> & React.MouseEventHandler<HTMLDivElement>;\n}\n\nconst AddComponentButton = ({\n hasError,\n isDisabled,\n isOpen,\n children,\n onClick,\n}: AddComponentButtonProps) => {\n return (\n <StyledButton\n type=\"button\"\n onClick={onClick}\n disabled={isDisabled}\n background=\"neutral0\"\n style={{ cursor: isDisabled ? 'not-allowed' : 'pointer' }}\n variant=\"tertiary\"\n >\n <Flex tag=\"span\" gap={2}>\n <StyledAddIcon aria-hidden $isOpen={isOpen} $hasError={hasError && !isOpen} />\n <Typography\n variant=\"pi\"\n fontWeight=\"bold\"\n textColor={hasError && !isOpen ? 'danger600' : 'neutral600'}\n >\n {children}\n </Typography>\n </Flex>\n </StyledButton>\n );\n};\n\nconst StyledAddIcon = styled(PlusCircle)<{ $isOpen?: boolean; $hasError?: boolean }>`\n height: ${({ theme }) => theme.spaces[6]};\n width: ${({ theme }) => theme.spaces[6]};\n transform: ${({ $isOpen }) => ($isOpen ? 'rotate(45deg)' : 'rotate(0deg)')};\n\n > circle {\n fill: ${({ theme, $hasError }) =>\n $hasError ? theme.colors.danger200 : theme.colors.neutral150};\n }\n > path {\n fill: ${({ theme, $hasError }) =>\n $hasError ? theme.colors.danger600 : theme.colors.neutral500};\n }\n`;\n\nconst StyledButton = styled(Button)`\n padding-left: ${({ theme }) => theme.spaces[3]};\n border-radius: 26px;\n box-shadow: ${({ theme }) => theme.shadows.filterShadow};\n height: 5rem;\n`;\n\nexport { AddComponentButton };\nexport type { AddComponentButtonProps };\n","import * as React from 'react';\n\nimport { Accordion, Box, Flex, FlexComponent, Typography } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { ComponentIcon } from '../../../../../components/ComponentIcon';\nimport { RESPONSIVE_CONTAINER_BREAKPOINTS } from '../../FormLayout';\n\ninterface ComponentCategoryProps {\n category: string;\n components?: Array<{\n uid: string;\n displayName: string;\n icon?: string;\n }>;\n onAddComponent: (\n componentUid: string\n ) => React.MouseEventHandler<HTMLButtonElement> & React.MouseEventHandler<HTMLDivElement>;\n variant?: Accordion.Variant;\n}\n\nconst ComponentCategory = ({\n category,\n components = [],\n variant = 'primary',\n onAddComponent,\n}: ComponentCategoryProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <Accordion.Item value={category}>\n <Accordion.Header variant={variant}>\n <Accordion.Trigger>\n {formatMessage({ id: category, defaultMessage: category })}\n </Accordion.Trigger>\n </Accordion.Header>\n <ResponsiveAccordionContent>\n <Grid paddingTop={4} paddingBottom={4} paddingLeft={3} paddingRight={3}>\n {components.map(({ uid, displayName, icon }) => (\n <ComponentBox\n key={uid}\n tag=\"button\"\n type=\"button\"\n background=\"neutral100\"\n justifyContent=\"center\"\n onClick={onAddComponent(uid)}\n hasRadius\n height=\"8.4rem\"\n shrink={0}\n borderColor=\"neutral200\"\n >\n <Flex direction=\"column\" gap={1} alignItems=\"center\" justifyContent=\"center\">\n <ComponentIcon color=\"currentColor\" background=\"primary200\" icon={icon} />\n\n <Typography variant=\"pi\" fontWeight=\"bold\">\n {displayName}\n </Typography>\n </Flex>\n </ComponentBox>\n ))}\n </Grid>\n </ResponsiveAccordionContent>\n </Accordion.Item>\n );\n};\n\nconst ResponsiveAccordionContent = styled(Accordion.Content)`\n container-type: inline-size;\n`;\n\n/**\n * TODO:\n * JSDOM cannot handle container queries.\n * This is a temporary workaround so that tests do not fail in the CI when jestdom throws an error\n * for failing to parse the stylesheet.\n */\nconst Grid =\n process.env.NODE_ENV !== 'test'\n ? styled(Box)`\n display: grid;\n grid-template-columns: repeat(auto-fill, 100%);\n grid-gap: 4px;\n\n @container (min-width: ${() => RESPONSIVE_CONTAINER_BREAKPOINTS.sm}) {\n grid-template-columns: repeat(auto-fill, 14rem);\n }\n `\n : styled(Box)`\n display: grid;\n grid-template-columns: repeat(auto-fill, 100%);\n grid-gap: 4px;\n `;\n\nconst ComponentBox = styled<FlexComponent<'button'>>(Flex)`\n color: ${({ theme }) => theme.colors.neutral600};\n cursor: pointer;\n\n @media (prefers-reduced-motion: no-preference) {\n transition: color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};\n }\n\n &:focus,\n &:hover {\n border: 1px solid ${({ theme }) => theme.colors.primary200};\n background: ${({ theme }) => theme.colors.primary100};\n color: ${({ theme }) => theme.colors.primary600};\n }\n`;\n\nexport { ComponentCategory };\nexport type { ComponentCategoryProps };\n","import * as React from 'react';\n\nimport { Box, Flex, Accordion, Typography } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\n\nimport { getTranslation } from '../../../../../utils/translations';\n\nimport { ComponentCategory, ComponentCategoryProps } from './ComponentCategory';\n\ninterface ComponentPickerProps {\n dynamicComponentsByCategory?: Record<string, NonNullable<ComponentCategoryProps['components']>>;\n isOpen?: boolean;\n onClickAddComponent: (componentUid: string) => void;\n}\n\nconst ComponentPicker = ({\n dynamicComponentsByCategory = {},\n isOpen,\n onClickAddComponent,\n}: ComponentPickerProps) => {\n const { formatMessage } = useIntl();\n\n const handleAddComponentToDz = (componentUid: string) => () => {\n onClickAddComponent(componentUid);\n };\n\n if (!isOpen) {\n return null;\n }\n\n return (\n <Box\n paddingTop={6}\n paddingBottom={6}\n paddingLeft={5}\n paddingRight={5}\n background=\"neutral0\"\n shadow=\"tableShadow\"\n borderColor=\"neutral150\"\n hasRadius\n >\n <Flex justifyContent=\"center\">\n <Typography fontWeight=\"bold\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslation('components.DynamicZone.ComponentPicker-label'),\n defaultMessage: 'Pick one component',\n })}\n </Typography>\n </Flex>\n <Box paddingTop={2}>\n <Accordion.Root defaultValue={Object.keys(dynamicComponentsByCategory)[0]}>\n {Object.entries(dynamicComponentsByCategory).map(([category, components], index) => (\n <ComponentCategory\n key={category}\n category={category}\n components={components}\n onAddComponent={handleAddComponentToDz}\n variant={index % 2 === 1 ? 'primary' : 'secondary'}\n />\n ))}\n </Accordion.Root>\n </Box>\n </Box>\n );\n};\n\nexport { ComponentPicker };\nexport type { ComponentPickerProps };\n","import * as React from 'react';\n\nimport { useForm, useField } from '@strapi/admin/strapi-admin';\nimport {\n Accordion,\n Box,\n Flex,\n Grid,\n IconButton,\n useComposedRefs,\n Menu,\n MenuItem,\n BoxComponent,\n} from '@strapi/design-system';\nimport { Drag, More, Trash } from '@strapi/icons';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { COMPONENT_ICONS } from '../../../../../components/ComponentIcon';\nimport { ItemTypes } from '../../../../../constants/dragAndDrop';\nimport { useDocumentContext } from '../../../../../features/DocumentContext';\nimport { useDocumentLayout } from '../../../../../hooks/useDocumentLayout';\nimport { type UseDragAndDropOptions, useDragAndDrop } from '../../../../../hooks/useDragAndDrop';\nimport { getIn } from '../../../../../utils/objects';\nimport { getTranslation } from '../../../../../utils/translations';\nimport { ResponsiveGridItem, ResponsiveGridRoot } from '../../FormLayout';\nimport { InputRenderer, type InputRendererProps } from '../../InputRenderer';\n\nimport type { ComponentPickerProps } from './ComponentPicker';\n\ninterface DynamicComponentProps\n extends Pick<UseDragAndDropOptions, 'onGrabItem' | 'onDropItem' | 'onCancel'>,\n Pick<ComponentPickerProps, 'dynamicComponentsByCategory'> {\n componentUid: string;\n disabled?: boolean;\n index: number;\n name: string;\n onAddComponent: (componentUid: string, index: number) => void;\n onRemoveComponentClick: () => void;\n onMoveComponent: (dragIndex: number, hoverIndex: number) => void;\n children?: (props: InputRendererProps) => React.ReactNode;\n}\n\nconst DynamicComponent = ({\n componentUid,\n disabled,\n index,\n name,\n onRemoveComponentClick,\n onMoveComponent,\n onGrabItem,\n onDropItem,\n onCancel,\n dynamicComponentsByCategory = {},\n onAddComponent,\n children,\n}: DynamicComponentProps) => {\n const { formatMessage } = useIntl();\n const formValues = useForm('DynamicComponent', (state) => state.values);\n const documentMeta = useDocumentContext('DynamicComponent', (state) => state.meta);\n const rootDocumentMeta = useDocumentContext(\n 'DynamicComponent',\n (state) => state.rootDocumentMeta\n );\n\n const {\n edit: { components: rootComponents },\n } = useDocumentLayout(rootDocumentMeta.model);\n const {\n edit: { components: relatedComponents },\n } = useDocumentLayout(documentMeta.model);\n\n // Merge the root level components and related components\n const components = React.useMemo(\n () => ({ ...rootComponents, ...relatedComponents }),\n [rootComponents, relatedComponents]\n );\n\n const document = useDocumentContext('DynamicComponent', (state) => state.document);\n\n const title = React.useMemo(() => {\n const { mainField } = components[componentUid]?.settings ?? { mainField: 'id' };\n\n const mainFieldValue = getIn(formValues, `${name}.${index}.${mainField}`);\n\n const displayedValue =\n mainField === 'id' || !mainFieldValue ? '' : String(mainFieldValue).trim();\n\n const mainValue = displayedValue.length > 0 ? `- ${displayedValue}` : displayedValue;\n\n return mainValue;\n }, [componentUid, components, formValues, name, index]);\n\n const { icon, displayName } = React.useMemo(() => {\n const [category] = componentUid.split('.');\n const { icon, displayName } = (dynamicComponentsByCategory[category] ?? []).find(\n (component) => component.uid === componentUid\n ) ?? { icon: null, displayName: null };\n\n return { icon, displayName };\n }, [componentUid, dynamicComponentsByCategory]);\n\n const [{ handlerId, isDragging, handleKeyDown }, boxRef, dropRef, dragRef, dragPreviewRef] =\n useDragAndDrop(!disabled, {\n type: `${ItemTypes.DYNAMIC_ZONE}_${name}`,\n index,\n item: {\n index,\n displayedValue: `${displayName} ${title}`,\n icon,\n },\n onMoveItem: onMoveComponent,\n onDropItem,\n onGrabItem,\n onCancel,\n });\n\n React.useEffect(() => {\n dragPreviewRef(getEmptyImage(), { captureDraggingState: false });\n }, [dragPreviewRef, index]);\n\n /**\n * We don't need the accordion's to communicate with each other,\n * so a unique value for their state is enough.\n */\n const accordionValue = React.useId();\n\n const { value = [], rawError } = useField(`${name}.${index}`);\n\n const [collapseToOpen, setCollapseToOpen] = React.useState<string>('');\n\n React.useEffect(() => {\n if (rawError && value) {\n setCollapseToOpen(accordionValue);\n }\n }, [rawError, value, accordionValue]);\n\n const composedBoxRefs = useComposedRefs(boxRef, dropRef);\n\n const accordionActions = disabled ? null : (\n <>\n <IconButton\n variant=\"ghost\"\n label={formatMessage(\n {\n id: getTranslation('components.DynamicZone.delete-label'),\n defaultMessage: 'Delete {name}',\n },\n { name: title }\n )}\n onClick={onRemoveComponentClick}\n >\n <Trash />\n </IconButton>\n <IconButton\n variant=\"ghost\"\n onClick={(e) => e.stopPropagation()}\n data-handler-id={handlerId}\n ref={dragRef}\n label={formatMessage({\n id: getTranslation('components.DragHandle-label'),\n defaultMessage: 'Drag',\n })}\n onKeyDown={handleKeyDown}\n >\n <Drag />\n </IconButton>\n <Menu.Root>\n <Menu.Trigger size=\"S\" endIcon={null} paddingLeft={0} paddingRight={0}>\n <IconButton\n variant=\"ghost\"\n label={formatMessage({\n id: getTranslation('components.DynamicZone.more-actions'),\n defaultMessage: 'More actions',\n })}\n tag=\"span\"\n >\n <More aria-hidden focusable={false} />\n </IconButton>\n </Menu.Trigger>\n <Menu.Content>\n <Menu.SubRoot>\n <Menu.SubTrigger>\n {formatMessage({\n id: getTranslation('components.DynamicZone.add-item-above'),\n defaultMessage: 'Add component above',\n })}\n </Menu.SubTrigger>\n <Menu.SubContent>\n {Object.entries(dynamicComponentsByCategory).map(([category, components]) => (\n <React.Fragment key={category}>\n <Menu.Label>{category}</Menu.Label>\n {components.map(({ displayName, uid }) => (\n <MenuItem key={componentUid} onSelect={() => onAddComponent(uid, index)}>\n {displayName}\n </MenuItem>\n ))}\n </React.Fragment>\n ))}\n </Menu.SubContent>\n </Menu.SubRoot>\n <Menu.SubRoot>\n <Menu.SubTrigger>\n {formatMessage({\n id: getTranslation('components.DynamicZone.add-item-below'),\n defaultMessage: 'Add component below',\n })}\n </Menu.SubTrigger>\n <Menu.SubContent>\n {Object.entries(dynamicComponentsByCategory).map(([category, components]) => (\n <React.Fragment key={category}>\n <Menu.Label>{category}</Menu.Label>\n {components.map(({ displayName, uid }) => (\n <MenuItem key={componentUid} onSelect={() => onAddComponent(uid, index + 1)}>\n {displayName}\n </MenuItem>\n ))}\n </React.Fragment>\n ))}\n </Menu.SubContent>\n </Menu.SubRoot>\n </Menu.Content>\n </Menu.Root>\n </>\n );\n\n const accordionTitle = title ? `${displayName} ${title}` : displayName;\n\n return (\n <ComponentContainer tag=\"li\" width=\"100%\">\n <Flex justifyContent=\"center\">\n <Rectangle background=\"neutral200\" />\n </Flex>\n <StyledBox ref={composedBoxRefs} hasRadius>\n {isDragging ? (\n <Preview />\n ) : (\n <Accordion.Root value={collapseToOpen} onValueChange={setCollapseToOpen}>\n <Accordion.Item value={accordionValue}>\n <Accordion.Header>\n <Accordion.Trigger\n icon={\n icon && COMPONENT_ICONS[icon]\n ? COMPONENT_ICONS[icon]\n : COMPONENT_ICONS.dashboard\n }\n >\n {accordionTitle}\n </Accordion.Trigger>\n <Accordion.Actions>{accordionActions}</Accordion.Actions>\n </Accordion.Header>\n <Accordion.Content>\n <AccordionContentRadius background=\"neutral0\">\n <Box paddingLeft={6} paddingRight={6} paddingTop={6} paddingBottom={6}>\n <Grid.Root gap={4}>\n {components[componentUid]?.layout?.map((row, rowInd) => (\n <Grid.Item\n col={12}\n key={rowInd}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n <ResponsiveGridRoot gap={4}>\n {row.map(({ size, ...field }) => {\n const fieldName = `${name}.${index}.${field.name}`;\n\n const fieldWithTranslatedLabel = {\n ...field,\n label: formatMessage({\n id: `content-manager.components.${componentUid}.${field.name}`,\n defaultMessage: field.label,\n }),\n };\n\n return (\n <ResponsiveGridItem\n col={size}\n key={fieldName}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n {children ? (\n children({\n ...fieldWithTranslatedLabel,\n document,\n name: fieldName,\n })\n ) : (\n <InputRenderer\n {...fieldWithTranslatedLabel}\n document={document}\n name={fieldName}\n />\n )}\n </ResponsiveGridItem>\n );\n })}\n </ResponsiveGridRoot>\n </Grid.Item>\n ))}\n </Grid.Root>\n </Box>\n </AccordionContentRadius>\n </Accordion.Content>\n </Accordion.Item>\n </Accordion.Root>\n )}\n </StyledBox>\n </ComponentContainer>\n );\n};\n\n// TODO: Delete once https://github.com/strapi/design-system/pull/858\n// is merged and released.\nconst StyledBox = styled<BoxComponent>(Box)`\n > div:first-child {\n box-shadow: ${({ theme }) => theme.shadows.tableShadow};\n }\n`;\n\nconst AccordionContentRadius = styled<BoxComponent>(Box)`\n border-radius: 0 0 ${({ theme }) => theme.spaces[1]} ${({ theme }) => theme.spaces[1]};\n`;\n\nconst Rectangle = styled<BoxComponent>(Box)`\n width: ${({ theme }) => theme.spaces[2]};\n height: ${({ theme }) => theme.spaces[4]};\n`;\n\nconst Preview = styled.span`\n display: block;\n background-color: ${({ theme }) => theme.colors.primary100};\n outline: 1px dashed ${({ theme }) => theme.colors.primary500};\n outline-offset: -1px;\n padding: ${({ theme }) => theme.spaces[6]};\n`;\n\nconst ComponentContainer = styled<BoxComponent<'li'>>(Box)`\n list-style: none;\n padding: 0;\n margin: 0;\n`;\n\nexport { DynamicComponent };\nexport type { DynamicComponentProps };\n","import * as React from 'react';\n\nimport { Box, Flex, Typography } from '@strapi/design-system';\n\ninterface DynamicZoneLabelProps {\n label?: React.ReactNode;\n labelAction?: React.ReactNode;\n name: string;\n numberOfComponents?: number;\n required?: boolean;\n hint?: React.ReactNode;\n}\n\nconst DynamicZoneLabel = ({\n hint,\n label,\n labelAction,\n name,\n numberOfComponents = 0,\n required,\n}: DynamicZoneLabelProps) => {\n return (\n <Flex justifyContent=\"center\">\n <Box\n paddingTop={3}\n paddingBottom={3}\n paddingRight={4}\n paddingLeft={4}\n borderRadius=\"26px\"\n background=\"neutral0\"\n shadow=\"filterShadow\"\n color=\"neutral500\"\n >\n <Flex direction=\"column\" justifyContent=\"center\">\n <Flex maxWidth=\"35.6rem\">\n <Typography variant=\"pi\" textColor=\"neutral600\" fontWeight=\"bold\" ellipsis>\n {label || name}&nbsp;\n </Typography>\n <Typography variant=\"pi\" textColor=\"neutral600\" fontWeight=\"bold\">\n ({numberOfComponents})\n </Typography>\n {required && <Typography textColor=\"danger600\">*</Typography>}\n {labelAction && <Box paddingLeft={1}>{labelAction}</Box>}\n </Flex>\n {hint && (\n <Box paddingTop={1} maxWidth=\"35.6rem\">\n <Typography variant=\"pi\" textColor=\"neutral600\" ellipsis>\n {hint}\n </Typography>\n </Box>\n )}\n </Flex>\n </Box>\n </Flex>\n );\n};\n\nexport { DynamicZoneLabel };\nexport type { DynamicZoneLabelProps };\n","import * as React from 'react';\n\nimport {\n createContext,\n InputProps,\n useField,\n useForm,\n useNotification,\n} from '@strapi/admin/strapi-admin';\nimport { Box, Flex, VisuallyHidden } from '@strapi/design-system';\nimport pipe from 'lodash/fp/pipe';\nimport { useIntl } from 'react-intl';\n\nimport { useDocumentContext } from '../../../../../features/DocumentContext';\nimport { type EditFieldLayout } from '../../../../../hooks/useDocumentLayout';\nimport { getTranslation } from '../../../../../utils/translations';\nimport { transformDocument } from '../../../utils/data';\nimport { createDefaultForm } from '../../../utils/forms';\nimport { ComponentProvider, useComponent } from '../ComponentContext';\n\nimport { AddComponentButton } from './AddComponentButton';\nimport { ComponentPicker } from './ComponentPicker';\nimport { DynamicComponent, DynamicComponentProps } from './DynamicComponent';\nimport { DynamicZoneLabel, DynamicZoneLabelProps } from './DynamicZoneLabel';\n\nimport type { InputRendererProps } from '../../InputRenderer';\nimport type { Schema } from '@strapi/types';\n\ninterface DynamicZoneContextValue {\n isInDynamicZone: boolean;\n}\n\nconst [DynamicZoneProvider, useDynamicZone] = createContext<DynamicZoneContextValue>(\n 'DynamicZone',\n {\n isInDynamicZone: false,\n }\n);\n\ninterface DynamicZoneProps\n extends Omit<Extract<EditFieldLayout, { type: 'dynamiczone' }>, 'size' | 'hint'>,\n Pick<InputProps, 'hint'>,\n Pick<DynamicZoneLabelProps, 'labelAction'> {\n children?: (props: InputRendererProps) => React.ReactNode;\n}\n\nconst DynamicZone = ({\n attribute,\n disabled: disabledProp,\n hint,\n label,\n labelAction,\n name,\n required = false,\n children,\n}: DynamicZoneProps) => {\n // We cannot use the default props here\n const { max = Infinity, min = -Infinity } = attribute ?? {};\n\n const [addComponentIsOpen, setAddComponentIsOpen] = React.useState(false);\n const [liveText, setLiveText] = React.useState('');\n\n const document = useDocumentContext('DynamicZone', (state) => state.document);\n const { components, isLoading } = document;\n\n const disabled = disabledProp || isLoading;\n const { addFieldRow, removeFieldRow, moveFieldRow } = useForm(\n 'DynamicZone',\n ({ addFieldRow, removeFieldRow, moveFieldRow }) => ({\n addFieldRow,\n removeFieldRow,\n moveFieldRow,\n })\n );\n\n type DzWithTempKey =\n Schema.Attribute.GetDynamicZoneValue<Schema.Attribute.DynamicZone>[number] & {\n __temp_key__: number;\n };\n\n const { value = [], error } = useField<Array<DzWithTempKey>>(name);\n\n const dynamicComponentsByCategory = React.useMemo(() => {\n return attribute.components.reduce<\n NonNullable<DynamicComponentProps['dynamicComponentsByCategory']>\n >((acc, componentUid) => {\n const { category, info } = components[componentUid] ?? { info: {} };\n\n const component = { uid: componentUid, displayName: info.displayName, icon: info.icon };\n\n if (!acc[category]) {\n acc[category] = [];\n }\n\n acc[category] = [...acc[category], component];\n\n return acc;\n }, {});\n }, [attribute.components, components]);\n\n const { formatMessage } = useIntl();\n\n const { toggleNotification } = useNotification();\n\n const dynamicDisplayedComponentsLength = value.length;\n\n const handleAddComponent = (uid: string, position?: number) => {\n setAddComponentIsOpen(false);\n\n const schema = components[uid];\n const form = createDefaultForm(schema, components);\n const transformations = pipe(transformDocument(schema, components), (data) => ({\n ...data,\n __component: uid,\n }));\n\n const data = transformations(form);\n\n addFieldRow(name, data, position);\n };\n\n const handleClickOpenPicker = () => {\n if (dynamicDisplayedComponentsLength < max) {\n setAddComponentIsOpen((prev) => !prev);\n } else {\n toggleNotification({\n type: 'info',\n message: formatMessage({\n id: getTranslation('components.notification.info.maximum-requirement'),\n }),\n });\n }\n };\n\n const handleMoveComponent = (newIndex: number, currentIndex: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.reorder'),\n defaultMessage: '{item}, moved. New position in list: {position}.',\n },\n {\n item: `${name}.${currentIndex}`,\n position: getItemPos(newIndex),\n }\n )\n );\n\n moveFieldRow(name, currentIndex, newIndex);\n };\n\n const getItemPos = (index: number) => `${index + 1} of ${value.length}`;\n\n const handleCancel = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.cancel-item'),\n defaultMessage: '{item}, dropped. Re-order cancelled.',\n },\n {\n item: `${name}.${index}`,\n }\n )\n );\n };\n\n const handleGrabItem = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.grab-item'),\n defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`,\n },\n {\n item: `${name}.${index}`,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const handleDropItem = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.drop-item'),\n defaultMessage: `{item}, dropped. Final position in list: {position}.`,\n },\n {\n item: `${name}.${index}`,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const handleRemoveComponent = (name: string, currentIndex: number) => () => {\n removeFieldRow(name, currentIndex);\n };\n\n const hasError = error !== undefined;\n\n const renderButtonLabel = () => {\n if (addComponentIsOpen) {\n return formatMessage({ id: 'app.utils.close-label', defaultMessage: 'Close' });\n }\n\n if (hasError && dynamicDisplayedComponentsLength > max) {\n return formatMessage(\n {\n id: getTranslation(`components.DynamicZone.extra-components`),\n defaultMessage:\n 'There {number, plural, =0 {are # extra components} one {is # extra component} other {are # extra components}}',\n },\n {\n number: dynamicDisplayedComponentsLength - max,\n }\n );\n }\n\n if (hasError && dynamicDisplayedComponentsLength < min) {\n return formatMessage(\n {\n id: getTranslation(`components.DynamicZone.missing-components`),\n defaultMessage:\n 'There {number, plural, =0 {are # missing components} one {is # missing component} other {are # missing components}}',\n },\n { number: min - dynamicDisplayedComponentsLength }\n );\n }\n\n return formatMessage(\n {\n id: getTranslation('components.DynamicZone.add-component'),\n defaultMessage: 'Add a component to {componentName}',\n },\n { componentName: label || name }\n );\n };\n\n const level = useComponent('DynamicZone', (state) => state.level);\n\n const ariaDescriptionId = React.useId();\n\n return (\n <DynamicZoneProvider isInDynamicZone>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {dynamicDisplayedComponentsLength > 0 && (\n <Box>\n <DynamicZoneLabel\n hint={hint}\n label={label}\n labelAction={labelAction}\n name={name}\n numberOfComponents={dynamicDisplayedComponentsLength}\n required={required}\n />\n <VisuallyHidden id={ariaDescriptionId}>\n {formatMessage({\n id: getTranslation('dnd.instructions'),\n defaultMessage: `Press spacebar to grab and re-order`,\n })}\n </VisuallyHidden>\n <VisuallyHidden aria-live=\"assertive\">{liveText}</VisuallyHidden>\n <ol aria-describedby={ariaDescriptionId}>\n {value.map((field, index) => (\n <ComponentProvider\n key={field.__temp_key__}\n level={level + 1}\n uid={field.__component}\n // id is always a number in a dynamic zone.\n id={field.id as number}\n type=\"dynamiczone\"\n >\n <DynamicComponent\n disabled={disabled}\n name={name}\n index={index}\n componentUid={field.__component}\n onMoveComponent={handleMoveComponent}\n onRemoveComponentClick={handleRemoveComponent(name, index)}\n onCancel={handleCancel}\n onDropItem={handleDropItem}\n onGrabItem={handleGrabItem}\n onAddComponent={handleAddComponent}\n dynamicComponentsByCategory={dynamicComponentsByCategory}\n >\n {children}\n </DynamicComponent>\n </ComponentProvider>\n ))}\n </ol>\n </Box>\n )}\n <Flex justifyContent=\"center\">\n <AddComponentButton\n hasError={hasError}\n isDisabled={disabled}\n isOpen={addComponentIsOpen}\n onClick={handleClickOpenPicker}\n >\n {renderButtonLabel()}\n </AddComponentButton>\n </Flex>\n <ComponentPicker\n dynamicComponentsByCategory={dynamicComponentsByCategory}\n isOpen={addComponentIsOpen}\n onClickAddComponent={handleAddComponent}\n />\n </Flex>\n </DynamicZoneProvider>\n );\n};\n\nexport { DynamicZone, useDynamicZone };\nexport type { DynamicZoneProps };\n","import { Field, TextInput } from '@strapi/design-system';\nimport { EyeStriked } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport type { InputProps } from '@strapi/admin/strapi-admin';\nimport type { Schema } from '@strapi/types';\n\ninterface NotAllowedInputProps extends Omit<InputProps, 'type'> {\n type: Schema.Attribute.Kind;\n}\n\nconst NotAllowedInput = ({ hint, label, required, name }: NotAllowedInputProps) => {\n const { formatMessage } = useIntl();\n\n const placeholder = formatMessage({\n id: 'components.NotAllowedInput.text',\n defaultMessage: 'No permissions to see this field',\n });\n\n return (\n <Field.Root id={name} hint={hint} name={name} required={required}>\n <Field.Label>{label}</Field.Label>\n <TextInput\n disabled\n placeholder={placeholder}\n startAction={<EyeStriked fill=\"neutral600\" />}\n type=\"text\"\n value=\"\"\n />\n <Field.Hint />\n </Field.Root>\n );\n};\n\nexport { NotAllowedInput };\n","import * as React from 'react';\n\nimport {\n ConfirmDialog,\n DescriptionComponentRenderer,\n Form as FormContext,\n useRBAC,\n useStrapiApp,\n createContext,\n} from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Button,\n Dialog,\n EmptyStateLayout,\n Flex,\n IconButton,\n Loader,\n Modal,\n Typography,\n Tooltip,\n TextButton,\n} from '@strapi/design-system';\nimport { ArrowLeft, ArrowsOut, WarningCircle } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { useLocation, useNavigate } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { COLLECTION_TYPES, SINGLE_TYPES } from '../../../../../constants/collections';\nimport { PERMISSIONS } from '../../../../../constants/plugin';\nimport { type DocumentMeta, useDocumentContext } from '../../../../../features/DocumentContext';\nimport { DocumentRBAC } from '../../../../../features/DocumentRBAC';\nimport { useDocumentLayout } from '../../../../../hooks/useDocumentLayout';\nimport { useLazyGetDocumentQuery } from '../../../../../services/documents';\nimport { createYupSchema } from '../../../../../utils/validation';\nimport { DocumentActionButton } from '../../../components/DocumentActions';\nimport { DocumentStatus } from '../../DocumentStatus';\nimport { FormLayout } from '../../FormLayout';\n\nimport type { ContentManagerPlugin, DocumentActionProps } from '../../../../../content-manager';\n\ninterface RelationModalProps {\n triggerButtonLabel: string;\n relation: DocumentMeta;\n}\n\nexport function getCollectionType(url: string) {\n const regex = new RegExp(`(${COLLECTION_TYPES}|${SINGLE_TYPES})`);\n const match = url.match(regex);\n return match ? match[1] : undefined;\n}\n\nconst CustomModalContent = styled(Modal.Content)`\n width: 90%;\n max-width: 100%;\n height: 90%;\n max-height: 100%;\n`;\n\ninterface RelationModalContextValue {\n parentModified: boolean;\n depth: number;\n}\n\nconst [RelationModalProvider, useRelationModal] = createContext<RelationModalContextValue>(\n 'RelationModal',\n {\n parentModified: false,\n depth: 0,\n }\n);\n\nconst RelationModalForm = ({ relation, triggerButtonLabel }: RelationModalProps) => {\n const navigate = useNavigate();\n const { pathname, search } = useLocation();\n const { formatMessage } = useIntl();\n\n const [triggerRefetchDocument] = useLazyGetDocumentQuery();\n\n const currentDocument = useDocumentContext('RelationModalForm', (state) => state.document);\n const rootDocumentMeta = useDocumentContext(\n 'RelationModalForm',\n (state) => state.rootDocumentMeta\n );\n const currentDocumentMeta = useDocumentContext('RelationModalForm', (state) => state.meta);\n const changeDocument = useDocumentContext('RelationModalForm', (state) => state.changeDocument);\n const documentHistory = useDocumentContext('RelationModalForm', (state) => state.documentHistory);\n const setDocumentHistory = useDocumentContext(\n 'RelationModalForm',\n (state) => state.setDocumentHistory\n );\n\n const [isConfirmationOpen, setIsConfirmationOpen] = React.useState(false);\n const [actionPosition, setActionPosition] = React.useState<'cancel' | 'back' | 'navigate'>(\n 'cancel'\n );\n\n const [isModalOpen, setIsModalOpen] = React.useState(false);\n // NOTE: Not sure about this relation modal context, maybe we should move this to DocumentContext?\n // Get parent modal context if it exists\n const parentContext = useRelationModal('RelationModalForm', (state) => state);\n // Get depth of nested modals\n const depth = parentContext ? parentContext.depth + 1 : 0;\n // Check if this is a nested modal\n const isNested = depth > 0;\n\n const addDocumentToHistory = (document: DocumentMeta) =>\n setDocumentHistory((prev) => [...prev, document]);\n\n const getPreviousDocument = () => {\n if (documentHistory.length === 0) return undefined;\n\n const lastDocument = documentHistory[documentHistory.length - 1];\n\n return lastDocument;\n };\n\n const removeLastDocumentFromHistory = () => {\n setDocumentHistory((prev) => [...prev].slice(0, prev.length - 1));\n };\n\n const handleToggleModal = () => {\n if (isModalOpen) {\n setIsModalOpen(false);\n const document = {\n collectionType: rootDocumentMeta.collectionType,\n model: rootDocumentMeta.model,\n documentId: rootDocumentMeta.documentId,\n };\n // Change back to the root document\n changeDocument(document);\n // Reset the document history\n setDocumentHistory([]);\n // Reset action position\n setActionPosition('cancel');\n // Read from cache or refetch root document\n triggerRefetchDocument(\n document,\n // Favor the cache\n true\n );\n } else {\n changeDocument(relation);\n setIsModalOpen(true);\n }\n };\n\n const getFullPageLink = (): string => {\n const isSingleType = currentDocumentMeta.collectionType === SINGLE_TYPES;\n const queryParams = currentDocumentMeta.params?.locale\n ? `?plugins[i18n][locale]=${currentDocumentMeta.params.locale}`\n : '';\n\n return `/content-manager/${currentDocumentMeta.collectionType}/${currentDocumentMeta.model}${isSingleType ? '' : '/' + currentDocumentMeta.documentId}${queryParams}`;\n };\n\n const handleRedirection = () => {\n const editViewUrl = `${pathname}${search}`;\n const isRootDocumentUrl = editViewUrl.includes(getFullPageLink());\n\n if (isRootDocumentUrl) {\n handleToggleModal();\n } else {\n navigate(getFullPageLink());\n }\n };\n\n const handleConfirm = () => {\n if (actionPosition === 'navigate') {\n handleRedirection();\n } else if (actionPosition === 'back') {\n const previousRelation = getPreviousDocument();\n if (previousRelation) {\n removeLastDocumentFromHistory();\n changeDocument(previousRelation);\n }\n } else {\n // Add current relation to history before opening a new one in case we are opening a new one\n if (currentDocumentMeta && Object.keys(currentDocumentMeta).length > 0) {\n addDocumentToHistory(currentDocumentMeta);\n }\n handleToggleModal();\n }\n };\n\n return (\n <FormContext\n method=\"PUT\"\n initialValues={currentDocument.getInitialFormValues()}\n validate={(values: Record<string, unknown>, options: Record<string, string>) => {\n const yupSchema = createYupSchema(\n currentDocument.schema?.attributes,\n currentDocument.components,\n {\n status: currentDocument.document?.status,\n ...options,\n }\n );\n\n return yupSchema.validate(values, { abortEarly: false });\n }}\n >\n {({ modified, isSubmitting, resetForm }) => {\n // We don't count the root document, so history starts after 1\n const hasHistory = documentHistory.length > 1;\n\n return (\n <RelationModalProvider parentModified={modified} depth={depth}>\n <Modal.Root\n open={isModalOpen}\n onOpenChange={() => {\n if (isModalOpen) {\n if (modified && !isSubmitting) {\n setIsConfirmationOpen(true);\n } else {\n handleToggleModal();\n }\n }\n }}\n >\n <Modal.Trigger>\n <Tooltip description={triggerButtonLabel}>\n <CustomTextButton\n onClick={() => {\n // Check if parent modal has unsaved changes\n if (isNested && parentContext.parentModified) {\n setIsConfirmationOpen(true);\n // Return early to avoid opening the modal\n return;\n } else {\n if (modified && !isSubmitting) {\n setIsConfirmationOpen(true);\n } else {\n // Add current relation to history before opening a new one\n if (currentDocumentMeta && Object.keys(currentDocumentMeta).length > 0) {\n addDocumentToHistory(currentDocumentMeta);\n }\n handleToggleModal();\n }\n\n if (!isModalOpen) {\n setIsModalOpen(true);\n }\n }\n }}\n width=\"100%\"\n >\n {triggerButtonLabel}\n </CustomTextButton>\n </Tooltip>\n </Modal.Trigger>\n <CustomModalContent>\n <Modal.Header gap={2}>\n <Flex justifyContent=\"space-between\" alignItems=\"center\" width=\"100%\">\n <Flex gap={2}>\n <IconButton\n withTooltip={false}\n label=\"Back\"\n variant=\"ghost\"\n disabled={!hasHistory}\n onClick={() => {\n setActionPosition('back');\n if (modified && !isSubmitting) {\n setIsConfirmationOpen(true);\n } else {\n const previousRelation = getPreviousDocument();\n if (previousRelation) {\n removeLastDocumentFromHistory();\n changeDocument(previousRelation);\n }\n }\n }}\n marginRight={1}\n >\n <ArrowLeft />\n </IconButton>\n <Typography tag=\"span\" fontWeight={600}>\n {formatMessage({\n id: 'content-manager.components.RelationInputModal.modal-title',\n defaultMessage: 'Edit a relation',\n })}\n </Typography>\n </Flex>\n </Flex>\n </Modal.Header>\n <RelationModalBody>\n <IconButton\n onClick={() => {\n setActionPosition('navigate');\n\n if (modified && !isSubmitting) {\n setIsConfirmationOpen(true);\n } else {\n navigate(getFullPageLink());\n }\n }}\n variant=\"tertiary\"\n label={formatMessage({\n id: 'content-manager.components.RelationInputModal.button-fullpage',\n defaultMessage: 'Go to entry',\n })}\n >\n <ArrowsOut />\n </IconButton>\n </RelationModalBody>\n <Modal.Footer>\n <Button\n onClick={() => {\n if (modified && !isSubmitting) {\n setIsConfirmationOpen(true);\n } else {\n handleToggleModal();\n }\n }}\n variant=\"tertiary\"\n >\n {formatMessage({\n id: 'app.components.Button.cancel',\n defaultMessage: 'Cancel',\n })}\n </Button>\n </Modal.Footer>\n </CustomModalContent>\n </Modal.Root>\n <Dialog.Root open={isConfirmationOpen} onOpenChange={setIsConfirmationOpen}>\n <ConfirmDialog\n onConfirm={() => {\n handleConfirm();\n setIsConfirmationOpen(false);\n resetForm();\n }}\n onCancel={() => {\n setIsConfirmationOpen(false);\n }}\n variant=\"danger\"\n >\n {formatMessage({\n id: 'content-manager.components.RelationInputModal.confirmation-message',\n defaultMessage:\n 'Some changes were not saved. Are you sure you want to close this relation? All changes that were not saved will be lost.',\n })}\n </ConfirmDialog>\n </Dialog.Root>\n </RelationModalProvider>\n );\n }}\n </FormContext>\n );\n};\n\nconst CustomTextButton = styled(TextButton)`\n & > span {\n font-size: ${({ theme }) => theme.fontSizes[2]};\n width: inherit;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n }\n`;\n\ninterface RelationModalBodyProps {\n /**\n * Additional modal actions such as \"Open in full page\"\n */\n children: React.ReactNode;\n}\n\nconst RelationModalBody = ({ children }: RelationModalBodyProps) => {\n const { formatMessage } = useIntl();\n\n const documentMeta = useDocumentContext('RelationModalBody', (state) => state.meta);\n const documentResponse = useDocumentContext('RelationModalBody', (state) => state.document);\n const onPreview = useDocumentContext('RelationModalBody', (state) => state.onPreview);\n const documentLayoutResponse = useDocumentLayout(documentMeta.model);\n const plugins = useStrapiApp('RelationModalBody', (state) => state.plugins);\n\n const initialValues = documentResponse.getInitialFormValues();\n\n const {\n permissions = [],\n isLoading: isLoadingPermissions,\n error,\n } = useRBAC(\n PERMISSIONS.map((action) => ({\n action,\n subject: documentMeta.model,\n }))\n );\n\n const isLoading =\n isLoadingPermissions || documentLayoutResponse.isLoading || documentResponse.isLoading;\n if (isLoading && !documentResponse.document?.documentId) {\n return (\n <Loader small>\n {formatMessage({\n id: 'content-manager.ListViewTable.relation-loading',\n defaultMessage: 'Relations are loading',\n })}\n </Loader>\n );\n }\n\n if (\n error ||\n !documentMeta.model ||\n documentLayoutResponse.error ||\n !documentResponse.document ||\n !documentResponse.meta ||\n !documentResponse.schema ||\n !initialValues\n ) {\n return (\n <Flex alignItems=\"center\" height=\"100%\" justifyContent=\"center\">\n <EmptyStateLayout\n icon={<WarningCircle width=\"16rem\" />}\n content={formatMessage({\n id: 'anErrorOccurred',\n defaultMessage: 'Whoops! Something went wrong. Please, try again.',\n })}\n />\n </Flex>\n );\n }\n\n const documentTitle = documentResponse.getTitle(documentLayoutResponse.edit.settings.mainField);\n const hasDraftAndPublished = documentResponse.schema?.options?.draftAndPublish ?? false;\n\n const props = {\n activeTab: 'draft',\n collectionType: documentMeta.collectionType,\n model: documentMeta.model,\n documentId: documentMeta.documentId,\n document: documentResponse.document,\n meta: documentResponse.meta,\n onPreview,\n } satisfies DocumentActionProps;\n\n return (\n <Modal.Body>\n <DocumentRBAC permissions={permissions} model={documentMeta.model}>\n <Flex alignItems=\"flex-start\" direction=\"column\" gap={2}>\n <Flex width=\"100%\" justifyContent=\"space-between\" gap={2}>\n <Typography tag=\"h2\" variant=\"alpha\">\n {documentTitle}\n </Typography>\n <Flex gap={2}>\n {children}\n <DescriptionComponentRenderer\n props={props}\n descriptions={(\n plugins['content-manager'].apis as ContentManagerPlugin['config']['apis']\n ).getDocumentActions('relation-modal')}\n >\n {(actions) => {\n const filteredActions = actions.filter((action) => {\n return [action.position].flat().includes('relation-modal');\n });\n const [primaryAction, secondaryAction] = filteredActions;\n\n if (!primaryAction && !secondaryAction) return null;\n\n // Both actions are available when draft and publish enabled\n if (primaryAction && secondaryAction) {\n return (\n <>\n {/* Save */}\n <DocumentActionButton\n {...secondaryAction}\n variant={secondaryAction.variant || 'secondary'}\n />\n {/* Publish */}\n <DocumentActionButton\n {...primaryAction}\n variant={primaryAction.variant || 'default'}\n />\n </>\n );\n }\n\n // Otherwise we just have the save action\n return (\n <DocumentActionButton\n {...primaryAction}\n variant={primaryAction.variant || 'secondary'}\n />\n );\n }}\n </DescriptionComponentRenderer>\n </Flex>\n </Flex>\n {hasDraftAndPublished ? (\n <Box>\n <DocumentStatus status={documentResponse.document?.status} />\n </Box>\n ) : null}\n </Flex>\n\n <Flex flex={1} overflow=\"auto\" alignItems=\"stretch\" paddingTop={7}>\n <Box overflow=\"auto\" flex={1}>\n <FormLayout\n layout={documentLayoutResponse.edit.layout}\n document={documentResponse}\n hasBackground={false}\n />\n </Box>\n </Flex>\n </DocumentRBAC>\n </Modal.Body>\n );\n};\n\nexport { RelationModalForm };\n","import * as React from 'react';\n\nimport {\n type InputProps,\n useField,\n useForm,\n useNotification,\n useFocusInputField,\n useQueryParams,\n} from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Combobox,\n ComboboxOption,\n Flex,\n IconButton,\n TextButton,\n Typography,\n VisuallyHidden,\n useComposedRefs,\n Link,\n Field,\n FlexComponent,\n BoxComponent,\n} from '@strapi/design-system';\nimport { Cross, Drag, ArrowClockwise } from '@strapi/icons';\nimport { generateNKeysBetween } from 'fractional-indexing';\nimport pipe from 'lodash/fp/pipe';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport { FixedSizeList, ListChildComponentProps } from 'react-window';\nimport { styled } from 'styled-components';\n\nimport { RelationDragPreviewProps } from '../../../../../components/DragPreviews/RelationDragPreview';\nimport { COLLECTION_TYPES } from '../../../../../constants/collections';\nimport { ItemTypes } from '../../../../../constants/dragAndDrop';\nimport { useDocumentContext } from '../../../../../features/DocumentContext';\nimport { useDebounce } from '../../../../../hooks/useDebounce';\nimport { type EditFieldLayout } from '../../../../../hooks/useDocumentLayout';\nimport {\n DROP_SENSITIVITY,\n UseDragAndDropOptions,\n useDragAndDrop,\n} from '../../../../../hooks/useDragAndDrop';\nimport {\n useGetRelationsQuery,\n useLazySearchRelationsQuery,\n RelationResult,\n} from '../../../../../services/relations';\nimport { buildValidParams } from '../../../../../utils/api';\nimport { getRelationLabel } from '../../../../../utils/relations';\nimport { getTranslation } from '../../../../../utils/translations';\nimport { DocumentStatus } from '../../DocumentStatus';\nimport { useComponent } from '../ComponentContext';\nimport { RelationModalForm, getCollectionType } from '../Relations/RelationModal';\n\nimport type { Schema } from '@strapi/types';\n\n/**\n * Remove a relation, whether it's been already saved or not.\n * It's used both in RelationsList, where the \"remove relation\" button is, and in the input,\n * because we sometimes need to remove a previous relation when selecting a new one.\n */\nfunction useHandleDisconnect(fieldName: string, consumerName: string) {\n const field = useField(fieldName);\n const removeFieldRow = useForm(consumerName, (state) => state.removeFieldRow);\n const addFieldRow = useForm(consumerName, (state) => state.addFieldRow);\n\n const handleDisconnect: ListItemProps['data']['handleDisconnect'] = (relation) => {\n if (field.value && field.value.connect) {\n /**\n * A relation will exist in the `connect` array _if_ it has\n * been added without saving. In this case, we just remove it\n * from the connect array\n */\n const indexOfRelationInConnectArray = field.value.connect.findIndex(\n (rel: NonNullable<RelationsFormValue['connect']>[number]) => rel.id === relation.id\n );\n\n if (indexOfRelationInConnectArray >= 0) {\n removeFieldRow(`${fieldName}.connect`, indexOfRelationInConnectArray);\n return;\n }\n }\n\n addFieldRow(`${fieldName}.disconnect`, {\n id: relation.id,\n apiData: {\n id: relation.id,\n documentId: relation.documentId,\n locale: relation.locale,\n },\n });\n };\n\n return handleDisconnect;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * RelationsField\n * -----------------------------------------------------------------------------------------------*/\n\nconst RELATIONS_TO_DISPLAY = 5;\nconst ONE_WAY_RELATIONS = ['oneWay', 'oneToOne', 'manyToOne', 'oneToManyMorph', 'oneToOneMorph'];\n\ntype RelationPosition =\n | (Pick<RelationResult, 'status' | 'locale'> & {\n before: string;\n end?: never;\n })\n | { end: boolean; before?: never; status?: never; locale?: never };\n\ninterface Relation extends Pick<RelationResult, 'documentId' | 'id' | 'locale' | 'status'> {\n href: string;\n label: string;\n position?: RelationPosition;\n __temp_key__: string;\n apiData?: {\n documentId: RelationResult['documentId'];\n id: RelationResult['id'];\n locale?: RelationResult['locale'];\n position: RelationPosition;\n };\n}\n\ninterface RelationsFieldProps\n extends Omit<Extract<EditFieldLayout, { type: 'relation' }>, 'size' | 'hint'>,\n Pick<InputProps, 'hint'> {}\n\nexport interface RelationsFormValue {\n connect?: Relation[];\n disconnect?: Pick<Relation, 'id'>[];\n}\n\n/**\n * TODO: we get a rather ugly flash when we remove a single relation from the list leaving\n * no other relations when we press save. The initial relation re-renders, probably because\n * of the lag in the Form cleaning it's \"disconnect\" array, whilst our data has not been invalidated.\n *\n * Could we invalidate relation data on the document actions? Should we?\n */\n\n/**\n * @internal\n * @description The relations field holds a lot of domain logic for handling relations which is rather complicated\n * At present we do not expose this to plugin developers, however, they are able to overwrite it themselves should\n * they wish to do so.\n */\nconst RelationsField = React.forwardRef<HTMLDivElement, RelationsFieldProps>(\n ({ disabled, label, ...props }, ref) => {\n const currentDocumentMeta = useDocumentContext('RelationsField', (state) => state.meta);\n const currentDocument = useDocumentContext('RelationsField', (state) => state.document);\n const rootDocumentMeta = useDocumentContext(\n 'RelationsField',\n (state) => state.rootDocumentMeta\n );\n\n const [currentPage, setCurrentPage] = React.useState(1);\n const isRootDocument = rootDocumentMeta.documentId === currentDocumentMeta.documentId;\n const documentMeta = isRootDocument ? rootDocumentMeta : currentDocumentMeta;\n\n // Use the documentId from the actual document, not the params (meta)\n const documentId = currentDocument.document?.documentId;\n\n const { formatMessage } = useIntl();\n\n const [{ query }] = useQueryParams();\n const params = documentMeta.params ?? buildValidParams(query);\n\n const isMorph = props.attribute.relation.toLowerCase().includes('morph');\n const isDisabled = isMorph || disabled;\n\n const { componentId, componentUID } = useComponent('RelationsField', ({ uid, id }) => ({\n componentId: id,\n componentUID: uid,\n }));\n\n const isSubmitting = useForm('RelationsList', (state) => state.isSubmitting);\n\n React.useEffect(() => {\n setCurrentPage(1);\n }, [isSubmitting]);\n\n const component = componentUID && currentDocument.components[componentUID];\n /**\n * We'll always have a documentId in a created entry, so we look for a componentId first.\n * Same with `uid` and `documentModel`.\n */\n const model = component ? component.uid : documentMeta.model;\n const id = component && componentId ? componentId.toString() : documentId;\n\n /**\n * The `name` prop is a complete path to the field, e.g. `field1.field2.field3`.\n * Where the above example would a nested field within two components, however\n * we only require the field on the component not the complete path since we query\n * individual components. Therefore we split the string and take the last item.\n */\n const [targetField] = props.name.split('.').slice(-1);\n\n const schemaAttributes = component\n ? (component.attributes ?? {})\n : (currentDocument.schema?.attributes ?? {});\n\n /**\n * Confirm the target field is related to the current document.\n * Since relations can exist in a modal on top of the root document,\n * we need to ensure we are fetching relations for the correct document (root document vs related document),\n */\n const isRelatedToCurrentDocument =\n Object.values(schemaAttributes).filter(\n (attribute) =>\n attribute.type === 'relation' &&\n 'target' in attribute &&\n 'target' in props.attribute &&\n attribute.target === props.attribute.target\n ).length > 0;\n\n const { data, isLoading, isFetching } = useGetRelationsQuery(\n {\n model,\n targetField,\n // below we don't run the query if there is no id.\n id,\n params: {\n ...params,\n pageSize: RELATIONS_TO_DISPLAY,\n page: currentPage,\n },\n },\n {\n refetchOnMountOrArgChange: true,\n skip: !id || !isRelatedToCurrentDocument,\n selectFromResult: (result) => {\n return {\n ...result,\n data: {\n ...result.data,\n results: result.data?.results ? result.data.results : [],\n },\n };\n },\n }\n );\n\n const handleLoadMore = () => {\n setCurrentPage((prev) => prev + 1);\n };\n\n const field = useField(props.name);\n\n const isFetchingMoreRelations = isLoading || isFetching;\n\n const realServerRelationsCount =\n 'pagination' in data && data.pagination ? data.pagination.total : 0;\n\n /**\n * Items that are already connected, but reordered would be in\n * this list, so to get an accurate figure, we remove them.\n */\n const relationsConnected =\n (field.value?.connect ?? []).filter(\n (rel: Relation) => data.results.findIndex((relation) => relation.id === rel.id) === -1\n ).length ?? 0;\n const relationsDisconnected = field.value?.disconnect?.length ?? 0;\n\n const relationsCount = realServerRelationsCount + relationsConnected - relationsDisconnected;\n\n /**\n * This is it, the source of truth for reordering in conjunction with partial loading & updating\n * of relations. Relations on load are given __temp_key__ when fetched, because we don't want to\n * create brand new keys everytime the data updates, just keep adding them onto the newly loaded ones.\n */\n const relations = React.useMemo(() => {\n const ctx = {\n field: field.value,\n // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.\n href: `../${COLLECTION_TYPES}/${props.attribute.targetModel}`,\n mainField: props.mainField,\n };\n\n /**\n * Tidy up our data.\n */\n const transformations = pipe(\n removeConnected(ctx),\n removeDisconnected(ctx),\n addLabelAndHref(ctx)\n );\n\n const transformedRels = transformations([...data.results]);\n\n /**\n * THIS IS CRUCIAL. If you don't sort by the __temp_key__ which comes from fractional indexing\n * then the list will be in the wrong order.\n */\n return [...transformedRels, ...(field.value?.connect ?? [])].sort((a, b) => {\n if (a.__temp_key__ < b.__temp_key__) return -1;\n if (a.__temp_key__ > b.__temp_key__) return 1;\n return 0;\n });\n }, [\n data.results,\n field.value,\n // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.\n props.attribute.targetModel,\n props.mainField,\n ]);\n\n const handleDisconnect = useHandleDisconnect(props.name, 'RelationsField');\n\n const handleConnect: RelationsInputProps['onChange'] = (relation) => {\n const [lastItemInList] = relations.slice(-1);\n\n const item = {\n id: relation.id,\n apiData: {\n id: relation.id,\n documentId: relation.documentId,\n locale: relation.locale,\n },\n status: relation.status,\n /**\n * If there's a last item, that's the first key we use to generate out next one.\n */\n __temp_key__: generateNKeysBetween(lastItemInList?.__temp_key__ ?? null, null, 1)[0],\n // Fallback to `id` if there is no `mainField` value, which will overwrite the above `id` property with the exact same data.\n [props.mainField?.name ?? 'documentId']: relation[props.mainField?.name ?? 'documentId'],\n label: getRelationLabel(relation, props.mainField),\n // @ts-expect-error – targetModel does exist on the attribute, but it's not typed.\n href: `../${COLLECTION_TYPES}/${props.attribute.targetModel}/${relation.documentId}?${relation.locale ? `plugins[i18n][locale]=${relation.locale}` : ''}`,\n };\n\n if (ONE_WAY_RELATIONS.includes(props.attribute.relation)) {\n // Remove any existing relation so they can be replaced with the new one\n field.value?.connect?.forEach(handleDisconnect);\n relations.forEach(handleDisconnect);\n\n field.onChange(`${props.name}.connect`, [item]);\n } else {\n field.onChange(`${props.name}.connect`, [...(field.value?.connect ?? []), item]);\n }\n };\n\n return (\n <Flex\n ref={ref}\n direction=\"column\"\n gap={3}\n justifyContent=\"space-between\"\n alignItems=\"stretch\"\n wrap=\"wrap\"\n >\n <StyledFlex direction=\"column\" alignItems=\"start\" gap={2} width=\"100%\">\n <RelationsInput\n disabled={isDisabled}\n // NOTE: we should not default to using the documentId if the component is being created (componentUID is undefined)\n id={componentUID && component ? (componentId ? `${componentId}` : '') : documentId}\n label={`${label} ${relationsCount > 0 ? `(${relationsCount})` : ''}`}\n model={model}\n onChange={handleConnect}\n isRelatedToCurrentDocument={isRelatedToCurrentDocument}\n {...props}\n />\n {'pagination' in data &&\n data.pagination &&\n data.pagination.pageCount > data.pagination.page ? (\n <TextButton\n disabled={isFetchingMoreRelations}\n onClick={handleLoadMore}\n loading={isFetchingMoreRelations}\n startIcon={<ArrowClockwise />}\n // prevent the label from line-wrapping\n shrink={0}\n >\n {formatMessage({\n id: getTranslation('relation.loadMore'),\n defaultMessage: 'Load More',\n })}\n </TextButton>\n ) : null}\n </StyledFlex>\n <RelationsList\n data={relations}\n serverData={data.results}\n disabled={isDisabled}\n name={props.name}\n isLoading={isFetchingMoreRelations}\n relationType={props.attribute.relation}\n // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.\n targetModel={props.attribute.targetModel}\n />\n </Flex>\n );\n }\n);\n\n/**\n * TODO: this can be removed once we stop shipping Inputs with\n * labels wrapped round in DS@2.\n */\nconst StyledFlex = styled<FlexComponent>(Flex)`\n & > div {\n width: 100%;\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * Relation Transformations\n * -----------------------------------------------------------------------------------------------*/\n\ninterface TransformationContext extends Pick<RelationsFieldProps, 'mainField'> {\n field?: RelationsFormValue;\n href: string;\n}\n\n/**\n * If it's in the connected array, it can get out of our data array,\n * we'll be putting it back in later and sorting it anyway.\n */\nconst removeConnected =\n ({ field }: TransformationContext) =>\n (relations: RelationResult[]) => {\n return relations.filter((relation) => {\n const connectedRelations = field?.connect ?? [];\n\n return connectedRelations.findIndex((rel) => rel.id === relation.id) === -1;\n });\n };\n\n/**\n * @description Removes relations that are in the `disconnect` array of the field\n */\nconst removeDisconnected =\n ({ field }: TransformationContext) =>\n (relations: RelationResult[]): RelationResult[] =>\n relations.filter((relation) => {\n const disconnectedRelations = field?.disconnect ?? [];\n\n return disconnectedRelations.findIndex((rel) => rel.id === relation.id) === -1;\n });\n\n/**\n * @description Adds a label and href to the relation object we use this to render\n * a better UI where we can link to the relation and display a human-readable label.\n */\nconst addLabelAndHref =\n ({ mainField, href }: TransformationContext) =>\n (relations: RelationResult[]): Relation[] =>\n relations.map((relation) => {\n return {\n ...relation,\n // Fallback to `id` if there is no `mainField` value, which will overwrite the above `documentId` property with the exact same data.\n [mainField?.name ?? 'documentId']: relation[mainField?.name ?? 'documentId'],\n label: getRelationLabel(relation, mainField),\n href: `${href}/${relation.documentId}?${relation.locale ? `plugins[i18n][locale]=${relation.locale}` : ''}`,\n };\n });\n\n/* -------------------------------------------------------------------------------------------------\n * RelationsInput\n * -----------------------------------------------------------------------------------------------*/\n\ninterface RelationsInputProps extends Omit<RelationsFieldProps, 'type'> {\n id?: string;\n model: string;\n isRelatedToCurrentDocument: boolean;\n onChange: (\n relation: Pick<RelationResult, 'documentId' | 'id' | 'locale' | 'status'> & {\n [key: string]: any;\n }\n ) => void;\n}\n\n/**\n * @description Contains all the logic for the combobox that can search\n * for relations and then add them to the field's connect array.\n */\nconst RelationsInput = ({\n hint,\n id,\n model,\n label,\n labelAction,\n name,\n mainField,\n placeholder,\n required,\n unique: _unique,\n 'aria-label': _ariaLabel,\n onChange,\n isRelatedToCurrentDocument,\n ...props\n}: RelationsInputProps) => {\n const [textValue, setTextValue] = React.useState<string | undefined>('');\n const [searchParams, setSearchParams] = React.useState({\n _q: '',\n page: 1,\n });\n const { toggleNotification } = useNotification();\n const [{ query }] = useQueryParams();\n const currentDocumentMeta = useDocumentContext('RelationsInput', (state) => state.meta);\n const rootDocumentMeta = useDocumentContext('RelationsInput', (state) => state.rootDocumentMeta);\n const isRootDocument = rootDocumentMeta.documentId === currentDocumentMeta.documentId;\n const documentMeta = isRootDocument ? rootDocumentMeta : currentDocumentMeta;\n\n const { formatMessage } = useIntl();\n const fieldRef = useFocusInputField<HTMLInputElement>(name);\n const field = useField<RelationsFormValue>(name);\n\n const searchParamsDebounced = useDebounce(searchParams, 300);\n const [searchForTrigger, { data, isLoading }] = useLazySearchRelationsQuery();\n\n /**\n * Because we're using a lazy query, we need to trigger the search\n * when the component mounts and when the search params change.\n * We also need to trigger the search when the field value changes\n * so that we can filter out the relations that are already connected.\n */\n React.useEffect(() => {\n /**\n * The `name` prop is a complete path to the field, e.g. `field1.field2.field3`.\n * Where the above example would a nested field within two components, however\n * we only require the field on the component not the complete path since we query\n * individual components. Therefore we split the string and take the last item.\n */\n const [targetField] = name.split('.').slice(-1);\n\n // Return early if there is no relation to the document\n if (!isRelatedToCurrentDocument) return;\n\n const params = documentMeta.params ?? buildValidParams(query);\n\n searchForTrigger({\n model,\n targetField,\n params: {\n ...params,\n id: id ?? '',\n pageSize: 10,\n idsToInclude: field.value?.disconnect?.map((rel) => rel.id.toString()) ?? [],\n idsToOmit: field.value?.connect?.map((rel) => rel.id.toString()) ?? [],\n ...searchParamsDebounced,\n },\n });\n }, [\n field.value?.connect,\n field.value?.disconnect,\n id,\n model,\n name,\n query,\n searchForTrigger,\n searchParamsDebounced,\n isRelatedToCurrentDocument,\n documentMeta,\n ]);\n\n const handleSearch = async (search: string) => {\n setSearchParams((s) => ({ ...s, _q: search, page: 1 }));\n };\n\n const hasNextPage = data?.pagination ? data.pagination.page < data.pagination.pageCount : false;\n\n const options = data?.results ?? [];\n\n const handleChange = (relationId?: string) => {\n if (!relationId) {\n return;\n }\n\n const relation = options.find((opt) => opt.id.toString() === relationId);\n\n if (!relation) {\n // This is very unlikely to happen, but it ensures we don't have any data for.\n console.error(\n \"You've tried to add a relation with an id that does not exist in the options you can see, this is likely a bug with Strapi. Please open an issue.\"\n );\n\n toggleNotification({\n message: formatMessage({\n id: getTranslation('relation.error-adding-relation'),\n defaultMessage: 'An error occurred while trying to add the relation.',\n }),\n type: 'danger',\n });\n\n return;\n }\n\n /**\n * You need to give this relation a correct _temp_key_ but\n * this component doesn't know about those ones, you can't rely\n * on the connect array because that doesn't hold items that haven't\n * moved. So use a callback to fill in the gaps when connecting.\n *\n */\n onChange(relation);\n };\n\n const handleLoadMore = () => {\n if (!data || !data.pagination) {\n return;\n } else if (data.pagination.page < data.pagination.pageCount) {\n setSearchParams((s) => ({ ...s, page: s.page + 1 }));\n }\n };\n\n React.useLayoutEffect(() => {\n setTextValue('');\n }, [field.value]);\n\n return (\n <Field.Root error={field.error} hint={hint} name={name} required={required}>\n <Field.Label action={labelAction}>{label}</Field.Label>\n <Combobox\n ref={fieldRef}\n name={name}\n autocomplete=\"list\"\n placeholder={\n placeholder ||\n formatMessage({\n id: getTranslation('relation.add'),\n defaultMessage: 'Add relation',\n })\n }\n hasMoreItems={hasNextPage}\n loading={isLoading}\n onOpenChange={() => {\n handleSearch(textValue ?? '');\n }}\n noOptionsMessage={() =>\n formatMessage({\n id: getTranslation('relation.notAvailable'),\n defaultMessage: 'No relations available',\n })\n }\n loadingMessage={formatMessage({\n id: getTranslation('relation.isLoading'),\n defaultMessage: 'Relations are loading',\n })}\n onLoadMore={handleLoadMore}\n textValue={textValue}\n onChange={handleChange}\n onTextValueChange={(text) => {\n setTextValue(text);\n }}\n onInputChange={(event) => {\n handleSearch(event.currentTarget.value);\n }}\n {...props}\n >\n {options.map((opt) => {\n const textValue = getRelationLabel(opt, mainField);\n\n return (\n <ComboboxOption key={opt.id} value={opt.id.toString()} textValue={textValue}>\n <Flex gap={2} justifyContent=\"space-between\">\n <Typography ellipsis>{textValue}</Typography>\n {opt.status ? <DocumentStatus status={opt.status} /> : null}\n </Flex>\n </ComboboxOption>\n );\n })}\n </Combobox>\n <Field.Error />\n <Field.Hint />\n </Field.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * RelationsList\n * -----------------------------------------------------------------------------------------------*/\nconst RELATION_ITEM_HEIGHT = 50;\nconst RELATION_GUTTER = 4;\n\ninterface RelationsListProps extends Pick<RelationsFieldProps, 'disabled' | 'name'> {\n data: Relation[];\n isLoading?: boolean;\n relationType: Schema.Attribute.RelationKind.Any;\n /**\n * The existing relations connected on the server. We need these to diff against.\n */\n serverData: RelationResult[];\n targetModel: string;\n}\n\nconst RelationsList = ({\n data,\n serverData,\n disabled,\n name,\n isLoading,\n relationType,\n targetModel,\n}: RelationsListProps) => {\n const ariaDescriptionId = React.useId();\n const { formatMessage } = useIntl();\n const listRef = React.useRef<FixedSizeList>(null);\n const outerListRef = React.useRef<HTMLUListElement>(null);\n const [overflow, setOverflow] = React.useState<'top' | 'bottom' | 'top-bottom'>();\n const [liveText, setLiveText] = React.useState('');\n const field = useField(name);\n\n React.useEffect(() => {\n if (data.length <= RELATIONS_TO_DISPLAY) {\n return setOverflow(undefined);\n }\n\n const handleNativeScroll = (e: Event) => {\n const el = e.target as HTMLUListElement;\n const parentScrollContainerHeight = (el.parentNode as HTMLDivElement).scrollHeight;\n const maxScrollBottom = el.scrollHeight - el.scrollTop;\n\n if (el.scrollTop === 0) {\n return setOverflow('bottom');\n }\n\n if (maxScrollBottom === parentScrollContainerHeight) {\n return setOverflow('top');\n }\n\n return setOverflow('top-bottom');\n };\n\n const outerListRefCurrent = outerListRef?.current;\n\n if (!isLoading && data.length > 0 && outerListRefCurrent) {\n outerListRef.current.addEventListener('scroll', handleNativeScroll);\n }\n\n return () => {\n if (outerListRefCurrent) {\n outerListRefCurrent.removeEventListener('scroll', handleNativeScroll);\n }\n };\n }, [isLoading, data.length]);\n\n const getItemPos = (index: number) => `${index + 1} of ${data.length}`;\n\n const handleMoveItem: UseDragAndDropOptions['onMoveItem'] = (newIndex, oldIndex) => {\n const item = data[oldIndex];\n\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.reorder'),\n defaultMessage: '{item}, moved. New position in list: {position}.',\n },\n {\n item: item.label ?? item.documentId,\n position: getItemPos(newIndex),\n }\n )\n );\n\n /**\n * Splicing mutates the array, so we need to create a new array\n */\n const newData = [...data];\n const currentRow = data[oldIndex];\n\n const startKey =\n oldIndex > newIndex ? newData[newIndex - 1]?.__temp_key__ : newData[newIndex]?.__temp_key__;\n const endKey =\n oldIndex > newIndex ? newData[newIndex]?.__temp_key__ : newData[newIndex + 1]?.__temp_key__;\n\n /**\n * We're moving the relation between two other relations, so\n * we need to generate a new key that keeps the order\n */\n const [newKey] = generateNKeysBetween(startKey, endKey, 1);\n\n newData.splice(oldIndex, 1);\n newData.splice(newIndex, 0, { ...currentRow, __temp_key__: newKey });\n\n /**\n * Now we diff against the server to understand what's different so we\n * can keep the connect array nice and tidy. It also needs reversing because\n * we reverse the relations from the server in the first place.\n */\n const connectedRelations = newData\n .reduce<Relation[]>((acc, relation, currentIndex, array) => {\n const relationOnServer = serverData.find((oldRelation) => oldRelation.id === relation.id);\n\n const relationInFront = array[currentIndex + 1];\n\n if (!relationOnServer || relationOnServer.__temp_key__ !== relation.__temp_key__) {\n const position = relationInFront\n ? {\n before: relationInFront.documentId,\n locale: relationInFront.locale,\n status:\n 'publishedAt' in relationInFront && relationInFront.publishedAt\n ? ('published' as Relation['status'])\n : ('draft' as Relation['status']),\n }\n : { end: true };\n\n const relationWithPosition: Relation = {\n ...relation,\n ...{\n apiData: {\n id: relation.id,\n documentId: relation.documentId ?? relation.apiData?.documentId ?? '',\n locale: relation.locale || relation.apiData?.locale,\n position,\n },\n },\n };\n\n return [...acc, relationWithPosition];\n }\n\n return acc;\n }, [])\n .toReversed();\n\n field.onChange(`${name}.connect`, connectedRelations);\n };\n\n const handleGrabItem: UseDragAndDropOptions['onGrabItem'] = (index) => {\n const item = data[index];\n\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.grab-item'),\n defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`,\n },\n {\n item: item.label ?? item.documentId,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const handleDropItem: UseDragAndDropOptions['onDropItem'] = (index) => {\n const { href: _href, label, ...item } = data[index];\n\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.drop-item'),\n defaultMessage: `{item}, dropped. Final position in list: {position}.`,\n },\n {\n item: label ?? item.documentId,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const handleCancel: UseDragAndDropOptions['onCancel'] = (index) => {\n const item = data[index];\n\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.cancel-item'),\n defaultMessage: '{item}, dropped. Re-order cancelled.',\n },\n {\n item: item.label ?? item.documentId,\n }\n )\n );\n };\n\n const handleDisconnect = useHandleDisconnect(name, 'RelationsList');\n\n /**\n * These relation types will only ever have one item\n * in their list, so you can't reorder a single item!\n */\n const canReorder = !ONE_WAY_RELATIONS.includes(relationType);\n\n const dynamicListHeight =\n data.length > RELATIONS_TO_DISPLAY\n ? Math.min(data.length, RELATIONS_TO_DISPLAY) * (RELATION_ITEM_HEIGHT + RELATION_GUTTER) +\n RELATION_ITEM_HEIGHT / 2\n : Math.min(data.length, RELATIONS_TO_DISPLAY) * (RELATION_ITEM_HEIGHT + RELATION_GUTTER);\n\n return (\n <ShadowBox $overflowDirection={overflow}>\n <VisuallyHidden id={ariaDescriptionId}>\n {formatMessage({\n id: getTranslation('dnd.instructions'),\n defaultMessage: `Press spacebar to grab and re-order`,\n })}\n </VisuallyHidden>\n <VisuallyHidden aria-live=\"assertive\">{liveText}</VisuallyHidden>\n {/* @ts-expect-error – width is expected, but we've not needed to pass it before. */}\n <FixedSizeList\n height={dynamicListHeight}\n ref={listRef}\n outerRef={outerListRef}\n itemCount={data.length}\n itemSize={RELATION_ITEM_HEIGHT + RELATION_GUTTER}\n itemData={{\n ariaDescribedBy: ariaDescriptionId,\n canDrag: canReorder,\n disabled,\n handleCancel,\n handleDropItem,\n handleGrabItem,\n handleMoveItem,\n name,\n handleDisconnect,\n relations: data,\n targetModel,\n }}\n itemKey={(index) => data[index].id}\n innerElementType=\"ol\"\n >\n {ListItem}\n </FixedSizeList>\n </ShadowBox>\n );\n};\n\nconst ShadowBox = styled<BoxComponent>(Box)<{\n $overflowDirection?: 'top-bottom' | 'top' | 'bottom';\n}>`\n position: relative;\n overflow: hidden;\n flex: 1;\n\n &:before,\n &:after {\n position: absolute;\n width: 100%;\n height: 4px;\n z-index: 1;\n }\n\n &:before {\n /* TODO: as for DS Table component we would need this to be handled by the DS theme */\n content: '';\n background: linear-gradient(rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);\n top: 0;\n opacity: ${({ $overflowDirection }) =>\n $overflowDirection === 'top-bottom' || $overflowDirection === 'top' ? 1 : 0};\n transition: opacity 0.2s ease-in-out;\n }\n\n &:after {\n /* TODO: as for DS Table component we would need this to be handled by the DS theme */\n content: '';\n background: linear-gradient(0deg, rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);\n bottom: 0;\n opacity: ${({ $overflowDirection }) =>\n $overflowDirection === 'top-bottom' || $overflowDirection === 'bottom' ? 1 : 0};\n transition: opacity 0.2s ease-in-out;\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * ListItem\n * -----------------------------------------------------------------------------------------------*/\n\ninterface ListItemProps extends Pick<ListChildComponentProps, 'style' | 'index'> {\n data: {\n ariaDescribedBy: string;\n canDrag?: boolean;\n disabled?: boolean;\n handleCancel: UseDragAndDropOptions['onCancel'];\n handleDropItem: UseDragAndDropOptions['onDropItem'];\n handleGrabItem: UseDragAndDropOptions['onGrabItem'];\n handleMoveItem: UseDragAndDropOptions['onMoveItem'];\n handleDisconnect: (relation: Relation) => void;\n name: string;\n relations: Relation[];\n targetModel: string;\n };\n}\n\nconst ListItem = ({ data, index, style }: ListItemProps) => {\n const {\n ariaDescribedBy,\n canDrag = false,\n disabled = false,\n handleCancel,\n handleDisconnect,\n handleDropItem,\n handleGrabItem,\n handleMoveItem,\n name,\n relations,\n targetModel,\n } = data;\n\n const { formatMessage } = useIntl();\n\n const { href, id, label, status, documentId, apiData, locale } = relations[index];\n\n const [{ handlerId, isDragging, handleKeyDown }, relationRef, dropRef, dragRef, dragPreviewRef] =\n useDragAndDrop<number, Omit<RelationDragPreviewProps, 'width'>, HTMLDivElement>(\n canDrag && !disabled,\n {\n type: `${ItemTypes.RELATION}_${name}`,\n index,\n item: {\n displayedValue: label,\n status,\n id: id,\n index,\n },\n onMoveItem: handleMoveItem,\n onDropItem: handleDropItem,\n onGrabItem: handleGrabItem,\n onCancel: handleCancel,\n dropSensitivity: DROP_SENSITIVITY.REGULAR,\n }\n );\n\n const composedRefs = useComposedRefs<HTMLDivElement>(relationRef, dragRef);\n\n React.useEffect(() => {\n dragPreviewRef(getEmptyImage());\n }, [dragPreviewRef]);\n\n return (\n <Box\n style={style}\n tag=\"li\"\n ref={dropRef}\n aria-describedby={ariaDescribedBy}\n cursor={canDrag ? 'all-scroll' : 'default'}\n >\n {isDragging ? (\n <RelationItemPlaceholder />\n ) : (\n <Flex\n paddingTop={2}\n paddingBottom={2}\n paddingLeft={canDrag ? 2 : 4}\n paddingRight={4}\n hasRadius\n borderColor=\"neutral200\"\n background={disabled ? 'neutral150' : 'neutral0'}\n justifyContent=\"space-between\"\n ref={composedRefs}\n data-handler-id={handlerId}\n >\n <FlexWrapper gap={1}>\n {canDrag ? (\n <IconButton\n tag=\"div\"\n role=\"button\"\n tabIndex={0}\n withTooltip={false}\n label={formatMessage({\n id: getTranslation('components.RelationInput.icon-button-aria-label'),\n defaultMessage: 'Drag',\n })}\n variant=\"ghost\"\n onKeyDown={handleKeyDown}\n disabled={disabled}\n >\n <Drag />\n </IconButton>\n ) : null}\n <Flex width=\"100%\" minWidth={0} justifyContent=\"space-between\">\n <Box minWidth={0} paddingTop={1} paddingBottom={1} paddingRight={4}>\n <RelationModalForm\n triggerButtonLabel={label}\n relation={{\n documentId: documentId ?? apiData?.documentId,\n model: targetModel,\n collectionType: getCollectionType(href)!,\n params: {\n locale: locale || apiData?.locale || null,\n },\n }}\n />\n </Box>\n {status ? <DocumentStatus status={status} /> : null}\n </Flex>\n </FlexWrapper>\n <Box paddingLeft={4}>\n <IconButton\n onClick={() => handleDisconnect(relations[index])}\n disabled={disabled}\n label={formatMessage({\n id: getTranslation('relation.disconnect'),\n defaultMessage: 'Remove',\n })}\n variant=\"ghost\"\n size=\"S\"\n >\n <Cross />\n </IconButton>\n </Box>\n </Flex>\n )}\n </Box>\n );\n};\n\nconst FlexWrapper = styled<FlexComponent>(Flex)`\n width: 100%;\n /* Used to prevent endAction to be pushed out of container */\n min-width: 0;\n\n & > div[role='button'] {\n cursor: all-scroll;\n }\n`;\n\nconst DisconnectButton = styled.button`\n svg path {\n fill: ${({ theme, disabled }) =>\n disabled ? theme.colors.neutral600 : theme.colors.neutral500};\n }\n\n &:hover svg path,\n &:focus svg path {\n fill: ${({ theme, disabled }) => !disabled && theme.colors.neutral600};\n }\n`;\n\nconst LinkEllipsis = styled(Link)`\n display: block;\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n }\n`;\n\nconst RelationItemPlaceholder = () => (\n <Box\n paddingTop={2}\n paddingBottom={2}\n paddingLeft={4}\n paddingRight={4}\n hasRadius\n borderStyle=\"dashed\"\n borderColor=\"primary600\"\n borderWidth=\"1px\"\n background=\"primary100\"\n height={`calc(100% - ${RELATION_GUTTER}px)`}\n />\n);\n\nconst MemoizedRelationsField = React.memo(RelationsField);\n\nexport { MemoizedRelationsField as RelationsInput, FlexWrapper, DisconnectButton, LinkEllipsis };\nexport type { RelationsFieldProps };\n","/**\n * Related to the InputUID component, not the UIDs of content-types.\n */\n\nimport { GenerateUID, CheckUIDAvailability } from '../../../shared/contracts/uid';\n\nimport { contentManagerApi } from './api';\n\nconst uidApi = contentManagerApi.injectEndpoints({\n endpoints: (builder) => ({\n getDefaultUID: builder.query<\n GenerateUID.Response['data'],\n GenerateUID.Request['body'] & {\n params: GenerateUID.Request['query'];\n }\n >({\n query: ({ params, ...data }) => {\n return {\n url: '/content-manager/uid/generate',\n method: 'POST',\n data,\n config: {\n params,\n },\n };\n },\n transformResponse: (response: GenerateUID.Response) => response.data,\n }),\n generateUID: builder.mutation<\n GenerateUID.Response['data'],\n GenerateUID.Request['body'] & {\n params: GenerateUID.Request['query'];\n }\n >({\n query: ({ params, ...data }) => ({\n url: '/content-manager/uid/generate',\n method: 'POST',\n data,\n config: {\n params,\n },\n }),\n transformResponse: (response: GenerateUID.Response) => response.data,\n }),\n getAvailability: builder.query<\n CheckUIDAvailability.Response,\n CheckUIDAvailability.Request['body'] & {\n params: CheckUIDAvailability.Request['query'];\n }\n >({\n query: ({ params, ...data }) => ({\n url: '/content-manager/uid/check-availability',\n method: 'POST',\n data,\n config: {\n params,\n },\n }),\n providesTags: (_res, _error, params) => [\n { type: 'UidAvailability', id: params.contentTypeUID },\n ],\n }),\n }),\n});\n\nconst { useGenerateUIDMutation, useGetDefaultUIDQuery, useGetAvailabilityQuery } = uidApi;\n\nexport { useGenerateUIDMutation, useGetDefaultUIDQuery, useGetAvailabilityQuery };\n","import * as React from 'react';\n\nimport {\n type InputProps,\n useField,\n useForm,\n useNotification,\n useAPIErrorHandler,\n useQueryParams,\n useFocusInputField,\n} from '@strapi/admin/strapi-admin';\nimport {\n Field,\n Flex,\n FlexComponent,\n TextInput,\n Typography,\n useComposedRefs,\n} from '@strapi/design-system';\nimport { CheckCircle, WarningCircle, Loader, ArrowClockwise } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { useMatch } from 'react-router-dom';\nimport { styled, keyframes } from 'styled-components';\n\nimport { useDebounce } from '../../../../hooks/useDebounce';\nimport { useDoc } from '../../../../hooks/useDocument';\nimport { CLONE_PATH } from '../../../../router';\nimport {\n useGenerateUIDMutation,\n useGetAvailabilityQuery,\n useGetDefaultUIDQuery,\n} from '../../../../services/uid';\nimport { buildValidParams } from '../../../../utils/api';\n\nimport type { CheckUIDAvailability } from '../../../../../../shared/contracts/uid';\nimport type { Schema } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * InputUID\n * -----------------------------------------------------------------------------------------------*/\n\nconst UID_REGEX = /^[A-Za-z0-9-_.~]*$/;\n\ninterface UIDInputProps extends Omit<InputProps, 'type'> {\n type: Schema.Attribute.TypeOf<Schema.Attribute.UID>;\n}\n\nconst UIDInput = React.forwardRef<any, UIDInputProps>(\n ({ hint, label, labelAction, name, required, ...props }, ref) => {\n const { model, id } = useDoc();\n const allFormValues = useForm('InputUID', (form) => form.values);\n const [availability, setAvailability] = React.useState<CheckUIDAvailability.Response>();\n const [showRegenerate, setShowRegenerate] = React.useState(false);\n const isCloning = useMatch(CLONE_PATH) !== null;\n const field = useField(name);\n const debouncedValue = useDebounce(field.value, 300);\n const hasChanged = debouncedValue !== field.initialValue;\n const { toggleNotification } = useNotification();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n const { formatMessage } = useIntl();\n const [{ query }] = useQueryParams();\n const params = React.useMemo(() => buildValidParams(query), [query]);\n\n const {\n data: defaultGeneratedUID,\n isLoading: isGeneratingDefaultUID,\n error: apiError,\n } = useGetDefaultUIDQuery(\n {\n contentTypeUID: model,\n field: name,\n data: {\n id: id ?? '',\n ...allFormValues,\n },\n params,\n },\n {\n skip: field.value || !required,\n }\n );\n\n React.useEffect(() => {\n if (apiError) {\n toggleNotification({\n type: 'warning',\n message: formatAPIError(apiError),\n });\n }\n }, [apiError, formatAPIError, toggleNotification]);\n\n /**\n * If the defaultGeneratedUID is available, then we set it as the value,\n * but we also want to set it as the initialValue too.\n */\n React.useEffect(() => {\n if (defaultGeneratedUID && field.value === undefined) {\n field.onChange(name, defaultGeneratedUID);\n }\n }, [defaultGeneratedUID, field, name]);\n\n const [generateUID, { isLoading: isGeneratingUID }] = useGenerateUIDMutation();\n\n const handleRegenerateClick = async () => {\n try {\n const res = await generateUID({\n contentTypeUID: model,\n field: name,\n data: { id: id ?? '', ...allFormValues },\n params,\n });\n\n if ('data' in res) {\n field.onChange(name, res.data);\n } else {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n }\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: 'notification.error',\n defaultMessage: 'An error occurred.',\n }),\n });\n }\n };\n\n const {\n data: availabilityData,\n isLoading: isCheckingAvailability,\n error: availabilityError,\n } = useGetAvailabilityQuery(\n {\n contentTypeUID: model,\n field: name,\n value: debouncedValue ? debouncedValue.trim() : '',\n params,\n },\n {\n // Don't check availability if the value is empty or wasn't changed\n skip: !Boolean(\n (hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())\n ),\n }\n );\n\n React.useEffect(() => {\n if (availabilityError) {\n toggleNotification({\n type: 'warning',\n message: formatAPIError(availabilityError),\n });\n }\n }, [availabilityError, formatAPIError, toggleNotification]);\n\n React.useEffect(() => {\n /**\n * always store the data in state because that way as seen below\n * we can then remove the data to stop showing the label.\n */\n setAvailability(availabilityData);\n\n let timer: number;\n\n if (availabilityData?.isAvailable) {\n timer = window.setTimeout(() => {\n setAvailability(undefined);\n }, 4000);\n }\n\n return () => {\n if (timer) {\n clearTimeout(timer);\n }\n };\n }, [availabilityData]);\n\n const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;\n\n const fieldRef = useFocusInputField(name);\n const composedRefs = useComposedRefs(ref, fieldRef);\n\n const shouldShowAvailability =\n (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;\n\n return (\n <Field.Root hint={hint} name={name} error={field.error} required={required}>\n <Field.Label action={labelAction}>{label}</Field.Label>\n <TextInput\n ref={composedRefs}\n disabled={props.disabled}\n endAction={\n <Flex position=\"relative\" gap={1}>\n {shouldShowAvailability && (\n <TextValidation\n alignItems=\"center\"\n gap={1}\n justifyContent=\"flex-end\"\n $available={!!availability?.isAvailable}\n data-not-here-outer\n position=\"absolute\"\n pointerEvents=\"none\"\n right={6}\n width=\"100px\"\n >\n {availability?.isAvailable ? <CheckCircle /> : <WarningCircle />}\n\n <Typography\n textColor={availability.isAvailable ? 'success600' : 'danger600'}\n variant=\"pi\"\n >\n {formatMessage(\n availability.isAvailable\n ? {\n id: 'content-manager.components.uid.available',\n defaultMessage: 'Available',\n }\n : {\n id: 'content-manager.components.uid.unavailable',\n defaultMessage: 'Unavailable',\n }\n )}\n </Typography>\n </TextValidation>\n )}\n\n {!props.disabled && (\n <>\n {showRegenerate && (\n <TextValidation alignItems=\"center\" justifyContent=\"flex-end\" gap={1}>\n <Typography textColor=\"primary600\" variant=\"pi\">\n {formatMessage({\n id: 'content-manager.components.uid.regenerate',\n defaultMessage: 'Regenerate',\n })}\n </Typography>\n </TextValidation>\n )}\n\n <FieldActionWrapper\n onClick={handleRegenerateClick}\n label={formatMessage({\n id: 'content-manager.components.uid.regenerate',\n defaultMessage: 'Regenerate',\n })}\n onMouseEnter={() => setShowRegenerate(true)}\n onMouseLeave={() => setShowRegenerate(false)}\n >\n {isLoading ? (\n <LoadingWrapper data-testid=\"loading-wrapper\">\n <Loader />\n </LoadingWrapper>\n ) : (\n <ArrowClockwise />\n )}\n </FieldActionWrapper>\n </>\n )}\n </Flex>\n }\n onChange={field.onChange}\n value={field.value ?? ''}\n {...props}\n />\n <Field.Error />\n <Field.Hint />\n </Field.Root>\n );\n }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * FieldActionWrapper\n * -----------------------------------------------------------------------------------------------*/\n\nconst FieldActionWrapper = styled(Field.Action)`\n width: 1.6rem;\n\n svg {\n height: 1.6rem;\n width: 1.6rem;\n path {\n fill: ${({ theme }) => theme.colors.neutral400};\n }\n }\n\n svg:hover {\n path {\n fill: ${({ theme }) => theme.colors.primary600};\n }\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * TextValidation\n * -----------------------------------------------------------------------------------------------*/\n\nconst TextValidation = styled<FlexComponent>(Flex)<{ $available?: boolean }>`\n svg {\n height: 1.2rem;\n width: 1.2rem;\n\n path {\n fill: ${({ theme, $available }) =>\n $available ? theme.colors.success600 : theme.colors.danger600};\n }\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * LoadingWrapper\n * -----------------------------------------------------------------------------------------------*/\n\nconst rotation = keyframes`\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(359deg);\n }\n`;\n\nconst LoadingWrapper = styled<FlexComponent>(Flex)`\n animation: ${rotation} 2s infinite linear;\n`;\n\nconst MemoizedUIDInput = React.memo(UIDInput);\n\nexport { MemoizedUIDInput as UIDInput };\nexport type { UIDInputProps };\n","import { getLanguage, highlight, highlightAuto } from 'highlight.js';\nimport Markdown from 'markdown-it';\n// @ts-expect-error - library does not export types\nimport abbr from 'markdown-it-abbr';\nimport container from 'markdown-it-container';\n// @ts-expect-error - library does not export types\nimport deflist from 'markdown-it-deflist';\nimport emoji from 'markdown-it-emoji';\nimport footnote from 'markdown-it-footnote';\n// @ts-expect-error - library does not export types\nimport ins from 'markdown-it-ins';\n// @ts-expect-error - library does not export types\nimport mark from 'markdown-it-mark';\n// @ts-expect-error - library does not export types\nimport sub from 'markdown-it-sub';\n// @ts-expect-error - library does not export types\nimport sup from 'markdown-it-sup';\n\nimport 'highlight.js/styles/solarized-dark.css';\n\nconst md: Markdown = new Markdown({\n html: true, // Enable HTML tags in source\n xhtmlOut: false,\n breaks: true,\n langPrefix: 'language-',\n linkify: true,\n typographer: true,\n // Code from: https://github.com/markdown-it/markdown-it/blob/master/support/demo_template/index.js#L83\n highlight(str, lang) {\n if (lang && lang !== 'auto' && getLanguage(lang)) {\n return (\n '<pre class=\"hljs language-' +\n md.utils.escapeHtml(lang.toLowerCase()) +\n '\"><code>' +\n highlight(lang, str, true).value +\n '</code></pre>'\n );\n }\n\n if (lang === 'auto') {\n const result = highlightAuto(str);\n\n return (\n '<pre class=\"hljs language-' +\n md.utils.escapeHtml(result.language!) +\n '\"><code>' +\n result.value +\n '</code></pre>'\n );\n }\n\n return '<pre class=\"hljs\"><code>' + md.utils.escapeHtml(str) + '</code></pre>';\n },\n})\n .use(abbr)\n .use(container, 'warning')\n .use(container, 'tip')\n .use(deflist)\n .use(emoji)\n .use(footnote)\n .use(ins)\n .use(mark)\n .use(sub)\n .use(sup);\n\n// Code from: https://github.com/markdown-it/markdown-it-footnote/blob/master/index.js#L29\nmd.renderer.rules.footnote_ref = (tokens, idx, options, env, slf) => {\n const caption = slf.rules.footnote_caption?.(tokens, idx, options, env, slf);\n\n return '<sup class=\"footnote-ref\"><span>' + caption + '</span></sup>';\n};\n\nmd.renderer.rules.footnote_anchor = () => {\n /* ↩ with escape code to prevent display as Apple Emoji on iOS */\n return ' <span class=\"footnote-backref\">\\u21a9\\uFE0E</span>';\n};\n\nexport { md };\n","import * as React from 'react';\n\nimport sanitizeHtml from 'sanitize-html';\nimport { styled } from 'styled-components';\n\nimport { md } from './utils/mdRenderer';\n\ninterface PreviewWysiwygProps {\n data?: string;\n}\n\nconst PreviewWysiwyg = ({ data = '' }: PreviewWysiwygProps) => {\n const html = React.useMemo(\n () =>\n sanitizeHtml(md.render(data.replaceAll('\\\\n', '\\n') || ''), {\n ...sanitizeHtml.defaults,\n allowedTags: false,\n allowedAttributes: {\n '*': ['href', 'align', 'alt', 'center', 'width', 'height', 'type', 'controls', 'target'],\n img: ['src', 'alt'],\n source: ['src', 'type'],\n },\n }),\n [data]\n );\n\n return (\n <Wrapper>\n <div dangerouslySetInnerHTML={{ __html: html }} />\n </Wrapper>\n );\n};\n\nconst Wrapper = styled.div`\n position: absolute;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};\n font-size: 1.4rem;\n background-color: ${({ theme }) => theme.colors.neutral0};\n color: ${({ theme }) => theme.colors.neutral800};\n line-height: ${({ theme }) => theme.lineHeights[6]};\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin-block-start: ${({ theme }) => theme.spaces[2]};\n margin-block-end: ${({ theme }) => theme.spaces[2]};\n }\n\n p {\n margin-bottom: ${({ theme }) => theme.spaces[2]};\n }\n\n h1 {\n font-size: 3.6rem;\n font-weight: 600;\n }\n\n h2 {\n font-size: 3rem;\n font-weight: 500;\n }\n\n h3 {\n font-size: 2.4rem;\n font-weight: 500;\n }\n\n h4 {\n font-size: 2rem;\n font-weight: 500;\n }\n\n strong {\n font-weight: 800;\n }\n\n em {\n font-style: italic;\n }\n\n blockquote {\n margin-top: ${({ theme }) => theme.spaces[8]};\n margin-bottom: ${({ theme }) => theme.spaces[7]};\n font-size: 1.4rem;\n font-weight: 400;\n border-left: 4px solid ${({ theme }) => theme.colors.neutral150};\n font-style: italic;\n padding: ${({ theme }) => theme.spaces[2]} ${({ theme }) => theme.spaces[5]};\n }\n\n img {\n max-width: 100%;\n }\n\n table {\n thead {\n background: ${({ theme }) => theme.colors.neutral150};\n\n th {\n padding: ${({ theme }) => theme.spaces[4]};\n }\n }\n tr {\n border: 1px solid ${({ theme }) => theme.colors.neutral200};\n }\n th,\n td {\n padding: ${({ theme }) => theme.spaces[4]};\n border: 1px solid ${({ theme }) => theme.colors.neutral200};\n border-bottom: 0;\n border-top: 0;\n }\n }\n\n pre,\n code {\n font-size: 1.4rem;\n border-radius: 4px;\n /* \n Hard coded since the color is the same between themes,\n theme.colors.neutral800 changes between themes.\n\n Matches the color of the JSON Input component.\n */\n background-color: #32324d;\n max-width: 100%;\n overflow: auto;\n padding: ${({ theme }) => theme.spaces[2]};\n }\n\n /* Inline code */\n p,\n pre,\n td {\n > code {\n color: #839496;\n }\n }\n\n ol {\n list-style-type: decimal;\n margin-block-start: ${({ theme }) => theme.spaces[4]};\n margin-block-end: ${({ theme }) => theme.spaces[4]};\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding-inline-start: ${({ theme }) => theme.spaces[4]};\n\n ol,\n ul {\n margin-block-start: 0px;\n margin-block-end: 0px;\n }\n }\n\n ul {\n list-style-type: disc;\n margin-block-start: ${({ theme }) => theme.spaces[4]};\n margin-block-end: ${({ theme }) => theme.spaces[4]};\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding-inline-start: ${({ theme }) => theme.spaces[4]};\n\n ul,\n ol {\n margin-block-start: 0px;\n margin-block-end: 0px;\n }\n }\n`;\n\nexport { PreviewWysiwyg };\n","import CodeMirror from 'codemirror5';\n\n// Disabling eslint on purpose\n/* eslint-disable */\n\nvar listRE = /^(\\s*)(>[> ]*|[*+-] \\[[x ]\\]\\s|[*+-]\\s|(\\d+)([.)]))(\\s*)/,\n emptyListRE = /^(\\s*)(>[> ]*|[*+-] \\[[x ]\\]|[*+-]|(\\d+)[.)])(\\s*)$/,\n unorderedListRE = /[*+-]\\s/;\n\n/*\n functions coming from CodeMirror addons continuelist.js\n ===> https://github.com/codemirror/CodeMirror/blob/master/addon/edit/continuelist.js\n\n we imported it because the way the addon ask to use markdown mode\n since we have our own markdown preview system we couldn't use it directly\n only thing we changed is removing the part that enabled addon only with markdown mode\n*/\n\nfunction newlineAndIndentContinueMarkdownList(cm: CodeMirror.Editor) {\n // @ts-expect-error - cm does not recognize disableInput.\n if (cm.getOption('disableInput')) return CodeMirror.Pass;\n var ranges = cm.listSelections(),\n replacements = [];\n for (var i = 0; i < ranges.length; i++) {\n var pos = ranges[i].head;\n\n var eolState = cm.getStateAfter(pos.line);\n var inList = eolState.list !== false;\n var inQuote = eolState.quote !== 0;\n\n var line = cm.getLine(pos.line),\n match = listRE.exec(line);\n var cursorBeforeBullet = /^\\s*$/.test(line.slice(0, pos.ch));\n if (!ranges[i].empty() || (!inList && !inQuote) || !match || cursorBeforeBullet) {\n cm.execCommand('newlineAndIndent');\n return;\n }\n if (emptyListRE.test(line)) {\n var endOfQuote = inQuote && />\\s*$/.test(line);\n var endOfList = !/>\\s*$/.test(line);\n if (endOfQuote || endOfList)\n cm.replaceRange(\n '',\n {\n line: pos.line,\n ch: 0,\n },\n {\n line: pos.line,\n ch: pos.ch + 1,\n }\n );\n replacements[i] = '\\n';\n } else {\n var indent = match[1],\n after = match[5];\n var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf('>') >= 0);\n var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace('x', ' ');\n replacements[i] = '\\n' + indent + bullet + after;\n\n if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);\n }\n }\n\n cm.replaceSelections(replacements);\n}\n\nfunction incrementRemainingMarkdownListNumbers(cm: CodeMirror.Editor, pos: CodeMirror.Position) {\n var startLine = pos.line,\n lookAhead = 0,\n skipCount = 0;\n var startItem = listRE.exec(cm.getLine(startLine)),\n startIndent = startItem![1];\n\n do {\n lookAhead += 1;\n var nextLineNumber = startLine + lookAhead;\n var nextLine = cm.getLine(nextLineNumber);\n var nextItem = listRE.exec(nextLine);\n\n if (nextItem) {\n var nextIndent = nextItem[1];\n var newNumber = parseInt(startItem![3], 10) + lookAhead - skipCount;\n var nextNumber = parseInt(nextItem[3], 10),\n itemNumber = nextNumber;\n\n if (startIndent === nextIndent && !isNaN(nextNumber)) {\n if (newNumber === nextNumber) itemNumber = nextNumber + 1;\n if (newNumber > nextNumber) itemNumber = newNumber + 1;\n cm.replaceRange(\n nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),\n {\n line: nextLineNumber,\n ch: 0,\n },\n {\n line: nextLineNumber,\n ch: nextLine.length,\n }\n );\n } else {\n if (startIndent.length > nextIndent.length) return;\n // This doesn't run if the next line immediately indents, as it is\n // not clear of the users intention (new indented item or same level)\n if (startIndent.length < nextIndent.length && lookAhead === 1) return;\n skipCount += 1;\n }\n }\n } while (nextItem);\n}\n\nexport { newlineAndIndentContinueMarkdownList };\n","import * as React from 'react';\n\nimport CodeMirror, { EditorFromTextArea } from 'codemirror5';\nimport { styled } from 'styled-components';\n\nimport { PreviewWysiwyg } from './PreviewWysiwyg';\nimport { newlineAndIndentContinueMarkdownList } from './utils/continueList';\n\nimport type { FieldValue, InputProps } from '@strapi/admin/strapi-admin';\n\nimport 'codemirror5/addon/display/placeholder';\n\ninterface EditorApi {\n focus: () => void;\n scrollIntoView: (args?: Parameters<HTMLElement['scrollIntoView']>[0]) => void;\n}\n\ninterface EditorProps extends Omit<FieldValue, 'initialValue'>, Omit<InputProps, 'type' | 'label'> {\n editorRef: React.MutableRefObject<EditorFromTextArea>;\n isPreviewMode?: boolean;\n isExpandMode?: boolean;\n textareaRef: React.RefObject<HTMLTextAreaElement>;\n}\n\nconst Editor = React.forwardRef<EditorApi, EditorProps>(\n (\n {\n disabled,\n editorRef,\n error,\n isPreviewMode,\n isExpandMode,\n name,\n onChange,\n placeholder,\n textareaRef,\n value,\n },\n forwardedRef\n ) => {\n const onChangeRef = React.useRef(onChange);\n\n React.useEffect(() => {\n if (editorRef.current) {\n // Ensure the editor and its wrapper are cleaned up whenever this view is re-rendered\n // e.g. in case of re-ordering wysiwyg components in a DynamicZone\n editorRef.current.toTextArea();\n }\n editorRef.current = CodeMirror.fromTextArea(textareaRef.current!, {\n lineWrapping: true,\n extraKeys: {\n Enter: 'newlineAndIndentContinueMarkdownList',\n Tab: false,\n 'Shift-Tab': false,\n },\n readOnly: false,\n smartIndent: false,\n placeholder,\n spellcheck: true,\n inputStyle: 'contenteditable',\n });\n\n // @ts-expect-error – doesn't think command exists?\n CodeMirror.commands.newlineAndIndentContinueMarkdownList =\n newlineAndIndentContinueMarkdownList;\n editorRef.current.on('change', (doc) => {\n onChangeRef.current(name, doc.getValue());\n });\n }, [editorRef, textareaRef, name, placeholder]);\n\n React.useEffect(() => {\n if (value && !editorRef.current.hasFocus()) {\n editorRef.current.setValue(value);\n }\n }, [editorRef, value]);\n\n React.useEffect(() => {\n if (isPreviewMode || disabled) {\n editorRef.current.setOption('readOnly', 'nocursor');\n } else {\n editorRef.current.setOption('readOnly', false);\n }\n }, [disabled, isPreviewMode, editorRef]);\n\n React.useEffect(() => {\n if (error) {\n editorRef.current.setOption('screenReaderLabel', error);\n } else {\n // to replace with translation\n editorRef.current.setOption('screenReaderLabel', 'Editor');\n }\n }, [editorRef, error]);\n\n React.useImperativeHandle(\n forwardedRef,\n () => ({\n focus() {\n editorRef.current.getInputField().focus();\n },\n scrollIntoView(args?: Parameters<HTMLElement['scrollIntoView']>[0]) {\n editorRef.current.getInputField().scrollIntoView(args);\n },\n }),\n [editorRef]\n );\n\n return (\n <EditorAndPreviewWrapper>\n <EditorStylesContainer $isExpandMode={isExpandMode} $disabled={disabled || isPreviewMode}>\n <textarea ref={textareaRef} />\n </EditorStylesContainer>\n {isPreviewMode && <PreviewWysiwyg data={value} />}\n </EditorAndPreviewWrapper>\n );\n }\n);\n\nconst EditorAndPreviewWrapper = styled.div`\n position: relative;\n height: calc(100% - 48px);\n`;\n\nconst EditorStylesContainer = styled.div<{ $disabled?: boolean; $isExpandMode?: boolean }>`\n cursor: ${({ $disabled }) => ($disabled ? 'not-allowed !important' : 'auto')};\n height: 100%;\n /* BASICS */\n .CodeMirror-placeholder {\n color: ${({ theme }) => theme.colors.neutral600} !important;\n }\n\n .CodeMirror {\n /* Set height, width, borders, and global font properties here */\n font-size: 1.4rem;\n height: ${({ $isExpandMode }) =>\n $isExpandMode\n ? '100%'\n : '410px'}; // 512px(total height) - 48px (header) - 52px(footer) - 2px border\n color: ${({ theme }) => theme.colors.neutral800};\n direction: ltr;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,\n 'Open Sans', 'Helvetica Neue', sans-serif;\n }\n\n /* PADDING */\n\n .CodeMirror-lines {\n padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};\n /* Vertical padding around content */\n }\n\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n /* The little square between H and V scrollbars */\n background-color: ${({ theme }) => `${theme.colors.neutral0}`};\n }\n\n /* GUTTER */\n\n .CodeMirror-gutters {\n border-right: 1px solid #ddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n }\n .CodeMirror-linenumbers {\n }\n .CodeMirror-linenumber {\n padding: 0 3px 0 5px;\n min-width: 20px;\n text-align: right;\n color: #999;\n white-space: nowrap;\n }\n\n .CodeMirror-guttermarker {\n color: black;\n }\n .CodeMirror-guttermarker-subtle {\n color: #999;\n }\n\n /* CURSOR */\n\n .CodeMirror-cursor {\n border-left: 1px solid black;\n border-right: none;\n width: 0;\n }\n /* Shown when moving in bi-directional text */\n .CodeMirror div.CodeMirror-secondarycursor {\n border-left: 1px solid silver;\n }\n .cm-fat-cursor .CodeMirror-cursor {\n width: auto;\n border: 0 !important;\n background: #7e7;\n }\n .cm-fat-cursor div.CodeMirror-cursors {\n /* z-index: 1; */\n }\n\n .cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n }\n .cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #7e7;\n }\n\n /* Can style cursor different in overwrite (non-insert) mode */\n .CodeMirror-overwrite .CodeMirror-cursor {\n }\n\n .cm-tab {\n display: inline-block;\n text-decoration: inherit;\n }\n\n .CodeMirror-rulers {\n position: absolute;\n left: 0;\n right: 0;\n top: -50px;\n bottom: 0;\n overflow: hidden;\n }\n .CodeMirror-ruler {\n border-left: 1px solid #ccc;\n top: 0;\n bottom: 0;\n position: absolute;\n }\n\n /* DEFAULT THEME */\n\n .cm-header,\n .cm-strong {\n font-weight: bold;\n }\n .cm-em {\n font-style: italic;\n }\n .cm-link {\n text-decoration: underline;\n }\n .cm-strikethrough {\n text-decoration: line-through;\n }\n\n .CodeMirror-composing {\n border-bottom: 2px solid;\n }\n\n /* Default styles for common addons */\n\n div.CodeMirror span.CodeMirror-matchingbracket {\n color: #0b0;\n }\n div.CodeMirror span.CodeMirror-nonmatchingbracket {\n color: #a22;\n }\n .CodeMirror-matchingtag {\n background: rgba(255, 150, 0, 0.3);\n }\n .CodeMirror-activeline-background {\n background: #e8f2ff;\n }\n\n /* STOP */\n\n /* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n .CodeMirror {\n position: relative;\n overflow: hidden;\n background: ${({ theme }) => `${theme.colors.neutral0}`};\n }\n\n .CodeMirror-scroll {\n overflow: scroll !important; /* Things will break if this is overridden */\n /* 50px is the magic margin used to hide the element's real scrollbars */\n /* See overflow: hidden in .CodeMirror */\n margin-bottom: -50px;\n margin-right: -50px;\n padding-bottom: 50px;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n }\n .CodeMirror-sizer {\n position: relative;\n border-right: 50px solid transparent;\n }\n\n /* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n .CodeMirror-vscrollbar,\n .CodeMirror-hscrollbar,\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 1;\n display: none;\n outline: none;\n }\n\n .CodeMirror-vscrollbar {\n right: 0;\n top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n .CodeMirror-hscrollbar {\n bottom: 0;\n left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n }\n .CodeMirror-scrollbar-filler {\n right: 0;\n bottom: 0;\n }\n\n .CodeMirror-lines {\n cursor: text;\n min-height: 1px; /* prevents collapsing before first draw */\n }\n /* Reset some styles that the rest of the page might have set */\n .CodeMirror pre.CodeMirror-line,\n .CodeMirror pre.CodeMirror-line-like {\n -moz-border-radius: 0;\n -webkit-border-radius: 0;\n border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: 1.5;\n color: inherit;\n /* z-index: 2; */\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n }\n\n .CodeMirror pre.CodeMirror-line-like {\n z-index: 2;\n }\n\n .CodeMirror-wrap pre.CodeMirror-line,\n .CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n }\n\n .CodeMirror-linebackground {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 0;\n }\n\n .CodeMirror-linewidget {\n position: relative;\n /* z-index: 2; */\n padding: 0.1px; /* Force widget margins to stay inside of the container */\n }\n\n .CodeMirror-widget {\n }\n\n .CodeMirror-rtl pre {\n direction: rtl;\n }\n\n .CodeMirror-code {\n outline: none;\n }\n\n /* Force content-box sizing for the elements where we expect it */\n .CodeMirror-scroll,\n .CodeMirror-sizer,\n .CodeMirror-gutter,\n .CodeMirror-gutters,\n .CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n }\n\n .CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n\n .CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n border-color: ${({ theme }) => `${theme.colors.neutral800}`};\n }\n .CodeMirror-measure pre {\n position: static;\n }\n\n div.CodeMirror-cursors {\n visibility: hidden;\n position: relative;\n + div {\n z-index: 0 !important;\n }\n }\n\n div.CodeMirror-dragcursors {\n visibility: visible;\n }\n\n .CodeMirror-focused div.CodeMirror-cursors {\n visibility: visible;\n }\n\n .CodeMirror-selected {\n background: ${({ theme }) => theme.colors.neutral200};\n /* z-index: -10; */\n }\n .CodeMirror-crosshair {\n cursor: crosshair;\n }\n\n /* Used to force a border model for a node */\n .cm-force-border {\n padding-right: 0.1px;\n }\n\n /* See issue #2901 */\n .cm-tab-wrap-hack:after {\n content: '';\n }\n\n /* Help users use markselection to safely style text background */\n span.CodeMirror-selectedtext {\n background: none;\n }\n\n span {\n color: ${({ theme }) => theme.colors.neutral800} !important;\n }\n`;\n\nexport { Editor };\nexport type { EditorProps, EditorApi };\n","import * as React from 'react';\n\nimport {\n Button,\n Box,\n BoxComponent,\n Flex,\n FlexComponent,\n FocusTrap,\n Portal,\n Typography,\n} from '@strapi/design-system';\nimport { Collapse } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { PreviewWysiwyg } from './PreviewWysiwyg';\n\ninterface EditorLayoutProps {\n children: React.ReactNode;\n isExpandMode: boolean;\n error?: string;\n previewContent?: string;\n onCollapse: () => void;\n}\n\nconst EditorLayout = ({\n children,\n isExpandMode,\n error,\n previewContent = '',\n onCollapse,\n}: EditorLayoutProps) => {\n const { formatMessage } = useIntl();\n\n React.useEffect(() => {\n if (isExpandMode) {\n document.body.classList.add('lock-body-scroll');\n }\n\n return () => {\n document.body.classList.remove('lock-body-scroll');\n };\n }, [isExpandMode]);\n\n if (isExpandMode) {\n return (\n <Portal role=\"dialog\" aria-modal={false}>\n <FocusTrap onEscape={onCollapse}>\n <ExpandWrapper\n position=\"fixed\"\n top={0}\n left={0}\n right={0}\n bottom={0}\n zIndex={4}\n justifyContent=\"center\"\n onClick={onCollapse}\n >\n <Box<'div'>\n background=\"neutral0\"\n hasRadius\n shadow=\"popupShadow\"\n overflow=\"hidden\"\n width=\"90%\"\n height=\"90%\"\n onClick={(e) => e.stopPropagation()}\n >\n <Flex height=\"100%\" alignItems=\"flex-start\">\n <BoxWithBorder flex=\"1\" height=\"100%\">\n {children}\n </BoxWithBorder>\n <Flex alignItems=\"start\" direction=\"column\" flex={1} height=\"100%\" width=\"100%\">\n <Flex\n height=\"4.8rem\"\n background=\"neutral100\"\n justifyContent=\"flex-end\"\n shrink={0}\n width=\"100%\"\n >\n <ExpandButton onClick={onCollapse} variant=\"tertiary\" size=\"M\">\n <Typography>\n {formatMessage({\n id: 'components.Wysiwyg.collapse',\n defaultMessage: 'Collapse',\n })}\n </Typography>\n <Collapse />\n </ExpandButton>\n </Flex>\n\n <Box position=\"relative\" height=\"100%\" width=\"100%\">\n <PreviewWysiwyg data={previewContent} />\n </Box>\n </Flex>\n </Flex>\n </Box>\n </ExpandWrapper>\n </FocusTrap>\n </Portal>\n );\n }\n\n return (\n <Flex\n borderColor={error ? 'danger600' : 'neutral200'}\n borderStyle=\"solid\"\n borderWidth=\"1px\"\n hasRadius\n direction=\"column\"\n alignItems=\"stretch\"\n >\n {children}\n </Flex>\n );\n};\n\nconst ExpandWrapper = styled<FlexComponent>(Flex)`\n background: ${({ theme }) =>\n `${theme.colors.neutral800}${Math.floor(0.2 * 255)\n .toString(16)\n .padStart(2, '0')}`};\n`;\n\nconst BoxWithBorder = styled<BoxComponent>(Box)`\n border-right: 1px solid ${({ theme }) => theme.colors.neutral200};\n`;\n\nconst ExpandButton = styled(Button)`\n background-color: transparent;\n border: none;\n align-items: center;\n\n & > span {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n }\n\n svg {\n margin-left: ${({ theme }) => `${theme.spaces[2]}`};\n\n path {\n fill: ${({ theme }) => theme.colors.neutral700};\n width: 1.2rem;\n height: 1.2rem;\n }\n }\n`;\n\nexport { EditorLayout, ExpandButton };\nexport type { EditorLayoutProps };\n","import { MutableRefObject } from 'react';\n\nimport CodeMirror from 'codemirror5';\n\nexport const replaceText = (markdownName: string, textToChange: string) => {\n let editedText;\n\n switch (markdownName) {\n case 'Strikethrough':\n editedText = `~~${textToChange}~~`;\n break;\n case 'Bold':\n editedText = `**${textToChange}**`;\n break;\n case 'Italic':\n editedText = `_${textToChange}_`;\n break;\n case 'Underline':\n editedText = `<u>${textToChange}</u>`;\n break;\n case 'Code':\n editedText = `\\`\\`\\`\\n${textToChange}\\n\\`\\`\\``;\n break;\n case 'Link':\n editedText = `[${textToChange}](link)`;\n break;\n case 'Quote':\n editedText = `>${textToChange}`;\n break;\n default:\n editedText = textToChange;\n }\n\n return editedText;\n};\n\nexport const insertText = (markdownName: string) => {\n let editedText;\n // object to calculate text that will be selected after insert of markdown\n const selection = { start: markdownName.length, end: 0 };\n\n switch (markdownName) {\n case 'Strikethrough':\n editedText = `~~${markdownName}~~`;\n selection.end = 2;\n break;\n case 'Bold':\n editedText = `**${markdownName}**`;\n selection.end = 2;\n break;\n case 'Italic':\n editedText = `_${markdownName}_`;\n selection.end = 1;\n break;\n case 'alt':\n editedText = `[${markdownName}]()`;\n selection.end = 3;\n break;\n case 'Underline':\n editedText = `<u>${markdownName}</u>`;\n selection.end = 4;\n break;\n case 'Code':\n editedText = `\\`\\`\\`\\n${markdownName}\\n\\`\\`\\``;\n selection.end = 3;\n break;\n case 'Link':\n editedText = `[${markdownName}](link)`;\n selection.end = 7;\n break;\n case 'Quote':\n editedText = `>${markdownName}`;\n selection.end = 0;\n break;\n default:\n editedText = '';\n }\n\n return { editedText, selection };\n};\n\nexport const insertListOrTitle = (markdown: string) => {\n let textToInsert;\n\n switch (markdown) {\n case 'BulletList':\n textToInsert = '- ';\n break;\n case 'NumberList':\n textToInsert = '1. ';\n break;\n case 'h1':\n textToInsert = '# ';\n break;\n case 'h2':\n textToInsert = '## ';\n break;\n case 'h3':\n textToInsert = '### ';\n break;\n case 'h4':\n textToInsert = '#### ';\n break;\n case 'h5':\n textToInsert = '##### ';\n break;\n case 'h6':\n textToInsert = '###### ';\n break;\n default:\n return '';\n }\n\n return textToInsert;\n};\n\n// EDITOR ACTIONS FUNCTIONS\n\nexport const markdownHandler = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n markdownType: string\n) => {\n const textToEdit = editor.current.getSelection();\n let textToInsert;\n\n if (textToEdit) {\n const editedText = replaceText(markdownType, textToEdit);\n editor.current.replaceSelection(editedText);\n editor.current.focus();\n } else {\n textToInsert = insertText(markdownType);\n editor.current.replaceSelection(textToInsert.editedText);\n editor.current.focus();\n // set selection-focus to text to replace with content\n const { line, ch } = editor.current.getCursor();\n const endSelection = ch - textToInsert.selection.end;\n const startSelection = ch - textToInsert.selection.end - textToInsert.selection.start;\n editor.current.setSelection({ line, ch: startSelection }, { line, ch: endSelection });\n }\n};\n\nexport const listHandler = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n listType: string\n) => {\n const doc = editor.current.getDoc();\n const insertion = listType === 'BulletList' ? '- ' : '1. ';\n\n if (doc.somethingSelected()) {\n const selections = doc.listSelections();\n let remove: boolean | null = null;\n\n editor.current.operation(function () {\n selections.forEach(function (selection) {\n const pos = [selection.head.line, selection.anchor.line].sort();\n\n // Remove if the first text starts with it\n if (remove == null) {\n remove = doc.getLine(pos[0]).startsWith(insertion);\n }\n\n for (let i = pos[0]; i <= pos[1]; i++) {\n if (remove) {\n // Don't remove if we don't start with it\n if (doc.getLine(i).startsWith(insertion)) {\n doc.replaceRange('', { line: i, ch: 0 }, { line: i, ch: insertion.length });\n }\n } else {\n const lineInsertion = listType === 'BulletList' ? '- ' : `${i + 1}. `;\n doc.replaceRange(lineInsertion, { line: i, ch: 0 });\n }\n }\n });\n });\n } else {\n const { line: currentLine } = doc.getCursor();\n const listToInsert = insertListOrTitle(listType);\n const lineContent = editor.current.getLine(currentLine);\n\n const textToInsert = listToInsert + lineContent;\n editor.current.setSelection(\n { line: currentLine, ch: 0 },\n { line: currentLine, ch: lineContent.length }\n );\n editor.current.replaceSelection(textToInsert);\n }\n\n editor.current.focus();\n};\n\nexport const titleHandler = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n titleType: string\n) => {\n const { line: currentLine } = editor.current.getCursor();\n const titleToInsert = insertListOrTitle(titleType);\n const lineContent = editor.current.getLine(currentLine);\n\n // replace hashtags followed by a space in case user want to change the type of title\n const lineWithNoTitle = lineContent.replace(/#{1,6}\\s/g, '').trim();\n\n const textToInsert = titleToInsert + lineWithNoTitle;\n editor.current.setSelection(\n { line: currentLine, ch: 0 },\n { line: currentLine, ch: lineContent.length }\n );\n editor.current.replaceSelection(textToInsert);\n\n setTimeout(() => {\n const newLastLineLength = editor.current.getLine(currentLine).length;\n editor.current.focus();\n editor.current.setCursor({ line: currentLine, ch: newLastLineLength });\n }, 0);\n};\n\nexport const insertFile = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n files: any[]\n) => {\n let { line } = editor.current.getCursor();\n const { ch } = editor.current.getCursor();\n\n files.forEach((file, i) => {\n let contentLength = editor.current.getLine(line).length;\n editor.current.setCursor({ line, ch: contentLength });\n // create a new line after first image markdown inserted\n // or if there is content in current line\n\n if (i > 0 || (i === 0 && ch !== 0)) {\n contentLength = editor.current.getLine(line).length;\n editor.current.setCursor({ line, ch: contentLength });\n line++;\n editor.current.replaceSelection('\\n');\n }\n\n if (file.mime.includes('image')) {\n editor.current.replaceSelection(`![${file.alt}](${file.url})`);\n } else {\n editor.current.replaceSelection(`[${file.alt}](${file.url})`);\n }\n });\n\n setTimeout(() => editor.current.focus(), 0);\n};\n\n// NEXT FUNCTIONS FOR QUOTE OR CODE MARKDOWN\n\nconst insertWithTextToEdit = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n markdownType: string,\n line: number,\n contentLength: number,\n textToEdit: string\n) => {\n const textToInsert = replaceText(markdownType, textToEdit);\n\n // remove content after current line\n const contentToMove = editor.current.getRange(\n { line: line + 1, ch: 0 },\n { line: Infinity, ch: Infinity }\n );\n editor.current.replaceRange('', { line: line + 1, ch: 0 }, { line: Infinity, ch: Infinity });\n\n // remove word that was selected\n // set cursor end of line + move to next line\n // add text to insert\n editor.current.replaceSelection('');\n editor.current.setCursor({ line, ch: contentLength });\n editor.current.replaceSelection('\\n');\n editor.current.replaceSelection(textToInsert);\n\n if (markdownType === 'Code') {\n const { line: newLine } = editor.current.getCursor();\n editor.current.setCursor({ line: newLine - 1, ch: textToEdit.length });\n }\n\n // add content we had to remove earlier\n editor.current.replaceRange(\n contentToMove,\n { line: line + 4, ch: 0 },\n { line: Infinity, ch: Infinity }\n );\n\n editor.current.focus();\n};\n\nconst insertWithoutTextToEdit = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n markdownType: string,\n line: number,\n contentLength: number\n) => {\n const textToInsert = insertText(markdownType);\n\n // remove content after current line\n const contentToMove = editor.current.getRange(\n { line: line + 1, ch: 0 },\n { line: Infinity, ch: Infinity }\n );\n editor.current.replaceRange('', { line: line + 1, ch: 0 }, { line: Infinity, ch: Infinity });\n\n // replace cursor to next line\n editor.current.setCursor({ line, ch: contentLength });\n editor.current.replaceSelection('\\n');\n editor.current.replaceSelection(textToInsert.editedText);\n\n // set selection on \"Code\" or \"Quote\" word\n\n if (markdownType === 'Code') {\n line += 2;\n\n editor.current.setSelection({ line, ch: 0 }, { line, ch: 4 });\n } else {\n line += 1;\n\n const { ch } = editor.current.getCursor();\n const endSelection = ch - textToInsert.selection.end;\n const startSelection = ch - textToInsert.selection.end - textToInsert.selection.start;\n editor.current.setSelection({ line, ch: startSelection }, { line, ch: endSelection });\n }\n\n // add content we had to remove earlier\n editor.current.replaceRange(\n contentToMove,\n { line: line + 2, ch: 0 },\n { line: Infinity, ch: Infinity }\n );\n editor.current.focus();\n};\n\nexport const quoteAndCodeHandler = (\n editor: MutableRefObject<CodeMirror.EditorFromTextArea>,\n markdownType: string\n) => {\n const textToEdit = editor.current.getSelection();\n const { line } = editor.current.getCursor();\n const contentLength = editor.current.getLine(line).length;\n\n if (textToEdit) {\n insertWithTextToEdit(editor, markdownType, line, contentLength, textToEdit);\n } else {\n insertWithoutTextToEdit(editor, markdownType, line, contentLength);\n }\n};\n","import { Button, IconButton, IconButtonComponent, IconButtonGroup } from '@strapi/design-system';\nimport { styled } from 'styled-components';\n\n// NAV BUTTONS\nexport const MainButtons = styled(IconButtonGroup)`\n margin-left: ${({ theme }) => theme.spaces[4]};\n`;\n\nexport const MoreButton = styled<IconButtonComponent>(IconButton)`\n margin: ${({ theme }) => `0 ${theme.spaces[2]}`};\n`;\n\n// NAV\n\nexport const IconButtonGroupMargin = styled(IconButtonGroup)`\n margin-right: ${({ theme }) => `${theme.spaces[2]}`};\n`;\n\n// FOOTER\nexport const ExpandButton = styled(Button)`\n background-color: transparent;\n border: none;\n align-items: center;\n\n & > span {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n }\n\n svg {\n margin-left: ${({ theme }) => `${theme.spaces[2]}`};\n path {\n fill: ${({ theme }) => theme.colors.neutral700};\n width: 1.2rem;\n height: 1.2rem;\n }\n }\n`;\n","import { ButtonProps, Box, Flex, Typography } from '@strapi/design-system';\nimport { Expand } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport { ExpandButton } from './WysiwygStyles';\n\ninterface WysiwygFooterProps {\n onToggleExpand: ButtonProps['onClick'];\n}\n\nconst WysiwygFooter = ({ onToggleExpand }: WysiwygFooterProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <Box padding={2} background=\"neutral100\" borderRadius={`0 0 0.4rem 0.4rem`}>\n <Flex justifyContent=\"flex-end\" alignItems=\"flex-end\">\n <ExpandButton id=\"expand\" onClick={onToggleExpand} variant=\"tertiary\" size=\"M\">\n <Typography textColor=\"neutral800\">\n {formatMessage({\n id: 'components.WysiwygBottomControls.fullscreen',\n defaultMessage: 'Expand',\n })}\n </Typography>\n <Expand />\n </ExpandButton>\n </Flex>\n </Box>\n );\n};\n\nexport { WysiwygFooter };\nexport type { WysiwygFooterProps };\n","import * as React from 'react';\n\nimport {\n Button,\n Flex,\n IconButton,\n IconButtonGroup,\n SingleSelectOption,\n SingleSelect,\n Field,\n Menu,\n} from '@strapi/design-system';\nimport {\n Bold,\n BulletList,\n Code,\n Italic,\n Link,\n NumberList,\n Image,\n Quotes,\n StrikeThrough,\n Underline,\n HeadingOne,\n HeadingTwo,\n HeadingThree,\n HeadingFour,\n HeadingFive,\n HeadingSix,\n} from '@strapi/icons';\nimport { EditorFromTextArea } from 'codemirror5';\nimport { useIntl } from 'react-intl';\n\nimport { EditorToolbarObserver, type ObservedComponent } from '../../EditorToolbarObserver';\n\nimport { listHandler, markdownHandler, quoteAndCodeHandler, titleHandler } from './utils/utils';\n\ninterface WysiwygNavProps {\n disabled?: boolean;\n editorRef: React.MutableRefObject<EditorFromTextArea>;\n isExpandMode?: boolean;\n isPreviewMode?: boolean;\n onToggleMediaLib: () => void;\n onTogglePreviewMode?: () => void;\n}\n\n/**\n * TODO: refactor this mess.\n */\nconst WysiwygNav = ({\n disabled,\n editorRef,\n isPreviewMode,\n onToggleMediaLib,\n onTogglePreviewMode,\n}: WysiwygNavProps) => {\n const { formatMessage } = useIntl();\n const isDisabled = disabled || isPreviewMode;\n\n const handleActionClick = (\n value: string,\n currentEditorRef: React.MutableRefObject<EditorFromTextArea>\n ) => {\n switch (value) {\n case 'Link': {\n markdownHandler(currentEditorRef, value);\n break;\n }\n case 'Code':\n case 'Quote': {\n quoteAndCodeHandler(currentEditorRef, value);\n break;\n }\n case 'Bold':\n case 'Italic':\n case 'Underline':\n case 'Strikethrough': {\n markdownHandler(currentEditorRef, value);\n break;\n }\n case 'BulletList':\n case 'NumberList': {\n listHandler(currentEditorRef, value);\n break;\n }\n case 'h1':\n case 'h2':\n case 'h3':\n case 'h4':\n case 'h5':\n case 'h6': {\n titleHandler(currentEditorRef, value);\n break;\n }\n default: {\n // Nothing\n }\n }\n };\n\n const observedComponents: ObservedComponent[] = [\n {\n toolbar: (\n <IconButtonGroup>\n <IconButton\n disabled={isDisabled}\n onClick={() => handleActionClick('Bold', editorRef)}\n label={formatMessage({\n id: 'components.Blocks.modifiers.bold',\n defaultMessage: 'Bold',\n })}\n name={formatMessage({\n id: 'components.Blocks.modifiers.bold',\n defaultMessage: 'Bold',\n })}\n >\n <Bold />\n </IconButton>\n <IconButton\n disabled={isDisabled}\n onClick={() => handleActionClick('Italic', editorRef)}\n label={formatMessage({\n id: 'components.Blocks.modifiers.italic',\n defaultMessage: 'Italic',\n })}\n name={formatMessage({\n id: 'components.Blocks.modifiers.italic',\n defaultMessage: 'Italic',\n })}\n >\n <Italic />\n </IconButton>\n <IconButton\n disabled={isDisabled}\n onClick={() => handleActionClick('Underline', editorRef)}\n label={formatMessage({\n id: 'components.Blocks.modifiers.underline',\n defaultMessage: 'Underline',\n })}\n name={formatMessage({\n id: 'components.Blocks.modifiers.underline',\n defaultMessage: 'Underline',\n })}\n >\n <Underline />\n </IconButton>\n <IconButton\n disabled={isDisabled}\n onClick={() => handleActionClick('Strikethrough', editorRef)}\n label={formatMessage({\n id: 'components.Blocks.modifiers.strikethrough',\n defaultMessage: 'Strikethrough',\n })}\n name={formatMessage({\n id: 'components.Blocks.modifiers.strikethrough',\n defaultMessage: 'Strikethrough',\n })}\n >\n <StrikeThrough />\n </IconButton>\n </IconButtonGroup>\n ),\n menu: (\n <>\n <Menu.Separator />\n <Menu.Item onSelect={() => handleActionClick('Bold', editorRef)} disabled={isDisabled}>\n <Flex tag=\"span\" gap={2}>\n <Bold aria-hidden fill=\"neutral600\" />\n {formatMessage({\n id: 'components.Blocks.modifiers.bold',\n defaultMessage: 'Bold',\n })}\n </Flex>\n </Menu.Item>\n <Menu.Item onSelect={() => handleActionClick('Italic', editorRef)} disabled={isDisabled}>\n <Flex tag=\"span\" gap={2}>\n <Italic aria-hidden fill=\"neutral600\" />\n {formatMessage({\n id: 'components.Blocks.modifiers.italic',\n defaultMessage: 'Italic',\n })}\n </Flex>\n </Menu.Item>\n <Menu.Item\n onSelect={() => handleActionClick('Underline', editorRef)}\n disabled={isDisabled}\n >\n <Flex tag=\"span\" gap={2}>\n <Underline aria-hidden fill=\"neutral600\" />\n {formatMessage({\n id: 'components.Blocks.modifiers.underline',\n defaultMessage: 'Underline',\n })}\n </Flex>\n </Menu.Item>\n <Menu.Item\n onSelect={() => handleActionClick('Strikethrough', editorRef)}\n disabled={isDisabled}\n >\n <Flex tag=\"span\" gap={2}>\n <StrikeThrough aria-hidden fill=\"neutral600\" />\n {formatMessage({\n id: 'components.Blocks.modifiers.strikethrough',\n defaultMessage: 'Strikethrough',\n })}\n </Flex>\n </Menu.Item>\n </>\n ),\n key: 'formatting-group-1',\n },\n {\n toolbar: (\n <IconButtonGroup>\n <IconButton\n disabled={isDisabled}\n onClick={() => handleActionClick('BulletList', editorRef)}\n label={formatMessage({\n id: 'components.Blocks.blocks.bulletList',\n defaultMessage: 'Bulleted list',\n })}\n name={formatMessage({\n id: 'components.Blocks.blocks.bulletList',\n defaultMessage: 'Bulleted list',\n })}\n >\n <BulletList />\n </IconButton>\n <IconButton\n disabled={isDisabled}\n onClick={() => handleActionClick('NumberList', editorRef)}\n label={formatMessage({\n id: 'components.Blocks.blocks.numberList',\n defaultMessage: 'Numbered list',\n })}\n name={formatMessage({\n id: 'components.Blocks.blocks.numberList',\n defaultMessage: 'Numbered list',\n })}\n >\n <NumberList />\n </IconButton>\n </IconButtonGroup>\n ),\n menu: (\n <>\n <Menu.Separator />\n <Menu.Item\n onSelect={() => handleActionClick('BulletList', editorRef)}\n disabled={isDisabled}\n >\n <Flex tag=\"span\" gap={2}>\n <BulletList aria-hidden fill=\"neutral600\" />\n {formatMessage({\n id: 'components.Blocks.blocks.unorderedList',\n defaultMessage: 'Bulleted list',\n })}\n </Flex>\n </Menu.Item>\n <Menu.Item\n onSelect={() => handleActionClick('NumberList', editorRef)}\n disabled={isDisabled}\n >\n <Flex tag=\"span\" gap={2}>\n <NumberList aria-hidden fill=\"neutral600\" />\n {formatMessage({\n id: 'components.Blocks.blocks.orderedList',\n defaultMessage: 'Numbered list',\n })}\n </Flex>\n </Menu.Item>\n </>\n ),\n key: 'formatting-group-2',\n },\n {\n toolbar: (\n <IconButtonGroup>\n <IconButton\n disabled={isDisabled}\n onClick={() => handleActionClick('Code', editorRef)}\n label={formatMessage({\n id: 'components.Wysiwyg.blocks.code',\n defaultMessage: 'Code',\n })}\n name={formatMessage({\n id: 'components.Wysiwyg.blocks.code',\n defaultMessage: 'Code',\n })}\n >\n <Code />\n </IconButton>\n <IconButton\n disabled={isDisabled}\n onClick={() => {\n onToggleMediaLib();\n }}\n label={formatMessage({\n id: 'components.Blocks.blocks.image',\n defaultMessage: 'Image',\n })}\n name={formatMessage({\n id: 'components.Blocks.blocks.image',\n defaultMessage: 'Image',\n })}\n >\n <Image />\n </IconButton>\n <IconButton\n disabled={isDisabled}\n onClick={() => handleActionClick('Link', editorRef)}\n label={formatMessage({\n id: 'components.Blocks.popover.link',\n defaultMessage: 'Link',\n })}\n name={formatMessage({\n id: 'components.Blocks.popover.link',\n defaultMessage: 'Link',\n })}\n >\n <Link />\n </IconButton>\n <IconButton\n disabled={isDisabled}\n onClick={() => handleActionClick('Quote', editorRef)}\n label={formatMessage({\n id: 'components.Blocks.blocks.quote',\n defaultMessage: 'Quote',\n })}\n name={formatMessage({\n id: 'components.Blocks.blocks.quote',\n defaultMessage: 'Quote',\n })}\n >\n <Quotes />\n </IconButton>\n </IconButtonGroup>\n ),\n menu: (\n <>\n <Menu.Separator />\n <Menu.Item onSelect={() => handleActionClick('Code', editorRef)} disabled={isDisabled}>\n <Flex tag=\"span\" gap={2}>\n <Code aria-hidden fill=\"neutral600\" />\n {formatMessage({\n id: 'components.Wysiwyg.blocks.code',\n defaultMessage: 'Code',\n })}\n </Flex>\n </Menu.Item>\n <Menu.Item\n startIcon={<Image />}\n onSelect={() => {\n onToggleMediaLib();\n }}\n disabled={isDisabled}\n >\n <Flex tag=\"span\" gap={2}>\n <Image aria-hidden fill=\"neutral600\" />\n {formatMessage({\n id: 'components.Blocks.blocks.image',\n defaultMessage: 'Image',\n })}\n </Flex>\n </Menu.Item>\n <Menu.Item\n startIcon={<Link />}\n onSelect={() => handleActionClick('Link', editorRef)}\n disabled={isDisabled}\n >\n <Flex tag=\"span\" gap={2}>\n <Link aria-hidden fill=\"neutral600\" />\n {formatMessage({\n id: 'components.Blocks.popover.link',\n defaultMessage: 'Link',\n })}\n </Flex>\n </Menu.Item>\n <Menu.Item onSelect={() => handleActionClick('Quote', editorRef)} disabled={isDisabled}>\n <Flex tag=\"span\" gap={2}>\n <Quotes aria-hidden fill=\"neutral600\" />\n {formatMessage({\n id: 'components.Blocks.blocks.quote',\n defaultMessage: 'Quote',\n })}\n </Flex>\n </Menu.Item>\n </>\n ),\n key: 'formatting-group-3',\n },\n ];\n\n return (\n <Flex\n padding={2}\n background=\"neutral100\"\n justifyContent=\"space-between\"\n borderRadius=\"0.4rem 0.4rem 0 0\"\n width=\"100%\"\n gap={4}\n >\n <Field.Root>\n <SingleSelect\n disabled={isDisabled}\n placeholder={formatMessage({\n id: 'components.Wysiwyg.selectOptions.title',\n defaultMessage: 'Headings',\n })}\n aria-label={formatMessage({\n id: 'components.Wysiwyg.selectOptions.title',\n defaultMessage: 'Headings',\n })}\n // @ts-expect-error – DS v2 will only allow strings.\n onChange={(value) => handleActionClick(value, editorRef)}\n size=\"S\"\n >\n <SingleSelectOption value=\"h1\" startIcon={<HeadingOne fill=\"neutral600\" />}>\n {formatMessage({\n id: 'components.Wysiwyg.selectOptions.H1',\n defaultMessage: 'Heading 1',\n })}\n </SingleSelectOption>\n <SingleSelectOption value=\"h2\" startIcon={<HeadingTwo fill=\"neutral600\" />}>\n {formatMessage({\n id: 'components.Wysiwyg.selectOptions.H2',\n defaultMessage: 'Heading 2',\n })}\n </SingleSelectOption>\n <SingleSelectOption value=\"h3\" startIcon={<HeadingThree fill=\"neutral600\" />}>\n {formatMessage({\n id: 'components.Wysiwyg.selectOptions.H3',\n defaultMessage: 'Heading 3',\n })}\n </SingleSelectOption>\n <SingleSelectOption value=\"h4\" startIcon={<HeadingFour fill=\"neutral600\" />}>\n {formatMessage({\n id: 'components.Wysiwyg.selectOptions.H4',\n defaultMessage: 'Heading 4',\n })}\n </SingleSelectOption>\n <SingleSelectOption value=\"h5\" startIcon={<HeadingFive fill=\"neutral600\" />}>\n {formatMessage({\n id: 'components.Wysiwyg.selectOptions.H5',\n defaultMessage: 'Heading 5',\n })}\n </SingleSelectOption>\n <SingleSelectOption value=\"h6\" startIcon={<HeadingSix fill=\"neutral600\" />}>\n {formatMessage({\n id: 'components.Wysiwyg.selectOptions.H6',\n defaultMessage: 'Heading 6',\n })}\n </SingleSelectOption>\n </SingleSelect>\n </Field.Root>\n <Flex width=\"100%\" justifyContent=\"space-between\" overflow=\"hidden\">\n <Flex gap={2} overflow=\"hidden\" width=\"100%\">\n <EditorToolbarObserver\n menuTriggerVariant=\"tertiary\"\n observedComponents={observedComponents}\n />\n </Flex>\n\n {onTogglePreviewMode && (\n <Button onClick={onTogglePreviewMode} variant=\"tertiary\" minWidth=\"132px\">\n {isPreviewMode\n ? formatMessage({\n id: 'components.Wysiwyg.ToggleMode.markdown-mode',\n defaultMessage: 'Markdown mode',\n })\n : formatMessage({\n id: 'components.Wysiwyg.ToggleMode.preview-mode',\n defaultMessage: 'Preview mode',\n })}\n </Button>\n )}\n </Flex>\n </Flex>\n );\n};\n\nexport { WysiwygNav };\nexport type { WysiwygNavProps };\n","import * as React from 'react';\n\nimport { useField, useStrapiApp, type InputProps } from '@strapi/admin/strapi-admin';\nimport { Field, Flex } from '@strapi/design-system';\nimport { EditorFromTextArea } from 'codemirror5';\n\nimport { prefixFileUrlWithBackendUrl } from '../../../../../utils/urls';\n\nimport { Editor, EditorApi } from './Editor';\nimport { EditorLayout } from './EditorLayout';\nimport { insertFile } from './utils/utils';\nimport { WysiwygFooter } from './WysiwygFooter';\nimport { WysiwygNav } from './WysiwygNav';\n\nimport type { Schema } from '@strapi/types';\n\ninterface WysiwygProps extends Omit<InputProps, 'type'> {\n labelAction?: React.ReactNode;\n type: Schema.Attribute.RichText['type'];\n}\n\nconst Wysiwyg = React.forwardRef<EditorApi, WysiwygProps>(\n ({ hint, disabled, label, name, placeholder, required, labelAction }, forwardedRef) => {\n const field = useField(name);\n const textareaRef = React.useRef<HTMLTextAreaElement>(null);\n const editorRef = React.useRef<EditorFromTextArea>(\n null\n ) as React.MutableRefObject<EditorFromTextArea>;\n const [isPreviewMode, setIsPreviewMode] = React.useState(false);\n const [mediaLibVisible, setMediaLibVisible] = React.useState(false);\n const [isExpandMode, setIsExpandMode] = React.useState(false);\n const components = useStrapiApp('ImageDialog', (state) => state.components);\n\n const MediaLibraryDialog = components['media-library'];\n\n const handleToggleMediaLib = () => setMediaLibVisible((prev) => !prev);\n const handleTogglePreviewMode = () => setIsPreviewMode((prev) => !prev);\n const handleToggleExpand = () => {\n setIsPreviewMode(false);\n setIsExpandMode((prev) => !prev);\n };\n\n const handleSelectAssets = (files: any[]) => {\n const formattedFiles = files.map((f) => ({\n alt: f.alternativeText || f.name,\n url: prefixFileUrlWithBackendUrl(f.url),\n mime: f.mime,\n }));\n\n insertFile(editorRef, formattedFiles);\n setMediaLibVisible(false);\n };\n\n return (\n <Field.Root name={name} hint={hint} error={field.error} required={required}>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={1}>\n <Field.Label action={labelAction}>{label}</Field.Label>\n <EditorLayout\n isExpandMode={isExpandMode}\n error={field.error}\n previewContent={field.value}\n onCollapse={handleToggleExpand}\n >\n <WysiwygNav\n isExpandMode={isExpandMode}\n editorRef={editorRef}\n isPreviewMode={isPreviewMode}\n onToggleMediaLib={handleToggleMediaLib}\n onTogglePreviewMode={isExpandMode ? undefined : handleTogglePreviewMode}\n disabled={disabled}\n />\n\n <Editor\n disabled={disabled}\n isExpandMode={isExpandMode}\n editorRef={editorRef}\n error={field.error}\n isPreviewMode={isPreviewMode}\n name={name}\n onChange={field.onChange}\n placeholder={placeholder}\n textareaRef={textareaRef}\n value={field.value}\n ref={forwardedRef}\n />\n\n {!isExpandMode && <WysiwygFooter onToggleExpand={handleToggleExpand} />}\n </EditorLayout>\n <Field.Hint />\n <Field.Error />\n </Flex>\n {mediaLibVisible && (\n // @ts-expect-error – TODO: fix this way of injecting because it's not really typeable without a registry.\n <MediaLibraryDialog onClose={handleToggleMediaLib} onSelectAssets={handleSelectAssets} />\n )}\n </Field.Root>\n );\n }\n);\n\nconst MemoizedWysiwyg = React.memo(Wysiwyg);\n\nexport { MemoizedWysiwyg as Wysiwyg };\nexport type { WysiwygProps };\n","import * as React from 'react';\n\nimport {\n useStrapiApp,\n useForm,\n InputRenderer as FormInputRenderer,\n useField,\n} from '@strapi/admin/strapi-admin';\nimport { useIntl } from 'react-intl';\n\nimport { SINGLE_TYPES } from '../../../constants/collections';\nimport { useDocumentContext } from '../../../features/DocumentContext';\nimport { useDocumentRBAC } from '../../../features/DocumentRBAC';\nimport { useDoc, UseDocument } from '../../../hooks/useDocument';\nimport { useDocumentLayout } from '../../../hooks/useDocumentLayout';\nimport { useLazyComponents } from '../../../hooks/useLazyComponents';\n\nimport { BlocksInput } from './FormInputs/BlocksInput/BlocksInput';\nimport { ComponentInput } from './FormInputs/Component/Input';\nimport { DynamicZone, useDynamicZone } from './FormInputs/DynamicZone/Field';\nimport { NotAllowedInput } from './FormInputs/NotAllowed';\nimport { RelationsInput } from './FormInputs/Relations/Relations';\nimport { UIDInput } from './FormInputs/UID';\nimport { Wysiwyg } from './FormInputs/Wysiwyg/Field';\n\nimport type { EditFieldLayout } from '../../../hooks/useDocumentLayout';\nimport type { Schema } from '@strapi/types';\nimport type { DistributiveOmit } from 'react-redux';\n\ntype InputRendererProps = DistributiveOmit<EditFieldLayout, 'size'> & {\n document: ReturnType<UseDocument>;\n};\n\n/**\n * @internal\n *\n * @description An abstraction around the regular form input renderer designed\n * specifically to be used in the EditView of the content-manager this understands\n * the complete EditFieldLayout and will handle RBAC conditions and rendering CM specific\n * components such as Blocks / Relations.\n */\nconst InputRenderer = ({ visible, hint: providedHint, document, ...props }: InputRendererProps) => {\n const { model: rootModel } = useDoc();\n const rootDocumentMeta = useDocumentContext(\n 'DynamicComponent',\n (state) => state.rootDocumentMeta\n );\n const {\n edit: { components: rootComponents },\n } = useDocumentLayout(rootDocumentMeta.model);\n const {\n edit: { components: relatedComponents },\n } = useDocumentLayout(document.schema?.uid ?? rootModel);\n const components = { ...rootComponents, ...relatedComponents };\n\n const collectionType =\n document.schema?.kind === 'collectionType' ? 'collection-types' : 'single-types';\n\n const isInDynamicZone = useDynamicZone('isInDynamicZone', (state) => state.isInDynamicZone);\n\n const isFormDisabled = useForm('InputRenderer', (state) => state.disabled);\n const canCreateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canCreateFields);\n const canReadFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canReadFields);\n const canUpdateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUpdateFields);\n const canUserAction = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUserAction);\n\n let idToCheck = document.document?.documentId;\n if (collectionType === SINGLE_TYPES) {\n idToCheck = document?.document?.documentId;\n }\n\n const editableFields = idToCheck ? canUpdateFields : canCreateFields;\n const readableFields = idToCheck ? canReadFields : canCreateFields;\n\n /**\n * Component fields are always readable and editable,\n * however the fields within them may not be.\n */\n const canUserReadField = canUserAction(props.name, readableFields, props.type);\n const canUserEditField = canUserAction(props.name, editableFields, props.type);\n\n const fields = useStrapiApp('InputRenderer', (app) => app.fields);\n const { lazyComponentStore } = useLazyComponents(\n attributeHasCustomFieldProperty(props.attribute) ? [props.attribute.customField] : undefined\n );\n\n const hint = useFieldHint(providedHint, props.attribute);\n\n // We pass field in case of Custom Fields to keep backward compatibility\n const field = useField(props.name);\n\n if (!visible) {\n return null;\n }\n\n /**\n * If the user can't read the field then we don't want to ever render it.\n */\n if (!canUserReadField && !isInDynamicZone) {\n return <NotAllowedInput hint={hint} {...props} />;\n }\n\n const fieldIsDisabled =\n (!canUserEditField && !isInDynamicZone) || props.disabled || isFormDisabled;\n\n /**\n * Because a custom field has a unique prop but the type could be confused with either\n * the useField hook or the type of the field we need to handle it separately and first.\n */\n if (attributeHasCustomFieldProperty(props.attribute)) {\n const CustomInput = lazyComponentStore[props.attribute.customField];\n\n if (CustomInput) {\n // @ts-expect-error – TODO: fix this type error in the useLazyComponents hook.\n return <CustomInput {...props} {...field} hint={hint} disabled={fieldIsDisabled} />;\n }\n\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n // @ts-expect-error – this workaround lets us display that the custom field is missing.\n type={props.attribute.customField}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n /**\n * This is where we handle ONLY the fields from the `useLibrary` hook.\n */\n const addedInputTypes = Object.keys(fields);\n if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {\n const CustomInput = fields[props.type];\n // @ts-expect-error – TODO: fix this type error in the useLibrary hook.\n return <CustomInput {...props} hint={hint} disabled={fieldIsDisabled} />;\n }\n\n /**\n * These include the content-manager specific fields, failing that we fall back\n * to the more generic form input renderer.\n */\n switch (props.type) {\n case 'blocks':\n return <BlocksInput {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\n case 'component':\n return (\n <ComponentInput\n {...props}\n hint={hint}\n layout={components[props.attribute.component].layout}\n disabled={fieldIsDisabled}\n >\n {(inputProps) => <InputRenderer {...inputProps} />}\n </ComponentInput>\n );\n case 'dynamiczone':\n return <DynamicZone {...props} hint={hint} disabled={fieldIsDisabled} />;\n case 'relation':\n return <RelationsInput {...props} hint={hint} disabled={fieldIsDisabled} />;\n case 'richtext':\n return <Wysiwyg {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\n case 'uid':\n return <UIDInput {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\n /**\n * Enumerations are a special case because they require options.\n */\n case 'enumeration':\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n options={props.attribute.enum.map((value) => ({ value }))}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n default:\n // These props are not needed for the generic form input renderer.\n const { unique: _unique, mainField: _mainField, ...restProps } = props;\n return (\n <FormInputRenderer\n {...restProps}\n hint={hint}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n }\n};\n\nconst attributeHasCustomFieldProperty = (\n attribute: Schema.Attribute.AnyAttribute\n): attribute is Schema.Attribute.AnyAttribute & Schema.Attribute.CustomField<string> =>\n 'customField' in attribute && typeof attribute.customField === 'string';\n\nconst useFieldHint = (\n hint: React.ReactNode = undefined,\n attribute: Schema.Attribute.AnyAttribute\n) => {\n const { formatMessage } = useIntl();\n\n const { maximum, minimum } = getMinMax(attribute);\n\n if (!maximum && !minimum) {\n return hint;\n }\n\n const units = !['biginteger', 'integer', 'number', 'dynamiczone', 'component'].includes(\n attribute.type\n )\n ? formatMessage(\n {\n id: 'content-manager.form.Input.hint.character.unit',\n defaultMessage: '{maxValue, plural, one { character} other { characters}}',\n },\n {\n maxValue: Math.max(minimum || 0, maximum || 0),\n }\n )\n : null;\n\n const hasMinAndMax = typeof minimum === 'number' && typeof maximum === 'number';\n\n return formatMessage(\n {\n id: 'content-manager.form.Input.hint.text',\n defaultMessage:\n '{min, select, undefined {} other {min. {min}}}{divider}{max, select, undefined {} other {max. {max}}}{unit}{br}{description}',\n },\n {\n min: minimum,\n max: maximum,\n description: hint,\n unit: units,\n divider: hasMinAndMax\n ? formatMessage({\n id: 'content-manager.form.Input.hint.minMaxDivider',\n defaultMessage: ' / ',\n })\n : null,\n br: <br />,\n }\n );\n};\n\nconst getMinMax = (attribute: Schema.Attribute.AnyAttribute) => {\n if ('min' in attribute || 'max' in attribute) {\n return {\n maximum: !Number.isNaN(Number(attribute.max)) ? Number(attribute.max) : undefined,\n minimum: !Number.isNaN(Number(attribute.min)) ? Number(attribute.min) : undefined,\n };\n } else if ('maxLength' in attribute || 'minLength' in attribute) {\n return { maximum: attribute.maxLength, minimum: attribute.minLength };\n } else {\n return { maximum: undefined, minimum: undefined };\n }\n};\n\nconst MemoizedInputRenderer = React.memo(InputRenderer);\n\nexport type { InputRendererProps };\nexport { MemoizedInputRenderer as InputRenderer, useFieldHint };\n","import { Box, Flex, Grid } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { EditLayout } from '../../../hooks/useDocumentLayout';\n\nimport { InputRenderer } from './InputRenderer';\n\nimport type { UseDocument } from '../../../hooks/useDocument';\n\nexport const RESPONSIVE_CONTAINER_BREAKPOINTS = {\n sm: '27.5rem', // 440px\n};\n\nexport const ResponsiveGridRoot = styled(Grid.Root)`\n container-type: inline-size;\n`;\n\nexport const ResponsiveGridItem =\n /**\n * TODO:\n * JSDOM cannot handle container queries.\n * This is a temporary workaround so that tests do not fail in the CI when jestdom throws an error\n * for failing to parse the stylesheet.\n */\n process.env.NODE_ENV !== 'test'\n ? styled(Grid.Item)<{ col: number }>`\n grid-column: span 12;\n @container (min-width: ${RESPONSIVE_CONTAINER_BREAKPOINTS.sm}) {\n ${({ col }) => col && `grid-column: span ${col};`}\n }\n `\n : styled(Grid.Item)<{ col: number }>`\n grid-column: span 12;\n `;\n\ninterface FormLayoutProps extends Pick<EditLayout, 'layout'> {\n hasBackground?: boolean;\n model?: string;\n document: ReturnType<UseDocument>;\n}\n\nconst FormLayout = ({ layout, document, hasBackground = true }: FormLayoutProps) => {\n const { formatMessage } = useIntl();\n const model = document.schema?.modelName;\n\n return (\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {layout.map((panel, index) => {\n if (panel.some((row) => row.some((field) => field.type === 'dynamiczone'))) {\n const [row] = panel;\n const [field] = row;\n\n const fieldWithTranslatedLabel = {\n ...field,\n label: formatMessage({\n id: `content-manager.content-types.${model}.${field.name}`,\n defaultMessage: field.label,\n }),\n };\n\n return (\n <Grid.Root key={field.name} gap={4}>\n <Grid.Item col={12} s={12} xs={12} direction=\"column\" alignItems=\"stretch\">\n <InputRenderer {...fieldWithTranslatedLabel} document={document} />\n </Grid.Item>\n </Grid.Root>\n );\n }\n\n return (\n <Box\n key={index}\n {...(hasBackground && {\n padding: 6,\n borderColor: 'neutral150',\n background: 'neutral0',\n hasRadius: true,\n shadow: 'tableShadow',\n })}\n >\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {panel.map((row, gridRowIndex) => (\n <ResponsiveGridRoot key={gridRowIndex} gap={4}>\n {row.map(({ size, ...field }) => {\n const fieldWithTranslatedLabel = {\n ...field,\n label: formatMessage({\n id: `content-manager.content-types.${model}.${field.name}`,\n defaultMessage: field.label,\n }),\n };\n return (\n <ResponsiveGridItem\n col={size}\n key={field.name}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n <InputRenderer {...fieldWithTranslatedLabel} document={document} />\n </ResponsiveGridItem>\n );\n })}\n </ResponsiveGridRoot>\n ))}\n </Flex>\n </Box>\n );\n })}\n </Flex>\n );\n};\n\nexport { FormLayout, FormLayoutProps };\n","import { useField } from '@strapi/admin/strapi-admin';\nimport { Box, Flex } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\n\nimport { useDocumentContext } from '../../../../../features/DocumentContext';\nimport { ResponsiveGridItem, ResponsiveGridRoot } from '../../FormLayout';\nimport { ComponentProvider, useComponent } from '../ComponentContext';\n\nimport type { ComponentInputProps } from './Input';\n\ntype NonRepeatableComponentProps = Omit<ComponentInputProps, 'required' | 'label'>;\n\nconst NonRepeatableComponent = ({\n attribute,\n name,\n children,\n layout,\n}: NonRepeatableComponentProps) => {\n const { formatMessage } = useIntl();\n const { value } = useField(name);\n const level = useComponent('NonRepeatableComponent', (state) => state.level);\n const isNested = level > 0;\n const currentDocument = useDocumentContext('NonRepeatableComponent', (state) => state.document);\n\n return (\n <ComponentProvider id={value?.id} uid={attribute.component} level={level + 1} type=\"component\">\n <Box\n background={'neutral100'}\n paddingLeft={6}\n paddingRight={6}\n paddingTop={6}\n paddingBottom={6}\n hasRadius={isNested}\n borderColor={isNested ? 'neutral200' : undefined}\n >\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {layout.map((row, index) => {\n return (\n <ResponsiveGridRoot gap={4} key={index}>\n {row.map(({ size, ...field }) => {\n /**\n * Layouts are built from schemas so they don't understand the complete\n * schema tree, for components we append the parent name to the field name\n * because this is the structure for the data & permissions also understand\n * the nesting involved.\n */\n const completeFieldName = `${name}.${field.name}`;\n\n const translatedLabel = formatMessage({\n id: `content-manager.components.${attribute.component}.${field.name}`,\n defaultMessage: field.label,\n });\n\n return (\n <ResponsiveGridItem\n col={size}\n key={completeFieldName}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n {children({\n ...field,\n label: translatedLabel,\n name: completeFieldName,\n document: currentDocument,\n })}\n </ResponsiveGridItem>\n );\n })}\n </ResponsiveGridRoot>\n );\n })}\n </Flex>\n </Box>\n </ComponentProvider>\n );\n};\n\nexport { NonRepeatableComponent };\nexport type { NonRepeatableComponentProps };\n","import * as React from 'react';\n\nimport { useField, useNotification, useForm } from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Flex,\n TextButton,\n VisuallyHidden,\n Accordion,\n IconButton,\n useComposedRefs,\n BoxComponent,\n} from '@strapi/design-system';\nimport { Plus, Drag, Trash } from '@strapi/icons';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport { useLocation } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { ItemTypes } from '../../../../../constants/dragAndDrop';\nimport { useDocumentContext } from '../../../../../features/DocumentContext';\nimport { useDragAndDrop, type UseDragAndDropOptions } from '../../../../../hooks/useDragAndDrop';\nimport { usePrev } from '../../../../../hooks/usePrev';\nimport { getIn } from '../../../../../utils/objects';\nimport { getTranslation } from '../../../../../utils/translations';\nimport { transformDocument } from '../../../utils/data';\nimport { createDefaultForm } from '../../../utils/forms';\nimport { ResponsiveGridItem, ResponsiveGridRoot } from '../../FormLayout';\nimport { ComponentProvider, useComponent } from '../ComponentContext';\n\nimport { Initializer } from './Initializer';\n\nimport type { ComponentInputProps } from './Input';\nimport type { Schema } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * RepeatableComponent\n * -----------------------------------------------------------------------------------------------*/\n\ntype RepeatableComponentProps = Omit<ComponentInputProps, 'required' | 'label'>;\n\nconst RepeatableComponent = ({\n attribute,\n disabled,\n name,\n mainField,\n children,\n layout,\n}: RepeatableComponentProps) => {\n const { toggleNotification } = useNotification();\n const { formatMessage } = useIntl();\n const { search: searchString } = useLocation();\n const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);\n const currentDocument = useDocumentContext('RepeatableComponent', (state) => state.document);\n const components = currentDocument.components;\n\n const {\n value = [],\n error,\n rawError,\n } = useField<Schema.Attribute.ComponentValue<`${string}.${string}`, true>>(name);\n const addFieldRow = useForm('RepeatableComponent', (state) => state.addFieldRow);\n const moveFieldRow = useForm('RepeatableComponent', (state) => state.moveFieldRow);\n const removeFieldRow = useForm('RepeatableComponent', (state) => state.removeFieldRow);\n const { max = Infinity } = attribute;\n\n const [collapseToOpen, setCollapseToOpen] = React.useState<string>('');\n const [liveText, setLiveText] = React.useState('');\n\n React.useEffect(() => {\n const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;\n const hasNestedValue = value && Array.isArray(value) && value.length > 0;\n\n if (hasNestedErrors && hasNestedValue) {\n const errorOpenItems = rawError\n .map((_: unknown, idx: number) => {\n return value[idx] ? value[idx].__temp_key__ : null;\n })\n .filter((value) => !!value);\n\n if (errorOpenItems && errorOpenItems.length > 0) {\n setCollapseToOpen((collapseToOpen) => {\n if (!errorOpenItems.includes(collapseToOpen)) {\n return errorOpenItems[0];\n }\n\n return collapseToOpen;\n });\n }\n }\n }, [rawError, value]);\n\n /**\n * Get the temp key of the component that has the field that is currently focussed\n * as defined by the `field` query param. We can then force this specific component\n * to be in its \"open\" state.\n */\n const componentTmpKeyWithFocussedField = React.useMemo(() => {\n if (search.has('field')) {\n const fieldParam = search.get('field');\n\n if (!fieldParam) {\n return undefined;\n }\n\n const [, path] = fieldParam.split(`${name}.`);\n\n if (getIn(value, path, undefined) !== undefined) {\n const [subpath] = path.split('.');\n\n return getIn(value, subpath, undefined)?.__temp_key__;\n }\n }\n\n return undefined;\n }, [search, name, value]);\n\n const prevValue = usePrev(value);\n\n React.useEffect(() => {\n /**\n * When we add a new item to the array, we want to open the collapse.\n */\n if (prevValue && prevValue.length < value.length) {\n setCollapseToOpen(value[value.length - 1].__temp_key__);\n }\n }, [value, prevValue]);\n\n React.useEffect(() => {\n if (typeof componentTmpKeyWithFocussedField === 'string') {\n setCollapseToOpen(componentTmpKeyWithFocussedField);\n }\n }, [componentTmpKeyWithFocussedField]);\n\n const toggleCollapses = () => {\n setCollapseToOpen('');\n };\n\n const handleClick = () => {\n if (value.length < max) {\n const schema = components[attribute.component];\n const form = createDefaultForm(schema, components);\n const data = transformDocument(schema, components)(form);\n\n addFieldRow(name, data);\n // setCollapseToOpen(nextTempKey);\n } else if (value.length >= max) {\n toggleNotification({\n type: 'info',\n message: formatMessage({\n id: getTranslation('components.notification.info.maximum-requirement'),\n }),\n });\n }\n };\n\n const handleMoveComponentField: ComponentProps['onMoveItem'] = (newIndex, currentIndex) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.reorder'),\n defaultMessage: '{item}, moved. New position in list: {position}.',\n },\n {\n item: `${name}.${currentIndex}`,\n position: getItemPos(newIndex),\n }\n )\n );\n\n moveFieldRow(name, currentIndex, newIndex);\n };\n\n const handleValueChange = (key: string) => {\n setCollapseToOpen(key);\n };\n\n const getItemPos = (index: number) => `${index + 1} of ${value.length}`;\n\n const handleCancel = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.cancel-item'),\n defaultMessage: '{item}, dropped. Re-order cancelled.',\n },\n {\n item: `${name}.${index}`,\n }\n )\n );\n };\n\n const handleGrabItem = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.grab-item'),\n defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`,\n },\n {\n item: `${name}.${index}`,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const handleDropItem = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: getTranslation('dnd.drop-item'),\n defaultMessage: `{item}, dropped. Final position in list: {position}.`,\n },\n {\n item: `${name}.${index}`,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const ariaDescriptionId = React.useId();\n\n const level = useComponent('RepeatableComponent', (state) => state.level);\n\n if (value.length === 0) {\n return <Initializer disabled={disabled} name={name} onClick={handleClick} />;\n }\n\n return (\n <Box hasRadius>\n <VisuallyHidden id={ariaDescriptionId}>\n {formatMessage({\n id: getTranslation('dnd.instructions'),\n defaultMessage: `Press spacebar to grab and re-order`,\n })}\n </VisuallyHidden>\n <VisuallyHidden aria-live=\"assertive\">{liveText}</VisuallyHidden>\n <AccordionRoot\n $error={error}\n value={collapseToOpen}\n onValueChange={handleValueChange}\n aria-describedby={ariaDescriptionId}\n >\n {value.map(({ __temp_key__: key, id }, index) => {\n const nameWithIndex = `${name}.${index}`;\n return (\n <ComponentProvider\n key={key}\n // id is always a number in a component\n id={id as number}\n uid={attribute.component}\n level={level + 1}\n type=\"repeatable\"\n >\n <Component\n disabled={disabled}\n name={nameWithIndex}\n attribute={attribute}\n index={index}\n mainField={mainField}\n onMoveItem={handleMoveComponentField}\n onDeleteComponent={() => {\n removeFieldRow(name, index);\n toggleCollapses();\n }}\n toggleCollapses={toggleCollapses}\n onCancel={handleCancel}\n onDropItem={handleDropItem}\n onGrabItem={handleGrabItem}\n __temp_key__={key}\n >\n {layout.map((row, index) => {\n return (\n <ResponsiveGridRoot gap={4} key={index}>\n {row.map(({ size, ...field }) => {\n /**\n * Layouts are built from schemas so they don't understand the complete\n * schema tree, for components we append the parent name to the field name\n * because this is the structure for the data & permissions also understand\n * the nesting involved.\n */\n const completeFieldName = `${nameWithIndex}.${field.name}`;\n\n const translatedLabel = formatMessage({\n id: `content-manager.components.${attribute.component}.${field.name}`,\n defaultMessage: field.label,\n });\n\n return (\n <ResponsiveGridItem\n col={size}\n key={completeFieldName}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n {children({\n ...field,\n label: translatedLabel,\n name: completeFieldName,\n document: currentDocument,\n })}\n </ResponsiveGridItem>\n );\n })}\n </ResponsiveGridRoot>\n );\n })}\n </Component>\n </ComponentProvider>\n );\n })}\n <TextButtonCustom disabled={disabled} onClick={handleClick} startIcon={<Plus />}>\n {formatMessage({\n id: getTranslation('containers.EditView.add.new-entry'),\n defaultMessage: 'Add an entry',\n })}\n </TextButtonCustom>\n </AccordionRoot>\n </Box>\n );\n};\n\nconst AccordionRoot = styled(Accordion.Root)<{ $error?: string }>`\n border: 1px solid\n ${({ theme, $error }) => ($error ? theme.colors.danger600 : theme.colors.neutral200)};\n`;\n\nconst TextButtonCustom = styled(TextButton)`\n width: 100%;\n display: flex;\n justify-content: center;\n border-top: 1px solid ${({ theme }) => theme.colors.neutral200};\n padding-inline: ${(props) => props.theme.spaces[6]};\n padding-block: ${(props) => props.theme.spaces[3]};\n\n &:not([disabled]) {\n cursor: pointer;\n\n &:hover {\n background-color: ${(props) => props.theme.colors.primary100};\n }\n }\n\n span {\n font-weight: 600;\n font-size: 1.4rem;\n line-height: 2.4rem;\n }\n\n @media (prefers-reduced-motion: no-preference) {\n transition: background-color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * Field\n * -----------------------------------------------------------------------------------------------*/\n\ninterface ComponentProps\n extends Pick<UseDragAndDropOptions, 'onGrabItem' | 'onDropItem' | 'onCancel' | 'onMoveItem'>,\n Pick<RepeatableComponentProps, 'mainField'> {\n attribute: Schema.Attribute.Component<`${string}.${string}`, boolean>;\n disabled?: boolean;\n index: number;\n name: string;\n onDeleteComponent?: React.MouseEventHandler<HTMLButtonElement>;\n toggleCollapses: () => void;\n children: React.ReactNode;\n __temp_key__: string;\n}\n\nconst Component = ({\n disabled,\n index,\n name,\n mainField = {\n name: 'id',\n type: 'integer',\n },\n children,\n onDeleteComponent,\n toggleCollapses,\n __temp_key__,\n ...dragProps\n}: ComponentProps) => {\n const { formatMessage } = useIntl();\n\n const displayValue = useForm('RepeatableComponent', (state) => {\n return getIn(state.values, [...name.split('.'), mainField.name]);\n });\n\n const accordionRef = React.useRef<HTMLButtonElement>(null!);\n\n /**\n * The last item in the fieldName array will be the index of this component.\n * Drag and drop should be isolated to the parent component so nested repeatable\n * components are not affected by the drag and drop of the parent component in\n * their own re-ordering context.\n */\n const componentKey = name.split('.').slice(0, -1).join('.');\n\n const [{ handlerId, isDragging, handleKeyDown }, boxRef, dropRef, dragRef, dragPreviewRef] =\n useDragAndDrop(!disabled, {\n type: `${ItemTypes.COMPONENT}_${componentKey}`,\n index,\n item: {\n index,\n displayedValue: displayValue,\n },\n onStart() {\n // Close all collapses\n toggleCollapses();\n },\n ...dragProps,\n });\n\n React.useEffect(() => {\n dragPreviewRef(getEmptyImage(), { captureDraggingState: false });\n }, [dragPreviewRef, index]);\n\n const composedAccordionRefs = useComposedRefs<HTMLButtonElement>(accordionRef, dragRef);\n const composedBoxRefs = useComposedRefs<HTMLDivElement>(\n boxRef as React.RefObject<HTMLDivElement>,\n dropRef\n );\n\n return (\n <>\n {isDragging ? (\n <Preview />\n ) : (\n <Accordion.Item ref={composedBoxRefs} value={__temp_key__}>\n <Accordion.Header>\n <Accordion.Trigger>{displayValue}</Accordion.Trigger>\n <Accordion.Actions>\n <IconButton\n variant=\"ghost\"\n onClick={onDeleteComponent}\n label={formatMessage({\n id: getTranslation('containers.Edit.delete'),\n defaultMessage: 'Delete',\n })}\n >\n <Trash />\n </IconButton>\n <IconButton\n ref={composedAccordionRefs}\n variant=\"ghost\"\n onClick={(e) => e.stopPropagation()}\n data-handler-id={handlerId}\n label={formatMessage({\n id: getTranslation('components.DragHandle-label'),\n defaultMessage: 'Drag',\n })}\n onKeyDown={handleKeyDown}\n >\n <Drag />\n </IconButton>\n </Accordion.Actions>\n </Accordion.Header>\n <Accordion.Content>\n <Flex\n direction=\"column\"\n alignItems=\"stretch\"\n background=\"neutral100\"\n padding={6}\n gap={6}\n >\n {children}\n </Flex>\n </Accordion.Content>\n </Accordion.Item>\n )}\n </>\n );\n};\n\nconst Preview = () => {\n return <StyledSpan tag=\"span\" padding={6} background=\"primary100\" />;\n};\n\nconst StyledSpan = styled<BoxComponent<'span'>>(Box)`\n display: block;\n outline: 1px dashed ${({ theme }) => theme.colors.primary500};\n outline-offset: -1px;\n`;\n\nexport { RepeatableComponent };\nexport type { RepeatableComponentProps };\n","import * as React from 'react';\n\nimport { InputProps, useField } from '@strapi/admin/strapi-admin';\nimport { Field, Flex, IconButton } from '@strapi/design-system';\nimport { Trash } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport { useDocumentContext } from '../../../../../features/DocumentContext';\nimport { EditFieldLayout } from '../../../../../hooks/useDocumentLayout';\nimport { getTranslation } from '../../../../../utils/translations';\nimport { transformDocument } from '../../../utils/data';\nimport { createDefaultForm } from '../../../utils/forms';\nimport { type InputRendererProps } from '../../InputRenderer';\n\nimport { Initializer } from './Initializer';\nimport { NonRepeatableComponent } from './NonRepeatable';\nimport { RepeatableComponent } from './Repeatable';\n\ninterface ComponentInputProps\n extends Omit<Extract<EditFieldLayout, { type: 'component' }>, 'size' | 'hint'>,\n Pick<InputProps, 'hint'> {\n labelAction?: React.ReactNode;\n children: (props: InputRendererProps) => React.ReactNode;\n /**\n * We need layout to come from the props, and not via a hook, because Content History needs\n * a way to modify the normal component layout to add hidden fields.\n */\n layout: EditFieldLayout[][];\n}\n\nconst ComponentInput = ({\n label,\n required,\n name,\n attribute,\n disabled,\n labelAction,\n ...props\n}: ComponentInputProps) => {\n const { formatMessage } = useIntl();\n const field = useField(name);\n\n const showResetComponent = !attribute.repeatable && field.value && !disabled;\n\n const components = useDocumentContext('ComponentInput', (state) => state.document.components);\n\n const handleInitialisationClick = () => {\n const schema = components[attribute.component];\n const form = createDefaultForm(schema, components);\n const data = transformDocument(schema, components)(form);\n\n field.onChange(name, data);\n };\n\n return (\n <Field.Root error={field.error} required={required}>\n <Flex justifyContent=\"space-between\">\n <Field.Label action={labelAction}>\n {label}\n {attribute.repeatable && (\n <>&nbsp;({Array.isArray(field.value) ? field.value.length : 0})</>\n )}\n </Field.Label>\n\n {showResetComponent && (\n <IconButton\n label={formatMessage({\n id: getTranslation('components.reset-entry'),\n defaultMessage: 'Reset Entry',\n })}\n variant=\"ghost\"\n onClick={() => {\n field.onChange(name, null);\n }}\n >\n <Trash />\n </IconButton>\n )}\n </Flex>\n {/**\n * if the field isn't repeatable then we display a button to start the field\n * TODO: should this just live in the `NonRepeatableComponent`?\n */}\n {!attribute.repeatable && !field.value && (\n <Initializer disabled={disabled} name={name} onClick={handleInitialisationClick} />\n )}\n {!attribute.repeatable && field.value ? (\n <NonRepeatableComponent attribute={attribute} name={name} disabled={disabled} {...props}>\n {props.children}\n </NonRepeatableComponent>\n ) : null}\n {attribute.repeatable && (\n <RepeatableComponent attribute={attribute} name={name} disabled={disabled} {...props}>\n {props.children}\n </RepeatableComponent>\n )}\n <Field.Error />\n </Field.Root>\n );\n};\n\nconst MemoizedComponentInput = React.memo(ComponentInput);\n\nexport { MemoizedComponentInput as ComponentInput };\nexport type { ComponentInputProps };\n"],"names":["componentStore","Map","useLazyComponents","componentUids","lazyComponentStore","setLazyComponentStore","useState","Object","fromEntries","newUids","filter","uid","get","loading","setLoading","length","getCustomField","useStrapiApp","state","customFields","useEffect","setStore","store","lazyLoadComponents","uids","components","modules","Promise","all","forEach","index","set","default","componentPromises","reduce","arrayOfPromises","customField","push","Input","cleanup","useCallback","clear","isLazyLoading","codeLanguages","value","label","decorate","baseHandleConvert","editor","attributesToSet","_","lastNodePath","Editor","last","Transforms","unwrapNodes","match","node","isEditor","type","split","at","selection","updatedLastNodePath","entry","above","element","elementPath","setNodes","getAttributesToClear","children","_children","_type","extra","attributesToClear","keys","currentAttributes","key","isText","Node","isNode","pressEnterTwiceToExit","nodeEntry","includes","nodePath","isNodeEnd","isEnd","anchor","lastTextNode","isEmptyLine","text","endsWith","delete","distance","unit","reverse","insertNodes","insertText","modifier","removeMark","decorateCode","path","ranges","Element","isElement","string","language","find","lang","decorateKey","selectedLanguage","Prism","languages","tokens","tokenize","start","token","end","offset","focus","className","CodeBlock","styled","pre","theme","borderRadius","colors","neutral100","spaces","neutral800","CodeEditor","props","useBlocksEditorContext","editorIsFocused","useFocused","imageIsSelected","useSelected","formatMessage","useIntl","isSelectOpen","setIsSelectOpen","React","shouldDisplayLanguageSelect","_jsxs","Box","position","width","_jsx","attributes","code","background","borderColor","borderStyle","borderWidth","shadow","top","marginTop","right","padding","hasRadius","SingleSelect","onChange","open","toString","onOpenChange","ReactEditor","onCloseAutoFocus","e","preventDefault","aria-label","id","defaultMessage","map","SingleSelectOption","codeBlocks","renderElement","icon","CodeBlockIcon","matchNode","isInBlocksSelector","handleConvert","handleEnterKey","snippets","H1","Typography","attrs","tag","lineHeights","H2","H3","H4","H5","H6","handleConvertToHeading","level","headingBlocks","HeadingOne","dragHandleTopMargin","HeadingTwo","HeadingThree","HeadingFour","HeadingFive","HeadingSix","ImageWrapper","Flex","$isFocused","css","primary600","IMAGE_SCHEMA_FIELDS","pick","object","entries","isImage","Image","url","alternativeText","height","image","contentEditable","justifyContent","img","src","alt","ImageDialog","isOpen","setIsOpen","MediaLibraryDialog","insertImages","images","nodeEntryBeingReplaced","isInlineNode","pathToInsert","removeNodes","nodesToInsert","imageNode","select","handleSelectAssets","formattedImages","expectedImage","nodeImage","name","prefixFileUrlWithBackendUrl","allowedTypes","onClose","onSelectAssets","imageBlocks","Picture","handleBackspaceKey","removeLink","SlateElement","insertLink","linkNodes","Array","from","nodes","Range","isCollapsed","link","wrapNodes","editLink","linkEntry","linkPath","linkNodeChildrens","childPath","concat","getEntries","getKeys","isLinkNode","isListNode","StyledLink","RemoveButton","Button","$visible","LinkContent","forwardRef","forwardedRef","findPath","popoverOpen","setPopoverOpen","lastInsertedLinkPath","Path","equals","elementText","child","join","linkText","setLinkText","linkUrl","setLinkUrl","linkInputRef","useRef","isLastInsertedLink","isSaveDisabled","setIsSaveDisabled","onLinkChange","target","URL","startsWith","error","handleSave","stopPropagation","parentPath","parent","handleClose","current","inputNotDirty","Popover","Root","Trigger","ref","href","onClick","color","Content","onPointerDownOutside","direction","gap","Field","alignItems","Label","placeholder","variant","disabled","Boolean","Link","linkBlocks","listStyle","Orderedlist","ol","$listStyleType","Unorderedlist","ul","orderedStyles","unorderedStyles","List","listStyles","format","nextIndex","indentLevel","listStyleType","replaceListWithEmptyBlock","currentListPath","handleBackspaceKeyOnList","event","currentListItem","currentListItemPath","currentList","isListEmpty","isListItemEmpty","isFocusAtTheBeginningOfAChild","parentListEntry","liftNodes","previousEntry","previous","nextEntry","next","previousList","nextList","mergeNodes","handleEnterKeyOnList","currentListItemEntry","currentNode","updatedPath","slice","previousIndentLevel","parentListNodeEntry","modifiedPath","moveNodes","to","createdParagraphPath","splitNodes","handleConvertToList","convertedPath","handleTabOnList","currentListItemIndex","findIndex","item","previousNode","insertAtPath","listBlocks","NumberList","handleTab","BulletList","paragraphBlocks","paragraph","Paragraph","anchorPathInitialPosition","always","parentBlockEntry","parentBlockPath","fragmentedNode","hasNextNode","Blockquote","blockquote","role","fontWeights","regular","neutral200","neutral600","quoteBlocks","quote","div","Quotes","ObservedToolbarComponent","lastVisibleIndex","setLastVisibleIndex","rootRef","isVisible","containerRef","useElementOnScreen","prev","Math","max","threshold","root","style","visibility","EditorToolbarObserver","observedComponents","menuTriggerVariant","toolbarRef","hasHiddenItems","menuIndex","setOpen","isMenuOpenWithContent","menuTriggerRef","component","toolbar","toSpliced","Menu","defaultOpen","paddingLeft","paddingRight","IconButton","More","maxHeight","minWidth","popoverPlacement","zIndex","Fragment","menu","ToolbarWrapper","neutral150","ToolbarSeparator","Toolbar","Separator","FlexButton","primary100","SelectWrapper","useConversionModal","modalElement","setModalComponent","handleConversionResult","renderModal","cloneElement","Date","now","ToolbarButton","Icon","isActive","handleClick","labelMessage","enabledColor","Tooltip","ToggleItem","data-state","onMouseDown","aria-disabled","asChild","fill","BlocksDropdown","blocks","blockKeysToInclude","currentKeys","block","blockSelected","setBlockSelected","handleSelect","optionKey","isSelectorBlockKey","editorIsEmpty","isEmpty","currentListEntry","maybeRenderModal","preventSelectFocus","selectedNode","anchorNode","edge","depth","anchorBlockKey","blockKey","_Fragment","startIcon","BlockOption","isSelected","ListButton","location","isListActive","isListDisabled","anchorNodeEntry","focusNodeEntry","toggleList","StyledMenuItem","onSelect","LinkButton","isLinkActive","unhangRange","isLinkDisabled","addLink","shouldSaveLinkPath","Item","BlocksToolbar","modifiers","checkButtonDisabled","isButtonDisabled","checkIsActive","handleToggle","ToggleGroup","grow","overflow","StyledEditable","Editable","isExpandedMode","Wrapper","isOverDropTarget","DropPlaceholder","dragDirection","placeholderMargin","DIRECTIONS","UPWARD","DOWNWARD","DragItem","$dragVisibility","DragIconButton","$dragHandleTopMargin","neutral500","DragAndDropElement","setDragDirection","setLiveText","dragVisibility","setDragVisibility","handleMoveBlock","newIndex","currentIndex","currentIndexPosition","newIndexPosition","getTranslation","handlerId","isDragging","blockRef","dropRef","dragRef","useDragAndDrop","ItemTypes","BLOCKS","displayedValue","onDropItem","composedBoxRefs","useComposedRefs","marginLeft","as","CloneDragItem","data-handler-id","onDragStart","currentTarget","getAttribute","opacity","onDragEnd","onMouseMove","onMouseLeave","tabIndex","withTooltip","draggable","Drag","baseRenderLeaf","wrappedChildren","currentChildren","modifierEntry","leaf","renderLeaf","span","baseRenderElement","blockMatch","values","BlocksContent","ariaLabelId","blocksRef","handleMoveBlocks","checkSnippet","textNode","textNodePath","blockMatchingSnippet","handleEnter","selectedBlock","shiftKey","handleBackspaceEvent","handleKeyboardShortcuts","isCtrlOrCmd","metaKey","ctrlKey","isValidEventKey","handleKeyDown","blur","handleScrollSelectionIntoView","domRange","toDOMRange","domRect","getBoundingClientRect","blocksInput","editorRect","bottom","scrollBy","behavior","fontSize","lineHeight","paddingTop","paddingBottom","aria-labelledby","readOnly","onKeyDown","scrollSelectionIntoView","onDrop","CollapseIconButton","ExpandWrapper","EditorLayout","onCollapse","ariaDescriptionId","document","body","classList","add","remove","Portal","aria-modal","FocusTrap","onEscape","left","aria-describedby","Collapse","InputWrapper","$disabled","$hasError","danger600","neutral0","undefined","stylesToInherit","BoldText","fontWeight","ItalicText","UnderlineText","textDecoration","StrikeThroughText","InlineCode","baseCheckIsActive","marks","baseHandleToggle","endOfEditor","addMark","bold","Bold","italic","Italic","underline","Underline","strikethrough","StrikeThrough","Code","withImages","isVoid","withLinks","isInline","apply","insertData","operation","hasPrevious","transform","linksInSelection","selectionIsInLink","selectionIsAtEndOfLink","Point","data","pastedText","getData","withStrapiSchema","normalizeNode","selectorBlockKeys","BlocksEditorProvider","usePartialBlocksEditorContext","createContext","consumerName","context","useSlate","EditorDivider","Divider","ExpandIconButton","shadows","filterShadow","useResetKey","slateUpdatesCount","valueUpdatesCount","setKey","previousKey","incrementSlateUpdatesCount","pipe","fns","fn","BlocksEditor","contentProps","withHistory","withReact","createEditor","liveText","useId","setIsExpandedMode","handleToggleExpand","useImperativeHandle","handleSlateChange","isAstChange","operations","some","op","VisuallyHidden","aria-live","Slate","initialValue","Expand","BlocksInput","required","hint","labelAction","editorProps","field","useField","action","Hint","Error","MemoizedBlocksInput","memo","Initializer","cursor","PlusCircle","textColor","ComponentProvider","useComponent","AddComponentButton","hasError","isDisabled","StyledButton","StyledAddIcon","aria-hidden","$isOpen","danger200","ComponentCategory","category","onAddComponent","Accordion","Header","ResponsiveAccordionContent","Grid","displayName","ComponentBox","shrink","ComponentIcon","process","env","NODE_ENV","RESPONSIVE_CONTAINER_BREAKPOINTS","sm","motion","easings","easeOutQuad","primary200","ComponentPicker","dynamicComponentsByCategory","onClickAddComponent","handleAddComponentToDz","componentUid","defaultValue","DynamicComponent","onRemoveComponentClick","onMoveComponent","onGrabItem","onCancel","formValues","useForm","documentMeta","useDocumentContext","meta","rootDocumentMeta","edit","rootComponents","useDocumentLayout","model","relatedComponents","useMemo","title","mainField","settings","mainFieldValue","getIn","String","trim","mainValue","boxRef","dragPreviewRef","DYNAMIC_ZONE","onMoveItem","getEmptyImage","captureDraggingState","accordionValue","rawError","collapseToOpen","setCollapseToOpen","accordionActions","Trash","size","endIcon","focusable","SubRoot","SubTrigger","SubContent","MenuItem","accordionTitle","ComponentContainer","Rectangle","StyledBox","Preview","onValueChange","COMPONENT_ICONS","dashboard","Actions","AccordionContentRadius","layout","row","rowInd","col","s","xs","ResponsiveGridRoot","fieldName","fieldWithTranslatedLabel","ResponsiveGridItem","InputRenderer","tableShadow","primary500","DynamicZoneLabel","numberOfComponents","maxWidth","ellipsis","DynamicZoneProvider","useDynamicZone","isInDynamicZone","DynamicZone","attribute","disabledProp","Infinity","min","addComponentIsOpen","setAddComponentIsOpen","isLoading","addFieldRow","removeFieldRow","moveFieldRow","acc","info","toggleNotification","useNotification","dynamicDisplayedComponentsLength","handleAddComponent","schema","form","createDefaultForm","transformations","transformDocument","__component","handleClickOpenPicker","message","handleMoveComponent","getItemPos","handleCancel","handleGrabItem","handleDropItem","handleRemoveComponent","renderButtonLabel","number","componentName","__temp_key__","NotAllowedInput","TextInput","startAction","EyeStriked","getCollectionType","regex","RegExp","COLLECTION_TYPES","SINGLE_TYPES","CustomModalContent","Modal","RelationModalProvider","useRelationModal","parentModified","RelationModalForm","relation","triggerButtonLabel","navigate","useNavigate","pathname","search","useLocation","triggerRefetchDocument","useLazyGetDocumentQuery","currentDocument","currentDocumentMeta","changeDocument","documentHistory","setDocumentHistory","isConfirmationOpen","setIsConfirmationOpen","actionPosition","setActionPosition","isModalOpen","setIsModalOpen","parentContext","isNested","addDocumentToHistory","getPreviousDocument","lastDocument","removeLastDocumentFromHistory","handleToggleModal","collectionType","documentId","getFullPageLink","isSingleType","queryParams","params","locale","handleRedirection","editViewUrl","isRootDocumentUrl","handleConfirm","previousRelation","FormContext","method","initialValues","getInitialFormValues","validate","options","yupSchema","createYupSchema","status","abortEarly","modified","isSubmitting","resetForm","hasHistory","description","CustomTextButton","marginRight","ArrowLeft","RelationModalBody","ArrowsOut","Footer","Dialog","ConfirmDialog","onConfirm","TextButton","fontSizes","documentResponse","onPreview","documentLayoutResponse","plugins","permissions","isLoadingPermissions","useRBAC","PERMISSIONS","subject","Loader","small","EmptyStateLayout","WarningCircle","content","documentTitle","getTitle","hasDraftAndPublished","draftAndPublish","activeTab","Body","DocumentRBAC","DescriptionComponentRenderer","descriptions","apis","getDocumentActions","actions","filteredActions","flat","primaryAction","secondaryAction","DocumentActionButton","DocumentStatus","flex","FormLayout","hasBackground","useHandleDisconnect","handleDisconnect","connect","indexOfRelationInConnectArray","rel","apiData","RELATIONS_TO_DISPLAY","ONE_WAY_RELATIONS","RelationsField","currentPage","setCurrentPage","isRootDocument","query","useQueryParams","buildValidParams","isMorph","toLowerCase","componentId","componentUID","targetField","schemaAttributes","isRelatedToCurrentDocument","isFetching","useGetRelationsQuery","pageSize","page","refetchOnMountOrArgChange","skip","selectFromResult","result","results","handleLoadMore","isFetchingMoreRelations","realServerRelationsCount","pagination","total","relationsConnected","relationsDisconnected","disconnect","relationsCount","relations","ctx","targetModel","removeConnected","removeDisconnected","addLabelAndHref","transformedRels","sort","a","b","handleConnect","lastItemInList","generateNKeysBetween","getRelationLabel","wrap","StyledFlex","RelationsInput","pageCount","ArrowClockwise","RelationsList","serverData","relationType","connectedRelations","disconnectedRelations","unique","_unique","_ariaLabel","textValue","setTextValue","searchParams","setSearchParams","_q","fieldRef","useFocusInputField","searchParamsDebounced","useDebounce","searchForTrigger","useLazySearchRelationsQuery","idsToInclude","idsToOmit","handleSearch","hasNextPage","handleChange","relationId","opt","console","useLayoutEffect","Combobox","autocomplete","hasMoreItems","noOptionsMessage","loadingMessage","onLoadMore","onTextValueChange","onInputChange","ComboboxOption","RELATION_ITEM_HEIGHT","RELATION_GUTTER","listRef","outerListRef","setOverflow","handleNativeScroll","el","parentScrollContainerHeight","parentNode","scrollHeight","maxScrollBottom","scrollTop","outerListRefCurrent","addEventListener","removeEventListener","handleMoveItem","oldIndex","newData","currentRow","startKey","endKey","newKey","splice","array","relationOnServer","oldRelation","relationInFront","before","publishedAt","relationWithPosition","toReversed","_href","canReorder","dynamicListHeight","ShadowBox","$overflowDirection","FixedSizeList","outerRef","itemCount","itemSize","itemData","ariaDescribedBy","canDrag","itemKey","innerElementType","ListItem","relationRef","RELATION","dropSensitivity","DROP_SENSITIVITY","REGULAR","composedRefs","RelationItemPlaceholder","FlexWrapper","Cross","DisconnectButton","button","LinkEllipsis","MemoizedRelationsField","uidApi","contentManagerApi","injectEndpoints","endpoints","builder","getDefaultUID","config","transformResponse","response","generateUID","mutation","getAvailability","providesTags","_res","_error","contentTypeUID","useGenerateUIDMutation","useGetDefaultUIDQuery","useGetAvailabilityQuery","UID_REGEX","UIDInput","useDoc","allFormValues","availability","setAvailability","showRegenerate","setShowRegenerate","isCloning","useMatch","CLONE_PATH","debouncedValue","hasChanged","_unstableFormatAPIError","formatAPIError","useAPIErrorHandler","defaultGeneratedUID","isGeneratingDefaultUID","apiError","isGeneratingUID","handleRegenerateClick","res","err","availabilityData","isCheckingAvailability","availabilityError","test","timer","isAvailable","window","setTimeout","clearTimeout","shouldShowAvailability","endAction","TextValidation","$available","data-not-here-outer","pointerEvents","CheckCircle","FieldActionWrapper","onMouseEnter","LoadingWrapper","data-testid","Action","neutral400","success600","rotation","keyframes","MemoizedUIDInput","md","Markdown","html","xhtmlOut","breaks","langPrefix","linkify","typographer","highlight","str","getLanguage","utils","escapeHtml","highlightAuto","use","abbr","container","deflist","emoji","footnote","ins","mark","sub","sup","renderer","rules","footnote_ref","idx","slf","caption","footnote_caption","footnote_anchor","PreviewWysiwyg","sanitizeHtml","render","replaceAll","defaults","allowedTags","allowedAttributes","source","dangerouslySetInnerHTML","__html","listRE","emptyListRE","unorderedListRE","newlineAndIndentContinueMarkdownList","cm","getOption","CodeMirror","Pass","listSelections","replacements","i","pos","head","eolState","getStateAfter","line","inList","list","inQuote","getLine","exec","cursorBeforeBullet","ch","empty","execCommand","endOfQuote","endOfList","replaceRange","indent","after","numbered","indexOf","bullet","parseInt","replace","incrementRemainingMarkdownListNumbers","replaceSelections","startLine","lookAhead","skipCount","startItem","startIndent","nextLineNumber","nextLine","nextItem","nextIndent","newNumber","nextNumber","itemNumber","isNaN","editorRef","isPreviewMode","isExpandMode","textareaRef","onChangeRef","toTextArea","fromTextArea","lineWrapping","extraKeys","Enter","Tab","smartIndent","spellcheck","inputStyle","commands","on","doc","getValue","hasFocus","setValue","setOption","getInputField","scrollIntoView","args","EditorAndPreviewWrapper","EditorStylesContainer","$isExpandMode","textarea","previewContent","BoxWithBorder","ExpandButton","floor","padStart","neutral700","replaceText","markdownName","textToChange","editedText","insertListOrTitle","markdown","textToInsert","markdownHandler","markdownType","textToEdit","getSelection","replaceSelection","getCursor","endSelection","startSelection","setSelection","listHandler","listType","getDoc","insertion","somethingSelected","selections","lineInsertion","currentLine","listToInsert","lineContent","titleHandler","titleType","titleToInsert","lineWithNoTitle","newLastLineLength","setCursor","insertFile","files","file","contentLength","mime","insertWithTextToEdit","contentToMove","getRange","newLine","insertWithoutTextToEdit","quoteAndCodeHandler","IconButtonGroup","WysiwygFooter","onToggleExpand","WysiwygNav","onToggleMediaLib","onTogglePreviewMode","handleActionClick","currentEditorRef","Wysiwyg","setIsPreviewMode","mediaLibVisible","setMediaLibVisible","setIsExpandMode","handleToggleMediaLib","handleTogglePreviewMode","formattedFiles","f","MemoizedWysiwyg","visible","providedHint","rootModel","kind","isFormDisabled","canCreateFields","useDocumentRBAC","rbac","canReadFields","canUpdateFields","canUserAction","idToCheck","editableFields","readableFields","canUserReadField","canUserEditField","fields","app","attributeHasCustomFieldProperty","useFieldHint","fieldIsDisabled","CustomInput","FormInputRenderer","addedInputTypes","ComponentInput","inputProps","enum","_mainField","restProps","maximum","minimum","getMinMax","units","maxValue","hasMinAndMax","divider","br","Number","maxLength","minLength","MemoizedInputRenderer","modelName","panel","gridRowIndex","NonRepeatableComponent","completeFieldName","translatedLabel","RepeatableComponent","searchString","URLSearchParams","hasNestedErrors","isArray","hasNestedValue","errorOpenItems","componentTmpKeyWithFocussedField","has","fieldParam","subpath","prevValue","usePrev","toggleCollapses","handleMoveComponentField","handleValueChange","AccordionRoot","$error","nameWithIndex","Component","onDeleteComponent","TextButtonCustom","Plus","dragProps","displayValue","accordionRef","componentKey","COMPONENT","onStart","composedAccordionRefs","StyledSpan","showResetComponent","repeatable","handleInitialisationClick","MemoizedComponentInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,MAAMA,iBAAiB,IAAIC,GAAAA,EAAAA;AAY3B;;AAEC,IACKC,MAAAA,iBAAAA,GAAoB,CAACC,aAAAA,GAA0B,EAAE,GAAA;AACrD,IAAA,MAAM,CAACC,kBAAoBC,EAAAA,qBAAAA,CAAsB,GAAGC,cAASC,CAAAA,MAAAA,CAAOC,WAAW,CAACR,cAAAA,CAAAA,CAAAA;AAChF;;;MAIA,MAAMS,OAAUN,GAAAA,aAAAA,CAAcO,MAAM,CAAC,CAACC,GAAQ,GAAA,CAACX,cAAeY,CAAAA,GAAG,CAACD,GAAAA,CAAAA,CAAAA;IAClE,MAAM,CAACE,SAASC,UAAW,CAAA,GAAGR,eAAS,IAAM,CAAC,CAACG,OAAAA,CAAQM,MAAM,CAAA;IAC7D,MAAMC,cAAAA,GAAiBC,yBAAa,mBAAqB,EAAA,CAACC,QAAUA,KAAMC,CAAAA,YAAY,CAACP,GAAG,CAAA;IAE1FQ,eAAU,CAAA,IAAA;AACR,QAAA,MAAMC,WAAW,CAACC,KAAAA,GAAAA;YAChBjB,qBAAsBiB,C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