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

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 (115) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-C-49MccQ.js → ComponentConfigurationPage-D_M8iBw5.js} +3 -3
  3. package/dist/_chunks/{ComponentConfigurationPage-C-49MccQ.js.map → ComponentConfigurationPage-D_M8iBw5.js.map} +1 -1
  4. package/dist/_chunks/{ComponentConfigurationPage-DmwmiFQy.mjs → ComponentConfigurationPage-qemkOlnj.mjs} +3 -3
  5. package/dist/_chunks/{ComponentConfigurationPage-DmwmiFQy.mjs.map → ComponentConfigurationPage-qemkOlnj.mjs.map} +1 -1
  6. package/dist/_chunks/{EditConfigurationPage-DjFJw56M.js → EditConfigurationPage-BePwPuHy.js} +3 -3
  7. package/dist/_chunks/{EditConfigurationPage-DjFJw56M.js.map → EditConfigurationPage-BePwPuHy.js.map} +1 -1
  8. package/dist/_chunks/{EditConfigurationPage-JT3E7NZy.mjs → EditConfigurationPage-CjUrEewK.mjs} +3 -3
  9. package/dist/_chunks/{EditConfigurationPage-JT3E7NZy.mjs.map → EditConfigurationPage-CjUrEewK.mjs.map} +1 -1
  10. package/dist/_chunks/{EditViewPage-zT3fBr4Y.js → EditViewPage-B-RJeiJD.js} +19 -8
  11. package/dist/_chunks/EditViewPage-B-RJeiJD.js.map +1 -0
  12. package/dist/_chunks/{EditViewPage-CPj61RMh.mjs → EditViewPage-De8GyU8P.mjs} +19 -8
  13. package/dist/_chunks/EditViewPage-De8GyU8P.mjs.map +1 -0
  14. package/dist/_chunks/{Field-Boxf9Ajp.js → Field-dq8Tg1M_.js} +175 -84
  15. package/dist/_chunks/Field-dq8Tg1M_.js.map +1 -0
  16. package/dist/_chunks/{Field-dha5VnIQ.mjs → Field-pb2o8uBe.mjs} +177 -86
  17. package/dist/_chunks/Field-pb2o8uBe.mjs.map +1 -0
  18. package/dist/_chunks/{Form-y5g1SRsh.js → Form-DGIf4jQU.js} +22 -11
  19. package/dist/_chunks/Form-DGIf4jQU.js.map +1 -0
  20. package/dist/_chunks/{Form-DHrru2AV.mjs → Form-DJn0Dxha.mjs} +22 -11
  21. package/dist/_chunks/Form-DJn0Dxha.mjs.map +1 -0
  22. package/dist/_chunks/{History-Bru_KoeP.mjs → History-BowL3JKP.mjs} +44 -19
  23. package/dist/_chunks/History-BowL3JKP.mjs.map +1 -0
  24. package/dist/_chunks/{History-CqN6K7SX.js → History-Dh2NEHnR.js} +44 -19
  25. package/dist/_chunks/History-Dh2NEHnR.js.map +1 -0
  26. package/dist/_chunks/{ListConfigurationPage-D8wGABj0.mjs → ListConfigurationPage-BpVOB-hn.mjs} +20 -8
  27. package/dist/_chunks/ListConfigurationPage-BpVOB-hn.mjs.map +1 -0
  28. package/dist/_chunks/{ListConfigurationPage-R_p-SbHZ.js → ListConfigurationPage-BxYCWz9e.js} +20 -8
  29. package/dist/_chunks/ListConfigurationPage-BxYCWz9e.js.map +1 -0
  30. package/dist/_chunks/{ListViewPage-pEw_zug9.js → ListViewPage-4XsciqHZ.js} +21 -7
  31. package/dist/_chunks/ListViewPage-4XsciqHZ.js.map +1 -0
  32. package/dist/_chunks/{ListViewPage-SID6TRb9.mjs → ListViewPage-CXFUjZQC.mjs} +22 -8
  33. package/dist/_chunks/ListViewPage-CXFUjZQC.mjs.map +1 -0
  34. package/dist/_chunks/{NoContentTypePage-C5dcQojD.js → NoContentTypePage-C8OpoHeU.js} +2 -2
  35. package/dist/_chunks/{NoContentTypePage-C5dcQojD.js.map → NoContentTypePage-C8OpoHeU.js.map} +1 -1
  36. package/dist/_chunks/{NoContentTypePage-CJ7UXwrQ.mjs → NoContentTypePage-DuhOTp3x.mjs} +2 -2
  37. package/dist/_chunks/{NoContentTypePage-CJ7UXwrQ.mjs.map → NoContentTypePage-DuhOTp3x.mjs.map} +1 -1
  38. package/dist/_chunks/{NoPermissionsPage-B7syEq5E.mjs → NoPermissionsPage-DVz3mzDz.mjs} +2 -2
  39. package/dist/_chunks/{NoPermissionsPage-B7syEq5E.mjs.map → NoPermissionsPage-DVz3mzDz.mjs.map} +1 -1
  40. package/dist/_chunks/{NoPermissionsPage-BtPrImPP.js → NoPermissionsPage-y_r7DVA2.js} +2 -2
  41. package/dist/_chunks/{NoPermissionsPage-BtPrImPP.js.map → NoPermissionsPage-y_r7DVA2.js.map} +1 -1
  42. package/dist/_chunks/{Relations-B9Crnhnn.mjs → Relations-CVNLrn1Y.mjs} +4 -4
  43. package/dist/_chunks/Relations-CVNLrn1Y.mjs.map +1 -0
  44. package/dist/_chunks/{Relations-DjTQ5kGB.js → Relations-DPFCAa7b.js} +4 -4
  45. package/dist/_chunks/Relations-DPFCAa7b.js.map +1 -0
  46. package/dist/_chunks/{en-Ux26r5pl.mjs → en-BrCTWlZv.mjs} +5 -4
  47. package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-BrCTWlZv.mjs.map} +1 -1
  48. package/dist/_chunks/{en-fbKQxLGn.js → en-uOUIxfcQ.js} +5 -4
  49. package/dist/_chunks/{en-fbKQxLGn.js.map → en-uOUIxfcQ.js.map} +1 -1
  50. package/dist/_chunks/{index-DVPWZkbS.js → index-C3fJE-1-.js} +368 -168
  51. package/dist/_chunks/index-C3fJE-1-.js.map +1 -0
  52. package/dist/_chunks/{index-DJXJw9V5.mjs → index-DiMrfcfy.mjs} +387 -187
  53. package/dist/_chunks/index-DiMrfcfy.mjs.map +1 -0
  54. package/dist/_chunks/{layout-Dm6fbiQj.js → layout-C788OmNr.js} +22 -10
  55. package/dist/_chunks/layout-C788OmNr.js.map +1 -0
  56. package/dist/_chunks/{layout-Bau7ZfLV.mjs → layout-ls3gxfpH.mjs} +23 -11
  57. package/dist/_chunks/layout-ls3gxfpH.mjs.map +1 -0
  58. package/dist/_chunks/{relations-BH_kBSJ0.mjs → relations-CLcOmGO0.mjs} +2 -2
  59. package/dist/_chunks/{relations-BH_kBSJ0.mjs.map → relations-CLcOmGO0.mjs.map} +1 -1
  60. package/dist/_chunks/{relations-CKnpRgrN.js → relations-DYeotliT.js} +2 -2
  61. package/dist/_chunks/{relations-CKnpRgrN.js.map → relations-DYeotliT.js.map} +1 -1
  62. package/dist/admin/index.js +1 -1
  63. package/dist/admin/index.mjs +4 -4
  64. package/dist/admin/src/history/index.d.ts +3 -0
  65. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  66. package/dist/admin/src/index.d.ts +1 -0
  67. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -0
  68. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
  69. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  70. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  71. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +10 -22
  72. package/dist/admin/src/services/api.d.ts +1 -1
  73. package/dist/admin/src/services/components.d.ts +2 -2
  74. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  75. package/dist/admin/src/services/documents.d.ts +16 -16
  76. package/dist/admin/src/services/init.d.ts +1 -1
  77. package/dist/admin/src/services/relations.d.ts +2 -2
  78. package/dist/admin/src/services/uid.d.ts +3 -3
  79. package/dist/admin/src/utils/validation.d.ts +4 -1
  80. package/dist/server/index.js +165 -105
  81. package/dist/server/index.js.map +1 -1
  82. package/dist/server/index.mjs +166 -106
  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/controllers/uid.d.ts.map +1 -1
  87. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  88. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  89. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  90. package/dist/server/src/history/services/utils.d.ts +1 -1
  91. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  92. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  93. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  94. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  95. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  96. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  97. package/package.json +8 -8
  98. package/dist/_chunks/EditViewPage-CPj61RMh.mjs.map +0 -1
  99. package/dist/_chunks/EditViewPage-zT3fBr4Y.js.map +0 -1
  100. package/dist/_chunks/Field-Boxf9Ajp.js.map +0 -1
  101. package/dist/_chunks/Field-dha5VnIQ.mjs.map +0 -1
  102. package/dist/_chunks/Form-DHrru2AV.mjs.map +0 -1
  103. package/dist/_chunks/Form-y5g1SRsh.js.map +0 -1
  104. package/dist/_chunks/History-Bru_KoeP.mjs.map +0 -1
  105. package/dist/_chunks/History-CqN6K7SX.js.map +0 -1
  106. package/dist/_chunks/ListConfigurationPage-D8wGABj0.mjs.map +0 -1
  107. package/dist/_chunks/ListConfigurationPage-R_p-SbHZ.js.map +0 -1
  108. package/dist/_chunks/ListViewPage-SID6TRb9.mjs.map +0 -1
  109. package/dist/_chunks/ListViewPage-pEw_zug9.js.map +0 -1
  110. package/dist/_chunks/Relations-B9Crnhnn.mjs.map +0 -1
  111. package/dist/_chunks/Relations-DjTQ5kGB.js.map +0 -1
  112. package/dist/_chunks/index-DJXJw9V5.mjs.map +0 -1
  113. package/dist/_chunks/index-DVPWZkbS.js.map +0 -1
  114. package/dist/_chunks/layout-Bau7ZfLV.mjs.map +0 -1
  115. package/dist/_chunks/layout-Dm6fbiQj.js.map +0 -1
@@ -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-DVPWZkbS.js");
8
+ const index = require("./index-C3fJE-1-.js");
9
9
  const fractionalIndexing = require("fractional-indexing");
10
- const Relations = require("./Relations-DjTQ5kGB.js");
10
+ const Relations = require("./Relations-DPFCAa7b.js");
11
11
  const Icons = require("@strapi/icons");
12
12
  const styledComponents = require("styled-components");
13
13
  const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
@@ -894,20 +894,8 @@ const LinkContent = React__namespace.forwardRef(
894
894
  const [linkText, setLinkText] = React__namespace.useState(elementText);
895
895
  const [linkUrl, setLinkUrl] = React__namespace.useState(link.url);
896
896
  const linkInputRef = React__namespace.useRef(null);
897
- const [showRemoveButton, setShowRemoveButton] = React__namespace.useState(false);
897
+ const isLastInsertedLink = editor.lastInsertedLinkPath ? !slate.Path.equals(path, editor.lastInsertedLinkPath) : true;
898
898
  const [isSaveDisabled, setIsSaveDisabled] = React__namespace.useState(false);
899
- const handleOpenChange = (isOpen) => {
900
- if (isOpen) {
901
- setPopoverOpen(isOpen);
902
- setShowRemoveButton(isOpen);
903
- } else {
904
- setPopoverOpen(isOpen);
905
- if (link.url === "") {
906
- removeLink(editor);
907
- }
908
- slateReact.ReactEditor.focus(editor);
909
- }
910
- };
911
899
  const onLinkChange = (e) => {
912
900
  setIsSaveDisabled(false);
913
901
  setLinkUrl(e.target.value);
@@ -928,15 +916,33 @@ const LinkContent = React__namespace.forwardRef(
928
916
  editLink(editor, { url: linkUrl, text: linkText });
929
917
  setPopoverOpen(false);
930
918
  editor.lastInsertedLinkPath = null;
919
+ slateReact.ReactEditor.focus(editor);
920
+ };
921
+ const handleClose = () => {
922
+ if (link.url === "") {
923
+ removeLink(editor);
924
+ }
925
+ setPopoverOpen(false);
926
+ slateReact.ReactEditor.focus(editor);
931
927
  };
932
928
  React__namespace.useEffect(() => {
933
929
  if (popoverOpen)
934
930
  linkInputRef.current?.focus();
935
931
  }, [popoverOpen]);
936
932
  const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
937
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { onOpenChange: handleOpenChange, open: popoverOpen, children: [
938
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(StyledBaseLink, { ...attributes, ref: forwardedRef, href: link.url, color: "primary600", children }) }),
939
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, tag: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
933
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { open: popoverOpen, children: [
934
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
935
+ StyledBaseLink,
936
+ {
937
+ ...attributes,
938
+ ref: forwardedRef,
939
+ href: link.url,
940
+ onClick: () => setPopoverOpen(true),
941
+ color: "primary600",
942
+ children
943
+ }
944
+ ) }),
945
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { onPointerDownOutside: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, direction: "column", gap: 4, children: [
940
946
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { width: "368px", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
941
947
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
942
948
  id: "components.Blocks.popover.text",
@@ -982,7 +988,7 @@ const LinkContent = React__namespace.forwardRef(
982
988
  {
983
989
  variant: "danger-light",
984
990
  onClick: () => removeLink(editor),
985
- $visible: showRemoveButton,
991
+ $visible: isLastInsertedLink,
986
992
  children: formatMessage({
987
993
  id: "components.Blocks.popover.remove",
988
994
  defaultMessage: "Remove"
@@ -990,11 +996,11 @@ const LinkContent = React__namespace.forwardRef(
990
996
  }
991
997
  ),
992
998
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
993
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: () => handleOpenChange(false), children: formatMessage({
999
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
994
1000
  id: "components.Blocks.popover.cancel",
995
1001
  defaultMessage: "Cancel"
996
1002
  }) }),
997
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { type: "submit", disabled: Boolean(inputNotDirty) || isSaveDisabled, children: formatMessage({
1003
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
998
1004
  id: "components.Blocks.popover.save",
999
1005
  defaultMessage: "Save"
1000
1006
  }) })
@@ -1580,6 +1586,26 @@ const ListButton = ({ block, format }) => {
1580
1586
  }
1581
1587
  return false;
1582
1588
  };
1589
+ const isListDisabled = () => {
1590
+ if (disabled) {
1591
+ return true;
1592
+ }
1593
+ if (!editor.selection) {
1594
+ return false;
1595
+ }
1596
+ const anchorNodeEntry = slate.Editor.above(editor, {
1597
+ at: editor.selection.anchor,
1598
+ match: (node) => !slate.Editor.isEditor(node) && node.type !== "text"
1599
+ });
1600
+ const focusNodeEntry = slate.Editor.above(editor, {
1601
+ at: editor.selection.focus,
1602
+ match: (node) => !slate.Editor.isEditor(node) && node.type !== "text"
1603
+ });
1604
+ if (!anchorNodeEntry || !focusNodeEntry) {
1605
+ return false;
1606
+ }
1607
+ return anchorNodeEntry[0] !== focusNodeEntry[0];
1608
+ };
1583
1609
  const toggleList = (format2) => {
1584
1610
  let currentListEntry;
1585
1611
  if (editor.selection) {
@@ -1613,7 +1639,7 @@ const ListButton = ({ block, format }) => {
1613
1639
  name: format,
1614
1640
  label: block.label,
1615
1641
  isActive: isListActive(),
1616
- disabled,
1642
+ disabled: isListDisabled(),
1617
1643
  handleClick: () => toggleList(format)
1618
1644
  }
1619
1645
  );
@@ -1780,7 +1806,7 @@ const DragIconButton = styledComponents.styled(designSystem.IconButton)`
1780
1806
  }
1781
1807
  svg {
1782
1808
  height: auto;
1783
- width: ${({ theme }) => theme.spaces[3]};
1809
+ min-width: ${({ theme }) => theme.spaces[3]};
1784
1810
 
1785
1811
  path {
1786
1812
  fill: ${({ theme }) => theme.colors.neutral700};
@@ -1897,7 +1923,7 @@ const DragAndDropElement = ({
1897
1923
  disabled,
1898
1924
  draggable: true,
1899
1925
  $dragHandleTopMargin: dragHandleTopMargin,
1900
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "neutral600" })
1926
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "primary500" })
1901
1927
  }
1902
1928
  ),
1903
1929
  children
@@ -2221,7 +2247,7 @@ const EditorLayout$1 = ({
2221
2247
  /* @__PURE__ */ jsxRuntime.jsx(
2222
2248
  CollapseIconButton,
2223
2249
  {
2224
- "aria-label": formatMessage({
2250
+ label: formatMessage({
2225
2251
  id: index.getTranslation("components.Blocks.collapse"),
2226
2252
  defaultMessage: "Collapse"
2227
2253
  }),
@@ -2560,7 +2586,7 @@ const BlocksEditor = React__namespace.forwardRef(
2560
2586
  !isExpandedMode && /* @__PURE__ */ jsxRuntime.jsx(
2561
2587
  ExpandIconButton,
2562
2588
  {
2563
- "aria-label": formatMessage({
2589
+ label: formatMessage({
2564
2590
  id: index.getTranslation("components.Blocks.expand"),
2565
2591
  defaultMessage: "Expand"
2566
2592
  }),
@@ -2626,30 +2652,27 @@ const createDefaultForm = (contentType, components = {}) => {
2626
2652
  const Initializer = ({ disabled, name: name2, onClick }) => {
2627
2653
  const { formatMessage } = reactIntl.useIntl();
2628
2654
  const field = strapiAdmin.useField(name2);
2629
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2630
- /* @__PURE__ */ jsxRuntime.jsx(
2631
- designSystem.Box,
2632
- {
2633
- tag: "button",
2634
- background: "neutral100",
2635
- borderColor: field.error ? "danger600" : "neutral200",
2636
- hasRadius: true,
2637
- disabled,
2638
- onClick,
2639
- paddingTop: 9,
2640
- paddingBottom: 9,
2641
- type: "button",
2642
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
2643
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(CircleIcon, {}) }),
2644
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2645
- id: index.getTranslation("components.empty-repeatable"),
2646
- defaultMessage: "No entry yet. Click on the button below to add one."
2647
- }) }) })
2648
- ] })
2649
- }
2650
- ),
2651
- field.error && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", variant: "pi", children: field.error })
2652
- ] });
2655
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
2656
+ designSystem.Box,
2657
+ {
2658
+ tag: "button",
2659
+ background: "neutral100",
2660
+ borderColor: field.error ? "danger600" : "neutral200",
2661
+ hasRadius: true,
2662
+ disabled,
2663
+ onClick,
2664
+ paddingTop: 9,
2665
+ paddingBottom: 9,
2666
+ type: "button",
2667
+ 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
+ }) }) })
2673
+ ] })
2674
+ }
2675
+ ) });
2653
2676
  };
2654
2677
  const CircleIcon = styledComponents.styled(Icons.PlusCircle)`
2655
2678
  width: 2.4rem;
@@ -2683,7 +2706,18 @@ const NonRepeatableComponent = ({
2683
2706
  children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index2) => {
2684
2707
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2685
2708
  const completeFieldName = `${name2}.${field.name}`;
2686
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2709
+ return /* @__PURE__ */ jsxRuntime.jsx(
2710
+ designSystem.Grid.Item,
2711
+ {
2712
+ col: size,
2713
+ s: 12,
2714
+ xs: 12,
2715
+ direction: "column",
2716
+ alignItems: "stretch",
2717
+ children: children({ ...field, name: completeFieldName })
2718
+ },
2719
+ completeFieldName
2720
+ );
2687
2721
  }) }, index2);
2688
2722
  }) })
2689
2723
  }
@@ -2861,7 +2895,18 @@ const RepeatableComponent = ({
2861
2895
  children: layout.map((row, index22) => {
2862
2896
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
2863
2897
  const completeFieldName = `${nameWithIndex}.${field.name}`;
2864
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
2898
+ return /* @__PURE__ */ jsxRuntime.jsx(
2899
+ designSystem.Grid.Item,
2900
+ {
2901
+ col: size,
2902
+ s: 12,
2903
+ xs: 12,
2904
+ direction: "column",
2905
+ alignItems: "stretch",
2906
+ children: children({ ...field, name: completeFieldName })
2907
+ },
2908
+ completeFieldName
2909
+ );
2865
2910
  }) }, index22);
2866
2911
  })
2867
2912
  }
@@ -2956,7 +3001,7 @@ const Component = ({
2956
3001
  /* @__PURE__ */ jsxRuntime.jsx(
2957
3002
  designSystem.IconButton,
2958
3003
  {
2959
- borderWidth: 0,
3004
+ variant: "ghost",
2960
3005
  onClick: onDeleteComponent,
2961
3006
  label: formatMessage({
2962
3007
  id: index.getTranslation("containers.Edit.delete"),
@@ -2969,7 +3014,7 @@ const Component = ({
2969
3014
  designSystem.IconButton,
2970
3015
  {
2971
3016
  ref: composedAccordionRefs,
2972
- borderWidth: 0,
3017
+ variant: "ghost",
2973
3018
  onClick: (e) => e.stopPropagation(),
2974
3019
  "data-handler-id": handlerId,
2975
3020
  label: formatMessage({
@@ -3039,7 +3084,7 @@ const ComponentInput = ({
3039
3084
  id: index.getTranslation("components.reset-entry"),
3040
3085
  defaultMessage: "Reset Entry"
3041
3086
  }),
3042
- borderWidth: 0,
3087
+ variant: "ghost",
3043
3088
  onClick: () => {
3044
3089
  field.onChange(name2, null);
3045
3090
  },
@@ -3068,11 +3113,8 @@ const AddComponentButton = ({
3068
3113
  onClick,
3069
3114
  disabled: isDisabled,
3070
3115
  background: "neutral0",
3071
- paddingTop: 3,
3072
- paddingBottom: 3,
3073
- paddingLeft: 4,
3074
- paddingRight: 4,
3075
3116
  style: { cursor: isDisabled ? "not-allowed" : "pointer" },
3117
+ variant: "tertiary",
3076
3118
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
3077
3119
  /* @__PURE__ */ jsxRuntime.jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
3078
3120
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3101,10 +3143,11 @@ const StyledAddIcon = styledComponents.styled(Icons.PlusCircle)`
3101
3143
  }
3102
3144
  `;
3103
3145
  const AddComponentTitle = styledComponents.styled(designSystem.Typography)``;
3104
- const StyledButton = styledComponents.styled(designSystem.BaseButton)`
3146
+ const StyledButton = styledComponents.styled(designSystem.Button)`
3105
3147
  border-radius: 26px;
3106
3148
  border-color: ${({ theme }) => theme.colors.neutral150};
3107
3149
  box-shadow: ${({ theme }) => theme.shadows.filterShadow};
3150
+ height: 5rem;
3108
3151
 
3109
3152
  &:hover {
3110
3153
  ${AddComponentTitle} {
@@ -3116,7 +3159,7 @@ const StyledButton = styledComponents.styled(designSystem.BaseButton)`
3116
3159
  fill: ${({ theme }) => theme.colors.primary600};
3117
3160
  }
3118
3161
  > path {
3119
- fill: ${({ theme }) => theme.colors.neutral100};
3162
+ fill: ${({ theme }) => theme.colors.primary600};
3120
3163
  }
3121
3164
  }
3122
3165
  }
@@ -3293,7 +3336,10 @@ const uidApi = index.contentManagerApi.injectEndpoints({
3293
3336
  config: {
3294
3337
  params
3295
3338
  }
3296
- })
3339
+ }),
3340
+ providesTags: (_res, _error, params) => [
3341
+ { type: "UidAvailability", id: params.contentTypeUID }
3342
+ ]
3297
3343
  })
3298
3344
  })
3299
3345
  });
@@ -3305,8 +3351,10 @@ const UIDInput = React__namespace.forwardRef(
3305
3351
  const allFormValues = strapiAdmin.useForm("InputUID", (form) => form.values);
3306
3352
  const [availability, setAvailability] = React__namespace.useState();
3307
3353
  const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
3354
+ const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
3308
3355
  const field = strapiAdmin.useField(name2);
3309
3356
  const debouncedValue = useDebounce(field.value, 300);
3357
+ const hasChanged = debouncedValue !== field.initialValue;
3310
3358
  const { toggleNotification } = strapiAdmin.useNotification();
3311
3359
  const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
3312
3360
  const { formatMessage } = reactIntl.useIntl();
@@ -3382,8 +3430,9 @@ const UIDInput = React__namespace.forwardRef(
3382
3430
  params
3383
3431
  },
3384
3432
  {
3433
+ // Don't check availability if the value is empty or wasn't changed
3385
3434
  skip: !Boolean(
3386
- debouncedValue !== field.initialValue && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3435
+ (hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
3387
3436
  )
3388
3437
  }
3389
3438
  );
@@ -3412,6 +3461,7 @@ const UIDInput = React__namespace.forwardRef(
3412
3461
  const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
3413
3462
  const fieldRef = strapiAdmin.useFocusInputField(name2);
3414
3463
  const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
3464
+ const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
3415
3465
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name: name2, error: field.error, required, children: [
3416
3466
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
3417
3467
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3420,7 +3470,7 @@ const UIDInput = React__namespace.forwardRef(
3420
3470
  ref: composedRefs,
3421
3471
  disabled: props.disabled,
3422
3472
  endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { position: "relative", gap: 1, children: [
3423
- availability && !showRegenerate && /* @__PURE__ */ jsxRuntime.jsxs(
3473
+ shouldShowAvailability && /* @__PURE__ */ jsxRuntime.jsxs(
3424
3474
  TextValidation,
3425
3475
  {
3426
3476
  alignItems: "center",
@@ -4254,7 +4304,7 @@ const EditorLayout = ({
4254
4304
  justifyContent: "flex-end",
4255
4305
  shrink: 0,
4256
4306
  width: "100%",
4257
- children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, children: [
4307
+ children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
4258
4308
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
4259
4309
  id: "components.Wysiwyg.collapse",
4260
4310
  defaultMessage: "Collapse"
@@ -4272,12 +4322,14 @@ const EditorLayout = ({
4272
4322
  ) }) });
4273
4323
  }
4274
4324
  return /* @__PURE__ */ jsxRuntime.jsx(
4275
- designSystem.Box,
4325
+ designSystem.Flex,
4276
4326
  {
4277
4327
  borderColor: error ? "danger600" : "neutral200",
4278
4328
  borderStyle: "solid",
4279
4329
  borderWidth: "1px",
4280
4330
  hasRadius: true,
4331
+ direction: "column",
4332
+ alignItems: "stretch",
4281
4333
  children
4282
4334
  }
4283
4335
  );
@@ -4288,11 +4340,19 @@ const ExpandWrapper = styledComponents.styled(designSystem.Flex)`
4288
4340
  const BoxWithBorder = styledComponents.styled(designSystem.Box)`
4289
4341
  border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
4290
4342
  `;
4291
- const ExpandButton$1 = styledComponents.styled(designSystem.BaseButton)`
4343
+ const ExpandButton$1 = styledComponents.styled(designSystem.Button)`
4292
4344
  background-color: transparent;
4293
4345
  border: none;
4294
4346
  align-items: center;
4295
4347
 
4348
+ & > span {
4349
+ display: flex;
4350
+ justify-content: space-between;
4351
+ align-items: center;
4352
+ width: 100%;
4353
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4354
+ }
4355
+
4296
4356
  svg {
4297
4357
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4298
4358
 
@@ -4588,11 +4648,19 @@ const MoreButton = styledComponents.styled(designSystem.IconButton)`
4588
4648
  const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
4589
4649
  margin-right: ${({ theme }) => `${theme.spaces[2]}`};
4590
4650
  `;
4591
- const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
4651
+ const ExpandButton = styledComponents.styled(designSystem.Button)`
4592
4652
  background-color: transparent;
4593
4653
  border: none;
4594
4654
  align-items: center;
4595
4655
 
4656
+ & > span {
4657
+ display: flex;
4658
+ justify-content: space-between;
4659
+ align-items: center;
4660
+ width: 100%;
4661
+ font-weight: ${({ theme }) => theme.fontWeights.regular};
4662
+ }
4663
+
4596
4664
  svg {
4597
4665
  margin-left: ${({ theme }) => `${theme.spaces[2]}`};
4598
4666
  path {
@@ -4604,8 +4672,8 @@ const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
4604
4672
  `;
4605
4673
  const WysiwygFooter = ({ onToggleExpand }) => {
4606
4674
  const { formatMessage } = reactIntl.useIntl();
4607
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, children: [
4608
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
4675
+ 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: [
4676
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: formatMessage({
4609
4677
  id: "components.WysiwygBottomControls.fullscreen",
4610
4678
  defaultMessage: "Expand"
4611
4679
  }) }),
@@ -4641,14 +4709,23 @@ const WysiwygNav = ({
4641
4709
  borderRadius: `0.4rem 0.4rem 0 0`,
4642
4710
  children: [
4643
4711
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
4644
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.SingleSelect, { disabled: true, placeholder: selectPlaceholder, "aria-label": selectPlaceholder, children: [
4645
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4646
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
4647
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
4648
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
4649
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
4650
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
4651
- ] }) }),
4712
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
4713
+ designSystem.SingleSelect,
4714
+ {
4715
+ disabled: true,
4716
+ placeholder: selectPlaceholder,
4717
+ "aria-label": selectPlaceholder,
4718
+ size: "S",
4719
+ children: [
4720
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4721
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
4722
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
4723
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
4724
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
4725
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
4726
+ ]
4727
+ }
4728
+ ) }),
4652
4729
  /* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
4653
4730
  /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
4654
4731
  /* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
@@ -4679,6 +4756,7 @@ const WysiwygNav = ({
4679
4756
  placeholder: selectPlaceholder,
4680
4757
  "aria-label": selectPlaceholder,
4681
4758
  onChange: (value) => onActionClick(value, editorRef),
4759
+ size: "S",
4682
4760
  children: [
4683
4761
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
4684
4762
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
@@ -5018,7 +5096,9 @@ const useFieldHint = (hint = void 0, attribute) => {
5018
5096
  if (!maximum && !minimum) {
5019
5097
  return hint;
5020
5098
  }
5021
- const units = !["biginteger", "integer", "number"].includes(attribute.type) ? formatMessage(
5099
+ const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
5100
+ attribute.type
5101
+ ) ? formatMessage(
5022
5102
  {
5023
5103
  id: "content-manager.form.Input.hint.character.unit",
5024
5104
  defaultMessage: "{maxValue, plural, one { character} other { characters}}"
@@ -5112,7 +5192,7 @@ const DynamicComponent = ({
5112
5192
  /* @__PURE__ */ jsxRuntime.jsx(
5113
5193
  designSystem.IconButton,
5114
5194
  {
5115
- borderWidth: 0,
5195
+ variant: "ghost",
5116
5196
  label: formatMessage(
5117
5197
  {
5118
5198
  id: index.getTranslation("components.DynamicZone.delete-label"),
@@ -5127,7 +5207,7 @@ const DynamicComponent = ({
5127
5207
  /* @__PURE__ */ jsxRuntime.jsx(
5128
5208
  designSystem.IconButton,
5129
5209
  {
5130
- borderWidth: 0,
5210
+ variant: "ghost",
5131
5211
  onClick: (e) => e.stopPropagation(),
5132
5212
  "data-handler-id": handlerId,
5133
5213
  ref: dragRef,
@@ -5188,7 +5268,18 @@ const DynamicComponent = ({
5188
5268
  ] }),
5189
5269
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
5190
5270
  const fieldName = `${name2}.${index$1}.${field.name}`;
5191
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
5271
+ return /* @__PURE__ */ jsxRuntime.jsx(
5272
+ designSystem.Grid.Item,
5273
+ {
5274
+ col: size,
5275
+ s: 12,
5276
+ xs: 12,
5277
+ direction: "column",
5278
+ alignItems: "stretch",
5279
+ children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName })
5280
+ },
5281
+ fieldName
5282
+ );
5192
5283
  }) }, rowInd)) }) }) })
5193
5284
  ] }) }) })
5194
5285
  ] });
@@ -5381,7 +5472,7 @@ const DynamicZone = ({
5381
5472
  const handleRemoveComponent = (name22, currentIndex) => () => {
5382
5473
  removeFieldRow(name22, currentIndex);
5383
5474
  };
5384
- const hasError = error !== void 0 || dynamicDisplayedComponentsLength < min || dynamicDisplayedComponentsLength > max;
5475
+ const hasError = error !== void 0;
5385
5476
  const renderButtonLabel = () => {
5386
5477
  if (addComponentIsOpen) {
5387
5478
  return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
@@ -5495,4 +5586,4 @@ exports.transformDocument = transformDocument;
5495
5586
  exports.useDynamicZone = useDynamicZone;
5496
5587
  exports.useFieldHint = useFieldHint;
5497
5588
  exports.useLazyComponents = useLazyComponents;
5498
- //# sourceMappingURL=Field-Boxf9Ajp.js.map
5589
+ //# sourceMappingURL=Field-dq8Tg1M_.js.map