@strapi/content-manager 0.0.0-next.c823b10e981295994d8b0733c78fa065aec064ee → 0.0.0-next.c9f32f6f0c2be1b88323373117f12eb33219d20e

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 (103) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-BpM_Hc7r.mjs → ComponentConfigurationPage-BaJMOQyq.mjs} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-BpM_Hc7r.mjs.map → ComponentConfigurationPage-BaJMOQyq.mjs.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-CL9CAMaL.js → ComponentConfigurationPage-N-CTtgQa.js} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-CL9CAMaL.js.map → ComponentConfigurationPage-N-CTtgQa.js.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-ILWo0h1e.js → EditConfigurationPage-BHkjAbxH.js} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-ILWo0h1e.js.map → EditConfigurationPage-BHkjAbxH.js.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-_prbqpTM.mjs → EditConfigurationPage-CKK-5LfX.mjs} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-_prbqpTM.mjs.map → EditConfigurationPage-CKK-5LfX.mjs.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-DAtscabN.mjs → EditViewPage-B11aeMcf.mjs} +38 -8
  10. package/dist/_chunks/EditViewPage-B11aeMcf.mjs.map +1 -0
  11. package/dist/_chunks/{EditViewPage-BqZvBN4s.js → EditViewPage-QPUftxUd.js} +37 -7
  12. package/dist/_chunks/EditViewPage-QPUftxUd.js.map +1 -0
  13. package/dist/_chunks/{Field-D-mgn1tH.mjs → Field-Bj_RgtGo.mjs} +43 -24
  14. package/dist/_chunks/Field-Bj_RgtGo.mjs.map +1 -0
  15. package/dist/_chunks/{Field-CcoQiiz1.js → Field-DUK83cfh.js} +42 -23
  16. package/dist/_chunks/Field-DUK83cfh.js.map +1 -0
  17. package/dist/_chunks/{Form-CmLbZDfi.js → Form-DHmBRlHd.js} +2 -2
  18. package/dist/_chunks/{Form-CmLbZDfi.js.map → Form-DHmBRlHd.js.map} +1 -1
  19. package/dist/_chunks/{Form-BxyeWiXW.mjs → Form-DLMSoXV7.mjs} +2 -2
  20. package/dist/_chunks/{Form-BxyeWiXW.mjs.map → Form-DLMSoXV7.mjs.map} +1 -1
  21. package/dist/_chunks/{History-BOhLaq_g.mjs → History-CfCSNlG9.mjs} +9 -63
  22. package/dist/_chunks/History-CfCSNlG9.mjs.map +1 -0
  23. package/dist/_chunks/{History-uECUbCZB.js → History-Di3zm4HT.js} +8 -62
  24. package/dist/_chunks/History-Di3zm4HT.js.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-D0vQez6F.mjs → ListConfigurationPage-0mtv_iqk.mjs} +5 -4
  26. package/dist/_chunks/ListConfigurationPage-0mtv_iqk.mjs.map +1 -0
  27. package/dist/_chunks/{ListConfigurationPage-D_bBSFNW.js → ListConfigurationPage-Cq361KIt.js} +4 -3
  28. package/dist/_chunks/ListConfigurationPage-Cq361KIt.js.map +1 -0
  29. package/dist/_chunks/{ListViewPage-ns-bmy5C.mjs → ListViewPage-BxLVROX8.mjs} +63 -51
  30. package/dist/_chunks/ListViewPage-BxLVROX8.mjs.map +1 -0
  31. package/dist/_chunks/{ListViewPage-BkZ83b1A.js → ListViewPage-DFDcG8gM.js} +63 -51
  32. package/dist/_chunks/ListViewPage-DFDcG8gM.js.map +1 -0
  33. package/dist/_chunks/{NoContentTypePage-BA5ZKMDR.mjs → NoContentTypePage-BRfDd67_.mjs} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-BA5ZKMDR.mjs.map → NoContentTypePage-BRfDd67_.mjs.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-C1439s4s.js → NoContentTypePage-BSyvnDZZ.js} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-C1439s4s.js.map → NoContentTypePage-BSyvnDZZ.js.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-B0GdMw1Q.mjs → NoPermissionsPage-CV9V8KWa.mjs} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-B0GdMw1Q.mjs.map → NoPermissionsPage-CV9V8KWa.mjs.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-CPGwsVfb.js → NoPermissionsPage-DyLphsn_.js} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-CPGwsVfb.js.map → NoPermissionsPage-DyLphsn_.js.map} +1 -1
  41. package/dist/_chunks/Preview-C_B1nx3g.mjs +272 -0
  42. package/dist/_chunks/Preview-C_B1nx3g.mjs.map +1 -0
  43. package/dist/_chunks/Preview-D_3aO6Ly.js +291 -0
  44. package/dist/_chunks/Preview-D_3aO6Ly.js.map +1 -0
  45. package/dist/_chunks/{Relations-BIGPMSW4.mjs → Relations-C6pwmDXh.mjs} +3 -3
  46. package/dist/_chunks/{Relations-BIGPMSW4.mjs.map → Relations-C6pwmDXh.mjs.map} +1 -1
  47. package/dist/_chunks/{Relations-d-8Uef_-.js → Relations-Cne2AlrL.js} +3 -3
  48. package/dist/_chunks/{Relations-d-8Uef_-.js.map → Relations-Cne2AlrL.js.map} +1 -1
  49. package/dist/_chunks/{en-CZw4xdPY.mjs → en-DhFUjrNW.mjs} +10 -3
  50. package/dist/_chunks/{en-CZw4xdPY.mjs.map → en-DhFUjrNW.mjs.map} +1 -1
  51. package/dist/_chunks/{en-Bdpa50w3.js → en-Ic0kXjxB.js} +10 -3
  52. package/dist/_chunks/{en-Bdpa50w3.js.map → en-Ic0kXjxB.js.map} +1 -1
  53. package/dist/_chunks/{index-3_WeHXYp.mjs → index-BpxR3En4.mjs} +122 -116
  54. package/dist/_chunks/index-BpxR3En4.mjs.map +1 -0
  55. package/dist/_chunks/{index-BgaeYWIy.js → index-T-aWjbj2.js} +116 -110
  56. package/dist/_chunks/index-T-aWjbj2.js.map +1 -0
  57. package/dist/_chunks/{layout-ByFyQRDH.js → layout-BEuNwv-F.js} +3 -3
  58. package/dist/_chunks/{layout-ByFyQRDH.js.map → layout-BEuNwv-F.js.map} +1 -1
  59. package/dist/_chunks/{layout-CrTxOnCy.mjs → layout-DhMZ_lDx.mjs} +3 -3
  60. package/dist/_chunks/{layout-CrTxOnCy.mjs.map → layout-DhMZ_lDx.mjs.map} +1 -1
  61. package/dist/_chunks/{relations-BlpLgngh.mjs → relations-BdnxoX6f.mjs} +6 -3
  62. package/dist/_chunks/relations-BdnxoX6f.mjs.map +1 -0
  63. package/dist/_chunks/{relations-C5RSW926.js → relations-kLcuobLk.js} +6 -3
  64. package/dist/_chunks/relations-kLcuobLk.js.map +1 -0
  65. package/dist/admin/index.js +1 -1
  66. package/dist/admin/index.mjs +4 -4
  67. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  68. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  69. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  70. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  71. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  72. package/dist/admin/src/preview/routes.d.ts +3 -0
  73. package/dist/admin/src/router.d.ts +1 -1
  74. package/dist/admin/src/services/documents.d.ts +0 -3
  75. package/dist/server/index.js +56 -9
  76. package/dist/server/index.js.map +1 -1
  77. package/dist/server/index.mjs +57 -10
  78. package/dist/server/index.mjs.map +1 -1
  79. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -1
  80. package/dist/server/src/preview/index.d.ts.map +1 -1
  81. package/dist/server/src/preview/services/index.d.ts +1 -0
  82. package/dist/server/src/preview/services/index.d.ts.map +1 -1
  83. package/dist/server/src/preview/services/preview-config.d.ts +2 -0
  84. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -1
  85. package/dist/server/src/preview/utils.d.ts +1 -0
  86. package/dist/server/src/preview/utils.d.ts.map +1 -1
  87. package/dist/server/src/register.d.ts.map +1 -1
  88. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  89. package/package.json +9 -9
  90. package/dist/_chunks/EditViewPage-BqZvBN4s.js.map +0 -1
  91. package/dist/_chunks/EditViewPage-DAtscabN.mjs.map +0 -1
  92. package/dist/_chunks/Field-CcoQiiz1.js.map +0 -1
  93. package/dist/_chunks/Field-D-mgn1tH.mjs.map +0 -1
  94. package/dist/_chunks/History-BOhLaq_g.mjs.map +0 -1
  95. package/dist/_chunks/History-uECUbCZB.js.map +0 -1
  96. package/dist/_chunks/ListConfigurationPage-D0vQez6F.mjs.map +0 -1
  97. package/dist/_chunks/ListConfigurationPage-D_bBSFNW.js.map +0 -1
  98. package/dist/_chunks/ListViewPage-BkZ83b1A.js.map +0 -1
  99. package/dist/_chunks/ListViewPage-ns-bmy5C.mjs.map +0 -1
  100. package/dist/_chunks/index-3_WeHXYp.mjs.map +0 -1
  101. package/dist/_chunks/index-BgaeYWIy.js.map +0 -1
  102. package/dist/_chunks/relations-BlpLgngh.mjs.map +0 -1
  103. package/dist/_chunks/relations-C5RSW926.js.map +0 -1
@@ -1,18 +1,18 @@
1
- import { More, Cross, WarningCircle, ListPlus, Pencil, Trash, Check, CrossCircle, CheckCircle, ArrowsCounterClockwise, ChevronRight, Duplicate, ClockCounterClockwise, Link as Link$1, Feather } from "@strapi/icons";
1
+ import { More, Cross, WarningCircle, ListPlus, Pencil, Trash, Check, CrossCircle, CheckCircle, ArrowsCounterClockwise, ChevronRight, Duplicate, ClockCounterClockwise, Feather } from "@strapi/icons";
2
2
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
- import { useStrapiApp, createContext, useQueryParams, useAuth, useRBAC, Page, adminApi, translatedErrors, useNotification, useAPIErrorHandler, getYupValidationErrors, useForm, useTracking, useGuidedTour, BackButton, DescriptionComponentRenderer, useTable, Table, useClipboard } from "@strapi/admin/strapi-admin";
3
+ import { useStrapiApp, createContext, useQueryParams, useAuth, useRBAC, Page, adminApi, translatedErrors, useNotification, useAPIErrorHandler, getYupValidationErrors, useForm, useTracking, useGuidedTour, BackButton, DescriptionComponentRenderer, useTable, Table } from "@strapi/admin/strapi-admin";
4
4
  import * as React from "react";
5
5
  import { lazy } from "react";
6
- import { Button, Menu, VisuallyHidden, Flex, Typography, Dialog, Modal, Radio, Status, Box, SingleSelect, SingleSelectOption, IconButton, Loader, Tooltip, LinkButton } from "@strapi/design-system";
6
+ import { Menu, Button, VisuallyHidden, Flex, Dialog, Modal, Typography, Radio, Status, Box, SingleSelect, SingleSelectOption, IconButton, Loader, Tooltip, LinkButton } from "@strapi/design-system";
7
7
  import mapValues from "lodash/fp/mapValues";
8
8
  import { useIntl } from "react-intl";
9
9
  import { useParams, useNavigate, Navigate, useMatch, useLocation, Link, NavLink } from "react-router-dom";
10
+ import { styled } from "styled-components";
10
11
  import * as yup from "yup";
11
12
  import { ValidationError } from "yup";
13
+ import { stringify } from "qs";
12
14
  import pipe from "lodash/fp/pipe";
13
15
  import { intervalToDuration, isPast } from "date-fns";
14
- import { styled } from "styled-components";
15
- import { stringify } from "qs";
16
16
  import { createSlice, combineReducers } from "@reduxjs/toolkit";
17
17
  const __variableDynamicImportRuntimeHelper = (glob, path) => {
18
18
  const v = glob[path];
@@ -274,7 +274,7 @@ const documentApi = contentManagerApi.injectEndpoints({
274
274
  url: `/content-manager/collection-types/${model}`,
275
275
  method: "GET",
276
276
  config: {
277
- params
277
+ params: stringify(params, { encode: true })
278
278
  }
279
279
  }),
280
280
  providesTags: (result, _error, arg) => {
@@ -462,9 +462,6 @@ const buildValidParams = (query) => {
462
462
  {}
463
463
  )
464
464
  };
465
- if ("_q" in validQueryParams) {
466
- validQueryParams._q = encodeURIComponent(validQueryParams._q);
467
- }
468
465
  return validQueryParams;
469
466
  };
470
467
  const isBaseQueryError = (error) => {
@@ -1663,10 +1660,10 @@ const useDocumentActions = () => {
1663
1660
  update
1664
1661
  };
1665
1662
  };
1666
- const ProtectedHistoryPage = lazy(
1667
- () => import("./History-BOhLaq_g.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1663
+ const ProtectedHistoryPage = React.lazy(
1664
+ () => import("./History-CfCSNlG9.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1668
1665
  );
1669
- const routes$1 = [
1666
+ const routes$2 = [
1670
1667
  {
1671
1668
  path: ":collectionType/:slug/:id/history",
1672
1669
  Component: ProtectedHistoryPage
@@ -1676,32 +1673,45 @@ const routes$1 = [
1676
1673
  Component: ProtectedHistoryPage
1677
1674
  }
1678
1675
  ];
1676
+ const ProtectedPreviewPage = React.lazy(
1677
+ () => import("./Preview-C_B1nx3g.mjs").then((mod) => ({ default: mod.ProtectedPreviewPage }))
1678
+ );
1679
+ const routes$1 = [
1680
+ {
1681
+ path: ":collectionType/:slug/:id/preview",
1682
+ Component: ProtectedPreviewPage
1683
+ },
1684
+ {
1685
+ path: ":collectionType/:slug/preview",
1686
+ Component: ProtectedPreviewPage
1687
+ }
1688
+ ];
1679
1689
  const ProtectedEditViewPage = lazy(
1680
- () => import("./EditViewPage-DAtscabN.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1690
+ () => import("./EditViewPage-B11aeMcf.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1681
1691
  );
1682
1692
  const ProtectedListViewPage = lazy(
1683
- () => import("./ListViewPage-ns-bmy5C.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1693
+ () => import("./ListViewPage-BxLVROX8.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1684
1694
  );
1685
1695
  const ProtectedListConfiguration = lazy(
1686
- () => import("./ListConfigurationPage-D0vQez6F.mjs").then((mod) => ({
1696
+ () => import("./ListConfigurationPage-0mtv_iqk.mjs").then((mod) => ({
1687
1697
  default: mod.ProtectedListConfiguration
1688
1698
  }))
1689
1699
  );
1690
1700
  const ProtectedEditConfigurationPage = lazy(
1691
- () => import("./EditConfigurationPage-_prbqpTM.mjs").then((mod) => ({
1701
+ () => import("./EditConfigurationPage-CKK-5LfX.mjs").then((mod) => ({
1692
1702
  default: mod.ProtectedEditConfigurationPage
1693
1703
  }))
1694
1704
  );
1695
1705
  const ProtectedComponentConfigurationPage = lazy(
1696
- () => import("./ComponentConfigurationPage-BpM_Hc7r.mjs").then((mod) => ({
1706
+ () => import("./ComponentConfigurationPage-BaJMOQyq.mjs").then((mod) => ({
1697
1707
  default: mod.ProtectedComponentConfigurationPage
1698
1708
  }))
1699
1709
  );
1700
1710
  const NoPermissions = lazy(
1701
- () => import("./NoPermissionsPage-B0GdMw1Q.mjs").then((mod) => ({ default: mod.NoPermissions }))
1711
+ () => import("./NoPermissionsPage-CV9V8KWa.mjs").then((mod) => ({ default: mod.NoPermissions }))
1702
1712
  );
1703
1713
  const NoContentType = lazy(
1704
- () => import("./NoContentTypePage-BA5ZKMDR.mjs").then((mod) => ({ default: mod.NoContentType }))
1714
+ () => import("./NoContentTypePage-BRfDd67_.mjs").then((mod) => ({ default: mod.NoContentType }))
1705
1715
  );
1706
1716
  const CollectionTypePages = () => {
1707
1717
  const { collectionType } = useParams();
@@ -1713,7 +1723,7 @@ const CollectionTypePages = () => {
1713
1723
  const CLONE_RELATIVE_PATH = ":collectionType/:slug/clone/:origin";
1714
1724
  const CLONE_PATH = `/content-manager/${CLONE_RELATIVE_PATH}`;
1715
1725
  const LIST_RELATIVE_PATH = ":collectionType/:slug";
1716
- const LIST_PATH = `/content-manager/${LIST_RELATIVE_PATH}`;
1726
+ const LIST_PATH = `/content-manager/collection-types/:slug`;
1717
1727
  const routes = [
1718
1728
  {
1719
1729
  path: LIST_RELATIVE_PATH,
@@ -1747,6 +1757,7 @@ const routes = [
1747
1757
  path: "no-content-types",
1748
1758
  Component: NoContentType
1749
1759
  },
1760
+ ...routes$2,
1750
1761
  ...routes$1
1751
1762
  ];
1752
1763
  const DocumentActions = ({ actions: actions2 }) => {
@@ -1845,6 +1856,11 @@ const DocumentActionButton = (action) => {
1845
1856
  ) : null
1846
1857
  ] });
1847
1858
  };
1859
+ const MenuItem = styled(Menu.Item)`
1860
+ &:hover {
1861
+ background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
1862
+ }
1863
+ `;
1848
1864
  const DocumentActionsMenu = ({
1849
1865
  actions: actions2,
1850
1866
  children,
@@ -1903,48 +1919,32 @@ const DocumentActionsMenu = ({
1903
1919
  /* @__PURE__ */ jsxs(Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
1904
1920
  actions2.map((action) => {
1905
1921
  return /* @__PURE__ */ jsx(
1906
- Menu.Item,
1922
+ MenuItem,
1907
1923
  {
1908
1924
  disabled: action.disabled,
1909
1925
  onSelect: handleClick(action),
1910
1926
  display: "block",
1911
- children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 4, children: [
1912
- /* @__PURE__ */ jsxs(
1913
- Flex,
1914
- {
1915
- color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1916
- gap: 2,
1917
- tag: "span",
1918
- children: [
1919
- /* @__PURE__ */ jsx(
1920
- Flex,
1921
- {
1922
- tag: "span",
1923
- color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1924
- children: action.icon
1925
- }
1926
- ),
1927
- action.label
1928
- ]
1929
- }
1930
- ),
1931
- action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsx(
1932
- Flex,
1933
- {
1934
- alignItems: "center",
1935
- background: "alternative100",
1936
- borderStyle: "solid",
1937
- borderColor: "alternative200",
1938
- borderWidth: "1px",
1939
- height: 5,
1940
- paddingLeft: 2,
1941
- paddingRight: 2,
1942
- hasRadius: true,
1943
- color: "alternative600",
1944
- children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", lineHeight: 1, children: formatMessage({ id: "global.new", defaultMessage: "New" }) })
1945
- }
1946
- )
1947
- ] })
1927
+ isVariantDanger: action.variant === "danger",
1928
+ isDisabled: action.disabled,
1929
+ children: /* @__PURE__ */ jsx(Flex, { justifyContent: "space-between", gap: 4, children: /* @__PURE__ */ jsxs(
1930
+ Flex,
1931
+ {
1932
+ color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1933
+ gap: 2,
1934
+ tag: "span",
1935
+ children: [
1936
+ /* @__PURE__ */ jsx(
1937
+ Flex,
1938
+ {
1939
+ tag: "span",
1940
+ color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1941
+ children: action.icon
1942
+ }
1943
+ ),
1944
+ action.label
1945
+ ]
1946
+ }
1947
+ ) })
1948
1948
  },
1949
1949
  action.id
1950
1950
  );
@@ -2081,6 +2081,7 @@ const PublishAction$1 = ({
2081
2081
  const { _unstableFormatValidationErrors: formatValidationErrors } = useAPIErrorHandler();
2082
2082
  const isListView = useMatch(LIST_PATH) !== null;
2083
2083
  const isCloning = useMatch(CLONE_PATH) !== null;
2084
+ const { id } = useParams();
2084
2085
  const { formatMessage } = useIntl();
2085
2086
  const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
2086
2087
  const { publish } = useDocumentActions();
@@ -2183,10 +2184,12 @@ const PublishAction$1 = ({
2183
2184
  transformData(formValues)
2184
2185
  );
2185
2186
  if ("data" in res && collectionType !== SINGLE_TYPES) {
2186
- navigate({
2187
- pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2188
- search: rawQuery
2189
- });
2187
+ if (id === "create") {
2188
+ navigate({
2189
+ pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2190
+ search: rawQuery
2191
+ });
2192
+ }
2190
2193
  } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2191
2194
  setErrors(formatValidationErrors(res.error));
2192
2195
  }
@@ -2270,7 +2273,7 @@ const UpdateAction = ({
2270
2273
  */
2271
2274
  disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2272
2275
  label: formatMessage({
2273
- id: "content-manager.containers.Edit.save",
2276
+ id: "global.save",
2274
2277
  defaultMessage: "Save"
2275
2278
  }),
2276
2279
  onClick: async () => {
@@ -2535,7 +2538,7 @@ const RelativeTime = React.forwardRef(
2535
2538
  });
2536
2539
  const unit = intervals.find((intervalUnit) => {
2537
2540
  return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
2538
- });
2541
+ }) ?? "seconds";
2539
2542
  const relativeTime = isPast(timestamp) ? -interval[unit] : interval[unit];
2540
2543
  const customInterval = customIntervals.find(
2541
2544
  (custom) => interval[custom.unit] < custom.threshold
@@ -2569,19 +2572,29 @@ const getDisplayName = ({
2569
2572
  return email ?? "";
2570
2573
  };
2571
2574
  const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
2572
- const DocumentStatus = ({ status = "draft", ...restProps }) => {
2575
+ const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
2573
2576
  const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
2574
- return /* @__PURE__ */ jsx(Status, { ...restProps, showBullet: false, size: "S", variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: capitalise(status) }) });
2577
+ const { formatMessage } = useIntl();
2578
+ return /* @__PURE__ */ jsx(Status, { ...restProps, size, variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: formatMessage({
2579
+ id: `content-manager.containers.List.${status}`,
2580
+ defaultMessage: capitalise(status)
2581
+ }) }) });
2575
2582
  };
2576
2583
  const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
2577
2584
  const { formatMessage } = useIntl();
2578
2585
  const isCloning = useMatch(CLONE_PATH) !== null;
2586
+ const params = useParams();
2579
2587
  const title = isCreating ? formatMessage({
2580
2588
  id: "content-manager.containers.edit.title.new",
2581
2589
  defaultMessage: "Create an entry"
2582
2590
  }) : documentTitle;
2583
2591
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
2584
- /* @__PURE__ */ jsx(BackButton, {}),
2592
+ /* @__PURE__ */ jsx(
2593
+ BackButton,
2594
+ {
2595
+ fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
2596
+ }
2597
+ ),
2585
2598
  /* @__PURE__ */ jsxs(Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
2586
2599
  /* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
2587
2600
  /* @__PURE__ */ jsx(HeaderToolbar, {})
@@ -3268,18 +3281,10 @@ const SelectedEntriesTableContent = ({
3268
3281
  search: row.locale && `?plugins[i18n][locale]=${row.locale}`
3269
3282
  },
3270
3283
  state: { from: pathname },
3271
- label: formatMessage(
3272
- { id: "app.component.HelperPluginTable.edit", defaultMessage: "Edit {target}" },
3273
- {
3274
- target: formatMessage(
3275
- {
3276
- id: "content-manager.components.ListViewHelperPluginTable.row-line",
3277
- defaultMessage: "item line {number}"
3278
- },
3279
- { number: index2 + 1 }
3280
- )
3281
- }
3282
- ),
3284
+ label: formatMessage({
3285
+ id: "content-manager.bulk-publish.edit",
3286
+ defaultMessage: "Edit"
3287
+ }),
3283
3288
  target: "_blank",
3284
3289
  marginLeft: "auto",
3285
3290
  variant: "ghost",
@@ -3923,17 +3928,27 @@ const HistoryAction = ({ model, document }) => {
3923
3928
  const { formatMessage } = useIntl();
3924
3929
  const [{ query }] = useQueryParams();
3925
3930
  const navigate = useNavigate();
3931
+ const { trackUsage } = useTracking();
3932
+ const { pathname } = useLocation();
3926
3933
  const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
3927
3934
  if (!window.strapi.features.isEnabled("cms-content-history")) {
3928
3935
  return null;
3929
3936
  }
3937
+ const handleOnClick = () => {
3938
+ const destination = { pathname: "history", search: pluginsQueryParams };
3939
+ trackUsage("willNavigate", {
3940
+ from: pathname,
3941
+ to: `${pathname}/${destination.pathname}`
3942
+ });
3943
+ navigate(destination);
3944
+ };
3930
3945
  return {
3931
3946
  icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
3932
3947
  label: formatMessage({
3933
3948
  id: "content-manager.history.document-action",
3934
3949
  defaultMessage: "Content History"
3935
3950
  }),
3936
- onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
3951
+ onClick: handleOnClick,
3937
3952
  disabled: (
3938
3953
  /**
3939
3954
  * The user is creating a new document.
@@ -4019,8 +4034,9 @@ const previewApi = contentManagerApi.injectEndpoints({
4019
4034
  const { useGetPreviewUrlQuery } = previewApi;
4020
4035
  const PreviewSidePanel = ({ model, documentId, document }) => {
4021
4036
  const { formatMessage } = useIntl();
4022
- const { toggleNotification } = useNotification();
4023
- const { copy } = useClipboard();
4037
+ const { trackUsage } = useTracking();
4038
+ const { pathname } = useLocation();
4039
+ const [{ query }] = useQueryParams();
4024
4040
  const { data, error } = useGetPreviewUrlQuery({
4025
4041
  params: {
4026
4042
  contentType: model
@@ -4034,37 +4050,26 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
4034
4050
  if (!data?.data?.url || error) {
4035
4051
  return null;
4036
4052
  }
4037
- const { url } = data.data;
4038
- const handleCopyLink = () => {
4039
- copy(url);
4040
- toggleNotification({
4041
- message: formatMessage({
4042
- id: "content-manager.preview.copy.success",
4043
- defaultMessage: "Copied preview link"
4044
- }),
4045
- type: "success"
4046
- });
4053
+ const trackNavigation = () => {
4054
+ const destinationPathname = pathname.replace(/\/$/, "") + "/preview";
4055
+ trackUsage("willNavigate", { from: pathname, to: destinationPathname });
4047
4056
  };
4048
4057
  return {
4049
4058
  title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
4050
- content: /* @__PURE__ */ jsxs(Flex, { gap: 2, width: "100%", children: [
4051
- /* @__PURE__ */ jsx(Button, { variant: "tertiary", tag: Link, to: url, target: "_blank", flex: "auto", children: formatMessage({
4052
- id: "content-manager.preview.panel.button",
4053
- defaultMessage: "Open preview"
4054
- }) }),
4055
- /* @__PURE__ */ jsx(
4056
- IconButton,
4057
- {
4058
- type: "button",
4059
- label: formatMessage({
4060
- id: "preview.copy.label",
4061
- defaultMessage: "Copy preview link"
4062
- }),
4063
- onClick: handleCopyLink,
4064
- children: /* @__PURE__ */ jsx(Link$1, {})
4065
- }
4066
- )
4067
- ] })
4059
+ content: /* @__PURE__ */ jsx(Flex, { gap: 2, width: "100%", children: /* @__PURE__ */ jsx(
4060
+ Button,
4061
+ {
4062
+ variant: "tertiary",
4063
+ tag: Link,
4064
+ to: { pathname: "preview", search: stringify(query, { encode: false }) },
4065
+ onClick: trackNavigation,
4066
+ flex: "auto",
4067
+ children: formatMessage({
4068
+ id: "content-manager.preview.panel.button",
4069
+ defaultMessage: "Open preview"
4070
+ })
4071
+ }
4072
+ ) })
4068
4073
  };
4069
4074
  };
4070
4075
  const FEATURE_ID = "preview";
@@ -4096,7 +4101,7 @@ const index = {
4096
4101
  app.router.addRoute({
4097
4102
  path: "content-manager/*",
4098
4103
  lazy: async () => {
4099
- const { Layout } = await import("./layout-CrTxOnCy.mjs");
4104
+ const { Layout } = await import("./layout-DhMZ_lDx.mjs");
4100
4105
  return {
4101
4106
  Component: Layout
4102
4107
  };
@@ -4116,7 +4121,7 @@ const index = {
4116
4121
  async registerTrads({ locales }) {
4117
4122
  const importedTrads = await Promise.all(
4118
4123
  locales.map((locale) => {
4119
- return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-CCEVvqGG.mjs"), "./translations/ca.json": () => import("./ca-5U32ON2v.mjs"), "./translations/cs.json": () => import("./cs-CM2aBUar.mjs"), "./translations/de.json": () => import("./de-C72KDNOl.mjs"), "./translations/en.json": () => import("./en-CZw4xdPY.mjs"), "./translations/es.json": () => import("./es-D34tqjMw.mjs"), "./translations/eu.json": () => import("./eu-CdALomew.mjs"), "./translations/fr.json": () => import("./fr--pg5jUbt.mjs"), "./translations/gu.json": () => import("./gu-CNpaMDpH.mjs"), "./translations/hi.json": () => import("./hi-Dwvd04m3.mjs"), "./translations/hu.json": () => import("./hu-CeYvaaO0.mjs"), "./translations/id.json": () => import("./id-BtwA9WJT.mjs"), "./translations/it.json": () => import("./it-BrVPqaf1.mjs"), "./translations/ja.json": () => import("./ja-BHqhDq4V.mjs"), "./translations/ko.json": () => import("./ko-HVQRlfUI.mjs"), "./translations/ml.json": () => import("./ml-BihZwQit.mjs"), "./translations/ms.json": () => import("./ms-m_WjyWx7.mjs"), "./translations/nl.json": () => import("./nl-D4R9gHx5.mjs"), "./translations/pl.json": () => import("./pl-sbx9mSt_.mjs"), "./translations/pt-BR.json": () => import("./pt-BR-C71iDxnh.mjs"), "./translations/pt.json": () => import("./pt-BsaFvS8-.mjs"), "./translations/ru.json": () => import("./ru-BE6A4Exp.mjs"), "./translations/sa.json": () => import("./sa-Dag0k-Z8.mjs"), "./translations/sk.json": () => import("./sk-BFg-R8qJ.mjs"), "./translations/sv.json": () => import("./sv-CUnfWGsh.mjs"), "./translations/th.json": () => import("./th-BqbI8lIT.mjs"), "./translations/tr.json": () => import("./tr-CgeK3wJM.mjs"), "./translations/uk.json": () => import("./uk-CR-zDhAY.mjs"), "./translations/vi.json": () => import("./vi-DUXIk_fw.mjs"), "./translations/zh-Hans.json": () => import("./zh-Hans-BPQcRIyH.mjs"), "./translations/zh.json": () => import("./zh-BWZspA60.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
4124
+ return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-CCEVvqGG.mjs"), "./translations/ca.json": () => import("./ca-5U32ON2v.mjs"), "./translations/cs.json": () => import("./cs-CM2aBUar.mjs"), "./translations/de.json": () => import("./de-C72KDNOl.mjs"), "./translations/en.json": () => import("./en-DhFUjrNW.mjs"), "./translations/es.json": () => import("./es-D34tqjMw.mjs"), "./translations/eu.json": () => import("./eu-CdALomew.mjs"), "./translations/fr.json": () => import("./fr--pg5jUbt.mjs"), "./translations/gu.json": () => import("./gu-CNpaMDpH.mjs"), "./translations/hi.json": () => import("./hi-Dwvd04m3.mjs"), "./translations/hu.json": () => import("./hu-CeYvaaO0.mjs"), "./translations/id.json": () => import("./id-BtwA9WJT.mjs"), "./translations/it.json": () => import("./it-BrVPqaf1.mjs"), "./translations/ja.json": () => import("./ja-BHqhDq4V.mjs"), "./translations/ko.json": () => import("./ko-HVQRlfUI.mjs"), "./translations/ml.json": () => import("./ml-BihZwQit.mjs"), "./translations/ms.json": () => import("./ms-m_WjyWx7.mjs"), "./translations/nl.json": () => import("./nl-D4R9gHx5.mjs"), "./translations/pl.json": () => import("./pl-sbx9mSt_.mjs"), "./translations/pt-BR.json": () => import("./pt-BR-C71iDxnh.mjs"), "./translations/pt.json": () => import("./pt-BsaFvS8-.mjs"), "./translations/ru.json": () => import("./ru-BE6A4Exp.mjs"), "./translations/sa.json": () => import("./sa-Dag0k-Z8.mjs"), "./translations/sk.json": () => import("./sk-BFg-R8qJ.mjs"), "./translations/sv.json": () => import("./sv-CUnfWGsh.mjs"), "./translations/th.json": () => import("./th-BqbI8lIT.mjs"), "./translations/tr.json": () => import("./tr-CgeK3wJM.mjs"), "./translations/uk.json": () => import("./uk-CR-zDhAY.mjs"), "./translations/vi.json": () => import("./vi-DUXIk_fw.mjs"), "./translations/zh-Hans.json": () => import("./zh-Hans-BPQcRIyH.mjs"), "./translations/zh.json": () => import("./zh-BWZspA60.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
4120
4125
  return {
4121
4126
  data: prefixPluginTranslations(data, PLUGIN_ID),
4122
4127
  locale
@@ -4143,9 +4148,10 @@ export {
4143
4148
  HOOKS as H,
4144
4149
  InjectionZone as I,
4145
4150
  useDocument as J,
4146
- index as K,
4147
- useContentManagerContext as L,
4148
- useDocumentActions as M,
4151
+ useGetPreviewUrlQuery as K,
4152
+ index as L,
4153
+ useContentManagerContext as M,
4154
+ useDocumentActions as N,
4149
4155
  Panels as P,
4150
4156
  RelativeTime as R,
4151
4157
  SINGLE_TYPES as S,
@@ -4177,4 +4183,4 @@ export {
4177
4183
  capitalise as y,
4178
4184
  useUpdateContentTypeConfigurationMutation as z
4179
4185
  };
4180
- //# sourceMappingURL=index-3_WeHXYp.mjs.map
4186
+ //# sourceMappingURL=index-BpxR3En4.mjs.map