@strapi/content-manager 0.0.0-experimental.d1602f22dc638a4c3c5084965fd6126fff5e9d4f → 0.0.0-experimental.d2a56e52af31fcf0f0c582a5a2e58e310966e96b
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/admin/chunks/{CardDragPreview-DwuraT0K.js → CardDragPreview-DwuraT0K.mjs} +1 -1
- package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs.map +1 -0
- package/dist/admin/chunks/{ComponentConfigurationPage-DXwOtpq1.js → ComponentConfigurationPage-CGn9IYeg.js} +6 -6
- package/dist/admin/chunks/{ComponentConfigurationPage-DXwOtpq1.js.map → ComponentConfigurationPage-CGn9IYeg.js.map} +1 -1
- package/dist/admin/chunks/{ComponentConfigurationPage-DhYZp4nN.js → ComponentConfigurationPage-DgYK4xW6.mjs} +9 -9
- package/dist/admin/chunks/ComponentConfigurationPage-DgYK4xW6.mjs.map +1 -0
- package/dist/admin/chunks/{ComponentIcon-BZcTc4rj.js → ComponentIcon-BZcTc4rj.mjs} +1 -1
- package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs.map +1 -0
- package/dist/admin/chunks/{EditConfigurationPage-D0Ng758X.js → EditConfigurationPage-7w_-4jF4.js} +6 -6
- package/dist/admin/chunks/{EditConfigurationPage-D0Ng758X.js.map → EditConfigurationPage-7w_-4jF4.js.map} +1 -1
- package/dist/admin/chunks/{EditConfigurationPage-DDuPch5d.js → EditConfigurationPage-C05SwwH-.mjs} +9 -9
- package/dist/admin/chunks/EditConfigurationPage-C05SwwH-.mjs.map +1 -0
- package/dist/admin/chunks/EditViewPage-CVRJBOEv.mjs +318 -0
- package/dist/admin/chunks/EditViewPage-CVRJBOEv.mjs.map +1 -0
- package/dist/admin/chunks/EditViewPage-CuQfZJDf.js +341 -0
- package/dist/admin/chunks/EditViewPage-CuQfZJDf.js.map +1 -0
- package/dist/admin/chunks/{FieldTypeIcon-BY6MrVF4.js → FieldTypeIcon-BY6MrVF4.mjs} +1 -1
- package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs.map +1 -0
- package/dist/admin/chunks/{Form-BEqiuSvQ.js → Form-BqNYRsCb.js} +5 -5
- package/dist/admin/chunks/{Form-BEqiuSvQ.js.map → Form-BqNYRsCb.js.map} +1 -1
- package/dist/admin/chunks/{Form-CZmB6JIg.js → Form-DaEnqAeV.mjs} +5 -5
- package/dist/admin/chunks/Form-DaEnqAeV.mjs.map +1 -0
- package/dist/admin/chunks/{History-CPYXgxkS.js → History-B7dGNfmx.mjs} +68 -15
- package/dist/admin/chunks/History-B7dGNfmx.mjs.map +1 -0
- package/dist/admin/chunks/{History-BlLKDZSw.js → History-CEoOna4w.js} +67 -14
- package/dist/admin/chunks/History-CEoOna4w.js.map +1 -0
- package/dist/admin/chunks/{Input-CLX3C5DI.js → Input-B3QUS9rv.mjs} +2273 -511
- package/dist/admin/chunks/Input-B3QUS9rv.mjs.map +1 -0
- package/dist/admin/chunks/{Input-DiR2Xfa7.js → Input-B8I0b9aD.js} +2284 -519
- package/dist/admin/chunks/Input-B8I0b9aD.js.map +1 -0
- package/dist/admin/chunks/{ListConfigurationPage-DdTp-HxB.js → ListConfigurationPage-BbjJweN-.js} +7 -7
- package/dist/admin/chunks/{ListConfigurationPage-DdTp-HxB.js.map → ListConfigurationPage-BbjJweN-.js.map} +1 -1
- package/dist/admin/chunks/{ListConfigurationPage-CNvotSqe.js → ListConfigurationPage-VtFQ5mOK.mjs} +8 -8
- package/dist/admin/chunks/ListConfigurationPage-VtFQ5mOK.mjs.map +1 -0
- package/dist/admin/chunks/{ListViewPage-MJNfQTp-.js → ListViewPage-Cg3zbT7Y.mjs} +5 -5
- package/dist/admin/chunks/ListViewPage-Cg3zbT7Y.mjs.map +1 -0
- package/dist/admin/chunks/{ListViewPage-BtXYjEYz.js → ListViewPage-CzUm2VJN.js} +8 -8
- package/dist/admin/chunks/{ListViewPage-BtXYjEYz.js.map → ListViewPage-CzUm2VJN.js.map} +1 -1
- package/dist/admin/chunks/{NoContentTypePage-CVvVpwj4.js → NoContentTypePage-FcLLn2Wt.js} +3 -2
- package/dist/admin/chunks/{NoContentTypePage-BJrZvYPY.js.map → NoContentTypePage-FcLLn2Wt.js.map} +1 -1
- package/dist/admin/chunks/{NoContentTypePage-BJrZvYPY.js → NoContentTypePage-NOf7Aq_E.mjs} +3 -2
- package/dist/admin/chunks/NoContentTypePage-NOf7Aq_E.mjs.map +1 -0
- package/dist/admin/chunks/{NoPermissionsPage-C5yWg70d.js → NoPermissionsPage-DmeyXtCk.js} +3 -2
- package/dist/admin/chunks/{NoPermissionsPage-BulvG4hB.js.map → NoPermissionsPage-DmeyXtCk.js.map} +1 -1
- package/dist/admin/chunks/{NoPermissionsPage-BulvG4hB.js → NoPermissionsPage-OVr9KG6L.mjs} +3 -2
- package/dist/admin/chunks/NoPermissionsPage-OVr9KG6L.mjs.map +1 -0
- package/dist/admin/chunks/Preview-BH9l1QXk.mjs +593 -0
- package/dist/admin/chunks/Preview-BH9l1QXk.mjs.map +1 -0
- package/dist/admin/chunks/Preview-BYKkpc11.js +615 -0
- package/dist/admin/chunks/Preview-BYKkpc11.js.map +1 -0
- package/dist/admin/chunks/{ar-DckYq_WK.js → ar-DckYq_WK.mjs} +1 -1
- package/dist/admin/chunks/ar-DckYq_WK.mjs.map +1 -0
- package/dist/admin/chunks/{ca-DviY7mRj.js → ca-DviY7mRj.mjs} +1 -1
- package/dist/admin/chunks/ca-DviY7mRj.mjs.map +1 -0
- package/dist/admin/chunks/{cs-C7OSYFQ7.js → cs-C7OSYFQ7.mjs} +1 -1
- package/dist/admin/chunks/cs-C7OSYFQ7.mjs.map +1 -0
- package/dist/admin/chunks/{de-5QRlDHyR.js → de-5QRlDHyR.mjs} +1 -1
- package/dist/admin/chunks/de-5QRlDHyR.mjs.map +1 -0
- package/dist/admin/chunks/{en-LfhocNG2.js → en-C2zEwS3-.mjs} +6 -1
- package/dist/admin/chunks/en-C2zEwS3-.mjs.map +1 -0
- package/dist/admin/chunks/{en-C1CjdAtC.js → en-G976DLsg.js} +6 -1
- package/dist/admin/chunks/{en-LfhocNG2.js.map → en-G976DLsg.js.map} +1 -1
- package/dist/admin/chunks/{es-DkoWSExG.js → es-DkoWSExG.mjs} +1 -1
- package/dist/admin/chunks/es-DkoWSExG.mjs.map +1 -0
- package/dist/admin/chunks/{eu-BG1xX7HK.js → eu-BG1xX7HK.mjs} +1 -1
- package/dist/admin/chunks/eu-BG1xX7HK.mjs.map +1 -0
- package/dist/admin/chunks/{fr-CFdRaRVj.js → fr-CFdRaRVj.mjs} +1 -1
- package/dist/admin/chunks/fr-CFdRaRVj.mjs.map +1 -0
- package/dist/admin/chunks/{gu-D5MMMXRs.js → gu-D5MMMXRs.mjs} +1 -1
- package/dist/admin/chunks/gu-D5MMMXRs.mjs.map +1 -0
- package/dist/admin/chunks/{hi-lp17SCjr.js → hi-lp17SCjr.mjs} +1 -1
- package/dist/admin/chunks/hi-lp17SCjr.mjs.map +1 -0
- package/dist/admin/chunks/{hooks-DMvik5y_.js → hooks-DMvik5y_.mjs} +1 -1
- package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +1 -0
- package/dist/admin/chunks/{hu-CLka1U2C.js → hu-CLka1U2C.mjs} +1 -1
- package/dist/admin/chunks/hu-CLka1U2C.mjs.map +1 -0
- package/dist/admin/chunks/{id-USfY9m1g.js → id-USfY9m1g.mjs} +1 -1
- package/dist/admin/chunks/id-USfY9m1g.mjs.map +1 -0
- package/dist/admin/chunks/{index-BRlRBRLb.js → index-BE7PI9Wp.mjs} +273 -173
- package/dist/admin/chunks/index-BE7PI9Wp.mjs.map +1 -0
- package/dist/admin/chunks/{index-ZIwOPk6p.js → index-BwIhYBsG.js} +246 -142
- package/dist/admin/chunks/index-BwIhYBsG.js.map +1 -0
- package/dist/admin/chunks/{it-BAHrwmYS.js → it-BAHrwmYS.mjs} +1 -1
- package/dist/admin/chunks/it-BAHrwmYS.mjs.map +1 -0
- package/dist/admin/chunks/{ja-BWKmBJFT.js → ja-BWKmBJFT.mjs} +1 -1
- package/dist/admin/chunks/ja-BWKmBJFT.mjs.map +1 -0
- package/dist/admin/chunks/{ko-CgADGBNt.js → ko-CgADGBNt.mjs} +1 -1
- package/dist/admin/chunks/ko-CgADGBNt.mjs.map +1 -0
- package/dist/admin/chunks/{layout-B3-guCPG.js → layout-9zlUM9V3.mjs} +81 -7
- package/dist/admin/chunks/layout-9zlUM9V3.mjs.map +1 -0
- package/dist/admin/chunks/{layout-ameRNiAM.js → layout-Cr0HaJVS.js} +87 -13
- package/dist/admin/chunks/layout-Cr0HaJVS.js.map +1 -0
- package/dist/admin/chunks/{ml-CnhCfOn_.js → ml-CnhCfOn_.mjs} +1 -1
- package/dist/admin/chunks/ml-CnhCfOn_.mjs.map +1 -0
- package/dist/admin/chunks/{ms-Bh09NFff.js → ms-Bh09NFff.mjs} +1 -1
- package/dist/admin/chunks/ms-Bh09NFff.mjs.map +1 -0
- package/dist/admin/chunks/{nl-C8HYflTc.js → nl-C8HYflTc.mjs} +1 -1
- package/dist/admin/chunks/nl-C8HYflTc.mjs.map +1 -0
- package/dist/admin/chunks/{useDragAndDrop-gcqEJMnO.js → objects-BJTP843m.js} +73 -1
- package/dist/admin/chunks/objects-BJTP843m.js.map +1 -0
- package/dist/admin/chunks/{useDragAndDrop-HYwNDExe.js → objects-D2z-IJgu.mjs} +72 -2
- package/dist/admin/chunks/objects-D2z-IJgu.mjs.map +1 -0
- package/dist/admin/chunks/{pl-MFCZJZuZ.js → pl-MFCZJZuZ.mjs} +1 -1
- package/dist/admin/chunks/pl-MFCZJZuZ.mjs.map +1 -0
- package/dist/admin/chunks/{pt-BR-CcotyBGJ.js → pt-BR-CcotyBGJ.mjs} +1 -1
- package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs.map +1 -0
- package/dist/admin/chunks/{pt-HbmgeiYO.js → pt-HbmgeiYO.mjs} +1 -1
- package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +1 -0
- package/dist/admin/chunks/{ru-CB4BUyQp.js → ru-CB4BUyQp.mjs} +1 -1
- package/dist/admin/chunks/{ru-CB4BUyQp.js.map → ru-CB4BUyQp.mjs.map} +1 -1
- package/dist/admin/chunks/{sa-n_aPA-pU.js → sa-n_aPA-pU.mjs} +1 -1
- package/dist/admin/chunks/sa-n_aPA-pU.mjs.map +1 -0
- package/dist/admin/chunks/{sk-tn_BDjE2.js → sk-tn_BDjE2.mjs} +1 -1
- package/dist/admin/chunks/sk-tn_BDjE2.mjs.map +1 -0
- package/dist/admin/chunks/{sv-cq4ZrQRd.js → sv-cq4ZrQRd.mjs} +1 -1
- package/dist/admin/chunks/sv-cq4ZrQRd.mjs.map +1 -0
- package/dist/admin/chunks/{th-mUH7hEtc.js → th-mUH7hEtc.mjs} +1 -1
- package/dist/admin/chunks/th-mUH7hEtc.mjs.map +1 -0
- package/dist/admin/chunks/{tr-Yt38daxh.js → tr-Yt38daxh.mjs} +1 -1
- package/dist/admin/chunks/tr-Yt38daxh.mjs.map +1 -0
- package/dist/admin/chunks/uk-BtM6WnaE.mjs +313 -0
- package/dist/admin/chunks/uk-BtM6WnaE.mjs.map +1 -0
- package/dist/admin/chunks/uk-DB6OgySY.js +318 -0
- package/dist/admin/chunks/{en-C1CjdAtC.js.map → uk-DB6OgySY.js.map} +1 -1
- package/dist/admin/chunks/{relations-CmoFVrKj.js → usePrev-DgZBp9Oo.js} +18 -2
- package/dist/admin/chunks/usePrev-DgZBp9Oo.js.map +1 -0
- package/dist/admin/chunks/{relations-DYQAaXwZ.js → usePrev-PisKKvhT.mjs} +18 -4
- package/dist/admin/chunks/usePrev-PisKKvhT.mjs.map +1 -0
- package/dist/admin/chunks/{vi-CvBGlTjr.js → vi-CvBGlTjr.mjs} +1 -1
- package/dist/admin/chunks/vi-CvBGlTjr.mjs.map +1 -0
- package/dist/admin/chunks/{zh-BmF-sHaT.js → zh-BmF-sHaT.mjs} +1 -1
- package/dist/admin/chunks/zh-BmF-sHaT.mjs.map +1 -0
- package/dist/admin/chunks/{zh-Hans-CI0HKio3.js → zh-Hans-CI0HKio3.mjs} +1 -1
- package/dist/admin/chunks/{zh-Hans-CI0HKio3.js.map → zh-Hans-CI0HKio3.mjs.map} +1 -1
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +2 -1
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/src/components/InjectionZone.d.ts +7 -1
- package/dist/admin/src/content-manager.d.ts +4 -0
- package/dist/admin/src/features/DocumentContext.d.ts +53 -0
- package/dist/admin/src/features/DocumentRBAC.d.ts +3 -2
- package/dist/admin/src/hooks/useDocument.d.ts +2 -0
- package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -0
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +2 -1
- package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +49 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations/RelationModal.d.ts +8 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/{Relations.d.ts → Relations/Relations.d.ts} +8 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +1 -2
- package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +9 -3
- package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +7 -4
- package/dist/admin/src/preview/components/PreviewHeader.d.ts +1 -2
- package/dist/admin/src/preview/pages/Preview.d.ts +2 -0
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +1 -1
- package/dist/server/index.mjs.map +1 -1
- package/package.json +8 -8
- package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.map +0 -1
- package/dist/admin/chunks/ComponentConfigurationPage-DhYZp4nN.js.map +0 -1
- package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.map +0 -1
- package/dist/admin/chunks/EditConfigurationPage-DDuPch5d.js.map +0 -1
- package/dist/admin/chunks/EditViewPage-jCZnUuCR.js +0 -265
- package/dist/admin/chunks/EditViewPage-jCZnUuCR.js.map +0 -1
- package/dist/admin/chunks/EditViewPage-zSnDwLz3.js +0 -288
- package/dist/admin/chunks/EditViewPage-zSnDwLz3.js.map +0 -1
- package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.map +0 -1
- package/dist/admin/chunks/Form-CZmB6JIg.js.map +0 -1
- package/dist/admin/chunks/History-BlLKDZSw.js.map +0 -1
- package/dist/admin/chunks/History-CPYXgxkS.js.map +0 -1
- package/dist/admin/chunks/Input-CLX3C5DI.js.map +0 -1
- package/dist/admin/chunks/Input-DiR2Xfa7.js.map +0 -1
- package/dist/admin/chunks/ListConfigurationPage-CNvotSqe.js.map +0 -1
- package/dist/admin/chunks/ListViewPage-MJNfQTp-.js.map +0 -1
- package/dist/admin/chunks/NoContentTypePage-CVvVpwj4.js.map +0 -1
- package/dist/admin/chunks/NoPermissionsPage-C5yWg70d.js.map +0 -1
- package/dist/admin/chunks/Preview-DEuQgQg2.js +0 -482
- package/dist/admin/chunks/Preview-DEuQgQg2.js.map +0 -1
- package/dist/admin/chunks/Preview-H74FQ9Cq.js +0 -504
- package/dist/admin/chunks/Preview-H74FQ9Cq.js.map +0 -1
- package/dist/admin/chunks/Relations-C8jbZPVK.js +0 -827
- package/dist/admin/chunks/Relations-C8jbZPVK.js.map +0 -1
- package/dist/admin/chunks/Relations-mxOUS7TJ.js +0 -853
- package/dist/admin/chunks/Relations-mxOUS7TJ.js.map +0 -1
- package/dist/admin/chunks/ar-DckYq_WK.js.map +0 -1
- package/dist/admin/chunks/ca-DviY7mRj.js.map +0 -1
- package/dist/admin/chunks/cs-C7OSYFQ7.js.map +0 -1
- package/dist/admin/chunks/de-5QRlDHyR.js.map +0 -1
- package/dist/admin/chunks/es-DkoWSExG.js.map +0 -1
- package/dist/admin/chunks/eu-BG1xX7HK.js.map +0 -1
- package/dist/admin/chunks/fr-CFdRaRVj.js.map +0 -1
- package/dist/admin/chunks/gu-D5MMMXRs.js.map +0 -1
- package/dist/admin/chunks/hi-lp17SCjr.js.map +0 -1
- package/dist/admin/chunks/hooks-DMvik5y_.js.map +0 -1
- package/dist/admin/chunks/hu-CLka1U2C.js.map +0 -1
- package/dist/admin/chunks/id-USfY9m1g.js.map +0 -1
- package/dist/admin/chunks/index-BRlRBRLb.js.map +0 -1
- package/dist/admin/chunks/index-ZIwOPk6p.js.map +0 -1
- package/dist/admin/chunks/it-BAHrwmYS.js.map +0 -1
- package/dist/admin/chunks/ja-BWKmBJFT.js.map +0 -1
- package/dist/admin/chunks/ko-CgADGBNt.js.map +0 -1
- package/dist/admin/chunks/layout-B3-guCPG.js.map +0 -1
- package/dist/admin/chunks/layout-ameRNiAM.js.map +0 -1
- package/dist/admin/chunks/ml-CnhCfOn_.js.map +0 -1
- package/dist/admin/chunks/ms-Bh09NFff.js.map +0 -1
- package/dist/admin/chunks/nl-C8HYflTc.js.map +0 -1
- package/dist/admin/chunks/objects-C3EebVVe.js +0 -76
- package/dist/admin/chunks/objects-C3EebVVe.js.map +0 -1
- package/dist/admin/chunks/objects-wl73iEma.js +0 -73
- package/dist/admin/chunks/objects-wl73iEma.js.map +0 -1
- package/dist/admin/chunks/pl-MFCZJZuZ.js.map +0 -1
- package/dist/admin/chunks/pt-BR-CcotyBGJ.js.map +0 -1
- package/dist/admin/chunks/pt-HbmgeiYO.js.map +0 -1
- package/dist/admin/chunks/relations-CmoFVrKj.js.map +0 -1
- package/dist/admin/chunks/relations-DYQAaXwZ.js.map +0 -1
- package/dist/admin/chunks/sa-n_aPA-pU.js.map +0 -1
- package/dist/admin/chunks/sk-tn_BDjE2.js.map +0 -1
- package/dist/admin/chunks/sv-cq4ZrQRd.js.map +0 -1
- package/dist/admin/chunks/th-mUH7hEtc.js.map +0 -1
- package/dist/admin/chunks/tr-Yt38daxh.js.map +0 -1
- package/dist/admin/chunks/uk-B24MoTVg.js +0 -145
- package/dist/admin/chunks/uk-B24MoTVg.js.map +0 -1
- package/dist/admin/chunks/uk-Cpgmm7gE.js +0 -140
- package/dist/admin/chunks/uk-Cpgmm7gE.js.map +0 -1
- package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.map +0 -1
- package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +0 -1
- package/dist/admin/chunks/usePrev-Bjw2dhmq.js +0 -18
- package/dist/admin/chunks/usePrev-Bjw2dhmq.js.map +0 -1
- package/dist/admin/chunks/usePrev-DIYl-IAL.js +0 -21
- package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +0 -1
- package/dist/admin/chunks/vi-CvBGlTjr.js.map +0 -1
- package/dist/admin/chunks/zh-BmF-sHaT.js.map +0 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +0 -0
- package/dist/admin/src/preview/components/PreviewContent.d.ts +0 -3
@@ -0,0 +1,593 @@
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
2
|
+
import * as React from 'react';
|
3
|
+
import { useStrapiApp, useQueryParams, useNotification, useClipboard, DescriptionComponentRenderer, useHistory, createContext, useRBAC, Page, Form, Blocker } from '@strapi/admin/strapi-admin';
|
4
|
+
import { Typography, Tabs, Flex, IconButton, Portal, FocusTrap, Box } from '@strapi/design-system';
|
5
|
+
import { Link, Cross, ArrowLineLeft } from '@strapi/icons';
|
6
|
+
import { useIntl } from 'react-intl';
|
7
|
+
import { Link as Link$1, useParams, useLocation } from 'react-router-dom';
|
8
|
+
import { styled } from 'styled-components';
|
9
|
+
import { c as useDocumentContext, I as InjectionZone, j as DocumentActionButton, D as DocumentStatus, i as DocumentRBAC, k as buildValidParams, C as COLLECTION_TYPES, V as useGetPreviewUrlQuery, U as useDocument, d as useDocumentLayout, p as DocumentContextProvider, h as createYupSchema } from './index-BE7PI9Wp.mjs';
|
10
|
+
import { a as FormLayout } from './Input-B3QUS9rv.mjs';
|
11
|
+
import { stringify } from 'qs';
|
12
|
+
import { getDocumentStatus } from './EditViewPage-CVRJBOEv.mjs';
|
13
|
+
import 'lodash/fp/mapValues';
|
14
|
+
import 'yup';
|
15
|
+
import 'fractional-indexing';
|
16
|
+
import 'lodash/fp/pipe';
|
17
|
+
import 'date-fns';
|
18
|
+
import '@reduxjs/toolkit';
|
19
|
+
import 'prismjs';
|
20
|
+
import 'slate';
|
21
|
+
import 'slate-history';
|
22
|
+
import 'slate-react';
|
23
|
+
import 'prismjs/themes/prism-solarizedlight.css';
|
24
|
+
import 'prismjs/components/prism-asmatmel';
|
25
|
+
import 'prismjs/components/prism-bash';
|
26
|
+
import 'prismjs/components/prism-basic';
|
27
|
+
import 'prismjs/components/prism-c';
|
28
|
+
import 'prismjs/components/prism-clojure';
|
29
|
+
import 'prismjs/components/prism-cobol';
|
30
|
+
import 'prismjs/components/prism-cpp';
|
31
|
+
import 'prismjs/components/prism-csharp';
|
32
|
+
import 'prismjs/components/prism-dart';
|
33
|
+
import 'prismjs/components/prism-docker';
|
34
|
+
import 'prismjs/components/prism-elixir';
|
35
|
+
import 'prismjs/components/prism-erlang';
|
36
|
+
import 'prismjs/components/prism-fortran';
|
37
|
+
import 'prismjs/components/prism-fsharp';
|
38
|
+
import 'prismjs/components/prism-go';
|
39
|
+
import 'prismjs/components/prism-graphql';
|
40
|
+
import 'prismjs/components/prism-groovy';
|
41
|
+
import 'prismjs/components/prism-haskell';
|
42
|
+
import 'prismjs/components/prism-haxe';
|
43
|
+
import 'prismjs/components/prism-ini';
|
44
|
+
import 'prismjs/components/prism-java';
|
45
|
+
import 'prismjs/components/prism-javascript';
|
46
|
+
import 'prismjs/components/prism-jsx';
|
47
|
+
import 'prismjs/components/prism-json';
|
48
|
+
import 'prismjs/components/prism-julia';
|
49
|
+
import 'prismjs/components/prism-kotlin';
|
50
|
+
import 'prismjs/components/prism-latex';
|
51
|
+
import 'prismjs/components/prism-lua';
|
52
|
+
import 'prismjs/components/prism-markdown';
|
53
|
+
import 'prismjs/components/prism-matlab';
|
54
|
+
import 'prismjs/components/prism-makefile';
|
55
|
+
import 'prismjs/components/prism-objectivec';
|
56
|
+
import 'prismjs/components/prism-perl';
|
57
|
+
import 'prismjs/components/prism-php';
|
58
|
+
import 'prismjs/components/prism-powershell';
|
59
|
+
import 'prismjs/components/prism-python';
|
60
|
+
import 'prismjs/components/prism-r';
|
61
|
+
import 'prismjs/components/prism-ruby';
|
62
|
+
import 'prismjs/components/prism-rust';
|
63
|
+
import 'prismjs/components/prism-sas';
|
64
|
+
import 'prismjs/components/prism-scala';
|
65
|
+
import 'prismjs/components/prism-scheme';
|
66
|
+
import 'prismjs/components/prism-sql';
|
67
|
+
import 'prismjs/components/prism-stata';
|
68
|
+
import 'prismjs/components/prism-swift';
|
69
|
+
import 'prismjs/components/prism-typescript';
|
70
|
+
import 'prismjs/components/prism-tsx';
|
71
|
+
import 'prismjs/components/prism-vbnet';
|
72
|
+
import 'prismjs/components/prism-yaml';
|
73
|
+
import './usePrev-PisKKvhT.mjs';
|
74
|
+
import './objects-D2z-IJgu.mjs';
|
75
|
+
import 'react-dnd';
|
76
|
+
import 'lodash/clone';
|
77
|
+
import 'lodash/toPath';
|
78
|
+
import '@radix-ui/react-toolbar';
|
79
|
+
import 'react-dnd-html5-backend';
|
80
|
+
import './ComponentIcon-BZcTc4rj.mjs';
|
81
|
+
import '@strapi/icons/symbols';
|
82
|
+
import 'react-window';
|
83
|
+
import 'codemirror5';
|
84
|
+
import 'sanitize-html';
|
85
|
+
import 'highlight.js';
|
86
|
+
import 'markdown-it';
|
87
|
+
import 'markdown-it-abbr';
|
88
|
+
import 'markdown-it-container';
|
89
|
+
import 'markdown-it-deflist';
|
90
|
+
import 'markdown-it-emoji';
|
91
|
+
import 'markdown-it-footnote';
|
92
|
+
import 'markdown-it-ins';
|
93
|
+
import 'markdown-it-mark';
|
94
|
+
import 'markdown-it-sub';
|
95
|
+
import 'markdown-it-sup';
|
96
|
+
import 'highlight.js/styles/solarized-dark.css';
|
97
|
+
import 'codemirror5/addon/display/placeholder';
|
98
|
+
|
99
|
+
/* -------------------------------------------------------------------------------------------------
|
100
|
+
* ClosePreviewButton
|
101
|
+
* -----------------------------------------------------------------------------------------------*/ const ClosePreviewButton = ()=>{
|
102
|
+
const [{ query }] = useQueryParams();
|
103
|
+
const { formatMessage } = useIntl();
|
104
|
+
const canGoBack = useHistory('BackButton', (state)=>state.canGoBack);
|
105
|
+
const goBack = useHistory('BackButton', (state)=>state.goBack);
|
106
|
+
const history = useHistory('BackButton', (state)=>state.history);
|
107
|
+
const locationIndex = useHistory('BackButton', (state)=>state.currentLocationIndex);
|
108
|
+
/**
|
109
|
+
* Get the link destination from the history.
|
110
|
+
* Rely on a fallback (the parent edit view page) if there's no page to go back .
|
111
|
+
*/ const historyTo = canGoBack ? history.at(locationIndex - 2) : undefined;
|
112
|
+
const fallback = {
|
113
|
+
pathname: '..',
|
114
|
+
search: stringify(query, {
|
115
|
+
encode: false
|
116
|
+
})
|
117
|
+
};
|
118
|
+
const toWithFallback = historyTo ?? fallback;
|
119
|
+
const handleClick = (e)=>{
|
120
|
+
if (canGoBack) {
|
121
|
+
// Prevent normal link behavior, go back in the history stack instead
|
122
|
+
e.preventDefault();
|
123
|
+
goBack();
|
124
|
+
return;
|
125
|
+
}
|
126
|
+
// Otherwise rely on native link behavior to go back to the edit view. We don't use navigate()
|
127
|
+
// here in order to get the relative="path" functionality from the Link component.
|
128
|
+
};
|
129
|
+
return /*#__PURE__*/ jsx(IconButton, {
|
130
|
+
variant: "ghost",
|
131
|
+
tag: Link$1,
|
132
|
+
relative: "path",
|
133
|
+
to: toWithFallback,
|
134
|
+
onClick: handleClick,
|
135
|
+
label: formatMessage({
|
136
|
+
id: 'content-manager.preview.header.close',
|
137
|
+
defaultMessage: 'Close preview'
|
138
|
+
}),
|
139
|
+
children: /*#__PURE__*/ jsx(Cross, {})
|
140
|
+
});
|
141
|
+
};
|
142
|
+
/* -------------------------------------------------------------------------------------------------
|
143
|
+
* Status
|
144
|
+
* -----------------------------------------------------------------------------------------------*/ const Status = ()=>{
|
145
|
+
// Get status
|
146
|
+
const document = usePreviewContext('PreviewHeader', (state)=>state.document);
|
147
|
+
const schema = usePreviewContext('PreviewHeader', (state)=>state.schema);
|
148
|
+
const meta = usePreviewContext('PreviewHeader', (state)=>state.meta);
|
149
|
+
const hasDraftAndPublished = schema?.options?.draftAndPublish ?? false;
|
150
|
+
if (!hasDraftAndPublished) {
|
151
|
+
return null;
|
152
|
+
}
|
153
|
+
const status = getDocumentStatus(document, meta);
|
154
|
+
return /*#__PURE__*/ jsx(DocumentStatus, {
|
155
|
+
status: status,
|
156
|
+
size: "XS"
|
157
|
+
});
|
158
|
+
};
|
159
|
+
const PreviewTabs = ()=>{
|
160
|
+
const { formatMessage } = useIntl();
|
161
|
+
// URL query params
|
162
|
+
const [{ query }, setQuery] = useQueryParams();
|
163
|
+
// Get status
|
164
|
+
const document = usePreviewContext('PreviewHeader', (state)=>state.document);
|
165
|
+
const schema = usePreviewContext('PreviewHeader', (state)=>state.schema);
|
166
|
+
const meta = usePreviewContext('PreviewHeader', (state)=>state.meta);
|
167
|
+
const hasDraftAndPublish = schema?.options?.draftAndPublish ?? false;
|
168
|
+
const documentStatus = getDocumentStatus(document, meta);
|
169
|
+
const handleTabChange = (status)=>{
|
170
|
+
if (status === 'published' || status === 'draft') {
|
171
|
+
setQuery({
|
172
|
+
status
|
173
|
+
}, 'push', true);
|
174
|
+
}
|
175
|
+
};
|
176
|
+
if (!hasDraftAndPublish) {
|
177
|
+
return null;
|
178
|
+
}
|
179
|
+
return /*#__PURE__*/ jsx(Tabs.Root, {
|
180
|
+
variant: "simple",
|
181
|
+
value: query.status || 'draft',
|
182
|
+
onValueChange: handleTabChange,
|
183
|
+
children: /*#__PURE__*/ jsxs(Tabs.List, {
|
184
|
+
"aria-label": formatMessage({
|
185
|
+
id: 'preview.tabs.label',
|
186
|
+
defaultMessage: 'Document status'
|
187
|
+
}),
|
188
|
+
children: [
|
189
|
+
/*#__PURE__*/ jsx(StatusTab, {
|
190
|
+
value: "draft",
|
191
|
+
children: formatMessage({
|
192
|
+
id: 'content-manager.containers.List.draft',
|
193
|
+
defaultMessage: 'draft'
|
194
|
+
})
|
195
|
+
}),
|
196
|
+
/*#__PURE__*/ jsx(StatusTab, {
|
197
|
+
value: "published",
|
198
|
+
disabled: documentStatus === 'draft',
|
199
|
+
children: formatMessage({
|
200
|
+
id: 'content-manager.containers.List.published',
|
201
|
+
defaultMessage: 'published'
|
202
|
+
})
|
203
|
+
})
|
204
|
+
]
|
205
|
+
})
|
206
|
+
});
|
207
|
+
};
|
208
|
+
/* -------------------------------------------------------------------------------------------------
|
209
|
+
* PreviewHeader
|
210
|
+
* -----------------------------------------------------------------------------------------------*/ const PreviewHeader = ()=>{
|
211
|
+
const title = usePreviewContext('PreviewHeader', (state)=>state.title);
|
212
|
+
const document = usePreviewContext('PreviewHeader', (state)=>state.document);
|
213
|
+
const schema = usePreviewContext('PreviewHeader', (state)=>state.schema);
|
214
|
+
const meta = usePreviewContext('PreviewHeader', (state)=>state.meta);
|
215
|
+
const plugins = useStrapiApp('PreviewHeader', (state)=>state.plugins);
|
216
|
+
const onPreview = useDocumentContext('PreviewHeader', (state)=>state.onPreview);
|
217
|
+
const [{ query }] = useQueryParams();
|
218
|
+
const { formatMessage } = useIntl();
|
219
|
+
const { toggleNotification } = useNotification();
|
220
|
+
const { copy } = useClipboard();
|
221
|
+
const handleCopyLink = ()=>{
|
222
|
+
copy(window.location.href);
|
223
|
+
toggleNotification({
|
224
|
+
message: formatMessage({
|
225
|
+
id: 'content-manager.preview.copy.success',
|
226
|
+
defaultMessage: 'Copied preview link'
|
227
|
+
}),
|
228
|
+
type: 'success'
|
229
|
+
});
|
230
|
+
};
|
231
|
+
const hasDraftAndPublish = schema.options?.draftAndPublish ?? false;
|
232
|
+
const documentActionProps = {
|
233
|
+
activeTab: query.status ?? null,
|
234
|
+
collectionType: schema.kind === 'collectionType' ? 'collection-types' : 'single-types',
|
235
|
+
model: schema.uid,
|
236
|
+
documentId: document.documentId,
|
237
|
+
document,
|
238
|
+
meta,
|
239
|
+
onPreview
|
240
|
+
};
|
241
|
+
return /*#__PURE__*/ jsxs(Flex, {
|
242
|
+
height: "48px",
|
243
|
+
gap: 4,
|
244
|
+
background: "neutral0",
|
245
|
+
borderColor: "neutral150",
|
246
|
+
tag: "header",
|
247
|
+
children: [
|
248
|
+
/*#__PURE__*/ jsxs(TitleContainer, {
|
249
|
+
height: "100%",
|
250
|
+
paddingLeft: 2,
|
251
|
+
paddingRight: 4,
|
252
|
+
children: [
|
253
|
+
/*#__PURE__*/ jsx(ClosePreviewButton, {}),
|
254
|
+
/*#__PURE__*/ jsx(PreviewTitle, {
|
255
|
+
tag: "h1",
|
256
|
+
title: title,
|
257
|
+
maxWidth: "200px",
|
258
|
+
fontSize: 2,
|
259
|
+
paddingLeft: 2,
|
260
|
+
paddingRight: 3,
|
261
|
+
fontWeight: 600,
|
262
|
+
children: title
|
263
|
+
}),
|
264
|
+
/*#__PURE__*/ jsx(Status, {})
|
265
|
+
]
|
266
|
+
}),
|
267
|
+
/*#__PURE__*/ jsxs(Flex, {
|
268
|
+
flex: 1,
|
269
|
+
paddingRight: 2,
|
270
|
+
gap: 2,
|
271
|
+
justifyContent: hasDraftAndPublish ? 'space-between' : 'flex-end',
|
272
|
+
children: [
|
273
|
+
/*#__PURE__*/ jsx(Flex, {
|
274
|
+
flex: "1 1 70%",
|
275
|
+
children: /*#__PURE__*/ jsx(PreviewTabs, {})
|
276
|
+
}),
|
277
|
+
/*#__PURE__*/ jsxs(Flex, {
|
278
|
+
gap: 2,
|
279
|
+
children: [
|
280
|
+
/*#__PURE__*/ jsx(IconButton, {
|
281
|
+
type: "button",
|
282
|
+
label: formatMessage({
|
283
|
+
id: 'preview.copy.label',
|
284
|
+
defaultMessage: 'Copy preview link'
|
285
|
+
}),
|
286
|
+
onClick: handleCopyLink,
|
287
|
+
children: /*#__PURE__*/ jsx(Link, {})
|
288
|
+
}),
|
289
|
+
/*#__PURE__*/ jsx(InjectionZone, {
|
290
|
+
area: "preview.actions"
|
291
|
+
}),
|
292
|
+
/*#__PURE__*/ jsx(DescriptionComponentRenderer, {
|
293
|
+
props: documentActionProps,
|
294
|
+
descriptions: plugins['content-manager'].apis.getDocumentActions('preview'),
|
295
|
+
children: (actions)=>{
|
296
|
+
const filteredActions = actions.filter((action)=>[
|
297
|
+
action.position
|
298
|
+
].flat().includes('preview'));
|
299
|
+
const [primaryAction, secondaryAction] = filteredActions;
|
300
|
+
if (!primaryAction && !secondaryAction) return null;
|
301
|
+
// Both actions are available when draft and publish enabled
|
302
|
+
if (primaryAction && secondaryAction) {
|
303
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
304
|
+
children: [
|
305
|
+
/*#__PURE__*/ jsx(DocumentActionButton, {
|
306
|
+
...secondaryAction,
|
307
|
+
variant: secondaryAction.variant || 'secondary'
|
308
|
+
}),
|
309
|
+
/*#__PURE__*/ jsx(DocumentActionButton, {
|
310
|
+
...primaryAction,
|
311
|
+
variant: primaryAction.variant || 'default'
|
312
|
+
})
|
313
|
+
]
|
314
|
+
});
|
315
|
+
}
|
316
|
+
// Otherwise we just have the save action
|
317
|
+
return /*#__PURE__*/ jsx(DocumentActionButton, {
|
318
|
+
...primaryAction,
|
319
|
+
variant: primaryAction.variant || 'secondary'
|
320
|
+
});
|
321
|
+
}
|
322
|
+
})
|
323
|
+
]
|
324
|
+
})
|
325
|
+
]
|
326
|
+
})
|
327
|
+
]
|
328
|
+
});
|
329
|
+
};
|
330
|
+
const PreviewTitle = styled(Typography)`
|
331
|
+
overflow: hidden;
|
332
|
+
text-overflow: ellipsis;
|
333
|
+
white-space: nowrap;
|
334
|
+
`;
|
335
|
+
const StatusTab = styled(Tabs.Trigger)`
|
336
|
+
text-transform: uppercase;
|
337
|
+
`;
|
338
|
+
const TitleContainer = styled(Flex)`
|
339
|
+
border-right: 1px solid ${({ theme })=>theme.colors.neutral150};
|
340
|
+
`;
|
341
|
+
|
342
|
+
const [PreviewProvider, usePreviewContext] = createContext('PreviewPage');
|
343
|
+
/* -------------------------------------------------------------------------------------------------
|
344
|
+
* PreviewPage
|
345
|
+
* -----------------------------------------------------------------------------------------------*/ const AnimatedArrow = styled(ArrowLineLeft)`
|
346
|
+
will-change: transform;
|
347
|
+
rotate: ${(props)=>props.isSideEditorOpen ? '0deg' : '180deg'};
|
348
|
+
transition: rotate 0.2s ease-in-out;
|
349
|
+
`;
|
350
|
+
const PreviewPage = ()=>{
|
351
|
+
const location = useLocation();
|
352
|
+
const { formatMessage } = useIntl();
|
353
|
+
const iframeRef = React.useRef(null);
|
354
|
+
const [isSideEditorOpen, setIsSideEditorOpen] = React.useState(true);
|
355
|
+
// Read all the necessary data from the URL to find the right preview URL
|
356
|
+
const { slug: model, id: documentId, collectionType } = useParams();
|
357
|
+
const [{ query }] = useQueryParams();
|
358
|
+
const params = React.useMemo(()=>buildValidParams(query), [
|
359
|
+
query
|
360
|
+
]);
|
361
|
+
if (!collectionType) {
|
362
|
+
throw new Error('Could not find collectionType in url params');
|
363
|
+
}
|
364
|
+
if (!model) {
|
365
|
+
throw new Error('Could not find model in url params');
|
366
|
+
}
|
367
|
+
// Only collection types must have a documentId
|
368
|
+
if (collectionType === COLLECTION_TYPES && !documentId) {
|
369
|
+
throw new Error('Could not find documentId in url params');
|
370
|
+
}
|
371
|
+
const previewUrlResponse = useGetPreviewUrlQuery({
|
372
|
+
params: {
|
373
|
+
contentType: model
|
374
|
+
},
|
375
|
+
query: {
|
376
|
+
documentId,
|
377
|
+
locale: params.locale,
|
378
|
+
status: params.status
|
379
|
+
}
|
380
|
+
});
|
381
|
+
const documentResponse = useDocument({
|
382
|
+
model,
|
383
|
+
collectionType,
|
384
|
+
documentId,
|
385
|
+
params
|
386
|
+
});
|
387
|
+
const documentLayoutResponse = useDocumentLayout(model);
|
388
|
+
const isLoading = previewUrlResponse.isLoading || documentLayoutResponse.isLoading || documentResponse.isLoading;
|
389
|
+
if (isLoading && !documentResponse.document?.documentId) {
|
390
|
+
return /*#__PURE__*/ jsx(Page.Loading, {});
|
391
|
+
}
|
392
|
+
const initialValues = documentResponse.getInitialFormValues();
|
393
|
+
if (previewUrlResponse.error || documentLayoutResponse.error || !documentResponse.document || !documentResponse.meta || !documentResponse.schema || !initialValues) {
|
394
|
+
return /*#__PURE__*/ jsx(Page.Error, {});
|
395
|
+
}
|
396
|
+
if (!previewUrlResponse.data?.data?.url) {
|
397
|
+
return /*#__PURE__*/ jsx(Page.NoData, {});
|
398
|
+
}
|
399
|
+
const documentTitle = documentResponse.getTitle(documentLayoutResponse.edit.settings.mainField);
|
400
|
+
const validateSync = (values, options)=>{
|
401
|
+
const yupSchema = createYupSchema(documentResponse.schema?.attributes, documentResponse.components, {
|
402
|
+
status: documentResponse.document?.status,
|
403
|
+
...options
|
404
|
+
});
|
405
|
+
return yupSchema.validateSync(values, {
|
406
|
+
abortEarly: false
|
407
|
+
});
|
408
|
+
};
|
409
|
+
const previewUrl = previewUrlResponse.data.data.url;
|
410
|
+
const onPreview = ()=>{
|
411
|
+
iframeRef?.current?.contentWindow?.postMessage({
|
412
|
+
type: 'strapiUpdate'
|
413
|
+
}, // The iframe origin is safe to use since it must be provided through the allowedOrigins config
|
414
|
+
new URL(iframeRef.current.src).origin);
|
415
|
+
};
|
416
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
417
|
+
children: [
|
418
|
+
/*#__PURE__*/ jsx(Page.Title, {
|
419
|
+
children: formatMessage({
|
420
|
+
id: 'content-manager.preview.page-title',
|
421
|
+
defaultMessage: '{contentType} preview'
|
422
|
+
}, {
|
423
|
+
contentType: documentTitle
|
424
|
+
})
|
425
|
+
}),
|
426
|
+
/*#__PURE__*/ jsx(DocumentContextProvider, {
|
427
|
+
initialDocument: {
|
428
|
+
documentId: documentId || '',
|
429
|
+
model,
|
430
|
+
collectionType
|
431
|
+
},
|
432
|
+
onPreview: onPreview,
|
433
|
+
children: /*#__PURE__*/ jsx(PreviewProvider, {
|
434
|
+
url: previewUrl,
|
435
|
+
document: documentResponse.document,
|
436
|
+
title: documentTitle,
|
437
|
+
meta: documentResponse.meta,
|
438
|
+
schema: documentResponse.schema,
|
439
|
+
layout: documentLayoutResponse.edit,
|
440
|
+
children: /*#__PURE__*/ jsx(Form, {
|
441
|
+
method: "PUT",
|
442
|
+
disabled: query.status === 'published' && documentResponse && documentResponse.document.status === 'published',
|
443
|
+
initialValues: documentResponse.getInitialFormValues(),
|
444
|
+
initialErrors: location?.state?.forceValidation ? validateSync(initialValues, {}) : {},
|
445
|
+
height: "100%",
|
446
|
+
validate: (values, options)=>{
|
447
|
+
const yupSchema = createYupSchema(documentResponse.schema?.attributes, documentResponse.components, {
|
448
|
+
status: documentResponse.document?.status,
|
449
|
+
...options
|
450
|
+
});
|
451
|
+
return yupSchema.validate(values, {
|
452
|
+
abortEarly: false
|
453
|
+
});
|
454
|
+
},
|
455
|
+
children: ({ resetForm })=>/*#__PURE__*/ jsxs(Flex, {
|
456
|
+
direction: "column",
|
457
|
+
height: "100%",
|
458
|
+
alignItems: "stretch",
|
459
|
+
children: [
|
460
|
+
/*#__PURE__*/ jsx(Blocker, {
|
461
|
+
onProceed: resetForm
|
462
|
+
}),
|
463
|
+
/*#__PURE__*/ jsx(PreviewHeader, {}),
|
464
|
+
/*#__PURE__*/ jsxs(Flex, {
|
465
|
+
flex: 1,
|
466
|
+
overflow: "auto",
|
467
|
+
alignItems: "stretch",
|
468
|
+
children: [
|
469
|
+
/*#__PURE__*/ jsx(Box, {
|
470
|
+
overflow: "auto",
|
471
|
+
width: isSideEditorOpen ? '50%' : 0,
|
472
|
+
borderWidth: "0 1px 0 0",
|
473
|
+
borderColor: "neutral150",
|
474
|
+
paddingTop: 6,
|
475
|
+
paddingBottom: 6,
|
476
|
+
// Remove horizontal padding when the editor is closed or it won't fully disappear
|
477
|
+
paddingLeft: isSideEditorOpen ? 6 : 0,
|
478
|
+
paddingRight: isSideEditorOpen ? 6 : 0,
|
479
|
+
transition: "all 0.2s ease-in-out",
|
480
|
+
children: /*#__PURE__*/ jsx(FormLayout, {
|
481
|
+
layout: documentLayoutResponse.edit.layout,
|
482
|
+
document: documentResponse,
|
483
|
+
hasBackground: false
|
484
|
+
})
|
485
|
+
}),
|
486
|
+
/*#__PURE__*/ jsxs(Box, {
|
487
|
+
position: "relative",
|
488
|
+
flex: 1,
|
489
|
+
height: "100%",
|
490
|
+
overflow: "hidden",
|
491
|
+
children: [
|
492
|
+
/*#__PURE__*/ jsx(Box, {
|
493
|
+
"data-testid": "preview-iframe",
|
494
|
+
ref: iframeRef,
|
495
|
+
src: previewUrl,
|
496
|
+
title: formatMessage({
|
497
|
+
id: 'content-manager.preview.panel.title',
|
498
|
+
defaultMessage: 'Preview'
|
499
|
+
}),
|
500
|
+
width: "100%",
|
501
|
+
height: "100%",
|
502
|
+
borderWidth: 0,
|
503
|
+
tag: "iframe"
|
504
|
+
}, previewUrl),
|
505
|
+
/*#__PURE__*/ jsx(IconButton, {
|
506
|
+
variant: "tertiary",
|
507
|
+
label: formatMessage(isSideEditorOpen ? {
|
508
|
+
id: 'content-manager.preview.content.close-editor',
|
509
|
+
defaultMessage: 'Close editor'
|
510
|
+
} : {
|
511
|
+
id: 'content-manager.preview.content.open-editor',
|
512
|
+
defaultMessage: 'Open editor'
|
513
|
+
}),
|
514
|
+
onClick: ()=>setIsSideEditorOpen((prev)=>!prev),
|
515
|
+
position: "absolute",
|
516
|
+
top: 2,
|
517
|
+
left: 2,
|
518
|
+
children: /*#__PURE__*/ jsx(AnimatedArrow, {
|
519
|
+
isSideEditorOpen: isSideEditorOpen
|
520
|
+
})
|
521
|
+
})
|
522
|
+
]
|
523
|
+
})
|
524
|
+
]
|
525
|
+
})
|
526
|
+
]
|
527
|
+
})
|
528
|
+
})
|
529
|
+
})
|
530
|
+
})
|
531
|
+
]
|
532
|
+
});
|
533
|
+
};
|
534
|
+
/* -------------------------------------------------------------------------------------------------
|
535
|
+
* ProtectedPreviewPage
|
536
|
+
* -----------------------------------------------------------------------------------------------*/ const ProtectedPreviewPageImpl = ()=>{
|
537
|
+
const { slug: model } = useParams();
|
538
|
+
const { permissions = [], isLoading, error } = useRBAC([
|
539
|
+
{
|
540
|
+
action: 'plugin::content-manager.explorer.read',
|
541
|
+
subject: model
|
542
|
+
},
|
543
|
+
{
|
544
|
+
action: 'plugin::content-manager.explorer.update',
|
545
|
+
subject: model
|
546
|
+
},
|
547
|
+
{
|
548
|
+
action: 'plugin::content-manager.explorer.publish',
|
549
|
+
subject: model
|
550
|
+
}
|
551
|
+
]);
|
552
|
+
if (isLoading) {
|
553
|
+
return /*#__PURE__*/ jsx(Page.Loading, {});
|
554
|
+
}
|
555
|
+
if (error || !model) {
|
556
|
+
return /*#__PURE__*/ jsx(Box, {
|
557
|
+
height: "100vh",
|
558
|
+
width: "100vw",
|
559
|
+
position: "fixed",
|
560
|
+
top: 0,
|
561
|
+
left: 0,
|
562
|
+
zIndex: 2,
|
563
|
+
background: "neutral0",
|
564
|
+
children: /*#__PURE__*/ jsx(Page.Error, {})
|
565
|
+
});
|
566
|
+
}
|
567
|
+
return /*#__PURE__*/ jsx(Box, {
|
568
|
+
height: "100vh",
|
569
|
+
width: "100vw",
|
570
|
+
position: "fixed",
|
571
|
+
top: 0,
|
572
|
+
left: 0,
|
573
|
+
zIndex: 2,
|
574
|
+
background: "neutral0",
|
575
|
+
children: /*#__PURE__*/ jsx(Page.Protect, {
|
576
|
+
permissions: permissions.filter((permission)=>permission.action.includes('explorer.read')),
|
577
|
+
children: /*#__PURE__*/ jsx(DocumentRBAC, {
|
578
|
+
permissions: permissions,
|
579
|
+
children: /*#__PURE__*/ jsx(PreviewPage, {})
|
580
|
+
})
|
581
|
+
})
|
582
|
+
});
|
583
|
+
};
|
584
|
+
const ProtectedPreviewPage = ()=>{
|
585
|
+
return /*#__PURE__*/ jsx(Portal, {
|
586
|
+
children: /*#__PURE__*/ jsx(FocusTrap, {
|
587
|
+
children: /*#__PURE__*/ jsx(ProtectedPreviewPageImpl, {})
|
588
|
+
})
|
589
|
+
});
|
590
|
+
};
|
591
|
+
|
592
|
+
export { ProtectedPreviewPage, usePreviewContext };
|
593
|
+
//# sourceMappingURL=Preview-BH9l1QXk.mjs.map
|