@strapi/content-manager 0.0.0-experimental.745741d19e90275ca6f7c928ca19f9bb0fd9d933 → 0.0.0-experimental.76d3543c13df7ef0095963ae2c20b792f179eef0

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 (219) hide show
  1. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -1
  2. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-BvHtG7uH.js → ComponentConfigurationPage-CJPoOvy3.js} +5 -6
  4. package/dist/_chunks/{ComponentConfigurationPage-BvHtG7uH.js.map → ComponentConfigurationPage-CJPoOvy3.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-DHNM3YBz.mjs → ComponentConfigurationPage-CcRDqD0e.mjs} +4 -4
  6. package/dist/_chunks/{ComponentConfigurationPage-DHNM3YBz.mjs.map → ComponentConfigurationPage-CcRDqD0e.mjs.map} +1 -1
  7. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js → ComponentIcon-CRbtQEUV.js} +2 -3
  8. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js.map → ComponentIcon-CRbtQEUV.js.map} +1 -1
  9. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -1
  10. package/dist/_chunks/{EditConfigurationPage-Cp6HAEzN.mjs → EditConfigurationPage-C1ddZ_zf.mjs} +4 -4
  11. package/dist/_chunks/{EditConfigurationPage-Cp6HAEzN.mjs.map → EditConfigurationPage-C1ddZ_zf.mjs.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-DOmfCEMo.js → EditConfigurationPage-CF3lxOy2.js} +5 -6
  13. package/dist/_chunks/{EditConfigurationPage-DOmfCEMo.js.map → EditConfigurationPage-CF3lxOy2.js.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-BtkEx339.mjs → EditViewPage-BPFcUbqi.mjs} +63 -12
  15. package/dist/_chunks/EditViewPage-BPFcUbqi.mjs.map +1 -0
  16. package/dist/_chunks/{EditViewPage-BqNpC6hO.js → EditViewPage-CDyTC6aU.js} +63 -13
  17. package/dist/_chunks/EditViewPage-CDyTC6aU.js.map +1 -0
  18. package/dist/_chunks/{Field-lsPFnAmH.js → Field-DuxAW9q2.js} +409 -260
  19. package/dist/_chunks/Field-DuxAW9q2.js.map +1 -0
  20. package/dist/_chunks/{Field-R5NbffTB.mjs → Field-fBnTwgU4.mjs} +405 -256
  21. package/dist/_chunks/Field-fBnTwgU4.mjs.map +1 -0
  22. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
  23. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
  24. package/dist/_chunks/{Form-BHmXSfyy.mjs → Form-BGl7PhlZ.mjs} +37 -18
  25. package/dist/_chunks/Form-BGl7PhlZ.mjs.map +1 -0
  26. package/dist/_chunks/{Form-CcGboku8.js → Form-DSGh_zkz.js} +39 -21
  27. package/dist/_chunks/Form-DSGh_zkz.js.map +1 -0
  28. package/dist/_chunks/{History-ByUPL3T3.mjs → History-DTYB9CSB.mjs} +66 -113
  29. package/dist/_chunks/History-DTYB9CSB.mjs.map +1 -0
  30. package/dist/_chunks/{History-Bsud8jwh.js → History-DrDJv698.js} +65 -113
  31. package/dist/_chunks/History-DrDJv698.js.map +1 -0
  32. package/dist/_chunks/{ListConfigurationPage-Bm5HACXf.mjs → ListConfigurationPage-qWx8r4D_.mjs} +25 -12
  33. package/dist/_chunks/ListConfigurationPage-qWx8r4D_.mjs.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-DiT463qx.js → ListConfigurationPage-zurIlUZ7.js} +25 -13
  35. package/dist/_chunks/ListConfigurationPage-zurIlUZ7.js.map +1 -0
  36. package/dist/_chunks/{ListViewPage-CsrC9L_d.js → ListViewPage-DTM2uO_S.js} +109 -78
  37. package/dist/_chunks/ListViewPage-DTM2uO_S.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-JSyNAAYu.mjs → ListViewPage-GKpL5p8A.mjs} +106 -74
  39. package/dist/_chunks/ListViewPage-GKpL5p8A.mjs.map +1 -0
  40. package/dist/_chunks/{NoContentTypePage-CsrQUpBE.mjs → NoContentTypePage-B5Vc5Cal.mjs} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-CsrQUpBE.mjs.map → NoContentTypePage-B5Vc5Cal.mjs.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-Bsvng4II.js → NoContentTypePage-BuZlNroO.js} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-Bsvng4II.js.map → NoContentTypePage-BuZlNroO.js.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-DNmf_pj0.mjs → NoPermissionsPage-BAZlWgJ4.mjs} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-DNmf_pj0.mjs.map → NoPermissionsPage-BAZlWgJ4.mjs.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-CdHNJtEf.js → NoPermissionsPage-DLzkS4Hy.js} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-CdHNJtEf.js.map → NoPermissionsPage-DLzkS4Hy.js.map} +1 -1
  48. package/dist/_chunks/Preview-VOJ8RuQp.js +312 -0
  49. package/dist/_chunks/Preview-VOJ8RuQp.js.map +1 -0
  50. package/dist/_chunks/Preview-Zzjg2_K_.mjs +294 -0
  51. package/dist/_chunks/Preview-Zzjg2_K_.mjs.map +1 -0
  52. package/dist/_chunks/{Relations-u8-37jK0.mjs → Relations-BVdRfDkW.mjs} +76 -42
  53. package/dist/_chunks/Relations-BVdRfDkW.mjs.map +1 -0
  54. package/dist/_chunks/{Relations-CghaPv2D.js → Relations-Dsj0boFJ.js} +76 -43
  55. package/dist/_chunks/Relations-Dsj0boFJ.js.map +1 -0
  56. package/dist/_chunks/{en-fbKQxLGn.js → en-BzQmavmK.js} +37 -18
  57. package/dist/_chunks/{en-fbKQxLGn.js.map → en-BzQmavmK.js.map} +1 -1
  58. package/dist/_chunks/{en-Ux26r5pl.mjs → en-CSxLmrh1.mjs} +37 -18
  59. package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-CSxLmrh1.mjs.map} +1 -1
  60. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  61. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  62. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  63. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  64. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  65. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  66. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  67. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  68. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
  69. package/dist/_chunks/{index-CaE6NG4a.mjs → index-Bu_-B7ZA.mjs} +1263 -772
  70. package/dist/_chunks/index-Bu_-B7ZA.mjs.map +1 -0
  71. package/dist/_chunks/{index-BOZx6IMg.js → index-Ct-GZ0iV.js} +1246 -755
  72. package/dist/_chunks/index-Ct-GZ0iV.js.map +1 -0
  73. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  74. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  75. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  76. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  77. package/dist/_chunks/{layout-Ciz224q5.js → layout-CDBEgRsM.js} +24 -12
  78. package/dist/_chunks/layout-CDBEgRsM.js.map +1 -0
  79. package/dist/_chunks/{layout-Bx7svTbY.mjs → layout-COzAvgJh.mjs} +24 -11
  80. package/dist/_chunks/layout-COzAvgJh.mjs.map +1 -0
  81. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  82. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  83. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  84. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  85. package/dist/_chunks/{relations-CP8sB2YZ.js → relations-BjiF1Aad.js} +6 -7
  86. package/dist/_chunks/relations-BjiF1Aad.js.map +1 -0
  87. package/dist/_chunks/{relations-Cxc1cEv3.mjs → relations-BtmMFBpM.mjs} +6 -7
  88. package/dist/_chunks/relations-BtmMFBpM.mjs.map +1 -0
  89. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  90. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  91. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  92. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  93. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
  94. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
  95. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
  96. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
  97. package/dist/admin/index.js +3 -1
  98. package/dist/admin/index.js.map +1 -1
  99. package/dist/admin/index.mjs +6 -4
  100. package/dist/admin/src/content-manager.d.ts +3 -2
  101. package/dist/admin/src/exports.d.ts +2 -1
  102. package/dist/admin/src/history/index.d.ts +3 -0
  103. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  104. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  105. package/dist/admin/src/index.d.ts +1 -0
  106. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  107. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +2 -1
  108. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +3 -3
  109. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  110. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  111. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  112. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
  113. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  114. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  115. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
  116. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  117. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  118. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  119. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  120. package/dist/admin/src/preview/index.d.ts +4 -0
  121. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  122. package/dist/admin/src/preview/routes.d.ts +3 -0
  123. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  124. package/dist/admin/src/router.d.ts +1 -1
  125. package/dist/admin/src/services/api.d.ts +1 -1
  126. package/dist/admin/src/services/components.d.ts +2 -2
  127. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  128. package/dist/admin/src/services/documents.d.ts +19 -20
  129. package/dist/admin/src/services/init.d.ts +1 -1
  130. package/dist/admin/src/services/relations.d.ts +2 -2
  131. package/dist/admin/src/services/uid.d.ts +3 -3
  132. package/dist/admin/src/utils/validation.d.ts +4 -1
  133. package/dist/server/index.js +682 -360
  134. package/dist/server/index.js.map +1 -1
  135. package/dist/server/index.mjs +683 -360
  136. package/dist/server/index.mjs.map +1 -1
  137. package/dist/server/src/bootstrap.d.ts.map +1 -1
  138. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  139. package/dist/server/src/controllers/index.d.ts.map +1 -1
  140. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  141. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  142. package/dist/server/src/controllers/utils/metadata.d.ts +16 -1
  143. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  144. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  145. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  146. package/dist/server/src/history/services/history.d.ts.map +1 -1
  147. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  148. package/dist/server/src/history/services/utils.d.ts +4 -4
  149. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  150. package/dist/server/src/index.d.ts +7 -6
  151. package/dist/server/src/index.d.ts.map +1 -1
  152. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  153. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  154. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  155. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  156. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  157. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  158. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  159. package/dist/server/src/preview/index.d.ts +4 -0
  160. package/dist/server/src/preview/index.d.ts.map +1 -0
  161. package/dist/server/src/preview/routes/index.d.ts +8 -0
  162. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  163. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  164. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  165. package/dist/server/src/preview/services/index.d.ts +16 -0
  166. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  167. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  168. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  169. package/dist/server/src/preview/services/preview.d.ts +12 -0
  170. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  171. package/dist/server/src/preview/utils.d.ts +19 -0
  172. package/dist/server/src/preview/utils.d.ts.map +1 -0
  173. package/dist/server/src/register.d.ts.map +1 -1
  174. package/dist/server/src/routes/index.d.ts.map +1 -1
  175. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  176. package/dist/server/src/services/document-metadata.d.ts +12 -10
  177. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  178. package/dist/server/src/services/index.d.ts +7 -6
  179. package/dist/server/src/services/index.d.ts.map +1 -1
  180. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  181. package/dist/server/src/services/utils/populate.d.ts +2 -2
  182. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  183. package/dist/server/src/utils/index.d.ts +2 -0
  184. package/dist/server/src/utils/index.d.ts.map +1 -1
  185. package/dist/shared/contracts/collection-types.d.ts +3 -1
  186. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  187. package/dist/shared/contracts/index.d.ts +1 -0
  188. package/dist/shared/contracts/index.d.ts.map +1 -1
  189. package/dist/shared/contracts/preview.d.ts +27 -0
  190. package/dist/shared/contracts/preview.d.ts.map +1 -0
  191. package/dist/shared/index.js +4 -0
  192. package/dist/shared/index.js.map +1 -1
  193. package/dist/shared/index.mjs +4 -0
  194. package/dist/shared/index.mjs.map +1 -1
  195. package/package.json +17 -15
  196. package/dist/_chunks/EditViewPage-BqNpC6hO.js.map +0 -1
  197. package/dist/_chunks/EditViewPage-BtkEx339.mjs.map +0 -1
  198. package/dist/_chunks/Field-R5NbffTB.mjs.map +0 -1
  199. package/dist/_chunks/Field-lsPFnAmH.js.map +0 -1
  200. package/dist/_chunks/Form-BHmXSfyy.mjs.map +0 -1
  201. package/dist/_chunks/Form-CcGboku8.js.map +0 -1
  202. package/dist/_chunks/History-Bsud8jwh.js.map +0 -1
  203. package/dist/_chunks/History-ByUPL3T3.mjs.map +0 -1
  204. package/dist/_chunks/ListConfigurationPage-Bm5HACXf.mjs.map +0 -1
  205. package/dist/_chunks/ListConfigurationPage-DiT463qx.js.map +0 -1
  206. package/dist/_chunks/ListViewPage-CsrC9L_d.js.map +0 -1
  207. package/dist/_chunks/ListViewPage-JSyNAAYu.mjs.map +0 -1
  208. package/dist/_chunks/Relations-CghaPv2D.js.map +0 -1
  209. package/dist/_chunks/Relations-u8-37jK0.mjs.map +0 -1
  210. package/dist/_chunks/index-BOZx6IMg.js.map +0 -1
  211. package/dist/_chunks/index-CaE6NG4a.mjs.map +0 -1
  212. package/dist/_chunks/layout-Bx7svTbY.mjs.map +0 -1
  213. package/dist/_chunks/layout-Ciz224q5.js.map +0 -1
  214. package/dist/_chunks/relations-CP8sB2YZ.js.map +0 -1
  215. package/dist/_chunks/relations-Cxc1cEv3.mjs.map +0 -1
  216. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  217. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  218. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  219. package/strapi-server.js +0 -3
@@ -2,24 +2,75 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { useState, useEffect, useCallback, memo } from "react";
4
4
  import { useStrapiApp, createContext, useField, useNotification, useForm, useAPIErrorHandler, useQueryParams, useFocusInputField, InputRenderer as InputRenderer$1 } from "@strapi/admin/strapi-admin";
5
- import { Box, SingleSelect, SingleSelectOption, Typography, Flex, BaseLink, Button, Popover, Field, Tooltip, IconButton, useComposedRefs, Portal, FocusTrap, Divider, VisuallyHidden, Grid as Grid$1, Accordion, TextButton, BaseButton, TextInput, IconButtonGroup, Menu, MenuItem } from "@strapi/design-system";
5
+ import { Box, SingleSelect, SingleSelectOption, Typography, Flex, BaseLink, Button, Popover, Field, Tooltip, IconButton, useComposedRefs, Portal, FocusTrap, Divider, VisuallyHidden, Grid as Grid$1, Accordion, TextButton, TextInput, IconButtonGroup, Menu, MenuItem } from "@strapi/design-system";
6
6
  import pipe$1 from "lodash/fp/pipe";
7
7
  import { useIntl } from "react-intl";
8
- import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, d as buildValidParams, f as useDocumentRBAC, n as useDocLayout } from "./index-CaE6NG4a.mjs";
8
+ import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, n as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, S as SINGLE_TYPES, o as useDocLayout } from "./index-Bu_-B7ZA.mjs";
9
9
  import { generateNKeysBetween } from "fractional-indexing";
10
- import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-u8-37jK0.mjs";
11
- import { Code, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, Expand, PlusCircle, Plus, Trash, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, More } from "@strapi/icons";
10
+ import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-BVdRfDkW.mjs";
11
+ import { CodeBlock as CodeBlock$1, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, Code, Expand, PlusCircle, Plus, Trash, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, More } from "@strapi/icons";
12
12
  import { styled, css, keyframes } from "styled-components";
13
13
  import { C as ComponentIcon, a as COMPONENT_ICONS } from "./ComponentIcon-u4bIXTFY.mjs";
14
14
  import { getEmptyImage } from "react-dnd-html5-backend";
15
- import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DdHgKsqq.mjs";
16
- import { g as getIn } from "./objects-mKMAmfec.mjs";
15
+ import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DJ6jqvZN.mjs";
16
+ import { g as getIn } from "./objects-D6yBsdmx.mjs";
17
17
  import { Editor as Editor$1, Transforms, Node, Element, Range, Path, Point, createEditor } from "slate";
18
18
  import { withHistory } from "slate-history";
19
19
  import { useFocused, useSelected, ReactEditor, Editable, useSlate, Slate, withReact } from "slate-react";
20
- import { p as prefixFileUrlWithBackendUrl, u as usePrev } from "./usePrev-DH6iah0A.mjs";
20
+ import * as Prism from "prismjs";
21
+ import "prismjs/themes/prism-solarizedlight.css";
22
+ import "prismjs/components/prism-asmatmel";
23
+ import "prismjs/components/prism-bash";
24
+ import "prismjs/components/prism-basic";
25
+ import "prismjs/components/prism-c";
26
+ import "prismjs/components/prism-clojure";
27
+ import "prismjs/components/prism-cobol";
28
+ import "prismjs/components/prism-cpp";
29
+ import "prismjs/components/prism-csharp";
30
+ import "prismjs/components/prism-dart";
31
+ import "prismjs/components/prism-docker";
32
+ import "prismjs/components/prism-elixir";
33
+ import "prismjs/components/prism-erlang";
34
+ import "prismjs/components/prism-fortran";
35
+ import "prismjs/components/prism-fsharp";
36
+ import "prismjs/components/prism-go";
37
+ import "prismjs/components/prism-graphql";
38
+ import "prismjs/components/prism-groovy";
39
+ import "prismjs/components/prism-haskell";
40
+ import "prismjs/components/prism-haxe";
41
+ import "prismjs/components/prism-ini";
42
+ import "prismjs/components/prism-java";
43
+ import "prismjs/components/prism-javascript";
44
+ import "prismjs/components/prism-jsx";
45
+ import "prismjs/components/prism-json";
46
+ import "prismjs/components/prism-julia";
47
+ import "prismjs/components/prism-kotlin";
48
+ import "prismjs/components/prism-latex";
49
+ import "prismjs/components/prism-lua";
50
+ import "prismjs/components/prism-markdown";
51
+ import "prismjs/components/prism-matlab";
52
+ import "prismjs/components/prism-makefile";
53
+ import "prismjs/components/prism-objectivec";
54
+ import "prismjs/components/prism-perl";
55
+ import "prismjs/components/prism-php";
56
+ import "prismjs/components/prism-powershell";
57
+ import "prismjs/components/prism-python";
58
+ import "prismjs/components/prism-r";
59
+ import "prismjs/components/prism-ruby";
60
+ import "prismjs/components/prism-rust";
61
+ import "prismjs/components/prism-sas";
62
+ import "prismjs/components/prism-scala";
63
+ import "prismjs/components/prism-scheme";
64
+ import "prismjs/components/prism-sql";
65
+ import "prismjs/components/prism-stata";
66
+ import "prismjs/components/prism-swift";
67
+ import "prismjs/components/prism-typescript";
68
+ import "prismjs/components/prism-tsx";
69
+ import "prismjs/components/prism-vbnet";
70
+ import "prismjs/components/prism-yaml";
71
+ import { p as prefixFileUrlWithBackendUrl, u as usePrev, a as useDebounce } from "./useDebounce-DmuSJIF3.mjs";
21
72
  import * as Toolbar from "@radix-ui/react-toolbar";
22
- import { useLocation } from "react-router-dom";
73
+ import { useLocation, useMatch } from "react-router-dom";
23
74
  import CodeMirror from "codemirror5";
24
75
  import sanitizeHtml from "sanitize-html";
25
76
  import { getLanguage, highlight, highlightAuto } from "highlight.js";
@@ -163,7 +214,8 @@ const useLazyComponents = (componentUids = []) => {
163
214
  const codeLanguages = [
164
215
  {
165
216
  value: "asm",
166
- label: "Assembly"
217
+ label: "Assembly",
218
+ decorate: "asmatmel"
167
219
  },
168
220
  {
169
221
  value: "bash",
@@ -199,7 +251,8 @@ const codeLanguages = [
199
251
  },
200
252
  {
201
253
  value: "dockerfile",
202
- label: "Dockerfile"
254
+ label: "Dockerfile",
255
+ decorate: "docker"
203
256
  },
204
257
  {
205
258
  value: "elixir",
@@ -355,7 +408,8 @@ const codeLanguages = [
355
408
  },
356
409
  {
357
410
  value: "typescript",
358
- label: "TypeScript"
411
+ label: "TypeScript",
412
+ decorate: "ts"
359
413
  },
360
414
  {
361
415
  value: "tsx",
@@ -371,7 +425,8 @@ const codeLanguages = [
371
425
  },
372
426
  {
373
427
  value: "yaml",
374
- label: "YAML"
428
+ label: "YAML",
429
+ decorate: "yml"
375
430
  }
376
431
  ];
377
432
  const baseHandleConvert = (editor, attributesToSet) => {
@@ -437,6 +492,29 @@ const pressEnterTwiceToExit = (editor) => {
437
492
  });
438
493
  }
439
494
  };
495
+ const decorateCode = ([node, path]) => {
496
+ const ranges = [];
497
+ if (!Element.isElement(node) || node.type !== "code") return ranges;
498
+ const text = Node.string(node);
499
+ const language = codeLanguages.find((lang) => lang.value === node.language);
500
+ const decorateKey = language?.decorate ?? language?.value;
501
+ const selectedLanguage = Prism.languages[decorateKey || "plaintext"];
502
+ const tokens = Prism.tokenize(text, selectedLanguage);
503
+ let start = 0;
504
+ for (const token of tokens) {
505
+ const length = token.length;
506
+ const end = start + length;
507
+ if (typeof token !== "string") {
508
+ ranges.push({
509
+ anchor: { path, offset: start },
510
+ focus: { path, offset: end },
511
+ className: `token ${token.type}`
512
+ });
513
+ }
514
+ start = end;
515
+ }
516
+ return ranges;
517
+ };
440
518
  const CodeBlock = styled.pre`
441
519
  border-radius: ${({ theme }) => theme.borderRadius};
442
520
  background-color: ${({ theme }) => theme.colors.neutral100};
@@ -508,7 +586,7 @@ const CodeEditor = (props) => {
508
586
  const codeBlocks = {
509
587
  code: {
510
588
  renderElement: (props) => /* @__PURE__ */ jsx(CodeEditor, { ...props }),
511
- icon: Code,
589
+ icon: CodeBlock$1,
512
590
  label: {
513
591
  id: "components.Blocks.blocks.code",
514
592
  defaultMessage: "Code block"
@@ -521,8 +599,7 @@ const codeBlocks = {
521
599
  handleEnterKey(editor) {
522
600
  pressEnterTwiceToExit(editor);
523
601
  },
524
- snippets: ["```"],
525
- dragHandleTopMargin: "10px"
602
+ snippets: ["```"]
526
603
  }
527
604
  };
528
605
  const H1 = styled(Typography).attrs({ tag: "h1" })`
@@ -697,8 +774,7 @@ const ImageDialog = () => {
697
774
  const [isOpen, setIsOpen] = React.useState(true);
698
775
  const { editor } = useBlocksEditorContext("ImageDialog");
699
776
  const components = useStrapiApp("ImageDialog", (state) => state.components);
700
- if (!components || !isOpen)
701
- return null;
777
+ if (!components || !isOpen) return null;
702
778
  const MediaLibraryDialog = components["media-library"];
703
779
  const insertImages = (images) => {
704
780
  Transforms.unwrapNodes(editor, {
@@ -707,14 +783,12 @@ const ImageDialog = () => {
707
783
  });
708
784
  const nodeEntryBeingReplaced = Editor$1.above(editor, {
709
785
  match(node) {
710
- if (Editor$1.isEditor(node))
711
- return false;
786
+ if (Editor$1.isEditor(node)) return false;
712
787
  const isInlineNode = ["text", "link"].includes(node.type);
713
788
  return !isInlineNode;
714
789
  }
715
790
  });
716
- if (!nodeEntryBeingReplaced)
717
- return;
791
+ if (!nodeEntryBeingReplaced) return;
718
792
  const [, pathToInsert] = nodeEntryBeingReplaced;
719
793
  Transforms.removeNodes(editor);
720
794
  const nodesToInsert = images.map((image) => {
@@ -860,20 +934,8 @@ const LinkContent = React.forwardRef(
860
934
  const [linkText, setLinkText] = React.useState(elementText);
861
935
  const [linkUrl, setLinkUrl] = React.useState(link.url);
862
936
  const linkInputRef = React.useRef(null);
863
- const [showRemoveButton, setShowRemoveButton] = React.useState(false);
937
+ const isLastInsertedLink = editor.lastInsertedLinkPath ? !Path.equals(path, editor.lastInsertedLinkPath) : true;
864
938
  const [isSaveDisabled, setIsSaveDisabled] = React.useState(false);
865
- const handleOpenChange = (isOpen) => {
866
- if (isOpen) {
867
- setPopoverOpen(isOpen);
868
- setShowRemoveButton(isOpen);
869
- } else {
870
- setPopoverOpen(isOpen);
871
- if (link.url === "") {
872
- removeLink(editor);
873
- }
874
- ReactEditor.focus(editor);
875
- }
876
- };
877
939
  const onLinkChange = (e) => {
878
940
  setIsSaveDisabled(false);
879
941
  setLinkUrl(e.target.value);
@@ -894,15 +956,32 @@ const LinkContent = React.forwardRef(
894
956
  editLink(editor, { url: linkUrl, text: linkText });
895
957
  setPopoverOpen(false);
896
958
  editor.lastInsertedLinkPath = null;
959
+ ReactEditor.focus(editor);
960
+ };
961
+ const handleClose = () => {
962
+ if (link.url === "") {
963
+ removeLink(editor);
964
+ }
965
+ setPopoverOpen(false);
966
+ ReactEditor.focus(editor);
897
967
  };
898
968
  React.useEffect(() => {
899
- if (popoverOpen)
900
- linkInputRef.current?.focus();
969
+ if (popoverOpen) linkInputRef.current?.focus();
901
970
  }, [popoverOpen]);
902
971
  const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
903
- return /* @__PURE__ */ jsxs(Popover.Root, { onOpenChange: handleOpenChange, open: popoverOpen, children: [
904
- /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(StyledBaseLink, { ...attributes, ref: forwardedRef, href: link.url, color: "primary600", children }) }),
905
- /* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsxs(Flex, { padding: 4, tag: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
972
+ return /* @__PURE__ */ jsxs(Popover.Root, { open: popoverOpen, children: [
973
+ /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
974
+ StyledBaseLink,
975
+ {
976
+ ...attributes,
977
+ ref: forwardedRef,
978
+ href: link.url,
979
+ onClick: () => setPopoverOpen(true),
980
+ color: "primary600",
981
+ children
982
+ }
983
+ ) }),
984
+ /* @__PURE__ */ jsx(Popover.Content, { onPointerDownOutside: handleClose, children: /* @__PURE__ */ jsxs(Flex, { padding: 4, direction: "column", gap: 4, children: [
906
985
  /* @__PURE__ */ jsx(Field.Root, { width: "368px", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
907
986
  /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
908
987
  id: "components.Blocks.popover.text",
@@ -948,7 +1027,7 @@ const LinkContent = React.forwardRef(
948
1027
  {
949
1028
  variant: "danger-light",
950
1029
  onClick: () => removeLink(editor),
951
- $visible: showRemoveButton,
1030
+ $visible: isLastInsertedLink,
952
1031
  children: formatMessage({
953
1032
  id: "components.Blocks.popover.remove",
954
1033
  defaultMessage: "Remove"
@@ -956,12 +1035,12 @@ const LinkContent = React.forwardRef(
956
1035
  }
957
1036
  ),
958
1037
  /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
959
- /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: () => handleOpenChange(false), children: formatMessage({
960
- id: "components.Blocks.popover.cancel",
1038
+ /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
1039
+ id: "global.cancel",
961
1040
  defaultMessage: "Cancel"
962
1041
  }) }),
963
- /* @__PURE__ */ jsx(Button, { type: "submit", disabled: Boolean(inputNotDirty) || isSaveDisabled, children: formatMessage({
964
- id: "components.Blocks.popover.save",
1042
+ /* @__PURE__ */ jsx(Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
1043
+ id: "global.save",
965
1044
  defaultMessage: "Save"
966
1045
  }) })
967
1046
  ] })
@@ -1042,8 +1121,7 @@ const isText$1 = (node) => {
1042
1121
  return Node.isNode(node) && !Editor$1.isEditor(node) && node.type === "text";
1043
1122
  };
1044
1123
  const handleBackspaceKeyOnList = (editor, event) => {
1045
- if (!editor.selection)
1046
- return;
1124
+ if (!editor.selection) return;
1047
1125
  const [currentListItem, currentListItemPath] = Editor$1.parent(editor, editor.selection.anchor);
1048
1126
  const [currentList, currentListPath] = Editor$1.parent(editor, currentListItemPath);
1049
1127
  const isListEmpty = currentList.children.length === 1 && isText$1(currentListItem.children[0]) && currentListItem.children[0].text === "";
@@ -1152,8 +1230,7 @@ const handleEnterKeyOnList = (editor) => {
1152
1230
  };
1153
1231
  const handleConvertToList = (editor, format) => {
1154
1232
  const convertedPath = baseHandleConvert(editor, { type: "list-item" });
1155
- if (!convertedPath)
1156
- return;
1233
+ if (!convertedPath) return;
1157
1234
  Transforms.wrapNodes(editor, { type: "list", format, children: [] }, { at: convertedPath });
1158
1235
  };
1159
1236
  const handleTabOnList = (editor) => {
@@ -1165,8 +1242,7 @@ const handleTabOnList = (editor) => {
1165
1242
  }
1166
1243
  const [currentListItem, currentListItemPath] = currentListItemEntry;
1167
1244
  const [currentList] = Editor$1.parent(editor, currentListItemPath);
1168
- if (currentListItem === currentList.children[0])
1169
- return;
1245
+ if (currentListItem === currentList.children[0]) return;
1170
1246
  const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);
1171
1247
  const previousNode = currentList.children[currentListItemIndex - 1];
1172
1248
  if (previousNode.type === "list") {
@@ -1302,13 +1378,13 @@ const quoteBlocks = {
1302
1378
  handleEnterKey(editor) {
1303
1379
  pressEnterTwiceToExit(editor);
1304
1380
  },
1305
- snippets: [">"],
1306
- dragHandleTopMargin: "6px"
1381
+ snippets: [">"]
1307
1382
  }
1308
1383
  };
1309
1384
  const ToolbarWrapper = styled(Flex)`
1310
1385
  &[aria-disabled='true'] {
1311
1386
  cursor: not-allowed;
1387
+ background: ${({ theme }) => theme.colors.neutral150};
1312
1388
  }
1313
1389
  `;
1314
1390
  const Separator = styled(Toolbar.Separator)`
@@ -1319,7 +1395,7 @@ const Separator = styled(Toolbar.Separator)`
1319
1395
  const FlexButton = styled(Flex)`
1320
1396
  // Inherit the not-allowed cursor from ToolbarWrapper when disabled
1321
1397
  &[aria-disabled] {
1322
- cursor: inherit;
1398
+ cursor: not-allowed;
1323
1399
  }
1324
1400
 
1325
1401
  &[aria-disabled='false'] {
@@ -1401,7 +1477,7 @@ const ToolbarButton = ({
1401
1477
  width: 7,
1402
1478
  height: 7,
1403
1479
  hasRadius: true,
1404
- children: /* @__PURE__ */ jsx(Icon, { width: "1.2rem", height: "1.2rem", fill: disabled ? "neutral300" : enabledColor })
1480
+ children: /* @__PURE__ */ jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
1405
1481
  }
1406
1482
  )
1407
1483
  }
@@ -1533,8 +1609,7 @@ const isListNode = (node) => {
1533
1609
  const ListButton = ({ block, format }) => {
1534
1610
  const { editor, disabled, blocks } = useBlocksEditorContext("ListButton");
1535
1611
  const isListActive = () => {
1536
- if (!editor.selection)
1537
- return false;
1612
+ if (!editor.selection) return false;
1538
1613
  const currentListEntry = Editor$1.above(editor, {
1539
1614
  match: (node) => !Editor$1.isEditor(node) && node.type === "list",
1540
1615
  at: editor.selection.anchor
@@ -1546,6 +1621,26 @@ const ListButton = ({ block, format }) => {
1546
1621
  }
1547
1622
  return false;
1548
1623
  };
1624
+ const isListDisabled = () => {
1625
+ if (disabled) {
1626
+ return true;
1627
+ }
1628
+ if (!editor.selection) {
1629
+ return false;
1630
+ }
1631
+ const anchorNodeEntry = Editor$1.above(editor, {
1632
+ at: editor.selection.anchor,
1633
+ match: (node) => !Editor$1.isEditor(node) && node.type !== "text"
1634
+ });
1635
+ const focusNodeEntry = Editor$1.above(editor, {
1636
+ at: editor.selection.focus,
1637
+ match: (node) => !Editor$1.isEditor(node) && node.type !== "text"
1638
+ });
1639
+ if (!anchorNodeEntry || !focusNodeEntry) {
1640
+ return false;
1641
+ }
1642
+ return anchorNodeEntry[0] !== focusNodeEntry[0];
1643
+ };
1549
1644
  const toggleList = (format2) => {
1550
1645
  let currentListEntry;
1551
1646
  if (editor.selection) {
@@ -1579,7 +1674,7 @@ const ListButton = ({ block, format }) => {
1579
1674
  name: format,
1580
1675
  label: block.label,
1581
1676
  isActive: isListActive(),
1582
- disabled,
1677
+ disabled: isListDisabled(),
1583
1678
  handleClick: () => toggleList(format)
1584
1679
  }
1585
1680
  );
@@ -1588,8 +1683,7 @@ const LinkButton = ({ disabled }) => {
1588
1683
  const { editor } = useBlocksEditorContext("LinkButton");
1589
1684
  const isLinkActive = () => {
1590
1685
  const { selection } = editor;
1591
- if (!selection)
1592
- return false;
1686
+ if (!selection) return false;
1593
1687
  const [match] = Array.from(
1594
1688
  Editor$1.nodes(editor, {
1595
1689
  at: Editor$1.unhangRange(editor, selection),
@@ -1653,7 +1747,7 @@ const BlocksToolbar = () => {
1653
1747
  return false;
1654
1748
  };
1655
1749
  const isButtonDisabled = checkButtonDisabled();
1656
- return /* @__PURE__ */ jsx(Toolbar.Root, { "aria-disabled": disabled, asChild: true, children: /* @__PURE__ */ jsxs(ToolbarWrapper, { gap: 2, padding: 2, children: [
1750
+ return /* @__PURE__ */ jsx(Toolbar.Root, { "aria-disabled": disabled, asChild: true, children: /* @__PURE__ */ jsxs(ToolbarWrapper, { gap: 2, padding: 2, width: "100%", children: [
1657
1751
  /* @__PURE__ */ jsx(BlocksDropdown, {}),
1658
1752
  /* @__PURE__ */ jsx(Separator, {}),
1659
1753
  /* @__PURE__ */ jsx(Toolbar.ToggleGroup, { type: "multiple", asChild: true, children: /* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
@@ -1723,33 +1817,36 @@ const DragItem = styled(Flex)`
1723
1817
  }
1724
1818
  `;
1725
1819
  const DragIconButton = styled(IconButton)`
1820
+ user-select: none;
1726
1821
  display: flex;
1727
1822
  align-items: center;
1728
1823
  justify-content: center;
1824
+ border: none;
1729
1825
  border-radius: ${({ theme }) => theme.borderRadius};
1730
- width: ${({ theme }) => theme.spaces[4]};
1731
- height: ${({ theme }) => theme.spaces[6]};
1826
+ padding-left: ${({ theme }) => theme.spaces[0]};
1827
+ padding-right: ${({ theme }) => theme.spaces[0]};
1828
+ padding-top: ${({ theme }) => theme.spaces[1]};
1829
+ padding-bottom: ${({ theme }) => theme.spaces[1]};
1732
1830
  visibility: hidden;
1733
1831
  cursor: grab;
1734
1832
  opacity: inherit;
1735
1833
  margin-top: ${(props) => props.$dragHandleTopMargin ?? 0};
1736
1834
 
1737
1835
  &:hover {
1738
- background: ${({ theme }) => theme.colors.neutral200};
1836
+ background: ${({ theme }) => theme.colors.neutral100};
1739
1837
  }
1740
1838
  &:active {
1741
1839
  cursor: grabbing;
1840
+ background: ${({ theme }) => theme.colors.neutral150};
1742
1841
  }
1743
1842
  &[aria-disabled='true'] {
1744
- cursor: not-allowed;
1745
- background: transparent;
1843
+ visibility: hidden;
1746
1844
  }
1747
1845
  svg {
1748
- height: auto;
1749
- width: ${({ theme }) => theme.spaces[3]};
1846
+ min-width: ${({ theme }) => theme.spaces[3]};
1750
1847
 
1751
1848
  path {
1752
- fill: ${({ theme }) => theme.colors.neutral700};
1849
+ fill: ${({ theme }) => theme.colors.neutral500};
1753
1850
  }
1754
1851
  }
1755
1852
  `;
@@ -1794,8 +1891,7 @@ const DragAndDropElement = ({
1794
1891
  displayedValue: children
1795
1892
  },
1796
1893
  onDropItem(currentIndex, newIndex) {
1797
- if (newIndex)
1798
- handleMoveBlock(newIndex, currentIndex);
1894
+ if (newIndex) handleMoveBlock(newIndex, currentIndex);
1799
1895
  }
1800
1896
  });
1801
1897
  const composedBoxRefs = useComposedRefs(blockRef, dropRef);
@@ -1851,6 +1947,7 @@ const DragAndDropElement = ({
1851
1947
  DragIconButton,
1852
1948
  {
1853
1949
  tag: "div",
1950
+ contentEditable: false,
1854
1951
  role: "button",
1855
1952
  tabIndex: 0,
1856
1953
  withTooltip: false,
@@ -1863,7 +1960,7 @@ const DragAndDropElement = ({
1863
1960
  disabled,
1864
1961
  draggable: true,
1865
1962
  $dragHandleTopMargin: dragHandleTopMargin,
1866
- children: /* @__PURE__ */ jsx(Drag, { color: "neutral600" })
1963
+ children: /* @__PURE__ */ jsx(Drag, { color: "primary500" })
1867
1964
  }
1868
1965
  ),
1869
1966
  children
@@ -1900,7 +1997,7 @@ const baseRenderLeaf = (props, modifiers2) => {
1900
1997
  }
1901
1998
  return currentChildren;
1902
1999
  }, props.children);
1903
- return /* @__PURE__ */ jsx("span", { ...props.attributes, children: wrappedChildren });
2000
+ return /* @__PURE__ */ jsx("span", { ...props.attributes, className: props.leaf.className, children: wrappedChildren });
1904
2001
  };
1905
2002
  const baseRenderElement = ({
1906
2003
  props,
@@ -1938,8 +2035,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
1938
2035
  [modifiers2]
1939
2036
  );
1940
2037
  const handleMoveBlocks = (editor2, event) => {
1941
- if (!editor2.selection)
1942
- return;
2038
+ if (!editor2.selection) return;
1943
2039
  const start = Range.start(editor2.selection);
1944
2040
  const currentIndex = [start.path[0]];
1945
2041
  let newIndexPosition = 0;
@@ -2076,8 +2172,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
2076
2172
  }
2077
2173
  };
2078
2174
  const handleScrollSelectionIntoView = () => {
2079
- if (!editor.selection)
2080
- return;
2175
+ if (!editor.selection) return;
2081
2176
  const domRange = ReactEditor.toDOMRange(editor, editor.selection);
2082
2177
  const domRect = domRange.getBoundingClientRect();
2083
2178
  const blocksInput = blocksRef.current;
@@ -2104,7 +2199,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
2104
2199
  background: "neutral0",
2105
2200
  color: "neutral800",
2106
2201
  lineHeight: 6,
2107
- paddingRight: 4,
2202
+ paddingRight: 7,
2108
2203
  paddingTop: 6,
2109
2204
  paddingBottom: 3,
2110
2205
  children: [
@@ -2115,6 +2210,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
2115
2210
  readOnly: disabled,
2116
2211
  placeholder,
2117
2212
  isExpandedMode,
2213
+ decorate: decorateCode,
2118
2214
  renderElement,
2119
2215
  renderLeaf,
2120
2216
  onKeyDown: handleKeyDown,
@@ -2187,7 +2283,7 @@ const EditorLayout$1 = ({
2187
2283
  /* @__PURE__ */ jsx(
2188
2284
  CollapseIconButton,
2189
2285
  {
2190
- "aria-label": formatMessage({
2286
+ label: formatMessage({
2191
2287
  id: getTranslation("components.Blocks.collapse"),
2192
2288
  defaultMessage: "Collapse"
2193
2289
  }),
@@ -2271,8 +2367,7 @@ const InlineCode = styled.code`
2271
2367
  `;
2272
2368
  const baseCheckIsActive = (editor, name2) => {
2273
2369
  const marks = Editor$1.marks(editor);
2274
- if (!marks)
2275
- return false;
2370
+ if (!marks) return false;
2276
2371
  return Boolean(marks[name2]);
2277
2372
  };
2278
2373
  const baseHandleToggle = (editor, name2) => {
@@ -2438,6 +2533,7 @@ const ExpandIconButton = styled(IconButton)`
2438
2533
  position: absolute;
2439
2534
  bottom: 1.2rem;
2440
2535
  right: 1.2rem;
2536
+ box-shadow: ${({ theme }) => theme.shadows.filterShadow};
2441
2537
  `;
2442
2538
  function useResetKey(value) {
2443
2539
  const slateUpdatesCount = React.useRef(0);
@@ -2526,7 +2622,7 @@ const BlocksEditor = React.forwardRef(
2526
2622
  !isExpandedMode && /* @__PURE__ */ jsx(
2527
2623
  ExpandIconButton,
2528
2624
  {
2529
- "aria-label": formatMessage({
2625
+ label: formatMessage({
2530
2626
  id: getTranslation("components.Blocks.expand"),
2531
2627
  defaultMessage: "Expand"
2532
2628
  }),
@@ -2592,47 +2688,44 @@ const createDefaultForm = (contentType, components = {}) => {
2592
2688
  const Initializer = ({ disabled, name: name2, onClick }) => {
2593
2689
  const { formatMessage } = useIntl();
2594
2690
  const field = useField(name2);
2595
- return /* @__PURE__ */ jsxs(Fragment, { children: [
2596
- /* @__PURE__ */ jsx(
2597
- Box,
2598
- {
2599
- tag: "button",
2600
- background: "neutral100",
2601
- borderColor: field.error ? "danger600" : "neutral200",
2602
- hasRadius: true,
2603
- disabled,
2604
- onClick,
2605
- paddingTop: 9,
2606
- paddingBottom: 9,
2607
- type: "button",
2608
- children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
2609
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(CircleIcon, {}) }),
2610
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2611
- id: getTranslation("components.empty-repeatable"),
2612
- defaultMessage: "No entry yet. Click on the button below to add one."
2613
- }) }) })
2614
- ] })
2615
- }
2616
- ),
2617
- field.error && /* @__PURE__ */ jsx(Typography, { textColor: "danger600", variant: "pi", children: field.error })
2618
- ] });
2691
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2692
+ Box,
2693
+ {
2694
+ tag: "button",
2695
+ background: disabled ? "neutral150" : "neutral100",
2696
+ borderColor: field.error ? "danger600" : "neutral200",
2697
+ hasRadius: true,
2698
+ disabled,
2699
+ onClick,
2700
+ paddingTop: 9,
2701
+ paddingBottom: 9,
2702
+ type: "button",
2703
+ style: { cursor: disabled ? "not-allowed" : "pointer" },
2704
+ children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
2705
+ /* @__PURE__ */ jsx(Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsx(PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
2706
+ /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
2707
+ Typography,
2708
+ {
2709
+ textColor: disabled ? "neutral600" : "primary600",
2710
+ variant: "pi",
2711
+ fontWeight: "bold",
2712
+ children: formatMessage({
2713
+ id: getTranslation("components.empty-repeatable"),
2714
+ defaultMessage: "No entry yet. Click to add one."
2715
+ })
2716
+ }
2717
+ ) })
2718
+ ] })
2719
+ }
2720
+ ) });
2619
2721
  };
2620
- const CircleIcon = styled(PlusCircle)`
2621
- width: 2.4rem;
2622
- height: 2.4rem;
2623
- > circle {
2624
- fill: ${({ theme }) => theme.colors.primary200};
2625
- }
2626
- > path {
2627
- fill: ${({ theme }) => theme.colors.primary600};
2628
- }
2629
- `;
2630
2722
  const NonRepeatableComponent = ({
2631
2723
  attribute,
2632
2724
  name: name2,
2633
2725
  children,
2634
2726
  layout
2635
2727
  }) => {
2728
+ const { formatMessage } = useIntl();
2636
2729
  const { value } = useField(name2);
2637
2730
  const level = useComponent("NonRepeatableComponent", (state) => state.level);
2638
2731
  const isNested = level > 0;
@@ -2649,7 +2742,22 @@ const NonRepeatableComponent = ({
2649
2742
  children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
2650
2743
  return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2651
2744
  const completeFieldName = `${name2}.${field.name}`;
2652
- return /* @__PURE__ */ jsx(Grid$1.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2745
+ const translatedLabel = formatMessage({
2746
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2747
+ defaultMessage: field.label
2748
+ });
2749
+ return /* @__PURE__ */ jsx(
2750
+ Grid$1.Item,
2751
+ {
2752
+ col: size,
2753
+ s: 12,
2754
+ xs: 12,
2755
+ direction: "column",
2756
+ alignItems: "stretch",
2757
+ children: children({ ...field, label: translatedLabel, name: completeFieldName })
2758
+ },
2759
+ completeFieldName
2760
+ );
2653
2761
  }) }, index);
2654
2762
  }) })
2655
2763
  }
@@ -2668,13 +2776,34 @@ const RepeatableComponent = ({
2668
2776
  const { search: searchString } = useLocation();
2669
2777
  const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
2670
2778
  const { components } = useDoc();
2671
- const { value = [], error } = useField(name2);
2779
+ const {
2780
+ value = [],
2781
+ error,
2782
+ rawError
2783
+ } = useField(name2);
2672
2784
  const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
2673
2785
  const moveFieldRow = useForm("RepeatableComponent", (state) => state.moveFieldRow);
2674
2786
  const removeFieldRow = useForm("RepeatableComponent", (state) => state.removeFieldRow);
2675
2787
  const { max = Infinity } = attribute;
2676
2788
  const [collapseToOpen, setCollapseToOpen] = React.useState("");
2677
2789
  const [liveText, setLiveText] = React.useState("");
2790
+ React.useEffect(() => {
2791
+ const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
2792
+ const hasNestedValue = value && Array.isArray(value) && value.length > 0;
2793
+ if (hasNestedErrors && hasNestedValue) {
2794
+ const errorOpenItems = rawError.map((_, idx) => {
2795
+ return value[idx] ? value[idx].__temp_key__ : null;
2796
+ }).filter((value2) => !!value2);
2797
+ if (errorOpenItems && errorOpenItems.length > 0) {
2798
+ setCollapseToOpen((collapseToOpen2) => {
2799
+ if (!errorOpenItems.includes(collapseToOpen2)) {
2800
+ return errorOpenItems[0];
2801
+ }
2802
+ return collapseToOpen2;
2803
+ });
2804
+ }
2805
+ }
2806
+ }, [rawError, value]);
2678
2807
  const componentTmpKeyWithFocussedField = React.useMemo(() => {
2679
2808
  if (search.has("field")) {
2680
2809
  const fieldParam = search.get("field");
@@ -2827,7 +2956,26 @@ const RepeatableComponent = ({
2827
2956
  children: layout.map((row, index2) => {
2828
2957
  return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2829
2958
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2830
- return /* @__PURE__ */ jsx(Grid$1.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2959
+ const translatedLabel = formatMessage({
2960
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2961
+ defaultMessage: field.label
2962
+ });
2963
+ return /* @__PURE__ */ jsx(
2964
+ Grid$1.Item,
2965
+ {
2966
+ col: size,
2967
+ s: 12,
2968
+ xs: 12,
2969
+ direction: "column",
2970
+ alignItems: "stretch",
2971
+ children: children({
2972
+ ...field,
2973
+ label: translatedLabel,
2974
+ name: completeFieldName
2975
+ })
2976
+ },
2977
+ completeFieldName
2978
+ );
2831
2979
  }) }, index2);
2832
2980
  })
2833
2981
  }
@@ -2922,7 +3070,7 @@ const Component = ({
2922
3070
  /* @__PURE__ */ jsx(
2923
3071
  IconButton,
2924
3072
  {
2925
- borderWidth: 0,
3073
+ variant: "ghost",
2926
3074
  onClick: onDeleteComponent,
2927
3075
  label: formatMessage({
2928
3076
  id: getTranslation("containers.Edit.delete"),
@@ -2935,7 +3083,7 @@ const Component = ({
2935
3083
  IconButton,
2936
3084
  {
2937
3085
  ref: composedAccordionRefs,
2938
- borderWidth: 0,
3086
+ variant: "ghost",
2939
3087
  onClick: (e) => e.stopPropagation(),
2940
3088
  "data-handler-id": handlerId,
2941
3089
  label: formatMessage({
@@ -3005,7 +3153,7 @@ const ComponentInput = ({
3005
3153
  id: getTranslation("components.reset-entry"),
3006
3154
  defaultMessage: "Reset Entry"
3007
3155
  }),
3008
- borderWidth: 0,
3156
+ variant: "ghost",
3009
3157
  onClick: () => {
3010
3158
  field.onChange(name2, null);
3011
3159
  },
@@ -3034,19 +3182,16 @@ const AddComponentButton = ({
3034
3182
  onClick,
3035
3183
  disabled: isDisabled,
3036
3184
  background: "neutral0",
3037
- paddingTop: 3,
3038
- paddingBottom: 3,
3039
- paddingLeft: 4,
3040
- paddingRight: 4,
3041
3185
  style: { cursor: isDisabled ? "not-allowed" : "pointer" },
3186
+ variant: "tertiary",
3042
3187
  children: /* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 2, children: [
3043
3188
  /* @__PURE__ */ jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
3044
3189
  /* @__PURE__ */ jsx(
3045
- AddComponentTitle,
3190
+ Typography,
3046
3191
  {
3047
3192
  variant: "pi",
3048
3193
  fontWeight: "bold",
3049
- textColor: hasError && !isOpen ? "danger600" : "neutral500",
3194
+ textColor: hasError && !isOpen ? "danger600" : "neutral600",
3050
3195
  children
3051
3196
  }
3052
3197
  )
@@ -3063,42 +3208,14 @@ const StyledAddIcon = styled(PlusCircle)`
3063
3208
  fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger200 : theme.colors.neutral150};
3064
3209
  }
3065
3210
  > path {
3066
- fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral600};
3211
+ fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral500};
3067
3212
  }
3068
3213
  `;
3069
- const AddComponentTitle = styled(Typography)``;
3070
- const StyledButton = styled(BaseButton)`
3214
+ const StyledButton = styled(Button)`
3215
+ padding-left: ${({ theme }) => theme.spaces[3]};
3071
3216
  border-radius: 26px;
3072
- border-color: ${({ theme }) => theme.colors.neutral150};
3073
3217
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
3074
-
3075
- &:hover {
3076
- ${AddComponentTitle} {
3077
- color: ${({ theme }) => theme.colors.primary600};
3078
- }
3079
-
3080
- ${StyledAddIcon} {
3081
- > circle {
3082
- fill: ${({ theme }) => theme.colors.primary600};
3083
- }
3084
- > path {
3085
- fill: ${({ theme }) => theme.colors.neutral100};
3086
- }
3087
- }
3088
- }
3089
- &:active {
3090
- ${AddComponentTitle} {
3091
- color: ${({ theme }) => theme.colors.primary600};
3092
- }
3093
- ${StyledAddIcon} {
3094
- > circle {
3095
- fill: ${({ theme }) => theme.colors.primary600};
3096
- }
3097
- > path {
3098
- fill: ${({ theme }) => theme.colors.neutral100};
3099
- }
3100
- }
3101
- }
3218
+ height: 5rem;
3102
3219
  `;
3103
3220
  const ComponentCategory = ({
3104
3221
  category,
@@ -3213,18 +3330,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
3213
3330
  /* @__PURE__ */ jsx(Field.Hint, {})
3214
3331
  ] });
3215
3332
  };
3216
- function useDebounce(value, delay) {
3217
- const [debouncedValue, setDebouncedValue] = useState(value);
3218
- useEffect(() => {
3219
- const handler = setTimeout(() => {
3220
- setDebouncedValue(value);
3221
- }, delay);
3222
- return () => {
3223
- clearTimeout(handler);
3224
- };
3225
- }, [value, delay]);
3226
- return debouncedValue;
3227
- }
3228
3333
  const uidApi = contentManagerApi.injectEndpoints({
3229
3334
  endpoints: (builder) => ({
3230
3335
  getDefaultUID: builder.query({
@@ -3259,7 +3364,10 @@ const uidApi = contentManagerApi.injectEndpoints({
3259
3364
  config: {
3260
3365
  params
3261
3366
  }
3262
- })
3367
+ }),
3368
+ providesTags: (_res, _error, params) => [
3369
+ { type: "UidAvailability", id: params.contentTypeUID }
3370
+ ]
3263
3371
  })
3264
3372
  })
3265
3373
  });
@@ -3271,8 +3379,10 @@ const UIDInput = React.forwardRef(
3271
3379
  const allFormValues = useForm("InputUID", (form) => form.values);
3272
3380
  const [availability, setAvailability] = React.useState();
3273
3381
  const [showRegenerate, setShowRegenerate] = React.useState(false);
3382
+ const isCloning = useMatch(CLONE_PATH) !== null;
3274
3383
  const field = useField(name2);
3275
3384
  const debouncedValue = useDebounce(field.value, 300);
3385
+ const hasChanged = debouncedValue !== field.initialValue;
3276
3386
  const { toggleNotification } = useNotification();
3277
3387
  const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
3278
3388
  const { formatMessage } = useIntl();
@@ -3348,8 +3458,9 @@ const UIDInput = React.forwardRef(
3348
3458
  params
3349
3459
  },
3350
3460
  {
3461
+ // Don't check availability if the value is empty or wasn't changed
3351
3462
  skip: !Boolean(
3352
- debouncedValue !== field.initialValue && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3463
+ (hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3353
3464
  )
3354
3465
  }
3355
3466
  );
@@ -3378,6 +3489,7 @@ const UIDInput = React.forwardRef(
3378
3489
  const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
3379
3490
  const fieldRef = useFocusInputField(name2);
3380
3491
  const composedRefs = useComposedRefs(ref, fieldRef);
3492
+ const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
3381
3493
  return /* @__PURE__ */ jsxs(Field.Root, { hint, name: name2, error: field.error, required, children: [
3382
3494
  /* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
3383
3495
  /* @__PURE__ */ jsx(
@@ -3386,7 +3498,7 @@ const UIDInput = React.forwardRef(
3386
3498
  ref: composedRefs,
3387
3499
  disabled: props.disabled,
3388
3500
  endAction: /* @__PURE__ */ jsxs(Flex, { position: "relative", gap: 1, children: [
3389
- availability && !showRegenerate && /* @__PURE__ */ jsxs(
3501
+ shouldShowAvailability && /* @__PURE__ */ jsxs(
3390
3502
  TextValidation,
3391
3503
  {
3392
3504
  alignItems: "center",
@@ -3675,8 +3787,7 @@ const Wrapper = styled.div`
3675
3787
  `;
3676
3788
  var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
3677
3789
  function newlineAndIndentContinueMarkdownList(cm) {
3678
- if (cm.getOption("disableInput"))
3679
- return CodeMirror.Pass;
3790
+ if (cm.getOption("disableInput")) return CodeMirror.Pass;
3680
3791
  var ranges = cm.listSelections(), replacements = [];
3681
3792
  for (var i = 0; i < ranges.length; i++) {
3682
3793
  var pos = ranges[i].head;
@@ -3710,8 +3821,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
3710
3821
  var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
3711
3822
  var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
3712
3823
  replacements[i] = "\n" + indent + bullet + after;
3713
- if (numbered)
3714
- incrementRemainingMarkdownListNumbers(cm, pos);
3824
+ if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
3715
3825
  }
3716
3826
  }
3717
3827
  cm.replaceSelections(replacements);
@@ -3729,10 +3839,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3729
3839
  var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
3730
3840
  var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
3731
3841
  if (startIndent === nextIndent && !isNaN(nextNumber)) {
3732
- if (newNumber === nextNumber)
3733
- itemNumber = nextNumber + 1;
3734
- if (newNumber > nextNumber)
3735
- itemNumber = newNumber + 1;
3842
+ if (newNumber === nextNumber) itemNumber = nextNumber + 1;
3843
+ if (newNumber > nextNumber) itemNumber = newNumber + 1;
3736
3844
  cm.replaceRange(
3737
3845
  nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
3738
3846
  {
@@ -3745,10 +3853,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3745
3853
  }
3746
3854
  );
3747
3855
  } else {
3748
- if (startIndent.length > nextIndent.length)
3749
- return;
3750
- if (startIndent.length < nextIndent.length && lookAhead === 1)
3751
- return;
3856
+ if (startIndent.length > nextIndent.length) return;
3857
+ if (startIndent.length < nextIndent.length && lookAhead === 1) return;
3752
3858
  skipCount += 1;
3753
3859
  }
3754
3860
  }
@@ -4220,7 +4326,7 @@ const EditorLayout = ({
4220
4326
  justifyContent: "flex-end",
4221
4327
  shrink: 0,
4222
4328
  width: "100%",
4223
- children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, children: [
4329
+ children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
4224
4330
  /* @__PURE__ */ jsx(Typography, { children: formatMessage({
4225
4331
  id: "components.Wysiwyg.collapse",
4226
4332
  defaultMessage: "Collapse"
@@ -4238,12 +4344,14 @@ const EditorLayout = ({
4238
4344
  ) }) });
4239
4345
  }
4240
4346
  return /* @__PURE__ */ jsx(
4241
- Box,
4347
+ Flex,
4242
4348
  {
4243
4349
  borderColor: error ? "danger600" : "neutral200",
4244
4350
  borderStyle: "solid",
4245
4351
  borderWidth: "1px",
4246
4352
  hasRadius: true,
4353
+ direction: "column",
4354
+ alignItems: "stretch",
4247
4355
  children
4248
4356
  }
4249
4357
  );
@@ -4254,11 +4362,19 @@ const ExpandWrapper = styled(Flex)`
4254
4362
  const BoxWithBorder = styled(Box)`
4255
4363
  border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
4256
4364
  `;
4257
- const ExpandButton$1 = styled(BaseButton)`
4365
+ const ExpandButton$1 = styled(Button)`
4258
4366
  background-color: transparent;
4259
4367
  border: none;
4260
4368
  align-items: center;
4261
4369
 
4370
+ & > span {
4371
+ display: flex;
4372
+ justify-content: space-between;
4373
+ align-items: center;
4374
+ width: 100%;
4375
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4376
+ }
4377
+
4262
4378
  svg {
4263
4379
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4264
4380
 
@@ -4525,40 +4641,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4525
4641
  insertWithoutTextToEdit(editor, markdownType, line, contentLength);
4526
4642
  }
4527
4643
  };
4528
- const CustomIconButton = styled(IconButton)`
4529
- padding: ${({ theme }) => theme.spaces[2]};
4530
-
4531
- svg {
4532
- width: 1.8rem;
4533
- height: 1.8rem;
4534
- }
4535
- `;
4536
- const CustomLinkIconButton = styled(CustomIconButton)`
4537
- svg {
4538
- width: 0.8rem;
4539
- height: 0.8rem;
4540
- }
4541
- `;
4542
4644
  const MainButtons = styled(IconButtonGroup)`
4543
4645
  margin-left: ${({ theme }) => theme.spaces[4]};
4544
4646
  `;
4545
4647
  const MoreButton = styled(IconButton)`
4546
4648
  margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
4547
- padding: ${({ theme }) => theme.spaces[2]};
4548
-
4549
- svg {
4550
- width: 1.8rem;
4551
- height: 1.8rem;
4552
- }
4553
4649
  `;
4554
4650
  const IconButtonGroupMargin = styled(IconButtonGroup)`
4555
4651
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
4556
4652
  `;
4557
- const ExpandButton = styled(BaseButton)`
4653
+ const ExpandButton = styled(Button)`
4558
4654
  background-color: transparent;
4559
4655
  border: none;
4560
4656
  align-items: center;
4561
4657
 
4658
+ & > span {
4659
+ display: flex;
4660
+ justify-content: space-between;
4661
+ align-items: center;
4662
+ width: 100%;
4663
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4664
+ }
4665
+
4562
4666
  svg {
4563
4667
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4564
4668
  path {
@@ -4570,8 +4674,8 @@ const ExpandButton = styled(BaseButton)`
4570
4674
  `;
4571
4675
  const WysiwygFooter = ({ onToggleExpand }) => {
4572
4676
  const { formatMessage } = useIntl();
4573
- return /* @__PURE__ */ jsx(Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, children: [
4574
- /* @__PURE__ */ jsx(Typography, { children: formatMessage({
4677
+ return /* @__PURE__ */ jsx(Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, variant: "tertiary", size: "M", children: [
4678
+ /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: formatMessage({
4575
4679
  id: "components.WysiwygBottomControls.fullscreen",
4576
4680
  defaultMessage: "Expand"
4577
4681
  }) }),
@@ -4607,18 +4711,27 @@ const WysiwygNav = ({
4607
4711
  borderRadius: `0.4rem 0.4rem 0 0`,
4608
4712
  children: [
4609
4713
  /* @__PURE__ */ jsxs(Flex, { children: [
4610
- /* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(SingleSelect, { disabled: true, placeholder: selectPlaceholder, "aria-label": selectPlaceholder, children: [
4611
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
4612
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
4613
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h3", children: "h3" }),
4614
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h4", children: "h4" }),
4615
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h5", children: "h5" }),
4616
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h6", children: "h6" })
4617
- ] }) }),
4714
+ /* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(
4715
+ SingleSelect,
4716
+ {
4717
+ disabled: true,
4718
+ placeholder: selectPlaceholder,
4719
+ "aria-label": selectPlaceholder,
4720
+ size: "S",
4721
+ children: [
4722
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
4723
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
4724
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h3", children: "h3" }),
4725
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h4", children: "h4" }),
4726
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h5", children: "h5" }),
4727
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h6", children: "h6" })
4728
+ ]
4729
+ }
4730
+ ) }),
4618
4731
  /* @__PURE__ */ jsxs(MainButtons, { children: [
4619
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4620
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
4621
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsx(Underline, {}) })
4732
+ /* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4733
+ /* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
4734
+ /* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsx(Underline, {}) })
4622
4735
  ] }),
4623
4736
  /* @__PURE__ */ jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsx(More, {}) })
4624
4737
  ] }),
@@ -4645,6 +4758,7 @@ const WysiwygNav = ({
4645
4758
  placeholder: selectPlaceholder,
4646
4759
  "aria-label": selectPlaceholder,
4647
4760
  onChange: (value) => onActionClick(value, editorRef),
4761
+ size: "S",
4648
4762
  children: [
4649
4763
  /* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
4650
4764
  /* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
@@ -4656,17 +4770,9 @@ const WysiwygNav = ({
4656
4770
  }
4657
4771
  ) }),
4658
4772
  /* @__PURE__ */ jsxs(MainButtons, { children: [
4773
+ /* @__PURE__ */ jsx(IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4659
4774
  /* @__PURE__ */ jsx(
4660
- CustomIconButton,
4661
- {
4662
- onClick: () => onActionClick("Bold", editorRef),
4663
- label: "Bold",
4664
- name: "Bold",
4665
- children: /* @__PURE__ */ jsx(Bold, {})
4666
- }
4667
- ),
4668
- /* @__PURE__ */ jsx(
4669
- CustomIconButton,
4775
+ IconButton,
4670
4776
  {
4671
4777
  onClick: () => onActionClick("Italic", editorRef),
4672
4778
  label: "Italic",
@@ -4675,7 +4781,7 @@ const WysiwygNav = ({
4675
4781
  }
4676
4782
  ),
4677
4783
  /* @__PURE__ */ jsx(
4678
- CustomIconButton,
4784
+ IconButton,
4679
4785
  {
4680
4786
  onClick: () => onActionClick("Underline", editorRef),
4681
4787
  label: "Underline",
@@ -4689,7 +4795,7 @@ const WysiwygNav = ({
4689
4795
  /* @__PURE__ */ jsx(Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxs(Flex, { padding: 2, children: [
4690
4796
  /* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
4691
4797
  /* @__PURE__ */ jsx(
4692
- CustomIconButton,
4798
+ IconButton,
4693
4799
  {
4694
4800
  onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4695
4801
  label: "Strikethrough",
@@ -4698,7 +4804,7 @@ const WysiwygNav = ({
4698
4804
  }
4699
4805
  ),
4700
4806
  /* @__PURE__ */ jsx(
4701
- CustomIconButton,
4807
+ IconButton,
4702
4808
  {
4703
4809
  onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4704
4810
  label: "BulletList",
@@ -4707,7 +4813,7 @@ const WysiwygNav = ({
4707
4813
  }
4708
4814
  ),
4709
4815
  /* @__PURE__ */ jsx(
4710
- CustomIconButton,
4816
+ IconButton,
4711
4817
  {
4712
4818
  onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4713
4819
  label: "NumberList",
@@ -4718,7 +4824,7 @@ const WysiwygNav = ({
4718
4824
  ] }),
4719
4825
  /* @__PURE__ */ jsxs(IconButtonGroup, { children: [
4720
4826
  /* @__PURE__ */ jsx(
4721
- CustomIconButton,
4827
+ IconButton,
4722
4828
  {
4723
4829
  onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4724
4830
  label: "Code",
@@ -4727,7 +4833,7 @@ const WysiwygNav = ({
4727
4833
  }
4728
4834
  ),
4729
4835
  /* @__PURE__ */ jsx(
4730
- CustomIconButton,
4836
+ IconButton,
4731
4837
  {
4732
4838
  onClick: () => {
4733
4839
  handleTogglePopover();
@@ -4739,7 +4845,7 @@ const WysiwygNav = ({
4739
4845
  }
4740
4846
  ),
4741
4847
  /* @__PURE__ */ jsx(
4742
- CustomLinkIconButton,
4848
+ IconButton,
4743
4849
  {
4744
4850
  onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4745
4851
  label: "Link",
@@ -4748,7 +4854,7 @@ const WysiwygNav = ({
4748
4854
  }
4749
4855
  ),
4750
4856
  /* @__PURE__ */ jsx(
4751
- CustomIconButton,
4857
+ IconButton,
4752
4858
  {
4753
4859
  onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4754
4860
  label: "Quote",
@@ -4885,15 +4991,19 @@ const Wysiwyg = React.forwardRef(
4885
4991
  );
4886
4992
  const MemoizedWysiwyg = React.memo(Wysiwyg);
4887
4993
  const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4888
- const { id } = useDoc();
4994
+ const { id, document: document2, collectionType } = useDoc();
4889
4995
  const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
4890
4996
  const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
4891
4997
  const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
4892
4998
  const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
4893
4999
  const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
4894
5000
  const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
4895
- const editableFields = id ? canUpdateFields : canCreateFields;
4896
- const readableFields = id ? canReadFields : canCreateFields;
5001
+ let idToCheck = id;
5002
+ if (collectionType === SINGLE_TYPES) {
5003
+ idToCheck = document2?.documentId;
5004
+ }
5005
+ const editableFields = idToCheck ? canUpdateFields : canCreateFields;
5006
+ const readableFields = idToCheck ? canReadFields : canCreateFields;
4897
5007
  const canUserReadField = canUserAction(props.name, readableFields, props.type);
4898
5008
  const canUserEditField = canUserAction(props.name, editableFields, props.type);
4899
5009
  const fields = useStrapiApp("InputRenderer", (app) => app.fields);
@@ -4904,6 +5014,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4904
5014
  const {
4905
5015
  edit: { components }
4906
5016
  } = useDocLayout();
5017
+ const field = useField(props.name);
4907
5018
  if (!visible) {
4908
5019
  return null;
4909
5020
  }
@@ -4914,7 +5025,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4914
5025
  if (attributeHasCustomFieldProperty(props.attribute)) {
4915
5026
  const CustomInput = lazyComponentStore[props.attribute.customField];
4916
5027
  if (CustomInput) {
4917
- return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
5028
+ return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
4918
5029
  }
4919
5030
  return /* @__PURE__ */ jsx(
4920
5031
  InputRenderer$1,
@@ -4984,7 +5095,9 @@ const useFieldHint = (hint = void 0, attribute) => {
4984
5095
  if (!maximum && !minimum) {
4985
5096
  return hint;
4986
5097
  }
4987
- const units = !["biginteger", "integer", "number"].includes(attribute.type) ? formatMessage(
5098
+ const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
5099
+ attribute.type
5100
+ ) ? formatMessage(
4988
5101
  {
4989
5102
  id: "content-manager.form.Input.hint.character.unit",
4990
5103
  defaultMessage: "{maxValue, plural, one { character} other { characters}}"
@@ -5073,12 +5186,20 @@ const DynamicComponent = ({
5073
5186
  React.useEffect(() => {
5074
5187
  dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
5075
5188
  }, [dragPreviewRef, index]);
5189
+ const accordionValue = React.useId();
5190
+ const { value = [], rawError } = useField(`${name2}.${index}`);
5191
+ const [collapseToOpen, setCollapseToOpen] = React.useState("");
5192
+ React.useEffect(() => {
5193
+ if (rawError && value) {
5194
+ setCollapseToOpen(accordionValue);
5195
+ }
5196
+ }, [rawError, value, accordionValue]);
5076
5197
  const composedBoxRefs = useComposedRefs(boxRef, dropRef);
5077
5198
  const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
5078
5199
  /* @__PURE__ */ jsx(
5079
5200
  IconButton,
5080
5201
  {
5081
- borderWidth: 0,
5202
+ variant: "ghost",
5082
5203
  label: formatMessage(
5083
5204
  {
5084
5205
  id: getTranslation("components.DynamicZone.delete-label"),
@@ -5093,7 +5214,7 @@ const DynamicComponent = ({
5093
5214
  /* @__PURE__ */ jsx(
5094
5215
  IconButton,
5095
5216
  {
5096
- borderWidth: 0,
5217
+ variant: "ghost",
5097
5218
  onClick: (e) => e.stopPropagation(),
5098
5219
  "data-handler-id": handlerId,
5099
5220
  ref: dragRef,
@@ -5138,10 +5259,9 @@ const DynamicComponent = ({
5138
5259
  ] })
5139
5260
  ] });
5140
5261
  const accordionTitle = title ? `${displayName} ${title}` : displayName;
5141
- const accordionValue = React.useId();
5142
5262
  return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
5143
5263
  /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
5144
- /* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
5264
+ /* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { value: collapseToOpen, onValueChange: setCollapseToOpen, children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
5145
5265
  /* @__PURE__ */ jsxs(Accordion.Header, { children: [
5146
5266
  /* @__PURE__ */ jsx(
5147
5267
  Accordion.Trigger,
@@ -5152,10 +5272,39 @@ const DynamicComponent = ({
5152
5272
  ),
5153
5273
  /* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
5154
5274
  ] }),
5155
- /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5156
- const fieldName = `${name2}.${index}.${field.name}`;
5157
- return /* @__PURE__ */ jsx(Grid$1.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
5158
- }) }, rowInd)) }) }) })
5275
+ /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(
5276
+ Grid$1.Item,
5277
+ {
5278
+ col: 12,
5279
+ s: 12,
5280
+ xs: 12,
5281
+ direction: "column",
5282
+ alignItems: "stretch",
5283
+ children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5284
+ const fieldName = `${name2}.${index}.${field.name}`;
5285
+ const fieldWithTranslatedLabel = {
5286
+ ...field,
5287
+ label: formatMessage({
5288
+ id: `content-manager.components.${componentUid}.${field.name}`,
5289
+ defaultMessage: field.label
5290
+ })
5291
+ };
5292
+ return /* @__PURE__ */ jsx(
5293
+ Grid$1.Item,
5294
+ {
5295
+ col: size,
5296
+ s: 12,
5297
+ xs: 12,
5298
+ direction: "column",
5299
+ alignItems: "stretch",
5300
+ children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
5301
+ },
5302
+ fieldName
5303
+ );
5304
+ }) })
5305
+ },
5306
+ rowInd
5307
+ )) }) }) }) })
5159
5308
  ] }) }) })
5160
5309
  ] });
5161
5310
  };
@@ -5347,7 +5496,7 @@ const DynamicZone = ({
5347
5496
  const handleRemoveComponent = (name22, currentIndex) => () => {
5348
5497
  removeFieldRow(name22, currentIndex);
5349
5498
  };
5350
- const hasError = error !== void 0 || dynamicDisplayedComponentsLength < min || dynamicDisplayedComponentsLength > max;
5499
+ const hasError = error !== void 0;
5351
5500
  const renderButtonLabel = () => {
5352
5501
  if (addComponentIsOpen) {
5353
5502
  return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
@@ -5463,4 +5612,4 @@ export {
5463
5612
  transformDocument as t,
5464
5613
  useLazyComponents as u
5465
5614
  };
5466
- //# sourceMappingURL=Field-R5NbffTB.mjs.map
5615
+ //# sourceMappingURL=Field-fBnTwgU4.mjs.map