@strapi/content-manager 0.0.0-experimental.d53e940834bf72ddc725f1d2fd36dac9abec30cb → 0.0.0-experimental.d6bba97c7ed8309e57888e84d4788fa279d473fd

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 (220) 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-DmwmiFQy.mjs → ComponentConfigurationPage-D4J64ny7.mjs} +4 -4
  5. package/dist/_chunks/{ComponentConfigurationPage-DmwmiFQy.mjs.map → ComponentConfigurationPage-D4J64ny7.mjs.map} +1 -1
  6. package/dist/_chunks/{ComponentConfigurationPage-C-49MccQ.js → ComponentConfigurationPage-DHV8IFbd.js} +5 -6
  7. package/dist/_chunks/{ComponentConfigurationPage-C-49MccQ.js.map → ComponentConfigurationPage-DHV8IFbd.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-JT3E7NZy.mjs → EditConfigurationPage-DMnf8orh.mjs} +4 -4
  12. package/dist/_chunks/{EditConfigurationPage-JT3E7NZy.mjs.map → EditConfigurationPage-DMnf8orh.mjs.map} +1 -1
  13. package/dist/_chunks/{EditConfigurationPage-DjFJw56M.js → EditConfigurationPage-q76oeVU1.js} +5 -6
  14. package/dist/_chunks/{EditConfigurationPage-DjFJw56M.js.map → EditConfigurationPage-q76oeVU1.js.map} +1 -1
  15. package/dist/_chunks/{EditViewPage-zT3fBr4Y.js → EditViewPage-BXoY-ITh.js} +63 -13
  16. package/dist/_chunks/EditViewPage-BXoY-ITh.js.map +1 -0
  17. package/dist/_chunks/{EditViewPage-CPj61RMh.mjs → EditViewPage-COVXj9bh.mjs} +63 -12
  18. package/dist/_chunks/EditViewPage-COVXj9bh.mjs.map +1 -0
  19. package/dist/_chunks/{Field-dha5VnIQ.mjs → Field-CcppsFQR.mjs} +300 -203
  20. package/dist/_chunks/Field-CcppsFQR.mjs.map +1 -0
  21. package/dist/_chunks/{Field-Boxf9Ajp.js → Field-Dj1nOvt8.js} +303 -207
  22. package/dist/_chunks/Field-Dj1nOvt8.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-DHrru2AV.mjs → Form-DbWwH0-A.mjs} +37 -18
  26. package/dist/_chunks/Form-DbWwH0-A.mjs.map +1 -0
  27. package/dist/_chunks/{Form-y5g1SRsh.js → Form-aTchNxab.js} +39 -21
  28. package/dist/_chunks/Form-aTchNxab.js.map +1 -0
  29. package/dist/_chunks/{History-CqN6K7SX.js → History-Cs6XM6EU.js} +81 -114
  30. package/dist/_chunks/History-Cs6XM6EU.js.map +1 -0
  31. package/dist/_chunks/{History-Bru_KoeP.mjs → History-tU567_hc.mjs} +82 -114
  32. package/dist/_chunks/History-tU567_hc.mjs.map +1 -0
  33. package/dist/_chunks/{ListConfigurationPage-R_p-SbHZ.js → ListConfigurationPage-7LeytuFD.js} +25 -13
  34. package/dist/_chunks/ListConfigurationPage-7LeytuFD.js.map +1 -0
  35. package/dist/_chunks/{ListConfigurationPage-D8wGABj0.mjs → ListConfigurationPage-DQryo_4i.mjs} +25 -12
  36. package/dist/_chunks/ListConfigurationPage-DQryo_4i.mjs.map +1 -0
  37. package/dist/_chunks/{ListViewPage-SID6TRb9.mjs → ListViewPage-B50esy_x.mjs} +118 -77
  38. package/dist/_chunks/ListViewPage-B50esy_x.mjs.map +1 -0
  39. package/dist/_chunks/{ListViewPage-pEw_zug9.js → ListViewPage-CaGBu5H5.js} +121 -81
  40. package/dist/_chunks/ListViewPage-CaGBu5H5.js.map +1 -0
  41. package/dist/_chunks/{NoContentTypePage-C5dcQojD.js → NoContentTypePage-BaBE00IO.js} +2 -2
  42. package/dist/_chunks/{NoContentTypePage-C5dcQojD.js.map → NoContentTypePage-BaBE00IO.js.map} +1 -1
  43. package/dist/_chunks/{NoContentTypePage-CJ7UXwrQ.mjs → NoContentTypePage-CiPP8cLx.mjs} +2 -2
  44. package/dist/_chunks/{NoContentTypePage-CJ7UXwrQ.mjs.map → NoContentTypePage-CiPP8cLx.mjs.map} +1 -1
  45. package/dist/_chunks/{NoPermissionsPage-B7syEq5E.mjs → NoPermissionsPage-0-CW106p.mjs} +2 -2
  46. package/dist/_chunks/{NoPermissionsPage-B7syEq5E.mjs.map → NoPermissionsPage-0-CW106p.mjs.map} +1 -1
  47. package/dist/_chunks/{NoPermissionsPage-BtPrImPP.js → NoPermissionsPage-DQn5cqZz.js} +2 -2
  48. package/dist/_chunks/{NoPermissionsPage-BtPrImPP.js.map → NoPermissionsPage-DQn5cqZz.js.map} +1 -1
  49. package/dist/_chunks/Preview-C1dBkhXf.mjs +272 -0
  50. package/dist/_chunks/Preview-C1dBkhXf.mjs.map +1 -0
  51. package/dist/_chunks/Preview-DH1h7kJ6.js +290 -0
  52. package/dist/_chunks/Preview-DH1h7kJ6.js.map +1 -0
  53. package/dist/_chunks/{Relations-B9Crnhnn.mjs → Relations-Bvne4TvU.mjs} +76 -42
  54. package/dist/_chunks/Relations-Bvne4TvU.mjs.map +1 -0
  55. package/dist/_chunks/{Relations-DjTQ5kGB.js → Relations-CkECnBOd.js} +76 -43
  56. package/dist/_chunks/Relations-CkECnBOd.js.map +1 -0
  57. package/dist/_chunks/{en-fbKQxLGn.js → en-BK8Xyl5I.js} +32 -18
  58. package/dist/_chunks/{en-fbKQxLGn.js.map → en-BK8Xyl5I.js.map} +1 -1
  59. package/dist/_chunks/{en-Ux26r5pl.mjs → en-Dtk_ot79.mjs} +32 -18
  60. package/dist/_chunks/{en-Ux26r5pl.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-DVPWZkbS.js → index-BN1pPa5v.js} +1135 -693
  71. package/dist/_chunks/index-BN1pPa5v.js.map +1 -0
  72. package/dist/_chunks/{index-DJXJw9V5.mjs → index-ByPZ754U.mjs} +1156 -714
  73. package/dist/_chunks/index-ByPZ754U.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-Bau7ZfLV.mjs → layout-CUTOYU8I.mjs} +26 -13
  79. package/dist/_chunks/layout-CUTOYU8I.mjs.map +1 -0
  80. package/dist/_chunks/{layout-Dm6fbiQj.js → layout-nBPDlXjr.js} +26 -14
  81. package/dist/_chunks/layout-nBPDlXjr.js.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-CKnpRgrN.js → relations-B6B-b7lI.js} +6 -7
  87. package/dist/_chunks/relations-B6B-b7lI.js.map +1 -0
  88. package/dist/_chunks/{relations-BH_kBSJ0.mjs → relations-CBc5HYHC.mjs} +6 -7
  89. package/dist/_chunks/relations-CBc5HYHC.mjs.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 +5 -4
  101. package/dist/admin/src/content-manager.d.ts +3 -2
  102. package/dist/admin/src/exports.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 +2 -1
  109. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  110. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
  111. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  112. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  113. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
  114. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  115. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  116. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  117. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  118. package/dist/admin/src/preview/constants.d.ts +1 -0
  119. package/dist/admin/src/preview/index.d.ts +4 -0
  120. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  121. package/dist/admin/src/preview/routes.d.ts +3 -0
  122. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  123. package/dist/admin/src/router.d.ts +1 -1
  124. package/dist/admin/src/services/api.d.ts +1 -1
  125. package/dist/admin/src/services/components.d.ts +2 -2
  126. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  127. package/dist/admin/src/services/documents.d.ts +19 -20
  128. package/dist/admin/src/services/init.d.ts +1 -1
  129. package/dist/admin/src/services/relations.d.ts +2 -2
  130. package/dist/admin/src/services/uid.d.ts +3 -3
  131. package/dist/admin/src/utils/validation.d.ts +4 -1
  132. package/dist/server/index.js +615 -299
  133. package/dist/server/index.js.map +1 -1
  134. package/dist/server/index.mjs +615 -298
  135. package/dist/server/index.mjs.map +1 -1
  136. package/dist/server/src/bootstrap.d.ts.map +1 -1
  137. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  138. package/dist/server/src/controllers/index.d.ts.map +1 -1
  139. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  140. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  141. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  142. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  143. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  144. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  145. package/dist/server/src/history/services/history.d.ts.map +1 -1
  146. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  147. package/dist/server/src/history/services/utils.d.ts +4 -4
  148. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  149. package/dist/server/src/index.d.ts +4 -4
  150. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  151. package/dist/server/src/preview/constants.d.ts +2 -0
  152. package/dist/server/src/preview/constants.d.ts.map +1 -0
  153. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  154. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  155. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  156. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  157. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  158. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  159. package/dist/server/src/preview/index.d.ts +4 -0
  160. package/dist/server/src/preview/index.d.ts.map +1 -0
  161. package/dist/server/src/preview/routes/index.d.ts +8 -0
  162. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  163. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  164. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  165. package/dist/server/src/preview/services/index.d.ts +16 -0
  166. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  167. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  168. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  169. package/dist/server/src/preview/services/preview.d.ts +12 -0
  170. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  171. package/dist/server/src/preview/utils.d.ts +19 -0
  172. package/dist/server/src/preview/utils.d.ts.map +1 -0
  173. package/dist/server/src/register.d.ts.map +1 -1
  174. package/dist/server/src/routes/index.d.ts.map +1 -1
  175. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  176. package/dist/server/src/services/document-metadata.d.ts +8 -8
  177. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  178. package/dist/server/src/services/index.d.ts +4 -4
  179. package/dist/server/src/services/index.d.ts.map +1 -1
  180. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  181. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  182. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  183. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  184. package/dist/server/src/utils/index.d.ts +2 -0
  185. package/dist/server/src/utils/index.d.ts.map +1 -1
  186. package/dist/shared/contracts/collection-types.d.ts +3 -1
  187. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  188. package/dist/shared/contracts/index.d.ts +1 -0
  189. package/dist/shared/contracts/index.d.ts.map +1 -1
  190. package/dist/shared/contracts/preview.d.ts +27 -0
  191. package/dist/shared/contracts/preview.d.ts.map +1 -0
  192. package/dist/shared/index.js +4 -0
  193. package/dist/shared/index.js.map +1 -1
  194. package/dist/shared/index.mjs +4 -0
  195. package/dist/shared/index.mjs.map +1 -1
  196. package/package.json +15 -15
  197. package/dist/_chunks/EditViewPage-CPj61RMh.mjs.map +0 -1
  198. package/dist/_chunks/EditViewPage-zT3fBr4Y.js.map +0 -1
  199. package/dist/_chunks/Field-Boxf9Ajp.js.map +0 -1
  200. package/dist/_chunks/Field-dha5VnIQ.mjs.map +0 -1
  201. package/dist/_chunks/Form-DHrru2AV.mjs.map +0 -1
  202. package/dist/_chunks/Form-y5g1SRsh.js.map +0 -1
  203. package/dist/_chunks/History-Bru_KoeP.mjs.map +0 -1
  204. package/dist/_chunks/History-CqN6K7SX.js.map +0 -1
  205. package/dist/_chunks/ListConfigurationPage-D8wGABj0.mjs.map +0 -1
  206. package/dist/_chunks/ListConfigurationPage-R_p-SbHZ.js.map +0 -1
  207. package/dist/_chunks/ListViewPage-SID6TRb9.mjs.map +0 -1
  208. package/dist/_chunks/ListViewPage-pEw_zug9.js.map +0 -1
  209. package/dist/_chunks/Relations-B9Crnhnn.mjs.map +0 -1
  210. package/dist/_chunks/Relations-DjTQ5kGB.js.map +0 -1
  211. package/dist/_chunks/index-DJXJw9V5.mjs.map +0 -1
  212. package/dist/_chunks/index-DVPWZkbS.js.map +0 -1
  213. package/dist/_chunks/layout-Bau7ZfLV.mjs.map +0 -1
  214. package/dist/_chunks/layout-Dm6fbiQj.js.map +0 -1
  215. package/dist/_chunks/relations-BH_kBSJ0.mjs.map +0 -1
  216. package/dist/_chunks/relations-CKnpRgrN.js.map +0 -1
  217. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  218. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  219. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  220. package/strapi-server.js +0 -3
@@ -5,19 +5,19 @@ const strapiAdmin = require("@strapi/admin/strapi-admin");
5
5
  const designSystem = require("@strapi/design-system");
6
6
  const pipe$1 = require("lodash/fp/pipe");
7
7
  const reactIntl = require("react-intl");
8
- const index = require("./index-DVPWZkbS.js");
8
+ const index = require("./index-BN1pPa5v.js");
9
9
  const fractionalIndexing = require("fractional-indexing");
10
- const Relations = require("./Relations-DjTQ5kGB.js");
10
+ const Relations = require("./Relations-CkECnBOd.js");
11
11
  const Icons = require("@strapi/icons");
12
12
  const styledComponents = require("styled-components");
13
- const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
13
+ const ComponentIcon = require("./ComponentIcon-CRbtQEUV.js");
14
14
  const reactDndHtml5Backend = require("react-dnd-html5-backend");
15
- const useDragAndDrop = require("./useDragAndDrop-J0TUUbR6.js");
16
- const objects = require("./objects-gigeqt7s.js");
15
+ const useDragAndDrop = require("./useDragAndDrop-BMtgCYzL.js");
16
+ const objects = require("./objects-BcXOv6_9.js");
17
17
  const slate = require("slate");
18
18
  const slateHistory = require("slate-history");
19
19
  const slateReact = require("slate-react");
20
- const usePrev = require("./usePrev-B9w_-eYc.js");
20
+ const useDebounce = require("./useDebounce-CtcjDB3L.js");
21
21
  const Toolbar = require("@radix-ui/react-toolbar");
22
22
  const reactRouterDom = require("react-router-dom");
23
23
  const CodeMirror = require("codemirror5");
@@ -37,8 +37,7 @@ require("highlight.js/styles/solarized-dark.css");
37
37
  require("codemirror5/addon/display/placeholder");
38
38
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
39
39
  function _interopNamespace(e) {
40
- if (e && e.__esModule)
41
- return e;
40
+ if (e && e.__esModule) return e;
42
41
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
43
42
  if (e) {
44
43
  for (const k in e) {
@@ -542,7 +541,7 @@ const CodeEditor = (props) => {
542
541
  const codeBlocks = {
543
542
  code: {
544
543
  renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(CodeEditor, { ...props }),
545
- icon: Icons.Code,
544
+ icon: Icons.CodeBlock,
546
545
  label: {
547
546
  id: "components.Blocks.blocks.code",
548
547
  defaultMessage: "Code block"
@@ -731,8 +730,7 @@ const ImageDialog = () => {
731
730
  const [isOpen, setIsOpen] = React__namespace.useState(true);
732
731
  const { editor } = useBlocksEditorContext("ImageDialog");
733
732
  const components = strapiAdmin.useStrapiApp("ImageDialog", (state) => state.components);
734
- if (!components || !isOpen)
735
- return null;
733
+ if (!components || !isOpen) return null;
736
734
  const MediaLibraryDialog = components["media-library"];
737
735
  const insertImages = (images) => {
738
736
  slate.Transforms.unwrapNodes(editor, {
@@ -741,14 +739,12 @@ const ImageDialog = () => {
741
739
  });
742
740
  const nodeEntryBeingReplaced = slate.Editor.above(editor, {
743
741
  match(node) {
744
- if (slate.Editor.isEditor(node))
745
- return false;
742
+ if (slate.Editor.isEditor(node)) return false;
746
743
  const isInlineNode = ["text", "link"].includes(node.type);
747
744
  return !isInlineNode;
748
745
  }
749
746
  });
750
- if (!nodeEntryBeingReplaced)
751
- return;
747
+ if (!nodeEntryBeingReplaced) return;
752
748
  const [, pathToInsert] = nodeEntryBeingReplaced;
753
749
  slate.Transforms.removeNodes(editor);
754
750
  const nodesToInsert = images.map((image) => {
@@ -768,7 +764,7 @@ const ImageDialog = () => {
768
764
  const nodeImage = {
769
765
  ...expectedImage,
770
766
  alternativeText: expectedImage.alternativeText || expectedImage.name,
771
- url: usePrev.prefixFileUrlWithBackendUrl(image.url)
767
+ url: useDebounce.prefixFileUrlWithBackendUrl(image.url)
772
768
  };
773
769
  return nodeImage;
774
770
  });
@@ -894,20 +890,8 @@ const LinkContent = React__namespace.forwardRef(
894
890
  const [linkText, setLinkText] = React__namespace.useState(elementText);
895
891
  const [linkUrl, setLinkUrl] = React__namespace.useState(link.url);
896
892
  const linkInputRef = React__namespace.useRef(null);
897
- const [showRemoveButton, setShowRemoveButton] = React__namespace.useState(false);
893
+ const isLastInsertedLink = editor.lastInsertedLinkPath ? !slate.Path.equals(path, editor.lastInsertedLinkPath) : true;
898
894
  const [isSaveDisabled, setIsSaveDisabled] = React__namespace.useState(false);
899
- const handleOpenChange = (isOpen) => {
900
- if (isOpen) {
901
- setPopoverOpen(isOpen);
902
- setShowRemoveButton(isOpen);
903
- } else {
904
- setPopoverOpen(isOpen);
905
- if (link.url === "") {
906
- removeLink(editor);
907
- }
908
- slateReact.ReactEditor.focus(editor);
909
- }
910
- };
911
895
  const onLinkChange = (e) => {
912
896
  setIsSaveDisabled(false);
913
897
  setLinkUrl(e.target.value);
@@ -928,15 +912,32 @@ const LinkContent = React__namespace.forwardRef(
928
912
  editLink(editor, { url: linkUrl, text: linkText });
929
913
  setPopoverOpen(false);
930
914
  editor.lastInsertedLinkPath = null;
915
+ slateReact.ReactEditor.focus(editor);
916
+ };
917
+ const handleClose = () => {
918
+ if (link.url === "") {
919
+ removeLink(editor);
920
+ }
921
+ setPopoverOpen(false);
922
+ slateReact.ReactEditor.focus(editor);
931
923
  };
932
924
  React__namespace.useEffect(() => {
933
- if (popoverOpen)
934
- linkInputRef.current?.focus();
925
+ if (popoverOpen) linkInputRef.current?.focus();
935
926
  }, [popoverOpen]);
936
927
  const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
937
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { onOpenChange: handleOpenChange, open: popoverOpen, children: [
938
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(StyledBaseLink, { ...attributes, ref: forwardedRef, href: link.url, color: "primary600", children }) }),
939
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, tag: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
928
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { open: popoverOpen, children: [
929
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
930
+ StyledBaseLink,
931
+ {
932
+ ...attributes,
933
+ ref: forwardedRef,
934
+ href: link.url,
935
+ onClick: () => setPopoverOpen(true),
936
+ color: "primary600",
937
+ children
938
+ }
939
+ ) }),
940
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { onPointerDownOutside: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, direction: "column", gap: 4, children: [
940
941
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { width: "368px", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
941
942
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
942
943
  id: "components.Blocks.popover.text",
@@ -982,7 +983,7 @@ const LinkContent = React__namespace.forwardRef(
982
983
  {
983
984
  variant: "danger-light",
984
985
  onClick: () => removeLink(editor),
985
- $visible: showRemoveButton,
986
+ $visible: isLastInsertedLink,
986
987
  children: formatMessage({
987
988
  id: "components.Blocks.popover.remove",
988
989
  defaultMessage: "Remove"
@@ -990,11 +991,11 @@ const LinkContent = React__namespace.forwardRef(
990
991
  }
991
992
  ),
992
993
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
993
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: () => handleOpenChange(false), children: formatMessage({
994
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
994
995
  id: "components.Blocks.popover.cancel",
995
996
  defaultMessage: "Cancel"
996
997
  }) }),
997
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { type: "submit", disabled: Boolean(inputNotDirty) || isSaveDisabled, children: formatMessage({
998
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
998
999
  id: "components.Blocks.popover.save",
999
1000
  defaultMessage: "Save"
1000
1001
  }) })
@@ -1076,8 +1077,7 @@ const isText$1 = (node) => {
1076
1077
  return slate.Node.isNode(node) && !slate.Editor.isEditor(node) && node.type === "text";
1077
1078
  };
1078
1079
  const handleBackspaceKeyOnList = (editor, event) => {
1079
- if (!editor.selection)
1080
- return;
1080
+ if (!editor.selection) return;
1081
1081
  const [currentListItem, currentListItemPath] = slate.Editor.parent(editor, editor.selection.anchor);
1082
1082
  const [currentList, currentListPath] = slate.Editor.parent(editor, currentListItemPath);
1083
1083
  const isListEmpty = currentList.children.length === 1 && isText$1(currentListItem.children[0]) && currentListItem.children[0].text === "";
@@ -1186,8 +1186,7 @@ const handleEnterKeyOnList = (editor) => {
1186
1186
  };
1187
1187
  const handleConvertToList = (editor, format) => {
1188
1188
  const convertedPath = baseHandleConvert(editor, { type: "list-item" });
1189
- if (!convertedPath)
1190
- return;
1189
+ if (!convertedPath) return;
1191
1190
  slate.Transforms.wrapNodes(editor, { type: "list", format, children: [] }, { at: convertedPath });
1192
1191
  };
1193
1192
  const handleTabOnList = (editor) => {
@@ -1199,8 +1198,7 @@ const handleTabOnList = (editor) => {
1199
1198
  }
1200
1199
  const [currentListItem, currentListItemPath] = currentListItemEntry;
1201
1200
  const [currentList] = slate.Editor.parent(editor, currentListItemPath);
1202
- if (currentListItem === currentList.children[0])
1203
- return;
1201
+ if (currentListItem === currentList.children[0]) return;
1204
1202
  const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);
1205
1203
  const previousNode = currentList.children[currentListItemIndex - 1];
1206
1204
  if (previousNode.type === "list") {
@@ -1435,7 +1433,7 @@ const ToolbarButton = ({
1435
1433
  width: 7,
1436
1434
  height: 7,
1437
1435
  hasRadius: true,
1438
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { width: "1.2rem", height: "1.2rem", fill: disabled ? "neutral300" : enabledColor })
1436
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
1439
1437
  }
1440
1438
  )
1441
1439
  }
@@ -1567,8 +1565,7 @@ const isListNode = (node) => {
1567
1565
  const ListButton = ({ block, format }) => {
1568
1566
  const { editor, disabled, blocks } = useBlocksEditorContext("ListButton");
1569
1567
  const isListActive = () => {
1570
- if (!editor.selection)
1571
- return false;
1568
+ if (!editor.selection) return false;
1572
1569
  const currentListEntry = slate.Editor.above(editor, {
1573
1570
  match: (node) => !slate.Editor.isEditor(node) && node.type === "list",
1574
1571
  at: editor.selection.anchor
@@ -1580,6 +1577,26 @@ const ListButton = ({ block, format }) => {
1580
1577
  }
1581
1578
  return false;
1582
1579
  };
1580
+ const isListDisabled = () => {
1581
+ if (disabled) {
1582
+ return true;
1583
+ }
1584
+ if (!editor.selection) {
1585
+ return false;
1586
+ }
1587
+ const anchorNodeEntry = slate.Editor.above(editor, {
1588
+ at: editor.selection.anchor,
1589
+ match: (node) => !slate.Editor.isEditor(node) && node.type !== "text"
1590
+ });
1591
+ const focusNodeEntry = slate.Editor.above(editor, {
1592
+ at: editor.selection.focus,
1593
+ match: (node) => !slate.Editor.isEditor(node) && node.type !== "text"
1594
+ });
1595
+ if (!anchorNodeEntry || !focusNodeEntry) {
1596
+ return false;
1597
+ }
1598
+ return anchorNodeEntry[0] !== focusNodeEntry[0];
1599
+ };
1583
1600
  const toggleList = (format2) => {
1584
1601
  let currentListEntry;
1585
1602
  if (editor.selection) {
@@ -1613,7 +1630,7 @@ const ListButton = ({ block, format }) => {
1613
1630
  name: format,
1614
1631
  label: block.label,
1615
1632
  isActive: isListActive(),
1616
- disabled,
1633
+ disabled: isListDisabled(),
1617
1634
  handleClick: () => toggleList(format)
1618
1635
  }
1619
1636
  );
@@ -1622,8 +1639,7 @@ const LinkButton = ({ disabled }) => {
1622
1639
  const { editor } = useBlocksEditorContext("LinkButton");
1623
1640
  const isLinkActive = () => {
1624
1641
  const { selection } = editor;
1625
- if (!selection)
1626
- return false;
1642
+ if (!selection) return false;
1627
1643
  const [match] = Array.from(
1628
1644
  slate.Editor.nodes(editor, {
1629
1645
  at: slate.Editor.unhangRange(editor, selection),
@@ -1757,6 +1773,7 @@ const DragItem = styledComponents.styled(designSystem.Flex)`
1757
1773
  }
1758
1774
  `;
1759
1775
  const DragIconButton = styledComponents.styled(designSystem.IconButton)`
1776
+ user-select: none;
1760
1777
  display: flex;
1761
1778
  align-items: center;
1762
1779
  justify-content: center;
@@ -1780,7 +1797,7 @@ const DragIconButton = styledComponents.styled(designSystem.IconButton)`
1780
1797
  }
1781
1798
  svg {
1782
1799
  height: auto;
1783
- width: ${({ theme }) => theme.spaces[3]};
1800
+ min-width: ${({ theme }) => theme.spaces[3]};
1784
1801
 
1785
1802
  path {
1786
1803
  fill: ${({ theme }) => theme.colors.neutral700};
@@ -1828,8 +1845,7 @@ const DragAndDropElement = ({
1828
1845
  displayedValue: children
1829
1846
  },
1830
1847
  onDropItem(currentIndex, newIndex) {
1831
- if (newIndex)
1832
- handleMoveBlock(newIndex, currentIndex);
1848
+ if (newIndex) handleMoveBlock(newIndex, currentIndex);
1833
1849
  }
1834
1850
  });
1835
1851
  const composedBoxRefs = designSystem.useComposedRefs(blockRef, dropRef);
@@ -1885,6 +1901,7 @@ const DragAndDropElement = ({
1885
1901
  DragIconButton,
1886
1902
  {
1887
1903
  tag: "div",
1904
+ contentEditable: false,
1888
1905
  role: "button",
1889
1906
  tabIndex: 0,
1890
1907
  withTooltip: false,
@@ -1897,7 +1914,7 @@ const DragAndDropElement = ({
1897
1914
  disabled,
1898
1915
  draggable: true,
1899
1916
  $dragHandleTopMargin: dragHandleTopMargin,
1900
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "neutral600" })
1917
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "primary500" })
1901
1918
  }
1902
1919
  ),
1903
1920
  children
@@ -1972,8 +1989,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
1972
1989
  [modifiers2]
1973
1990
  );
1974
1991
  const handleMoveBlocks = (editor2, event) => {
1975
- if (!editor2.selection)
1976
- return;
1992
+ if (!editor2.selection) return;
1977
1993
  const start = slate.Range.start(editor2.selection);
1978
1994
  const currentIndex = [start.path[0]];
1979
1995
  let newIndexPosition = 0;
@@ -2110,8 +2126,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
2110
2126
  }
2111
2127
  };
2112
2128
  const handleScrollSelectionIntoView = () => {
2113
- if (!editor.selection)
2114
- return;
2129
+ if (!editor.selection) return;
2115
2130
  const domRange = slateReact.ReactEditor.toDOMRange(editor, editor.selection);
2116
2131
  const domRect = domRange.getBoundingClientRect();
2117
2132
  const blocksInput = blocksRef.current;
@@ -2221,7 +2236,7 @@ const EditorLayout$1 = ({
2221
2236
  /* @__PURE__ */ jsxRuntime.jsx(
2222
2237
  CollapseIconButton,
2223
2238
  {
2224
- "aria-label": formatMessage({
2239
+ label: formatMessage({
2225
2240
  id: index.getTranslation("components.Blocks.collapse"),
2226
2241
  defaultMessage: "Collapse"
2227
2242
  }),
@@ -2305,8 +2320,7 @@ const InlineCode = styledComponents.styled.code`
2305
2320
  `;
2306
2321
  const baseCheckIsActive = (editor, name2) => {
2307
2322
  const marks = slate.Editor.marks(editor);
2308
- if (!marks)
2309
- return false;
2323
+ if (!marks) return false;
2310
2324
  return Boolean(marks[name2]);
2311
2325
  };
2312
2326
  const baseHandleToggle = (editor, name2) => {
@@ -2560,7 +2574,7 @@ const BlocksEditor = React__namespace.forwardRef(
2560
2574
  !isExpandedMode && /* @__PURE__ */ jsxRuntime.jsx(
2561
2575
  ExpandIconButton,
2562
2576
  {
2563
- "aria-label": formatMessage({
2577
+ label: formatMessage({
2564
2578
  id: index.getTranslation("components.Blocks.expand"),
2565
2579
  defaultMessage: "Expand"
2566
2580
  }),
@@ -2626,47 +2640,44 @@ const createDefaultForm = (contentType, components = {}) => {
2626
2640
  const Initializer = ({ disabled, name: name2, onClick }) => {
2627
2641
  const { formatMessage } = reactIntl.useIntl();
2628
2642
  const field = strapiAdmin.useField(name2);
2629
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2630
- /* @__PURE__ */ jsxRuntime.jsx(
2631
- designSystem.Box,
2632
- {
2633
- tag: "button",
2634
- background: "neutral100",
2635
- borderColor: field.error ? "danger600" : "neutral200",
2636
- hasRadius: true,
2637
- disabled,
2638
- onClick,
2639
- paddingTop: 9,
2640
- paddingBottom: 9,
2641
- type: "button",
2642
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
2643
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(CircleIcon, {}) }),
2644
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2645
- id: index.getTranslation("components.empty-repeatable"),
2646
- defaultMessage: "No entry yet. Click on the button below to add one."
2647
- }) }) })
2648
- ] })
2649
- }
2650
- ),
2651
- field.error && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", variant: "pi", children: field.error })
2652
- ] });
2643
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
2644
+ designSystem.Box,
2645
+ {
2646
+ tag: "button",
2647
+ background: disabled ? "neutral150" : "neutral100",
2648
+ borderColor: field.error ? "danger600" : "neutral200",
2649
+ hasRadius: true,
2650
+ disabled,
2651
+ onClick,
2652
+ paddingTop: 9,
2653
+ paddingBottom: 9,
2654
+ type: "button",
2655
+ style: { cursor: disabled ? "not-allowed" : "pointer" },
2656
+ children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
2657
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
2658
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
2659
+ designSystem.Typography,
2660
+ {
2661
+ textColor: disabled ? "neutral600" : "primary600",
2662
+ variant: "pi",
2663
+ fontWeight: "bold",
2664
+ children: formatMessage({
2665
+ id: index.getTranslation("components.empty-repeatable"),
2666
+ defaultMessage: "No entry yet. Click to add one."
2667
+ })
2668
+ }
2669
+ ) })
2670
+ ] })
2671
+ }
2672
+ ) });
2653
2673
  };
2654
- const CircleIcon = styledComponents.styled(Icons.PlusCircle)`
2655
- width: 2.4rem;
2656
- height: 2.4rem;
2657
- > circle {
2658
- fill: ${({ theme }) => theme.colors.primary200};
2659
- }
2660
- > path {
2661
- fill: ${({ theme }) => theme.colors.primary600};
2662
- }
2663
- `;
2664
2674
  const NonRepeatableComponent = ({
2665
2675
  attribute,
2666
2676
  name: name2,
2667
2677
  children,
2668
2678
  layout
2669
2679
  }) => {
2680
+ const { formatMessage } = reactIntl.useIntl();
2670
2681
  const { value } = strapiAdmin.useField(name2);
2671
2682
  const level = Relations.useComponent("NonRepeatableComponent", (state) => state.level);
2672
2683
  const isNested = level > 0;
@@ -2683,7 +2694,22 @@ const NonRepeatableComponent = ({
2683
2694
  children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index2) => {
2684
2695
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2685
2696
  const completeFieldName = `${name2}.${field.name}`;
2686
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2697
+ const translatedLabel = formatMessage({
2698
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2699
+ defaultMessage: field.label
2700
+ });
2701
+ return /* @__PURE__ */ jsxRuntime.jsx(
2702
+ designSystem.Grid.Item,
2703
+ {
2704
+ col: size,
2705
+ s: 12,
2706
+ xs: 12,
2707
+ direction: "column",
2708
+ alignItems: "stretch",
2709
+ children: children({ ...field, label: translatedLabel, name: completeFieldName })
2710
+ },
2711
+ completeFieldName
2712
+ );
2687
2713
  }) }, index2);
2688
2714
  }) })
2689
2715
  }
@@ -2702,13 +2728,34 @@ const RepeatableComponent = ({
2702
2728
  const { search: searchString } = reactRouterDom.useLocation();
2703
2729
  const search = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
2704
2730
  const { components } = index.useDoc();
2705
- const { value = [], error } = strapiAdmin.useField(name2);
2731
+ const {
2732
+ value = [],
2733
+ error,
2734
+ rawError
2735
+ } = strapiAdmin.useField(name2);
2706
2736
  const addFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.addFieldRow);
2707
2737
  const moveFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.moveFieldRow);
2708
2738
  const removeFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.removeFieldRow);
2709
2739
  const { max = Infinity } = attribute;
2710
2740
  const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
2711
2741
  const [liveText, setLiveText] = React__namespace.useState("");
2742
+ React__namespace.useEffect(() => {
2743
+ const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
2744
+ const hasNestedValue = value && Array.isArray(value) && value.length > 0;
2745
+ if (hasNestedErrors && hasNestedValue) {
2746
+ const errorOpenItems = rawError.map((_, idx) => {
2747
+ return value[idx] ? value[idx].__temp_key__ : null;
2748
+ }).filter((value2) => !!value2);
2749
+ if (errorOpenItems && errorOpenItems.length > 0) {
2750
+ setCollapseToOpen((collapseToOpen2) => {
2751
+ if (!errorOpenItems.includes(collapseToOpen2)) {
2752
+ return errorOpenItems[0];
2753
+ }
2754
+ return collapseToOpen2;
2755
+ });
2756
+ }
2757
+ }
2758
+ }, [rawError, value]);
2712
2759
  const componentTmpKeyWithFocussedField = React__namespace.useMemo(() => {
2713
2760
  if (search.has("field")) {
2714
2761
  const fieldParam = search.get("field");
@@ -2723,7 +2770,7 @@ const RepeatableComponent = ({
2723
2770
  }
2724
2771
  return void 0;
2725
2772
  }, [search, name2, value]);
2726
- const prevValue = usePrev.usePrev(value);
2773
+ const prevValue = useDebounce.usePrev(value);
2727
2774
  React__namespace.useEffect(() => {
2728
2775
  if (prevValue && prevValue.length < value.length) {
2729
2776
  setCollapseToOpen(value[value.length - 1].__temp_key__);
@@ -2861,7 +2908,26 @@ const RepeatableComponent = ({
2861
2908
  children: layout.map((row, index22) => {
2862
2909
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2863
2910
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2864
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2911
+ const translatedLabel = formatMessage({
2912
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2913
+ defaultMessage: field.label
2914
+ });
2915
+ return /* @__PURE__ */ jsxRuntime.jsx(
2916
+ designSystem.Grid.Item,
2917
+ {
2918
+ col: size,
2919
+ s: 12,
2920
+ xs: 12,
2921
+ direction: "column",
2922
+ alignItems: "stretch",
2923
+ children: children({
2924
+ ...field,
2925
+ label: translatedLabel,
2926
+ name: completeFieldName
2927
+ })
2928
+ },
2929
+ completeFieldName
2930
+ );
2865
2931
  }) }, index22);
2866
2932
  })
2867
2933
  }
@@ -2956,7 +3022,7 @@ const Component = ({
2956
3022
  /* @__PURE__ */ jsxRuntime.jsx(
2957
3023
  designSystem.IconButton,
2958
3024
  {
2959
- borderWidth: 0,
3025
+ variant: "ghost",
2960
3026
  onClick: onDeleteComponent,
2961
3027
  label: formatMessage({
2962
3028
  id: index.getTranslation("containers.Edit.delete"),
@@ -2969,7 +3035,7 @@ const Component = ({
2969
3035
  designSystem.IconButton,
2970
3036
  {
2971
3037
  ref: composedAccordionRefs,
2972
- borderWidth: 0,
3038
+ variant: "ghost",
2973
3039
  onClick: (e) => e.stopPropagation(),
2974
3040
  "data-handler-id": handlerId,
2975
3041
  label: formatMessage({
@@ -3039,7 +3105,7 @@ const ComponentInput = ({
3039
3105
  id: index.getTranslation("components.reset-entry"),
3040
3106
  defaultMessage: "Reset Entry"
3041
3107
  }),
3042
- borderWidth: 0,
3108
+ variant: "ghost",
3043
3109
  onClick: () => {
3044
3110
  field.onChange(name2, null);
3045
3111
  },
@@ -3068,11 +3134,8 @@ const AddComponentButton = ({
3068
3134
  onClick,
3069
3135
  disabled: isDisabled,
3070
3136
  background: "neutral0",
3071
- paddingTop: 3,
3072
- paddingBottom: 3,
3073
- paddingLeft: 4,
3074
- paddingRight: 4,
3075
3137
  style: { cursor: isDisabled ? "not-allowed" : "pointer" },
3138
+ variant: "tertiary",
3076
3139
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
3077
3140
  /* @__PURE__ */ jsxRuntime.jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
3078
3141
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3101,10 +3164,11 @@ const StyledAddIcon = styledComponents.styled(Icons.PlusCircle)`
3101
3164
  }
3102
3165
  `;
3103
3166
  const AddComponentTitle = styledComponents.styled(designSystem.Typography)``;
3104
- const StyledButton = styledComponents.styled(designSystem.BaseButton)`
3167
+ const StyledButton = styledComponents.styled(designSystem.Button)`
3105
3168
  border-radius: 26px;
3106
3169
  border-color: ${({ theme }) => theme.colors.neutral150};
3107
3170
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
3171
+ height: 5rem;
3108
3172
 
3109
3173
  &:hover {
3110
3174
  ${AddComponentTitle} {
@@ -3116,7 +3180,7 @@ const StyledButton = styledComponents.styled(designSystem.BaseButton)`
3116
3180
  fill: ${({ theme }) => theme.colors.primary600};
3117
3181
  }
3118
3182
  > path {
3119
- fill: ${({ theme }) => theme.colors.neutral100};
3183
+ fill: ${({ theme }) => theme.colors.primary600};
3120
3184
  }
3121
3185
  }
3122
3186
  }
@@ -3247,18 +3311,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
3247
3311
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
3248
3312
  ] });
3249
3313
  };
3250
- function useDebounce(value, delay) {
3251
- const [debouncedValue, setDebouncedValue] = React.useState(value);
3252
- React.useEffect(() => {
3253
- const handler = setTimeout(() => {
3254
- setDebouncedValue(value);
3255
- }, delay);
3256
- return () => {
3257
- clearTimeout(handler);
3258
- };
3259
- }, [value, delay]);
3260
- return debouncedValue;
3261
- }
3262
3314
  const uidApi = index.contentManagerApi.injectEndpoints({
3263
3315
  endpoints: (builder) => ({
3264
3316
  getDefaultUID: builder.query({
@@ -3293,7 +3345,10 @@ const uidApi = index.contentManagerApi.injectEndpoints({
3293
3345
  config: {
3294
3346
  params
3295
3347
  }
3296
- })
3348
+ }),
3349
+ providesTags: (_res, _error, params) => [
3350
+ { type: "UidAvailability", id: params.contentTypeUID }
3351
+ ]
3297
3352
  })
3298
3353
  })
3299
3354
  });
@@ -3305,8 +3360,10 @@ const UIDInput = React__namespace.forwardRef(
3305
3360
  const allFormValues = strapiAdmin.useForm("InputUID", (form) => form.values);
3306
3361
  const [availability, setAvailability] = React__namespace.useState();
3307
3362
  const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
3363
+ const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
3308
3364
  const field = strapiAdmin.useField(name2);
3309
- const debouncedValue = useDebounce(field.value, 300);
3365
+ const debouncedValue = useDebounce.useDebounce(field.value, 300);
3366
+ const hasChanged = debouncedValue !== field.initialValue;
3310
3367
  const { toggleNotification } = strapiAdmin.useNotification();
3311
3368
  const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
3312
3369
  const { formatMessage } = reactIntl.useIntl();
@@ -3382,8 +3439,9 @@ const UIDInput = React__namespace.forwardRef(
3382
3439
  params
3383
3440
  },
3384
3441
  {
3442
+ // Don't check availability if the value is empty or wasn't changed
3385
3443
  skip: !Boolean(
3386
- debouncedValue !== field.initialValue && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3444
+ (hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3387
3445
  )
3388
3446
  }
3389
3447
  );
@@ -3412,6 +3470,7 @@ const UIDInput = React__namespace.forwardRef(
3412
3470
  const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
3413
3471
  const fieldRef = strapiAdmin.useFocusInputField(name2);
3414
3472
  const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
3473
+ const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
3415
3474
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name: name2, error: field.error, required, children: [
3416
3475
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
3417
3476
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3420,7 +3479,7 @@ const UIDInput = React__namespace.forwardRef(
3420
3479
  ref: composedRefs,
3421
3480
  disabled: props.disabled,
3422
3481
  endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { position: "relative", gap: 1, children: [
3423
- availability && !showRegenerate && /* @__PURE__ */ jsxRuntime.jsxs(
3482
+ shouldShowAvailability && /* @__PURE__ */ jsxRuntime.jsxs(
3424
3483
  TextValidation,
3425
3484
  {
3426
3485
  alignItems: "center",
@@ -3709,8 +3768,7 @@ const Wrapper = styledComponents.styled.div`
3709
3768
  `;
3710
3769
  var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
3711
3770
  function newlineAndIndentContinueMarkdownList(cm) {
3712
- if (cm.getOption("disableInput"))
3713
- return CodeMirror__default.default.Pass;
3771
+ if (cm.getOption("disableInput")) return CodeMirror__default.default.Pass;
3714
3772
  var ranges = cm.listSelections(), replacements = [];
3715
3773
  for (var i = 0; i < ranges.length; i++) {
3716
3774
  var pos = ranges[i].head;
@@ -3744,8 +3802,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
3744
3802
  var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
3745
3803
  var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
3746
3804
  replacements[i] = "\n" + indent + bullet + after;
3747
- if (numbered)
3748
- incrementRemainingMarkdownListNumbers(cm, pos);
3805
+ if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
3749
3806
  }
3750
3807
  }
3751
3808
  cm.replaceSelections(replacements);
@@ -3763,10 +3820,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3763
3820
  var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
3764
3821
  var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
3765
3822
  if (startIndent === nextIndent && !isNaN(nextNumber)) {
3766
- if (newNumber === nextNumber)
3767
- itemNumber = nextNumber + 1;
3768
- if (newNumber > nextNumber)
3769
- itemNumber = newNumber + 1;
3823
+ if (newNumber === nextNumber) itemNumber = nextNumber + 1;
3824
+ if (newNumber > nextNumber) itemNumber = newNumber + 1;
3770
3825
  cm.replaceRange(
3771
3826
  nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
3772
3827
  {
@@ -3779,10 +3834,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
3779
3834
  }
3780
3835
  );
3781
3836
  } else {
3782
- if (startIndent.length > nextIndent.length)
3783
- return;
3784
- if (startIndent.length < nextIndent.length && lookAhead === 1)
3785
- return;
3837
+ if (startIndent.length > nextIndent.length) return;
3838
+ if (startIndent.length < nextIndent.length && lookAhead === 1) return;
3786
3839
  skipCount += 1;
3787
3840
  }
3788
3841
  }
@@ -4254,7 +4307,7 @@ const EditorLayout = ({
4254
4307
  justifyContent: "flex-end",
4255
4308
  shrink: 0,
4256
4309
  width: "100%",
4257
- children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, children: [
4310
+ children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
4258
4311
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
4259
4312
  id: "components.Wysiwyg.collapse",
4260
4313
  defaultMessage: "Collapse"
@@ -4272,12 +4325,14 @@ const EditorLayout = ({
4272
4325
  ) }) });
4273
4326
  }
4274
4327
  return /* @__PURE__ */ jsxRuntime.jsx(
4275
- designSystem.Box,
4328
+ designSystem.Flex,
4276
4329
  {
4277
4330
  borderColor: error ? "danger600" : "neutral200",
4278
4331
  borderStyle: "solid",
4279
4332
  borderWidth: "1px",
4280
4333
  hasRadius: true,
4334
+ direction: "column",
4335
+ alignItems: "stretch",
4281
4336
  children
4282
4337
  }
4283
4338
  );
@@ -4288,11 +4343,19 @@ const ExpandWrapper = styledComponents.styled(designSystem.Flex)`
4288
4343
  const BoxWithBorder = styledComponents.styled(designSystem.Box)`
4289
4344
  border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
4290
4345
  `;
4291
- const ExpandButton$1 = styledComponents.styled(designSystem.BaseButton)`
4346
+ const ExpandButton$1 = styledComponents.styled(designSystem.Button)`
4292
4347
  background-color: transparent;
4293
4348
  border: none;
4294
4349
  align-items: center;
4295
4350
 
4351
+ & > span {
4352
+ display: flex;
4353
+ justify-content: space-between;
4354
+ align-items: center;
4355
+ width: 100%;
4356
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4357
+ }
4358
+
4296
4359
  svg {
4297
4360
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4298
4361
 
@@ -4559,40 +4622,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4559
4622
  insertWithoutTextToEdit(editor, markdownType, line, contentLength);
4560
4623
  }
4561
4624
  };
4562
- const CustomIconButton = styledComponents.styled(designSystem.IconButton)`
4563
- padding: ${({ theme }) => theme.spaces[2]};
4564
-
4565
- svg {
4566
- width: 1.8rem;
4567
- height: 1.8rem;
4568
- }
4569
- `;
4570
- const CustomLinkIconButton = styledComponents.styled(CustomIconButton)`
4571
- svg {
4572
- width: 0.8rem;
4573
- height: 0.8rem;
4574
- }
4575
- `;
4576
4625
  const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
4577
4626
  margin-left: ${({ theme }) => theme.spaces[4]};
4578
4627
  `;
4579
4628
  const MoreButton = styledComponents.styled(designSystem.IconButton)`
4580
4629
  margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
4581
- padding: ${({ theme }) => theme.spaces[2]};
4582
-
4583
- svg {
4584
- width: 1.8rem;
4585
- height: 1.8rem;
4586
- }
4587
4630
  `;
4588
4631
  const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
4589
4632
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
4590
4633
  `;
4591
- const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
4634
+ const ExpandButton = styledComponents.styled(designSystem.Button)`
4592
4635
  background-color: transparent;
4593
4636
  border: none;
4594
4637
  align-items: center;
4595
4638
 
4639
+ & > span {
4640
+ display: flex;
4641
+ justify-content: space-between;
4642
+ align-items: center;
4643
+ width: 100%;
4644
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4645
+ }
4646
+
4596
4647
  svg {
4597
4648
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4598
4649
  path {
@@ -4604,8 +4655,8 @@ const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
4604
4655
  `;
4605
4656
  const WysiwygFooter = ({ onToggleExpand }) => {
4606
4657
  const { formatMessage } = reactIntl.useIntl();
4607
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, children: [
4608
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
4658
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, variant: "tertiary", size: "M", children: [
4659
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: formatMessage({
4609
4660
  id: "components.WysiwygBottomControls.fullscreen",
4610
4661
  defaultMessage: "Expand"
4611
4662
  }) }),
@@ -4641,18 +4692,27 @@ const WysiwygNav = ({
4641
4692
  borderRadius: `0.4rem 0.4rem 0 0`,
4642
4693
  children: [
4643
4694
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
4644
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.SingleSelect, { disabled: true, placeholder: selectPlaceholder, "aria-label": selectPlaceholder, children: [
4645
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4646
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
4647
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
4648
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
4649
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
4650
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
4651
- ] }) }),
4695
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
4696
+ designSystem.SingleSelect,
4697
+ {
4698
+ disabled: true,
4699
+ placeholder: selectPlaceholder,
4700
+ "aria-label": selectPlaceholder,
4701
+ size: "S",
4702
+ children: [
4703
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4704
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
4705
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
4706
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
4707
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
4708
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
4709
+ ]
4710
+ }
4711
+ ) }),
4652
4712
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4653
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4654
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
4655
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
4713
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4714
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
4715
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
4656
4716
  ] }),
4657
4717
  /* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
4658
4718
  ] }),
@@ -4679,6 +4739,7 @@ const WysiwygNav = ({
4679
4739
  placeholder: selectPlaceholder,
4680
4740
  "aria-label": selectPlaceholder,
4681
4741
  onChange: (value) => onActionClick(value, editorRef),
4742
+ size: "S",
4682
4743
  children: [
4683
4744
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4684
4745
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
@@ -4690,17 +4751,9 @@ const WysiwygNav = ({
4690
4751
  }
4691
4752
  ) }),
4692
4753
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4754
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4693
4755
  /* @__PURE__ */ jsxRuntime.jsx(
4694
- CustomIconButton,
4695
- {
4696
- onClick: () => onActionClick("Bold", editorRef),
4697
- label: "Bold",
4698
- name: "Bold",
4699
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {})
4700
- }
4701
- ),
4702
- /* @__PURE__ */ jsxRuntime.jsx(
4703
- CustomIconButton,
4756
+ designSystem.IconButton,
4704
4757
  {
4705
4758
  onClick: () => onActionClick("Italic", editorRef),
4706
4759
  label: "Italic",
@@ -4709,7 +4762,7 @@ const WysiwygNav = ({
4709
4762
  }
4710
4763
  ),
4711
4764
  /* @__PURE__ */ jsxRuntime.jsx(
4712
- CustomIconButton,
4765
+ designSystem.IconButton,
4713
4766
  {
4714
4767
  onClick: () => onActionClick("Underline", editorRef),
4715
4768
  label: "Underline",
@@ -4723,7 +4776,7 @@ const WysiwygNav = ({
4723
4776
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
4724
4777
  /* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
4725
4778
  /* @__PURE__ */ jsxRuntime.jsx(
4726
- CustomIconButton,
4779
+ designSystem.IconButton,
4727
4780
  {
4728
4781
  onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4729
4782
  label: "Strikethrough",
@@ -4732,7 +4785,7 @@ const WysiwygNav = ({
4732
4785
  }
4733
4786
  ),
4734
4787
  /* @__PURE__ */ jsxRuntime.jsx(
4735
- CustomIconButton,
4788
+ designSystem.IconButton,
4736
4789
  {
4737
4790
  onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4738
4791
  label: "BulletList",
@@ -4741,7 +4794,7 @@ const WysiwygNav = ({
4741
4794
  }
4742
4795
  ),
4743
4796
  /* @__PURE__ */ jsxRuntime.jsx(
4744
- CustomIconButton,
4797
+ designSystem.IconButton,
4745
4798
  {
4746
4799
  onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4747
4800
  label: "NumberList",
@@ -4752,7 +4805,7 @@ const WysiwygNav = ({
4752
4805
  ] }),
4753
4806
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
4754
4807
  /* @__PURE__ */ jsxRuntime.jsx(
4755
- CustomIconButton,
4808
+ designSystem.IconButton,
4756
4809
  {
4757
4810
  onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4758
4811
  label: "Code",
@@ -4761,7 +4814,7 @@ const WysiwygNav = ({
4761
4814
  }
4762
4815
  ),
4763
4816
  /* @__PURE__ */ jsxRuntime.jsx(
4764
- CustomIconButton,
4817
+ designSystem.IconButton,
4765
4818
  {
4766
4819
  onClick: () => {
4767
4820
  handleTogglePopover();
@@ -4773,7 +4826,7 @@ const WysiwygNav = ({
4773
4826
  }
4774
4827
  ),
4775
4828
  /* @__PURE__ */ jsxRuntime.jsx(
4776
- CustomLinkIconButton,
4829
+ designSystem.IconButton,
4777
4830
  {
4778
4831
  onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4779
4832
  label: "Link",
@@ -4782,7 +4835,7 @@ const WysiwygNav = ({
4782
4835
  }
4783
4836
  ),
4784
4837
  /* @__PURE__ */ jsxRuntime.jsx(
4785
- CustomIconButton,
4838
+ designSystem.IconButton,
4786
4839
  {
4787
4840
  onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4788
4841
  label: "Quote",
@@ -4860,7 +4913,7 @@ const Wysiwyg = React__namespace.forwardRef(
4860
4913
  const handleSelectAssets = (files) => {
4861
4914
  const formattedFiles = files.map((f) => ({
4862
4915
  alt: f.alternativeText || f.name,
4863
- url: usePrev.prefixFileUrlWithBackendUrl(f.url),
4916
+ url: useDebounce.prefixFileUrlWithBackendUrl(f.url),
4864
4917
  mime: f.mime
4865
4918
  }));
4866
4919
  insertFile(editorRef, formattedFiles);
@@ -4919,15 +4972,19 @@ const Wysiwyg = React__namespace.forwardRef(
4919
4972
  );
4920
4973
  const MemoizedWysiwyg = React__namespace.memo(Wysiwyg);
4921
4974
  const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4922
- const { id } = index.useDoc();
4975
+ const { id, document: document2, collectionType } = index.useDoc();
4923
4976
  const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
4924
4977
  const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
4925
4978
  const canCreateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
4926
4979
  const canReadFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
4927
4980
  const canUpdateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
4928
4981
  const canUserAction = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
4929
- const editableFields = id ? canUpdateFields : canCreateFields;
4930
- const readableFields = id ? canReadFields : canCreateFields;
4982
+ let idToCheck = id;
4983
+ if (collectionType === index.SINGLE_TYPES) {
4984
+ idToCheck = document2?.documentId;
4985
+ }
4986
+ const editableFields = idToCheck ? canUpdateFields : canCreateFields;
4987
+ const readableFields = idToCheck ? canReadFields : canCreateFields;
4931
4988
  const canUserReadField = canUserAction(props.name, readableFields, props.type);
4932
4989
  const canUserEditField = canUserAction(props.name, editableFields, props.type);
4933
4990
  const fields = strapiAdmin.useStrapiApp("InputRenderer", (app) => app.fields);
@@ -4938,6 +4995,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4938
4995
  const {
4939
4996
  edit: { components }
4940
4997
  } = index.useDocLayout();
4998
+ const field = strapiAdmin.useField(props.name);
4941
4999
  if (!visible) {
4942
5000
  return null;
4943
5001
  }
@@ -4948,7 +5006,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4948
5006
  if (attributeHasCustomFieldProperty(props.attribute)) {
4949
5007
  const CustomInput = lazyComponentStore[props.attribute.customField];
4950
5008
  if (CustomInput) {
4951
- return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
5009
+ return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
4952
5010
  }
4953
5011
  return /* @__PURE__ */ jsxRuntime.jsx(
4954
5012
  strapiAdmin.InputRenderer,
@@ -5018,7 +5076,9 @@ const useFieldHint = (hint = void 0, attribute) => {
5018
5076
  if (!maximum && !minimum) {
5019
5077
  return hint;
5020
5078
  }
5021
- const units = !["biginteger", "integer", "number"].includes(attribute.type) ? formatMessage(
5079
+ const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
5080
+ attribute.type
5081
+ ) ? formatMessage(
5022
5082
  {
5023
5083
  id: "content-manager.form.Input.hint.character.unit",
5024
5084
  defaultMessage: "{maxValue, plural, one { character} other { characters}}"
@@ -5107,12 +5167,20 @@ const DynamicComponent = ({
5107
5167
  React__namespace.useEffect(() => {
5108
5168
  dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
5109
5169
  }, [dragPreviewRef, index$1]);
5170
+ const accordionValue = React__namespace.useId();
5171
+ const { value = [], rawError } = strapiAdmin.useField(`${name2}.${index$1}`);
5172
+ const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
5173
+ React__namespace.useEffect(() => {
5174
+ if (rawError && value) {
5175
+ setCollapseToOpen(accordionValue);
5176
+ }
5177
+ }, [rawError, value, accordionValue]);
5110
5178
  const composedBoxRefs = designSystem.useComposedRefs(boxRef, dropRef);
5111
5179
  const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5112
5180
  /* @__PURE__ */ jsxRuntime.jsx(
5113
5181
  designSystem.IconButton,
5114
5182
  {
5115
- borderWidth: 0,
5183
+ variant: "ghost",
5116
5184
  label: formatMessage(
5117
5185
  {
5118
5186
  id: index.getTranslation("components.DynamicZone.delete-label"),
@@ -5127,7 +5195,7 @@ const DynamicComponent = ({
5127
5195
  /* @__PURE__ */ jsxRuntime.jsx(
5128
5196
  designSystem.IconButton,
5129
5197
  {
5130
- borderWidth: 0,
5198
+ variant: "ghost",
5131
5199
  onClick: (e) => e.stopPropagation(),
5132
5200
  "data-handler-id": handlerId,
5133
5201
  ref: dragRef,
@@ -5172,10 +5240,9 @@ const DynamicComponent = ({
5172
5240
  ] })
5173
5241
  ] });
5174
5242
  const accordionTitle = title ? `${displayName} ${title}` : displayName;
5175
- const accordionValue = React__namespace.useId();
5176
5243
  return /* @__PURE__ */ jsxRuntime.jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
5177
5244
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Rectangle, { background: "neutral200" }) }),
5178
- /* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
5245
+ /* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { value: collapseToOpen, onValueChange: setCollapseToOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
5179
5246
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
5180
5247
  /* @__PURE__ */ jsxRuntime.jsx(
5181
5248
  designSystem.Accordion.Trigger,
@@ -5186,10 +5253,39 @@ const DynamicComponent = ({
5186
5253
  ),
5187
5254
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: accordionActions })
5188
5255
  ] }),
5189
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5190
- const fieldName = `${name2}.${index$1}.${field.name}`;
5191
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
5192
- }) }, rowInd)) }) }) })
5256
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsxRuntime.jsx(
5257
+ designSystem.Grid.Item,
5258
+ {
5259
+ col: 12,
5260
+ s: 12,
5261
+ xs: 12,
5262
+ direction: "column",
5263
+ alignItems: "stretch",
5264
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5265
+ const fieldName = `${name2}.${index$1}.${field.name}`;
5266
+ const fieldWithTranslatedLabel = {
5267
+ ...field,
5268
+ label: formatMessage({
5269
+ id: `content-manager.components.${componentUid}.${field.name}`,
5270
+ defaultMessage: field.label
5271
+ })
5272
+ };
5273
+ return /* @__PURE__ */ jsxRuntime.jsx(
5274
+ designSystem.Grid.Item,
5275
+ {
5276
+ col: size,
5277
+ s: 12,
5278
+ xs: 12,
5279
+ direction: "column",
5280
+ alignItems: "stretch",
5281
+ children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
5282
+ },
5283
+ fieldName
5284
+ );
5285
+ }) })
5286
+ },
5287
+ rowInd
5288
+ )) }) }) }) })
5193
5289
  ] }) }) })
5194
5290
  ] });
5195
5291
  };
@@ -5381,7 +5477,7 @@ const DynamicZone = ({
5381
5477
  const handleRemoveComponent = (name22, currentIndex) => () => {
5382
5478
  removeFieldRow(name22, currentIndex);
5383
5479
  };
5384
- const hasError = error !== void 0 || dynamicDisplayedComponentsLength < min || dynamicDisplayedComponentsLength > max;
5480
+ const hasError = error !== void 0;
5385
5481
  const renderButtonLabel = () => {
5386
5482
  if (addComponentIsOpen) {
5387
5483
  return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
@@ -5495,4 +5591,4 @@ exports.transformDocument = transformDocument;
5495
5591
  exports.useDynamicZone = useDynamicZone;
5496
5592
  exports.useFieldHint = useFieldHint;
5497
5593
  exports.useLazyComponents = useLazyComponents;
5498
- //# sourceMappingURL=Field-Boxf9Ajp.js.map
5594
+ //# sourceMappingURL=Field-Dj1nOvt8.js.map