@strapi/content-manager 0.0.0-experimental.b1d7921ddb1b36c84b58a3946e1dc9dbda91b2dc → 0.0.0-experimental.b67f4e6a09bc9dea2c9c999705ecef7e18e84f94

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 (152) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-CQDCxI8x.js → ComponentConfigurationPage-ClKl_TA2.js} +4 -4
  2. package/dist/_chunks/{ComponentConfigurationPage-CQDCxI8x.js.map → ComponentConfigurationPage-ClKl_TA2.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-jmWwucg_.mjs → ComponentConfigurationPage-D3ZWDAHG.mjs} +4 -4
  4. package/dist/_chunks/{ComponentConfigurationPage-jmWwucg_.mjs.map → ComponentConfigurationPage-D3ZWDAHG.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-W07CEdm2.mjs → EditConfigurationPage-BYCBSJxP.mjs} +4 -4
  6. package/dist/_chunks/{EditConfigurationPage-W07CEdm2.mjs.map → EditConfigurationPage-BYCBSJxP.mjs.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-Ce4bIm4n.js → EditConfigurationPage-OWez0Kxp.js} +4 -4
  8. package/dist/_chunks/{EditConfigurationPage-Ce4bIm4n.js.map → EditConfigurationPage-OWez0Kxp.js.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-al5OO1NR.mjs → EditViewPage-5pdbvsO_.mjs} +38 -8
  10. package/dist/_chunks/EditViewPage-5pdbvsO_.mjs.map +1 -0
  11. package/dist/_chunks/{EditViewPage-CqHMM0P0.js → EditViewPage-BEs5iGDi.js} +37 -7
  12. package/dist/_chunks/EditViewPage-BEs5iGDi.js.map +1 -0
  13. package/dist/_chunks/{Field-DSOUlTCm.js → Field-DNHm4wHx.js} +42 -23
  14. package/dist/_chunks/Field-DNHm4wHx.js.map +1 -0
  15. package/dist/_chunks/{Field-EeG6NQ7x.mjs → Field-DcKuFHYK.mjs} +42 -23
  16. package/dist/_chunks/Field-DcKuFHYK.mjs.map +1 -0
  17. package/dist/_chunks/{Form-BAo9ANb_.mjs → Form-CGwM_-5c.mjs} +2 -2
  18. package/dist/_chunks/{Form-BAo9ANb_.mjs.map → Form-CGwM_-5c.mjs.map} +1 -1
  19. package/dist/_chunks/{Form-DAEfHKzm.js → Form-CoRxWJOz.js} +2 -2
  20. package/dist/_chunks/{Form-DAEfHKzm.js.map → Form-CoRxWJOz.js.map} +1 -1
  21. package/dist/_chunks/{History-CTFvy6XH.js → History-BcUTQrfG.js} +21 -91
  22. package/dist/_chunks/History-BcUTQrfG.js.map +1 -0
  23. package/dist/_chunks/{History-BpLIu67W.mjs → History-DEvr3Q_V.mjs} +22 -92
  24. package/dist/_chunks/History-DEvr3Q_V.mjs.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-CDzlMBz_.js → ListConfigurationPage-BE_Ho7tV.js} +5 -4
  26. package/dist/_chunks/ListConfigurationPage-BE_Ho7tV.js.map +1 -0
  27. package/dist/_chunks/{ListConfigurationPage-DOqj5f8Y.mjs → ListConfigurationPage-BM4zZZcM.mjs} +6 -5
  28. package/dist/_chunks/ListConfigurationPage-BM4zZZcM.mjs.map +1 -0
  29. package/dist/_chunks/{ListViewPage-BbXYNI0v.mjs → ListViewPage-BK2mkrql.mjs} +28 -6
  30. package/dist/_chunks/{ListViewPage-BbXYNI0v.mjs.map → ListViewPage-BK2mkrql.mjs.map} +1 -1
  31. package/dist/_chunks/{ListViewPage-D0fpPYKp.js → ListViewPage-BkT8Eao0.js} +28 -6
  32. package/dist/_chunks/ListViewPage-BkT8Eao0.js.map +1 -0
  33. package/dist/_chunks/{NoContentTypePage-w2Q0VVOT.mjs → NoContentTypePage-BvcAutu9.mjs} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-w2Q0VVOT.mjs.map → NoContentTypePage-BvcAutu9.mjs.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-DTzkSAV5.js → NoContentTypePage-C8mtyc4H.js} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-DTzkSAV5.js.map → NoContentTypePage-C8mtyc4H.js.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-BoI2rU68.js → NoPermissionsPage-B5Y9Y78B.js} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-BoI2rU68.js.map → NoPermissionsPage-B5Y9Y78B.js.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-Km0Vk5Wp.mjs → NoPermissionsPage-BmbRz7PR.mjs} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-Km0Vk5Wp.mjs.map → NoPermissionsPage-BmbRz7PR.mjs.map} +1 -1
  41. package/dist/_chunks/Preview-BF8ZDYqS.js +286 -0
  42. package/dist/_chunks/Preview-BF8ZDYqS.js.map +1 -0
  43. package/dist/_chunks/Preview-DcexhKJE.mjs +267 -0
  44. package/dist/_chunks/Preview-DcexhKJE.mjs.map +1 -0
  45. package/dist/_chunks/{Relations-D6Nz5ksc.js → Relations-BKnoK1R0.js} +24 -10
  46. package/dist/_chunks/Relations-BKnoK1R0.js.map +1 -0
  47. package/dist/_chunks/{Relations-C_bpmSuQ.mjs → Relations-BjIzc4EK.mjs} +25 -11
  48. package/dist/_chunks/Relations-BjIzc4EK.mjs.map +1 -0
  49. package/dist/_chunks/{en-DKV44jRb.mjs → en-CfIXaZf9.mjs} +14 -3
  50. package/dist/_chunks/{en-DKV44jRb.mjs.map → en-CfIXaZf9.mjs.map} +1 -1
  51. package/dist/_chunks/{en-Bm0D0IWz.js → en-DTWPCdTS.js} +14 -3
  52. package/dist/_chunks/{en-Bm0D0IWz.js.map → en-DTWPCdTS.js.map} +1 -1
  53. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  54. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  55. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  56. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  57. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  58. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  59. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  60. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  61. package/dist/_chunks/{index-DcQ6xogO.mjs → index-BW-rXkjn.mjs} +164 -81
  62. package/dist/_chunks/index-BW-rXkjn.mjs.map +1 -0
  63. package/dist/_chunks/{index-BsMu2oVP.js → index-DOzAG2cq.js} +160 -77
  64. package/dist/_chunks/index-DOzAG2cq.js.map +1 -0
  65. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  66. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  67. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  68. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  69. package/dist/_chunks/{layout-BavJ6v4B.mjs → layout-DFVbgjp2.mjs} +3 -3
  70. package/dist/_chunks/{layout-BavJ6v4B.mjs.map → layout-DFVbgjp2.mjs.map} +1 -1
  71. package/dist/_chunks/{layout-B4aCAdTt.js → layout-RC3W2obV.js} +3 -3
  72. package/dist/_chunks/{layout-B4aCAdTt.js.map → layout-RC3W2obV.js.map} +1 -1
  73. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  74. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  75. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  76. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  77. package/dist/_chunks/{relations-DMG453Od.mjs → relations-Dogh8HWI.mjs} +6 -7
  78. package/dist/_chunks/relations-Dogh8HWI.mjs.map +1 -0
  79. package/dist/_chunks/{relations-Lrm9nz_m.js → relations-zam7-5H7.js} +6 -7
  80. package/dist/_chunks/relations-zam7-5H7.js.map +1 -0
  81. package/dist/admin/index.js +1 -1
  82. package/dist/admin/index.mjs +4 -4
  83. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  84. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  85. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  86. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  87. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  88. package/dist/admin/src/preview/constants.d.ts +1 -0
  89. package/dist/admin/src/preview/index.d.ts +4 -0
  90. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  91. package/dist/admin/src/preview/routes.d.ts +3 -0
  92. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  93. package/dist/admin/src/router.d.ts +1 -1
  94. package/dist/server/index.js +347 -130
  95. package/dist/server/index.js.map +1 -1
  96. package/dist/server/index.mjs +348 -131
  97. package/dist/server/index.mjs.map +1 -1
  98. package/dist/server/src/bootstrap.d.ts.map +1 -1
  99. package/dist/server/src/controllers/index.d.ts.map +1 -1
  100. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  101. package/dist/server/src/history/services/utils.d.ts +2 -3
  102. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  103. package/dist/server/src/preview/constants.d.ts +2 -0
  104. package/dist/server/src/preview/constants.d.ts.map +1 -0
  105. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  106. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  107. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  108. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  109. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  110. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  111. package/dist/server/src/preview/index.d.ts +4 -0
  112. package/dist/server/src/preview/index.d.ts.map +1 -0
  113. package/dist/server/src/preview/routes/index.d.ts +8 -0
  114. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  115. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  116. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  117. package/dist/server/src/preview/services/index.d.ts +16 -0
  118. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  119. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  120. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  121. package/dist/server/src/preview/services/preview.d.ts +12 -0
  122. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  123. package/dist/server/src/preview/utils.d.ts +19 -0
  124. package/dist/server/src/preview/utils.d.ts.map +1 -0
  125. package/dist/server/src/register.d.ts.map +1 -1
  126. package/dist/server/src/routes/index.d.ts.map +1 -1
  127. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  128. package/dist/server/src/services/index.d.ts.map +1 -1
  129. package/dist/shared/contracts/index.d.ts +1 -0
  130. package/dist/shared/contracts/index.d.ts.map +1 -1
  131. package/dist/shared/contracts/preview.d.ts +27 -0
  132. package/dist/shared/contracts/preview.d.ts.map +1 -0
  133. package/dist/shared/index.js +4 -0
  134. package/dist/shared/index.js.map +1 -1
  135. package/dist/shared/index.mjs +4 -0
  136. package/dist/shared/index.mjs.map +1 -1
  137. package/package.json +10 -10
  138. package/dist/_chunks/EditViewPage-CqHMM0P0.js.map +0 -1
  139. package/dist/_chunks/EditViewPage-al5OO1NR.mjs.map +0 -1
  140. package/dist/_chunks/Field-DSOUlTCm.js.map +0 -1
  141. package/dist/_chunks/Field-EeG6NQ7x.mjs.map +0 -1
  142. package/dist/_chunks/History-BpLIu67W.mjs.map +0 -1
  143. package/dist/_chunks/History-CTFvy6XH.js.map +0 -1
  144. package/dist/_chunks/ListConfigurationPage-CDzlMBz_.js.map +0 -1
  145. package/dist/_chunks/ListConfigurationPage-DOqj5f8Y.mjs.map +0 -1
  146. package/dist/_chunks/ListViewPage-D0fpPYKp.js.map +0 -1
  147. package/dist/_chunks/Relations-C_bpmSuQ.mjs.map +0 -1
  148. package/dist/_chunks/Relations-D6Nz5ksc.js.map +0 -1
  149. package/dist/_chunks/index-BsMu2oVP.js.map +0 -1
  150. package/dist/_chunks/index-DcQ6xogO.mjs.map +0 -1
  151. package/dist/_chunks/relations-DMG453Od.mjs.map +0 -1
  152. package/dist/_chunks/relations-Lrm9nz_m.js.map +0 -1
@@ -3,15 +3,15 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
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";
12
13
  import pipe from "lodash/fp/pipe";
13
14
  import { intervalToDuration, isPast } from "date-fns";
14
- import { styled } from "styled-components";
15
15
  import { stringify } from "qs";
16
16
  import { createSlice, combineReducers } from "@reduxjs/toolkit";
17
17
  const __variableDynamicImportRuntimeHelper = (glob, path) => {
@@ -969,9 +969,10 @@ const formatEditLayout = (data, {
969
969
  currentPanelIndex += 2;
970
970
  } else {
971
971
  if (!panels[currentPanelIndex]) {
972
- panels.push([]);
972
+ panels.push([row]);
973
+ } else {
974
+ panels[currentPanelIndex].push(row);
973
975
  }
974
- panels[currentPanelIndex].push(row);
975
976
  }
976
977
  return panels;
977
978
  }, []);
@@ -1229,9 +1230,6 @@ const useContentManagerContext = () => {
1229
1230
  };
1230
1231
  };
1231
1232
  const prefixPluginTranslations = (trad, pluginId) => {
1232
- if (!pluginId) {
1233
- throw new TypeError("pluginId can't be empty");
1234
- }
1235
1233
  return Object.keys(trad).reduce((acc, current) => {
1236
1234
  acc[`${pluginId}.${current}`] = trad[current];
1237
1235
  return acc;
@@ -1665,10 +1663,10 @@ const useDocumentActions = () => {
1665
1663
  update
1666
1664
  };
1667
1665
  };
1668
- const ProtectedHistoryPage = lazy(
1669
- () => import("./History-BpLIu67W.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1666
+ const ProtectedHistoryPage = React.lazy(
1667
+ () => import("./History-DEvr3Q_V.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1670
1668
  );
1671
- const routes$1 = [
1669
+ const routes$2 = [
1672
1670
  {
1673
1671
  path: ":collectionType/:slug/:id/history",
1674
1672
  Component: ProtectedHistoryPage
@@ -1678,32 +1676,45 @@ const routes$1 = [
1678
1676
  Component: ProtectedHistoryPage
1679
1677
  }
1680
1678
  ];
1679
+ const ProtectedPreviewPage = React.lazy(
1680
+ () => import("./Preview-DcexhKJE.mjs").then((mod) => ({ default: mod.ProtectedPreviewPage }))
1681
+ );
1682
+ const routes$1 = [
1683
+ {
1684
+ path: ":collectionType/:slug/:id/preview",
1685
+ Component: ProtectedPreviewPage
1686
+ },
1687
+ {
1688
+ path: ":collectionType/:slug/preview",
1689
+ Component: ProtectedPreviewPage
1690
+ }
1691
+ ];
1681
1692
  const ProtectedEditViewPage = lazy(
1682
- () => import("./EditViewPage-al5OO1NR.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1693
+ () => import("./EditViewPage-5pdbvsO_.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1683
1694
  );
1684
1695
  const ProtectedListViewPage = lazy(
1685
- () => import("./ListViewPage-BbXYNI0v.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1696
+ () => import("./ListViewPage-BK2mkrql.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1686
1697
  );
1687
1698
  const ProtectedListConfiguration = lazy(
1688
- () => import("./ListConfigurationPage-DOqj5f8Y.mjs").then((mod) => ({
1699
+ () => import("./ListConfigurationPage-BM4zZZcM.mjs").then((mod) => ({
1689
1700
  default: mod.ProtectedListConfiguration
1690
1701
  }))
1691
1702
  );
1692
1703
  const ProtectedEditConfigurationPage = lazy(
1693
- () => import("./EditConfigurationPage-W07CEdm2.mjs").then((mod) => ({
1704
+ () => import("./EditConfigurationPage-BYCBSJxP.mjs").then((mod) => ({
1694
1705
  default: mod.ProtectedEditConfigurationPage
1695
1706
  }))
1696
1707
  );
1697
1708
  const ProtectedComponentConfigurationPage = lazy(
1698
- () => import("./ComponentConfigurationPage-jmWwucg_.mjs").then((mod) => ({
1709
+ () => import("./ComponentConfigurationPage-D3ZWDAHG.mjs").then((mod) => ({
1699
1710
  default: mod.ProtectedComponentConfigurationPage
1700
1711
  }))
1701
1712
  );
1702
1713
  const NoPermissions = lazy(
1703
- () => import("./NoPermissionsPage-Km0Vk5Wp.mjs").then((mod) => ({ default: mod.NoPermissions }))
1714
+ () => import("./NoPermissionsPage-BmbRz7PR.mjs").then((mod) => ({ default: mod.NoPermissions }))
1704
1715
  );
1705
1716
  const NoContentType = lazy(
1706
- () => import("./NoContentTypePage-w2Q0VVOT.mjs").then((mod) => ({ default: mod.NoContentType }))
1717
+ () => import("./NoContentTypePage-BvcAutu9.mjs").then((mod) => ({ default: mod.NoContentType }))
1707
1718
  );
1708
1719
  const CollectionTypePages = () => {
1709
1720
  const { collectionType } = useParams();
@@ -1715,7 +1726,7 @@ const CollectionTypePages = () => {
1715
1726
  const CLONE_RELATIVE_PATH = ":collectionType/:slug/clone/:origin";
1716
1727
  const CLONE_PATH = `/content-manager/${CLONE_RELATIVE_PATH}`;
1717
1728
  const LIST_RELATIVE_PATH = ":collectionType/:slug";
1718
- const LIST_PATH = `/content-manager/${LIST_RELATIVE_PATH}`;
1729
+ const LIST_PATH = `/content-manager/collection-types/:slug`;
1719
1730
  const routes = [
1720
1731
  {
1721
1732
  path: LIST_RELATIVE_PATH,
@@ -1749,6 +1760,7 @@ const routes = [
1749
1760
  path: "no-content-types",
1750
1761
  Component: NoContentType
1751
1762
  },
1763
+ ...routes$2,
1752
1764
  ...routes$1
1753
1765
  ];
1754
1766
  const DocumentActions = ({ actions: actions2 }) => {
@@ -1847,6 +1859,11 @@ const DocumentActionButton = (action) => {
1847
1859
  ) : null
1848
1860
  ] });
1849
1861
  };
1862
+ const MenuItem = styled(Menu.Item)`
1863
+ &:hover {
1864
+ background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
1865
+ }
1866
+ `;
1850
1867
  const DocumentActionsMenu = ({
1851
1868
  actions: actions2,
1852
1869
  children,
@@ -1905,48 +1922,32 @@ const DocumentActionsMenu = ({
1905
1922
  /* @__PURE__ */ jsxs(Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
1906
1923
  actions2.map((action) => {
1907
1924
  return /* @__PURE__ */ jsx(
1908
- Menu.Item,
1925
+ MenuItem,
1909
1926
  {
1910
1927
  disabled: action.disabled,
1911
1928
  onSelect: handleClick(action),
1912
1929
  display: "block",
1913
- children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 4, children: [
1914
- /* @__PURE__ */ jsxs(
1915
- Flex,
1916
- {
1917
- color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1918
- gap: 2,
1919
- tag: "span",
1920
- children: [
1921
- /* @__PURE__ */ jsx(
1922
- Flex,
1923
- {
1924
- tag: "span",
1925
- color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1926
- children: action.icon
1927
- }
1928
- ),
1929
- action.label
1930
- ]
1931
- }
1932
- ),
1933
- action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsx(
1934
- Flex,
1935
- {
1936
- alignItems: "center",
1937
- background: "alternative100",
1938
- borderStyle: "solid",
1939
- borderColor: "alternative200",
1940
- borderWidth: "1px",
1941
- height: 5,
1942
- paddingLeft: 2,
1943
- paddingRight: 2,
1944
- hasRadius: true,
1945
- color: "alternative600",
1946
- children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", lineHeight: 1, children: formatMessage({ id: "global.new", defaultMessage: "New" }) })
1947
- }
1948
- )
1949
- ] })
1930
+ isVariantDanger: action.variant === "danger",
1931
+ isDisabled: action.disabled,
1932
+ children: /* @__PURE__ */ jsx(Flex, { justifyContent: "space-between", gap: 4, children: /* @__PURE__ */ jsxs(
1933
+ Flex,
1934
+ {
1935
+ color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1936
+ gap: 2,
1937
+ tag: "span",
1938
+ children: [
1939
+ /* @__PURE__ */ jsx(
1940
+ Flex,
1941
+ {
1942
+ tag: "span",
1943
+ color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1944
+ children: action.icon
1945
+ }
1946
+ ),
1947
+ action.label
1948
+ ]
1949
+ }
1950
+ ) })
1950
1951
  },
1951
1952
  action.id
1952
1953
  );
@@ -2272,7 +2273,7 @@ const UpdateAction = ({
2272
2273
  */
2273
2274
  disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2274
2275
  label: formatMessage({
2275
- id: "content-manager.containers.Edit.save",
2276
+ id: "global.save",
2276
2277
  defaultMessage: "Save"
2277
2278
  }),
2278
2279
  onClick: async () => {
@@ -2537,7 +2538,7 @@ const RelativeTime = React.forwardRef(
2537
2538
  });
2538
2539
  const unit = intervals.find((intervalUnit) => {
2539
2540
  return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
2540
- });
2541
+ }) ?? "seconds";
2541
2542
  const relativeTime = isPast(timestamp) ? -interval[unit] : interval[unit];
2542
2543
  const customInterval = customIntervals.find(
2543
2544
  (custom) => interval[custom.unit] < custom.threshold
@@ -2571,19 +2572,29 @@ const getDisplayName = ({
2571
2572
  return email ?? "";
2572
2573
  };
2573
2574
  const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
2574
- const DocumentStatus = ({ status = "draft", ...restProps }) => {
2575
+ const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
2575
2576
  const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
2576
- 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
+ }) }) });
2577
2582
  };
2578
2583
  const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
2579
2584
  const { formatMessage } = useIntl();
2580
2585
  const isCloning = useMatch(CLONE_PATH) !== null;
2586
+ const params = useParams();
2581
2587
  const title = isCreating ? formatMessage({
2582
2588
  id: "content-manager.containers.edit.title.new",
2583
2589
  defaultMessage: "Create an entry"
2584
2590
  }) : documentTitle;
2585
2591
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
2586
- /* @__PURE__ */ jsx(BackButton, {}),
2592
+ /* @__PURE__ */ jsx(
2593
+ BackButton,
2594
+ {
2595
+ fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
2596
+ }
2597
+ ),
2587
2598
  /* @__PURE__ */ jsxs(Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
2588
2599
  /* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
2589
2600
  /* @__PURE__ */ jsx(HeaderToolbar, {})
@@ -3020,7 +3031,7 @@ const Panel = React.forwardRef(({ children, title }, ref) => {
3020
3031
  justifyContent: "stretch",
3021
3032
  alignItems: "flex-start",
3022
3033
  children: [
3023
- /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", children: title }),
3034
+ /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", textColor: "neutral600", children: title }),
3024
3035
  children
3025
3036
  ]
3026
3037
  }
@@ -3270,18 +3281,10 @@ const SelectedEntriesTableContent = ({
3270
3281
  search: row.locale && `?plugins[i18n][locale]=${row.locale}`
3271
3282
  },
3272
3283
  state: { from: pathname },
3273
- label: formatMessage(
3274
- { id: "app.component.HelperPluginTable.edit", defaultMessage: "Edit {target}" },
3275
- {
3276
- target: formatMessage(
3277
- {
3278
- id: "content-manager.components.ListViewHelperPluginTable.row-line",
3279
- defaultMessage: "item line {number}"
3280
- },
3281
- { number: index2 + 1 }
3282
- )
3283
- }
3284
- ),
3284
+ label: formatMessage({
3285
+ id: "content-manager.bulk-publish.edit",
3286
+ defaultMessage: "Edit"
3287
+ }),
3285
3288
  target: "_blank",
3286
3289
  marginLeft: "auto",
3287
3290
  variant: "ghost",
@@ -3925,17 +3928,27 @@ const HistoryAction = ({ model, document }) => {
3925
3928
  const { formatMessage } = useIntl();
3926
3929
  const [{ query }] = useQueryParams();
3927
3930
  const navigate = useNavigate();
3931
+ const { trackUsage } = useTracking();
3932
+ const { pathname } = useLocation();
3928
3933
  const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
3929
3934
  if (!window.strapi.features.isEnabled("cms-content-history")) {
3930
3935
  return null;
3931
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
+ };
3932
3945
  return {
3933
3946
  icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
3934
3947
  label: formatMessage({
3935
3948
  id: "content-manager.history.document-action",
3936
3949
  defaultMessage: "Content History"
3937
3950
  }),
3938
- onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
3951
+ onClick: handleOnClick,
3939
3952
  disabled: (
3940
3953
  /**
3941
3954
  * The user is creating a new document.
@@ -4003,6 +4016,72 @@ const { setInitialData } = actions;
4003
4016
  const reducer = combineReducers({
4004
4017
  app: reducer$1
4005
4018
  });
4019
+ const previewApi = contentManagerApi.injectEndpoints({
4020
+ endpoints: (builder) => ({
4021
+ getPreviewUrl: builder.query({
4022
+ query({ query, params }) {
4023
+ return {
4024
+ url: `/content-manager/preview/url/${params.contentType}`,
4025
+ method: "GET",
4026
+ config: {
4027
+ params: query
4028
+ }
4029
+ };
4030
+ }
4031
+ })
4032
+ })
4033
+ });
4034
+ const { useGetPreviewUrlQuery } = previewApi;
4035
+ const PreviewSidePanel = ({ model, documentId, document }) => {
4036
+ const { formatMessage } = useIntl();
4037
+ const { trackUsage } = useTracking();
4038
+ const { pathname } = useLocation();
4039
+ const [{ query }] = useQueryParams();
4040
+ const { data, error } = useGetPreviewUrlQuery({
4041
+ params: {
4042
+ contentType: model
4043
+ },
4044
+ query: {
4045
+ documentId,
4046
+ locale: document?.locale,
4047
+ status: document?.status
4048
+ }
4049
+ });
4050
+ if (!data?.data?.url || error) {
4051
+ return null;
4052
+ }
4053
+ const trackNavigation = () => {
4054
+ const destinationPathname = pathname.replace(/\/$/, "") + "/preview";
4055
+ trackUsage("willNavigate", { from: pathname, to: destinationPathname });
4056
+ };
4057
+ return {
4058
+ title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
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
+ ) })
4073
+ };
4074
+ };
4075
+ const FEATURE_ID = "preview";
4076
+ const previewAdmin = {
4077
+ bootstrap(app) {
4078
+ if (!window.strapi.future.isEnabled(FEATURE_ID)) {
4079
+ return;
4080
+ }
4081
+ const contentManagerPluginApis = app.getPlugin("content-manager").apis;
4082
+ contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
4083
+ }
4084
+ };
4006
4085
  const index = {
4007
4086
  register(app) {
4008
4087
  const cm = new ContentManagerPlugin();
@@ -4022,7 +4101,7 @@ const index = {
4022
4101
  app.router.addRoute({
4023
4102
  path: "content-manager/*",
4024
4103
  lazy: async () => {
4025
- const { Layout } = await import("./layout-BavJ6v4B.mjs");
4104
+ const { Layout } = await import("./layout-DFVbgjp2.mjs");
4026
4105
  return {
4027
4106
  Component: Layout
4028
4107
  };
@@ -4035,11 +4114,14 @@ const index = {
4035
4114
  if (typeof historyAdmin.bootstrap === "function") {
4036
4115
  historyAdmin.bootstrap(app);
4037
4116
  }
4117
+ if (typeof previewAdmin.bootstrap === "function") {
4118
+ previewAdmin.bootstrap(app);
4119
+ }
4038
4120
  },
4039
4121
  async registerTrads({ locales }) {
4040
4122
  const importedTrads = await Promise.all(
4041
4123
  locales.map((locale) => {
4042
- 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-DKV44jRb.mjs"), "./translations/es.json": () => import("./es-CeXiYflN.mjs"), "./translations/eu.json": () => import("./eu-CdALomew.mjs"), "./translations/fr.json": () => import("./fr-CD9VFbPM.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-CtsUxOvk.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-CfIXaZf9.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 }) => {
4043
4125
  return {
4044
4126
  data: prefixPluginTranslations(data, PLUGIN_ID),
4045
4127
  locale
@@ -4066,9 +4148,10 @@ export {
4066
4148
  HOOKS as H,
4067
4149
  InjectionZone as I,
4068
4150
  useDocument as J,
4069
- index as K,
4070
- useContentManagerContext as L,
4071
- useDocumentActions as M,
4151
+ useGetPreviewUrlQuery as K,
4152
+ index as L,
4153
+ useContentManagerContext as M,
4154
+ useDocumentActions as N,
4072
4155
  Panels as P,
4073
4156
  RelativeTime as R,
4074
4157
  SINGLE_TYPES as S,
@@ -4100,4 +4183,4 @@ export {
4100
4183
  capitalise as y,
4101
4184
  useUpdateContentTypeConfigurationMutation as z
4102
4185
  };
4103
- //# sourceMappingURL=index-DcQ6xogO.mjs.map
4186
+ //# sourceMappingURL=index-BW-rXkjn.mjs.map