@backstage/plugin-techdocs 1.11.1-next.1 → 1.11.1-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/dist/EntityPageDocs.esm.js.map +1 -1
- package/dist/Router.esm.js.map +1 -1
- package/dist/alpha.esm.js.map +1 -1
- package/dist/api.esm.js.map +1 -1
- package/dist/client.esm.js.map +1 -1
- package/dist/helpers.esm.js.map +1 -1
- package/dist/home/components/DefaultTechDocsHome.esm.js.map +1 -1
- package/dist/home/components/Grids/DocsCardGrid.esm.js.map +1 -1
- package/dist/home/components/Grids/EntityListDocsGrid.esm.js.map +1 -1
- package/dist/home/components/Tables/DocsTable.esm.js.map +1 -1
- package/dist/home/components/Tables/EntityListDocsTable.esm.js.map +1 -1
- package/dist/home/components/Tables/actions.esm.js.map +1 -1
- package/dist/home/components/Tables/columns.esm.js.map +1 -1
- package/dist/home/components/TechDocsCustomHome.esm.js.map +1 -1
- package/dist/home/components/TechDocsIndexPage.esm.js.map +1 -1
- package/dist/home/components/TechDocsPageWrapper.esm.js.map +1 -1
- package/dist/home/components/TechDocsPicker.esm.js.map +1 -1
- package/dist/plugin.esm.js.map +1 -1
- package/dist/reader/components/TechDocsBuildLogs.esm.js.map +1 -1
- package/dist/reader/components/TechDocsNotFound.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPage/TechDocsReaderPage.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContentAddons.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPageContent/dom.esm.js +4 -2
- package/dist/reader/components/TechDocsReaderPageContent/dom.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPageContent/useNavigateUrl.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPageHeader/TechDocsReaderPageHeader.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderProvider.esm.js.map +1 -1
- package/dist/reader/components/TechDocsRedirectNotification/TechDocsRedirectNotification.esm.js.map +1 -1
- package/dist/reader/components/TechDocsStateIndicator.esm.js.map +1 -1
- package/dist/reader/components/useReaderState.esm.js.map +1 -1
- package/dist/reader/transformers/addBaseUrl.esm.js.map +1 -1
- package/dist/reader/transformers/addGitFeedbackLink.esm.js.map +1 -1
- package/dist/reader/transformers/addLinkClickListener.esm.js.map +1 -1
- package/dist/reader/transformers/addSidebarToggle.esm.js.map +1 -1
- package/dist/reader/transformers/copyToClipboard.esm.js.map +1 -1
- package/dist/reader/transformers/handleMetaRedirects.esm.js.map +1 -1
- package/dist/reader/transformers/html/hooks/iframes.esm.js.map +1 -1
- package/dist/reader/transformers/html/hooks/links.esm.js.map +1 -1
- package/dist/reader/transformers/html/transformer.esm.js.map +1 -1
- package/dist/reader/transformers/onCssReady.esm.js.map +1 -1
- package/dist/reader/transformers/removeMkdocsHeader.esm.js.map +1 -1
- package/dist/reader/transformers/renderReactElement.esm.js.map +1 -1
- package/dist/reader/transformers/rewriteDocLinks.esm.js.map +1 -1
- package/dist/reader/transformers/scrollIntoNavigation.esm.js.map +1 -1
- package/dist/reader/transformers/simplifyMkdocsFooter.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/animations.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/extensions.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/layout.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/palette.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/reset.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/rules.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/typeset.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/variables.esm.js.map +1 -1
- package/dist/reader/transformers/styles/transformer.esm.js.map +1 -1
- package/dist/reader/transformers/transformer.esm.js.map +1 -1
- package/dist/routes.esm.js.map +1 -1
- package/dist/search/components/TechDocsSearch.esm.js.map +1 -1
- package/dist/search/components/TechDocsSearchResultListItem.esm.js.map +1 -1
- package/package.json +22 -13
- package/alpha/package.json +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformer.esm.js","sources":["../../../src/reader/transformers/transformer.ts"],"sourcesContent":["/*\n * Copyright 2020 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\nexport type Transformer = (dom: Element) => Element | Promise<Element>;\n\nexport const transform = async (\n html: string | Element,\n transformers: Transformer[],\n): Promise<Element> => {\n let dom: Element;\n\n if (typeof html === 'string') {\n dom = new DOMParser().parseFromString(html, 'text/html').documentElement;\n } else if (html instanceof Element) {\n dom = html;\n } else {\n throw new Error('dom is not a recognized type');\n }\n\n for (const transformer of transformers) {\n dom = await transformer(dom);\n }\n\n return dom;\n};\n"],"names":[],"mappings":"AAkBa,MAAA,SAAA,GAAY,OACvB,IAAA,EACA,YACqB,KAAA;AACrB,EAAI,IAAA,GAAA
|
|
1
|
+
{"version":3,"file":"transformer.esm.js","sources":["../../../src/reader/transformers/transformer.ts"],"sourcesContent":["/*\n * Copyright 2020 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\nexport type Transformer = (dom: Element) => Element | Promise<Element>;\n\nexport const transform = async (\n html: string | Element,\n transformers: Transformer[],\n): Promise<Element> => {\n let dom: Element;\n\n if (typeof html === 'string') {\n dom = new DOMParser().parseFromString(html, 'text/html').documentElement;\n } else if (html instanceof Element) {\n dom = html;\n } else {\n throw new Error('dom is not a recognized type');\n }\n\n for (const transformer of transformers) {\n dom = await transformer(dom);\n }\n\n return dom;\n};\n"],"names":[],"mappings":"AAkBa,MAAA,SAAA,GAAY,OACvB,IAAA,EACA,YACqB,KAAA;AACrB,EAAI,IAAA,GAAA;AAEJ,EAAI,IAAA,OAAO,SAAS,QAAU,EAAA;AAC5B,IAAA,GAAA,GAAM,IAAI,SAAU,EAAA,CAAE,eAAgB,CAAA,IAAA,EAAM,WAAW,CAAE,CAAA,eAAA;AAAA,GAC3D,MAAA,IAAW,gBAAgB,OAAS,EAAA;AAClC,IAAM,GAAA,GAAA,IAAA;AAAA,GACD,MAAA;AACL,IAAM,MAAA,IAAI,MAAM,8BAA8B,CAAA;AAAA;AAGhD,EAAA,KAAA,MAAW,eAAe,YAAc,EAAA;AACtC,IAAM,GAAA,GAAA,MAAM,YAAY,GAAG,CAAA;AAAA;AAG7B,EAAO,OAAA,GAAA;AACT;;;;"}
|
package/dist/routes.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'techdocs:index-page',\n});\n\nexport const rootDocsRouteRef = createRouteRef({\n id: 'techdocs:reader-page',\n params: ['namespace', 'kind', 'name'],\n});\n\nexport const rootCatalogDocsRouteRef = createRouteRef({\n id: 'techdocs:catalog-reader-view',\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA
|
|
1
|
+
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { createRouteRef } from '@backstage/core-plugin-api';\n\nexport const rootRouteRef = createRouteRef({\n id: 'techdocs:index-page',\n});\n\nexport const rootDocsRouteRef = createRouteRef({\n id: 'techdocs:reader-page',\n params: ['namespace', 'kind', 'name'],\n});\n\nexport const rootCatalogDocsRouteRef = createRouteRef({\n id: 'techdocs:catalog-reader-view',\n});\n"],"names":[],"mappings":";;AAkBO,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA;AACN,CAAC;AAEM,MAAM,mBAAmB,cAAe,CAAA;AAAA,EAC7C,EAAI,EAAA,sBAAA;AAAA,EACJ,MAAQ,EAAA,CAAC,WAAa,EAAA,MAAA,EAAQ,MAAM;AACtC,CAAC;AAEM,MAAM,0BAA0B,cAAe,CAAA;AAAA,EACpD,EAAI,EAAA;AACN,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TechDocsSearch.esm.js","sources":["../../../src/search/components/TechDocsSearch.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 { CompoundEntityRef } from '@backstage/catalog-model';\nimport { ResultHighlight } from '@backstage/plugin-search-common';\nimport {\n SearchAutocomplete,\n SearchContextProvider,\n useSearch,\n} from '@backstage/plugin-search-react';\nimport React, { useEffect, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { TechDocsSearchResultListItem } from './TechDocsSearchResultListItem';\n\n/**\n * Props for {@link TechDocsSearch}\n *\n * @public\n */\nexport type TechDocsSearchProps = {\n entityId: CompoundEntityRef;\n entityTitle?: string;\n debounceTime?: number;\n};\n\ntype TechDocsDoc = {\n namespace: string;\n kind: string;\n name: string;\n path: string;\n location: string;\n title: string;\n};\n\ntype TechDocsSearchResult = {\n type: string;\n document: TechDocsDoc;\n highlight?: ResultHighlight;\n};\n\nconst isTechDocsSearchResult = (\n option: any,\n): option is TechDocsSearchResult => {\n return option?.document;\n};\n\nconst TechDocsSearchBar = (props: TechDocsSearchProps) => {\n const { entityId, entityTitle, debounceTime = 150 } = props;\n const [open, setOpen] = useState(false);\n const navigate = useNavigate();\n const {\n setFilters,\n term,\n result: { loading, value: searchVal },\n } = useSearch();\n const [options, setOptions] = useState<any[]>([]);\n useEffect(() => {\n let mounted = true;\n\n if (mounted && searchVal) {\n // TODO: Change this into getting only subset of search results from the BE in the first place\n // once pagination is implemented for search engines\n // See: https://github.com/backstage/backstage/issues/6062\n const searchResults = searchVal.results.slice(0, 10);\n setOptions(searchResults);\n }\n return () => {\n mounted = false;\n };\n }, [loading, searchVal]);\n\n // Update the filter context when the entityId changes, e.g. when the search\n // bar continues to be rendered, navigating between different TechDocs sites.\n const { kind, name, namespace } = entityId;\n useEffect(() => {\n setFilters(prevFilters => {\n return {\n ...prevFilters,\n kind,\n namespace,\n name,\n };\n });\n }, [kind, namespace, name, setFilters]);\n\n const handleSelection = (\n _: any,\n selection: TechDocsSearchResult | string | null,\n ) => {\n if (isTechDocsSearchResult(selection)) {\n const { location } = selection.document;\n navigate(location);\n }\n };\n\n return (\n <SearchAutocomplete\n data-testid=\"techdocs-search-bar\"\n size=\"small\"\n open={open && Boolean(term)}\n getOptionLabel={() => ''}\n filterOptions={x => {\n return x; // This is needed to get renderOption to be called after options change. Bug in material-ui?\n }}\n onClose={() => {\n setOpen(false);\n }}\n onOpen={() => {\n setOpen(true);\n }}\n onChange={handleSelection}\n blurOnSelect\n noOptionsText=\"No results found\"\n value={null}\n options={options}\n renderOption={({ document, highlight }) => (\n <TechDocsSearchResultListItem\n result={document}\n lineClamp={3}\n asListItem={false}\n asLink={false}\n title={document.title}\n highlight={highlight}\n />\n )}\n loading={loading}\n inputDebounceTime={debounceTime}\n inputPlaceholder={`Search ${entityTitle || entityId.name} docs`}\n freeSolo={false}\n />\n );\n};\n\n/**\n * Component used to render search bar on TechDocs page, scoped to\n *\n * @public\n */\nexport const TechDocsSearch = (props: TechDocsSearchProps) => {\n const initialState = {\n term: '',\n types: ['techdocs'],\n pageCursor: '',\n filters: props.entityId,\n };\n return (\n <SearchContextProvider initialState={initialState}>\n <TechDocsSearchBar {...props} />\n </SearchContextProvider>\n );\n};\n"],"names":[],"mappings":";;;;;AAqDA,MAAM,sBAAA,GAAyB,CAC7B,MACmC,KAAA;AACnC,EAAA,OAAO,MAAQ,EAAA,QAAA
|
|
1
|
+
{"version":3,"file":"TechDocsSearch.esm.js","sources":["../../../src/search/components/TechDocsSearch.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 { CompoundEntityRef } from '@backstage/catalog-model';\nimport { ResultHighlight } from '@backstage/plugin-search-common';\nimport {\n SearchAutocomplete,\n SearchContextProvider,\n useSearch,\n} from '@backstage/plugin-search-react';\nimport React, { useEffect, useState } from 'react';\nimport { useNavigate } from 'react-router-dom';\nimport { TechDocsSearchResultListItem } from './TechDocsSearchResultListItem';\n\n/**\n * Props for {@link TechDocsSearch}\n *\n * @public\n */\nexport type TechDocsSearchProps = {\n entityId: CompoundEntityRef;\n entityTitle?: string;\n debounceTime?: number;\n};\n\ntype TechDocsDoc = {\n namespace: string;\n kind: string;\n name: string;\n path: string;\n location: string;\n title: string;\n};\n\ntype TechDocsSearchResult = {\n type: string;\n document: TechDocsDoc;\n highlight?: ResultHighlight;\n};\n\nconst isTechDocsSearchResult = (\n option: any,\n): option is TechDocsSearchResult => {\n return option?.document;\n};\n\nconst TechDocsSearchBar = (props: TechDocsSearchProps) => {\n const { entityId, entityTitle, debounceTime = 150 } = props;\n const [open, setOpen] = useState(false);\n const navigate = useNavigate();\n const {\n setFilters,\n term,\n result: { loading, value: searchVal },\n } = useSearch();\n const [options, setOptions] = useState<any[]>([]);\n useEffect(() => {\n let mounted = true;\n\n if (mounted && searchVal) {\n // TODO: Change this into getting only subset of search results from the BE in the first place\n // once pagination is implemented for search engines\n // See: https://github.com/backstage/backstage/issues/6062\n const searchResults = searchVal.results.slice(0, 10);\n setOptions(searchResults);\n }\n return () => {\n mounted = false;\n };\n }, [loading, searchVal]);\n\n // Update the filter context when the entityId changes, e.g. when the search\n // bar continues to be rendered, navigating between different TechDocs sites.\n const { kind, name, namespace } = entityId;\n useEffect(() => {\n setFilters(prevFilters => {\n return {\n ...prevFilters,\n kind,\n namespace,\n name,\n };\n });\n }, [kind, namespace, name, setFilters]);\n\n const handleSelection = (\n _: any,\n selection: TechDocsSearchResult | string | null,\n ) => {\n if (isTechDocsSearchResult(selection)) {\n const { location } = selection.document;\n navigate(location);\n }\n };\n\n return (\n <SearchAutocomplete\n data-testid=\"techdocs-search-bar\"\n size=\"small\"\n open={open && Boolean(term)}\n getOptionLabel={() => ''}\n filterOptions={x => {\n return x; // This is needed to get renderOption to be called after options change. Bug in material-ui?\n }}\n onClose={() => {\n setOpen(false);\n }}\n onOpen={() => {\n setOpen(true);\n }}\n onChange={handleSelection}\n blurOnSelect\n noOptionsText=\"No results found\"\n value={null}\n options={options}\n renderOption={({ document, highlight }) => (\n <TechDocsSearchResultListItem\n result={document}\n lineClamp={3}\n asListItem={false}\n asLink={false}\n title={document.title}\n highlight={highlight}\n />\n )}\n loading={loading}\n inputDebounceTime={debounceTime}\n inputPlaceholder={`Search ${entityTitle || entityId.name} docs`}\n freeSolo={false}\n />\n );\n};\n\n/**\n * Component used to render search bar on TechDocs page, scoped to\n *\n * @public\n */\nexport const TechDocsSearch = (props: TechDocsSearchProps) => {\n const initialState = {\n term: '',\n types: ['techdocs'],\n pageCursor: '',\n filters: props.entityId,\n };\n return (\n <SearchContextProvider initialState={initialState}>\n <TechDocsSearchBar {...props} />\n </SearchContextProvider>\n );\n};\n"],"names":[],"mappings":";;;;;AAqDA,MAAM,sBAAA,GAAyB,CAC7B,MACmC,KAAA;AACnC,EAAA,OAAO,MAAQ,EAAA,QAAA;AACjB,CAAA;AAEA,MAAM,iBAAA,GAAoB,CAAC,KAA+B,KAAA;AACxD,EAAA,MAAM,EAAE,QAAA,EAAU,WAAa,EAAA,YAAA,GAAe,KAAQ,GAAA,KAAA;AACtD,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MAAM,WAAW,WAAY,EAAA;AAC7B,EAAM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GAAG,OAAO,CAChC,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TechDocsSearchResultListItem.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 from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\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":";;;;;;;;AAyBA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,aAAe,EAAA;AAAA,IACb,QAAU,EAAA
|
|
1
|
+
{"version":3,"file":"TechDocsSearchResultListItem.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 from '@material-ui/core/ListItemIcon';\nimport ListItemText from '@material-ui/core/ListItemText';\nimport { makeStyles } from '@material-ui/core/styles';\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":";;;;;;;;AAyBA,MAAM,YAAY,UAAW,CAAA;AAAA,EAC3B,aAAe,EAAA;AAAA,IACb,QAAU,EAAA;AAAA,GACZ;AAAA,EACA,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,MAAA;AAAA,IACP,YAAc,EAAA;AAAA;AAElB,CAAC,CAAA;AAuBY,MAAA,4BAAA,GAA+B,CAC1C,KACG,KAAA;AACH,EAAM,MAA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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;AAGhB,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA,IAAS,CACZ,CAAA;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-techdocs",
|
|
3
|
-
"version": "1.11.1-next.
|
|
3
|
+
"version": "1.11.1-next.3",
|
|
4
4
|
"description": "The Backstage plugin that renders technical documentation for your components",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -44,10 +44,19 @@
|
|
|
44
44
|
},
|
|
45
45
|
"main": "./dist/index.esm.js",
|
|
46
46
|
"types": "./dist/index.d.ts",
|
|
47
|
+
"typesVersions": {
|
|
48
|
+
"*": {
|
|
49
|
+
"index": [
|
|
50
|
+
"dist/index.d.ts"
|
|
51
|
+
],
|
|
52
|
+
"alpha": [
|
|
53
|
+
"dist/alpha.d.ts"
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
},
|
|
47
57
|
"files": [
|
|
48
58
|
"dist",
|
|
49
|
-
"config.d.ts"
|
|
50
|
-
"alpha"
|
|
59
|
+
"config.d.ts"
|
|
51
60
|
],
|
|
52
61
|
"scripts": {
|
|
53
62
|
"build": "backstage-cli package build",
|
|
@@ -61,19 +70,19 @@
|
|
|
61
70
|
"dependencies": {
|
|
62
71
|
"@backstage/catalog-model": "1.7.0",
|
|
63
72
|
"@backstage/config": "1.2.0",
|
|
64
|
-
"@backstage/core-compat-api": "0.3.2-next.
|
|
65
|
-
"@backstage/core-components": "0.16.0-next.
|
|
73
|
+
"@backstage/core-compat-api": "0.3.2-next.2",
|
|
74
|
+
"@backstage/core-components": "0.16.0-next.2",
|
|
66
75
|
"@backstage/core-plugin-api": "1.10.0",
|
|
67
76
|
"@backstage/errors": "1.2.4",
|
|
68
|
-
"@backstage/frontend-plugin-api": "0.9.1-next.
|
|
77
|
+
"@backstage/frontend-plugin-api": "0.9.1-next.2",
|
|
69
78
|
"@backstage/integration": "1.15.1",
|
|
70
79
|
"@backstage/integration-react": "1.2.0",
|
|
71
|
-
"@backstage/plugin-auth-react": "0.1.8-next.
|
|
72
|
-
"@backstage/plugin-catalog-react": "1.14.1-next.
|
|
80
|
+
"@backstage/plugin-auth-react": "0.1.8-next.2",
|
|
81
|
+
"@backstage/plugin-catalog-react": "1.14.1-next.3",
|
|
73
82
|
"@backstage/plugin-search-common": "1.2.14",
|
|
74
|
-
"@backstage/plugin-search-react": "1.8.2-next.
|
|
83
|
+
"@backstage/plugin-search-react": "1.8.2-next.2",
|
|
75
84
|
"@backstage/plugin-techdocs-common": "0.1.0",
|
|
76
|
-
"@backstage/plugin-techdocs-react": "1.2.10-next.
|
|
85
|
+
"@backstage/plugin-techdocs-react": "1.2.10-next.2",
|
|
77
86
|
"@backstage/theme": "0.6.1-next.0",
|
|
78
87
|
"@material-ui/core": "^4.12.2",
|
|
79
88
|
"@material-ui/icons": "^4.9.1",
|
|
@@ -88,10 +97,10 @@
|
|
|
88
97
|
"react-use": "^17.2.4"
|
|
89
98
|
},
|
|
90
99
|
"devDependencies": {
|
|
91
|
-
"@backstage/cli": "0.29.0-next.
|
|
100
|
+
"@backstage/cli": "0.29.0-next.3",
|
|
92
101
|
"@backstage/core-app-api": "1.15.1",
|
|
93
|
-
"@backstage/dev-utils": "1.1.3-next.
|
|
94
|
-
"@backstage/plugin-techdocs-module-addons-contrib": "1.1.17-next.
|
|
102
|
+
"@backstage/dev-utils": "1.1.3-next.3",
|
|
103
|
+
"@backstage/plugin-techdocs-module-addons-contrib": "1.1.17-next.2",
|
|
95
104
|
"@backstage/test-utils": "1.7.1-next.0",
|
|
96
105
|
"@testing-library/dom": "^10.0.0",
|
|
97
106
|
"@testing-library/jest-dom": "^6.0.0",
|