@backstage/plugin-techdocs 1.4.0-next.2 → 1.4.1-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.
- package/CHANGELOG.md +71 -0
- package/dist/esm/{TechDocsCustomHome-b18e6234.esm.js → TechDocsCustomHome-02667b22.esm.js} +3 -3
- package/dist/esm/{TechDocsCustomHome-b18e6234.esm.js.map → TechDocsCustomHome-02667b22.esm.js.map} +1 -1
- package/dist/esm/{index-73ab5148.esm.js → index-5ce38e4c.esm.js} +3 -3
- package/dist/esm/index-5ce38e4c.esm.js.map +1 -0
- package/dist/esm/{index-c0c013ea.esm.js → index-847211c1.esm.js} +28 -16
- package/dist/esm/index-847211c1.esm.js.map +1 -0
- package/dist/index.esm.js +2 -2
- package/package.json +17 -17
- package/dist/esm/index-73ab5148.esm.js.map +0 -1
- package/dist/esm/index-c0c013ea.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# @backstage/plugin-techdocs
|
|
2
2
|
|
|
3
|
+
## 1.4.1-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3280711113: Updated dependency `msw` to `^0.49.0`.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/plugin-techdocs-react@1.0.7-next.0
|
|
10
|
+
- @backstage/core-components@0.12.1-next.0
|
|
11
|
+
- @backstage/core-plugin-api@1.1.1-next.0
|
|
12
|
+
- @backstage/integration-react@1.1.7-next.0
|
|
13
|
+
- @backstage/integration@1.4.1-next.0
|
|
14
|
+
- @backstage/plugin-catalog-react@1.2.2-next.0
|
|
15
|
+
- @backstage/catalog-model@1.1.4-next.0
|
|
16
|
+
- @backstage/config@1.0.5-next.0
|
|
17
|
+
- @backstage/errors@1.1.4-next.0
|
|
18
|
+
- @backstage/theme@0.2.16
|
|
19
|
+
- @backstage/plugin-search-common@1.1.2-next.0
|
|
20
|
+
- @backstage/plugin-search-react@1.2.2-next.0
|
|
21
|
+
|
|
22
|
+
## 1.4.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- 5691baea69: Add ability to configure filters when using EntityListDocsGrid
|
|
27
|
+
|
|
28
|
+
The following example will render two sections of cards grid:
|
|
29
|
+
|
|
30
|
+
- One section for documentations tagged as `recommended`
|
|
31
|
+
- One section for documentations tagged as `runbook`
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
<EntityListDocsGrid groups={{[
|
|
35
|
+
{
|
|
36
|
+
title: "Recommended Documentation",
|
|
37
|
+
filterPredicate: entity =>
|
|
38
|
+
entity?.metadata?.tags?.includes('recommended') ?? false,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
title: "RunBooks Documentation",
|
|
42
|
+
filterPredicate: entity =>
|
|
43
|
+
entity?.metadata?.tags?.includes('runbook') ?? false,
|
|
44
|
+
}
|
|
45
|
+
]}} />
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
- 63705e73d9: Hide document description if not provided
|
|
49
|
+
- 847fc588a6: Updated TechDocs header to include label for source code icon and updated label to reflect Kind name
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- 9e4d8e6198: Fix logic bug that broke techdocs-cli-embedded-app
|
|
54
|
+
- e92aa15f01: Bumped `canvas` dependency to the latest version, which has better Node.js v18 support.
|
|
55
|
+
- cbe11d1e23: Tweak README
|
|
56
|
+
- 7573b65232: Internal refactor of imports to avoid circular dependencies
|
|
57
|
+
- c1784a4980: Replaces in-code uses of `GitHub` with `Github` and deprecates old versions.
|
|
58
|
+
- 3a1a999b7b: Include query parameters when navigating to relative links in documents
|
|
59
|
+
- bd2aab4726: An analytics event matching the semantics of the `click` action is now captured when users click links within a TechDocs document.
|
|
60
|
+
- Updated dependencies
|
|
61
|
+
- @backstage/plugin-catalog-react@1.2.1
|
|
62
|
+
- @backstage/core-components@0.12.0
|
|
63
|
+
- @backstage/core-plugin-api@1.1.0
|
|
64
|
+
- @backstage/integration@1.4.0
|
|
65
|
+
- @backstage/catalog-model@1.1.3
|
|
66
|
+
- @backstage/plugin-techdocs-react@1.0.6
|
|
67
|
+
- @backstage/integration-react@1.1.6
|
|
68
|
+
- @backstage/plugin-search-react@1.2.1
|
|
69
|
+
- @backstage/config@1.0.4
|
|
70
|
+
- @backstage/errors@1.1.3
|
|
71
|
+
- @backstage/theme@0.2.16
|
|
72
|
+
- @backstage/plugin-search-common@1.1.1
|
|
73
|
+
|
|
3
74
|
## 1.4.0-next.2
|
|
4
75
|
|
|
5
76
|
### 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-
|
|
5
|
+
import { T as TechDocsPageWrapper, D as DocsTable, a as DocsCardGrid } from './index-847211c1.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';
|
|
@@ -24,9 +24,9 @@ import '@material-ui/icons/Menu';
|
|
|
24
24
|
import 'react-helmet';
|
|
25
25
|
import '@material-ui/icons/Code';
|
|
26
26
|
import '@backstage/catalog-model';
|
|
27
|
+
import 'lodash';
|
|
27
28
|
import '@material-ui/icons/Settings';
|
|
28
29
|
import 'react-use/lib/useCopyToClipboard';
|
|
29
|
-
import 'lodash';
|
|
30
30
|
import '@material-ui/icons/Share';
|
|
31
31
|
import '@material-ui/styles';
|
|
32
32
|
import '@material-ui/icons/Star';
|
|
@@ -127,4 +127,4 @@ const TechDocsCustomHome = (props) => {
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
export { TechDocsCustomHome };
|
|
130
|
-
//# sourceMappingURL=TechDocsCustomHome-
|
|
130
|
+
//# sourceMappingURL=TechDocsCustomHome-02667b22.esm.js.map
|
package/dist/esm/{TechDocsCustomHome-b18e6234.esm.js.map → TechDocsCustomHome-02667b22.esm.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TechDocsCustomHome-
|
|
1
|
+
{"version":3,"file":"TechDocsCustomHome-02667b22.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,CAA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EAAA;AAAA,KAAG,CACvD,CACF,CACF,CAAA,CAAA;AAAA,GAEJ;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,2CACE,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA;AAAA,IACC,aAAe,EAAA,WAAA;AAAA,IACf,QAAA,EAAU,CAAS,KAAA,KAAA,cAAA,CAAe,KAAK,CAAA;AAAA,IACvC,MAAM,UAAW,CAAA,GAAA,CAAI,CAAC,EAAE,KAAA,IAAS,KAAW,MAAA;AAAA,MAC1C,EAAA,EAAI,MAAM,QAAS,EAAA;AAAA,MACnB,KAAA;AAAA,KACA,CAAA,CAAA;AAAA,GACJ,mBACC,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA;AAAA,IAAQ,aAAY,EAAA,kBAAA;AAAA,GAAA,EAClB,iBAAiB,MAAO,CAAA,GAAA,CAAI,CAAC,MAAA,EAAQ,0BACnC,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA;AAAA,IACC,GAAK,EAAA,KAAA;AAAA,IACL,MAAA;AAAA,IACA,QAAU,EAAA,CAAC,CAAC,QAAA,GAAW,WAAW,EAAC;AAAA,IACnC,KAAA;AAAA,GACF,CACD,CACH,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as TechDocsReaderLayout, b as TechDocsReaderPage } from './index-
|
|
1
|
+
export { c as TechDocsReaderLayout, b as TechDocsReaderPage } from './index-847211c1.esm.js';
|
|
2
2
|
import '@backstage/core-plugin-api';
|
|
3
3
|
import '@backstage/errors';
|
|
4
4
|
import 'event-source-polyfill';
|
|
@@ -24,11 +24,11 @@ import 'react-helmet';
|
|
|
24
24
|
import '@material-ui/icons/Code';
|
|
25
25
|
import '@backstage/plugin-catalog-react';
|
|
26
26
|
import '@backstage/catalog-model';
|
|
27
|
+
import 'lodash';
|
|
27
28
|
import '@material-ui/icons/Settings';
|
|
28
29
|
import 'react-use/lib/useCopyToClipboard';
|
|
29
|
-
import 'lodash';
|
|
30
30
|
import '@material-ui/icons/Share';
|
|
31
31
|
import '@material-ui/styles';
|
|
32
32
|
import '@material-ui/icons/Star';
|
|
33
33
|
import '@material-ui/icons/StarBorder';
|
|
34
|
-
//# sourceMappingURL=index-
|
|
34
|
+
//# sourceMappingURL=index-5ce38e4c.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-5ce38e4c.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -23,9 +23,9 @@ import Helmet from 'react-helmet';
|
|
|
23
23
|
import CodeIcon from '@material-ui/icons/Code';
|
|
24
24
|
import { getEntityRelations, EntityRefLink, EntityRefLinks, useEntityList, useEntityOwnership, humanizeEntityRef, useStarredEntities, CATALOG_FILTER_EXISTS, EntityListProvider, CatalogFilterLayout, UserListPicker, EntityOwnerPicker, EntityTagPicker, useEntity } from '@backstage/plugin-catalog-react';
|
|
25
25
|
import { RELATION_OWNED_BY, getCompoundEntityRef } from '@backstage/catalog-model';
|
|
26
|
+
import { capitalize } from 'lodash';
|
|
26
27
|
import SettingsIcon from '@material-ui/icons/Settings';
|
|
27
28
|
import useCopyToClipboard from 'react-use/lib/useCopyToClipboard';
|
|
28
|
-
import { capitalize } from 'lodash';
|
|
29
29
|
import ShareIcon from '@material-ui/icons/Share';
|
|
30
30
|
import { withStyles as withStyles$1 } from '@material-ui/styles';
|
|
31
31
|
import Star from '@material-ui/icons/Star';
|
|
@@ -1574,6 +1574,7 @@ const useTechDocsReaderDom = (entityRef) => {
|
|
|
1574
1574
|
const isMobileMedia = useMediaQuery(MOBILE_MEDIA_QUERY);
|
|
1575
1575
|
const sanitizerTransformer = useSanitizerTransformer();
|
|
1576
1576
|
const stylesTransformer = useStylesTransformer();
|
|
1577
|
+
const analytics = useAnalytics();
|
|
1577
1578
|
const techdocsStorageApi = useApi(techdocsStorageApiRef$1);
|
|
1578
1579
|
const scmIntegrationsApi = useApi(scmIntegrationsApiRef);
|
|
1579
1580
|
const { state, path, content: rawPage } = useTechDocsReader();
|
|
@@ -1660,16 +1661,19 @@ const useTechDocsReaderDom = (entityRef) => {
|
|
|
1660
1661
|
addLinkClickListener({
|
|
1661
1662
|
baseUrl: window.location.origin,
|
|
1662
1663
|
onClick: (event, url) => {
|
|
1663
|
-
var _a;
|
|
1664
|
+
var _a, _b;
|
|
1664
1665
|
const modifierActive = event.ctrlKey || event.metaKey;
|
|
1665
1666
|
const parsedUrl = new URL(url);
|
|
1666
1667
|
const fullPath = `${parsedUrl.pathname}${parsedUrl.search}${parsedUrl.hash}`;
|
|
1668
|
+
const linkText = ((_a = event.target) == null ? void 0 : _a.innerText) || url;
|
|
1669
|
+
const to = url.replace(window.location.origin, "");
|
|
1670
|
+
analytics.captureEvent("click", linkText, { attributes: { to } });
|
|
1667
1671
|
if (parsedUrl.hash) {
|
|
1668
1672
|
if (modifierActive) {
|
|
1669
1673
|
window.open(fullPath, "_blank");
|
|
1670
1674
|
} else {
|
|
1671
1675
|
navigate(fullPath);
|
|
1672
|
-
(
|
|
1676
|
+
(_b = transformedElement == null ? void 0 : transformedElement.querySelector(`[id="${parsedUrl.hash.slice(1)}"]`)) == null ? void 0 : _b.scrollIntoView();
|
|
1673
1677
|
}
|
|
1674
1678
|
} else {
|
|
1675
1679
|
if (modifierActive) {
|
|
@@ -1701,7 +1705,7 @@ const useTechDocsReaderDom = (entityRef) => {
|
|
|
1701
1705
|
}
|
|
1702
1706
|
})
|
|
1703
1707
|
]),
|
|
1704
|
-
[theme, navigate]
|
|
1708
|
+
[theme, navigate, analytics]
|
|
1705
1709
|
);
|
|
1706
1710
|
useEffect(() => {
|
|
1707
1711
|
if (!rawPage)
|
|
@@ -1872,7 +1876,7 @@ const TechDocsReaderPageHeader = (props) => {
|
|
|
1872
1876
|
setSubtitle(() => {
|
|
1873
1877
|
let { site_description } = metadata;
|
|
1874
1878
|
if (!site_description || site_description === "None") {
|
|
1875
|
-
site_description = "
|
|
1879
|
+
site_description = "";
|
|
1876
1880
|
}
|
|
1877
1881
|
return site_description;
|
|
1878
1882
|
});
|
|
@@ -1884,7 +1888,7 @@ const TechDocsReaderPageHeader = (props) => {
|
|
|
1884
1888
|
const ownedByRelations = entityMetadata ? getEntityRelations(entityMetadata, RELATION_OWNED_BY) : [];
|
|
1885
1889
|
const docsRootLink = useRouteRef(rootRouteRef)();
|
|
1886
1890
|
const labels = /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(HeaderLabel, {
|
|
1887
|
-
label: "
|
|
1891
|
+
label: capitalize((entityMetadata == null ? void 0 : entityMetadata.kind) || "entity"),
|
|
1888
1892
|
value: /* @__PURE__ */ React.createElement(EntityRefLink, {
|
|
1889
1893
|
color: "inherit",
|
|
1890
1894
|
entityRef,
|
|
@@ -1903,13 +1907,21 @@ const TechDocsReaderPageHeader = (props) => {
|
|
|
1903
1907
|
value: lifecycle
|
|
1904
1908
|
}) : null, locationMetadata && locationMetadata.type !== "dir" && locationMetadata.type !== "file" ? /* @__PURE__ */ React.createElement(HeaderLabel, {
|
|
1905
1909
|
label: "",
|
|
1906
|
-
value: /* @__PURE__ */ React.createElement(
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
+
value: /* @__PURE__ */ React.createElement(Grid, {
|
|
1911
|
+
container: true,
|
|
1912
|
+
direction: "column",
|
|
1913
|
+
alignItems: "center",
|
|
1914
|
+
style: { color: "#fff" }
|
|
1915
|
+
}, /* @__PURE__ */ React.createElement(Grid, {
|
|
1916
|
+
style: { padding: 0 },
|
|
1917
|
+
item: true
|
|
1910
1918
|
}, /* @__PURE__ */ React.createElement(CodeIcon, {
|
|
1911
|
-
style: { marginTop: "-25px"
|
|
1912
|
-
}))
|
|
1919
|
+
style: { marginTop: "-25px" }
|
|
1920
|
+
})), /* @__PURE__ */ React.createElement(Grid, {
|
|
1921
|
+
style: { padding: 0 },
|
|
1922
|
+
item: true
|
|
1923
|
+
}, "Source")),
|
|
1924
|
+
url: locationMetadata.target
|
|
1913
1925
|
}) : null);
|
|
1914
1926
|
const noEntMetadata = !entityMetadataLoading && entityMetadata === void 0;
|
|
1915
1927
|
const noTdMetadata = !metadataLoading && metadata === void 0;
|
|
@@ -1919,7 +1931,7 @@ const TechDocsReaderPageHeader = (props) => {
|
|
|
1919
1931
|
type: "Documentation",
|
|
1920
1932
|
typeLink: docsRootLink,
|
|
1921
1933
|
title: title || skeleton,
|
|
1922
|
-
subtitle: subtitle || skeleton
|
|
1934
|
+
subtitle: subtitle === "" ? void 0 : subtitle || skeleton
|
|
1923
1935
|
}, /* @__PURE__ */ React.createElement(Helmet, {
|
|
1924
1936
|
titleTemplate: "%s"
|
|
1925
1937
|
}, /* @__PURE__ */ React.createElement("title", null, tabTitle)), labels, children, addons.renderComponentsByLocation(TechDocsAddonLocations.Header));
|
|
@@ -2380,7 +2392,7 @@ const EntityTechdocsContent = techdocsPlugin.provide(
|
|
|
2380
2392
|
const TechDocsCustomHome = techdocsPlugin.provide(
|
|
2381
2393
|
createRoutableExtension({
|
|
2382
2394
|
name: "TechDocsCustomHome",
|
|
2383
|
-
component: () => import('./TechDocsCustomHome-
|
|
2395
|
+
component: () => import('./TechDocsCustomHome-02667b22.esm.js').then(
|
|
2384
2396
|
(m) => m.TechDocsCustomHome
|
|
2385
2397
|
),
|
|
2386
2398
|
mountPoint: rootRouteRef
|
|
@@ -2398,7 +2410,7 @@ const TechDocsIndexPage$2 = techdocsPlugin.provide(
|
|
|
2398
2410
|
const TechDocsReaderPage = techdocsPlugin.provide(
|
|
2399
2411
|
createRoutableExtension({
|
|
2400
2412
|
name: "TechDocsReaderPage",
|
|
2401
|
-
component: () => import('./index-
|
|
2413
|
+
component: () => import('./index-5ce38e4c.esm.js').then(
|
|
2402
2414
|
(m) => m.TechDocsReaderPage
|
|
2403
2415
|
),
|
|
2404
2416
|
mountPoint: rootDocsRouteRef
|
|
@@ -2475,4 +2487,4 @@ var Router$1 = /*#__PURE__*/Object.freeze({
|
|
|
2475
2487
|
});
|
|
2476
2488
|
|
|
2477
2489
|
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 };
|
|
2478
|
-
//# sourceMappingURL=index-
|
|
2490
|
+
//# sourceMappingURL=index-847211c1.esm.js.map
|