@backstage/plugin-techdocs 1.19.0-next.2 → 1.19.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 CHANGED
@@ -1,5 +1,55 @@
1
1
  # @backstage/plugin-techdocs
2
2
 
3
+ ## 1.19.1-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 9a1d5cf: Fixed the TechDocs table of contents drifting to the right on wide screens. It now stays aligned with the right edge of the documentation content.
8
+ - Updated dependencies
9
+ - @backstage/frontend-plugin-api@0.18.3-next.0
10
+ - @backstage/core-plugin-api@1.12.12-next.0
11
+ - @backstage/plugin-catalog-react@4.0.0-next.0
12
+ - @backstage/plugin-search-react@1.11.10-next.0
13
+ - @backstage/plugin-techdocs-react@1.4.1-next.0
14
+ - @backstage/core-components@0.18.16-next.0
15
+ - @backstage/integration-react@1.2.24-next.0
16
+ - @backstage/plugin-auth-react@0.1.33-next.0
17
+
18
+ ## 1.19.0
19
+
20
+ ### Minor Changes
21
+
22
+ - 4a5b52d: TechDocs now uses the default `NotFoundErrorPage` when documentation is missing, instead of its own TechDocs-specific page.
23
+
24
+ This means if you have provided an override to the `NotFoundErrorPage` component it will now be used within TechDocs when documentation is missing as well.
25
+
26
+ One thing to note is that the default not found page shows "PAGE NOT FOUND" rather than "Documentation not found".
27
+
28
+ - 80a0da9: Added `withoutFeedbackLink` prop to `page:techdocs/reader` and `entity-content:techdocs` extensions, which can be set to `true` to disable the feedback button in the rendered documentation.
29
+
30
+ ### Patch Changes
31
+
32
+ - 24fd0e8: Fixed TechDocs addons silently not rendering in apps using the new frontend system, on both the standalone documentation reader page and the entity documentation tab.
33
+ - 6c74f3f: Migrated the `TechDocsPicker` filter from the deprecated `getCatalogFilters` to `getCatalogQuery`.
34
+ - Updated dependencies
35
+ - @backstage/frontend-plugin-api@0.18.2
36
+ - @backstage/integration@2.1.3
37
+ - @backstage/ui@0.19.0
38
+ - @backstage/plugin-techdocs-react@1.4.0
39
+ - @backstage/catalog-client@1.16.3
40
+ - @backstage/plugin-catalog-react@3.3.0
41
+ - @backstage/config@1.3.10
42
+ - @backstage/errors@1.3.2
43
+ - @backstage/filter-predicates@0.2.0
44
+ - @backstage/core-components@0.18.15
45
+ - @backstage/plugin-techdocs-common@0.1.2
46
+ - @backstage/catalog-model@1.10.2
47
+ - @backstage/core-plugin-api@1.12.11
48
+ - @backstage/integration-react@1.2.23
49
+ - @backstage/plugin-auth-react@0.1.32
50
+ - @backstage/plugin-search-common@1.2.26
51
+ - @backstage/plugin-search-react@1.11.9
52
+
3
53
  ## 1.19.0-next.2
4
54
 
5
55
  ### Patch Changes
package/dist/alpha.d.ts CHANGED
@@ -141,7 +141,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
141
141
  withoutFeedbackLink: boolean;
142
142
  path: string | undefined;
143
143
  title: string | undefined;
144
- filter: _backstage_filter_predicates.FilterPredicate | undefined;
144
+ filter: string | _backstage_filter_predicates.FilterPredicate | undefined;
145
145
  group: string | false | undefined;
146
146
  icon: string | undefined;
147
147
  };
@@ -149,7 +149,7 @@ declare const _default: _backstage_frontend_plugin_api.OverridableFrontendPlugin
149
149
  withoutFeedbackLink?: boolean | undefined;
150
150
  path?: string | undefined;
151
151
  title?: string | undefined;
152
- filter?: _backstage_filter_predicates.FilterPredicate | undefined;
152
+ filter?: string | _backstage_filter_predicates.FilterPredicate | undefined;
153
153
  group?: string | false | undefined;
154
154
  icon?: string | undefined;
155
155
  };
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-techdocs";
2
- var version = "1.19.0-next.2";
2
+ var version = "1.19.1-next.0";
3
3
  var description = "The Backstage plugin that renders technical documentation for your components";
4
4
  var backstage = {
5
5
  role: "frontend-plugin",
@@ -34,6 +34,11 @@ const useInitialRedirect = (defaultPath) => {
34
34
  }
35
35
  }, []);
36
36
  };
37
+ const getSecondarySidebarRightOffset = (container, minOffset) => {
38
+ const viewportWidth = document.documentElement.clientWidth;
39
+ const containerRight = container.getBoundingClientRect().right;
40
+ return Math.max(minOffset, viewportWidth - containerRight);
41
+ };
37
42
  const useTechDocsReaderDom = (entityRef, options) => {
38
43
  const { defaultPath, withFeedbackLink = true } = options ?? {};
39
44
  const navigate = useNavigateUrl();
@@ -70,10 +75,14 @@ const useTechDocsReaderDom = (entityRef, options) => {
70
75
  const footer = dom.querySelector(".md-container > .md-footer");
71
76
  const scrollbarEndPx = footer?.getBoundingClientRect().top ?? window.innerHeight;
72
77
  element.style.height = `${scrollbarEndPx - scrollbarTopPx}px`;
78
+ if (element.classList.contains("md-sidebar--secondary")) {
79
+ const rightPx = getSecondarySidebarRightOffset(dom, theme.spacing(3));
80
+ element.style.right = `${rightPx}px`;
81
+ }
73
82
  }
74
83
  element.style.setProperty("opacity", "1");
75
84
  });
76
- }, [dom, isMobileMedia]);
85
+ }, [dom, isMobileMedia, theme]);
77
86
  useEffect(() => {
78
87
  window.addEventListener("resize", updateSidebarPositionAndHeight);
79
88
  window.addEventListener("scroll", updateSidebarPositionAndHeight, true);
@@ -225,5 +234,5 @@ const useTechDocsReaderDom = (entityRef, options) => {
225
234
  return dom;
226
235
  };
227
236
 
228
- export { useInitialRedirect, useTechDocsReaderDom };
237
+ export { getSecondarySidebarRightOffset, useInitialRedirect, useTechDocsReaderDom };
229
238
  //# sourceMappingURL=dom.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.esm.js","sources":["../../../../src/reader/components/TechDocsReaderPageContent/dom.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {\n useCallback,\n useEffect,\n useLayoutEffect,\n // useRef,\n useState,\n} from 'react';\n\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport { useTheme } from '@material-ui/core/styles';\n\nimport { CompoundEntityRef } from '@backstage/catalog-model';\nimport { configApiRef, useAnalytics, useApi } from '@backstage/core-plugin-api';\nimport { scmIntegrationsApiRef } from '@backstage/integration-react';\n\nimport {\n techdocsStorageApiRef,\n useShadowDomStylesLoading,\n} from '@backstage/plugin-techdocs-react';\n\nimport { useTechDocsReader } from '../TechDocsReaderProvider';\n\nimport {\n addBaseUrl,\n addGitFeedbackLink,\n addLinkClickListener,\n addSidebarToggle,\n onCssReady,\n removeMkdocsHeader,\n rewriteDocLinks,\n simplifyMkdocsFooter,\n scrollIntoNavigation,\n transform as transformer,\n copyToClipboard,\n useSanitizerTransformer,\n useStylesTransformer,\n handleMetaRedirects,\n addNavLinkKeyboardToggle,\n} from '../../transformers';\nimport { useNavigateUrl } from './useNavigateUrl';\nimport { useLocation, useNavigate, useParams } from 'react-router-dom';\n\nconst MOBILE_MEDIA_QUERY = 'screen and (max-width: 76.1875em)';\n\n// If a defaultPath is specified then we should navigate to that path replacing the\n// current location in the history. This should only happen on the initial load so\n// navigating to the root of the docs doesn't also redirect.\nexport const useInitialRedirect = (defaultPath?: string) => {\n const location = useLocation();\n const navigate = useNavigate();\n const { '*': currPath = '' } = useParams();\n\n useLayoutEffect(() => {\n if (currPath === '' && defaultPath) {\n navigate(`${location.pathname}${defaultPath}`, { replace: true });\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n};\n\n/**\n * Hook that encapsulates the behavior of getting raw HTML and applying\n * transforms to it in order to make it function at a basic level in the\n * Backstage UI.\n */\nexport const useTechDocsReaderDom = (\n entityRef: CompoundEntityRef,\n options?: { defaultPath?: string; withFeedbackLink?: boolean },\n): Element | null => {\n const { defaultPath, withFeedbackLink = true } = options ?? {};\n\n const navigate = useNavigateUrl();\n const theme = useTheme();\n const isMobileMedia = useMediaQuery(MOBILE_MEDIA_QUERY);\n const sanitizerTransformer = useSanitizerTransformer();\n const stylesTransformer = useStylesTransformer();\n const analytics = useAnalytics();\n\n const techdocsStorageApi = useApi(techdocsStorageApiRef);\n const scmIntegrationsApi = useApi(scmIntegrationsApiRef);\n const configApi = useApi(configApiRef);\n\n const { state, path, content: rawPage } = useTechDocsReader();\n const { '*': currPath = '' } = useParams();\n\n const [dom, setDom] = useState<HTMLElement | null>(null);\n const isStyleLoading = useShadowDomStylesLoading(dom);\n\n useInitialRedirect(defaultPath);\n\n const updateSidebarPositionAndHeight = useCallback(() => {\n if (!dom) return;\n\n const sidebars = dom.querySelectorAll<HTMLElement>('.md-sidebar');\n\n sidebars.forEach(element => {\n // set sidebar position to render in correct position\n if (isMobileMedia) {\n element.style.top = '0px';\n } else {\n const page = document?.querySelector('.techdocs-reader-page');\n const pageTop = page?.getBoundingClientRect().top ?? 0;\n let domTop = dom.getBoundingClientRect().top ?? 0;\n\n const tabs = dom.querySelector('.md-container > .md-tabs');\n const tabsHeight = tabs?.getBoundingClientRect().height ?? 0;\n\n // the sidebars should not scroll beyond the total height of the header and tabs\n if (domTop < pageTop) {\n domTop = pageTop;\n }\n\n const scrollbarTopPx = Math.max(domTop, 0) + tabsHeight;\n\n element.style.top = `${scrollbarTopPx}px`;\n\n // set scrollbar height to ensure all links can be seen when content is small\n const footer = dom.querySelector('.md-container > .md-footer');\n // if no footer, fallback to using the bottom of the window\n const scrollbarEndPx =\n footer?.getBoundingClientRect().top ?? window.innerHeight;\n\n element.style.height = `${scrollbarEndPx - scrollbarTopPx}px`;\n }\n\n // show the sidebar only after updating its position\n element.style.setProperty('opacity', '1');\n });\n }, [dom, isMobileMedia]);\n\n useEffect(() => {\n window.addEventListener('resize', updateSidebarPositionAndHeight);\n window.addEventListener('scroll', updateSidebarPositionAndHeight, true);\n return () => {\n window.removeEventListener('resize', updateSidebarPositionAndHeight);\n window.removeEventListener(\n 'scroll',\n updateSidebarPositionAndHeight,\n true,\n );\n };\n }, [dom, updateSidebarPositionAndHeight]);\n\n // dynamically set width of footer to accommodate for pinning of the sidebar\n const updateFooterWidth = useCallback(() => {\n if (!dom) return;\n const footer = dom.querySelector<HTMLElement>('.md-footer');\n if (footer) {\n footer.style.width = `${dom.getBoundingClientRect().width}px`;\n }\n }, [dom]);\n\n useEffect(() => {\n window.addEventListener('resize', updateFooterWidth);\n return () => {\n window.removeEventListener('resize', updateFooterWidth);\n };\n }, [dom, updateFooterWidth]);\n\n // an update to \"state\" might lead to an updated UI so we include it as a trigger\n useEffect(() => {\n if (!isStyleLoading) {\n updateFooterWidth();\n updateSidebarPositionAndHeight();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n state,\n isStyleLoading,\n updateFooterWidth,\n updateSidebarPositionAndHeight,\n ]);\n\n // a function that performs transformations that are executed prior to adding it to the DOM\n const preRender = useCallback(\n (rawContent: string, contentPath: string) =>\n transformer(rawContent, [\n sanitizerTransformer,\n addBaseUrl({\n techdocsStorageApi,\n entityId: entityRef,\n path: contentPath,\n }),\n rewriteDocLinks(),\n addSidebarToggle(),\n removeMkdocsHeader(),\n simplifyMkdocsFooter(),\n ...(withFeedbackLink ? [addGitFeedbackLink(scmIntegrationsApi)] : []),\n stylesTransformer,\n ]),\n [\n // only add dependencies that are in state or memorized variables to avoid unnecessary calls between re-renders\n entityRef,\n scmIntegrationsApi,\n techdocsStorageApi,\n sanitizerTransformer,\n stylesTransformer,\n withFeedbackLink,\n ],\n );\n\n // a function that performs transformations that are executed after adding it to the DOM\n const postRender = useCallback(\n async (transformedElement: Element) =>\n transformer(transformedElement, [\n handleMetaRedirects(navigate, entityRef.name),\n scrollIntoNavigation(),\n copyToClipboard(theme),\n addLinkClickListener({\n baseUrl:\n configApi.getOptionalString('app.baseUrl') ||\n window.location.origin,\n onClick: (event: MouseEvent, url: string) => {\n // detect if CTRL or META keys are pressed so that links can be opened in a new tab with `window.open`\n const modifierActive = event.ctrlKey || event.metaKey;\n const parsedUrl = new URL(url);\n\n // capture link clicks within documentation\n const linkText =\n (event.target as HTMLAnchorElement | undefined)?.innerText || url;\n const to = url.replace(window.location.origin, '');\n analytics.captureEvent('click', linkText, { attributes: { to } });\n\n // hash exists when anchor is clicked on secondary sidebar\n if (parsedUrl.hash) {\n if (modifierActive) {\n window.open(url, '_blank');\n } else {\n // If it's in a different page, we navigate to it\n if (window.location.pathname !== parsedUrl.pathname) {\n navigate(url);\n } else {\n // If it's in the same page we avoid using navigate that causes\n // the page to rerender.\n window.history.pushState(\n null,\n document.title,\n parsedUrl.hash,\n );\n }\n // Scroll to hash if it's on the current page\n transformedElement\n ?.querySelector(`[id=\"${parsedUrl.hash.slice(1)}\"]`)\n ?.scrollIntoView();\n\n // Focus first focusable element in the target section\n (\n transformedElement\n ?.querySelector(`[id=\"${parsedUrl.hash.slice(1)}\"]`)\n ?.querySelector('a, button, [tabindex]') as HTMLElement\n )?.focus();\n }\n } else {\n if (modifierActive) {\n window.open(url, '_blank');\n } else {\n navigate(url);\n }\n }\n },\n }),\n // disable MkDocs drawer toggling ('for' attribute => checkbox mechanism)\n onCssReady({\n onLoading: () => {},\n onLoaded: () => {\n transformedElement\n .querySelector('.md-nav__title')\n ?.removeAttribute('for');\n },\n }),\n // hide sidebars until their positions are updated\n onCssReady({\n onLoading: () => {\n const sidebars = Array.from(\n transformedElement.querySelectorAll<HTMLElement>('.md-sidebar'),\n );\n sidebars.forEach(element => {\n element.style.setProperty('opacity', '0');\n });\n },\n onLoaded: () => {},\n }),\n addNavLinkKeyboardToggle(),\n ]),\n [theme, navigate, analytics, entityRef.name, configApi],\n );\n\n useEffect(() => {\n if (!rawPage) return () => {};\n\n // if false, there is already a newer execution of this effect\n let shouldReplaceContent = true;\n\n // Pre-render\n preRender(rawPage, path).then(async preTransformedDomElement => {\n if (!preTransformedDomElement?.innerHTML) {\n return; // An unexpected error occurred\n }\n\n // don't manipulate the shadow dom if this isn't the latest effect execution\n if (!shouldReplaceContent) {\n return;\n }\n\n // Skip this update if the location's path has changed but the state\n // contains a page that isn't loaded yet.\n if (currPath !== path) {\n return;\n }\n\n // Scroll to top after render\n window.scroll({ top: 0 });\n\n // Post-render\n const postTransformedDomElement = await postRender(\n preTransformedDomElement,\n );\n\n setDom(postTransformedDomElement as HTMLElement);\n });\n\n // cancel this execution\n return () => {\n shouldReplaceContent = false;\n };\n }, [rawPage, currPath, path, preRender, postRender]);\n\n return dom;\n};\n"],"names":["transformer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,MAAM,kBAAA,GAAqB,mCAAA;AAKpB,MAAM,kBAAA,GAAqB,CAAC,WAAA,KAAyB;AAC1D,EAAA,MAAM,WAAW,WAAA,EAAY;AAC7B,EAAA,MAAM,WAAW,WAAA,EAAY;AAC7B,EAAA,MAAM,EAAE,GAAA,EAAK,QAAA,GAAW,EAAA,KAAO,SAAA,EAAU;AAEzC,EAAA,eAAA,CAAgB,MAAM;AACpB,IAAA,IAAI,QAAA,KAAa,MAAM,WAAA,EAAa;AAClC,MAAA,QAAA,CAAS,CAAA,EAAG,SAAS,QAAQ,CAAA,EAAG,WAAW,CAAA,CAAA,EAAI,EAAE,OAAA,EAAS,IAAA,EAAM,CAAA;AAAA,IAClE;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AACP;AAOO,MAAM,oBAAA,GAAuB,CAClC,SAAA,EACA,OAAA,KACmB;AACnB,EAAA,MAAM,EAAE,WAAA,EAAa,gBAAA,GAAmB,IAAA,EAAK,GAAI,WAAW,EAAC;AAE7D,EAAA,MAAM,WAAW,cAAA,EAAe;AAChC,EAAA,MAAM,QAAQ,QAAA,EAAS;AACvB,EAAA,MAAM,aAAA,GAAgB,cAAc,kBAAkB,CAAA;AACtD,EAAA,MAAM,uBAAuB,uBAAA,EAAwB;AACrD,EAAA,MAAM,oBAAoB,oBAAA,EAAqB;AAC/C,EAAA,MAAM,YAAY,YAAA,EAAa;AAE/B,EAAA,MAAM,kBAAA,GAAqB,OAAO,qBAAqB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AA,IAAI,oBAAA,GAAuB,IAAA;AAG3B,IAAA,SAAA,CAAU,OAAA,EAAS,IAAI,CAAA,CAAE,IAAA,CAAK,OAAM,wBAAA,KAA4B;AAC9D,MAAA,IAAI,CAAC,0BAA0B,SAAA,EAAW;AACxC,QAAA;AAAA,MACF;AAGA,MAAA,IAAI,CAAC,oBAAA,EAAsB;AACzB,QAAA;AAAA,MACF;AAIA,MAAA,IAAI,aAAa,IAAA,EAAM;AACrB,QAAA;AAAA,MACF;AAGA,MAAA,MAAA,CAAO,MAAA,CAAO,EAAE,GAAA,EAAK,CAAA,EAAG,CAAA;AAGxB,MAAA,MAAM,4BAA4B,MAAM,UAAA;AAAA,QACtC;AAAA,OACF;AAEA,MAAA,MAAA,CAAO,yBAAwC,CAAA;AAAA,IACjD,CAAC,CAAA;AAGD,IAAA,OAAO,MAAM;AACX,MAAA,oBAAA,GAAuB,KAAA;AAAA,IACzB,CAAA;AAAA,EACF,GAAG,CAAC,OAAA,EAAS,UAAU,IAAA,EAAM,SAAA,EAAW,UAAU,CAAC,CAAA;AAEnD,EAAA,OAAO,GAAA;AACT;;"}
1
+ {"version":3,"file":"dom.esm.js","sources":["../../../../src/reader/components/TechDocsReaderPageContent/dom.tsx"],"sourcesContent":["/*\n * Copyright 2022 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 {\n useCallback,\n useEffect,\n useLayoutEffect,\n // useRef,\n useState,\n} from 'react';\n\nimport useMediaQuery from '@material-ui/core/useMediaQuery';\nimport { useTheme } from '@material-ui/core/styles';\n\nimport { CompoundEntityRef } from '@backstage/catalog-model';\nimport { configApiRef, useAnalytics, useApi } from '@backstage/core-plugin-api';\nimport { scmIntegrationsApiRef } from '@backstage/integration-react';\n\nimport {\n techdocsStorageApiRef,\n useShadowDomStylesLoading,\n} from '@backstage/plugin-techdocs-react';\n\nimport { useTechDocsReader } from '../TechDocsReaderProvider';\n\nimport {\n addBaseUrl,\n addGitFeedbackLink,\n addLinkClickListener,\n addSidebarToggle,\n onCssReady,\n removeMkdocsHeader,\n rewriteDocLinks,\n simplifyMkdocsFooter,\n scrollIntoNavigation,\n transform as transformer,\n copyToClipboard,\n useSanitizerTransformer,\n useStylesTransformer,\n handleMetaRedirects,\n addNavLinkKeyboardToggle,\n} from '../../transformers';\nimport { useNavigateUrl } from './useNavigateUrl';\nimport { useLocation, useNavigate, useParams } from 'react-router-dom';\n\nconst MOBILE_MEDIA_QUERY = 'screen and (max-width: 76.1875em)';\n\n// If a defaultPath is specified then we should navigate to that path replacing the\n// current location in the history. This should only happen on the initial load so\n// navigating to the root of the docs doesn't also redirect.\nexport const useInitialRedirect = (defaultPath?: string) => {\n const location = useLocation();\n const navigate = useNavigate();\n const { '*': currPath = '' } = useParams();\n\n useLayoutEffect(() => {\n if (currPath === '' && defaultPath) {\n navigate(`${location.pathname}${defaultPath}`, { replace: true });\n }\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n};\n\n// The secondary sidebar (table of contents) is fixed-positioned, so its\n// `right` offset is relative to the viewport. When the docs container is\n// narrower than the viewport (e.g. on wide screens), offset the sidebar so it\n// stays aligned with the container's right edge instead of drifting outwards.\nexport const getSecondarySidebarRightOffset = (\n container: Element,\n minOffset: number,\n): number => {\n const viewportWidth = document.documentElement.clientWidth;\n const containerRight = container.getBoundingClientRect().right;\n return Math.max(minOffset, viewportWidth - containerRight);\n};\n\n/**\n * Hook that encapsulates the behavior of getting raw HTML and applying\n * transforms to it in order to make it function at a basic level in the\n * Backstage UI.\n */\nexport const useTechDocsReaderDom = (\n entityRef: CompoundEntityRef,\n options?: { defaultPath?: string; withFeedbackLink?: boolean },\n): Element | null => {\n const { defaultPath, withFeedbackLink = true } = options ?? {};\n\n const navigate = useNavigateUrl();\n const theme = useTheme();\n const isMobileMedia = useMediaQuery(MOBILE_MEDIA_QUERY);\n const sanitizerTransformer = useSanitizerTransformer();\n const stylesTransformer = useStylesTransformer();\n const analytics = useAnalytics();\n\n const techdocsStorageApi = useApi(techdocsStorageApiRef);\n const scmIntegrationsApi = useApi(scmIntegrationsApiRef);\n const configApi = useApi(configApiRef);\n\n const { state, path, content: rawPage } = useTechDocsReader();\n const { '*': currPath = '' } = useParams();\n\n const [dom, setDom] = useState<HTMLElement | null>(null);\n const isStyleLoading = useShadowDomStylesLoading(dom);\n\n useInitialRedirect(defaultPath);\n\n const updateSidebarPositionAndHeight = useCallback(() => {\n if (!dom) return;\n\n const sidebars = dom.querySelectorAll<HTMLElement>('.md-sidebar');\n\n sidebars.forEach(element => {\n // set sidebar position to render in correct position\n if (isMobileMedia) {\n element.style.top = '0px';\n } else {\n const page = document?.querySelector('.techdocs-reader-page');\n const pageTop = page?.getBoundingClientRect().top ?? 0;\n let domTop = dom.getBoundingClientRect().top ?? 0;\n\n const tabs = dom.querySelector('.md-container > .md-tabs');\n const tabsHeight = tabs?.getBoundingClientRect().height ?? 0;\n\n // the sidebars should not scroll beyond the total height of the header and tabs\n if (domTop < pageTop) {\n domTop = pageTop;\n }\n\n const scrollbarTopPx = Math.max(domTop, 0) + tabsHeight;\n\n element.style.top = `${scrollbarTopPx}px`;\n\n // set scrollbar height to ensure all links can be seen when content is small\n const footer = dom.querySelector('.md-container > .md-footer');\n // if no footer, fallback to using the bottom of the window\n const scrollbarEndPx =\n footer?.getBoundingClientRect().top ?? window.innerHeight;\n\n element.style.height = `${scrollbarEndPx - scrollbarTopPx}px`;\n\n // keep the table of contents aligned with the docs container\n if (element.classList.contains('md-sidebar--secondary')) {\n const rightPx = getSecondarySidebarRightOffset(dom, theme.spacing(3));\n element.style.right = `${rightPx}px`;\n }\n }\n\n // show the sidebar only after updating its position\n element.style.setProperty('opacity', '1');\n });\n }, [dom, isMobileMedia, theme]);\n\n useEffect(() => {\n window.addEventListener('resize', updateSidebarPositionAndHeight);\n window.addEventListener('scroll', updateSidebarPositionAndHeight, true);\n return () => {\n window.removeEventListener('resize', updateSidebarPositionAndHeight);\n window.removeEventListener(\n 'scroll',\n updateSidebarPositionAndHeight,\n true,\n );\n };\n }, [dom, updateSidebarPositionAndHeight]);\n\n // dynamically set width of footer to accommodate for pinning of the sidebar\n const updateFooterWidth = useCallback(() => {\n if (!dom) return;\n const footer = dom.querySelector<HTMLElement>('.md-footer');\n if (footer) {\n footer.style.width = `${dom.getBoundingClientRect().width}px`;\n }\n }, [dom]);\n\n useEffect(() => {\n window.addEventListener('resize', updateFooterWidth);\n return () => {\n window.removeEventListener('resize', updateFooterWidth);\n };\n }, [dom, updateFooterWidth]);\n\n // an update to \"state\" might lead to an updated UI so we include it as a trigger\n useEffect(() => {\n if (!isStyleLoading) {\n updateFooterWidth();\n updateSidebarPositionAndHeight();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n state,\n isStyleLoading,\n updateFooterWidth,\n updateSidebarPositionAndHeight,\n ]);\n\n // a function that performs transformations that are executed prior to adding it to the DOM\n const preRender = useCallback(\n (rawContent: string, contentPath: string) =>\n transformer(rawContent, [\n sanitizerTransformer,\n addBaseUrl({\n techdocsStorageApi,\n entityId: entityRef,\n path: contentPath,\n }),\n rewriteDocLinks(),\n addSidebarToggle(),\n removeMkdocsHeader(),\n simplifyMkdocsFooter(),\n ...(withFeedbackLink ? [addGitFeedbackLink(scmIntegrationsApi)] : []),\n stylesTransformer,\n ]),\n [\n // only add dependencies that are in state or memorized variables to avoid unnecessary calls between re-renders\n entityRef,\n scmIntegrationsApi,\n techdocsStorageApi,\n sanitizerTransformer,\n stylesTransformer,\n withFeedbackLink,\n ],\n );\n\n // a function that performs transformations that are executed after adding it to the DOM\n const postRender = useCallback(\n async (transformedElement: Element) =>\n transformer(transformedElement, [\n handleMetaRedirects(navigate, entityRef.name),\n scrollIntoNavigation(),\n copyToClipboard(theme),\n addLinkClickListener({\n baseUrl:\n configApi.getOptionalString('app.baseUrl') ||\n window.location.origin,\n onClick: (event: MouseEvent, url: string) => {\n // detect if CTRL or META keys are pressed so that links can be opened in a new tab with `window.open`\n const modifierActive = event.ctrlKey || event.metaKey;\n const parsedUrl = new URL(url);\n\n // capture link clicks within documentation\n const linkText =\n (event.target as HTMLAnchorElement | undefined)?.innerText || url;\n const to = url.replace(window.location.origin, '');\n analytics.captureEvent('click', linkText, { attributes: { to } });\n\n // hash exists when anchor is clicked on secondary sidebar\n if (parsedUrl.hash) {\n if (modifierActive) {\n window.open(url, '_blank');\n } else {\n // If it's in a different page, we navigate to it\n if (window.location.pathname !== parsedUrl.pathname) {\n navigate(url);\n } else {\n // If it's in the same page we avoid using navigate that causes\n // the page to rerender.\n window.history.pushState(\n null,\n document.title,\n parsedUrl.hash,\n );\n }\n // Scroll to hash if it's on the current page\n transformedElement\n ?.querySelector(`[id=\"${parsedUrl.hash.slice(1)}\"]`)\n ?.scrollIntoView();\n\n // Focus first focusable element in the target section\n (\n transformedElement\n ?.querySelector(`[id=\"${parsedUrl.hash.slice(1)}\"]`)\n ?.querySelector('a, button, [tabindex]') as HTMLElement\n )?.focus();\n }\n } else {\n if (modifierActive) {\n window.open(url, '_blank');\n } else {\n navigate(url);\n }\n }\n },\n }),\n // disable MkDocs drawer toggling ('for' attribute => checkbox mechanism)\n onCssReady({\n onLoading: () => {},\n onLoaded: () => {\n transformedElement\n .querySelector('.md-nav__title')\n ?.removeAttribute('for');\n },\n }),\n // hide sidebars until their positions are updated\n onCssReady({\n onLoading: () => {\n const sidebars = Array.from(\n transformedElement.querySelectorAll<HTMLElement>('.md-sidebar'),\n );\n sidebars.forEach(element => {\n element.style.setProperty('opacity', '0');\n });\n },\n onLoaded: () => {},\n }),\n addNavLinkKeyboardToggle(),\n ]),\n [theme, navigate, analytics, entityRef.name, configApi],\n );\n\n useEffect(() => {\n if (!rawPage) return () => {};\n\n // if false, there is already a newer execution of this effect\n let shouldReplaceContent = true;\n\n // Pre-render\n preRender(rawPage, path).then(async preTransformedDomElement => {\n if (!preTransformedDomElement?.innerHTML) {\n return; // An unexpected error occurred\n }\n\n // don't manipulate the shadow dom if this isn't the latest effect execution\n if (!shouldReplaceContent) {\n return;\n }\n\n // Skip this update if the location's path has changed but the state\n // contains a page that isn't loaded yet.\n if (currPath !== path) {\n return;\n }\n\n // Scroll to top after render\n window.scroll({ top: 0 });\n\n // Post-render\n const postTransformedDomElement = await postRender(\n preTransformedDomElement,\n );\n\n setDom(postTransformedDomElement as HTMLElement);\n });\n\n // cancel this execution\n return () => {\n shouldReplaceContent = false;\n };\n }, [rawPage, currPath, path, preRender, postRender]);\n\n return dom;\n};\n"],"names":["transformer"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0DA,MAAM,kBAAA,GAAqB,mCAAA;AAKpB,MAAM,kBAAA,GAAqB,CAAC,WAAA,KAAyB;AAC1D,EAAA,MAAM,WAAW,WAAA,EAAY;AAC7B,EAAA,MAAM,WAAW,WAAA,EAAY;AAC7B,EAAA,MAAM,EAAE,GAAA,EAAK,QAAA,GAAW,EAAA,KAAO,SAAA,EAAU;AAEzC,EAAA,eAAA,CAAgB,MAAM;AACpB,IAAA,IAAI,QAAA,KAAa,MAAM,WAAA,EAAa;AAClC,MAAA,QAAA,CAAS,CAAA,EAAG,SAAS,QAAQ,CAAA,EAAG,WAAW,CAAA,CAAA,EAAI,EAAE,OAAA,EAAS,IAAA,EAAM,CAAA;AAAA,IAClE;AAAA,EACF,CAAA,EAAG,EAAE,CAAA;AACP;AAMO,MAAM,8BAAA,GAAiC,CAC5C,SAAA,EACA,SAAA,KACW;AACX,EAAA,MAAM,aAAA,GAAgB,SAAS,eAAA,CAAgB,WAAA;AAC/C,EAAA,MAAM,cAAA,GAAiB,SAAA,CAAU,qBAAA,EAAsB,CAAE,KAAA;AACzD,EAAA,OAAO,IA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,CAAO,yBAAwC,CAAA;AAAA,IACjD,CAAC,CAAA;AAGD,IAAA,OAAO,MAAM;AACX,MAAA,oBAAA,GAAuB,KAAA;AAAA,IACzB,CAAA;AAAA,EACF,GAAG,CAAC,OAAA,EAAS,UAAU,IAAA,EAAM,SAAA,EAAW,UAAU,CAAC,CAAA;AAEnD,EAAA,OAAO,GAAA;AACT;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-techdocs",
3
- "version": "1.19.0-next.2",
3
+ "version": "1.19.1-next.0",
4
4
  "description": "The Backstage plugin that renders technical documentation for your components",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -71,24 +71,24 @@
71
71
  "test": "backstage-cli package test"
72
72
  },
73
73
  "dependencies": {
74
- "@backstage/catalog-client": "1.16.3-next.1",
75
- "@backstage/catalog-model": "1.10.2-next.0",
76
- "@backstage/config": "1.3.10-next.0",
77
- "@backstage/core-components": "0.18.15-next.3",
78
- "@backstage/core-plugin-api": "1.12.11-next.0",
79
- "@backstage/errors": "1.3.2-next.0",
80
- "@backstage/filter-predicates": "0.1.6-next.0",
81
- "@backstage/frontend-plugin-api": "0.18.2-next.1",
82
- "@backstage/integration": "2.1.3-next.1",
83
- "@backstage/integration-react": "1.2.23-next.0",
84
- "@backstage/plugin-auth-react": "0.1.32-next.0",
85
- "@backstage/plugin-catalog-react": "3.3.0-next.2",
86
- "@backstage/plugin-search-common": "1.2.26-next.0",
87
- "@backstage/plugin-search-react": "1.11.9-next.0",
88
- "@backstage/plugin-techdocs-common": "0.1.2-next.0",
89
- "@backstage/plugin-techdocs-react": "1.3.16-next.2",
74
+ "@backstage/catalog-client": "1.16.3",
75
+ "@backstage/catalog-model": "1.10.2",
76
+ "@backstage/config": "1.3.10",
77
+ "@backstage/core-components": "0.18.16-next.0",
78
+ "@backstage/core-plugin-api": "1.12.12-next.0",
79
+ "@backstage/errors": "1.3.2",
80
+ "@backstage/filter-predicates": "0.2.0",
81
+ "@backstage/frontend-plugin-api": "0.18.3-next.0",
82
+ "@backstage/integration": "2.1.3",
83
+ "@backstage/integration-react": "1.2.24-next.0",
84
+ "@backstage/plugin-auth-react": "0.1.33-next.0",
85
+ "@backstage/plugin-catalog-react": "4.0.0-next.0",
86
+ "@backstage/plugin-search-common": "1.2.26",
87
+ "@backstage/plugin-search-react": "1.11.10-next.0",
88
+ "@backstage/plugin-techdocs-common": "0.1.2",
89
+ "@backstage/plugin-techdocs-react": "1.4.1-next.0",
90
90
  "@backstage/theme": "0.7.3",
91
- "@backstage/ui": "0.19.0-next.0",
91
+ "@backstage/ui": "0.19.0",
92
92
  "@material-ui/core": "^4.12.2",
93
93
  "@material-ui/icons": "^4.9.1",
94
94
  "@material-ui/lab": "4.0.0-alpha.61",
@@ -103,12 +103,12 @@
103
103
  "zod": "^4.0.0"
104
104
  },
105
105
  "devDependencies": {
106
- "@backstage/cli": "0.36.7-next.0",
107
- "@backstage/core-app-api": "1.20.6-next.1",
108
- "@backstage/dev-utils": "1.1.28-next.1",
109
- "@backstage/plugin-catalog": "2.0.10-next.3",
110
- "@backstage/plugin-techdocs-module-addons-contrib": "1.1.41-next.0",
111
- "@backstage/test-utils": "1.7.23-next.0",
106
+ "@backstage/cli": "0.36.8-next.0",
107
+ "@backstage/core-app-api": "1.20.7-next.0",
108
+ "@backstage/dev-utils": "1.1.29-next.0",
109
+ "@backstage/plugin-catalog": "2.0.11-next.0",
110
+ "@backstage/plugin-techdocs-module-addons-contrib": "1.1.42-next.0",
111
+ "@backstage/test-utils": "1.7.24-next.0",
112
112
  "@testing-library/dom": "^10.0.0",
113
113
  "@testing-library/jest-dom": "^6.0.0",
114
114
  "@testing-library/react": "^16.0.0",