@strapi/content-manager 0.0.0-experimental.e60ec1829240dae21c1e1d29076681c322288813 → 0.0.0-experimental.f31889311d753b5f7d95198ae84d8fce1d156cd6

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 (175) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/{CardDragPreview-DSVYodBX.js → CardDragPreview-C0QyJgRA.js} +10 -14
  3. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -0
  4. package/dist/_chunks/{CardDragPreview-ikSG4M46.mjs → CardDragPreview-DOxamsuj.mjs} +7 -9
  5. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -0
  6. package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js → ComponentConfigurationPage-BNxtMIfV.js} +3 -3
  7. package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js.map → ComponentConfigurationPage-BNxtMIfV.js.map} +1 -1
  8. package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs → ComponentConfigurationPage-BWOQWCv2.mjs} +3 -3
  9. package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs.map → ComponentConfigurationPage-BWOQWCv2.mjs.map} +1 -1
  10. package/dist/_chunks/{ComponentIcon-BBQsYCVn.js → ComponentIcon-BXdiCGQp.js} +8 -2
  11. package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +1 -0
  12. package/dist/_chunks/{ComponentIcon-BOFnK76n.mjs → ComponentIcon-u4bIXTFY.mjs} +9 -3
  13. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -0
  14. package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js → EditConfigurationPage-D340bYlT.js} +3 -3
  15. package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js.map → EditConfigurationPage-D340bYlT.js.map} +1 -1
  16. package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs → EditConfigurationPage-GTp-Ucnw.mjs} +3 -3
  17. package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs.map → EditConfigurationPage-GTp-Ucnw.mjs.map} +1 -1
  18. package/dist/_chunks/{EditViewPage-DDS6H9HO.mjs → EditViewPage-BVMS5hT-.mjs} +47 -47
  19. package/dist/_chunks/EditViewPage-BVMS5hT-.mjs.map +1 -0
  20. package/dist/_chunks/{EditViewPage-DvNpQkam.js → EditViewPage-CXkmnAvI.js} +46 -48
  21. package/dist/_chunks/EditViewPage-CXkmnAvI.js.map +1 -0
  22. package/dist/_chunks/{Field-DmVKIAOo.js → Field-Ibi32diw.js} +953 -782
  23. package/dist/_chunks/Field-Ibi32diw.js.map +1 -0
  24. package/dist/_chunks/{Field-6gvGdPBV.mjs → Field-nNgv5bpd.mjs} +901 -729
  25. package/dist/_chunks/Field-nNgv5bpd.mjs.map +1 -0
  26. package/dist/_chunks/{Form-CPZC9vWa.js → Form-Dhnh34ym.js} +39 -38
  27. package/dist/_chunks/Form-Dhnh34ym.js.map +1 -0
  28. package/dist/_chunks/{Form-DW6K1IH-.mjs → Form-DodJsI2A.mjs} +39 -37
  29. package/dist/_chunks/Form-DodJsI2A.mjs.map +1 -0
  30. package/dist/_chunks/{History-DeAPlvtv.js → History-C9auUkDi.js} +149 -56
  31. package/dist/_chunks/History-C9auUkDi.js.map +1 -0
  32. package/dist/_chunks/{History-Dmr9fmUA.mjs → History-CKCSQXz_.mjs} +148 -54
  33. package/dist/_chunks/History-CKCSQXz_.mjs.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-DPCwW5Vr.js → ListConfigurationPage-Bg4rWUjX.js} +58 -59
  35. package/dist/_chunks/ListConfigurationPage-Bg4rWUjX.js.map +1 -0
  36. package/dist/_chunks/{ListConfigurationPage-DhwvYcNv.mjs → ListConfigurationPage-CKEC4ttG.mjs} +54 -54
  37. package/dist/_chunks/ListConfigurationPage-CKEC4ttG.mjs.map +1 -0
  38. package/dist/_chunks/{ListViewPage-BtAwuYLE.mjs → ListViewPage-B7_WJUjG.mjs} +93 -104
  39. package/dist/_chunks/ListViewPage-B7_WJUjG.mjs.map +1 -0
  40. package/dist/_chunks/{ListViewPage-5ySZ-VUs.js → ListViewPage-C2gIeYHG.js} +98 -109
  41. package/dist/_chunks/ListViewPage-C2gIeYHG.js.map +1 -0
  42. package/dist/_chunks/{NoContentTypePage-DSPxnxxp.mjs → NoContentTypePage-Ckem6Ll6.mjs} +3 -3
  43. package/dist/_chunks/NoContentTypePage-Ckem6Ll6.mjs.map +1 -0
  44. package/dist/_chunks/{NoContentTypePage-DOC_yWOf.js → NoContentTypePage-DqgdUfyn.js} +3 -3
  45. package/dist/_chunks/NoContentTypePage-DqgdUfyn.js.map +1 -0
  46. package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs → NoPermissionsPage-BO-GEjA4.mjs} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs.map → NoPermissionsPage-BO-GEjA4.mjs.map} +1 -1
  48. package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js → NoPermissionsPage-CF29Q-sW.js} +2 -2
  49. package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js.map → NoPermissionsPage-CF29Q-sW.js.map} +1 -1
  50. package/dist/_chunks/{Relations-CgWtgnPe.js → Relations-C0uC9J4f.js} +70 -61
  51. package/dist/_chunks/Relations-C0uC9J4f.js.map +1 -0
  52. package/dist/_chunks/{Relations-J8cscLlR.mjs → Relations-DItV5eow.mjs} +66 -56
  53. package/dist/_chunks/Relations-DItV5eow.mjs.map +1 -0
  54. package/dist/_chunks/{en-MBPul9Su.mjs → en-BrCTWlZv.mjs} +11 -4
  55. package/dist/_chunks/{en-MBPul9Su.mjs.map → en-BrCTWlZv.mjs.map} +1 -1
  56. package/dist/_chunks/{en-C-V1_90f.js → en-uOUIxfcQ.js} +11 -4
  57. package/dist/_chunks/{en-C-V1_90f.js.map → en-uOUIxfcQ.js.map} +1 -1
  58. package/dist/_chunks/{index-C6AH2hEl.js → index-Dd0nXyJF.js} +1649 -905
  59. package/dist/_chunks/index-Dd0nXyJF.js.map +1 -0
  60. package/dist/_chunks/{index-CwRRo1V9.mjs → index-DrNe6ctw.mjs} +1671 -926
  61. package/dist/_chunks/index-DrNe6ctw.mjs.map +1 -0
  62. package/dist/_chunks/{layout-jIDzX0Fp.mjs → layout-B3ez7kvr.mjs} +43 -26
  63. package/dist/_chunks/layout-B3ez7kvr.mjs.map +1 -0
  64. package/dist/_chunks/{layout-B_SXLhqf.js → layout-CLLtt_5O.js} +43 -28
  65. package/dist/_chunks/layout-CLLtt_5O.js.map +1 -0
  66. package/dist/_chunks/{relations-CuvIgCqI.mjs → relations-B0hlsUU_.mjs} +2 -2
  67. package/dist/_chunks/{relations-CuvIgCqI.mjs.map → relations-B0hlsUU_.mjs.map} +1 -1
  68. package/dist/_chunks/{relations-iBMa_OFG.js → relations-bRxcNv1q.js} +2 -2
  69. package/dist/_chunks/{relations-iBMa_OFG.js.map → relations-bRxcNv1q.js.map} +1 -1
  70. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +1 -1
  71. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +1 -1
  72. package/dist/_chunks/usePrev-B9w_-eYc.js +15 -0
  73. package/dist/_chunks/usePrev-B9w_-eYc.js.map +1 -0
  74. package/dist/_chunks/usePrev-DH6iah0A.mjs +16 -0
  75. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +1 -0
  76. package/dist/admin/index.js +2 -1
  77. package/dist/admin/index.js.map +1 -1
  78. package/dist/admin/index.mjs +5 -4
  79. package/dist/admin/src/components/ComponentIcon.d.ts +6 -3
  80. package/dist/admin/src/content-manager.d.ts +3 -3
  81. package/dist/admin/src/exports.d.ts +1 -0
  82. package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
  83. package/dist/admin/src/history/index.d.ts +3 -0
  84. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  85. package/dist/admin/src/hooks/useDocument.d.ts +5 -8
  86. package/dist/admin/src/hooks/useDocumentActions.d.ts +24 -3
  87. package/dist/admin/src/hooks/useDocumentLayout.d.ts +2 -2
  88. package/dist/admin/src/hooks/useDragAndDrop.d.ts +4 -4
  89. package/dist/admin/src/hooks/useKeyboardDragAndDrop.d.ts +1 -1
  90. package/dist/admin/src/index.d.ts +1 -0
  91. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +11 -4
  92. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.d.ts +3 -3
  93. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  94. package/dist/admin/src/pages/EditView/components/FormInputs/Component/Input.d.ts +2 -2
  95. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.d.ts +3 -5
  96. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +1 -1
  97. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +30 -18
  98. package/dist/admin/src/pages/EditView/components/FormInputs/UID.d.ts +2 -2
  99. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +3 -49
  100. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/Field.d.ts +2 -2
  101. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +59 -52
  102. package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +2 -10
  103. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  104. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  105. package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +9 -26
  106. package/dist/admin/src/services/api.d.ts +2 -3
  107. package/dist/admin/src/services/components.d.ts +2 -2
  108. package/dist/admin/src/services/contentTypes.d.ts +5 -5
  109. package/dist/admin/src/services/documents.d.ts +29 -17
  110. package/dist/admin/src/services/init.d.ts +2 -2
  111. package/dist/admin/src/services/relations.d.ts +3 -3
  112. package/dist/admin/src/services/uid.d.ts +3 -3
  113. package/dist/admin/src/utils/api.d.ts +4 -18
  114. package/dist/admin/src/utils/validation.d.ts +1 -6
  115. package/dist/server/index.js +392 -261
  116. package/dist/server/index.js.map +1 -1
  117. package/dist/server/index.mjs +400 -269
  118. package/dist/server/index.mjs.map +1 -1
  119. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  120. package/dist/server/src/controllers/single-types.d.ts.map +1 -1
  121. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  122. package/dist/server/src/controllers/utils/metadata.d.ts +8 -0
  123. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -0
  124. package/dist/server/src/controllers/validation/dimensions.d.ts +11 -0
  125. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -0
  126. package/dist/server/src/controllers/validation/index.d.ts +1 -1
  127. package/dist/server/src/history/services/history.d.ts.map +1 -1
  128. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  129. package/dist/server/src/history/services/utils.d.ts +1 -1
  130. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  131. package/dist/server/src/index.d.ts +18 -39
  132. package/dist/server/src/index.d.ts.map +1 -1
  133. package/dist/server/src/services/document-manager.d.ts +13 -12
  134. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  135. package/dist/server/src/services/document-metadata.d.ts +8 -29
  136. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  137. package/dist/server/src/services/index.d.ts +18 -39
  138. package/dist/server/src/services/index.d.ts.map +1 -1
  139. package/dist/server/src/services/utils/populate.d.ts +8 -1
  140. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  141. package/dist/shared/contracts/collection-types.d.ts +14 -6
  142. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  143. package/dist/shared/contracts/relations.d.ts +2 -2
  144. package/dist/shared/contracts/relations.d.ts.map +1 -1
  145. package/package.json +13 -14
  146. package/dist/_chunks/CardDragPreview-DSVYodBX.js.map +0 -1
  147. package/dist/_chunks/CardDragPreview-ikSG4M46.mjs.map +0 -1
  148. package/dist/_chunks/ComponentIcon-BBQsYCVn.js.map +0 -1
  149. package/dist/_chunks/ComponentIcon-BOFnK76n.mjs.map +0 -1
  150. package/dist/_chunks/EditViewPage-DDS6H9HO.mjs.map +0 -1
  151. package/dist/_chunks/EditViewPage-DvNpQkam.js.map +0 -1
  152. package/dist/_chunks/Field-6gvGdPBV.mjs.map +0 -1
  153. package/dist/_chunks/Field-DmVKIAOo.js.map +0 -1
  154. package/dist/_chunks/Form-CPZC9vWa.js.map +0 -1
  155. package/dist/_chunks/Form-DW6K1IH-.mjs.map +0 -1
  156. package/dist/_chunks/History-DeAPlvtv.js.map +0 -1
  157. package/dist/_chunks/History-Dmr9fmUA.mjs.map +0 -1
  158. package/dist/_chunks/ListConfigurationPage-DPCwW5Vr.js.map +0 -1
  159. package/dist/_chunks/ListConfigurationPage-DhwvYcNv.mjs.map +0 -1
  160. package/dist/_chunks/ListViewPage-5ySZ-VUs.js.map +0 -1
  161. package/dist/_chunks/ListViewPage-BtAwuYLE.mjs.map +0 -1
  162. package/dist/_chunks/NoContentTypePage-DOC_yWOf.js.map +0 -1
  163. package/dist/_chunks/NoContentTypePage-DSPxnxxp.mjs.map +0 -1
  164. package/dist/_chunks/Relations-CgWtgnPe.js.map +0 -1
  165. package/dist/_chunks/Relations-J8cscLlR.mjs.map +0 -1
  166. package/dist/_chunks/index-C6AH2hEl.js.map +0 -1
  167. package/dist/_chunks/index-CwRRo1V9.mjs.map +0 -1
  168. package/dist/_chunks/layout-B_SXLhqf.js.map +0 -1
  169. package/dist/_chunks/layout-jIDzX0Fp.mjs.map +0 -1
  170. package/dist/_chunks/urls-CbOsUOoW.mjs +0 -7
  171. package/dist/_chunks/urls-CbOsUOoW.mjs.map +0 -1
  172. package/dist/_chunks/urls-DzZya_gm.js +0 -6
  173. package/dist/_chunks/urls-DzZya_gm.js.map +0 -1
  174. package/dist/server/src/controllers/utils/dimensions.d.ts +0 -5
  175. package/dist/server/src/controllers/utils/dimensions.d.ts.map +0 -1
@@ -1,17 +1,17 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { useForm, useStrapiApp, InputRenderer, useField, Form, Layouts, useNotification, useQueryParams, useRBAC, ConfirmDialog, createContext, Page } from "@strapi/admin/strapi-admin";
4
- import { Alert, Link, Flex, FieldLabel, Box, Tooltip, Divider, Typography, Grid, GridItem, Button, Portal, FocusTrap, Main } from "@strapi/design-system";
4
+ import { Alert, Link, Flex, Field, Box, Tooltip, Divider, Typography, Grid, Dialog, Button, Portal, FocusTrap, Main } from "@strapi/design-system";
5
5
  import { stringify } from "qs";
6
6
  import { useIntl } from "react-intl";
7
7
  import { NavLink, useNavigate, useParams, Link as Link$1, Navigate } from "react-router-dom";
8
- import { b as useDoc, e as useDocumentRBAC, m as useDocLayout, C as COLLECTION_TYPES, D as DocumentStatus, d as contentManagerApi, j as PERMISSIONS, t as getDisplayName, R as RelativeTime, k as DocumentRBAC, G as useDocument, f as useDocumentLayout, o as useGetContentTypeConfigurationQuery, c as buildValidParams } from "./index-CwRRo1V9.mjs";
8
+ import { c as useDoc, f as useDocumentRBAC, n as useDocLayout, C as COLLECTION_TYPES, D as DocumentStatus, e as contentManagerApi, k as PERMISSIONS, r as getDisplayName, R as RelativeTime, l as DocumentRBAC, G as useDocument, h as useDocumentLayout, o as useGetContentTypeConfigurationQuery, d as buildValidParams } from "./index-DrNe6ctw.mjs";
9
9
  import pipe from "lodash/fp/pipe";
10
10
  import { u as useTypedSelector } from "./hooks-E5u1mcgM.mjs";
11
- import { a as useDynamicZone, u as useLazyComponents, b as useFieldHint, N as NotAllowedInput, U as UIDInput, W as Wysiwyg, D as DynamicZone, C as ComponentInput, B as BlocksInput, r as removeFieldsThatDontExistOnSchema, p as prepareTempKeys } from "./Field-6gvGdPBV.mjs";
11
+ import { a as useDynamicZone, u as useLazyComponents, b as useFieldHint, N as NotAllowedInput, d as MemoizedUIDInput, e as MemoizedWysiwyg, D as DynamicZone, f as MemoizedComponentInput, g as MemoizedBlocksInput, r as removeFieldsThatDontExistOnSchema, p as prepareTempKeys } from "./Field-nNgv5bpd.mjs";
12
12
  import { ArrowLeft, WarningCircle } from "@strapi/icons";
13
- import styled from "styled-components";
14
- import { g as getRelationLabel } from "./relations-CuvIgCqI.mjs";
13
+ import { styled } from "styled-components";
14
+ import { g as getRelationLabel } from "./relations-B0hlsUU_.mjs";
15
15
  const StyledAlert = styled(Alert).attrs({ closeLabel: "Close", onClose: () => {
16
16
  } })`
17
17
  button {
@@ -31,13 +31,13 @@ const LinkEllipsis = styled(Link)`
31
31
  const CustomRelationInput = (props) => {
32
32
  const { formatMessage } = useIntl();
33
33
  const field = useField(props.name);
34
- const formattedFieldValue = Array.isArray(field.value) ? {
35
- results: field.value,
36
- meta: { missingCount: 0 }
37
- } : field.value;
38
- if (!formattedFieldValue || formattedFieldValue.results.length === 0) {
34
+ let formattedFieldValue;
35
+ if (field) {
36
+ formattedFieldValue = Array.isArray(field.value) ? { results: field.value, meta: { missingCount: 0 } } : field.value;
37
+ }
38
+ if (!formattedFieldValue || formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0) {
39
39
  return /* @__PURE__ */ jsxs(Fragment, { children: [
40
- /* @__PURE__ */ jsx(FieldLabel, { children: props.label }),
40
+ /* @__PURE__ */ jsx(Field.Label, { action: props.labelAction, children: props.label }),
41
41
  /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(StyledAlert, { variant: "default", children: formatMessage({
42
42
  id: "content-manager.history.content.no-relations",
43
43
  defaultMessage: "No relations."
@@ -46,7 +46,7 @@ const CustomRelationInput = (props) => {
46
46
  }
47
47
  const { results, meta } = formattedFieldValue;
48
48
  return /* @__PURE__ */ jsxs(Box, { children: [
49
- /* @__PURE__ */ jsx(FieldLabel, { children: props.label }),
49
+ /* @__PURE__ */ jsx(Field.Label, { children: props.label }),
50
50
  results.length > 0 && /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 2, marginTop: 1, alignItems: "stretch", children: results.map((relationData) => {
51
51
  const href = `../${COLLECTION_TYPES}/${props.attribute.targetModel}/${relationData.documentId}`;
52
52
  const label = getRelationLabel(relationData, props.mainField);
@@ -62,14 +62,15 @@ const CustomRelationInput = (props) => {
62
62
  background: "neutral150",
63
63
  justifyContent: "space-between",
64
64
  children: [
65
- /* @__PURE__ */ jsx(Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsx(Tooltip, { description: label, children: /* @__PURE__ */ jsx(LinkEllipsis, { forwardedAs: NavLink, to: href, children: label }) }) }),
65
+ /* @__PURE__ */ jsx(Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsx(Tooltip, { description: label, children: /* @__PURE__ */ jsx(LinkEllipsis, { tag: NavLink, to: href, children: label }) }) }),
66
66
  /* @__PURE__ */ jsx(DocumentStatus, { status: relationData.status })
67
67
  ]
68
68
  },
69
69
  relationData.documentId
70
70
  );
71
71
  }) }),
72
- meta.missingCount > 0 && /* @__PURE__ */ jsx(
72
+ meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
73
+ /* @__PURE__ */ jsx(
73
74
  StyledAlert,
74
75
  {
75
76
  marginTop: 1,
@@ -89,17 +90,13 @@ const CustomRelationInput = (props) => {
89
90
  { number: meta.missingCount }
90
91
  )
91
92
  }
92
- ),
93
- results.length === 0 && meta.missingCount === 0 && /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(StyledAlert, { variant: "default", children: formatMessage({
94
- id: "content-manager.history.content.no-relations",
95
- defaultMessage: "No relations."
96
- }) }) })
93
+ )
97
94
  ] });
98
95
  };
99
96
  const CustomMediaInput = (props) => {
100
- const {
101
- value: { results, meta }
102
- } = useField(props.name);
97
+ const { value } = useField(props.name);
98
+ const results = value ? value.results : [];
99
+ const meta = value ? value.meta : { missingCount: 0 };
103
100
  const { formatMessage } = useIntl();
104
101
  const fields = useStrapiApp("CustomMediaInput", (state) => state.fields);
105
102
  const MediaLibrary = fields.media;
@@ -130,12 +127,39 @@ const CustomMediaInput = (props) => {
130
127
  )
131
128
  ] });
132
129
  };
130
+ const getLabelAction = (labelAction) => {
131
+ if (!React.isValidElement(labelAction)) {
132
+ return labelAction;
133
+ }
134
+ const labelActionTitleId = labelAction.props.title.id;
135
+ if (labelActionTitleId === "i18n.Field.localized") {
136
+ return React.cloneElement(labelAction, {
137
+ ...labelAction.props,
138
+ title: {
139
+ id: "history.content.localized",
140
+ defaultMessage: "This value is specific to this locale. If you restore this version, the content will not be replaced for other locales."
141
+ }
142
+ });
143
+ }
144
+ if (labelActionTitleId === "i18n.Field.not-localized") {
145
+ return React.cloneElement(labelAction, {
146
+ ...labelAction.props,
147
+ title: {
148
+ id: "history.content.not-localized",
149
+ defaultMessage: "This value is common to all locales. If you restore this version and save the changes, the content will be replaced for all locales."
150
+ }
151
+ });
152
+ }
153
+ return labelAction;
154
+ };
133
155
  const VersionInputRenderer = ({
134
156
  visible,
135
157
  hint: providedHint,
136
158
  shouldIgnoreRBAC = false,
159
+ labelAction,
137
160
  ...props
138
161
  }) => {
162
+ const customLabelAction = getLabelAction(labelAction);
139
163
  const { formatMessage } = useIntl();
140
164
  const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
141
165
  const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
@@ -169,7 +193,7 @@ const VersionInputRenderer = ({
169
193
  const addedAttributes = version.meta.unknownAttributes.added;
170
194
  if (Object.keys(addedAttributes).includes(props.name)) {
171
195
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
172
- /* @__PURE__ */ jsx(FieldLabel, { children: props.label }),
196
+ /* @__PURE__ */ jsx(Field.Label, { children: props.label }),
173
197
  /* @__PURE__ */ jsx(
174
198
  StyledAlert,
175
199
  {
@@ -193,29 +217,46 @@ const VersionInputRenderer = ({
193
217
  if (attributeHasCustomFieldProperty(props.attribute)) {
194
218
  const CustomInput = lazyComponentStore[props.attribute.customField];
195
219
  if (CustomInput) {
196
- return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
220
+ return /* @__PURE__ */ jsx(
221
+ CustomInput,
222
+ {
223
+ ...props,
224
+ hint,
225
+ labelAction: customLabelAction,
226
+ disabled: fieldIsDisabled
227
+ }
228
+ );
197
229
  }
198
230
  return /* @__PURE__ */ jsx(
199
231
  InputRenderer,
200
232
  {
201
233
  ...props,
202
234
  hint,
235
+ labelAction: customLabelAction,
203
236
  type: props.attribute.customField,
204
237
  disabled: fieldIsDisabled
205
238
  }
206
239
  );
207
240
  }
208
241
  if (props.type === "media") {
209
- return /* @__PURE__ */ jsx(CustomMediaInput, { ...props, disabled: fieldIsDisabled });
242
+ return /* @__PURE__ */ jsx(CustomMediaInput, { ...props, labelAction: customLabelAction, disabled: fieldIsDisabled });
210
243
  }
211
244
  const addedInputTypes = Object.keys(fields);
212
245
  if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {
213
246
  const CustomInput = fields[props.type];
214
- return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
247
+ return /* @__PURE__ */ jsx(
248
+ CustomInput,
249
+ {
250
+ ...props,
251
+ hint,
252
+ labelAction: customLabelAction,
253
+ disabled: fieldIsDisabled
254
+ }
255
+ );
215
256
  }
216
257
  switch (props.type) {
217
258
  case "blocks":
218
- return /* @__PURE__ */ jsx(BlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
259
+ return /* @__PURE__ */ jsx(MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
219
260
  case "component":
220
261
  const { layout } = componentsLayout[props.attribute.component];
221
262
  const [remainingFieldsLayout] = getRemaingFieldsLayout({
@@ -225,29 +266,65 @@ const VersionInputRenderer = ({
225
266
  schemaAttributes: components[props.attribute.component].attributes
226
267
  });
227
268
  return /* @__PURE__ */ jsx(
228
- ComponentInput,
269
+ MemoizedComponentInput,
229
270
  {
230
271
  ...props,
231
272
  layout: [...layout, ...remainingFieldsLayout || []],
232
273
  hint,
274
+ labelAction: customLabelAction,
233
275
  disabled: fieldIsDisabled,
234
276
  children: (inputProps) => /* @__PURE__ */ jsx(VersionInputRenderer, { ...inputProps, shouldIgnoreRBAC: true })
235
277
  }
236
278
  );
237
279
  case "dynamiczone":
238
- return /* @__PURE__ */ jsx(DynamicZone, { ...props, hint, disabled: fieldIsDisabled });
280
+ return /* @__PURE__ */ jsx(
281
+ DynamicZone,
282
+ {
283
+ ...props,
284
+ hint,
285
+ labelAction: customLabelAction,
286
+ disabled: fieldIsDisabled
287
+ }
288
+ );
239
289
  case "relation":
240
- return /* @__PURE__ */ jsx(CustomRelationInput, { ...props, hint, disabled: fieldIsDisabled });
290
+ return /* @__PURE__ */ jsx(
291
+ CustomRelationInput,
292
+ {
293
+ ...props,
294
+ hint,
295
+ labelAction: customLabelAction,
296
+ disabled: fieldIsDisabled
297
+ }
298
+ );
241
299
  case "richtext":
242
- return /* @__PURE__ */ jsx(Wysiwyg, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
300
+ return /* @__PURE__ */ jsx(
301
+ MemoizedWysiwyg,
302
+ {
303
+ ...props,
304
+ hint,
305
+ type: props.type,
306
+ labelAction: customLabelAction,
307
+ disabled: fieldIsDisabled
308
+ }
309
+ );
243
310
  case "uid":
244
- return /* @__PURE__ */ jsx(UIDInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
311
+ return /* @__PURE__ */ jsx(
312
+ MemoizedUIDInput,
313
+ {
314
+ ...props,
315
+ hint,
316
+ type: props.type,
317
+ labelAction: customLabelAction,
318
+ disabled: fieldIsDisabled
319
+ }
320
+ );
245
321
  case "enumeration":
246
322
  return /* @__PURE__ */ jsx(
247
323
  InputRenderer,
248
324
  {
249
325
  ...props,
250
326
  hint,
327
+ labelAction: customLabelAction,
251
328
  options: props.attribute.enum.map((value) => ({ value })),
252
329
  type: props.customField ? "custom-field" : props.type,
253
330
  disabled: fieldIsDisabled
@@ -260,6 +337,7 @@ const VersionInputRenderer = ({
260
337
  {
261
338
  ...restProps,
262
339
  hint,
340
+ labelAction: customLabelAction,
263
341
  type: props.customField ? "custom-field" : props.type,
264
342
  disabled: fieldIsDisabled
265
343
  }
@@ -313,7 +391,7 @@ const FormPanel = ({ panel }) => {
313
391
  if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
314
392
  const [row] = panel;
315
393
  const [field] = row;
316
- return /* @__PURE__ */ jsx(Grid, { gap: 4, children: /* @__PURE__ */ jsx(GridItem, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field }) }) }, field.name);
394
+ return /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: /* @__PURE__ */ jsx(Grid.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field }) }) }, field.name);
317
395
  }
318
396
  return /* @__PURE__ */ jsx(
319
397
  Box,
@@ -326,8 +404,8 @@ const FormPanel = ({ panel }) => {
326
404
  paddingTop: 6,
327
405
  paddingBottom: 6,
328
406
  borderColor: "neutral150",
329
- children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsx(Grid, { gap: 4, children: row.map(({ size, ...field }) => {
330
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field }) }, field.name);
407
+ children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
408
+ return /* @__PURE__ */ jsx(Grid.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field }) }, field.name);
331
409
  }) }, gridRowIndex)) })
332
410
  }
333
411
  );
@@ -459,12 +537,12 @@ const VersionHeader = ({ headerId }) => {
459
537
  const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
460
538
  if (collectionType === COLLECTION_TYPES) {
461
539
  return {
462
- pathname: `/content-manager/${collectionType}/${version.contentType}/${version.relatedDocumentId}`,
540
+ pathname: "..",
463
541
  search: pluginsQueryParams
464
542
  };
465
543
  }
466
544
  return {
467
- pathname: `/content-manager/${collectionType}/${version.contentType}`,
545
+ pathname: "..",
468
546
  search: pluginsQueryParams
469
547
  };
470
548
  };
@@ -480,7 +558,7 @@ const VersionHeader = ({ headerId }) => {
480
558
  body: { contentType: version.contentType }
481
559
  });
482
560
  if ("data" in response) {
483
- navigate(getNextNavigation());
561
+ navigate(getNextNavigation(), { relative: "path" });
484
562
  toggleNotification({
485
563
  type: "success",
486
564
  title: formatMessage({
@@ -509,7 +587,7 @@ const VersionHeader = ({ headerId }) => {
509
587
  });
510
588
  }
511
589
  };
512
- return /* @__PURE__ */ jsxs(Fragment, { children: [
590
+ return /* @__PURE__ */ jsxs(Dialog.Root, { open: isConfirmDialogOpen, onOpenChange: setIsConfirmDialogOpen, children: [
513
591
  /* @__PURE__ */ jsx(
514
592
  Layouts.BaseHeader,
515
593
  {
@@ -536,8 +614,10 @@ const VersionHeader = ({ headerId }) => {
536
614
  Link,
537
615
  {
538
616
  startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
539
- as: NavLink,
617
+ tag: NavLink,
540
618
  to: getNextNavigation(),
619
+ relative: "path",
620
+ isExternal: false,
541
621
  children: formatMessage({
542
622
  id: "global.back",
543
623
  defaultMessage: "Back"
@@ -545,7 +625,7 @@ const VersionHeader = ({ headerId }) => {
545
625
  }
546
626
  ),
547
627
  sticky: false,
548
- primaryAction: /* @__PURE__ */ jsx(
628
+ primaryAction: /* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(
549
629
  Button,
550
630
  {
551
631
  disabled: !allowedActions.canUpdate || isCurrentVersion,
@@ -557,16 +637,13 @@ const VersionHeader = ({ headerId }) => {
557
637
  defaultMessage: "Restore"
558
638
  })
559
639
  }
560
- )
640
+ ) })
561
641
  }
562
642
  ),
563
643
  /* @__PURE__ */ jsx(
564
644
  ConfirmDialog,
565
645
  {
566
- isOpen: isConfirmDialogOpen,
567
- onClose: () => setIsConfirmDialogOpen(false),
568
646
  onConfirm: handleRestore,
569
- icon: /* @__PURE__ */ jsx(WarningCircle, {}),
570
647
  endAction: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: handleRestore, loading: isLoading, children: formatMessage({
571
648
  id: "content-manager.history.restore.confirm.button",
572
649
  defaultMessage: "Restore"
@@ -580,6 +657,7 @@ const VersionHeader = ({ headerId }) => {
580
657
  gap: 2,
581
658
  textAlign: "center",
582
659
  children: [
660
+ /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
583
661
  /* @__PURE__ */ jsx(Typography, { children: formatMessage({
584
662
  id: "content-manager.history.restore.confirm.title",
585
663
  defaultMessage: "Are you sure you want to restore this version?"
@@ -652,23 +730,24 @@ const VersionCard = ({ version, isCurrent }) => {
652
730
  borderWidth: "1px",
653
731
  borderStyle: "solid",
654
732
  borderColor: isActive ? "primary600" : "neutral200",
733
+ color: "neutral800",
655
734
  paddingTop: 4,
656
735
  paddingBottom: 4,
657
736
  paddingLeft: 5,
658
737
  paddingRight: 5,
659
- as: Link$1,
738
+ tag: Link$1,
660
739
  to: `?${stringify({ ...query, id: version.id })}`,
661
740
  style: { textDecoration: "none" },
662
741
  children: [
663
742
  /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
664
- /* @__PURE__ */ jsx(Typography, { as: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
743
+ /* @__PURE__ */ jsx(Typography, { tag: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
665
744
  day: "numeric",
666
745
  month: "numeric",
667
746
  year: "numeric",
668
747
  hour: "2-digit",
669
748
  minute: "2-digit"
670
749
  }) }),
671
- /* @__PURE__ */ jsx(Typography, { as: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
750
+ /* @__PURE__ */ jsx(Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
672
751
  {
673
752
  id: "content-manager.history.sidebar.versionDescription",
674
753
  defaultMessage: "{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}"
@@ -724,7 +803,7 @@ const VersionsList = () => {
724
803
  borderColor: "neutral200",
725
804
  borderWidth: "0 0 0 1px",
726
805
  borderStyle: "solid",
727
- as: "aside",
806
+ tag: "aside",
728
807
  children: [
729
808
  /* @__PURE__ */ jsxs(
730
809
  Flex,
@@ -735,9 +814,9 @@ const VersionsList = () => {
735
814
  borderColor: "neutral200",
736
815
  borderWidth: "0 0 1px",
737
816
  borderStyle: "solid",
738
- as: "header",
817
+ tag: "header",
739
818
  children: [
740
- /* @__PURE__ */ jsx(Typography, { as: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
819
+ /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
741
820
  id: "content-manager.history.sidebar.title",
742
821
  defaultMessage: "Versions"
743
822
  }) }),
@@ -759,7 +838,7 @@ const VersionsList = () => {
759
838
  paddingBottom: 5,
760
839
  paddingLeft: 4,
761
840
  paddingRight: 4,
762
- as: "ul",
841
+ tag: "ul",
763
842
  alignItems: "stretch",
764
843
  children: versions.data.map((version, index) => /* @__PURE__ */ jsx(
765
844
  "li",
@@ -826,7 +905,22 @@ const HistoryPage = () => {
826
905
  return /* @__PURE__ */ jsx(Page.Loading, {});
827
906
  }
828
907
  if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
829
- return /* @__PURE__ */ jsx(Page.NoData, {});
908
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
909
+ Page.NoData,
910
+ {
911
+ action: /* @__PURE__ */ jsx(
912
+ Link,
913
+ {
914
+ tag: NavLink,
915
+ to: `/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ""}`,
916
+ children: formatMessage({
917
+ id: "global.back",
918
+ defaultMessage: "Back"
919
+ })
920
+ }
921
+ )
922
+ }
923
+ ) });
830
924
  }
831
925
  if (versionsResponse.data?.data?.length && !selectedVersionId) {
832
926
  return /* @__PURE__ */ jsx(
@@ -935,4 +1029,4 @@ export {
935
1029
  ProtectedHistoryPage,
936
1030
  useHistoryContext
937
1031
  };
938
- //# sourceMappingURL=History-Dmr9fmUA.mjs.map
1032
+ //# sourceMappingURL=History-CKCSQXz_.mjs.map