@strapi/content-manager 0.0.0-next.f93d6eabe52aa7681655cfa08eedbc3708dbb90d → 0.0.0-next.fb92031f3d90f3d2a2d191ba65725b6c8e329a5d

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 (89) hide show
  1. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.js +7 -12
  2. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.js.map +1 -1
  3. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.mjs +8 -13
  4. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.mjs.map +1 -1
  5. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.js +46 -95
  6. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.js.map +1 -1
  7. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.mjs +48 -78
  8. package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.mjs.map +1 -1
  9. package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.js +2 -0
  10. package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.js.map +1 -1
  11. package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.mjs +2 -0
  12. package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.mjs.map +1 -1
  13. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.js +50 -97
  14. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.js.map +1 -1
  15. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.mjs +51 -79
  16. package/dist/admin/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.mjs.map +1 -1
  17. package/dist/admin/services/homepage.js +9 -5
  18. package/dist/admin/services/homepage.js.map +1 -1
  19. package/dist/admin/services/homepage.mjs +9 -5
  20. package/dist/admin/services/homepage.mjs.map +1 -1
  21. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.d.ts +2 -2
  22. package/dist/server/controllers/index.js +3 -1
  23. package/dist/server/controllers/index.js.map +1 -1
  24. package/dist/server/controllers/index.mjs +3 -1
  25. package/dist/server/controllers/index.mjs.map +1 -1
  26. package/dist/server/homepage/controllers/homepage.js +57 -0
  27. package/dist/server/homepage/controllers/homepage.js.map +1 -0
  28. package/dist/server/homepage/controllers/homepage.mjs +36 -0
  29. package/dist/server/homepage/controllers/homepage.mjs.map +1 -0
  30. package/dist/server/homepage/controllers/index.js +10 -0
  31. package/dist/server/homepage/controllers/index.js.map +1 -0
  32. package/dist/server/homepage/controllers/index.mjs +8 -0
  33. package/dist/server/homepage/controllers/index.mjs.map +1 -0
  34. package/dist/server/homepage/index.js +14 -0
  35. package/dist/server/homepage/index.js.map +1 -0
  36. package/dist/server/homepage/index.mjs +12 -0
  37. package/dist/server/homepage/index.mjs.map +1 -0
  38. package/dist/server/homepage/routes/homepage.js +25 -0
  39. package/dist/server/homepage/routes/homepage.js.map +1 -0
  40. package/dist/server/homepage/routes/homepage.mjs +23 -0
  41. package/dist/server/homepage/routes/homepage.mjs.map +1 -0
  42. package/dist/server/homepage/routes/index.js +13 -0
  43. package/dist/server/homepage/routes/index.js.map +1 -0
  44. package/dist/server/homepage/routes/index.mjs +11 -0
  45. package/dist/server/homepage/routes/index.mjs.map +1 -0
  46. package/dist/server/homepage/services/homepage.js +157 -0
  47. package/dist/server/homepage/services/homepage.js.map +1 -0
  48. package/dist/server/homepage/services/homepage.mjs +155 -0
  49. package/dist/server/homepage/services/homepage.mjs.map +1 -0
  50. package/dist/server/homepage/services/index.js +10 -0
  51. package/dist/server/homepage/services/index.js.map +1 -0
  52. package/dist/server/homepage/services/index.mjs +8 -0
  53. package/dist/server/homepage/services/index.mjs.map +1 -0
  54. package/dist/server/preview/services/preview.js +0 -1
  55. package/dist/server/preview/services/preview.js.map +1 -1
  56. package/dist/server/preview/services/preview.mjs +0 -1
  57. package/dist/server/preview/services/preview.mjs.map +1 -1
  58. package/dist/server/routes/index.js +3 -1
  59. package/dist/server/routes/index.js.map +1 -1
  60. package/dist/server/routes/index.mjs +3 -1
  61. package/dist/server/routes/index.mjs.map +1 -1
  62. package/dist/server/services/index.js +3 -1
  63. package/dist/server/services/index.js.map +1 -1
  64. package/dist/server/services/index.mjs +3 -1
  65. package/dist/server/services/index.mjs.map +1 -1
  66. package/dist/server/src/controllers/index.d.ts.map +1 -1
  67. package/dist/server/src/homepage/controllers/homepage.d.ts +7 -0
  68. package/dist/server/src/homepage/controllers/homepage.d.ts.map +1 -0
  69. package/dist/server/src/homepage/controllers/index.d.ts +2 -0
  70. package/dist/server/src/homepage/controllers/index.d.ts.map +1 -0
  71. package/dist/server/src/homepage/index.d.ts +16 -0
  72. package/dist/server/src/homepage/index.d.ts.map +1 -0
  73. package/dist/server/src/homepage/routes/homepage.d.ts +4 -0
  74. package/dist/server/src/homepage/routes/homepage.d.ts.map +1 -0
  75. package/dist/server/src/homepage/routes/index.d.ts +8 -0
  76. package/dist/server/src/homepage/routes/index.d.ts.map +1 -0
  77. package/dist/server/src/{services → homepage/services}/homepage.d.ts +1 -1
  78. package/dist/server/src/homepage/services/homepage.d.ts.map +1 -0
  79. package/dist/server/src/homepage/services/index.d.ts +9 -0
  80. package/dist/server/src/homepage/services/index.d.ts.map +1 -0
  81. package/dist/server/src/index.d.ts +7 -0
  82. package/dist/server/src/index.d.ts.map +1 -1
  83. package/dist/server/src/preview/services/preview.d.ts.map +1 -1
  84. package/dist/server/src/routes/index.d.ts +1 -0
  85. package/dist/server/src/routes/index.d.ts.map +1 -1
  86. package/dist/server/src/services/index.d.ts +6 -0
  87. package/dist/server/src/services/index.d.ts.map +1 -1
  88. package/package.json +5 -5
  89. package/dist/server/src/services/homepage.d.ts.map +0 -1
@@ -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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,SAAS,EAAA,IAAA;QACTY,SAAU,EAAA,QAAA;QACVH,UAAW,EAAA,SAAA;AAEVxC,QAAAA,QAAAA,EAAAA;;AAGP;AAEA,MAAMoB,aAAAA,GAAgBqC,uBAAsBlB,CAAAA,iBAAAA,CAAK;cACnC,EAAE,CAAC,EAAEmB,KAAK,EAAE,GACtB,CAAC,EAAEA,KAAMC,CAAAA,MAAM,CAACC,UAAU,CAAC,EAAEC,KAAKC,KAAK,CAAC,GAAM,GAAA,GAAA,CAAA,CAC3CC,QAAQ,CAAC,EACTC,CAAAA,CAAAA,QAAQ,CAAC,CAAA,EAAG,GAAK,CAAA,CAAA,CAAC,CAAC;AAC1B,CAAC;AAED,MAAMvB,aAAAA,GAAgBgB,uBAAqB5B,CAAAA,gBAAAA,CAAI;0BACrB,EAAE,CAAC,EAAE6B,KAAK,EAAE,GAAKA,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,aAAa,EAAE,GAAGC,iBAAAA,EAAAA;AAE1B,IAAA,IAAIL,YAAc,EAAA;QAChB,qBACEM,cAAA,CAACC,mBAAMC,IAAI,EAAA;YAACC,IAAMT,EAAAA,YAAAA;YAAcU,YAAcP,EAAAA,UAAAA;oCAC5CG,cAAA,CAACC,mBAAMI,OAAO,EAAA;gBAACC,KAAO,EAAA;oBAAEC,QAAU,EAAA,OAAA;oBAASC,KAAO,EAAA;AAAQ,iBAAA;AACxD,gBAAA,QAAA,gBAAAC,eAACC,CAAAA,iBAAAA,EAAAA;oBAAKC,MAAO,EAAA,MAAA;oBAAOH,KAAM,EAAA,MAAA;oBAAOI,UAAW,EAAA,YAAA;;sCAC1CZ,cAACa,CAAAA,aAAAA,EAAAA;4BAAcC,IAAK,EAAA,GAAA;4BAAIH,MAAO,EAAA,MAAA;AAC5BlB,4BAAAA,QAAAA,EAAAA;;sCAEHgB,eAACC,CAAAA,iBAAAA,EAAAA;4BAAKE,UAAW,EAAA,OAAA;4BAAQG,SAAU,EAAA,QAAA;4BAASD,IAAM,EAAA,CAAA;4BAAGH,MAAO,EAAA,MAAA;4BAA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AAC,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;AAA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aAAAA,GAAgBgB,MAAqB5B,CAAAA,GAAAA,CAAI;0BACrB,EAAE,CAAC,EAAE6B,KAAK,EAAE,GAAKA,KAAMC,CAAAA,MAAM,CAACM,UAAU,CAAC;AACnE,CAAC;AAEKpB,MAAAA,YAAAA,GAAeY,MAAOS,CAAAA,MAAAA,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.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,YAA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AEFzB,GAAC0B,CAAAA,QAAAA,EAAAA,EAAAA;;;;8CAGL1B,GAAC2B,CAAAA,GAAAA,EAAAA;oCAAIC,QAAS,EAAA,UAAA;oCAAWjB,MAAO,EAAA,MAAA;oCAAOH,KAAM,EAAA,MAAA;AAC3C,oCAAA,QAAA,gBAAAR,GAAC6B,CAAAA,cAAAA,EAAAA;wCAAeC,IAAMlC,EAAAA;;;;;;;;;AAOpC;AAEA,IAAA,qBACEI,GAACU,CAAAA,IAAAA,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,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;;;;"}
@@ -2,14 +2,18 @@
2
2
 
3
3
  var api = require('./api.js');
4
4
 
5
- const homepageService = api.contentManagerApi.injectEndpoints({
5
+ const homepageService = api.contentManagerApi.enhanceEndpoints({
6
+ addTagTypes: [
7
+ 'RecentDocumentList'
8
+ ]
9
+ }).injectEndpoints({
6
10
  /**
7
- * TODO: Remove overrideExisting when we remove the future flag
8
- * and delete the old homepage service in the admin
9
- */ overrideExisting: true,
11
+ * TODO: Remove overrideExisting when we remove the future flag
12
+ * and delete the old homepage service in the admin
13
+ */ overrideExisting: true,
10
14
  endpoints: (builder)=>({
11
15
  getRecentDocuments: builder.query({
12
- query: (params)=>`/admin/homepage/recent-documents?action=${params.action}`,
16
+ query: (params)=>`/content-manager/homepage/recent-documents?action=${params.action}`,
13
17
  transformResponse: (response)=>response.data,
14
18
  providesTags: (res, _err, { action })=>[
15
19
  {
@@ -1 +1 @@
1
- {"version":3,"file":"homepage.js","sources":["../../../admin/src/services/homepage.ts"],"sourcesContent":["import * as Homepage from '../../../shared/contracts/homepage';\n\nimport { contentManagerApi } from './api';\n\nconst homepageService = contentManagerApi.injectEndpoints({\n /**\n * TODO: Remove overrideExisting when we remove the future flag\n * and delete the old homepage service in the admin\n */\n overrideExisting: true,\n endpoints: (builder) => ({\n getRecentDocuments: builder.query<\n Homepage.GetRecentDocuments.Response['data'],\n Homepage.GetRecentDocuments.Request['query']\n >({\n query: (params) => `/admin/homepage/recent-documents?action=${params.action}`,\n transformResponse: (response: Homepage.GetRecentDocuments.Response) => response.data,\n providesTags: (res, _err, { action }) => [\n { type: 'RecentDocumentList' as const, id: action },\n ],\n }),\n }),\n});\n\nconst { useGetRecentDocumentsQuery } = homepageService;\n\nexport { useGetRecentDocumentsQuery };\n"],"names":["homepageService","contentManagerApi","injectEndpoints","overrideExisting","endpoints","builder","getRecentDocuments","query","params","action","transformResponse","response","data","providesTags","res","_err","type","id","useGetRecentDocumentsQuery"],"mappings":";;;;AAIA,MAAMA,eAAAA,GAAkBC,qBAAkBC,CAAAA,eAAe,CAAC;AACxD;;;AAGC,MACDC,gBAAkB,EAAA,IAAA;IAClBC,SAAW,EAAA,CAACC,WAAa;YACvBC,kBAAoBD,EAAAA,OAAAA,CAAQE,KAAK,CAG/B;gBACAA,KAAO,EAAA,CAACC,SAAW,CAAC,wCAAwC,EAAEA,MAAOC,CAAAA,MAAM,CAAC,CAAC;gBAC7EC,iBAAmB,EAAA,CAACC,QAAmDA,GAAAA,QAAAA,CAASC,IAAI;AACpFC,gBAAAA,YAAAA,EAAc,CAACC,GAAKC,EAAAA,IAAAA,EAAM,EAAEN,MAAM,EAAE,GAAK;AACvC,wBAAA;4BAAEO,IAAM,EAAA,oBAAA;4BAA+BC,EAAIR,EAAAA;AAAO;AACnD;AACH,aAAA;SACF;AACF,CAAA,CAAA;AAEM,MAAA,EAAES,0BAA0B,EAAE,GAAGlB;;;;"}
1
+ {"version":3,"file":"homepage.js","sources":["../../../admin/src/services/homepage.ts"],"sourcesContent":["import * as Homepage from '../../../shared/contracts/homepage';\n\nimport { contentManagerApi } from './api';\n\nconst homepageService = contentManagerApi\n .enhanceEndpoints({\n addTagTypes: ['RecentDocumentList'],\n })\n .injectEndpoints({\n /**\n * TODO: Remove overrideExisting when we remove the future flag\n * and delete the old homepage service in the admin\n */\n overrideExisting: true,\n endpoints: (builder) => ({\n getRecentDocuments: builder.query<\n Homepage.GetRecentDocuments.Response['data'],\n Homepage.GetRecentDocuments.Request['query']\n >({\n query: (params) => `/content-manager/homepage/recent-documents?action=${params.action}`,\n transformResponse: (response: Homepage.GetRecentDocuments.Response) => response.data,\n providesTags: (res, _err, { action }) => [\n { type: 'RecentDocumentList' as const, id: action },\n ],\n }),\n }),\n });\n\nconst { useGetRecentDocumentsQuery } = homepageService;\n\nexport { useGetRecentDocumentsQuery };\n"],"names":["homepageService","contentManagerApi","enhanceEndpoints","addTagTypes","injectEndpoints","overrideExisting","endpoints","builder","getRecentDocuments","query","params","action","transformResponse","response","data","providesTags","res","_err","type","id","useGetRecentDocumentsQuery"],"mappings":";;;;AAIA,MAAMA,eAAAA,GAAkBC,qBACrBC,CAAAA,gBAAgB,CAAC;IAChBC,WAAa,EAAA;AAAC,QAAA;AAAqB;AACrC,CAAA,CAAA,CACCC,eAAe,CAAC;AACf;;;AAGC,QACDC,gBAAkB,EAAA,IAAA;IAClBC,SAAW,EAAA,CAACC,WAAa;YACvBC,kBAAoBD,EAAAA,OAAAA,CAAQE,KAAK,CAG/B;gBACAA,KAAO,EAAA,CAACC,SAAW,CAAC,kDAAkD,EAAEA,MAAOC,CAAAA,MAAM,CAAC,CAAC;gBACvFC,iBAAmB,EAAA,CAACC,QAAmDA,GAAAA,QAAAA,CAASC,IAAI;AACpFC,gBAAAA,YAAAA,EAAc,CAACC,GAAKC,EAAAA,IAAAA,EAAM,EAAEN,MAAM,EAAE,GAAK;AACvC,wBAAA;4BAAEO,IAAM,EAAA,oBAAA;4BAA+BC,EAAIR,EAAAA;AAAO;AACnD;AACH,aAAA;SACF;AACF,CAAA,CAAA;AAEI,MAAA,EAAES,0BAA0B,EAAE,GAAGpB;;;;"}
@@ -1,13 +1,17 @@
1
1
  import { contentManagerApi } from './api.mjs';
2
2
 
3
- const homepageService = contentManagerApi.injectEndpoints({
3
+ const homepageService = contentManagerApi.enhanceEndpoints({
4
+ addTagTypes: [
5
+ 'RecentDocumentList'
6
+ ]
7
+ }).injectEndpoints({
4
8
  /**
5
- * TODO: Remove overrideExisting when we remove the future flag
6
- * and delete the old homepage service in the admin
7
- */ overrideExisting: true,
9
+ * TODO: Remove overrideExisting when we remove the future flag
10
+ * and delete the old homepage service in the admin
11
+ */ overrideExisting: true,
8
12
  endpoints: (builder)=>({
9
13
  getRecentDocuments: builder.query({
10
- query: (params)=>`/admin/homepage/recent-documents?action=${params.action}`,
14
+ query: (params)=>`/content-manager/homepage/recent-documents?action=${params.action}`,
11
15
  transformResponse: (response)=>response.data,
12
16
  providesTags: (res, _err, { action })=>[
13
17
  {
@@ -1 +1 @@
1
- {"version":3,"file":"homepage.mjs","sources":["../../../admin/src/services/homepage.ts"],"sourcesContent":["import * as Homepage from '../../../shared/contracts/homepage';\n\nimport { contentManagerApi } from './api';\n\nconst homepageService = contentManagerApi.injectEndpoints({\n /**\n * TODO: Remove overrideExisting when we remove the future flag\n * and delete the old homepage service in the admin\n */\n overrideExisting: true,\n endpoints: (builder) => ({\n getRecentDocuments: builder.query<\n Homepage.GetRecentDocuments.Response['data'],\n Homepage.GetRecentDocuments.Request['query']\n >({\n query: (params) => `/admin/homepage/recent-documents?action=${params.action}`,\n transformResponse: (response: Homepage.GetRecentDocuments.Response) => response.data,\n providesTags: (res, _err, { action }) => [\n { type: 'RecentDocumentList' as const, id: action },\n ],\n }),\n }),\n});\n\nconst { useGetRecentDocumentsQuery } = homepageService;\n\nexport { useGetRecentDocumentsQuery };\n"],"names":["homepageService","contentManagerApi","injectEndpoints","overrideExisting","endpoints","builder","getRecentDocuments","query","params","action","transformResponse","response","data","providesTags","res","_err","type","id","useGetRecentDocumentsQuery"],"mappings":";;AAIA,MAAMA,eAAAA,GAAkBC,iBAAkBC,CAAAA,eAAe,CAAC;AACxD;;;AAGC,MACDC,gBAAkB,EAAA,IAAA;IAClBC,SAAW,EAAA,CAACC,WAAa;YACvBC,kBAAoBD,EAAAA,OAAAA,CAAQE,KAAK,CAG/B;gBACAA,KAAO,EAAA,CAACC,SAAW,CAAC,wCAAwC,EAAEA,MAAOC,CAAAA,MAAM,CAAC,CAAC;gBAC7EC,iBAAmB,EAAA,CAACC,QAAmDA,GAAAA,QAAAA,CAASC,IAAI;AACpFC,gBAAAA,YAAAA,EAAc,CAACC,GAAKC,EAAAA,IAAAA,EAAM,EAAEN,MAAM,EAAE,GAAK;AACvC,wBAAA;4BAAEO,IAAM,EAAA,oBAAA;4BAA+BC,EAAIR,EAAAA;AAAO;AACnD;AACH,aAAA;SACF;AACF,CAAA,CAAA;AAEM,MAAA,EAAES,0BAA0B,EAAE,GAAGlB;;;;"}
1
+ {"version":3,"file":"homepage.mjs","sources":["../../../admin/src/services/homepage.ts"],"sourcesContent":["import * as Homepage from '../../../shared/contracts/homepage';\n\nimport { contentManagerApi } from './api';\n\nconst homepageService = contentManagerApi\n .enhanceEndpoints({\n addTagTypes: ['RecentDocumentList'],\n })\n .injectEndpoints({\n /**\n * TODO: Remove overrideExisting when we remove the future flag\n * and delete the old homepage service in the admin\n */\n overrideExisting: true,\n endpoints: (builder) => ({\n getRecentDocuments: builder.query<\n Homepage.GetRecentDocuments.Response['data'],\n Homepage.GetRecentDocuments.Request['query']\n >({\n query: (params) => `/content-manager/homepage/recent-documents?action=${params.action}`,\n transformResponse: (response: Homepage.GetRecentDocuments.Response) => response.data,\n providesTags: (res, _err, { action }) => [\n { type: 'RecentDocumentList' as const, id: action },\n ],\n }),\n }),\n });\n\nconst { useGetRecentDocumentsQuery } = homepageService;\n\nexport { useGetRecentDocumentsQuery };\n"],"names":["homepageService","contentManagerApi","enhanceEndpoints","addTagTypes","injectEndpoints","overrideExisting","endpoints","builder","getRecentDocuments","query","params","action","transformResponse","response","data","providesTags","res","_err","type","id","useGetRecentDocumentsQuery"],"mappings":";;AAIA,MAAMA,eAAAA,GAAkBC,iBACrBC,CAAAA,gBAAgB,CAAC;IAChBC,WAAa,EAAA;AAAC,QAAA;AAAqB;AACrC,CAAA,CAAA,CACCC,eAAe,CAAC;AACf;;;AAGC,QACDC,gBAAkB,EAAA,IAAA;IAClBC,SAAW,EAAA,CAACC,WAAa;YACvBC,kBAAoBD,EAAAA,OAAAA,CAAQE,KAAK,CAG/B;gBACAA,KAAO,EAAA,CAACC,SAAW,CAAC,kDAAkD,EAAEA,MAAOC,CAAAA,MAAM,CAAC,CAAC;gBACvFC,iBAAmB,EAAA,CAACC,QAAmDA,GAAAA,QAAAA,CAASC,IAAI;AACpFC,gBAAAA,YAAAA,EAAc,CAACC,GAAKC,EAAAA,IAAAA,EAAM,EAAEN,MAAM,EAAE,GAAK;AACvC,wBAAA;4BAAEO,IAAM,EAAA,oBAAA;4BAA+BC,EAAIR,EAAAA;AAAO;AACnD;AACH,aAAA;SACF;AACF,CAAA,CAAA;AAEI,MAAA,EAAES,0BAA0B,EAAE,GAAGpB;;;;"}
@@ -2,9 +2,9 @@ import * as React from 'react';
2
2
  interface EditorLayoutProps {
3
3
  children: React.ReactNode;
4
4
  error?: string;
5
- onCollapse: () => void;
5
+ onToggleExpand: () => void;
6
6
  disabled: boolean;
7
7
  ariaDescriptionId: string;
8
8
  }
9
- declare const EditorLayout: ({ children, error, disabled, onCollapse, ariaDescriptionId, }: EditorLayoutProps) => import("react/jsx-runtime").JSX.Element;
9
+ declare const EditorLayout: ({ children, error, disabled, onToggleExpand, ariaDescriptionId, }: EditorLayoutProps) => import("react/jsx-runtime").JSX.Element;
10
10
  export { EditorLayout };
@@ -9,6 +9,7 @@ var singleTypes = require('./single-types.js');
9
9
  var uid = require('./uid.js');
10
10
  var index = require('../history/index.js');
11
11
  var index$1 = require('../preview/index.js');
12
+ var index$2 = require('../homepage/index.js');
12
13
 
13
14
  var controllers = {
14
15
  'collection-types': collectionTypes,
@@ -19,7 +20,8 @@ var controllers = {
19
20
  'single-types': singleTypes,
20
21
  uid,
21
22
  ...index.controllers ? index.controllers : {},
22
- ...index$1.controllers ? index$1.controllers : {}
23
+ ...index$1.controllers ? index$1.controllers : {},
24
+ ...index$2.controllers
23
25
  };
24
26
 
25
27
  module.exports = controllers;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../server/src/controllers/index.ts"],"sourcesContent":["import collectionTypes from './collection-types';\nimport components from './components';\nimport contentTypes from './content-types';\nimport init from './init';\nimport relations from './relations';\nimport singleTypes from './single-types';\nimport uid from './uid';\nimport history from '../history';\nimport preview from '../preview';\n\nexport default {\n 'collection-types': collectionTypes,\n components,\n 'content-types': contentTypes,\n init,\n relations,\n 'single-types': singleTypes,\n uid,\n ...(history.controllers ? history.controllers : {}),\n ...(preview.controllers ? preview.controllers : {}),\n};\n"],"names":["collectionTypes","components","contentTypes","init","relations","singleTypes","uid","history","controllers","preview"],"mappings":";;;;;;;;;;;;AAUA,kBAAe;IACb,kBAAoBA,EAAAA,eAAAA;AACpBC,IAAAA,UAAAA;IACA,eAAiBC,EAAAA,YAAAA;AACjBC,IAAAA,IAAAA;AACAC,IAAAA,SAAAA;IACA,cAAgBC,EAAAA,WAAAA;AAChBC,IAAAA,GAAAA;AACA,IAAA,GAAIC,MAAQC,WAAW,GAAGD,MAAQC,WAAW,GAAG,EAAE;AAClD,IAAA,GAAIC,QAAQD,WAAW,GAAGC,QAAQD,WAAW,GAAG;AAClD,CAAE;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../server/src/controllers/index.ts"],"sourcesContent":["import collectionTypes from './collection-types';\nimport components from './components';\nimport contentTypes from './content-types';\nimport init from './init';\nimport relations from './relations';\nimport singleTypes from './single-types';\nimport uid from './uid';\nimport history from '../history';\nimport preview from '../preview';\nimport homepage from '../homepage';\n\nexport default {\n 'collection-types': collectionTypes,\n components,\n 'content-types': contentTypes,\n init,\n relations,\n 'single-types': singleTypes,\n uid,\n ...(history.controllers ? history.controllers : {}),\n ...(preview.controllers ? preview.controllers : {}),\n ...homepage.controllers,\n};\n"],"names":["collectionTypes","components","contentTypes","init","relations","singleTypes","uid","history","controllers","preview","homepage"],"mappings":";;;;;;;;;;;;;AAWA,kBAAe;IACb,kBAAoBA,EAAAA,eAAAA;AACpBC,IAAAA,UAAAA;IACA,eAAiBC,EAAAA,YAAAA;AACjBC,IAAAA,IAAAA;AACAC,IAAAA,SAAAA;IACA,cAAgBC,EAAAA,WAAAA;AAChBC,IAAAA,GAAAA;AACA,IAAA,GAAIC,MAAQC,WAAW,GAAGD,MAAQC,WAAW,GAAG,EAAE;AAClD,IAAA,GAAIC,QAAQD,WAAW,GAAGC,QAAQD,WAAW,GAAG,EAAE;AAClD,IAAA,GAAGE,QAASF;AACd,CAAE;;;;"}
@@ -7,6 +7,7 @@ import singleTypes from './single-types.mjs';
7
7
  import uid from './uid.mjs';
8
8
  import history from '../history/index.mjs';
9
9
  import preview from '../preview/index.mjs';
10
+ import homepage from '../homepage/index.mjs';
10
11
 
11
12
  var controllers = {
12
13
  'collection-types': collectionTypes,
@@ -17,7 +18,8 @@ var controllers = {
17
18
  'single-types': singleTypes,
18
19
  uid,
19
20
  ...history.controllers ? history.controllers : {},
20
- ...preview.controllers ? preview.controllers : {}
21
+ ...preview.controllers ? preview.controllers : {},
22
+ ...homepage.controllers
21
23
  };
22
24
 
23
25
  export { controllers as default };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../server/src/controllers/index.ts"],"sourcesContent":["import collectionTypes from './collection-types';\nimport components from './components';\nimport contentTypes from './content-types';\nimport init from './init';\nimport relations from './relations';\nimport singleTypes from './single-types';\nimport uid from './uid';\nimport history from '../history';\nimport preview from '../preview';\n\nexport default {\n 'collection-types': collectionTypes,\n components,\n 'content-types': contentTypes,\n init,\n relations,\n 'single-types': singleTypes,\n uid,\n ...(history.controllers ? history.controllers : {}),\n ...(preview.controllers ? preview.controllers : {}),\n};\n"],"names":["collectionTypes","components","contentTypes","init","relations","singleTypes","uid","history","controllers","preview"],"mappings":";;;;;;;;;;AAUA,kBAAe;IACb,kBAAoBA,EAAAA,eAAAA;AACpBC,IAAAA,UAAAA;IACA,eAAiBC,EAAAA,YAAAA;AACjBC,IAAAA,IAAAA;AACAC,IAAAA,SAAAA;IACA,cAAgBC,EAAAA,WAAAA;AAChBC,IAAAA,GAAAA;AACA,IAAA,GAAIC,QAAQC,WAAW,GAAGD,QAAQC,WAAW,GAAG,EAAE;AAClD,IAAA,GAAIC,QAAQD,WAAW,GAAGC,QAAQD,WAAW,GAAG;AAClD,CAAE;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../server/src/controllers/index.ts"],"sourcesContent":["import collectionTypes from './collection-types';\nimport components from './components';\nimport contentTypes from './content-types';\nimport init from './init';\nimport relations from './relations';\nimport singleTypes from './single-types';\nimport uid from './uid';\nimport history from '../history';\nimport preview from '../preview';\nimport homepage from '../homepage';\n\nexport default {\n 'collection-types': collectionTypes,\n components,\n 'content-types': contentTypes,\n init,\n relations,\n 'single-types': singleTypes,\n uid,\n ...(history.controllers ? history.controllers : {}),\n ...(preview.controllers ? preview.controllers : {}),\n ...homepage.controllers,\n};\n"],"names":["collectionTypes","components","contentTypes","init","relations","singleTypes","uid","history","controllers","preview","homepage"],"mappings":";;;;;;;;;;;AAWA,kBAAe;IACb,kBAAoBA,EAAAA,eAAAA;AACpBC,IAAAA,UAAAA;IACA,eAAiBC,EAAAA,YAAAA;AACjBC,IAAAA,IAAAA;AACAC,IAAAA,SAAAA;IACA,cAAgBC,EAAAA,WAAAA;AAChBC,IAAAA,GAAAA;AACA,IAAA,GAAIC,QAAQC,WAAW,GAAGD,QAAQC,WAAW,GAAG,EAAE;AAClD,IAAA,GAAIC,QAAQD,WAAW,GAAGC,QAAQD,WAAW,GAAG,EAAE;AAClD,IAAA,GAAGE,SAASF;AACd,CAAE;;;;"}
@@ -0,0 +1,57 @@
1
+ 'use strict';
2
+
3
+ var yup = require('yup');
4
+ var strapiUtils = require('@strapi/utils');
5
+
6
+ function _interopNamespaceDefault(e) {
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
24
+
25
+ const createHomepageController = ()=>{
26
+ const homepageService = strapi.plugin('content-manager').service('homepage');
27
+ const recentDocumentParamsSchema = yup__namespace.object().shape({
28
+ action: yup__namespace.mixed().oneOf([
29
+ 'update',
30
+ 'publish'
31
+ ]).required()
32
+ });
33
+ return {
34
+ async getRecentDocuments (ctx) {
35
+ let action;
36
+ try {
37
+ action = (await recentDocumentParamsSchema.validate(ctx.query)).action;
38
+ } catch (error) {
39
+ if (error instanceof yup__namespace.ValidationError) {
40
+ throw new strapiUtils.errors.ValidationError(error.message);
41
+ }
42
+ throw error;
43
+ }
44
+ if (action === 'publish') {
45
+ return {
46
+ data: await homepageService.getRecentlyPublishedDocuments()
47
+ };
48
+ }
49
+ return {
50
+ data: await homepageService.getRecentlyUpdatedDocuments()
51
+ };
52
+ }
53
+ };
54
+ };
55
+
56
+ exports.createHomepageController = createHomepageController;
57
+ //# sourceMappingURL=homepage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"homepage.js","sources":["../../../../server/src/homepage/controllers/homepage.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport * as yup from 'yup';\nimport { errors } from '@strapi/utils';\nimport type { GetRecentDocuments } from '../../../../shared/contracts/homepage';\n\nconst createHomepageController = () => {\n const homepageService = strapi.plugin('content-manager').service('homepage');\n\n const recentDocumentParamsSchema = yup.object().shape({\n action: yup\n .mixed<GetRecentDocuments.Request['query']['action']>()\n .oneOf(['update', 'publish'])\n .required(),\n });\n\n return {\n async getRecentDocuments(ctx): Promise<GetRecentDocuments.Response> {\n let action;\n\n try {\n action = (await recentDocumentParamsSchema.validate(ctx.query)).action;\n } catch (error) {\n if (error instanceof yup.ValidationError) {\n throw new errors.ValidationError(error.message);\n }\n throw error;\n }\n\n if (action === 'publish') {\n return { data: await homepageService.getRecentlyPublishedDocuments() };\n }\n\n return { data: await homepageService.getRecentlyUpdatedDocuments() };\n },\n } satisfies Core.Controller;\n};\n\nexport { createHomepageController };\n"],"names":["createHomepageController","homepageService","strapi","plugin","service","recentDocumentParamsSchema","yup","object","shape","action","mixed","oneOf","required","getRecentDocuments","ctx","validate","query","error","ValidationError","errors","message","data","getRecentlyPublishedDocuments","getRecentlyUpdatedDocuments"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAMA,wBAA2B,GAAA,IAAA;AAC/B,IAAA,MAAMC,kBAAkBC,MAAOC,CAAAA,MAAM,CAAC,iBAAA,CAAA,CAAmBC,OAAO,CAAC,UAAA,CAAA;AAEjE,IAAA,MAAMC,0BAA6BC,GAAAA,cAAAA,CAAIC,MAAM,EAAA,CAAGC,KAAK,CAAC;AACpDC,QAAAA,MAAAA,EAAQH,cACLI,CAAAA,KAAK,EACLC,CAAAA,KAAK,CAAC;AAAC,YAAA,QAAA;AAAU,YAAA;AAAU,SAAA,CAAA,CAC3BC,QAAQ;AACb,KAAA,CAAA;IAEA,OAAO;AACL,QAAA,MAAMC,oBAAmBC,GAAG,EAAA;YAC1B,IAAIL,MAAAA;YAEJ,IAAI;gBACFA,MAAS,GAAC,CAAA,MAAMJ,0BAA2BU,CAAAA,QAAQ,CAACD,GAAIE,CAAAA,KAAK,CAAA,EAAGP,MAAM;AACxE,aAAA,CAAE,OAAOQ,KAAO,EAAA;gBACd,IAAIA,KAAAA,YAAiBX,cAAIY,CAAAA,eAAe,EAAE;AACxC,oBAAA,MAAM,IAAIC,kBAAAA,CAAOD,eAAe,CAACD,MAAMG,OAAO,CAAA;AAChD;gBACA,MAAMH,KAAAA;AACR;AAEA,YAAA,IAAIR,WAAW,SAAW,EAAA;gBACxB,OAAO;oBAAEY,IAAM,EAAA,MAAMpB,gBAAgBqB,6BAA6B;AAAG,iBAAA;AACvE;YAEA,OAAO;gBAAED,IAAM,EAAA,MAAMpB,gBAAgBsB,2BAA2B;AAAG,aAAA;AACrE;AACF,KAAA;AACF;;;;"}
@@ -0,0 +1,36 @@
1
+ import * as yup from 'yup';
2
+ import { errors } from '@strapi/utils';
3
+
4
+ const createHomepageController = ()=>{
5
+ const homepageService = strapi.plugin('content-manager').service('homepage');
6
+ const recentDocumentParamsSchema = yup.object().shape({
7
+ action: yup.mixed().oneOf([
8
+ 'update',
9
+ 'publish'
10
+ ]).required()
11
+ });
12
+ return {
13
+ async getRecentDocuments (ctx) {
14
+ let action;
15
+ try {
16
+ action = (await recentDocumentParamsSchema.validate(ctx.query)).action;
17
+ } catch (error) {
18
+ if (error instanceof yup.ValidationError) {
19
+ throw new errors.ValidationError(error.message);
20
+ }
21
+ throw error;
22
+ }
23
+ if (action === 'publish') {
24
+ return {
25
+ data: await homepageService.getRecentlyPublishedDocuments()
26
+ };
27
+ }
28
+ return {
29
+ data: await homepageService.getRecentlyUpdatedDocuments()
30
+ };
31
+ }
32
+ };
33
+ };
34
+
35
+ export { createHomepageController };
36
+ //# sourceMappingURL=homepage.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"homepage.mjs","sources":["../../../../server/src/homepage/controllers/homepage.ts"],"sourcesContent":["import type { Core } from '@strapi/types';\nimport * as yup from 'yup';\nimport { errors } from '@strapi/utils';\nimport type { GetRecentDocuments } from '../../../../shared/contracts/homepage';\n\nconst createHomepageController = () => {\n const homepageService = strapi.plugin('content-manager').service('homepage');\n\n const recentDocumentParamsSchema = yup.object().shape({\n action: yup\n .mixed<GetRecentDocuments.Request['query']['action']>()\n .oneOf(['update', 'publish'])\n .required(),\n });\n\n return {\n async getRecentDocuments(ctx): Promise<GetRecentDocuments.Response> {\n let action;\n\n try {\n action = (await recentDocumentParamsSchema.validate(ctx.query)).action;\n } catch (error) {\n if (error instanceof yup.ValidationError) {\n throw new errors.ValidationError(error.message);\n }\n throw error;\n }\n\n if (action === 'publish') {\n return { data: await homepageService.getRecentlyPublishedDocuments() };\n }\n\n return { data: await homepageService.getRecentlyUpdatedDocuments() };\n },\n } satisfies Core.Controller;\n};\n\nexport { createHomepageController };\n"],"names":["createHomepageController","homepageService","strapi","plugin","service","recentDocumentParamsSchema","yup","object","shape","action","mixed","oneOf","required","getRecentDocuments","ctx","validate","query","error","ValidationError","errors","message","data","getRecentlyPublishedDocuments","getRecentlyUpdatedDocuments"],"mappings":";;;AAKA,MAAMA,wBAA2B,GAAA,IAAA;AAC/B,IAAA,MAAMC,kBAAkBC,MAAOC,CAAAA,MAAM,CAAC,iBAAA,CAAA,CAAmBC,OAAO,CAAC,UAAA,CAAA;AAEjE,IAAA,MAAMC,0BAA6BC,GAAAA,GAAAA,CAAIC,MAAM,EAAA,CAAGC,KAAK,CAAC;AACpDC,QAAAA,MAAAA,EAAQH,GACLI,CAAAA,KAAK,EACLC,CAAAA,KAAK,CAAC;AAAC,YAAA,QAAA;AAAU,YAAA;AAAU,SAAA,CAAA,CAC3BC,QAAQ;AACb,KAAA,CAAA;IAEA,OAAO;AACL,QAAA,MAAMC,oBAAmBC,GAAG,EAAA;YAC1B,IAAIL,MAAAA;YAEJ,IAAI;gBACFA,MAAS,GAAC,CAAA,MAAMJ,0BAA2BU,CAAAA,QAAQ,CAACD,GAAIE,CAAAA,KAAK,CAAA,EAAGP,MAAM;AACxE,aAAA,CAAE,OAAOQ,KAAO,EAAA;gBACd,IAAIA,KAAAA,YAAiBX,GAAIY,CAAAA,eAAe,EAAE;AACxC,oBAAA,MAAM,IAAIC,MAAAA,CAAOD,eAAe,CAACD,MAAMG,OAAO,CAAA;AAChD;gBACA,MAAMH,KAAAA;AACR;AAEA,YAAA,IAAIR,WAAW,SAAW,EAAA;gBACxB,OAAO;oBAAEY,IAAM,EAAA,MAAMpB,gBAAgBqB,6BAA6B;AAAG,iBAAA;AACvE;YAEA,OAAO;gBAAED,IAAM,EAAA,MAAMpB,gBAAgBsB,2BAA2B;AAAG,aAAA;AACrE;AACF,KAAA;AACF;;;;"}
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ var homepage = require('./homepage.js');
4
+
5
+ const controllers = {
6
+ homepage: homepage.createHomepageController
7
+ };
8
+
9
+ exports.controllers = controllers;
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../../server/src/homepage/controllers/index.ts"],"sourcesContent":["import type { Plugin } from '@strapi/types';\nimport { createHomepageController } from './homepage';\n\nexport const controllers = {\n homepage: createHomepageController,\n /**\n * Casting is needed because the types aren't aware that Strapi supports\n * passing a controller factory as the value, instead of a controller object directly\n */\n} as unknown as Plugin.LoadedPlugin['controllers'];\n"],"names":["controllers","homepage","createHomepageController"],"mappings":";;;;MAGaA,WAAc,GAAA;IACzBC,QAAUC,EAAAA;AAKZ;;;;"}
@@ -0,0 +1,8 @@
1
+ import { createHomepageController } from './homepage.mjs';
2
+
3
+ const controllers = {
4
+ homepage: createHomepageController
5
+ };
6
+
7
+ export { controllers };
8
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../server/src/homepage/controllers/index.ts"],"sourcesContent":["import type { Plugin } from '@strapi/types';\nimport { createHomepageController } from './homepage';\n\nexport const controllers = {\n homepage: createHomepageController,\n /**\n * Casting is needed because the types aren't aware that Strapi supports\n * passing a controller factory as the value, instead of a controller object directly\n */\n} as unknown as Plugin.LoadedPlugin['controllers'];\n"],"names":["controllers","homepage","createHomepageController"],"mappings":";;MAGaA,WAAc,GAAA;IACzBC,QAAUC,EAAAA;AAKZ;;;;"}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ var index = require('./routes/index.js');
4
+ var index$1 = require('./controllers/index.js');
5
+ var index$2 = require('./services/index.js');
6
+
7
+ var homepage = {
8
+ routes: index.routes,
9
+ controllers: index$1.controllers,
10
+ services: index$2.services
11
+ };
12
+
13
+ module.exports = homepage;
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../server/src/homepage/index.ts"],"sourcesContent":["import { routes } from './routes';\nimport { controllers } from './controllers';\nimport { services } from './services';\n\nexport default {\n routes,\n controllers,\n services,\n};\n"],"names":["routes","controllers","services"],"mappings":";;;;;;AAIA,eAAe;AACbA,YAAAA,YAAAA;AACAC,iBAAAA,mBAAAA;AACAC,cAAAA;AACF,CAAE;;;;"}
@@ -0,0 +1,12 @@
1
+ import { routes } from './routes/index.mjs';
2
+ import { controllers } from './controllers/index.mjs';
3
+ import { services } from './services/index.mjs';
4
+
5
+ var homepage = {
6
+ routes,
7
+ controllers,
8
+ services
9
+ };
10
+
11
+ export { homepage as default };
12
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../server/src/homepage/index.ts"],"sourcesContent":["import { routes } from './routes';\nimport { controllers } from './controllers';\nimport { services } from './services';\n\nexport default {\n routes,\n controllers,\n services,\n};\n"],"names":["routes","controllers","services"],"mappings":";;;;AAIA,eAAe;AACbA,IAAAA,MAAAA;AACAC,IAAAA,WAAAA;AACAC,IAAAA;AACF,CAAE;;;;"}
@@ -0,0 +1,25 @@
1
+ 'use strict';
2
+
3
+ const info = {
4
+ pluginName: 'content-manager',
5
+ type: 'admin'
6
+ };
7
+ const homepageRouter = {
8
+ type: 'admin',
9
+ routes: [
10
+ {
11
+ method: 'GET',
12
+ info,
13
+ path: '/homepage/recent-documents',
14
+ handler: 'homepage.getRecentDocuments',
15
+ config: {
16
+ policies: [
17
+ 'admin::isAuthenticatedAdmin'
18
+ ]
19
+ }
20
+ }
21
+ ]
22
+ };
23
+
24
+ exports.homepageRouter = homepageRouter;
25
+ //# sourceMappingURL=homepage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"homepage.js","sources":["../../../../server/src/homepage/routes/homepage.ts"],"sourcesContent":["import type { Plugin } from '@strapi/types';\n\nconst info = { pluginName: 'content-manager', type: 'admin' };\n\nconst homepageRouter: Plugin.LoadedPlugin['routes'][string] = {\n type: 'admin',\n routes: [\n {\n method: 'GET',\n info,\n path: '/homepage/recent-documents',\n handler: 'homepage.getRecentDocuments',\n config: {\n policies: ['admin::isAuthenticatedAdmin'],\n },\n },\n ],\n};\n\nexport { homepageRouter };\n"],"names":["info","pluginName","type","homepageRouter","routes","method","path","handler","config","policies"],"mappings":";;AAEA,MAAMA,IAAO,GAAA;IAAEC,UAAY,EAAA,iBAAA;IAAmBC,IAAM,EAAA;AAAQ,CAAA;AAE5D,MAAMC,cAAwD,GAAA;IAC5DD,IAAM,EAAA,OAAA;IACNE,MAAQ,EAAA;AACN,QAAA;YACEC,MAAQ,EAAA,KAAA;AACRL,YAAAA,IAAAA;YACAM,IAAM,EAAA,4BAAA;YACNC,OAAS,EAAA,6BAAA;YACTC,MAAQ,EAAA;gBACNC,QAAU,EAAA;AAAC,oBAAA;AAA8B;AAC3C;AACF;AACD;AACH;;;;"}