@backstage/frontend-plugin-api 0.7.0-next.2 → 0.7.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/dist/blueprints/ApiBlueprint.esm.js +20 -0
- package/dist/blueprints/ApiBlueprint.esm.js.map +1 -0
- package/dist/blueprints/AppRootElementBlueprint.esm.js +18 -0
- package/dist/blueprints/AppRootElementBlueprint.esm.js.map +1 -0
- package/dist/blueprints/AppRootWrapperBlueprint.esm.js +24 -0
- package/dist/blueprints/AppRootWrapperBlueprint.esm.js.map +1 -0
- package/dist/{extensions → blueprints}/IconBundleBlueprint.esm.js.map +1 -1
- package/dist/blueprints/NavItemBlueprint.esm.js +33 -0
- package/dist/blueprints/NavItemBlueprint.esm.js.map +1 -0
- package/dist/blueprints/NavLogoBlueprint.esm.js +26 -0
- package/dist/blueprints/NavLogoBlueprint.esm.js.map +1 -0
- package/dist/blueprints/PageBlueprint.esm.js +40 -0
- package/dist/blueprints/PageBlueprint.esm.js.map +1 -0
- package/dist/blueprints/RouterBlueprint.esm.js +20 -0
- package/dist/blueprints/RouterBlueprint.esm.js.map +1 -0
- package/dist/blueprints/SignInPageBlueprint.esm.js +27 -0
- package/dist/blueprints/SignInPageBlueprint.esm.js.map +1 -0
- package/dist/blueprints/ThemeBlueprint.esm.js +21 -0
- package/dist/blueprints/ThemeBlueprint.esm.js.map +1 -0
- package/dist/blueprints/TranslationBlueprint.esm.js +20 -0
- package/dist/blueprints/TranslationBlueprint.esm.js.map +1 -0
- package/dist/extensions/createApiExtension.esm.js.map +1 -1
- package/dist/extensions/createAppRootElementExtension.esm.js.map +1 -1
- package/dist/extensions/createAppRootWrapperExtension.esm.js.map +1 -1
- package/dist/extensions/createNavItemExtension.esm.js.map +1 -1
- package/dist/extensions/createNavLogoExtension.esm.js.map +1 -1
- package/dist/extensions/createPageExtension.esm.js.map +1 -1
- package/dist/extensions/createRouterExtension.esm.js.map +1 -1
- package/dist/extensions/createSignInPageExtension.esm.js.map +1 -1
- package/dist/extensions/createThemeExtension.esm.js.map +1 -1
- package/dist/extensions/createTranslationExtension.esm.js.map +1 -1
- package/dist/index.d.ts +364 -122
- package/dist/index.esm.js +11 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/wiring/createExtension.esm.js +75 -8
- package/dist/wiring/createExtension.esm.js.map +1 -1
- package/dist/wiring/createExtensionBlueprint.esm.js +38 -27
- package/dist/wiring/createExtensionBlueprint.esm.js.map +1 -1
- package/dist/wiring/createExtensionDataContainer.esm.js +31 -0
- package/dist/wiring/createExtensionDataContainer.esm.js.map +1 -0
- package/dist/wiring/createPlugin.esm.js +28 -5
- package/dist/wiring/createPlugin.esm.js.map +1 -1
- package/dist/wiring/resolveExtensionDefinition.esm.js +7 -1
- package/dist/wiring/resolveExtensionDefinition.esm.js.map +1 -1
- package/dist/wiring/resolveInputOverrides.esm.js +76 -0
- package/dist/wiring/resolveInputOverrides.esm.js.map +1 -0
- package/package.json +4 -4
- /package/dist/{extensions → blueprints}/IconBundleBlueprint.esm.js +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
# @backstage/frontend-plugin-api
|
|
2
2
|
|
|
3
|
+
## 0.7.0-next.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6f72c2b: Fixing issue with extension blueprints `inputs` merging.
|
|
8
|
+
- 99abb6b: Support overriding of plugin extensions using the new `plugin.withOverrides` method.
|
|
9
|
+
|
|
10
|
+
```tsx
|
|
11
|
+
import homePlugin from '@backstage/plugin-home';
|
|
12
|
+
|
|
13
|
+
export default homePlugin.withOverrides({
|
|
14
|
+
extensions: [
|
|
15
|
+
homePage.getExtension('page:home').override({
|
|
16
|
+
*factory(originalFactory) {
|
|
17
|
+
yield* originalFactory();
|
|
18
|
+
yield coreExtensionData.reactElement(<h1>My custom home page</h1>);
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
],
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- 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.
|
|
26
|
+
- 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.
|
|
27
|
+
- 2d21599: Added support for being able to override extension definitions.
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
const TestCard = EntityCardBlueprint.make({
|
|
31
|
+
...
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
TestCard.override({
|
|
35
|
+
// override attachment points
|
|
36
|
+
attachTo: { id: 'something-else', input: 'overridden' },
|
|
37
|
+
// extend the config schema
|
|
38
|
+
config: {
|
|
39
|
+
schema: {
|
|
40
|
+
newConfig: z => z.string().optional(),
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
// override factory
|
|
44
|
+
*factory(originalFactory, { inputs, config }){
|
|
45
|
+
const originalOutput = originalFactory();
|
|
46
|
+
|
|
47
|
+
yield coreExentsionData.reactElement(
|
|
48
|
+
<Wrapping>
|
|
49
|
+
{originalOutput.get(coreExentsionData.reactElement)}
|
|
50
|
+
</Wrapping>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
- Updated dependencies
|
|
58
|
+
- @backstage/core-components@0.14.10-next.0
|
|
59
|
+
- @backstage/core-plugin-api@1.9.3
|
|
60
|
+
- @backstage/types@1.1.1
|
|
61
|
+
- @backstage/version-bridge@1.0.8
|
|
62
|
+
|
|
3
63
|
## 0.7.0-next.2
|
|
4
64
|
|
|
5
65
|
### Minor Changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import '../wiring/coreExtensionData.esm.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import 'zod-to-json-schema';
|
|
4
|
+
import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
|
|
5
|
+
import { createApiExtension } from '../extensions/createApiExtension.esm.js';
|
|
6
|
+
|
|
7
|
+
const ApiBlueprint = createExtensionBlueprint({
|
|
8
|
+
kind: "api",
|
|
9
|
+
attachTo: { id: "app", input: "apis" },
|
|
10
|
+
output: [createApiExtension.factoryDataRef],
|
|
11
|
+
dataRefs: {
|
|
12
|
+
factory: createApiExtension.factoryDataRef
|
|
13
|
+
},
|
|
14
|
+
*factory(params) {
|
|
15
|
+
yield createApiExtension.factoryDataRef(params.factory);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export { ApiBlueprint };
|
|
20
|
+
//# 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 } 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;;;;"}
|
|
@@ -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 */\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;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import '../wiring/coreExtensionData.esm.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import 'zod-to-json-schema';
|
|
5
|
+
import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
|
|
6
|
+
import { createAppRootWrapperExtension } from '../extensions/createAppRootWrapperExtension.esm.js';
|
|
7
|
+
|
|
8
|
+
const AppRootWrapperBlueprint = createExtensionBlueprint({
|
|
9
|
+
kind: "app-root-wrapper",
|
|
10
|
+
attachTo: { id: "app/root", input: "wrappers" },
|
|
11
|
+
output: [createAppRootWrapperExtension.componentDataRef],
|
|
12
|
+
dataRefs: {
|
|
13
|
+
component: createAppRootWrapperExtension.componentDataRef
|
|
14
|
+
},
|
|
15
|
+
*factory(params) {
|
|
16
|
+
const Component = (props) => {
|
|
17
|
+
return /* @__PURE__ */ React.createElement(params.Component, null, props.children);
|
|
18
|
+
};
|
|
19
|
+
yield createAppRootWrapperExtension.componentDataRef(Component);
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export { AppRootWrapperBlueprint };
|
|
24
|
+
//# 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 } 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconBundleBlueprint.esm.js","sources":["../../src/
|
|
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;;;;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import '../wiring/coreExtensionData.esm.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import 'zod-to-json-schema';
|
|
4
|
+
import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
|
|
5
|
+
import { createNavItemExtension } from '../extensions/createNavItemExtension.esm.js';
|
|
6
|
+
|
|
7
|
+
const NavItemBlueprint = createExtensionBlueprint({
|
|
8
|
+
kind: "nav-item",
|
|
9
|
+
attachTo: { id: "app/nav", input: "items" },
|
|
10
|
+
output: [createNavItemExtension.targetDataRef],
|
|
11
|
+
dataRefs: {
|
|
12
|
+
target: createNavItemExtension.targetDataRef
|
|
13
|
+
},
|
|
14
|
+
factory: ({
|
|
15
|
+
icon,
|
|
16
|
+
routeRef,
|
|
17
|
+
title
|
|
18
|
+
}, { config }) => [
|
|
19
|
+
createNavItemExtension.targetDataRef({
|
|
20
|
+
title: config.title ?? title,
|
|
21
|
+
icon,
|
|
22
|
+
routeRef
|
|
23
|
+
})
|
|
24
|
+
],
|
|
25
|
+
config: {
|
|
26
|
+
schema: {
|
|
27
|
+
title: (z) => z.string().optional()
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { NavItemBlueprint };
|
|
33
|
+
//# 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 } 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;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import '../wiring/coreExtensionData.esm.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import 'zod-to-json-schema';
|
|
4
|
+
import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
|
|
5
|
+
import { createNavLogoExtension } from '../extensions/createNavLogoExtension.esm.js';
|
|
6
|
+
|
|
7
|
+
const NavLogoBlueprint = createExtensionBlueprint({
|
|
8
|
+
kind: "nav-logo",
|
|
9
|
+
attachTo: { id: "app/nav", input: "logos" },
|
|
10
|
+
output: [createNavLogoExtension.logoElementsDataRef],
|
|
11
|
+
dataRefs: {
|
|
12
|
+
logoElements: createNavLogoExtension.logoElementsDataRef
|
|
13
|
+
},
|
|
14
|
+
*factory({
|
|
15
|
+
logoIcon,
|
|
16
|
+
logoFull
|
|
17
|
+
}) {
|
|
18
|
+
yield createNavLogoExtension.logoElementsDataRef({
|
|
19
|
+
logoIcon,
|
|
20
|
+
logoFull
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { NavLogoBlueprint };
|
|
26
|
+
//# 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 } 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;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, { lazy } from 'react';
|
|
2
|
+
import { coreExtensionData } from '../wiring/coreExtensionData.esm.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import 'zod-to-json-schema';
|
|
5
|
+
import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
|
|
6
|
+
import { ExtensionBoundary } from '../components/ExtensionBoundary.esm.js';
|
|
7
|
+
|
|
8
|
+
const PageBlueprint = createExtensionBlueprint({
|
|
9
|
+
kind: "page",
|
|
10
|
+
attachTo: { id: "app/routes", input: "routes" },
|
|
11
|
+
output: [
|
|
12
|
+
coreExtensionData.routePath,
|
|
13
|
+
coreExtensionData.reactElement,
|
|
14
|
+
coreExtensionData.routeRef.optional()
|
|
15
|
+
],
|
|
16
|
+
config: {
|
|
17
|
+
schema: {
|
|
18
|
+
path: (z) => z.string().optional()
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
*factory({
|
|
22
|
+
defaultPath,
|
|
23
|
+
loader,
|
|
24
|
+
routeRef
|
|
25
|
+
}, { config, node }) {
|
|
26
|
+
const ExtensionComponent = lazy(
|
|
27
|
+
() => loader().then((element) => ({ default: () => element }))
|
|
28
|
+
);
|
|
29
|
+
yield coreExtensionData.routePath(config.path ?? defaultPath);
|
|
30
|
+
yield coreExtensionData.reactElement(
|
|
31
|
+
/* @__PURE__ */ React.createElement(ExtensionBoundary, { node }, /* @__PURE__ */ React.createElement(ExtensionComponent, null))
|
|
32
|
+
);
|
|
33
|
+
if (routeRef) {
|
|
34
|
+
yield coreExtensionData.routeRef(routeRef);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export { PageBlueprint };
|
|
40
|
+
//# 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 */\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;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import '../wiring/coreExtensionData.esm.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import 'zod-to-json-schema';
|
|
4
|
+
import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
|
|
5
|
+
import { createRouterExtension } from '../extensions/createRouterExtension.esm.js';
|
|
6
|
+
|
|
7
|
+
const RouterBlueprint = createExtensionBlueprint({
|
|
8
|
+
kind: "app-router-component",
|
|
9
|
+
attachTo: { id: "app/root", input: "router" },
|
|
10
|
+
output: [createRouterExtension.componentDataRef],
|
|
11
|
+
dataRefs: {
|
|
12
|
+
component: createRouterExtension.componentDataRef
|
|
13
|
+
},
|
|
14
|
+
*factory({ Component }) {
|
|
15
|
+
yield createRouterExtension.componentDataRef(Component);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export { RouterBlueprint };
|
|
20
|
+
//# 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 */\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;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { lazy } from 'react';
|
|
2
|
+
import '../wiring/coreExtensionData.esm.js';
|
|
3
|
+
import 'zod';
|
|
4
|
+
import 'zod-to-json-schema';
|
|
5
|
+
import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
|
|
6
|
+
import { createSignInPageExtension } from '../extensions/createSignInPageExtension.esm.js';
|
|
7
|
+
import { ExtensionBoundary } from '../components/ExtensionBoundary.esm.js';
|
|
8
|
+
|
|
9
|
+
const SignInPageBlueprint = createExtensionBlueprint({
|
|
10
|
+
kind: "sign-in-page",
|
|
11
|
+
attachTo: { id: "app/root", input: "signInPage" },
|
|
12
|
+
output: [createSignInPageExtension.componentDataRef],
|
|
13
|
+
dataRefs: {
|
|
14
|
+
component: createSignInPageExtension.componentDataRef
|
|
15
|
+
},
|
|
16
|
+
*factory({
|
|
17
|
+
loader
|
|
18
|
+
}, { node }) {
|
|
19
|
+
const ExtensionComponent = lazy(
|
|
20
|
+
() => loader().then((component) => ({ default: component }))
|
|
21
|
+
);
|
|
22
|
+
yield createSignInPageExtension.componentDataRef((props) => /* @__PURE__ */ React.createElement(ExtensionBoundary, { node, routable: true }, /* @__PURE__ */ React.createElement(ExtensionComponent, { ...props })));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { SignInPageBlueprint };
|
|
27
|
+
//# 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 */\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;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import '../wiring/coreExtensionData.esm.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import 'zod-to-json-schema';
|
|
4
|
+
import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
|
|
5
|
+
import { createThemeExtension } from '../extensions/createThemeExtension.esm.js';
|
|
6
|
+
|
|
7
|
+
const ThemeBlueprint = createExtensionBlueprint({
|
|
8
|
+
kind: "theme",
|
|
9
|
+
namespace: "app",
|
|
10
|
+
attachTo: { id: "app", input: "themes" },
|
|
11
|
+
output: [createThemeExtension.themeDataRef],
|
|
12
|
+
dataRefs: {
|
|
13
|
+
theme: createThemeExtension.themeDataRef
|
|
14
|
+
},
|
|
15
|
+
factory: ({ theme }) => [
|
|
16
|
+
createThemeExtension.themeDataRef(theme)
|
|
17
|
+
]
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export { ThemeBlueprint };
|
|
21
|
+
//# 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 } 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;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import '../wiring/coreExtensionData.esm.js';
|
|
2
|
+
import 'zod';
|
|
3
|
+
import 'zod-to-json-schema';
|
|
4
|
+
import { createExtensionBlueprint } from '../wiring/createExtensionBlueprint.esm.js';
|
|
5
|
+
import { createTranslationExtension } from '../extensions/createTranslationExtension.esm.js';
|
|
6
|
+
|
|
7
|
+
const TranslationBlueprint = createExtensionBlueprint({
|
|
8
|
+
kind: "translation",
|
|
9
|
+
attachTo: { id: "app", input: "translations" },
|
|
10
|
+
output: [createTranslationExtension.translationDataRef],
|
|
11
|
+
dataRefs: {
|
|
12
|
+
translation: createTranslationExtension.translationDataRef
|
|
13
|
+
},
|
|
14
|
+
factory: ({
|
|
15
|
+
resource
|
|
16
|
+
}) => [createTranslationExtension.translationDataRef(resource)]
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export { TranslationBlueprint };
|
|
20
|
+
//# 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 } 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApiExtension.esm.js","sources":["../../src/extensions/createApiExtension.ts"],"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 { AnyApiFactory, AnyApiRef } from '@backstage/core-plugin-api';\nimport { PortableSchema } from '../schema';\nimport {\n ResolvedExtensionInputs,\n createExtension,\n createExtensionDataRef,\n} from '../wiring';\nimport { AnyExtensionInputMap } from '../wiring/createExtension';\nimport { Expand } from '../types';\n\n
|
|
1
|
+
{"version":3,"file":"createApiExtension.esm.js","sources":["../../src/extensions/createApiExtension.ts"],"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 { AnyApiFactory, AnyApiRef } from '@backstage/core-plugin-api';\nimport { PortableSchema } from '../schema';\nimport {\n ResolvedExtensionInputs,\n createExtension,\n createExtensionDataRef,\n} from '../wiring';\nimport { AnyExtensionInputMap } from '../wiring/createExtension';\nimport { Expand } from '../types';\n\n/**\n * @public\n * @deprecated Use {@link ApiBlueprint} instead.\n */\nexport function createApiExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(\n options: (\n | {\n api: AnyApiRef;\n factory: (options: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => AnyApiFactory;\n }\n | {\n factory: AnyApiFactory;\n }\n ) & {\n configSchema?: PortableSchema<TConfig>;\n inputs?: TInputs;\n },\n) {\n const { factory, configSchema, inputs: extensionInputs } = options;\n\n const apiRef =\n 'api' in options ? options.api : (factory as { api: AnyApiRef }).api;\n\n return createExtension({\n kind: 'api',\n // Since ApiRef IDs use a global namespace we use the namespace here in order to override\n // potential plugin IDs and always end up with the format `api:<api-ref-id>`\n namespace: apiRef.id,\n attachTo: { id: 'app', input: 'apis' },\n inputs: extensionInputs,\n configSchema,\n output: {\n api: createApiExtension.factoryDataRef,\n },\n factory({ config, inputs }) {\n if (typeof factory === 'function') {\n return { api: factory({ config, inputs }) };\n }\n return { api: factory };\n },\n });\n}\n\n/** @public */\nexport namespace createApiExtension {\n export const factoryDataRef = createExtensionDataRef<AnyApiFactory>().with({\n id: 'core.api.factory',\n });\n}\n"],"names":["createApiExtension"],"mappings":";;;;AA8BO,SAAS,mBAId,OAeA,EAAA;AACA,EAAA,MAAM,EAAE,OAAA,EAAS,YAAc,EAAA,MAAA,EAAQ,iBAAoB,GAAA,OAAA,CAAA;AAE3D,EAAA,MAAM,MACJ,GAAA,KAAA,IAAS,OAAU,GAAA,OAAA,CAAQ,MAAO,OAA+B,CAAA,GAAA,CAAA;AAEnE,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,KAAA;AAAA;AAAA;AAAA,IAGN,WAAW,MAAO,CAAA,EAAA;AAAA,IAClB,QAAU,EAAA,EAAE,EAAI,EAAA,KAAA,EAAO,OAAO,MAAO,EAAA;AAAA,IACrC,MAAQ,EAAA,eAAA;AAAA,IACR,YAAA;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,KAAK,kBAAmB,CAAA,cAAA;AAAA,KAC1B;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAU,EAAA;AAC1B,MAAI,IAAA,OAAO,YAAY,UAAY,EAAA;AACjC,QAAA,OAAO,EAAE,GAAK,EAAA,OAAA,CAAQ,EAAE,MAAQ,EAAA,MAAA,EAAQ,CAAE,EAAA,CAAA;AAAA,OAC5C;AACA,MAAO,OAAA,EAAE,KAAK,OAAQ,EAAA,CAAA;AAAA,KACxB;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,mBAAV,KAAA;AACE,EAAMA,mBAAA,CAAA,cAAA,GAAiB,sBAAsC,EAAA,CAAE,IAAK,CAAA;AAAA,IACzE,EAAI,EAAA,kBAAA;AAAA,GACL,CAAA,CAAA;AAAA,CAHc,EAAA,kBAAA,KAAA,kBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAppRootElementExtension.esm.js","sources":["../../src/extensions/createAppRootElementExtension.ts"],"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 { JSX } from 'react';\nimport { PortableSchema } from '../schema/types';\nimport { Expand } from '../types';\nimport { coreExtensionData } from '../wiring/coreExtensionData';\nimport {\n AnyExtensionInputMap,\n ExtensionDefinition,\n ResolvedExtensionInputs,\n createExtension,\n} from '../wiring/createExtension';\n\n/**\n * Creates an extension that renders 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 function createAppRootElementExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n configSchema?: PortableSchema<TConfig>;\n disabled?: boolean;\n inputs?: TInputs;\n element:\n | JSX.Element\n | ((options: {\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n config: TConfig;\n }) => JSX.Element);\n}): ExtensionDefinition<TConfig> {\n return createExtension({\n kind: 'app-root-element',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? { id: 'app/root', input: 'elements' },\n configSchema: options.configSchema,\n disabled: options.disabled,\n inputs: options.inputs,\n output: {\n element: coreExtensionData.reactElement,\n },\n factory({ inputs, config }) {\n return {\n element:\n typeof options.element === 'function'\n ? options.element({ inputs, config })\n : options.element,\n };\n },\n });\n}\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"createAppRootElementExtension.esm.js","sources":["../../src/extensions/createAppRootElementExtension.ts"],"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 { JSX } from 'react';\nimport { PortableSchema } from '../schema/types';\nimport { Expand } from '../types';\nimport { coreExtensionData } from '../wiring/coreExtensionData';\nimport {\n AnyExtensionInputMap,\n ExtensionDefinition,\n ResolvedExtensionInputs,\n createExtension,\n} from '../wiring/createExtension';\n\n/**\n * Creates an extension that renders 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 * @deprecated Use {@link AppRootElementBlueprint} instead.\n */\nexport function createAppRootElementExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n configSchema?: PortableSchema<TConfig>;\n disabled?: boolean;\n inputs?: TInputs;\n element:\n | JSX.Element\n | ((options: {\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n config: TConfig;\n }) => JSX.Element);\n}): ExtensionDefinition<TConfig> {\n return createExtension({\n kind: 'app-root-element',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? { id: 'app/root', input: 'elements' },\n configSchema: options.configSchema,\n disabled: options.disabled,\n inputs: options.inputs,\n output: {\n element: coreExtensionData.reactElement,\n },\n factory({ inputs, config }) {\n return {\n element:\n typeof options.element === 'function'\n ? options.element({ inputs, config })\n : options.element,\n };\n },\n });\n}\n"],"names":[],"mappings":";;;AAkCO,SAAS,8BAGd,OAa+B,EAAA;AAC/B,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,kBAAA;AAAA,IACN,WAAW,OAAQ,CAAA,SAAA;AAAA,IACnB,MAAM,OAAQ,CAAA,IAAA;AAAA,IACd,UAAU,OAAQ,CAAA,QAAA,IAAY,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,UAAW,EAAA;AAAA,IAClE,cAAc,OAAQ,CAAA,YAAA;AAAA,IACtB,UAAU,OAAQ,CAAA,QAAA;AAAA,IAClB,QAAQ,OAAQ,CAAA,MAAA;AAAA,IAChB,MAAQ,EAAA;AAAA,MACN,SAAS,iBAAkB,CAAA,YAAA;AAAA,KAC7B;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAU,EAAA;AAC1B,MAAO,OAAA;AAAA,QACL,OACE,EAAA,OAAO,OAAQ,CAAA,OAAA,KAAY,UACvB,GAAA,OAAA,CAAQ,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAQ,CAAA,GAClC,OAAQ,CAAA,OAAA;AAAA,OAChB,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAppRootWrapperExtension.esm.js","sources":["../../src/extensions/createAppRootWrapperExtension.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, { ComponentType, PropsWithChildren } from 'react';\nimport { PortableSchema } from '../schema/types';\nimport {\n AnyExtensionInputMap,\n ExtensionDefinition,\n ResolvedExtensionInputs,\n createExtension,\n} from '../wiring/createExtension';\nimport { createExtensionDataRef } from '../wiring/createExtensionDataRef';\nimport { Expand } from '../types';\n\n/**\n * Creates an extension that renders 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 function createAppRootWrapperExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n configSchema?: PortableSchema<TConfig>;\n disabled?: boolean;\n inputs?: TInputs;\n Component: ComponentType<\n PropsWithChildren<{\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n config: TConfig;\n }>\n >;\n}): ExtensionDefinition<TConfig> {\n return createExtension({\n kind: 'app-root-wrapper',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? { id: 'app/root', input: 'wrappers' },\n configSchema: options.configSchema,\n disabled: options.disabled,\n inputs: options.inputs,\n output: {\n component: createAppRootWrapperExtension.componentDataRef,\n },\n factory({ inputs, config }) {\n const Component = (props: PropsWithChildren<{}>) => {\n return (\n <options.Component inputs={inputs} config={config}>\n {props.children}\n </options.Component>\n );\n };\n return {\n component: Component,\n };\n },\n });\n}\n\n/** @public */\nexport namespace createAppRootWrapperExtension {\n export const componentDataRef = createExtensionDataRef<\n ComponentType<PropsWithChildren<{}>>\n >().with({ id: 'app.root.wrapper' });\n}\n"],"names":["createAppRootWrapperExtension"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"createAppRootWrapperExtension.esm.js","sources":["../../src/extensions/createAppRootWrapperExtension.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, { ComponentType, PropsWithChildren } from 'react';\nimport { PortableSchema } from '../schema/types';\nimport {\n AnyExtensionInputMap,\n ExtensionDefinition,\n ResolvedExtensionInputs,\n createExtension,\n} from '../wiring/createExtension';\nimport { createExtensionDataRef } from '../wiring/createExtensionDataRef';\nimport { Expand } from '../types';\n\n/**\n * Creates an extension that renders 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 * @deprecated Use {@link AppRootWrapperBlueprint} instead.\n */\nexport function createAppRootWrapperExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n configSchema?: PortableSchema<TConfig>;\n disabled?: boolean;\n inputs?: TInputs;\n Component: ComponentType<\n PropsWithChildren<{\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n config: TConfig;\n }>\n >;\n}): ExtensionDefinition<TConfig> {\n return createExtension({\n kind: 'app-root-wrapper',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? { id: 'app/root', input: 'wrappers' },\n configSchema: options.configSchema,\n disabled: options.disabled,\n inputs: options.inputs,\n output: {\n component: createAppRootWrapperExtension.componentDataRef,\n },\n factory({ inputs, config }) {\n const Component = (props: PropsWithChildren<{}>) => {\n return (\n <options.Component inputs={inputs} config={config}>\n {props.children}\n </options.Component>\n );\n };\n return {\n component: Component,\n };\n },\n });\n}\n\n/** @public */\nexport namespace createAppRootWrapperExtension {\n export const componentDataRef = createExtensionDataRef<\n ComponentType<PropsWithChildren<{}>>\n >().with({ id: 'app.root.wrapper' });\n}\n"],"names":["createAppRootWrapperExtension"],"mappings":";;;;AAmCO,SAAS,8BAGd,OAa+B,EAAA;AAC/B,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,kBAAA;AAAA,IACN,WAAW,OAAQ,CAAA,SAAA;AAAA,IACnB,MAAM,OAAQ,CAAA,IAAA;AAAA,IACd,UAAU,OAAQ,CAAA,QAAA,IAAY,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,UAAW,EAAA;AAAA,IAClE,cAAc,OAAQ,CAAA,YAAA;AAAA,IACtB,UAAU,OAAQ,CAAA,QAAA;AAAA,IAClB,QAAQ,OAAQ,CAAA,MAAA;AAAA,IAChB,MAAQ,EAAA;AAAA,MACN,WAAW,6BAA8B,CAAA,gBAAA;AAAA,KAC3C;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAU,EAAA;AAC1B,MAAM,MAAA,SAAA,GAAY,CAAC,KAAiC,KAAA;AAClD,QAAA,2CACG,OAAQ,CAAA,SAAA,EAAR,EAAkB,MAAgB,EAAA,MAAA,EAAA,EAChC,MAAM,QACT,CAAA,CAAA;AAAA,OAEJ,CAAA;AACA,MAAO,OAAA;AAAA,QACL,SAAW,EAAA,SAAA;AAAA,OACb,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,8BAAV,KAAA;AACE,EAAMA,8BAAAA,CAAA,mBAAmB,sBAE9B,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,oBAAoB,CAAA,CAAA;AAAA,CAHpB,EAAA,6BAAA,KAAA,6BAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNavItemExtension.esm.js","sources":["../../src/extensions/createNavItemExtension.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 { IconComponent } from '@backstage/core-plugin-api';\nimport { createSchemaFromZod } from '../schema/createSchemaFromZod';\nimport { createExtension, createExtensionDataRef } from '../wiring';\nimport { RouteRef } from '../routing';\n\n/**\n * Helper for creating extensions for a nav item.\n * @public\n */\nexport function createNavItemExtension(options: {\n namespace?: string;\n name?: string;\n routeRef: RouteRef<undefined>;\n title: string;\n icon: IconComponent;\n}) {\n const { routeRef, title, icon, namespace, name } = options;\n return createExtension({\n namespace,\n name,\n kind: 'nav-item',\n attachTo: { id: 'app/nav', input: 'items' },\n configSchema: createSchemaFromZod(z =>\n z.object({\n title: z.string().default(title),\n }),\n ),\n output: {\n navTarget: createNavItemExtension.targetDataRef,\n },\n factory: ({ config }) => ({\n navTarget: {\n title: config.title,\n icon,\n routeRef,\n },\n }),\n });\n}\n\n/** @public */\nexport namespace createNavItemExtension {\n // TODO(Rugvip): Should this be broken apart into separate refs? title/icon/routeRef\n export const targetDataRef = createExtensionDataRef<{\n title: string;\n icon: IconComponent;\n routeRef: RouteRef<undefined>;\n }>().with({ id: 'core.nav-item.target' });\n}\n"],"names":["createNavItemExtension"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"createNavItemExtension.esm.js","sources":["../../src/extensions/createNavItemExtension.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 { IconComponent } from '@backstage/core-plugin-api';\nimport { createSchemaFromZod } from '../schema/createSchemaFromZod';\nimport { createExtension, createExtensionDataRef } from '../wiring';\nimport { RouteRef } from '../routing';\n\n/**\n * Helper for creating extensions for a nav item.\n *\n * @public\n * @deprecated Use {@link NavItemBlueprint} instead.\n */\nexport function createNavItemExtension(options: {\n namespace?: string;\n name?: string;\n routeRef: RouteRef<undefined>;\n title: string;\n icon: IconComponent;\n}) {\n const { routeRef, title, icon, namespace, name } = options;\n return createExtension({\n namespace,\n name,\n kind: 'nav-item',\n attachTo: { id: 'app/nav', input: 'items' },\n configSchema: createSchemaFromZod(z =>\n z.object({\n title: z.string().default(title),\n }),\n ),\n output: {\n navTarget: createNavItemExtension.targetDataRef,\n },\n factory: ({ config }) => ({\n navTarget: {\n title: config.title,\n icon,\n routeRef,\n },\n }),\n });\n}\n\n/** @public */\nexport namespace createNavItemExtension {\n // TODO(Rugvip): Should this be broken apart into separate refs? title/icon/routeRef\n export const targetDataRef = createExtensionDataRef<{\n title: string;\n icon: IconComponent;\n routeRef: RouteRef<undefined>;\n }>().with({ id: 'core.nav-item.target' });\n}\n"],"names":["createNavItemExtension"],"mappings":";;;;;AA2BO,SAAS,uBAAuB,OAMpC,EAAA;AACD,EAAA,MAAM,EAAE,QAAU,EAAA,KAAA,EAAO,IAAM,EAAA,SAAA,EAAW,MAAS,GAAA,OAAA,CAAA;AACnD,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,SAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAM,EAAA,UAAA;AAAA,IACN,QAAU,EAAA,EAAE,EAAI,EAAA,SAAA,EAAW,OAAO,OAAQ,EAAA;AAAA,IAC1C,YAAc,EAAA,mBAAA;AAAA,MAAoB,CAAA,CAAA,KAChC,EAAE,MAAO,CAAA;AAAA,QACP,KAAO,EAAA,CAAA,CAAE,MAAO,EAAA,CAAE,QAAQ,KAAK,CAAA;AAAA,OAChC,CAAA;AAAA,KACH;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,WAAW,sBAAuB,CAAA,aAAA;AAAA,KACpC;AAAA,IACA,OAAS,EAAA,CAAC,EAAE,MAAA,EAAc,MAAA;AAAA,MACxB,SAAW,EAAA;AAAA,QACT,OAAO,MAAO,CAAA,KAAA;AAAA,QACd,IAAA;AAAA,QACA,QAAA;AAAA,OACF;AAAA,KACF,CAAA;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,uBAAV,KAAA;AAEE,EAAMA,uBAAAA,CAAA,gBAAgB,sBAI1B,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,wBAAwB,CAAA,CAAA;AAAA,CANzB,EAAA,sBAAA,KAAA,sBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createNavLogoExtension.esm.js","sources":["../../src/extensions/createNavLogoExtension.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 { createExtension, createExtensionDataRef } from '../wiring';\n\n/**\n * Helper for creating extensions for a nav logos.\n * @public\n */\nexport function createNavLogoExtension(options: {\n name?: string;\n namespace?: string;\n logoIcon: JSX.Element;\n logoFull: JSX.Element;\n}) {\n const { logoIcon, logoFull } = options;\n return createExtension({\n kind: 'nav-logo',\n name: options?.name,\n namespace: options?.namespace,\n attachTo: { id: 'app/nav', input: 'logos' },\n output: {\n logos: createNavLogoExtension.logoElementsDataRef,\n },\n factory: () => {\n return {\n logos: {\n logoIcon,\n logoFull,\n },\n };\n },\n });\n}\n\n/** @public */\nexport namespace createNavLogoExtension {\n export const logoElementsDataRef = createExtensionDataRef<{\n logoIcon?: JSX.Element;\n logoFull?: JSX.Element;\n }>().with({ id: 'core.nav-logo.logo-elements' });\n}\n"],"names":["createNavLogoExtension"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"createNavLogoExtension.esm.js","sources":["../../src/extensions/createNavLogoExtension.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 { createExtension, createExtensionDataRef } from '../wiring';\n\n/**\n * Helper for creating extensions for a nav logos.\n *\n * @public\n * @deprecated Use {@link NavLogoBlueprint} instead.\n */\nexport function createNavLogoExtension(options: {\n name?: string;\n namespace?: string;\n logoIcon: JSX.Element;\n logoFull: JSX.Element;\n}) {\n const { logoIcon, logoFull } = options;\n return createExtension({\n kind: 'nav-logo',\n name: options?.name,\n namespace: options?.namespace,\n attachTo: { id: 'app/nav', input: 'logos' },\n output: {\n logos: createNavLogoExtension.logoElementsDataRef,\n },\n factory: () => {\n return {\n logos: {\n logoIcon,\n logoFull,\n },\n };\n },\n });\n}\n\n/** @public */\nexport namespace createNavLogoExtension {\n export const logoElementsDataRef = createExtensionDataRef<{\n logoIcon?: JSX.Element;\n logoFull?: JSX.Element;\n }>().with({ id: 'core.nav-logo.logo-elements' });\n}\n"],"names":["createNavLogoExtension"],"mappings":";;;;AAwBO,SAAS,uBAAuB,OAKpC,EAAA;AACD,EAAM,MAAA,EAAE,QAAU,EAAA,QAAA,EAAa,GAAA,OAAA,CAAA;AAC/B,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,UAAA;AAAA,IACN,MAAM,OAAS,EAAA,IAAA;AAAA,IACf,WAAW,OAAS,EAAA,SAAA;AAAA,IACpB,QAAU,EAAA,EAAE,EAAI,EAAA,SAAA,EAAW,OAAO,OAAQ,EAAA;AAAA,IAC1C,MAAQ,EAAA;AAAA,MACN,OAAO,sBAAuB,CAAA,mBAAA;AAAA,KAChC;AAAA,IACA,SAAS,MAAM;AACb,MAAO,OAAA;AAAA,QACL,KAAO,EAAA;AAAA,UACL,QAAA;AAAA,UACA,QAAA;AAAA,SACF;AAAA,OACF,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,uBAAV,KAAA;AACE,EAAMA,uBAAAA,CAAA,sBAAsB,sBAGhC,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,+BAA+B,CAAA,CAAA;AAAA,CAJhC,EAAA,sBAAA,KAAA,sBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPageExtension.esm.js","sources":["../../src/extensions/createPageExtension.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, { lazy } from 'react';\nimport { ExtensionBoundary } from '../components';\nimport { createSchemaFromZod, PortableSchema } from '../schema';\nimport {\n coreExtensionData,\n createExtension,\n ResolvedExtensionInputs,\n AnyExtensionInputMap,\n} from '../wiring';\nimport { RouteRef } from '../routing';\nimport { Expand } from '../types';\nimport { ExtensionDefinition } from '../wiring/createExtension';\n\n/**\n * Helper for creating extensions for a routable React page component.\n *\n * @public\n */\nexport function createPageExtension<\n TConfig extends { path: string },\n TInputs extends AnyExtensionInputMap,\n>(\n options: (\n | {\n defaultPath: string;\n }\n | {\n configSchema: PortableSchema<TConfig>;\n }\n ) & {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n disabled?: boolean;\n inputs?: TInputs;\n routeRef?: RouteRef;\n loader: (options: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<JSX.Element>;\n },\n): ExtensionDefinition<TConfig> {\n const configSchema =\n 'configSchema' in options\n ? options.configSchema\n : (createSchemaFromZod(z =>\n z.object({ path: z.string().default(options.defaultPath) }),\n ) as PortableSchema<TConfig>);\n\n return createExtension({\n kind: 'page',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? { id: 'app/routes', input: 'routes' },\n configSchema,\n inputs: options.inputs,\n disabled: options.disabled,\n output: {\n element: coreExtensionData.reactElement,\n path: coreExtensionData.routePath,\n routeRef: coreExtensionData.routeRef.optional(),\n },\n factory({ config, inputs, node }) {\n const ExtensionComponent = lazy(() =>\n options\n .loader({ config, inputs })\n .then(element => ({ default: () => element })),\n );\n\n return {\n path: config.path,\n routeRef: options.routeRef,\n element: (\n <ExtensionBoundary node={node}>\n <ExtensionComponent />\n </ExtensionBoundary>\n ),\n };\n },\n });\n}\n"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"createPageExtension.esm.js","sources":["../../src/extensions/createPageExtension.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, { lazy } from 'react';\nimport { ExtensionBoundary } from '../components';\nimport { createSchemaFromZod, PortableSchema } from '../schema';\nimport {\n coreExtensionData,\n createExtension,\n ResolvedExtensionInputs,\n AnyExtensionInputMap,\n} from '../wiring';\nimport { RouteRef } from '../routing';\nimport { Expand } from '../types';\nimport { ExtensionDefinition } from '../wiring/createExtension';\n\n/**\n * Helper for creating extensions for a routable React page component.\n *\n * @public\n * @deprecated Use {@link PageBlueprint} instead.\n */\nexport function createPageExtension<\n TConfig extends { path: string },\n TInputs extends AnyExtensionInputMap,\n>(\n options: (\n | {\n defaultPath: string;\n }\n | {\n configSchema: PortableSchema<TConfig>;\n }\n ) & {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n disabled?: boolean;\n inputs?: TInputs;\n routeRef?: RouteRef;\n loader: (options: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<JSX.Element>;\n },\n): ExtensionDefinition<TConfig> {\n const configSchema =\n 'configSchema' in options\n ? options.configSchema\n : (createSchemaFromZod(z =>\n z.object({ path: z.string().default(options.defaultPath) }),\n ) as PortableSchema<TConfig>);\n\n return createExtension({\n kind: 'page',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? { id: 'app/routes', input: 'routes' },\n configSchema,\n inputs: options.inputs,\n disabled: options.disabled,\n output: {\n element: coreExtensionData.reactElement,\n path: coreExtensionData.routePath,\n routeRef: coreExtensionData.routeRef.optional(),\n },\n factory({ config, inputs, node }) {\n const ExtensionComponent = lazy(() =>\n options\n .loader({ config, inputs })\n .then(element => ({ default: () => element })),\n );\n\n return {\n path: config.path,\n routeRef: options.routeRef,\n element: (\n <ExtensionBoundary node={node}>\n <ExtensionComponent />\n </ExtensionBoundary>\n ),\n };\n },\n });\n}\n"],"names":[],"mappings":";;;;;;AAmCO,SAAS,oBAId,OAmB8B,EAAA;AAC9B,EAAA,MAAM,YACJ,GAAA,cAAA,IAAkB,OACd,GAAA,OAAA,CAAQ,YACP,GAAA,mBAAA;AAAA,IAAoB,CACnB,CAAA,KAAA,CAAA,CAAE,MAAO,CAAA,EAAE,IAAM,EAAA,CAAA,CAAE,MAAO,EAAA,CAAE,OAAQ,CAAA,OAAA,CAAQ,WAAW,CAAA,EAAG,CAAA;AAAA,GAC5D,CAAA;AAEN,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,MAAA;AAAA,IACN,WAAW,OAAQ,CAAA,SAAA;AAAA,IACnB,MAAM,OAAQ,CAAA,IAAA;AAAA,IACd,UAAU,OAAQ,CAAA,QAAA,IAAY,EAAE,EAAI,EAAA,YAAA,EAAc,OAAO,QAAS,EAAA;AAAA,IAClE,YAAA;AAAA,IACA,QAAQ,OAAQ,CAAA,MAAA;AAAA,IAChB,UAAU,OAAQ,CAAA,QAAA;AAAA,IAClB,MAAQ,EAAA;AAAA,MACN,SAAS,iBAAkB,CAAA,YAAA;AAAA,MAC3B,MAAM,iBAAkB,CAAA,SAAA;AAAA,MACxB,QAAA,EAAU,iBAAkB,CAAA,QAAA,CAAS,QAAS,EAAA;AAAA,KAChD;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAQ,MAAQ,EAAA;AAChC,MAAA,MAAM,kBAAqB,GAAA,IAAA;AAAA,QAAK,MAC9B,OAAA,CACG,MAAO,CAAA,EAAE,QAAQ,MAAO,EAAC,CACzB,CAAA,IAAA,CAAK,CAAY,OAAA,MAAA,EAAE,OAAS,EAAA,MAAM,SAAU,CAAA,CAAA;AAAA,OACjD,CAAA;AAEA,MAAO,OAAA;AAAA,QACL,MAAM,MAAO,CAAA,IAAA;AAAA,QACb,UAAU,OAAQ,CAAA,QAAA;AAAA,QAClB,yBACG,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAkB,IACjB,EAAA,kBAAA,KAAA,CAAA,aAAA,CAAC,wBAAmB,CACtB,CAAA;AAAA,OAEJ,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRouterExtension.esm.js","sources":["../../src/extensions/createRouterExtension.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, { ComponentType, PropsWithChildren } from 'react';\nimport { PortableSchema } from '../schema/types';\nimport {\n AnyExtensionInputMap,\n ExtensionDefinition,\n ResolvedExtensionInputs,\n createExtension,\n} from '../wiring/createExtension';\nimport { createExtensionDataRef } from '../wiring/createExtensionDataRef';\nimport { Expand } from '../types';\n\n/**\n * Creates an extension that replaces the router implementation at the app root.\n * This is useful to be able to for example replace the BrowserRouter with a\n * MemoryRouter in tests, or to add additional props to a BrowserRouter.\n *\n * @public\n */\nexport function createRouterExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n configSchema?: PortableSchema<TConfig>;\n disabled?: boolean;\n inputs?: TInputs;\n Component: ComponentType<\n PropsWithChildren<{\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n config: TConfig;\n }>\n >;\n}): ExtensionDefinition<TConfig> {\n return createExtension({\n kind: 'app-router-component',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? { id: 'app/root', input: 'router' },\n configSchema: options.configSchema,\n disabled: options.disabled,\n inputs: options.inputs,\n output: {\n component: createRouterExtension.componentDataRef,\n },\n factory({ inputs, config }) {\n const Component = (props: PropsWithChildren<{}>) => {\n return (\n <options.Component inputs={inputs} config={config}>\n {props.children}\n </options.Component>\n );\n };\n return {\n component: Component,\n };\n },\n });\n}\n\n/** @public */\nexport namespace createRouterExtension {\n export const componentDataRef = createExtensionDataRef<\n ComponentType<PropsWithChildren<{}>>\n >().with({ id: 'app.router.wrapper' });\n}\n"],"names":["createRouterExtension"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"createRouterExtension.esm.js","sources":["../../src/extensions/createRouterExtension.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, { ComponentType, PropsWithChildren } from 'react';\nimport { PortableSchema } from '../schema/types';\nimport {\n AnyExtensionInputMap,\n ExtensionDefinition,\n ResolvedExtensionInputs,\n createExtension,\n} from '../wiring/createExtension';\nimport { createExtensionDataRef } from '../wiring/createExtensionDataRef';\nimport { Expand } from '../types';\n\n/**\n * Creates an extension that replaces the router implementation at the app root.\n * This is useful to be able to for example replace the BrowserRouter with a\n * MemoryRouter in tests, or to add additional props to a BrowserRouter.\n *\n * @public\n * @deprecated Use {@link RouterBlueprint} instead.\n */\nexport function createRouterExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n configSchema?: PortableSchema<TConfig>;\n disabled?: boolean;\n inputs?: TInputs;\n Component: ComponentType<\n PropsWithChildren<{\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n config: TConfig;\n }>\n >;\n}): ExtensionDefinition<TConfig> {\n return createExtension({\n kind: 'app-router-component',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? { id: 'app/root', input: 'router' },\n configSchema: options.configSchema,\n disabled: options.disabled,\n inputs: options.inputs,\n output: {\n component: createRouterExtension.componentDataRef,\n },\n factory({ inputs, config }) {\n const Component = (props: PropsWithChildren<{}>) => {\n return (\n <options.Component inputs={inputs} config={config}>\n {props.children}\n </options.Component>\n );\n };\n return {\n component: Component,\n };\n },\n });\n}\n\n/** @public */\nexport namespace createRouterExtension {\n export const componentDataRef = createExtensionDataRef<\n ComponentType<PropsWithChildren<{}>>\n >().with({ id: 'app.router.wrapper' });\n}\n"],"names":["createRouterExtension"],"mappings":";;;;AAmCO,SAAS,sBAGd,OAa+B,EAAA;AAC/B,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,sBAAA;AAAA,IACN,WAAW,OAAQ,CAAA,SAAA;AAAA,IACnB,MAAM,OAAQ,CAAA,IAAA;AAAA,IACd,UAAU,OAAQ,CAAA,QAAA,IAAY,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,QAAS,EAAA;AAAA,IAChE,cAAc,OAAQ,CAAA,YAAA;AAAA,IACtB,UAAU,OAAQ,CAAA,QAAA;AAAA,IAClB,QAAQ,OAAQ,CAAA,MAAA;AAAA,IAChB,MAAQ,EAAA;AAAA,MACN,WAAW,qBAAsB,CAAA,gBAAA;AAAA,KACnC;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAU,EAAA;AAC1B,MAAM,MAAA,SAAA,GAAY,CAAC,KAAiC,KAAA;AAClD,QAAA,2CACG,OAAQ,CAAA,SAAA,EAAR,EAAkB,MAAgB,EAAA,MAAA,EAAA,EAChC,MAAM,QACT,CAAA,CAAA;AAAA,OAEJ,CAAA;AACA,MAAO,OAAA;AAAA,QACL,SAAW,EAAA,SAAA;AAAA,OACb,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,sBAAV,KAAA;AACE,EAAMA,sBAAAA,CAAA,mBAAmB,sBAE9B,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,sBAAsB,CAAA,CAAA;AAAA,CAHtB,EAAA,qBAAA,KAAA,qBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSignInPageExtension.esm.js","sources":["../../src/extensions/createSignInPageExtension.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, { ComponentType, lazy } from 'react';\nimport { ExtensionBoundary } from '../components';\nimport { PortableSchema } from '../schema';\nimport {\n createExtension,\n ResolvedExtensionInputs,\n AnyExtensionInputMap,\n createExtensionDataRef,\n ExtensionDefinition,\n} from '../wiring';\nimport { Expand } from '../types';\nimport { SignInPageProps } from '@backstage/core-plugin-api';\n\n/**\n *\n * @public\n */\nexport function createSignInPageExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n configSchema?: PortableSchema<TConfig>;\n disabled?: boolean;\n inputs?: TInputs;\n loader: (options: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<ComponentType<SignInPageProps>>;\n}): ExtensionDefinition<TConfig> {\n return createExtension({\n kind: 'sign-in-page',\n namespace: options?.namespace,\n name: options?.name,\n attachTo: options.attachTo ?? { id: 'app/root', input: 'signInPage' },\n configSchema: options.configSchema,\n inputs: options.inputs,\n disabled: options.disabled,\n output: {\n component: createSignInPageExtension.componentDataRef,\n },\n factory({ config, inputs, node }) {\n const ExtensionComponent = lazy(() =>\n options\n .loader({ config, inputs })\n .then(component => ({ default: component })),\n );\n\n return {\n component: props => (\n <ExtensionBoundary node={node} routable>\n <ExtensionComponent {...props} />\n </ExtensionBoundary>\n ),\n };\n },\n });\n}\n\n/** @public */\nexport namespace createSignInPageExtension {\n export const componentDataRef = createExtensionDataRef<\n ComponentType<SignInPageProps>\n >().with({ id: 'core.sign-in-page.component' });\n}\n"],"names":["createSignInPageExtension"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"createSignInPageExtension.esm.js","sources":["../../src/extensions/createSignInPageExtension.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, { ComponentType, lazy } from 'react';\nimport { ExtensionBoundary } from '../components';\nimport { PortableSchema } from '../schema';\nimport {\n createExtension,\n ResolvedExtensionInputs,\n AnyExtensionInputMap,\n createExtensionDataRef,\n ExtensionDefinition,\n} from '../wiring';\nimport { Expand } from '../types';\nimport { SignInPageProps } from '@backstage/core-plugin-api';\n\n/**\n *\n * @public\n * @deprecated Use {@link SignInPageBlueprint} instead.\n */\nexport function createSignInPageExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n configSchema?: PortableSchema<TConfig>;\n disabled?: boolean;\n inputs?: TInputs;\n loader: (options: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<ComponentType<SignInPageProps>>;\n}): ExtensionDefinition<TConfig> {\n return createExtension({\n kind: 'sign-in-page',\n namespace: options?.namespace,\n name: options?.name,\n attachTo: options.attachTo ?? { id: 'app/root', input: 'signInPage' },\n configSchema: options.configSchema,\n inputs: options.inputs,\n disabled: options.disabled,\n output: {\n component: createSignInPageExtension.componentDataRef,\n },\n factory({ config, inputs, node }) {\n const ExtensionComponent = lazy(() =>\n options\n .loader({ config, inputs })\n .then(component => ({ default: component })),\n );\n\n return {\n component: props => (\n <ExtensionBoundary node={node} routable>\n <ExtensionComponent {...props} />\n </ExtensionBoundary>\n ),\n };\n },\n });\n}\n\n/** @public */\nexport namespace createSignInPageExtension {\n export const componentDataRef = createExtensionDataRef<\n ComponentType<SignInPageProps>\n >().with({ id: 'core.sign-in-page.component' });\n}\n"],"names":["createSignInPageExtension"],"mappings":";;;;;;AAkCO,SAAS,0BAGd,OAW+B,EAAA;AAC/B,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,cAAA;AAAA,IACN,WAAW,OAAS,EAAA,SAAA;AAAA,IACpB,MAAM,OAAS,EAAA,IAAA;AAAA,IACf,UAAU,OAAQ,CAAA,QAAA,IAAY,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,YAAa,EAAA;AAAA,IACpE,cAAc,OAAQ,CAAA,YAAA;AAAA,IACtB,QAAQ,OAAQ,CAAA,MAAA;AAAA,IAChB,UAAU,OAAQ,CAAA,QAAA;AAAA,IAClB,MAAQ,EAAA;AAAA,MACN,WAAW,yBAA0B,CAAA,gBAAA;AAAA,KACvC;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAQ,MAAQ,EAAA;AAChC,MAAA,MAAM,kBAAqB,GAAA,IAAA;AAAA,QAAK,MAC9B,OAAA,CACG,MAAO,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAQ,CAAA,CACzB,IAAK,CAAA,CAAA,SAAA,MAAc,EAAE,OAAA,EAAS,WAAY,CAAA,CAAA;AAAA,OAC/C,CAAA;AAEA,MAAO,OAAA;AAAA,QACL,SAAA,EAAW,CACT,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,CAAA;AAAA,OAEJ,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,0BAAV,KAAA;AACE,EAAMA,0BAAAA,CAAA,mBAAmB,sBAE9B,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,+BAA+B,CAAA,CAAA;AAAA,CAH/B,EAAA,yBAAA,KAAA,yBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createThemeExtension.esm.js","sources":["../../src/extensions/createThemeExtension.ts"],"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 { createExtension, createExtensionDataRef } from '../wiring';\nimport { AppTheme } from '@backstage/core-plugin-api';\n\n
|
|
1
|
+
{"version":3,"file":"createThemeExtension.esm.js","sources":["../../src/extensions/createThemeExtension.ts"],"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 { createExtension, createExtensionDataRef } from '../wiring';\nimport { AppTheme } from '@backstage/core-plugin-api';\n\n/**\n * @public\n * @deprecated Use {@link ThemeBlueprint} instead.\n */\nexport function createThemeExtension(theme: AppTheme) {\n return createExtension({\n kind: 'theme',\n namespace: 'app',\n name: theme.id,\n attachTo: { id: 'app', input: 'themes' },\n output: {\n theme: createThemeExtension.themeDataRef,\n },\n factory: () => ({ theme }),\n });\n}\n\n/**\n * @public\n * @deprecated Use {@link ThemeBlueprint} instead.\n */\nexport namespace createThemeExtension {\n export const themeDataRef = createExtensionDataRef<AppTheme>().with({\n id: 'core.theme.theme',\n });\n}\n"],"names":["createThemeExtension"],"mappings":";;;;AAuBO,SAAS,qBAAqB,KAAiB,EAAA;AACpD,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,OAAA;AAAA,IACN,SAAW,EAAA,KAAA;AAAA,IACX,MAAM,KAAM,CAAA,EAAA;AAAA,IACZ,QAAU,EAAA,EAAE,EAAI,EAAA,KAAA,EAAO,OAAO,QAAS,EAAA;AAAA,IACvC,MAAQ,EAAA;AAAA,MACN,OAAO,oBAAqB,CAAA,YAAA;AAAA,KAC9B;AAAA,IACA,OAAA,EAAS,OAAO,EAAE,KAAM,EAAA,CAAA;AAAA,GACzB,CAAA,CAAA;AACH,CAAA;AAAA,CAMO,CAAUA,qBAAV,KAAA;AACE,EAAMA,qBAAA,CAAA,YAAA,GAAe,sBAAiC,EAAA,CAAE,IAAK,CAAA;AAAA,IAClE,EAAI,EAAA,kBAAA;AAAA,GACL,CAAA,CAAA;AAAA,CAHc,EAAA,oBAAA,KAAA,oBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|