@strapi/content-manager 0.0.0-experimental.af7e4e2471a04cc7f17b8ed3474530810efc02bc → 0.0.0-experimental.b05633daea1bf090c66312b8ab30ec13bdb52f57
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-aeNlfgi9.mjs → ComponentConfigurationPage-A5f-t42A.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-aeNlfgi9.mjs.map → ComponentConfigurationPage-A5f-t42A.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-_EzKh4uq.js → ComponentConfigurationPage-BtmEfYUS.js} +4 -5
- package/dist/_chunks/{ComponentConfigurationPage-_EzKh4uq.js.map → ComponentConfigurationPage-BtmEfYUS.js.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-DaK5-ltL.js → EditConfigurationPage-CXLQhPpj.js} +4 -5
- package/dist/_chunks/{EditConfigurationPage-DaK5-ltL.js.map → EditConfigurationPage-CXLQhPpj.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DBVSBjCB.mjs → EditConfigurationPage-DN6yaDFZ.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-DBVSBjCB.mjs.map → EditConfigurationPage-DN6yaDFZ.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-C3qKSunQ.js → EditViewPage-BW-BJJVg.js} +4 -5
- package/dist/_chunks/{EditViewPage-C3qKSunQ.js.map → EditViewPage-BW-BJJVg.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-BeRi9xCR.mjs → EditViewPage-ONky_-8U.mjs} +3 -3
- package/dist/_chunks/{EditViewPage-BeRi9xCR.mjs.map → EditViewPage-ONky_-8U.mjs.map} +1 -1
- package/dist/_chunks/{Field-CfbMEZLv.mjs → Field-B4gAYDmQ.mjs} +126 -67
- package/dist/_chunks/Field-B4gAYDmQ.mjs.map +1 -0
- package/dist/_chunks/{Field-BwLr5b0V.js → Field-BMlzghtV.js} +128 -69
- package/dist/_chunks/Field-BMlzghtV.js.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-BSInvgp4.js → Form-DQPyv3UY.js} +5 -6
- package/dist/_chunks/{Form-BSInvgp4.js.map → Form-DQPyv3UY.js.map} +1 -1
- package/dist/_chunks/{Form-Br-9I4vG.mjs → Form-e4RpNQY0.mjs} +3 -3
- package/dist/_chunks/{Form-Br-9I4vG.mjs.map → Form-e4RpNQY0.mjs.map} +1 -1
- package/dist/_chunks/{History-BQ721fHN.mjs → History-Bk2VCzmJ.mjs} +8 -6
- package/dist/_chunks/History-Bk2VCzmJ.mjs.map +1 -0
- package/dist/_chunks/{History-BHH0axCz.js → History-CzkXjAR0.js} +8 -7
- package/dist/_chunks/History-CzkXjAR0.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-B7VtZkjG.js → ListConfigurationPage-B9TbaEqp.js} +4 -5
- package/dist/_chunks/{ListConfigurationPage-B7VtZkjG.js.map → ListConfigurationPage-B9TbaEqp.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-BVtVADtP.mjs → ListConfigurationPage-BhNCzkQd.mjs} +3 -3
- package/dist/_chunks/{ListConfigurationPage-BVtVADtP.mjs.map → ListConfigurationPage-BhNCzkQd.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-C4UCZKeD.js → ListViewPage-CIHO4H2J.js} +51 -51
- package/dist/_chunks/ListViewPage-CIHO4H2J.js.map +1 -0
- package/dist/_chunks/{ListViewPage-Dq7nBEKD.mjs → ListViewPage-mK-sFVGU.mjs} +50 -49
- package/dist/_chunks/ListViewPage-mK-sFVGU.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-CQlgc_9h.mjs → NoContentTypePage-BSVg7nZI.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CQlgc_9h.mjs.map → NoContentTypePage-BSVg7nZI.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-YNlmMHbx.js → NoContentTypePage-Dbfi49ek.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-YNlmMHbx.js.map → NoContentTypePage-Dbfi49ek.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-CERDW9_P.js → NoPermissionsPage-CDvWOtEy.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-CERDW9_P.js.map → NoPermissionsPage-CDvWOtEy.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-CT2YbxJK.mjs → NoPermissionsPage-zpYME1_X.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-CT2YbxJK.mjs.map → NoPermissionsPage-zpYME1_X.mjs.map} +1 -1
- package/dist/_chunks/{Preview-D9FlX2H8.js → Preview-8U27vy1U.js} +48 -12
- package/dist/_chunks/Preview-8U27vy1U.js.map +1 -0
- package/dist/_chunks/{Preview-GZFXtAgo.mjs → Preview-Dd3kQluA.mjs} +49 -12
- package/dist/_chunks/Preview-Dd3kQluA.mjs.map +1 -0
- package/dist/_chunks/{Relations-49C4HPsL.mjs → Relations-BvdARGTL.mjs} +6 -8
- package/dist/_chunks/{Relations-49C4HPsL.mjs.map → Relations-BvdARGTL.mjs.map} +1 -1
- package/dist/_chunks/{Relations-CcJBqH7I.js → Relations-CFMS6Dm8.js} +7 -10
- package/dist/_chunks/{Relations-CcJBqH7I.js.map → Relations-CFMS6Dm8.js.map} +1 -1
- package/dist/_chunks/{en-DTWPCdTS.js → en-BzQmavmK.js} +9 -3
- package/dist/_chunks/{en-DTWPCdTS.js.map → en-BzQmavmK.js.map} +1 -1
- package/dist/_chunks/{en-CfIXaZf9.mjs → en-CSxLmrh1.mjs} +9 -3
- package/dist/_chunks/{en-CfIXaZf9.mjs.map → en-CSxLmrh1.mjs.map} +1 -1
- package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
- package/dist/_chunks/{index-CP5EOEiH.mjs → index-B3tHjkLZ.mjs} +253 -148
- package/dist/_chunks/index-B3tHjkLZ.mjs.map +1 -0
- package/dist/_chunks/{index-DUjGm1xz.js → index-TSBwtMDV.js} +253 -149
- package/dist/_chunks/index-TSBwtMDV.js.map +1 -0
- package/dist/_chunks/{layout-B3LdnMTA.mjs → layout-C71zeI19.mjs} +4 -4
- package/dist/_chunks/{layout-B3LdnMTA.mjs.map → layout-C71zeI19.mjs.map} +1 -1
- package/dist/_chunks/{layout-zHc8BsKI.js → layout-CB2vrWLp.js} +5 -6
- package/dist/_chunks/{layout-zHc8BsKI.js.map → layout-CB2vrWLp.js.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-DrsZXRl-.js → relations-8mON7ZVQ.js} +2 -2
- package/dist/_chunks/{relations-DrsZXRl-.js.map → relations-8mON7ZVQ.js.map} +1 -1
- package/dist/_chunks/{relations-DnT2jc-S.mjs → relations-DcEHhh0U.mjs} +2 -2
- package/dist/_chunks/{relations-DnT2jc-S.mjs.map → relations-DcEHhh0U.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 +1 -1
- 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/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 +74 -49
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +74 -48
- package/dist/server/index.mjs.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/package.json +12 -10
- package/dist/_chunks/Field-BwLr5b0V.js.map +0 -1
- package/dist/_chunks/Field-CfbMEZLv.mjs.map +0 -1
- package/dist/_chunks/History-BHH0axCz.js.map +0 -1
- package/dist/_chunks/History-BQ721fHN.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-C4UCZKeD.js.map +0 -1
- package/dist/_chunks/ListViewPage-Dq7nBEKD.mjs.map +0 -1
- package/dist/_chunks/Preview-D9FlX2H8.js.map +0 -1
- package/dist/_chunks/Preview-GZFXtAgo.mjs.map +0 -1
- package/dist/_chunks/index-CP5EOEiH.mjs.map +0 -1
- package/dist/_chunks/index-DUjGm1xz.js.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,7 +249,8 @@ 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 }
|
252
|
+
{ type: "UidAvailability", id: model },
|
253
|
+
"RecentDocumentList"
|
245
254
|
]
|
246
255
|
}),
|
247
256
|
deleteDocument: builder.mutation({
|
@@ -253,7 +262,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
253
262
|
}
|
254
263
|
}),
|
255
264
|
invalidatesTags: (_result, _error, { collectionType, model }) => [
|
256
|
-
{ type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model }
|
265
|
+
{ type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model },
|
266
|
+
"RecentDocumentList"
|
257
267
|
]
|
258
268
|
}),
|
259
269
|
deleteManyDocuments: builder.mutation({
|
@@ -265,7 +275,10 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
265
275
|
params
|
266
276
|
}
|
267
277
|
}),
|
268
|
-
invalidatesTags: (_res, _error, { model }) => [
|
278
|
+
invalidatesTags: (_res, _error, { model }) => [
|
279
|
+
{ type: "Document", id: `${model}_LIST` },
|
280
|
+
"RecentDocumentList"
|
281
|
+
]
|
269
282
|
}),
|
270
283
|
discardDocument: builder.mutation({
|
271
284
|
query: ({ collectionType, model, documentId, params }) => ({
|
@@ -283,7 +296,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
283
296
|
},
|
284
297
|
{ type: "Document", id: `${model}_LIST` },
|
285
298
|
"Relations",
|
286
|
-
{ type: "UidAvailability", id: model }
|
299
|
+
{ type: "UidAvailability", id: model },
|
300
|
+
"RecentDocumentList"
|
287
301
|
];
|
288
302
|
}
|
289
303
|
}),
|
@@ -296,7 +310,7 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
296
310
|
url: `/content-manager/collection-types/${model}`,
|
297
311
|
method: "GET",
|
298
312
|
config: {
|
299
|
-
params
|
313
|
+
params: qs.stringify(params, { encode: true })
|
300
314
|
}
|
301
315
|
}),
|
302
316
|
providesTags: (result, _error, arg) => {
|
@@ -378,7 +392,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
378
392
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
379
393
|
},
|
380
394
|
{ type: "Document", id: `${model}_LIST` },
|
381
|
-
"Relations"
|
395
|
+
"Relations",
|
396
|
+
"RecentDocumentList"
|
382
397
|
];
|
383
398
|
}
|
384
399
|
}),
|
@@ -409,7 +424,9 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
409
424
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
410
425
|
},
|
411
426
|
"Relations",
|
412
|
-
{ type: "UidAvailability", id: model }
|
427
|
+
{ type: "UidAvailability", id: model },
|
428
|
+
"RecentDocumentList",
|
429
|
+
"RecentDocumentList"
|
413
430
|
];
|
414
431
|
},
|
415
432
|
async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {
|
@@ -439,7 +456,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
439
456
|
{
|
440
457
|
type: "Document",
|
441
458
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
442
|
-
}
|
459
|
+
},
|
460
|
+
"RecentDocumentList"
|
443
461
|
];
|
444
462
|
}
|
445
463
|
}),
|
@@ -452,7 +470,10 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
452
470
|
params
|
453
471
|
}
|
454
472
|
}),
|
455
|
-
invalidatesTags: (_res, _error, { model, documentIds }) =>
|
473
|
+
invalidatesTags: (_res, _error, { model, documentIds }) => [
|
474
|
+
...documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` })),
|
475
|
+
"RecentDocumentList"
|
476
|
+
]
|
456
477
|
})
|
457
478
|
})
|
458
479
|
});
|
@@ -475,8 +496,7 @@ const {
|
|
475
496
|
useUnpublishManyDocumentsMutation
|
476
497
|
} = documentApi;
|
477
498
|
const buildValidParams = (query) => {
|
478
|
-
if (!query)
|
479
|
-
return query;
|
499
|
+
if (!query) return query;
|
480
500
|
const { plugins: _, ...validQueryParams } = {
|
481
501
|
...query,
|
482
502
|
...Object.values(query?.plugins ?? {}).reduce(
|
@@ -484,9 +504,6 @@ const buildValidParams = (query) => {
|
|
484
504
|
{}
|
485
505
|
)
|
486
506
|
};
|
487
|
-
if ("_q" in validQueryParams) {
|
488
|
-
validQueryParams._q = encodeURIComponent(validQueryParams._q);
|
489
|
-
}
|
490
507
|
return validQueryParams;
|
491
508
|
};
|
492
509
|
const isBaseQueryError = (error) => {
|
@@ -1686,7 +1703,7 @@ const useDocumentActions = () => {
|
|
1686
1703
|
};
|
1687
1704
|
};
|
1688
1705
|
const ProtectedHistoryPage = React__namespace.lazy(
|
1689
|
-
() => Promise.resolve().then(() => require("./History-
|
1706
|
+
() => Promise.resolve().then(() => require("./History-CzkXjAR0.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1690
1707
|
);
|
1691
1708
|
const routes$2 = [
|
1692
1709
|
{
|
@@ -1699,7 +1716,7 @@ const routes$2 = [
|
|
1699
1716
|
}
|
1700
1717
|
];
|
1701
1718
|
const ProtectedPreviewPage = React__namespace.lazy(
|
1702
|
-
() => Promise.resolve().then(() => require("./Preview-
|
1719
|
+
() => Promise.resolve().then(() => require("./Preview-8U27vy1U.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
|
1703
1720
|
);
|
1704
1721
|
const routes$1 = [
|
1705
1722
|
{
|
@@ -1712,31 +1729,31 @@ const routes$1 = [
|
|
1712
1729
|
}
|
1713
1730
|
];
|
1714
1731
|
const ProtectedEditViewPage = React.lazy(
|
1715
|
-
() => Promise.resolve().then(() => require("./EditViewPage-
|
1732
|
+
() => Promise.resolve().then(() => require("./EditViewPage-BW-BJJVg.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1716
1733
|
);
|
1717
1734
|
const ProtectedListViewPage = React.lazy(
|
1718
|
-
() => Promise.resolve().then(() => require("./ListViewPage-
|
1735
|
+
() => Promise.resolve().then(() => require("./ListViewPage-CIHO4H2J.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1719
1736
|
);
|
1720
1737
|
const ProtectedListConfiguration = React.lazy(
|
1721
|
-
() => Promise.resolve().then(() => require("./ListConfigurationPage-
|
1738
|
+
() => Promise.resolve().then(() => require("./ListConfigurationPage-B9TbaEqp.js")).then((mod) => ({
|
1722
1739
|
default: mod.ProtectedListConfiguration
|
1723
1740
|
}))
|
1724
1741
|
);
|
1725
1742
|
const ProtectedEditConfigurationPage = React.lazy(
|
1726
|
-
() => Promise.resolve().then(() => require("./EditConfigurationPage-
|
1743
|
+
() => Promise.resolve().then(() => require("./EditConfigurationPage-CXLQhPpj.js")).then((mod) => ({
|
1727
1744
|
default: mod.ProtectedEditConfigurationPage
|
1728
1745
|
}))
|
1729
1746
|
);
|
1730
1747
|
const ProtectedComponentConfigurationPage = React.lazy(
|
1731
|
-
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-
|
1748
|
+
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-BtmEfYUS.js")).then((mod) => ({
|
1732
1749
|
default: mod.ProtectedComponentConfigurationPage
|
1733
1750
|
}))
|
1734
1751
|
);
|
1735
1752
|
const NoPermissions = React.lazy(
|
1736
|
-
() => Promise.resolve().then(() => require("./NoPermissionsPage-
|
1753
|
+
() => Promise.resolve().then(() => require("./NoPermissionsPage-CDvWOtEy.js")).then((mod) => ({ default: mod.NoPermissions }))
|
1737
1754
|
);
|
1738
1755
|
const NoContentType = React.lazy(
|
1739
|
-
() => Promise.resolve().then(() => require("./NoContentTypePage-
|
1756
|
+
() => Promise.resolve().then(() => require("./NoContentTypePage-Dbfi49ek.js")).then((mod) => ({ default: mod.NoContentType }))
|
1740
1757
|
);
|
1741
1758
|
const CollectionTypePages = () => {
|
1742
1759
|
const { collectionType } = reactRouterDom.useParams();
|
@@ -1881,6 +1898,11 @@ const DocumentActionButton = (action) => {
|
|
1881
1898
|
) : null
|
1882
1899
|
] });
|
1883
1900
|
};
|
1901
|
+
const MenuItem = styledComponents.styled(designSystem.Menu.Item)`
|
1902
|
+
&:hover {
|
1903
|
+
background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
|
1904
|
+
}
|
1905
|
+
`;
|
1884
1906
|
const DocumentActionsMenu = ({
|
1885
1907
|
actions: actions2,
|
1886
1908
|
children,
|
@@ -1939,11 +1961,13 @@ const DocumentActionsMenu = ({
|
|
1939
1961
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
|
1940
1962
|
actions2.map((action) => {
|
1941
1963
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
1942
|
-
|
1964
|
+
MenuItem,
|
1943
1965
|
{
|
1944
1966
|
disabled: action.disabled,
|
1945
1967
|
onSelect: handleClick(action),
|
1946
1968
|
display: "block",
|
1969
|
+
isVariantDanger: action.variant === "danger",
|
1970
|
+
isDisabled: action.disabled,
|
1947
1971
|
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "space-between", gap: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
1948
1972
|
designSystem.Flex,
|
1949
1973
|
{
|
@@ -2099,6 +2123,7 @@ const PublishAction$1 = ({
|
|
2099
2123
|
const { _unstableFormatValidationErrors: formatValidationErrors } = strapiAdmin.useAPIErrorHandler();
|
2100
2124
|
const isListView = reactRouterDom.useMatch(LIST_PATH) !== null;
|
2101
2125
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
2126
|
+
const { id } = reactRouterDom.useParams();
|
2102
2127
|
const { formatMessage } = reactIntl.useIntl();
|
2103
2128
|
const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
|
2104
2129
|
const { publish } = useDocumentActions();
|
@@ -2201,10 +2226,12 @@ const PublishAction$1 = ({
|
|
2201
2226
|
transformData(formValues)
|
2202
2227
|
);
|
2203
2228
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2204
|
-
|
2205
|
-
|
2206
|
-
|
2207
|
-
|
2229
|
+
if (id === "create") {
|
2230
|
+
navigate({
|
2231
|
+
pathname: `../${collectionType}/${model}/${res.data.documentId}`,
|
2232
|
+
search: rawQuery
|
2233
|
+
});
|
2234
|
+
}
|
2208
2235
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2209
2236
|
setErrors(formatValidationErrors(res.error));
|
2210
2237
|
}
|
@@ -2257,6 +2284,7 @@ const PublishAction$1 = ({
|
|
2257
2284
|
};
|
2258
2285
|
};
|
2259
2286
|
PublishAction$1.type = "publish";
|
2287
|
+
PublishAction$1.position = "panel";
|
2260
2288
|
const UpdateAction = ({
|
2261
2289
|
activeTab,
|
2262
2290
|
documentId,
|
@@ -2279,96 +2307,134 @@ const UpdateAction = ({
|
|
2279
2307
|
const validate = strapiAdmin.useForm("UpdateAction", (state) => state.validate);
|
2280
2308
|
const setErrors = strapiAdmin.useForm("UpdateAction", (state) => state.setErrors);
|
2281
2309
|
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"
|
2310
|
+
const handleUpdate = React__namespace.useCallback(async () => {
|
2311
|
+
setSubmitting(true);
|
2312
|
+
try {
|
2313
|
+
if (!modified) {
|
2314
|
+
return;
|
2315
|
+
}
|
2316
|
+
const { errors } = await validate(true, {
|
2317
|
+
status: "draft"
|
2318
|
+
});
|
2319
|
+
if (errors) {
|
2320
|
+
toggleNotification({
|
2321
|
+
type: "danger",
|
2322
|
+
message: formatMessage({
|
2323
|
+
id: "content-manager.validation.error",
|
2324
|
+
defaultMessage: "There are validation errors in your document. Please fix them before saving."
|
2325
|
+
})
|
2299
2326
|
});
|
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(
|
2327
|
+
return;
|
2328
|
+
}
|
2329
|
+
if (isCloning) {
|
2330
|
+
const res = await clone(
|
2331
|
+
{
|
2332
|
+
model,
|
2333
|
+
documentId: cloneMatch.params.origin,
|
2334
|
+
params
|
2335
|
+
},
|
2336
|
+
transformData(document)
|
2337
|
+
);
|
2338
|
+
if ("data" in res) {
|
2339
|
+
navigate(
|
2332
2340
|
{
|
2333
|
-
|
2334
|
-
|
2335
|
-
documentId,
|
2336
|
-
params
|
2341
|
+
pathname: `../${res.data.documentId}`,
|
2342
|
+
search: rawQuery
|
2337
2343
|
},
|
2338
|
-
|
2344
|
+
{ relative: "path" }
|
2339
2345
|
);
|
2340
|
-
|
2341
|
-
|
2342
|
-
|
2343
|
-
|
2344
|
-
|
2346
|
+
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2347
|
+
setErrors(formatValidationErrors(res.error));
|
2348
|
+
}
|
2349
|
+
} else if (documentId || collectionType === SINGLE_TYPES) {
|
2350
|
+
const res = await update(
|
2351
|
+
{
|
2352
|
+
collectionType,
|
2353
|
+
model,
|
2354
|
+
documentId,
|
2355
|
+
params
|
2356
|
+
},
|
2357
|
+
transformData(document)
|
2358
|
+
);
|
2359
|
+
if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2360
|
+
setErrors(formatValidationErrors(res.error));
|
2345
2361
|
} else {
|
2346
|
-
|
2362
|
+
resetForm();
|
2363
|
+
}
|
2364
|
+
} else {
|
2365
|
+
const res = await create(
|
2366
|
+
{
|
2367
|
+
model,
|
2368
|
+
params
|
2369
|
+
},
|
2370
|
+
transformData(document)
|
2371
|
+
);
|
2372
|
+
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2373
|
+
navigate(
|
2347
2374
|
{
|
2348
|
-
|
2349
|
-
|
2375
|
+
pathname: `../${res.data.documentId}`,
|
2376
|
+
search: rawQuery
|
2350
2377
|
},
|
2351
|
-
|
2378
|
+
{ replace: true, relative: "path" }
|
2352
2379
|
);
|
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
|
-
}
|
2380
|
+
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2381
|
+
setErrors(formatValidationErrors(res.error));
|
2364
2382
|
}
|
2365
|
-
} finally {
|
2366
|
-
setSubmitting(false);
|
2367
2383
|
}
|
2384
|
+
} finally {
|
2385
|
+
setSubmitting(false);
|
2368
2386
|
}
|
2387
|
+
}, [
|
2388
|
+
clone,
|
2389
|
+
cloneMatch?.params.origin,
|
2390
|
+
collectionType,
|
2391
|
+
create,
|
2392
|
+
document,
|
2393
|
+
documentId,
|
2394
|
+
formatMessage,
|
2395
|
+
formatValidationErrors,
|
2396
|
+
isCloning,
|
2397
|
+
model,
|
2398
|
+
modified,
|
2399
|
+
navigate,
|
2400
|
+
params,
|
2401
|
+
rawQuery,
|
2402
|
+
resetForm,
|
2403
|
+
setErrors,
|
2404
|
+
setSubmitting,
|
2405
|
+
toggleNotification,
|
2406
|
+
update,
|
2407
|
+
validate
|
2408
|
+
]);
|
2409
|
+
React__namespace.useEffect(() => {
|
2410
|
+
const handleKeyDown = (e) => {
|
2411
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
2412
|
+
e.preventDefault();
|
2413
|
+
handleUpdate();
|
2414
|
+
}
|
2415
|
+
};
|
2416
|
+
window.addEventListener("keydown", handleKeyDown);
|
2417
|
+
return () => {
|
2418
|
+
window.removeEventListener("keydown", handleKeyDown);
|
2419
|
+
};
|
2420
|
+
}, [handleUpdate]);
|
2421
|
+
return {
|
2422
|
+
/**
|
2423
|
+
* Disabled when:
|
2424
|
+
* - the form is submitting
|
2425
|
+
* - the document is not modified & we're not cloning (you can save a clone entity straight away)
|
2426
|
+
* - the active tab is the published tab
|
2427
|
+
*/
|
2428
|
+
disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
|
2429
|
+
label: formatMessage({
|
2430
|
+
id: "global.save",
|
2431
|
+
defaultMessage: "Save"
|
2432
|
+
}),
|
2433
|
+
onClick: handleUpdate
|
2369
2434
|
};
|
2370
2435
|
};
|
2371
2436
|
UpdateAction.type = "update";
|
2437
|
+
UpdateAction.position = "panel";
|
2372
2438
|
const UNPUBLISH_DRAFT_OPTIONS = {
|
2373
2439
|
KEEP: "keep",
|
2374
2440
|
DISCARD: "discard"
|
@@ -2491,6 +2557,7 @@ const UnpublishAction$1 = ({
|
|
2491
2557
|
};
|
2492
2558
|
};
|
2493
2559
|
UnpublishAction$1.type = "unpublish";
|
2560
|
+
UnpublishAction$1.position = "panel";
|
2494
2561
|
const DiscardAction = ({
|
2495
2562
|
activeTab,
|
2496
2563
|
documentId,
|
@@ -2541,6 +2608,7 @@ const DiscardAction = ({
|
|
2541
2608
|
};
|
2542
2609
|
};
|
2543
2610
|
DiscardAction.type = "discard";
|
2611
|
+
DiscardAction.position = "panel";
|
2544
2612
|
const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
|
2545
2613
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
2546
2614
|
const RelativeTime = React__namespace.forwardRef(
|
@@ -2660,7 +2728,7 @@ const HeaderToolbar = () => {
|
|
2660
2728
|
meta: isCloning ? void 0 : meta,
|
2661
2729
|
collectionType
|
2662
2730
|
},
|
2663
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
2731
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
|
2664
2732
|
children: (actions2) => {
|
2665
2733
|
const headerActions = actions2.filter((action) => {
|
2666
2734
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -2868,6 +2936,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
|
|
2868
2936
|
};
|
2869
2937
|
};
|
2870
2938
|
ConfigureTheViewAction.type = "configure-the-view";
|
2939
|
+
ConfigureTheViewAction.position = "header";
|
2871
2940
|
const EditTheModelAction = ({ model }) => {
|
2872
2941
|
const navigate = reactRouterDom.useNavigate();
|
2873
2942
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2884,6 +2953,7 @@ const EditTheModelAction = ({ model }) => {
|
|
2884
2953
|
};
|
2885
2954
|
};
|
2886
2955
|
EditTheModelAction.type = "edit-the-model";
|
2956
|
+
EditTheModelAction.position = "header";
|
2887
2957
|
const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
2888
2958
|
const navigate = reactRouterDom.useNavigate();
|
2889
2959
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2957,6 +3027,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
|
2957
3027
|
};
|
2958
3028
|
};
|
2959
3029
|
DeleteAction$1.type = "delete";
|
3030
|
+
DeleteAction$1.position = ["header", "table-row"];
|
2960
3031
|
const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
|
2961
3032
|
const Panels = () => {
|
2962
3033
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
@@ -3019,7 +3090,7 @@ const ActionsPanelContent = () => {
|
|
3019
3090
|
strapiAdmin.DescriptionComponentRenderer,
|
3020
3091
|
{
|
3021
3092
|
props,
|
3022
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
3093
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
|
3023
3094
|
children: (actions2) => /* @__PURE__ */ jsxRuntime.jsx(DocumentActions, { actions: actions2 })
|
3024
3095
|
}
|
3025
3096
|
),
|
@@ -3473,8 +3544,7 @@ const PublishAction = ({ documents, model }) => {
|
|
3473
3544
|
const refetchList = () => {
|
3474
3545
|
contentManagerApi.util.invalidateTags([{ type: "Document", id: `${model}_LIST` }]);
|
3475
3546
|
};
|
3476
|
-
if (!showPublishButton)
|
3477
|
-
return null;
|
3547
|
+
if (!showPublishButton) return null;
|
3478
3548
|
return {
|
3479
3549
|
actionType: "publish",
|
3480
3550
|
variant: "tertiary",
|
@@ -3542,8 +3612,7 @@ const DeleteAction = ({ documents, model }) => {
|
|
3542
3612
|
selectRow([]);
|
3543
3613
|
}
|
3544
3614
|
};
|
3545
|
-
if (!hasDeletePermission)
|
3546
|
-
return null;
|
3615
|
+
if (!hasDeletePermission) return null;
|
3547
3616
|
return {
|
3548
3617
|
variant: "danger-light",
|
3549
3618
|
label: formatMessage({ id: "global.delete", defaultMessage: "Delete" }),
|
@@ -3592,8 +3661,7 @@ const UnpublishAction = ({ documents, model }) => {
|
|
3592
3661
|
}
|
3593
3662
|
};
|
3594
3663
|
const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published" || entry.status === "modified");
|
3595
|
-
if (!showUnpublishButton)
|
3596
|
-
return null;
|
3664
|
+
if (!showUnpublishButton) return null;
|
3597
3665
|
return {
|
3598
3666
|
variant: "tertiary",
|
3599
3667
|
label: formatMessage({ id: "app.utils.unpublish", defaultMessage: "Unpublish" }),
|
@@ -3698,7 +3766,7 @@ const TableActions = ({ document }) => {
|
|
3698
3766
|
strapiAdmin.DescriptionComponentRenderer,
|
3699
3767
|
{
|
3700
3768
|
props,
|
3701
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
|
3769
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("table-row").filter((action) => action.name !== "PublishAction"),
|
3702
3770
|
children: (actions2) => {
|
3703
3771
|
const tableRowActions = actions2.filter((action) => {
|
3704
3772
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -3757,6 +3825,7 @@ const EditAction = ({ documentId }) => {
|
|
3757
3825
|
};
|
3758
3826
|
};
|
3759
3827
|
EditAction.type = "edit";
|
3828
|
+
EditAction.position = "table-row";
|
3760
3829
|
const StyledPencil = styledComponents.styled(Icons.Pencil)`
|
3761
3830
|
path {
|
3762
3831
|
fill: currentColor;
|
@@ -3833,6 +3902,7 @@ const CloneAction = ({ model, documentId }) => {
|
|
3833
3902
|
};
|
3834
3903
|
};
|
3835
3904
|
CloneAction.type = "clone";
|
3905
|
+
CloneAction.position = "table-row";
|
3836
3906
|
const StyledDuplicate = styledComponents.styled(Icons.Duplicate)`
|
3837
3907
|
path {
|
3838
3908
|
fill: currentColor;
|
@@ -3919,7 +3989,14 @@ class ContentManagerPlugin {
|
|
3919
3989
|
addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
|
3920
3990
|
addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
|
3921
3991
|
getBulkActions: () => this.bulkActions,
|
3922
|
-
getDocumentActions: () =>
|
3992
|
+
getDocumentActions: (position) => {
|
3993
|
+
if (position) {
|
3994
|
+
return this.documentActions.filter(
|
3995
|
+
(action) => action.position == void 0 || [action.position].flat().includes(position)
|
3996
|
+
);
|
3997
|
+
}
|
3998
|
+
return this.documentActions;
|
3999
|
+
},
|
3923
4000
|
getEditViewSidePanels: () => this.editViewSidePanels,
|
3924
4001
|
getHeaderActions: () => this.headerActions
|
3925
4002
|
}
|
@@ -3929,10 +4006,8 @@ class ContentManagerPlugin {
|
|
3929
4006
|
const getPrintableType = (value) => {
|
3930
4007
|
const nativeType = typeof value;
|
3931
4008
|
if (nativeType === "object") {
|
3932
|
-
if (value === null)
|
3933
|
-
|
3934
|
-
if (Array.isArray(value))
|
3935
|
-
return "array";
|
4009
|
+
if (value === null) return "null";
|
4010
|
+
if (Array.isArray(value)) return "array";
|
3936
4011
|
if (value instanceof Object && value.constructor.name !== "Object") {
|
3937
4012
|
return value.constructor.name;
|
3938
4013
|
}
|
@@ -3943,17 +4018,27 @@ const HistoryAction = ({ model, document }) => {
|
|
3943
4018
|
const { formatMessage } = reactIntl.useIntl();
|
3944
4019
|
const [{ query }] = strapiAdmin.useQueryParams();
|
3945
4020
|
const navigate = reactRouterDom.useNavigate();
|
4021
|
+
const { trackUsage } = strapiAdmin.useTracking();
|
4022
|
+
const { pathname } = reactRouterDom.useLocation();
|
3946
4023
|
const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
|
3947
4024
|
if (!window.strapi.features.isEnabled("cms-content-history")) {
|
3948
4025
|
return null;
|
3949
4026
|
}
|
4027
|
+
const handleOnClick = () => {
|
4028
|
+
const destination = { pathname: "history", search: pluginsQueryParams };
|
4029
|
+
trackUsage("willNavigate", {
|
4030
|
+
from: pathname,
|
4031
|
+
to: `${pathname}/${destination.pathname}`
|
4032
|
+
});
|
4033
|
+
navigate(destination);
|
4034
|
+
};
|
3950
4035
|
return {
|
3951
4036
|
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ClockCounterClockwise, {}),
|
3952
4037
|
label: formatMessage({
|
3953
4038
|
id: "content-manager.history.document-action",
|
3954
4039
|
defaultMessage: "Content History"
|
3955
4040
|
}),
|
3956
|
-
onClick:
|
4041
|
+
onClick: handleOnClick,
|
3957
4042
|
disabled: (
|
3958
4043
|
/**
|
3959
4044
|
* The user is creating a new document.
|
@@ -3975,6 +4060,7 @@ const HistoryAction = ({ model, document }) => {
|
|
3975
4060
|
};
|
3976
4061
|
};
|
3977
4062
|
HistoryAction.type = "history";
|
4063
|
+
HistoryAction.position = "header";
|
3978
4064
|
const historyAdmin = {
|
3979
4065
|
bootstrap(app) {
|
3980
4066
|
const { addDocumentAction } = app.getPlugin("content-manager").apis;
|
@@ -4037,10 +4123,18 @@ const previewApi = contentManagerApi.injectEndpoints({
|
|
4037
4123
|
})
|
4038
4124
|
});
|
4039
4125
|
const { useGetPreviewUrlQuery } = previewApi;
|
4126
|
+
const ConditionalTooltip = ({ isShown, label, children }) => {
|
4127
|
+
if (isShown) {
|
4128
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label, children });
|
4129
|
+
}
|
4130
|
+
return children;
|
4131
|
+
};
|
4040
4132
|
const PreviewSidePanel = ({ model, documentId, document }) => {
|
4041
4133
|
const { formatMessage } = reactIntl.useIntl();
|
4042
4134
|
const { trackUsage } = strapiAdmin.useTracking();
|
4135
|
+
const { pathname } = reactRouterDom.useLocation();
|
4043
4136
|
const [{ query }] = strapiAdmin.useQueryParams();
|
4137
|
+
const isModified = strapiAdmin.useForm("PreviewSidePanel", (state) => state.modified);
|
4044
4138
|
const { data, error } = useGetPreviewUrlQuery({
|
4045
4139
|
params: {
|
4046
4140
|
contentType: model
|
@@ -4054,33 +4148,43 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
|
|
4054
4148
|
if (!data?.data?.url || error) {
|
4055
4149
|
return null;
|
4056
4150
|
}
|
4057
|
-
const
|
4058
|
-
|
4151
|
+
const trackNavigation = () => {
|
4152
|
+
const destinationPathname = pathname.replace(/\/$/, "") + "/preview";
|
4153
|
+
trackUsage("willNavigate", { from: pathname, to: destinationPathname });
|
4059
4154
|
};
|
4060
4155
|
return {
|
4061
4156
|
title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
|
4062
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(
|
4063
|
-
|
4157
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(
|
4158
|
+
ConditionalTooltip,
|
4064
4159
|
{
|
4065
|
-
|
4066
|
-
|
4067
|
-
|
4068
|
-
|
4069
|
-
|
4070
|
-
children:
|
4071
|
-
|
4072
|
-
|
4073
|
-
|
4160
|
+
label: formatMessage({
|
4161
|
+
id: "content-manager.preview.panel.button-disabled-tooltip",
|
4162
|
+
defaultMessage: "Please save to open the preview"
|
4163
|
+
}),
|
4164
|
+
isShown: isModified,
|
4165
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
4166
|
+
designSystem.Button,
|
4167
|
+
{
|
4168
|
+
variant: "tertiary",
|
4169
|
+
tag: reactRouterDom.Link,
|
4170
|
+
to: { pathname: "preview", search: qs.stringify(query, { encode: false }) },
|
4171
|
+
onClick: trackNavigation,
|
4172
|
+
width: "100%",
|
4173
|
+
disabled: isModified,
|
4174
|
+
pointerEvents: isModified ? "none" : void 0,
|
4175
|
+
tabIndex: isModified ? -1 : void 0,
|
4176
|
+
children: formatMessage({
|
4177
|
+
id: "content-manager.preview.panel.button",
|
4178
|
+
defaultMessage: "Open preview"
|
4179
|
+
})
|
4180
|
+
}
|
4181
|
+
) })
|
4074
4182
|
}
|
4075
|
-
)
|
4183
|
+
)
|
4076
4184
|
};
|
4077
4185
|
};
|
4078
|
-
const FEATURE_ID = "preview";
|
4079
4186
|
const previewAdmin = {
|
4080
4187
|
bootstrap(app) {
|
4081
|
-
if (!window.strapi.future.isEnabled(FEATURE_ID)) {
|
4082
|
-
return;
|
4083
|
-
}
|
4084
4188
|
const contentManagerPluginApis = app.getPlugin("content-manager").apis;
|
4085
4189
|
contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
|
4086
4190
|
}
|
@@ -4104,7 +4208,7 @@ const index = {
|
|
4104
4208
|
app.router.addRoute({
|
4105
4209
|
path: "content-manager/*",
|
4106
4210
|
lazy: async () => {
|
4107
|
-
const { Layout } = await Promise.resolve().then(() => require("./layout-
|
4211
|
+
const { Layout } = await Promise.resolve().then(() => require("./layout-CB2vrWLp.js"));
|
4108
4212
|
return {
|
4109
4213
|
Component: Layout
|
4110
4214
|
};
|
@@ -4124,7 +4228,7 @@ const index = {
|
|
4124
4228
|
async registerTrads({ locales }) {
|
4125
4229
|
const importedTrads = await Promise.all(
|
4126
4230
|
locales.map((locale) => {
|
4127
|
-
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-
|
4231
|
+
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 }) => {
|
4128
4232
|
return {
|
4129
4233
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
4130
4234
|
locale
|
@@ -4184,4 +4288,4 @@ exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuer
|
|
4184
4288
|
exports.useGetInitialDataQuery = useGetInitialDataQuery;
|
4185
4289
|
exports.useGetPreviewUrlQuery = useGetPreviewUrlQuery;
|
4186
4290
|
exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
|
4187
|
-
//# sourceMappingURL=index-
|
4291
|
+
//# sourceMappingURL=index-TSBwtMDV.js.map
|