@backstage/frontend-plugin-api 0.7.0-next.2 → 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 (64) hide show
  1. package/CHANGELOG.md +244 -0
  2. package/dist/blueprints/ApiBlueprint.esm.js +23 -0
  3. package/dist/blueprints/ApiBlueprint.esm.js.map +1 -0
  4. package/dist/blueprints/AppRootElementBlueprint.esm.js +18 -0
  5. package/dist/blueprints/AppRootElementBlueprint.esm.js.map +1 -0
  6. package/dist/blueprints/AppRootWrapperBlueprint.esm.js +25 -0
  7. package/dist/blueprints/AppRootWrapperBlueprint.esm.js.map +1 -0
  8. package/dist/blueprints/IconBundleBlueprint.esm.js.map +1 -0
  9. package/dist/blueprints/NavItemBlueprint.esm.js +34 -0
  10. package/dist/blueprints/NavItemBlueprint.esm.js.map +1 -0
  11. package/dist/blueprints/NavLogoBlueprint.esm.js +27 -0
  12. package/dist/blueprints/NavLogoBlueprint.esm.js.map +1 -0
  13. package/dist/blueprints/PageBlueprint.esm.js +34 -0
  14. package/dist/blueprints/PageBlueprint.esm.js.map +1 -0
  15. package/dist/blueprints/RouterBlueprint.esm.js +21 -0
  16. package/dist/blueprints/RouterBlueprint.esm.js.map +1 -0
  17. package/dist/blueprints/SignInPageBlueprint.esm.js +28 -0
  18. package/dist/blueprints/SignInPageBlueprint.esm.js.map +1 -0
  19. package/dist/blueprints/ThemeBlueprint.esm.js +22 -0
  20. package/dist/blueprints/ThemeBlueprint.esm.js.map +1 -0
  21. package/dist/blueprints/TranslationBlueprint.esm.js +21 -0
  22. package/dist/blueprints/TranslationBlueprint.esm.js.map +1 -0
  23. package/dist/components/ExtensionBoundary.esm.js +10 -1
  24. package/dist/components/ExtensionBoundary.esm.js.map +1 -1
  25. package/dist/extensions/createApiExtension.esm.js +3 -5
  26. package/dist/extensions/createApiExtension.esm.js.map +1 -1
  27. package/dist/extensions/createAppRootElementExtension.esm.js.map +1 -1
  28. package/dist/extensions/createAppRootWrapperExtension.esm.js +3 -3
  29. package/dist/extensions/createAppRootWrapperExtension.esm.js.map +1 -1
  30. package/dist/extensions/createComponentExtension.esm.js.map +1 -1
  31. package/dist/extensions/createNavItemExtension.esm.js +3 -3
  32. package/dist/extensions/createNavItemExtension.esm.js.map +1 -1
  33. package/dist/extensions/createNavLogoExtension.esm.js +3 -3
  34. package/dist/extensions/createNavLogoExtension.esm.js.map +1 -1
  35. package/dist/extensions/createPageExtension.esm.js.map +1 -1
  36. package/dist/extensions/createRouterExtension.esm.js +3 -3
  37. package/dist/extensions/createRouterExtension.esm.js.map +1 -1
  38. package/dist/extensions/createSignInPageExtension.esm.js +12 -2
  39. package/dist/extensions/createSignInPageExtension.esm.js.map +1 -1
  40. package/dist/extensions/createThemeExtension.esm.js +3 -5
  41. package/dist/extensions/createThemeExtension.esm.js.map +1 -1
  42. package/dist/extensions/createTranslationExtension.esm.js +3 -3
  43. package/dist/extensions/createTranslationExtension.esm.js.map +1 -1
  44. package/dist/index.d.ts +517 -128
  45. package/dist/index.esm.js +12 -2
  46. package/dist/index.esm.js.map +1 -1
  47. package/dist/wiring/createExtension.esm.js +75 -8
  48. package/dist/wiring/createExtension.esm.js.map +1 -1
  49. package/dist/wiring/createExtensionBlueprint.esm.js +38 -27
  50. package/dist/wiring/createExtensionBlueprint.esm.js.map +1 -1
  51. package/dist/wiring/createExtensionDataContainer.esm.js +31 -0
  52. package/dist/wiring/createExtensionDataContainer.esm.js.map +1 -0
  53. package/dist/wiring/createExtensionDataRef.esm.js.map +1 -1
  54. package/dist/wiring/createFrontendPlugin.esm.js +59 -0
  55. package/dist/wiring/createFrontendPlugin.esm.js.map +1 -0
  56. package/dist/wiring/resolveExtensionDefinition.esm.js +7 -1
  57. package/dist/wiring/resolveExtensionDefinition.esm.js.map +1 -1
  58. package/dist/wiring/resolveInputOverrides.esm.js +76 -0
  59. package/dist/wiring/resolveInputOverrides.esm.js.map +1 -0
  60. package/package.json +6 -6
  61. package/dist/extensions/IconBundleBlueprint.esm.js.map +0 -1
  62. package/dist/wiring/createPlugin.esm.js +0 -35
  63. package/dist/wiring/createPlugin.esm.js.map +0 -1
  64. /package/dist/{extensions → blueprints}/IconBundleBlueprint.esm.js +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,249 @@
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
+
187
+ ## 0.7.0-next.3
188
+
189
+ ### Patch Changes
190
+
191
+ - 6f72c2b: Fixing issue with extension blueprints `inputs` merging.
192
+ - 99abb6b: Support overriding of plugin extensions using the new `plugin.withOverrides` method.
193
+
194
+ ```tsx
195
+ import homePlugin from '@backstage/plugin-home';
196
+
197
+ export default homePlugin.withOverrides({
198
+ extensions: [
199
+ homePage.getExtension('page:home').override({
200
+ *factory(originalFactory) {
201
+ yield* originalFactory();
202
+ yield coreExtensionData.reactElement(<h1>My custom home page</h1>);
203
+ },
204
+ }),
205
+ ],
206
+ });
207
+ ```
208
+
209
+ - 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.
210
+ - 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.
211
+ - 2d21599: Added support for being able to override extension definitions.
212
+
213
+ ```tsx
214
+ const TestCard = EntityCardBlueprint.make({
215
+ ...
216
+ });
217
+
218
+ TestCard.override({
219
+ // override attachment points
220
+ attachTo: { id: 'something-else', input: 'overridden' },
221
+ // extend the config schema
222
+ config: {
223
+ schema: {
224
+ newConfig: z => z.string().optional(),
225
+ }
226
+ },
227
+ // override factory
228
+ *factory(originalFactory, { inputs, config }){
229
+ const originalOutput = originalFactory();
230
+
231
+ yield coreExentsionData.reactElement(
232
+ <Wrapping>
233
+ {originalOutput.get(coreExentsionData.reactElement)}
234
+ </Wrapping>
235
+ );
236
+ }
237
+ });
238
+
239
+ ```
240
+
241
+ - Updated dependencies
242
+ - @backstage/core-components@0.14.10-next.0
243
+ - @backstage/core-plugin-api@1.9.3
244
+ - @backstage/types@1.1.1
245
+ - @backstage/version-bridge@1.0.8
246
+
3
247
  ## 0.7.0-next.2
4
248
 
5
249
  ### Minor Changes
@@ -0,0 +1,23 @@
1
+ import '../wiring/coreExtensionData.esm.js';
2
+ import 'zod';
3
+ import 'zod-to-json-schema';
4
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
5
+ import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
6
+
7
+ const factoryDataRef = createExtensionDataRef().with({
8
+ id: "core.api.factory"
9
+ });
10
+ const ApiBlueprint = createExtensionBlueprint({
11
+ kind: "api",
12
+ attachTo: { id: "app", input: "apis" },
13
+ output: [factoryDataRef],
14
+ dataRefs: {
15
+ factory: factoryDataRef
16
+ },
17
+ *factory(params) {
18
+ yield factoryDataRef(params.factory);
19
+ }
20
+ });
21
+
22
+ export { ApiBlueprint };
23
+ //# sourceMappingURL=ApiBlueprint.esm.js.map
@@ -0,0 +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, 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;;;;"}
@@ -0,0 +1,18 @@
1
+ import { coreExtensionData } from '../wiring/coreExtensionData.esm.js';
2
+ import 'zod';
3
+ import 'zod-to-json-schema';
4
+ import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
5
+
6
+ const AppRootElementBlueprint = createExtensionBlueprint({
7
+ kind: "app-root-element",
8
+ attachTo: { id: "app/root", input: "elements" },
9
+ output: [coreExtensionData.reactElement],
10
+ *factory(params) {
11
+ yield coreExtensionData.reactElement(
12
+ typeof params.element === "function" ? params.element() : params.element
13
+ );
14
+ }
15
+ });
16
+
17
+ export { AppRootElementBlueprint };
18
+ //# sourceMappingURL=AppRootElementBlueprint.esm.js.map
@@ -0,0 +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 */\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;;;;"}
@@ -0,0 +1,25 @@
1
+ import React from 'react';
2
+ import '../wiring/coreExtensionData.esm.js';
3
+ import 'zod';
4
+ import 'zod-to-json-schema';
5
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
6
+ import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
7
+
8
+ const componentDataRef = createExtensionDataRef().with({ id: "app.root.wrapper" });
9
+ const AppRootWrapperBlueprint = createExtensionBlueprint({
10
+ kind: "app-root-wrapper",
11
+ attachTo: { id: "app/root", input: "wrappers" },
12
+ output: [componentDataRef],
13
+ dataRefs: {
14
+ component: componentDataRef
15
+ },
16
+ *factory(params) {
17
+ const Component = (props) => {
18
+ return /* @__PURE__ */ React.createElement(params.Component, null, props.children);
19
+ };
20
+ yield componentDataRef(Component);
21
+ }
22
+ });
23
+
24
+ export { AppRootWrapperBlueprint };
25
+ //# sourceMappingURL=AppRootWrapperBlueprint.esm.js.map
@@ -0,0 +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, 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;;;;"}
@@ -0,0 +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 */\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;;;;"}
@@ -0,0 +1,34 @@
1
+ import '../wiring/coreExtensionData.esm.js';
2
+ import 'zod';
3
+ import 'zod-to-json-schema';
4
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
5
+ import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
6
+
7
+ const targetDataRef = createExtensionDataRef().with({ id: "core.nav-item.target" });
8
+ const NavItemBlueprint = createExtensionBlueprint({
9
+ kind: "nav-item",
10
+ attachTo: { id: "app/nav", input: "items" },
11
+ output: [targetDataRef],
12
+ dataRefs: {
13
+ target: targetDataRef
14
+ },
15
+ factory: ({
16
+ icon,
17
+ routeRef,
18
+ title
19
+ }, { config }) => [
20
+ targetDataRef({
21
+ title: config.title ?? title,
22
+ icon,
23
+ routeRef
24
+ })
25
+ ],
26
+ config: {
27
+ schema: {
28
+ title: (z) => z.string().optional()
29
+ }
30
+ }
31
+ });
32
+
33
+ export { NavItemBlueprint };
34
+ //# sourceMappingURL=NavItemBlueprint.esm.js.map
@@ -0,0 +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, 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;;;;"}
@@ -0,0 +1,27 @@
1
+ import '../wiring/coreExtensionData.esm.js';
2
+ import 'zod';
3
+ import 'zod-to-json-schema';
4
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
5
+ import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
6
+
7
+ const logoElementsDataRef = createExtensionDataRef().with({ id: "core.nav-logo.logo-elements" });
8
+ const NavLogoBlueprint = createExtensionBlueprint({
9
+ kind: "nav-logo",
10
+ attachTo: { id: "app/nav", input: "logos" },
11
+ output: [logoElementsDataRef],
12
+ dataRefs: {
13
+ logoElements: logoElementsDataRef
14
+ },
15
+ *factory({
16
+ logoIcon,
17
+ logoFull
18
+ }) {
19
+ yield logoElementsDataRef({
20
+ logoIcon,
21
+ logoFull
22
+ });
23
+ }
24
+ });
25
+
26
+ export { NavLogoBlueprint };
27
+ //# sourceMappingURL=NavLogoBlueprint.esm.js.map
@@ -0,0 +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, 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;;;;"}
@@ -0,0 +1,34 @@
1
+ import { coreExtensionData } from '../wiring/coreExtensionData.esm.js';
2
+ import 'zod';
3
+ import 'zod-to-json-schema';
4
+ import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
5
+ import { ExtensionBoundary } from '../components/ExtensionBoundary.esm.js';
6
+
7
+ const PageBlueprint = createExtensionBlueprint({
8
+ kind: "page",
9
+ attachTo: { id: "app/routes", input: "routes" },
10
+ output: [
11
+ coreExtensionData.routePath,
12
+ coreExtensionData.reactElement,
13
+ coreExtensionData.routeRef.optional()
14
+ ],
15
+ config: {
16
+ schema: {
17
+ path: (z) => z.string().optional()
18
+ }
19
+ },
20
+ *factory({
21
+ defaultPath,
22
+ loader,
23
+ routeRef
24
+ }, { config, node }) {
25
+ yield coreExtensionData.routePath(config.path ?? defaultPath);
26
+ yield coreExtensionData.reactElement(ExtensionBoundary.lazy(node, loader));
27
+ if (routeRef) {
28
+ yield coreExtensionData.routeRef(routeRef);
29
+ }
30
+ }
31
+ });
32
+
33
+ export { PageBlueprint };
34
+ //# sourceMappingURL=PageBlueprint.esm.js.map
@@ -0,0 +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 */\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;;;;"}
@@ -0,0 +1,21 @@
1
+ import '../wiring/coreExtensionData.esm.js';
2
+ import 'zod';
3
+ import 'zod-to-json-schema';
4
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
5
+ import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
6
+
7
+ const componentDataRef = createExtensionDataRef().with({ id: "app.router.wrapper" });
8
+ const RouterBlueprint = createExtensionBlueprint({
9
+ kind: "app-router-component",
10
+ attachTo: { id: "app/root", input: "router" },
11
+ output: [componentDataRef],
12
+ dataRefs: {
13
+ component: componentDataRef
14
+ },
15
+ *factory({ Component }) {
16
+ yield componentDataRef(Component);
17
+ }
18
+ });
19
+
20
+ export { RouterBlueprint };
21
+ //# sourceMappingURL=RouterBlueprint.esm.js.map
@@ -0,0 +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 */\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;;;;"}
@@ -0,0 +1,28 @@
1
+ import React, { lazy } from 'react';
2
+ import '../wiring/coreExtensionData.esm.js';
3
+ import 'zod';
4
+ import 'zod-to-json-schema';
5
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
6
+ import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
7
+ import { ExtensionBoundary } from '../components/ExtensionBoundary.esm.js';
8
+
9
+ const componentDataRef = createExtensionDataRef().with({ id: "core.sign-in-page.component" });
10
+ const SignInPageBlueprint = createExtensionBlueprint({
11
+ kind: "sign-in-page",
12
+ attachTo: { id: "app/root", input: "signInPage" },
13
+ output: [componentDataRef],
14
+ dataRefs: {
15
+ component: componentDataRef
16
+ },
17
+ *factory({
18
+ loader
19
+ }, { node }) {
20
+ const ExtensionComponent = lazy(
21
+ () => loader().then((component) => ({ default: component }))
22
+ );
23
+ yield componentDataRef((props) => /* @__PURE__ */ React.createElement(ExtensionBoundary, { node, routable: true }, /* @__PURE__ */ React.createElement(ExtensionComponent, { ...props })));
24
+ }
25
+ });
26
+
27
+ export { SignInPageBlueprint };
28
+ //# sourceMappingURL=SignInPageBlueprint.esm.js.map
@@ -0,0 +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 */\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;;;;"}
@@ -0,0 +1,22 @@
1
+ import '../wiring/coreExtensionData.esm.js';
2
+ import 'zod';
3
+ import 'zod-to-json-schema';
4
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
5
+ import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
6
+
7
+ const themeDataRef = createExtensionDataRef().with({
8
+ id: "core.theme.theme"
9
+ });
10
+ const ThemeBlueprint = createExtensionBlueprint({
11
+ kind: "theme",
12
+ namespace: "app",
13
+ attachTo: { id: "app", input: "themes" },
14
+ output: [themeDataRef],
15
+ dataRefs: {
16
+ theme: themeDataRef
17
+ },
18
+ factory: ({ theme }) => [themeDataRef(theme)]
19
+ });
20
+
21
+ export { ThemeBlueprint };
22
+ //# sourceMappingURL=ThemeBlueprint.esm.js.map
@@ -0,0 +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, 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;;;;"}
@@ -0,0 +1,21 @@
1
+ import '../wiring/coreExtensionData.esm.js';
2
+ import 'zod';
3
+ import 'zod-to-json-schema';
4
+ import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
5
+ import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
6
+
7
+ const translationDataRef = createExtensionDataRef().with({ id: "core.translation.translation" });
8
+ const TranslationBlueprint = createExtensionBlueprint({
9
+ kind: "translation",
10
+ attachTo: { id: "app", input: "translations" },
11
+ output: [translationDataRef],
12
+ dataRefs: {
13
+ translation: translationDataRef
14
+ },
15
+ factory: ({
16
+ resource
17
+ }) => [translationDataRef(resource)]
18
+ });
19
+
20
+ export { TranslationBlueprint };
21
+ //# sourceMappingURL=TranslationBlueprint.esm.js.map
@@ -0,0 +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, 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
@@ -1 +1 @@
1
- {"version":3,"file":"ExtensionBoundary.esm.js","sources":["../../src/components/ExtensionBoundary.tsx"],"sourcesContent":["/*\n * Copyright 2023 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, {\n PropsWithChildren,\n ReactNode,\n Suspense,\n useEffect,\n} from 'react';\nimport { AnalyticsContext, useAnalytics } from '@backstage/core-plugin-api';\nimport { ErrorBoundary } from './ErrorBoundary';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { routableExtensionRenderedEvent } from '../../../core-plugin-api/src/analytics/Tracker';\nimport { AppNode, useComponentRef } from '../apis';\nimport { coreComponentRefs } from './coreComponentRefs';\nimport { coreExtensionData } from '../wiring';\n\ntype RouteTrackerProps = PropsWithChildren<{\n disableTracking?: boolean;\n}>;\n\nconst RouteTracker = (props: RouteTrackerProps) => {\n const { disableTracking, children } = props;\n const analytics = useAnalytics();\n\n // This event, never exposed to end-users of the analytics API,\n // helps inform which extension metadata gets associated with a\n // navigation event when the route navigated to is a gathered\n // mountpoint.\n useEffect(() => {\n if (disableTracking) return;\n analytics.captureEvent(routableExtensionRenderedEvent, '');\n }, [analytics, disableTracking]);\n\n return <>{children}</>;\n};\n\n/** @public */\nexport interface ExtensionBoundaryProps {\n node: AppNode;\n /**\n * This explicitly marks the extension as routable for the purpose of\n * capturing analytics events. If not provided, the extension boundary will be\n * marked as routable if it outputs a routePath.\n */\n routable?: boolean;\n children: ReactNode;\n}\n\n/** @public */\nexport function ExtensionBoundary(props: ExtensionBoundaryProps) {\n const { node, routable, children } = props;\n\n const doesOutputRoutePath = Boolean(\n node.instance?.getData(coreExtensionData.routePath),\n );\n\n const plugin = node.spec.source;\n const Progress = useComponentRef(coreComponentRefs.progress);\n const fallback = useComponentRef(coreComponentRefs.errorBoundaryFallback);\n\n // Skipping \"routeRef\" attribute in the new system, the extension \"id\" should provide more insight\n const attributes = {\n extensionId: node.spec.id,\n pluginId: node.spec.source?.id ?? 'app',\n };\n\n return (\n <Suspense fallback={<Progress />}>\n <ErrorBoundary plugin={plugin} Fallback={fallback}>\n <AnalyticsContext attributes={attributes}>\n <RouteTracker disableTracking={!(routable ?? doesOutputRoutePath)}>\n {children}\n </RouteTracker>\n </AnalyticsContext>\n </ErrorBoundary>\n </Suspense>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAkCA,MAAM,YAAA,GAAe,CAAC,KAA6B,KAAA;AACjD,EAAM,MAAA,EAAE,eAAiB,EAAA,QAAA,EAAa,GAAA,KAAA,CAAA;AACtC,EAAA,MAAM,YAAY,YAAa,EAAA,CAAA;AAM/B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,eAAiB,EAAA,OAAA;AACrB,IAAU,SAAA,CAAA,YAAA,CAAa,gCAAgC,EAAE,CAAA,CAAA;AAAA,GACxD,EAAA,CAAC,SAAW,EAAA,eAAe,CAAC,CAAA,CAAA;AAE/B,EAAA,iEAAU,QAAS,CAAA,CAAA;AACrB,CAAA,CAAA;AAeO,SAAS,kBAAkB,KAA+B,EAAA;AAC/D,EAAA,MAAM,EAAE,IAAA,EAAM,QAAU,EAAA,QAAA,EAAa,GAAA,KAAA,CAAA;AAErC,EAAA,MAAM,mBAAsB,GAAA,OAAA;AAAA,IAC1B,IAAK,CAAA,QAAA,EAAU,OAAQ,CAAA,iBAAA,CAAkB,SAAS,CAAA;AAAA,GACpD,CAAA;AAEA,EAAM,MAAA,MAAA,GAAS,KAAK,IAAK,CAAA,MAAA,CAAA;AACzB,EAAM,MAAA,QAAA,GAAW,eAAgB,CAAA,iBAAA,CAAkB,QAAQ,CAAA,CAAA;AAC3D,EAAM,MAAA,QAAA,GAAW,eAAgB,CAAA,iBAAA,CAAkB,qBAAqB,CAAA,CAAA;AAGxE,EAAA,MAAM,UAAa,GAAA;AAAA,IACjB,WAAA,EAAa,KAAK,IAAK,CAAA,EAAA;AAAA,IACvB,QAAU,EAAA,IAAA,CAAK,IAAK,CAAA,MAAA,EAAQ,EAAM,IAAA,KAAA;AAAA,GACpC,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,YAAS,QAAU,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAS,CAC5B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,MAAA,EAAgB,QAAU,EAAA,QAAA,EAAA,sCACtC,gBAAiB,EAAA,EAAA,UAAA,EAAA,kBACf,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,EAAa,eAAiB,EAAA,EAAE,YAAY,mBAC1C,CAAA,EAAA,EAAA,QACH,CACF,CACF,CACF,CAAA,CAAA;AAEJ;;;;"}
1
+ {"version":3,"file":"ExtensionBoundary.esm.js","sources":["../../src/components/ExtensionBoundary.tsx"],"sourcesContent":["/*\n * Copyright 2023 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, {\n PropsWithChildren,\n ReactNode,\n Suspense,\n useEffect,\n lazy as reactLazy,\n} from 'react';\nimport { AnalyticsContext, useAnalytics } from '@backstage/core-plugin-api';\nimport { ErrorBoundary } from './ErrorBoundary';\n// eslint-disable-next-line @backstage/no-relative-monorepo-imports\nimport { routableExtensionRenderedEvent } from '../../../core-plugin-api/src/analytics/Tracker';\nimport { AppNode, useComponentRef } from '../apis';\nimport { coreComponentRefs } from './coreComponentRefs';\nimport { coreExtensionData } from '../wiring';\n\ntype RouteTrackerProps = PropsWithChildren<{\n disableTracking?: boolean;\n}>;\n\nconst RouteTracker = (props: RouteTrackerProps) => {\n const { disableTracking, children } = props;\n const analytics = useAnalytics();\n\n // This event, never exposed to end-users of the analytics API,\n // helps inform which extension metadata gets associated with a\n // navigation event when the route navigated to is a gathered\n // mountpoint.\n useEffect(() => {\n if (disableTracking) return;\n analytics.captureEvent(routableExtensionRenderedEvent, '');\n }, [analytics, disableTracking]);\n\n return <>{children}</>;\n};\n\n/** @public */\nexport interface ExtensionBoundaryProps {\n node: AppNode;\n /**\n * This explicitly marks the extension as routable for the purpose of\n * capturing analytics events. If not provided, the extension boundary will be\n * marked as routable if it outputs a routePath.\n */\n routable?: boolean;\n children: ReactNode;\n}\n\n/** @public */\nexport function ExtensionBoundary(props: ExtensionBoundaryProps) {\n const { node, routable, children } = props;\n\n const doesOutputRoutePath = Boolean(\n node.instance?.getData(coreExtensionData.routePath),\n );\n\n const plugin = node.spec.source;\n const Progress = useComponentRef(coreComponentRefs.progress);\n const fallback = useComponentRef(coreComponentRefs.errorBoundaryFallback);\n\n // Skipping \"routeRef\" attribute in the new system, the extension \"id\" should provide more insight\n const attributes = {\n extensionId: node.spec.id,\n pluginId: node.spec.source?.id ?? 'app',\n };\n\n return (\n <Suspense fallback={<Progress />}>\n <ErrorBoundary plugin={plugin} Fallback={fallback}>\n <AnalyticsContext attributes={attributes}>\n <RouteTracker disableTracking={!(routable ?? doesOutputRoutePath)}>\n {children}\n </RouteTracker>\n </AnalyticsContext>\n </ErrorBoundary>\n </Suspense>\n );\n}\n\n/** @public */\nexport namespace ExtensionBoundary {\n export function lazy(\n appNode: AppNode,\n lazyElement: () => Promise<JSX.Element>,\n ): JSX.Element {\n const ExtensionComponent = reactLazy(() =>\n lazyElement().then(element => ({ default: () => element })),\n );\n return (\n <ExtensionBoundary node={appNode}>\n <ExtensionComponent />\n </ExtensionBoundary>\n );\n }\n}\n"],"names":["ExtensionBoundary","lazy","reactLazy"],"mappings":";;;;;;;;;;;;;;AAmCA,MAAM,YAAA,GAAe,CAAC,KAA6B,KAAA;AACjD,EAAM,MAAA,EAAE,eAAiB,EAAA,QAAA,EAAa,GAAA,KAAA,CAAA;AACtC,EAAA,MAAM,YAAY,YAAa,EAAA,CAAA;AAM/B,EAAA,SAAA,CAAU,MAAM;AACd,IAAA,IAAI,eAAiB,EAAA,OAAA;AACrB,IAAU,SAAA,CAAA,YAAA,CAAa,gCAAgC,EAAE,CAAA,CAAA;AAAA,GACxD,EAAA,CAAC,SAAW,EAAA,eAAe,CAAC,CAAA,CAAA;AAE/B,EAAA,iEAAU,QAAS,CAAA,CAAA;AACrB,CAAA,CAAA;AAeO,SAAS,kBAAkB,KAA+B,EAAA;AAC/D,EAAA,MAAM,EAAE,IAAA,EAAM,QAAU,EAAA,QAAA,EAAa,GAAA,KAAA,CAAA;AAErC,EAAA,MAAM,mBAAsB,GAAA,OAAA;AAAA,IAC1B,IAAK,CAAA,QAAA,EAAU,OAAQ,CAAA,iBAAA,CAAkB,SAAS,CAAA;AAAA,GACpD,CAAA;AAEA,EAAM,MAAA,MAAA,GAAS,KAAK,IAAK,CAAA,MAAA,CAAA;AACzB,EAAM,MAAA,QAAA,GAAW,eAAgB,CAAA,iBAAA,CAAkB,QAAQ,CAAA,CAAA;AAC3D,EAAM,MAAA,QAAA,GAAW,eAAgB,CAAA,iBAAA,CAAkB,qBAAqB,CAAA,CAAA;AAGxE,EAAA,MAAM,UAAa,GAAA;AAAA,IACjB,WAAA,EAAa,KAAK,IAAK,CAAA,EAAA;AAAA,IACvB,QAAU,EAAA,IAAA,CAAK,IAAK,CAAA,MAAA,EAAQ,EAAM,IAAA,KAAA;AAAA,GACpC,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,YAAS,QAAU,kBAAA,KAAA,CAAA,aAAA,CAAC,cAAS,CAC5B,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,EAAA,EAAA,MAAA,EAAgB,QAAU,EAAA,QAAA,EAAA,sCACtC,gBAAiB,EAAA,EAAA,UAAA,EAAA,kBACf,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA,EAAa,eAAiB,EAAA,EAAE,YAAY,mBAC1C,CAAA,EAAA,EAAA,QACH,CACF,CACF,CACF,CAAA,CAAA;AAEJ,CAAA;AAAA,CAGO,CAAUA,kBAAV,KAAA;AACE,EAAS,SAAAC,MAAA,CACd,SACA,WACa,EAAA;AACb,IAAA,MAAM,kBAAqB,GAAAC,IAAA;AAAA,MAAU,MACnC,aAAc,CAAA,IAAA,CAAK,cAAY,EAAE,OAAA,EAAS,MAAM,OAAA,EAAU,CAAA,CAAA;AAAA,KAC5D,CAAA;AACA,IAAA,2CACGF,kBAAA,EAAA,EAAkB,MAAM,OACvB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,wBAAmB,CACtB,CAAA,CAAA;AAAA,GAEJ;AAZO,EAAAA,kBAAS,CAAA,IAAA,GAAAC,MAAA,CAAA;AAAA,CADD,EAAA,iBAAA,KAAA,iBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}