@backstage/plugin-techdocs 1.7.1-next.0 → 1.7.1-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 +41 -0
- package/alpha/package.json +7 -0
- package/dist/alpha.d.ts +14 -0
- package/dist/alpha.esm.js +29 -0
- package/dist/alpha.esm.js.map +1 -0
- package/dist/esm/{TechDocsCustomHome-43b6b9e3.esm.js → TechDocsCustomHome-453580db.esm.js} +3 -2
- package/dist/esm/{TechDocsCustomHome-43b6b9e3.esm.js.map → TechDocsCustomHome-453580db.esm.js.map} +1 -1
- package/dist/esm/TechDocsSearchResultListItem-4736f829.esm.js +91 -0
- package/dist/esm/TechDocsSearchResultListItem-4736f829.esm.js.map +1 -0
- package/dist/esm/{index-f1c01785.esm.js → index-683d6465.esm.js} +21 -100
- package/dist/esm/index-683d6465.esm.js.map +1 -0
- package/dist/esm/{index-533d76b7.esm.js → index-715820dc.esm.js} +3 -2
- package/dist/esm/index-715820dc.esm.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +2 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +37 -24
- package/dist/esm/index-533d76b7.esm.js.map +0 -1
- package/dist/esm/index-f1c01785.esm.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# @backstage/plugin-techdocs
|
|
2
2
|
|
|
3
|
+
## 1.7.1-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3605370af6: Improved `DocsTable` to display pagination controls dynamically, appearing only when needed.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/frontend-plugin-api@0.2.0-next.2
|
|
10
|
+
- @backstage/integration-react@1.1.20-next.2
|
|
11
|
+
- @backstage/core-components@0.13.6-next.2
|
|
12
|
+
- @backstage/core-plugin-api@1.7.0-next.1
|
|
13
|
+
- @backstage/catalog-model@1.4.3-next.0
|
|
14
|
+
- @backstage/plugin-catalog-react@1.8.5-next.2
|
|
15
|
+
- @backstage/integration@1.7.1-next.1
|
|
16
|
+
- @backstage/errors@1.2.3-next.0
|
|
17
|
+
- @backstage/plugin-search-react@1.7.1-next.2
|
|
18
|
+
- @backstage/theme@0.4.3-next.0
|
|
19
|
+
- @backstage/config@1.1.1-next.0
|
|
20
|
+
- @backstage/plugin-search-common@1.2.7-next.0
|
|
21
|
+
- @backstage/plugin-techdocs-react@1.1.12-next.2
|
|
22
|
+
|
|
23
|
+
## 1.7.1-next.1
|
|
24
|
+
|
|
25
|
+
### Patch Changes
|
|
26
|
+
|
|
27
|
+
- 4918f65ab2: Create an experimental `TechDocsSearchResultItemExtension` for declarative integration with Backstage; it can be accessed via the `/alpha` import.
|
|
28
|
+
- df449a7a31: Add kind column by default to TechDocsTable
|
|
29
|
+
- Updated dependencies
|
|
30
|
+
- @backstage/frontend-plugin-api@0.1.1-next.1
|
|
31
|
+
- @backstage/core-components@0.13.6-next.1
|
|
32
|
+
- @backstage/plugin-search-react@1.7.1-next.1
|
|
33
|
+
- @backstage/integration-react@1.1.20-next.1
|
|
34
|
+
- @backstage/plugin-catalog-react@1.8.5-next.1
|
|
35
|
+
- @backstage/plugin-techdocs-react@1.1.12-next.1
|
|
36
|
+
- @backstage/core-plugin-api@1.7.0-next.0
|
|
37
|
+
- @backstage/config@1.1.0
|
|
38
|
+
- @backstage/catalog-model@1.4.2
|
|
39
|
+
- @backstage/errors@1.2.2
|
|
40
|
+
- @backstage/integration@1.7.1-next.0
|
|
41
|
+
- @backstage/theme@0.4.2
|
|
42
|
+
- @backstage/plugin-search-common@1.2.6
|
|
43
|
+
|
|
3
44
|
## 1.7.1-next.0
|
|
4
45
|
|
|
5
46
|
### Patch Changes
|
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
|
|
2
|
+
|
|
3
|
+
/** @alpha */
|
|
4
|
+
declare const TechDocsSearchResultListItemExtension: _backstage_frontend_plugin_api.Extension<{
|
|
5
|
+
lineClamp: number;
|
|
6
|
+
noTrack: boolean;
|
|
7
|
+
asListItem: boolean;
|
|
8
|
+
asLink: boolean;
|
|
9
|
+
title?: string | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
/** @alpha */
|
|
12
|
+
declare const _default: _backstage_frontend_plugin_api.BackstagePlugin;
|
|
13
|
+
|
|
14
|
+
export { TechDocsSearchResultListItemExtension, _default as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createSchemaFromZod, createPlugin } from '@backstage/frontend-plugin-api';
|
|
3
|
+
import { createSearchResultListItemExtension } from '@backstage/plugin-search-react/alpha';
|
|
4
|
+
|
|
5
|
+
const TechDocsSearchResultListItemExtension = createSearchResultListItemExtension({
|
|
6
|
+
id: "techdocs",
|
|
7
|
+
configSchema: createSchemaFromZod(
|
|
8
|
+
(z) => z.object({
|
|
9
|
+
// TODO: Define how the icon can be configurable
|
|
10
|
+
title: z.string().optional(),
|
|
11
|
+
lineClamp: z.number().default(5),
|
|
12
|
+
asLink: z.boolean().default(true),
|
|
13
|
+
asListItem: z.boolean().default(true),
|
|
14
|
+
noTrack: z.boolean().default(false)
|
|
15
|
+
})
|
|
16
|
+
),
|
|
17
|
+
predicate: (result) => result.type === "techdocs",
|
|
18
|
+
component: async ({ config }) => {
|
|
19
|
+
const { TechDocsSearchResultListItem } = await import('./esm/TechDocsSearchResultListItem-4736f829.esm.js');
|
|
20
|
+
return (props) => /* @__PURE__ */ React.createElement(TechDocsSearchResultListItem, { ...props, ...config });
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
var alpha = createPlugin({
|
|
24
|
+
id: "techdocs",
|
|
25
|
+
extensions: [TechDocsSearchResultListItemExtension]
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export { TechDocsSearchResultListItemExtension, alpha as default };
|
|
29
|
+
//# sourceMappingURL=alpha.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.esm.js","sources":["../src/alpha.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 from 'react';\nimport {\n createPlugin,\n createSchemaFromZod,\n} from '@backstage/frontend-plugin-api';\nimport { createSearchResultListItemExtension } from '@backstage/plugin-search-react/alpha';\n\n/** @alpha */\nexport const TechDocsSearchResultListItemExtension =\n createSearchResultListItemExtension({\n id: 'techdocs',\n configSchema: createSchemaFromZod(z =>\n z.object({\n // TODO: Define how the icon can be configurable\n title: z.string().optional(),\n lineClamp: z.number().default(5),\n asLink: z.boolean().default(true),\n asListItem: z.boolean().default(true),\n noTrack: z.boolean().default(false),\n }),\n ),\n predicate: result => result.type === 'techdocs',\n component: async ({ config }) => {\n const { TechDocsSearchResultListItem } = await import(\n './search/components/TechDocsSearchResultListItem'\n );\n return props => <TechDocsSearchResultListItem {...props} {...config} />;\n },\n });\n\n/** @alpha */\nexport default createPlugin({\n id: 'techdocs',\n extensions: [TechDocsSearchResultListItemExtension],\n});\n"],"names":[],"mappings":";;;;AAwBO,MAAM,wCACX,mCAAoC,CAAA;AAAA,EAClC,EAAI,EAAA,UAAA;AAAA,EACJ,YAAc,EAAA,mBAAA;AAAA,IAAoB,CAAA,CAAA,KAChC,EAAE,MAAO,CAAA;AAAA;AAAA,MAEP,KAAO,EAAA,CAAA,CAAE,MAAO,EAAA,CAAE,QAAS,EAAA;AAAA,MAC3B,SAAW,EAAA,CAAA,CAAE,MAAO,EAAA,CAAE,QAAQ,CAAC,CAAA;AAAA,MAC/B,MAAQ,EAAA,CAAA,CAAE,OAAQ,EAAA,CAAE,QAAQ,IAAI,CAAA;AAAA,MAChC,UAAY,EAAA,CAAA,CAAE,OAAQ,EAAA,CAAE,QAAQ,IAAI,CAAA;AAAA,MACpC,OAAS,EAAA,CAAA,CAAE,OAAQ,EAAA,CAAE,QAAQ,KAAK,CAAA;AAAA,KACnC,CAAA;AAAA,GACH;AAAA,EACA,SAAA,EAAW,CAAU,MAAA,KAAA,MAAA,CAAO,IAAS,KAAA,UAAA;AAAA,EACrC,SAAW,EAAA,OAAO,EAAE,MAAA,EAAa,KAAA;AAC/B,IAAA,MAAM,EAAE,4BAAA,EAAiC,GAAA,MAAM,OAC7C,oDACF,CAAA,CAAA;AACA,IAAA,OAAO,2BAAU,KAAA,CAAA,aAAA,CAAA,4BAAA,EAAA,EAA8B,GAAG,KAAA,EAAQ,GAAG,MAAQ,EAAA,CAAA,CAAA;AAAA,GACvE;AACF,CAAC,EAAA;AAGH,YAAe,YAAa,CAAA;AAAA,EAC1B,EAAI,EAAA,UAAA;AAAA,EACJ,UAAA,EAAY,CAAC,qCAAqC,CAAA;AACpD,CAAC,CAAA;;;;"}
|
|
@@ -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-683d6465.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';
|
|
@@ -11,6 +11,7 @@ import 'react-router-dom';
|
|
|
11
11
|
import '@backstage/plugin-techdocs-react';
|
|
12
12
|
import 'react-use/lib/useAsyncRetry';
|
|
13
13
|
import '@backstage/plugin-search-react';
|
|
14
|
+
import './TechDocsSearchResultListItem-4736f829.esm.js';
|
|
14
15
|
import '@material-ui/core/Typography';
|
|
15
16
|
import '@material-ui/lab';
|
|
16
17
|
import '@material-ui/icons/Close';
|
|
@@ -126,4 +127,4 @@ const TechDocsCustomHome = (props) => {
|
|
|
126
127
|
};
|
|
127
128
|
|
|
128
129
|
export { TechDocsCustomHome };
|
|
129
|
-
//# sourceMappingURL=TechDocsCustomHome-
|
|
130
|
+
//# sourceMappingURL=TechDocsCustomHome-453580db.esm.js.map
|
package/dist/esm/{TechDocsCustomHome-43b6b9e3.esm.js.map → TechDocsCustomHome-453580db.esm.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TechDocsCustomHome-
|
|
1
|
+
{"version":3,"file":"TechDocsCustomHome-453580db.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,E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@material-ui/core';
|
|
3
|
+
import Typography from '@material-ui/core/Typography';
|
|
4
|
+
import { Link } from '@backstage/core-components';
|
|
5
|
+
import { HighlightedSearchResultText } from '@backstage/plugin-search-react';
|
|
6
|
+
|
|
7
|
+
const useStyles = makeStyles({
|
|
8
|
+
flexContainer: {
|
|
9
|
+
flexWrap: "wrap"
|
|
10
|
+
},
|
|
11
|
+
itemText: {
|
|
12
|
+
width: "100%",
|
|
13
|
+
marginBottom: "1rem"
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
const TechDocsSearchResultListItem = (props) => {
|
|
17
|
+
const {
|
|
18
|
+
result,
|
|
19
|
+
highlight,
|
|
20
|
+
lineClamp = 5,
|
|
21
|
+
asListItem = true,
|
|
22
|
+
asLink = true,
|
|
23
|
+
title,
|
|
24
|
+
icon
|
|
25
|
+
} = props;
|
|
26
|
+
const classes = useStyles();
|
|
27
|
+
const LinkWrapper = ({ children }) => asLink ? /* @__PURE__ */ React.createElement(Link, { noTrack: true, to: result.location }, children) : /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
28
|
+
const TextItem = () => {
|
|
29
|
+
const resultTitle = (highlight == null ? void 0 : highlight.fields.title) ? /* @__PURE__ */ React.createElement(
|
|
30
|
+
HighlightedSearchResultText,
|
|
31
|
+
{
|
|
32
|
+
text: highlight.fields.title,
|
|
33
|
+
preTag: highlight.preTag,
|
|
34
|
+
postTag: highlight.postTag
|
|
35
|
+
}
|
|
36
|
+
) : result.title;
|
|
37
|
+
const entityTitle = (highlight == null ? void 0 : highlight.fields.entityTitle) ? /* @__PURE__ */ React.createElement(
|
|
38
|
+
HighlightedSearchResultText,
|
|
39
|
+
{
|
|
40
|
+
text: highlight.fields.entityTitle,
|
|
41
|
+
preTag: highlight.preTag,
|
|
42
|
+
postTag: highlight.postTag
|
|
43
|
+
}
|
|
44
|
+
) : result.entityTitle;
|
|
45
|
+
const resultName = (highlight == null ? void 0 : highlight.fields.name) ? /* @__PURE__ */ React.createElement(
|
|
46
|
+
HighlightedSearchResultText,
|
|
47
|
+
{
|
|
48
|
+
text: highlight.fields.name,
|
|
49
|
+
preTag: highlight.preTag,
|
|
50
|
+
postTag: highlight.postTag
|
|
51
|
+
}
|
|
52
|
+
) : result.name;
|
|
53
|
+
if (!result)
|
|
54
|
+
return null;
|
|
55
|
+
return /* @__PURE__ */ React.createElement(
|
|
56
|
+
ListItemText,
|
|
57
|
+
{
|
|
58
|
+
className: classes.itemText,
|
|
59
|
+
primaryTypographyProps: { variant: "h6" },
|
|
60
|
+
primary: /* @__PURE__ */ React.createElement(LinkWrapper, null, title ? title : /* @__PURE__ */ React.createElement(React.Fragment, null, resultTitle, " | ", entityTitle != null ? entityTitle : resultName, " docs")),
|
|
61
|
+
secondary: /* @__PURE__ */ React.createElement(
|
|
62
|
+
Typography,
|
|
63
|
+
{
|
|
64
|
+
component: "span",
|
|
65
|
+
style: {
|
|
66
|
+
display: "-webkit-box",
|
|
67
|
+
WebkitBoxOrient: "vertical",
|
|
68
|
+
WebkitLineClamp: lineClamp,
|
|
69
|
+
overflow: "hidden"
|
|
70
|
+
},
|
|
71
|
+
color: "textSecondary",
|
|
72
|
+
variant: "body2"
|
|
73
|
+
},
|
|
74
|
+
(highlight == null ? void 0 : highlight.fields.text) ? /* @__PURE__ */ React.createElement(
|
|
75
|
+
HighlightedSearchResultText,
|
|
76
|
+
{
|
|
77
|
+
text: highlight.fields.text,
|
|
78
|
+
preTag: highlight.preTag,
|
|
79
|
+
postTag: highlight.postTag
|
|
80
|
+
}
|
|
81
|
+
) : result.text
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
const ListItemWrapper = ({ children }) => asListItem ? /* @__PURE__ */ React.createElement(React.Fragment, null, icon && /* @__PURE__ */ React.createElement(ListItemIcon, null, typeof icon === "function" ? icon(result) : icon), /* @__PURE__ */ React.createElement("div", { className: classes.flexContainer }, children)) : /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
87
|
+
return /* @__PURE__ */ React.createElement(ListItemWrapper, null, /* @__PURE__ */ React.createElement(TextItem, null));
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export { TechDocsSearchResultListItem };
|
|
91
|
+
//# sourceMappingURL=TechDocsSearchResultListItem-4736f829.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TechDocsSearchResultListItem-4736f829.esm.js","sources":["../../src/search/components/TechDocsSearchResultListItem.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, { PropsWithChildren, ReactNode } from 'react';\nimport { ListItemIcon, ListItemText, makeStyles } from '@material-ui/core';\nimport Typography from '@material-ui/core/Typography';\nimport { Link } from '@backstage/core-components';\nimport { ResultHighlight } from '@backstage/plugin-search-common';\nimport { HighlightedSearchResultText } from '@backstage/plugin-search-react';\n\nconst useStyles = makeStyles({\n flexContainer: {\n flexWrap: 'wrap',\n },\n itemText: {\n width: '100%',\n marginBottom: '1rem',\n },\n});\n\n/**\n * Props for {@link TechDocsSearchResultListItem}.\n *\n * @public\n */\nexport type TechDocsSearchResultListItemProps = {\n icon?: ReactNode | ((result: any) => ReactNode);\n result?: any;\n highlight?: ResultHighlight;\n rank?: number;\n lineClamp?: number;\n asListItem?: boolean;\n asLink?: boolean;\n title?: string;\n};\n\n/**\n * Component which renders documentation and related metadata.\n *\n * @public\n */\nexport const TechDocsSearchResultListItem = (\n props: TechDocsSearchResultListItemProps,\n) => {\n const {\n result,\n highlight,\n lineClamp = 5,\n asListItem = true,\n asLink = true,\n title,\n icon,\n } = props;\n const classes = useStyles();\n\n const LinkWrapper = ({ children }: PropsWithChildren<{}>) =>\n asLink ? (\n <Link noTrack to={result.location}>\n {children}\n </Link>\n ) : (\n <>{children}</>\n );\n\n const TextItem = () => {\n const resultTitle = highlight?.fields.title ? (\n <HighlightedSearchResultText\n text={highlight.fields.title}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.title\n );\n\n const entityTitle = highlight?.fields.entityTitle ? (\n <HighlightedSearchResultText\n text={highlight.fields.entityTitle}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.entityTitle\n );\n\n const resultName = highlight?.fields.name ? (\n <HighlightedSearchResultText\n text={highlight.fields.name}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.name\n );\n\n if (!result) return null;\n\n return (\n <ListItemText\n className={classes.itemText}\n primaryTypographyProps={{ variant: 'h6' }}\n primary={\n <LinkWrapper>\n {title ? (\n title\n ) : (\n <>\n {resultTitle} | {entityTitle ?? resultName} docs\n </>\n )}\n </LinkWrapper>\n }\n secondary={\n <Typography\n component=\"span\"\n style={{\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: lineClamp,\n overflow: 'hidden',\n }}\n color=\"textSecondary\"\n variant=\"body2\"\n >\n {highlight?.fields.text ? (\n <HighlightedSearchResultText\n text={highlight.fields.text}\n preTag={highlight.preTag}\n postTag={highlight.postTag}\n />\n ) : (\n result.text\n )}\n </Typography>\n }\n />\n );\n };\n\n const ListItemWrapper = ({ children }: PropsWithChildren<{}>) =>\n asListItem ? (\n <>\n {icon && (\n <ListItemIcon>\n {typeof icon === 'function' ? icon(result) : icon}\n </ListItemIcon>\n )}\n <div className={classes.flexContainer}>{children}</div>\n </>\n ) : (\n <>{children}</>\n );\n\n return (\n <ListItemWrapper>\n <TextItem />\n </ListItemWrapper>\n );\n};\n"],"names":[],"mappings":";;;;;;AAuBA,MAAM,YAAY,UAAW,C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A;AAAA,YACN,OAAQ,EAAA,OAAA;AAAA,WAAA;AAAA,UAEP,CAAA,SAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAW,OAAO,IACjB,oBAAA,KAAA,CAAA,aAAA;AAAA,YAAC,2BAAA;AAAA,YAAA;AAAA,cACC,IAAA,EAAM,UAAU,MAAO,CAAA,IAAA;AAAA,cACvB,QAAQ,SAAU,CAAA,MAAA;AAAA,cAClB,SAAS,SAAU,CAAA,OAAA;AAAA,aAAA;AAAA,cAGrB,MAAO,CAAA,IAAA;AAAA,SAEX;AAAA,OAAA;AAAA,KAEJ,CAAA;AAAA,GAEJ,CAAA;AAEA,EAAM,MAAA,eAAA,GAAkB,CAAC,EAAE,QAAS,EAAA,KAClC,UACE,mBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EACG,IACC,oBAAA,KAAA,CAAA,aAAA,CAAC,YACE,EAAA,IAAA,EAAA,OAAO,IAAS,KAAA,UAAA,GAAa,IAAK,CAAA,MAAM,CAAI,GAAA,IAC/C,CAEF,kBAAA,KAAA,CAAA,aAAA,CAAC,KAAI,EAAA,EAAA,SAAA,EAAW,OAAQ,CAAA,aAAA,EAAA,EAAgB,QAAS,CACnD,CAEA,mBAAA,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,EAAG,QAAS,CAAA,CAAA;AAGhB,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,IAAS,CACZ,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -6,10 +6,10 @@ 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 {
|
|
10
|
-
import { makeStyles,
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
9
|
+
import { LogViewer, ErrorPage, useSidebarPinState, Content, HeaderLabel, Header, Page, ItemCardGrid, ItemCardHeader, LinkButton, WarningPanel, CodeSnippet, Progress, Link, ContentHeader, SubvalueCell, Table, EmptyState, PageWithHeader, SupportButton, MissingAnnotationEmptyState } from '@backstage/core-components';
|
|
10
|
+
import { makeStyles, 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';
|
|
11
|
+
import { SearchContextProvider, useSearch, SearchAutocomplete, createSearchResultListItemExtension } from '@backstage/plugin-search-react';
|
|
12
|
+
import { TechDocsSearchResultListItem as TechDocsSearchResultListItem$1 } from './TechDocsSearchResultListItem-4736f829.esm.js';
|
|
13
13
|
import { Alert, Skeleton } from '@material-ui/lab';
|
|
14
14
|
import Close from '@material-ui/icons/Close';
|
|
15
15
|
import { scmIntegrationsApiRef } from '@backstage/integration-react';
|
|
@@ -368,94 +368,6 @@ const TechDocsReaderProvider = (props) => {
|
|
|
368
368
|
};
|
|
369
369
|
const withTechDocsReaderProvider = (Component) => (props) => /* @__PURE__ */ React.createElement(TechDocsReaderProvider, null, /* @__PURE__ */ React.createElement(Component, { ...props }));
|
|
370
370
|
|
|
371
|
-
const useStyles$3 = makeStyles({
|
|
372
|
-
flexContainer: {
|
|
373
|
-
flexWrap: "wrap"
|
|
374
|
-
},
|
|
375
|
-
itemText: {
|
|
376
|
-
width: "100%",
|
|
377
|
-
marginBottom: "1rem"
|
|
378
|
-
}
|
|
379
|
-
});
|
|
380
|
-
const TechDocsSearchResultListItem$1 = (props) => {
|
|
381
|
-
const {
|
|
382
|
-
result,
|
|
383
|
-
highlight,
|
|
384
|
-
lineClamp = 5,
|
|
385
|
-
asListItem = true,
|
|
386
|
-
asLink = true,
|
|
387
|
-
title,
|
|
388
|
-
icon
|
|
389
|
-
} = props;
|
|
390
|
-
const classes = useStyles$3();
|
|
391
|
-
const LinkWrapper = ({ children }) => asLink ? /* @__PURE__ */ React.createElement(Link, { noTrack: true, to: result.location }, children) : /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
392
|
-
const TextItem = () => {
|
|
393
|
-
const resultTitle = (highlight == null ? void 0 : highlight.fields.title) ? /* @__PURE__ */ React.createElement(
|
|
394
|
-
HighlightedSearchResultText,
|
|
395
|
-
{
|
|
396
|
-
text: highlight.fields.title,
|
|
397
|
-
preTag: highlight.preTag,
|
|
398
|
-
postTag: highlight.postTag
|
|
399
|
-
}
|
|
400
|
-
) : result.title;
|
|
401
|
-
const entityTitle = (highlight == null ? void 0 : highlight.fields.entityTitle) ? /* @__PURE__ */ React.createElement(
|
|
402
|
-
HighlightedSearchResultText,
|
|
403
|
-
{
|
|
404
|
-
text: highlight.fields.entityTitle,
|
|
405
|
-
preTag: highlight.preTag,
|
|
406
|
-
postTag: highlight.postTag
|
|
407
|
-
}
|
|
408
|
-
) : result.entityTitle;
|
|
409
|
-
const resultName = (highlight == null ? void 0 : highlight.fields.name) ? /* @__PURE__ */ React.createElement(
|
|
410
|
-
HighlightedSearchResultText,
|
|
411
|
-
{
|
|
412
|
-
text: highlight.fields.name,
|
|
413
|
-
preTag: highlight.preTag,
|
|
414
|
-
postTag: highlight.postTag
|
|
415
|
-
}
|
|
416
|
-
) : result.name;
|
|
417
|
-
if (!result)
|
|
418
|
-
return null;
|
|
419
|
-
return /* @__PURE__ */ React.createElement(
|
|
420
|
-
ListItemText,
|
|
421
|
-
{
|
|
422
|
-
className: classes.itemText,
|
|
423
|
-
primaryTypographyProps: { variant: "h6" },
|
|
424
|
-
primary: /* @__PURE__ */ React.createElement(LinkWrapper, null, title ? title : /* @__PURE__ */ React.createElement(React.Fragment, null, resultTitle, " | ", entityTitle != null ? entityTitle : resultName, " docs")),
|
|
425
|
-
secondary: /* @__PURE__ */ React.createElement(
|
|
426
|
-
Typography,
|
|
427
|
-
{
|
|
428
|
-
component: "span",
|
|
429
|
-
style: {
|
|
430
|
-
display: "-webkit-box",
|
|
431
|
-
WebkitBoxOrient: "vertical",
|
|
432
|
-
WebkitLineClamp: lineClamp,
|
|
433
|
-
overflow: "hidden"
|
|
434
|
-
},
|
|
435
|
-
color: "textSecondary",
|
|
436
|
-
variant: "body2"
|
|
437
|
-
},
|
|
438
|
-
(highlight == null ? void 0 : highlight.fields.text) ? /* @__PURE__ */ React.createElement(
|
|
439
|
-
HighlightedSearchResultText,
|
|
440
|
-
{
|
|
441
|
-
text: highlight.fields.text,
|
|
442
|
-
preTag: highlight.preTag,
|
|
443
|
-
postTag: highlight.postTag
|
|
444
|
-
}
|
|
445
|
-
) : result.text
|
|
446
|
-
)
|
|
447
|
-
}
|
|
448
|
-
);
|
|
449
|
-
};
|
|
450
|
-
const ListItemWrapper = ({ children }) => asListItem ? /* @__PURE__ */ React.createElement(React.Fragment, null, icon && /* @__PURE__ */ React.createElement(ListItemIcon, null, typeof icon === "function" ? icon(result) : icon), /* @__PURE__ */ React.createElement("div", { className: classes.flexContainer }, children)) : /* @__PURE__ */ React.createElement(React.Fragment, null, children);
|
|
451
|
-
return /* @__PURE__ */ React.createElement(ListItemWrapper, null, /* @__PURE__ */ React.createElement(TextItem, null));
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
var TechDocsSearchResultListItem$2 = /*#__PURE__*/Object.freeze({
|
|
455
|
-
__proto__: null,
|
|
456
|
-
TechDocsSearchResultListItem: TechDocsSearchResultListItem$1
|
|
457
|
-
});
|
|
458
|
-
|
|
459
371
|
const isTechDocsSearchResult = (option) => {
|
|
460
372
|
return option == null ? void 0 : option.document;
|
|
461
373
|
};
|
|
@@ -590,7 +502,7 @@ const TechDocsBuildLogsDrawerContent = ({
|
|
|
590
502
|
spacing: 0,
|
|
591
503
|
wrap: "nowrap"
|
|
592
504
|
},
|
|
593
|
-
/* @__PURE__ */ React.createElement(Typography
|
|
505
|
+
/* @__PURE__ */ React.createElement(Typography, { variant: "h5" }, "Build Details"),
|
|
594
506
|
/* @__PURE__ */ React.createElement(
|
|
595
507
|
IconButton,
|
|
596
508
|
{
|
|
@@ -2237,7 +2149,7 @@ const EntityListDocsGrid = (props) => {
|
|
|
2237
2149
|
return /* @__PURE__ */ React.createElement(Progress, null);
|
|
2238
2150
|
}
|
|
2239
2151
|
if (entities.length === 0) {
|
|
2240
|
-
return /* @__PURE__ */ React.createElement("div", { "data-testid": "doc-not-found" }, /* @__PURE__ */ React.createElement(Typography
|
|
2152
|
+
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"), "."));
|
|
2241
2153
|
}
|
|
2242
2154
|
entities.sort(
|
|
2243
2155
|
(a, b) => {
|
|
@@ -2317,6 +2229,12 @@ const columnFactories = {
|
|
|
2317
2229
|
)
|
|
2318
2230
|
};
|
|
2319
2231
|
},
|
|
2232
|
+
createKindColumn() {
|
|
2233
|
+
return {
|
|
2234
|
+
title: "Kind",
|
|
2235
|
+
field: "entity.kind"
|
|
2236
|
+
};
|
|
2237
|
+
},
|
|
2320
2238
|
createTypeColumn() {
|
|
2321
2239
|
return {
|
|
2322
2240
|
title: "Type",
|
|
@@ -2354,18 +2272,21 @@ const DocsTable = (props) => {
|
|
|
2354
2272
|
const defaultColumns = [
|
|
2355
2273
|
columnFactories.createNameColumn(),
|
|
2356
2274
|
columnFactories.createOwnerColumn(),
|
|
2275
|
+
columnFactories.createKindColumn(),
|
|
2357
2276
|
columnFactories.createTypeColumn()
|
|
2358
2277
|
];
|
|
2359
2278
|
const defaultActions = [
|
|
2360
2279
|
actionFactories.createCopyDocsUrlAction(copyToClipboard)
|
|
2361
2280
|
];
|
|
2281
|
+
const pageSize = 20;
|
|
2282
|
+
const paging = documents && documents.length > pageSize;
|
|
2362
2283
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, loading || documents && documents.length > 0 ? /* @__PURE__ */ React.createElement(
|
|
2363
2284
|
Table,
|
|
2364
2285
|
{
|
|
2365
2286
|
isLoading: loading,
|
|
2366
2287
|
options: {
|
|
2367
|
-
paging
|
|
2368
|
-
pageSize
|
|
2288
|
+
paging,
|
|
2289
|
+
pageSize,
|
|
2369
2290
|
search: true,
|
|
2370
2291
|
actionsColumnIndex: -1,
|
|
2371
2292
|
...options
|
|
@@ -2528,7 +2449,7 @@ const EntityTechdocsContent = techdocsPlugin.provide(
|
|
|
2528
2449
|
const TechDocsCustomHome = techdocsPlugin.provide(
|
|
2529
2450
|
createRoutableExtension({
|
|
2530
2451
|
name: "TechDocsCustomHome",
|
|
2531
|
-
component: () => import('./TechDocsCustomHome-
|
|
2452
|
+
component: () => import('./TechDocsCustomHome-453580db.esm.js').then(
|
|
2532
2453
|
(m) => m.TechDocsCustomHome
|
|
2533
2454
|
),
|
|
2534
2455
|
mountPoint: rootRouteRef
|
|
@@ -2546,7 +2467,7 @@ const TechDocsIndexPage$2 = techdocsPlugin.provide(
|
|
|
2546
2467
|
const TechDocsReaderPage = techdocsPlugin.provide(
|
|
2547
2468
|
createRoutableExtension({
|
|
2548
2469
|
name: "TechDocsReaderPage",
|
|
2549
|
-
component: () => import('./index-
|
|
2470
|
+
component: () => import('./index-715820dc.esm.js').then(
|
|
2550
2471
|
(m) => m.TechDocsReaderPage
|
|
2551
2472
|
),
|
|
2552
2473
|
mountPoint: rootDocsRouteRef
|
|
@@ -2555,7 +2476,7 @@ const TechDocsReaderPage = techdocsPlugin.provide(
|
|
|
2555
2476
|
const TechDocsSearchResultListItem = techdocsPlugin.provide(
|
|
2556
2477
|
createSearchResultListItemExtension({
|
|
2557
2478
|
name: "TechDocsSearchResultListItem",
|
|
2558
|
-
component: () =>
|
|
2479
|
+
component: () => import('./TechDocsSearchResultListItem-4736f829.esm.js').then(
|
|
2559
2480
|
(m) => m.TechDocsSearchResultListItem
|
|
2560
2481
|
),
|
|
2561
2482
|
predicate: (result) => result.type === "techdocs"
|
|
@@ -2633,4 +2554,4 @@ var Router$1 = /*#__PURE__*/Object.freeze({
|
|
|
2633
2554
|
});
|
|
2634
2555
|
|
|
2635
2556
|
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 };
|
|
2636
|
-
//# sourceMappingURL=index-
|
|
2557
|
+
//# sourceMappingURL=index-683d6465.esm.js.map
|