@strapi/content-manager 0.0.0-experimental.e0df4d50334a17a1beb3d203bff414fbbff62f7b → 0.0.0-experimental.e12978dcee698470990e9c5c63384faf2c307443
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/{ComponentConfigurationPage-C5H-5L1u.js → ComponentConfigurationPage-Ci3dN40b.js} +5 -6
- package/dist/admin/chunks/{ComponentConfigurationPage-C5H-5L1u.js.map → ComponentConfigurationPage-Ci3dN40b.js.map} +1 -1
- package/dist/admin/chunks/{ComponentConfigurationPage-BN2kOtDm.mjs → ComponentConfigurationPage-DFPdl9pm.mjs} +5 -6
- package/dist/admin/chunks/{ComponentConfigurationPage-BN2kOtDm.mjs.map → ComponentConfigurationPage-DFPdl9pm.mjs.map} +1 -1
- package/dist/admin/chunks/{EditConfigurationPage-BExtZuB7.js → EditConfigurationPage-7xe8u-Pp.js} +5 -6
- package/dist/admin/chunks/{EditConfigurationPage-BExtZuB7.js.map → EditConfigurationPage-7xe8u-Pp.js.map} +1 -1
- package/dist/admin/chunks/{EditConfigurationPage-tMgOELQG.mjs → EditConfigurationPage-BFse-urJ.mjs} +5 -6
- package/dist/admin/chunks/{EditConfigurationPage-tMgOELQG.mjs.map → EditConfigurationPage-BFse-urJ.mjs.map} +1 -1
- package/dist/admin/chunks/{EditViewPage-CYe7wAXF.mjs → EditViewPage-BNpRr7fZ.mjs} +99 -98
- package/dist/admin/chunks/EditViewPage-BNpRr7fZ.mjs.map +1 -0
- package/dist/admin/chunks/{EditViewPage-DFkloeMZ.js → EditViewPage-CwYSs8Cq.js} +99 -98
- package/dist/admin/chunks/EditViewPage-CwYSs8Cq.js.map +1 -0
- package/dist/admin/chunks/{Form-DTO0ZIaB.mjs → Form-D9Ee-exF.mjs} +3 -3
- package/dist/admin/chunks/{Form-DTO0ZIaB.mjs.map → Form-D9Ee-exF.mjs.map} +1 -1
- package/dist/admin/chunks/{Form-DGUP3zQO.js → Form-DDbxreII.js} +5 -5
- package/dist/admin/chunks/{Form-DGUP3zQO.js.map → Form-DDbxreII.js.map} +1 -1
- package/dist/admin/chunks/{History-CQznK1pG.js → History-D5joC76n.js} +17 -13
- package/dist/admin/chunks/History-D5joC76n.js.map +1 -0
- package/dist/admin/chunks/{History-C333pgXF.mjs → History-FuD7Tp5I.mjs} +16 -12
- package/dist/admin/chunks/History-FuD7Tp5I.mjs.map +1 -0
- package/dist/admin/chunks/{Input-BexkC_pp.mjs → Input-BHucdqva.mjs} +1108 -47
- package/dist/admin/chunks/Input-BHucdqva.mjs.map +1 -0
- package/dist/admin/chunks/{Input-DLJZHw9Y.js → Input-BJCenRYN.js} +1121 -57
- package/dist/admin/chunks/Input-BJCenRYN.js.map +1 -0
- package/dist/admin/chunks/{ListConfigurationPage-BX2WR7MI.mjs → ListConfigurationPage-3kSfz9xV.mjs} +4 -5
- package/dist/admin/chunks/{ListConfigurationPage-BX2WR7MI.mjs.map → ListConfigurationPage-3kSfz9xV.mjs.map} +1 -1
- package/dist/admin/chunks/{ListConfigurationPage-71I_stAM.js → ListConfigurationPage-CgJEcEkD.js} +6 -7
- package/dist/admin/chunks/{ListConfigurationPage-71I_stAM.js.map → ListConfigurationPage-CgJEcEkD.js.map} +1 -1
- package/dist/admin/chunks/{ListViewPage-DV3heO4F.js → ListViewPage-CvQ1w8IW.js} +7 -8
- package/dist/admin/chunks/{ListViewPage-DV3heO4F.js.map → ListViewPage-CvQ1w8IW.js.map} +1 -1
- package/dist/admin/chunks/{ListViewPage-BDeT3Dkk.mjs → ListViewPage-DPUYRHss.mjs} +3 -4
- package/dist/admin/chunks/{ListViewPage-BDeT3Dkk.mjs.map → ListViewPage-DPUYRHss.mjs.map} +1 -1
- package/dist/admin/chunks/{NoContentTypePage-9JHYpYVX.mjs → NoContentTypePage-BRLLtjLb.mjs} +2 -2
- package/dist/admin/chunks/{NoContentTypePage-9JHYpYVX.mjs.map → NoContentTypePage-BRLLtjLb.mjs.map} +1 -1
- package/dist/admin/chunks/{NoContentTypePage-COih9y2J.js → NoContentTypePage-C5Vut1Af.js} +2 -2
- package/dist/admin/chunks/{NoContentTypePage-COih9y2J.js.map → NoContentTypePage-C5Vut1Af.js.map} +1 -1
- package/dist/admin/chunks/{NoPermissionsPage-DTe9I47q.mjs → NoPermissionsPage-B5HJbcjm.mjs} +2 -2
- package/dist/admin/chunks/{NoPermissionsPage-DTe9I47q.mjs.map → NoPermissionsPage-B5HJbcjm.mjs.map} +1 -1
- package/dist/admin/chunks/{NoPermissionsPage-DGAwRIlN.js → NoPermissionsPage-BBXnpc7M.js} +2 -2
- package/dist/admin/chunks/{NoPermissionsPage-DGAwRIlN.js.map → NoPermissionsPage-BBXnpc7M.js.map} +1 -1
- package/dist/admin/chunks/{Preview-BEq0FXda.mjs → Preview-C3lnOgQx.mjs} +244 -116
- package/dist/admin/chunks/Preview-C3lnOgQx.mjs.map +1 -0
- package/dist/admin/chunks/{Preview-CXtc9yEV.js → Preview-DB7ZGawL.js} +240 -112
- package/dist/admin/chunks/Preview-DB7ZGawL.js.map +1 -0
- package/dist/admin/chunks/{en-C1CjdAtC.js → en-CH__IC8g.js} +4 -1
- package/dist/admin/chunks/{en-C1CjdAtC.js.map → en-CH__IC8g.js.map} +1 -1
- package/dist/admin/chunks/{en-LfhocNG2.mjs → en-DBP0Gaid.mjs} +4 -1
- package/dist/admin/chunks/{en-LfhocNG2.mjs.map → en-DBP0Gaid.mjs.map} +1 -1
- package/dist/admin/chunks/{index-Cs6qwFQu.mjs → index-DYrCidCq.mjs} +225 -140
- package/dist/admin/chunks/index-DYrCidCq.mjs.map +1 -0
- package/dist/admin/chunks/{index-BHimg6jW.js → index-DoUQnFTk.js} +227 -138
- package/dist/admin/chunks/index-DoUQnFTk.js.map +1 -0
- package/dist/admin/chunks/{layout-Dtahn4Ue.js → layout-CqndYVtU.js} +86 -13
- package/dist/admin/chunks/layout-CqndYVtU.js.map +1 -0
- package/dist/admin/chunks/{layout-DStNia_P.mjs → layout-D2NJmgCw.mjs} +78 -5
- package/dist/admin/chunks/layout-D2NJmgCw.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.mjs → objects-D2z-IJgu.mjs} +72 -2
- package/dist/admin/chunks/objects-D2z-IJgu.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/uk-DB6OgySY.js.map +1 -0
- package/dist/admin/chunks/{relations-XOYEEqMz.js → usePrev-Cm_0-qRC.js} +18 -2
- package/dist/admin/chunks/usePrev-Cm_0-qRC.js.map +1 -0
- package/dist/admin/chunks/{relations-Cq8NRUto.mjs → usePrev-DinC2aha.mjs} +18 -4
- package/dist/admin/chunks/usePrev-DinC2aha.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +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 +48 -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/pages/EditView/components/DocumentActions.d.ts +2 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations/RelationModal.d.ts +7 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/{Relations.d.ts → Relations/Relations.d.ts} +9 -4
- package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +5 -2
- package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +3 -3
- package/dist/admin/src/preview/components/PreviewContent.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/EditViewPage-CYe7wAXF.mjs.map +0 -1
- package/dist/admin/chunks/EditViewPage-DFkloeMZ.js.map +0 -1
- package/dist/admin/chunks/History-C333pgXF.mjs.map +0 -1
- package/dist/admin/chunks/History-CQznK1pG.js.map +0 -1
- package/dist/admin/chunks/Input-BexkC_pp.mjs.map +0 -1
- package/dist/admin/chunks/Input-DLJZHw9Y.js.map +0 -1
- package/dist/admin/chunks/Preview-BEq0FXda.mjs.map +0 -1
- package/dist/admin/chunks/Preview-CXtc9yEV.js.map +0 -1
- package/dist/admin/chunks/Relations-o7_hVGyK.js +0 -1318
- package/dist/admin/chunks/Relations-o7_hVGyK.js.map +0 -1
- package/dist/admin/chunks/Relations-qeZyLDgQ.mjs +0 -1291
- package/dist/admin/chunks/Relations-qeZyLDgQ.mjs.map +0 -1
- package/dist/admin/chunks/index-BHimg6jW.js.map +0 -1
- package/dist/admin/chunks/index-Cs6qwFQu.mjs.map +0 -1
- package/dist/admin/chunks/layout-DStNia_P.mjs.map +0 -1
- package/dist/admin/chunks/layout-Dtahn4Ue.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.mjs +0 -73
- package/dist/admin/chunks/objects-wl73iEma.mjs.map +0 -1
- package/dist/admin/chunks/relations-Cq8NRUto.mjs.map +0 -1
- package/dist/admin/chunks/relations-XOYEEqMz.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.mjs +0 -140
- package/dist/admin/chunks/uk-Cpgmm7gE.mjs.map +0 -1
- package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs.map +0 -1
- package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +0 -1
- package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs +0 -18
- package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs.map +0 -1
- package/dist/admin/chunks/usePrev-DIYl-IAL.js +0 -21
- package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Preview-BEq0FXda.mjs","sources":["../../../admin/src/preview/components/PreviewContent.tsx","../../../admin/src/preview/components/PreviewHeader.tsx","../../../admin/src/preview/pages/Preview.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Box, Flex } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\n\nimport { FormLayout } from '../../pages/EditView/components/FormLayout';\nimport { usePreviewContext } from '../pages/Preview';\n\nconst UnstablePreviewContent = () => {\n const previewUrl = usePreviewContext('PreviewContent', (state) => state.url);\n const layout = usePreviewContext('PreviewContent', (state) => state.layout);\n\n const { formatMessage } = useIntl();\n\n return (\n <Flex flex={1} overflow=\"auto\" alignItems=\"stretch\">\n <Box overflow=\"auto\" flex={1} borderWidth=\"0 1px 0 0\" borderColor=\"neutral150\" padding={6}>\n <FormLayout layout={layout.layout} hasBackground />\n </Box>\n <Box\n src={previewUrl}\n /**\n * For some reason, changing an iframe's src tag causes the browser to add a new item in the\n * history stack. This is an issue for us as it means clicking the back button will not let us\n * go back to the edit view. To fix it, we need to trick the browser into thinking this is a\n * different iframe when the preview URL changes. So we set a key prop to force React\n * to mount a different node when the src changes.\n */\n key={previewUrl}\n title={formatMessage({\n id: 'content-manager.preview.panel.title',\n defaultMessage: 'Preview',\n })}\n flex={1}\n height=\"100%\"\n borderWidth={0}\n tag=\"iframe\"\n />\n </Flex>\n );\n};\n\nconst PreviewContent = () => {\n const previewUrl = usePreviewContext('PreviewContent', (state) => state.url);\n\n const { formatMessage } = useIntl();\n\n return (\n <Box\n src={previewUrl}\n /**\n * For some reason, changing an iframe's src tag causes the browser to add a new item in the\n * history stack. This is an issue for us as it means clicking the back button will not let us\n * go back to the edit view. To fix it, we need to trick the browser into thinking this is a\n * different iframe when the preview URL changes. So we set a key prop to force React\n * to mount a different node when the src changes.\n */\n key={previewUrl}\n title={formatMessage({\n id: 'content-manager.preview.panel.title',\n defaultMessage: 'Preview',\n })}\n width=\"100%\"\n height=\"100%\"\n borderWidth={0}\n tag=\"iframe\"\n />\n );\n};\n\nexport { PreviewContent, UnstablePreviewContent };\n","import * as React from 'react';\n\nimport {\n useClipboard,\n useHistory,\n useNotification,\n useQueryParams,\n} from '@strapi/admin/strapi-admin';\nimport { IconButton, Tabs, Typography, Grid, Flex } from '@strapi/design-system';\nimport { Cross, Link as LinkIcon } from '@strapi/icons';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { Link, type To } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { DocumentStatus } from '../../pages/EditView/components/DocumentStatus';\nimport { getDocumentStatus } from '../../pages/EditView/EditViewPage';\nimport { usePreviewContext } from '../pages/Preview';\n\n/* -------------------------------------------------------------------------------------------------\n * ClosePreviewButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst ClosePreviewButton = () => {\n const [{ query }] = useQueryParams<{\n plugins?: Record<string, unknown>;\n }>();\n const { formatMessage } = useIntl();\n\n const canGoBack = useHistory('BackButton', (state) => state.canGoBack);\n const goBack = useHistory('BackButton', (state) => state.goBack);\n const history = useHistory('BackButton', (state) => state.history);\n const locationIndex = useHistory('BackButton', (state) => state.currentLocationIndex);\n\n /**\n * Get the link destination from the history.\n * Rely on a fallback (the parent edit view page) if there's no page to go back .\n */\n const historyTo = canGoBack ? history.at(locationIndex - 2) : undefined;\n const fallback = {\n pathname: '..',\n search: stringify(query, { encode: false }),\n } satisfies To;\n const toWithFallback = historyTo ?? fallback;\n\n const handleClick = (e: React.MouseEvent) => {\n if (canGoBack) {\n // Prevent normal link behavior, go back in the history stack instead\n e.preventDefault();\n goBack();\n return;\n }\n\n // Otherwise rely on native link behavior to go back to the edit view. We don't use navigate()\n // here in order to get the relative=\"path\" functionality from the Link component.\n };\n\n return (\n <IconButton\n variant=\"ghost\"\n tag={Link}\n relative=\"path\"\n to={toWithFallback}\n onClick={handleClick}\n label={formatMessage({\n id: 'content-manager.preview.header.close',\n defaultMessage: 'Close preview',\n })}\n >\n <Cross />\n </IconButton>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Status\n * -----------------------------------------------------------------------------------------------*/\n\nconst Status = () => {\n // Get status\n const document = usePreviewContext('PreviewHeader', (state) => state.document);\n const schema = usePreviewContext('PreviewHeader', (state) => state.schema);\n const meta = usePreviewContext('PreviewHeader', (state) => state.meta);\n const hasDraftAndPublished = schema?.options?.draftAndPublish ?? false;\n\n if (!hasDraftAndPublished) {\n return null;\n }\n\n const status = getDocumentStatus(document, meta);\n\n return <DocumentStatus status={status} size=\"XS\" />;\n};\n\nconst PreviewTabs = () => {\n const { formatMessage } = useIntl();\n\n // URL query params\n const [{ query }, setQuery] = useQueryParams<{ status: 'draft' | 'published' }>();\n\n // Get status\n const document = usePreviewContext('PreviewHeader', (state) => state.document);\n const schema = usePreviewContext('PreviewHeader', (state) => state.schema);\n const meta = usePreviewContext('PreviewHeader', (state) => state.meta);\n const hasDraftAndPublish = schema?.options?.draftAndPublish ?? false;\n const documentStatus = getDocumentStatus(document, meta);\n\n const handleTabChange = (status: string) => {\n if (status === 'published' || status === 'draft') {\n setQuery({ status }, 'push', true);\n }\n };\n\n if (!hasDraftAndPublish) {\n return null;\n }\n\n return (\n <>\n <Tabs.Root variant=\"simple\" value={query.status || 'draft'} onValueChange={handleTabChange}>\n <Tabs.List\n aria-label={formatMessage({\n id: 'preview.tabs.label',\n defaultMessage: 'Document status',\n })}\n >\n <StatusTab value=\"draft\">\n {formatMessage({\n id: 'content-manager.containers.List.draft',\n defaultMessage: 'draft',\n })}\n </StatusTab>\n <StatusTab value=\"published\" disabled={documentStatus === 'draft'}>\n {formatMessage({\n id: 'content-manager.containers.List.published',\n defaultMessage: 'published',\n })}\n </StatusTab>\n </Tabs.List>\n </Tabs.Root>\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PreviewHeader\n * -----------------------------------------------------------------------------------------------*/\n\nconst UnstablePreviewHeader = () => {\n // Get the document title\n const title = usePreviewContext('PreviewHeader', (state) => state.title);\n\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const { copy } = useClipboard();\n\n const handleCopyLink = () => {\n copy(window.location.href);\n toggleNotification({\n message: formatMessage({\n id: 'content-manager.preview.copy.success',\n defaultMessage: 'Copied preview link',\n }),\n type: 'success',\n });\n };\n\n return (\n <Flex gap={4} background=\"neutral0\" borderColor=\"neutral150\" tag=\"header\">\n {/* Title and status */}\n <TitleContainer height=\"100%\" paddingLeft={2} paddingRight={4}>\n <ClosePreviewButton />\n <PreviewTitle\n tag=\"h1\"\n title={title}\n maxWidth=\"200px\"\n fontSize={2}\n paddingLeft={2}\n paddingRight={3}\n fontWeight={600}\n >\n {title}\n </PreviewTitle>\n <Status />\n </TitleContainer>\n\n {/* Tabs and actions */}\n <Flex flex={1} paddingRight={2} justifyContent=\"space-between\">\n <PreviewTabs />\n <IconButton\n type=\"button\"\n label={formatMessage({\n id: 'preview.copy.label',\n defaultMessage: 'Copy preview link',\n })}\n onClick={handleCopyLink}\n >\n <LinkIcon />\n </IconButton>\n </Flex>\n </Flex>\n );\n};\n\nconst PreviewHeader = () => {\n // Get the document title\n const title = usePreviewContext('PreviewHeader', (state) => state.title);\n\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const { copy } = useClipboard();\n\n const handleCopyLink = () => {\n copy(window.location.href);\n toggleNotification({\n message: formatMessage({\n id: 'content-manager.preview.copy.success',\n defaultMessage: 'Copied preview link',\n }),\n type: 'success',\n });\n };\n\n return (\n <Grid.Root\n gap={3}\n gridCols={3}\n paddingLeft={2}\n paddingRight={2}\n background=\"neutral0\"\n borderColor=\"neutral150\"\n tag=\"header\"\n >\n {/* Title and status */}\n <Grid.Item xs={1} paddingTop={2} paddingBottom={2} gap={3}>\n <ClosePreviewButton />\n <PreviewTitle tag=\"h1\" fontWeight={600} fontSize={2} maxWidth=\"200px\" title={title}>\n {title}\n </PreviewTitle>\n <Status />\n </Grid.Item>\n {/* Tabs */}\n <Grid.Item xs={1} marginBottom=\"-1px\" alignItems=\"end\" margin=\"auto\">\n <PreviewTabs />\n </Grid.Item>\n {/* Copy link */}\n <Grid.Item xs={1} justifyContent=\"end\" paddingTop={2} paddingBottom={2}>\n <IconButton\n type=\"button\"\n label={formatMessage({\n id: 'preview.copy.label',\n defaultMessage: 'Copy preview link',\n })}\n onClick={handleCopyLink}\n >\n <LinkIcon />\n </IconButton>\n </Grid.Item>\n </Grid.Root>\n );\n};\n\nconst PreviewTitle = styled(Typography)`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nconst StatusTab = styled(Tabs.Trigger)`\n text-transform: uppercase;\n`;\n\nconst TitleContainer = styled(Flex)`\n border-right: 1px solid ${({ theme }) => theme.colors.neutral150};\n`;\n\nexport { PreviewHeader, UnstablePreviewHeader };\n","import * as React from 'react';\n\nimport {\n Page,\n useQueryParams,\n useRBAC,\n createContext,\n Form as FormContext,\n} from '@strapi/admin/strapi-admin';\nimport { Box, Flex, FocusTrap, Portal } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useParams } from 'react-router-dom';\n\nimport { GetPreviewUrl } from '../../../../shared/contracts/preview';\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { DocumentRBAC } from '../../features/DocumentRBAC';\nimport { type UseDocument, useDocument } from '../../hooks/useDocument';\nimport { type EditLayout, useDocumentLayout } from '../../hooks/useDocumentLayout';\nimport { buildValidParams } from '../../utils/api';\nimport { PreviewContent, UnstablePreviewContent } from '../components/PreviewContent';\nimport { PreviewHeader, UnstablePreviewHeader } from '../components/PreviewHeader';\nimport { useGetPreviewUrlQuery } from '../services/preview';\n\nimport type { UID } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * PreviewProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface PreviewContextValue {\n url: string;\n title: string;\n document: NonNullable<ReturnType<UseDocument>['document']>;\n meta: NonNullable<ReturnType<UseDocument>['meta']>;\n schema: NonNullable<ReturnType<UseDocument>['schema']>;\n layout: EditLayout;\n}\n\nconst [PreviewProvider, usePreviewContext] = createContext<PreviewContextValue>('PreviewPage');\n\n/* -------------------------------------------------------------------------------------------------\n * PreviewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst PreviewPage = () => {\n const { formatMessage } = useIntl();\n\n // Read all the necessary data from the URL to find the right preview URL\n const {\n slug: model,\n id: documentId,\n collectionType,\n } = useParams<{\n slug: UID.ContentType;\n id: string;\n collectionType: string;\n }>();\n const [{ query }] = useQueryParams<{\n plugins?: Record<string, unknown>;\n }>();\n\n const params = React.useMemo(() => buildValidParams(query), [query]);\n\n if (!collectionType) {\n throw new Error('Could not find collectionType in url params');\n }\n\n if (!model) {\n throw new Error('Could not find model in url params');\n }\n\n // Only collection types must have a documentId\n if (collectionType === COLLECTION_TYPES && !documentId) {\n throw new Error('Could not find documentId in url params');\n }\n\n const previewUrlResponse = useGetPreviewUrlQuery({\n params: {\n contentType: model,\n },\n query: {\n documentId,\n locale: params.locale,\n status: params.status as GetPreviewUrl.Request['query']['status'],\n },\n });\n\n const documentResponse = useDocument({\n model,\n collectionType,\n documentId,\n params,\n });\n\n const documentLayoutResponse = useDocumentLayout(model);\n\n if (\n documentResponse.isLoading ||\n previewUrlResponse.isLoading ||\n documentLayoutResponse.isLoading\n ) {\n return <Page.Loading />;\n }\n\n if (\n previewUrlResponse.error ||\n documentLayoutResponse.error ||\n !documentResponse.document ||\n !documentResponse.meta ||\n !documentResponse.schema\n ) {\n return <Page.Error />;\n }\n\n if (!previewUrlResponse.data?.data?.url) {\n return <Page.NoData />;\n }\n\n const documentTitle = documentResponse.getTitle(documentLayoutResponse.edit.settings.mainField);\n\n return (\n <>\n <Page.Title>\n {formatMessage(\n {\n id: 'content-manager.preview.page-title',\n defaultMessage: '{contentType} preview',\n },\n {\n contentType: documentTitle,\n }\n )}\n </Page.Title>\n <PreviewProvider\n url={previewUrlResponse.data.data.url}\n document={documentResponse.document}\n title={documentTitle}\n meta={documentResponse.meta}\n schema={documentResponse.schema}\n layout={documentLayoutResponse.edit}\n >\n <FormContext method=\"POST\" initialValues={documentResponse.document} height=\"100%\">\n <Flex direction=\"column\" height=\"100%\" alignItems=\"stretch\">\n {window.strapi.future.isEnabled('unstablePreviewSideEditor') ? (\n <>\n <UnstablePreviewHeader />\n <UnstablePreviewContent />\n </>\n ) : (\n <>\n <PreviewHeader />\n <PreviewContent />\n </>\n )}\n </Flex>\n </FormContext>\n </PreviewProvider>\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ProtectedPreviewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedPreviewPageImpl = () => {\n const { slug: model } = useParams<{\n slug: string;\n }>();\n const {\n permissions = [],\n isLoading,\n error,\n } = useRBAC([\n { action: 'plugin::content-manager.explorer.read', subject: model },\n { action: 'plugin::content-manager.explorer.update', subject: model },\n ]);\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !model) {\n return (\n <Box\n height=\"100vh\"\n width=\"100vw\"\n position=\"fixed\"\n top={0}\n left={0}\n zIndex={2}\n background=\"neutral0\"\n >\n <Page.Error />\n </Box>\n );\n }\n\n return (\n <Box\n height=\"100vh\"\n width=\"100vw\"\n position=\"fixed\"\n top={0}\n left={0}\n zIndex={2}\n background=\"neutral0\"\n >\n <Page.Protect\n permissions={permissions.filter((permission) =>\n permission.action.includes('explorer.read')\n )}\n >\n <DocumentRBAC permissions={permissions}>\n <PreviewPage />\n </DocumentRBAC>\n </Page.Protect>\n </Box>\n );\n};\n\nconst ProtectedPreviewPage = () => {\n return (\n <Portal>\n <FocusTrap>\n <ProtectedPreviewPageImpl />\n </FocusTrap>\n </Portal>\n );\n};\n\nexport { ProtectedPreviewPage, usePreviewContext };\n"],"names":["UnstablePreviewContent","previewUrl","usePreviewContext","state","url","layout","formatMessage","useIntl","_jsxs","Flex","flex","overflow","alignItems","_jsx","Box","borderWidth","borderColor","padding","FormLayout","hasBackground","src","title","id","defaultMessage","height","tag","PreviewContent","width","ClosePreviewButton","query","useQueryParams","canGoBack","useHistory","goBack","history","locationIndex","currentLocationIndex","historyTo","at","undefined","fallback","pathname","search","stringify","encode","toWithFallback","handleClick","e","preventDefault","IconButton","variant","Link","relative","to","onClick","label","Cross","Status","document","schema","meta","hasDraftAndPublished","options","draftAndPublish","status","getDocumentStatus","DocumentStatus","size","PreviewTabs","setQuery","hasDraftAndPublish","documentStatus","handleTabChange","_Fragment","Tabs","Root","value","onValueChange","List","aria-label","StatusTab","disabled","UnstablePreviewHeader","toggleNotification","useNotification","copy","useClipboard","handleCopyLink","window","location","href","message","type","gap","background","TitleContainer","paddingLeft","paddingRight","PreviewTitle","maxWidth","fontSize","fontWeight","justifyContent","LinkIcon","PreviewHeader","Grid","gridCols","Item","xs","paddingTop","paddingBottom","marginBottom","margin","styled","Typography","Trigger","theme","colors","neutral150","PreviewProvider","createContext","PreviewPage","slug","model","documentId","collectionType","useParams","params","React","useMemo","buildValidParams","Error","COLLECTION_TYPES","previewUrlResponse","useGetPreviewUrlQuery","contentType","locale","documentResponse","useDocument","documentLayoutResponse","useDocumentLayout","isLoading","Page","Loading","error","data","NoData","documentTitle","getTitle","edit","settings","mainField","Title","FormContext","method","initialValues","direction","strapi","future","isEnabled","ProtectedPreviewPageImpl","permissions","useRBAC","action","subject","position","top","left","zIndex","Protect","filter","permission","includes","DocumentRBAC","ProtectedPreviewPage","Portal","FocusTrap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA;AACzB,gBAAA,QAAA,gBAAApJ,GAAC4G,CAAAA,WAAAA,EAAAA,EAAAA;;;;AAKX,CAAA;AAEA,MAAMqD,oBAAuB,GAAA,IAAA;AAC3B,IAAA,qBACEjK,GAACkK,CAAAA,MAAAA,EAAAA;AACC,QAAA,QAAA,gBAAAlK,GAACmK,CAAAA,SAAAA,EAAAA;AACC,YAAA,QAAA,gBAAAnK,GAACmJ,CAAAA,wBAAAA,EAAAA,EAAAA;;;AAIT;;;;"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Preview-CXtc9yEV.js","sources":["../../../admin/src/preview/components/PreviewContent.tsx","../../../admin/src/preview/components/PreviewHeader.tsx","../../../admin/src/preview/pages/Preview.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Box, Flex } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\n\nimport { FormLayout } from '../../pages/EditView/components/FormLayout';\nimport { usePreviewContext } from '../pages/Preview';\n\nconst UnstablePreviewContent = () => {\n const previewUrl = usePreviewContext('PreviewContent', (state) => state.url);\n const layout = usePreviewContext('PreviewContent', (state) => state.layout);\n\n const { formatMessage } = useIntl();\n\n return (\n <Flex flex={1} overflow=\"auto\" alignItems=\"stretch\">\n <Box overflow=\"auto\" flex={1} borderWidth=\"0 1px 0 0\" borderColor=\"neutral150\" padding={6}>\n <FormLayout layout={layout.layout} hasBackground />\n </Box>\n <Box\n src={previewUrl}\n /**\n * For some reason, changing an iframe's src tag causes the browser to add a new item in the\n * history stack. This is an issue for us as it means clicking the back button will not let us\n * go back to the edit view. To fix it, we need to trick the browser into thinking this is a\n * different iframe when the preview URL changes. So we set a key prop to force React\n * to mount a different node when the src changes.\n */\n key={previewUrl}\n title={formatMessage({\n id: 'content-manager.preview.panel.title',\n defaultMessage: 'Preview',\n })}\n flex={1}\n height=\"100%\"\n borderWidth={0}\n tag=\"iframe\"\n />\n </Flex>\n );\n};\n\nconst PreviewContent = () => {\n const previewUrl = usePreviewContext('PreviewContent', (state) => state.url);\n\n const { formatMessage } = useIntl();\n\n return (\n <Box\n src={previewUrl}\n /**\n * For some reason, changing an iframe's src tag causes the browser to add a new item in the\n * history stack. This is an issue for us as it means clicking the back button will not let us\n * go back to the edit view. To fix it, we need to trick the browser into thinking this is a\n * different iframe when the preview URL changes. So we set a key prop to force React\n * to mount a different node when the src changes.\n */\n key={previewUrl}\n title={formatMessage({\n id: 'content-manager.preview.panel.title',\n defaultMessage: 'Preview',\n })}\n width=\"100%\"\n height=\"100%\"\n borderWidth={0}\n tag=\"iframe\"\n />\n );\n};\n\nexport { PreviewContent, UnstablePreviewContent };\n","import * as React from 'react';\n\nimport {\n useClipboard,\n useHistory,\n useNotification,\n useQueryParams,\n} from '@strapi/admin/strapi-admin';\nimport { IconButton, Tabs, Typography, Grid, Flex } from '@strapi/design-system';\nimport { Cross, Link as LinkIcon } from '@strapi/icons';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { Link, type To } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { DocumentStatus } from '../../pages/EditView/components/DocumentStatus';\nimport { getDocumentStatus } from '../../pages/EditView/EditViewPage';\nimport { usePreviewContext } from '../pages/Preview';\n\n/* -------------------------------------------------------------------------------------------------\n * ClosePreviewButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst ClosePreviewButton = () => {\n const [{ query }] = useQueryParams<{\n plugins?: Record<string, unknown>;\n }>();\n const { formatMessage } = useIntl();\n\n const canGoBack = useHistory('BackButton', (state) => state.canGoBack);\n const goBack = useHistory('BackButton', (state) => state.goBack);\n const history = useHistory('BackButton', (state) => state.history);\n const locationIndex = useHistory('BackButton', (state) => state.currentLocationIndex);\n\n /**\n * Get the link destination from the history.\n * Rely on a fallback (the parent edit view page) if there's no page to go back .\n */\n const historyTo = canGoBack ? history.at(locationIndex - 2) : undefined;\n const fallback = {\n pathname: '..',\n search: stringify(query, { encode: false }),\n } satisfies To;\n const toWithFallback = historyTo ?? fallback;\n\n const handleClick = (e: React.MouseEvent) => {\n if (canGoBack) {\n // Prevent normal link behavior, go back in the history stack instead\n e.preventDefault();\n goBack();\n return;\n }\n\n // Otherwise rely on native link behavior to go back to the edit view. We don't use navigate()\n // here in order to get the relative=\"path\" functionality from the Link component.\n };\n\n return (\n <IconButton\n variant=\"ghost\"\n tag={Link}\n relative=\"path\"\n to={toWithFallback}\n onClick={handleClick}\n label={formatMessage({\n id: 'content-manager.preview.header.close',\n defaultMessage: 'Close preview',\n })}\n >\n <Cross />\n </IconButton>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Status\n * -----------------------------------------------------------------------------------------------*/\n\nconst Status = () => {\n // Get status\n const document = usePreviewContext('PreviewHeader', (state) => state.document);\n const schema = usePreviewContext('PreviewHeader', (state) => state.schema);\n const meta = usePreviewContext('PreviewHeader', (state) => state.meta);\n const hasDraftAndPublished = schema?.options?.draftAndPublish ?? false;\n\n if (!hasDraftAndPublished) {\n return null;\n }\n\n const status = getDocumentStatus(document, meta);\n\n return <DocumentStatus status={status} size=\"XS\" />;\n};\n\nconst PreviewTabs = () => {\n const { formatMessage } = useIntl();\n\n // URL query params\n const [{ query }, setQuery] = useQueryParams<{ status: 'draft' | 'published' }>();\n\n // Get status\n const document = usePreviewContext('PreviewHeader', (state) => state.document);\n const schema = usePreviewContext('PreviewHeader', (state) => state.schema);\n const meta = usePreviewContext('PreviewHeader', (state) => state.meta);\n const hasDraftAndPublish = schema?.options?.draftAndPublish ?? false;\n const documentStatus = getDocumentStatus(document, meta);\n\n const handleTabChange = (status: string) => {\n if (status === 'published' || status === 'draft') {\n setQuery({ status }, 'push', true);\n }\n };\n\n if (!hasDraftAndPublish) {\n return null;\n }\n\n return (\n <>\n <Tabs.Root variant=\"simple\" value={query.status || 'draft'} onValueChange={handleTabChange}>\n <Tabs.List\n aria-label={formatMessage({\n id: 'preview.tabs.label',\n defaultMessage: 'Document status',\n })}\n >\n <StatusTab value=\"draft\">\n {formatMessage({\n id: 'content-manager.containers.List.draft',\n defaultMessage: 'draft',\n })}\n </StatusTab>\n <StatusTab value=\"published\" disabled={documentStatus === 'draft'}>\n {formatMessage({\n id: 'content-manager.containers.List.published',\n defaultMessage: 'published',\n })}\n </StatusTab>\n </Tabs.List>\n </Tabs.Root>\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PreviewHeader\n * -----------------------------------------------------------------------------------------------*/\n\nconst UnstablePreviewHeader = () => {\n // Get the document title\n const title = usePreviewContext('PreviewHeader', (state) => state.title);\n\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const { copy } = useClipboard();\n\n const handleCopyLink = () => {\n copy(window.location.href);\n toggleNotification({\n message: formatMessage({\n id: 'content-manager.preview.copy.success',\n defaultMessage: 'Copied preview link',\n }),\n type: 'success',\n });\n };\n\n return (\n <Flex gap={4} background=\"neutral0\" borderColor=\"neutral150\" tag=\"header\">\n {/* Title and status */}\n <TitleContainer height=\"100%\" paddingLeft={2} paddingRight={4}>\n <ClosePreviewButton />\n <PreviewTitle\n tag=\"h1\"\n title={title}\n maxWidth=\"200px\"\n fontSize={2}\n paddingLeft={2}\n paddingRight={3}\n fontWeight={600}\n >\n {title}\n </PreviewTitle>\n <Status />\n </TitleContainer>\n\n {/* Tabs and actions */}\n <Flex flex={1} paddingRight={2} justifyContent=\"space-between\">\n <PreviewTabs />\n <IconButton\n type=\"button\"\n label={formatMessage({\n id: 'preview.copy.label',\n defaultMessage: 'Copy preview link',\n })}\n onClick={handleCopyLink}\n >\n <LinkIcon />\n </IconButton>\n </Flex>\n </Flex>\n );\n};\n\nconst PreviewHeader = () => {\n // Get the document title\n const title = usePreviewContext('PreviewHeader', (state) => state.title);\n\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const { copy } = useClipboard();\n\n const handleCopyLink = () => {\n copy(window.location.href);\n toggleNotification({\n message: formatMessage({\n id: 'content-manager.preview.copy.success',\n defaultMessage: 'Copied preview link',\n }),\n type: 'success',\n });\n };\n\n return (\n <Grid.Root\n gap={3}\n gridCols={3}\n paddingLeft={2}\n paddingRight={2}\n background=\"neutral0\"\n borderColor=\"neutral150\"\n tag=\"header\"\n >\n {/* Title and status */}\n <Grid.Item xs={1} paddingTop={2} paddingBottom={2} gap={3}>\n <ClosePreviewButton />\n <PreviewTitle tag=\"h1\" fontWeight={600} fontSize={2} maxWidth=\"200px\" title={title}>\n {title}\n </PreviewTitle>\n <Status />\n </Grid.Item>\n {/* Tabs */}\n <Grid.Item xs={1} marginBottom=\"-1px\" alignItems=\"end\" margin=\"auto\">\n <PreviewTabs />\n </Grid.Item>\n {/* Copy link */}\n <Grid.Item xs={1} justifyContent=\"end\" paddingTop={2} paddingBottom={2}>\n <IconButton\n type=\"button\"\n label={formatMessage({\n id: 'preview.copy.label',\n defaultMessage: 'Copy preview link',\n })}\n onClick={handleCopyLink}\n >\n <LinkIcon />\n </IconButton>\n </Grid.Item>\n </Grid.Root>\n );\n};\n\nconst PreviewTitle = styled(Typography)`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n`;\n\nconst StatusTab = styled(Tabs.Trigger)`\n text-transform: uppercase;\n`;\n\nconst TitleContainer = styled(Flex)`\n border-right: 1px solid ${({ theme }) => theme.colors.neutral150};\n`;\n\nexport { PreviewHeader, UnstablePreviewHeader };\n","import * as React from 'react';\n\nimport {\n Page,\n useQueryParams,\n useRBAC,\n createContext,\n Form as FormContext,\n} from '@strapi/admin/strapi-admin';\nimport { Box, Flex, FocusTrap, Portal } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useParams } from 'react-router-dom';\n\nimport { GetPreviewUrl } from '../../../../shared/contracts/preview';\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { DocumentRBAC } from '../../features/DocumentRBAC';\nimport { type UseDocument, useDocument } from '../../hooks/useDocument';\nimport { type EditLayout, useDocumentLayout } from '../../hooks/useDocumentLayout';\nimport { buildValidParams } from '../../utils/api';\nimport { PreviewContent, UnstablePreviewContent } from '../components/PreviewContent';\nimport { PreviewHeader, UnstablePreviewHeader } from '../components/PreviewHeader';\nimport { useGetPreviewUrlQuery } from '../services/preview';\n\nimport type { UID } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * PreviewProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface PreviewContextValue {\n url: string;\n title: string;\n document: NonNullable<ReturnType<UseDocument>['document']>;\n meta: NonNullable<ReturnType<UseDocument>['meta']>;\n schema: NonNullable<ReturnType<UseDocument>['schema']>;\n layout: EditLayout;\n}\n\nconst [PreviewProvider, usePreviewContext] = createContext<PreviewContextValue>('PreviewPage');\n\n/* -------------------------------------------------------------------------------------------------\n * PreviewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst PreviewPage = () => {\n const { formatMessage } = useIntl();\n\n // Read all the necessary data from the URL to find the right preview URL\n const {\n slug: model,\n id: documentId,\n collectionType,\n } = useParams<{\n slug: UID.ContentType;\n id: string;\n collectionType: string;\n }>();\n const [{ query }] = useQueryParams<{\n plugins?: Record<string, unknown>;\n }>();\n\n const params = React.useMemo(() => buildValidParams(query), [query]);\n\n if (!collectionType) {\n throw new Error('Could not find collectionType in url params');\n }\n\n if (!model) {\n throw new Error('Could not find model in url params');\n }\n\n // Only collection types must have a documentId\n if (collectionType === COLLECTION_TYPES && !documentId) {\n throw new Error('Could not find documentId in url params');\n }\n\n const previewUrlResponse = useGetPreviewUrlQuery({\n params: {\n contentType: model,\n },\n query: {\n documentId,\n locale: params.locale,\n status: params.status as GetPreviewUrl.Request['query']['status'],\n },\n });\n\n const documentResponse = useDocument({\n model,\n collectionType,\n documentId,\n params,\n });\n\n const documentLayoutResponse = useDocumentLayout(model);\n\n if (\n documentResponse.isLoading ||\n previewUrlResponse.isLoading ||\n documentLayoutResponse.isLoading\n ) {\n return <Page.Loading />;\n }\n\n if (\n previewUrlResponse.error ||\n documentLayoutResponse.error ||\n !documentResponse.document ||\n !documentResponse.meta ||\n !documentResponse.schema\n ) {\n return <Page.Error />;\n }\n\n if (!previewUrlResponse.data?.data?.url) {\n return <Page.NoData />;\n }\n\n const documentTitle = documentResponse.getTitle(documentLayoutResponse.edit.settings.mainField);\n\n return (\n <>\n <Page.Title>\n {formatMessage(\n {\n id: 'content-manager.preview.page-title',\n defaultMessage: '{contentType} preview',\n },\n {\n contentType: documentTitle,\n }\n )}\n </Page.Title>\n <PreviewProvider\n url={previewUrlResponse.data.data.url}\n document={documentResponse.document}\n title={documentTitle}\n meta={documentResponse.meta}\n schema={documentResponse.schema}\n layout={documentLayoutResponse.edit}\n >\n <FormContext method=\"POST\" initialValues={documentResponse.document} height=\"100%\">\n <Flex direction=\"column\" height=\"100%\" alignItems=\"stretch\">\n {window.strapi.future.isEnabled('unstablePreviewSideEditor') ? (\n <>\n <UnstablePreviewHeader />\n <UnstablePreviewContent />\n </>\n ) : (\n <>\n <PreviewHeader />\n <PreviewContent />\n </>\n )}\n </Flex>\n </FormContext>\n </PreviewProvider>\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ProtectedPreviewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedPreviewPageImpl = () => {\n const { slug: model } = useParams<{\n slug: string;\n }>();\n const {\n permissions = [],\n isLoading,\n error,\n } = useRBAC([\n { action: 'plugin::content-manager.explorer.read', subject: model },\n { action: 'plugin::content-manager.explorer.update', subject: model },\n ]);\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !model) {\n return (\n <Box\n height=\"100vh\"\n width=\"100vw\"\n position=\"fixed\"\n top={0}\n left={0}\n zIndex={2}\n background=\"neutral0\"\n >\n <Page.Error />\n </Box>\n );\n }\n\n return (\n <Box\n height=\"100vh\"\n width=\"100vw\"\n position=\"fixed\"\n top={0}\n left={0}\n zIndex={2}\n background=\"neutral0\"\n >\n <Page.Protect\n permissions={permissions.filter((permission) =>\n permission.action.includes('explorer.read')\n )}\n >\n <DocumentRBAC permissions={permissions}>\n <PreviewPage />\n </DocumentRBAC>\n </Page.Protect>\n </Box>\n );\n};\n\nconst ProtectedPreviewPage = () => {\n return (\n <Portal>\n <FocusTrap>\n <ProtectedPreviewPageImpl />\n </FocusTrap>\n </Portal>\n );\n};\n\nexport { ProtectedPreviewPage, usePreviewContext };\n"],"names":["UnstablePreviewContent","previewUrl","usePreviewContext","state","url","layout","formatMessage","useIntl","_jsxs","Flex","flex","overflow","alignItems","_jsx","Box","borderWidth","borderColor","padding","FormLayout","hasBackground","src","title","id","defaultMessage","height","tag","PreviewContent","width","ClosePreviewButton","query","useQueryParams","canGoBack","useHistory","goBack","history","locationIndex","currentLocationIndex","historyTo","at","undefined","fallback","pathname","search","stringify","encode","toWithFallback","handleClick","e","preventDefault","IconButton","variant","Link","relative","to","onClick","label","Cross","Status","document","schema","meta","hasDraftAndPublished","options","draftAndPublish","status","getDocumentStatus","DocumentStatus","size","PreviewTabs","setQuery","hasDraftAndPublish","documentStatus","handleTabChange","_Fragment","Tabs","Root","value","onValueChange","List","aria-label","StatusTab","disabled","UnstablePreviewHeader","toggleNotification","useNotification","copy","useClipboard","handleCopyLink","window","location","href","message","type","gap","background","TitleContainer","paddingLeft","paddingRight","PreviewTitle","maxWidth","fontSize","fontWeight","justifyContent","LinkIcon","PreviewHeader","Grid","gridCols","Item","xs","paddingTop","paddingBottom","marginBottom","margin","styled","Typography","Trigger","theme","colors","neutral150","PreviewProvider","createContext","PreviewPage","slug","model","documentId","collectionType","useParams","params","React","useMemo","buildValidParams","Error","COLLECTION_TYPES","previewUrlResponse","useGetPreviewUrlQuery","contentType","locale","documentResponse","useDocument","documentLayoutResponse","useDocumentLayout","isLoading","Page","Loading","error","data","NoData","documentTitle","getTitle","edit","settings","mainField","Title","FormContext","method","initialValues","direction","strapi","future","isEnabled","ProtectedPreviewPageImpl","permissions","useRBAC","action","subject","position","top","left","zIndex","Protect","filter","permission","includes","DocumentRBAC","ProtectedPreviewPage","Portal","FocusTrap"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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