@backstage/frontend-plugin-api 0.7.0-next.3 → 0.8.0-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.
Files changed (63) hide show
  1. package/CHANGELOG.md +245 -0
  2. package/dist/blueprints/ApiBlueprint.esm.js +8 -5
  3. package/dist/blueprints/ApiBlueprint.esm.js.map +1 -1
  4. package/dist/blueprints/AppRootElementBlueprint.esm.js.map +1 -1
  5. package/dist/blueprints/AppRootWrapperBlueprint.esm.js +5 -4
  6. package/dist/blueprints/AppRootWrapperBlueprint.esm.js.map +1 -1
  7. package/dist/blueprints/IconBundleBlueprint.esm.js +1 -1
  8. package/dist/blueprints/IconBundleBlueprint.esm.js.map +1 -1
  9. package/dist/blueprints/NavItemBlueprint.esm.js +5 -4
  10. package/dist/blueprints/NavItemBlueprint.esm.js.map +1 -1
  11. package/dist/blueprints/NavLogoBlueprint.esm.js +5 -4
  12. package/dist/blueprints/NavLogoBlueprint.esm.js.map +1 -1
  13. package/dist/blueprints/PageBlueprint.esm.js +1 -7
  14. package/dist/blueprints/PageBlueprint.esm.js.map +1 -1
  15. package/dist/blueprints/RouterBlueprint.esm.js +5 -4
  16. package/dist/blueprints/RouterBlueprint.esm.js.map +1 -1
  17. package/dist/blueprints/SignInPageBlueprint.esm.js +5 -4
  18. package/dist/blueprints/SignInPageBlueprint.esm.js.map +1 -1
  19. package/dist/blueprints/ThemeBlueprint.esm.js +8 -7
  20. package/dist/blueprints/ThemeBlueprint.esm.js.map +1 -1
  21. package/dist/blueprints/TranslationBlueprint.esm.js +6 -5
  22. package/dist/blueprints/TranslationBlueprint.esm.js.map +1 -1
  23. package/dist/components/ExtensionBoundary.esm.js +10 -1
  24. package/dist/components/ExtensionBoundary.esm.js.map +1 -1
  25. package/dist/extensions/createComponentExtension.esm.js +13 -17
  26. package/dist/extensions/createComponentExtension.esm.js.map +1 -1
  27. package/dist/index.d.ts +378 -498
  28. package/dist/index.esm.js +1 -12
  29. package/dist/index.esm.js.map +1 -1
  30. package/dist/schema/createSchemaFromZod.esm.js.map +1 -1
  31. package/dist/wiring/createExtension.esm.js +21 -27
  32. package/dist/wiring/createExtension.esm.js.map +1 -1
  33. package/dist/wiring/createExtensionBlueprint.esm.js +58 -61
  34. package/dist/wiring/createExtensionBlueprint.esm.js.map +1 -1
  35. package/dist/wiring/createExtensionDataRef.esm.js.map +1 -1
  36. package/dist/wiring/createExtensionInput.esm.js +2 -1
  37. package/dist/wiring/createExtensionInput.esm.js.map +1 -1
  38. package/dist/wiring/createExtensionOverrides.esm.js.map +1 -1
  39. package/dist/wiring/{createPlugin.esm.js → createFrontendPlugin.esm.js} +11 -5
  40. package/dist/wiring/createFrontendPlugin.esm.js.map +1 -0
  41. package/dist/wiring/resolveExtensionDefinition.esm.js.map +1 -1
  42. package/package.json +6 -6
  43. package/dist/extensions/createApiExtension.esm.js +0 -34
  44. package/dist/extensions/createApiExtension.esm.js.map +0 -1
  45. package/dist/extensions/createAppRootElementExtension.esm.js +0 -25
  46. package/dist/extensions/createAppRootElementExtension.esm.js.map +0 -1
  47. package/dist/extensions/createAppRootWrapperExtension.esm.js +0 -32
  48. package/dist/extensions/createAppRootWrapperExtension.esm.js.map +0 -1
  49. package/dist/extensions/createNavItemExtension.esm.js +0 -35
  50. package/dist/extensions/createNavItemExtension.esm.js.map +0 -1
  51. package/dist/extensions/createNavLogoExtension.esm.js +0 -30
  52. package/dist/extensions/createNavLogoExtension.esm.js.map +0 -1
  53. package/dist/extensions/createPageExtension.esm.js +0 -38
  54. package/dist/extensions/createPageExtension.esm.js.map +0 -1
  55. package/dist/extensions/createRouterExtension.esm.js +0 -32
  56. package/dist/extensions/createRouterExtension.esm.js.map +0 -1
  57. package/dist/extensions/createSignInPageExtension.esm.js +0 -34
  58. package/dist/extensions/createSignInPageExtension.esm.js.map +0 -1
  59. package/dist/extensions/createThemeExtension.esm.js +0 -24
  60. package/dist/extensions/createThemeExtension.esm.js.map +0 -1
  61. package/dist/extensions/createTranslationExtension.esm.js +0 -22
  62. package/dist/extensions/createTranslationExtension.esm.js.map +0 -1
  63. package/dist/wiring/createPlugin.esm.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,250 @@
1
1
  # @backstage/frontend-plugin-api
2
2
 
3
+ ## 0.8.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5446061: **BREAKING**: Removed support for "v1" extensions. This means that it is no longer possible to declare inputs and outputs as objects when using `createExtension`. In addition, all extension creators except for `createComponentExtension` have been removed, use the equivalent blueprint instead. See the [1.30 migration documentation](https://backstage.io/docs/frontend-system/architecture/migrations/#130) for more information on this change.
8
+ - fec8b57: **BREAKING**: Updated the type parameters for `ExtensionDefinition` and `ExtensionBlueprint` to only have a single object parameter. The base type parameter is exported as `ExtensionDefinitionParameters` and `ExtensionBlueprintParameters` respectively. This is shipped as an immediate breaking change as we expect usage of these types to be rare, and it does not affect the runtime behavior of the API.
9
+
10
+ This is a breaking change as it changes the type parameters. Existing usage can generally be updated as follows:
11
+
12
+ - `ExtensionDefinition<any>` -> `ExtensionDefinition`
13
+ - `ExtensionDefinition<any, any>` -> `ExtensionDefinition`
14
+ - `ExtensionDefinition<TConfig>` -> `ExtensionDefinition<{ config: TConfig }>`
15
+ - `ExtensionDefinition<TConfig, TConfigInput>` -> `ExtensionDefinition<{ config: TConfig, configInput: TConfigInput }>`
16
+
17
+ If you need to infer the parameter you can use `ExtensionDefinitionParameters`, for example:
18
+
19
+ ```ts
20
+ import {
21
+ ExtensionDefinition,
22
+ ExtensionDefinitionParameters,
23
+ } from '@backstage/frontend-plugin-api';
24
+
25
+ function myUtility<T extends ExtensionDefinitionParameters>(
26
+ ext: ExtensionDefinition<T>,
27
+ ): T['config'] {
28
+ // ...
29
+ }
30
+ ```
31
+
32
+ The same patterns apply to `ExtensionBlueprint`.
33
+
34
+ This change is made to improve the readability of API references and ability to evolve the type parameters in the future.
35
+
36
+ ### Patch Changes
37
+
38
+ - 2bb9517: Introduce the `@backstage/plugin-app` package to hold all of the built-in extensions for easy consumption and overriding.
39
+ - f3a2b91: Moved several implementations of built-in APIs from being hardcoded in the app to instead be provided as API extensions. This moves all API-related inputs from the `app` extension to the respective API extensions. For example, extensions created with `ThemeBlueprint` are now attached to the `themes` input of `api:app-theme` rather than the `app` extension.
40
+ - 98850de: Added support for defining `replaces` in `createExtensionInput` which will allow extensions to redirect missing `attachTo` points to an input of the created extension.
41
+
42
+ ```ts
43
+ export const AppThemeApi = ApiBlueprint.makeWithOverrides({
44
+ name: 'app-theme',
45
+ inputs: {
46
+ themes: createExtensionInput([ThemeBlueprint.dataRefs.theme], {
47
+ // attachTo: { id: 'app', input: 'themes'} will be redirected to this input instead
48
+ replaces: [{ id: 'app', input: 'themes' }],
49
+ }),
50
+ },
51
+ factory: () {
52
+ ...
53
+ }
54
+ });
55
+ ```
56
+
57
+ - 4a66456: A new `apis` parameter has been added to `factory` for extensions. This is a way to access utility APIs without being coupled to the React context.
58
+ - Updated dependencies
59
+ - @backstage/core-components@0.14.10
60
+ - @backstage/core-plugin-api@1.9.3
61
+ - @backstage/types@1.1.1
62
+ - @backstage/version-bridge@1.0.8
63
+
64
+ ## 0.7.0
65
+
66
+ ### Minor Changes
67
+
68
+ - 72754db: **BREAKING**: All types of route refs are always considered optional by `useRouteRef`, which means the caller must always handle a potential `undefined` return value. Related to this change, the `optional` option from `createExternalRouteRef` has been removed, since it is no longer necessary.
69
+
70
+ This is released as an immediate breaking change as we expect the usage of the new route refs to be extremely low or zero, since plugins that support the new system will still use route refs and `useRouteRef` from `@backstage/core-plugin-api` in combination with `convertLegacyRouteRef` from `@backstage/core-compat-api`.
71
+
72
+ ### Patch Changes
73
+
74
+ - 6f72c2b: Fixing issue with extension blueprints `inputs` merging.
75
+ - 210d066: Added support for using the `params` in other properties of the `createExtensionBlueprint` options by providing a callback.
76
+ - 9b356dc: Renamed `createPlugin` to `createFrontendPlugin`. The old symbol is still exported but deprecated.
77
+ - a376559: Correct the `TConfig` type of data references to only contain config
78
+ - 4e53ad6: Introduce a new way to encapsulate extension kinds that replaces the extension creator pattern with `createExtensionBlueprint`
79
+
80
+ This allows the creation of extension instances with the following pattern:
81
+
82
+ ```tsx
83
+ // create the extension blueprint which is used to create instances
84
+ const EntityCardBlueprint = createExtensionBlueprint({
85
+ kind: 'entity-card',
86
+ attachTo: { id: 'test', input: 'default' },
87
+ output: [coreExtensionData.reactElement],
88
+ factory(params: { text: string }) {
89
+ return [coreExtensionData.reactElement(<h1>{params.text}</h1>)];
90
+ },
91
+ });
92
+
93
+ // create an instance of the extension blueprint with params
94
+ const testExtension = EntityCardBlueprint.make({
95
+ name: 'foo',
96
+ params: {
97
+ text: 'Hello World',
98
+ },
99
+ });
100
+ ```
101
+
102
+ - 9b89b82: The `ExtensionBoundary` now by default infers whether it's routable from whether it outputs a route path.
103
+ - e493020: Deprecated `inputs` and `configSchema` options for `createComponentExtenion`, these will be removed in a future release
104
+ - 7777b5f: Added a new `IconBundleBlueprint` that lets you create icon bundle extensions that can be installed in an App in order to override or add new app icons.
105
+
106
+ ```tsx
107
+ import { IconBundleBlueprint } from '@backstage/frontend-plugin-api';
108
+
109
+ const exampleIconBundle = IconBundleBlueprint.make({
110
+ name: 'example-bundle',
111
+ params: {
112
+ icons: {
113
+ user: MyOwnUserIcon,
114
+ },
115
+ },
116
+ });
117
+ ```
118
+
119
+ - 99abb6b: Support overriding of plugin extensions using the new `plugin.withOverrides` method.
120
+
121
+ ```tsx
122
+ import homePlugin from '@backstage/plugin-home';
123
+
124
+ export default homePlugin.withOverrides({
125
+ extensions: [
126
+ homePage.getExtension('page:home').override({
127
+ *factory(originalFactory) {
128
+ yield* originalFactory();
129
+ yield coreExtensionData.reactElement(<h1>My custom home page</h1>);
130
+ },
131
+ }),
132
+ ],
133
+ });
134
+ ```
135
+
136
+ - 813cac4: Add an `ExtensionBoundary.lazy` function to create properly wrapped lazy-loading enabled elements, suitable for use with `coreExtensionData.reactElement`. The page blueprint now automatically leverages this.
137
+ - a65cfc8: Add support for accessing extensions definitions provided by a plugin via `plugin.getExtension(...)`. For this to work the extensions must be defined using the v2 format, typically using an extension blueprint.
138
+ - 3be9aeb: Extensions have been changed to be declared with an array of inputs and outputs, rather than a map of named data refs. This change was made to reduce confusion around the role of the input and output names, as well as enable more powerful APIs for overriding extensions.
139
+
140
+ An extension that was previously declared like this:
141
+
142
+ ```tsx
143
+ const exampleExtension = createExtension({
144
+ name: 'example',
145
+ inputs: {
146
+ items: createExtensionInput({
147
+ element: coreExtensionData.reactElement,
148
+ }),
149
+ },
150
+ output: {
151
+ element: coreExtensionData.reactElement,
152
+ },
153
+ factory({ inputs }) {
154
+ return {
155
+ element: (
156
+ <div>
157
+ Example
158
+ {inputs.items.map(item => {
159
+ return <div>{item.output.element}</div>;
160
+ })}
161
+ </div>
162
+ ),
163
+ };
164
+ },
165
+ });
166
+ ```
167
+
168
+ Should be migrated to the following:
169
+
170
+ ```tsx
171
+ const exampleExtension = createExtension({
172
+ name: 'example',
173
+ inputs: {
174
+ items: createExtensionInput([coreExtensionData.reactElement]),
175
+ },
176
+ output: [coreExtensionData.reactElement],
177
+ factory({ inputs }) {
178
+ return [
179
+ coreExtensionData.reactElement(
180
+ <div>
181
+ Example
182
+ {inputs.items.map(item => {
183
+ return <div>{item.get(coreExtensionData.reactElement)}</div>;
184
+ })}
185
+ </div>,
186
+ ),
187
+ ];
188
+ },
189
+ });
190
+ ```
191
+
192
+ - 34f1b2a: Support merging of `inputs` in extension blueprints, but stop merging `output`. In addition, the original factory in extension blueprints now returns a data container that both provides access to the returned data, but can also be forwarded as output.
193
+ - 3fb421d: Added support to be able to define `zod` config schema in Blueprints, with built in schema merging from the Blueprint and the extension instances.
194
+ - 2d21599: Added support for being able to override extension definitions.
195
+
196
+ ```tsx
197
+ const TestCard = EntityCardBlueprint.make({
198
+ ...
199
+ });
200
+
201
+ TestCard.override({
202
+ // override attachment points
203
+ attachTo: { id: 'something-else', input: 'overridden' },
204
+ // extend the config schema
205
+ config: {
206
+ schema: {
207
+ newConfig: z => z.string().optional(),
208
+ }
209
+ },
210
+ // override factory
211
+ *factory(originalFactory, { inputs, config }){
212
+ const originalOutput = originalFactory();
213
+
214
+ yield coreExentsionData.reactElement(
215
+ <Wrapping>
216
+ {originalOutput.get(coreExentsionData.reactElement)}
217
+ </Wrapping>
218
+ );
219
+ }
220
+ });
221
+
222
+ ```
223
+
224
+ - 31bfc44: Extension data references can now be defined in a way that encapsulates the ID string in the type, in addition to the data type itself. The old way of creating extension data references is deprecated and will be removed in a future release.
225
+
226
+ For example, the following code:
227
+
228
+ ```ts
229
+ export const myExtension =
230
+ createExtensionDataRef<MyType>('my-plugin.my-data');
231
+ ```
232
+
233
+ Should be updated to the following:
234
+
235
+ ```ts
236
+ export const myExtension = createExtensionDataRef<MyType>().with({
237
+ id: 'my-plugin.my-data',
238
+ });
239
+ ```
240
+
241
+ - 6349099: Added config input type to the extensions
242
+ - Updated dependencies
243
+ - @backstage/core-components@0.14.10
244
+ - @backstage/core-plugin-api@1.9.3
245
+ - @backstage/types@1.1.1
246
+ - @backstage/version-bridge@1.0.8
247
+
3
248
  ## 0.7.0-next.3
4
249
 
5
250
  ### Patch Changes
@@ -1,18 +1,21 @@
1
1
  import '../wiring/coreExtensionData.esm.js';
2
2
  import 'zod';
3
3
  import 'zod-to-json-schema';
4
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
4
5
  import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
5
- import { createApiExtension } from '../extensions/createApiExtension.esm.js';
6
6
 
7
+ const factoryDataRef = createExtensionDataRef().with({
8
+ id: "core.api.factory"
9
+ });
7
10
  const ApiBlueprint = createExtensionBlueprint({
8
11
  kind: "api",
9
- attachTo: { id: "app", input: "apis" },
10
- output: [createApiExtension.factoryDataRef],
12
+ attachTo: { id: "root", input: "apis" },
13
+ output: [factoryDataRef],
11
14
  dataRefs: {
12
- factory: createApiExtension.factoryDataRef
15
+ factory: factoryDataRef
13
16
  },
14
17
  *factory(params) {
15
- yield createApiExtension.factoryDataRef(params.factory);
18
+ yield factoryDataRef(params.factory);
16
19
  }
17
20
  });
18
21
 
@@ -1 +1 @@
1
- {"version":3,"file":"ApiBlueprint.esm.js","sources":["../../src/blueprints/ApiBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { createExtensionBlueprint } from '../wiring';\nimport { createApiExtension } from '../extensions/createApiExtension';\nimport { AnyApiFactory } from '@backstage/core-plugin-api';\n\n/**\n * Creates utility API extensions.\n *\n * @public\n */\nexport const ApiBlueprint = createExtensionBlueprint({\n kind: 'api',\n attachTo: { id: 'app', input: 'apis' },\n output: [createApiExtension.factoryDataRef],\n dataRefs: {\n factory: createApiExtension.factoryDataRef,\n },\n *factory(params: { factory: AnyApiFactory }) {\n yield createApiExtension.factoryDataRef(params.factory);\n },\n});\n"],"names":[],"mappings":";;;;;;AAyBO,MAAM,eAAe,wBAAyB,CAAA;AAAA,EACnD,IAAM,EAAA,KAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,KAAA,EAAO,OAAO,MAAO,EAAA;AAAA,EACrC,MAAA,EAAQ,CAAC,kBAAA,CAAmB,cAAc,CAAA;AAAA,EAC1C,QAAU,EAAA;AAAA,IACR,SAAS,kBAAmB,CAAA,cAAA;AAAA,GAC9B;AAAA,EACA,CAAC,QAAQ,MAAoC,EAAA;AAC3C,IAAM,MAAA,kBAAA,CAAmB,cAAe,CAAA,MAAA,CAAO,OAAO,CAAA,CAAA;AAAA,GACxD;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"ApiBlueprint.esm.js","sources":["../../src/blueprints/ApiBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { createExtensionBlueprint, createExtensionDataRef } from '../wiring';\nimport { AnyApiFactory } from '@backstage/core-plugin-api';\n\nconst factoryDataRef = createExtensionDataRef<AnyApiFactory>().with({\n id: 'core.api.factory',\n});\n\n/**\n * Creates utility API extensions.\n *\n * @public\n */\nexport const ApiBlueprint = createExtensionBlueprint({\n kind: 'api',\n attachTo: { id: 'root', input: 'apis' },\n output: [factoryDataRef],\n dataRefs: {\n factory: factoryDataRef,\n },\n *factory(params: { factory: AnyApiFactory }) {\n yield factoryDataRef(params.factory);\n },\n});\n"],"names":[],"mappings":";;;;;;AAmBA,MAAM,cAAA,GAAiB,sBAAsC,EAAA,CAAE,IAAK,CAAA;AAAA,EAClE,EAAI,EAAA,kBAAA;AACN,CAAC,CAAA,CAAA;AAOM,MAAM,eAAe,wBAAyB,CAAA;AAAA,EACnD,IAAM,EAAA,KAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,MAAA,EAAQ,OAAO,MAAO,EAAA;AAAA,EACtC,MAAA,EAAQ,CAAC,cAAc,CAAA;AAAA,EACvB,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,cAAA;AAAA,GACX;AAAA,EACA,CAAC,QAAQ,MAAoC,EAAA;AAC3C,IAAM,MAAA,cAAA,CAAe,OAAO,OAAO,CAAA,CAAA;AAAA,GACrC;AACF,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AppRootElementBlueprint.esm.js","sources":["../../src/blueprints/AppRootElementBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { coreExtensionData, createExtensionBlueprint } from '../wiring';\n\n/**\n * Creates extensions that render a React element at the app root, outside of\n * the app layout. This is useful for example for shared popups and similar.\n *\n * @public\n */\nexport const AppRootElementBlueprint = createExtensionBlueprint({\n kind: 'app-root-element',\n attachTo: { id: 'app/root', input: 'elements' },\n output: [coreExtensionData.reactElement],\n *factory(params: { element: JSX.Element | (() => JSX.Element) }) {\n yield coreExtensionData.reactElement(\n typeof params.element === 'function' ? params.element() : params.element,\n );\n },\n});\n"],"names":[],"mappings":";;;;;AAuBO,MAAM,0BAA0B,wBAAyB,CAAA;AAAA,EAC9D,IAAM,EAAA,kBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,UAAW,EAAA;AAAA,EAC9C,MAAA,EAAQ,CAAC,iBAAA,CAAkB,YAAY,CAAA;AAAA,EACvC,CAAC,QAAQ,MAAwD,EAAA;AAC/D,IAAA,MAAM,iBAAkB,CAAA,YAAA;AAAA,MACtB,OAAO,MAAO,CAAA,OAAA,KAAY,aAAa,MAAO,CAAA,OAAA,KAAY,MAAO,CAAA,OAAA;AAAA,KACnE,CAAA;AAAA,GACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"AppRootElementBlueprint.esm.js","sources":["../../src/blueprints/AppRootElementBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { coreExtensionData, createExtensionBlueprint } from '../wiring';\n\n/**\n * Creates extensions that render a React element at the app root, outside of\n * the app layout. This is useful for example for shared popups and similar.\n *\n * @public\n */\nexport const AppRootElementBlueprint = createExtensionBlueprint({\n kind: 'app-root-element',\n attachTo: { id: 'app/root', input: 'elements' },\n output: [coreExtensionData.reactElement],\n *factory(params: { element: JSX.Element | (() => JSX.Element) }) {\n yield coreExtensionData.reactElement(\n typeof params.element === 'function' ? params.element() : params.element,\n );\n },\n});\n"],"names":[],"mappings":";;;;;AAwBO,MAAM,0BAA0B,wBAAyB,CAAA;AAAA,EAC9D,IAAM,EAAA,kBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,UAAW,EAAA;AAAA,EAC9C,MAAA,EAAQ,CAAC,iBAAA,CAAkB,YAAY,CAAA;AAAA,EACvC,CAAC,QAAQ,MAAwD,EAAA;AAC/D,IAAA,MAAM,iBAAkB,CAAA,YAAA;AAAA,MACtB,OAAO,MAAO,CAAA,OAAA,KAAY,aAAa,MAAO,CAAA,OAAA,KAAY,MAAO,CAAA,OAAA;AAAA,KACnE,CAAA;AAAA,GACF;AACF,CAAC;;;;"}
@@ -2,21 +2,22 @@ import React from 'react';
2
2
  import '../wiring/coreExtensionData.esm.js';
3
3
  import 'zod';
4
4
  import 'zod-to-json-schema';
5
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
5
6
  import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
6
- import { createAppRootWrapperExtension } from '../extensions/createAppRootWrapperExtension.esm.js';
7
7
 
8
+ const componentDataRef = createExtensionDataRef().with({ id: "app.root.wrapper" });
8
9
  const AppRootWrapperBlueprint = createExtensionBlueprint({
9
10
  kind: "app-root-wrapper",
10
11
  attachTo: { id: "app/root", input: "wrappers" },
11
- output: [createAppRootWrapperExtension.componentDataRef],
12
+ output: [componentDataRef],
12
13
  dataRefs: {
13
- component: createAppRootWrapperExtension.componentDataRef
14
+ component: componentDataRef
14
15
  },
15
16
  *factory(params) {
16
17
  const Component = (props) => {
17
18
  return /* @__PURE__ */ React.createElement(params.Component, null, props.children);
18
19
  };
19
- yield createAppRootWrapperExtension.componentDataRef(Component);
20
+ yield componentDataRef(Component);
20
21
  }
21
22
  });
22
23
 
@@ -1 +1 @@
1
- {"version":3,"file":"AppRootWrapperBlueprint.esm.js","sources":["../../src/blueprints/AppRootWrapperBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { ComponentType, PropsWithChildren } from 'react';\nimport { createExtensionBlueprint } from '../wiring';\nimport { createAppRootWrapperExtension } from '../extensions/createAppRootWrapperExtension';\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.\n *\n * @public\n */\nexport const AppRootWrapperBlueprint = createExtensionBlueprint({\n kind: 'app-root-wrapper',\n attachTo: { id: 'app/root', input: 'wrappers' },\n output: [createAppRootWrapperExtension.componentDataRef],\n dataRefs: {\n component: createAppRootWrapperExtension.componentDataRef,\n },\n *factory(params: { Component: ComponentType<PropsWithChildren<{}>> }) {\n // todo(blam): not sure that this wrapping is even necessary anymore.\n const Component = (props: PropsWithChildren<{}>) => {\n return <params.Component>{props.children}</params.Component>;\n };\n\n yield createAppRootWrapperExtension.componentDataRef(Component);\n },\n});\n"],"names":[],"mappings":";;;;;;;AA4BO,MAAM,0BAA0B,wBAAyB,CAAA;AAAA,EAC9D,IAAM,EAAA,kBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,UAAW,EAAA;AAAA,EAC9C,MAAA,EAAQ,CAAC,6BAAA,CAA8B,gBAAgB,CAAA;AAAA,EACvD,QAAU,EAAA;AAAA,IACR,WAAW,6BAA8B,CAAA,gBAAA;AAAA,GAC3C;AAAA,EACA,CAAC,QAAQ,MAA6D,EAAA;AAEpE,IAAM,MAAA,SAAA,GAAY,CAAC,KAAiC,KAAA;AAClD,MAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,MAAA,CAAO,SAAP,EAAA,IAAA,EAAkB,MAAM,QAAS,CAAA,CAAA;AAAA,KAC3C,CAAA;AAEA,IAAM,MAAA,6BAAA,CAA8B,iBAAiB,SAAS,CAAA,CAAA;AAAA,GAChE;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"AppRootWrapperBlueprint.esm.js","sources":["../../src/blueprints/AppRootWrapperBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React from 'react';\nimport { ComponentType, PropsWithChildren } from 'react';\nimport { createExtensionBlueprint, createExtensionDataRef } from '../wiring';\n\nconst componentDataRef = createExtensionDataRef<\n ComponentType<PropsWithChildren<{}>>\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.\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: { Component: ComponentType<PropsWithChildren<{}>> }) {\n // todo(blam): not sure that this wrapping is even necessary anymore.\n const Component = (props: PropsWithChildren<{}>) => {\n return <params.Component>{props.children}</params.Component>;\n };\n\n yield componentDataRef(Component);\n },\n});\n"],"names":[],"mappings":";;;;;;;AAoBA,MAAM,mBAAmB,sBAEvB,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,oBAAoB,CAAA,CAAA;AAS5B,MAAM,0BAA0B,wBAAyB,CAAA;AAAA,EAC9D,IAAM,EAAA,kBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,UAAW,EAAA;AAAA,EAC9C,MAAA,EAAQ,CAAC,gBAAgB,CAAA;AAAA,EACzB,QAAU,EAAA;AAAA,IACR,SAAW,EAAA,gBAAA;AAAA,GACb;AAAA,EACA,CAAC,QAAQ,MAA6D,EAAA;AAEpE,IAAM,MAAA,SAAA,GAAY,CAAC,KAAiC,KAAA;AAClD,MAAA,uBAAQ,KAAA,CAAA,aAAA,CAAA,MAAA,CAAO,SAAP,EAAA,IAAA,EAAkB,MAAM,QAAS,CAAA,CAAA;AAAA,KAC3C,CAAA;AAEA,IAAA,MAAM,iBAAiB,SAAS,CAAA,CAAA;AAAA,GAClC;AACF,CAAC;;;;"}
@@ -8,7 +8,7 @@ const iconsDataRef = createExtensionDataRef().with({ id: "core.icons" });
8
8
  const IconBundleBlueprint = createExtensionBlueprint({
9
9
  kind: "icon-bundle",
10
10
  namespace: "app",
11
- attachTo: { id: "app", input: "icons" },
11
+ attachTo: { id: "api:app/icons", input: "icons" },
12
12
  output: [iconsDataRef],
13
13
  config: {
14
14
  schema: {
@@ -1 +1 @@
1
- {"version":3,"file":"IconBundleBlueprint.esm.js","sources":["../../src/blueprints/IconBundleBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { IconComponent } from '../icons';\nimport { createExtensionBlueprint, createExtensionDataRef } from '../wiring';\n\nconst iconsDataRef = createExtensionDataRef<{\n [key in string]: IconComponent;\n}>().with({ id: 'core.icons' });\n\n/** @public */\nexport const IconBundleBlueprint = createExtensionBlueprint({\n kind: 'icon-bundle',\n namespace: 'app',\n attachTo: { id: 'app', input: 'icons' },\n output: [iconsDataRef],\n config: {\n schema: {\n icons: z => z.string().default('blob'),\n test: z => z.string(),\n },\n },\n factory: (params: { icons: { [key in string]: IconComponent } }) => [\n iconsDataRef(params.icons),\n ],\n dataRefs: {\n icons: iconsDataRef,\n },\n});\n"],"names":[],"mappings":";;;;;;AAkBA,MAAM,eAAe,sBAElB,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,cAAc,CAAA,CAAA;AAGvB,MAAM,sBAAsB,wBAAyB,CAAA;AAAA,EAC1D,IAAM,EAAA,aAAA;AAAA,EACN,SAAW,EAAA,KAAA;AAAA,EACX,QAAU,EAAA,EAAE,EAAI,EAAA,KAAA,EAAO,OAAO,OAAQ,EAAA;AAAA,EACtC,MAAA,EAAQ,CAAC,YAAY,CAAA;AAAA,EACrB,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,OAAO,CAAK,CAAA,KAAA,CAAA,CAAE,MAAO,EAAA,CAAE,QAAQ,MAAM,CAAA;AAAA,MACrC,IAAA,EAAM,CAAK,CAAA,KAAA,CAAA,CAAE,MAAO,EAAA;AAAA,KACtB;AAAA,GACF;AAAA,EACA,OAAA,EAAS,CAAC,MAA0D,KAAA;AAAA,IAClE,YAAA,CAAa,OAAO,KAAK,CAAA;AAAA,GAC3B;AAAA,EACA,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,YAAA;AAAA,GACT;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"IconBundleBlueprint.esm.js","sources":["../../src/blueprints/IconBundleBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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 } from '../icons';\nimport { createExtensionBlueprint, createExtensionDataRef } from '../wiring';\n\nconst iconsDataRef = createExtensionDataRef<{\n [key in string]: IconComponent;\n}>().with({ id: 'core.icons' });\n\n/** @public */\nexport const IconBundleBlueprint = createExtensionBlueprint({\n kind: 'icon-bundle',\n namespace: 'app',\n attachTo: { id: 'api:app/icons', input: 'icons' },\n output: [iconsDataRef],\n config: {\n schema: {\n icons: z => z.string().default('blob'),\n test: z => z.string(),\n },\n },\n factory: (params: { icons: { [key in string]: IconComponent } }) => [\n iconsDataRef(params.icons),\n ],\n dataRefs: {\n icons: iconsDataRef,\n },\n});\n"],"names":[],"mappings":";;;;;;AAmBA,MAAM,eAAe,sBAElB,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,cAAc,CAAA,CAAA;AAGvB,MAAM,sBAAsB,wBAAyB,CAAA;AAAA,EAC1D,IAAM,EAAA,aAAA;AAAA,EACN,SAAW,EAAA,KAAA;AAAA,EACX,QAAU,EAAA,EAAE,EAAI,EAAA,eAAA,EAAiB,OAAO,OAAQ,EAAA;AAAA,EAChD,MAAA,EAAQ,CAAC,YAAY,CAAA;AAAA,EACrB,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,OAAO,CAAK,CAAA,KAAA,CAAA,CAAE,MAAO,EAAA,CAAE,QAAQ,MAAM,CAAA;AAAA,MACrC,IAAA,EAAM,CAAK,CAAA,KAAA,CAAA,CAAE,MAAO,EAAA;AAAA,KACtB;AAAA,GACF;AAAA,EACA,OAAA,EAAS,CAAC,MAA0D,KAAA;AAAA,IAClE,YAAA,CAAa,OAAO,KAAK,CAAA;AAAA,GAC3B;AAAA,EACA,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,YAAA;AAAA,GACT;AACF,CAAC;;;;"}
@@ -1,22 +1,23 @@
1
1
  import '../wiring/coreExtensionData.esm.js';
2
2
  import 'zod';
3
3
  import 'zod-to-json-schema';
4
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
4
5
  import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
5
- import { createNavItemExtension } from '../extensions/createNavItemExtension.esm.js';
6
6
 
7
+ const targetDataRef = createExtensionDataRef().with({ id: "core.nav-item.target" });
7
8
  const NavItemBlueprint = createExtensionBlueprint({
8
9
  kind: "nav-item",
9
10
  attachTo: { id: "app/nav", input: "items" },
10
- output: [createNavItemExtension.targetDataRef],
11
+ output: [targetDataRef],
11
12
  dataRefs: {
12
- target: createNavItemExtension.targetDataRef
13
+ target: targetDataRef
13
14
  },
14
15
  factory: ({
15
16
  icon,
16
17
  routeRef,
17
18
  title
18
19
  }, { config }) => [
19
- createNavItemExtension.targetDataRef({
20
+ targetDataRef({
20
21
  title: config.title ?? title,
21
22
  icon,
22
23
  routeRef
@@ -1 +1 @@
1
- {"version":3,"file":"NavItemBlueprint.esm.js","sources":["../../src/blueprints/NavItemBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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 } from '@backstage/core-plugin-api';\nimport { RouteRef } from '../routing';\nimport { createExtensionBlueprint } from '../wiring';\nimport { createNavItemExtension } from '../extensions/createNavItemExtension';\n\n/**\n * Creates extensions that make up the items of the nav bar.\n *\n * @public\n */\nexport const NavItemBlueprint = createExtensionBlueprint({\n kind: 'nav-item',\n attachTo: { id: 'app/nav', input: 'items' },\n output: [createNavItemExtension.targetDataRef],\n dataRefs: {\n target: createNavItemExtension.targetDataRef,\n },\n factory: (\n {\n icon,\n routeRef,\n title,\n }: {\n title: string;\n icon: IconComponent;\n routeRef: RouteRef<undefined>;\n },\n { config },\n ) => [\n createNavItemExtension.targetDataRef({\n title: config.title ?? title,\n icon,\n routeRef,\n }),\n ],\n config: {\n schema: {\n title: z => z.string().optional(),\n },\n },\n});\n"],"names":[],"mappings":";;;;;;AA0BO,MAAM,mBAAmB,wBAAyB,CAAA;AAAA,EACvD,IAAM,EAAA,UAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,SAAA,EAAW,OAAO,OAAQ,EAAA;AAAA,EAC1C,MAAA,EAAQ,CAAC,sBAAA,CAAuB,aAAa,CAAA;AAAA,EAC7C,QAAU,EAAA;AAAA,IACR,QAAQ,sBAAuB,CAAA,aAAA;AAAA,GACjC;AAAA,EACA,SAAS,CACP;AAAA,IACE,IAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,GACF,EAKA,EAAE,MAAA,EACC,KAAA;AAAA,IACH,uBAAuB,aAAc,CAAA;AAAA,MACnC,KAAA,EAAO,OAAO,KAAS,IAAA,KAAA;AAAA,MACvB,IAAA;AAAA,MACA,QAAA;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,KAClC;AAAA,GACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"NavItemBlueprint.esm.js","sources":["../../src/blueprints/NavItemBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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 } from '@backstage/core-plugin-api';\nimport { RouteRef } from '../routing';\nimport { createExtensionBlueprint, createExtensionDataRef } from '../wiring';\n\n// TODO(Rugvip): Should this be broken apart into separate refs? title/icon/routeRef\nconst targetDataRef = createExtensionDataRef<{\n title: string;\n icon: IconComponent;\n routeRef: RouteRef<undefined>;\n}>().with({ id: 'core.nav-item.target' });\n\n/**\n * Creates extensions that make up the items of the nav bar.\n *\n * @public\n */\nexport const NavItemBlueprint = createExtensionBlueprint({\n kind: 'nav-item',\n attachTo: { id: 'app/nav', input: 'items' },\n output: [targetDataRef],\n dataRefs: {\n target: targetDataRef,\n },\n factory: (\n {\n icon,\n routeRef,\n title,\n }: {\n title: string;\n icon: IconComponent;\n routeRef: RouteRef<undefined>;\n },\n { config },\n ) => [\n targetDataRef({\n title: config.title ?? title,\n icon,\n routeRef,\n }),\n ],\n config: {\n schema: {\n title: z => z.string().optional(),\n },\n },\n});\n"],"names":[],"mappings":";;;;;;AAqBA,MAAM,gBAAgB,sBAInB,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,wBAAwB,CAAA,CAAA;AAOjC,MAAM,mBAAmB,wBAAyB,CAAA;AAAA,EACvD,IAAM,EAAA,UAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,SAAA,EAAW,OAAO,OAAQ,EAAA;AAAA,EAC1C,MAAA,EAAQ,CAAC,aAAa,CAAA;AAAA,EACtB,QAAU,EAAA;AAAA,IACR,MAAQ,EAAA,aAAA;AAAA,GACV;AAAA,EACA,SAAS,CACP;AAAA,IACE,IAAA;AAAA,IACA,QAAA;AAAA,IACA,KAAA;AAAA,GACF,EAKA,EAAE,MAAA,EACC,KAAA;AAAA,IACH,aAAc,CAAA;AAAA,MACZ,KAAA,EAAO,OAAO,KAAS,IAAA,KAAA;AAAA,MACvB,IAAA;AAAA,MACA,QAAA;AAAA,KACD,CAAA;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,KAAO,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,KAClC;AAAA,GACF;AACF,CAAC;;;;"}
@@ -1,21 +1,22 @@
1
1
  import '../wiring/coreExtensionData.esm.js';
2
2
  import 'zod';
3
3
  import 'zod-to-json-schema';
4
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
4
5
  import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
5
- import { createNavLogoExtension } from '../extensions/createNavLogoExtension.esm.js';
6
6
 
7
+ const logoElementsDataRef = createExtensionDataRef().with({ id: "core.nav-logo.logo-elements" });
7
8
  const NavLogoBlueprint = createExtensionBlueprint({
8
9
  kind: "nav-logo",
9
10
  attachTo: { id: "app/nav", input: "logos" },
10
- output: [createNavLogoExtension.logoElementsDataRef],
11
+ output: [logoElementsDataRef],
11
12
  dataRefs: {
12
- logoElements: createNavLogoExtension.logoElementsDataRef
13
+ logoElements: logoElementsDataRef
13
14
  },
14
15
  *factory({
15
16
  logoIcon,
16
17
  logoFull
17
18
  }) {
18
- yield createNavLogoExtension.logoElementsDataRef({
19
+ yield logoElementsDataRef({
19
20
  logoIcon,
20
21
  logoFull
21
22
  });
@@ -1 +1 @@
1
- {"version":3,"file":"NavLogoBlueprint.esm.js","sources":["../../src/blueprints/NavLogoBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { createExtensionBlueprint } from '../wiring';\nimport { createNavLogoExtension } from '../extensions/createNavLogoExtension';\n\n/**\n * Creates an extension that replaces the logo in the nav bar with your own.\n *\n * @public\n */\nexport const NavLogoBlueprint = createExtensionBlueprint({\n kind: 'nav-logo',\n attachTo: { id: 'app/nav', input: 'logos' },\n output: [createNavLogoExtension.logoElementsDataRef],\n dataRefs: {\n logoElements: createNavLogoExtension.logoElementsDataRef,\n },\n *factory({\n logoIcon,\n logoFull,\n }: {\n logoIcon: JSX.Element;\n logoFull: JSX.Element;\n }) {\n yield createNavLogoExtension.logoElementsDataRef({\n logoIcon,\n logoFull,\n });\n },\n});\n"],"names":[],"mappings":";;;;;;AAwBO,MAAM,mBAAmB,wBAAyB,CAAA;AAAA,EACvD,IAAM,EAAA,UAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,SAAA,EAAW,OAAO,OAAQ,EAAA;AAAA,EAC1C,MAAA,EAAQ,CAAC,sBAAA,CAAuB,mBAAmB,CAAA;AAAA,EACnD,QAAU,EAAA;AAAA,IACR,cAAc,sBAAuB,CAAA,mBAAA;AAAA,GACvC;AAAA,EACA,CAAC,OAAQ,CAAA;AAAA,IACP,QAAA;AAAA,IACA,QAAA;AAAA,GAIC,EAAA;AACD,IAAA,MAAM,uBAAuB,mBAAoB,CAAA;AAAA,MAC/C,QAAA;AAAA,MACA,QAAA;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"NavLogoBlueprint.esm.js","sources":["../../src/blueprints/NavLogoBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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 { createExtensionBlueprint, createExtensionDataRef } from '../wiring';\n\nconst logoElementsDataRef = createExtensionDataRef<{\n logoIcon?: JSX.Element;\n logoFull?: JSX.Element;\n}>().with({ id: 'core.nav-logo.logo-elements' });\n\n/**\n * Creates an extension that replaces the logo in the nav bar with your own.\n *\n * @public\n */\nexport const NavLogoBlueprint = createExtensionBlueprint({\n kind: 'nav-logo',\n attachTo: { id: 'app/nav', input: 'logos' },\n output: [logoElementsDataRef],\n dataRefs: {\n logoElements: logoElementsDataRef,\n },\n *factory({\n logoIcon,\n logoFull,\n }: {\n logoIcon: JSX.Element;\n logoFull: JSX.Element;\n }) {\n yield logoElementsDataRef({\n logoIcon,\n logoFull,\n });\n },\n});\n"],"names":[],"mappings":";;;;;;AAkBA,MAAM,sBAAsB,sBAGzB,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,+BAA+B,CAAA,CAAA;AAOxC,MAAM,mBAAmB,wBAAyB,CAAA;AAAA,EACvD,IAAM,EAAA,UAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,SAAA,EAAW,OAAO,OAAQ,EAAA;AAAA,EAC1C,MAAA,EAAQ,CAAC,mBAAmB,CAAA;AAAA,EAC5B,QAAU,EAAA;AAAA,IACR,YAAc,EAAA,mBAAA;AAAA,GAChB;AAAA,EACA,CAAC,OAAQ,CAAA;AAAA,IACP,QAAA;AAAA,IACA,QAAA;AAAA,GAIC,EAAA;AACD,IAAA,MAAM,mBAAoB,CAAA;AAAA,MACxB,QAAA;AAAA,MACA,QAAA;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
@@ -1,4 +1,3 @@
1
- import React, { lazy } from 'react';
2
1
  import { coreExtensionData } from '../wiring/coreExtensionData.esm.js';
3
2
  import 'zod';
4
3
  import 'zod-to-json-schema';
@@ -23,13 +22,8 @@ const PageBlueprint = createExtensionBlueprint({
23
22
  loader,
24
23
  routeRef
25
24
  }, { config, node }) {
26
- const ExtensionComponent = lazy(
27
- () => loader().then((element) => ({ default: () => element }))
28
- );
29
25
  yield coreExtensionData.routePath(config.path ?? defaultPath);
30
- yield coreExtensionData.reactElement(
31
- /* @__PURE__ */ React.createElement(ExtensionBoundary, { node }, /* @__PURE__ */ React.createElement(ExtensionComponent, null))
32
- );
26
+ yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));
33
27
  if (routeRef) {
34
28
  yield coreExtensionData.routeRef(routeRef);
35
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PageBlueprint.esm.js","sources":["../../src/blueprints/PageBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 React, { lazy } from 'react';\nimport { RouteRef } from '../routing';\nimport { coreExtensionData, createExtensionBlueprint } from '../wiring';\nimport { ExtensionBoundary } from '../components';\n\n/**\n * Createx extensions that are routable React page components.\n *\n * @public\n */\nexport const PageBlueprint = createExtensionBlueprint({\n kind: 'page',\n attachTo: { id: 'app/routes', input: 'routes' },\n output: [\n coreExtensionData.routePath,\n coreExtensionData.reactElement,\n coreExtensionData.routeRef.optional(),\n ],\n config: {\n schema: {\n path: z => z.string().optional(),\n },\n },\n *factory(\n {\n defaultPath,\n loader,\n routeRef,\n }: {\n defaultPath: string;\n loader: () => Promise<JSX.Element>;\n routeRef?: RouteRef;\n },\n { config, node },\n ) {\n const ExtensionComponent = lazy(() =>\n loader().then(element => ({ default: () => element })),\n );\n\n yield coreExtensionData.routePath(config.path ?? defaultPath);\n yield coreExtensionData.reactElement(\n <ExtensionBoundary node={node}>\n <ExtensionComponent />\n </ExtensionBoundary>,\n );\n\n if (routeRef) {\n yield coreExtensionData.routeRef(routeRef);\n }\n },\n});\n"],"names":[],"mappings":";;;;;;;AAyBO,MAAM,gBAAgB,wBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,MAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,YAAA,EAAc,OAAO,QAAS,EAAA;AAAA,EAC9C,MAAQ,EAAA;AAAA,IACN,iBAAkB,CAAA,SAAA;AAAA,IAClB,iBAAkB,CAAA,YAAA;AAAA,IAClB,iBAAA,CAAkB,SAAS,QAAS,EAAA;AAAA,GACtC;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,KACjC;AAAA,GACF;AAAA,EACA,CAAC,OACC,CAAA;AAAA,IACE,WAAA;AAAA,IACA,MAAA;AAAA,IACA,QAAA;AAAA,GAMF,EAAA,EAAE,MAAQ,EAAA,IAAA,EACV,EAAA;AACA,IAAA,MAAM,kBAAqB,GAAA,IAAA;AAAA,MAAK,MAC9B,QAAS,CAAA,IAAA,CAAK,cAAY,EAAE,OAAA,EAAS,MAAM,OAAA,EAAU,CAAA,CAAA;AAAA,KACvD,CAAA;AAEA,IAAA,MAAM,iBAAkB,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,IAAQ,WAAW,CAAA,CAAA;AAC5D,IAAA,MAAM,iBAAkB,CAAA,YAAA;AAAA,sBACrB,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAkB,IACjB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,wBAAmB,CACtB,CAAA;AAAA,KACF,CAAA;AAEA,IAAA,IAAI,QAAU,EAAA;AACZ,MAAM,MAAA,iBAAA,CAAkB,SAAS,QAAQ,CAAA,CAAA;AAAA,KAC3C;AAAA,GACF;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"PageBlueprint.esm.js","sources":["../../src/blueprints/PageBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { RouteRef } from '../routing';\nimport { coreExtensionData, createExtensionBlueprint } from '../wiring';\nimport { ExtensionBoundary } from '../components';\n\n/**\n * Createx extensions that are routable React page components.\n *\n * @public\n */\nexport const PageBlueprint = createExtensionBlueprint({\n kind: 'page',\n attachTo: { id: 'app/routes', input: 'routes' },\n output: [\n coreExtensionData.routePath,\n coreExtensionData.reactElement,\n coreExtensionData.routeRef.optional(),\n ],\n config: {\n schema: {\n path: z => z.string().optional(),\n },\n },\n *factory(\n {\n defaultPath,\n loader,\n routeRef,\n }: {\n defaultPath: string;\n loader: () => Promise<JSX.Element>;\n routeRef?: RouteRef;\n },\n { config, node },\n ) {\n yield coreExtensionData.routePath(config.path ?? defaultPath);\n yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));\n if (routeRef) {\n yield coreExtensionData.routeRef(routeRef);\n }\n },\n});\n"],"names":[],"mappings":";;;;;;AAyBO,MAAM,gBAAgB,wBAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,MAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,YAAA,EAAc,OAAO,QAAS,EAAA;AAAA,EAC9C,MAAQ,EAAA;AAAA,IACN,iBAAkB,CAAA,SAAA;AAAA,IAClB,iBAAkB,CAAA,YAAA;AAAA,IAClB,iBAAA,CAAkB,SAAS,QAAS,EAAA;AAAA,GACtC;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,MAAQ,EAAA;AAAA,MACN,IAAM,EAAA,CAAA,CAAA,KAAK,CAAE,CAAA,MAAA,GAAS,QAAS,EAAA;AAAA,KACjC;AAAA,GACF;AAAA,EACA,CAAC,OACC,CAAA;AAAA,IACE,WAAA;AAAA,IACA,MAAA;AAAA,IACA,QAAA;AAAA,GAMF,EAAA,EAAE,MAAQ,EAAA,IAAA,EACV,EAAA;AACA,IAAA,MAAM,iBAAkB,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,IAAQ,WAAW,CAAA,CAAA;AAC5D,IAAA,MAAM,kBAAkB,YAAa,CAAA,iBAAA,CAAkB,IAAK,CAAA,IAAA,EAAM,MAAM,CAAC,CAAA,CAAA;AACzE,IAAA,IAAI,QAAU,EAAA;AACZ,MAAM,MAAA,iBAAA,CAAkB,SAAS,QAAQ,CAAA,CAAA;AAAA,KAC3C;AAAA,GACF;AACF,CAAC;;;;"}
@@ -1,18 +1,19 @@
1
1
  import '../wiring/coreExtensionData.esm.js';
2
2
  import 'zod';
3
3
  import 'zod-to-json-schema';
4
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
4
5
  import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
5
- import { createRouterExtension } from '../extensions/createRouterExtension.esm.js';
6
6
 
7
+ const componentDataRef = createExtensionDataRef().with({ id: "app.router.wrapper" });
7
8
  const RouterBlueprint = createExtensionBlueprint({
8
9
  kind: "app-router-component",
9
10
  attachTo: { id: "app/root", input: "router" },
10
- output: [createRouterExtension.componentDataRef],
11
+ output: [componentDataRef],
11
12
  dataRefs: {
12
- component: createRouterExtension.componentDataRef
13
+ component: componentDataRef
13
14
  },
14
15
  *factory({ Component }) {
15
- yield createRouterExtension.componentDataRef(Component);
16
+ yield componentDataRef(Component);
16
17
  }
17
18
  });
18
19
 
@@ -1 +1 @@
1
- {"version":3,"file":"RouterBlueprint.esm.js","sources":["../../src/blueprints/RouterBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 { ComponentType, PropsWithChildren } from 'react';\nimport { createExtensionBlueprint } from '../wiring';\nimport { createRouterExtension } from '../extensions/createRouterExtension';\n\n/** @public */\nexport const RouterBlueprint = createExtensionBlueprint({\n kind: 'app-router-component',\n attachTo: { id: 'app/root', input: 'router' },\n output: [createRouterExtension.componentDataRef],\n dataRefs: {\n component: createRouterExtension.componentDataRef,\n },\n *factory({ Component }: { Component: ComponentType<PropsWithChildren<{}>> }) {\n yield createRouterExtension.componentDataRef(Component);\n },\n});\n"],"names":[],"mappings":";;;;;;AAoBO,MAAM,kBAAkB,wBAAyB,CAAA;AAAA,EACtD,IAAM,EAAA,sBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,QAAS,EAAA;AAAA,EAC5C,MAAA,EAAQ,CAAC,qBAAA,CAAsB,gBAAgB,CAAA;AAAA,EAC/C,QAAU,EAAA;AAAA,IACR,WAAW,qBAAsB,CAAA,gBAAA;AAAA,GACnC;AAAA,EACA,CAAC,OAAA,CAAQ,EAAE,SAAA,EAAkE,EAAA;AAC3E,IAAM,MAAA,qBAAA,CAAsB,iBAAiB,SAAS,CAAA,CAAA;AAAA,GACxD;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"RouterBlueprint.esm.js","sources":["../../src/blueprints/RouterBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2024 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, PropsWithChildren } from 'react';\nimport { createExtensionBlueprint, createExtensionDataRef } from '../wiring';\n\nconst componentDataRef = createExtensionDataRef<\n ComponentType<PropsWithChildren<{}>>\n>().with({ id: 'app.router.wrapper' });\n\n/** @public */\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({ Component }: { Component: ComponentType<PropsWithChildren<{}>> }) {\n yield componentDataRef(Component);\n },\n});\n"],"names":[],"mappings":";;;;;;AAmBA,MAAM,mBAAmB,sBAEvB,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,sBAAsB,CAAA,CAAA;AAG9B,MAAM,kBAAkB,wBAAyB,CAAA;AAAA,EACtD,IAAM,EAAA,sBAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,QAAS,EAAA;AAAA,EAC5C,MAAA,EAAQ,CAAC,gBAAgB,CAAA;AAAA,EACzB,QAAU,EAAA;AAAA,IACR,SAAW,EAAA,gBAAA;AAAA,GACb;AAAA,EACA,CAAC,OAAA,CAAQ,EAAE,SAAA,EAAkE,EAAA;AAC3E,IAAA,MAAM,iBAAiB,SAAS,CAAA,CAAA;AAAA,GAClC;AACF,CAAC;;;;"}
@@ -2,16 +2,17 @@ import React, { lazy } from 'react';
2
2
  import '../wiring/coreExtensionData.esm.js';
3
3
  import 'zod';
4
4
  import 'zod-to-json-schema';
5
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
5
6
  import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
6
- import { createSignInPageExtension } from '../extensions/createSignInPageExtension.esm.js';
7
7
  import { ExtensionBoundary } from '../components/ExtensionBoundary.esm.js';
8
8
 
9
+ const componentDataRef = createExtensionDataRef().with({ id: "core.sign-in-page.component" });
9
10
  const SignInPageBlueprint = createExtensionBlueprint({
10
11
  kind: "sign-in-page",
11
12
  attachTo: { id: "app/root", input: "signInPage" },
12
- output: [createSignInPageExtension.componentDataRef],
13
+ output: [componentDataRef],
13
14
  dataRefs: {
14
- component: createSignInPageExtension.componentDataRef
15
+ component: componentDataRef
15
16
  },
16
17
  *factory({
17
18
  loader
@@ -19,7 +20,7 @@ const SignInPageBlueprint = createExtensionBlueprint({
19
20
  const ExtensionComponent = lazy(
20
21
  () => loader().then((component) => ({ default: component }))
21
22
  );
22
- yield createSignInPageExtension.componentDataRef((props) => /* @__PURE__ */ React.createElement(ExtensionBoundary, { node, routable: true }, /* @__PURE__ */ React.createElement(ExtensionComponent, { ...props })));
23
+ yield componentDataRef((props) => /* @__PURE__ */ React.createElement(ExtensionBoundary, { node, routable: true }, /* @__PURE__ */ React.createElement(ExtensionComponent, { ...props })));
23
24
  }
24
25
  });
25
26
 
@@ -1 +1 @@
1
- {"version":3,"file":"SignInPageBlueprint.esm.js","sources":["../../src/blueprints/SignInPageBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2024 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 React, { ComponentType, lazy } from 'react';\nimport { createExtensionBlueprint } from '../wiring';\nimport { createSignInPageExtension } from '../extensions/createSignInPageExtension';\nimport { SignInPageProps } from '@backstage/core-plugin-api';\nimport { ExtensionBoundary } from '../components';\n\n/**\n * Creates an extension that replaces the sign in page.\n *\n * @public\n */\nexport const SignInPageBlueprint = createExtensionBlueprint({\n kind: 'sign-in-page',\n attachTo: { id: 'app/root', input: 'signInPage' },\n output: [createSignInPageExtension.componentDataRef],\n dataRefs: {\n component: createSignInPageExtension.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 createSignInPageExtension.componentDataRef(props => (\n <ExtensionBoundary node={node} routable>\n <ExtensionComponent {...props} />\n </ExtensionBoundary>\n ));\n },\n});\n"],"names":[],"mappings":";;;;;;;;AA0BO,MAAM,sBAAsB,wBAAyB,CAAA;AAAA,EAC1D,IAAM,EAAA,cAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,YAAa,EAAA;AAAA,EAChD,MAAA,EAAQ,CAAC,yBAAA,CAA0B,gBAAgB,CAAA;AAAA,EACnD,QAAU,EAAA;AAAA,IACR,WAAW,yBAA0B,CAAA,gBAAA;AAAA,GACvC;AAAA,EACA,CAAC,OACC,CAAA;AAAA,IACE,MAAA;AAAA,GACF,EAGA,EAAE,IAAA,EACF,EAAA;AACA,IAAA,MAAM,kBAAqB,GAAA,IAAA;AAAA,MAAK,MAC9B,QAAS,CAAA,IAAA,CAAK,gBAAc,EAAE,OAAA,EAAS,WAAY,CAAA,CAAA;AAAA,KACrD,CAAA;AAEA,IAAA,MAAM,yBAA0B,CAAA,gBAAA,CAAiB,CAC/C,KAAA,qBAAA,KAAA,CAAA,aAAA,CAAC,iBAAkB,EAAA,EAAA,IAAA,EAAY,QAAQ,EAAA,IAAA,EAAA,kBACpC,KAAA,CAAA,aAAA,CAAA,kBAAA,EAAA,EAAoB,GAAG,KAAA,EAAO,CACjC,CACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"SignInPageBlueprint.esm.js","sources":["../../src/blueprints/SignInPageBlueprint.tsx"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ComponentType, lazy } from 'react';\nimport { createExtensionBlueprint, createExtensionDataRef } from '../wiring';\nimport { SignInPageProps } from '@backstage/core-plugin-api';\nimport { ExtensionBoundary } from '../components';\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.\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} routable>\n <ExtensionComponent {...props} />\n </ExtensionBoundary>\n ));\n },\n});\n"],"names":[],"mappings":";;;;;;;;AAqBA,MAAM,mBAAmB,sBAEvB,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,+BAA+B,CAAA,CAAA;AAOvC,MAAM,sBAAsB,wBAAyB,CAAA;AAAA,EAC1D,IAAM,EAAA,cAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,YAAa,EAAA;AAAA,EAChD,MAAA,EAAQ,CAAC,gBAAgB,CAAA;AAAA,EACzB,QAAU,EAAA;AAAA,IACR,SAAW,EAAA,gBAAA;AAAA,GACb;AAAA,EACA,CAAC,OACC,CAAA;AAAA,IACE,MAAA;AAAA,GACF,EAGA,EAAE,IAAA,EACF,EAAA;AACA,IAAA,MAAM,kBAAqB,GAAA,IAAA;AAAA,MAAK,MAC9B,QAAS,CAAA,IAAA,CAAK,gBAAc,EAAE,OAAA,EAAS,WAAY,CAAA,CAAA;AAAA,KACrD,CAAA;AAEA,IAAA,MAAM,gBAAiB,CAAA,CAAA,KAAA,qBACpB,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAkB,IAAY,EAAA,QAAA,EAAQ,IACrC,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,kBAAoB,EAAA,EAAA,GAAG,KAAO,EAAA,CACjC,CACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
@@ -1,20 +1,21 @@
1
1
  import '../wiring/coreExtensionData.esm.js';
2
2
  import 'zod';
3
3
  import 'zod-to-json-schema';
4
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
4
5
  import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
5
- import { createThemeExtension } from '../extensions/createThemeExtension.esm.js';
6
6
 
7
+ const themeDataRef = createExtensionDataRef().with({
8
+ id: "core.theme.theme"
9
+ });
7
10
  const ThemeBlueprint = createExtensionBlueprint({
8
11
  kind: "theme",
9
12
  namespace: "app",
10
- attachTo: { id: "app", input: "themes" },
11
- output: [createThemeExtension.themeDataRef],
13
+ attachTo: { id: "api:app/app-theme", input: "themes" },
14
+ output: [themeDataRef],
12
15
  dataRefs: {
13
- theme: createThemeExtension.themeDataRef
16
+ theme: themeDataRef
14
17
  },
15
- factory: ({ theme }) => [
16
- createThemeExtension.themeDataRef(theme)
17
- ]
18
+ factory: ({ theme }) => [themeDataRef(theme)]
18
19
  });
19
20
 
20
21
  export { ThemeBlueprint };
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeBlueprint.esm.js","sources":["../../src/blueprints/ThemeBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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/core-plugin-api';\nimport { createExtensionBlueprint } from '../wiring';\nimport { createThemeExtension } from '../extensions/createThemeExtension';\n\n/**\n * Creates an extension that adds/replaces an app theme.\n *\n * @public\n */\nexport const ThemeBlueprint = createExtensionBlueprint({\n kind: 'theme',\n namespace: 'app',\n attachTo: { id: 'app', input: 'themes' },\n output: [createThemeExtension.themeDataRef],\n dataRefs: {\n theme: createThemeExtension.themeDataRef,\n },\n factory: ({ theme }: { theme: AppTheme }) => [\n createThemeExtension.themeDataRef(theme),\n ],\n});\n"],"names":[],"mappings":";;;;;;AAyBO,MAAM,iBAAiB,wBAAyB,CAAA;AAAA,EACrD,IAAM,EAAA,OAAA;AAAA,EACN,SAAW,EAAA,KAAA;AAAA,EACX,QAAU,EAAA,EAAE,EAAI,EAAA,KAAA,EAAO,OAAO,QAAS,EAAA;AAAA,EACvC,MAAA,EAAQ,CAAC,oBAAA,CAAqB,YAAY,CAAA;AAAA,EAC1C,QAAU,EAAA;AAAA,IACR,OAAO,oBAAqB,CAAA,YAAA;AAAA,GAC9B;AAAA,EACA,OAAS,EAAA,CAAC,EAAE,KAAA,EAAiC,KAAA;AAAA,IAC3C,oBAAA,CAAqB,aAAa,KAAK,CAAA;AAAA,GACzC;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"ThemeBlueprint.esm.js","sources":["../../src/blueprints/ThemeBlueprint.ts"],"sourcesContent":["/*\n * Copyright 2024 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/core-plugin-api';\nimport { createExtensionBlueprint, createExtensionDataRef } from '../wiring';\n\nconst themeDataRef = createExtensionDataRef<AppTheme>().with({\n id: 'core.theme.theme',\n});\n\n/**\n * Creates an extension that adds/replaces an app theme.\n *\n * @public\n */\nexport const ThemeBlueprint = createExtensionBlueprint({\n kind: 'theme',\n namespace: 'app',\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":";;;;;;AAmBA,MAAM,YAAA,GAAe,sBAAiC,EAAA,CAAE,IAAK,CAAA;AAAA,EAC3D,EAAI,EAAA,kBAAA;AACN,CAAC,CAAA,CAAA;AAOM,MAAM,iBAAiB,wBAAyB,CAAA;AAAA,EACrD,IAAM,EAAA,OAAA;AAAA,EACN,SAAW,EAAA,KAAA;AAAA,EACX,QAAU,EAAA,EAAE,EAAI,EAAA,mBAAA,EAAqB,OAAO,QAAS,EAAA;AAAA,EACrD,MAAA,EAAQ,CAAC,YAAY,CAAA;AAAA,EACrB,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,YAAA;AAAA,GACT;AAAA,EACA,OAAA,EAAS,CAAC,EAAE,KAAA,OAAiC,CAAC,YAAA,CAAa,KAAK,CAAC,CAAA;AACnE,CAAC;;;;"}