@strapi/content-manager 0.0.0-next.973df62640087231761ffaeb1c2b5d0d706346d8 → 0.0.0-next.a28002c793bc4de2a8b3c6c5b9c2336c5a6db7a9
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/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -1
- package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BCCTDNe1.js → ComponentConfigurationPage-DquE3cSt.js} +4 -5
- package/dist/_chunks/{ComponentConfigurationPage-BCCTDNe1.js.map → ComponentConfigurationPage-DquE3cSt.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-CsMNJw_0.mjs → ComponentConfigurationPage-xgUutqCq.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-CsMNJw_0.mjs.map → ComponentConfigurationPage-xgUutqCq.mjs.map} +1 -1
- package/dist/_chunks/{ComponentIcon-BXdiCGQp.js → ComponentIcon-CRbtQEUV.js} +2 -3
- package/dist/_chunks/{ComponentIcon-BXdiCGQp.js.map → ComponentIcon-CRbtQEUV.js.map} +1 -1
- package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -1
- package/dist/_chunks/{EditConfigurationPage-BkEV5bFT.mjs → EditConfigurationPage-BxxS_VjE.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BkEV5bFT.mjs.map → EditConfigurationPage-BxxS_VjE.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DC1Bpfr1.js → EditConfigurationPage-DBZcYu4y.js} +4 -5
- package/dist/_chunks/{EditConfigurationPage-DC1Bpfr1.js.map → EditConfigurationPage-DBZcYu4y.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-Bc97GGF4.mjs → EditViewPage-CxbLxtSZ.mjs} +3 -3
- package/dist/_chunks/{EditViewPage-Bc97GGF4.mjs.map → EditViewPage-CxbLxtSZ.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-B_Gr-2r6.js → EditViewPage-eVQAzqrX.js} +4 -5
- package/dist/_chunks/{EditViewPage-B_Gr-2r6.js.map → EditViewPage-eVQAzqrX.js.map} +1 -1
- package/dist/_chunks/{Field-CqmTpeRt.js → Field-B1V9AyU1.js} +167 -127
- package/dist/_chunks/Field-B1V9AyU1.js.map +1 -0
- package/dist/_chunks/{Field-CIuPhh1m.mjs → Field-CZwQcrmw.mjs} +165 -125
- package/dist/_chunks/Field-CZwQcrmw.mjs.map +1 -0
- package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
- package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
- package/dist/_chunks/{Form-C22QTzNy.mjs → Form-3kEYdc-J.mjs} +3 -3
- package/dist/_chunks/{Form-C22QTzNy.mjs.map → Form-3kEYdc-J.mjs.map} +1 -1
- package/dist/_chunks/{Form-BRlXI9Ey.js → Form-DDb5-H01.js} +5 -6
- package/dist/_chunks/{Form-BRlXI9Ey.js.map → Form-DDb5-H01.js.map} +1 -1
- package/dist/_chunks/{History-mYpwx4Rh.js → History-COpTRR4s.js} +37 -61
- package/dist/_chunks/History-COpTRR4s.js.map +1 -0
- package/dist/_chunks/{History-nFKCaE9Y.mjs → History-DXZrV891.mjs} +37 -60
- package/dist/_chunks/History-DXZrV891.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-vjQ_UKxh.mjs → ListConfigurationPage-B1BlI0vS.mjs} +6 -5
- package/dist/_chunks/ListConfigurationPage-B1BlI0vS.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-CXwjTP1m.js → ListConfigurationPage-D5zn8EA8.js} +6 -6
- package/dist/_chunks/ListConfigurationPage-D5zn8EA8.js.map +1 -0
- package/dist/_chunks/{ListViewPage-Cf1E8F2V.mjs → ListViewPage-CfHJAt9S.mjs} +50 -49
- package/dist/_chunks/ListViewPage-CfHJAt9S.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-DFq-_rFt.js → ListViewPage-OqGWxoXp.js} +51 -51
- package/dist/_chunks/ListViewPage-OqGWxoXp.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-CpFh_nLX.mjs → NoContentTypePage-B1vde0d2.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CpFh_nLX.mjs.map → NoContentTypePage-B1vde0d2.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BUnPLdSC.js → NoContentTypePage-BwuxzVhz.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-BUnPLdSC.js.map → NoContentTypePage-BwuxzVhz.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-GgY8yEd6.mjs → NoPermissionsPage-BZx6YZ0-.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-GgY8yEd6.mjs.map → NoPermissionsPage-BZx6YZ0-.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DlEaSUxx.js → NoPermissionsPage-CM4q9eyp.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DlEaSUxx.js.map → NoPermissionsPage-CM4q9eyp.js.map} +1 -1
- package/dist/_chunks/{Preview-BPBvJI2O.js → Preview-DZWvwEHg.js} +77 -72
- package/dist/_chunks/Preview-DZWvwEHg.js.map +1 -0
- package/dist/_chunks/{Preview-BbRS-OKT.mjs → Preview-DeD_aLg6.mjs} +78 -72
- package/dist/_chunks/Preview-DeD_aLg6.mjs.map +1 -0
- package/dist/_chunks/{Relations-C1HdkZyt.js → Relations-DXVAOSqj.js} +7 -10
- package/dist/_chunks/{Relations-C1HdkZyt.js.map → Relations-DXVAOSqj.js.map} +1 -1
- package/dist/_chunks/{Relations-CkIXcHbJ.mjs → Relations-i1BqMPqp.mjs} +6 -8
- package/dist/_chunks/{Relations-CkIXcHbJ.mjs.map → Relations-i1BqMPqp.mjs.map} +1 -1
- package/dist/_chunks/{en-CHOp_xJv.js → en-BzQmavmK.js} +11 -3
- package/dist/_chunks/{en-CHOp_xJv.js.map → en-BzQmavmK.js.map} +1 -1
- package/dist/_chunks/{en-D_BMf0hT.mjs → en-CSxLmrh1.mjs} +11 -3
- package/dist/_chunks/{en-D_BMf0hT.mjs.map → en-CSxLmrh1.mjs.map} +1 -1
- package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
- package/dist/_chunks/{index-BL9NYW88.js → index-D9vDl-4J.js} +279 -165
- package/dist/_chunks/index-D9vDl-4J.js.map +1 -0
- package/dist/_chunks/{index-C_KAytfk.mjs → index-Rej95OkL.mjs} +279 -164
- package/dist/_chunks/index-Rej95OkL.mjs.map +1 -0
- package/dist/_chunks/{layout-_a2iPFa6.js → layout-B4X3h5C4.js} +5 -6
- package/dist/_chunks/{layout-_a2iPFa6.js.map → layout-B4X3h5C4.js.map} +1 -1
- package/dist/_chunks/{layout-D6QIbKn7.mjs → layout-CKw8rE38.mjs} +4 -4
- package/dist/_chunks/{layout-D6QIbKn7.mjs.map → layout-CKw8rE38.mjs.map} +1 -1
- package/dist/_chunks/objects-BcXOv6_9.js.map +1 -1
- package/dist/_chunks/objects-D6yBsdmx.mjs.map +1 -1
- package/dist/_chunks/{relations-BX-k1SIX.js → relations-CvZ0Uu8l.js} +2 -2
- package/dist/_chunks/{relations-BX-k1SIX.js.map → relations-CvZ0Uu8l.js.map} +1 -1
- package/dist/_chunks/{relations-BIejV2xk.mjs → relations-GpHbwwdj.mjs} +2 -2
- package/dist/_chunks/{relations-BIejV2xk.mjs.map → relations-GpHbwwdj.mjs.map} +1 -1
- package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -1
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -1
- package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
- package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
- package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
- package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +2 -1
- package/dist/admin/src/content-manager.d.ts +3 -2
- package/dist/admin/src/exports.d.ts +1 -0
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +3 -3
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
- package/dist/admin/src/preview/services/preview.d.ts +1 -1
- package/dist/admin/src/services/api.d.ts +1 -1
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +3 -3
- package/dist/admin/src/services/documents.d.ts +16 -19
- package/dist/admin/src/services/init.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +2 -2
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/server/index.js +230 -187
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +231 -187
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +1 -0
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
- package/dist/server/src/history/controllers/history-version.d.ts +1 -1
- package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
- package/dist/server/src/history/services/history.d.ts +3 -3
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +6 -10
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +3 -2
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -1
- package/dist/server/src/preview/index.d.ts.map +1 -1
- package/dist/server/src/preview/services/index.d.ts +1 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -1
- package/dist/server/src/preview/services/preview-config.d.ts +2 -0
- package/dist/server/src/preview/services/preview-config.d.ts.map +1 -1
- package/dist/server/src/preview/utils.d.ts +1 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -1
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +4 -2
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +3 -2
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
- package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
- package/dist/server/src/services/utils/populate.d.ts +2 -2
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/package.json +12 -11
- package/dist/_chunks/Field-CIuPhh1m.mjs.map +0 -1
- package/dist/_chunks/Field-CqmTpeRt.js.map +0 -1
- package/dist/_chunks/History-mYpwx4Rh.js.map +0 -1
- package/dist/_chunks/History-nFKCaE9Y.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-CXwjTP1m.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-vjQ_UKxh.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-Cf1E8F2V.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-DFq-_rFt.js.map +0 -1
- package/dist/_chunks/Preview-BPBvJI2O.js.map +0 -1
- package/dist/_chunks/Preview-BbRS-OKT.mjs.map +0 -1
- package/dist/_chunks/index-BL9NYW88.js.map +0 -1
- package/dist/_chunks/index-C_KAytfk.mjs.map +0 -1
- package/dist/admin/src/preview/constants.d.ts +0 -1
- package/dist/server/src/preview/constants.d.ts +0 -2
- package/dist/server/src/preview/constants.d.ts.map +0 -1
@@ -7,16 +7,15 @@ const designSystem = require("@strapi/design-system");
|
|
7
7
|
const mapValues = require("lodash/fp/mapValues");
|
8
8
|
const reactIntl = require("react-intl");
|
9
9
|
const reactRouterDom = require("react-router-dom");
|
10
|
+
const styledComponents = require("styled-components");
|
10
11
|
const yup = require("yup");
|
12
|
+
const qs = require("qs");
|
11
13
|
const pipe = require("lodash/fp/pipe");
|
12
14
|
const dateFns = require("date-fns");
|
13
|
-
const styledComponents = require("styled-components");
|
14
|
-
const qs = require("qs");
|
15
15
|
const toolkit = require("@reduxjs/toolkit");
|
16
16
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
17
17
|
function _interopNamespace(e) {
|
18
|
-
if (e && e.__esModule)
|
19
|
-
return e;
|
18
|
+
if (e && e.__esModule) return e;
|
20
19
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
21
20
|
if (e) {
|
22
21
|
for (const k in e) {
|
@@ -36,13 +35,20 @@ const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
36
35
|
const mapValues__default = /* @__PURE__ */ _interopDefault(mapValues);
|
37
36
|
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
38
37
|
const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
|
39
|
-
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
38
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
40
39
|
const v = glob[path];
|
41
40
|
if (v) {
|
42
41
|
return typeof v === "function" ? v() : Promise.resolve(v);
|
43
42
|
}
|
44
43
|
return new Promise((_, reject) => {
|
45
|
-
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
44
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
45
|
+
reject.bind(
|
46
|
+
null,
|
47
|
+
new Error(
|
48
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
49
|
+
)
|
50
|
+
)
|
51
|
+
);
|
46
52
|
});
|
47
53
|
};
|
48
54
|
const PLUGIN_ID = "content-manager";
|
@@ -190,7 +196,8 @@ const contentManagerApi = strapiAdmin.adminApi.enhanceEndpoints({
|
|
190
196
|
"InitialData",
|
191
197
|
"HistoryVersion",
|
192
198
|
"Relations",
|
193
|
-
"UidAvailability"
|
199
|
+
"UidAvailability",
|
200
|
+
"RecentDocumentList"
|
194
201
|
]
|
195
202
|
});
|
196
203
|
const documentApi = contentManagerApi.injectEndpoints({
|
@@ -208,7 +215,7 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
208
215
|
if (error) {
|
209
216
|
return [];
|
210
217
|
}
|
211
|
-
return [{ type: "Document", id: `${model}_LIST` }];
|
218
|
+
return [{ type: "Document", id: `${model}_LIST` }, "RecentDocumentList"];
|
212
219
|
}
|
213
220
|
}),
|
214
221
|
cloneDocument: builder.mutation({
|
@@ -222,7 +229,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
222
229
|
}),
|
223
230
|
invalidatesTags: (_result, _error, { model }) => [
|
224
231
|
{ type: "Document", id: `${model}_LIST` },
|
225
|
-
{ type: "UidAvailability", id: model }
|
232
|
+
{ type: "UidAvailability", id: model },
|
233
|
+
"RecentDocumentList"
|
226
234
|
]
|
227
235
|
}),
|
228
236
|
/**
|
@@ -241,8 +249,21 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
241
249
|
invalidatesTags: (result, _error, { model }) => [
|
242
250
|
{ type: "Document", id: `${model}_LIST` },
|
243
251
|
"Relations",
|
244
|
-
{ type: "UidAvailability", id: model }
|
245
|
-
|
252
|
+
{ type: "UidAvailability", id: model },
|
253
|
+
"RecentDocumentList"
|
254
|
+
],
|
255
|
+
transformResponse: (response, meta, arg) => {
|
256
|
+
if (!("data" in response) && arg.model === "plugin::users-permissions.user") {
|
257
|
+
return {
|
258
|
+
data: response,
|
259
|
+
meta: {
|
260
|
+
availableStatus: [],
|
261
|
+
availableLocales: []
|
262
|
+
}
|
263
|
+
};
|
264
|
+
}
|
265
|
+
return response;
|
266
|
+
}
|
246
267
|
}),
|
247
268
|
deleteDocument: builder.mutation({
|
248
269
|
query: ({ collectionType, model, documentId, params }) => ({
|
@@ -253,7 +274,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
253
274
|
}
|
254
275
|
}),
|
255
276
|
invalidatesTags: (_result, _error, { collectionType, model }) => [
|
256
|
-
{ type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model }
|
277
|
+
{ type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model },
|
278
|
+
"RecentDocumentList"
|
257
279
|
]
|
258
280
|
}),
|
259
281
|
deleteManyDocuments: builder.mutation({
|
@@ -265,7 +287,10 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
265
287
|
params
|
266
288
|
}
|
267
289
|
}),
|
268
|
-
invalidatesTags: (_res, _error, { model }) => [
|
290
|
+
invalidatesTags: (_res, _error, { model }) => [
|
291
|
+
{ type: "Document", id: `${model}_LIST` },
|
292
|
+
"RecentDocumentList"
|
293
|
+
]
|
269
294
|
}),
|
270
295
|
discardDocument: builder.mutation({
|
271
296
|
query: ({ collectionType, model, documentId, params }) => ({
|
@@ -283,7 +308,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
283
308
|
},
|
284
309
|
{ type: "Document", id: `${model}_LIST` },
|
285
310
|
"Relations",
|
286
|
-
{ type: "UidAvailability", id: model }
|
311
|
+
{ type: "UidAvailability", id: model },
|
312
|
+
"RecentDocumentList"
|
287
313
|
];
|
288
314
|
}
|
289
315
|
}),
|
@@ -296,7 +322,7 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
296
322
|
url: `/content-manager/collection-types/${model}`,
|
297
323
|
method: "GET",
|
298
324
|
config: {
|
299
|
-
params
|
325
|
+
params: qs.stringify(params, { encode: true })
|
300
326
|
}
|
301
327
|
}),
|
302
328
|
providesTags: (result, _error, arg) => {
|
@@ -378,7 +404,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
378
404
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
379
405
|
},
|
380
406
|
{ type: "Document", id: `${model}_LIST` },
|
381
|
-
"Relations"
|
407
|
+
"Relations",
|
408
|
+
"RecentDocumentList"
|
382
409
|
];
|
383
410
|
}
|
384
411
|
}),
|
@@ -409,7 +436,9 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
409
436
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
410
437
|
},
|
411
438
|
"Relations",
|
412
|
-
{ type: "UidAvailability", id: model }
|
439
|
+
{ type: "UidAvailability", id: model },
|
440
|
+
"RecentDocumentList",
|
441
|
+
"RecentDocumentList"
|
413
442
|
];
|
414
443
|
},
|
415
444
|
async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {
|
@@ -439,7 +468,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
439
468
|
{
|
440
469
|
type: "Document",
|
441
470
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
442
|
-
}
|
471
|
+
},
|
472
|
+
"RecentDocumentList"
|
443
473
|
];
|
444
474
|
}
|
445
475
|
}),
|
@@ -452,7 +482,10 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
452
482
|
params
|
453
483
|
}
|
454
484
|
}),
|
455
|
-
invalidatesTags: (_res, _error, { model, documentIds }) =>
|
485
|
+
invalidatesTags: (_res, _error, { model, documentIds }) => [
|
486
|
+
...documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` })),
|
487
|
+
"RecentDocumentList"
|
488
|
+
]
|
456
489
|
})
|
457
490
|
})
|
458
491
|
});
|
@@ -475,8 +508,7 @@ const {
|
|
475
508
|
useUnpublishManyDocumentsMutation
|
476
509
|
} = documentApi;
|
477
510
|
const buildValidParams = (query) => {
|
478
|
-
if (!query)
|
479
|
-
return query;
|
511
|
+
if (!query) return query;
|
480
512
|
const { plugins: _, ...validQueryParams } = {
|
481
513
|
...query,
|
482
514
|
...Object.values(query?.plugins ?? {}).reduce(
|
@@ -484,9 +516,6 @@ const buildValidParams = (query) => {
|
|
484
516
|
{}
|
485
517
|
)
|
486
518
|
};
|
487
|
-
if ("_q" in validQueryParams) {
|
488
|
-
validQueryParams._q = encodeURIComponent(validQueryParams._q);
|
489
|
-
}
|
490
519
|
return validQueryParams;
|
491
520
|
};
|
492
521
|
const isBaseQueryError = (error) => {
|
@@ -1686,7 +1715,7 @@ const useDocumentActions = () => {
|
|
1686
1715
|
};
|
1687
1716
|
};
|
1688
1717
|
const ProtectedHistoryPage = React__namespace.lazy(
|
1689
|
-
() => Promise.resolve().then(() => require("./History-
|
1718
|
+
() => Promise.resolve().then(() => require("./History-COpTRR4s.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1690
1719
|
);
|
1691
1720
|
const routes$2 = [
|
1692
1721
|
{
|
@@ -1699,7 +1728,7 @@ const routes$2 = [
|
|
1699
1728
|
}
|
1700
1729
|
];
|
1701
1730
|
const ProtectedPreviewPage = React__namespace.lazy(
|
1702
|
-
() => Promise.resolve().then(() => require("./Preview-
|
1731
|
+
() => Promise.resolve().then(() => require("./Preview-DZWvwEHg.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
|
1703
1732
|
);
|
1704
1733
|
const routes$1 = [
|
1705
1734
|
{
|
@@ -1712,31 +1741,31 @@ const routes$1 = [
|
|
1712
1741
|
}
|
1713
1742
|
];
|
1714
1743
|
const ProtectedEditViewPage = React.lazy(
|
1715
|
-
() => Promise.resolve().then(() => require("./EditViewPage-
|
1744
|
+
() => Promise.resolve().then(() => require("./EditViewPage-eVQAzqrX.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1716
1745
|
);
|
1717
1746
|
const ProtectedListViewPage = React.lazy(
|
1718
|
-
() => Promise.resolve().then(() => require("./ListViewPage-
|
1747
|
+
() => Promise.resolve().then(() => require("./ListViewPage-OqGWxoXp.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1719
1748
|
);
|
1720
1749
|
const ProtectedListConfiguration = React.lazy(
|
1721
|
-
() => Promise.resolve().then(() => require("./ListConfigurationPage-
|
1750
|
+
() => Promise.resolve().then(() => require("./ListConfigurationPage-D5zn8EA8.js")).then((mod) => ({
|
1722
1751
|
default: mod.ProtectedListConfiguration
|
1723
1752
|
}))
|
1724
1753
|
);
|
1725
1754
|
const ProtectedEditConfigurationPage = React.lazy(
|
1726
|
-
() => Promise.resolve().then(() => require("./EditConfigurationPage-
|
1755
|
+
() => Promise.resolve().then(() => require("./EditConfigurationPage-DBZcYu4y.js")).then((mod) => ({
|
1727
1756
|
default: mod.ProtectedEditConfigurationPage
|
1728
1757
|
}))
|
1729
1758
|
);
|
1730
1759
|
const ProtectedComponentConfigurationPage = React.lazy(
|
1731
|
-
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-
|
1760
|
+
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-DquE3cSt.js")).then((mod) => ({
|
1732
1761
|
default: mod.ProtectedComponentConfigurationPage
|
1733
1762
|
}))
|
1734
1763
|
);
|
1735
1764
|
const NoPermissions = React.lazy(
|
1736
|
-
() => Promise.resolve().then(() => require("./NoPermissionsPage-
|
1765
|
+
() => Promise.resolve().then(() => require("./NoPermissionsPage-CM4q9eyp.js")).then((mod) => ({ default: mod.NoPermissions }))
|
1737
1766
|
);
|
1738
1767
|
const NoContentType = React.lazy(
|
1739
|
-
() => Promise.resolve().then(() => require("./NoContentTypePage-
|
1768
|
+
() => Promise.resolve().then(() => require("./NoContentTypePage-BwuxzVhz.js")).then((mod) => ({ default: mod.NoContentType }))
|
1740
1769
|
);
|
1741
1770
|
const CollectionTypePages = () => {
|
1742
1771
|
const { collectionType } = reactRouterDom.useParams();
|
@@ -1881,6 +1910,11 @@ const DocumentActionButton = (action) => {
|
|
1881
1910
|
) : null
|
1882
1911
|
] });
|
1883
1912
|
};
|
1913
|
+
const MenuItem = styledComponents.styled(designSystem.Menu.Item)`
|
1914
|
+
&:hover {
|
1915
|
+
background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
|
1916
|
+
}
|
1917
|
+
`;
|
1884
1918
|
const DocumentActionsMenu = ({
|
1885
1919
|
actions: actions2,
|
1886
1920
|
children,
|
@@ -1939,11 +1973,13 @@ const DocumentActionsMenu = ({
|
|
1939
1973
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
|
1940
1974
|
actions2.map((action) => {
|
1941
1975
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
1942
|
-
|
1976
|
+
MenuItem,
|
1943
1977
|
{
|
1944
1978
|
disabled: action.disabled,
|
1945
1979
|
onSelect: handleClick(action),
|
1946
1980
|
display: "block",
|
1981
|
+
isVariantDanger: action.variant === "danger",
|
1982
|
+
isDisabled: action.disabled,
|
1947
1983
|
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "space-between", gap: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
1948
1984
|
designSystem.Flex,
|
1949
1985
|
{
|
@@ -2099,6 +2135,7 @@ const PublishAction$1 = ({
|
|
2099
2135
|
const { _unstableFormatValidationErrors: formatValidationErrors } = strapiAdmin.useAPIErrorHandler();
|
2100
2136
|
const isListView = reactRouterDom.useMatch(LIST_PATH) !== null;
|
2101
2137
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
2138
|
+
const { id } = reactRouterDom.useParams();
|
2102
2139
|
const { formatMessage } = reactIntl.useIntl();
|
2103
2140
|
const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
|
2104
2141
|
const { publish } = useDocumentActions();
|
@@ -2201,10 +2238,12 @@ const PublishAction$1 = ({
|
|
2201
2238
|
transformData(formValues)
|
2202
2239
|
);
|
2203
2240
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2204
|
-
|
2205
|
-
|
2206
|
-
|
2207
|
-
|
2241
|
+
if (id === "create") {
|
2242
|
+
navigate({
|
2243
|
+
pathname: `../${collectionType}/${model}/${res.data.documentId}`,
|
2244
|
+
search: rawQuery
|
2245
|
+
});
|
2246
|
+
}
|
2208
2247
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2209
2248
|
setErrors(formatValidationErrors(res.error));
|
2210
2249
|
}
|
@@ -2257,6 +2296,7 @@ const PublishAction$1 = ({
|
|
2257
2296
|
};
|
2258
2297
|
};
|
2259
2298
|
PublishAction$1.type = "publish";
|
2299
|
+
PublishAction$1.position = "panel";
|
2260
2300
|
const UpdateAction = ({
|
2261
2301
|
activeTab,
|
2262
2302
|
documentId,
|
@@ -2279,96 +2319,134 @@ const UpdateAction = ({
|
|
2279
2319
|
const validate = strapiAdmin.useForm("UpdateAction", (state) => state.validate);
|
2280
2320
|
const setErrors = strapiAdmin.useForm("UpdateAction", (state) => state.setErrors);
|
2281
2321
|
const resetForm = strapiAdmin.useForm("PublishAction", ({ resetForm: resetForm2 }) => resetForm2);
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2285
|
-
|
2286
|
-
|
2287
|
-
|
2288
|
-
|
2289
|
-
|
2290
|
-
|
2291
|
-
|
2292
|
-
|
2293
|
-
|
2294
|
-
|
2295
|
-
|
2296
|
-
|
2297
|
-
|
2298
|
-
status: "draft"
|
2322
|
+
const handleUpdate = React__namespace.useCallback(async () => {
|
2323
|
+
setSubmitting(true);
|
2324
|
+
try {
|
2325
|
+
if (!modified) {
|
2326
|
+
return;
|
2327
|
+
}
|
2328
|
+
const { errors } = await validate(true, {
|
2329
|
+
status: "draft"
|
2330
|
+
});
|
2331
|
+
if (errors) {
|
2332
|
+
toggleNotification({
|
2333
|
+
type: "danger",
|
2334
|
+
message: formatMessage({
|
2335
|
+
id: "content-manager.validation.error",
|
2336
|
+
defaultMessage: "There are validation errors in your document. Please fix them before saving."
|
2337
|
+
})
|
2299
2338
|
});
|
2300
|
-
|
2301
|
-
|
2302
|
-
|
2303
|
-
|
2304
|
-
|
2305
|
-
|
2306
|
-
|
2307
|
-
|
2308
|
-
|
2309
|
-
|
2310
|
-
|
2311
|
-
|
2312
|
-
|
2313
|
-
model,
|
2314
|
-
documentId: cloneMatch.params.origin,
|
2315
|
-
params
|
2316
|
-
},
|
2317
|
-
transformData(document)
|
2318
|
-
);
|
2319
|
-
if ("data" in res) {
|
2320
|
-
navigate(
|
2321
|
-
{
|
2322
|
-
pathname: `../${res.data.documentId}`,
|
2323
|
-
search: rawQuery
|
2324
|
-
},
|
2325
|
-
{ relative: "path" }
|
2326
|
-
);
|
2327
|
-
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2328
|
-
setErrors(formatValidationErrors(res.error));
|
2329
|
-
}
|
2330
|
-
} else if (documentId || collectionType === SINGLE_TYPES) {
|
2331
|
-
const res = await update(
|
2339
|
+
return;
|
2340
|
+
}
|
2341
|
+
if (isCloning) {
|
2342
|
+
const res = await clone(
|
2343
|
+
{
|
2344
|
+
model,
|
2345
|
+
documentId: cloneMatch.params.origin,
|
2346
|
+
params
|
2347
|
+
},
|
2348
|
+
transformData(document)
|
2349
|
+
);
|
2350
|
+
if ("data" in res) {
|
2351
|
+
navigate(
|
2332
2352
|
{
|
2333
|
-
|
2334
|
-
|
2335
|
-
documentId,
|
2336
|
-
params
|
2353
|
+
pathname: `../${res.data.documentId}`,
|
2354
|
+
search: rawQuery
|
2337
2355
|
},
|
2338
|
-
|
2356
|
+
{ relative: "path" }
|
2339
2357
|
);
|
2340
|
-
|
2341
|
-
|
2342
|
-
|
2343
|
-
|
2344
|
-
|
2358
|
+
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2359
|
+
setErrors(formatValidationErrors(res.error));
|
2360
|
+
}
|
2361
|
+
} else if (documentId || collectionType === SINGLE_TYPES) {
|
2362
|
+
const res = await update(
|
2363
|
+
{
|
2364
|
+
collectionType,
|
2365
|
+
model,
|
2366
|
+
documentId,
|
2367
|
+
params
|
2368
|
+
},
|
2369
|
+
transformData(document)
|
2370
|
+
);
|
2371
|
+
if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2372
|
+
setErrors(formatValidationErrors(res.error));
|
2345
2373
|
} else {
|
2346
|
-
|
2374
|
+
resetForm();
|
2375
|
+
}
|
2376
|
+
} else {
|
2377
|
+
const res = await create(
|
2378
|
+
{
|
2379
|
+
model,
|
2380
|
+
params
|
2381
|
+
},
|
2382
|
+
transformData(document)
|
2383
|
+
);
|
2384
|
+
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2385
|
+
navigate(
|
2347
2386
|
{
|
2348
|
-
|
2349
|
-
|
2387
|
+
pathname: `../${res.data.documentId}`,
|
2388
|
+
search: rawQuery
|
2350
2389
|
},
|
2351
|
-
|
2390
|
+
{ replace: true, relative: "path" }
|
2352
2391
|
);
|
2353
|
-
|
2354
|
-
|
2355
|
-
{
|
2356
|
-
pathname: `../${res.data.documentId}`,
|
2357
|
-
search: rawQuery
|
2358
|
-
},
|
2359
|
-
{ replace: true, relative: "path" }
|
2360
|
-
);
|
2361
|
-
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2362
|
-
setErrors(formatValidationErrors(res.error));
|
2363
|
-
}
|
2392
|
+
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2393
|
+
setErrors(formatValidationErrors(res.error));
|
2364
2394
|
}
|
2365
|
-
} finally {
|
2366
|
-
setSubmitting(false);
|
2367
2395
|
}
|
2396
|
+
} finally {
|
2397
|
+
setSubmitting(false);
|
2368
2398
|
}
|
2399
|
+
}, [
|
2400
|
+
clone,
|
2401
|
+
cloneMatch?.params.origin,
|
2402
|
+
collectionType,
|
2403
|
+
create,
|
2404
|
+
document,
|
2405
|
+
documentId,
|
2406
|
+
formatMessage,
|
2407
|
+
formatValidationErrors,
|
2408
|
+
isCloning,
|
2409
|
+
model,
|
2410
|
+
modified,
|
2411
|
+
navigate,
|
2412
|
+
params,
|
2413
|
+
rawQuery,
|
2414
|
+
resetForm,
|
2415
|
+
setErrors,
|
2416
|
+
setSubmitting,
|
2417
|
+
toggleNotification,
|
2418
|
+
update,
|
2419
|
+
validate
|
2420
|
+
]);
|
2421
|
+
React__namespace.useEffect(() => {
|
2422
|
+
const handleKeyDown = (e) => {
|
2423
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
2424
|
+
e.preventDefault();
|
2425
|
+
handleUpdate();
|
2426
|
+
}
|
2427
|
+
};
|
2428
|
+
window.addEventListener("keydown", handleKeyDown);
|
2429
|
+
return () => {
|
2430
|
+
window.removeEventListener("keydown", handleKeyDown);
|
2431
|
+
};
|
2432
|
+
}, [handleUpdate]);
|
2433
|
+
return {
|
2434
|
+
/**
|
2435
|
+
* Disabled when:
|
2436
|
+
* - the form is submitting
|
2437
|
+
* - the document is not modified & we're not cloning (you can save a clone entity straight away)
|
2438
|
+
* - the active tab is the published tab
|
2439
|
+
*/
|
2440
|
+
disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
|
2441
|
+
label: formatMessage({
|
2442
|
+
id: "global.save",
|
2443
|
+
defaultMessage: "Save"
|
2444
|
+
}),
|
2445
|
+
onClick: handleUpdate
|
2369
2446
|
};
|
2370
2447
|
};
|
2371
2448
|
UpdateAction.type = "update";
|
2449
|
+
UpdateAction.position = "panel";
|
2372
2450
|
const UNPUBLISH_DRAFT_OPTIONS = {
|
2373
2451
|
KEEP: "keep",
|
2374
2452
|
DISCARD: "discard"
|
@@ -2491,6 +2569,7 @@ const UnpublishAction$1 = ({
|
|
2491
2569
|
};
|
2492
2570
|
};
|
2493
2571
|
UnpublishAction$1.type = "unpublish";
|
2572
|
+
UnpublishAction$1.position = "panel";
|
2494
2573
|
const DiscardAction = ({
|
2495
2574
|
activeTab,
|
2496
2575
|
documentId,
|
@@ -2541,6 +2620,7 @@ const DiscardAction = ({
|
|
2541
2620
|
};
|
2542
2621
|
};
|
2543
2622
|
DiscardAction.type = "discard";
|
2623
|
+
DiscardAction.position = "panel";
|
2544
2624
|
const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
|
2545
2625
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
2546
2626
|
const RelativeTime = React__namespace.forwardRef(
|
@@ -2587,10 +2667,10 @@ const getDisplayName = ({
|
|
2587
2667
|
return email ?? "";
|
2588
2668
|
};
|
2589
2669
|
const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
2590
|
-
const DocumentStatus = ({ status = "draft", ...restProps }) => {
|
2670
|
+
const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
|
2591
2671
|
const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
|
2592
2672
|
const { formatMessage } = reactIntl.useIntl();
|
2593
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Status, { ...restProps, size
|
2673
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Status, { ...restProps, size, variant: statusVariant, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: formatMessage({
|
2594
2674
|
id: `content-manager.containers.List.${status}`,
|
2595
2675
|
defaultMessage: capitalise(status)
|
2596
2676
|
}) }) });
|
@@ -2598,12 +2678,18 @@ const DocumentStatus = ({ status = "draft", ...restProps }) => {
|
|
2598
2678
|
const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
|
2599
2679
|
const { formatMessage } = reactIntl.useIntl();
|
2600
2680
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
2681
|
+
const params = reactRouterDom.useParams();
|
2601
2682
|
const title = isCreating ? formatMessage({
|
2602
2683
|
id: "content-manager.containers.edit.title.new",
|
2603
2684
|
defaultMessage: "Create an entry"
|
2604
2685
|
}) : documentTitle;
|
2605
2686
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
|
2606
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
2687
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
2688
|
+
strapiAdmin.BackButton,
|
2689
|
+
{
|
2690
|
+
fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
|
2691
|
+
}
|
2692
|
+
),
|
2607
2693
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
|
2608
2694
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", tag: "h1", children: title }),
|
2609
2695
|
/* @__PURE__ */ jsxRuntime.jsx(HeaderToolbar, {})
|
@@ -2654,7 +2740,7 @@ const HeaderToolbar = () => {
|
|
2654
2740
|
meta: isCloning ? void 0 : meta,
|
2655
2741
|
collectionType
|
2656
2742
|
},
|
2657
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
2743
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
|
2658
2744
|
children: (actions2) => {
|
2659
2745
|
const headerActions = actions2.filter((action) => {
|
2660
2746
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -2862,6 +2948,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
|
|
2862
2948
|
};
|
2863
2949
|
};
|
2864
2950
|
ConfigureTheViewAction.type = "configure-the-view";
|
2951
|
+
ConfigureTheViewAction.position = "header";
|
2865
2952
|
const EditTheModelAction = ({ model }) => {
|
2866
2953
|
const navigate = reactRouterDom.useNavigate();
|
2867
2954
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2878,6 +2965,7 @@ const EditTheModelAction = ({ model }) => {
|
|
2878
2965
|
};
|
2879
2966
|
};
|
2880
2967
|
EditTheModelAction.type = "edit-the-model";
|
2968
|
+
EditTheModelAction.position = "header";
|
2881
2969
|
const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
2882
2970
|
const navigate = reactRouterDom.useNavigate();
|
2883
2971
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2951,6 +3039,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
|
2951
3039
|
};
|
2952
3040
|
};
|
2953
3041
|
DeleteAction$1.type = "delete";
|
3042
|
+
DeleteAction$1.position = ["header", "table-row"];
|
2954
3043
|
const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
|
2955
3044
|
const Panels = () => {
|
2956
3045
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
@@ -3013,7 +3102,7 @@ const ActionsPanelContent = () => {
|
|
3013
3102
|
strapiAdmin.DescriptionComponentRenderer,
|
3014
3103
|
{
|
3015
3104
|
props,
|
3016
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
3105
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
|
3017
3106
|
children: (actions2) => /* @__PURE__ */ jsxRuntime.jsx(DocumentActions, { actions: actions2 })
|
3018
3107
|
}
|
3019
3108
|
),
|
@@ -3290,18 +3379,10 @@ const SelectedEntriesTableContent = ({
|
|
3290
3379
|
search: row.locale && `?plugins[i18n][locale]=${row.locale}`
|
3291
3380
|
},
|
3292
3381
|
state: { from: pathname },
|
3293
|
-
label: formatMessage(
|
3294
|
-
|
3295
|
-
|
3296
|
-
|
3297
|
-
{
|
3298
|
-
id: "content-manager.components.ListViewHelperPluginTable.row-line",
|
3299
|
-
defaultMessage: "item line {number}"
|
3300
|
-
},
|
3301
|
-
{ number: index2 + 1 }
|
3302
|
-
)
|
3303
|
-
}
|
3304
|
-
),
|
3382
|
+
label: formatMessage({
|
3383
|
+
id: "content-manager.bulk-publish.edit",
|
3384
|
+
defaultMessage: "Edit"
|
3385
|
+
}),
|
3305
3386
|
target: "_blank",
|
3306
3387
|
marginLeft: "auto",
|
3307
3388
|
variant: "ghost",
|
@@ -3475,8 +3556,7 @@ const PublishAction = ({ documents, model }) => {
|
|
3475
3556
|
const refetchList = () => {
|
3476
3557
|
contentManagerApi.util.invalidateTags([{ type: "Document", id: `${model}_LIST` }]);
|
3477
3558
|
};
|
3478
|
-
if (!showPublishButton)
|
3479
|
-
return null;
|
3559
|
+
if (!showPublishButton) return null;
|
3480
3560
|
return {
|
3481
3561
|
actionType: "publish",
|
3482
3562
|
variant: "tertiary",
|
@@ -3544,8 +3624,7 @@ const DeleteAction = ({ documents, model }) => {
|
|
3544
3624
|
selectRow([]);
|
3545
3625
|
}
|
3546
3626
|
};
|
3547
|
-
if (!hasDeletePermission)
|
3548
|
-
return null;
|
3627
|
+
if (!hasDeletePermission) return null;
|
3549
3628
|
return {
|
3550
3629
|
variant: "danger-light",
|
3551
3630
|
label: formatMessage({ id: "global.delete", defaultMessage: "Delete" }),
|
@@ -3594,8 +3673,7 @@ const UnpublishAction = ({ documents, model }) => {
|
|
3594
3673
|
}
|
3595
3674
|
};
|
3596
3675
|
const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published" || entry.status === "modified");
|
3597
|
-
if (!showUnpublishButton)
|
3598
|
-
return null;
|
3676
|
+
if (!showUnpublishButton) return null;
|
3599
3677
|
return {
|
3600
3678
|
variant: "tertiary",
|
3601
3679
|
label: formatMessage({ id: "app.utils.unpublish", defaultMessage: "Unpublish" }),
|
@@ -3700,7 +3778,7 @@ const TableActions = ({ document }) => {
|
|
3700
3778
|
strapiAdmin.DescriptionComponentRenderer,
|
3701
3779
|
{
|
3702
3780
|
props,
|
3703
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
|
3781
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("table-row").filter((action) => action.name !== "PublishAction"),
|
3704
3782
|
children: (actions2) => {
|
3705
3783
|
const tableRowActions = actions2.filter((action) => {
|
3706
3784
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -3759,6 +3837,7 @@ const EditAction = ({ documentId }) => {
|
|
3759
3837
|
};
|
3760
3838
|
};
|
3761
3839
|
EditAction.type = "edit";
|
3840
|
+
EditAction.position = "table-row";
|
3762
3841
|
const StyledPencil = styledComponents.styled(Icons.Pencil)`
|
3763
3842
|
path {
|
3764
3843
|
fill: currentColor;
|
@@ -3835,6 +3914,7 @@ const CloneAction = ({ model, documentId }) => {
|
|
3835
3914
|
};
|
3836
3915
|
};
|
3837
3916
|
CloneAction.type = "clone";
|
3917
|
+
CloneAction.position = "table-row";
|
3838
3918
|
const StyledDuplicate = styledComponents.styled(Icons.Duplicate)`
|
3839
3919
|
path {
|
3840
3920
|
fill: currentColor;
|
@@ -3921,7 +4001,14 @@ class ContentManagerPlugin {
|
|
3921
4001
|
addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
|
3922
4002
|
addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
|
3923
4003
|
getBulkActions: () => this.bulkActions,
|
3924
|
-
getDocumentActions: () =>
|
4004
|
+
getDocumentActions: (position) => {
|
4005
|
+
if (position) {
|
4006
|
+
return this.documentActions.filter(
|
4007
|
+
(action) => action.position == void 0 || [action.position].flat().includes(position)
|
4008
|
+
);
|
4009
|
+
}
|
4010
|
+
return this.documentActions;
|
4011
|
+
},
|
3925
4012
|
getEditViewSidePanels: () => this.editViewSidePanels,
|
3926
4013
|
getHeaderActions: () => this.headerActions
|
3927
4014
|
}
|
@@ -3931,10 +4018,8 @@ class ContentManagerPlugin {
|
|
3931
4018
|
const getPrintableType = (value) => {
|
3932
4019
|
const nativeType = typeof value;
|
3933
4020
|
if (nativeType === "object") {
|
3934
|
-
if (value === null)
|
3935
|
-
|
3936
|
-
if (Array.isArray(value))
|
3937
|
-
return "array";
|
4021
|
+
if (value === null) return "null";
|
4022
|
+
if (Array.isArray(value)) return "array";
|
3938
4023
|
if (value instanceof Object && value.constructor.name !== "Object") {
|
3939
4024
|
return value.constructor.name;
|
3940
4025
|
}
|
@@ -3945,17 +4030,27 @@ const HistoryAction = ({ model, document }) => {
|
|
3945
4030
|
const { formatMessage } = reactIntl.useIntl();
|
3946
4031
|
const [{ query }] = strapiAdmin.useQueryParams();
|
3947
4032
|
const navigate = reactRouterDom.useNavigate();
|
4033
|
+
const { trackUsage } = strapiAdmin.useTracking();
|
4034
|
+
const { pathname } = reactRouterDom.useLocation();
|
3948
4035
|
const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
|
3949
4036
|
if (!window.strapi.features.isEnabled("cms-content-history")) {
|
3950
4037
|
return null;
|
3951
4038
|
}
|
4039
|
+
const handleOnClick = () => {
|
4040
|
+
const destination = { pathname: "history", search: pluginsQueryParams };
|
4041
|
+
trackUsage("willNavigate", {
|
4042
|
+
from: pathname,
|
4043
|
+
to: `${pathname}/${destination.pathname}`
|
4044
|
+
});
|
4045
|
+
navigate(destination);
|
4046
|
+
};
|
3952
4047
|
return {
|
3953
4048
|
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ClockCounterClockwise, {}),
|
3954
4049
|
label: formatMessage({
|
3955
4050
|
id: "content-manager.history.document-action",
|
3956
4051
|
defaultMessage: "Content History"
|
3957
4052
|
}),
|
3958
|
-
onClick:
|
4053
|
+
onClick: handleOnClick,
|
3959
4054
|
disabled: (
|
3960
4055
|
/**
|
3961
4056
|
* The user is creating a new document.
|
@@ -3977,6 +4072,7 @@ const HistoryAction = ({ model, document }) => {
|
|
3977
4072
|
};
|
3978
4073
|
};
|
3979
4074
|
HistoryAction.type = "history";
|
4075
|
+
HistoryAction.position = "header";
|
3980
4076
|
const historyAdmin = {
|
3981
4077
|
bootstrap(app) {
|
3982
4078
|
const { addDocumentAction } = app.getPlugin("content-manager").apis;
|
@@ -4039,10 +4135,18 @@ const previewApi = contentManagerApi.injectEndpoints({
|
|
4039
4135
|
})
|
4040
4136
|
});
|
4041
4137
|
const { useGetPreviewUrlQuery } = previewApi;
|
4138
|
+
const ConditionalTooltip = ({ isShown, label, children }) => {
|
4139
|
+
if (isShown) {
|
4140
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label, children });
|
4141
|
+
}
|
4142
|
+
return children;
|
4143
|
+
};
|
4042
4144
|
const PreviewSidePanel = ({ model, documentId, document }) => {
|
4043
4145
|
const { formatMessage } = reactIntl.useIntl();
|
4044
4146
|
const { trackUsage } = strapiAdmin.useTracking();
|
4147
|
+
const { pathname } = reactRouterDom.useLocation();
|
4045
4148
|
const [{ query }] = strapiAdmin.useQueryParams();
|
4149
|
+
const isModified = strapiAdmin.useForm("PreviewSidePanel", (state) => state.modified);
|
4046
4150
|
const { data, error } = useGetPreviewUrlQuery({
|
4047
4151
|
params: {
|
4048
4152
|
contentType: model
|
@@ -4056,33 +4160,43 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
|
|
4056
4160
|
if (!data?.data?.url || error) {
|
4057
4161
|
return null;
|
4058
4162
|
}
|
4059
|
-
const
|
4060
|
-
|
4163
|
+
const trackNavigation = () => {
|
4164
|
+
const destinationPathname = pathname.replace(/\/$/, "") + "/preview";
|
4165
|
+
trackUsage("willNavigate", { from: pathname, to: destinationPathname });
|
4061
4166
|
};
|
4062
4167
|
return {
|
4063
4168
|
title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
|
4064
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(
|
4065
|
-
|
4169
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(
|
4170
|
+
ConditionalTooltip,
|
4066
4171
|
{
|
4067
|
-
|
4068
|
-
|
4069
|
-
|
4070
|
-
|
4071
|
-
|
4072
|
-
children:
|
4073
|
-
|
4074
|
-
|
4075
|
-
|
4172
|
+
label: formatMessage({
|
4173
|
+
id: "content-manager.preview.panel.button-disabled-tooltip",
|
4174
|
+
defaultMessage: "Please save to open the preview"
|
4175
|
+
}),
|
4176
|
+
isShown: isModified,
|
4177
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
4178
|
+
designSystem.Button,
|
4179
|
+
{
|
4180
|
+
variant: "tertiary",
|
4181
|
+
tag: reactRouterDom.Link,
|
4182
|
+
to: { pathname: "preview", search: qs.stringify(query, { encode: false }) },
|
4183
|
+
onClick: trackNavigation,
|
4184
|
+
width: "100%",
|
4185
|
+
disabled: isModified,
|
4186
|
+
pointerEvents: isModified ? "none" : void 0,
|
4187
|
+
tabIndex: isModified ? -1 : void 0,
|
4188
|
+
children: formatMessage({
|
4189
|
+
id: "content-manager.preview.panel.button",
|
4190
|
+
defaultMessage: "Open preview"
|
4191
|
+
})
|
4192
|
+
}
|
4193
|
+
) })
|
4076
4194
|
}
|
4077
|
-
)
|
4195
|
+
)
|
4078
4196
|
};
|
4079
4197
|
};
|
4080
|
-
const FEATURE_ID = "preview";
|
4081
4198
|
const previewAdmin = {
|
4082
4199
|
bootstrap(app) {
|
4083
|
-
if (!window.strapi.future.isEnabled(FEATURE_ID)) {
|
4084
|
-
return;
|
4085
|
-
}
|
4086
4200
|
const contentManagerPluginApis = app.getPlugin("content-manager").apis;
|
4087
4201
|
contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
|
4088
4202
|
}
|
@@ -4106,7 +4220,7 @@ const index = {
|
|
4106
4220
|
app.router.addRoute({
|
4107
4221
|
path: "content-manager/*",
|
4108
4222
|
lazy: async () => {
|
4109
|
-
const { Layout } = await Promise.resolve().then(() => require("./layout-
|
4223
|
+
const { Layout } = await Promise.resolve().then(() => require("./layout-B4X3h5C4.js"));
|
4110
4224
|
return {
|
4111
4225
|
Component: Layout
|
4112
4226
|
};
|
@@ -4126,7 +4240,7 @@ const index = {
|
|
4126
4240
|
async registerTrads({ locales }) {
|
4127
4241
|
const importedTrads = await Promise.all(
|
4128
4242
|
locales.map((locale) => {
|
4129
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-
|
4243
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-BzQmavmK.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-9K52xZIr.js")), "./translations/eu.json": () => Promise.resolve().then(() => require("./eu-VDH-3ovk.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-B2Kyv8Z9.js")), "./translations/gu.json": () => Promise.resolve().then(() => require("./gu-BRmF601H.js")), "./translations/hi.json": () => Promise.resolve().then(() => require("./hi-CCJBptSq.js")), "./translations/hu.json": () => Promise.resolve().then(() => require("./hu-sNV_yLYy.js")), "./translations/id.json": () => Promise.resolve().then(() => require("./id-B5Ser98A.js")), "./translations/it.json": () => Promise.resolve().then(() => require("./it-DkBIs7vD.js")), "./translations/ja.json": () => Promise.resolve().then(() => require("./ja-7sfIbjxE.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-woFZPmLk.js")), "./translations/ml.json": () => Promise.resolve().then(() => require("./ml-C2W8N8k1.js")), "./translations/ms.json": () => Promise.resolve().then(() => require("./ms-BuFotyP_.js")), "./translations/nl.json": () => Promise.resolve().then(() => require("./nl-bbEOHChV.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-uzwG-hk7.js")), "./translations/pt-BR.json": () => Promise.resolve().then(() => require("./pt-BR-BiOz37D9.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-CeXQuq50.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BT3ybNny.js")), "./translations/sa.json": () => Promise.resolve().then(() => require("./sa-CcvkYInH.js")), "./translations/sk.json": () => Promise.resolve().then(() => require("./sk-CvY09Xjv.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("./sv-MYDuzgvT.js")), "./translations/th.json": () => Promise.resolve().then(() => require("./th-D9_GfAjc.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-D9UH-O_R.js")), "./translations/uk.json": () => Promise.resolve().then(() => require("./uk-C8EiqJY7.js")), "./translations/vi.json": () => Promise.resolve().then(() => require("./vi-CJlYDheJ.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-9kOncHGw.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CQQfszqR.js")) }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
|
4130
4244
|
return {
|
4131
4245
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
4132
4246
|
locale
|
@@ -4186,4 +4300,4 @@ exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuer
|
|
4186
4300
|
exports.useGetInitialDataQuery = useGetInitialDataQuery;
|
4187
4301
|
exports.useGetPreviewUrlQuery = useGetPreviewUrlQuery;
|
4188
4302
|
exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
|
4189
|
-
//# sourceMappingURL=index-
|
4303
|
+
//# sourceMappingURL=index-D9vDl-4J.js.map
|