@backstage/plugin-api-docs 0.11.1-next.2 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/alpha/package.json +1 -1
  3. package/dist/alpha.esm.js +12 -12
  4. package/dist/alpha.esm.js.map +1 -1
  5. package/dist/esm/{ApiDefinitionCard-504c2432.esm.js → ApiDefinitionCard-B-gBxw4Y.esm.js} +4 -4
  6. package/dist/esm/ApiDefinitionCard-B-gBxw4Y.esm.js.map +1 -0
  7. package/dist/esm/{ApiDefinitionWidget-798ee85f.esm.js → ApiDefinitionWidget-B2Z_EBYd.esm.js} +4 -4
  8. package/dist/esm/{ApiDefinitionWidget-798ee85f.esm.js.map → ApiDefinitionWidget-B2Z_EBYd.esm.js.map} +1 -1
  9. package/dist/esm/{ApiExplorerPage-ce544a95.esm.js → ApiExplorerPage-DN8sGDDe.esm.js} +2 -2
  10. package/dist/esm/{ApiExplorerPage-ce544a95.esm.js.map → ApiExplorerPage-DN8sGDDe.esm.js.map} +1 -1
  11. package/dist/esm/{ApiTypeTitle-cc79a2f3.esm.js → ApiTypeTitle-Q7DWBnfV.esm.js} +2 -2
  12. package/dist/esm/{ApiTypeTitle-cc79a2f3.esm.js.map → ApiTypeTitle-Q7DWBnfV.esm.js.map} +1 -1
  13. package/dist/esm/{AsyncApiDefinition-ffed9c50.esm.js → AsyncApiDefinition-BS46mwIR.esm.js} +2 -3
  14. package/dist/esm/AsyncApiDefinition-BS46mwIR.esm.js.map +1 -0
  15. package/dist/esm/{GraphQlDefinition-49cc2c3b.esm.js → GraphQlDefinition-D3sN0srb.esm.js} +1 -1
  16. package/dist/esm/{GraphQlDefinition-49cc2c3b.esm.js.map → GraphQlDefinition-D3sN0srb.esm.js.map} +1 -1
  17. package/dist/esm/{OpenApiDefinition-20ae2e8c.esm.js → OpenApiDefinition-P9gI3GDo.esm.js} +1 -1
  18. package/dist/esm/{OpenApiDefinition-20ae2e8c.esm.js.map → OpenApiDefinition-P9gI3GDo.esm.js.map} +1 -1
  19. package/dist/esm/{ProvidedApisCard-e92fbd29.esm.js → ProvidedApisCard-DYM2U8N2.esm.js} +15 -6
  20. package/dist/esm/ProvidedApisCard-DYM2U8N2.esm.js.map +1 -0
  21. package/dist/esm/{ProvidingComponentsCard-5b679445.esm.js → ProvidingComponentsCard-DleuYPKR.esm.js} +2 -2
  22. package/dist/esm/ProvidingComponentsCard-DleuYPKR.esm.js.map +1 -0
  23. package/dist/esm/index-BREvzWXp.esm.js +22 -0
  24. package/dist/esm/index-BREvzWXp.esm.js.map +1 -0
  25. package/dist/esm/{index-6f21bd2e.esm.js → index-BnvGScty.esm.js} +5 -5
  26. package/dist/esm/index-BnvGScty.esm.js.map +1 -0
  27. package/dist/esm/{index-c969ed3d.esm.js → index-CEoQtSjl.esm.js} +3 -3
  28. package/dist/esm/index-CEoQtSjl.esm.js.map +1 -0
  29. package/dist/esm/{index-435dfc01.esm.js → index-DDxb-GVK.esm.js} +3 -3
  30. package/dist/esm/index-DDxb-GVK.esm.js.map +1 -0
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.esm.js +25 -17
  33. package/dist/index.esm.js.map +1 -1
  34. package/package.json +15 -15
  35. package/dist/esm/ApiDefinitionCard-504c2432.esm.js.map +0 -1
  36. package/dist/esm/AsyncApiDefinition-ffed9c50.esm.js.map +0 -1
  37. package/dist/esm/ProvidedApisCard-e92fbd29.esm.js.map +0 -1
  38. package/dist/esm/ProvidingComponentsCard-5b679445.esm.js.map +0 -1
  39. package/dist/esm/index-435dfc01.esm.js.map +0 -1
  40. package/dist/esm/index-5f0727eb.esm.js +0 -14
  41. package/dist/esm/index-5f0727eb.esm.js.map +0 -1
  42. package/dist/esm/index-6f21bd2e.esm.js.map +0 -1
  43. package/dist/esm/index-c969ed3d.esm.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @backstage/plugin-api-docs
2
2
 
3
+ ## 0.11.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/core-components@0.14.2
9
+ - @backstage/plugin-catalog-react@1.11.1
10
+ - @backstage/plugin-catalog@1.18.1
11
+ - @backstage/frontend-plugin-api@0.6.2
12
+ - @backstage/core-compat-api@0.2.2
13
+ - @backstage/core-plugin-api@1.9.1
14
+ - @backstage/catalog-model@1.4.5
15
+ - @backstage/plugin-catalog-common@1.0.22
16
+ - @backstage/plugin-permission-react@0.4.21
17
+
18
+ ## 0.11.1
19
+
20
+ ### Patch Changes
21
+
22
+ - c60dc3b: added an optional ESLint rule - no-top-level-material-ui-4-imports - in api-docs plugin which has an auto fix function to migrate the imports and used it to migrate the material-ui imports for plugins/api-docs
23
+ - 7854120: Use the `AppIcon` component in the navigation item extension.
24
+ - 2be27b9: Updated dependency `graphiql` to `3.1.1`.
25
+ - efba3d2: Updated dependency `@asyncapi/react-component` to `1.3.1`.
26
+ - Updated dependencies
27
+ - @backstage/core-components@0.14.1
28
+ - @backstage/plugin-catalog@1.18.0
29
+ - @backstage/plugin-catalog-react@1.11.0
30
+ - @backstage/catalog-model@1.4.5
31
+ - @backstage/core-compat-api@0.2.1
32
+ - @backstage/core-plugin-api@1.9.1
33
+ - @backstage/frontend-plugin-api@0.6.1
34
+ - @backstage/plugin-catalog-common@1.0.22
35
+ - @backstage/plugin-permission-react@0.4.21
36
+
3
37
  ## 0.11.1-next.2
4
38
 
5
39
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-api-docs",
3
- "version": "0.11.1-next.2",
3
+ "version": "0.11.2",
4
4
  "main": "../dist/alpha.esm.js",
5
5
  "module": "../dist/alpha.esm.js",
6
6
  "types": "../dist/alpha.d.ts"
package/dist/alpha.esm.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import React from 'react';
2
- import { Grid } from '@material-ui/core';
2
+ import Grid from '@material-ui/core/Grid';
3
3
  import { createNavItemExtension, createApiExtension, createApiFactory, createPageExtension, createSchemaFromZod, createPlugin } from '@backstage/frontend-plugin-api';
4
4
  import { convertLegacyRouteRef, compatWrapper } from '@backstage/core-compat-api';
5
5
  import { createEntityCardExtension, createEntityContentExtension } from '@backstage/plugin-catalog-react/alpha';
6
6
  import { RELATION_HAS_PART, parseEntityRef } from '@backstage/catalog-model';
7
7
  import '@backstage/plugin-catalog-react';
8
- import '@material-ui/lab';
9
- import { r as rootRoute, a as apiDocsConfigRef, b as registerComponentRouteRef, d as defaultDefinitionWidgets } from './esm/ApiDefinitionWidget-798ee85f.esm.js';
8
+ import '@material-ui/lab/Alert';
9
+ import { r as rootRoute, a as apiDocsConfigRef, b as registerComponentRouteRef, d as defaultDefinitionWidgets } from './esm/ApiDefinitionWidget-B2Z_EBYd.esm.js';
10
10
  import { AppIcon } from '@backstage/core-components';
11
11
  import '@backstage/core-plugin-api';
12
12
  import '@material-ui/core/Typography';
@@ -42,7 +42,7 @@ const apiDocsExplorerPage = createPageExtension({
42
42
  // Ommiting columns and actions for now as their types are too complex to map to zod
43
43
  })
44
44
  ),
45
- loader: ({ config }) => import('./esm/index-435dfc01.esm.js').then(
45
+ loader: ({ config }) => import('./esm/index-DDxb-GVK.esm.js').then(
46
46
  (m) => compatWrapper(
47
47
  /* @__PURE__ */ React.createElement(
48
48
  m.ApiExplorerIndexPage,
@@ -64,14 +64,14 @@ const apiDocsHasApisEntityCard = createEntityCardExtension({
64
64
  ({ type, targetRef }) => type.toLocaleLowerCase("en-US") === RELATION_HAS_PART && parseEntityRef(targetRef).kind === "API"
65
65
  ));
66
66
  },
67
- loader: () => import('./esm/index-5f0727eb.esm.js').then(
67
+ loader: () => import('./esm/index-BREvzWXp.esm.js').then(
68
68
  (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.HasApisCard, null))
69
69
  )
70
70
  });
71
71
  const apiDocsDefinitionEntityCard = createEntityCardExtension({
72
72
  name: "definition",
73
73
  filter: "kind:api",
74
- loader: () => import('./esm/index-6f21bd2e.esm.js').then(
74
+ loader: () => import('./esm/index-BnvGScty.esm.js').then(
75
75
  (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ApiDefinitionCard, null))
76
76
  )
77
77
  });
@@ -81,7 +81,7 @@ const apiDocsConsumedApisEntityCard = createEntityCardExtension({
81
81
  // We are skipping variants and columns are too complex to map to zod
82
82
  // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
83
83
  filter: "kind:component",
84
- loader: () => import('./esm/index-5f0727eb.esm.js').then(
84
+ loader: () => import('./esm/index-BREvzWXp.esm.js').then(
85
85
  (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ConsumedApisCard, null))
86
86
  )
87
87
  });
@@ -91,7 +91,7 @@ const apiDocsProvidedApisEntityCard = createEntityCardExtension({
91
91
  // We are skipping variants and columns are too complex to map to zod
92
92
  // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
93
93
  filter: "kind:component",
94
- loader: () => import('./esm/index-5f0727eb.esm.js').then(
94
+ loader: () => import('./esm/index-BREvzWXp.esm.js').then(
95
95
  (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ProvidedApisCard, null))
96
96
  )
97
97
  });
@@ -101,7 +101,7 @@ const apiDocsConsumingComponentsEntityCard = createEntityCardExtension({
101
101
  // We are skipping variants
102
102
  // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
103
103
  filter: "kind:api",
104
- loader: () => import('./esm/index-c969ed3d.esm.js').then(
104
+ loader: () => import('./esm/index-CEoQtSjl.esm.js').then(
105
105
  (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ConsumingComponentsCard, null))
106
106
  )
107
107
  });
@@ -111,7 +111,7 @@ const apiDocsProvidingComponentsEntityCard = createEntityCardExtension({
111
111
  // We are skipping variants
112
112
  // See: https://github.com/backstage/backstage/pull/22619#discussion_r1477333252
113
113
  filter: "kind:api",
114
- loader: () => import('./esm/index-c969ed3d.esm.js').then(
114
+ loader: () => import('./esm/index-CEoQtSjl.esm.js').then(
115
115
  (m) => compatWrapper(/* @__PURE__ */ React.createElement(m.ProvidingComponentsCard, null))
116
116
  )
117
117
  });
@@ -120,7 +120,7 @@ const apiDocsDefinitionEntityContent = createEntityContentExtension({
120
120
  defaultPath: "/defintion",
121
121
  defaultTitle: "Definition",
122
122
  filter: "kind:api",
123
- loader: async () => import('./esm/index-6f21bd2e.esm.js').then(
123
+ loader: async () => import('./esm/index-BnvGScty.esm.js').then(
124
124
  (m) => compatWrapper(
125
125
  /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3 }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(m.ApiDefinitionCard, null)))
126
126
  )
@@ -131,7 +131,7 @@ const apiDocsApisEntityContent = createEntityContentExtension({
131
131
  defaultPath: "/apis",
132
132
  defaultTitle: "APIs",
133
133
  filter: "kind:component",
134
- loader: async () => import('./esm/index-5f0727eb.esm.js').then(
134
+ loader: async () => import('./esm/index-BREvzWXp.esm.js').then(
135
135
  (m) => compatWrapper(
136
136
  /* @__PURE__ */ React.createElement(Grid, { container: true, spacing: 3, alignItems: "stretch" }, /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(m.ProvidedApisCard, null)), /* @__PURE__ */ React.createElement(Grid, { item: true, xs: 12 }, /* @__PURE__ */ React.createElement(m.ConsumedApisCard, null)))
137
137
  )
@@ -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';\n\nimport {\n createApiExtension,\n createApiFactory,\n createNavItemExtension,\n createPageExtension,\n createPlugin,\n createSchemaFromZod,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\n\nimport {\n createEntityCardExtension,\n createEntityContentExtension,\n} from '@backstage/plugin-catalog-react/alpha';\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\nconst apiDocsNavItem = createNavItemExtension({\n title: 'APIs',\n routeRef: convertLegacyRouteRef(rootRoute),\n icon: () => compatWrapper(<AppIcon id=\"kind:api\" />),\n});\n\nconst apiDocsConfigApi = createApiExtension({\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\nconst apiDocsExplorerPage = createPageExtension({\n defaultPath: '/api-docs',\n routeRef: convertLegacyRouteRef(rootRoute),\n // Mapping DefaultApiExplorerPageProps to config\n configSchema: createSchemaFromZod(z =>\n z.object({\n path: z.string().default('/api-docs'),\n initiallySelectedFilter: z.enum(['owned', 'starred', 'all']).optional(),\n // Ommiting columns and actions for now as their types are too complex to map to zod\n }),\n ),\n loader: ({ config }) =>\n import('./components/ApiExplorerPage').then(m =>\n compatWrapper(\n <m.ApiExplorerIndexPage\n initiallySelectedFilter={config.initiallySelectedFilter}\n />,\n ),\n ),\n});\n\nconst apiDocsHasApisEntityCard = createEntityCardExtension({\n name: 'has-apis',\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\nconst apiDocsDefinitionEntityCard = createEntityCardExtension({\n name: 'definition',\n filter: 'kind:api',\n loader: () =>\n import('./components/ApiDefinitionCard').then(m =>\n compatWrapper(<m.ApiDefinitionCard />),\n ),\n});\n\nconst apiDocsConsumedApisEntityCard = createEntityCardExtension({\n name: 'consumed-apis',\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\nconst apiDocsProvidedApisEntityCard = createEntityCardExtension({\n name: 'provided-apis',\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\nconst apiDocsConsumingComponentsEntityCard = createEntityCardExtension({\n name: 'consuming-components',\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\nconst apiDocsProvidingComponentsEntityCard = createEntityCardExtension({\n name: 'providing-components',\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\nconst apiDocsDefinitionEntityContent = createEntityContentExtension({\n name: 'definition',\n defaultPath: '/defintion',\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\nconst apiDocsApisEntityContent = createEntityContentExtension({\n name: 'apis',\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\nexport default createPlugin({\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,iBAAiB,sBAAuB,CAAA;AAAA,EAC5C,KAAO,EAAA,MAAA;AAAA,EACP,QAAA,EAAU,sBAAsB,SAAS,CAAA;AAAA,EACzC,MAAM,MAAM,aAAA,qCAAe,OAAQ,EAAA,EAAA,EAAA,EAAG,YAAW,CAAE,CAAA;AACrD,CAAC,CAAA,CAAA;AAED,MAAM,mBAAmB,kBAAmB,CAAA;AAAA,EAC1C,SAAS,gBAAiB,CAAA;AAAA,IACxB,GAAK,EA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AAA,IACA,oCAAA;AAAA,IACA,oCAAA;AAAA,IACA,8BAAA;AAAA,IACA,wBAAA;AAAA,GACF;AACF,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 React from 'react';\nimport Grid from '@material-ui/core/Grid';\n\nimport {\n createApiExtension,\n createApiFactory,\n createNavItemExtension,\n createPageExtension,\n createPlugin,\n createSchemaFromZod,\n} from '@backstage/frontend-plugin-api';\n\nimport {\n compatWrapper,\n convertLegacyRouteRef,\n} from '@backstage/core-compat-api';\n\nimport {\n createEntityCardExtension,\n createEntityContentExtension,\n} from '@backstage/plugin-catalog-react/alpha';\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\nconst apiDocsNavItem = createNavItemExtension({\n title: 'APIs',\n routeRef: convertLegacyRouteRef(rootRoute),\n icon: () => compatWrapper(<AppIcon id=\"kind:api\" />),\n});\n\nconst apiDocsConfigApi = createApiExtension({\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\nconst apiDocsExplorerPage = createPageExtension({\n defaultPath: '/api-docs',\n routeRef: convertLegacyRouteRef(rootRoute),\n // Mapping DefaultApiExplorerPageProps to config\n configSchema: createSchemaFromZod(z =>\n z.object({\n path: z.string().default('/api-docs'),\n initiallySelectedFilter: z.enum(['owned', 'starred', 'all']).optional(),\n // Ommiting columns and actions for now as their types are too complex to map to zod\n }),\n ),\n loader: ({ config }) =>\n import('./components/ApiExplorerPage').then(m =>\n compatWrapper(\n <m.ApiExplorerIndexPage\n initiallySelectedFilter={config.initiallySelectedFilter}\n />,\n ),\n ),\n});\n\nconst apiDocsHasApisEntityCard = createEntityCardExtension({\n name: 'has-apis',\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\nconst apiDocsDefinitionEntityCard = createEntityCardExtension({\n name: 'definition',\n filter: 'kind:api',\n loader: () =>\n import('./components/ApiDefinitionCard').then(m =>\n compatWrapper(<m.ApiDefinitionCard />),\n ),\n});\n\nconst apiDocsConsumedApisEntityCard = createEntityCardExtension({\n name: 'consumed-apis',\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\nconst apiDocsProvidedApisEntityCard = createEntityCardExtension({\n name: 'provided-apis',\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\nconst apiDocsConsumingComponentsEntityCard = createEntityCardExtension({\n name: 'consuming-components',\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\nconst apiDocsProvidingComponentsEntityCard = createEntityCardExtension({\n name: 'providing-components',\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\nconst apiDocsDefinitionEntityContent = createEntityContentExtension({\n name: 'definition',\n defaultPath: '/defintion',\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\nconst apiDocsApisEntityContent = createEntityContentExtension({\n name: 'apis',\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\nexport default createPlugin({\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,iBAAiB,sBAAuB,CAAA;AAAA,EAC5C,KAAO,EAAA,MAAA;AAAA,EACP,QAAA,EAAU,sBAAsB,SAAS,CAAA;AAAA,EACzC,MAAM,MAAM,aAAA,qCAAe,OAAQ,EAAA,EAAA,EAAA,EAAG,YAAW,CAAE,CAAA;AACrD,CAAC,CAAA,CAAA;AAED,MAAM,mBAAmB,kBAAmB,CAAA;AAAA,EAC1C,SAAS,gBAAiB,CAAA;AAAA,IACxB,GAAK,EAAA,gBAAA;AAAA,IACL,MAAM,EAAC;AAAA,IACP,SAAS,MAAM;AACb,MAAA,MAAM,oBAAoB,wBAAyB,EAAA,CAAA;AACnD,MAAO,OAAA;AAAA,QACL,sBAAA,EAAwB,CAAC,SAAyB,KAAA;AAChD,UAAA,OAAO,kBAAkB,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,IAAS,KAAA,SAAA,CAAU,KAAK,IAAI,CAAA,CAAA;AAAA,SACnE;AAAA,OACF,CAAA;AAAA,KACF;AAAA,GACD,CAAA;AACH,CAAC,CAAA,CAAA;AAED,MAAM,sBAAsB,mBAAoB,CAAA;AAAA,EAC9C,WAAa,EAAA,WAAA;AAAA,EACb,QAAA,EAAU,sBAAsB,SAAS,CAAA;AAAA;AAAA,EAEzC,YAAc,EAAA,mBAAA;AAAA,IAAoB,CAAA,CAAA,KAChC,EAAE,MAAO,CAAA;AAAA,MACP,IAAM,EAAA,CAAA,CAAE,MAAO,EAAA,CAAE,QAAQ,WAAW,CAAA;AAAA,MACpC,uBAAA,EAAyB,EAAE,IAAK,CAAA,CAAC,SAAS,SAAW,EAAA,KAAK,CAAC,CAAA,CAAE,QAAS,EAAA;AAAA;AAAA,KAEvE,CAAA;AAAA,GACH;AAAA,EACA,QAAQ,CAA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AF,EAAA,IAAmB,CACtB,CACF,CAAA;AAAA,KACF;AAAA,GACF;AACJ,CAAC,CAAA,CAAA;AAED,YAAe,YAAa,CAAA;AAAA,EAC1B,EAAI,EAAA,UAAA;AAAA,EACJ,MAAQ,EAAA;AAAA,IACN,IAAA,EAAM,sBAAsB,SAAS,CAAA;AAAA,GACvC;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,WAAA,EAAa,sBAAsB,yBAAyB,CAAA;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,wBAAA;AAAA,GACF;AACF,CAAC,CAAA;;;;"}
@@ -1,8 +1,8 @@
1
1
  import { useEntity } from '@backstage/plugin-catalog-react';
2
- import { Alert } from '@material-ui/lab';
2
+ import Alert from '@material-ui/lab/Alert';
3
3
  import React from 'react';
4
- import { a as apiDocsConfigRef } from './ApiDefinitionWidget-798ee85f.esm.js';
5
- import { P as PlainApiDefinitionWidget } from './ApiTypeTitle-cc79a2f3.esm.js';
4
+ import { a as apiDocsConfigRef } from './ApiDefinitionWidget-B2Z_EBYd.esm.js';
5
+ import { P as PlainApiDefinitionWidget } from './ApiTypeTitle-Q7DWBnfV.esm.js';
6
6
  import { TabbedCard, CardTab } from '@backstage/core-components';
7
7
  import { useApi } from '@backstage/core-plugin-api';
8
8
 
@@ -44,4 +44,4 @@ const ApiDefinitionCard = () => {
44
44
  };
45
45
 
46
46
  export { ApiDefinitionCard as A };
47
- //# sourceMappingURL=ApiDefinitionCard-504c2432.esm.js.map
47
+ //# sourceMappingURL=ApiDefinitionCard-B-gBxw4Y.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApiDefinitionCard-B-gBxw4Y.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 React from 'react';\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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A;AAAA,MACC,KAAO,EAAA,WAAA;AAAA,MACP,QAAU,EAAA;AAAA;AAAA,4CAEP,OAAQ,EAAA,EAAA,KAAA,EAAO,OAAO,IAAK,CAAA,IAAA,EAAM,KAAI,KACpC,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,UAAC,wBAAA;AAAA,UAAA;AAAA,YACC,UAAA,EAAY,OAAO,IAAK,CAAA,UAAA;AAAA,YACxB,QAAA,EAAU,OAAO,IAAK,CAAA,IAAA;AAAA,WAAA;AAAA,SAE1B,CAAA;AAAA,OACF;AAAA,KAAA;AAAA,GACF,CAAA;AAEJ;;;;"}
@@ -16,7 +16,7 @@ const apiDocsConfigRef = createApiRef({
16
16
  });
17
17
 
18
18
  const LazyAsyncApiDefinition = React.lazy(
19
- () => import('./AsyncApiDefinition-ffed9c50.esm.js').then((m) => ({
19
+ () => import('./AsyncApiDefinition-BS46mwIR.esm.js').then((m) => ({
20
20
  default: m.AsyncApiDefinition
21
21
  }))
22
22
  );
@@ -25,7 +25,7 @@ const AsyncApiDefinitionWidget = (props) => {
25
25
  };
26
26
 
27
27
  const LazyGraphQlDefinition = React.lazy(
28
- () => import('./GraphQlDefinition-49cc2c3b.esm.js').then((m) => ({
28
+ () => import('./GraphQlDefinition-D3sN0srb.esm.js').then((m) => ({
29
29
  default: m.GraphQlDefinition
30
30
  }))
31
31
  );
@@ -34,7 +34,7 @@ const GraphQlDefinitionWidget = (props) => {
34
34
  };
35
35
 
36
36
  const LazyOpenApiDefinition = React.lazy(
37
- () => import('./OpenApiDefinition-20ae2e8c.esm.js').then((m) => ({
37
+ () => import('./OpenApiDefinition-P9gI3GDo.esm.js').then((m) => ({
38
38
  default: m.OpenApiDefinition
39
39
  }))
40
40
  );
@@ -113,4 +113,4 @@ function defaultDefinitionWidgets() {
113
113
  }
114
114
 
115
115
  export { AsyncApiDefinitionWidget as A, GraphQlDefinitionWidget as G, OpenApiDefinitionWidget as O, TrpcApiDefinitionWidget as T, apiDocsConfigRef as a, registerComponentRouteRef as b, defaultDefinitionWidgets as d, rootRoute as r };
116
- //# sourceMappingURL=ApiDefinitionWidget-798ee85f.esm.js.map
116
+ //# sourceMappingURL=ApiDefinitionWidget-B2Z_EBYd.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApiDefinitionWidget-798ee85f.esm.js","sources":["../../src/routes.ts","../../src/config.ts","../../src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.tsx","../../src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx","../../src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.tsx","../../src/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.tsx","../../src/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.tsx","../../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 */\n\nimport {\n createExternalRouteRef,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\nexport const rootRoute = createRouteRef({\n id: 'api-docs',\n});\n\nexport const registerComponentRouteRef = createExternalRouteRef({\n id: 'register-component',\n optional: true,\n});\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport { ApiDefinitionWidget } from './components/ApiDefinitionCard/ApiDefinitionWidget';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/** @public */\nexport const apiDocsConfigRef = createApiRef<ApiDocsConfig>({\n id: 'plugin.api-docs.config',\n});\n\n/** @public */\nexport interface ApiDocsConfig {\n getApiDefinitionWidget: (\n apiEntity: ApiEntity,\n ) => ApiDefinitionWidget | undefined;\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The asyncapi component and related CSS has a significant size, only load it\n// if the element is actually used.\nconst LazyAsyncApiDefinition = React.lazy(() =>\n import('./AsyncApiDefinition').then(m => ({\n default: m.AsyncApiDefinition,\n })),\n);\n\n/** @public */\nexport type AsyncApiDefinitionWidgetProps = {\n definition: string;\n};\n\n/** @public */\nexport const AsyncApiDefinitionWidget = (\n props: AsyncApiDefinitionWidgetProps,\n) => {\n return (\n <Suspense fallback={<Progress />}>\n <LazyAsyncApiDefinition {...props} />\n </Suspense>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The graphql component, graphql and related CSS has a significant size, only\n// load it if the element is actually used.\nconst LazyGraphQlDefinition = React.lazy(() =>\n import('./GraphQlDefinition').then(m => ({\n default: m.GraphQlDefinition,\n })),\n);\n\n/** @public */\nexport type GraphQlDefinitionWidgetProps = {\n definition: string;\n};\n\n/** @public */\nexport const GraphQlDefinitionWidget = (\n props: GraphQlDefinitionWidgetProps,\n) => {\n return (\n <Suspense fallback={<Progress />}>\n <LazyGraphQlDefinition {...props} />\n </Suspense>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The swagger-ui component and related CSS has a significant size, only load it\n// if the element is actually used.\nconst LazyOpenApiDefinition = React.lazy(() =>\n import('./OpenApiDefinition').then(m => ({\n default: m.OpenApiDefinition,\n })),\n);\n\n/** @public */\nexport type OpenApiDefinitionWidgetProps = {\n definition: string;\n requestInterceptor?: (req: any) => any | Promise<any>;\n supportedSubmitMethods?: string[];\n};\n\n/** @public */\nexport const OpenApiDefinitionWidget = (\n props: OpenApiDefinitionWidgetProps,\n) => {\n const validSubmitMethods = props.supportedSubmitMethods?.map(method =>\n method.toLocaleLowerCase(),\n );\n return (\n <Suspense fallback={<Progress />}>\n <LazyOpenApiDefinition\n {...props}\n supportedSubmitMethods={validSubmitMethods}\n />\n </Suspense>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { useTheme } from '@material-ui/core/styles';\n\n/** @public */\nexport type GrpcApiDefinitionWidgetProps = {\n definition: string;\n};\n\n/** @public */\nexport const GrpcApiDefinitionWidget = (\n props: GrpcApiDefinitionWidgetProps,\n) => {\n const theme = useTheme();\n return (\n <CodeSnippet\n customStyle={{ backgroundColor: theme.palette.background.default }}\n text={props.definition}\n language=\"protobuf\"\n showCopyCodeButton\n />\n );\n};\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { useTheme } from '@material-ui/core/styles';\n\n/** @public */\nexport type TrpcApiDefinitionWidgetProps = {\n definition: string;\n};\n\n/** @public */\nexport const TrpcApiDefinitionWidget = (\n props: TrpcApiDefinitionWidgetProps,\n) => {\n const { definition } = props;\n const theme = useTheme();\n return (\n <CodeSnippet\n customStyle={{ backgroundColor: theme.palette.background.default }}\n text={definition}\n language=\"typescript\"\n showCopyCodeButton\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React 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) => React.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":";;;;;AAqBO,MAAM,YAAY,cAAe,CAAA;AAAA,EACtC,EAAI,EAAA,UAAA;AACN,CAAC,EAAA;AAEM,MAAM,4BAA4B,sBAAuB,CAAA;AAAA,EAC9D,EAAI,EAAA,oBAAA;AAAA,EACJ,QAAU,EAAA,IAAA;AACZ,CAAC;;ACPM,MAAM,mBAAmB,YA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,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,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA,CAAA;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,KAAA,CAAA,aAAA,CAAA,wBAAA,EAAA,EAAyB,UAAwB,EAAA,CAAA;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,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA,CAAA;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAM,EAAA,MAAA;AAAA,MACN,KAAO,EAAA,MAAA;AAAA,MACP,SAAW,EAAA,CAAA,UAAA,qBACR,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA,CAAA;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAM,EAAA,MAAA;AAAA,MACN,KAAO,EAAA,MAAA;AAAA,MACP,SAAW,EAAA,CAAA,UAAA,qBACR,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA,CAAA;AAAA,KAErD;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"ApiDefinitionWidget-B2Z_EBYd.esm.js","sources":["../../src/routes.ts","../../src/config.ts","../../src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.tsx","../../src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.tsx","../../src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.tsx","../../src/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.tsx","../../src/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.tsx","../../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 */\n\nimport {\n createExternalRouteRef,\n createRouteRef,\n} from '@backstage/core-plugin-api';\n\nexport const rootRoute = createRouteRef({\n id: 'api-docs',\n});\n\nexport const registerComponentRouteRef = createExternalRouteRef({\n id: 'register-component',\n optional: true,\n});\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport { ApiDefinitionWidget } from './components/ApiDefinitionCard/ApiDefinitionWidget';\nimport { createApiRef } from '@backstage/core-plugin-api';\n\n/** @public */\nexport const apiDocsConfigRef = createApiRef<ApiDocsConfig>({\n id: 'plugin.api-docs.config',\n});\n\n/** @public */\nexport interface ApiDocsConfig {\n getApiDefinitionWidget: (\n apiEntity: ApiEntity,\n ) => ApiDefinitionWidget | undefined;\n}\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The asyncapi component and related CSS has a significant size, only load it\n// if the element is actually used.\nconst LazyAsyncApiDefinition = React.lazy(() =>\n import('./AsyncApiDefinition').then(m => ({\n default: m.AsyncApiDefinition,\n })),\n);\n\n/** @public */\nexport type AsyncApiDefinitionWidgetProps = {\n definition: string;\n};\n\n/** @public */\nexport const AsyncApiDefinitionWidget = (\n props: AsyncApiDefinitionWidgetProps,\n) => {\n return (\n <Suspense fallback={<Progress />}>\n <LazyAsyncApiDefinition {...props} />\n </Suspense>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The graphql component, graphql and related CSS has a significant size, only\n// load it if the element is actually used.\nconst LazyGraphQlDefinition = React.lazy(() =>\n import('./GraphQlDefinition').then(m => ({\n default: m.GraphQlDefinition,\n })),\n);\n\n/** @public */\nexport type GraphQlDefinitionWidgetProps = {\n definition: string;\n};\n\n/** @public */\nexport const GraphQlDefinitionWidget = (\n props: GraphQlDefinitionWidgetProps,\n) => {\n return (\n <Suspense fallback={<Progress />}>\n <LazyGraphQlDefinition {...props} />\n </Suspense>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Progress } from '@backstage/core-components';\nimport React, { Suspense } from 'react';\n\n// The swagger-ui component and related CSS has a significant size, only load it\n// if the element is actually used.\nconst LazyOpenApiDefinition = React.lazy(() =>\n import('./OpenApiDefinition').then(m => ({\n default: m.OpenApiDefinition,\n })),\n);\n\n/** @public */\nexport type OpenApiDefinitionWidgetProps = {\n definition: string;\n requestInterceptor?: (req: any) => any | Promise<any>;\n supportedSubmitMethods?: string[];\n};\n\n/** @public */\nexport const OpenApiDefinitionWidget = (\n props: OpenApiDefinitionWidgetProps,\n) => {\n const validSubmitMethods = props.supportedSubmitMethods?.map(method =>\n method.toLocaleLowerCase(),\n );\n return (\n <Suspense fallback={<Progress />}>\n <LazyOpenApiDefinition\n {...props}\n supportedSubmitMethods={validSubmitMethods}\n />\n </Suspense>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { useTheme } from '@material-ui/core/styles';\n\n/** @public */\nexport type GrpcApiDefinitionWidgetProps = {\n definition: string;\n};\n\n/** @public */\nexport const GrpcApiDefinitionWidget = (\n props: GrpcApiDefinitionWidgetProps,\n) => {\n const theme = useTheme();\n return (\n <CodeSnippet\n customStyle={{ backgroundColor: theme.palette.background.default }}\n text={props.definition}\n language=\"protobuf\"\n showCopyCodeButton\n />\n );\n};\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\nimport { useTheme } from '@material-ui/core/styles';\n\n/** @public */\nexport type TrpcApiDefinitionWidgetProps = {\n definition: string;\n};\n\n/** @public */\nexport const TrpcApiDefinitionWidget = (\n props: TrpcApiDefinitionWidgetProps,\n) => {\n const { definition } = props;\n const theme = useTheme();\n return (\n <CodeSnippet\n customStyle={{ backgroundColor: theme.palette.background.default }}\n text={definition}\n language=\"typescript\"\n showCopyCodeButton\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport React 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) => React.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":";;;;;AAqBO,MAAM,YAAY,cAAe,CAAA;AAAA,EACtC,EAAI,EAAA,UAAA;AACN,CAAC,EAAA;AAEM,MAAM,4BAA4B,sBAAuB,CAAA;AAAA,EAC9D,EAAI,EAAA,oBAAA;AAAA,EACJ,QAAU,EAAA,IAAA;AACZ,CAAC;;ACPM,MAAM,mBAAmB,YAA4B,CAAA;AAAA,EAC1D,EAAI,EAAA,wBAAA;AACN,CAAC;;ACFD,MAAM,yBAAyB,KAAM,CAAA,IAAA;AAAA,EAAK,MACxC,OAAO,sCAAsB,CAAA,CAAE,KAAK,CAAM,CAAA,MAAA;AAAA,IACxC,SAAS,CAAE,CAAA,kBAAA;AAAA,GACX,CAAA,CAAA;AACJ,CAAA,CAAA;AAQa,MAAA,wBAAA,GAA2B,CACtC,KACG,KAAA;AACH,EACE,uBAAA,KAAA,CA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,UAAA;AAAA,MACP,WAAa,EAAA,MAAA;AAAA,MACb,SAAW,EAAA,CAAA,UAAA,qBACR,KAAA,CAAA,aAAA,CAAA,wBAAA,EAAA,EAAyB,UAAwB,EAAA,CAAA;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,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA,CAAA;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAM,EAAA,MAAA;AAAA,MACN,KAAO,EAAA,MAAA;AAAA,MACP,SAAW,EAAA,CAAA,UAAA,qBACR,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA,CAAA;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAM,EAAA,MAAA;AAAA,MACN,KAAO,EAAA,MAAA;AAAA,MACP,SAAW,EAAA,CAAA,UAAA,qBACR,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA,EAAwB,UAAwB,EAAA,CAAA;AAAA,KAErD;AAAA,GACF,CAAA;AACF;;;;"}
@@ -4,7 +4,7 @@ import { PageWithHeader, Content, ContentHeader, CreateButton, SupportButton } f
4
4
  import { useApi, configApiRef, useRouteRef } from '@backstage/core-plugin-api';
5
5
  import { CatalogTable } from '@backstage/plugin-catalog';
6
6
  import { EntityListProvider, CatalogFilterLayout, EntityKindPicker, EntityTypePicker, UserListPicker, EntityOwnerPicker, EntityLifecyclePicker, EntityTagPicker } from '@backstage/plugin-catalog-react';
7
- import { b as registerComponentRouteRef } from './ApiDefinitionWidget-798ee85f.esm.js';
7
+ import { b as registerComponentRouteRef } from './ApiDefinitionWidget-B2Z_EBYd.esm.js';
8
8
  import { usePermission } from '@backstage/plugin-permission-react';
9
9
  import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';
10
10
 
@@ -57,4 +57,4 @@ const ApiExplorerPage = (props) => {
57
57
  };
58
58
 
59
59
  export { ApiExplorerPage as A, DefaultApiExplorerPage as D };
60
- //# sourceMappingURL=ApiExplorerPage-ce544a95.esm.js.map
60
+ //# sourceMappingURL=ApiExplorerPage-DN8sGDDe.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApiExplorerPage-ce544a95.esm.js","sources":["../../src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx","../../src/components/ApiExplorerPage/ApiExplorerPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Content,\n ContentHeader,\n CreateButton,\n PageWithHeader,\n SupportButton,\n TableColumn,\n TableProps,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport { CatalogTable, CatalogTableRow } from '@backstage/plugin-catalog';\nimport {\n EntityKindPicker,\n EntityLifecyclePicker,\n EntityListProvider,\n EntityOwnerPicker,\n EntityTagPicker,\n EntityTypePicker,\n UserListFilterKind,\n UserListPicker,\n CatalogFilterLayout,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { registerComponentRouteRef } from '../../routes';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';\n\nconst defaultColumns: TableColumn<CatalogTableRow>[] = [\n CatalogTable.columns.createTitleColumn({ hidden: true }),\n CatalogTable.columns.createNameColumn({ defaultKind: 'API' }),\n CatalogTable.columns.createSystemColumn(),\n CatalogTable.columns.createOwnerColumn(),\n CatalogTable.columns.createSpecTypeColumn(),\n CatalogTable.columns.createSpecLifecycleColumn(),\n CatalogTable.columns.createMetadataDescriptionColumn(),\n CatalogTable.columns.createTagsColumn(),\n];\n\n/**\n * DefaultApiExplorerPageProps\n * @public\n */\nexport type DefaultApiExplorerPageProps = {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[];\n actions?: TableProps<CatalogTableRow>['actions'];\n};\n\n/**\n * DefaultApiExplorerPage\n * @public\n */\nexport const DefaultApiExplorerPage = (props: DefaultApiExplorerPageProps) => {\n const { initiallySelectedFilter = 'all', columns, actions } = props;\n\n const configApi = useApi(configApiRef);\n const generatedSubtitle = `${\n configApi.getOptionalString('organization.name') ?? 'Backstage'\n } API Explorer`;\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n\n return (\n <PageWithHeader\n themeId=\"apis\"\n title=\"APIs\"\n subtitle={generatedSubtitle}\n pageTitleOverride=\"APIs\"\n >\n <Content>\n <ContentHeader title=\"\">\n {allowed && (\n <CreateButton\n title=\"Register Existing API\"\n to={registerComponentLink?.()}\n />\n )}\n <SupportButton>All your APIs</SupportButton>\n </ContentHeader>\n <EntityListProvider>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>\n <EntityKindPicker initialFilter=\"api\" hidden />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n </CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>\n <CatalogTable\n columns={columns || defaultColumns}\n actions={actions}\n />\n </CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n </Content>\n </PageWithHeader>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { useOutlet } from 'react-router-dom';\nimport {\n DefaultApiExplorerPage,\n DefaultApiExplorerPageProps,\n} from './DefaultApiExplorerPage';\n\n/**\n * ApiExplorerPage\n * @public\n */\nexport const ApiExplorerPage = (props: DefaultApiExplorerPageProps) => {\n const outlet = useOutlet();\n\n return outlet || <DefaultApiExplorerPage {...props} />;\n};\n"],"names":[],"mappings":";;;;;;;;;;AA2CA,MAAM,cAAiD,GAAA;AAAA,EACrD,aAAa,OAAQ,CAAA,iBAAA,CAAkB,EAAE,MAAA,EAAQ,MAAM,CAAA;AAAA,EACvD,aAAa,OAAQ,CAAA,gBAAA,CAAiB,EAAE,WAAA,EAAa,OAAO,CAAA;AAAA,EAC5D,YAAA,CAAa,QAAQ,kBAAmB,EAAA;AAAA,EACxC,YAAA,CAAa,QAAQ,iBAAkB,EAAA;AAAA,EACvC,YAAA,CAAa,QAAQ,oBAAqB,EAAA;AAAA,EAC1C,YAAA,CAAa,QAAQ,yBAA0B,EAAA;AAAA,EAC/C,YAAA,CAAa,QAAQ,+BAAgC,EAAA;AAAA,EACrD,YAAA,CAAa,QAAQ,gBAAiB,EAAA;AACxC,CAAA,CAAA;AAgBa,MAAA,sBAAA,GAAyB,CAAC,KAAuC,KAAA;AApE9E,EAAA,IAAA,EAAA,CAAA;AAqEE,EAAA,MAAM,EAAE,uBAAA,GAA0B,KAAO,EAAA,OAAA,EAAS,SAAY,GAAA,KAAA,CAAA;AAE9D,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA,CAAA;AACrC,EAAA,MAAM,oBAAoB,CACxB,EAAA,CAAA,EAAA,GAAA,SAAA,CAAU,kBAAkB,mBAAmB,CAAA,KAA/C,Y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,SAApB,IACC,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,SAAS,OAAW,IAAA,cAAA;AAAA,QACpB,OAAA;AAAA,OAAA;AAAA,KAEJ,CACF,CACF,CACF,CAAA;AAAA,GACF,CAAA;AAEJ;;AC3Fa,MAAA,eAAA,GAAkB,CAAC,KAAuC,KAAA;AACrE,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AAEzB,EAAA,OAAO,MAAU,oBAAA,KAAA,CAAA,aAAA,CAAC,sBAAwB,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA,CAAA;AACtD;;;;"}
1
+ {"version":3,"file":"ApiExplorerPage-DN8sGDDe.esm.js","sources":["../../src/components/ApiExplorerPage/DefaultApiExplorerPage.tsx","../../src/components/ApiExplorerPage/ApiExplorerPage.tsx"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Content,\n ContentHeader,\n CreateButton,\n PageWithHeader,\n SupportButton,\n TableColumn,\n TableProps,\n} from '@backstage/core-components';\nimport { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api';\nimport { CatalogTable, CatalogTableRow } from '@backstage/plugin-catalog';\nimport {\n EntityKindPicker,\n EntityLifecyclePicker,\n EntityListProvider,\n EntityOwnerPicker,\n EntityTagPicker,\n EntityTypePicker,\n UserListFilterKind,\n UserListPicker,\n CatalogFilterLayout,\n} from '@backstage/plugin-catalog-react';\nimport React from 'react';\nimport { registerComponentRouteRef } from '../../routes';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';\n\nconst defaultColumns: TableColumn<CatalogTableRow>[] = [\n CatalogTable.columns.createTitleColumn({ hidden: true }),\n CatalogTable.columns.createNameColumn({ defaultKind: 'API' }),\n CatalogTable.columns.createSystemColumn(),\n CatalogTable.columns.createOwnerColumn(),\n CatalogTable.columns.createSpecTypeColumn(),\n CatalogTable.columns.createSpecLifecycleColumn(),\n CatalogTable.columns.createMetadataDescriptionColumn(),\n CatalogTable.columns.createTagsColumn(),\n];\n\n/**\n * DefaultApiExplorerPageProps\n * @public\n */\nexport type DefaultApiExplorerPageProps = {\n initiallySelectedFilter?: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[];\n actions?: TableProps<CatalogTableRow>['actions'];\n};\n\n/**\n * DefaultApiExplorerPage\n * @public\n */\nexport const DefaultApiExplorerPage = (props: DefaultApiExplorerPageProps) => {\n const { initiallySelectedFilter = 'all', columns, actions } = props;\n\n const configApi = useApi(configApiRef);\n const generatedSubtitle = `${\n configApi.getOptionalString('organization.name') ?? 'Backstage'\n } API Explorer`;\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n\n return (\n <PageWithHeader\n themeId=\"apis\"\n title=\"APIs\"\n subtitle={generatedSubtitle}\n pageTitleOverride=\"APIs\"\n >\n <Content>\n <ContentHeader title=\"\">\n {allowed && (\n <CreateButton\n title=\"Register Existing API\"\n to={registerComponentLink?.()}\n />\n )}\n <SupportButton>All your APIs</SupportButton>\n </ContentHeader>\n <EntityListProvider>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>\n <EntityKindPicker initialFilter=\"api\" hidden />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n </CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>\n <CatalogTable\n columns={columns || defaultColumns}\n actions={actions}\n />\n </CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n </Content>\n </PageWithHeader>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { useOutlet } from 'react-router-dom';\nimport {\n DefaultApiExplorerPage,\n DefaultApiExplorerPageProps,\n} from './DefaultApiExplorerPage';\n\n/**\n * ApiExplorerPage\n * @public\n */\nexport const ApiExplorerPage = (props: DefaultApiExplorerPageProps) => {\n const outlet = useOutlet();\n\n return outlet || <DefaultApiExplorerPage {...props} />;\n};\n"],"names":[],"mappings":";;;;;;;;;;AA2CA,MAAM,cAAiD,GAAA;AAAA,EACrD,aAAa,OAAQ,CAAA,iBAAA,CAAkB,EAAE,MAAA,EAAQ,MAAM,CAAA;AAAA,EACvD,aAAa,OAAQ,CAAA,gBAAA,CAAiB,EAAE,WAAA,EAAa,OAAO,CAAA;AAAA,EAC5D,YAAA,CAAa,QAAQ,kBAAmB,EAAA;AAAA,EACxC,YAAA,CAAa,QAAQ,iBAAkB,EAAA;AAAA,EACvC,YAAA,CAAa,QAAQ,oBAAqB,EAAA;AAAA,EAC1C,YAAA,CAAa,QAAQ,yBAA0B,EAAA;AAAA,EAC/C,YAAA,CAAa,QAAQ,+BAAgC,EAAA;AAAA,EACrD,YAAA,CAAa,QAAQ,gBAAiB,EAAA;AACxC,CAAA,CAAA;AAgBa,MAAA,sBAAA,GAAyB,CAAC,KAAuC,KAAA;AApE9E,EAAA,IAAA,EAAA,CAAA;AAqEE,EAAA,MAAM,EAAE,uBAAA,GAA0B,KAAO,EAA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CAAA,cAAA,EAAA,EAAe,eAAe,uBAAyB,EAAA,CAAA,sCACvD,iBAAkB,EAAA,IAAA,CAAA,sCAClB,qBAAsB,EAAA,IAAA,CAAA,sCACtB,eAAgB,EAAA,IAAA,CACnB,mBACC,KAAA,CAAA,aAAA,CAAA,mBAAA,CAAoB,SAApB,IACC,kBAAA,KAAA,CAAA,aAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,SAAS,OAAW,IAAA,cAAA;AAAA,QACpB,OAAA;AAAA,OAAA;AAAA,KAEJ,CACF,CACF,CACF,CAAA;AAAA,GACF,CAAA;AAEJ;;AC3Fa,MAAA,eAAA,GAAkB,CAAC,KAAuC,KAAA;AACrE,EAAA,MAAM,SAAS,SAAU,EAAA,CAAA;AAEzB,EAAA,OAAO,MAAU,oBAAA,KAAA,CAAA,aAAA,CAAC,sBAAwB,EAAA,EAAA,GAAG,KAAO,EAAA,CAAA,CAAA;AACtD;;;;"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { CodeSnippet } from '@backstage/core-components';
3
3
  import Typography from '@material-ui/core/Typography';
4
- import { a as apiDocsConfigRef } from './ApiDefinitionWidget-798ee85f.esm.js';
4
+ import { a as apiDocsConfigRef } from './ApiDefinitionWidget-B2Z_EBYd.esm.js';
5
5
  import { useApi } from '@backstage/core-plugin-api';
6
6
 
7
7
  const PlainApiDefinitionWidget = (props) => {
@@ -24,4 +24,4 @@ const ApiTypeTitle = (props) => {
24
24
  };
25
25
 
26
26
  export { ApiTypeTitle as A, PlainApiDefinitionWidget as P };
27
- //# sourceMappingURL=ApiTypeTitle-cc79a2f3.esm.js.map
27
+ //# sourceMappingURL=ApiTypeTitle-Q7DWBnfV.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApiTypeTitle-cc79a2f3.esm.js","sources":["../../src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx","../../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 React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\n/** @public */\nexport type PlainApiDefinitionWidgetProps = {\n definition: any;\n language: string;\n};\n\n/** @public */\nexport const PlainApiDefinitionWidget = (\n props: PlainApiDefinitionWidgetProps,\n) => {\n return (\n <CodeSnippet\n text={props.definition}\n language={props.language}\n showCopyCodeButton\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport React from 'react';\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 <Typography component=\"span\">{type}</Typography>;\n};\n"],"names":[],"mappings":";;;;;;AA0Ba,MAAA,wBAAA,GAA2B,CACtC,KACG,KAAA;AACH,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,MAAM,KAAM,CAAA,UAAA;AAAA,MACZ,UAAU,KAAM,CAAA,QAAA;AAAA,MAChB,kBAAkB,EAAA,IAAA;AAAA,KAAA;AAAA,GACpB,CAAA;AAEJ;;ACXa,MAAA,YAAA,GAAe,CAAC,KAAoC,KAAA;AAC/D,EAAM,MAAA,EAAE,WAAc,GAAA,KAAA,CAAA;AACtB,EAAM,MAAA,MAAA,GAAS,OAAO,gBAAgB,CAAA,CAAA;AACtC,EAAM,MAAA,UAAA,GAAa,MAAO,CAAA,sBAAA,CAAuB,SAAS,CAAA,CAAA;AAC1D,EAAA,MAAM,IAAO,GAAA,UAAA,GAAa,UAAW,CAAA,KAAA,GAAQ,UAAU,IAAK,CAAA,IAAA,CAAA;AAE5D,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAU,EAAA,MAAA,EAAA,EAAQ,IAAK,CAAA,CAAA;AAC5C;;;;"}
1
+ {"version":3,"file":"ApiTypeTitle-Q7DWBnfV.esm.js","sources":["../../src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.tsx","../../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 React from 'react';\nimport { CodeSnippet } from '@backstage/core-components';\n\n/** @public */\nexport type PlainApiDefinitionWidgetProps = {\n definition: any;\n language: string;\n};\n\n/** @public */\nexport const PlainApiDefinitionWidget = (\n props: PlainApiDefinitionWidgetProps,\n) => {\n return (\n <CodeSnippet\n text={props.definition}\n language={props.language}\n showCopyCodeButton\n />\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport React from 'react';\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 <Typography component=\"span\">{type}</Typography>;\n};\n"],"names":[],"mappings":";;;;;;AA0Ba,MAAA,wBAAA,GAA2B,CACtC,KACG,KAAA;AACH,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,MAAM,KAAM,CAAA,UAAA;AAAA,MACZ,UAAU,KAAM,CAAA,QAAA;AAAA,MAChB,kBAAkB,EAAA,IAAA;AAAA,KAAA;AAAA,GACpB,CAAA;AAEJ;;ACXa,MAAA,YAAA,GAAe,CAAC,KAAoC,KAAA;AAC/D,EAAM,MAAA,EAAE,WAAc,GAAA,KAAA,CAAA;AACtB,EAAM,MAAA,MAAA,GAAS,OAAO,gBAAgB,CAAA,CAAA;AACtC,EAAM,MAAA,UAAA,GAAa,MAAO,CAAA,sBAAA,CAAuB,SAAS,CAAA,CAAA;AAC1D,EAAA,MAAM,IAAO,GAAA,UAAA,GAAa,UAAW,CAAA,KAAA,GAAQ,UAAU,IAAK,CAAA,IAAA,CAAA;AAE5D,EAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,EAAW,SAAU,EAAA,MAAA,EAAA,EAAQ,IAAK,CAAA,CAAA;AAC5C;;;;"}
@@ -1,8 +1,7 @@
1
1
  import AsyncApi from '@asyncapi/react-component';
2
2
  import '@asyncapi/react-component/styles/default.css';
3
- import { makeStyles, alpha, darken } from '@material-ui/core/styles';
3
+ import { makeStyles, alpha, darken, useTheme } from '@material-ui/core/styles';
4
4
  import React from 'react';
5
- import { useTheme } from '@material-ui/core';
6
5
 
7
6
  const useStyles = makeStyles((theme) => ({
8
7
  root: {
@@ -161,4 +160,4 @@ const AsyncApiDefinition = ({ definition }) => {
161
160
  };
162
161
 
163
162
  export { AsyncApiDefinition };
164
- //# sourceMappingURL=AsyncApiDefinition-ffed9c50.esm.js.map
163
+ //# sourceMappingURL=AsyncApiDefinition-BS46mwIR.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AsyncApiDefinition-BS46mwIR.esm.js","sources":["../../src/components/AsyncApiDefinitionWidget/AsyncApiDefinition.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 AsyncApi from '@asyncapi/react-component';\nimport '@asyncapi/react-component/styles/default.css';\nimport { makeStyles, alpha, darken } from '@material-ui/core/styles';\nimport React from 'react';\nimport { useTheme } from '@material-ui/core/styles';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n fontFamily: 'inherit',\n '& .bg-white': {\n background: 'none',\n },\n '& .text-4xl': {\n ...theme.typography.h3,\n },\n ' & h2': {\n ...theme.typography.h4,\n },\n '& .border': {\n borderColor: alpha(theme.palette.border, 0.1),\n },\n '& .min-w-min': {\n minWidth: 'fit-content',\n },\n '& .examples': {\n padding: '1rem',\n },\n '& .bg-teal-500': {\n backgroundColor: theme.palette.status.ok,\n },\n '& .bg-blue-500': {\n backgroundColor: theme.palette.info.main,\n },\n '& .bg-blue-400': {\n backgroundColor: theme.palette.info.light,\n },\n '& .bg-indigo-400': {\n backgroundColor: theme.palette.warning.main,\n },\n '& .text-teal-50': {\n color: theme.palette.status.ok,\n },\n '& .text-red-600': {\n color: theme.palette.error.main,\n },\n '& .text-orange-600': {\n color: theme.palette.warning.main,\n },\n '& .text-teal-500': {\n color: theme.palette.status.ok,\n },\n '& .text-blue-500': {\n color: theme.palette.info.main,\n },\n '& .-rotate-90': {\n '--tw-rotate': '0deg',\n },\n '& button': {\n ...theme.typography.button,\n borderRadius: theme.shape.borderRadius,\n color: theme.palette.primary.main,\n // override whatever may be in the theme's typography to ensure consistency with asyncapi\n textTransform: 'inherit',\n },\n '& a': {\n color: theme.palette.link,\n },\n '& a.no-underline': {\n ...theme.typography.button,\n background: 'none',\n boxSizing: 'border-box',\n minWidth: 64,\n borderRadius: theme.shape.borderRadius,\n transition: theme.transitions.create(\n ['background-color', 'box-shadow', 'border'],\n {\n duration: theme.transitions.duration.short,\n },\n ),\n padding: '5px 15px',\n color: theme.palette.primary.main,\n border: `1px solid ${alpha(theme.palette.primary.main, 0.5)}`,\n '&:hover': {\n textDecoration: 'none',\n border: `1px solid ${theme.palette.primary.main}`,\n backgroundColor: alpha(\n theme.palette.primary.main,\n theme.palette.action.hoverOpacity,\n ),\n },\n },\n '& li.no-underline': {\n '& a': {\n textDecoration: 'none',\n color: theme.palette.getContrastText(theme.palette.primary.main),\n },\n },\n },\n dark: {\n '& svg': {\n fill: theme.palette.text.primary,\n },\n '& .prose': {\n color: theme.palette.text.secondary,\n '& h3': {\n color: theme.palette.text.primary,\n },\n },\n '& .bg-gray-100, .bg-gray-200': {\n backgroundColor: theme.palette.background.default,\n },\n '& .text-gray-600': {\n color: theme.palette.grey['50'],\n },\n '& .text-gray-700': {\n color: theme.palette.grey['100'],\n },\n '& .panel--right': {\n background: darken(theme.palette.navigation.background, 0.1),\n },\n '& .examples': {\n backgroundColor: darken(theme.palette.navigation.background, 0.1),\n '& pre': {\n backgroundColor: darken(theme.palette.background.default, 0.2),\n },\n },\n },\n}));\n\nconst httpsFetchResolver = {\n schema: 'https',\n order: 1,\n canRead: true,\n async read(uri: any) {\n const response = await fetch(uri.toString());\n return response.text();\n },\n};\n\nconst httpFetchResolver = {\n schema: 'http',\n order: 1,\n canRead: true,\n async read(uri: any) {\n const response = await fetch(uri.toString());\n return response.text();\n },\n};\n\nconst config = {\n parserOptions: {\n __unstable: {\n resolver: {\n resolvers: [httpsFetchResolver, httpFetchResolver],\n },\n },\n },\n};\n\ntype Props = {\n definition: string;\n};\n\nexport const AsyncApiDefinition = ({ definition }: Props): JSX.Element => {\n const classes = useStyles();\n const theme = useTheme();\n const classNames = `${classes.root} ${\n theme.palette.type === 'dark' ? classes.dark : ''\n }`;\n\n return (\n <div className={classNames}>\n <AsyncApi schema={definition} config={config} />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AAsBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,UAAY,EAAA,SAAA;AAAA,IACZ,aAAe,EAAA;AAAA,MACb,UAAY,EAAA,MAAA;AAAA,KACd;AAAA,IACA,aAAe,EAAA;AAAA,MACb,GAAG,MAAM,UAAW,CAAA,EAAA;AAAA,KACtB;AAAA,IACA,OAAS,EAAA;AAAA,MACP,GAAG,MAAM,UAAW,CAAA,EAAA;AAAA,KACtB;AAAA,IACA,WAAa,EAAA;AAAA,MACX,WAAa,EAAA,KAAA,CAAM,KAAM,CAAA,OAAA,CAAQ,QAAQ,GAAG,CAAA;AAAA,KAC9C;AAAA,IACA,cAAgB,EAAA;AAA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AEJ;;;;"}
@@ -39,4 +39,4 @@ const GraphQlDefinition = ({ definition }) => {
39
39
  };
40
40
 
41
41
  export { GraphQlDefinition };
42
- //# sourceMappingURL=GraphQlDefinition-49cc2c3b.esm.js.map
42
+ //# sourceMappingURL=GraphQlDefinition-D3sN0srb.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GraphQlDefinition-49cc2c3b.esm.js","sources":["../../src/components/GraphQlDefinitionWidget/GraphQlDefinition.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 { makeStyles } from '@material-ui/core/styles';\nimport {\n DocExplorer,\n EditorContextProvider,\n ExplorerContextProvider,\n SchemaContextProvider,\n} from '@graphiql/react';\nimport 'graphiql/graphiql.css';\nimport { buildSchema } from 'graphql';\nimport React from 'react';\n\nconst useStyles = makeStyles({\n root: {\n height: '100%',\n display: 'flex',\n flexFlow: 'column nowrap',\n },\n graphiQlWrapper: {\n flex: 1,\n '@global': {\n '.graphiql-container': {\n boxSizing: 'initial',\n height: '100%',\n minHeight: '600px',\n flex: '1 1 auto',\n },\n '.graphiql-sidebar': {\n width: '100%',\n },\n },\n },\n});\n\ntype Props = {\n definition: string;\n};\n\nexport const GraphQlDefinition = ({ definition }: Props) => {\n const classes = useStyles();\n const schema = buildSchema(definition);\n\n return (\n <div className={classes.root}>\n <div className={classes.graphiQlWrapper}>\n <EditorContextProvider>\n <SchemaContextProvider\n schema={schema}\n fetcher={() => Promise.resolve(null) as any}\n >\n <div className=\"graphiql-container\">\n <div className=\"graphiql-sidebar\">\n <div className=\"graphiql-sidebar-section\">\n <ExplorerContextProvider>\n <DocExplorer />\n </ExplorerContextProvider>\n </div>\n </div>\n </div>\n </SchemaContextProvider>\n </EditorContextProvider>\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AA2BA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,IAAM,EAAA;AAAA,IACJ,MAAQ,EAAA,MAAA;AAAA,IACR,OAAS,EAAA,MAAA;AAAA,IACT,QAAU,EAAA,eAAA;AAAA,GACZ;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,IAAM,EAAA,CAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,qBAAuB,EAAA;AAAA,QACrB,SAAW,EAAA,SAAA;AAAA,QACX,MAAQ,EAAA,MAAA;AAAA,QACR,SAAW,EAAA,OAAA;AAAA,QACX,IAAM,EAAA,UAAA;AAAA,OACR;AAAA,MACA,mBAAqB,EAAA;AAAA,QACnB,KAAO,EAAA,MAAA;AAAA,OACT;AAAA,KACF;AAAA,GACF;AACF,CAAC,CAAA,CAAA;AAMM,MAAM,iBAAoB,GAAA,CAAC,EAAE,UAAA,EAAwB,KAAA;AAC1D,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,MAAA,GAAS,YAAY,UAAU,CAAA,CAAA;AAErC,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,IAAA,EAAA,kBACrB,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,eACtB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,qBACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,qBAAA;AAAA,IAAA;AAAA,MACC,MAAA;AAAA,MACA,OAAS,EAAA,MAAM,OAAQ,CAAA,OAAA,CAAQ,IAAI,CAAA;AAAA,KAAA;AAAA,wCAElC,KAAI,EAAA,EAAA,SAAA,EAAU,wCACZ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,WAAU,kBACb,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,SAAI,SAAU,EAAA,0BAAA,EAAA,sCACZ,uBACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,iBAAY,CACf,CACF,CACF,CACF,CAAA;AAAA,GAEJ,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"GraphQlDefinition-D3sN0srb.esm.js","sources":["../../src/components/GraphQlDefinitionWidget/GraphQlDefinition.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 { makeStyles } from '@material-ui/core/styles';\nimport {\n DocExplorer,\n EditorContextProvider,\n ExplorerContextProvider,\n SchemaContextProvider,\n} from '@graphiql/react';\nimport 'graphiql/graphiql.css';\nimport { buildSchema } from 'graphql';\nimport React from 'react';\n\nconst useStyles = makeStyles({\n root: {\n height: '100%',\n display: 'flex',\n flexFlow: 'column nowrap',\n },\n graphiQlWrapper: {\n flex: 1,\n '@global': {\n '.graphiql-container': {\n boxSizing: 'initial',\n height: '100%',\n minHeight: '600px',\n flex: '1 1 auto',\n },\n '.graphiql-sidebar': {\n width: '100%',\n },\n },\n },\n});\n\ntype Props = {\n definition: string;\n};\n\nexport const GraphQlDefinition = ({ definition }: Props) => {\n const classes = useStyles();\n const schema = buildSchema(definition);\n\n return (\n <div className={classes.root}>\n <div className={classes.graphiQlWrapper}>\n <EditorContextProvider>\n <SchemaContextProvider\n schema={schema}\n fetcher={() => Promise.resolve(null) as any}\n >\n <div className=\"graphiql-container\">\n <div className=\"graphiql-sidebar\">\n <div className=\"graphiql-sidebar-section\">\n <ExplorerContextProvider>\n <DocExplorer />\n </ExplorerContextProvider>\n </div>\n </div>\n </div>\n </SchemaContextProvider>\n </EditorContextProvider>\n </div>\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AA2BA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,IAAM,EAAA;AAAA,IACJ,MAAQ,EAAA,MAAA;AAAA,IACR,OAAS,EAAA,MAAA;AAAA,IACT,QAAU,EAAA,eAAA;AAAA,GACZ;AAAA,EACA,eAAiB,EAAA;AAAA,IACf,IAAM,EAAA,CAAA;AAAA,IACN,SAAW,EAAA;AAAA,MACT,qBAAuB,EAAA;AAAA,QACrB,SAAW,EAAA,SAAA;AAAA,QACX,MAAQ,EAAA,MAAA;AAAA,QACR,SAAW,EAAA,OAAA;AAAA,QACX,IAAM,EAAA,UAAA;AAAA,OACR;AAAA,MACA,mBAAqB,EAAA;AAAA,QACnB,KAAO,EAAA,MAAA;AAAA,OACT;AAAA,KACF;AAAA,GACF;AACF,CAAC,CAAA,CAAA;AAMM,MAAM,iBAAoB,GAAA,CAAC,EAAE,UAAA,EAAwB,KAAA;AAC1D,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAM,MAAA,MAAA,GAAS,YAAY,UAAU,CAAA,CAAA;AAErC,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,IAAA,EAAA,kBACrB,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,eACtB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,qBACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,qBAAA;AAAA,IAAA;AAAA,MACC,MAAA;AAAA,MACA,OAAS,EAAA,MAAM,OAAQ,CAAA,OAAA,CAAQ,IAAI,CAAA;AAAA,KAAA;AAAA,wCAElC,KAAI,EAAA,EAAA,SAAA,EAAU,wCACZ,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,WAAU,kBACb,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,SAAI,SAAU,EAAA,0BAAA,EAAA,sCACZ,uBACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,iBAAY,CACf,CACF,CACF,CACF,CAAA;AAAA,GAEJ,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -139,4 +139,4 @@ const OpenApiDefinition = ({
139
139
  };
140
140
 
141
141
  export { OpenApiDefinition };
142
- //# sourceMappingURL=OpenApiDefinition-20ae2e8c.esm.js.map
142
+ //# sourceMappingURL=OpenApiDefinition-P9gI3GDo.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenApiDefinition-20ae2e8c.esm.js","sources":["../../src/components/OpenApiDefinitionWidget/OpenApiDefinition.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 { makeStyles } from '@material-ui/core/styles';\nimport React, { useEffect, useState } from 'react';\nimport SwaggerUI, { SwaggerUIProps } from 'swagger-ui-react';\nimport 'swagger-ui-react/swagger-ui.css';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n '& .swagger-ui': {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n\n ['& .btn-clear']: {\n color: theme.palette.text.primary,\n },\n [`& .scheme-container`]: {\n backgroundColor: theme.palette.background.default,\n },\n [`& .opblock-tag,\n .opblock-tag small,\n table thead tr td,\n table thead tr th`]: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n borderColor: theme.palette.divider,\n },\n [`& section.models,\n section.models.is-open h4`]: {\n borderColor: theme.palette.divider,\n },\n [`& .model-title,\n .model .renderedMarkdown,\n .model .description`]: {\n fontFamily: theme.typography.fontFamily,\n fontWeight: theme.typography.fontWeightRegular,\n },\n [`& h1, h2, h3, h4, h5, h6,\n .errors h4, .error h4, .opblock h4, section.models h4,\n .response-control-media-type__accept-message,\n .opblock-summary-description,\n .opblock-summary-operation-id,\n .opblock-summary-path,\n .opblock-summary-path__deprecated,\n .opblock-description-wrapper,\n .opblock-external-docs-wrapper,\n .opblock-section-header .btn,\n .opblock-section-header>label,\n .scheme-container .schemes>label,a.nostyle,\n .parameter__name,\n .response-col_status,\n .response-col_links,\n .error .btn,\n .info .title,\n .info .base-url`]: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n },\n [`& .opblock .opblock-section-header,\n .model-box,\n section.models .model-container`]: {\n background: theme.palette.background.default,\n },\n [`& .prop-format,\n .parameter__in`]: {\n color: theme.palette.text.disabled,\n },\n [`& table.model,\n .parameter__type,\n .model.model-title,\n .model-title,\n .model span,\n .model .brace-open,\n .model .brace-close,\n .model .property.primitive,\n .model .renderedMarkdown,\n .model .description,\n .errors small`]: {\n color: theme.palette.text.secondary,\n },\n [`& .parameter__name.required:after`]: {\n color: theme.palette.warning.dark,\n },\n [`& table.model,\n table.model .model,\n .opblock-external-docs-wrapper`]: {\n fontSize: theme.typography.fontSize,\n },\n [`& table.headers td`]: {\n color: theme.palette.text.primary,\n fontWeight: theme.typography.fontWeightRegular,\n },\n [`& .model-hint`]: {\n color: theme.palette.text.secondary,\n backgroundColor: theme.palette.background.paper,\n },\n [`& .opblock-summary-method,\n .info a`]: {\n fontFamily: theme.typography.fontFamily,\n },\n [`& .info, .opblock, .tab`]: {\n [`& li, p`]: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n },\n },\n [`& a`]: {\n color: theme.palette.primary.main,\n },\n [`& .renderedMarkdown code`]: {\n color: theme.palette.secondary.light,\n },\n [`& .property-row td:first-child`]: {\n color: theme.palette.text.primary,\n },\n [`& span.prop-type`]: {\n color: theme.palette.success.light,\n },\n },\n },\n}));\n\nexport type OpenApiDefinitionProps = {\n definition: string;\n} & Omit<SwaggerUIProps, 'spec'>;\n\nexport const OpenApiDefinition = ({\n definition,\n ...swaggerUiProps\n}: OpenApiDefinitionProps) => {\n const classes = useStyles();\n\n // Due to a bug in the swagger-ui-react component, the component needs\n // to be created without content first.\n const [def, setDef] = useState('');\n\n useEffect(() => {\n const timer = setTimeout(() => setDef(definition), 0);\n return () => clearTimeout(timer);\n }, [definition, setDef]);\n\n return (\n <div className={classes.root}>\n <SwaggerUI\n spec={def}\n url=\"\"\n deepLinking\n oauth2RedirectUrl={`${window.location.protocol}//${window.location.host}/oauth2-redirect.html`}\n {...swaggerUiProps}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AAqBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,eAAiB,EAAA;AAAA,MACf,UAAA,EAAY,MAAM,UAAW,CAAA,UAAA;AAAA,MAC7B,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,OAAA;AAAA,MAE1B,CAAC,cAAc,GAAG;AAAA,QAChB,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,OAAA;AAAA,OAC5B;AAAA,MACA,CAAC,qBAAqB,GAAG;AAAA,QACvB,eAAA,EAAiB,KAAM,CAAA,OAAA,CAAQ,UAAW,CAAA,OAAA;AAAA,OAC5C;AAAA,MACA,CAAC,CAAA;AAAA;AAAA;AAAA,2BAAA,CAGqB,GAAG;AAAA,QACvB,UAAA,EAAY,MAAM,UAAW,CAAA,UAAA;AAAA,QAC7B,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ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A;AAMK,MAAM,oBAAoB,CAAC;AAAA,EAChC,UAAA;AAAA,EACA,GAAG,cAAA;AACL,CAA8B,KAAA;AAC5B,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAI1B,EAAA,MAAM,CAAC,GAAA,EAAK,MAAM,CAAA,GAAI,SAAS,EAAE,CAAA,CAAA;AAEjC,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,MAAM,QAAQ,UAAW,CAAA,MAAM,MAAO,CAAA,UAAU,GAAG,CAAC,CAAA,CAAA;AACpD,IAAO,OAAA,MAAM,aAAa,KAAK,CAAA,CAAA;AAAA,GAC9B,EAAA,CAAC,UAAY,EAAA,MAAM,CAAC,CAAA,CAAA;AAEvB,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAI,SAAW,EAAA,OAAA,CAAQ,IACtB,EAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,SAAA;AAAA,IAAA;AAAA,MACC,IAAM,EAAA,GAAA;AAAA,MACN,GAAI,EAAA,EAAA;AAAA,MACJ,WAAW,EAAA,IAAA;AAAA,MACX,iBAAA,EAAmB,GAAG,MAAO,CAAA,QAAA,CAAS,QAAQ,CAAK,EAAA,EAAA,MAAA,CAAO,SAAS,IAAI,CAAA,qBAAA,CAAA;AAAA,MACtE,GAAG,cAAA;AAAA,KAAA;AAAA,GAER,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"OpenApiDefinition-P9gI3GDo.esm.js","sources":["../../src/components/OpenApiDefinitionWidget/OpenApiDefinition.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 { makeStyles } from '@material-ui/core/styles';\nimport React, { useEffect, useState } from 'react';\nimport SwaggerUI, { SwaggerUIProps } from 'swagger-ui-react';\nimport 'swagger-ui-react/swagger-ui.css';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n '& .swagger-ui': {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n\n ['& .btn-clear']: {\n color: theme.palette.text.primary,\n },\n [`& .scheme-container`]: {\n backgroundColor: theme.palette.background.default,\n },\n [`& .opblock-tag,\n .opblock-tag small,\n table thead tr td,\n table thead tr th`]: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n borderColor: theme.palette.divider,\n },\n [`& section.models,\n section.models.is-open h4`]: {\n borderColor: theme.palette.divider,\n },\n [`& .model-title,\n .model .renderedMarkdown,\n .model .description`]: {\n fontFamily: theme.typography.fontFamily,\n fontWeight: theme.typography.fontWeightRegular,\n },\n [`& h1, h2, h3, h4, h5, h6,\n .errors h4, .error h4, .opblock h4, section.models h4,\n .response-control-media-type__accept-message,\n .opblock-summary-description,\n .opblock-summary-operation-id,\n .opblock-summary-path,\n .opblock-summary-path__deprecated,\n .opblock-description-wrapper,\n .opblock-external-docs-wrapper,\n .opblock-section-header .btn,\n .opblock-section-header>label,\n .scheme-container .schemes>label,a.nostyle,\n .parameter__name,\n .response-col_status,\n .response-col_links,\n .error .btn,\n .info .title,\n .info .base-url`]: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n },\n [`& .opblock .opblock-section-header,\n .model-box,\n section.models .model-container`]: {\n background: theme.palette.background.default,\n },\n [`& .prop-format,\n .parameter__in`]: {\n color: theme.palette.text.disabled,\n },\n [`& table.model,\n .parameter__type,\n .model.model-title,\n .model-title,\n .model span,\n .model .brace-open,\n .model .brace-close,\n .model .property.primitive,\n .model .renderedMarkdown,\n .model .description,\n .errors small`]: {\n color: theme.palette.text.secondary,\n },\n [`& .parameter__name.required:after`]: {\n color: theme.palette.warning.dark,\n },\n [`& table.model,\n table.model .model,\n .opblock-external-docs-wrapper`]: {\n fontSize: theme.typography.fontSize,\n },\n [`& table.headers td`]: {\n color: theme.palette.text.primary,\n fontWeight: theme.typography.fontWeightRegular,\n },\n [`& .model-hint`]: {\n color: theme.palette.text.secondary,\n backgroundColor: theme.palette.background.paper,\n },\n [`& .opblock-summary-method,\n .info a`]: {\n fontFamily: theme.typography.fontFamily,\n },\n [`& .info, .opblock, .tab`]: {\n [`& li, p`]: {\n fontFamily: theme.typography.fontFamily,\n color: theme.palette.text.primary,\n },\n },\n [`& a`]: {\n color: theme.palette.primary.main,\n },\n [`& .renderedMarkdown code`]: {\n color: theme.palette.secondary.light,\n },\n [`& .property-row td:first-child`]: {\n color: theme.palette.text.primary,\n },\n [`& span.prop-type`]: {\n color: theme.palette.success.light,\n },\n },\n },\n}));\n\nexport type OpenApiDefinitionProps = {\n definition: string;\n} & Omit<SwaggerUIProps, 'spec'>;\n\nexport const OpenApiDefinition = ({\n definition,\n ...swaggerUiProps\n}: OpenApiDefinitionProps) => {\n const classes = useStyles();\n\n // Due to a bug in the swagger-ui-react component, the component needs\n // to be created without content first.\n const [def, setDef] = useState('');\n\n useEffect(() => {\n const timer = setTimeout(() => setDef(definition), 0);\n return () => clearTimeout(timer);\n }, [definition, setDef]);\n\n return (\n <div className={classes.root}>\n <SwaggerUI\n spec={def}\n url=\"\"\n deepLinking\n oauth2RedirectUrl={`${window.location.protocol}//${window.location.host}/oauth2-redirect.html`}\n {...swaggerUiProps}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AAqBA,MAAM,SAAA,GAAY,WAAW,CAAU,KAAA,MAAA;AAAA,EACrC,IAAM,EAAA;AAAA,IACJ,eAAiB,EAAA;AAAA,MACf,UAAA,EAAY,MAAM,UAAW,CAAA,UAAA;AAAA,MAC7B,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,OAAA;AAAA,MAE1B,CAAC,c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;"}
@@ -1,14 +1,23 @@
1
1
  import { RELATION_CONSUMES_API, RELATION_HAS_PART, RELATION_PROVIDES_API } from '@backstage/catalog-model';
2
- import { makeStyles, Dialog, DialogTitle, Typography, DialogContent, Tabs, Tab, DialogActions, Button, Box } from '@material-ui/core';
2
+ import Typography from '@material-ui/core/Typography';
3
3
  import { EntityTable, useEntity, useRelatedEntities } from '@backstage/plugin-catalog-react';
4
4
  import React, { useEffect, useState } from 'react';
5
5
  import { InfoCard, Progress, WarningPanel, CodeSnippet, Link } from '@backstage/core-components';
6
6
  import ExtensionIcon from '@material-ui/icons/Extension';
7
- import { ToggleButton } from '@material-ui/lab';
8
- import { a as apiDocsConfigRef } from './ApiDefinitionWidget-798ee85f.esm.js';
7
+ import ToggleButton from '@material-ui/lab/ToggleButton';
8
+ import '@material-ui/lab/Alert';
9
+ import { a as apiDocsConfigRef } from './ApiDefinitionWidget-B2Z_EBYd.esm.js';
9
10
  import { useApi } from '@backstage/core-plugin-api';
10
- import '@material-ui/core/styles';
11
- import { P as PlainApiDefinitionWidget, A as ApiTypeTitle } from './ApiTypeTitle-cc79a2f3.esm.js';
11
+ import { makeStyles } from '@material-ui/core/styles';
12
+ import { P as PlainApiDefinitionWidget, A as ApiTypeTitle } from './ApiTypeTitle-Q7DWBnfV.esm.js';
13
+ import Box from '@material-ui/core/Box';
14
+ import Button from '@material-ui/core/Button';
15
+ import Dialog from '@material-ui/core/Dialog';
16
+ import DialogActions from '@material-ui/core/DialogActions';
17
+ import DialogContent from '@material-ui/core/DialogContent';
18
+ import DialogTitle from '@material-ui/core/DialogTitle';
19
+ import Tab from '@material-ui/core/Tab';
20
+ import Tabs from '@material-ui/core/Tabs';
12
21
 
13
22
  const useStyles = makeStyles((theme) => ({
14
23
  fullHeightDialog: {
@@ -253,4 +262,4 @@ const ProvidedApisCard = (props) => {
253
262
  };
254
263
 
255
264
  export { ApiDefinitionDialog as A, ConsumedApisCard as C, HasApisCard as H, ProvidedApisCard as P };
256
- //# sourceMappingURL=ProvidedApisCard-e92fbd29.esm.js.map
265
+ //# sourceMappingURL=ProvidedApisCard-DYM2U8N2.esm.js.map