@backstage/plugin-techdocs 1.11.1-next.1 → 1.11.1-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/dist/EntityPageDocs.esm.js.map +1 -1
- package/dist/Router.esm.js.map +1 -1
- package/dist/alpha.esm.js.map +1 -1
- package/dist/api.esm.js.map +1 -1
- package/dist/client.esm.js.map +1 -1
- package/dist/helpers.esm.js.map +1 -1
- package/dist/home/components/DefaultTechDocsHome.esm.js.map +1 -1
- package/dist/home/components/Grids/DocsCardGrid.esm.js.map +1 -1
- package/dist/home/components/Grids/EntityListDocsGrid.esm.js.map +1 -1
- package/dist/home/components/Tables/DocsTable.esm.js.map +1 -1
- package/dist/home/components/Tables/EntityListDocsTable.esm.js.map +1 -1
- package/dist/home/components/Tables/actions.esm.js.map +1 -1
- package/dist/home/components/Tables/columns.esm.js.map +1 -1
- package/dist/home/components/TechDocsCustomHome.esm.js.map +1 -1
- package/dist/home/components/TechDocsIndexPage.esm.js.map +1 -1
- package/dist/home/components/TechDocsPageWrapper.esm.js.map +1 -1
- package/dist/home/components/TechDocsPicker.esm.js.map +1 -1
- package/dist/plugin.esm.js.map +1 -1
- package/dist/reader/components/TechDocsBuildLogs.esm.js.map +1 -1
- package/dist/reader/components/TechDocsNotFound.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPage/TechDocsReaderPage.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContentAddons.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPageContent/dom.esm.js +4 -2
- package/dist/reader/components/TechDocsReaderPageContent/dom.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPageContent/useNavigateUrl.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPageHeader/TechDocsReaderPageHeader.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.esm.js.map +1 -1
- package/dist/reader/components/TechDocsReaderProvider.esm.js.map +1 -1
- package/dist/reader/components/TechDocsRedirectNotification/TechDocsRedirectNotification.esm.js.map +1 -1
- package/dist/reader/components/TechDocsStateIndicator.esm.js.map +1 -1
- package/dist/reader/components/useReaderState.esm.js.map +1 -1
- package/dist/reader/transformers/addBaseUrl.esm.js.map +1 -1
- package/dist/reader/transformers/addGitFeedbackLink.esm.js.map +1 -1
- package/dist/reader/transformers/addLinkClickListener.esm.js.map +1 -1
- package/dist/reader/transformers/addSidebarToggle.esm.js.map +1 -1
- package/dist/reader/transformers/copyToClipboard.esm.js.map +1 -1
- package/dist/reader/transformers/handleMetaRedirects.esm.js.map +1 -1
- package/dist/reader/transformers/html/hooks/iframes.esm.js.map +1 -1
- package/dist/reader/transformers/html/hooks/links.esm.js.map +1 -1
- package/dist/reader/transformers/html/transformer.esm.js.map +1 -1
- package/dist/reader/transformers/onCssReady.esm.js.map +1 -1
- package/dist/reader/transformers/removeMkdocsHeader.esm.js.map +1 -1
- package/dist/reader/transformers/renderReactElement.esm.js.map +1 -1
- package/dist/reader/transformers/rewriteDocLinks.esm.js.map +1 -1
- package/dist/reader/transformers/scrollIntoNavigation.esm.js.map +1 -1
- package/dist/reader/transformers/simplifyMkdocsFooter.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/animations.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/extensions.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/layout.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/palette.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/reset.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/rules.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/typeset.esm.js.map +1 -1
- package/dist/reader/transformers/styles/rules/variables.esm.js.map +1 -1
- package/dist/reader/transformers/styles/transformer.esm.js.map +1 -1
- package/dist/reader/transformers/transformer.esm.js.map +1 -1
- package/dist/routes.esm.js.map +1 -1
- package/dist/search/components/TechDocsSearch.esm.js.map +1 -1
- package/dist/search/components/TechDocsSearchResultListItem.esm.js.map +1 -1
- package/package.json +22 -13
- package/alpha/package.json +0 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addBaseUrl.esm.js","sources":["../../../src/reader/transformers/addBaseUrl.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 */\nimport { CompoundEntityRef } from '@backstage/catalog-model';\nimport { TechDocsStorageApi } from '../../api';\nimport type { Transformer } from './transformer';\n\ntype AddBaseUrlOptions = {\n techdocsStorageApi: TechDocsStorageApi;\n entityId: CompoundEntityRef;\n path: string;\n};\n\n/**\n * TechDocs backend serves SVGs with text/plain content-type for security. This\n * helper determines if an SVG is being loaded from the backend, and thus needs\n * inlining to be displayed properly.\n */\nconst isSvgNeedingInlining = (\n attrName: string,\n attrVal: string,\n apiOrigin: string,\n) => {\n const isSrcToSvg = attrName === 'src' && attrVal.endsWith('.svg');\n const isRelativeUrl = !attrVal.match(/^([a-z]*:)?\\/\\//i);\n const pointsToOurBackend = attrVal.startsWith(apiOrigin);\n return isSrcToSvg && (isRelativeUrl || pointsToOurBackend);\n};\n\nexport const addBaseUrl = ({\n techdocsStorageApi,\n entityId,\n path,\n}: AddBaseUrlOptions): Transformer => {\n return async dom => {\n const apiOrigin = await techdocsStorageApi.getApiOrigin();\n\n const updateDom = async <T extends Element>(\n list: HTMLCollectionOf<T> | NodeListOf<T>,\n attributeName: string,\n ) => {\n for (const elem of list) {\n if (elem.hasAttribute(attributeName)) {\n const elemAttribute = elem.getAttribute(attributeName);\n if (!elemAttribute) return;\n\n // Special handling for SVG images.\n const newValue = await techdocsStorageApi.getBaseUrl(\n elemAttribute,\n entityId,\n path,\n );\n\n if (isSvgNeedingInlining(attributeName, elemAttribute, apiOrigin)) {\n try {\n const svg = await fetch(newValue, { credentials: 'include' });\n const svgContent = await svg.text();\n elem.setAttribute(\n attributeName,\n `data:image/svg+xml;base64,${btoa(\n unescape(encodeURIComponent(svgContent)),\n )}`,\n );\n } catch (e) {\n elem.setAttribute('alt', `Error: ${elemAttribute}`);\n }\n } else {\n elem.setAttribute(attributeName, newValue);\n }\n }\n }\n };\n\n await Promise.all([\n updateDom<HTMLImageElement>(dom.querySelectorAll('img'), 'src'),\n updateDom<HTMLScriptElement>(dom.querySelectorAll('script'), 'src'),\n updateDom<HTMLSourceElement>(dom.querySelectorAll('source'), 'src'),\n updateDom<HTMLLinkElement>(dom.querySelectorAll('link'), 'href'),\n updateDom<HTMLAnchorElement>(dom.querySelectorAll('a[download]'), 'href'),\n ]);\n\n return dom;\n };\n};\n"],"names":[],"mappings":"AA8BA,MAAM,oBAAuB,GAAA,CAC3B,QACA,EAAA,OAAA,EACA,SACG,KAAA;AACH,EAAA,MAAM,UAAa,GAAA,QAAA,KAAa,KAAS,IAAA,OAAA,CAAQ,SAAS,MAAM,CAAA
|
|
1
|
+
{"version":3,"file":"addBaseUrl.esm.js","sources":["../../../src/reader/transformers/addBaseUrl.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 */\nimport { CompoundEntityRef } from '@backstage/catalog-model';\nimport { TechDocsStorageApi } from '../../api';\nimport type { Transformer } from './transformer';\n\ntype AddBaseUrlOptions = {\n techdocsStorageApi: TechDocsStorageApi;\n entityId: CompoundEntityRef;\n path: string;\n};\n\n/**\n * TechDocs backend serves SVGs with text/plain content-type for security. This\n * helper determines if an SVG is being loaded from the backend, and thus needs\n * inlining to be displayed properly.\n */\nconst isSvgNeedingInlining = (\n attrName: string,\n attrVal: string,\n apiOrigin: string,\n) => {\n const isSrcToSvg = attrName === 'src' && attrVal.endsWith('.svg');\n const isRelativeUrl = !attrVal.match(/^([a-z]*:)?\\/\\//i);\n const pointsToOurBackend = attrVal.startsWith(apiOrigin);\n return isSrcToSvg && (isRelativeUrl || pointsToOurBackend);\n};\n\nexport const addBaseUrl = ({\n techdocsStorageApi,\n entityId,\n path,\n}: AddBaseUrlOptions): Transformer => {\n return async dom => {\n const apiOrigin = await techdocsStorageApi.getApiOrigin();\n\n const updateDom = async <T extends Element>(\n list: HTMLCollectionOf<T> | NodeListOf<T>,\n attributeName: string,\n ) => {\n for (const elem of list) {\n if (elem.hasAttribute(attributeName)) {\n const elemAttribute = elem.getAttribute(attributeName);\n if (!elemAttribute) return;\n\n // Special handling for SVG images.\n const newValue = await techdocsStorageApi.getBaseUrl(\n elemAttribute,\n entityId,\n path,\n );\n\n if (isSvgNeedingInlining(attributeName, elemAttribute, apiOrigin)) {\n try {\n const svg = await fetch(newValue, { credentials: 'include' });\n const svgContent = await svg.text();\n elem.setAttribute(\n attributeName,\n `data:image/svg+xml;base64,${btoa(\n unescape(encodeURIComponent(svgContent)),\n )}`,\n );\n } catch (e) {\n elem.setAttribute('alt', `Error: ${elemAttribute}`);\n }\n } else {\n elem.setAttribute(attributeName, newValue);\n }\n }\n }\n };\n\n await Promise.all([\n updateDom<HTMLImageElement>(dom.querySelectorAll('img'), 'src'),\n updateDom<HTMLScriptElement>(dom.querySelectorAll('script'), 'src'),\n updateDom<HTMLSourceElement>(dom.querySelectorAll('source'), 'src'),\n updateDom<HTMLLinkElement>(dom.querySelectorAll('link'), 'href'),\n updateDom<HTMLAnchorElement>(dom.querySelectorAll('a[download]'), 'href'),\n ]);\n\n return dom;\n };\n};\n"],"names":[],"mappings":"AA8BA,MAAM,oBAAuB,GAAA,CAC3B,QACA,EAAA,OAAA,EACA,SACG,KAAA;AACH,EAAA,MAAM,UAAa,GAAA,QAAA,KAAa,KAAS,IAAA,OAAA,CAAQ,SAAS,MAAM,CAAA;AAChE,EAAA,MAAM,aAAgB,GAAA,CAAC,OAAQ,CAAA,KAAA,CAAM,kBAAkB,CAAA;AACvD,EAAM,MAAA,kBAAA,GAAqB,OAAQ,CAAA,UAAA,CAAW,SAAS,CAAA;AACvD,EAAA,OAAO,eAAe,aAAiB,IAAA,kBAAA,CAAA;AACzC,CAAA;AAEO,MAAM,aAAa,CAAC;AAAA,EACzB,kBAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAsC,KAAA;AACpC,EAAA,OAAO,OAAM,GAAO,KAAA;AAClB,IAAM,MAAA,SAAA,GAAY,MAAM,kBAAA,CAAmB,YAAa,EAAA;AAExD,IAAM,MAAA,SAAA,GAAY,OAChB,IAAA,EACA,aACG,KAAA;AACH,MAAA,KAAA,MAAW,QAAQ,IAAM,EAAA;AACvB,QAAI,IAAA,IAAA,CAAK,YAAa,CAAA,aAAa,CAAG,EAAA;AACpC,UAAM,MAAA,aAAA,GAAgB,IAAK,CAAA,YAAA,CAAa,aAAa,CAAA;AACrD,UAAA,IAAI,CAAC,aAAe,EAAA;AAGpB,UAAM,MAAA,QAAA,GAAW,MAAM,kBAAmB,CAAA,UAAA;AAAA,YACxC,aAAA;AAAA,YACA,QAAA;AAAA,YACA;AAAA,WACF;AAEA,UAAA,IAAI,oBAAqB,CAAA,aAAA,EAAe,aAAe,EAAA,SAAS,CAAG,EAAA;AACjE,YAAI,IAAA;AACF,cAAA,MAAM,MAAM,MAAM,KAAA,CAAM,UAAU,EAAE,WAAA,EAAa,WAAW,CAAA;AAC5D,cAAM,MAAA,UAAA,GAAa,MAAM,GAAA,CAAI,IAAK,EAAA;AAClC,cAAK,IAAA,CAAA,YAAA;AAAA,gBACH,aAAA;AAAA,gBACA,CAA6B,0BAAA,EAAA,IAAA;AAAA,kBAC3B,QAAA,CAAS,kBAAmB,CAAA,UAAU,CAAC;AAAA,iBACxC,CAAA;AAAA,eACH;AAAA,qBACO,CAAG,EAAA;AACV,cAAA,IAAA,CAAK,YAAa,CAAA,KAAA,EAAO,CAAU,OAAA,EAAA,aAAa,CAAE,CAAA,CAAA;AAAA;AACpD,WACK,MAAA;AACL,YAAK,IAAA,CAAA,YAAA,CAAa,eAAe,QAAQ,CAAA;AAAA;AAC3C;AACF;AACF,KACF;AAEA,IAAA,MAAM,QAAQ,GAAI,CAAA;AAAA,MAChB,SAA4B,CAAA,GAAA,CAAI,gBAAiB,CAAA,KAAK,GAAG,KAAK,CAAA;AAAA,MAC9D,SAA6B,CAAA,GAAA,CAAI,gBAAiB,CAAA,QAAQ,GAAG,KAAK,CAAA;AAAA,MAClE,SAA6B,CAAA,GAAA,CAAI,gBAAiB,CAAA,QAAQ,GAAG,KAAK,CAAA;AAAA,MAClE,SAA2B,CAAA,GAAA,CAAI,gBAAiB,CAAA,MAAM,GAAG,MAAM,CAAA;AAAA,MAC/D,SAA6B,CAAA,GAAA,CAAI,gBAAiB,CAAA,aAAa,GAAG,MAAM;AAAA,KACzE,CAAA;AAED,IAAO,OAAA,GAAA;AAAA,GACT;AACF;;;;"}
|
|
@@ -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 React 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(React.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":";;;;;;AA2Ba,MAAA,kBAAA,GAAqB,CAChC,kBACgB,KAAA;AAChB,EAAA,OAAO,CAAO,GAAA,KAAA;AAEZ,IAAA,MAAM,eAAe,GAAI,CAAA,aAAA;AAAA,MACvB
|
|
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 React 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(React.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":";;;;;;AA2Ba,MAAA,kBAAA,GAAqB,CAChC,kBACgB,KAAA;AAChB,EAAA,OAAO,CAAO,GAAA,KAAA;AAEZ,IAAA,MAAM,eAAe,GAAI,CAAA,aAAA;AAAA,MACvB;AAAA,KACF;AAGA,IAAA,IAAI,CAAC,YAAA,IAAgB,CAAC,YAAA,CAAa,IAAM,EAAA;AACvC,MAAO,OAAA,GAAA;AAAA;AAGT,IAAA,MAAM,SAAY,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,QAAA;AAAA,MACF;AACE,QAAO,OAAA,GAAA;AAAA;AAEX,IAAA,kBAAA,CAAmB,KAAM,CAAA,aAAA,CAAc,oBAAoB,CAAA,EAAG,YAAY,CAAA;AAC1E,IAAA,YAAA,CAAa,MAAM,WAAc,GAAA,KAAA;AACjC,IAAA,YAAA,CAAa,KAAQ,GAAA,8BAAA;AACrB,IAAA,YAAA,CAAa,EAAK,GAAA,mBAAA;AAClB,IAAc,YAAA,EAAA,qBAAA,CAAsB,eAAe,YAAY,CAAA;AAC/D,IAAO,OAAA,GAAA;AAAA,GACT;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
|
|
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,CAAgD,KAAA;AAC9C,EAAA,OAAO,CAAO,GAAA,KAAA;AACZ,IAAA,KAAA,CAAM,KAAK,GAAI,CAAA,oBAAA,CAAqB,GAAG,CAAC,CAAA,CAAE,QAAQ,CAAQ,IAAA,KAAA;AACxD,MAAK,IAAA,CAAA,gBAAA,CAAiB,OAAS,EAAA,CAAC,CAAkB,KAAA;AAChD,QAAA,MAAM,MAAS,GAAA,IAAA;AACf,QAAM,MAAA,IAAA,GAAO,MAAO,CAAA,YAAA,CAAa,MAAM,CAAA;AAEvC,QAAA,IAAI,CAAC,IAAM,EAAA;AACX,QAAI,IAAA,IAAA,CAAK,WAAW,OAAO,CAAA,IAAK,CAAC,IAAK,CAAA,YAAA,CAAa,UAAU,CAAG,EAAA;AAC9D,UAAA,CAAA,CAAE,cAAe,EAAA;AACjB,UAAA,OAAA,CAAQ,GAAG,IAAI,CAAA;AAAA;AACjB,OACD,CAAA;AAAA,KACF,CAAA;AAED,IAAO,OAAA,GAAA;AAAA,GACT;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 React 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(React.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,CAAO,GAAA,KAAA;AAEZ,IAAA,MAAM,sBAAsB,GAAI,CAAA,aAAA;AAAA,MAC9B
|
|
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 React 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(React.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,CAAO,GAAA,KAAA;AAEZ,IAAA,MAAM,sBAAsB,GAAI,CAAA,aAAA;AAAA,MAC9B;AAAA,KACF;AACA,IAAM,MAAA,OAAA,GAAU,GAAI,CAAA,aAAA,CAAc,SAAS,CAAA;AAG3C,IAAI,IAAA,CAAC,mBAAuB,IAAA,CAAC,OAAS,EAAA;AACpC,MAAO,OAAA,GAAA;AAAA;AAGT,IAAM,MAAA,aAAA,GAAgB,oBAAoB,SAAU,EAAA;AACpD,IAAA,kBAAA,CAAmB,KAAM,CAAA,aAAA,CAAc,QAAQ,CAAA,EAAG,aAAa,CAAA;AAC/D,IAAA,aAAA,CAAc,EAAK,GAAA,gBAAA;AACnB,IAAA,aAAA,CAAc,KAAQ,GAAA,gBAAA;AACtB,IAAc,aAAA,CAAA,SAAA,CAAU,IAAI,oBAAoB,CAAA;AAChD,IAAc,aAAA,CAAA,KAAA,CAAM,WAAY,CAAA,SAAA,EAAW,WAAW,CAAA;AACtD,IAAc,aAAA,CAAA,KAAA,CAAM,WAAY,CAAA,QAAA,EAAU,wBAAwB,CAAA;AAClE,IAAA,OAAA,EAAS,QAAQ,aAAa,CAAA;AAC9B,IAAO,OAAA,GAAA;AAAA,GACT;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 React, { 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={{ color: 'inherit', position: 'absolute' }}\n className=\"md-clipboard md-icon\"\n onClick={handleClick}\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 */\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,CAAU,KAAA,MAAA;AAAA,EAClD,OAAS,EAAA;AAAA,IACP,QAAU,EAAA,SAAA;AAAA,IACV,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,OAAA;AAAA,IAC1B,MAAQ,EAAA,CAAA;AAAA,IACR,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,IAC1B,eAAiB,EAAA,aAAA;AAAA,IACjB,SAAW,EAAA
|
|
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 React, { 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={{ color: 'inherit', position: 'absolute' }}\n className=\"md-clipboard md-icon\"\n onClick={handleClick}\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 */\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,CAAU,KAAA,MAAA;AAAA,EAClD,OAAS,EAAA;AAAA,IACP,QAAU,EAAA,SAAA;AAAA,IACV,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,OAAA;AAAA,IAC1B,MAAQ,EAAA,CAAA;AAAA,IACR,OAAA,EAAS,KAAM,CAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,IAC1B,eAAiB,EAAA,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,KAAA;AACZ,IAAM,MAAA,KAAA,GAAQ,GAAI,CAAA,gBAAA,CAAiB,YAAY,CAAA;AAC/C,IAAA,KAAA,MAAW,QAAQ,KAAO,EAAA;AACxB,MAAM,MAAA,IAAA,GAAO,KAAK,WAAe,IAAA,EAAA;AACjC,MAAM,MAAA,SAAA,GAAY,QAAS,CAAA,aAAA,CAAc,KAAK,CAAA;AAC9C,MAAM,IAAA,EAAA,aAAA,EAAe,QAAQ,SAAS,CAAA;AACtC,MAAA,kBAAA;AAAA,4CACG,aAAc,EAAA,EAAA,KAAA,EAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,qBAAA,EAAA,EAAsB,MAAY,CACrC,CAAA;AAAA,QACA;AAAA,OACF;AAAA;AAEF,IAAO,OAAA,GAAA;AAAA,GACT;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 React from 'react';\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":";;;;;AAsBa,MAAA,mBAAA,GAAsB,CACjC,QAAA,EACA,UACgB,KAAA;AAChB,EAAA,MAAM,eAAkB,GAAA,GAAA
|
|
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 React from 'react';\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 }\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A;AAAA;AAGT,QAAM,MAAA,OAAA,GAAU,sBAAsB,CAAC,CAAA;AACvC,QAAM,MAAA,WAAA,GAAc,qBAAqB,OAAO,CAAA;AAGhD,QAAI,IAAA,MAAA,CAAO,QAAS,CAAA,IAAA,KAAS,WAAa,EAAA;AACxC,UAAO,OAAA,GAAA;AAAA;AAGT,QAAM,MAAA,SAAA,GAAY,QAAS,CAAA,aAAA,CAAc,KAAK,CAAA;AAE9C,QAAA,kBAAA;AAAA,0BACE,KAAA,CAAA,aAAA;AAAA,YAAC,4BAAA;AAAA,YAAA;AAAA,cACC,OAAQ,EAAA,wGAAA;AAAA,cACR,iBAAA,EAAmB,MAAM,QAAA,CAAS,WAAW,CAAA;AAAA,cAC7C,gBAAkB,EAAA;AAAA;AAAA,WACpB;AAAA,UACA;AAAA,SACF;AACA,QAAS,QAAA,CAAA,IAAA,CAAK,YAAY,SAAS,CAAA;AAEnC,QAAA,UAAA,CAAW,MAAM;AACf,UAAA,QAAA,CAAS,WAAW,CAAA;AAAA,WACnB,eAAe,CAAA;AAElB,QAAO,OAAA,GAAA;AAAA;AACT;AAEF,IAAO,OAAA,GAAA;AAAA,GACT;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\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: Element) => {\n if (isIframe(node) && !isSafe(node, hosts)) {\n node.remove();\n }\n return node;\n};\n"],"names":[],"mappings":"AAqBA,MAAM,QAAW,GAAA,CAAC,IAAkB,KAAA,IAAA,CAAK,QAAa,KAAA,QAAA
|
|
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\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: Element) => {\n if (isIframe(node) && !isSafe(node, hosts)) {\n node.remove();\n }\n return node;\n};\n"],"names":[],"mappings":"AAqBA,MAAM,QAAW,GAAA,CAAC,IAAkB,KAAA,IAAA,CAAK,QAAa,KAAA,QAAA;AAQtD,MAAM,MAAA,GAAS,CAAC,IAAA,EAAe,KAAoB,KAAA;AACjD,EAAA,MAAM,GAAM,GAAA,IAAA,CAAK,YAAa,CAAA,KAAK,CAAK,IAAA,EAAA;AACxC,EAAI,IAAA;AACF,IAAA,MAAM,EAAE,IAAA,EAAS,GAAA,IAAI,IAAI,GAAG,CAAA;AAC5B,IAAO,OAAA,KAAA,CAAM,SAAS,IAAI,CAAA;AAAA,GACpB,CAAA,MAAA;AACN,IAAO,OAAA,KAAA;AAAA;AAEX,CAAA;AAOO,MAAM,mBAAsB,GAAA,CAAC,KAAoB,KAAA,CAAC,IAAkB,KAAA;AACzE,EAAA,IAAI,SAAS,IAAI,CAAA,IAAK,CAAC,MAAO,CAAA,IAAA,EAAM,KAAK,CAAG,EAAA;AAC1C,IAAA,IAAA,CAAK,MAAO,EAAA;AAAA;AAEd,EAAO,OAAA,IAAA;AACT;;;;"}
|
|
@@ -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\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 * @param hosts - list of allowed hosts.\n */\nexport const removeUnsafeLinks = (node: Element) => {\n if (isLink(node) && !isSafe(node)) {\n node.remove();\n }\n return node;\n};\n"],"names":[],"mappings":"AAgBA,MAAM,UAAa,GAAA,iCAAA
|
|
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\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 * @param hosts - list of allowed hosts.\n */\nexport const removeUnsafeLinks = (node: Element) => {\n if (isLink(node) && !isSafe(node)) {\n node.remove();\n }\n return node;\n};\n"],"names":[],"mappings":"AAgBA,MAAM,UAAa,GAAA,iCAAA;AACnB,MAAM,YAAe,GAAA,mCAAA;AACrB,MAAM,aAAgB,GAAA,gCAAA;AAOtB,MAAM,MAAS,GAAA,CAAC,IAAkB,KAAA,IAAA,CAAK,QAAa,KAAA,MAAA;AAOpD,MAAM,MAAA,GAAS,CAAC,IAAkB,KAAA;AAChC,EAAA,MAAM,IAAO,GAAA,IAAA,EAAM,YAAa,CAAA,MAAM,CAAK,IAAA,EAAA;AAC3C,EAAM,MAAA,WAAA,GAAc,IAAK,CAAA,KAAA,CAAM,UAAU,CAAA;AACzC,EAAM,MAAA,aAAA,GAAgB,IAAK,CAAA,KAAA,CAAM,YAAY,CAAA;AAC7C,EAAM,MAAA,cAAA,GAAiB,IAAK,CAAA,KAAA,CAAM,aAAa,CAAA;AAC/C,EAAA,OAAO,eAAe,aAAiB,IAAA,cAAA;AACzC,CAAA;AAOa,MAAA,iBAAA,GAAoB,CAAC,IAAkB,KAAA;AAClD,EAAA,IAAI,OAAO,IAAI,CAAA,IAAK,CAAC,MAAA,CAAO,IAAI,CAAG,EAAA;AACjC,IAAA,IAAA,CAAK,MAAO,EAAA;AAAA;AAEd,EAAO,OAAA,IAAA;AACT;;;;"}
|
|
@@ -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 { removeUnsafeIframes, removeUnsafeLinks } 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 return useCallback(\n async (dom: Element) => {\n const hosts = config?.getOptionalStringArray('allowedIframeHosts');\n\n DOMPurify.addHook('beforeSanitizeElements', removeUnsafeLinks);\n const tags = ['link', 'meta'];\n\n if (hosts) {\n tags.push('iframe');\n DOMPurify.addHook('beforeSanitizeElements', removeUnsafeIframes(hosts));\n }\n\n // Only allow meta tags if they are used for refreshing the page. They are required for the redirect feature.\n DOMPurify.addHook('uponSanitizeElement', (currNode, data) => {\n if (data.tagName === 'meta') {\n const isMetaRefreshTag =\n currNode.getAttribute('http-equiv') === 'refresh' &&\n currNode.getAttribute('content')?.includes('url=');\n if (!isMetaRefreshTag) {\n currNode.parentNode?.removeChild(currNode);\n }\n }\n });\n\n // Only allow http-equiv and content attributes on meta tags. They are required for the redirect feature.\n DOMPurify.addHook('uponSanitizeAttribute', (currNode, data) => {\n if (currNode.tagName !== 'meta') {\n if (data.attrName === 'http-equiv' || data.attrName === 'content') {\n currNode.removeAttribute(data.attrName);\n }\n }\n });\n\n const tagNameCheck = config?.getOptionalString(\n 'allowedCustomElementTagNameRegExp',\n );\n const attributeNameCheck = config?.getOptionalString(\n 'allowedCustomElementAttributeNameRegExp',\n );\n\n // using outerHTML as we want to preserve the html tag attributes (lang)\n return DOMPurify.sanitize(dom.outerHTML, {\n ADD_TAGS: tags,\n FORBID_TAGS: ['style'],\n ADD_ATTR: ['http-equiv', 'content'],\n WHOLE_DOCUMENT: true,\n RETURN_DOM: true,\n CUSTOM_ELEMENT_HANDLING: {\n tagNameCheck: tagNameCheck ? new RegExp(tagNameCheck) : undefined,\n attributeNameCheck: attributeNameCheck\n ? new RegExp(attributeNameCheck)\n : undefined,\n },\n });\n },\n [config],\n );\n};\n"],"names":[],"mappings":";;;;;;AA2BA,MAAM,qBAAqB,MAAM;AAC/B,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA
|
|
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 { removeUnsafeIframes, removeUnsafeLinks } 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 return useCallback(\n async (dom: Element) => {\n const hosts = config?.getOptionalStringArray('allowedIframeHosts');\n\n DOMPurify.addHook('beforeSanitizeElements', removeUnsafeLinks);\n const tags = ['link', 'meta'];\n\n if (hosts) {\n tags.push('iframe');\n DOMPurify.addHook('beforeSanitizeElements', removeUnsafeIframes(hosts));\n }\n\n // Only allow meta tags if they are used for refreshing the page. They are required for the redirect feature.\n DOMPurify.addHook('uponSanitizeElement', (currNode, data) => {\n if (data.tagName === 'meta') {\n const isMetaRefreshTag =\n currNode.getAttribute('http-equiv') === 'refresh' &&\n currNode.getAttribute('content')?.includes('url=');\n if (!isMetaRefreshTag) {\n currNode.parentNode?.removeChild(currNode);\n }\n }\n });\n\n // Only allow http-equiv and content attributes on meta tags. They are required for the redirect feature.\n DOMPurify.addHook('uponSanitizeAttribute', (currNode, data) => {\n if (currNode.tagName !== 'meta') {\n if (data.attrName === 'http-equiv' || data.attrName === 'content') {\n currNode.removeAttribute(data.attrName);\n }\n }\n });\n\n const tagNameCheck = config?.getOptionalString(\n 'allowedCustomElementTagNameRegExp',\n );\n const attributeNameCheck = config?.getOptionalString(\n 'allowedCustomElementAttributeNameRegExp',\n );\n\n // using outerHTML as we want to preserve the html tag attributes (lang)\n return DOMPurify.sanitize(dom.outerHTML, {\n ADD_TAGS: tags,\n FORBID_TAGS: ['style'],\n ADD_ATTR: ['http-equiv', 'content'],\n WHOLE_DOCUMENT: true,\n RETURN_DOM: true,\n CUSTOM_ELEMENT_HANDLING: {\n tagNameCheck: tagNameCheck ? new RegExp(tagNameCheck) : undefined,\n attributeNameCheck: attributeNameCheck\n ? new RegExp(attributeNameCheck)\n : undefined,\n },\n });\n },\n [config],\n );\n};\n"],"names":[],"mappings":";;;;;;AA2BA,MAAM,qBAAqB,MAAM;AAC/B,EAAM,MAAA,SAAA,GAAY,OAAO,YAAY,CAAA;AAErC,EAAA,OAAO,QAA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YAAS,QAAA,CAAA,eAAA,CAAgB,KAAK,QAAQ,CAAA;AAAA;AACxC;AACF,OACD,CAAA;AAED,MAAA,MAAM,eAAe,MAAQ,EAAA,iBAAA;AAAA,QAC3B;AAAA,OACF;AACA,MAAA,MAAM,qBAAqB,MAAQ,EAAA,iBAAA;AAAA,QACjC;AAAA,OACF;AAGA,MAAO,OAAA,SAAA,CAAU,QAAS,CAAA,GAAA,CAAI,SAAW,EAAA;AAAA,QACvC,QAAU,EAAA,IAAA;AAAA,QACV,WAAA,EAAa,CAAC,OAAO,CAAA;AAAA,QACrB,QAAA,EAAU,CAAC,YAAA,EAAc,SAAS,CAAA;AAAA,QAClC,cAAgB,EAAA,IAAA;AAAA,QAChB,UAAY,EAAA,IAAA;AAAA,QACZ,uBAAyB,EAAA;AAAA,UACvB,YAAc,EAAA,YAAA,GAAe,IAAI,MAAA,CAAO,YAAY,CAAI,GAAA,KAAA,CAAA;AAAA,UACxD,kBAAoB,EAAA,kBAAA,GAChB,IAAI,MAAA,CAAO,kBAAkB,CAC7B,GAAA,KAAA;AAAA;AACN,OACD,CAAA;AAAA,KACH;AAAA,IACA,CAAC,MAAM;AAAA,GACT;AACF;;;;"}
|
|
@@ -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
|
|
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,CAAsC,KAAA;AACpC,EAAA,OAAO,CAAO,GAAA,KAAA;AACZ,IAAU,SAAA,EAAA;AACV,IAAI,GAAA,CAAA,gBAAA;AAAA,MACF,2BAAA;AAAA,MACA,SAAS,wBAA2B,GAAA;AAClC,QAAS,QAAA,EAAA;AACT,QAAI,GAAA,CAAA,mBAAA;AAAA,UACF,2BAAA;AAAA,UACA;AAAA,SACF;AAAA;AACF,KACF;AACA,IAAO,OAAA,GAAA;AAAA,GACT;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,CAAO,GAAA,KAAA;AAEZ,IAAI,GAAA,CAAA,aAAA,CAAc,YAAY,CAAA,EAAG,MAAO,EAAA
|
|
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,CAAO,GAAA,KAAA;AAEZ,IAAI,GAAA,CAAA,aAAA,CAAc,YAAY,CAAA,EAAG,MAAO,EAAA;AAExC,IAAO,OAAA,GAAA;AAAA,GACT;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
|
|
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,oBAAsB,EAAA;AACpC,EAAA,eAAA,GAAkB,OAAO,kBAAkB,CAAA;AAC7C,CAAO,MAAA;AACL,EAAA,eAAA,GAAkB,OAAO,WAAW,CAAA;AACtC;AAGgB,SAAA,kBAAA,CAAmB,SAAsB,IAAmB,EAAA;AAC1E,EAAA,eAAA,CAAgB,KAAK,CAAY,QAAA,KAAA;AAC/B,IAAA,IAAI,gBAAgB,QAAU,EAAA;AAC5B,MAAA,QAAA,CAAS,UAAW,CAAA,IAAI,CAAE,CAAA,MAAA,CAAO,OAAO,CAAA;AAAA,KACnC,MAAA;AACL,MAAS,QAAA,CAAA,MAAA,CAAO,SAAS,IAAI,CAAA;AAAA;AAC/B,GACD,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,CAAO,GAAA,KAAA;AACZ,IAAM,MAAA,SAAA,GAAY,CAChB,IAAA,EACA,aACS,KAAA;AACT,MAAA,KAAA,CAAM,IAAK,CAAA,IAAI,CACZ,CAAA,MAAA,CAAO,CAAQ,IAAA,KAAA,IAAA,CAAK,YAAa,CAAA,aAAa,CAAC,CAAA,CAC/C,OAAQ,CAAA,CAAC,IAAY,KAAA;AACpB,QAAM,MAAA,aAAA,GAAgB,IAAK,CAAA,YAAA,CAAa,aAAa,CAAA
|
|
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,CAAO,GAAA,KAAA;AACZ,IAAM,MAAA,SAAA,GAAY,CAChB,IAAA,EACA,aACS,KAAA;AACT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
{"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,CAAO,GAAA,KAAA;AACZ,IAAA,UAAA,CAAW,MAAM;AACf,MAAM,MAAA,cAAA,GAAiB,GAAK,EAAA,gBAAA,CAAiB,CAAyB,uBAAA,CAAA,CAAA
|
|
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,CAAO,GAAA,KAAA;AACZ,IAAA,UAAA,CAAW,MAAM;AACf,MAAM,MAAA,cAAA,GAAiB,GAAK,EAAA,gBAAA,CAAiB,CAAyB,uBAAA,CAAA,CAAA;AACtE,MAAI,IAAA,cAAA,CAAe,WAAW,CAAG,EAAA;AAE/B,QAAA,cAAA,CAAe,QAAQ,CAAiB,aAAA,KAAA;AACtC,UAAM,MAAA,QAAA,GAAW,aAAe,EAAA,aAAA,CAAc,OAAO,CAAA;AACrD,UAAI,IAAA,CAAC,UAAU,OAAS,EAAA;AACtB,YAAA,QAAA,EAAU,KAAM,EAAA;AAAA;AAClB,SACD,CAAA;AAED,QAAA,MAAM,QAAW,GAAA,cAAA,CAAe,cAAe,CAAA,MAAA,GAAS,CAAC,CAAA;AACzD,QAAA,QAAA,CAAS,cAAe,EAAA;AAAA;AAC1B,OACC,GAAG,CAAA;AACN,IAAO,OAAA,GAAA;AAAA,GACT;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,CAAO,GAAA,KAAA;AAEZ,IAAI,GAAA,CAAA,aAAA,CAAc,0BAA0B,CAAA,EAAG,MAAO,EAAA
|
|
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,CAAO,GAAA,KAAA;AAEZ,IAAI,GAAA,CAAA,aAAA,CAAc,0BAA0B,CAAA,EAAG,MAAO,EAAA;AAEtD,IAAI,GAAA,CAAA,aAAA,CAAc,sBAAsB,CAAA,EAAG,MAAO,EAAA;AAClD,IAAO,OAAA,GAAA;AAAA,GACT;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
|
|
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,EAAyB,KAAA
|
|
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,EAAyB,KAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA,SAAA,EAShC,KAAM,CAAA,OAAA,CAAQ,IAAS,KAAA,MAAA,GAAS,YAAY,SAAS,CAAA;AAAA;;AAAA;AAAA;AAAA,oBAAA,EAM5D,KAAM,CAAA,OAAA,CAAQ,IAAS,KAAA,MAAA,GAAS,yBAAyB,MAC3D,CAAA;AAAA;;AAAA;AAAA,oBAAA,EAKE,KAAM,CAAA,OAAA,CAAQ,IAAS,KAAA,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,oBA8BoB,EAAA,KAAA,CAAM,OAAQ,CAAA,MAAA,CAAO,kBAAkB,CAAA;AAAA;AAAA;AAAA,mBAGxC,EAAA,KAAA,CAAM,OAAQ,CAAA,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 SIDEBAR_WIDTH = '224px';\n\nexport default ({ theme, sidebar }: RuleOptions) => `\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: 16rem;\n overflow-y: auto;\n overflow-x: hidden;\n scrollbar-color: rgb(193, 193, 193) #eee;\n scrollbar-width: thin;\n}\n.md-sidebar .md-sidebar__scrollwrap {\n width: calc(16rem);\n overflow-y: hidden;\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.md-sidebar::-webkit-scrollbar {\n width: 5px;\n}\n.md-sidebar::-webkit-scrollbar-button {\n width: 5px;\n height: 5px;\n}\n.md-sidebar::-webkit-scrollbar-track {\n background: #eee;\n border: 1 px solid rgb(250, 250, 250);\n box-shadow: 0px 0px 3px #dfdfdf inset;\n border-radius: 3px;\n}\n.md-sidebar::-webkit-scrollbar-thumb {\n width: 5px;\n background: rgb(193, 193, 193);\n border: transparent;\n border-radius: 3px;\n}\n.md-sidebar::-webkit-scrollbar-thumb:hover {\n background: rgb(125, 125, 125);\n}\n\n.md-content {\n max-width: calc(100% - 16rem * 2);\n margin-left: 16rem;\n margin-bottom: 50px;\n}\n\n.md-content > .md-sidebar {\n left: 16rem;\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: 16rem;\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 }\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: 16rem !important;\n z-index: 200;\n left: ${\n sidebar.isPinned\n ? `calc(-16rem + ${SIDEBAR_WIDTH})`\n : 'calc(-16rem + 72px)'\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(16rem);\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: -16rem !important;\n width: 16rem;\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,aAAgB,GAAA,OAAA
|
|
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 SIDEBAR_WIDTH = '224px';\n\nexport default ({ theme, sidebar }: RuleOptions) => `\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: 16rem;\n overflow-y: auto;\n overflow-x: hidden;\n scrollbar-color: rgb(193, 193, 193) #eee;\n scrollbar-width: thin;\n}\n.md-sidebar .md-sidebar__scrollwrap {\n width: calc(16rem);\n overflow-y: hidden;\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.md-sidebar::-webkit-scrollbar {\n width: 5px;\n}\n.md-sidebar::-webkit-scrollbar-button {\n width: 5px;\n height: 5px;\n}\n.md-sidebar::-webkit-scrollbar-track {\n background: #eee;\n border: 1 px solid rgb(250, 250, 250);\n box-shadow: 0px 0px 3px #dfdfdf inset;\n border-radius: 3px;\n}\n.md-sidebar::-webkit-scrollbar-thumb {\n width: 5px;\n background: rgb(193, 193, 193);\n border: transparent;\n border-radius: 3px;\n}\n.md-sidebar::-webkit-scrollbar-thumb:hover {\n background: rgb(125, 125, 125);\n}\n\n.md-content {\n max-width: calc(100% - 16rem * 2);\n margin-left: 16rem;\n margin-bottom: 50px;\n}\n\n.md-content > .md-sidebar {\n left: 16rem;\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: 16rem;\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 }\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: 16rem !important;\n z-index: 200;\n left: ${\n sidebar.isPinned\n ? `calc(-16rem + ${SIDEBAR_WIDTH})`\n : 'calc(-16rem + 72px)'\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(16rem);\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: -16rem !important;\n width: 16rem;\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,aAAgB,GAAA,OAAA;AAEtB,aAAe,CAAC,EAAE,KAAO,EAAA,OAAA,EAA2B,KAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAA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A;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,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,WAAuE,GAAA;AAAA,EAC3E,IAAA,EAAM,CAAC,aAAA,EAAe,qBAAqB,CAAA;AAAA,EAC3C,KAAA,EAAO,CAAC,YAAA,EAAc,oBAAoB
|
|
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,WAAuE,GAAA;AAAA,EAC3E,IAAA,EAAM,CAAC,aAAA,EAAe,qBAAqB,CAAA;AAAA,EAC3C,KAAA,EAAO,CAAC,YAAA,EAAc,oBAAoB;AAC5C,CAAA;AAEA,cAAe,CAAC,EAAE,KAAA,EAAyB,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA,EAQzC,WAAY,CAAA,KAAA,CAAM,OAAQ,CAAA,IAAI,CAC7B,CAAA,GAAA,CAAI,CAAQ,IAAA,KAAA,CAAA,UAAA,EAAa,IAAI,CAAA,EAAA,CAAI,CACjC,CAAA,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,EAAyB,KAAA
|
|
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,EAAyB,KAAA;AAAA;;AAAA;AAAA;AAAA;AAAA,yBAMhB,EAAA,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,KAAQ,GAAA;AAAA,EACnB,SAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA
|
|
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,KAAQ,GAAA;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-default-fg-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-default-fg-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,IAAM,EAAA,IAAA,EAAM,MAAM,IAAI,CAAA
|
|
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-default-fg-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-default-fg-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,IAAM,EAAA,IAAA,EAAM,MAAM,IAAI,CAAA;AAC9E,MAAM,kBAA6B,GAAA,cAAA;AACnC,MAAM,WAAsB,GAAA,YAAA;AAE5B,cAAe,CAAC,EAAE,KAAA,EAAyB,KAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA,EAOzC,QAAS,CAAA,MAAA,CAAe,CAAC,KAAA,EAAO,OAAY,KAAA;AAC5C,EAAM,MAAA,YAAA,GACH,KAAM,CAAA,UAAA,CAAmC,YAAgB,IAAA,EAAA;AAC5D,EAAM,MAAA,MAAA,GAAS,KAAM,CAAA,UAAA,CAAW,OAAO,CAAA;AACvC,EAAA,MAAM,EAAE,UAAA,EAAY,UAAY,EAAA,UAAA,EAAY,UAAa,GAAA,MAAA;AACzD,EAAM,MAAA,SAAA,GAAY,CAAC,KAA+C,KAAA;AAChE,IAAI,IAAA,OAAO,UAAU,QAAU,EAAA;AAE7B,MAAA,OAAO,SAAU,CAAA,CAAA,EAAI,KAAQ,GAAA,YAAA,GAAgB,GAAG,CAAK,GAAA,CAAA,CAAA;AAAA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AA;AAAA;;AAAA;AAAA;AAAA;AAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/variables.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 { alpha, lighten } from '@material-ui/core/styles';\nimport { RuleOptions } from './types';\n\nexport default ({ theme }: RuleOptions) => `\n/*================== Variables ==================*/\n/*\n As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.\n As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.\n*/\n\n:host {\n /* FONT */\n --md-default-fg-color: ${theme.palette.text.primary};\n --md-default-fg-color--light: ${theme.palette.text.secondary};\n --md-default-fg-color--lighter: ${lighten(theme.palette.text.secondary, 0.7)};\n --md-default-fg-color--lightest: ${lighten(\n theme.palette.text.secondary,\n 0.3,\n )};\n\n /* BACKGROUND */\n --md-default-bg-color:${theme.palette.background.default};\n --md-default-bg-color--light: ${theme.palette.background.paper};\n --md-default-bg-color--lighter: ${lighten(\n theme.palette.background.paper,\n 0.7,\n )};\n --md-default-bg-color--lightest: ${lighten(\n theme.palette.background.paper,\n 0.3,\n )};\n\n /* PRIMARY */\n --md-primary-fg-color: ${theme.palette.primary.main};\n --md-primary-fg-color--light: ${theme.palette.primary.light};\n --md-primary-fg-color--dark: ${theme.palette.primary.dark};\n --md-primary-bg-color: ${theme.palette.primary.contrastText};\n --md-primary-bg-color--light: ${lighten(\n theme.palette.primary.contrastText,\n 0.7,\n )};\n\n /* ACCENT */\n --md-accent-fg-color: var(--md-primary-fg-color);\n --md-accent-fg-color--transparent: ${alpha(theme.palette.primary.main, 0.1)};\n --md-accent-bg-color: var(--md-primary-bg-color);\n --md-accent-bg-color--light: var(--md-primary-bg-color--light);\n\n /* SHADOW */\n --md-shadow-z1: ${theme.shadows[1]};\n --md-shadow-z2: ${theme.shadows[2]};\n --md-shadow-z3: ${theme.shadows[3]};\n\n /* EXTENSIONS */\n --md-admonition-fg-color: var(--md-default-fg-color);\n --md-admonition-bg-color: var(--md-default-bg-color);\n /* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */\n --md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z\"/></svg>');\n --md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z\"/></svg>');\n --md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z\"/></svg>');\n --md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z\"/></svg>');\n --md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"/></svg>');\n --md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z\"/></svg>');\n --md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z\"/></svg>');\n --md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z\"/></svg>');\n --md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z\"/></svg>');\n --md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z\"/></svg>');\n --md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z\"/></svg>');\n --md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z\"/></svg>');\n --md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z\"/></svg>');\n --md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z\"/></svg>');\n --md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\"/></svg>');\n --md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"/></svg>');\n --md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z\"/></svg>');\n --md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z\"/></svg>');\n --md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z\"/></svg>');\n --md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z\"/></svg>');\n --md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z\"/></svg>');\n --md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" d=\"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z\"/></svg>');\n --md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" d=\"M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z\"/></svg>');\n --md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" d=\"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z\"/></svg>');\n --md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" d=\"M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z\"/></svg>');\n --md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d=\"m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z\"/></svg>');\n \n --md-status--updated: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><title>cellphone-arrow-down</title><path d=\"M17,1H7A2,2 0 0,0 5,3V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3A2,2 0 0,0 17,1M17,19H7V5H17V19M16,13H13V8H11V13H8L12,17L16,13Z\" /></svg>');\n --md-status: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z\"/></svg>');\n --md-status--new: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"m23 12-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12m-10 5h-2v-2h2v2m0-4h-2V7h2v6Z\"/></svg>');\n --md-status--deprecated: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M9 3v1H4v2h1v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6h1V4h-5V3H9m0 5h2v9H9V8m4 0h2v9h-2V8Z\"/></svg>');\n --md-status--encrypted: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4m0 6c1.4 0 2.8 1.1 2.8 2.5V11c.6 0 1.2.6 1.2 1.3v3.5c0 .6-.6 1.2-1.3 1.2H9.2c-.6 0-1.2-.6-1.2-1.3v-3.5c0-.6.6-1.2 1.2-1.2V9.5C9.2 8.1 10.6 7 12 7m0 1.2c-.8 0-1.5.5-1.5 1.3V11h3V9.5c0-.8-.7-1.3-1.5-1.3Z\"/></svg>');\n}\n\n:host > * {\n /* CODE */\n --md-code-fg-color: ${theme.palette.text.primary};\n --md-code-bg-color: ${\n theme.palette.code?.background ?? theme.palette.background.paper\n };\n --md-code-hl-color: ${alpha(theme.palette.warning.main, 0.5)};\n --md-code-hl-color--light: var(--md-code-hl-color);\n --md-code-hl-keyword-color: ${\n theme.palette.type === 'dark'\n ? theme.palette.primary.light\n : theme.palette.primary.dark\n };\n --md-code-hl-function-color: ${\n theme.palette.type === 'dark'\n ? theme.palette.secondary.light\n : theme.palette.secondary.dark\n };\n --md-code-hl-string-color: ${\n theme.palette.type === 'dark'\n ? theme.palette.success.light\n : theme.palette.success.dark\n };\n --md-code-hl-number-color: ${\n theme.palette.type === 'dark'\n ? theme.palette.error.light\n : theme.palette.error.dark\n };\n --md-code-hl-constant-color: var(--md-code-hl-function-color);\n --md-code-hl-special-color: var(--md-code-hl-function-color);\n --md-code-hl-name-color: var(--md-code-fg-color);\n --md-code-hl-comment-color: var(--md-default-fg-color--light);\n --md-code-hl-generic-color: var(--md-default-fg-color--light);\n --md-code-hl-variable-color: var(--md-default-fg-color--light);\n --md-code-hl-operator-color: var(--md-default-fg-color--light);\n --md-code-hl-punctuation-color: var(--md-default-fg-color--light);\n\n /* TYPESET */\n --md-typeset-font-size: 1rem;\n --md-typeset-color: var(--md-default-fg-color);\n --md-typeset-a-color: ${theme.palette.link};\n --md-typeset-table-color: ${theme.palette.text.primary};\n --md-typeset-table-color--light: ${alpha(theme.palette.text.primary, 0.05)};\n --md-typeset-del-color: ${\n theme.palette.type === 'dark'\n ? alpha(theme.palette.error.dark, 0.5)\n : alpha(theme.palette.error.light, 0.5)\n };\n --md-typeset-ins-color: ${\n theme.palette.type === 'dark'\n ? alpha(theme.palette.success.dark, 0.5)\n : alpha(theme.palette.success.light, 0.5)\n };\n --md-typeset-mark-color: ${\n theme.palette.type === 'dark'\n ? alpha(theme.palette.warning.dark, 0.5)\n : alpha(theme.palette.warning.light, 0.5)\n };\n --md-typeset-kbd-color: var(--md-code-bg-color);\n --md-typeset-kbd-accent-color var(--md-code-bg-color);\n --md-typeset-kbd-border-color: var(--md-default-fg-color--light);\n}\n\n@media screen and (max-width: 76.1875em) {\n :host > * {\n /* TYPESET */\n --md-typeset-font-size: .9rem;\n }\n}\n\n@media screen and (max-width: 600px) {\n :host > * {\n /* TYPESET */\n --md-typeset-font-size: .7rem;\n }\n}\n\n --md-footer-bg-color: var(--md-default-bg-color);\n --md-footer-bg-color--dark: var(--md-default-bg-color);\n`;\n"],"names":[],"mappings":";;AAmBA,gBAAe,CAAC,EAAE,KAAA,EAAyB,KAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAShB,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,OAAO,CAAA;AAAA,gCACnB,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,SAAS,CAAA;AAAA,kCAAA,EAC1B,QAAQ,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,SAAA,EAAW,GAAG,CAAC,CAAA;AAAA,mCACzC,EAAA,OAAA;AAAA,EACjC,KAAA,CAAM,QAAQ,IAAK,CAAA,SAAA;AAAA,EACnB,GAAA;AACF,CAAC,CAAA;AAAA;AAAA;AAAA,wBAGuB,EAAA,KAAA,CAAM,OAAQ,CAAA,UAAA,CAAW,OAAO,CAAA;AAAA,gCACxB,EAAA,KAAA,CAAM,OAAQ,CAAA,UAAA,CAAW,KAAK,CAAA;AAAA,kCAC5B,EAAA,OAAA;AAAA,EAChC,KAAA,CAAM,QAAQ,UAAW,CAAA,KAAA;AAAA,EACzB,GAAA;AACF,CAAC,CAAA;AAAA,mCACkC,EAAA,OAAA;AAAA,EACjC,KAAA,CAAM,QAAQ,UAAW,CAAA,KAAA;AAAA,EACzB,GAAA;AACF,CAAC,CAAA;AAAA;AAAA;AAA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A,KAAA,CAAM,MAAM,OAAQ,CAAA,OAAA,CAAQ,IAAM,EAAA,GAAG,IACrC,KAAM,CAAA,KAAA,CAAM,QAAQ,OAAQ,CAAA,KAAA,EAAO,GAAG,CAC5C,CAAA;AAAA,2BAAA,EAEE,MAAM,OAAQ,CAAA,IAAA,KAAS,MACnB,GAAA,KAAA,CAAM,MAAM,OAAQ,CAAA,OAAA,CAAQ,IAAM,EAAA,GAAG,IACrC,KAAM,CAAA,KAAA,CAAM,QAAQ,OAAQ,CAAA,KAAA,EAAO,GAAG,CAC5C,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"variables.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/variables.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 { alpha, lighten } from '@material-ui/core/styles';\nimport { RuleOptions } from './types';\n\nexport default ({ theme }: RuleOptions) => `\n/*================== Variables ==================*/\n/*\n As the MkDocs output is rendered in shadow DOM, the CSS variable definitions on the root selector are not applied. Instead, they have to be applied on :host.\n As there is no way to transform the served main*.css yet (for example in the backend), we have to copy from main*.css and modify them.\n*/\n\n:host {\n /* FONT */\n --md-default-fg-color: ${theme.palette.text.primary};\n --md-default-fg-color--light: ${theme.palette.text.secondary};\n --md-default-fg-color--lighter: ${lighten(theme.palette.text.secondary, 0.7)};\n --md-default-fg-color--lightest: ${lighten(\n theme.palette.text.secondary,\n 0.3,\n )};\n\n /* BACKGROUND */\n --md-default-bg-color:${theme.palette.background.default};\n --md-default-bg-color--light: ${theme.palette.background.paper};\n --md-default-bg-color--lighter: ${lighten(\n theme.palette.background.paper,\n 0.7,\n )};\n --md-default-bg-color--lightest: ${lighten(\n theme.palette.background.paper,\n 0.3,\n )};\n\n /* PRIMARY */\n --md-primary-fg-color: ${theme.palette.primary.main};\n --md-primary-fg-color--light: ${theme.palette.primary.light};\n --md-primary-fg-color--dark: ${theme.palette.primary.dark};\n --md-primary-bg-color: ${theme.palette.primary.contrastText};\n --md-primary-bg-color--light: ${lighten(\n theme.palette.primary.contrastText,\n 0.7,\n )};\n\n /* ACCENT */\n --md-accent-fg-color: var(--md-primary-fg-color);\n --md-accent-fg-color--transparent: ${alpha(theme.palette.primary.main, 0.1)};\n --md-accent-bg-color: var(--md-primary-bg-color);\n --md-accent-bg-color--light: var(--md-primary-bg-color--light);\n\n /* SHADOW */\n --md-shadow-z1: ${theme.shadows[1]};\n --md-shadow-z2: ${theme.shadows[2]};\n --md-shadow-z3: ${theme.shadows[3]};\n\n /* EXTENSIONS */\n --md-admonition-fg-color: var(--md-default-fg-color);\n --md-admonition-bg-color: var(--md-default-bg-color);\n /* Admonitions and others are using SVG masks to define icons. These masks are defined as CSS variables. */\n --md-admonition-icon--note: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z\"/></svg>');\n --md-admonition-icon--abstract: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M4 5h16v2H4V5m0 4h16v2H4V9m0 4h16v2H4v-2m0 4h10v2H4v-2z\"/></svg>');\n --md-admonition-icon--info: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M13 9h-2V7h2m0 10h-2v-6h2m-1-9A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10A10 10 0 0012 2z\"/></svg>');\n --md-admonition-icon--tip: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M17.55 11.2c-.23-.3-.5-.56-.76-.82-.65-.6-1.4-1.03-2.03-1.66C13.3 7.26 13 4.85 13.91 3c-.91.23-1.75.75-2.45 1.32-2.54 2.08-3.54 5.75-2.34 8.9.04.1.08.2.08.33 0 .22-.15.42-.35.5-.22.1-.46.04-.64-.12a.83.83 0 01-.15-.17c-1.1-1.43-1.28-3.48-.53-5.12C5.89 10 5 12.3 5.14 14.47c.04.5.1 1 .27 1.5.14.6.4 1.2.72 1.73 1.04 1.73 2.87 2.97 4.84 3.22 2.1.27 4.35-.12 5.96-1.6 1.8-1.66 2.45-4.32 1.5-6.6l-.13-.26c-.2-.46-.47-.87-.8-1.25l.05-.01m-3.1 6.3c-.28.24-.73.5-1.08.6-1.1.4-2.2-.16-2.87-.82 1.19-.28 1.89-1.16 2.09-2.05.17-.8-.14-1.46-.27-2.23-.12-.74-.1-1.37.18-2.06.17.38.37.76.6 1.06.76 1 1.95 1.44 2.2 2.8.04.14.06.28.06.43.03.82-.32 1.72-.92 2.27h.01z\"/></svg>');\n --md-admonition-icon--success: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10 10-4.5 10-10S17.5 2 12 2m-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"/></svg>');\n --md-admonition-icon--question: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M15.07 11.25l-.9.92C13.45 12.89 13 13.5 13 15h-2v-.5c0-1.11.45-2.11 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41a2 2 0 00-2-2 2 2 0 00-2 2H8a4 4 0 014-4 4 4 0 014 4 3.2 3.2 0 01-.93 2.25M13 19h-2v-2h2M12 2A10 10 0 002 12a10 10 0 0010 10 10 10 0 0010-10c0-5.53-4.5-10-10-10z\"/></svg>');\n --md-admonition-icon--warning: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M13 14h-2v-4h2m0 8h-2v-2h2M1 21h22L12 2 1 21z\"/></svg>');\n --md-admonition-icon--failure: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 2c5.53 0 10 4.47 10 10s-4.47 10-10 10S2 17.53 2 12 6.47 2 12 2m3.59 5L12 10.59 8.41 7 7 8.41 10.59 12 7 15.59 8.41 17 12 13.41 15.59 17 17 15.59 13.41 12 17 8.41 15.59 7z\"/></svg>');\n --md-admonition-icon--danger: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M11.5 20l4.86-9.73H13V4l-5 9.73h3.5V20M12 2c2.75 0 5.1 1 7.05 2.95C21 6.9 22 9.25 22 12s-1 5.1-2.95 7.05C17.1 21 14.75 22 12 22s-5.1-1-7.05-2.95C3 17.1 2 14.75 2 12s1-5.1 2.95-7.05C6.9 3 9.25 2 12 2z\"/></svg>');\n --md-admonition-icon--bug: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14 12h-4v-2h4m0 6h-4v-2h4m6-6h-2.81a5.985 5.985 0 00-1.82-1.96L17 4.41 15.59 3l-2.17 2.17a6.002 6.002 0 00-2.83 0L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8z\"/></svg>');\n --md-admonition-icon--example: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M7 13v-2h14v2H7m0 6v-2h14v2H7M7 7V5h14v2H7M3 8V5H2V4h2v4H3m-1 9v-1h3v4H2v-1h2v-.5H3v-1h1V17H2m2.25-7a.75.75 0 01.75.75c0 .2-.08.39-.21.52L3.12 13H5v1H2v-.92L4 11H2v-1h2.25z\"/></svg>');\n --md-admonition-icon--quote: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14 17h3l2-4V7h-6v6h3M6 17h3l2-4V7H5v6h3l-2 4z\"/></svg>');\n --md-footnotes-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.42L5.83 13H21V7h-2z\"/></svg>');\n --md-details-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z\"/></svg>');\n --md-tasklist-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z\"/></svg>');\n --md-tasklist-icon--checked: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M0 0h24v24H0z\" fill=\"none\"/><path d=\"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\"/></svg>');\n --md-nav-icon--prev: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z\"/></svg>');\n --md-nav-icon--next: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M8.59 16.58 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.42z\"/></svg>');\n --md-toc-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M3 9h14V7H3v2m0 4h14v-2H3v2m0 4h14v-2H3v2m16 0h2v-2h-2v2m0-10v2h2V7h-2m0 6h2v-2h-2v2z\"/></svg>');\n --md-clipboard-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M19 21H8V7h11m0-2H8a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2m-3-4H4a2 2 0 0 0-2 2v14h2V3h12V1z\"/></svg>');\n --md-search-result-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h7c-.41-.25-.8-.56-1.14-.9-.33-.33-.61-.7-.86-1.1H6V4h7v5h5v1.18c.71.16 1.39.43 2 .82V8l-6-6m6.31 16.9c1.33-2.11.69-4.9-1.4-6.22-2.11-1.33-4.91-.68-6.22 1.4-1.34 2.11-.69 4.89 1.4 6.22 1.46.93 3.32.93 4.79.02L22 23.39 23.39 22l-3.08-3.1m-3.81.1a2.5 2.5 0 0 1-2.5-2.5 2.5 2.5 0 0 1 2.5-2.5 2.5 2.5 0 0 1 2.5 2.5 2.5 2.5 0 0 1-2.5 2.5z\"/></svg>');\n --md-source-forks-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" d=\"M5 3.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm0 2.122a2.25 2.25 0 1 0-1.5 0v.878A2.25 2.25 0 0 0 5.75 8.5h1.5v2.128a2.251 2.251 0 1 0 1.5 0V8.5h1.5a2.25 2.25 0 0 0 2.25-2.25v-.878a2.25 2.25 0 1 0-1.5 0v.878a.75.75 0 0 1-.75.75h-4.5A.75.75 0 0 1 5 6.25v-.878zm3.75 7.378a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0zm3-8.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5z\"/></svg>');\n --md-source-repositories-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" d=\"M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 1 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 0 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 0 1 1-1h8zM5 12.25v3.25a.25.25 0 0 0 .4.2l1.45-1.087a.25.25 0 0 1 .3 0L8.6 15.7a.25.25 0 0 0 .4-.2v-3.25a.25.25 0 0 0-.25-.25h-3.5a.25.25 0 0 0-.25.25z\"/></svg>');\n --md-source-stars-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" d=\"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.75.75 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25zm0 2.445L6.615 5.5a.75.75 0 0 1-.564.41l-3.097.45 2.24 2.184a.75.75 0 0 1 .216.664l-.528 3.084 2.769-1.456a.75.75 0 0 1 .698 0l2.77 1.456-.53-3.084a.75.75 0 0 1 .216-.664l2.24-2.183-3.096-.45a.75.75 0 0 1-.564-.41L8 2.694v.001z\"/></svg>');\n --md-source-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path fill-rule=\"evenodd\" d=\"M2.5 7.775V2.75a.25.25 0 0 1 .25-.25h5.025a.25.25 0 0 1 .177.073l6.25 6.25a.25.25 0 0 1 0 .354l-5.025 5.025a.25.25 0 0 1-.354 0l-6.25-6.25a.25.25 0 0 1-.073-.177zm-1.5 0V2.75C1 1.784 1.784 1 2.75 1h5.025c.464 0 .91.184 1.238.513l6.25 6.25a1.75 1.75 0 0 1 0 2.474l-5.026 5.026a1.75 1.75 0 0 1-2.474 0l-6.25-6.25A1.75 1.75 0 0 1 1 7.775zM6 5a1 1 0 1 0 0 2 1 1 0 0 0 0-2z\"/></svg>');\n --md-version-icon: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\"><!--! Font Awesome Free 6.0.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--><path d=\"m310.6 246.6-127.1 128c-7.1 6.3-15.3 9.4-23.5 9.4s-16.38-3.125-22.63-9.375l-127.1-128C.224 237.5-2.516 223.7 2.438 211.8S19.07 192 32 192h255.1c12.94 0 24.62 7.781 29.58 19.75s3.12 25.75-6.08 34.85z\"/></svg>');\n \n --md-status--updated: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><title>cellphone-arrow-down</title><path d=\"M17,1H7A2,2 0 0,0 5,3V21A2,2 0 0,0 7,23H17A2,2 0 0,0 19,21V3A2,2 0 0,0 17,1M17,19H7V5H17V19M16,13H13V8H11V13H8L12,17L16,13Z\" /></svg>');\n --md-status: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M11 9h2V7h-2m1 13c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-18A10 10 0 0 0 2 12a10 10 0 0 0 10 10 10 10 0 0 0 10-10A10 10 0 0 0 12 2m-1 15h2v-6h-2v6Z\"/></svg>');\n --md-status--new: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"m23 12-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12m-10 5h-2v-2h2v2m0-4h-2V7h2v6Z\"/></svg>');\n --md-status--deprecated: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M9 3v1H4v2h1v13a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6h1V4h-5V3H9m0 5h2v9H9V8m4 0h2v9h-2V8Z\"/></svg>');\n --md-status--encrypted: url('data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\"><path d=\"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4m0 6c1.4 0 2.8 1.1 2.8 2.5V11c.6 0 1.2.6 1.2 1.3v3.5c0 .6-.6 1.2-1.3 1.2H9.2c-.6 0-1.2-.6-1.2-1.3v-3.5c0-.6.6-1.2 1.2-1.2V9.5C9.2 8.1 10.6 7 12 7m0 1.2c-.8 0-1.5.5-1.5 1.3V11h3V9.5c0-.8-.7-1.3-1.5-1.3Z\"/></svg>');\n}\n\n:host > * {\n /* CODE */\n --md-code-fg-color: ${theme.palette.text.primary};\n --md-code-bg-color: ${\n theme.palette.code?.background ?? theme.palette.background.paper\n };\n --md-code-hl-color: ${alpha(theme.palette.warning.main, 0.5)};\n --md-code-hl-color--light: var(--md-code-hl-color);\n --md-code-hl-keyword-color: ${\n theme.palette.type === 'dark'\n ? theme.palette.primary.light\n : theme.palette.primary.dark\n };\n --md-code-hl-function-color: ${\n theme.palette.type === 'dark'\n ? theme.palette.secondary.light\n : theme.palette.secondary.dark\n };\n --md-code-hl-string-color: ${\n theme.palette.type === 'dark'\n ? theme.palette.success.light\n : theme.palette.success.dark\n };\n --md-code-hl-number-color: ${\n theme.palette.type === 'dark'\n ? theme.palette.error.light\n : theme.palette.error.dark\n };\n --md-code-hl-constant-color: var(--md-code-hl-function-color);\n --md-code-hl-special-color: var(--md-code-hl-function-color);\n --md-code-hl-name-color: var(--md-code-fg-color);\n --md-code-hl-comment-color: var(--md-default-fg-color--light);\n --md-code-hl-generic-color: var(--md-default-fg-color--light);\n --md-code-hl-variable-color: var(--md-default-fg-color--light);\n --md-code-hl-operator-color: var(--md-default-fg-color--light);\n --md-code-hl-punctuation-color: var(--md-default-fg-color--light);\n\n /* TYPESET */\n --md-typeset-font-size: 1rem;\n --md-typeset-color: var(--md-default-fg-color);\n --md-typeset-a-color: ${theme.palette.link};\n --md-typeset-table-color: ${theme.palette.text.primary};\n --md-typeset-table-color--light: ${alpha(theme.palette.text.primary, 0.05)};\n --md-typeset-del-color: ${\n theme.palette.type === 'dark'\n ? alpha(theme.palette.error.dark, 0.5)\n : alpha(theme.palette.error.light, 0.5)\n };\n --md-typeset-ins-color: ${\n theme.palette.type === 'dark'\n ? alpha(theme.palette.success.dark, 0.5)\n : alpha(theme.palette.success.light, 0.5)\n };\n --md-typeset-mark-color: ${\n theme.palette.type === 'dark'\n ? alpha(theme.palette.warning.dark, 0.5)\n : alpha(theme.palette.warning.light, 0.5)\n };\n --md-typeset-kbd-color: var(--md-code-bg-color);\n --md-typeset-kbd-accent-color var(--md-code-bg-color);\n --md-typeset-kbd-border-color: var(--md-default-fg-color--light);\n}\n\n@media screen and (max-width: 76.1875em) {\n :host > * {\n /* TYPESET */\n --md-typeset-font-size: .9rem;\n }\n}\n\n@media screen and (max-width: 600px) {\n :host > * {\n /* TYPESET */\n --md-typeset-font-size: .7rem;\n }\n}\n\n --md-footer-bg-color: var(--md-default-bg-color);\n --md-footer-bg-color--dark: var(--md-default-bg-color);\n`;\n"],"names":[],"mappings":";;AAmBA,gBAAe,CAAC,EAAE,KAAA,EAAyB,KAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA,yBAShB,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,OAAO,CAAA;AAAA,gCACnB,EAAA,KAAA,CAAM,OAAQ,CAAA,IAAA,CAAK,SAAS,CAAA;AAAA,kCAAA,EAC1B,QAAQ,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,SAAA,EAAW,GAAG,CAAC,CAAA;AAAA,mCACzC,EAAA,OAAA;AAAA,EACjC,KAAA,CAAM,QAAQ,IAAK,CAAA,SAAA;AA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AA;AAAA,mCAAA,EACnB,MAAM,KAAM,CAAA,OAAA,CAAQ,IAAK,CAAA,OAAA,EAAS,IAAI,CAAC,CAAA;AAAA,0BAAA,EAExE,MAAM,OAAQ,CAAA,IAAA,KAAS,MACnB,GAAA,KAAA,CAAM,MAAM,OAAQ,CAAA,KAAA,CAAM,IAAM,EAAA,GAAG,IACnC,KAAM,CAAA,KAAA,CAAM,QAAQ,KAAM,CAAA,KAAA,EAAO,GAAG,CAC1C,CAAA;AAAA,0BAAA,EAEE,MAAM,OAAQ,CAAA,IAAA,KAAS,MACnB,GAAA,KAAA,CAAM,MAAM,OAAQ,CAAA,OAAA,CAAQ,IAAM,EAAA,GAAG,IACrC,KAAM,CAAA,KAAA,CAAM,QAAQ,OAAQ,CAAA,KAAA,EAAO,GAAG,CAC5C,CAAA;AAAA,2BAAA,EAEE,MAAM,OAAQ,CAAA,IAAA,KAAS,MACnB,GAAA,KAAA,CAAM,MAAM,OAAQ,CAAA,OAAA,CAAQ,IAAM,EAAA,GAAG,IACrC,KAAM,CAAA,KAAA,CAAM,QAAQ,OAAQ,CAAA,KAAA,EAAO,GAAG,CAC5C,CAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformer.esm.js","sources":["../../../../src/reader/transformers/styles/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 { useCallback, useMemo } from 'react';\nimport { useTheme } from '@material-ui/core/styles';\nimport { useSidebarPinState } from '@backstage/core-components';\nimport { Transformer } from '../transformer';\nimport { rules } from './rules';\n\n/**\n * Sidebar pinned state to be used in computing style injections.\n */\nconst useSidebar = () => useSidebarPinState();\n\n/**\n * Process all rules and concatenate their definitions into a single style.\n * @returns a string containing all processed style definitions.\n */\nconst useRuleStyles = () => {\n const sidebar = useSidebar();\n const theme = useTheme();\n\n return useMemo(() => {\n const options = { theme, sidebar };\n return rules.reduce<string>((styles, rule) => styles + rule(options), '');\n }, [theme, sidebar]);\n};\n\n/**\n * Returns a transformer that inserts all style rules into the given element's head tag.\n */\nexport const useStylesTransformer = (): Transformer => {\n const styles = useRuleStyles();\n\n return useCallback(\n (dom: Element) => {\n dom\n .getElementsByTagName('head')[0]\n .insertAdjacentHTML('beforeend', `<style>${styles}</style>`);\n return dom;\n },\n [styles],\n );\n};\n"],"names":[],"mappings":";;;;;AAyBA,MAAM,UAAA,GAAa,MAAM,kBAAmB,EAAA
|
|
1
|
+
{"version":3,"file":"transformer.esm.js","sources":["../../../../src/reader/transformers/styles/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 { useCallback, useMemo } from 'react';\nimport { useTheme } from '@material-ui/core/styles';\nimport { useSidebarPinState } from '@backstage/core-components';\nimport { Transformer } from '../transformer';\nimport { rules } from './rules';\n\n/**\n * Sidebar pinned state to be used in computing style injections.\n */\nconst useSidebar = () => useSidebarPinState();\n\n/**\n * Process all rules and concatenate their definitions into a single style.\n * @returns a string containing all processed style definitions.\n */\nconst useRuleStyles = () => {\n const sidebar = useSidebar();\n const theme = useTheme();\n\n return useMemo(() => {\n const options = { theme, sidebar };\n return rules.reduce<string>((styles, rule) => styles + rule(options), '');\n }, [theme, sidebar]);\n};\n\n/**\n * Returns a transformer that inserts all style rules into the given element's head tag.\n */\nexport const useStylesTransformer = (): Transformer => {\n const styles = useRuleStyles();\n\n return useCallback(\n (dom: Element) => {\n dom\n .getElementsByTagName('head')[0]\n .insertAdjacentHTML('beforeend', `<style>${styles}</style>`);\n return dom;\n },\n [styles],\n );\n};\n"],"names":[],"mappings":";;;;;AAyBA,MAAM,UAAA,GAAa,MAAM,kBAAmB,EAAA;AAM5C,MAAM,gBAAgB,MAAM;AAC1B,EAAA,MAAM,UAAU,UAAW,EAAA;AAC3B,EAAA,MAAM,QAAQ,QAAS,EAAA;AAEvB,EAAA,OAAO,QAAQ,MAAM;AACnB,IAAM,MAAA,OAAA,GAAU,EAAE,KAAA,EAAO,OAAQ,EAAA;AACjC,IAAO,OAAA,KAAA,CAAM,OAAe,CAAC,MAAA,EAAQ,SAAS,MAAS,GAAA,IAAA,CAAK,OAAO,CAAA,EAAG,EAAE,CAAA;AAAA,GACvE,EAAA,CAAC,KAAO,EAAA,OAAO,CAAC,CAAA;AACrB,CAAA;AAKO,MAAM,uBAAuB,MAAmB;AACrD,EAAA,MAAM,SAAS,aAAc,EAAA;AAE7B,EAAO,OAAA,WAAA;AAAA,IACL,CAAC,GAAiB,KAAA;AAChB,MACG,GAAA,CAAA,oBAAA,CAAqB,MAAM,CAAE,CAAA,CAAC,EAC9B,kBAAmB,CAAA,WAAA,EAAa,CAAU,OAAA,EAAA,MAAM,CAAU,QAAA,CAAA,CAAA;AAC7D,MAAO,OAAA,GAAA;AAAA,KACT;AAAA,IACA,CAAC,MAAM;AAAA,GACT;AACF;;;;"}
|