@strapi/content-manager 0.0.0-experimental.fdacf4285d1cada9d94ab4dcd756c5362cba1b54 → 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-CI7K072v.js → ComponentConfigurationPage-BH5297nw.js} +4 -4
  2. package/dist/_chunks/{ComponentConfigurationPage-CI7K072v.js.map → ComponentConfigurationPage-BH5297nw.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-CVfoYQ9p.mjs → ComponentConfigurationPage-CBRYXx1V.mjs} +4 -4
  4. package/dist/_chunks/{ComponentConfigurationPage-CVfoYQ9p.mjs.map → ComponentConfigurationPage-CBRYXx1V.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-CtnhGgIx.js → EditConfigurationPage-CKkb0EW6.js} +4 -4
  6. package/dist/_chunks/{EditConfigurationPage-CtnhGgIx.js.map → EditConfigurationPage-CKkb0EW6.js.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-Cg1Esg_N.mjs → EditConfigurationPage-DCFTHMFy.mjs} +4 -4
  8. package/dist/_chunks/{EditConfigurationPage-Cg1Esg_N.mjs.map → EditConfigurationPage-DCFTHMFy.mjs.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-C_iuCG0Z.mjs → EditViewPage-B7qtO55B.mjs} +30 -8
  10. package/dist/_chunks/EditViewPage-B7qtO55B.mjs.map +1 -0
  11. package/dist/_chunks/{EditViewPage-MURPhGdY.js → EditViewPage-CtYyxyPW.js} +29 -7
  12. package/dist/_chunks/EditViewPage-CtYyxyPW.js.map +1 -0
  13. package/dist/_chunks/{Field-55cGR9kd.mjs → Field-BMv9ud3N.mjs} +44 -25
  14. package/dist/_chunks/Field-BMv9ud3N.mjs.map +1 -0
  15. package/dist/_chunks/{Field-D1c7z74Q.js → Field-oqDBIPId.js} +43 -24
  16. package/dist/_chunks/Field-oqDBIPId.js.map +1 -0
  17. package/dist/_chunks/{Form-D1cecnu3.js → Form-BtsYj5GQ.js} +2 -2
  18. package/dist/_chunks/{Form-D1cecnu3.js.map → Form-BtsYj5GQ.js.map} +1 -1
  19. package/dist/_chunks/{Form-oLrvgmvM.mjs → Form-Drwa2T5R.mjs} +2 -2
  20. package/dist/_chunks/{Form-oLrvgmvM.mjs.map → Form-Drwa2T5R.mjs.map} +1 -1
  21. package/dist/_chunks/{History-DJpjbGJZ.js → History-CxGvvWhH.js} +22 -92
  22. package/dist/_chunks/History-CxGvvWhH.js.map +1 -0
  23. package/dist/_chunks/{History-5VbTZWYl.mjs → History-dUA1IWvK.mjs} +23 -93
  24. package/dist/_chunks/History-dUA1IWvK.mjs.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-BNs0g27c.mjs → ListConfigurationPage-C-dzvcr-.mjs} +6 -5
  26. package/dist/_chunks/ListConfigurationPage-C-dzvcr-.mjs.map +1 -0
  27. package/dist/_chunks/{ListConfigurationPage-DylRESaU.js → ListConfigurationPage-fJRHoZ-W.js} +5 -4
  28. package/dist/_chunks/ListConfigurationPage-fJRHoZ-W.js.map +1 -0
  29. package/dist/_chunks/{ListViewPage-MbdmfkXa.js → ListViewPage-BjPkVAd6.js} +74 -40
  30. package/dist/_chunks/ListViewPage-BjPkVAd6.js.map +1 -0
  31. package/dist/_chunks/{ListViewPage-DelIyZ5D.mjs → ListViewPage-Dq1Q0T3K.mjs} +74 -40
  32. package/dist/_chunks/ListViewPage-Dq1Q0T3K.mjs.map +1 -0
  33. package/dist/_chunks/{NoContentTypePage-CoXa1X8-.mjs → NoContentTypePage-B2qw4pa9.mjs} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-CoXa1X8-.mjs.map → NoContentTypePage-B2qw4pa9.mjs.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-BDQ1MdsC.js → NoContentTypePage-DoosCI8K.js} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-BDQ1MdsC.js.map → NoContentTypePage-DoosCI8K.js.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-GgkDXRq3.mjs → NoPermissionsPage-BthC4KSZ.mjs} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-GgkDXRq3.mjs.map → NoPermissionsPage-BthC4KSZ.mjs.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-CnnuMd2Y.js → NoPermissionsPage-Eb2ZWoy6.js} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-CnnuMd2Y.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-DVeWgAT4.js → Relations-30DATMsp.js} +43 -16
  46. package/dist/_chunks/Relations-30DATMsp.js.map +1 -0
  47. package/dist/_chunks/{Relations-BKnC9peY.mjs → Relations-BVKe5d6m.mjs} +44 -17
  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-jwACjpe1.mjs → index-C-rEZYIo.mjs} +188 -89
  62. package/dist/_chunks/index-C-rEZYIo.mjs.map +1 -0
  63. package/dist/_chunks/{index-B9u01WiI.js → index-CliQLPIn.js} +185 -85
  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-DDtbDqUd.js → layout-Ap9UjC0q.js} +3 -3
  70. package/dist/_chunks/{layout-DDtbDqUd.js.map → layout-Ap9UjC0q.js.map} +1 -1
  71. package/dist/_chunks/{layout-D51YDRJV.mjs → layout-Cc0Kovb9.mjs} +3 -3
  72. package/dist/_chunks/{layout-D51YDRJV.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-Bgc8jKKt.mjs → relations-CMPpsYC4.mjs} +6 -7
  78. package/dist/_chunks/relations-CMPpsYC4.mjs.map +1 -0
  79. package/dist/_chunks/{relations-DtsF4GJw.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-C_iuCG0Z.mjs.map +0 -1
  150. package/dist/_chunks/EditViewPage-MURPhGdY.js.map +0 -1
  151. package/dist/_chunks/Field-55cGR9kd.mjs.map +0 -1
  152. package/dist/_chunks/Field-D1c7z74Q.js.map +0 -1
  153. package/dist/_chunks/History-5VbTZWYl.mjs.map +0 -1
  154. package/dist/_chunks/History-DJpjbGJZ.js.map +0 -1
  155. package/dist/_chunks/ListConfigurationPage-BNs0g27c.mjs.map +0 -1
  156. package/dist/_chunks/ListConfigurationPage-DylRESaU.js.map +0 -1
  157. package/dist/_chunks/ListViewPage-DelIyZ5D.mjs.map +0 -1
  158. package/dist/_chunks/ListViewPage-MbdmfkXa.js.map +0 -1
  159. package/dist/_chunks/Relations-BKnC9peY.mjs.map +0 -1
  160. package/dist/_chunks/Relations-DVeWgAT4.js.map +0 -1
  161. package/dist/_chunks/index-B9u01WiI.js.map +0 -1
  162. package/dist/_chunks/index-jwACjpe1.mjs.map +0 -1
  163. package/dist/_chunks/relations-Bgc8jKKt.mjs.map +0 -1
  164. package/dist/_chunks/relations-DtsF4GJw.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-5VbTZWYl.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-C_iuCG0Z.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-DelIyZ5D.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-BNs0g27c.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-Cg1Esg_N.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-CVfoYQ9p.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-GgkDXRq3.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-CoXa1X8-.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
- 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
  }
@@ -2259,7 +2276,7 @@ const UpdateAction = ({
2259
2276
  */
2260
2277
  disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2261
2278
  label: formatMessage({
2262
- id: "content-manager.containers.Edit.save",
2279
+ id: "global.save",
2263
2280
  defaultMessage: "Save"
2264
2281
  }),
2265
2282
  onClick: async () => {
@@ -2285,7 +2302,7 @@ const UpdateAction = ({
2285
2302
  documentId: cloneMatch.params.origin,
2286
2303
  params
2287
2304
  },
2288
- document
2305
+ transformData(document)
2289
2306
  );
2290
2307
  if ("data" in res) {
2291
2308
  navigate(
@@ -2306,7 +2323,7 @@ const UpdateAction = ({
2306
2323
  documentId,
2307
2324
  params
2308
2325
  },
2309
- document
2326
+ transformData(document)
2310
2327
  );
2311
2328
  if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2312
2329
  setErrors(formatValidationErrors(res.error));
@@ -2319,7 +2336,7 @@ const UpdateAction = ({
2319
2336
  model,
2320
2337
  params
2321
2338
  },
2322
- document
2339
+ transformData(document)
2323
2340
  );
2324
2341
  if ("data" in res && collectionType !== SINGLE_TYPES) {
2325
2342
  navigate(
@@ -2524,7 +2541,7 @@ const RelativeTime = React.forwardRef(
2524
2541
  });
2525
2542
  const unit = intervals.find((intervalUnit) => {
2526
2543
  return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
2527
- });
2544
+ }) ?? "seconds";
2528
2545
  const relativeTime = isPast(timestamp) ? -interval[unit] : interval[unit];
2529
2546
  const customInterval = customIntervals.find(
2530
2547
  (custom) => interval[custom.unit] < custom.threshold
@@ -2558,19 +2575,29 @@ const getDisplayName = ({
2558
2575
  return email ?? "";
2559
2576
  };
2560
2577
  const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
2561
- const DocumentStatus = ({ status = "draft", ...restProps }) => {
2578
+ const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
2562
2579
  const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
2563
- 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
+ }) }) });
2564
2585
  };
2565
2586
  const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
2566
2587
  const { formatMessage } = useIntl();
2567
2588
  const isCloning = useMatch(CLONE_PATH) !== null;
2589
+ const params = useParams();
2568
2590
  const title = isCreating ? formatMessage({
2569
2591
  id: "content-manager.containers.edit.title.new",
2570
2592
  defaultMessage: "Create an entry"
2571
2593
  }) : documentTitle;
2572
2594
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
2573
- /* @__PURE__ */ jsx(BackButton, {}),
2595
+ /* @__PURE__ */ jsx(
2596
+ BackButton,
2597
+ {
2598
+ fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
2599
+ }
2600
+ ),
2574
2601
  /* @__PURE__ */ jsxs(Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
2575
2602
  /* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
2576
2603
  /* @__PURE__ */ jsx(HeaderToolbar, {})
@@ -3007,7 +3034,7 @@ const Panel = React.forwardRef(({ children, title }, ref) => {
3007
3034
  justifyContent: "stretch",
3008
3035
  alignItems: "flex-start",
3009
3036
  children: [
3010
- /* @__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 }),
3011
3038
  children
3012
3039
  ]
3013
3040
  }
@@ -3257,18 +3284,10 @@ const SelectedEntriesTableContent = ({
3257
3284
  search: row.locale && `?plugins[i18n][locale]=${row.locale}`
3258
3285
  },
3259
3286
  state: { from: pathname },
3260
- label: formatMessage(
3261
- { id: "app.component.HelperPluginTable.edit", defaultMessage: "Edit {target}" },
3262
- {
3263
- target: formatMessage(
3264
- {
3265
- id: "content-manager.components.ListViewHelperPluginTable.row-line",
3266
- defaultMessage: "item line {number}"
3267
- },
3268
- { number: index2 + 1 }
3269
- )
3270
- }
3271
- ),
3287
+ label: formatMessage({
3288
+ id: "content-manager.bulk-publish.edit",
3289
+ defaultMessage: "Edit"
3290
+ }),
3272
3291
  target: "_blank",
3273
3292
  marginLeft: "auto",
3274
3293
  variant: "ghost",
@@ -3912,17 +3931,27 @@ const HistoryAction = ({ model, document }) => {
3912
3931
  const { formatMessage } = useIntl();
3913
3932
  const [{ query }] = useQueryParams();
3914
3933
  const navigate = useNavigate();
3934
+ const { trackUsage } = useTracking();
3935
+ const { pathname } = useLocation();
3915
3936
  const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
3916
3937
  if (!window.strapi.features.isEnabled("cms-content-history")) {
3917
3938
  return null;
3918
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
+ };
3919
3948
  return {
3920
3949
  icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
3921
3950
  label: formatMessage({
3922
3951
  id: "content-manager.history.document-action",
3923
3952
  defaultMessage: "Content History"
3924
3953
  }),
3925
- onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
3954
+ onClick: handleOnClick,
3926
3955
  disabled: (
3927
3956
  /**
3928
3957
  * The user is creating a new document.
@@ -3990,6 +4019,72 @@ const { setInitialData } = actions;
3990
4019
  const reducer = combineReducers({
3991
4020
  app: reducer$1
3992
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
+ };
3993
4088
  const index = {
3994
4089
  register(app) {
3995
4090
  const cm = new ContentManagerPlugin();
@@ -4009,7 +4104,7 @@ const index = {
4009
4104
  app.router.addRoute({
4010
4105
  path: "content-manager/*",
4011
4106
  lazy: async () => {
4012
- const { Layout } = await import("./layout-D51YDRJV.mjs");
4107
+ const { Layout } = await import("./layout-Cc0Kovb9.mjs");
4013
4108
  return {
4014
4109
  Component: Layout
4015
4110
  };
@@ -4022,11 +4117,14 @@ const index = {
4022
4117
  if (typeof historyAdmin.bootstrap === "function") {
4023
4118
  historyAdmin.bootstrap(app);
4024
4119
  }
4120
+ if (typeof previewAdmin.bootstrap === "function") {
4121
+ previewAdmin.bootstrap(app);
4122
+ }
4025
4123
  },
4026
4124
  async registerTrads({ locales }) {
4027
4125
  const importedTrads = await Promise.all(
4028
4126
  locales.map((locale) => {
4029
- 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 }) => {
4030
4128
  return {
4031
4129
  data: prefixPluginTranslations(data, PLUGIN_ID),
4032
4130
  locale
@@ -4053,9 +4151,10 @@ export {
4053
4151
  HOOKS as H,
4054
4152
  InjectionZone as I,
4055
4153
  useDocument as J,
4056
- index as K,
4057
- useContentManagerContext as L,
4058
- useDocumentActions as M,
4154
+ useGetPreviewUrlQuery as K,
4155
+ index as L,
4156
+ useContentManagerContext as M,
4157
+ useDocumentActions as N,
4059
4158
  Panels as P,
4060
4159
  RelativeTime as R,
4061
4160
  SINGLE_TYPES as S,
@@ -4087,4 +4186,4 @@ export {
4087
4186
  capitalise as y,
4088
4187
  useUpdateContentTypeConfigurationMutation as z
4089
4188
  };
4090
- //# sourceMappingURL=index-jwACjpe1.mjs.map
4189
+ //# sourceMappingURL=index-C-rEZYIo.mjs.map