@strapi/content-manager 0.0.0-next.d6ed4fcf2c833656b8c91a90909c1e77c79379e5 → 0.0.0-next.dad3c50630ca4fd9eccdcbe549ee632fc572e23d
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/{ComponentConfigurationPage-DywpTZeV.js → ComponentConfigurationPage-BLWQy8ru.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DywpTZeV.js.map → ComponentConfigurationPage-BLWQy8ru.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BgCLcjXO.mjs → ComponentConfigurationPage-CtIa3aa2.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-BgCLcjXO.mjs.map → ComponentConfigurationPage-CtIa3aa2.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BNjOAHNS.mjs → EditConfigurationPage-DsPR2DVk.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BNjOAHNS.mjs.map → EditConfigurationPage-DsPR2DVk.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-CxRlP5if.js → EditConfigurationPage-RQkymxCy.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-CxRlP5if.js.map → EditConfigurationPage-RQkymxCy.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-BRewdTqE.js → EditViewPage-B-kExt8C.js} +3 -3
- package/dist/_chunks/{EditViewPage-BRewdTqE.js.map → EditViewPage-B-kExt8C.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-CD_hqc1J.mjs → EditViewPage-BPyVuPfM.mjs} +3 -3
- package/dist/_chunks/{EditViewPage-CD_hqc1J.mjs.map → EditViewPage-BPyVuPfM.mjs.map} +1 -1
- package/dist/_chunks/{Field-DwvmENVf.js → Field-DPIsQRre.js} +117 -61
- package/dist/_chunks/Field-DPIsQRre.js.map +1 -0
- package/dist/_chunks/{Field-BPkQ-3Ku.mjs → Field-Dltnt1km.mjs} +116 -61
- package/dist/_chunks/Field-Dltnt1km.mjs.map +1 -0
- package/dist/_chunks/{Form-C_Gwv8P_.js → Form-BFi4MXMT.js} +2 -2
- package/dist/_chunks/{Form-C_Gwv8P_.js.map → Form-BFi4MXMT.js.map} +1 -1
- package/dist/_chunks/{Form-Czi0cf_2.mjs → Form-C1IcWm1u.mjs} +2 -2
- package/dist/_chunks/{Form-Czi0cf_2.mjs.map → Form-C1IcWm1u.mjs.map} +1 -1
- package/dist/_chunks/{History-CIQHyi4T.mjs → History-04ChQ4pl.mjs} +32 -8
- package/dist/_chunks/History-04ChQ4pl.mjs.map +1 -0
- package/dist/_chunks/{History-C1TKAig-.js → History-wjcK4L0C.js} +32 -8
- package/dist/_chunks/History-wjcK4L0C.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DcZsfyEL.mjs → ListConfigurationPage-BYqPYLSU.mjs} +2 -2
- package/dist/_chunks/{ListConfigurationPage-DcZsfyEL.mjs.map → ListConfigurationPage-BYqPYLSU.mjs.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-D-NGRLYu.js → ListConfigurationPage-CRbxIC3J.js} +2 -2
- package/dist/_chunks/{ListConfigurationPage-D-NGRLYu.js.map → ListConfigurationPage-CRbxIC3J.js.map} +1 -1
- package/dist/_chunks/{ListViewPage-xv5IQoZp.js → ListViewPage-D5NY9183.js} +3 -3
- package/dist/_chunks/{ListViewPage-xv5IQoZp.js.map → ListViewPage-D5NY9183.js.map} +1 -1
- package/dist/_chunks/{ListViewPage-C10McTK1.mjs → ListViewPage-FU2LBuhl.mjs} +3 -3
- package/dist/_chunks/{ListViewPage-C10McTK1.mjs.map → ListViewPage-FU2LBuhl.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-Dzw5Yj5u.js → NoContentTypePage-BgQVE_Qb.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-Dzw5Yj5u.js.map → NoContentTypePage-BgQVE_Qb.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CPc0Cd3S.mjs → NoContentTypePage-DCKUkwb8.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CPc0Cd3S.mjs.map → NoContentTypePage-DCKUkwb8.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DAe5CDCC.js → NoPermissionsPage-C5jwn70o.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DAe5CDCC.js.map → NoPermissionsPage-C5jwn70o.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-wfPBh2_0.mjs → NoPermissionsPage-jqve7C8l.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-wfPBh2_0.mjs.map → NoPermissionsPage-jqve7C8l.mjs.map} +1 -1
- package/dist/_chunks/{Preview-BVFFm7uB.mjs → Preview-BMYN548c.mjs} +33 -11
- package/dist/_chunks/Preview-BMYN548c.mjs.map +1 -0
- package/dist/_chunks/{Preview-B7LyGT_b.js → Preview-DaOihysv.js} +32 -10
- package/dist/_chunks/Preview-DaOihysv.js.map +1 -0
- package/dist/_chunks/{Relations-BmYR1AjY.js → Relations-CTGM7Hv5.js} +3 -3
- package/dist/_chunks/{Relations-BmYR1AjY.js.map → Relations-CTGM7Hv5.js.map} +1 -1
- package/dist/_chunks/{Relations-JPhWxk-s.mjs → Relations-gscPkxjF.mjs} +3 -3
- package/dist/_chunks/{Relations-JPhWxk-s.mjs.map → Relations-gscPkxjF.mjs.map} +1 -1
- package/dist/_chunks/{en-BK8Xyl5I.js → en-BzQmavmK.js} +7 -2
- package/dist/_chunks/{en-BK8Xyl5I.js.map → en-BzQmavmK.js.map} +1 -1
- package/dist/_chunks/{en-Dtk_ot79.mjs → en-CSxLmrh1.mjs} +7 -2
- package/dist/_chunks/{en-Dtk_ot79.mjs.map → en-CSxLmrh1.mjs.map} +1 -1
- package/dist/_chunks/{index-C2Q_PLWj.js → index-Ca7YWlAA.js} +191 -112
- package/dist/_chunks/index-Ca7YWlAA.js.map +1 -0
- package/dist/_chunks/{index-DLIkNVnQ.mjs → index-DqasUQ6Q.mjs} +191 -112
- package/dist/_chunks/index-DqasUQ6Q.mjs.map +1 -0
- package/dist/_chunks/{layout-7AsWJzZJ.js → layout-BW80JSCd.js} +3 -3
- package/dist/_chunks/{layout-7AsWJzZJ.js.map → layout-BW80JSCd.js.map} +1 -1
- package/dist/_chunks/{layout-qE8qkNH_.mjs → layout-W3clJSCy.mjs} +3 -3
- package/dist/_chunks/{layout-qE8qkNH_.mjs.map → layout-W3clJSCy.mjs.map} +1 -1
- package/dist/_chunks/{relations-BjHH_1Am.mjs → relations-BlDkoeWh.mjs} +2 -2
- package/dist/_chunks/{relations-BjHH_1Am.mjs.map → relations-BlDkoeWh.mjs.map} +1 -1
- package/dist/_chunks/{relations-EifVzf_2.js → relations-C9Usz9k5.js} +2 -2
- package/dist/_chunks/{relations-EifVzf_2.js.map → relations-C9Usz9k5.js.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/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 -16
- 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 +156 -142
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +157 -143
- 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/index.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 +8 -6
- package/dist/_chunks/Field-BPkQ-3Ku.mjs.map +0 -1
- package/dist/_chunks/Field-DwvmENVf.js.map +0 -1
- package/dist/_chunks/History-C1TKAig-.js.map +0 -1
- package/dist/_chunks/History-CIQHyi4T.mjs.map +0 -1
- package/dist/_chunks/Preview-B7LyGT_b.js.map +0 -1
- package/dist/_chunks/Preview-BVFFm7uB.mjs.map +0 -1
- package/dist/_chunks/index-C2Q_PLWj.js.map +0 -1
- package/dist/_chunks/index-DLIkNVnQ.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
@@ -196,7 +196,8 @@ const contentManagerApi = strapiAdmin.adminApi.enhanceEndpoints({
|
|
196
196
|
"InitialData",
|
197
197
|
"HistoryVersion",
|
198
198
|
"Relations",
|
199
|
-
"UidAvailability"
|
199
|
+
"UidAvailability",
|
200
|
+
"RecentDocumentList"
|
200
201
|
]
|
201
202
|
});
|
202
203
|
const documentApi = contentManagerApi.injectEndpoints({
|
@@ -214,7 +215,7 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
214
215
|
if (error) {
|
215
216
|
return [];
|
216
217
|
}
|
217
|
-
return [{ type: "Document", id: `${model}_LIST` }];
|
218
|
+
return [{ type: "Document", id: `${model}_LIST` }, "RecentDocumentList"];
|
218
219
|
}
|
219
220
|
}),
|
220
221
|
cloneDocument: builder.mutation({
|
@@ -228,7 +229,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
228
229
|
}),
|
229
230
|
invalidatesTags: (_result, _error, { model }) => [
|
230
231
|
{ type: "Document", id: `${model}_LIST` },
|
231
|
-
{ type: "UidAvailability", id: model }
|
232
|
+
{ type: "UidAvailability", id: model },
|
233
|
+
"RecentDocumentList"
|
232
234
|
]
|
233
235
|
}),
|
234
236
|
/**
|
@@ -247,8 +249,21 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
247
249
|
invalidatesTags: (result, _error, { model }) => [
|
248
250
|
{ type: "Document", id: `${model}_LIST` },
|
249
251
|
"Relations",
|
250
|
-
{ type: "UidAvailability", id: model }
|
251
|
-
|
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
|
+
}
|
252
267
|
}),
|
253
268
|
deleteDocument: builder.mutation({
|
254
269
|
query: ({ collectionType, model, documentId, params }) => ({
|
@@ -259,7 +274,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
259
274
|
}
|
260
275
|
}),
|
261
276
|
invalidatesTags: (_result, _error, { collectionType, model }) => [
|
262
|
-
{ type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model }
|
277
|
+
{ type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model },
|
278
|
+
"RecentDocumentList"
|
263
279
|
]
|
264
280
|
}),
|
265
281
|
deleteManyDocuments: builder.mutation({
|
@@ -271,7 +287,10 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
271
287
|
params
|
272
288
|
}
|
273
289
|
}),
|
274
|
-
invalidatesTags: (_res, _error, { model }) => [
|
290
|
+
invalidatesTags: (_res, _error, { model }) => [
|
291
|
+
{ type: "Document", id: `${model}_LIST` },
|
292
|
+
"RecentDocumentList"
|
293
|
+
]
|
275
294
|
}),
|
276
295
|
discardDocument: builder.mutation({
|
277
296
|
query: ({ collectionType, model, documentId, params }) => ({
|
@@ -289,7 +308,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
289
308
|
},
|
290
309
|
{ type: "Document", id: `${model}_LIST` },
|
291
310
|
"Relations",
|
292
|
-
{ type: "UidAvailability", id: model }
|
311
|
+
{ type: "UidAvailability", id: model },
|
312
|
+
"RecentDocumentList"
|
293
313
|
];
|
294
314
|
}
|
295
315
|
}),
|
@@ -384,7 +404,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
384
404
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
385
405
|
},
|
386
406
|
{ type: "Document", id: `${model}_LIST` },
|
387
|
-
"Relations"
|
407
|
+
"Relations",
|
408
|
+
"RecentDocumentList"
|
388
409
|
];
|
389
410
|
}
|
390
411
|
}),
|
@@ -415,7 +436,9 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
415
436
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
416
437
|
},
|
417
438
|
"Relations",
|
418
|
-
{ type: "UidAvailability", id: model }
|
439
|
+
{ type: "UidAvailability", id: model },
|
440
|
+
"RecentDocumentList",
|
441
|
+
"RecentDocumentList"
|
419
442
|
];
|
420
443
|
},
|
421
444
|
async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {
|
@@ -445,7 +468,8 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
445
468
|
{
|
446
469
|
type: "Document",
|
447
470
|
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
448
|
-
}
|
471
|
+
},
|
472
|
+
"RecentDocumentList"
|
449
473
|
];
|
450
474
|
}
|
451
475
|
}),
|
@@ -458,7 +482,10 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
458
482
|
params
|
459
483
|
}
|
460
484
|
}),
|
461
|
-
invalidatesTags: (_res, _error, { model, documentIds }) =>
|
485
|
+
invalidatesTags: (_res, _error, { model, documentIds }) => [
|
486
|
+
...documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` })),
|
487
|
+
"RecentDocumentList"
|
488
|
+
]
|
462
489
|
})
|
463
490
|
})
|
464
491
|
});
|
@@ -1688,7 +1715,7 @@ const useDocumentActions = () => {
|
|
1688
1715
|
};
|
1689
1716
|
};
|
1690
1717
|
const ProtectedHistoryPage = React__namespace.lazy(
|
1691
|
-
() => Promise.resolve().then(() => require("./History-
|
1718
|
+
() => Promise.resolve().then(() => require("./History-wjcK4L0C.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1692
1719
|
);
|
1693
1720
|
const routes$2 = [
|
1694
1721
|
{
|
@@ -1701,7 +1728,7 @@ const routes$2 = [
|
|
1701
1728
|
}
|
1702
1729
|
];
|
1703
1730
|
const ProtectedPreviewPage = React__namespace.lazy(
|
1704
|
-
() => Promise.resolve().then(() => require("./Preview-
|
1731
|
+
() => Promise.resolve().then(() => require("./Preview-DaOihysv.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
|
1705
1732
|
);
|
1706
1733
|
const routes$1 = [
|
1707
1734
|
{
|
@@ -1714,31 +1741,31 @@ const routes$1 = [
|
|
1714
1741
|
}
|
1715
1742
|
];
|
1716
1743
|
const ProtectedEditViewPage = React.lazy(
|
1717
|
-
() => Promise.resolve().then(() => require("./EditViewPage-
|
1744
|
+
() => Promise.resolve().then(() => require("./EditViewPage-B-kExt8C.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1718
1745
|
);
|
1719
1746
|
const ProtectedListViewPage = React.lazy(
|
1720
|
-
() => Promise.resolve().then(() => require("./ListViewPage-
|
1747
|
+
() => Promise.resolve().then(() => require("./ListViewPage-D5NY9183.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1721
1748
|
);
|
1722
1749
|
const ProtectedListConfiguration = React.lazy(
|
1723
|
-
() => Promise.resolve().then(() => require("./ListConfigurationPage-
|
1750
|
+
() => Promise.resolve().then(() => require("./ListConfigurationPage-CRbxIC3J.js")).then((mod) => ({
|
1724
1751
|
default: mod.ProtectedListConfiguration
|
1725
1752
|
}))
|
1726
1753
|
);
|
1727
1754
|
const ProtectedEditConfigurationPage = React.lazy(
|
1728
|
-
() => Promise.resolve().then(() => require("./EditConfigurationPage-
|
1755
|
+
() => Promise.resolve().then(() => require("./EditConfigurationPage-RQkymxCy.js")).then((mod) => ({
|
1729
1756
|
default: mod.ProtectedEditConfigurationPage
|
1730
1757
|
}))
|
1731
1758
|
);
|
1732
1759
|
const ProtectedComponentConfigurationPage = React.lazy(
|
1733
|
-
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-
|
1760
|
+
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-BLWQy8ru.js")).then((mod) => ({
|
1734
1761
|
default: mod.ProtectedComponentConfigurationPage
|
1735
1762
|
}))
|
1736
1763
|
);
|
1737
1764
|
const NoPermissions = React.lazy(
|
1738
|
-
() => Promise.resolve().then(() => require("./NoPermissionsPage-
|
1765
|
+
() => Promise.resolve().then(() => require("./NoPermissionsPage-C5jwn70o.js")).then((mod) => ({ default: mod.NoPermissions }))
|
1739
1766
|
);
|
1740
1767
|
const NoContentType = React.lazy(
|
1741
|
-
() => Promise.resolve().then(() => require("./NoContentTypePage-
|
1768
|
+
() => Promise.resolve().then(() => require("./NoContentTypePage-BgQVE_Qb.js")).then((mod) => ({ default: mod.NoContentType }))
|
1742
1769
|
);
|
1743
1770
|
const CollectionTypePages = () => {
|
1744
1771
|
const { collectionType } = reactRouterDom.useParams();
|
@@ -2269,6 +2296,7 @@ const PublishAction$1 = ({
|
|
2269
2296
|
};
|
2270
2297
|
};
|
2271
2298
|
PublishAction$1.type = "publish";
|
2299
|
+
PublishAction$1.position = "panel";
|
2272
2300
|
const UpdateAction = ({
|
2273
2301
|
activeTab,
|
2274
2302
|
documentId,
|
@@ -2291,6 +2319,117 @@ const UpdateAction = ({
|
|
2291
2319
|
const validate = strapiAdmin.useForm("UpdateAction", (state) => state.validate);
|
2292
2320
|
const setErrors = strapiAdmin.useForm("UpdateAction", (state) => state.setErrors);
|
2293
2321
|
const resetForm = strapiAdmin.useForm("PublishAction", ({ resetForm: resetForm2 }) => resetForm2);
|
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
|
+
})
|
2338
|
+
});
|
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(
|
2352
|
+
{
|
2353
|
+
pathname: `../${res.data.documentId}`,
|
2354
|
+
search: rawQuery
|
2355
|
+
},
|
2356
|
+
{ relative: "path" }
|
2357
|
+
);
|
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));
|
2373
|
+
} else {
|
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(
|
2386
|
+
{
|
2387
|
+
pathname: `../${res.data.documentId}`,
|
2388
|
+
search: rawQuery
|
2389
|
+
},
|
2390
|
+
{ replace: true, relative: "path" }
|
2391
|
+
);
|
2392
|
+
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2393
|
+
setErrors(formatValidationErrors(res.error));
|
2394
|
+
}
|
2395
|
+
}
|
2396
|
+
} finally {
|
2397
|
+
setSubmitting(false);
|
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]);
|
2294
2433
|
return {
|
2295
2434
|
/**
|
2296
2435
|
* Disabled when:
|
@@ -2303,84 +2442,11 @@ const UpdateAction = ({
|
|
2303
2442
|
id: "global.save",
|
2304
2443
|
defaultMessage: "Save"
|
2305
2444
|
}),
|
2306
|
-
onClick:
|
2307
|
-
setSubmitting(true);
|
2308
|
-
try {
|
2309
|
-
const { errors } = await validate(true, {
|
2310
|
-
status: "draft"
|
2311
|
-
});
|
2312
|
-
if (errors) {
|
2313
|
-
toggleNotification({
|
2314
|
-
type: "danger",
|
2315
|
-
message: formatMessage({
|
2316
|
-
id: "content-manager.validation.error",
|
2317
|
-
defaultMessage: "There are validation errors in your document. Please fix them before saving."
|
2318
|
-
})
|
2319
|
-
});
|
2320
|
-
return;
|
2321
|
-
}
|
2322
|
-
if (isCloning) {
|
2323
|
-
const res = await clone(
|
2324
|
-
{
|
2325
|
-
model,
|
2326
|
-
documentId: cloneMatch.params.origin,
|
2327
|
-
params
|
2328
|
-
},
|
2329
|
-
transformData(document)
|
2330
|
-
);
|
2331
|
-
if ("data" in res) {
|
2332
|
-
navigate(
|
2333
|
-
{
|
2334
|
-
pathname: `../${res.data.documentId}`,
|
2335
|
-
search: rawQuery
|
2336
|
-
},
|
2337
|
-
{ relative: "path" }
|
2338
|
-
);
|
2339
|
-
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2340
|
-
setErrors(formatValidationErrors(res.error));
|
2341
|
-
}
|
2342
|
-
} else if (documentId || collectionType === SINGLE_TYPES) {
|
2343
|
-
const res = await update(
|
2344
|
-
{
|
2345
|
-
collectionType,
|
2346
|
-
model,
|
2347
|
-
documentId,
|
2348
|
-
params
|
2349
|
-
},
|
2350
|
-
transformData(document)
|
2351
|
-
);
|
2352
|
-
if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2353
|
-
setErrors(formatValidationErrors(res.error));
|
2354
|
-
} else {
|
2355
|
-
resetForm();
|
2356
|
-
}
|
2357
|
-
} else {
|
2358
|
-
const res = await create(
|
2359
|
-
{
|
2360
|
-
model,
|
2361
|
-
params
|
2362
|
-
},
|
2363
|
-
transformData(document)
|
2364
|
-
);
|
2365
|
-
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2366
|
-
navigate(
|
2367
|
-
{
|
2368
|
-
pathname: `../${res.data.documentId}`,
|
2369
|
-
search: rawQuery
|
2370
|
-
},
|
2371
|
-
{ replace: true, relative: "path" }
|
2372
|
-
);
|
2373
|
-
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2374
|
-
setErrors(formatValidationErrors(res.error));
|
2375
|
-
}
|
2376
|
-
}
|
2377
|
-
} finally {
|
2378
|
-
setSubmitting(false);
|
2379
|
-
}
|
2380
|
-
}
|
2445
|
+
onClick: handleUpdate
|
2381
2446
|
};
|
2382
2447
|
};
|
2383
2448
|
UpdateAction.type = "update";
|
2449
|
+
UpdateAction.position = "panel";
|
2384
2450
|
const UNPUBLISH_DRAFT_OPTIONS = {
|
2385
2451
|
KEEP: "keep",
|
2386
2452
|
DISCARD: "discard"
|
@@ -2503,6 +2569,7 @@ const UnpublishAction$1 = ({
|
|
2503
2569
|
};
|
2504
2570
|
};
|
2505
2571
|
UnpublishAction$1.type = "unpublish";
|
2572
|
+
UnpublishAction$1.position = "panel";
|
2506
2573
|
const DiscardAction = ({
|
2507
2574
|
activeTab,
|
2508
2575
|
documentId,
|
@@ -2553,6 +2620,7 @@ const DiscardAction = ({
|
|
2553
2620
|
};
|
2554
2621
|
};
|
2555
2622
|
DiscardAction.type = "discard";
|
2623
|
+
DiscardAction.position = "panel";
|
2556
2624
|
const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
|
2557
2625
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
2558
2626
|
const RelativeTime = React__namespace.forwardRef(
|
@@ -2672,7 +2740,7 @@ const HeaderToolbar = () => {
|
|
2672
2740
|
meta: isCloning ? void 0 : meta,
|
2673
2741
|
collectionType
|
2674
2742
|
},
|
2675
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
2743
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
|
2676
2744
|
children: (actions2) => {
|
2677
2745
|
const headerActions = actions2.filter((action) => {
|
2678
2746
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -2880,6 +2948,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
|
|
2880
2948
|
};
|
2881
2949
|
};
|
2882
2950
|
ConfigureTheViewAction.type = "configure-the-view";
|
2951
|
+
ConfigureTheViewAction.position = "header";
|
2883
2952
|
const EditTheModelAction = ({ model }) => {
|
2884
2953
|
const navigate = reactRouterDom.useNavigate();
|
2885
2954
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2896,6 +2965,7 @@ const EditTheModelAction = ({ model }) => {
|
|
2896
2965
|
};
|
2897
2966
|
};
|
2898
2967
|
EditTheModelAction.type = "edit-the-model";
|
2968
|
+
EditTheModelAction.position = "header";
|
2899
2969
|
const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
2900
2970
|
const navigate = reactRouterDom.useNavigate();
|
2901
2971
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2969,6 +3039,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
|
2969
3039
|
};
|
2970
3040
|
};
|
2971
3041
|
DeleteAction$1.type = "delete";
|
3042
|
+
DeleteAction$1.position = ["header", "table-row"];
|
2972
3043
|
const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
|
2973
3044
|
const Panels = () => {
|
2974
3045
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
@@ -3031,7 +3102,7 @@ const ActionsPanelContent = () => {
|
|
3031
3102
|
strapiAdmin.DescriptionComponentRenderer,
|
3032
3103
|
{
|
3033
3104
|
props,
|
3034
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
3105
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
|
3035
3106
|
children: (actions2) => /* @__PURE__ */ jsxRuntime.jsx(DocumentActions, { actions: actions2 })
|
3036
3107
|
}
|
3037
3108
|
),
|
@@ -3707,7 +3778,7 @@ const TableActions = ({ document }) => {
|
|
3707
3778
|
strapiAdmin.DescriptionComponentRenderer,
|
3708
3779
|
{
|
3709
3780
|
props,
|
3710
|
-
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"),
|
3711
3782
|
children: (actions2) => {
|
3712
3783
|
const tableRowActions = actions2.filter((action) => {
|
3713
3784
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -3766,6 +3837,7 @@ const EditAction = ({ documentId }) => {
|
|
3766
3837
|
};
|
3767
3838
|
};
|
3768
3839
|
EditAction.type = "edit";
|
3840
|
+
EditAction.position = "table-row";
|
3769
3841
|
const StyledPencil = styledComponents.styled(Icons.Pencil)`
|
3770
3842
|
path {
|
3771
3843
|
fill: currentColor;
|
@@ -3842,6 +3914,7 @@ const CloneAction = ({ model, documentId }) => {
|
|
3842
3914
|
};
|
3843
3915
|
};
|
3844
3916
|
CloneAction.type = "clone";
|
3917
|
+
CloneAction.position = "table-row";
|
3845
3918
|
const StyledDuplicate = styledComponents.styled(Icons.Duplicate)`
|
3846
3919
|
path {
|
3847
3920
|
fill: currentColor;
|
@@ -3928,7 +4001,14 @@ class ContentManagerPlugin {
|
|
3928
4001
|
addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
|
3929
4002
|
addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
|
3930
4003
|
getBulkActions: () => this.bulkActions,
|
3931
|
-
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
|
+
},
|
3932
4012
|
getEditViewSidePanels: () => this.editViewSidePanels,
|
3933
4013
|
getHeaderActions: () => this.headerActions
|
3934
4014
|
}
|
@@ -3992,6 +4072,7 @@ const HistoryAction = ({ model, document }) => {
|
|
3992
4072
|
};
|
3993
4073
|
};
|
3994
4074
|
HistoryAction.type = "history";
|
4075
|
+
HistoryAction.position = "header";
|
3995
4076
|
const historyAdmin = {
|
3996
4077
|
bootstrap(app) {
|
3997
4078
|
const { addDocumentAction } = app.getPlugin("content-manager").apis;
|
@@ -4085,7 +4166,7 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
|
|
4085
4166
|
};
|
4086
4167
|
return {
|
4087
4168
|
title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
|
4088
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(
|
4169
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(
|
4089
4170
|
ConditionalTooltip,
|
4090
4171
|
{
|
4091
4172
|
label: formatMessage({
|
@@ -4093,31 +4174,29 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
|
|
4093
4174
|
defaultMessage: "Please save to open the preview"
|
4094
4175
|
}),
|
4095
4176
|
isShown: isModified,
|
4096
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
4177
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
4097
4178
|
designSystem.Button,
|
4098
4179
|
{
|
4099
4180
|
variant: "tertiary",
|
4100
4181
|
tag: reactRouterDom.Link,
|
4101
4182
|
to: { pathname: "preview", search: qs.stringify(query, { encode: false }) },
|
4102
4183
|
onClick: trackNavigation,
|
4103
|
-
|
4184
|
+
width: "100%",
|
4104
4185
|
disabled: isModified,
|
4186
|
+
pointerEvents: isModified ? "none" : void 0,
|
4187
|
+
tabIndex: isModified ? -1 : void 0,
|
4105
4188
|
children: formatMessage({
|
4106
4189
|
id: "content-manager.preview.panel.button",
|
4107
4190
|
defaultMessage: "Open preview"
|
4108
4191
|
})
|
4109
4192
|
}
|
4110
|
-
)
|
4193
|
+
) })
|
4111
4194
|
}
|
4112
|
-
)
|
4195
|
+
)
|
4113
4196
|
};
|
4114
4197
|
};
|
4115
|
-
const FEATURE_ID = "preview";
|
4116
4198
|
const previewAdmin = {
|
4117
4199
|
bootstrap(app) {
|
4118
|
-
if (!window.strapi.future.isEnabled(FEATURE_ID)) {
|
4119
|
-
return;
|
4120
|
-
}
|
4121
4200
|
const contentManagerPluginApis = app.getPlugin("content-manager").apis;
|
4122
4201
|
contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
|
4123
4202
|
}
|
@@ -4141,7 +4220,7 @@ const index = {
|
|
4141
4220
|
app.router.addRoute({
|
4142
4221
|
path: "content-manager/*",
|
4143
4222
|
lazy: async () => {
|
4144
|
-
const { Layout } = await Promise.resolve().then(() => require("./layout-
|
4223
|
+
const { Layout } = await Promise.resolve().then(() => require("./layout-BW80JSCd.js"));
|
4145
4224
|
return {
|
4146
4225
|
Component: Layout
|
4147
4226
|
};
|
@@ -4161,7 +4240,7 @@ const index = {
|
|
4161
4240
|
async registerTrads({ locales }) {
|
4162
4241
|
const importedTrads = await Promise.all(
|
4163
4242
|
locales.map((locale) => {
|
4164
|
-
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 }) => {
|
4165
4244
|
return {
|
4166
4245
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
4167
4246
|
locale
|
@@ -4221,4 +4300,4 @@ exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuer
|
|
4221
4300
|
exports.useGetInitialDataQuery = useGetInitialDataQuery;
|
4222
4301
|
exports.useGetPreviewUrlQuery = useGetPreviewUrlQuery;
|
4223
4302
|
exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
|
4224
|
-
//# sourceMappingURL=index-
|
4303
|
+
//# sourceMappingURL=index-Ca7YWlAA.js.map
|