Review feedback.

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Eric Peterson
2022-04-12 11:25:25 +02:00
parent 1f51e960af
commit ca4420782c
5 changed files with 11 additions and 9 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
'@backstage/integration': patch
---
replaceGitLabUrlType exported from package
Exported `replaceGitLabUrlType` from package
+1 -1
View File
@@ -5,5 +5,5 @@ This package provides frontend utilities for TechDocs and Addons.
## Installation
```sh
yarn add @backstage/plugin-techdocs-react
yarn add --cwd packages/app @backstage/plugin-techdocs-react
```
+3 -3
View File
@@ -80,17 +80,17 @@ export type TechDocsReaderPageValue = {
onReady?: () => void;
};
// @public
// @alpha
export const useShadowRoot: () => ShadowRoot | undefined;
// @public
// @alpha
export const useShadowRootElements: <
TReturnedElement extends HTMLElement = HTMLElement,
>(
selectors: string[],
) => TReturnedElement[];
// @public
// @alpha
export const useShadowRootSelection: (wait?: number) => Selection | null;
// @alpha
+3 -1
View File
@@ -5,6 +5,7 @@
"private": false,
"publishConfig": {
"access": "public",
"alphaTypes": "dist/index.alpha.d.ts",
"main": "dist/index.esm.js",
"types": "dist/index.d.ts"
},
@@ -25,7 +26,7 @@
"main": "src/index.ts",
"types": "src/index.ts",
"scripts": {
"build": "backstage-cli package build",
"build": "backstage-cli package build --experimental-type-build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"prepack": "backstage-cli package prepack",
@@ -59,6 +60,7 @@
"@backstage/theme": "^0.2.15"
},
"files": [
"alpha",
"dist"
]
}
+3 -3
View File
@@ -20,7 +20,7 @@ import { useTechDocsReaderPage } from './context';
/**
* Hook for use within TechDocs addons that provides access to the underlying
* shadow root of the current page, allowing the DOM within to be mutated.
* @public
* @alpha
*/
export const useShadowRoot = () => {
const { shadowRoot } = useTechDocsReaderPage();
@@ -31,7 +31,7 @@ export const useShadowRoot = () => {
* Convenience hook for use within TechDocs addons that provides access to
* elements that match a given selector within the shadow root.
*
* @public
* @alpha
*/
export const useShadowRootElements = <
TReturnedElement extends HTMLElement = HTMLElement,
@@ -58,7 +58,7 @@ const isValidSelection = (newSelection: Selection) => {
/**
* Hook for retreiving a selection within the ShadowRoot.
* @public
* @alpha
*/
export const useShadowRootSelection = (wait: number = 0) => {
const shadowRoot = useShadowRoot();