@backstage/plugin-api-docs 0.13.1-next.1 → 0.13.1
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 +16 -0
- package/dist/alpha.d.ts +14 -11
- package/dist/alpha.esm.js +3 -3
- package/dist/components/ApiDefinitionCard/ApiDefinitionCard.esm.js +7 -4
- package/dist/components/ApiDefinitionCard/ApiDefinitionCard.esm.js.map +1 -1
- package/dist/components/ApiDefinitionDialog/ApiDefinitionDialog.esm.js +10 -3
- package/dist/components/ApiDefinitionDialog/ApiDefinitionDialog.esm.js.map +1 -1
- package/dist/components/ApisCards/presets.esm.js +4 -3
- package/dist/components/ApisCards/presets.esm.js.map +1 -1
- package/dist/package.json.esm.js +1 -1
- package/dist/plugin.esm.js +4 -2
- package/dist/plugin.esm.js.map +1 -1
- package/dist/translation.esm.js +8 -1
- package/dist/translation.esm.js.map +1 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @backstage/plugin-api-docs
|
|
2
2
|
|
|
3
|
+
## 0.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7c281a5: Add i18n support for Raw tab title and an error message
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/frontend-plugin-api@0.13.0
|
|
10
|
+
- @backstage/core-compat-api@0.5.4
|
|
11
|
+
- @backstage/plugin-catalog@1.32.0
|
|
12
|
+
- @backstage/plugin-catalog-react@1.21.3
|
|
13
|
+
- @backstage/core-components@0.18.3
|
|
14
|
+
- @backstage/core-plugin-api@1.12.0
|
|
15
|
+
- @backstage/plugin-permission-react@0.4.38
|
|
16
|
+
- @backstage/catalog-model@1.7.6
|
|
17
|
+
- @backstage/plugin-catalog-common@1.1.7
|
|
18
|
+
|
|
3
19
|
## 0.13.1-next.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -8,8 +8,11 @@ import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api'
|
|
|
8
8
|
* @alpha
|
|
9
9
|
*/
|
|
10
10
|
declare const apiDocsTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"api-docs", {
|
|
11
|
+
readonly "apiDefinitionCard.error.title": "Could not fetch the API";
|
|
12
|
+
readonly "apiDefinitionCard.rawButtonTitle": "Raw";
|
|
11
13
|
readonly "apiDefinitionDialog.closeButtonTitle": "Close";
|
|
12
14
|
readonly "apiDefinitionDialog.tabsAriaLabel": "API definition options";
|
|
15
|
+
readonly "apiDefinitionDialog.rawButtonTitle": "Raw";
|
|
13
16
|
readonly "apiDefinitionDialog.toggleButtonAriaLabel": "Toggle API Definition Dialog";
|
|
14
17
|
readonly "defaultApiExplorerPage.title": "APIs";
|
|
15
18
|
readonly "defaultApiExplorerPage.subtitle": "{{orgName}} API Explorer";
|
|
@@ -41,7 +44,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
41
44
|
}, {
|
|
42
45
|
registerApi: _backstage_frontend_plugin_api.ExternalRouteRef<undefined>;
|
|
43
46
|
}, {
|
|
44
|
-
"api:api-docs/config": _backstage_frontend_plugin_api.
|
|
47
|
+
"api:api-docs/config": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
45
48
|
kind: "api";
|
|
46
49
|
name: "config";
|
|
47
50
|
config: {};
|
|
@@ -50,7 +53,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
50
53
|
inputs: {};
|
|
51
54
|
params: <TApi, TImpl extends TApi, TDeps extends { [name in string]: unknown; }>(params: _backstage_frontend_plugin_api.ApiFactory<TApi, TImpl, TDeps>) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<_backstage_frontend_plugin_api.AnyApiFactory>;
|
|
52
55
|
}>;
|
|
53
|
-
"entity-card:api-docs/consumed-apis": _backstage_frontend_plugin_api.
|
|
56
|
+
"entity-card:api-docs/consumed-apis": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
54
57
|
kind: "entity-card";
|
|
55
58
|
name: "consumed-apis";
|
|
56
59
|
config: {
|
|
@@ -75,7 +78,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
75
78
|
type?: _backstage_plugin_catalog_react_alpha.EntityCardType;
|
|
76
79
|
};
|
|
77
80
|
}>;
|
|
78
|
-
"entity-card:api-docs/consuming-components": _backstage_frontend_plugin_api.
|
|
81
|
+
"entity-card:api-docs/consuming-components": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
79
82
|
kind: "entity-card";
|
|
80
83
|
name: "consuming-components";
|
|
81
84
|
config: {
|
|
@@ -100,7 +103,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
100
103
|
type?: _backstage_plugin_catalog_react_alpha.EntityCardType;
|
|
101
104
|
};
|
|
102
105
|
}>;
|
|
103
|
-
"entity-card:api-docs/definition": _backstage_frontend_plugin_api.
|
|
106
|
+
"entity-card:api-docs/definition": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
104
107
|
kind: "entity-card";
|
|
105
108
|
name: "definition";
|
|
106
109
|
config: {
|
|
@@ -125,7 +128,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
125
128
|
type?: _backstage_plugin_catalog_react_alpha.EntityCardType;
|
|
126
129
|
};
|
|
127
130
|
}>;
|
|
128
|
-
"entity-card:api-docs/has-apis": _backstage_frontend_plugin_api.
|
|
131
|
+
"entity-card:api-docs/has-apis": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
129
132
|
kind: "entity-card";
|
|
130
133
|
name: "has-apis";
|
|
131
134
|
config: {
|
|
@@ -150,7 +153,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
150
153
|
type?: _backstage_plugin_catalog_react_alpha.EntityCardType;
|
|
151
154
|
};
|
|
152
155
|
}>;
|
|
153
|
-
"entity-card:api-docs/provided-apis": _backstage_frontend_plugin_api.
|
|
156
|
+
"entity-card:api-docs/provided-apis": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
154
157
|
kind: "entity-card";
|
|
155
158
|
name: "provided-apis";
|
|
156
159
|
config: {
|
|
@@ -175,7 +178,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
175
178
|
type?: _backstage_plugin_catalog_react_alpha.EntityCardType;
|
|
176
179
|
};
|
|
177
180
|
}>;
|
|
178
|
-
"entity-card:api-docs/providing-components": _backstage_frontend_plugin_api.
|
|
181
|
+
"entity-card:api-docs/providing-components": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
179
182
|
kind: "entity-card";
|
|
180
183
|
name: "providing-components";
|
|
181
184
|
config: {
|
|
@@ -200,7 +203,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
200
203
|
type?: _backstage_plugin_catalog_react_alpha.EntityCardType;
|
|
201
204
|
};
|
|
202
205
|
}>;
|
|
203
|
-
"entity-content:api-docs/apis": _backstage_frontend_plugin_api.
|
|
206
|
+
"entity-content:api-docs/apis": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
204
207
|
kind: "entity-content";
|
|
205
208
|
name: "apis";
|
|
206
209
|
config: {
|
|
@@ -237,7 +240,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
237
240
|
filter?: string | _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean);
|
|
238
241
|
};
|
|
239
242
|
}>;
|
|
240
|
-
"entity-content:api-docs/definition": _backstage_frontend_plugin_api.
|
|
243
|
+
"entity-content:api-docs/definition": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
241
244
|
kind: "entity-content";
|
|
242
245
|
name: "definition";
|
|
243
246
|
config: {
|
|
@@ -274,7 +277,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
274
277
|
filter?: string | _backstage_plugin_catalog_react_alpha.EntityPredicate | ((entity: _backstage_catalog_model.Entity) => boolean);
|
|
275
278
|
};
|
|
276
279
|
}>;
|
|
277
|
-
"nav-item:api-docs": _backstage_frontend_plugin_api.
|
|
280
|
+
"nav-item:api-docs": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
278
281
|
kind: "nav-item";
|
|
279
282
|
name: undefined;
|
|
280
283
|
config: {};
|
|
@@ -291,7 +294,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
|
|
|
291
294
|
routeRef: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
292
295
|
};
|
|
293
296
|
}>;
|
|
294
|
-
"page:api-docs": _backstage_frontend_plugin_api.
|
|
297
|
+
"page:api-docs": _backstage_frontend_plugin_api.OverridableExtensionDefinition<{
|
|
295
298
|
config: {
|
|
296
299
|
initiallySelectedFilter: "all" | "owned" | "starred" | undefined;
|
|
297
300
|
} & {
|
package/dist/alpha.esm.js
CHANGED
|
@@ -4,15 +4,15 @@ import { NavItemBlueprint, ApiBlueprint, PageBlueprint, createFrontendPlugin } f
|
|
|
4
4
|
import { compatWrapper, convertLegacyRouteRef } from '@backstage/core-compat-api';
|
|
5
5
|
import { RELATION_HAS_PART, parseEntityRef } from '@backstage/catalog-model';
|
|
6
6
|
import '@backstage/plugin-catalog-react';
|
|
7
|
-
import '@material-ui/lab/Alert';
|
|
8
|
-
import { apiDocsConfigRef } from './config.esm.js';
|
|
9
7
|
import { AppIcon } from '@backstage/core-components';
|
|
10
8
|
import '@backstage/core-plugin-api';
|
|
9
|
+
import '@material-ui/lab/Alert';
|
|
10
|
+
import { apiDocsConfigRef } from './config.esm.js';
|
|
11
|
+
export { apiDocsTranslationRef } from './translation.esm.js';
|
|
11
12
|
import { defaultDefinitionWidgets } from './components/ApiDefinitionCard/ApiDefinitionWidget.esm.js';
|
|
12
13
|
import '@material-ui/core/Typography';
|
|
13
14
|
import { rootRoute, registerComponentRouteRef } from './routes.esm.js';
|
|
14
15
|
import { EntityCardBlueprint, EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
15
|
-
export { apiDocsTranslationRef } from './translation.esm.js';
|
|
16
16
|
|
|
17
17
|
const apiDocsNavItem = NavItemBlueprint.make({
|
|
18
18
|
params: {
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
3
|
+
import { TabbedCard, CardTab } from '@backstage/core-components';
|
|
4
|
+
import { useApi } from '@backstage/core-plugin-api';
|
|
5
|
+
import { useTranslationRef } from '@backstage/frontend-plugin-api';
|
|
3
6
|
import Alert from '@material-ui/lab/Alert';
|
|
4
7
|
import { apiDocsConfigRef } from '../../config.esm.js';
|
|
8
|
+
import { apiDocsTranslationRef } from '../../translation.esm.js';
|
|
5
9
|
import { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget/PlainApiDefinitionWidget.esm.js';
|
|
6
|
-
import { TabbedCard, CardTab } from '@backstage/core-components';
|
|
7
|
-
import { useApi } from '@backstage/core-plugin-api';
|
|
8
10
|
|
|
9
11
|
const ApiDefinitionCard = () => {
|
|
10
12
|
const { entity } = useEntity();
|
|
11
13
|
const config = useApi(apiDocsConfigRef);
|
|
12
14
|
const { getApiDefinitionWidget } = config;
|
|
15
|
+
const { t } = useTranslationRef(apiDocsTranslationRef);
|
|
13
16
|
if (!entity) {
|
|
14
|
-
return /* @__PURE__ */ jsx(Alert, { severity: "error", children: "
|
|
17
|
+
return /* @__PURE__ */ jsx(Alert, { severity: "error", children: t("apiDefinitionCard.error.title") });
|
|
15
18
|
}
|
|
16
19
|
const definitionWidget = getApiDefinitionWidget(entity);
|
|
17
20
|
const entityTitle = entity.metadata.title ?? entity.metadata.name;
|
|
18
21
|
if (definitionWidget) {
|
|
19
22
|
return /* @__PURE__ */ jsxs(TabbedCard, { title: entityTitle, children: [
|
|
20
23
|
/* @__PURE__ */ jsx(CardTab, { label: definitionWidget.title, children: definitionWidget.component(entity.spec.definition) }, "widget"),
|
|
21
|
-
/* @__PURE__ */ jsx(CardTab, { label: "
|
|
24
|
+
/* @__PURE__ */ jsx(CardTab, { label: t("apiDefinitionCard.rawButtonTitle"), children: /* @__PURE__ */ jsx(
|
|
22
25
|
PlainApiDefinitionWidget,
|
|
23
26
|
{
|
|
24
27
|
definition: entity.spec.definition,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiDefinitionCard.esm.js","sources":["../../../src/components/ApiDefinitionCard/ApiDefinitionCard.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 { ApiEntity } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport
|
|
1
|
+
{"version":3,"file":"ApiDefinitionCard.esm.js","sources":["../../../src/components/ApiDefinitionCard/ApiDefinitionCard.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 { ApiEntity } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { CardTab, TabbedCard } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport Alert from '@material-ui/lab/Alert';\nimport { apiDocsConfigRef } from '../../config';\nimport { apiDocsTranslationRef } from '../../translation';\nimport { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';\n\n/** @public */\nexport const ApiDefinitionCard = () => {\n const { entity } = useEntity<ApiEntity>();\n const config = useApi(apiDocsConfigRef);\n const { getApiDefinitionWidget } = config;\n const { t } = useTranslationRef(apiDocsTranslationRef);\n\n if (!entity) {\n return <Alert severity=\"error\">{t('apiDefinitionCard.error.title')}</Alert>;\n }\n\n const definitionWidget = getApiDefinitionWidget(entity);\n const entityTitle = entity.metadata.title ?? entity.metadata.name;\n\n if (definitionWidget) {\n return (\n <TabbedCard title={entityTitle}>\n <CardTab label={definitionWidget.title} key=\"widget\">\n {definitionWidget.component(entity.spec.definition)}\n </CardTab>\n <CardTab label={t('apiDefinitionCard.rawButtonTitle')} key=\"raw\">\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={definitionWidget.rawLanguage || entity.spec.type}\n />\n </CardTab>\n </TabbedCard>\n );\n }\n\n return (\n <TabbedCard\n title={entityTitle}\n children={[\n // Has to be an array, otherwise typescript doesn't like that this has only a single child\n <CardTab label={entity.spec.type} key=\"raw\">\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={entity.spec.type}\n />\n </CardTab>,\n ]}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA2BO,MAAM,oBAAoB,MAAM;AACrC,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAqB;AACxC,EAAA,MAAM,MAAA,GAAS,OAAO,gBAAgB,CAAA;AACtC,EAAA,MAAM,EAAE,wBAAuB,GAAI,MAAA;AACnC,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAA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AAA,EAAU,OAAO,IAAA,CAAK;AAAA;AAAA,aAHY,KAKtC;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -94,8 +94,9 @@ function ApiDefinitionDialog(props) {
|
|
|
94
94
|
children: [
|
|
95
95
|
/* @__PURE__ */ jsxs(DialogTitle, { id: "api-definition-dialog-title", disableTypography: true, children: [
|
|
96
96
|
/* @__PURE__ */ jsxs(Typography, { className: classes.type, children: [
|
|
97
|
-
"API -
|
|
98
|
-
|
|
97
|
+
"API -",
|
|
98
|
+
" ",
|
|
99
|
+
definitionWidget?.title ?? t("apiDefinitionDialog.rawButtonTitle")
|
|
99
100
|
] }),
|
|
100
101
|
/* @__PURE__ */ jsx(Typography, { className: classes.title, variant: "h1", children: entity.metadata.title ?? entity.metadata.name })
|
|
101
102
|
] }),
|
|
@@ -111,7 +112,13 @@ function ApiDefinitionDialog(props) {
|
|
|
111
112
|
className: classes.tabs,
|
|
112
113
|
children: [
|
|
113
114
|
definitionWidget ? /* @__PURE__ */ jsx(Tab, { label: definitionWidget.title, ...a11yProps(tabIndex++) }) : null,
|
|
114
|
-
/* @__PURE__ */ jsx(
|
|
115
|
+
/* @__PURE__ */ jsx(
|
|
116
|
+
Tab,
|
|
117
|
+
{
|
|
118
|
+
label: t("apiDefinitionDialog.rawButtonTitle"),
|
|
119
|
+
...a11yProps(tabIndex++)
|
|
120
|
+
}
|
|
121
|
+
)
|
|
115
122
|
]
|
|
116
123
|
}
|
|
117
124
|
),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiDefinitionDialog.esm.js","sources":["../../../src/components/ApiDefinitionDialog/ApiDefinitionDialog.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 Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Tab from '@material-ui/core/Tab';\nimport Tabs from '@material-ui/core/Tabs';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ReactNode, useState, useEffect } from 'react';\nimport { apiDocsConfigRef } from '../../config';\nimport { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\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?: 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] = useState(0);\n const classes = useStyles();\n const { t } = useTranslationRef(apiDocsTranslationRef);\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 ?? '
|
|
1
|
+
{"version":3,"file":"ApiDefinitionDialog.esm.js","sources":["../../../src/components/ApiDefinitionDialog/ApiDefinitionDialog.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 Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Tab from '@material-ui/core/Tab';\nimport Tabs from '@material-ui/core/Tabs';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ReactNode, useState, useEffect } from 'react';\nimport { apiDocsConfigRef } from '../../config';\nimport { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\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?: 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] = useState(0);\n const classes = useStyles();\n const { t } = useTranslationRef(apiDocsTranslationRef);\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 -{' '}\n {definitionWidget?.title ?? t('apiDefinitionDialog.rawButtonTitle')}\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={t('apiDefinitionDialog.tabsAriaLabel')}\n className={classes.tabs}\n >\n {definitionWidget ? (\n <Tab label={definitionWidget.title} {...a11yProps(tabIndex++)} />\n ) : null}\n <Tab\n label={t('apiDefinitionDialog.rawButtonTitle')}\n {...a11yProps(tabIndex++)}\n />\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 {t('apiDefinitionDialog.closeButtonTitle')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAkCA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,gBAAA,EAAkB;AAAA,IAChB,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,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AA;AAC1B;AAAA;AAAA,WACF;AAAA,UAEC,gBAAA,mBACC,GAAA,CAAC,QAAA,EAAA,EAAS,KAAA,EAAO,SAAA,EAAW,KAAA,EAAO,aAAA,EAAA,EAChC,QAAA,EAAA,gBAAA,CAAiB,SAAA,CAAU,MAAA,CAAO,IAAA,CAAK,UAAU,GACpD,CAAA,GACE,IAAA;AAAA,0BACJ,GAAA,CAAC,QAAA,EAAA,EAAS,KAAA,EAAO,SAAA,EAAW,OAAO,aAAA,EAAA,EACjC,QAAA,kBAAA,GAAA;AAAA,YAAC,wBAAA;AAAA,YAAA;AAAA,cACC,UAAA,EAAY,OAAO,IAAA,CAAK,UAAA;AAAA,cACxB,QAAA,EAAU,gBAAA,EAAkB,WAAA,IAAe,MAAA,CAAO,IAAA,CAAK;AAAA;AAAA,WACzD,EACF;AAAA,SAAA,EACF,CAAA;AAAA,wBACA,GAAA,CAAC,aAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,MAAA,EAAA,EAAO,OAAA,EAAS,OAAA,EAAS,KAAA,EAAM,SAAA,EAC7B,QAAA,EAAA,CAAA,CAAE,sCAAsC,CAAA,EAC3C,CAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -3,10 +3,12 @@ import { EntityTable } from '@backstage/plugin-catalog-react';
|
|
|
3
3
|
import ExtensionIcon from '@material-ui/icons/Extension';
|
|
4
4
|
import ToggleButton from '@material-ui/lab/ToggleButton';
|
|
5
5
|
import { useState } from 'react';
|
|
6
|
-
import '@material-ui/lab/Alert';
|
|
7
|
-
import '../../config.esm.js';
|
|
8
6
|
import '@backstage/core-components';
|
|
9
7
|
import '@backstage/core-plugin-api';
|
|
8
|
+
import '@backstage/frontend-plugin-api';
|
|
9
|
+
import '@material-ui/lab/Alert';
|
|
10
|
+
import '../../config.esm.js';
|
|
11
|
+
import { apiDocsTranslationRef } from '../../translation.esm.js';
|
|
10
12
|
import '../AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.esm.js';
|
|
11
13
|
import '../GraphQlDefinitionWidget/GraphQlDefinitionWidget.esm.js';
|
|
12
14
|
import '../OpenApiDefinitionWidget/OpenApiDefinitionWidget.esm.js';
|
|
@@ -14,7 +16,6 @@ import '@material-ui/core/styles';
|
|
|
14
16
|
import { ApiTypeTitle } from '../ApiDefinitionCard/ApiTypeTitle.esm.js';
|
|
15
17
|
import { ApiDefinitionDialog } from '../ApiDefinitionDialog/ApiDefinitionDialog.esm.js';
|
|
16
18
|
import { useTranslationRef } from '@backstage/core-plugin-api/alpha';
|
|
17
|
-
import { apiDocsTranslationRef } from '../../translation.esm.js';
|
|
18
19
|
|
|
19
20
|
function createSpecApiTypeColumn(t) {
|
|
20
21
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"presets.esm.js","sources":["../../../src/components/ApisCards/presets.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 { 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/ToggleButton';\nimport { useState } from 'react';\nimport { ApiTypeTitle } from '../ApiDefinitionCard';\nimport { ApiDefinitionDialog } from '../ApiDefinitionDialog';\nimport {\n TranslationFunction,\n useTranslationRef,\n} from '@backstage/core-plugin-api/alpha';\nimport { apiDocsTranslationRef } from '../../translation';\n\nexport function createSpecApiTypeColumn(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): TableColumn<ApiEntity> {\n return {\n title: t('apiEntityColumns.typeTitle'),\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 const { t } = useTranslationRef(apiDocsTranslationRef);\n return (\n <>\n <ToggleButton\n aria-label={t('apiDefinitionDialog.toggleButtonAriaLabel')}\n onClick={() => setDialogOpen(!dialogOpen)}\n value={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(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): TableColumn<ApiEntity> {\n return {\n title: t('apiEntityColumns.apiDefinitionTitle'),\n render: entity => <ApiDefinitionButton apiEntity={entity} />,\n };\n}\n\nexport const getApiEntityColumns = (\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): TableColumn<ApiEntity>[] => {\n return [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createSystemColumn(),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(t),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n createApiDefinitionColumn(t),\n ];\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"presets.esm.js","sources":["../../../src/components/ApisCards/presets.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 { 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/ToggleButton';\nimport { useState } from 'react';\nimport { ApiTypeTitle } from '../ApiDefinitionCard';\nimport { ApiDefinitionDialog } from '../ApiDefinitionDialog';\nimport {\n TranslationFunction,\n useTranslationRef,\n} from '@backstage/core-plugin-api/alpha';\nimport { apiDocsTranslationRef } from '../../translation';\n\nexport function createSpecApiTypeColumn(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): TableColumn<ApiEntity> {\n return {\n title: t('apiEntityColumns.typeTitle'),\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 const { t } = useTranslationRef(apiDocsTranslationRef);\n return (\n <>\n <ToggleButton\n aria-label={t('apiDefinitionDialog.toggleButtonAriaLabel')}\n onClick={() => setDialogOpen(!dialogOpen)}\n value={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(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): TableColumn<ApiEntity> {\n return {\n title: t('apiEntityColumns.apiDefinitionTitle'),\n render: entity => <ApiDefinitionButton apiEntity={entity} />,\n };\n}\n\nexport const getApiEntityColumns = (\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): TableColumn<ApiEntity>[] => {\n return [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createSystemColumn(),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(t),\n EntityTable.columns.createSpecLif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AAA,GAC5D;AACF;AAEO,MAAM,mBAAA,GAAsB,CACjC,CAAA,KAC6B;AAC7B,EAAA,OAAO;AAAA,IACL,YAAY,OAAA,CAAQ,qBAAA,CAAsB,EAAE,WAAA,EAAa,OAAO,CAAA;AAAA,IAChE,WAAA,CAAY,QAAQ,kBAAA,EAAmB;AAAA,IACvC,WAAA,CAAY,QAAQ,iBAAA,EAAkB;AAAA,IACtC,wBAAwB,CAAC,CAAA;AAAA,IACzB,WAAA,CAAY,QAAQ,yBAAA,EAA0B;AAAA,IAC9C,WAAA,CAAY,QAAQ,+BAAA,EAAgC;AAAA,IACpD,0BAA0B,CAAC;AAAA,GAC7B;AACF;;;;"}
|
package/dist/package.json.esm.js
CHANGED
package/dist/plugin.esm.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import 'react/jsx-runtime';
|
|
2
2
|
import '@backstage/plugin-catalog-react';
|
|
3
|
-
import '@material-ui/lab/Alert';
|
|
4
|
-
import { apiDocsConfigRef } from './config.esm.js';
|
|
5
3
|
import '@backstage/core-components';
|
|
6
4
|
import { createPlugin, createApiFactory, createRoutableExtension, createComponentExtension } from '@backstage/core-plugin-api';
|
|
5
|
+
import '@backstage/frontend-plugin-api';
|
|
6
|
+
import '@material-ui/lab/Alert';
|
|
7
|
+
import { apiDocsConfigRef } from './config.esm.js';
|
|
8
|
+
import './translation.esm.js';
|
|
7
9
|
import { defaultDefinitionWidgets } from './components/ApiDefinitionCard/ApiDefinitionWidget.esm.js';
|
|
8
10
|
import '@material-ui/core/Typography';
|
|
9
11
|
import { registerComponentRouteRef, rootRoute } from './routes.esm.js';
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"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 { ApiEntity } from '@backstage/catalog-model';\nimport { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { apiDocsConfigRef } from './config';\nimport { registerComponentRouteRef, rootRoute } from './routes';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const apiDocsPlugin = createPlugin({\n id: 'api-docs',\n routes: {\n root: rootRoute,\n },\n apis: [\n createApiFactory({\n api: apiDocsConfigRef,\n deps: {},\n factory: () => {\n const definitionWidgets = defaultDefinitionWidgets();\n return {\n getApiDefinitionWidget: (apiEntity: ApiEntity) => {\n return definitionWidgets.find(d => d.type === apiEntity.spec.type);\n },\n };\n },\n }),\n ],\n externalRoutes: {\n registerApi: registerComponentRouteRef,\n },\n});\n\n/** @public */\nexport const ApiExplorerPage = apiDocsPlugin.provide(\n createRoutableExtension({\n name: 'ApiExplorerPage',\n component: () =>\n import('./components/ApiExplorerPage').then(m => m.ApiExplorerIndexPage),\n mountPoint: rootRoute,\n }),\n);\n\n/** @public */\nexport const EntityApiDefinitionCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityApiDefinitionCard',\n component: {\n lazy: () =>\n import('./components/ApiDefinitionCard').then(m => m.ApiDefinitionCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityConsumedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ConsumedApisCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityConsumingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ConsumingComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityProvidedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ProvidedApisCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityProvidingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ProvidingComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityHasApisCard',\n component: {\n lazy: () => import('./components/ApisCards').then(m => m.HasApisCard),\n },\n }),\n);\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"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 { ApiEntity } from '@backstage/catalog-model';\nimport { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { apiDocsConfigRef } from './config';\nimport { registerComponentRouteRef, rootRoute } from './routes';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const apiDocsPlugin = createPlugin({\n id: 'api-docs',\n routes: {\n root: rootRoute,\n },\n apis: [\n createApiFactory({\n api: apiDocsConfigRef,\n deps: {},\n factory: () => {\n const definitionWidgets = defaultDefinitionWidgets();\n return {\n getApiDefinitionWidget: (apiEntity: ApiEntity) => {\n return definitionWidgets.find(d => d.type === apiEntity.spec.type);\n },\n };\n },\n }),\n ],\n externalRoutes: {\n registerApi: registerComponentRouteRef,\n },\n});\n\n/** @public */\nexport const ApiExplorerPage = apiDocsPlugin.provide(\n createRoutableExtension({\n name: 'ApiExplorerPage',\n component: () =>\n import('./components/ApiExplorerPage').then(m => m.ApiExplorerIndexPage),\n mountPoint: rootRoute,\n }),\n);\n\n/** @public */\nexport const EntityApiDefinitionCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityApiDefinitionCard',\n component: {\n lazy: () =>\n import('./components/ApiDefinitionCard').then(m => m.ApiDefinitionCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityConsumedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ConsumedApisCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityConsumingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ConsumingComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityProvidedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ProvidedApisCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityProvidingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ProvidingComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityHasApisCard',\n component: {\n lazy: () => import('./components/ApisCards').then(m => m.HasApisCard),\n },\n }),\n);\n"],"names":[],"mappings":";;;;;;;;;;;;AA4BO,MAAM,gBAAgB,YAAA,CAAa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A;AACjE,GACD;AACH;AAGO,MAAM,gCAAgC,aAAA,CAAc,OAAA;AAAA,EACzD,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,+BAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,2CAA8B,CAAA,CAAE,IAAA;AAAA,QACrC,OAAK,CAAA,CAAE;AAAA;AACT;AACJ,GACD;AACH;AAGO,MAAM,yBAAyB,aAAA,CAAc,OAAA;AAAA,EAClD,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,wBAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,qCAAwB,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,gBAAgB;AAAA;AACjE,GACD;AACH;AAGO,MAAM,gCAAgC,aAAA,CAAc,OAAA;AAAA,EACzD,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,+BAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,2CAA8B,CAAA,CAAE,IAAA;AAAA,QACrC,OAAK,CAAA,CAAE;AAAA;AACT;AACJ,GACD;AACH;AAGO,MAAM,oBAAoB,aAAA,CAAc,OAAA;AAAA,EAC7C,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,mBAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,qCAAwB,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,WAAW;AAAA;AACtE,GACD;AACH;;;;"}
|
package/dist/translation.esm.js
CHANGED
|
@@ -3,10 +3,17 @@ import { createTranslationRef } from '@backstage/frontend-plugin-api';
|
|
|
3
3
|
const apiDocsTranslationRef = createTranslationRef({
|
|
4
4
|
id: "api-docs",
|
|
5
5
|
messages: {
|
|
6
|
+
apiDefinitionCard: {
|
|
7
|
+
error: {
|
|
8
|
+
title: "Could not fetch the API"
|
|
9
|
+
},
|
|
10
|
+
rawButtonTitle: "Raw"
|
|
11
|
+
},
|
|
6
12
|
apiDefinitionDialog: {
|
|
7
13
|
closeButtonTitle: "Close",
|
|
8
14
|
tabsAriaLabel: "API definition options",
|
|
9
|
-
toggleButtonAriaLabel: "Toggle API Definition Dialog"
|
|
15
|
+
toggleButtonAriaLabel: "Toggle API Definition Dialog",
|
|
16
|
+
rawButtonTitle: "Raw"
|
|
10
17
|
},
|
|
11
18
|
defaultApiExplorerPage: {
|
|
12
19
|
title: "APIs",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/**\n * @alpha\n */\nexport const apiDocsTranslationRef = createTranslationRef({\n id: 'api-docs',\n messages: {\n apiDefinitionDialog: {\n closeButtonTitle: 'Close',\n tabsAriaLabel: 'API definition options',\n toggleButtonAriaLabel: 'Toggle API Definition Dialog',\n },\n defaultApiExplorerPage: {\n title: 'APIs',\n subtitle: '{{orgName}} API Explorer',\n pageTitleOverride: 'APIs',\n createButtonTitle: 'Register Existing API',\n supportButtonTitle: 'All your APIs',\n },\n consumedApisCard: {\n title: 'Consumed APIs',\n error: {\n title: 'Could not load APIs',\n },\n emptyContent: {\n title: 'This {{entity}} does not consume any APIs.',\n },\n },\n hasApisCard: {\n title: 'APIs',\n error: {\n title: 'Could not load APIs',\n },\n emptyContent: {\n title: 'This {{entity}} does not contain any APIs.',\n },\n },\n providedApisCard: {\n title: 'Provided APIs',\n error: {\n title: 'Could not load APIs',\n },\n emptyContent: {\n title: 'This {{entity}} does not provide any APIs.',\n },\n },\n apiEntityColumns: {\n typeTitle: 'Type',\n apiDefinitionTitle: 'API Definition',\n },\n consumingComponentsCard: {\n title: 'Consumers',\n error: {\n title: 'Could not load components',\n },\n emptyContent: {\n title: 'No component consumes this API.',\n },\n },\n providingComponentsCard: {\n title: 'Providers',\n error: {\n title: 'Could not load components',\n },\n emptyContent: {\n title: 'No component provides this API.',\n },\n },\n apisCardHelpLinkTitle: 'Learn how to change this',\n },\n});\n"],"names":[],"mappings":";;AAqBO,MAAM,wBAAwB,oBAAA,CAAqB;AAAA,EACxD,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,mBAAA,EAAqB;AAAA,MACnB,gBAAA,EAAkB,OAAA;AAAA,MAClB,aAAA,EAAe,wBAAA;AAAA,MACf,qBAAA,EAAuB;AAAA,
|
|
1
|
+
{"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 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 { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/**\n * @alpha\n */\nexport const apiDocsTranslationRef = createTranslationRef({\n id: 'api-docs',\n messages: {\n apiDefinitionCard: {\n error: {\n title: 'Could not fetch the API',\n },\n rawButtonTitle: 'Raw',\n },\n apiDefinitionDialog: {\n closeButtonTitle: 'Close',\n tabsAriaLabel: 'API definition options',\n toggleButtonAriaLabel: 'Toggle API Definition Dialog',\n rawButtonTitle: 'Raw',\n },\n defaultApiExplorerPage: {\n title: 'APIs',\n subtitle: '{{orgName}} API Explorer',\n pageTitleOverride: 'APIs',\n createButtonTitle: 'Register Existing API',\n supportButtonTitle: 'All your APIs',\n },\n consumedApisCard: {\n title: 'Consumed APIs',\n error: {\n title: 'Could not load APIs',\n },\n emptyContent: {\n title: 'This {{entity}} does not consume any APIs.',\n },\n },\n hasApisCard: {\n title: 'APIs',\n error: {\n title: 'Could not load APIs',\n },\n emptyContent: {\n title: 'This {{entity}} does not contain any APIs.',\n },\n },\n providedApisCard: {\n title: 'Provided APIs',\n error: {\n title: 'Could not load APIs',\n },\n emptyContent: {\n title: 'This {{entity}} does not provide any APIs.',\n },\n },\n apiEntityColumns: {\n typeTitle: 'Type',\n apiDefinitionTitle: 'API Definition',\n },\n consumingComponentsCard: {\n title: 'Consumers',\n error: {\n title: 'Could not load components',\n },\n emptyContent: {\n title: 'No component consumes this API.',\n },\n },\n providingComponentsCard: {\n title: 'Providers',\n error: {\n title: 'Could not load components',\n },\n emptyContent: {\n title: 'No component provides this API.',\n },\n },\n apisCardHelpLinkTitle: 'Learn how to change this',\n },\n});\n"],"names":[],"mappings":";;AAqBO,MAAM,wBAAwB,oBAAA,CAAqB;AAAA,EACxD,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,cAAA,EAAgB;AAAA,KAClB;AAAA,IACA,mBAAA,EAAqB;AAAA,MACnB,gBAAA,EAAkB,OAAA;AAAA,MAClB,aAAA,EAAe,wBAAA;AAAA,MACf,qBAAA,EAAuB,8BAAA;AAAA,MACvB,cAAA,EAAgB;AAAA,KAClB;AAAA,IACA,sBAAA,EAAwB;AAAA,MACtB,KAAA,EAAO,MAAA;AAAA,MACP,QAAA,EAAU,0BAAA;AAAA,MACV,iBAAA,EAAmB,MAAA;AAAA,MACnB,iBAAA,EAAmB,uBAAA;AAAA,MACnB,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,eAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,WAAA,EAAa;AAAA,MACX,KAAA,EAAO,MAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,eAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,SAAA,EAAW,MAAA;AAAA,MACX,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,uBAAA,EAAyB;AAAA,MACvB,KAAA,EAAO,WAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,uBAAA,EAAyB;AAAA,MACvB,KAAA,EAAO,WAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,qBAAA,EAAuB;AAAA;AAE3B,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-api-docs",
|
|
3
|
-
"version": "0.13.1
|
|
3
|
+
"version": "0.13.1",
|
|
4
4
|
"description": "A Backstage plugin that helps represent API entities in the frontend",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -66,15 +66,15 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@asyncapi/react-component": "^2.3.3",
|
|
69
|
-
"@backstage/catalog-model": "1.7.6
|
|
70
|
-
"@backstage/core-compat-api": "0.5.4
|
|
71
|
-
"@backstage/core-components": "0.18.3
|
|
72
|
-
"@backstage/core-plugin-api": "1.
|
|
73
|
-
"@backstage/frontend-plugin-api": "0.
|
|
74
|
-
"@backstage/plugin-catalog": "1.32.0
|
|
75
|
-
"@backstage/plugin-catalog-common": "1.1.7
|
|
76
|
-
"@backstage/plugin-catalog-react": "1.21.3
|
|
77
|
-
"@backstage/plugin-permission-react": "0.4.38
|
|
69
|
+
"@backstage/catalog-model": "^1.7.6",
|
|
70
|
+
"@backstage/core-compat-api": "^0.5.4",
|
|
71
|
+
"@backstage/core-components": "^0.18.3",
|
|
72
|
+
"@backstage/core-plugin-api": "^1.12.0",
|
|
73
|
+
"@backstage/frontend-plugin-api": "^0.13.0",
|
|
74
|
+
"@backstage/plugin-catalog": "^1.32.0",
|
|
75
|
+
"@backstage/plugin-catalog-common": "^1.1.7",
|
|
76
|
+
"@backstage/plugin-catalog-react": "^1.21.3",
|
|
77
|
+
"@backstage/plugin-permission-react": "^0.4.38",
|
|
78
78
|
"@graphiql/react": "^0.23.0",
|
|
79
79
|
"@material-ui/core": "^4.12.2",
|
|
80
80
|
"@material-ui/icons": "^4.9.1",
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
"swagger-ui-react": "^5.27.1"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@backstage/cli": "0.34.5
|
|
90
|
-
"@backstage/core-app-api": "1.19.2
|
|
91
|
-
"@backstage/dev-utils": "1.1.17
|
|
92
|
-
"@backstage/test-utils": "1.7.13
|
|
89
|
+
"@backstage/cli": "^0.34.5",
|
|
90
|
+
"@backstage/core-app-api": "^1.19.2",
|
|
91
|
+
"@backstage/dev-utils": "^1.1.17",
|
|
92
|
+
"@backstage/test-utils": "^1.7.13",
|
|
93
93
|
"@testing-library/dom": "^10.0.0",
|
|
94
94
|
"@testing-library/jest-dom": "^6.0.0",
|
|
95
95
|
"@testing-library/react": "^16.0.0",
|