@backstage/plugin-techdocs 1.4.3-next.1 → 1.4.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,44 @@
1
1
  # @backstage/plugin-techdocs
2
2
 
3
+ ## 1.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - a74dd61534: Fix sizing of build log component to render all lines
8
+ - 80ce4e8c29: Small updates to some components to ensure theme typography properties are inherited correctly.
9
+ - 7115c7389b: Updated dependency `jss` to `~10.9.0`.
10
+ - Updated dependencies
11
+ - @backstage/catalog-model@1.1.5
12
+ - @backstage/plugin-catalog-react@1.2.4
13
+ - @backstage/core-components@0.12.3
14
+ - @backstage/plugin-search-react@1.4.0
15
+ - @backstage/core-plugin-api@1.3.0
16
+ - @backstage/plugin-techdocs-react@1.1.2
17
+ - @backstage/config@1.0.6
18
+ - @backstage/errors@1.1.4
19
+ - @backstage/integration@1.4.2
20
+ - @backstage/integration-react@1.1.9
21
+ - @backstage/theme@0.2.16
22
+ - @backstage/plugin-search-common@1.2.1
23
+
24
+ ## 1.4.3-next.2
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies
29
+ - @backstage/plugin-search-react@1.4.0-next.2
30
+ - @backstage/core-plugin-api@1.3.0-next.1
31
+ - @backstage/plugin-catalog-react@1.2.4-next.2
32
+ - @backstage/plugin-techdocs-react@1.1.2-next.2
33
+ - @backstage/catalog-model@1.1.5-next.1
34
+ - @backstage/config@1.0.6-next.0
35
+ - @backstage/core-components@0.12.3-next.2
36
+ - @backstage/errors@1.1.4
37
+ - @backstage/integration@1.4.2-next.0
38
+ - @backstage/integration-react@1.1.9-next.2
39
+ - @backstage/theme@0.2.16
40
+ - @backstage/plugin-search-common@1.2.1-next.0
41
+
3
42
  ## 1.4.3-next.1
4
43
 
5
44
  ### 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-0b629b97.esm.js';
5
+ import { T as TechDocsPageWrapper, D as DocsTable, a as DocsCardGrid } from './index-1937614f.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';
@@ -10,6 +10,7 @@ import 'event-source-polyfill';
10
10
  import 'react-router-dom';
11
11
  import '@backstage/plugin-techdocs-react';
12
12
  import 'react-use/lib/useAsyncRetry';
13
+ import '@material-ui/core/Typography';
13
14
  import '@backstage/plugin-search-react';
14
15
  import '@material-ui/lab';
15
16
  import '@material-ui/icons/Close';
@@ -124,4 +125,4 @@ const TechDocsCustomHome = (props) => {
124
125
  };
125
126
 
126
127
  export { TechDocsCustomHome };
127
- //# sourceMappingURL=TechDocsCustomHome-77c90730.esm.js.map
128
+ //# sourceMappingURL=TechDocsCustomHome-a8048941.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TechDocsCustomHome-77c90730.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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GAEH,CACH,CACF,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"TechDocsCustomHome-a8048941.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,IAAI,IAAA,MAAA,CAAO,oBAAoB,aAAe,EAAA;AAC5C,MAAA,IAAI,gBAAkB,EAAA;AACpB,QAAO,OAAA,KAAA,CA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AK,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;;;;"}
@@ -7,7 +7,8 @@ import { techdocsStorageApiRef as techdocsStorageApiRef$1, useTechDocsReaderPage
7
7
  import useAsync from 'react-use/lib/useAsync';
8
8
  import useAsyncRetry from 'react-use/lib/useAsyncRetry';
9
9
  import { Link, LogViewer, ErrorPage, useSidebarPinState, Content, HeaderLabel, Header, Page, ItemCardGrid, ItemCardHeader, Button as Button$2, WarningPanel, CodeSnippet, Progress, ContentHeader, SubvalueCell, Table, EmptyState, PageWithHeader, SupportButton, MissingAnnotationEmptyState } from '@backstage/core-components';
10
- import { makeStyles, ListItemText, ListItem, ListItemIcon, Divider, Paper, createStyles, Button, Drawer, Grid, Typography, IconButton, CircularProgress, lighten, alpha, useTheme, withStyles, Tooltip, ThemeProvider, SvgIcon, useMediaQuery, Portal, Toolbar, Box, Menu, Card, CardMedia, CardContent, CardActions } from '@material-ui/core';
10
+ import { makeStyles, ListItemText, ListItem, ListItemIcon, Divider, Paper, createStyles, Button, Drawer, Grid, Typography as Typography$1, IconButton, CircularProgress, lighten, alpha, useTheme, withStyles, Tooltip, ThemeProvider, SvgIcon, useMediaQuery, Portal, Toolbar, Box, Menu, Card, CardMedia, CardContent, CardActions } from '@material-ui/core';
11
+ import Typography from '@material-ui/core/Typography';
11
12
  import { HighlightedSearchResultText, SearchContextProvider, useSearch, SearchAutocomplete } from '@backstage/plugin-search-react';
12
13
  import { Alert, Skeleton } from '@material-ui/lab';
13
14
  import Close from '@material-ui/icons/Close';
@@ -47,6 +48,15 @@ class TechDocsClient {
47
48
  async getApiOrigin() {
48
49
  return await this.discoveryApi.getBaseUrl("techdocs");
49
50
  }
51
+ /**
52
+ * Retrieve TechDocs metadata.
53
+ *
54
+ * When docs are built, we generate a techdocs_metadata.json and store it along with the generated
55
+ * static files. It includes necessary data about the docs site. This method requests techdocs-backend
56
+ * which retrieves the TechDocs metadata.
57
+ *
58
+ * @param entityId - Object containing entity data like name, namespace, etc.
59
+ */
50
60
  async getTechDocsMetadata(entityId) {
51
61
  const { kind, namespace, name } = entityId;
52
62
  const apiOrigin = await this.getApiOrigin();
@@ -57,6 +67,14 @@ class TechDocsClient {
57
67
  }
58
68
  return await request.json();
59
69
  }
70
+ /**
71
+ * Retrieve metadata about an entity.
72
+ *
73
+ * This method requests techdocs-backend which uses the catalog APIs to respond with filtered
74
+ * information required here.
75
+ *
76
+ * @param entityId - Object containing entity data like name, namespace, etc.
77
+ */
60
78
  async getEntityMetadata(entityId) {
61
79
  const { kind, namespace, name } = entityId;
62
80
  const apiOrigin = await this.getApiOrigin();
@@ -85,6 +103,14 @@ class TechDocsStorageClient {
85
103
  async getBuilder() {
86
104
  return this.configApi.getString("techdocs.builder");
87
105
  }
106
+ /**
107
+ * Fetch HTML content as text for an individual docs page in an entity's docs site.
108
+ *
109
+ * @param entityId - Object containing entity data like name, namespace, etc.
110
+ * @param path - The unique path to an individual docs page e.g. overview/what-is-new
111
+ * @returns HTML content of the docs page as string
112
+ * @throws Throws error when the page is not found.
113
+ */
88
114
  async getEntityDocs(entityId, path) {
89
115
  const { kind, namespace, name } = entityId;
90
116
  const storageUrl = await this.getStorageUrl();
@@ -106,6 +132,14 @@ class TechDocsStorageClient {
106
132
  }
107
133
  return request.text();
108
134
  }
135
+ /**
136
+ * Check if docs are on the latest version and trigger rebuild if not
137
+ *
138
+ * @param entityId - Object containing entity data like name, namespace, etc.
139
+ * @param logHandler - Callback to receive log messages from the build process
140
+ * @returns Whether documents are currently synchronized to newest version
141
+ * @throws Throws error on error from sync endpoint in Techdocs Backend
142
+ */
109
143
  async syncEntityDocs(entityId, logHandler = () => {
110
144
  }) {
111
145
  const { kind, namespace, name } = entityId;
@@ -382,8 +416,9 @@ const TechDocsSearchResultListItem = (props) => {
382
416
  primaryTypographyProps: { variant: "h6" },
383
417
  primary: /* @__PURE__ */ React.createElement(LinkWrapper, null, title ? title : /* @__PURE__ */ React.createElement(React.Fragment, null, resultTitle, " | ", entityTitle != null ? entityTitle : resultName, " docs")),
384
418
  secondary: /* @__PURE__ */ React.createElement(
385
- "span",
419
+ Typography,
386
420
  {
421
+ component: "span",
387
422
  style: {
388
423
  display: "-webkit-box",
389
424
  WebkitBoxOrient: "vertical",
@@ -551,7 +586,7 @@ const TechDocsBuildLogsDrawerContent = ({
551
586
  spacing: 0,
552
587
  wrap: "nowrap"
553
588
  },
554
- /* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Build Details"),
589
+ /* @__PURE__ */ React.createElement(Typography$1, { variant: "h5" }, "Build Details"),
555
590
  /* @__PURE__ */ React.createElement(
556
591
  IconButton,
557
592
  {
@@ -608,6 +643,8 @@ const useStyles$2 = makeStyles((theme) => ({
608
643
  marginBottom: theme.spacing(2)
609
644
  },
610
645
  message: {
646
+ // `word-break: break-word` is deprecated, but gives legacy support to browsers not supporting `overflow-wrap` yet
647
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/word-break
611
648
  wordBreak: "break-word",
612
649
  overflowWrap: "anywhere"
613
650
  }
@@ -1668,6 +1705,7 @@ const useTechDocsReaderDom = (entityRef) => {
1668
1705
  stylesTransformer
1669
1706
  ]),
1670
1707
  [
1708
+ // only add dependencies that are in state or memorized variables to avoid unnecessary calls between re-renders
1671
1709
  entityRef,
1672
1710
  scmIntegrationsApi,
1673
1711
  techdocsStorageApi,
@@ -1706,6 +1744,7 @@ const useTechDocsReaderDom = (entityRef) => {
1706
1744
  }
1707
1745
  }
1708
1746
  }),
1747
+ // disable MkDocs drawer toggling ('for' attribute => checkbox mechanism)
1709
1748
  onCssReady({
1710
1749
  onLoading: () => {
1711
1750
  },
@@ -1714,6 +1753,7 @@ const useTechDocsReaderDom = (entityRef) => {
1714
1753
  (_a = transformedElement.querySelector(".md-nav__title")) == null ? void 0 : _a.removeAttribute("for");
1715
1754
  }
1716
1755
  }),
1756
+ // hide sidebars until their positions are updated
1717
1757
  onCssReady({
1718
1758
  onLoading: () => {
1719
1759
  const sidebars = Array.from(
@@ -2116,7 +2156,7 @@ const EntityListDocsGrid = ({ groups }) => {
2116
2156
  return /* @__PURE__ */ React.createElement(Progress, null);
2117
2157
  }
2118
2158
  if (entities.length === 0) {
2119
- return /* @__PURE__ */ React.createElement("div", { "data-testid": "doc-not-found" }, /* @__PURE__ */ React.createElement(Typography, { variant: "body2" }, "No documentation found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/techdocs/creating-and-publishing" }, "publishing documentation"), "."));
2159
+ return /* @__PURE__ */ React.createElement("div", { "data-testid": "doc-not-found" }, /* @__PURE__ */ React.createElement(Typography$1, { variant: "body2" }, "No documentation found that match your filter. Learn more about", " ", /* @__PURE__ */ React.createElement(Link, { to: "https://backstage.io/docs/features/techdocs/creating-and-publishing" }, "publishing documentation"), "."));
2120
2160
  }
2121
2161
  entities.sort(
2122
2162
  (a, b) => {
@@ -2404,7 +2444,7 @@ const EntityTechdocsContent = techdocsPlugin.provide(
2404
2444
  const TechDocsCustomHome = techdocsPlugin.provide(
2405
2445
  createRoutableExtension({
2406
2446
  name: "TechDocsCustomHome",
2407
- component: () => import('./TechDocsCustomHome-77c90730.esm.js').then(
2447
+ component: () => import('./TechDocsCustomHome-a8048941.esm.js').then(
2408
2448
  (m) => m.TechDocsCustomHome
2409
2449
  ),
2410
2450
  mountPoint: rootRouteRef
@@ -2422,7 +2462,7 @@ const TechDocsIndexPage$2 = techdocsPlugin.provide(
2422
2462
  const TechDocsReaderPage = techdocsPlugin.provide(
2423
2463
  createRoutableExtension({
2424
2464
  name: "TechDocsReaderPage",
2425
- component: () => import('./index-db694b9e.esm.js').then(
2465
+ component: () => import('./index-58b04432.esm.js').then(
2426
2466
  (m) => m.TechDocsReaderPage
2427
2467
  ),
2428
2468
  mountPoint: rootDocsRouteRef
@@ -2489,4 +2529,4 @@ var Router$1 = /*#__PURE__*/Object.freeze({
2489
2529
  });
2490
2530
 
2491
2531
  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, techdocsStorageApiRef as h, techdocsApiRef as i, TechDocsClient as j, TechDocsStorageClient as k, TechDocsReaderProvider as l, TechDocsReaderPageHeader as m, TechDocsReaderPageContent as n, TechDocsReaderPageSubheader as o, TechDocsSearchResultListItem 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 };
2492
- //# sourceMappingURL=index-0b629b97.esm.js.map
2532
+ //# sourceMappingURL=index-1937614f.esm.js.map