@backstage/frontend-plugin-api 0.7.0 → 0.8.0-next.1
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 +106 -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 -2
- package/dist/blueprints/IconBundleBlueprint.esm.js.map +1 -1
- package/dist/blueprints/ThemeBlueprint.esm.js +1 -2
- 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 +14 -19
- package/dist/extensions/createComponentExtension.esm.js.map +1 -1
- package/dist/index.d.ts +466 -583
- package/dist/index.esm.js +1 -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/createFrontendModule.esm.js +43 -0
- package/dist/wiring/createFrontendModule.esm.js.map +1 -0
- package/dist/wiring/createFrontendPlugin.esm.js +7 -2
- package/dist/wiring/createFrontendPlugin.esm.js.map +1 -1
- package/dist/wiring/resolveExtensionDefinition.esm.js.map +1 -1
- package/package.json +6 -6
- 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
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { toInternalExtensionDefinition } from './createExtension.esm.js';
|
|
1
2
|
import { resolveExtensionDefinition } from './resolveExtensionDefinition.esm.js';
|
|
2
3
|
|
|
3
4
|
function createFrontendPlugin(options) {
|
|
4
5
|
const extensions = new Array();
|
|
5
6
|
const extensionDefinitionsById = /* @__PURE__ */ new Map();
|
|
6
7
|
for (const def of options.extensions ?? []) {
|
|
8
|
+
const internal = toInternalExtensionDefinition(def);
|
|
7
9
|
const ext = resolveExtensionDefinition(def, { namespace: options.id });
|
|
8
10
|
extensions.push(ext);
|
|
9
|
-
extensionDefinitionsById.set(ext.id, {
|
|
11
|
+
extensionDefinitionsById.set(ext.id, {
|
|
12
|
+
...internal,
|
|
13
|
+
namespace: options.id
|
|
14
|
+
});
|
|
10
15
|
}
|
|
11
16
|
if (extensions.length !== extensionDefinitionsById.size) {
|
|
12
17
|
const extensionIds = extensions.map((e) => e.id);
|
|
@@ -22,7 +27,7 @@ function createFrontendPlugin(options) {
|
|
|
22
27
|
);
|
|
23
28
|
}
|
|
24
29
|
return {
|
|
25
|
-
$$type: "@backstage/
|
|
30
|
+
$$type: "@backstage/FrontendPlugin",
|
|
26
31
|
version: "v1",
|
|
27
32
|
id: options.id,
|
|
28
33
|
routes: options.routes ?? {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFrontendPlugin.esm.js","sources":["../../src/wiring/createFrontendPlugin.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 {
|
|
1
|
+
{"version":3,"file":"createFrontendPlugin.esm.js","sources":["../../src/wiring/createFrontendPlugin.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 {\n ExtensionDefinition,\n InternalExtensionDefinition,\n toInternalExtensionDefinition,\n} from './createExtension';\nimport {\n Extension,\n ResolveExtensionId,\n resolveExtensionDefinition,\n} from './resolveExtensionDefinition';\nimport { AnyExternalRoutes, AnyRoutes, FeatureFlagConfig } from './types';\n\n/** @public */\nexport interface FrontendPlugin<\n TRoutes extends AnyRoutes = AnyRoutes,\n TExternalRoutes extends AnyExternalRoutes = AnyExternalRoutes,\n TExtensionMap extends { [id in string]: ExtensionDefinition } = {},\n> {\n readonly $$type: '@backstage/FrontendPlugin';\n readonly id: string;\n readonly routes: TRoutes;\n readonly externalRoutes: TExternalRoutes;\n getExtension<TId extends keyof TExtensionMap>(id: TId): TExtensionMap[TId];\n withOverrides(options: {\n extensions: Array<ExtensionDefinition>;\n }): FrontendPlugin<TRoutes, TExternalRoutes, TExtensionMap>;\n}\n\n/**\n * @public\n * @deprecated Use {@link FrontendPlugin} instead.\n */\nexport type BackstagePlugin<\n TRoutes extends AnyRoutes = AnyRoutes,\n TExternalRoutes extends AnyExternalRoutes = AnyExternalRoutes,\n TExtensionMap extends { [id in string]: ExtensionDefinition } = {},\n> = FrontendPlugin<TRoutes, TExternalRoutes, TExtensionMap>;\n/** @public */\nexport interface PluginOptions<\n TId extends string,\n TRoutes extends AnyRoutes,\n TExternalRoutes extends AnyExternalRoutes,\n TExtensions extends readonly ExtensionDefinition[],\n> {\n id: TId;\n routes?: TRoutes;\n externalRoutes?: TExternalRoutes;\n extensions?: TExtensions;\n featureFlags?: FeatureFlagConfig[];\n}\n\n/** @public */\nexport interface InternalFrontendPlugin<\n TRoutes extends AnyRoutes = AnyRoutes,\n TExternalRoutes extends AnyExternalRoutes = AnyExternalRoutes,\n> extends FrontendPlugin<TRoutes, TExternalRoutes> {\n readonly version: 'v1';\n readonly extensions: Extension<unknown>[];\n readonly featureFlags: FeatureFlagConfig[];\n}\n\n/** @public */\nexport function createFrontendPlugin<\n TId extends string,\n TRoutes extends AnyRoutes = {},\n TExternalRoutes extends AnyExternalRoutes = {},\n TExtensions extends readonly ExtensionDefinition[] = [],\n>(\n options: PluginOptions<TId, TRoutes, TExternalRoutes, TExtensions>,\n): FrontendPlugin<\n TRoutes,\n TExternalRoutes,\n {\n [KExtension in TExtensions[number] as ResolveExtensionId<\n KExtension,\n TId\n >]: KExtension;\n }\n> {\n const extensions = new Array<Extension<any>>();\n const extensionDefinitionsById = new Map<\n string,\n InternalExtensionDefinition\n >();\n\n for (const def of options.extensions ?? []) {\n const internal = toInternalExtensionDefinition(def);\n const ext = resolveExtensionDefinition(def, { namespace: options.id });\n extensions.push(ext);\n extensionDefinitionsById.set(ext.id, {\n ...internal,\n namespace: options.id,\n });\n }\n\n if (extensions.length !== extensionDefinitionsById.size) {\n const extensionIds = extensions.map(e => e.id);\n const duplicates = Array.from(\n new Set(\n extensionIds.filter((id, index) => extensionIds.indexOf(id) !== index),\n ),\n );\n // TODO(Rugvip): This could provide some more information about the kind + name of the extensions\n throw new Error(\n `Plugin '${options.id}' provided duplicate extensions: ${duplicates.join(\n ', ',\n )}`,\n );\n }\n\n return {\n $$type: '@backstage/FrontendPlugin',\n version: 'v1',\n id: options.id,\n routes: options.routes ?? ({} as TRoutes),\n externalRoutes: options.externalRoutes ?? ({} as TExternalRoutes),\n featureFlags: options.featureFlags ?? [],\n extensions,\n getExtension(id) {\n return extensionDefinitionsById.get(id);\n },\n toString() {\n return `Plugin{id=${options.id}}`;\n },\n withOverrides(overrides) {\n const overriddenExtensionIds = new Set(\n overrides.extensions.map(\n e => resolveExtensionDefinition(e, { namespace: options.id }).id,\n ),\n );\n const nonOverriddenExtensions = (options.extensions ?? []).filter(\n e =>\n !overriddenExtensionIds.has(\n resolveExtensionDefinition(e, { namespace: options.id }).id,\n ),\n );\n return createFrontendPlugin({\n ...options,\n extensions: [...nonOverriddenExtensions, ...overrides.extensions],\n });\n },\n } as InternalFrontendPlugin<TRoutes, TExternalRoutes>;\n}\n\n/** @internal */\nexport function isInternalFrontendPlugin(opaque: {\n $$type: string;\n}): opaque is InternalFrontendPlugin {\n if (\n opaque.$$type === '@backstage/FrontendPlugin' ||\n opaque.$$type === '@backstage/BackstagePlugin'\n ) {\n // Make sure we throw if invalid\n toInternalFrontendPlugin(opaque as FrontendPlugin);\n return true;\n }\n return false;\n}\n\n/** @internal */\nexport function toInternalFrontendPlugin(\n plugin: FrontendPlugin,\n): InternalFrontendPlugin {\n const internal = plugin as InternalFrontendPlugin;\n if (\n internal.$$type !== '@backstage/FrontendPlugin' &&\n internal.$$type !== '@backstage/BackstagePlugin'\n ) {\n throw new Error(`Invalid plugin instance, bad type '${internal.$$type}'`);\n }\n if (internal.version !== 'v1') {\n throw new Error(\n `Invalid plugin instance, bad version '${internal.version}'`,\n );\n }\n return internal;\n}\n\n/**\n * @public\n * @deprecated Use {@link createFrontendPlugin} instead.\n */\nexport const createPlugin = createFrontendPlugin;\n"],"names":[],"mappings":";;;AA8EO,SAAS,qBAMd,OAUA,EAAA;AACA,EAAM,MAAA,UAAA,GAAa,IAAI,KAAsB,EAAA,CAAA;AAC7C,EAAM,MAAA,wBAAA,uBAA+B,GAGnC,EAAA,CAAA;AAEF,EAAA,KAAA,MAAW,GAAO,IAAA,OAAA,CAAQ,UAAc,IAAA,EAAI,EAAA;AAC1C,IAAM,MAAA,QAAA,GAAW,8BAA8B,GAAG,CAAA,CAAA;AAClD,IAAA,MAAM,MAAM,0BAA2B,CAAA,GAAA,EAAK,EAAE,SAAW,EAAA,OAAA,CAAQ,IAAI,CAAA,CAAA;AACrE,IAAA,UAAA,CAAW,KAAK,GAAG,CAAA,CAAA;AACnB,IAAyB,wBAAA,CAAA,GAAA,CAAI,IAAI,EAAI,EAAA;AAAA,MACnC,GAAG,QAAA;AAAA,MACH,WAAW,OAAQ,CAAA,EAAA;AAAA,KACpB,CAAA,CAAA;AAAA,GACH;AAEA,EAAI,IAAA,UAAA,CAAW,MAAW,KAAA,wBAAA,CAAyB,IAAM,EAAA;AACvD,IAAA,MAAM,YAAe,GAAA,UAAA,CAAW,GAAI,CAAA,CAAA,CAAA,KAAK,EAAE,EAAE,CAAA,CAAA;AAC7C,IAAA,MAAM,aAAa,KAAM,CAAA,IAAA;AAAA,MACvB,IAAI,GAAA;AAAA,QACF,YAAA,CAAa,OAAO,CAAC,EAAA,EAAI,UAAU,YAAa,CAAA,OAAA,CAAQ,EAAE,CAAA,KAAM,KAAK,CAAA;AAAA,OACvE;AAAA,KACF,CAAA;AAEA,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAW,QAAA,EAAA,OAAA,CAAQ,EAAE,CAAA,iCAAA,EAAoC,UAAW,CAAA,IAAA;AAAA,QAClE,IAAA;AAAA,OACD,CAAA,CAAA;AAAA,KACH,CAAA;AAAA,GACF;AAEA,EAAO,OAAA;AAAA,IACL,MAAQ,EAAA,2BAAA;AAAA,IACR,OAAS,EAAA,IAAA;AAAA,IACT,IAAI,OAAQ,CAAA,EAAA;AAAA,IACZ,MAAA,EAAQ,OAAQ,CAAA,MAAA,IAAW,EAAC;AAAA,IAC5B,cAAA,EAAgB,OAAQ,CAAA,cAAA,IAAmB,EAAC;AAAA,IAC5C,YAAA,EAAc,OAAQ,CAAA,YAAA,IAAgB,EAAC;AAAA,IACvC,UAAA;AAAA,IACA,aAAa,EAAI,EAAA;AACf,MAAO,OAAA,wBAAA,CAAyB,IAAI,EAAE,CAAA,CAAA;AAAA,KACxC;AAAA,IACA,QAAW,GAAA;AACT,MAAO,OAAA,CAAA,UAAA,EAAa,QAAQ,EAAE,CAAA,CAAA,CAAA,CAAA;AAAA,KAChC;AAAA,IACA,cAAc,SAAW,EAAA;AACvB,MAAA,MAAM,yBAAyB,IAAI,GAAA;AAAA,QACjC,UAAU,UAAW,CAAA,GAAA;AAAA,UACnB,CAAA,CAAA,KAAK,2BAA2B,CAAG,EAAA,EAAE,WAAW,OAAQ,CAAA,EAAA,EAAI,CAAE,CAAA,EAAA;AAAA,SAChE;AAAA,OACF,CAAA;AACA,MAAA,MAAM,uBAA2B,GAAA,CAAA,OAAA,CAAQ,UAAc,IAAA,EAAI,EAAA,MAAA;AAAA,QACzD,CAAA,CAAA,KACE,CAAC,sBAAuB,CAAA,GAAA;AAAA,UACtB,2BAA2B,CAAG,EAAA,EAAE,WAAW,OAAQ,CAAA,EAAA,EAAI,CAAE,CAAA,EAAA;AAAA,SAC3D;AAAA,OACJ,CAAA;AACA,MAAA,OAAO,oBAAqB,CAAA;AAAA,QAC1B,GAAG,OAAA;AAAA,QACH,YAAY,CAAC,GAAG,uBAAyB,EAAA,GAAG,UAAU,UAAU,CAAA;AAAA,OACjE,CAAA,CAAA;AAAA,KACH;AAAA,GACF,CAAA;AACF,CAAA;AAwCO,MAAM,YAAe,GAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveExtensionDefinition.esm.js","sources":["../../src/wiring/resolveExtensionDefinition.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 { AppNode } from '../apis';\nimport {\n
|
|
1
|
+
{"version":3,"file":"resolveExtensionDefinition.esm.js","sources":["../../src/wiring/resolveExtensionDefinition.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 { ApiHolder, AppNode } from '../apis';\nimport {\n ExtensionDefinition,\n ExtensionDefinitionParameters,\n ResolvedExtensionInputs,\n toInternalExtensionDefinition,\n} from './createExtension';\nimport { PortableSchema } from '../schema';\nimport { ExtensionInput } from './createExtensionInput';\nimport {\n AnyExtensionDataRef,\n ExtensionDataValue,\n} from './createExtensionDataRef';\n\n/** @public */\nexport interface Extension<TConfig, TConfigInput = TConfig> {\n $$type: '@backstage/Extension';\n readonly id: string;\n readonly attachTo: { id: string; input: string };\n readonly disabled: boolean;\n readonly configSchema?: PortableSchema<TConfig, TConfigInput>;\n}\n\n/** @internal */\nexport type InternalExtension<TConfig, TConfigInput> = Extension<\n TConfig,\n TConfigInput\n> &\n (\n | {\n readonly version: 'v1';\n readonly inputs: {\n [inputName in string]: {\n $$type: '@backstage/ExtensionInput';\n extensionData: {\n [name in string]: AnyExtensionDataRef;\n };\n config: { optional: boolean; singleton: boolean };\n };\n };\n readonly output: {\n [name in string]: AnyExtensionDataRef;\n };\n factory(context: {\n apis: ApiHolder;\n node: AppNode;\n config: TConfig;\n inputs: {\n [inputName in string]: unknown;\n };\n }): {\n [inputName in string]: unknown;\n };\n }\n | {\n readonly version: 'v2';\n readonly inputs: {\n [inputName in string]: ExtensionInput<\n AnyExtensionDataRef,\n { optional: boolean; singleton: boolean }\n >;\n };\n readonly output: Array<AnyExtensionDataRef>;\n factory(options: {\n apis: ApiHolder;\n node: AppNode;\n config: TConfig;\n inputs: ResolvedExtensionInputs<{\n [inputName in string]: ExtensionInput<\n AnyExtensionDataRef,\n { optional: boolean; singleton: boolean }\n >;\n }>;\n }): Iterable<ExtensionDataValue<any, any>>;\n }\n );\n\n/** @internal */\nexport function toInternalExtension<TConfig, TConfigInput>(\n overrides: Extension<TConfig, TConfigInput>,\n): InternalExtension<TConfig, TConfigInput> {\n const internal = overrides as InternalExtension<TConfig, TConfigInput>;\n if (internal.$$type !== '@backstage/Extension') {\n throw new Error(\n `Invalid extension instance, bad type '${internal.$$type}'`,\n );\n }\n const version = internal.version;\n if (version !== 'v1' && version !== 'v2') {\n throw new Error(`Invalid extension instance, bad version '${version}'`);\n }\n return internal;\n}\n\n/** @ignore */\nexport type ResolveExtensionId<\n TExtension extends ExtensionDefinition,\n TDefaultNamespace extends string | undefined,\n> = TExtension extends ExtensionDefinition<{\n kind: infer IKind extends string | undefined;\n namespace: infer INamespace extends string | undefined;\n name: infer IName extends string | undefined;\n}>\n ? [string | undefined] extends [IKind | INamespace | IName]\n ? never\n : (\n (\n undefined extends TDefaultNamespace ? INamespace : TDefaultNamespace\n ) extends infer ISelectedNamespace extends string\n ? undefined extends IName\n ? ISelectedNamespace\n : `${ISelectedNamespace}/${IName}`\n : IName\n ) extends infer INamePart extends string\n ? IKind extends string\n ? `${IKind}:${INamePart}`\n : INamePart\n : never\n : never;\n\n/** @internal */\nexport function resolveExtensionDefinition<\n T extends ExtensionDefinitionParameters,\n>(\n definition: ExtensionDefinition<T>,\n context?: { namespace?: string },\n): Extension<T['config'], T['configInput']> {\n const internalDefinition = toInternalExtensionDefinition(definition);\n const {\n name,\n kind,\n namespace: _skip1,\n override: _skip2,\n ...rest\n } = internalDefinition;\n\n const namespace = internalDefinition.namespace ?? context?.namespace;\n\n const namePart =\n name && namespace ? `${namespace}/${name}` : namespace || name;\n if (!namePart) {\n throw new Error(\n `Extension must declare an explicit namespace or name as it could not be resolved from context, kind=${kind} namespace=${namespace} name=${name}`,\n );\n }\n\n const id = kind ? `${kind}:${namePart}` : namePart;\n\n return {\n ...rest,\n $$type: '@backstage/Extension',\n version: internalDefinition.version,\n id,\n toString() {\n return `Extension{id=${id}}`;\n },\n } as InternalExtension<T['config'], T['configInput']> & Object;\n}\n"],"names":[],"mappings":";;AAyIgB,SAAA,0BAAA,CAGd,YACA,OAC0C,EAAA;AAC1C,EAAM,MAAA,kBAAA,GAAqB,8BAA8B,UAAU,CAAA,CAAA;AACnE,EAAM,MAAA;AAAA,IACJ,IAAA;AAAA,IACA,IAAA;AAAA,IACA,SAAW,EAAA,MAAA;AAAA,IACX,QAAU,EAAA,MAAA;AAAA,IACV,GAAG,IAAA;AAAA,GACD,GAAA,kBAAA,CAAA;AAEJ,EAAM,MAAA,SAAA,GAAY,kBAAmB,CAAA,SAAA,IAAa,OAAS,EAAA,SAAA,CAAA;AAE3D,EAAM,MAAA,QAAA,GACJ,QAAQ,SAAY,GAAA,CAAA,EAAG,SAAS,CAAI,CAAA,EAAA,IAAI,KAAK,SAAa,IAAA,IAAA,CAAA;AAC5D,EAAA,IAAI,CAAC,QAAU,EAAA;AACb,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAuG,oGAAA,EAAA,IAAI,CAAc,WAAA,EAAA,SAAS,SAAS,IAAI,CAAA,CAAA;AAAA,KACjJ,CAAA;AAAA,GACF;AAEA,EAAA,MAAM,KAAK,IAAO,GAAA,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,QAAQ,CAAK,CAAA,GAAA,QAAA,CAAA;AAE1C,EAAO,OAAA;AAAA,IACL,GAAG,IAAA;AAAA,IACH,MAAQ,EAAA,sBAAA;AAAA,IACR,SAAS,kBAAmB,CAAA,OAAA;AAAA,IAC5B,EAAA;AAAA,IACA,QAAW,GAAA;AACT,MAAA,OAAO,gBAAgB,EAAE,CAAA,CAAA,CAAA,CAAA;AAAA,KAC3B;AAAA,GACF,CAAA;AACF;;;;"}
|
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.1",
|
|
4
4
|
"backstage": {
|
|
5
5
|
"role": "web-library"
|
|
6
6
|
},
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"test": "backstage-cli package test"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@backstage/core-components": "^0.14.
|
|
34
|
+
"@backstage/core-components": "^0.14.11-next.0",
|
|
35
35
|
"@backstage/core-plugin-api": "^1.9.3",
|
|
36
36
|
"@backstage/types": "^1.1.1",
|
|
37
37
|
"@backstage/version-bridge": "^1.0.8",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"zod-to-json-schema": "^3.21.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@backstage/cli": "^0.27.
|
|
46
|
-
"@backstage/frontend-app-api": "^0.
|
|
47
|
-
"@backstage/frontend-test-utils": "^0.1
|
|
48
|
-
"@backstage/test-utils": "^1.
|
|
45
|
+
"@backstage/cli": "^0.27.1-next.1",
|
|
46
|
+
"@backstage/frontend-app-api": "^0.9.0-next.1",
|
|
47
|
+
"@backstage/frontend-test-utils": "^0.2.0-next.1",
|
|
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;;;;"}
|