@strapi/content-manager 0.0.0-experimental.59ce88771272039a9d868fba2f7b503edf715c6a → 0.0.0-experimental.5e04dee5c96cd68273df3b3cadf4635e19dc2afc
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/LICENSE +18 -3
- package/dist/_chunks/{ComponentConfigurationPage-gdUj_t-O.mjs → ComponentConfigurationPage-B3yDbeU1.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-gdUj_t-O.mjs.map → ComponentConfigurationPage-B3yDbeU1.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-WRPUXGd6.js → ComponentConfigurationPage-KXSuLnQD.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-WRPUXGd6.js.map → ComponentConfigurationPage-KXSuLnQD.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-C1vjMBgy.js → EditConfigurationPage-BQ17--5R.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-C1vjMBgy.js.map → EditConfigurationPage-BQ17--5R.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BwuIPOJG.mjs → EditConfigurationPage-D7PrLO8j.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BwuIPOJG.mjs.map → EditConfigurationPage-D7PrLO8j.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-0MiFkXa8.mjs → EditViewPage-B7VgwJaG.mjs} +18 -7
- package/dist/_chunks/EditViewPage-B7VgwJaG.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-DbcGfyqK.js → EditViewPage-BgjdnGz2.js} +18 -7
- package/dist/_chunks/EditViewPage-BgjdnGz2.js.map +1 -0
- package/dist/_chunks/{Field-BG1xu38N.js → Field-CdK7ZLmv.js} +434 -83
- package/dist/_chunks/Field-CdK7ZLmv.js.map +1 -0
- package/dist/_chunks/{Field-BDMSCcy5.mjs → Field-tHCw4lGA.mjs} +435 -84
- package/dist/_chunks/Field-tHCw4lGA.mjs.map +1 -0
- package/dist/_chunks/{Form-CPVWavB8.mjs → Form-BJxdTv3Q.mjs} +26 -12
- package/dist/_chunks/Form-BJxdTv3Q.mjs.map +1 -0
- package/dist/_chunks/{Form-9BnFyUjy.js → Form-C_0KTVvV.js} +26 -12
- package/dist/_chunks/Form-C_0KTVvV.js.map +1 -0
- package/dist/_chunks/{History-BVpd8LP3.mjs → History-DR2txJLE.mjs} +44 -19
- package/dist/_chunks/History-DR2txJLE.mjs.map +1 -0
- package/dist/_chunks/{History-BWWxLt2Z.js → History-nuEzM5qm.js} +44 -19
- package/dist/_chunks/History-nuEzM5qm.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-6swzjdAZ.js → ListConfigurationPage-CnB86Psm.js} +20 -8
- package/dist/_chunks/ListConfigurationPage-CnB86Psm.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DozVMKcR.mjs → ListConfigurationPage-voFVtXu6.mjs} +20 -8
- package/dist/_chunks/ListConfigurationPage-voFVtXu6.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-Ds0ulgfG.mjs → ListViewPage-B_GaWgRH.mjs} +22 -8
- package/dist/_chunks/ListViewPage-B_GaWgRH.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-BlzfjS2Q.js → ListViewPage-SXIXm-RM.js} +21 -7
- package/dist/_chunks/ListViewPage-SXIXm-RM.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-D2nCCWEl.js → NoContentTypePage-BzsQ3hLZ.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-D2nCCWEl.js.map → NoContentTypePage-BzsQ3hLZ.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BH11kaKt.mjs → NoContentTypePage-CYiGpsbj.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-BH11kaKt.mjs.map → NoContentTypePage-CYiGpsbj.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BT2Tn0D_.mjs → NoPermissionsPage-B5baIHal.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BT2Tn0D_.mjs.map → NoPermissionsPage-B5baIHal.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DN_JlsU2.js → NoPermissionsPage-IGkId4C5.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DN_JlsU2.js.map → NoPermissionsPage-IGkId4C5.js.map} +1 -1
- package/dist/_chunks/{Relations-Dnag3fhV.mjs → Relations-CIYDdKU-.mjs} +4 -4
- package/dist/_chunks/Relations-CIYDdKU-.mjs.map +1 -0
- package/dist/_chunks/{Relations-CcgFTcWo.js → Relations-Dhuurpx2.js} +4 -4
- package/dist/_chunks/Relations-Dhuurpx2.js.map +1 -0
- package/dist/_chunks/{en-Ux26r5pl.mjs → en-BrCTWlZv.mjs} +5 -4
- package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-BrCTWlZv.mjs.map} +1 -1
- package/dist/_chunks/{en-fbKQxLGn.js → en-uOUIxfcQ.js} +5 -4
- package/dist/_chunks/{en-fbKQxLGn.js.map → en-uOUIxfcQ.js.map} +1 -1
- package/dist/_chunks/{index-JNNNKUHs.mjs → index-C9TJPyni.mjs} +351 -151
- package/dist/_chunks/index-C9TJPyni.mjs.map +1 -0
- package/dist/_chunks/{index-CWpLBSt0.js → index-CdT0kHZ8.js} +336 -136
- package/dist/_chunks/index-CdT0kHZ8.js.map +1 -0
- package/dist/_chunks/{layout-DC503LnF.mjs → layout-BNqvLR_b.mjs} +25 -13
- package/dist/_chunks/layout-BNqvLR_b.mjs.map +1 -0
- package/dist/_chunks/{layout--iHdZzRk.js → layout-C6dxWYT7.js} +23 -11
- package/dist/_chunks/layout-C6dxWYT7.js.map +1 -0
- package/dist/_chunks/{relations-CTje5t-a.mjs → relations-CkKqKw65.mjs} +2 -2
- package/dist/_chunks/{relations-CTje5t-a.mjs.map → relations-CkKqKw65.mjs.map} +1 -1
- package/dist/_chunks/{relations-BbHizA5K.js → relations-DtFaDnP1.js} +2 -2
- package/dist/_chunks/{relations-BbHizA5K.js.map → relations-DtFaDnP1.js.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +4 -4
- package/dist/admin/src/history/index.d.ts +3 -0
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +10 -22
- package/dist/server/index.js +137 -90
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +138 -91
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/uid.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
- package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +1 -1
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/_chunks/EditViewPage-0MiFkXa8.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-DbcGfyqK.js.map +0 -1
- package/dist/_chunks/Field-BDMSCcy5.mjs.map +0 -1
- package/dist/_chunks/Field-BG1xu38N.js.map +0 -1
- package/dist/_chunks/Form-9BnFyUjy.js.map +0 -1
- package/dist/_chunks/Form-CPVWavB8.mjs.map +0 -1
- package/dist/_chunks/History-BVpd8LP3.mjs.map +0 -1
- package/dist/_chunks/History-BWWxLt2Z.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-6swzjdAZ.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DozVMKcR.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BlzfjS2Q.js.map +0 -1
- package/dist/_chunks/ListViewPage-Ds0ulgfG.mjs.map +0 -1
- package/dist/_chunks/Relations-CcgFTcWo.js.map +0 -1
- package/dist/_chunks/Relations-Dnag3fhV.mjs.map +0 -1
- package/dist/_chunks/index-CWpLBSt0.js.map +0 -1
- package/dist/_chunks/index-JNNNKUHs.mjs.map +0 -1
- package/dist/_chunks/layout--iHdZzRk.js.map +0 -1
- package/dist/_chunks/layout-DC503LnF.mjs.map +0 -1
@@ -1,17 +1,17 @@
|
|
1
|
-
import {
|
1
|
+
import { CrossCircle, More, WarningCircle, ListPlus, Pencil, Trash, Check, CheckCircle, ArrowsCounterClockwise, ChevronRight, Duplicate, ClockCounterClockwise, Feather } from "@strapi/icons";
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
3
|
-
import { useStrapiApp,
|
4
|
-
import { stringify } from "qs";
|
5
|
-
import { useIntl } from "react-intl";
|
6
|
-
import { useNavigate, useParams, Navigate, useMatch, useLocation, Link, NavLink } from "react-router-dom";
|
3
|
+
import { useStrapiApp, createContext, useAuth, useRBAC, Page, adminApi, translatedErrors, useNotification, useAPIErrorHandler, getYupValidationErrors, useQueryParams, useTracking, useForm, BackButton, DescriptionComponentRenderer, useTable, Table } from "@strapi/admin/strapi-admin";
|
7
4
|
import * as React from "react";
|
8
5
|
import { lazy } from "react";
|
9
|
-
import {
|
6
|
+
import { Menu, Button, VisuallyHidden, Flex, Typography, Dialog, Modal, Radio, Status, Box, SingleSelect, SingleSelectOption, Loader, IconButton, Tooltip, LinkButton } from "@strapi/design-system";
|
7
|
+
import { useIntl } from "react-intl";
|
8
|
+
import { useParams, Navigate, useNavigate, useMatch, useLocation, Link, NavLink } from "react-router-dom";
|
10
9
|
import { styled } from "styled-components";
|
11
10
|
import * as yup from "yup";
|
12
11
|
import { ValidationError } from "yup";
|
13
12
|
import pipe from "lodash/fp/pipe";
|
14
13
|
import { intervalToDuration, isPast } from "date-fns";
|
14
|
+
import { stringify } from "qs";
|
15
15
|
import { createSlice, combineReducers } from "@reduxjs/toolkit";
|
16
16
|
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
17
17
|
const v = glob[path];
|
@@ -49,42 +49,6 @@ const useInjectionZone = (area) => {
|
|
49
49
|
const [page, position] = area.split(".");
|
50
50
|
return contentManagerPlugin.getInjectedComponents(page, position);
|
51
51
|
};
|
52
|
-
const HistoryAction = ({ model, document }) => {
|
53
|
-
const { formatMessage } = useIntl();
|
54
|
-
const [{ query }] = useQueryParams();
|
55
|
-
const navigate = useNavigate();
|
56
|
-
const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
|
57
|
-
if (!window.strapi.features.isEnabled("cms-content-history")) {
|
58
|
-
return null;
|
59
|
-
}
|
60
|
-
return {
|
61
|
-
icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
|
62
|
-
label: formatMessage({
|
63
|
-
id: "content-manager.history.document-action",
|
64
|
-
defaultMessage: "Content History"
|
65
|
-
}),
|
66
|
-
onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
|
67
|
-
disabled: (
|
68
|
-
/**
|
69
|
-
* The user is creating a new document.
|
70
|
-
* It hasn't been saved yet, so there's no history to go to
|
71
|
-
*/
|
72
|
-
!document || /**
|
73
|
-
* The document has been created but the current dimension has never been saved.
|
74
|
-
* For example, the user is creating a new locale in an existing document,
|
75
|
-
* so there's no history for the document in that locale
|
76
|
-
*/
|
77
|
-
!document.id || /**
|
78
|
-
* History is only available for content types created by the user.
|
79
|
-
* These have the `api::` prefix, as opposed to the ones created by Strapi or plugins,
|
80
|
-
* which start with `admin::` or `plugin::`
|
81
|
-
*/
|
82
|
-
!model.startsWith("api::")
|
83
|
-
),
|
84
|
-
position: "header"
|
85
|
-
};
|
86
|
-
};
|
87
|
-
HistoryAction.type = "history";
|
88
52
|
const ID = "id";
|
89
53
|
const CREATED_BY_ATTRIBUTE_NAME = "createdBy";
|
90
54
|
const UPDATED_BY_ATTRIBUTE_NAME = "updatedBy";
|
@@ -198,6 +162,7 @@ const contentManagerApi = adminApi.enhanceEndpoints({
|
|
198
162
|
]
|
199
163
|
});
|
200
164
|
const documentApi = contentManagerApi.injectEndpoints({
|
165
|
+
overrideExisting: true,
|
201
166
|
endpoints: (builder) => ({
|
202
167
|
autoCloneDocument: builder.mutation({
|
203
168
|
query: ({ model, sourceId, query }) => ({
|
@@ -207,7 +172,12 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
207
172
|
params: query
|
208
173
|
}
|
209
174
|
}),
|
210
|
-
invalidatesTags: (_result,
|
175
|
+
invalidatesTags: (_result, error, { model }) => {
|
176
|
+
if (error) {
|
177
|
+
return [];
|
178
|
+
}
|
179
|
+
return [{ type: "Document", id: `${model}_LIST` }];
|
180
|
+
}
|
211
181
|
}),
|
212
182
|
cloneDocument: builder.mutation({
|
213
183
|
query: ({ model, sourceId, data, params }) => ({
|
@@ -294,6 +264,7 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
294
264
|
}),
|
295
265
|
providesTags: (result, _error, arg) => {
|
296
266
|
return [
|
267
|
+
{ type: "Document", id: `ALL_LIST` },
|
297
268
|
{ type: "Document", id: `${arg.model}_LIST` },
|
298
269
|
...result?.results.map(({ documentId }) => ({
|
299
270
|
type: "Document",
|
@@ -332,6 +303,11 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
332
303
|
{
|
333
304
|
type: "Document",
|
334
305
|
id: collectionType !== SINGLE_TYPES ? `${model}_${result && "documentId" in result ? result.documentId : documentId}` : model
|
306
|
+
},
|
307
|
+
// Make it easy to invalidate all individual documents queries for a model
|
308
|
+
{
|
309
|
+
type: "Document",
|
310
|
+
id: `${model}_ALL_ITEMS`
|
335
311
|
}
|
336
312
|
];
|
337
313
|
}
|
@@ -397,6 +373,18 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
397
373
|
},
|
398
374
|
"Relations"
|
399
375
|
];
|
376
|
+
},
|
377
|
+
async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {
|
378
|
+
const patchResult = dispatch(
|
379
|
+
documentApi.util.updateQueryData("getDocument", patch, (draft) => {
|
380
|
+
Object.assign(draft.data, data);
|
381
|
+
})
|
382
|
+
);
|
383
|
+
try {
|
384
|
+
await queryFulfilled;
|
385
|
+
} catch {
|
386
|
+
patchResult.undo();
|
387
|
+
}
|
400
388
|
}
|
401
389
|
}),
|
402
390
|
unpublishDocument: builder.mutation({
|
@@ -580,6 +568,14 @@ const createAttributeSchema = (attribute) => {
|
|
580
568
|
if (!value || typeof value === "string" && value.length === 0) {
|
581
569
|
return true;
|
582
570
|
}
|
571
|
+
if (typeof value === "object") {
|
572
|
+
try {
|
573
|
+
JSON.stringify(value);
|
574
|
+
return true;
|
575
|
+
} catch (err) {
|
576
|
+
return false;
|
577
|
+
}
|
578
|
+
}
|
583
579
|
try {
|
584
580
|
JSON.parse(value);
|
585
581
|
return true;
|
@@ -599,11 +595,11 @@ const createAttributeSchema = (attribute) => {
|
|
599
595
|
}
|
600
596
|
};
|
601
597
|
const addRequiredValidation = (attribute) => (schema) => {
|
602
|
-
if (attribute.required) {
|
603
|
-
return schema.required
|
604
|
-
|
605
|
-
|
606
|
-
|
598
|
+
if ((attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") && attribute.required && "min" in schema) {
|
599
|
+
return schema.min(1, translatedErrors.required);
|
600
|
+
}
|
601
|
+
if (attribute.required && attribute.type !== "relation") {
|
602
|
+
return schema.required(translatedErrors.required);
|
607
603
|
}
|
608
604
|
return schema?.nullable ? schema.nullable() : (
|
609
605
|
// In some cases '.nullable' will not be available on the schema.
|
@@ -637,6 +633,28 @@ const addMaxLengthValidation = (attribute) => (schema) => {
|
|
637
633
|
const addMinValidation = (attribute) => (schema) => {
|
638
634
|
if ("min" in attribute) {
|
639
635
|
const min = toInteger(attribute.min);
|
636
|
+
if (attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") {
|
637
|
+
if (!attribute.required && "test" in schema && min) {
|
638
|
+
return schema.test(
|
639
|
+
"custom-min",
|
640
|
+
{
|
641
|
+
...translatedErrors.min,
|
642
|
+
values: {
|
643
|
+
min: attribute.min
|
644
|
+
}
|
645
|
+
},
|
646
|
+
(value) => {
|
647
|
+
if (!value) {
|
648
|
+
return true;
|
649
|
+
}
|
650
|
+
if (Array.isArray(value) && value.length === 0) {
|
651
|
+
return true;
|
652
|
+
}
|
653
|
+
return value.length >= min;
|
654
|
+
}
|
655
|
+
);
|
656
|
+
}
|
657
|
+
}
|
640
658
|
if ("min" in schema && min) {
|
641
659
|
return schema.min(min, {
|
642
660
|
...translatedErrors.min,
|
@@ -763,7 +781,10 @@ const useDocument = (args, opts) => {
|
|
763
781
|
isLoading: isLoadingDocument,
|
764
782
|
isFetching: isFetchingDocument,
|
765
783
|
error
|
766
|
-
} = useGetDocumentQuery(args,
|
784
|
+
} = useGetDocumentQuery(args, {
|
785
|
+
...opts,
|
786
|
+
skip: !args.documentId && args.collectionType !== SINGLE_TYPES || opts?.skip
|
787
|
+
});
|
767
788
|
const { components, schema, isLoading: isLoadingSchema } = useContentTypeSchema(args.model);
|
768
789
|
React.useEffect(() => {
|
769
790
|
if (error) {
|
@@ -1184,7 +1205,6 @@ const useDocumentActions = () => {
|
|
1184
1205
|
sourceId
|
1185
1206
|
});
|
1186
1207
|
if ("error" in res) {
|
1187
|
-
toggleNotification({ type: "danger", message: formatAPIError(res.error) });
|
1188
1208
|
return { error: res.error };
|
1189
1209
|
}
|
1190
1210
|
toggleNotification({
|
@@ -1265,7 +1285,7 @@ const useDocumentActions = () => {
|
|
1265
1285
|
};
|
1266
1286
|
};
|
1267
1287
|
const ProtectedHistoryPage = lazy(
|
1268
|
-
() => import("./History-
|
1288
|
+
() => import("./History-DR2txJLE.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1269
1289
|
);
|
1270
1290
|
const routes$1 = [
|
1271
1291
|
{
|
@@ -1278,31 +1298,31 @@ const routes$1 = [
|
|
1278
1298
|
}
|
1279
1299
|
];
|
1280
1300
|
const ProtectedEditViewPage = lazy(
|
1281
|
-
() => import("./EditViewPage-
|
1301
|
+
() => import("./EditViewPage-B7VgwJaG.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1282
1302
|
);
|
1283
1303
|
const ProtectedListViewPage = lazy(
|
1284
|
-
() => import("./ListViewPage-
|
1304
|
+
() => import("./ListViewPage-B_GaWgRH.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1285
1305
|
);
|
1286
1306
|
const ProtectedListConfiguration = lazy(
|
1287
|
-
() => import("./ListConfigurationPage-
|
1307
|
+
() => import("./ListConfigurationPage-voFVtXu6.mjs").then((mod) => ({
|
1288
1308
|
default: mod.ProtectedListConfiguration
|
1289
1309
|
}))
|
1290
1310
|
);
|
1291
1311
|
const ProtectedEditConfigurationPage = lazy(
|
1292
|
-
() => import("./EditConfigurationPage-
|
1312
|
+
() => import("./EditConfigurationPage-D7PrLO8j.mjs").then((mod) => ({
|
1293
1313
|
default: mod.ProtectedEditConfigurationPage
|
1294
1314
|
}))
|
1295
1315
|
);
|
1296
1316
|
const ProtectedComponentConfigurationPage = lazy(
|
1297
|
-
() => import("./ComponentConfigurationPage-
|
1317
|
+
() => import("./ComponentConfigurationPage-B3yDbeU1.mjs").then((mod) => ({
|
1298
1318
|
default: mod.ProtectedComponentConfigurationPage
|
1299
1319
|
}))
|
1300
1320
|
);
|
1301
1321
|
const NoPermissions = lazy(
|
1302
|
-
() => import("./NoPermissionsPage-
|
1322
|
+
() => import("./NoPermissionsPage-B5baIHal.mjs").then((mod) => ({ default: mod.NoPermissions }))
|
1303
1323
|
);
|
1304
1324
|
const NoContentType = lazy(
|
1305
|
-
() => import("./NoContentTypePage-
|
1325
|
+
() => import("./NoContentTypePage-CYiGpsbj.mjs").then((mod) => ({ default: mod.NoContentType }))
|
1306
1326
|
);
|
1307
1327
|
const CollectionTypePages = () => {
|
1308
1328
|
const { collectionType } = useParams();
|
@@ -1416,12 +1436,14 @@ const DocumentActionButton = (action) => {
|
|
1416
1436
|
/* @__PURE__ */ jsx(
|
1417
1437
|
Button,
|
1418
1438
|
{
|
1419
|
-
flex:
|
1439
|
+
flex: "auto",
|
1420
1440
|
startIcon: action.icon,
|
1421
1441
|
disabled: action.disabled,
|
1422
1442
|
onClick: handleClick(action),
|
1423
1443
|
justifyContent: "center",
|
1424
1444
|
variant: action.variant || "default",
|
1445
|
+
paddingTop: "7px",
|
1446
|
+
paddingBottom: "7px",
|
1425
1447
|
children: action.label
|
1426
1448
|
}
|
1427
1449
|
),
|
@@ -1429,7 +1451,7 @@ const DocumentActionButton = (action) => {
|
|
1429
1451
|
DocumentActionConfirmDialog,
|
1430
1452
|
{
|
1431
1453
|
...action.dialog,
|
1432
|
-
variant: action.variant,
|
1454
|
+
variant: action.dialog?.variant ?? action.variant,
|
1433
1455
|
isOpen: dialogId === action.id,
|
1434
1456
|
onClose: handleClose
|
1435
1457
|
}
|
@@ -1481,14 +1503,14 @@ const DocumentActionsMenu = ({
|
|
1481
1503
|
};
|
1482
1504
|
return /* @__PURE__ */ jsxs(Menu.Root, { open: isOpen, onOpenChange: setIsOpen, children: [
|
1483
1505
|
/* @__PURE__ */ jsxs(
|
1484
|
-
|
1506
|
+
StyledMoreButton,
|
1485
1507
|
{
|
1486
1508
|
disabled: isDisabled,
|
1487
1509
|
size: "S",
|
1488
1510
|
endIcon: null,
|
1489
|
-
paddingTop: "
|
1490
|
-
paddingLeft: "
|
1491
|
-
paddingRight: "
|
1511
|
+
paddingTop: "4px",
|
1512
|
+
paddingLeft: "7px",
|
1513
|
+
paddingRight: "7px",
|
1492
1514
|
variant,
|
1493
1515
|
children: [
|
1494
1516
|
/* @__PURE__ */ jsx(More, { "aria-hidden": true, focusable: false }),
|
@@ -1508,10 +1530,25 @@ const DocumentActionsMenu = ({
|
|
1508
1530
|
onSelect: handleClick(action),
|
1509
1531
|
display: "block",
|
1510
1532
|
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 4, children: [
|
1511
|
-
/* @__PURE__ */ jsxs(
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
1533
|
+
/* @__PURE__ */ jsxs(
|
1534
|
+
Flex,
|
1535
|
+
{
|
1536
|
+
color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
|
1537
|
+
gap: 2,
|
1538
|
+
tag: "span",
|
1539
|
+
children: [
|
1540
|
+
/* @__PURE__ */ jsx(
|
1541
|
+
Flex,
|
1542
|
+
{
|
1543
|
+
tag: "span",
|
1544
|
+
color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
|
1545
|
+
children: action.icon
|
1546
|
+
}
|
1547
|
+
),
|
1548
|
+
action.label
|
1549
|
+
]
|
1550
|
+
}
|
1551
|
+
),
|
1515
1552
|
action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsx(
|
1516
1553
|
Flex,
|
1517
1554
|
{
|
@@ -1570,6 +1607,23 @@ const convertActionVariantToColor = (variant = "secondary") => {
|
|
1570
1607
|
return "primary600";
|
1571
1608
|
}
|
1572
1609
|
};
|
1610
|
+
const convertActionVariantToIconColor = (variant = "secondary") => {
|
1611
|
+
switch (variant) {
|
1612
|
+
case "danger":
|
1613
|
+
return "danger600";
|
1614
|
+
case "secondary":
|
1615
|
+
return "neutral500";
|
1616
|
+
case "success":
|
1617
|
+
return "success600";
|
1618
|
+
default:
|
1619
|
+
return "primary600";
|
1620
|
+
}
|
1621
|
+
};
|
1622
|
+
const StyledMoreButton = styled(Menu.Trigger)`
|
1623
|
+
& > span {
|
1624
|
+
display: flex;
|
1625
|
+
}
|
1626
|
+
`;
|
1573
1627
|
const DocumentActionConfirmDialog = ({
|
1574
1628
|
onClose,
|
1575
1629
|
onCancel,
|
@@ -1646,6 +1700,12 @@ const PublishAction$1 = ({
|
|
1646
1700
|
({ canPublish: canPublish2, canCreate: canCreate2, canUpdate: canUpdate2 }) => ({ canPublish: canPublish2, canCreate: canCreate2, canUpdate: canUpdate2 })
|
1647
1701
|
);
|
1648
1702
|
const { publish } = useDocumentActions();
|
1703
|
+
const [
|
1704
|
+
countDraftRelations,
|
1705
|
+
{ isLoading: isLoadingDraftRelations, isError: isErrorDraftRelations }
|
1706
|
+
] = useLazyGetDraftRelationCountQuery();
|
1707
|
+
const [localCountOfDraftRelations, setLocalCountOfDraftRelations] = React.useState(0);
|
1708
|
+
const [serverCountOfDraftRelations, setServerCountOfDraftRelations] = React.useState(0);
|
1649
1709
|
const [{ query, rawQuery }] = useQueryParams();
|
1650
1710
|
const params = React.useMemo(() => buildValidParams(query), [query]);
|
1651
1711
|
const modified = useForm("PublishAction", ({ modified: modified2 }) => modified2);
|
@@ -1654,10 +1714,101 @@ const PublishAction$1 = ({
|
|
1654
1714
|
const validate = useForm("PublishAction", (state) => state.validate);
|
1655
1715
|
const setErrors = useForm("PublishAction", (state) => state.setErrors);
|
1656
1716
|
const formValues = useForm("PublishAction", ({ values }) => values);
|
1717
|
+
React.useEffect(() => {
|
1718
|
+
if (isErrorDraftRelations) {
|
1719
|
+
toggleNotification({
|
1720
|
+
type: "danger",
|
1721
|
+
message: formatMessage({
|
1722
|
+
id: getTranslation("error.records.fetch-draft-relatons"),
|
1723
|
+
defaultMessage: "An error occurred while fetching draft relations on this document."
|
1724
|
+
})
|
1725
|
+
});
|
1726
|
+
}
|
1727
|
+
}, [isErrorDraftRelations, toggleNotification, formatMessage]);
|
1728
|
+
React.useEffect(() => {
|
1729
|
+
const localDraftRelations = /* @__PURE__ */ new Set();
|
1730
|
+
const extractDraftRelations = (data) => {
|
1731
|
+
const relations = data.connect || [];
|
1732
|
+
relations.forEach((relation) => {
|
1733
|
+
if (relation.status === "draft") {
|
1734
|
+
localDraftRelations.add(relation.id);
|
1735
|
+
}
|
1736
|
+
});
|
1737
|
+
};
|
1738
|
+
const traverseAndExtract = (data) => {
|
1739
|
+
Object.entries(data).forEach(([key, value]) => {
|
1740
|
+
if (key === "connect" && Array.isArray(value)) {
|
1741
|
+
extractDraftRelations({ connect: value });
|
1742
|
+
} else if (typeof value === "object" && value !== null) {
|
1743
|
+
traverseAndExtract(value);
|
1744
|
+
}
|
1745
|
+
});
|
1746
|
+
};
|
1747
|
+
if (!documentId || modified) {
|
1748
|
+
traverseAndExtract(formValues);
|
1749
|
+
setLocalCountOfDraftRelations(localDraftRelations.size);
|
1750
|
+
}
|
1751
|
+
}, [documentId, modified, formValues, setLocalCountOfDraftRelations]);
|
1752
|
+
React.useEffect(() => {
|
1753
|
+
if (documentId) {
|
1754
|
+
const fetchDraftRelationsCount = async () => {
|
1755
|
+
const { data, error } = await countDraftRelations({
|
1756
|
+
collectionType,
|
1757
|
+
model,
|
1758
|
+
documentId,
|
1759
|
+
params
|
1760
|
+
});
|
1761
|
+
if (error) {
|
1762
|
+
throw error;
|
1763
|
+
}
|
1764
|
+
if (data) {
|
1765
|
+
setServerCountOfDraftRelations(data.data);
|
1766
|
+
}
|
1767
|
+
};
|
1768
|
+
fetchDraftRelationsCount();
|
1769
|
+
}
|
1770
|
+
}, [documentId, countDraftRelations, collectionType, model, params]);
|
1657
1771
|
const isDocumentPublished = (document?.[PUBLISHED_AT_ATTRIBUTE_NAME] || meta?.availableStatus.some((doc) => doc[PUBLISHED_AT_ATTRIBUTE_NAME] !== null)) && document?.status !== "modified";
|
1658
1772
|
if (!schema?.options?.draftAndPublish) {
|
1659
1773
|
return null;
|
1660
1774
|
}
|
1775
|
+
const performPublish = async () => {
|
1776
|
+
setSubmitting(true);
|
1777
|
+
try {
|
1778
|
+
const { errors } = await validate();
|
1779
|
+
if (errors) {
|
1780
|
+
toggleNotification({
|
1781
|
+
type: "danger",
|
1782
|
+
message: formatMessage({
|
1783
|
+
id: "content-manager.validation.error",
|
1784
|
+
defaultMessage: "There are validation errors in your document. Please fix them before saving."
|
1785
|
+
})
|
1786
|
+
});
|
1787
|
+
return;
|
1788
|
+
}
|
1789
|
+
const res = await publish(
|
1790
|
+
{
|
1791
|
+
collectionType,
|
1792
|
+
model,
|
1793
|
+
documentId,
|
1794
|
+
params
|
1795
|
+
},
|
1796
|
+
formValues
|
1797
|
+
);
|
1798
|
+
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
1799
|
+
navigate({
|
1800
|
+
pathname: `../${collectionType}/${model}/${res.data.documentId}`,
|
1801
|
+
search: rawQuery
|
1802
|
+
});
|
1803
|
+
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
1804
|
+
setErrors(formatValidationErrors(res.error));
|
1805
|
+
}
|
1806
|
+
} finally {
|
1807
|
+
setSubmitting(false);
|
1808
|
+
}
|
1809
|
+
};
|
1810
|
+
const totalDraftRelations = localCountOfDraftRelations + serverCountOfDraftRelations;
|
1811
|
+
const hasDraftRelations = totalDraftRelations > 0;
|
1661
1812
|
return {
|
1662
1813
|
/**
|
1663
1814
|
* Disabled when:
|
@@ -1667,49 +1818,39 @@ const PublishAction$1 = ({
|
|
1667
1818
|
* - the document is already published & not modified
|
1668
1819
|
* - the document is being created & not modified
|
1669
1820
|
* - the user doesn't have the permission to publish
|
1670
|
-
* - the user doesn't have the permission to create a new document
|
1671
|
-
* - the user doesn't have the permission to update the document
|
1672
1821
|
*/
|
1673
|
-
disabled: isCloning || isSubmitting || activeTab === "published" || !modified && isDocumentPublished || !modified && !document?.documentId || !canPublish
|
1822
|
+
disabled: isCloning || isSubmitting || isLoadingDraftRelations || activeTab === "published" || !modified && isDocumentPublished || !modified && !document?.documentId || !canPublish,
|
1674
1823
|
label: formatMessage({
|
1675
1824
|
id: "app.utils.publish",
|
1676
1825
|
defaultMessage: "Publish"
|
1677
1826
|
}),
|
1678
1827
|
onClick: async () => {
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
formValues
|
1700
|
-
);
|
1701
|
-
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
1702
|
-
navigate({
|
1703
|
-
pathname: `../${collectionType}/${model}/${res.data.documentId}`,
|
1704
|
-
search: rawQuery
|
1705
|
-
});
|
1706
|
-
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
1707
|
-
setErrors(formatValidationErrors(res.error));
|
1828
|
+
if (hasDraftRelations) {
|
1829
|
+
return;
|
1830
|
+
}
|
1831
|
+
await performPublish();
|
1832
|
+
},
|
1833
|
+
dialog: hasDraftRelations ? {
|
1834
|
+
type: "dialog",
|
1835
|
+
variant: "danger",
|
1836
|
+
footer: null,
|
1837
|
+
title: formatMessage({
|
1838
|
+
id: getTranslation(`popUpwarning.warning.bulk-has-draft-relations.title`),
|
1839
|
+
defaultMessage: "Confirmation"
|
1840
|
+
}),
|
1841
|
+
content: formatMessage(
|
1842
|
+
{
|
1843
|
+
id: getTranslation(`popUpwarning.warning.bulk-has-draft-relations.message`),
|
1844
|
+
defaultMessage: "This entry is related to {count, plural, one {# draft entry} other {# draft entries}}. Publishing it could leave broken links in your app."
|
1845
|
+
},
|
1846
|
+
{
|
1847
|
+
count: totalDraftRelations
|
1708
1848
|
}
|
1709
|
-
|
1710
|
-
|
1849
|
+
),
|
1850
|
+
onConfirm: async () => {
|
1851
|
+
await performPublish();
|
1711
1852
|
}
|
1712
|
-
}
|
1853
|
+
} : void 0
|
1713
1854
|
};
|
1714
1855
|
};
|
1715
1856
|
PublishAction$1.type = "publish";
|
@@ -1725,7 +1866,7 @@ const UpdateAction = ({
|
|
1725
1866
|
const cloneMatch = useMatch(CLONE_PATH);
|
1726
1867
|
const isCloning = cloneMatch !== null;
|
1727
1868
|
const { formatMessage } = useIntl();
|
1728
|
-
|
1869
|
+
useDocumentRBAC("UpdateAction", ({ canCreate: canCreate2, canUpdate: canUpdate2 }) => ({
|
1729
1870
|
canCreate: canCreate2,
|
1730
1871
|
canUpdate: canUpdate2
|
1731
1872
|
}));
|
@@ -1745,10 +1886,8 @@ const UpdateAction = ({
|
|
1745
1886
|
* - the form is submitting
|
1746
1887
|
* - the document is not modified & we're not cloning (you can save a clone entity straight away)
|
1747
1888
|
* - the active tab is the published tab
|
1748
|
-
* - the user doesn't have the permission to create a new document
|
1749
|
-
* - the user doesn't have the permission to update the document
|
1750
1889
|
*/
|
1751
|
-
disabled: isSubmitting || !modified && !isCloning || activeTab === "published"
|
1890
|
+
disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
|
1752
1891
|
label: formatMessage({
|
1753
1892
|
id: "content-manager.containers.Edit.save",
|
1754
1893
|
defaultMessage: "Save"
|
@@ -1777,10 +1916,13 @@ const UpdateAction = ({
|
|
1777
1916
|
document
|
1778
1917
|
);
|
1779
1918
|
if ("data" in res) {
|
1780
|
-
navigate(
|
1781
|
-
|
1782
|
-
|
1783
|
-
|
1919
|
+
navigate(
|
1920
|
+
{
|
1921
|
+
pathname: `../${res.data.documentId}`,
|
1922
|
+
search: rawQuery
|
1923
|
+
},
|
1924
|
+
{ relative: "path" }
|
1925
|
+
);
|
1784
1926
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
1785
1927
|
setErrors(formatValidationErrors(res.error));
|
1786
1928
|
}
|
@@ -1808,10 +1950,13 @@ const UpdateAction = ({
|
|
1808
1950
|
document
|
1809
1951
|
);
|
1810
1952
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
1811
|
-
navigate(
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1953
|
+
navigate(
|
1954
|
+
{
|
1955
|
+
pathname: `../${res.data.documentId}`,
|
1956
|
+
search: rawQuery
|
1957
|
+
},
|
1958
|
+
{ replace: true, relative: "path" }
|
1959
|
+
);
|
1815
1960
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
1816
1961
|
setErrors(formatValidationErrors(res.error));
|
1817
1962
|
}
|
@@ -2057,23 +2202,13 @@ const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
|
|
2057
2202
|
id: "content-manager.containers.edit.title.new",
|
2058
2203
|
defaultMessage: "Create an entry"
|
2059
2204
|
}) : documentTitle;
|
2060
|
-
return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingTop:
|
2205
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
|
2061
2206
|
/* @__PURE__ */ jsx(BackButton, {}),
|
2062
|
-
/* @__PURE__ */ jsxs(
|
2063
|
-
|
2064
|
-
{
|
2065
|
-
|
2066
|
-
|
2067
|
-
paddingTop: 1,
|
2068
|
-
gap: "80px",
|
2069
|
-
alignItems: "flex-start",
|
2070
|
-
children: [
|
2071
|
-
/* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
|
2072
|
-
/* @__PURE__ */ jsx(HeaderToolbar, {})
|
2073
|
-
]
|
2074
|
-
}
|
2075
|
-
),
|
2076
|
-
status ? /* @__PURE__ */ jsx(DocumentStatus, { status: isCloning ? "draft" : status }) : null
|
2207
|
+
/* @__PURE__ */ jsxs(Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
|
2208
|
+
/* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
|
2209
|
+
/* @__PURE__ */ jsx(HeaderToolbar, {})
|
2210
|
+
] }),
|
2211
|
+
status ? /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(DocumentStatus, { status: isCloning ? "draft" : status }) }) : null
|
2077
2212
|
] });
|
2078
2213
|
};
|
2079
2214
|
const HeaderToolbar = () => {
|
@@ -2764,7 +2899,7 @@ const ConfirmBulkActionDialog = ({
|
|
2764
2899
|
endAction
|
2765
2900
|
}) => {
|
2766
2901
|
const { formatMessage } = useIntl();
|
2767
|
-
return /* @__PURE__ */ jsx(Dialog.Root, {
|
2902
|
+
return /* @__PURE__ */ jsx(Dialog.Root, { open: isOpen, children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
2768
2903
|
/* @__PURE__ */ jsx(Dialog.Header, { children: formatMessage({
|
2769
2904
|
id: "app.components.ConfirmDialog.title",
|
2770
2905
|
defaultMessage: "Confirmation"
|
@@ -2885,7 +3020,14 @@ const formatErrorMessages = (errors, parentKey, formatMessage) => {
|
|
2885
3020
|
)
|
2886
3021
|
);
|
2887
3022
|
} else {
|
2888
|
-
messages.push(
|
3023
|
+
messages.push(
|
3024
|
+
...formatErrorMessages(
|
3025
|
+
// @ts-expect-error TODO: check why value is not compatible with FormErrors
|
3026
|
+
value,
|
3027
|
+
currentKey,
|
3028
|
+
formatMessage
|
3029
|
+
)
|
3030
|
+
);
|
2889
3031
|
}
|
2890
3032
|
} else {
|
2891
3033
|
messages.push(
|
@@ -3548,8 +3690,7 @@ class ContentManagerPlugin {
|
|
3548
3690
|
documentActions = [
|
3549
3691
|
...DEFAULT_ACTIONS,
|
3550
3692
|
...DEFAULT_TABLE_ROW_ACTIONS,
|
3551
|
-
...DEFAULT_HEADER_ACTIONS
|
3552
|
-
HistoryAction
|
3693
|
+
...DEFAULT_HEADER_ACTIONS
|
3553
3694
|
];
|
3554
3695
|
editViewSidePanels = [ActionsPanel];
|
3555
3696
|
headerActions = [];
|
@@ -3638,6 +3779,52 @@ const getPrintableType = (value) => {
|
|
3638
3779
|
}
|
3639
3780
|
return nativeType;
|
3640
3781
|
};
|
3782
|
+
const HistoryAction = ({ model, document }) => {
|
3783
|
+
const { formatMessage } = useIntl();
|
3784
|
+
const [{ query }] = useQueryParams();
|
3785
|
+
const navigate = useNavigate();
|
3786
|
+
const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
|
3787
|
+
if (!window.strapi.features.isEnabled("cms-content-history")) {
|
3788
|
+
return null;
|
3789
|
+
}
|
3790
|
+
return {
|
3791
|
+
icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
|
3792
|
+
label: formatMessage({
|
3793
|
+
id: "content-manager.history.document-action",
|
3794
|
+
defaultMessage: "Content History"
|
3795
|
+
}),
|
3796
|
+
onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
|
3797
|
+
disabled: (
|
3798
|
+
/**
|
3799
|
+
* The user is creating a new document.
|
3800
|
+
* It hasn't been saved yet, so there's no history to go to
|
3801
|
+
*/
|
3802
|
+
!document || /**
|
3803
|
+
* The document has been created but the current dimension has never been saved.
|
3804
|
+
* For example, the user is creating a new locale in an existing document,
|
3805
|
+
* so there's no history for the document in that locale
|
3806
|
+
*/
|
3807
|
+
!document.id || /**
|
3808
|
+
* History is only available for content types created by the user.
|
3809
|
+
* These have the `api::` prefix, as opposed to the ones created by Strapi or plugins,
|
3810
|
+
* which start with `admin::` or `plugin::`
|
3811
|
+
*/
|
3812
|
+
!model.startsWith("api::")
|
3813
|
+
),
|
3814
|
+
position: "header"
|
3815
|
+
};
|
3816
|
+
};
|
3817
|
+
HistoryAction.type = "history";
|
3818
|
+
const historyAdmin = {
|
3819
|
+
bootstrap(app) {
|
3820
|
+
const { addDocumentAction } = app.getPlugin("content-manager").apis;
|
3821
|
+
addDocumentAction((actions2) => {
|
3822
|
+
const indexOfDeleteAction = actions2.findIndex((action) => action.type === "delete");
|
3823
|
+
actions2.splice(indexOfDeleteAction, 0, HistoryAction);
|
3824
|
+
return actions2;
|
3825
|
+
});
|
3826
|
+
}
|
3827
|
+
};
|
3641
3828
|
const initialState = {
|
3642
3829
|
collectionTypeLinks: [],
|
3643
3830
|
components: [],
|
@@ -3688,15 +3875,29 @@ const index = {
|
|
3688
3875
|
defaultMessage: "Content Manager"
|
3689
3876
|
},
|
3690
3877
|
permissions: [],
|
3691
|
-
Component: () => import("./layout-DC503LnF.mjs").then((mod) => ({ default: mod.Layout })),
|
3692
3878
|
position: 1
|
3693
3879
|
});
|
3880
|
+
app.router.addRoute({
|
3881
|
+
path: "content-manager/*",
|
3882
|
+
lazy: async () => {
|
3883
|
+
const { Layout } = await import("./layout-BNqvLR_b.mjs");
|
3884
|
+
return {
|
3885
|
+
Component: Layout
|
3886
|
+
};
|
3887
|
+
},
|
3888
|
+
children: routes
|
3889
|
+
});
|
3694
3890
|
app.registerPlugin(cm.config);
|
3695
3891
|
},
|
3892
|
+
bootstrap(app) {
|
3893
|
+
if (typeof historyAdmin.bootstrap === "function") {
|
3894
|
+
historyAdmin.bootstrap(app);
|
3895
|
+
}
|
3896
|
+
},
|
3696
3897
|
async registerTrads({ locales }) {
|
3697
3898
|
const importedTrads = await Promise.all(
|
3698
3899
|
locales.map((locale) => {
|
3699
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-CCEVvqGG.mjs"), "./translations/ca.json": () => import("./ca-5U32ON2v.mjs"), "./translations/cs.json": () => import("./cs-CM2aBUar.mjs"), "./translations/de.json": () => import("./de-C72KDNOl.mjs"), "./translations/en.json": () => import("./en-
|
3900
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-CCEVvqGG.mjs"), "./translations/ca.json": () => import("./ca-5U32ON2v.mjs"), "./translations/cs.json": () => import("./cs-CM2aBUar.mjs"), "./translations/de.json": () => import("./de-C72KDNOl.mjs"), "./translations/en.json": () => import("./en-BrCTWlZv.mjs"), "./translations/es.json": () => import("./es-CeXiYflN.mjs"), "./translations/eu.json": () => import("./eu-CdALomew.mjs"), "./translations/fr.json": () => import("./fr-CD9VFbPM.mjs"), "./translations/gu.json": () => import("./gu-CNpaMDpH.mjs"), "./translations/hi.json": () => import("./hi-Dwvd04m3.mjs"), "./translations/hu.json": () => import("./hu-CeYvaaO0.mjs"), "./translations/id.json": () => import("./id-BtwA9WJT.mjs"), "./translations/it.json": () => import("./it-BrVPqaf1.mjs"), "./translations/ja.json": () => import("./ja-CtsUxOvk.mjs"), "./translations/ko.json": () => import("./ko-HVQRlfUI.mjs"), "./translations/ml.json": () => import("./ml-BihZwQit.mjs"), "./translations/ms.json": () => import("./ms-m_WjyWx7.mjs"), "./translations/nl.json": () => import("./nl-D4R9gHx5.mjs"), "./translations/pl.json": () => import("./pl-sbx9mSt_.mjs"), "./translations/pt-BR.json": () => import("./pt-BR-C71iDxnh.mjs"), "./translations/pt.json": () => import("./pt-BsaFvS8-.mjs"), "./translations/ru.json": () => import("./ru-BE6A4Exp.mjs"), "./translations/sa.json": () => import("./sa-Dag0k-Z8.mjs"), "./translations/sk.json": () => import("./sk-BFg-R8qJ.mjs"), "./translations/sv.json": () => import("./sv-CUnfWGsh.mjs"), "./translations/th.json": () => import("./th-BqbI8lIT.mjs"), "./translations/tr.json": () => import("./tr-CgeK3wJM.mjs"), "./translations/uk.json": () => import("./uk-CR-zDhAY.mjs"), "./translations/vi.json": () => import("./vi-DUXIk_fw.mjs"), "./translations/zh-Hans.json": () => import("./zh-Hans-BPQcRIyH.mjs"), "./translations/zh.json": () => import("./zh-BWZspA60.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
|
3700
3901
|
return {
|
3701
3902
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
3702
3903
|
locale
|
@@ -3717,14 +3918,13 @@ export {
|
|
3717
3918
|
BulkActionsRenderer as B,
|
3718
3919
|
COLLECTION_TYPES as C,
|
3719
3920
|
DocumentStatus as D,
|
3720
|
-
|
3721
|
-
|
3722
|
-
|
3921
|
+
DEFAULT_SETTINGS as E,
|
3922
|
+
convertEditLayoutToFieldLayouts as F,
|
3923
|
+
useDocument as G,
|
3723
3924
|
HOOKS as H,
|
3724
3925
|
InjectionZone as I,
|
3725
|
-
|
3726
|
-
|
3727
|
-
useDocumentActions as L,
|
3926
|
+
index as J,
|
3927
|
+
useDocumentActions as K,
|
3728
3928
|
Panels as P,
|
3729
3929
|
RelativeTime as R,
|
3730
3930
|
SINGLE_TYPES as S,
|
@@ -3746,14 +3946,14 @@ export {
|
|
3746
3946
|
useGetContentTypeConfigurationQuery as o,
|
3747
3947
|
CREATOR_FIELDS as p,
|
3748
3948
|
getMainField as q,
|
3749
|
-
|
3949
|
+
getDisplayName as r,
|
3750
3950
|
setInitialData as s,
|
3751
|
-
|
3951
|
+
checkIfAttributeIsDisplayable as t,
|
3752
3952
|
useContentTypeSchema as u,
|
3753
|
-
|
3754
|
-
|
3755
|
-
|
3756
|
-
|
3757
|
-
|
3953
|
+
useGetAllDocumentsQuery as v,
|
3954
|
+
convertListLayoutToFieldLayouts as w,
|
3955
|
+
capitalise as x,
|
3956
|
+
useUpdateContentTypeConfigurationMutation as y,
|
3957
|
+
extractContentTypeComponents as z
|
3758
3958
|
};
|
3759
|
-
//# sourceMappingURL=index-
|
3959
|
+
//# sourceMappingURL=index-C9TJPyni.mjs.map
|