@backstage/plugin-app-react 0.2.1-next.1 → 0.2.2-next.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,23 @@
1
1
  # @backstage/plugin-app-react
2
2
 
3
+ ## 0.2.2-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/frontend-plugin-api@0.15.2-next.0
9
+ - @backstage/core-plugin-api@1.12.5-next.0
10
+
11
+ ## 0.2.1
12
+
13
+ ### Patch Changes
14
+
15
+ - 5f3f5d2: `NavContentBlueprint` nav item collections now keep previously collected `rest()` results in sync when additional items are taken later in the same render, making it easier to place items across multiple sidebar sections.
16
+ - 2c383b5: Added `AnalyticsImplementationBlueprint` and `AnalyticsImplementationFactory`, migrated from `@backstage/frontend-plugin-api`.
17
+ - Updated dependencies
18
+ - @backstage/core-plugin-api@1.12.4
19
+ - @backstage/frontend-plugin-api@0.15.0
20
+
3
21
  ## 0.2.1-next.1
4
22
 
5
23
  ### Patch Changes
@@ -1 +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;;;;"}
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 /**\n * Render all remaining items not yet taken, optionally sorted.\n *\n * The returned array is live and is updated when later `take` calls remove\n * items from the collection.\n */\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 /**\n * All items not yet taken.\n *\n * The returned array is live and is updated when later `take` calls remove\n * items from the collection.\n */\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":";;AA4HA,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;;;;"}
package/dist/index.d.ts CHANGED
@@ -104,7 +104,12 @@ interface NavContentNavItem {
104
104
  interface NavContentNavItemsWithComponent {
105
105
  /** Render and take a specific item by extension ID. Returns null if not found. */
106
106
  take(id: string): JSX.Element | null;
107
- /** Render all remaining items not yet taken, optionally sorted. */
107
+ /**
108
+ * Render all remaining items not yet taken, optionally sorted.
109
+ *
110
+ * The returned array is live and is updated when later `take` calls remove
111
+ * items from the collection.
112
+ */
108
113
  rest(options?: {
109
114
  sortBy?: 'title';
110
115
  }): JSX.Element[];
@@ -118,7 +123,12 @@ interface NavContentNavItemsWithComponent {
118
123
  interface NavContentNavItems {
119
124
  /** Take an item by extension ID, removing it from the collection. */
120
125
  take(id: string): NavContentNavItem | undefined;
121
- /** All items not yet taken. */
126
+ /**
127
+ * All items not yet taken.
128
+ *
129
+ * The returned array is live and is updated when later `take` calls remove
130
+ * items from the collection.
131
+ */
122
132
  rest(): NavContentNavItem[];
123
133
  /** Create a copy of the collection preserving the current taken state. */
124
134
  clone(): NavContentNavItems;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-app-react",
3
- "version": "0.2.1-next.1",
3
+ "version": "0.2.2-next.0",
4
4
  "description": "Web library for the app plugin",
5
5
  "backstage": {
6
6
  "role": "web-library",
@@ -39,14 +39,14 @@
39
39
  "test": "backstage-cli package test"
40
40
  },
41
41
  "dependencies": {
42
- "@backstage/core-plugin-api": "1.12.4-next.1",
43
- "@backstage/frontend-plugin-api": "0.15.0-next.1",
42
+ "@backstage/core-plugin-api": "1.12.5-next.0",
43
+ "@backstage/frontend-plugin-api": "0.15.2-next.0",
44
44
  "@material-ui/core": "^4.9.13"
45
45
  },
46
46
  "devDependencies": {
47
- "@backstage/cli": "0.36.0-next.2",
48
- "@backstage/frontend-test-utils": "0.5.1-next.2",
49
- "@backstage/test-utils": "1.7.16-next.0",
47
+ "@backstage/cli": "0.36.1-next.0",
48
+ "@backstage/frontend-test-utils": "0.5.2-next.0",
49
+ "@backstage/test-utils": "1.7.17-next.0",
50
50
  "@testing-library/jest-dom": "^6.0.0",
51
51
  "@testing-library/react": "^16.0.0",
52
52
  "@types/react": "^18.0.0",