@strapi/content-manager 0.0.0-experimental.5691f94a497e119f564a7f60ce0830bf4c875eb9 → 0.0.0-experimental.5788c38836be65c0321a2dcadbdf44f04b798e8a

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 (101) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-D_M8iBw5.js → ComponentConfigurationPage-B42mQr1K.js} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-D_M8iBw5.js.map → ComponentConfigurationPage-B42mQr1K.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-qemkOlnj.mjs → ComponentConfigurationPage-D1YuKq8j.mjs} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-qemkOlnj.mjs.map → ComponentConfigurationPage-D1YuKq8j.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-CjUrEewK.mjs → EditConfigurationPage-C9yiwgI_.mjs} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-CjUrEewK.mjs.map → EditConfigurationPage-C9yiwgI_.mjs.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-BePwPuHy.js → EditConfigurationPage-NC89F29V.js} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-BePwPuHy.js.map → EditConfigurationPage-NC89F29V.js.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-B-RJeiJD.js → EditViewPage-DYDpe5Wi.js} +15 -5
  10. package/dist/_chunks/EditViewPage-DYDpe5Wi.js.map +1 -0
  11. package/dist/_chunks/{EditViewPage-De8GyU8P.mjs → EditViewPage-k8UcfVwt.mjs} +15 -5
  12. package/dist/_chunks/EditViewPage-k8UcfVwt.mjs.map +1 -0
  13. package/dist/_chunks/{Field-pb2o8uBe.mjs → Field-BLL5lknV.mjs} +79 -77
  14. package/dist/_chunks/Field-BLL5lknV.mjs.map +1 -0
  15. package/dist/_chunks/{Field-dq8Tg1M_.js → Field-Crhugun2.js} +83 -81
  16. package/dist/_chunks/Field-Crhugun2.js.map +1 -0
  17. package/dist/_chunks/{Form-DGIf4jQU.js → Form-DUU19g6M.js} +15 -7
  18. package/dist/_chunks/Form-DUU19g6M.js.map +1 -0
  19. package/dist/_chunks/{Form-DJn0Dxha.mjs → Form-UHu2eOuG.mjs} +15 -7
  20. package/dist/_chunks/Form-UHu2eOuG.mjs.map +1 -0
  21. package/dist/_chunks/{History-BowL3JKP.mjs → History-CpxkZXS3.mjs} +4 -4
  22. package/dist/_chunks/{History-BowL3JKP.mjs.map → History-CpxkZXS3.mjs.map} +1 -1
  23. package/dist/_chunks/{History-Dh2NEHnR.js → History-CyA8tvJZ.js} +4 -4
  24. package/dist/_chunks/{History-Dh2NEHnR.js.map → History-CyA8tvJZ.js.map} +1 -1
  25. package/dist/_chunks/{ListConfigurationPage-BpVOB-hn.mjs → ListConfigurationPage-OUwV8QF1.mjs} +2 -2
  26. package/dist/_chunks/{ListConfigurationPage-BpVOB-hn.mjs.map → ListConfigurationPage-OUwV8QF1.mjs.map} +1 -1
  27. package/dist/_chunks/{ListConfigurationPage-BxYCWz9e.js → ListConfigurationPage-pJV7aG2V.js} +2 -2
  28. package/dist/_chunks/{ListConfigurationPage-BxYCWz9e.js.map → ListConfigurationPage-pJV7aG2V.js.map} +1 -1
  29. package/dist/_chunks/{ListViewPage-4XsciqHZ.js → ListViewPage-BIT0M8VG.js} +43 -39
  30. package/dist/_chunks/ListViewPage-BIT0M8VG.js.map +1 -0
  31. package/dist/_chunks/{ListViewPage-CXFUjZQC.mjs → ListViewPage-BOnhCGkE.mjs} +40 -36
  32. package/dist/_chunks/ListViewPage-BOnhCGkE.mjs.map +1 -0
  33. package/dist/_chunks/{NoContentTypePage-DuhOTp3x.mjs → NoContentTypePage-CwjlHGTn.mjs} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-DuhOTp3x.mjs.map → NoContentTypePage-CwjlHGTn.mjs.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-C8OpoHeU.js → NoContentTypePage-uIBsBUmH.js} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-C8OpoHeU.js.map → NoContentTypePage-uIBsBUmH.js.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-y_r7DVA2.js → NoPermissionsPage-C8wkEaOF.js} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-y_r7DVA2.js.map → NoPermissionsPage-C8wkEaOF.js.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-DVz3mzDz.mjs → NoPermissionsPage-CcWbyT_z.mjs} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-DVz3mzDz.mjs.map → NoPermissionsPage-CcWbyT_z.mjs.map} +1 -1
  41. package/dist/_chunks/{Relations-DPFCAa7b.js → Relations-CwRu_eZv.js} +32 -23
  42. package/dist/_chunks/Relations-CwRu_eZv.js.map +1 -0
  43. package/dist/_chunks/{Relations-CVNLrn1Y.mjs → Relations-wIdWJnA9.mjs} +32 -23
  44. package/dist/_chunks/Relations-wIdWJnA9.mjs.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-C3fJE-1-.js → index-BO-T2BdP.js} +1862 -1765
  50. package/dist/_chunks/index-BO-T2BdP.js.map +1 -0
  51. package/dist/_chunks/{index-DiMrfcfy.mjs → index-BQ8DxaCa.mjs} +1866 -1769
  52. package/dist/_chunks/index-BQ8DxaCa.mjs.map +1 -0
  53. package/dist/_chunks/{layout-C788OmNr.js → layout-BTB1_M8g.js} +5 -4
  54. package/dist/_chunks/{layout-C788OmNr.js.map → layout-BTB1_M8g.js.map} +1 -1
  55. package/dist/_chunks/{layout-ls3gxfpH.mjs → layout-N63eyE5E.mjs} +5 -4
  56. package/dist/_chunks/{layout-ls3gxfpH.mjs.map → layout-N63eyE5E.mjs.map} +1 -1
  57. package/dist/_chunks/{relations-CLcOmGO0.mjs → relations-Bh9r0CVE.mjs} +2 -2
  58. package/dist/_chunks/{relations-CLcOmGO0.mjs.map → relations-Bh9r0CVE.mjs.map} +1 -1
  59. package/dist/_chunks/{relations-DYeotliT.js → relations-C9AQuM2z.js} +2 -2
  60. package/dist/_chunks/{relations-DYeotliT.js.map → relations-C9AQuM2z.js.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 +3 -2
  68. package/dist/admin/src/exports.d.ts +1 -1
  69. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  70. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +0 -32
  71. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  72. package/dist/admin/src/services/documents.d.ts +3 -1
  73. package/dist/server/index.js +42 -20
  74. package/dist/server/index.js.map +1 -1
  75. package/dist/server/index.mjs +42 -20
  76. package/dist/server/index.mjs.map +1 -1
  77. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  78. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  79. package/dist/server/src/history/services/history.d.ts.map +1 -1
  80. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  81. package/dist/server/src/history/services/utils.d.ts +1 -0
  82. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  83. package/dist/shared/contracts/collection-types.d.ts +3 -1
  84. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  85. package/package.json +11 -11
  86. package/dist/_chunks/EditViewPage-B-RJeiJD.js.map +0 -1
  87. package/dist/_chunks/EditViewPage-De8GyU8P.mjs.map +0 -1
  88. package/dist/_chunks/Field-dq8Tg1M_.js.map +0 -1
  89. package/dist/_chunks/Field-pb2o8uBe.mjs.map +0 -1
  90. package/dist/_chunks/Form-DGIf4jQU.js.map +0 -1
  91. package/dist/_chunks/Form-DJn0Dxha.mjs.map +0 -1
  92. package/dist/_chunks/ListViewPage-4XsciqHZ.js.map +0 -1
  93. package/dist/_chunks/ListViewPage-CXFUjZQC.mjs.map +0 -1
  94. package/dist/_chunks/Relations-CVNLrn1Y.mjs.map +0 -1
  95. package/dist/_chunks/Relations-DPFCAa7b.js.map +0 -1
  96. package/dist/_chunks/index-C3fJE-1-.js.map +0 -1
  97. package/dist/_chunks/index-DiMrfcfy.mjs.map +0 -1
  98. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  99. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  100. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  101. package/strapi-server.js +0 -3
@@ -5,9 +5,9 @@ import { useStrapiApp, createContext, useField, useNotification, useForm, useAPI
5
5
  import { Box, SingleSelect, SingleSelectOption, Typography, Flex, BaseLink, Button, Popover, Field, Tooltip, IconButton, useComposedRefs, Portal, FocusTrap, Divider, VisuallyHidden, Grid as Grid$1, Accordion, TextButton, TextInput, IconButtonGroup, Menu, MenuItem } from "@strapi/design-system";
6
6
  import pipe$1 from "lodash/fp/pipe";
7
7
  import { useIntl } from "react-intl";
8
- import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, n as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, o as useDocLayout } from "./index-DiMrfcfy.mjs";
8
+ import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, n as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, o as useDocLayout } from "./index-BQ8DxaCa.mjs";
9
9
  import { generateNKeysBetween } from "fractional-indexing";
10
- import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-CVNLrn1Y.mjs";
10
+ import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-wIdWJnA9.mjs";
11
11
  import { Code, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, Expand, PlusCircle, Plus, Trash, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, More } from "@strapi/icons";
12
12
  import { styled, css, keyframes } from "styled-components";
13
13
  import { C as ComponentIcon, a as COMPONENT_ICONS } from "./ComponentIcon-u4bIXTFY.mjs";
@@ -17,7 +17,7 @@ import { g as getIn } from "./objects-mKMAmfec.mjs";
17
17
  import { Editor as Editor$1, Transforms, Node, Element, Range, Path, Point, createEditor } from "slate";
18
18
  import { withHistory } from "slate-history";
19
19
  import { useFocused, useSelected, ReactEditor, Editable, useSlate, Slate, withReact } from "slate-react";
20
- import { p as prefixFileUrlWithBackendUrl, u as usePrev } from "./usePrev-DH6iah0A.mjs";
20
+ import { p as prefixFileUrlWithBackendUrl, u as usePrev, a as useDebounce } from "./useDebounce-DmuSJIF3.mjs";
21
21
  import * as Toolbar from "@radix-ui/react-toolbar";
22
22
  import { useLocation, useMatch } from "react-router-dom";
23
23
  import CodeMirror from "codemirror5";
@@ -1407,7 +1407,7 @@ const ToolbarButton = ({
1407
1407
  width: 7,
1408
1408
  height: 7,
1409
1409
  hasRadius: true,
1410
- children: /* @__PURE__ */ jsx(Icon, { width: "1.2rem", height: "1.2rem", fill: disabled ? "neutral300" : enabledColor })
1410
+ children: /* @__PURE__ */ jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
1411
1411
  }
1412
1412
  )
1413
1413
  }
@@ -1749,6 +1749,7 @@ const DragItem = styled(Flex)`
1749
1749
  }
1750
1750
  `;
1751
1751
  const DragIconButton = styled(IconButton)`
1752
+ user-select: none;
1752
1753
  display: flex;
1753
1754
  align-items: center;
1754
1755
  justify-content: center;
@@ -1877,6 +1878,7 @@ const DragAndDropElement = ({
1877
1878
  DragIconButton,
1878
1879
  {
1879
1880
  tag: "div",
1881
+ contentEditable: false,
1880
1882
  role: "button",
1881
1883
  tabIndex: 0,
1882
1884
  withTooltip: false,
@@ -2702,13 +2704,34 @@ const RepeatableComponent = ({
2702
2704
  const { search: searchString } = useLocation();
2703
2705
  const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
2704
2706
  const { components } = useDoc();
2705
- const { value = [], error } = useField(name2);
2707
+ const {
2708
+ value = [],
2709
+ error,
2710
+ rawError
2711
+ } = useField(name2);
2706
2712
  const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
2707
2713
  const moveFieldRow = useForm("RepeatableComponent", (state) => state.moveFieldRow);
2708
2714
  const removeFieldRow = useForm("RepeatableComponent", (state) => state.removeFieldRow);
2709
2715
  const { max = Infinity } = attribute;
2710
2716
  const [collapseToOpen, setCollapseToOpen] = React.useState("");
2711
2717
  const [liveText, setLiveText] = React.useState("");
2718
+ React.useEffect(() => {
2719
+ const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
2720
+ const hasNestedValue = value && Array.isArray(value) && value.length > 0;
2721
+ if (hasNestedErrors && hasNestedValue) {
2722
+ const errorOpenItems = rawError.map((_, idx) => {
2723
+ return value[idx].__temp_key__;
2724
+ }).filter((value2) => !!value2);
2725
+ if (errorOpenItems && errorOpenItems.length > 0) {
2726
+ setCollapseToOpen((collapseToOpen2) => {
2727
+ if (!errorOpenItems.includes(collapseToOpen2)) {
2728
+ return errorOpenItems[0];
2729
+ }
2730
+ return collapseToOpen2;
2731
+ });
2732
+ }
2733
+ }
2734
+ }, [rawError, value]);
2712
2735
  const componentTmpKeyWithFocussedField = React.useMemo(() => {
2713
2736
  if (search.has("field")) {
2714
2737
  const fieldParam = search.get("field");
@@ -3256,18 +3279,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
3256
3279
  /* @__PURE__ */ jsx(Field.Hint, {})
3257
3280
  ] });
3258
3281
  };
3259
- function useDebounce(value, delay) {
3260
- const [debouncedValue, setDebouncedValue] = useState(value);
3261
- useEffect(() => {
3262
- const handler = setTimeout(() => {
3263
- setDebouncedValue(value);
3264
- }, delay);
3265
- return () => {
3266
- clearTimeout(handler);
3267
- };
3268
- }, [value, delay]);
3269
- return debouncedValue;
3270
- }
3271
3282
  const uidApi = contentManagerApi.injectEndpoints({
3272
3283
  endpoints: (builder) => ({
3273
3284
  getDefaultUID: builder.query({
@@ -4585,31 +4596,11 @@ const quoteAndCodeHandler = (editor, markdownType) => {
4585
4596
  insertWithoutTextToEdit(editor, markdownType, line, contentLength);
4586
4597
  }
4587
4598
  };
4588
- const CustomIconButton = styled(IconButton)`
4589
- padding: ${({ theme }) => theme.spaces[2]};
4590
-
4591
- svg {
4592
- width: 1.8rem;
4593
- height: 1.8rem;
4594
- }
4595
- `;
4596
- const CustomLinkIconButton = styled(CustomIconButton)`
4597
- svg {
4598
- width: 0.8rem;
4599
- height: 0.8rem;
4600
- }
4601
- `;
4602
4599
  const MainButtons = styled(IconButtonGroup)`
4603
4600
  margin-left: ${({ theme }) => theme.spaces[4]};
4604
4601
  `;
4605
4602
  const MoreButton = styled(IconButton)`
4606
4603
  margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
4607
- padding: ${({ theme }) => theme.spaces[2]};
4608
-
4609
- svg {
4610
- width: 1.8rem;
4611
- height: 1.8rem;
4612
- }
4613
4604
  `;
4614
4605
  const IconButtonGroupMargin = styled(IconButtonGroup)`
4615
4606
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
@@ -4693,9 +4684,9 @@ const WysiwygNav = ({
4693
4684
  }
4694
4685
  ) }),
4695
4686
  /* @__PURE__ */ jsxs(MainButtons, { children: [
4696
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4697
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
4698
- /* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsx(Underline, {}) })
4687
+ /* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4688
+ /* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
4689
+ /* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsx(Underline, {}) })
4699
4690
  ] }),
4700
4691
  /* @__PURE__ */ jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsx(More, {}) })
4701
4692
  ] }),
@@ -4734,17 +4725,9 @@ const WysiwygNav = ({
4734
4725
  }
4735
4726
  ) }),
4736
4727
  /* @__PURE__ */ jsxs(MainButtons, { children: [
4728
+ /* @__PURE__ */ jsx(IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
4737
4729
  /* @__PURE__ */ jsx(
4738
- CustomIconButton,
4739
- {
4740
- onClick: () => onActionClick("Bold", editorRef),
4741
- label: "Bold",
4742
- name: "Bold",
4743
- children: /* @__PURE__ */ jsx(Bold, {})
4744
- }
4745
- ),
4746
- /* @__PURE__ */ jsx(
4747
- CustomIconButton,
4730
+ IconButton,
4748
4731
  {
4749
4732
  onClick: () => onActionClick("Italic", editorRef),
4750
4733
  label: "Italic",
@@ -4753,7 +4736,7 @@ const WysiwygNav = ({
4753
4736
  }
4754
4737
  ),
4755
4738
  /* @__PURE__ */ jsx(
4756
- CustomIconButton,
4739
+ IconButton,
4757
4740
  {
4758
4741
  onClick: () => onActionClick("Underline", editorRef),
4759
4742
  label: "Underline",
@@ -4767,7 +4750,7 @@ const WysiwygNav = ({
4767
4750
  /* @__PURE__ */ jsx(Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxs(Flex, { padding: 2, children: [
4768
4751
  /* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
4769
4752
  /* @__PURE__ */ jsx(
4770
- CustomIconButton,
4753
+ IconButton,
4771
4754
  {
4772
4755
  onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
4773
4756
  label: "Strikethrough",
@@ -4776,7 +4759,7 @@ const WysiwygNav = ({
4776
4759
  }
4777
4760
  ),
4778
4761
  /* @__PURE__ */ jsx(
4779
- CustomIconButton,
4762
+ IconButton,
4780
4763
  {
4781
4764
  onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
4782
4765
  label: "BulletList",
@@ -4785,7 +4768,7 @@ const WysiwygNav = ({
4785
4768
  }
4786
4769
  ),
4787
4770
  /* @__PURE__ */ jsx(
4788
- CustomIconButton,
4771
+ IconButton,
4789
4772
  {
4790
4773
  onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
4791
4774
  label: "NumberList",
@@ -4796,7 +4779,7 @@ const WysiwygNav = ({
4796
4779
  ] }),
4797
4780
  /* @__PURE__ */ jsxs(IconButtonGroup, { children: [
4798
4781
  /* @__PURE__ */ jsx(
4799
- CustomIconButton,
4782
+ IconButton,
4800
4783
  {
4801
4784
  onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
4802
4785
  label: "Code",
@@ -4805,7 +4788,7 @@ const WysiwygNav = ({
4805
4788
  }
4806
4789
  ),
4807
4790
  /* @__PURE__ */ jsx(
4808
- CustomIconButton,
4791
+ IconButton,
4809
4792
  {
4810
4793
  onClick: () => {
4811
4794
  handleTogglePopover();
@@ -4817,7 +4800,7 @@ const WysiwygNav = ({
4817
4800
  }
4818
4801
  ),
4819
4802
  /* @__PURE__ */ jsx(
4820
- CustomLinkIconButton,
4803
+ IconButton,
4821
4804
  {
4822
4805
  onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
4823
4806
  label: "Link",
@@ -4826,7 +4809,7 @@ const WysiwygNav = ({
4826
4809
  }
4827
4810
  ),
4828
4811
  /* @__PURE__ */ jsx(
4829
- CustomIconButton,
4812
+ IconButton,
4830
4813
  {
4831
4814
  onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
4832
4815
  label: "Quote",
@@ -4982,6 +4965,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4982
4965
  const {
4983
4966
  edit: { components }
4984
4967
  } = useDocLayout();
4968
+ const field = useField(props.name);
4985
4969
  if (!visible) {
4986
4970
  return null;
4987
4971
  }
@@ -4992,7 +4976,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
4992
4976
  if (attributeHasCustomFieldProperty(props.attribute)) {
4993
4977
  const CustomInput = lazyComponentStore[props.attribute.customField];
4994
4978
  if (CustomInput) {
4995
- return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
4979
+ return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
4996
4980
  }
4997
4981
  return /* @__PURE__ */ jsx(
4998
4982
  InputRenderer$1,
@@ -5153,6 +5137,14 @@ const DynamicComponent = ({
5153
5137
  React.useEffect(() => {
5154
5138
  dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
5155
5139
  }, [dragPreviewRef, index]);
5140
+ const accordionValue = React.useId();
5141
+ const { value = [], rawError } = useField(`${name2}.${index}`);
5142
+ const [collapseToOpen, setCollapseToOpen] = React.useState("");
5143
+ React.useEffect(() => {
5144
+ if (rawError && value) {
5145
+ setCollapseToOpen(accordionValue);
5146
+ }
5147
+ }, [rawError, value, accordionValue]);
5156
5148
  const composedBoxRefs = useComposedRefs(boxRef, dropRef);
5157
5149
  const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
5158
5150
  /* @__PURE__ */ jsx(
@@ -5218,10 +5210,9 @@ const DynamicComponent = ({
5218
5210
  ] })
5219
5211
  ] });
5220
5212
  const accordionTitle = title ? `${displayName} ${title}` : displayName;
5221
- const accordionValue = React.useId();
5222
5213
  return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
5223
5214
  /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
5224
- /* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
5215
+ /* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { value: collapseToOpen, onValueChange: setCollapseToOpen, children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
5225
5216
  /* @__PURE__ */ jsxs(Accordion.Header, { children: [
5226
5217
  /* @__PURE__ */ jsx(
5227
5218
  Accordion.Trigger,
@@ -5232,21 +5223,32 @@ const DynamicComponent = ({
5232
5223
  ),
5233
5224
  /* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
5234
5225
  ] }),
5235
- /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5236
- const fieldName = `${name2}.${index}.${field.name}`;
5237
- return /* @__PURE__ */ jsx(
5238
- Grid$1.Item,
5239
- {
5240
- col: size,
5241
- s: 12,
5242
- xs: 12,
5243
- direction: "column",
5244
- alignItems: "stretch",
5245
- children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName })
5246
- },
5247
- fieldName
5248
- );
5249
- }) }, rowInd)) }) }) })
5226
+ /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(
5227
+ Grid$1.Item,
5228
+ {
5229
+ col: 12,
5230
+ s: 12,
5231
+ xs: 12,
5232
+ direction: "column",
5233
+ alignItems: "stretch",
5234
+ children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5235
+ const fieldName = `${name2}.${index}.${field.name}`;
5236
+ return /* @__PURE__ */ jsx(
5237
+ Grid$1.Item,
5238
+ {
5239
+ col: size,
5240
+ s: 12,
5241
+ xs: 12,
5242
+ direction: "column",
5243
+ alignItems: "stretch",
5244
+ children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName })
5245
+ },
5246
+ fieldName
5247
+ );
5248
+ }) })
5249
+ },
5250
+ rowInd
5251
+ )) }) }) }) })
5250
5252
  ] }) }) })
5251
5253
  ] });
5252
5254
  };
@@ -5554,4 +5556,4 @@ export {
5554
5556
  transformDocument as t,
5555
5557
  useLazyComponents as u
5556
5558
  };
5557
- //# sourceMappingURL=Field-pb2o8uBe.mjs.map
5559
+ //# sourceMappingURL=Field-BLL5lknV.mjs.map