@backstage/plugin-home 0.8.7-next.0 → 0.8.7-next.2
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/CHANGELOG.md +38 -0
- package/README.md +0 -4
- package/dist/alpha.d.ts +3 -3
- package/dist/alpha.esm.js +2 -2
- package/dist/alpha.esm.js.map +1 -1
- package/dist/assets/TemplateBackstageLogo.esm.js +11 -11
- package/dist/assets/TemplateBackstageLogo.esm.js.map +1 -1
- package/dist/assets/TemplateBackstageLogoIcon.esm.js +11 -11
- package/dist/assets/TemplateBackstageLogoIcon.esm.js.map +1 -1
- package/dist/componentRenderers/ComponentAccordion.esm.js +39 -27
- package/dist/componentRenderers/ComponentAccordion.esm.js.map +1 -1
- package/dist/componentRenderers/ComponentTabs/ComponentTab.esm.js +2 -2
- package/dist/componentRenderers/ComponentTabs/ComponentTab.esm.js.map +1 -1
- package/dist/componentRenderers/ComponentTabs/ComponentTabs.esm.js +14 -10
- package/dist/componentRenderers/ComponentTabs/ComponentTabs.esm.js.map +1 -1
- package/dist/components/CustomHomepage/AddWidgetDialog.esm.js +31 -26
- package/dist/components/CustomHomepage/AddWidgetDialog.esm.js.map +1 -1
- package/dist/components/CustomHomepage/CustomHomepageButtons.esm.js +53 -48
- package/dist/components/CustomHomepage/CustomHomepageButtons.esm.js.map +1 -1
- package/dist/components/CustomHomepage/CustomHomepageGrid.esm.js +78 -70
- package/dist/components/CustomHomepage/CustomHomepageGrid.esm.js.map +1 -1
- package/dist/components/CustomHomepage/WidgetSettingsOverlay.esm.js +55 -46
- package/dist/components/CustomHomepage/WidgetSettingsOverlay.esm.js.map +1 -1
- package/dist/components/CustomHomepage/types.esm.js.map +1 -1
- package/dist/components/HomepageCompositionRoot.esm.js +2 -2
- package/dist/components/HomepageCompositionRoot.esm.js.map +1 -1
- package/dist/components/StarredEntityListItem/StarredEntityListItem.esm.js +30 -28
- package/dist/components/StarredEntityListItem/StarredEntityListItem.esm.js.map +1 -1
- package/dist/components/VisitList/ItemCategory.esm.js +2 -2
- package/dist/components/VisitList/ItemCategory.esm.js.map +1 -1
- package/dist/components/VisitList/ItemDetail.esm.js +11 -7
- package/dist/components/VisitList/ItemDetail.esm.js.map +1 -1
- package/dist/components/VisitList/ItemName.esm.js +5 -5
- package/dist/components/VisitList/ItemName.esm.js.map +1 -1
- package/dist/components/VisitList/VisitList.esm.js +23 -14
- package/dist/components/VisitList/VisitList.esm.js.map +1 -1
- package/dist/components/VisitList/VisitListEmpty.esm.js +5 -2
- package/dist/components/VisitList/VisitListEmpty.esm.js.map +1 -1
- package/dist/components/VisitList/VisitListFew.esm.js +2 -2
- package/dist/components/VisitList/VisitListFew.esm.js.map +1 -1
- package/dist/components/VisitList/VisitListItem.esm.js +12 -9
- package/dist/components/VisitList/VisitListItem.esm.js.map +1 -1
- package/dist/components/VisitList/VisitListSkeleton.esm.js +23 -17
- package/dist/components/VisitList/VisitListSkeleton.esm.js.map +1 -1
- package/dist/components/VisitListener.esm.js +3 -2
- package/dist/components/VisitListener.esm.js.map +1 -1
- package/dist/homePageComponents/CompanyLogo/CompanyLogo.esm.js +2 -2
- package/dist/homePageComponents/CompanyLogo/CompanyLogo.esm.js.map +1 -1
- package/dist/homePageComponents/FeaturedDocsCard/Content.esm.js +32 -30
- package/dist/homePageComponents/FeaturedDocsCard/Content.esm.js.map +1 -1
- package/dist/homePageComponents/HeaderWorldClock/HeaderWorldClock.esm.js +9 -8
- package/dist/homePageComponents/HeaderWorldClock/HeaderWorldClock.esm.js.map +1 -1
- package/dist/homePageComponents/QuickStart/Content.esm.js +34 -26
- package/dist/homePageComponents/QuickStart/Content.esm.js.map +1 -1
- package/dist/homePageComponents/QuickStart/ContentModal.esm.js +25 -21
- package/dist/homePageComponents/QuickStart/ContentModal.esm.js.map +1 -1
- package/dist/homePageComponents/RandomJoke/Actions.esm.js +2 -2
- package/dist/homePageComponents/RandomJoke/Actions.esm.js.map +1 -1
- package/dist/homePageComponents/RandomJoke/Content.esm.js +6 -3
- package/dist/homePageComponents/RandomJoke/Content.esm.js.map +1 -1
- package/dist/homePageComponents/RandomJoke/Context.esm.js +10 -9
- package/dist/homePageComponents/RandomJoke/Context.esm.js.map +1 -1
- package/dist/homePageComponents/RandomJoke/Settings.esm.js +19 -16
- package/dist/homePageComponents/RandomJoke/Settings.esm.js.map +1 -1
- package/dist/homePageComponents/StarredEntities/Content.esm.js +45 -40
- package/dist/homePageComponents/StarredEntities/Content.esm.js.map +1 -1
- package/dist/homePageComponents/Toolkit/Content.esm.js +11 -8
- package/dist/homePageComponents/Toolkit/Content.esm.js.map +1 -1
- package/dist/homePageComponents/Toolkit/Context.esm.js +5 -4
- package/dist/homePageComponents/Toolkit/Context.esm.js.map +1 -1
- package/dist/homePageComponents/VisitedByType/Actions.esm.js +4 -3
- package/dist/homePageComponents/VisitedByType/Actions.esm.js.map +1 -1
- package/dist/homePageComponents/VisitedByType/Content.esm.js +3 -2
- package/dist/homePageComponents/VisitedByType/Content.esm.js.map +1 -1
- package/dist/homePageComponents/VisitedByType/Context.esm.js +5 -4
- package/dist/homePageComponents/VisitedByType/Context.esm.js.map +1 -1
- package/dist/homePageComponents/VisitedByType/RecentlyVisited.esm.js +2 -2
- package/dist/homePageComponents/VisitedByType/RecentlyVisited.esm.js.map +1 -1
- package/dist/homePageComponents/VisitedByType/TopVisited.esm.js +2 -2
- package/dist/homePageComponents/VisitedByType/TopVisited.esm.js.map +1 -1
- package/dist/homePageComponents/VisitedByType/VisitedByType.esm.js +2 -2
- package/dist/homePageComponents/VisitedByType/VisitedByType.esm.js.map +1 -1
- package/dist/homePageComponents/WelcomeTitle/WelcomeTitle.esm.js +3 -2
- package/dist/homePageComponents/WelcomeTitle/WelcomeTitle.esm.js.map +1 -1
- package/dist/index.d.ts +33 -34
- package/dist/index.esm.js +1 -1
- package/package.json +15 -15
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import Button from '@material-ui/core/Button';
|
|
2
3
|
import Dialog from '@material-ui/core/Dialog';
|
|
3
4
|
import DialogActions from '@material-ui/core/DialogActions';
|
|
@@ -8,10 +9,10 @@ import Tooltip from '@material-ui/core/Tooltip';
|
|
|
8
9
|
import { makeStyles, createStyles } from '@material-ui/core/styles';
|
|
9
10
|
import DeleteIcon from '@material-ui/icons/Delete';
|
|
10
11
|
import SettingsIcon from '@material-ui/icons/Settings';
|
|
12
|
+
import { useState } from 'react';
|
|
11
13
|
import { withTheme } from '@rjsf/core';
|
|
12
14
|
import { Theme } from '@rjsf/material-ui';
|
|
13
15
|
import validator from '@rjsf/validator-ajv8';
|
|
14
|
-
import React from 'react';
|
|
15
16
|
|
|
16
17
|
const Form = withTheme(Theme);
|
|
17
18
|
const useStyles = makeStyles(
|
|
@@ -36,56 +37,64 @@ const useStyles = makeStyles(
|
|
|
36
37
|
);
|
|
37
38
|
const WidgetSettingsOverlay = (props) => {
|
|
38
39
|
const { id, widget, settings, handleRemove, handleSettingsSave, deletable } = props;
|
|
39
|
-
const [settingsDialogOpen, setSettingsDialogOpen] =
|
|
40
|
+
const [settingsDialogOpen, setSettingsDialogOpen] = useState(false);
|
|
40
41
|
const styles = useStyles();
|
|
41
42
|
const onClose = () => setSettingsDialogOpen(false);
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
open: settingsDialogOpen,
|
|
46
|
-
className: "widgetSettingsDialog",
|
|
47
|
-
onClose
|
|
48
|
-
},
|
|
49
|
-
/* @__PURE__ */ React.createElement(DialogContent, null, /* @__PURE__ */ React.createElement(
|
|
50
|
-
Form,
|
|
43
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.settingsOverlay, children: [
|
|
44
|
+
widget.settingsSchema && /* @__PURE__ */ jsx(
|
|
45
|
+
Dialog,
|
|
51
46
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
47
|
+
open: settingsDialogOpen,
|
|
48
|
+
className: "widgetSettingsDialog",
|
|
49
|
+
onClose,
|
|
50
|
+
children: /* @__PURE__ */ jsx(DialogContent, { children: /* @__PURE__ */ jsx(
|
|
51
|
+
Form,
|
|
52
|
+
{
|
|
53
|
+
validator,
|
|
54
|
+
showErrorList: false,
|
|
55
|
+
schema: widget.settingsSchema,
|
|
56
|
+
uiSchema: widget.uiSchema,
|
|
57
|
+
noHtml5Validate: true,
|
|
58
|
+
formData: settings,
|
|
59
|
+
formContext: { settings },
|
|
60
|
+
onSubmit: ({ formData, errors }) => {
|
|
61
|
+
if (errors.length === 0) {
|
|
62
|
+
handleSettingsSave(id, formData);
|
|
63
|
+
setSettingsDialogOpen(false);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
experimental_defaultFormStateBehavior: {
|
|
67
|
+
allOf: "populateDefaults"
|
|
68
|
+
},
|
|
69
|
+
children: /* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
70
|
+
/* @__PURE__ */ jsx(Button, { color: "primary", variant: "contained", type: "submit", children: "Submit" }),
|
|
71
|
+
/* @__PURE__ */ jsx(Button, { color: "secondary", onClick: onClose, children: "Cancel" })
|
|
72
|
+
] })
|
|
63
73
|
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
/* @__PURE__ */ React.createElement(DialogActions, null, /* @__PURE__ */ React.createElement(Button, { color: "primary", variant: "contained", type: "submit" }, "Submit"), /* @__PURE__ */ React.createElement(Button, { color: "secondary", onClick: onClose }, "Cancel"))
|
|
70
|
-
))
|
|
71
|
-
), /* @__PURE__ */ React.createElement(
|
|
72
|
-
Grid,
|
|
73
|
-
{
|
|
74
|
-
container: true,
|
|
75
|
-
className: styles.iconGrid,
|
|
76
|
-
alignItems: "center",
|
|
77
|
-
justifyContent: "center"
|
|
78
|
-
},
|
|
79
|
-
widget.settingsSchema && /* @__PURE__ */ React.createElement(Grid, { item: true, className: "overlayGridItem" }, /* @__PURE__ */ React.createElement(Tooltip, { title: "Edit settings" }, /* @__PURE__ */ React.createElement(
|
|
80
|
-
IconButton,
|
|
74
|
+
) })
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ jsxs(
|
|
78
|
+
Grid,
|
|
81
79
|
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
container: true,
|
|
81
|
+
className: styles.iconGrid,
|
|
82
|
+
alignItems: "center",
|
|
83
|
+
justifyContent: "center",
|
|
84
|
+
children: [
|
|
85
|
+
widget.settingsSchema && /* @__PURE__ */ jsx(Grid, { item: true, className: "overlayGridItem", children: /* @__PURE__ */ jsx(Tooltip, { title: "Edit settings", children: /* @__PURE__ */ jsx(
|
|
86
|
+
IconButton,
|
|
87
|
+
{
|
|
88
|
+
color: "primary",
|
|
89
|
+
onClick: () => setSettingsDialogOpen(true),
|
|
90
|
+
children: /* @__PURE__ */ jsx(SettingsIcon, { fontSize: "large" })
|
|
91
|
+
}
|
|
92
|
+
) }) }),
|
|
93
|
+
deletable !== false && /* @__PURE__ */ jsx(Grid, { item: true, className: "overlayGridItem", children: /* @__PURE__ */ jsx(Tooltip, { title: "Delete widget", children: /* @__PURE__ */ jsx(IconButton, { color: "secondary", onClick: () => handleRemove(id), children: /* @__PURE__ */ jsx(DeleteIcon, { fontSize: "large" }) }) }) })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
)
|
|
97
|
+
] });
|
|
89
98
|
};
|
|
90
99
|
|
|
91
100
|
export { WidgetSettingsOverlay };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetSettingsOverlay.esm.js","sources":["../../../src/components/CustomHomepage/WidgetSettingsOverlay.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport Grid from '@material-ui/core/Grid';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport { withTheme } from '@rjsf/core';\nimport { Theme as MuiTheme } from '@rjsf/material-ui';\nimport validator from '@rjsf/validator-ajv8';\
|
|
1
|
+
{"version":3,"file":"WidgetSettingsOverlay.esm.js","sources":["../../../src/components/CustomHomepage/WidgetSettingsOverlay.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport Grid from '@material-ui/core/Grid';\nimport IconButton from '@material-ui/core/IconButton';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles';\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport SettingsIcon from '@material-ui/icons/Settings';\nimport { useState } from 'react';\nimport { Widget } from './types';\nimport { withTheme } from '@rjsf/core';\nimport { Theme as MuiTheme } from '@rjsf/material-ui';\nimport validator from '@rjsf/validator-ajv8';\n\nconst Form = withTheme(MuiTheme);\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n iconGrid: {\n height: '100%',\n '& *': {\n padding: 0,\n },\n },\n settingsOverlay: {\n position: 'absolute',\n backgroundColor: 'rgba(40, 40, 40, 0.93)',\n width: '100%',\n height: '100%',\n top: 0,\n left: 0,\n padding: theme.spacing(2),\n color: 'white',\n },\n }),\n);\ninterface WidgetSettingsOverlayProps {\n id: string;\n widget: Widget;\n handleRemove: (id: string) => void;\n handleSettingsSave: (id: string, settings: Record<string, any>) => void;\n settings?: Record<string, any>;\n deletable?: boolean;\n}\n\nexport const WidgetSettingsOverlay = (props: WidgetSettingsOverlayProps) => {\n const { id, widget, settings, handleRemove, handleSettingsSave, deletable } =\n props;\n const [settingsDialogOpen, setSettingsDialogOpen] = useState(false);\n const styles = useStyles();\n\n const onClose = () => setSettingsDialogOpen(false);\n\n return (\n <div className={styles.settingsOverlay}>\n {widget.settingsSchema && (\n <Dialog\n open={settingsDialogOpen}\n className=\"widgetSettingsDialog\"\n onClose={onClose}\n >\n <DialogContent>\n <Form\n validator={validator}\n showErrorList={false}\n schema={widget.settingsSchema}\n uiSchema={widget.uiSchema}\n noHtml5Validate\n formData={settings}\n formContext={{ settings }}\n onSubmit={({ formData, errors }) => {\n if (errors.length === 0) {\n handleSettingsSave(id, formData);\n setSettingsDialogOpen(false);\n }\n }}\n experimental_defaultFormStateBehavior={{\n allOf: 'populateDefaults',\n }}\n >\n <DialogActions>\n <Button color=\"primary\" variant=\"contained\" type=\"submit\">\n Submit\n </Button>\n <Button color=\"secondary\" onClick={onClose}>\n Cancel\n </Button>\n </DialogActions>\n </Form>\n </DialogContent>\n </Dialog>\n )}\n <Grid\n container\n className={styles.iconGrid}\n alignItems=\"center\"\n justifyContent=\"center\"\n >\n {widget.settingsSchema && (\n <Grid item className=\"overlayGridItem\">\n <Tooltip title=\"Edit settings\">\n <IconButton\n color=\"primary\"\n onClick={() => setSettingsDialogOpen(true)}\n >\n <SettingsIcon fontSize=\"large\" />\n </IconButton>\n </Tooltip>\n </Grid>\n )}\n {deletable !== false && (\n <Grid item className=\"overlayGridItem\">\n <Tooltip title=\"Delete widget\">\n <IconButton color=\"secondary\" onClick={() => handleRemove(id)}>\n <DeleteIcon fontSize=\"large\" />\n </IconButton>\n </Tooltip>\n </Grid>\n )}\n </Grid>\n </div>\n );\n};\n"],"names":["MuiTheme"],"mappings":";;;;;;;;;;;;;;;;AAgCA,MAAM,IAAA,GAAO,UAAUA,KAAQ,CAAA;AAE/B,MAAM,SAAY,GAAA,UAAA;AAAA,EAAW,CAAC,UAC5B,YAAa,CAAA;AAAA,IACX,QAAU,EAAA;AAAA,MACR,MAAQ,EAAA,MAAA;AAAA,MACR,KAAO,EAAA;AAAA,QACL,OAAS,EAAA;AAAA;AACX,KACF;AAAA,IACA,eAAiB,EAAA;AAAA,MACf,QAAU,EAAA,UAAA;AAAA,MACV,eAAiB,EAAA,wBAAA;AAAA,MACjB,KAAO,EAAA,MAAA;AAAA,MACP,MAAQ,EAAA,MAAA;AAAA,MACR,GAAK,EAAA,CAAA;AAAA,MACL,IAAM,EAAA,CAAA;AAAA,MACN,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,MACxB,KAAO,EAAA;AAAA;AACT,GACD;AACH,CAAA;AAUa,MAAA,qBAAA,GAAwB,CAAC,KAAsC,KAAA;AAC1E,EAAA,MAAM,EAAE,EAAI,EAAA,MAAA,EAAQ,UAAU,YAAc,EAAA,kBAAA,EAAoB,WAC9D,GAAA,KAAA;AACF,EAAA,MAAM,CAAC,kBAAA,EAAoB,qBAAqB,CAAA,G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2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"types.esm.js","sources":["../../../src/components/CustomHomepage/types.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CSSProperties, ReactElement, ReactNode } from 'react';\nimport { Layout } from 'react-grid-layout';\nimport { z } from 'zod';\nimport { RJSFSchema, UiSchema } from '@rjsf/utils';\n\nconst RSJFTypeSchema: z.ZodType<RJSFSchema> = z.any();\nconst RSJFTypeUiSchema: z.ZodType<UiSchema> = z.any();\nconst ReactElementSchema: z.ZodType<ReactElement> = z.any();\nconst LayoutSchema: z.ZodType<Layout> = z.any();\n\n/**\n * Breakpoint options for <CustomHomepageGridProps/>\n *\n * @public\n */\nexport type Breakpoint = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\n/**\n * Props customizing the <CustomHomepageGrid/> component.\n *\n * @public\n */\nexport type CustomHomepageGridProps = {\n /**\n * Children contain all widgets user can configure on their own homepage.\n */\n children?: ReactNode;\n /**\n * Default layout for the homepage before users have modified it.\n */\n config?: LayoutConfiguration[];\n /**\n * Height of grid row in pixels.\n * @defaultValue 60\n */\n rowHeight?: number;\n /**\n * Screen width in pixels for different breakpoints.\n * @defaultValue theme breakpoints\n */\n breakpoints?: Record<Breakpoint, number>;\n /**\n * Number of grid columns for different breakpoints.\n * @defaultValue \\{ lg: 12, md: 10, sm: 6, xs: 4, xxs: 2 \\}\n */\n cols?: Record<Breakpoint, number>;\n /**\n * Grid container padding (x, y) in pixels for all or specific breakpoints.\n * @defaultValue [0, 0]\n * @example [10, 10]\n * @example \\{ lg: [10, 10] \\}\n */\n containerPadding?: [number, number] | Record<Breakpoint, [number, number]>;\n /**\n * Grid container margin (x, y) in pixels for all or specific breakpoints.\n * @defaultValue [0, 0]\n * @example [10, 10]\n * @example \\{ lg: [10, 10] \\}\n */\n containerMargin?: [number, number] | Record<Breakpoint, [number, number]>;\n /**\n * Maximum number of rows user can have in the grid.\n * @defaultValue unlimited\n */\n maxRows?: number;\n /**\n * Custom style for grid.\n */\n style?: CSSProperties;\n /**\n * Compaction type of widgets in the grid. This controls where widgets are moved in case\n * they are overlapping in the grid.\n */\n compactType?: 'vertical' | 'horizontal' | null;\n /**\n * Controls if widgets can overlap in the grid. If true, grid can be placed one over the other.\n * @defaultValue false\n */\n allowOverlap?: boolean;\n /**\n * Controls if widgets can collide with each other. If true, grid items won't change position when being dragged over.\n * @defaultValue false\n */\n preventCollision?: boolean;\n};\n\nexport const LayoutConfigurationSchema = z.object({\n component: ReactElementSchema,\n x: z.number().nonnegative('x must be positive number'),\n y: z.number().nonnegative('y must be positive number'),\n width: z.number().positive('width must be positive number'),\n height: z.number().positive('height must be positive number'),\n movable: z.boolean().optional(),\n deletable: z.boolean().optional(),\n resizable: z.boolean().optional(),\n});\n\n/**\n * Layout configuration that can be passed to the custom home page.\n *\n * @public\n */\nexport type LayoutConfiguration = {\n component: ReactElement | string;\n x: number;\n y: number;\n width: number;\n height: number;\n movable?: boolean;\n deletable?: boolean;\n resizable?: boolean;\n};\n\nexport const WidgetSchema = z.object({\n name: z.string(),\n title: z.string().optional(),\n description: z.string().optional(),\n component: ReactElementSchema,\n width: z.number().positive('width must be positive number').optional(),\n height: z.number().positive('height must be positive number').optional(),\n minWidth: z.number().positive('minWidth must be positive number').optional(),\n maxWidth: z.number().positive('maxWidth must be positive number').optional(),\n minHeight: z\n .number()\n .positive('minHeight must be positive number')\n .optional(),\n maxHeight: z\n .number()\n .positive('maxHeight must be positive number')\n .optional(),\n settingsSchema: RSJFTypeSchema.optional(),\n uiSchema: RSJFTypeUiSchema.optional(),\n movable: z.boolean().optional(),\n deletable: z.boolean().optional(),\n resizable: z.boolean().optional(),\n});\n\nexport type Widget = z.infer<typeof WidgetSchema>;\n\nconst GridWidgetSchema = z.object({\n id: z.string(),\n layout: LayoutSchema,\n settings: z.record(z.string(), z.any()),\n movable: z.boolean().optional(),\n deletable: z.boolean().optional(),\n resizable: z.boolean().optional(),\n});\n\nexport type GridWidget = z.infer<typeof GridWidgetSchema>;\n\nexport const CustomHomepageGridStateV1Schema = z.object({\n version: z.literal(1),\n pages: z.record(z.string(), z.array(GridWidgetSchema)),\n});\n\nexport type CustomHomepageGridStateV1 = z.infer<\n typeof CustomHomepageGridStateV1Schema\n>;\n"],"names":[],"mappings":";;AAqBA,MAAM,cAAA,GAAwC,EAAE,GAAI,EAAA;AACpD,MAAM,gBAAA,GAAwC,EAAE,GAAI,EAAA;AACpD,MAAM,kBAAA,GAA8C,EAAE,GAAI,EAAA;AAC1D,MAAM,YAAA,GAAkC,EAAE,GAAI,EAAA;AA8EjC,MAAA,yBAAA,GAA4B,EAAE,MAAO,CAAA;AAAA,EAChD,SAAW,EAAA,kBAAA;AAAA,EACX,CAAG,EAAA,CAAA,CAAE,MAAO,EAAA,CAAE,YAAY,2BAA2B,CAAA;AAAA,EACrD,CAAG,EAAA,CAAA,CAAE,MAAO,EAAA,CAAE,YAAY,2BAA2B,CAAA;AAAA,EACrD,KAAO,EAAA,CAAA,CAAE,MAAO,EAAA,CAAE,SAAS,+BAA+B,CAAA;AAAA,EAC1D,MAAQ,EAAA,CAAA,CAAE,MA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,CAAE,OAAQ,EAAA,CAAE,QAAS;AAClC,CAAC;AAID,MAAM,gBAAA,GAAmB,EAAE,MAAO,CAAA;AAAA,EAChC,EAAA,EAAI,EAAE,MAAO,EAAA;AAAA,EACb,MAAQ,EAAA,YAAA;AAAA,EACR,QAAA,EAAU,EAAE,MAAO,CAAA,CAAA,CAAE,QAAU,EAAA,CAAA,CAAE,KAAK,CAAA;AAAA,EACtC,OAAS,EAAA,CAAA,CAAE,OAAQ,EAAA,CAAE,QAAS,EAAA;AAAA,EAC9B,SAAW,EAAA,CAAA,CAAE,OAAQ,EAAA,CAAE,QAAS,EAAA;AAAA,EAChC,SAAW,EAAA,CAAA,CAAE,OAAQ,EAAA,CAAE,QAAS;AAClC,CAAC,CAAA;AAIY,MAAA,+BAAA,GAAkC,EAAE,MAAO,CAAA;AAAA,EACtD,OAAA,EAAS,CAAE,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,EACpB,KAAA,EAAO,EAAE,MAAO,CAAA,CAAA,CAAE,QAAU,EAAA,CAAA,CAAE,KAAM,CAAA,gBAAgB,CAAC;AACvD,CAAC;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { useOutlet } from 'react-router-dom';
|
|
3
3
|
|
|
4
4
|
const HomepageCompositionRoot = (props) => {
|
|
5
5
|
const outlet = useOutlet();
|
|
6
6
|
const children = props.children ?? outlet;
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { HomepageCompositionRoot };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HomepageCompositionRoot.esm.js","sources":["../../src/components/HomepageCompositionRoot.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"HomepageCompositionRoot.esm.js","sources":["../../src/components/HomepageCompositionRoot.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactNode } from 'react';\nimport { useOutlet } from 'react-router-dom';\n\nexport const HomepageCompositionRoot = (props: {\n title?: string;\n children?: ReactNode;\n}) => {\n const outlet = useOutlet();\n const children = props.children ?? outlet;\n return <>{children}</>;\n};\n"],"names":[],"mappings":";;;AAmBa,MAAA,uBAAA,GAA0B,CAAC,KAGlC,KAAA;AACJ,EAAA,MAAM,SAAS,SAAU,EAAA;AACzB,EAAM,MAAA,QAAA,GAAW,MAAM,QAAY,IAAA,MAAA;AACnC,EAAA,uCAAU,QAAS,EAAA,CAAA;AACrB;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { entityRouteRef, entityRouteParams, EntityDisplayName } from '@backstage/plugin-catalog-react';
|
|
2
3
|
import ListItem from '@material-ui/core/ListItem';
|
|
3
4
|
import ListItemIcon from '@material-ui/core/ListItemIcon';
|
|
4
5
|
import ListItemText from '@material-ui/core/ListItemText';
|
|
5
|
-
import React from 'react';
|
|
6
6
|
import { Link } from 'react-router-dom';
|
|
7
7
|
import { useRouteRef } from '@backstage/core-plugin-api';
|
|
8
8
|
import { FavoriteToggle } from '@backstage/core-components';
|
|
@@ -36,39 +36,41 @@ const StarredEntityListItem = ({
|
|
|
36
36
|
"en-US"
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ jsxs(
|
|
40
40
|
ListItem,
|
|
41
41
|
{
|
|
42
42
|
dense: true,
|
|
43
43
|
className: classes.listItem,
|
|
44
44
|
component: Link,
|
|
45
45
|
button: true,
|
|
46
|
-
to: catalogEntityRoute(entityRouteParams(entity))
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
46
|
+
to: catalogEntityRoute(entityRouteParams(entity)),
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
ListItemIcon,
|
|
50
|
+
{
|
|
51
|
+
onClick: (e) => {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
},
|
|
54
|
+
children: /* @__PURE__ */ jsx(
|
|
55
|
+
FavoriteToggle,
|
|
56
|
+
{
|
|
57
|
+
id: `remove-favorite-${entity.metadata.uid}`,
|
|
58
|
+
title: "Remove entity from favorites",
|
|
59
|
+
isFavorite: true,
|
|
60
|
+
onToggle: () => onToggleStarredEntity(entity)
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsx(
|
|
66
|
+
ListItemText,
|
|
67
|
+
{
|
|
68
|
+
primary: /* @__PURE__ */ jsx(EntityDisplayName, { hideIcon: true, entityRef: entity }),
|
|
69
|
+
secondary: secondaryText
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
]
|
|
73
|
+
}
|
|
72
74
|
);
|
|
73
75
|
};
|
|
74
76
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StarredEntityListItem.esm.js","sources":["../../../src/components/StarredEntityListItem/StarredEntityListItem.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\nimport {\n EntityDisplayName,\n entityRouteParams,\n} from '@backstage/plugin-catalog-react';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport
|
|
1
|
+
{"version":3,"file":"StarredEntityListItem.esm.js","sources":["../../../src/components/StarredEntityListItem/StarredEntityListItem.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { Entity } from '@backstage/catalog-model';\nimport {\n EntityDisplayName,\n entityRouteParams,\n} from '@backstage/plugin-catalog-react';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemIcon from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { Link } from 'react-router-dom';\nimport { entityRouteRef } from '@backstage/plugin-catalog-react';\nimport { useRouteRef } from '@backstage/core-plugin-api';\nimport { FavoriteToggle } from '@backstage/core-components';\nimport { makeStyles } from '@material-ui/core/styles';\n\ntype EntityListItemProps = {\n entity: Entity;\n onToggleStarredEntity: (entity: Entity) => void;\n showKind?: boolean;\n};\n\nconst useStyles = makeStyles(theme => ({\n listItem: {\n paddingBottom: theme.spacing(0),\n paddingTop: theme.spacing(0),\n },\n secondary: {\n textTransform: 'uppercase',\n },\n}));\n\nexport const StarredEntityListItem = ({\n entity,\n onToggleStarredEntity,\n showKind,\n}: EntityListItemProps) => {\n const classes = useStyles();\n const catalogEntityRoute = useRouteRef(entityRouteRef);\n\n let secondaryText = '';\n if (showKind) {\n secondaryText += entity.kind.toLocaleLowerCase('en-US');\n }\n if (entity.spec && 'type' in entity.spec) {\n if (showKind) {\n secondaryText += ' — ';\n }\n secondaryText += (entity.spec as { type: string }).type.toLocaleLowerCase(\n 'en-US',\n );\n }\n\n return (\n <ListItem\n dense\n className={classes.listItem}\n component={Link}\n button\n to={catalogEntityRoute(entityRouteParams(entity))}\n >\n <ListItemIcon\n // Prevent following the link when clicking on the icon\n onClick={e => {\n e.preventDefault();\n }}\n >\n <FavoriteToggle\n id={`remove-favorite-${entity.metadata.uid}`}\n title=\"Remove entity from favorites\"\n isFavorite\n onToggle={() => onToggleStarredEntity(entity)}\n />\n </ListItemIcon>\n <ListItemText\n primary={<EntityDisplayName hideIcon entityRef={entity} />}\n secondary={secondaryText}\n />\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AAmCA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,QAAU,EAAA;AAAA,IACR,aAAA,EAAe,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AA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CAAA,QAAA,CAAS,GAAG,CAAA,CAAA;AAAA,gBAC1C,KAAM,EAAA,8BAAA;AAAA,gBACN,UAAU,EAAA,IAAA;AAAA,gBACV,QAAA,EAAU,MAAM,qBAAA,CAAsB,MAAM;AAAA;AAAA;AAC9C;AAAA,SACF;AAAA,wBACA,GAAA;AAAA,UAAC,YAAA;AAAA,UAAA;AAAA,YACC,yBAAU,GAAA,CAAA,iBAAA,EAAA,EAAkB,QAAQ,EAAA,IAAA,EAAC,WAAW,MAAQ,EAAA,CAAA;AAAA,YACxD,SAAW,EAAA;AAAA;AAAA;AACb;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Chip from '@material-ui/core/Chip';
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
4
|
import { colorVariants } from '@backstage/theme';
|
|
@@ -45,7 +45,7 @@ const getChipColor = (entity) => {
|
|
|
45
45
|
const ItemCategory = ({ visit }) => {
|
|
46
46
|
const classes = useStyles();
|
|
47
47
|
const entity = maybeEntity(visit);
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ jsx(
|
|
49
49
|
Chip,
|
|
50
50
|
{
|
|
51
51
|
size: "small",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemCategory.esm.js","sources":["../../../src/components/VisitList/ItemCategory.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"ItemCategory.esm.js","sources":["../../../src/components/VisitList/ItemCategory.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Chip from '@material-ui/core/Chip';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { colorVariants } from '@backstage/theme';\nimport { Visit } from '../../api/VisitsApi';\nimport { CompoundEntityRef, parseEntityRef } from '@backstage/catalog-model';\n\nconst useStyles = makeStyles(theme => ({\n chip: {\n color: theme.palette.common.white,\n fontWeight: 'bold',\n margin: 0,\n },\n}));\nconst maybeEntity = (visit: Visit): CompoundEntityRef | undefined => {\n try {\n return parseEntityRef(visit?.entityRef ?? '');\n } catch (e) {\n return undefined;\n }\n};\nconst getColorByIndex = (index: number) => {\n const variants = Object.keys(colorVariants);\n const variantIndex = index % variants.length;\n return colorVariants[variants[variantIndex]][0];\n};\nconst getChipColor = (entity: CompoundEntityRef | undefined): string => {\n const defaultColor = getColorByIndex(0);\n if (!entity) return defaultColor;\n\n // IDEA: Use or replicate useAllKinds hook thus supporting all software catalog\n // registered kinds. See:\n // plugins/catalog-react/src/components/EntityKindPicker/kindFilterUtils.ts\n // Provide extension point to register your own color code.\n const entityKinds = [\n 'component',\n 'template',\n 'api',\n 'group',\n 'user',\n 'resource',\n 'system',\n 'domain',\n 'location',\n ];\n const foundIndex = entityKinds.indexOf(\n entity.kind.toLocaleLowerCase('en-US'),\n );\n return foundIndex === -1 ? defaultColor : getColorByIndex(foundIndex + 1);\n};\n\nexport const ItemCategory = ({ visit }: { visit: Visit }) => {\n const classes = useStyles();\n const entity = maybeEntity(visit);\n\n return (\n <Chip\n size=\"small\"\n className={classes.chip}\n label={(entity?.kind ?? 'Other').toLocaleLowerCase('en-US')}\n style={{ background: getChipColor(entity) }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;AAsBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,MAAO,CAAA,KAAA;AAAA,IAC5B,UAAY,EAAA,MAAA;AAAA,IACZ,MAAQ,EAAA;AAAA;AAEZ,CAAE,CAAA,CAAA;AACF,MAAM,WAAA,GAAc,CAAC,KAAgD,KAAA;AACnE,EAAI,IAAA;AACF,IAAO,OAAA,cAAA,CAAe,KAAO,EAAA,SAAA,IAAa,EAAE,CAAA;AAAA,WACrC,CAAG,EAAA;AACV,IAAO,OAAA,KAAA,CAAA;AAAA;AAEX,CAAA;AACA,MAAM,eAAA,GAAkB,CAAC,KAAkB,KAAA;AACzC,EAAM,MAAA,QAAA,GAAW,MAAO,CAAA,IAAA,CAAK,aAAa,CAAA;AAC1C,EAAM,MAAA,YAAA,GAAe,QAAQ,QAAS,CAAA,MAAA;AACtC,EAAA,OAAO,aAAc,CAAA,QAAA,CAAS,YAAY,CAAC,EAAE,CAAC,CAAA;AAChD,CAAA;AACA,MAAM,YAAA,GAAe,CAAC,MAAkD,KAAA;AACtE,EAAM,MAAA,YAAA,GAAe,gBAAgB,CAAC,CAAA;AACtC,EAAI,IAAA,CAAC,QAAe,OAAA,YAAA;AAMpB,EAAA,MAAM,WAAc,GAAA;AAAA,IAClB,WAAA;AAAA,IACA,UAAA;AAAA,IACA,KAAA;AAAA,IACA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,GACF;AACA,EAAA,MAAM,aAAa,WAAY,CAAA,OAAA;AAAA,IAC7B,MAAA,CAAO,IAAK,CAAA,iBAAA,CAAkB,OAAO;AAAA,GACvC;AACA,EAAA,OAAO,UAAe,KAAA,CAAA,CAAA,GAAK,YAAe,GAAA,eAAA,CAAgB,aAAa,CAAC,CAAA;AAC1E,CAAA;AAEO,MAAM,YAAe,GAAA,CAAC,EAAE,KAAA,EAA8B,KAAA;AAC3D,EAAA,MAAM,UAAU,SAAU,EAAA;AAC1B,EAAM,MAAA,MAAA,GAAS,YAAY,KAAK,CAAA;AAEhC,EACE,uBAAA,GAAA;AAAA,IAAC,IAAA;AAAA,IAAA;AAAA,MACC,IAAK,EAAA,OAAA;AAAA,MACL,WAAW,OAAQ,CAAA,IAAA;AAAA,MACnB,KAAQ,EAAA,CAAA,MAAA,EAAQ,IAAQ,IAAA,OAAA,EAAS,kBAAkB,OAAO,CAAA;AAAA,MAC1D,KAAO,EAAA,EAAE,UAAY,EAAA,YAAA,CAAa,MAAM,CAAE;AAAA;AAAA,GAC5C;AAEJ;;;;"}
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import Typography from '@material-ui/core/Typography';
|
|
3
3
|
import { DateTime } from 'luxon';
|
|
4
4
|
|
|
5
|
-
const ItemDetailHits = ({ visit }) => /* @__PURE__ */
|
|
5
|
+
const ItemDetailHits = ({ visit }) => /* @__PURE__ */ jsxs(Typography, { component: "span", variant: "caption", color: "textSecondary", children: [
|
|
6
|
+
visit.hits,
|
|
7
|
+
" time",
|
|
8
|
+
visit.hits > 1 ? "s" : ""
|
|
9
|
+
] });
|
|
6
10
|
const ItemDetailTimeAgo = ({ visit }) => {
|
|
7
11
|
const visitDate = DateTime.fromMillis(visit.timestamp);
|
|
8
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ jsx(
|
|
9
13
|
Typography,
|
|
10
14
|
{
|
|
11
15
|
component: "time",
|
|
12
16
|
variant: "caption",
|
|
13
17
|
color: "textSecondary",
|
|
14
|
-
dateTime: visitDate.toISO() ?? void 0
|
|
15
|
-
|
|
16
|
-
|
|
18
|
+
dateTime: visitDate.toISO() ?? void 0,
|
|
19
|
+
children: visitDate.toRelative()
|
|
20
|
+
}
|
|
17
21
|
);
|
|
18
22
|
};
|
|
19
23
|
const ItemDetail = ({
|
|
20
24
|
visit,
|
|
21
25
|
type
|
|
22
|
-
}) => type === "time-ago" ? /* @__PURE__ */
|
|
26
|
+
}) => type === "time-ago" ? /* @__PURE__ */ jsx(ItemDetailTimeAgo, { visit }) : /* @__PURE__ */ jsx(ItemDetailHits, { visit });
|
|
23
27
|
|
|
24
28
|
export { ItemDetail };
|
|
25
29
|
//# sourceMappingURL=ItemDetail.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemDetail.esm.js","sources":["../../../src/components/VisitList/ItemDetail.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"ItemDetail.esm.js","sources":["../../../src/components/VisitList/ItemDetail.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Typography from '@material-ui/core/Typography';\nimport { Visit } from '../../api/VisitsApi';\nimport { DateTime } from 'luxon';\n\nconst ItemDetailHits = ({ visit }: { visit: Visit }) => (\n <Typography component=\"span\" variant=\"caption\" color=\"textSecondary\">\n {visit.hits} time{visit.hits > 1 ? 's' : ''}\n </Typography>\n);\n\nconst ItemDetailTimeAgo = ({ visit }: { visit: Visit }) => {\n const visitDate = DateTime.fromMillis(visit.timestamp);\n\n return (\n <Typography\n component=\"time\"\n variant=\"caption\"\n color=\"textSecondary\"\n dateTime={visitDate.toISO() ?? undefined}\n >\n {visitDate.toRelative()}\n </Typography>\n );\n};\n\nexport type ItemDetailType = 'time-ago' | 'hits';\n\nexport const ItemDetail = ({\n visit,\n type,\n}: {\n visit: Visit;\n type: ItemDetailType;\n}) =>\n type === 'time-ago' ? (\n <ItemDetailTimeAgo visit={visit} />\n ) : (\n <ItemDetailHits visit={visit} />\n );\n"],"names":[],"mappings":";;;;AAoBA,MAAM,cAAiB,GAAA,CAAC,EAAE,KAAA,EACxB,qBAAA,IAAA,CAAC,UAAW,EAAA,EAAA,SAAA,EAAU,MAAO,EAAA,OAAA,EAAQ,SAAU,EAAA,KAAA,EAAM,eAClD,EAAA,QAAA,EAAA;AAAA,EAAM,KAAA,CAAA,IAAA;AAAA,EAAK,OAAA;AAAA,EAAM,KAAA,CAAM,IAAO,GAAA,CAAA,GAAI,GAAM,GAAA;AAAA,CAC3C,EAAA,CAAA;AAGF,MAAM,iBAAoB,GAAA,CAAC,EAAE,KAAA,EAA8B,KAAA;AACzD,EAAA,MAAM,SAAY,GAAA,QAAA,CAAS,UAAW,CAAA,KAAA,CAAM,SAAS,CAAA;AAErD,EACE,uBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,SAAU,EAAA,MAAA;AAAA,MACV,OAAQ,EAAA,SAAA;AAAA,MACR,KAAM,EAAA,eAAA;AAAA,MACN,QAAA,EAAU,SAAU,CAAA,KAAA,EAAW,IAAA,KAAA,CAAA;AAAA,MAE9B,oBAAU,UAAW;AAAA;AAAA,GACxB;AAEJ,CAAA;AAIO,MAAM,aAAa,CAAC;AAAA,EACzB,KAAA;AAAA,EACA;AACF,CAIE,KAAA,IAAA,KAAS,6BACN,GAAA,CAAA,iBAAA,EAAA,EAAkB,OAAc,CAEjC,mBAAA,GAAA,CAAC,kBAAe,KAAc,EAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Typography from '@material-ui/core/Typography';
|
|
3
3
|
import { makeStyles } from '@material-ui/core/styles';
|
|
4
4
|
import { Link } from '@backstage/core-components';
|
|
@@ -11,15 +11,15 @@ const useStyles = makeStyles((_theme) => ({
|
|
|
11
11
|
}));
|
|
12
12
|
const ItemName = ({ visit }) => {
|
|
13
13
|
const classes = useStyles();
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ jsx(
|
|
15
15
|
Typography,
|
|
16
16
|
{
|
|
17
17
|
component: Link,
|
|
18
18
|
to: visit.pathname,
|
|
19
19
|
noWrap: true,
|
|
20
|
-
className: classes.name
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
className: classes.name,
|
|
21
|
+
children: visit.name
|
|
22
|
+
}
|
|
23
23
|
);
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ItemName.esm.js","sources":["../../../src/components/VisitList/ItemName.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"ItemName.esm.js","sources":["../../../src/components/VisitList/ItemName.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Visit } from '../../api/VisitsApi';\nimport { Link } from '@backstage/core-components';\n\nconst useStyles = makeStyles(_theme => ({\n name: {\n marginLeft: '0.8rem',\n marginRight: '0.8rem',\n },\n}));\nexport const ItemName = ({ visit }: { visit: Visit }) => {\n const classes = useStyles();\n\n return (\n <Typography\n component={Link}\n to={visit.pathname}\n noWrap\n className={classes.name}\n >\n {visit.name}\n </Typography>\n );\n};\n"],"names":[],"mappings":";;;;;AAqBA,MAAM,SAAA,GAAY,WAAW,CAAW,MAAA,MAAA;AAAA,EACtC,IAAM,EAAA;AAAA,IACJ,UAAY,EAAA,QAAA;AAAA,IACZ,WAAa,EAAA;AAAA;AAEjB,CAAE,CAAA,CAAA;AACK,MAAM,QAAW,GAAA,CAAC,EAAE,KAAA,EAA8B,KAAA;AACvD,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EACE,uBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,SAAW,EAAA,IAAA;AAAA,MACX,IAAI,KAAM,CAAA,QAAA;AAAA,MACV,MAAM,EAAA,IAAA;AAAA,MACN,WAAW,OAAQ,CAAA,IAAA;AAAA,MAElB,QAAM,EAAA,KAAA,CAAA;AAAA;AAAA,GACT;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Collapse from '@material-ui/core/Collapse';
|
|
3
3
|
import List from '@material-ui/core/List';
|
|
4
4
|
import { VisitListItem } from './VisitListItem.esm.js';
|
|
@@ -15,9 +15,9 @@ const VisitList = ({
|
|
|
15
15
|
loading = false,
|
|
16
16
|
title = ""
|
|
17
17
|
}) => {
|
|
18
|
-
let listBody = /* @__PURE__ */
|
|
18
|
+
let listBody = /* @__PURE__ */ jsx(Fragment, {});
|
|
19
19
|
if (loading) {
|
|
20
|
-
listBody = /* @__PURE__ */
|
|
20
|
+
listBody = /* @__PURE__ */ jsx(
|
|
21
21
|
VisitListSkeleton,
|
|
22
22
|
{
|
|
23
23
|
numVisitsOpen,
|
|
@@ -26,20 +26,29 @@ const VisitList = ({
|
|
|
26
26
|
}
|
|
27
27
|
);
|
|
28
28
|
} else if (visits.length === 0) {
|
|
29
|
-
listBody = /* @__PURE__ */
|
|
29
|
+
listBody = /* @__PURE__ */ jsx(VisitListEmpty, {});
|
|
30
30
|
} else if (visits.length < numVisitsOpen) {
|
|
31
|
-
listBody = /* @__PURE__ */
|
|
31
|
+
listBody = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
32
|
+
visits.map((visit, index) => /* @__PURE__ */ jsx(VisitListItem, { visit, detailType }, index)),
|
|
33
|
+
/* @__PURE__ */ jsx(VisitListFew, {})
|
|
34
|
+
] });
|
|
32
35
|
} else {
|
|
33
|
-
listBody = /* @__PURE__ */
|
|
34
|
-
VisitListItem,
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
listBody = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
37
|
+
visits.slice(0, numVisitsOpen).map((visit, index) => /* @__PURE__ */ jsx(VisitListItem, { visit, detailType }, index)),
|
|
38
|
+
visits.length > numVisitsOpen && /* @__PURE__ */ jsx(Collapse, { in: !collapsed, children: visits.slice(numVisitsOpen, numVisitsTotal).map((visit, index) => /* @__PURE__ */ jsx(
|
|
39
|
+
VisitListItem,
|
|
40
|
+
{
|
|
41
|
+
visit,
|
|
42
|
+
detailType
|
|
43
|
+
},
|
|
44
|
+
index
|
|
45
|
+
)) })
|
|
46
|
+
] });
|
|
41
47
|
}
|
|
42
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
49
|
+
title && /* @__PURE__ */ jsx("h5", { children: title }),
|
|
50
|
+
/* @__PURE__ */ jsx(List, { dense: true, disablePadding: true, children: listBody })
|
|
51
|
+
] });
|
|
43
52
|
};
|
|
44
53
|
|
|
45
54
|
export { VisitList };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisitList.esm.js","sources":["../../../src/components/VisitList/VisitList.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"VisitList.esm.js","sources":["../../../src/components/VisitList/VisitList.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ReactElement } from 'react';\nimport Collapse from '@material-ui/core/Collapse';\nimport List from '@material-ui/core/List';\nimport { Visit } from '../../api/VisitsApi';\nimport { VisitListItem } from './VisitListItem';\nimport { ItemDetailType } from './ItemDetail';\nimport { VisitListEmpty } from './VisitListEmpty';\nimport { VisitListFew } from './VisitListFew';\nimport { VisitListSkeleton } from './VisitListSkeleton';\n\nexport const VisitList = ({\n detailType,\n visits = [],\n numVisitsOpen = 3,\n numVisitsTotal = 8,\n collapsed = true,\n loading = false,\n title = '',\n}: {\n detailType: ItemDetailType;\n visits?: Visit[];\n numVisitsOpen?: number;\n numVisitsTotal?: number;\n collapsed?: boolean;\n loading?: boolean;\n title?: string;\n}) => {\n let listBody: ReactElement = <></>;\n if (loading) {\n listBody = (\n <VisitListSkeleton\n numVisitsOpen={numVisitsOpen}\n numVisitsTotal={numVisitsTotal}\n collapsed={collapsed}\n />\n );\n } else if (visits.length === 0) {\n listBody = <VisitListEmpty />;\n } else if (visits.length < numVisitsOpen) {\n listBody = (\n <>\n {visits.map((visit, index) => (\n <VisitListItem visit={visit} key={index} detailType={detailType} />\n ))}\n <VisitListFew />\n </>\n );\n } else {\n listBody = (\n <>\n {visits.slice(0, numVisitsOpen).map((visit, index) => (\n <VisitListItem visit={visit} key={index} detailType={detailType} />\n ))}\n {visits.length > numVisitsOpen && (\n <Collapse in={!collapsed}>\n {visits.slice(numVisitsOpen, numVisitsTotal).map((visit, index) => (\n <VisitListItem\n visit={visit}\n key={index}\n detailType={detailType}\n />\n ))}\n </Collapse>\n )}\n </>\n );\n }\n\n return (\n <>\n {title && <h5>{title}</h5>}\n <List dense disablePadding>\n {listBody}\n </List>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;AA0BO,MAAM,YAAY,CAAC;AAAA,EACxB,UAAA;AAAA,EACA,SAAS,EAAC;AAAA,EACV,aAAgB,GAAA,CAAA;AAAA,EAChB,cAAiB,GAAA,CAAA;AAAA,EACjB,SAAY,GAAA,IAAA;AAAA,EACZ,OAAU,GAAA,KAAA;AAAA,EACV,KAAQ,GAAA;AACV,C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A;AAAA,KAEJ,EAAA,CAAA;AAAA;AAIJ,EAAA,uBAEK,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,IAAS,KAAA,oBAAA,GAAA,CAAC,QAAI,QAAM,EAAA,KAAA,EAAA,CAAA;AAAA,wBACpB,IAAK,EAAA,EAAA,KAAA,EAAK,IAAC,EAAA,cAAA,EAAc,MACvB,QACH,EAAA,QAAA,EAAA;AAAA,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Typography from '@material-ui/core/Typography';
|
|
3
3
|
|
|
4
|
-
const VisitListEmpty = () => /* @__PURE__ */
|
|
4
|
+
const VisitListEmpty = () => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", color: "textSecondary", children: "There are no visits to show yet." }),
|
|
6
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", color: "textSecondary", children: "Once you start using Backstage, your visits will appear here as a quick link to carry on where you left off." })
|
|
7
|
+
] });
|
|
5
8
|
|
|
6
9
|
export { VisitListEmpty };
|
|
7
10
|
//# sourceMappingURL=VisitListEmpty.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisitListEmpty.esm.js","sources":["../../../src/components/VisitList/VisitListEmpty.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport
|
|
1
|
+
{"version":3,"file":"VisitListEmpty.esm.js","sources":["../../../src/components/VisitList/VisitListEmpty.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Typography from '@material-ui/core/Typography';\n\nexport const VisitListEmpty = () => (\n <>\n <Typography variant=\"body2\" color=\"textSecondary\">\n There are no visits to show yet.\n </Typography>\n <Typography variant=\"body2\" color=\"textSecondary\">\n Once you start using Backstage, your visits will appear here as a quick\n link to carry on where you left off.\n </Typography>\n </>\n);\n"],"names":[],"mappings":";;;AAkBa,MAAA,cAAA,GAAiB,sBAE1B,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,kBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAAQ,EAAA,KAAA,EAAM,iBAAgB,QAElD,EAAA,kCAAA,EAAA,CAAA;AAAA,sBACC,UAAW,EAAA,EAAA,OAAA,EAAQ,OAAQ,EAAA,KAAA,EAAM,iBAAgB,QAGlD,EAAA,8GAAA,EAAA;AAAA,CACF,EAAA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import Typography from '@material-ui/core/Typography';
|
|
3
3
|
|
|
4
|
-
const VisitListFew = () => /* @__PURE__ */
|
|
4
|
+
const VisitListFew = () => /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "textSecondary", children: "The more pages you visit, the more pages will appear here." }) });
|
|
5
5
|
|
|
6
6
|
export { VisitListFew };
|
|
7
7
|
//# sourceMappingURL=VisitListFew.esm.js.map
|