@backstage/plugin-api-docs 0.12.6-next.1 → 0.12.6
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 +39 -0
- package/dist/alpha.d.ts +43 -11
- package/dist/alpha.esm.js +15 -11
- package/dist/alpha.esm.js.map +1 -1
- package/dist/components/ApiDefinitionCard/ApiDefinitionCard.esm.js +15 -12
- package/dist/components/ApiDefinitionCard/ApiDefinitionCard.esm.js.map +1 -1
- package/dist/components/ApiDefinitionCard/ApiDefinitionWidget.esm.js +6 -6
- package/dist/components/ApiDefinitionCard/ApiDefinitionWidget.esm.js.map +1 -1
- package/dist/components/ApiDefinitionCard/ApiTypeTitle.esm.js +2 -2
- package/dist/components/ApiDefinitionCard/ApiTypeTitle.esm.js.map +1 -1
- package/dist/components/ApiDefinitionDialog/ApiDefinitionDialog.esm.js +48 -30
- package/dist/components/ApiDefinitionDialog/ApiDefinitionDialog.esm.js.map +1 -1
- package/dist/components/ApiExplorerPage/ApiExplorerPage.esm.js +2 -2
- package/dist/components/ApiExplorerPage/ApiExplorerPage.esm.js.map +1 -1
- package/dist/components/ApiExplorerPage/DefaultApiExplorerPage.esm.js +40 -19
- package/dist/components/ApiExplorerPage/DefaultApiExplorerPage.esm.js.map +1 -1
- package/dist/components/ApisCards/ConsumedApisCard.esm.js +26 -18
- package/dist/components/ApisCards/ConsumedApisCard.esm.js.map +1 -1
- package/dist/components/ApisCards/HasApisCard.esm.js +27 -16
- package/dist/components/ApisCards/HasApisCard.esm.js.map +1 -1
- package/dist/components/ApisCards/ProvidedApisCard.esm.js +26 -18
- package/dist/components/ApisCards/ProvidedApisCard.esm.js.map +1 -1
- package/dist/components/ApisCards/presets.esm.js +42 -33
- package/dist/components/ApisCards/presets.esm.js.map +1 -1
- package/dist/components/AsyncApiDefinitionWidget/AsyncApiDefinition.esm.js +2 -2
- package/dist/components/AsyncApiDefinitionWidget/AsyncApiDefinition.esm.js.map +1 -1
- package/dist/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.esm.js +4 -3
- package/dist/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.esm.js.map +1 -1
- package/dist/components/ComponentsCards/ConsumingComponentsCard.esm.js +15 -9
- package/dist/components/ComponentsCards/ConsumingComponentsCard.esm.js.map +1 -1
- package/dist/components/ComponentsCards/ProvidingComponentsCard.esm.js +15 -9
- package/dist/components/ComponentsCards/ProvidingComponentsCard.esm.js.map +1 -1
- package/dist/components/GraphQlDefinitionWidget/GraphQlDefinition.esm.js +6 -6
- package/dist/components/GraphQlDefinitionWidget/GraphQlDefinition.esm.js.map +1 -1
- package/dist/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.esm.js +4 -3
- package/dist/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.esm.js.map +1 -1
- package/dist/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.esm.js +2 -2
- package/dist/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.esm.js.map +1 -1
- package/dist/components/OpenApiDefinitionWidget/OpenApiDefinition.esm.js +4 -3
- package/dist/components/OpenApiDefinitionWidget/OpenApiDefinition.esm.js.map +1 -1
- package/dist/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.esm.js +5 -4
- package/dist/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.esm.js.map +1 -1
- package/dist/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.esm.js +2 -2
- package/dist/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.esm.js.map +1 -1
- package/dist/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.esm.js +2 -2
- package/dist/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.esm.js.map +1 -1
- package/dist/index.d.ts +25 -25
- package/dist/plugin.esm.js +1 -1
- package/dist/translation.esm.js +72 -0
- package/dist/translation.esm.js.map +1 -0
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @backstage/plugin-api-docs
|
|
2
2
|
|
|
3
|
+
## 0.12.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 317bc3d: api-docs plugin support i18n
|
|
8
|
+
- a47fd39: Removes instances of default React imports, a necessary update for the upcoming React 19 migration.
|
|
9
|
+
|
|
10
|
+
<https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html>
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
- @backstage/plugin-catalog@1.29.0
|
|
14
|
+
- @backstage/plugin-catalog-react@1.17.0
|
|
15
|
+
- @backstage/frontend-plugin-api@0.10.1
|
|
16
|
+
- @backstage/core-compat-api@0.4.1
|
|
17
|
+
- @backstage/core-components@0.17.1
|
|
18
|
+
- @backstage/core-plugin-api@1.10.6
|
|
19
|
+
- @backstage/plugin-permission-react@0.4.33
|
|
20
|
+
- @backstage/catalog-model@1.7.3
|
|
21
|
+
- @backstage/plugin-catalog-common@1.1.3
|
|
22
|
+
|
|
23
|
+
## 0.12.6-next.2
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- a47fd39: Removes instances of default React imports, a necessary update for the upcoming React 19 migration.
|
|
28
|
+
|
|
29
|
+
<https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html>
|
|
30
|
+
|
|
31
|
+
- Updated dependencies
|
|
32
|
+
- @backstage/plugin-catalog@1.29.0-next.2
|
|
33
|
+
- @backstage/frontend-plugin-api@0.10.1-next.1
|
|
34
|
+
- @backstage/core-compat-api@0.4.1-next.2
|
|
35
|
+
- @backstage/core-components@0.17.1-next.1
|
|
36
|
+
- @backstage/core-plugin-api@1.10.6-next.0
|
|
37
|
+
- @backstage/plugin-permission-react@0.4.33-next.0
|
|
38
|
+
- @backstage/plugin-catalog-react@1.17.0-next.2
|
|
39
|
+
- @backstage/catalog-model@1.7.3
|
|
40
|
+
- @backstage/plugin-catalog-common@1.1.3
|
|
41
|
+
|
|
3
42
|
## 0.12.6-next.1
|
|
4
43
|
|
|
5
44
|
### Patch Changes
|
package/dist/alpha.d.ts
CHANGED
|
@@ -1,8 +1,40 @@
|
|
|
1
1
|
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
2
2
|
import * as _backstage_catalog_model from '@backstage/catalog-model';
|
|
3
|
+
import * as react from 'react';
|
|
3
4
|
import * as _backstage_plugin_catalog_react_alpha from '@backstage/plugin-catalog-react/alpha';
|
|
4
5
|
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @alpha
|
|
9
|
+
*/
|
|
10
|
+
declare const apiDocsTranslationRef: _backstage_frontend_plugin_api.TranslationRef<"api-docs", {
|
|
11
|
+
readonly "apiDefinitionDialog.closeButtonTitle": "Close";
|
|
12
|
+
readonly "apiDefinitionDialog.tabsAriaLabel": "API definition options";
|
|
13
|
+
readonly "apiDefinitionDialog.toggleButtonAriaLabel": "Toggle API Definition Dialog";
|
|
14
|
+
readonly "defaultApiExplorerPage.title": "APIs";
|
|
15
|
+
readonly "defaultApiExplorerPage.subtitle": "{{orgName}} API Explorer";
|
|
16
|
+
readonly "defaultApiExplorerPage.pageTitleOverride": "APIs";
|
|
17
|
+
readonly "defaultApiExplorerPage.createButtonTitle": "Register Existing API";
|
|
18
|
+
readonly "defaultApiExplorerPage.supportButtonTitle": "All your APIs";
|
|
19
|
+
readonly "consumedApisCard.error.title": "Could not load APIs";
|
|
20
|
+
readonly "consumedApisCard.title": "Consumed APIs";
|
|
21
|
+
readonly "consumedApisCard.emptyContent.title": "This {{entity}} does not consume any APIs.";
|
|
22
|
+
readonly "hasApisCard.error.title": "Could not load APIs";
|
|
23
|
+
readonly "hasApisCard.title": "APIs";
|
|
24
|
+
readonly "hasApisCard.emptyContent.title": "This {{entity}} does not contain any APIs.";
|
|
25
|
+
readonly "providedApisCard.error.title": "Could not load APIs";
|
|
26
|
+
readonly "providedApisCard.title": "Provided APIs";
|
|
27
|
+
readonly "providedApisCard.emptyContent.title": "This {{entity}} does not provide any APIs.";
|
|
28
|
+
readonly "apiEntityColumns.typeTitle": "Type";
|
|
29
|
+
readonly "apiEntityColumns.apiDefinitionTitle": "API Definition";
|
|
30
|
+
readonly "consumingComponentsCard.error.title": "Could not load components";
|
|
31
|
+
readonly "consumingComponentsCard.title": "Consumers";
|
|
32
|
+
readonly "consumingComponentsCard.emptyContent.title": "No component consumes this API.";
|
|
33
|
+
readonly "providingComponentsCard.error.title": "Could not load components";
|
|
34
|
+
readonly "providingComponentsCard.title": "Providers";
|
|
35
|
+
readonly "providingComponentsCard.emptyContent.title": "No component provides this API.";
|
|
36
|
+
readonly apisCardHelpLinkTitle: "Learn how to change this";
|
|
37
|
+
}>;
|
|
6
38
|
|
|
7
39
|
declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
8
40
|
root: _backstage_frontend_plugin_api.RouteRef<undefined>;
|
|
@@ -31,7 +63,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
31
63
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
32
64
|
type?: "content" | "summary" | "info" | undefined;
|
|
33
65
|
};
|
|
34
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
66
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
35
67
|
optional: true;
|
|
36
68
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
37
69
|
optional: true;
|
|
@@ -56,7 +88,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
56
88
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
57
89
|
type?: "content" | "summary" | "info" | undefined;
|
|
58
90
|
};
|
|
59
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
91
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
60
92
|
optional: true;
|
|
61
93
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
62
94
|
optional: true;
|
|
@@ -81,7 +113,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
81
113
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
82
114
|
type?: "content" | "summary" | "info" | undefined;
|
|
83
115
|
};
|
|
84
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
116
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
85
117
|
optional: true;
|
|
86
118
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
87
119
|
optional: true;
|
|
@@ -106,7 +138,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
106
138
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
107
139
|
type?: "content" | "summary" | "info" | undefined;
|
|
108
140
|
};
|
|
109
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
141
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
110
142
|
optional: true;
|
|
111
143
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
112
144
|
optional: true;
|
|
@@ -131,7 +163,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
131
163
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
132
164
|
type?: "content" | "summary" | "info" | undefined;
|
|
133
165
|
};
|
|
134
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
166
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
135
167
|
optional: true;
|
|
136
168
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
137
169
|
optional: true;
|
|
@@ -156,7 +188,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
156
188
|
filter?: _backstage_plugin_catalog_react_alpha.EntityPredicate | undefined;
|
|
157
189
|
type?: "content" | "summary" | "info" | undefined;
|
|
158
190
|
};
|
|
159
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
191
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
160
192
|
optional: true;
|
|
161
193
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-filter-expression", {
|
|
162
194
|
optional: true;
|
|
@@ -185,7 +217,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
185
217
|
path?: string | undefined;
|
|
186
218
|
group?: string | false | undefined;
|
|
187
219
|
};
|
|
188
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
220
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
189
221
|
optional: true;
|
|
190
222
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-title", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
191
223
|
optional: true;
|
|
@@ -219,7 +251,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
219
251
|
path?: string | undefined;
|
|
220
252
|
group?: string | false | undefined;
|
|
221
253
|
};
|
|
222
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
254
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
223
255
|
optional: true;
|
|
224
256
|
}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "catalog.entity-content-title", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(entity: _backstage_catalog_model.Entity) => boolean, "catalog.entity-filter-function", {
|
|
225
257
|
optional: true;
|
|
@@ -266,7 +298,7 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
266
298
|
} & {
|
|
267
299
|
path?: string | undefined;
|
|
268
300
|
};
|
|
269
|
-
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<
|
|
301
|
+
output: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.JSX.Element, "core.reactElement", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<string, "core.routing.path", {}> | _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.RouteRef<_backstage_frontend_plugin_api.AnyRouteRefParams>, "core.routing.ref", {
|
|
270
302
|
optional: true;
|
|
271
303
|
}>;
|
|
272
304
|
inputs: {
|
|
@@ -285,4 +317,4 @@ declare const _default: _backstage_frontend_plugin_api.FrontendPlugin<{
|
|
|
285
317
|
}>;
|
|
286
318
|
}>;
|
|
287
319
|
|
|
288
|
-
export { _default as default };
|
|
320
|
+
export { apiDocsTranslationRef, _default as default };
|
package/dist/alpha.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import Grid from '@material-ui/core/Grid';
|
|
3
3
|
import { NavItemBlueprint, ApiBlueprint, createApiFactory, PageBlueprint, createFrontendPlugin } from '@backstage/frontend-plugin-api';
|
|
4
4
|
import { convertLegacyRouteRef, compatWrapper } from '@backstage/core-compat-api';
|
|
@@ -12,12 +12,13 @@ import { defaultDefinitionWidgets } from './components/ApiDefinitionCard/ApiDefi
|
|
|
12
12
|
import '@material-ui/core/Typography';
|
|
13
13
|
import { rootRoute, registerComponentRouteRef } from './routes.esm.js';
|
|
14
14
|
import { EntityCardBlueprint, EntityContentBlueprint } from '@backstage/plugin-catalog-react/alpha';
|
|
15
|
+
export { apiDocsTranslationRef } from './translation.esm.js';
|
|
15
16
|
|
|
16
17
|
const apiDocsNavItem = NavItemBlueprint.make({
|
|
17
18
|
params: {
|
|
18
19
|
title: "APIs",
|
|
19
20
|
routeRef: convertLegacyRouteRef(rootRoute),
|
|
20
|
-
icon: () => compatWrapper(/* @__PURE__ */
|
|
21
|
+
icon: () => compatWrapper(/* @__PURE__ */ jsx(AppIcon, { id: "kind:api" }))
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
24
|
const apiDocsConfigApi = ApiBlueprint.make({
|
|
@@ -50,7 +51,7 @@ const apiDocsExplorerPage = PageBlueprint.makeWithOverrides({
|
|
|
50
51
|
routeRef: convertLegacyRouteRef(rootRoute),
|
|
51
52
|
loader: () => import('./components/ApiExplorerPage/index.esm.js').then(
|
|
52
53
|
(m) => compatWrapper(
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ jsx(
|
|
54
55
|
m.ApiExplorerIndexPage,
|
|
55
56
|
{
|
|
56
57
|
initiallySelectedFilter: config.initiallySelectedFilter
|
|
@@ -73,7 +74,7 @@ const apiDocsHasApisEntityCard = EntityCardBlueprint.make({
|
|
|
73
74
|
);
|
|
74
75
|
},
|
|
75
76
|
loader: () => import('./components/ApisCards/index.esm.js').then(
|
|
76
|
-
(m) => compatWrapper(/* @__PURE__ */
|
|
77
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.HasApisCard, {}))
|
|
77
78
|
)
|
|
78
79
|
}
|
|
79
80
|
});
|
|
@@ -82,7 +83,7 @@ const apiDocsDefinitionEntityCard = EntityCardBlueprint.make({
|
|
|
82
83
|
params: {
|
|
83
84
|
filter: "kind:api",
|
|
84
85
|
loader: () => import('./components/ApiDefinitionCard/index.esm.js').then(
|
|
85
|
-
(m) => compatWrapper(/* @__PURE__ */
|
|
86
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.ApiDefinitionCard, {}))
|
|
86
87
|
)
|
|
87
88
|
}
|
|
88
89
|
});
|
|
@@ -94,7 +95,7 @@ const apiDocsConsumedApisEntityCard = EntityCardBlueprint.make({
|
|
|
94
95
|
// See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
|
|
95
96
|
filter: "kind:component",
|
|
96
97
|
loader: () => import('./components/ApisCards/index.esm.js').then(
|
|
97
|
-
(m) => compatWrapper(/* @__PURE__ */
|
|
98
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.ConsumedApisCard, {}))
|
|
98
99
|
)
|
|
99
100
|
}
|
|
100
101
|
});
|
|
@@ -106,7 +107,7 @@ const apiDocsProvidedApisEntityCard = EntityCardBlueprint.make({
|
|
|
106
107
|
// See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
|
|
107
108
|
filter: "kind:component",
|
|
108
109
|
loader: () => import('./components/ApisCards/index.esm.js').then(
|
|
109
|
-
(m) => compatWrapper(/* @__PURE__ */
|
|
110
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.ProvidedApisCard, {}))
|
|
110
111
|
)
|
|
111
112
|
}
|
|
112
113
|
});
|
|
@@ -118,7 +119,7 @@ const apiDocsConsumingComponentsEntityCard = EntityCardBlueprint.make({
|
|
|
118
119
|
// See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
|
|
119
120
|
filter: "kind:api",
|
|
120
121
|
loader: () => import('./components/ComponentsCards/index.esm.js').then(
|
|
121
|
-
(m) => compatWrapper(/* @__PURE__ */
|
|
122
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.ConsumingComponentsCard, {}))
|
|
122
123
|
)
|
|
123
124
|
}
|
|
124
125
|
});
|
|
@@ -130,7 +131,7 @@ const apiDocsProvidingComponentsEntityCard = EntityCardBlueprint.make({
|
|
|
130
131
|
// See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
|
|
131
132
|
filter: "kind:api",
|
|
132
133
|
loader: () => import('./components/ComponentsCards/index.esm.js').then(
|
|
133
|
-
(m) => compatWrapper(/* @__PURE__ */
|
|
134
|
+
(m) => compatWrapper(/* @__PURE__ */ jsx(m.ProvidingComponentsCard, {}))
|
|
134
135
|
)
|
|
135
136
|
}
|
|
136
137
|
});
|
|
@@ -142,7 +143,7 @@ const apiDocsDefinitionEntityContent = EntityContentBlueprint.make({
|
|
|
142
143
|
filter: "kind:api",
|
|
143
144
|
loader: async () => import('./components/ApiDefinitionCard/index.esm.js').then(
|
|
144
145
|
(m) => compatWrapper(
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
+
/* @__PURE__ */ jsx(Grid, { container: true, spacing: 3, children: /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(m.ApiDefinitionCard, {}) }) })
|
|
146
147
|
)
|
|
147
148
|
)
|
|
148
149
|
}
|
|
@@ -155,7 +156,10 @@ const apiDocsApisEntityContent = EntityContentBlueprint.make({
|
|
|
155
156
|
filter: "kind:component",
|
|
156
157
|
loader: async () => import('./components/ApisCards/index.esm.js').then(
|
|
157
158
|
(m) => compatWrapper(
|
|
158
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, alignItems: "stretch", children: [
|
|
160
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(m.ProvidedApisCard, {}) }),
|
|
161
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(m.ConsumedApisCard, {}) })
|
|
162
|
+
] })
|
|
159
163
|
)
|
|
160
164
|
)
|
|
161
165
|
}
|
package/dist/alpha.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 React from 'react';\nimport Grid from '@material-ui/core/Grid';\n\nimport {\n ApiBlueprint,\n NavItemBlueprint,\n PageBlueprint,\n createApiFactory,\n createFrontendPlugin,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\n\nimport {\n ApiEntity,\n parseEntityRef,\n RELATION_HAS_PART,\n} from '@backstage/catalog-model';\n\nimport { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { rootRoute, registerComponentRouteRef } from './routes';\nimport { apiDocsConfigRef } from './config';\nimport { AppIcon } from '@backstage/core-components';\n\nimport {\n EntityCardBlueprint,\n EntityContentBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\n\nconst apiDocsNavItem = NavItemBlueprint.make({\n params: {\n title: 'APIs',\n routeRef: convertLegacyRouteRef(rootRoute),\n icon: () => compatWrapper(<AppIcon id=\"kind:api\" />),\n },\n});\n\nconst apiDocsConfigApi = ApiBlueprint.make({\n name: 'config',\n params: {\n factory: 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});\n\nconst apiDocsExplorerPage = PageBlueprint.makeWithOverrides({\n config: {\n schema: {\n // Ommiting columns and actions for now as their types are too complex to map to zod\n initiallySelectedFilter: z =>\n z.enum(['owned', 'starred', 'all']).optional(),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n defaultPath: '/api-docs',\n routeRef: convertLegacyRouteRef(rootRoute),\n loader: () =>\n import('./components/ApiExplorerPage').then(m =>\n compatWrapper(\n <m.ApiExplorerIndexPage\n initiallySelectedFilter={config.initiallySelectedFilter}\n />,\n ),\n ),\n });\n },\n});\n\nconst apiDocsHasApisEntityCard = EntityCardBlueprint.make({\n name: 'has-apis',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants and columns are too complex to map to zod\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: entity => {\n return (\n entity.kind === 'Component' &&\n entity.relations?.some(\n ({ type, targetRef }) =>\n type.toLocaleLowerCase('en-US') === RELATION_HAS_PART &&\n parseEntityRef(targetRef).kind === 'API',\n )!!\n );\n },\n loader: () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(<m.HasApisCard />),\n ),\n },\n});\n\nconst apiDocsDefinitionEntityCard = EntityCardBlueprint.make({\n name: 'definition',\n params: {\n filter: 'kind:api',\n loader: () =>\n import('./components/ApiDefinitionCard').then(m =>\n compatWrapper(<m.ApiDefinitionCard />),\n ),\n },\n});\n\nconst apiDocsConsumedApisEntityCard = EntityCardBlueprint.make({\n name: 'consumed-apis',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants and columns are too complex to map to zod\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:component',\n loader: () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(<m.ConsumedApisCard />),\n ),\n },\n});\n\nconst apiDocsProvidedApisEntityCard = EntityCardBlueprint.make({\n name: 'provided-apis',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants and columns are too complex to map to zod\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:component',\n loader: () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(<m.ProvidedApisCard />),\n ),\n },\n});\n\nconst apiDocsConsumingComponentsEntityCard = EntityCardBlueprint.make({\n name: 'consuming-components',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:api',\n loader: () =>\n import('./components/ComponentsCards').then(m =>\n compatWrapper(<m.ConsumingComponentsCard />),\n ),\n },\n});\n\nconst apiDocsProvidingComponentsEntityCard = EntityCardBlueprint.make({\n name: 'providing-components',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:api',\n loader: () =>\n import('./components/ComponentsCards').then(m =>\n compatWrapper(<m.ProvidingComponentsCard />),\n ),\n },\n});\n\nconst apiDocsDefinitionEntityContent = EntityContentBlueprint.make({\n name: 'definition',\n params: {\n defaultPath: '/definition',\n defaultTitle: 'Definition',\n filter: 'kind:api',\n loader: async () =>\n import('./components/ApiDefinitionCard').then(m =>\n compatWrapper(\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <m.ApiDefinitionCard />\n </Grid>\n </Grid>,\n ),\n ),\n },\n});\n\nconst apiDocsApisEntityContent = EntityContentBlueprint.make({\n name: 'apis',\n params: {\n defaultPath: '/apis',\n defaultTitle: 'APIs',\n filter: 'kind:component',\n loader: async () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(\n <Grid container spacing={3} alignItems=\"stretch\">\n <Grid item xs={12}>\n <m.ProvidedApisCard />\n </Grid>\n <Grid item xs={12}>\n <m.ConsumedApisCard />\n </Grid>\n </Grid>,\n ),\n ),\n },\n});\n\nexport default createFrontendPlugin({\n id: 'api-docs',\n routes: {\n root: convertLegacyRouteRef(rootRoute),\n },\n externalRoutes: {\n registerApi: convertLegacyRouteRef(registerComponentRouteRef),\n },\n extensions: [\n apiDocsNavItem,\n apiDocsConfigApi,\n apiDocsExplorerPage,\n apiDocsHasApisEntityCard,\n apiDocsDefinitionEntityCard,\n apiDocsProvidedApisEntityCard,\n apiDocsConsumedApisEntityCard,\n apiDocsConsumingComponentsEntityCard,\n apiDocsProvidingComponentsEntityCard,\n apiDocsDefinitionEntityContent,\n apiDocsApisEntityContent,\n ],\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAgDA,MAAM,cAAA,GAAiB,iBAAiB,IAAK,CAAA;AAAA,EAC3C,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,MAAA;AAAA,IACP,QAAA,EAAU,sBAAsB,SAAS,CAAA;AAAA,IACzC,MAAM,MAAM,aAAA,qCAAe,OAAQ,EAAA,EAAA,EAAA,EAAG,YAAW,CAAE;AAAA;AAEvD,CAAC,CAA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9D;AAAA,EACA,UAAY,EAAA;AAAA,IACV,cAAA;AAAA,IACA,gBAAA;AAAA,IACA,mBAAA;AAAA,IACA,wBAAA;AAAA,IACA,2BAAA;AAAA,IACA,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA,oCAAA;AAAA,IACA,oCAAA;AAAA,IACA,8BAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 Grid from '@material-ui/core/Grid';\n\nimport {\n ApiBlueprint,\n NavItemBlueprint,\n PageBlueprint,\n createApiFactory,\n createFrontendPlugin,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\n\nimport {\n ApiEntity,\n parseEntityRef,\n RELATION_HAS_PART,\n} from '@backstage/catalog-model';\n\nimport { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { rootRoute, registerComponentRouteRef } from './routes';\nimport { apiDocsConfigRef } from './config';\nimport { AppIcon } from '@backstage/core-components';\n\nimport {\n EntityCardBlueprint,\n EntityContentBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\n\nconst apiDocsNavItem = NavItemBlueprint.make({\n params: {\n title: 'APIs',\n routeRef: convertLegacyRouteRef(rootRoute),\n icon: () => compatWrapper(<AppIcon id=\"kind:api\" />),\n },\n});\n\nconst apiDocsConfigApi = ApiBlueprint.make({\n name: 'config',\n params: {\n factory: 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});\n\nconst apiDocsExplorerPage = PageBlueprint.makeWithOverrides({\n config: {\n schema: {\n // Ommiting columns and actions for now as their types are too complex to map to zod\n initiallySelectedFilter: z =>\n z.enum(['owned', 'starred', 'all']).optional(),\n },\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n defaultPath: '/api-docs',\n routeRef: convertLegacyRouteRef(rootRoute),\n loader: () =>\n import('./components/ApiExplorerPage').then(m =>\n compatWrapper(\n <m.ApiExplorerIndexPage\n initiallySelectedFilter={config.initiallySelectedFilter}\n />,\n ),\n ),\n });\n },\n});\n\nconst apiDocsHasApisEntityCard = EntityCardBlueprint.make({\n name: 'has-apis',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants and columns are too complex to map to zod\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: entity => {\n return (\n entity.kind === 'Component' &&\n entity.relations?.some(\n ({ type, targetRef }) =>\n type.toLocaleLowerCase('en-US') === RELATION_HAS_PART &&\n parseEntityRef(targetRef).kind === 'API',\n )!!\n );\n },\n loader: () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(<m.HasApisCard />),\n ),\n },\n});\n\nconst apiDocsDefinitionEntityCard = EntityCardBlueprint.make({\n name: 'definition',\n params: {\n filter: 'kind:api',\n loader: () =>\n import('./components/ApiDefinitionCard').then(m =>\n compatWrapper(<m.ApiDefinitionCard />),\n ),\n },\n});\n\nconst apiDocsConsumedApisEntityCard = EntityCardBlueprint.make({\n name: 'consumed-apis',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants and columns are too complex to map to zod\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:component',\n loader: () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(<m.ConsumedApisCard />),\n ),\n },\n});\n\nconst apiDocsProvidedApisEntityCard = EntityCardBlueprint.make({\n name: 'provided-apis',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants and columns are too complex to map to zod\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:component',\n loader: () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(<m.ProvidedApisCard />),\n ),\n },\n});\n\nconst apiDocsConsumingComponentsEntityCard = EntityCardBlueprint.make({\n name: 'consuming-components',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:api',\n loader: () =>\n import('./components/ComponentsCards').then(m =>\n compatWrapper(<m.ConsumingComponentsCard />),\n ),\n },\n});\n\nconst apiDocsProvidingComponentsEntityCard = EntityCardBlueprint.make({\n name: 'providing-components',\n params: {\n // Ommiting configSchema for now\n // We are skipping variants\n // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252\n filter: 'kind:api',\n loader: () =>\n import('./components/ComponentsCards').then(m =>\n compatWrapper(<m.ProvidingComponentsCard />),\n ),\n },\n});\n\nconst apiDocsDefinitionEntityContent = EntityContentBlueprint.make({\n name: 'definition',\n params: {\n defaultPath: '/definition',\n defaultTitle: 'Definition',\n filter: 'kind:api',\n loader: async () =>\n import('./components/ApiDefinitionCard').then(m =>\n compatWrapper(\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <m.ApiDefinitionCard />\n </Grid>\n </Grid>,\n ),\n ),\n },\n});\n\nconst apiDocsApisEntityContent = EntityContentBlueprint.make({\n name: 'apis',\n params: {\n defaultPath: '/apis',\n defaultTitle: 'APIs',\n filter: 'kind:component',\n loader: async () =>\n import('./components/ApisCards').then(m =>\n compatWrapper(\n <Grid container spacing={3} alignItems=\"stretch\">\n <Grid item xs={12}>\n <m.ProvidedApisCard />\n </Grid>\n <Grid item xs={12}>\n <m.ConsumedApisCard />\n </Grid>\n </Grid>,\n ),\n ),\n },\n});\n\nexport default createFrontendPlugin({\n id: 'api-docs',\n routes: {\n root: convertLegacyRouteRef(rootRoute),\n },\n externalRoutes: {\n registerApi: convertLegacyRouteRef(registerComponentRouteRef),\n },\n extensions: [\n apiDocsNavItem,\n apiDocsConfigApi,\n apiDocsExplorerPage,\n apiDocsHasApisEntityCard,\n apiDocsDefinitionEntityCard,\n apiDocsProvidedApisEntityCard,\n apiDocsConsumedApisEntityCard,\n apiDocsConsumingComponentsEntityCard,\n apiDocsProvidingComponentsEntityCard,\n apiDocsDefinitionEntityContent,\n apiDocsApisEntityContent,\n ],\n});\n\nexport { apiDocsTranslationRef } from './translation';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA+CA,MAAM,cAAA,GAAiB,iBAAiB,IAAK,CAAA;AAAA,EAC3C,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,MAAA;AAAA,IACP,QAAA,EAAU,sBAAsB,SAAS,CAAA;AAAA,IACzC,MAAM,MAAM,aAAA,qBAAe,OAAQ,EAAA,EAAA,EAAA,EAAG,YAAW,CAAE;AAAA;AAEvD,CAAC,CAAA;AAED,MAAM,gBAAA,GAAmB,aAAa,IAAK,CAAA;AAAA,EACzC,IAAM,EAAA,QAAA;AAAA,EACN,MAAQ,EAAA;AAAA,IACN,SAAS,gBAAiB,CAAA;AAAA,MACxB,GAAK,EAAA,gBAAA;AAAA,MACL,MAAM,EAAC;AAAA,MACP,SAAS,MAAM;AACb,QAAA,MAAM,oBAAoB,wBAAyB,EAAA;AACnD,QAAO,OAAA;AAAA,UACL,sBAAA,EAAwB,CAAC,SAAyB,KAAA;AAChD,YAAA,OAAO,kBAAkB,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,IAAS,KAAA,SAAA,CAAU,KAAK,IAAI,CAAA;AAAA;AACnE,SACF;AAAA;AACF,KACD;AAAA;AAEL,CAAC,CAAA;AAED,MAAM,mBAAA,GAAsB,cAAc,iBAAkB,CAAA;AAAA,EAC1D,MAAQ,EAAA;AAAA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,QAAA,EAAA;AAAA,0BAAC,GAAA,CAAA,IAAA,EAAA,EAAK,MAAI,IAAC,EAAA,EAAA,EAAI,IACb,QAAC,kBAAA,GAAA,CAAA,CAAA,CAAE,gBAAF,EAAA,EAAmB,CACtB,EAAA,CAAA;AAAA,0BACA,GAAA,CAAC,IAAK,EAAA,EAAA,IAAA,EAAI,IAAC,EAAA,EAAA,EAAI,IACb,QAAC,kBAAA,GAAA,CAAA,CAAA,CAAE,gBAAF,EAAA,EAAmB,CACtB,EAAA;AAAA,SACF,EAAA;AAAA;AACF;AACF;AAEN,CAAC,CAAA;AAED,YAAe,oBAAqB,CAAA;AAAA,EAClC,EAAI,EAAA,UAAA;AAAA,EACJ,MAAQ,EAAA;AAAA,IACN,IAAA,EAAM,sBAAsB,SAAS;AAAA,GACvC;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,WAAA,EAAa,sBAAsB,yBAAyB;AAAA,GAC9D;AAAA,EACA,UAAY,EAAA;AAAA,IACV,cAAA;AAAA,IACA,gBAAA;AAAA,IACA,mBAAA;AAAA,IACA,wBAAA;AAAA,IACA,2BAAA;AAAA,IACA,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA,oCAAA;AAAA,IACA,oCAAA;AAAA,IACA,8BAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { useEntity } from '@backstage/plugin-catalog-react';
|
|
2
3
|
import Alert from '@material-ui/lab/Alert';
|
|
3
|
-
import React from 'react';
|
|
4
4
|
import { apiDocsConfigRef } from '../../config.esm.js';
|
|
5
5
|
import { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget/PlainApiDefinitionWidget.esm.js';
|
|
6
6
|
import { TabbedCard, CardTab } from '@backstage/core-components';
|
|
@@ -11,32 +11,35 @@ const ApiDefinitionCard = () => {
|
|
|
11
11
|
const config = useApi(apiDocsConfigRef);
|
|
12
12
|
const { getApiDefinitionWidget } = config;
|
|
13
13
|
if (!entity) {
|
|
14
|
-
return /* @__PURE__ */
|
|
14
|
+
return /* @__PURE__ */ jsx(Alert, { severity: "error", children: "Could not fetch the API" });
|
|
15
15
|
}
|
|
16
16
|
const definitionWidget = getApiDefinitionWidget(entity);
|
|
17
17
|
const entityTitle = entity.metadata.title ?? entity.metadata.name;
|
|
18
18
|
if (definitionWidget) {
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
return /* @__PURE__ */ jsxs(TabbedCard, { title: entityTitle, children: [
|
|
20
|
+
/* @__PURE__ */ jsx(CardTab, { label: definitionWidget.title, children: definitionWidget.component(entity.spec.definition) }, "widget"),
|
|
21
|
+
/* @__PURE__ */ jsx(CardTab, { label: "Raw", children: /* @__PURE__ */ jsx(
|
|
22
|
+
PlainApiDefinitionWidget,
|
|
23
|
+
{
|
|
24
|
+
definition: entity.spec.definition,
|
|
25
|
+
language: definitionWidget.rawLanguage || entity.spec.type
|
|
26
|
+
}
|
|
27
|
+
) }, "raw")
|
|
28
|
+
] });
|
|
26
29
|
}
|
|
27
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
28
31
|
TabbedCard,
|
|
29
32
|
{
|
|
30
33
|
title: entityTitle,
|
|
31
34
|
children: [
|
|
32
35
|
// Has to be an array, otherwise typescript doesn't like that this has only a single child
|
|
33
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ jsx(CardTab, { label: entity.spec.type, children: /* @__PURE__ */ jsx(
|
|
34
37
|
PlainApiDefinitionWidget,
|
|
35
38
|
{
|
|
36
39
|
definition: entity.spec.definition,
|
|
37
40
|
language: entity.spec.type
|
|
38
41
|
}
|
|
39
|
-
))
|
|
42
|
+
) }, "raw")
|
|
40
43
|
]
|
|
41
44
|
}
|
|
42
45
|
);
|
|
@@ -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 Alert from '@material-ui/lab/Alert';\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 Alert from '@material-ui/lab/Alert';\nimport { apiDocsConfigRef } from '../../config';\nimport { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';\n\nimport { CardTab, TabbedCard } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\n/** @public */\nexport const ApiDefinitionCard = () => {\n const { entity } = useEntity<ApiEntity>();\n const config = useApi(apiDocsConfigRef);\n const { getApiDefinitionWidget } = config;\n\n if (!entity) {\n return <Alert severity=\"error\">Could not fetch the API</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=\"Raw\" 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":";;;;;;;;AA0BO,MAAM,oBAAoB,MAAM;AACrC,EAAM,MAAA,EAAE,MAAO,EAAA,GAAI,SAAqB,EAAA;AACxC,EAAM,MAAA,MAAA,GAAS,OAAO,gBAAgB,CAAA;AACtC,EAAM,MAAA,EAAE,wBAA2B,GAAA,MAAA;AAEnC,EAAA,IAAI,CAAC,MAAQ,EAAA;AACX,IAAA,uBAAQ,GAAA,CAAA,KAAA,EAAA,EAAM,QAAS,EAAA,OAAA,EAAQ,QAAuB,EAAA,yBAAA,EAAA,CAAA;AAAA;AAGxD,EAAM,MAAA,gBAAA,GAAmB,uBAAuB,MAAM,CAAA;AACtD,EAAA,MAAM,WAAc,GAAA,MAAA,CAAO,QAAS,CAAA,KAAA,IAAS,OAAO,QAAS,CAAA,IAAA;AAE7D,EAAA,IAAI,gBAAkB,EAAA;AACpB,IACE,uBAAA,IAAA,CAAC,UAAW,EAAA,EAAA,KAAA,EAAO,WACjB,EAAA,QAAA,EAAA;AAAA,sBAAC,GAAA,CAAA,OAAA,EAAA,EAAQ,KAAO,EAAA,gBAAA,CAAiB,KAC9B,EAAA,QAAA,EAAA,gBAAA,CAAiB,UAAU,MAAO,CAAA,IAAA,CAAK,UAAU,CAAA,EAAA,EADR,QAE5C,CAAA;AAAA,sBACA,GAAA,CAAC,OAAQ,EAAA,EAAA,KAAA,EAAM,KACb,EAAA,QAAA,kBAAA,GAAA;AAAA,QAAC,wBAAA;AAAA,QAAA;AAAA,UACC,UAAA,EAAY,OAAO,IAAK,CAAA,UAAA;AAAA,UACxB,QAAU,EAAA,gBAAA,CAAiB,WAAe,IAAA,MAAA,CAAO,IAAK,CAAA;AAAA;AAAA,WAHjC,KAKzB;AAAA,KACF,EAAA,CAAA;AAAA;AAIJ,EACE,uBAAA,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAO,EAAA,WAAA;AAAA,MACP,QAAU,EAAA;AAAA;AAAA,wBAEP,GAAA,CAAA,OAAA,EAAA,EAAQ,KAAO,EAAA,MAAA,CAAO,KAAK,IAC1B,EAAA,QAAA,kBAAA,GAAA;AAAA,UAAC,wBAAA;AAAA,UAAA;AAAA,YACC,UAAA,EAAY,OAAO,IAAK,CAAA,UAAA;AAAA,YACxB,QAAA,EAAU,OAAO,IAAK,CAAA;AAAA;AAAA,aAHY,KAKtC;AAAA;AACF;AAAA,GACF;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { AsyncApiDefinitionWidget } from '../AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.esm.js';
|
|
3
3
|
import { GraphQlDefinitionWidget } from '../GraphQlDefinitionWidget/GraphQlDefinitionWidget.esm.js';
|
|
4
4
|
import { OpenApiDefinitionWidget } from '../OpenApiDefinitionWidget/OpenApiDefinitionWidget.esm.js';
|
|
@@ -11,29 +11,29 @@ function defaultDefinitionWidgets() {
|
|
|
11
11
|
type: "openapi",
|
|
12
12
|
title: "OpenAPI",
|
|
13
13
|
rawLanguage: "yaml",
|
|
14
|
-
component: (definition) => /* @__PURE__ */
|
|
14
|
+
component: (definition) => /* @__PURE__ */ jsx(OpenApiDefinitionWidget, { definition })
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
type: "asyncapi",
|
|
18
18
|
title: "AsyncAPI",
|
|
19
19
|
rawLanguage: "yaml",
|
|
20
|
-
component: (definition) => /* @__PURE__ */
|
|
20
|
+
component: (definition) => /* @__PURE__ */ jsx(AsyncApiDefinitionWidget, { definition })
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
type: "graphql",
|
|
24
24
|
title: "GraphQL",
|
|
25
25
|
rawLanguage: "graphql",
|
|
26
|
-
component: (definition) => /* @__PURE__ */
|
|
26
|
+
component: (definition) => /* @__PURE__ */ jsx(GraphQlDefinitionWidget, { definition })
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
type: "grpc",
|
|
30
30
|
title: "gRPC",
|
|
31
|
-
component: (definition) => /* @__PURE__ */
|
|
31
|
+
component: (definition) => /* @__PURE__ */ jsx(GrpcApiDefinitionWidget, { definition })
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
type: "trpc",
|
|
35
35
|
title: "tRPC",
|
|
36
|
-
component: (definition) => /* @__PURE__ */
|
|
36
|
+
component: (definition) => /* @__PURE__ */ jsx(TrpcApiDefinitionWidget, { definition })
|
|
37
37
|
}
|
|
38
38
|
];
|
|
39
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiDefinitionWidget.esm.js","sources":["../../../src/components/ApiDefinitionCard/ApiDefinitionWidget.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 */\nimport
|
|
1
|
+
{"version":3,"file":"ApiDefinitionWidget.esm.js","sources":["../../../src/components/ApiDefinitionCard/ApiDefinitionWidget.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 */\nimport { ReactElement } from 'react';\nimport { AsyncApiDefinitionWidget } from '../AsyncApiDefinitionWidget';\nimport { GraphQlDefinitionWidget } from '../GraphQlDefinitionWidget';\nimport { OpenApiDefinitionWidget } from '../OpenApiDefinitionWidget';\nimport { GrpcApiDefinitionWidget } from '../GrpcApiDefinitionWidget';\nimport { TrpcApiDefinitionWidget } from '../TrpcDefinitionWidget';\n\n/** @public */\nexport type ApiDefinitionWidget = {\n type: string;\n title: string;\n component: (definition: string) => ReactElement;\n rawLanguage?: string;\n};\n\n/** @public */\nexport function defaultDefinitionWidgets(): ApiDefinitionWidget[] {\n return [\n {\n type: 'openapi',\n title: 'OpenAPI',\n rawLanguage: 'yaml',\n component: definition => (\n <OpenApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'asyncapi',\n title: 'AsyncAPI',\n rawLanguage: 'yaml',\n component: definition => (\n <AsyncApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'graphql',\n title: 'GraphQL',\n rawLanguage: 'graphql',\n component: definition => (\n <GraphQlDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'grpc',\n title: 'gRPC',\n component: definition => (\n <GrpcApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'trpc',\n title: 'tRPC',\n component: definition => (\n <TrpcApiDefinitionWidget definition={definition} />\n ),\n },\n ];\n}\n"],"names":[],"mappings":";;;;;;;AA+BO,SAAS,wBAAkD,GAAA;AAChE,EAAO,OAAA;AAAA,IACL;AAAA,MACE,IAAM,EAAA,SAAA;AAAA,MACN,KAAO,EAAA,SAAA;AAAA,MACP,WAAa,EAAA,MAAA;AAAA,MACb,SAAW,EAAA,CAAA,UAAA,qBACR,GAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAM,EAAA,UAAA;AAAA,MACN,KAAO,EAAA,UAAA;AAAA,MACP,WAAa,EAAA,MAAA;AAAA,MACb,SAAW,EAAA,CAAA,UAAA,qBACR,GAAA,CAAA,wBAAA,EAAA,EAAyB,UAAwB,EAAA;AAAA,KAEtD;AAAA,IACA;AAAA,MACE,IAAM,EAAA,SAAA;AAAA,MACN,KAAO,EAAA,SAAA;AAAA,MACP,WAAa,EAAA,SAAA;AAAA,MACb,SAAW,EAAA,CAAA,UAAA,qBACR,GAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAM,EAAA,MAAA;AAAA,MACN,KAAO,EAAA,MAAA;AAAA,MACP,SAAW,EAAA,CAAA,UAAA,qBACR,GAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAM,EAAA,MAAA;AAAA,MACN,KAAO,EAAA,MAAA;AAAA,MACP,SAAW,EAAA,CAAA,UAAA,qBACR,GAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA;AAAA;AAErD,GACF;AACF;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import Typography from '@material-ui/core/Typography';
|
|
2
|
-
import React from 'react';
|
|
3
3
|
import { apiDocsConfigRef } from '../../config.esm.js';
|
|
4
4
|
import { useApi } from '@backstage/core-plugin-api';
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ const ApiTypeTitle = (props) => {
|
|
|
8
8
|
const config = useApi(apiDocsConfigRef);
|
|
9
9
|
const definition = config.getApiDefinitionWidget(apiEntity);
|
|
10
10
|
const type = definition ? definition.title : apiEntity.spec.type;
|
|
11
|
-
return /* @__PURE__ */
|
|
11
|
+
return /* @__PURE__ */ jsx(Typography, { component: "span", variant: "inherit", children: type });
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export { ApiTypeTitle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiTypeTitle.esm.js","sources":["../../../src/components/ApiDefinitionCard/ApiTypeTitle.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 Typography from '@material-ui/core/Typography';\nimport
|
|
1
|
+
{"version":3,"file":"ApiTypeTitle.esm.js","sources":["../../../src/components/ApiDefinitionCard/ApiTypeTitle.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 Typography from '@material-ui/core/Typography';\nimport { apiDocsConfigRef } from '../../config';\nimport { useApi } from '@backstage/core-plugin-api';\n\n/**\n * @public\n */\nexport const ApiTypeTitle = (props: { apiEntity: ApiEntity }) => {\n const { apiEntity } = props;\n const config = useApi(apiDocsConfigRef);\n const definition = config.getApiDefinitionWidget(apiEntity);\n const type = definition ? definition.title : apiEntity.spec.type;\n\n return (\n <Typography component=\"span\" variant=\"inherit\">\n {type}\n </Typography>\n );\n};\n"],"names":[],"mappings":";;;;;AAwBa,MAAA,YAAA,GAAe,CAAC,KAAoC,KAAA;AAC/D,EAAM,MAAA,EAAE,WAAc,GAAA,KAAA;AACtB,EAAM,MAAA,MAAA,GAAS,OAAO,gBAAgB,CAAA;AACtC,EAAM,MAAA,UAAA,GAAa,MAAO,CAAA,sBAAA,CAAuB,SAAS,CAAA;AAC1D,EAAA,MAAM,IAAO,GAAA,UAAA,GAAa,UAAW,CAAA,KAAA,GAAQ,UAAU,IAAK,CAAA,IAAA;AAE5D,EAAA,2BACG,UAAW,EAAA,EAAA,SAAA,EAAU,MAAO,EAAA,OAAA,EAAQ,WAClC,QACH,EAAA,IAAA,EAAA,CAAA;AAEJ;;;;"}
|