@backstage/plugin-techdocs 0.0.0-nightly-20240731020649 → 0.0.0-nightly-20240801022222
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,28 +1,29 @@
|
|
|
1
1
|
# @backstage/plugin-techdocs
|
|
2
2
|
|
|
3
|
-
## 0.0.0-nightly-
|
|
3
|
+
## 0.0.0-nightly-20240801022222
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
7
|
- 69bd940: Use annotation constants from new techdocs-common package.
|
|
8
|
+
- bdc5471: Fixed issue where header styles were incorrectly generated when themes used CSS variables to define font size.
|
|
8
9
|
- 6349099: Added config input type to the extensions
|
|
9
10
|
- Updated dependencies
|
|
10
|
-
- @backstage/frontend-plugin-api@0.0.0-nightly-
|
|
11
|
-
- @backstage/plugin-catalog-react@0.0.0-nightly-
|
|
12
|
-
- @backstage/plugin-search-react@0.0.0-nightly-
|
|
13
|
-
- @backstage/core-components@0.0.0-nightly-
|
|
14
|
-
- @backstage/integration@0.0.0-nightly-
|
|
15
|
-
- @backstage/plugin-techdocs-common@0.0.0-nightly-
|
|
16
|
-
- @backstage/plugin-auth-react@0.0.0-nightly-
|
|
17
|
-
- @backstage/core-compat-api@0.0.0-nightly-
|
|
11
|
+
- @backstage/frontend-plugin-api@0.0.0-nightly-20240801022222
|
|
12
|
+
- @backstage/plugin-catalog-react@0.0.0-nightly-20240801022222
|
|
13
|
+
- @backstage/plugin-search-react@0.0.0-nightly-20240801022222
|
|
14
|
+
- @backstage/core-components@0.0.0-nightly-20240801022222
|
|
15
|
+
- @backstage/integration@0.0.0-nightly-20240801022222
|
|
16
|
+
- @backstage/plugin-techdocs-common@0.0.0-nightly-20240801022222
|
|
17
|
+
- @backstage/plugin-auth-react@0.0.0-nightly-20240801022222
|
|
18
|
+
- @backstage/core-compat-api@0.0.0-nightly-20240801022222
|
|
18
19
|
- @backstage/catalog-model@1.5.0
|
|
19
20
|
- @backstage/config@1.2.0
|
|
20
21
|
- @backstage/core-plugin-api@1.9.3
|
|
21
22
|
- @backstage/errors@1.2.4
|
|
22
|
-
- @backstage/integration-react@0.0.0-nightly-
|
|
23
|
+
- @backstage/integration-react@0.0.0-nightly-20240801022222
|
|
23
24
|
- @backstage/theme@0.5.6
|
|
24
|
-
- @backstage/plugin-search-common@0.0.0-nightly-
|
|
25
|
-
- @backstage/plugin-techdocs-react@0.0.0-nightly-
|
|
25
|
+
- @backstage/plugin-search-common@0.0.0-nightly-20240801022222
|
|
26
|
+
- @backstage/plugin-techdocs-react@0.0.0-nightly-20240801022222
|
|
26
27
|
|
|
27
28
|
## 1.10.8-next.1
|
|
28
29
|
|
package/alpha/package.json
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const headings = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
2
|
+
const relativeLengthUnit = /(em)|(rem)/gi;
|
|
3
|
+
const cssVariable = /var\(|\)/gi;
|
|
2
4
|
var typeset = ({ theme }) => `
|
|
3
5
|
/*================== Typeset ==================*/
|
|
4
6
|
|
|
@@ -11,14 +13,20 @@ ${headings.reduce((style, heading) => {
|
|
|
11
13
|
const styles = theme.typography[heading];
|
|
12
14
|
const { lineHeight, fontFamily, fontWeight, fontSize } = styles;
|
|
13
15
|
const calculate = (value) => {
|
|
14
|
-
let factor = 1;
|
|
15
16
|
if (typeof value === "number") {
|
|
16
|
-
|
|
17
|
+
return calculate(`${value / htmlFontSize * 0.6}rem`);
|
|
18
|
+
} else if (typeof value === "string") {
|
|
19
|
+
if (value.match(cssVariable)) {
|
|
20
|
+
const resolvedValue = window.getComputedStyle(document.body).getPropertyValue(value.replaceAll(cssVariable, ""));
|
|
21
|
+
if (resolvedValue !== "") {
|
|
22
|
+
return calculate(resolvedValue);
|
|
23
|
+
}
|
|
24
|
+
} else if (value.match(relativeLengthUnit)) {
|
|
25
|
+
const factor = value.replace(relativeLengthUnit, "");
|
|
26
|
+
return `calc(${factor} * var(--md-typeset-font-size))`;
|
|
27
|
+
}
|
|
17
28
|
}
|
|
18
|
-
|
|
19
|
-
factor = value.replace("rem", "");
|
|
20
|
-
}
|
|
21
|
-
return `calc(${factor} * var(--md-typeset-font-size))`;
|
|
29
|
+
return value;
|
|
22
30
|
};
|
|
23
31
|
return style.concat(`
|
|
24
32
|
.md-typeset ${heading} {
|
|
@@ -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'];\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)
|
|
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}\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,CAAA;AAC9E,MAAM,kBAA6B,GAAA,cAAA,CAAA;AACnC,MAAM,WAAsB,GAAA,YAAA,CAAA;AAE5B,cAAe,CAAC,EAAE,KAAA,EAAyB,KAAA,CAA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AAA;AAAA,gBAAA,EACJ,OAAO,CAAA;AAAA;AAAA,mBAAA,EAEJ,UAAU,CAAA;AAAA,mBAAA,EACV,UAAU,CAAA;AAAA,mBAAA,EACV,UAAU,CAAA;AAAA,iBACZ,EAAA,SAAA,CAAU,QAAQ,CAAC,CAAA;AAAA;AAAA,EAEnC,CAAA,CAAA,CAAA;AACH,CAAA,EAAG,EAAE,CAAC,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAO4B,EAAA,KAAA,CAAM,QAAQ,OAAO,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-techdocs",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20240801022222",
|
|
4
4
|
"description": "The Backstage plugin that renders technical documentation for your components",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "frontend-plugin",
|
|
@@ -60,19 +60,19 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@backstage/catalog-model": "^1.5.0",
|
|
62
62
|
"@backstage/config": "^1.2.0",
|
|
63
|
-
"@backstage/core-compat-api": "^0.0.0-nightly-
|
|
64
|
-
"@backstage/core-components": "^0.0.0-nightly-
|
|
63
|
+
"@backstage/core-compat-api": "^0.0.0-nightly-20240801022222",
|
|
64
|
+
"@backstage/core-components": "^0.0.0-nightly-20240801022222",
|
|
65
65
|
"@backstage/core-plugin-api": "^1.9.3",
|
|
66
66
|
"@backstage/errors": "^1.2.4",
|
|
67
|
-
"@backstage/frontend-plugin-api": "^0.0.0-nightly-
|
|
68
|
-
"@backstage/integration": "^0.0.0-nightly-
|
|
69
|
-
"@backstage/integration-react": "^0.0.0-nightly-
|
|
70
|
-
"@backstage/plugin-auth-react": "^0.0.0-nightly-
|
|
71
|
-
"@backstage/plugin-catalog-react": "^0.0.0-nightly-
|
|
72
|
-
"@backstage/plugin-search-common": "^0.0.0-nightly-
|
|
73
|
-
"@backstage/plugin-search-react": "^0.0.0-nightly-
|
|
74
|
-
"@backstage/plugin-techdocs-common": "^0.0.0-nightly-
|
|
75
|
-
"@backstage/plugin-techdocs-react": "^0.0.0-nightly-
|
|
67
|
+
"@backstage/frontend-plugin-api": "^0.0.0-nightly-20240801022222",
|
|
68
|
+
"@backstage/integration": "^0.0.0-nightly-20240801022222",
|
|
69
|
+
"@backstage/integration-react": "^0.0.0-nightly-20240801022222",
|
|
70
|
+
"@backstage/plugin-auth-react": "^0.0.0-nightly-20240801022222",
|
|
71
|
+
"@backstage/plugin-catalog-react": "^0.0.0-nightly-20240801022222",
|
|
72
|
+
"@backstage/plugin-search-common": "^0.0.0-nightly-20240801022222",
|
|
73
|
+
"@backstage/plugin-search-react": "^0.0.0-nightly-20240801022222",
|
|
74
|
+
"@backstage/plugin-techdocs-common": "^0.0.0-nightly-20240801022222",
|
|
75
|
+
"@backstage/plugin-techdocs-react": "^0.0.0-nightly-20240801022222",
|
|
76
76
|
"@backstage/theme": "^0.5.6",
|
|
77
77
|
"@material-ui/core": "^4.12.2",
|
|
78
78
|
"@material-ui/icons": "^4.9.1",
|
|
@@ -88,11 +88,11 @@
|
|
|
88
88
|
"react-use": "^17.2.4"
|
|
89
89
|
},
|
|
90
90
|
"devDependencies": {
|
|
91
|
-
"@backstage/cli": "^0.0.0-nightly-
|
|
92
|
-
"@backstage/core-app-api": "^0.0.0-nightly-
|
|
93
|
-
"@backstage/dev-utils": "^0.0.0-nightly-
|
|
94
|
-
"@backstage/plugin-techdocs-module-addons-contrib": "^0.0.0-nightly-
|
|
95
|
-
"@backstage/test-utils": "^0.0.0-nightly-
|
|
91
|
+
"@backstage/cli": "^0.0.0-nightly-20240801022222",
|
|
92
|
+
"@backstage/core-app-api": "^0.0.0-nightly-20240801022222",
|
|
93
|
+
"@backstage/dev-utils": "^0.0.0-nightly-20240801022222",
|
|
94
|
+
"@backstage/plugin-techdocs-module-addons-contrib": "^0.0.0-nightly-20240801022222",
|
|
95
|
+
"@backstage/test-utils": "^0.0.0-nightly-20240801022222",
|
|
96
96
|
"@testing-library/dom": "^10.0.0",
|
|
97
97
|
"@testing-library/jest-dom": "^6.0.0",
|
|
98
98
|
"@testing-library/react": "^15.0.0",
|