@backstage/plugin-api-docs 0.14.5 → 0.14.6-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/alpha.esm.js.map +1 -1
  3. package/dist/components/ApiDefinitionCard/ApiDefinitionCard.esm.js.map +1 -1
  4. package/dist/components/ApiDefinitionCard/ApiDefinitionWidget.esm.js.map +1 -1
  5. package/dist/components/ApiDefinitionCard/ApiTypeTitle.esm.js.map +1 -1
  6. package/dist/components/ApiDefinitionDialog/ApiDefinitionDialog.esm.js.map +1 -1
  7. package/dist/components/ApiExplorerPage/ApiExplorerPage.esm.js.map +1 -1
  8. package/dist/components/ApiExplorerPage/DefaultApiExplorerPage.esm.js +1 -1
  9. package/dist/components/ApiExplorerPage/DefaultApiExplorerPage.esm.js.map +1 -1
  10. package/dist/components/ApisCards/ConsumedApisCard.esm.js.map +1 -1
  11. package/dist/components/ApisCards/HasApisCard.esm.js.map +1 -1
  12. package/dist/components/ApisCards/ProvidedApisCard.esm.js.map +1 -1
  13. package/dist/components/ApisCards/presets.esm.js.map +1 -1
  14. package/dist/components/AsyncApiDefinitionWidget/AsyncApiDefinition.esm.js.map +1 -1
  15. package/dist/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.esm.js.map +1 -1
  16. package/dist/components/ComponentsCards/ConsumingComponentsCard.esm.js.map +1 -1
  17. package/dist/components/ComponentsCards/ProvidingComponentsCard.esm.js.map +1 -1
  18. package/dist/components/GraphQlDefinitionWidget/GraphQlDefinition.esm.js.map +1 -1
  19. package/dist/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.esm.js.map +1 -1
  20. package/dist/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.esm.js.map +1 -1
  21. package/dist/components/OpenApiDefinitionWidget/OpenApiDefinition.esm.js.map +1 -1
  22. package/dist/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.esm.js.map +1 -1
  23. package/dist/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.esm.js.map +1 -1
  24. package/dist/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.esm.js.map +1 -1
  25. package/dist/config.esm.js.map +1 -1
  26. package/dist/package.json.esm.js +1 -1
  27. package/dist/package.json.esm.js.map +1 -1
  28. package/dist/plugin.esm.js.map +1 -1
  29. package/dist/routes.esm.js.map +1 -1
  30. package/dist/translation.esm.js.map +1 -1
  31. package/package.json +15 -15
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @backstage/plugin-api-docs
2
2
 
3
+ ## 0.14.6-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/core-components@0.18.15-next.0
9
+ - @backstage/core-plugin-api@1.12.11-next.0
10
+ - @backstage/frontend-plugin-api@0.18.2-next.0
11
+ - @backstage/plugin-permission-react@0.5.6-next.0
12
+ - @backstage/catalog-model@1.10.2-next.0
13
+ - @backstage/plugin-catalog@2.0.10-next.0
14
+ - @backstage/plugin-catalog-react@3.2.4-next.0
15
+ - @backstage/plugin-catalog-common@1.2.1-next.0
16
+
3
17
  ## 0.14.5
4
18
 
5
19
  ### Patch Changes
@@ -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 Grid from '@material-ui/core/Grid';\n\nimport {\n ApiBlueprint,\n PageBlueprint,\n createFrontendPlugin,\n} from '@backstage/frontend-plugin-api';\nimport { z } from 'zod/v4';\n\nimport {\n ApiEntity,\n parseEntityRef,\n RELATION_HAS_PART,\n} from '@backstage/catalog-model';\n\nimport { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { rootRoute, registerComponentRouteRef } from './routes';\nimport { apiDocsConfigRef } from './config';\nimport { AppIcon } from '@backstage/core-components';\n\nimport {\n EntityCardBlueprint,\n EntityContentBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\n\nconst apiDocsConfigApi = ApiBlueprint.make({\n name: 'config',\n params: defineParams =>\n defineParams({\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 = PageBlueprint.makeWithOverrides({\n configSchema: {\n // Omitting columns and actions for now as their types are too complex to map to zod\n initiallySelectedFilter: z.enum(['owned', 'starred', 'all']).optional(),\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n path: '/api-docs',\n routeRef: rootRoute,\n title: 'APIs',\n icon: <AppIcon fontSize=\"inherit\" id=\"kind:api\" />,\n loader: () =>\n import('./components/ApiExplorerPage/DefaultApiExplorerPage').then(\n m => (\n <m.NfsApiExplorerPage\n initiallySelectedFilter={config.initiallySelectedFilter}\n />\n ),\n ),\n });\n },\n});\n\nconst apiDocsHasApisEntityCard = EntityCardBlueprint.make({\n name: 'has-apis',\n params: {\n // Omitting 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.toLowerCase() === RELATION_HAS_PART &&\n parseEntityRef(targetRef).kind === 'API',\n )!!\n );\n },\n loader: () => import('./components/ApisCards').then(m => <m.HasApisCard />),\n },\n});\n\nconst apiDocsDefinitionEntityCard = EntityCardBlueprint.make({\n name: 'definition',\n params: {\n filter: { kind: 'api' },\n loader: () =>\n import('./components/ApiDefinitionCard').then(m => (\n <m.ApiDefinitionCard />\n )),\n },\n});\n\nconst apiDocsConsumedApisEntityCard = EntityCardBlueprint.make({\n name: 'consumed-apis',\n params: {\n // Omitting 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 => <m.ConsumedApisCard />),\n },\n});\n\nconst apiDocsProvidedApisEntityCard = EntityCardBlueprint.make({\n name: 'provided-apis',\n params: {\n // Omitting 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 => <m.ProvidedApisCard />),\n },\n});\n\nconst apiDocsConsumingComponentsEntityCard = EntityCardBlueprint.make({\n name: 'consuming-components',\n params: {\n // Omitting 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 <m.ConsumingComponentsCard />\n )),\n },\n});\n\nconst apiDocsProvidingComponentsEntityCard = EntityCardBlueprint.make({\n name: 'providing-components',\n params: {\n // Omitting 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 <m.ProvidingComponentsCard />\n )),\n },\n});\n\nconst apiDocsDefinitionEntityContent = EntityContentBlueprint.make({\n name: 'definition',\n params: {\n path: '/definition',\n title: 'Definition',\n group: 'documentation',\n filter: { kind: 'api' },\n loader: async () =>\n import('./components/ApiDefinitionCard').then(m => (\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <m.ApiDefinitionCard />\n </Grid>\n </Grid>\n )),\n },\n});\n\nconst apiDocsApisEntityContent = EntityContentBlueprint.make({\n name: 'apis',\n params: {\n path: '/apis',\n title: 'APIs',\n group: 'development',\n filter: { kind: 'component' },\n loader: async () =>\n import('./components/ApisCards').then(m => (\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 createFrontendPlugin({\n pluginId: 'api-docs',\n title: 'APIs',\n icon: <AppIcon fontSize=\"inherit\" id=\"kind:api\" />,\n info: { packageJson: () => import('../package.json') },\n routes: {\n root: rootRoute,\n },\n externalRoutes: {\n registerApi: registerComponentRouteRef,\n },\n extensions: [\n apiDocsConfigApi,\n apiDocsExplorerPage,\n apiDocsHasApisEntityCard,\n apiDocsDefinitionEntityCard,\n apiDocsProvidedApisEntityCard,\n apiDocsConsumedApisEntityCard,\n apiDocsConsumingComponentsEntityCard,\n apiDocsProvidingComponentsEntityCard,\n apiDocsDefinitionEntityContent,\n apiDocsApisEntityContent,\n ],\n});\n\nimport { apiDocsTranslationRef as _apiDocsTranslationRef } from './translation';\n\n/**\n * @alpha\n * @deprecated Import from `@backstage/plugin-api-docs` instead.\n */\nexport const apiDocsTranslationRef = _apiDocsTranslationRef;\n"],"names":["_apiDocsTranslationRef"],"mappings":";;;;;;;;;;;;;;;;AAyCA,MAAM,gBAAA,GAAmB,aAAa,IAAA,CAAK;AAAA,EACzC,IAAA,EAAM,QAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,gBAAA;AAAA,IACL,MAAM,EAAC;AAAA,IACP,SAAS,MAAM;AACb,MAAA,MAAM,oBAAoB,wBAAA,EAAyB;AACnD,MAAA,OAAO;AAAA,QACL,sBAAA,EAAwB,CAAC,SAAA,KAAyB;AAChD,UAAA,OAAO,kBAAkB,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,IAAA,KAAS,SAAA,CAAU,KAAK,IAAI,CAAA;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AAAA,IACA,8BAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;AAQM,MAAM,qBAAA,GAAwBA;;;;"}
1
+ {"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport Grid from '@material-ui/core/Grid';\n\nimport {\n ApiBlueprint,\n PageBlueprint,\n createFrontendPlugin,\n} from '@backstage/frontend-plugin-api';\nimport { z } from 'zod/v4';\n\nimport {\n ApiEntity,\n parseEntityRef,\n RELATION_HAS_PART,\n} from '@backstage/catalog-model';\n\nimport { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { rootRoute, registerComponentRouteRef } from './routes';\nimport { apiDocsConfigRef } from './config';\nimport { AppIcon } from '@backstage/core-components';\n\nimport {\n EntityCardBlueprint,\n EntityContentBlueprint,\n} from '@backstage/plugin-catalog-react/alpha';\n\nconst apiDocsConfigApi = ApiBlueprint.make({\n name: 'config',\n params: defineParams =>\n defineParams({\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 = PageBlueprint.makeWithOverrides({\n configSchema: {\n // Omitting columns and actions for now as their types are too complex to map to zod\n initiallySelectedFilter: z.enum(['owned', 'starred', 'all']).optional(),\n },\n factory(originalFactory, { config }) {\n return originalFactory({\n path: '/api-docs',\n routeRef: rootRoute,\n title: 'APIs',\n icon: <AppIcon fontSize=\"inherit\" id=\"kind:api\" />,\n loader: () =>\n import('./components/ApiExplorerPage/DefaultApiExplorerPage').then(\n m => (\n <m.NfsApiExplorerPage\n initiallySelectedFilter={config.initiallySelectedFilter}\n />\n ),\n ),\n });\n },\n});\n\nconst apiDocsHasApisEntityCard = EntityCardBlueprint.make({\n name: 'has-apis',\n params: {\n // Omitting 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.toLowerCase() === RELATION_HAS_PART &&\n parseEntityRef(targetRef).kind === 'API',\n )!!\n );\n },\n loader: () => import('./components/ApisCards').then(m => <m.HasApisCard />),\n },\n});\n\nconst apiDocsDefinitionEntityCard = EntityCardBlueprint.make({\n name: 'definition',\n params: {\n filter: { kind: 'api' },\n loader: () =>\n import('./components/ApiDefinitionCard').then(m => (\n <m.ApiDefinitionCard />\n )),\n },\n});\n\nconst apiDocsConsumedApisEntityCard = EntityCardBlueprint.make({\n name: 'consumed-apis',\n params: {\n // Omitting 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 => <m.ConsumedApisCard />),\n },\n});\n\nconst apiDocsProvidedApisEntityCard = EntityCardBlueprint.make({\n name: 'provided-apis',\n params: {\n // Omitting 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 => <m.ProvidedApisCard />),\n },\n});\n\nconst apiDocsConsumingComponentsEntityCard = EntityCardBlueprint.make({\n name: 'consuming-components',\n params: {\n // Omitting 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 <m.ConsumingComponentsCard />\n )),\n },\n});\n\nconst apiDocsProvidingComponentsEntityCard = EntityCardBlueprint.make({\n name: 'providing-components',\n params: {\n // Omitting 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 <m.ProvidingComponentsCard />\n )),\n },\n});\n\nconst apiDocsDefinitionEntityContent = EntityContentBlueprint.make({\n name: 'definition',\n params: {\n path: '/definition',\n title: 'Definition',\n group: 'documentation',\n filter: { kind: 'api' },\n loader: async () =>\n import('./components/ApiDefinitionCard').then(m => (\n <Grid container spacing={3}>\n <Grid item xs={12}>\n <m.ApiDefinitionCard />\n </Grid>\n </Grid>\n )),\n },\n});\n\nconst apiDocsApisEntityContent = EntityContentBlueprint.make({\n name: 'apis',\n params: {\n path: '/apis',\n title: 'APIs',\n group: 'development',\n filter: { kind: 'component' },\n loader: async () =>\n import('./components/ApisCards').then(m => (\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 createFrontendPlugin({\n pluginId: 'api-docs',\n title: 'APIs',\n icon: <AppIcon fontSize=\"inherit\" id=\"kind:api\" />,\n info: { packageJson: () => import('../package.json') },\n routes: {\n root: rootRoute,\n },\n externalRoutes: {\n registerApi: registerComponentRouteRef,\n },\n extensions: [\n apiDocsConfigApi,\n apiDocsExplorerPage,\n apiDocsHasApisEntityCard,\n apiDocsDefinitionEntityCard,\n apiDocsProvidedApisEntityCard,\n apiDocsConsumedApisEntityCard,\n apiDocsConsumingComponentsEntityCard,\n apiDocsProvidingComponentsEntityCard,\n apiDocsDefinitionEntityContent,\n apiDocsApisEntityContent,\n ],\n});\n\nimport { apiDocsTranslationRef as _apiDocsTranslationRef } from './translation';\n\n/**\n * @alpha\n * @deprecated Import from `@backstage/plugin-api-docs` instead.\n */\nexport const apiDocsTranslationRef = _apiDocsTranslationRef;\n"],"names":["_apiDocsTranslationRef"],"mappings":";;;;;;;;;;;;;;;;AAyCA,MAAM,gBAAA,GAAmB,aAAa,IAAA,CAAK;AAAA,EACzC,IAAA,EAAM,QAAA;AAAA,EACN,MAAA,EAAQ,kBACN,YAAA,CAAa;AAAA,IACX,GAAA,EAAK,gBAAA;AAAA,IACL,MAAM,EAAC;AAAA,IACP,SAAS,MAAM;AACb,MAAA,MAAM,oBAAoB,wBAAA,EAAyB;AACnD,MAAA,OAAO;AAAA,QACL,sBAAA,EAAwB,CAAC,SAAA,KAAyB;AAChD,UAAA,OAAO,kBAAkB,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,IAAA,KAAS,SAAA,CAAU,KAAK,IAAI,CAAA;AAAA,QACnE;AAAA,OACF;AAAA,IACF;AAAA,GACD;AACL,CAAC,CAAA;AAED,MAAM,mBAAA,GAAsB,cAAc,iBAAA,CAAkB;AAAA,EAC1D,YAAA,EAAc;AAAA;AAAA,IAEZ,uBAAA,EAAyB,EAAE,IAAA,CAAK,CAAC,SAAS,SAAA,EAAW,KAAK,CAAC,CAAA,CAAE,QAAA;AAAS,GACxE;AAAA,EACA,OAAA,CAAQ,eAAA,EAAiB,EAAE,MAAA,EAAO,EAAG;AACnC,IAAA,OAAO,eAAA,CAAgB;AAAA,MACrB,IAAA,EAAM,WAAA;AAAA,MACN,QAAA,EAAU,SAAA;AAAA,MACV,KAAA,EAAO,MAAA;AAAA,MACP,sBAAM,GAAA,CAAC,OAAA,EAAA,EAAQ,QAAA,EAAS,SAAA,EAAU,IAAG,UAAA,EAAW,CAAA;AAAA,MAChD,MAAA,EAAQ,MACN,OAAO,4DAAqD,CAAA,CAAE,IAAA;AAAA,QAC5D,CAAA,CAAA,qBACE,GAAA;AAAA,UAAC,CAAA,CAAE,kBAAA;AAAA,UAAF;AAAA,YACC,yBAAy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AC,CAAA;AAED,YAAe,oBAAA,CAAqB;AAAA,EAClC,QAAA,EAAU,UAAA;AAAA,EACV,KAAA,EAAO,MAAA;AAAA,EACP,sBAAM,GAAA,CAAC,OAAA,EAAA,EAAQ,QAAA,EAAS,SAAA,EAAU,IAAG,UAAA,EAAW,CAAA;AAAA,EAChD,MAAM,EAAE,WAAA,EAAa,MAAM,OAAO,uBAAiB,CAAA,EAAE;AAAA,EACrD,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM;AAAA,GACR;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,WAAA,EAAa;AAAA,GACf;AAAA,EACA,UAAA,EAAY;AAAA,IACV,gBAAA;AAAA,IACA,mBAAA;AAAA,IACA,wBAAA;AAAA,IACA,2BAAA;AAAA,IACA,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA,oCAAA;AAAA,IACA,oCAAA;AAAA,IACA,8BAAA;AAAA,IACA;AAAA;AAEJ,CAAC,CAAA;AAQM,MAAM,qBAAA,GAAwBA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiDefinitionCard.esm.js","sources":["../../../src/components/ApiDefinitionCard/ApiDefinitionCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport {\n useEntity,\n useEntityPresentation,\n} from '@backstage/plugin-catalog-react';\nimport { CardTab, TabbedCard } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport Alert from '@material-ui/lab/Alert';\nimport { apiDocsConfigRef } from '../../config';\nimport { apiDocsTranslationRef } from '../../translation';\nimport { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';\n\n/** @public */\nexport const ApiDefinitionCard = () => {\n const { entity } = useEntity<ApiEntity>();\n const config = useApi(apiDocsConfigRef);\n const { getApiDefinitionWidget } = config;\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const { primaryTitle } = useEntityPresentation(entity);\n\n if (!entity) {\n return <Alert severity=\"error\">{t('apiDefinitionCard.error.title')}</Alert>;\n }\n\n const definitionWidget = getApiDefinitionWidget(entity);\n\n if (definitionWidget) {\n return (\n <TabbedCard title={primaryTitle}>\n <CardTab label={definitionWidget.title} key=\"widget\">\n {definitionWidget.component(entity.spec.definition)}\n </CardTab>\n <CardTab label={t('apiDefinitionCard.rawButtonTitle')} key=\"raw\">\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={definitionWidget.rawLanguage || entity.spec.type}\n />\n </CardTab>\n </TabbedCard>\n );\n }\n\n return (\n <TabbedCard\n title={primaryTitle}\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":";;;;;;;;;;AA8BO,MAAM,oBAAoB,MAAM;AACrC,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAqB;AACxC,EAAA,MAAM,MAAA,GAAS,OAAO,gBAAgB,CAAA;AACtC,EAAA,MAAM,EAAE,wBAAuB,GAAI,MAAA;AACnC,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM,EAAE,YAAA,EAAa,GAAI,qBAAA,CAAsB,MAAM,CAAA;AAErD,EAAA,IAAI,CAAC,MAAA,EAAQ;AACX,IAAA,2BAAQ,KAAA,EAAA,EAAM,QAAA,EA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cesContent":["/*\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 {\n useEntity,\n useEntityPresentation,\n} from '@backstage/plugin-catalog-react';\nimport { CardTab, TabbedCard } from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport Alert from '@material-ui/lab/Alert';\nimport { apiDocsConfigRef } from '../../config';\nimport { apiDocsTranslationRef } from '../../translation';\nimport { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';\n\n/** @public */\nexport const ApiDefinitionCard = () => {\n const { entity } = useEntity<ApiEntity>();\n const config = useApi(apiDocsConfigRef);\n const { getApiDefinitionWidget } = config;\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const { primaryTitle } = useEntityPresentation(entity);\n\n if (!entity) {\n return <Alert severity=\"error\">{t('apiDefinitionCard.error.title')}</Alert>;\n }\n\n const definitionWidget = getApiDefinitionWidget(entity);\n\n if (definitionWidget) {\n return (\n <TabbedCard title={primaryTitle}>\n <CardTab label={definitionWidget.title} key=\"widget\">\n {definitionWidget.component(entity.spec.definition)}\n </CardTab>\n <CardTab label={t('apiDefinitionCard.rawButtonTitle')} key=\"raw\">\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={definitionWidget.rawLanguage || entity.spec.type}\n />\n </CardTab>\n </TabbedCard>\n );\n }\n\n return (\n <TabbedCard\n title={primaryTitle}\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 <PlainAp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AAA;AAAA,EAEJ;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,UAAA;AAAA,IAAA;AAAA,MACC,KAAA,EAAO,YAAA;AAAA,MACP,QAAA,EAAU;AAAA;AAAA,wBAER,GAAA,CAAC,OAAA,EAAA,EAAQ,KAAA,EAAO,MAAA,CAAO,KAAK,IAAA,EAC1B,QAAA,kBAAA,GAAA;AAAA,UAAC,wBAAA;AAAA,UAAA;AAAA,YACC,UAAA,EAAY,OAAO,IAAA,CAAK,UAAA;AAAA,YACxB,QAAA,EAAU,OAAO,IAAA,CAAK;AAAA;AAAA,aAHY,KAKtC;AAAA;AACF;AAAA,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiDefinitionWidget.esm.js","sources":["../../../src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ReactElement } from 'react';\nimport { AsyncApiDefinitionWidget } from '../AsyncApiDefinitionWidget';\nimport { GraphQlDefinitionWidget } from '../GraphQlDefinitionWidget';\nimport { OpenApiDefinitionWidget } from '../OpenApiDefinitionWidget';\nimport { GrpcApiDefinitionWidget } from '../GrpcApiDefinitionWidget';\nimport { TrpcApiDefinitionWidget } from '../TrpcDefinitionWidget';\n\n/** @public */\nexport type ApiDefinitionWidget = {\n type: string;\n title: string;\n component: (definition: string) => ReactElement;\n rawLanguage?: string;\n};\n\n/** @public */\nexport function defaultDefinitionWidgets(): ApiDefinitionWidget[] {\n return [\n {\n type: 'openapi',\n title: 'OpenAPI',\n rawLanguage: 'yaml',\n component: definition => (\n <OpenApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'asyncapi',\n title: 'AsyncAPI',\n rawLanguage: 'yaml',\n component: definition => (\n <AsyncApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'graphql',\n title: 'GraphQL',\n rawLanguage: 'graphql',\n component: definition => (\n <GraphQlDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'grpc',\n title: 'gRPC',\n component: definition => (\n <GrpcApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'trpc',\n title: 'tRPC',\n component: definition => (\n <TrpcApiDefinitionWidget definition={definition} />\n ),\n },\n ];\n}\n"],"names":[],"mappings":";;;;;;;AA+BO,SAAS,wBAAA,GAAkD;AAChE,EAAA,OAAO;AAAA,IACL;AAAA,MACE,IAAA,EAAM,SAAA;AAAA,MACN,KAAA,EAAO,SAAA;AAAA,MACP,WAAA,EAAa,MAAA;AAAA,MACb,SAAA,EAAW,CAAA,UAAA,qBACT,GAAA,CAAC,uBAAA,EAAA,EAAwB,UAAA,EAAwB;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAA,EAAM,UAAA;AAAA,MACN,KAAA,EAAO,UAAA;AAAA,MACP,WAAA,EAAa,MAAA;AAAA,MACb,SAAA,EAAW,CAAA,UAAA,qBACT,GAAA,CAAC,wBAAA,EAAA,EAAyB,UAAA,EAAwB;AAAA,KAEtD;AAAA,IACA;AAAA,MACE,IAAA,EAAM,SAAA;AAAA,MACN,KAAA,EAAO,SAAA;AAAA,MACP,WAAA,EAAa,SAAA;AAAA,MACb,SAAA,EAAW,CAAA,UAAA,qBACT,GAAA,CAAC,uBAAA,EAAA,EAAwB,UAAA,EAAwB;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,MAAA;AAAA,MACP,SAAA,EAAW,CAAA,UAAA,qBACT,GAAA,CAAC,uBAAA,EAAA,EAAwB,UAAA,EAAwB;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,MAAA;AAAA,MACP,SAAA,EAAW,CAAA,UAAA,qBACT,GAAA,CAAC,uBAAA,EAAA,EAAwB,UAAA,EAAwB;AAAA;AAErD,GACF;AACF;;;;"}
1
+ {"version":3,"file":"ApiDefinitionWidget.esm.js","sources":["../../../src/components/ApiDefinitionCard/ApiDefinitionWidget.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ReactElement } from 'react';\nimport { AsyncApiDefinitionWidget } from '../AsyncApiDefinitionWidget';\nimport { GraphQlDefinitionWidget } from '../GraphQlDefinitionWidget';\nimport { OpenApiDefinitionWidget } from '../OpenApiDefinitionWidget';\nimport { GrpcApiDefinitionWidget } from '../GrpcApiDefinitionWidget';\nimport { TrpcApiDefinitionWidget } from '../TrpcDefinitionWidget';\n\n/** @public */\nexport type ApiDefinitionWidget = {\n type: string;\n title: string;\n component: (definition: string) => ReactElement;\n rawLanguage?: string;\n};\n\n/** @public */\nexport function defaultDefinitionWidgets(): ApiDefinitionWidget[] {\n return [\n {\n type: 'openapi',\n title: 'OpenAPI',\n rawLanguage: 'yaml',\n component: definition => (\n <OpenApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'asyncapi',\n title: 'AsyncAPI',\n rawLanguage: 'yaml',\n component: definition => (\n <AsyncApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'graphql',\n title: 'GraphQL',\n rawLanguage: 'graphql',\n component: definition => (\n <GraphQlDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'grpc',\n title: 'gRPC',\n component: definition => (\n <GrpcApiDefinitionWidget definition={definition} />\n ),\n },\n {\n type: 'trpc',\n title: 'tRPC',\n component: definition => (\n <TrpcApiDefinitionWidget definition={definition} />\n ),\n },\n ];\n}\n"],"names":[],"mappings":";;;;;;;AA+BO,SAAS,wBAAA,GAAkD;AAChE,EAAA,OAAO;AAAA,IACL;AAAA,MACE,IAAA,EAAM,SAAA;AAAA,MACN,KAAA,EAAO,SAAA;AAAA,MACP,WAAA,EAAa,MAAA;AAAA,MACb,SAAA,EAAW,CAAA,UAAA,qBACT,GAAA,CAAC,uBAAA,EAAA,EAAwB,UAAA,EAAwB;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAA,EAAM,UAAA;AAAA,MACN,KAAA,EAAO,UAAA;AAAA,MACP,WAAA,EAAa,MAAA;AAAA,MACb,SAAA,EAAW,CAAA,UAAA,qBACT,GAAA,CAAC,wBAAA,EAAA,EAAyB,UAAA,EAAwB;AAAA,KAEtD;AAAA,IACA;AAAA,MACE,IAAA,EAAM,SAAA;AAAA,MACN,KAAA,EAAO,SAAA;AAAA,MACP,WAAA,EAAa,SAAA;AAAA,MACb,SAAA,EAAW,CAAA,UAAA,qBACT,GAAA,CAAC,uBAAA,EAAA,EAAwB,UAAA,EAAwB;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,MAAA;AAAA,MACP,SAAA,EAAW,CAAA,UAAA,qBACT,GAAA,CAAC,uBAAA,EAAA,EAAwB,UAAA,EAAwB;AAAA,KAErD;AAAA,IACA;AAAA,MACE,IAAA,EAAM,MAAA;AAAA,MACN,KAAA,EAAO,MAAA;AAAA,MACP,SAAA,EAAW,CAAA,UAAA,qBACT,GAAA,CAAC,uBAAA,EAAA,EAAwB,UAAA,EAAwB;AAAA;AAErD,GACF;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiTypeTitle.esm.js","sources":["../../../src/components/ApiDefinitionCard/ApiTypeTitle.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport { apiDocsConfigRef } from '../../config';\nimport { useApi } from '@backstage/core-plugin-api';\n\n/**\n * @public\n */\nexport const ApiTypeTitle = (props: { apiEntity: ApiEntity }) => {\n const { apiEntity } = props;\n const config = useApi(apiDocsConfigRef);\n const definition = config.getApiDefinitionWidget(apiEntity);\n const type = definition ? definition.title : apiEntity.spec.type;\n\n return (\n <Typography component=\"span\" variant=\"inherit\">\n {type}\n </Typography>\n );\n};\n"],"names":[],"mappings":";;;;;AAwBO,MAAM,YAAA,GAAe,CAAC,KAAA,KAAoC;AAC/D,EAAA,MAAM,EAAE,WAAU,GAAI,KAAA;AACtB,EAAA,MAAM,MAAA,GAAS,OAAO,gBAAgB,CAAA;AACtC,EAAA,MAAM,UAAA,GAAa,MAAA,CAAO,sBAAA,CAAuB,SAAS,CAAA;AAC1D,EAAA,MAAM,IAAA,GAAO,UAAA,GAAa,UAAA,CAAW,KAAA,GAAQ,UAAU,IAAA,CAAK,IAAA;AAE5D,EAAA,2BACG,UAAA,EAAA,EAAW,SAAA,EAAU,MAAA,EAAO,OAAA,EAAQ,WAClC,QAAA,EAAA,IAAA,EACH,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ApiTypeTitle.esm.js","sources":["../../../src/components/ApiDefinitionCard/ApiTypeTitle.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport { apiDocsConfigRef } from '../../config';\nimport { useApi } from '@backstage/core-plugin-api';\n\n/**\n * @public\n */\nexport const ApiTypeTitle = (props: { apiEntity: ApiEntity }) => {\n const { apiEntity } = props;\n const config = useApi(apiDocsConfigRef);\n const definition = config.getApiDefinitionWidget(apiEntity);\n const type = definition ? definition.title : apiEntity.spec.type;\n\n return (\n <Typography component=\"span\" variant=\"inherit\">\n {type}\n </Typography>\n );\n};\n"],"names":[],"mappings":";;;;;AAwBO,MAAM,YAAA,GAAe,CAAC,KAAA,KAAoC;AAC/D,EAAA,MAAM,EAAE,WAAU,GAAI,KAAA;AACtB,EAAA,MAAM,MAAA,GAAS,OAAO,gBAAgB,CAAA;AACtC,EAAA,MAAM,UAAA,GAAa,MAAA,CAAO,sBAAA,CAAuB,SAAS,CAAA;AAC1D,EAAA,MAAM,IAAA,GAAO,UAAA,GAAa,UAAA,CAAW,KAAA,GAAQ,UAAU,IAAA,CAAK,IAAA;AAE5D,EAAA,2BACG,UAAA,EAAA,EAAW,SAAA,EAAU,MAAA,EAAO,OAAA,EAAQ,WAClC,QAAA,EAAA,IAAA,EACH,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiDefinitionDialog.esm.js","sources":["../../../src/components/ApiDefinitionDialog/ApiDefinitionDialog.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { EntityDisplayName } from '@backstage/plugin-catalog-react';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Tab from '@material-ui/core/Tab';\nimport Tabs from '@material-ui/core/Tabs';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ReactNode, useState, useEffect } from 'react';\nimport { apiDocsConfigRef } from '../../config';\nimport { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\n\nconst useStyles = makeStyles(theme => ({\n fullHeightDialog: {\n height: 'calc(100% - 64px)',\n },\n root: {\n display: 'flex',\n flexGrow: 1,\n width: '100%',\n height: '100%',\n },\n tabs: {\n borderRight: `1px solid ${theme.palette.divider}`,\n flexShrink: 0,\n },\n tabContents: {\n flexGrow: 1,\n overflowX: 'auto',\n },\n title: {\n color: theme.palette.text.primary,\n wordBreak: 'break-word',\n fontSize: theme.typography.h3.fontSize,\n marginBottom: 0,\n },\n type: {\n textTransform: 'uppercase',\n fontSize: 11,\n opacity: 0.8,\n marginBottom: theme.spacing(1),\n color: theme.palette.text.primary,\n },\n}));\n\nfunction TabPanel(props: {\n children?: ReactNode;\n index: number;\n value: number;\n}) {\n const { children, value, index, ...other } = props;\n const classes = useStyles();\n return (\n <div\n role=\"tabpanel\"\n hidden={value !== index}\n id={`vertical-tabpanel-${index}`}\n aria-labelledby={`vertical-tab-${index}`}\n className={classes.tabContents}\n {...other}\n >\n {value === index && (\n <Box pl={3} pr={3}>\n {children}\n </Box>\n )}\n </div>\n );\n}\n\nfunction a11yProps(index: number) {\n return {\n id: `vertical-tab-${index}`,\n 'aria-controls': `vertical-tabpanel-${index}`,\n };\n}\n\n/**\n * A dialog that lets users inspect the API definition.\n *\n * @public\n */\nexport function ApiDefinitionDialog(props: {\n open: boolean;\n entity: ApiEntity;\n onClose: () => void;\n}) {\n const { open, entity, onClose } = props;\n const [activeTab, setActiveTab] = useState(0);\n const classes = useStyles();\n const { t } = useTranslationRef(apiDocsTranslationRef);\n\n useEffect(() => {\n setActiveTab(0);\n }, [open]);\n\n const config = useApi(apiDocsConfigRef);\n const definitionWidget = config.getApiDefinitionWidget(entity);\n\n let tabIndex = 0;\n let tabPanelIndex = 0;\n\n return (\n <Dialog\n fullWidth\n maxWidth=\"xl\"\n open={open}\n onClose={onClose}\n aria-labelledby=\"api-definition-dialog-title\"\n PaperProps={{ className: classes.fullHeightDialog }}\n >\n <DialogTitle id=\"api-definition-dialog-title\" disableTypography>\n <Typography className={classes.type}>\n API -{' '}\n {definitionWidget?.title ?? t('apiDefinitionDialog.rawButtonTitle')}\n </Typography>\n <Typography className={classes.title} variant=\"h1\">\n <EntityDisplayName entityRef={entity} />\n </Typography>\n </DialogTitle>\n <DialogContent dividers className={classes.root}>\n <Tabs\n orientation=\"vertical\"\n variant=\"scrollable\"\n value={activeTab}\n onChange={(_, newValue) => setActiveTab(newValue)}\n aria-label={t('apiDefinitionDialog.tabsAriaLabel')}\n className={classes.tabs}\n >\n {definitionWidget ? (\n <Tab label={definitionWidget.title} {...a11yProps(tabIndex++)} />\n ) : null}\n <Tab\n label={t('apiDefinitionDialog.rawButtonTitle')}\n {...a11yProps(tabIndex++)}\n />\n </Tabs>\n\n {definitionWidget ? (\n <TabPanel value={activeTab} index={tabPanelIndex++}>\n {definitionWidget.component(entity.spec.definition)}\n </TabPanel>\n ) : null}\n <TabPanel value={activeTab} index={tabPanelIndex++}>\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={definitionWidget?.rawLanguage ?? entity.spec.type}\n />\n </TabPanel>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose} color=\"primary\">\n {t('apiDefinitionDialog.closeButtonTitle')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAmCA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,gBAAA,EAAkB;AAAA,IAChB,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,MAAA;AAAA,IACT,QAAA,EAAU,CAAA;AAAA,IACV,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,WAAA,EAAa,CAAA,UAAA,EAAa,KAAA,CAAM,OAAA,CAAQ,OAAO,CAAA,CAAA;AAAA,IAC/C,UAAA,EAAY;AAAA,GACd;AAAA,EACA,WAAA,EAAa;AAAA,IACX,QAAA,EAAU,CAAA;AAAA,IACV,SAAA,EAAW;AAAA,GACb;AAAA,EACA,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,IAC1B,SAAA,EAAW,YAAA;AAAA,IACX,QAAA,EAAU,KAAA,CAAM,UAAA,CAAW,EAAA,CAAG,QAAA;AAAA,IAC9B,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,aAAA,EAAe,WAAA;AAAA,IACf,QAAA,EAAU,EAAA;AAAA,IACV,OAAA,EAAS,GAAA;AAAA,IACT,YAAA,EAAc,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC7B,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,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src/components/ApiDefinitionDialog/ApiDefinitionDialog.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport { useApi } from '@backstage/core-plugin-api';\nimport { EntityDisplayName } from '@backstage/plugin-catalog-react';\nimport Box from '@material-ui/core/Box';\nimport Button from '@material-ui/core/Button';\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Tab from '@material-ui/core/Tab';\nimport Tabs from '@material-ui/core/Tabs';\nimport Typography from '@material-ui/core/Typography';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { ReactNode, useState, useEffect } from 'react';\nimport { apiDocsConfigRef } from '../../config';\nimport { PlainApiDefinitionWidget } from '../PlainApiDefinitionWidget';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\n\nconst useStyles = makeStyles(theme => ({\n fullHeightDialog: {\n height: 'calc(100% - 64px)',\n },\n root: {\n display: 'flex',\n flexGrow: 1,\n width: '100%',\n height: '100%',\n },\n tabs: {\n borderRight: `1px solid ${theme.palette.divider}`,\n flexShrink: 0,\n },\n tabContents: {\n flexGrow: 1,\n overflowX: 'auto',\n },\n title: {\n color: theme.palette.text.primary,\n wordBreak: 'break-word',\n fontSize: theme.typography.h3.fontSize,\n marginBottom: 0,\n },\n type: {\n textTransform: 'uppercase',\n fontSize: 11,\n opacity: 0.8,\n marginBottom: theme.spacing(1),\n color: theme.palette.text.primary,\n },\n}));\n\nfunction TabPanel(props: {\n children?: ReactNode;\n index: number;\n value: number;\n}) {\n const { children, value, index, ...other } = props;\n const classes = useStyles();\n return (\n <div\n role=\"tabpanel\"\n hidden={value !== index}\n id={`vertical-tabpanel-${index}`}\n aria-labelledby={`vertical-tab-${index}`}\n className={classes.tabContents}\n {...other}\n >\n {value === index && (\n <Box pl={3} pr={3}>\n {children}\n </Box>\n )}\n </div>\n );\n}\n\nfunction a11yProps(index: number) {\n return {\n id: `vertical-tab-${index}`,\n 'aria-controls': `vertical-tabpanel-${index}`,\n };\n}\n\n/**\n * A dialog that lets users inspect the API definition.\n *\n * @public\n */\nexport function ApiDefinitionDialog(props: {\n open: boolean;\n entity: ApiEntity;\n onClose: () => void;\n}) {\n const { open, entity, onClose } = props;\n const [activeTab, setActiveTab] = useState(0);\n const classes = useStyles();\n const { t } = useTranslationRef(apiDocsTranslationRef);\n\n useEffect(() => {\n setActiveTab(0);\n }, [open]);\n\n const config = useApi(apiDocsConfigRef);\n const definitionWidget = config.getApiDefinitionWidget(entity);\n\n let tabIndex = 0;\n let tabPanelIndex = 0;\n\n return (\n <Dialog\n fullWidth\n maxWidth=\"xl\"\n open={open}\n onClose={onClose}\n aria-labelledby=\"api-definition-dialog-title\"\n PaperProps={{ className: classes.fullHeightDialog }}\n >\n <DialogTitle id=\"api-definition-dialog-title\" disableTypography>\n <Typography className={classes.type}>\n API -{' '}\n {definitionWidget?.title ?? t('apiDefinitionDialog.rawButtonTitle')}\n </Typography>\n <Typography className={classes.title} variant=\"h1\">\n <EntityDisplayName entityRef={entity} />\n </Typography>\n </DialogTitle>\n <DialogContent dividers className={classes.root}>\n <Tabs\n orientation=\"vertical\"\n variant=\"scrollable\"\n value={activeTab}\n onChange={(_, newValue) => setActiveTab(newValue)}\n aria-label={t('apiDefinitionDialog.tabsAriaLabel')}\n className={classes.tabs}\n >\n {definitionWidget ? (\n <Tab label={definitionWidget.title} {...a11yProps(tabIndex++)} />\n ) : null}\n <Tab\n label={t('apiDefinitionDialog.rawButtonTitle')}\n {...a11yProps(tabIndex++)}\n />\n </Tabs>\n\n {definitionWidget ? (\n <TabPanel value={activeTab} index={tabPanelIndex++}>\n {definitionWidget.component(entity.spec.definition)}\n </TabPanel>\n ) : null}\n <TabPanel value={activeTab} index={tabPanelIndex++}>\n <PlainApiDefinitionWidget\n definition={entity.spec.definition}\n language={definitionWidget?.rawLanguage ?? entity.spec.type}\n />\n </TabPanel>\n </DialogContent>\n <DialogActions>\n <Button onClick={onClose} color=\"primary\">\n {t('apiDefinitionDialog.closeButtonTitle')}\n </Button>\n </DialogActions>\n </Dialog>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAmCA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,gBAAA,EAAkB;AAAA,IAChB,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,OAAA,EAAS,MAAA;AAAA,IACT,QAAA,EAAU,CAAA;AAAA,IACV,KAAA,EAAO,MAAA;AAAA,IACP,MAAA,EAAQ;AAAA,GACV;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,WAAA,EAAa,CAAA,UAAA,EAAa,KAAA,CAAM,OAAA,CAAQ,OAAO,CAAA,CAAA;AAAA,IAC/C,UAAA,EAAY;AAAA,GACd;AAAA,EACA,WAAA,EAAa;AAAA,IACX,QAAA,EAAU,CAAA;AAAA,IACV,SAAA,EAAW;AAAA,GACb;AAAA,EACA,KAAA,EAAO;AAAA,IACL,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,IAC1B,SAAA,EAAW,YAAA;AAAA,IACX,QAAA,EAAU,KAAA,CAAM,UAAA,CAAW,EAAA,CAAG,QAAA;AAAA,IAC9B,YAAA,EAAc;AAAA,GAChB;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,aAAA,EAAe,WAAA;AAAA,IACf,QAA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,SAAA,EAC7B,QAAA,EAAA,CAAA,CAAE,sCAAsC,CAAA,EAC3C,CAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ApiExplorerPage.esm.js","sources":["../../../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 { 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":";;;;AA0BO,MAAM,eAAA,GAAkB,CAAC,KAAA,KAAuC;AACrE,EAAA,MAAM,SAAS,SAAA,EAAU;AAEzB,EAAA,OAAO,MAAA,oBAAU,GAAA,CAAC,sBAAA,EAAA,EAAwB,GAAG,KAAA,EAAO,CAAA;AACtD;;;;"}
1
+ {"version":3,"file":"ApiExplorerPage.esm.js","sources":["../../../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 { 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":";;;;AA0BO,MAAM,eAAA,GAAkB,CAAC,KAAA,KAAuC;AACrE,EAAA,MAAM,SAAS,SAAA,EAAU;AAEzB,EAAA,OAAO,MAAA,oBAAU,GAAA,CAAC,sBAAA,EAAA,EAAwB,GAAG,KAAA,EAAO,CAAA;AACtD;;"}
@@ -1,5 +1,5 @@
1
1
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
2
- import { CreateButton, SupportButton, PageWithHeader, Content, ContentHeader } from '@backstage/core-components';
2
+ import { CreateButton, SupportButton, Content, PageWithHeader, ContentHeader } from '@backstage/core-components';
3
3
  import { useApi, configApiRef, useRouteRef } from '@backstage/core-plugin-api';
4
4
  import { HeaderPage } from '@backstage/ui';
5
5
  import { CatalogTable } from '@backstage/plugin-catalog';
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultApiExplorerPage.esm.js","sources":["../../../src/components/ApiExplorerPage/DefaultApiExplorerPage.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 { HeaderPage } from '@backstage/ui';\nimport { CatalogTable, CatalogTableRow } from '@backstage/plugin-catalog';\nimport {\n EntityKindPicker,\n EntityLifecyclePicker,\n EntityListProvider,\n EntityListPagination,\n EntityOwnerPicker,\n EntityTagPicker,\n EntityTypePicker,\n UserListFilterKind,\n UserListPicker,\n CatalogFilterLayout,\n EntityOwnerPickerProps,\n} from '@backstage/plugin-catalog-react';\nimport { registerComponentRouteRef } from '../../routes';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\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 ownerPickerMode?: EntityOwnerPickerProps['mode'];\n pagination?: EntityListPagination;\n};\n\ntype ApiExplorerPageContentProps = {\n initiallySelectedFilter: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[];\n actions?: TableProps<CatalogTableRow>['actions'];\n ownerPickerMode?: EntityOwnerPickerProps['mode'];\n pagination?: EntityListPagination;\n};\n\nfunction ApiExplorerPageContent(props: ApiExplorerPageContentProps) {\n const {\n initiallySelectedFilter,\n columns,\n actions,\n ownerPickerMode,\n pagination,\n } = props;\n\n return (\n <EntityListProvider pagination={pagination}>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>\n <EntityKindPicker initialFilter=\"api\" hidden />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker mode={ownerPickerMode} />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n </CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>\n <CatalogTable columns={columns || defaultColumns} actions={actions} />\n </CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n );\n}\n\n/**\n * DefaultApiExplorerPage\n * @public\n */\nexport const DefaultApiExplorerPage = (props: DefaultApiExplorerPageProps) => {\n const {\n initiallySelectedFilter = 'all',\n columns,\n actions,\n ownerPickerMode,\n pagination,\n } = props;\n\n const configApi = useApi(configApiRef);\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const generatedSubtitle = t('defaultApiExplorerPage.subtitle', {\n orgName: configApi.getOptionalString('organization.name') ?? 'Backstage',\n });\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n const headerActions = (\n <>\n {allowed && (\n <CreateButton\n title={t('defaultApiExplorerPage.createButtonTitle')}\n to={registerComponentLink?.()}\n />\n )}\n <SupportButton>\n {t('defaultApiExplorerPage.supportButtonTitle')}\n </SupportButton>\n </>\n );\n\n return (\n <PageWithHeader\n themeId=\"apis\"\n title={t('defaultApiExplorerPage.title')}\n subtitle={generatedSubtitle}\n pageTitleOverride={t('defaultApiExplorerPage.pageTitleOverride')}\n >\n <Content>\n <ContentHeader title=\"\">{headerActions}</ContentHeader>\n <ApiExplorerPageContent\n initiallySelectedFilter={initiallySelectedFilter}\n columns={columns}\n actions={actions}\n ownerPickerMode={ownerPickerMode}\n pagination={pagination}\n />\n </Content>\n </PageWithHeader>\n );\n};\n\nexport const NfsApiExplorerPage = (props: DefaultApiExplorerPageProps) => {\n const {\n initiallySelectedFilter = 'all',\n columns,\n actions,\n ownerPickerMode,\n pagination,\n } = props;\n\n const configApi = useApi(configApiRef);\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const generatedSubtitle = t('defaultApiExplorerPage.subtitle', {\n orgName: configApi.getOptionalString('organization.name') ?? 'Backstage',\n });\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n const headerActions = (\n <>\n {allowed && (\n <CreateButton\n title={t('defaultApiExplorerPage.createButtonTitle')}\n to={registerComponentLink?.()}\n />\n )}\n <SupportButton>\n {t('defaultApiExplorerPage.supportButtonTitle')}\n </SupportButton>\n </>\n );\n\n return (\n <>\n <HeaderPage title={generatedSubtitle} customActions={headerActions} />\n <Content>\n <ApiExplorerPageContent\n initiallySelectedFilter={initiallySelectedFilter}\n columns={columns}\n actions={actions}\n ownerPickerMode={ownerPickerMode}\n pagination={pagination}\n />\n </Content>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA+CA,MAAM,cAAA,GAAiD;AAAA,EACrD,aAAa,OAAA,CAAQ,iBAAA,CAAkB,EAAE,MAAA,EAAQ,MAAM,CAAA;AAAA,EACvD,aAAa,OAAA,CAAQ,gBAAA,CAAiB,EAAE,WAAA,EAAa,OAAO,CAAA;AAAA,EAC5D,YAAA,CAAa,QAAQ,kBAAA,EAAmB;AAAA,EACxC,YAAA,CAAa,QAAQ,iBAAA,EAAkB;AAAA,EACvC,YAAA,CAAa,QAAQ,oBAAA,EAAqB;AAAA,EAC1C,YAAA,CAAa,QAAQ,yBAAA,EAA0B;AAAA,EAC/C,YAAA,CAAa,QAAQ,+BAAA,EAAgC;AAAA,EACrD,YAAA,CAAa,QAAQ,gBAAA;AACvB,CAAA;AAsBA,SAAS,uBAAuB,KAAA,EAAoC;AAClE,EAAA,MAAM;AAAA,IACJ,uBAAA;AAAA,IACA,OAAA;AAAA,IACA,OAAA;AAAA,IACA,eAAA;AAAA,IAC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AY,CAAA;AACrC,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM,iBAAA,GAAoB,EAAE,iCAAA,EAAmC;AAAA,IAC7D,OAAA,EAAS,SAAA,CAAU,iBAAA,CAAkB,mBAAmB,CAAA,IAAK;AAAA,GAC9D,CAAA;AACD,EAAA,MAAM,qBAAA,GAAwB,YAAY,yBAAyB,CAAA;AACnE,EAAA,MAAM,EAAE,OAAA,EAAQ,GAAI,aAAA,CAAc;AAAA,IAChC,UAAA,EAAY;AAAA,GACb,CAAA;AACD,EAAA,MAAM,gCACJ,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,IAAA,OAAA,oBACC,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,KAAA,EAAO,EAAE,0CAA0C,CAAA;AAAA,QACnD,IAAI,qBAAA;AAAwB;AAAA,KAC9B;AAAA,oBAEF,GAAA,CAAC,aAAA,EAAA,EACE,QAAA,EAAA,CAAA,CAAE,2CAA2C,CAAA,EAChD;AAAA,GAAA,EACF,CAAA;AAGF,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,KAAA,EAAO,iBAAA,EAAmB,aAAA,EAAe,aAAA,EAAe,CAAA;AAAA,wBACnE,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,MAAC,sBAAA;AAAA,MAAA;AAAA,QACC,uBAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA;AAAA,QACA,eAAA;AAAA,QACA;AAAA;AAAA,KACF,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"DefaultApiExplorerPage.esm.js","sources":["../../../src/components/ApiExplorerPage/DefaultApiExplorerPage.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 { HeaderPage } from '@backstage/ui';\nimport { CatalogTable, CatalogTableRow } from '@backstage/plugin-catalog';\nimport {\n EntityKindPicker,\n EntityLifecyclePicker,\n EntityListProvider,\n EntityListPagination,\n EntityOwnerPicker,\n EntityTagPicker,\n EntityTypePicker,\n UserListFilterKind,\n UserListPicker,\n CatalogFilterLayout,\n EntityOwnerPickerProps,\n} from '@backstage/plugin-catalog-react';\nimport { registerComponentRouteRef } from '../../routes';\nimport { usePermission } from '@backstage/plugin-permission-react';\nimport { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\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 ownerPickerMode?: EntityOwnerPickerProps['mode'];\n pagination?: EntityListPagination;\n};\n\ntype ApiExplorerPageContentProps = {\n initiallySelectedFilter: UserListFilterKind;\n columns?: TableColumn<CatalogTableRow>[];\n actions?: TableProps<CatalogTableRow>['actions'];\n ownerPickerMode?: EntityOwnerPickerProps['mode'];\n pagination?: EntityListPagination;\n};\n\nfunction ApiExplorerPageContent(props: ApiExplorerPageContentProps) {\n const {\n initiallySelectedFilter,\n columns,\n actions,\n ownerPickerMode,\n pagination,\n } = props;\n\n return (\n <EntityListProvider pagination={pagination}>\n <CatalogFilterLayout>\n <CatalogFilterLayout.Filters>\n <EntityKindPicker initialFilter=\"api\" hidden />\n <EntityTypePicker />\n <UserListPicker initialFilter={initiallySelectedFilter} />\n <EntityOwnerPicker mode={ownerPickerMode} />\n <EntityLifecyclePicker />\n <EntityTagPicker />\n </CatalogFilterLayout.Filters>\n <CatalogFilterLayout.Content>\n <CatalogTable columns={columns || defaultColumns} actions={actions} />\n </CatalogFilterLayout.Content>\n </CatalogFilterLayout>\n </EntityListProvider>\n );\n}\n\n/**\n * DefaultApiExplorerPage\n * @public\n */\nexport const DefaultApiExplorerPage = (props: DefaultApiExplorerPageProps) => {\n const {\n initiallySelectedFilter = 'all',\n columns,\n actions,\n ownerPickerMode,\n pagination,\n } = props;\n\n const configApi = useApi(configApiRef);\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const generatedSubtitle = t('defaultApiExplorerPage.subtitle', {\n orgName: configApi.getOptionalString('organization.name') ?? 'Backstage',\n });\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n const headerActions = (\n <>\n {allowed && (\n <CreateButton\n title={t('defaultApiExplorerPage.createButtonTitle')}\n to={registerComponentLink?.()}\n />\n )}\n <SupportButton>\n {t('defaultApiExplorerPage.supportButtonTitle')}\n </SupportButton>\n </>\n );\n\n return (\n <PageWithHeader\n themeId=\"apis\"\n title={t('defaultApiExplorerPage.title')}\n subtitle={generatedSubtitle}\n pageTitleOverride={t('defaultApiExplorerPage.pageTitleOverride')}\n >\n <Content>\n <ContentHeader title=\"\">{headerActions}</ContentHeader>\n <ApiExplorerPageContent\n initiallySelectedFilter={initiallySelectedFilter}\n columns={columns}\n actions={actions}\n ownerPickerMode={ownerPickerMode}\n pagination={pagination}\n />\n </Content>\n </PageWithHeader>\n );\n};\n\nexport const NfsApiExplorerPage = (props: DefaultApiExplorerPageProps) => {\n const {\n initiallySelectedFilter = 'all',\n columns,\n actions,\n ownerPickerMode,\n pagination,\n } = props;\n\n const configApi = useApi(configApiRef);\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const generatedSubtitle = t('defaultApiExplorerPage.subtitle', {\n orgName: configApi.getOptionalString('organization.name') ?? 'Backstage',\n });\n const registerComponentLink = useRouteRef(registerComponentRouteRef);\n const { allowed } = usePermission({\n permission: catalogEntityCreatePermission,\n });\n const headerActions = (\n <>\n {allowed && (\n <CreateButton\n title={t('defaultApiExplorerPage.createButtonTitle')}\n to={registerComponentLink?.()}\n />\n )}\n <SupportButton>\n {t('defaultApiExplorerPage.supportButtonTitle')}\n </SupportButton>\n </>\n );\n\n return (\n <>\n <HeaderPage title={generatedSubtitle} customActions={headerActions} />\n <Content>\n <ApiExplorerPageContent\n initiallySelectedFilter={initiallySelectedFilter}\n columns={columns}\n actions={actions}\n ownerPickerMode={ownerPickerMode}\n pagination={pagination}\n />\n </Content>\n </>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AA+CA,MAAM,cAAA,GAAiD;AAAA,EACrD,aAAa,OAAA,CAAQ,iBAAA,CAAkB,EAAE,MAAA,EAAQ,MAAM,CAAA;AAAA,EACvD,aAAa,OAAA,CAAQ,gBAAA,CAAiB,EAAE,WAAA,EAAa,OAAO,CAAA;AAAA,EAC5D,YAAA,CAAa,QAAQ,kBAAA,EAAmB;AAAA,EACxC,YAAA,CAAa,QAAQ,iBAAA,EAAkB;AAAA,EACvC,YAAA,CAAa,QAAQ,o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ACC,uBAAA;AAAA,QACA,OAAA;AAAA,QACA,OAAA;AAAA,QACA,eAAA;AAAA,QACA;AAAA;AAAA,KACF,EACF;AAAA,GAAA,EACF,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConsumedApisCard.esm.js","sources":["../../../src/components/ApisCards/ConsumedApisCard.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, RELATION_CONSUMES_API } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n EntityRelationCard,\n EntityColumnConfig,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { getApiEntityColumns, getApiEntityColumnConfig } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\n\n/** @public */\nexport interface ConsumedApisCardProps {\n title?: string;\n columnConfig?: EntityColumnConfig[];\n}\n\n/**\n * Props for the legacy MUI-based rendering.\n * @deprecated Use {@link ConsumedApisCardProps} instead.\n * @public\n */\nexport interface ConsumedApisCardLegacyProps {\n title?: string;\n /** @deprecated Use `columnConfig` instead. */\n variant?: InfoCardVariants;\n /** @deprecated Use `columnConfig` instead. */\n columns?: TableColumn<ApiEntity>[];\n /** @deprecated Use `columnConfig` instead. */\n tableOptions?: TableOptions;\n}\n\nfunction isLegacyProps(\n props: ConsumedApisCardProps | ConsumedApisCardLegacyProps,\n): props is ConsumedApisCardLegacyProps {\n return 'variant' in props || 'columns' in props || 'tableOptions' in props;\n}\n\nfunction ConsumedApisCardLegacy(props: ConsumedApisCardLegacyProps) {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const {\n variant = 'gridItem',\n title = t('consumedApisCard.title'),\n columns = getApiEntityColumns(t),\n tableOptions = {},\n } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_CONSUMES_API,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\n <WarningPanel\n severity=\"error\"\n title={t('consumedApisCard.error.title')}\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n {t('consumedApisCard.emptyContent.title', {\n entity: entity.kind.toLowerCase(),\n })}\n </Typography>\n <Typography variant=\"body2\">\n <Link\n to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional\"\n externalLinkIcon\n >\n {t('apisCardHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n tableOptions={tableOptions}\n entities={entities as ApiEntity[]}\n />\n );\n}\n\n/**\n * @public\n */\nexport const ConsumedApisCard = (\n props: ConsumedApisCardProps | ConsumedApisCardLegacyProps,\n) => {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const { entity } = useEntity();\n\n if (isLegacyProps(props)) {\n return <ConsumedApisCardLegacy {...props} />;\n }\n\n const {\n title = t('consumedApisCard.title'),\n columnConfig = getApiEntityColumnConfig(t),\n } = props;\n\n return (\n <EntityRelationCard\n title={title}\n relationType={RELATION_CONSUMES_API}\n columnConfig={columnConfig}\n emptyState={{\n message: t('consumedApisCard.emptyContent.title', {\n entity: entity.kind.toLowerCase(),\n }),\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional',\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA8DA,SAAS,cACP,KAAA,EACsC;AACtC,EAAA,OAAO,SAAA,IAAa,KAAA,IAAS,SAAA,IAAa,KAAA,IAAS,cAAA,IAAkB,KAAA;AACvE;AAEA,SAAS,uBAAuB,KAAA,EAAoC;AAClE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM;AAAA,IACJ,OAAA,GAAU,UAAA;AAAA,IACV,KAAA,GAAQ,EAAE,wBAAwB,CAAA;AAAA,IAClC,OAAA,GAAU,oBAAoB,CAAC,CAAA;AAAA,IAC/B,eAAe;AAAC,GAClB,GAAI,KAAA;AACJ,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,EAAE,QAAA,EAAU,OAAA,EAAS,KAAA,EAAM,GAAI,mBAAmB,MAAA,EAAQ;AAAA,IAC9D,IAAA,EAAM;AAAA,GACP,CAAA;AAED,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,2BACG,QAAA,EAAA,EAAS,OAAA,EAAkB,KAAA,EAC1B,QAAA,kBAAA,GAAA,CAAC,YAAS,CAAA,EACZ,CAAA;AAAA,EAEJ;AAEA,EAAA,IAAI,KAAA,IAAS,CAAC,QAAA,EAAU;AACtB,IAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAS,OAAA,EAAkB,KAAA,EAC1B,QAAA,kBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,QAAA,EAAS,OAAA;AAAA,QACT,KAAA,EAAO,EAAE,8BAA8B,CAAA;AAAA,QACvC,OAAA,sBAAU,WAAA,EAAA,EAAY,IAAA,EAAM,GAAG,KAAK,CAAA,CAAA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AC,kBAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,YAAA,EAAc,qBAAA;AAAA,MACd,YAAA;AAAA,MACA,UAAA,EAAY;AAAA,QACV,OAAA,EAAS,EAAE,qCAAA,EAAuC;AAAA,UAChD,MAAA,EAAQ,MAAA,CAAO,IAAA,CAAK,WAAA;AAAY,SACjC,CAAA;AAAA,QACD,QAAA,EACE;AAAA;AACJ;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"ConsumedApisCard.esm.js","sources":["../../../src/components/ApisCards/ConsumedApisCard.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, RELATION_CONSUMES_API } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n EntityRelationCard,\n EntityColumnConfig,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { getApiEntityColumns, getApiEntityColumnConfig } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\n\n/** @public */\nexport interface ConsumedApisCardProps {\n title?: string;\n columnConfig?: EntityColumnConfig[];\n}\n\n/**\n * Props for the legacy MUI-based rendering.\n * @deprecated Use {@link ConsumedApisCardProps} instead.\n * @public\n */\nexport interface ConsumedApisCardLegacyProps {\n title?: string;\n /** @deprecated Use `columnConfig` instead. */\n variant?: InfoCardVariants;\n /** @deprecated Use `columnConfig` instead. */\n columns?: TableColumn<ApiEntity>[];\n /** @deprecated Use `columnConfig` instead. */\n tableOptions?: TableOptions;\n}\n\nfunction isLegacyProps(\n props: ConsumedApisCardProps | ConsumedApisCardLegacyProps,\n): props is ConsumedApisCardLegacyProps {\n return 'variant' in props || 'columns' in props || 'tableOptions' in props;\n}\n\nfunction ConsumedApisCardLegacy(props: ConsumedApisCardLegacyProps) {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const {\n variant = 'gridItem',\n title = t('consumedApisCard.title'),\n columns = getApiEntityColumns(t),\n tableOptions = {},\n } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_CONSUMES_API,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\n <WarningPanel\n severity=\"error\"\n title={t('consumedApisCard.error.title')}\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n {t('consumedApisCard.emptyContent.title', {\n entity: entity.kind.toLowerCase(),\n })}\n </Typography>\n <Typography variant=\"body2\">\n <Link\n to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional\"\n externalLinkIcon\n >\n {t('apisCardHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n tableOptions={tableOptions}\n entities={entities as ApiEntity[]}\n />\n );\n}\n\n/**\n * @public\n */\nexport const ConsumedApisCard = (\n props: ConsumedApisCardProps | ConsumedApisCardLegacyProps,\n) => {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const { entity } = useEntity();\n\n if (isLegacyProps(props)) {\n return <ConsumedApisCardLegacy {...props} />;\n }\n\n const {\n title = t('consumedApisCard.title'),\n columnConfig = getApiEntityColumnConfig(t),\n } = props;\n\n return (\n <EntityRelationCard\n title={title}\n relationType={RELATION_CONSUMES_API}\n columnConfig={columnConfig}\n emptyState={{\n message: t('consumedApisCard.emptyContent.title', {\n entity: entity.kind.toLowerCase(),\n }),\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional',\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA8DA,SAAS,cACP,KAAA,EACsC;AACtC,EAAA,OAAO,SAAA,IAAa,KAAA,IAAS,SAAA,IAAa,KAAA,IAAS,cAAA,IAAkB,KAAA;AACvE;AAEA,SAAS,uBAAuB,KAAA,EAAoC;AAClE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM;AAAA,IACJ,OAAA,GAAU,UAAA;AAAA,IACV,KAAA,GAAQ,EAAE,wBAAwB,CAAA;AAAA,IAClC,OAAA,GAAU,oBAAoB,CAAC,CAAA;AAAA,IAC/B,eAAe;AAAC,GAClB,GAAI,KAAA;AACJ,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,EAAE,QAAA,EAAU,OAAA,EAAS,KAAA,EAAM,GAAI,mBAAmB,MAAA,EAAQ;AAAA,IAC9D,IAAA,EAAM;AAAA,GACP,CAAA;AAED,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,2BACG,QAAA,EAAA,EAAS,OAAA,EAAkB,KAAA,EAC1B,QAAA,kBAAA,GAAA,CAAC,YAAS,CAAA,EACZ,CAAA;AAAA,EAEJ;AAEA,EAAA,IAAI,KAAA,IAAS,CAAC,QAAA,EAAU;AACtB,IAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAS,OAAA,EAAkB,KAAA,EAC1B,QAAA,kBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,Q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AAAA,IACJ,KAAA,GAAQ,EAAE,wBAAwB,CAAA;AAAA,IAClC,YAAA,GAAe,yBAAyB,CAAC;AAAA,GAC3C,GAAI,KAAA;AAEJ,EAAA,uBACE,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,YAAA,EAAc,qBAAA;AAAA,MACd,YAAA;AAAA,MACA,UAAA,EAAY;AAAA,QACV,OAAA,EAAS,EAAE,qCAAA,EAAuC;AAAA,UAChD,MAAA,EAAQ,MAAA,CAAO,IAAA,CAAK,WAAA;AAAY,SACjC,CAAA;AAAA,QACD,QAAA,EACE;AAAA;AACJ;AAAA,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"HasApisCard.esm.js","sources":["../../../src/components/ApisCards/HasApisCard.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, RELATION_HAS_PART } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n EntityRelationCard,\n EntityColumnConfig,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { useMemo } from 'react';\nimport { createSpecApiTypeColumn, getHasApisColumnConfig } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\n\n/** @public */\nexport interface HasApisCardProps {\n title?: string;\n columnConfig?: EntityColumnConfig[];\n}\n\n/**\n * Props for the legacy MUI-based rendering.\n * @deprecated Use {@link HasApisCardProps} instead.\n * @public\n */\nexport interface HasApisCardLegacyProps {\n title?: string;\n /** @deprecated Use `columnConfig` instead. */\n variant?: InfoCardVariants;\n /** @deprecated Use `columnConfig` instead. */\n columns?: TableColumn<ApiEntity>[];\n /** @deprecated Use `columnConfig` instead. */\n tableOptions?: TableOptions;\n}\n\nfunction isLegacyProps(\n props: HasApisCardProps | HasApisCardLegacyProps,\n): props is HasApisCardLegacyProps {\n return 'variant' in props || 'columns' in props || 'tableOptions' in props;\n}\n\nfunction HasApisCardLegacy(props: HasApisCardLegacyProps) {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const presetColumns: TableColumn<ApiEntity>[] = useMemo(() => {\n return [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(t),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n ];\n }, [t]);\n const {\n variant = 'gridItem',\n title = t('hasApisCard.title'),\n columns = presetColumns,\n tableOptions = {},\n } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_HAS_PART,\n kind: 'API',\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\n <WarningPanel\n severity=\"error\"\n title={t('hasApisCard.error.title')}\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n {t('hasApisCard.emptyContent.title', {\n entity: entity.kind.toLowerCase(),\n })}\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#kind-api\">\n {t('apisCardHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n tableOptions={tableOptions}\n entities={entities as ApiEntity[]}\n />\n );\n}\n\n/**\n * @public\n */\nexport const HasApisCard = (\n props: HasApisCardProps | HasApisCardLegacyProps,\n) => {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const { entity } = useEntity();\n\n if (isLegacyProps(props)) {\n return <HasApisCardLegacy {...props} />;\n }\n\n const {\n title = t('hasApisCard.title'),\n columnConfig = getHasApisColumnConfig(t),\n } = props;\n\n return (\n <EntityRelationCard\n title={title}\n entityKind=\"API\"\n relationType={RELATION_HAS_PART}\n columnConfig={columnConfig}\n emptyState={{\n message: t('hasApisCard.emptyContent.title', {\n entity: entity.kind.toLowerCase(),\n }),\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-api',\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;AA+DA,SAAS,cACP,KAAA,EACiC;AACjC,EAAA,OAAO,SAAA,IAAa,KAAA,IAAS,SAAA,IAAa,KAAA,IAAS,cAAA,IAAkB,KAAA;AACvE;AAEA,SAAS,kBAAkB,KAAA,EAA+B;AACxD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM,aAAA,GAA0C,QAAQ,MAAM;AAC5D,IAAA,OAAO;AAAA,MACL,YAAY,OAAA,CAAQ,qBAAA,CAAsB,EAAE,WAAA,EAAa,OAAO,CAAA;AAAA,MAChE,WAAA,CAAY,QAAQ,iBAAA,EAAkB;AAAA,MACtC,wBAAwB,CAAC,CAAA;AAAA,MACzB,WAAA,CAAY,QAAQ,yBAAA,EAA0B;AAAA,MAC9C,WAAA,CAAY,QAAQ,+BAAA;AAAgC,KACtD;AAAA,EACF,CAAA,EAAG,CAAC,CAAC,CAAC,CAAA;AACN,EAAA,MAAM;AAAA,IACJ,OAA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AA;AAAY,SACjC,CAAA,EACH,CAAA;AAAA,wBACA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EAClB,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,EAAA,EAAG,gFAAA,EACN,QAAA,EAAA,CAAA,CAAE,uBAAuB,CAAA,EAC5B,CAAA,EACF;AAAA,OAAA,EACF,CAAA;AAAA,MAEF,OAAA;AAAA,MACA,YAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;AAKO,MAAM,WAAA,GAAc,CACzB,KAAA,KACG;AACH,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAE7B,EAAA,IAAI,aAAA,CAAc,KAAK,CAAA,EAAG;AACxB,IAAA,uBAAO,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,KAAA,EAAO,CAAA;AAAA,EACvC;AAEA,EAAA,MAAM;AAAA,IACJ,KAAA,GAAQ,EAAE,mBAAmB,CAAA;AAAA,IAC7B,YAAA,GAAe,uBAAuB,CAAC;AAAA,GACzC,GAAI,KAAA;AAEJ,EAAA,uBACE,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,UAAA,EAAW,KAAA;AAAA,MACX,YAAA,EAAc,iBAAA;AAAA,MACd,YAAA;AAAA,MACA,UAAA,EAAY;AAAA,QACV,OAAA,EAAS,EAAE,gCAAA,EAAkC;AAAA,UAC3C,MAAA,EAAQ,MAAA,CAAO,IAAA,CAAK,WAAA;AAAY,SACjC,CAAA;AAAA,QACD,QAAA,EACE;AAAA;AACJ;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"HasApisCard.esm.js","sources":["../../../src/components/ApisCards/HasApisCard.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, RELATION_HAS_PART } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n EntityRelationCard,\n EntityColumnConfig,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { useMemo } from 'react';\nimport { createSpecApiTypeColumn, getHasApisColumnConfig } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\n\n/** @public */\nexport interface HasApisCardProps {\n title?: string;\n columnConfig?: EntityColumnConfig[];\n}\n\n/**\n * Props for the legacy MUI-based rendering.\n * @deprecated Use {@link HasApisCardProps} instead.\n * @public\n */\nexport interface HasApisCardLegacyProps {\n title?: string;\n /** @deprecated Use `columnConfig` instead. */\n variant?: InfoCardVariants;\n /** @deprecated Use `columnConfig` instead. */\n columns?: TableColumn<ApiEntity>[];\n /** @deprecated Use `columnConfig` instead. */\n tableOptions?: TableOptions;\n}\n\nfunction isLegacyProps(\n props: HasApisCardProps | HasApisCardLegacyProps,\n): props is HasApisCardLegacyProps {\n return 'variant' in props || 'columns' in props || 'tableOptions' in props;\n}\n\nfunction HasApisCardLegacy(props: HasApisCardLegacyProps) {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const presetColumns: TableColumn<ApiEntity>[] = useMemo(() => {\n return [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(t),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n ];\n }, [t]);\n const {\n variant = 'gridItem',\n title = t('hasApisCard.title'),\n columns = presetColumns,\n tableOptions = {},\n } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_HAS_PART,\n kind: 'API',\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\n <WarningPanel\n severity=\"error\"\n title={t('hasApisCard.error.title')}\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n {t('hasApisCard.emptyContent.title', {\n entity: entity.kind.toLowerCase(),\n })}\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#kind-api\">\n {t('apisCardHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n tableOptions={tableOptions}\n entities={entities as ApiEntity[]}\n />\n );\n}\n\n/**\n * @public\n */\nexport const HasApisCard = (\n props: HasApisCardProps | HasApisCardLegacyProps,\n) => {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const { entity } = useEntity();\n\n if (isLegacyProps(props)) {\n return <HasApisCardLegacy {...props} />;\n }\n\n const {\n title = t('hasApisCard.title'),\n columnConfig = getHasApisColumnConfig(t),\n } = props;\n\n return (\n <EntityRelationCard\n title={title}\n entityKind=\"API\"\n relationType={RELATION_HAS_PART}\n columnConfig={columnConfig}\n emptyState={{\n message: t('hasApisCard.emptyContent.title', {\n entity: entity.kind.toLowerCase(),\n }),\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#kind-api',\n }}\n />\n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AAmB,GAAG,KAAA,EAAO,CAAA;AAAA,EACvC;AAEA,EAAA,MAAM;AAAA,IACJ,KAAA,GAAQ,EAAE,mBAAmB,CAAA;AAAA,IAC7B,YAAA,GAAe,uBAAuB,CAAC;AAAA,GACzC,GAAI,KAAA;AAEJ,EAAA,uBACE,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,UAAA,EAAW,KAAA;AAAA,MACX,YAAA,EAAc,iBAAA;AAAA,MACd,YAAA;AAAA,MACA,UAAA,EAAY;AAAA,QACV,OAAA,EAAS,EAAE,gCAAA,EAAkC;AAAA,UAC3C,MAAA,EAAQ,MAAA,CAAO,IAAA,CAAK,WAAA;AAAY,SACjC,CAAA;AAAA,QACD,QAAA,EACE;AAAA;AACJ;AAAA,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProvidedApisCard.esm.js","sources":["../../../src/components/ApisCards/ProvidedApisCard.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, RELATION_PROVIDES_API } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n EntityRelationCard,\n EntityColumnConfig,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { getApiEntityColumns, getApiEntityColumnConfig } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\n\n/** @public */\nexport interface ProvidedApisCardProps {\n title?: string;\n columnConfig?: EntityColumnConfig[];\n}\n\n/**\n * Props for the legacy MUI-based rendering.\n * @deprecated Use {@link ProvidedApisCardProps} instead.\n * @public\n */\nexport interface ProvidedApisCardLegacyProps {\n title?: string;\n /** @deprecated Use `columnConfig` instead. */\n variant?: InfoCardVariants;\n /** @deprecated Use `columnConfig` instead. */\n columns?: TableColumn<ApiEntity>[];\n /** @deprecated Use `columnConfig` instead. */\n tableOptions?: TableOptions;\n}\n\nfunction isLegacyProps(\n props: ProvidedApisCardProps | ProvidedApisCardLegacyProps,\n): props is ProvidedApisCardLegacyProps {\n return 'variant' in props || 'columns' in props || 'tableOptions' in props;\n}\n\nfunction ProvidedApisCardLegacy(props: ProvidedApisCardLegacyProps) {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const {\n variant = 'gridItem',\n title = t('providedApisCard.title'),\n columns = getApiEntityColumns(t),\n tableOptions = {},\n } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_PROVIDES_API,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\n <WarningPanel\n severity=\"error\"\n title={t('providedApisCard.error.title')}\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n {t('providedApisCard.emptyContent.title', {\n entity: entity.kind.toLowerCase(),\n })}\n </Typography>\n <Typography variant=\"body2\">\n <Link\n to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional\"\n externalLinkIcon\n >\n {t('apisCardHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n tableOptions={tableOptions}\n entities={entities as ApiEntity[]}\n />\n );\n}\n\n/**\n * @public\n */\nexport const ProvidedApisCard = (\n props: ProvidedApisCardProps | ProvidedApisCardLegacyProps,\n) => {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const { entity } = useEntity();\n\n if (isLegacyProps(props)) {\n return <ProvidedApisCardLegacy {...props} />;\n }\n\n const {\n title = t('providedApisCard.title'),\n columnConfig = getApiEntityColumnConfig(t),\n } = props;\n\n return (\n <EntityRelationCard\n title={title}\n relationType={RELATION_PROVIDES_API}\n columnConfig={columnConfig}\n emptyState={{\n message: t('providedApisCard.emptyContent.title', {\n entity: entity.kind.toLowerCase(),\n }),\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional',\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA8DA,SAAS,cACP,KAAA,EACsC;AACtC,EAAA,OAAO,SAAA,IAAa,KAAA,IAAS,SAAA,IAAa,KAAA,IAAS,cAAA,IAAkB,KAAA;AACvE;AAEA,SAAS,uBAAuB,KAAA,EAAoC;AAClE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM;AAAA,IACJ,OAAA,GAAU,UAAA;AAAA,IACV,KAAA,GAAQ,EAAE,wBAAwB,CAAA;AAAA,IAClC,OAAA,GAAU,oBAAoB,CAAC,CAAA;AAAA,IAC/B,eAAe;AAAC,GAClB,GAAI,KAAA;AACJ,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,EAAE,QAAA,EAAU,OAAA,EAAS,KAAA,EAAM,GAAI,mBAAmB,MAAA,EAAQ;AAAA,IAC9D,IAAA,EAAM;AAAA,GACP,CAAA;AAED,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,2BACG,QAAA,EAAA,EAAS,OAAA,EAAkB,KAAA,EAC1B,QAA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BAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAE7B,EAAA,IAAI,aAAA,CAAc,KAAK,CAAA,EAAG;AACxB,IAAA,uBAAO,GAAA,CAAC,sBAAA,EAAA,EAAwB,GAAG,KAAA,EAAO,CAAA;AAAA,EAC5C;AAEA,EAAA,MAAM;AAAA,IACJ,KAAA,GAAQ,EAAE,wBAAwB,CAAA;AAAA,IAClC,YAAA,GAAe,yBAAyB,CAAC;AAAA,GAC3C,GAAI,KAAA;AAEJ,EAAA,uBACE,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,YAAA,EAAc,qBAAA;AAAA,MACd,YAAA;AAAA,MACA,UAAA,EAAY;AAAA,QACV,OAAA,EAAS,EAAE,qCAAA,EAAuC;AAAA,UAChD,MAAA,EAAQ,MAAA,CAAO,IAAA,CAAK,WAAA;AAAY,SACjC,CAAA;AAAA,QACD,QAAA,EACE;AAAA;AACJ;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"ProvidedApisCard.esm.js","sources":["../../../src/components/ApisCards/ProvidedApisCard.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, RELATION_PROVIDES_API } from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n EntityRelationCard,\n EntityColumnConfig,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { getApiEntityColumns, getApiEntityColumnConfig } from './presets';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\n\n/** @public */\nexport interface ProvidedApisCardProps {\n title?: string;\n columnConfig?: EntityColumnConfig[];\n}\n\n/**\n * Props for the legacy MUI-based rendering.\n * @deprecated Use {@link ProvidedApisCardProps} instead.\n * @public\n */\nexport interface ProvidedApisCardLegacyProps {\n title?: string;\n /** @deprecated Use `columnConfig` instead. */\n variant?: InfoCardVariants;\n /** @deprecated Use `columnConfig` instead. */\n columns?: TableColumn<ApiEntity>[];\n /** @deprecated Use `columnConfig` instead. */\n tableOptions?: TableOptions;\n}\n\nfunction isLegacyProps(\n props: ProvidedApisCardProps | ProvidedApisCardLegacyProps,\n): props is ProvidedApisCardLegacyProps {\n return 'variant' in props || 'columns' in props || 'tableOptions' in props;\n}\n\nfunction ProvidedApisCardLegacy(props: ProvidedApisCardLegacyProps) {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const {\n variant = 'gridItem',\n title = t('providedApisCard.title'),\n columns = getApiEntityColumns(t),\n tableOptions = {},\n } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_PROVIDES_API,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\n <WarningPanel\n severity=\"error\"\n title={t('providedApisCard.error.title')}\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n {t('providedApisCard.emptyContent.title', {\n entity: entity.kind.toLowerCase(),\n })}\n </Typography>\n <Typography variant=\"body2\">\n <Link\n to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional\"\n externalLinkIcon\n >\n {t('apisCardHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n tableOptions={tableOptions}\n entities={entities as ApiEntity[]}\n />\n );\n}\n\n/**\n * @public\n */\nexport const ProvidedApisCard = (\n props: ProvidedApisCardProps | ProvidedApisCardLegacyProps,\n) => {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const { entity } = useEntity();\n\n if (isLegacyProps(props)) {\n return <ProvidedApisCardLegacy {...props} />;\n }\n\n const {\n title = t('providedApisCard.title'),\n columnConfig = getApiEntityColumnConfig(t),\n } = props;\n\n return (\n <EntityRelationCard\n title={title}\n relationType={RELATION_PROVIDES_API}\n columnConfig={columnConfig}\n emptyState={{\n message: t('providedApisCard.emptyContent.title', {\n entity: entity.kind.toLowerCase(),\n }),\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional',\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;AA8DA,SAAS,cACP,KAAA,EACsC;AACtC,EAAA,OAAO,SAAA,IAAa,KAAA,IAAS,SAAA,IAAa,KAAA,IAAS,cAAA,IAAkB,KAAA;AACvE;AAEA,SAAS,uBAAuB,KAAA,EAAoC;AAClE,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM;AAAA,IACJ,OAAA,GAAU,UAAA;AAAA,IACV,KAAA,GAAQ,EAAE,wBAAwB,CAAA;AAAA,IAClC,OAAA,GAAU,oBAAoB,CAAC,CAAA;AAAA,IAC/B,eAAe;AAAC,GAClB,GAAI,KAAA;AACJ,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,EAAE,QAAA,EAAU,OAAA,EAAS,KAAA,EAAM,GAAI,mBAAmB,MAAA,EAAQ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AAA,MACA,YAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;AAKO,MAAM,gBAAA,GAAmB,CAC9B,KAAA,KACG;AACH,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAE7B,EAAA,IAAI,aAAA,CAAc,KAAK,CAAA,EAAG;AACxB,IAAA,uBAAO,GAAA,CAAC,sBAAA,EAAA,EAAwB,GAAG,KAAA,EAAO,CAAA;AAAA,EAC5C;AAEA,EAAA,MAAM;AAAA,IACJ,KAAA,GAAQ,EAAE,wBAAwB,CAAA;AAAA,IAClC,YAAA,GAAe,yBAAyB,CAAC;AAAA,GAC3C,GAAI,KAAA;AAEJ,EAAA,uBACE,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,YAAA,EAAc,qBAAA;AAAA,MACd,YAAA;AAAA,MACA,UAAA,EAAY;AAAA,QACV,OAAA,EAAS,EAAE,qCAAA,EAAuC;AAAA,UAChD,MAAA,EAAQ,MAAA,CAAO,IAAA,CAAK,WAAA;AAAY,SACjC,CAAA;AAAA,QACD,QAAA,EACE;AAAA;AACJ;AAAA,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"presets.esm.js","sources":["../../../src/components/ApisCards/presets.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport { TableColumn } from '@backstage/core-components';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport {\n EntityColumnConfig,\n entityDataTableColumns,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { ButtonIcon, Cell } from '@backstage/ui';\nimport { RiPuzzleLine } from '@remixicon/react';\nimport { useState } from 'react';\nimport { ApiTypeTitle } from '../ApiDefinitionCard';\nimport { ApiDefinitionDialog } from '../ApiDefinitionDialog';\nimport {\n TranslationFunction,\n useTranslationRef,\n} from '@backstage/core-plugin-api/alpha';\nimport { apiDocsTranslationRef } from '../../translation';\n\n/** @deprecated Use `getApiEntityColumnConfig` instead. */\nexport function createSpecApiTypeColumn(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): TableColumn<ApiEntity> {\n return {\n title: t('apiEntityColumns.typeTitle'),\n field: 'spec.type',\n render: entity => <ApiTypeTitle apiEntity={entity} />,\n };\n}\n\nconst ApiDefinitionButton = ({ apiEntity }: { apiEntity: ApiEntity }) => {\n const [dialogOpen, setDialogOpen] = useState(false);\n const { t } = useTranslationRef(apiDocsTranslationRef);\n return (\n <>\n <ButtonIcon\n aria-label={t('apiDefinitionDialog.toggleButtonAriaLabel')}\n onPress={() => setDialogOpen(!dialogOpen)}\n variant=\"tertiary\"\n size=\"small\"\n icon={<RiPuzzleLine />}\n />\n <ApiDefinitionDialog\n entity={apiEntity}\n open={dialogOpen}\n onClose={() => setDialogOpen(false)}\n />\n </>\n );\n};\n\nfunction createApiDefinitionColumn(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): TableColumn<ApiEntity> {\n return {\n title: t('apiEntityColumns.apiDefinitionTitle'),\n render: entity => <ApiDefinitionButton apiEntity={entity} />,\n };\n}\n\n/** @deprecated Use `getApiEntityColumnConfig` instead. */\nexport const getApiEntityColumns = (\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): TableColumn<ApiEntity>[] => {\n return [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createSystemColumn(),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(t),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n createApiDefinitionColumn(t),\n ];\n};\n\n// Column config presets\n\nfunction createSpecApiTypeColumnConfig(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): EntityColumnConfig {\n return {\n id: 'apiType',\n label: t('apiEntityColumns.typeTitle'),\n isSortable: true,\n cell: entity => (\n <Cell>\n <ApiTypeTitle apiEntity={entity as unknown as ApiEntity} />\n </Cell>\n ),\n sortValue: entity =>\n (entity.spec as Record<string, string> | undefined)?.type ?? '',\n };\n}\n\nfunction createApiDefinitionColumnConfig(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): EntityColumnConfig {\n return {\n id: 'apiDefinition',\n label: t('apiEntityColumns.apiDefinitionTitle'),\n cell: entity => (\n <Cell>\n <ApiDefinitionButton apiEntity={entity as unknown as ApiEntity} />\n </Cell>\n ),\n };\n}\n\nexport function getApiEntityColumnConfig(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): EntityColumnConfig[] {\n return [\n entityDataTableColumns.createEntityRefColumn({ defaultKind: 'API' }),\n entityDataTableColumns.createSystemColumn(),\n entityDataTableColumns.createOwnerColumn(),\n createSpecApiTypeColumnConfig(t),\n entityDataTableColumns.createSpecLifecycleColumn(),\n entityDataTableColumns.createMetadataDescriptionColumn(),\n createApiDefinitionColumnConfig(t),\n ];\n}\n\nexport function getHasApisColumnConfig(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): EntityColumnConfig[] {\n return [\n entityDataTableColumns.createEntityRefColumn({ defaultKind: 'API' }),\n entityDataTableColumns.createOwnerColumn(),\n createSpecApiTypeColumnConfig(t),\n entityDataTableColumns.createSpecLifecycleColumn(),\n entityDataTableColumns.createMetadataDescriptionColumn(),\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAmCO,SAAS,wBACd,CAAA,EACwB;AACxB,EAAA,OAA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,gCAAgC,CAAC;AAAA,GACnC;AACF;AAEO,SAAS,uBACd,CAAA,EACsB;AACtB,EAAA,OAAO;AAAA,IACL,sBAAA,CAAuB,qBAAA,CAAsB,EAAE,WAAA,EAAa,OAAO,CAAA;AAAA,IACnE,uBAAuB,iBAAA,EAAkB;AAAA,IACzC,8BAA8B,CAAC,CAAA;AAAA,IAC/B,uBAAuB,yBAAA,EAA0B;AAAA,IACjD,uBAAuB,+BAAA;AAAgC,GACzD;AACF;;;;"}
1
+ {"version":3,"file":"presets.esm.js","sources":["../../../src/components/ApisCards/presets.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport { TableColumn } from '@backstage/core-components';\nimport { EntityTable } from '@backstage/plugin-catalog-react';\nimport {\n EntityColumnConfig,\n entityDataTableColumns,\n} from '@backstage/plugin-catalog-react/alpha';\nimport { ButtonIcon, Cell } from '@backstage/ui';\nimport { RiPuzzleLine } from '@remixicon/react';\nimport { useState } from 'react';\nimport { ApiTypeTitle } from '../ApiDefinitionCard';\nimport { ApiDefinitionDialog } from '../ApiDefinitionDialog';\nimport {\n TranslationFunction,\n useTranslationRef,\n} from '@backstage/core-plugin-api/alpha';\nimport { apiDocsTranslationRef } from '../../translation';\n\n/** @deprecated Use `getApiEntityColumnConfig` instead. */\nexport function createSpecApiTypeColumn(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): TableColumn<ApiEntity> {\n return {\n title: t('apiEntityColumns.typeTitle'),\n field: 'spec.type',\n render: entity => <ApiTypeTitle apiEntity={entity} />,\n };\n}\n\nconst ApiDefinitionButton = ({ apiEntity }: { apiEntity: ApiEntity }) => {\n const [dialogOpen, setDialogOpen] = useState(false);\n const { t } = useTranslationRef(apiDocsTranslationRef);\n return (\n <>\n <ButtonIcon\n aria-label={t('apiDefinitionDialog.toggleButtonAriaLabel')}\n onPress={() => setDialogOpen(!dialogOpen)}\n variant=\"tertiary\"\n size=\"small\"\n icon={<RiPuzzleLine />}\n />\n <ApiDefinitionDialog\n entity={apiEntity}\n open={dialogOpen}\n onClose={() => setDialogOpen(false)}\n />\n </>\n );\n};\n\nfunction createApiDefinitionColumn(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): TableColumn<ApiEntity> {\n return {\n title: t('apiEntityColumns.apiDefinitionTitle'),\n render: entity => <ApiDefinitionButton apiEntity={entity} />,\n };\n}\n\n/** @deprecated Use `getApiEntityColumnConfig` instead. */\nexport const getApiEntityColumns = (\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): TableColumn<ApiEntity>[] => {\n return [\n EntityTable.columns.createEntityRefColumn({ defaultKind: 'API' }),\n EntityTable.columns.createSystemColumn(),\n EntityTable.columns.createOwnerColumn(),\n createSpecApiTypeColumn(t),\n EntityTable.columns.createSpecLifecycleColumn(),\n EntityTable.columns.createMetadataDescriptionColumn(),\n createApiDefinitionColumn(t),\n ];\n};\n\n// Column config presets\n\nfunction createSpecApiTypeColumnConfig(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): EntityColumnConfig {\n return {\n id: 'apiType',\n label: t('apiEntityColumns.typeTitle'),\n isSortable: true,\n cell: entity => (\n <Cell>\n <ApiTypeTitle apiEntity={entity as unknown as ApiEntity} />\n </Cell>\n ),\n sortValue: entity =>\n (entity.spec as Record<string, string> | undefined)?.type ?? '',\n };\n}\n\nfunction createApiDefinitionColumnConfig(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): EntityColumnConfig {\n return {\n id: 'apiDefinition',\n label: t('apiEntityColumns.apiDefinitionTitle'),\n cell: entity => (\n <Cell>\n <ApiDefinitionButton apiEntity={entity as unknown as ApiEntity} />\n </Cell>\n ),\n };\n}\n\nexport function getApiEntityColumnConfig(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): EntityColumnConfig[] {\n return [\n entityDataTableColumns.createEntityRefColumn({ defaultKind: 'API' }),\n entityDataTableColumns.createSystemColumn(),\n entityDataTableColumns.createOwnerColumn(),\n createSpecApiTypeColumnConfig(t),\n entityDataTableColumns.createSpecLifecycleColumn(),\n entityDataTableColumns.createMetadataDescriptionColumn(),\n createApiDefinitionColumnConfig(t),\n ];\n}\n\nexport function getHasApisColumnConfig(\n t: TranslationFunction<typeof apiDocsTranslationRef.T>,\n): EntityColumnConfig[] {\n return [\n entityDataTableColumns.createEntityRefColumn({ defaultKind: 'API' }),\n entityDataTableColumns.createOwnerColumn(),\n createSpecApiTypeColumnConfig(t),\n entityDataTableColumns.createSpecLifecycleColumn(),\n entityDataTableColumns.createMetadataDescriptionColumn(),\n ];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAmCO,SAAS,wBACd,CAAA,EACwB;AACxB,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,EAAE,4BAA4B,CAAA;AAAA,IACrC,KAAA,EAAO,WAAA;AAAA,IACP,MAAA,EAAQ,CAAA,MAAA,qBAAU,GAAA,CAAC,YAAA,EAAA,EAAa,WAAW,MAAA,EAAQ;AAAA,GACrD;AACF;AAEA,MAAM,mBAAA,GAAsB,CAAC,EAAE,SAAA,EAAU,KAAgC;AACvE,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,KAAK,CAAA;AAClD,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,uBACE,IAAA,CAAA,QAAA,EAAA,EACE,QAAA,EAAA;AAAA,oBAAA,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,YA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,8BAAC,YAAA,EAAA,EAAa,SAAA,EAAW,QAAgC,CAAA,EAC3D,CAAA;AAAA,IAEF,SAAA,EAAW,CAAA,MAAA,KACR,MAAA,CAAO,IAAA,EAA6C,IAAA,IAAQ;AAAA,GACjE;AACF;AAEA,SAAS,gCACP,CAAA,EACoB;AACpB,EAAA,OAAO;AAAA,IACL,EAAA,EAAI,eAAA;AAAA,IACJ,KAAA,EAAO,EAAE,qCAAqC,CAAA;AAAA,IAC9C,IAAA,EAAM,4BACJ,GAAA,CAAC,IAAA,EAAA,EACC,8BAAC,mBAAA,EAAA,EAAoB,SAAA,EAAW,QAAgC,CAAA,EAClE;AAAA,GAEJ;AACF;AAEO,SAAS,yBACd,CAAA,EACsB;AACtB,EAAA,OAAO;AAAA,IACL,sBAAA,CAAuB,qBAAA,CAAsB,EAAE,WAAA,EAAa,OAAO,CAAA;AAAA,IACnE,uBAAuB,kBAAA,EAAmB;AAAA,IAC1C,uBAAuB,iBAAA,EAAkB;AAAA,IACzC,8BAA8B,CAAC,CAAA;AAAA,IAC/B,uBAAuB,yBAAA,EAA0B;AAAA,IACjD,uBAAuB,+BAAA,EAAgC;AAAA,IACvD,gCAAgC,CAAC;AAAA,GACnC;AACF;AAEO,SAAS,uBACd,CAAA,EACsB;AACtB,EAAA,OAAO;AAAA,IACL,sBAAA,CAAuB,qBAAA,CAAsB,EAAE,WAAA,EAAa,OAAO,CAAA;AAAA,IACnE,uBAAuB,iBAAA,EAAkB;AAAA,IACzC,8BAA8B,CAAC,CAAA;AAAA,IAC/B,uBAAuB,yBAAA,EAA0B;AAAA,IACjD,uBAAuB,+BAAA;AAAgC,GACzD;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AsyncApiDefinition.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 { useTheme } from '@material-ui/core/styles';\n\n/** @public */\nexport type AsyncApiResolver = {\n schema: string;\n order: number;\n canRead: boolean;\n read(uri: any): Promise<string>;\n};\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, code': {\n color: theme.palette.text.primary,\n },\n '& a': {\n color: theme.palette.link,\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: AsyncApiResolver = {\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: AsyncApiResolver = {\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\ntype Props = {\n definition: string;\n resolvers?: AsyncApiResolver[];\n};\n\nexport const AsyncApiDefinition = ({\n definition,\n resolvers,\n}: 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 const config = {\n parserOptions: {\n __unstable: {\n resolver: {\n resolvers: [httpsFetchResolver, httpFetchResolver],\n },\n },\n },\n };\n\n // Overwrite default resolvers if custom ones are set\n if (resolvers) {\n config.parserOptions.__unstable.resolver.resolvers = resolvers;\n }\n\n return (\n <div className={classNames}>\n <AsyncApi schema={definition} config={config} />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AA6BA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,SAAA;AAAA,IACZ,aAAA,EAAe;AAAA,MACb,UAAA,EAAY;AAAA,KACd;AAAA,IACA,aAAA,EAAe;AAAA,MACb,GAAG,MAAM,UAAA,CAAW;AAAA,KACtB;AAAA,IACA,OAAA,EAAS;AAAA,MACP,GAAG,MAAM,UAAA,CAAW;AAAA,KACtB;AAAA,IACA,WAAA,EAAa;AAAA,MACX,WAAA,EAAa,KAAA,CAAM,KAAA,CAAM,OAAA,CAAQ,QAAQ,GAAG;AAAA,KAC9C;AAAA,IACA,cAAA,EAAgB;AAAA,MACd,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,aAAA,EAAe;AAAA,MACb,OAAA,EAAS;AAAA,KACX;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO;AAAA,KACxC;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK;AAAA,KACtC;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK;AAAA,KACtC;AAAA,IACA,kBAAA,EAAoB;AAAA,MAClB,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,OAAA,CAAQ;AAAA,KACzC;AAAA,IACA,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO;AA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AA,EAAG,OAAA,CAAQ,IAAI,CAAA,CAAA,EAChC,KAAA,CAAM,OAAA,CAAQ,IAAA,KAAS,MAAA,GAAS,OAAA,CAAQ,IAAA,GAAO,EACjD,CAAA,CAAA;AAEA,EAAA,MAAM,MAAA,GAAS;AAAA,IACb,aAAA,EAAe;AAAA,MACb,UAAA,EAAY;AAAA,QACV,QAAA,EAAU;AAAA,UACR,SAAA,EAAW,CAAC,kBAAA,EAAoB,iBAAiB;AAAA;AACnD;AACF;AACF,GACF;AAGA,EAAA,IAAI,SAAA,EAAW;AACb,IAAA,MAAA,CAAO,aAAA,CAAc,UAAA,CAAW,QAAA,CAAS,SAAA,GAAY,SAAA;AAAA,EACvD;AAEA,EAAA,uBACE,GAAA,CAAC,SAAI,SAAA,EAAW,UAAA,EACd,8BAAC,QAAA,EAAA,EAAS,MAAA,EAAQ,UAAA,EAAY,MAAA,EAAgB,CAAA,EAChD,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"AsyncApiDefinition.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 { useTheme } from '@material-ui/core/styles';\n\n/** @public */\nexport type AsyncApiResolver = {\n schema: string;\n order: number;\n canRead: boolean;\n read(uri: any): Promise<string>;\n};\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, code': {\n color: theme.palette.text.primary,\n },\n '& a': {\n color: theme.palette.link,\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: AsyncApiResolver = {\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: AsyncApiResolver = {\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\ntype Props = {\n definition: string;\n resolvers?: AsyncApiResolver[];\n};\n\nexport const AsyncApiDefinition = ({\n definition,\n resolvers,\n}: 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 const config = {\n parserOptions: {\n __unstable: {\n resolver: {\n resolvers: [httpsFetchResolver, httpFetchResolver],\n },\n },\n },\n };\n\n // Overwrite default resolvers if custom ones are set\n if (resolvers) {\n config.parserOptions.__unstable.resolver.resolvers = resolvers;\n }\n\n return (\n <div className={classNames}>\n <AsyncApi schema={definition} config={config} />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AA6BA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,IAAA,EAAM;AAAA,IACJ,UAAA,EAAY,SAAA;AAAA,IACZ,aAAA,EAAe;AAAA,MACb,UAAA,EAAY;AAAA,KACd;AAAA,IACA,aAAA,EAAe;AAAA,MACb,GAAG,MAAM,UAAA,CAAW;AAAA,KACtB;AAA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E,GAAA,CAAC,SAAI,SAAA,EAAW,UAAA,EACd,8BAAC,QAAA,EAAA,EAAS,MAAA,EAAQ,UAAA,EAAY,MAAA,EAAgB,CAAA,EAChD,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AsyncApiDefinitionWidget.esm.js","sources":["../../../src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.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 { Progress } from '@backstage/core-components';\nimport { lazy, Suspense } from 'react';\nimport { AsyncApiResolver } from './AsyncApiDefinition';\n\n// The asyncapi component and related CSS has a significant size, only load it\n// if the element is actually used.\nconst LazyAsyncApiDefinition = lazy(() =>\n import('./AsyncApiDefinition').then(m => ({\n default: m.AsyncApiDefinition,\n })),\n);\n\n/** @public */\nexport type AsyncApiDefinitionWidgetProps = {\n definition: string;\n resolvers?: AsyncApiResolver[];\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"],"names":[],"mappings":";;;;AAsBA,MAAM,sBAAA,GAAyB,IAAA;AAAA,EAAK,MAClC,OAAO,6BAAsB,CAAA,CAAE,KAAK,CAAA,CAAA,MAAM;AAAA,IACxC,SAAS,CAAA,CAAE;AAAA,GACb,CAAE;AACJ,CAAA;AASO,MAAM,wBAAA,GAA2B,CACtC,KAAA,KACG;AACH,EAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAS,QAAA,kBAAU,GAAA,CAAC,QAAA,EAAA,EAAS,GAC5B,QAAA,kBAAA,GAAA,CAAC,sBAAA,EAAA,EAAwB,GAAG,KAAA,EAAO,CAAA,EACrC,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"AsyncApiDefinitionWidget.esm.js","sources":["../../../src/components/AsyncApiDefinitionWidget/AsyncApiDefinitionWidget.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 { Progress } from '@backstage/core-components';\nimport { lazy, Suspense } from 'react';\nimport { AsyncApiResolver } from './AsyncApiDefinition';\n\n// The asyncapi component and related CSS has a significant size, only load it\n// if the element is actually used.\nconst LazyAsyncApiDefinition = lazy(() =>\n import('./AsyncApiDefinition').then(m => ({\n default: m.AsyncApiDefinition,\n })),\n);\n\n/** @public */\nexport type AsyncApiDefinitionWidgetProps = {\n definition: string;\n resolvers?: AsyncApiResolver[];\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"],"names":[],"mappings":";;;;AAsBA,MAAM,sBAAA,GAAyB,IAAA;AAAA,EAAK,MAClC,OAAO,6BAAsB,CAAA,CAAE,KAAK,CAAA,CAAA,MAAM;AAAA,IACxC,SAAS,CAAA,CAAE;AAAA,GACb,CAAE;AACJ,CAAA;AASO,MAAM,wBAAA,GAA2B,CACtC,KAAA,KACG;AACH,EAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAS,QAAA,kBAAU,GAAA,CAAC,QAAA,EAAA,EAAS,GAC5B,QAAA,kBAAA,GAAA,CAAC,sBAAA,EAAA,EAAwB,GAAG,KAAA,EAAO,CAAA,EACrC,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConsumingComponentsCard.esm.js","sources":["../../../src/components/ComponentsCards/ConsumingComponentsCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ComponentEntity,\n RELATION_API_CONSUMED_BY,\n} from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n EntityRelationCard,\n EntityColumnConfig,\n entityColumnPresets,\n} from '@backstage/plugin-catalog-react/alpha';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\n\n/** @public */\nexport interface ConsumingComponentsCardProps {\n title?: string;\n columnConfig?: EntityColumnConfig[];\n}\n\n/**\n * Props for the legacy MUI-based rendering.\n * @deprecated Use {@link ConsumingComponentsCardProps} instead.\n * @public\n */\nexport interface ConsumingComponentsCardLegacyProps {\n title?: string;\n /** @deprecated Use `columnConfig` instead. */\n variant?: InfoCardVariants;\n /** @deprecated Use `columnConfig` instead. */\n columns?: TableColumn<ComponentEntity>[];\n /** @deprecated Use `columnConfig` instead. */\n tableOptions?: TableOptions;\n}\n\nfunction isLegacyProps(\n props: ConsumingComponentsCardProps | ConsumingComponentsCardLegacyProps,\n): props is ConsumingComponentsCardLegacyProps {\n return 'variant' in props || 'columns' in props || 'tableOptions' in props;\n}\n\nfunction ConsumingComponentsCardLegacy(\n props: ConsumingComponentsCardLegacyProps,\n) {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const {\n variant = 'gridItem',\n title = t('consumingComponentsCard.title'),\n columns = EntityTable.componentEntityColumns,\n tableOptions = {},\n } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_API_CONSUMED_BY,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\n <WarningPanel\n severity=\"error\"\n title={t('consumingComponentsCard.error.title')}\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n {t('consumingComponentsCard.emptyContent.title')}\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional\">\n {t('apisCardHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n tableOptions={tableOptions}\n entities={entities as ComponentEntity[]}\n />\n );\n}\n\n/**\n * @public\n */\nexport const ConsumingComponentsCard = (\n props: ConsumingComponentsCardProps | ConsumingComponentsCardLegacyProps,\n) => {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n\n if (isLegacyProps(props)) {\n return <ConsumingComponentsCardLegacy {...props} />;\n }\n\n const {\n title = t('consumingComponentsCard.title'),\n columnConfig = entityColumnPresets.component.columns,\n } = props;\n\n return (\n <EntityRelationCard\n title={title}\n relationType={RELATION_API_CONSUMED_BY}\n columnConfig={columnConfig}\n emptyState={{\n message: t('consumingComponentsCard.emptyContent.title'),\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional',\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAiEA,SAAS,cACP,KAAA,EAC6C;AAC7C,EAAA,OAAO,SAAA,IAAa,KAAA,IAAS,SAAA,IAAa,KAAA,IAAS,cAAA,IAAkB,KAAA;AACvE;AAEA,SAAS,8BACP,KAAA,EACA;AACA,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM;AAAA,IACJ,OAAA,GAAU,UAAA;AAAA,IACV,KAAA,GAAQ,EAAE,+BAA+B,CAAA;AAAA,IACzC,UAAU,WAAA,CAAY,sBAAA;AAAA,IACtB,eAAe;AAAC,GAClB,GAAI,KAAA;AACJ,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,EAAE,QAAA,EAAU,OAAA,EAAS,KAAA,EAAM,GAAI,mBAAmB,MAAA,EAAQ;AAAA,IAC9D,IAAA,EAAM;AAAA,GACP,CAAA;AAED,EAAA,IAAI,OAAA,EAAS;AACX,IAAA,2BACG,QAAA,EAAA,EAAS,OAAA,EAAkB,KAAA,EAC1B,QAAA,kBAAA,GAAA,CAAC,YAAS,CAAA,EACZ,CAAA;AAAA,EAEJ;AAEA,EAAA,IAAI,KAAA,IAAS,CAAC,QAAA,EAAU;AACtB,IAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAS,OAAA,EAAkB,KAAA,EAC1B,QAAA,kBAAA,GAAA;AAAA,MAAC,YAAA;AAAA,MAAA;AAAA,QACC,QAAA,EAAS,OAAA;AAAA,QACT,KAAA,EAAO,EAAE,qCAAqC,CAAA;AAAA,QAC9C,OAAA,sBAAU,WAAA,EAAA,EAAY,IAAA,EAAM,GAAG,KAAK,CAAA,CAAA,EAAI,UAAS,MAAA,EAAO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;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"ConsumingComponentsCard.esm.js","sources":["../../../src/components/ComponentsCards/ConsumingComponentsCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ComponentEntity,\n RELATION_API_CONSUMED_BY,\n} from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n EntityRelationCard,\n EntityColumnConfig,\n entityColumnPresets,\n} from '@backstage/plugin-catalog-react/alpha';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\n\n/** @public */\nexport interface ConsumingComponentsCardProps {\n title?: string;\n columnConfig?: EntityColumnConfig[];\n}\n\n/**\n * Props for the legacy MUI-based rendering.\n * @deprecated Use {@link ConsumingComponentsCardProps} instead.\n * @public\n */\nexport interface ConsumingComponentsCardLegacyProps {\n title?: string;\n /** @deprecated Use `columnConfig` instead. */\n variant?: InfoCardVariants;\n /** @deprecated Use `columnConfig` instead. */\n columns?: TableColumn<ComponentEntity>[];\n /** @deprecated Use `columnConfig` instead. */\n tableOptions?: TableOptions;\n}\n\nfunction isLegacyProps(\n props: ConsumingComponentsCardProps | ConsumingComponentsCardLegacyProps,\n): props is ConsumingComponentsCardLegacyProps {\n return 'variant' in props || 'columns' in props || 'tableOptions' in props;\n}\n\nfunction ConsumingComponentsCardLegacy(\n props: ConsumingComponentsCardLegacyProps,\n) {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const {\n variant = 'gridItem',\n title = t('consumingComponentsCard.title'),\n columns = EntityTable.componentEntityColumns,\n tableOptions = {},\n } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_API_CONSUMED_BY,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\n <WarningPanel\n severity=\"error\"\n title={t('consumingComponentsCard.error.title')}\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n {t('consumingComponentsCard.emptyContent.title')}\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional\">\n {t('apisCardHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n tableOptions={tableOptions}\n entities={entities as ComponentEntity[]}\n />\n );\n}\n\n/**\n * @public\n */\nexport const ConsumingComponentsCard = (\n props: ConsumingComponentsCardProps | ConsumingComponentsCardLegacyProps,\n) => {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n\n if (isLegacyProps(props)) {\n return <ConsumingComponentsCardLegacy {...props} />;\n }\n\n const {\n title = t('consumingComponentsCard.title'),\n columnConfig = entityColumnPresets.component.columns,\n } = props;\n\n return (\n <EntityRelationCard\n title={title}\n relationType={RELATION_API_CONSUMED_BY}\n columnConfig={columnConfig}\n emptyState={{\n message: t('consumingComponentsCard.emptyContent.title'),\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#specconsumesapis-optional',\n }}\n />\n );\n};\n"],"names":[],"mapp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MACA,8BACE,IAAA,CAAC,KAAA,EAAA,EAAI,OAAO,EAAE,SAAA,EAAW,UAAS,EAChC,QAAA,EAAA;AAAA,wBAAA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EACjB,QAAA,EAAA,CAAA,CAAE,4CAA4C,CAAA,EACjD,CAAA;AAAA,wBACA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EAClB,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,EAAA,EAAG,iGAAA,EACN,QAAA,EAAA,CAAA,CAAE,uBAAuB,CAAA,EAC5B,CAAA,EACF;AAAA,OAAA,EACF,CAAA;AAAA,MAEF,OAAA;AAAA,MACA,YAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;AAKO,MAAM,uBAAA,GAA0B,CACrC,KAAA,KACG;AACH,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AAErD,EAAA,IAAI,aAAA,CAAc,KAAK,CAAA,EAAG;AACxB,IAAA,uBAAO,GAAA,CAAC,6BAAA,EAAA,EAA+B,GAAG,KAAA,EAAO,CAAA;AAAA,EACnD;AAEA,EAAA,MAAM;AAAA,IACJ,KAAA,GAAQ,EAAE,+BAA+B,CAAA;AAAA,IACzC,YAAA,GAAe,oBAAoB,SAAA,CAAU;AAAA,GAC/C,GAAI,KAAA;AAEJ,EAAA,uBACE,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,YAAA,EAAc,wBAAA;AAAA,MACd,YAAA;AAAA,MACA,UAAA,EAAY;AAAA,QACV,OAAA,EAAS,EAAE,4CAA4C,CAAA;AAAA,QACvD,QAAA,EACE;AAAA;AACJ;AAAA,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ProvidingComponentsCard.esm.js","sources":["../../../src/components/ComponentsCards/ProvidingComponentsCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ComponentEntity,\n RELATION_API_PROVIDED_BY,\n} from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n EntityRelationCard,\n EntityColumnConfig,\n entityColumnPresets,\n} from '@backstage/plugin-catalog-react/alpha';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\n\n/** @public */\nexport interface ProvidingComponentsCardProps {\n title?: string;\n columnConfig?: EntityColumnConfig[];\n}\n\n/**\n * Props for the legacy MUI-based rendering.\n * @deprecated Use {@link ProvidingComponentsCardProps} instead.\n * @public\n */\nexport interface ProvidingComponentsCardLegacyProps {\n title?: string;\n /** @deprecated Use `columnConfig` instead. */\n variant?: InfoCardVariants;\n /** @deprecated Use `columnConfig` instead. */\n columns?: TableColumn<ComponentEntity>[];\n /** @deprecated Use `columnConfig` instead. */\n tableOptions?: TableOptions;\n}\n\nfunction isLegacyProps(\n props: ProvidingComponentsCardProps | ProvidingComponentsCardLegacyProps,\n): props is ProvidingComponentsCardLegacyProps {\n return 'variant' in props || 'columns' in props || 'tableOptions' in props;\n}\n\nfunction ProvidingComponentsCardLegacy(\n props: ProvidingComponentsCardLegacyProps,\n) {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const {\n variant = 'gridItem',\n title = t('providingComponentsCard.title'),\n columns = EntityTable.componentEntityColumns,\n tableOptions = {},\n } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_API_PROVIDED_BY,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\n <WarningPanel\n severity=\"error\"\n title={t('providingComponentsCard.error.title')}\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n {t('providingComponentsCard.emptyContent.title')}\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional\">\n {t('apisCardHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n tableOptions={tableOptions}\n entities={entities as ComponentEntity[]}\n />\n );\n}\n\n/** @public */\nexport const ProvidingComponentsCard = (\n props: ProvidingComponentsCardProps | ProvidingComponentsCardLegacyProps,\n) => {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n\n if (isLegacyProps(props)) {\n return <ProvidingComponentsCardLegacy {...props} />;\n }\n\n const {\n title = t('providingComponentsCard.title'),\n columnConfig = entityColumnPresets.component.columns,\n } = props;\n\n return (\n <EntityRelationCard\n title={title}\n relationType={RELATION_API_PROVIDED_BY}\n columnConfig={columnConfig}\n emptyState={{\n message: t('providingComponentsCard.emptyContent.title'),\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional',\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAiEA,SAAS,cACP,KAAA,EAC6C;AAC7C,EAAA,OAAO,SAAA,IAAa,KAAA,IAAS,SAAA,IAAa,KAAA,IAAS,cAAA,IAAkB,KAAA;AACvE;AA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AAQ,OAAA,EACjB,QAAA,EAAA,CAAA,CAAE,4CAA4C,CAAA,EACjD,CAAA;AAAA,wBACA,GAAA,CAAC,UAAA,EAAA,EAAW,OAAA,EAAQ,OAAA,EAClB,QAAA,kBAAA,GAAA,CAAC,IAAA,EAAA,EAAK,EAAA,EAAG,iGAAA,EACN,QAAA,EAAA,CAAA,CAAE,uBAAuB,CAAA,EAC5B,CAAA,EACF;AAAA,OAAA,EACF,CAAA;AAAA,MAEF,OAAA;AAAA,MACA,YAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;AAGO,MAAM,uBAAA,GAA0B,CACrC,KAAA,KACG;AACH,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AAErD,EAAA,IAAI,aAAA,CAAc,KAAK,CAAA,EAAG;AACxB,IAAA,uBAAO,GAAA,CAAC,6BAAA,EAAA,EAA+B,GAAG,KAAA,EAAO,CAAA;AAAA,EACnD;AAEA,EAAA,MAAM;AAAA,IACJ,KAAA,GAAQ,EAAE,+BAA+B,CAAA;AAAA,IACzC,YAAA,GAAe,oBAAoB,SAAA,CAAU;AAAA,GAC/C,GAAI,KAAA;AAEJ,EAAA,uBACE,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,YAAA,EAAc,wBAAA;AAAA,MACd,YAAA;AAAA,MACA,UAAA,EAAY;AAAA,QACV,OAAA,EAAS,EAAE,4CAA4C,CAAA;AAAA,QACvD,QAAA,EACE;AAAA;AACJ;AAAA,GACF;AAEJ;;;;"}
1
+ {"version":3,"file":"ProvidingComponentsCard.esm.js","sources":["../../../src/components/ComponentsCards/ProvidingComponentsCard.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ComponentEntity,\n RELATION_API_PROVIDED_BY,\n} from '@backstage/catalog-model';\nimport Typography from '@material-ui/core/Typography';\nimport {\n EntityTable,\n useEntity,\n useRelatedEntities,\n} from '@backstage/plugin-catalog-react';\nimport {\n EntityRelationCard,\n EntityColumnConfig,\n entityColumnPresets,\n} from '@backstage/plugin-catalog-react/alpha';\nimport {\n CodeSnippet,\n InfoCard,\n InfoCardVariants,\n Link,\n Progress,\n TableColumn,\n TableOptions,\n WarningPanel,\n} from '@backstage/core-components';\nimport { useTranslationRef } from '@backstage/frontend-plugin-api';\nimport { apiDocsTranslationRef } from '../../translation';\n\n/** @public */\nexport interface ProvidingComponentsCardProps {\n title?: string;\n columnConfig?: EntityColumnConfig[];\n}\n\n/**\n * Props for the legacy MUI-based rendering.\n * @deprecated Use {@link ProvidingComponentsCardProps} instead.\n * @public\n */\nexport interface ProvidingComponentsCardLegacyProps {\n title?: string;\n /** @deprecated Use `columnConfig` instead. */\n variant?: InfoCardVariants;\n /** @deprecated Use `columnConfig` instead. */\n columns?: TableColumn<ComponentEntity>[];\n /** @deprecated Use `columnConfig` instead. */\n tableOptions?: TableOptions;\n}\n\nfunction isLegacyProps(\n props: ProvidingComponentsCardProps | ProvidingComponentsCardLegacyProps,\n): props is ProvidingComponentsCardLegacyProps {\n return 'variant' in props || 'columns' in props || 'tableOptions' in props;\n}\n\nfunction ProvidingComponentsCardLegacy(\n props: ProvidingComponentsCardLegacyProps,\n) {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n const {\n variant = 'gridItem',\n title = t('providingComponentsCard.title'),\n columns = EntityTable.componentEntityColumns,\n tableOptions = {},\n } = props;\n const { entity } = useEntity();\n const { entities, loading, error } = useRelatedEntities(entity, {\n type: RELATION_API_PROVIDED_BY,\n });\n\n if (loading) {\n return (\n <InfoCard variant={variant} title={title}>\n <Progress />\n </InfoCard>\n );\n }\n\n if (error || !entities) {\n return (\n <InfoCard variant={variant} title={title}>\n <WarningPanel\n severity=\"error\"\n title={t('providingComponentsCard.error.title')}\n message={<CodeSnippet text={`${error}`} language=\"text\" />}\n />\n </InfoCard>\n );\n }\n\n return (\n <EntityTable\n title={title}\n variant={variant}\n emptyContent={\n <div style={{ textAlign: 'center' }}>\n <Typography variant=\"body1\">\n {t('providingComponentsCard.emptyContent.title')}\n </Typography>\n <Typography variant=\"body2\">\n <Link to=\"https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional\">\n {t('apisCardHelpLinkTitle')}\n </Link>\n </Typography>\n </div>\n }\n columns={columns}\n tableOptions={tableOptions}\n entities={entities as ComponentEntity[]}\n />\n );\n}\n\n/** @public */\nexport const ProvidingComponentsCard = (\n props: ProvidingComponentsCardProps | ProvidingComponentsCardLegacyProps,\n) => {\n const { t } = useTranslationRef(apiDocsTranslationRef);\n\n if (isLegacyProps(props)) {\n return <ProvidingComponentsCardLegacy {...props} />;\n }\n\n const {\n title = t('providingComponentsCard.title'),\n columnConfig = entityColumnPresets.component.columns,\n } = props;\n\n return (\n <EntityRelationCard\n title={title}\n relationType={RELATION_API_PROVIDED_BY}\n columnConfig={columnConfig}\n emptyState={{\n message: t('providingComponentsCard.emptyContent.title'),\n helpLink:\n 'https://backstage.io/docs/features/software-catalog/descriptor-format#specprovidesapis-optional',\n }}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;AAiEA,SAAS,cACP,KAAA,EAC6C;AAC7C,EAAA,OAAO,SAAA,IAAa,KAAA,IAAS,SAAA,IAAa,KAAA,IAAS,cAAA,IAAkB,KAAA;AACvE;AAEA,SAAS,8BACP,KAAA,EACA;AACA,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AACrD,EAAA,MAAM;AAAA,IACJ,OAAA,GAAU,UAAA;AAAA,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AAA,CAAC,IAAA,EAAA,EAAK,EAAA,EAAG,iGAAA,EACN,QAAA,EAAA,CAAA,CAAE,uBAAuB,CAAA,EAC5B,CAAA,EACF;AAAA,OAAA,EACF,CAAA;AAAA,MAEF,OAAA;AAAA,MACA,YAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;AAGO,MAAM,uBAAA,GAA0B,CACrC,KAAA,KACG;AACH,EAAA,MAAM,EAAE,CAAA,EAAE,GAAI,iBAAA,CAAkB,qBAAqB,CAAA;AAErD,EAAA,IAAI,aAAA,CAAc,KAAK,CAAA,EAAG;AACxB,IAAA,uBAAO,GAAA,CAAC,6BAAA,EAAA,EAA+B,GAAG,KAAA,EAAO,CAAA;AAAA,EACnD;AAEA,EAAA,MAAM;AAAA,IACJ,KAAA,GAAQ,EAAE,+BAA+B,CAAA;AAAA,IACzC,YAAA,GAAe,oBAAoB,SAAA,CAAU;AAAA,GAC/C,GAAI,KAAA;AAEJ,EAAA,uBACE,GAAA;AAAA,IAAC,kBAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,YAAA,EAAc,wBAAA;AAAA,MACd,YAAA;AAAA,MACA,UAAA,EAAY;AAAA,QACV,OAAA,EAAS,EAAE,4CAA4C,CAAA;AAAA,QACvD,QAAA,EACE;AAAA;AACJ;AAAA,GACF;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"GraphQlDefinition.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';\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":";;;;;;AA0BA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,IAAA,EAAM;AAAA,IACJ,MAAA,EAAQ,MAAA;AAAA,IACR,OAAA,EAAS,MAAA;AAAA,IACT,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,IAAA,EAAM,CAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,qBAAA,EAAuB;AAAA,QACrB,SAAA,EAAW,SAAA;AAAA,QACX,MAAA,EAAQ,MAAA;AAAA,QACR,SAAA,EAAW,OAAA;AAAA,QACX,IAAA,EAAM;AAAA,OACR;AAAA,MACA,mBAAA,EAAqB;AAAA,QACnB,KAAA,EAAO;AAAA;AACT;AACF;AAEJ,CAAC,CAAA;AAMM,MAAM,iBAAA,GAAoB,CAAC,EAAE,UAAA,EAAW,KAAa;AAC1D,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,MAAA,GAAS,YAAY,UAAU,CAAA;AAErC,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,IAAA,EACtB,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,eAAA,EACtB,QAAA,kBAAA,GAAA,CAAC,qBAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,IAAC,qBAAA;AAAA,IAAA;AAAA,MACC,MAAA;AAAA,MACA,OAAA,EAAS,MAAM,OAAA,CAAQ,OAAA,CAAQ,IAAI,CAAA;AAAA,MAEnC,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAU,sBACb,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,WAAU,kBAAA,EACb,QAAA,kBAAA,GAAA,CAAC,SAAI,SAAA,EAAU,0BAAA,EACb,8BAAC,uBAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,eAAY,CAAA,EACf,CAAA,EACF,GACF,CAAA,EACF;AAAA;AAAA,GACF,EACF,GACF,CAAA,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"GraphQlDefinition.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';\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":";;;;;;AA0BA,MAAM,YAAY,UAAA,CAAW;AAAA,EAC3B,IAAA,EAAM;AAAA,IACJ,MAAA,EAAQ,MAAA;AAAA,IACR,OAAA,EAAS,MAAA;AAAA,IACT,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,IAAA,EAAM,CAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,qBAAA,EAAuB;AAAA,QACrB,SAAA,EAAW,SAAA;AAAA,QACX,MAAA,EAAQ,MAAA;AAAA,QACR,SAAA,EAAW,OAAA;AAAA,QACX,IAAA,EAAM;AAAA,OACR;AAAA,MACA,mBAAA,EAAqB;AAAA,QACnB,KAAA,EAAO;AAAA;AACT;AACF;AAEJ,CAAC,CAAA;AAMM,MAAM,iBAAA,GAAoB,CAAC,EAAE,UAAA,EAAW,KAAa;AAC1D,EAAA,MAAM,UAAU,SAAA,EAAU;AAC1B,EAAA,MAAM,MAAA,GAAS,YAAY,UAAU,CAAA;AAErC,EAAA,uBACE,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,IAAA,EACtB,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAW,OAAA,CAAQ,eAAA,EACtB,QAAA,kBAAA,GAAA,CAAC,qBAAA,EAAA,EACC,QAAA,kBAAA,GAAA;AAAA,IAAC,qBAAA;AAAA,IAAA;AAAA,MACC,MAAA;AAAA,MACA,OAAA,EAAS,MAAM,OAAA,CAAQ,OAAA,CAAQ,IAAI,CAAA;AAAA,MAEnC,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAU,sBACb,QAAA,kBAAA,GAAA,CAAC,KAAA,EAAA,EAAI,WAAU,kBAAA,EACb,QAAA,kBAAA,GAAA,CAAC,SAAI,SAAA,EAAU,0BAAA,EACb,8BAAC,uBAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,eAAY,CAAA,EACf,CAAA,EACF,GACF,CAAA,EACF;AAAA;AAAA,GACF,EACF,GACF,CAAA,EACF,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"GraphQlDefinitionWidget.esm.js","sources":["../../../src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.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 { Progress } from '@backstage/core-components';\nimport { lazy, 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 = 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"],"names":[],"mappings":";;;;AAqBA,MAAM,qBAAA,GAAwB,IAAA;AAAA,EAAK,MACjC,OAAO,4BAAqB,CAAA,CAAE,KAAK,CAAA,CAAA,MAAM;AAAA,IACvC,SAAS,CAAA,CAAE;AAAA,GACb,CAAE;AACJ,CAAA;AAQO,MAAM,uBAAA,GAA0B,CACrC,KAAA,KACG;AACH,EAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAS,QAAA,kBAAU,GAAA,CAAC,QAAA,EAAA,EAAS,GAC5B,QAAA,kBAAA,GAAA,CAAC,qBAAA,EAAA,EAAuB,GAAG,KAAA,EAAO,CAAA,EACpC,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"GraphQlDefinitionWidget.esm.js","sources":["../../../src/components/GraphQlDefinitionWidget/GraphQlDefinitionWidget.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 { Progress } from '@backstage/core-components';\nimport { lazy, 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 = 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"],"names":[],"mappings":";;;;AAqBA,MAAM,qBAAA,GAAwB,IAAA;AAAA,EAAK,MACjC,OAAO,4BAAqB,CAAA,CAAE,KAAK,CAAA,CAAA,MAAM;AAAA,IACvC,SAAS,CAAA,CAAE;AAAA,GACb,CAAE;AACJ,CAAA;AAQO,MAAM,uBAAA,GAA0B,CACrC,KAAA,KACG;AACH,EAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAS,QAAA,kBAAU,GAAA,CAAC,QAAA,EAAA,EAAS,GAC5B,QAAA,kBAAA,GAAA,CAAC,qBAAA,EAAA,EAAuB,GAAG,KAAA,EAAO,CAAA,EACpC,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"GrpcApiDefinitionWidget.esm.js","sources":["../../../src/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.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 { 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"],"names":[],"mappings":";;;;AAyBO,MAAM,uBAAA,GAA0B,CACrC,KAAA,KACG;AACH,EAAA,MAAM,QAAQ,QAAA,EAAS;AACvB,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,aAAa,EAAE,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,WAAW,OAAA,EAAQ;AAAA,MACjE,MAAM,KAAA,CAAM,UAAA;AAAA,MACZ,QAAA,EAAS,UAAA;AAAA,MACT,kBAAA,EAAkB;AAAA;AAAA,GACpB;AAEJ;;;;"}
1
+ {"version":3,"file":"GrpcApiDefinitionWidget.esm.js","sources":["../../../src/components/GrpcApiDefinitionWidget/GrpcApiDefinitionWidget.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 { 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"],"names":[],"mappings":";;;;AAyBO,MAAM,uBAAA,GAA0B,CACrC,KAAA,KACG;AACH,EAAA,MAAM,QAAQ,QAAA,EAAS;AACvB,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,aAAa,EAAE,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,WAAW,OAAA,EAAQ;AAAA,MACjE,MAAM,KAAA,CAAM,UAAA;AAAA,MACZ,QAAA,EAAS,UAAA;AAAA,MACT,kBAAA,EAAkB;AAAA;AAAA,GACpB;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenApiDefinition.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 { useEffect, useState } from 'react';\nimport SwaggerUI 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 table tbody tr td,\n table tbody 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 .parameter__name.required span`]: {\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 [`& .opblock-control-arrow svg, .authorization__btn .unlocked`]: {\n fill: theme.palette.text.primary,\n },\n [`& .json-schema-2020-12__title,\n .json-schema-2020-12-keyword__name,\n .json-schema-2020-12-property .json-schema-2020-12__title,\n .json-schema-2020-12-keyword--description`]: {\n color: theme.palette.text.primary,\n },\n [`.json-schema-2020-12-accordion__icon svg`]: {\n fill: theme.palette.text.primary,\n },\n [`& .json-schema-2020-12-accordion,\n .json-schema-2020-12-expand-deep-button`]: {\n background: 'none',\n appearance: 'none',\n },\n [`& .json-schema-2020-12-expand-deep-button,\n .json-schema-2020-12-keyword__name--secondary,\n .json-schema-2020-12-keyword__value--secondary,\n .json-schema-2020-12__attribute--muted,\n .json-schema-2020-12-keyword__value--const,\n .json-schema-2020-12-keyword__value--warning`]: {\n color: theme.palette.text.secondary,\n },\n [`& .json-schema-2020-12-body,\n .json-schema-2020-12-keyword__value--const,\n .json-schema-2020-12-keyword__value--warning`]: {\n borderColor: theme.palette.text.secondary,\n },\n [`.json-schema-2020-12__constraint--string`]: {\n backgroundColor: theme.palette.primary.main,\n },\n [`& .json-schema-2020-12__attribute--primary`]: {\n color: theme.palette.primary.main,\n },\n [`& .json-schema-2020-12-property--required>.json-schema-2020-12:first-of-type>.json-schema-2020-12-head .json-schema-2020-12__title:after`]:\n {\n color: theme.palette.warning.dark,\n },\n [`& input[type=text],\n & input[type=password],\n & input[type=email],\n & input[type=number],\n & textarea,\n & select`]: {\n backgroundColor: theme.palette.background.paper,\n color: theme.palette.text.primary,\n borderColor: theme.palette.divider,\n },\n },\n },\n}));\n\nconst scrollToDeepLink = () => {\n const hash = window.location.hash;\n if (!hash || !hash.startsWith('#/')) return;\n\n let fragment;\n try {\n fragment = decodeURIComponent(hash.substring(2)); // strip leading \"#/\"\n } catch {\n return;\n }\n const [tag, operationId] = fragment.split('/');\n if (!tag) return;\n const elementId = operationId\n ? `operations-${tag}-${operationId}`\n : `operations-tag-${tag}`;\n document\n .getElementById(elementId)\n ?.scrollIntoView({ behavior: 'auto', block: 'start' });\n};\n\nexport type OpenApiDefinitionProps = {\n definition: string;\n} & Omit<React.ComponentProps<typeof SwaggerUI>, '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 onComplete={scrollToDeepLink}\n {...swaggerUiProps}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAqBA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,IAAA,EAAM;AAAA,IACJ,eAAA,EAAiB;AAAA,MACf,UAAA,EAAY,MAAM,UAAA,CAAW,UAAA;AAAA,MAC7B,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,MAE1B,CAAC,cAAc,GAAG;AAAA,QAChB,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK;AAAA,OAC5B;AAAA,MACA,CAAC,qBAAqB,GAAG;AAAA,QACvB,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,UAAA,CAAW;AAAA,OAC5C;AAAA,MACA,CAAC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAA,CAKqB,GAAG;AAAA,QACvB,UAAA,EAAY,MAAM,UAAA,CAAW,UAAA;AAAA,QAC7B,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,QAC1B,WAAA,EAAa,MAAM,OAAA,CAAQ;AAAA,OAC7B;AAAA,MACA,CAAC,CAAA;AAAA,mCAAA,CAC6B,GAAG;AAAA,QAC/B,WAAA,EAAa,MAA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Q,CAAA,EAAA,EAAK,MAAA,CAAO,SAAS,IAAI,CAAA,qBAAA,CAAA;AAAA,MACvE,UAAA,EAAY,gBAAA;AAAA,MACX,GAAG;AAAA;AAAA,GACN,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"OpenApiDefinition.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 { useEffect, useState } from 'react';\nimport SwaggerUI 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 table tbody tr td,\n table tbody 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 .parameter__name.required span`]: {\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 [`& .opblock-control-arrow svg, .authorization__btn .unlocked`]: {\n fill: theme.palette.text.primary,\n },\n [`& .json-schema-2020-12__title,\n .json-schema-2020-12-keyword__name,\n .json-schema-2020-12-property .json-schema-2020-12__title,\n .json-schema-2020-12-keyword--description`]: {\n color: theme.palette.text.primary,\n },\n [`.json-schema-2020-12-accordion__icon svg`]: {\n fill: theme.palette.text.primary,\n },\n [`& .json-schema-2020-12-accordion,\n .json-schema-2020-12-expand-deep-button`]: {\n background: 'none',\n appearance: 'none',\n },\n [`& .json-schema-2020-12-expand-deep-button,\n .json-schema-2020-12-keyword__name--secondary,\n .json-schema-2020-12-keyword__value--secondary,\n .json-schema-2020-12__attribute--muted,\n .json-schema-2020-12-keyword__value--const,\n .json-schema-2020-12-keyword__value--warning`]: {\n color: theme.palette.text.secondary,\n },\n [`& .json-schema-2020-12-body,\n .json-schema-2020-12-keyword__value--const,\n .json-schema-2020-12-keyword__value--warning`]: {\n borderColor: theme.palette.text.secondary,\n },\n [`.json-schema-2020-12__constraint--string`]: {\n backgroundColor: theme.palette.primary.main,\n },\n [`& .json-schema-2020-12__attribute--primary`]: {\n color: theme.palette.primary.main,\n },\n [`& .json-schema-2020-12-property--required>.json-schema-2020-12:first-of-type>.json-schema-2020-12-head .json-schema-2020-12__title:after`]:\n {\n color: theme.palette.warning.dark,\n },\n [`& input[type=text],\n & input[type=password],\n & input[type=email],\n & input[type=number],\n & textarea,\n & select`]: {\n backgroundColor: theme.palette.background.paper,\n color: theme.palette.text.primary,\n borderColor: theme.palette.divider,\n },\n },\n },\n}));\n\nconst scrollToDeepLink = () => {\n const hash = window.location.hash;\n if (!hash || !hash.startsWith('#/')) return;\n\n let fragment;\n try {\n fragment = decodeURIComponent(hash.substring(2)); // strip leading \"#/\"\n } catch {\n return;\n }\n const [tag, operationId] = fragment.split('/');\n if (!tag) return;\n const elementId = operationId\n ? `operations-${tag}-${operationId}`\n : `operations-tag-${tag}`;\n document\n .getElementById(elementId)\n ?.scrollIntoView({ behavior: 'auto', block: 'start' });\n};\n\nexport type OpenApiDefinitionProps = {\n definition: string;\n} & Omit<React.ComponentProps<typeof SwaggerUI>, '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 onComplete={scrollToDeepLink}\n {...swaggerUiProps}\n />\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAqBA,MAAM,SAAA,GAAY,WAAW,CAAA,KAAA,MAAU;AAAA,EACrC,IAAA,EAAM;AAAA,IACJ,eAAA,EAAiB;AAAA,MACf,UAAA,EAAY,MAAM,UAAA,CAAW,UAAA;AAAA,MAC7B,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,MAE1B,CAAC,cAAc,GAAG;AAAA,QAChB,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK;AAAA,OAC5B;AAAA,MACA,CAAC,qBAAqB,GAAG;AAAA,QACvB,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,UAAA,CAAW;AAAA,OAC5C;AAAA,MACA,CAAC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAAA,CAKqB,GAAG;AAAA,QACvB,UAAA,EAAY,MAAM,UAAA,CAAW,UAAA;AAAA,QAC7B,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,QAC1B,WAAA,EAAa,MAAM,OAAA,CAAQ;AAAA,OAC7B;AAAA,MACA,CAAC,CAAA;AAAA,mCAAA,CAC6B,GAAG;AAAA,QAC/B,WAAA,EAAa,MAAM,OAAA,CAAQ;AAAA,OAC7B;AAAA,MACA,CAAC,CAAA;AAAA;AAAA,6BAAA,CAEuB,GAAG;AAAA,QACzB,UAAA,EAAY,MAAM,UAAA,CAAW,UAAA;AAAA,QAC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AEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"OpenApiDefinitionWidget.esm.js","sources":["../../../src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.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 { Progress } from '@backstage/core-components';\nimport { lazy, 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 = 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.toLowerCase(),\n );\n return (\n <Suspense fallback={<Progress />}>\n <LazyOpenApiDefinition\n {...props}\n supportedSubmitMethods={validSubmitMethods as any}\n />\n </Suspense>\n );\n};\n"],"names":[],"mappings":";;;;AAqBA,MAAM,qBAAA,GAAwB,IAAA;AAAA,EAAK,MACjC,OAAO,4BAAqB,CAAA,CAAE,KAAK,CAAA,CAAA,MAAM;AAAA,IACvC,SAAS,CAAA,CAAE;AAAA,GACb,CAAE;AACJ,CAAA;AAUO,MAAM,uBAAA,GAA0B,CACrC,KAAA,KACG;AACH,EAAA,MAAM,kBAAA,GAAqB,MAAM,sBAAA,EAAwB,GAAA;AAAA,IAAI,CAAA,MAAA,KAC3D,OAAO,WAAA;AAAY,GACrB;AACA,EAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAS,QAAA,kBAAU,GAAA,CAAC,YAAS,CAAA,EAC5B,QAAA,kBAAA,GAAA;AAAA,IAAC,qBAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACJ,sBAAA,EAAwB;AAAA;AAAA,GAC1B,EACF,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"OpenApiDefinitionWidget.esm.js","sources":["../../../src/components/OpenApiDefinitionWidget/OpenApiDefinitionWidget.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 { Progress } from '@backstage/core-components';\nimport { lazy, 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 = 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.toLowerCase(),\n );\n return (\n <Suspense fallback={<Progress />}>\n <LazyOpenApiDefinition\n {...props}\n supportedSubmitMethods={validSubmitMethods as any}\n />\n </Suspense>\n );\n};\n"],"names":[],"mappings":";;;;AAqBA,MAAM,qBAAA,GAAwB,IAAA;AAAA,EAAK,MACjC,OAAO,4BAAqB,CAAA,CAAE,KAAK,CAAA,CAAA,MAAM;AAAA,IACvC,SAAS,CAAA,CAAE;AAAA,GACb,CAAE;AACJ,CAAA;AAUO,MAAM,uBAAA,GAA0B,CACrC,KAAA,KACG;AACH,EAAA,MAAM,kBAAA,GAAqB,MAAM,sBAAA,EAAwB,GAAA;AAAA,IAAI,CAAA,MAAA,KAC3D,OAAO,WAAA;AAAY,GACrB;AACA,EAAA,uBACE,GAAA,CAAC,QAAA,EAAA,EAAS,QAAA,kBAAU,GAAA,CAAC,YAAS,CAAA,EAC5B,QAAA,kBAAA,GAAA;AAAA,IAAC,qBAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACJ,sBAAA,EAAwB;AAAA;AAAA,GAC1B,EACF,CAAA;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PlainApiDefinitionWidget.esm.js","sources":["../../../src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.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 { 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"],"names":[],"mappings":";;;AAyBO,MAAM,wBAAA,GAA2B,CACtC,KAAA,KACG;AACH,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,MAAM,KAAA,CAAM,UAAA;AAAA,MACZ,UAAU,KAAA,CAAM,QAAA;AAAA,MAChB,kBAAA,EAAkB;AAAA;AAAA,GACpB;AAEJ;;;;"}
1
+ {"version":3,"file":"PlainApiDefinitionWidget.esm.js","sources":["../../../src/components/PlainApiDefinitionWidget/PlainApiDefinitionWidget.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 { 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"],"names":[],"mappings":";;;AAyBO,MAAM,wBAAA,GAA2B,CACtC,KAAA,KACG;AACH,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,MAAM,KAAA,CAAM,UAAA;AAAA,MACZ,UAAU,KAAA,CAAM,QAAA;AAAA,MAChB,kBAAA,EAAkB;AAAA;AAAA,GACpB;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TrpcApiDefinitionWidget.esm.js","sources":["../../../src/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { 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"],"names":[],"mappings":";;;;AAwBO,MAAM,uBAAA,GAA0B,CACrC,KAAA,KACG;AACH,EAAA,MAAM,EAAE,YAAW,GAAI,KAAA;AACvB,EAAA,MAAM,QAAQ,QAAA,EAAS;AACvB,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,aAAa,EAAE,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,WAAW,OAAA,EAAQ;AAAA,MACjE,IAAA,EAAM,UAAA;AAAA,MACN,QAAA,EAAS,YAAA;AAAA,MACT,kBAAA,EAAkB;AAAA;AAAA,GACpB;AAEJ;;;;"}
1
+ {"version":3,"file":"TrpcApiDefinitionWidget.esm.js","sources":["../../../src/components/TrpcDefinitionWidget/TrpcApiDefinitionWidget.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { 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"],"names":[],"mappings":";;;;AAwBO,MAAM,uBAAA,GAA0B,CACrC,KAAA,KACG;AACH,EAAA,MAAM,EAAE,YAAW,GAAI,KAAA;AACvB,EAAA,MAAM,QAAQ,QAAA,EAAS;AACvB,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,aAAa,EAAE,eAAA,EAAiB,KAAA,CAAM,OAAA,CAAQ,WAAW,OAAA,EAAQ;AAAA,MACjE,IAAA,EAAM,UAAA;AAAA,MACN,QAAA,EAAS,YAAA;AAAA,MACT,kBAAA,EAAkB;AAAA;AAAA,GACpB;AAEJ;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.esm.js","sources":["../src/config.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport { 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"],"names":[],"mappings":";;AAqBO,MAAM,mBAAmB,YAAA,CAA4B;AAAA,EAC1D,EAAA,EAAI;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"config.esm.js","sources":["../src/config.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport { 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"],"names":[],"mappings":";;AAqBO,MAAM,mBAAmB,YAAA,CAA4B;AAAA,EAC1D,EAAA,EAAI;AACN,CAAC;;"}
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-api-docs";
2
- var version = "0.14.5";
2
+ var version = "0.14.6-next.0";
3
3
  var description = "A Backstage plugin that helps represent API entities in the frontend";
4
4
  var backstage = {
5
5
  role: "frontend-plugin",
@@ -1 +1 @@
1
- {"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"package.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { apiDocsConfigRef } from './config';\nimport { registerComponentRouteRef, rootRoute } from './routes';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const apiDocsPlugin = createPlugin({\n id: 'api-docs',\n routes: {\n root: rootRoute,\n },\n apis: [\n createApiFactory({\n api: apiDocsConfigRef,\n deps: {},\n factory: () => {\n const definitionWidgets = defaultDefinitionWidgets();\n return {\n getApiDefinitionWidget: (apiEntity: ApiEntity) => {\n return definitionWidgets.find(d => d.type === apiEntity.spec.type);\n },\n };\n },\n }),\n ],\n externalRoutes: {\n registerApi: registerComponentRouteRef,\n },\n});\n\n/** @public */\nexport const ApiExplorerPage = apiDocsPlugin.provide(\n createRoutableExtension({\n name: 'ApiExplorerPage',\n component: () =>\n import('./components/ApiExplorerPage').then(m => m.ApiExplorerIndexPage),\n mountPoint: rootRoute,\n }),\n);\n\n/** @public */\nexport const EntityApiDefinitionCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityApiDefinitionCard',\n component: {\n lazy: () =>\n import('./components/ApiDefinitionCard').then(m => m.ApiDefinitionCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityConsumedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ConsumedApisCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityConsumingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ConsumingComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityProvidedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ProvidedApisCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityProvidingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ProvidingComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityHasApisCard',\n component: {\n lazy: () => import('./components/ApisCards').then(m => m.HasApisCard),\n },\n }),\n);\n"],"names":[],"mappings":";;;;;;;;;;;;AA4BO,MAAM,gBAAgB,YAAA,CAAa;AAAA,EACxC,EAAA,EAAI,UAAA;AAAA,EACJ,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,gBAAA,CAAiB;AAAA,MACf,GAAA,EAAK,gBAAA;AAAA,MACL,MAAM,EAAC;AAAA,MACP,SAAS,MAAM;AACb,QAAA,MAA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AAA;AACT;AACJ,GACD;AACH;AAGO,MAAM,yBAAyB,aAAA,CAAc,OAAA;AAAA,EAClD,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,wBAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,qCAAwB,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,gBAAgB;AAAA;AACjE,GACD;AACH;AAGO,MAAM,gCAAgC,aAAA,CAAc,OAAA;AAAA,EACzD,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,+BAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,2CAA8B,CAAA,CAAE,IAAA;AAAA,QACrC,OAAK,CAAA,CAAE;AAAA;AACT;AACJ,GACD;AACH;AAGO,MAAM,oBAAoB,aAAA,CAAc,OAAA;AAAA,EAC7C,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,mBAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MAAM,OAAO,qCAAwB,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,WAAW;AAAA;AACtE,GACD;AACH;;;;"}
1
+ {"version":3,"file":"plugin.esm.js","sources":["../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ApiEntity } from '@backstage/catalog-model';\nimport { defaultDefinitionWidgets } from './components/ApiDefinitionCard';\nimport { apiDocsConfigRef } from './config';\nimport { registerComponentRouteRef, rootRoute } from './routes';\nimport {\n createApiFactory,\n createComponentExtension,\n createPlugin,\n createRoutableExtension,\n} from '@backstage/core-plugin-api';\n\n/** @public */\nexport const apiDocsPlugin = createPlugin({\n id: 'api-docs',\n routes: {\n root: rootRoute,\n },\n apis: [\n createApiFactory({\n api: apiDocsConfigRef,\n deps: {},\n factory: () => {\n const definitionWidgets = defaultDefinitionWidgets();\n return {\n getApiDefinitionWidget: (apiEntity: ApiEntity) => {\n return definitionWidgets.find(d => d.type === apiEntity.spec.type);\n },\n };\n },\n }),\n ],\n externalRoutes: {\n registerApi: registerComponentRouteRef,\n },\n});\n\n/** @public */\nexport const ApiExplorerPage = apiDocsPlugin.provide(\n createRoutableExtension({\n name: 'ApiExplorerPage',\n component: () =>\n import('./components/ApiExplorerPage').then(m => m.ApiExplorerIndexPage),\n mountPoint: rootRoute,\n }),\n);\n\n/** @public */\nexport const EntityApiDefinitionCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityApiDefinitionCard',\n component: {\n lazy: () =>\n import('./components/ApiDefinitionCard').then(m => m.ApiDefinitionCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityConsumedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ConsumedApisCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityConsumingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityConsumingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ConsumingComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityProvidedApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidedApisCard',\n component: {\n lazy: () =>\n import('./components/ApisCards').then(m => m.ProvidedApisCard),\n },\n }),\n);\n\n/** @public */\nexport const EntityProvidingComponentsCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityProvidingComponentsCard',\n component: {\n lazy: () =>\n import('./components/ComponentsCards').then(\n m => m.ProvidingComponentsCard,\n ),\n },\n }),\n);\n\n/** @public */\nexport const EntityHasApisCard = apiDocsPlugin.provide(\n createComponentExtension({\n name: 'EntityHasApisCard',\n component: {\n lazy: () => import('./components/ApisCards').then(m => m.HasApisCard),\n },\n }),\n);\n"],"names":[],"mappings":";;;;;;;;;;;;AA4BO,MAAM,gBAAgB,YAAA,CAAa;AAAA,EACxC,EAAA,EAAI,UAAA;AAAA,EACJ,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACJ,gBAAA,CAAiB;AAAA,MACf,GAAA,EAAK,gBAAA;AAAA,MACL,MAAM,EAAC;AAAA,MACP,SAAS,MAAM;AACb,QAAA,MAAM,oBAAoB,wBAAA,EAAyB;AACnD,QAAA,OAAO;AAAA,UACL,sBAAA,EAAwB,CAAC,SAAA,KAAyB;AAChD,YAAA,OAAO,kBAAkB,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,IAAA,KAAS,SAAA,CAAU,KAAK,IAAI,CAAA;AAAA,UACnE;AAAA,SACF;AAAA,MACF;AAAA,KACD;AAAA,GACH;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,WAAA,EAAa;AAAA;AAEjB,CAAC;AAGM,MAAM,kBAAkB,aAAA,CAAc,OAAA;AAAA,EAC3C,uBAAA,CAAwB;AAAA,IACtB,IAAA,EAAM,iBAAA;AAAA,IACN,SAAA,EAAW,MACT,OAAO,2CAA8B,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,oBAAoB,CAAA;AAAA,IACzE,UAAA,EAAY;AAAA,GACb;AACH;AAGO,MAAM,0BAA0B,aAAA,CAAc,OAAA;AAAA,EACnD,wBAAA,CAAyB;AAAA,IACvB,IAAA,EAAM,yBAAA;AAAA,IACN,SAAA,EAAW;AAAA,MACT,IAAA,EAAM,MACJ,OAAO,6CAAgC,EAAE,IAAA,CAAK,CAAA,CAAA,KAAK,EAAE,iBAAiB;AAAA;AAC1E,G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":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\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 defaultTarget: 'catalog-import.importPage',\n});\n"],"names":[],"mappings":";;AAqBO,MAAM,YAAY,cAAA,CAAe;AAAA,EACtC,EAAA,EAAI;AACN,CAAC;AAEM,MAAM,4BAA4B,sBAAA,CAAuB;AAAA,EAC9D,EAAA,EAAI,oBAAA;AAAA,EACJ,QAAA,EAAU,IAAA;AAAA,EACV,aAAA,EAAe;AACjB,CAAC;;;;"}
1
+ {"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\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 defaultTarget: 'catalog-import.importPage',\n});\n"],"names":[],"mappings":";;AAqBO,MAAM,YAAY,cAAA,CAAe;AAAA,EACtC,EAAA,EAAI;AACN,CAAC;AAEM,MAAM,4BAA4B,sBAAA,CAAuB;AAAA,EAC9D,EAAA,EAAI,oBAAA;AAAA,EACJ,QAAA,EAAU,IAAA;AAAA,EACV,aAAA,EAAe;AACjB,CAAC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/**\n * @public\n */\nexport const apiDocsTranslationRef = createTranslationRef({\n id: 'api-docs',\n messages: {\n apiDefinitionCard: {\n error: {\n title: 'Could not fetch the API',\n },\n rawButtonTitle: 'Raw',\n },\n apiDefinitionDialog: {\n closeButtonTitle: 'Close',\n tabsAriaLabel: 'API definition options',\n toggleButtonAriaLabel: 'Toggle API Definition Dialog',\n rawButtonTitle: 'Raw',\n },\n defaultApiExplorerPage: {\n title: 'APIs',\n subtitle: '{{orgName}} API Explorer',\n pageTitleOverride: 'APIs',\n createButtonTitle: 'Register Existing API',\n supportButtonTitle: 'All your APIs',\n },\n consumedApisCard: {\n title: 'Consumed APIs',\n error: {\n title: 'Could not load APIs',\n },\n emptyContent: {\n title: 'This {{entity}} does not consume any APIs.',\n },\n },\n hasApisCard: {\n title: 'APIs',\n error: {\n title: 'Could not load APIs',\n },\n emptyContent: {\n title: 'This {{entity}} does not contain any APIs.',\n },\n },\n providedApisCard: {\n title: 'Provided APIs',\n error: {\n title: 'Could not load APIs',\n },\n emptyContent: {\n title: 'This {{entity}} does not provide any APIs.',\n },\n },\n apiEntityColumns: {\n typeTitle: 'Type',\n apiDefinitionTitle: 'API Definition',\n },\n consumingComponentsCard: {\n title: 'Consumers',\n error: {\n title: 'Could not load components',\n },\n emptyContent: {\n title: 'No component consumes this API.',\n },\n },\n providingComponentsCard: {\n title: 'Providers',\n error: {\n title: 'Could not load components',\n },\n emptyContent: {\n title: 'No component provides this API.',\n },\n },\n apisCardHelpLinkTitle: 'Learn how to change this.',\n },\n});\n"],"names":[],"mappings":";;AAqBO,MAAM,wBAAwB,oBAAA,CAAqB;AAAA,EACxD,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,cAAA,EAAgB;AAAA,KAClB;AAAA,IACA,mBAAA,EAAqB;AAAA,MACnB,gBAAA,EAAkB,OAAA;AAAA,MAClB,aAAA,EAAe,wBAAA;AAAA,MACf,qBAAA,EAAuB,8BAAA;AAAA,MACvB,cAAA,EAAgB;AAAA,KAClB;AAAA,IACA,sBAAA,EAAwB;AAAA,MACtB,KAAA,EAAO,MAAA;AAAA,MACP,QAAA,EAAU,0BAAA;AAAA,MACV,iBAAA,EAAmB,MAAA;AAAA,MACnB,iBAAA,EAAmB,uBAAA;AAAA,MACnB,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,eAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,WAAA,EAAa;AAAA,MACX,KAAA,EAAO,MAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,eAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,SAAA,EAAW,MAAA;AAAA,MACX,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,uBAAA,EAAyB;AAAA,MACvB,KAAA,EAAO,WAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,uBAAA,EAAyB;AAAA,MACvB,KAAA,EAAO,WAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,qBAAA,EAAuB;AAAA;AAE3B,CAAC;;;;"}
1
+ {"version":3,"file":"translation.esm.js","sources":["../src/translation.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTranslationRef } from '@backstage/frontend-plugin-api';\n\n/**\n * @public\n */\nexport const apiDocsTranslationRef = createTranslationRef({\n id: 'api-docs',\n messages: {\n apiDefinitionCard: {\n error: {\n title: 'Could not fetch the API',\n },\n rawButtonTitle: 'Raw',\n },\n apiDefinitionDialog: {\n closeButtonTitle: 'Close',\n tabsAriaLabel: 'API definition options',\n toggleButtonAriaLabel: 'Toggle API Definition Dialog',\n rawButtonTitle: 'Raw',\n },\n defaultApiExplorerPage: {\n title: 'APIs',\n subtitle: '{{orgName}} API Explorer',\n pageTitleOverride: 'APIs',\n createButtonTitle: 'Register Existing API',\n supportButtonTitle: 'All your APIs',\n },\n consumedApisCard: {\n title: 'Consumed APIs',\n error: {\n title: 'Could not load APIs',\n },\n emptyContent: {\n title: 'This {{entity}} does not consume any APIs.',\n },\n },\n hasApisCard: {\n title: 'APIs',\n error: {\n title: 'Could not load APIs',\n },\n emptyContent: {\n title: 'This {{entity}} does not contain any APIs.',\n },\n },\n providedApisCard: {\n title: 'Provided APIs',\n error: {\n title: 'Could not load APIs',\n },\n emptyContent: {\n title: 'This {{entity}} does not provide any APIs.',\n },\n },\n apiEntityColumns: {\n typeTitle: 'Type',\n apiDefinitionTitle: 'API Definition',\n },\n consumingComponentsCard: {\n title: 'Consumers',\n error: {\n title: 'Could not load components',\n },\n emptyContent: {\n title: 'No component consumes this API.',\n },\n },\n providingComponentsCard: {\n title: 'Providers',\n error: {\n title: 'Could not load components',\n },\n emptyContent: {\n title: 'No component provides this API.',\n },\n },\n apisCardHelpLinkTitle: 'Learn how to change this.',\n },\n});\n"],"names":[],"mappings":";;AAqBO,MAAM,wBAAwB,oBAAA,CAAqB;AAAA,EACxD,EAAA,EAAI,UAAA;AAAA,EACJ,QAAA,EAAU;AAAA,IACR,iBAAA,EAAmB;AAAA,MACjB,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,cAAA,EAAgB;AAAA,KAClB;AAAA,IACA,mBAAA,EAAqB;AAAA,MACnB,gBAAA,EAAkB,OAAA;AAAA,MAClB,aAAA,EAAe,wBAAA;AAAA,MACf,qBAAA,EAAuB,8BAAA;AAAA,MACvB,cAAA,EAAgB;AAAA,KAClB;AAAA,IACA,sBAAA,EAAwB;AAAA,MACtB,KAAA,EAAO,MAAA;AAAA,MACP,QAAA,EAAU,0BAAA;AAAA,MACV,iBAAA,EAAmB,MAAA;AAAA,MACnB,iBAAA,EAAmB,uBAAA;AAAA,MACnB,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,eAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,WAAA,EAAa;AAAA,MACX,KAAA,EAAO,MAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,KAAA,EAAO,eAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,gBAAA,EAAkB;AAAA,MAChB,SAAA,EAAW,MAAA;AAAA,MACX,kBAAA,EAAoB;AAAA,KACtB;AAAA,IACA,uBAAA,EAAyB;AAAA,MACvB,KAAA,EAAO,WAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,uBAAA,EAAyB;AAAA,MACvB,KAAA,EAAO,WAAA;AAAA,MACP,KAAA,EAAO;AAAA,QACL,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,KAAA,EAAO;AAAA;AACT,KACF;AAAA,IACA,qBAAA,EAAuB;AAAA;AAE3B,CAAC;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-api-docs",
3
- "version": "0.14.5",
3
+ "version": "0.14.6-next.0",
4
4
  "description": "A Backstage plugin that helps represent API entities in the frontend",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -66,15 +66,15 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@asyncapi/react-component": "^2.3.3",
69
- "@backstage/catalog-model": "^1.10.1",
70
- "@backstage/core-components": "^0.18.14",
71
- "@backstage/core-plugin-api": "^1.12.10",
72
- "@backstage/frontend-plugin-api": "^0.18.1",
73
- "@backstage/plugin-catalog": "^2.0.9",
74
- "@backstage/plugin-catalog-common": "^1.2.0",
75
- "@backstage/plugin-catalog-react": "^3.2.3",
76
- "@backstage/plugin-permission-react": "^0.5.5",
77
- "@backstage/ui": "^0.18.0",
69
+ "@backstage/catalog-model": "1.10.2-next.0",
70
+ "@backstage/core-components": "0.18.15-next.0",
71
+ "@backstage/core-plugin-api": "1.12.11-next.0",
72
+ "@backstage/frontend-plugin-api": "0.18.2-next.0",
73
+ "@backstage/plugin-catalog": "2.0.10-next.0",
74
+ "@backstage/plugin-catalog-common": "1.2.1-next.0",
75
+ "@backstage/plugin-catalog-react": "3.2.4-next.0",
76
+ "@backstage/plugin-permission-react": "0.5.6-next.0",
77
+ "@backstage/ui": "0.18.0",
78
78
  "@graphiql/react": "0.29.0",
79
79
  "@material-ui/core": "^4.12.2",
80
80
  "@material-ui/icons": "^4.9.1",
@@ -87,11 +87,11 @@
87
87
  "zod": "^4.0.0"
88
88
  },
89
89
  "devDependencies": {
90
- "@backstage/cli": "^0.36.6",
91
- "@backstage/core-app-api": "^1.20.5",
92
- "@backstage/dev-utils": "^1.1.27",
93
- "@backstage/frontend-test-utils": "^0.6.4",
94
- "@backstage/test-utils": "^1.7.22",
90
+ "@backstage/cli": "0.36.7-next.0",
91
+ "@backstage/core-app-api": "1.20.6-next.0",
92
+ "@backstage/dev-utils": "1.1.28-next.0",
93
+ "@backstage/frontend-test-utils": "0.6.5-next.0",
94
+ "@backstage/test-utils": "1.7.23-next.0",
95
95
  "@testing-library/dom": "^10.0.0",
96
96
  "@testing-library/jest-dom": "^6.0.0",
97
97
  "@testing-library/react": "^16.0.0",