@strapi/content-manager 0.0.0-experimental.65b9961ce81496e349024ceb95be1d5946f2c429 → 0.0.0-experimental.702fcf7aec9be82c4485a8bd49e235293c37f022

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 (158) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-CO977CPh.js → ComponentConfigurationPage-BaGEn2nd.js} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-CO977CPh.js.map → ComponentConfigurationPage-BaGEn2nd.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-CQroR9Qk.mjs → ComponentConfigurationPage-EIYRzIr6.mjs} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-CQroR9Qk.mjs.map → ComponentConfigurationPage-EIYRzIr6.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-BPgoE-kf.js → EditConfigurationPage-BQGdJb6Z.js} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-BPgoE-kf.js.map → EditConfigurationPage-BQGdJb6Z.js.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-tVCJ5vWC.mjs → EditConfigurationPage-ByaNUj_q.mjs} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-tVCJ5vWC.mjs.map → EditConfigurationPage-ByaNUj_q.mjs.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-8mOu02ji.mjs → EditViewPage-BgeC8L9X.mjs} +38 -8
  10. package/dist/_chunks/EditViewPage-BgeC8L9X.mjs.map +1 -0
  11. package/dist/_chunks/{EditViewPage-BMVgUNOX.js → EditViewPage-s_qVLiC6.js} +37 -7
  12. package/dist/_chunks/EditViewPage-s_qVLiC6.js.map +1 -0
  13. package/dist/_chunks/{Field-CdSLKFQk.js → Field-0AdG2t0D.js} +27 -7
  14. package/dist/_chunks/Field-0AdG2t0D.js.map +1 -0
  15. package/dist/_chunks/{Field-CJPYzwD7.mjs → Field-DbpDop_h.mjs} +27 -7
  16. package/dist/_chunks/Field-DbpDop_h.mjs.map +1 -0
  17. package/dist/_chunks/{Form-eP5bZwap.js → Form-BpC9hWi-.js} +2 -2
  18. package/dist/_chunks/{Form-eP5bZwap.js.map → Form-BpC9hWi-.js.map} +1 -1
  19. package/dist/_chunks/{Form-DJOJ-GF1.mjs → Form-Xb-u04dn.mjs} +2 -2
  20. package/dist/_chunks/{Form-DJOJ-GF1.mjs.map → Form-Xb-u04dn.mjs.map} +1 -1
  21. package/dist/_chunks/{History-MnQLtk1g.mjs → History-DLl10NEN.mjs} +22 -92
  22. package/dist/_chunks/History-DLl10NEN.mjs.map +1 -0
  23. package/dist/_chunks/{History-B-Mrquzu.js → History-sJ61vusJ.js} +21 -91
  24. package/dist/_chunks/History-sJ61vusJ.js.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-C0n4rUzH.js → ListConfigurationPage-C00guBjQ.js} +4 -3
  26. package/dist/_chunks/ListConfigurationPage-C00guBjQ.js.map +1 -0
  27. package/dist/_chunks/{ListConfigurationPage-BcycI8Lw.mjs → ListConfigurationPage-mbZQmEZ3.mjs} +5 -4
  28. package/dist/_chunks/ListConfigurationPage-mbZQmEZ3.mjs.map +1 -0
  29. package/dist/_chunks/{ListViewPage-q0SHVPUS.js → ListViewPage-DDVpN1ql.js} +28 -6
  30. package/dist/_chunks/ListViewPage-DDVpN1ql.js.map +1 -0
  31. package/dist/_chunks/{ListViewPage-CRXONXwZ.mjs → ListViewPage-iRJ5AUjS.mjs} +28 -6
  32. package/dist/_chunks/{ListViewPage-CRXONXwZ.mjs.map → ListViewPage-iRJ5AUjS.mjs.map} +1 -1
  33. package/dist/_chunks/{NoContentTypePage-Bh3komDV.js → NoContentTypePage-BvkII4H4.js} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-Bh3komDV.js.map → NoContentTypePage-BvkII4H4.js.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-ukzFRF3z.mjs → NoContentTypePage-DI8VWkVK.mjs} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-ukzFRF3z.mjs.map → NoContentTypePage-DI8VWkVK.mjs.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-BGBpj_Y1.js → NoPermissionsPage-BZjHQTpb.js} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-BGBpj_Y1.js.map → NoPermissionsPage-BZjHQTpb.js.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-B4sD7Ble.mjs → NoPermissionsPage-DckHN3oZ.mjs} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-B4sD7Ble.mjs.map → NoPermissionsPage-DckHN3oZ.mjs.map} +1 -1
  41. package/dist/_chunks/Preview-BDOUHeaW.mjs +267 -0
  42. package/dist/_chunks/Preview-BDOUHeaW.mjs.map +1 -0
  43. package/dist/_chunks/Preview-CS2aV-BU.js +286 -0
  44. package/dist/_chunks/Preview-CS2aV-BU.js.map +1 -0
  45. package/dist/_chunks/{Relations-B53wYe8g.js → Relations-DEIQO39t.js} +43 -16
  46. package/dist/_chunks/Relations-DEIQO39t.js.map +1 -0
  47. package/dist/_chunks/{Relations-CIexb8gr.mjs → Relations-J-8HC3zX.mjs} +44 -17
  48. package/dist/_chunks/Relations-J-8HC3zX.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-CJ2vYwuT.mjs → index-DzTs9ga-.mjs} +180 -81
  62. package/dist/_chunks/index-DzTs9ga-.mjs.map +1 -0
  63. package/dist/_chunks/{index-DbT2sx-Q.js → index-uXHSvmlw.js} +177 -77
  64. package/dist/_chunks/index-uXHSvmlw.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-vzKSrr7p.mjs → layout-BhIZkPuB.mjs} +3 -3
  70. package/dist/_chunks/{layout-vzKSrr7p.mjs.map → layout-BhIZkPuB.mjs.map} +1 -1
  71. package/dist/_chunks/{layout-CeBSIkmP.js → layout-zA_F2rU4.js} +3 -3
  72. package/dist/_chunks/{layout-CeBSIkmP.js.map → layout-zA_F2rU4.js.map} +1 -1
  73. package/dist/_chunks/{relations-DI0lguF0.mjs → relations-BoCufH_z.mjs} +6 -7
  74. package/dist/_chunks/relations-BoCufH_z.mjs.map +1 -0
  75. package/dist/_chunks/{relations-Cl-6t9iz.js → relations-DnUyZQaL.js} +6 -7
  76. package/dist/_chunks/relations-DnUyZQaL.js.map +1 -0
  77. package/dist/admin/index.js +1 -1
  78. package/dist/admin/index.mjs +4 -4
  79. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  80. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  81. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  82. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  83. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  84. package/dist/admin/src/preview/constants.d.ts +1 -0
  85. package/dist/admin/src/preview/index.d.ts +4 -0
  86. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  87. package/dist/admin/src/preview/routes.d.ts +3 -0
  88. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  89. package/dist/admin/src/router.d.ts +1 -1
  90. package/dist/server/index.js +344 -144
  91. package/dist/server/index.js.map +1 -1
  92. package/dist/server/index.mjs +344 -144
  93. package/dist/server/index.mjs.map +1 -1
  94. package/dist/server/src/bootstrap.d.ts.map +1 -1
  95. package/dist/server/src/controllers/index.d.ts.map +1 -1
  96. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  97. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  98. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  99. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  100. package/dist/server/src/history/services/utils.d.ts +2 -3
  101. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  102. package/dist/server/src/index.d.ts +4 -4
  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 +15 -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 +30 -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 +18 -0
  124. package/dist/server/src/preview/utils.d.ts.map +1 -0
  125. package/dist/server/src/routes/index.d.ts.map +1 -1
  126. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  127. package/dist/server/src/services/document-metadata.d.ts +8 -8
  128. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  129. package/dist/server/src/services/index.d.ts +4 -4
  130. package/dist/server/src/services/index.d.ts.map +1 -1
  131. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  132. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  133. package/dist/server/src/utils/index.d.ts +2 -0
  134. package/dist/server/src/utils/index.d.ts.map +1 -1
  135. package/dist/shared/contracts/index.d.ts +1 -0
  136. package/dist/shared/contracts/index.d.ts.map +1 -1
  137. package/dist/shared/contracts/preview.d.ts +27 -0
  138. package/dist/shared/contracts/preview.d.ts.map +1 -0
  139. package/dist/shared/index.js +4 -0
  140. package/dist/shared/index.js.map +1 -1
  141. package/dist/shared/index.mjs +4 -0
  142. package/dist/shared/index.mjs.map +1 -1
  143. package/package.json +10 -10
  144. package/dist/_chunks/EditViewPage-8mOu02ji.mjs.map +0 -1
  145. package/dist/_chunks/EditViewPage-BMVgUNOX.js.map +0 -1
  146. package/dist/_chunks/Field-CJPYzwD7.mjs.map +0 -1
  147. package/dist/_chunks/Field-CdSLKFQk.js.map +0 -1
  148. package/dist/_chunks/History-B-Mrquzu.js.map +0 -1
  149. package/dist/_chunks/History-MnQLtk1g.mjs.map +0 -1
  150. package/dist/_chunks/ListConfigurationPage-BcycI8Lw.mjs.map +0 -1
  151. package/dist/_chunks/ListConfigurationPage-C0n4rUzH.js.map +0 -1
  152. package/dist/_chunks/ListViewPage-q0SHVPUS.js.map +0 -1
  153. package/dist/_chunks/Relations-B53wYe8g.js.map +0 -1
  154. package/dist/_chunks/Relations-CIexb8gr.mjs.map +0 -1
  155. package/dist/_chunks/index-CJ2vYwuT.mjs.map +0 -1
  156. package/dist/_chunks/index-DbT2sx-Q.js.map +0 -1
  157. package/dist/_chunks/relations-Cl-6t9iz.js.map +0 -1
  158. package/dist/_chunks/relations-DI0lguF0.mjs.map +0 -1
@@ -3,14 +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
+ import mapValues from "lodash/fp/mapValues";
7
8
  import { useIntl } from "react-intl";
8
9
  import { useParams, useNavigate, Navigate, useMatch, useLocation, Link, NavLink } from "react-router-dom";
10
+ import { styled } from "styled-components";
9
11
  import * as yup from "yup";
10
12
  import { ValidationError } from "yup";
11
13
  import pipe from "lodash/fp/pipe";
12
14
  import { intervalToDuration, isPast } from "date-fns";
13
- import { styled } from "styled-components";
14
15
  import { stringify } from "qs";
15
16
  import { createSlice, combineReducers } from "@reduxjs/toolkit";
16
17
  const __variableDynamicImportRuntimeHelper = (glob, path) => {
@@ -968,9 +969,10 @@ const formatEditLayout = (data, {
968
969
  currentPanelIndex += 2;
969
970
  } else {
970
971
  if (!panels[currentPanelIndex]) {
971
- panels.push([]);
972
+ panels.push([row]);
973
+ } else {
974
+ panels[currentPanelIndex].push(row);
972
975
  }
973
- panels[currentPanelIndex].push(row);
974
976
  }
975
977
  return panels;
976
978
  }, []);
@@ -1661,10 +1663,10 @@ const useDocumentActions = () => {
1661
1663
  update
1662
1664
  };
1663
1665
  };
1664
- const ProtectedHistoryPage = lazy(
1665
- () => import("./History-MnQLtk1g.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1666
+ const ProtectedHistoryPage = React.lazy(
1667
+ () => import("./History-DLl10NEN.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1666
1668
  );
1667
- const routes$1 = [
1669
+ const routes$2 = [
1668
1670
  {
1669
1671
  path: ":collectionType/:slug/:id/history",
1670
1672
  Component: ProtectedHistoryPage
@@ -1674,32 +1676,45 @@ const routes$1 = [
1674
1676
  Component: ProtectedHistoryPage
1675
1677
  }
1676
1678
  ];
1679
+ const ProtectedPreviewPage = React.lazy(
1680
+ () => import("./Preview-BDOUHeaW.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
+ ];
1677
1692
  const ProtectedEditViewPage = lazy(
1678
- () => import("./EditViewPage-8mOu02ji.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1693
+ () => import("./EditViewPage-BgeC8L9X.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1679
1694
  );
1680
1695
  const ProtectedListViewPage = lazy(
1681
- () => import("./ListViewPage-CRXONXwZ.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1696
+ () => import("./ListViewPage-iRJ5AUjS.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1682
1697
  );
1683
1698
  const ProtectedListConfiguration = lazy(
1684
- () => import("./ListConfigurationPage-BcycI8Lw.mjs").then((mod) => ({
1699
+ () => import("./ListConfigurationPage-mbZQmEZ3.mjs").then((mod) => ({
1685
1700
  default: mod.ProtectedListConfiguration
1686
1701
  }))
1687
1702
  );
1688
1703
  const ProtectedEditConfigurationPage = lazy(
1689
- () => import("./EditConfigurationPage-tVCJ5vWC.mjs").then((mod) => ({
1704
+ () => import("./EditConfigurationPage-ByaNUj_q.mjs").then((mod) => ({
1690
1705
  default: mod.ProtectedEditConfigurationPage
1691
1706
  }))
1692
1707
  );
1693
1708
  const ProtectedComponentConfigurationPage = lazy(
1694
- () => import("./ComponentConfigurationPage-CQroR9Qk.mjs").then((mod) => ({
1709
+ () => import("./ComponentConfigurationPage-EIYRzIr6.mjs").then((mod) => ({
1695
1710
  default: mod.ProtectedComponentConfigurationPage
1696
1711
  }))
1697
1712
  );
1698
1713
  const NoPermissions = lazy(
1699
- () => import("./NoPermissionsPage-B4sD7Ble.mjs").then((mod) => ({ default: mod.NoPermissions }))
1714
+ () => import("./NoPermissionsPage-DckHN3oZ.mjs").then((mod) => ({ default: mod.NoPermissions }))
1700
1715
  );
1701
1716
  const NoContentType = lazy(
1702
- () => import("./NoContentTypePage-ukzFRF3z.mjs").then((mod) => ({ default: mod.NoContentType }))
1717
+ () => import("./NoContentTypePage-DI8VWkVK.mjs").then((mod) => ({ default: mod.NoContentType }))
1703
1718
  );
1704
1719
  const CollectionTypePages = () => {
1705
1720
  const { collectionType } = useParams();
@@ -1711,7 +1726,7 @@ const CollectionTypePages = () => {
1711
1726
  const CLONE_RELATIVE_PATH = ":collectionType/:slug/clone/:origin";
1712
1727
  const CLONE_PATH = `/content-manager/${CLONE_RELATIVE_PATH}`;
1713
1728
  const LIST_RELATIVE_PATH = ":collectionType/:slug";
1714
- const LIST_PATH = `/content-manager/${LIST_RELATIVE_PATH}`;
1729
+ const LIST_PATH = `/content-manager/collection-types/:slug`;
1715
1730
  const routes = [
1716
1731
  {
1717
1732
  path: LIST_RELATIVE_PATH,
@@ -1745,6 +1760,7 @@ const routes = [
1745
1760
  path: "no-content-types",
1746
1761
  Component: NoContentType
1747
1762
  },
1763
+ ...routes$2,
1748
1764
  ...routes$1
1749
1765
  ];
1750
1766
  const DocumentActions = ({ actions: actions2 }) => {
@@ -1843,6 +1859,11 @@ const DocumentActionButton = (action) => {
1843
1859
  ) : null
1844
1860
  ] });
1845
1861
  };
1862
+ const MenuItem = styled(Menu.Item)`
1863
+ &:hover {
1864
+ background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
1865
+ }
1866
+ `;
1846
1867
  const DocumentActionsMenu = ({
1847
1868
  actions: actions2,
1848
1869
  children,
@@ -1901,48 +1922,32 @@ const DocumentActionsMenu = ({
1901
1922
  /* @__PURE__ */ jsxs(Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
1902
1923
  actions2.map((action) => {
1903
1924
  return /* @__PURE__ */ jsx(
1904
- Menu.Item,
1925
+ MenuItem,
1905
1926
  {
1906
1927
  disabled: action.disabled,
1907
1928
  onSelect: handleClick(action),
1908
1929
  display: "block",
1909
- children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 4, children: [
1910
- /* @__PURE__ */ jsxs(
1911
- Flex,
1912
- {
1913
- color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1914
- gap: 2,
1915
- tag: "span",
1916
- children: [
1917
- /* @__PURE__ */ jsx(
1918
- Flex,
1919
- {
1920
- tag: "span",
1921
- color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1922
- children: action.icon
1923
- }
1924
- ),
1925
- action.label
1926
- ]
1927
- }
1928
- ),
1929
- action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsx(
1930
- Flex,
1931
- {
1932
- alignItems: "center",
1933
- background: "alternative100",
1934
- borderStyle: "solid",
1935
- borderColor: "alternative200",
1936
- borderWidth: "1px",
1937
- height: 5,
1938
- paddingLeft: 2,
1939
- paddingRight: 2,
1940
- hasRadius: true,
1941
- color: "alternative600",
1942
- children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", lineHeight: 1, children: formatMessage({ id: "global.new", defaultMessage: "New" }) })
1943
- }
1944
- )
1945
- ] })
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
+ ) })
1946
1951
  },
1947
1952
  action.id
1948
1953
  );
@@ -2053,6 +2058,18 @@ const DocumentActionModal = ({
2053
2058
  typeof Footer === "function" ? /* @__PURE__ */ jsx(Footer, { onClose: handleClose }) : Footer
2054
2059
  ] }) });
2055
2060
  };
2061
+ const transformData = (data) => {
2062
+ if (Array.isArray(data)) {
2063
+ return data.map(transformData);
2064
+ }
2065
+ if (typeof data === "object" && data !== null) {
2066
+ if ("apiData" in data) {
2067
+ return data.apiData;
2068
+ }
2069
+ return mapValues(transformData)(data);
2070
+ }
2071
+ return data;
2072
+ };
2056
2073
  const PublishAction$1 = ({
2057
2074
  activeTab,
2058
2075
  documentId,
@@ -2166,7 +2183,7 @@ const PublishAction$1 = ({
2166
2183
  documentId,
2167
2184
  params
2168
2185
  },
2169
- formValues
2186
+ transformData(formValues)
2170
2187
  );
2171
2188
  if ("data" in res && collectionType !== SINGLE_TYPES) {
2172
2189
  navigate({
@@ -2282,7 +2299,7 @@ const UpdateAction = ({
2282
2299
  documentId: cloneMatch.params.origin,
2283
2300
  params
2284
2301
  },
2285
- document
2302
+ transformData(document)
2286
2303
  );
2287
2304
  if ("data" in res) {
2288
2305
  navigate(
@@ -2303,7 +2320,7 @@ const UpdateAction = ({
2303
2320
  documentId,
2304
2321
  params
2305
2322
  },
2306
- document
2323
+ transformData(document)
2307
2324
  );
2308
2325
  if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2309
2326
  setErrors(formatValidationErrors(res.error));
@@ -2316,7 +2333,7 @@ const UpdateAction = ({
2316
2333
  model,
2317
2334
  params
2318
2335
  },
2319
- document
2336
+ transformData(document)
2320
2337
  );
2321
2338
  if ("data" in res && collectionType !== SINGLE_TYPES) {
2322
2339
  navigate(
@@ -2521,7 +2538,7 @@ const RelativeTime = React.forwardRef(
2521
2538
  });
2522
2539
  const unit = intervals.find((intervalUnit) => {
2523
2540
  return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
2524
- });
2541
+ }) ?? "seconds";
2525
2542
  const relativeTime = isPast(timestamp) ? -interval[unit] : interval[unit];
2526
2543
  const customInterval = customIntervals.find(
2527
2544
  (custom) => interval[custom.unit] < custom.threshold
@@ -2555,19 +2572,29 @@ const getDisplayName = ({
2555
2572
  return email ?? "";
2556
2573
  };
2557
2574
  const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
2558
- const DocumentStatus = ({ status = "draft", ...restProps }) => {
2575
+ const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
2559
2576
  const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
2560
- 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
+ }) }) });
2561
2582
  };
2562
2583
  const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
2563
2584
  const { formatMessage } = useIntl();
2564
2585
  const isCloning = useMatch(CLONE_PATH) !== null;
2586
+ const params = useParams();
2565
2587
  const title = isCreating ? formatMessage({
2566
2588
  id: "content-manager.containers.edit.title.new",
2567
2589
  defaultMessage: "Create an entry"
2568
2590
  }) : documentTitle;
2569
2591
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
2570
- /* @__PURE__ */ jsx(BackButton, {}),
2592
+ /* @__PURE__ */ jsx(
2593
+ BackButton,
2594
+ {
2595
+ fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
2596
+ }
2597
+ ),
2571
2598
  /* @__PURE__ */ jsxs(Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
2572
2599
  /* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
2573
2600
  /* @__PURE__ */ jsx(HeaderToolbar, {})
@@ -3004,7 +3031,7 @@ const Panel = React.forwardRef(({ children, title }, ref) => {
3004
3031
  justifyContent: "stretch",
3005
3032
  alignItems: "flex-start",
3006
3033
  children: [
3007
- /* @__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 }),
3008
3035
  children
3009
3036
  ]
3010
3037
  }
@@ -3254,18 +3281,10 @@ const SelectedEntriesTableContent = ({
3254
3281
  search: row.locale && `?plugins[i18n][locale]=${row.locale}`
3255
3282
  },
3256
3283
  state: { from: pathname },
3257
- label: formatMessage(
3258
- { id: "app.component.HelperPluginTable.edit", defaultMessage: "Edit {target}" },
3259
- {
3260
- target: formatMessage(
3261
- {
3262
- id: "content-manager.components.ListViewHelperPluginTable.row-line",
3263
- defaultMessage: "item line {number}"
3264
- },
3265
- { number: index2 + 1 }
3266
- )
3267
- }
3268
- ),
3284
+ label: formatMessage({
3285
+ id: "content-manager.bulk-publish.edit",
3286
+ defaultMessage: "Edit"
3287
+ }),
3269
3288
  target: "_blank",
3270
3289
  marginLeft: "auto",
3271
3290
  variant: "ghost",
@@ -3909,17 +3928,27 @@ const HistoryAction = ({ model, document }) => {
3909
3928
  const { formatMessage } = useIntl();
3910
3929
  const [{ query }] = useQueryParams();
3911
3930
  const navigate = useNavigate();
3931
+ const { trackUsage } = useTracking();
3932
+ const { pathname } = useLocation();
3912
3933
  const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
3913
3934
  if (!window.strapi.features.isEnabled("cms-content-history")) {
3914
3935
  return null;
3915
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
+ };
3916
3945
  return {
3917
3946
  icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
3918
3947
  label: formatMessage({
3919
3948
  id: "content-manager.history.document-action",
3920
3949
  defaultMessage: "Content History"
3921
3950
  }),
3922
- onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
3951
+ onClick: handleOnClick,
3923
3952
  disabled: (
3924
3953
  /**
3925
3954
  * The user is creating a new document.
@@ -3987,6 +4016,72 @@ const { setInitialData } = actions;
3987
4016
  const reducer = combineReducers({
3988
4017
  app: reducer$1
3989
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
+ };
3990
4085
  const index = {
3991
4086
  register(app) {
3992
4087
  const cm = new ContentManagerPlugin();
@@ -4006,7 +4101,7 @@ const index = {
4006
4101
  app.router.addRoute({
4007
4102
  path: "content-manager/*",
4008
4103
  lazy: async () => {
4009
- const { Layout } = await import("./layout-vzKSrr7p.mjs");
4104
+ const { Layout } = await import("./layout-BhIZkPuB.mjs");
4010
4105
  return {
4011
4106
  Component: Layout
4012
4107
  };
@@ -4019,11 +4114,14 @@ const index = {
4019
4114
  if (typeof historyAdmin.bootstrap === "function") {
4020
4115
  historyAdmin.bootstrap(app);
4021
4116
  }
4117
+ if (typeof previewAdmin.bootstrap === "function") {
4118
+ previewAdmin.bootstrap(app);
4119
+ }
4022
4120
  },
4023
4121
  async registerTrads({ locales }) {
4024
4122
  const importedTrads = await Promise.all(
4025
4123
  locales.map((locale) => {
4026
- 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 }) => {
4027
4125
  return {
4028
4126
  data: prefixPluginTranslations(data, PLUGIN_ID),
4029
4127
  locale
@@ -4050,9 +4148,10 @@ export {
4050
4148
  HOOKS as H,
4051
4149
  InjectionZone as I,
4052
4150
  useDocument as J,
4053
- index as K,
4054
- useContentManagerContext as L,
4055
- useDocumentActions as M,
4151
+ useGetPreviewUrlQuery as K,
4152
+ index as L,
4153
+ useContentManagerContext as M,
4154
+ useDocumentActions as N,
4056
4155
  Panels as P,
4057
4156
  RelativeTime as R,
4058
4157
  SINGLE_TYPES as S,
@@ -4084,4 +4183,4 @@ export {
4084
4183
  capitalise as y,
4085
4184
  useUpdateContentTypeConfigurationMutation as z
4086
4185
  };
4087
- //# sourceMappingURL=index-CJ2vYwuT.mjs.map
4186
+ //# sourceMappingURL=index-DzTs9ga-.mjs.map