@strapi/content-manager 5.34.0 → 5.36.0
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.
- package/dist/admin/components/ActionsDrawer.js +208 -0
- package/dist/admin/components/ActionsDrawer.js.map +1 -0
- package/dist/admin/components/ActionsDrawer.mjs +186 -0
- package/dist/admin/components/ActionsDrawer.mjs.map +1 -0
- package/dist/admin/components/LeftMenu.js +1 -28
- package/dist/admin/components/LeftMenu.js.map +1 -1
- package/dist/admin/components/LeftMenu.mjs +2 -29
- package/dist/admin/components/LeftMenu.mjs.map +1 -1
- package/dist/admin/history/components/VersionContent.js +96 -68
- package/dist/admin/history/components/VersionContent.js.map +1 -1
- package/dist/admin/history/components/VersionContent.mjs +98 -70
- package/dist/admin/history/components/VersionContent.mjs.map +1 -1
- package/dist/admin/history/components/VersionsList.js +139 -54
- package/dist/admin/history/components/VersionsList.js.map +1 -1
- package/dist/admin/history/components/VersionsList.mjs +141 -56
- package/dist/admin/history/components/VersionsList.mjs.map +1 -1
- package/dist/admin/history/pages/History.js +27 -9
- package/dist/admin/history/pages/History.js.map +1 -1
- package/dist/admin/history/pages/History.mjs +28 -10
- package/dist/admin/history/pages/History.mjs.map +1 -1
- package/dist/admin/hooks/useDocument.js +1 -1
- package/dist/admin/hooks/useDocument.js.map +1 -1
- package/dist/admin/hooks/useDocument.mjs +1 -1
- package/dist/admin/hooks/useDocument.mjs.map +1 -1
- package/dist/admin/hooks/usePersistentQueryParams.js +56 -0
- package/dist/admin/hooks/usePersistentQueryParams.js.map +1 -0
- package/dist/admin/hooks/usePersistentQueryParams.mjs +54 -0
- package/dist/admin/hooks/usePersistentQueryParams.mjs.map +1 -0
- package/dist/admin/pages/EditView/EditViewPage.js +107 -71
- package/dist/admin/pages/EditView/EditViewPage.js.map +1 -1
- package/dist/admin/pages/EditView/EditViewPage.mjs +109 -73
- package/dist/admin/pages/EditView/EditViewPage.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/DocumentActions.js +48 -40
- package/dist/admin/pages/EditView/components/DocumentActions.js.map +1 -1
- package/dist/admin/pages/EditView/components/DocumentActions.mjs +50 -42
- package/dist/admin/pages/EditView/components/DocumentActions.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/EditorToolbarObserver.js +63 -31
- package/dist/admin/pages/EditView/components/EditorToolbarObserver.js.map +1 -1
- package/dist/admin/pages/EditView/components/EditorToolbarObserver.mjs +64 -32
- package/dist/admin/pages/EditView/components/EditorToolbarObserver.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Blocks/Link.js +20 -5
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Blocks/Link.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Blocks/Link.mjs +20 -5
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Blocks/Link.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksContent.js +22 -12
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksContent.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksContent.mjs +22 -12
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksContent.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.js +6 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.mjs +7 -2
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksToolbar.js +151 -10
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksToolbar.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksToolbar.mjs +152 -11
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksToolbar.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Modifiers.js +52 -5
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Modifiers.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Modifiers.mjs +53 -6
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Modifiers.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.js +10 -6
- package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.mjs +11 -7
- package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.js +8 -2
- package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.mjs +8 -2
- package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/AddComponentButton.js +9 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/AddComponentButton.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/AddComponentButton.mjs +9 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/AddComponentButton.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.js +7 -2
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.mjs +7 -2
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentPicker.js +30 -11
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentPicker.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentPicker.mjs +31 -12
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentPicker.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.js +4 -4
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.mjs +4 -4
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.js +4 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.mjs +4 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Editor.js +6 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Editor.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Editor.mjs +6 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Editor.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.js +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.mjs +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Field.js +21 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Field.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Field.mjs +24 -4
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/Field.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.js +2 -2
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.mjs +2 -2
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.js +4 -0
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.mjs +4 -0
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.js +30 -13
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.mjs +32 -16
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormLayout.js +6 -9
- package/dist/admin/pages/EditView/components/FormLayout.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormLayout.mjs +6 -9
- package/dist/admin/pages/EditView/components/FormLayout.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/Header.js +2 -0
- package/dist/admin/pages/EditView/components/Header.js.map +1 -1
- package/dist/admin/pages/EditView/components/Header.mjs +2 -0
- package/dist/admin/pages/EditView/components/Header.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/Panels.js +67 -15
- package/dist/admin/pages/EditView/components/Panels.js.map +1 -1
- package/dist/admin/pages/EditView/components/Panels.mjs +67 -18
- package/dist/admin/pages/EditView/components/Panels.mjs.map +1 -1
- package/dist/admin/pages/ListView/ListViewPage.js +52 -20
- package/dist/admin/pages/ListView/ListViewPage.js.map +1 -1
- package/dist/admin/pages/ListView/ListViewPage.mjs +53 -21
- package/dist/admin/pages/ListView/ListViewPage.mjs.map +1 -1
- package/dist/admin/preview/index.js +9 -3
- package/dist/admin/preview/index.js.map +1 -1
- package/dist/admin/preview/index.mjs +9 -3
- package/dist/admin/preview/index.mjs.map +1 -1
- package/dist/admin/src/components/ActionsDrawer.d.ts +35 -0
- package/dist/admin/src/hooks/usePersistentQueryParams.d.ts +5 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +7 -2
- package/dist/admin/src/pages/EditView/components/Panels.d.ts +14 -2
- package/dist/admin/translations/en.json.js +5 -1
- package/dist/admin/translations/en.json.js.map +1 -1
- package/dist/admin/translations/en.json.mjs +5 -1
- package/dist/admin/translations/en.json.mjs.map +1 -1
- package/dist/admin/translations/es.json.js +3 -1
- package/dist/admin/translations/es.json.js.map +1 -1
- package/dist/admin/translations/es.json.mjs +3 -1
- package/dist/admin/translations/es.json.mjs.map +1 -1
- package/dist/admin/translations/fr.json.js +3 -1
- package/dist/admin/translations/fr.json.js.map +1 -1
- package/dist/admin/translations/fr.json.mjs +3 -1
- package/dist/admin/translations/fr.json.mjs.map +1 -1
- package/dist/server/preview/services/preview.js +1 -1
- package/dist/server/preview/services/preview.js.map +1 -1
- package/dist/server/preview/services/preview.mjs +1 -1
- package/dist/server/preview/services/preview.mjs.map +1 -1
- package/dist/server/src/preview/services/index.d.ts +1 -1
- package/dist/server/src/preview/utils.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import 'react';
|
|
3
|
-
import { useQueryParams } from '@strapi/admin/strapi-admin';
|
|
3
|
+
import { useIsMobile, useQueryParams } from '@strapi/admin/strapi-admin';
|
|
4
4
|
import { Flex, Typography, Box } from '@strapi/design-system';
|
|
5
5
|
import { stringify } from 'qs';
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
7
|
import { Link } from 'react-router-dom';
|
|
8
|
+
import { ActionsDrawer, useActionsDrawer } from '../../components/ActionsDrawer.mjs';
|
|
8
9
|
import { RelativeTime } from '../../components/RelativeTime.mjs';
|
|
9
10
|
import { DocumentStatus } from '../../pages/EditView/components/DocumentStatus.mjs';
|
|
10
11
|
import { getDisplayName } from '../../utils/users.mjs';
|
|
@@ -17,11 +18,34 @@ import { useHistoryContext } from '../pages/History.mjs';
|
|
|
17
18
|
variant: "pi",
|
|
18
19
|
children: children
|
|
19
20
|
});
|
|
21
|
+
/* -------------------------------------------------------------------------------------------------
|
|
22
|
+
* VersionAuthor
|
|
23
|
+
* -----------------------------------------------------------------------------------------------*/ const VersionAuthor = ({ version, isCurrent })=>{
|
|
24
|
+
const { formatMessage } = useIntl();
|
|
25
|
+
const author = version.createdBy && getDisplayName(version.createdBy);
|
|
26
|
+
return /*#__PURE__*/ jsx(Fragment, {
|
|
27
|
+
children: formatMessage({
|
|
28
|
+
id: 'content-manager.history.sidebar.versionDescription',
|
|
29
|
+
defaultMessage: '{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}'
|
|
30
|
+
}, {
|
|
31
|
+
distanceToNow: /*#__PURE__*/ jsx(RelativeTime, {
|
|
32
|
+
timestamp: new Date(version.createdAt)
|
|
33
|
+
}),
|
|
34
|
+
author,
|
|
35
|
+
isAnonymous: !Boolean(version.createdBy),
|
|
36
|
+
isCurrent,
|
|
37
|
+
b: BlueText
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
};
|
|
20
41
|
const VersionCard = ({ version, isCurrent })=>{
|
|
21
|
-
const { formatDate
|
|
42
|
+
const { formatDate } = useIntl();
|
|
22
43
|
const [{ query }] = useQueryParams();
|
|
44
|
+
const setIsOpen = useActionsDrawer('VersionCard', (s)=>s?.setIsOpen, false);
|
|
23
45
|
const isActive = query.id === version.id.toString();
|
|
24
|
-
const
|
|
46
|
+
const handleClick = ()=>{
|
|
47
|
+
setIsOpen?.(false);
|
|
48
|
+
};
|
|
25
49
|
return /*#__PURE__*/ jsxs(Flex, {
|
|
26
50
|
direction: "column",
|
|
27
51
|
alignItems: "flex-start",
|
|
@@ -40,6 +64,7 @@ const VersionCard = ({ version, isCurrent })=>{
|
|
|
40
64
|
style: {
|
|
41
65
|
textDecoration: 'none'
|
|
42
66
|
},
|
|
67
|
+
onClick: handleClick,
|
|
43
68
|
children: [
|
|
44
69
|
/*#__PURE__*/ jsxs(Flex, {
|
|
45
70
|
direction: "column",
|
|
@@ -61,17 +86,9 @@ const VersionCard = ({ version, isCurrent })=>{
|
|
|
61
86
|
tag: "p",
|
|
62
87
|
variant: "pi",
|
|
63
88
|
textColor: "neutral600",
|
|
64
|
-
children:
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, {
|
|
68
|
-
distanceToNow: /*#__PURE__*/ jsx(RelativeTime, {
|
|
69
|
-
timestamp: new Date(version.createdAt)
|
|
70
|
-
}),
|
|
71
|
-
author,
|
|
72
|
-
isAnonymous: !Boolean(version.createdBy),
|
|
73
|
-
isCurrent,
|
|
74
|
-
b: BlueText
|
|
89
|
+
children: /*#__PURE__*/ jsx(VersionAuthor, {
|
|
90
|
+
version: version,
|
|
91
|
+
isCurrent: isCurrent
|
|
75
92
|
})
|
|
76
93
|
})
|
|
77
94
|
]
|
|
@@ -105,6 +122,63 @@ const PaginationButton = ({ page, children })=>{
|
|
|
105
122
|
})
|
|
106
123
|
});
|
|
107
124
|
};
|
|
125
|
+
/* -------------------------------------------------------------------------------------------------
|
|
126
|
+
* VersionsListItems
|
|
127
|
+
* -----------------------------------------------------------------------------------------------*/ const VersionsListItems = ()=>{
|
|
128
|
+
const { formatMessage } = useIntl();
|
|
129
|
+
const { versions, page } = useHistoryContext('VersionsListItems', (state)=>({
|
|
130
|
+
versions: state.versions,
|
|
131
|
+
page: state.page
|
|
132
|
+
}));
|
|
133
|
+
return /*#__PURE__*/ jsxs(Box, {
|
|
134
|
+
flex: 1,
|
|
135
|
+
overflow: "auto",
|
|
136
|
+
children: [
|
|
137
|
+
versions.meta.pagination.page > 1 && /*#__PURE__*/ jsx(Box, {
|
|
138
|
+
paddingTop: 4,
|
|
139
|
+
textAlign: "center",
|
|
140
|
+
children: /*#__PURE__*/ jsx(PaginationButton, {
|
|
141
|
+
page: page - 1,
|
|
142
|
+
children: formatMessage({
|
|
143
|
+
id: 'content-manager.history.sidebar.show-newer',
|
|
144
|
+
defaultMessage: 'Show newer versions'
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
}),
|
|
148
|
+
/*#__PURE__*/ jsx(Flex, {
|
|
149
|
+
direction: "column",
|
|
150
|
+
gap: 3,
|
|
151
|
+
padding: {
|
|
152
|
+
initial: 0,
|
|
153
|
+
medium: 4
|
|
154
|
+
},
|
|
155
|
+
tag: "ul",
|
|
156
|
+
alignItems: "stretch",
|
|
157
|
+
children: versions.data.map((version, index)=>/*#__PURE__*/ jsx("li", {
|
|
158
|
+
"aria-label": formatMessage({
|
|
159
|
+
id: 'content-manager.history.sidebar.title.version-card.aria-label',
|
|
160
|
+
defaultMessage: 'Version card'
|
|
161
|
+
}),
|
|
162
|
+
children: /*#__PURE__*/ jsx(VersionCard, {
|
|
163
|
+
version: version,
|
|
164
|
+
isCurrent: page === 1 && index === 0
|
|
165
|
+
})
|
|
166
|
+
}, version.id))
|
|
167
|
+
}),
|
|
168
|
+
versions.meta.pagination.page < versions.meta.pagination.pageCount && /*#__PURE__*/ jsx(Box, {
|
|
169
|
+
paddingBottom: 4,
|
|
170
|
+
textAlign: "center",
|
|
171
|
+
children: /*#__PURE__*/ jsx(PaginationButton, {
|
|
172
|
+
page: page + 1,
|
|
173
|
+
children: formatMessage({
|
|
174
|
+
id: 'content-manager.history.sidebar.show-older',
|
|
175
|
+
defaultMessage: 'Show older versions'
|
|
176
|
+
})
|
|
177
|
+
})
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
});
|
|
181
|
+
};
|
|
108
182
|
/* -------------------------------------------------------------------------------------------------
|
|
109
183
|
* VersionsList
|
|
110
184
|
* -----------------------------------------------------------------------------------------------*/ const VersionsList = ()=>{
|
|
@@ -113,12 +187,19 @@ const PaginationButton = ({ page, children })=>{
|
|
|
113
187
|
versions: state.versions,
|
|
114
188
|
page: state.page
|
|
115
189
|
}));
|
|
116
|
-
|
|
190
|
+
const isMobile = useIsMobile();
|
|
191
|
+
const [{ query }] = useQueryParams();
|
|
192
|
+
const currentVersion = versions.data.find((version)=>version.id.toString() === query.id);
|
|
193
|
+
return !isMobile ? /*#__PURE__*/ jsxs(Flex, {
|
|
117
194
|
shrink: 0,
|
|
118
195
|
direction: "column",
|
|
119
196
|
alignItems: "stretch",
|
|
120
|
-
width:
|
|
121
|
-
|
|
197
|
+
width: {
|
|
198
|
+
initial: '28rem',
|
|
199
|
+
large: '32rem'
|
|
200
|
+
},
|
|
201
|
+
height: "100%",
|
|
202
|
+
overflow: "hidden",
|
|
122
203
|
background: "neutral0",
|
|
123
204
|
borderColor: "neutral200",
|
|
124
205
|
borderWidth: "0 0 0 1px",
|
|
@@ -133,6 +214,7 @@ const PaginationButton = ({ page, children })=>{
|
|
|
133
214
|
borderWidth: "0 0 1px",
|
|
134
215
|
borderStyle: "solid",
|
|
135
216
|
tag: "header",
|
|
217
|
+
role: "banner",
|
|
136
218
|
children: [
|
|
137
219
|
/*#__PURE__*/ jsx(Typography, {
|
|
138
220
|
tag: "h2",
|
|
@@ -155,50 +237,53 @@ const PaginationButton = ({ page, children })=>{
|
|
|
155
237
|
})
|
|
156
238
|
]
|
|
157
239
|
}),
|
|
158
|
-
/*#__PURE__*/
|
|
159
|
-
|
|
160
|
-
|
|
240
|
+
/*#__PURE__*/ jsx(VersionsListItems, {})
|
|
241
|
+
]
|
|
242
|
+
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
243
|
+
children: [
|
|
244
|
+
/*#__PURE__*/ jsxs(ActionsDrawer.Root, {
|
|
245
|
+
hasContent: true,
|
|
246
|
+
hasSideNav: true,
|
|
161
247
|
children: [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
children:
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
248
|
+
/*#__PURE__*/ jsx(ActionsDrawer.Overlay, {}),
|
|
249
|
+
/*#__PURE__*/ jsx(ActionsDrawer.Header, {
|
|
250
|
+
children: currentVersion && /*#__PURE__*/ jsxs(Flex, {
|
|
251
|
+
gap: 2,
|
|
252
|
+
overflow: "hidden",
|
|
253
|
+
children: [
|
|
254
|
+
/*#__PURE__*/ jsx(Box, {
|
|
255
|
+
flex: 1,
|
|
256
|
+
overflow: "hidden",
|
|
257
|
+
children: /*#__PURE__*/ jsx(Typography, {
|
|
258
|
+
display: "block",
|
|
259
|
+
variant: "omega",
|
|
260
|
+
textColor: "neutral600",
|
|
261
|
+
overflow: "hidden",
|
|
262
|
+
style: {
|
|
263
|
+
textOverflow: 'ellipsis',
|
|
264
|
+
whiteSpace: 'nowrap'
|
|
265
|
+
},
|
|
266
|
+
children: /*#__PURE__*/ jsx(VersionAuthor, {
|
|
267
|
+
version: currentVersion,
|
|
268
|
+
isCurrent: page === 1 && versions.data.indexOf(currentVersion) === 0
|
|
269
|
+
})
|
|
270
|
+
})
|
|
183
271
|
}),
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
272
|
+
currentVersion.status && /*#__PURE__*/ jsx(DocumentStatus, {
|
|
273
|
+
status: currentVersion.status,
|
|
274
|
+
size: "XS"
|
|
187
275
|
})
|
|
188
|
-
|
|
189
|
-
}),
|
|
190
|
-
versions.meta.pagination.page < versions.meta.pagination.pageCount && /*#__PURE__*/ jsx(Box, {
|
|
191
|
-
paddingBottom: 4,
|
|
192
|
-
textAlign: "center",
|
|
193
|
-
children: /*#__PURE__*/ jsx(PaginationButton, {
|
|
194
|
-
page: page + 1,
|
|
195
|
-
children: formatMessage({
|
|
196
|
-
id: 'content-manager.history.sidebar.show-older',
|
|
197
|
-
defaultMessage: 'Show older versions'
|
|
198
|
-
})
|
|
276
|
+
]
|
|
199
277
|
})
|
|
278
|
+
}),
|
|
279
|
+
/*#__PURE__*/ jsx(ActionsDrawer.Content, {
|
|
280
|
+
children: /*#__PURE__*/ jsx(VersionsListItems, {})
|
|
200
281
|
})
|
|
201
282
|
]
|
|
283
|
+
}),
|
|
284
|
+
/*#__PURE__*/ jsx(Box, {
|
|
285
|
+
width: "100%",
|
|
286
|
+
height: "5.7rem"
|
|
202
287
|
})
|
|
203
288
|
]
|
|
204
289
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionsList.mjs","sources":["../../../../admin/src/history/components/VersionsList.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useQueryParams } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, Typography } from '@strapi/design-system';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { Link } from 'react-router-dom';\n\nimport { RelativeTime } from '../../components/RelativeTime';\nimport { DocumentStatus } from '../../pages/EditView/components/DocumentStatus';\nimport { getDisplayName } from '../../utils/users';\nimport { useHistoryContext } from '../pages/History';\n\nimport type { HistoryVersions } from '../../../../shared/contracts';\n\n/* -------------------------------------------------------------------------------------------------\n * BlueText\n * -----------------------------------------------------------------------------------------------*/\n\nconst BlueText = (children: React.ReactNode) => (\n <Typography textColor=\"primary600\" variant=\"pi\">\n {children}\n </Typography>\n);\n\n/* -------------------------------------------------------------------------------------------------\n * VersionCard\n * -----------------------------------------------------------------------------------------------*/\n\ninterface VersionCardProps {\n version: HistoryVersions.HistoryVersionDataResponse;\n isCurrent: boolean;\n}\n\nconst VersionCard = ({ version, isCurrent }: VersionCardProps) => {\n const { formatDate, formatMessage } = useIntl();\n const [{ query }] = useQueryParams<{ id?: string }>();\n const isActive = query.id === version.id.toString();\n const author = version.createdBy && getDisplayName(version.createdBy);\n\n return (\n <Flex\n direction=\"column\"\n alignItems=\"flex-start\"\n gap={3}\n hasRadius\n borderWidth=\"1px\"\n borderStyle=\"solid\"\n borderColor={isActive ? 'primary600' : 'neutral200'}\n color=\"neutral800\"\n padding={5}\n tag={Link}\n to={`?${stringify({ ...query, id: version.id })}`}\n style={{ textDecoration: 'none' }}\n >\n <Flex direction=\"column\" gap={1} alignItems=\"flex-start\">\n <Typography tag=\"h3\" fontWeight=\"semiBold\">\n {formatDate(version.createdAt, {\n day: 'numeric',\n month: 'numeric',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n })}\n </Typography>\n <Typography tag=\"p\" variant=\"pi\" textColor=\"neutral600\">\n {formatMessage(\n {\n id: 'content-manager.history.sidebar.versionDescription',\n defaultMessage:\n '{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}',\n },\n {\n distanceToNow: <RelativeTime timestamp={new Date(version.createdAt)} />,\n author,\n isAnonymous: !Boolean(version.createdBy),\n isCurrent,\n b: BlueText,\n }\n )}\n </Typography>\n </Flex>\n {version.status && <DocumentStatus status={version.status} size=\"XS\" />}\n </Flex>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PaginationButton\n * -----------------------------------------------------------------------------------------------*/\n\ninterface PaginationButtonProps {\n page: number;\n children: React.ReactNode;\n}\n\nconst PaginationButton = ({ page, children }: PaginationButtonProps) => {\n const [{ query }] = useQueryParams<{ id?: string }>();\n\n // Remove the id from the pagination link, so that the history page can redirect\n // to the id of the first history version in the new page once it's loaded\n const { id: _id, ...queryRest } = query;\n\n return (\n <Link to={{ search: stringify({ ...queryRest, page }) }} style={{ textDecoration: 'none' }}>\n <Typography variant=\"omega\" textColor=\"primary600\">\n {children}\n </Typography>\n </Link>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * VersionsList\n * -----------------------------------------------------------------------------------------------*/\n\nconst VersionsList = () => {\n const { formatMessage } = useIntl();\n const { versions, page } = useHistoryContext('VersionsList', (state) => ({\n versions: state.versions,\n page: state.page,\n }));\n\n return (\n <Flex\n shrink={0}\n direction=\"column\"\n alignItems=\"stretch\"\n width=\"320px\"\n height=\"100dvh\"\n background=\"neutral0\"\n borderColor=\"neutral200\"\n borderWidth=\"0 0 0 1px\"\n borderStyle=\"solid\"\n tag=\"aside\"\n >\n <Flex\n direction=\"row\"\n justifyContent=\"space-between\"\n padding={4}\n borderColor=\"neutral200\"\n borderWidth=\"0 0 1px\"\n borderStyle=\"solid\"\n tag=\"header\"\n >\n <Typography tag=\"h2\" variant=\"omega\" fontWeight=\"semiBold\">\n {formatMessage({\n id: 'content-manager.history.sidebar.title',\n defaultMessage: 'Versions',\n })}\n </Typography>\n <Box background=\"neutral150\" hasRadius padding={1}>\n <Typography variant=\"sigma\" textColor=\"neutral600\">\n {versions.meta.pagination.total}\n </Typography>\n </Box>\n </Flex>\n <Box flex={1} overflow=\"auto\">\n {versions.meta.pagination.page > 1 && (\n <Box paddingTop={4} textAlign=\"center\">\n <PaginationButton page={page - 1}>\n {formatMessage({\n id: 'content-manager.history.sidebar.show-newer',\n defaultMessage: 'Show newer versions',\n })}\n </PaginationButton>\n </Box>\n )}\n <Flex direction=\"column\" gap={3} padding={4} tag=\"ul\" alignItems=\"stretch\">\n {versions.data.map((version, index) => (\n <li\n key={version.id}\n aria-label={formatMessage({\n id: 'content-manager.history.sidebar.title.version-card.aria-label',\n defaultMessage: 'Version card',\n })}\n >\n <VersionCard version={version} isCurrent={page === 1 && index === 0} />\n </li>\n ))}\n </Flex>\n {versions.meta.pagination.page < versions.meta.pagination.pageCount && (\n <Box paddingBottom={4} textAlign=\"center\">\n <PaginationButton page={page + 1}>\n {formatMessage({\n id: 'content-manager.history.sidebar.show-older',\n defaultMessage: 'Show older versions',\n })}\n </PaginationButton>\n </Box>\n )}\n </Box>\n </Flex>\n );\n};\n\nexport { VersionsList };\n"],"names":["BlueText","children","_jsx","Typography","textColor","variant","VersionCard","version","isCurrent","formatDate","formatMessage","useIntl","query","useQueryParams","isActive","id","toString","author","createdBy","getDisplayName","_jsxs","Flex","direction","alignItems","gap","hasRadius","borderWidth","borderStyle","borderColor","color","padding","tag","Link","to","stringify","style","textDecoration","fontWeight","createdAt","day","month","year","hour","minute","defaultMessage","distanceToNow","RelativeTime","timestamp","Date","isAnonymous","Boolean","b","status","DocumentStatus","size","PaginationButton","page","_id","queryRest","search","VersionsList","versions","useHistoryContext","state","shrink","width","height","background","justifyContent","Box","meta","pagination","total","flex","overflow","paddingTop","textAlign","data","map","index","li","aria-label","pageCount","paddingBottom"],"mappings":";;;;;;;;;;;;AAeA;;AAEkG,qGAElG,MAAMA,QAAAA,GAAW,CAACC,QAAAA,iBAChBC,GAACC,CAAAA,UAAAA,EAAAA;QAAWC,SAAU,EAAA,YAAA;QAAaC,OAAQ,EAAA,IAAA;AACxCJ,QAAAA,QAAAA,EAAAA;;AAaL,MAAMK,cAAc,CAAC,EAAEC,OAAO,EAAEC,SAAS,EAAoB,GAAA;AAC3D,IAAA,MAAM,EAAEC,UAAU,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;AACtC,IAAA,MAAM,CAAC,EAAEC,KAAK,EAAE,CAAC,GAAGC,cAAAA,EAAAA;AACpB,IAAA,MAAMC,WAAWF,KAAMG,CAAAA,EAAE,KAAKR,OAAQQ,CAAAA,EAAE,CAACC,QAAQ,EAAA;AACjD,IAAA,MAAMC,SAASV,OAAQW,CAAAA,SAAS,IAAIC,cAAAA,CAAeZ,QAAQW,SAAS,CAAA;AAEpE,IAAA,qBACEE,IAACC,CAAAA,IAAAA,EAAAA;QACCC,SAAU,EAAA,QAAA;QACVC,UAAW,EAAA,YAAA;QACXC,GAAK,EAAA,CAAA;QACLC,SAAS,EAAA,IAAA;QACTC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C,aAAc,CAAA;gCACbK,EAAI,EAAA,4CAAA;gCACJ6B,cAAgB,EAAA;AAClB,6BAAA;;;kCAIN1C,GAACmB,CAAAA,IAAAA,EAAAA;wBAAKC,SAAU,EAAA,QAAA;wBAASE,GAAK,EAAA,CAAA;wBAAGM,OAAS,EAAA,CAAA;wBAAGC,GAAI,EAAA,IAAA;wBAAKR,UAAW,EAAA,SAAA;AAC9DsC,wBAAAA,QAAAA,EAAAA,QAAAA,CAASgB,IAAI,CAACC,GAAG,CAAC,CAACvE,OAAAA,EAASwE,sBAC3B7E,GAAC8E,CAAAA,IAAAA,EAAAA;AAECC,gCAAAA,YAAAA,EAAYvE,aAAc,CAAA;oCACxBK,EAAI,EAAA,+DAAA;oCACJ6B,cAAgB,EAAA;AAClB,iCAAA,CAAA;AAEA,gCAAA,QAAA,gBAAA1C,GAACI,CAAAA,WAAAA,EAAAA;oCAAYC,OAASA,EAAAA,OAAAA;oCAASC,SAAWgD,EAAAA,IAAAA,KAAS,KAAKuB,KAAU,KAAA;;AAN7DxE,6BAAAA,EAAAA,OAAAA,CAAQQ,EAAE,CAAA;;AAUpB8C,oBAAAA,QAAAA,CAASS,IAAI,CAACC,UAAU,CAACf,IAAI,GAAGK,QAASS,CAAAA,IAAI,CAACC,UAAU,CAACW,SAAS,kBACjEhF,GAACmE,CAAAA,GAAAA,EAAAA;wBAAIc,aAAe,EAAA,CAAA;wBAAGP,SAAU,EAAA,QAAA;AAC/B,wBAAA,QAAA,gBAAA1E,GAACqD,CAAAA,gBAAAA,EAAAA;AAAiBC,4BAAAA,IAAAA,EAAMA,IAAO,GAAA,CAAA;sCAC5B9C,aAAc,CAAA;gCACbK,EAAI,EAAA,4CAAA;gCACJ6B,cAAgB,EAAA;AAClB,6BAAA;;;;;;;AAOd;;;;"}
|
|
1
|
+
{"version":3,"file":"VersionsList.mjs","sources":["../../../../admin/src/history/components/VersionsList.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useQueryParams, useIsMobile } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, Typography } from '@strapi/design-system';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { Link } from 'react-router-dom';\n\nimport { ActionsDrawer, useActionsDrawer } from '../../components/ActionsDrawer';\nimport { RelativeTime } from '../../components/RelativeTime';\nimport { DocumentStatus } from '../../pages/EditView/components/DocumentStatus';\nimport { getDisplayName } from '../../utils/users';\nimport { useHistoryContext } from '../pages/History';\n\nimport type { HistoryVersions } from '../../../../shared/contracts';\n\n/* -------------------------------------------------------------------------------------------------\n * BlueText\n * -----------------------------------------------------------------------------------------------*/\n\nconst BlueText = (children: React.ReactNode) => (\n <Typography textColor=\"primary600\" variant=\"pi\">\n {children}\n </Typography>\n);\n\n/* -------------------------------------------------------------------------------------------------\n * VersionAuthor\n * -----------------------------------------------------------------------------------------------*/\n\nconst VersionAuthor = ({\n version,\n isCurrent,\n}: {\n version: HistoryVersions.HistoryVersionDataResponse;\n isCurrent: boolean;\n}) => {\n const { formatMessage } = useIntl();\n const author = version.createdBy && getDisplayName(version.createdBy);\n return (\n <>\n {formatMessage(\n {\n id: 'content-manager.history.sidebar.versionDescription',\n defaultMessage:\n '{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}',\n },\n {\n distanceToNow: <RelativeTime timestamp={new Date(version.createdAt)} />,\n author,\n isAnonymous: !Boolean(version.createdBy),\n isCurrent,\n b: BlueText,\n }\n )}\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * VersionCard\n * -----------------------------------------------------------------------------------------------*/\n\ninterface VersionCardProps {\n version: HistoryVersions.HistoryVersionDataResponse;\n isCurrent: boolean;\n}\n\nconst VersionCard = ({ version, isCurrent }: VersionCardProps) => {\n const { formatDate } = useIntl();\n const [{ query }] = useQueryParams<{ id?: string }>();\n const setIsOpen = useActionsDrawer('VersionCard', (s) => s?.setIsOpen, false);\n const isActive = query.id === version.id.toString();\n\n const handleClick = () => {\n setIsOpen?.(false);\n };\n\n return (\n <Flex\n direction=\"column\"\n alignItems=\"flex-start\"\n gap={3}\n hasRadius\n borderWidth=\"1px\"\n borderStyle=\"solid\"\n borderColor={isActive ? 'primary600' : 'neutral200'}\n color=\"neutral800\"\n padding={5}\n tag={Link}\n to={`?${stringify({ ...query, id: version.id })}`}\n style={{ textDecoration: 'none' }}\n onClick={handleClick}\n >\n <Flex direction=\"column\" gap={1} alignItems=\"flex-start\">\n <Typography tag=\"h3\" fontWeight=\"semiBold\">\n {formatDate(version.createdAt, {\n day: 'numeric',\n month: 'numeric',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n })}\n </Typography>\n <Typography tag=\"p\" variant=\"pi\" textColor=\"neutral600\">\n <VersionAuthor version={version} isCurrent={isCurrent} />\n </Typography>\n </Flex>\n {version.status && <DocumentStatus status={version.status} size=\"XS\" />}\n </Flex>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PaginationButton\n * -----------------------------------------------------------------------------------------------*/\n\ninterface PaginationButtonProps {\n page: number;\n children: React.ReactNode;\n}\n\nconst PaginationButton = ({ page, children }: PaginationButtonProps) => {\n const [{ query }] = useQueryParams<{ id?: string }>();\n\n // Remove the id from the pagination link, so that the history page can redirect\n // to the id of the first history version in the new page once it's loaded\n const { id: _id, ...queryRest } = query;\n\n return (\n <Link to={{ search: stringify({ ...queryRest, page }) }} style={{ textDecoration: 'none' }}>\n <Typography variant=\"omega\" textColor=\"primary600\">\n {children}\n </Typography>\n </Link>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * VersionsListItems\n * -----------------------------------------------------------------------------------------------*/\n\nconst VersionsListItems = () => {\n const { formatMessage } = useIntl();\n const { versions, page } = useHistoryContext('VersionsListItems', (state) => ({\n versions: state.versions,\n page: state.page,\n }));\n\n return (\n <Box flex={1} overflow=\"auto\">\n {versions.meta.pagination.page > 1 && (\n <Box paddingTop={4} textAlign=\"center\">\n <PaginationButton page={page - 1}>\n {formatMessage({\n id: 'content-manager.history.sidebar.show-newer',\n defaultMessage: 'Show newer versions',\n })}\n </PaginationButton>\n </Box>\n )}\n <Flex\n direction=\"column\"\n gap={3}\n padding={{ initial: 0, medium: 4 }}\n tag=\"ul\"\n alignItems=\"stretch\"\n >\n {versions.data.map((version, index) => (\n <li\n key={version.id}\n aria-label={formatMessage({\n id: 'content-manager.history.sidebar.title.version-card.aria-label',\n defaultMessage: 'Version card',\n })}\n >\n <VersionCard version={version} isCurrent={page === 1 && index === 0} />\n </li>\n ))}\n </Flex>\n {versions.meta.pagination.page < versions.meta.pagination.pageCount && (\n <Box paddingBottom={4} textAlign=\"center\">\n <PaginationButton page={page + 1}>\n {formatMessage({\n id: 'content-manager.history.sidebar.show-older',\n defaultMessage: 'Show older versions',\n })}\n </PaginationButton>\n </Box>\n )}\n </Box>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * VersionsList\n * -----------------------------------------------------------------------------------------------*/\n\nconst VersionsList = () => {\n const { formatMessage } = useIntl();\n const { versions, page } = useHistoryContext('VersionsList', (state) => ({\n versions: state.versions,\n page: state.page,\n }));\n const isMobile = useIsMobile();\n\n const [{ query }] = useQueryParams<{ id?: string }>();\n const currentVersion = versions.data.find((version) => version.id.toString() === query.id);\n\n return !isMobile ? (\n <Flex\n shrink={0}\n direction=\"column\"\n alignItems=\"stretch\"\n width={{ initial: '28rem', large: '32rem' }}\n height=\"100%\"\n overflow=\"hidden\"\n background=\"neutral0\"\n borderColor=\"neutral200\"\n borderWidth=\"0 0 0 1px\"\n borderStyle=\"solid\"\n tag=\"aside\"\n >\n <Flex\n direction=\"row\"\n justifyContent=\"space-between\"\n padding={4}\n borderColor=\"neutral200\"\n borderWidth=\"0 0 1px\"\n borderStyle=\"solid\"\n tag=\"header\"\n role=\"banner\"\n >\n <Typography tag=\"h2\" variant=\"omega\" fontWeight=\"semiBold\">\n {formatMessage({\n id: 'content-manager.history.sidebar.title',\n defaultMessage: 'Versions',\n })}\n </Typography>\n <Box background=\"neutral150\" hasRadius padding={1}>\n <Typography variant=\"sigma\" textColor=\"neutral600\">\n {versions.meta.pagination.total}\n </Typography>\n </Box>\n </Flex>\n <VersionsListItems />\n </Flex>\n ) : (\n <>\n <ActionsDrawer.Root hasContent hasSideNav>\n <ActionsDrawer.Overlay />\n <ActionsDrawer.Header>\n {currentVersion && (\n <Flex gap={2} overflow=\"hidden\">\n <Box flex={1} overflow=\"hidden\">\n <Typography\n display=\"block\"\n variant=\"omega\"\n textColor=\"neutral600\"\n overflow=\"hidden\"\n style={{ textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}\n >\n <VersionAuthor\n version={currentVersion}\n isCurrent={page === 1 && versions.data.indexOf(currentVersion) === 0}\n />\n </Typography>\n </Box>\n {currentVersion.status && <DocumentStatus status={currentVersion.status} size=\"XS\" />}\n </Flex>\n )}\n </ActionsDrawer.Header>\n <ActionsDrawer.Content>\n <VersionsListItems />\n </ActionsDrawer.Content>\n </ActionsDrawer.Root>\n {/* Adding a fixed height to the bottom of the page to prevent \n the actions drawer from covering the content\n (32px + 12px * 2 padding + 1px border) */}\n <Box width=\"100%\" height=\"5.7rem\" />\n </>\n );\n};\n\nexport { VersionsList };\n"],"names":["BlueText","children","_jsx","Typography","textColor","variant","VersionAuthor","version","isCurrent","formatMessage","useIntl","author","createdBy","getDisplayName","_Fragment","id","defaultMessage","distanceToNow","RelativeTime","timestamp","Date","createdAt","isAnonymous","Boolean","b","VersionCard","formatDate","query","useQueryParams","setIsOpen","useActionsDrawer","s","isActive","toString","handleClick","_jsxs","Flex","direction","alignItems","gap","hasRadius","borderWidth","borderStyle","borderColor","color","padding","tag","Link","to","stringify","style","textDecoration","onClick","fontWeight","day","month","year","hour","minute","status","DocumentStatus","size","PaginationButton","page","_id","queryRest","search","VersionsListItems","versions","useHistoryContext","state","Box","flex","overflow","meta","pagination","paddingTop","textAlign","initial","medium","data","map","index","li","aria-label","pageCount","paddingBottom","VersionsList","isMobile","useIsMobile","currentVersion","find","shrink","width","large","height","background","justifyContent","role","total","ActionsDrawer","Root","hasContent","hasSideNav","Overlay","Header","display","textOverflow","whiteSpace","indexOf","Content"],"mappings":";;;;;;;;;;;;;AAgBA;;AAEkG,qGAElG,MAAMA,QAAAA,GAAW,CAACC,QAAAA,iBAChBC,GAACC,CAAAA,UAAAA,EAAAA;QAAWC,SAAU,EAAA,YAAA;QAAaC,OAAQ,EAAA,IAAA;AACxCJ,QAAAA,QAAAA,EAAAA;;AAIL;;AAEkG,qGAElG,MAAMK,aAAgB,GAAA,CAAC,EACrBC,OAAO,EACPC,SAAS,EAIV,GAAA;IACC,MAAM,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;AAC1B,IAAA,MAAMC,SAASJ,OAAQK,CAAAA,SAAS,IAAIC,cAAAA,CAAeN,QAAQK,SAAS,CAAA;IACpE,qBACEV,GAAA,CAAAY,QAAA,EAAA;kBACGL,aACC,CAAA;YACEM,EAAI,EAAA,oDAAA;YACJC,cACE,EAAA;SAEJ,EAAA;AACEC,YAAAA,aAAAA,gBAAef,GAACgB,CAAAA,YAAAA,EAAAA;gBAAaC,SAAW,EAAA,IAAIC,IAAKb,CAAAA,OAAAA,CAAQc,SAAS;;AAClEV,YAAAA,MAAAA;YACAW,WAAa,EAAA,CAACC,OAAQhB,CAAAA,OAAAA,CAAQK,SAAS,CAAA;AACvCJ,YAAAA,SAAAA;YACAgB,CAAGxB,EAAAA;AACL,SAAA;;AAIR,CAAA;AAWA,MAAMyB,cAAc,CAAC,EAAElB,OAAO,EAAEC,SAAS,EAAoB,GAAA;IAC3D,MAAM,EAAEkB,UAAU,EAAE,GAAGhB,OAAAA,EAAAA;AACvB,IAAA,MAAM,CAAC,EAAEiB,KAAK,EAAE,CAAC,GAAGC,cAAAA,EAAAA;AACpB,IAAA,MAAMC,YAAYC,gBAAiB,CAAA,aAAA,EAAe,CAACC,CAAAA,GAAMA,GAAGF,SAAW,EAAA,KAAA,CAAA;AACvE,IAAA,MAAMG,WAAWL,KAAMZ,CAAAA,EAA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AAA,QAAA,gBAAAvE,GAACC,CAAAA,UAAAA,EAAAA;wCACCuG,OAAQ,EAAA,OAAA;wCACRrG,OAAQ,EAAA,OAAA;wCACRD,SAAU,EAAA,YAAA;wCACVqE,QAAS,EAAA,QAAA;wCACTvB,KAAO,EAAA;4CAAEyD,YAAc,EAAA,UAAA;4CAAYC,UAAY,EAAA;AAAS,yCAAA;AAExD,wCAAA,QAAA,gBAAA1G,GAACI,CAAAA,aAAAA,EAAAA;4CACCC,OAASmF,EAAAA,cAAAA;AACTlF,4CAAAA,SAAAA,EAAWuD,SAAS,CAAKK,IAAAA,QAAAA,CAASY,IAAI,CAAC6B,OAAO,CAACnB,cAAoB,CAAA,KAAA;;;;gCAIxEA,cAAe/B,CAAAA,MAAM,kBAAIzD,GAAC0D,CAAAA,cAAAA,EAAAA;AAAeD,oCAAAA,MAAAA,EAAQ+B,eAAe/B,MAAM;oCAAEE,IAAK,EAAA;;;;;AAIpF,kCAAA3D,GAAA,CAACkG,cAAcU,OAAO,EAAA;AACpB,wBAAA,QAAA,gBAAA5G,GAACiE,CAAAA,iBAAAA,EAAAA,EAAAA;;;;0BAMLjE,GAACqE,CAAAA,GAAAA,EAAAA;gBAAIsB,KAAM,EAAA,MAAA;gBAAOE,MAAO,EAAA;;;;AAG/B;;;;"}
|
|
@@ -142,15 +142,21 @@ const [HistoryProvider, useHistoryContext] = strapiAdmin.createContext('HistoryP
|
|
|
142
142
|
page: page,
|
|
143
143
|
mainField: mainField,
|
|
144
144
|
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
145
|
-
direction:
|
|
145
|
+
direction: {
|
|
146
|
+
initial: 'column',
|
|
147
|
+
medium: 'row'
|
|
148
|
+
},
|
|
146
149
|
alignItems: "flex-start",
|
|
150
|
+
height: "100%",
|
|
151
|
+
overflow: "hidden",
|
|
147
152
|
children: [
|
|
148
153
|
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Main, {
|
|
149
154
|
grow: 1,
|
|
150
|
-
|
|
155
|
+
width: "100%",
|
|
156
|
+
height: "100%",
|
|
151
157
|
background: "neutral100",
|
|
152
158
|
paddingBottom: 6,
|
|
153
|
-
overflow: "auto",
|
|
159
|
+
overflow: "hidden auto",
|
|
154
160
|
labelledBy: headerId,
|
|
155
161
|
children: [
|
|
156
162
|
/*#__PURE__*/ jsxRuntime.jsx(VersionHeader.VersionHeader, {
|
|
@@ -179,23 +185,35 @@ const [HistoryProvider, useHistoryContext] = strapiAdmin.createContext('HistoryP
|
|
|
179
185
|
}
|
|
180
186
|
if (error || !slug) {
|
|
181
187
|
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
|
|
182
|
-
height: "100dvh",
|
|
183
188
|
width: "100dvw",
|
|
184
189
|
position: "fixed",
|
|
185
|
-
top:
|
|
190
|
+
top: {
|
|
191
|
+
initial: strapiAdmin.HEIGHT_TOP_NAVIGATION,
|
|
192
|
+
large: 0
|
|
193
|
+
},
|
|
194
|
+
bottom: 0,
|
|
186
195
|
left: 0,
|
|
187
|
-
zIndex:
|
|
196
|
+
zIndex: {
|
|
197
|
+
initial: 2,
|
|
198
|
+
large: 4
|
|
199
|
+
},
|
|
188
200
|
background: "neutral0",
|
|
189
201
|
children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Error, {})
|
|
190
202
|
});
|
|
191
203
|
}
|
|
192
204
|
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
|
|
193
|
-
height: "100dvh",
|
|
194
205
|
width: "100dvw",
|
|
195
206
|
position: "fixed",
|
|
196
|
-
top:
|
|
207
|
+
top: {
|
|
208
|
+
initial: strapiAdmin.HEIGHT_TOP_NAVIGATION,
|
|
209
|
+
large: 0
|
|
210
|
+
},
|
|
211
|
+
bottom: 0,
|
|
197
212
|
left: 0,
|
|
198
|
-
zIndex:
|
|
213
|
+
zIndex: {
|
|
214
|
+
initial: 2,
|
|
215
|
+
large: 4
|
|
216
|
+
},
|
|
199
217
|
background: "neutral0",
|
|
200
218
|
children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Protect, {
|
|
201
219
|
permissions: permissions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"History.js","sources":["../../../../admin/src/history/pages/History.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useQueryParams, Page, createContext, useRBAC } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, FocusTrap, Main, Portal, Link } from '@strapi/design-system';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { Navigate, useParams, NavLink } from 'react-router-dom';\n\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { PERMISSIONS } from '../../constants/plugin';\nimport { DocumentRBAC } from '../../features/DocumentRBAC';\nimport { useDocument } from '../../hooks/useDocument';\nimport { type EditLayout, useDocumentLayout } from '../../hooks/useDocumentLayout';\nimport { useGetContentTypeConfigurationQuery } from '../../services/contentTypes';\nimport { buildValidParams } from '../../utils/api';\nimport { VersionContent } from '../components/VersionContent';\nimport { VersionHeader } from '../components/VersionHeader';\nimport { VersionsList } from '../components/VersionsList';\nimport { useGetHistoryVersionsQuery } from '../services/historyVersion';\n\nimport type {\n ContentType,\n FindContentTypeConfiguration,\n} from '../../../../shared/contracts/content-types';\nimport type {\n HistoryVersionDataResponse,\n GetHistoryVersions,\n} from '../../../../shared/contracts/history-versions';\nimport type { UID } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * HistoryProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface HistoryContextValue {\n contentType: UID.ContentType;\n id?: string; // null for single types\n layout: EditLayout['layout'];\n configuration: FindContentTypeConfiguration.Response['data'];\n selectedVersion: HistoryVersionDataResponse;\n // Errors are handled outside of the provider, so we exclude errors from the response type\n versions: Extract<GetHistoryVersions.Response, { data: Array<HistoryVersionDataResponse> }>;\n page: number;\n mainField: string;\n schema: ContentType;\n}\n\nconst [HistoryProvider, useHistoryContext] = createContext<HistoryContextValue>('HistoryPage');\n\n/* -------------------------------------------------------------------------------------------------\n * HistoryPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst HistoryPage = () => {\n const headerId = React.useId();\n const { formatMessage } = useIntl();\n const {\n slug,\n id: documentId,\n collectionType,\n } = useParams<{\n collectionType: string;\n slug: UID.ContentType;\n id: string;\n }>();\n\n const { isLoading: isLoadingDocument, schema } = useDocument({\n collectionType: collectionType!,\n model: slug!,\n });\n\n const {\n isLoading: isLoadingLayout,\n edit: {\n layout,\n settings: { displayName, mainField },\n },\n } = useDocumentLayout(slug!);\n const { data: configuration, isLoading: isLoadingConfiguration } =\n useGetContentTypeConfigurationQuery(slug!);\n\n // Parse state from query params\n const [{ query }] = useQueryParams<{\n page?: number;\n id?: string;\n plugins?: Record<string, unknown>;\n }>();\n const { id: selectedVersionId, ...queryWithoutId } = query;\n const validQueryParamsWithoutId = buildValidParams(queryWithoutId);\n const page = validQueryParamsWithoutId.page ? Number(validQueryParamsWithoutId.page) : 1;\n\n const versionsResponse = useGetHistoryVersionsQuery(\n {\n contentType: slug!,\n ...(documentId ? { documentId } : {}),\n // Omit id since it's not needed by the endpoint and caused extra refetches\n ...validQueryParamsWithoutId,\n },\n { refetchOnMountOrArgChange: true }\n );\n\n /**\n * When the page is first mounted, if there's already data in the cache, RTK has a fullfilled\n * status for the first render, right before it triggers a new request. This means the code\n * briefly reaches the part that redirects to the first history version (if none is set).\n * But since that data is stale, that means auto-selecting a version that may not be the most\n * recent. To avoid this, we identify through requestId if the query is stale despite the\n * fullfilled status, and show the loader in that case.\n * This means we essentially don't want cache. We always refetch when the page mounts, and\n * we always show the loader until we have the most recent data. That's fine for this page.\n */\n const initialRequestId = React.useRef(versionsResponse.requestId);\n const isStaleRequest = versionsResponse.requestId === initialRequestId.current;\n\n /**\n * Ensure that we have the necessary data to render the page:\n * - slug for single types\n * - slug _and_ documentId for collection types\n */\n if (!slug || (collectionType === COLLECTION_TYPES && !documentId)) {\n return <Navigate to=\"/content-manager\" />;\n }\n\n if (\n isLoadingDocument ||\n isLoadingLayout ||\n versionsResponse.isFetching ||\n isStaleRequest ||\n isLoadingConfiguration\n ) {\n return <Page.Loading />;\n }\n\n // It was a success, handle empty data\n if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {\n return (\n <>\n <Page.NoData\n action={\n <Link\n tag={NavLink}\n to={`/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ''}`}\n >\n {formatMessage({\n id: 'global.back',\n defaultMessage: 'Back',\n })}\n </Link>\n }\n />\n </>\n );\n }\n\n // We have data, handle selected version\n if (versionsResponse.data?.data?.length && !selectedVersionId) {\n return (\n <Navigate\n to={{ search: stringify({ ...query, id: versionsResponse.data.data[0].id }) }}\n replace\n />\n );\n }\n\n const selectedVersion = versionsResponse.data?.data?.find(\n (version) => version.id.toString() === selectedVersionId\n );\n if (\n versionsResponse.isError ||\n !layout ||\n !schema ||\n !selectedVersion ||\n !configuration ||\n // This should not happen as it's covered by versionsResponse.isError, but we need it for TS\n versionsResponse.data.error\n ) {\n return <Page.Error />;\n }\n\n return (\n <>\n <Page.Title>\n {formatMessage(\n {\n id: 'content-manager.history.page-title',\n defaultMessage: '{contentType} history',\n },\n {\n contentType: displayName,\n }\n )}\n </Page.Title>\n <HistoryProvider\n contentType={slug}\n id={documentId}\n schema={schema}\n layout={layout}\n configuration={configuration}\n selectedVersion={selectedVersion}\n versions={versionsResponse.data}\n page={page}\n mainField={mainField}\n >\n <Flex direction=\"row\" alignItems=\"flex-start\">\n <Main\n grow={1}\n height=\"100dvh\"\n background=\"neutral100\"\n paddingBottom={6}\n overflow=\"auto\"\n labelledBy={headerId}\n >\n <VersionHeader headerId={headerId} />\n\n <VersionContent />\n </Main>\n <VersionsList />\n </Flex>\n </HistoryProvider>\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ProtectedHistoryPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedHistoryPageImpl = () => {\n const { slug } = useParams<{\n slug: string;\n }>();\n const {\n permissions = [],\n isLoading,\n error,\n } = useRBAC(PERMISSIONS.map((action) => ({ action, subject: slug })));\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !slug) {\n return (\n <Box\n height=\"100dvh\"\n width=\"100dvw\"\n position=\"fixed\"\n top={0}\n left={0}\n zIndex={4}\n background=\"neutral0\"\n >\n <Page.Error />\n </Box>\n );\n }\n\n return (\n <Box\n height=\"100dvh\"\n width=\"100dvw\"\n position=\"fixed\"\n top={0}\n left={0}\n zIndex={4}\n background=\"neutral0\"\n >\n <Page.Protect permissions={permissions}>\n {({ permissions }) => (\n <DocumentRBAC permissions={permissions}>\n <HistoryPage />\n </DocumentRBAC>\n )}\n </Page.Protect>\n </Box>\n );\n};\n\nconst ProtectedHistoryPage = () => {\n return (\n <Portal>\n <FocusTrap>\n <ProtectedHistoryPageImpl />\n </FocusTrap>\n </Portal>\n );\n};\n\nexport { ProtectedHistoryPage, HistoryProvider, useHistoryContext };\nexport type { HistoryContextValue };\n"],"names":["HistoryProvider","useHistoryContext","createContext","HistoryPage","headerId","React","useId","formatMessage","useIntl","slug","id","documentId","collectionType","useParams","isLoading","isLoadingDocument","schema","useDocument","model","isLoadingLayout","edit","layout","settings","displayName","mainField","useDocumentLayout","data","configuration","isLoadingConfiguration","useGetContentTypeConfigurationQuery","query","useQueryParams","selectedVersionId","queryWithoutId","validQueryParamsWithoutId","buildValidParams","page","Number","versionsResponse","useGetHistoryVersionsQuery","contentType","refetchOnMountOrArgChange","initialRequestId","useRef","requestId","isStaleRequest","current","COLLECTION_TYPES","_jsx","Navigate","to","isFetching","Page","Loading","isError","length","_Fragment","NoData","action","Link","tag","NavLink","defaultMessage","search","stringify","replace","selectedVersion","find","version","toString","error","Error","_jsxs","Title","versions","Flex","direction","alignItems","Main","grow","height","background","paddingBottom","overflow","labelledBy","VersionHeader","VersionContent","VersionsList","ProtectedHistoryPageImpl","permissions","useRBAC","PERMISSIONS","map","subject","Box","width","position","top","left","zIndex","Protect","DocumentRBAC","Protect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B,UAAW,EAAA,UAAA;oCAEXjC,cAAA,CAACI,iBAAKmB,KAAK,EAAA,EAAA;;AAGjB;AAEA,IAAA,qBACEvB,cAAC8C,CAAAA,gBAAAA,EAAAA;QACCd,MAAO,EAAA,QAAA;QACPe,KAAM,EAAA,QAAA;QACNC,QAAS,EAAA,OAAA;QACTC,GAAK,EAAA,CAAA;QACLC,IAAM,EAAA,CAAA;QACNC,MAAQ,EAAA,CAAA;QACRlB,UAAW,EAAA,UAAA;gCAEXjC,cAAA,CAACI,iBAAKgD,OAAO,EAAA;YAACX,WAAaA,EAAAA,WAAAA;AACxB,YAAA,QAAA,EAAA,CAAC,EAAEA,WAAW,EAAE,iBACfzC,cAACqD,CAAAA,yBAAAA,EAAAA;oBAAaZ,WAAaA,EAAAA,WAAAA;AACzB,oBAAA,QAAA,gBAAAzC,cAAC7C,CAAAA,WAAAA,EAAAA,EAAAA;;;;AAMb,CAAA;AAEA,MAAMmG,oBAAuB,GAAA,IAAA;AAC3B,IAAA,qBACEtD,cAACuD,CAAAA,mBAAAA,EAAAA;AACC,QAAA,QAAA,gBAAAvD,cAACwD,CAAAA,sBAAAA,EAAAA;AACC,YAAA,QAAA,gBAAAxD,cAACwC,CAAAA,wBAAAA,EAAAA,EAAAA;;;AAIT;;;;;;"}
|
|
1
|
+
{"version":3,"file":"History.js","sources":["../../../../admin/src/history/pages/History.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useQueryParams,\n Page,\n createContext,\n useRBAC,\n HEIGHT_TOP_NAVIGATION,\n} from '@strapi/admin/strapi-admin';\nimport { Box, Flex, FocusTrap, Main, Portal, Link } from '@strapi/design-system';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { Navigate, useParams, NavLink } from 'react-router-dom';\n\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { PERMISSIONS } from '../../constants/plugin';\nimport { DocumentRBAC } from '../../features/DocumentRBAC';\nimport { useDocument } from '../../hooks/useDocument';\nimport { type EditLayout, useDocumentLayout } from '../../hooks/useDocumentLayout';\nimport { useGetContentTypeConfigurationQuery } from '../../services/contentTypes';\nimport { buildValidParams } from '../../utils/api';\nimport { VersionContent } from '../components/VersionContent';\nimport { VersionHeader } from '../components/VersionHeader';\nimport { VersionsList } from '../components/VersionsList';\nimport { useGetHistoryVersionsQuery } from '../services/historyVersion';\n\nimport type {\n ContentType,\n FindContentTypeConfiguration,\n} from '../../../../shared/contracts/content-types';\nimport type {\n HistoryVersionDataResponse,\n GetHistoryVersions,\n} from '../../../../shared/contracts/history-versions';\nimport type { UID } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * HistoryProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface HistoryContextValue {\n contentType: UID.ContentType;\n id?: string; // null for single types\n layout: EditLayout['layout'];\n configuration: FindContentTypeConfiguration.Response['data'];\n selectedVersion: HistoryVersionDataResponse;\n // Errors are handled outside of the provider, so we exclude errors from the response type\n versions: Extract<GetHistoryVersions.Response, { data: Array<HistoryVersionDataResponse> }>;\n page: number;\n mainField: string;\n schema: ContentType;\n}\n\nconst [HistoryProvider, useHistoryContext] = createContext<HistoryContextValue>('HistoryPage');\n\n/* -------------------------------------------------------------------------------------------------\n * HistoryPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst HistoryPage = () => {\n const headerId = React.useId();\n const { formatMessage } = useIntl();\n const {\n slug,\n id: documentId,\n collectionType,\n } = useParams<{\n collectionType: string;\n slug: UID.ContentType;\n id: string;\n }>();\n\n const { isLoading: isLoadingDocument, schema } = useDocument({\n collectionType: collectionType!,\n model: slug!,\n });\n\n const {\n isLoading: isLoadingLayout,\n edit: {\n layout,\n settings: { displayName, mainField },\n },\n } = useDocumentLayout(slug!);\n const { data: configuration, isLoading: isLoadingConfiguration } =\n useGetContentTypeConfigurationQuery(slug!);\n\n // Parse state from query params\n const [{ query }] = useQueryParams<{\n page?: number;\n id?: string;\n plugins?: Record<string, unknown>;\n }>();\n const { id: selectedVersionId, ...queryWithoutId } = query;\n const validQueryParamsWithoutId = buildValidParams(queryWithoutId);\n const page = validQueryParamsWithoutId.page ? Number(validQueryParamsWithoutId.page) : 1;\n\n const versionsResponse = useGetHistoryVersionsQuery(\n {\n contentType: slug!,\n ...(documentId ? { documentId } : {}),\n // Omit id since it's not needed by the endpoint and caused extra refetches\n ...validQueryParamsWithoutId,\n },\n { refetchOnMountOrArgChange: true }\n );\n\n /**\n * When the page is first mounted, if there's already data in the cache, RTK has a fullfilled\n * status for the first render, right before it triggers a new request. This means the code\n * briefly reaches the part that redirects to the first history version (if none is set).\n * But since that data is stale, that means auto-selecting a version that may not be the most\n * recent. To avoid this, we identify through requestId if the query is stale despite the\n * fullfilled status, and show the loader in that case.\n * This means we essentially don't want cache. We always refetch when the page mounts, and\n * we always show the loader until we have the most recent data. That's fine for this page.\n */\n const initialRequestId = React.useRef(versionsResponse.requestId);\n const isStaleRequest = versionsResponse.requestId === initialRequestId.current;\n\n /**\n * Ensure that we have the necessary data to render the page:\n * - slug for single types\n * - slug _and_ documentId for collection types\n */\n if (!slug || (collectionType === COLLECTION_TYPES && !documentId)) {\n return <Navigate to=\"/content-manager\" />;\n }\n\n if (\n isLoadingDocument ||\n isLoadingLayout ||\n versionsResponse.isFetching ||\n isStaleRequest ||\n isLoadingConfiguration\n ) {\n return <Page.Loading />;\n }\n\n // It was a success, handle empty data\n if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {\n return (\n <>\n <Page.NoData\n action={\n <Link\n tag={NavLink}\n to={`/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ''}`}\n >\n {formatMessage({\n id: 'global.back',\n defaultMessage: 'Back',\n })}\n </Link>\n }\n />\n </>\n );\n }\n\n // We have data, handle selected version\n if (versionsResponse.data?.data?.length && !selectedVersionId) {\n return (\n <Navigate\n to={{ search: stringify({ ...query, id: versionsResponse.data.data[0].id }) }}\n replace\n />\n );\n }\n\n const selectedVersion = versionsResponse.data?.data?.find(\n (version) => version.id.toString() === selectedVersionId\n );\n if (\n versionsResponse.isError ||\n !layout ||\n !schema ||\n !selectedVersion ||\n !configuration ||\n // This should not happen as it's covered by versionsResponse.isError, but we need it for TS\n versionsResponse.data.error\n ) {\n return <Page.Error />;\n }\n\n return (\n <>\n <Page.Title>\n {formatMessage(\n {\n id: 'content-manager.history.page-title',\n defaultMessage: '{contentType} history',\n },\n {\n contentType: displayName,\n }\n )}\n </Page.Title>\n <HistoryProvider\n contentType={slug}\n id={documentId}\n schema={schema}\n layout={layout}\n configuration={configuration}\n selectedVersion={selectedVersion}\n versions={versionsResponse.data}\n page={page}\n mainField={mainField}\n >\n <Flex\n direction={{ initial: 'column', medium: 'row' }}\n alignItems=\"flex-start\"\n height=\"100%\"\n overflow=\"hidden\"\n >\n <Main\n grow={1}\n width=\"100%\"\n height=\"100%\"\n background=\"neutral100\"\n paddingBottom={6}\n overflow=\"hidden auto\"\n labelledBy={headerId}\n >\n <VersionHeader headerId={headerId} />\n <VersionContent />\n </Main>\n <VersionsList />\n </Flex>\n </HistoryProvider>\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ProtectedHistoryPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedHistoryPageImpl = () => {\n const { slug } = useParams<{\n slug: string;\n }>();\n const {\n permissions = [],\n isLoading,\n error,\n } = useRBAC(PERMISSIONS.map((action) => ({ action, subject: slug })));\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !slug) {\n return (\n <Box\n width=\"100dvw\"\n position=\"fixed\"\n top={{ initial: HEIGHT_TOP_NAVIGATION, large: 0 }}\n bottom={0}\n left={0}\n zIndex={{ initial: 2, large: 4 }}\n background=\"neutral0\"\n >\n <Page.Error />\n </Box>\n );\n }\n\n return (\n <Box\n width=\"100dvw\"\n position=\"fixed\"\n top={{ initial: HEIGHT_TOP_NAVIGATION, large: 0 }}\n bottom={0}\n left={0}\n zIndex={{ initial: 2, large: 4 }}\n background=\"neutral0\"\n >\n <Page.Protect permissions={permissions}>\n {({ permissions }) => (\n <DocumentRBAC permissions={permissions}>\n <HistoryPage />\n </DocumentRBAC>\n )}\n </Page.Protect>\n </Box>\n );\n};\n\nconst ProtectedHistoryPage = () => {\n return (\n <Portal>\n <FocusTrap>\n <ProtectedHistoryPageImpl />\n </FocusTrap>\n </Portal>\n );\n};\n\nexport { ProtectedHistoryPage, HistoryProvider, useHistoryContext };\nexport type { HistoryContextValue };\n"],"names":["HistoryProvider","useHistoryContext","createContext","HistoryPage","headerId","React","useId","formatMessage","useIntl","slug","id","documentId","collectionType","useParams","isLoading","isLoadingDocument","schema","useDocument","model","isLoadingLayout","edit","layout","settings","displayName","mainField","useDocumentLayout","data","configuration","isLoadingConfiguration","useGetContentTypeConfigurationQuery","query","useQueryParams","selectedVersionId","queryWithoutId","validQueryParamsWithoutId","buildValidParams","page","Number","versionsResponse","useGetHistoryVersionsQuery","contentType","refetchOnMountOrArgChange","initialRequestId","useRef","requestId","isStaleRequest","current","COLLECTION_TYPES","_jsx","Navigate","to","isFetching","Page","Loading","isError","length","_Fragment","NoData","action","Link","tag","NavLink","defaultMessage","search","stringify","replace","selectedVersion","find","version","toString","error","Error","_jsxs","Title","versions","Flex","direction","initial","medium","alignItems","height","overflow","Main","grow","width","background","paddingBottom","labelledBy","VersionHeader","VersionContent","VersionsList","ProtectedHistoryPageImpl","permissions","useRBAC","PERMISSIONS","map","subject","Box","position","top","HEIGHT_TOP_NAVIGATION","large","bottom","left","zIndex","Protect","DocumentRBAC","ProtectedHistoryPage","Portal","FocusTrap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAM,CAACA,eAAAA,EAAiBC,iBAAkB,CAAA,GAAGC,yBAAmC,CAAA,aAAA;AAEhF;;AAEkG,qGAElG,MAAMC,WAAc,GAAA,IAAA;IAClB,MAAMC,QAAAA,GAAWC,iBAAMC,KAAK,EAAA;IAC5B,MAAM,EAAEC,aAAa,EAAE,GAAGC,iBAAAA,EAAAA;IA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A,EAAA;;AAGjB;AAEA,IAAA,qBACEvB,cAACiD,CAAAA,gBAAAA,EAAAA;QACCb,KAAM,EAAA,QAAA;QACNc,QAAS,EAAA,OAAA;QACTC,GAAK,EAAA;YAAEtB,OAASuB,EAAAA,iCAAAA;YAAuBC,KAAO,EAAA;AAAE,SAAA;QAChDC,MAAQ,EAAA,CAAA;QACRC,IAAM,EAAA,CAAA;QACNC,MAAQ,EAAA;YAAE3B,OAAS,EAAA,CAAA;YAAGwB,KAAO,EAAA;AAAE,SAAA;QAC/BhB,UAAW,EAAA,UAAA;gCAEXrC,cAAA,CAACI,iBAAKqD,OAAO,EAAA;YAACb,WAAaA,EAAAA,WAAAA;AACxB,YAAA,QAAA,EAAA,CAAC,EAAEA,WAAW,EAAE,iBACf5C,cAAC0D,CAAAA,yBAAAA,EAAAA;oBAAad,WAAaA,EAAAA,WAAAA;AACzB,oBAAA,QAAA,gBAAA5C,cAAC7C,CAAAA,WAAAA,EAAAA,EAAAA;;;;AAMb,CAAA;AAEA,MAAMwG,oBAAuB,GAAA,IAAA;AAC3B,IAAA,qBACE3D,cAAC4D,CAAAA,mBAAAA,EAAAA;AACC,QAAA,QAAA,gBAAA5D,cAAC6D,CAAAA,sBAAAA,EAAAA;AACC,YAAA,QAAA,gBAAA7D,cAAC2C,CAAAA,wBAAAA,EAAAA,EAAAA;;;AAIT;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { createContext, useRBAC, Page, useQueryParams } from '@strapi/admin/strapi-admin';
|
|
3
|
+
import { createContext, useRBAC, Page, HEIGHT_TOP_NAVIGATION, useQueryParams } from '@strapi/admin/strapi-admin';
|
|
4
4
|
import { Portal, FocusTrap, Box, Link, Flex, Main } from '@strapi/design-system';
|
|
5
5
|
import { stringify } from 'qs';
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
@@ -121,15 +121,21 @@ const [HistoryProvider, useHistoryContext] = createContext('HistoryPage');
|
|
|
121
121
|
page: page,
|
|
122
122
|
mainField: mainField,
|
|
123
123
|
children: /*#__PURE__*/ jsxs(Flex, {
|
|
124
|
-
direction:
|
|
124
|
+
direction: {
|
|
125
|
+
initial: 'column',
|
|
126
|
+
medium: 'row'
|
|
127
|
+
},
|
|
125
128
|
alignItems: "flex-start",
|
|
129
|
+
height: "100%",
|
|
130
|
+
overflow: "hidden",
|
|
126
131
|
children: [
|
|
127
132
|
/*#__PURE__*/ jsxs(Main, {
|
|
128
133
|
grow: 1,
|
|
129
|
-
|
|
134
|
+
width: "100%",
|
|
135
|
+
height: "100%",
|
|
130
136
|
background: "neutral100",
|
|
131
137
|
paddingBottom: 6,
|
|
132
|
-
overflow: "auto",
|
|
138
|
+
overflow: "hidden auto",
|
|
133
139
|
labelledBy: headerId,
|
|
134
140
|
children: [
|
|
135
141
|
/*#__PURE__*/ jsx(VersionHeader, {
|
|
@@ -158,23 +164,35 @@ const [HistoryProvider, useHistoryContext] = createContext('HistoryPage');
|
|
|
158
164
|
}
|
|
159
165
|
if (error || !slug) {
|
|
160
166
|
return /*#__PURE__*/ jsx(Box, {
|
|
161
|
-
height: "100dvh",
|
|
162
167
|
width: "100dvw",
|
|
163
168
|
position: "fixed",
|
|
164
|
-
top:
|
|
169
|
+
top: {
|
|
170
|
+
initial: HEIGHT_TOP_NAVIGATION,
|
|
171
|
+
large: 0
|
|
172
|
+
},
|
|
173
|
+
bottom: 0,
|
|
165
174
|
left: 0,
|
|
166
|
-
zIndex:
|
|
175
|
+
zIndex: {
|
|
176
|
+
initial: 2,
|
|
177
|
+
large: 4
|
|
178
|
+
},
|
|
167
179
|
background: "neutral0",
|
|
168
180
|
children: /*#__PURE__*/ jsx(Page.Error, {})
|
|
169
181
|
});
|
|
170
182
|
}
|
|
171
183
|
return /*#__PURE__*/ jsx(Box, {
|
|
172
|
-
height: "100dvh",
|
|
173
184
|
width: "100dvw",
|
|
174
185
|
position: "fixed",
|
|
175
|
-
top:
|
|
186
|
+
top: {
|
|
187
|
+
initial: HEIGHT_TOP_NAVIGATION,
|
|
188
|
+
large: 0
|
|
189
|
+
},
|
|
190
|
+
bottom: 0,
|
|
176
191
|
left: 0,
|
|
177
|
-
zIndex:
|
|
192
|
+
zIndex: {
|
|
193
|
+
initial: 2,
|
|
194
|
+
large: 4
|
|
195
|
+
},
|
|
178
196
|
background: "neutral0",
|
|
179
197
|
children: /*#__PURE__*/ jsx(Page.Protect, {
|
|
180
198
|
permissions: permissions,
|