@strapi/content-manager 0.0.0-experimental.d954d57341a6623992a0d211daaec8e245c3517d → 0.0.0-experimental.dad3c50630ca4fd9eccdcbe549ee632fc572e23d

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 (225) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -1
  3. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -1
  4. package/dist/_chunks/{ComponentConfigurationPage-WRPUXGd6.js → ComponentConfigurationPage-BLWQy8ru.js} +5 -6
  5. package/dist/_chunks/{ComponentConfigurationPage-WRPUXGd6.js.map → ComponentConfigurationPage-BLWQy8ru.js.map} +1 -1
  6. package/dist/_chunks/{ComponentConfigurationPage-gdUj_t-O.mjs → ComponentConfigurationPage-CtIa3aa2.mjs} +4 -4
  7. package/dist/_chunks/{ComponentConfigurationPage-gdUj_t-O.mjs.map → ComponentConfigurationPage-CtIa3aa2.mjs.map} +1 -1
  8. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js → ComponentIcon-CRbtQEUV.js} +2 -3
  9. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js.map → ComponentIcon-CRbtQEUV.js.map} +1 -1
  10. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -1
  11. package/dist/_chunks/{EditConfigurationPage-BwuIPOJG.mjs → EditConfigurationPage-DsPR2DVk.mjs} +4 -4
  12. package/dist/_chunks/{EditConfigurationPage-BwuIPOJG.mjs.map → EditConfigurationPage-DsPR2DVk.mjs.map} +1 -1
  13. package/dist/_chunks/{EditConfigurationPage-C1vjMBgy.js → EditConfigurationPage-RQkymxCy.js} +5 -6
  14. package/dist/_chunks/{EditConfigurationPage-C1vjMBgy.js.map → EditConfigurationPage-RQkymxCy.js.map} +1 -1
  15. package/dist/_chunks/{EditViewPage-DbcGfyqK.js → EditViewPage-B-kExt8C.js} +63 -13
  16. package/dist/_chunks/EditViewPage-B-kExt8C.js.map +1 -0
  17. package/dist/_chunks/{EditViewPage-0MiFkXa8.mjs → EditViewPage-BPyVuPfM.mjs} +63 -12
  18. package/dist/_chunks/EditViewPage-BPyVuPfM.mjs.map +1 -0
  19. package/dist/_chunks/{Field-BG1xu38N.js → Field-DPIsQRre.js} +680 -261
  20. package/dist/_chunks/Field-DPIsQRre.js.map +1 -0
  21. package/dist/_chunks/{Field-BDMSCcy5.mjs → Field-Dltnt1km.mjs} +676 -257
  22. package/dist/_chunks/Field-Dltnt1km.mjs.map +1 -0
  23. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
  24. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
  25. package/dist/_chunks/{Form-9BnFyUjy.js → Form-BFi4MXMT.js} +43 -22
  26. package/dist/_chunks/Form-BFi4MXMT.js.map +1 -0
  27. package/dist/_chunks/{Form-CPVWavB8.mjs → Form-C1IcWm1u.mjs} +41 -19
  28. package/dist/_chunks/Form-C1IcWm1u.mjs.map +1 -0
  29. package/dist/_chunks/{History-BVpd8LP3.mjs → History-04ChQ4pl.mjs} +108 -116
  30. package/dist/_chunks/History-04ChQ4pl.mjs.map +1 -0
  31. package/dist/_chunks/{History-BWWxLt2Z.js → History-wjcK4L0C.js} +107 -116
  32. package/dist/_chunks/History-wjcK4L0C.js.map +1 -0
  33. package/dist/_chunks/{ListConfigurationPage-DozVMKcR.mjs → ListConfigurationPage-BYqPYLSU.mjs} +25 -12
  34. package/dist/_chunks/ListConfigurationPage-BYqPYLSU.mjs.map +1 -0
  35. package/dist/_chunks/{ListConfigurationPage-6swzjdAZ.js → ListConfigurationPage-CRbxIC3J.js} +25 -13
  36. package/dist/_chunks/ListConfigurationPage-CRbxIC3J.js.map +1 -0
  37. package/dist/_chunks/{ListViewPage-BlzfjS2Q.js → ListViewPage-D5NY9183.js} +121 -81
  38. package/dist/_chunks/ListViewPage-D5NY9183.js.map +1 -0
  39. package/dist/_chunks/{ListViewPage-Ds0ulgfG.mjs → ListViewPage-FU2LBuhl.mjs} +118 -77
  40. package/dist/_chunks/ListViewPage-FU2LBuhl.mjs.map +1 -0
  41. package/dist/_chunks/{NoContentTypePage-D2nCCWEl.js → NoContentTypePage-BgQVE_Qb.js} +2 -2
  42. package/dist/_chunks/{NoContentTypePage-D2nCCWEl.js.map → NoContentTypePage-BgQVE_Qb.js.map} +1 -1
  43. package/dist/_chunks/{NoContentTypePage-BH11kaKt.mjs → NoContentTypePage-DCKUkwb8.mjs} +2 -2
  44. package/dist/_chunks/{NoContentTypePage-BH11kaKt.mjs.map → NoContentTypePage-DCKUkwb8.mjs.map} +1 -1
  45. package/dist/_chunks/{NoPermissionsPage-DN_JlsU2.js → NoPermissionsPage-C5jwn70o.js} +2 -2
  46. package/dist/_chunks/{NoPermissionsPage-DN_JlsU2.js.map → NoPermissionsPage-C5jwn70o.js.map} +1 -1
  47. package/dist/_chunks/{NoPermissionsPage-BT2Tn0D_.mjs → NoPermissionsPage-jqve7C8l.mjs} +2 -2
  48. package/dist/_chunks/{NoPermissionsPage-BT2Tn0D_.mjs.map → NoPermissionsPage-jqve7C8l.mjs.map} +1 -1
  49. package/dist/_chunks/Preview-BMYN548c.mjs +294 -0
  50. package/dist/_chunks/Preview-BMYN548c.mjs.map +1 -0
  51. package/dist/_chunks/Preview-DaOihysv.js +312 -0
  52. package/dist/_chunks/Preview-DaOihysv.js.map +1 -0
  53. package/dist/_chunks/{Relations-CcgFTcWo.js → Relations-CTGM7Hv5.js} +76 -43
  54. package/dist/_chunks/Relations-CTGM7Hv5.js.map +1 -0
  55. package/dist/_chunks/{Relations-Dnag3fhV.mjs → Relations-gscPkxjF.mjs} +76 -42
  56. package/dist/_chunks/Relations-gscPkxjF.mjs.map +1 -0
  57. package/dist/_chunks/{en-fbKQxLGn.js → en-BzQmavmK.js} +37 -18
  58. package/dist/_chunks/{en-fbKQxLGn.js.map → en-BzQmavmK.js.map} +1 -1
  59. package/dist/_chunks/{en-Ux26r5pl.mjs → en-CSxLmrh1.mjs} +37 -18
  60. package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-CSxLmrh1.mjs.map} +1 -1
  61. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  62. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  63. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  64. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  65. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  66. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  67. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  68. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  69. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
  70. package/dist/_chunks/{index-CWpLBSt0.js → index-Ca7YWlAA.js} +1271 -746
  71. package/dist/_chunks/index-Ca7YWlAA.js.map +1 -0
  72. package/dist/_chunks/{index-JNNNKUHs.mjs → index-DqasUQ6Q.mjs} +1288 -763
  73. package/dist/_chunks/index-DqasUQ6Q.mjs.map +1 -0
  74. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  75. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  76. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  77. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  78. package/dist/_chunks/{layout--iHdZzRk.js → layout-BW80JSCd.js} +27 -15
  79. package/dist/_chunks/layout-BW80JSCd.js.map +1 -0
  80. package/dist/_chunks/{layout-DC503LnF.mjs → layout-W3clJSCy.mjs} +28 -15
  81. package/dist/_chunks/layout-W3clJSCy.mjs.map +1 -0
  82. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  83. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  84. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  85. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  86. package/dist/_chunks/{relations-CTje5t-a.mjs → relations-BlDkoeWh.mjs} +6 -7
  87. package/dist/_chunks/relations-BlDkoeWh.mjs.map +1 -0
  88. package/dist/_chunks/{relations-BbHizA5K.js → relations-C9Usz9k5.js} +6 -7
  89. package/dist/_chunks/relations-C9Usz9k5.js.map +1 -0
  90. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  91. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  92. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  93. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  94. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
  95. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
  96. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
  97. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
  98. package/dist/admin/index.js +3 -1
  99. package/dist/admin/index.js.map +1 -1
  100. package/dist/admin/index.mjs +5 -3
  101. package/dist/admin/src/content-manager.d.ts +3 -2
  102. package/dist/admin/src/exports.d.ts +2 -1
  103. package/dist/admin/src/history/index.d.ts +3 -0
  104. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  105. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  106. package/dist/admin/src/index.d.ts +1 -0
  107. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  108. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +2 -1
  109. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +3 -3
  110. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  111. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  112. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +5 -0
  113. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
  114. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
  115. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
  116. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  117. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  118. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
  119. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  120. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  121. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  122. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  123. package/dist/admin/src/preview/index.d.ts +4 -0
  124. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  125. package/dist/admin/src/preview/routes.d.ts +3 -0
  126. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  127. package/dist/admin/src/router.d.ts +1 -1
  128. package/dist/admin/src/services/api.d.ts +1 -1
  129. package/dist/admin/src/services/components.d.ts +2 -2
  130. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  131. package/dist/admin/src/services/documents.d.ts +19 -20
  132. package/dist/admin/src/services/init.d.ts +1 -1
  133. package/dist/admin/src/services/relations.d.ts +2 -2
  134. package/dist/admin/src/services/uid.d.ts +3 -3
  135. package/dist/admin/src/utils/validation.d.ts +4 -1
  136. package/dist/server/index.js +765 -437
  137. package/dist/server/index.js.map +1 -1
  138. package/dist/server/index.mjs +766 -437
  139. package/dist/server/index.mjs.map +1 -1
  140. package/dist/server/src/bootstrap.d.ts.map +1 -1
  141. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  142. package/dist/server/src/controllers/index.d.ts.map +1 -1
  143. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  144. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  145. package/dist/server/src/controllers/utils/metadata.d.ts +16 -1
  146. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  147. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  148. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  149. package/dist/server/src/history/controllers/history-version.d.ts +1 -1
  150. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
  151. package/dist/server/src/history/services/history.d.ts +3 -3
  152. package/dist/server/src/history/services/history.d.ts.map +1 -1
  153. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  154. package/dist/server/src/history/services/utils.d.ts +8 -12
  155. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  156. package/dist/server/src/index.d.ts +7 -6
  157. package/dist/server/src/index.d.ts.map +1 -1
  158. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  159. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  160. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  161. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  162. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  163. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  164. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  165. package/dist/server/src/preview/index.d.ts +4 -0
  166. package/dist/server/src/preview/index.d.ts.map +1 -0
  167. package/dist/server/src/preview/routes/index.d.ts +8 -0
  168. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  169. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  170. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  171. package/dist/server/src/preview/services/index.d.ts +16 -0
  172. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  173. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  174. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  175. package/dist/server/src/preview/services/preview.d.ts +12 -0
  176. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  177. package/dist/server/src/preview/utils.d.ts +19 -0
  178. package/dist/server/src/preview/utils.d.ts.map +1 -0
  179. package/dist/server/src/register.d.ts.map +1 -1
  180. package/dist/server/src/routes/index.d.ts.map +1 -1
  181. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  182. package/dist/server/src/services/document-metadata.d.ts +12 -10
  183. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  184. package/dist/server/src/services/index.d.ts +7 -6
  185. package/dist/server/src/services/index.d.ts.map +1 -1
  186. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  187. package/dist/server/src/services/utils/populate.d.ts +2 -2
  188. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  189. package/dist/server/src/utils/index.d.ts +2 -0
  190. package/dist/server/src/utils/index.d.ts.map +1 -1
  191. package/dist/shared/contracts/collection-types.d.ts +3 -1
  192. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  193. package/dist/shared/contracts/index.d.ts +1 -0
  194. package/dist/shared/contracts/index.d.ts.map +1 -1
  195. package/dist/shared/contracts/preview.d.ts +27 -0
  196. package/dist/shared/contracts/preview.d.ts.map +1 -0
  197. package/dist/shared/index.js +4 -0
  198. package/dist/shared/index.js.map +1 -1
  199. package/dist/shared/index.mjs +4 -0
  200. package/dist/shared/index.mjs.map +1 -1
  201. package/package.json +17 -15
  202. package/dist/_chunks/EditViewPage-0MiFkXa8.mjs.map +0 -1
  203. package/dist/_chunks/EditViewPage-DbcGfyqK.js.map +0 -1
  204. package/dist/_chunks/Field-BDMSCcy5.mjs.map +0 -1
  205. package/dist/_chunks/Field-BG1xu38N.js.map +0 -1
  206. package/dist/_chunks/Form-9BnFyUjy.js.map +0 -1
  207. package/dist/_chunks/Form-CPVWavB8.mjs.map +0 -1
  208. package/dist/_chunks/History-BVpd8LP3.mjs.map +0 -1
  209. package/dist/_chunks/History-BWWxLt2Z.js.map +0 -1
  210. package/dist/_chunks/ListConfigurationPage-6swzjdAZ.js.map +0 -1
  211. package/dist/_chunks/ListConfigurationPage-DozVMKcR.mjs.map +0 -1
  212. package/dist/_chunks/ListViewPage-BlzfjS2Q.js.map +0 -1
  213. package/dist/_chunks/ListViewPage-Ds0ulgfG.mjs.map +0 -1
  214. package/dist/_chunks/Relations-CcgFTcWo.js.map +0 -1
  215. package/dist/_chunks/Relations-Dnag3fhV.mjs.map +0 -1
  216. package/dist/_chunks/index-CWpLBSt0.js.map +0 -1
  217. package/dist/_chunks/index-JNNNKUHs.mjs.map +0 -1
  218. package/dist/_chunks/layout--iHdZzRk.js.map +0 -1
  219. package/dist/_chunks/layout-DC503LnF.mjs.map +0 -1
  220. package/dist/_chunks/relations-BbHizA5K.js.map +0 -1
  221. package/dist/_chunks/relations-CTje5t-a.mjs.map +0 -1
  222. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  223. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  224. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  225. package/strapi-server.js +0 -3
@@ -5,19 +5,70 @@ const strapiAdmin = require("@strapi/admin/strapi-admin");
5
5
  const designSystem = require("@strapi/design-system");
6
6
  const pipe$1 = require("lodash/fp/pipe");
7
7
  const reactIntl = require("react-intl");
8
- const index = require("./index-CWpLBSt0.js");
8
+ const index = require("./index-Ca7YWlAA.js");
9
9
  const fractionalIndexing = require("fractional-indexing");
10
- const Relations = require("./Relations-CcgFTcWo.js");
10
+ const Relations = require("./Relations-CTGM7Hv5.js");
11
11
  const Icons = require("@strapi/icons");
12
12
  const styledComponents = require("styled-components");
13
- const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
13
+ const ComponentIcon = require("./ComponentIcon-CRbtQEUV.js");
14
14
  const reactDndHtml5Backend = require("react-dnd-html5-backend");
15
- const useDragAndDrop = require("./useDragAndDrop-J0TUUbR6.js");
16
- const objects = require("./objects-gigeqt7s.js");
15
+ const useDragAndDrop = require("./useDragAndDrop-BMtgCYzL.js");
16
+ const objects = require("./objects-BcXOv6_9.js");
17
17
  const slate = require("slate");
18
18
  const slateHistory = require("slate-history");
19
19
  const slateReact = require("slate-react");
20
- const usePrev = require("./usePrev-B9w_-eYc.js");
20
+ const Prism = require("prismjs");
21
+ require("prismjs/themes/prism-solarizedlight.css");
22
+ require("prismjs/components/prism-asmatmel");
23
+ require("prismjs/components/prism-bash");
24
+ require("prismjs/components/prism-basic");
25
+ require("prismjs/components/prism-c");
26
+ require("prismjs/components/prism-clojure");
27
+ require("prismjs/components/prism-cobol");
28
+ require("prismjs/components/prism-cpp");
29
+ require("prismjs/components/prism-csharp");
30
+ require("prismjs/components/prism-dart");
31
+ require("prismjs/components/prism-docker");
32
+ require("prismjs/components/prism-elixir");
33
+ require("prismjs/components/prism-erlang");
34
+ require("prismjs/components/prism-fortran");
35
+ require("prismjs/components/prism-fsharp");
36
+ require("prismjs/components/prism-go");
37
+ require("prismjs/components/prism-graphql");
38
+ require("prismjs/components/prism-groovy");
39
+ require("prismjs/components/prism-haskell");
40
+ require("prismjs/components/prism-haxe");
41
+ require("prismjs/components/prism-ini");
42
+ require("prismjs/components/prism-java");
43
+ require("prismjs/components/prism-javascript");
44
+ require("prismjs/components/prism-jsx");
45
+ require("prismjs/components/prism-json");
46
+ require("prismjs/components/prism-julia");
47
+ require("prismjs/components/prism-kotlin");
48
+ require("prismjs/components/prism-latex");
49
+ require("prismjs/components/prism-lua");
50
+ require("prismjs/components/prism-markdown");
51
+ require("prismjs/components/prism-matlab");
52
+ require("prismjs/components/prism-makefile");
53
+ require("prismjs/components/prism-objectivec");
54
+ require("prismjs/components/prism-perl");
55
+ require("prismjs/components/prism-php");
56
+ require("prismjs/components/prism-powershell");
57
+ require("prismjs/components/prism-python");
58
+ require("prismjs/components/prism-r");
59
+ require("prismjs/components/prism-ruby");
60
+ require("prismjs/components/prism-rust");
61
+ require("prismjs/components/prism-sas");
62
+ require("prismjs/components/prism-scala");
63
+ require("prismjs/components/prism-scheme");
64
+ require("prismjs/components/prism-sql");
65
+ require("prismjs/components/prism-stata");
66
+ require("prismjs/components/prism-swift");
67
+ require("prismjs/components/prism-typescript");
68
+ require("prismjs/components/prism-tsx");
69
+ require("prismjs/components/prism-vbnet");
70
+ require("prismjs/components/prism-yaml");
71
+ const useDebounce = require("./useDebounce-CtcjDB3L.js");
21
72
  const Toolbar = require("@radix-ui/react-toolbar");
22
73
  const reactRouterDom = require("react-router-dom");
23
74
  const CodeMirror = require("codemirror5");
@@ -37,8 +88,7 @@ require("highlight.js/styles/solarized-dark.css");
37
88
  require("codemirror5/addon/display/placeholder");
38
89
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
39
90
  function _interopNamespace(e) {
40
- if (e && e.__esModule)
41
- return e;
91
+ if (e && e.__esModule) return e;
42
92
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
43
93
  if (e) {
44
94
  for (const k in e) {
@@ -56,6 +106,7 @@ function _interopNamespace(e) {
56
106
  }
57
107
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
58
108
  const pipe__default = /* @__PURE__ */ _interopDefault(pipe$1);
109
+ const Prism__namespace = /* @__PURE__ */ _interopNamespace(Prism);
59
110
  const Toolbar__namespace = /* @__PURE__ */ _interopNamespace(Toolbar);
60
111
  const CodeMirror__default = /* @__PURE__ */ _interopDefault(CodeMirror);
61
112
  const sanitizeHtml__default = /* @__PURE__ */ _interopDefault(sanitizeHtml);
@@ -194,6 +245,224 @@ const useLazyComponents = (componentUids = []) => {
194
245
  }, []);
195
246
  return { isLazyLoading: loading, lazyComponentStore, cleanup };
196
247
  };
248
+ const codeLanguages = [
249
+ {
250
+ value: "asm",
251
+ label: "Assembly",
252
+ decorate: "asmatmel"
253
+ },
254
+ {
255
+ value: "bash",
256
+ label: "Bash"
257
+ },
258
+ {
259
+ value: "c",
260
+ label: "C"
261
+ },
262
+ {
263
+ value: "clojure",
264
+ label: "Clojure"
265
+ },
266
+ {
267
+ value: "cobol",
268
+ label: "COBOL"
269
+ },
270
+ {
271
+ value: "cpp",
272
+ label: "C++"
273
+ },
274
+ {
275
+ value: "csharp",
276
+ label: "C#"
277
+ },
278
+ {
279
+ value: "css",
280
+ label: "CSS"
281
+ },
282
+ {
283
+ value: "dart",
284
+ label: "Dart"
285
+ },
286
+ {
287
+ value: "dockerfile",
288
+ label: "Dockerfile",
289
+ decorate: "docker"
290
+ },
291
+ {
292
+ value: "elixir",
293
+ label: "Elixir"
294
+ },
295
+ {
296
+ value: "erlang",
297
+ label: "Erlang"
298
+ },
299
+ {
300
+ value: "fortran",
301
+ label: "Fortran"
302
+ },
303
+ {
304
+ value: "fsharp",
305
+ label: "F#"
306
+ },
307
+ {
308
+ value: "go",
309
+ label: "Go"
310
+ },
311
+ {
312
+ value: "graphql",
313
+ label: "GraphQL"
314
+ },
315
+ {
316
+ value: "groovy",
317
+ label: "Groovy"
318
+ },
319
+ {
320
+ value: "haskell",
321
+ label: "Haskell"
322
+ },
323
+ {
324
+ value: "haxe",
325
+ label: "Haxe"
326
+ },
327
+ {
328
+ value: "html",
329
+ label: "HTML"
330
+ },
331
+ {
332
+ value: "ini",
333
+ label: "INI"
334
+ },
335
+ {
336
+ value: "java",
337
+ label: "Java"
338
+ },
339
+ {
340
+ value: "javascript",
341
+ label: "JavaScript"
342
+ },
343
+ {
344
+ value: "jsx",
345
+ label: "JavaScript (React)"
346
+ },
347
+ {
348
+ value: "json",
349
+ label: "JSON"
350
+ },
351
+ {
352
+ value: "julia",
353
+ label: "Julia"
354
+ },
355
+ {
356
+ value: "kotlin",
357
+ label: "Kotlin"
358
+ },
359
+ {
360
+ value: "latex",
361
+ label: "LaTeX"
362
+ },
363
+ {
364
+ value: "lua",
365
+ label: "Lua"
366
+ },
367
+ {
368
+ value: "markdown",
369
+ label: "Markdown"
370
+ },
371
+ {
372
+ value: "matlab",
373
+ label: "MATLAB"
374
+ },
375
+ {
376
+ value: "makefile",
377
+ label: "Makefile"
378
+ },
379
+ {
380
+ value: "objectivec",
381
+ label: "Objective-C"
382
+ },
383
+ {
384
+ value: "perl",
385
+ label: "Perl"
386
+ },
387
+ {
388
+ value: "php",
389
+ label: "PHP"
390
+ },
391
+ {
392
+ value: "plaintext",
393
+ label: "Plain text"
394
+ },
395
+ {
396
+ value: "powershell",
397
+ label: "PowerShell"
398
+ },
399
+ {
400
+ value: "python",
401
+ label: "Python"
402
+ },
403
+ {
404
+ value: "r",
405
+ label: "R"
406
+ },
407
+ {
408
+ value: "ruby",
409
+ label: "Ruby"
410
+ },
411
+ {
412
+ value: "rust",
413
+ label: "Rust"
414
+ },
415
+ {
416
+ value: "sas",
417
+ label: "SAS"
418
+ },
419
+ {
420
+ value: "scala",
421
+ label: "Scala"
422
+ },
423
+ {
424
+ value: "scheme",
425
+ label: "Scheme"
426
+ },
427
+ {
428
+ value: "shell",
429
+ label: "Shell"
430
+ },
431
+ {
432
+ value: "sql",
433
+ label: "SQL"
434
+ },
435
+ {
436
+ value: "stata",
437
+ label: "Stata"
438
+ },
439
+ {
440
+ value: "swift",
441
+ label: "Swift"
442
+ },
443
+ {
444
+ value: "typescript",
445
+ label: "TypeScript",
446
+ decorate: "ts"
447
+ },
448
+ {
449
+ value: "tsx",
450
+ label: "TypeScript (React)"
451
+ },
452
+ {
453
+ value: "vbnet",
454
+ label: "VB.NET"
455
+ },
456
+ {
457
+ value: "xml",
458
+ label: "XML"
459
+ },
460
+ {
461
+ value: "yaml",
462
+ label: "YAML",
463
+ decorate: "yml"
464
+ }
465
+ ];
197
466
  const baseHandleConvert = (editor, attributesToSet) => {
198
467
  const [_, lastNodePath] = slate.Editor.last(editor, []);
199
468
  slate.Transforms.unwrapNodes(editor, {
@@ -257,6 +526,29 @@ const pressEnterTwiceToExit = (editor) => {
257
526
  });
258
527
  }
259
528
  };
529
+ const decorateCode = ([node, path]) => {
530
+ const ranges = [];
531
+ if (!slate.Element.isElement(node) || node.type !== "code") return ranges;
532
+ const text = slate.Node.string(node);
533
+ const language = codeLanguages.find((lang) => lang.value === node.language);
534
+ const decorateKey = language?.decorate ?? language?.value;
535
+ const selectedLanguage = Prism__namespace.languages[decorateKey || "plaintext"];
536
+ const tokens = Prism__namespace.tokenize(text, selectedLanguage);
537
+ let start = 0;
538
+ for (const token of tokens) {
539
+ const length = token.length;
540
+ const end = start + length;
541
+ if (typeof token !== "string") {
542
+ ranges.push({
543
+ anchor: { path, offset: start },
544
+ focus: { path, offset: end },
545
+ className: `token ${token.type}`
546
+ });
547
+ }
548
+ start = end;
549
+ }
550
+ return ranges;
551
+ };
260
552
  const CodeBlock = styledComponents.styled.pre`
261
553
  border-radius: ${({ theme }) => theme.borderRadius};
262
554
  background-color: ${({ theme }) => theme.colors.neutral100};
@@ -264,6 +556,7 @@ const CodeBlock = styledComponents.styled.pre`
264
556
  overflow: auto;
265
557
  padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};
266
558
  flex-shrink: 1;
559
+
267
560
  & > code {
268
561
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas,
269
562
  monospace;
@@ -272,10 +565,62 @@ const CodeBlock = styledComponents.styled.pre`
272
565
  max-width: 100%;
273
566
  }
274
567
  `;
568
+ const CodeEditor = (props) => {
569
+ const { editor } = useBlocksEditorContext("ImageDialog");
570
+ const editorIsFocused = slateReact.useFocused();
571
+ const imageIsSelected = slateReact.useSelected();
572
+ const { formatMessage } = reactIntl.useIntl();
573
+ const [isSelectOpen, setIsSelectOpen] = React__namespace.useState(false);
574
+ const shouldDisplayLanguageSelect = editorIsFocused && imageIsSelected || isSelectOpen;
575
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { position: "relative", width: "100%", children: [
576
+ /* @__PURE__ */ jsxRuntime.jsx(CodeBlock, { ...props.attributes, children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: props.children }) }),
577
+ shouldDisplayLanguageSelect && /* @__PURE__ */ jsxRuntime.jsx(
578
+ designSystem.Box,
579
+ {
580
+ position: "absolute",
581
+ background: "neutral0",
582
+ borderColor: "neutral150",
583
+ borderStyle: "solid",
584
+ borderWidth: "0.5px",
585
+ shadow: "tableShadow",
586
+ top: "100%",
587
+ marginTop: 1,
588
+ right: 0,
589
+ padding: 1,
590
+ hasRadius: true,
591
+ children: /* @__PURE__ */ jsxRuntime.jsx(
592
+ designSystem.SingleSelect,
593
+ {
594
+ onChange: (open) => {
595
+ slate.Transforms.setNodes(
596
+ editor,
597
+ { language: open.toString() },
598
+ { match: (node) => !slate.Editor.isEditor(node) && node.type === "code" }
599
+ );
600
+ },
601
+ value: props.element.type === "code" && props.element.language || "plaintext",
602
+ onOpenChange: (open) => {
603
+ setIsSelectOpen(open);
604
+ if (!open) {
605
+ slateReact.ReactEditor.focus(editor);
606
+ }
607
+ },
608
+ onCloseAutoFocus: (e) => e.preventDefault(),
609
+ "aria-label": formatMessage({
610
+ id: "components.Blocks.blocks.code.languageLabel",
611
+ defaultMessage: "Select a language"
612
+ }),
613
+ children: codeLanguages.map(({ value, label }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value, children: label }, value))
614
+ }
615
+ )
616
+ }
617
+ )
618
+ ] });
619
+ };
275
620
  const codeBlocks = {
276
621
  code: {
277
- renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(CodeBlock, { ...props.attributes, children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: props.children }) }),
278
- icon: Icons.Code,
622
+ renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(CodeEditor, { ...props }),
623
+ icon: Icons.CodeBlock,
279
624
  label: {
280
625
  id: "components.Blocks.blocks.code",
281
626
  defaultMessage: "Code block"
@@ -283,13 +628,12 @@ const codeBlocks = {
283
628
  matchNode: (node) => node.type === "code",
284
629
  isInBlocksSelector: true,
285
630
  handleConvert(editor) {
286
- baseHandleConvert(editor, { type: "code" });
631
+ baseHandleConvert(editor, { type: "code", language: "plaintext" });
287
632
  },
288
633
  handleEnterKey(editor) {
289
634
  pressEnterTwiceToExit(editor);
290
635
  },
291
- snippets: ["```"],
292
- dragHandleTopMargin: "10px"
636
+ snippets: ["```"]
293
637
  }
294
638
  };
295
639
  const H1 = styledComponents.styled(designSystem.Typography).attrs({ tag: "h1" })`
@@ -464,8 +808,7 @@ const ImageDialog = () => {
464
808
  const [isOpen, setIsOpen] = React__namespace.useState(true);
465
809
  const { editor } = useBlocksEditorContext("ImageDialog");
466
810
  const components = strapiAdmin.useStrapiApp("ImageDialog", (state) => state.components);
467
- if (!components || !isOpen)
468
- return null;
811
+ if (!components || !isOpen) return null;
469
812
  const MediaLibraryDialog = components["media-library"];
470
813
  const insertImages = (images) => {
471
814
  slate.Transforms.unwrapNodes(editor, {
@@ -474,14 +817,12 @@ const ImageDialog = () => {
474
817
  });
475
818
  const nodeEntryBeingReplaced = slate.Editor.above(editor, {
476
819
  match(node) {
477
- if (slate.Editor.isEditor(node))
478
- return false;
820
+ if (slate.Editor.isEditor(node)) return false;
479
821
  const isInlineNode = ["text", "link"].includes(node.type);
480
822
  return !isInlineNode;
481
823
  }
482
824
  });
483
- if (!nodeEntryBeingReplaced)
484
- return;
825
+ if (!nodeEntryBeingReplaced) return;
485
826
  const [, pathToInsert] = nodeEntryBeingReplaced;
486
827
  slate.Transforms.removeNodes(editor);
487
828
  const nodesToInsert = images.map((image) => {
@@ -501,7 +842,7 @@ const ImageDialog = () => {
501
842
  const nodeImage = {
502
843
  ...expectedImage,
503
844
  alternativeText: expectedImage.alternativeText || expectedImage.name,
504
- url: usePrev.prefixFileUrlWithBackendUrl(image.url)
845
+ url: useDebounce.prefixFileUrlWithBackendUrl(image.url)
505
846
  };
506
847
  return nodeImage;
507
848
  });
@@ -627,20 +968,8 @@ const LinkContent = React__namespace.forwardRef(
627
968
  const [linkText, setLinkText] = React__namespace.useState(elementText);
628
969
  const [linkUrl, setLinkUrl] = React__namespace.useState(link.url);
629
970
  const linkInputRef = React__namespace.useRef(null);
630
- const [showRemoveButton, setShowRemoveButton] = React__namespace.useState(false);
971
+ const isLastInsertedLink = editor.lastInsertedLinkPath ? !slate.Path.equals(path, editor.lastInsertedLinkPath) : true;
631
972
  const [isSaveDisabled, setIsSaveDisabled] = React__namespace.useState(false);
632
- const handleOpenChange = (isOpen) => {
633
- if (isOpen) {
634
- setPopoverOpen(isOpen);
635
- setShowRemoveButton(isOpen);
636
- } else {
637
- setPopoverOpen(isOpen);
638
- if (link.url === "") {
639
- removeLink(editor);
640
- }
641
- slateReact.ReactEditor.focus(editor);
642
- }
643
- };
644
973
  const onLinkChange = (e) => {
645
974
  setIsSaveDisabled(false);
646
975
  setLinkUrl(e.target.value);
@@ -661,15 +990,32 @@ const LinkContent = React__namespace.forwardRef(
661
990
  editLink(editor, { url: linkUrl, text: linkText });
662
991
  setPopoverOpen(false);
663
992
  editor.lastInsertedLinkPath = null;
993
+ slateReact.ReactEditor.focus(editor);
994
+ };
995
+ const handleClose = () => {
996
+ if (link.url === "") {
997
+ removeLink(editor);
998
+ }
999
+ setPopoverOpen(false);
1000
+ slateReact.ReactEditor.focus(editor);
664
1001
  };
665
1002
  React__namespace.useEffect(() => {
666
- if (popoverOpen)
667
- linkInputRef.current?.focus();
1003
+ if (popoverOpen) linkInputRef.current?.focus();
668
1004
  }, [popoverOpen]);
669
1005
  const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
670
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { onOpenChange: handleOpenChange, open: popoverOpen, children: [
671
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(StyledBaseLink, { ...attributes, ref: forwardedRef, href: link.url, color: "primary600", children }) }),
672
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, tag: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
1006
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { open: popoverOpen, children: [
1007
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
1008
+ StyledBaseLink,
1009
+ {
1010
+ ...attributes,
1011
+ ref: forwardedRef,
1012
+ href: link.url,
1013
+ onClick: () => setPopoverOpen(true),
1014
+ color: "primary600",
1015
+ children
1016
+ }
1017
+ ) }),
1018
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { onPointerDownOutside: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, direction: "column", gap: 4, children: [
673
1019
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { width: "368px", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
674
1020
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
675
1021
  id: "components.Blocks.popover.text",
@@ -715,7 +1061,7 @@ const LinkContent = React__namespace.forwardRef(
715
1061
  {
716
1062
  variant: "danger-light",
717
1063
  onClick: () => removeLink(editor),
718
- $visible: showRemoveButton,
1064
+ $visible: isLastInsertedLink,
719
1065
  children: formatMessage({
720
1066
  id: "components.Blocks.popover.remove",
721
1067
  defaultMessage: "Remove"
@@ -723,12 +1069,12 @@ const LinkContent = React__namespace.forwardRef(
723
1069
  }
724
1070
  ),
725
1071
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
726
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: () => handleOpenChange(false), children: formatMessage({
727
- id: "components.Blocks.popover.cancel",
1072
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
1073
+ id: "global.cancel",
728
1074
  defaultMessage: "Cancel"
729
1075
  }) }),
730
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { type: "submit", disabled: Boolean(inputNotDirty) || isSaveDisabled, children: formatMessage({
731
- id: "components.Blocks.popover.save",
1076
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
1077
+ id: "global.save",
732
1078
  defaultMessage: "Save"
733
1079
  }) })
734
1080
  ] })
@@ -809,8 +1155,7 @@ const isText$1 = (node) => {
809
1155
  return slate.Node.isNode(node) && !slate.Editor.isEditor(node) && node.type === "text";
810
1156
  };
811
1157
  const handleBackspaceKeyOnList = (editor, event) => {
812
- if (!editor.selection)
813
- return;
1158
+ if (!editor.selection) return;
814
1159
  const [currentListItem, currentListItemPath] = slate.Editor.parent(editor, editor.selection.anchor);
815
1160
  const [currentList, currentListPath] = slate.Editor.parent(editor, currentListItemPath);
816
1161
  const isListEmpty = currentList.children.length === 1 && isText$1(currentListItem.children[0]) && currentListItem.children[0].text === "";
@@ -919,8 +1264,7 @@ const handleEnterKeyOnList = (editor) => {
919
1264
  };
920
1265
  const handleConvertToList = (editor, format) => {
921
1266
  const convertedPath = baseHandleConvert(editor, { type: "list-item" });
922
- if (!convertedPath)
923
- return;
1267
+ if (!convertedPath) return;
924
1268
  slate.Transforms.wrapNodes(editor, { type: "list", format, children: [] }, { at: convertedPath });
925
1269
  };
926
1270
  const handleTabOnList = (editor) => {
@@ -932,8 +1276,7 @@ const handleTabOnList = (editor) => {
932
1276
  }
933
1277
  const [currentListItem, currentListItemPath] = currentListItemEntry;
934
1278
  const [currentList] = slate.Editor.parent(editor, currentListItemPath);
935
- if (currentListItem === currentList.children[0])
936
- return;
1279
+ if (currentListItem === currentList.children[0]) return;
937
1280
  const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);
938
1281
  const previousNode = currentList.children[currentListItemIndex - 1];
939
1282
  if (previousNode.type === "list") {
@@ -1069,13 +1412,13 @@ const quoteBlocks = {
1069
1412
  handleEnterKey(editor) {
1070
1413
  pressEnterTwiceToExit(editor);
1071
1414
  },
1072
- snippets: [">"],
1073
- dragHandleTopMargin: "6px"
1415
+ snippets: [">"]
1074
1416
  }
1075
1417
  };
1076
1418
  const ToolbarWrapper = styledComponents.styled(designSystem.Flex)`
1077
1419
  &[aria-disabled='true'] {
1078
1420
  cursor: not-allowed;
1421
+ background: ${({ theme }) => theme.colors.neutral150};
1079
1422
  }
1080
1423
  `;
1081
1424
  const Separator = styledComponents.styled(Toolbar__namespace.Separator)`
@@ -1086,7 +1429,7 @@ const Separator = styledComponents.styled(Toolbar__namespace.Separator)`
1086
1429
  const FlexButton = styledComponents.styled(designSystem.Flex)`
1087
1430
  // Inherit the not-allowed cursor from ToolbarWrapper when disabled
1088
1431
  &[aria-disabled] {
1089
- cursor: inherit;
1432
+ cursor: not-allowed;
1090
1433
  }
1091
1434
 
1092
1435
  &[aria-disabled='false'] {
@@ -1168,7 +1511,7 @@ const ToolbarButton = ({
1168
1511
  width: 7,
1169
1512
  height: 7,
1170
1513
  hasRadius: true,
1171
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { width: "1.2rem", height: "1.2rem", fill: disabled ? "neutral300" : enabledColor })
1514
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
1172
1515
  }
1173
1516
  )
1174
1517
  }
@@ -1300,8 +1643,7 @@ const isListNode = (node) => {
1300
1643
  const ListButton = ({ block, format }) => {
1301
1644
  const { editor, disabled, blocks } = useBlocksEditorContext("ListButton");
1302
1645
  const isListActive = () => {
1303
- if (!editor.selection)
1304
- return false;
1646
+ if (!editor.selection) return false;
1305
1647
  const currentListEntry = slate.Editor.above(editor, {
1306
1648
  match: (node) => !slate.Editor.isEditor(node) && node.type === "list",
1307
1649
  at: editor.selection.anchor
@@ -1313,6 +1655,26 @@ const ListButton = ({ block, format }) => {
1313
1655
  }
1314
1656
  return false;
1315
1657
  };
1658
+ const isListDisabled = () => {
1659
+ if (disabled) {
1660
+ return true;
1661
+ }
1662
+ if (!editor.selection) {
1663
+ return false;
1664
+ }
1665
+ const anchorNodeEntry = slate.Editor.above(editor, {
1666
+ at: editor.selection.anchor,
1667
+ match: (node) => !slate.Editor.isEditor(node) && node.type !== "text"
1668
+ });
1669
+ const focusNodeEntry = slate.Editor.above(editor, {
1670
+ at: editor.selection.focus,
1671
+ match: (node) => !slate.Editor.isEditor(node) && node.type !== "text"
1672
+ });
1673
+ if (!anchorNodeEntry || !focusNodeEntry) {
1674
+ return false;
1675
+ }
1676
+ return anchorNodeEntry[0] !== focusNodeEntry[0];
1677
+ };
1316
1678
  const toggleList = (format2) => {
1317
1679
  let currentListEntry;
1318
1680
  if (editor.selection) {
@@ -1346,7 +1708,7 @@ const ListButton = ({ block, format }) => {
1346
1708
  name: format,
1347
1709
  label: block.label,
1348
1710
  isActive: isListActive(),
1349
- disabled,
1711
+ disabled: isListDisabled(),
1350
1712
  handleClick: () => toggleList(format)
1351
1713
  }
1352
1714
  );
@@ -1355,8 +1717,7 @@ const LinkButton = ({ disabled }) => {
1355
1717
  const { editor } = useBlocksEditorContext("LinkButton");
1356
1718
  const isLinkActive = () => {
1357
1719
  const { selection } = editor;
1358
- if (!selection)
1359
- return false;
1720
+ if (!selection) return false;
1360
1721
  const [match] = Array.from(
1361
1722
  slate.Editor.nodes(editor, {
1362
1723
  at: slate.Editor.unhangRange(editor, selection),
@@ -1420,7 +1781,7 @@ const BlocksToolbar = () => {
1420
1781
  return false;
1421
1782
  };
1422
1783
  const isButtonDisabled = checkButtonDisabled();
1423
- return /* @__PURE__ */ jsxRuntime.jsx(Toolbar__namespace.Root, { "aria-disabled": disabled, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarWrapper, { gap: 2, padding: 2, children: [
1784
+ return /* @__PURE__ */ jsxRuntime.jsx(Toolbar__namespace.Root, { "aria-disabled": disabled, asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(ToolbarWrapper, { gap: 2, padding: 2, width: "100%", children: [
1424
1785
  /* @__PURE__ */ jsxRuntime.jsx(BlocksDropdown, {}),
1425
1786
  /* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
1426
1787
  /* @__PURE__ */ jsxRuntime.jsx(Toolbar__namespace.ToggleGroup, { type: "multiple", asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 1, children: [
@@ -1490,33 +1851,36 @@ const DragItem = styledComponents.styled(designSystem.Flex)`
1490
1851
  }
1491
1852
  `;
1492
1853
  const DragIconButton = styledComponents.styled(designSystem.IconButton)`
1854
+ user-select: none;
1493
1855
  display: flex;
1494
1856
  align-items: center;
1495
1857
  justify-content: center;
1858
+ border: none;
1496
1859
  border-radius: ${({ theme }) => theme.borderRadius};
1497
- width: ${({ theme }) => theme.spaces[4]};
1498
- height: ${({ theme }) => theme.spaces[6]};
1860
+ padding-left: ${({ theme }) => theme.spaces[0]};
1861
+ padding-right: ${({ theme }) => theme.spaces[0]};
1862
+ padding-top: ${({ theme }) => theme.spaces[1]};
1863
+ padding-bottom: ${({ theme }) => theme.spaces[1]};
1499
1864
  visibility: hidden;
1500
1865
  cursor: grab;
1501
1866
  opacity: inherit;
1502
1867
  margin-top: ${(props) => props.$dragHandleTopMargin ?? 0};
1503
1868
 
1504
1869
  &:hover {
1505
- background: ${({ theme }) => theme.colors.neutral200};
1870
+ background: ${({ theme }) => theme.colors.neutral100};
1506
1871
  }
1507
1872
  &:active {
1508
1873
  cursor: grabbing;
1874
+ background: ${({ theme }) => theme.colors.neutral150};
1509
1875
  }
1510
1876
  &[aria-disabled='true'] {
1511
- cursor: not-allowed;
1512
- background: transparent;
1877
+ visibility: hidden;
1513
1878
  }
1514
1879
  svg {
1515
- height: auto;
1516
- width: ${({ theme }) => theme.spaces[3]};
1880
+ min-width: ${({ theme }) => theme.spaces[3]};
1517
1881
 
1518
1882
  path {
1519
- fill: ${({ theme }) => theme.colors.neutral700};
1883
+ fill: ${({ theme }) => theme.colors.neutral500};
1520
1884
  }
1521
1885
  }
1522
1886
  `;
@@ -1561,8 +1925,7 @@ const DragAndDropElement = ({
1561
1925
  displayedValue: children
1562
1926
  },
1563
1927
  onDropItem(currentIndex, newIndex) {
1564
- if (newIndex)
1565
- handleMoveBlock(newIndex, currentIndex);
1928
+ if (newIndex) handleMoveBlock(newIndex, currentIndex);
1566
1929
  }
1567
1930
  });
1568
1931
  const composedBoxRefs = designSystem.useComposedRefs(blockRef, dropRef);
@@ -1618,6 +1981,7 @@ const DragAndDropElement = ({
1618
1981
  DragIconButton,
1619
1982
  {
1620
1983
  tag: "div",
1984
+ contentEditable: false,
1621
1985
  role: "button",
1622
1986
  tabIndex: 0,
1623
1987
  withTooltip: false,
@@ -1630,7 +1994,7 @@ const DragAndDropElement = ({
1630
1994
  disabled,
1631
1995
  draggable: true,
1632
1996
  $dragHandleTopMargin: dragHandleTopMargin,
1633
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "neutral600" })
1997
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "primary500" })
1634
1998
  }
1635
1999
  ),
1636
2000
  children
@@ -1667,7 +2031,7 @@ const baseRenderLeaf = (props, modifiers2) => {
1667
2031
  }
1668
2032
  return currentChildren;
1669
2033
  }, props.children);
1670
- return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props.attributes, children: wrappedChildren });
2034
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { ...props.attributes, className: props.leaf.className, children: wrappedChildren });
1671
2035
  };
1672
2036
  const baseRenderElement = ({
1673
2037
  props,
@@ -1705,8 +2069,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
1705
2069
  [modifiers2]
1706
2070
  );
1707
2071
  const handleMoveBlocks = (editor2, event) => {
1708
- if (!editor2.selection)
1709
- return;
2072
+ if (!editor2.selection) return;
1710
2073
  const start = slate.Range.start(editor2.selection);
1711
2074
  const currentIndex = [start.path[0]];
1712
2075
  let newIndexPosition = 0;
@@ -1843,8 +2206,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
1843
2206
  }
1844
2207
  };
1845
2208
  const handleScrollSelectionIntoView = () => {
1846
- if (!editor.selection)
1847
- return;
2209
+ if (!editor.selection) return;
1848
2210
  const domRange = slateReact.ReactEditor.toDOMRange(editor, editor.selection);
1849
2211
  const domRect = domRange.getBoundingClientRect();
1850
2212
  const blocksInput = blocksRef.current;
@@ -1871,7 +2233,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
1871
2233
  background: "neutral0",
1872
2234
  color: "neutral800",
1873
2235
  lineHeight: 6,
1874
- paddingRight: 4,
2236
+ paddingRight: 7,
1875
2237
  paddingTop: 6,
1876
2238
  paddingBottom: 3,
1877
2239
  children: [
@@ -1882,6 +2244,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
1882
2244
  readOnly: disabled,
1883
2245
  placeholder,
1884
2246
  isExpandedMode,
2247
+ decorate: decorateCode,
1885
2248
  renderElement,
1886
2249
  renderLeaf,
1887
2250
  onKeyDown: handleKeyDown,
@@ -1954,7 +2317,7 @@ const EditorLayout$1 = ({
1954
2317
  /* @__PURE__ */ jsxRuntime.jsx(
1955
2318
  CollapseIconButton,
1956
2319
  {
1957
- "aria-label": formatMessage({
2320
+ label: formatMessage({
1958
2321
  id: index.getTranslation("components.Blocks.collapse"),
1959
2322
  defaultMessage: "Collapse"
1960
2323
  }),
@@ -2038,8 +2401,7 @@ const InlineCode = styledComponents.styled.code`
2038
2401
  `;
2039
2402
  const baseCheckIsActive = (editor, name2) => {
2040
2403
  const marks = slate.Editor.marks(editor);
2041
- if (!marks)
2042
- return false;
2404
+ if (!marks) return false;
2043
2405
  return Boolean(marks[name2]);
2044
2406
  };
2045
2407
  const baseHandleToggle = (editor, name2) => {
@@ -2205,6 +2567,7 @@ const ExpandIconButton = styledComponents.styled(designSystem.IconButton)`
2205
2567
  position: absolute;
2206
2568
  bottom: 1.2rem;
2207
2569
  right: 1.2rem;
2570
+ box-shadow: ${({ theme }) => theme.shadows.filterShadow};
2208
2571
  `;
2209
2572
  function useResetKey(value) {
2210
2573
  const slateUpdatesCount = React__namespace.useRef(0);
@@ -2293,7 +2656,7 @@ const BlocksEditor = React__namespace.forwardRef(
2293
2656
  !isExpandedMode && /* @__PURE__ */ jsxRuntime.jsx(
2294
2657
  ExpandIconButton,
2295
2658
  {
2296
- "aria-label": formatMessage({
2659
+ label: formatMessage({
2297
2660
  id: index.getTranslation("components.Blocks.expand"),
2298
2661
  defaultMessage: "Expand"
2299
2662
  }),
@@ -2359,47 +2722,44 @@ const createDefaultForm = (contentType, components = {}) => {
2359
2722
  const Initializer = ({ disabled, name: name2, onClick }) => {
2360
2723
  const { formatMessage } = reactIntl.useIntl();
2361
2724
  const field = strapiAdmin.useField(name2);
2362
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2363
- /* @__PURE__ */ jsxRuntime.jsx(
2364
- designSystem.Box,
2365
- {
2366
- tag: "button",
2367
- background: "neutral100",
2368
- borderColor: field.error ? "danger600" : "neutral200",
2369
- hasRadius: true,
2370
- disabled,
2371
- onClick,
2372
- paddingTop: 9,
2373
- paddingBottom: 9,
2374
- type: "button",
2375
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
2376
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(CircleIcon, {}) }),
2377
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2378
- id: index.getTranslation("components.empty-repeatable"),
2379
- defaultMessage: "No entry yet. Click on the button below to add one."
2380
- }) }) })
2381
- ] })
2382
- }
2383
- ),
2384
- field.error && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", variant: "pi", children: field.error })
2385
- ] });
2725
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
2726
+ designSystem.Box,
2727
+ {
2728
+ tag: "button",
2729
+ background: disabled ? "neutral150" : "neutral100",
2730
+ borderColor: field.error ? "danger600" : "neutral200",
2731
+ hasRadius: true,
2732
+ disabled,
2733
+ onClick,
2734
+ paddingTop: 9,
2735
+ paddingBottom: 9,
2736
+ type: "button",
2737
+ style: { cursor: disabled ? "not-allowed" : "pointer" },
2738
+ children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
2739
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
2740
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
2741
+ designSystem.Typography,
2742
+ {
2743
+ textColor: disabled ? "neutral600" : "primary600",
2744
+ variant: "pi",
2745
+ fontWeight: "bold",
2746
+ children: formatMessage({
2747
+ id: index.getTranslation("components.empty-repeatable"),
2748
+ defaultMessage: "No entry yet. Click to add one."
2749
+ })
2750
+ }
2751
+ ) })
2752
+ ] })
2753
+ }
2754
+ ) });
2386
2755
  };
2387
- const CircleIcon = styledComponents.styled(Icons.PlusCircle)`
2388
- width: 2.4rem;
2389
- height: 2.4rem;
2390
- > circle {
2391
- fill: ${({ theme }) => theme.colors.primary200};
2392
- }
2393
- > path {
2394
- fill: ${({ theme }) => theme.colors.primary600};
2395
- }
2396
- `;
2397
2756
  const NonRepeatableComponent = ({
2398
2757
  attribute,
2399
2758
  name: name2,
2400
2759
  children,
2401
2760
  layout
2402
2761
  }) => {
2762
+ const { formatMessage } = reactIntl.useIntl();
2403
2763
  const { value } = strapiAdmin.useField(name2);
2404
2764
  const level = Relations.useComponent("NonRepeatableComponent", (state) => state.level);
2405
2765
  const isNested = level > 0;
@@ -2416,7 +2776,22 @@ const NonRepeatableComponent = ({
2416
2776
  children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index2) => {
2417
2777
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2418
2778
  const completeFieldName = `${name2}.${field.name}`;
2419
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2779
+ const translatedLabel = formatMessage({
2780
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2781
+ defaultMessage: field.label
2782
+ });
2783
+ return /* @__PURE__ */ jsxRuntime.jsx(
2784
+ designSystem.Grid.Item,
2785
+ {
2786
+ col: size,
2787
+ s: 12,
2788
+ xs: 12,
2789
+ direction: "column",
2790
+ alignItems: "stretch",
2791
+ children: children({ ...field, label: translatedLabel, name: completeFieldName })
2792
+ },
2793
+ completeFieldName
2794
+ );
2420
2795
  }) }, index2);
2421
2796
  }) })
2422
2797
  }
@@ -2435,13 +2810,34 @@ const RepeatableComponent = ({
2435
2810
  const { search: searchString } = reactRouterDom.useLocation();
2436
2811
  const search = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
2437
2812
  const { components } = index.useDoc();
2438
- const { value = [], error } = strapiAdmin.useField(name2);
2813
+ const {
2814
+ value = [],
2815
+ error,
2816
+ rawError
2817
+ } = strapiAdmin.useField(name2);
2439
2818
  const addFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.addFieldRow);
2440
2819
  const moveFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.moveFieldRow);
2441
2820
  const removeFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.removeFieldRow);
2442
2821
  const { max = Infinity } = attribute;
2443
2822
  const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
2444
2823
  const [liveText, setLiveText] = React__namespace.useState("");
2824
+ React__namespace.useEffect(() => {
2825
+ const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
2826
+ const hasNestedValue = value && Array.isArray(value) && value.length > 0;
2827
+ if (hasNestedErrors && hasNestedValue) {
2828
+ const errorOpenItems = rawError.map((_, idx) => {
2829
+ return value[idx] ? value[idx].__temp_key__ : null;
2830
+ }).filter((value2) => !!value2);
2831
+ if (errorOpenItems && errorOpenItems.length > 0) {
2832
+ setCollapseToOpen((collapseToOpen2) => {
2833
+ if (!errorOpenItems.includes(collapseToOpen2)) {
2834
+ return errorOpenItems[0];
2835
+ }
2836
+ return collapseToOpen2;
2837
+ });
2838
+ }
2839
+ }
2840
+ }, [rawError, value]);
2445
2841
  const componentTmpKeyWithFocussedField = React__namespace.useMemo(() => {
2446
2842
  if (search.has("field")) {
2447
2843
  const fieldParam = search.get("field");
@@ -2456,7 +2852,7 @@ const RepeatableComponent = ({
2456
2852
  }
2457
2853
  return void 0;
2458
2854
  }, [search, name2, value]);
2459
- const prevValue = usePrev.usePrev(value);
2855
+ const prevValue = useDebounce.usePrev(value);
2460
2856
  React__namespace.useEffect(() => {
2461
2857
  if (prevValue && prevValue.length < value.length) {
2462
2858
  setCollapseToOpen(value[value.length - 1].__temp_key__);
@@ -2594,7 +2990,26 @@ const RepeatableComponent = ({
2594
2990
  children: layout.map((row, index22) => {
2595
2991
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2596
2992
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2597
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2993
+ const translatedLabel = formatMessage({
2994
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2995
+ defaultMessage: field.label
2996
+ });
2997
+ return /* @__PURE__ */ jsxRuntime.jsx(
2998
+ designSystem.Grid.Item,
2999
+ {
3000
+ col: size,
3001
+ s: 12,
3002
+ xs: 12,
3003
+ direction: "column",
3004
+ alignItems: "stretch",
3005
+ children: children({
3006
+ ...field,
3007
+ label: translatedLabel,
3008
+ name: completeFieldName
3009
+ })
3010
+ },
3011
+ completeFieldName
3012
+ );
2598
3013
  }) }, index22);
2599
3014
  })
2600
3015
  }
@@ -2689,7 +3104,7 @@ const Component = ({
2689
3104
  /* @__PURE__ */ jsxRuntime.jsx(
2690
3105
  designSystem.IconButton,
2691
3106
  {
2692
- borderWidth: 0,
3107
+ variant: "ghost",
2693
3108
  onClick: onDeleteComponent,
2694
3109
  label: formatMessage({
2695
3110
  id: index.getTranslation("containers.Edit.delete"),
@@ -2702,7 +3117,7 @@ const Component = ({
2702
3117
  designSystem.IconButton,
2703
3118
  {
2704
3119
  ref: composedAccordionRefs,
2705
- borderWidth: 0,
3120
+ variant: "ghost",
2706
3121
  onClick: (e) => e.stopPropagation(),
2707
3122
  "data-handler-id": handlerId,
2708
3123
  label: formatMessage({
@@ -2772,7 +3187,7 @@ const ComponentInput = ({
2772
3187
  id: index.getTranslation("components.reset-entry"),
2773
3188
  defaultMessage: "Reset Entry"
2774
3189
  }),
2775
- borderWidth: 0,
3190
+ variant: "ghost",
2776
3191
  onClick: () => {
2777
3192
  field.onChange(name2, null);
2778
3193
  },
@@ -2801,19 +3216,16 @@ const AddComponentButton = ({
2801
3216
  onClick,
2802
3217
  disabled: isDisabled,
2803
3218
  background: "neutral0",
2804
- paddingTop: 3,
2805
- paddingBottom: 3,
2806
- paddingLeft: 4,
2807
- paddingRight: 4,
2808
3219
  style: { cursor: isDisabled ? "not-allowed" : "pointer" },
3220
+ variant: "tertiary",
2809
3221
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
2810
3222
  /* @__PURE__ */ jsxRuntime.jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
2811
3223
  /* @__PURE__ */ jsxRuntime.jsx(
2812
- AddComponentTitle,
3224
+ designSystem.Typography,
2813
3225
  {
2814
3226
  variant: "pi",
2815
3227
  fontWeight: "bold",
2816
- textColor: hasError && !isOpen ? "danger600" : "neutral500",
3228
+ textColor: hasError && !isOpen ? "danger600" : "neutral600",
2817
3229
  children
2818
3230
  }
2819
3231
  )
@@ -2830,42 +3242,14 @@ const StyledAddIcon = styledComponents.styled(Icons.PlusCircle)`
2830
3242
  fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger200 : theme.colors.neutral150};
2831
3243
  }
2832
3244
  > path {
2833
- fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral600};
3245
+ fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral500};
2834
3246
  }
2835
3247
  `;
2836
- const AddComponentTitle = styledComponents.styled(designSystem.Typography)``;
2837
- const StyledButton = styledComponents.styled(designSystem.BaseButton)`
3248
+ const StyledButton = styledComponents.styled(designSystem.Button)`
3249
+ padding-left: ${({ theme }) => theme.spaces[3]};
2838
3250
  border-radius: 26px;
2839
- border-color: ${({ theme }) => theme.colors.neutral150};
2840
3251
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
2841
-
2842
- &:hover {
2843
- ${AddComponentTitle} {
2844
- color: ${({ theme }) => theme.colors.primary600};
2845
- }
2846
-
2847
- ${StyledAddIcon} {
2848
- > circle {
2849
- fill: ${({ theme }) => theme.colors.primary600};
2850
- }
2851
- > path {
2852
- fill: ${({ theme }) => theme.colors.neutral100};
2853
- }
2854
- }
2855
- }
2856
- &:active {
2857
- ${AddComponentTitle} {
2858
- color: ${({ theme }) => theme.colors.primary600};
2859
- }
2860
- ${StyledAddIcon} {
2861
- > circle {
2862
- fill: ${({ theme }) => theme.colors.primary600};
2863
- }
2864
- > path {
2865
- fill: ${({ theme }) => theme.colors.neutral100};
2866
- }
2867
- }
2868
- }
3252
+ height: 5rem;
2869
3253
  `;
2870
3254
  const ComponentCategory = ({
2871
3255
  category,
@@ -2980,18 +3364,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
2980
3364
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
2981
3365
  ] });
2982
3366
  };
2983
- function useDebounce(value, delay) {
2984
- const [debouncedValue, setDebouncedValue] = React.useState(value);
2985
- React.useEffect(() => {
2986
- const handler = setTimeout(() => {
2987
- setDebouncedValue(value);
2988
- }, delay);
2989
- return () => {
2990
- clearTimeout(handler);
2991
- };
2992
- }, [value, delay]);
2993
- return debouncedValue;
2994
- }
2995
3367
  const uidApi = index.contentManagerApi.injectEndpoints({
2996
3368
  endpoints: (builder) => ({
2997
3369
  getDefaultUID: builder.query({
@@ -3026,7 +3398,10 @@ const uidApi = index.contentManagerApi.injectEndpoints({
3026
3398
  config: {
3027
3399
  params
3028
3400
  }
3029
- })
3401
+ }),
3402
+ providesTags: (_res, _error, params) => [
3403
+ { type: "UidAvailability", id: params.contentTypeUID }
3404
+ ]
3030
3405
  })
3031
3406
  })
3032
3407
  });
@@ -3038,8 +3413,10 @@ const UIDInput = React__namespace.forwardRef(
3038
3413
  const allFormValues = strapiAdmin.useForm("InputUID", (form) => form.values);
3039
3414
  const [availability, setAvailability] = React__namespace.useState();
3040
3415
  const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
3416
+ const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
3041
3417
  const field = strapiAdmin.useField(name2);
3042
- const debouncedValue = useDebounce(field.value, 300);
3418
+ const debouncedValue = useDebounce.useDebounce(field.value, 300);
3419
+ const hasChanged = debouncedValue !== field.initialValue;
3043
3420
  const { toggleNotification } = strapiAdmin.useNotification();
3044
3421
  const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
3045
3422
  const { formatMessage } = reactIntl.useIntl();
@@ -3115,8 +3492,9 @@ const UIDInput = React__namespace.forwardRef(
3115
3492
  params
3116
3493
  },
3117
3494
  {
3495
+ // Don't check availability if the value is empty or wasn't changed
3118
3496
  skip: !Boolean(
3119
- debouncedValue !== field.initialValue && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3497
+ (hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3120
3498
  )
3121
3499
  }
3122
3500
  );
@@ -3145,6 +3523,7 @@ const UIDInput = React__namespace.forwardRef(
3145
3523
  const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
3146
3524
  const fieldRef = strapiAdmin.useFocusInputField(name2);
3147
3525
  const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
3526
+ const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
3148
3527
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name: name2, error: field.error, required, children: [
3149
3528
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
3150
3529
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3153,7 +3532,7 @@ const UIDInput = React__namespace.forwardRef(
3153
3532
  ref: composedRefs,
3154
3533
  disabled: props.disabled,
3155
3534
  endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { position: "relative", gap: 1, children: [
3156
- availability && !showRegenerate && /* @__PURE__ */ jsxRuntime.jsxs(
3535
+ shouldShowAvailability && /* @__PURE__ */ jsxRuntime.jsxs(
3157
3536
  TextValidation,
3158
3537
  {
3159
3538
  alignItems: "center",
@@ -3442,8 +3821,7 @@ const Wrapper = styledComponents.styled.div`
3442
3821
  `;
3443
3822
  var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
3444
3823
  function newlineAndIndentContinueMarkdownList(cm) {
3445
- if (cm.getOption("disableInput"))
3446
- return CodeMirror__default.default.Pass;
3824
+ if (cm.getOption("disableInput")) return CodeMirror__default.default.Pass;
3447
3825
  var ranges = cm.listSelections(), replacements = [];
3448
3826
  for (var i = 0; i < ranges.length; i++) {
3449
3827
  var pos = ranges[i].head;
@@ -3477,8 +3855,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
3477
3855
  var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
3478
3856
  var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
3479
3857
  replacements[i] = "\n" + indent + bullet + after;
3480
- if (numbered)
3481
- incrementRemainingMarkdownListNumbers(cm, pos);
3858
+ if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
3482
3859
  }
3483
3860
  }
3484
3861
  cm.replaceSelections(replacements);
@@ -3496,10 +3873,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3496
3873
  var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
3497
3874
  var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
3498
3875
  if (startIndent === nextIndent && !isNaN(nextNumber)) {
3499
- if (newNumber === nextNumber)
3500
- itemNumber = nextNumber + 1;
3501
- if (newNumber > nextNumber)
3502
- itemNumber = newNumber + 1;
3876
+ if (newNumber === nextNumber) itemNumber = nextNumber + 1;
3877
+ if (newNumber > nextNumber) itemNumber = newNumber + 1;
3503
3878
  cm.replaceRange(
3504
3879
  nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
3505
3880
  {
@@ -3512,10 +3887,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3512
3887
  }
3513
3888
  );
3514
3889
  } else {
3515
- if (startIndent.length > nextIndent.length)
3516
- return;
3517
- if (startIndent.length < nextIndent.length && lookAhead === 1)
3518
- return;
3890
+ if (startIndent.length > nextIndent.length) return;
3891
+ if (startIndent.length < nextIndent.length && lookAhead === 1) return;
3519
3892
  skipCount += 1;
3520
3893
  }
3521
3894
  }
@@ -3987,7 +4360,7 @@ const EditorLayout = ({
3987
4360
  justifyContent: "flex-end",
3988
4361
  shrink: 0,
3989
4362
  width: "100%",
3990
- children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, children: [
4363
+ children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
3991
4364
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
3992
4365
  id: "components.Wysiwyg.collapse",
3993
4366
  defaultMessage: "Collapse"
@@ -4005,12 +4378,14 @@ const EditorLayout = ({
4005
4378
  ) }) });
4006
4379
  }
4007
4380
  return /* @__PURE__ */ jsxRuntime.jsx(
4008
- designSystem.Box,
4381
+ designSystem.Flex,
4009
4382
  {
4010
4383
  borderColor: error ? "danger600" : "neutral200",
4011
4384
  borderStyle: "solid",
4012
4385
  borderWidth: "1px",
4013
4386
  hasRadius: true,
4387
+ direction: "column",
4388
+ alignItems: "stretch",
4014
4389
  children
4015
4390
  }
4016
4391
  );
@@ -4021,11 +4396,19 @@ const ExpandWrapper = styledComponents.styled(designSystem.Flex)`
4021
4396
  const BoxWithBorder = styledComponents.styled(designSystem.Box)`
4022
4397
  border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
4023
4398
  `;
4024
- const ExpandButton$1 = styledComponents.styled(designSystem.BaseButton)`
4399
+ const ExpandButton$1 = styledComponents.styled(designSystem.Button)`
4025
4400
  background-color: transparent;
4026
4401
  border: none;
4027
4402
  align-items: center;
4028
4403
 
4404
+ & > span {
4405
+ display: flex;
4406
+ justify-content: space-between;
4407
+ align-items: center;
4408
+ width: 100%;
4409
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4410
+ }
4411
+
4029
4412
  svg {
4030
4413
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4031
4414
 
@@ -4292,40 +4675,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4292
4675
  insertWithoutTextToEdit(editor, markdownType, line, contentLength);
4293
4676
  }
4294
4677
  };
4295
- const CustomIconButton = styledComponents.styled(designSystem.IconButton)`
4296
- padding: ${({ theme }) => theme.spaces[2]};
4297
-
4298
- svg {
4299
- width: 1.8rem;
4300
- height: 1.8rem;
4301
- }
4302
- `;
4303
- const CustomLinkIconButton = styledComponents.styled(CustomIconButton)`
4304
- svg {
4305
- width: 0.8rem;
4306
- height: 0.8rem;
4307
- }
4308
- `;
4309
4678
  const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
4310
4679
  margin-left: ${({ theme }) => theme.spaces[4]};
4311
4680
  `;
4312
4681
  const MoreButton = styledComponents.styled(designSystem.IconButton)`
4313
4682
  margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
4314
- padding: ${({ theme }) => theme.spaces[2]};
4315
-
4316
- svg {
4317
- width: 1.8rem;
4318
- height: 1.8rem;
4319
- }
4320
4683
  `;
4321
4684
  const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
4322
4685
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
4323
4686
  `;
4324
- const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
4687
+ const ExpandButton = styledComponents.styled(designSystem.Button)`
4325
4688
  background-color: transparent;
4326
4689
  border: none;
4327
4690
  align-items: center;
4328
4691
 
4692
+ & > span {
4693
+ display: flex;
4694
+ justify-content: space-between;
4695
+ align-items: center;
4696
+ width: 100%;
4697
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4698
+ }
4699
+
4329
4700
  svg {
4330
4701
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4331
4702
  path {
@@ -4337,8 +4708,8 @@ const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
4337
4708
  `;
4338
4709
  const WysiwygFooter = ({ onToggleExpand }) => {
4339
4710
  const { formatMessage } = reactIntl.useIntl();
4340
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, children: [
4341
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
4711
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, variant: "tertiary", size: "M", children: [
4712
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: formatMessage({
4342
4713
  id: "components.WysiwygBottomControls.fullscreen",
4343
4714
  defaultMessage: "Expand"
4344
4715
  }) }),
@@ -4374,18 +4745,27 @@ const WysiwygNav = ({
4374
4745
  borderRadius: `0.4rem 0.4rem 0 0`,
4375
4746
  children: [
4376
4747
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
4377
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.SingleSelect, { disabled: true, placeholder: selectPlaceholder, "aria-label": selectPlaceholder, children: [
4378
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4379
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
4380
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
4381
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
4382
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
4383
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
4384
- ] }) }),
4748
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
4749
+ designSystem.SingleSelect,
4750
+ {
4751
+ disabled: true,
4752
+ placeholder: selectPlaceholder,
4753
+ "aria-label": selectPlaceholder,
4754
+ size: "S",
4755
+ children: [
4756
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4757
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
4758
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
4759
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
4760
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
4761
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
4762
+ ]
4763
+ }
4764
+ ) }),
4385
4765
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4386
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4387
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
4388
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
4766
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4767
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
4768
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
4389
4769
  ] }),
4390
4770
  /* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
4391
4771
  ] }),
@@ -4412,6 +4792,7 @@ const WysiwygNav = ({
4412
4792
  placeholder: selectPlaceholder,
4413
4793
  "aria-label": selectPlaceholder,
4414
4794
  onChange: (value) => onActionClick(value, editorRef),
4795
+ size: "S",
4415
4796
  children: [
4416
4797
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4417
4798
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
@@ -4423,17 +4804,9 @@ const WysiwygNav = ({
4423
4804
  }
4424
4805
  ) }),
4425
4806
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4807
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4426
4808
  /* @__PURE__ */ jsxRuntime.jsx(
4427
- CustomIconButton,
4428
- {
4429
- onClick: () => onActionClick("Bold", editorRef),
4430
- label: "Bold",
4431
- name: "Bold",
4432
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {})
4433
- }
4434
- ),
4435
- /* @__PURE__ */ jsxRuntime.jsx(
4436
- CustomIconButton,
4809
+ designSystem.IconButton,
4437
4810
  {
4438
4811
  onClick: () => onActionClick("Italic", editorRef),
4439
4812
  label: "Italic",
@@ -4442,7 +4815,7 @@ const WysiwygNav = ({
4442
4815
  }
4443
4816
  ),
4444
4817
  /* @__PURE__ */ jsxRuntime.jsx(
4445
- CustomIconButton,
4818
+ designSystem.IconButton,
4446
4819
  {
4447
4820
  onClick: () => onActionClick("Underline", editorRef),
4448
4821
  label: "Underline",
@@ -4456,7 +4829,7 @@ const WysiwygNav = ({
4456
4829
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
4457
4830
  /* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
4458
4831
  /* @__PURE__ */ jsxRuntime.jsx(
4459
- CustomIconButton,
4832
+ designSystem.IconButton,
4460
4833
  {
4461
4834
  onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4462
4835
  label: "Strikethrough",
@@ -4465,7 +4838,7 @@ const WysiwygNav = ({
4465
4838
  }
4466
4839
  ),
4467
4840
  /* @__PURE__ */ jsxRuntime.jsx(
4468
- CustomIconButton,
4841
+ designSystem.IconButton,
4469
4842
  {
4470
4843
  onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4471
4844
  label: "BulletList",
@@ -4474,7 +4847,7 @@ const WysiwygNav = ({
4474
4847
  }
4475
4848
  ),
4476
4849
  /* @__PURE__ */ jsxRuntime.jsx(
4477
- CustomIconButton,
4850
+ designSystem.IconButton,
4478
4851
  {
4479
4852
  onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4480
4853
  label: "NumberList",
@@ -4485,7 +4858,7 @@ const WysiwygNav = ({
4485
4858
  ] }),
4486
4859
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
4487
4860
  /* @__PURE__ */ jsxRuntime.jsx(
4488
- CustomIconButton,
4861
+ designSystem.IconButton,
4489
4862
  {
4490
4863
  onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4491
4864
  label: "Code",
@@ -4494,7 +4867,7 @@ const WysiwygNav = ({
4494
4867
  }
4495
4868
  ),
4496
4869
  /* @__PURE__ */ jsxRuntime.jsx(
4497
- CustomIconButton,
4870
+ designSystem.IconButton,
4498
4871
  {
4499
4872
  onClick: () => {
4500
4873
  handleTogglePopover();
@@ -4506,7 +4879,7 @@ const WysiwygNav = ({
4506
4879
  }
4507
4880
  ),
4508
4881
  /* @__PURE__ */ jsxRuntime.jsx(
4509
- CustomLinkIconButton,
4882
+ designSystem.IconButton,
4510
4883
  {
4511
4884
  onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4512
4885
  label: "Link",
@@ -4515,7 +4888,7 @@ const WysiwygNav = ({
4515
4888
  }
4516
4889
  ),
4517
4890
  /* @__PURE__ */ jsxRuntime.jsx(
4518
- CustomIconButton,
4891
+ designSystem.IconButton,
4519
4892
  {
4520
4893
  onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4521
4894
  label: "Quote",
@@ -4593,7 +4966,7 @@ const Wysiwyg = React__namespace.forwardRef(
4593
4966
  const handleSelectAssets = (files) => {
4594
4967
  const formattedFiles = files.map((f) => ({
4595
4968
  alt: f.alternativeText || f.name,
4596
- url: usePrev.prefixFileUrlWithBackendUrl(f.url),
4969
+ url: useDebounce.prefixFileUrlWithBackendUrl(f.url),
4597
4970
  mime: f.mime
4598
4971
  }));
4599
4972
  insertFile(editorRef, formattedFiles);
@@ -4652,15 +5025,19 @@ const Wysiwyg = React__namespace.forwardRef(
4652
5025
  );
4653
5026
  const MemoizedWysiwyg = React__namespace.memo(Wysiwyg);
4654
5027
  const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4655
- const { id } = index.useDoc();
5028
+ const { id, document: document2, collectionType } = index.useDoc();
4656
5029
  const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
4657
5030
  const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
4658
5031
  const canCreateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
4659
5032
  const canReadFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
4660
5033
  const canUpdateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
4661
5034
  const canUserAction = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
4662
- const editableFields = id ? canUpdateFields : canCreateFields;
4663
- const readableFields = id ? canReadFields : canCreateFields;
5035
+ let idToCheck = id;
5036
+ if (collectionType === index.SINGLE_TYPES) {
5037
+ idToCheck = document2?.documentId;
5038
+ }
5039
+ const editableFields = idToCheck ? canUpdateFields : canCreateFields;
5040
+ const readableFields = idToCheck ? canReadFields : canCreateFields;
4664
5041
  const canUserReadField = canUserAction(props.name, readableFields, props.type);
4665
5042
  const canUserEditField = canUserAction(props.name, editableFields, props.type);
4666
5043
  const fields = strapiAdmin.useStrapiApp("InputRenderer", (app) => app.fields);
@@ -4671,6 +5048,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4671
5048
  const {
4672
5049
  edit: { components }
4673
5050
  } = index.useDocLayout();
5051
+ const field = strapiAdmin.useField(props.name);
4674
5052
  if (!visible) {
4675
5053
  return null;
4676
5054
  }
@@ -4681,7 +5059,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4681
5059
  if (attributeHasCustomFieldProperty(props.attribute)) {
4682
5060
  const CustomInput = lazyComponentStore[props.attribute.customField];
4683
5061
  if (CustomInput) {
4684
- return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
5062
+ return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
4685
5063
  }
4686
5064
  return /* @__PURE__ */ jsxRuntime.jsx(
4687
5065
  strapiAdmin.InputRenderer,
@@ -4751,7 +5129,9 @@ const useFieldHint = (hint = void 0, attribute) => {
4751
5129
  if (!maximum && !minimum) {
4752
5130
  return hint;
4753
5131
  }
4754
- const units = !["biginteger", "integer", "number"].includes(attribute.type) ? formatMessage(
5132
+ const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
5133
+ attribute.type
5134
+ ) ? formatMessage(
4755
5135
  {
4756
5136
  id: "content-manager.form.Input.hint.character.unit",
4757
5137
  defaultMessage: "{maxValue, plural, one { character} other { characters}}"
@@ -4803,7 +5183,8 @@ const DynamicComponent = ({
4803
5183
  onDropItem,
4804
5184
  onCancel,
4805
5185
  dynamicComponentsByCategory = {},
4806
- onAddComponent
5186
+ onAddComponent,
5187
+ children
4807
5188
  }) => {
4808
5189
  const { formatMessage } = reactIntl.useIntl();
4809
5190
  const formValues = strapiAdmin.useForm("DynamicComponent", (state) => state.values);
@@ -4840,12 +5221,20 @@ const DynamicComponent = ({
4840
5221
  React__namespace.useEffect(() => {
4841
5222
  dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
4842
5223
  }, [dragPreviewRef, index$1]);
5224
+ const accordionValue = React__namespace.useId();
5225
+ const { value = [], rawError } = strapiAdmin.useField(`${name2}.${index$1}`);
5226
+ const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
5227
+ React__namespace.useEffect(() => {
5228
+ if (rawError && value) {
5229
+ setCollapseToOpen(accordionValue);
5230
+ }
5231
+ }, [rawError, value, accordionValue]);
4843
5232
  const composedBoxRefs = designSystem.useComposedRefs(boxRef, dropRef);
4844
5233
  const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
4845
5234
  /* @__PURE__ */ jsxRuntime.jsx(
4846
5235
  designSystem.IconButton,
4847
5236
  {
4848
- borderWidth: 0,
5237
+ variant: "ghost",
4849
5238
  label: formatMessage(
4850
5239
  {
4851
5240
  id: index.getTranslation("components.DynamicZone.delete-label"),
@@ -4860,7 +5249,7 @@ const DynamicComponent = ({
4860
5249
  /* @__PURE__ */ jsxRuntime.jsx(
4861
5250
  designSystem.IconButton,
4862
5251
  {
4863
- borderWidth: 0,
5252
+ variant: "ghost",
4864
5253
  onClick: (e) => e.stopPropagation(),
4865
5254
  "data-handler-id": handlerId,
4866
5255
  ref: dragRef,
@@ -4905,10 +5294,9 @@ const DynamicComponent = ({
4905
5294
  ] })
4906
5295
  ] });
4907
5296
  const accordionTitle = title ? `${displayName} ${title}` : displayName;
4908
- const accordionValue = React__namespace.useId();
4909
5297
  return /* @__PURE__ */ jsxRuntime.jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
4910
5298
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Rectangle, { background: "neutral200" }) }),
4911
- /* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
5299
+ /* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { value: collapseToOpen, onValueChange: setCollapseToOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
4912
5300
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
4913
5301
  /* @__PURE__ */ jsxRuntime.jsx(
4914
5302
  designSystem.Accordion.Trigger,
@@ -4919,10 +5307,39 @@ const DynamicComponent = ({
4919
5307
  ),
4920
5308
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: accordionActions })
4921
5309
  ] }),
4922
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
4923
- const fieldName = `${name2}.${index$1}.${field.name}`;
4924
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
4925
- }) }, rowInd)) }) }) })
5310
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsxRuntime.jsx(
5311
+ designSystem.Grid.Item,
5312
+ {
5313
+ col: 12,
5314
+ s: 12,
5315
+ xs: 12,
5316
+ direction: "column",
5317
+ alignItems: "stretch",
5318
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5319
+ const fieldName = `${name2}.${index$1}.${field.name}`;
5320
+ const fieldWithTranslatedLabel = {
5321
+ ...field,
5322
+ label: formatMessage({
5323
+ id: `content-manager.components.${componentUid}.${field.name}`,
5324
+ defaultMessage: field.label
5325
+ })
5326
+ };
5327
+ return /* @__PURE__ */ jsxRuntime.jsx(
5328
+ designSystem.Grid.Item,
5329
+ {
5330
+ col: size,
5331
+ s: 12,
5332
+ xs: 12,
5333
+ direction: "column",
5334
+ alignItems: "stretch",
5335
+ children: children ? children({ ...fieldWithTranslatedLabel, name: fieldName }) : /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
5336
+ },
5337
+ fieldName
5338
+ );
5339
+ }) })
5340
+ },
5341
+ rowInd
5342
+ )) }) }) }) })
4926
5343
  ] }) }) })
4927
5344
  ] });
4928
5345
  };
@@ -5001,7 +5418,8 @@ const DynamicZone = ({
5001
5418
  label,
5002
5419
  labelAction,
5003
5420
  name: name2,
5004
- required = false
5421
+ required = false,
5422
+ children
5005
5423
  }) => {
5006
5424
  const { max = Infinity, min = -Infinity } = attribute ?? {};
5007
5425
  const [addComponentIsOpen, setAddComponentIsOpen] = React__namespace.useState(false);
@@ -5114,7 +5532,7 @@ const DynamicZone = ({
5114
5532
  const handleRemoveComponent = (name22, currentIndex) => () => {
5115
5533
  removeFieldRow(name22, currentIndex);
5116
5534
  };
5117
- const hasError = error !== void 0 || dynamicDisplayedComponentsLength < min || dynamicDisplayedComponentsLength > max;
5535
+ const hasError = error !== void 0;
5118
5536
  const renderButtonLabel = () => {
5119
5537
  if (addComponentIsOpen) {
5120
5538
  return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
@@ -5187,7 +5605,8 @@ const DynamicZone = ({
5187
5605
  onDropItem: handleDropItem,
5188
5606
  onGrabItem: handleGrabItem,
5189
5607
  onAddComponent: handleAddComponent,
5190
- dynamicComponentsByCategory
5608
+ dynamicComponentsByCategory,
5609
+ children
5191
5610
  }
5192
5611
  )
5193
5612
  },
@@ -5228,4 +5647,4 @@ exports.transformDocument = transformDocument;
5228
5647
  exports.useDynamicZone = useDynamicZone;
5229
5648
  exports.useFieldHint = useFieldHint;
5230
5649
  exports.useLazyComponents = useLazyComponents;
5231
- //# sourceMappingURL=Field-BG1xu38N.js.map
5650
+ //# sourceMappingURL=Field-DPIsQRre.js.map