@strapi/content-manager 0.0.0-experimental.edc24aaa3bb5a90fa5fd4fee208167dd4e2e38d4 → 0.0.0-experimental.ee7402bacc4656d268ab76aa9c334a7b7a951201

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 (213) 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-5ukroXAh.js → ComponentConfigurationPage-BlzvDpbX.js} +5 -6
  4. package/dist/_chunks/{ComponentConfigurationPage-5ukroXAh.js.map → ComponentConfigurationPage-BlzvDpbX.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-BAgyHiMm.mjs → ComponentConfigurationPage-DaPOlQaD.mjs} +4 -4
  6. package/dist/_chunks/{ComponentConfigurationPage-BAgyHiMm.mjs.map → ComponentConfigurationPage-DaPOlQaD.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-DmoXawIh.mjs → EditConfigurationPage-BZPXItXo.mjs} +4 -4
  11. package/dist/_chunks/{EditConfigurationPage-DmoXawIh.mjs.map → EditConfigurationPage-BZPXItXo.mjs.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-Xp7lun0f.js → EditConfigurationPage-uy-v43AR.js} +5 -6
  13. package/dist/_chunks/{EditConfigurationPage-Xp7lun0f.js.map → EditConfigurationPage-uy-v43AR.js.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-C-ukDOB7.js → EditViewPage-DT6A4ayX.js} +63 -13
  15. package/dist/_chunks/EditViewPage-DT6A4ayX.js.map +1 -0
  16. package/dist/_chunks/{EditViewPage-BLsjc5F-.mjs → EditViewPage-oOLeTySr.mjs} +63 -12
  17. package/dist/_chunks/EditViewPage-oOLeTySr.mjs.map +1 -0
  18. package/dist/_chunks/{Field-Cs7duwWd.mjs → Field-D7dv2aUX.mjs} +335 -211
  19. package/dist/_chunks/Field-D7dv2aUX.mjs.map +1 -0
  20. package/dist/_chunks/{Field-Bfph5SOd.js → Field-kYFVIGiP.js} +339 -215
  21. package/dist/_chunks/Field-kYFVIGiP.js.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-Dg_GS5TQ.mjs → Form-BxR6sc29.mjs} +37 -18
  25. package/dist/_chunks/Form-BxR6sc29.mjs.map +1 -0
  26. package/dist/_chunks/{Form-CPYqIWDG.js → Form-CCijSg3V.js} +39 -21
  27. package/dist/_chunks/Form-CCijSg3V.js.map +1 -0
  28. package/dist/_chunks/{History-DNQkXANT.js → History-BMndx49M.js} +42 -100
  29. package/dist/_chunks/History-BMndx49M.js.map +1 -0
  30. package/dist/_chunks/{History-wrnHqf09.mjs → History-D8F7aYQU.mjs} +43 -100
  31. package/dist/_chunks/History-D8F7aYQU.mjs.map +1 -0
  32. package/dist/_chunks/{ListConfigurationPage-CUQxfpjT.js → ListConfigurationPage-DouY1EWM.js} +19 -9
  33. package/dist/_chunks/ListConfigurationPage-DouY1EWM.js.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-DScmJVkW.mjs → ListConfigurationPage-DqAdSPwC.mjs} +19 -8
  35. package/dist/_chunks/ListConfigurationPage-DqAdSPwC.mjs.map +1 -0
  36. package/dist/_chunks/{ListViewPage-BsLiH2-2.js → ListViewPage-BPVmh9pq.js} +109 -78
  37. package/dist/_chunks/ListViewPage-BPVmh9pq.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-C4IvrMgY.mjs → ListViewPage-C73F0jPh.mjs} +106 -74
  39. package/dist/_chunks/ListViewPage-C73F0jPh.mjs.map +1 -0
  40. package/dist/_chunks/{NoContentTypePage-Djg8nPlj.mjs → NoContentTypePage-B5w7iJOF.mjs} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-Djg8nPlj.mjs.map → NoContentTypePage-B5w7iJOF.mjs.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-BZ-PnGAf.js → NoContentTypePage-BwcL--4H.js} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-BZ-PnGAf.js.map → NoContentTypePage-BwcL--4H.js.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-_lUqjGW3.js → NoPermissionsPage-BMFKVcwJ.js} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-_lUqjGW3.js.map → NoPermissionsPage-BMFKVcwJ.js.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-DSP7R-hv.mjs → NoPermissionsPage-UnEgMGK4.mjs} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-DSP7R-hv.mjs.map → NoPermissionsPage-UnEgMGK4.mjs.map} +1 -1
  48. package/dist/_chunks/Preview-B7PR3Ok_.js +312 -0
  49. package/dist/_chunks/Preview-B7PR3Ok_.js.map +1 -0
  50. package/dist/_chunks/Preview-DECOhK0D.mjs +294 -0
  51. package/dist/_chunks/Preview-DECOhK0D.mjs.map +1 -0
  52. package/dist/_chunks/{Relations-BZr8tL0R.mjs → Relations-DinMQJ4B.mjs} +76 -42
  53. package/dist/_chunks/Relations-DinMQJ4B.mjs.map +1 -0
  54. package/dist/_chunks/{Relations-CtELXYIK.js → Relations-lndx3aQk.js} +76 -43
  55. package/dist/_chunks/Relations-lndx3aQk.js.map +1 -0
  56. package/dist/_chunks/{en-uOUIxfcQ.js → en-BK8Xyl5I.js} +28 -15
  57. package/dist/_chunks/{en-uOUIxfcQ.js.map → en-BK8Xyl5I.js.map} +1 -1
  58. package/dist/_chunks/{en-BrCTWlZv.mjs → en-Dtk_ot79.mjs} +28 -15
  59. package/dist/_chunks/{en-BrCTWlZv.mjs.map → en-Dtk_ot79.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-c_5DdJi-.mjs → index-C2SagWVW.mjs} +1107 -777
  70. package/dist/_chunks/index-C2SagWVW.mjs.map +1 -0
  71. package/dist/_chunks/{index-OerGjbAN.js → index-Cnw4gqee.js} +1089 -759
  72. package/dist/_chunks/index-Cnw4gqee.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-oPBiO7RY.mjs → layout-DY_D9MGA.mjs} +23 -10
  78. package/dist/_chunks/layout-DY_D9MGA.mjs.map +1 -0
  79. package/dist/_chunks/{layout-Ci7qHlFb.js → layout-ivwIVPnV.js} +23 -11
  80. package/dist/_chunks/layout-ivwIVPnV.js.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-COBpStiF.js → relations-B7C7O_Pv.js} +6 -7
  86. package/dist/_chunks/relations-B7C7O_Pv.js.map +1 -0
  87. package/dist/_chunks/{relations-BIdWFjdq.mjs → relations-Boc5Y9kX.mjs} +6 -7
  88. package/dist/_chunks/relations-Boc5Y9kX.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 +2 -1
  98. package/dist/admin/index.js.map +1 -1
  99. package/dist/admin/index.mjs +5 -4
  100. package/dist/admin/src/content-manager.d.ts +3 -2
  101. package/dist/admin/src/exports.d.ts +1 -1
  102. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  103. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  104. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  105. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  106. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  107. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  108. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  109. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  110. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  111. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  112. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
  113. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  114. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  115. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  116. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  117. package/dist/admin/src/preview/index.d.ts +4 -0
  118. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  119. package/dist/admin/src/preview/routes.d.ts +3 -0
  120. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  121. package/dist/admin/src/router.d.ts +1 -1
  122. package/dist/admin/src/services/api.d.ts +1 -1
  123. package/dist/admin/src/services/components.d.ts +2 -2
  124. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  125. package/dist/admin/src/services/documents.d.ts +19 -20
  126. package/dist/admin/src/services/init.d.ts +1 -1
  127. package/dist/admin/src/services/relations.d.ts +2 -2
  128. package/dist/admin/src/services/uid.d.ts +3 -3
  129. package/dist/admin/src/utils/validation.d.ts +4 -1
  130. package/dist/server/index.js +648 -333
  131. package/dist/server/index.js.map +1 -1
  132. package/dist/server/index.mjs +649 -333
  133. package/dist/server/index.mjs.map +1 -1
  134. package/dist/server/src/bootstrap.d.ts.map +1 -1
  135. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  136. package/dist/server/src/controllers/index.d.ts.map +1 -1
  137. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  138. package/dist/server/src/controllers/utils/metadata.d.ts +16 -1
  139. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  140. package/dist/server/src/history/services/history.d.ts.map +1 -1
  141. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  142. package/dist/server/src/history/services/utils.d.ts +4 -4
  143. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  144. package/dist/server/src/index.d.ts +7 -6
  145. package/dist/server/src/index.d.ts.map +1 -1
  146. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  147. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  148. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  149. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  150. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  151. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  152. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  153. package/dist/server/src/preview/index.d.ts +4 -0
  154. package/dist/server/src/preview/index.d.ts.map +1 -0
  155. package/dist/server/src/preview/routes/index.d.ts +8 -0
  156. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  157. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  158. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  159. package/dist/server/src/preview/services/index.d.ts +16 -0
  160. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  161. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  162. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  163. package/dist/server/src/preview/services/preview.d.ts +12 -0
  164. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  165. package/dist/server/src/preview/utils.d.ts +19 -0
  166. package/dist/server/src/preview/utils.d.ts.map +1 -0
  167. package/dist/server/src/register.d.ts.map +1 -1
  168. package/dist/server/src/routes/index.d.ts.map +1 -1
  169. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  170. package/dist/server/src/services/document-metadata.d.ts +12 -10
  171. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  172. package/dist/server/src/services/index.d.ts +7 -6
  173. package/dist/server/src/services/index.d.ts.map +1 -1
  174. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  175. package/dist/server/src/services/utils/populate.d.ts +2 -2
  176. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  177. package/dist/server/src/utils/index.d.ts +2 -0
  178. package/dist/server/src/utils/index.d.ts.map +1 -1
  179. package/dist/shared/contracts/collection-types.d.ts +3 -1
  180. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  181. package/dist/shared/contracts/index.d.ts +1 -0
  182. package/dist/shared/contracts/index.d.ts.map +1 -1
  183. package/dist/shared/contracts/preview.d.ts +27 -0
  184. package/dist/shared/contracts/preview.d.ts.map +1 -0
  185. package/dist/shared/index.js +4 -0
  186. package/dist/shared/index.js.map +1 -1
  187. package/dist/shared/index.mjs +4 -0
  188. package/dist/shared/index.mjs.map +1 -1
  189. package/package.json +17 -15
  190. package/dist/_chunks/EditViewPage-BLsjc5F-.mjs.map +0 -1
  191. package/dist/_chunks/EditViewPage-C-ukDOB7.js.map +0 -1
  192. package/dist/_chunks/Field-Bfph5SOd.js.map +0 -1
  193. package/dist/_chunks/Field-Cs7duwWd.mjs.map +0 -1
  194. package/dist/_chunks/Form-CPYqIWDG.js.map +0 -1
  195. package/dist/_chunks/Form-Dg_GS5TQ.mjs.map +0 -1
  196. package/dist/_chunks/History-DNQkXANT.js.map +0 -1
  197. package/dist/_chunks/History-wrnHqf09.mjs.map +0 -1
  198. package/dist/_chunks/ListConfigurationPage-CUQxfpjT.js.map +0 -1
  199. package/dist/_chunks/ListConfigurationPage-DScmJVkW.mjs.map +0 -1
  200. package/dist/_chunks/ListViewPage-BsLiH2-2.js.map +0 -1
  201. package/dist/_chunks/ListViewPage-C4IvrMgY.mjs.map +0 -1
  202. package/dist/_chunks/Relations-BZr8tL0R.mjs.map +0 -1
  203. package/dist/_chunks/Relations-CtELXYIK.js.map +0 -1
  204. package/dist/_chunks/index-OerGjbAN.js.map +0 -1
  205. package/dist/_chunks/index-c_5DdJi-.mjs.map +0 -1
  206. package/dist/_chunks/layout-Ci7qHlFb.js.map +0 -1
  207. package/dist/_chunks/layout-oPBiO7RY.mjs.map +0 -1
  208. package/dist/_chunks/relations-BIdWFjdq.mjs.map +0 -1
  209. package/dist/_chunks/relations-COBpStiF.js.map +0 -1
  210. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  211. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  212. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  213. 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-c_5DdJi-.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-C2SagWVW.mjs";
9
9
  import { generateNKeysBetween } from "fractional-indexing";
10
- import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-BZr8tL0R.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-DinMQJ4B.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) => {
@@ -892,8 +966,7 @@ const LinkContent = React.forwardRef(
892
966
  ReactEditor.focus(editor);
893
967
  };
894
968
  React.useEffect(() => {
895
- if (popoverOpen)
896
- linkInputRef.current?.focus();
969
+ if (popoverOpen) linkInputRef.current?.focus();
897
970
  }, [popoverOpen]);
898
971
  const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
899
972
  return /* @__PURE__ */ jsxs(Popover.Root, { open: popoverOpen, children: [
@@ -963,11 +1036,11 @@ const LinkContent = React.forwardRef(
963
1036
  ),
964
1037
  /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
965
1038
  /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
966
- id: "components.Blocks.popover.cancel",
1039
+ id: "global.cancel",
967
1040
  defaultMessage: "Cancel"
968
1041
  }) }),
969
1042
  /* @__PURE__ */ jsx(Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
970
- id: "components.Blocks.popover.save",
1043
+ id: "global.save",
971
1044
  defaultMessage: "Save"
972
1045
  }) })
973
1046
  ] })
@@ -1048,8 +1121,7 @@ const isText$1 = (node) => {
1048
1121
  return Node.isNode(node) && !Editor$1.isEditor(node) && node.type === "text";
1049
1122
  };
1050
1123
  const handleBackspaceKeyOnList = (editor, event) => {
1051
- if (!editor.selection)
1052
- return;
1124
+ if (!editor.selection) return;
1053
1125
  const [currentListItem, currentListItemPath] = Editor$1.parent(editor, editor.selection.anchor);
1054
1126
  const [currentList, currentListPath] = Editor$1.parent(editor, currentListItemPath);
1055
1127
  const isListEmpty = currentList.children.length === 1 && isText$1(currentListItem.children[0]) && currentListItem.children[0].text === "";
@@ -1158,8 +1230,7 @@ const handleEnterKeyOnList = (editor) => {
1158
1230
  };
1159
1231
  const handleConvertToList = (editor, format) => {
1160
1232
  const convertedPath = baseHandleConvert(editor, { type: "list-item" });
1161
- if (!convertedPath)
1162
- return;
1233
+ if (!convertedPath) return;
1163
1234
  Transforms.wrapNodes(editor, { type: "list", format, children: [] }, { at: convertedPath });
1164
1235
  };
1165
1236
  const handleTabOnList = (editor) => {
@@ -1171,8 +1242,7 @@ const handleTabOnList = (editor) => {
1171
1242
  }
1172
1243
  const [currentListItem, currentListItemPath] = currentListItemEntry;
1173
1244
  const [currentList] = Editor$1.parent(editor, currentListItemPath);
1174
- if (currentListItem === currentList.children[0])
1175
- return;
1245
+ if (currentListItem === currentList.children[0]) return;
1176
1246
  const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);
1177
1247
  const previousNode = currentList.children[currentListItemIndex - 1];
1178
1248
  if (previousNode.type === "list") {
@@ -1308,13 +1378,13 @@ const quoteBlocks = {
1308
1378
  handleEnterKey(editor) {
1309
1379
  pressEnterTwiceToExit(editor);
1310
1380
  },
1311
- snippets: [">"],
1312
- dragHandleTopMargin: "6px"
1381
+ snippets: [">"]
1313
1382
  }
1314
1383
  };
1315
1384
  const ToolbarWrapper = styled(Flex)`
1316
1385
  &[aria-disabled='true'] {
1317
1386
  cursor: not-allowed;
1387
+ background: ${({ theme }) => theme.colors.neutral150};
1318
1388
  }
1319
1389
  `;
1320
1390
  const Separator = styled(Toolbar.Separator)`
@@ -1325,7 +1395,7 @@ const Separator = styled(Toolbar.Separator)`
1325
1395
  const FlexButton = styled(Flex)`
1326
1396
  // Inherit the not-allowed cursor from ToolbarWrapper when disabled
1327
1397
  &[aria-disabled] {
1328
- cursor: inherit;
1398
+ cursor: not-allowed;
1329
1399
  }
1330
1400
 
1331
1401
  &[aria-disabled='false'] {
@@ -1407,7 +1477,7 @@ const ToolbarButton = ({
1407
1477
  width: 7,
1408
1478
  height: 7,
1409
1479
  hasRadius: true,
1410
- children: /* @__PURE__ */ jsx(Icon, { width: "1.2rem", height: "1.2rem", fill: disabled ? "neutral300" : enabledColor })
1480
+ children: /* @__PURE__ */ jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
1411
1481
  }
1412
1482
  )
1413
1483
  }
@@ -1539,8 +1609,7 @@ const isListNode = (node) => {
1539
1609
  const ListButton = ({ block, format }) => {
1540
1610
  const { editor, disabled, blocks } = useBlocksEditorContext("ListButton");
1541
1611
  const isListActive = () => {
1542
- if (!editor.selection)
1543
- return false;
1612
+ if (!editor.selection) return false;
1544
1613
  const currentListEntry = Editor$1.above(editor, {
1545
1614
  match: (node) => !Editor$1.isEditor(node) && node.type === "list",
1546
1615
  at: editor.selection.anchor
@@ -1614,8 +1683,7 @@ const LinkButton = ({ disabled }) => {
1614
1683
  const { editor } = useBlocksEditorContext("LinkButton");
1615
1684
  const isLinkActive = () => {
1616
1685
  const { selection } = editor;
1617
- if (!selection)
1618
- return false;
1686
+ if (!selection) return false;
1619
1687
  const [match] = Array.from(
1620
1688
  Editor$1.nodes(editor, {
1621
1689
  at: Editor$1.unhangRange(editor, selection),
@@ -1679,7 +1747,7 @@ const BlocksToolbar = () => {
1679
1747
  return false;
1680
1748
  };
1681
1749
  const isButtonDisabled = checkButtonDisabled();
1682
- 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: [
1683
1751
  /* @__PURE__ */ jsx(BlocksDropdown, {}),
1684
1752
  /* @__PURE__ */ jsx(Separator, {}),
1685
1753
  /* @__PURE__ */ jsx(Toolbar.ToggleGroup, { type: "multiple", asChild: true, children: /* @__PURE__ */ jsxs(Flex, { gap: 1, children: [
@@ -1749,33 +1817,36 @@ const DragItem = styled(Flex)`
1749
1817
  }
1750
1818
  `;
1751
1819
  const DragIconButton = styled(IconButton)`
1820
+ user-select: none;
1752
1821
  display: flex;
1753
1822
  align-items: center;
1754
1823
  justify-content: center;
1824
+ border: none;
1755
1825
  border-radius: ${({ theme }) => theme.borderRadius};
1756
- width: ${({ theme }) => theme.spaces[4]};
1757
- 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]};
1758
1830
  visibility: hidden;
1759
1831
  cursor: grab;
1760
1832
  opacity: inherit;
1761
1833
  margin-top: ${(props) => props.$dragHandleTopMargin ?? 0};
1762
1834
 
1763
1835
  &:hover {
1764
- background: ${({ theme }) => theme.colors.neutral200};
1836
+ background: ${({ theme }) => theme.colors.neutral100};
1765
1837
  }
1766
1838
  &:active {
1767
1839
  cursor: grabbing;
1840
+ background: ${({ theme }) => theme.colors.neutral150};
1768
1841
  }
1769
1842
  &[aria-disabled='true'] {
1770
- cursor: not-allowed;
1771
- background: transparent;
1843
+ visibility: hidden;
1772
1844
  }
1773
1845
  svg {
1774
- height: auto;
1775
1846
  min-width: ${({ theme }) => theme.spaces[3]};
1776
1847
 
1777
1848
  path {
1778
- fill: ${({ theme }) => theme.colors.neutral700};
1849
+ fill: ${({ theme }) => theme.colors.neutral500};
1779
1850
  }
1780
1851
  }
1781
1852
  `;
@@ -1820,8 +1891,7 @@ const DragAndDropElement = ({
1820
1891
  displayedValue: children
1821
1892
  },
1822
1893
  onDropItem(currentIndex, newIndex) {
1823
- if (newIndex)
1824
- handleMoveBlock(newIndex, currentIndex);
1894
+ if (newIndex) handleMoveBlock(newIndex, currentIndex);
1825
1895
  }
1826
1896
  });
1827
1897
  const composedBoxRefs = useComposedRefs(blockRef, dropRef);
@@ -1877,6 +1947,7 @@ const DragAndDropElement = ({
1877
1947
  DragIconButton,
1878
1948
  {
1879
1949
  tag: "div",
1950
+ contentEditable: false,
1880
1951
  role: "button",
1881
1952
  tabIndex: 0,
1882
1953
  withTooltip: false,
@@ -1926,7 +1997,7 @@ const baseRenderLeaf = (props, modifiers2) => {
1926
1997
  }
1927
1998
  return currentChildren;
1928
1999
  }, props.children);
1929
- return /* @__PURE__ */ jsx("span", { ...props.attributes, children: wrappedChildren });
2000
+ return /* @__PURE__ */ jsx("span", { ...props.attributes, className: props.leaf.className, children: wrappedChildren });
1930
2001
  };
1931
2002
  const baseRenderElement = ({
1932
2003
  props,
@@ -1964,8 +2035,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
1964
2035
  [modifiers2]
1965
2036
  );
1966
2037
  const handleMoveBlocks = (editor2, event) => {
1967
- if (!editor2.selection)
1968
- return;
2038
+ if (!editor2.selection) return;
1969
2039
  const start = Range.start(editor2.selection);
1970
2040
  const currentIndex = [start.path[0]];
1971
2041
  let newIndexPosition = 0;
@@ -2102,8 +2172,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
2102
2172
  }
2103
2173
  };
2104
2174
  const handleScrollSelectionIntoView = () => {
2105
- if (!editor.selection)
2106
- return;
2175
+ if (!editor.selection) return;
2107
2176
  const domRange = ReactEditor.toDOMRange(editor, editor.selection);
2108
2177
  const domRect = domRange.getBoundingClientRect();
2109
2178
  const blocksInput = blocksRef.current;
@@ -2130,7 +2199,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
2130
2199
  background: "neutral0",
2131
2200
  color: "neutral800",
2132
2201
  lineHeight: 6,
2133
- paddingRight: 4,
2202
+ paddingRight: 7,
2134
2203
  paddingTop: 6,
2135
2204
  paddingBottom: 3,
2136
2205
  children: [
@@ -2141,6 +2210,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
2141
2210
  readOnly: disabled,
2142
2211
  placeholder,
2143
2212
  isExpandedMode,
2213
+ decorate: decorateCode,
2144
2214
  renderElement,
2145
2215
  renderLeaf,
2146
2216
  onKeyDown: handleKeyDown,
@@ -2297,8 +2367,7 @@ const InlineCode = styled.code`
2297
2367
  `;
2298
2368
  const baseCheckIsActive = (editor, name2) => {
2299
2369
  const marks = Editor$1.marks(editor);
2300
- if (!marks)
2301
- return false;
2370
+ if (!marks) return false;
2302
2371
  return Boolean(marks[name2]);
2303
2372
  };
2304
2373
  const baseHandleToggle = (editor, name2) => {
@@ -2464,6 +2533,7 @@ const ExpandIconButton = styled(IconButton)`
2464
2533
  position: absolute;
2465
2534
  bottom: 1.2rem;
2466
2535
  right: 1.2rem;
2536
+ box-shadow: ${({ theme }) => theme.shadows.filterShadow};
2467
2537
  `;
2468
2538
  function useResetKey(value) {
2469
2539
  const slateUpdatesCount = React.useRef(0);
@@ -2622,7 +2692,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
2622
2692
  Box,
2623
2693
  {
2624
2694
  tag: "button",
2625
- background: "neutral100",
2695
+ background: disabled ? "neutral150" : "neutral100",
2626
2696
  borderColor: field.error ? "danger600" : "neutral200",
2627
2697
  hasRadius: true,
2628
2698
  disabled,
@@ -2630,32 +2700,32 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
2630
2700
  paddingTop: 9,
2631
2701
  paddingBottom: 9,
2632
2702
  type: "button",
2703
+ style: { cursor: disabled ? "not-allowed" : "pointer" },
2633
2704
  children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
2634
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(CircleIcon, {}) }),
2635
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2636
- id: getTranslation("components.empty-repeatable"),
2637
- defaultMessage: "No entry yet. Click on the button below to add one."
2638
- }) }) })
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
+ ) })
2639
2718
  ] })
2640
2719
  }
2641
2720
  ) });
2642
2721
  };
2643
- const CircleIcon = styled(PlusCircle)`
2644
- width: 2.4rem;
2645
- height: 2.4rem;
2646
- > circle {
2647
- fill: ${({ theme }) => theme.colors.primary200};
2648
- }
2649
- > path {
2650
- fill: ${({ theme }) => theme.colors.primary600};
2651
- }
2652
- `;
2653
2722
  const NonRepeatableComponent = ({
2654
2723
  attribute,
2655
2724
  name: name2,
2656
2725
  children,
2657
2726
  layout
2658
2727
  }) => {
2728
+ const { formatMessage } = useIntl();
2659
2729
  const { value } = useField(name2);
2660
2730
  const level = useComponent("NonRepeatableComponent", (state) => state.level);
2661
2731
  const isNested = level > 0;
@@ -2672,7 +2742,22 @@ const NonRepeatableComponent = ({
2672
2742
  children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
2673
2743
  return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2674
2744
  const completeFieldName = `${name2}.${field.name}`;
2675
- 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
+ );
2676
2761
  }) }, index);
2677
2762
  }) })
2678
2763
  }
@@ -2691,13 +2776,34 @@ const RepeatableComponent = ({
2691
2776
  const { search: searchString } = useLocation();
2692
2777
  const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
2693
2778
  const { components } = useDoc();
2694
- const { value = [], error } = useField(name2);
2779
+ const {
2780
+ value = [],
2781
+ error,
2782
+ rawError
2783
+ } = useField(name2);
2695
2784
  const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
2696
2785
  const moveFieldRow = useForm("RepeatableComponent", (state) => state.moveFieldRow);
2697
2786
  const removeFieldRow = useForm("RepeatableComponent", (state) => state.removeFieldRow);
2698
2787
  const { max = Infinity } = attribute;
2699
2788
  const [collapseToOpen, setCollapseToOpen] = React.useState("");
2700
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]);
2701
2807
  const componentTmpKeyWithFocussedField = React.useMemo(() => {
2702
2808
  if (search.has("field")) {
2703
2809
  const fieldParam = search.get("field");
@@ -2850,7 +2956,26 @@ const RepeatableComponent = ({
2850
2956
  children: layout.map((row, index2) => {
2851
2957
  return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2852
2958
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2853
- 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
+ );
2854
2979
  }) }, index2);
2855
2980
  })
2856
2981
  }
@@ -2945,7 +3070,7 @@ const Component = ({
2945
3070
  /* @__PURE__ */ jsx(
2946
3071
  IconButton,
2947
3072
  {
2948
- borderWidth: 0,
3073
+ variant: "ghost",
2949
3074
  onClick: onDeleteComponent,
2950
3075
  label: formatMessage({
2951
3076
  id: getTranslation("containers.Edit.delete"),
@@ -2958,7 +3083,7 @@ const Component = ({
2958
3083
  IconButton,
2959
3084
  {
2960
3085
  ref: composedAccordionRefs,
2961
- borderWidth: 0,
3086
+ variant: "ghost",
2962
3087
  onClick: (e) => e.stopPropagation(),
2963
3088
  "data-handler-id": handlerId,
2964
3089
  label: formatMessage({
@@ -3028,7 +3153,7 @@ const ComponentInput = ({
3028
3153
  id: getTranslation("components.reset-entry"),
3029
3154
  defaultMessage: "Reset Entry"
3030
3155
  }),
3031
- borderWidth: 0,
3156
+ variant: "ghost",
3032
3157
  onClick: () => {
3033
3158
  field.onChange(name2, null);
3034
3159
  },
@@ -3057,19 +3182,16 @@ const AddComponentButton = ({
3057
3182
  onClick,
3058
3183
  disabled: isDisabled,
3059
3184
  background: "neutral0",
3060
- paddingTop: 3,
3061
- paddingBottom: 3,
3062
- paddingLeft: 4,
3063
- paddingRight: 4,
3064
3185
  style: { cursor: isDisabled ? "not-allowed" : "pointer" },
3186
+ variant: "tertiary",
3065
3187
  children: /* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 2, children: [
3066
3188
  /* @__PURE__ */ jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
3067
3189
  /* @__PURE__ */ jsx(
3068
- AddComponentTitle,
3190
+ Typography,
3069
3191
  {
3070
3192
  variant: "pi",
3071
3193
  fontWeight: "bold",
3072
- textColor: hasError && !isOpen ? "danger600" : "neutral500",
3194
+ textColor: hasError && !isOpen ? "danger600" : "neutral600",
3073
3195
  children
3074
3196
  }
3075
3197
  )
@@ -3086,42 +3208,14 @@ const StyledAddIcon = styled(PlusCircle)`
3086
3208
  fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger200 : theme.colors.neutral150};
3087
3209
  }
3088
3210
  > path {
3089
- fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral600};
3211
+ fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral500};
3090
3212
  }
3091
3213
  `;
3092
- const AddComponentTitle = styled(Typography)``;
3093
- const StyledButton = styled(BaseButton)`
3214
+ const StyledButton = styled(Button)`
3215
+ padding-left: ${({ theme }) => theme.spaces[3]};
3094
3216
  border-radius: 26px;
3095
- border-color: ${({ theme }) => theme.colors.neutral150};
3096
3217
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
3097
-
3098
- &:hover {
3099
- ${AddComponentTitle} {
3100
- color: ${({ theme }) => theme.colors.primary600};
3101
- }
3102
-
3103
- ${StyledAddIcon} {
3104
- > circle {
3105
- fill: ${({ theme }) => theme.colors.primary600};
3106
- }
3107
- > path {
3108
- fill: ${({ theme }) => theme.colors.neutral100};
3109
- }
3110
- }
3111
- }
3112
- &:active {
3113
- ${AddComponentTitle} {
3114
- color: ${({ theme }) => theme.colors.primary600};
3115
- }
3116
- ${StyledAddIcon} {
3117
- > circle {
3118
- fill: ${({ theme }) => theme.colors.primary600};
3119
- }
3120
- > path {
3121
- fill: ${({ theme }) => theme.colors.neutral100};
3122
- }
3123
- }
3124
- }
3218
+ height: 5rem;
3125
3219
  `;
3126
3220
  const ComponentCategory = ({
3127
3221
  category,
@@ -3236,18 +3330,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
3236
3330
  /* @__PURE__ */ jsx(Field.Hint, {})
3237
3331
  ] });
3238
3332
  };
3239
- function useDebounce(value, delay) {
3240
- const [debouncedValue, setDebouncedValue] = useState(value);
3241
- useEffect(() => {
3242
- const handler = setTimeout(() => {
3243
- setDebouncedValue(value);
3244
- }, delay);
3245
- return () => {
3246
- clearTimeout(handler);
3247
- };
3248
- }, [value, delay]);
3249
- return debouncedValue;
3250
- }
3251
3333
  const uidApi = contentManagerApi.injectEndpoints({
3252
3334
  endpoints: (builder) => ({
3253
3335
  getDefaultUID: builder.query({
@@ -3282,7 +3364,10 @@ const uidApi = contentManagerApi.injectEndpoints({
3282
3364
  config: {
3283
3365
  params
3284
3366
  }
3285
- })
3367
+ }),
3368
+ providesTags: (_res, _error, params) => [
3369
+ { type: "UidAvailability", id: params.contentTypeUID }
3370
+ ]
3286
3371
  })
3287
3372
  })
3288
3373
  });
@@ -3294,8 +3379,10 @@ const UIDInput = React.forwardRef(
3294
3379
  const allFormValues = useForm("InputUID", (form) => form.values);
3295
3380
  const [availability, setAvailability] = React.useState();
3296
3381
  const [showRegenerate, setShowRegenerate] = React.useState(false);
3382
+ const isCloning = useMatch(CLONE_PATH) !== null;
3297
3383
  const field = useField(name2);
3298
3384
  const debouncedValue = useDebounce(field.value, 300);
3385
+ const hasChanged = debouncedValue !== field.initialValue;
3299
3386
  const { toggleNotification } = useNotification();
3300
3387
  const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
3301
3388
  const { formatMessage } = useIntl();
@@ -3371,8 +3458,9 @@ const UIDInput = React.forwardRef(
3371
3458
  params
3372
3459
  },
3373
3460
  {
3461
+ // Don't check availability if the value is empty or wasn't changed
3374
3462
  skip: !Boolean(
3375
- debouncedValue !== field.initialValue && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3463
+ (hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3376
3464
  )
3377
3465
  }
3378
3466
  );
@@ -3401,6 +3489,7 @@ const UIDInput = React.forwardRef(
3401
3489
  const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
3402
3490
  const fieldRef = useFocusInputField(name2);
3403
3491
  const composedRefs = useComposedRefs(ref, fieldRef);
3492
+ const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
3404
3493
  return /* @__PURE__ */ jsxs(Field.Root, { hint, name: name2, error: field.error, required, children: [
3405
3494
  /* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
3406
3495
  /* @__PURE__ */ jsx(
@@ -3409,7 +3498,7 @@ const UIDInput = React.forwardRef(
3409
3498
  ref: composedRefs,
3410
3499
  disabled: props.disabled,
3411
3500
  endAction: /* @__PURE__ */ jsxs(Flex, { position: "relative", gap: 1, children: [
3412
- availability && !showRegenerate && /* @__PURE__ */ jsxs(
3501
+ shouldShowAvailability && /* @__PURE__ */ jsxs(
3413
3502
  TextValidation,
3414
3503
  {
3415
3504
  alignItems: "center",
@@ -3698,8 +3787,7 @@ const Wrapper = styled.div`
3698
3787
  `;
3699
3788
  var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
3700
3789
  function newlineAndIndentContinueMarkdownList(cm) {
3701
- if (cm.getOption("disableInput"))
3702
- return CodeMirror.Pass;
3790
+ if (cm.getOption("disableInput")) return CodeMirror.Pass;
3703
3791
  var ranges = cm.listSelections(), replacements = [];
3704
3792
  for (var i = 0; i < ranges.length; i++) {
3705
3793
  var pos = ranges[i].head;
@@ -3733,8 +3821,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
3733
3821
  var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
3734
3822
  var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
3735
3823
  replacements[i] = "\n" + indent + bullet + after;
3736
- if (numbered)
3737
- incrementRemainingMarkdownListNumbers(cm, pos);
3824
+ if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
3738
3825
  }
3739
3826
  }
3740
3827
  cm.replaceSelections(replacements);
@@ -3752,10 +3839,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3752
3839
  var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
3753
3840
  var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
3754
3841
  if (startIndent === nextIndent && !isNaN(nextNumber)) {
3755
- if (newNumber === nextNumber)
3756
- itemNumber = nextNumber + 1;
3757
- if (newNumber > nextNumber)
3758
- itemNumber = newNumber + 1;
3842
+ if (newNumber === nextNumber) itemNumber = nextNumber + 1;
3843
+ if (newNumber > nextNumber) itemNumber = newNumber + 1;
3759
3844
  cm.replaceRange(
3760
3845
  nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
3761
3846
  {
@@ -3768,10 +3853,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3768
3853
  }
3769
3854
  );
3770
3855
  } else {
3771
- if (startIndent.length > nextIndent.length)
3772
- return;
3773
- if (startIndent.length < nextIndent.length && lookAhead === 1)
3774
- return;
3856
+ if (startIndent.length > nextIndent.length) return;
3857
+ if (startIndent.length < nextIndent.length && lookAhead === 1) return;
3775
3858
  skipCount += 1;
3776
3859
  }
3777
3860
  }
@@ -4243,7 +4326,7 @@ const EditorLayout = ({
4243
4326
  justifyContent: "flex-end",
4244
4327
  shrink: 0,
4245
4328
  width: "100%",
4246
- children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, children: [
4329
+ children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
4247
4330
  /* @__PURE__ */ jsx(Typography, { children: formatMessage({
4248
4331
  id: "components.Wysiwyg.collapse",
4249
4332
  defaultMessage: "Collapse"
@@ -4261,12 +4344,14 @@ const EditorLayout = ({
4261
4344
  ) }) });
4262
4345
  }
4263
4346
  return /* @__PURE__ */ jsx(
4264
- Box,
4347
+ Flex,
4265
4348
  {
4266
4349
  borderColor: error ? "danger600" : "neutral200",
4267
4350
  borderStyle: "solid",
4268
4351
  borderWidth: "1px",
4269
4352
  hasRadius: true,
4353
+ direction: "column",
4354
+ alignItems: "stretch",
4270
4355
  children
4271
4356
  }
4272
4357
  );
@@ -4277,11 +4362,19 @@ const ExpandWrapper = styled(Flex)`
4277
4362
  const BoxWithBorder = styled(Box)`
4278
4363
  border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
4279
4364
  `;
4280
- const ExpandButton$1 = styled(BaseButton)`
4365
+ const ExpandButton$1 = styled(Button)`
4281
4366
  background-color: transparent;
4282
4367
  border: none;
4283
4368
  align-items: center;
4284
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
+
4285
4378
  svg {
4286
4379
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4287
4380
 
@@ -4548,40 +4641,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4548
4641
  insertWithoutTextToEdit(editor, markdownType, line, contentLength);
4549
4642
  }
4550
4643
  };
4551
- const CustomIconButton = styled(IconButton)`
4552
- padding: ${({ theme }) => theme.spaces[2]};
4553
-
4554
- svg {
4555
- width: 1.8rem;
4556
- height: 1.8rem;
4557
- }
4558
- `;
4559
- const CustomLinkIconButton = styled(CustomIconButton)`
4560
- svg {
4561
- width: 0.8rem;
4562
- height: 0.8rem;
4563
- }
4564
- `;
4565
4644
  const MainButtons = styled(IconButtonGroup)`
4566
4645
  margin-left: ${({ theme }) => theme.spaces[4]};
4567
4646
  `;
4568
4647
  const MoreButton = styled(IconButton)`
4569
4648
  margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
4570
- padding: ${({ theme }) => theme.spaces[2]};
4571
-
4572
- svg {
4573
- width: 1.8rem;
4574
- height: 1.8rem;
4575
- }
4576
4649
  `;
4577
4650
  const IconButtonGroupMargin = styled(IconButtonGroup)`
4578
4651
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
4579
4652
  `;
4580
- const ExpandButton = styled(BaseButton)`
4653
+ const ExpandButton = styled(Button)`
4581
4654
  background-color: transparent;
4582
4655
  border: none;
4583
4656
  align-items: center;
4584
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
+
4585
4666
  svg {
4586
4667
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4587
4668
  path {
@@ -4593,7 +4674,7 @@ const ExpandButton = styled(BaseButton)`
4593
4674
  `;
4594
4675
  const WysiwygFooter = ({ onToggleExpand }) => {
4595
4676
  const { formatMessage } = useIntl();
4596
- 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: [
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: [
4597
4678
  /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: formatMessage({
4598
4679
  id: "components.WysiwygBottomControls.fullscreen",
4599
4680
  defaultMessage: "Expand"
@@ -4630,18 +4711,27 @@ const WysiwygNav = ({
4630
4711
  borderRadius: `0.4rem 0.4rem 0 0`,
4631
4712
  children: [
4632
4713
  /* @__PURE__ */ jsxs(Flex, { children: [
4633
- /* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(SingleSelect, { disabled: true, placeholder: selectPlaceholder, "aria-label": selectPlaceholder, children: [
4634
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
4635
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
4636
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h3", children: "h3" }),
4637
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h4", children: "h4" }),
4638
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h5", children: "h5" }),
4639
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h6", children: "h6" })
4640
- ] }) }),
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
+ ) }),
4641
4731
  /* @__PURE__ */ jsxs(MainButtons, { children: [
4642
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4643
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
4644
- /* @__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, {}) })
4645
4735
  ] }),
4646
4736
  /* @__PURE__ */ jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsx(More, {}) })
4647
4737
  ] }),
@@ -4668,6 +4758,7 @@ const WysiwygNav = ({
4668
4758
  placeholder: selectPlaceholder,
4669
4759
  "aria-label": selectPlaceholder,
4670
4760
  onChange: (value) => onActionClick(value, editorRef),
4761
+ size: "S",
4671
4762
  children: [
4672
4763
  /* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
4673
4764
  /* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
@@ -4679,17 +4770,9 @@ const WysiwygNav = ({
4679
4770
  }
4680
4771
  ) }),
4681
4772
  /* @__PURE__ */ jsxs(MainButtons, { children: [
4773
+ /* @__PURE__ */ jsx(IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4682
4774
  /* @__PURE__ */ jsx(
4683
- CustomIconButton,
4684
- {
4685
- onClick: () => onActionClick("Bold", editorRef),
4686
- label: "Bold",
4687
- name: "Bold",
4688
- children: /* @__PURE__ */ jsx(Bold, {})
4689
- }
4690
- ),
4691
- /* @__PURE__ */ jsx(
4692
- CustomIconButton,
4775
+ IconButton,
4693
4776
  {
4694
4777
  onClick: () => onActionClick("Italic", editorRef),
4695
4778
  label: "Italic",
@@ -4698,7 +4781,7 @@ const WysiwygNav = ({
4698
4781
  }
4699
4782
  ),
4700
4783
  /* @__PURE__ */ jsx(
4701
- CustomIconButton,
4784
+ IconButton,
4702
4785
  {
4703
4786
  onClick: () => onActionClick("Underline", editorRef),
4704
4787
  label: "Underline",
@@ -4712,7 +4795,7 @@ const WysiwygNav = ({
4712
4795
  /* @__PURE__ */ jsx(Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxs(Flex, { padding: 2, children: [
4713
4796
  /* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
4714
4797
  /* @__PURE__ */ jsx(
4715
- CustomIconButton,
4798
+ IconButton,
4716
4799
  {
4717
4800
  onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4718
4801
  label: "Strikethrough",
@@ -4721,7 +4804,7 @@ const WysiwygNav = ({
4721
4804
  }
4722
4805
  ),
4723
4806
  /* @__PURE__ */ jsx(
4724
- CustomIconButton,
4807
+ IconButton,
4725
4808
  {
4726
4809
  onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4727
4810
  label: "BulletList",
@@ -4730,7 +4813,7 @@ const WysiwygNav = ({
4730
4813
  }
4731
4814
  ),
4732
4815
  /* @__PURE__ */ jsx(
4733
- CustomIconButton,
4816
+ IconButton,
4734
4817
  {
4735
4818
  onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4736
4819
  label: "NumberList",
@@ -4741,7 +4824,7 @@ const WysiwygNav = ({
4741
4824
  ] }),
4742
4825
  /* @__PURE__ */ jsxs(IconButtonGroup, { children: [
4743
4826
  /* @__PURE__ */ jsx(
4744
- CustomIconButton,
4827
+ IconButton,
4745
4828
  {
4746
4829
  onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4747
4830
  label: "Code",
@@ -4750,7 +4833,7 @@ const WysiwygNav = ({
4750
4833
  }
4751
4834
  ),
4752
4835
  /* @__PURE__ */ jsx(
4753
- CustomIconButton,
4836
+ IconButton,
4754
4837
  {
4755
4838
  onClick: () => {
4756
4839
  handleTogglePopover();
@@ -4762,7 +4845,7 @@ const WysiwygNav = ({
4762
4845
  }
4763
4846
  ),
4764
4847
  /* @__PURE__ */ jsx(
4765
- CustomLinkIconButton,
4848
+ IconButton,
4766
4849
  {
4767
4850
  onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4768
4851
  label: "Link",
@@ -4771,7 +4854,7 @@ const WysiwygNav = ({
4771
4854
  }
4772
4855
  ),
4773
4856
  /* @__PURE__ */ jsx(
4774
- CustomIconButton,
4857
+ IconButton,
4775
4858
  {
4776
4859
  onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4777
4860
  label: "Quote",
@@ -4908,15 +4991,19 @@ const Wysiwyg = React.forwardRef(
4908
4991
  );
4909
4992
  const MemoizedWysiwyg = React.memo(Wysiwyg);
4910
4993
  const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4911
- const { id } = useDoc();
4994
+ const { id, document: document2, collectionType } = useDoc();
4912
4995
  const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
4913
4996
  const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
4914
4997
  const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
4915
4998
  const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
4916
4999
  const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
4917
5000
  const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
4918
- const editableFields = id ? canUpdateFields : canCreateFields;
4919
- 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;
4920
5007
  const canUserReadField = canUserAction(props.name, readableFields, props.type);
4921
5008
  const canUserEditField = canUserAction(props.name, editableFields, props.type);
4922
5009
  const fields = useStrapiApp("InputRenderer", (app) => app.fields);
@@ -4927,6 +5014,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4927
5014
  const {
4928
5015
  edit: { components }
4929
5016
  } = useDocLayout();
5017
+ const field = useField(props.name);
4930
5018
  if (!visible) {
4931
5019
  return null;
4932
5020
  }
@@ -4937,7 +5025,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4937
5025
  if (attributeHasCustomFieldProperty(props.attribute)) {
4938
5026
  const CustomInput = lazyComponentStore[props.attribute.customField];
4939
5027
  if (CustomInput) {
4940
- return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
5028
+ return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
4941
5029
  }
4942
5030
  return /* @__PURE__ */ jsx(
4943
5031
  InputRenderer$1,
@@ -5098,12 +5186,20 @@ const DynamicComponent = ({
5098
5186
  React.useEffect(() => {
5099
5187
  dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
5100
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]);
5101
5197
  const composedBoxRefs = useComposedRefs(boxRef, dropRef);
5102
5198
  const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
5103
5199
  /* @__PURE__ */ jsx(
5104
5200
  IconButton,
5105
5201
  {
5106
- borderWidth: 0,
5202
+ variant: "ghost",
5107
5203
  label: formatMessage(
5108
5204
  {
5109
5205
  id: getTranslation("components.DynamicZone.delete-label"),
@@ -5118,7 +5214,7 @@ const DynamicComponent = ({
5118
5214
  /* @__PURE__ */ jsx(
5119
5215
  IconButton,
5120
5216
  {
5121
- borderWidth: 0,
5217
+ variant: "ghost",
5122
5218
  onClick: (e) => e.stopPropagation(),
5123
5219
  "data-handler-id": handlerId,
5124
5220
  ref: dragRef,
@@ -5163,10 +5259,9 @@ const DynamicComponent = ({
5163
5259
  ] })
5164
5260
  ] });
5165
5261
  const accordionTitle = title ? `${displayName} ${title}` : displayName;
5166
- const accordionValue = React.useId();
5167
5262
  return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
5168
5263
  /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
5169
- /* @__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: [
5170
5265
  /* @__PURE__ */ jsxs(Accordion.Header, { children: [
5171
5266
  /* @__PURE__ */ jsx(
5172
5267
  Accordion.Trigger,
@@ -5177,10 +5272,39 @@ const DynamicComponent = ({
5177
5272
  ),
5178
5273
  /* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
5179
5274
  ] }),
5180
- /* @__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 }) => {
5181
- const fieldName = `${name2}.${index}.${field.name}`;
5182
- return /* @__PURE__ */ jsx(Grid$1.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
5183
- }) }, 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
+ )) }) }) }) })
5184
5308
  ] }) }) })
5185
5309
  ] });
5186
5310
  };
@@ -5488,4 +5612,4 @@ export {
5488
5612
  transformDocument as t,
5489
5613
  useLazyComponents as u
5490
5614
  };
5491
- //# sourceMappingURL=Field-Cs7duwWd.mjs.map
5615
+ //# sourceMappingURL=Field-D7dv2aUX.mjs.map