@strapi/content-manager 0.0.0-experimental.f2351bcfa3965c60f063a492da51faa2c636eee8 → 0.0.0-experimental.f49f46a1c17445a39e8af3f63124bcccf73842e6
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-BlAzljQ6.js → ComponentConfigurationPage-ClKl_TA2.js} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-BlAzljQ6.js.map → ComponentConfigurationPage-ClKl_TA2.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-Ccwb19Qj.mjs → ComponentConfigurationPage-D3ZWDAHG.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-Ccwb19Qj.mjs.map → ComponentConfigurationPage-D3ZWDAHG.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-C19b_9RL.mjs → EditConfigurationPage-BYCBSJxP.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-C19b_9RL.mjs.map → EditConfigurationPage-BYCBSJxP.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BPoOzhCM.js → EditConfigurationPage-OWez0Kxp.js} +4 -4
- package/dist/_chunks/{EditConfigurationPage-BPoOzhCM.js.map → EditConfigurationPage-OWez0Kxp.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-nmrHNiJ9.mjs → EditViewPage-5pdbvsO_.mjs} +50 -10
- package/dist/_chunks/EditViewPage-5pdbvsO_.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-D9xH8HYD.js → EditViewPage-BEs5iGDi.js} +49 -9
- package/dist/_chunks/EditViewPage-BEs5iGDi.js.map +1 -0
- package/dist/_chunks/{Field-BB_pHo6D.js → Field-DNHm4wHx.js} +107 -44
- package/dist/_chunks/Field-DNHm4wHx.js.map +1 -0
- package/dist/_chunks/{Field--kmlJuSb.mjs → Field-DcKuFHYK.mjs} +107 -44
- package/dist/_chunks/Field-DcKuFHYK.mjs.map +1 -0
- package/dist/_chunks/{Form-CUtOiC4S.mjs → Form-CGwM_-5c.mjs} +3 -3
- package/dist/_chunks/Form-CGwM_-5c.mjs.map +1 -0
- package/dist/_chunks/{Form-iwbkoaAF.js → Form-CoRxWJOz.js} +3 -3
- package/dist/_chunks/Form-CoRxWJOz.js.map +1 -0
- package/dist/_chunks/{History-guuZF4lR.js → History-BcUTQrfG.js} +40 -97
- package/dist/_chunks/History-BcUTQrfG.js.map +1 -0
- package/dist/_chunks/{History-BKR3KyU3.mjs → History-DEvr3Q_V.mjs} +42 -99
- package/dist/_chunks/History-DEvr3Q_V.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-Cu26t5sE.js → ListConfigurationPage-BE_Ho7tV.js} +5 -4
- package/dist/_chunks/ListConfigurationPage-BE_Ho7tV.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-B_O3hiLT.mjs → ListConfigurationPage-BM4zZZcM.mjs} +6 -5
- package/dist/_chunks/ListConfigurationPage-BM4zZZcM.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-B4sTBfu6.mjs → ListViewPage-BK2mkrql.mjs} +29 -7
- package/dist/_chunks/{ListViewPage-B4sTBfu6.mjs.map → ListViewPage-BK2mkrql.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-DWqqGno8.js → ListViewPage-BkT8Eao0.js} +29 -7
- package/dist/_chunks/ListViewPage-BkT8Eao0.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Daktt4t9.mjs → NoContentTypePage-BvcAutu9.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-Daktt4t9.mjs.map → NoContentTypePage-BvcAutu9.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-TTkwA8uk.js → NoContentTypePage-C8mtyc4H.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-TTkwA8uk.js.map → NoContentTypePage-C8mtyc4H.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-D8_k39Q0.js → NoPermissionsPage-B5Y9Y78B.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-D8_k39Q0.js.map → NoPermissionsPage-B5Y9Y78B.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-CBUXY2Pt.mjs → NoPermissionsPage-BmbRz7PR.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-CBUXY2Pt.mjs.map → NoPermissionsPage-BmbRz7PR.mjs.map} +1 -1
- package/dist/_chunks/Preview-BF8ZDYqS.js +286 -0
- package/dist/_chunks/Preview-BF8ZDYqS.js.map +1 -0
- package/dist/_chunks/Preview-DcexhKJE.mjs +267 -0
- package/dist/_chunks/Preview-DcexhKJE.mjs.map +1 -0
- package/dist/_chunks/{Relations-DjvmZ_XQ.js → Relations-BKnoK1R0.js} +71 -35
- package/dist/_chunks/Relations-BKnoK1R0.js.map +1 -0
- package/dist/_chunks/{Relations-HKmXF7eO.mjs → Relations-BjIzc4EK.mjs} +72 -36
- package/dist/_chunks/Relations-BjIzc4EK.mjs.map +1 -0
- package/dist/_chunks/{en-CPTj6CjC.mjs → en-CfIXaZf9.mjs} +21 -10
- package/dist/_chunks/{en-CPTj6CjC.mjs.map → en-CfIXaZf9.mjs.map} +1 -1
- package/dist/_chunks/{en-BVzUkPxZ.js → en-DTWPCdTS.js} +21 -10
- package/dist/_chunks/{en-BVzUkPxZ.js.map → en-DTWPCdTS.js.map} +1 -1
- package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
- package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
- package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
- package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
- package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
- package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
- package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
- package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
- package/dist/_chunks/{index-CB1AN26E.mjs → index-BW-rXkjn.mjs} +882 -721
- package/dist/_chunks/index-BW-rXkjn.mjs.map +1 -0
- package/dist/_chunks/{index-jDJgW_Lf.js → index-DOzAG2cq.js} +879 -717
- package/dist/_chunks/index-DOzAG2cq.js.map +1 -0
- package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
- package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
- package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
- package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
- package/dist/_chunks/{layout-BCzDsMgN.mjs → layout-DFVbgjp2.mjs} +3 -3
- package/dist/_chunks/{layout-BCzDsMgN.mjs.map → layout-DFVbgjp2.mjs.map} +1 -1
- package/dist/_chunks/{layout-D6A3K-ut.js → layout-RC3W2obV.js} +3 -3
- package/dist/_chunks/{layout-D6A3K-ut.js.map → layout-RC3W2obV.js.map} +1 -1
- package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
- package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
- package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
- package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
- package/dist/_chunks/{relations-B5Jnw32V.mjs → relations-Dogh8HWI.mjs} +6 -7
- package/dist/_chunks/relations-Dogh8HWI.mjs.map +1 -0
- package/dist/_chunks/{relations-C10QoukP.js → relations-zam7-5H7.js} +6 -7
- package/dist/_chunks/relations-zam7-5H7.js.map +1 -0
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +4 -3
- package/dist/admin/src/exports.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +32 -1
- package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
- package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/Header.d.ts +1 -0
- package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
- package/dist/admin/src/preview/constants.d.ts +1 -0
- package/dist/admin/src/preview/index.d.ts +4 -0
- package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
- package/dist/admin/src/preview/routes.d.ts +3 -0
- package/dist/admin/src/preview/services/preview.d.ts +3 -0
- package/dist/admin/src/router.d.ts +1 -1
- package/dist/server/index.js +374 -160
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +374 -160
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
- package/dist/server/src/history/services/history.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 +2 -3
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +4 -4
- package/dist/server/src/preview/constants.d.ts +2 -0
- package/dist/server/src/preview/constants.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/index.d.ts +2 -0
- package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/preview.d.ts +13 -0
- package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
- package/dist/server/src/preview/index.d.ts +4 -0
- package/dist/server/src/preview/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/index.d.ts +8 -0
- package/dist/server/src/preview/routes/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/preview.d.ts +4 -0
- package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
- package/dist/server/src/preview/services/index.d.ts +15 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview-config.d.ts +30 -0
- package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview.d.ts +12 -0
- package/dist/server/src/preview/services/preview.d.ts.map +1 -0
- package/dist/server/src/preview/utils.d.ts +18 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -0
- package/dist/server/src/routes/index.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 +8 -8
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +4 -4
- 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/utils/index.d.ts +2 -0
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/index.d.ts +1 -0
- package/dist/shared/contracts/index.d.ts.map +1 -1
- package/dist/shared/contracts/preview.d.ts +27 -0
- package/dist/shared/contracts/preview.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs +4 -0
- package/dist/shared/index.mjs.map +1 -1
- package/package.json +13 -13
- package/dist/_chunks/EditViewPage-D9xH8HYD.js.map +0 -1
- package/dist/_chunks/EditViewPage-nmrHNiJ9.mjs.map +0 -1
- package/dist/_chunks/Field--kmlJuSb.mjs.map +0 -1
- package/dist/_chunks/Field-BB_pHo6D.js.map +0 -1
- package/dist/_chunks/Form-CUtOiC4S.mjs.map +0 -1
- package/dist/_chunks/Form-iwbkoaAF.js.map +0 -1
- package/dist/_chunks/History-BKR3KyU3.mjs.map +0 -1
- package/dist/_chunks/History-guuZF4lR.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-B_O3hiLT.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-Cu26t5sE.js.map +0 -1
- package/dist/_chunks/ListViewPage-DWqqGno8.js.map +0 -1
- package/dist/_chunks/Relations-DjvmZ_XQ.js.map +0 -1
- package/dist/_chunks/Relations-HKmXF7eO.mjs.map +0 -1
- package/dist/_chunks/index-CB1AN26E.mjs.map +0 -1
- package/dist/_chunks/index-jDJgW_Lf.js.map +0 -1
- package/dist/_chunks/relations-B5Jnw32V.mjs.map +0 -1
- package/dist/_chunks/relations-C10QoukP.js.map +0 -1
- package/strapi-server.js +0 -3
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
const fractionalIndexing = require("fractional-indexing");
|
3
|
-
const index = require("./index-
|
3
|
+
const index = require("./index-DOzAG2cq.js");
|
4
4
|
const relationsApi = index.contentManagerApi.injectEndpoints({
|
5
5
|
endpoints: (build) => ({
|
6
6
|
getRelations: build.query({
|
@@ -27,11 +27,10 @@ const relationsApi = index.contentManagerApi.injectEndpoints({
|
|
27
27
|
merge: (currentCache, newItems) => {
|
28
28
|
if (currentCache.pagination && newItems.pagination) {
|
29
29
|
if (currentCache.pagination.page < newItems.pagination.page) {
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
currentCache.results.push(...prepareTempKeys(uniqueNewItems, currentCache.results));
|
30
|
+
currentCache.results = [
|
31
|
+
...prepareTempKeys(newItems.results, currentCache.results),
|
32
|
+
...currentCache.results
|
33
|
+
];
|
35
34
|
currentCache.pagination = newItems.pagination;
|
36
35
|
} else if (newItems.pagination.page === 1) {
|
37
36
|
currentCache.results = prepareTempKeys(newItems.results);
|
@@ -131,4 +130,4 @@ const getRelationLabel = (relation, mainField) => {
|
|
131
130
|
exports.getRelationLabel = getRelationLabel;
|
132
131
|
exports.useGetRelationsQuery = useGetRelationsQuery;
|
133
132
|
exports.useLazySearchRelationsQuery = useLazySearchRelationsQuery;
|
134
|
-
//# sourceMappingURL=relations-
|
133
|
+
//# sourceMappingURL=relations-zam7-5H7.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"relations-zam7-5H7.js","sources":["../../admin/src/services/relations.ts","../../admin/src/utils/relations.ts"],"sourcesContent":["import { generateNKeysBetween } from 'fractional-indexing';\n\nimport {\n RelationResult as RelResult,\n FindAvailable,\n FindExisting,\n} from '../../../shared/contracts/relations';\n\nimport { contentManagerApi } from './api';\n\nimport type { Modules } from '@strapi/types';\nimport type { errors } from '@strapi/utils';\n\ninterface RelationResult extends RelResult {\n __temp_key__: string;\n}\n\ntype GetRelationsResponse =\n | {\n results: Array<RelationResult>;\n pagination: {\n page: NonNullable<Modules.EntityService.Params.Pagination.PageNotation['page']>;\n pageSize: NonNullable<Modules.EntityService.Params.Pagination.PageNotation['pageSize']>;\n pageCount: number;\n total: number;\n } | null;\n error?: never;\n }\n | {\n results?: never;\n pagination?: never;\n error: errors.ApplicationError | errors.YupValidationError;\n };\n\nconst relationsApi = contentManagerApi.injectEndpoints({\n endpoints: (build) => ({\n getRelations: build.query<\n GetRelationsResponse,\n FindExisting.Params & {\n params?: FindExisting.Request['query'];\n }\n >({\n query: ({ model, id, targetField, params }) => {\n return {\n url: `/content-manager/relations/${model}/${id}/${targetField}`,\n method: 'GET',\n config: {\n params,\n },\n };\n },\n serializeQueryArgs: (args) => {\n const { endpointName, queryArgs } = args;\n return {\n endpointName,\n model: queryArgs.model,\n id: queryArgs.id,\n targetField: queryArgs.targetField,\n locale: queryArgs.params?.locale,\n status: queryArgs.params?.status,\n };\n },\n merge: (currentCache, newItems) => {\n if (currentCache.pagination && newItems.pagination) {\n if (currentCache.pagination.page < newItems.pagination.page) {\n /**\n * Relations will always have unique IDs, so we can therefore assume\n * that we only need to push the new items to the cache.\n *\n * Push new items at the beginning as latest items are shown first\n */\n currentCache.results = [\n ...prepareTempKeys(newItems.results, currentCache.results),\n ...currentCache.results,\n ];\n currentCache.pagination = newItems.pagination;\n } else if (newItems.pagination.page === 1) {\n /**\n * We're resetting the relations\n */\n currentCache.results = prepareTempKeys(newItems.results);\n currentCache.pagination = newItems.pagination;\n }\n }\n },\n forceRefetch({ currentArg, previousArg }) {\n if (!currentArg?.params && !previousArg?.params) {\n return false;\n }\n\n return (\n currentArg?.params?.page !== previousArg?.params?.page ||\n currentArg?.params?.pageSize !== previousArg?.params?.pageSize\n );\n },\n transformResponse: (response: FindExisting.Response) => {\n if ('results' in response && response.results) {\n return {\n ...response,\n results: prepareTempKeys(response.results.toReversed()),\n };\n } else {\n return response;\n }\n },\n providesTags: ['Relations'],\n }),\n searchRelations: build.query<\n FindAvailable.Response,\n FindAvailable.Params & {\n params?: FindAvailable.Request['query'];\n }\n >({\n query: ({ model, targetField, params }) => {\n return {\n url: `/content-manager/relations/${model}/${targetField}`,\n method: 'GET',\n config: {\n params,\n },\n };\n },\n serializeQueryArgs: (args) => {\n const { endpointName, queryArgs } = args;\n return {\n endpointName,\n model: queryArgs.model,\n targetField: queryArgs.targetField,\n _q: queryArgs.params?._q,\n idsToOmit: queryArgs.params?.idsToOmit,\n idsToInclude: queryArgs.params?.idsToInclude,\n };\n },\n merge: (currentCache, newItems) => {\n if (currentCache.pagination && newItems.pagination) {\n if (currentCache.pagination.page < newItems.pagination.page) {\n /**\n * Relations will always have unique IDs, so we can therefore assume\n * that we only need to push the new items to the cache.\n */\n const existingIds = currentCache.results.map((item) => item.documentId);\n const uniqueNewItems = newItems.results.filter(\n (item) => !existingIds.includes(item.documentId)\n );\n currentCache.results.push(...uniqueNewItems);\n currentCache.pagination = newItems.pagination;\n } else if (newItems.pagination.page === 1) {\n /**\n * We're resetting the relations\n */\n currentCache.results = newItems.results;\n currentCache.pagination = newItems.pagination;\n }\n }\n },\n forceRefetch({ currentArg, previousArg }) {\n if (!currentArg?.params && !previousArg?.params) {\n return false;\n }\n\n return (\n currentArg?.params?.page !== previousArg?.params?.page ||\n currentArg?.params?.pageSize !== previousArg?.params?.pageSize\n );\n },\n transformResponse: (response: FindAvailable.Response) => {\n if (response.results) {\n return {\n ...response,\n results: response.results,\n };\n } else {\n return response;\n }\n },\n }),\n }),\n});\n\n/**\n * @internal\n * @description Adds a `__temp_key__` to each relation item. This gives us\n * a stable identifier regardless of it's ids etc. that we can then use for drag and drop.\n */\nconst prepareTempKeys = (relations: RelResult[], existingRelations: RelationResult[] = []) => {\n const [firstItem] = existingRelations.slice(0);\n const keys = generateNKeysBetween(null, firstItem?.__temp_key__ ?? null, relations.length);\n\n return relations.map((datum, index) => ({\n ...datum,\n __temp_key__: keys[index],\n }));\n};\n\nconst { useGetRelationsQuery, useLazySearchRelationsQuery } = relationsApi;\n\nexport { useGetRelationsQuery, useLazySearchRelationsQuery };\nexport type { RelationResult };\n","import type { MainField } from './attributes';\nimport type { RelationResult } from '../../../shared/contracts/relations';\n\n/**\n * @internal\n * @description Get the label of a relation, the contract has [key: string]: unknown,\n * so we need to check if the mainFieldKey is defined and if the relation has a value\n * under that property. If it does, we then verify it's type of string and return it.\n *\n * We fallback to the documentId.\n */\nconst getRelationLabel = (relation: RelationResult, mainField?: MainField): string => {\n const label = mainField && relation[mainField.name] ? relation[mainField.name] : null;\n\n if (typeof label === 'string') {\n return label;\n }\n\n return relation.documentId;\n};\n\nexport { getRelationLabel };\n"],"names":["contentManagerApi","generateNKeysBetween","index"],"mappings":";;;AAkCA,MAAM,eAAeA,wBAAkB,gBAAgB;AAAA,EACrD,WAAW,CAAC,WAAW;AAAA,IACrB,cAAc,MAAM,MAKlB;AAAA,MACA,OAAO,CAAC,EAAE,OAAO,IAAI,aAAa,aAAa;AACtC,eAAA;AAAA,UACL,KAAK,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AA,YACL,GAAG;AAAA,YACH,SAAS,SAAS;AAAA,UAAA;AAAA,QACpB,OACK;AACE,iBAAA;AAAA,QACT;AAAA,MACF;AAAA,IAAA,CACD;AAAA,EAAA;AAEL,CAAC;AAOD,MAAM,kBAAkB,CAAC,WAAwB,oBAAsC,OAAO;AAC5F,QAAM,CAAC,SAAS,IAAI,kBAAkB,MAAM,CAAC;AAC7C,QAAM,OAAOC,mBAAqB,qBAAA,MAAM,WAAW,gBAAgB,MAAM,UAAU,MAAM;AAEzF,SAAO,UAAU,IAAI,CAAC,OAAOC,YAAW;AAAA,IACtC,GAAG;AAAA,IACH,cAAc,KAAKA,MAAK;AAAA,EACxB,EAAA;AACJ;AAEM,MAAA,EAAE,sBAAsB,gCAAgC;ACvLxD,MAAA,mBAAmB,CAAC,UAA0B,cAAkC;AAC9E,QAAA,QAAQ,aAAa,SAAS,UAAU,IAAI,IAAI,SAAS,UAAU,IAAI,IAAI;AAE7E,MAAA,OAAO,UAAU,UAAU;AACtB,WAAA;AAAA,EACT;AAEA,SAAO,SAAS;AAClB;;;;"}
|
package/dist/admin/index.js
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
3
|
-
const index = require("../_chunks/index-
|
3
|
+
const index = require("../_chunks/index-DOzAG2cq.js");
|
4
4
|
require("@strapi/icons");
|
5
5
|
exports.DocumentRBAC = index.DocumentRBAC;
|
6
6
|
exports.buildValidParams = index.buildValidParams;
|
7
7
|
exports.default = index.index;
|
8
|
+
exports.unstable_useContentManagerContext = index.useContentManagerContext;
|
8
9
|
exports.unstable_useDocument = index.useDocument;
|
9
10
|
exports.unstable_useDocumentActions = index.useDocumentActions;
|
10
11
|
exports.unstable_useDocumentLayout = index.useDocumentLayout;
|
package/dist/admin/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
package/dist/admin/index.mjs
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
-
import { l, d,
|
1
|
+
import { l, d, L, M, J, N, h, f } from "../_chunks/index-BW-rXkjn.mjs";
|
2
2
|
import "@strapi/icons";
|
3
3
|
export {
|
4
4
|
l as DocumentRBAC,
|
5
5
|
d as buildValidParams,
|
6
|
-
|
6
|
+
L as default,
|
7
|
+
M as unstable_useContentManagerContext,
|
7
8
|
J as unstable_useDocument,
|
8
|
-
|
9
|
+
N as unstable_useDocumentActions,
|
9
10
|
h as unstable_useDocumentLayout,
|
10
11
|
f as useDocumentRBAC
|
11
12
|
};
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* but should still export the same things.
|
5
5
|
*/
|
6
6
|
export { buildValidParams } from './utils/api';
|
7
|
-
export { useDocument as unstable_useDocument } from './hooks/useDocument';
|
7
|
+
export { useDocument as unstable_useDocument, useContentManagerContext as unstable_useContentManagerContext, } from './hooks/useDocument';
|
8
8
|
export { useDocumentActions as unstable_useDocumentActions } from './hooks/useDocumentActions';
|
9
9
|
export { useDocumentLayout as unstable_useDocumentLayout } from './hooks/useDocumentLayout';
|
10
10
|
export type { EditFieldLayout, EditLayout, ListFieldLayout, ListLayout, } from './hooks/useDocumentLayout';
|
@@ -31,7 +31,9 @@ type UseDocument = (args: UseDocumentArgs, opts?: UseDocumentOpts) => {
|
|
31
31
|
* This is the schema of the content type, it is not the same as the layout.
|
32
32
|
*/
|
33
33
|
schema?: Schema;
|
34
|
+
schemas?: Schema[];
|
34
35
|
validate: (document: Document) => null | FormErrors;
|
36
|
+
hasError?: boolean;
|
35
37
|
};
|
36
38
|
/**
|
37
39
|
* @alpha
|
@@ -78,10 +80,39 @@ declare const useDoc: () => {
|
|
78
80
|
* This is the schema of the content type, it is not the same as the layout.
|
79
81
|
*/
|
80
82
|
schema?: ContentType | undefined;
|
83
|
+
schemas?: ContentType[] | undefined;
|
81
84
|
validate: (document: Document) => null | FormErrors;
|
85
|
+
hasError?: boolean | undefined;
|
82
86
|
collectionType: string;
|
83
87
|
model: string;
|
84
88
|
id: string | undefined;
|
85
89
|
};
|
86
|
-
|
90
|
+
/**
|
91
|
+
* @public
|
92
|
+
* @experimental
|
93
|
+
* Content manager context hooks for plugin development.
|
94
|
+
* Make sure to use this hook inside the content manager.
|
95
|
+
*/
|
96
|
+
declare const useContentManagerContext: () => {
|
97
|
+
error: import("@reduxjs/toolkit").SerializedError | import("../utils/api").BaseQueryError | undefined;
|
98
|
+
isLoading: boolean;
|
99
|
+
model: string;
|
100
|
+
collectionType: string;
|
101
|
+
id: string | undefined;
|
102
|
+
slug: string;
|
103
|
+
isCreatingEntry: boolean;
|
104
|
+
isSingleType: boolean;
|
105
|
+
hasDraftAndPublish: boolean;
|
106
|
+
components: ComponentsDictionary;
|
107
|
+
contentType: ContentType | undefined;
|
108
|
+
contentTypes: ContentType[] | undefined;
|
109
|
+
form: import("@strapi/admin/strapi-admin").FormContextValue<import("@strapi/admin/strapi-admin").FormValues>;
|
110
|
+
layout: {
|
111
|
+
error?: import("@reduxjs/toolkit").SerializedError | import("../utils/api").BaseQueryError | undefined;
|
112
|
+
isLoading: boolean;
|
113
|
+
edit: import("./useDocumentLayout").EditLayout;
|
114
|
+
list: import("./useDocumentLayout").ListLayout;
|
115
|
+
};
|
116
|
+
};
|
117
|
+
export { useDocument, useDoc, useContentManagerContext };
|
87
118
|
export type { UseDocument, UseDocumentArgs, Document, Schema, ComponentsDictionary };
|
@@ -1,3 +1,11 @@
|
|
1
|
+
import { type UseDocument } from '../../hooks/useDocument';
|
1
2
|
declare const EditViewPage: () => import("react/jsx-runtime").JSX.Element;
|
3
|
+
/**
|
4
|
+
* @internal
|
5
|
+
* @description Returns the status of the document where its latest state takes priority,
|
6
|
+
* this typically will be "published" unless a user has edited their draft in which we should
|
7
|
+
* display "modified".
|
8
|
+
*/
|
9
|
+
declare const getDocumentStatus: (document: ReturnType<UseDocument>['document'], meta: ReturnType<UseDocument>['meta']) => 'draft' | 'published' | 'modified';
|
2
10
|
declare const ProtectedEditViewPage: () => import("react/jsx-runtime").JSX.Element;
|
3
|
-
export { EditViewPage, ProtectedEditViewPage };
|
11
|
+
export { EditViewPage, ProtectedEditViewPage, getDocumentStatus };
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { StatusProps } from '@strapi/design-system';
|
2
|
-
interface DocumentStatusProps extends Omit<StatusProps, 'children' | '
|
2
|
+
interface DocumentStatusProps extends Omit<StatusProps, 'children' | 'variant'> {
|
3
3
|
/**
|
4
4
|
* The status of the document (draft, published, etc.)
|
5
5
|
* @default 'draft'
|
@@ -11,6 +11,6 @@ interface DocumentStatusProps extends Omit<StatusProps, 'children' | 'showBullet
|
|
11
11
|
* @description Displays the status of a document (draft, published, etc.)
|
12
12
|
* and automatically calculates the appropriate variant for the status.
|
13
13
|
*/
|
14
|
-
declare const DocumentStatus: ({ status, ...restProps }: DocumentStatusProps) => import("react/jsx-runtime").JSX.Element;
|
14
|
+
declare const DocumentStatus: ({ status, size, ...restProps }: DocumentStatusProps) => import("react/jsx-runtime").JSX.Element;
|
15
15
|
export { DocumentStatus };
|
16
16
|
export type { DocumentStatusProps };
|
@@ -28,6 +28,7 @@ interface HeaderActionDescription {
|
|
28
28
|
}>;
|
29
29
|
onSelect?: (value: string) => void;
|
30
30
|
value?: string;
|
31
|
+
customizeContent?: (value: string) => React.ReactNode;
|
31
32
|
}
|
32
33
|
declare const DEFAULT_HEADER_ACTIONS: DocumentActionComponent[];
|
33
34
|
export { Header, DEFAULT_HEADER_ACTIONS };
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const FEATURE_ID = "preview";
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { type UseDocument } from '../../hooks/useDocument';
|
2
|
+
interface PreviewContextValue {
|
3
|
+
url: string;
|
4
|
+
mainField: string;
|
5
|
+
document: NonNullable<ReturnType<UseDocument>['document']>;
|
6
|
+
meta: NonNullable<ReturnType<UseDocument>['meta']>;
|
7
|
+
schema: NonNullable<ReturnType<UseDocument>['schema']>;
|
8
|
+
}
|
9
|
+
declare const usePreviewContext: <Selected>(consumerName: string, selector: (value: PreviewContextValue) => Selected) => Selected;
|
10
|
+
declare const ProtectedPreviewPage: () => import("react/jsx-runtime").JSX.Element;
|
11
|
+
export { ProtectedPreviewPage, usePreviewContext };
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { GetPreviewUrl } from '../../../../shared/contracts/preview';
|
2
|
+
declare const useGetPreviewUrlQuery: import("@reduxjs/toolkit/dist/query/react/buildHooks").UseQuery<import("@reduxjs/toolkit/query").QueryDefinition<GetPreviewUrl.Request, import("@reduxjs/toolkit/query").BaseQueryFn<string | import("@strapi/admin/strapi-admin").QueryArguments, unknown, import("@strapi/admin/strapi-admin").BaseQueryError, {}, {}>, "ComponentConfiguration" | "ContentTypesConfiguration" | "ContentTypeSettings" | "Document" | "InitialData" | "HistoryVersion" | "Relations" | "UidAvailability", GetPreviewUrl.Response, "adminApi">>;
|
3
|
+
export { useGetPreviewUrlQuery };
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { PathRouteProps } from 'react-router-dom';
|
2
2
|
declare const CLONE_PATH = "/content-manager/:collectionType/:slug/clone/:origin";
|
3
|
-
declare const LIST_PATH = "/content-manager/:
|
3
|
+
declare const LIST_PATH = "/content-manager/collection-types/:slug";
|
4
4
|
declare const routes: PathRouteProps[];
|
5
5
|
export { routes, CLONE_PATH, LIST_PATH };
|