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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) 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-DyDkPajU.js → ComponentConfigurationPage-BLWQy8ru.js} +5 -6
  4. package/dist/_chunks/{ComponentConfigurationPage-DyDkPajU.js.map → ComponentConfigurationPage-BLWQy8ru.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-9lRmRdIr.mjs → ComponentConfigurationPage-CtIa3aa2.mjs} +4 -4
  6. package/dist/_chunks/{ComponentConfigurationPage-9lRmRdIr.mjs.map → ComponentConfigurationPage-CtIa3aa2.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-Bk893vVY.mjs → EditConfigurationPage-DsPR2DVk.mjs} +4 -4
  11. package/dist/_chunks/{EditConfigurationPage-Bk893vVY.mjs.map → EditConfigurationPage-DsPR2DVk.mjs.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-DValmA0m.js → EditConfigurationPage-RQkymxCy.js} +5 -6
  13. package/dist/_chunks/{EditConfigurationPage-DValmA0m.js.map → EditConfigurationPage-RQkymxCy.js.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-Dk7Eaft4.js → EditViewPage-B-kExt8C.js} +50 -11
  15. package/dist/_chunks/EditViewPage-B-kExt8C.js.map +1 -0
  16. package/dist/_chunks/{EditViewPage-DiNFdFqP.mjs → EditViewPage-BPyVuPfM.mjs} +50 -10
  17. package/dist/_chunks/EditViewPage-BPyVuPfM.mjs.map +1 -0
  18. package/dist/_chunks/{Field-DH2OaqUP.js → Field-DPIsQRre.js} +250 -161
  19. package/dist/_chunks/Field-DPIsQRre.js.map +1 -0
  20. package/dist/_chunks/{Field-Dv_HTFTa.mjs → Field-Dltnt1km.mjs} +244 -155
  21. package/dist/_chunks/Field-Dltnt1km.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-B_dUDizM.js → Form-BFi4MXMT.js} +19 -12
  25. package/dist/_chunks/Form-BFi4MXMT.js.map +1 -0
  26. package/dist/_chunks/{Form-Dy6P4HgH.mjs → Form-C1IcWm1u.mjs} +17 -9
  27. package/dist/_chunks/Form-C1IcWm1u.mjs.map +1 -0
  28. package/dist/_chunks/{History-DrwsD1Vc.mjs → History-04ChQ4pl.mjs} +71 -104
  29. package/dist/_chunks/History-04ChQ4pl.mjs.map +1 -0
  30. package/dist/_chunks/{History-BT4w83Oa.js → History-wjcK4L0C.js} +70 -104
  31. package/dist/_chunks/History-wjcK4L0C.js.map +1 -0
  32. package/dist/_chunks/{ListConfigurationPage-BxIP0jRy.mjs → ListConfigurationPage-BYqPYLSU.mjs} +7 -6
  33. package/dist/_chunks/ListConfigurationPage-BYqPYLSU.mjs.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-CuYrMcW3.js → ListConfigurationPage-CRbxIC3J.js} +7 -7
  35. package/dist/_chunks/ListConfigurationPage-CRbxIC3J.js.map +1 -0
  36. package/dist/_chunks/{ListViewPage-BvpwNur7.js → ListViewPage-D5NY9183.js} +88 -54
  37. package/dist/_chunks/ListViewPage-D5NY9183.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-5a1vw-OK.mjs → ListViewPage-FU2LBuhl.mjs} +83 -48
  39. package/dist/_chunks/ListViewPage-FU2LBuhl.mjs.map +1 -0
  40. package/dist/_chunks/{NoContentTypePage-UqEiWKkM.js → NoContentTypePage-BgQVE_Qb.js} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-UqEiWKkM.js.map → NoContentTypePage-BgQVE_Qb.js.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-Bm6tRcd3.mjs → NoContentTypePage-DCKUkwb8.mjs} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-Bm6tRcd3.mjs.map → NoContentTypePage-DCKUkwb8.mjs.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-C_vGRo8Q.js → NoPermissionsPage-C5jwn70o.js} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-C_vGRo8Q.js.map → NoPermissionsPage-C5jwn70o.js.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-BHPqn_tQ.mjs → NoPermissionsPage-jqve7C8l.mjs} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-BHPqn_tQ.mjs.map → NoPermissionsPage-jqve7C8l.mjs.map} +1 -1
  48. package/dist/_chunks/Preview-BMYN548c.mjs +294 -0
  49. package/dist/_chunks/Preview-BMYN548c.mjs.map +1 -0
  50. package/dist/_chunks/Preview-DaOihysv.js +312 -0
  51. package/dist/_chunks/Preview-DaOihysv.js.map +1 -0
  52. package/dist/_chunks/{Relations-CznVF6LS.js → Relations-CTGM7Hv5.js} +75 -42
  53. package/dist/_chunks/Relations-CTGM7Hv5.js.map +1 -0
  54. package/dist/_chunks/{Relations-C7fPyh5P.mjs → Relations-gscPkxjF.mjs} +75 -41
  55. package/dist/_chunks/Relations-gscPkxjF.mjs.map +1 -0
  56. package/dist/_chunks/{en-otD_UBJi.js → en-BzQmavmK.js} +32 -14
  57. package/dist/_chunks/{en-otD_UBJi.js.map → en-BzQmavmK.js.map} +1 -1
  58. package/dist/_chunks/{en-CbaIuYoB.mjs → en-CSxLmrh1.mjs} +32 -14
  59. package/dist/_chunks/{en-CbaIuYoB.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-D9UmmBcM.js → index-Ca7YWlAA.js} +1063 -754
  70. package/dist/_chunks/index-Ca7YWlAA.js.map +1 -0
  71. package/dist/_chunks/{index-BJ6uTqLL.mjs → index-DqasUQ6Q.mjs} +1066 -757
  72. package/dist/_chunks/index-DqasUQ6Q.mjs.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-kfu5Wtix.js → layout-BW80JSCd.js} +7 -7
  78. package/dist/_chunks/{layout-kfu5Wtix.js.map → layout-BW80JSCd.js.map} +1 -1
  79. package/dist/_chunks/{layout-uomiIGbG.mjs → layout-W3clJSCy.mjs} +6 -5
  80. package/dist/_chunks/{layout-uomiIGbG.mjs.map → layout-W3clJSCy.mjs.map} +1 -1
  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-DiDufGSA.mjs → relations-BlDkoeWh.mjs} +6 -7
  86. package/dist/_chunks/relations-BlDkoeWh.mjs.map +1 -0
  87. package/dist/_chunks/{relations-DKENrxko.js → relations-C9Usz9k5.js} +6 -7
  88. package/dist/_chunks/relations-C9Usz9k5.js.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 +5 -3
  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/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 +3 -3
  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/DynamicZone/DynamicComponent.d.ts +4 -1
  111. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
  112. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  113. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  114. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  115. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  116. package/dist/admin/src/preview/index.d.ts +4 -0
  117. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  118. package/dist/admin/src/preview/routes.d.ts +3 -0
  119. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  120. package/dist/admin/src/router.d.ts +1 -1
  121. package/dist/admin/src/services/api.d.ts +1 -1
  122. package/dist/admin/src/services/components.d.ts +2 -2
  123. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  124. package/dist/admin/src/services/documents.d.ts +19 -20
  125. package/dist/admin/src/services/init.d.ts +1 -1
  126. package/dist/admin/src/services/relations.d.ts +2 -2
  127. package/dist/admin/src/services/uid.d.ts +3 -3
  128. package/dist/server/index.js +594 -335
  129. package/dist/server/index.js.map +1 -1
  130. package/dist/server/index.mjs +595 -335
  131. package/dist/server/index.mjs.map +1 -1
  132. package/dist/server/src/bootstrap.d.ts.map +1 -1
  133. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  134. package/dist/server/src/controllers/index.d.ts.map +1 -1
  135. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  136. package/dist/server/src/controllers/utils/metadata.d.ts +16 -1
  137. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  138. package/dist/server/src/history/controllers/history-version.d.ts +1 -1
  139. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
  140. package/dist/server/src/history/services/history.d.ts +3 -3
  141. package/dist/server/src/history/services/history.d.ts.map +1 -1
  142. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  143. package/dist/server/src/history/services/utils.d.ts +6 -11
  144. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  145. package/dist/server/src/index.d.ts +7 -6
  146. package/dist/server/src/index.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/utils/populate.d.ts +2 -2
  175. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  176. package/dist/server/src/utils/index.d.ts +2 -0
  177. package/dist/server/src/utils/index.d.ts.map +1 -1
  178. package/dist/shared/contracts/collection-types.d.ts +3 -1
  179. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  180. package/dist/shared/contracts/index.d.ts +1 -0
  181. package/dist/shared/contracts/index.d.ts.map +1 -1
  182. package/dist/shared/contracts/preview.d.ts +27 -0
  183. package/dist/shared/contracts/preview.d.ts.map +1 -0
  184. package/dist/shared/index.js +4 -0
  185. package/dist/shared/index.js.map +1 -1
  186. package/dist/shared/index.mjs +4 -0
  187. package/dist/shared/index.mjs.map +1 -1
  188. package/package.json +17 -15
  189. package/dist/_chunks/EditViewPage-DiNFdFqP.mjs.map +0 -1
  190. package/dist/_chunks/EditViewPage-Dk7Eaft4.js.map +0 -1
  191. package/dist/_chunks/Field-DH2OaqUP.js.map +0 -1
  192. package/dist/_chunks/Field-Dv_HTFTa.mjs.map +0 -1
  193. package/dist/_chunks/Form-B_dUDizM.js.map +0 -1
  194. package/dist/_chunks/Form-Dy6P4HgH.mjs.map +0 -1
  195. package/dist/_chunks/History-BT4w83Oa.js.map +0 -1
  196. package/dist/_chunks/History-DrwsD1Vc.mjs.map +0 -1
  197. package/dist/_chunks/ListConfigurationPage-BxIP0jRy.mjs.map +0 -1
  198. package/dist/_chunks/ListConfigurationPage-CuYrMcW3.js.map +0 -1
  199. package/dist/_chunks/ListViewPage-5a1vw-OK.mjs.map +0 -1
  200. package/dist/_chunks/ListViewPage-BvpwNur7.js.map +0 -1
  201. package/dist/_chunks/Relations-C7fPyh5P.mjs.map +0 -1
  202. package/dist/_chunks/Relations-CznVF6LS.js.map +0 -1
  203. package/dist/_chunks/index-BJ6uTqLL.mjs.map +0 -1
  204. package/dist/_chunks/index-D9UmmBcM.js.map +0 -1
  205. package/dist/_chunks/relations-DKENrxko.js.map +0 -1
  206. package/dist/_chunks/relations-DiDufGSA.mjs.map +0 -1
  207. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  208. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  209. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  210. package/strapi-server.js +0 -3
@@ -5,19 +5,70 @@ import { useStrapiApp, createContext, useField, useNotification, useForm, useAPI
5
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, n as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, o as useDocLayout } from "./index-BJ6uTqLL.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-DqasUQ6Q.mjs";
9
9
  import { generateNKeysBetween } from "fractional-indexing";
10
- import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-C7fPyh5P.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-gscPkxjF.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
73
  import { useLocation, useMatch } from "react-router-dom";
23
74
  import CodeMirror from "codemirror5";
@@ -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'] {
@@ -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,6 +2742,10 @@ 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}`;
2745
+ const translatedLabel = formatMessage({
2746
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2747
+ defaultMessage: field.label
2748
+ });
2675
2749
  return /* @__PURE__ */ jsx(
2676
2750
  Grid$1.Item,
2677
2751
  {
@@ -2680,7 +2754,7 @@ const NonRepeatableComponent = ({
2680
2754
  xs: 12,
2681
2755
  direction: "column",
2682
2756
  alignItems: "stretch",
2683
- children: children({ ...field, name: completeFieldName })
2757
+ children: children({ ...field, label: translatedLabel, name: completeFieldName })
2684
2758
  },
2685
2759
  completeFieldName
2686
2760
  );
@@ -2702,13 +2776,34 @@ const RepeatableComponent = ({
2702
2776
  const { search: searchString } = useLocation();
2703
2777
  const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
2704
2778
  const { components } = useDoc();
2705
- const { value = [], error } = useField(name2);
2779
+ const {
2780
+ value = [],
2781
+ error,
2782
+ rawError
2783
+ } = useField(name2);
2706
2784
  const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
2707
2785
  const moveFieldRow = useForm("RepeatableComponent", (state) => state.moveFieldRow);
2708
2786
  const removeFieldRow = useForm("RepeatableComponent", (state) => state.removeFieldRow);
2709
2787
  const { max = Infinity } = attribute;
2710
2788
  const [collapseToOpen, setCollapseToOpen] = React.useState("");
2711
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]);
2712
2807
  const componentTmpKeyWithFocussedField = React.useMemo(() => {
2713
2808
  if (search.has("field")) {
2714
2809
  const fieldParam = search.get("field");
@@ -2861,6 +2956,10 @@ const RepeatableComponent = ({
2861
2956
  children: layout.map((row, index2) => {
2862
2957
  return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2863
2958
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2959
+ const translatedLabel = formatMessage({
2960
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2961
+ defaultMessage: field.label
2962
+ });
2864
2963
  return /* @__PURE__ */ jsx(
2865
2964
  Grid$1.Item,
2866
2965
  {
@@ -2869,7 +2968,11 @@ const RepeatableComponent = ({
2869
2968
  xs: 12,
2870
2969
  direction: "column",
2871
2970
  alignItems: "stretch",
2872
- children: children({ ...field, name: completeFieldName })
2971
+ children: children({
2972
+ ...field,
2973
+ label: translatedLabel,
2974
+ name: completeFieldName
2975
+ })
2873
2976
  },
2874
2977
  completeFieldName
2875
2978
  );
@@ -3084,11 +3187,11 @@ const AddComponentButton = ({
3084
3187
  children: /* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 2, children: [
3085
3188
  /* @__PURE__ */ jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
3086
3189
  /* @__PURE__ */ jsx(
3087
- AddComponentTitle,
3190
+ Typography,
3088
3191
  {
3089
3192
  variant: "pi",
3090
3193
  fontWeight: "bold",
3091
- textColor: hasError && !isOpen ? "danger600" : "neutral500",
3194
+ textColor: hasError && !isOpen ? "danger600" : "neutral600",
3092
3195
  children
3093
3196
  }
3094
3197
  )
@@ -3105,43 +3208,14 @@ const StyledAddIcon = styled(PlusCircle)`
3105
3208
  fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger200 : theme.colors.neutral150};
3106
3209
  }
3107
3210
  > path {
3108
- fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral600};
3211
+ fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral500};
3109
3212
  }
3110
3213
  `;
3111
- const AddComponentTitle = styled(Typography)``;
3112
3214
  const StyledButton = styled(Button)`
3215
+ padding-left: ${({ theme }) => theme.spaces[3]};
3113
3216
  border-radius: 26px;
3114
- border-color: ${({ theme }) => theme.colors.neutral150};
3115
3217
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
3116
3218
  height: 5rem;
3117
-
3118
- &:hover {
3119
- ${AddComponentTitle} {
3120
- color: ${({ theme }) => theme.colors.primary600};
3121
- }
3122
-
3123
- ${StyledAddIcon} {
3124
- > circle {
3125
- fill: ${({ theme }) => theme.colors.primary600};
3126
- }
3127
- > path {
3128
- fill: ${({ theme }) => theme.colors.primary600};
3129
- }
3130
- }
3131
- }
3132
- &:active {
3133
- ${AddComponentTitle} {
3134
- color: ${({ theme }) => theme.colors.primary600};
3135
- }
3136
- ${StyledAddIcon} {
3137
- > circle {
3138
- fill: ${({ theme }) => theme.colors.primary600};
3139
- }
3140
- > path {
3141
- fill: ${({ theme }) => theme.colors.neutral100};
3142
- }
3143
- }
3144
- }
3145
3219
  `;
3146
3220
  const ComponentCategory = ({
3147
3221
  category,
@@ -3256,18 +3330,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
3256
3330
  /* @__PURE__ */ jsx(Field.Hint, {})
3257
3331
  ] });
3258
3332
  };
3259
- function useDebounce(value, delay) {
3260
- const [debouncedValue, setDebouncedValue] = useState(value);
3261
- useEffect(() => {
3262
- const handler = setTimeout(() => {
3263
- setDebouncedValue(value);
3264
- }, delay);
3265
- return () => {
3266
- clearTimeout(handler);
3267
- };
3268
- }, [value, delay]);
3269
- return debouncedValue;
3270
- }
3271
3333
  const uidApi = contentManagerApi.injectEndpoints({
3272
3334
  endpoints: (builder) => ({
3273
3335
  getDefaultUID: builder.query({
@@ -3725,8 +3787,7 @@ const Wrapper = styled.div`
3725
3787
  `;
3726
3788
  var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
3727
3789
  function newlineAndIndentContinueMarkdownList(cm) {
3728
- if (cm.getOption("disableInput"))
3729
- return CodeMirror.Pass;
3790
+ if (cm.getOption("disableInput")) return CodeMirror.Pass;
3730
3791
  var ranges = cm.listSelections(), replacements = [];
3731
3792
  for (var i = 0; i < ranges.length; i++) {
3732
3793
  var pos = ranges[i].head;
@@ -3760,8 +3821,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
3760
3821
  var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
3761
3822
  var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
3762
3823
  replacements[i] = "\n" + indent + bullet + after;
3763
- if (numbered)
3764
- incrementRemainingMarkdownListNumbers(cm, pos);
3824
+ if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
3765
3825
  }
3766
3826
  }
3767
3827
  cm.replaceSelections(replacements);
@@ -3779,10 +3839,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3779
3839
  var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
3780
3840
  var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
3781
3841
  if (startIndent === nextIndent && !isNaN(nextNumber)) {
3782
- if (newNumber === nextNumber)
3783
- itemNumber = nextNumber + 1;
3784
- if (newNumber > nextNumber)
3785
- itemNumber = newNumber + 1;
3842
+ if (newNumber === nextNumber) itemNumber = nextNumber + 1;
3843
+ if (newNumber > nextNumber) itemNumber = newNumber + 1;
3786
3844
  cm.replaceRange(
3787
3845
  nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
3788
3846
  {
@@ -3795,10 +3853,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3795
3853
  }
3796
3854
  );
3797
3855
  } else {
3798
- if (startIndent.length > nextIndent.length)
3799
- return;
3800
- if (startIndent.length < nextIndent.length && lookAhead === 1)
3801
- return;
3856
+ if (startIndent.length > nextIndent.length) return;
3857
+ if (startIndent.length < nextIndent.length && lookAhead === 1) return;
3802
3858
  skipCount += 1;
3803
3859
  }
3804
3860
  }
@@ -4935,15 +4991,19 @@ const Wysiwyg = React.forwardRef(
4935
4991
  );
4936
4992
  const MemoizedWysiwyg = React.memo(Wysiwyg);
4937
4993
  const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4938
- const { id } = useDoc();
4994
+ const { id, document: document2, collectionType } = useDoc();
4939
4995
  const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
4940
4996
  const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
4941
4997
  const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
4942
4998
  const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
4943
4999
  const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
4944
5000
  const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
4945
- const editableFields = id ? canUpdateFields : canCreateFields;
4946
- 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;
4947
5007
  const canUserReadField = canUserAction(props.name, readableFields, props.type);
4948
5008
  const canUserEditField = canUserAction(props.name, editableFields, props.type);
4949
5009
  const fields = useStrapiApp("InputRenderer", (app) => app.fields);
@@ -4954,6 +5014,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4954
5014
  const {
4955
5015
  edit: { components }
4956
5016
  } = useDocLayout();
5017
+ const field = useField(props.name);
4957
5018
  if (!visible) {
4958
5019
  return null;
4959
5020
  }
@@ -4964,7 +5025,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4964
5025
  if (attributeHasCustomFieldProperty(props.attribute)) {
4965
5026
  const CustomInput = lazyComponentStore[props.attribute.customField];
4966
5027
  if (CustomInput) {
4967
- return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
5028
+ return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
4968
5029
  }
4969
5030
  return /* @__PURE__ */ jsx(
4970
5031
  InputRenderer$1,
@@ -5088,7 +5149,8 @@ const DynamicComponent = ({
5088
5149
  onDropItem,
5089
5150
  onCancel,
5090
5151
  dynamicComponentsByCategory = {},
5091
- onAddComponent
5152
+ onAddComponent,
5153
+ children
5092
5154
  }) => {
5093
5155
  const { formatMessage } = useIntl();
5094
5156
  const formValues = useForm("DynamicComponent", (state) => state.values);
@@ -5125,6 +5187,14 @@ const DynamicComponent = ({
5125
5187
  React.useEffect(() => {
5126
5188
  dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
5127
5189
  }, [dragPreviewRef, index]);
5190
+ const accordionValue = React.useId();
5191
+ const { value = [], rawError } = useField(`${name2}.${index}`);
5192
+ const [collapseToOpen, setCollapseToOpen] = React.useState("");
5193
+ React.useEffect(() => {
5194
+ if (rawError && value) {
5195
+ setCollapseToOpen(accordionValue);
5196
+ }
5197
+ }, [rawError, value, accordionValue]);
5128
5198
  const composedBoxRefs = useComposedRefs(boxRef, dropRef);
5129
5199
  const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
5130
5200
  /* @__PURE__ */ jsx(
@@ -5190,10 +5260,9 @@ const DynamicComponent = ({
5190
5260
  ] })
5191
5261
  ] });
5192
5262
  const accordionTitle = title ? `${displayName} ${title}` : displayName;
5193
- const accordionValue = React.useId();
5194
5263
  return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
5195
5264
  /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
5196
- /* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
5265
+ /* @__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: [
5197
5266
  /* @__PURE__ */ jsxs(Accordion.Header, { children: [
5198
5267
  /* @__PURE__ */ jsx(
5199
5268
  Accordion.Trigger,
@@ -5204,21 +5273,39 @@ const DynamicComponent = ({
5204
5273
  ),
5205
5274
  /* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
5206
5275
  ] }),
5207
- /* @__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 }) => {
5208
- const fieldName = `${name2}.${index}.${field.name}`;
5209
- return /* @__PURE__ */ jsx(
5210
- Grid$1.Item,
5211
- {
5212
- col: size,
5213
- s: 12,
5214
- xs: 12,
5215
- direction: "column",
5216
- alignItems: "stretch",
5217
- children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName })
5218
- },
5219
- fieldName
5220
- );
5221
- }) }, rowInd)) }) }) })
5276
+ /* @__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(
5277
+ Grid$1.Item,
5278
+ {
5279
+ col: 12,
5280
+ s: 12,
5281
+ xs: 12,
5282
+ direction: "column",
5283
+ alignItems: "stretch",
5284
+ children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5285
+ const fieldName = `${name2}.${index}.${field.name}`;
5286
+ const fieldWithTranslatedLabel = {
5287
+ ...field,
5288
+ label: formatMessage({
5289
+ id: `content-manager.components.${componentUid}.${field.name}`,
5290
+ defaultMessage: field.label
5291
+ })
5292
+ };
5293
+ return /* @__PURE__ */ jsx(
5294
+ Grid$1.Item,
5295
+ {
5296
+ col: size,
5297
+ s: 12,
5298
+ xs: 12,
5299
+ direction: "column",
5300
+ alignItems: "stretch",
5301
+ children: children ? children({ ...fieldWithTranslatedLabel, name: fieldName }) : /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
5302
+ },
5303
+ fieldName
5304
+ );
5305
+ }) })
5306
+ },
5307
+ rowInd
5308
+ )) }) }) }) })
5222
5309
  ] }) }) })
5223
5310
  ] });
5224
5311
  };
@@ -5297,7 +5384,8 @@ const DynamicZone = ({
5297
5384
  label,
5298
5385
  labelAction,
5299
5386
  name: name2,
5300
- required = false
5387
+ required = false,
5388
+ children
5301
5389
  }) => {
5302
5390
  const { max = Infinity, min = -Infinity } = attribute ?? {};
5303
5391
  const [addComponentIsOpen, setAddComponentIsOpen] = React.useState(false);
@@ -5483,7 +5571,8 @@ const DynamicZone = ({
5483
5571
  onDropItem: handleDropItem,
5484
5572
  onGrabItem: handleGrabItem,
5485
5573
  onAddComponent: handleAddComponent,
5486
- dynamicComponentsByCategory
5574
+ dynamicComponentsByCategory,
5575
+ children
5487
5576
  }
5488
5577
  )
5489
5578
  },
@@ -5526,4 +5615,4 @@ export {
5526
5615
  transformDocument as t,
5527
5616
  useLazyComponents as u
5528
5617
  };
5529
- //# sourceMappingURL=Field-Dv_HTFTa.mjs.map
5618
+ //# sourceMappingURL=Field-Dltnt1km.mjs.map