@backstage/frontend-plugin-api 0.7.0-next.3 → 0.7.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 (50) hide show
  1. package/CHANGELOG.md +184 -0
  2. package/dist/blueprints/ApiBlueprint.esm.js +7 -4
  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.map +1 -1
  8. package/dist/blueprints/NavItemBlueprint.esm.js +5 -4
  9. package/dist/blueprints/NavItemBlueprint.esm.js.map +1 -1
  10. package/dist/blueprints/NavLogoBlueprint.esm.js +5 -4
  11. package/dist/blueprints/NavLogoBlueprint.esm.js.map +1 -1
  12. package/dist/blueprints/PageBlueprint.esm.js +1 -7
  13. package/dist/blueprints/PageBlueprint.esm.js.map +1 -1
  14. package/dist/blueprints/RouterBlueprint.esm.js +5 -4
  15. package/dist/blueprints/RouterBlueprint.esm.js.map +1 -1
  16. package/dist/blueprints/SignInPageBlueprint.esm.js +5 -4
  17. package/dist/blueprints/SignInPageBlueprint.esm.js.map +1 -1
  18. package/dist/blueprints/ThemeBlueprint.esm.js +7 -6
  19. package/dist/blueprints/ThemeBlueprint.esm.js.map +1 -1
  20. package/dist/blueprints/TranslationBlueprint.esm.js +5 -4
  21. package/dist/blueprints/TranslationBlueprint.esm.js.map +1 -1
  22. package/dist/components/ExtensionBoundary.esm.js +10 -1
  23. package/dist/components/ExtensionBoundary.esm.js.map +1 -1
  24. package/dist/extensions/createApiExtension.esm.js +3 -5
  25. package/dist/extensions/createApiExtension.esm.js.map +1 -1
  26. package/dist/extensions/createAppRootWrapperExtension.esm.js +3 -3
  27. package/dist/extensions/createAppRootWrapperExtension.esm.js.map +1 -1
  28. package/dist/extensions/createComponentExtension.esm.js.map +1 -1
  29. package/dist/extensions/createNavItemExtension.esm.js +3 -3
  30. package/dist/extensions/createNavItemExtension.esm.js.map +1 -1
  31. package/dist/extensions/createNavLogoExtension.esm.js +3 -3
  32. package/dist/extensions/createNavLogoExtension.esm.js.map +1 -1
  33. package/dist/extensions/createRouterExtension.esm.js +3 -3
  34. package/dist/extensions/createRouterExtension.esm.js.map +1 -1
  35. package/dist/extensions/createSignInPageExtension.esm.js +12 -2
  36. package/dist/extensions/createSignInPageExtension.esm.js.map +1 -1
  37. package/dist/extensions/createThemeExtension.esm.js +3 -5
  38. package/dist/extensions/createThemeExtension.esm.js.map +1 -1
  39. package/dist/extensions/createTranslationExtension.esm.js +3 -3
  40. package/dist/extensions/createTranslationExtension.esm.js.map +1 -1
  41. package/dist/index.d.ts +185 -38
  42. package/dist/index.esm.js +1 -1
  43. package/dist/wiring/createExtension.esm.js.map +1 -1
  44. package/dist/wiring/createExtensionBlueprint.esm.js.map +1 -1
  45. package/dist/wiring/createExtensionDataRef.esm.js.map +1 -1
  46. package/dist/wiring/{createPlugin.esm.js → createFrontendPlugin.esm.js} +5 -4
  47. package/dist/wiring/createFrontendPlugin.esm.js.map +1 -0
  48. package/dist/wiring/resolveExtensionDefinition.esm.js.map +1 -1
  49. package/package.json +6 -6
  50. package/dist/wiring/createPlugin.esm.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,189 @@
1
1
  # @backstage/frontend-plugin-api
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 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.
8
+
9
+ 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`.
10
+
11
+ ### Patch Changes
12
+
13
+ - 6f72c2b: Fixing issue with extension blueprints `inputs` merging.
14
+ - 210d066: Added support for using the `params` in other properties of the `createExtensionBlueprint` options by providing a callback.
15
+ - 9b356dc: Renamed `createPlugin` to `createFrontendPlugin`. The old symbol is still exported but deprecated.
16
+ - a376559: Correct the `TConfig` type of data references to only contain config
17
+ - 4e53ad6: Introduce a new way to encapsulate extension kinds that replaces the extension creator pattern with `createExtensionBlueprint`
18
+
19
+ This allows the creation of extension instances with the following pattern:
20
+
21
+ ```tsx
22
+ // create the extension blueprint which is used to create instances
23
+ const EntityCardBlueprint = createExtensionBlueprint({
24
+ kind: 'entity-card',
25
+ attachTo: { id: 'test', input: 'default' },
26
+ output: [coreExtensionData.reactElement],
27
+ factory(params: { text: string }) {
28
+ return [coreExtensionData.reactElement(<h1>{params.text}</h1>)];
29
+ },
30
+ });
31
+
32
+ // create an instance of the extension blueprint with params
33
+ const testExtension = EntityCardBlueprint.make({
34
+ name: 'foo',
35
+ params: {
36
+ text: 'Hello World',
37
+ },
38
+ });
39
+ ```
40
+
41
+ - 9b89b82: The `ExtensionBoundary` now by default infers whether it's routable from whether it outputs a route path.
42
+ - e493020: Deprecated `inputs` and `configSchema` options for `createComponentExtenion`, these will be removed in a future release
43
+ - 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.
44
+
45
+ ```tsx
46
+ import { IconBundleBlueprint } from '@backstage/frontend-plugin-api';
47
+
48
+ const exampleIconBundle = IconBundleBlueprint.make({
49
+ name: 'example-bundle',
50
+ params: {
51
+ icons: {
52
+ user: MyOwnUserIcon,
53
+ },
54
+ },
55
+ });
56
+ ```
57
+
58
+ - 99abb6b: Support overriding of plugin extensions using the new `plugin.withOverrides` method.
59
+
60
+ ```tsx
61
+ import homePlugin from '@backstage/plugin-home';
62
+
63
+ export default homePlugin.withOverrides({
64
+ extensions: [
65
+ homePage.getExtension('page:home').override({
66
+ *factory(originalFactory) {
67
+ yield* originalFactory();
68
+ yield coreExtensionData.reactElement(<h1>My custom home page</h1>);
69
+ },
70
+ }),
71
+ ],
72
+ });
73
+ ```
74
+
75
+ - 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.
76
+ - 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.
77
+ - 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.
78
+
79
+ An extension that was previously declared like this:
80
+
81
+ ```tsx
82
+ const exampleExtension = createExtension({
83
+ name: 'example',
84
+ inputs: {
85
+ items: createExtensionInput({
86
+ element: coreExtensionData.reactElement,
87
+ }),
88
+ },
89
+ output: {
90
+ element: coreExtensionData.reactElement,
91
+ },
92
+ factory({ inputs }) {
93
+ return {
94
+ element: (
95
+ <div>
96
+ Example
97
+ {inputs.items.map(item => {
98
+ return <div>{item.output.element}</div>;
99
+ })}
100
+ </div>
101
+ ),
102
+ };
103
+ },
104
+ });
105
+ ```
106
+
107
+ Should be migrated to the following:
108
+
109
+ ```tsx
110
+ const exampleExtension = createExtension({
111
+ name: 'example',
112
+ inputs: {
113
+ items: createExtensionInput([coreExtensionData.reactElement]),
114
+ },
115
+ output: [coreExtensionData.reactElement],
116
+ factory({ inputs }) {
117
+ return [
118
+ coreExtensionData.reactElement(
119
+ <div>
120
+ Example
121
+ {inputs.items.map(item => {
122
+ return <div>{item.get(coreExtensionData.reactElement)}</div>;
123
+ })}
124
+ </div>,
125
+ ),
126
+ ];
127
+ },
128
+ });
129
+ ```
130
+
131
+ - 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.
132
+ - 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.
133
+ - 2d21599: Added support for being able to override extension definitions.
134
+
135
+ ```tsx
136
+ const TestCard = EntityCardBlueprint.make({
137
+ ...
138
+ });
139
+
140
+ TestCard.override({
141
+ // override attachment points
142
+ attachTo: { id: 'something-else', input: 'overridden' },
143
+ // extend the config schema
144
+ config: {
145
+ schema: {
146
+ newConfig: z => z.string().optional(),
147
+ }
148
+ },
149
+ // override factory
150
+ *factory(originalFactory, { inputs, config }){
151
+ const originalOutput = originalFactory();
152
+
153
+ yield coreExentsionData.reactElement(
154
+ <Wrapping>
155
+ {originalOutput.get(coreExentsionData.reactElement)}
156
+ </Wrapping>
157
+ );
158
+ }
159
+ });
160
+
161
+ ```
162
+
163
+ - 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.
164
+
165
+ For example, the following code:
166
+
167
+ ```ts
168
+ export const myExtension =
169
+ createExtensionDataRef<MyType>('my-plugin.my-data');
170
+ ```
171
+
172
+ Should be updated to the following:
173
+
174
+ ```ts
175
+ export const myExtension = createExtensionDataRef<MyType>().with({
176
+ id: 'my-plugin.my-data',
177
+ });
178
+ ```
179
+
180
+ - 6349099: Added config input type to the extensions
181
+ - Updated dependencies
182
+ - @backstage/core-components@0.14.10
183
+ - @backstage/core-plugin-api@1.9.3
184
+ - @backstage/types@1.1.1
185
+ - @backstage/version-bridge@1.0.8
186
+
3
187
  ## 0.7.0-next.3
4
188
 
5
189
  ### 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
12
  attachTo: { id: "app", input: "apis" },
10
- output: [createApiExtension.factoryDataRef],
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: 'app', 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,KAAA,EAAO,OAAO,MAAO,EAAA;AAAA,EACrC,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;;;;"}
@@ -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: '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":";;;;;;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,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,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
13
  attachTo: { id: "app", input: "themes" },
11
- output: [createThemeExtension.themeDataRef],
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: 'app', 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,KAAA,EAAO,OAAO,QAAS,EAAA;AAAA,EACvC,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;;;;"}
@@ -1,19 +1,20 @@
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 { createTranslationExtension } from '../extensions/createTranslationExtension.esm.js';
6
6
 
7
+ const translationDataRef = createExtensionDataRef().with({ id: "core.translation.translation" });
7
8
  const TranslationBlueprint = createExtensionBlueprint({
8
9
  kind: "translation",
9
10
  attachTo: { id: "app", input: "translations" },
10
- output: [createTranslationExtension.translationDataRef],
11
+ output: [translationDataRef],
11
12
  dataRefs: {
12
- translation: createTranslationExtension.translationDataRef
13
+ translation: translationDataRef
13
14
  },
14
15
  factory: ({
15
16
  resource
16
- }) => [createTranslationExtension.translationDataRef(resource)]
17
+ }) => [translationDataRef(resource)]
17
18
  });
18
19
 
19
20
  export { TranslationBlueprint };
@@ -1 +1 @@
1
- {"version":3,"file":"TranslationBlueprint.esm.js","sources":["../../src/blueprints/TranslationBlueprint.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 { createTranslationExtension } from '../extensions/createTranslationExtension';\nimport { TranslationMessages, TranslationResource } from '../translation';\n\n/**\n * Creates an extension that adds translations to your app.\n *\n * @public\n */\nexport const TranslationBlueprint = createExtensionBlueprint({\n kind: 'translation',\n attachTo: { id: 'app', input: 'translations' },\n output: [createTranslationExtension.translationDataRef],\n dataRefs: {\n translation: createTranslationExtension.translationDataRef,\n },\n factory: ({\n resource,\n }: {\n resource: TranslationResource | TranslationMessages;\n }) => [createTranslationExtension.translationDataRef(resource)],\n});\n"],"names":[],"mappings":";;;;;;AAyBO,MAAM,uBAAuB,wBAAyB,CAAA;AAAA,EAC3D,IAAM,EAAA,aAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,KAAA,EAAO,OAAO,cAAe,EAAA;AAAA,EAC7C,MAAA,EAAQ,CAAC,0BAAA,CAA2B,kBAAkB,CAAA;AAAA,EACtD,QAAU,EAAA;AAAA,IACR,aAAa,0BAA2B,CAAA,kBAAA;AAAA,GAC1C;AAAA,EACA,SAAS,CAAC;AAAA,IACR,QAAA;AAAA,GAGI,KAAA,CAAC,0BAA2B,CAAA,kBAAA,CAAmB,QAAQ,CAAC,CAAA;AAChE,CAAC;;;;"}
1
+ {"version":3,"file":"TranslationBlueprint.esm.js","sources":["../../src/blueprints/TranslationBlueprint.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 { TranslationMessages, TranslationResource } from '../translation';\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.\n *\n * @public\n */\nexport const TranslationBlueprint = createExtensionBlueprint({\n kind: 'translation',\n attachTo: { id: 'app', 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":";;;;;;AAmBA,MAAM,qBAAqB,sBAEzB,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,gCAAgC,CAAA,CAAA;AAOxC,MAAM,uBAAuB,wBAAyB,CAAA;AAAA,EAC3D,IAAM,EAAA,aAAA;AAAA,EACN,QAAU,EAAA,EAAE,EAAI,EAAA,KAAA,EAAO,OAAO,cAAe,EAAA;AAAA,EAC7C,MAAA,EAAQ,CAAC,kBAAkB,CAAA;AAAA,EAC3B,QAAU,EAAA;AAAA,IACR,WAAa,EAAA,kBAAA;AAAA,GACf;AAAA,EACA,SAAS,CAAC;AAAA,IACR,QAAA;AAAA,GAGI,KAAA,CAAC,kBAAmB,CAAA,QAAQ,CAAC,CAAA;AACrC,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- import React, { Suspense, useEffect } from 'react';
1
+ import React, { Suspense, lazy, useEffect } from 'react';
2
2
  import { AnalyticsContext, useAnalytics } from '@backstage/core-plugin-api';
3
3
  import { ErrorBoundary } from './ErrorBoundary.esm.js';
4
4
  import { routableExtensionRenderedEvent } from '../core-plugin-api/src/analytics/Tracker.esm.js';
@@ -35,6 +35,15 @@ function ExtensionBoundary(props) {
35
35
  };
36
36
  return /* @__PURE__ */ React.createElement(Suspense, { fallback: /* @__PURE__ */ React.createElement(Progress, null) }, /* @__PURE__ */ React.createElement(ErrorBoundary, { plugin, Fallback: fallback }, /* @__PURE__ */ React.createElement(AnalyticsContext, { attributes }, /* @__PURE__ */ React.createElement(RouteTracker, { disableTracking: !(routable ?? doesOutputRoutePath) }, children))));
37
37
  }
38
+ ((ExtensionBoundary2) => {
39
+ function lazy$1(appNode, lazyElement) {
40
+ const ExtensionComponent = lazy(
41
+ () => lazyElement().then((element) => ({ default: () => element }))
42
+ );
43
+ return /* @__PURE__ */ React.createElement(ExtensionBoundary2, { node: appNode }, /* @__PURE__ */ React.createElement(ExtensionComponent, null));
44
+ }
45
+ ExtensionBoundary2.lazy = lazy$1;
46
+ })(ExtensionBoundary || (ExtensionBoundary = {}));
38
47
 
39
48
  export { ExtensionBoundary };
40
49
  //# sourceMappingURL=ExtensionBoundary.esm.js.map