@backstage/plugin-techdocs 1.6.0 → 1.6.1-next.1

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,49 @@
1
1
  # @backstage/plugin-techdocs
2
2
 
3
+ ## 1.6.1-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 6c809d1a41c: Minor visual tweaks to adapt to changes in mkdocs-material v9
8
+ - 847a1eee3da: Change anchor links color in Techdocs content
9
+
10
+ With the color (mkdocs supplied) used for anchor links the background and foreground colors do not have a sufficient contrast ratio. Using the link color from theme palette.
11
+
12
+ - e0c6e8b9c3c: Update peer dependencies
13
+ - Updated dependencies
14
+ - @backstage/core-components@0.12.6-next.1
15
+ - @backstage/integration-react@1.1.12-next.1
16
+ - @backstage/core-plugin-api@1.5.1-next.0
17
+ - @backstage/plugin-techdocs-react@1.1.5-next.1
18
+ - @backstage/plugin-catalog-react@1.4.1-next.1
19
+ - @backstage/integration@1.4.4-next.0
20
+ - @backstage/plugin-search-react@1.5.2-next.1
21
+ - @backstage/theme@0.2.19-next.0
22
+ - @backstage/catalog-model@1.2.1
23
+ - @backstage/config@1.0.7
24
+ - @backstage/errors@1.1.5
25
+ - @backstage/plugin-search-common@1.2.3-next.0
26
+
27
+ ## 1.6.1-next.0
28
+
29
+ ### Patch Changes
30
+
31
+ - b2e182cdfa4: Fixes a UI bug in search result item which rendered the item text with incorrect font size and color
32
+ - 8e00acb28db: Small tweaks to remove warnings in the console during development (mainly focusing on techdocs)
33
+ - Updated dependencies
34
+ - @backstage/core-components@0.12.6-next.0
35
+ - @backstage/plugin-search-react@1.5.2-next.0
36
+ - @backstage/plugin-techdocs-react@1.1.5-next.0
37
+ - @backstage/plugin-catalog-react@1.4.1-next.0
38
+ - @backstage/integration-react@1.1.12-next.0
39
+ - @backstage/core-plugin-api@1.5.0
40
+ - @backstage/config@1.0.7
41
+ - @backstage/integration@1.4.3
42
+ - @backstage/catalog-model@1.2.1
43
+ - @backstage/errors@1.1.5
44
+ - @backstage/theme@0.2.18
45
+ - @backstage/plugin-search-common@1.2.2
46
+
3
47
  ## 1.6.0
4
48
 
5
49
  ### 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-de111f38.esm.js';
5
+ import { T as TechDocsPageWrapper, D as DocsTable, a as DocsCardGrid } from './index-27835b1e.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';
@@ -21,7 +21,7 @@ import '@material-ui/icons/FeedbackOutlined';
21
21
  import 'react-dom';
22
22
  import 'git-url-parse';
23
23
  import '@material-ui/icons/Menu';
24
- import '@material-ui/core/Button';
24
+ import '@material-ui/core/IconButton';
25
25
  import 'react-use/lib/useCopyToClipboard';
26
26
  import 'react-helmet';
27
27
  import '@material-ui/core/styles';
@@ -126,4 +126,4 @@ const TechDocsCustomHome = (props) => {
126
126
  };
127
127
 
128
128
  export { TechDocsCustomHome };
129
- //# sourceMappingURL=TechDocsCustomHome-0b9f43da.esm.js.map
129
+ //# sourceMappingURL=TechDocsCustomHome-cd6edd4b.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TechDocsCustomHome-cd6edd4b.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,IAAA,kBAAA,KAAA,CAAA,aAAA,CA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AAA,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;;;;"}
@@ -19,7 +19,7 @@ import FeedbackOutlinedIcon from '@material-ui/icons/FeedbackOutlined';
19
19
  import ReactDOM from 'react-dom';
20
20
  import parseGitUrl from 'git-url-parse';
21
21
  import MenuIcon from '@material-ui/icons/Menu';
22
- import Button$1 from '@material-ui/core/Button';
22
+ import IconButton$1 from '@material-ui/core/IconButton';
23
23
  import useCopyToClipboard from 'react-use/lib/useCopyToClipboard';
24
24
  import Helmet from 'react-helmet';
25
25
  import { useTheme as useTheme$1 } from '@material-ui/core/styles';
@@ -418,7 +418,9 @@ const TechDocsSearchResultListItem$1 = (props) => {
418
418
  WebkitBoxOrient: "vertical",
419
419
  WebkitLineClamp: lineClamp,
420
420
  overflow: "hidden"
421
- }
421
+ },
422
+ color: "textSecondary",
423
+ variant: "body2"
422
424
  },
423
425
  (highlight == null ? void 0 : highlight.fields.text) ? /* @__PURE__ */ React.createElement(
424
426
  HighlightedSearchResultText,
@@ -890,7 +892,7 @@ var variables = ({ theme }) => `
890
892
  /* TYPESET */
891
893
  --md-typeset-font-size: 1rem;
892
894
  --md-typeset-color: var(--md-default-fg-color);
893
- --md-typeset-a-color: var(--md-accent-fg-color);
895
+ --md-typeset-a-color: ${theme.palette.link};
894
896
  --md-typeset-table-color: ${theme.palette.text.primary};
895
897
  --md-typeset-del-color: ${theme.palette.type === "dark" ? alpha(theme.palette.error.dark, 0.5) : alpha(theme.palette.error.light, 0.5)};
896
898
  --md-typeset-ins-color: ${theme.palette.type === "dark" ? alpha(theme.palette.success.dark, 0.5) : alpha(theme.palette.success.light, 0.5)};
@@ -928,6 +930,11 @@ const SIDEBAR_WIDTH = "224px";
928
930
  var layout = ({ theme, sidebar }) => `
929
931
  /*================== Layout ==================*/
930
932
 
933
+ /* mkdocs material v9 compat */
934
+ .md-nav__title {
935
+ color: var(--md-default-fg-color);
936
+ }
937
+
931
938
  .md-grid {
932
939
  max-width: 100%;
933
940
  margin: 0;
@@ -1528,7 +1535,15 @@ const CopyToClipboardButton = ({ text }) => {
1528
1535
  onClose: handleClose,
1529
1536
  leaveDelay: 1e3
1530
1537
  },
1531
- /* @__PURE__ */ React.createElement(Button$1, { className: "md-clipboard md-icon", onClick: handleClick }, /* @__PURE__ */ React.createElement(CopyToClipboardIcon, null))
1538
+ /* @__PURE__ */ React.createElement(
1539
+ IconButton$1,
1540
+ {
1541
+ style: { color: "inherit" },
1542
+ className: "md-clipboard md-icon",
1543
+ onClick: handleClick
1544
+ },
1545
+ /* @__PURE__ */ React.createElement(CopyToClipboardIcon, null)
1546
+ )
1532
1547
  );
1533
1548
  };
1534
1549
  const copyToClipboard = (theme) => {
@@ -2058,7 +2073,7 @@ const TechDocsReaderPageSubheader = (props) => {
2058
2073
  onClose: handleClose,
2059
2074
  keepMounted: true
2060
2075
  },
2061
- settingsAddons
2076
+ /* @__PURE__ */ React.createElement("div", null, settingsAddons)
2062
2077
  )) : null
2063
2078
  ));
2064
2079
  };
@@ -2461,7 +2476,7 @@ const EntityTechdocsContent = techdocsPlugin.provide(
2461
2476
  const TechDocsCustomHome = techdocsPlugin.provide(
2462
2477
  createRoutableExtension({
2463
2478
  name: "TechDocsCustomHome",
2464
- component: () => import('./TechDocsCustomHome-0b9f43da.esm.js').then(
2479
+ component: () => import('./TechDocsCustomHome-cd6edd4b.esm.js').then(
2465
2480
  (m) => m.TechDocsCustomHome
2466
2481
  ),
2467
2482
  mountPoint: rootRouteRef
@@ -2479,7 +2494,7 @@ const TechDocsIndexPage$2 = techdocsPlugin.provide(
2479
2494
  const TechDocsReaderPage = techdocsPlugin.provide(
2480
2495
  createRoutableExtension({
2481
2496
  name: "TechDocsReaderPage",
2482
- component: () => import('./index-7a1c229e.esm.js').then(
2497
+ component: () => import('./index-4901a4ac.esm.js').then(
2483
2498
  (m) => m.TechDocsReaderPage
2484
2499
  ),
2485
2500
  mountPoint: rootDocsRouteRef
@@ -2555,4 +2570,4 @@ var Router$1 = /*#__PURE__*/Object.freeze({
2555
2570
  });
2556
2571
 
2557
2572
  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 };
2558
- //# sourceMappingURL=index-de111f38.esm.js.map
2573
+ //# sourceMappingURL=index-27835b1e.esm.js.map