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

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 (180) 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-BPvzFjM7.mjs → ComponentConfigurationPage-CpBFh6_r.mjs} +3 -3
  7. package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs.map → ComponentConfigurationPage-CpBFh6_r.mjs.map} +1 -1
  8. package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js → ComponentConfigurationPage-_zF8p6CY.js} +3 -3
  9. package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js.map → ComponentConfigurationPage-_zF8p6CY.js.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-DacbqQ_f.mjs → EditConfigurationPage-CE_yavTi.mjs} +3 -3
  15. package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs.map → EditConfigurationPage-CE_yavTi.mjs.map} +1 -1
  16. package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js → EditConfigurationPage-_aG2DJSU.js} +3 -3
  17. package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js.map → EditConfigurationPage-_aG2DJSU.js.map} +1 -1
  18. package/dist/_chunks/{EditViewPage-DDS6H9HO.mjs → EditViewPage-DeTn7rAF.mjs} +59 -48
  19. package/dist/_chunks/EditViewPage-DeTn7rAF.mjs.map +1 -0
  20. package/dist/_chunks/{EditViewPage-DvNpQkam.js → EditViewPage-G9uNzwYL.js} +58 -49
  21. package/dist/_chunks/EditViewPage-G9uNzwYL.js.map +1 -0
  22. package/dist/_chunks/{Field-6gvGdPBV.mjs → Field-CnCKhI1R.mjs} +995 -795
  23. package/dist/_chunks/Field-CnCKhI1R.mjs.map +1 -0
  24. package/dist/_chunks/{Field-DmVKIAOo.js → Field-DDHUWEfV.js} +1041 -842
  25. package/dist/_chunks/Field-DDHUWEfV.js.map +1 -0
  26. package/dist/_chunks/{Form-CPZC9vWa.js → Form-DYETaKUX.js} +65 -45
  27. package/dist/_chunks/Form-DYETaKUX.js.map +1 -0
  28. package/dist/_chunks/{Form-DW6K1IH-.mjs → Form-IvVVwqRL.mjs} +65 -44
  29. package/dist/_chunks/Form-IvVVwqRL.mjs.map +1 -0
  30. package/dist/_chunks/{History-Dmr9fmUA.mjs → History-BMunT-do.mjs} +148 -54
  31. package/dist/_chunks/History-BMunT-do.mjs.map +1 -0
  32. package/dist/_chunks/{History-DeAPlvtv.js → History-CnZDctSO.js} +149 -56
  33. package/dist/_chunks/History-CnZDctSO.js.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-DPCwW5Vr.js → ListConfigurationPage-BynalOp8.js} +67 -58
  35. package/dist/_chunks/ListConfigurationPage-BynalOp8.js.map +1 -0
  36. package/dist/_chunks/{ListConfigurationPage-DhwvYcNv.mjs → ListConfigurationPage-CDqkCxgV.mjs} +63 -53
  37. package/dist/_chunks/ListConfigurationPage-CDqkCxgV.mjs.map +1 -0
  38. package/dist/_chunks/{ListViewPage-5ySZ-VUs.js → ListViewPage-I88Ouzoq.js} +126 -137
  39. package/dist/_chunks/ListViewPage-I88Ouzoq.js.map +1 -0
  40. package/dist/_chunks/{ListViewPage-BtAwuYLE.mjs → ListViewPage-_5gS-DOF.mjs} +123 -134
  41. package/dist/_chunks/ListViewPage-_5gS-DOF.mjs.map +1 -0
  42. package/dist/_chunks/{NoContentTypePage-DOC_yWOf.js → NoContentTypePage-BaWQ7HsA.js} +3 -3
  43. package/dist/_chunks/NoContentTypePage-BaWQ7HsA.js.map +1 -0
  44. package/dist/_chunks/{NoContentTypePage-DSPxnxxp.mjs → NoContentTypePage-Dht-55hr.mjs} +3 -3
  45. package/dist/_chunks/NoContentTypePage-Dht-55hr.mjs.map +1 -0
  46. package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs → NoPermissionsPage-Bs8D5W_v.mjs} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs.map → NoPermissionsPage-Bs8D5W_v.mjs.map} +1 -1
  48. package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js → NoPermissionsPage-DCVUh5at.js} +2 -2
  49. package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js.map → NoPermissionsPage-DCVUh5at.js.map} +1 -1
  50. package/dist/_chunks/{Relations-CgWtgnPe.js → Relations-BPgFQeGj.js} +71 -62
  51. package/dist/_chunks/Relations-BPgFQeGj.js.map +1 -0
  52. package/dist/_chunks/{Relations-J8cscLlR.mjs → Relations-Chdt5qWc.mjs} +67 -57
  53. package/dist/_chunks/Relations-Chdt5qWc.mjs.map +1 -0
  54. package/dist/_chunks/{en-C-V1_90f.js → en-BVzUkPxZ.js} +16 -8
  55. package/dist/_chunks/{en-C-V1_90f.js.map → en-BVzUkPxZ.js.map} +1 -1
  56. package/dist/_chunks/{en-MBPul9Su.mjs → en-CPTj6CjC.mjs} +16 -8
  57. package/dist/_chunks/{en-MBPul9Su.mjs.map → en-CPTj6CjC.mjs.map} +1 -1
  58. package/dist/_chunks/{index-C6AH2hEl.js → index-BhbLFX4l.js} +1752 -903
  59. package/dist/_chunks/index-BhbLFX4l.js.map +1 -0
  60. package/dist/_chunks/{index-CwRRo1V9.mjs → index-D4UGPFZC.mjs} +1778 -928
  61. package/dist/_chunks/index-D4UGPFZC.mjs.map +1 -0
  62. package/dist/_chunks/{layout-B_SXLhqf.js → layout-CYA7s0qO.js} +45 -29
  63. package/dist/_chunks/layout-CYA7s0qO.js.map +1 -0
  64. package/dist/_chunks/{layout-jIDzX0Fp.mjs → layout-D4HI4_PS.mjs} +45 -27
  65. package/dist/_chunks/layout-D4HI4_PS.mjs.map +1 -0
  66. package/dist/_chunks/{relations-CuvIgCqI.mjs → relations-1pXaYpBK.mjs} +2 -2
  67. package/dist/_chunks/{relations-CuvIgCqI.mjs.map → relations-1pXaYpBK.mjs.map} +1 -1
  68. package/dist/_chunks/{relations-iBMa_OFG.js → relations-DDZ9OxNo.js} +2 -2
  69. package/dist/_chunks/{relations-iBMa_OFG.js.map → relations-DDZ9OxNo.js.map} +1 -1
  70. package/dist/_chunks/useDebounce-CtcjDB3L.js +28 -0
  71. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  72. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  73. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  74. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +1 -1
  75. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +1 -1
  76. package/dist/admin/index.js +2 -1
  77. package/dist/admin/index.js.map +1 -1
  78. package/dist/admin/index.mjs +8 -7
  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/WysiwygFooter.d.ts +2 -2
  102. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +16 -53
  103. package/dist/admin/src/pages/EditView/components/Header.d.ts +10 -11
  104. package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +2 -10
  105. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  106. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  107. package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +9 -26
  108. package/dist/admin/src/services/api.d.ts +2 -3
  109. package/dist/admin/src/services/components.d.ts +2 -2
  110. package/dist/admin/src/services/contentTypes.d.ts +5 -5
  111. package/dist/admin/src/services/documents.d.ts +31 -17
  112. package/dist/admin/src/services/init.d.ts +2 -2
  113. package/dist/admin/src/services/relations.d.ts +3 -3
  114. package/dist/admin/src/services/uid.d.ts +3 -3
  115. package/dist/admin/src/utils/api.d.ts +4 -18
  116. package/dist/admin/src/utils/validation.d.ts +5 -7
  117. package/dist/server/index.js +436 -281
  118. package/dist/server/index.js.map +1 -1
  119. package/dist/server/index.mjs +444 -289
  120. package/dist/server/index.mjs.map +1 -1
  121. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  122. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  123. package/dist/server/src/controllers/single-types.d.ts.map +1 -1
  124. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  125. package/dist/server/src/controllers/utils/metadata.d.ts +8 -0
  126. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -0
  127. package/dist/server/src/controllers/validation/dimensions.d.ts +11 -0
  128. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -0
  129. package/dist/server/src/controllers/validation/index.d.ts +1 -1
  130. package/dist/server/src/history/services/history.d.ts.map +1 -1
  131. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  132. package/dist/server/src/history/services/utils.d.ts +2 -1
  133. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  134. package/dist/server/src/index.d.ts +18 -39
  135. package/dist/server/src/index.d.ts.map +1 -1
  136. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  137. package/dist/server/src/services/document-manager.d.ts +13 -12
  138. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  139. package/dist/server/src/services/document-metadata.d.ts +8 -29
  140. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  141. package/dist/server/src/services/index.d.ts +18 -39
  142. package/dist/server/src/services/index.d.ts.map +1 -1
  143. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  144. package/dist/server/src/services/utils/populate.d.ts +8 -1
  145. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  146. package/dist/shared/contracts/collection-types.d.ts +17 -7
  147. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  148. package/dist/shared/contracts/relations.d.ts +2 -2
  149. package/dist/shared/contracts/relations.d.ts.map +1 -1
  150. package/package.json +14 -15
  151. package/dist/_chunks/CardDragPreview-DSVYodBX.js.map +0 -1
  152. package/dist/_chunks/CardDragPreview-ikSG4M46.mjs.map +0 -1
  153. package/dist/_chunks/ComponentIcon-BBQsYCVn.js.map +0 -1
  154. package/dist/_chunks/ComponentIcon-BOFnK76n.mjs.map +0 -1
  155. package/dist/_chunks/EditViewPage-DDS6H9HO.mjs.map +0 -1
  156. package/dist/_chunks/EditViewPage-DvNpQkam.js.map +0 -1
  157. package/dist/_chunks/Field-6gvGdPBV.mjs.map +0 -1
  158. package/dist/_chunks/Field-DmVKIAOo.js.map +0 -1
  159. package/dist/_chunks/Form-CPZC9vWa.js.map +0 -1
  160. package/dist/_chunks/Form-DW6K1IH-.mjs.map +0 -1
  161. package/dist/_chunks/History-DeAPlvtv.js.map +0 -1
  162. package/dist/_chunks/History-Dmr9fmUA.mjs.map +0 -1
  163. package/dist/_chunks/ListConfigurationPage-DPCwW5Vr.js.map +0 -1
  164. package/dist/_chunks/ListConfigurationPage-DhwvYcNv.mjs.map +0 -1
  165. package/dist/_chunks/ListViewPage-5ySZ-VUs.js.map +0 -1
  166. package/dist/_chunks/ListViewPage-BtAwuYLE.mjs.map +0 -1
  167. package/dist/_chunks/NoContentTypePage-DOC_yWOf.js.map +0 -1
  168. package/dist/_chunks/NoContentTypePage-DSPxnxxp.mjs.map +0 -1
  169. package/dist/_chunks/Relations-CgWtgnPe.js.map +0 -1
  170. package/dist/_chunks/Relations-J8cscLlR.mjs.map +0 -1
  171. package/dist/_chunks/index-C6AH2hEl.js.map +0 -1
  172. package/dist/_chunks/index-CwRRo1V9.mjs.map +0 -1
  173. package/dist/_chunks/layout-B_SXLhqf.js.map +0 -1
  174. package/dist/_chunks/layout-jIDzX0Fp.mjs.map +0 -1
  175. package/dist/_chunks/urls-CbOsUOoW.mjs +0 -7
  176. package/dist/_chunks/urls-CbOsUOoW.mjs.map +0 -1
  177. package/dist/_chunks/urls-DzZya_gm.js +0 -6
  178. package/dist/_chunks/urls-DzZya_gm.js.map +0 -1
  179. package/dist/server/src/controllers/utils/dimensions.d.ts +0 -5
  180. package/dist/server/src/controllers/utils/dimensions.d.ts.map +0 -1
@@ -7,13 +7,13 @@ const designSystem = require("@strapi/design-system");
7
7
  const qs = require("qs");
8
8
  const reactIntl = require("react-intl");
9
9
  const reactRouterDom = require("react-router-dom");
10
- const index = require("./index-C6AH2hEl.js");
10
+ const index = require("./index-BhbLFX4l.js");
11
11
  const pipe = require("lodash/fp/pipe");
12
12
  const hooks = require("./hooks-BAaaKPS_.js");
13
- const Field = require("./Field-DmVKIAOo.js");
13
+ const Field = require("./Field-DDHUWEfV.js");
14
14
  const Icons = require("@strapi/icons");
15
- const styled = require("styled-components");
16
- const relations = require("./relations-iBMa_OFG.js");
15
+ const styledComponents = require("styled-components");
16
+ const relations = require("./relations-DDZ9OxNo.js");
17
17
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
18
18
  function _interopNamespace(e) {
19
19
  if (e && e.__esModule)
@@ -35,14 +35,13 @@ function _interopNamespace(e) {
35
35
  }
36
36
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
37
37
  const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
38
- const styled__default = /* @__PURE__ */ _interopDefault(styled);
39
- const StyledAlert = styled__default.default(designSystem.Alert).attrs({ closeLabel: "Close", onClose: () => {
38
+ const StyledAlert = styledComponents.styled(designSystem.Alert).attrs({ closeLabel: "Close", onClose: () => {
40
39
  } })`
41
40
  button {
42
41
  display: none;
43
42
  }
44
43
  `;
45
- const LinkEllipsis = styled__default.default(designSystem.Link)`
44
+ const LinkEllipsis = styledComponents.styled(designSystem.Link)`
46
45
  display: block;
47
46
 
48
47
  & > span {
@@ -55,13 +54,13 @@ const LinkEllipsis = styled__default.default(designSystem.Link)`
55
54
  const CustomRelationInput = (props) => {
56
55
  const { formatMessage } = reactIntl.useIntl();
57
56
  const field = strapiAdmin.useField(props.name);
58
- const formattedFieldValue = Array.isArray(field.value) ? {
59
- results: field.value,
60
- meta: { missingCount: 0 }
61
- } : field.value;
62
- if (!formattedFieldValue || formattedFieldValue.results.length === 0) {
57
+ let formattedFieldValue;
58
+ if (field) {
59
+ formattedFieldValue = Array.isArray(field.value) ? { results: field.value, meta: { missingCount: 0 } } : field.value;
60
+ }
61
+ if (!formattedFieldValue || formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0) {
63
62
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
64
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.FieldLabel, { children: props.label }),
63
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: props.labelAction, children: props.label }),
65
64
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(StyledAlert, { variant: "default", children: formatMessage({
66
65
  id: "content-manager.history.content.no-relations",
67
66
  defaultMessage: "No relations."
@@ -70,7 +69,7 @@ const CustomRelationInput = (props) => {
70
69
  }
71
70
  const { results, meta } = formattedFieldValue;
72
71
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
73
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.FieldLabel, { children: props.label }),
72
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: props.label }),
74
73
  results.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 2, marginTop: 1, alignItems: "stretch", children: results.map((relationData) => {
75
74
  const href = `../${index.COLLECTION_TYPES}/${props.attribute.targetModel}/${relationData.documentId}`;
76
75
  const label = relations.getRelationLabel(relationData, props.mainField);
@@ -86,14 +85,15 @@ const CustomRelationInput = (props) => {
86
85
  background: "neutral150",
87
86
  justifyContent: "space-between",
88
87
  children: [
89
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: label, children: /* @__PURE__ */ jsxRuntime.jsx(LinkEllipsis, { forwardedAs: reactRouterDom.NavLink, to: href, children: label }) }) }),
88
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: label, children: /* @__PURE__ */ jsxRuntime.jsx(LinkEllipsis, { tag: reactRouterDom.NavLink, to: href, children: label }) }) }),
90
89
  /* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status: relationData.status })
91
90
  ]
92
91
  },
93
92
  relationData.documentId
94
93
  );
95
94
  }) }),
96
- meta.missingCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(
95
+ meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
96
+ /* @__PURE__ */ jsxRuntime.jsx(
97
97
  StyledAlert,
98
98
  {
99
99
  marginTop: 1,
@@ -113,17 +113,13 @@ const CustomRelationInput = (props) => {
113
113
  { number: meta.missingCount }
114
114
  )
115
115
  }
116
- ),
117
- results.length === 0 && meta.missingCount === 0 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(StyledAlert, { variant: "default", children: formatMessage({
118
- id: "content-manager.history.content.no-relations",
119
- defaultMessage: "No relations."
120
- }) }) })
116
+ )
121
117
  ] });
122
118
  };
123
119
  const CustomMediaInput = (props) => {
124
- const {
125
- value: { results, meta }
126
- } = strapiAdmin.useField(props.name);
120
+ const { value } = strapiAdmin.useField(props.name);
121
+ const results = value ? value.results : [];
122
+ const meta = value ? value.meta : { missingCount: 0 };
127
123
  const { formatMessage } = reactIntl.useIntl();
128
124
  const fields = strapiAdmin.useStrapiApp("CustomMediaInput", (state) => state.fields);
129
125
  const MediaLibrary = fields.media;
@@ -154,12 +150,39 @@ const CustomMediaInput = (props) => {
154
150
  )
155
151
  ] });
156
152
  };
153
+ const getLabelAction = (labelAction) => {
154
+ if (!React__namespace.isValidElement(labelAction)) {
155
+ return labelAction;
156
+ }
157
+ const labelActionTitleId = labelAction.props.title.id;
158
+ if (labelActionTitleId === "i18n.Field.localized") {
159
+ return React__namespace.cloneElement(labelAction, {
160
+ ...labelAction.props,
161
+ title: {
162
+ id: "history.content.localized",
163
+ defaultMessage: "This value is specific to this locale. If you restore this version, the content will not be replaced for other locales."
164
+ }
165
+ });
166
+ }
167
+ if (labelActionTitleId === "i18n.Field.not-localized") {
168
+ return React__namespace.cloneElement(labelAction, {
169
+ ...labelAction.props,
170
+ title: {
171
+ id: "history.content.not-localized",
172
+ 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."
173
+ }
174
+ });
175
+ }
176
+ return labelAction;
177
+ };
157
178
  const VersionInputRenderer = ({
158
179
  visible,
159
180
  hint: providedHint,
160
181
  shouldIgnoreRBAC = false,
182
+ labelAction,
161
183
  ...props
162
184
  }) => {
185
+ const customLabelAction = getLabelAction(labelAction);
163
186
  const { formatMessage } = reactIntl.useIntl();
164
187
  const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
165
188
  const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
@@ -193,7 +216,7 @@ const VersionInputRenderer = ({
193
216
  const addedAttributes = version.meta.unknownAttributes.added;
194
217
  if (Object.keys(addedAttributes).includes(props.name)) {
195
218
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
196
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.FieldLabel, { children: props.label }),
219
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: props.label }),
197
220
  /* @__PURE__ */ jsxRuntime.jsx(
198
221
  StyledAlert,
199
222
  {
@@ -217,29 +240,46 @@ const VersionInputRenderer = ({
217
240
  if (attributeHasCustomFieldProperty(props.attribute)) {
218
241
  const CustomInput = lazyComponentStore[props.attribute.customField];
219
242
  if (CustomInput) {
220
- return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
243
+ return /* @__PURE__ */ jsxRuntime.jsx(
244
+ CustomInput,
245
+ {
246
+ ...props,
247
+ hint,
248
+ labelAction: customLabelAction,
249
+ disabled: fieldIsDisabled
250
+ }
251
+ );
221
252
  }
222
253
  return /* @__PURE__ */ jsxRuntime.jsx(
223
254
  strapiAdmin.InputRenderer,
224
255
  {
225
256
  ...props,
226
257
  hint,
258
+ labelAction: customLabelAction,
227
259
  type: props.attribute.customField,
228
260
  disabled: fieldIsDisabled
229
261
  }
230
262
  );
231
263
  }
232
264
  if (props.type === "media") {
233
- return /* @__PURE__ */ jsxRuntime.jsx(CustomMediaInput, { ...props, disabled: fieldIsDisabled });
265
+ return /* @__PURE__ */ jsxRuntime.jsx(CustomMediaInput, { ...props, labelAction: customLabelAction, disabled: fieldIsDisabled });
234
266
  }
235
267
  const addedInputTypes = Object.keys(fields);
236
268
  if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {
237
269
  const CustomInput = fields[props.type];
238
- return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
270
+ return /* @__PURE__ */ jsxRuntime.jsx(
271
+ CustomInput,
272
+ {
273
+ ...props,
274
+ hint,
275
+ labelAction: customLabelAction,
276
+ disabled: fieldIsDisabled
277
+ }
278
+ );
239
279
  }
240
280
  switch (props.type) {
241
281
  case "blocks":
242
- return /* @__PURE__ */ jsxRuntime.jsx(Field.BlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
282
+ return /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
243
283
  case "component":
244
284
  const { layout } = componentsLayout[props.attribute.component];
245
285
  const [remainingFieldsLayout] = getRemaingFieldsLayout({
@@ -249,29 +289,65 @@ const VersionInputRenderer = ({
249
289
  schemaAttributes: components[props.attribute.component].attributes
250
290
  });
251
291
  return /* @__PURE__ */ jsxRuntime.jsx(
252
- Field.ComponentInput,
292
+ Field.MemoizedComponentInput,
253
293
  {
254
294
  ...props,
255
295
  layout: [...layout, ...remainingFieldsLayout || []],
256
296
  hint,
297
+ labelAction: customLabelAction,
257
298
  disabled: fieldIsDisabled,
258
299
  children: (inputProps) => /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...inputProps, shouldIgnoreRBAC: true })
259
300
  }
260
301
  );
261
302
  case "dynamiczone":
262
- return /* @__PURE__ */ jsxRuntime.jsx(Field.DynamicZone, { ...props, hint, disabled: fieldIsDisabled });
303
+ return /* @__PURE__ */ jsxRuntime.jsx(
304
+ Field.DynamicZone,
305
+ {
306
+ ...props,
307
+ hint,
308
+ labelAction: customLabelAction,
309
+ disabled: fieldIsDisabled
310
+ }
311
+ );
263
312
  case "relation":
264
- return /* @__PURE__ */ jsxRuntime.jsx(CustomRelationInput, { ...props, hint, disabled: fieldIsDisabled });
313
+ return /* @__PURE__ */ jsxRuntime.jsx(
314
+ CustomRelationInput,
315
+ {
316
+ ...props,
317
+ hint,
318
+ labelAction: customLabelAction,
319
+ disabled: fieldIsDisabled
320
+ }
321
+ );
265
322
  case "richtext":
266
- return /* @__PURE__ */ jsxRuntime.jsx(Field.Wysiwyg, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
323
+ return /* @__PURE__ */ jsxRuntime.jsx(
324
+ Field.MemoizedWysiwyg,
325
+ {
326
+ ...props,
327
+ hint,
328
+ type: props.type,
329
+ labelAction: customLabelAction,
330
+ disabled: fieldIsDisabled
331
+ }
332
+ );
267
333
  case "uid":
268
- return /* @__PURE__ */ jsxRuntime.jsx(Field.UIDInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
334
+ return /* @__PURE__ */ jsxRuntime.jsx(
335
+ Field.MemoizedUIDInput,
336
+ {
337
+ ...props,
338
+ hint,
339
+ type: props.type,
340
+ labelAction: customLabelAction,
341
+ disabled: fieldIsDisabled
342
+ }
343
+ );
269
344
  case "enumeration":
270
345
  return /* @__PURE__ */ jsxRuntime.jsx(
271
346
  strapiAdmin.InputRenderer,
272
347
  {
273
348
  ...props,
274
349
  hint,
350
+ labelAction: customLabelAction,
275
351
  options: props.attribute.enum.map((value) => ({ value })),
276
352
  type: props.customField ? "custom-field" : props.type,
277
353
  disabled: fieldIsDisabled
@@ -284,6 +360,7 @@ const VersionInputRenderer = ({
284
360
  {
285
361
  ...restProps,
286
362
  hint,
363
+ labelAction: customLabelAction,
287
364
  type: props.customField ? "custom-field" : props.type,
288
365
  disabled: fieldIsDisabled
289
366
  }
@@ -337,7 +414,7 @@ const FormPanel = ({ panel }) => {
337
414
  if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
338
415
  const [row] = panel;
339
416
  const [field] = row;
340
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field }) }) }, field.name);
417
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field }) }) }, field.name);
341
418
  }
342
419
  return /* @__PURE__ */ jsxRuntime.jsx(
343
420
  designSystem.Box,
@@ -350,8 +427,8 @@ const FormPanel = ({ panel }) => {
350
427
  paddingTop: 6,
351
428
  paddingBottom: 6,
352
429
  borderColor: "neutral150",
353
- 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 }) => {
354
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field }) }, field.name);
430
+ 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 }) => {
431
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field }) }, field.name);
355
432
  }) }, gridRowIndex)) })
356
433
  }
357
434
  );
@@ -483,12 +560,12 @@ const VersionHeader = ({ headerId }) => {
483
560
  const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
484
561
  if (collectionType === index.COLLECTION_TYPES) {
485
562
  return {
486
- pathname: `/content-manager/${collectionType}/${version.contentType}/${version.relatedDocumentId}`,
563
+ pathname: "..",
487
564
  search: pluginsQueryParams
488
565
  };
489
566
  }
490
567
  return {
491
- pathname: `/content-manager/${collectionType}/${version.contentType}`,
568
+ pathname: "..",
492
569
  search: pluginsQueryParams
493
570
  };
494
571
  };
@@ -504,7 +581,7 @@ const VersionHeader = ({ headerId }) => {
504
581
  body: { contentType: version.contentType }
505
582
  });
506
583
  if ("data" in response) {
507
- navigate(getNextNavigation());
584
+ navigate(getNextNavigation(), { relative: "path" });
508
585
  toggleNotification({
509
586
  type: "success",
510
587
  title: formatMessage({
@@ -533,7 +610,7 @@ const VersionHeader = ({ headerId }) => {
533
610
  });
534
611
  }
535
612
  };
536
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
613
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Root, { open: isConfirmDialogOpen, onOpenChange: setIsConfirmDialogOpen, children: [
537
614
  /* @__PURE__ */ jsxRuntime.jsx(
538
615
  strapiAdmin.Layouts.BaseHeader,
539
616
  {
@@ -560,8 +637,10 @@ const VersionHeader = ({ headerId }) => {
560
637
  designSystem.Link,
561
638
  {
562
639
  startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ArrowLeft, {}),
563
- as: reactRouterDom.NavLink,
640
+ tag: reactRouterDom.NavLink,
564
641
  to: getNextNavigation(),
642
+ relative: "path",
643
+ isExternal: false,
565
644
  children: formatMessage({
566
645
  id: "global.back",
567
646
  defaultMessage: "Back"
@@ -569,7 +648,7 @@ const VersionHeader = ({ headerId }) => {
569
648
  }
570
649
  ),
571
650
  sticky: false,
572
- primaryAction: /* @__PURE__ */ jsxRuntime.jsx(
651
+ primaryAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
573
652
  designSystem.Button,
574
653
  {
575
654
  disabled: !allowedActions.canUpdate || isCurrentVersion,
@@ -581,16 +660,13 @@ const VersionHeader = ({ headerId }) => {
581
660
  defaultMessage: "Restore"
582
661
  })
583
662
  }
584
- )
663
+ ) })
585
664
  }
586
665
  ),
587
666
  /* @__PURE__ */ jsxRuntime.jsx(
588
667
  strapiAdmin.ConfirmDialog,
589
668
  {
590
- isOpen: isConfirmDialogOpen,
591
- onClose: () => setIsConfirmDialogOpen(false),
592
669
  onConfirm: handleRestore,
593
- icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, {}),
594
670
  endAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: handleRestore, loading: isLoading, children: formatMessage({
595
671
  id: "content-manager.history.restore.confirm.button",
596
672
  defaultMessage: "Restore"
@@ -604,6 +680,7 @@ const VersionHeader = ({ headerId }) => {
604
680
  gap: 2,
605
681
  textAlign: "center",
606
682
  children: [
683
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
607
684
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
608
685
  id: "content-manager.history.restore.confirm.title",
609
686
  defaultMessage: "Are you sure you want to restore this version?"
@@ -676,23 +753,24 @@ const VersionCard = ({ version, isCurrent }) => {
676
753
  borderWidth: "1px",
677
754
  borderStyle: "solid",
678
755
  borderColor: isActive ? "primary600" : "neutral200",
756
+ color: "neutral800",
679
757
  paddingTop: 4,
680
758
  paddingBottom: 4,
681
759
  paddingLeft: 5,
682
760
  paddingRight: 5,
683
- as: reactRouterDom.Link,
761
+ tag: reactRouterDom.Link,
684
762
  to: `?${qs.stringify({ ...query, id: version.id })}`,
685
763
  style: { textDecoration: "none" },
686
764
  children: [
687
765
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
688
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { as: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
766
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
689
767
  day: "numeric",
690
768
  month: "numeric",
691
769
  year: "numeric",
692
770
  hour: "2-digit",
693
771
  minute: "2-digit"
694
772
  }) }),
695
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { as: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
773
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
696
774
  {
697
775
  id: "content-manager.history.sidebar.versionDescription",
698
776
  defaultMessage: "{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}"
@@ -748,7 +826,7 @@ const VersionsList = () => {
748
826
  borderColor: "neutral200",
749
827
  borderWidth: "0 0 0 1px",
750
828
  borderStyle: "solid",
751
- as: "aside",
829
+ tag: "aside",
752
830
  children: [
753
831
  /* @__PURE__ */ jsxRuntime.jsxs(
754
832
  designSystem.Flex,
@@ -759,9 +837,9 @@ const VersionsList = () => {
759
837
  borderColor: "neutral200",
760
838
  borderWidth: "0 0 1px",
761
839
  borderStyle: "solid",
762
- as: "header",
840
+ tag: "header",
763
841
  children: [
764
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { as: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
842
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
765
843
  id: "content-manager.history.sidebar.title",
766
844
  defaultMessage: "Versions"
767
845
  }) }),
@@ -783,7 +861,7 @@ const VersionsList = () => {
783
861
  paddingBottom: 5,
784
862
  paddingLeft: 4,
785
863
  paddingRight: 4,
786
- as: "ul",
864
+ tag: "ul",
787
865
  alignItems: "stretch",
788
866
  children: versions.data.map((version, index2) => /* @__PURE__ */ jsxRuntime.jsx(
789
867
  "li",
@@ -850,7 +928,22 @@ const HistoryPage = () => {
850
928
  return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
851
929
  }
852
930
  if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
853
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.NoData, {});
931
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
932
+ strapiAdmin.Page.NoData,
933
+ {
934
+ action: /* @__PURE__ */ jsxRuntime.jsx(
935
+ designSystem.Link,
936
+ {
937
+ tag: reactRouterDom.NavLink,
938
+ to: `/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ""}`,
939
+ children: formatMessage({
940
+ id: "global.back",
941
+ defaultMessage: "Back"
942
+ })
943
+ }
944
+ )
945
+ }
946
+ ) });
854
947
  }
855
948
  if (versionsResponse.data?.data?.length && !selectedVersionId) {
856
949
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -957,4 +1050,4 @@ const ProtectedHistoryPage = () => {
957
1050
  exports.HistoryProvider = HistoryProvider;
958
1051
  exports.ProtectedHistoryPage = ProtectedHistoryPage;
959
1052
  exports.useHistoryContext = useHistoryContext;
960
- //# sourceMappingURL=History-DeAPlvtv.js.map
1053
+ //# sourceMappingURL=History-CnZDctSO.js.map