@strapi/content-manager 0.0.0-experimental.dd3311938ac827f1fa8560c8840a9a394f5896c0 → 0.0.0-experimental.df298029ec6478763dcca7d59fafe8d2ae4ed60a

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 (198) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-y_7iLdmB.js → ComponentConfigurationPage-CpJNPBgk.js} +4 -4
  3. package/dist/_chunks/{ComponentConfigurationPage-y_7iLdmB.js.map → ComponentConfigurationPage-CpJNPBgk.js.map} +1 -1
  4. package/dist/_chunks/{ComponentConfigurationPage-BMajAl1u.mjs → ComponentConfigurationPage-TYDPg5WG.mjs} +4 -4
  5. package/dist/_chunks/{ComponentConfigurationPage-BMajAl1u.mjs.map → ComponentConfigurationPage-TYDPg5WG.mjs.map} +1 -1
  6. package/dist/_chunks/{EditConfigurationPage-CPVB8Uqc.js → EditConfigurationPage-CFDe6SA1.js} +4 -4
  7. package/dist/_chunks/{EditConfigurationPage-CPVB8Uqc.js.map → EditConfigurationPage-CFDe6SA1.js.map} +1 -1
  8. package/dist/_chunks/{EditConfigurationPage-CcOoD26O.mjs → EditConfigurationPage-DqL8Pq5r.mjs} +4 -4
  9. package/dist/_chunks/{EditConfigurationPage-CcOoD26O.mjs.map → EditConfigurationPage-DqL8Pq5r.mjs.map} +1 -1
  10. package/dist/_chunks/{EditViewPage-DWb0DE7R.mjs → EditViewPage-RXrFLav2.mjs} +69 -48
  11. package/dist/_chunks/EditViewPage-RXrFLav2.mjs.map +1 -0
  12. package/dist/_chunks/{EditViewPage-CTTDHKkQ.js → EditViewPage-khfP2CR3.js} +68 -47
  13. package/dist/_chunks/EditViewPage-khfP2CR3.js.map +1 -0
  14. package/dist/_chunks/{Field-DnStdvQw.mjs → Field--rQeS6Zj.mjs} +580 -228
  15. package/dist/_chunks/Field--rQeS6Zj.mjs.map +1 -0
  16. package/dist/_chunks/{Field-C5Z1Ivdv.js → Field-C1ftmTe9.js} +582 -230
  17. package/dist/_chunks/Field-C1ftmTe9.js.map +1 -0
  18. package/dist/_chunks/{Form-DqGgE55Q.mjs → Form-COtGXyUE.mjs} +54 -36
  19. package/dist/_chunks/Form-COtGXyUE.mjs.map +1 -0
  20. package/dist/_chunks/{Form-B81OtW-k.js → Form-CwdX5oLw.js} +52 -34
  21. package/dist/_chunks/Form-CwdX5oLw.js.map +1 -0
  22. package/dist/_chunks/{History-DS6-HCYX.mjs → History-BevwkPO1.mjs} +83 -63
  23. package/dist/_chunks/History-BevwkPO1.mjs.map +1 -0
  24. package/dist/_chunks/{History-4NbOq2dX.js → History-DKS2aqqM.js} +82 -62
  25. package/dist/_chunks/History-DKS2aqqM.js.map +1 -0
  26. package/dist/_chunks/{ListConfigurationPage-DQJJltko.mjs → ListConfigurationPage-DNfZDtDA.mjs} +59 -49
  27. package/dist/_chunks/ListConfigurationPage-DNfZDtDA.mjs.map +1 -0
  28. package/dist/_chunks/{ListConfigurationPage-CpfstlYY.js → ListConfigurationPage-LSYSPZHH.js} +58 -47
  29. package/dist/_chunks/ListConfigurationPage-LSYSPZHH.js.map +1 -0
  30. package/dist/_chunks/{ListViewPage-nQrOQuVo.mjs → ListViewPage-C1PyuYRS.mjs} +115 -103
  31. package/dist/_chunks/ListViewPage-C1PyuYRS.mjs.map +1 -0
  32. package/dist/_chunks/{ListViewPage-CA3I75m5.js → ListViewPage-DlUpqLIo.js} +117 -105
  33. package/dist/_chunks/ListViewPage-DlUpqLIo.js.map +1 -0
  34. package/dist/_chunks/{NoContentTypePage-DbnHE22g.mjs → NoContentTypePage-C9q744z1.mjs} +2 -2
  35. package/dist/_chunks/{NoContentTypePage-DbnHE22g.mjs.map → NoContentTypePage-C9q744z1.mjs.map} +1 -1
  36. package/dist/_chunks/{NoContentTypePage-Dldu-_Mx.js → NoContentTypePage-m8wt3sf6.js} +2 -2
  37. package/dist/_chunks/{NoContentTypePage-Dldu-_Mx.js.map → NoContentTypePage-m8wt3sf6.js.map} +1 -1
  38. package/dist/_chunks/{NoPermissionsPage-fOIkQM0v.mjs → NoPermissionsPage-8BM-LWta.mjs} +2 -2
  39. package/dist/_chunks/{NoPermissionsPage-fOIkQM0v.mjs.map → NoPermissionsPage-8BM-LWta.mjs.map} +1 -1
  40. package/dist/_chunks/{NoPermissionsPage-CO2MK200.js → NoPermissionsPage-DLfPsA0Q.js} +2 -2
  41. package/dist/_chunks/{NoPermissionsPage-CO2MK200.js.map → NoPermissionsPage-DLfPsA0Q.js.map} +1 -1
  42. package/dist/_chunks/{Relations-BDRl99Ux.mjs → Relations-D25xRcFy.mjs} +73 -37
  43. package/dist/_chunks/Relations-D25xRcFy.mjs.map +1 -0
  44. package/dist/_chunks/{Relations-DG2jnOcr.js → Relations-OMriCP_L.js} +72 -36
  45. package/dist/_chunks/Relations-OMriCP_L.js.map +1 -0
  46. package/dist/_chunks/{en-fbKQxLGn.js → en-Bdpa50w3.js} +22 -16
  47. package/dist/_chunks/{en-fbKQxLGn.js.map → en-Bdpa50w3.js.map} +1 -1
  48. package/dist/_chunks/{en-Ux26r5pl.mjs → en-CZw4xdPY.mjs} +22 -16
  49. package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-CZw4xdPY.mjs.map} +1 -1
  50. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  51. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  52. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  53. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  54. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  55. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  56. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  57. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  58. package/dist/_chunks/{index-Drt2DN7v.mjs → index-BvGihCJp.mjs} +1116 -858
  59. package/dist/_chunks/index-BvGihCJp.mjs.map +1 -0
  60. package/dist/_chunks/{index-BZoNZMXL.js → index-DqZnjo8F.js} +1107 -848
  61. package/dist/_chunks/index-DqZnjo8F.js.map +1 -0
  62. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  63. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  64. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  65. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  66. package/dist/_chunks/{layout-DEYBqgF1.js → layout-CmaemAO3.js} +25 -12
  67. package/dist/_chunks/layout-CmaemAO3.js.map +1 -0
  68. package/dist/_chunks/{layout-BzAbmoO6.mjs → layout-ykHSe2KQ.mjs} +27 -14
  69. package/dist/_chunks/layout-ykHSe2KQ.mjs.map +1 -0
  70. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  71. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  72. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  73. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  74. package/dist/_chunks/{relations-D0eZ4VWw.js → relations-D9fKsCLY.js} +3 -7
  75. package/dist/_chunks/relations-D9fKsCLY.js.map +1 -0
  76. package/dist/_chunks/{relations-D26zVRdi.mjs → relations-u-Vz51Ea.mjs} +3 -7
  77. package/dist/_chunks/relations-u-Vz51Ea.mjs.map +1 -0
  78. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  79. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  80. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  81. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  82. package/dist/admin/index.js +2 -1
  83. package/dist/admin/index.js.map +1 -1
  84. package/dist/admin/index.mjs +3 -2
  85. package/dist/admin/src/exports.d.ts +1 -1
  86. package/dist/admin/src/history/index.d.ts +3 -0
  87. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  88. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  89. package/dist/admin/src/index.d.ts +1 -0
  90. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +8 -3
  91. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  92. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
  93. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  94. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  95. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +6 -58
  96. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  97. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  98. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  99. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  100. package/dist/admin/src/preview/constants.d.ts +1 -0
  101. package/dist/admin/src/preview/index.d.ts +4 -0
  102. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  103. package/dist/admin/src/services/api.d.ts +1 -1
  104. package/dist/admin/src/services/components.d.ts +2 -2
  105. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  106. package/dist/admin/src/services/documents.d.ts +19 -17
  107. package/dist/admin/src/services/init.d.ts +1 -1
  108. package/dist/admin/src/services/relations.d.ts +2 -2
  109. package/dist/admin/src/services/uid.d.ts +3 -3
  110. package/dist/admin/src/utils/validation.d.ts +4 -1
  111. package/dist/server/index.js +551 -266
  112. package/dist/server/index.js.map +1 -1
  113. package/dist/server/index.mjs +552 -267
  114. package/dist/server/index.mjs.map +1 -1
  115. package/dist/server/src/bootstrap.d.ts.map +1 -1
  116. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  117. package/dist/server/src/controllers/index.d.ts.map +1 -1
  118. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  119. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  120. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  121. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  122. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  123. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  124. package/dist/server/src/history/services/history.d.ts.map +1 -1
  125. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  126. package/dist/server/src/history/services/utils.d.ts +4 -4
  127. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  128. package/dist/server/src/index.d.ts +4 -4
  129. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  130. package/dist/server/src/preview/constants.d.ts +2 -0
  131. package/dist/server/src/preview/constants.d.ts.map +1 -0
  132. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  133. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  134. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  135. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  136. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  137. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  138. package/dist/server/src/preview/index.d.ts +4 -0
  139. package/dist/server/src/preview/index.d.ts.map +1 -0
  140. package/dist/server/src/preview/routes/index.d.ts +8 -0
  141. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  142. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  143. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  144. package/dist/server/src/preview/services/index.d.ts +15 -0
  145. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  146. package/dist/server/src/preview/services/preview-config.d.ts +30 -0
  147. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  148. package/dist/server/src/preview/services/preview.d.ts +12 -0
  149. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  150. package/dist/server/src/preview/utils.d.ts +18 -0
  151. package/dist/server/src/preview/utils.d.ts.map +1 -0
  152. package/dist/server/src/routes/index.d.ts.map +1 -1
  153. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  154. package/dist/server/src/services/document-metadata.d.ts +8 -8
  155. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  156. package/dist/server/src/services/index.d.ts +4 -4
  157. package/dist/server/src/services/index.d.ts.map +1 -1
  158. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  159. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  160. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  161. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  162. package/dist/server/src/utils/index.d.ts +2 -0
  163. package/dist/server/src/utils/index.d.ts.map +1 -1
  164. package/dist/shared/contracts/collection-types.d.ts +3 -1
  165. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  166. package/dist/shared/contracts/index.d.ts +1 -0
  167. package/dist/shared/contracts/index.d.ts.map +1 -1
  168. package/dist/shared/contracts/preview.d.ts +27 -0
  169. package/dist/shared/contracts/preview.d.ts.map +1 -0
  170. package/dist/shared/index.js +4 -0
  171. package/dist/shared/index.js.map +1 -1
  172. package/dist/shared/index.mjs +4 -0
  173. package/dist/shared/index.mjs.map +1 -1
  174. package/package.json +13 -13
  175. package/dist/_chunks/EditViewPage-CTTDHKkQ.js.map +0 -1
  176. package/dist/_chunks/EditViewPage-DWb0DE7R.mjs.map +0 -1
  177. package/dist/_chunks/Field-C5Z1Ivdv.js.map +0 -1
  178. package/dist/_chunks/Field-DnStdvQw.mjs.map +0 -1
  179. package/dist/_chunks/Form-B81OtW-k.js.map +0 -1
  180. package/dist/_chunks/Form-DqGgE55Q.mjs.map +0 -1
  181. package/dist/_chunks/History-4NbOq2dX.js.map +0 -1
  182. package/dist/_chunks/History-DS6-HCYX.mjs.map +0 -1
  183. package/dist/_chunks/ListConfigurationPage-CpfstlYY.js.map +0 -1
  184. package/dist/_chunks/ListConfigurationPage-DQJJltko.mjs.map +0 -1
  185. package/dist/_chunks/ListViewPage-CA3I75m5.js.map +0 -1
  186. package/dist/_chunks/ListViewPage-nQrOQuVo.mjs.map +0 -1
  187. package/dist/_chunks/Relations-BDRl99Ux.mjs.map +0 -1
  188. package/dist/_chunks/Relations-DG2jnOcr.js.map +0 -1
  189. package/dist/_chunks/index-BZoNZMXL.js.map +0 -1
  190. package/dist/_chunks/index-Drt2DN7v.mjs.map +0 -1
  191. package/dist/_chunks/layout-BzAbmoO6.mjs.map +0 -1
  192. package/dist/_chunks/layout-DEYBqgF1.js.map +0 -1
  193. package/dist/_chunks/relations-D0eZ4VWw.js.map +0 -1
  194. package/dist/_chunks/relations-D26zVRdi.mjs.map +0 -1
  195. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  196. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  197. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  198. package/strapi-server.js +0 -3
@@ -7,8 +7,8 @@ const designSystem = require("@strapi/design-system");
7
7
  const reactIntl = require("react-intl");
8
8
  const reactRouterDom = require("react-router-dom");
9
9
  const styledComponents = require("styled-components");
10
- const index = require("./index-BZoNZMXL.js");
11
- const Field = require("./Field-C5Z1Ivdv.js");
10
+ const index = require("./index-DqZnjo8F.js");
11
+ const Field = require("./Field-C1ftmTe9.js");
12
12
  function _interopNamespace(e) {
13
13
  if (e && e.__esModule)
14
14
  return e;
@@ -35,7 +35,7 @@ const FormLayout = ({ layout }) => {
35
35
  if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
36
36
  const [row] = panel;
37
37
  const [field] = row;
38
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedInputRenderer, { ...field }) }) }, field.name);
38
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, s: 12, xs: 12, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedInputRenderer, { ...field }) }) }, field.name);
39
39
  }
40
40
  return /* @__PURE__ */ jsxRuntime.jsx(
41
41
  designSystem.Box,
@@ -48,8 +48,19 @@ const FormLayout = ({ layout }) => {
48
48
  paddingTop: 6,
49
49
  paddingBottom: 6,
50
50
  borderColor: "neutral150",
51
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: row.map(({ size, ...field }) => {
52
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedInputRenderer, { ...field }) }, field.name);
51
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
52
+ return /* @__PURE__ */ jsxRuntime.jsx(
53
+ designSystem.Grid.Item,
54
+ {
55
+ col: size,
56
+ s: 12,
57
+ xs: 12,
58
+ direction: "column",
59
+ alignItems: "stretch",
60
+ children: /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedInputRenderer, { ...field })
61
+ },
62
+ field.name
63
+ );
53
64
  }) }, gridRowIndex)) })
54
65
  },
55
66
  index2
@@ -63,10 +74,11 @@ const EditViewPage = () => {
63
74
  query: { status }
64
75
  },
65
76
  setQuery
66
- ] = strapiAdmin.useQueryParams();
77
+ ] = strapiAdmin.useQueryParams({
78
+ status: "draft"
79
+ });
67
80
  const { formatMessage } = reactIntl.useIntl();
68
81
  const { toggleNotification } = strapiAdmin.useNotification();
69
- const tabApi = React__namespace.useRef(null);
70
82
  const {
71
83
  document,
72
84
  meta,
@@ -75,7 +87,8 @@ const EditViewPage = () => {
75
87
  components,
76
88
  collectionType,
77
89
  id,
78
- model
90
+ model,
91
+ hasError
79
92
  } = index.useDoc();
80
93
  const hasDraftAndPublished = schema?.options?.draftAndPublish ?? false;
81
94
  useOnce(() => {
@@ -106,17 +119,18 @@ const EditViewPage = () => {
106
119
  const form = document?.id ? document : Field.createDefaultForm(schema, components);
107
120
  return Field.transformDocument(schema, components)(form);
108
121
  }, [document, isCreatingDocument, isSingleType, schema, components]);
122
+ if (hasError) {
123
+ return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
124
+ }
109
125
  if (isLoading && !document?.documentId) {
110
126
  return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
111
127
  }
112
128
  if (!initialValues) {
113
129
  return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
114
130
  }
115
- const handleTabChange = (index2) => {
116
- if (index2 === 0) {
117
- setQuery({ status: "draft" }, "push", true);
118
- } else {
119
- setQuery({ status: "published" }, "push", true);
131
+ const handleTabChange = (status2) => {
132
+ if (status2 === "published" || status2 === "draft") {
133
+ setQuery({ status: status2 }, "push", true);
120
134
  }
121
135
  };
122
136
  const documentTitle = mainField !== "id" && document?.[mainField] ? document[mainField] : "Untitled";
@@ -128,7 +142,13 @@ const EditViewPage = () => {
128
142
  disabled: hasDraftAndPublished && status === "published",
129
143
  initialValues,
130
144
  method: isCreatingDocument ? "POST" : "PUT",
131
- validationSchema: index.createYupSchema(schema?.attributes, components),
145
+ validate: (values, options) => {
146
+ const yupSchema = index.createYupSchema(schema?.attributes, components, {
147
+ status,
148
+ ...options
149
+ });
150
+ return yupSchema.validate(values, { abortEarly: false });
151
+ },
132
152
  children: ({ resetForm }) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
133
153
  /* @__PURE__ */ jsxRuntime.jsx(
134
154
  index.Header,
@@ -138,40 +158,41 @@ const EditViewPage = () => {
138
158
  title: documentTitle
139
159
  }
140
160
  ),
141
- /* @__PURE__ */ jsxRuntime.jsxs(
142
- designSystem.TabGroup,
143
- {
144
- ref: tabApi,
145
- variant: "simple",
146
- label: formatMessage({
147
- id: index.getTranslation("containers.edit.tabs.label"),
148
- defaultMessage: "Document status"
149
- }),
150
- selectedTabIndex: hasDraftAndPublished && status === "published" ? 1 : 0,
151
- onTabChange: (index2) => {
152
- handleTabChange(index2);
153
- },
154
- children: [
155
- hasDraftAndPublished ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs, { children: [
156
- /* @__PURE__ */ jsxRuntime.jsx(StatusTab, { children: formatMessage({
161
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs.Root, { variant: "simple", value: status, onValueChange: handleTabChange, children: [
162
+ /* @__PURE__ */ jsxRuntime.jsx(
163
+ designSystem.Tabs.List,
164
+ {
165
+ "aria-label": formatMessage({
166
+ id: index.getTranslation("containers.edit.tabs.label"),
167
+ defaultMessage: "Document status"
168
+ }),
169
+ children: hasDraftAndPublished ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
170
+ /* @__PURE__ */ jsxRuntime.jsx(StatusTab, { value: "draft", children: formatMessage({
157
171
  id: index.getTranslation("containers.edit.tabs.draft"),
158
172
  defaultMessage: "draft"
159
173
  }) }),
160
- /* @__PURE__ */ jsxRuntime.jsx(StatusTab, { disabled: !meta || meta.availableStatus.length === 0, children: formatMessage({
161
- id: index.getTranslation("containers.edit.tabs.published"),
162
- defaultMessage: "published"
163
- }) })
164
- ] }) : null,
165
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid, { paddingTop: 8, gap: 4, children: [
166
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 9, s: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.TabPanels, { children: [
167
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.TabPanel, { children: /* @__PURE__ */ jsxRuntime.jsx(FormLayout, { layout }) }),
168
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.TabPanel, { children: /* @__PURE__ */ jsxRuntime.jsx(FormLayout, { layout }) })
169
- ] }) }),
170
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 3, s: 12, children: /* @__PURE__ */ jsxRuntime.jsx(index.Panels, {}) })
171
- ] })
172
- ]
173
- }
174
- ),
174
+ /* @__PURE__ */ jsxRuntime.jsx(
175
+ StatusTab,
176
+ {
177
+ disabled: !meta || meta.availableStatus.length === 0,
178
+ value: "published",
179
+ children: formatMessage({
180
+ id: index.getTranslation("containers.edit.tabs.published"),
181
+ defaultMessage: "published"
182
+ })
183
+ }
184
+ )
185
+ ] }) : null
186
+ }
187
+ ),
188
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { paddingTop: 8, gap: 4, children: [
189
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Item, { col: 9, s: 12, direction: "column", alignItems: "stretch", children: [
190
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "draft", children: /* @__PURE__ */ jsxRuntime.jsx(FormLayout, { layout }) }),
191
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "published", children: /* @__PURE__ */ jsxRuntime.jsx(FormLayout, { layout }) })
192
+ ] }),
193
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 12, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(index.Panels, {}) })
194
+ ] })
195
+ ] }),
175
196
  /* @__PURE__ */ jsxRuntime.jsx(
176
197
  strapiAdmin.Blocker,
177
198
  {
@@ -183,7 +204,7 @@ const EditViewPage = () => {
183
204
  )
184
205
  ] });
185
206
  };
186
- const StatusTab = styledComponents.styled(designSystem.Tab)`
207
+ const StatusTab = styledComponents.styled(designSystem.Tabs.Trigger)`
187
208
  text-transform: uppercase;
188
209
  `;
189
210
  const getDocumentStatus = (document, meta) => {
@@ -219,4 +240,4 @@ const ProtectedEditViewPage = () => {
219
240
  };
220
241
  exports.EditViewPage = EditViewPage;
221
242
  exports.ProtectedEditViewPage = ProtectedEditViewPage;
222
- //# sourceMappingURL=EditViewPage-CTTDHKkQ.js.map
243
+ //# sourceMappingURL=EditViewPage-khfP2CR3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditViewPage-khfP2CR3.js","sources":["../../admin/src/hooks/useOnce.ts","../../admin/src/pages/EditView/components/FormLayout.tsx","../../admin/src/pages/EditView/EditViewPage.tsx"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\nimport * as React from 'react';\n\nexport const useOnce = (effect: React.EffectCallback) => React.useEffect(effect, emptyDeps);\n\nconst emptyDeps: React.DependencyList = [];\n","import { Box, Flex, Grid } from '@strapi/design-system';\n\nimport { EditLayout } from '../../../hooks/useDocumentLayout';\n\nimport { InputRenderer } from './InputRenderer';\n\ninterface FormLayoutProps extends Pick<EditLayout, 'layout'> {}\n\nconst FormLayout = ({ layout }: FormLayoutProps) => {\n return (\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {layout.map((panel, index) => {\n if (panel.some((row) => row.some((field) => field.type === 'dynamiczone'))) {\n const [row] = panel;\n const [field] = row;\n return (\n <Grid.Root key={field.name} gap={4}>\n <Grid.Item col={12} s={12} xs={12} direction=\"column\" alignItems=\"stretch\">\n <InputRenderer {...field} />\n </Grid.Item>\n </Grid.Root>\n );\n }\n\n return (\n <Box\n key={index}\n hasRadius\n background=\"neutral0\"\n shadow=\"tableShadow\"\n paddingLeft={6}\n paddingRight={6}\n paddingTop={6}\n paddingBottom={6}\n borderColor=\"neutral150\"\n >\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {panel.map((row, gridRowIndex) => (\n <Grid.Root key={gridRowIndex} gap={4}>\n {row.map(({ size, ...field }) => {\n return (\n <Grid.Item\n col={size}\n key={field.name}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n <InputRenderer {...field} />\n </Grid.Item>\n );\n })}\n </Grid.Root>\n ))}\n </Flex>\n </Box>\n );\n })}\n </Flex>\n );\n};\n\nexport { FormLayout, FormLayoutProps };\n","import * as React from 'react';\n\nimport {\n Page,\n Blocker,\n Form,\n useRBAC,\n useNotification,\n useQueryParams,\n} from '@strapi/admin/strapi-admin';\nimport { Grid, Main, Tabs } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useLocation, useParams } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { SINGLE_TYPES } from '../../constants/collections';\nimport { PERMISSIONS } from '../../constants/plugin';\nimport { DocumentRBAC, useDocumentRBAC } from '../../features/DocumentRBAC';\nimport { type UseDocument, useDoc } from '../../hooks/useDocument';\nimport { useDocumentLayout } from '../../hooks/useDocumentLayout';\nimport { useLazyComponents } from '../../hooks/useLazyComponents';\nimport { useOnce } from '../../hooks/useOnce';\nimport { getTranslation } from '../../utils/translations';\nimport { createYupSchema } from '../../utils/validation';\n\nimport { FormLayout } from './components/FormLayout';\nimport { Header } from './components/Header';\nimport { Panels } from './components/Panels';\nimport { transformDocument } from './utils/data';\nimport { createDefaultForm } from './utils/forms';\n\n/* -------------------------------------------------------------------------------------------------\n * EditViewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst EditViewPage = () => {\n const location = useLocation();\n const [\n {\n query: { status },\n },\n setQuery,\n ] = useQueryParams<{ status: 'draft' | 'published' }>({\n status: 'draft',\n });\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n\n const {\n document,\n meta,\n isLoading: isLoadingDocument,\n schema,\n components,\n collectionType,\n id,\n model,\n hasError,\n } = useDoc();\n\n const hasDraftAndPublished = schema?.options?.draftAndPublish ?? false;\n\n useOnce(() => {\n /**\n * We only ever want to fire the notification once otherwise\n * whenever the app re-renders it'll pop up regardless of\n * what we do because the state comes from react-router-dom\n */\n if (location?.state && 'error' in location.state) {\n toggleNotification({\n type: 'danger',\n message: location.state.error,\n timeout: 5000,\n });\n }\n });\n\n const isLoadingActionsRBAC = useDocumentRBAC('EditViewPage', (state) => state.isLoading);\n\n const isSingleType = collectionType === SINGLE_TYPES;\n\n /**\n * single-types don't current have an id, but because they're a singleton\n * we can simply use the update operation to continuously update the same\n * document with varying params.\n */\n const isCreatingDocument = !id && !isSingleType;\n\n const {\n isLoading: isLoadingLayout,\n edit: {\n layout,\n settings: { mainField },\n },\n } = useDocumentLayout(model);\n\n const { isLazyLoading } = useLazyComponents([]);\n\n const isLoading = isLoadingActionsRBAC || isLoadingDocument || isLoadingLayout || isLazyLoading;\n\n /**\n * Here we prepare the form for editing, we need to:\n * - remove prohibited fields from the document (passwords | ADD YOURS WHEN THERES A NEW ONE)\n * - swap out count objects on relations for empty arrays\n * - set __temp_key__ on array objects for drag & drop\n *\n * We also prepare the form for new documents, so we need to:\n * - set default values on fields\n */\n const initialValues = React.useMemo(() => {\n if ((!document && !isCreatingDocument && !isSingleType) || !schema) {\n return undefined;\n }\n\n /**\n * Check that we have an ID so we know the\n * document has been created in some way.\n */\n const form = document?.id ? document : createDefaultForm(schema, components);\n\n return transformDocument(schema, components)(form);\n }, [document, isCreatingDocument, isSingleType, schema, components]);\n\n if (hasError) {\n return <Page.Error />;\n }\n\n if (isLoading && !document?.documentId) {\n return <Page.Loading />;\n }\n\n if (!initialValues) {\n return <Page.Error />;\n }\n\n const handleTabChange = (status: string) => {\n if (status === 'published' || status === 'draft') {\n setQuery({ status }, 'push', true);\n }\n };\n\n /**\n * We look to see what the mainField is from the configuration,\n * if it's an id we don't use it because it's a uuid format and\n * not very user friendly. Instead in that case, we simply write \"Untitled\".\n */\n const documentTitle =\n mainField !== 'id' && document?.[mainField] ? document[mainField] : 'Untitled';\n\n return (\n <Main paddingLeft={10} paddingRight={10}>\n <Page.Title>{`${documentTitle}`}</Page.Title>\n <Form\n disabled={hasDraftAndPublished && status === 'published'}\n initialValues={initialValues}\n method={isCreatingDocument ? 'POST' : 'PUT'}\n validate={(values: Record<string, unknown>, options: Record<string, string>) => {\n const yupSchema = createYupSchema(schema?.attributes, components, {\n status,\n ...options,\n });\n\n return yupSchema.validate(values, { abortEarly: false });\n }}\n >\n {({ resetForm }) => (\n <>\n <Header\n isCreating={isCreatingDocument}\n status={hasDraftAndPublished ? getDocumentStatus(document, meta) : undefined}\n title={documentTitle}\n />\n <Tabs.Root variant=\"simple\" value={status} onValueChange={handleTabChange}>\n <Tabs.List\n aria-label={formatMessage({\n id: getTranslation('containers.edit.tabs.label'),\n defaultMessage: 'Document status',\n })}\n >\n {hasDraftAndPublished ? (\n <>\n <StatusTab value=\"draft\">\n {formatMessage({\n id: getTranslation('containers.edit.tabs.draft'),\n defaultMessage: 'draft',\n })}\n </StatusTab>\n <StatusTab\n disabled={!meta || meta.availableStatus.length === 0}\n value=\"published\"\n >\n {formatMessage({\n id: getTranslation('containers.edit.tabs.published'),\n defaultMessage: 'published',\n })}\n </StatusTab>\n </>\n ) : null}\n </Tabs.List>\n <Grid.Root paddingTop={8} gap={4}>\n <Grid.Item col={9} s={12} direction=\"column\" alignItems=\"stretch\">\n <Tabs.Content value=\"draft\">\n <FormLayout layout={layout} />\n </Tabs.Content>\n <Tabs.Content value=\"published\">\n <FormLayout layout={layout} />\n </Tabs.Content>\n </Grid.Item>\n <Grid.Item col={3} s={12} direction=\"column\" alignItems=\"stretch\">\n <Panels />\n </Grid.Item>\n </Grid.Root>\n </Tabs.Root>\n <Blocker\n // We reset the form to the published version to avoid errors like – https://strapi-inc.atlassian.net/browse/CONTENT-2284\n onProceed={resetForm}\n />\n </>\n )}\n </Form>\n </Main>\n );\n};\n\nconst StatusTab = styled(Tabs.Trigger)`\n text-transform: uppercase;\n`;\n\n/**\n * @internal\n * @description Returns the status of the document where it's latest state takes priority,\n * this typically will be \"published\" unless a user has edited their draft in which we should\n * display \"modified\".\n */\nconst getDocumentStatus = (\n document: ReturnType<UseDocument>['document'],\n meta: ReturnType<UseDocument>['meta']\n): 'draft' | 'published' | 'modified' => {\n const docStatus = document?.status;\n const statuses = meta?.availableStatus ?? [];\n\n /**\n * Creating an entry\n */\n if (!docStatus) {\n return 'draft';\n }\n\n /**\n * We're viewing a draft, but the document could have a published version\n */\n if (docStatus === 'draft' && statuses.find((doc) => doc.publishedAt !== null)) {\n return 'published';\n }\n\n return docStatus;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ProtectedEditViewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedEditViewPage = () => {\n const { slug = '' } = useParams<{\n slug: string;\n }>();\n const {\n permissions = [],\n isLoading,\n error,\n } = useRBAC(\n PERMISSIONS.map((action) => ({\n action,\n subject: slug,\n }))\n );\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !slug) {\n return <Page.Error />;\n }\n\n return (\n <Page.Protect permissions={permissions}>\n {({ permissions }) => (\n <DocumentRBAC permissions={permissions}>\n <EditViewPage />\n </DocumentRBAC>\n )}\n </Page.Protect>\n );\n};\n\nexport { EditViewPage, ProtectedEditViewPage };\n"],"names":["React","jsx","Flex","index","Grid","InputRenderer","Box","useLocation","useQueryParams","useIntl","useNotification","useDoc","useDocumentRBAC","SINGLE_TYPES","useDocumentLayout","useLazyComponents","createDefaultForm","transformDocument","Page","status","jsxs","Main","Form","createYupSchema","Fragment","Header","Tabs","getTranslation","Panels","Blocker","styled","useParams","useRBAC","PERMISSIONS","permissions","DocumentRBAC"],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