@strapi/content-manager 0.0.0-experimental.f31889311d753b5f7d95198ae84d8fce1d156cd6 → 0.0.0-experimental.f49f46a1c17445a39e8af3f63124bcccf73842e6

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 (197) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-BNxtMIfV.js → ComponentConfigurationPage-ClKl_TA2.js} +4 -4
  2. package/dist/_chunks/{ComponentConfigurationPage-BNxtMIfV.js.map → ComponentConfigurationPage-ClKl_TA2.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-BWOQWCv2.mjs → ComponentConfigurationPage-D3ZWDAHG.mjs} +4 -4
  4. package/dist/_chunks/{ComponentConfigurationPage-BWOQWCv2.mjs.map → ComponentConfigurationPage-D3ZWDAHG.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-GTp-Ucnw.mjs → EditConfigurationPage-BYCBSJxP.mjs} +4 -4
  6. package/dist/_chunks/{EditConfigurationPage-GTp-Ucnw.mjs.map → EditConfigurationPage-BYCBSJxP.mjs.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-D340bYlT.js → EditConfigurationPage-OWez0Kxp.js} +4 -4
  8. package/dist/_chunks/{EditConfigurationPage-D340bYlT.js.map → EditConfigurationPage-OWez0Kxp.js.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-BVMS5hT-.mjs → EditViewPage-5pdbvsO_.mjs} +63 -12
  10. package/dist/_chunks/EditViewPage-5pdbvsO_.mjs.map +1 -0
  11. package/dist/_chunks/{EditViewPage-CXkmnAvI.js → EditViewPage-BEs5iGDi.js} +62 -11
  12. package/dist/_chunks/EditViewPage-BEs5iGDi.js.map +1 -0
  13. package/dist/_chunks/{Field-Ibi32diw.js → Field-DNHm4wHx.js} +210 -119
  14. package/dist/_chunks/Field-DNHm4wHx.js.map +1 -0
  15. package/dist/_chunks/{Field-nNgv5bpd.mjs → Field-DcKuFHYK.mjs} +208 -117
  16. package/dist/_chunks/Field-DcKuFHYK.mjs.map +1 -0
  17. package/dist/_chunks/{Form-DodJsI2A.mjs → Form-CGwM_-5c.mjs} +36 -17
  18. package/dist/_chunks/Form-CGwM_-5c.mjs.map +1 -0
  19. package/dist/_chunks/{Form-Dhnh34ym.js → Form-CoRxWJOz.js} +36 -17
  20. package/dist/_chunks/Form-CoRxWJOz.js.map +1 -0
  21. package/dist/_chunks/{History-C9auUkDi.js → History-BcUTQrfG.js} +40 -97
  22. package/dist/_chunks/History-BcUTQrfG.js.map +1 -0
  23. package/dist/_chunks/{History-CKCSQXz_.mjs → History-DEvr3Q_V.mjs} +42 -99
  24. package/dist/_chunks/History-DEvr3Q_V.mjs.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-Bg4rWUjX.js → ListConfigurationPage-BE_Ho7tV.js} +17 -6
  26. package/dist/_chunks/ListConfigurationPage-BE_Ho7tV.js.map +1 -0
  27. package/dist/_chunks/{ListConfigurationPage-CKEC4ttG.mjs → ListConfigurationPage-BM4zZZcM.mjs} +18 -7
  28. package/dist/_chunks/ListConfigurationPage-BM4zZZcM.mjs.map +1 -0
  29. package/dist/_chunks/{ListViewPage-B7_WJUjG.mjs → ListViewPage-BK2mkrql.mjs} +65 -39
  30. package/dist/_chunks/ListViewPage-BK2mkrql.mjs.map +1 -0
  31. package/dist/_chunks/{ListViewPage-C2gIeYHG.js → ListViewPage-BkT8Eao0.js} +68 -42
  32. package/dist/_chunks/ListViewPage-BkT8Eao0.js.map +1 -0
  33. package/dist/_chunks/{NoContentTypePage-Ckem6Ll6.mjs → NoContentTypePage-BvcAutu9.mjs} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-Ckem6Ll6.mjs.map → NoContentTypePage-BvcAutu9.mjs.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-DqgdUfyn.js → NoContentTypePage-C8mtyc4H.js} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-DqgdUfyn.js.map → NoContentTypePage-C8mtyc4H.js.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-CF29Q-sW.js → NoPermissionsPage-B5Y9Y78B.js} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-CF29Q-sW.js.map → NoPermissionsPage-B5Y9Y78B.js.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-BO-GEjA4.mjs → NoPermissionsPage-BmbRz7PR.mjs} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-BO-GEjA4.mjs.map → NoPermissionsPage-BmbRz7PR.mjs.map} +1 -1
  41. package/dist/_chunks/Preview-BF8ZDYqS.js +286 -0
  42. package/dist/_chunks/Preview-BF8ZDYqS.js.map +1 -0
  43. package/dist/_chunks/Preview-DcexhKJE.mjs +267 -0
  44. package/dist/_chunks/Preview-DcexhKJE.mjs.map +1 -0
  45. package/dist/_chunks/{Relations-C0uC9J4f.js → Relations-BKnoK1R0.js} +72 -36
  46. package/dist/_chunks/Relations-BKnoK1R0.js.map +1 -0
  47. package/dist/_chunks/{Relations-DItV5eow.mjs → Relations-BjIzc4EK.mjs} +73 -37
  48. package/dist/_chunks/Relations-BjIzc4EK.mjs.map +1 -0
  49. package/dist/_chunks/{en-BrCTWlZv.mjs → en-CfIXaZf9.mjs} +26 -14
  50. package/dist/_chunks/{en-BrCTWlZv.mjs.map → en-CfIXaZf9.mjs.map} +1 -1
  51. package/dist/_chunks/{en-uOUIxfcQ.js → en-DTWPCdTS.js} +26 -14
  52. package/dist/_chunks/{en-uOUIxfcQ.js.map → en-DTWPCdTS.js.map} +1 -1
  53. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  54. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  55. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  56. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  57. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  58. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  59. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  60. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  61. package/dist/_chunks/{index-DrNe6ctw.mjs → index-BW-rXkjn.mjs} +1027 -761
  62. package/dist/_chunks/index-BW-rXkjn.mjs.map +1 -0
  63. package/dist/_chunks/{index-Dd0nXyJF.js → index-DOzAG2cq.js} +1008 -741
  64. package/dist/_chunks/index-DOzAG2cq.js.map +1 -0
  65. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  66. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  67. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  68. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  69. package/dist/_chunks/{layout-B3ez7kvr.mjs → layout-DFVbgjp2.mjs} +8 -7
  70. package/dist/_chunks/layout-DFVbgjp2.mjs.map +1 -0
  71. package/dist/_chunks/{layout-CLLtt_5O.js → layout-RC3W2obV.js} +8 -7
  72. package/dist/_chunks/layout-RC3W2obV.js.map +1 -0
  73. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  74. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  75. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  76. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  77. package/dist/_chunks/{relations-B0hlsUU_.mjs → relations-Dogh8HWI.mjs} +6 -7
  78. package/dist/_chunks/relations-Dogh8HWI.mjs.map +1 -0
  79. package/dist/_chunks/{relations-bRxcNv1q.js → relations-zam7-5H7.js} +6 -7
  80. package/dist/_chunks/relations-zam7-5H7.js.map +1 -0
  81. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  82. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  83. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  84. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  85. package/dist/admin/index.js +2 -1
  86. package/dist/admin/index.js.map +1 -1
  87. package/dist/admin/index.mjs +5 -4
  88. package/dist/admin/src/exports.d.ts +1 -1
  89. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  90. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  91. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  92. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  93. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  94. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  95. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
  96. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  97. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  98. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  99. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  100. package/dist/admin/src/preview/constants.d.ts +1 -0
  101. package/dist/admin/src/preview/index.d.ts +4 -0
  102. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  103. package/dist/admin/src/preview/routes.d.ts +3 -0
  104. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  105. package/dist/admin/src/router.d.ts +1 -1
  106. package/dist/admin/src/services/api.d.ts +1 -1
  107. package/dist/admin/src/services/components.d.ts +2 -2
  108. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  109. package/dist/admin/src/services/documents.d.ts +19 -17
  110. package/dist/admin/src/services/init.d.ts +1 -1
  111. package/dist/admin/src/services/relations.d.ts +2 -2
  112. package/dist/admin/src/services/uid.d.ts +3 -3
  113. package/dist/admin/src/utils/validation.d.ts +4 -1
  114. package/dist/server/index.js +421 -183
  115. package/dist/server/index.js.map +1 -1
  116. package/dist/server/index.mjs +421 -183
  117. package/dist/server/index.mjs.map +1 -1
  118. package/dist/server/src/bootstrap.d.ts.map +1 -1
  119. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  120. package/dist/server/src/controllers/index.d.ts.map +1 -1
  121. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  122. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  123. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  124. package/dist/server/src/history/services/history.d.ts.map +1 -1
  125. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  126. package/dist/server/src/history/services/utils.d.ts +3 -3
  127. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  128. package/dist/server/src/index.d.ts +4 -4
  129. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  130. package/dist/server/src/preview/constants.d.ts +2 -0
  131. package/dist/server/src/preview/constants.d.ts.map +1 -0
  132. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  133. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  134. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  135. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  136. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  137. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  138. package/dist/server/src/preview/index.d.ts +4 -0
  139. package/dist/server/src/preview/index.d.ts.map +1 -0
  140. package/dist/server/src/preview/routes/index.d.ts +8 -0
  141. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  142. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  143. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  144. package/dist/server/src/preview/services/index.d.ts +15 -0
  145. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  146. package/dist/server/src/preview/services/preview-config.d.ts +30 -0
  147. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  148. package/dist/server/src/preview/services/preview.d.ts +12 -0
  149. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  150. package/dist/server/src/preview/utils.d.ts +18 -0
  151. package/dist/server/src/preview/utils.d.ts.map +1 -0
  152. package/dist/server/src/routes/index.d.ts.map +1 -1
  153. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  154. package/dist/server/src/services/document-metadata.d.ts +8 -8
  155. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  156. package/dist/server/src/services/index.d.ts +4 -4
  157. package/dist/server/src/services/index.d.ts.map +1 -1
  158. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  159. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  160. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  161. package/dist/server/src/utils/index.d.ts +2 -0
  162. package/dist/server/src/utils/index.d.ts.map +1 -1
  163. package/dist/shared/contracts/collection-types.d.ts +3 -1
  164. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  165. package/dist/shared/contracts/index.d.ts +1 -0
  166. package/dist/shared/contracts/index.d.ts.map +1 -1
  167. package/dist/shared/contracts/preview.d.ts +27 -0
  168. package/dist/shared/contracts/preview.d.ts.map +1 -0
  169. package/dist/shared/index.js +4 -0
  170. package/dist/shared/index.js.map +1 -1
  171. package/dist/shared/index.mjs +4 -0
  172. package/dist/shared/index.mjs.map +1 -1
  173. package/package.json +14 -14
  174. package/dist/_chunks/EditViewPage-BVMS5hT-.mjs.map +0 -1
  175. package/dist/_chunks/EditViewPage-CXkmnAvI.js.map +0 -1
  176. package/dist/_chunks/Field-Ibi32diw.js.map +0 -1
  177. package/dist/_chunks/Field-nNgv5bpd.mjs.map +0 -1
  178. package/dist/_chunks/Form-Dhnh34ym.js.map +0 -1
  179. package/dist/_chunks/Form-DodJsI2A.mjs.map +0 -1
  180. package/dist/_chunks/History-C9auUkDi.js.map +0 -1
  181. package/dist/_chunks/History-CKCSQXz_.mjs.map +0 -1
  182. package/dist/_chunks/ListConfigurationPage-Bg4rWUjX.js.map +0 -1
  183. package/dist/_chunks/ListConfigurationPage-CKEC4ttG.mjs.map +0 -1
  184. package/dist/_chunks/ListViewPage-B7_WJUjG.mjs.map +0 -1
  185. package/dist/_chunks/ListViewPage-C2gIeYHG.js.map +0 -1
  186. package/dist/_chunks/Relations-C0uC9J4f.js.map +0 -1
  187. package/dist/_chunks/Relations-DItV5eow.mjs.map +0 -1
  188. package/dist/_chunks/index-Dd0nXyJF.js.map +0 -1
  189. package/dist/_chunks/index-DrNe6ctw.mjs.map +0 -1
  190. package/dist/_chunks/layout-B3ez7kvr.mjs.map +0 -1
  191. package/dist/_chunks/layout-CLLtt_5O.js.map +0 -1
  192. package/dist/_chunks/relations-B0hlsUU_.mjs.map +0 -1
  193. package/dist/_chunks/relations-bRxcNv1q.js.map +0 -1
  194. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  195. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  196. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  197. 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-Dd0nXyJF.js");
8
+ const index = require("./index-DOzAG2cq.js");
9
9
  const fractionalIndexing = require("fractional-indexing");
10
- const Relations = require("./Relations-C0uC9J4f.js");
10
+ const Relations = require("./Relations-BKnoK1R0.js");
11
11
  const Icons = require("@strapi/icons");
12
12
  const styledComponents = require("styled-components");
13
13
  const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
14
14
  const reactDndHtml5Backend = require("react-dnd-html5-backend");
15
15
  const useDragAndDrop = require("./useDragAndDrop-J0TUUbR6.js");
16
- const objects = require("./objects-gigeqt7s.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");
@@ -768,7 +768,7 @@ const ImageDialog = () => {
768
768
  const nodeImage = {
769
769
  ...expectedImage,
770
770
  alternativeText: expectedImage.alternativeText || expectedImage.name,
771
- url: usePrev.prefixFileUrlWithBackendUrl(image.url)
771
+ url: useDebounce.prefixFileUrlWithBackendUrl(image.url)
772
772
  };
773
773
  return nodeImage;
774
774
  });
@@ -1441,7 +1441,7 @@ const ToolbarButton = ({
1441
1441
  width: 7,
1442
1442
  height: 7,
1443
1443
  hasRadius: true,
1444
- children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { width: "1.2rem", height: "1.2rem", fill: disabled ? "neutral300" : enabledColor })
1444
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
1445
1445
  }
1446
1446
  )
1447
1447
  }
@@ -1783,6 +1783,7 @@ const DragItem = styledComponents.styled(designSystem.Flex)`
1783
1783
  }
1784
1784
  `;
1785
1785
  const DragIconButton = styledComponents.styled(designSystem.IconButton)`
1786
+ user-select: none;
1786
1787
  display: flex;
1787
1788
  align-items: center;
1788
1789
  justify-content: center;
@@ -1911,6 +1912,7 @@ const DragAndDropElement = ({
1911
1912
  DragIconButton,
1912
1913
  {
1913
1914
  tag: "div",
1915
+ contentEditable: false,
1914
1916
  role: "button",
1915
1917
  tabIndex: 0,
1916
1918
  withTooltip: false,
@@ -2656,7 +2658,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
2656
2658
  designSystem.Box,
2657
2659
  {
2658
2660
  tag: "button",
2659
- background: "neutral100",
2661
+ background: disabled ? "neutral150" : "neutral100",
2660
2662
  borderColor: field.error ? "danger600" : "neutral200",
2661
2663
  hasRadius: true,
2662
2664
  disabled,
@@ -2664,32 +2666,32 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
2664
2666
  paddingTop: 9,
2665
2667
  paddingBottom: 9,
2666
2668
  type: "button",
2669
+ style: { cursor: disabled ? "not-allowed" : "pointer" },
2667
2670
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
2668
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(CircleIcon, {}) }),
2669
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2670
- id: index.getTranslation("components.empty-repeatable"),
2671
- defaultMessage: "No entry yet. Click on the button below to add one."
2672
- }) }) })
2671
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
2672
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
2673
+ designSystem.Typography,
2674
+ {
2675
+ textColor: disabled ? "neutral600" : "primary600",
2676
+ variant: "pi",
2677
+ fontWeight: "bold",
2678
+ children: formatMessage({
2679
+ id: index.getTranslation("components.empty-repeatable"),
2680
+ defaultMessage: "No entry yet. Click to add one."
2681
+ })
2682
+ }
2683
+ ) })
2673
2684
  ] })
2674
2685
  }
2675
2686
  ) });
2676
2687
  };
2677
- const CircleIcon = styledComponents.styled(Icons.PlusCircle)`
2678
- width: 2.4rem;
2679
- height: 2.4rem;
2680
- > circle {
2681
- fill: ${({ theme }) => theme.colors.primary200};
2682
- }
2683
- > path {
2684
- fill: ${({ theme }) => theme.colors.primary600};
2685
- }
2686
- `;
2687
2688
  const NonRepeatableComponent = ({
2688
2689
  attribute,
2689
2690
  name: name2,
2690
2691
  children,
2691
2692
  layout
2692
2693
  }) => {
2694
+ const { formatMessage } = reactIntl.useIntl();
2693
2695
  const { value } = strapiAdmin.useField(name2);
2694
2696
  const level = Relations.useComponent("NonRepeatableComponent", (state) => state.level);
2695
2697
  const isNested = level > 0;
@@ -2706,7 +2708,22 @@ const NonRepeatableComponent = ({
2706
2708
  children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index2) => {
2707
2709
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2708
2710
  const completeFieldName = `${name2}.${field.name}`;
2709
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2711
+ const translatedLabel = formatMessage({
2712
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2713
+ defaultMessage: field.label
2714
+ });
2715
+ return /* @__PURE__ */ jsxRuntime.jsx(
2716
+ designSystem.Grid.Item,
2717
+ {
2718
+ col: size,
2719
+ s: 12,
2720
+ xs: 12,
2721
+ direction: "column",
2722
+ alignItems: "stretch",
2723
+ children: children({ ...field, label: translatedLabel, name: completeFieldName })
2724
+ },
2725
+ completeFieldName
2726
+ );
2710
2727
  }) }, index2);
2711
2728
  }) })
2712
2729
  }
@@ -2725,13 +2742,34 @@ const RepeatableComponent = ({
2725
2742
  const { search: searchString } = reactRouterDom.useLocation();
2726
2743
  const search = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
2727
2744
  const { components } = index.useDoc();
2728
- const { value = [], error } = strapiAdmin.useField(name2);
2745
+ const {
2746
+ value = [],
2747
+ error,
2748
+ rawError
2749
+ } = strapiAdmin.useField(name2);
2729
2750
  const addFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.addFieldRow);
2730
2751
  const moveFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.moveFieldRow);
2731
2752
  const removeFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.removeFieldRow);
2732
2753
  const { max = Infinity } = attribute;
2733
2754
  const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
2734
2755
  const [liveText, setLiveText] = React__namespace.useState("");
2756
+ React__namespace.useEffect(() => {
2757
+ const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
2758
+ const hasNestedValue = value && Array.isArray(value) && value.length > 0;
2759
+ if (hasNestedErrors && hasNestedValue) {
2760
+ const errorOpenItems = rawError.map((_, idx) => {
2761
+ return value[idx] ? value[idx].__temp_key__ : null;
2762
+ }).filter((value2) => !!value2);
2763
+ if (errorOpenItems && errorOpenItems.length > 0) {
2764
+ setCollapseToOpen((collapseToOpen2) => {
2765
+ if (!errorOpenItems.includes(collapseToOpen2)) {
2766
+ return errorOpenItems[0];
2767
+ }
2768
+ return collapseToOpen2;
2769
+ });
2770
+ }
2771
+ }
2772
+ }, [rawError, value]);
2735
2773
  const componentTmpKeyWithFocussedField = React__namespace.useMemo(() => {
2736
2774
  if (search.has("field")) {
2737
2775
  const fieldParam = search.get("field");
@@ -2746,7 +2784,7 @@ const RepeatableComponent = ({
2746
2784
  }
2747
2785
  return void 0;
2748
2786
  }, [search, name2, value]);
2749
- const prevValue = usePrev.usePrev(value);
2787
+ const prevValue = useDebounce.usePrev(value);
2750
2788
  React__namespace.useEffect(() => {
2751
2789
  if (prevValue && prevValue.length < value.length) {
2752
2790
  setCollapseToOpen(value[value.length - 1].__temp_key__);
@@ -2884,7 +2922,26 @@ const RepeatableComponent = ({
2884
2922
  children: layout.map((row, index22) => {
2885
2923
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2886
2924
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2887
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2925
+ const translatedLabel = formatMessage({
2926
+ id: `content-manager.components.${attribute.component}.${field.name}`,
2927
+ defaultMessage: field.label
2928
+ });
2929
+ return /* @__PURE__ */ jsxRuntime.jsx(
2930
+ designSystem.Grid.Item,
2931
+ {
2932
+ col: size,
2933
+ s: 12,
2934
+ xs: 12,
2935
+ direction: "column",
2936
+ alignItems: "stretch",
2937
+ children: children({
2938
+ ...field,
2939
+ label: translatedLabel,
2940
+ name: completeFieldName
2941
+ })
2942
+ },
2943
+ completeFieldName
2944
+ );
2888
2945
  }) }, index22);
2889
2946
  })
2890
2947
  }
@@ -2979,7 +3036,7 @@ const Component = ({
2979
3036
  /* @__PURE__ */ jsxRuntime.jsx(
2980
3037
  designSystem.IconButton,
2981
3038
  {
2982
- borderWidth: 0,
3039
+ variant: "ghost",
2983
3040
  onClick: onDeleteComponent,
2984
3041
  label: formatMessage({
2985
3042
  id: index.getTranslation("containers.Edit.delete"),
@@ -2992,7 +3049,7 @@ const Component = ({
2992
3049
  designSystem.IconButton,
2993
3050
  {
2994
3051
  ref: composedAccordionRefs,
2995
- borderWidth: 0,
3052
+ variant: "ghost",
2996
3053
  onClick: (e) => e.stopPropagation(),
2997
3054
  "data-handler-id": handlerId,
2998
3055
  label: formatMessage({
@@ -3062,7 +3119,7 @@ const ComponentInput = ({
3062
3119
  id: index.getTranslation("components.reset-entry"),
3063
3120
  defaultMessage: "Reset Entry"
3064
3121
  }),
3065
- borderWidth: 0,
3122
+ variant: "ghost",
3066
3123
  onClick: () => {
3067
3124
  field.onChange(name2, null);
3068
3125
  },
@@ -3091,11 +3148,8 @@ const AddComponentButton = ({
3091
3148
  onClick,
3092
3149
  disabled: isDisabled,
3093
3150
  background: "neutral0",
3094
- paddingTop: 3,
3095
- paddingBottom: 3,
3096
- paddingLeft: 4,
3097
- paddingRight: 4,
3098
3151
  style: { cursor: isDisabled ? "not-allowed" : "pointer" },
3152
+ variant: "tertiary",
3099
3153
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
3100
3154
  /* @__PURE__ */ jsxRuntime.jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
3101
3155
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3124,10 +3178,11 @@ const StyledAddIcon = styledComponents.styled(Icons.PlusCircle)`
3124
3178
  }
3125
3179
  `;
3126
3180
  const AddComponentTitle = styledComponents.styled(designSystem.Typography)``;
3127
- const StyledButton = styledComponents.styled(designSystem.BaseButton)`
3181
+ const StyledButton = styledComponents.styled(designSystem.Button)`
3128
3182
  border-radius: 26px;
3129
3183
  border-color: ${({ theme }) => theme.colors.neutral150};
3130
3184
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
3185
+ height: 5rem;
3131
3186
 
3132
3187
  &:hover {
3133
3188
  ${AddComponentTitle} {
@@ -3139,7 +3194,7 @@ const StyledButton = styledComponents.styled(designSystem.BaseButton)`
3139
3194
  fill: ${({ theme }) => theme.colors.primary600};
3140
3195
  }
3141
3196
  > path {
3142
- fill: ${({ theme }) => theme.colors.neutral100};
3197
+ fill: ${({ theme }) => theme.colors.primary600};
3143
3198
  }
3144
3199
  }
3145
3200
  }
@@ -3270,18 +3325,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
3270
3325
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
3271
3326
  ] });
3272
3327
  };
3273
- function useDebounce(value, delay) {
3274
- const [debouncedValue, setDebouncedValue] = React.useState(value);
3275
- React.useEffect(() => {
3276
- const handler = setTimeout(() => {
3277
- setDebouncedValue(value);
3278
- }, delay);
3279
- return () => {
3280
- clearTimeout(handler);
3281
- };
3282
- }, [value, delay]);
3283
- return debouncedValue;
3284
- }
3285
3328
  const uidApi = index.contentManagerApi.injectEndpoints({
3286
3329
  endpoints: (builder) => ({
3287
3330
  getDefaultUID: builder.query({
@@ -3316,7 +3359,10 @@ const uidApi = index.contentManagerApi.injectEndpoints({
3316
3359
  config: {
3317
3360
  params
3318
3361
  }
3319
- })
3362
+ }),
3363
+ providesTags: (_res, _error, params) => [
3364
+ { type: "UidAvailability", id: params.contentTypeUID }
3365
+ ]
3320
3366
  })
3321
3367
  })
3322
3368
  });
@@ -3328,8 +3374,10 @@ const UIDInput = React__namespace.forwardRef(
3328
3374
  const allFormValues = strapiAdmin.useForm("InputUID", (form) => form.values);
3329
3375
  const [availability, setAvailability] = React__namespace.useState();
3330
3376
  const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
3377
+ const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
3331
3378
  const field = strapiAdmin.useField(name2);
3332
- const debouncedValue = useDebounce(field.value, 300);
3379
+ const debouncedValue = useDebounce.useDebounce(field.value, 300);
3380
+ const hasChanged = debouncedValue !== field.initialValue;
3333
3381
  const { toggleNotification } = strapiAdmin.useNotification();
3334
3382
  const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
3335
3383
  const { formatMessage } = reactIntl.useIntl();
@@ -3405,8 +3453,9 @@ const UIDInput = React__namespace.forwardRef(
3405
3453
  params
3406
3454
  },
3407
3455
  {
3456
+ // Don't check availability if the value is empty or wasn't changed
3408
3457
  skip: !Boolean(
3409
- debouncedValue !== field.initialValue && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3458
+ (hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3410
3459
  )
3411
3460
  }
3412
3461
  );
@@ -3435,6 +3484,7 @@ const UIDInput = React__namespace.forwardRef(
3435
3484
  const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
3436
3485
  const fieldRef = strapiAdmin.useFocusInputField(name2);
3437
3486
  const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
3487
+ const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
3438
3488
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name: name2, error: field.error, required, children: [
3439
3489
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
3440
3490
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3443,7 +3493,7 @@ const UIDInput = React__namespace.forwardRef(
3443
3493
  ref: composedRefs,
3444
3494
  disabled: props.disabled,
3445
3495
  endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { position: "relative", gap: 1, children: [
3446
- availability && !showRegenerate && /* @__PURE__ */ jsxRuntime.jsxs(
3496
+ shouldShowAvailability && /* @__PURE__ */ jsxRuntime.jsxs(
3447
3497
  TextValidation,
3448
3498
  {
3449
3499
  alignItems: "center",
@@ -4277,7 +4327,7 @@ const EditorLayout = ({
4277
4327
  justifyContent: "flex-end",
4278
4328
  shrink: 0,
4279
4329
  width: "100%",
4280
- children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, children: [
4330
+ children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
4281
4331
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
4282
4332
  id: "components.Wysiwyg.collapse",
4283
4333
  defaultMessage: "Collapse"
@@ -4295,12 +4345,14 @@ const EditorLayout = ({
4295
4345
  ) }) });
4296
4346
  }
4297
4347
  return /* @__PURE__ */ jsxRuntime.jsx(
4298
- designSystem.Box,
4348
+ designSystem.Flex,
4299
4349
  {
4300
4350
  borderColor: error ? "danger600" : "neutral200",
4301
4351
  borderStyle: "solid",
4302
4352
  borderWidth: "1px",
4303
4353
  hasRadius: true,
4354
+ direction: "column",
4355
+ alignItems: "stretch",
4304
4356
  children
4305
4357
  }
4306
4358
  );
@@ -4311,11 +4363,19 @@ const ExpandWrapper = styledComponents.styled(designSystem.Flex)`
4311
4363
  const BoxWithBorder = styledComponents.styled(designSystem.Box)`
4312
4364
  border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
4313
4365
  `;
4314
- const ExpandButton$1 = styledComponents.styled(designSystem.BaseButton)`
4366
+ const ExpandButton$1 = styledComponents.styled(designSystem.Button)`
4315
4367
  background-color: transparent;
4316
4368
  border: none;
4317
4369
  align-items: center;
4318
4370
 
4371
+ & > span {
4372
+ display: flex;
4373
+ justify-content: space-between;
4374
+ align-items: center;
4375
+ width: 100%;
4376
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4377
+ }
4378
+
4319
4379
  svg {
4320
4380
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4321
4381
 
@@ -4582,40 +4642,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4582
4642
  insertWithoutTextToEdit(editor, markdownType, line, contentLength);
4583
4643
  }
4584
4644
  };
4585
- const CustomIconButton = styledComponents.styled(designSystem.IconButton)`
4586
- padding: ${({ theme }) => theme.spaces[2]};
4587
-
4588
- svg {
4589
- width: 1.8rem;
4590
- height: 1.8rem;
4591
- }
4592
- `;
4593
- const CustomLinkIconButton = styledComponents.styled(CustomIconButton)`
4594
- svg {
4595
- width: 0.8rem;
4596
- height: 0.8rem;
4597
- }
4598
- `;
4599
4645
  const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
4600
4646
  margin-left: ${({ theme }) => theme.spaces[4]};
4601
4647
  `;
4602
4648
  const MoreButton = styledComponents.styled(designSystem.IconButton)`
4603
4649
  margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
4604
- padding: ${({ theme }) => theme.spaces[2]};
4605
-
4606
- svg {
4607
- width: 1.8rem;
4608
- height: 1.8rem;
4609
- }
4610
4650
  `;
4611
4651
  const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
4612
4652
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
4613
4653
  `;
4614
- const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
4654
+ const ExpandButton = styledComponents.styled(designSystem.Button)`
4615
4655
  background-color: transparent;
4616
4656
  border: none;
4617
4657
  align-items: center;
4618
4658
 
4659
+ & > span {
4660
+ display: flex;
4661
+ justify-content: space-between;
4662
+ align-items: center;
4663
+ width: 100%;
4664
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4665
+ }
4666
+
4619
4667
  svg {
4620
4668
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4621
4669
  path {
@@ -4627,7 +4675,7 @@ const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
4627
4675
  `;
4628
4676
  const WysiwygFooter = ({ onToggleExpand }) => {
4629
4677
  const { formatMessage } = reactIntl.useIntl();
4630
- 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: [
4678
+ 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: [
4631
4679
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: formatMessage({
4632
4680
  id: "components.WysiwygBottomControls.fullscreen",
4633
4681
  defaultMessage: "Expand"
@@ -4664,18 +4712,27 @@ const WysiwygNav = ({
4664
4712
  borderRadius: `0.4rem 0.4rem 0 0`,
4665
4713
  children: [
4666
4714
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
4667
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.SingleSelect, { disabled: true, placeholder: selectPlaceholder, "aria-label": selectPlaceholder, children: [
4668
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4669
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
4670
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
4671
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
4672
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
4673
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
4674
- ] }) }),
4715
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
4716
+ designSystem.SingleSelect,
4717
+ {
4718
+ disabled: true,
4719
+ placeholder: selectPlaceholder,
4720
+ "aria-label": selectPlaceholder,
4721
+ size: "S",
4722
+ children: [
4723
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4724
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
4725
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
4726
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
4727
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
4728
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
4729
+ ]
4730
+ }
4731
+ ) }),
4675
4732
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4676
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4677
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
4678
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
4733
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4734
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
4735
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
4679
4736
  ] }),
4680
4737
  /* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
4681
4738
  ] }),
@@ -4702,6 +4759,7 @@ const WysiwygNav = ({
4702
4759
  placeholder: selectPlaceholder,
4703
4760
  "aria-label": selectPlaceholder,
4704
4761
  onChange: (value) => onActionClick(value, editorRef),
4762
+ size: "S",
4705
4763
  children: [
4706
4764
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4707
4765
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
@@ -4713,17 +4771,9 @@ const WysiwygNav = ({
4713
4771
  }
4714
4772
  ) }),
4715
4773
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4774
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4716
4775
  /* @__PURE__ */ jsxRuntime.jsx(
4717
- CustomIconButton,
4718
- {
4719
- onClick: () => onActionClick("Bold", editorRef),
4720
- label: "Bold",
4721
- name: "Bold",
4722
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {})
4723
- }
4724
- ),
4725
- /* @__PURE__ */ jsxRuntime.jsx(
4726
- CustomIconButton,
4776
+ designSystem.IconButton,
4727
4777
  {
4728
4778
  onClick: () => onActionClick("Italic", editorRef),
4729
4779
  label: "Italic",
@@ -4732,7 +4782,7 @@ const WysiwygNav = ({
4732
4782
  }
4733
4783
  ),
4734
4784
  /* @__PURE__ */ jsxRuntime.jsx(
4735
- CustomIconButton,
4785
+ designSystem.IconButton,
4736
4786
  {
4737
4787
  onClick: () => onActionClick("Underline", editorRef),
4738
4788
  label: "Underline",
@@ -4746,7 +4796,7 @@ const WysiwygNav = ({
4746
4796
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
4747
4797
  /* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
4748
4798
  /* @__PURE__ */ jsxRuntime.jsx(
4749
- CustomIconButton,
4799
+ designSystem.IconButton,
4750
4800
  {
4751
4801
  onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4752
4802
  label: "Strikethrough",
@@ -4755,7 +4805,7 @@ const WysiwygNav = ({
4755
4805
  }
4756
4806
  ),
4757
4807
  /* @__PURE__ */ jsxRuntime.jsx(
4758
- CustomIconButton,
4808
+ designSystem.IconButton,
4759
4809
  {
4760
4810
  onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4761
4811
  label: "BulletList",
@@ -4764,7 +4814,7 @@ const WysiwygNav = ({
4764
4814
  }
4765
4815
  ),
4766
4816
  /* @__PURE__ */ jsxRuntime.jsx(
4767
- CustomIconButton,
4817
+ designSystem.IconButton,
4768
4818
  {
4769
4819
  onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4770
4820
  label: "NumberList",
@@ -4775,7 +4825,7 @@ const WysiwygNav = ({
4775
4825
  ] }),
4776
4826
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
4777
4827
  /* @__PURE__ */ jsxRuntime.jsx(
4778
- CustomIconButton,
4828
+ designSystem.IconButton,
4779
4829
  {
4780
4830
  onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4781
4831
  label: "Code",
@@ -4784,7 +4834,7 @@ const WysiwygNav = ({
4784
4834
  }
4785
4835
  ),
4786
4836
  /* @__PURE__ */ jsxRuntime.jsx(
4787
- CustomIconButton,
4837
+ designSystem.IconButton,
4788
4838
  {
4789
4839
  onClick: () => {
4790
4840
  handleTogglePopover();
@@ -4796,7 +4846,7 @@ const WysiwygNav = ({
4796
4846
  }
4797
4847
  ),
4798
4848
  /* @__PURE__ */ jsxRuntime.jsx(
4799
- CustomLinkIconButton,
4849
+ designSystem.IconButton,
4800
4850
  {
4801
4851
  onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4802
4852
  label: "Link",
@@ -4805,7 +4855,7 @@ const WysiwygNav = ({
4805
4855
  }
4806
4856
  ),
4807
4857
  /* @__PURE__ */ jsxRuntime.jsx(
4808
- CustomIconButton,
4858
+ designSystem.IconButton,
4809
4859
  {
4810
4860
  onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4811
4861
  label: "Quote",
@@ -4883,7 +4933,7 @@ const Wysiwyg = React__namespace.forwardRef(
4883
4933
  const handleSelectAssets = (files) => {
4884
4934
  const formattedFiles = files.map((f) => ({
4885
4935
  alt: f.alternativeText || f.name,
4886
- url: usePrev.prefixFileUrlWithBackendUrl(f.url),
4936
+ url: useDebounce.prefixFileUrlWithBackendUrl(f.url),
4887
4937
  mime: f.mime
4888
4938
  }));
4889
4939
  insertFile(editorRef, formattedFiles);
@@ -4942,15 +4992,19 @@ const Wysiwyg = React__namespace.forwardRef(
4942
4992
  );
4943
4993
  const MemoizedWysiwyg = React__namespace.memo(Wysiwyg);
4944
4994
  const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4945
- const { id } = index.useDoc();
4995
+ const { id, document: document2, collectionType } = index.useDoc();
4946
4996
  const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
4947
4997
  const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
4948
4998
  const canCreateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
4949
4999
  const canReadFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
4950
5000
  const canUpdateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
4951
5001
  const canUserAction = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
4952
- const editableFields = id ? canUpdateFields : canCreateFields;
4953
- const readableFields = id ? canReadFields : canCreateFields;
5002
+ let idToCheck = id;
5003
+ if (collectionType === index.SINGLE_TYPES) {
5004
+ idToCheck = document2?.documentId;
5005
+ }
5006
+ const editableFields = idToCheck ? canUpdateFields : canCreateFields;
5007
+ const readableFields = idToCheck ? canReadFields : canCreateFields;
4954
5008
  const canUserReadField = canUserAction(props.name, readableFields, props.type);
4955
5009
  const canUserEditField = canUserAction(props.name, editableFields, props.type);
4956
5010
  const fields = strapiAdmin.useStrapiApp("InputRenderer", (app) => app.fields);
@@ -4961,6 +5015,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4961
5015
  const {
4962
5016
  edit: { components }
4963
5017
  } = index.useDocLayout();
5018
+ const field = strapiAdmin.useField(props.name);
4964
5019
  if (!visible) {
4965
5020
  return null;
4966
5021
  }
@@ -4971,7 +5026,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4971
5026
  if (attributeHasCustomFieldProperty(props.attribute)) {
4972
5027
  const CustomInput = lazyComponentStore[props.attribute.customField];
4973
5028
  if (CustomInput) {
4974
- return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
5029
+ return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
4975
5030
  }
4976
5031
  return /* @__PURE__ */ jsxRuntime.jsx(
4977
5032
  strapiAdmin.InputRenderer,
@@ -5132,12 +5187,20 @@ const DynamicComponent = ({
5132
5187
  React__namespace.useEffect(() => {
5133
5188
  dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
5134
5189
  }, [dragPreviewRef, index$1]);
5190
+ const accordionValue = React__namespace.useId();
5191
+ const { value = [], rawError } = strapiAdmin.useField(`${name2}.${index$1}`);
5192
+ const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
5193
+ React__namespace.useEffect(() => {
5194
+ if (rawError && value) {
5195
+ setCollapseToOpen(accordionValue);
5196
+ }
5197
+ }, [rawError, value, accordionValue]);
5135
5198
  const composedBoxRefs = designSystem.useComposedRefs(boxRef, dropRef);
5136
5199
  const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5137
5200
  /* @__PURE__ */ jsxRuntime.jsx(
5138
5201
  designSystem.IconButton,
5139
5202
  {
5140
- borderWidth: 0,
5203
+ variant: "ghost",
5141
5204
  label: formatMessage(
5142
5205
  {
5143
5206
  id: index.getTranslation("components.DynamicZone.delete-label"),
@@ -5152,7 +5215,7 @@ const DynamicComponent = ({
5152
5215
  /* @__PURE__ */ jsxRuntime.jsx(
5153
5216
  designSystem.IconButton,
5154
5217
  {
5155
- borderWidth: 0,
5218
+ variant: "ghost",
5156
5219
  onClick: (e) => e.stopPropagation(),
5157
5220
  "data-handler-id": handlerId,
5158
5221
  ref: dragRef,
@@ -5197,10 +5260,9 @@ const DynamicComponent = ({
5197
5260
  ] })
5198
5261
  ] });
5199
5262
  const accordionTitle = title ? `${displayName} ${title}` : displayName;
5200
- const accordionValue = React__namespace.useId();
5201
5263
  return /* @__PURE__ */ jsxRuntime.jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
5202
5264
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Rectangle, { background: "neutral200" }) }),
5203
- /* @__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: [
5265
+ /* @__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: [
5204
5266
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
5205
5267
  /* @__PURE__ */ jsxRuntime.jsx(
5206
5268
  designSystem.Accordion.Trigger,
@@ -5211,10 +5273,39 @@ const DynamicComponent = ({
5211
5273
  ),
5212
5274
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: accordionActions })
5213
5275
  ] }),
5214
- /* @__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 }) => {
5215
- const fieldName = `${name2}.${index$1}.${field.name}`;
5216
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
5217
- }) }, rowInd)) }) }) })
5276
+ /* @__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(
5277
+ designSystem.Grid.Item,
5278
+ {
5279
+ col: 12,
5280
+ s: 12,
5281
+ xs: 12,
5282
+ direction: "column",
5283
+ alignItems: "stretch",
5284
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5285
+ const fieldName = `${name2}.${index$1}.${field.name}`;
5286
+ const fieldWithTranslatedLabel = {
5287
+ ...field,
5288
+ label: formatMessage({
5289
+ id: `content-manager.components.${componentUid}.${field.name}`,
5290
+ defaultMessage: field.label
5291
+ })
5292
+ };
5293
+ return /* @__PURE__ */ jsxRuntime.jsx(
5294
+ designSystem.Grid.Item,
5295
+ {
5296
+ col: size,
5297
+ s: 12,
5298
+ xs: 12,
5299
+ direction: "column",
5300
+ alignItems: "stretch",
5301
+ children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
5302
+ },
5303
+ fieldName
5304
+ );
5305
+ }) })
5306
+ },
5307
+ rowInd
5308
+ )) }) }) }) })
5218
5309
  ] }) }) })
5219
5310
  ] });
5220
5311
  };
@@ -5520,4 +5611,4 @@ exports.transformDocument = transformDocument;
5520
5611
  exports.useDynamicZone = useDynamicZone;
5521
5612
  exports.useFieldHint = useFieldHint;
5522
5613
  exports.useLazyComponents = useLazyComponents;
5523
- //# sourceMappingURL=Field-Ibi32diw.js.map
5614
+ //# sourceMappingURL=Field-DNHm4wHx.js.map