@backstage/plugin-app-react 0.1.0 → 0.2.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,28 @@
1
1
  # @backstage/plugin-app-react
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a2133be: Added new `NavContentNavItem`, `NavContentNavItems`, and `navItems` prop to `NavContentComponentProps` for auto-discovering navigation items from page extensions. The new `navItems` collection supports `take(id)` and `rest()` methods for placing specific items in custom sidebar positions, as well as `withComponent(Component)` which returns a `NavContentNavItemsWithComponent` for rendering items directly as elements. The existing `items` prop is now deprecated in favor of `navItems`.
8
+
9
+ ### Patch Changes
10
+
11
+ - ef6916e: Added `IconElement` type as a replacement for the deprecated `IconComponent`. The `IconsApi` now has a new `icon()` method that returns `IconElement`, while the existing `getIcon()` method is deprecated. The `IconBundleBlueprint` now accepts both `IconComponent` and `IconElement` values.
12
+ - 409af72: Internal refactor to move implementation of blueprints from `@backstage/frontend-plugin-api` to this package.
13
+ - Updated dependencies
14
+ - @backstage/frontend-plugin-api@0.14.0
15
+ - @backstage/core-plugin-api@1.12.3
16
+
17
+ ## 0.1.1-next.0
18
+
19
+ ### Patch Changes
20
+
21
+ - 409af72: Internal refactor to move implementation of blueprints from `@backstage/frontend-plugin-api` to this package.
22
+ - Updated dependencies
23
+ - @backstage/frontend-plugin-api@0.14.0-next.0
24
+ - @backstage/core-plugin-api@1.12.2-next.0
25
+
3
26
  ## 0.1.0
4
27
 
5
28
  ### Minor Changes
@@ -0,0 +1,17 @@
1
+ import { createExtensionDataRef, createExtensionBlueprint } from '@backstage/frontend-plugin-api';
2
+
3
+ const componentDataRef = createExtensionDataRef().with({ id: "app.root.wrapper" });
4
+ const AppRootWrapperBlueprint = createExtensionBlueprint({
5
+ kind: "app-root-wrapper",
6
+ attachTo: { id: "app/root", input: "wrappers" },
7
+ output: [componentDataRef],
8
+ dataRefs: {
9
+ component: componentDataRef
10
+ },
11
+ *factory(params) {
12
+ yield componentDataRef(params.component);
13
+ }
14
+ });
15
+
16
+ export { AppRootWrapperBlueprint };
17
+ //# sourceMappingURL=AppRootWrapperBlueprint.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppRootWrapperBlueprint.esm.js","sources":["../../src/blueprints/AppRootWrapperBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ReactNode } from 'react';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n} from '@backstage/frontend-plugin-api';\n\nconst componentDataRef = createExtensionDataRef<\n (props: { children: ReactNode }) => JSX.Element | null\n>().with({ id: 'app.root.wrapper' });\n\n/**\n * Creates a extensions that render a React wrapper at the app root, enclosing\n * the app layout. This is useful for example for adding global React contexts\n * and similar. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const AppRootWrapperBlueprint = createExtensionBlueprint({\n kind: 'app-root-wrapper',\n attachTo: { id: 'app/root', input: 'wrappers' },\n output: [componentDataRef],\n dataRefs: {\n component: componentDataRef,\n },\n *factory(params: {\n /** @deprecated use the `component` parameter instead */\n Component?: [error: 'Use the `component` parameter instead'];\n component: (props: { children: ReactNode }) => JSX.Element | null;\n }) {\n yield componentDataRef(params.component);\n },\n});\n"],"names":[],"mappings":";;AAsBA,MAAM,mBAAmB,sBAAA,EAEvB,CAAE,KAAK,EAAE,EAAA,EAAI,oBAAoB,CAAA;AAS5B,MAAM,0BAA0B,wBAAA,CAAyB;AAAA,EAC9D,IAAA,EAAM,kBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,UAAA,EAAY,OAAO,UAAA,EAAW;AAAA,EAC9C,MAAA,EAAQ,CAAC,gBAAgB,CAAA;AAAA,EACzB,QAAA,EAAU;AAAA,IACR,SAAA,EAAW;AAAA,GACb;AAAA,EACA,CAAC,QAAQ,MAAA,EAIN;AACD,IAAA,MAAM,gBAAA,CAAiB,OAAO,SAAS,CAAA;AAAA,EACzC;AACF,CAAC;;;;"}
@@ -0,0 +1,15 @@
1
+ import { createExtensionDataRef, createExtensionBlueprint } from '@backstage/frontend-plugin-api';
2
+
3
+ const iconsDataRef = createExtensionDataRef().with({ id: "core.icons" });
4
+ const IconBundleBlueprint = createExtensionBlueprint({
5
+ kind: "icon-bundle",
6
+ attachTo: { id: "api:app/icons", input: "icons" },
7
+ output: [iconsDataRef],
8
+ factory: (params) => [iconsDataRef(params.icons)],
9
+ dataRefs: {
10
+ icons: iconsDataRef
11
+ }
12
+ });
13
+
14
+ export { IconBundleBlueprint };
15
+ //# sourceMappingURL=IconBundleBlueprint.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconBundleBlueprint.esm.js","sources":["../../src/blueprints/IconBundleBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { IconComponent, IconElement } from '@backstage/frontend-plugin-api';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n} from '@backstage/frontend-plugin-api';\n\nconst iconsDataRef = createExtensionDataRef<{\n [key in string]: IconComponent | IconElement;\n}>().with({ id: 'core.icons' });\n\n/**\n * Creates an extension that adds icon bundles to your app. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const IconBundleBlueprint = createExtensionBlueprint({\n kind: 'icon-bundle',\n attachTo: { id: 'api:app/icons', input: 'icons' },\n output: [iconsDataRef],\n factory: (params: {\n icons: { [key in string]: IconComponent | IconElement };\n }) => [iconsDataRef(params.icons)],\n dataRefs: {\n icons: iconsDataRef,\n },\n});\n"],"names":[],"mappings":";;AAsBA,MAAM,eAAe,sBAAA,EAElB,CAAE,KAAK,EAAE,EAAA,EAAI,cAAc,CAAA;AAOvB,MAAM,sBAAsB,wBAAA,CAAyB;AAAA,EAC1D,IAAA,EAAM,aAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,eAAA,EAAiB,OAAO,OAAA,EAAQ;AAAA,EAChD,MAAA,EAAQ,CAAC,YAAY,CAAA;AAAA,EACrB,SAAS,CAAC,MAAA,KAEJ,CAAC,YAAA,CAAa,MAAA,CAAO,KAAK,CAAC,CAAA;AAAA,EACjC,QAAA,EAAU;AAAA,IACR,KAAA,EAAO;AAAA;AAEX,CAAC;;;;"}
@@ -0,0 +1,19 @@
1
+ import { createExtensionDataRef, createExtensionBlueprint } from '@backstage/frontend-plugin-api';
2
+
3
+ const componentDataRef = createExtensionDataRef().with({
4
+ id: "core.nav-content.component"
5
+ });
6
+ const NavContentBlueprint = createExtensionBlueprint({
7
+ kind: "nav-content",
8
+ attachTo: { id: "app/nav", input: "content" },
9
+ output: [componentDataRef],
10
+ dataRefs: {
11
+ component: componentDataRef
12
+ },
13
+ *factory(params) {
14
+ yield componentDataRef(params.component);
15
+ }
16
+ });
17
+
18
+ export { NavContentBlueprint };
19
+ //# sourceMappingURL=NavContentBlueprint.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NavContentBlueprint.esm.js","sources":["../../src/blueprints/NavContentBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { ComponentType } from 'react';\nimport {\n AppNode,\n IconComponent,\n IconElement,\n RouteRef,\n} from '@backstage/frontend-plugin-api';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n} from '@backstage/frontend-plugin-api';\n\n/**\n * A navigation item auto-discovered from a page extension in the app.\n *\n * @public\n */\nexport interface NavContentNavItem {\n /** The app node of the page extension that this nav item points to */\n node: AppNode;\n /** The resolved route path */\n href: string;\n /** The display title */\n title: string;\n /** The display icon */\n icon: IconElement;\n /** The route ref of the source page */\n routeRef: RouteRef;\n}\n\n/**\n * A pre-bound renderer that wraps {@link NavContentNavItems} with a component,\n * so that `take` and `rest` return rendered elements directly.\n *\n * @public\n */\nexport interface NavContentNavItemsWithComponent {\n /** Render and take a specific item by extension ID. Returns null if not found. */\n take(id: string): JSX.Element | null;\n /** Render all remaining items not yet taken, optionally sorted. */\n rest(options?: { sortBy?: 'title' }): JSX.Element[];\n}\n\n/**\n * A collection of nav items that supports picking specific items by ID\n * and retrieving whatever remains. Created fresh for each render.\n *\n * @public\n */\nexport interface NavContentNavItems {\n /** Take an item by extension ID, removing it from the collection. */\n take(id: string): NavContentNavItem | undefined;\n /** All items not yet taken. */\n rest(): NavContentNavItem[];\n /** Create a copy of the collection preserving the current taken state. */\n clone(): NavContentNavItems;\n /** Create a renderer that wraps take/rest to return pre-rendered elements. */\n withComponent(\n Component: ComponentType<NavContentNavItem>,\n ): NavContentNavItemsWithComponent;\n}\n\n/**\n * The props for the {@link NavContentComponent}.\n *\n * @public\n */\nexport interface NavContentComponentProps {\n /**\n * Nav items auto-discovered from page extensions, with take/rest semantics\n * for placing specific items in specific positions.\n */\n navItems: NavContentNavItems;\n\n /**\n * Flat list of nav items for simple rendering. Use `navItems` for more\n * control over item placement.\n *\n * @deprecated Use `navItems` instead.\n */\n items: Array<{\n icon: IconComponent;\n title: string;\n routeRef: RouteRef<undefined>;\n to: string;\n text: string;\n }>;\n}\n\n/**\n * A component that renders the nav bar content, to be passed to the {@link NavContentBlueprint}.\n *\n * @public\n */\nexport type NavContentComponent = (\n props: NavContentComponentProps,\n) => JSX.Element | null;\n\nconst componentDataRef = createExtensionDataRef<NavContentComponent>().with({\n id: 'core.nav-content.component',\n});\n\n/**\n * Creates an extension that replaces the entire nav bar with your own component. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const NavContentBlueprint = createExtensionBlueprint({\n kind: 'nav-content',\n attachTo: { id: 'app/nav', input: 'content' },\n output: [componentDataRef],\n dataRefs: {\n component: componentDataRef,\n },\n *factory(params: { component: NavContentComponent }) {\n yield componentDataRef(params.component);\n },\n});\n"],"names":[],"mappings":";;AAkHA,MAAM,gBAAA,GAAmB,sBAAA,EAA4C,CAAE,IAAA,CAAK;AAAA,EAC1E,EAAA,EAAI;AACN,CAAC,CAAA;AAOM,MAAM,sBAAsB,wBAAA,CAAyB;AAAA,EAC1D,IAAA,EAAM,aAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,SAAA,EAAW,OAAO,SAAA,EAAU;AAAA,EAC5C,MAAA,EAAQ,CAAC,gBAAgB,CAAA;AAAA,EACzB,QAAA,EAAU;AAAA,IACR,SAAA,EAAW;AAAA,GACb;AAAA,EACA,CAAC,QAAQ,MAAA,EAA4C;AACnD,IAAA,MAAM,gBAAA,CAAiB,OAAO,SAAS,CAAA;AAAA,EACzC;AACF,CAAC;;;;"}
@@ -0,0 +1,17 @@
1
+ import { createExtensionDataRef, createExtensionBlueprint } from '@backstage/frontend-plugin-api';
2
+
3
+ const componentDataRef = createExtensionDataRef().with({ id: "app.router.wrapper" });
4
+ const RouterBlueprint = createExtensionBlueprint({
5
+ kind: "app-router-component",
6
+ attachTo: { id: "app/root", input: "router" },
7
+ output: [componentDataRef],
8
+ dataRefs: {
9
+ component: componentDataRef
10
+ },
11
+ *factory(params) {
12
+ yield componentDataRef(params.component);
13
+ }
14
+ });
15
+
16
+ export { RouterBlueprint };
17
+ //# sourceMappingURL=RouterBlueprint.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouterBlueprint.esm.js","sources":["../../src/blueprints/RouterBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ReactNode } from 'react';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n} from '@backstage/frontend-plugin-api';\n\nconst componentDataRef = createExtensionDataRef<\n (props: { children: ReactNode }) => JSX.Element | null\n>().with({ id: 'app.router.wrapper' });\n\n/**\n * Creates an extension that replaces the router component. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const RouterBlueprint = createExtensionBlueprint({\n kind: 'app-router-component',\n attachTo: { id: 'app/root', input: 'router' },\n output: [componentDataRef],\n dataRefs: {\n component: componentDataRef,\n },\n *factory(params: {\n /** @deprecated use the `component` parameter instead */\n Component?: [error: 'Use the `component` parameter instead'];\n component: (props: { children: ReactNode }) => JSX.Element | null;\n }) {\n yield componentDataRef(params.component);\n },\n});\n"],"names":[],"mappings":";;AAsBA,MAAM,mBAAmB,sBAAA,EAEvB,CAAE,KAAK,EAAE,EAAA,EAAI,sBAAsB,CAAA;AAO9B,MAAM,kBAAkB,wBAAA,CAAyB;AAAA,EACtD,IAAA,EAAM,sBAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,UAAA,EAAY,OAAO,QAAA,EAAS;AAAA,EAC5C,MAAA,EAAQ,CAAC,gBAAgB,CAAA;AAAA,EACzB,QAAA,EAAU;AAAA,IACR,SAAA,EAAW;AAAA,GACb;AAAA,EACA,CAAC,QAAQ,MAAA,EAIN;AACD,IAAA,MAAM,gBAAA,CAAiB,OAAO,SAAS,CAAA;AAAA,EACzC;AACF,CAAC;;;;"}
@@ -0,0 +1,24 @@
1
+ import { jsx } from 'react/jsx-runtime';
2
+ import { lazy } from 'react';
3
+ import { createExtensionDataRef, createExtensionBlueprint, ExtensionBoundary } from '@backstage/frontend-plugin-api';
4
+
5
+ const componentDataRef = createExtensionDataRef().with({ id: "core.sign-in-page.component" });
6
+ const SignInPageBlueprint = createExtensionBlueprint({
7
+ kind: "sign-in-page",
8
+ attachTo: { id: "app/root", input: "signInPage" },
9
+ output: [componentDataRef],
10
+ dataRefs: {
11
+ component: componentDataRef
12
+ },
13
+ *factory({
14
+ loader
15
+ }, { node }) {
16
+ const ExtensionComponent = lazy(
17
+ () => loader().then((component) => ({ default: component }))
18
+ );
19
+ yield componentDataRef((props) => /* @__PURE__ */ jsx(ExtensionBoundary, { node, children: /* @__PURE__ */ jsx(ExtensionComponent, { ...props }) }));
20
+ }
21
+ });
22
+
23
+ export { SignInPageBlueprint };
24
+ //# sourceMappingURL=SignInPageBlueprint.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignInPageBlueprint.esm.js","sources":["../../src/blueprints/SignInPageBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2026 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 { ComponentType, lazy, ReactNode } from 'react';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n ExtensionBoundary,\n IdentityApi,\n} from '@backstage/frontend-plugin-api';\n\n/**\n * Props for the `SignInPage` component.\n *\n * @public\n */\nexport type SignInPageProps = {\n /**\n * Set the IdentityApi on successful sign-in. This should only be called once.\n */\n onSignInSuccess(identityApi: IdentityApi): void;\n\n /**\n * The children to render.\n */\n children?: ReactNode;\n};\n\nconst componentDataRef = createExtensionDataRef<\n ComponentType<SignInPageProps>\n>().with({ id: 'core.sign-in-page.component' });\n\n/**\n * Creates an extension that replaces the sign in page. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const SignInPageBlueprint = createExtensionBlueprint({\n kind: 'sign-in-page',\n attachTo: { id: 'app/root', input: 'signInPage' },\n output: [componentDataRef],\n dataRefs: {\n component: componentDataRef,\n },\n *factory(\n {\n loader,\n }: {\n loader: () => Promise<ComponentType<SignInPageProps>>;\n },\n { node },\n ) {\n const ExtensionComponent = lazy(() =>\n loader().then(component => ({ default: component })),\n );\n\n yield componentDataRef(props => (\n <ExtensionBoundary node={node}>\n <ExtensionComponent {...props} />\n </ExtensionBoundary>\n ));\n },\n});\n"],"names":[],"mappings":";;;;AAyCA,MAAM,mBAAmB,sBAAA,EAEvB,CAAE,KAAK,EAAE,EAAA,EAAI,+BAA+B,CAAA;AAOvC,MAAM,sBAAsB,wBAAA,CAAyB;AAAA,EAC1D,IAAA,EAAM,cAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,UAAA,EAAY,OAAO,YAAA,EAAa;AAAA,EAChD,MAAA,EAAQ,CAAC,gBAAgB,CAAA;AAAA,EACzB,QAAA,EAAU;AAAA,IACR,SAAA,EAAW;AAAA,GACb;AAAA,EACA,CAAC,OAAA,CACC;AAAA,IACE;AAAA,GACF,EAGA,EAAE,IAAA,EAAK,EACP;AACA,IAAA,MAAM,kBAAA,GAAqB,IAAA;AAAA,MAAK,MAC9B,QAAO,CAAE,IAAA,CAAK,gBAAc,EAAE,OAAA,EAAS,WAAU,CAAE;AAAA,KACrD;AAEA,IAAA,MAAM,gBAAA,CAAiB,CAAA,KAAA,qBACrB,GAAA,CAAC,iBAAA,EAAA,EAAkB,IAAA,EACjB,8BAAC,kBAAA,EAAA,EAAoB,GAAG,KAAA,EAAO,CAAA,EACjC,CACD,CAAA;AAAA,EACH;AACF,CAAC;;;;"}
@@ -0,0 +1,23 @@
1
+ import { createExtensionDataRef, createExtensionBlueprint, createExtensionBlueprintParams } from '@backstage/frontend-plugin-api';
2
+
3
+ const componentDataRef = createExtensionDataRef().with({ id: "core.swappableComponent" });
4
+ const SwappableComponentBlueprint = createExtensionBlueprint({
5
+ kind: "component",
6
+ attachTo: { id: "api:app/swappable-components", input: "components" },
7
+ output: [componentDataRef],
8
+ dataRefs: {
9
+ component: componentDataRef
10
+ },
11
+ defineParams(params) {
12
+ return createExtensionBlueprintParams(params);
13
+ },
14
+ factory: (params) => [
15
+ componentDataRef({
16
+ ref: params.component.ref,
17
+ loader: params.loader
18
+ })
19
+ ]
20
+ });
21
+
22
+ export { SwappableComponentBlueprint, componentDataRef };
23
+ //# sourceMappingURL=SwappableComponentBlueprint.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwappableComponentBlueprint.esm.js","sources":["../../src/blueprints/SwappableComponentBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { SwappableComponentRef } from '@backstage/frontend-plugin-api';\nimport {\n createExtensionBlueprint,\n createExtensionBlueprintParams,\n createExtensionDataRef,\n} from '@backstage/frontend-plugin-api';\n\nexport const componentDataRef = createExtensionDataRef<{\n ref: SwappableComponentRef;\n loader:\n | (() => (props: {}) => JSX.Element | null)\n | (() => Promise<(props: {}) => JSX.Element | null>);\n}>().with({ id: 'core.swappableComponent' });\n\n/**\n * Blueprint for creating swappable components from a SwappableComponentRef and a loader. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const SwappableComponentBlueprint = createExtensionBlueprint({\n kind: 'component',\n attachTo: { id: 'api:app/swappable-components', input: 'components' },\n output: [componentDataRef],\n dataRefs: {\n component: componentDataRef,\n },\n defineParams<Ref extends SwappableComponentRef<any>>(params: {\n component: Ref extends SwappableComponentRef<\n any,\n infer IExternalComponentProps\n >\n ? { ref: Ref } & ((props: IExternalComponentProps) => JSX.Element | null)\n : never;\n loader: Ref extends SwappableComponentRef<infer IInnerComponentProps, any>\n ?\n | (() => (props: IInnerComponentProps) => JSX.Element | null)\n | (() => Promise<(props: IInnerComponentProps) => JSX.Element | null>)\n : never;\n }) {\n return createExtensionBlueprintParams(params);\n },\n factory: params => [\n componentDataRef({\n ref: params.component.ref,\n loader: params.loader,\n }),\n ],\n});\n"],"names":[],"mappings":";;AAuBO,MAAM,mBAAmB,sBAAA,EAK7B,CAAE,KAAK,EAAE,EAAA,EAAI,2BAA2B;AAOpC,MAAM,8BAA8B,wBAAA,CAAyB;AAAA,EAClE,IAAA,EAAM,WAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,8BAAA,EAAgC,OAAO,YAAA,EAAa;AAAA,EACpE,MAAA,EAAQ,CAAC,gBAAgB,CAAA;AAAA,EACzB,QAAA,EAAU;AAAA,IACR,SAAA,EAAW;AAAA,GACb;AAAA,EACA,aAAqD,MAAA,EAYlD;AACD,IAAA,OAAO,+BAA+B,MAAM,CAAA;AAAA,EAC9C,CAAA;AAAA,EACA,SAAS,CAAA,MAAA,KAAU;AAAA,IACjB,gBAAA,CAAiB;AAAA,MACf,GAAA,EAAK,OAAO,SAAA,CAAU,GAAA;AAAA,MACtB,QAAQ,MAAA,CAAO;AAAA,KAChB;AAAA;AAEL,CAAC;;;;"}
@@ -0,0 +1,17 @@
1
+ import { createExtensionDataRef, createExtensionBlueprint } from '@backstage/frontend-plugin-api';
2
+
3
+ const themeDataRef = createExtensionDataRef().with({
4
+ id: "core.theme.theme"
5
+ });
6
+ const ThemeBlueprint = createExtensionBlueprint({
7
+ kind: "theme",
8
+ attachTo: { id: "api:app/app-theme", input: "themes" },
9
+ output: [themeDataRef],
10
+ dataRefs: {
11
+ theme: themeDataRef
12
+ },
13
+ factory: ({ theme }) => [themeDataRef(theme)]
14
+ });
15
+
16
+ export { ThemeBlueprint };
17
+ //# sourceMappingURL=ThemeBlueprint.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeBlueprint.esm.js","sources":["../../src/blueprints/ThemeBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { AppTheme } from '@backstage/frontend-plugin-api';\nimport {\n createExtensionBlueprint,\n createExtensionDataRef,\n} from '@backstage/frontend-plugin-api';\n\nconst themeDataRef = createExtensionDataRef<AppTheme>().with({\n id: 'core.theme.theme',\n});\n\n/**\n * Creates an extension that adds/replaces an app theme. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const ThemeBlueprint = createExtensionBlueprint({\n kind: 'theme',\n attachTo: { id: 'api:app/app-theme', input: 'themes' },\n output: [themeDataRef],\n dataRefs: {\n theme: themeDataRef,\n },\n factory: ({ theme }: { theme: AppTheme }) => [themeDataRef(theme)],\n});\n"],"names":[],"mappings":";;AAsBA,MAAM,YAAA,GAAe,sBAAA,EAAiC,CAAE,IAAA,CAAK;AAAA,EAC3D,EAAA,EAAI;AACN,CAAC,CAAA;AAOM,MAAM,iBAAiB,wBAAA,CAAyB;AAAA,EACrD,IAAA,EAAM,OAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,mBAAA,EAAqB,OAAO,QAAA,EAAS;AAAA,EACrD,MAAA,EAAQ,CAAC,YAAY,CAAA;AAAA,EACrB,QAAA,EAAU;AAAA,IACR,KAAA,EAAO;AAAA,GACT;AAAA,EACA,OAAA,EAAS,CAAC,EAAE,KAAA,OAAiC,CAAC,YAAA,CAAa,KAAK,CAAC;AACnE,CAAC;;;;"}
@@ -0,0 +1,17 @@
1
+ import { createExtensionDataRef, createExtensionBlueprint } from '@backstage/frontend-plugin-api';
2
+
3
+ const translationDataRef = createExtensionDataRef().with({ id: "core.translation.translation" });
4
+ const TranslationBlueprint = createExtensionBlueprint({
5
+ kind: "translation",
6
+ attachTo: { id: "api:app/translations", input: "translations" },
7
+ output: [translationDataRef],
8
+ dataRefs: {
9
+ translation: translationDataRef
10
+ },
11
+ factory: ({
12
+ resource
13
+ }) => [translationDataRef(resource)]
14
+ });
15
+
16
+ export { TranslationBlueprint };
17
+ //# sourceMappingURL=TranslationBlueprint.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TranslationBlueprint.esm.js","sources":["../../src/blueprints/TranslationBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2026 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 createExtensionBlueprint,\n createExtensionDataRef,\n TranslationMessages,\n TranslationResource,\n} from '@backstage/frontend-plugin-api';\n\nconst translationDataRef = createExtensionDataRef<\n TranslationResource | TranslationMessages\n>().with({ id: 'core.translation.translation' });\n\n/**\n * Creates an extension that adds translations to your app. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const TranslationBlueprint = createExtensionBlueprint({\n kind: 'translation',\n attachTo: { id: 'api:app/translations', input: 'translations' },\n output: [translationDataRef],\n dataRefs: {\n translation: translationDataRef,\n },\n factory: ({\n resource,\n }: {\n resource: TranslationResource | TranslationMessages;\n }) => [translationDataRef(resource)],\n});\n"],"names":[],"mappings":";;AAuBA,MAAM,qBAAqB,sBAAA,EAEzB,CAAE,KAAK,EAAE,EAAA,EAAI,gCAAgC,CAAA;AAOxC,MAAM,uBAAuB,wBAAA,CAAyB;AAAA,EAC3D,IAAA,EAAM,aAAA;AAAA,EACN,QAAA,EAAU,EAAE,EAAA,EAAI,sBAAA,EAAwB,OAAO,cAAA,EAAe;AAAA,EAC9D,MAAA,EAAQ,CAAC,kBAAkB,CAAA;AAAA,EAC3B,QAAA,EAAU;AAAA,IACR,WAAA,EAAa;AAAA,GACf;AAAA,EACA,SAAS,CAAC;AAAA,IACR;AAAA,GACF,KAEM,CAAC,kBAAA,CAAmB,QAAQ,CAAC;AACrC,CAAC;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,110 +1,156 @@
1
1
  import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
2
- import { SignInPageProps, NavContentComponent } from '@backstage/frontend-plugin-api';
3
- export { NavContentComponent, NavContentComponentProps, SignInPageProps } from '@backstage/frontend-plugin-api';
4
- import * as react from 'react';
2
+ import { IconComponent, IconElement, AppNode, RouteRef, IdentityApi, SwappableComponentRef, AppTheme, TranslationResource, TranslationMessages } from '@backstage/frontend-plugin-api';
3
+ import { ReactNode, ComponentType } from 'react';
5
4
 
6
5
  /**
7
- * Creates an extension that renders a React wrapper at the app root, enclosing
8
- * the app layout. This blueprint is limited to use by the app plugin.
6
+ * Creates a extensions that render a React wrapper at the app root, enclosing
7
+ * the app layout. This is useful for example for adding global React contexts
8
+ * and similar. This blueprint is limited to use by the app plugin.
9
9
  *
10
10
  * @public
11
11
  */
12
12
  declare const AppRootWrapperBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
13
13
  kind: "app-root-wrapper";
14
14
  params: {
15
+ /** @deprecated use the `component` parameter instead */
15
16
  Component?: [error: "Use the `component` parameter instead"];
16
17
  component: (props: {
17
- children: react.ReactNode;
18
+ children: ReactNode;
18
19
  }) => JSX.Element | null;
19
20
  };
20
21
  output: _backstage_frontend_plugin_api.ExtensionDataRef<(props: {
21
- children: react.ReactNode;
22
+ children: ReactNode;
22
23
  }) => JSX.Element | null, "app.root.wrapper", {}>;
23
24
  inputs: {};
24
25
  config: {};
25
26
  configInput: {};
26
27
  dataRefs: {
27
28
  component: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(props: {
28
- children: react.ReactNode;
29
+ children: ReactNode;
29
30
  }) => JSX.Element | null, "app.root.wrapper", {}>;
30
31
  };
31
32
  }>;
33
+
32
34
  /**
33
- * Creates an extension that adds/replaces an app theme. This blueprint is limited to use by the app plugin.
35
+ * Creates an extension that adds icon bundles to your app. This blueprint is limited to use by the app plugin.
34
36
  *
35
37
  * @public
36
38
  */
37
- declare const ThemeBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
38
- kind: "theme";
39
+ declare const IconBundleBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
40
+ kind: "icon-bundle";
39
41
  params: {
40
- theme: _backstage_frontend_plugin_api.AppTheme;
42
+ icons: { [key in string]: IconComponent | IconElement; };
41
43
  };
42
- output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.AppTheme, "core.theme.theme", {}>;
44
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<{
45
+ [x: string]: IconComponent | IconElement;
46
+ }, "core.icons", {}>;
43
47
  inputs: {};
44
48
  config: {};
45
49
  configInput: {};
46
50
  dataRefs: {
47
- theme: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.AppTheme, "core.theme.theme", {}>;
51
+ icons: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<{
52
+ [x: string]: IconComponent | IconElement;
53
+ }, "core.icons", {}>;
48
54
  };
49
55
  }>;
56
+
50
57
  /**
51
- * Blueprint for creating swappable components from a SwappableComponentRef and a loader. This blueprint is limited to use by the app plugin.
58
+ * A navigation item auto-discovered from a page extension in the app.
52
59
  *
53
60
  * @public
54
61
  */
55
- declare const SwappableComponentBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
56
- kind: "component";
57
- params: <Ref extends _backstage_frontend_plugin_api.SwappableComponentRef<any>>(params: {
58
- component: Ref extends _backstage_frontend_plugin_api.SwappableComponentRef<any, infer IExternalComponentProps> ? {
59
- ref: Ref;
60
- } & ((props: IExternalComponentProps) => JSX.Element | null) : never;
61
- loader: Ref extends _backstage_frontend_plugin_api.SwappableComponentRef<infer IInnerComponentProps, any> ? (() => (props: IInnerComponentProps) => JSX.Element | null) | (() => Promise<(props: IInnerComponentProps) => JSX.Element /**
62
- * Creates an extension that replaces the router component. This blueprint is limited to use by the app plugin.
63
- *
64
- * @public
65
- */ | null>) : never;
66
- }) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<{
67
- component: Ref extends _backstage_frontend_plugin_api.SwappableComponentRef<any, infer IExternalComponentProps> ? {
68
- ref: Ref;
69
- } & ((props: IExternalComponentProps) => JSX.Element | null) : never;
70
- loader: Ref extends _backstage_frontend_plugin_api.SwappableComponentRef<infer IInnerComponentProps, any> ? (() => (props: IInnerComponentProps) => JSX.Element | null) | (() => Promise<(props: IInnerComponentProps) => JSX.Element /**
71
- * Creates an extension that replaces the router component. This blueprint is limited to use by the app plugin.
72
- *
73
- * @public
74
- */ | null>) : never;
62
+ interface NavContentNavItem {
63
+ /** The app node of the page extension that this nav item points to */
64
+ node: AppNode;
65
+ /** The resolved route path */
66
+ href: string;
67
+ /** The display title */
68
+ title: string;
69
+ /** The display icon */
70
+ icon: IconElement;
71
+ /** The route ref of the source page */
72
+ routeRef: RouteRef;
73
+ }
74
+ /**
75
+ * A pre-bound renderer that wraps {@link NavContentNavItems} with a component,
76
+ * so that `take` and `rest` return rendered elements directly.
77
+ *
78
+ * @public
79
+ */
80
+ interface NavContentNavItemsWithComponent {
81
+ /** Render and take a specific item by extension ID. Returns null if not found. */
82
+ take(id: string): JSX.Element | null;
83
+ /** Render all remaining items not yet taken, optionally sorted. */
84
+ rest(options?: {
85
+ sortBy?: 'title';
86
+ }): JSX.Element[];
87
+ }
88
+ /**
89
+ * A collection of nav items that supports picking specific items by ID
90
+ * and retrieving whatever remains. Created fresh for each render.
91
+ *
92
+ * @public
93
+ */
94
+ interface NavContentNavItems {
95
+ /** Take an item by extension ID, removing it from the collection. */
96
+ take(id: string): NavContentNavItem | undefined;
97
+ /** All items not yet taken. */
98
+ rest(): NavContentNavItem[];
99
+ /** Create a copy of the collection preserving the current taken state. */
100
+ clone(): NavContentNavItems;
101
+ /** Create a renderer that wraps take/rest to return pre-rendered elements. */
102
+ withComponent(Component: ComponentType<NavContentNavItem>): NavContentNavItemsWithComponent;
103
+ }
104
+ /**
105
+ * The props for the {@link NavContentComponent}.
106
+ *
107
+ * @public
108
+ */
109
+ interface NavContentComponentProps {
110
+ /**
111
+ * Nav items auto-discovered from page extensions, with take/rest semantics
112
+ * for placing specific items in specific positions.
113
+ */
114
+ navItems: NavContentNavItems;
115
+ /**
116
+ * Flat list of nav items for simple rendering. Use `navItems` for more
117
+ * control over item placement.
118
+ *
119
+ * @deprecated Use `navItems` instead.
120
+ */
121
+ items: Array<{
122
+ icon: IconComponent;
123
+ title: string;
124
+ routeRef: RouteRef<undefined>;
125
+ to: string;
126
+ text: string;
75
127
  }>;
76
- output: _backstage_frontend_plugin_api.ExtensionDataRef<{
77
- ref: _backstage_frontend_plugin_api.SwappableComponentRef;
78
- loader: (() => (props: {}) => JSX.Element | null) | (() => Promise<(props: {}) => JSX.Element | null>);
79
- }, "core.swappableComponent", {}>;
80
- inputs: {};
81
- config: {};
82
- configInput: {};
83
- dataRefs: {
84
- component: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<{
85
- ref: _backstage_frontend_plugin_api.SwappableComponentRef;
86
- loader: (() => (props: {}) => JSX.Element | null) | (() => Promise<(props: {}) => JSX.Element | null>);
87
- }, "core.swappableComponent", {}>;
88
- };
89
- }>;
128
+ }
90
129
  /**
91
- * Creates an extension that replaces the sign in page. This blueprint is limited to use by the app plugin.
130
+ * A component that renders the nav bar content, to be passed to the {@link NavContentBlueprint}.
92
131
  *
93
132
  * @public
94
133
  */
95
- declare const SignInPageBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
96
- kind: "sign-in-page";
134
+ type NavContentComponent = (props: NavContentComponentProps) => JSX.Element | null;
135
+ /**
136
+ * Creates an extension that replaces the entire nav bar with your own component. This blueprint is limited to use by the app plugin.
137
+ *
138
+ * @public
139
+ */
140
+ declare const NavContentBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
141
+ kind: "nav-content";
97
142
  params: {
98
- loader: () => Promise<react.ComponentType<SignInPageProps>>;
143
+ component: NavContentComponent;
99
144
  };
100
- output: _backstage_frontend_plugin_api.ExtensionDataRef<react.ComponentType<SignInPageProps>, "core.sign-in-page.component", {}>;
145
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<NavContentComponent, "core.nav-content.component", {}>;
101
146
  inputs: {};
102
147
  config: {};
103
148
  configInput: {};
104
149
  dataRefs: {
105
- component: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<react.ComponentType<SignInPageProps>, "core.sign-in-page.component", {}>;
150
+ component: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<NavContentComponent, "core.nav-content.component", {}>;
106
151
  };
107
152
  }>;
153
+
108
154
  /**
109
155
  * Creates an extension that replaces the router component. This blueprint is limited to use by the app plugin.
110
156
  *
@@ -113,61 +159,108 @@ declare const SignInPageBlueprint: _backstage_frontend_plugin_api.ExtensionBluep
113
159
  declare const RouterBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
114
160
  kind: "app-router-component";
115
161
  params: {
162
+ /** @deprecated use the `component` parameter instead */
116
163
  Component?: [error: "Use the `component` parameter instead"];
117
164
  component: (props: {
118
- children: react.ReactNode;
165
+ children: ReactNode;
119
166
  }) => JSX.Element | null;
120
167
  };
121
168
  output: _backstage_frontend_plugin_api.ExtensionDataRef<(props: {
122
- children: react.ReactNode;
169
+ children: ReactNode;
123
170
  }) => JSX.Element | null, "app.router.wrapper", {}>;
124
171
  inputs: {};
125
172
  config: {};
126
173
  configInput: {};
127
174
  dataRefs: {
128
175
  component: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<(props: {
129
- children: react.ReactNode;
176
+ children: ReactNode;
130
177
  }) => JSX.Element | null, "app.router.wrapper", {}>;
131
178
  };
132
179
  }>;
180
+
133
181
  /**
134
- * Creates an extension that replaces the entire nav bar with your own component. This blueprint is limited to use by the app plugin.
182
+ * Props for the `SignInPage` component.
135
183
  *
136
184
  * @public
137
185
  */
138
- declare const NavContentBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
139
- kind: "nav-content";
186
+ type SignInPageProps = {
187
+ /**
188
+ * Set the IdentityApi on successful sign-in. This should only be called once.
189
+ */
190
+ onSignInSuccess(identityApi: IdentityApi): void;
191
+ /**
192
+ * The children to render.
193
+ */
194
+ children?: ReactNode;
195
+ };
196
+ /**
197
+ * Creates an extension that replaces the sign in page. This blueprint is limited to use by the app plugin.
198
+ *
199
+ * @public
200
+ */
201
+ declare const SignInPageBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
202
+ kind: "sign-in-page";
140
203
  params: {
141
- component: NavContentComponent;
204
+ loader: () => Promise<ComponentType<SignInPageProps>>;
142
205
  };
143
- output: _backstage_frontend_plugin_api.ExtensionDataRef<NavContentComponent, "core.nav-content.component", {}>;
206
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<ComponentType<SignInPageProps>, "core.sign-in-page.component", {}>;
144
207
  inputs: {};
145
208
  config: {};
146
209
  configInput: {};
147
210
  dataRefs: {
148
- component: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<NavContentComponent, "core.nav-content.component", {}>;
211
+ component: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<ComponentType<SignInPageProps>, "core.sign-in-page.component", {}>;
149
212
  };
150
213
  }>;
214
+
151
215
  /**
152
- * Creates an extension that adds icon bundles to your app. This blueprint is limited to use by the app plugin.
216
+ * Blueprint for creating swappable components from a SwappableComponentRef and a loader. This blueprint is limited to use by the app plugin.
153
217
  *
154
218
  * @public
155
219
  */
156
- declare const IconBundleBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
157
- kind: "icon-bundle";
220
+ declare const SwappableComponentBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
221
+ kind: "component";
222
+ params: <Ref extends SwappableComponentRef<any>>(params: {
223
+ component: Ref extends SwappableComponentRef<any, infer IExternalComponentProps> ? {
224
+ ref: Ref;
225
+ } & ((props: IExternalComponentProps) => JSX.Element | null) : never;
226
+ loader: Ref extends SwappableComponentRef<infer IInnerComponentProps, any> ? (() => (props: IInnerComponentProps) => JSX.Element | null) | (() => Promise<(props: IInnerComponentProps) => JSX.Element | null>) : never;
227
+ }) => _backstage_frontend_plugin_api.ExtensionBlueprintParams<{
228
+ component: Ref extends SwappableComponentRef<any, infer IExternalComponentProps> ? {
229
+ ref: Ref;
230
+ } & ((props: IExternalComponentProps) => JSX.Element | null) : never;
231
+ loader: Ref extends SwappableComponentRef<infer IInnerComponentProps, any> ? (() => (props: IInnerComponentProps) => JSX.Element | null) | (() => Promise<(props: IInnerComponentProps) => JSX.Element | null>) : never;
232
+ }>;
233
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<{
234
+ ref: SwappableComponentRef;
235
+ loader: (() => (props: {}) => JSX.Element | null) | (() => Promise<(props: {}) => JSX.Element | null>);
236
+ }, "core.swappableComponent", {}>;
237
+ inputs: {};
238
+ config: {};
239
+ configInput: {};
240
+ dataRefs: {
241
+ component: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<{
242
+ ref: SwappableComponentRef;
243
+ loader: (() => (props: {}) => JSX.Element | null) | (() => Promise<(props: {}) => JSX.Element | null>);
244
+ }, "core.swappableComponent", {}>;
245
+ };
246
+ }>;
247
+
248
+ /**
249
+ * Creates an extension that adds/replaces an app theme. This blueprint is limited to use by the app plugin.
250
+ *
251
+ * @public
252
+ */
253
+ declare const ThemeBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
254
+ kind: "theme";
158
255
  params: {
159
- icons: { [key in string]: _backstage_frontend_plugin_api.IconComponent; };
256
+ theme: AppTheme;
160
257
  };
161
- output: _backstage_frontend_plugin_api.ExtensionDataRef<{
162
- [x: string]: _backstage_frontend_plugin_api.IconComponent;
163
- }, "core.icons", {}>;
258
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<AppTheme, "core.theme.theme", {}>;
164
259
  inputs: {};
165
260
  config: {};
166
261
  configInput: {};
167
262
  dataRefs: {
168
- icons: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<{
169
- [x: string]: _backstage_frontend_plugin_api.IconComponent;
170
- }, "core.icons", {}>;
263
+ theme: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<AppTheme, "core.theme.theme", {}>;
171
264
  };
172
265
  }>;
173
266
 
@@ -179,19 +272,20 @@ declare const IconBundleBlueprint: _backstage_frontend_plugin_api.ExtensionBluep
179
272
  declare const TranslationBlueprint: _backstage_frontend_plugin_api.ExtensionBlueprint<{
180
273
  kind: "translation";
181
274
  params: {
182
- resource: _backstage_frontend_plugin_api.TranslationResource | _backstage_frontend_plugin_api.TranslationMessages;
275
+ resource: TranslationResource | TranslationMessages;
183
276
  };
184
- output: _backstage_frontend_plugin_api.ExtensionDataRef<_backstage_frontend_plugin_api.TranslationResource<string> | _backstage_frontend_plugin_api.TranslationMessages<string, {
277
+ output: _backstage_frontend_plugin_api.ExtensionDataRef<TranslationResource<string> | TranslationMessages<string, {
185
278
  [x: string]: string;
186
279
  }, boolean>, "core.translation.translation", {}>;
187
280
  inputs: {};
188
281
  config: {};
189
282
  configInput: {};
190
283
  dataRefs: {
191
- translation: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<_backstage_frontend_plugin_api.TranslationResource<string> | _backstage_frontend_plugin_api.TranslationMessages<string, {
284
+ translation: _backstage_frontend_plugin_api.ConfigurableExtensionDataRef<TranslationResource<string> | TranslationMessages<string, {
192
285
  [x: string]: string;
193
286
  }, boolean>, "core.translation.translation", {}>;
194
287
  };
195
288
  }>;
196
289
 
197
290
  export { AppRootWrapperBlueprint, IconBundleBlueprint, NavContentBlueprint, RouterBlueprint, SignInPageBlueprint, SwappableComponentBlueprint, ThemeBlueprint, TranslationBlueprint };
291
+ export type { NavContentComponent, NavContentComponentProps, NavContentNavItem, NavContentNavItems, NavContentNavItemsWithComponent, SignInPageProps };
package/dist/index.esm.js CHANGED
@@ -1,2 +1,9 @@
1
- export { AppRootWrapperBlueprint, IconBundleBlueprint, NavContentBlueprint, RouterBlueprint, SignInPageBlueprint, SwappableComponentBlueprint, ThemeBlueprint, TranslationBlueprint } from './blueprints/index.esm.js';
1
+ export { AppRootWrapperBlueprint } from './blueprints/AppRootWrapperBlueprint.esm.js';
2
+ export { IconBundleBlueprint } from './blueprints/IconBundleBlueprint.esm.js';
3
+ export { NavContentBlueprint } from './blueprints/NavContentBlueprint.esm.js';
4
+ export { RouterBlueprint } from './blueprints/RouterBlueprint.esm.js';
5
+ export { SignInPageBlueprint } from './blueprints/SignInPageBlueprint.esm.js';
6
+ export { SwappableComponentBlueprint } from './blueprints/SwappableComponentBlueprint.esm.js';
7
+ export { ThemeBlueprint } from './blueprints/ThemeBlueprint.esm.js';
8
+ export { TranslationBlueprint } from './blueprints/TranslationBlueprint.esm.js';
2
9
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-app-react",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Web library for the app plugin",
5
5
  "backstage": {
6
6
  "role": "web-library",
@@ -39,26 +39,26 @@
39
39
  "test": "backstage-cli package test"
40
40
  },
41
41
  "dependencies": {
42
- "@backstage/core-plugin-api": "^1.12.1",
43
- "@backstage/frontend-plugin-api": "^0.13.3",
42
+ "@backstage/core-plugin-api": "^1.12.3",
43
+ "@backstage/frontend-plugin-api": "^0.14.0",
44
44
  "@material-ui/core": "^4.9.13"
45
45
  },
46
46
  "devDependencies": {
47
- "@backstage/cli": "^0.35.2",
48
- "@backstage/frontend-test-utils": "^0.4.3",
49
- "@backstage/test-utils": "^1.7.14",
47
+ "@backstage/cli": "^0.35.4",
48
+ "@backstage/frontend-test-utils": "^0.5.0",
49
+ "@backstage/test-utils": "^1.7.15",
50
50
  "@testing-library/jest-dom": "^6.0.0",
51
51
  "@testing-library/react": "^16.0.0",
52
52
  "@types/react": "^18.0.0",
53
53
  "react": "^18.0.2",
54
54
  "react-dom": "^18.0.2",
55
- "react-router-dom": "^6.3.0"
55
+ "react-router-dom": "^6.30.2"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "@types/react": "^17.0.0 || ^18.0.0",
59
59
  "react": "^17.0.0 || ^18.0.0",
60
60
  "react-dom": "^17.0.0 || ^18.0.0",
61
- "react-router-dom": "^6.3.0"
61
+ "react-router-dom": "^6.30.2"
62
62
  },
63
63
  "peerDependenciesMeta": {
64
64
  "@types/react": {
@@ -1,13 +0,0 @@
1
- import { AppRootWrapperBlueprint as AppRootWrapperBlueprint$1, ThemeBlueprint as ThemeBlueprint$1, SwappableComponentBlueprint as SwappableComponentBlueprint$1, SignInPageBlueprint as SignInPageBlueprint$1, RouterBlueprint as RouterBlueprint$1, NavContentBlueprint as NavContentBlueprint$1, IconBundleBlueprint as IconBundleBlueprint$1, TranslationBlueprint as TranslationBlueprint$1 } from '@backstage/frontend-plugin-api';
2
-
3
- const AppRootWrapperBlueprint = AppRootWrapperBlueprint$1;
4
- const ThemeBlueprint = ThemeBlueprint$1;
5
- const SwappableComponentBlueprint = SwappableComponentBlueprint$1;
6
- const SignInPageBlueprint = SignInPageBlueprint$1;
7
- const RouterBlueprint = RouterBlueprint$1;
8
- const NavContentBlueprint = NavContentBlueprint$1;
9
- const IconBundleBlueprint = IconBundleBlueprint$1;
10
- const TranslationBlueprint = TranslationBlueprint$1;
11
-
12
- export { AppRootWrapperBlueprint, IconBundleBlueprint, NavContentBlueprint, RouterBlueprint, SignInPageBlueprint, SwappableComponentBlueprint, ThemeBlueprint, TranslationBlueprint };
13
- //# sourceMappingURL=index.esm.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../src/blueprints/index.ts"],"sourcesContent":["/*\n * Copyright 2026 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 AppRootWrapperBlueprint as _AppRootWrapperBlueprint,\n IconBundleBlueprint as _IconBundleBlueprint,\n NavContentBlueprint as _NavContentBlueprint,\n type NavContentComponent,\n type NavContentComponentProps,\n RouterBlueprint as _RouterBlueprint,\n SignInPageBlueprint as _SignInPageBlueprint,\n type SignInPageProps,\n SwappableComponentBlueprint as _SwappableComponentBlueprint,\n ThemeBlueprint as _ThemeBlueprint,\n TranslationBlueprint as _TranslationBlueprint,\n} from '@backstage/frontend-plugin-api';\n\n/**\n * Creates an extension that renders a React wrapper at the app root, enclosing\n * the app layout. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const AppRootWrapperBlueprint = _AppRootWrapperBlueprint;\n\n/**\n * Creates an extension that adds/replaces an app theme. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const ThemeBlueprint = _ThemeBlueprint;\n\n/**\n * Blueprint for creating swappable components from a SwappableComponentRef and a loader. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const SwappableComponentBlueprint = _SwappableComponentBlueprint;\n\n/**\n * Creates an extension that replaces the sign in page. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const SignInPageBlueprint = _SignInPageBlueprint;\n\n/**\n * Creates an extension that replaces the router component. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const RouterBlueprint = _RouterBlueprint;\n\n/**\n * Creates an extension that replaces the entire nav bar with your own component. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const NavContentBlueprint = _NavContentBlueprint;\n\n/**\n * Creates an extension that adds icon bundles to your app. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const IconBundleBlueprint = _IconBundleBlueprint;\n\n/**\n * Props for the `SignInPage` component.\n *\n * @public\n */\nexport type { SignInPageProps };\n\n/**\n * The props for the {@link NavContentComponent}.\n *\n * @public\n */\nexport type { NavContentComponentProps };\n\n/**\n * A component that renders the nav bar content, to be passed to the {@link NavContentBlueprint}.\n *\n * @public\n */\nexport type { NavContentComponent };\n\n/**\n * Creates an extension that adds translations to your app. This blueprint is limited to use by the app plugin.\n *\n * @public\n */\nexport const TranslationBlueprint = _TranslationBlueprint;\n"],"names":["_AppRootWrapperBlueprint","_ThemeBlueprint","_SwappableComponentBlueprint","_SignInPageBlueprint","_RouterBlueprint","_NavContentBlueprint","_IconBundleBlueprint","_TranslationBlueprint"],"mappings":";;AAoCO,MAAM,uBAAA,GAA0BA;AAOhC,MAAM,cAAA,GAAiBC;AAOvB,MAAM,2BAAA,GAA8BC;AAOpC,MAAM,mBAAA,GAAsBC;AAO5B,MAAM,eAAA,GAAkBC;AAOxB,MAAM,mBAAA,GAAsBC;AAO5B,MAAM,mBAAA,GAAsBC;AA4B5B,MAAM,oBAAA,GAAuBC;;;;"}