@backstage/frontend-plugin-api 0.7.0 → 0.8.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/dist/blueprints/ApiBlueprint.esm.js +1 -1
- package/dist/blueprints/ApiBlueprint.esm.js.map +1 -1
- package/dist/blueprints/IconBundleBlueprint.esm.js +1 -1
- package/dist/blueprints/IconBundleBlueprint.esm.js.map +1 -1
- package/dist/blueprints/ThemeBlueprint.esm.js +1 -1
- package/dist/blueprints/ThemeBlueprint.esm.js.map +1 -1
- package/dist/blueprints/TranslationBlueprint.esm.js +1 -1
- package/dist/blueprints/TranslationBlueprint.esm.js.map +1 -1
- package/dist/extensions/createComponentExtension.esm.js +13 -17
- package/dist/extensions/createComponentExtension.esm.js.map +1 -1
- package/dist/index.d.ts +305 -572
- package/dist/index.esm.js +0 -11
- package/dist/index.esm.js.map +1 -1
- package/dist/schema/createSchemaFromZod.esm.js.map +1 -1
- package/dist/wiring/createExtension.esm.js +21 -27
- package/dist/wiring/createExtension.esm.js.map +1 -1
- package/dist/wiring/createExtensionBlueprint.esm.js +58 -61
- package/dist/wiring/createExtensionBlueprint.esm.js.map +1 -1
- package/dist/wiring/createExtensionInput.esm.js +2 -1
- package/dist/wiring/createExtensionInput.esm.js.map +1 -1
- package/dist/wiring/createExtensionOverrides.esm.js.map +1 -1
- package/dist/wiring/createFrontendPlugin.esm.js +6 -1
- package/dist/wiring/createFrontendPlugin.esm.js.map +1 -1
- package/dist/wiring/resolveExtensionDefinition.esm.js.map +1 -1
- package/package.json +5 -5
- package/dist/extensions/createApiExtension.esm.js +0 -32
- package/dist/extensions/createApiExtension.esm.js.map +0 -1
- package/dist/extensions/createAppRootElementExtension.esm.js +0 -25
- package/dist/extensions/createAppRootElementExtension.esm.js.map +0 -1
- package/dist/extensions/createAppRootWrapperExtension.esm.js +0 -32
- package/dist/extensions/createAppRootWrapperExtension.esm.js.map +0 -1
- package/dist/extensions/createNavItemExtension.esm.js +0 -35
- package/dist/extensions/createNavItemExtension.esm.js.map +0 -1
- package/dist/extensions/createNavLogoExtension.esm.js +0 -30
- package/dist/extensions/createNavLogoExtension.esm.js.map +0 -1
- package/dist/extensions/createPageExtension.esm.js +0 -38
- package/dist/extensions/createPageExtension.esm.js.map +0 -1
- package/dist/extensions/createRouterExtension.esm.js +0 -32
- package/dist/extensions/createRouterExtension.esm.js.map +0 -1
- package/dist/extensions/createSignInPageExtension.esm.js +0 -44
- package/dist/extensions/createSignInPageExtension.esm.js.map +0 -1
- package/dist/extensions/createThemeExtension.esm.js +0 -22
- package/dist/extensions/createThemeExtension.esm.js.map +0 -1
- package/dist/extensions/createTranslationExtension.esm.js +0 -22
- package/dist/extensions/createTranslationExtension.esm.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/frontend-plugin-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-next.0",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "web-library"
|
|
6
6
|
},
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"zod-to-json-schema": "^3.21.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@backstage/cli": "^0.27.0",
|
|
46
|
-
"@backstage/frontend-app-api": "^0.
|
|
47
|
-
"@backstage/frontend-test-utils": "^0.
|
|
48
|
-
"@backstage/test-utils": "^1.
|
|
45
|
+
"@backstage/cli": "^0.27.1-next.0",
|
|
46
|
+
"@backstage/frontend-app-api": "^0.9.0-next.0",
|
|
47
|
+
"@backstage/frontend-test-utils": "^0.2.0-next.0",
|
|
48
|
+
"@backstage/test-utils": "^1.6.0-next.0",
|
|
49
49
|
"@testing-library/jest-dom": "^6.0.0",
|
|
50
50
|
"@testing-library/react": "^15.0.0",
|
|
51
51
|
"history": "^5.3.0"
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import '../wiring/coreExtensionData.esm.js';
|
|
2
|
-
import { createExtension } from '../wiring/createExtension.esm.js';
|
|
3
|
-
import { ApiBlueprint } from '../blueprints/ApiBlueprint.esm.js';
|
|
4
|
-
|
|
5
|
-
function createApiExtension(options) {
|
|
6
|
-
const { factory, configSchema, inputs: extensionInputs } = options;
|
|
7
|
-
const apiRef = "api" in options ? options.api : factory.api;
|
|
8
|
-
return createExtension({
|
|
9
|
-
kind: "api",
|
|
10
|
-
// Since ApiRef IDs use a global namespace we use the namespace here in order to override
|
|
11
|
-
// potential plugin IDs and always end up with the format `api:<api-ref-id>`
|
|
12
|
-
namespace: apiRef.id,
|
|
13
|
-
attachTo: { id: "app", input: "apis" },
|
|
14
|
-
inputs: extensionInputs,
|
|
15
|
-
configSchema,
|
|
16
|
-
output: {
|
|
17
|
-
api: ApiBlueprint.dataRefs.factory
|
|
18
|
-
},
|
|
19
|
-
factory({ config, inputs }) {
|
|
20
|
-
if (typeof factory === "function") {
|
|
21
|
-
return { api: factory({ config, inputs }) };
|
|
22
|
-
}
|
|
23
|
-
return { api: factory };
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
((createApiExtension2) => {
|
|
28
|
-
createApiExtension2.factoryDataRef = ApiBlueprint.dataRefs.factory;
|
|
29
|
-
})(createApiExtension || (createApiExtension = {}));
|
|
30
|
-
|
|
31
|
-
export { createApiExtension };
|
|
32
|
-
//# sourceMappingURL=createApiExtension.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 { ResolvedExtensionInputs, createExtension } from '../wiring';\nimport { AnyExtensionInputMap } from '../wiring/createExtension';\nimport { Expand } from '../types';\nimport { ApiBlueprint } from '../blueprints/ApiBlueprint';\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: ApiBlueprint.dataRefs.factory,\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/**\n * @public\n * @deprecated Use {@link ApiBlueprint} instead.\n */\nexport namespace createApiExtension {\n /**\n * @deprecated Use {@link ApiBlueprint} instead.\n */\n export const factoryDataRef = ApiBlueprint.dataRefs.factory;\n}\n"],"names":["createApiExtension"],"mappings":";;;;AA2BO,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,GAAA,EAAK,aAAa,QAAS,CAAA,OAAA;AAAA,KAC7B;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,CAMO,CAAUA,mBAAV,KAAA;AAIE,EAAMA,mBAAAA,CAAA,cAAiB,GAAA,YAAA,CAAa,QAAS,CAAA,OAAA,CAAA;AAAA,CAJrC,EAAA,kBAAA,KAAA,kBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { coreExtensionData } from '../wiring/coreExtensionData.esm.js';
|
|
2
|
-
import { createExtension } from '../wiring/createExtension.esm.js';
|
|
3
|
-
|
|
4
|
-
function createAppRootElementExtension(options) {
|
|
5
|
-
return createExtension({
|
|
6
|
-
kind: "app-root-element",
|
|
7
|
-
namespace: options.namespace,
|
|
8
|
-
name: options.name,
|
|
9
|
-
attachTo: options.attachTo ?? { id: "app/root", input: "elements" },
|
|
10
|
-
configSchema: options.configSchema,
|
|
11
|
-
disabled: options.disabled,
|
|
12
|
-
inputs: options.inputs,
|
|
13
|
-
output: {
|
|
14
|
-
element: coreExtensionData.reactElement
|
|
15
|
-
},
|
|
16
|
-
factory({ inputs, config }) {
|
|
17
|
-
return {
|
|
18
|
-
element: typeof options.element === "function" ? options.element({ inputs, config }) : options.element
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export { createAppRootElementExtension };
|
|
25
|
-
//# sourceMappingURL=createAppRootElementExtension.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createExtension } from '../wiring/createExtension.esm.js';
|
|
3
|
-
import { AppRootWrapperBlueprint } from '../blueprints/AppRootWrapperBlueprint.esm.js';
|
|
4
|
-
|
|
5
|
-
function createAppRootWrapperExtension(options) {
|
|
6
|
-
return createExtension({
|
|
7
|
-
kind: "app-root-wrapper",
|
|
8
|
-
namespace: options.namespace,
|
|
9
|
-
name: options.name,
|
|
10
|
-
attachTo: options.attachTo ?? { id: "app/root", input: "wrappers" },
|
|
11
|
-
configSchema: options.configSchema,
|
|
12
|
-
disabled: options.disabled,
|
|
13
|
-
inputs: options.inputs,
|
|
14
|
-
output: {
|
|
15
|
-
component: AppRootWrapperBlueprint.dataRefs.component
|
|
16
|
-
},
|
|
17
|
-
factory({ inputs, config }) {
|
|
18
|
-
const Component = (props) => {
|
|
19
|
-
return /* @__PURE__ */ React.createElement(options.Component, { inputs, config }, props.children);
|
|
20
|
-
};
|
|
21
|
-
return {
|
|
22
|
-
component: Component
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
((createAppRootWrapperExtension2) => {
|
|
28
|
-
createAppRootWrapperExtension2.componentDataRef = AppRootWrapperBlueprint.dataRefs.component;
|
|
29
|
-
})(createAppRootWrapperExtension || (createAppRootWrapperExtension = {}));
|
|
30
|
-
|
|
31
|
-
export { createAppRootWrapperExtension };
|
|
32
|
-
//# sourceMappingURL=createAppRootWrapperExtension.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 { Expand } from '../types';\nimport { AppRootWrapperBlueprint } from '../blueprints/AppRootWrapperBlueprint';\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: AppRootWrapperBlueprint.dataRefs.component,\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/**\n * @public\n * @deprecated Use {@link AppRootWrapperBlueprint} instead.\n */\nexport namespace createAppRootWrapperExtension {\n /**\n * @deprecated Use {@link AppRootWrapperBlueprint} instead.\n */\n export const componentDataRef = AppRootWrapperBlueprint.dataRefs.component;\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,SAAA,EAAW,wBAAwB,QAAS,CAAA,SAAA;AAAA,KAC9C;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,CAMO,CAAUA,8BAAV,KAAA;AAIE,EAAMA,8BAAAA,CAAA,gBAAmB,GAAA,uBAAA,CAAwB,QAAS,CAAA,SAAA,CAAA;AAAA,CAJlD,EAAA,6BAAA,KAAA,6BAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { createSchemaFromZod } from '../schema/createSchemaFromZod.esm.js';
|
|
2
|
-
import '../wiring/coreExtensionData.esm.js';
|
|
3
|
-
import { createExtension } from '../wiring/createExtension.esm.js';
|
|
4
|
-
import { NavItemBlueprint } from '../blueprints/NavItemBlueprint.esm.js';
|
|
5
|
-
|
|
6
|
-
function createNavItemExtension(options) {
|
|
7
|
-
const { routeRef, title, icon, namespace, name } = options;
|
|
8
|
-
return createExtension({
|
|
9
|
-
namespace,
|
|
10
|
-
name,
|
|
11
|
-
kind: "nav-item",
|
|
12
|
-
attachTo: { id: "app/nav", input: "items" },
|
|
13
|
-
configSchema: createSchemaFromZod(
|
|
14
|
-
(z) => z.object({
|
|
15
|
-
title: z.string().default(title)
|
|
16
|
-
})
|
|
17
|
-
),
|
|
18
|
-
output: {
|
|
19
|
-
navTarget: NavItemBlueprint.dataRefs.target
|
|
20
|
-
},
|
|
21
|
-
factory: ({ config }) => ({
|
|
22
|
-
navTarget: {
|
|
23
|
-
title: config.title,
|
|
24
|
-
icon,
|
|
25
|
-
routeRef
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
((createNavItemExtension2) => {
|
|
31
|
-
createNavItemExtension2.targetDataRef = NavItemBlueprint.dataRefs.target;
|
|
32
|
-
})(createNavItemExtension || (createNavItemExtension = {}));
|
|
33
|
-
|
|
34
|
-
export { createNavItemExtension };
|
|
35
|
-
//# sourceMappingURL=createNavItemExtension.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 } from '../wiring';\nimport { RouteRef } from '../routing';\nimport { NavItemBlueprint } from '../blueprints/NavItemBlueprint';\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: NavItemBlueprint.dataRefs.target,\n },\n factory: ({ config }) => ({\n navTarget: {\n title: config.title,\n icon,\n routeRef,\n },\n }),\n });\n}\n\n/**\n * @public\n * @deprecated Use {@link NavItemBlueprint} instead.\n */\nexport namespace createNavItemExtension {\n /**\n * @deprecated Use {@link NavItemBlueprint} instead.\n */\n export const targetDataRef = NavItemBlueprint.dataRefs.target;\n}\n"],"names":["createNavItemExtension"],"mappings":";;;;;AA4BO,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,SAAA,EAAW,iBAAiB,QAAS,CAAA,MAAA;AAAA,KACvC;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,CAMO,CAAUA,uBAAV,KAAA;AAIE,EAAMA,uBAAAA,CAAA,aAAgB,GAAA,gBAAA,CAAiB,QAAS,CAAA,MAAA,CAAA;AAAA,CAJxC,EAAA,sBAAA,KAAA,sBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import '../wiring/coreExtensionData.esm.js';
|
|
2
|
-
import { createExtension } from '../wiring/createExtension.esm.js';
|
|
3
|
-
import { NavLogoBlueprint } from '../blueprints/NavLogoBlueprint.esm.js';
|
|
4
|
-
|
|
5
|
-
function createNavLogoExtension(options) {
|
|
6
|
-
const { logoIcon, logoFull } = options;
|
|
7
|
-
return createExtension({
|
|
8
|
-
kind: "nav-logo",
|
|
9
|
-
name: options?.name,
|
|
10
|
-
namespace: options?.namespace,
|
|
11
|
-
attachTo: { id: "app/nav", input: "logos" },
|
|
12
|
-
output: {
|
|
13
|
-
logos: NavLogoBlueprint.dataRefs.logoElements
|
|
14
|
-
},
|
|
15
|
-
factory: () => {
|
|
16
|
-
return {
|
|
17
|
-
logos: {
|
|
18
|
-
logoIcon,
|
|
19
|
-
logoFull
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
((createNavLogoExtension2) => {
|
|
26
|
-
createNavLogoExtension2.logoElementsDataRef = NavLogoBlueprint.dataRefs.logoElements;
|
|
27
|
-
})(createNavLogoExtension || (createNavLogoExtension = {}));
|
|
28
|
-
|
|
29
|
-
export { createNavLogoExtension };
|
|
30
|
-
//# sourceMappingURL=createNavLogoExtension.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 } from '../wiring';\nimport { NavLogoBlueprint } from '../blueprints/NavLogoBlueprint';\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: NavLogoBlueprint.dataRefs.logoElements,\n },\n factory: () => {\n return {\n logos: {\n logoIcon,\n logoFull,\n },\n };\n },\n });\n}\n\n/**\n * @public\n * @deprecated Use {@link NavLogoBlueprint} instead.\n */\nexport namespace createNavLogoExtension {\n /**\n * @deprecated Use {@link NavLogoBlueprint} instead.\n */\n export const logoElementsDataRef = NavLogoBlueprint.dataRefs.logoElements;\n}\n"],"names":["createNavLogoExtension"],"mappings":";;;;AAyBO,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,KAAA,EAAO,iBAAiB,QAAS,CAAA,YAAA;AAAA,KACnC;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,CAMO,CAAUA,uBAAV,KAAA;AAIE,EAAMA,uBAAAA,CAAA,mBAAsB,GAAA,gBAAA,CAAiB,QAAS,CAAA,YAAA,CAAA;AAAA,CAJ9C,EAAA,sBAAA,KAAA,sBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import React, { lazy } from 'react';
|
|
2
|
-
import { ExtensionBoundary } from '../components/ExtensionBoundary.esm.js';
|
|
3
|
-
import { createSchemaFromZod } from '../schema/createSchemaFromZod.esm.js';
|
|
4
|
-
import { coreExtensionData } from '../wiring/coreExtensionData.esm.js';
|
|
5
|
-
import { createExtension } from '../wiring/createExtension.esm.js';
|
|
6
|
-
|
|
7
|
-
function createPageExtension(options) {
|
|
8
|
-
const configSchema = "configSchema" in options ? options.configSchema : createSchemaFromZod(
|
|
9
|
-
(z) => z.object({ path: z.string().default(options.defaultPath) })
|
|
10
|
-
);
|
|
11
|
-
return createExtension({
|
|
12
|
-
kind: "page",
|
|
13
|
-
namespace: options.namespace,
|
|
14
|
-
name: options.name,
|
|
15
|
-
attachTo: options.attachTo ?? { id: "app/routes", input: "routes" },
|
|
16
|
-
configSchema,
|
|
17
|
-
inputs: options.inputs,
|
|
18
|
-
disabled: options.disabled,
|
|
19
|
-
output: {
|
|
20
|
-
element: coreExtensionData.reactElement,
|
|
21
|
-
path: coreExtensionData.routePath,
|
|
22
|
-
routeRef: coreExtensionData.routeRef.optional()
|
|
23
|
-
},
|
|
24
|
-
factory({ config, inputs, node }) {
|
|
25
|
-
const ExtensionComponent = lazy(
|
|
26
|
-
() => options.loader({ config, inputs }).then((element) => ({ default: () => element }))
|
|
27
|
-
);
|
|
28
|
-
return {
|
|
29
|
-
path: config.path,
|
|
30
|
-
routeRef: options.routeRef,
|
|
31
|
-
element: /* @__PURE__ */ React.createElement(ExtensionBoundary, { node }, /* @__PURE__ */ React.createElement(ExtensionComponent, null))
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { createPageExtension };
|
|
38
|
-
//# sourceMappingURL=createPageExtension.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { createExtension } from '../wiring/createExtension.esm.js';
|
|
3
|
-
import { RouterBlueprint } from '../blueprints/RouterBlueprint.esm.js';
|
|
4
|
-
|
|
5
|
-
function createRouterExtension(options) {
|
|
6
|
-
return createExtension({
|
|
7
|
-
kind: "app-router-component",
|
|
8
|
-
namespace: options.namespace,
|
|
9
|
-
name: options.name,
|
|
10
|
-
attachTo: options.attachTo ?? { id: "app/root", input: "router" },
|
|
11
|
-
configSchema: options.configSchema,
|
|
12
|
-
disabled: options.disabled,
|
|
13
|
-
inputs: options.inputs,
|
|
14
|
-
output: {
|
|
15
|
-
component: RouterBlueprint.dataRefs.component
|
|
16
|
-
},
|
|
17
|
-
factory({ inputs, config }) {
|
|
18
|
-
const Component = (props) => {
|
|
19
|
-
return /* @__PURE__ */ React.createElement(options.Component, { inputs, config }, props.children);
|
|
20
|
-
};
|
|
21
|
-
return {
|
|
22
|
-
component: Component
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
((createRouterExtension2) => {
|
|
28
|
-
createRouterExtension2.componentDataRef = RouterBlueprint.dataRefs.component;
|
|
29
|
-
})(createRouterExtension || (createRouterExtension = {}));
|
|
30
|
-
|
|
31
|
-
export { createRouterExtension };
|
|
32
|
-
//# sourceMappingURL=createRouterExtension.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 { Expand } from '../types';\nimport { RouterBlueprint } from '../blueprints/RouterBlueprint';\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: RouterBlueprint.dataRefs.component,\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/**\n * @public\n * @deprecated Use {@link RouterBlueprint} instead.\n */\nexport namespace createRouterExtension {\n /**\n * @deprecated Use {@link RouterBlueprint} instead.\n */\n export const componentDataRef = RouterBlueprint.dataRefs.component;\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,SAAA,EAAW,gBAAgB,QAAS,CAAA,SAAA;AAAA,KACtC;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,CAMO,CAAUA,sBAAV,KAAA;AAIE,EAAMA,sBAAAA,CAAA,gBAAmB,GAAA,eAAA,CAAgB,QAAS,CAAA,SAAA,CAAA;AAAA,CAJ1C,EAAA,qBAAA,KAAA,qBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React, { lazy } from 'react';
|
|
2
|
-
import { ExtensionBoundary } from '../components/ExtensionBoundary.esm.js';
|
|
3
|
-
import '../wiring/coreExtensionData.esm.js';
|
|
4
|
-
import { createExtension } from '../wiring/createExtension.esm.js';
|
|
5
|
-
import '../blueprints/ApiBlueprint.esm.js';
|
|
6
|
-
import '../blueprints/AppRootElementBlueprint.esm.js';
|
|
7
|
-
import '../blueprints/AppRootWrapperBlueprint.esm.js';
|
|
8
|
-
import '../blueprints/IconBundleBlueprint.esm.js';
|
|
9
|
-
import '../blueprints/NavItemBlueprint.esm.js';
|
|
10
|
-
import '../blueprints/NavLogoBlueprint.esm.js';
|
|
11
|
-
import '../blueprints/PageBlueprint.esm.js';
|
|
12
|
-
import '../blueprints/RouterBlueprint.esm.js';
|
|
13
|
-
import { SignInPageBlueprint } from '../blueprints/SignInPageBlueprint.esm.js';
|
|
14
|
-
import '../blueprints/ThemeBlueprint.esm.js';
|
|
15
|
-
import '../blueprints/TranslationBlueprint.esm.js';
|
|
16
|
-
|
|
17
|
-
function createSignInPageExtension(options) {
|
|
18
|
-
return createExtension({
|
|
19
|
-
kind: "sign-in-page",
|
|
20
|
-
namespace: options?.namespace,
|
|
21
|
-
name: options?.name,
|
|
22
|
-
attachTo: options.attachTo ?? { id: "app/root", input: "signInPage" },
|
|
23
|
-
configSchema: options.configSchema,
|
|
24
|
-
inputs: options.inputs,
|
|
25
|
-
disabled: options.disabled,
|
|
26
|
-
output: {
|
|
27
|
-
component: createSignInPageExtension.componentDataRef
|
|
28
|
-
},
|
|
29
|
-
factory({ config, inputs, node }) {
|
|
30
|
-
const ExtensionComponent = lazy(
|
|
31
|
-
() => options.loader({ config, inputs }).then((component) => ({ default: component }))
|
|
32
|
-
);
|
|
33
|
-
return {
|
|
34
|
-
component: (props) => /* @__PURE__ */ React.createElement(ExtensionBoundary, { node, routable: true }, /* @__PURE__ */ React.createElement(ExtensionComponent, { ...props }))
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
((createSignInPageExtension2) => {
|
|
40
|
-
createSignInPageExtension2.componentDataRef = SignInPageBlueprint.dataRefs.component;
|
|
41
|
-
})(createSignInPageExtension || (createSignInPageExtension = {}));
|
|
42
|
-
|
|
43
|
-
export { createSignInPageExtension };
|
|
44
|
-
//# sourceMappingURL=createSignInPageExtension.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 ExtensionDefinition,\n} from '../wiring';\nimport { Expand } from '../types';\nimport { SignInPageProps } from '@backstage/core-plugin-api';\nimport { SignInPageBlueprint } from '../blueprints';\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/**\n * @public\n * @deprecated Use {@link SignInPageBlueprint} instead.\n */\nexport namespace createSignInPageExtension {\n /**\n * @deprecated Use {@link SignInPageBlueprint} instead.\n */\n export const componentDataRef = SignInPageBlueprint.dataRefs.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,CAMO,CAAUA,0BAAV,KAAA;AAIE,EAAMA,0BAAAA,CAAA,gBAAmB,GAAA,mBAAA,CAAoB,QAAS,CAAA,SAAA,CAAA;AAAA,CAJ9C,EAAA,yBAAA,KAAA,yBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ThemeBlueprint } from '../blueprints/ThemeBlueprint.esm.js';
|
|
2
|
-
import '../wiring/coreExtensionData.esm.js';
|
|
3
|
-
import { createExtension } from '../wiring/createExtension.esm.js';
|
|
4
|
-
|
|
5
|
-
function createThemeExtension(theme) {
|
|
6
|
-
return createExtension({
|
|
7
|
-
kind: "theme",
|
|
8
|
-
namespace: "app",
|
|
9
|
-
name: theme.id,
|
|
10
|
-
attachTo: { id: "app", input: "themes" },
|
|
11
|
-
output: {
|
|
12
|
-
theme: ThemeBlueprint.dataRefs.theme
|
|
13
|
-
},
|
|
14
|
-
factory: () => ({ theme })
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
((createThemeExtension2) => {
|
|
18
|
-
createThemeExtension2.themeDataRef = ThemeBlueprint.dataRefs.theme;
|
|
19
|
-
})(createThemeExtension || (createThemeExtension = {}));
|
|
20
|
-
|
|
21
|
-
export { createThemeExtension };
|
|
22
|
-
//# sourceMappingURL=createThemeExtension.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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 { ThemeBlueprint } from '../blueprints/ThemeBlueprint';\nimport { createExtension } 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: ThemeBlueprint.dataRefs.theme,\n },\n factory: () => ({ theme }),\n });\n}\n\n/**\n * @public\n * @deprecated Use {@link ThemeBlueprint} instead.\n */\nexport namespace createThemeExtension {\n export const themeDataRef = ThemeBlueprint.dataRefs.theme;\n}\n"],"names":["createThemeExtension"],"mappings":";;;;AAwBO,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,KAAA,EAAO,eAAe,QAAS,CAAA,KAAA;AAAA,KACjC;AAAA,IACA,OAAA,EAAS,OAAO,EAAE,KAAM,EAAA,CAAA;AAAA,GACzB,CAAA,CAAA;AACH,CAAA;AAAA,CAMO,CAAUA,qBAAV,KAAA;AACE,EAAMA,qBAAAA,CAAA,YAAe,GAAA,cAAA,CAAe,QAAS,CAAA,KAAA,CAAA;AAAA,CADrC,EAAA,oBAAA,KAAA,oBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { TranslationBlueprint } from '../blueprints/TranslationBlueprint.esm.js';
|
|
2
|
-
import '../wiring/coreExtensionData.esm.js';
|
|
3
|
-
import { createExtension } from '../wiring/createExtension.esm.js';
|
|
4
|
-
|
|
5
|
-
function createTranslationExtension(options) {
|
|
6
|
-
return createExtension({
|
|
7
|
-
kind: "translation",
|
|
8
|
-
namespace: options.resource.id,
|
|
9
|
-
name: options.name,
|
|
10
|
-
attachTo: { id: "app", input: "translations" },
|
|
11
|
-
output: {
|
|
12
|
-
resource: TranslationBlueprint.dataRefs.translation
|
|
13
|
-
},
|
|
14
|
-
factory: () => ({ resource: options.resource })
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
((createTranslationExtension2) => {
|
|
18
|
-
createTranslationExtension2.translationDataRef = TranslationBlueprint.dataRefs.translation;
|
|
19
|
-
})(createTranslationExtension || (createTranslationExtension = {}));
|
|
20
|
-
|
|
21
|
-
export { createTranslationExtension };
|
|
22
|
-
//# sourceMappingURL=createTranslationExtension.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createTranslationExtension.esm.js","sources":["../../src/extensions/createTranslationExtension.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 { TranslationBlueprint } from '../blueprints/TranslationBlueprint';\nimport { TranslationMessages, TranslationResource } from '../translation';\nimport { createExtension } from '../wiring';\n\n/**\n * @public\n * @deprecated Use {@link TranslationBlueprint} instead.\n */\nexport function createTranslationExtension(options: {\n name?: string;\n resource: TranslationResource | TranslationMessages;\n}) {\n return createExtension({\n kind: 'translation',\n namespace: options.resource.id,\n name: options.name,\n attachTo: { id: 'app', input: 'translations' },\n output: {\n resource: TranslationBlueprint.dataRefs.translation,\n },\n factory: () => ({ resource: options.resource }),\n });\n}\n\n/**\n * @public\n * @deprecated Use {@link TranslationBlueprint} instead.\n */\nexport namespace createTranslationExtension {\n export const translationDataRef = TranslationBlueprint.dataRefs.translation;\n}\n"],"names":["createTranslationExtension"],"mappings":";;;;AAwBO,SAAS,2BAA2B,OAGxC,EAAA;AACD,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,aAAA;AAAA,IACN,SAAA,EAAW,QAAQ,QAAS,CAAA,EAAA;AAAA,IAC5B,MAAM,OAAQ,CAAA,IAAA;AAAA,IACd,QAAU,EAAA,EAAE,EAAI,EAAA,KAAA,EAAO,OAAO,cAAe,EAAA;AAAA,IAC7C,MAAQ,EAAA;AAAA,MACN,QAAA,EAAU,qBAAqB,QAAS,CAAA,WAAA;AAAA,KAC1C;AAAA,IACA,OAAS,EAAA,OAAO,EAAE,QAAA,EAAU,QAAQ,QAAS,EAAA,CAAA;AAAA,GAC9C,CAAA,CAAA;AACH,CAAA;AAAA,CAMO,CAAUA,2BAAV,KAAA;AACE,EAAMA,2BAAAA,CAAA,kBAAqB,GAAA,oBAAA,CAAqB,QAAS,CAAA,WAAA,CAAA;AAAA,CADjD,EAAA,0BAAA,KAAA,0BAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
|