@backstage/plugin-techdocs-module-addons-contrib 0.1.0-next.0 → 1.0.0

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,112 @@
1
1
  # @backstage/plugin-techdocs-module-addons-contrib
2
2
 
3
+ ## 1.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 0ad901569f: The TechDocs Addon framework is now generally available.
8
+
9
+ ### Minor Changes
10
+
11
+ - 5f4dbd2b52: A package for contributed TechDocs addons.
12
+
13
+ In this release it will introduce the ReportIssue addon, which lets you select text and open a GitHub/Gitlab issue.
14
+
15
+ ### Patch Changes
16
+
17
+ - 10d86dedc0: Improved inline/type documentation for the <ReportIssue /> addon.
18
+ - 52419be116: Create a TechDocs `<TextSize/>` addon that allows users to set a font size in the browser's local storage for the text of documentation pages.
19
+
20
+ Here's an example on how to use it in a Backstage app:
21
+
22
+ ```diff
23
+ import {
24
+ DefaultTechDocsHome,
25
+ TechDocsIndexPage,
26
+ TechDocsReaderPage,
27
+ } from '@backstage/plugin-techdocs';
28
+ import { TechDocsAddons } from '@backstage/plugin-techdocs-react/alpha';
29
+ +import { TextSize } from '@backstage/plugin-techdocs-module-addons-contrib';
30
+
31
+ const AppRoutes = () => {
32
+ <FlatRoutes>
33
+ // other plugin routes
34
+ <Route path="/docs" element={<TechDocsIndexPage />}>
35
+ <DefaultTechDocsHome />
36
+ </Route>
37
+ <Route
38
+ path="/docs/:namespace/:kind/:name/*"
39
+ element={<TechDocsReaderPage />}
40
+ >
41
+ <TechDocsAddons>
42
+ + <TextSize />
43
+ </TechDocsAddons>
44
+ </Route>
45
+ </FlatRoutes>;
46
+ };
47
+ ```
48
+
49
+ - 075a9a067b: Updated the return type of `createTechDocsAddonExtension` to better reflect the fact that passing children to Addon components is not a valid use-case.
50
+ - c25e880e36: Introducing the Expandable Navigation addon, which lets you expand and collapse the TechDocs main navigation and store your preference in local storage.
51
+ - Updated dependencies
52
+ - @backstage/core-components@0.9.4
53
+ - @backstage/integration@1.2.0
54
+ - @backstage/core-plugin-api@1.0.2
55
+ - @backstage/integration-react@1.1.0
56
+ - @backstage/plugin-techdocs-react@1.0.0
57
+
58
+ ## 0.1.0-next.2
59
+
60
+ ### Patch Changes
61
+
62
+ - 52419be116: Create a TechDocs `<TextSize/>` addon that allows users to set a font size in the browser's local storage for the text of documentation pages.
63
+
64
+ Here's an example on how to use it in a Backstage app:
65
+
66
+ ```diff
67
+ import {
68
+ DefaultTechDocsHome,
69
+ TechDocsIndexPage,
70
+ TechDocsReaderPage,
71
+ } from '@backstage/plugin-techdocs';
72
+ import { TechDocsAddons } from '@backstage/plugin-techdocs-react/alpha';
73
+ +import { TextSize } from '@backstage/plugin-techdocs-module-addons-contrib';
74
+
75
+ const AppRoutes = () => {
76
+ <FlatRoutes>
77
+ // other plugin routes
78
+ <Route path="/docs" element={<TechDocsIndexPage />}>
79
+ <DefaultTechDocsHome />
80
+ </Route>
81
+ <Route
82
+ path="/docs/:namespace/:kind/:name/*"
83
+ element={<TechDocsReaderPage />}
84
+ >
85
+ <TechDocsAddons>
86
+ + <TextSize />
87
+ </TechDocsAddons>
88
+ </Route>
89
+ </FlatRoutes>;
90
+ };
91
+ ```
92
+
93
+ - Updated dependencies
94
+ - @backstage/core-components@0.9.4-next.1
95
+ - @backstage/plugin-techdocs-react@0.1.1-next.2
96
+ - @backstage/core-plugin-api@1.0.2-next.1
97
+ - @backstage/integration@1.2.0-next.1
98
+ - @backstage/integration-react@1.1.0-next.2
99
+
100
+ ## 0.1.0-next.1
101
+
102
+ ### Patch Changes
103
+
104
+ - Updated dependencies
105
+ - @backstage/core-components@0.9.4-next.0
106
+ - @backstage/core-plugin-api@1.0.2-next.0
107
+ - @backstage/plugin-techdocs-react@0.1.1-next.1
108
+ - @backstage/integration-react@1.1.0-next.1
109
+
3
110
  ## 0.1.0-next.0
4
111
 
5
112
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -2,13 +2,24 @@
2
2
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
3
3
 
4
4
  /**
5
+ * Properties for creating an issue in a remote issue tracker.
6
+ *
5
7
  * @public
6
8
  */
7
9
  declare type ReportIssueTemplate = {
10
+ /**
11
+ * The title of the issue.
12
+ */
8
13
  title: string;
14
+ /**
15
+ * The body or description of the issue.
16
+ */
9
17
  body: string;
10
18
  };
11
19
  /**
20
+ * A function for returning a custom issue template, given a selection of text
21
+ * on a TechDocs page.
22
+ *
12
23
  * @public
13
24
  */
14
25
  declare type ReportIssueTemplateBuilder = ({ selection, }: {
@@ -16,10 +27,20 @@ declare type ReportIssueTemplateBuilder = ({ selection, }: {
16
27
  }) => ReportIssueTemplate;
17
28
 
18
29
  /**
30
+ * Props customizing the <ReportIssue /> Addon.
31
+ *
19
32
  * @public
20
33
  */
21
34
  declare type ReportIssueProps = {
35
+ /**
36
+ * Number of milliseconds after a user highlights some text before the report
37
+ * issue link appears above the highlighted text. Defaults to 500ms.
38
+ */
22
39
  debounceTime?: number;
40
+ /**
41
+ * An optional function defining how a custom issue title and body should be
42
+ * constructed, given some selected text.
43
+ */
23
44
  templateBuilder?: ReportIssueTemplateBuilder;
24
45
  };
25
46
 
@@ -29,11 +50,154 @@ declare type ReportIssueProps = {
29
50
  * @public
30
51
  */
31
52
  declare const techdocsModuleAddonsContribPlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {}>;
53
+ /**
54
+ * TechDocs addon that lets you expand/collapse the TechDocs main navigation
55
+ * and keep the preferred state in local storage. The addon will render as
56
+ * a button next to the site name if the documentation has nested navigation.
57
+ *
58
+ * @example
59
+ * Here's a simple example:
60
+ * ```
61
+ * import {
62
+ * DefaultTechDocsHome,
63
+ * TechDocsIndexPage,
64
+ * TechDocsReaderPage,
65
+ * } from '@backstage/plugin-techdocs';
66
+ * import { TechDocsAddons } from '@backstage/plugin-techdocs-react/alpha';
67
+ * import { ExpandableNavigation } from '@backstage/plugin-techdocs-module-addons-contrib';
68
+ *
69
+ *
70
+ * const AppRoutes = () => {
71
+ * <FlatRoutes>
72
+ * // other plugin routes
73
+ * <Route path="/docs" element={<TechDocsIndexPage />}>
74
+ * <DefaultTechDocsHome />
75
+ * </Route>
76
+ * <Route
77
+ * path="/docs/:namespace/:kind/:name/*"
78
+ * element={<TechDocsReaderPage />}
79
+ * >
80
+ * <TechDocsAddons>
81
+ * <ExpandableNavigation />
82
+ * </TechDocsAddons>
83
+ * </Route>
84
+ * </FlatRoutes>;
85
+ * };
86
+ * ```
87
+ *
88
+ * @public
89
+ */
90
+ declare const ExpandableNavigation: () => JSX.Element | null;
32
91
  /**
33
92
  * TechDocs addon that lets you select text and open GitHub/Gitlab issues
34
93
  *
94
+ * @remarks
95
+ * Before using it, you should set up an `edit_uri` for your pages as explained {@link https://backstage.io/docs/features/techdocs/faqs#is-it-possible-for-users-to-suggest-changes-or-provide-feedback-on-a-techdocs-page | here} and remember, it only works for Github or Gitlab.
96
+ *
97
+ * @example
98
+ * Here's a simple example:
99
+ * ```
100
+ * import {
101
+ * DefaultTechDocsHome,
102
+ * TechDocsIndexPage,
103
+ * TechDocsReaderPage,
104
+ * } from '@backstage/plugin-techdocs';
105
+ * import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
106
+ * import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
107
+ *
108
+ *
109
+ * const AppRoutes = () => {
110
+ * <FlatRoutes>
111
+ * // other plugin routes
112
+ * <Route path="/docs" element={<TechDocsIndexPage />}>
113
+ * <DefaultTechDocsHome />
114
+ * </Route>
115
+ * <Route
116
+ * path="/docs/:namespace/:kind/:name/*"
117
+ * element={<TechDocsReaderPage />}
118
+ * >
119
+ * <TechDocsAddons>
120
+ * <ReportIssue />
121
+ * </TechDocsAddons>
122
+ * </Route>
123
+ * </FlatRoutes>;
124
+ * };
125
+ * ```
126
+ *
127
+ * @example
128
+ * Here's an example with `debounceTime` and `templateBuilder` props:
129
+ * ```
130
+ * import {
131
+ * DefaultTechDocsHome,
132
+ * TechDocsIndexPage,
133
+ * TechDocsReaderPage,
134
+ * } from '@backstage/plugin-techdocs';
135
+ * import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
136
+ * import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
137
+ *
138
+ * const templateBuilder = ({ selection }: ReportIssueTemplateBuilder) => (({
139
+ * title: 'Custom issue title',
140
+ * body: `Custom issue body: ${selection.toString()}`
141
+ * }))
142
+ *
143
+ * const AppRoutes = () => {
144
+ * <FlatRoutes>
145
+ * // other plugin routes
146
+ * <Route path="/docs" element={<TechDocsIndexPage />}>
147
+ * <DefaultTechDocsHome />
148
+ * </Route>
149
+ * <Route
150
+ * path="/docs/:namespace/:kind/:name/*"
151
+ * element={<TechDocsReaderPage />}
152
+ * >
153
+ * <TechDocsAddons>
154
+ * <ReportIssue debounceTime={300} templateBuilder={templateBuilder} />
155
+ * </TechDocsAddons>
156
+ * </Route>
157
+ * </FlatRoutes>;
158
+ * ```
159
+ * @param props - Object that can optionally contain `debounceTime` and `templateBuilder` properties.
35
160
  * @public
36
161
  */
37
162
  declare const ReportIssue: (props: ReportIssueProps) => JSX.Element | null;
163
+ /**
164
+ * This TechDocs addon allows users to customize text size on documentation pages, they can select how much they want to increase or decrease the font size via slider or buttons.
165
+ *
166
+ * @remarks
167
+ * The default value for the font size is 100% of the HTML font size, if the theme does not have a `htmlFontSize` in its typography object, the addon will assume 16px as 100%, and remember, this setting is kept in the browser local storage.
168
+ *
169
+ * @example
170
+ * Here's a simple example:
171
+ * ```
172
+ * import {
173
+ * DefaultTechDocsHome,
174
+ * TechDocsIndexPage,
175
+ * TechDocsReaderPage,
176
+ * } from '@backstage/plugin-techdocs';
177
+ * import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
178
+ * import { TextSize } from '@backstage/plugin-techdocs-module-addons-contrib';
179
+ *
180
+ *
181
+ * const AppRoutes = () => {
182
+ * <FlatRoutes>
183
+ * // other plugin routes
184
+ * <Route path="/docs" element={<TechDocsIndexPage />}>
185
+ * <DefaultTechDocsHome />
186
+ * </Route>
187
+ * <Route
188
+ * path="/docs/:namespace/:kind/:name/*"
189
+ * element={<TechDocsReaderPage />}
190
+ * >
191
+ * <TechDocsAddons>
192
+ * <TextSize />
193
+ * </TechDocsAddons>
194
+ * </Route>
195
+ * </FlatRoutes>;
196
+ * };
197
+ * ```
198
+ *
199
+ * @public
200
+ */
201
+ declare const TextSize: () => JSX.Element | null;
38
202
 
39
- export { ReportIssue, ReportIssueProps, ReportIssueTemplate, ReportIssueTemplateBuilder, techdocsModuleAddonsContribPlugin };
203
+ export { ExpandableNavigation, ReportIssue, ReportIssueProps, ReportIssueTemplate, ReportIssueTemplateBuilder, TextSize, techdocsModuleAddonsContribPlugin };
package/dist/index.esm.js CHANGED
@@ -1,12 +1,79 @@
1
1
  import { useApi, createPlugin } from '@backstage/core-plugin-api';
2
- import { useShadowRootSelection, useShadowRootElements, createTechDocsAddonExtension, TechDocsAddonLocations } from '@backstage/plugin-techdocs-react';
3
- import React, { useState, useEffect } from 'react';
4
- import { makeStyles, Portal, Paper } from '@material-ui/core';
2
+ import { useShadowRootElements, useShadowRootSelection, createTechDocsAddonExtension, TechDocsAddonLocations } from '@backstage/plugin-techdocs-react';
3
+ import React, { useState, useCallback, useEffect, useMemo } from 'react';
4
+ import { useLocalStorageValue } from '@react-hookz/web';
5
+ import { withStyles, Button, makeStyles, Portal, Paper, Slider, useTheme, MenuItem, ListItemText, Typography, Box, IconButton } from '@material-ui/core';
6
+ import ChevronRightIcon from '@material-ui/icons/ChevronRight';
7
+ import ExpandMoreIcon from '@material-ui/icons/ExpandMore';
5
8
  import parseGitUrl from 'git-url-parse';
6
9
  import { replaceGitHubUrlType, replaceGitLabUrlType } from '@backstage/integration';
7
10
  import { scmIntegrationsApiRef } from '@backstage/integration-react';
8
11
  import BugReportIcon from '@material-ui/icons/BugReport';
9
12
  import { Link, GitHubIcon } from '@backstage/core-components';
13
+ import AddIcon from '@material-ui/icons/Add';
14
+ import RemoveIcon from '@material-ui/icons/Remove';
15
+
16
+ const NESTED_LIST_TOGGLE = ".md-nav__item--nested .md-toggle";
17
+ const EXPANDABLE_NAVIGATION_LOCAL_STORAGE = "@backstage/techdocs-addons/nav-expanded";
18
+ const StyledButton = withStyles({
19
+ root: {
20
+ position: "absolute",
21
+ left: "220px",
22
+ top: "19px",
23
+ padding: 0,
24
+ minWidth: 0
25
+ }
26
+ })(Button);
27
+ const CollapsedIcon = withStyles({
28
+ root: {
29
+ height: "20px",
30
+ width: "20px"
31
+ }
32
+ })(ChevronRightIcon);
33
+ const ExpandedIcon = withStyles({
34
+ root: {
35
+ height: "20px",
36
+ width: "20px"
37
+ }
38
+ })(ExpandMoreIcon);
39
+ const ExpandableNavigationAddon = () => {
40
+ const defaultValue = { expandAllNestedNavs: false };
41
+ const [expanded, setExpanded] = useLocalStorageValue(EXPANDABLE_NAVIGATION_LOCAL_STORAGE, defaultValue);
42
+ const [hasNavSubLevels, setHasNavSubLevels] = useState(false);
43
+ const [...checkboxToggles] = useShadowRootElements([
44
+ NESTED_LIST_TOGGLE
45
+ ]);
46
+ const shouldToggle = useCallback((item) => {
47
+ const isExpanded = item.checked;
48
+ const shouldExpand = expanded == null ? void 0 : expanded.expandAllNestedNavs;
49
+ if (shouldExpand && !isExpanded) {
50
+ return true;
51
+ }
52
+ if (!shouldExpand && isExpanded) {
53
+ return true;
54
+ }
55
+ return false;
56
+ }, [expanded]);
57
+ useEffect(() => {
58
+ if (!(checkboxToggles == null ? void 0 : checkboxToggles.length))
59
+ return;
60
+ setHasNavSubLevels(true);
61
+ checkboxToggles.forEach((item) => {
62
+ if (shouldToggle(item))
63
+ item.click();
64
+ });
65
+ }, [expanded, shouldToggle, checkboxToggles]);
66
+ const handleState = () => {
67
+ setExpanded((prevState) => ({
68
+ expandAllNestedNavs: !(prevState == null ? void 0 : prevState.expandAllNestedNavs)
69
+ }));
70
+ };
71
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, hasNavSubLevels ? /* @__PURE__ */ React.createElement(StyledButton, {
72
+ size: "small",
73
+ onClick: handleState,
74
+ "aria-label": (expanded == null ? void 0 : expanded.expandAllNestedNavs) ? "collapse-nav" : "expand-nav"
75
+ }, (expanded == null ? void 0 : expanded.expandAllNestedNavs) ? /* @__PURE__ */ React.createElement(ExpandedIcon, null) : /* @__PURE__ */ React.createElement(CollapsedIcon, null)) : null);
76
+ };
10
77
 
11
78
  const ADDON_FEEDBACK_CONTAINER_ID = "techdocs-report-issue";
12
79
  const ADDON_FEEDBACK_CONTAINER_SELECTOR = `#${ADDON_FEEDBACK_CONTAINER_ID}`;
@@ -80,7 +147,7 @@ const useGitRepository = () => {
80
147
  return { ...parseGitUrl(resolveBlobUrl(url, type)), type };
81
148
  };
82
149
 
83
- const useStyles$1 = makeStyles((theme) => ({
150
+ const useStyles$2 = makeStyles((theme) => ({
84
151
  root: {
85
152
  display: "grid",
86
153
  gridGap: theme.spacing(1),
@@ -114,10 +181,10 @@ const getUrl = (repository, template) => {
114
181
  if (type === "github") {
115
182
  return `${url}/issues/new?title=${encodedTitle}&body=${encodedBody}`;
116
183
  }
117
- return `${url}/issues/new?[title]=${encodedTitle}&[body]=${encodedBody}`;
184
+ return `${url}/issues/new?issue[title]=${encodedTitle}&issue[description]=${encodedBody}`;
118
185
  };
119
186
  const IssueLink = ({ template, repository }) => {
120
- const classes = useStyles$1();
187
+ const classes = useStyles$2();
121
188
  const Icon = getIcon(repository);
122
189
  const url = getUrl(repository, template);
123
190
  return /* @__PURE__ */ React.createElement(Link, {
@@ -127,7 +194,7 @@ const IssueLink = ({ template, repository }) => {
127
194
  }, /* @__PURE__ */ React.createElement(Icon, null), " Open new ", getName(repository), " issue");
128
195
  };
129
196
 
130
- const useStyles = makeStyles((theme) => ({
197
+ const useStyles$1 = makeStyles((theme) => ({
131
198
  root: {
132
199
  transform: "translate(-100%, -100%)",
133
200
  position: "absolute",
@@ -140,7 +207,7 @@ const ReportIssueAddon = ({
140
207
  debounceTime = 500,
141
208
  templateBuilder: buildTemplate
142
209
  }) => {
143
- const classes = useStyles();
210
+ const classes = useStyles$1();
144
211
  const [style, setStyle] = useState();
145
212
  const repository = useGitRepository();
146
213
  const defaultTemplate = useGitTemplate(debounceTime);
@@ -185,14 +252,186 @@ const ReportIssueAddon = ({
185
252
  })));
186
253
  };
187
254
 
255
+ const boxShadow = "0 3px 1px rgba(0,0,0,0.1),0 4px 8px rgba(0,0,0,0.13),0 0 0 1px rgba(0,0,0,0.02)";
256
+ const StyledSlider = withStyles((theme) => ({
257
+ root: {
258
+ height: 2,
259
+ padding: "15px 0"
260
+ },
261
+ thumb: {
262
+ height: 18,
263
+ width: 18,
264
+ backgroundColor: theme.palette.common.white,
265
+ boxShadow,
266
+ marginTop: -9,
267
+ marginLeft: -9,
268
+ "&:focus, &:hover, &$active": {
269
+ boxShadow: "0 3px 1px rgba(0,0,0,0.1),0 4px 8px rgba(0,0,0,0.3),0 0 0 1px rgba(0,0,0,0.02)",
270
+ "@media (hover: none)": {
271
+ boxShadow
272
+ }
273
+ }
274
+ },
275
+ active: {},
276
+ valueLabel: {
277
+ top: "100%",
278
+ left: "50%",
279
+ transform: "scale(1) translate(-50%, -5px) !important",
280
+ "& *": {
281
+ color: theme.palette.common.black,
282
+ fontSize: theme.typography.caption.fontSize,
283
+ background: "transparent"
284
+ }
285
+ },
286
+ track: {
287
+ height: 2
288
+ },
289
+ rail: {
290
+ height: 2,
291
+ opacity: 0.5
292
+ },
293
+ mark: {
294
+ height: 10,
295
+ width: 1,
296
+ marginTop: -4
297
+ },
298
+ markActive: {
299
+ opacity: 1,
300
+ backgroundColor: "currentColor"
301
+ }
302
+ }))(Slider);
303
+ const settings = {
304
+ key: "techdocs.addons.settings.textsize",
305
+ defaultValue: 100
306
+ };
307
+ const marks = [
308
+ {
309
+ value: 90
310
+ },
311
+ {
312
+ value: 100
313
+ },
314
+ {
315
+ value: 115
316
+ },
317
+ {
318
+ value: 130
319
+ },
320
+ {
321
+ value: 150
322
+ }
323
+ ];
324
+ const useStyles = makeStyles((theme) => ({
325
+ container: {
326
+ color: theme.palette.textSubtle,
327
+ display: "flex",
328
+ alignItems: "center",
329
+ margin: 0,
330
+ minWidth: 200
331
+ },
332
+ menuItem: {
333
+ "&:hover": {
334
+ background: "transparent"
335
+ }
336
+ },
337
+ decreaseButton: {
338
+ marginRight: theme.spacing(1)
339
+ },
340
+ increaseButton: {
341
+ marginLeft: theme.spacing(1)
342
+ }
343
+ }));
344
+ const TextSizeAddon = () => {
345
+ const classes = useStyles();
346
+ const theme = useTheme();
347
+ const [body] = useShadowRootElements(["body"]);
348
+ const [value, setValue] = useState(() => {
349
+ const initialValue = localStorage == null ? void 0 : localStorage.getItem(settings.key);
350
+ return initialValue ? parseInt(initialValue, 10) : settings.defaultValue;
351
+ });
352
+ const values = useMemo(() => marks.map((mark) => mark.value), []);
353
+ const index = useMemo(() => values.indexOf(value), [values, value]);
354
+ const min = useMemo(() => values[0], [values]);
355
+ const max = useMemo(() => values[values.length - 1], [values]);
356
+ const getValueText = useCallback(() => `${value}%`, [value]);
357
+ const handleChangeCommitted = useCallback((_event, newValue) => {
358
+ if (!Array.isArray(newValue)) {
359
+ setValue(newValue);
360
+ localStorage == null ? void 0 : localStorage.setItem(settings.key, String(newValue));
361
+ }
362
+ }, [setValue]);
363
+ const handleDecreaseClick = useCallback((event) => {
364
+ handleChangeCommitted(event, values[index - 1]);
365
+ }, [index, values, handleChangeCommitted]);
366
+ const handleIncreaseClick = useCallback((event) => {
367
+ handleChangeCommitted(event, values[index + 1]);
368
+ }, [index, values, handleChangeCommitted]);
369
+ useEffect(() => {
370
+ var _a, _b;
371
+ if (!body)
372
+ return;
373
+ const htmlFontSize = (_b = (_a = theme.typography) == null ? void 0 : _a.htmlFontSize) != null ? _b : 16;
374
+ body.style.setProperty("--md-typeset-font-size", `${htmlFontSize * (value / 100)}px`);
375
+ }, [body, value, theme]);
376
+ return /* @__PURE__ */ React.createElement(MenuItem, {
377
+ className: classes.menuItem,
378
+ button: true,
379
+ disableRipple: true
380
+ }, /* @__PURE__ */ React.createElement(ListItemText, {
381
+ primary: /* @__PURE__ */ React.createElement(Typography, {
382
+ variant: "subtitle2",
383
+ color: "textPrimary"
384
+ }, "Text size"),
385
+ secondary: /* @__PURE__ */ React.createElement(Box, {
386
+ className: classes.container
387
+ }, /* @__PURE__ */ React.createElement(IconButton, {
388
+ className: classes.decreaseButton,
389
+ size: "small",
390
+ edge: "start",
391
+ disabled: value === min,
392
+ onClick: handleDecreaseClick,
393
+ "aria-label": "Decrease text size"
394
+ }, /* @__PURE__ */ React.createElement(RemoveIcon, null)), /* @__PURE__ */ React.createElement(StyledSlider, {
395
+ value,
396
+ "aria-labelledby": "text-size-slider",
397
+ getAriaValueText: getValueText,
398
+ valueLabelDisplay: "on",
399
+ valueLabelFormat: getValueText,
400
+ marks,
401
+ step: null,
402
+ min,
403
+ max,
404
+ onChangeCommitted: handleChangeCommitted
405
+ }), /* @__PURE__ */ React.createElement(IconButton, {
406
+ className: classes.increaseButton,
407
+ size: "small",
408
+ edge: "end",
409
+ disabled: value === max,
410
+ onClick: handleIncreaseClick,
411
+ "aria-label": "Increase text size"
412
+ }, /* @__PURE__ */ React.createElement(AddIcon, null))),
413
+ disableTypography: true
414
+ }));
415
+ };
416
+
188
417
  const techdocsModuleAddonsContribPlugin = createPlugin({
189
418
  id: "techdocsModuleAddonsContrib"
190
419
  });
420
+ const ExpandableNavigation = techdocsModuleAddonsContribPlugin.provide(createTechDocsAddonExtension({
421
+ name: "ExpandableNavigation",
422
+ location: TechDocsAddonLocations.PrimarySidebar,
423
+ component: ExpandableNavigationAddon
424
+ }));
191
425
  const ReportIssue = techdocsModuleAddonsContribPlugin.provide(createTechDocsAddonExtension({
192
426
  name: "ReportIssue",
193
427
  location: TechDocsAddonLocations.Content,
194
428
  component: ReportIssueAddon
195
429
  }));
430
+ const TextSize = techdocsModuleAddonsContribPlugin.provide(createTechDocsAddonExtension({
431
+ name: "TextSize",
432
+ location: TechDocsAddonLocations.Settings,
433
+ component: TextSizeAddon
434
+ }));
196
435
 
197
- export { ReportIssue, techdocsModuleAddonsContribPlugin };
436
+ export { ExpandableNavigation, ReportIssue, TextSize, techdocsModuleAddonsContribPlugin };
198
437
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/ReportIssue/constants.ts","../src/ReportIssue/hooks.ts","../src/ReportIssue/IssueLink.tsx","../src/ReportIssue/ReportIssue.tsx","../src/plugin.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 const ADDON_FEEDBACK_CONTAINER_ID = 'techdocs-report-issue';\nexport const ADDON_FEEDBACK_CONTAINER_SELECTOR = `#${ADDON_FEEDBACK_CONTAINER_ID}`;\nexport const PAGE_EDIT_LINK_SELECTOR = '[title^=\"Edit this page\"]';\nexport const PAGE_FEEDBACK_LINK_SELECTOR = '[title^=\"Leave feedback for\"]';\nexport const PAGE_MAIN_CONTENT_SELECTOR =\n '[data-md-component=\"main\"] .md-content';\n","/*\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 parseGitUrl from 'git-url-parse';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n replaceGitHubUrlType,\n replaceGitLabUrlType,\n} from '@backstage/integration';\nimport { scmIntegrationsApiRef } from '@backstage/integration-react';\nimport {\n useShadowRootElements,\n useShadowRootSelection,\n} from '@backstage/plugin-techdocs-react';\n\nimport { PAGE_EDIT_LINK_SELECTOR } from './constants';\n\nconst resolveBlobUrl = (url: string, type: string) => {\n if (type === 'github') {\n return replaceGitHubUrlType(url, 'blob');\n } else if (type === 'gitlab') {\n return replaceGitLabUrlType(url, 'blob');\n }\n // eslint-disable-next-line no-console\n console.error(\n `Invalid SCM type ${type} found in ReportIssue addon for URL ${url}!`,\n );\n return url;\n};\n\nexport const getTitle = (selection: Selection) => {\n const text = selection.toString().substring(0, 70);\n const ellipsis = text.length === 70 ? '...' : '';\n return `Documentation feedback: ${text}${ellipsis}`;\n};\n\nexport const getBody = (selection: Selection, markdownUrl: string) => {\n const title = '## Documentation Feedback 📝';\n const subheading = '#### The highlighted text:';\n const commentHeading = '#### The comment on the text:';\n const commentPlaceholder = '_>replace this line with your comment<_';\n const highlightedTextAsQuote = selection\n .toString()\n .trim()\n .split('\\n')\n .map(line => `> ${line.trim()}`)\n .join('\\n');\n\n const facts = [\n `Backstage URL: <${window.location.href}> \\nMarkdown URL: <${markdownUrl}>`,\n ];\n\n return `${title}\\n\\n ${subheading} \\n\\n ${highlightedTextAsQuote}\\n\\n ${commentHeading} \\n ${commentPlaceholder}\\n\\n ___\\n${facts}`;\n};\n\nexport const useGitTemplate = (debounceTime?: number) => {\n const initialTemplate = { title: '', body: '' };\n const selection = useShadowRootSelection(debounceTime);\n const [editLink] = useShadowRootElements([PAGE_EDIT_LINK_SELECTOR]);\n const url = (editLink as HTMLAnchorElement)?.href ?? '';\n const scmIntegrationsApi = useApi(scmIntegrationsApiRef);\n\n if (!selection || !url) return initialTemplate;\n\n const type = scmIntegrationsApi.byUrl(url)?.type;\n\n if (!type) return initialTemplate;\n\n return {\n title: getTitle(selection),\n body: getBody(selection, resolveBlobUrl(url, type)),\n };\n};\n\nexport const useGitRepository = () => {\n const scmIntegrationsApi = useApi(scmIntegrationsApiRef);\n\n const [editLink] = useShadowRootElements([PAGE_EDIT_LINK_SELECTOR]);\n const url = (editLink as HTMLAnchorElement)?.href ?? '';\n\n if (!url) return null;\n\n const type = scmIntegrationsApi.byUrl(url)?.type;\n\n if (!type) return null;\n\n return { ...parseGitUrl(resolveBlobUrl(url, type)), type };\n};\n","/*\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 from 'react';\n\nimport { makeStyles } from '@material-ui/core';\nimport BugReportIcon from '@material-ui/icons/BugReport';\n\nimport { Link, GitHubIcon } from '@backstage/core-components';\n\nimport { ReportIssueTemplate, Repository } from './types';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n display: 'grid',\n gridGap: theme.spacing(1),\n gridAutoFlow: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n color: theme.palette.common.black,\n fontSize: theme.typography.button.fontSize,\n },\n}));\n\ntype IssueLinkProps = {\n template: ReportIssueTemplate;\n repository: Repository;\n};\n\nconst getIcon = ({ type }: Repository) => {\n if (type === 'github') {\n return GitHubIcon;\n }\n return BugReportIcon;\n};\n\nconst getName = ({ type }: Repository) => {\n if (type === 'github') {\n return 'Github';\n }\n return 'Gitlab';\n};\n\nconst getUrl = (repository: Repository, template: ReportIssueTemplate) => {\n const { title, body } = template;\n const encodedTitle = encodeURIComponent(title);\n const encodedBody = encodeURIComponent(body);\n const { protocol, resource, owner, name, type } = repository;\n const encodedOwner = encodeURIComponent(owner);\n const encodedName = encodeURIComponent(name);\n\n const url = `${protocol}://${resource}/${encodedOwner}/${encodedName}`;\n if (type === 'github') {\n return `${url}/issues/new?title=${encodedTitle}&body=${encodedBody}`;\n }\n return `${url}/issues/new?[title]=${encodedTitle}&[body]=${encodedBody}`;\n};\n\nexport const IssueLink = ({ template, repository }: IssueLinkProps) => {\n const classes = useStyles();\n\n const Icon = getIcon(repository);\n const url = getUrl(repository, template);\n\n return (\n <Link className={classes.root} to={url} target=\"_blank\">\n <Icon /> Open new {getName(repository)} issue\n </Link>\n );\n};\n","/*\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, useEffect } from 'react';\n\nimport { makeStyles, Portal, Paper } from '@material-ui/core';\n\nimport { useGitTemplate, useGitRepository } from './hooks';\nimport { ReportIssueTemplateBuilder } from './types';\nimport {\n PAGE_MAIN_CONTENT_SELECTOR,\n PAGE_FEEDBACK_LINK_SELECTOR,\n ADDON_FEEDBACK_CONTAINER_ID,\n ADDON_FEEDBACK_CONTAINER_SELECTOR,\n} from './constants';\nimport { IssueLink } from './IssueLink';\n\nimport {\n useShadowRootElements,\n useShadowRootSelection,\n} from '@backstage/plugin-techdocs-react';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n transform: 'translate(-100%, -100%)',\n position: 'absolute',\n padding: theme.spacing(1),\n zIndex: theme.zIndex.tooltip,\n background: theme.palette.common.white,\n },\n}));\n\ntype Style = {\n top: string;\n left: string;\n};\n\n/**\n * @public\n */\nexport type ReportIssueProps = {\n debounceTime?: number;\n templateBuilder?: ReportIssueTemplateBuilder;\n};\n\n/**\n * Show report issue button when text is highlighted\n */\nexport const ReportIssueAddon = ({\n debounceTime = 500,\n templateBuilder: buildTemplate,\n}: ReportIssueProps) => {\n const classes = useStyles();\n const [style, setStyle] = useState<Style>();\n\n const repository = useGitRepository();\n\n const defaultTemplate = useGitTemplate(debounceTime);\n\n const selection = useShadowRootSelection(debounceTime);\n\n const [mainContent, feedbackLink] = useShadowRootElements([\n PAGE_MAIN_CONTENT_SELECTOR,\n PAGE_FEEDBACK_LINK_SELECTOR,\n ]);\n\n let [feedbackContainer] = useShadowRootElements([\n ADDON_FEEDBACK_CONTAINER_SELECTOR,\n ]);\n\n if (feedbackLink) {\n feedbackLink.style.display = 'none';\n }\n\n // calculates the position of the selected text to be able to set the position of the addon\n useEffect(() => {\n if (\n // todo(backstage/techdocs-core) handle non-repo rendering\n !repository ||\n !selection ||\n !selection.containsNode(mainContent!, true) ||\n selection?.containsNode(feedbackContainer!, true)\n ) {\n return;\n }\n\n const mainContentPosition = mainContent!.getBoundingClientRect();\n const selectionPosition = selection.getRangeAt(0).getBoundingClientRect();\n\n setStyle({\n top: `${selectionPosition.top - mainContentPosition.top - 16}px`,\n left: `${selectionPosition.left + selectionPosition.width / 2}px`,\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selection, mainContent, feedbackContainer]);\n\n if (!selection || !repository) return null;\n\n if (!feedbackContainer) {\n feedbackContainer = document.createElement('div');\n feedbackContainer.setAttribute('id', ADDON_FEEDBACK_CONTAINER_ID);\n mainContent!.prepend(feedbackContainer);\n }\n\n return (\n <Portal container={feedbackContainer}>\n <Paper\n data-testid=\"report-issue-addon\"\n className={classes.root}\n style={style}\n >\n <IssueLink\n repository={repository}\n template={\n buildTemplate ? buildTemplate({ selection }) : defaultTemplate\n }\n />\n </Paper>\n </Portal>\n );\n};\n","/*\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 { createPlugin } from '@backstage/core-plugin-api';\nimport {\n createTechDocsAddonExtension,\n TechDocsAddonLocations,\n} from '@backstage/plugin-techdocs-react';\nimport { ReportIssueAddon, ReportIssueProps } from './ReportIssue';\n\n/**\n * The TechDocs addons contrib plugin\n *\n * @public\n */\n\nexport const techdocsModuleAddonsContribPlugin = createPlugin({\n id: 'techdocsModuleAddonsContrib',\n});\n\n/**\n * TechDocs addon that lets you select text and open GitHub/Gitlab issues\n *\n * @public\n */\n\nexport const ReportIssue = techdocsModuleAddonsContribPlugin.provide(\n createTechDocsAddonExtension<ReportIssueProps>({\n name: 'ReportIssue',\n location: TechDocsAddonLocations.Content,\n component: ReportIssueAddon,\n }),\n);\n"],"names":["useStyles"],"mappings":";;;;;;;;;;AAAO,MAAM,2BAA2B,GAAG,uBAAuB,CAAC;AAC5D,MAAM,iCAAiC,GAAG,CAAC,CAAC,EAAE,2BAA2B,CAAC,CAAC,CAAC;AAC5E,MAAM,uBAAuB,GAAG,2BAA2B,CAAC;AAC5D,MAAM,2BAA2B,GAAG,+BAA+B,CAAC;AACpE,MAAM,0BAA0B,GAAG,wCAAwC;;ACQlF,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK;AACtC,EAAE,IAAI,IAAI,KAAK,QAAQ,EAAE;AACzB,IAAI,OAAO,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC7C,GAAG,MAAM,IAAI,IAAI,KAAK,QAAQ,EAAE;AAChC,IAAI,OAAO,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;AAC7C,GAAG;AACH,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,iBAAiB,EAAE,IAAI,CAAC,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iBAAiB,EAAE;AAC1B,IAAI,iBAAiB,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AACtD,IAAI,iBAAiB,CAAC,YAAY,CAAC,IAAI,EAAE,2BAA2B,CAAC,CAAC;AACtE,IAAI,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC3C,GAAG;AACH,EAAE,uBAAuB,KAAK,CAAC,aAAa,CAAC,MAAM,EAAE;AACrD,IAAI,SAAS,EAAE,iBAAiB;AAChC,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE;AAChD,IAAI,aAAa,EAAE,oBAAoB;AACvC,IAAI,SAAS,EAAE,OAAO,CAAC,IAAI;AAC3B,IAAI,KAAK;AACT,GAAG,kBAAkB,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE;AACpD,IAAI,UAAU;AACd,IAAI,QAAQ,EAAE,aAAa,GAAG,aAAa,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,eAAe;AAC5E,GAAG,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;;AChEW,MAAC,iCAAiC,GAAG,YAAY,CAAC;AAC9D,EAAE,EAAE,EAAE,6BAA6B;AACnC,CAAC,EAAE;AACS,MAAC,WAAW,GAAG,iCAAiC,CAAC,OAAO,CAAC,4BAA4B,CAAC;AAClG,EAAE,IAAI,EAAE,aAAa;AACrB,EAAE,QAAQ,EAAE,sBAAsB,CAAC,OAAO;AAC1C,EAAE,SAAS,EAAE,gBAAgB;AAC7B,CAAC,CAAC;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/ExpandableNavigation/ExpandableNavigation.tsx","../src/ReportIssue/constants.ts","../src/ReportIssue/hooks.ts","../src/ReportIssue/IssueLink.tsx","../src/ReportIssue/ReportIssue.tsx","../src/TextSize/TextSize.tsx","../src/plugin.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 React, { useEffect, useCallback, useState } from 'react';\nimport { useLocalStorageValue } from '@react-hookz/web';\nimport { Button, withStyles } from '@material-ui/core';\nimport ChevronRightIcon from '@material-ui/icons/ChevronRight';\nimport ExpandMoreIcon from '@material-ui/icons/ExpandMore';\n\nimport { useShadowRootElements } from '@backstage/plugin-techdocs-react';\n\nconst NESTED_LIST_TOGGLE = '.md-nav__item--nested .md-toggle';\n\nconst EXPANDABLE_NAVIGATION_LOCAL_STORAGE =\n '@backstage/techdocs-addons/nav-expanded';\n\nconst StyledButton = withStyles({\n root: {\n position: 'absolute',\n left: '220px',\n top: '19px',\n padding: 0,\n minWidth: 0,\n },\n})(Button);\n\nconst CollapsedIcon = withStyles({\n root: {\n height: '20px',\n width: '20px',\n },\n})(ChevronRightIcon);\n\nconst ExpandedIcon = withStyles({\n root: {\n height: '20px',\n width: '20px',\n },\n})(ExpandMoreIcon);\n\ntype expandableNavigationLocalStorage = {\n expandAllNestedNavs: boolean;\n};\n\n/**\n * Show expand/collapse navigation button next to site name in main\n * navigation menu if documentation site has nested navigation.\n */\nexport const ExpandableNavigationAddon = () => {\n const defaultValue = { expandAllNestedNavs: false };\n const [expanded, setExpanded] =\n useLocalStorageValue<expandableNavigationLocalStorage>(\n EXPANDABLE_NAVIGATION_LOCAL_STORAGE,\n defaultValue,\n );\n const [hasNavSubLevels, setHasNavSubLevels] = useState<boolean>(false);\n\n const [...checkboxToggles] = useShadowRootElements<HTMLInputElement>([\n NESTED_LIST_TOGGLE,\n ]);\n\n const shouldToggle = useCallback(\n (item: HTMLInputElement) => {\n const isExpanded = item.checked;\n const shouldExpand = expanded?.expandAllNestedNavs;\n\n // Is collapsed but should expand\n if (shouldExpand && !isExpanded) {\n return true;\n }\n\n // Is expanded but should collapse\n if (!shouldExpand && isExpanded) {\n return true;\n }\n\n return false;\n },\n [expanded],\n );\n\n useEffect(() => {\n // There is no nested navs\n if (!checkboxToggles?.length) return;\n\n setHasNavSubLevels(true);\n checkboxToggles.forEach(item => {\n if (shouldToggle(item)) item.click();\n });\n }, [expanded, shouldToggle, checkboxToggles]);\n\n const handleState = () => {\n setExpanded(prevState => ({\n expandAllNestedNavs: !prevState?.expandAllNestedNavs,\n }));\n };\n\n return (\n <>\n {hasNavSubLevels ? (\n <StyledButton\n size=\"small\"\n onClick={handleState}\n aria-label={\n expanded?.expandAllNestedNavs ? 'collapse-nav' : 'expand-nav'\n }\n >\n {expanded?.expandAllNestedNavs ? <ExpandedIcon /> : <CollapsedIcon />}\n </StyledButton>\n ) : null}\n </>\n );\n};\n","/*\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 const ADDON_FEEDBACK_CONTAINER_ID = 'techdocs-report-issue';\nexport const ADDON_FEEDBACK_CONTAINER_SELECTOR = `#${ADDON_FEEDBACK_CONTAINER_ID}`;\nexport const PAGE_EDIT_LINK_SELECTOR = '[title^=\"Edit this page\"]';\nexport const PAGE_FEEDBACK_LINK_SELECTOR = '[title^=\"Leave feedback for\"]';\nexport const PAGE_MAIN_CONTENT_SELECTOR =\n '[data-md-component=\"main\"] .md-content';\n","/*\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 parseGitUrl from 'git-url-parse';\n\nimport { useApi } from '@backstage/core-plugin-api';\nimport {\n replaceGitHubUrlType,\n replaceGitLabUrlType,\n} from '@backstage/integration';\nimport { scmIntegrationsApiRef } from '@backstage/integration-react';\nimport {\n useShadowRootElements,\n useShadowRootSelection,\n} from '@backstage/plugin-techdocs-react';\n\nimport { PAGE_EDIT_LINK_SELECTOR } from './constants';\n\nconst resolveBlobUrl = (url: string, type: string) => {\n if (type === 'github') {\n return replaceGitHubUrlType(url, 'blob');\n } else if (type === 'gitlab') {\n return replaceGitLabUrlType(url, 'blob');\n }\n // eslint-disable-next-line no-console\n console.error(\n `Invalid SCM type ${type} found in ReportIssue addon for URL ${url}!`,\n );\n return url;\n};\n\nexport const getTitle = (selection: Selection) => {\n const text = selection.toString().substring(0, 70);\n const ellipsis = text.length === 70 ? '...' : '';\n return `Documentation feedback: ${text}${ellipsis}`;\n};\n\nexport const getBody = (selection: Selection, markdownUrl: string) => {\n const title = '## Documentation Feedback 📝';\n const subheading = '#### The highlighted text:';\n const commentHeading = '#### The comment on the text:';\n const commentPlaceholder = '_>replace this line with your comment<_';\n const highlightedTextAsQuote = selection\n .toString()\n .trim()\n .split('\\n')\n .map(line => `> ${line.trim()}`)\n .join('\\n');\n\n const facts = [\n `Backstage URL: <${window.location.href}> \\nMarkdown URL: <${markdownUrl}>`,\n ];\n\n return `${title}\\n\\n ${subheading} \\n\\n ${highlightedTextAsQuote}\\n\\n ${commentHeading} \\n ${commentPlaceholder}\\n\\n ___\\n${facts}`;\n};\n\nexport const useGitTemplate = (debounceTime?: number) => {\n const initialTemplate = { title: '', body: '' };\n const selection = useShadowRootSelection(debounceTime);\n const [editLink] = useShadowRootElements([PAGE_EDIT_LINK_SELECTOR]);\n const url = (editLink as HTMLAnchorElement)?.href ?? '';\n const scmIntegrationsApi = useApi(scmIntegrationsApiRef);\n\n if (!selection || !url) return initialTemplate;\n\n const type = scmIntegrationsApi.byUrl(url)?.type;\n\n if (!type) return initialTemplate;\n\n return {\n title: getTitle(selection),\n body: getBody(selection, resolveBlobUrl(url, type)),\n };\n};\n\nexport const useGitRepository = () => {\n const scmIntegrationsApi = useApi(scmIntegrationsApiRef);\n\n const [editLink] = useShadowRootElements([PAGE_EDIT_LINK_SELECTOR]);\n const url = (editLink as HTMLAnchorElement)?.href ?? '';\n\n if (!url) return null;\n\n const type = scmIntegrationsApi.byUrl(url)?.type;\n\n if (!type) return null;\n\n return { ...parseGitUrl(resolveBlobUrl(url, type)), type };\n};\n","/*\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 from 'react';\n\nimport { makeStyles } from '@material-ui/core';\nimport BugReportIcon from '@material-ui/icons/BugReport';\n\nimport { Link, GitHubIcon } from '@backstage/core-components';\n\nimport { ReportIssueTemplate, Repository } from './types';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n display: 'grid',\n gridGap: theme.spacing(1),\n gridAutoFlow: 'column',\n justifyContent: 'center',\n alignItems: 'center',\n color: theme.palette.common.black,\n fontSize: theme.typography.button.fontSize,\n },\n}));\n\ntype IssueLinkProps = {\n template: ReportIssueTemplate;\n repository: Repository;\n};\n\nconst getIcon = ({ type }: Repository) => {\n if (type === 'github') {\n return GitHubIcon;\n }\n return BugReportIcon;\n};\n\nconst getName = ({ type }: Repository) => {\n if (type === 'github') {\n return 'Github';\n }\n return 'Gitlab';\n};\n\nconst getUrl = (repository: Repository, template: ReportIssueTemplate) => {\n const { title, body } = template;\n const encodedTitle = encodeURIComponent(title);\n const encodedBody = encodeURIComponent(body);\n const { protocol, resource, owner, name, type } = repository;\n const encodedOwner = encodeURIComponent(owner);\n const encodedName = encodeURIComponent(name);\n\n const url = `${protocol}://${resource}/${encodedOwner}/${encodedName}`;\n if (type === 'github') {\n return `${url}/issues/new?title=${encodedTitle}&body=${encodedBody}`;\n }\n return `${url}/issues/new?issue[title]=${encodedTitle}&issue[description]=${encodedBody}`;\n};\n\nexport const IssueLink = ({ template, repository }: IssueLinkProps) => {\n const classes = useStyles();\n\n const Icon = getIcon(repository);\n const url = getUrl(repository, template);\n\n return (\n <Link className={classes.root} to={url} target=\"_blank\">\n <Icon /> Open new {getName(repository)} issue\n </Link>\n );\n};\n","/*\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, useEffect } from 'react';\n\nimport { makeStyles, Portal, Paper } from '@material-ui/core';\n\nimport { useGitTemplate, useGitRepository } from './hooks';\nimport { ReportIssueTemplateBuilder } from './types';\nimport {\n PAGE_MAIN_CONTENT_SELECTOR,\n PAGE_FEEDBACK_LINK_SELECTOR,\n ADDON_FEEDBACK_CONTAINER_ID,\n ADDON_FEEDBACK_CONTAINER_SELECTOR,\n} from './constants';\nimport { IssueLink } from './IssueLink';\n\nimport {\n useShadowRootElements,\n useShadowRootSelection,\n} from '@backstage/plugin-techdocs-react';\n\nconst useStyles = makeStyles(theme => ({\n root: {\n transform: 'translate(-100%, -100%)',\n position: 'absolute',\n padding: theme.spacing(1),\n zIndex: theme.zIndex.tooltip,\n background: theme.palette.common.white,\n },\n}));\n\ntype Style = {\n top: string;\n left: string;\n};\n\n/**\n * Props customizing the <ReportIssue /> Addon.\n *\n * @public\n */\nexport type ReportIssueProps = {\n /**\n * Number of milliseconds after a user highlights some text before the report\n * issue link appears above the highlighted text. Defaults to 500ms.\n */\n debounceTime?: number;\n\n /**\n * An optional function defining how a custom issue title and body should be\n * constructed, given some selected text.\n */\n templateBuilder?: ReportIssueTemplateBuilder;\n};\n\n/**\n * Show report issue button when text is highlighted\n */\nexport const ReportIssueAddon = ({\n debounceTime = 500,\n templateBuilder: buildTemplate,\n}: ReportIssueProps) => {\n const classes = useStyles();\n const [style, setStyle] = useState<Style>();\n\n const repository = useGitRepository();\n\n const defaultTemplate = useGitTemplate(debounceTime);\n\n const selection = useShadowRootSelection(debounceTime);\n\n const [mainContent, feedbackLink] = useShadowRootElements([\n PAGE_MAIN_CONTENT_SELECTOR,\n PAGE_FEEDBACK_LINK_SELECTOR,\n ]);\n\n let [feedbackContainer] = useShadowRootElements([\n ADDON_FEEDBACK_CONTAINER_SELECTOR,\n ]);\n\n if (feedbackLink) {\n feedbackLink.style.display = 'none';\n }\n\n // calculates the position of the selected text to be able to set the position of the addon\n useEffect(() => {\n if (\n // todo(backstage/techdocs-core) handle non-repo rendering\n !repository ||\n !selection ||\n !selection.containsNode(mainContent!, true) ||\n selection?.containsNode(feedbackContainer!, true)\n ) {\n return;\n }\n\n const mainContentPosition = mainContent!.getBoundingClientRect();\n const selectionPosition = selection.getRangeAt(0).getBoundingClientRect();\n\n setStyle({\n top: `${selectionPosition.top - mainContentPosition.top - 16}px`,\n left: `${selectionPosition.left + selectionPosition.width / 2}px`,\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selection, mainContent, feedbackContainer]);\n\n if (!selection || !repository) return null;\n\n if (!feedbackContainer) {\n feedbackContainer = document.createElement('div');\n feedbackContainer.setAttribute('id', ADDON_FEEDBACK_CONTAINER_ID);\n mainContent!.prepend(feedbackContainer);\n }\n\n return (\n <Portal container={feedbackContainer}>\n <Paper\n data-testid=\"report-issue-addon\"\n className={classes.root}\n style={style}\n >\n <IssueLink\n repository={repository}\n template={\n buildTemplate ? buildTemplate({ selection }) : defaultTemplate\n }\n />\n </Paper>\n </Portal>\n );\n};\n","/*\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, {\n ChangeEvent,\n MouseEvent,\n useMemo,\n useState,\n useEffect,\n useCallback,\n} from 'react';\n\nimport {\n withStyles,\n makeStyles,\n useTheme,\n Box,\n MenuItem,\n ListItemText,\n Slider,\n IconButton,\n Typography,\n} from '@material-ui/core';\nimport AddIcon from '@material-ui/icons/Add';\nimport RemoveIcon from '@material-ui/icons/Remove';\n\nimport { BackstageTheme } from '@backstage/theme';\nimport { useShadowRootElements } from '@backstage/plugin-techdocs-react';\n\nconst boxShadow =\n '0 3px 1px rgba(0,0,0,0.1),0 4px 8px rgba(0,0,0,0.13),0 0 0 1px rgba(0,0,0,0.02)';\n\nconst StyledSlider = withStyles(theme => ({\n root: {\n height: 2,\n padding: '15px 0',\n },\n thumb: {\n height: 18,\n width: 18,\n backgroundColor: theme.palette.common.white,\n boxShadow: boxShadow,\n marginTop: -9,\n marginLeft: -9,\n '&:focus, &:hover, &$active': {\n boxShadow:\n '0 3px 1px rgba(0,0,0,0.1),0 4px 8px rgba(0,0,0,0.3),0 0 0 1px rgba(0,0,0,0.02)',\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n boxShadow: boxShadow,\n },\n },\n },\n active: {},\n valueLabel: {\n top: '100%',\n left: '50%',\n transform: 'scale(1) translate(-50%, -5px) !important',\n '& *': {\n color: theme.palette.common.black,\n fontSize: theme.typography.caption.fontSize,\n background: 'transparent',\n },\n },\n track: {\n height: 2,\n },\n rail: {\n height: 2,\n opacity: 0.5,\n },\n mark: {\n height: 10,\n width: 1,\n marginTop: -4,\n },\n markActive: {\n opacity: 1,\n backgroundColor: 'currentColor',\n },\n}))(Slider);\n\nconst settings = {\n key: 'techdocs.addons.settings.textsize',\n defaultValue: 100,\n};\n\nconst marks = [\n {\n value: 90,\n },\n {\n value: 100,\n },\n {\n value: 115,\n },\n {\n value: 130,\n },\n {\n value: 150,\n },\n];\n\nconst useStyles = makeStyles((theme: BackstageTheme) => ({\n container: {\n color: theme.palette.textSubtle,\n display: 'flex',\n alignItems: 'center',\n margin: 0,\n minWidth: 200,\n },\n menuItem: {\n '&:hover': {\n background: 'transparent',\n },\n },\n decreaseButton: {\n marginRight: theme.spacing(1),\n },\n increaseButton: {\n marginLeft: theme.spacing(1),\n },\n}));\n\nexport const TextSizeAddon = () => {\n const classes = useStyles();\n const theme = useTheme<BackstageTheme>();\n const [body] = useShadowRootElements(['body']);\n\n const [value, setValue] = useState<number>(() => {\n const initialValue = localStorage?.getItem(settings.key);\n return initialValue ? parseInt(initialValue, 10) : settings.defaultValue;\n });\n\n const values = useMemo(() => marks.map(mark => mark.value), []);\n const index = useMemo(() => values.indexOf(value), [values, value]);\n const min = useMemo(() => values[0], [values]);\n const max = useMemo(() => values[values.length - 1], [values]);\n\n const getValueText = useCallback(() => `${value}%`, [value]);\n\n const handleChangeCommitted = useCallback(\n (_event: ChangeEvent<{}>, newValue: number | number[]) => {\n if (!Array.isArray(newValue)) {\n setValue(newValue);\n localStorage?.setItem(settings.key, String(newValue));\n }\n },\n [setValue],\n );\n\n const handleDecreaseClick = useCallback(\n (event: MouseEvent) => {\n handleChangeCommitted(event, values[index - 1]);\n },\n [index, values, handleChangeCommitted],\n );\n\n const handleIncreaseClick = useCallback(\n (event: MouseEvent) => {\n handleChangeCommitted(event, values[index + 1]);\n },\n [index, values, handleChangeCommitted],\n );\n\n useEffect(() => {\n if (!body) return;\n const htmlFontSize =\n (\n theme.typography as BackstageTheme['typography'] & {\n htmlFontSize?: number;\n }\n )?.htmlFontSize ?? 16;\n body.style.setProperty(\n '--md-typeset-font-size',\n `${htmlFontSize * (value / 100)}px`,\n );\n }, [body, value, theme]);\n\n return (\n <MenuItem className={classes.menuItem} button disableRipple>\n <ListItemText\n primary={\n <Typography variant=\"subtitle2\" color=\"textPrimary\">\n Text size\n </Typography>\n }\n secondary={\n <Box className={classes.container}>\n <IconButton\n className={classes.decreaseButton}\n size=\"small\"\n edge=\"start\"\n disabled={value === min}\n onClick={handleDecreaseClick}\n aria-label=\"Decrease text size\"\n >\n <RemoveIcon />\n </IconButton>\n <StyledSlider\n value={value}\n aria-labelledby=\"text-size-slider\"\n getAriaValueText={getValueText}\n valueLabelDisplay=\"on\"\n valueLabelFormat={getValueText}\n marks={marks}\n step={null}\n min={min}\n max={max}\n onChangeCommitted={handleChangeCommitted}\n />\n <IconButton\n className={classes.increaseButton}\n size=\"small\"\n edge=\"end\"\n disabled={value === max}\n onClick={handleIncreaseClick}\n aria-label=\"Increase text size\"\n >\n <AddIcon />\n </IconButton>\n </Box>\n }\n disableTypography\n />\n </MenuItem>\n );\n};\n","/*\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 { createPlugin } from '@backstage/core-plugin-api';\nimport {\n createTechDocsAddonExtension,\n TechDocsAddonLocations,\n} from '@backstage/plugin-techdocs-react';\nimport { ExpandableNavigationAddon } from './ExpandableNavigation';\nimport { ReportIssueAddon, ReportIssueProps } from './ReportIssue';\nimport { TextSizeAddon } from './TextSize';\n\n/**\n * The TechDocs addons contrib plugin\n *\n * @public\n */\n\nexport const techdocsModuleAddonsContribPlugin = createPlugin({\n id: 'techdocsModuleAddonsContrib',\n});\n\n/**\n * TechDocs addon that lets you expand/collapse the TechDocs main navigation\n * and keep the preferred state in local storage. The addon will render as\n * a button next to the site name if the documentation has nested navigation.\n *\n * @example\n * Here's a simple example:\n * ```\n * import {\n * DefaultTechDocsHome,\n * TechDocsIndexPage,\n * TechDocsReaderPage,\n * } from '@backstage/plugin-techdocs';\n * import { TechDocsAddons } from '@backstage/plugin-techdocs-react/alpha';\n * import { ExpandableNavigation } from '@backstage/plugin-techdocs-module-addons-contrib';\n *\n *\n * const AppRoutes = () => {\n * <FlatRoutes>\n * // other plugin routes\n * <Route path=\"/docs\" element={<TechDocsIndexPage />}>\n * <DefaultTechDocsHome />\n * </Route>\n * <Route\n * path=\"/docs/:namespace/:kind/:name/*\"\n * element={<TechDocsReaderPage />}\n * >\n * <TechDocsAddons>\n * <ExpandableNavigation />\n * </TechDocsAddons>\n * </Route>\n * </FlatRoutes>;\n * };\n * ```\n *\n * @public\n */\n\nexport const ExpandableNavigation = techdocsModuleAddonsContribPlugin.provide(\n createTechDocsAddonExtension({\n name: 'ExpandableNavigation',\n location: TechDocsAddonLocations.PrimarySidebar,\n component: ExpandableNavigationAddon,\n }),\n);\n\n/**\n * TechDocs addon that lets you select text and open GitHub/Gitlab issues\n *\n * @remarks\n * Before using it, you should set up an `edit_uri` for your pages as explained {@link https://backstage.io/docs/features/techdocs/faqs#is-it-possible-for-users-to-suggest-changes-or-provide-feedback-on-a-techdocs-page | here} and remember, it only works for Github or Gitlab.\n *\n * @example\n * Here's a simple example:\n * ```\n * import {\n * DefaultTechDocsHome,\n * TechDocsIndexPage,\n * TechDocsReaderPage,\n * } from '@backstage/plugin-techdocs';\n * import { TechDocsAddons } from '@backstage/plugin-techdocs-react';\n * import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';\n *\n *\n * const AppRoutes = () => {\n * <FlatRoutes>\n * // other plugin routes\n * <Route path=\"/docs\" element={<TechDocsIndexPage />}>\n * <DefaultTechDocsHome />\n * </Route>\n * <Route\n * path=\"/docs/:namespace/:kind/:name/*\"\n * element={<TechDocsReaderPage />}\n * >\n * <TechDocsAddons>\n * <ReportIssue />\n * </TechDocsAddons>\n * </Route>\n * </FlatRoutes>;\n * };\n * ```\n *\n * @example\n * Here's an example with `debounceTime` and `templateBuilder` props:\n * ```\n * import {\n * DefaultTechDocsHome,\n * TechDocsIndexPage,\n * TechDocsReaderPage,\n * } from '@backstage/plugin-techdocs';\n * import { TechDocsAddons } from '@backstage/plugin-techdocs-react';\n * import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';\n *\n * const templateBuilder = ({ selection }: ReportIssueTemplateBuilder) => (({\n * title: 'Custom issue title',\n * body: `Custom issue body: ${selection.toString()}`\n * }))\n *\n * const AppRoutes = () => {\n * <FlatRoutes>\n * // other plugin routes\n * <Route path=\"/docs\" element={<TechDocsIndexPage />}>\n * <DefaultTechDocsHome />\n * </Route>\n * <Route\n * path=\"/docs/:namespace/:kind/:name/*\"\n * element={<TechDocsReaderPage />}\n * >\n * <TechDocsAddons>\n * <ReportIssue debounceTime={300} templateBuilder={templateBuilder} />\n * </TechDocsAddons>\n * </Route>\n * </FlatRoutes>;\n * ```\n * @param props - Object that can optionally contain `debounceTime` and `templateBuilder` properties.\n * @public\n */\nexport const ReportIssue = techdocsModuleAddonsContribPlugin.provide(\n createTechDocsAddonExtension<ReportIssueProps>({\n name: 'ReportIssue',\n location: TechDocsAddonLocations.Content,\n component: ReportIssueAddon,\n }),\n);\n\n/**\n * This TechDocs addon allows users to customize text size on documentation pages, they can select how much they want to increase or decrease the font size via slider or buttons.\n *\n * @remarks\n * The default value for the font size is 100% of the HTML font size, if the theme does not have a `htmlFontSize` in its typography object, the addon will assume 16px as 100%, and remember, this setting is kept in the browser local storage.\n *\n * @example\n * Here's a simple example:\n * ```\n * import {\n * DefaultTechDocsHome,\n * TechDocsIndexPage,\n * TechDocsReaderPage,\n * } from '@backstage/plugin-techdocs';\n * import { TechDocsAddons } from '@backstage/plugin-techdocs-react';\n * import { TextSize } from '@backstage/plugin-techdocs-module-addons-contrib';\n *\n *\n * const AppRoutes = () => {\n * <FlatRoutes>\n * // other plugin routes\n * <Route path=\"/docs\" element={<TechDocsIndexPage />}>\n * <DefaultTechDocsHome />\n * </Route>\n * <Route\n * path=\"/docs/:namespace/:kind/:name/*\"\n * element={<TechDocsReaderPage />}\n * >\n * <TechDocsAddons>\n * <TextSize />\n * </TechDocsAddons>\n * </Route>\n * </FlatRoutes>;\n * };\n * ```\n *\n * @public\n */\nexport const TextSize = techdocsModuleAddonsContribPlugin.provide(\n createTechDocsAddonExtension({\n name: 'TextSize',\n location: TechDocsAddonLocations.Settings,\n component: TextSizeAddon,\n }),\n);\n"],"names":["useStyles"],"mappings":";;;;;;;;;;;;;;;AAMA,MAAM,kBAAkB,GAAG,kCAAkC,CAAC;AAC9D,MAAM,mCAAmC,GAAG,yCAAyC,CAAC;AACtF,MAAM,YAAY,GAAG,UAAU,CAAC;AAChC,EAAE,IAAI,EAAE;AACR,IAAI,QAAQ,EAAE,UAAU;AACxB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,GAAG,EAAE,MAAM;AACf,IAAI,OAAO,EAAE,CAAC;AACd,IAAI,QAAQ,EAAE,CAAC;AACf,GAAG;AACH,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACX,MAAM,aAAa,GAAG,UAAU,CAAC;AACjC,EAAE,IAAI,EAAE;AACR,IAAI,MAAM,EAAE,MAAM;AAClB,IAAI,KAAK,EAAE,MAAM;AACjB,GAAG;AACH,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACrB,MAAM,Y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AAI,iBAAiB,EAAE,IAAI;AAC3B,GAAG,CAAC,CAAC,CAAC;AACN,CAAC;;AC5KW,MAAC,iCAAiC,GAAG,YAAY,CAAC;AAC9D,EAAE,EAAE,EAAE,6BAA6B;AACnC,CAAC,EAAE;AACS,MAAC,oBAAoB,GAAG,iCAAiC,CAAC,OAAO,CAAC,4BAA4B,CAAC;AAC3G,EAAE,IAAI,EAAE,sBAAsB;AAC9B,EAAE,QAAQ,EAAE,sBAAsB,CAAC,cAAc;AACjD,EAAE,SAAS,EAAE,yBAAyB;AACtC,CAAC,CAAC,EAAE;AACQ,MAAC,WAAW,GAAG,iCAAiC,CAAC,OAAO,CAAC,4BAA4B,CAAC;AAClG,EAAE,IAAI,EAAE,aAAa;AACrB,EAAE,QAAQ,EAAE,sBAAsB,CAAC,OAAO;AAC1C,EAAE,SAAS,EAAE,gBAAgB;AAC7B,CAAC,CAAC,EAAE;AACQ,MAAC,QAAQ,GAAG,iCAAiC,CAAC,OAAO,CAAC,4BAA4B,CAAC;AAC/F,EAAE,IAAI,EAAE,UAAU;AAClB,EAAE,QAAQ,EAAE,sBAAsB,CAAC,QAAQ;AAC3C,EAAE,SAAS,EAAE,aAAa;AAC1B,CAAC,CAAC;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-techdocs-module-addons-contrib",
3
3
  "description": "Plugin module for contributed TechDocs Addons",
4
- "version": "0.1.0-next.0",
4
+ "version": "1.0.0",
5
5
  "main": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -34,15 +34,16 @@
34
34
  "postpack": "backstage-cli package postpack"
35
35
  },
36
36
  "dependencies": {
37
- "@backstage/core-components": "^0.9.3",
38
- "@backstage/core-plugin-api": "^1.0.1",
39
- "@backstage/integration": "^1.2.0-next.0",
40
- "@backstage/integration-react": "^1.1.0-next.0",
41
- "@backstage/plugin-techdocs-react": "^0.1.1-next.0",
37
+ "@backstage/core-components": "^0.9.4",
38
+ "@backstage/core-plugin-api": "^1.0.2",
39
+ "@backstage/integration": "^1.2.0",
40
+ "@backstage/integration-react": "^1.1.0",
41
+ "@backstage/plugin-techdocs-react": "^1.0.0",
42
42
  "@backstage/theme": "^0.2.15",
43
43
  "@material-ui/core": "^4.9.13",
44
44
  "@material-ui/icons": "^4.9.1",
45
45
  "@material-ui/lab": "4.0.0-alpha.57",
46
+ "@react-hookz/web": "^13.0.0",
46
47
  "git-url-parse": "^11.6.0",
47
48
  "react-use": "^17.2.4"
48
49
  },
@@ -50,10 +51,11 @@
50
51
  "react": "^16.13.1 || ^17.0.0"
51
52
  },
52
53
  "devDependencies": {
53
- "@backstage/cli": "^0.17.1-next.0",
54
- "@backstage/core-app-api": "^1.0.1",
55
- "@backstage/dev-utils": "^1.0.2-next.0",
56
- "@backstage/test-utils": "^1.0.2-next.0",
54
+ "@backstage/cli": "^0.17.1",
55
+ "@backstage/core-app-api": "^1.0.2",
56
+ "@backstage/dev-utils": "^1.0.2",
57
+ "@backstage/plugin-techdocs-addons-test-utils": "^1.0.0",
58
+ "@backstage/test-utils": "^1.1.0",
57
59
  "@testing-library/jest-dom": "^5.10.1",
58
60
  "@testing-library/react": "^12.1.3",
59
61
  "@testing-library/user-event": "^14.0.0",
@@ -66,5 +68,5 @@
66
68
  "files": [
67
69
  "dist"
68
70
  ],
69
- "gitHead": "88ee375f5ee44b7a7917297785ddf88691fe3381"
71
+ "gitHead": "96323f280ba32ee526c5b151cda42260aee927c9"
70
72
  }