@backstage/plugin-techdocs 1.6.9-next.1 → 1.7.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,47 @@
1
1
  # @backstage/plugin-techdocs
2
2
 
3
+ ## 1.7.0-next.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 406b786a2a2c: Mark package as being free of side effects, allowing more optimized Webpack builds.
8
+ - Updated dependencies
9
+ - @backstage/catalog-model@1.4.2-next.2
10
+ - @backstage/config@1.1.0-next.2
11
+ - @backstage/core-components@0.13.5-next.3
12
+ - @backstage/core-plugin-api@1.6.0-next.3
13
+ - @backstage/errors@1.2.2-next.0
14
+ - @backstage/integration@1.7.0-next.3
15
+ - @backstage/integration-react@1.1.19-next.3
16
+ - @backstage/plugin-catalog-react@1.8.4-next.3
17
+ - @backstage/plugin-search-common@1.2.6-next.2
18
+ - @backstage/plugin-search-react@1.7.0-next.3
19
+ - @backstage/plugin-techdocs-react@1.1.10-next.3
20
+ - @backstage/theme@0.4.2-next.0
21
+
22
+ ## 1.7.0-next.2
23
+
24
+ ### Minor Changes
25
+
26
+ - e44f45ac4515: This change allows a new annotation of `backstage.io/techdocs-entity` this ref allows you to reference another entity for its TechDocs. This allows you have a single TechDoc for all items in a system, for example you might have a frontend and a backend in the same repo. This would allow you to have TechDocs build under a `System` entity while referencing the system e.g.: `backstage.io/techdocs-entity: system:default/example` that will show the systems docs in both the TechDocs button and the TechDocs tab without needing to do duplicate builds and filling the TechDocs page with garbage.
27
+
28
+ ### Patch Changes
29
+
30
+ - 8cec7664e146: Removed `@types/node` dependency
31
+ - Updated dependencies
32
+ - @backstage/integration-react@1.1.19-next.2
33
+ - @backstage/core-components@0.13.5-next.2
34
+ - @backstage/core-plugin-api@1.6.0-next.2
35
+ - @backstage/config@1.1.0-next.1
36
+ - @backstage/plugin-catalog-react@1.8.4-next.2
37
+ - @backstage/plugin-search-react@1.7.0-next.2
38
+ - @backstage/plugin-techdocs-react@1.1.10-next.2
39
+ - @backstage/integration@1.7.0-next.2
40
+ - @backstage/catalog-model@1.4.2-next.1
41
+ - @backstage/errors@1.2.1
42
+ - @backstage/theme@0.4.1
43
+ - @backstage/plugin-search-common@1.2.6-next.1
44
+
3
45
  ## 1.6.9-next.1
4
46
 
5
47
  ### Patch Changes
@@ -2,7 +2,7 @@ import React, { useState } from 'react';
2
2
  import useAsync from 'react-use/lib/useAsync';
3
3
  import { makeStyles } from '@material-ui/core';
4
4
  import { catalogApiRef, CATALOG_FILTER_EXISTS, useEntityOwnership } from '@backstage/plugin-catalog-react';
5
- import { T as TechDocsPageWrapper, D as DocsTable, a as DocsCardGrid } from './index-05858541.esm.js';
5
+ import { T as TechDocsPageWrapper, D as DocsTable, a as DocsCardGrid } from './index-f1c01785.esm.js';
6
6
  import { Content, Progress, WarningPanel, CodeSnippet, HeaderTabs, ContentHeader, SupportButton } from '@backstage/core-components';
7
7
  import { useApi } from '@backstage/core-plugin-api';
8
8
  import '@backstage/errors';
@@ -126,4 +126,4 @@ const TechDocsCustomHome = (props) => {
126
126
  };
127
127
 
128
128
  export { TechDocsCustomHome };
129
- //# sourceMappingURL=TechDocsCustomHome-df16ceef.esm.js.map
129
+ //# sourceMappingURL=TechDocsCustomHome-43b6b9e3.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TechDocsCustomHome-df16ceef.esm.js","sources":["../../src/home/components/TechDocsCustomHome.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 React, { useState } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { makeStyles } from '@material-ui/core';\nimport { CSSProperties } from '@material-ui/styles';\nimport {\n CATALOG_FILTER_EXISTS,\n catalogApiRef,\n CatalogApi,\n useEntityOwnership,\n} from '@backstage/plugin-catalog-react';\nimport { Entity } from '@backstage/catalog-model';\nimport { DocsTable } from './Tables';\nimport { DocsCardGrid } from './Grids';\nimport { TechDocsPageWrapper } from './TechDocsPageWrapper';\n\nimport {\n CodeSnippet,\n Content,\n HeaderTabs,\n Progress,\n WarningPanel,\n SupportButton,\n ContentHeader,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst panels = {\n DocsTable: DocsTable,\n DocsCardGrid: DocsCardGrid,\n};\n\n/**\n * Available panel types\n *\n * @public\n */\nexport type PanelType = 'DocsCardGrid' | 'DocsTable';\n\n/**\n * Type representing a TechDocsCustomHome panel.\n *\n * @public\n */\nexport interface PanelConfig {\n title: string;\n description: string;\n panelType: PanelType;\n panelCSS?: CSSProperties;\n filterPredicate: ((entity: Entity) => boolean) | string;\n}\n\n/**\n * Type representing a TechDocsCustomHome tab.\n *\n * @public\n */\nexport interface TabConfig {\n label: string;\n panels: PanelConfig[];\n}\n\n/**\n * Type representing a list of TechDocsCustomHome tabs.\n *\n * @public\n */\nexport type TabsConfig = TabConfig[];\n\nconst CustomPanel = ({\n config,\n entities,\n index,\n}: {\n config: PanelConfig;\n entities: Entity[];\n index: number;\n}) => {\n const useStyles = makeStyles({\n panelContainer: {\n marginBottom: '2rem',\n ...(config.panelCSS ? config.panelCSS : {}),\n },\n });\n const classes = useStyles();\n const { loading: loadingOwnership, isOwnedEntity } = useEntityOwnership();\n\n const Panel = panels[config.panelType];\n\n const shownEntities = entities.filter(entity => {\n if (config.filterPredicate === 'ownedByUser') {\n if (loadingOwnership) {\n return false;\n }\n return isOwnedEntity(entity);\n }\n\n return (\n typeof config.filterPredicate === 'function' &&\n config.filterPredicate(entity)\n );\n });\n\n return (\n <>\n <ContentHeader title={config.title} description={config.description}>\n {index === 0 ? (\n <SupportButton>\n Discover documentation in your ecosystem.\n </SupportButton>\n ) : null}\n </ContentHeader>\n <div className={classes.panelContainer}>\n <Panel data-testid=\"techdocs-custom-panel\" entities={shownEntities} />\n </div>\n </>\n );\n};\n\n/**\n * Props for {@link TechDocsCustomHome}\n *\n * @public\n */\nexport type TechDocsCustomHomeProps = {\n tabsConfig: TabsConfig;\n};\n\nexport const TechDocsCustomHome = (props: TechDocsCustomHomeProps) => {\n const { tabsConfig } = props;\n const [selectedTab, setSelectedTab] = useState<number>(0);\n const catalogApi: CatalogApi = useApi(catalogApiRef);\n\n const {\n value: entities,\n loading,\n error,\n } = useAsync(async () => {\n const response = await catalogApi.getEntities({\n filter: {\n 'metadata.annotations.backstage.io/techdocs-ref': CATALOG_FILTER_EXISTS,\n },\n fields: [\n 'apiVersion',\n 'kind',\n 'metadata',\n 'relations',\n 'spec.owner',\n 'spec.type',\n ],\n });\n return response.items.filter((entity: Entity) => {\n return !!entity.metadata.annotations?.['backstage.io/techdocs-ref'];\n });\n });\n\n const currentTabConfig = tabsConfig[selectedTab];\n\n if (loading) {\n return (\n <TechDocsPageWrapper>\n <Content>\n <Progress />\n </Content>\n </TechDocsPageWrapper>\n );\n }\n\n if (error) {\n return (\n <TechDocsPageWrapper>\n <Content>\n <WarningPanel\n severity=\"error\"\n title=\"Could not load available documentation.\"\n >\n <CodeSnippet language=\"text\" text={error.toString()} />\n </WarningPanel>\n </Content>\n </TechDocsPageWrapper>\n );\n }\n\n return (\n <TechDocsPageWrapper>\n <HeaderTabs\n selectedIndex={selectedTab}\n onChange={index => setSelectedTab(index)}\n tabs={tabsConfig.map(({ label }, index) => ({\n id: index.toString(),\n label,\n }))}\n />\n <Content data-testid=\"techdocs-content\">\n {currentTabConfig.panels.map((config, index) => (\n <CustomPanel\n key={index}\n config={config}\n entities={!!entities ? entities : []}\n index={index}\n />\n ))}\n </Content>\n </TechDocsPageWrapper>\n );\n};\n"],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MAAA;AAAA,MACA,QAAU,EAAA,CAAC,CAAC,QAAA,GAAW,WAAW,EAAC;AAAA,MACnC,KAAA;AAAA,KAAA;AAAA,GAEH,CACH,CACF,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"TechDocsCustomHome-43b6b9e3.esm.js","sources":["../../src/home/components/TechDocsCustomHome.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 React, { useState } from 'react';\nimport useAsync from 'react-use/lib/useAsync';\nimport { makeStyles } from '@material-ui/core';\nimport { CSSProperties } from '@material-ui/styles';\nimport {\n CATALOG_FILTER_EXISTS,\n catalogApiRef,\n CatalogApi,\n useEntityOwnership,\n} from '@backstage/plugin-catalog-react';\nimport { Entity } from '@backstage/catalog-model';\nimport { DocsTable } from './Tables';\nimport { DocsCardGrid } from './Grids';\nimport { TechDocsPageWrapper } from './TechDocsPageWrapper';\n\nimport {\n CodeSnippet,\n Content,\n HeaderTabs,\n Progress,\n WarningPanel,\n SupportButton,\n ContentHeader,\n} from '@backstage/core-components';\nimport { useApi } from '@backstage/core-plugin-api';\n\nconst panels = {\n DocsTable: DocsTable,\n DocsCardGrid: DocsCardGrid,\n};\n\n/**\n * Available panel types\n *\n * @public\n */\nexport type PanelType = 'DocsCardGrid' | 'DocsTable';\n\n/**\n * Type representing a TechDocsCustomHome panel.\n *\n * @public\n */\nexport interface PanelConfig {\n title: string;\n description: string;\n panelType: PanelType;\n panelCSS?: CSSProperties;\n filterPredicate: ((entity: Entity) => boolean) | string;\n}\n\n/**\n * Type representing a TechDocsCustomHome tab.\n *\n * @public\n */\nexport interface TabConfig {\n label: string;\n panels: PanelConfig[];\n}\n\n/**\n * Type representing a list of TechDocsCustomHome tabs.\n *\n * @public\n */\nexport type TabsConfig = TabConfig[];\n\nconst CustomPanel = ({\n config,\n entities,\n index,\n}: {\n config: PanelConfig;\n entities: Entity[];\n index: number;\n}) => {\n const useStyles = makeStyles({\n panelContainer: {\n marginBottom: '2rem',\n ...(config.panelCSS ? config.panelCSS : {}),\n },\n });\n const classes = useStyles();\n const { loading: loadingOwnership, isOwnedEntity } = useEntityOwnership();\n\n const Panel = panels[config.panelType];\n\n const shownEntities = entities.filter(entity => {\n if (config.filterPredicate === 'ownedByUser') {\n if (loadingOwnership) {\n return false;\n }\n return isOwnedEntity(entity);\n }\n\n return (\n typeof config.filterPredicate === 'function' &&\n config.filterPredicate(entity)\n );\n });\n\n return (\n <>\n <ContentHeader title={config.title} description={config.description}>\n {index === 0 ? (\n <SupportButton>\n Discover documentation in your ecosystem.\n </SupportButton>\n ) : null}\n </ContentHeader>\n <div className={classes.panelContainer}>\n <Panel data-testid=\"techdocs-custom-panel\" entities={shownEntities} />\n </div>\n </>\n );\n};\n\n/**\n * Props for {@link TechDocsCustomHome}\n *\n * @public\n */\nexport type TechDocsCustomHomeProps = {\n tabsConfig: TabsConfig;\n};\n\nexport const TechDocsCustomHome = (props: TechDocsCustomHomeProps) => {\n const { tabsConfig } = props;\n const [selectedTab, setSelectedTab] = useState<number>(0);\n const catalogApi: CatalogApi = useApi(catalogApiRef);\n\n const {\n value: entities,\n loading,\n error,\n } = useAsync(async () => {\n const response = await catalogApi.getEntities({\n filter: {\n 'metadata.annotations.backstage.io/techdocs-ref': CATALOG_FILTER_EXISTS,\n },\n fields: [\n 'apiVersion',\n 'kind',\n 'metadata',\n 'relations',\n 'spec.owner',\n 'spec.type',\n ],\n });\n return response.items.filter((entity: Entity) => {\n return !!entity.metadata.annotations?.['backstage.io/techdocs-ref'];\n });\n });\n\n const currentTabConfig = tabsConfig[selectedTab];\n\n if (loading) {\n return (\n <TechDocsPageWrapper>\n <Content>\n <Progress />\n </Content>\n </TechDocsPageWrapper>\n );\n }\n\n if (error) {\n return (\n <TechDocsPageWrapper>\n <Content>\n <WarningPanel\n severity=\"error\"\n title=\"Could not load available documentation.\"\n >\n <CodeSnippet language=\"text\" text={error.toString()} />\n </WarningPanel>\n </Content>\n </TechDocsPageWrapper>\n );\n }\n\n return (\n <TechDocsPageWrapper>\n <HeaderTabs\n selectedIndex={selectedTab}\n onChange={index => setSelectedTab(index)}\n tabs={tabsConfig.map(({ label }, index) => ({\n id: index.toString(),\n label,\n }))}\n />\n <Content data-testid=\"techdocs-content\">\n {currentTabConfig.panels.map((config, index) => (\n <CustomPanel\n key={index}\n config={config}\n entities={!!entities ? entities : []}\n index={index}\n />\n ))}\n </Content>\n </TechDocsPageWrapper>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAM,MAAS,GAAA;AAAA,EACb,SAAA;AAAA,EACA,YAAA;AACF,CAAA,CAAA;AAuCA,MAAM,cAAc,CAAC;AAAA,EACnB,MAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AACF,CAIM,KAAA;AACJ,EAAA,MAAM,YAAY,UAAW,CAAA;AAAA,IAC3B,cAAgB,EAAA;AAAA,MACd,YAAc,EAAA,MAAA;AAAA,MACd,GAAI,MAAA,CAAO,QAAW,GAAA,MAAA,CAAO,WAAW,EAAC;AAAA,KAC3C;AAAA,GACD,CAAA,CAAA;AACD,EAAA,MAAM,UAAU,SAAU,EAAA,CAAA;AAC1B,EAAA,MAAM,EAAE,OAAA,EAAS,gBAAkB,EAAA,aAAA,KAAkB,kBAAmB,EAAA,CAAA;AAExE,EAAM,MAAA,KAAA,GAAQ,MAAO,CAAA,MAAA,CAAO,SAAS,CAAA,CAAA;AAErC,EAAM,MAAA,aAAA,GAAgB,QAAS,CAAA,MAAA,CAAO,CAAU,MAAA,KAAA;AAC9C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AC,UAAA;AAAA,IAAA;AAAA,MACC,aAAe,EAAA,WAAA;AAAA,MACf,QAAA,EAAU,CAAS,KAAA,KAAA,cAAA,CAAe,KAAK,CAAA;AAAA,MACvC,MAAM,UAAW,CAAA,GAAA,CAAI,CAAC,EAAE,KAAA,IAAS,KAAW,MAAA;AAAA,QAC1C,EAAA,EAAI,MAAM,QAAS,EAAA;AAAA,QACnB,KAAA;AAAA,OACA,CAAA,CAAA;AAAA,KAAA;AAAA,GACJ,kBACC,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EAAQ,aAAY,EAAA,kBAAA,EAAA,EAClB,iBAAiB,MAAO,CAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,KACpC,qBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACC,GAAK,EAAA,KAAA;AAAA,MACL,MAAA;AAAA,MACA,QAAU,EAAA,CAAC,CAAC,QAAA,GAAW,WAAW,EAAC;AAAA,MACnC,KAAA;AAAA,KAAA;AAAA,GAEH,CACH,CACF,CAAA,CAAA;AAEJ;;;;"}
@@ -1,4 +1,4 @@
1
- export { c as TechDocsReaderLayout, b as TechDocsReaderPage } from './index-05858541.esm.js';
1
+ export { c as TechDocsReaderLayout, b as TechDocsReaderPage } from './index-f1c01785.esm.js';
2
2
  import '@backstage/core-plugin-api';
3
3
  import '@backstage/errors';
4
4
  import 'event-source-polyfill';
@@ -33,4 +33,4 @@ import '@material-ui/icons/Share';
33
33
  import '@material-ui/styles';
34
34
  import '@material-ui/icons/Star';
35
35
  import '@material-ui/icons/StarBorder';
36
- //# sourceMappingURL=index-85604292.esm.js.map
36
+ //# sourceMappingURL=index-533d76b7.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-533d76b7.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -25,7 +25,7 @@ import Helmet from 'react-helmet';
25
25
  import { useTheme as useTheme$1 } from '@material-ui/core/styles';
26
26
  import CodeIcon from '@material-ui/icons/Code';
27
27
  import { getEntityRelations, EntityRefLink, EntityRefLinks, useEntityList, useEntityOwnership, humanizeEntityRef, useStarredEntities, CATALOG_FILTER_EXISTS, EntityListProvider, CatalogFilterLayout, UserListPicker, EntityOwnerPicker, EntityTagPicker, useEntity } from '@backstage/plugin-catalog-react';
28
- import { RELATION_OWNED_BY, getCompoundEntityRef } from '@backstage/catalog-model';
28
+ import { RELATION_OWNED_BY, getCompoundEntityRef, parseEntityRef } from '@backstage/catalog-model';
29
29
  import { capitalize } from 'lodash';
30
30
  import SettingsIcon from '@material-ui/icons/Settings';
31
31
  import ShareIcon from '@material-ui/icons/Share';
@@ -2528,7 +2528,7 @@ const EntityTechdocsContent = techdocsPlugin.provide(
2528
2528
  const TechDocsCustomHome = techdocsPlugin.provide(
2529
2529
  createRoutableExtension({
2530
2530
  name: "TechDocsCustomHome",
2531
- component: () => import('./TechDocsCustomHome-df16ceef.esm.js').then(
2531
+ component: () => import('./TechDocsCustomHome-43b6b9e3.esm.js').then(
2532
2532
  (m) => m.TechDocsCustomHome
2533
2533
  ),
2534
2534
  mountPoint: rootRouteRef
@@ -2546,7 +2546,7 @@ const TechDocsIndexPage$2 = techdocsPlugin.provide(
2546
2546
  const TechDocsReaderPage = techdocsPlugin.provide(
2547
2547
  createRoutableExtension({
2548
2548
  name: "TechDocsReaderPage",
2549
- component: () => import('./index-85604292.esm.js').then(
2549
+ component: () => import('./index-533d76b7.esm.js').then(
2550
2550
  (m) => m.TechDocsReaderPage
2551
2551
  ),
2552
2552
  mountPoint: rootDocsRouteRef
@@ -2562,8 +2562,18 @@ const TechDocsSearchResultListItem = techdocsPlugin.provide(
2562
2562
  })
2563
2563
  );
2564
2564
 
2565
+ const TECHDOCS_EXTERNAL_ANNOTATION$1 = "backstage.io/techdocs-entity";
2565
2566
  const EntityPageDocs = ({ entity }) => {
2566
- const entityRef = getCompoundEntityRef(entity);
2567
+ var _a, _b;
2568
+ let entityRef = getCompoundEntityRef(entity);
2569
+ if ((_a = entity.metadata.annotations) == null ? void 0 : _a[TECHDOCS_EXTERNAL_ANNOTATION$1]) {
2570
+ try {
2571
+ entityRef = parseEntityRef(
2572
+ (_b = entity.metadata.annotations) == null ? void 0 : _b[TECHDOCS_EXTERNAL_ANNOTATION$1]
2573
+ );
2574
+ } catch {
2575
+ }
2576
+ }
2567
2577
  return /* @__PURE__ */ React.createElement(TechDocsReaderPage, { entityRef }, /* @__PURE__ */ React.createElement(TechDocsReaderPageSubheader, null), /* @__PURE__ */ React.createElement(TechDocsReaderPageContent, { withSearch: false }));
2568
2578
  };
2569
2579
 
@@ -2578,9 +2588,10 @@ var TechDocsIndexPage$1 = /*#__PURE__*/Object.freeze({
2578
2588
  });
2579
2589
 
2580
2590
  const TECHDOCS_ANNOTATION = "backstage.io/techdocs-ref";
2591
+ const TECHDOCS_EXTERNAL_ANNOTATION = "backstage.io/techdocs-entity";
2581
2592
  const isTechDocsAvailable = (entity) => {
2582
- var _a, _b;
2583
- return Boolean((_b = (_a = entity == null ? void 0 : entity.metadata) == null ? void 0 : _a.annotations) == null ? void 0 : _b[TECHDOCS_ANNOTATION]);
2593
+ var _a, _b, _c, _d;
2594
+ return Boolean((_b = (_a = entity == null ? void 0 : entity.metadata) == null ? void 0 : _a.annotations) == null ? void 0 : _b[TECHDOCS_ANNOTATION]) || Boolean((_d = (_c = entity == null ? void 0 : entity.metadata) == null ? void 0 : _c.annotations) == null ? void 0 : _d[TECHDOCS_EXTERNAL_ANNOTATION]);
2584
2595
  };
2585
2596
  const Router = () => {
2586
2597
  return /* @__PURE__ */ React.createElement(Routes, null, /* @__PURE__ */ React.createElement(Route, { path: "/", element: /* @__PURE__ */ React.createElement(TechDocsIndexPage, null) }), /* @__PURE__ */ React.createElement(
@@ -2592,7 +2603,7 @@ const Router = () => {
2592
2603
  ));
2593
2604
  };
2594
2605
  const EmbeddedDocsRouter = (props) => {
2595
- var _a;
2606
+ var _a, _b;
2596
2607
  const { children } = props;
2597
2608
  const { entity } = useEntity();
2598
2609
  const element = useRoutes([
@@ -2607,9 +2618,9 @@ const EmbeddedDocsRouter = (props) => {
2607
2618
  ]
2608
2619
  }
2609
2620
  ]);
2610
- const projectId = (_a = entity.metadata.annotations) == null ? void 0 : _a[TECHDOCS_ANNOTATION];
2621
+ const projectId = ((_a = entity.metadata.annotations) == null ? void 0 : _a[TECHDOCS_ANNOTATION]) || ((_b = entity.metadata.annotations) == null ? void 0 : _b[TECHDOCS_EXTERNAL_ANNOTATION]);
2611
2622
  if (!projectId) {
2612
- return /* @__PURE__ */ React.createElement(MissingAnnotationEmptyState, { annotation: TECHDOCS_ANNOTATION });
2623
+ return /* @__PURE__ */ React.createElement(MissingAnnotationEmptyState, { annotation: [TECHDOCS_ANNOTATION] });
2613
2624
  }
2614
2625
  return element;
2615
2626
  };
@@ -2622,4 +2633,4 @@ var Router$1 = /*#__PURE__*/Object.freeze({
2622
2633
  });
2623
2634
 
2624
2635
  export { DocsTable as D, EntityTechdocsContent as E, Reader as R, TechDocsPageWrapper as T, DocsCardGrid as a, TechDocsReaderPage$1 as b, TechDocsReaderLayout as c, TechDocsCustomHome as d, TechDocsIndexPage$2 as e, TechdocsPage as f, TechDocsReaderPage as g, TechDocsSearchResultListItem as h, techdocsStorageApiRef as i, techdocsApiRef as j, TechDocsClient as k, TechDocsStorageClient as l, TechDocsReaderProvider as m, TechDocsReaderPageHeader as n, TechDocsReaderPageContent as o, TechDocsReaderPageSubheader as p, TechDocsSearch as q, EntityListDocsGrid as r, EntityListDocsTable as s, techdocsPlugin as t, DefaultTechDocsHome as u, TechDocsPicker as v, isTechDocsAvailable as w, Router as x, EmbeddedDocsRouter as y };
2625
- //# sourceMappingURL=index-05858541.esm.js.map
2636
+ //# sourceMappingURL=index-f1c01785.esm.js.map