@backstage/plugin-techdocs 0.0.0-nightly-20260919022921 → 0.0.0-nightly-20260920023043

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.
Files changed (92) hide show
  1. package/CHANGELOG.md +17 -16
  2. package/dist/EntityPageDocs.esm.js.map +1 -1
  3. package/dist/Router.esm.js +2 -2
  4. package/dist/Router.esm.js.map +1 -1
  5. package/dist/alpha/addonsApi.esm.js.map +1 -1
  6. package/dist/alpha/components/TechDocsIndexPageContent.esm.js.map +1 -1
  7. package/dist/alpha/components/TechDocsReaderContent.esm.js.map +1 -1
  8. package/dist/alpha/components/TechDocsReaderEntityCard.esm.js.map +1 -1
  9. package/dist/alpha/components/TechDocsReaderEntityCard.module.css.esm.js.map +1 -1
  10. package/dist/alpha/components/TechDocsReaderHeader.esm.js.map +1 -1
  11. package/dist/alpha/components/TechDocsReaderLayout.esm.js.map +1 -1
  12. package/dist/alpha/components/TechDocsReaderPage.esm.js +4 -4
  13. package/dist/alpha/components/TechDocsReaderPage.esm.js.map +1 -1
  14. package/dist/alpha/components/TechDocsReaderSearch.esm.js.map +1 -1
  15. package/dist/alpha/hooks/useTechdocsReaderIconLinkProps.esm.js.map +1 -1
  16. package/dist/alpha.esm.js.map +1 -1
  17. package/dist/api.esm.js.map +1 -1
  18. package/dist/client.esm.js.map +1 -1
  19. package/dist/helpers.esm.js.map +1 -1
  20. package/dist/home/components/DefaultTechDocsHome.esm.js.map +1 -1
  21. package/dist/home/components/Grids/DocsCardGrid.esm.js.map +1 -1
  22. package/dist/home/components/Grids/EntityListDocsGrid.esm.js.map +1 -1
  23. package/dist/home/components/Grids/InfoCardGrid.esm.js.map +1 -1
  24. package/dist/home/components/Tables/CursorPaginatedDocsTable.esm.js.map +1 -1
  25. package/dist/home/components/Tables/DocsTable.esm.js.map +1 -1
  26. package/dist/home/components/Tables/EntityListDocsTable.esm.js.map +1 -1
  27. package/dist/home/components/Tables/OffsetPaginatedDocsTable.esm.js.map +1 -1
  28. package/dist/home/components/Tables/actions.esm.js.map +1 -1
  29. package/dist/home/components/Tables/columns.esm.js.map +1 -1
  30. package/dist/home/components/Tables/helpers.esm.js.map +1 -1
  31. package/dist/home/components/TechDocsCustomHome.esm.js.map +1 -1
  32. package/dist/home/components/TechDocsIndexPage.esm.js.map +1 -1
  33. package/dist/home/components/TechDocsPageWrapper.esm.js.map +1 -1
  34. package/dist/home/components/TechDocsPicker.esm.js.map +1 -1
  35. package/dist/hooks/useTechDocsReaderContentData.esm.js.map +1 -1
  36. package/dist/hooks/useTechDocsReaderHeaderData.esm.js.map +1 -1
  37. package/dist/hooks/useTechDocsSearch.esm.js.map +1 -1
  38. package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js.map +1 -1
  39. package/dist/plugin.esm.js +2 -2
  40. package/dist/plugin.esm.js.map +1 -1
  41. package/dist/plugins/techdocs/package.json.esm.js +1 -1
  42. package/dist/plugins/techdocs/package.json.esm.js.map +1 -1
  43. package/dist/reader/components/TechDocsBuildLogs.esm.js.map +1 -1
  44. package/dist/reader/components/TechDocsNotFound.esm.js.map +1 -1
  45. package/dist/reader/components/TechDocsReaderPage/TechDocsReaderPage.esm.js +2 -2
  46. package/dist/reader/components/TechDocsReaderPage/TechDocsReaderPage.esm.js.map +1 -1
  47. package/dist/reader/components/TechDocsReaderPage/useExternalRedirect.esm.js.map +1 -1
  48. package/dist/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.esm.js.map +1 -1
  49. package/dist/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContentAddons.esm.js.map +1 -1
  50. package/dist/reader/components/TechDocsReaderPageContent/dom.esm.js.map +1 -1
  51. package/dist/reader/components/TechDocsReaderPageContent/useNavigateUrl.esm.js.map +1 -1
  52. package/dist/reader/components/TechDocsReaderPageHeader/TechDocsReaderPageHeader.esm.js.map +1 -1
  53. package/dist/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.esm.js.map +1 -1
  54. package/dist/reader/components/TechDocsReaderProvider.esm.js.map +1 -1
  55. package/dist/reader/components/TechDocsRedirectNotification/TechDocsRedirectNotification.esm.js.map +1 -1
  56. package/dist/reader/components/TechDocsStateIndicator.esm.js.map +1 -1
  57. package/dist/reader/components/useReaderState.esm.js.map +1 -1
  58. package/dist/reader/transformers/addBaseUrl.esm.js.map +1 -1
  59. package/dist/reader/transformers/addGitFeedbackLink.esm.js.map +1 -1
  60. package/dist/reader/transformers/addLinkClickListener.esm.js.map +1 -1
  61. package/dist/reader/transformers/addNavLinkKeyboardToggle.esm.js.map +1 -1
  62. package/dist/reader/transformers/addSidebarToggle.esm.js.map +1 -1
  63. package/dist/reader/transformers/copyToClipboard.esm.js.map +1 -1
  64. package/dist/reader/transformers/handleMetaRedirects.esm.js.map +1 -1
  65. package/dist/reader/transformers/html/hooks/attributes.esm.js.map +1 -1
  66. package/dist/reader/transformers/html/hooks/iframes.esm.js.map +1 -1
  67. package/dist/reader/transformers/html/hooks/links.esm.js.map +1 -1
  68. package/dist/reader/transformers/html/hooks/metatags.esm.js.map +1 -1
  69. package/dist/reader/transformers/html/transformer.esm.js.map +1 -1
  70. package/dist/reader/transformers/html/utils.esm.js.map +1 -1
  71. package/dist/reader/transformers/onCssReady.esm.js.map +1 -1
  72. package/dist/reader/transformers/removeMkdocsHeader.esm.js.map +1 -1
  73. package/dist/reader/transformers/renderReactElement.esm.js.map +1 -1
  74. package/dist/reader/transformers/rewriteDocLinks.esm.js.map +1 -1
  75. package/dist/reader/transformers/scrollIntoNavigation.esm.js.map +1 -1
  76. package/dist/reader/transformers/simplifyMkdocsFooter.esm.js.map +1 -1
  77. package/dist/reader/transformers/styles/rules/animations.esm.js.map +1 -1
  78. package/dist/reader/transformers/styles/rules/extensions.esm.js.map +1 -1
  79. package/dist/reader/transformers/styles/rules/layout.esm.js.map +1 -1
  80. package/dist/reader/transformers/styles/rules/palette.esm.js.map +1 -1
  81. package/dist/reader/transformers/styles/rules/reset.esm.js.map +1 -1
  82. package/dist/reader/transformers/styles/rules/rules.esm.js.map +1 -1
  83. package/dist/reader/transformers/styles/rules/typeset.esm.js.map +1 -1
  84. package/dist/reader/transformers/styles/rules/variables.esm.js.map +1 -1
  85. package/dist/reader/transformers/styles/transformer.esm.js.map +1 -1
  86. package/dist/reader/transformers/transformer.esm.js.map +1 -1
  87. package/dist/routes.esm.js.map +1 -1
  88. package/dist/search/components/TechDocsSearch.esm.js.map +1 -1
  89. package/dist/search/components/TechDocsSearchResultListItem.esm.js.map +1 -1
  90. package/dist/search/hooks/useTechDocsLocation.esm.js.map +1 -1
  91. package/dist/translation.esm.js.map +1 -1
  92. package/package.json +21 -21
@@ -1 +1 @@
1
- {"version":3,"file":"addGitFeedbackLink.esm.js","sources":["../../../src/reader/transformers/addGitFeedbackLink.ts"],"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 type { Transformer } from './transformer';\nimport {\n replaceGithubUrlType,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport FeedbackOutlinedIcon from '@material-ui/icons/FeedbackOutlined';\nimport { createElement } from 'react';\nimport parseGitUrl from 'git-url-parse';\nimport { renderReactElement } from './renderReactElement';\n\n// requires repo\nexport const addGitFeedbackLink = (\n scmIntegrationsApi: ScmIntegrationRegistry,\n): Transformer => {\n return dom => {\n // attempting to use selectors that are more likely to be static as MkDocs updates over time\n const sourceAnchor = dom.querySelector(\n '[title=\"Edit this page\"]',\n ) as HTMLAnchorElement;\n\n // don't show if edit link not available in raw page\n if (!sourceAnchor || !sourceAnchor.href) {\n return dom;\n }\n\n const sourceURL = new URL(sourceAnchor.href);\n const integration = scmIntegrationsApi.byUrl(sourceURL);\n\n // don't show if can't identify edit link hostname as a gitlab/github hosting\n if (integration?.type !== 'github' && integration?.type !== 'gitlab') {\n return dom;\n }\n\n // topmost h1 only contains title for whole page\n const title =\n (dom.querySelector('article>h1') as HTMLElement)?.childNodes[0]\n .textContent || '';\n const issueTitle = encodeURIComponent(`Documentation Feedback: ${title}`);\n const issueDesc = encodeURIComponent(\n `Page source:\\n${sourceAnchor.href}\\n\\nFeedback:`,\n );\n\n // Convert GitHub edit url to blob type so it can be parsed by git-url-parse correctly\n const gitUrl =\n integration?.type === 'github'\n ? replaceGithubUrlType(sourceURL.href, 'blob')\n : sourceURL.href;\n const gitInfo = parseGitUrl(gitUrl);\n const repoPath = `/${gitInfo.organization}/${gitInfo.name}`;\n\n const feedbackLink = sourceAnchor.cloneNode() as HTMLAnchorElement;\n switch (integration?.type) {\n case 'gitlab':\n feedbackLink.href = `${sourceURL.origin}${repoPath}/issues/new?issue[title]=${issueTitle}&issue[description]=${issueDesc}`;\n break;\n case 'github':\n feedbackLink.href = `${sourceURL.origin}${repoPath}/issues/new?title=${issueTitle}&body=${issueDesc}`;\n break;\n default:\n return dom;\n }\n renderReactElement(createElement(FeedbackOutlinedIcon), feedbackLink);\n feedbackLink.style.paddingLeft = '5px';\n feedbackLink.title = 'Leave feedback for this page';\n feedbackLink.id = 'git-feedback-link';\n sourceAnchor?.insertAdjacentElement('beforebegin', feedbackLink);\n return dom;\n };\n};\n"],"names":[],"mappings":";;;;;;AA2BO,MAAM,kBAAA,GAAqB,CAChC,kBAAA,KACgB;AAChB,EAAA,OAAO,CAAA,GAAA,KAAO;AAEZ,IAAA,MAAM,eAAe,GAAA,CAAI,aAAA;AAAA,MACvB;AAAA,KACF;AAGA,IAAA,IAAI,CAAC,YAAA,IAAgB,CAAC,YAAA,CAAa,IAAA,EAAM;AACvC,MAAA,OAAO,GAAA;AAAA,IACT;AAEA,IAAA,MAAM,SAAA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;AACnG,QAAA;AAAA,MACF;AACE,QAAA,OAAO,GAAA;AAAA;AAEX,IAAA,kBAAA,CAAmB,aAAA,CAAc,oBAAoB,CAAA,EAAG,YAAY,CAAA;AACpE,IAAA,YAAA,CAAa,MAAM,WAAA,GAAc,KAAA;AACjC,IAAA,YAAA,CAAa,KAAA,GAAQ,8BAAA;AACrB,IAAA,YAAA,CAAa,EAAA,GAAK,mBAAA;AAClB,IAAA,YAAA,EAAc,qBAAA,CAAsB,eAAe,YAAY,CAAA;AAC/D,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"addGitFeedbackLink.esm.js","sources":["../../../src/reader/transformers/addGitFeedbackLink.ts"],"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 type { Transformer } from './transformer';\nimport {\n replaceGithubUrlType,\n ScmIntegrationRegistry,\n} from '@backstage/integration';\nimport FeedbackOutlinedIcon from '@material-ui/icons/FeedbackOutlined';\nimport { createElement } from 'react';\nimport parseGitUrl from 'git-url-parse';\nimport { renderReactElement } from './renderReactElement';\n\n// requires repo\nexport const addGitFeedbackLink = (\n scmIntegrationsApi: ScmIntegrationRegistry,\n): Transformer => {\n return dom => {\n // attempting to use selectors that are more likely to be static as MkDocs updates over time\n const sourceAnchor = dom.querySelector(\n '[title=\"Edit this page\"]',\n ) as HTMLAnchorElement;\n\n // don't show if edit link not available in raw page\n if (!sourceAnchor || !sourceAnchor.href) {\n return dom;\n }\n\n const sourceURL = new URL(sourceAnchor.href);\n const integration = scmIntegrationsApi.byUrl(sourceURL);\n\n // don't show if can't identify edit link hostname as a gitlab/github hosting\n if (integration?.type !== 'github' && integration?.type !== 'gitlab') {\n return dom;\n }\n\n // topmost h1 only contains title for whole page\n const title =\n (dom.querySelector('article>h1') as HTMLElement)?.childNodes[0]\n .textContent || '';\n const issueTitle = encodeURIComponent(`Documentation Feedback: ${title}`);\n const issueDesc = encodeURIComponent(\n `Page source:\\n${sourceAnchor.href}\\n\\nFeedback:`,\n );\n\n // Convert GitHub edit url to blob type so it can be parsed by git-url-parse correctly\n const gitUrl =\n integration?.type === 'github'\n ? replaceGithubUrlType(sourceURL.href, 'blob')\n : sourceURL.href;\n const gitInfo = parseGitUrl(gitUrl);\n const repoPath = `/${gitInfo.organization}/${gitInfo.name}`;\n\n const feedbackLink = sourceAnchor.cloneNode() as HTMLAnchorElement;\n switch (integration?.type) {\n case 'gitlab':\n feedbackLink.href = `${sourceURL.origin}${repoPath}/issues/new?issue[title]=${issueTitle}&issue[description]=${issueDesc}`;\n break;\n case 'github':\n feedbackLink.href = `${sourceURL.origin}${repoPath}/issues/new?title=${issueTitle}&body=${issueDesc}`;\n break;\n default:\n return dom;\n }\n renderReactElement(createElement(FeedbackOutlinedIcon), feedbackLink);\n feedbackLink.style.paddingLeft = '5px';\n feedbackLink.title = 'Leave feedback for this page';\n feedbackLink.id = 'git-feedback-link';\n sourceAnchor?.insertAdjacentElement('beforebegin', feedbackLink);\n return dom;\n };\n};\n"],"names":[],"mappings":";;;;;;AA2BO,MAAM,kBAAA,GAAqB,CAChC,kBAAA,KACgB;AAChB,EAAA,OAAO,CAAA,GAAA,KAAO;AAEZ,IAAA,MAAM,eAAe,GAAA,CAAI,aAAA;AAAA,MACvB;AAAA,KACF;AAGA,IAAA,IAAI,CAAC,YAAA,IAAgB,CAAC,YAAA,CAAa,IAAA,EAAM;AACvC,MAAA,OAAO,GAAA;AAAA,IACT;AAEA,IAAA,MAAM,SAAA,GAAY,IAAI,GAAA,CAAI,YAAA,CAAa,IAAI,CAAA;AAC3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AEX,IAAA,kBAAA,CAAmB,aAAA,CAAc,oBAAoB,CAAA,EAAG,YAAY,CAAA;AACpE,IAAA,YAAA,CAAa,MAAM,WAAA,GAAc,KAAA;AACjC,IAAA,YAAA,CAAa,KAAA,GAAQ,8BAAA;AACrB,IAAA,YAAA,CAAa,EAAA,GAAK,mBAAA;AAClB,IAAA,YAAA,EAAc,qBAAA,CAAsB,eAAe,YAAY,CAAA;AAC/D,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"addLinkClickListener.esm.js","sources":["../../../src/reader/transformers/addLinkClickListener.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 type { Transformer } from './transformer';\n\ntype AddLinkClickListenerOptions = {\n baseUrl: string;\n onClick: (e: MouseEvent, newUrl: string) => void;\n};\n\nexport const addLinkClickListener = ({\n baseUrl,\n onClick,\n}: AddLinkClickListenerOptions): Transformer => {\n return dom => {\n Array.from(dom.getElementsByTagName('a')).forEach(elem => {\n elem.addEventListener('click', (e: MouseEvent) => {\n const target = elem as HTMLAnchorElement;\n const href = target.getAttribute('href');\n\n if (!href) return;\n if (href.startsWith(baseUrl) && !elem.hasAttribute('download')) {\n e.preventDefault();\n onClick(e, href);\n }\n });\n });\n\n return dom;\n };\n};\n"],"names":[],"mappings":"AAuBO,MAAM,uBAAuB,CAAC;AAAA,EACnC,OAAA;AAAA,EACA;AACF,CAAA,KAAgD;AAC9C,EAAA,OAAO,CAAA,GAAA,KAAO;AACZ,IAAA,KAAA,CAAM,KAAK,GAAA,CAAI,oBAAA,CAAqB,GAAG,CAAC,CAAA,CAAE,QAAQ,CAAA,IAAA,KAAQ;AACxD,MAAA,IAAA,CAAK,gBAAA,CAAiB,OAAA,EAAS,CAAC,CAAA,KAAkB;AAChD,QAAA,MAAM,MAAA,GAAS,IAAA;AACf,QAAA,MAAM,IAAA,GAAO,MAAA,CAAO,YAAA,CAAa,MAAM,CAAA;AAEvC,QAAA,IAAI,CAAC,IAAA,EAAM;AACX,QAAA,IAAI,IAAA,CAAK,WAAW,OAAO,CAAA,IAAK,CAAC,IAAA,CAAK,YAAA,CAAa,UAAU,CAAA,EAAG;AAC9D,UAAA,CAAA,CAAE,cAAA,EAAe;AACjB,UAAA,OAAA,CAAQ,GAAG,IAAI,CAAA;AAAA,QACjB;AAAA,MACF,CAAC,CAAA;AAAA,IACH,CAAC,CAAA;AAED,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"addLinkClickListener.esm.js","sources":["../../../src/reader/transformers/addLinkClickListener.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 type { Transformer } from './transformer';\n\ntype AddLinkClickListenerOptions = {\n baseUrl: string;\n onClick: (e: MouseEvent, newUrl: string) => void;\n};\n\nexport const addLinkClickListener = ({\n baseUrl,\n onClick,\n}: AddLinkClickListenerOptions): Transformer => {\n return dom => {\n Array.from(dom.getElementsByTagName('a')).forEach(elem => {\n elem.addEventListener('click', (e: MouseEvent) => {\n const target = elem as HTMLAnchorElement;\n const href = target.getAttribute('href');\n\n if (!href) return;\n if (href.startsWith(baseUrl) && !elem.hasAttribute('download')) {\n e.preventDefault();\n onClick(e, href);\n }\n });\n });\n\n return dom;\n };\n};\n"],"names":[],"mappings":"AAuBO,MAAM,uBAAuB,CAAC;AAAA,EACnC,OAAA;AAAA,EACA;AACF,CAAA,KAAgD;AAC9C,EAAA,OAAO,CAAA,GAAA,KAAO;AACZ,IAAA,KAAA,CAAM,KAAK,GAAA,CAAI,oBAAA,CAAqB,GAAG,CAAC,CAAA,CAAE,QAAQ,CAAA,IAAA,KAAQ;AACxD,MAAA,IAAA,CAAK,gBAAA,CAAiB,OAAA,EAAS,CAAC,CAAA,KAAkB;AAChD,QAAA,MAAM,MAAA,GAAS,IAAA;AACf,QAAA,MAAM,IAAA,GAAO,MAAA,CAAO,YAAA,CAAa,MAAM,CAAA;AAEvC,QAAA,IAAI,CAAC,IAAA,EAAM;AACX,QAAA,IAAI,IAAA,CAAK,WAAW,OAAO,CAAA,IAAK,CAAC,IAAA,CAAK,YAAA,CAAa,UAAU,CAAA,EAAG;AAC9D,UAAA,CAAA,CAAE,cAAA,EAAe;AACjB,UAAA,OAAA,CAAQ,GAAG,IAAI,CAAA;AAAA,QACjB;AAAA,MACF,CAAC,CAAA;AAAA,IACH,CAAC,CAAA;AAED,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"addNavLinkKeyboardToggle.esm.js","sources":["../../../src/reader/transformers/addNavLinkKeyboardToggle.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 function addNavLinkKeyboardToggle() {\n return (element: Element) => {\n const navLabels = element.querySelectorAll('label.md-nav__link[for]');\n navLabels.forEach(label => {\n label.setAttribute('tabIndex', '0');\n label.addEventListener('keydown', event => {\n const keyboardEvent = event as KeyboardEvent;\n if (keyboardEvent.key === 'Enter' || keyboardEvent.key === ' ') {\n const forId = label.getAttribute('for');\n if (!forId) return;\n const checkbox = element.querySelector(\n `#${forId}`,\n ) as HTMLInputElement | null;\n if (checkbox && checkbox.type === 'checkbox') {\n checkbox.checked = !checkbox.checked;\n checkbox.dispatchEvent(new Event('change', { bubbles: true }));\n event.preventDefault();\n event.stopPropagation();\n }\n }\n });\n });\n return element;\n };\n}\n"],"names":[],"mappings":"AAgBO,SAAS,wBAAA,GAA2B;AACzC,EAAA,OAAO,CAAC,OAAA,KAAqB;AAC3B,IAAA,MAAM,SAAA,GAAY,OAAA,CAAQ,gBAAA,CAAiB,yBAAyB,CAAA;AACpE,IAAA,SAAA,CAAU,QAAQ,CAAA,KAAA,KAAS;AACzB,MAAA,KAAA,CAAM,YAAA,CAAa,YAAY,GAAG,CAAA;AAClC,MAAA,KAAA,CAAM,gBAAA,CAAiB,WAAW,CAAA,KAAA,KAAS;AACzC,QAAA,MAAM,aAAA,GAAgB,KAAA;AACtB,QAAA,IAAI,aAAA,CAAc,GAAA,KAAQ,OAAA,IAAW,aAAA,CAAc,QAAQ,GAAA,EAAK;AAC9D,UAAA,MAAM,KAAA,GAAQ,KAAA,CAAM,YAAA,CAAa,KAAK,CAAA;AACtC,UAAA,IAAI,CAAC,KAAA,EAAO;AACZ,UAAA,MAAM,WAAW,OAAA,CAAQ,aAAA;AAAA,YACvB,IAAI,KAAK,CAAA;AAAA,WACX;AACA,UAAA,IAAI,QAAA,IAAY,QAAA,CAAS,IAAA,KAAS,UAAA,EAAY;AAC5C,YAAA,QAAA,CAAS,OAAA,GAAU,CAAC,QAAA,CAAS,OAAA;AAC7B,YAAA,QAAA,CAAS,aAAA,CAAc,IAAI,KAAA,CAAM,QAAA,EAAU,EAAE,OAAA,EAAS,IAAA,EAAM,CAAC,CAAA;AAC7D,YAAA,KAAA,CAAM,cAAA,EAAe;AACrB,YAAA,KAAA,CAAM,eAAA,EAAgB;AAAA,UACxB;AAAA,QACF;AAAA,MACF,CAAC,CAAA;AAAA,IACH,CAAC,CAAA;AACD,IAAA,OAAO,OAAA;AAAA,EACT,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"addNavLinkKeyboardToggle.esm.js","sources":["../../../src/reader/transformers/addNavLinkKeyboardToggle.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 function addNavLinkKeyboardToggle() {\n return (element: Element) => {\n const navLabels = element.querySelectorAll('label.md-nav__link[for]');\n navLabels.forEach(label => {\n label.setAttribute('tabIndex', '0');\n label.addEventListener('keydown', event => {\n const keyboardEvent = event as KeyboardEvent;\n if (keyboardEvent.key === 'Enter' || keyboardEvent.key === ' ') {\n const forId = label.getAttribute('for');\n if (!forId) return;\n const checkbox = element.querySelector(\n `#${forId}`,\n ) as HTMLInputElement | null;\n if (checkbox && checkbox.type === 'checkbox') {\n checkbox.checked = !checkbox.checked;\n checkbox.dispatchEvent(new Event('change', { bubbles: true }));\n event.preventDefault();\n event.stopPropagation();\n }\n }\n });\n });\n return element;\n };\n}\n"],"names":[],"mappings":"AAgBO,SAAS,wBAAA,GAA2B;AACzC,EAAA,OAAO,CAAC,OAAA,KAAqB;AAC3B,IAAA,MAAM,SAAA,GAAY,OAAA,CAAQ,gBAAA,CAAiB,yBAAyB,CAAA;AACpE,IAAA,SAAA,CAAU,QAAQ,CAAA,KAAA,KAAS;AACzB,MAAA,KAAA,CAAM,YAAA,CAAa,YAAY,GAAG,CAAA;AAClC,MAAA,KAAA,CAAM,gBAAA,CAAiB,WAAW,CAAA,KAAA,KAAS;AACzC,QAAA,MAAM,aAAA,GAAgB,KAAA;AACtB,QAAA,IAAI,aAAA,CAAc,GAAA,KAAQ,OAAA,IAAW,aAAA,CAAc,QAAQ,GAAA,EAAK;AAC9D,UAAA,MAAM,KAAA,GAAQ,KAAA,CAAM,YAAA,CAAa,KAAK,CAAA;AACtC,UAAA,IAAI,CAAC,KAAA,EAAO;AACZ,UAAA,MAAM,WAAW,OAAA,CAAQ,aAAA;AAAA,YACvB,IAAI,KAAK,CAAA;AAAA,WACX;AACA,UAAA,IAAI,QAAA,IAAY,QAAA,CAAS,IAAA,KAAS,UAAA,EAAY;AAC5C,YAAA,QAAA,CAAS,OAAA,GAAU,CAAC,QAAA,CAAS,OAAA;AAC7B,YAAA,QAAA,CAAS,aAAA,CAAc,IAAI,KAAA,CAAM,QAAA,EAAU,EAAE,OAAA,EAAS,IAAA,EAAM,CAAC,CAAA;AAC7D,YAAA,KAAA,CAAM,cAAA,EAAe;AACrB,YAAA,KAAA,CAAM,eAAA,EAAgB;AAAA,UACxB;AAAA,QACF;AAAA,MACF,CAAC,CAAA;AAAA,IACH,CAAC,CAAA;AACD,IAAA,OAAO,OAAA;AAAA,EACT,CAAA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"addSidebarToggle.esm.js","sources":["../../../src/reader/transformers/addSidebarToggle.ts"],"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 type { Transformer } from './transformer';\nimport MenuIcon from '@material-ui/icons/Menu';\nimport { createElement } from 'react';\nimport { renderReactElement } from './renderReactElement';\n\nexport const addSidebarToggle = (): Transformer => {\n return dom => {\n // attempting to use selectors that are more likely to be static as MkDocs updates over time\n const mkdocsToggleSidebar = dom.querySelector(\n '.md-header label[for=\"__drawer\"]',\n ) as HTMLLabelElement;\n const article = dom.querySelector('article') as HTMLElement;\n\n // Fail gracefully\n if (!mkdocsToggleSidebar || !article) {\n return dom;\n }\n\n const toggleSidebar = mkdocsToggleSidebar.cloneNode() as HTMLLabelElement;\n renderReactElement(createElement(MenuIcon), toggleSidebar);\n toggleSidebar.id = 'toggle-sidebar';\n toggleSidebar.title = 'Toggle Sidebar';\n toggleSidebar.classList.add('md-content__button');\n toggleSidebar.style.setProperty('padding', '0 0 0 5px');\n toggleSidebar.style.setProperty('margin', '0.4rem 0 0.4rem 0.4rem');\n article?.prepend(toggleSidebar);\n return dom;\n };\n};\n"],"names":[],"mappings":";;;;AAqBO,MAAM,mBAAmB,MAAmB;AACjD,EAAA,OAAO,CAAA,GAAA,KAAO;AAEZ,IAAA,MAAM,sBAAsB,GAAA,CAAI,aAAA;AAAA,MAC9B;AAAA,KACF;AACA,IAAA,MAAM,OAAA,GAAU,GAAA,CAAI,aAAA,CAAc,SAAS,CAAA;AAG3C,IAAA,IAAI,CAAC,mBAAA,IAAuB,CAAC,OAAA,EAAS;AACpC,MAAA,OAAO,GAAA;AAAA,IACT;AAEA,IAAA,MAAM,aAAA,GAAgB,oBAAoB,SAAA,EAAU;AACpD,IAAA,kBAAA,CAAmB,aAAA,CAAc,QAAQ,CAAA,EAAG,aAAa,CAAA;AACzD,IAAA,aAAA,CAAc,EAAA,GAAK,gBAAA;AACnB,IAAA,aAAA,CAAc,KAAA,GAAQ,gBAAA;AACtB,IAAA,aAAA,CAAc,SAAA,CAAU,IAAI,oBAAoB,CAAA;AAChD,IAAA,aAAA,CAAc,KAAA,CAAM,WAAA,CAAY,SAAA,EAAW,WAAW,CAAA;AACtD,IAAA,aAAA,CAAc,KAAA,CAAM,WAAA,CAAY,QAAA,EAAU,wBAAwB,CAAA;AAClE,IAAA,OAAA,EAAS,QAAQ,aAAa,CAAA;AAC9B,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"addSidebarToggle.esm.js","sources":["../../../src/reader/transformers/addSidebarToggle.ts"],"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 type { Transformer } from './transformer';\nimport MenuIcon from '@material-ui/icons/Menu';\nimport { createElement } from 'react';\nimport { renderReactElement } from './renderReactElement';\n\nexport const addSidebarToggle = (): Transformer => {\n return dom => {\n // attempting to use selectors that are more likely to be static as MkDocs updates over time\n const mkdocsToggleSidebar = dom.querySelector(\n '.md-header label[for=\"__drawer\"]',\n ) as HTMLLabelElement;\n const article = dom.querySelector('article') as HTMLElement;\n\n // Fail gracefully\n if (!mkdocsToggleSidebar || !article) {\n return dom;\n }\n\n const toggleSidebar = mkdocsToggleSidebar.cloneNode() as HTMLLabelElement;\n renderReactElement(createElement(MenuIcon), toggleSidebar);\n toggleSidebar.id = 'toggle-sidebar';\n toggleSidebar.title = 'Toggle Sidebar';\n toggleSidebar.classList.add('md-content__button');\n toggleSidebar.style.setProperty('padding', '0 0 0 5px');\n toggleSidebar.style.setProperty('margin', '0.4rem 0 0.4rem 0.4rem');\n article?.prepend(toggleSidebar);\n return dom;\n };\n};\n"],"names":[],"mappings":";;;;AAqBO,MAAM,mBAAmB,MAAmB;AACjD,EAAA,OAAO,CAAA,GAAA,KAAO;AAEZ,IAAA,MAAM,sBAAsB,GAAA,CAAI,aAAA;AAAA,MAC9B;AAAA,KACF;AACA,IAAA,MAAM,OAAA,GAAU,GAAA,CAAI,aAAA,CAAc,SAAS,CAAA;AAG3C,IAAA,IAAI,CAAC,mBAAA,IAAuB,CAAC,OAAA,EAAS;AACpC,MAAA,OAAO,GAAA;AAAA,IACT;AAEA,IAAA,MAAM,aAAA,GAAgB,oBAAoB,SAAA,EAAU;AACpD,IAAA,kBAAA,CAAmB,aAAA,CAAc,QAAQ,CAAA,EAAG,aAAa,CAAA;AACzD,IAAA,aAAA,CAAc,EAAA,GAAK,gBAAA;AACnB,IAAA,aAAA,CAAc,KAAA,GAAQ,gBAAA;AACtB,IAAA,aAAA,CAAc,SAAA,CAAU,IAAI,oBAAoB,CAAA;AAChD,IAAA,aAAA,CAAc,KAAA,CAAM,WAAA,CAAY,SAAA,EAAW,WAAW,CAAA;AACtD,IAAA,aAAA,CAAc,KAAA,CAAM,WAAA,CAAY,QAAA,EAAU,wBAAwB,CAAA;AAClE,IAAA,OAAA,EAAS,QAAQ,aAAa,CAAA;AAC9B,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"copyToClipboard.esm.js","sources":["../../../src/reader/transformers/copyToClipboard.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 { useState, useCallback } from 'react';\nimport { renderReactElement } from './renderReactElement';\nimport { ThemeProvider } from '@material-ui/core/styles';\nimport SvgIcon from '@material-ui/core/SvgIcon';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { withStyles, Theme } from '@material-ui/core/styles';\nimport IconButton from '@material-ui/core/IconButton';\nimport type { Transformer } from './transformer';\nimport useCopyToClipboard from 'react-use/esm/useCopyToClipboard';\n\nconst CopyToClipboardTooltip = withStyles(theme => ({\n tooltip: {\n fontSize: 'inherit',\n color: theme.palette.text.primary,\n margin: 0,\n padding: theme.spacing(0.5),\n backgroundColor: 'transparent',\n boxShadow: 'none',\n },\n}))(Tooltip);\n\nconst CopyToClipboardIcon = () => (\n <SvgIcon>\n <path d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\" />\n </SvgIcon>\n);\n\ntype CopyToClipboardButtonProps = {\n text: string;\n};\n\nconst CopyToClipboardButton = ({ text }: CopyToClipboardButtonProps) => {\n const [open, setOpen] = useState(false);\n const [, copyToClipboard] = useCopyToClipboard();\n\n const handleClick = useCallback(() => {\n copyToClipboard(text);\n setOpen(true);\n }, [text, copyToClipboard]);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n\n return (\n <CopyToClipboardTooltip\n title=\"Copied to clipboard\"\n placement=\"left\"\n open={open}\n onClose={handleClose}\n leaveDelay={1000}\n >\n <IconButton\n style={{\n position: 'absolute',\n // top & right was removed from upstream .md-clipboard in mkdocs-material 9.7.0\n top: '0.5rem',\n right: '0.5rem',\n }}\n className=\"md-clipboard md-icon\"\n onClick={handleClick}\n aria-label=\"Copy to clipboard\"\n >\n <CopyToClipboardIcon />\n </IconButton>\n </CopyToClipboardTooltip>\n );\n};\n\n/**\n * Recreates copy-to-clipboard functionality attached to <code> snippets that\n * is native to mkdocs-material theme.\n *\n * Unlike native mkdocs-material theme, this is always enabled and does not respect the mkdocs's config `theme.features` `content.code.copy` setting.\n */\nexport const copyToClipboard = (theme: Theme): Transformer => {\n return dom => {\n const codes = dom.querySelectorAll('pre > code');\n for (const code of codes) {\n const text = code.textContent || '';\n const container = document.createElement('div');\n code?.parentElement?.prepend(container);\n renderReactElement(\n <ThemeProvider theme={theme}>\n <CopyToClipboardButton text={text} />\n </ThemeProvider>,\n container,\n );\n }\n return dom;\n };\n};\n"],"names":["copyToClipboard"],"mappings":";;;;;;;;;AA0BA,MAAM,sBAAA,GAAyB,WAAW,CAAA,KAAA,MAAU;AAAA,EAClD,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,SAAA;AAAA,IACV,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,IAC1B,MAAA,EAAQ,CAAA;AAAA,IACR,OAAA,EAAS,KAAA,CAAM,OAAA,CAAQ,GAAG,CAAA;AAAA,IAC1B,eAAA,EAAiB,aAAA;AAAA,IACjB,SAAA,EAAW;AAAA;AAEf,CAAA,CAAE,EAAE,OAAO,CAAA;AAEX,MAAM,mBAAA,GAAsB,sBAC1B,GAAA,CAAC,OAAA,EAAA,EACC,8BAAC,MAAA,EAAA,EAAK,CAAA,EAAE,mIAAkI,CAAA,EAC5I,CAAA;AAOF,MAAM,qBAAA,GAAwB,CAAC,EAAE,IAAA,EAAK,KAAkC;AACtE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA;AACtC,EAAA,MAAM,GAAGA,gBAAe,CAAA,GAAI,kBAAA,EAAmB;AAE/C,EAAA,MAAM,WAAA,GAAc,YAAY,MAAM;AACpC,IAAAA,iBAAgB,IAAI,CAAA;AACpB,IAAA,OAAA,CAAQ,IAAI,CAAA;AAAA,EACd,CAAA,EAAG,CAAC,IAAA,EAAMA,gBAAe,CAAC,CAAA;AAE1B,EAAA,MAAM,WAAA,GAAc,YAAY,MAAM;AACpC,IAAA,OAAA,CAAQ,KAAK,CAAA;AAAA,EACf,CAAA,E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cesContent":["/*\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 { useState, useCallback } from 'react';\nimport { renderReactElement } from './renderReactElement';\nimport { ThemeProvider } from '@material-ui/core/styles';\nimport SvgIcon from '@material-ui/core/SvgIcon';\nimport Tooltip from '@material-ui/core/Tooltip';\nimport { withStyles, Theme } from '@material-ui/core/styles';\nimport IconButton from '@material-ui/core/IconButton';\nimport type { Transformer } from './transformer';\nimport useCopyToClipboard from 'react-use/esm/useCopyToClipboard';\n\nconst CopyToClipboardTooltip = withStyles(theme => ({\n tooltip: {\n fontSize: 'inherit',\n color: theme.palette.text.primary,\n margin: 0,\n padding: theme.spacing(0.5),\n backgroundColor: 'transparent',\n boxShadow: 'none',\n },\n}))(Tooltip);\n\nconst CopyToClipboardIcon = () => (\n <SvgIcon>\n <path d=\"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z\" />\n </SvgIcon>\n);\n\ntype CopyToClipboardButtonProps = {\n text: string;\n};\n\nconst CopyToClipboardButton = ({ text }: CopyToClipboardButtonProps) => {\n const [open, setOpen] = useState(false);\n const [, copyToClipboard] = useCopyToClipboard();\n\n const handleClick = useCallback(() => {\n copyToClipboard(text);\n setOpen(true);\n }, [text, copyToClipboard]);\n\n const handleClose = useCallback(() => {\n setOpen(false);\n }, [setOpen]);\n\n return (\n <CopyToClipboardTooltip\n title=\"Copied to clipboard\"\n placement=\"left\"\n open={open}\n onClose={handleClose}\n leaveDelay={1000}\n >\n <IconButton\n style={{\n position: 'absolute',\n // top & right was removed from upstream .md-clipboard in mkdocs-material 9.7.0\n top: '0.5rem',\n right: '0.5rem',\n }}\n className=\"md-clipboard md-icon\"\n onClick={handleClick}\n aria-label=\"Copy to clipboard\"\n >\n <CopyToClipboardIcon />\n </IconButton>\n </CopyToClipboardTooltip>\n );\n};\n\n/**\n * Recreates copy-to-clipboard functionality attached to <code> snippets that\n * is native to mkdocs-material theme.\n *\n * Unlike native mkdocs-material theme, this is always enabled and does not respect the mkdocs's config `theme.features` `content.code.copy` setting.\n */\nexport const copyToClipboard = (theme: Theme): Transformer => {\n return dom => {\n const codes = dom.querySelectorAll('pre > code');\n for (const code of codes) {\n const text = code.textContent || '';\n const container = document.createElement('div');\n code?.parentElement?.prepend(container);\n renderReactElement(\n <ThemeProvider theme={theme}>\n <CopyToClipboardButton text={text} />\n </ThemeProvider>,\n container,\n );\n }\n return dom;\n };\n};\n"],"names":["copyToClipboard"],"mappings":";;;;;;;;;AA0BA,MAAM,sBAAA,GAAyB,WAAW,CAAA,KAAA,MAAU;AAAA,EAClD,OAAA,EAAS;AAAA,IACP,QAAA,EAAU,SAAA;AAAA,IACV,KAAA,EAAO,KAAA,CAAM,OAAA,CAAQ,IAAA,CAAK,OAAA;AAAA,IAC1B,MAAA,EAAQ,CAAA;AAAA,IACR,OAAA,EAAS,KAAA,CAAM,OAAA,CAAQ,GAAG,CAAA;AAAA,IAC1B,eAAA,EAAiB,aAAA;AAAA,IACjB,SAAA,EAAW;AAAA;AAEf,CAAA,CAAE,EAAE,OAAO,CAAA;AAEX,MAAM,mBAAA,GAAsB,sBAC1B,GAAA,CAAC,OAAA,EAAA,EACC,8BAAC,MAAA,EAAA,EAAK,CAAA,EAAE,mIAAkI,CAAA,EAC5I,CAAA;AAOF,MAAM,qBAAA,GAAwB,CAAC,EAAE,IAAA,EAAK,KAAkC;AACtE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CA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,CAAc,KAAK,CAAA;AAC9C,MAAA,IAAA,EAAM,aAAA,EAAe,QAAQ,SAAS,CAAA;AACtC,MAAA,kBAAA;AAAA,4BACG,aAAA,EAAA,EAAc,KAAA,EACb,QAAA,kBAAA,GAAA,CAAC,qBAAA,EAAA,EAAsB,MAAY,CAAA,EACrC,CAAA;AAAA,QACA;AAAA,OACF;AAAA,IACF;AACA,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"handleMetaRedirects.esm.js","sources":["../../../src/reader/transformers/handleMetaRedirects.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { Transformer } from './transformer';\nimport { normalizeUrl } from './rewriteDocLinks';\nimport { renderReactElement } from './renderReactElement';\nimport { TechDocsRedirectNotification } from '../components/TechDocsRedirectNotification';\n\nexport const handleMetaRedirects = (\n navigate: (to: string) => void,\n entityName: string,\n): Transformer => {\n const redirectAfterMs = 3000;\n\n const determineRedirectURL = (metaUrl: string) => {\n const normalizedCurrentUrl = normalizeUrl(window.location.href);\n // When creating URL object, if the metaUrl is relative, it will be resolved with base href. If it is absolute, it will replace the base href.\n const absoluteRedirectObj = new URL(metaUrl, normalizedCurrentUrl);\n const isExternalRedirect =\n absoluteRedirectObj.hostname !== window.location.hostname;\n\n if (isExternalRedirect) {\n const currentTechDocPath = window.location.pathname;\n const indexOfSiteHome = currentTechDocPath.indexOf(entityName);\n const siteHomePath = currentTechDocPath.slice(\n 0,\n indexOfSiteHome + entityName.length,\n );\n return new URL(siteHomePath, normalizedCurrentUrl).href;\n }\n return absoluteRedirectObj.href;\n };\n\n return dom => {\n for (const elem of Array.from(dom.querySelectorAll('meta'))) {\n if (elem.getAttribute('http-equiv') === 'refresh') {\n const metaContentParameters = elem\n .getAttribute('content')\n ?.split('url=');\n\n if (!metaContentParameters || metaContentParameters.length < 2) {\n return dom;\n }\n\n const metaUrl = metaContentParameters[1];\n const redirectURL = determineRedirectURL(metaUrl);\n\n // If the current URL is the same as the redirect URL, do not proceed with the redirect.\n if (window.location.href === redirectURL) {\n return dom;\n }\n\n const container = document.createElement('div');\n\n renderReactElement(\n <TechDocsRedirectNotification\n message=\"This TechDocs page is no longer maintained. Will automatically redirect to the designated replacement.\"\n handleButtonClick={() => navigate(redirectURL)}\n autoHideDuration={redirectAfterMs}\n />,\n container,\n );\n document.body.appendChild(container);\n\n setTimeout(() => {\n navigate(redirectURL);\n }, redirectAfterMs);\n\n return dom;\n }\n }\n return dom;\n };\n};\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,mBAAA,GAAsB,CACjC,QAAA,EACA,UAAA,KACgB;AAChB,EAAA,MAAM,eAAA,GAAkB,GAAA;AAExB,EAAA,MAAM,oBAAA,GAAuB,CAAC,OAAA,KAAoB;AAChD,IAAA,MAAM,oBAAA,GAAuB,YAAA,CAAa,MAAA,CAAO,QAAA,CAAS,IAAI,CAAA;AAE9D,IAAA,MAAM,mBAAA,GAAsB,IAAI,GAAA,CAAI,OAAA,EAAS,oBAAoB,CAAA;AACjE,IAAA,MAAM,kBAAA,GACJ,mBAAA,CAAoB,QAAA,KAAa,MAAA,CAAO,QAAA,CAAS,QAAA;AAEnD,IAAA,IAAI,kBAAA,EAAoB;AACtB,MAAA,MAAM,kBAAA,GAAqB,OAAO,QAAA,CAAS,QAAA;AAC3C,MAAA,MAAM,eAAA,GAAkB,kBAAA,CAAmB,OAAA,CAAQ,UAAU,CAAA;AAC7D,MAAA,MAAM,eAAe,kBAAA,CAAmB,KAAA;AAAA,QACtC,CAAA;AAAA,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A;AAElB,QAAA,OAAO,GAAA;AAAA,MACT;AAAA,IACF;AACA,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"handleMetaRedirects.esm.js","sources":["../../../src/reader/transformers/handleMetaRedirects.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { Transformer } from './transformer';\nimport { normalizeUrl } from './rewriteDocLinks';\nimport { renderReactElement } from './renderReactElement';\nimport { TechDocsRedirectNotification } from '../components/TechDocsRedirectNotification';\n\nexport const handleMetaRedirects = (\n navigate: (to: string) => void,\n entityName: string,\n): Transformer => {\n const redirectAfterMs = 3000;\n\n const determineRedirectURL = (metaUrl: string) => {\n const normalizedCurrentUrl = normalizeUrl(window.location.href);\n // When creating URL object, if the metaUrl is relative, it will be resolved with base href. If it is absolute, it will replace the base href.\n const absoluteRedirectObj = new URL(metaUrl, normalizedCurrentUrl);\n const isExternalRedirect =\n absoluteRedirectObj.hostname !== window.location.hostname;\n\n if (isExternalRedirect) {\n const currentTechDocPath = window.location.pathname;\n const indexOfSiteHome = currentTechDocPath.indexOf(entityName);\n const siteHomePath = currentTechDocPath.slice(\n 0,\n indexOfSiteHome + entityName.length,\n );\n return new URL(siteHomePath, normalizedCurrentUrl).href;\n }\n return absoluteRedirectObj.href;\n };\n\n return dom => {\n for (const elem of Array.from(dom.querySelectorAll('meta'))) {\n if (elem.getAttribute('http-equiv') === 'refresh') {\n const metaContentParameters = elem\n .getAttribute('content')\n ?.split('url=');\n\n if (!metaContentParameters || metaContentParameters.length < 2) {\n return dom;\n }\n\n const metaUrl = metaContentParameters[1];\n const redirectURL = determineRedirectURL(metaUrl);\n\n // If the current URL is the same as the redirect URL, do not proceed with the redirect.\n if (window.location.href === redirectURL) {\n return dom;\n }\n\n const container = document.createElement('div');\n\n renderReactElement(\n <TechDocsRedirectNotification\n message=\"This TechDocs page is no longer maintained. Will automatically redirect to the designated replacement.\"\n handleButtonClick={() => navigate(redirectURL)}\n autoHideDuration={redirectAfterMs}\n />,\n container,\n );\n document.body.appendChild(container);\n\n setTimeout(() => {\n navigate(redirectURL);\n }, redirectAfterMs);\n\n return dom;\n }\n }\n return dom;\n };\n};\n"],"names":[],"mappings":";;;;;AAqBO,MAAM,mBAAA,GAAsB,CACjC,QAAA,EACA,UAAA,KACgB;AAChB,EAAA,MAAM,eAAA,GAAkB,GAAA;AAExB,EAAA,MAAM,oBAAA,GAAuB,CAAC,OAAA,KAAoB;AAChD,IAAA,MAAM,oBAAA,GAAuB,YAAA,CAAa,MAAA,CAAO,QAAA,CAAS,IAAI,CAAA;AAE9D,IAAA,MAAM,mBAAA,GAAsB,IAAI,GAAA,CAAI,OAAA,EAAS,oBAAoB,CAAA;AACjE,IAAA,MAAM,kBAAA,GACJ,mBAAA,CAAoB,QAAA,KAAa,MAAA,CAAO,QAAA,CAAS,QAAA;AAEnD,IAAA,IAAI,kBAAA,EAAoB;AACtB,MAAA,MAAM,kBAAA,GAAqB,OAAO,QAAA,CAAS,QAAA;AAC3C,MAAA,MAAM,eAAA,GAAkB,kBAAA,CAAmB,OAAA,CAAQ,UAAU,CAAA;AAC7D,MAAA,MAAM,eAAe,kBAAA,CAAmB,KAAA;AAAA,QACtC,CAAA;AAAA,QACA,kBAAkB,UAAA,CAAW;AAAA,OAC/B;AACA,MAAA,OAAO,IAAI,GAAA,CAAI,YAAA,EAAc,oBAAoB,CAAA,CAAE,IAAA;AAAA,IACrD;AACA,IAAA,OAAO,mBAAA,CAAoB,IAAA;AAAA,EAC7B,CAAA;AAEA,EAAA,OAAO,CAAA,GAAA,KAAO;AACZ,IAAA,KAAA,MAAW,QAAQ,KAAA,CAAM,IAAA,CAAK,IAAI,gBAAA,CAAiB,MAAM,CAAC,CAAA,EAAG;AAC3D,MAAA,IAAI,IAAA,CAAK,YAAA,CAAa,YAAY,CAAA,KAAM,SAAA,EAAW;AACjD,QAAA,MAAM,wBAAwB,IAAA,CAC3B,YAAA,CAAa,SAAS,CAAA,EACrB,MAAM,MAAM,CAAA;AAEhB,QAAA,IAAI,CAAC,qBAAA,IAAyB,qBAAA,CAAsB,MAAA,GAAS,CAAA,EAAG;AAC9D,UAAA,OAAO,GAAA;AAAA,QACT;AAEA,QAAA,MAAM,OAAA,GAAU,sBAAsB,CAAC,CAAA;AACvC,QAAA,MAAM,WAAA,GAAc,qBAAqB,OAAO,CAAA;AAGhD,QAAA,IAAI,MAAA,CAAO,QAAA,CAAS,IAAA,KAAS,WAAA,EAAa;AACxC,UAAA,OAAO,GAAA;AAAA,QACT;AAEA,QAAA,MAAM,SAAA,GAAY,QAAA,CAAS,aAAA,CAAc,KAAK,CAAA;AAE9C,QAAA,kBAAA;AAAA,0BACE,GAAA;AAAA,YAAC,4BAAA;AAAA,YAAA;AAAA,cACC,OAAA,EAAQ,wGAAA;AAAA,cACR,iBAAA,EAAmB,MAAM,QAAA,CAAS,WAAW,CAAA;AAAA,cAC7C,gBAAA,EAAkB;AAAA;AAAA,WACpB;AAAA,UACA;AAAA,SACF;AACA,QAAA,QAAA,CAAS,IAAA,CAAK,YAAY,SAAS,CAAA;AAEnC,QAAA,UAAA,CAAW,MAAM;AACf,UAAA,QAAA,CAAS,WAAW,CAAA;AAAA,QACtB,GAAG,eAAe,CAAA;AAElB,QAAA,OAAO,GAAA;AAAA,MACT;AAAA,IACF;AACA,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"attributes.esm.js","sources":["../../../../../src/reader/transformers/html/hooks/attributes.ts"],"sourcesContent":["/*\n * Copyright 2025 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 */\nimport { UponSanitizeAttributeHook } from 'dompurify';\n\n/**\n * Removes attributes that should only be present on meta tags from other elements.\n * This ensures that http-equiv and content attributes are only allowed on meta tags\n * where they are required for the redirect feature.\n */\nexport const removeRestrictedAttributes: UponSanitizeAttributeHook = (\n node,\n data,\n) => {\n if (node.tagName !== 'META') {\n if (data.attrName === 'http-equiv' || data.attrName === 'content') {\n node.removeAttribute(data.attrName);\n }\n }\n};\n"],"names":[],"mappings":"AAsBO,MAAM,0BAAA,GAAwD,CACnE,IAAA,EACA,IAAA,KACG;AACH,EAAA,IAAI,IAAA,CAAK,YAAY,MAAA,EAAQ;AAC3B,IAAA,IAAI,IAAA,CAAK,QAAA,KAAa,YAAA,IAAgB,IAAA,CAAK,aAAa,SAAA,EAAW;AACjE,MAAA,IAAA,CAAK,eAAA,CAAgB,KAAK,QAAQ,CAAA;AAAA,IACpC;AAAA,EACF;AACF;;;;"}
1
+ {"version":3,"file":"attributes.esm.js","sources":["../../../../../src/reader/transformers/html/hooks/attributes.ts"],"sourcesContent":["/*\n * Copyright 2025 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 */\nimport { UponSanitizeAttributeHook } from 'dompurify';\n\n/**\n * Removes attributes that should only be present on meta tags from other elements.\n * This ensures that http-equiv and content attributes are only allowed on meta tags\n * where they are required for the redirect feature.\n */\nexport const removeRestrictedAttributes: UponSanitizeAttributeHook = (\n node,\n data,\n) => {\n if (node.tagName !== 'META') {\n if (data.attrName === 'http-equiv' || data.attrName === 'content') {\n node.removeAttribute(data.attrName);\n }\n }\n};\n"],"names":[],"mappings":"AAsBO,MAAM,0BAAA,GAAwD,CACnE,IAAA,EACA,IAAA,KACG;AACH,EAAA,IAAI,IAAA,CAAK,YAAY,MAAA,EAAQ;AAC3B,IAAA,IAAI,IAAA,CAAK,QAAA,KAAa,YAAA,IAAgB,IAAA,CAAK,aAAa,SAAA,EAAW;AACjE,MAAA,IAAA,CAAK,eAAA,CAAgB,KAAK,QAAQ,CAAA;AAAA,IACpC;AAAA,EACF;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"iframes.esm.js","sources":["../../../../../src/reader/transformers/html/hooks/iframes.ts"],"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 { isElement } from '../utils';\n\n/**\n * Checks whether a node is iframe or not.\n * @param node - can be any element.\n * @returns true when node is iframe.\n */\nconst isIframe = (node: Element) => node.nodeName === 'IFRAME';\n\n/**\n * Checks whether a iframe is safe or not.\n * @param node - is an iframe element.\n * @param hosts - list of allowed hosts.\n * @returns true when iframe is included in hosts.\n */\nconst isSafe = (node: Element, hosts: string[]) => {\n const src = node.getAttribute('src') || '';\n try {\n const { host } = new URL(src);\n return hosts.includes(host);\n } catch {\n return false;\n }\n};\n\n/**\n * Returns a function that removes unsafe iframe nodes.\n * @param node - can be any element.\n * @param hosts - list of allowed hosts.\n */\nexport const removeUnsafeIframes = (hosts: string[]) => (node: Node) => {\n if (!isElement(node)) return;\n\n if (isIframe(node) && !isSafe(node, hosts)) {\n node.remove();\n }\n};\n"],"names":[],"mappings":";;AAuBA,MAAM,QAAA,GAAW,CAAC,IAAA,KAAkB,IAAA,CAAK,QAAA,KAAa,QAAA;AAQtD,MAAM,MAAA,GAAS,CAAC,IAAA,EAAe,KAAA,KAAoB;AACjD,EAAA,MAAM,GAAA,GAAM,IAAA,CAAK,YAAA,CAAa,KAAK,CAAA,IAAK,EAAA;AACxC,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,IAAI,IAAI,GAAG,CAAA;AAC5B,IAAA,OAAO,KAAA,CAAM,SAAS,IAAI,CAAA;AAAA,EAC5B,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF,CAAA;AAOO,MAAM,mBAAA,GAAsB,CAAC,KAAA,KAAoB,CAAC,IAAA,KAAe;AACtE,EAAA,IAAI,CAAC,SAAA,CAAU,IAAI,CAAA,EAAG;AAEtB,EAAA,IAAI,SAAS,IAAI,CAAA,IAAK,CAAC,MAAA,CAAO,IAAA,EAAM,KAAK,CAAA,EAAG;AAC1C,IAAA,IAAA,CAAK,MAAA,EAAO;AAAA,EACd;AACF;;;;"}
1
+ {"version":3,"file":"iframes.esm.js","sources":["../../../../../src/reader/transformers/html/hooks/iframes.ts"],"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 { isElement } from '../utils';\n\n/**\n * Checks whether a node is iframe or not.\n * @param node - can be any element.\n * @returns true when node is iframe.\n */\nconst isIframe = (node: Element) => node.nodeName === 'IFRAME';\n\n/**\n * Checks whether a iframe is safe or not.\n * @param node - is an iframe element.\n * @param hosts - list of allowed hosts.\n * @returns true when iframe is included in hosts.\n */\nconst isSafe = (node: Element, hosts: string[]) => {\n const src = node.getAttribute('src') || '';\n try {\n const { host } = new URL(src);\n return hosts.includes(host);\n } catch {\n return false;\n }\n};\n\n/**\n * Returns a function that removes unsafe iframe nodes.\n * @param node - can be any element.\n * @param hosts - list of allowed hosts.\n */\nexport const removeUnsafeIframes = (hosts: string[]) => (node: Node) => {\n if (!isElement(node)) return;\n\n if (isIframe(node) && !isSafe(node, hosts)) {\n node.remove();\n }\n};\n"],"names":[],"mappings":";;AAuBA,MAAM,QAAA,GAAW,CAAC,IAAA,KAAkB,IAAA,CAAK,QAAA,KAAa,QAAA;AAQtD,MAAM,MAAA,GAAS,CAAC,IAAA,EAAe,KAAA,KAAoB;AACjD,EAAA,MAAM,GAAA,GAAM,IAAA,CAAK,YAAA,CAAa,KAAK,CAAA,IAAK,EAAA;AACxC,EAAA,IAAI;AACF,IAAA,MAAM,EAAE,IAAA,EAAK,GAAI,IAAI,IAAI,GAAG,CAAA;AAC5B,IAAA,OAAO,KAAA,CAAM,SAAS,IAAI,CAAA;AAAA,EAC5B,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,KAAA;AAAA,EACT;AACF,CAAA;AAOO,MAAM,mBAAA,GAAsB,CAAC,KAAA,KAAoB,CAAC,IAAA,KAAe;AACtE,EAAA,IAAI,CAAC,SAAA,CAAU,IAAI,CAAA,EAAG;AAEtB,EAAA,IAAI,SAAS,IAAI,CAAA,IAAK,CAAC,MAAA,CAAO,IAAA,EAAM,KAAK,CAAA,EAAG;AAC1C,IAAA,IAAA,CAAK,MAAA,EAAO;AAAA,EACd;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"links.esm.js","sources":["../../../../../src/reader/transformers/html/hooks/links.ts"],"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 { isElement } from '../utils';\n\nconst MKDOCS_CSS = /main\\.[A-Fa-f0-9]{8}\\.min\\.css$/;\nconst GOOGLE_FONTS = /^https:\\/\\/fonts\\.googleapis\\.com/;\nconst GSTATIC_FONTS = /^https:\\/\\/fonts\\.gstatic\\.com/;\n\n/**\n * Checks whether a node is link or not.\n * @param node - can be any element.\n * @returns true when node is link.\n */\nconst isLink = (node: Element) => node.nodeName === 'LINK';\n\n/**\n * Checks whether a link is safe or not.\n * @param node - is an link element.\n * @returns true when link is mkdocs css, google fonts or gstatic fonts.\n */\nconst isSafe = (node: Element) => {\n const href = node?.getAttribute('href') || '';\n const isMkdocsCss = href.match(MKDOCS_CSS);\n const isGoogleFonts = href.match(GOOGLE_FONTS);\n const isGstaticFonts = href.match(GSTATIC_FONTS);\n return isMkdocsCss || isGoogleFonts || isGstaticFonts;\n};\n\n/**\n * Function that removes unsafe link nodes.\n * @param node - can be any element.\n */\nexport const removeUnsafeLinks = (node: Node) => {\n if (!isElement(node)) return;\n\n if (isLink(node) && !isSafe(node)) {\n node.remove();\n }\n};\n"],"names":[],"mappings":";;AAkBA,MAAM,UAAA,GAAa,iCAAA;AACnB,MAAM,YAAA,GAAe,mCAAA;AACrB,MAAM,aAAA,GAAgB,gCAAA;AAOtB,MAAM,MAAA,GAAS,CAAC,IAAA,KAAkB,IAAA,CAAK,QAAA,KAAa,MAAA;AAOpD,MAAM,MAAA,GAAS,CAAC,IAAA,KAAkB;AAChC,EAAA,MAAM,IAAA,GAAO,IAAA,EAAM,YAAA,CAAa,MAAM,CAAA,IAAK,EAAA;AAC3C,EAAA,MAAM,WAAA,GAAc,IAAA,CAAK,KAAA,CAAM,UAAU,CAAA;AACzC,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,KAAA,CAAM,YAAY,CAAA;AAC7C,EAAA,MAAM,cAAA,GAAiB,IAAA,CAAK,KAAA,CAAM,aAAa,CAAA;AAC/C,EAAA,OAAO,eAAe,aAAA,IAAiB,cAAA;AACzC,CAAA;AAMO,MAAM,iBAAA,GAAoB,CAAC,IAAA,KAAe;AAC/C,EAAA,IAAI,CAAC,SAAA,CAAU,IAAI,CAAA,EAAG;AAEtB,EAAA,IAAI,OAAO,IAAI,CAAA,IAAK,CAAC,MAAA,CAAO,IAAI,CAAA,EAAG;AACjC,IAAA,IAAA,CAAK,MAAA,EAAO;AAAA,EACd;AACF;;;;"}
1
+ {"version":3,"file":"links.esm.js","sources":["../../../../../src/reader/transformers/html/hooks/links.ts"],"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 { isElement } from '../utils';\n\nconst MKDOCS_CSS = /main\\.[A-Fa-f0-9]{8}\\.min\\.css$/;\nconst GOOGLE_FONTS = /^https:\\/\\/fonts\\.googleapis\\.com/;\nconst GSTATIC_FONTS = /^https:\\/\\/fonts\\.gstatic\\.com/;\n\n/**\n * Checks whether a node is link or not.\n * @param node - can be any element.\n * @returns true when node is link.\n */\nconst isLink = (node: Element) => node.nodeName === 'LINK';\n\n/**\n * Checks whether a link is safe or not.\n * @param node - is an link element.\n * @returns true when link is mkdocs css, google fonts or gstatic fonts.\n */\nconst isSafe = (node: Element) => {\n const href = node?.getAttribute('href') || '';\n const isMkdocsCss = href.match(MKDOCS_CSS);\n const isGoogleFonts = href.match(GOOGLE_FONTS);\n const isGstaticFonts = href.match(GSTATIC_FONTS);\n return isMkdocsCss || isGoogleFonts || isGstaticFonts;\n};\n\n/**\n * Function that removes unsafe link nodes.\n * @param node - can be any element.\n */\nexport const removeUnsafeLinks = (node: Node) => {\n if (!isElement(node)) return;\n\n if (isLink(node) && !isSafe(node)) {\n node.remove();\n }\n};\n"],"names":[],"mappings":";;AAkBA,MAAM,UAAA,GAAa,iCAAA;AACnB,MAAM,YAAA,GAAe,mCAAA;AACrB,MAAM,aAAA,GAAgB,gCAAA;AAOtB,MAAM,MAAA,GAAS,CAAC,IAAA,KAAkB,IAAA,CAAK,QAAA,KAAa,MAAA;AAOpD,MAAM,MAAA,GAAS,CAAC,IAAA,KAAkB;AAChC,EAAA,MAAM,IAAA,GAAO,IAAA,EAAM,YAAA,CAAa,MAAM,CAAA,IAAK,EAAA;AAC3C,EAAA,MAAM,WAAA,GAAc,IAAA,CAAK,KAAA,CAAM,UAAU,CAAA;AACzC,EAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,KAAA,CAAM,YAAY,CAAA;AAC7C,EAAA,MAAM,cAAA,GAAiB,IAAA,CAAK,KAAA,CAAM,aAAa,CAAA;AAC/C,EAAA,OAAO,eAAe,aAAA,IAAiB,cAAA;AACzC,CAAA;AAMO,MAAM,iBAAA,GAAoB,CAAC,IAAA,KAAe;AAC/C,EAAA,IAAI,CAAC,SAAA,CAAU,IAAI,CAAA,EAAG;AAEtB,EAAA,IAAI,OAAO,IAAI,CAAA,IAAK,CAAC,MAAA,CAAO,IAAI,CAAA,EAAG;AACjC,IAAA,IAAA,CAAK,MAAA,EAAO;AAAA,EACd;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"metatags.esm.js","sources":["../../../../../src/reader/transformers/html/hooks/metatags.ts"],"sourcesContent":["/*\n * Copyright 2025 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 */\nimport { UponSanitizeElementHook } from 'dompurify';\nimport { isElement } from '../utils';\n\n/**\n * Checks if a meta tag is a refresh redirect tag that should be allowed.\n * These tags are required for the TechDocs redirect feature.\n */\nconst isAllowedMetaRefreshTag = (element: Element): boolean => {\n const httpEquiv = element.getAttribute('http-equiv');\n const content = element.getAttribute('content');\n\n return httpEquiv === 'refresh' && content?.includes('url=') === true;\n};\n\n/**\n * Removes unsafe meta tags from the DOM while preserving allowed refresh redirect tags.\n * Only meta tags used for page refreshing/redirects are allowed as they are required\n * for the TechDocs redirect feature.\n */\nexport const removeUnsafeMetaTags: UponSanitizeElementHook = (node, data) => {\n if (!isElement(node)) return;\n\n if (data.tagName === 'meta' && !isAllowedMetaRefreshTag(node)) {\n node.parentNode?.removeChild(node);\n }\n};\n"],"names":[],"mappings":";;AAsBA,MAAM,uBAAA,GAA0B,CAAC,OAAA,KAA8B;AAC7D,EAAA,MAAM,SAAA,GAAY,OAAA,CAAQ,YAAA,CAAa,YAAY,CAAA;AACnD,EAAA,MAAM,OAAA,GAAU,OAAA,CAAQ,YAAA,CAAa,SAAS,CAAA;AAE9C,EAAA,OAAO,SAAA,KAAc,SAAA,IAAa,OAAA,EAAS,QAAA,CAAS,MAAM,CAAA,KAAM,IAAA;AAClE,CAAA;AAOO,MAAM,oBAAA,GAAgD,CAAC,IAAA,EAAM,IAAA,KAAS;AAC3E,EAAA,IAAI,CAAC,SAAA,CAAU,IAAI,CAAA,EAAG;AAEtB,EAAA,IAAI,KAAK,OAAA,KAAY,MAAA,IAAU,CAAC,uBAAA,CAAwB,IAAI,CAAA,EAAG;AAC7D,IAAA,IAAA,CAAK,UAAA,EAAY,YAAY,IAAI,CAAA;AAAA,EACnC;AACF;;;;"}
1
+ {"version":3,"file":"metatags.esm.js","sources":["../../../../../src/reader/transformers/html/hooks/metatags.ts"],"sourcesContent":["/*\n * Copyright 2025 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 */\nimport { UponSanitizeElementHook } from 'dompurify';\nimport { isElement } from '../utils';\n\n/**\n * Checks if a meta tag is a refresh redirect tag that should be allowed.\n * These tags are required for the TechDocs redirect feature.\n */\nconst isAllowedMetaRefreshTag = (element: Element): boolean => {\n const httpEquiv = element.getAttribute('http-equiv');\n const content = element.getAttribute('content');\n\n return httpEquiv === 'refresh' && content?.includes('url=') === true;\n};\n\n/**\n * Removes unsafe meta tags from the DOM while preserving allowed refresh redirect tags.\n * Only meta tags used for page refreshing/redirects are allowed as they are required\n * for the TechDocs redirect feature.\n */\nexport const removeUnsafeMetaTags: UponSanitizeElementHook = (node, data) => {\n if (!isElement(node)) return;\n\n if (data.tagName === 'meta' && !isAllowedMetaRefreshTag(node)) {\n node.parentNode?.removeChild(node);\n }\n};\n"],"names":[],"mappings":";;AAsBA,MAAM,uBAAA,GAA0B,CAAC,OAAA,KAA8B;AAC7D,EAAA,MAAM,SAAA,GAAY,OAAA,CAAQ,YAAA,CAAa,YAAY,CAAA;AACnD,EAAA,MAAM,OAAA,GAAU,OAAA,CAAQ,YAAA,CAAa,SAAS,CAAA;AAE9C,EAAA,OAAO,SAAA,KAAc,SAAA,IAAa,OAAA,EAAS,QAAA,CAAS,MAAM,CAAA,KAAM,IAAA;AAClE,CAAA;AAOO,MAAM,oBAAA,GAAgD,CAAC,IAAA,EAAM,IAAA,KAAS;AAC3E,EAAA,IAAI,CAAC,SAAA,CAAU,IAAI,CAAA,EAAG;AAEtB,EAAA,IAAI,KAAK,OAAA,KAAY,MAAA,IAAU,CAAC,uBAAA,CAAwB,IAAI,CAAA,EAAG;AAC7D,IAAA,IAAA,CAAK,UAAA,EAAY,YAAY,IAAI,CAAA;AAAA,EACnC;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"transformer.esm.js","sources":["../../../../src/reader/transformers/html/transformer.ts"],"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 DOMPurify from 'dompurify';\nimport { useCallback, useMemo } from 'react';\n\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\n\nimport { Transformer } from '../transformer';\nimport {\n removeRestrictedAttributes,\n removeUnsafeIframes,\n removeUnsafeLinks,\n removeUnsafeMetaTags,\n} from './hooks';\n\n/**\n * Returns html sanitizer configuration\n */\nconst useSanitizerConfig = () => {\n const configApi = useApi(configApiRef);\n\n return useMemo(() => {\n return configApi.getOptionalConfig('techdocs.sanitizer');\n }, [configApi]);\n};\n\n/**\n * Returns a transformer that sanitizes the dom\n */\nexport const useSanitizerTransformer = (): Transformer => {\n const config = useSanitizerConfig();\n\n const purify = useMemo(() => {\n // eslint-disable-next-line new-cap\n const instance = DOMPurify();\n\n instance.addHook('beforeSanitizeElements', removeUnsafeLinks);\n\n const hosts = config?.getOptionalStringArray('allowedIframeHosts');\n if (hosts) {\n instance.addHook('beforeSanitizeElements', removeUnsafeIframes(hosts));\n }\n\n instance.addHook('uponSanitizeElement', removeUnsafeMetaTags);\n\n instance.addHook('uponSanitizeAttribute', removeRestrictedAttributes);\n\n return instance;\n }, [config]);\n\n return useCallback(\n async (dom: Element) => {\n const hosts = config?.getOptionalStringArray('allowedIframeHosts');\n const tags = ['link', 'meta'];\n\n if (hosts) {\n tags.push('iframe');\n }\n\n const tagNameCheck = config?.getOptionalString(\n 'allowedCustomElementTagNameRegExp',\n );\n const attributeNameCheck = config?.getOptionalString(\n 'allowedCustomElementAttributeNameRegExp',\n );\n const additionalAllowedURIProtocols =\n config?.getOptionalStringArray('additionalAllowedURIProtocols') || [];\n\n // Define allowed URI protocols, including any additional ones from the config.\n // The default protocols are based on the DOMPurify defaults.\n const allowedURIProtocols = [\n 'callto',\n 'cid',\n 'ftp',\n 'ftps',\n 'http',\n 'https',\n 'mailto',\n 'matrix',\n 'sms',\n 'tel',\n 'xmpp',\n ...additionalAllowedURIProtocols,\n ].filter(Boolean);\n\n const allowedURIRegExp = new RegExp(\n // This regex is not exposed by DOMPurify, so we need to define it ourselves.\n // It is possible for this to drift from the default in future versions of DOMPurify.\n // See: https://raw.githubusercontent.com/cure53/DOMPurify/master/src/regexp.ts\n `^(?:${allowedURIProtocols.join(\n '|',\n )}:|[^a-z]|[a-z+.-]+(?:[^a-z+.\\\\-:]|$))`,\n 'i',\n );\n\n // using outerHTML as we want to preserve the html tag attributes (lang)\n return purify.sanitize(dom.outerHTML, {\n ADD_TAGS: tags,\n FORBID_TAGS: ['style'],\n ADD_ATTR: ['http-equiv', 'content', 'dominant-baseline'],\n WHOLE_DOCUMENT: true,\n RETURN_DOM: true,\n ALLOWED_URI_REGEXP: allowedURIRegExp,\n CUSTOM_ELEMENT_HANDLING: {\n tagNameCheck: tagNameCheck ? new RegExp(tagNameCheck) : undefined,\n attributeNameCheck: att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ader/transformers/html/transformer.ts"],"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 DOMPurify from 'dompurify';\nimport { useCallback, useMemo } from 'react';\n\nimport { configApiRef, useApi } from '@backstage/core-plugin-api';\n\nimport { Transformer } from '../transformer';\nimport {\n removeRestrictedAttributes,\n removeUnsafeIframes,\n removeUnsafeLinks,\n removeUnsafeMetaTags,\n} from './hooks';\n\n/**\n * Returns html sanitizer configuration\n */\nconst useSanitizerConfig = () => {\n const configApi = useApi(configApiRef);\n\n return useMemo(() => {\n return configApi.getOptionalConfig('techdocs.sanitizer');\n }, [configApi]);\n};\n\n/**\n * Returns a transformer that sanitizes the dom\n */\nexport const useSanitizerTransformer = (): Transformer => {\n const config = useSanitizerConfig();\n\n const purify = useMemo(() => {\n // eslint-disable-next-line new-cap\n const instance = DOMPurify();\n\n instance.addHook('beforeSanitizeElements', removeUnsafeLinks);\n\n const hosts = config?.getOptionalStringArray('allowedIframeHosts');\n if (hosts) {\n instance.addHook('beforeSanitizeElements', removeUnsafeIframes(hosts));\n }\n\n instance.addHook('uponSanitizeElement', removeUnsafeMetaTags);\n\n instance.addHook('uponSanitizeAttribute', removeRestrictedAttributes);\n\n return instance;\n }, [config]);\n\n return useCallback(\n async (dom: Element) => {\n const hosts = config?.getOptionalStringArray('allowedIframeHosts');\n const tags = ['link', 'meta'];\n\n if (hosts) {\n tags.push('iframe');\n }\n\n const tagNameCheck = config?.getOptionalString(\n 'allowedCustomElementTagNameRegExp',\n );\n const attributeNameCheck = config?.getOptionalString(\n 'allowedCustomElementAttributeNameRegExp',\n );\n const additionalAllowedURIProtocols =\n config?.getOptionalStringArray('additionalAllowedURIProtocols') || [];\n\n // Define allowed URI protocols, including any additional ones from the config.\n // The default protocols are based on the DOMPurify defaults.\n const allowedURIProtocols = [\n 'callto',\n 'cid',\n 'ftp',\n 'ftps',\n 'http',\n 'https',\n 'mailto',\n 'matrix',\n 'sms',\n 'tel',\n 'xmpp',\n ...additionalAllowedURIProtocols,\n ].filter(Boolean);\n\n const allowedURIRegExp = new RegExp(\n // This regex is not exposed by DOMPurify, so we need to define it ourselves.\n // It is possible for this to drift from the default in future versions of DOMPurify.\n // See: https://raw.githubusercontent.com/cure53/DOMPurify/master/src/regexp.ts\n `^(?:${allowedURIProtocols.join(\n '|',\n )}:|[^a-z]|[a-z+.-]+(?:[^a-z+.\\\\-:]|$))`,\n 'i',\n );\n\n // using outerHTML as we want to preserve the html tag attributes (lang)\n return purify.sanitize(dom.outerHTML, {\n ADD_TAGS: tags,\n FORBID_TAGS: ['style'],\n ADD_ATTR: ['http-equiv', 'content', 'dominant-baseline'],\n WHOLE_DOCUMENT: true,\n RETURN_DOM: true,\n ALLOWED_URI_REGEXP: allowedURIRegExp,\n CUSTOM_ELEMENT_HANDLING: {\n tagNameCheck: tagNameCheck ? new RegExp(tagNameCheck) : undefined,\n attributeNameCheck: attributeNameCheck\n ? new RegExp(attributeNameCheck)\n : undefined,\n },\n }) as Element;\n },\n [config, purify],\n );\n};\n"],"names":[],"mappings":";;;;;;;;AAgCA,MAAM,qBAAqB,MAAM;AAC/B,EAAA,MAAM,SAAA,GAAY,OAAO,YAAY,CAAA;AAErC,EAAA,OAAO,QAAQ,MAAM;AACnB,IAAA,OAAO,SAAA,CAAU,kBAAkB,oBAAoB,CAAA;AAAA,EACzD,CAAA,EAAG,CAAC,SAAS,CAAC,CAAA;AAChB,CAAA;AAKO,MAAM,0BAA0B,MAAmB;AACxD,EAAA,MAAM,SAAS,kBAAA,EAAmB;AAElC,EAAA,MAAM,MAAA,GAAS,QAAQ,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ACL,CAAE,OAAO,OAAO,CAAA;AAEhB,MAAA,MAAM,mBAAmB,IAAI,MAAA;AAAA;AAAA;AAAA;AAAA,QAI3B,OAAO,mBAAA,CAAoB,IAAA;AAAA,UACzB;AAAA,SACD,CAAA,qCAAA,CAAA;AAAA,QACD;AAAA,OACF;AAGA,MAAA,OAAO,MAAA,CAAO,QAAA,CAAS,GAAA,CAAI,SAAA,EAAW;AAAA,QACpC,QAAA,EAAU,IAAA;AAAA,QACV,WAAA,EAAa,CAAC,OAAO,CAAA;AAAA,QACrB,QAAA,EAAU,CAAC,YAAA,EAAc,SAAA,EAAW,mBAAmB,CAAA;AAAA,QACvD,cAAA,EAAgB,IAAA;AAAA,QAChB,UAAA,EAAY,IAAA;AAAA,QACZ,kBAAA,EAAoB,gBAAA;AAAA,QACpB,uBAAA,EAAyB;AAAA,UACvB,YAAA,EAAc,YAAA,GAAe,IAAI,MAAA,CAAO,YAAY,CAAA,GAAI,MAAA;AAAA,UACxD,kBAAA,EAAoB,kBAAA,GAChB,IAAI,MAAA,CAAO,kBAAkB,CAAA,GAC7B;AAAA;AACN,OACD,CAAA;AAAA,IACH,CAAA;AAAA,IACA,CAAC,QAAQ,MAAM;AAAA,GACjB;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.esm.js","sources":["../../../../src/reader/transformers/html/utils.ts"],"sourcesContent":["/*\n * Copyright 2025 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 const isElement = (node: Node): node is Element => {\n return node.nodeType === Node.ELEMENT_NODE;\n};\n"],"names":[],"mappings":"AAgBO,MAAM,SAAA,GAAY,CAAC,IAAA,KAAgC;AACxD,EAAA,OAAO,IAAA,CAAK,aAAa,IAAA,CAAK,YAAA;AAChC;;;;"}
1
+ {"version":3,"file":"utils.esm.js","sources":["../../../../src/reader/transformers/html/utils.ts"],"sourcesContent":["/*\n * Copyright 2025 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 const isElement = (node: Node): node is Element => {\n return node.nodeType === Node.ELEMENT_NODE;\n};\n"],"names":[],"mappings":"AAgBO,MAAM,SAAA,GAAY,CAAC,IAAA,KAAgC;AACxD,EAAA,OAAO,IAAA,CAAK,aAAa,IAAA,CAAK,YAAA;AAChC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"onCssReady.esm.js","sources":["../../../src/reader/transformers/onCssReady.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 { SHADOW_DOM_STYLE_LOAD_EVENT } from '@backstage/plugin-techdocs-react';\nimport type { Transformer } from './transformer';\n\ntype OnCssReadyOptions = {\n onLoading: () => void;\n onLoaded: () => void;\n};\n\nexport const onCssReady = ({\n onLoading,\n onLoaded,\n}: OnCssReadyOptions): Transformer => {\n return dom => {\n onLoading();\n dom.addEventListener(\n SHADOW_DOM_STYLE_LOAD_EVENT,\n function handleShadowDomStyleLoad() {\n onLoaded();\n dom.removeEventListener(\n SHADOW_DOM_STYLE_LOAD_EVENT,\n handleShadowDomStyleLoad,\n );\n },\n );\n return dom;\n };\n};\n"],"names":[],"mappings":";;AAwBO,MAAM,aAAa,CAAC;AAAA,EACzB,SAAA;AAAA,EACA;AACF,CAAA,KAAsC;AACpC,EAAA,OAAO,CAAA,GAAA,KAAO;AACZ,IAAA,SAAA,EAAU;AACV,IAAA,GAAA,CAAI,gBAAA;AAAA,MACF,2BAAA;AAAA,MACA,SAAS,wBAAA,GAA2B;AAClC,QAAA,QAAA,EAAS;AACT,QAAA,GAAA,CAAI,mBAAA;AAAA,UACF,2BAAA;AAAA,UACA;AAAA,SACF;AAAA,MACF;AAAA,KACF;AACA,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"onCssReady.esm.js","sources":["../../../src/reader/transformers/onCssReady.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 { SHADOW_DOM_STYLE_LOAD_EVENT } from '@backstage/plugin-techdocs-react';\nimport type { Transformer } from './transformer';\n\ntype OnCssReadyOptions = {\n onLoading: () => void;\n onLoaded: () => void;\n};\n\nexport const onCssReady = ({\n onLoading,\n onLoaded,\n}: OnCssReadyOptions): Transformer => {\n return dom => {\n onLoading();\n dom.addEventListener(\n SHADOW_DOM_STYLE_LOAD_EVENT,\n function handleShadowDomStyleLoad() {\n onLoaded();\n dom.removeEventListener(\n SHADOW_DOM_STYLE_LOAD_EVENT,\n handleShadowDomStyleLoad,\n );\n },\n );\n return dom;\n };\n};\n"],"names":[],"mappings":";;AAwBO,MAAM,aAAa,CAAC;AAAA,EACzB,SAAA;AAAA,EACA;AACF,CAAA,KAAsC;AACpC,EAAA,OAAO,CAAA,GAAA,KAAO;AACZ,IAAA,SAAA,EAAU;AACV,IAAA,GAAA,CAAI,gBAAA;AAAA,MACF,2BAAA;AAAA,MACA,SAAS,wBAAA,GAA2B;AAClC,QAAA,QAAA,EAAS;AACT,QAAA,GAAA,CAAI,mBAAA;AAAA,UACF,2BAAA;AAAA,UACA;AAAA,SACF;AAAA,MACF;AAAA,KACF;AACA,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"removeMkdocsHeader.esm.js","sources":["../../../src/reader/transformers/removeMkdocsHeader.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 type { Transformer } from './transformer';\n\nexport const removeMkdocsHeader = (): Transformer => {\n return dom => {\n // Remove the header\n dom.querySelector('.md-header')?.remove();\n\n return dom;\n };\n};\n"],"names":[],"mappings":"AAkBO,MAAM,qBAAqB,MAAmB;AACnD,EAAA,OAAO,CAAA,GAAA,KAAO;AAEZ,IAAA,GAAA,CAAI,aAAA,CAAc,YAAY,CAAA,EAAG,MAAA,EAAO;AAExC,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"removeMkdocsHeader.esm.js","sources":["../../../src/reader/transformers/removeMkdocsHeader.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 type { Transformer } from './transformer';\n\nexport const removeMkdocsHeader = (): Transformer => {\n return dom => {\n // Remove the header\n dom.querySelector('.md-header')?.remove();\n\n return dom;\n };\n};\n"],"names":[],"mappings":"AAkBO,MAAM,qBAAqB,MAAmB;AACnD,EAAA,OAAO,CAAA,GAAA,KAAO;AAEZ,IAAA,GAAA,CAAI,aAAA,CAAc,YAAY,CAAA,EAAG,MAAA,EAAO;AAExC,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"renderReactElement.esm.js","sources":["../../../src/reader/transformers/renderReactElement.ts"],"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\nlet ReactDOMPromise: Promise<\n typeof import('react-dom') | typeof import('react-dom/client')\n>;\nif (process.env.HAS_REACT_DOM_CLIENT) {\n ReactDOMPromise = import('react-dom/client');\n} else {\n ReactDOMPromise = import('react-dom');\n}\n\n/** @internal */\nexport function renderReactElement(element: JSX.Element, root: HTMLElement) {\n ReactDOMPromise.then(ReactDOM => {\n if ('createRoot' in ReactDOM) {\n ReactDOM.createRoot(root).render(element);\n } else {\n ReactDOM.render(element, root);\n }\n });\n}\n"],"names":[],"mappings":"AAgBA,IAAI,eAAA;AAGJ,IAAI,OAAA,CAAQ,IAAI,oBAAA,EAAsB;AACpC,EAAA,eAAA,GAAkB,OAAO,kBAAkB,CAAA;AAC7C,CAAA,MAAO;AACL,EAAA,eAAA,GAAkB,OAAO,WAAW,CAAA;AACtC;AAGO,SAAS,kBAAA,CAAmB,SAAsB,IAAA,EAAmB;AAC1E,EAAA,eAAA,CAAgB,KAAK,CAAA,QAAA,KAAY;AAC/B,IAAA,IAAI,gBAAgB,QAAA,EAAU;AAC5B,MAAA,QAAA,CAAS,UAAA,CAAW,IAAI,CAAA,CAAE,MAAA,CAAO,OAAO,CAAA;AAAA,IAC1C,CAAA,MAAO;AACL,MAAA,QAAA,CAAS,MAAA,CAAO,SAAS,IAAI,CAAA;AAAA,IAC/B;AAAA,EACF,CAAC,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"renderReactElement.esm.js","sources":["../../../src/reader/transformers/renderReactElement.ts"],"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\nlet ReactDOMPromise: Promise<\n typeof import('react-dom') | typeof import('react-dom/client')\n>;\nif (process.env.HAS_REACT_DOM_CLIENT) {\n ReactDOMPromise = import('react-dom/client');\n} else {\n ReactDOMPromise = import('react-dom');\n}\n\n/** @internal */\nexport function renderReactElement(element: JSX.Element, root: HTMLElement) {\n ReactDOMPromise.then(ReactDOM => {\n if ('createRoot' in ReactDOM) {\n ReactDOM.createRoot(root).render(element);\n } else {\n ReactDOM.render(element, root);\n }\n });\n}\n"],"names":[],"mappings":"AAgBA,IAAI,eAAA;AAGJ,IAAI,OAAA,CAAQ,IAAI,oBAAA,EAAsB;AACpC,EAAA,eAAA,GAAkB,OAAO,kBAAkB,CAAA;AAC7C,CAAA,MAAO;AACL,EAAA,eAAA,GAAkB,OAAO,WAAW,CAAA;AACtC;AAGO,SAAS,kBAAA,CAAmB,SAAsB,IAAA,EAAmB;AAC1E,EAAA,eAAA,CAAgB,KAAK,CAAA,QAAA,KAAY;AAC/B,IAAA,IAAI,gBAAgB,QAAA,EAAU;AAC5B,MAAA,QAAA,CAAS,UAAA,CAAW,IAAI,CAAA,CAAE,MAAA,CAAO,OAAO,CAAA;AAAA,IAC1C,CAAA,MAAO;AACL,MAAA,QAAA,CAAS,MAAA,CAAO,SAAS,IAAI,CAAA;AAAA,IAC/B;AAAA,EACF,CAAC,CAAA;AACH;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"rewriteDocLinks.esm.js","sources":["../../../src/reader/transformers/rewriteDocLinks.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 type { Transformer } from './transformer';\n\nexport const rewriteDocLinks = (): Transformer => {\n return dom => {\n const updateDom = <T extends Element>(\n list: Array<T>,\n attributeName: string,\n ): void => {\n Array.from(list)\n .filter(elem => elem.hasAttribute(attributeName))\n .forEach((elem: T) => {\n const elemAttribute = elem.getAttribute(attributeName);\n if (elemAttribute) {\n // if link is external, add target to open in a new window or tab\n if (elemAttribute.match(/^https?:\\/\\//i)) {\n elem.setAttribute('target', '_blank');\n }\n\n try {\n const normalizedWindowLocation = normalizeUrl(\n window.location.href,\n );\n elem.setAttribute(\n attributeName,\n new URL(elemAttribute, normalizedWindowLocation).toString(),\n );\n } catch (_e) {\n // Non-parseable links should be re-written as plain text.\n elem.replaceWith(elem.textContent || elemAttribute);\n }\n }\n });\n };\n\n updateDom(Array.from(dom.getElementsByTagName('a')), 'href');\n\n return dom;\n };\n};\n\n/** Make sure that the input url always ends with a '/' */\nexport function normalizeUrl(input: string): string {\n const url = new URL(input);\n\n if (!url.pathname.endsWith('/') && !url.pathname.endsWith('.html')) {\n url.pathname += '/';\n }\n\n return url.toString();\n}\n"],"names":[],"mappings":"AAkBO,MAAM,kBAAkB,MAAmB;AAChD,EAAA,OAAO,CAAA,GAAA,KAAO;AACZ,IAAA,MAAM,SAAA,GAAY,CAChB,IAAA,EACA,aAAA,KACS;AACT,MAAA,KAAA,CAAM,IAAA,CAAK,IAAI,CAAA,CACZ,MAAA,CAAO,CAAA,IAAA,KAAQ,IAAA,CAAK,YAAA,CAAa,aAAa,CAAC,CAAA,CAC/C,OAAA,CAAQ,CAAC,IAAA,KAAY;AACpB,QAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,YAAA,CAAa,aAAa,CAAA;AACrD,QAAA,IAAI,aAAA,EAAe;AAEjB,UAAA,IAAI,aAAA,CAAc,KAAA,CAAM,eAAe,CAAA,EAAG;AACxC,YAAA,IAAA,CAAK,YAAA,CAAa,UAAU,QAAQ,CAAA;AAAA,UACtC;AAEA,UAAA,IAAI;AACF,YAAA,MAAM,wBAAA,GAA2B,YAAA;AAAA,cAC/B,OAAO,QAAA,CAAS;AAAA,aAClB;AACA,YAAA,IAAA,CAAK,YAAA;AAAA,cACH,aAAA;AAAA,cACA,IAAI,GAAA,CAAI,aAAA,EAAe,wBAAwB,EAAE,QAAA;AAAS,aAC5D;AAAA,UACF,SAAS,EAAA,EAAI;AAEX,YAAA,IAAA,CAAK,WAAA,CAAY,IAAA,CAAK,WAAA,IAAe,aAAa,CAAA;AAAA,UACpD;AAAA,QACF;AAAA,MACF,CAAC,CAAA;AAAA,IACL,CAAA;AAEA,IAAA,SAAA,CAAU,MAAM,IAAA,CAAK,GAAA,CAAI,qBAAqB,GAAG,CAAC,GAAG,MAAM,CAAA;AAE3D,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;AAGO,SAAS,aAAa,KAAA,EAAuB;AAClD,EAAA,MAAM,GAAA,GAAM,IAAI,GAAA,CAAI,KAAK,CAAA;AAEzB,EAAA,IAAI,CAAC,GAAA,CAAI,QAAA,CAAS,QAAA,CAAS,GAAG,CAAA,IAAK,CAAC,GAAA,CAAI,QAAA,CAAS,QAAA,CAAS,OAAO,CAAA,EAAG;AAClE,IAAA,GAAA,CAAI,QAAA,IAAY,GAAA;AAAA,EAClB;AAEA,EAAA,OAAO,IAAI,QAAA,EAAS;AACtB;;;;"}
1
+ {"version":3,"file":"rewriteDocLinks.esm.js","sources":["../../../src/reader/transformers/rewriteDocLinks.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 type { Transformer } from './transformer';\n\nexport const rewriteDocLinks = (): Transformer => {\n return dom => {\n const updateDom = <T extends Element>(\n list: Array<T>,\n attributeName: string,\n ): void => {\n Array.from(list)\n .filter(elem => elem.hasAttribute(attributeName))\n .forEach((elem: T) => {\n const elemAttribute = elem.getAttribute(attributeName);\n if (elemAttribute) {\n // if link is external, add target to open in a new window or tab\n if (elemAttribute.match(/^https?:\\/\\//i)) {\n elem.setAttribute('target', '_blank');\n }\n\n try {\n const normalizedWindowLocation = normalizeUrl(\n window.location.href,\n );\n elem.setAttribute(\n attributeName,\n new URL(elemAttribute, normalizedWindowLocation).toString(),\n );\n } catch (_e) {\n // Non-parseable links should be re-written as plain text.\n elem.replaceWith(elem.textContent || elemAttribute);\n }\n }\n });\n };\n\n updateDom(Array.from(dom.getElementsByTagName('a')), 'href');\n\n return dom;\n };\n};\n\n/** Make sure that the input url always ends with a '/' */\nexport function normalizeUrl(input: string): string {\n const url = new URL(input);\n\n if (!url.pathname.endsWith('/') && !url.pathname.endsWith('.html')) {\n url.pathname += '/';\n }\n\n return url.toString();\n}\n"],"names":[],"mappings":"AAkBO,MAAM,kBAAkB,MAAmB;AAChD,EAAA,OAAO,CAAA,GAAA,KAAO;AACZ,IAAA,MAAM,SAAA,GAAY,CAChB,IAAA,EACA,aAAA,KACS;AACT,MAAA,KAAA,CAAM,IAAA,CAAK,IAAI,CAAA,CACZ,MAAA,CAAO,CAAA,IAAA,KAAQ,IAAA,CAAK,YAAA,CAAa,aAAa,CAAC,CAAA,CAC/C,OAAA,CAAQ,CAAC,IAAA,KAAY;AACpB,QAAA,MAAM,aAAA,GAAgB,IAAA,CAAK,YAAA,CAAa,aAAa,CAAA;AACrD,QAAA,IAAI,aAAA,EAAe;AAEjB,UAAA,IAAI,aAAA,CAAc,KAAA,CAAM,eAAe,CAAA,EAAG;AACxC,YAAA,IAAA,CAAK,YAAA,CAAa,UAAU,QAAQ,CAAA;AAAA,UACtC;AAEA,UAAA,IAAI;AACF,YAAA,MAAM,wBAAA,GAA2B,YAAA;AAAA,cAC/B,OAAO,QAAA,CAAS;AAAA,aAClB;AACA,YAAA,IAAA,CAAK,YAAA;AAAA,cACH,aAAA;AAAA,cACA,IAAI,GAAA,CAAI,aAAA,EAAe,wBAAwB,EAAE,QAAA;AAAS,aAC5D;AAAA,UACF,SAAS,EAAA,EAAI;AAEX,YAAA,IAAA,CAAK,WAAA,CAAY,IAAA,CAAK,WAAA,IAAe,aAAa,CAAA;AAAA,UACpD;AAAA,QACF;AAAA,MACF,CAAC,CAAA;AAAA,IACL,CAAA;AAEA,IAAA,SAAA,CAAU,MAAM,IAAA,CAAK,GAAA,CAAI,qBAAqB,GAAG,CAAC,GAAG,MAAM,CAAA;AAE3D,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;AAGO,SAAS,aAAa,KAAA,EAAuB;AAClD,EAAA,MAAM,GAAA,GAAM,IAAI,GAAA,CAAI,KAAK,CAAA;AAEzB,EAAA,IAAI,CAAC,GAAA,CAAI,QAAA,CAAS,QAAA,CAAS,GAAG,CAAA,IAAK,CAAC,GAAA,CAAI,QAAA,CAAS,QAAA,CAAS,OAAO,CAAA,EAAG;AAClE,IAAA,GAAA,CAAI,QAAA,IAAY,GAAA;AAAA,EAClB;AAEA,EAAA,OAAO,IAAI,QAAA,EAAS;AACtB;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"scrollIntoNavigation.esm.js","sources":["../../../src/reader/transformers/scrollIntoNavigation.ts"],"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 type { Transformer } from './transformer';\n\nexport const scrollIntoNavigation = (): Transformer => {\n return dom => {\n setTimeout(() => {\n const activeNavItems = dom?.querySelectorAll(`li.md-nav__item--active`);\n if (activeNavItems.length !== 0) {\n // expand all navigation items that are active\n activeNavItems.forEach(activeNavItem => {\n const checkbox = activeNavItem?.querySelector('input');\n if (!checkbox?.checked) {\n checkbox?.click();\n }\n });\n\n const lastItem = activeNavItems[activeNavItems.length - 1];\n lastItem.scrollIntoView();\n }\n }, 200);\n return dom;\n };\n};\n"],"names":[],"mappings":"AAkBO,MAAM,uBAAuB,MAAmB;AACrD,EAAA,OAAO,CAAA,GAAA,KAAO;AACZ,IAAA,UAAA,CAAW,MAAM;AACf,MAAA,MAAM,cAAA,GAAiB,GAAA,EAAK,gBAAA,CAAiB,CAAA,uBAAA,CAAyB,CAAA;AACtE,MAAA,IAAI,cAAA,CAAe,WAAW,CAAA,EAAG;AAE/B,QAAA,cAAA,CAAe,QAAQ,CAAA,aAAA,KAAiB;AACtC,UAAA,MAAM,QAAA,GAAW,aAAA,EAAe,aAAA,CAAc,OAAO,CAAA;AACrD,UAAA,IAAI,CAAC,UAAU,OAAA,EAAS;AACtB,YAAA,QAAA,EAAU,KAAA,EAAM;AAAA,UAClB;AAAA,QACF,CAAC,CAAA;AAED,QAAA,MAAM,QAAA,GAAW,cAAA,CAAe,cAAA,CAAe,MAAA,GAAS,CAAC,CAAA;AACzD,QAAA,QAAA,CAAS,cAAA,EAAe;AAAA,MAC1B;AAAA,IACF,GAAG,GAAG,CAAA;AACN,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"scrollIntoNavigation.esm.js","sources":["../../../src/reader/transformers/scrollIntoNavigation.ts"],"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 type { Transformer } from './transformer';\n\nexport const scrollIntoNavigation = (): Transformer => {\n return dom => {\n setTimeout(() => {\n const activeNavItems = dom?.querySelectorAll(`li.md-nav__item--active`);\n if (activeNavItems.length !== 0) {\n // expand all navigation items that are active\n activeNavItems.forEach(activeNavItem => {\n const checkbox = activeNavItem?.querySelector('input');\n if (!checkbox?.checked) {\n checkbox?.click();\n }\n });\n\n const lastItem = activeNavItems[activeNavItems.length - 1];\n lastItem.scrollIntoView();\n }\n }, 200);\n return dom;\n };\n};\n"],"names":[],"mappings":"AAkBO,MAAM,uBAAuB,MAAmB;AACrD,EAAA,OAAO,CAAA,GAAA,KAAO;AACZ,IAAA,UAAA,CAAW,MAAM;AACf,MAAA,MAAM,cAAA,GAAiB,GAAA,EAAK,gBAAA,CAAiB,CAAA,uBAAA,CAAyB,CAAA;AACtE,MAAA,IAAI,cAAA,CAAe,WAAW,CAAA,EAAG;AAE/B,QAAA,cAAA,CAAe,QAAQ,CAAA,aAAA,KAAiB;AACtC,UAAA,MAAM,QAAA,GAAW,aAAA,EAAe,aAAA,CAAc,OAAO,CAAA;AACrD,UAAA,IAAI,CAAC,UAAU,OAAA,EAAS;AACtB,YAAA,QAAA,EAAU,KAAA,EAAM;AAAA,UAClB;AAAA,QACF,CAAC,CAAA;AAED,QAAA,MAAM,QAAA,GAAW,cAAA,CAAe,cAAA,CAAe,MAAA,GAAS,CAAC,CAAA;AACzD,QAAA,QAAA,CAAS,cAAA,EAAe;AAAA,MAC1B;AAAA,IACF,GAAG,GAAG,CAAA;AACN,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"simplifyMkdocsFooter.esm.js","sources":["../../../src/reader/transformers/simplifyMkdocsFooter.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 type { Transformer } from './transformer';\n\nexport const simplifyMkdocsFooter = (): Transformer => {\n return dom => {\n // Remove new mkdocs copyright\n dom.querySelector('.md-footer .md-copyright')?.remove();\n // Remove old mkdocs copyright\n dom.querySelector('.md-footer-copyright')?.remove();\n return dom;\n };\n};\n"],"names":[],"mappings":"AAkBO,MAAM,uBAAuB,MAAmB;AACrD,EAAA,OAAO,CAAA,GAAA,KAAO;AAEZ,IAAA,GAAA,CAAI,aAAA,CAAc,0BAA0B,CAAA,EAAG,MAAA,EAAO;AAEtD,IAAA,GAAA,CAAI,aAAA,CAAc,sBAAsB,CAAA,EAAG,MAAA,EAAO;AAClD,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"simplifyMkdocsFooter.esm.js","sources":["../../../src/reader/transformers/simplifyMkdocsFooter.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 type { Transformer } from './transformer';\n\nexport const simplifyMkdocsFooter = (): Transformer => {\n return dom => {\n // Remove new mkdocs copyright\n dom.querySelector('.md-footer .md-copyright')?.remove();\n // Remove old mkdocs copyright\n dom.querySelector('.md-footer-copyright')?.remove();\n return dom;\n };\n};\n"],"names":[],"mappings":"AAkBO,MAAM,uBAAuB,MAAmB;AACrD,EAAA,OAAO,CAAA,GAAA,KAAO;AAEZ,IAAA,GAAA,CAAI,aAAA,CAAc,0BAA0B,CAAA,EAAG,MAAA,EAAO;AAEtD,IAAA,GAAA,CAAI,aAAA,CAAc,sBAAsB,CAAA,EAAG,MAAA,EAAO;AAClD,IAAA,OAAO,GAAA;AAAA,EACT,CAAA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"animations.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/animations.ts"],"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\nexport default () => `\n/*================== Animations ==================*/\n/*\n Disable CSS animations on link colors as they lead to issues in dark mode.\n The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.\n*/\n.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {\n transition: none;\n}\n`;\n"],"names":[],"mappings":"AAgBA,iBAAe,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;;;;"}
1
+ {"version":3,"file":"animations.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/animations.ts"],"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\nexport default () => `\n/*================== Animations ==================*/\n/*\n Disable CSS animations on link colors as they lead to issues in dark mode.\n The dark mode color theme is applied later and theirfore there is always an animation from light to dark mode when navigation between pages.\n*/\n.md-dialog, .md-nav__link, .md-footer__link, .md-typeset a, .md-typeset a::before, .md-typeset .headerlink {\n transition: none;\n}\n`;\n"],"names":[],"mappings":"AAgBA,iBAAe,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/extensions.ts"],"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 { RuleOptions } from './types';\n\nexport default ({ theme }: RuleOptions) => `\n/*================== Extensions ==================*/\n\n/* HIGHLIGHT */\n.highlight .md-clipboard:after {\n content: unset;\n}\n\n.highlight .nx {\n color: ${theme.palette.type === 'dark' ? '#ff53a3' : '#ec407a'};\n}\n\n/* CODE HILITE */\n.codehilite .gd {\n background-color: ${\n theme.palette.type === 'dark' ? 'rgba(248,81,73,0.65)' : '#fdd'\n };\n}\n\n.codehilite .gi {\n background-color: ${\n theme.palette.type === 'dark' ? 'rgba(46,160,67,0.65)' : '#dfd'\n };\n}\n\n/* TABBED */\n.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),\n.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),\n.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),\n.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),\n.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),\n.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),\n.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),\n.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),\n.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),\n.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),\n.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),\n.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),\n.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),\n.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),\n.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),\n.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),\n.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),\n.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),\n.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),\n.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {\n color: var(--md-accent-fg-color);\n border-color: var(--md-accent-fg-color);\n}\n\n/* TASK-LIST */\n.task-list-control .task-list-indicator::before {\n background-color: ${theme.palette.action.disabledBackground};\n}\n.task-list-control [type=\"checkbox\"]:checked + .task-list-indicator:before {\n background-color: ${theme.palette.success.main};\n}\n\n/* ADMONITION */\n.admonition {\n font-size: var(--md-typeset-font-size) !important;\n}\n.admonition .admonition-title {\n padding-left: 2.5rem !important;\n}\n\n.admonition .admonition-title:before {\n top: 50% !important;\n width: 20px !important;\n height: 20px !important;\n transform: translateY(-50%) !important;\n}\n`;\n"],"names":[],"mappings":"AAkBA,iBAAe,CAAC,EAAE,KAAA,EAAM,KAAmB;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA,SAAA,EAShC,KAAA,CAAM,OAAA,CAAQ,IAAA,KAAS,MAAA,GAAS,YAAY,SAAS,CAAA;AAAA;;AAAA;AAAA;AAAA,oBAAA,EAM5D,KAAA,CAAM,OAAA,CAAQ,IAAA,KAAS,MAAA,GAAS,yBAAyB,MAC3D,CAAA;AAAA;;AAAA;AAAA,oBAAA,EAKE,KAAA,CAAM,OAAA,CAAQ,IAAA,KAAS,MAAA,GAAS,yBAAyB,MAC3D,CAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA,oBAAA,EA8BoB,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO,kBAAkB,CAAA;AAAA;AAAA;AAAA,mBAAA,EAGxC,KAAA,CAAM,OAAA,CAAQ,OAAA,CAAQ,IAAI,CAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;;;;"}
1
+ {"version":3,"file":"extensions.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/extensions.ts"],"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 { RuleOptions } from './types';\n\nexport default ({ theme }: RuleOptions) => `\n/*================== Extensions ==================*/\n\n/* HIGHLIGHT */\n.highlight .md-clipboard:after {\n content: unset;\n}\n\n.highlight .nx {\n color: ${theme.palette.type === 'dark' ? '#ff53a3' : '#ec407a'};\n}\n\n/* CODE HILITE */\n.codehilite .gd {\n background-color: ${\n theme.palette.type === 'dark' ? 'rgba(248,81,73,0.65)' : '#fdd'\n };\n}\n\n.codehilite .gi {\n background-color: ${\n theme.palette.type === 'dark' ? 'rgba(46,160,67,0.65)' : '#dfd'\n };\n}\n\n/* TABBED */\n.tabbed-set>input:nth-child(1):checked~.tabbed-labels>:nth-child(1),\n.tabbed-set>input:nth-child(2):checked~.tabbed-labels>:nth-child(2),\n.tabbed-set>input:nth-child(3):checked~.tabbed-labels>:nth-child(3),\n.tabbed-set>input:nth-child(4):checked~.tabbed-labels>:nth-child(4),\n.tabbed-set>input:nth-child(5):checked~.tabbed-labels>:nth-child(5),\n.tabbed-set>input:nth-child(6):checked~.tabbed-labels>:nth-child(6),\n.tabbed-set>input:nth-child(7):checked~.tabbed-labels>:nth-child(7),\n.tabbed-set>input:nth-child(8):checked~.tabbed-labels>:nth-child(8),\n.tabbed-set>input:nth-child(9):checked~.tabbed-labels>:nth-child(9),\n.tabbed-set>input:nth-child(10):checked~.tabbed-labels>:nth-child(10),\n.tabbed-set>input:nth-child(11):checked~.tabbed-labels>:nth-child(11),\n.tabbed-set>input:nth-child(12):checked~.tabbed-labels>:nth-child(12),\n.tabbed-set>input:nth-child(13):checked~.tabbed-labels>:nth-child(13),\n.tabbed-set>input:nth-child(14):checked~.tabbed-labels>:nth-child(14),\n.tabbed-set>input:nth-child(15):checked~.tabbed-labels>:nth-child(15),\n.tabbed-set>input:nth-child(16):checked~.tabbed-labels>:nth-child(16),\n.tabbed-set>input:nth-child(17):checked~.tabbed-labels>:nth-child(17),\n.tabbed-set>input:nth-child(18):checked~.tabbed-labels>:nth-child(18),\n.tabbed-set>input:nth-child(19):checked~.tabbed-labels>:nth-child(19),\n.tabbed-set>input:nth-child(20):checked~.tabbed-labels>:nth-child(20) {\n color: var(--md-accent-fg-color);\n border-color: var(--md-accent-fg-color);\n}\n\n/* TASK-LIST */\n.task-list-control .task-list-indicator::before {\n background-color: ${theme.palette.action.disabledBackground};\n}\n.task-list-control [type=\"checkbox\"]:checked + .task-list-indicator:before {\n background-color: ${theme.palette.success.main};\n}\n\n/* ADMONITION */\n.admonition {\n font-size: var(--md-typeset-font-size) !important;\n}\n.admonition .admonition-title {\n padding-left: 2.5rem !important;\n}\n\n.admonition .admonition-title:before {\n top: 50% !important;\n width: 20px !important;\n height: 20px !important;\n transform: translateY(-50%) !important;\n}\n`;\n"],"names":[],"mappings":"AAkBA,iBAAe,CAAC,EAAE,KAAA,EAAM,KAAmB;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA,SAAA,EAShC,KAAA,CAAM,OAAA,CAAQ,IAAA,KAAS,MAAA,GAAS,YAAY,SAAS,CAAA;AAAA;;AAAA;AAAA;AAAA,oBAAA,EAM5D,KAAA,CAAM,OAAA,CAAQ,IAAA,KAAS,MAAA,GAAS,yBAAyB,MAC3D,CAAA;AAAA;;AAAA;AAAA,oBAAA,EAKE,KAAA,CAAM,OAAA,CAAQ,IAAA,KAAS,MAAA,GAAS,yBAAyB,MAC3D,CAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA,oBAAA,EA8BoB,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO,kBAAkB,CAAA;AAAA;AAAA;AAAA,mBAAA,EAGxC,KAAA,CAAM,OAAA,CAAQ,OAAA,CAAQ,IAAI,CAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"layout.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/layout.ts"],"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 { RuleOptions } from './types';\n\nconst TECHDOCS_SIDEBAR_WIDTH = '16rem';\nconst APP_SIDEBAR_WIDTH_PINNED = '224px';\nconst APP_SIDEBAR_WIDTH_COLLAPSED = '72px';\n\nexport default ({ theme, sidebar }: RuleOptions) => `\n\n/*================== Layout ==================*/\n\n/* mkdocs material v9 compat */\n.md-nav__title {\n color: var(--md-default-fg-color);\n}\n\n.md-grid {\n max-width: 100%;\n margin: 0;\n}\n\n.md-nav {\n font-size: calc(var(--md-typeset-font-size) * 0.9);\n}\n.md-nav__link:not(:has(svg)) {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.md-nav__link:has(svg) > .md-ellipsis {\n flex-grow: 1;\n}\n.md-nav__icon {\n height: 20px !important;\n width: 20px !important;\n margin-left:${theme.spacing(1)}px;\n}\n.md-nav__icon svg {\n margin: 0;\n width: 20px !important;\n height: 20px !important;\n}\n.md-nav__icon:after {\n width: 20px !important;\n height: 20px !important;\n}\n.md-status--updated::after {\n -webkit-mask-image: var(--md-status--updated);\n mask-image: var(--md-status--updated);\n}\n\n.md-nav__item--active > .md-nav__link, a.md-nav__link--active {\n text-decoration: underline;\n color: var(--md-typeset-a-color);\n}\n.md-nav__link--active > .md-status:after {\n background-color: var(--md-typeset-a-color);\n}\n.md-nav__link[href]:hover > .md-status:after {\n background-color: var(--md-accent-fg-color);\n}\n\n.md-main__inner {\n margin-top: 0;\n}\n\n.md-sidebar {\n bottom: 75px;\n position: fixed;\n width: ${TECHDOCS_SIDEBAR_WIDTH};\n}\n.md-sidebar .md-sidebar__scrollwrap {\n width: calc(${TECHDOCS_SIDEBAR_WIDTH});\n height: 100%\n}\n\n@supports selector(::-webkit-scrollbar) {\n [dir=ltr] .md-sidebar__inner {\n padding-right: calc(100% - 15.1rem);\n }\n}\n.md-sidebar--secondary {\n right: ${theme.spacing(3)}px;\n}\n\n.md-content {\n max-width: calc(100% - ${TECHDOCS_SIDEBAR_WIDTH} * 2);\n margin-left: ${TECHDOCS_SIDEBAR_WIDTH};\n margin-bottom: 50px;\n}\n\n.md-content > .md-sidebar {\n left: ${TECHDOCS_SIDEBAR_WIDTH};\n}\n\n.md-footer {\n position: fixed;\n bottom: 0px;\n pointer-events: none;\n}\n\n.md-footer-nav__link, .md-footer__link {\n pointer-events: all;\n}\n\n.md-footer__title {\n background-color: unset;\n}\n.md-footer-nav__link, .md-footer__link {\n width: ${TECHDOCS_SIDEBAR_WIDTH};\n}\n\n.md-dialog {\n background-color: unset;\n}\n\n@media screen and (min-width: 76.25em) {\n .md-sidebar {\n height: auto;\n /* Less padding before the Previous / Next buttons */\n padding-bottom: 0 !important;\n }\n}\n\n@media screen and (max-width: 76.1875em) {\n .md-nav {\n transition: none !important;\n background-color: var(--md-default-bg-color)\n }\n .md-nav--primary .md-nav__title {\n cursor: auto;\n color: var(--md-default-fg-color);\n font-weight: 700;\n white-space: normal;\n line-height: 1rem;\n height: auto;\n display: flex;\n flex-flow: column;\n row-gap: 1.6rem;\n padding: 1.2rem .8rem .8rem;\n background-color: var(--md-default-bg-color);\n }\n .md-nav--primary .md-nav__title~.md-nav__list {\n box-shadow: none;\n }\n .md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {\n border-top: none;\n }\n .md-nav--primary .md-nav__title .md-nav__button {\n display: none;\n }\n .md-nav--primary .md-nav__title .md-nav__icon {\n color: var(--md-default-fg-color);\n position: static;\n height: auto;\n margin: 0 0 0 -0.2rem;\n }\n .md-nav--primary > .md-nav__title [for=\"none\"] {\n padding-top: 0;\n }\n .md-nav--primary .md-nav__item {\n border-top: none;\n }\n .md-nav--primary :is(.md-nav__title,.md-nav__item) {\n font-size : var(--md-typeset-font-size);\n }\n .md-nav .md-source {\n display: none;\n }\n\n .md-sidebar {\n height: 100%;\n }\n .md-sidebar--primary {\n width: ${TECHDOCS_SIDEBAR_WIDTH} !important;\n z-index: 200;\n left: ${\n sidebar.isPinned\n ? `calc(-${TECHDOCS_SIDEBAR_WIDTH} + var(--techdocs-sidebar-closed-offset-pinned, ${APP_SIDEBAR_WIDTH_PINNED}))`\n : `calc(-${TECHDOCS_SIDEBAR_WIDTH} + var(--techdocs-sidebar-closed-offset-collapsed, ${APP_SIDEBAR_WIDTH_COLLAPSED}))`\n } !important;\n }\n .md-sidebar--secondary:not([hidden]) {\n display: none;\n }\n\n [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary {\n transform: translateX(var(--techdocs-sidebar-open-translate, ${TECHDOCS_SIDEBAR_WIDTH}));\n }\n\n .md-content {\n max-width: 100%;\n margin-left: 0;\n }\n\n .md-header__button {\n margin: 0.4rem 0;\n margin-left: 0.4rem;\n padding: 0;\n }\n\n .md-overlay {\n left: 0;\n }\n\n .md-footer {\n position: static;\n padding-left: 0;\n }\n .md-footer-nav__link {\n /* footer links begin to overlap at small sizes without setting width */\n width: 50%;\n }\n}\n\n@media screen and (max-width: 600px) {\n .md-sidebar--primary {\n left: -${TECHDOCS_SIDEBAR_WIDTH} !important;\n width: ${TECHDOCS_SIDEBAR_WIDTH};\n }\n}\n\n\n@media print {\n .md-sidebar,\n #toggle-sidebar {\n display: none;\n }\n\n .md-content {\n margin: 0;\n width: 100%;\n max-width: 100%;\n }\n}\n`;\n"],"names":[],"mappings":"AAkBA,MAAM,sBAAA,GAAyB,OAAA;AAC/B,MAAM,wBAAA,GAA2B,OAAA;AACjC,MAAM,2BAAA,GAA8B,MAAA;AAEpC,aAAe,CAAC,EAAE,KAAA,EAAO,OAAA,EAAQ,KAAmB;;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,EA4BpC,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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O+D,sBAAsB,CAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA,WAAA,EA8B5E,sBAAsB,CAAA;AAAA,WAAA,EACtB,sBAAsB,CAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;;;;"}
1
+ {"version":3,"file":"layout.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/layout.ts"],"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 { RuleOptions } from './types';\n\nconst TECHDOCS_SIDEBAR_WIDTH = '16rem';\nconst APP_SIDEBAR_WIDTH_PINNED = '224px';\nconst APP_SIDEBAR_WIDTH_COLLAPSED = '72px';\n\nexport default ({ theme, sidebar }: RuleOptions) => `\n\n/*================== Layout ==================*/\n\n/* mkdocs material v9 compat */\n.md-nav__title {\n color: var(--md-default-fg-color);\n}\n\n.md-grid {\n max-width: 100%;\n margin: 0;\n}\n\n.md-nav {\n font-size: calc(var(--md-typeset-font-size) * 0.9);\n}\n.md-nav__link:not(:has(svg)) {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.md-nav__link:has(svg) > .md-ellipsis {\n flex-grow: 1;\n}\n.md-nav__icon {\n height: 20px !important;\n width: 20px !important;\n margin-left:${theme.spacing(1)}px;\n}\n.md-nav__icon svg {\n margin: 0;\n width: 20px !important;\n height: 20px !important;\n}\n.md-nav__icon:after {\n width: 20px !important;\n height: 20px !important;\n}\n.md-status--updated::after {\n -webkit-mask-image: var(--md-status--updated);\n mask-image: var(--md-status--updated);\n}\n\n.md-nav__item--active > .md-nav__link, a.md-nav__link--active {\n text-decoration: underline;\n color: var(--md-typeset-a-color);\n}\n.md-nav__link--active > .md-status:after {\n background-color: var(--md-typeset-a-color);\n}\n.md-nav__link[href]:hover > .md-status:after {\n background-color: var(--md-accent-fg-color);\n}\n\n.md-main__inner {\n margin-top: 0;\n}\n\n.md-sidebar {\n bottom: 75px;\n position: fixed;\n width: ${TECHDOCS_SIDEBAR_WIDTH};\n}\n.md-sidebar .md-sidebar__scrollwrap {\n width: calc(${TECHDOCS_SIDEBAR_WIDTH});\n height: 100%\n}\n\n@supports selector(::-webkit-scrollbar) {\n [dir=ltr] .md-sidebar__inner {\n padding-right: calc(100% - 15.1rem);\n }\n}\n.md-sidebar--secondary {\n right: ${theme.spacing(3)}px;\n}\n\n.md-content {\n max-width: calc(100% - ${TECHDOCS_SIDEBAR_WIDTH} * 2);\n margin-left: ${TECHDOCS_SIDEBAR_WIDTH};\n margin-bottom: 50px;\n}\n\n.md-content > .md-sidebar {\n left: ${TECHDOCS_SIDEBAR_WIDTH};\n}\n\n.md-footer {\n position: fixed;\n bottom: 0px;\n pointer-events: none;\n}\n\n.md-footer-nav__link, .md-footer__link {\n pointer-events: all;\n}\n\n.md-footer__title {\n background-color: unset;\n}\n.md-footer-nav__link, .md-footer__link {\n width: ${TECHDOCS_SIDEBAR_WIDTH};\n}\n\n.md-dialog {\n background-color: unset;\n}\n\n@media screen and (min-width: 76.25em) {\n .md-sidebar {\n height: auto;\n /* Less padding before the Previous / Next buttons */\n padding-bottom: 0 !important;\n }\n}\n\n@media screen and (max-width: 76.1875em) {\n .md-nav {\n transition: none !important;\n background-color: var(--md-default-bg-color)\n }\n .md-nav--primary .md-nav__title {\n cursor: auto;\n color: var(--md-default-fg-color);\n font-weight: 700;\n white-space: normal;\n line-height: 1rem;\n height: auto;\n display: flex;\n flex-flow: column;\n row-gap: 1.6rem;\n padding: 1.2rem .8rem .8rem;\n background-color: var(--md-default-bg-color);\n }\n .md-nav--primary .md-nav__title~.md-nav__list {\n box-shadow: none;\n }\n .md-nav--primary .md-nav__title ~ .md-nav__list > :first-child {\n border-top: none;\n }\n .md-nav--primary .md-nav__title .md-nav__button {\n display: none;\n }\n .md-nav--primary .md-nav__title .md-nav__icon {\n color: var(--md-default-fg-color);\n position: static;\n height: auto;\n margin: 0 0 0 -0.2rem;\n }\n .md-nav--primary > .md-nav__title [for=\"none\"] {\n padding-top: 0;\n }\n .md-nav--primary .md-nav__item {\n border-top: none;\n }\n .md-nav--primary :is(.md-nav__title,.md-nav__item) {\n font-size : var(--md-typeset-font-size);\n }\n .md-nav .md-source {\n display: none;\n }\n\n .md-sidebar {\n height: 100%;\n }\n .md-sidebar--primary {\n width: ${TECHDOCS_SIDEBAR_WIDTH} !important;\n z-index: 200;\n left: ${\n sidebar.isPinned\n ? `calc(-${TECHDOCS_SIDEBAR_WIDTH} + var(--techdocs-sidebar-closed-offset-pinned, ${APP_SIDEBAR_WIDTH_PINNED}))`\n : `calc(-${TECHDOCS_SIDEBAR_WIDTH} + var(--techdocs-sidebar-closed-offset-collapsed, ${APP_SIDEBAR_WIDTH_COLLAPSED}))`\n } !important;\n }\n .md-sidebar--secondary:not([hidden]) {\n display: none;\n }\n\n [data-md-toggle=drawer]:checked~.md-container .md-sidebar--primary {\n transform: translateX(var(--techdocs-sidebar-open-translate, ${TECHDOCS_SIDEBAR_WIDTH}));\n }\n\n .md-content {\n max-width: 100%;\n margin-left: 0;\n }\n\n .md-header__button {\n margin: 0.4rem 0;\n margin-left: 0.4rem;\n padding: 0;\n }\n\n .md-overlay {\n left: 0;\n }\n\n .md-footer {\n position: static;\n padding-left: 0;\n }\n .md-footer-nav__link {\n /* footer links begin to overlap at small sizes without setting width */\n width: 50%;\n }\n}\n\n@media screen and (max-width: 600px) {\n .md-sidebar--primary {\n left: -${TECHDOCS_SIDEBAR_WIDTH} !important;\n width: ${TECHDOCS_SIDEBAR_WIDTH};\n }\n}\n\n\n@media print {\n .md-sidebar,\n #toggle-sidebar {\n display: none;\n }\n\n .md-content {\n margin: 0;\n width: 100%;\n max-width: 100%;\n }\n}\n`;\n"],"names":[],"mappings":"AAkBA,MAAM,sBAAA,GAAyB,OAAA;AAC/B,MAAM,wBAAA,GAA2B,OAAA;AACjC,MAAM,2BAAA,GAA8B,MAAA;AAEpC,aAAe,CAAC,EAAE,KAAA,EAAO,OAAA,EAAQ,KAAmB;;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAAA,EA4BpC,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA,SAAA,EAkCrB,sBAAsB,CAAA;AAAA;AAAA;AAAA,cAAA,EAGjB,sBAAsB,CAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAA,EAU3B,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAC,CAAA;AAAA;;AAAA;AAAA,yBAAA,EAIA,sBAAsB,CAAA;AAAA,eAAA,EAChC,sBAAsB,CAAA;AAAA;AAAA;;AAAA;AAAA,QAAA,EAK7B,sBAAsB,CAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,SAAA,EAiBrB,sBAAsB,CAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA,WAAA,EAiEpB,sBAAsB,CAAA;AAAA;AAAA,UAAA,EAG7B,OAAA,CAAQ,QAAA,GACJ,CAAA,MAAA,EAAS,sBAAsB,CAAA,gDAAA,EAAmD,wBAAwB,CAAA,EAAA,CAAA,GAC1G,CAAA,MAAA,EAAS,sBAAsB,CAAA,mDAAA,EAAsD,2BAA2B,CAAA,EAAA,CACtH,CAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA,iEAAA,EAO+D,sBAAsB,CAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA,WAAA,EA8B5E,sBAAsB,CAAA;AAAA,WAAA,EACtB,sBAAsB,CAAA;AAAA;AAAA;;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"palette.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/palette.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { RuleOptions } from './types';\nimport { Theme } from '@material-ui/core/styles';\n\nconst themeHashes: Record<Theme['palette']['type'], ReadonlyArray<string>> = {\n dark: ['#only-light', '#gh-light-mode-only'],\n light: ['#only-dark', '#gh-dark-mode-only'],\n};\n\nexport default ({ theme }: RuleOptions) => `\n/*================== Palette ==================*/\n/*\n When color palette toggle is enabled in material theme for Mkdocs, there is a possibility to show conditionally \n images by adding #only-dark or #only-light to resource hash. Backstage doesn't use mkdocs color palette mechanism,\n so there is a need to add css rules from palette*.css manually.\n*/\n\n${themeHashes[theme.palette.type]\n .map(hash => `img[src$=\"${hash}\"]`)\n .join(', ')} {\n display: none;\n}\n`;\n"],"names":[],"mappings":"AAmBA,MAAM,WAAA,GAAuE;AAAA,EAC3E,IAAA,EAAM,CAAC,aAAA,EAAe,qBAAqB,CAAA;AAAA,EAC3C,KAAA,EAAO,CAAC,YAAA,EAAc,oBAAoB;AAC5C,CAAA;AAEA,cAAe,CAAC,EAAE,KAAA,EAAM,KAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA,EAQzC,WAAA,CAAY,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,CAC7B,GAAA,CAAI,CAAA,IAAA,KAAQ,CAAA,UAAA,EAAa,IAAI,CAAA,EAAA,CAAI,CAAA,CACjC,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA;AAAA;AAAA,CAAA;;;;"}
1
+ {"version":3,"file":"palette.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/palette.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { RuleOptions } from './types';\nimport { Theme } from '@material-ui/core/styles';\n\nconst themeHashes: Record<Theme['palette']['type'], ReadonlyArray<string>> = {\n dark: ['#only-light', '#gh-light-mode-only'],\n light: ['#only-dark', '#gh-dark-mode-only'],\n};\n\nexport default ({ theme }: RuleOptions) => `\n/*================== Palette ==================*/\n/*\n When color palette toggle is enabled in material theme for Mkdocs, there is a possibility to show conditionally \n images by adding #only-dark or #only-light to resource hash. Backstage doesn't use mkdocs color palette mechanism,\n so there is a need to add css rules from palette*.css manually.\n*/\n\n${themeHashes[theme.palette.type]\n .map(hash => `img[src$=\"${hash}\"]`)\n .join(', ')} {\n display: none;\n}\n`;\n"],"names":[],"mappings":"AAmBA,MAAM,WAAA,GAAuE;AAAA,EAC3E,IAAA,EAAM,CAAC,aAAA,EAAe,qBAAqB,CAAA;AAAA,EAC3C,KAAA,EAAO,CAAC,YAAA,EAAc,oBAAoB;AAC5C,CAAA;AAEA,cAAe,CAAC,EAAE,KAAA,EAAM,KAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA,EAQzC,WAAA,CAAY,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,CAC7B,GAAA,CAAI,CAAA,IAAA,KAAQ,CAAA,UAAA,EAAa,IAAI,CAAA,EAAA,CAAI,CAAA,CACjC,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA;AAAA;AAAA,CAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"reset.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/reset.ts"],"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 { RuleOptions } from './types';\n\nexport default ({ theme }: RuleOptions) => `\n/*================== Reset ==================*/\n\nbody {\n --md-text-color: var(--md-default-fg-color);\n --md-text-link-color: var(--md-accent-fg-color);\n --md-text-font-family: ${theme.typography.fontFamily};\n font-family: var(--md-text-font-family);\n background-color: unset;\n}\n`;\n"],"names":[],"mappings":"AAkBA,YAAe,CAAC,EAAE,KAAA,EAAM,KAAmB;AAAA;;AAAA;AAAA;AAAA;AAAA,yBAAA,EAMhB,KAAA,CAAM,WAAW,UAAU,CAAA;AAAA;AAAA;AAAA;AAAA,CAAA;;;;"}
1
+ {"version":3,"file":"reset.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/reset.ts"],"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 { RuleOptions } from './types';\n\nexport default ({ theme }: RuleOptions) => `\n/*================== Reset ==================*/\n\nbody {\n --md-text-color: var(--md-default-fg-color);\n --md-text-link-color: var(--md-accent-fg-color);\n --md-text-font-family: ${theme.typography.fontFamily};\n font-family: var(--md-text-font-family);\n background-color: unset;\n}\n`;\n"],"names":[],"mappings":"AAkBA,YAAe,CAAC,EAAE,KAAA,EAAM,KAAmB;AAAA;;AAAA;AAAA;AAAA;AAAA,yBAAA,EAMhB,KAAA,CAAM,WAAW,UAAU,CAAA;AAAA;AAAA;AAAA;AAAA,CAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"rules.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/rules.ts"],"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 { default as variables } from './variables';\nimport { default as reset } from './reset';\nimport { default as layout } from './layout';\nimport { default as typeset } from './typeset';\nimport { default as animations } from './animations';\nimport { default as extensions } from './extensions';\nimport palette from './palette';\n\n/**\n * A list of style rules that will be applied to an element in the order they were added.\n *\n * @remarks\n * The order of items is important, which means that a rule can override any other rule previously added to the list,\n * i.e. the rules will be applied from the first added to the last added.\n */\nexport const rules = [\n variables,\n reset,\n layout,\n typeset,\n animations,\n extensions,\n palette,\n];\n"],"names":[],"mappings":";;;;;;;;AA+BO,MAAM,KAAA,GAAQ;AAAA,EACnB,SAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF;;;;"}
1
+ {"version":3,"file":"rules.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/rules.ts"],"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 { default as variables } from './variables';\nimport { default as reset } from './reset';\nimport { default as layout } from './layout';\nimport { default as typeset } from './typeset';\nimport { default as animations } from './animations';\nimport { default as extensions } from './extensions';\nimport palette from './palette';\n\n/**\n * A list of style rules that will be applied to an element in the order they were added.\n *\n * @remarks\n * The order of items is important, which means that a rule can override any other rule previously added to the list,\n * i.e. the rules will be applied from the first added to the last added.\n */\nexport const rules = [\n variables,\n reset,\n layout,\n typeset,\n animations,\n extensions,\n palette,\n];\n"],"names":[],"mappings":";;;;;;;;AA+BO,MAAM,KAAA,GAAQ;AAAA,EACnB,SAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"typeset.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/typeset.ts"],"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 { RuleOptions } from './types';\n\ntype RuleTypography = RuleOptions['theme']['typography'];\n\ntype BackstageTypography = RuleTypography & {\n htmlFontSize?: number;\n};\n\ntype TypographyHeadings = Pick<\n RuleTypography,\n 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n>;\n\ntype TypographyHeadingsKeys = keyof TypographyHeadings;\n\nconst headings: TypographyHeadingsKeys[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\nconst relativeLengthUnit: RegExp = /(em)|(rem)/gi;\nconst cssVariable: RegExp = /var\\(|\\)/gi;\n\nexport default ({ theme }: RuleOptions) => `\n/*================== Typeset ==================*/\n\n.md-typeset {\n font-size: var(--md-typeset-font-size);\n}\n\n${headings.reduce<string>((style, heading) => {\n const htmlFontSize =\n (theme.typography as BackstageTypography).htmlFontSize ?? 16;\n const styles = theme.typography[heading];\n const { lineHeight, fontFamily, fontWeight, fontSize } = styles;\n const calculate = (value: typeof fontSize): string | undefined => {\n if (typeof value === 'number') {\n // Convert px to rem and apply 60% factor\n return calculate(`${(value / htmlFontSize) * 0.6}rem`);\n } else if (typeof value === 'string') {\n if (value.match(cssVariable)) {\n // Resolve css variable and calculate recursively\n const resolvedValue = window\n .getComputedStyle(document.body)\n .getPropertyValue(value.replaceAll(cssVariable, ''));\n if (resolvedValue !== '') {\n return calculate(resolvedValue);\n }\n } else if (value.match(relativeLengthUnit)) {\n // Use relative size as factor\n const factor = value.replace(relativeLengthUnit, '');\n return `calc(${factor} * var(--md-typeset-font-size))`;\n }\n }\n // Value is not a number, relative length unit, or CSS variable, return as is\n return value;\n };\n return style.concat(`\n .md-typeset ${heading} {\n color: var(--md-default-fg-color);\n line-height: ${lineHeight};\n font-family: ${fontFamily};\n font-weight: ${fontWeight};\n font-size: ${calculate(fontSize)};\n }\n `);\n}, '')}\n\n.md-typeset .md-content__button {\n color: var(--md-default-fg-color);\n}\n\n.md-typeset hr {\n border-bottom: 0.05rem dotted ${theme.palette.divider};\n}\n\n.md-typeset details {\n font-size: var(--md-typeset-font-size) !important;\n}\n.md-typeset details summary {\n padding-left: 2.5rem !important;\n}\n.md-typeset details summary:before,\n.md-typeset details summary:after {\n top: 50% !important;\n width: 20px !important;\n height: 20px !important;\n transform: rotate(0deg) translateY(-50%) !important;\n}\n.md-typeset details[open] > summary:after {\n transform: rotate(90deg) translateX(-50%) !important;\n}\n\n.md-typeset blockquote {\n color: var(--md-default-fg-color--light);\n border-left: 0.2rem solid var(--md-default-fg-color--light);\n}\n\n.md-typeset table:not([class]) {\n font-size: var(--md-typeset-font-size);\n border: 1px solid var(--md-typeset-table-color);\n border-bottom: none;\n border-collapse: collapse;\n border-radius: ${theme.shape.borderRadius}px;\n}\n.md-typeset table:not([class]) th {\n font-weight: bold;\n}\n.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {\n border-bottom: 1px solid var(--md-typeset-table-color);\n}\n\n.md-typeset pre > code::-webkit-scrollbar-thumb {\n background-color: hsla(0, 0%, 0%, 0.32);\n}\n.md-typeset pre > code::-webkit-scrollbar-thumb:hover {\n background-color: hsla(0, 0%, 0%, 0.87);\n}\n\n.md-typeset code {\n word-break: keep-all;\n}\n`;\n"],"names":[],"mappings":"AA+BA,MAAM,WAAqC,CAAC,IAAA,EAAM,MAAM,IAAA,EAAM,IAAA,EAAM,MAAM,IAAI,CAAA;AAC9E,MAAM,kBAAA,GAA6B,cAAA;AACnC,MAAM,WAAA,GAAsB,YAAA;AAE5B,cAAe,CAAC,EAAE,KAAA,EAAM,KAAmB;AAAA;;AAAA;AAAA;AAAA;;AAAA,EAOzC,QAAA,CAAS,MAAA,CAAe,CAAC,KAAA,EAAO,OAAA,KAAY;AAC5C,EAAA,MAAM,YAAA,GACH,KAAA,CAAM,UAAA,CAAmC,YAAA,IAAgB,EAAA;AAC5D,EAAA,MAAM,MAAA,GAAS,KAAA,CAAM,UAAA,CAAW,OAAO,CAAA;AACvC,EAAA,MAAM,EAAE,UAAA,EAAY,UAAA,EAAY,UAAA,EAAY,UAAS,GAAI,MAAA;AACzD,EAAA,MAAM,SAAA,GAAY,CAAC,KAAA,KAA+C;AAChE,IAAA,IAAI,OAAO,UAAU,QAAA,EAAU;AAE7B,MAAA,OAAO,SAAA,CAAU,CAAA,EAAI,KAAA,GAAQ,YAAA,GAAgB,GAAG,CAAA,GAAA,CAAK,CAAA;AAAA,IACvD,CAAA,MAAA,IAAW,OAAO,KAAA,KAAU,QAAA,EAAU;AACpC,MAAA,IAAI,KAAA,CAAM,KAAA,CAAM,WAAW,CAAA,EAAG;AAE5B,QAAA,MAAM,aAAA,GAAgB,MAAA,CACnB,gBAAA,CAA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 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 { RuleOptions } from './types';\n\ntype RuleTypography = RuleOptions['theme']['typography'];\n\ntype BackstageTypography = RuleTypography & {\n htmlFontSize?: number;\n};\n\ntype TypographyHeadings = Pick<\n RuleTypography,\n 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n>;\n\ntype TypographyHeadingsKeys = keyof TypographyHeadings;\n\nconst headings: TypographyHeadingsKeys[] = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'];\nconst relativeLengthUnit: RegExp = /(em)|(rem)/gi;\nconst cssVariable: RegExp = /var\\(|\\)/gi;\n\nexport default ({ theme }: RuleOptions) => `\n/*================== Typeset ==================*/\n\n.md-typeset {\n font-size: var(--md-typeset-font-size);\n}\n\n${headings.reduce<string>((style, heading) => {\n const htmlFontSize =\n (theme.typography as BackstageTypography).htmlFontSize ?? 16;\n const styles = theme.typography[heading];\n const { lineHeight, fontFamily, fontWeight, fontSize } = styles;\n const calculate = (value: typeof fontSize): string | undefined => {\n if (typeof value === 'number') {\n // Convert px to rem and apply 60% factor\n return calculate(`${(value / htmlFontSize) * 0.6}rem`);\n } else if (typeof value === 'string') {\n if (value.match(cssVariable)) {\n // Resolve css variable and calculate recursively\n const resolvedValue = window\n .getComputedStyle(document.body)\n .getPropertyValue(value.replaceAll(cssVariable, ''));\n if (resolvedValue !== '') {\n return calculate(resolvedValue);\n }\n } else if (value.match(relativeLengthUnit)) {\n // Use relative size as factor\n const factor = value.replace(relativeLengthUnit, '');\n return `calc(${factor} * var(--md-typeset-font-size))`;\n }\n }\n // Value is not a number, relative length unit, or CSS variable, return as is\n return value;\n };\n return style.concat(`\n .md-typeset ${heading} {\n color: var(--md-default-fg-color);\n line-height: ${lineHeight};\n font-family: ${fontFamily};\n font-weight: ${fontWeight};\n font-size: ${calculate(fontSize)};\n }\n `);\n}, '')}\n\n.md-typeset .md-content__button {\n color: var(--md-default-fg-color);\n}\n\n.md-typeset hr {\n border-bottom: 0.05rem dotted ${theme.palette.divider};\n}\n\n.md-typeset details {\n font-size: var(--md-typeset-font-size) !important;\n}\n.md-typeset details summary {\n padding-left: 2.5rem !important;\n}\n.md-typeset details summary:before,\n.md-typeset details summary:after {\n top: 50% !important;\n width: 20px !important;\n height: 20px !important;\n transform: rotate(0deg) translateY(-50%) !important;\n}\n.md-typeset details[open] > summary:after {\n transform: rotate(90deg) translateX(-50%) !important;\n}\n\n.md-typeset blockquote {\n color: var(--md-default-fg-color--light);\n border-left: 0.2rem solid var(--md-default-fg-color--light);\n}\n\n.md-typeset table:not([class]) {\n font-size: var(--md-typeset-font-size);\n border: 1px solid var(--md-typeset-table-color);\n border-bottom: none;\n border-collapse: collapse;\n border-radius: ${theme.shape.borderRadius}px;\n}\n.md-typeset table:not([class]) th {\n font-weight: bold;\n}\n.md-typeset table:not([class]) td, .md-typeset table:not([class]) th {\n border-bottom: 1px solid var(--md-typeset-table-color);\n}\n\n.md-typeset pre > code::-webkit-scrollbar-thumb {\n background-color: hsla(0, 0%, 0%, 0.32);\n}\n.md-typeset pre > code::-webkit-scrollbar-thumb:hover {\n background-color: hsla(0, 0%, 0%, 0.87);\n}\n\n.md-typeset code {\n word-break: keep-all;\n}\n`;\n"],"names":[],"mappings":"AA+BA,MAAM,WAAqC,CAAC,IAAA,EAAM,MAAM,IAAA,EAAM,IAAA,EAAM,MAAM,IAAI,CAAA;AAC9E,MAAM,kBAAA,GAA6B,cAAA;AACnC,MAAM,WAAA,GAAsB,YAAA;AAE5B,cAAe,CAAC,EAAE,KAAA,EAAM,KAAmB;AAAA;;AAAA;AAAA;AA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