@strapi/content-manager 5.33.4 → 5.34.0
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/components/LeftMenu.js +13 -8
- package/dist/admin/components/LeftMenu.js.map +1 -1
- package/dist/admin/components/LeftMenu.mjs +13 -8
- package/dist/admin/components/LeftMenu.mjs.map +1 -1
- package/dist/admin/history/components/VersionHeader.js +1 -0
- package/dist/admin/history/components/VersionHeader.js.map +1 -1
- package/dist/admin/history/components/VersionHeader.mjs +1 -0
- package/dist/admin/history/components/VersionHeader.mjs.map +1 -1
- package/dist/admin/pages/EditView/EditViewPage.js +71 -71
- package/dist/admin/pages/EditView/EditViewPage.js.map +1 -1
- package/dist/admin/pages/EditView/EditViewPage.mjs +73 -73
- package/dist/admin/pages/EditView/EditViewPage.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/DocumentActions.js +29 -21
- package/dist/admin/pages/EditView/components/DocumentActions.js.map +1 -1
- package/dist/admin/pages/EditView/components/DocumentActions.mjs +30 -22
- package/dist/admin/pages/EditView/components/DocumentActions.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Blocks/Heading.js +30 -6
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Blocks/Heading.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Blocks/Heading.mjs +30 -6
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/Blocks/Heading.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.js +19 -7
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.mjs +19 -7
- package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/Header.js +91 -44
- package/dist/admin/pages/EditView/components/Header.js.map +1 -1
- package/dist/admin/pages/EditView/components/Header.mjs +92 -45
- package/dist/admin/pages/EditView/components/Header.mjs.map +1 -1
- package/dist/admin/pages/ListView/ListViewPage.js +6 -4
- package/dist/admin/pages/ListView/ListViewPage.js.map +1 -1
- package/dist/admin/pages/ListView/ListViewPage.mjs +6 -4
- package/dist/admin/pages/ListView/ListViewPage.mjs.map +1 -1
- package/dist/admin/translations/de.json.js +165 -32
- package/dist/admin/translations/de.json.js.map +1 -1
- package/dist/admin/translations/de.json.mjs +165 -32
- package/dist/admin/translations/de.json.mjs.map +1 -1
- package/dist/admin/translations/zh-Hans.json.js +0 -44
- package/dist/admin/translations/zh-Hans.json.js.map +1 -1
- package/dist/admin/translations/zh-Hans.json.mjs +0 -44
- package/dist/admin/translations/zh-Hans.json.mjs.map +1 -1
- package/dist/server/controllers/collection-types.js +16 -13
- package/dist/server/controllers/collection-types.js.map +1 -1
- package/dist/server/controllers/collection-types.mjs +16 -13
- package/dist/server/controllers/collection-types.mjs.map +1 -1
- package/dist/server/controllers/relations.js +5 -2
- package/dist/server/controllers/relations.js.map +1 -1
- package/dist/server/controllers/relations.mjs +5 -2
- package/dist/server/controllers/relations.mjs.map +1 -1
- package/dist/server/controllers/utils/document-status.js +28 -0
- package/dist/server/controllers/utils/document-status.js.map +1 -0
- package/dist/server/controllers/utils/document-status.mjs +26 -0
- package/dist/server/controllers/utils/document-status.mjs.map +1 -0
- package/dist/server/services/components.js +68 -20
- package/dist/server/services/components.js.map +1 -1
- package/dist/server/services/components.mjs +69 -21
- package/dist/server/services/components.mjs.map +1 -1
- package/dist/server/services/permission-checker.js +23 -0
- package/dist/server/services/permission-checker.js.map +1 -1
- package/dist/server/services/permission-checker.mjs +23 -0
- package/dist/server/services/permission-checker.mjs.map +1 -1
- package/dist/server/services/utils/store.js +51 -4
- package/dist/server/services/utils/store.js.map +1 -1
- package/dist/server/services/utils/store.mjs +51 -4
- package/dist/server/services/utils/store.mjs.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/document-status.d.ts +10 -0
- package/dist/server/src/controllers/utils/document-status.d.ts.map +1 -0
- package/dist/server/src/index.d.ts +1 -0
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/services/components.d.ts +6 -0
- package/dist/server/src/services/components.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +1 -0
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/permission-checker.d.ts +1 -0
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/server/src/services/utils/store.d.ts +5 -1
- package/dist/server/src/services/utils/store.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -8,37 +8,61 @@ import { baseHandleConvert } from '../utils/conversions.mjs';
|
|
|
8
8
|
const H1 = styled(Typography).attrs({
|
|
9
9
|
tag: 'h1'
|
|
10
10
|
})`
|
|
11
|
-
font-size:
|
|
11
|
+
font-size: 2.8rem;
|
|
12
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
13
|
+
font-size: 3.6rem;
|
|
14
|
+
}
|
|
15
|
+
font-weight: 600;
|
|
12
16
|
line-height: ${({ theme })=>theme.lineHeights[1]};
|
|
13
17
|
`;
|
|
14
18
|
const H2 = styled(Typography).attrs({
|
|
15
19
|
tag: 'h2'
|
|
16
20
|
})`
|
|
17
|
-
font-size:
|
|
21
|
+
font-size: 2.2rem;
|
|
22
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
23
|
+
font-size: 3rem;
|
|
24
|
+
}
|
|
25
|
+
font-weight: 600;
|
|
18
26
|
line-height: ${({ theme })=>theme.lineHeights[1]};
|
|
19
27
|
`;
|
|
20
28
|
const H3 = styled(Typography).attrs({
|
|
21
29
|
tag: 'h3'
|
|
22
30
|
})`
|
|
23
|
-
font-size:
|
|
31
|
+
font-size: 2rem;
|
|
32
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
33
|
+
font-size: 2.4rem;
|
|
34
|
+
}
|
|
35
|
+
font-weight: 600;
|
|
24
36
|
line-height: ${({ theme })=>theme.lineHeights[1]};
|
|
25
37
|
`;
|
|
26
38
|
const H4 = styled(Typography).attrs({
|
|
27
39
|
tag: 'h4'
|
|
28
40
|
})`
|
|
29
|
-
font-size:
|
|
41
|
+
font-size: 1.8rem;
|
|
42
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
43
|
+
font-size: 2.4rem;
|
|
44
|
+
}
|
|
45
|
+
font-weight: 600;
|
|
30
46
|
line-height: ${({ theme })=>theme.lineHeights[1]};
|
|
31
47
|
`;
|
|
32
48
|
const H5 = styled(Typography).attrs({
|
|
33
49
|
tag: 'h5'
|
|
34
50
|
})`
|
|
35
|
-
font-size:
|
|
51
|
+
font-size: 1.6rem;
|
|
52
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
53
|
+
font-size: 2rem;
|
|
54
|
+
}
|
|
55
|
+
font-weight: 600;
|
|
36
56
|
line-height: ${({ theme })=>theme.lineHeights[1]};
|
|
37
57
|
`;
|
|
38
58
|
const H6 = styled(Typography).attrs({
|
|
39
59
|
tag: 'h6'
|
|
40
60
|
})`
|
|
41
|
-
font-size: 1.
|
|
61
|
+
font-size: 1.4rem;
|
|
62
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
63
|
+
font-size: 1.6rem;
|
|
64
|
+
}
|
|
65
|
+
font-weight: 600;
|
|
42
66
|
line-height: ${({ theme })=>theme.lineHeights[1]};
|
|
43
67
|
`;
|
|
44
68
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.mjs","sources":["../../../../../../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Heading.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Typography, TypographyComponent } from '@strapi/design-system';\nimport {\n HeadingFive,\n HeadingFour,\n HeadingOne,\n HeadingSix,\n HeadingThree,\n HeadingTwo,\n} from '@strapi/icons';\nimport { Editor } from 'slate';\nimport { styled } from 'styled-components';\n\nimport { type BlocksStore } from '../BlocksEditor';\nimport { baseHandleConvert } from '../utils/conversions';\nimport { type Block } from '../utils/types';\n\nconst H1 = styled<TypographyComponent<'h1'>>(Typography).attrs({ tag: 'h1' })`\n font-size: 4.2rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H2 = styled<TypographyComponent<'h2'>>(Typography).attrs({ tag: 'h2' })`\n font-size: 3.5rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H3 = styled<TypographyComponent<'h3'>>(Typography).attrs({ tag: 'h3' })`\n font-size: 2.9rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H4 = styled<TypographyComponent<'h4'>>(Typography).attrs({ tag: 'h4' })`\n font-size: 2.4rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H5 = styled<TypographyComponent<'h5'>>(Typography).attrs({ tag: 'h5' })`\n font-size: 2rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H6 = styled<TypographyComponent<'h6'>>(Typography).attrs({ tag: 'h6' })`\n font-size: 1.6rem;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\n/**\n * Common handler for converting a node to a heading\n */\nconst handleConvertToHeading = (editor: Editor, level: Block<'heading'>['level']) => {\n baseHandleConvert<Block<'heading'>>(editor, { type: 'heading', level });\n};\n\nconst headingBlocks: Pick<\n BlocksStore,\n 'heading-one' | 'heading-two' | 'heading-three' | 'heading-four' | 'heading-five' | 'heading-six'\n> = {\n 'heading-one': {\n renderElement: (props) => <H1 {...props.attributes}>{props.children}</H1>,\n icon: HeadingOne,\n label: {\n id: 'components.Blocks.blocks.heading1',\n defaultMessage: 'Heading 1',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 1),\n matchNode: (node) => node.type === 'heading' && node.level === 1,\n isInBlocksSelector: true,\n snippets: ['#'],\n dragHandleTopMargin: '14px',\n },\n 'heading-two': {\n renderElement: (props) => <H2 {...props.attributes}>{props.children}</H2>,\n icon: HeadingTwo,\n label: {\n id: 'components.Blocks.blocks.heading2',\n defaultMessage: 'Heading 2',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 2),\n matchNode: (node) => node.type === 'heading' && node.level === 2,\n isInBlocksSelector: true,\n snippets: ['##'],\n dragHandleTopMargin: '10px',\n },\n 'heading-three': {\n renderElement: (props) => <H3 {...props.attributes}>{props.children}</H3>,\n icon: HeadingThree,\n label: {\n id: 'components.Blocks.blocks.heading3',\n defaultMessage: 'Heading 3',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 3),\n matchNode: (node) => node.type === 'heading' && node.level === 3,\n isInBlocksSelector: true,\n snippets: ['###'],\n dragHandleTopMargin: '7px',\n },\n 'heading-four': {\n renderElement: (props) => <H4 {...props.attributes}>{props.children}</H4>,\n icon: HeadingFour,\n label: {\n id: 'components.Blocks.blocks.heading4',\n defaultMessage: 'Heading 4',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 4),\n matchNode: (node) => node.type === 'heading' && node.level === 4,\n isInBlocksSelector: true,\n snippets: ['####'],\n dragHandleTopMargin: '4px',\n },\n 'heading-five': {\n renderElement: (props) => <H5 {...props.attributes}>{props.children}</H5>,\n icon: HeadingFive,\n label: {\n id: 'components.Blocks.blocks.heading5',\n defaultMessage: 'Heading 5',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 5),\n matchNode: (node) => node.type === 'heading' && node.level === 5,\n isInBlocksSelector: true,\n snippets: ['#####'],\n },\n 'heading-six': {\n renderElement: (props) => <H6 {...props.attributes}>{props.children}</H6>,\n icon: HeadingSix,\n label: {\n id: 'components.Blocks.blocks.heading6',\n defaultMessage: 'Heading 6',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 6),\n matchNode: (node) => node.type === 'heading' && node.level === 6,\n isInBlocksSelector: true,\n snippets: ['######'],\n dragHandleTopMargin: '-2px',\n },\n};\n\nexport { headingBlocks };\n"],"names":["H1","styled","Typography","attrs","tag","theme","lineHeights","H2","H3","H4","H5","H6","handleConvertToHeading","editor","level","baseHandleConvert","type","headingBlocks","renderElement","props","_jsx","attributes","children","icon","HeadingOne","label","id","defaultMessage","handleConvert","matchNode","node","isInBlocksSelector","snippets","dragHandleTopMargin","HeadingTwo","HeadingThree","HeadingFour","HeadingFive","HeadingSix"],"mappings":";;;;;;;AAkBA,MAAMA,EAAKC,GAAAA,MAAAA,CAAkCC,UAAYC,CAAAA,CAAAA,KAAK,CAAC;IAAEC,GAAK,EAAA;AAAK,CAAA,CAAE;;eAE9D,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAMC,CAAAA,WAAW,CAAC,CAAA,CAAE,CAAC;AACrD,CAAC;AAED,MAAMC,EAAKN,GAAAA,MAAAA,CAAkCC,UAAYC,CAAAA,CAAAA,KAAK,CAAC;IAAEC,GAAK,EAAA;AAAK,CAAA,CAAE;;eAE9D,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAMC,CAAAA,WAAW,CAAC,CAAA,CAAE,CAAC;AACrD,CAAC;AAED,MAAME,EAAKP,GAAAA,MAAAA,CAAkCC,UAAYC,CAAAA,CAAAA,KAAK,CAAC;IAAEC,GAAK,EAAA;AAAK,CAAA,CAAE;;eAE9D,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAMC,CAAAA,WAAW,CAAC,CAAA,CAAE,CAAC;AACrD,CAAC;AAED,MAAMG,EAAKR,GAAAA,MAAAA,CAAkCC,UAAYC,CAAAA,CAAAA,KAAK,CAAC;IAAEC,GAAK,EAAA;AAAK,CAAA,CAAE;;eAE9D,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAMC,CAAAA,WAAW,CAAC,CAAA,CAAE,CAAC;AACrD,CAAC;AAED,MAAMI,EAAKT,GAAAA,MAAAA,CAAkCC,UAAYC,CAAAA,CAAAA,KAAK,CAAC;IAAEC,GAAK,EAAA;AAAK,CAAA,CAAE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AA,IAAAA,CAAKhB,KAAK,KAAK,CAAA;QAC/DiB,kBAAoB,EAAA,IAAA;QACpBC,QAAU,EAAA;AAAC,YAAA;AAAS,SAAA;QACpBC,mBAAqB,EAAA;AACvB;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"Heading.mjs","sources":["../../../../../../../../admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Heading.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Typography, TypographyComponent } from '@strapi/design-system';\nimport {\n HeadingFive,\n HeadingFour,\n HeadingOne,\n HeadingSix,\n HeadingThree,\n HeadingTwo,\n} from '@strapi/icons';\nimport { Editor } from 'slate';\nimport { styled } from 'styled-components';\n\nimport { type BlocksStore } from '../BlocksEditor';\nimport { baseHandleConvert } from '../utils/conversions';\nimport { type Block } from '../utils/types';\n\nconst H1 = styled<TypographyComponent<'h1'>>(Typography).attrs({ tag: 'h1' })`\n font-size: 2.8rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 3.6rem;\n }\n font-weight: 600;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H2 = styled<TypographyComponent<'h2'>>(Typography).attrs({ tag: 'h2' })`\n font-size: 2.2rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 3rem;\n }\n font-weight: 600;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H3 = styled<TypographyComponent<'h3'>>(Typography).attrs({ tag: 'h3' })`\n font-size: 2rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 2.4rem;\n }\n font-weight: 600;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H4 = styled<TypographyComponent<'h4'>>(Typography).attrs({ tag: 'h4' })`\n font-size: 1.8rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 2.4rem;\n }\n font-weight: 600;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H5 = styled<TypographyComponent<'h5'>>(Typography).attrs({ tag: 'h5' })`\n font-size: 1.6rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 2rem;\n }\n font-weight: 600;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\nconst H6 = styled<TypographyComponent<'h6'>>(Typography).attrs({ tag: 'h6' })`\n font-size: 1.4rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 1.6rem;\n }\n font-weight: 600;\n line-height: ${({ theme }) => theme.lineHeights[1]};\n`;\n\n/**\n * Common handler for converting a node to a heading\n */\nconst handleConvertToHeading = (editor: Editor, level: Block<'heading'>['level']) => {\n baseHandleConvert<Block<'heading'>>(editor, { type: 'heading', level });\n};\n\nconst headingBlocks: Pick<\n BlocksStore,\n 'heading-one' | 'heading-two' | 'heading-three' | 'heading-four' | 'heading-five' | 'heading-six'\n> = {\n 'heading-one': {\n renderElement: (props) => <H1 {...props.attributes}>{props.children}</H1>,\n icon: HeadingOne,\n label: {\n id: 'components.Blocks.blocks.heading1',\n defaultMessage: 'Heading 1',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 1),\n matchNode: (node) => node.type === 'heading' && node.level === 1,\n isInBlocksSelector: true,\n snippets: ['#'],\n dragHandleTopMargin: '14px',\n },\n 'heading-two': {\n renderElement: (props) => <H2 {...props.attributes}>{props.children}</H2>,\n icon: HeadingTwo,\n label: {\n id: 'components.Blocks.blocks.heading2',\n defaultMessage: 'Heading 2',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 2),\n matchNode: (node) => node.type === 'heading' && node.level === 2,\n isInBlocksSelector: true,\n snippets: ['##'],\n dragHandleTopMargin: '10px',\n },\n 'heading-three': {\n renderElement: (props) => <H3 {...props.attributes}>{props.children}</H3>,\n icon: HeadingThree,\n label: {\n id: 'components.Blocks.blocks.heading3',\n defaultMessage: 'Heading 3',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 3),\n matchNode: (node) => node.type === 'heading' && node.level === 3,\n isInBlocksSelector: true,\n snippets: ['###'],\n dragHandleTopMargin: '7px',\n },\n 'heading-four': {\n renderElement: (props) => <H4 {...props.attributes}>{props.children}</H4>,\n icon: HeadingFour,\n label: {\n id: 'components.Blocks.blocks.heading4',\n defaultMessage: 'Heading 4',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 4),\n matchNode: (node) => node.type === 'heading' && node.level === 4,\n isInBlocksSelector: true,\n snippets: ['####'],\n dragHandleTopMargin: '4px',\n },\n 'heading-five': {\n renderElement: (props) => <H5 {...props.attributes}>{props.children}</H5>,\n icon: HeadingFive,\n label: {\n id: 'components.Blocks.blocks.heading5',\n defaultMessage: 'Heading 5',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 5),\n matchNode: (node) => node.type === 'heading' && node.level === 5,\n isInBlocksSelector: true,\n snippets: ['#####'],\n },\n 'heading-six': {\n renderElement: (props) => <H6 {...props.attributes}>{props.children}</H6>,\n icon: HeadingSix,\n label: {\n id: 'components.Blocks.blocks.heading6',\n defaultMessage: 'Heading 6',\n },\n handleConvert: (editor) => handleConvertToHeading(editor, 6),\n matchNode: (node) => node.type === 'heading' && node.level === 6,\n isInBlocksSelector: true,\n snippets: ['######'],\n dragHandleTopMargin: '-2px',\n },\n};\n\nexport { headingBlocks };\n"],"names":["H1","styled","Typography","attrs","tag","theme","breakpoints","medium","lineHeights","H2","H3","H4","H5","H6","handleConvertToHeading","editor","level","baseHandleConvert","type","headingBlocks","renderElement","props","_jsx","attributes","children","icon","HeadingOne","label","id","defaultMessage","handleConvert","matchNode","node","isInBlocksSelector","snippets","dragHandleTopMargin","HeadingTwo","HeadingThree","HeadingFour","HeadingFive","HeadingSix"],"mappings":";;;;;;;AAkBA,MAAMA,EAAKC,GAAAA,MAAAA,CAAkCC,UAAYC,CAAAA,CAAAA,KAAK,CAAC;IAAEC,GAAK,EAAA;AAAK,CAAA,CAAE;;EAE3E,EAAE,CAAC,EAAEC,KAAK,EAAE,GAAKA,KAAMC,CAAAA,WAAW,CAACC,MAAM,CAAC;;;;eAI7B,EAAE,CA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,EAAA,CAACC,OAASA,IAAKd,CAAAA,IAAI,KAAK,SAAac,IAAAA,IAAAA,CAAKhB,KAAK,KAAK,CAAA;QAC/DiB,kBAAoB,EAAA,IAAA;QACpBC,QAAU,EAAA;AAAC,YAAA;AAAS,SAAA;QACpBC,mBAAqB,EAAA;AACvB;AACF;;;;"}
|
|
@@ -88,23 +88,35 @@ const Wrapper = styledComponents.styled.div`
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
h1 {
|
|
91
|
-
font-size:
|
|
91
|
+
font-size: 2.8rem;
|
|
92
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
93
|
+
font-size: 3.6rem;
|
|
94
|
+
}
|
|
92
95
|
font-weight: 600;
|
|
93
96
|
}
|
|
94
97
|
|
|
95
98
|
h2 {
|
|
96
|
-
font-size:
|
|
97
|
-
|
|
99
|
+
font-size: 2.2rem;
|
|
100
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
101
|
+
font-size: 3rem;
|
|
102
|
+
}
|
|
103
|
+
font-weight: 600;
|
|
98
104
|
}
|
|
99
105
|
|
|
100
106
|
h3 {
|
|
101
|
-
font-size:
|
|
102
|
-
|
|
107
|
+
font-size: 2rem;
|
|
108
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
109
|
+
font-size: 2.4rem;
|
|
110
|
+
}
|
|
111
|
+
font-weight: 600;
|
|
103
112
|
}
|
|
104
113
|
|
|
105
114
|
h4 {
|
|
106
|
-
font-size:
|
|
107
|
-
|
|
115
|
+
font-size: 1.8rem;
|
|
116
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
117
|
+
font-size: 2.4rem;
|
|
118
|
+
}
|
|
119
|
+
font-weight: 600;
|
|
108
120
|
}
|
|
109
121
|
|
|
110
122
|
strong {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewWysiwyg.js","sources":["../../../../../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport sanitizeHtml from 'sanitize-html';\nimport { styled } from 'styled-components';\n\nimport { md } from './utils/mdRenderer';\n\ninterface PreviewWysiwygProps {\n data?: string;\n}\n\nconst PreviewWysiwyg = ({ data = '' }: PreviewWysiwygProps) => {\n const html = React.useMemo(\n () =>\n sanitizeHtml(md.render(data.replaceAll('\\\\n', '\\n') || ''), {\n ...sanitizeHtml.defaults,\n allowedTags: false,\n allowedAttributes: {\n '*': ['href', 'align', 'alt', 'center', 'width', 'height', 'type', 'controls', 'target'],\n img: ['src', 'alt'],\n source: ['src', 'type'],\n },\n }),\n [data]\n );\n\n return (\n <Wrapper>\n <div dangerouslySetInnerHTML={{ __html: html }} />\n </Wrapper>\n );\n};\n\nconst Wrapper = styled.div`\n position: absolute;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};\n font-size: 1.4rem;\n background-color: ${({ theme }) => theme.colors.neutral0};\n color: ${({ theme }) => theme.colors.neutral800};\n line-height: ${({ theme }) => theme.lineHeights[6]};\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin-block-start: ${({ theme }) => theme.spaces[2]};\n margin-block-end: ${({ theme }) => theme.spaces[2]};\n }\n\n p {\n margin-bottom: ${({ theme }) => theme.spaces[2]};\n }\n\n h1 {\n font-size: 3.6rem;\n font-weight: 600;\n }\n\n h2 {\n font-size: 3rem;\n font-weight:
|
|
1
|
+
{"version":3,"file":"PreviewWysiwyg.js","sources":["../../../../../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport sanitizeHtml from 'sanitize-html';\nimport { styled } from 'styled-components';\n\nimport { md } from './utils/mdRenderer';\n\ninterface PreviewWysiwygProps {\n data?: string;\n}\n\nconst PreviewWysiwyg = ({ data = '' }: PreviewWysiwygProps) => {\n const html = React.useMemo(\n () =>\n sanitizeHtml(md.render(data.replaceAll('\\\\n', '\\n') || ''), {\n ...sanitizeHtml.defaults,\n allowedTags: false,\n allowedAttributes: {\n '*': ['href', 'align', 'alt', 'center', 'width', 'height', 'type', 'controls', 'target'],\n img: ['src', 'alt'],\n source: ['src', 'type'],\n },\n }),\n [data]\n );\n\n return (\n <Wrapper>\n <div dangerouslySetInnerHTML={{ __html: html }} />\n </Wrapper>\n );\n};\n\nconst Wrapper = styled.div`\n position: absolute;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};\n font-size: 1.4rem;\n background-color: ${({ theme }) => theme.colors.neutral0};\n color: ${({ theme }) => theme.colors.neutral800};\n line-height: ${({ theme }) => theme.lineHeights[6]};\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin-block-start: ${({ theme }) => theme.spaces[2]};\n margin-block-end: ${({ theme }) => theme.spaces[2]};\n }\n\n p {\n margin-bottom: ${({ theme }) => theme.spaces[2]};\n }\n\n h1 {\n font-size: 2.8rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 3.6rem;\n }\n font-weight: 600;\n }\n\n h2 {\n font-size: 2.2rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 3rem;\n }\n font-weight: 600;\n }\n\n h3 {\n font-size: 2rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 2.4rem;\n }\n font-weight: 600;\n }\n\n h4 {\n font-size: 1.8rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 2.4rem;\n }\n font-weight: 600;\n }\n\n strong {\n font-weight: 800;\n }\n\n em {\n font-style: italic;\n }\n\n blockquote {\n margin-top: ${({ theme }) => theme.spaces[8]};\n margin-bottom: ${({ theme }) => theme.spaces[7]};\n font-size: 1.4rem;\n font-weight: 400;\n border-left: 4px solid ${({ theme }) => theme.colors.neutral150};\n font-style: italic;\n padding: ${({ theme }) => theme.spaces[2]} ${({ theme }) => theme.spaces[5]};\n }\n\n img {\n max-width: 100%;\n }\n\n table {\n thead {\n background: ${({ theme }) => theme.colors.neutral150};\n\n th {\n padding: ${({ theme }) => theme.spaces[4]};\n }\n }\n tr {\n border: 1px solid ${({ theme }) => theme.colors.neutral200};\n }\n th,\n td {\n padding: ${({ theme }) => theme.spaces[4]};\n border: 1px solid ${({ theme }) => theme.colors.neutral200};\n border-bottom: 0;\n border-top: 0;\n }\n }\n\n pre,\n code {\n font-size: 1.4rem;\n border-radius: 4px;\n /* \n Hard coded since the color is the same between themes,\n theme.colors.neutral800 changes between themes.\n\n Matches the color of the JSON Input component.\n */\n background-color: #32324d;\n max-width: 100%;\n overflow: auto;\n padding: ${({ theme }) => theme.spaces[2]};\n }\n\n /* Inline code */\n p,\n pre,\n td {\n > code {\n color: #839496;\n }\n }\n\n ol {\n list-style-type: decimal;\n margin-block-start: ${({ theme }) => theme.spaces[4]};\n margin-block-end: ${({ theme }) => theme.spaces[4]};\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding-inline-start: ${({ theme }) => theme.spaces[4]};\n\n ol,\n ul {\n margin-block-start: 0px;\n margin-block-end: 0px;\n }\n }\n\n ul {\n list-style-type: disc;\n margin-block-start: ${({ theme }) => theme.spaces[4]};\n margin-block-end: ${({ theme }) => theme.spaces[4]};\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding-inline-start: ${({ theme }) => theme.spaces[4]};\n\n ul,\n ol {\n margin-block-start: 0px;\n margin-block-end: 0px;\n }\n }\n`;\n\nexport { PreviewWysiwyg };\n"],"names":["PreviewWysiwyg","data","html","React","useMemo","sanitizeHtml","md","render","replaceAll","defaults","allowedTags","allowedAttributes","img","source","_jsx","Wrapper","div","dangerouslySetInnerHTML","__html","styled","theme","spaces","colors","neutral0","neutral800","lineHeights","breakpoints","medium","neutral150","neutral200"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,MAAMA,cAAiB,GAAA,CAAC,EAAEC,IAAAA,GAAO,EAAE,EAAuB,GAAA;AAC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>theme.breakpoints.medium} {
|
|
72
|
+
font-size: 3.6rem;
|
|
73
|
+
}
|
|
71
74
|
font-weight: 600;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
h2 {
|
|
75
|
-
font-size:
|
|
76
|
-
|
|
78
|
+
font-size: 2.2rem;
|
|
79
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
80
|
+
font-size: 3rem;
|
|
81
|
+
}
|
|
82
|
+
font-weight: 600;
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
h3 {
|
|
80
|
-
font-size:
|
|
81
|
-
|
|
86
|
+
font-size: 2rem;
|
|
87
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
88
|
+
font-size: 2.4rem;
|
|
89
|
+
}
|
|
90
|
+
font-weight: 600;
|
|
82
91
|
}
|
|
83
92
|
|
|
84
93
|
h4 {
|
|
85
|
-
font-size:
|
|
86
|
-
|
|
94
|
+
font-size: 1.8rem;
|
|
95
|
+
${({ theme })=>theme.breakpoints.medium} {
|
|
96
|
+
font-size: 2.4rem;
|
|
97
|
+
}
|
|
98
|
+
font-weight: 600;
|
|
87
99
|
}
|
|
88
100
|
|
|
89
101
|
strong {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewWysiwyg.mjs","sources":["../../../../../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport sanitizeHtml from 'sanitize-html';\nimport { styled } from 'styled-components';\n\nimport { md } from './utils/mdRenderer';\n\ninterface PreviewWysiwygProps {\n data?: string;\n}\n\nconst PreviewWysiwyg = ({ data = '' }: PreviewWysiwygProps) => {\n const html = React.useMemo(\n () =>\n sanitizeHtml(md.render(data.replaceAll('\\\\n', '\\n') || ''), {\n ...sanitizeHtml.defaults,\n allowedTags: false,\n allowedAttributes: {\n '*': ['href', 'align', 'alt', 'center', 'width', 'height', 'type', 'controls', 'target'],\n img: ['src', 'alt'],\n source: ['src', 'type'],\n },\n }),\n [data]\n );\n\n return (\n <Wrapper>\n <div dangerouslySetInnerHTML={{ __html: html }} />\n </Wrapper>\n );\n};\n\nconst Wrapper = styled.div`\n position: absolute;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};\n font-size: 1.4rem;\n background-color: ${({ theme }) => theme.colors.neutral0};\n color: ${({ theme }) => theme.colors.neutral800};\n line-height: ${({ theme }) => theme.lineHeights[6]};\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin-block-start: ${({ theme }) => theme.spaces[2]};\n margin-block-end: ${({ theme }) => theme.spaces[2]};\n }\n\n p {\n margin-bottom: ${({ theme }) => theme.spaces[2]};\n }\n\n h1 {\n font-size: 3.6rem;\n font-weight: 600;\n }\n\n h2 {\n font-size: 3rem;\n font-weight:
|
|
1
|
+
{"version":3,"file":"PreviewWysiwyg.mjs","sources":["../../../../../../../admin/src/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport sanitizeHtml from 'sanitize-html';\nimport { styled } from 'styled-components';\n\nimport { md } from './utils/mdRenderer';\n\ninterface PreviewWysiwygProps {\n data?: string;\n}\n\nconst PreviewWysiwyg = ({ data = '' }: PreviewWysiwygProps) => {\n const html = React.useMemo(\n () =>\n sanitizeHtml(md.render(data.replaceAll('\\\\n', '\\n') || ''), {\n ...sanitizeHtml.defaults,\n allowedTags: false,\n allowedAttributes: {\n '*': ['href', 'align', 'alt', 'center', 'width', 'height', 'type', 'controls', 'target'],\n img: ['src', 'alt'],\n source: ['src', 'type'],\n },\n }),\n [data]\n );\n\n return (\n <Wrapper>\n <div dangerouslySetInnerHTML={{ __html: html }} />\n </Wrapper>\n );\n};\n\nconst Wrapper = styled.div`\n position: absolute;\n top: 0;\n width: 100%;\n height: 100%;\n overflow: auto;\n padding: ${({ theme }) => `${theme.spaces[3]} ${theme.spaces[4]}`};\n font-size: 1.4rem;\n background-color: ${({ theme }) => theme.colors.neutral0};\n color: ${({ theme }) => theme.colors.neutral800};\n line-height: ${({ theme }) => theme.lineHeights[6]};\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n margin-block-start: ${({ theme }) => theme.spaces[2]};\n margin-block-end: ${({ theme }) => theme.spaces[2]};\n }\n\n p {\n margin-bottom: ${({ theme }) => theme.spaces[2]};\n }\n\n h1 {\n font-size: 2.8rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 3.6rem;\n }\n font-weight: 600;\n }\n\n h2 {\n font-size: 2.2rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 3rem;\n }\n font-weight: 600;\n }\n\n h3 {\n font-size: 2rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 2.4rem;\n }\n font-weight: 600;\n }\n\n h4 {\n font-size: 1.8rem;\n ${({ theme }) => theme.breakpoints.medium} {\n font-size: 2.4rem;\n }\n font-weight: 600;\n }\n\n strong {\n font-weight: 800;\n }\n\n em {\n font-style: italic;\n }\n\n blockquote {\n margin-top: ${({ theme }) => theme.spaces[8]};\n margin-bottom: ${({ theme }) => theme.spaces[7]};\n font-size: 1.4rem;\n font-weight: 400;\n border-left: 4px solid ${({ theme }) => theme.colors.neutral150};\n font-style: italic;\n padding: ${({ theme }) => theme.spaces[2]} ${({ theme }) => theme.spaces[5]};\n }\n\n img {\n max-width: 100%;\n }\n\n table {\n thead {\n background: ${({ theme }) => theme.colors.neutral150};\n\n th {\n padding: ${({ theme }) => theme.spaces[4]};\n }\n }\n tr {\n border: 1px solid ${({ theme }) => theme.colors.neutral200};\n }\n th,\n td {\n padding: ${({ theme }) => theme.spaces[4]};\n border: 1px solid ${({ theme }) => theme.colors.neutral200};\n border-bottom: 0;\n border-top: 0;\n }\n }\n\n pre,\n code {\n font-size: 1.4rem;\n border-radius: 4px;\n /* \n Hard coded since the color is the same between themes,\n theme.colors.neutral800 changes between themes.\n\n Matches the color of the JSON Input component.\n */\n background-color: #32324d;\n max-width: 100%;\n overflow: auto;\n padding: ${({ theme }) => theme.spaces[2]};\n }\n\n /* Inline code */\n p,\n pre,\n td {\n > code {\n color: #839496;\n }\n }\n\n ol {\n list-style-type: decimal;\n margin-block-start: ${({ theme }) => theme.spaces[4]};\n margin-block-end: ${({ theme }) => theme.spaces[4]};\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding-inline-start: ${({ theme }) => theme.spaces[4]};\n\n ol,\n ul {\n margin-block-start: 0px;\n margin-block-end: 0px;\n }\n }\n\n ul {\n list-style-type: disc;\n margin-block-start: ${({ theme }) => theme.spaces[4]};\n margin-block-end: ${({ theme }) => theme.spaces[4]};\n margin-inline-start: 0px;\n margin-inline-end: 0px;\n padding-inline-start: ${({ theme }) => theme.spaces[4]};\n\n ul,\n ol {\n margin-block-start: 0px;\n margin-block-end: 0px;\n }\n }\n`;\n\nexport { PreviewWysiwyg };\n"],"names":["PreviewWysiwyg","data","html","React","useMemo","sanitizeHtml","md","render","replaceAll","defaults","allowedTags","allowedAttributes","img","source","_jsx","Wrapper","div","dangerouslySetInnerHTML","__html","styled","theme","spaces","colors","neutral0","neutral800","lineHeights","breakpoints","medium","neutral150","neutral200"],"mappings":";;;;;;AAWA,MAAMA,cAAiB,GAAA,CAAC,EAAEC,IAAAA,GAAO,EAAE,EAAuB,GAAA;AACxD,IAAA,MAAMC,IAAOC,GAAAA,KAAAA,CAAMC,OAAO,CACxB,IACEC,YAAaC,CAAAA,EAAAA,CAAGC,MAAM,CAACN,IAAKO,CAAAA,UAAU,CAAC,KAAA,EAAO,SAAS,EAAK,CAAA,EAAA;AAC1D,YAAA,GAAGH,aAAaI,QAAQ;YACxBC,WAAa,EAAA,KAAA;YACbC,iBAAmB,EAAA;gBACjB,GAAK,EAAA;AAAC,oBAAA,MAAA;AAAQ,oBAAA,OAAA;AAAS,oBAAA,KAAA;AAAO,oBAAA,QAAA;AAAU,oBAAA,OAAA;AAAS,oBAAA,QAAA;A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;;;aAmBpD,EAAE,CAAC,EAAET,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;;;;;;;;;;;;;;wBActB,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;sBACnC,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;;;0BAG7B,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;;;;;;;;;;;wBAWnC,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;sBACnC,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;;;0BAG7B,EAAE,CAAC,EAAED,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAAC,CAAA,CAAE,CAAC;;;;;;;;AAQ3D,CAAC;;;;"}
|
|
@@ -40,7 +40,9 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
|
40
40
|
const Header = ({ isCreating, status, title: documentTitle = 'Untitled' })=>{
|
|
41
41
|
const { formatMessage } = reactIntl.useIntl();
|
|
42
42
|
const isCloning = reactRouterDom.useMatch(router.CLONE_PATH) !== null;
|
|
43
|
+
const isMobile = strapiAdmin.useIsMobile();
|
|
43
44
|
const params = reactRouterDom.useParams();
|
|
45
|
+
const [{ query: { status: activeTab = 'draft' } }] = strapiAdmin.useQueryParams();
|
|
44
46
|
const title = isCreating ? formatMessage({
|
|
45
47
|
id: 'content-manager.containers.edit.title.new',
|
|
46
48
|
defaultMessage: 'Create an entry'
|
|
@@ -48,17 +50,16 @@ const Header = ({ isCreating, status, title: documentTitle = 'Untitled' })=>{
|
|
|
48
50
|
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
49
51
|
direction: "column",
|
|
50
52
|
alignItems: "flex-start",
|
|
53
|
+
paddingLeft: strapiAdmin.RESPONSIVE_DEFAULT_SPACING,
|
|
54
|
+
paddingRight: strapiAdmin.RESPONSIVE_DEFAULT_SPACING,
|
|
51
55
|
paddingTop: {
|
|
52
56
|
initial: 4,
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
paddingBottom: {
|
|
56
|
-
initial: 0,
|
|
57
|
-
large: 4
|
|
57
|
+
medium: 6
|
|
58
58
|
},
|
|
59
|
+
paddingBottom: 4,
|
|
59
60
|
gap: 2,
|
|
60
61
|
children: [
|
|
61
|
-
/*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.BackButton, {
|
|
62
|
+
!isMobile && /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.BackButton, {
|
|
62
63
|
fallback: params.collectionType === collections.SINGLE_TYPES ? undefined : `../${collections.COLLECTION_TYPES}/${params.slug}`
|
|
63
64
|
}),
|
|
64
65
|
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
@@ -70,16 +71,50 @@ const Header = ({ isCreating, status, title: documentTitle = 'Untitled' })=>{
|
|
|
70
71
|
},
|
|
71
72
|
alignItems: "flex-start",
|
|
72
73
|
direction: {
|
|
73
|
-
initial: 'column',
|
|
74
|
+
initial: 'column-reverse',
|
|
74
75
|
medium: 'row'
|
|
75
76
|
},
|
|
76
77
|
children: [
|
|
77
|
-
/*#__PURE__*/ jsxRuntime.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
79
|
+
gap: 2,
|
|
80
|
+
justifyContent: "space-between",
|
|
81
|
+
alignItems: "flex-start",
|
|
82
|
+
width: "100%",
|
|
83
|
+
children: [
|
|
84
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
|
|
85
|
+
variant: "alpha",
|
|
86
|
+
tag: "h1",
|
|
87
|
+
children: title
|
|
88
|
+
}),
|
|
89
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
|
|
90
|
+
display: {
|
|
91
|
+
initial: 'block',
|
|
92
|
+
medium: 'none'
|
|
93
|
+
},
|
|
94
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(HeaderDocumentActions, {
|
|
95
|
+
activeTab: activeTab,
|
|
96
|
+
isCloning: isCloning
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
]
|
|
81
100
|
}),
|
|
82
|
-
/*#__PURE__*/ jsxRuntime.
|
|
101
|
+
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
102
|
+
width: {
|
|
103
|
+
initial: '100%',
|
|
104
|
+
medium: 'auto'
|
|
105
|
+
},
|
|
106
|
+
gap: 3,
|
|
107
|
+
justifyContent: "space-between",
|
|
108
|
+
children: [
|
|
109
|
+
isMobile && /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.BackButton, {
|
|
110
|
+
fallback: params.collectionType === collections.SINGLE_TYPES ? undefined : `../${collections.COLLECTION_TYPES}/${params.slug}`
|
|
111
|
+
}),
|
|
112
|
+
/*#__PURE__*/ jsxRuntime.jsx(HeaderToolbar, {
|
|
113
|
+
activeTab: activeTab,
|
|
114
|
+
isCloning: isCloning
|
|
115
|
+
})
|
|
116
|
+
]
|
|
117
|
+
})
|
|
83
118
|
]
|
|
84
119
|
}),
|
|
85
120
|
status ? /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
|
|
@@ -91,13 +126,44 @@ const Header = ({ isCreating, status, title: documentTitle = 'Untitled' })=>{
|
|
|
91
126
|
]
|
|
92
127
|
});
|
|
93
128
|
};
|
|
129
|
+
const HeaderDocumentActions = ({ activeTab, isCloning })=>{
|
|
130
|
+
const { model, id, document, meta, collectionType } = useDocument.useDoc();
|
|
131
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
132
|
+
const plugins = strapiAdmin.useStrapiApp('HeaderToolbar', (state)=>state.plugins);
|
|
133
|
+
return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.DescriptionComponentRenderer, {
|
|
134
|
+
props: {
|
|
135
|
+
activeTab,
|
|
136
|
+
model,
|
|
137
|
+
documentId: id,
|
|
138
|
+
document: isCloning ? undefined : document,
|
|
139
|
+
meta: isCloning ? undefined : meta,
|
|
140
|
+
collectionType
|
|
141
|
+
},
|
|
142
|
+
descriptions: plugins['content-manager'].apis.getDocumentActions('header'),
|
|
143
|
+
children: (actions)=>{
|
|
144
|
+
const headerActions = actions.filter((action)=>{
|
|
145
|
+
const positions = Array.isArray(action.position) ? action.position : [
|
|
146
|
+
action.position
|
|
147
|
+
];
|
|
148
|
+
return positions.includes('header');
|
|
149
|
+
});
|
|
150
|
+
return /*#__PURE__*/ jsxRuntime.jsx(DocumentActions.DocumentActionsMenu, {
|
|
151
|
+
actions: headerActions,
|
|
152
|
+
label: formatMessage({
|
|
153
|
+
id: 'content-manager.containers.edit.header.more-actions',
|
|
154
|
+
defaultMessage: 'More actions'
|
|
155
|
+
}),
|
|
156
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(Information, {
|
|
157
|
+
activeTab: activeTab
|
|
158
|
+
})
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
};
|
|
94
163
|
/**
|
|
95
164
|
* @description Contains the document actions that have `position: header`, if there are
|
|
96
165
|
* none we still render the menu because we render the information about the document there.
|
|
97
|
-
*/ const HeaderToolbar = ()=>{
|
|
98
|
-
const { formatMessage } = reactIntl.useIntl();
|
|
99
|
-
const isCloning = reactRouterDom.useMatch(router.CLONE_PATH) !== null;
|
|
100
|
-
const [{ query: { status = 'draft' } }] = strapiAdmin.useQueryParams();
|
|
166
|
+
*/ const HeaderToolbar = ({ activeTab, isCloning })=>{
|
|
101
167
|
const { model, id, document, meta, collectionType } = useDocument.useDoc();
|
|
102
168
|
const plugins = strapiAdmin.useStrapiApp('HeaderToolbar', (state)=>state.plugins);
|
|
103
169
|
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
@@ -105,7 +171,7 @@ const Header = ({ isCreating, status, title: documentTitle = 'Untitled' })=>{
|
|
|
105
171
|
children: [
|
|
106
172
|
/*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.DescriptionComponentRenderer, {
|
|
107
173
|
props: {
|
|
108
|
-
activeTab
|
|
174
|
+
activeTab,
|
|
109
175
|
model,
|
|
110
176
|
documentId: id,
|
|
111
177
|
document: isCloning ? undefined : document,
|
|
@@ -123,34 +189,15 @@ const Header = ({ isCreating, status, title: documentTitle = 'Untitled' })=>{
|
|
|
123
189
|
}
|
|
124
190
|
}
|
|
125
191
|
}),
|
|
126
|
-
/*#__PURE__*/ jsxRuntime.jsx(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
documentId: id,
|
|
131
|
-
document: isCloning ? undefined : document,
|
|
132
|
-
meta: isCloning ? undefined : meta,
|
|
133
|
-
collectionType
|
|
192
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
|
|
193
|
+
display: {
|
|
194
|
+
initial: 'none',
|
|
195
|
+
medium: 'block'
|
|
134
196
|
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
action.position
|
|
140
|
-
];
|
|
141
|
-
return positions.includes('header');
|
|
142
|
-
});
|
|
143
|
-
return /*#__PURE__*/ jsxRuntime.jsx(DocumentActions.DocumentActionsMenu, {
|
|
144
|
-
actions: headerActions,
|
|
145
|
-
label: formatMessage({
|
|
146
|
-
id: 'content-manager.containers.edit.header.more-actions',
|
|
147
|
-
defaultMessage: 'More actions'
|
|
148
|
-
}),
|
|
149
|
-
children: /*#__PURE__*/ jsxRuntime.jsx(Information, {
|
|
150
|
-
activeTab: status
|
|
151
|
-
})
|
|
152
|
-
});
|
|
153
|
-
}
|
|
197
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(HeaderDocumentActions, {
|
|
198
|
+
activeTab: activeTab,
|
|
199
|
+
isCloning: isCloning
|
|
200
|
+
})
|
|
154
201
|
})
|
|
155
202
|
]
|
|
156
203
|
});
|