@backstage/plugin-techdocs 1.14.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @backstage/plugin-techdocs
2
2
 
3
+ ## 1.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - e4d09a3: Reverts a change in CSS layout that shifted the content of the Techdocs too far to the left.
8
+ - Updated dependencies
9
+ - @backstage/core-compat-api@0.5.1
10
+
3
11
  ## 1.14.0
4
12
 
5
13
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-techdocs";
2
- var version = "1.14.0";
2
+ var version = "1.14.1";
3
3
  var description = "The Backstage plugin that renders technical documentation for your components";
4
4
  var backstage = {
5
5
  role: "frontend-plugin",
@@ -1,15 +1,6 @@
1
- var layout = ({ theme, sidebar }) => {
2
- const sidebarWidth = sidebar.isPresent ? `${sidebar.width}px` : "0px";
3
- const sidebarMargin = sidebar.isPresent ? "16rem" : "0";
4
- let sidebarLeftPosition;
5
- if (!sidebar.isPresent) {
6
- sidebarLeftPosition = "-16rem";
7
- } else if (sidebar.isPinned) {
8
- sidebarLeftPosition = `calc(-16rem + ${sidebarWidth})`;
9
- } else {
10
- sidebarLeftPosition = "calc(-16rem + 72px)";
11
- }
12
- return `
1
+ const SIDEBAR_WIDTH = "224px";
2
+ var layout = ({ theme, sidebar }) => `
3
+
13
4
  /*================== Layout ==================*/
14
5
 
15
6
  /* mkdocs material v9 compat */
@@ -113,12 +104,12 @@ var layout = ({ theme, sidebar }) => {
113
104
 
114
105
  .md-content {
115
106
  max-width: calc(100% - 16rem * 2);
116
- margin-left: ${sidebarMargin};
107
+ margin-left: 16rem;
117
108
  margin-bottom: 50px;
118
109
  }
119
110
 
120
111
  .md-content > .md-sidebar {
121
- left: ${sidebarMargin};
112
+ left: 16rem;
122
113
  }
123
114
 
124
115
  .md-footer {
@@ -200,7 +191,7 @@ var layout = ({ theme, sidebar }) => {
200
191
  .md-sidebar--primary {
201
192
  width: 16rem !important;
202
193
  z-index: 200;
203
- left: ${sidebarLeftPosition} !important;
194
+ left: ${sidebar.isPinned ? `calc(-16rem + ${SIDEBAR_WIDTH})` : "calc(-16rem + 72px)"} !important;
204
195
  }
205
196
  .md-sidebar--secondary:not([hidden]) {
206
197
  display: none;
@@ -256,7 +247,6 @@ var layout = ({ theme, sidebar }) => {
256
247
  }
257
248
  }
258
249
  `;
259
- };
260
250
 
261
251
  export { layout as default };
262
252
  //# sourceMappingURL=layout.esm.js.map
@@ -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\nexport default ({ theme, sidebar }: RuleOptions) => {\n const sidebarWidth = sidebar.isPresent ? `${sidebar.width}px` : '0px';\n const sidebarMargin = sidebar.isPresent ? '16rem' : '0';\n\n // Calculate the sidebar position for mobile layouts\n let sidebarLeftPosition;\n if (!sidebar.isPresent) {\n sidebarLeftPosition = '-16rem';\n } else if (sidebar.isPinned) {\n sidebarLeftPosition = `calc(-16rem + ${sidebarWidth})`;\n } else {\n sidebarLeftPosition = 'calc(-16rem + 72px)';\n }\n\n return `\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: ${sidebarMargin};\n margin-bottom: 50px;\n}\n\n.md-content > .md-sidebar {\n left: ${sidebarMargin};\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: ${sidebarLeftPosition} !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};\n"],"names":[],"mappings":"AAkBA,aAAe,CAAC,EAAE,KAAA,EAAO,OAAA,EAAQ,KAAmB;AAClD,EAAA,MAAM,eAAe,OAAA,CAAQ,SAAA,GAAY,CAAA,EAAG,OAAA,CAAQ,KAAK,CAAA,EAAA,CAAA,GAAO,KAAA;AAChE,EAAA,MAAM,aAAA,GAAgB,OAAA,CAAQ,SAAA,GAAY,OAAA,GAAU,GAAA;AAGpD,EAAA,IAAI,mBAAA;AACJ,EAAA,IAAI,CAAC,QAAQ,SAAA,EAAW;AACtB,IAAA,mBAAA,GAAsB,QAAA;AAAA,EACxB,CAAA,MAAA,IAAW,QAAQ,QAAA,EAAU;AAC3B,IAAA,mBAAA,GAAsB,iBAAiB,YAAY,CAAA,CAAA,CAAA;AAAA,EACrD,CAAA,MAAO;AACL,IAAA,mBAAA,GAAsB,qBAAA;AAAA,EACxB;AAEA,EAAA,OAAO;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,EA2BO,KAAA,CAAM,OAAA,CAAQ,CAAC,CAAC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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AAwD/B,CAAA;;;;"}
1
+ {"version":3,"file":"layout.esm.js","sources":["../../../../../src/reader/transformers/styles/rules/layout.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { RuleOptions } from './types';\n\nconst SIDEBAR_WIDTH = '224px';\n\nexport default ({ theme, sidebar }: RuleOptions) => `\n\n/*================== Layout ==================*/\n\n/* mkdocs material v9 compat */\n.md-nav__title {\n color: var(--md-default-fg-color);\n}\n\n.md-grid {\n max-width: 100%;\n margin: 0;\n}\n\n.md-nav {\n font-size: calc(var(--md-typeset-font-size) * 0.9);\n}\n.md-nav__link:not(:has(svg)) {\n display: flex;\n align-items: center;\n justify-content: space-between;\n}\n.md-nav__link:has(svg) > .md-ellipsis {\n flex-grow: 1;\n}\n.md-nav__icon {\n height: 20px !important;\n width: 20px !important;\n margin-left:${theme.spacing(1)}px;\n}\n.md-nav__icon svg {\n margin: 0;\n width: 20px !important;\n height: 20px !important;\n}\n.md-nav__icon:after {\n width: 20px !important;\n height: 20px !important;\n}\n.md-status--updated::after {\n -webkit-mask-image: var(--md-status--updated);\n mask-image: var(--md-status--updated);\n}\n\n.md-nav__item--active > .md-nav__link, a.md-nav__link--active {\n text-decoration: underline;\n color: var(--md-typeset-a-color);\n}\n.md-nav__link--active > .md-status:after {\n background-color: var(--md-typeset-a-color);\n}\n.md-nav__link[href]:hover > .md-status:after {\n background-color: var(--md-accent-fg-color);\n}\n\n.md-main__inner {\n margin-top: 0;\n}\n\n.md-sidebar {\n bottom: 75px;\n position: fixed;\n width: 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,aAAA,GAAgB,OAAA;AAEtB,aAAe,CAAC,EAAE,KAAA,EAAO,OAAA,EAAQ,KAAmB;;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA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AA;;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;;;;"}
@@ -3,19 +3,7 @@ import { useTheme } from '@material-ui/core/styles';
3
3
  import { useSidebarPinState } from '@backstage/core-components';
4
4
  import { rules } from './rules/rules.esm.js';
5
5
 
6
- const SIDEBAR_WIDTH = 224;
7
- const useSidebar = () => {
8
- const pinState = useSidebarPinState();
9
- const hasSidebar = useMemo(
10
- () => typeof window !== "undefined" && Boolean(document.querySelector('[class*="BackstageSidebar"]')),
11
- []
12
- );
13
- return {
14
- isPinned: pinState.isPinned,
15
- isPresent: hasSidebar,
16
- width: SIDEBAR_WIDTH
17
- };
18
- };
6
+ const useSidebar = () => useSidebarPinState();
19
7
  const useRuleStyles = () => {
20
8
  const sidebar = useSidebar();
21
9
  const theme = useTheme();
@@ -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\nconst SIDEBAR_WIDTH = 224;\n/**\n * Enhanced sidebar state that detects presence through CSS environment.\n */\nconst useSidebar = () => {\n const pinState = useSidebarPinState();\n\n const hasSidebar = useMemo(\n () =>\n typeof window !== 'undefined' &&\n Boolean(document.querySelector('[class*=\"BackstageSidebar\"]')),\n [],\n );\n\n return {\n isPinned: pinState.isPinned,\n isPresent: hasSidebar,\n width: SIDEBAR_WIDTH,\n };\n};\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":";;;;;AAsBA,MAAM,aAAA,GAAgB,GAAA;AAItB,MAAM,aAAa,MAAM;AACvB,EAAA,MAAM,WAAW,kBAAA,EAAmB;AAEpC,EAAA,MAAM,UAAA,GAAa,OAAA;AAAA,IACjB,MACE,OAAO,MAAA,KAAW,WAAA,IAClB,QAAQ,QAAA,CAAS,aAAA,CAAc,6BAA6B,CAAC,CAAA;AAAA,IAC/D;AAAC,GACH;AAEA,EAAA,OAAO;AAAA,IACL,UAAU,QAAA,CAAS,QAAA;AAAA,IACnB,SAAA,EAAW,UAAA;AAAA,IACX,KAAA,EAAO;AAAA,GACT;AACF,CAAA;AAMA,MAAM,gBAAgB,MAAM;AAC1B,EAAA,MAAM,UAAU,UAAA,EAAW;AAC3B,EAAA,MAAM,QAAQ,QAAA,EAAS;AAEvB,EAAA,OAAO,QAAQ,MAAM;AACnB,IAAA,MAAM,OAAA,GAAU,EAAE,KAAA,EAAO,OAAA,EAAQ;AACjC,IAAA,OAAO,KAAA,CAAM,OAAe,CAAC,MAAA,EAAQ,SAAS,MAAA,GAAS,IAAA,CAAK,OAAO,CAAA,EAAG,EAAE,CAAA;AAAA,EAC1E,CAAA,EAAG,CAAC,KAAA,EAAO,OAAO,CAAC,CAAA;AACrB,CAAA;AAKO,MAAM,uBAAuB,MAAmB;AACrD,EAAA,MAAM,SAAS,aAAA,EAAc;AAE7B,EAAA,OAAO,WAAA;AAAA,IACL,CAAC,GAAA,KAAiB;AAChB,MAAA,GAAA,CACG,oBAAA,CAAqB,MAAM,CAAA,CAAE,CAAC,EAC9B,kBAAA,CAAmB,WAAA,EAAa,CAAA,OAAA,EAAU,MAAM,CAAA,QAAA,CAAU,CAAA;AAC7D,MAAA,OAAO,GAAA;AAAA,IACT,CAAA;AAAA,IACA,CAAC,MAAM;AAAA,GACT;AACF;;;;"}
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,kBAAA,EAAmB;AAM5C,MAAM,gBAAgB,MAAM;AAC1B,EAAA,MAAM,UAAU,UAAA,EAAW;AAC3B,EAAA,MAAM,QAAQ,QAAA,EAAS;AAEvB,EAAA,OAAO,QAAQ,MAAM;AACnB,IAAA,MAAM,OAAA,GAAU,EAAE,KAAA,EAAO,OAAA,EAAQ;AACjC,IAAA,OAAO,KAAA,CAAM,OAAe,CAAC,MAAA,EAAQ,SAAS,MAAA,GAAS,IAAA,CAAK,OAAO,CAAA,EAAG,EAAE,CAAA;AAAA,EAC1E,CAAA,EAAG,CAAC,KAAA,EAAO,OAAO,CAAC,CAAA;AACrB,CAAA;AAKO,MAAM,uBAAuB,MAAmB;AACrD,EAAA,MAAM,SAAS,aAAA,EAAc;AAE7B,EAAA,OAAO,WAAA;AAAA,IACL,CAAC,GAAA,KAAiB;AAChB,MAAA,GAAA,CACG,oBAAA,CAAqB,MAAM,CAAA,CAAE,CAAC,EAC9B,kBAAA,CAAmB,WAAA,EAAa,CAAA,OAAA,EAAU,MAAM,CAAA,QAAA,CAAU,CAAA;AAC7D,MAAA,OAAO,GAAA;AAAA,IACT,CAAA;AAAA,IACA,CAAC,MAAM;AAAA,GACT;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-techdocs",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "description": "The Backstage plugin that renders technical documentation for your components",
5
5
  "backstage": {
6
6
  "role": "frontend-plugin",
@@ -74,7 +74,7 @@
74
74
  "@backstage/catalog-client": "^1.11.0",
75
75
  "@backstage/catalog-model": "^1.7.5",
76
76
  "@backstage/config": "^1.3.3",
77
- "@backstage/core-compat-api": "^0.5.0",
77
+ "@backstage/core-compat-api": "^0.5.1",
78
78
  "@backstage/core-components": "^0.17.5",
79
79
  "@backstage/core-plugin-api": "^1.10.9",
80
80
  "@backstage/errors": "^1.2.7",
@@ -82,7 +82,7 @@
82
82
  "@backstage/integration": "^1.17.1",
83
83
  "@backstage/integration-react": "^1.2.9",
84
84
  "@backstage/plugin-auth-react": "^0.1.18",
85
- "@backstage/plugin-catalog-react": "^1.20.0",
85
+ "@backstage/plugin-catalog-react": "^1.20.1",
86
86
  "@backstage/plugin-search-common": "^1.2.19",
87
87
  "@backstage/plugin-search-react": "^1.9.3",
88
88
  "@backstage/plugin-techdocs-common": "^0.1.1",