@strapi/content-manager 5.0.0-rc.9 → 5.0.0

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 (110) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-BwnO0su2.mjs → ComponentConfigurationPage-DfFSZQxe.mjs} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-BwnO0su2.mjs.map → ComponentConfigurationPage-DfFSZQxe.mjs.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-BOKmq7mz.js → ComponentConfigurationPage-FqfsxQ1j.js} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-BOKmq7mz.js.map → ComponentConfigurationPage-FqfsxQ1j.js.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-N3OaN53v.js → EditConfigurationPage-Cn0e8t3I.js} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-N3OaN53v.js.map → EditConfigurationPage-Cn0e8t3I.js.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-DJDSIf3D.mjs → EditConfigurationPage-DdPNAbl3.mjs} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-DJDSIf3D.mjs.map → EditConfigurationPage-DdPNAbl3.mjs.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-IZbGSeL3.mjs → EditViewPage-B82x_x1b.mjs} +15 -5
  10. package/dist/_chunks/EditViewPage-B82x_x1b.mjs.map +1 -0
  11. package/dist/_chunks/{EditViewPage-l9qOdDUI.js → EditViewPage-DlxEHhUt.js} +15 -5
  12. package/dist/_chunks/EditViewPage-DlxEHhUt.js.map +1 -0
  13. package/dist/_chunks/{Field-CWjyW47-.js → Field-COL25JiC.js} +100 -87
  14. package/dist/_chunks/Field-COL25JiC.js.map +1 -0
  15. package/dist/_chunks/{Field-D3mNj-iY.mjs → Field-DufHXW17.mjs} +97 -84
  16. package/dist/_chunks/Field-DufHXW17.mjs.map +1 -0
  17. package/dist/_chunks/{Form-DFXXFrJV.js → Form-BssUwrTO.js} +16 -8
  18. package/dist/_chunks/Form-BssUwrTO.js.map +1 -0
  19. package/dist/_chunks/{Form-Ddy3XYS-.mjs → Form-u_kAOhwB.mjs} +16 -8
  20. package/dist/_chunks/Form-u_kAOhwB.mjs.map +1 -0
  21. package/dist/_chunks/{History-pesEeFFT.js → History-C9t9UqpO.js} +23 -10
  22. package/dist/_chunks/History-C9t9UqpO.js.map +1 -0
  23. package/dist/_chunks/{History-BEFrLZfz.mjs → History-DRwA3oMM.mjs} +24 -11
  24. package/dist/_chunks/History-DRwA3oMM.mjs.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-BIoi-Sog.js → ListConfigurationPage-BXYPohh-.js} +2 -2
  26. package/dist/_chunks/{ListConfigurationPage-BIoi-Sog.js.map → ListConfigurationPage-BXYPohh-.js.map} +1 -1
  27. package/dist/_chunks/{ListConfigurationPage-CB_lBFVX.mjs → ListConfigurationPage-BxfQJzPk.mjs} +2 -2
  28. package/dist/_chunks/{ListConfigurationPage-CB_lBFVX.mjs.map → ListConfigurationPage-BxfQJzPk.mjs.map} +1 -1
  29. package/dist/_chunks/{ListViewPage-DBbH7Esr.mjs → ListViewPage-CELx2ysp.mjs} +40 -36
  30. package/dist/_chunks/ListViewPage-CELx2ysp.mjs.map +1 -0
  31. package/dist/_chunks/{ListViewPage-C6FK36UI.js → ListViewPage-D2VD8Szg.js} +43 -39
  32. package/dist/_chunks/ListViewPage-D2VD8Szg.js.map +1 -0
  33. package/dist/_chunks/{NoContentTypePage-Dod8M_xM.js → NoContentTypePage-BV9IjJSM.js} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-Dod8M_xM.js.map → NoContentTypePage-BV9IjJSM.js.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-BU9Omzp4.mjs → NoContentTypePage-DtJ9jcfk.mjs} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-BU9Omzp4.mjs.map → NoContentTypePage-DtJ9jcfk.mjs.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-B88W05rh.mjs → NoPermissionsPage-DWleVYK7.mjs} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-B88W05rh.mjs.map → NoPermissionsPage-DWleVYK7.mjs.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-CMLH3uMk.js → NoPermissionsPage-Dp8NpF9I.js} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-CMLH3uMk.js.map → NoPermissionsPage-Dp8NpF9I.js.map} +1 -1
  41. package/dist/_chunks/{Relations-BBJRxopY.mjs → Relations-BTcf5xaw.mjs} +32 -23
  42. package/dist/_chunks/Relations-BTcf5xaw.mjs.map +1 -0
  43. package/dist/_chunks/{Relations-OXbsEvNt.js → Relations-DR7EUgyC.js} +32 -23
  44. package/dist/_chunks/Relations-DR7EUgyC.js.map +1 -0
  45. package/dist/_chunks/{en-uOUIxfcQ.js → en-Bm0D0IWz.js} +13 -12
  46. package/dist/_chunks/{en-uOUIxfcQ.js.map → en-Bm0D0IWz.js.map} +1 -1
  47. package/dist/_chunks/{en-BrCTWlZv.mjs → en-DKV44jRb.mjs} +13 -12
  48. package/dist/_chunks/{en-BrCTWlZv.mjs.map → en-DKV44jRb.mjs.map} +1 -1
  49. package/dist/_chunks/{index-Bj8wwbdx.js → index-BdMf2lfT.js} +1879 -1765
  50. package/dist/_chunks/index-BdMf2lfT.js.map +1 -0
  51. package/dist/_chunks/{index-BgiNQ7Q9.mjs → index-wnqzm4Q8.mjs} +1899 -1785
  52. package/dist/_chunks/index-wnqzm4Q8.mjs.map +1 -0
  53. package/dist/_chunks/{layout-LOFMsdWo.mjs → layout-2CfjL0T9.mjs} +5 -4
  54. package/dist/_chunks/{layout-LOFMsdWo.mjs.map → layout-2CfjL0T9.mjs.map} +1 -1
  55. package/dist/_chunks/{layout-DBvOIgWG.js → layout-B2MyZU-_.js} +5 -4
  56. package/dist/_chunks/{layout-DBvOIgWG.js.map → layout-B2MyZU-_.js.map} +1 -1
  57. package/dist/_chunks/{relations-BLilXMyN.js → relations-BH7JJGGe.js} +2 -2
  58. package/dist/_chunks/{relations-BLilXMyN.js.map → relations-BH7JJGGe.js.map} +1 -1
  59. package/dist/_chunks/{relations-BTQKCDqX.mjs → relations-C0w0GcXi.mjs} +2 -2
  60. package/dist/_chunks/{relations-BTQKCDqX.mjs.map → relations-C0w0GcXi.mjs.map} +1 -1
  61. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  62. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  63. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  64. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  65. package/dist/admin/index.js +2 -1
  66. package/dist/admin/index.js.map +1 -1
  67. package/dist/admin/index.mjs +5 -4
  68. package/dist/admin/src/exports.d.ts +1 -1
  69. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  70. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  71. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +0 -32
  72. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  73. package/dist/admin/src/services/api.d.ts +1 -1
  74. package/dist/admin/src/services/components.d.ts +2 -2
  75. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  76. package/dist/admin/src/services/documents.d.ts +19 -17
  77. package/dist/admin/src/services/init.d.ts +1 -1
  78. package/dist/admin/src/services/relations.d.ts +2 -2
  79. package/dist/admin/src/services/uid.d.ts +3 -3
  80. package/dist/server/index.js +48 -21
  81. package/dist/server/index.js.map +1 -1
  82. package/dist/server/index.mjs +48 -21
  83. package/dist/server/index.mjs.map +1 -1
  84. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  85. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  86. package/dist/server/src/history/services/history.d.ts.map +1 -1
  87. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  88. package/dist/server/src/history/services/utils.d.ts +1 -0
  89. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  90. package/dist/shared/contracts/collection-types.d.ts +3 -1
  91. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  92. package/package.json +12 -12
  93. package/dist/_chunks/EditViewPage-IZbGSeL3.mjs.map +0 -1
  94. package/dist/_chunks/EditViewPage-l9qOdDUI.js.map +0 -1
  95. package/dist/_chunks/Field-CWjyW47-.js.map +0 -1
  96. package/dist/_chunks/Field-D3mNj-iY.mjs.map +0 -1
  97. package/dist/_chunks/Form-DFXXFrJV.js.map +0 -1
  98. package/dist/_chunks/Form-Ddy3XYS-.mjs.map +0 -1
  99. package/dist/_chunks/History-BEFrLZfz.mjs.map +0 -1
  100. package/dist/_chunks/History-pesEeFFT.js.map +0 -1
  101. package/dist/_chunks/ListViewPage-C6FK36UI.js.map +0 -1
  102. package/dist/_chunks/ListViewPage-DBbH7Esr.mjs.map +0 -1
  103. package/dist/_chunks/Relations-BBJRxopY.mjs.map +0 -1
  104. package/dist/_chunks/Relations-OXbsEvNt.js.map +0 -1
  105. package/dist/_chunks/index-BgiNQ7Q9.mjs.map +0 -1
  106. package/dist/_chunks/index-Bj8wwbdx.js.map +0 -1
  107. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  108. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  109. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  110. package/strapi-server.js +0 -3
@@ -5,9 +5,9 @@ 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-Bj8wwbdx.js");
8
+ const index = require("./index-BdMf2lfT.js");
9
9
  const fractionalIndexing = require("fractional-indexing");
10
- const Relations = require("./Relations-OXbsEvNt.js");
10
+ const Relations = require("./Relations-DR7EUgyC.js");
11
11
  const Icons = require("@strapi/icons");
12
12
  const styledComponents = require("styled-components");
13
13
  const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
@@ -17,7 +17,7 @@ const objects = require("./objects-gigeqt7s.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,
@@ -2736,13 +2738,34 @@ const RepeatableComponent = ({
2736
2738
  const { search: searchString } = reactRouterDom.useLocation();
2737
2739
  const search = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
2738
2740
  const { components } = index.useDoc();
2739
- const { value = [], error } = strapiAdmin.useField(name2);
2741
+ const {
2742
+ value = [],
2743
+ error,
2744
+ rawError
2745
+ } = strapiAdmin.useField(name2);
2740
2746
  const addFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.addFieldRow);
2741
2747
  const moveFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.moveFieldRow);
2742
2748
  const removeFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.removeFieldRow);
2743
2749
  const { max = Infinity } = attribute;
2744
2750
  const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
2745
2751
  const [liveText, setLiveText] = React__namespace.useState("");
2752
+ React__namespace.useEffect(() => {
2753
+ const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
2754
+ const hasNestedValue = value && Array.isArray(value) && value.length > 0;
2755
+ if (hasNestedErrors && hasNestedValue) {
2756
+ const errorOpenItems = rawError.map((_, idx) => {
2757
+ return value[idx] ? value[idx].__temp_key__ : null;
2758
+ }).filter((value2) => !!value2);
2759
+ if (errorOpenItems && errorOpenItems.length > 0) {
2760
+ setCollapseToOpen((collapseToOpen2) => {
2761
+ if (!errorOpenItems.includes(collapseToOpen2)) {
2762
+ return errorOpenItems[0];
2763
+ }
2764
+ return collapseToOpen2;
2765
+ });
2766
+ }
2767
+ }
2768
+ }, [rawError, value]);
2746
2769
  const componentTmpKeyWithFocussedField = React__namespace.useMemo(() => {
2747
2770
  if (search.has("field")) {
2748
2771
  const fieldParam = search.get("field");
@@ -2757,7 +2780,7 @@ const RepeatableComponent = ({
2757
2780
  }
2758
2781
  return void 0;
2759
2782
  }, [search, name2, value]);
2760
- const prevValue = usePrev.usePrev(value);
2783
+ const prevValue = useDebounce.usePrev(value);
2761
2784
  React__namespace.useEffect(() => {
2762
2785
  if (prevValue && prevValue.length < value.length) {
2763
2786
  setCollapseToOpen(value[value.length - 1].__temp_key__);
@@ -3290,18 +3313,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
3290
3313
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
3291
3314
  ] });
3292
3315
  };
3293
- function useDebounce(value, delay) {
3294
- const [debouncedValue, setDebouncedValue] = React.useState(value);
3295
- React.useEffect(() => {
3296
- const handler = setTimeout(() => {
3297
- setDebouncedValue(value);
3298
- }, delay);
3299
- return () => {
3300
- clearTimeout(handler);
3301
- };
3302
- }, [value, delay]);
3303
- return debouncedValue;
3304
- }
3305
3316
  const uidApi = index.contentManagerApi.injectEndpoints({
3306
3317
  endpoints: (builder) => ({
3307
3318
  getDefaultUID: builder.query({
@@ -3336,7 +3347,10 @@ const uidApi = index.contentManagerApi.injectEndpoints({
3336
3347
  config: {
3337
3348
  params
3338
3349
  }
3339
- })
3350
+ }),
3351
+ providesTags: (_res, _error, params) => [
3352
+ { type: "UidAvailability", id: params.contentTypeUID }
3353
+ ]
3340
3354
  })
3341
3355
  })
3342
3356
  });
@@ -3348,8 +3362,10 @@ const UIDInput = React__namespace.forwardRef(
3348
3362
  const allFormValues = strapiAdmin.useForm("InputUID", (form) => form.values);
3349
3363
  const [availability, setAvailability] = React__namespace.useState();
3350
3364
  const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
3365
+ const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
3351
3366
  const field = strapiAdmin.useField(name2);
3352
- const debouncedValue = useDebounce(field.value, 300);
3367
+ const debouncedValue = useDebounce.useDebounce(field.value, 300);
3368
+ const hasChanged = debouncedValue !== field.initialValue;
3353
3369
  const { toggleNotification } = strapiAdmin.useNotification();
3354
3370
  const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
3355
3371
  const { formatMessage } = reactIntl.useIntl();
@@ -3425,8 +3441,9 @@ const UIDInput = React__namespace.forwardRef(
3425
3441
  params
3426
3442
  },
3427
3443
  {
3444
+ // Don't check availability if the value is empty or wasn't changed
3428
3445
  skip: !Boolean(
3429
- debouncedValue !== field.initialValue && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3446
+ (hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3430
3447
  )
3431
3448
  }
3432
3449
  );
@@ -3455,6 +3472,7 @@ const UIDInput = React__namespace.forwardRef(
3455
3472
  const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
3456
3473
  const fieldRef = strapiAdmin.useFocusInputField(name2);
3457
3474
  const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
3475
+ const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
3458
3476
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name: name2, error: field.error, required, children: [
3459
3477
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
3460
3478
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3463,7 +3481,7 @@ const UIDInput = React__namespace.forwardRef(
3463
3481
  ref: composedRefs,
3464
3482
  disabled: props.disabled,
3465
3483
  endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { position: "relative", gap: 1, children: [
3466
- availability && !showRegenerate && /* @__PURE__ */ jsxRuntime.jsxs(
3484
+ shouldShowAvailability && /* @__PURE__ */ jsxRuntime.jsxs(
3467
3485
  TextValidation,
3468
3486
  {
3469
3487
  alignItems: "center",
@@ -4612,31 +4630,11 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4612
4630
  insertWithoutTextToEdit(editor, markdownType, line, contentLength);
4613
4631
  }
4614
4632
  };
4615
- const CustomIconButton = styledComponents.styled(designSystem.IconButton)`
4616
- padding: ${({ theme }) => theme.spaces[2]};
4617
-
4618
- svg {
4619
- width: 1.8rem;
4620
- height: 1.8rem;
4621
- }
4622
- `;
4623
- const CustomLinkIconButton = styledComponents.styled(CustomIconButton)`
4624
- svg {
4625
- width: 0.8rem;
4626
- height: 0.8rem;
4627
- }
4628
- `;
4629
4633
  const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
4630
4634
  margin-left: ${({ theme }) => theme.spaces[4]};
4631
4635
  `;
4632
4636
  const MoreButton = styledComponents.styled(designSystem.IconButton)`
4633
4637
  margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
4634
- padding: ${({ theme }) => theme.spaces[2]};
4635
-
4636
- svg {
4637
- width: 1.8rem;
4638
- height: 1.8rem;
4639
- }
4640
4638
  `;
4641
4639
  const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
4642
4640
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
@@ -4720,9 +4718,9 @@ const WysiwygNav = ({
4720
4718
  }
4721
4719
  ) }),
4722
4720
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4723
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4724
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
4725
- /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
4721
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4722
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
4723
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
4726
4724
  ] }),
4727
4725
  /* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
4728
4726
  ] }),
@@ -4761,17 +4759,9 @@ const WysiwygNav = ({
4761
4759
  }
4762
4760
  ) }),
4763
4761
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4762
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4764
4763
  /* @__PURE__ */ jsxRuntime.jsx(
4765
- CustomIconButton,
4766
- {
4767
- onClick: () => onActionClick("Bold", editorRef),
4768
- label: "Bold",
4769
- name: "Bold",
4770
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {})
4771
- }
4772
- ),
4773
- /* @__PURE__ */ jsxRuntime.jsx(
4774
- CustomIconButton,
4764
+ designSystem.IconButton,
4775
4765
  {
4776
4766
  onClick: () => onActionClick("Italic", editorRef),
4777
4767
  label: "Italic",
@@ -4780,7 +4770,7 @@ const WysiwygNav = ({
4780
4770
  }
4781
4771
  ),
4782
4772
  /* @__PURE__ */ jsxRuntime.jsx(
4783
- CustomIconButton,
4773
+ designSystem.IconButton,
4784
4774
  {
4785
4775
  onClick: () => onActionClick("Underline", editorRef),
4786
4776
  label: "Underline",
@@ -4794,7 +4784,7 @@ const WysiwygNav = ({
4794
4784
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
4795
4785
  /* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
4796
4786
  /* @__PURE__ */ jsxRuntime.jsx(
4797
- CustomIconButton,
4787
+ designSystem.IconButton,
4798
4788
  {
4799
4789
  onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4800
4790
  label: "Strikethrough",
@@ -4803,7 +4793,7 @@ const WysiwygNav = ({
4803
4793
  }
4804
4794
  ),
4805
4795
  /* @__PURE__ */ jsxRuntime.jsx(
4806
- CustomIconButton,
4796
+ designSystem.IconButton,
4807
4797
  {
4808
4798
  onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4809
4799
  label: "BulletList",
@@ -4812,7 +4802,7 @@ const WysiwygNav = ({
4812
4802
  }
4813
4803
  ),
4814
4804
  /* @__PURE__ */ jsxRuntime.jsx(
4815
- CustomIconButton,
4805
+ designSystem.IconButton,
4816
4806
  {
4817
4807
  onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4818
4808
  label: "NumberList",
@@ -4823,7 +4813,7 @@ const WysiwygNav = ({
4823
4813
  ] }),
4824
4814
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
4825
4815
  /* @__PURE__ */ jsxRuntime.jsx(
4826
- CustomIconButton,
4816
+ designSystem.IconButton,
4827
4817
  {
4828
4818
  onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4829
4819
  label: "Code",
@@ -4832,7 +4822,7 @@ const WysiwygNav = ({
4832
4822
  }
4833
4823
  ),
4834
4824
  /* @__PURE__ */ jsxRuntime.jsx(
4835
- CustomIconButton,
4825
+ designSystem.IconButton,
4836
4826
  {
4837
4827
  onClick: () => {
4838
4828
  handleTogglePopover();
@@ -4844,7 +4834,7 @@ const WysiwygNav = ({
4844
4834
  }
4845
4835
  ),
4846
4836
  /* @__PURE__ */ jsxRuntime.jsx(
4847
- CustomLinkIconButton,
4837
+ designSystem.IconButton,
4848
4838
  {
4849
4839
  onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4850
4840
  label: "Link",
@@ -4853,7 +4843,7 @@ const WysiwygNav = ({
4853
4843
  }
4854
4844
  ),
4855
4845
  /* @__PURE__ */ jsxRuntime.jsx(
4856
- CustomIconButton,
4846
+ designSystem.IconButton,
4857
4847
  {
4858
4848
  onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4859
4849
  label: "Quote",
@@ -4931,7 +4921,7 @@ const Wysiwyg = React__namespace.forwardRef(
4931
4921
  const handleSelectAssets = (files) => {
4932
4922
  const formattedFiles = files.map((f) => ({
4933
4923
  alt: f.alternativeText || f.name,
4934
- url: usePrev.prefixFileUrlWithBackendUrl(f.url),
4924
+ url: useDebounce.prefixFileUrlWithBackendUrl(f.url),
4935
4925
  mime: f.mime
4936
4926
  }));
4937
4927
  insertFile(editorRef, formattedFiles);
@@ -4990,15 +4980,19 @@ const Wysiwyg = React__namespace.forwardRef(
4990
4980
  );
4991
4981
  const MemoizedWysiwyg = React__namespace.memo(Wysiwyg);
4992
4982
  const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4993
- const { id } = index.useDoc();
4983
+ const { id, document: document2, collectionType } = index.useDoc();
4994
4984
  const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
4995
4985
  const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
4996
4986
  const canCreateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
4997
4987
  const canReadFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
4998
4988
  const canUpdateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
4999
4989
  const canUserAction = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
5000
- const editableFields = id ? canUpdateFields : canCreateFields;
5001
- const readableFields = id ? canReadFields : canCreateFields;
4990
+ let idToCheck = id;
4991
+ if (collectionType === index.SINGLE_TYPES) {
4992
+ idToCheck = document2?.documentId;
4993
+ }
4994
+ const editableFields = idToCheck ? canUpdateFields : canCreateFields;
4995
+ const readableFields = idToCheck ? canReadFields : canCreateFields;
5002
4996
  const canUserReadField = canUserAction(props.name, readableFields, props.type);
5003
4997
  const canUserEditField = canUserAction(props.name, editableFields, props.type);
5004
4998
  const fields = strapiAdmin.useStrapiApp("InputRenderer", (app) => app.fields);
@@ -5009,6 +5003,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
5009
5003
  const {
5010
5004
  edit: { components }
5011
5005
  } = index.useDocLayout();
5006
+ const field = strapiAdmin.useField(props.name);
5012
5007
  if (!visible) {
5013
5008
  return null;
5014
5009
  }
@@ -5019,7 +5014,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
5019
5014
  if (attributeHasCustomFieldProperty(props.attribute)) {
5020
5015
  const CustomInput = lazyComponentStore[props.attribute.customField];
5021
5016
  if (CustomInput) {
5022
- return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
5017
+ return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
5023
5018
  }
5024
5019
  return /* @__PURE__ */ jsxRuntime.jsx(
5025
5020
  strapiAdmin.InputRenderer,
@@ -5180,6 +5175,14 @@ const DynamicComponent = ({
5180
5175
  React__namespace.useEffect(() => {
5181
5176
  dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
5182
5177
  }, [dragPreviewRef, index$1]);
5178
+ const accordionValue = React__namespace.useId();
5179
+ const { value = [], rawError } = strapiAdmin.useField(`${name2}.${index$1}`);
5180
+ const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
5181
+ React__namespace.useEffect(() => {
5182
+ if (rawError && value) {
5183
+ setCollapseToOpen(accordionValue);
5184
+ }
5185
+ }, [rawError, value, accordionValue]);
5183
5186
  const composedBoxRefs = designSystem.useComposedRefs(boxRef, dropRef);
5184
5187
  const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5185
5188
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -5245,10 +5248,9 @@ const DynamicComponent = ({
5245
5248
  ] })
5246
5249
  ] });
5247
5250
  const accordionTitle = title ? `${displayName} ${title}` : displayName;
5248
- const accordionValue = React__namespace.useId();
5249
5251
  return /* @__PURE__ */ jsxRuntime.jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
5250
5252
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Rectangle, { background: "neutral200" }) }),
5251
- /* @__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: [
5253
+ /* @__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: [
5252
5254
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
5253
5255
  /* @__PURE__ */ jsxRuntime.jsx(
5254
5256
  designSystem.Accordion.Trigger,
@@ -5259,21 +5261,32 @@ const DynamicComponent = ({
5259
5261
  ),
5260
5262
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: accordionActions })
5261
5263
  ] }),
5262
- /* @__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 }) => {
5263
- const fieldName = `${name2}.${index$1}.${field.name}`;
5264
- return /* @__PURE__ */ jsxRuntime.jsx(
5265
- designSystem.Grid.Item,
5266
- {
5267
- col: size,
5268
- s: 12,
5269
- xs: 12,
5270
- direction: "column",
5271
- alignItems: "stretch",
5272
- children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName })
5273
- },
5274
- fieldName
5275
- );
5276
- }) }, rowInd)) }) }) })
5264
+ /* @__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(
5265
+ designSystem.Grid.Item,
5266
+ {
5267
+ col: 12,
5268
+ s: 12,
5269
+ xs: 12,
5270
+ direction: "column",
5271
+ alignItems: "stretch",
5272
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5273
+ const fieldName = `${name2}.${index$1}.${field.name}`;
5274
+ return /* @__PURE__ */ jsxRuntime.jsx(
5275
+ designSystem.Grid.Item,
5276
+ {
5277
+ col: size,
5278
+ s: 12,
5279
+ xs: 12,
5280
+ direction: "column",
5281
+ alignItems: "stretch",
5282
+ children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName })
5283
+ },
5284
+ fieldName
5285
+ );
5286
+ }) })
5287
+ },
5288
+ rowInd
5289
+ )) }) }) }) })
5277
5290
  ] }) }) })
5278
5291
  ] });
5279
5292
  };
@@ -5579,4 +5592,4 @@ exports.transformDocument = transformDocument;
5579
5592
  exports.useDynamicZone = useDynamicZone;
5580
5593
  exports.useFieldHint = useFieldHint;
5581
5594
  exports.useLazyComponents = useLazyComponents;
5582
- //# sourceMappingURL=Field-CWjyW47-.js.map
5595
+ //# sourceMappingURL=Field-COL25JiC.js.map