@strapi/content-manager 0.0.0-experimental.fed75ee8e64c57dbed0b670b25ef026b69baab10 → 0.0.0-next.185e16fdc3e6f1895610ab73932bc3f044bb59e9

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 (164) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-DNRPa10q.js → ComponentConfigurationPage-BH5297nw.js} +4 -4
  2. package/dist/_chunks/{ComponentConfigurationPage-DNRPa10q.js.map → ComponentConfigurationPage-BH5297nw.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-BVM7LScS.mjs → ComponentConfigurationPage-CBRYXx1V.mjs} +4 -4
  4. package/dist/_chunks/{ComponentConfigurationPage-BVM7LScS.mjs.map → ComponentConfigurationPage-CBRYXx1V.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-BrG0mEfF.js → EditConfigurationPage-CKkb0EW6.js} +4 -4
  6. package/dist/_chunks/{EditConfigurationPage-BrG0mEfF.js.map → EditConfigurationPage-CKkb0EW6.js.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-BWq-9Zhk.mjs → EditConfigurationPage-DCFTHMFy.mjs} +4 -4
  8. package/dist/_chunks/{EditConfigurationPage-BWq-9Zhk.mjs.map → EditConfigurationPage-DCFTHMFy.mjs.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-Dx0QnTxn.mjs → EditViewPage-B7qtO55B.mjs} +38 -8
  10. package/dist/_chunks/EditViewPage-B7qtO55B.mjs.map +1 -0
  11. package/dist/_chunks/{EditViewPage-BbY0bNNE.js → EditViewPage-CtYyxyPW.js} +37 -7
  12. package/dist/_chunks/EditViewPage-CtYyxyPW.js.map +1 -0
  13. package/dist/_chunks/{Field-DVZSGAon.mjs → Field-BMv9ud3N.mjs} +44 -25
  14. package/dist/_chunks/Field-BMv9ud3N.mjs.map +1 -0
  15. package/dist/_chunks/{Field-CglKum3X.js → Field-oqDBIPId.js} +43 -24
  16. package/dist/_chunks/Field-oqDBIPId.js.map +1 -0
  17. package/dist/_chunks/{Form-B7nYNIUm.js → Form-BtsYj5GQ.js} +2 -2
  18. package/dist/_chunks/{Form-B7nYNIUm.js.map → Form-BtsYj5GQ.js.map} +1 -1
  19. package/dist/_chunks/{Form-BQwxPqu3.mjs → Form-Drwa2T5R.mjs} +2 -2
  20. package/dist/_chunks/{Form-BQwxPqu3.mjs.map → Form-Drwa2T5R.mjs.map} +1 -1
  21. package/dist/_chunks/{History-3JN4BIS1.js → History-CxGvvWhH.js} +22 -92
  22. package/dist/_chunks/History-CxGvvWhH.js.map +1 -0
  23. package/dist/_chunks/{History-Bmu6tx6s.mjs → History-dUA1IWvK.mjs} +23 -93
  24. package/dist/_chunks/History-dUA1IWvK.mjs.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-DwijcJ17.mjs → ListConfigurationPage-C-dzvcr-.mjs} +6 -5
  26. package/dist/_chunks/ListConfigurationPage-C-dzvcr-.mjs.map +1 -0
  27. package/dist/_chunks/{ListConfigurationPage-BcC28SV0.js → ListConfigurationPage-fJRHoZ-W.js} +5 -4
  28. package/dist/_chunks/ListConfigurationPage-fJRHoZ-W.js.map +1 -0
  29. package/dist/_chunks/{ListViewPage-ZPNQ6jWC.js → ListViewPage-BjPkVAd6.js} +74 -40
  30. package/dist/_chunks/ListViewPage-BjPkVAd6.js.map +1 -0
  31. package/dist/_chunks/{ListViewPage-DzhuS3CW.mjs → ListViewPage-Dq1Q0T3K.mjs} +74 -40
  32. package/dist/_chunks/ListViewPage-Dq1Q0T3K.mjs.map +1 -0
  33. package/dist/_chunks/{NoContentTypePage-BKMgOyd3.mjs → NoContentTypePage-B2qw4pa9.mjs} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-BKMgOyd3.mjs.map → NoContentTypePage-B2qw4pa9.mjs.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-DzwJNXvn.js → NoContentTypePage-DoosCI8K.js} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-DzwJNXvn.js.map → NoContentTypePage-DoosCI8K.js.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-DBbGJqL9.mjs → NoPermissionsPage-BthC4KSZ.mjs} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-DBbGJqL9.mjs.map → NoPermissionsPage-BthC4KSZ.mjs.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-GaweP-NG.js → NoPermissionsPage-Eb2ZWoy6.js} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-GaweP-NG.js.map → NoPermissionsPage-Eb2ZWoy6.js.map} +1 -1
  41. package/dist/_chunks/Preview-DAZ8xXys.js +291 -0
  42. package/dist/_chunks/Preview-DAZ8xXys.js.map +1 -0
  43. package/dist/_chunks/Preview-kpxJkIOq.mjs +272 -0
  44. package/dist/_chunks/Preview-kpxJkIOq.mjs.map +1 -0
  45. package/dist/_chunks/{Relations-BHXq_cKF.js → Relations-30DATMsp.js} +43 -17
  46. package/dist/_chunks/Relations-30DATMsp.js.map +1 -0
  47. package/dist/_chunks/{Relations-B7VtRA3g.mjs → Relations-BVKe5d6m.mjs} +44 -18
  48. package/dist/_chunks/Relations-BVKe5d6m.mjs.map +1 -0
  49. package/dist/_chunks/{en-DKV44jRb.mjs → en-DhFUjrNW.mjs} +15 -4
  50. package/dist/_chunks/{en-DKV44jRb.mjs.map → en-DhFUjrNW.mjs.map} +1 -1
  51. package/dist/_chunks/{en-Bm0D0IWz.js → en-Ic0kXjxB.js} +15 -4
  52. package/dist/_chunks/{en-Bm0D0IWz.js.map → en-Ic0kXjxB.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-TaRzG09p.mjs → index-C-rEZYIo.mjs} +188 -119
  62. package/dist/_chunks/index-C-rEZYIo.mjs.map +1 -0
  63. package/dist/_chunks/{index-DcA8_tJw.js → index-CliQLPIn.js} +185 -115
  64. package/dist/_chunks/index-CliQLPIn.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-CrgXpOxT.js → layout-Ap9UjC0q.js} +3 -3
  70. package/dist/_chunks/{layout-CrgXpOxT.js.map → layout-Ap9UjC0q.js.map} +1 -1
  71. package/dist/_chunks/{layout-aX-RJhd5.mjs → layout-Cc0Kovb9.mjs} +3 -3
  72. package/dist/_chunks/{layout-aX-RJhd5.mjs.map → layout-Cc0Kovb9.mjs.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-D3Hlx6QX.mjs → relations-CMPpsYC4.mjs} +6 -7
  78. package/dist/_chunks/relations-CMPpsYC4.mjs.map +1 -0
  79. package/dist/_chunks/{relations-Z6RA1sBS.js → relations-Quzh1sDm.js} +6 -7
  80. package/dist/_chunks/relations-Quzh1sDm.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 +391 -144
  95. package/dist/server/index.js.map +1 -1
  96. package/dist/server/index.mjs +392 -145
  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/controllers/relations.d.ts.map +1 -1
  101. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  102. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  103. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  104. package/dist/server/src/history/services/utils.d.ts +2 -3
  105. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  106. package/dist/server/src/index.d.ts +4 -4
  107. package/dist/server/src/preview/constants.d.ts +2 -0
  108. package/dist/server/src/preview/constants.d.ts.map +1 -0
  109. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  110. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  111. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  112. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  113. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  114. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  115. package/dist/server/src/preview/index.d.ts +4 -0
  116. package/dist/server/src/preview/index.d.ts.map +1 -0
  117. package/dist/server/src/preview/routes/index.d.ts +8 -0
  118. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  119. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  120. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  121. package/dist/server/src/preview/services/index.d.ts +16 -0
  122. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  123. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  124. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  125. package/dist/server/src/preview/services/preview.d.ts +12 -0
  126. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  127. package/dist/server/src/preview/utils.d.ts +19 -0
  128. package/dist/server/src/preview/utils.d.ts.map +1 -0
  129. package/dist/server/src/register.d.ts.map +1 -1
  130. package/dist/server/src/routes/index.d.ts.map +1 -1
  131. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  132. package/dist/server/src/services/document-metadata.d.ts +8 -8
  133. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  134. package/dist/server/src/services/index.d.ts +4 -4
  135. package/dist/server/src/services/index.d.ts.map +1 -1
  136. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  137. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  138. package/dist/server/src/utils/index.d.ts +2 -0
  139. package/dist/server/src/utils/index.d.ts.map +1 -1
  140. package/dist/shared/contracts/index.d.ts +1 -0
  141. package/dist/shared/contracts/index.d.ts.map +1 -1
  142. package/dist/shared/contracts/preview.d.ts +27 -0
  143. package/dist/shared/contracts/preview.d.ts.map +1 -0
  144. package/dist/shared/index.js +4 -0
  145. package/dist/shared/index.js.map +1 -1
  146. package/dist/shared/index.mjs +4 -0
  147. package/dist/shared/index.mjs.map +1 -1
  148. package/package.json +10 -10
  149. package/dist/_chunks/EditViewPage-BbY0bNNE.js.map +0 -1
  150. package/dist/_chunks/EditViewPage-Dx0QnTxn.mjs.map +0 -1
  151. package/dist/_chunks/Field-CglKum3X.js.map +0 -1
  152. package/dist/_chunks/Field-DVZSGAon.mjs.map +0 -1
  153. package/dist/_chunks/History-3JN4BIS1.js.map +0 -1
  154. package/dist/_chunks/History-Bmu6tx6s.mjs.map +0 -1
  155. package/dist/_chunks/ListConfigurationPage-BcC28SV0.js.map +0 -1
  156. package/dist/_chunks/ListConfigurationPage-DwijcJ17.mjs.map +0 -1
  157. package/dist/_chunks/ListViewPage-DzhuS3CW.mjs.map +0 -1
  158. package/dist/_chunks/ListViewPage-ZPNQ6jWC.js.map +0 -1
  159. package/dist/_chunks/Relations-B7VtRA3g.mjs.map +0 -1
  160. package/dist/_chunks/Relations-BHXq_cKF.js.map +0 -1
  161. package/dist/_chunks/index-DcA8_tJw.js.map +0 -1
  162. package/dist/_chunks/index-TaRzG09p.mjs.map +0 -1
  163. package/dist/_chunks/relations-D3Hlx6QX.mjs.map +0 -1
  164. package/dist/_chunks/relations-Z6RA1sBS.js.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
  }, []);
@@ -1228,9 +1230,6 @@ const useContentManagerContext = () => {
1228
1230
  };
1229
1231
  };
1230
1232
  const prefixPluginTranslations = (trad, pluginId) => {
1231
- if (!pluginId) {
1232
- throw new TypeError("pluginId can't be empty");
1233
- }
1234
1233
  return Object.keys(trad).reduce((acc, current) => {
1235
1234
  acc[`${pluginId}.${current}`] = trad[current];
1236
1235
  return acc;
@@ -1664,10 +1663,10 @@ const useDocumentActions = () => {
1664
1663
  update
1665
1664
  };
1666
1665
  };
1667
- const ProtectedHistoryPage = lazy(
1668
- () => import("./History-Bmu6tx6s.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1666
+ const ProtectedHistoryPage = React.lazy(
1667
+ () => import("./History-dUA1IWvK.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1669
1668
  );
1670
- const routes$1 = [
1669
+ const routes$2 = [
1671
1670
  {
1672
1671
  path: ":collectionType/:slug/:id/history",
1673
1672
  Component: ProtectedHistoryPage
@@ -1677,32 +1676,45 @@ const routes$1 = [
1677
1676
  Component: ProtectedHistoryPage
1678
1677
  }
1679
1678
  ];
1679
+ const ProtectedPreviewPage = React.lazy(
1680
+ () => import("./Preview-kpxJkIOq.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
+ ];
1680
1692
  const ProtectedEditViewPage = lazy(
1681
- () => import("./EditViewPage-Dx0QnTxn.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1693
+ () => import("./EditViewPage-B7qtO55B.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1682
1694
  );
1683
1695
  const ProtectedListViewPage = lazy(
1684
- () => import("./ListViewPage-DzhuS3CW.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1696
+ () => import("./ListViewPage-Dq1Q0T3K.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1685
1697
  );
1686
1698
  const ProtectedListConfiguration = lazy(
1687
- () => import("./ListConfigurationPage-DwijcJ17.mjs").then((mod) => ({
1699
+ () => import("./ListConfigurationPage-C-dzvcr-.mjs").then((mod) => ({
1688
1700
  default: mod.ProtectedListConfiguration
1689
1701
  }))
1690
1702
  );
1691
1703
  const ProtectedEditConfigurationPage = lazy(
1692
- () => import("./EditConfigurationPage-BWq-9Zhk.mjs").then((mod) => ({
1704
+ () => import("./EditConfigurationPage-DCFTHMFy.mjs").then((mod) => ({
1693
1705
  default: mod.ProtectedEditConfigurationPage
1694
1706
  }))
1695
1707
  );
1696
1708
  const ProtectedComponentConfigurationPage = lazy(
1697
- () => import("./ComponentConfigurationPage-BVM7LScS.mjs").then((mod) => ({
1709
+ () => import("./ComponentConfigurationPage-CBRYXx1V.mjs").then((mod) => ({
1698
1710
  default: mod.ProtectedComponentConfigurationPage
1699
1711
  }))
1700
1712
  );
1701
1713
  const NoPermissions = lazy(
1702
- () => import("./NoPermissionsPage-DBbGJqL9.mjs").then((mod) => ({ default: mod.NoPermissions }))
1714
+ () => import("./NoPermissionsPage-BthC4KSZ.mjs").then((mod) => ({ default: mod.NoPermissions }))
1703
1715
  );
1704
1716
  const NoContentType = lazy(
1705
- () => import("./NoContentTypePage-BKMgOyd3.mjs").then((mod) => ({ default: mod.NoContentType }))
1717
+ () => import("./NoContentTypePage-B2qw4pa9.mjs").then((mod) => ({ default: mod.NoContentType }))
1706
1718
  );
1707
1719
  const CollectionTypePages = () => {
1708
1720
  const { collectionType } = useParams();
@@ -1714,7 +1726,7 @@ const CollectionTypePages = () => {
1714
1726
  const CLONE_RELATIVE_PATH = ":collectionType/:slug/clone/:origin";
1715
1727
  const CLONE_PATH = `/content-manager/${CLONE_RELATIVE_PATH}`;
1716
1728
  const LIST_RELATIVE_PATH = ":collectionType/:slug";
1717
- const LIST_PATH = `/content-manager/${LIST_RELATIVE_PATH}`;
1729
+ const LIST_PATH = `/content-manager/collection-types/:slug`;
1718
1730
  const routes = [
1719
1731
  {
1720
1732
  path: LIST_RELATIVE_PATH,
@@ -1748,6 +1760,7 @@ const routes = [
1748
1760
  path: "no-content-types",
1749
1761
  Component: NoContentType
1750
1762
  },
1763
+ ...routes$2,
1751
1764
  ...routes$1
1752
1765
  ];
1753
1766
  const DocumentActions = ({ actions: actions2 }) => {
@@ -1846,6 +1859,11 @@ const DocumentActionButton = (action) => {
1846
1859
  ) : null
1847
1860
  ] });
1848
1861
  };
1862
+ const MenuItem = styled(Menu.Item)`
1863
+ &:hover {
1864
+ background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
1865
+ }
1866
+ `;
1849
1867
  const DocumentActionsMenu = ({
1850
1868
  actions: actions2,
1851
1869
  children,
@@ -1904,48 +1922,32 @@ const DocumentActionsMenu = ({
1904
1922
  /* @__PURE__ */ jsxs(Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
1905
1923
  actions2.map((action) => {
1906
1924
  return /* @__PURE__ */ jsx(
1907
- Menu.Item,
1925
+ MenuItem,
1908
1926
  {
1909
1927
  disabled: action.disabled,
1910
1928
  onSelect: handleClick(action),
1911
1929
  display: "block",
1912
- children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 4, children: [
1913
- /* @__PURE__ */ jsxs(
1914
- Flex,
1915
- {
1916
- color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1917
- gap: 2,
1918
- tag: "span",
1919
- children: [
1920
- /* @__PURE__ */ jsx(
1921
- Flex,
1922
- {
1923
- tag: "span",
1924
- color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1925
- children: action.icon
1926
- }
1927
- ),
1928
- action.label
1929
- ]
1930
- }
1931
- ),
1932
- action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsx(
1933
- Flex,
1934
- {
1935
- alignItems: "center",
1936
- background: "alternative100",
1937
- borderStyle: "solid",
1938
- borderColor: "alternative200",
1939
- borderWidth: "1px",
1940
- height: 5,
1941
- paddingLeft: 2,
1942
- paddingRight: 2,
1943
- hasRadius: true,
1944
- color: "alternative600",
1945
- children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", lineHeight: 1, children: formatMessage({ id: "global.new", defaultMessage: "New" }) })
1946
- }
1947
- )
1948
- ] })
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
+ ) })
1949
1951
  },
1950
1952
  action.id
1951
1953
  );
@@ -2056,6 +2058,18 @@ const DocumentActionModal = ({
2056
2058
  typeof Footer === "function" ? /* @__PURE__ */ jsx(Footer, { onClose: handleClose }) : Footer
2057
2059
  ] }) });
2058
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
+ };
2059
2073
  const PublishAction$1 = ({
2060
2074
  activeTab,
2061
2075
  documentId,
@@ -2070,6 +2084,7 @@ const PublishAction$1 = ({
2070
2084
  const { _unstableFormatValidationErrors: formatValidationErrors } = useAPIErrorHandler();
2071
2085
  const isListView = useMatch(LIST_PATH) !== null;
2072
2086
  const isCloning = useMatch(CLONE_PATH) !== null;
2087
+ const { id } = useParams();
2073
2088
  const { formatMessage } = useIntl();
2074
2089
  const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
2075
2090
  const { publish } = useDocumentActions();
@@ -2169,13 +2184,15 @@ const PublishAction$1 = ({
2169
2184
  documentId,
2170
2185
  params
2171
2186
  },
2172
- formDocumentToData(formValues)
2187
+ transformData(formValues)
2173
2188
  );
2174
2189
  if ("data" in res && collectionType !== SINGLE_TYPES) {
2175
- navigate({
2176
- pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2177
- search: rawQuery
2178
- });
2190
+ if (id === "create") {
2191
+ navigate({
2192
+ pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2193
+ search: rawQuery
2194
+ });
2195
+ }
2179
2196
  } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2180
2197
  setErrors(formatValidationErrors(res.error));
2181
2198
  }
@@ -2228,36 +2245,6 @@ const PublishAction$1 = ({
2228
2245
  };
2229
2246
  };
2230
2247
  PublishAction$1.type = "publish";
2231
- const formDocumentToData = (document) => {
2232
- return Object.keys(document).reduce((acc, key) => {
2233
- if (document[key] !== void 0) {
2234
- acc[key] = document[key];
2235
- }
2236
- if (typeof document[key] === "object" && document[key] !== null) {
2237
- if ("connect" in document[key] && document[key].connect !== null) {
2238
- acc[key] = {
2239
- ...acc[key],
2240
- connect: document[key].connect.map((item) => {
2241
- return {
2242
- documentId: item.documentId
2243
- };
2244
- })
2245
- };
2246
- }
2247
- if ("disconnect" in document[key] && document[key].disconnect !== null) {
2248
- acc[key] = {
2249
- ...acc[key],
2250
- disconnect: document[key].disconnect.map((item) => {
2251
- return {
2252
- documentId: item.documentId
2253
- };
2254
- })
2255
- };
2256
- }
2257
- }
2258
- return acc;
2259
- }, {});
2260
- };
2261
2248
  const UpdateAction = ({
2262
2249
  activeTab,
2263
2250
  documentId,
@@ -2289,7 +2276,7 @@ const UpdateAction = ({
2289
2276
  */
2290
2277
  disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2291
2278
  label: formatMessage({
2292
- id: "content-manager.containers.Edit.save",
2279
+ id: "global.save",
2293
2280
  defaultMessage: "Save"
2294
2281
  }),
2295
2282
  onClick: async () => {
@@ -2315,7 +2302,7 @@ const UpdateAction = ({
2315
2302
  documentId: cloneMatch.params.origin,
2316
2303
  params
2317
2304
  },
2318
- formDocumentToData(document)
2305
+ transformData(document)
2319
2306
  );
2320
2307
  if ("data" in res) {
2321
2308
  navigate(
@@ -2336,7 +2323,7 @@ const UpdateAction = ({
2336
2323
  documentId,
2337
2324
  params
2338
2325
  },
2339
- formDocumentToData(document)
2326
+ transformData(document)
2340
2327
  );
2341
2328
  if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2342
2329
  setErrors(formatValidationErrors(res.error));
@@ -2349,7 +2336,7 @@ const UpdateAction = ({
2349
2336
  model,
2350
2337
  params
2351
2338
  },
2352
- formDocumentToData(document)
2339
+ transformData(document)
2353
2340
  );
2354
2341
  if ("data" in res && collectionType !== SINGLE_TYPES) {
2355
2342
  navigate(
@@ -2554,7 +2541,7 @@ const RelativeTime = React.forwardRef(
2554
2541
  });
2555
2542
  const unit = intervals.find((intervalUnit) => {
2556
2543
  return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
2557
- });
2544
+ }) ?? "seconds";
2558
2545
  const relativeTime = isPast(timestamp) ? -interval[unit] : interval[unit];
2559
2546
  const customInterval = customIntervals.find(
2560
2547
  (custom) => interval[custom.unit] < custom.threshold
@@ -2588,19 +2575,29 @@ const getDisplayName = ({
2588
2575
  return email ?? "";
2589
2576
  };
2590
2577
  const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
2591
- const DocumentStatus = ({ status = "draft", ...restProps }) => {
2578
+ const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
2592
2579
  const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
2593
- return /* @__PURE__ */ jsx(Status, { ...restProps, showBullet: false, size: "S", variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: capitalise(status) }) });
2580
+ const { formatMessage } = useIntl();
2581
+ return /* @__PURE__ */ jsx(Status, { ...restProps, size, variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: formatMessage({
2582
+ id: `content-manager.containers.List.${status}`,
2583
+ defaultMessage: capitalise(status)
2584
+ }) }) });
2594
2585
  };
2595
2586
  const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
2596
2587
  const { formatMessage } = useIntl();
2597
2588
  const isCloning = useMatch(CLONE_PATH) !== null;
2589
+ const params = useParams();
2598
2590
  const title = isCreating ? formatMessage({
2599
2591
  id: "content-manager.containers.edit.title.new",
2600
2592
  defaultMessage: "Create an entry"
2601
2593
  }) : documentTitle;
2602
2594
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
2603
- /* @__PURE__ */ jsx(BackButton, {}),
2595
+ /* @__PURE__ */ jsx(
2596
+ BackButton,
2597
+ {
2598
+ fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
2599
+ }
2600
+ ),
2604
2601
  /* @__PURE__ */ jsxs(Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
2605
2602
  /* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
2606
2603
  /* @__PURE__ */ jsx(HeaderToolbar, {})
@@ -3037,7 +3034,7 @@ const Panel = React.forwardRef(({ children, title }, ref) => {
3037
3034
  justifyContent: "stretch",
3038
3035
  alignItems: "flex-start",
3039
3036
  children: [
3040
- /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", children: title }),
3037
+ /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", textColor: "neutral600", children: title }),
3041
3038
  children
3042
3039
  ]
3043
3040
  }
@@ -3287,18 +3284,10 @@ const SelectedEntriesTableContent = ({
3287
3284
  search: row.locale && `?plugins[i18n][locale]=${row.locale}`
3288
3285
  },
3289
3286
  state: { from: pathname },
3290
- label: formatMessage(
3291
- { id: "app.component.HelperPluginTable.edit", defaultMessage: "Edit {target}" },
3292
- {
3293
- target: formatMessage(
3294
- {
3295
- id: "content-manager.components.ListViewHelperPluginTable.row-line",
3296
- defaultMessage: "item line {number}"
3297
- },
3298
- { number: index2 + 1 }
3299
- )
3300
- }
3301
- ),
3287
+ label: formatMessage({
3288
+ id: "content-manager.bulk-publish.edit",
3289
+ defaultMessage: "Edit"
3290
+ }),
3302
3291
  target: "_blank",
3303
3292
  marginLeft: "auto",
3304
3293
  variant: "ghost",
@@ -3942,17 +3931,27 @@ const HistoryAction = ({ model, document }) => {
3942
3931
  const { formatMessage } = useIntl();
3943
3932
  const [{ query }] = useQueryParams();
3944
3933
  const navigate = useNavigate();
3934
+ const { trackUsage } = useTracking();
3935
+ const { pathname } = useLocation();
3945
3936
  const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
3946
3937
  if (!window.strapi.features.isEnabled("cms-content-history")) {
3947
3938
  return null;
3948
3939
  }
3940
+ const handleOnClick = () => {
3941
+ const destination = { pathname: "history", search: pluginsQueryParams };
3942
+ trackUsage("willNavigate", {
3943
+ from: pathname,
3944
+ to: `${pathname}/${destination.pathname}`
3945
+ });
3946
+ navigate(destination);
3947
+ };
3949
3948
  return {
3950
3949
  icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
3951
3950
  label: formatMessage({
3952
3951
  id: "content-manager.history.document-action",
3953
3952
  defaultMessage: "Content History"
3954
3953
  }),
3955
- onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
3954
+ onClick: handleOnClick,
3956
3955
  disabled: (
3957
3956
  /**
3958
3957
  * The user is creating a new document.
@@ -4020,6 +4019,72 @@ const { setInitialData } = actions;
4020
4019
  const reducer = combineReducers({
4021
4020
  app: reducer$1
4022
4021
  });
4022
+ const previewApi = contentManagerApi.injectEndpoints({
4023
+ endpoints: (builder) => ({
4024
+ getPreviewUrl: builder.query({
4025
+ query({ query, params }) {
4026
+ return {
4027
+ url: `/content-manager/preview/url/${params.contentType}`,
4028
+ method: "GET",
4029
+ config: {
4030
+ params: query
4031
+ }
4032
+ };
4033
+ }
4034
+ })
4035
+ })
4036
+ });
4037
+ const { useGetPreviewUrlQuery } = previewApi;
4038
+ const PreviewSidePanel = ({ model, documentId, document }) => {
4039
+ const { formatMessage } = useIntl();
4040
+ const { trackUsage } = useTracking();
4041
+ const { pathname } = useLocation();
4042
+ const [{ query }] = useQueryParams();
4043
+ const { data, error } = useGetPreviewUrlQuery({
4044
+ params: {
4045
+ contentType: model
4046
+ },
4047
+ query: {
4048
+ documentId,
4049
+ locale: document?.locale,
4050
+ status: document?.status
4051
+ }
4052
+ });
4053
+ if (!data?.data?.url || error) {
4054
+ return null;
4055
+ }
4056
+ const trackNavigation = () => {
4057
+ const destinationPathname = pathname.replace(/\/$/, "") + "/preview";
4058
+ trackUsage("willNavigate", { from: pathname, to: destinationPathname });
4059
+ };
4060
+ return {
4061
+ title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
4062
+ content: /* @__PURE__ */ jsx(Flex, { gap: 2, width: "100%", children: /* @__PURE__ */ jsx(
4063
+ Button,
4064
+ {
4065
+ variant: "tertiary",
4066
+ tag: Link,
4067
+ to: { pathname: "preview", search: stringify(query, { encode: false }) },
4068
+ onClick: trackNavigation,
4069
+ flex: "auto",
4070
+ children: formatMessage({
4071
+ id: "content-manager.preview.panel.button",
4072
+ defaultMessage: "Open preview"
4073
+ })
4074
+ }
4075
+ ) })
4076
+ };
4077
+ };
4078
+ const FEATURE_ID = "preview";
4079
+ const previewAdmin = {
4080
+ bootstrap(app) {
4081
+ if (!window.strapi.future.isEnabled(FEATURE_ID)) {
4082
+ return;
4083
+ }
4084
+ const contentManagerPluginApis = app.getPlugin("content-manager").apis;
4085
+ contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
4086
+ }
4087
+ };
4023
4088
  const index = {
4024
4089
  register(app) {
4025
4090
  const cm = new ContentManagerPlugin();
@@ -4039,7 +4104,7 @@ const index = {
4039
4104
  app.router.addRoute({
4040
4105
  path: "content-manager/*",
4041
4106
  lazy: async () => {
4042
- const { Layout } = await import("./layout-aX-RJhd5.mjs");
4107
+ const { Layout } = await import("./layout-Cc0Kovb9.mjs");
4043
4108
  return {
4044
4109
  Component: Layout
4045
4110
  };
@@ -4052,11 +4117,14 @@ const index = {
4052
4117
  if (typeof historyAdmin.bootstrap === "function") {
4053
4118
  historyAdmin.bootstrap(app);
4054
4119
  }
4120
+ if (typeof previewAdmin.bootstrap === "function") {
4121
+ previewAdmin.bootstrap(app);
4122
+ }
4055
4123
  },
4056
4124
  async registerTrads({ locales }) {
4057
4125
  const importedTrads = await Promise.all(
4058
4126
  locales.map((locale) => {
4059
- 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 }) => {
4127
+ 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 }) => {
4060
4128
  return {
4061
4129
  data: prefixPluginTranslations(data, PLUGIN_ID),
4062
4130
  locale
@@ -4083,9 +4151,10 @@ export {
4083
4151
  HOOKS as H,
4084
4152
  InjectionZone as I,
4085
4153
  useDocument as J,
4086
- index as K,
4087
- useContentManagerContext as L,
4088
- useDocumentActions as M,
4154
+ useGetPreviewUrlQuery as K,
4155
+ index as L,
4156
+ useContentManagerContext as M,
4157
+ useDocumentActions as N,
4089
4158
  Panels as P,
4090
4159
  RelativeTime as R,
4091
4160
  SINGLE_TYPES as S,
@@ -4117,4 +4186,4 @@ export {
4117
4186
  capitalise as y,
4118
4187
  useUpdateContentTypeConfigurationMutation as z
4119
4188
  };
4120
- //# sourceMappingURL=index-TaRzG09p.mjs.map
4189
+ //# sourceMappingURL=index-C-rEZYIo.mjs.map