@strapi/content-manager 5.12.4 → 5.12.6

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.
Files changed (36) hide show
  1. package/dist/admin/components/Widgets.js +161 -0
  2. package/dist/admin/components/Widgets.js.map +1 -0
  3. package/dist/admin/components/Widgets.mjs +158 -0
  4. package/dist/admin/components/Widgets.mjs.map +1 -0
  5. package/dist/admin/index.js +41 -2
  6. package/dist/admin/index.js.map +1 -1
  7. package/dist/admin/index.mjs +42 -3
  8. package/dist/admin/index.mjs.map +1 -1
  9. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.js +7 -12
  10. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.js.map +1 -1
  11. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.mjs +8 -13
  12. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.mjs.map +1 -1
  13. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.js +46 -95
  14. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.js.map +1 -1
  15. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.mjs +48 -78
  16. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.mjs.map +1 -1
  17. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.js +50 -97
  18. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.js.map +1 -1
  19. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.mjs +51 -79
  20. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.mjs.map +1 -1
  21. package/dist/admin/preview/components/PreviewHeader.js +1 -1
  22. package/dist/admin/preview/components/PreviewHeader.js.map +1 -1
  23. package/dist/admin/preview/components/PreviewHeader.mjs +1 -1
  24. package/dist/admin/preview/components/PreviewHeader.mjs.map +1 -1
  25. package/dist/admin/services/homepage.js +26 -0
  26. package/dist/admin/services/homepage.js.map +1 -0
  27. package/dist/admin/services/homepage.mjs +24 -0
  28. package/dist/admin/services/homepage.mjs.map +1 -0
  29. package/dist/admin/src/components/Widgets.d.ts +3 -0
  30. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.d.ts +2 -2
  31. package/dist/admin/src/services/homepage.d.ts +5 -0
  32. package/dist/server/src/services/homepage.d.ts +11 -0
  33. package/dist/server/src/services/homepage.d.ts.map +1 -0
  34. package/dist/shared/contracts/homepage.d.ts +25 -0
  35. package/dist/shared/contracts/homepage.d.ts.map +1 -0
  36. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"EditorLayout.mjs","sources":["../../../../../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Box, Flex, FocusTrap, Portal, IconButton, FlexComponent } from '@strapi/design-system';\nimport { Collapse } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { css, styled } from 'styled-components';\n\nimport { getTranslation } from '../../../../../utils/translations';\n\nimport { useBlocksEditorContext } from './BlocksEditor';\n\nconst CollapseIconButton = styled(IconButton)`\n position: absolute;\n bottom: 1.2rem;\n right: 1.2rem;\n`;\n\nconst ExpandWrapper = styled<FlexComponent>(Flex)`\n // Background with 20% opacity\n background: ${({ theme }) => `${theme.colors.neutral800}1F`};\n`;\n\ninterface EditorLayoutProps {\n children: React.ReactNode;\n error?: string;\n onCollapse: () => void;\n disabled: boolean;\n ariaDescriptionId: string;\n}\n\nconst EditorLayout = ({\n children,\n error,\n disabled,\n onCollapse,\n ariaDescriptionId,\n}: EditorLayoutProps) => {\n const { formatMessage } = useIntl();\n const { isExpandedMode } = useBlocksEditorContext('editorLayout');\n\n React.useEffect(() => {\n if (isExpandedMode) {\n document.body.classList.add('lock-body-scroll');\n }\n\n return () => {\n document.body.classList.remove('lock-body-scroll');\n };\n }, [isExpandedMode]);\n\n if (isExpandedMode) {\n return (\n <Portal role=\"dialog\" aria-modal={false}>\n <FocusTrap onEscape={onCollapse}>\n <ExpandWrapper\n position=\"fixed\"\n top={0}\n left={0}\n right={0}\n bottom={0}\n zIndex={4}\n justifyContent=\"center\"\n onClick={onCollapse}\n >\n <Box<'div'>\n background=\"neutral0\"\n hasRadius\n shadow=\"popupShadow\"\n overflow=\"hidden\"\n width=\"90%\"\n height=\"90%\"\n onClick={(e) => e.stopPropagation()}\n aria-describedby={ariaDescriptionId}\n position=\"relative\"\n >\n <Flex height=\"100%\" alignItems=\"flex-start\" direction=\"column\">\n {children}\n <CollapseIconButton\n label={formatMessage({\n id: getTranslation('components.Blocks.collapse'),\n defaultMessage: 'Collapse',\n })}\n onClick={onCollapse}\n >\n <Collapse />\n </CollapseIconButton>\n </Flex>\n </Box>\n </ExpandWrapper>\n </FocusTrap>\n </Portal>\n );\n }\n\n return (\n <InputWrapper\n direction=\"column\"\n alignItems=\"flex-start\"\n height=\"512px\"\n $disabled={disabled}\n $hasError={Boolean(error)}\n style={{ overflow: 'hidden' }}\n aria-describedby={ariaDescriptionId}\n position=\"relative\"\n >\n {children}\n </InputWrapper>\n );\n};\n\nconst InputWrapper = styled<FlexComponent>(Flex)<{ $disabled?: boolean; $hasError?: boolean }>`\n border: 1px solid\n ${({ theme, $hasError }) => ($hasError ? theme.colors.danger600 : theme.colors.neutral200)};\n border-radius: ${({ theme }) => theme.borderRadius};\n background: ${({ theme }) => theme.colors.neutral0};\n\n ${({ theme, $hasError = false }) => css`\n outline: none;\n box-shadow: 0;\n transition-property: border-color, box-shadow, fill;\n transition-duration: 0.2s;\n\n &:focus-within {\n border: 1px solid ${$hasError ? theme.colors.danger600 : theme.colors.primary600};\n box-shadow: ${$hasError ? theme.colors.danger600 : theme.colors.primary600} 0px 0px 0px 2px;\n }\n `}\n\n ${({ theme, $disabled }) =>\n $disabled\n ? css`\n color: ${theme.colors.neutral600};\n background: ${theme.colors.neutral150};\n `\n : undefined}\n`;\n\nexport { EditorLayout };\n"],"names":["CollapseIconButton","styled","IconButton","ExpandWrapper","Flex","theme","colors","neutral800","EditorLayout","children","error","disabled","onCollapse","ariaDescriptionId","formatMessage","useIntl","isExpandedMode","useBlocksEditorContext","React","useEffect","document","body","classList","add","remove","_jsx","Portal","role","aria-modal","FocusTrap","onEscape","position","top","left","right","bottom","zIndex","justifyContent","onClick","Box","background","hasRadius","shadow","overflow","width","height","e","stopPropagation","aria-describedby","_jsxs","alignItems","direction","label","id","getTranslation","defaultMessage","Collapse","InputWrapper","$disabled","$hasError","Boolean","style","danger600","neutral200","borderRadius","neutral0","css","primary600","neutral600","neutral150","undefined"],"mappings":";;;;;;;;;AAWA,MAAMA,kBAAAA,GAAqBC,MAAOC,CAAAA,UAAAA,CAAW;;;;AAI7C,CAAC;AAED,MAAMC,aAAAA,GAAgBF,MAAsBG,CAAAA,IAAAA,CAAK;;AAEnC,cAAA,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAK,CAAC,EAAEA,KAAMC,CAAAA,MAAM,CAACC,UAAU,CAAC,EAAE,CAAC,CAAC;AAC9D,CAAC;AAUD,MAAMC,YAAe,GAAA,CAAC,EACpBC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,UAAU,EACVC,iBAAiB,EACC,GAAA;IAClB,MAAM,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;AAC1B,IAAA,MAAM,EAAEC,cAAc,EAAE,GAAGC,sBAAuB,CAAA,cAAA,CAAA;AAElDC,IAAAA,KAAAA,CAAMC,SAAS,CAAC,IAAA;AACd,QAAA,IAAIH,cAAgB,EAAA;AAClBI,YAAAA,QAAAA,CAASC,IAAI,CAACC,SAAS,CAACC,GAAG,CAAC,kBAAA,CAAA;AAC9B;QAEA,OAAO,IAAA;AACLH,YAAAA,QAAAA,CAASC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAC,kBAAA,CAAA;AACjC,SAAA;KACC,EAAA;AAACR,QAAAA;AA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MC,CAAAA,MAAM,CAAC8D,UAAU,CAAC;AACrB,sBAAA,EAAE/D,KAAMC,CAAAA,MAAM,CAAC+D,UAAU,CAAC;AACxC,QAAA,CAAC,GACDC,SAAU;AAClB,CAAC;;;;"}
1
+ {"version":3,"file":"EditorLayout.mjs","sources":["../../../../../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Flex, IconButton, FlexComponent, Modal } from '@strapi/design-system';\nimport { Collapse } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { css, styled } from 'styled-components';\n\nimport { getTranslation } from '../../../../../utils/translations';\n\nimport { useBlocksEditorContext } from './BlocksEditor';\n\ninterface EditorLayoutProps {\n children: React.ReactNode;\n error?: string;\n onToggleExpand: () => void;\n disabled: boolean;\n ariaDescriptionId: string;\n}\n\nconst EditorLayout = ({\n children,\n error,\n disabled,\n onToggleExpand,\n ariaDescriptionId,\n}: EditorLayoutProps) => {\n const { formatMessage } = useIntl();\n const { isExpandedMode } = useBlocksEditorContext('editorLayout');\n\n return (\n <>\n {isExpandedMode && (\n <Modal.Root open={isExpandedMode} onOpenChange={onToggleExpand}>\n <Modal.Content style={{ maxWidth: 'unset', width: 'unset' }}>\n <Flex height=\"90vh\" width=\"90vw\" alignItems=\"flex-start\" direction=\"column\">\n {children}\n <IconButton\n position=\"absolute\"\n bottom=\"1.2rem\"\n right=\"1.2rem\"\n shadow=\"filterShadow\"\n label={formatMessage({\n id: getTranslation('components.Blocks.collapse'),\n defaultMessage: 'Collapse',\n })}\n onClick={onToggleExpand}\n >\n <Collapse />\n </IconButton>\n </Flex>\n </Modal.Content>\n </Modal.Root>\n )}\n <InputWrapper\n direction=\"column\"\n alignItems=\"flex-start\"\n height=\"512px\"\n $disabled={disabled}\n $hasError={Boolean(error)}\n style={{ overflow: 'hidden' }}\n aria-describedby={ariaDescriptionId}\n position=\"relative\"\n >\n {!isExpandedMode && children}\n </InputWrapper>\n </>\n );\n};\n\nconst InputWrapper = styled<FlexComponent>(Flex)<{ $disabled?: boolean; $hasError?: boolean }>`\n border: 1px solid\n ${({ theme, $hasError }) => ($hasError ? theme.colors.danger600 : theme.colors.neutral200)};\n border-radius: ${({ theme }) => theme.borderRadius};\n background: ${({ theme }) => theme.colors.neutral0};\n\n ${({ theme, $hasError = false }) => css`\n outline: none;\n box-shadow: 0;\n transition-property: border-color, box-shadow, fill;\n transition-duration: 0.2s;\n\n &:focus-within {\n border: 1px solid ${$hasError ? theme.colors.danger600 : theme.colors.primary600};\n box-shadow: ${$hasError ? theme.colors.danger600 : theme.colors.primary600} 0px 0px 0px 2px;\n }\n `}\n\n ${({ theme, $disabled }) =>\n $disabled\n ? css`\n color: ${theme.colors.neutral600};\n background: ${theme.colors.neutral150};\n `\n : undefined}\n`;\n\nexport { EditorLayout };\n"],"names":["EditorLayout","children","error","disabled","onToggleExpand","ariaDescriptionId","formatMessage","useIntl","isExpandedMode","useBlocksEditorContext","_jsxs","_Fragment","_jsx","Modal","Root","open","onOpenChange","Content","style","maxWidth","width","Flex","height","alignItems","direction","IconButton","position","bottom","right","shadow","label","id","getTranslation","defaultMessage","onClick","Collapse","InputWrapper","$disabled","$hasError","Boolean","overflow","aria-describedby","styled","theme","colors","danger600","neutral200","borderRadius","neutral0","css","primary600","neutral600","neutral150","undefined"],"mappings":";;;;;;;;;AAmBA,MAAMA,YAAe,GAAA,CAAC,EACpBC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,cAAc,EACdC,iBAAiB,EACC,GAAA;IAClB,MAAM,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;AAC1B,IAAA,MAAM,EAAEC,cAAc,EAAE,GAAGC,sBAAuB,CAAA,cAAA,CAAA;IAElD,qBACEC,IAAA,CAAAC,QAAA,EAAA;;YACGH,cACC,kBAAAI,GAAA,CAACC,MAAMC,IAAI,EAAA;gBAACC,IAAMP,EAAAA,cAAAA;gBAAgBQ,YAAcZ,EAAAA,cAAA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AACC,SAAS,GAAGF,MAAMC,MAAM,CAACE,UAAU,CAAE;AAC9E,iBAAA,EAAE,CAAC,EAAEH,KAAK,EAAE,GAAKA,KAAAA,CAAMI,YAAY,CAAC;cACvC,EAAE,CAAC,EAAEJ,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACI,QAAQ,CAAC;;EAEnD,EAAE,CAAC,EAAEL,KAAK,EAAEL,YAAY,KAAK,EAAE,GAAKW,GAAG;;;;;;;wBAOjB,EAAEX,SAAAA,GAAYK,KAAMC,CAAAA,MAAM,CAACC,SAAS,GAAGF,KAAMC,CAAAA,MAAM,CAACM,UAAU,CAAC;kBACrE,EAAEZ,SAAAA,GAAYK,KAAMC,CAAAA,MAAM,CAACC,SAAS,GAAGF,KAAMC,CAAAA,MAAM,CAACM,UAAU,CAAC;;AAE/E,EAAA,CAAC;;EAED,EAAE,CAAC,EAAEP,KAAK,EAAEN,SAAS,EAAE,GACrBA,SACIY,GAAAA,GAAG;AACM,iBAAA,EAAEN,KAAMC,CAAAA,MAAM,CAACO,UAAU,CAAC;AACrB,sBAAA,EAAER,KAAMC,CAAAA,MAAM,CAACQ,UAAU,CAAC;AACxC,QAAA,CAAC,GACDC,SAAU;AAClB,CAAC;;;;"}
@@ -1,117 +1,73 @@
1
1
  'use strict';
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
- var React = require('react');
4
+ require('react');
5
5
  var designSystem = require('@strapi/design-system');
6
6
  var Icons = require('@strapi/icons');
7
7
  var reactIntl = require('react-intl');
8
8
  var styledComponents = require('styled-components');
9
9
  var PreviewWysiwyg = require('./PreviewWysiwyg.js');
10
10
 
11
- function _interopNamespaceDefault(e) {
12
- var n = Object.create(null);
13
- if (e) {
14
- Object.keys(e).forEach(function (k) {
15
- if (k !== 'default') {
16
- var d = Object.getOwnPropertyDescriptor(e, k);
17
- Object.defineProperty(n, k, d.get ? d : {
18
- enumerable: true,
19
- get: function () { return e[k]; }
20
- });
21
- }
22
- });
23
- }
24
- n.default = e;
25
- return Object.freeze(n);
26
- }
27
-
28
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
29
-
30
11
  const EditorLayout = ({ children, isExpandMode, error, previewContent = '', onCollapse })=>{
31
12
  const { formatMessage } = reactIntl.useIntl();
32
- React__namespace.useEffect(()=>{
33
- if (isExpandMode) {
34
- document.body.classList.add('lock-body-scroll');
35
- }
36
- return ()=>{
37
- document.body.classList.remove('lock-body-scroll');
38
- };
39
- }, [
40
- isExpandMode
41
- ]);
42
13
  if (isExpandMode) {
43
- return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Portal, {
44
- role: "dialog",
45
- "aria-modal": false,
46
- children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.FocusTrap, {
47
- onEscape: onCollapse,
48
- children: /*#__PURE__*/ jsxRuntime.jsx(ExpandWrapper, {
49
- position: "fixed",
50
- top: 0,
51
- left: 0,
52
- right: 0,
53
- bottom: 0,
54
- zIndex: 4,
55
- justifyContent: "center",
56
- onClick: onCollapse,
57
- children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
58
- background: "neutral0",
59
- hasRadius: true,
60
- shadow: "popupShadow",
61
- overflow: "hidden",
62
- width: "90%",
63
- height: "90%",
64
- onClick: (e)=>e.stopPropagation(),
65
- children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
14
+ return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Root, {
15
+ open: isExpandMode,
16
+ onOpenChange: onCollapse,
17
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Modal.Content, {
18
+ style: {
19
+ maxWidth: 'unset',
20
+ width: 'unset'
21
+ },
22
+ children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
23
+ height: "90vh",
24
+ width: "90vw",
25
+ alignItems: "flex-start",
26
+ children: [
27
+ /*#__PURE__*/ jsxRuntime.jsx(BoxWithBorder, {
28
+ flex: "1",
66
29
  height: "100%",
67
- alignItems: "flex-start",
30
+ children: children
31
+ }),
32
+ /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
33
+ alignItems: "start",
34
+ direction: "column",
35
+ flex: 1,
36
+ height: "100%",
37
+ width: "100%",
68
38
  children: [
69
- /*#__PURE__*/ jsxRuntime.jsx(BoxWithBorder, {
70
- flex: "1",
71
- height: "100%",
72
- children: children
39
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
40
+ height: "4.8rem",
41
+ background: "neutral100",
42
+ justifyContent: "flex-end",
43
+ shrink: 0,
44
+ width: "100%",
45
+ children: /*#__PURE__*/ jsxRuntime.jsxs(ExpandButton, {
46
+ onClick: onCollapse,
47
+ variant: "tertiary",
48
+ size: "M",
49
+ children: [
50
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
51
+ children: formatMessage({
52
+ id: 'components.Wysiwyg.collapse',
53
+ defaultMessage: 'Collapse'
54
+ })
55
+ }),
56
+ /*#__PURE__*/ jsxRuntime.jsx(Icons.Collapse, {})
57
+ ]
58
+ })
73
59
  }),
74
- /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
75
- alignItems: "start",
76
- direction: "column",
77
- flex: 1,
60
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
61
+ position: "relative",
78
62
  height: "100%",
79
63
  width: "100%",
80
- children: [
81
- /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
82
- height: "4.8rem",
83
- background: "neutral100",
84
- justifyContent: "flex-end",
85
- shrink: 0,
86
- width: "100%",
87
- children: /*#__PURE__*/ jsxRuntime.jsxs(ExpandButton, {
88
- onClick: onCollapse,
89
- variant: "tertiary",
90
- size: "M",
91
- children: [
92
- /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
93
- children: formatMessage({
94
- id: 'components.Wysiwyg.collapse',
95
- defaultMessage: 'Collapse'
96
- })
97
- }),
98
- /*#__PURE__*/ jsxRuntime.jsx(Icons.Collapse, {})
99
- ]
100
- })
101
- }),
102
- /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
103
- position: "relative",
104
- height: "100%",
105
- width: "100%",
106
- children: /*#__PURE__*/ jsxRuntime.jsx(PreviewWysiwyg.PreviewWysiwyg, {
107
- data: previewContent
108
- })
109
- })
110
- ]
64
+ children: /*#__PURE__*/ jsxRuntime.jsx(PreviewWysiwyg.PreviewWysiwyg, {
65
+ data: previewContent
66
+ })
111
67
  })
112
68
  ]
113
69
  })
114
- })
70
+ ]
115
71
  })
116
72
  })
117
73
  });
@@ -126,9 +82,6 @@ const EditorLayout = ({ children, isExpandMode, error, previewContent = '', onCo
126
82
  children: children
127
83
  });
128
84
  };
129
- const ExpandWrapper = styledComponents.styled(designSystem.Flex)`
130
- background: ${({ theme })=>`${theme.colors.neutral800}${Math.floor(0.2 * 255).toString(16).padStart(2, '0')}`};
131
- `;
132
85
  const BoxWithBorder = styledComponents.styled(designSystem.Box)`
133
86
  border-right: 1px solid ${({ theme })=>theme.colors.neutral200};
134
87
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"EditorLayout.js","sources":["../../../../../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n Button,\n Box,\n BoxComponent,\n Flex,\n FlexComponent,\n FocusTrap,\n Portal,\n Typography,\n} from '@strapi/design-system';\nimport { Collapse } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { PreviewWysiwyg } from './PreviewWysiwyg';\n\ninterface EditorLayoutProps {\n children: React.ReactNode;\n isExpandMode: boolean;\n error?: string;\n previewContent?: string;\n onCollapse: () => void;\n}\n\nconst EditorLayout = ({\n children,\n isExpandMode,\n error,\n previewContent = '',\n onCollapse,\n}: EditorLayoutProps) => {\n const { formatMessage } = useIntl();\n\n React.useEffect(() => {\n if (isExpandMode) {\n document.body.classList.add('lock-body-scroll');\n }\n\n return () => {\n document.body.classList.remove('lock-body-scroll');\n };\n }, [isExpandMode]);\n\n if (isExpandMode) {\n return (\n <Portal role=\"dialog\" aria-modal={false}>\n <FocusTrap onEscape={onCollapse}>\n <ExpandWrapper\n position=\"fixed\"\n top={0}\n left={0}\n right={0}\n bottom={0}\n zIndex={4}\n justifyContent=\"center\"\n onClick={onCollapse}\n >\n <Box<'div'>\n background=\"neutral0\"\n hasRadius\n shadow=\"popupShadow\"\n overflow=\"hidden\"\n width=\"90%\"\n height=\"90%\"\n onClick={(e) => e.stopPropagation()}\n >\n <Flex height=\"100%\" alignItems=\"flex-start\">\n <BoxWithBorder flex=\"1\" height=\"100%\">\n {children}\n </BoxWithBorder>\n <Flex alignItems=\"start\" direction=\"column\" flex={1} height=\"100%\" width=\"100%\">\n <Flex\n height=\"4.8rem\"\n background=\"neutral100\"\n justifyContent=\"flex-end\"\n shrink={0}\n width=\"100%\"\n >\n <ExpandButton onClick={onCollapse} variant=\"tertiary\" size=\"M\">\n <Typography>\n {formatMessage({\n id: 'components.Wysiwyg.collapse',\n defaultMessage: 'Collapse',\n })}\n </Typography>\n <Collapse />\n </ExpandButton>\n </Flex>\n\n <Box position=\"relative\" height=\"100%\" width=\"100%\">\n <PreviewWysiwyg data={previewContent} />\n </Box>\n </Flex>\n </Flex>\n </Box>\n </ExpandWrapper>\n </FocusTrap>\n </Portal>\n );\n }\n\n return (\n <Flex\n borderColor={error ? 'danger600' : 'neutral200'}\n borderStyle=\"solid\"\n borderWidth=\"1px\"\n hasRadius\n direction=\"column\"\n alignItems=\"stretch\"\n >\n {children}\n </Flex>\n );\n};\n\nconst ExpandWrapper = styled<FlexComponent>(Flex)`\n background: ${({ theme }) =>\n `${theme.colors.neutral800}${Math.floor(0.2 * 255)\n .toString(16)\n .padStart(2, '0')}`};\n`;\n\nconst BoxWithBorder = styled<BoxComponent>(Box)`\n border-right: 1px solid ${({ theme }) => theme.colors.neutral200};\n`;\n\nconst ExpandButton = styled(Button)`\n background-color: transparent;\n border: none;\n align-items: center;\n\n & > span {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n }\n\n svg {\n margin-left: ${({ theme }) => `${theme.spaces[2]}`};\n\n path {\n fill: ${({ theme }) => theme.colors.neutral700};\n width: 1.2rem;\n height: 1.2rem;\n }\n }\n`;\n\nexport { EditorLayout, ExpandButton };\nexport type { EditorLayoutProps };\n"],"names":["EditorLayout","children","isExpandMode","error","previewContent","onCollapse","formatMessage","useIntl","React","useEffect","document","body","classList","add","remove","_jsx","Portal","role","aria-modal","FocusTrap","onEscape","ExpandWrapper","position","top","left","right","bottom","zIndex","justifyContent","onClick","Box","background","hasRadius","shadow","overflow","width","height","e","stopPropagation","_jsxs","Flex","alignItems","BoxWithBorder","flex","direction","shrink","ExpandButton","variant","size","Typography","id","defaultMessage","Collapse","PreviewWysiwyg","data","borderColor","borderStyle","borderWidth","styled","theme","colors","neutral800","Math","floor","toString","padStart","neutral200","Button","fontWeights","regular","spaces","neutral700"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,MAAMA,YAAe,GAAA,CAAC,EACpBC,QAAQ,EACRC,YAAY,EACZC,KAAK,EACLC,cAAAA,GAAiB,EAAE,EACnBC,UAAU,EACQ,GAAA;IAClB,MAAM,EAAEC,aAAa,EAAE,GAAGC,iBAAAA,EAAAA;AAE1BC,IAAAA,gBAAAA,CAAMC,SAAS,CAAC,IAAA;AACd,QAAA,IAAIP,YAAc,EAAA;AAChBQ,YAAAA,QAAAA,CAASC,IAAI,CAACC,SAAS,CAACC,GAAG,CAAC,kBAAA,CAAA;AAC9B;QAEA,OAAO,IAAA;AACLH,YAAAA,QAAAA,CAASC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAC,kBAAA,CAAA;AACjC,SAAA;KACC,EAAA;AAACZ,QAAAA;AAAa,KAAA,CAAA;AAEjB,IAAA,IAAIA,YAAc,EAAA;AAChB,QAAA,qBACEa,cAACC,CAAAA,mBAAAA,EAAAA;YAAOC,IAAK,E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,KAAMC,CAAAA,MAAM,CAACM,UAAU,CAAC;AACnE,CAAC;AAEKpB,MAAAA,YAAAA,GAAeY,uBAAOS,CAAAA,mBAAAA,CAAO;;;;;;;;;;iBAUlB,EAAE,CAAC,EAAER,KAAK,EAAE,GAAKA,KAAMS,CAAAA,WAAW,CAACC,OAAO,CAAC;;;;AAI3C,iBAAA,EAAE,CAAC,EAAEV,KAAK,EAAE,GAAK,CAAC,EAAEA,KAAAA,CAAMW,MAAM,CAAC,CAAE,CAAA,CAAC,CAAC,CAAC;;;YAG3C,EAAE,CAAC,EAAEX,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACW,UAAU,CAAC;;;;;AAKrD;;;;;"}
1
+ {"version":3,"file":"EditorLayout.js","sources":["../../../../../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Button, Box, BoxComponent, Flex, Typography, Modal } from '@strapi/design-system';\nimport { Collapse } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { PreviewWysiwyg } from './PreviewWysiwyg';\n\ninterface EditorLayoutProps {\n children: React.ReactNode;\n isExpandMode: boolean;\n error?: string;\n previewContent?: string;\n onCollapse: () => void;\n}\n\nconst EditorLayout = ({\n children,\n isExpandMode,\n error,\n previewContent = '',\n onCollapse,\n}: EditorLayoutProps) => {\n const { formatMessage } = useIntl();\n\n if (isExpandMode) {\n return (\n <Modal.Root open={isExpandMode} onOpenChange={onCollapse}>\n <Modal.Content style={{ maxWidth: 'unset', width: 'unset' }}>\n <Flex height=\"90vh\" width=\"90vw\" alignItems=\"flex-start\">\n <BoxWithBorder flex=\"1\" height=\"100%\">\n {children}\n </BoxWithBorder>\n <Flex alignItems=\"start\" direction=\"column\" flex={1} height=\"100%\" width=\"100%\">\n <Flex\n height=\"4.8rem\"\n background=\"neutral100\"\n justifyContent=\"flex-end\"\n shrink={0}\n width=\"100%\"\n >\n <ExpandButton onClick={onCollapse} variant=\"tertiary\" size=\"M\">\n <Typography>\n {formatMessage({\n id: 'components.Wysiwyg.collapse',\n defaultMessage: 'Collapse',\n })}\n </Typography>\n <Collapse />\n </ExpandButton>\n </Flex>\n <Box position=\"relative\" height=\"100%\" width=\"100%\">\n <PreviewWysiwyg data={previewContent} />\n </Box>\n </Flex>\n </Flex>\n </Modal.Content>\n </Modal.Root>\n );\n }\n\n return (\n <Flex\n borderColor={error ? 'danger600' : 'neutral200'}\n borderStyle=\"solid\"\n borderWidth=\"1px\"\n hasRadius\n direction=\"column\"\n alignItems=\"stretch\"\n >\n {children}\n </Flex>\n );\n};\n\nconst BoxWithBorder = styled<BoxComponent>(Box)`\n border-right: 1px solid ${({ theme }) => theme.colors.neutral200};\n`;\n\nconst ExpandButton = styled(Button)`\n background-color: transparent;\n border: none;\n align-items: center;\n\n & > span {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n }\n\n svg {\n margin-left: ${({ theme }) => `${theme.spaces[2]}`};\n\n path {\n fill: ${({ theme }) => theme.colors.neutral700};\n width: 1.2rem;\n height: 1.2rem;\n }\n }\n`;\n\nexport { EditorLayout, ExpandButton };\nexport type { EditorLayoutProps };\n"],"names":["EditorLayout","children","isExpandMode","error","previewContent","onCollapse","formatMessage","useIntl","_jsx","Modal","Root","open","onOpenChange","Content","style","maxWidth","width","_jsxs","Flex","height","alignItems","BoxWithBorder","flex","direction","background","justifyContent","shrink","ExpandButton","onClick","variant","size","Typography","id","defaultMessage","Collapse","Box","position","PreviewWysiwyg","data","borderColor","borderStyle","borderWidth","hasRadius","styled","theme","colors","neutral200","Button","fontWeights","regular","spaces","neutral700"],"mappings":";;;;;;;;;;AAiBA,MAAMA,YAAe,GAAA,CAAC,EACpBC,QAAQ,EACRC,YAAY,EACZC,KAAK,EACLC,cAAAA,GAAiB,EAAE,EACnBC,UAAU,EACQ,GAAA;IAClB,MAAM,EAAEC,aAA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,EAAAA;oCAAIC,QAAS,EAAA,UAAA;oCAAWjB,MAAO,EAAA,MAAA;oCAAOH,KAAM,EAAA,MAAA;AAC3C,oCAAA,QAAA,gBAAAR,cAAC6B,CAAAA,6BAAAA,EAAAA;wCAAeC,IAAMlC,EAAAA;;;;;;;;;AAOpC;AAEA,IAAA,qBACEI,cAACU,CAAAA,iBAAAA,EAAAA;AACCqB,QAAAA,WAAAA,EAAapC,QAAQ,WAAc,GAAA,YAAA;QACnCqC,WAAY,EAAA,OAAA;QACZC,WAAY,EAAA,KAAA;QACZC,SAAS,EAAA,IAAA;QACTnB,SAAU,EAAA,QAAA;QACVH,UAAW,EAAA,SAAA;AAEVnB,QAAAA,QAAAA,EAAAA;;AAGP;AAEA,MAAMoB,aAAAA,GAAgBsB,uBAAqBR,CAAAA,gBAAAA,CAAI;0BACrB,EAAE,CAAC,EAAES,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACC,UAAU,CAAC;AACnE,CAAC;AAEKnB,MAAAA,YAAAA,GAAegB,uBAAOI,CAAAA,mBAAAA,CAAO;;;;;;;;;;iBAUlB,EAAE,CAAC,EAAEH,KAAK,EAAE,GAAKA,KAAMI,CAAAA,WAAW,CAACC,OAAO,CAAC;;;;AAI3C,iBAAA,EAAE,CAAC,EAAEL,KAAK,EAAE,GAAK,CAAC,EAAEA,KAAAA,CAAMM,MAAM,CAAC,CAAE,CAAA,CAAC,CAAC,CAAC;;;YAG3C,EAAE,CAAC,EAAEN,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACM,UAAU,CAAC;;;;;AAKrD;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
- import * as React from 'react';
3
- import { Flex, Box, Button, Portal, FocusTrap, Typography } from '@strapi/design-system';
2
+ import 'react';
3
+ import { Box, Button, Modal, Flex, Typography } from '@strapi/design-system';
4
4
  import { Collapse } from '@strapi/icons';
5
5
  import { useIntl } from 'react-intl';
6
6
  import { styled } from 'styled-components';
@@ -8,89 +8,64 @@ import { PreviewWysiwyg } from './PreviewWysiwyg.mjs';
8
8
 
9
9
  const EditorLayout = ({ children, isExpandMode, error, previewContent = '', onCollapse })=>{
10
10
  const { formatMessage } = useIntl();
11
- React.useEffect(()=>{
12
- if (isExpandMode) {
13
- document.body.classList.add('lock-body-scroll');
14
- }
15
- return ()=>{
16
- document.body.classList.remove('lock-body-scroll');
17
- };
18
- }, [
19
- isExpandMode
20
- ]);
21
11
  if (isExpandMode) {
22
- return /*#__PURE__*/ jsx(Portal, {
23
- role: "dialog",
24
- "aria-modal": false,
25
- children: /*#__PURE__*/ jsx(FocusTrap, {
26
- onEscape: onCollapse,
27
- children: /*#__PURE__*/ jsx(ExpandWrapper, {
28
- position: "fixed",
29
- top: 0,
30
- left: 0,
31
- right: 0,
32
- bottom: 0,
33
- zIndex: 4,
34
- justifyContent: "center",
35
- onClick: onCollapse,
36
- children: /*#__PURE__*/ jsx(Box, {
37
- background: "neutral0",
38
- hasRadius: true,
39
- shadow: "popupShadow",
40
- overflow: "hidden",
41
- width: "90%",
42
- height: "90%",
43
- onClick: (e)=>e.stopPropagation(),
44
- children: /*#__PURE__*/ jsxs(Flex, {
12
+ return /*#__PURE__*/ jsx(Modal.Root, {
13
+ open: isExpandMode,
14
+ onOpenChange: onCollapse,
15
+ children: /*#__PURE__*/ jsx(Modal.Content, {
16
+ style: {
17
+ maxWidth: 'unset',
18
+ width: 'unset'
19
+ },
20
+ children: /*#__PURE__*/ jsxs(Flex, {
21
+ height: "90vh",
22
+ width: "90vw",
23
+ alignItems: "flex-start",
24
+ children: [
25
+ /*#__PURE__*/ jsx(BoxWithBorder, {
26
+ flex: "1",
45
27
  height: "100%",
46
- alignItems: "flex-start",
28
+ children: children
29
+ }),
30
+ /*#__PURE__*/ jsxs(Flex, {
31
+ alignItems: "start",
32
+ direction: "column",
33
+ flex: 1,
34
+ height: "100%",
35
+ width: "100%",
47
36
  children: [
48
- /*#__PURE__*/ jsx(BoxWithBorder, {
49
- flex: "1",
50
- height: "100%",
51
- children: children
37
+ /*#__PURE__*/ jsx(Flex, {
38
+ height: "4.8rem",
39
+ background: "neutral100",
40
+ justifyContent: "flex-end",
41
+ shrink: 0,
42
+ width: "100%",
43
+ children: /*#__PURE__*/ jsxs(ExpandButton, {
44
+ onClick: onCollapse,
45
+ variant: "tertiary",
46
+ size: "M",
47
+ children: [
48
+ /*#__PURE__*/ jsx(Typography, {
49
+ children: formatMessage({
50
+ id: 'components.Wysiwyg.collapse',
51
+ defaultMessage: 'Collapse'
52
+ })
53
+ }),
54
+ /*#__PURE__*/ jsx(Collapse, {})
55
+ ]
56
+ })
52
57
  }),
53
- /*#__PURE__*/ jsxs(Flex, {
54
- alignItems: "start",
55
- direction: "column",
56
- flex: 1,
58
+ /*#__PURE__*/ jsx(Box, {
59
+ position: "relative",
57
60
  height: "100%",
58
61
  width: "100%",
59
- children: [
60
- /*#__PURE__*/ jsx(Flex, {
61
- height: "4.8rem",
62
- background: "neutral100",
63
- justifyContent: "flex-end",
64
- shrink: 0,
65
- width: "100%",
66
- children: /*#__PURE__*/ jsxs(ExpandButton, {
67
- onClick: onCollapse,
68
- variant: "tertiary",
69
- size: "M",
70
- children: [
71
- /*#__PURE__*/ jsx(Typography, {
72
- children: formatMessage({
73
- id: 'components.Wysiwyg.collapse',
74
- defaultMessage: 'Collapse'
75
- })
76
- }),
77
- /*#__PURE__*/ jsx(Collapse, {})
78
- ]
79
- })
80
- }),
81
- /*#__PURE__*/ jsx(Box, {
82
- position: "relative",
83
- height: "100%",
84
- width: "100%",
85
- children: /*#__PURE__*/ jsx(PreviewWysiwyg, {
86
- data: previewContent
87
- })
88
- })
89
- ]
62
+ children: /*#__PURE__*/ jsx(PreviewWysiwyg, {
63
+ data: previewContent
64
+ })
90
65
  })
91
66
  ]
92
67
  })
93
- })
68
+ ]
94
69
  })
95
70
  })
96
71
  });
@@ -105,9 +80,6 @@ const EditorLayout = ({ children, isExpandMode, error, previewContent = '', onCo
105
80
  children: children
106
81
  });
107
82
  };
108
- const ExpandWrapper = styled(Flex)`
109
- background: ${({ theme })=>`${theme.colors.neutral800}${Math.floor(0.2 * 255).toString(16).padStart(2, '0')}`};
110
- `;
111
83
  const BoxWithBorder = styled(Box)`
112
84
  border-right: 1px solid ${({ theme })=>theme.colors.neutral200};
113
85
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"EditorLayout.mjs","sources":["../../../../../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n Button,\n Box,\n BoxComponent,\n Flex,\n FlexComponent,\n FocusTrap,\n Portal,\n Typography,\n} from '@strapi/design-system';\nimport { Collapse } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { PreviewWysiwyg } from './PreviewWysiwyg';\n\ninterface EditorLayoutProps {\n children: React.ReactNode;\n isExpandMode: boolean;\n error?: string;\n previewContent?: string;\n onCollapse: () => void;\n}\n\nconst EditorLayout = ({\n children,\n isExpandMode,\n error,\n previewContent = '',\n onCollapse,\n}: EditorLayoutProps) => {\n const { formatMessage } = useIntl();\n\n React.useEffect(() => {\n if (isExpandMode) {\n document.body.classList.add('lock-body-scroll');\n }\n\n return () => {\n document.body.classList.remove('lock-body-scroll');\n };\n }, [isExpandMode]);\n\n if (isExpandMode) {\n return (\n <Portal role=\"dialog\" aria-modal={false}>\n <FocusTrap onEscape={onCollapse}>\n <ExpandWrapper\n position=\"fixed\"\n top={0}\n left={0}\n right={0}\n bottom={0}\n zIndex={4}\n justifyContent=\"center\"\n onClick={onCollapse}\n >\n <Box<'div'>\n background=\"neutral0\"\n hasRadius\n shadow=\"popupShadow\"\n overflow=\"hidden\"\n width=\"90%\"\n height=\"90%\"\n onClick={(e) => e.stopPropagation()}\n >\n <Flex height=\"100%\" alignItems=\"flex-start\">\n <BoxWithBorder flex=\"1\" height=\"100%\">\n {children}\n </BoxWithBorder>\n <Flex alignItems=\"start\" direction=\"column\" flex={1} height=\"100%\" width=\"100%\">\n <Flex\n height=\"4.8rem\"\n background=\"neutral100\"\n justifyContent=\"flex-end\"\n shrink={0}\n width=\"100%\"\n >\n <ExpandButton onClick={onCollapse} variant=\"tertiary\" size=\"M\">\n <Typography>\n {formatMessage({\n id: 'components.Wysiwyg.collapse',\n defaultMessage: 'Collapse',\n })}\n </Typography>\n <Collapse />\n </ExpandButton>\n </Flex>\n\n <Box position=\"relative\" height=\"100%\" width=\"100%\">\n <PreviewWysiwyg data={previewContent} />\n </Box>\n </Flex>\n </Flex>\n </Box>\n </ExpandWrapper>\n </FocusTrap>\n </Portal>\n );\n }\n\n return (\n <Flex\n borderColor={error ? 'danger600' : 'neutral200'}\n borderStyle=\"solid\"\n borderWidth=\"1px\"\n hasRadius\n direction=\"column\"\n alignItems=\"stretch\"\n >\n {children}\n </Flex>\n );\n};\n\nconst ExpandWrapper = styled<FlexComponent>(Flex)`\n background: ${({ theme }) =>\n `${theme.colors.neutral800}${Math.floor(0.2 * 255)\n .toString(16)\n .padStart(2, '0')}`};\n`;\n\nconst BoxWithBorder = styled<BoxComponent>(Box)`\n border-right: 1px solid ${({ theme }) => theme.colors.neutral200};\n`;\n\nconst ExpandButton = styled(Button)`\n background-color: transparent;\n border: none;\n align-items: center;\n\n & > span {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n }\n\n svg {\n margin-left: ${({ theme }) => `${theme.spaces[2]}`};\n\n path {\n fill: ${({ theme }) => theme.colors.neutral700};\n width: 1.2rem;\n height: 1.2rem;\n }\n }\n`;\n\nexport { EditorLayout, ExpandButton };\nexport type { EditorLayoutProps };\n"],"names":["EditorLayout","children","isExpandMode","error","previewContent","onCollapse","formatMessage","useIntl","React","useEffect","document","body","classList","add","remove","_jsx","Portal","role","aria-modal","FocusTrap","onEscape","ExpandWrapper","position","top","left","right","bottom","zIndex","justifyContent","onClick","Box","background","hasRadius","shadow","overflow","width","height","e","stopPropagation","_jsxs","Flex","alignItems","BoxWithBorder","flex","direction","shrink","ExpandButton","variant","size","Typography","id","defaultMessage","Collapse","PreviewWysiwyg","data","borderColor","borderStyle","borderWidth","styled","theme","colors","neutral800","Math","floor","toString","padStart","neutral200","Button","fontWeights","regular","spaces","neutral700"],"mappings":";;;;;;;;AA0BA,MAAMA,YAAe,GAAA,CAAC,EACpBC,QAAQ,EACRC,YAAY,EACZC,KAAK,EACLC,cAAAA,GAAiB,EAAE,EACnBC,UAAU,EACQ,GAAA;IAClB,MAAM,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;AAE1BC,IAAAA,KAAAA,CAAMC,SAAS,CAAC,IAAA;AACd,QAAA,IAAIP,YAAc,EAAA;AAChBQ,YAAAA,QAAAA,CAASC,IAAI,CAACC,SAAS,CAACC,GAAG,CAAC,kBAAA,CAAA;AAC9B;QAEA,OAAO,IAAA;AACLH,YAAAA,QAAAA,CAASC,IAAI,CAACC,SAAS,CAACE,MAAM,CAAC,kBAAA,CAAA;AACjC,SAAA;KACC,EAAA;AAACZ,QAAAA;AAAa,KAAA,CAAA;AAEjB,IAAA,IAAIA,YAAc,EAAA;AAChB,QAAA,qBACEa,GAACC,CAAAA,MAAAA,EAAAA;YAAOC,IAAK,EAAA,QAAA;YAASC,YAAY,EAAA,KAAA;AAChC,YAAA,QAAA,gBAAAH,GAACI,CAAAA,SAAAA,EAAAA;gBAAUC,QAAUf,EAAAA,UAAAA;AACnB,gBAAA,QAAA,gBAAAU,GAACM,CAAAA,aAAAA,EAAAA;oBACCC,QAAS,EAAA,OAAA;oBACTC,GAAK,EAAA,CAAA;oBACLC,IAAM,EAAA,CAAA;oBACNC,KAAO,EAAA,CAAA;oBACPC,MAAQ,EAAA,CAAA;oBACRC,MAAQ,EAAA,CAAA;oBACRC,cAAe,EAAA,QAAA;oBACfC,OAASxB,EAAAA,UAAAA;AAET,oBAAA,QAAA,gBAAAU,GAACe,CAAAA,GAA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"version":3,"file":"EditorLayout.mjs","sources":["../../../../../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Button, Box, BoxComponent, Flex, Typography, Modal } from '@strapi/design-system';\nimport { Collapse } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { PreviewWysiwyg } from './PreviewWysiwyg';\n\ninterface EditorLayoutProps {\n children: React.ReactNode;\n isExpandMode: boolean;\n error?: string;\n previewContent?: string;\n onCollapse: () => void;\n}\n\nconst EditorLayout = ({\n children,\n isExpandMode,\n error,\n previewContent = '',\n onCollapse,\n}: EditorLayoutProps) => {\n const { formatMessage } = useIntl();\n\n if (isExpandMode) {\n return (\n <Modal.Root open={isExpandMode} onOpenChange={onCollapse}>\n <Modal.Content style={{ maxWidth: 'unset', width: 'unset' }}>\n <Flex height=\"90vh\" width=\"90vw\" alignItems=\"flex-start\">\n <BoxWithBorder flex=\"1\" height=\"100%\">\n {children}\n </BoxWithBorder>\n <Flex alignItems=\"start\" direction=\"column\" flex={1} height=\"100%\" width=\"100%\">\n <Flex\n height=\"4.8rem\"\n background=\"neutral100\"\n justifyContent=\"flex-end\"\n shrink={0}\n width=\"100%\"\n >\n <ExpandButton onClick={onCollapse} variant=\"tertiary\" size=\"M\">\n <Typography>\n {formatMessage({\n id: 'components.Wysiwyg.collapse',\n defaultMessage: 'Collapse',\n })}\n </Typography>\n <Collapse />\n </ExpandButton>\n </Flex>\n <Box position=\"relative\" height=\"100%\" width=\"100%\">\n <PreviewWysiwyg data={previewContent} />\n </Box>\n </Flex>\n </Flex>\n </Modal.Content>\n </Modal.Root>\n );\n }\n\n return (\n <Flex\n borderColor={error ? 'danger600' : 'neutral200'}\n borderStyle=\"solid\"\n borderWidth=\"1px\"\n hasRadius\n direction=\"column\"\n alignItems=\"stretch\"\n >\n {children}\n </Flex>\n );\n};\n\nconst BoxWithBorder = styled<BoxComponent>(Box)`\n border-right: 1px solid ${({ theme }) => theme.colors.neutral200};\n`;\n\nconst ExpandButton = styled(Button)`\n background-color: transparent;\n border: none;\n align-items: center;\n\n & > span {\n display: flex;\n justify-content: space-between;\n align-items: center;\n width: 100%;\n font-weight: ${({ theme }) => theme.fontWeights.regular};\n }\n\n svg {\n margin-left: ${({ theme }) => `${theme.spaces[2]}`};\n\n path {\n fill: ${({ theme }) => theme.colors.neutral700};\n width: 1.2rem;\n height: 1.2rem;\n }\n }\n`;\n\nexport { EditorLayout, ExpandButton };\nexport type { EditorLayoutProps };\n"],"names":["EditorLayout","children","isExpandMode","error","previewContent","onCollapse","formatMessage","useIntl","_jsx","Modal","Root","open","onOpenChange","Content","style","maxWidth","width","_jsxs","Flex","height","alignItems","BoxWithBorder","flex","direction","background","justifyContent","shrink","ExpandButton","onClick","variant","size","Typography","id","defaultMessage","Collapse","Box","position","PreviewWysiwyg","data","borderColor","borderStyle","borderWidth","hasRadius","styled","theme","colors","neutral200","Button","fontWeights","regular","spaces","neutral700"],"mappings":";;;;;;;;AAiBA,MAAMA,YAAe,GAAA,CAAC,EACpBC,QAAQ,EACRC,YAAY,EACZC,KAAK,EACLC,cAAAA,GAAiB,EAAE,EACnBC,UAAU,EACQ,GAAA;IAClB,MAAM,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;AAE1B,IAAA,IAAIL,YAAc,EAAA;QAChB,qBACEM,GAAA,CAACC,MAAMC,IAAI,EAAA;YAACC,IAAMT,EAAAA,YAAAA;YAAcU,YAAcP,EAAAA,UAAAA;oCAC5CG,GAAA,CAACC,MAAMI,OAAO,EAAA;gBAACC,KAAO,EAAA;oBAAEC,QAAU,EAAA,OAAA;oBAASC,KAAO,EAAA;AAAQ,iBAAA;AACxD,gBAAA,QAAA,gBAAAC,IAACC,CAAAA,IAAAA,EAAAA;oBAAKC,MAAO,EAAA,MAAA;oBAAOH,KAAM,EAAA,MAAA;oBAAOI,UAAW,EAAA,YAAA;;sCAC1CZ,GAACa,CAAAA,a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A,MAAMoB,aAAAA,GAAgBsB,MAAqBR,CAAAA,GAAAA,CAAI;0BACrB,EAAE,CAAC,EAAES,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACC,UAAU,CAAC;AACnE,CAAC;AAEKnB,MAAAA,YAAAA,GAAegB,MAAOI,CAAAA,MAAAA,CAAO;;;;;;;;;;iBAUlB,EAAE,CAAC,EAAEH,KAAK,EAAE,GAAKA,KAAMI,CAAAA,WAAW,CAACC,OAAO,CAAC;;;;AAI3C,iBAAA,EAAE,CAAC,EAAEL,KAAK,EAAE,GAAK,CAAC,EAAEA,KAAAA,CAAMM,MAAM,CAAC,CAAE,CAAA,CAAC,CAAC,CAAC;;;YAG3C,EAAE,CAAC,EAAEN,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACM,UAAU,CAAC;;;;;AAKrD;;;;"}
@@ -152,7 +152,7 @@ const PreviewTabs = ()=>{
152
152
  activeTab: query.status ?? null,
153
153
  collectionType: schema.kind === 'collectionType' ? 'collection-types' : 'single-types',
154
154
  model: schema.uid,
155
- documentId: document.documentId,
155
+ documentId: schema.kind === 'collectionType' ? document.documentId : undefined,
156
156
  document,
157
157
  meta
158
158
  };
@@ -1 +1 @@
1
- {"version":3,"file":"PreviewHeader.js","sources":["../../../../admin/src/preview/components/PreviewHeader.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n DescriptionComponentRenderer,\n useClipboard,\n useHistory,\n useNotification,\n useQueryParams,\n useStrapiApp,\n} from '@strapi/admin/strapi-admin';\nimport { IconButton, Tabs, Typography, 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 { InjectionZone } from '../../components/InjectionZone';\nimport { DocumentActionButton } from '../../pages/EditView/components/DocumentActions';\nimport { DocumentStatus } from '../../pages/EditView/components/DocumentStatus';\nimport { getDocumentStatus } from '../../pages/EditView/EditViewPage';\nimport { usePreviewContext } from '../pages/Preview';\n\nimport type { ContentManagerPlugin, DocumentActionProps } from '../../content-manager';\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 <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 * PreviewHeader\n * -----------------------------------------------------------------------------------------------*/\n\nconst PreviewHeader = () => {\n const title = usePreviewContext('PreviewHeader', (state) => state.title);\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 onPreview = usePreviewContext('PreviewHeader', (state) => state.onPreview);\n const plugins = useStrapiApp('PreviewHeader', (state) => state.plugins);\n\n const [{ query }] = useQueryParams<{\n status?: 'draft' | 'published';\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 const hasDraftAndPublish = schema.options?.draftAndPublish ?? false;\n const documentActionProps = {\n activeTab: query.status ?? null,\n collectionType: schema.kind === 'collectionType' ? 'collection-types' : 'single-types',\n model: schema.uid,\n documentId: document.documentId,\n document,\n meta,\n } satisfies DocumentActionProps;\n\n return (\n <Flex height=\"48px\" 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\n flex={1}\n paddingRight={2}\n gap={2}\n justifyContent={hasDraftAndPublish ? 'space-between' : 'flex-end'}\n >\n <Flex flex=\"1 1 70%\">\n <PreviewTabs />\n </Flex>\n <Flex gap={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 <InjectionZone area=\"preview.actions\" />\n <DescriptionComponentRenderer\n props={documentActionProps}\n descriptions={(\n plugins['content-manager'].apis as ContentManagerPlugin['config']['apis']\n ).getDocumentActions('preview')}\n >\n {(actions) => {\n const filteredActions = actions.filter((action) =>\n [action.position].flat().includes('preview')\n );\n const [primaryAction, secondaryAction] = filteredActions;\n\n if (!primaryAction && !secondaryAction) return null;\n\n // Both actions are available when draft and publish enabled\n if (primaryAction && secondaryAction) {\n return (\n <>\n {/* Save */}\n <DocumentActionButton\n {...secondaryAction}\n variant={secondaryAction.variant || 'secondary'}\n />\n {/* Publish */}\n <DocumentActionButton\n {...primaryAction}\n variant={primaryAction.variant || 'default'}\n />\n </>\n );\n }\n\n // Otherwise we just have the save action\n return (\n <DocumentActionButton\n {...primaryAction}\n variant={primaryAction.variant || 'secondary'}\n />\n );\n }}\n </DescriptionComponentRenderer>\n </Flex>\n </Flex>\n </Flex>\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 };\n"],"names":["ClosePreviewButton","query","useQueryParams","formatMessage","useIntl","canGoBack","useHistory","state","goBack","history","locationIndex","currentLocationIndex","historyTo","at","undefined","fallback","pathname","search","stringify","encode","toWithFallback","handleClick","e","preventDefault","_jsx","IconButton","variant","tag","Link","relative","to","onClick","label","id","defaultMessage","Cross","Status","document","usePreviewContext","schema","meta","hasDraftAndPublished","options","draftAndPublish","status","getDocumentStatus","DocumentStatus","size","PreviewTabs","setQuery","hasDraftAndPublish","documentStatus","handleTabChange","Tabs","Root","value","onValueChange","_jsxs","List","aria-label","StatusTab","disabled","PreviewHeader","title","onPreview","plugins","useStrapiApp","toggleNotification","useNotification","copy","useClipboard","handleCopyLink","window","location","href","message","type","documentActionProps","activeTab","collectionType","kind","model","uid","documentId","Flex","height","gap","background","borderColor","TitleContainer","paddingLeft","paddingRight","PreviewTitle","maxWidth","fontSize","fontWeight","flex","justifyContent","LinkIcon","InjectionZone","area","DescriptionComponentRenderer","props","descriptions","apis","getDocumentActions","actions","filteredActions","filter","action","position","flat","includes","primaryAction","secondaryAction","_Fragment","DocumentActionButton","styled","Typography","Trigger","theme","colors","neutral150"],"mappings":";;;;;;;;;;;;;;;;;AAyBA;;AAEkG,qGAElG,MAAMA,kBAAqB,GAAA,IAAA;AACzB,IAAA,MAAM,CAAC,EAAEC,KAAK,EAAE,CAAC,GAAGC,0BAAAA,EAAAA;IAGpB,MAAM,EAAEC,aAAa,EAAE,GA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AEA,MAAMkE,YAAAA,GAAeyB,uBAAOC,CAAAA,uBAAAA,CAAW;;;;AAIvC,CAAC;AAED,MAAM1D,SAAYyD,GAAAA,uBAAAA,CAAOhE,iBAAKkE,CAAAA,OAAO,CAAC;;AAEtC,CAAC;AAED,MAAM9B,cAAAA,GAAiB4B,uBAAOjC,CAAAA,iBAAAA,CAAK;0BACT,EAAE,CAAC,EAAEoC,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACC,UAAU,CAAC;AACnE,CAAC;;;;"}
1
+ {"version":3,"file":"PreviewHeader.js","sources":["../../../../admin/src/preview/components/PreviewHeader.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n DescriptionComponentRenderer,\n useClipboard,\n useHistory,\n useNotification,\n useQueryParams,\n useStrapiApp,\n} from '@strapi/admin/strapi-admin';\nimport { IconButton, Tabs, Typography, 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 { InjectionZone } from '../../components/InjectionZone';\nimport { DocumentActionButton } from '../../pages/EditView/components/DocumentActions';\nimport { DocumentStatus } from '../../pages/EditView/components/DocumentStatus';\nimport { getDocumentStatus } from '../../pages/EditView/EditViewPage';\nimport { usePreviewContext } from '../pages/Preview';\n\nimport type { ContentManagerPlugin, DocumentActionProps } from '../../content-manager';\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 <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 * PreviewHeader\n * -----------------------------------------------------------------------------------------------*/\n\nconst PreviewHeader = () => {\n const title = usePreviewContext('PreviewHeader', (state) => state.title);\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 onPreview = usePreviewContext('PreviewHeader', (state) => state.onPreview);\n const plugins = useStrapiApp('PreviewHeader', (state) => state.plugins);\n\n const [{ query }] = useQueryParams<{\n status?: 'draft' | 'published';\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 const hasDraftAndPublish = schema.options?.draftAndPublish ?? false;\n const documentActionProps = {\n activeTab: query.status ?? null,\n collectionType: schema.kind === 'collectionType' ? 'collection-types' : 'single-types',\n model: schema.uid,\n documentId: schema.kind === 'collectionType' ? document.documentId : undefined,\n document,\n meta,\n } satisfies DocumentActionProps;\n\n return (\n <Flex height=\"48px\" 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\n flex={1}\n paddingRight={2}\n gap={2}\n justifyContent={hasDraftAndPublish ? 'space-between' : 'flex-end'}\n >\n <Flex flex=\"1 1 70%\">\n <PreviewTabs />\n </Flex>\n <Flex gap={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 <InjectionZone area=\"preview.actions\" />\n <DescriptionComponentRenderer\n props={documentActionProps}\n descriptions={(\n plugins['content-manager'].apis as ContentManagerPlugin['config']['apis']\n ).getDocumentActions('preview')}\n >\n {(actions) => {\n const filteredActions = actions.filter((action) =>\n [action.position].flat().includes('preview')\n );\n const [primaryAction, secondaryAction] = filteredActions;\n\n if (!primaryAction && !secondaryAction) return null;\n\n // Both actions are available when draft and publish enabled\n if (primaryAction && secondaryAction) {\n return (\n <>\n {/* Save */}\n <DocumentActionButton\n {...secondaryAction}\n variant={secondaryAction.variant || 'secondary'}\n />\n {/* Publish */}\n <DocumentActionButton\n {...primaryAction}\n variant={primaryAction.variant || 'default'}\n />\n </>\n );\n }\n\n // Otherwise we just have the save action\n return (\n <DocumentActionButton\n {...primaryAction}\n variant={primaryAction.variant || 'secondary'}\n />\n );\n }}\n </DescriptionComponentRenderer>\n </Flex>\n </Flex>\n </Flex>\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 };\n"],"names":["ClosePreviewButton","query","useQueryParams","formatMessage","useIntl","canGoBack","useHistory","state","goBack","history","locationIndex","currentLocationIndex","historyTo","at","undefined","fallback","pathname","search","stringify","encode","toWithFallback","handleClick","e","preventDefault","_jsx","IconButton","variant","tag","Link","relative","to","onClick","label","id","defaultMessage","Cross","Status","document","usePreviewContext","schema","meta","hasDraftAndPublished","options","draftAndPublish","status","getDocumentStatus","DocumentStatus","size","PreviewTabs","setQuery","hasDraftAndPublish","documentStatus","handleTabChange","Tabs","Root","value","onValueChange","_jsxs","List","aria-label","StatusTab","disabled","PreviewHeader","title","onPreview","plugins","useStrapiApp","toggleNotification","useNotification","copy","useClipboard","handleCopyLink","window","location","href","message","type","documentActionProps","activeTab","collectionType","kind","model","uid","documentId","Flex","height","gap","background","borderColor","TitleContainer","paddingLeft","paddingRight","PreviewTitle","maxWidth","fontSize","fontWeight","flex","justifyContent","LinkIcon","InjectionZone","area","DescriptionComponentRenderer","props","descriptions","apis","getDocumentActions","actions","filteredActions","filter","action","position","flat","includes","primaryAction","secondaryAction","_Fragment","DocumentActionButton","styled","Typography","Trigger","theme","colors","neutral150"],"mappings":";;;;;;;;;;;;;;;;;AAyBA;;AAEkG,qGAElG,MAAMA,kBAAqB,GAAA,IAAA;AACzB,IAAA,MAAM,CAAC,EAAEC,KAAK,EAAE,CAAC,GAAGC,0BAAAA,EAAAA;IAGpB,MAAM,EAAEC,aAAa,EAAE,GAAGC,iBAAAA,EAAAA;AAE1B,IAAA,MAAMC,YAAYC,sBAAW,CAAA,YAAA,EAAc,CAACC,KAAAA,GAAUA,MAAMF,SAAS,CAAA;AACrE,IAAA,MAAMG,SAASF,sBAAW,CAAA,YAAA,EAAc,CAACC,KAAAA,GAAUA,MAAMC,MAAM,CAAA;AAC/D,IAAA,MAAMC,UAAUH,sBAAW,CAAA,YAAA,EAAc,CAACC,KAAAA,GAAUA,MAAME,OAAO,CAAA;AACjE,IAAA,MAAMC,gBAAgBJ,sBAAW,CAAA,YAAA,EAAc,CAACC,KAAAA,GAAUA,MAAMI,oBAAoB,CAAA;AAEpF;;;AAGC,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 const PreviewTabs = ()=>{
150
150
  activeTab: query.status ?? null,
151
151
  collectionType: schema.kind === 'collectionType' ? 'collection-types' : 'single-types',
152
152
  model: schema.uid,
153
- documentId: document.documentId,
153
+ documentId: schema.kind === 'collectionType' ? document.documentId : undefined,
154
154
  document,
155
155
  meta
156
156
  };