@strapi/content-manager 0.0.0-experimental.745741d19e90275ca6f7c928ca19f9bb0fd9d933 → 0.0.0-experimental.779667bd163026468f566293decf331a0246fff9

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 (79) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-DHNM3YBz.mjs → ComponentConfigurationPage-B1bIXVuX.mjs} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-DHNM3YBz.mjs.map → ComponentConfigurationPage-B1bIXVuX.mjs.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-BvHtG7uH.js → ComponentConfigurationPage-Bqgx7Mes.js} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-BvHtG7uH.js.map → ComponentConfigurationPage-Bqgx7Mes.js.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-DOmfCEMo.js → EditConfigurationPage-BFEwvdMW.js} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-DOmfCEMo.js.map → EditConfigurationPage-BFEwvdMW.js.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-Cp6HAEzN.mjs → EditConfigurationPage-ZO0vOO8q.mjs} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-Cp6HAEzN.mjs.map → EditConfigurationPage-ZO0vOO8q.mjs.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-BqNpC6hO.js → EditViewPage-DA95Ha6J.js} +3 -3
  10. package/dist/_chunks/{EditViewPage-BqNpC6hO.js.map → EditViewPage-DA95Ha6J.js.map} +1 -1
  11. package/dist/_chunks/{EditViewPage-BtkEx339.mjs → EditViewPage-DlLEyUL6.mjs} +3 -3
  12. package/dist/_chunks/{EditViewPage-BtkEx339.mjs.map → EditViewPage-DlLEyUL6.mjs.map} +1 -1
  13. package/dist/_chunks/{Field-lsPFnAmH.js → Field-CnK8dO8N.js} +74 -49
  14. package/dist/_chunks/Field-CnK8dO8N.js.map +1 -0
  15. package/dist/_chunks/{Field-R5NbffTB.mjs → Field-Dq7bDnuh.mjs} +74 -49
  16. package/dist/_chunks/Field-Dq7bDnuh.mjs.map +1 -0
  17. package/dist/_chunks/{Form-BHmXSfyy.mjs → Form-B_JE0dbz.mjs} +2 -2
  18. package/dist/_chunks/{Form-BHmXSfyy.mjs.map → Form-B_JE0dbz.mjs.map} +1 -1
  19. package/dist/_chunks/{Form-CcGboku8.js → Form-BpiR4piS.js} +2 -2
  20. package/dist/_chunks/{Form-CcGboku8.js.map → Form-BpiR4piS.js.map} +1 -1
  21. package/dist/_chunks/{History-ByUPL3T3.mjs → History-CBNGU7a-.mjs} +11 -11
  22. package/dist/_chunks/History-CBNGU7a-.mjs.map +1 -0
  23. package/dist/_chunks/{History-Bsud8jwh.js → History-DdIstl8b.js} +11 -11
  24. package/dist/_chunks/History-DdIstl8b.js.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-Bm5HACXf.mjs → ListConfigurationPage-5dr4qpue.mjs} +8 -6
  26. package/dist/_chunks/ListConfigurationPage-5dr4qpue.mjs.map +1 -0
  27. package/dist/_chunks/{ListConfigurationPage-DiT463qx.js → ListConfigurationPage-DkKRparB.js} +8 -6
  28. package/dist/_chunks/ListConfigurationPage-DkKRparB.js.map +1 -0
  29. package/dist/_chunks/{ListViewPage-JSyNAAYu.mjs → ListViewPage-DecLrYV6.mjs} +3 -3
  30. package/dist/_chunks/{ListViewPage-JSyNAAYu.mjs.map → ListViewPage-DecLrYV6.mjs.map} +1 -1
  31. package/dist/_chunks/{ListViewPage-CsrC9L_d.js → ListViewPage-wE0lXqoD.js} +3 -3
  32. package/dist/_chunks/{ListViewPage-CsrC9L_d.js.map → ListViewPage-wE0lXqoD.js.map} +1 -1
  33. package/dist/_chunks/{NoContentTypePage-CsrQUpBE.mjs → NoContentTypePage-CiIcfYsd.mjs} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-CsrQUpBE.mjs.map → NoContentTypePage-CiIcfYsd.mjs.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-Bsvng4II.js → NoContentTypePage-DEKR6tf9.js} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-Bsvng4II.js.map → NoContentTypePage-DEKR6tf9.js.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-DNmf_pj0.mjs → NoPermissionsPage-CM5UD8ee.mjs} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-DNmf_pj0.mjs.map → NoPermissionsPage-CM5UD8ee.mjs.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-CdHNJtEf.js → NoPermissionsPage-DmNfF2Bb.js} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-CdHNJtEf.js.map → NoPermissionsPage-DmNfF2Bb.js.map} +1 -1
  41. package/dist/_chunks/{Relations-u8-37jK0.mjs → Relations-Dqz0C1fz.mjs} +3 -3
  42. package/dist/_chunks/Relations-Dqz0C1fz.mjs.map +1 -0
  43. package/dist/_chunks/{Relations-CghaPv2D.js → Relations-L0xYRoSQ.js} +3 -3
  44. package/dist/_chunks/Relations-L0xYRoSQ.js.map +1 -0
  45. package/dist/_chunks/{en-Ux26r5pl.mjs → en-BrCTWlZv.mjs} +5 -4
  46. package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-BrCTWlZv.mjs.map} +1 -1
  47. package/dist/_chunks/{en-fbKQxLGn.js → en-uOUIxfcQ.js} +5 -4
  48. package/dist/_chunks/{en-fbKQxLGn.js.map → en-uOUIxfcQ.js.map} +1 -1
  49. package/dist/_chunks/{index-CaE6NG4a.mjs → index-BSn97i8U.mjs} +224 -109
  50. package/dist/_chunks/index-BSn97i8U.mjs.map +1 -0
  51. package/dist/_chunks/{index-BOZx6IMg.js → index-DyvUPg1a.js} +222 -107
  52. package/dist/_chunks/index-DyvUPg1a.js.map +1 -0
  53. package/dist/_chunks/{layout-Bx7svTbY.mjs → layout-DPaHUusj.mjs} +4 -4
  54. package/dist/_chunks/layout-DPaHUusj.mjs.map +1 -0
  55. package/dist/_chunks/{layout-Ciz224q5.js → layout-TPqF2oJ5.js} +4 -4
  56. package/dist/_chunks/layout-TPqF2oJ5.js.map +1 -0
  57. package/dist/_chunks/{relations-CP8sB2YZ.js → relations-BWYS9gkn.js} +2 -2
  58. package/dist/_chunks/{relations-CP8sB2YZ.js.map → relations-BWYS9gkn.js.map} +1 -1
  59. package/dist/_chunks/{relations-Cxc1cEv3.mjs → relations-Ck7-ecDT.mjs} +2 -2
  60. package/dist/_chunks/{relations-Cxc1cEv3.mjs.map → relations-Ck7-ecDT.mjs.map} +1 -1
  61. package/dist/admin/index.js +1 -1
  62. package/dist/admin/index.mjs +1 -1
  63. package/dist/admin/src/history/index.d.ts +3 -0
  64. package/dist/admin/src/index.d.ts +1 -0
  65. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -0
  66. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
  67. package/package.json +6 -6
  68. package/dist/_chunks/Field-R5NbffTB.mjs.map +0 -1
  69. package/dist/_chunks/Field-lsPFnAmH.js.map +0 -1
  70. package/dist/_chunks/History-Bsud8jwh.js.map +0 -1
  71. package/dist/_chunks/History-ByUPL3T3.mjs.map +0 -1
  72. package/dist/_chunks/ListConfigurationPage-Bm5HACXf.mjs.map +0 -1
  73. package/dist/_chunks/ListConfigurationPage-DiT463qx.js.map +0 -1
  74. package/dist/_chunks/Relations-CghaPv2D.js.map +0 -1
  75. package/dist/_chunks/Relations-u8-37jK0.mjs.map +0 -1
  76. package/dist/_chunks/index-BOZx6IMg.js.map +0 -1
  77. package/dist/_chunks/index-CaE6NG4a.mjs.map +0 -1
  78. package/dist/_chunks/layout-Bx7svTbY.mjs.map +0 -1
  79. package/dist/_chunks/layout-Ciz224q5.js.map +0 -1
@@ -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, BaseButton, 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, d as buildValidParams, f as useDocumentRBAC, n as useDocLayout } from "./index-CaE6NG4a.mjs";
8
+ import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, d as buildValidParams, f as useDocumentRBAC, n as useDocLayout } from "./index-BSn97i8U.mjs";
9
9
  import { generateNKeysBetween } from "fractional-indexing";
10
- import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-u8-37jK0.mjs";
10
+ import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-Dqz0C1fz.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";
@@ -860,20 +860,8 @@ const LinkContent = React.forwardRef(
860
860
  const [linkText, setLinkText] = React.useState(elementText);
861
861
  const [linkUrl, setLinkUrl] = React.useState(link.url);
862
862
  const linkInputRef = React.useRef(null);
863
- const [showRemoveButton, setShowRemoveButton] = React.useState(false);
863
+ const isLastInsertedLink = editor.lastInsertedLinkPath ? !Path.equals(path, editor.lastInsertedLinkPath) : true;
864
864
  const [isSaveDisabled, setIsSaveDisabled] = React.useState(false);
865
- const handleOpenChange = (isOpen) => {
866
- if (isOpen) {
867
- setPopoverOpen(isOpen);
868
- setShowRemoveButton(isOpen);
869
- } else {
870
- setPopoverOpen(isOpen);
871
- if (link.url === "") {
872
- removeLink(editor);
873
- }
874
- ReactEditor.focus(editor);
875
- }
876
- };
877
865
  const onLinkChange = (e) => {
878
866
  setIsSaveDisabled(false);
879
867
  setLinkUrl(e.target.value);
@@ -894,15 +882,33 @@ const LinkContent = React.forwardRef(
894
882
  editLink(editor, { url: linkUrl, text: linkText });
895
883
  setPopoverOpen(false);
896
884
  editor.lastInsertedLinkPath = null;
885
+ ReactEditor.focus(editor);
886
+ };
887
+ const handleClose = () => {
888
+ if (link.url === "") {
889
+ removeLink(editor);
890
+ }
891
+ setPopoverOpen(false);
892
+ ReactEditor.focus(editor);
897
893
  };
898
894
  React.useEffect(() => {
899
895
  if (popoverOpen)
900
896
  linkInputRef.current?.focus();
901
897
  }, [popoverOpen]);
902
898
  const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
903
- return /* @__PURE__ */ jsxs(Popover.Root, { onOpenChange: handleOpenChange, open: popoverOpen, children: [
904
- /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(StyledBaseLink, { ...attributes, ref: forwardedRef, href: link.url, color: "primary600", children }) }),
905
- /* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsxs(Flex, { padding: 4, tag: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
899
+ return /* @__PURE__ */ jsxs(Popover.Root, { open: popoverOpen, children: [
900
+ /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
901
+ StyledBaseLink,
902
+ {
903
+ ...attributes,
904
+ ref: forwardedRef,
905
+ href: link.url,
906
+ onClick: () => setPopoverOpen(true),
907
+ color: "primary600",
908
+ children
909
+ }
910
+ ) }),
911
+ /* @__PURE__ */ jsx(Popover.Content, { onPointerDownOutside: handleClose, children: /* @__PURE__ */ jsxs(Flex, { padding: 4, direction: "column", gap: 4, children: [
906
912
  /* @__PURE__ */ jsx(Field.Root, { width: "368px", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
907
913
  /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
908
914
  id: "components.Blocks.popover.text",
@@ -948,7 +954,7 @@ const LinkContent = React.forwardRef(
948
954
  {
949
955
  variant: "danger-light",
950
956
  onClick: () => removeLink(editor),
951
- $visible: showRemoveButton,
957
+ $visible: isLastInsertedLink,
952
958
  children: formatMessage({
953
959
  id: "components.Blocks.popover.remove",
954
960
  defaultMessage: "Remove"
@@ -956,11 +962,11 @@ const LinkContent = React.forwardRef(
956
962
  }
957
963
  ),
958
964
  /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
959
- /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: () => handleOpenChange(false), children: formatMessage({
965
+ /* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
960
966
  id: "components.Blocks.popover.cancel",
961
967
  defaultMessage: "Cancel"
962
968
  }) }),
963
- /* @__PURE__ */ jsx(Button, { type: "submit", disabled: Boolean(inputNotDirty) || isSaveDisabled, children: formatMessage({
969
+ /* @__PURE__ */ jsx(Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
964
970
  id: "components.Blocks.popover.save",
965
971
  defaultMessage: "Save"
966
972
  }) })
@@ -1546,6 +1552,26 @@ const ListButton = ({ block, format }) => {
1546
1552
  }
1547
1553
  return false;
1548
1554
  };
1555
+ const isListDisabled = () => {
1556
+ if (disabled) {
1557
+ return true;
1558
+ }
1559
+ if (!editor.selection) {
1560
+ return false;
1561
+ }
1562
+ const anchorNodeEntry = Editor$1.above(editor, {
1563
+ at: editor.selection.anchor,
1564
+ match: (node) => !Editor$1.isEditor(node) && node.type !== "text"
1565
+ });
1566
+ const focusNodeEntry = Editor$1.above(editor, {
1567
+ at: editor.selection.focus,
1568
+ match: (node) => !Editor$1.isEditor(node) && node.type !== "text"
1569
+ });
1570
+ if (!anchorNodeEntry || !focusNodeEntry) {
1571
+ return false;
1572
+ }
1573
+ return anchorNodeEntry[0] !== focusNodeEntry[0];
1574
+ };
1549
1575
  const toggleList = (format2) => {
1550
1576
  let currentListEntry;
1551
1577
  if (editor.selection) {
@@ -1579,7 +1605,7 @@ const ListButton = ({ block, format }) => {
1579
1605
  name: format,
1580
1606
  label: block.label,
1581
1607
  isActive: isListActive(),
1582
- disabled,
1608
+ disabled: isListDisabled(),
1583
1609
  handleClick: () => toggleList(format)
1584
1610
  }
1585
1611
  );
@@ -2592,30 +2618,27 @@ const createDefaultForm = (contentType, components = {}) => {
2592
2618
  const Initializer = ({ disabled, name: name2, onClick }) => {
2593
2619
  const { formatMessage } = useIntl();
2594
2620
  const field = useField(name2);
2595
- return /* @__PURE__ */ jsxs(Fragment, { children: [
2596
- /* @__PURE__ */ jsx(
2597
- Box,
2598
- {
2599
- tag: "button",
2600
- background: "neutral100",
2601
- borderColor: field.error ? "danger600" : "neutral200",
2602
- hasRadius: true,
2603
- disabled,
2604
- onClick,
2605
- paddingTop: 9,
2606
- paddingBottom: 9,
2607
- type: "button",
2608
- children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
2609
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(CircleIcon, {}) }),
2610
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2611
- id: getTranslation("components.empty-repeatable"),
2612
- defaultMessage: "No entry yet. Click on the button below to add one."
2613
- }) }) })
2614
- ] })
2615
- }
2616
- ),
2617
- field.error && /* @__PURE__ */ jsx(Typography, { textColor: "danger600", variant: "pi", children: field.error })
2618
- ] });
2621
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
2622
+ Box,
2623
+ {
2624
+ tag: "button",
2625
+ background: "neutral100",
2626
+ borderColor: field.error ? "danger600" : "neutral200",
2627
+ hasRadius: true,
2628
+ disabled,
2629
+ onClick,
2630
+ paddingTop: 9,
2631
+ paddingBottom: 9,
2632
+ type: "button",
2633
+ children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
2634
+ /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(CircleIcon, {}) }),
2635
+ /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
2636
+ id: getTranslation("components.empty-repeatable"),
2637
+ defaultMessage: "No entry yet. Click on the button below to add one."
2638
+ }) }) })
2639
+ ] })
2640
+ }
2641
+ ) });
2619
2642
  };
2620
2643
  const CircleIcon = styled(PlusCircle)`
2621
2644
  width: 2.4rem;
@@ -4984,7 +5007,9 @@ const useFieldHint = (hint = void 0, attribute) => {
4984
5007
  if (!maximum && !minimum) {
4985
5008
  return hint;
4986
5009
  }
4987
- const units = !["biginteger", "integer", "number"].includes(attribute.type) ? formatMessage(
5010
+ const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
5011
+ attribute.type
5012
+ ) ? formatMessage(
4988
5013
  {
4989
5014
  id: "content-manager.form.Input.hint.character.unit",
4990
5015
  defaultMessage: "{maxValue, plural, one { character} other { characters}}"
@@ -5347,7 +5372,7 @@ const DynamicZone = ({
5347
5372
  const handleRemoveComponent = (name22, currentIndex) => () => {
5348
5373
  removeFieldRow(name22, currentIndex);
5349
5374
  };
5350
- const hasError = error !== void 0 || dynamicDisplayedComponentsLength < min || dynamicDisplayedComponentsLength > max;
5375
+ const hasError = error !== void 0;
5351
5376
  const renderButtonLabel = () => {
5352
5377
  if (addComponentIsOpen) {
5353
5378
  return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
@@ -5463,4 +5488,4 @@ export {
5463
5488
  transformDocument as t,
5464
5489
  useLazyComponents as u
5465
5490
  };
5466
- //# sourceMappingURL=Field-R5NbffTB.mjs.map
5491
+ //# sourceMappingURL=Field-Dq7bDnuh.mjs.map