@backstage/plugin-api-docs 0.10.4-next.2 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +4 -1
  3. package/alpha/package.json +7 -0
  4. package/dist/alpha.d.ts +9 -0
  5. package/dist/alpha.esm.js +169 -0
  6. package/dist/alpha.esm.js.map +1 -0
  7. package/dist/esm/ApiDefinitionCard-504c2432.esm.js +47 -0
  8. package/dist/esm/ApiDefinitionCard-504c2432.esm.js.map +1 -0
  9. package/dist/esm/ApiDefinitionWidget-798ee85f.esm.js +116 -0
  10. package/dist/esm/ApiDefinitionWidget-798ee85f.esm.js.map +1 -0
  11. package/dist/esm/ApiExplorerPage-ce544a95.esm.js +60 -0
  12. package/dist/esm/ApiExplorerPage-ce544a95.esm.js.map +1 -0
  13. package/dist/esm/ApiTypeTitle-cc79a2f3.esm.js +27 -0
  14. package/dist/esm/ApiTypeTitle-cc79a2f3.esm.js.map +1 -0
  15. package/dist/esm/ProvidedApisCard-e92fbd29.esm.js +256 -0
  16. package/dist/esm/ProvidedApisCard-e92fbd29.esm.js.map +1 -0
  17. package/dist/esm/ProvidingComponentsCard-5b679445.esm.js +70 -0
  18. package/dist/esm/ProvidingComponentsCard-5b679445.esm.js.map +1 -0
  19. package/dist/esm/{index-3c5f9414.esm.js → index-435dfc01.esm.js} +4 -8
  20. package/dist/esm/index-435dfc01.esm.js.map +1 -0
  21. package/dist/esm/{index-3d17238a.esm.js → index-5f0727eb.esm.js} +9 -11
  22. package/dist/esm/index-5f0727eb.esm.js.map +1 -0
  23. package/dist/esm/index-6f21bd2e.esm.js +11 -0
  24. package/dist/esm/index-6f21bd2e.esm.js.map +1 -0
  25. package/dist/esm/index-c969ed3d.esm.js +7 -0
  26. package/dist/esm/index-c969ed3d.esm.js.map +1 -0
  27. package/dist/index.esm.js +29 -539
  28. package/dist/index.esm.js.map +1 -1
  29. package/package.json +32 -18
  30. package/dist/esm/index-1081c12a.esm.js +0 -16
  31. package/dist/esm/index-1081c12a.esm.js.map +0 -1
  32. package/dist/esm/index-3c5f9414.esm.js.map +0 -1
  33. package/dist/esm/index-3d17238a.esm.js.map +0 -1
  34. package/dist/esm/index-ca71e2a1.esm.js +0 -16
  35. package/dist/esm/index-ca71e2a1.esm.js.map +0 -1
@@ -0,0 +1,256 @@
1
+ import { RELATION_CONSUMES_API, RELATION_HAS_PART, RELATION_PROVIDES_API } from '@backstage/catalog-model';
2
+ import { makeStyles, Dialog, DialogTitle, Typography, DialogContent, Tabs, Tab, DialogActions, Button, Box } from '@material-ui/core';
3
+ import { EntityTable, useEntity, useRelatedEntities } from '@backstage/plugin-catalog-react';
4
+ import React, { useEffect, useState } from 'react';
5
+ import { InfoCard, Progress, WarningPanel, CodeSnippet, Link } from '@backstage/core-components';
6
+ import ExtensionIcon from '@material-ui/icons/Extension';
7
+ import { ToggleButton } from '@material-ui/lab';
8
+ import { a as apiDocsConfigRef } from './ApiDefinitionWidget-798ee85f.esm.js';
9
+ import { useApi } from '@backstage/core-plugin-api';
10
+ import '@material-ui/core/styles';
11
+ import { P as PlainApiDefinitionWidget, A as ApiTypeTitle } from './ApiTypeTitle-cc79a2f3.esm.js';
12
+
13
+ const useStyles = makeStyles((theme) => ({
14
+ fullHeightDialog: {
15
+ height: "calc(100% - 64px)"
16
+ },
17
+ root: {
18
+ display: "flex",
19
+ flexGrow: 1,
20
+ width: "100%",
21
+ height: "100%"
22
+ },
23
+ tabs: {
24
+ borderRight: `1px solid ${theme.palette.divider}`,
25
+ flexShrink: 0
26
+ },
27
+ tabContents: {
28
+ flexGrow: 1,
29
+ overflowX: "auto"
30
+ },
31
+ title: {
32
+ color: theme.palette.text.primary,
33
+ wordBreak: "break-word",
34
+ fontSize: theme.typography.h3.fontSize,
35
+ marginBottom: 0
36
+ },
37
+ type: {
38
+ textTransform: "uppercase",
39
+ fontSize: 11,
40
+ opacity: 0.8,
41
+ marginBottom: theme.spacing(1),
42
+ color: theme.palette.text.primary
43
+ }
44
+ }));
45
+ function TabPanel(props) {
46
+ const { children, value, index, ...other } = props;
47
+ const classes = useStyles();
48
+ return /* @__PURE__ */ React.createElement(
49
+ "div",
50
+ {
51
+ role: "tabpanel",
52
+ hidden: value !== index,
53
+ id: `vertical-tabpanel-${index}`,
54
+ "aria-labelledby": `vertical-tab-${index}`,
55
+ className: classes.tabContents,
56
+ ...other
57
+ },
58
+ value === index && /* @__PURE__ */ React.createElement(Box, { pl: 3, pr: 3 }, children)
59
+ );
60
+ }
61
+ function a11yProps(index) {
62
+ return {
63
+ id: `vertical-tab-${index}`,
64
+ "aria-controls": `vertical-tabpanel-${index}`
65
+ };
66
+ }
67
+ function ApiDefinitionDialog(props) {
68
+ var _a, _b, _c;
69
+ const { open, entity, onClose } = props;
70
+ const [activeTab, setActiveTab] = React.useState(0);
71
+ const classes = useStyles();
72
+ useEffect(() => {
73
+ setActiveTab(0);
74
+ }, [open]);
75
+ const config = useApi(apiDocsConfigRef);
76
+ const definitionWidget = config.getApiDefinitionWidget(entity);
77
+ let tabIndex = 0;
78
+ let tabPanelIndex = 0;
79
+ return /* @__PURE__ */ React.createElement(
80
+ Dialog,
81
+ {
82
+ fullWidth: true,
83
+ maxWidth: "xl",
84
+ open,
85
+ onClose,
86
+ "aria-labelledby": "api-definition-dialog-title",
87
+ PaperProps: { className: classes.fullHeightDialog }
88
+ },
89
+ /* @__PURE__ */ React.createElement(DialogTitle, { id: "api-definition-dialog-title", disableTypography: true }, /* @__PURE__ */ React.createElement(Typography, { className: classes.type }, "API - ", (_a = definitionWidget == null ? void 0 : definitionWidget.title) != null ? _a : "Raw"), /* @__PURE__ */ React.createElement(Typography, { className: classes.title, variant: "h1" }, (_b = entity.metadata.title) != null ? _b : entity.metadata.name)),
90
+ /* @__PURE__ */ React.createElement(DialogContent, { dividers: true, className: classes.root }, /* @__PURE__ */ React.createElement(
91
+ Tabs,
92
+ {
93
+ orientation: "vertical",
94
+ variant: "scrollable",
95
+ value: activeTab,
96
+ onChange: (_, newValue) => setActiveTab(newValue),
97
+ "aria-label": "API definition options",
98
+ className: classes.tabs
99
+ },
100
+ definitionWidget ? /* @__PURE__ */ React.createElement(Tab, { label: definitionWidget.title, ...a11yProps(tabIndex++) }) : null,
101
+ /* @__PURE__ */ React.createElement(Tab, { label: "Raw", ...a11yProps(tabIndex++) })
102
+ ), definitionWidget ? /* @__PURE__ */ React.createElement(TabPanel, { value: activeTab, index: tabPanelIndex++ }, definitionWidget.component(entity.spec.definition)) : null, /* @__PURE__ */ React.createElement(TabPanel, { value: activeTab, index: tabPanelIndex++ }, /* @__PURE__ */ React.createElement(
103
+ PlainApiDefinitionWidget,
104
+ {
105
+ definition: entity.spec.definition,
106
+ language: (_c = definitionWidget == null ? void 0 : definitionWidget.rawLanguage) != null ? _c : entity.spec.type
107
+ }
108
+ ))),
109
+ /* @__PURE__ */ React.createElement(DialogActions, null, /* @__PURE__ */ React.createElement(Button, { onClick: onClose, color: "primary" }, "Close"))
110
+ );
111
+ }
112
+
113
+ function createSpecApiTypeColumn() {
114
+ return {
115
+ title: "Type",
116
+ field: "spec.type",
117
+ render: (entity) => /* @__PURE__ */ React.createElement(ApiTypeTitle, { apiEntity: entity })
118
+ };
119
+ }
120
+ const ApiDefinitionButton = ({ apiEntity }) => {
121
+ const [dialogOpen, setDialogOpen] = useState(false);
122
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
123
+ ToggleButton,
124
+ {
125
+ "aria-label": "Toggle API Definition Dialog",
126
+ onClick: () => setDialogOpen(!dialogOpen)
127
+ },
128
+ /* @__PURE__ */ React.createElement(ExtensionIcon, null)
129
+ ), /* @__PURE__ */ React.createElement(
130
+ ApiDefinitionDialog,
131
+ {
132
+ entity: apiEntity,
133
+ open: dialogOpen,
134
+ onClose: () => setDialogOpen(false)
135
+ }
136
+ ));
137
+ };
138
+ function createApiDefinitionColumn() {
139
+ return {
140
+ title: "API Definition",
141
+ render: (entity) => /* @__PURE__ */ React.createElement(ApiDefinitionButton, { apiEntity: entity })
142
+ };
143
+ }
144
+ const apiEntityColumns = [
145
+ EntityTable.columns.createEntityRefColumn({ defaultKind: "API" }),
146
+ EntityTable.columns.createSystemColumn(),
147
+ EntityTable.columns.createOwnerColumn(),
148
+ createSpecApiTypeColumn(),
149
+ EntityTable.columns.createSpecLifecycleColumn(),
150
+ EntityTable.columns.createMetadataDescriptionColumn(),
151
+ createApiDefinitionColumn()
152
+ ];
153
+
154
+ const ConsumedApisCard = (props) => {
155
+ const { variant = "gridItem", columns = apiEntityColumns } = props;
156
+ const { entity } = useEntity();
157
+ const { entities, loading, error } = useRelatedEntities(entity, {
158
+ type: RELATION_CONSUMES_API
159
+ });
160
+ if (loading) {
161
+ return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Consumed APIs" }, /* @__PURE__ */ React.createElement(Progress, null));
162
+ }
163
+ if (error || !entities) {
164
+ return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Consumed APIs" }, /* @__PURE__ */ React.createElement(
165
+ WarningPanel,
166
+ {
167
+ severity: "error",
168
+ title: "Could not load APIs",
169
+ message: /* @__PURE__ */ React.createElement(CodeSnippet, { text: `${error}`, language: "text" })
170
+ }
171
+ ));
172
+ }
173
+ return /* @__PURE__ */ React.createElement(
174
+ EntityTable,
175
+ {
176
+ title: "Consumed APIs",
177
+ variant,
178
+ emptyContent: /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not consume any APIs."), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional" }, "Learn how to change this."))),
179
+ columns,
180
+ entities
181
+ }
182
+ );
183
+ };
184
+
185
+ const presetColumns = [
186
+ EntityTable.columns.createEntityRefColumn({ defaultKind: "API" }),
187
+ EntityTable.columns.createOwnerColumn(),
188
+ createSpecApiTypeColumn(),
189
+ EntityTable.columns.createSpecLifecycleColumn(),
190
+ EntityTable.columns.createMetadataDescriptionColumn()
191
+ ];
192
+ const HasApisCard = (props) => {
193
+ const { variant = "gridItem", columns = presetColumns } = props;
194
+ const { entity } = useEntity();
195
+ const { entities, loading, error } = useRelatedEntities(entity, {
196
+ type: RELATION_HAS_PART,
197
+ kind: "API"
198
+ });
199
+ if (loading) {
200
+ return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "APIs" }, /* @__PURE__ */ React.createElement(Progress, null));
201
+ }
202
+ if (error || !entities) {
203
+ return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "APIs" }, /* @__PURE__ */ React.createElement(
204
+ WarningPanel,
205
+ {
206
+ severity: "error",
207
+ title: "Could not load APIs",
208
+ message: /* @__PURE__ */ React.createElement(CodeSnippet, { text: `${error}`, language: "text" })
209
+ }
210
+ ));
211
+ }
212
+ return /* @__PURE__ */ React.createElement(
213
+ EntityTable,
214
+ {
215
+ title: "APIs",
216
+ variant,
217
+ emptyContent: /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not contain any APIs."), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/software-catalog/descriptor-format#kind-api" }, "Learn how to change this."))),
218
+ columns,
219
+ entities
220
+ }
221
+ );
222
+ };
223
+
224
+ const ProvidedApisCard = (props) => {
225
+ const { variant = "gridItem", columns = apiEntityColumns } = props;
226
+ const { entity } = useEntity();
227
+ const { entities, loading, error } = useRelatedEntities(entity, {
228
+ type: RELATION_PROVIDES_API
229
+ });
230
+ if (loading) {
231
+ return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Provided APIs" }, /* @__PURE__ */ React.createElement(Progress, null));
232
+ }
233
+ if (error || !entities) {
234
+ return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Provided APIs" }, /* @__PURE__ */ React.createElement(
235
+ WarningPanel,
236
+ {
237
+ severity: "error",
238
+ title: "Could not load APIs",
239
+ message: /* @__PURE__ */ React.createElement(CodeSnippet, { text: `${error}`, language: "text" })
240
+ }
241
+ ));
242
+ }
243
+ return /* @__PURE__ */ React.createElement(
244
+ EntityTable,
245
+ {
246
+ title: "Provided APIs",
247
+ variant,
248
+ emptyContent: /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "This ", entity.kind.toLocaleLowerCase("en-US"), " does not provide any APIs."), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional" }, "Learn how to change this."))),
249
+ columns,
250
+ entities
251
+ }
252
+ );
253
+ };
254
+
255
+ export { ApiDefinitionDialog as A, ConsumedApisCard as C, HasApisCard as H, ProvidedApisCard as P };
256
+ //# sourceMappingURL=ProvidedApisCard-e92fbd29.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProvidedApisCard-e92fbd29.esm.js","sources":["../../src/components/ApiDefinitionDialog/ApiDefinitionDialog.tsx","../../src/components/ApisCards/presets.tsx","../../src/components/ApisCards/ConsumedApisCard.tsx","../../src/components/ApisCards/HasApisCard.tsx","../../src/components/ApisCards/ProvidedApisCard.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 { ApiEntity } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n Box,\n Button,\n Dialog,\n DialogActions,\n DialogContent,\n DialogTitle,\n makeStyles,\n Tab,\n Tabs,\n Typography,\n} from '@material-ui/core';\nimport React, { useEffect } from 'react';\nimport { apiDocsConfigRef } from '../../config';\nimport { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';\n\nconst useStyles = makeStyles(theme => ({\n fullHeightDialog: {\n height: 'calc(100% - 64px)',\n },\n root: {\n display: 'flex',\n flexGrow: 1,\n width: '100%',\n height: '100%',\n },\n tabs: {\n borderRight: `1px solid ${theme.palette.divider}`,\n flexShrink: 0,\n },\n tabContents: {\n flexGrow: 1,\n overflowX: 'auto',\n },\n title: {\n color: theme.palette.text.primary,\n wordBreak: 'break-word',\n fontSize: theme.typography.h3.fontSize,\n marginBottom: 0,\n },\n type: {\n textTransform: 'uppercase',\n fontSize: 11,\n opacity: 0.8,\n marginBottom: theme.spacing(1),\n color: theme.palette.text.primary,\n },\n}));\n\nfunction TabPanel(props: {\n children?: React.ReactNode;\n index: number;\n value: number;\n}) {\n const { children, value, index, ...other } = props;\n const classes = useStyles();\n return (\n <div\n role=\"tabpanel\"\n hidden={value !== index}\n id={`vertical-tabpanel-${index}`}\n aria-labelledby={`vertical-tab-${index}`}\n className={classes.tabContents}\n {...other}\n >\n {value === index && (\n <Box pl={3} pr={3}>\n {children}\n </Box>\n )}\n </div>\n );\n}\n\nfunction a11yProps(index: number) {\n return {\n id: `vertical-tab-${index}`,\n 'aria-controls': `vertical-tabpanel-${index}`,\n };\n}\n\n/**\n * A dialog that lets users inspect the API definition.\n *\n * @public\n */\nexport function ApiDefinitionDialog(props: {\n open: boolean;\n entity: ApiEntity;\n onClose: () => void;\n}) {\n const { open, entity, onClose } = props;\n const [activeTab, setActiveTab] = React.useState(0);\n const classes = useStyles();\n\n useEffect(() => {\n setActiveTab(0);\n }, [open]);\n\n const config = useApi(apiDocsConfigRef);\n const definitionWidget = config.getApiDefinitionWidget(entity);\n\n let tabIndex = 0;\n let tabPanelIndex = 0;\n\n return (\n <Dialog\n fullWidth\n maxWidth=\"xl\"\n open={open}\n onClose={onClose}\n aria-labelledby=\"api-definition-dialog-title\"\n PaperProps={{ className: classes.fullHeightDialog }}\n >\n <DialogTitle id=\"api-definition-dialog-title\" disableTypography>\n <Typography className={classes.type}>\n API - {definitionWidget?.title ?? 'Raw'}\n </Typography>\n <Typography className={classes.title} variant=\"h1\">\n {entity.metadata.title ?? entity.metadata.name}\n </Typography>\n </DialogTitle>\n <DialogContent dividers className={classes.root}>\n <Tabs\n orientation=\"vertical\"\n variant=\"scrollable\"\n value={activeTab}\n onChange={(_, newValue) => setActiveTab(newValue)}\n aria-label=\"API definition options\"\n className={classes.tabs}\n >\n {definitionWidget ? (\n <Tab label={definitionWidget.title} {...a11yProps(tabIndex++)} />\n ) : null}\n <Tab label=\"Raw\" {...a11yProps(tabIndex++)} />\n </Tabs>\n\n {definitionWidget ? (\n <TabPanel value={activeTab} index={tabPanelIndex++}>\n {definitionWidget.component(entity.spec.definition)}\n </TabPanel>\n ) : null}\n <TabPanel value={activeTab} index={tabPanelIndex++}>\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={definitionWidget?.rawLanguage ?? entity.spec.type}\n />\n </TabPanel>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose} color=\"primary\">\n Close\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n","/*\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 { ApiEntity } from '@backstage/catalog-model';\nimport { TableColumn } from '@backstage/core-components';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport ExtensionIcon from '@material-ui/icons/Extension';\nimport { ToggleButton } from '@material-ui/lab';\nimport React, { useState } from 'react';\nimport { ApiTypeTitle } from '../ApiDefinitionCard';\nimport { ApiDefinitionDialog } from '../ApiDefinitionDialog';\n\nexport function createSpecApiTypeColumn(): TableColumn<ApiEntity> {\n return {\n title: 'Type',\n field: 'spec.type',\n render: entity => <ApiTypeTitle apiEntity={entity} />,\n };\n}\n\nconst ApiDefinitionButton = ({ apiEntity }: { apiEntity: ApiEntity }) => {\n const [dialogOpen, setDialogOpen] = useState(false);\n return (\n <>\n <ToggleButton\n aria-label=\"Toggle API Definition Dialog\"\n onClick={() => setDialogOpen(!dialogOpen)}\n >\n <ExtensionIcon />\n </ToggleButton>\n <ApiDefinitionDialog\n entity={apiEntity}\n open={dialogOpen}\n onClose={() => setDialogOpen(false)}\n />\n </>\n );\n};\n\nfunction createApiDefinitionColumn(): TableColumn<ApiEntity> {\n return {\n title: 'API Definition',\n render: entity => <ApiDefinitionButton apiEntity={entity} />,\n };\n}\n\nexport const apiEntityColumns: TableColumn<ApiEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createSystemColumn(),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n createApiDefinitionColumn(),\n];\n","/*\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 { ApiEntity, RELATION_CONSUMES_API } from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { apiEntityColumns } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n WarningPanel,\n} from '@backstage/core-components';\n\n/**\n * @public\n */\nexport const ConsumedApisCard = (props: {\n variant?: InfoCardVariants;\n columns?: TableColumn<ApiEntity>[];\n}) => {\n const { variant = 'gridItem', columns = apiEntityColumns } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_CONSUMES_API,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Consumed APIs\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Consumed APIs\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load APIs\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Consumed APIs\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n This {entity.kind.toLocaleLowerCase('en-US')} does not consume any\n APIs.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={entities as ApiEntity[]}\n />\n );\n};\n","/*\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 { ApiEntity, RELATION_HAS_PART } from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { createSpecApiTypeColumn } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n WarningPanel,\n} from '@backstage/core-components';\n\nconst presetColumns: TableColumn<ApiEntity>[] = [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n];\n\n/**\n * @public\n */\nexport const HasApisCard = (props: {\n variant?: InfoCardVariants;\n columns?: TableColumn<ApiEntity>[];\n}) => {\n const { variant = 'gridItem', columns = presetColumns } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_HAS_PART,\n kind: 'API',\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"APIs\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"APIs\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load APIs\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"APIs\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n This {entity.kind.toLocaleLowerCase('en-US')} does not contain any\n APIs.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#kind-api\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={entities as ApiEntity[]}\n />\n );\n};\n","/*\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 { ApiEntity, RELATION_PROVIDES_API } from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { apiEntityColumns } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n WarningPanel,\n} from '@backstage/core-components';\n\n/**\n * @public\n */\nexport const ProvidedApisCard = (props: {\n variant?: InfoCardVariants;\n columns?: TableColumn<ApiEntity>[];\n}) => {\n const { variant = 'gridItem', columns = apiEntityColumns } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_PROVIDES_API,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Provided APIs\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Provided APIs\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load APIs\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Provided APIs\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n This {entity.kind.toLocaleLowerCase('en-US')} does not provide any\n APIs.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n entities={entities as ApiEntity[]}\n />\n );\n};\n"],"names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;;;;"}
@@ -0,0 +1,70 @@
1
+ import { RELATION_API_CONSUMED_BY, RELATION_API_PROVIDED_BY } from '@backstage/catalog-model';
2
+ import { Typography } from '@material-ui/core';
3
+ import { useEntity, useRelatedEntities, EntityTable } from '@backstage/plugin-catalog-react';
4
+ import React from 'react';
5
+ import { InfoCard, Progress, WarningPanel, CodeSnippet, Link } from '@backstage/core-components';
6
+
7
+ const ConsumingComponentsCard = (props) => {
8
+ const { variant = "gridItem" } = props;
9
+ const { entity } = useEntity();
10
+ const { entities, loading, error } = useRelatedEntities(entity, {
11
+ type: RELATION_API_CONSUMED_BY
12
+ });
13
+ if (loading) {
14
+ return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Consumers" }, /* @__PURE__ */ React.createElement(Progress, null));
15
+ }
16
+ if (error || !entities) {
17
+ return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Consumers" }, /* @__PURE__ */ React.createElement(
18
+ WarningPanel,
19
+ {
20
+ severity: "error",
21
+ title: "Could not load components",
22
+ message: /* @__PURE__ */ React.createElement(CodeSnippet, { text: `${error}`, language: "text" })
23
+ }
24
+ ));
25
+ }
26
+ return /* @__PURE__ */ React.createElement(
27
+ EntityTable,
28
+ {
29
+ title: "Consumers",
30
+ variant,
31
+ emptyContent: /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "No component consumes this API."), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional" }, "Learn how to change this."))),
32
+ columns: EntityTable.componentEntityColumns,
33
+ entities
34
+ }
35
+ );
36
+ };
37
+
38
+ const ProvidingComponentsCard = (props) => {
39
+ const { variant = "gridItem" } = props;
40
+ const { entity } = useEntity();
41
+ const { entities, loading, error } = useRelatedEntities(entity, {
42
+ type: RELATION_API_PROVIDED_BY
43
+ });
44
+ if (loading) {
45
+ return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Providers" }, /* @__PURE__ */ React.createElement(Progress, null));
46
+ }
47
+ if (error || !entities) {
48
+ return /* @__PURE__ */ React.createElement(InfoCard, { variant, title: "Providers" }, /* @__PURE__ */ React.createElement(
49
+ WarningPanel,
50
+ {
51
+ severity: "error",
52
+ title: "Could not load components",
53
+ message: /* @__PURE__ */ React.createElement(CodeSnippet, { text: `${error}`, language: "text" })
54
+ }
55
+ ));
56
+ }
57
+ return /* @__PURE__ */ React.createElement(
58
+ EntityTable,
59
+ {
60
+ title: "Providers",
61
+ variant,
62
+ emptyContent: /* @__PURE__ */ React.createElement("div", { style: { textAlign: "center" } }, /* @__PURE__ */ React.createElement(Typography, { variant: "body1" }, "No component provides this API."), /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional" }, "Learn how to change this."))),
63
+ columns: EntityTable.componentEntityColumns,
64
+ entities
65
+ }
66
+ );
67
+ };
68
+
69
+ export { ConsumingComponentsCard as C, ProvidingComponentsCard as P };
70
+ //# sourceMappingURL=ProvidingComponentsCard-5b679445.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProvidingComponentsCard-5b679445.esm.js","sources":["../../src/components/ComponentsCards/ConsumingComponentsCard.tsx","../../src/components/ComponentsCards/ProvidingComponentsCard.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 {\n ComponentEntity,\n RELATION_API_CONSUMED_BY,\n} from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\n/**\n * @public\n */\nexport const ConsumingComponentsCard = (props: {\n variant?: InfoCardVariants;\n}) => {\n const { variant = 'gridItem' } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_API_CONSUMED_BY,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Consumers\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Consumers\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load components\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Consumers\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n No component consumes this API.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={EntityTable.componentEntityColumns}\n entities={entities as ComponentEntity[]}\n />\n );\n};\n","/*\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 {\n ComponentEntity,\n RELATION_API_PROVIDED_BY,\n} from '@backstage/catalog-model';\nimport { Typography } from '@material-ui/core';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n WarningPanel,\n} from '@backstage/core-components';\n\n/** @public */\nexport const ProvidingComponentsCard = (props: {\n variant?: InfoCardVariants;\n}) => {\n const { variant = 'gridItem' } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_API_PROVIDED_BY,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title=\"Providers\">\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title=\"Providers\">\n <WarningPanel\n severity=\"error\"\n title=\"Could not load components\"\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title=\"Providers\"\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n No component provides this API.\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional\">\n Learn how to change this.\n </Link>\n </Typography>\n </div>\n }\n columns={EntityTable.componentEntityColumns}\n entities={entities as ComponentEntity[]}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;AAuCa,MAAA,uBAAA,GAA0B,CAAC,KAElC,KAAA;AACJ,EAAM,MAAA,EAAE,OAAU,GAAA,UAAA,EAAe,GAAA,KAAA,CAAA;AACjC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAU,EAAA,CAAA;AAC7B,EAAA,MAAM,EAAE,QAAU,EAAA,OAAA,EAAS,KAAM,EAAA,GAAI,mBAAmB,MAAQ,EAAA;AAAA,IAC9D,IAAM,EAAA,wBAAA;AAAA,GACP,CAAA,CAAA;AAED,EAAA,IAAI,OAAS,EAAA;AACX,IAAA,2CACG,QAAS,EAAA,EAAA,OAAA,EAAkB,OAAM,WACh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F,SAAS,WAAY,CAAA,sBAAA;AAAA,MACrB,QAAA;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
@@ -1,16 +1,12 @@
1
- export { ConsumedApisCard, HasApisCard, ProvidedApisCard } from '../index.esm.js';
1
+ export { A as ApiExplorerIndexPage, D as DefaultApiExplorerPage } from './ApiExplorerPage-ce544a95.esm.js';
2
2
  import 'react';
3
3
  import 'react-router-dom';
4
4
  import '@backstage/core-components';
5
5
  import '@backstage/core-plugin-api';
6
6
  import '@backstage/plugin-catalog';
7
7
  import '@backstage/plugin-catalog-react';
8
+ import './ApiDefinitionWidget-798ee85f.esm.js';
9
+ import '@material-ui/core/styles';
8
10
  import '@backstage/plugin-permission-react';
9
11
  import '@backstage/plugin-catalog-common/alpha';
10
- import '@material-ui/lab';
11
- import '@material-ui/core/styles';
12
- import '@material-ui/core/Typography';
13
- import '@material-ui/core';
14
- import '@backstage/catalog-model';
15
- import '@material-ui/icons/Extension';
16
- //# sourceMappingURL=index-3c5f9414.esm.js.map
12
+ //# sourceMappingURL=index-435dfc01.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-435dfc01.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1,16 +1,14 @@
1
- export { ApiExplorerIndexPage, DefaultApiExplorerPage } from '../index.esm.js';
1
+ export { C as ConsumedApisCard, H as HasApisCard, P as ProvidedApisCard } from './ProvidedApisCard-e92fbd29.esm.js';
2
+ import '@backstage/catalog-model';
3
+ import '@material-ui/core';
4
+ import '@backstage/plugin-catalog-react';
2
5
  import 'react';
3
- import 'react-router-dom';
4
6
  import '@backstage/core-components';
5
- import '@backstage/core-plugin-api';
6
- import '@backstage/plugin-catalog';
7
- import '@backstage/plugin-catalog-react';
8
- import '@backstage/plugin-permission-react';
9
- import '@backstage/plugin-catalog-common/alpha';
7
+ import '@material-ui/icons/Extension';
10
8
  import '@material-ui/lab';
9
+ import './ApiDefinitionWidget-798ee85f.esm.js';
10
+ import '@backstage/core-plugin-api';
11
11
  import '@material-ui/core/styles';
12
+ import './ApiTypeTitle-cc79a2f3.esm.js';
12
13
  import '@material-ui/core/Typography';
13
- import '@material-ui/core';
14
- import '@backstage/catalog-model';
15
- import '@material-ui/icons/Extension';
16
- //# sourceMappingURL=index-3d17238a.esm.js.map
14
+ //# sourceMappingURL=index-5f0727eb.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-5f0727eb.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
@@ -0,0 +1,11 @@
1
+ export { A as ApiDefinitionCard } from './ApiDefinitionCard-504c2432.esm.js';
2
+ export { d as defaultDefinitionWidgets } from './ApiDefinitionWidget-798ee85f.esm.js';
3
+ export { A as ApiTypeTitle } from './ApiTypeTitle-cc79a2f3.esm.js';
4
+ import '@backstage/plugin-catalog-react';
5
+ import '@material-ui/lab';
6
+ import 'react';
7
+ import '@backstage/core-components';
8
+ import '@backstage/core-plugin-api';
9
+ import '@material-ui/core/styles';
10
+ import '@material-ui/core/Typography';
11
+ //# sourceMappingURL=index-6f21bd2e.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-6f21bd2e.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,7 @@
1
+ export { C as ConsumingComponentsCard, P as ProvidingComponentsCard } from './ProvidingComponentsCard-5b679445.esm.js';
2
+ import '@backstage/catalog-model';
3
+ import '@material-ui/core';
4
+ import '@backstage/plugin-catalog-react';
5
+ import 'react';
6
+ import '@backstage/core-components';
7
+ //# sourceMappingURL=index-c969ed3d.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-c969ed3d.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}