@strapi/content-manager 0.0.0-experimental.826f263c58b6886b849d3f03b81f7a530bc51c91 → 0.0.0-experimental.8c83c87960f2f5ddf95ae2f0acf849052f4a9ab4

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 (223) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -1
  3. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -1
  4. package/dist/_chunks/{ComponentConfigurationPage-CR5XdR33.mjs → ComponentConfigurationPage-BgCLcjXO.mjs} +4 -4
  5. package/dist/_chunks/{ComponentConfigurationPage-CR5XdR33.mjs.map → ComponentConfigurationPage-BgCLcjXO.mjs.map} +1 -1
  6. package/dist/_chunks/{ComponentConfigurationPage-DJcn1DrO.js → ComponentConfigurationPage-DywpTZeV.js} +5 -6
  7. package/dist/_chunks/{ComponentConfigurationPage-DJcn1DrO.js.map → ComponentConfigurationPage-DywpTZeV.js.map} +1 -1
  8. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js → ComponentIcon-CRbtQEUV.js} +2 -3
  9. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js.map → ComponentIcon-CRbtQEUV.js.map} +1 -1
  10. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -1
  11. package/dist/_chunks/{EditConfigurationPage-DmCIb4kD.mjs → EditConfigurationPage-BNjOAHNS.mjs} +4 -4
  12. package/dist/_chunks/{EditConfigurationPage-DmCIb4kD.mjs.map → EditConfigurationPage-BNjOAHNS.mjs.map} +1 -1
  13. package/dist/_chunks/{EditConfigurationPage-tDtWj7R2.js → EditConfigurationPage-CxRlP5if.js} +5 -6
  14. package/dist/_chunks/{EditConfigurationPage-tDtWj7R2.js.map → EditConfigurationPage-CxRlP5if.js.map} +1 -1
  15. package/dist/_chunks/{EditViewPage-CoQEnFlC.js → EditViewPage-BRewdTqE.js} +101 -51
  16. package/dist/_chunks/EditViewPage-BRewdTqE.js.map +1 -0
  17. package/dist/_chunks/{EditViewPage-DvaV7U9b.mjs → EditViewPage-CD_hqc1J.mjs} +102 -51
  18. package/dist/_chunks/EditViewPage-CD_hqc1J.mjs.map +1 -0
  19. package/dist/_chunks/{Field-Cz_J9551.mjs → Field-BPkQ-3Ku.mjs} +631 -279
  20. package/dist/_chunks/Field-BPkQ-3Ku.mjs.map +1 -0
  21. package/dist/_chunks/{Field-ZdrmmQ4Y.js → Field-DwvmENVf.js} +634 -283
  22. package/dist/_chunks/Field-DwvmENVf.js.map +1 -0
  23. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
  24. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
  25. package/dist/_chunks/{Form-Bpig5rch.js → Form-C_Gwv8P_.js} +55 -38
  26. package/dist/_chunks/Form-C_Gwv8P_.js.map +1 -0
  27. package/dist/_chunks/{Form-Dxmihyw8.mjs → Form-Czi0cf_2.mjs} +55 -37
  28. package/dist/_chunks/Form-Czi0cf_2.mjs.map +1 -0
  29. package/dist/_chunks/{History-BfX6XmZK.js → History-C1TKAig-.js} +175 -129
  30. package/dist/_chunks/History-C1TKAig-.js.map +1 -0
  31. package/dist/_chunks/{History-BZP8n7KT.mjs → History-CIQHyi4T.mjs} +176 -129
  32. package/dist/_chunks/History-CIQHyi4T.mjs.map +1 -0
  33. package/dist/_chunks/{ListConfigurationPage-B3CXj8PY.js → ListConfigurationPage-D-NGRLYu.js} +62 -51
  34. package/dist/_chunks/ListConfigurationPage-D-NGRLYu.js.map +1 -0
  35. package/dist/_chunks/{ListConfigurationPage-DxKuVkKz.mjs → ListConfigurationPage-DcZsfyEL.mjs} +63 -52
  36. package/dist/_chunks/ListConfigurationPage-DcZsfyEL.mjs.map +1 -0
  37. package/dist/_chunks/{ListViewPage-D5D3tVPq.mjs → ListViewPage-C10McTK1.mjs} +152 -128
  38. package/dist/_chunks/ListViewPage-C10McTK1.mjs.map +1 -0
  39. package/dist/_chunks/{ListViewPage-Bk9VO__I.js → ListViewPage-xv5IQoZp.js} +155 -132
  40. package/dist/_chunks/ListViewPage-xv5IQoZp.js.map +1 -0
  41. package/dist/_chunks/{NoContentTypePage-DnMeuQCj.mjs → NoContentTypePage-CPc0Cd3S.mjs} +2 -2
  42. package/dist/_chunks/{NoContentTypePage-DnMeuQCj.mjs.map → NoContentTypePage-CPc0Cd3S.mjs.map} +1 -1
  43. package/dist/_chunks/{NoContentTypePage-DsB2F7Z1.js → NoContentTypePage-Dzw5Yj5u.js} +2 -2
  44. package/dist/_chunks/{NoContentTypePage-DsB2F7Z1.js.map → NoContentTypePage-Dzw5Yj5u.js.map} +1 -1
  45. package/dist/_chunks/{NoPermissionsPage-BQDM64_b.js → NoPermissionsPage-DAe5CDCC.js} +2 -2
  46. package/dist/_chunks/{NoPermissionsPage-BQDM64_b.js.map → NoPermissionsPage-DAe5CDCC.js.map} +1 -1
  47. package/dist/_chunks/{NoPermissionsPage-OyoME_Tf.mjs → NoPermissionsPage-wfPBh2_0.mjs} +2 -2
  48. package/dist/_chunks/{NoPermissionsPage-OyoME_Tf.mjs.map → NoPermissionsPage-wfPBh2_0.mjs.map} +1 -1
  49. package/dist/_chunks/Preview-B7LyGT_b.js +290 -0
  50. package/dist/_chunks/Preview-B7LyGT_b.js.map +1 -0
  51. package/dist/_chunks/Preview-BVFFm7uB.mjs +272 -0
  52. package/dist/_chunks/Preview-BVFFm7uB.mjs.map +1 -0
  53. package/dist/_chunks/{Relations-B6B3A3mb.js → Relations-BmYR1AjY.js} +76 -43
  54. package/dist/_chunks/Relations-BmYR1AjY.js.map +1 -0
  55. package/dist/_chunks/{Relations-BOYZmuWy.mjs → Relations-JPhWxk-s.mjs} +76 -42
  56. package/dist/_chunks/Relations-JPhWxk-s.mjs.map +1 -0
  57. package/dist/_chunks/{en-BN1bvFK7.js → en-BK8Xyl5I.js} +35 -18
  58. package/dist/_chunks/{en-BN1bvFK7.js.map → en-BK8Xyl5I.js.map} +1 -1
  59. package/dist/_chunks/{en-Dzv55oQw.mjs → en-Dtk_ot79.mjs} +35 -18
  60. package/dist/_chunks/{en-Dzv55oQw.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
  61. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  62. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  63. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  64. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  65. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  66. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  67. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  68. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  69. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
  70. package/dist/_chunks/{index-DzN3kBgx.js → index-C2Q_PLWj.js} +1165 -880
  71. package/dist/_chunks/index-C2Q_PLWj.js.map +1 -0
  72. package/dist/_chunks/{index-VHviNMeW.mjs → index-DLIkNVnQ.mjs} +1185 -900
  73. package/dist/_chunks/index-DLIkNVnQ.mjs.map +1 -0
  74. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  75. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  76. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  77. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  78. package/dist/_chunks/{layout-b91XRlD2.js → layout-7AsWJzZJ.js} +41 -24
  79. package/dist/_chunks/layout-7AsWJzZJ.js.map +1 -0
  80. package/dist/_chunks/{layout-CPn1PM6x.mjs → layout-qE8qkNH_.mjs} +42 -24
  81. package/dist/_chunks/layout-qE8qkNH_.mjs.map +1 -0
  82. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  83. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  84. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  85. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  86. package/dist/_chunks/{relations-BsqxS6tR.mjs → relations-BjHH_1Am.mjs} +6 -7
  87. package/dist/_chunks/relations-BjHH_1Am.mjs.map +1 -0
  88. package/dist/_chunks/{relations-CA7IYmcP.js → relations-EifVzf_2.js} +6 -7
  89. package/dist/_chunks/relations-EifVzf_2.js.map +1 -0
  90. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  91. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  92. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  93. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  94. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
  95. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
  96. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
  97. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
  98. package/dist/admin/index.js +2 -1
  99. package/dist/admin/index.js.map +1 -1
  100. package/dist/admin/index.mjs +8 -7
  101. package/dist/admin/src/exports.d.ts +1 -1
  102. package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
  103. package/dist/admin/src/history/index.d.ts +3 -0
  104. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  105. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  106. package/dist/admin/src/index.d.ts +1 -0
  107. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  108. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +8 -3
  109. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  110. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  111. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
  112. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  113. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  114. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +6 -58
  115. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  116. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  117. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  118. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  119. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  120. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  121. package/dist/admin/src/preview/constants.d.ts +1 -0
  122. package/dist/admin/src/preview/index.d.ts +4 -0
  123. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  124. package/dist/admin/src/preview/routes.d.ts +3 -0
  125. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  126. package/dist/admin/src/router.d.ts +1 -1
  127. package/dist/admin/src/services/api.d.ts +1 -1
  128. package/dist/admin/src/services/components.d.ts +2 -2
  129. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  130. package/dist/admin/src/services/documents.d.ts +19 -20
  131. package/dist/admin/src/services/init.d.ts +1 -1
  132. package/dist/admin/src/services/relations.d.ts +2 -2
  133. package/dist/admin/src/services/uid.d.ts +3 -3
  134. package/dist/admin/src/utils/validation.d.ts +4 -1
  135. package/dist/server/index.js +616 -299
  136. package/dist/server/index.js.map +1 -1
  137. package/dist/server/index.mjs +616 -298
  138. package/dist/server/index.mjs.map +1 -1
  139. package/dist/server/src/bootstrap.d.ts.map +1 -1
  140. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  141. package/dist/server/src/controllers/index.d.ts.map +1 -1
  142. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  143. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  144. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  145. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  146. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  147. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  148. package/dist/server/src/history/services/history.d.ts.map +1 -1
  149. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  150. package/dist/server/src/history/services/utils.d.ts +4 -4
  151. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  152. package/dist/server/src/index.d.ts +4 -4
  153. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  154. package/dist/server/src/preview/constants.d.ts +2 -0
  155. package/dist/server/src/preview/constants.d.ts.map +1 -0
  156. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  157. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  158. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  159. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  160. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  161. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  162. package/dist/server/src/preview/index.d.ts +4 -0
  163. package/dist/server/src/preview/index.d.ts.map +1 -0
  164. package/dist/server/src/preview/routes/index.d.ts +8 -0
  165. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  166. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  167. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  168. package/dist/server/src/preview/services/index.d.ts +16 -0
  169. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  170. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  171. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  172. package/dist/server/src/preview/services/preview.d.ts +12 -0
  173. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  174. package/dist/server/src/preview/utils.d.ts +19 -0
  175. package/dist/server/src/preview/utils.d.ts.map +1 -0
  176. package/dist/server/src/register.d.ts.map +1 -1
  177. package/dist/server/src/routes/index.d.ts.map +1 -1
  178. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  179. package/dist/server/src/services/document-metadata.d.ts +8 -8
  180. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  181. package/dist/server/src/services/index.d.ts +4 -4
  182. package/dist/server/src/services/index.d.ts.map +1 -1
  183. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  184. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  185. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  186. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  187. package/dist/server/src/utils/index.d.ts +2 -0
  188. package/dist/server/src/utils/index.d.ts.map +1 -1
  189. package/dist/shared/contracts/collection-types.d.ts +3 -1
  190. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  191. package/dist/shared/contracts/index.d.ts +1 -0
  192. package/dist/shared/contracts/index.d.ts.map +1 -1
  193. package/dist/shared/contracts/preview.d.ts +27 -0
  194. package/dist/shared/contracts/preview.d.ts.map +1 -0
  195. package/dist/shared/index.js +4 -0
  196. package/dist/shared/index.js.map +1 -1
  197. package/dist/shared/index.mjs +4 -0
  198. package/dist/shared/index.mjs.map +1 -1
  199. package/package.json +15 -15
  200. package/dist/_chunks/EditViewPage-CoQEnFlC.js.map +0 -1
  201. package/dist/_chunks/EditViewPage-DvaV7U9b.mjs.map +0 -1
  202. package/dist/_chunks/Field-Cz_J9551.mjs.map +0 -1
  203. package/dist/_chunks/Field-ZdrmmQ4Y.js.map +0 -1
  204. package/dist/_chunks/Form-Bpig5rch.js.map +0 -1
  205. package/dist/_chunks/Form-Dxmihyw8.mjs.map +0 -1
  206. package/dist/_chunks/History-BZP8n7KT.mjs.map +0 -1
  207. package/dist/_chunks/History-BfX6XmZK.js.map +0 -1
  208. package/dist/_chunks/ListConfigurationPage-B3CXj8PY.js.map +0 -1
  209. package/dist/_chunks/ListConfigurationPage-DxKuVkKz.mjs.map +0 -1
  210. package/dist/_chunks/ListViewPage-Bk9VO__I.js.map +0 -1
  211. package/dist/_chunks/ListViewPage-D5D3tVPq.mjs.map +0 -1
  212. package/dist/_chunks/Relations-B6B3A3mb.js.map +0 -1
  213. package/dist/_chunks/Relations-BOYZmuWy.mjs.map +0 -1
  214. package/dist/_chunks/index-DzN3kBgx.js.map +0 -1
  215. package/dist/_chunks/index-VHviNMeW.mjs.map +0 -1
  216. package/dist/_chunks/layout-CPn1PM6x.mjs.map +0 -1
  217. package/dist/_chunks/layout-b91XRlD2.js.map +0 -1
  218. package/dist/_chunks/relations-BsqxS6tR.mjs.map +0 -1
  219. package/dist/_chunks/relations-CA7IYmcP.js.map +0 -1
  220. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  221. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  222. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  223. package/strapi-server.js +0 -3
@@ -2,24 +2,24 @@ 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 { Typography, Flex, Box, BaseLink, Button, useComposedRefs, Popover, Field, Tooltip, SingleSelect, SingleSelectOption, IconButton, Portal, FocusTrap, Divider, VisuallyHidden, Grid as Grid$1, GridItem, 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 { l as DOCUMENT_META_FIELDS, g as getTranslation, b as useDoc, d as contentManagerApi, c as buildValidParams, e as useDocumentRBAC, m as useDocLayout } from "./index-VHviNMeW.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-DLIkNVnQ.mjs";
9
9
  import { generateNKeysBetween } from "fractional-indexing";
10
- import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-BOYZmuWy.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-JPhWxk-s.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 { p as prefixFileUrlWithBackendUrl, u as usePrev, a as useDebounce } from "./useDebounce-DmuSJIF3.mjs";
21
21
  import * as Toolbar from "@radix-ui/react-toolbar";
22
- import { useLocation } from "react-router-dom";
22
+ import { useLocation, useMatch } from "react-router-dom";
23
23
  import CodeMirror from "codemirror5";
24
24
  import sanitizeHtml from "sanitize-html";
25
25
  import { getLanguage, highlight, highlightAuto } from "highlight.js";
@@ -160,6 +160,220 @@ const useLazyComponents = (componentUids = []) => {
160
160
  }, []);
161
161
  return { isLazyLoading: loading, lazyComponentStore, cleanup };
162
162
  };
163
+ const codeLanguages = [
164
+ {
165
+ value: "asm",
166
+ label: "Assembly"
167
+ },
168
+ {
169
+ value: "bash",
170
+ label: "Bash"
171
+ },
172
+ {
173
+ value: "c",
174
+ label: "C"
175
+ },
176
+ {
177
+ value: "clojure",
178
+ label: "Clojure"
179
+ },
180
+ {
181
+ value: "cobol",
182
+ label: "COBOL"
183
+ },
184
+ {
185
+ value: "cpp",
186
+ label: "C++"
187
+ },
188
+ {
189
+ value: "csharp",
190
+ label: "C#"
191
+ },
192
+ {
193
+ value: "css",
194
+ label: "CSS"
195
+ },
196
+ {
197
+ value: "dart",
198
+ label: "Dart"
199
+ },
200
+ {
201
+ value: "dockerfile",
202
+ label: "Dockerfile"
203
+ },
204
+ {
205
+ value: "elixir",
206
+ label: "Elixir"
207
+ },
208
+ {
209
+ value: "erlang",
210
+ label: "Erlang"
211
+ },
212
+ {
213
+ value: "fortran",
214
+ label: "Fortran"
215
+ },
216
+ {
217
+ value: "fsharp",
218
+ label: "F#"
219
+ },
220
+ {
221
+ value: "go",
222
+ label: "Go"
223
+ },
224
+ {
225
+ value: "graphql",
226
+ label: "GraphQL"
227
+ },
228
+ {
229
+ value: "groovy",
230
+ label: "Groovy"
231
+ },
232
+ {
233
+ value: "haskell",
234
+ label: "Haskell"
235
+ },
236
+ {
237
+ value: "haxe",
238
+ label: "Haxe"
239
+ },
240
+ {
241
+ value: "html",
242
+ label: "HTML"
243
+ },
244
+ {
245
+ value: "ini",
246
+ label: "INI"
247
+ },
248
+ {
249
+ value: "java",
250
+ label: "Java"
251
+ },
252
+ {
253
+ value: "javascript",
254
+ label: "JavaScript"
255
+ },
256
+ {
257
+ value: "jsx",
258
+ label: "JavaScript (React)"
259
+ },
260
+ {
261
+ value: "json",
262
+ label: "JSON"
263
+ },
264
+ {
265
+ value: "julia",
266
+ label: "Julia"
267
+ },
268
+ {
269
+ value: "kotlin",
270
+ label: "Kotlin"
271
+ },
272
+ {
273
+ value: "latex",
274
+ label: "LaTeX"
275
+ },
276
+ {
277
+ value: "lua",
278
+ label: "Lua"
279
+ },
280
+ {
281
+ value: "markdown",
282
+ label: "Markdown"
283
+ },
284
+ {
285
+ value: "matlab",
286
+ label: "MATLAB"
287
+ },
288
+ {
289
+ value: "makefile",
290
+ label: "Makefile"
291
+ },
292
+ {
293
+ value: "objectivec",
294
+ label: "Objective-C"
295
+ },
296
+ {
297
+ value: "perl",
298
+ label: "Perl"
299
+ },
300
+ {
301
+ value: "php",
302
+ label: "PHP"
303
+ },
304
+ {
305
+ value: "plaintext",
306
+ label: "Plain text"
307
+ },
308
+ {
309
+ value: "powershell",
310
+ label: "PowerShell"
311
+ },
312
+ {
313
+ value: "python",
314
+ label: "Python"
315
+ },
316
+ {
317
+ value: "r",
318
+ label: "R"
319
+ },
320
+ {
321
+ value: "ruby",
322
+ label: "Ruby"
323
+ },
324
+ {
325
+ value: "rust",
326
+ label: "Rust"
327
+ },
328
+ {
329
+ value: "sas",
330
+ label: "SAS"
331
+ },
332
+ {
333
+ value: "scala",
334
+ label: "Scala"
335
+ },
336
+ {
337
+ value: "scheme",
338
+ label: "Scheme"
339
+ },
340
+ {
341
+ value: "shell",
342
+ label: "Shell"
343
+ },
344
+ {
345
+ value: "sql",
346
+ label: "SQL"
347
+ },
348
+ {
349
+ value: "stata",
350
+ label: "Stata"
351
+ },
352
+ {
353
+ value: "swift",
354
+ label: "Swift"
355
+ },
356
+ {
357
+ value: "typescript",
358
+ label: "TypeScript"
359
+ },
360
+ {
361
+ value: "tsx",
362
+ label: "TypeScript (React)"
363
+ },
364
+ {
365
+ value: "vbnet",
366
+ label: "VB.NET"
367
+ },
368
+ {
369
+ value: "xml",
370
+ label: "XML"
371
+ },
372
+ {
373
+ value: "yaml",
374
+ label: "YAML"
375
+ }
376
+ ];
163
377
  const baseHandleConvert = (editor, attributesToSet) => {
164
378
  const [_, lastNodePath] = Editor$1.last(editor, []);
165
379
  Transforms.unwrapNodes(editor, {
@@ -230,6 +444,7 @@ const CodeBlock = styled.pre`
230
444
  overflow: auto;
231
445
  padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};
232
446
  flex-shrink: 1;
447
+
233
448
  & > code {
234
449
  font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas,
235
450
  monospace;
@@ -238,10 +453,62 @@ const CodeBlock = styled.pre`
238
453
  max-width: 100%;
239
454
  }
240
455
  `;
456
+ const CodeEditor = (props) => {
457
+ const { editor } = useBlocksEditorContext("ImageDialog");
458
+ const editorIsFocused = useFocused();
459
+ const imageIsSelected = useSelected();
460
+ const { formatMessage } = useIntl();
461
+ const [isSelectOpen, setIsSelectOpen] = React.useState(false);
462
+ const shouldDisplayLanguageSelect = editorIsFocused && imageIsSelected || isSelectOpen;
463
+ return /* @__PURE__ */ jsxs(Box, { position: "relative", width: "100%", children: [
464
+ /* @__PURE__ */ jsx(CodeBlock, { ...props.attributes, children: /* @__PURE__ */ jsx("code", { children: props.children }) }),
465
+ shouldDisplayLanguageSelect && /* @__PURE__ */ jsx(
466
+ Box,
467
+ {
468
+ position: "absolute",
469
+ background: "neutral0",
470
+ borderColor: "neutral150",
471
+ borderStyle: "solid",
472
+ borderWidth: "0.5px",
473
+ shadow: "tableShadow",
474
+ top: "100%",
475
+ marginTop: 1,
476
+ right: 0,
477
+ padding: 1,
478
+ hasRadius: true,
479
+ children: /* @__PURE__ */ jsx(
480
+ SingleSelect,
481
+ {
482
+ onChange: (open) => {
483
+ Transforms.setNodes(
484
+ editor,
485
+ { language: open.toString() },
486
+ { match: (node) => !Editor$1.isEditor(node) && node.type === "code" }
487
+ );
488
+ },
489
+ value: props.element.type === "code" && props.element.language || "plaintext",
490
+ onOpenChange: (open) => {
491
+ setIsSelectOpen(open);
492
+ if (!open) {
493
+ ReactEditor.focus(editor);
494
+ }
495
+ },
496
+ onCloseAutoFocus: (e) => e.preventDefault(),
497
+ "aria-label": formatMessage({
498
+ id: "components.Blocks.blocks.code.languageLabel",
499
+ defaultMessage: "Select a language"
500
+ }),
501
+ children: codeLanguages.map(({ value, label }) => /* @__PURE__ */ jsx(SingleSelectOption, { value, children: label }, value))
502
+ }
503
+ )
504
+ }
505
+ )
506
+ ] });
507
+ };
241
508
  const codeBlocks = {
242
509
  code: {
243
- renderElement: (props) => /* @__PURE__ */ jsx(CodeBlock, { ...props.attributes, children: /* @__PURE__ */ jsx("code", { children: props.children }) }),
244
- icon: Code,
510
+ renderElement: (props) => /* @__PURE__ */ jsx(CodeEditor, { ...props }),
511
+ icon: CodeBlock$1,
245
512
  label: {
246
513
  id: "components.Blocks.blocks.code",
247
514
  defaultMessage: "Code block"
@@ -249,7 +516,7 @@ const codeBlocks = {
249
516
  matchNode: (node) => node.type === "code",
250
517
  isInBlocksSelector: true,
251
518
  handleConvert(editor) {
252
- baseHandleConvert(editor, { type: "code" });
519
+ baseHandleConvert(editor, { type: "code", language: "plaintext" });
253
520
  },
254
521
  handleEnterKey(editor) {
255
522
  pressEnterTwiceToExit(editor);
@@ -430,8 +697,7 @@ const ImageDialog = () => {
430
697
  const [isOpen, setIsOpen] = React.useState(true);
431
698
  const { editor } = useBlocksEditorContext("ImageDialog");
432
699
  const components = useStrapiApp("ImageDialog", (state) => state.components);
433
- if (!components || !isOpen)
434
- return null;
700
+ if (!components || !isOpen) return null;
435
701
  const MediaLibraryDialog = components["media-library"];
436
702
  const insertImages = (images) => {
437
703
  Transforms.unwrapNodes(editor, {
@@ -440,14 +706,12 @@ const ImageDialog = () => {
440
706
  });
441
707
  const nodeEntryBeingReplaced = Editor$1.above(editor, {
442
708
  match(node) {
443
- if (Editor$1.isEditor(node))
444
- return false;
709
+ if (Editor$1.isEditor(node)) return false;
445
710
  const isInlineNode = ["text", "link"].includes(node.type);
446
711
  return !isInlineNode;
447
712
  }
448
713
  });
449
- if (!nodeEntryBeingReplaced)
450
- return;
714
+ if (!nodeEntryBeingReplaced) return;
451
715
  const [, pathToInsert] = nodeEntryBeingReplaced;
452
716
  Transforms.removeNodes(editor);
453
717
  const nodesToInsert = images.map((image) => {
@@ -589,18 +853,12 @@ const LinkContent = React.forwardRef(
589
853
  const [popoverOpen, setPopoverOpen] = React.useState(
590
854
  editor.lastInsertedLinkPath ? Path.equals(path, editor.lastInsertedLinkPath) : false
591
855
  );
592
- const linkRef = React.useRef(null);
593
856
  const elementText = link.children.map((child) => child.text).join("");
594
857
  const [linkText, setLinkText] = React.useState(elementText);
595
858
  const [linkUrl, setLinkUrl] = React.useState(link.url);
596
859
  const linkInputRef = React.useRef(null);
597
- const [showRemoveButton, setShowRemoveButton] = React.useState(false);
860
+ const isLastInsertedLink = editor.lastInsertedLinkPath ? !Path.equals(path, editor.lastInsertedLinkPath) : true;
598
861
  const [isSaveDisabled, setIsSaveDisabled] = React.useState(false);
599
- const handleOpenEditPopover = (e) => {
600
- e.preventDefault();
601
- setPopoverOpen(true);
602
- setShowRemoveButton(true);
603
- };
604
862
  const onLinkChange = (e) => {
605
863
  setIsSaveDisabled(false);
606
864
  setLinkUrl(e.target.value);
@@ -621,33 +879,32 @@ const LinkContent = React.forwardRef(
621
879
  editLink(editor, { url: linkUrl, text: linkText });
622
880
  setPopoverOpen(false);
623
881
  editor.lastInsertedLinkPath = null;
882
+ ReactEditor.focus(editor);
624
883
  };
625
- const handleDismiss = () => {
626
- setPopoverOpen(false);
884
+ const handleClose = () => {
627
885
  if (link.url === "") {
628
886
  removeLink(editor);
629
887
  }
888
+ setPopoverOpen(false);
630
889
  ReactEditor.focus(editor);
631
890
  };
632
- const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
633
- const composedRefs = useComposedRefs(linkRef, forwardedRef);
634
891
  React.useEffect(() => {
635
- if (popoverOpen)
636
- linkInputRef.current?.focus();
892
+ if (popoverOpen) linkInputRef.current?.focus();
637
893
  }, [popoverOpen]);
638
- return /* @__PURE__ */ jsxs(Fragment, { children: [
639
- /* @__PURE__ */ jsx(
894
+ const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
895
+ return /* @__PURE__ */ jsxs(Popover.Root, { open: popoverOpen, children: [
896
+ /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
640
897
  StyledBaseLink,
641
898
  {
642
899
  ...attributes,
643
- ref: composedRefs,
900
+ ref: forwardedRef,
644
901
  href: link.url,
645
- onClick: handleOpenEditPopover,
902
+ onClick: () => setPopoverOpen(true),
646
903
  color: "primary600",
647
904
  children
648
905
  }
649
- ),
650
- popoverOpen && /* @__PURE__ */ jsx(Popover, { source: linkRef, onDismiss: handleDismiss, padding: 4, contentEditable: false, children: /* @__PURE__ */ jsxs(Flex, { tag: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
906
+ ) }),
907
+ /* @__PURE__ */ jsx(Popover.Content, { onPointerDownOutside: handleClose, children: /* @__PURE__ */ jsxs(Flex, { padding: 4, direction: "column", gap: 4, children: [
651
908
  /* @__PURE__ */ jsx(Field.Root, { width: "368px", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
652
909
  /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
653
910
  id: "components.Blocks.popover.text",
@@ -693,7 +950,7 @@ const LinkContent = React.forwardRef(
693
950
  {
694
951
  variant: "danger-light",
695
952
  onClick: () => removeLink(editor),
696
- $visible: showRemoveButton,
953
+ $visible: isLastInsertedLink,
697
954
  children: formatMessage({
698
955
  id: "components.Blocks.popover.remove",
699
956
  defaultMessage: "Remove"
@@ -701,11 +958,11 @@ const LinkContent = React.forwardRef(
701
958
  }
702
959
  ),
703
960
  /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
704
- /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleDismiss, children: formatMessage({
961
+ /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
705
962
  id: "components.Blocks.popover.cancel",
706
963
  defaultMessage: "Cancel"
707
964
  }) }),
708
- /* @__PURE__ */ jsx(Button, { type: "submit", disabled: Boolean(inputNotDirty) || isSaveDisabled, children: formatMessage({
965
+ /* @__PURE__ */ jsx(Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
709
966
  id: "components.Blocks.popover.save",
710
967
  defaultMessage: "Save"
711
968
  }) })
@@ -787,8 +1044,7 @@ const isText$1 = (node) => {
787
1044
  return Node.isNode(node) && !Editor$1.isEditor(node) && node.type === "text";
788
1045
  };
789
1046
  const handleBackspaceKeyOnList = (editor, event) => {
790
- if (!editor.selection)
791
- return;
1047
+ if (!editor.selection) return;
792
1048
  const [currentListItem, currentListItemPath] = Editor$1.parent(editor, editor.selection.anchor);
793
1049
  const [currentList, currentListPath] = Editor$1.parent(editor, currentListItemPath);
794
1050
  const isListEmpty = currentList.children.length === 1 && isText$1(currentListItem.children[0]) && currentListItem.children[0].text === "";
@@ -897,8 +1153,7 @@ const handleEnterKeyOnList = (editor) => {
897
1153
  };
898
1154
  const handleConvertToList = (editor, format) => {
899
1155
  const convertedPath = baseHandleConvert(editor, { type: "list-item" });
900
- if (!convertedPath)
901
- return;
1156
+ if (!convertedPath) return;
902
1157
  Transforms.wrapNodes(editor, { type: "list", format, children: [] }, { at: convertedPath });
903
1158
  };
904
1159
  const handleTabOnList = (editor) => {
@@ -910,8 +1165,7 @@ const handleTabOnList = (editor) => {
910
1165
  }
911
1166
  const [currentListItem, currentListItemPath] = currentListItemEntry;
912
1167
  const [currentList] = Editor$1.parent(editor, currentListItemPath);
913
- if (currentListItem === currentList.children[0])
914
- return;
1168
+ if (currentListItem === currentList.children[0]) return;
915
1169
  const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);
916
1170
  const previousNode = currentList.children[currentListItemIndex - 1];
917
1171
  if (previousNode.type === "list") {
@@ -1146,7 +1400,7 @@ const ToolbarButton = ({
1146
1400
  width: 7,
1147
1401
  height: 7,
1148
1402
  hasRadius: true,
1149
- children: /* @__PURE__ */ jsx(Icon, { width: "1.2rem", height: "1.2rem", fill: disabled ? "neutral300" : enabledColor })
1403
+ children: /* @__PURE__ */ jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
1150
1404
  }
1151
1405
  )
1152
1406
  }
@@ -1278,8 +1532,7 @@ const isListNode = (node) => {
1278
1532
  const ListButton = ({ block, format }) => {
1279
1533
  const { editor, disabled, blocks } = useBlocksEditorContext("ListButton");
1280
1534
  const isListActive = () => {
1281
- if (!editor.selection)
1282
- return false;
1535
+ if (!editor.selection) return false;
1283
1536
  const currentListEntry = Editor$1.above(editor, {
1284
1537
  match: (node) => !Editor$1.isEditor(node) && node.type === "list",
1285
1538
  at: editor.selection.anchor
@@ -1291,6 +1544,26 @@ const ListButton = ({ block, format }) => {
1291
1544
  }
1292
1545
  return false;
1293
1546
  };
1547
+ const isListDisabled = () => {
1548
+ if (disabled) {
1549
+ return true;
1550
+ }
1551
+ if (!editor.selection) {
1552
+ return false;
1553
+ }
1554
+ const anchorNodeEntry = Editor$1.above(editor, {
1555
+ at: editor.selection.anchor,
1556
+ match: (node) => !Editor$1.isEditor(node) && node.type !== "text"
1557
+ });
1558
+ const focusNodeEntry = Editor$1.above(editor, {
1559
+ at: editor.selection.focus,
1560
+ match: (node) => !Editor$1.isEditor(node) && node.type !== "text"
1561
+ });
1562
+ if (!anchorNodeEntry || !focusNodeEntry) {
1563
+ return false;
1564
+ }
1565
+ return anchorNodeEntry[0] !== focusNodeEntry[0];
1566
+ };
1294
1567
  const toggleList = (format2) => {
1295
1568
  let currentListEntry;
1296
1569
  if (editor.selection) {
@@ -1324,7 +1597,7 @@ const ListButton = ({ block, format }) => {
1324
1597
  name: format,
1325
1598
  label: block.label,
1326
1599
  isActive: isListActive(),
1327
- disabled,
1600
+ disabled: isListDisabled(),
1328
1601
  handleClick: () => toggleList(format)
1329
1602
  }
1330
1603
  );
@@ -1333,8 +1606,7 @@ const LinkButton = ({ disabled }) => {
1333
1606
  const { editor } = useBlocksEditorContext("LinkButton");
1334
1607
  const isLinkActive = () => {
1335
1608
  const { selection } = editor;
1336
- if (!selection)
1337
- return false;
1609
+ if (!selection) return false;
1338
1610
  const [match] = Array.from(
1339
1611
  Editor$1.nodes(editor, {
1340
1612
  at: Editor$1.unhangRange(editor, selection),
@@ -1468,6 +1740,7 @@ const DragItem = styled(Flex)`
1468
1740
  }
1469
1741
  `;
1470
1742
  const DragIconButton = styled(IconButton)`
1743
+ user-select: none;
1471
1744
  display: flex;
1472
1745
  align-items: center;
1473
1746
  justify-content: center;
@@ -1491,7 +1764,7 @@ const DragIconButton = styled(IconButton)`
1491
1764
  }
1492
1765
  svg {
1493
1766
  height: auto;
1494
- width: ${({ theme }) => theme.spaces[3]};
1767
+ min-width: ${({ theme }) => theme.spaces[3]};
1495
1768
 
1496
1769
  path {
1497
1770
  fill: ${({ theme }) => theme.colors.neutral700};
@@ -1539,8 +1812,7 @@ const DragAndDropElement = ({
1539
1812
  displayedValue: children
1540
1813
  },
1541
1814
  onDropItem(currentIndex, newIndex) {
1542
- if (newIndex)
1543
- handleMoveBlock(newIndex, currentIndex);
1815
+ if (newIndex) handleMoveBlock(newIndex, currentIndex);
1544
1816
  }
1545
1817
  });
1546
1818
  const composedBoxRefs = useComposedRefs(blockRef, dropRef);
@@ -1596,6 +1868,7 @@ const DragAndDropElement = ({
1596
1868
  DragIconButton,
1597
1869
  {
1598
1870
  tag: "div",
1871
+ contentEditable: false,
1599
1872
  role: "button",
1600
1873
  tabIndex: 0,
1601
1874
  withTooltip: false,
@@ -1608,7 +1881,7 @@ const DragAndDropElement = ({
1608
1881
  disabled,
1609
1882
  draggable: true,
1610
1883
  $dragHandleTopMargin: dragHandleTopMargin,
1611
- children: /* @__PURE__ */ jsx(Drag, { color: "neutral600" })
1884
+ children: /* @__PURE__ */ jsx(Drag, { color: "primary500" })
1612
1885
  }
1613
1886
  ),
1614
1887
  children
@@ -1683,8 +1956,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
1683
1956
  [modifiers2]
1684
1957
  );
1685
1958
  const handleMoveBlocks = (editor2, event) => {
1686
- if (!editor2.selection)
1687
- return;
1959
+ if (!editor2.selection) return;
1688
1960
  const start = Range.start(editor2.selection);
1689
1961
  const currentIndex = [start.path[0]];
1690
1962
  let newIndexPosition = 0;
@@ -1821,8 +2093,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
1821
2093
  }
1822
2094
  };
1823
2095
  const handleScrollSelectionIntoView = () => {
1824
- if (!editor.selection)
1825
- return;
2096
+ if (!editor.selection) return;
1826
2097
  const domRange = ReactEditor.toDOMRange(editor, editor.selection);
1827
2098
  const domRect = domRange.getBoundingClientRect();
1828
2099
  const blocksInput = blocksRef.current;
@@ -1932,7 +2203,7 @@ const EditorLayout$1 = ({
1932
2203
  /* @__PURE__ */ jsx(
1933
2204
  CollapseIconButton,
1934
2205
  {
1935
- "aria-label": formatMessage({
2206
+ label: formatMessage({
1936
2207
  id: getTranslation("components.Blocks.collapse"),
1937
2208
  defaultMessage: "Collapse"
1938
2209
  }),
@@ -2016,8 +2287,7 @@ const InlineCode = styled.code`
2016
2287
  `;
2017
2288
  const baseCheckIsActive = (editor, name2) => {
2018
2289
  const marks = Editor$1.marks(editor);
2019
- if (!marks)
2020
- return false;
2290
+ if (!marks) return false;
2021
2291
  return Boolean(marks[name2]);
2022
2292
  };
2023
2293
  const baseHandleToggle = (editor, name2) => {
@@ -2271,7 +2541,7 @@ const BlocksEditor = React.forwardRef(
2271
2541
  !isExpandedMode && /* @__PURE__ */ jsx(
2272
2542
  ExpandIconButton,
2273
2543
  {
2274
- "aria-label": formatMessage({
2544
+ label: formatMessage({
2275
2545
  id: getTranslation("components.Blocks.expand"),
2276
2546
  defaultMessage: "Expand"
2277
2547
  }),
@@ -2337,47 +2607,44 @@ const createDefaultForm = (contentType, components = {}) => {
2337
2607
  const Initializer = ({ disabled, name: name2, onClick }) => {
2338
2608
  const { formatMessage } = useIntl();
2339
2609
  const field = useField(name2);
2340
- return /* @__PURE__ */ jsxs(Fragment, { children: [
2341
- /* @__PURE__ */ jsx(
2342
- Box,
2343
- {
2344
- tag: "button",
2345
- background: "neutral100",
2346
- borderColor: field.error ? "danger600" : "neutral200",
2347
- hasRadius: true,
2348
- disabled,
2349
- onClick,
2350
- paddingTop: 9,
2351
- paddingBottom: 9,
2352
- type: "button",
2353
- children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
2354
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(CircleIcon, {}) }),
2355
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2356
- id: getTranslation("components.empty-repeatable"),
2357
- defaultMessage: "No entry yet. Click on the button below to add one."
2358
- }) }) })
2359
- ] })
2360
- }
2361
- ),
2362
- field.error && /* @__PURE__ */ jsx(Typography, { textColor: "danger600", variant: "pi", children: field.error })
2363
- ] });
2610
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2611
+ Box,
2612
+ {
2613
+ tag: "button",
2614
+ background: disabled ? "neutral150" : "neutral100",
2615
+ borderColor: field.error ? "danger600" : "neutral200",
2616
+ hasRadius: true,
2617
+ disabled,
2618
+ onClick,
2619
+ paddingTop: 9,
2620
+ paddingBottom: 9,
2621
+ type: "button",
2622
+ style: { cursor: disabled ? "not-allowed" : "pointer" },
2623
+ children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
2624
+ /* @__PURE__ */ jsx(Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsx(PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
2625
+ /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
2626
+ Typography,
2627
+ {
2628
+ textColor: disabled ? "neutral600" : "primary600",
2629
+ variant: "pi",
2630
+ fontWeight: "bold",
2631
+ children: formatMessage({
2632
+ id: getTranslation("components.empty-repeatable"),
2633
+ defaultMessage: "No entry yet. Click to add one."
2634
+ })
2635
+ }
2636
+ ) })
2637
+ ] })
2638
+ }
2639
+ ) });
2364
2640
  };
2365
- const CircleIcon = styled(PlusCircle)`
2366
- width: 2.4rem;
2367
- height: 2.4rem;
2368
- > circle {
2369
- fill: ${({ theme }) => theme.colors.primary200};
2370
- }
2371
- > path {
2372
- fill: ${({ theme }) => theme.colors.primary600};
2373
- }
2374
- `;
2375
2641
  const NonRepeatableComponent = ({
2376
2642
  attribute,
2377
2643
  name: name2,
2378
2644
  children,
2379
2645
  layout
2380
2646
  }) => {
2647
+ const { formatMessage } = useIntl();
2381
2648
  const { value } = useField(name2);
2382
2649
  const level = useComponent("NonRepeatableComponent", (state) => state.level);
2383
2650
  const isNested = level > 0;
@@ -2392,9 +2659,24 @@ const NonRepeatableComponent = ({
2392
2659
  hasRadius: isNested,
2393
2660
  borderColor: isNested ? "neutral200" : void 0,
2394
2661
  children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
2395
- return /* @__PURE__ */ jsx(Grid$1, { gap: 4, children: row.map(({ size, ...field }) => {
2662
+ return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2396
2663
  const completeFieldName = `${name2}.${field.name}`;
2397
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2664
+ const translatedLabel = formatMessage({
2665
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2666
+ defaultMessage: field.label
2667
+ });
2668
+ return /* @__PURE__ */ jsx(
2669
+ Grid$1.Item,
2670
+ {
2671
+ col: size,
2672
+ s: 12,
2673
+ xs: 12,
2674
+ direction: "column",
2675
+ alignItems: "stretch",
2676
+ children: children({ ...field, label: translatedLabel, name: completeFieldName })
2677
+ },
2678
+ completeFieldName
2679
+ );
2398
2680
  }) }, index);
2399
2681
  }) })
2400
2682
  }
@@ -2413,13 +2695,34 @@ const RepeatableComponent = ({
2413
2695
  const { search: searchString } = useLocation();
2414
2696
  const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
2415
2697
  const { components } = useDoc();
2416
- const { value = [], error } = useField(name2);
2698
+ const {
2699
+ value = [],
2700
+ error,
2701
+ rawError
2702
+ } = useField(name2);
2417
2703
  const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
2418
2704
  const moveFieldRow = useForm("RepeatableComponent", (state) => state.moveFieldRow);
2419
2705
  const removeFieldRow = useForm("RepeatableComponent", (state) => state.removeFieldRow);
2420
2706
  const { max = Infinity } = attribute;
2421
2707
  const [collapseToOpen, setCollapseToOpen] = React.useState("");
2422
2708
  const [liveText, setLiveText] = React.useState("");
2709
+ React.useEffect(() => {
2710
+ const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
2711
+ const hasNestedValue = value && Array.isArray(value) && value.length > 0;
2712
+ if (hasNestedErrors && hasNestedValue) {
2713
+ const errorOpenItems = rawError.map((_, idx) => {
2714
+ return value[idx] ? value[idx].__temp_key__ : null;
2715
+ }).filter((value2) => !!value2);
2716
+ if (errorOpenItems && errorOpenItems.length > 0) {
2717
+ setCollapseToOpen((collapseToOpen2) => {
2718
+ if (!errorOpenItems.includes(collapseToOpen2)) {
2719
+ return errorOpenItems[0];
2720
+ }
2721
+ return collapseToOpen2;
2722
+ });
2723
+ }
2724
+ }
2725
+ }, [rawError, value]);
2423
2726
  const componentTmpKeyWithFocussedField = React.useMemo(() => {
2424
2727
  if (search.has("field")) {
2425
2728
  const fieldParam = search.get("field");
@@ -2570,9 +2873,28 @@ const RepeatableComponent = ({
2570
2873
  onGrabItem: handleGrabItem,
2571
2874
  __temp_key__: key,
2572
2875
  children: layout.map((row, index2) => {
2573
- return /* @__PURE__ */ jsx(Grid$1, { gap: 4, children: row.map(({ size, ...field }) => {
2876
+ return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2574
2877
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2575
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2878
+ const translatedLabel = formatMessage({
2879
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2880
+ defaultMessage: field.label
2881
+ });
2882
+ return /* @__PURE__ */ jsx(
2883
+ Grid$1.Item,
2884
+ {
2885
+ col: size,
2886
+ s: 12,
2887
+ xs: 12,
2888
+ direction: "column",
2889
+ alignItems: "stretch",
2890
+ children: children({
2891
+ ...field,
2892
+ label: translatedLabel,
2893
+ name: completeFieldName
2894
+ })
2895
+ },
2896
+ completeFieldName
2897
+ );
2576
2898
  }) }, index2);
2577
2899
  })
2578
2900
  }
@@ -2617,7 +2939,7 @@ const TextButtonCustom = styled(TextButton)`
2617
2939
  }
2618
2940
 
2619
2941
  @media (prefers-reduced-motion: no-preference) {
2620
- transition: background-color 120ms ${(props) => props.theme.easings.easeOutQuad};
2942
+ transition: background-color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};
2621
2943
  }
2622
2944
  `;
2623
2945
  const Component = ({
@@ -2667,7 +2989,7 @@ const Component = ({
2667
2989
  /* @__PURE__ */ jsx(
2668
2990
  IconButton,
2669
2991
  {
2670
- borderWidth: 0,
2992
+ variant: "ghost",
2671
2993
  onClick: onDeleteComponent,
2672
2994
  label: formatMessage({
2673
2995
  id: getTranslation("containers.Edit.delete"),
@@ -2680,7 +3002,7 @@ const Component = ({
2680
3002
  IconButton,
2681
3003
  {
2682
3004
  ref: composedAccordionRefs,
2683
- borderWidth: 0,
3005
+ variant: "ghost",
2684
3006
  onClick: (e) => e.stopPropagation(),
2685
3007
  "data-handler-id": handlerId,
2686
3008
  label: formatMessage({
@@ -2750,7 +3072,7 @@ const ComponentInput = ({
2750
3072
  id: getTranslation("components.reset-entry"),
2751
3073
  defaultMessage: "Reset Entry"
2752
3074
  }),
2753
- borderWidth: 0,
3075
+ variant: "ghost",
2754
3076
  onClick: () => {
2755
3077
  field.onChange(name2, null);
2756
3078
  },
@@ -2779,11 +3101,8 @@ const AddComponentButton = ({
2779
3101
  onClick,
2780
3102
  disabled: isDisabled,
2781
3103
  background: "neutral0",
2782
- paddingTop: 3,
2783
- paddingBottom: 3,
2784
- paddingLeft: 4,
2785
- paddingRight: 4,
2786
3104
  style: { cursor: isDisabled ? "not-allowed" : "pointer" },
3105
+ variant: "tertiary",
2787
3106
  children: /* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 2, children: [
2788
3107
  /* @__PURE__ */ jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
2789
3108
  /* @__PURE__ */ jsx(
@@ -2812,10 +3131,11 @@ const StyledAddIcon = styled(PlusCircle)`
2812
3131
  }
2813
3132
  `;
2814
3133
  const AddComponentTitle = styled(Typography)``;
2815
- const StyledButton = styled(BaseButton)`
3134
+ const StyledButton = styled(Button)`
2816
3135
  border-radius: 26px;
2817
3136
  border-color: ${({ theme }) => theme.colors.neutral150};
2818
3137
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
3138
+ height: 5rem;
2819
3139
 
2820
3140
  &:hover {
2821
3141
  ${AddComponentTitle} {
@@ -2827,7 +3147,7 @@ const StyledButton = styled(BaseButton)`
2827
3147
  fill: ${({ theme }) => theme.colors.primary600};
2828
3148
  }
2829
3149
  > path {
2830
- fill: ${({ theme }) => theme.colors.neutral100};
3150
+ fill: ${({ theme }) => theme.colors.primary600};
2831
3151
  }
2832
3152
  }
2833
3153
  }
@@ -2885,7 +3205,7 @@ const ComponentBox = styled(Flex)`
2885
3205
  cursor: pointer;
2886
3206
 
2887
3207
  @media (prefers-reduced-motion: no-preference) {
2888
- transition: color 120ms ${(props) => props.theme.easings.easeOutQuad};
3208
+ transition: color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};
2889
3209
  }
2890
3210
 
2891
3211
  &:focus,
@@ -2958,18 +3278,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
2958
3278
  /* @__PURE__ */ jsx(Field.Hint, {})
2959
3279
  ] });
2960
3280
  };
2961
- function useDebounce(value, delay) {
2962
- const [debouncedValue, setDebouncedValue] = useState(value);
2963
- useEffect(() => {
2964
- const handler = setTimeout(() => {
2965
- setDebouncedValue(value);
2966
- }, delay);
2967
- return () => {
2968
- clearTimeout(handler);
2969
- };
2970
- }, [value, delay]);
2971
- return debouncedValue;
2972
- }
2973
3281
  const uidApi = contentManagerApi.injectEndpoints({
2974
3282
  endpoints: (builder) => ({
2975
3283
  getDefaultUID: builder.query({
@@ -3004,7 +3312,10 @@ const uidApi = contentManagerApi.injectEndpoints({
3004
3312
  config: {
3005
3313
  params
3006
3314
  }
3007
- })
3315
+ }),
3316
+ providesTags: (_res, _error, params) => [
3317
+ { type: "UidAvailability", id: params.contentTypeUID }
3318
+ ]
3008
3319
  })
3009
3320
  })
3010
3321
  });
@@ -3016,8 +3327,10 @@ const UIDInput = React.forwardRef(
3016
3327
  const allFormValues = useForm("InputUID", (form) => form.values);
3017
3328
  const [availability, setAvailability] = React.useState();
3018
3329
  const [showRegenerate, setShowRegenerate] = React.useState(false);
3330
+ const isCloning = useMatch(CLONE_PATH) !== null;
3019
3331
  const field = useField(name2);
3020
3332
  const debouncedValue = useDebounce(field.value, 300);
3333
+ const hasChanged = debouncedValue !== field.initialValue;
3021
3334
  const { toggleNotification } = useNotification();
3022
3335
  const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
3023
3336
  const { formatMessage } = useIntl();
@@ -3093,8 +3406,9 @@ const UIDInput = React.forwardRef(
3093
3406
  params
3094
3407
  },
3095
3408
  {
3409
+ // Don't check availability if the value is empty or wasn't changed
3096
3410
  skip: !Boolean(
3097
- debouncedValue !== field.initialValue && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3411
+ (hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3098
3412
  )
3099
3413
  }
3100
3414
  );
@@ -3123,6 +3437,7 @@ const UIDInput = React.forwardRef(
3123
3437
  const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
3124
3438
  const fieldRef = useFocusInputField(name2);
3125
3439
  const composedRefs = useComposedRefs(ref, fieldRef);
3440
+ const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
3126
3441
  return /* @__PURE__ */ jsxs(Field.Root, { hint, name: name2, error: field.error, required, children: [
3127
3442
  /* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
3128
3443
  /* @__PURE__ */ jsx(
@@ -3131,7 +3446,7 @@ const UIDInput = React.forwardRef(
3131
3446
  ref: composedRefs,
3132
3447
  disabled: props.disabled,
3133
3448
  endAction: /* @__PURE__ */ jsxs(Flex, { position: "relative", gap: 1, children: [
3134
- availability && !showRegenerate && /* @__PURE__ */ jsxs(
3449
+ shouldShowAvailability && /* @__PURE__ */ jsxs(
3135
3450
  TextValidation,
3136
3451
  {
3137
3452
  alignItems: "center",
@@ -3420,8 +3735,7 @@ const Wrapper = styled.div`
3420
3735
  `;
3421
3736
  var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
3422
3737
  function newlineAndIndentContinueMarkdownList(cm) {
3423
- if (cm.getOption("disableInput"))
3424
- return CodeMirror.Pass;
3738
+ if (cm.getOption("disableInput")) return CodeMirror.Pass;
3425
3739
  var ranges = cm.listSelections(), replacements = [];
3426
3740
  for (var i = 0; i < ranges.length; i++) {
3427
3741
  var pos = ranges[i].head;
@@ -3455,8 +3769,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
3455
3769
  var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
3456
3770
  var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
3457
3771
  replacements[i] = "\n" + indent + bullet + after;
3458
- if (numbered)
3459
- incrementRemainingMarkdownListNumbers(cm, pos);
3772
+ if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
3460
3773
  }
3461
3774
  }
3462
3775
  cm.replaceSelections(replacements);
@@ -3474,10 +3787,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3474
3787
  var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
3475
3788
  var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
3476
3789
  if (startIndent === nextIndent && !isNaN(nextNumber)) {
3477
- if (newNumber === nextNumber)
3478
- itemNumber = nextNumber + 1;
3479
- if (newNumber > nextNumber)
3480
- itemNumber = newNumber + 1;
3790
+ if (newNumber === nextNumber) itemNumber = nextNumber + 1;
3791
+ if (newNumber > nextNumber) itemNumber = newNumber + 1;
3481
3792
  cm.replaceRange(
3482
3793
  nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
3483
3794
  {
@@ -3490,10 +3801,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3490
3801
  }
3491
3802
  );
3492
3803
  } else {
3493
- if (startIndent.length > nextIndent.length)
3494
- return;
3495
- if (startIndent.length < nextIndent.length && lookAhead === 1)
3496
- return;
3804
+ if (startIndent.length > nextIndent.length) return;
3805
+ if (startIndent.length < nextIndent.length && lookAhead === 1) return;
3497
3806
  skipCount += 1;
3498
3807
  }
3499
3808
  }
@@ -3965,7 +4274,7 @@ const EditorLayout = ({
3965
4274
  justifyContent: "flex-end",
3966
4275
  shrink: 0,
3967
4276
  width: "100%",
3968
- children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, children: [
4277
+ children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
3969
4278
  /* @__PURE__ */ jsx(Typography, { children: formatMessage({
3970
4279
  id: "components.Wysiwyg.collapse",
3971
4280
  defaultMessage: "Collapse"
@@ -3983,12 +4292,14 @@ const EditorLayout = ({
3983
4292
  ) }) });
3984
4293
  }
3985
4294
  return /* @__PURE__ */ jsx(
3986
- Box,
4295
+ Flex,
3987
4296
  {
3988
4297
  borderColor: error ? "danger600" : "neutral200",
3989
4298
  borderStyle: "solid",
3990
4299
  borderWidth: "1px",
3991
4300
  hasRadius: true,
4301
+ direction: "column",
4302
+ alignItems: "stretch",
3992
4303
  children
3993
4304
  }
3994
4305
  );
@@ -3999,11 +4310,19 @@ const ExpandWrapper = styled(Flex)`
3999
4310
  const BoxWithBorder = styled(Box)`
4000
4311
  border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
4001
4312
  `;
4002
- const ExpandButton$1 = styled(BaseButton)`
4313
+ const ExpandButton$1 = styled(Button)`
4003
4314
  background-color: transparent;
4004
4315
  border: none;
4005
4316
  align-items: center;
4006
4317
 
4318
+ & > span {
4319
+ display: flex;
4320
+ justify-content: space-between;
4321
+ align-items: center;
4322
+ width: 100%;
4323
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4324
+ }
4325
+
4007
4326
  svg {
4008
4327
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4009
4328
 
@@ -4270,42 +4589,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4270
4589
  insertWithoutTextToEdit(editor, markdownType, line, contentLength);
4271
4590
  }
4272
4591
  };
4273
- const CustomIconButton = styled(IconButton)`
4274
- padding: ${({ theme }) => theme.spaces[2]};
4275
- /* Trick to prevent the outline from overflowing because of the general outline-offset */
4276
- outline-offset: -2px !important;
4277
-
4278
- svg {
4279
- width: 1.8rem;
4280
- height: 1.8rem;
4281
- }
4282
- `;
4283
- const CustomLinkIconButton = styled(CustomIconButton)`
4284
- svg {
4285
- width: 0.8rem;
4286
- height: 0.8rem;
4287
- }
4288
- `;
4289
4592
  const MainButtons = styled(IconButtonGroup)`
4290
4593
  margin-left: ${({ theme }) => theme.spaces[4]};
4291
4594
  `;
4292
4595
  const MoreButton = styled(IconButton)`
4293
4596
  margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
4294
- padding: ${({ theme }) => theme.spaces[2]};
4295
-
4296
- svg {
4297
- width: 1.8rem;
4298
- height: 1.8rem;
4299
- }
4300
4597
  `;
4301
4598
  const IconButtonGroupMargin = styled(IconButtonGroup)`
4302
4599
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
4303
4600
  `;
4304
- const ExpandButton = styled(BaseButton)`
4601
+ const ExpandButton = styled(Button)`
4305
4602
  background-color: transparent;
4306
4603
  border: none;
4307
4604
  align-items: center;
4308
4605
 
4606
+ & > span {
4607
+ display: flex;
4608
+ justify-content: space-between;
4609
+ align-items: center;
4610
+ width: 100%;
4611
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4612
+ }
4613
+
4309
4614
  svg {
4310
4615
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4311
4616
  path {
@@ -4317,8 +4622,8 @@ const ExpandButton = styled(BaseButton)`
4317
4622
  `;
4318
4623
  const WysiwygFooter = ({ onToggleExpand }) => {
4319
4624
  const { formatMessage } = useIntl();
4320
- 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: [
4321
- /* @__PURE__ */ jsx(Typography, { children: formatMessage({
4625
+ 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: [
4626
+ /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: formatMessage({
4322
4627
  id: "components.WysiwygBottomControls.fullscreen",
4323
4628
  defaultMessage: "Expand"
4324
4629
  }) }),
@@ -4340,7 +4645,7 @@ const WysiwygNav = ({
4340
4645
  id: "components.Wysiwyg.selectOptions.title",
4341
4646
  defaultMessage: "Add a title"
4342
4647
  });
4343
- const buttonMoreRef = React.useRef(null);
4648
+ React.useRef(null);
4344
4649
  const handleTogglePopover = () => {
4345
4650
  setVisiblePopover((prev) => !prev);
4346
4651
  };
@@ -4354,18 +4659,27 @@ const WysiwygNav = ({
4354
4659
  borderRadius: `0.4rem 0.4rem 0 0`,
4355
4660
  children: [
4356
4661
  /* @__PURE__ */ jsxs(Flex, { children: [
4357
- /* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(SingleSelect, { disabled: true, placeholder: selectPlaceholder, "aria-label": selectPlaceholder, children: [
4358
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
4359
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
4360
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h3", children: "h3" }),
4361
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h4", children: "h4" }),
4362
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h5", children: "h5" }),
4363
- /* @__PURE__ */ jsx(SingleSelectOption, { value: "h6", children: "h6" })
4364
- ] }) }),
4662
+ /* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(
4663
+ SingleSelect,
4664
+ {
4665
+ disabled: true,
4666
+ placeholder: selectPlaceholder,
4667
+ "aria-label": selectPlaceholder,
4668
+ size: "S",
4669
+ children: [
4670
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
4671
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
4672
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h3", children: "h3" }),
4673
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h4", children: "h4" }),
4674
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h5", children: "h5" }),
4675
+ /* @__PURE__ */ jsx(SingleSelectOption, { value: "h6", children: "h6" })
4676
+ ]
4677
+ }
4678
+ ) }),
4365
4679
  /* @__PURE__ */ jsxs(MainButtons, { children: [
4366
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4367
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
4368
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsx(Underline, {}) })
4680
+ /* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4681
+ /* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
4682
+ /* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsx(Underline, {}) })
4369
4683
  ] }),
4370
4684
  /* @__PURE__ */ jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsx(More, {}) })
4371
4685
  ] }),
@@ -4392,6 +4706,7 @@ const WysiwygNav = ({
4392
4706
  placeholder: selectPlaceholder,
4393
4707
  "aria-label": selectPlaceholder,
4394
4708
  onChange: (value) => onActionClick(value, editorRef),
4709
+ size: "S",
4395
4710
  children: [
4396
4711
  /* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
4397
4712
  /* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
@@ -4403,17 +4718,9 @@ const WysiwygNav = ({
4403
4718
  }
4404
4719
  ) }),
4405
4720
  /* @__PURE__ */ jsxs(MainButtons, { children: [
4721
+ /* @__PURE__ */ jsx(IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4406
4722
  /* @__PURE__ */ jsx(
4407
- CustomIconButton,
4408
- {
4409
- onClick: () => onActionClick("Bold", editorRef),
4410
- label: "Bold",
4411
- name: "Bold",
4412
- children: /* @__PURE__ */ jsx(Bold, {})
4413
- }
4414
- ),
4415
- /* @__PURE__ */ jsx(
4416
- CustomIconButton,
4723
+ IconButton,
4417
4724
  {
4418
4725
  onClick: () => onActionClick("Italic", editorRef),
4419
4726
  label: "Italic",
@@ -4422,7 +4729,7 @@ const WysiwygNav = ({
4422
4729
  }
4423
4730
  ),
4424
4731
  /* @__PURE__ */ jsx(
4425
- CustomIconButton,
4732
+ IconButton,
4426
4733
  {
4427
4734
  onClick: () => onActionClick("Underline", editorRef),
4428
4735
  label: "Underline",
@@ -4431,79 +4738,81 @@ const WysiwygNav = ({
4431
4738
  }
4432
4739
  )
4433
4740
  ] }),
4434
- /* @__PURE__ */ jsx(MoreButton, { ref: buttonMoreRef, onClick: handleTogglePopover, label: "More", children: /* @__PURE__ */ jsx(More, {}) }),
4435
- visiblePopover && /* @__PURE__ */ jsx(Popover, { onDismiss: handleTogglePopover, centered: true, source: buttonMoreRef, spacing: 4, children: /* @__PURE__ */ jsxs(Flex, { children: [
4436
- /* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
4437
- /* @__PURE__ */ jsx(
4438
- CustomIconButton,
4439
- {
4440
- onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4441
- label: "Strikethrough",
4442
- name: "Strikethrough",
4443
- children: /* @__PURE__ */ jsx(StrikeThrough, {})
4444
- }
4445
- ),
4446
- /* @__PURE__ */ jsx(
4447
- CustomIconButton,
4448
- {
4449
- onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4450
- label: "BulletList",
4451
- name: "BulletList",
4452
- children: /* @__PURE__ */ jsx(BulletList, {})
4453
- }
4454
- ),
4455
- /* @__PURE__ */ jsx(
4456
- CustomIconButton,
4457
- {
4458
- onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4459
- label: "NumberList",
4460
- name: "NumberList",
4461
- children: /* @__PURE__ */ jsx(NumberList, {})
4462
- }
4463
- )
4464
- ] }),
4465
- /* @__PURE__ */ jsxs(IconButtonGroup, { children: [
4466
- /* @__PURE__ */ jsx(
4467
- CustomIconButton,
4468
- {
4469
- onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4470
- label: "Code",
4471
- name: "Code",
4472
- children: /* @__PURE__ */ jsx(Code, {})
4473
- }
4474
- ),
4475
- /* @__PURE__ */ jsx(
4476
- CustomIconButton,
4477
- {
4478
- onClick: () => {
4479
- handleTogglePopover();
4480
- onToggleMediaLib();
4481
- },
4482
- label: "Image",
4483
- name: "Image",
4484
- children: /* @__PURE__ */ jsx(Image$1, {})
4485
- }
4486
- ),
4487
- /* @__PURE__ */ jsx(
4488
- CustomLinkIconButton,
4489
- {
4490
- onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4491
- label: "Link",
4492
- name: "Link",
4493
- children: /* @__PURE__ */ jsx(Link$1, {})
4494
- }
4495
- ),
4496
- /* @__PURE__ */ jsx(
4497
- CustomIconButton,
4498
- {
4499
- onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4500
- label: "Quote",
4501
- name: "Quote",
4502
- children: /* @__PURE__ */ jsx(Quotes, {})
4503
- }
4504
- )
4505
- ] })
4506
- ] }) })
4741
+ /* @__PURE__ */ jsxs(Popover.Root, { children: [
4742
+ /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(MoreButton, { label: "More", children: /* @__PURE__ */ jsx(More, {}) }) }),
4743
+ /* @__PURE__ */ jsx(Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxs(Flex, { padding: 2, children: [
4744
+ /* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
4745
+ /* @__PURE__ */ jsx(
4746
+ IconButton,
4747
+ {
4748
+ onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4749
+ label: "Strikethrough",
4750
+ name: "Strikethrough",
4751
+ children: /* @__PURE__ */ jsx(StrikeThrough, {})
4752
+ }
4753
+ ),
4754
+ /* @__PURE__ */ jsx(
4755
+ IconButton,
4756
+ {
4757
+ onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4758
+ label: "BulletList",
4759
+ name: "BulletList",
4760
+ children: /* @__PURE__ */ jsx(BulletList, {})
4761
+ }
4762
+ ),
4763
+ /* @__PURE__ */ jsx(
4764
+ IconButton,
4765
+ {
4766
+ onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4767
+ label: "NumberList",
4768
+ name: "NumberList",
4769
+ children: /* @__PURE__ */ jsx(NumberList, {})
4770
+ }
4771
+ )
4772
+ ] }),
4773
+ /* @__PURE__ */ jsxs(IconButtonGroup, { children: [
4774
+ /* @__PURE__ */ jsx(
4775
+ IconButton,
4776
+ {
4777
+ onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4778
+ label: "Code",
4779
+ name: "Code",
4780
+ children: /* @__PURE__ */ jsx(Code, {})
4781
+ }
4782
+ ),
4783
+ /* @__PURE__ */ jsx(
4784
+ IconButton,
4785
+ {
4786
+ onClick: () => {
4787
+ handleTogglePopover();
4788
+ onToggleMediaLib();
4789
+ },
4790
+ label: "Image",
4791
+ name: "Image",
4792
+ children: /* @__PURE__ */ jsx(Image$1, {})
4793
+ }
4794
+ ),
4795
+ /* @__PURE__ */ jsx(
4796
+ IconButton,
4797
+ {
4798
+ onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4799
+ label: "Link",
4800
+ name: "Link",
4801
+ children: /* @__PURE__ */ jsx(Link$1, {})
4802
+ }
4803
+ ),
4804
+ /* @__PURE__ */ jsx(
4805
+ IconButton,
4806
+ {
4807
+ onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4808
+ label: "Quote",
4809
+ name: "Quote",
4810
+ children: /* @__PURE__ */ jsx(Quotes, {})
4811
+ }
4812
+ )
4813
+ ] })
4814
+ ] }) })
4815
+ ] })
4507
4816
  ] }),
4508
4817
  onTogglePreviewMode && /* @__PURE__ */ jsx(Button, { onClick: onTogglePreviewMode, variant: "tertiary", children: formatMessage({
4509
4818
  id: "components.Wysiwyg.ToggleMode.preview-mode",
@@ -4630,15 +4939,19 @@ const Wysiwyg = React.forwardRef(
4630
4939
  );
4631
4940
  const MemoizedWysiwyg = React.memo(Wysiwyg);
4632
4941
  const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4633
- const { id } = useDoc();
4942
+ const { id, document: document2, collectionType } = useDoc();
4634
4943
  const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
4635
4944
  const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
4636
4945
  const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
4637
4946
  const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
4638
4947
  const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
4639
4948
  const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
4640
- const editableFields = id ? canUpdateFields : canCreateFields;
4641
- const readableFields = id ? canReadFields : canCreateFields;
4949
+ let idToCheck = id;
4950
+ if (collectionType === SINGLE_TYPES) {
4951
+ idToCheck = document2?.documentId;
4952
+ }
4953
+ const editableFields = idToCheck ? canUpdateFields : canCreateFields;
4954
+ const readableFields = idToCheck ? canReadFields : canCreateFields;
4642
4955
  const canUserReadField = canUserAction(props.name, readableFields, props.type);
4643
4956
  const canUserEditField = canUserAction(props.name, editableFields, props.type);
4644
4957
  const fields = useStrapiApp("InputRenderer", (app) => app.fields);
@@ -4649,6 +4962,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4649
4962
  const {
4650
4963
  edit: { components }
4651
4964
  } = useDocLayout();
4965
+ const field = useField(props.name);
4652
4966
  if (!visible) {
4653
4967
  return null;
4654
4968
  }
@@ -4659,7 +4973,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4659
4973
  if (attributeHasCustomFieldProperty(props.attribute)) {
4660
4974
  const CustomInput = lazyComponentStore[props.attribute.customField];
4661
4975
  if (CustomInput) {
4662
- return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
4976
+ return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
4663
4977
  }
4664
4978
  return /* @__PURE__ */ jsx(
4665
4979
  InputRenderer$1,
@@ -4729,7 +5043,9 @@ const useFieldHint = (hint = void 0, attribute) => {
4729
5043
  if (!maximum && !minimum) {
4730
5044
  return hint;
4731
5045
  }
4732
- const units = !["biginteger", "integer", "number"].includes(attribute.type) ? formatMessage(
5046
+ const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
5047
+ attribute.type
5048
+ ) ? formatMessage(
4733
5049
  {
4734
5050
  id: "content-manager.form.Input.hint.character.unit",
4735
5051
  defaultMessage: "{maxValue, plural, one { character} other { characters}}"
@@ -4818,12 +5134,20 @@ const DynamicComponent = ({
4818
5134
  React.useEffect(() => {
4819
5135
  dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
4820
5136
  }, [dragPreviewRef, index]);
5137
+ const accordionValue = React.useId();
5138
+ const { value = [], rawError } = useField(`${name2}.${index}`);
5139
+ const [collapseToOpen, setCollapseToOpen] = React.useState("");
5140
+ React.useEffect(() => {
5141
+ if (rawError && value) {
5142
+ setCollapseToOpen(accordionValue);
5143
+ }
5144
+ }, [rawError, value, accordionValue]);
4821
5145
  const composedBoxRefs = useComposedRefs(boxRef, dropRef);
4822
5146
  const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
4823
5147
  /* @__PURE__ */ jsx(
4824
5148
  IconButton,
4825
5149
  {
4826
- borderWidth: 0,
5150
+ variant: "ghost",
4827
5151
  label: formatMessage(
4828
5152
  {
4829
5153
  id: getTranslation("components.DynamicZone.delete-label"),
@@ -4838,7 +5162,7 @@ const DynamicComponent = ({
4838
5162
  /* @__PURE__ */ jsx(
4839
5163
  IconButton,
4840
5164
  {
4841
- borderWidth: 0,
5165
+ variant: "ghost",
4842
5166
  onClick: (e) => e.stopPropagation(),
4843
5167
  "data-handler-id": handlerId,
4844
5168
  ref: dragRef,
@@ -4883,10 +5207,9 @@ const DynamicComponent = ({
4883
5207
  ] })
4884
5208
  ] });
4885
5209
  const accordionTitle = title ? `${displayName} ${title}` : displayName;
4886
- const accordionValue = React.useId();
4887
5210
  return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
4888
5211
  /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
4889
- /* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
5212
+ /* @__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: [
4890
5213
  /* @__PURE__ */ jsxs(Accordion.Header, { children: [
4891
5214
  /* @__PURE__ */ jsx(
4892
5215
  Accordion.Trigger,
@@ -4897,10 +5220,39 @@ const DynamicComponent = ({
4897
5220
  ),
4898
5221
  /* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
4899
5222
  ] }),
4900
- /* @__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, { gap: 4, children: row.map(({ size, ...field }) => {
4901
- const fieldName = `${name2}.${index}.${field.name}`;
4902
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
4903
- }) }, rowInd)) }) }) })
5223
+ /* @__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(
5224
+ Grid$1.Item,
5225
+ {
5226
+ col: 12,
5227
+ s: 12,
5228
+ xs: 12,
5229
+ direction: "column",
5230
+ alignItems: "stretch",
5231
+ children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5232
+ const fieldName = `${name2}.${index}.${field.name}`;
5233
+ const fieldWithTranslatedLabel = {
5234
+ ...field,
5235
+ label: formatMessage({
5236
+ id: `content-manager.components.${componentUid}.${field.name}`,
5237
+ defaultMessage: field.label
5238
+ })
5239
+ };
5240
+ return /* @__PURE__ */ jsx(
5241
+ Grid$1.Item,
5242
+ {
5243
+ col: size,
5244
+ s: 12,
5245
+ xs: 12,
5246
+ direction: "column",
5247
+ alignItems: "stretch",
5248
+ children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
5249
+ },
5250
+ fieldName
5251
+ );
5252
+ }) })
5253
+ },
5254
+ rowInd
5255
+ )) }) }) }) })
4904
5256
  ] }) }) })
4905
5257
  ] });
4906
5258
  };
@@ -5092,7 +5444,7 @@ const DynamicZone = ({
5092
5444
  const handleRemoveComponent = (name22, currentIndex) => () => {
5093
5445
  removeFieldRow(name22, currentIndex);
5094
5446
  };
5095
- const hasError = error !== void 0 || dynamicDisplayedComponentsLength < min || dynamicDisplayedComponentsLength > max;
5447
+ const hasError = error !== void 0;
5096
5448
  const renderButtonLabel = () => {
5097
5449
  if (addComponentIsOpen) {
5098
5450
  return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
@@ -5208,4 +5560,4 @@ export {
5208
5560
  transformDocument as t,
5209
5561
  useLazyComponents as u
5210
5562
  };
5211
- //# sourceMappingURL=Field-Cz_J9551.mjs.map
5563
+ //# sourceMappingURL=Field-BPkQ-3Ku.mjs.map