@backstage/plugin-techdocs 1.6.0-next.0 → 1.6.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # @backstage/plugin-techdocs
2
2
 
3
+ ## 1.6.0-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 65454876fb2: Minor API report tweaks
8
+ - Updated dependencies
9
+ - @backstage/core-components@0.12.5-next.2
10
+ - @backstage/plugin-techdocs-react@1.1.4-next.2
11
+ - @backstage/plugin-catalog-react@1.4.0-next.2
12
+ - @backstage/plugin-search-react@1.5.1-next.2
13
+ - @backstage/core-plugin-api@1.5.0-next.2
14
+ - @backstage/integration-react@1.1.11-next.2
15
+ - @backstage/config@1.0.7-next.0
16
+ - @backstage/integration@1.4.3-next.0
17
+
18
+ ## 1.6.0-next.1
19
+
20
+ ### Patch Changes
21
+
22
+ - 54a1e133b56: Fix bug that caused next and previous links not to work with certain versions of mkdocs-material
23
+ - cb8ec97cdeb: Change black & white colors to be theme aware
24
+ - c10384a9235: Switch to using `LinkButton` instead of the deprecated `Button`
25
+ - 8adfda60ae1: Updated dependency `jss` to `~10.10.0`.
26
+ - 52b0022dab7: Updated dependency `msw` to `^1.0.0`.
27
+ - 238cf657c09: Copy to clipboard now works in a not secure context.
28
+ - Updated dependencies
29
+ - @backstage/core-components@0.12.5-next.1
30
+ - @backstage/errors@1.1.5-next.0
31
+ - @backstage/plugin-techdocs-react@1.1.4-next.1
32
+ - @backstage/core-plugin-api@1.4.1-next.1
33
+ - @backstage/integration-react@1.1.11-next.1
34
+ - @backstage/integration@1.4.3-next.0
35
+ - @backstage/config@1.0.7-next.0
36
+ - @backstage/theme@0.2.18-next.0
37
+ - @backstage/plugin-catalog-react@1.4.0-next.1
38
+ - @backstage/catalog-model@1.2.1-next.1
39
+ - @backstage/plugin-search-common@1.2.2-next.0
40
+ - @backstage/plugin-search-react@1.5.1-next.1
41
+
3
42
  ## 1.6.0-next.0
4
43
 
5
44
  ### Minor 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-5ce3a177.esm.js';
5
+ import { T as TechDocsPageWrapper, D as DocsTable, a as DocsCardGrid } from './index-de111f38.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';
@@ -22,12 +22,13 @@ import 'react-dom';
22
22
  import 'git-url-parse';
23
23
  import '@material-ui/icons/Menu';
24
24
  import '@material-ui/core/Button';
25
+ import 'react-use/lib/useCopyToClipboard';
25
26
  import 'react-helmet';
27
+ import '@material-ui/core/styles';
26
28
  import '@material-ui/icons/Code';
27
29
  import '@backstage/catalog-model';
28
30
  import 'lodash';
29
31
  import '@material-ui/icons/Settings';
30
- import 'react-use/lib/useCopyToClipboard';
31
32
  import '@material-ui/icons/Share';
32
33
  import '@material-ui/styles';
33
34
  import '@material-ui/icons/Star';
@@ -125,4 +126,4 @@ const TechDocsCustomHome = (props) => {
125
126
  };
126
127
 
127
128
  export { TechDocsCustomHome };
128
- //# sourceMappingURL=TechDocsCustomHome-64750785.esm.js.map
129
+ //# sourceMappingURL=TechDocsCustomHome-0b9f43da.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TechDocsCustomHome-64750785.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,CAAA;AAAA,OACT;AACA,MAAA,OAAO,cAAc,MAAM,CAAA,CAAA;AAAA,KAC7B;AAEA,IAAA,OACE,OAAO,MAAO,CAAA,eAAA,KAAoB,UAClC,IAAA,MAAA,CAAO,gBAAgB,MAAM,CAAA,CAAA;AAAA,GAEhC,CAAA,CAAA;AAED,EAAA,uBAEI,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,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BAAA,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
+ {"version":3,"file":"TechDocsCustomHome-0b9f43da.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,kB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AA,EAAS,QAAO,IAAM,EAAA,KAAA,CAAM,UAAY,EAAA,CAAA;AAAA,KAEzD,CACF,CAAA,CAAA;AAAA,GAEJ;AAEA,EAAA,2CACG,mBACC,EAAA,IAAA,kBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,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-5ce3a177.esm.js';
1
+ export { c as TechDocsReaderLayout, b as TechDocsReaderPage } from './index-de111f38.esm.js';
2
2
  import '@backstage/core-plugin-api';
3
3
  import '@backstage/errors';
4
4
  import 'event-source-polyfill';
@@ -21,15 +21,16 @@ import 'react-dom';
21
21
  import 'git-url-parse';
22
22
  import '@material-ui/icons/Menu';
23
23
  import '@material-ui/core/Button';
24
+ import 'react-use/lib/useCopyToClipboard';
24
25
  import 'react-helmet';
26
+ import '@material-ui/core/styles';
25
27
  import '@material-ui/icons/Code';
26
28
  import '@backstage/plugin-catalog-react';
27
29
  import '@backstage/catalog-model';
28
30
  import 'lodash';
29
31
  import '@material-ui/icons/Settings';
30
- import 'react-use/lib/useCopyToClipboard';
31
32
  import '@material-ui/icons/Share';
32
33
  import '@material-ui/styles';
33
34
  import '@material-ui/icons/Star';
34
35
  import '@material-ui/icons/StarBorder';
35
- //# sourceMappingURL=index-bc1891e4.esm.js.map
36
+ //# sourceMappingURL=index-7a1c229e.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-7a1c229e.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -6,7 +6,7 @@ import { useParams, useNavigate, useOutlet, Routes, Route, useRoutes } from 'rea
6
6
  import { techdocsStorageApiRef as techdocsStorageApiRef$1, useTechDocsReaderPage, SHADOW_DOM_STYLE_LOAD_EVENT, useShadowDomStylesLoading, useTechDocsAddons, TechDocsAddonLocations, TechDocsShadowDom, TECHDOCS_ADDONS_WRAPPER_KEY, TECHDOCS_ADDONS_KEY, TechDocsReaderPageProvider, techdocsApiRef as techdocsApiRef$1 } from '@backstage/plugin-techdocs-react';
7
7
  import useAsync from 'react-use/lib/useAsync';
8
8
  import useAsyncRetry from 'react-use/lib/useAsyncRetry';
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';
9
+ import { Link, LogViewer, ErrorPage, useSidebarPinState, Content, HeaderLabel, Header, Page, ItemCardGrid, ItemCardHeader, LinkButton, WarningPanel, CodeSnippet, Progress, ContentHeader, SubvalueCell, Table, EmptyState, PageWithHeader, SupportButton, MissingAnnotationEmptyState } from '@backstage/core-components';
10
10
  import { makeStyles, ListItemText, ListItemIcon, 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
11
  import { HighlightedSearchResultText, SearchContextProvider, useSearch, SearchAutocomplete, createSearchResultListItemExtension } from '@backstage/plugin-search-react';
12
12
  import Typography from '@material-ui/core/Typography';
@@ -20,13 +20,14 @@ import ReactDOM from 'react-dom';
20
20
  import parseGitUrl from 'git-url-parse';
21
21
  import MenuIcon from '@material-ui/icons/Menu';
22
22
  import Button$1 from '@material-ui/core/Button';
23
+ import useCopyToClipboard from 'react-use/lib/useCopyToClipboard';
23
24
  import Helmet from 'react-helmet';
25
+ import { useTheme as useTheme$1 } from '@material-ui/core/styles';
24
26
  import CodeIcon from '@material-ui/icons/Code';
25
27
  import { getEntityRelations, EntityRefLink, EntityRefLinks, useEntityList, useEntityOwnership, humanizeEntityRef, useStarredEntities, CATALOG_FILTER_EXISTS, EntityListProvider, CatalogFilterLayout, UserListPicker, EntityOwnerPicker, EntityTagPicker, useEntity } from '@backstage/plugin-catalog-react';
26
28
  import { RELATION_OWNED_BY, getCompoundEntityRef } from '@backstage/catalog-model';
27
29
  import { capitalize } from 'lodash';
28
30
  import SettingsIcon from '@material-ui/icons/Settings';
29
- import useCopyToClipboard from 'react-use/lib/useCopyToClipboard';
30
31
  import ShareIcon from '@material-ui/icons/Share';
31
32
  import { withStyles as withStyles$1 } from '@material-ui/styles';
32
33
  import Star from '@material-ui/icons/Star';
@@ -344,9 +345,8 @@ function useReaderState(kind, namespace, name, path) {
344
345
 
345
346
  const TechDocsReaderContext = createContext({});
346
347
  const useTechDocsReader = () => useContext(TechDocsReaderContext);
347
- const TechDocsReaderProvider = ({
348
- children
349
- }) => {
348
+ const TechDocsReaderProvider = (props) => {
349
+ const { children } = props;
350
350
  const { "*": path = "" } = useParams();
351
351
  const { entityRef } = useTechDocsReaderPage();
352
352
  const { kind, namespace, name } = entityRef;
@@ -1015,7 +1015,7 @@ var layout = ({ theme, sidebar }) => `
1015
1015
  pointer-events: none;
1016
1016
  }
1017
1017
 
1018
- .md-footer-nav__link {
1018
+ .md-footer-nav__link, .md-footer__link {
1019
1019
  pointer-events: all;
1020
1020
  }
1021
1021
 
@@ -1511,10 +1511,11 @@ const CopyToClipboardTooltip = withStyles((theme) => ({
1511
1511
  const CopyToClipboardIcon = () => /* @__PURE__ */ React.createElement(SvgIcon, null, /* @__PURE__ */ React.createElement("path", { d: "M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z" }));
1512
1512
  const CopyToClipboardButton = ({ text }) => {
1513
1513
  const [open, setOpen] = useState(false);
1514
+ const [, copyToClipboard2] = useCopyToClipboard();
1514
1515
  const handleClick = useCallback(() => {
1515
- window.navigator.clipboard.writeText(text);
1516
+ copyToClipboard2(text);
1516
1517
  setOpen(true);
1517
- }, [text]);
1518
+ }, [text, copyToClipboard2]);
1518
1519
  const handleClose = useCallback(() => {
1519
1520
  setOpen(false);
1520
1521
  }, [setOpen]);
@@ -1901,6 +1902,11 @@ const rootCatalogDocsRouteRef = createRouteRef({
1901
1902
 
1902
1903
  const skeleton = /* @__PURE__ */ React.createElement(Skeleton, { animation: "wave", variant: "text", height: 40 });
1903
1904
  const TechDocsReaderPageHeader = (props) => {
1905
+ const {
1906
+ palette: {
1907
+ common: { white }
1908
+ }
1909
+ } = useTheme$1();
1904
1910
  const { children } = props;
1905
1911
  const addons = useTechDocsAddons();
1906
1912
  const configApi = useApi(configApiRef);
@@ -1968,7 +1974,7 @@ const TechDocsReaderPageHeader = (props) => {
1968
1974
  container: true,
1969
1975
  direction: "column",
1970
1976
  alignItems: "center",
1971
- style: { color: "#fff" }
1977
+ style: { color: white }
1972
1978
  },
1973
1979
  /* @__PURE__ */ React.createElement(Grid, { style: { padding: 0 }, item: true }, /* @__PURE__ */ React.createElement(CodeIcon, { style: { marginTop: "-25px" } })),
1974
1980
  /* @__PURE__ */ React.createElement(Grid, { style: { padding: 0 }, item: true }, "Source")
@@ -2057,10 +2063,8 @@ const TechDocsReaderPageSubheader = (props) => {
2057
2063
  ));
2058
2064
  };
2059
2065
 
2060
- const TechDocsReaderLayout = ({
2061
- withSearch,
2062
- withHeader = true
2063
- }) => {
2066
+ const TechDocsReaderLayout = (props) => {
2067
+ const { withSearch, withHeader = true } = props;
2064
2068
  return /* @__PURE__ */ React.createElement(Page, { themeId: "documentation" }, withHeader && /* @__PURE__ */ React.createElement(TechDocsReaderPageHeader, null), /* @__PURE__ */ React.createElement(TechDocsReaderPageSubheader, null), /* @__PURE__ */ React.createElement(TechDocsReaderPageContent, { withSearch }));
2065
2069
  };
2066
2070
  const TechDocsReaderPage$1 = (props) => {
@@ -2108,7 +2112,7 @@ const DocsCardGrid = (props) => {
2108
2112
  title: (_a = entity.metadata.title) != null ? _a : entity.metadata.name
2109
2113
  }
2110
2114
  )), /* @__PURE__ */ React.createElement(CardContent, null, entity.metadata.description), /* @__PURE__ */ React.createElement(CardActions, null, /* @__PURE__ */ React.createElement(
2111
- Button$2,
2115
+ LinkButton,
2112
2116
  {
2113
2117
  to: getRouteToReaderPageFor({
2114
2118
  namespace: toLowerMaybe(
@@ -2130,10 +2134,8 @@ const allEntitiesGroup = {
2130
2134
  title: "All Documentation",
2131
2135
  filterPredicate: () => true
2132
2136
  };
2133
- const EntityListDocsGridGroup = ({
2134
- entities,
2135
- group
2136
- }) => {
2137
+ const EntityListDocsGridGroup = (props) => {
2138
+ const { entities, group } = props;
2137
2139
  const { loading: loadingOwnership, isOwnedEntity } = useEntityOwnership();
2138
2140
  const shownEntities = entities.filter((entity) => {
2139
2141
  if (group.filterPredicate === "ownedByUser") {
@@ -2152,7 +2154,7 @@ const EntityListDocsGridGroup = ({
2152
2154
  }
2153
2155
  return /* @__PURE__ */ React.createElement(Content, null, titleComponent, /* @__PURE__ */ React.createElement(DocsCardGrid, { entities: shownEntities }));
2154
2156
  };
2155
- const EntityListDocsGrid = ({ groups }) => {
2157
+ const EntityListDocsGrid = (props) => {
2156
2158
  const { loading, error, entities } = useEntityList();
2157
2159
  if (error) {
2158
2160
  return /* @__PURE__ */ React.createElement(
@@ -2178,7 +2180,7 @@ const EntityListDocsGrid = ({ groups }) => {
2178
2180
  );
2179
2181
  }
2180
2182
  );
2181
- return /* @__PURE__ */ React.createElement(Content, null, (groups || [allEntitiesGroup]).map((group, index) => /* @__PURE__ */ React.createElement(
2183
+ return /* @__PURE__ */ React.createElement(Content, null, (props.groups || [allEntitiesGroup]).map((group, index) => /* @__PURE__ */ React.createElement(
2182
2184
  EntityListDocsGridGroup,
2183
2185
  {
2184
2186
  entities,
@@ -2204,7 +2206,8 @@ const actionFactories = {
2204
2206
  };
2205
2207
  },
2206
2208
  createStarEntityAction(isStarredEntity, toggleStarredEntity) {
2207
- return ({ entity }) => {
2209
+ return (row) => {
2210
+ const entity = row.entity;
2208
2211
  const isStarred = isStarredEntity(entity);
2209
2212
  return {
2210
2213
  cellStyle: { paddingLeft: "1em" },
@@ -2312,7 +2315,7 @@ const DocsTable = (props) => {
2312
2315
  title: "No documents to show",
2313
2316
  description: "Create your own document. Check out our Getting Started Information",
2314
2317
  action: /* @__PURE__ */ React.createElement(
2315
- Button$2,
2318
+ LinkButton,
2316
2319
  {
2317
2320
  color: "primary",
2318
2321
  to: "https://backstage.io/docs/features/techdocs/getting-started",
@@ -2458,7 +2461,7 @@ const EntityTechdocsContent = techdocsPlugin.provide(
2458
2461
  const TechDocsCustomHome = techdocsPlugin.provide(
2459
2462
  createRoutableExtension({
2460
2463
  name: "TechDocsCustomHome",
2461
- component: () => import('./TechDocsCustomHome-64750785.esm.js').then(
2464
+ component: () => import('./TechDocsCustomHome-0b9f43da.esm.js').then(
2462
2465
  (m) => m.TechDocsCustomHome
2463
2466
  ),
2464
2467
  mountPoint: rootRouteRef
@@ -2476,7 +2479,7 @@ const TechDocsIndexPage$2 = techdocsPlugin.provide(
2476
2479
  const TechDocsReaderPage = techdocsPlugin.provide(
2477
2480
  createRoutableExtension({
2478
2481
  name: "TechDocsReaderPage",
2479
- component: () => import('./index-bc1891e4.esm.js').then(
2482
+ component: () => import('./index-7a1c229e.esm.js').then(
2480
2483
  (m) => m.TechDocsReaderPage
2481
2484
  ),
2482
2485
  mountPoint: rootDocsRouteRef
@@ -2552,4 +2555,4 @@ var Router$1 = /*#__PURE__*/Object.freeze({
2552
2555
  });
2553
2556
 
2554
2557
  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 };
2555
- //# sourceMappingURL=index-5ce3a177.esm.js.map
2558
+ //# sourceMappingURL=index-de111f38.esm.js.map