@backstage/dev-utils 0.2.11 → 0.2.15

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,61 @@
1
1
  # @backstage/dev-utils
2
2
 
3
+ ## 0.2.15
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/app-defaults@0.1.3
9
+ - @backstage/core-app-api@0.3.0
10
+ - @backstage/core-plugin-api@0.4.0
11
+ - @backstage/plugin-catalog-react@0.6.8
12
+ - @backstage/core-components@0.8.2
13
+ - @backstage/test-utils@0.2.0
14
+ - @backstage/integration-react@0.1.16
15
+
16
+ ## 0.2.14
17
+
18
+ ### Patch Changes
19
+
20
+ - cd450844f6: Moved React dependencies to `peerDependencies` and allow both React v16 and v17 to be used.
21
+ - dcd1a0c3f4: Minor improvement to the API reports, by not unpacking arguments directly
22
+ - Updated dependencies
23
+ - @backstage/core-components@0.8.0
24
+ - @backstage/core-plugin-api@0.3.0
25
+ - @backstage/core-app-api@0.2.0
26
+ - @backstage/app-defaults@0.1.2
27
+ - @backstage/integration-react@0.1.15
28
+ - @backstage/test-utils@0.1.24
29
+ - @backstage/plugin-catalog-react@0.6.5
30
+
31
+ ## 0.2.13
32
+
33
+ ### Patch Changes
34
+
35
+ - 58a4e67ded: Add theme switcher to sidebar of dev app.
36
+ - 014cbf8cb9: Migrated to using `@backstage/app-defaults`.
37
+ - Updated dependencies
38
+ - @backstage/catalog-model@0.9.7
39
+ - @backstage/plugin-catalog-react@0.6.4
40
+ - @backstage/core-components@0.7.4
41
+ - @backstage/core-plugin-api@0.2.0
42
+ - @backstage/core-app-api@0.1.21
43
+ - @backstage/test-utils@0.1.22
44
+ - @backstage/app-defaults@0.1.1
45
+ - @backstage/integration-react@0.1.14
46
+
47
+ ## 0.2.12
48
+
49
+ ### Patch Changes
50
+
51
+ - Updated dependencies
52
+ - @backstage/plugin-catalog-react@0.6.0
53
+ - @backstage/core-app-api@0.1.17
54
+ - @backstage/core-components@0.7.0
55
+ - @backstage/theme@0.2.11
56
+ - @backstage/test-utils@0.1.19
57
+ - @backstage/integration-react@0.1.12
58
+
3
59
  ## 0.2.11
4
60
 
5
61
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import { Entity } from '@backstage/catalog-model';
3
3
  import { GridProps } from '@material-ui/core';
4
- import { ReactNode, ComponentType } from 'react';
5
4
  import { IconComponent, BackstagePlugin, ApiFactory, AppTheme } from '@backstage/core-plugin-api';
5
+ import { ReactNode, ComponentType } from 'react';
6
6
 
7
7
  /** @public */
8
- declare const EntityGridItem: ({ entity, classes, ...rest }: Omit<GridProps<"div", {}>, "container" | "item"> & {
8
+ declare const EntityGridItem: (props: Omit<GridProps, 'item' | 'container'> & {
9
9
  entity: Entity;
10
10
  }) => JSX.Element;
11
11
 
package/dist/index.esm.js CHANGED
@@ -1,17 +1,20 @@
1
1
  import { EntityProvider } from '@backstage/plugin-catalog-react';
2
- import { makeStyles, Grid, Box } from '@material-ui/core';
3
- import React from 'react';
2
+ import { makeStyles, Grid, Menu, MenuItem, ListItemIcon, ListItemText, Box } from '@material-ui/core';
3
+ import React, { useState, useCallback, cloneElement } from 'react';
4
+ import { createApp } from '@backstage/app-defaults';
5
+ import { FlatRoutes } from '@backstage/core-app-api';
6
+ import { SidebarItem, AlertDisplay, OAuthRequestDialog, SidebarPage, Sidebar, SidebarSpacer, SidebarSpace, SidebarDivider } from '@backstage/core-components';
7
+ import { useApi, appThemeApiRef, attachComponentData, createRouteRef, createApiFactory, configApiRef } from '@backstage/core-plugin-api';
4
8
  import { scmIntegrationsApiRef, ScmIntegrationsApi } from '@backstage/integration-react';
5
9
  import BookmarkIcon from '@material-ui/icons/Bookmark';
6
10
  import ReactDOM from 'react-dom';
7
11
  import { hot } from 'react-hot-loader';
8
12
  import { Route } from 'react-router';
9
- import { SidebarItem, AlertDisplay, OAuthRequestDialog, SidebarPage, Sidebar, SidebarSpacer } from '@backstage/core-components';
10
- import { attachComponentData, createRouteRef, createApiFactory, configApiRef } from '@backstage/core-plugin-api';
11
- import { createApp, FlatRoutes } from '@backstage/core-app-api';
13
+ import AutoIcon from '@material-ui/icons/BrightnessAuto';
14
+ import { useObservable } from 'react-use';
12
15
 
13
16
  const useStyles = makeStyles((theme) => ({
14
- root: ({entity}) => ({
17
+ root: ({ entity }) => ({
15
18
  position: "relative",
16
19
  "&::before": {
17
20
  content: `"${entity.metadata.name}"`,
@@ -22,22 +25,88 @@ const useStyles = makeStyles((theme) => ({
22
25
  }
23
26
  })
24
27
  }));
25
- const EntityGridItem = ({
26
- entity,
27
- classes,
28
- ...rest
29
- }) => {
30
- const itemClasses = useStyles({entity});
28
+ const EntityGridItem = (props) => {
29
+ const { entity, classes, ...rest } = props;
30
+ const itemClasses = useStyles({ entity });
31
31
  return /* @__PURE__ */ React.createElement(EntityProvider, {
32
32
  entity
33
33
  }, /* @__PURE__ */ React.createElement(Grid, {
34
- classes: {root: itemClasses.root, ...classes},
34
+ classes: { root: itemClasses.root, ...classes },
35
35
  ...rest,
36
36
  item: true
37
37
  }));
38
38
  };
39
39
 
40
- const GatheringRoute = ({element}) => element;
40
+ const ThemeIcon = ({ active, icon }) => icon ? cloneElement(icon, {
41
+ color: active ? "primary" : void 0
42
+ }) : /* @__PURE__ */ React.createElement(AutoIcon, {
43
+ color: active ? "primary" : void 0
44
+ });
45
+ const SidebarThemeSwitcher = () => {
46
+ const appThemeApi = useApi(appThemeApiRef);
47
+ const themeId = useObservable(appThemeApi.activeThemeId$(), appThemeApi.getActiveThemeId());
48
+ const themeIds = appThemeApi.getInstalledThemes();
49
+ const activeTheme = themeIds.find((t) => t.id === themeId);
50
+ const [anchorEl, setAnchorEl] = useState();
51
+ const open = Boolean(anchorEl);
52
+ const handleOpen = (event) => {
53
+ setAnchorEl(event.currentTarget);
54
+ };
55
+ const handleSelectTheme = (newThemeId) => {
56
+ if (themeIds.some((t) => t.id === newThemeId)) {
57
+ appThemeApi.setActiveThemeId(newThemeId);
58
+ } else {
59
+ appThemeApi.setActiveThemeId(void 0);
60
+ }
61
+ setAnchorEl(void 0);
62
+ };
63
+ const handleClose = () => {
64
+ setAnchorEl(void 0);
65
+ };
66
+ const ActiveIcon = useCallback(() => /* @__PURE__ */ React.createElement(ThemeIcon, {
67
+ icon: activeTheme == null ? void 0 : activeTheme.icon
68
+ }), [activeTheme]);
69
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SidebarItem, {
70
+ icon: ActiveIcon,
71
+ text: "Switch Theme",
72
+ id: "theme-button",
73
+ "aria-haspopup": "listbox",
74
+ "aria-controls": "theme-menu",
75
+ "aria-label": "switch theme",
76
+ "aria-expanded": open ? "true" : void 0,
77
+ onClick: handleOpen
78
+ }), /* @__PURE__ */ React.createElement(Menu, {
79
+ id: "theme-menu",
80
+ anchorEl,
81
+ open,
82
+ onClose: handleClose,
83
+ MenuListProps: {
84
+ "aria-labelledby": "theme-button",
85
+ role: "listbox"
86
+ }
87
+ }, /* @__PURE__ */ React.createElement(MenuItem, {
88
+ disabled: true
89
+ }, "Choose a theme"), /* @__PURE__ */ React.createElement(MenuItem, {
90
+ selected: themeId === void 0,
91
+ onClick: () => handleSelectTheme(void 0)
92
+ }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(ThemeIcon, {
93
+ icon: void 0,
94
+ active: themeId === void 0
95
+ })), /* @__PURE__ */ React.createElement(ListItemText, null, "Auto")), themeIds.map((theme) => {
96
+ const active = theme.id === themeId;
97
+ return /* @__PURE__ */ React.createElement(MenuItem, {
98
+ key: theme.id,
99
+ selected: active,
100
+ "aria-selected": active,
101
+ onClick: () => handleSelectTheme(theme.id)
102
+ }, /* @__PURE__ */ React.createElement(ListItemIcon, null, /* @__PURE__ */ React.createElement(ThemeIcon, {
103
+ icon: theme.icon,
104
+ active
105
+ })), /* @__PURE__ */ React.createElement(ListItemText, null, theme.title));
106
+ })));
107
+ };
108
+
109
+ const GatheringRoute = ({ element }) => element;
41
110
  attachComponentData(GatheringRoute, "core.gatherMountPoints", true);
42
111
  class DevAppBuilder {
43
112
  constructor() {
@@ -86,7 +155,7 @@ class DevAppBuilder {
86
155
  return this;
87
156
  }
88
157
  build() {
89
- const dummyRouteRef = createRouteRef({title: "Page of another plugin"});
158
+ const dummyRouteRef = createRouteRef({ id: "dummy" });
90
159
  const DummyPage = () => /* @__PURE__ */ React.createElement(Box, {
91
160
  p: 3
92
161
  }, "Page belonging to another plugin.");
@@ -95,15 +164,15 @@ class DevAppBuilder {
95
164
  if (!apis.some((api) => api.api.id === scmIntegrationsApiRef.id)) {
96
165
  apis.push(createApiFactory({
97
166
  api: scmIntegrationsApiRef,
98
- deps: {configApi: configApiRef},
99
- factory: ({configApi}) => ScmIntegrationsApi.fromConfig(configApi)
167
+ deps: { configApi: configApiRef },
168
+ factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi)
100
169
  }));
101
170
  }
102
171
  const app = createApp({
103
172
  apis,
104
173
  plugins: this.plugins,
105
174
  themes: this.themes,
106
- bindRoutes: ({bind}) => {
175
+ bindRoutes: ({ bind }) => {
107
176
  var _a;
108
177
  for (const plugin of (_a = this.plugins) != null ? _a : []) {
109
178
  const targets = {};
@@ -117,7 +186,7 @@ class DevAppBuilder {
117
186
  const AppProvider = app.getProvider();
118
187
  const AppRouter = app.getRouter();
119
188
  const DevApp = () => {
120
- return /* @__PURE__ */ React.createElement(AppProvider, null, /* @__PURE__ */ React.createElement(AlertDisplay, null), /* @__PURE__ */ React.createElement(OAuthRequestDialog, null), this.rootChildren, /* @__PURE__ */ React.createElement(AppRouter, null, /* @__PURE__ */ React.createElement(SidebarPage, null, /* @__PURE__ */ React.createElement(Sidebar, null, /* @__PURE__ */ React.createElement(SidebarSpacer, null), this.sidebarItems), /* @__PURE__ */ React.createElement(FlatRoutes, null, this.routes, /* @__PURE__ */ React.createElement(Route, {
189
+ return /* @__PURE__ */ React.createElement(AppProvider, null, /* @__PURE__ */ React.createElement(AlertDisplay, null), /* @__PURE__ */ React.createElement(OAuthRequestDialog, null), this.rootChildren, /* @__PURE__ */ React.createElement(AppRouter, null, /* @__PURE__ */ React.createElement(SidebarPage, null, /* @__PURE__ */ React.createElement(Sidebar, null, /* @__PURE__ */ React.createElement(SidebarSpacer, null), this.sidebarItems, /* @__PURE__ */ React.createElement(SidebarSpace, null), /* @__PURE__ */ React.createElement(SidebarDivider, null), /* @__PURE__ */ React.createElement(SidebarThemeSwitcher, null)), /* @__PURE__ */ React.createElement(FlatRoutes, null, this.routes, /* @__PURE__ */ React.createElement(Route, {
121
190
  path: "/_external_route",
122
191
  element: /* @__PURE__ */ React.createElement(DummyPage, null)
123
192
  })))));
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/components/EntityGridItem/EntityGridItem.tsx","../src/devApp/render.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityProvider } from '@backstage/plugin-catalog-react';\nimport { BackstageTheme } from '@backstage/theme';\nimport { Grid, GridProps, makeStyles } from '@material-ui/core';\nimport React from 'react';\n\nconst useStyles = makeStyles<BackstageTheme, { entity: Entity }>(theme => ({\n root: ({ entity }) => ({\n position: 'relative',\n\n '&::before': {\n content: `\"${entity.metadata.name}\"`,\n top: -theme.typography.fontSize + 4,\n display: 'block',\n position: 'absolute',\n color: theme.palette.textSubtle,\n },\n }),\n}));\n\n/** @public */\nexport const EntityGridItem = ({\n entity,\n classes,\n ...rest\n}: Omit<GridProps, 'item' | 'container'> & { entity: Entity }): JSX.Element => {\n const itemClasses = useStyles({ entity });\n\n return (\n <EntityProvider entity={entity}>\n <Grid classes={{ root: itemClasses.root, ...classes }} {...rest} item />\n </EntityProvider>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n ScmIntegrationsApi,\n scmIntegrationsApiRef,\n} from '@backstage/integration-react';\nimport { Box } from '@material-ui/core';\nimport BookmarkIcon from '@material-ui/icons/Bookmark';\nimport React, { ComponentType, ReactNode } from 'react';\nimport ReactDOM from 'react-dom';\nimport { hot } from 'react-hot-loader';\nimport { Route } from 'react-router';\n\nimport {\n AlertDisplay,\n OAuthRequestDialog,\n Sidebar,\n SidebarItem,\n SidebarPage,\n SidebarSpacer,\n} from '@backstage/core-components';\n\nimport {\n AnyApiFactory,\n ApiFactory,\n AppTheme,\n attachComponentData,\n configApiRef,\n createApiFactory,\n createRouteRef,\n IconComponent,\n RouteRef,\n BackstagePlugin,\n} from '@backstage/core-plugin-api';\n\nimport { createApp, FlatRoutes } from '@backstage/core-app-api';\n\nconst GatheringRoute: (props: {\n path: string;\n element: JSX.Element;\n children?: ReactNode;\n}) => JSX.Element = ({ element }) => element;\n\nattachComponentData(GatheringRoute, 'core.gatherMountPoints', true);\n\n/** @public */\nexport type DevAppPageOptions = {\n path?: string;\n element: JSX.Element;\n children?: JSX.Element;\n title?: string;\n icon?: IconComponent;\n};\n\n/**\n * DevApp builder that is similar to the App builder API, but creates an App\n * with the purpose of developing one or more plugins inside it.\n *\n * @public\n */\nexport class DevAppBuilder {\n private readonly plugins = new Array<BackstagePlugin>();\n private readonly apis = new Array<AnyApiFactory>();\n private readonly rootChildren = new Array<ReactNode>();\n private readonly routes = new Array<JSX.Element>();\n private readonly sidebarItems = new Array<JSX.Element>();\n\n private defaultPage?: string;\n private themes?: Array<AppTheme>;\n\n /**\n * Register one or more plugins to render in the dev app\n */\n registerPlugin(...plugins: BackstagePlugin[]): DevAppBuilder {\n this.plugins.push(...plugins);\n return this;\n }\n\n /**\n * Register an API factory to add to the app\n */\n registerApi<\n Api,\n Impl extends Api,\n Deps extends { [name in string]: unknown },\n >(factory: ApiFactory<Api, Impl, Deps>): DevAppBuilder {\n this.apis.push(factory);\n return this;\n }\n\n /**\n * Adds a React node to place just inside the App Provider.\n *\n * Useful for adding more global components like the AlertDisplay.\n */\n addRootChild(node: ReactNode): DevAppBuilder {\n this.rootChildren.push(node);\n return this;\n }\n\n /**\n * Adds a page component along with accompanying sidebar item.\n *\n * If no path is provided one will be generated.\n * If no title is provided, no sidebar item will be created.\n */\n addPage(opts: DevAppPageOptions): DevAppBuilder {\n const path = opts.path ?? `/page-${this.routes.length + 1}`;\n\n if (!this.defaultPage || path === '/') {\n this.defaultPage = path;\n }\n\n if (opts.title) {\n this.sidebarItems.push(\n <SidebarItem\n key={path}\n to={path}\n text={opts.title}\n icon={opts.icon ?? BookmarkIcon}\n />,\n );\n }\n this.routes.push(\n <GatheringRoute\n key={path}\n path={path}\n element={opts.element}\n children={opts.children}\n />,\n );\n return this;\n }\n\n /**\n * Adds an array of themes to overide the default theme.\n */\n addThemes(themes: AppTheme[]) {\n this.themes = themes;\n return this;\n }\n\n /**\n * Build a DevApp component using the resources registered so far\n */\n build(): ComponentType<{}> {\n const dummyRouteRef = createRouteRef({ title: 'Page of another plugin' });\n const DummyPage = () => <Box p={3}>Page belonging to another plugin.</Box>;\n attachComponentData(DummyPage, 'core.mountPoint', dummyRouteRef);\n\n const apis = [...this.apis];\n if (!apis.some(api => api.api.id === scmIntegrationsApiRef.id)) {\n apis.push(\n createApiFactory({\n api: scmIntegrationsApiRef,\n deps: { configApi: configApiRef },\n factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi),\n }),\n );\n }\n\n const app = createApp({\n apis,\n plugins: this.plugins,\n themes: this.themes,\n bindRoutes: ({ bind }) => {\n for (const plugin of this.plugins ?? []) {\n const targets: Record<string, RouteRef<any>> = {};\n for (const routeKey of Object.keys(plugin.externalRoutes)) {\n targets[routeKey] = dummyRouteRef;\n }\n bind(plugin.externalRoutes, targets);\n }\n },\n });\n\n const AppProvider = app.getProvider();\n const AppRouter = app.getRouter();\n\n const DevApp = () => {\n return (\n <AppProvider>\n <AlertDisplay />\n <OAuthRequestDialog />\n {this.rootChildren}\n <AppRouter>\n <SidebarPage>\n <Sidebar>\n <SidebarSpacer />\n {this.sidebarItems}\n </Sidebar>\n <FlatRoutes>\n {this.routes}\n <Route path=\"/_external_route\" element={<DummyPage />} />\n </FlatRoutes>\n </SidebarPage>\n </AppRouter>\n </AppProvider>\n );\n };\n\n return DevApp;\n }\n\n /**\n * Build and render directory to #root element, with react hot loading.\n */\n render(): void {\n const hotModule =\n require.cache['./dev/index.tsx'] ??\n require.cache['./dev/index.ts'] ??\n module;\n\n const DevApp = hot(hotModule)(this.build());\n\n if (\n window.location.pathname === '/' &&\n this.defaultPage &&\n this.defaultPage !== '/'\n ) {\n window.location.pathname = this.defaultPage;\n }\n\n ReactDOM.render(<DevApp />, document.getElementById('root'));\n }\n}\n\n// TODO(rugvip): Figure out patterns for how to allow in-house apps to build upon\n// this to provide their own plugin dev wrappers.\n\n/**\n * Creates a dev app for rendering one or more plugins and exposing the touch points of the plugin.\n *\n * @public\n */\nexport function createDevApp() {\n return new DevAppBuilder();\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,MAAM,YAAY,WAA+C;AAAU,EACzE,MAAM,CAAC,CAAE;AAAc,IACrB,UAAU;AAAA,IAEV,aAAa;AAAA,MACX,SAAS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SAAS,aAAa,OAC7B,KAAK,eACL,KAAK,gBAAgB,KACrB;AACA,aAAO,SAAS,WAAW,KAAK;AAAA;AAGlC,aAAS,2CAAQ,QAAD,OAAY,SAAS,eAAe;AAAA;AAAA;wBAYzB;AAC7B,SAAO,IAAI;AAAA;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/components/EntityGridItem/EntityGridItem.tsx","../src/devApp/SidebarThemeSwitcher.tsx","../src/devApp/render.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Entity } from '@backstage/catalog-model';\nimport { EntityProvider } from '@backstage/plugin-catalog-react';\nimport { BackstageTheme } from '@backstage/theme';\nimport { Grid, GridProps, makeStyles } from '@material-ui/core';\nimport React from 'react';\n\nconst useStyles = makeStyles<BackstageTheme, { entity: Entity }>(theme => ({\n root: ({ entity }) => ({\n position: 'relative',\n\n '&::before': {\n content: `\"${entity.metadata.name}\"`,\n top: -theme.typography.fontSize + 4,\n display: 'block',\n position: 'absolute',\n color: theme.palette.textSubtle,\n },\n }),\n}));\n\n/** @public */\nexport const EntityGridItem = (\n props: Omit<GridProps, 'item' | 'container'> & { entity: Entity },\n): JSX.Element => {\n const { entity, classes, ...rest } = props;\n const itemClasses = useStyles({ entity });\n\n return (\n <EntityProvider entity={entity}>\n <Grid classes={{ root: itemClasses.root, ...classes }} {...rest} item />\n </EntityProvider>\n );\n};\n","/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SidebarItem } from '@backstage/core-components';\nimport { appThemeApiRef, useApi } from '@backstage/core-plugin-api';\nimport { ListItemIcon, ListItemText, Menu, MenuItem } from '@material-ui/core';\nimport AutoIcon from '@material-ui/icons/BrightnessAuto';\nimport React, { cloneElement, useCallback, useState } from 'react';\nimport { useObservable } from 'react-use';\n\ntype ThemeIconProps = {\n active?: boolean;\n icon: JSX.Element | undefined;\n};\n\nconst ThemeIcon = ({ active, icon }: ThemeIconProps) =>\n icon ? (\n cloneElement(icon, {\n color: active ? 'primary' : undefined,\n })\n ) : (\n <AutoIcon color={active ? 'primary' : undefined} />\n );\n\nexport const SidebarThemeSwitcher = () => {\n const appThemeApi = useApi(appThemeApiRef);\n const themeId = useObservable(\n appThemeApi.activeThemeId$(),\n appThemeApi.getActiveThemeId(),\n );\n const themeIds = appThemeApi.getInstalledThemes();\n const activeTheme = themeIds.find(t => t.id === themeId);\n\n const [anchorEl, setAnchorEl] = useState<Element | undefined>();\n const open = Boolean(anchorEl);\n\n const handleOpen = (event: React.MouseEvent) => {\n setAnchorEl(event.currentTarget);\n };\n\n const handleSelectTheme = (newThemeId: string | undefined) => {\n if (themeIds.some(t => t.id === newThemeId)) {\n appThemeApi.setActiveThemeId(newThemeId);\n } else {\n appThemeApi.setActiveThemeId(undefined);\n }\n\n setAnchorEl(undefined);\n };\n\n const handleClose = () => {\n setAnchorEl(undefined);\n };\n\n const ActiveIcon = useCallback(\n () => <ThemeIcon icon={activeTheme?.icon} />,\n [activeTheme],\n );\n\n return (\n <>\n <SidebarItem\n icon={ActiveIcon}\n text=\"Switch Theme\"\n id=\"theme-button\"\n aria-haspopup=\"listbox\"\n aria-controls=\"theme-menu\"\n aria-label=\"switch theme\"\n aria-expanded={open ? 'true' : undefined}\n onClick={handleOpen}\n />\n\n <Menu\n id=\"theme-menu\"\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n MenuListProps={{\n 'aria-labelledby': 'theme-button',\n role: 'listbox',\n }}\n >\n <MenuItem disabled>Choose a theme</MenuItem>\n <MenuItem\n selected={themeId === undefined}\n onClick={() => handleSelectTheme(undefined)}\n >\n <ListItemIcon>\n <ThemeIcon icon={undefined} active={themeId === undefined} />\n </ListItemIcon>\n <ListItemText>Auto</ListItemText>\n </MenuItem>\n\n {themeIds.map(theme => {\n const active = theme.id === themeId;\n return (\n <MenuItem\n key={theme.id}\n selected={active}\n aria-selected={active}\n onClick={() => handleSelectTheme(theme.id)}\n >\n <ListItemIcon>\n <ThemeIcon icon={theme.icon} active={active} />\n </ListItemIcon>\n <ListItemText>{theme.title}</ListItemText>\n </MenuItem>\n );\n })}\n </Menu>\n </>\n );\n};\n","/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createApp } from '@backstage/app-defaults';\nimport { FlatRoutes } from '@backstage/core-app-api';\nimport {\n AlertDisplay,\n OAuthRequestDialog,\n Sidebar,\n SidebarDivider,\n SidebarItem,\n SidebarPage,\n SidebarSpace,\n SidebarSpacer,\n} from '@backstage/core-components';\nimport {\n AnyApiFactory,\n ApiFactory,\n AppTheme,\n attachComponentData,\n BackstagePlugin,\n configApiRef,\n createApiFactory,\n createRouteRef,\n IconComponent,\n RouteRef,\n} from '@backstage/core-plugin-api';\nimport {\n ScmIntegrationsApi,\n scmIntegrationsApiRef,\n} from '@backstage/integration-react';\nimport { Box } from '@material-ui/core';\nimport BookmarkIcon from '@material-ui/icons/Bookmark';\nimport React, { ComponentType, ReactNode } from 'react';\nimport ReactDOM from 'react-dom';\nimport { hot } from 'react-hot-loader';\nimport { Route } from 'react-router';\nimport { SidebarThemeSwitcher } from './SidebarThemeSwitcher';\n\nconst GatheringRoute: (props: {\n path: string;\n element: JSX.Element;\n children?: ReactNode;\n}) => JSX.Element = ({ element }) => element;\n\nattachComponentData(GatheringRoute, 'core.gatherMountPoints', true);\n\n/** @public */\nexport type DevAppPageOptions = {\n path?: string;\n element: JSX.Element;\n children?: JSX.Element;\n title?: string;\n icon?: IconComponent;\n};\n\n/**\n * DevApp builder that is similar to the App builder API, but creates an App\n * with the purpose of developing one or more plugins inside it.\n *\n * @public\n */\nexport class DevAppBuilder {\n private readonly plugins = new Array<BackstagePlugin>();\n private readonly apis = new Array<AnyApiFactory>();\n private readonly rootChildren = new Array<ReactNode>();\n private readonly routes = new Array<JSX.Element>();\n private readonly sidebarItems = new Array<JSX.Element>();\n\n private defaultPage?: string;\n private themes?: Array<AppTheme>;\n\n /**\n * Register one or more plugins to render in the dev app\n */\n registerPlugin(...plugins: BackstagePlugin[]): DevAppBuilder {\n this.plugins.push(...plugins);\n return this;\n }\n\n /**\n * Register an API factory to add to the app\n */\n registerApi<\n Api,\n Impl extends Api,\n Deps extends { [name in string]: unknown },\n >(factory: ApiFactory<Api, Impl, Deps>): DevAppBuilder {\n this.apis.push(factory);\n return this;\n }\n\n /**\n * Adds a React node to place just inside the App Provider.\n *\n * Useful for adding more global components like the AlertDisplay.\n */\n addRootChild(node: ReactNode): DevAppBuilder {\n this.rootChildren.push(node);\n return this;\n }\n\n /**\n * Adds a page component along with accompanying sidebar item.\n *\n * If no path is provided one will be generated.\n * If no title is provided, no sidebar item will be created.\n */\n addPage(opts: DevAppPageOptions): DevAppBuilder {\n const path = opts.path ?? `/page-${this.routes.length + 1}`;\n\n if (!this.defaultPage || path === '/') {\n this.defaultPage = path;\n }\n\n if (opts.title) {\n this.sidebarItems.push(\n <SidebarItem\n key={path}\n to={path}\n text={opts.title}\n icon={opts.icon ?? BookmarkIcon}\n />,\n );\n }\n this.routes.push(\n <GatheringRoute\n key={path}\n path={path}\n element={opts.element}\n children={opts.children}\n />,\n );\n return this;\n }\n\n /**\n * Adds an array of themes to overide the default theme.\n */\n addThemes(themes: AppTheme[]) {\n this.themes = themes;\n return this;\n }\n\n /**\n * Build a DevApp component using the resources registered so far\n */\n build(): ComponentType<{}> {\n const dummyRouteRef = createRouteRef({ id: 'dummy' });\n const DummyPage = () => <Box p={3}>Page belonging to another plugin.</Box>;\n attachComponentData(DummyPage, 'core.mountPoint', dummyRouteRef);\n\n const apis = [...this.apis];\n if (!apis.some(api => api.api.id === scmIntegrationsApiRef.id)) {\n apis.push(\n createApiFactory({\n api: scmIntegrationsApiRef,\n deps: { configApi: configApiRef },\n factory: ({ configApi }) => ScmIntegrationsApi.fromConfig(configApi),\n }),\n );\n }\n\n const app = createApp({\n apis,\n plugins: this.plugins,\n themes: this.themes,\n bindRoutes: ({ bind }) => {\n for (const plugin of this.plugins ?? []) {\n const targets: Record<string, RouteRef<any>> = {};\n for (const routeKey of Object.keys(plugin.externalRoutes)) {\n targets[routeKey] = dummyRouteRef;\n }\n bind(plugin.externalRoutes, targets);\n }\n },\n });\n\n const AppProvider = app.getProvider();\n const AppRouter = app.getRouter();\n\n const DevApp = () => {\n return (\n <AppProvider>\n <AlertDisplay />\n <OAuthRequestDialog />\n {this.rootChildren}\n <AppRouter>\n <SidebarPage>\n <Sidebar>\n <SidebarSpacer />\n {this.sidebarItems}\n <SidebarSpace />\n <SidebarDivider />\n <SidebarThemeSwitcher />\n </Sidebar>\n <FlatRoutes>\n {this.routes}\n <Route path=\"/_external_route\" element={<DummyPage />} />\n </FlatRoutes>\n </SidebarPage>\n </AppRouter>\n </AppProvider>\n );\n };\n\n return DevApp;\n }\n\n /**\n * Build and render directory to #root element, with react hot loading.\n */\n render(): void {\n const hotModule =\n require.cache['./dev/index.tsx'] ??\n require.cache['./dev/index.ts'] ??\n module;\n\n const DevApp = hot(hotModule)(this.build());\n\n if (\n window.location.pathname === '/' &&\n this.defaultPage &&\n this.defaultPage !== '/'\n ) {\n window.location.pathname = this.defaultPage;\n }\n\n ReactDOM.render(<DevApp />, document.getElementById('root'));\n }\n}\n\n// TODO(rugvip): Figure out patterns for how to allow in-house apps to build upon\n// this to provide their own plugin dev wrappers.\n\n/**\n * Creates a dev app for rendering one or more plugins and exposing the touch points of the plugin.\n *\n * @public\n */\nexport function createDevApp() {\n return new DevAppBuilder();\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAsBA,MAAM,YAAY,WAA+C;AAAU,EACzE,MAAM,CAAC,EAAE;AAAc,IACrB,UAAU;AAAA,IAEV,aAAa;AAAA,MACX,SAAS,IAAI,OAAO,SAAS;AAAA,MAC7B,KAAK,CAAC,MAAM,WAAW,WAAW;AAAA,MAClC,SAAS;AAAA,MACT,UAAU;AAAA,MACV,OAAO,MAAM,QAAQ;AAAA;AAAA;AAAA;MAMd,iBAAiB,CAC5B,UACgB;AAChB,QAAM,EAAE,QAAQ,YAAY,SAAS;AACrC,QAAM,cAAc,UAAU,EAAE;AAEhC,6CACG,gBAAD;AAAA,IAAgB;AAAA,yCACb,MAAD;AAAA,IAAM,SAAS,EAAE,MAAM,YAAY,SAAS;AAAA,OAAe;AAAA,IAAM,MAAI;AAAA;AAAA;;AClB3E,MAAM,YAAY,CAAC,EAAE,QAAQ,WAC3B,OACE,aAAa,MAAM;AAAA,EACjB,OAAO,SAAS,YAAY;AAAA,yCAG7B,UAAD;AAAA,EAAU,OAAO,SAAS,YAAY;AAAA;MAG7B,uBAAuB,MAAM;AACxC,QAAM,cAAc,OAAO;AAC3B,QAAM,UAAU,cACd,YAAY,kBACZ,YAAY;AAEd,QAAM,WAAW,YAAY;AAC7B,QAAM,cAAc,SAAS,KAAK,OAAK,EAAE,OAAO;AAEhD,QAAM,CAAC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AAS,CAAC,EAAE,gBAAgB,mBAAmB,WAAW;AAAA;AAAA;AAKhE,UAAM,MAAM,UAAU;AAAA,MACpB;AAAA,MACA,SAAS,KAAK;AAAA,MACd,QAAQ,KAAK;AAAA,MACb,YAAY,CAAC,EAAE,WAAW;AApLhC;AAqLQ,mBAAW,UAAU,WAAK,YAAL,YAAgB,IAAI;AACvC,gBAAM,UAAyC;AAC/C,qBAAW,YAAY,OAAO,KAAK,OAAO,iBAAiB;AACzD,oBAAQ,YAAY;AAAA;AAEtB,eAAK,OAAO,gBAAgB;AAAA;AAAA;AAAA;AAKlC,UAAM,cAAc,IAAI;AACxB,UAAM,YAAY,IAAI;AAEtB,UAAM,SAAS,MAAM;AACnB,iDACG,aAAD,0CACG,cAAD,2CACC,oBAAD,OACC,KAAK,kDACL,WAAD,0CACG,aAAD,0CACG,SAAD,0CACG,eAAD,OACC,KAAK,kDACL,cAAD,2CACC,gBAAD,2CACC,sBAAD,4CAED,YAAD,MACG,KAAK,4CACL,OAAD;AAAA,QAAO,MAAK;AAAA,QAAmB,6CAAU,WAAD;AAAA;AAAA;AAQpD,WAAO;AAAA;AAAA,EAMT,SAAe;AAjOjB;AAkOI,UAAM,YACJ,oBAAQ,MAAM,uBAAd,YACA,QAAQ,MAAM,sBADd,YAEA;AAEF,UAAM,SAAS,IAAI,WAAW,KAAK;AAEnC,QACE,OAAO,SAAS,aAAa,OAC7B,KAAK,eACL,KAAK,gBAAgB,KACrB;AACA,aAAO,SAAS,WAAW,KAAK;AAAA;AAGlC,aAAS,2CAAQ,QAAD,OAAY,SAAS,eAAe;AAAA;AAAA;wBAYzB;AAC7B,SAAO,IAAI;AAAA;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/dev-utils",
3
3
  "description": "Utilities for developing Backstage plugins.",
4
- "version": "0.2.11",
4
+ "version": "0.2.15",
5
5
  "private": false,
6
6
  "publishConfig": {
7
7
  "access": "public",
@@ -29,33 +29,38 @@
29
29
  "clean": "backstage-cli clean"
30
30
  },
31
31
  "dependencies": {
32
- "@backstage/catalog-model": "^0.9.3",
33
- "@backstage/core-app-api": "^0.1.15",
34
- "@backstage/core-components": "^0.6.0",
35
- "@backstage/core-plugin-api": "^0.1.9",
36
- "@backstage/integration-react": "^0.1.11",
37
- "@backstage/plugin-catalog-react": "^0.5.1",
38
- "@backstage/test-utils": "^0.1.17",
39
- "@backstage/theme": "^0.2.10",
32
+ "@backstage/app-defaults": "^0.1.3",
33
+ "@backstage/catalog-model": "^0.9.7",
34
+ "@backstage/core-app-api": "^0.3.0",
35
+ "@backstage/core-components": "^0.8.2",
36
+ "@backstage/core-plugin-api": "^0.4.0",
37
+ "@backstage/integration-react": "^0.1.16",
38
+ "@backstage/plugin-catalog-react": "^0.6.8",
39
+ "@backstage/test-utils": "^0.2.0",
40
+ "@backstage/theme": "^0.2.14",
40
41
  "@material-ui/core": "^4.12.2",
41
42
  "@material-ui/icons": "^4.9.1",
42
43
  "@testing-library/jest-dom": "^5.10.1",
43
44
  "@testing-library/react": "^11.2.5",
44
45
  "@testing-library/user-event": "^13.1.8",
45
- "@types/react": "*",
46
- "react": "^16.12.0",
47
- "react-dom": "^16.12.0",
48
46
  "react-hot-loader": "^4.12.21",
49
47
  "react-router": "6.0.0-beta.0",
50
- "react-router-dom": "6.0.0-beta.0"
48
+ "react-router-dom": "6.0.0-beta.0",
49
+ "react-use": "^17.2.4",
50
+ "zen-observable": "^0.8.15"
51
+ },
52
+ "peerDependencies": {
53
+ "@types/react": "^16.13.1 || ^17.0.0",
54
+ "react": "^16.13.1 || ^17.0.0",
55
+ "react-dom": "^16.13.1 || ^17.0.0"
51
56
  },
52
57
  "devDependencies": {
53
- "@backstage/cli": "^0.7.14",
58
+ "@backstage/cli": "^0.10.3",
54
59
  "@types/jest": "^26.0.7",
55
60
  "@types/node": "^14.14.32"
56
61
  },
57
62
  "files": [
58
63
  "dist"
59
64
  ],
60
- "gitHead": "ca2905d9c6d1dd12c6d0cc64ec87f459175193a3"
65
+ "gitHead": "b315430f9dfcfa19ab0dd90f5b4ac6904938fba7"
61
66
  }