@backstage/plugin-home 0.8.7-next.1 → 0.8.7
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 +42 -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 +18 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisitListFew.esm.js","sources":["../../../src/components/VisitList/VisitListFew.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":"VisitListFew.esm.js","sources":["../../../src/components/VisitList/VisitListFew.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 VisitListFew = () => (\n <>\n <Typography variant=\"body2\" color=\"textSecondary\">\n The more pages you visit, the more pages will appear here.\n </Typography>\n </>\n);\n"],"names":[],"mappings":";;;AAkBa,MAAA,YAAA,GAAe,sBAC1B,GAAA,CAAA,QAAA,EAAA,EACE,QAAC,kBAAA,GAAA,CAAA,UAAA,EAAA,EAAW,SAAQ,OAAQ,EAAA,KAAA,EAAM,eAAgB,EAAA,QAAA,EAAA,4DAAA,EAElD,CACF,EAAA;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import ListItem from '@material-ui/core/ListItem';
|
|
3
3
|
import ListItemAvatar from '@material-ui/core/ListItemAvatar';
|
|
4
4
|
import ListItemText from '@material-ui/core/ListItemText';
|
|
@@ -17,14 +17,17 @@ const VisitListItem = ({
|
|
|
17
17
|
detailType
|
|
18
18
|
}) => {
|
|
19
19
|
const classes = useStyles();
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
return /* @__PURE__ */ jsxs(ListItem, { disableGutters: true, children: [
|
|
21
|
+
/* @__PURE__ */ jsx(ListItemAvatar, { className: classes.avatar, children: /* @__PURE__ */ jsx(ItemCategory, { visit }) }),
|
|
22
|
+
/* @__PURE__ */ jsx(
|
|
23
|
+
ListItemText,
|
|
24
|
+
{
|
|
25
|
+
primary: /* @__PURE__ */ jsx(ItemName, { visit }),
|
|
26
|
+
secondary: /* @__PURE__ */ jsx(ItemDetail, { visit, type: detailType }),
|
|
27
|
+
disableTypography: true
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
] });
|
|
28
31
|
};
|
|
29
32
|
|
|
30
33
|
export { VisitListItem };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisitListItem.esm.js","sources":["../../../src/components/VisitList/VisitListItem.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":"VisitListItem.esm.js","sources":["../../../src/components/VisitList/VisitListItem.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 ListItem from '@material-ui/core/ListItem';\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { Visit } from '../../api/VisitsApi';\nimport { ItemName } from './ItemName';\nimport { ItemDetail, ItemDetailType } from './ItemDetail';\nimport { ItemCategory } from './ItemCategory';\n\nconst useStyles = makeStyles(_theme => ({\n avatar: {\n minWidth: 0,\n },\n}));\nexport const VisitListItem = ({\n visit,\n detailType,\n}: {\n visit: Visit;\n detailType: ItemDetailType;\n}) => {\n const classes = useStyles();\n\n return (\n <ListItem disableGutters>\n <ListItemAvatar className={classes.avatar}>\n <ItemCategory visit={visit} />\n </ListItemAvatar>\n <ListItemText\n primary={<ItemName visit={visit} />}\n secondary={<ItemDetail visit={visit} type={detailType} />}\n disableTypography\n />\n </ListItem>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAyBA,MAAM,SAAA,GAAY,WAAW,CAAW,MAAA,MAAA;AAAA,EACtC,MAAQ,EAAA;AAAA,IACN,QAAU,EAAA;AAAA;AAEd,CAAE,CAAA,CAAA;AACK,MAAM,gBAAgB,CAAC;AAAA,EAC5B,KAAA;AAAA,EACA;AACF,CAGM,KAAA;AACJ,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EACE,uBAAA,IAAA,CAAC,QAAS,EAAA,EAAA,cAAA,EAAc,IACtB,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,kBAAe,SAAW,EAAA,OAAA,CAAQ,QACjC,QAAC,kBAAA,GAAA,CAAA,YAAA,EAAA,EAAa,OAAc,CAC9B,EAAA,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,OAAA,kBAAU,GAAA,CAAA,QAAA,EAAA,EAAS,KAAc,EAAA,CAAA;AAAA,QACjC,SAAW,kBAAA,GAAA,CAAC,UAAW,EAAA,EAAA,KAAA,EAAc,MAAM,UAAY,EAAA,CAAA;AAAA,QACvD,iBAAiB,EAAA;AAAA;AAAA;AACnB,GACF,EAAA,CAAA;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 ListItem from '@material-ui/core/ListItem';
|
|
4
4
|
import ListItemAvatar from '@material-ui/core/ListItemAvatar';
|
|
@@ -13,27 +13,33 @@ const useStyles = makeStyles((_theme) => ({
|
|
|
13
13
|
}));
|
|
14
14
|
const VisitListItemSkeleton = () => {
|
|
15
15
|
const classes = useStyles();
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
return /* @__PURE__ */ jsxs(ListItem, { disableGutters: true, children: [
|
|
17
|
+
/* @__PURE__ */ jsx(ListItemAvatar, { children: /* @__PURE__ */ jsx(
|
|
18
|
+
Skeleton,
|
|
19
|
+
{
|
|
20
|
+
className: classes.skeleton,
|
|
21
|
+
variant: "rect",
|
|
22
|
+
width: 50,
|
|
23
|
+
height: 24
|
|
24
|
+
}
|
|
25
|
+
) }),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
ListItemText,
|
|
28
|
+
{
|
|
29
|
+
primary: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "100%", height: 28 }),
|
|
30
|
+
disableTypography: true
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] });
|
|
31
34
|
};
|
|
32
35
|
const VisitListSkeleton = ({
|
|
33
36
|
numVisitsOpen,
|
|
34
37
|
numVisitsTotal,
|
|
35
38
|
collapsed
|
|
36
|
-
}) => /* @__PURE__ */
|
|
39
|
+
}) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
|
+
Array(numVisitsOpen).fill(null).map((_e, index) => /* @__PURE__ */ jsx(VisitListItemSkeleton, {}, index)),
|
|
41
|
+
numVisitsTotal > numVisitsOpen && /* @__PURE__ */ jsx(Collapse, { in: !collapsed, children: Array(numVisitsTotal - numVisitsOpen).fill(null).map((_e, index) => /* @__PURE__ */ jsx(VisitListItemSkeleton, {}, index)) })
|
|
42
|
+
] });
|
|
37
43
|
|
|
38
44
|
export { VisitListSkeleton };
|
|
39
45
|
//# sourceMappingURL=VisitListSkeleton.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisitListSkeleton.esm.js","sources":["../../../src/components/VisitList/VisitListSkeleton.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":"VisitListSkeleton.esm.js","sources":["../../../src/components/VisitList/VisitListSkeleton.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 Collapse from '@material-ui/core/Collapse';\nimport ListItem from '@material-ui/core/ListItem';\nimport ListItemAvatar from '@material-ui/core/ListItemAvatar';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\nimport Skeleton from '@material-ui/lab/Skeleton';\n\nconst useStyles = makeStyles(_theme => ({\n skeleton: {\n borderRadius: 30,\n },\n}));\n\nconst VisitListItemSkeleton = () => {\n const classes = useStyles();\n\n return (\n <ListItem disableGutters>\n <ListItemAvatar>\n <Skeleton\n className={classes.skeleton}\n variant=\"rect\"\n width={50}\n height={24}\n />\n </ListItemAvatar>\n <ListItemText\n primary={<Skeleton variant=\"text\" width=\"100%\" height={28} />}\n disableTypography\n />\n </ListItem>\n );\n};\n\nexport const VisitListSkeleton = ({\n numVisitsOpen,\n numVisitsTotal,\n collapsed,\n}: {\n numVisitsOpen: number;\n numVisitsTotal: number;\n collapsed: boolean;\n}) => (\n <>\n {Array(numVisitsOpen)\n .fill(null)\n .map((_e, index) => (\n <VisitListItemSkeleton key={index} />\n ))}\n {numVisitsTotal > numVisitsOpen && (\n <Collapse in={!collapsed}>\n {Array(numVisitsTotal - numVisitsOpen)\n .fill(null)\n .map((_e, index) => (\n <VisitListItemSkeleton key={index} />\n ))}\n </Collapse>\n )}\n </>\n);\n"],"names":[],"mappings":";;;;;;;;AAuBA,MAAM,SAAA,GAAY,WAAW,CAAW,MAAA,MAAA;AAAA,EACtC,QAAU,EAAA;AAAA,IACR,YAAc,EAAA;AAAA;AAElB,CAAE,CAAA,CAAA;AAEF,MAAM,wBAAwB,MAAM;AAClC,EAAA,MAAM,UAAU,SAAU,EAAA;AAE1B,EACE,uBAAA,IAAA,CAAC,QAAS,EAAA,EAAA,cAAA,EAAc,IACtB,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,cACC,EAAA,EAAA,QAAA,kBAAA,GAAA;AAAA,MAAC,QAAA;AAAA,MAAA;AAAA,QACC,WAAW,OAAQ,CAAA,QAAA;AAAA,QACnB,OAAQ,EAAA,MAAA;AAAA,QACR,KAAO,EAAA,EAAA;AAAA,QACP,MAAQ,EAAA;AAAA;AAAA,KAEZ,EAAA,CAAA;AAAA,oBACA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,OAAA,sBAAU,QAAS,EAAA,EAAA,OAAA,EAAQ,QAAO,KAAM,EAAA,MAAA,EAAO,QAAQ,EAAI,EAAA,CAAA;AAAA,QAC3D,iBAAiB,EAAA;AAAA;AAAA;AACnB,GACF,EAAA,CAAA;AAEJ,CAAA;AAEO,MAAM,oBAAoB,CAAC;AAAA,EAChC,aAAA;AAAA,EACA,cAAA;AAAA,EACA;AACF,CAAA,qBAMK,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,EAAA,KAAA,CAAM,aAAa,CAAA,CACjB,IAAK,CAAA,IAAI,CACT,CAAA,GAAA,CAAI,CAAC,EAAA,EAAI,KACR,qBAAA,GAAA,CAAC,qBAA2B,EAAA,EAAA,EAAA,KAAO,CACpC,CAAA;AAAA,EACF,cAAA,GAAiB,iCACf,GAAA,CAAA,QAAA,EAAA,EAAS,IAAI,CAAC,SAAA,EACZ,QAAM,EAAA,KAAA,CAAA,cAAA,GAAiB,aAAa,CAAA,CAClC,KAAK,IAAI,CAAA,CACT,IAAI,CAAC,EAAA,EAAI,0BACP,GAAA,CAAA,qBAAA,EAAA,EAAA,EAA2B,KAAO,CACpC,CACL,EAAA;AAAA,CAEJ,EAAA;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useEffect } from 'react';
|
|
2
3
|
import { useLocation } from 'react-router-dom';
|
|
3
4
|
import '@backstage/core-app-api';
|
|
4
5
|
import { visitsApiRef } from '../api/VisitsApi.esm.js';
|
|
@@ -52,7 +53,7 @@ const VisitListener = ({
|
|
|
52
53
|
});
|
|
53
54
|
return () => cancelAnimationFrame(requestId);
|
|
54
55
|
}, [visitsApi, pathname, toEntityRefImpl, visitNameImpl]);
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
export { VisitListener };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisitListener.esm.js","sources":["../../src/components/VisitListener.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
|
|
1
|
+
{"version":3,"file":"VisitListener.esm.js","sources":["../../src/components/VisitListener.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 { ReactNode, useEffect } from 'react';\n\nimport { useLocation } from 'react-router-dom';\n\nimport { visitsApiRef } from '../api';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\n\n/**\n * This function returns an implementation of toEntityRef which is responsible\n * for receiving a pathname and maybe returning an entityRef compatible with the\n * catalog-model.\n * By default this function uses the url root \"/catalog\" and the\n * stringifyEntityRef implementation from catalog-model.\n * Example:\n * const toEntityRef = getToEntityRef();\n * toEntityRef(\\{ pathname: \"/catalog/default/component/playback-order\" \\})\n * // returns \"component:default/playback-order\"\n */\nconst getToEntityRef =\n ({\n rootPath = 'catalog',\n stringifyEntityRefImpl = stringifyEntityRef,\n } = {}) =>\n ({ pathname }: { pathname: string }): string | undefined => {\n const regex = new RegExp(\n `^\\/${rootPath}\\/(?<namespace>[^\\/]+)\\/(?<kind>[^\\/]+)\\/(?<name>[^\\/]+)`,\n );\n const result = regex.exec(pathname);\n if (!result || !result?.groups) return undefined;\n const entity = {\n namespace: result.groups.namespace,\n kind: result.groups.kind,\n name: result.groups.name,\n };\n return stringifyEntityRefImpl(entity);\n };\n\n/**\n * @internal\n * This function returns an implementation of visitName which is responsible\n * for receiving a pathname and returning a string (name).\n */\nconst getVisitName =\n ({ rootPath = 'catalog', document = global.document } = {}) =>\n ({ pathname }: { pathname: string }) => {\n // If it is a catalog entity, get the name from the path\n const regex = new RegExp(\n `^\\/${rootPath}\\/(?<namespace>[^\\/]+)\\/(?<kind>[^\\/]+)\\/(?<name>[^\\/]+)`,\n );\n let result = regex.exec(pathname);\n if (result && result?.groups) return result.groups.name;\n\n // If it is a root pathname, get the name from there\n result = /^\\/(?<name>[^\\/]+)$/.exec(pathname);\n if (result && result?.groups) return result.groups.name;\n\n // Fallback to document title\n return document.title;\n };\n\n/**\n * @public\n * Component responsible for listening to location changes and calling\n * the visitsApi to save visits.\n */\nexport const VisitListener = ({\n children,\n toEntityRef,\n visitName,\n}: {\n children?: ReactNode;\n toEntityRef?: ({ pathname }: { pathname: string }) => string | undefined;\n visitName?: ({ pathname }: { pathname: string }) => string;\n}): JSX.Element => {\n const visitsApi = useApi(visitsApiRef);\n const { pathname } = useLocation();\n const toEntityRefImpl = toEntityRef ?? getToEntityRef();\n const visitNameImpl = visitName ?? getVisitName();\n useEffect(() => {\n // Wait for the browser to finish with paint with the assumption react\n // has finished with dom reconciliation.\n const requestId = requestAnimationFrame(() => {\n visitsApi.save({\n visit: {\n name: visitNameImpl({ pathname }),\n pathname,\n entityRef: toEntityRefImpl({ pathname }),\n },\n });\n });\n return () => cancelAnimationFrame(requestId);\n }, [visitsApi, pathname, toEntityRefImpl, visitNameImpl]);\n\n return <>{children}</>;\n};\n"],"names":[],"mappings":";;;;;;;;AAkCA,MAAM,iBACJ,CAAC;AAAA,EACC,QAAW,GAAA,SAAA;AAAA,EACX,sBAAyB,GAAA;AAC3B,CAAA,GAAI,EAAC,KACL,CAAC,EAAE,UAAyD,KAAA;AAC1D,EAAA,MAAM,QAAQ,IAAI,MAAA;AAAA,IAChB,KAAM,QAAQ,CAAA,kDAAA;AAAA,GAChB;AACA,EAAM,MAAA,MAAA,GAAS,KAAM,CAAA,IAAA,CAAK,QAAQ,CAAA;AAClC,EAAA,IAAI,CAAC,MAAA,IAAU,CAAC,MAAA,EAAQ,QAAe,OAAA,KAAA,CAAA;AACvC,EAAA,MAAM,MAAS,GAAA;AAAA,IACb,SAAA,EAAW,OAAO,MAAO,CAAA,SAAA;AAAA,IACzB,IAAA,EAAM,OAAO,MAAO,CAAA,IAAA;AAAA,IACpB,IAAA,EAAM,OAAO,MAAO,CAAA;AAAA,GACtB;AACA,EAAA,OAAO,uBAAuB,MAAM,CAAA;AACtC,CAAA;AAOF,MAAM,YACJ,GAAA,CAAC,EAAE,QAAA,GAAW,WAAW,QAAW,GAAA,MAAA,CAAO,QAAS,EAAA,GAAI,EAAC,KACzD,CAAC,EAAE,UAAqC,KAAA;AAEtC,EAAA,MAAM,QAAQ,IAAI,MAAA;AAAA,IAChB,KAAM,QAAQ,CAAA,kDAAA;AAAA,GAChB;AACA,EAAI,IAAA,MAAA,GAAS,KAAM,CAAA,IAAA,CAAK,QAAQ,CAAA;AAChC,EAAA,IAAI,MAAU,IAAA,MAAA,EAAQ,MAAQ,EAAA,OAAO,OAAO,MAAO,CAAA,IAAA;AAGnD,EAAS,MAAA,GAAA,qBAAA,CAAsB,KAAK,QAAQ,CAAA;AAC5C,EAAA,IAAI,MAAU,IAAA,MAAA,EAAQ,MAAQ,EAAA,OAAO,OAAO,MAAO,CAAA,IAAA;AAGnD,EAAA,OAAO,QAAS,CAAA,KAAA;AAClB,CAAA;AAOK,MAAM,gBAAgB,CAAC;AAAA,EAC5B,QAAA;AAAA,EACA,WAAA;AAAA,EACA;AACF,CAImB,KAAA;AACjB,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AACrC,EAAM,MAAA,EAAE,QAAS,EAAA,GAAI,WAAY,EAAA;AACjC,EAAM,MAAA,eAAA,GAAkB,eAAe,cAAe,EAAA;AACtD,EAAM,MAAA,aAAA,GAAgB,aAAa,YAAa,EAAA;AAChD,EAAA,SAAA,CAAU,MAAM;AAGd,IAAM,MAAA,SAAA,GAAY,sBAAsB,MAAM;AAC5C,MAAA,SAAA,CAAU,IAAK,CAAA;AAAA,QACb,KAAO,EAAA;AAAA,UACL,IAAM,EAAA,aAAA,CAAc,EAAE,QAAA,EAAU,CAAA;AAAA,UAChC,QAAA;AAAA,UACA,SAAW,EAAA,eAAA,CAAgB,EAAE,QAAA,EAAU;AAAA;AACzC,OACD,CAAA;AAAA,KACF,CAAA;AACD,IAAO,OAAA,MAAM,qBAAqB,SAAS,CAAA;AAAA,KAC1C,CAAC,SAAA,EAAW,QAAU,EAAA,eAAA,EAAiB,aAAa,CAAC,CAAA;AAExD,EAAA,uCAAU,QAAS,EAAA,CAAA;AACrB;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import Typography from '@material-ui/core/Typography';
|
|
2
3
|
import { useApi, configApiRef } from '@backstage/core-plugin-api';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
|
|
5
5
|
const CompanyLogo = (props) => {
|
|
6
6
|
const { logo, className } = props;
|
|
7
7
|
const configApi = useApi(configApiRef);
|
|
8
|
-
return /* @__PURE__ */
|
|
8
|
+
return /* @__PURE__ */ jsx("div", { className, children: logo ? /* @__PURE__ */ jsx(Fragment, { children: logo }) : /* @__PURE__ */ jsx(Typography, { variant: "h1", children: configApi.getString("app.title") }) });
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export { CompanyLogo };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompanyLogo.esm.js","sources":["../../../src/homePageComponents/CompanyLogo/CompanyLogo.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 */\nimport Typography from '@material-ui/core/Typography';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport
|
|
1
|
+
{"version":3,"file":"CompanyLogo.esm.js","sources":["../../../src/homePageComponents/CompanyLogo/CompanyLogo.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 */\nimport Typography from '@material-ui/core/Typography';\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\nimport { ReactNode } from 'react';\n\ntype CompanyLogoProps = {\n logo?: ReactNode;\n className?: string;\n};\n\n/**\n * A component to display a company logo for the user.\n *\n * @public\n */\nexport const CompanyLogo = (props: CompanyLogoProps) => {\n const { logo, className } = props;\n const configApi = useApi(configApiRef);\n\n return (\n <div className={className}>\n {logo ? (\n <>{logo}</>\n ) : (\n <Typography variant=\"h1\">{configApi.getString('app.title')}</Typography>\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;AA6Ba,MAAA,WAAA,GAAc,CAAC,KAA4B,KAAA;AACtD,EAAM,MAAA,EAAE,IAAM,EAAA,SAAA,EAAc,GAAA,KAAA;AAC5B,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AAErC,EAAA,uBACG,GAAA,CAAA,KAAA,EAAA,EAAI,SACF,EAAA,QAAA,EAAA,IAAA,mCACI,QAAK,EAAA,IAAA,EAAA,CAAA,mBAEP,GAAA,CAAA,UAAA,EAAA,EAAW,SAAQ,IAAM,EAAA,QAAA,EAAA,SAAA,CAAU,SAAU,CAAA,WAAW,GAAE,CAE/D,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import useAsync from 'react-use/esm/useAsync';
|
|
3
3
|
import { Progress, ErrorPanel, Link, EmptyState, LinkButton } from '@backstage/core-components';
|
|
4
4
|
import { catalogApiRef, EntityDisplayName } from '@backstage/plugin-catalog-react';
|
|
@@ -45,49 +45,51 @@ const Content = (props) => {
|
|
|
45
45
|
return response.items;
|
|
46
46
|
});
|
|
47
47
|
if (loading) {
|
|
48
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ jsx(Progress, {});
|
|
49
49
|
}
|
|
50
50
|
if (error) {
|
|
51
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ jsx(ErrorPanel, { error });
|
|
52
52
|
}
|
|
53
|
-
return entities?.length ? /* @__PURE__ */
|
|
53
|
+
return entities?.length ? /* @__PURE__ */ jsx(Fragment, { children: entities.map((d) => /* @__PURE__ */ jsxs(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
"data-testid": "docs-card-content",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(
|
|
59
|
+
Link,
|
|
60
|
+
{
|
|
61
|
+
className: styles.docsTitleLink,
|
|
62
|
+
"data-testid": "docs-card-title",
|
|
63
|
+
to: linkDestination || `/docs/${d.metadata.namespace || "default"}/${d.kind}/${d.metadata.name}/`,
|
|
64
|
+
children: /* @__PURE__ */ jsx(EntityDisplayName, { entityRef: stringifyEntityRef(d) })
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
d.metadata.description && /* @__PURE__ */ jsx(Typography, { className: styles.docDescription, children: d.metadata.description }),
|
|
68
|
+
/* @__PURE__ */ jsx(
|
|
69
|
+
Link,
|
|
70
|
+
{
|
|
71
|
+
className: styles.docSubLink,
|
|
72
|
+
"data-testid": "docs-card-sub-link",
|
|
73
|
+
to: linkDestination || `/docs/${d.metadata.namespace || "default"}/${d.kind}/${d.metadata.name}/`,
|
|
74
|
+
children: linkText
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
]
|
|
58
78
|
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
{
|
|
62
|
-
className: styles.docsTitleLink,
|
|
63
|
-
"data-testid": "docs-card-title",
|
|
64
|
-
to: linkDestination || `/docs/${d.metadata.namespace || "default"}/${d.kind}/${d.metadata.name}/`
|
|
65
|
-
},
|
|
66
|
-
/* @__PURE__ */ React.createElement(EntityDisplayName, { entityRef: stringifyEntityRef(d) })
|
|
67
|
-
),
|
|
68
|
-
d.metadata.description && /* @__PURE__ */ React.createElement(Typography, { className: styles.docDescription }, d.metadata.description),
|
|
69
|
-
/* @__PURE__ */ React.createElement(
|
|
70
|
-
Link,
|
|
71
|
-
{
|
|
72
|
-
className: styles.docSubLink,
|
|
73
|
-
"data-testid": "docs-card-sub-link",
|
|
74
|
-
to: linkDestination || `/docs/${d.metadata.namespace || "default"}/${d.kind}/${d.metadata.name}/`
|
|
75
|
-
},
|
|
76
|
-
linkText
|
|
77
|
-
)
|
|
78
|
-
))) : emptyState || /* @__PURE__ */ React.createElement(
|
|
79
|
+
`${d.metadata.name}-${d.kind}-${d.metadata.namespace}`
|
|
80
|
+
)) }) : emptyState || /* @__PURE__ */ jsx(
|
|
79
81
|
EmptyState,
|
|
80
82
|
{
|
|
81
83
|
missing: "data",
|
|
82
84
|
title: "No documents to show",
|
|
83
85
|
description: "Create your own document. Check out our Getting Started Information",
|
|
84
|
-
action: /* @__PURE__ */
|
|
86
|
+
action: /* @__PURE__ */ jsx(
|
|
85
87
|
LinkButton,
|
|
86
88
|
{
|
|
87
89
|
to: "https://backstage.io/docs/features/techdocs/getting-started",
|
|
88
|
-
variant: "contained"
|
|
89
|
-
|
|
90
|
-
|
|
90
|
+
variant: "contained",
|
|
91
|
+
children: "DOCS"
|
|
92
|
+
}
|
|
91
93
|
)
|
|
92
94
|
}
|
|
93
95
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.esm.js","sources":["../../../src/homePageComponents/FeaturedDocsCard/Content.tsx"],"sourcesContent":["/*\n * Copyright 2022 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":"Content.esm.js","sources":["../../../src/homePageComponents/FeaturedDocsCard/Content.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 { JSX } from 'react';\nimport useAsync from 'react-use/esm/useAsync';\nimport {\n LinkButton,\n EmptyState,\n Link,\n Progress,\n ErrorPanel,\n} from '@backstage/core-components';\nimport {\n catalogApiRef,\n CatalogApi,\n EntityDisplayName,\n} from '@backstage/plugin-catalog-react';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { EntityFilterQuery } from '@backstage/catalog-client';\n\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\n\n/**\n * Props customizing the <FeaturedDocsCard/> component.\n *\n * @public\n */\nexport type FeaturedDocsCardProps = {\n /** The entity filter used to display only the intended item/s */\n filter: EntityFilterQuery;\n /** An optional ReactNode for empty states */\n emptyState?: JSX.Element;\n /** An optional linkDestination to set for the Featured Doc */\n linkDestination?: string;\n /** An optional limit to set for link destination */\n responseLimit?: number;\n /** An optional string to customize sublink text */\n subLinkText?: string;\n};\n\n/** @public */\nexport type FeaturedDocsCardClassKey =\n | 'docDescription'\n | 'docSubLink'\n | 'docsTitleLink';\n\nconst useStyles = makeStyles(\n theme => ({\n docDescription: {\n fontSize: theme.typography.body1.fontSize,\n fontWeight: theme.typography.body1.fontWeight,\n marginBottom: theme.spacing(2),\n marginTop: theme.spacing(2),\n },\n docSubLink: {\n fontSize: theme.typography.subtitle1.fontSize,\n fontWeight: theme.typography.subtitle1.fontWeight,\n lineHeight: theme.typography.subtitle1.lineHeight,\n },\n docsTitleLink: {\n fontSize: theme.typography.h6.fontSize,\n fontWeight: theme.typography.h6.fontWeight,\n lineHeight: theme.typography.h6.lineHeight,\n },\n }),\n { name: 'HomeFeaturedDocsCard' },\n);\n\n/**\n * A component to display specific Featured Docs.\n *\n * @public\n */\nexport const Content = (props: FeaturedDocsCardProps): JSX.Element => {\n const { emptyState, filter, linkDestination, responseLimit, subLinkText } =\n props;\n const linkText = subLinkText || 'LEARN MORE';\n const styles = useStyles();\n const catalogApi: CatalogApi = useApi(catalogApiRef);\n const {\n value: entities,\n loading,\n error,\n } = useAsync(async () => {\n const response = await catalogApi.getEntities({\n filter: filter,\n limit: responseLimit || 10,\n });\n return response.items;\n });\n\n if (loading) {\n return <Progress />;\n }\n if (error) {\n return <ErrorPanel error={error} />;\n }\n\n return entities?.length ? (\n <>\n {entities.map(d => (\n <div\n key={`${d.metadata.name}-${d.kind}-${d.metadata.namespace}`}\n data-testid=\"docs-card-content\"\n >\n <Link\n className={styles.docsTitleLink}\n data-testid=\"docs-card-title\"\n to={\n linkDestination ||\n `/docs/${d.metadata.namespace || 'default'}/${d.kind}/${\n d.metadata.name\n }/`\n }\n >\n <EntityDisplayName entityRef={stringifyEntityRef(d)} />\n </Link>\n {d.metadata.description && (\n <Typography className={styles.docDescription}>\n {d.metadata.description}\n </Typography>\n )}\n <Link\n className={styles.docSubLink}\n data-testid=\"docs-card-sub-link\"\n to={\n linkDestination ||\n `/docs/${d.metadata.namespace || 'default'}/${d.kind}/${\n d.metadata.name\n }/`\n }\n >\n {linkText}\n </Link>\n </div>\n ))}\n </>\n ) : (\n emptyState || (\n <EmptyState\n missing=\"data\"\n title=\"No documents to show\"\n description=\"Create your own document. Check out our Getting Started Information\"\n action={\n <LinkButton\n to=\"https://backstage.io/docs/features/techdocs/getting-started\"\n variant=\"contained\"\n >\n DOCS\n </LinkButton>\n }\n />\n )\n );\n};\n"],"names":[],"mappings":"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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
2
3
|
import { HeaderLabel } from '@backstage/core-components';
|
|
3
4
|
|
|
4
5
|
const timeFormat = {
|
|
@@ -41,8 +42,8 @@ function getTimes(clockConfigs, customTimeFormat) {
|
|
|
41
42
|
const HeaderWorldClock = (props) => {
|
|
42
43
|
const { clockConfigs, customTimeFormat } = props;
|
|
43
44
|
const defaultTimes = [];
|
|
44
|
-
const [clocks, setTimes] =
|
|
45
|
-
|
|
45
|
+
const [clocks, setTimes] = useState(defaultTimes);
|
|
46
|
+
useEffect(() => {
|
|
46
47
|
setTimes(getTimes(clockConfigs, customTimeFormat));
|
|
47
48
|
const intervalId = setInterval(() => {
|
|
48
49
|
setTimes(getTimes(clockConfigs, customTimeFormat));
|
|
@@ -52,14 +53,14 @@ const HeaderWorldClock = (props) => {
|
|
|
52
53
|
};
|
|
53
54
|
}, [clockConfigs, customTimeFormat]);
|
|
54
55
|
if (clocks.length !== 0) {
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ jsx(Fragment, { children: clocks.map((clock) => /* @__PURE__ */ jsx(
|
|
56
57
|
HeaderLabel,
|
|
57
58
|
{
|
|
58
|
-
key: clock.label,
|
|
59
59
|
label: clock.label,
|
|
60
|
-
value: /* @__PURE__ */
|
|
61
|
-
}
|
|
62
|
-
|
|
60
|
+
value: /* @__PURE__ */ jsx("time", { dateTime: clock.dateTime, children: clock.value })
|
|
61
|
+
},
|
|
62
|
+
clock.label
|
|
63
|
+
)) });
|
|
63
64
|
}
|
|
64
65
|
return null;
|
|
65
66
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderWorldClock.esm.js","sources":["../../../src/homePageComponents/HeaderWorldClock/HeaderWorldClock.tsx"],"sourcesContent":["/*\n * Copyright 2020 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":"HeaderWorldClock.esm.js","sources":["../../../src/homePageComponents/HeaderWorldClock/HeaderWorldClock.tsx"],"sourcesContent":["/*\n * Copyright 2020 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 { useState, useEffect } from 'react';\nimport { HeaderLabel } from '@backstage/core-components';\n\nconst timeFormat: Intl.DateTimeFormatOptions = {\n hour: '2-digit',\n minute: '2-digit',\n};\n\ntype TimeObj = {\n label: string;\n value: string;\n dateTime: string;\n};\n\n/** @public */\nexport type ClockConfig = {\n label: string;\n timeZone: string;\n};\n\nfunction getTimes(\n clockConfigs: ClockConfig[],\n customTimeFormat?: Intl.DateTimeFormatOptions,\n) {\n const d = new Date();\n const lang = window.navigator.language;\n\n const clocks: TimeObj[] = [];\n\n if (!clockConfigs) {\n return clocks;\n }\n\n for (const clockConfig of clockConfigs) {\n let label = clockConfig.label;\n\n const options: Intl.DateTimeFormatOptions = {\n timeZone: clockConfig.timeZone,\n ...(customTimeFormat ?? timeFormat),\n };\n\n try {\n new Date().toLocaleString(lang, options);\n } catch (e) {\n // eslint-disable-next-line no-console\n console.warn(\n `The timezone ${options.timeZone} is invalid. Defaulting to GMT`,\n );\n options.timeZone = 'GMT';\n label = 'GMT';\n }\n\n const value = d.toLocaleTimeString(lang, options);\n const dateTime = d.toLocaleTimeString(lang, {\n timeZone: options.timeZone,\n hour: '2-digit',\n minute: '2-digit',\n hour12: false,\n });\n clocks.push({ label, value, dateTime });\n }\n\n return clocks;\n}\n\n/**\n * A component to display a configurable list of clocks for various time zones.\n *\n * @example\n * Here's a simple example:\n * ```\n * // This will give you a clock for the time zone that Stockholm is in\n * // you can add more than one but keep in mind space may be limited\n * const clockConfigs: ClockConfig[] = [\n * {\n * label: 'STO',\n * timeZone: 'Europe/Stockholm',\n * },\n * ];\n *\n * // Setting hour12 to false will make all the clocks show in the 24hr format\n * const timeFormat: Intl.DateTimeFormatOptions = {\n * hour: '2-digit',\n * minute: '2-digit',\n * hour12: false,\n * };\n *\n * // Here is the component in use:\n * <HeaderWorldClock\n * clockConfigs={clockConfigs}\n * customTimeFormat={timeFormat}\n * />\n * ```\n *\n * @public\n */\nexport const HeaderWorldClock = (props: {\n clockConfigs: ClockConfig[];\n customTimeFormat?: Intl.DateTimeFormatOptions;\n}) => {\n const { clockConfigs, customTimeFormat } = props;\n\n const defaultTimes: TimeObj[] = [];\n const [clocks, setTimes] = useState(defaultTimes);\n\n useEffect(() => {\n setTimes(getTimes(clockConfigs, customTimeFormat));\n\n const intervalId = setInterval(() => {\n setTimes(getTimes(clockConfigs, customTimeFormat));\n }, 1000);\n\n return () => {\n clearInterval(intervalId);\n };\n }, [clockConfigs, customTimeFormat]);\n\n if (clocks.length !== 0) {\n return (\n <>\n {clocks.map(clock => (\n <HeaderLabel\n key={clock.label}\n label={clock.label}\n value={<time dateTime={clock.dateTime}>{clock.value}</time>}\n />\n ))}\n </>\n );\n }\n return null;\n};\n"],"names":[],"mappings":";;;;AAmBA,MAAM,UAAyC,GAAA;AAAA,EAC7C,IAAM,EAAA,SAAA;AAAA,EACN,MAAQ,EAAA;AACV,CAAA;AAcA,SAAS,QAAA,CACP,cACA,gBACA,EAAA;AACA,EAAM,MAAA,CAAA,uBAAQ,IAAK,EAAA;AACnB,EAAM,MAAA,IAAA,GAAO,OAAO,SAAU,CAAA,QAAA;AAE9B,EAAA,MAAM,SAAoB,EAAC;AAE3B,EAAA,IAAI,CAAC,YAAc,EAAA;AACjB,IAAO,OAAA,MAAA;AAAA;AAGT,EAAA,KAAA,MAAW,eAAe,YAAc,EAAA;AACtC,IAAA,IAAI,QAAQ,WAAY,CAAA,KAAA;AAExB,IAAA,MAAM,OAAsC,GAAA;AAAA,MAC1C,UAAU,WAAY,CAAA,QAAA;AAAA,MACtB,GAAI,gBAAoB,IAAA;AAAA,KAC1B;AAEA,IAAI,IAAA;AACF,MAAA,iBAAA,IAAI,IAAK,EAAA,EAAE,cAAe,CAAA,IAAA,EAAM,OAAO,CAAA;AAAA,aAChC,CAAG,EAAA;AAEV,MAAQ,OAAA,CAAA,IAAA;AAAA,QACN,CAAA,aAAA,EAAgB,QAAQ,QAAQ,CAAA,8BAAA;AAAA,OAClC;AACA,MAAA,OAAA,CAAQ,QAAW,GAAA,KAAA;AACnB,MAAQ,KAAA,GAAA,KAAA;AAAA;AAGV,IAAA,MAAM,KAAQ,GAAA,CAAA,CAAE,kBAAmB,CAAA,IAAA,EAAM,OAAO,CAAA;AAChD,IAAM,MAAA,QAAA,GAAW,CAAE,CAAA,kBAAA,CAAmB,IAAM,EAAA;AAAA,MAC1C,UAAU,OAAQ,CAAA,QAAA;AAAA,MAClB,IAAM,EAAA,SAAA;AAAA,MACN,MAAQ,EAAA,SAAA;AAAA,MACR,MAAQ,EAAA;AAAA,KACT,CAAA;AACD,IAAA,MAAA,CAAO,IAAK,CAAA,EAAE,KAAO,EAAA,KAAA,EAAO,UAAU,CAAA;AAAA;AAGxC,EAAO,OAAA,MAAA;AACT;AAiCa,MAAA,gBAAA,GAAmB,CAAC,KAG3B,KAAA;AACJ,EAAM,MAAA,EAAE,YAAc,EAAA,gBAAA,EAAqB,GAAA,KAAA;AAE3C,EAAA,MAAM,eAA0B,EAAC;AACjC,EAAA,MAAM,CAAC,MAAA,EAAQ,QAAQ,CAAA,GAAI,SAAS,YAAY,CAAA;AAEhD,EAAA,SAAA,CAAU,MAAM;AACd,IAAS,QAAA,CAAA,QAAA,CAAS,YAAc,EAAA,gBAAgB,CAAC,CAAA;AAEjD,IAAM,MAAA,UAAA,GAAa,YAAY,MAAM;AACnC,MAAS,QAAA,CAAA,QAAA,CAAS,YAAc,EAAA,gBAAgB,CAAC,CAAA;AAAA,OAChD,GAAI,CAAA;AAEP,IAAA,OAAO,MAAM;AACX,MAAA,aAAA,CAAc,UAAU,CAAA;AAAA,KAC1B;AAAA,GACC,EAAA,CAAC,YAAc,EAAA,gBAAgB,CAAC,CAAA;AAEnC,EAAI,IAAA,MAAA,CAAO,WAAW,CAAG,EAAA;AACvB,IACE,uBAAA,GAAA,CAAA,QAAA,EAAA,EACG,QAAO,EAAA,MAAA,CAAA,GAAA,CAAI,CACV,KAAA,qBAAA,GAAA;AAAA,MAAC,WAAA;AAAA,MAAA;AAAA,QAEC,OAAO,KAAM,CAAA,KAAA;AAAA,QACb,uBAAQ,GAAA,CAAA,MAAA,EAAA,EAAK,UAAU,KAAM,CAAA,QAAA,EAAW,gBAAM,KAAM,EAAA;AAAA,OAAA;AAAA,MAF/C,KAAM,CAAA;AAAA,KAId,CACH,EAAA,CAAA;AAAA;AAGJ,EAAO,OAAA,IAAA;AACT;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Link } from '@backstage/core-components';
|
|
3
3
|
import Typography from '@material-ui/core/Typography';
|
|
4
4
|
import Grid from '@material-ui/core/Grid';
|
|
@@ -7,32 +7,40 @@ import { useStyles } from './styles.esm.js';
|
|
|
7
7
|
|
|
8
8
|
const Content = (props) => {
|
|
9
9
|
const styles = useStyles();
|
|
10
|
-
return /* @__PURE__ */
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
modalContent: props.image,
|
|
14
|
-
linkContent: props.modalTitle || "Onboarding"
|
|
15
|
-
}
|
|
16
|
-
), /* @__PURE__ */ React.createElement(Typography, { variant: "body1", paragraph: true }, props.cardDescription || "Get started with Backstage"), /* @__PURE__ */ React.createElement(ContentModal, { modalContent: props.image, linkContent: props.image }), /* @__PURE__ */ React.createElement(
|
|
17
|
-
Grid,
|
|
18
|
-
{
|
|
19
|
-
container: true,
|
|
20
|
-
alignItems: "center",
|
|
21
|
-
className: styles.contentActionContainer
|
|
22
|
-
},
|
|
23
|
-
props.downloadImage && /* @__PURE__ */ React.createElement(Grid, { item: true }, props.downloadImage),
|
|
24
|
-
/* @__PURE__ */ React.createElement(Grid, { item: true }, /* @__PURE__ */ React.createElement(
|
|
25
|
-
Link,
|
|
10
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
ContentModal,
|
|
26
13
|
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
14
|
+
modalContent: props.image,
|
|
15
|
+
linkContent: props.modalTitle || "Onboarding"
|
|
16
|
+
}
|
|
17
|
+
),
|
|
18
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", paragraph: true, children: props.cardDescription || "Get started with Backstage" }),
|
|
19
|
+
/* @__PURE__ */ jsx(ContentModal, { modalContent: props.image, linkContent: props.image }),
|
|
20
|
+
/* @__PURE__ */ jsxs(
|
|
21
|
+
Grid,
|
|
22
|
+
{
|
|
23
|
+
container: true,
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
className: styles.contentActionContainer,
|
|
26
|
+
children: [
|
|
27
|
+
props.downloadImage && /* @__PURE__ */ jsx(Grid, { item: true, children: props.downloadImage }),
|
|
28
|
+
/* @__PURE__ */ jsx(Grid, { item: true, children: /* @__PURE__ */ jsx(
|
|
29
|
+
Link,
|
|
30
|
+
{
|
|
31
|
+
to: props.docsLink || "https://backstage.io/docs/getting-started/",
|
|
32
|
+
"data-testid": "quick-start-link-to-docs",
|
|
33
|
+
underline: "none",
|
|
34
|
+
variant: "h6",
|
|
35
|
+
className: styles.link,
|
|
36
|
+
children: props.docsLinkTitle || "Learn more"
|
|
37
|
+
}
|
|
38
|
+
) })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
props.video && props.video
|
|
43
|
+
] });
|
|
36
44
|
};
|
|
37
45
|
|
|
38
46
|
export { Content };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Content.esm.js","sources":["../../../src/homePageComponents/QuickStart/Content.tsx"],"sourcesContent":["/*\n * Copyright 2022 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":"Content.esm.js","sources":["../../../src/homePageComponents/QuickStart/Content.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 { JSX } from 'react';\nimport { Link } from '@backstage/core-components';\nimport Typography from '@material-ui/core/Typography';\nimport Grid from '@material-ui/core/Grid';\nimport { ContentModal } from './ContentModal';\nimport { useStyles } from './styles';\n\n/**\n * Props customizing the <QuickStartCard/> component.\n *\n * @public\n */\nexport type QuickStartCardProps = {\n /** The modal link title */\n modalTitle?: string | JSX.Element;\n /** The link to docs title */\n docsLinkTitle?: string;\n /** The link to docs */\n docsLink?: string;\n /** The video to play on the card */\n video?: JSX.Element;\n /** A quickstart image to display on the card */\n image: JSX.Element;\n /** The card description*/\n cardDescription?: string;\n /** A component used to download a quickStart image*/\n downloadImage?: JSX.Element;\n};\n\n/**\n * A component to display Quick Start info on the homepage.\n *\n * @public\n */\nexport const Content = (props: QuickStartCardProps): JSX.Element => {\n const styles = useStyles();\n return (\n <>\n <ContentModal\n modalContent={props.image}\n linkContent={props.modalTitle || 'Onboarding'}\n />\n <Typography variant=\"body1\" paragraph>\n {props.cardDescription || 'Get started with Backstage'}\n </Typography>\n <ContentModal modalContent={props.image} linkContent={props.image} />\n <Grid\n container\n alignItems=\"center\"\n className={styles.contentActionContainer}\n >\n {props.downloadImage && <Grid item>{props.downloadImage}</Grid>}\n <Grid item>\n <Link\n to={props.docsLink || 'https://backstage.io/docs/getting-started/'}\n data-testid=\"quick-start-link-to-docs\"\n underline=\"none\"\n variant=\"h6\"\n className={styles.link}\n >\n {props.docsLinkTitle || 'Learn more'}\n </Link>\n </Grid>\n </Grid>\n {props.video && props.video}\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;AAkDa,MAAA,OAAA,GAAU,CAAC,KAA4C,KAAA;AAClE,EAAA,MAAM,SAAS,SAAU,EAAA;AACzB,EAAA,uBAEI,IAAA,CAAA,QAAA,EAAA,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,cAAc,KAAM,CAAA,KAAA;AAAA,QACpB,WAAA,EAAa,MAAM,UAAc,IAAA;AAAA;AAAA,KACnC;AAAA,oBACA,GAAA,CAAC,cAAW,OAAQ,EAAA,OAAA,EAAQ,WAAS,IAClC,EAAA,QAAA,EAAA,KAAA,CAAM,mBAAmB,4BAC5B,EAAA,CAAA;AAAA,wBACC,YAAa,EAAA,EAAA,YAAA,EAAc,MAAM,KAAO,EAAA,WAAA,EAAa,MAAM,KAAO,EAAA,CAAA;AAAA,oBACnE,IAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,SAAS,EAAA,IAAA;AAAA,QACT,UAAW,EAAA,QAAA;AAAA,QACX,WAAW,MAAO,CAAA,sBAAA;AAAA,QAEjB,QAAA,EAAA;AAAA,UAAA,KAAA,CAAM,iCAAkB,GAAA,CAAA,IAAA,EAAA,EAAK,IAAI,EAAA,IAAA,EAAE,gBAAM,aAAc,EAAA,CAAA;AAAA,0BACxD,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IACR,EAAA,QAAA,kBAAA,GAAA;AAAA,YAAC,IAAA;AAAA,YAAA;AAAA,cACC,EAAA,EAAI,MAAM,QAAY,IAAA,4CAAA;AAAA,cACtB,aAAY,EAAA,0BAAA;AAAA,cACZ,SAAU,EAAA,MAAA;AAAA,cACV,OAAQ,EAAA,IAAA;AAAA,cACR,WAAW,MAAO,CAAA,IAAA;AAAA,cAEjB,gBAAM,aAAiB,IAAA;AAAA;AAAA,WAE5B,EAAA;AAAA;AAAA;AAAA,KACF;AAAA,IACC,KAAA,CAAM,SAAS,KAAM,CAAA;AAAA,GACxB,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { Link } from '@backstage/core-components';
|
|
3
4
|
import Modal from '@material-ui/core/Modal';
|
|
4
5
|
import Box from '@material-ui/core/Box';
|
|
@@ -8,26 +9,29 @@ const ContentModal = (props) => {
|
|
|
8
9
|
const { modalContent, linkContent } = props;
|
|
9
10
|
const styles = useStyles();
|
|
10
11
|
const [open, setOpen] = useState(false);
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.linkText, "data-testid": "content-modal-container", children: [
|
|
13
|
+
/* @__PURE__ */ jsx(
|
|
14
|
+
Link,
|
|
15
|
+
{
|
|
16
|
+
to: "#",
|
|
17
|
+
component: "button",
|
|
18
|
+
variant: "h6",
|
|
19
|
+
underline: "none",
|
|
20
|
+
onClick: () => setOpen(true),
|
|
21
|
+
children: linkContent
|
|
22
|
+
}
|
|
23
|
+
),
|
|
24
|
+
/* @__PURE__ */ jsx(
|
|
25
|
+
Modal,
|
|
26
|
+
{
|
|
27
|
+
open,
|
|
28
|
+
onClose: () => setOpen(false),
|
|
29
|
+
"aria-labelledby": "content-modal",
|
|
30
|
+
"data-testid": "content-modal",
|
|
31
|
+
children: /* @__PURE__ */ jsx(Box, { className: styles.contentModal, "data-testid": "content-modal-open", children: modalContent })
|
|
32
|
+
}
|
|
33
|
+
)
|
|
34
|
+
] });
|
|
31
35
|
};
|
|
32
36
|
|
|
33
37
|
export { ContentModal };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentModal.esm.js","sources":["../../../src/homePageComponents/QuickStart/ContentModal.tsx"],"sourcesContent":["/*\n * Copyright 2022 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":"ContentModal.esm.js","sources":["../../../src/homePageComponents/QuickStart/ContentModal.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 { JSX, useState } from 'react';\nimport { Link } from '@backstage/core-components';\nimport Modal from '@material-ui/core/Modal';\nimport Box from '@material-ui/core/Box';\n\nimport { useStyles } from './styles';\n\nexport type ContentModalProps = {\n modalContent: JSX.Element;\n linkContent: string | JSX.Element;\n};\n\nexport const ContentModal = (props: ContentModalProps) => {\n const { modalContent, linkContent } = props;\n const styles = useStyles();\n const [open, setOpen] = useState(false);\n\n return (\n <div className={styles.linkText} data-testid=\"content-modal-container\">\n <Link\n to=\"#\"\n component=\"button\"\n variant=\"h6\"\n underline=\"none\"\n onClick={() => setOpen(true)}\n >\n {linkContent}\n </Link>\n <Modal\n open={open}\n onClose={() => setOpen(false)}\n aria-labelledby=\"content-modal\"\n data-testid=\"content-modal\"\n >\n <Box className={styles.contentModal} data-testid=\"content-modal-open\">\n {modalContent}\n </Box>\n </Modal>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;AA4Ba,MAAA,YAAA,GAAe,CAAC,KAA6B,KAAA;AACxD,EAAM,MAAA,EAAE,YAAc,EAAA,WAAA,EAAgB,GAAA,KAAA;AACtC,EAAA,MAAM,SAAS,SAAU,EAAA;AACzB,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AAEtC,EAAA,4BACG,KAAI,EAAA,EAAA,SAAA,EAAW,MAAO,CAAA,QAAA,EAAU,eAAY,yBAC3C,EAAA,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,IAAA;AAAA,MAAA;AAAA,QACC,EAAG,EAAA,GAAA;AAAA,QACH,SAAU,EAAA,QAAA;AAAA,QACV,OAAQ,EAAA,IAAA;AAAA,QACR,SAAU,EAAA,MAAA;AAAA,QACV,OAAA,EAAS,MAAM,OAAA,CAAQ,IAAI,CAAA;AAAA,QAE1B,QAAA,EAAA;AAAA;AAAA,KACH;AAAA,oBACA,GAAA;AAAA,MAAC,KAAA;AAAA,MAAA;AAAA,QACC,IAAA;AAAA,QACA,OAAA,EAAS,MAAM,OAAA,CAAQ,KAAK,CAAA;AAAA,QAC5B,iBAAgB,EAAA,eAAA;AAAA,QAChB,aAAY,EAAA,eAAA;AAAA,QAEZ,8BAAC,GAAI,EAAA,EAAA,SAAA,EAAW,OAAO,YAAc,EAAA,aAAA,EAAY,sBAC9C,QACH,EAAA,YAAA,EAAA;AAAA;AAAA;AACF,GACF,EAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import Button from '@material-ui/core/Button';
|
|
3
3
|
import { useRandomJoke } from './Context.esm.js';
|
|
4
4
|
|
|
5
5
|
const Actions = () => {
|
|
6
6
|
const { rerollJoke } = useRandomJoke();
|
|
7
|
-
return /* @__PURE__ */
|
|
7
|
+
return /* @__PURE__ */ jsx(Button, { variant: "contained", color: "primary", onClick: () => rerollJoke(), children: "Reroll" });
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { Actions };
|