@backstage/frontend-plugin-api 0.7.0-next.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +244 -0
  2. package/dist/blueprints/ApiBlueprint.esm.js +23 -0
  3. package/dist/blueprints/ApiBlueprint.esm.js.map +1 -0
  4. package/dist/blueprints/AppRootElementBlueprint.esm.js +18 -0
  5. package/dist/blueprints/AppRootElementBlueprint.esm.js.map +1 -0
  6. package/dist/blueprints/AppRootWrapperBlueprint.esm.js +25 -0
  7. package/dist/blueprints/AppRootWrapperBlueprint.esm.js.map +1 -0
  8. package/dist/blueprints/IconBundleBlueprint.esm.js.map +1 -0
  9. package/dist/blueprints/NavItemBlueprint.esm.js +34 -0
  10. package/dist/blueprints/NavItemBlueprint.esm.js.map +1 -0
  11. package/dist/blueprints/NavLogoBlueprint.esm.js +27 -0
  12. package/dist/blueprints/NavLogoBlueprint.esm.js.map +1 -0
  13. package/dist/blueprints/PageBlueprint.esm.js +34 -0
  14. package/dist/blueprints/PageBlueprint.esm.js.map +1 -0
  15. package/dist/blueprints/RouterBlueprint.esm.js +21 -0
  16. package/dist/blueprints/RouterBlueprint.esm.js.map +1 -0
  17. package/dist/blueprints/SignInPageBlueprint.esm.js +28 -0
  18. package/dist/blueprints/SignInPageBlueprint.esm.js.map +1 -0
  19. package/dist/blueprints/ThemeBlueprint.esm.js +22 -0
  20. package/dist/blueprints/ThemeBlueprint.esm.js.map +1 -0
  21. package/dist/blueprints/TranslationBlueprint.esm.js +21 -0
  22. package/dist/blueprints/TranslationBlueprint.esm.js.map +1 -0
  23. package/dist/components/ExtensionBoundary.esm.js +10 -1
  24. package/dist/components/ExtensionBoundary.esm.js.map +1 -1
  25. package/dist/extensions/createApiExtension.esm.js +3 -5
  26. package/dist/extensions/createApiExtension.esm.js.map +1 -1
  27. package/dist/extensions/createAppRootElementExtension.esm.js.map +1 -1
  28. package/dist/extensions/createAppRootWrapperExtension.esm.js +3 -3
  29. package/dist/extensions/createAppRootWrapperExtension.esm.js.map +1 -1
  30. package/dist/extensions/createComponentExtension.esm.js.map +1 -1
  31. package/dist/extensions/createNavItemExtension.esm.js +3 -3
  32. package/dist/extensions/createNavItemExtension.esm.js.map +1 -1
  33. package/dist/extensions/createNavLogoExtension.esm.js +3 -3
  34. package/dist/extensions/createNavLogoExtension.esm.js.map +1 -1
  35. package/dist/extensions/createPageExtension.esm.js.map +1 -1
  36. package/dist/extensions/createRouterExtension.esm.js +3 -3
  37. package/dist/extensions/createRouterExtension.esm.js.map +1 -1
  38. package/dist/extensions/createSignInPageExtension.esm.js +12 -2
  39. package/dist/extensions/createSignInPageExtension.esm.js.map +1 -1
  40. package/dist/extensions/createThemeExtension.esm.js +3 -5
  41. package/dist/extensions/createThemeExtension.esm.js.map +1 -1
  42. package/dist/extensions/createTranslationExtension.esm.js +3 -3
  43. package/dist/extensions/createTranslationExtension.esm.js.map +1 -1
  44. package/dist/index.d.ts +517 -128
  45. package/dist/index.esm.js +12 -2
  46. package/dist/index.esm.js.map +1 -1
  47. package/dist/wiring/createExtension.esm.js +75 -8
  48. package/dist/wiring/createExtension.esm.js.map +1 -1
  49. package/dist/wiring/createExtensionBlueprint.esm.js +38 -27
  50. package/dist/wiring/createExtensionBlueprint.esm.js.map +1 -1
  51. package/dist/wiring/createExtensionDataContainer.esm.js +31 -0
  52. package/dist/wiring/createExtensionDataContainer.esm.js.map +1 -0
  53. package/dist/wiring/createExtensionDataRef.esm.js.map +1 -1
  54. package/dist/wiring/createFrontendPlugin.esm.js +59 -0
  55. package/dist/wiring/createFrontendPlugin.esm.js.map +1 -0
  56. package/dist/wiring/resolveExtensionDefinition.esm.js +7 -1
  57. package/dist/wiring/resolveExtensionDefinition.esm.js.map +1 -1
  58. package/dist/wiring/resolveInputOverrides.esm.js +76 -0
  59. package/dist/wiring/resolveInputOverrides.esm.js.map +1 -0
  60. package/package.json +6 -6
  61. package/dist/extensions/IconBundleBlueprint.esm.js.map +0 -1
  62. package/dist/wiring/createPlugin.esm.js +0 -35
  63. package/dist/wiring/createPlugin.esm.js.map +0 -1
  64. /package/dist/{extensions → blueprints}/IconBundleBlueprint.esm.js +0 -0
@@ -1,6 +1,6 @@
1
1
  import '../wiring/coreExtensionData.esm.js';
2
2
  import { createExtension } from '../wiring/createExtension.esm.js';
3
- import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
3
+ import { ApiBlueprint } from '../blueprints/ApiBlueprint.esm.js';
4
4
 
5
5
  function createApiExtension(options) {
6
6
  const { factory, configSchema, inputs: extensionInputs } = options;
@@ -14,7 +14,7 @@ function createApiExtension(options) {
14
14
  inputs: extensionInputs,
15
15
  configSchema,
16
16
  output: {
17
- api: createApiExtension.factoryDataRef
17
+ api: ApiBlueprint.dataRefs.factory
18
18
  },
19
19
  factory({ config, inputs }) {
20
20
  if (typeof factory === "function") {
@@ -25,9 +25,7 @@ function createApiExtension(options) {
25
25
  });
26
26
  }
27
27
  ((createApiExtension2) => {
28
- createApiExtension2.factoryDataRef = createExtensionDataRef().with({
29
- id: "core.api.factory"
30
- });
28
+ createApiExtension2.factoryDataRef = ApiBlueprint.dataRefs.factory;
31
29
  })(createApiExtension || (createApiExtension = {}));
32
30
 
33
31
  export { createApiExtension };
@@ -1 +1 @@
1
- {"version":3,"file":"createApiExtension.esm.js","sources":["../../src/extensions/createApiExtension.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AnyApiFactory, AnyApiRef } from '@backstage/core-plugin-api';\nimport { PortableSchema } from '../schema';\nimport {\n ResolvedExtensionInputs,\n createExtension,\n createExtensionDataRef,\n} from '../wiring';\nimport { AnyExtensionInputMap } from '../wiring/createExtension';\nimport { Expand } from '../types';\n\n/** @public */\nexport function createApiExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(\n options: (\n | {\n api: AnyApiRef;\n factory: (options: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => AnyApiFactory;\n }\n | {\n factory: AnyApiFactory;\n }\n ) & {\n configSchema?: PortableSchema<TConfig>;\n inputs?: TInputs;\n },\n) {\n const { factory, configSchema, inputs: extensionInputs } = options;\n\n const apiRef =\n 'api' in options ? options.api : (factory as { api: AnyApiRef }).api;\n\n return createExtension({\n kind: 'api',\n // Since ApiRef IDs use a global namespace we use the namespace here in order to override\n // potential plugin IDs and always end up with the format `api:<api-ref-id>`\n namespace: apiRef.id,\n attachTo: { id: 'app', input: 'apis' },\n inputs: extensionInputs,\n configSchema,\n output: {\n api: createApiExtension.factoryDataRef,\n },\n factory({ config, inputs }) {\n if (typeof factory === 'function') {\n return { api: factory({ config, inputs }) };\n }\n return { api: factory };\n },\n });\n}\n\n/** @public */\nexport namespace createApiExtension {\n export const factoryDataRef = createExtensionDataRef<AnyApiFactory>().with({\n id: 'core.api.factory',\n });\n}\n"],"names":["createApiExtension"],"mappings":";;;;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,KAAK,kBAAmB,CAAA,cAAA;AAAA,KAC1B;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAU,EAAA;AAC1B,MAAI,IAAA,OAAO,YAAY,UAAY,EAAA;AACjC,QAAA,OAAO,EAAE,GAAK,EAAA,OAAA,CAAQ,EAAE,MAAQ,EAAA,MAAA,EAAQ,CAAE,EAAA,CAAA;AAAA,OAC5C;AACA,MAAO,OAAA,EAAE,KAAK,OAAQ,EAAA,CAAA;AAAA,KACxB;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,mBAAV,KAAA;AACE,EAAMA,mBAAA,CAAA,cAAA,GAAiB,sBAAsC,EAAA,CAAE,IAAK,CAAA;AAAA,IACzE,EAAI,EAAA,kBAAA;AAAA,GACL,CAAA,CAAA;AAAA,CAHc,EAAA,kBAAA,KAAA,kBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
1
+ {"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 +1 @@
1
- {"version":3,"file":"createAppRootElementExtension.esm.js","sources":["../../src/extensions/createAppRootElementExtension.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { JSX } from 'react';\nimport { PortableSchema } from '../schema/types';\nimport { Expand } from '../types';\nimport { coreExtensionData } from '../wiring/coreExtensionData';\nimport {\n AnyExtensionInputMap,\n ExtensionDefinition,\n ResolvedExtensionInputs,\n createExtension,\n} from '../wiring/createExtension';\n\n/**\n * Creates an extension that renders a React element at the app root, outside of\n * the app layout. This is useful for example for shared popups and similar.\n *\n * @public\n */\nexport function createAppRootElementExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n configSchema?: PortableSchema<TConfig>;\n disabled?: boolean;\n inputs?: TInputs;\n element:\n | JSX.Element\n | ((options: {\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n config: TConfig;\n }) => JSX.Element);\n}): ExtensionDefinition<TConfig> {\n return createExtension({\n kind: 'app-root-element',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? { id: 'app/root', input: 'elements' },\n configSchema: options.configSchema,\n disabled: options.disabled,\n inputs: options.inputs,\n output: {\n element: coreExtensionData.reactElement,\n },\n factory({ inputs, config }) {\n return {\n element:\n typeof options.element === 'function'\n ? options.element({ inputs, config })\n : options.element,\n };\n },\n });\n}\n"],"names":[],"mappings":";;;AAiCO,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
+ {"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,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { createExtension } from '../wiring/createExtension.esm.js';
3
- import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
3
+ import { AppRootWrapperBlueprint } from '../blueprints/AppRootWrapperBlueprint.esm.js';
4
4
 
5
5
  function createAppRootWrapperExtension(options) {
6
6
  return createExtension({
@@ -12,7 +12,7 @@ function createAppRootWrapperExtension(options) {
12
12
  disabled: options.disabled,
13
13
  inputs: options.inputs,
14
14
  output: {
15
- component: createAppRootWrapperExtension.componentDataRef
15
+ component: AppRootWrapperBlueprint.dataRefs.component
16
16
  },
17
17
  factory({ inputs, config }) {
18
18
  const Component = (props) => {
@@ -25,7 +25,7 @@ function createAppRootWrapperExtension(options) {
25
25
  });
26
26
  }
27
27
  ((createAppRootWrapperExtension2) => {
28
- createAppRootWrapperExtension2.componentDataRef = createExtensionDataRef().with({ id: "app.root.wrapper" });
28
+ createAppRootWrapperExtension2.componentDataRef = AppRootWrapperBlueprint.dataRefs.component;
29
29
  })(createAppRootWrapperExtension || (createAppRootWrapperExtension = {}));
30
30
 
31
31
  export { createAppRootWrapperExtension };
@@ -1 +1 @@
1
- {"version":3,"file":"createAppRootWrapperExtension.esm.js","sources":["../../src/extensions/createAppRootWrapperExtension.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ComponentType, PropsWithChildren } from 'react';\nimport { PortableSchema } from '../schema/types';\nimport {\n AnyExtensionInputMap,\n ExtensionDefinition,\n ResolvedExtensionInputs,\n createExtension,\n} from '../wiring/createExtension';\nimport { createExtensionDataRef } from '../wiring/createExtensionDataRef';\nimport { Expand } from '../types';\n\n/**\n * Creates an extension that renders a React wrapper at the app root, enclosing\n * the app layout. This is useful for example for adding global React contexts\n * and similar.\n *\n * @public\n */\nexport function createAppRootWrapperExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n configSchema?: PortableSchema<TConfig>;\n disabled?: boolean;\n inputs?: TInputs;\n Component: ComponentType<\n PropsWithChildren<{\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n config: TConfig;\n }>\n >;\n}): ExtensionDefinition<TConfig> {\n return createExtension({\n kind: 'app-root-wrapper',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? { id: 'app/root', input: 'wrappers' },\n configSchema: options.configSchema,\n disabled: options.disabled,\n inputs: options.inputs,\n output: {\n component: createAppRootWrapperExtension.componentDataRef,\n },\n factory({ inputs, config }) {\n const Component = (props: PropsWithChildren<{}>) => {\n return (\n <options.Component inputs={inputs} config={config}>\n {props.children}\n </options.Component>\n );\n };\n return {\n component: Component,\n };\n },\n });\n}\n\n/** @public */\nexport namespace createAppRootWrapperExtension {\n export const componentDataRef = createExtensionDataRef<\n ComponentType<PropsWithChildren<{}>>\n >().with({ id: 'app.root.wrapper' });\n}\n"],"names":["createAppRootWrapperExtension"],"mappings":";;;;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,WAAW,6BAA8B,CAAA,gBAAA;AAAA,KAC3C;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAU,EAAA;AAC1B,MAAM,MAAA,SAAA,GAAY,CAAC,KAAiC,KAAA;AAClD,QAAA,2CACG,OAAQ,CAAA,SAAA,EAAR,EAAkB,MAAgB,EAAA,MAAA,EAAA,EAChC,MAAM,QACT,CAAA,CAAA;AAAA,OAEJ,CAAA;AACA,MAAO,OAAA;AAAA,QACL,SAAW,EAAA,SAAA;AAAA,OACb,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,8BAAV,KAAA;AACE,EAAMA,8BAAAA,CAAA,mBAAmB,sBAE9B,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,oBAAoB,CAAA,CAAA;AAAA,CAHpB,EAAA,6BAAA,KAAA,6BAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
1
+ {"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 +1 @@
1
- {"version":3,"file":"createComponentExtension.esm.js","sources":["../../src/extensions/createComponentExtension.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 { lazy, ComponentType } from 'react';\nimport {\n AnyExtensionInputMap,\n ResolvedExtensionInputs,\n createExtension,\n createExtensionDataRef,\n} from '../wiring';\nimport { Expand } from '../types';\nimport { PortableSchema } from '../schema';\nimport { ComponentRef } from '../components';\n\n/** @public */\nexport function createComponentExtension<\n TProps extends {},\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n ref: ComponentRef<TProps>;\n name?: string;\n disabled?: boolean;\n inputs?: TInputs;\n configSchema?: PortableSchema<TConfig>;\n loader:\n | {\n lazy: (values: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<ComponentType<TProps>>;\n }\n | {\n sync: (values: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => ComponentType<TProps>;\n };\n}) {\n return createExtension({\n kind: 'component',\n namespace: options.ref.id,\n name: options.name,\n attachTo: { id: 'app', input: 'components' },\n inputs: options.inputs,\n disabled: options.disabled,\n configSchema: options.configSchema,\n output: {\n component: createComponentExtension.componentDataRef,\n },\n factory({ config, inputs }) {\n if ('sync' in options.loader) {\n return {\n component: {\n ref: options.ref,\n impl: options.loader.sync({ config, inputs }) as ComponentType,\n },\n };\n }\n const lazyLoader = options.loader.lazy;\n const ExtensionComponent = lazy(() =>\n lazyLoader({ config, inputs }).then(Component => ({\n default: Component,\n })),\n ) as unknown as ComponentType;\n\n return {\n component: {\n ref: options.ref,\n impl: ExtensionComponent,\n },\n };\n },\n });\n}\n\n/** @public */\nexport namespace createComponentExtension {\n export const componentDataRef = createExtensionDataRef<{\n ref: ComponentRef;\n impl: ComponentType;\n }>().with({ id: 'core.component.component' });\n}\n"],"names":["createComponentExtension"],"mappings":";;;;;AA4BO,SAAS,yBAId,OAmBC,EAAA;AACD,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,WAAA;AAAA,IACN,SAAA,EAAW,QAAQ,GAAI,CAAA,EAAA;AAAA,IACvB,MAAM,OAAQ,CAAA,IAAA;AAAA,IACd,QAAU,EAAA,EAAE,EAAI,EAAA,KAAA,EAAO,OAAO,YAAa,EAAA;AAAA,IAC3C,QAAQ,OAAQ,CAAA,MAAA;AAAA,IAChB,UAAU,OAAQ,CAAA,QAAA;AAAA,IAClB,cAAc,OAAQ,CAAA,YAAA;AAAA,IACtB,MAAQ,EAAA;AAAA,MACN,WAAW,wBAAyB,CAAA,gBAAA;AAAA,KACtC;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAU,EAAA;AAC1B,MAAI,IAAA,MAAA,IAAU,QAAQ,MAAQ,EAAA;AAC5B,QAAO,OAAA;AAAA,UACL,SAAW,EAAA;AAAA,YACT,KAAK,OAAQ,CAAA,GAAA;AAAA,YACb,MAAM,OAAQ,CAAA,MAAA,CAAO,KAAK,EAAE,MAAA,EAAQ,QAAQ,CAAA;AAAA,WAC9C;AAAA,SACF,CAAA;AAAA,OACF;AACA,MAAM,MAAA,UAAA,GAAa,QAAQ,MAAO,CAAA,IAAA,CAAA;AAClC,MAAA,MAAM,kBAAqB,GAAA,IAAA;AAAA,QAAK,MAC9B,WAAW,EAAE,MAAA,EAAQ,QAAQ,CAAA,CAAE,KAAK,CAAc,SAAA,MAAA;AAAA,UAChD,OAAS,EAAA,SAAA;AAAA,SACT,CAAA,CAAA;AAAA,OACJ,CAAA;AAEA,MAAO,OAAA;AAAA,QACL,SAAW,EAAA;AAAA,UACT,KAAK,OAAQ,CAAA,GAAA;AAAA,UACb,IAAM,EAAA,kBAAA;AAAA,SACR;AAAA,OACF,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,yBAAV,KAAA;AACE,EAAMA,yBAAAA,CAAA,mBAAmB,sBAG7B,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,4BAA4B,CAAA,CAAA;AAAA,CAJ7B,EAAA,wBAAA,KAAA,wBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"createComponentExtension.esm.js","sources":["../../src/extensions/createComponentExtension.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 { lazy, ComponentType } from 'react';\nimport {\n AnyExtensionInputMap,\n ResolvedExtensionInputs,\n createExtension,\n createExtensionDataRef,\n} from '../wiring';\nimport { Expand } from '../types';\nimport { PortableSchema } from '../schema';\nimport { ComponentRef } from '../components';\n\n/** @public */\nexport function createComponentExtension<\n TProps extends {},\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n ref: ComponentRef<TProps>;\n name?: string;\n disabled?: boolean;\n /** @deprecated these will be removed in the future */\n inputs?: TInputs;\n /** @deprecated these will be removed in the future */\n configSchema?: PortableSchema<TConfig>;\n loader:\n | {\n lazy: (values: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<ComponentType<TProps>>;\n }\n | {\n sync: (values: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => ComponentType<TProps>;\n };\n}) {\n return createExtension({\n kind: 'component',\n namespace: options.ref.id,\n name: options.name,\n attachTo: { id: 'app', input: 'components' },\n inputs: options.inputs,\n disabled: options.disabled,\n configSchema: options.configSchema,\n output: {\n component: createComponentExtension.componentDataRef,\n },\n factory({ config, inputs }) {\n if ('sync' in options.loader) {\n return {\n component: {\n ref: options.ref,\n impl: options.loader.sync({ config, inputs }) as ComponentType,\n },\n };\n }\n const lazyLoader = options.loader.lazy;\n const ExtensionComponent = lazy(() =>\n lazyLoader({ config, inputs }).then(Component => ({\n default: Component,\n })),\n ) as unknown as ComponentType;\n\n return {\n component: {\n ref: options.ref,\n impl: ExtensionComponent,\n },\n };\n },\n });\n}\n\n/** @public */\nexport namespace createComponentExtension {\n export const componentDataRef = createExtensionDataRef<{\n ref: ComponentRef;\n impl: ComponentType;\n }>().with({ id: 'core.component.component' });\n}\n"],"names":["createComponentExtension"],"mappings":";;;;;AA4BO,SAAS,yBAId,OAqBC,EAAA;AACD,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,WAAA;AAAA,IACN,SAAA,EAAW,QAAQ,GAAI,CAAA,EAAA;AAAA,IACvB,MAAM,OAAQ,CAAA,IAAA;AAAA,IACd,QAAU,EAAA,EAAE,EAAI,EAAA,KAAA,EAAO,OAAO,YAAa,EAAA;AAAA,IAC3C,QAAQ,OAAQ,CAAA,MAAA;AAAA,IAChB,UAAU,OAAQ,CAAA,QAAA;AAAA,IAClB,cAAc,OAAQ,CAAA,YAAA;AAAA,IACtB,MAAQ,EAAA;AAAA,MACN,WAAW,wBAAyB,CAAA,gBAAA;AAAA,KACtC;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAU,EAAA;AAC1B,MAAI,IAAA,MAAA,IAAU,QAAQ,MAAQ,EAAA;AAC5B,QAAO,OAAA;AAAA,UACL,SAAW,EAAA;AAAA,YACT,KAAK,OAAQ,CAAA,GAAA;AAAA,YACb,MAAM,OAAQ,CAAA,MAAA,CAAO,KAAK,EAAE,MAAA,EAAQ,QAAQ,CAAA;AAAA,WAC9C;AAAA,SACF,CAAA;AAAA,OACF;AACA,MAAM,MAAA,UAAA,GAAa,QAAQ,MAAO,CAAA,IAAA,CAAA;AAClC,MAAA,MAAM,kBAAqB,GAAA,IAAA;AAAA,QAAK,MAC9B,WAAW,EAAE,MAAA,EAAQ,QAAQ,CAAA,CAAE,KAAK,CAAc,SAAA,MAAA;AAAA,UAChD,OAAS,EAAA,SAAA;AAAA,SACT,CAAA,CAAA;AAAA,OACJ,CAAA;AAEA,MAAO,OAAA;AAAA,QACL,SAAW,EAAA;AAAA,UACT,KAAK,OAAQ,CAAA,GAAA;AAAA,UACb,IAAM,EAAA,kBAAA;AAAA,SACR;AAAA,OACF,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,yBAAV,KAAA;AACE,EAAMA,yBAAAA,CAAA,mBAAmB,sBAG7B,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,4BAA4B,CAAA,CAAA;AAAA,CAJ7B,EAAA,wBAAA,KAAA,wBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { createSchemaFromZod } from '../schema/createSchemaFromZod.esm.js';
2
2
  import '../wiring/coreExtensionData.esm.js';
3
3
  import { createExtension } from '../wiring/createExtension.esm.js';
4
- import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
4
+ import { NavItemBlueprint } from '../blueprints/NavItemBlueprint.esm.js';
5
5
 
6
6
  function createNavItemExtension(options) {
7
7
  const { routeRef, title, icon, namespace, name } = options;
@@ -16,7 +16,7 @@ function createNavItemExtension(options) {
16
16
  })
17
17
  ),
18
18
  output: {
19
- navTarget: createNavItemExtension.targetDataRef
19
+ navTarget: NavItemBlueprint.dataRefs.target
20
20
  },
21
21
  factory: ({ config }) => ({
22
22
  navTarget: {
@@ -28,7 +28,7 @@ function createNavItemExtension(options) {
28
28
  });
29
29
  }
30
30
  ((createNavItemExtension2) => {
31
- createNavItemExtension2.targetDataRef = createExtensionDataRef().with({ id: "core.nav-item.target" });
31
+ createNavItemExtension2.targetDataRef = NavItemBlueprint.dataRefs.target;
32
32
  })(createNavItemExtension || (createNavItemExtension = {}));
33
33
 
34
34
  export { createNavItemExtension };
@@ -1 +1 @@
1
- {"version":3,"file":"createNavItemExtension.esm.js","sources":["../../src/extensions/createNavItemExtension.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { IconComponent } from '@backstage/core-plugin-api';\nimport { createSchemaFromZod } from '../schema/createSchemaFromZod';\nimport { createExtension, createExtensionDataRef } from '../wiring';\nimport { RouteRef } from '../routing';\n\n/**\n * Helper for creating extensions for a nav item.\n * @public\n */\nexport function createNavItemExtension(options: {\n namespace?: string;\n name?: string;\n routeRef: RouteRef<undefined>;\n title: string;\n icon: IconComponent;\n}) {\n const { routeRef, title, icon, namespace, name } = options;\n return createExtension({\n namespace,\n name,\n kind: 'nav-item',\n attachTo: { id: 'app/nav', input: 'items' },\n configSchema: createSchemaFromZod(z =>\n z.object({\n title: z.string().default(title),\n }),\n ),\n output: {\n navTarget: createNavItemExtension.targetDataRef,\n },\n factory: ({ config }) => ({\n navTarget: {\n title: config.title,\n icon,\n routeRef,\n },\n }),\n });\n}\n\n/** @public */\nexport namespace createNavItemExtension {\n // TODO(Rugvip): Should this be broken apart into separate refs? title/icon/routeRef\n export const targetDataRef = createExtensionDataRef<{\n title: string;\n icon: IconComponent;\n routeRef: RouteRef<undefined>;\n }>().with({ id: 'core.nav-item.target' });\n}\n"],"names":["createNavItemExtension"],"mappings":";;;;;AAyBO,SAAS,uBAAuB,OAMpC,EAAA;AACD,EAAA,MAAM,EAAE,QAAU,EAAA,KAAA,EAAO,IAAM,EAAA,SAAA,EAAW,MAAS,GAAA,OAAA,CAAA;AACnD,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,SAAA;AAAA,IACA,IAAA;AAAA,IACA,IAAM,EAAA,UAAA;AAAA,IACN,QAAU,EAAA,EAAE,EAAI,EAAA,SAAA,EAAW,OAAO,OAAQ,EAAA;AAAA,IAC1C,YAAc,EAAA,mBAAA;AAAA,MAAoB,CAAA,CAAA,KAChC,EAAE,MAAO,CAAA;AAAA,QACP,KAAO,EAAA,CAAA,CAAE,MAAO,EAAA,CAAE,QAAQ,KAAK,CAAA;AAAA,OAChC,CAAA;AAAA,KACH;AAAA,IACA,MAAQ,EAAA;AAAA,MACN,WAAW,sBAAuB,CAAA,aAAA;AAAA,KACpC;AAAA,IACA,OAAS,EAAA,CAAC,EAAE,MAAA,EAAc,MAAA;AAAA,MACxB,SAAW,EAAA;AAAA,QACT,OAAO,MAAO,CAAA,KAAA;AAAA,QACd,IAAA;AAAA,QACA,QAAA;AAAA,OACF;AAAA,KACF,CAAA;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,uBAAV,KAAA;AAEE,EAAMA,uBAAAA,CAAA,gBAAgB,sBAI1B,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,wBAAwB,CAAA,CAAA;AAAA,CANzB,EAAA,sBAAA,KAAA,sBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
1
+ {"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,6 +1,6 @@
1
1
  import '../wiring/coreExtensionData.esm.js';
2
2
  import { createExtension } from '../wiring/createExtension.esm.js';
3
- import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
3
+ import { NavLogoBlueprint } from '../blueprints/NavLogoBlueprint.esm.js';
4
4
 
5
5
  function createNavLogoExtension(options) {
6
6
  const { logoIcon, logoFull } = options;
@@ -10,7 +10,7 @@ function createNavLogoExtension(options) {
10
10
  namespace: options?.namespace,
11
11
  attachTo: { id: "app/nav", input: "logos" },
12
12
  output: {
13
- logos: createNavLogoExtension.logoElementsDataRef
13
+ logos: NavLogoBlueprint.dataRefs.logoElements
14
14
  },
15
15
  factory: () => {
16
16
  return {
@@ -23,7 +23,7 @@ function createNavLogoExtension(options) {
23
23
  });
24
24
  }
25
25
  ((createNavLogoExtension2) => {
26
- createNavLogoExtension2.logoElementsDataRef = createExtensionDataRef().with({ id: "core.nav-logo.logo-elements" });
26
+ createNavLogoExtension2.logoElementsDataRef = NavLogoBlueprint.dataRefs.logoElements;
27
27
  })(createNavLogoExtension || (createNavLogoExtension = {}));
28
28
 
29
29
  export { createNavLogoExtension };
@@ -1 +1 @@
1
- {"version":3,"file":"createNavLogoExtension.esm.js","sources":["../../src/extensions/createNavLogoExtension.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createExtension, createExtensionDataRef } from '../wiring';\n\n/**\n * Helper for creating extensions for a nav logos.\n * @public\n */\nexport function createNavLogoExtension(options: {\n name?: string;\n namespace?: string;\n logoIcon: JSX.Element;\n logoFull: JSX.Element;\n}) {\n const { logoIcon, logoFull } = options;\n return createExtension({\n kind: 'nav-logo',\n name: options?.name,\n namespace: options?.namespace,\n attachTo: { id: 'app/nav', input: 'logos' },\n output: {\n logos: createNavLogoExtension.logoElementsDataRef,\n },\n factory: () => {\n return {\n logos: {\n logoIcon,\n logoFull,\n },\n };\n },\n });\n}\n\n/** @public */\nexport namespace createNavLogoExtension {\n export const logoElementsDataRef = createExtensionDataRef<{\n logoIcon?: JSX.Element;\n logoFull?: JSX.Element;\n }>().with({ id: 'core.nav-logo.logo-elements' });\n}\n"],"names":["createNavLogoExtension"],"mappings":";;;;AAsBO,SAAS,uBAAuB,OAKpC,EAAA;AACD,EAAM,MAAA,EAAE,QAAU,EAAA,QAAA,EAAa,GAAA,OAAA,CAAA;AAC/B,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,UAAA;AAAA,IACN,MAAM,OAAS,EAAA,IAAA;AAAA,IACf,WAAW,OAAS,EAAA,SAAA;AAAA,IACpB,QAAU,EAAA,EAAE,EAAI,EAAA,SAAA,EAAW,OAAO,OAAQ,EAAA;AAAA,IAC1C,MAAQ,EAAA;AAAA,MACN,OAAO,sBAAuB,CAAA,mBAAA;AAAA,KAChC;AAAA,IACA,SAAS,MAAM;AACb,MAAO,OAAA;AAAA,QACL,KAAO,EAAA;AAAA,UACL,QAAA;AAAA,UACA,QAAA;AAAA,SACF;AAAA,OACF,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,uBAAV,KAAA;AACE,EAAMA,uBAAAA,CAAA,sBAAsB,sBAGhC,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,+BAA+B,CAAA,CAAA;AAAA,CAJhC,EAAA,sBAAA,KAAA,sBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
1
+ {"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 +1 @@
1
- {"version":3,"file":"createPageExtension.esm.js","sources":["../../src/extensions/createPageExtension.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { lazy } from 'react';\nimport { ExtensionBoundary } from '../components';\nimport { createSchemaFromZod, PortableSchema } from '../schema';\nimport {\n coreExtensionData,\n createExtension,\n ResolvedExtensionInputs,\n AnyExtensionInputMap,\n} from '../wiring';\nimport { RouteRef } from '../routing';\nimport { Expand } from '../types';\nimport { ExtensionDefinition } from '../wiring/createExtension';\n\n/**\n * Helper for creating extensions for a routable React page component.\n *\n * @public\n */\nexport function createPageExtension<\n TConfig extends { path: string },\n TInputs extends AnyExtensionInputMap,\n>(\n options: (\n | {\n defaultPath: string;\n }\n | {\n configSchema: PortableSchema<TConfig>;\n }\n ) & {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n disabled?: boolean;\n inputs?: TInputs;\n routeRef?: RouteRef;\n loader: (options: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<JSX.Element>;\n },\n): ExtensionDefinition<TConfig> {\n const configSchema =\n 'configSchema' in options\n ? options.configSchema\n : (createSchemaFromZod(z =>\n z.object({ path: z.string().default(options.defaultPath) }),\n ) as PortableSchema<TConfig>);\n\n return createExtension({\n kind: 'page',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? { id: 'app/routes', input: 'routes' },\n configSchema,\n inputs: options.inputs,\n disabled: options.disabled,\n output: {\n element: coreExtensionData.reactElement,\n path: coreExtensionData.routePath,\n routeRef: coreExtensionData.routeRef.optional(),\n },\n factory({ config, inputs, node }) {\n const ExtensionComponent = lazy(() =>\n options\n .loader({ config, inputs })\n .then(element => ({ default: () => element })),\n );\n\n return {\n path: config.path,\n routeRef: options.routeRef,\n element: (\n <ExtensionBoundary node={node}>\n <ExtensionComponent />\n </ExtensionBoundary>\n ),\n };\n },\n });\n}\n"],"names":[],"mappings":";;;;;;AAkCO,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
+ {"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,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { createExtension } from '../wiring/createExtension.esm.js';
3
- import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
3
+ import { RouterBlueprint } from '../blueprints/RouterBlueprint.esm.js';
4
4
 
5
5
  function createRouterExtension(options) {
6
6
  return createExtension({
@@ -12,7 +12,7 @@ function createRouterExtension(options) {
12
12
  disabled: options.disabled,
13
13
  inputs: options.inputs,
14
14
  output: {
15
- component: createRouterExtension.componentDataRef
15
+ component: RouterBlueprint.dataRefs.component
16
16
  },
17
17
  factory({ inputs, config }) {
18
18
  const Component = (props) => {
@@ -25,7 +25,7 @@ function createRouterExtension(options) {
25
25
  });
26
26
  }
27
27
  ((createRouterExtension2) => {
28
- createRouterExtension2.componentDataRef = createExtensionDataRef().with({ id: "app.router.wrapper" });
28
+ createRouterExtension2.componentDataRef = RouterBlueprint.dataRefs.component;
29
29
  })(createRouterExtension || (createRouterExtension = {}));
30
30
 
31
31
  export { createRouterExtension };
@@ -1 +1 @@
1
- {"version":3,"file":"createRouterExtension.esm.js","sources":["../../src/extensions/createRouterExtension.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ComponentType, PropsWithChildren } from 'react';\nimport { PortableSchema } from '../schema/types';\nimport {\n AnyExtensionInputMap,\n ExtensionDefinition,\n ResolvedExtensionInputs,\n createExtension,\n} from '../wiring/createExtension';\nimport { createExtensionDataRef } from '../wiring/createExtensionDataRef';\nimport { Expand } from '../types';\n\n/**\n * Creates an extension that replaces the router implementation at the app root.\n * This is useful to be able to for example replace the BrowserRouter with a\n * MemoryRouter in tests, or to add additional props to a BrowserRouter.\n *\n * @public\n */\nexport function createRouterExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n configSchema?: PortableSchema<TConfig>;\n disabled?: boolean;\n inputs?: TInputs;\n Component: ComponentType<\n PropsWithChildren<{\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n config: TConfig;\n }>\n >;\n}): ExtensionDefinition<TConfig> {\n return createExtension({\n kind: 'app-router-component',\n namespace: options.namespace,\n name: options.name,\n attachTo: options.attachTo ?? { id: 'app/root', input: 'router' },\n configSchema: options.configSchema,\n disabled: options.disabled,\n inputs: options.inputs,\n output: {\n component: createRouterExtension.componentDataRef,\n },\n factory({ inputs, config }) {\n const Component = (props: PropsWithChildren<{}>) => {\n return (\n <options.Component inputs={inputs} config={config}>\n {props.children}\n </options.Component>\n );\n };\n return {\n component: Component,\n };\n },\n });\n}\n\n/** @public */\nexport namespace createRouterExtension {\n export const componentDataRef = createExtensionDataRef<\n ComponentType<PropsWithChildren<{}>>\n >().with({ id: 'app.router.wrapper' });\n}\n"],"names":["createRouterExtension"],"mappings":";;;;AAkCO,SAAS,sBAGd,OAa+B,EAAA;AAC/B,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,sBAAA;AAAA,IACN,WAAW,OAAQ,CAAA,SAAA;AAAA,IACnB,MAAM,OAAQ,CAAA,IAAA;AAAA,IACd,UAAU,OAAQ,CAAA,QAAA,IAAY,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,QAAS,EAAA;AAAA,IAChE,cAAc,OAAQ,CAAA,YAAA;AAAA,IACtB,UAAU,OAAQ,CAAA,QAAA;AAAA,IAClB,QAAQ,OAAQ,CAAA,MAAA;AAAA,IAChB,MAAQ,EAAA;AAAA,MACN,WAAW,qBAAsB,CAAA,gBAAA;AAAA,KACnC;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAU,EAAA;AAC1B,MAAM,MAAA,SAAA,GAAY,CAAC,KAAiC,KAAA;AAClD,QAAA,2CACG,OAAQ,CAAA,SAAA,EAAR,EAAkB,MAAgB,EAAA,MAAA,EAAA,EAChC,MAAM,QACT,CAAA,CAAA;AAAA,OAEJ,CAAA;AACA,MAAO,OAAA;AAAA,QACL,SAAW,EAAA,SAAA;AAAA,OACb,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,sBAAV,KAAA;AACE,EAAMA,sBAAAA,CAAA,mBAAmB,sBAE9B,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,sBAAsB,CAAA,CAAA;AAAA,CAHtB,EAAA,qBAAA,KAAA,qBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
1
+ {"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;;;;"}
@@ -2,7 +2,17 @@ import React, { lazy } from 'react';
2
2
  import { ExtensionBoundary } from '../components/ExtensionBoundary.esm.js';
3
3
  import '../wiring/coreExtensionData.esm.js';
4
4
  import { createExtension } from '../wiring/createExtension.esm.js';
5
- import { createExtensionDataRef } from '../wiring/createExtensionDataRef.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';
6
16
 
7
17
  function createSignInPageExtension(options) {
8
18
  return createExtension({
@@ -27,7 +37,7 @@ function createSignInPageExtension(options) {
27
37
  });
28
38
  }
29
39
  ((createSignInPageExtension2) => {
30
- createSignInPageExtension2.componentDataRef = createExtensionDataRef().with({ id: "core.sign-in-page.component" });
40
+ createSignInPageExtension2.componentDataRef = SignInPageBlueprint.dataRefs.component;
31
41
  })(createSignInPageExtension || (createSignInPageExtension = {}));
32
42
 
33
43
  export { createSignInPageExtension };
@@ -1 +1 @@
1
- {"version":3,"file":"createSignInPageExtension.esm.js","sources":["../../src/extensions/createSignInPageExtension.tsx"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { ComponentType, lazy } from 'react';\nimport { ExtensionBoundary } from '../components';\nimport { PortableSchema } from '../schema';\nimport {\n createExtension,\n ResolvedExtensionInputs,\n AnyExtensionInputMap,\n createExtensionDataRef,\n ExtensionDefinition,\n} from '../wiring';\nimport { Expand } from '../types';\nimport { SignInPageProps } from '@backstage/core-plugin-api';\n\n/**\n *\n * @public\n */\nexport function createSignInPageExtension<\n TConfig extends {},\n TInputs extends AnyExtensionInputMap,\n>(options: {\n namespace?: string;\n name?: string;\n attachTo?: { id: string; input: string };\n configSchema?: PortableSchema<TConfig>;\n disabled?: boolean;\n inputs?: TInputs;\n loader: (options: {\n config: TConfig;\n inputs: Expand<ResolvedExtensionInputs<TInputs>>;\n }) => Promise<ComponentType<SignInPageProps>>;\n}): ExtensionDefinition<TConfig> {\n return createExtension({\n kind: 'sign-in-page',\n namespace: options?.namespace,\n name: options?.name,\n attachTo: options.attachTo ?? { id: 'app/root', input: 'signInPage' },\n configSchema: options.configSchema,\n inputs: options.inputs,\n disabled: options.disabled,\n output: {\n component: createSignInPageExtension.componentDataRef,\n },\n factory({ config, inputs, node }) {\n const ExtensionComponent = lazy(() =>\n options\n .loader({ config, inputs })\n .then(component => ({ default: component })),\n );\n\n return {\n component: props => (\n <ExtensionBoundary node={node} routable>\n <ExtensionComponent {...props} />\n </ExtensionBoundary>\n ),\n };\n },\n });\n}\n\n/** @public */\nexport namespace createSignInPageExtension {\n export const componentDataRef = createExtensionDataRef<\n ComponentType<SignInPageProps>\n >().with({ id: 'core.sign-in-page.component' });\n}\n"],"names":["createSignInPageExtension"],"mappings":";;;;;;AAiCO,SAAS,0BAGd,OAW+B,EAAA;AAC/B,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,cAAA;AAAA,IACN,WAAW,OAAS,EAAA,SAAA;AAAA,IACpB,MAAM,OAAS,EAAA,IAAA;AAAA,IACf,UAAU,OAAQ,CAAA,QAAA,IAAY,EAAE,EAAI,EAAA,UAAA,EAAY,OAAO,YAAa,EAAA;AAAA,IACpE,cAAc,OAAQ,CAAA,YAAA;AAAA,IACtB,QAAQ,OAAQ,CAAA,MAAA;AAAA,IAChB,UAAU,OAAQ,CAAA,QAAA;AAAA,IAClB,MAAQ,EAAA;AAAA,MACN,WAAW,yBAA0B,CAAA,gBAAA;AAAA,KACvC;AAAA,IACA,OAAQ,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAQ,MAAQ,EAAA;AAChC,MAAA,MAAM,kBAAqB,GAAA,IAAA;AAAA,QAAK,MAC9B,OAAA,CACG,MAAO,CAAA,EAAE,MAAQ,EAAA,MAAA,EAAQ,CAAA,CACzB,IAAK,CAAA,CAAA,SAAA,MAAc,EAAE,OAAA,EAAS,WAAY,CAAA,CAAA;AAAA,OAC/C,CAAA;AAEA,MAAO,OAAA;AAAA,QACL,SAAA,EAAW,CACT,KAAA,qBAAA,KAAA,CAAA,aAAA,CAAC,iBAAkB,EAAA,EAAA,IAAA,EAAY,QAAQ,EAAA,IAAA,EAAA,kBACpC,KAAA,CAAA,aAAA,CAAA,kBAAA,EAAA,EAAoB,GAAG,KAAA,EAAO,CACjC,CAAA;AAAA,OAEJ,CAAA;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,0BAAV,KAAA;AACE,EAAMA,0BAAAA,CAAA,mBAAmB,sBAE9B,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,+BAA+B,CAAA,CAAA;AAAA,CAH/B,EAAA,yBAAA,KAAA,yBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
1
+ {"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,6 +1,6 @@
1
+ import { ThemeBlueprint } from '../blueprints/ThemeBlueprint.esm.js';
1
2
  import '../wiring/coreExtensionData.esm.js';
2
3
  import { createExtension } from '../wiring/createExtension.esm.js';
3
- import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
4
4
 
5
5
  function createThemeExtension(theme) {
6
6
  return createExtension({
@@ -9,15 +9,13 @@ function createThemeExtension(theme) {
9
9
  name: theme.id,
10
10
  attachTo: { id: "app", input: "themes" },
11
11
  output: {
12
- theme: createThemeExtension.themeDataRef
12
+ theme: ThemeBlueprint.dataRefs.theme
13
13
  },
14
14
  factory: () => ({ theme })
15
15
  });
16
16
  }
17
17
  ((createThemeExtension2) => {
18
- createThemeExtension2.themeDataRef = createExtensionDataRef().with({
19
- id: "core.theme.theme"
20
- });
18
+ createThemeExtension2.themeDataRef = ThemeBlueprint.dataRefs.theme;
21
19
  })(createThemeExtension || (createThemeExtension = {}));
22
20
 
23
21
  export { createThemeExtension };
@@ -1 +1 @@
1
- {"version":3,"file":"createThemeExtension.esm.js","sources":["../../src/extensions/createThemeExtension.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createExtension, createExtensionDataRef } from '../wiring';\nimport { AppTheme } from '@backstage/core-plugin-api';\n\n/** @public */\nexport function createThemeExtension(theme: AppTheme) {\n return createExtension({\n kind: 'theme',\n namespace: 'app',\n name: theme.id,\n attachTo: { id: 'app', input: 'themes' },\n output: {\n theme: createThemeExtension.themeDataRef,\n },\n factory: () => ({ theme }),\n });\n}\n\n/** @public */\nexport namespace createThemeExtension {\n export const themeDataRef = createExtensionDataRef<AppTheme>().with({\n id: 'core.theme.theme',\n });\n}\n"],"names":["createThemeExtension"],"mappings":";;;;AAoBO,SAAS,qBAAqB,KAAiB,EAAA;AACpD,EAAA,OAAO,eAAgB,CAAA;AAAA,IACrB,IAAM,EAAA,OAAA;AAAA,IACN,SAAW,EAAA,KAAA;AAAA,IACX,MAAM,KAAM,CAAA,EAAA;AAAA,IACZ,QAAU,EAAA,EAAE,EAAI,EAAA,KAAA,EAAO,OAAO,QAAS,EAAA;AAAA,IACvC,MAAQ,EAAA;AAAA,MACN,OAAO,oBAAqB,CAAA,YAAA;AAAA,KAC9B;AAAA,IACA,OAAA,EAAS,OAAO,EAAE,KAAM,EAAA,CAAA;AAAA,GACzB,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,qBAAV,KAAA;AACE,EAAMA,qBAAA,CAAA,YAAA,GAAe,sBAAiC,EAAA,CAAE,IAAK,CAAA;AAAA,IAClE,EAAI,EAAA,kBAAA;AAAA,GACL,CAAA,CAAA;AAAA,CAHc,EAAA,oBAAA,KAAA,oBAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
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,6 +1,6 @@
1
+ import { TranslationBlueprint } from '../blueprints/TranslationBlueprint.esm.js';
1
2
  import '../wiring/coreExtensionData.esm.js';
2
3
  import { createExtension } from '../wiring/createExtension.esm.js';
3
- import { createExtensionDataRef } from '../wiring/createExtensionDataRef.esm.js';
4
4
 
5
5
  function createTranslationExtension(options) {
6
6
  return createExtension({
@@ -9,13 +9,13 @@ function createTranslationExtension(options) {
9
9
  name: options.name,
10
10
  attachTo: { id: "app", input: "translations" },
11
11
  output: {
12
- resource: createTranslationExtension.translationDataRef
12
+ resource: TranslationBlueprint.dataRefs.translation
13
13
  },
14
14
  factory: () => ({ resource: options.resource })
15
15
  });
16
16
  }
17
17
  ((createTranslationExtension2) => {
18
- createTranslationExtension2.translationDataRef = createExtensionDataRef().with({ id: "core.translation.translation" });
18
+ createTranslationExtension2.translationDataRef = TranslationBlueprint.dataRefs.translation;
19
19
  })(createTranslationExtension || (createTranslationExtension = {}));
20
20
 
21
21
  export { createTranslationExtension };
@@ -1 +1 @@
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 { TranslationMessages, TranslationResource } from '../translation';\nimport { createExtension, createExtensionDataRef } from '../wiring';\n\n/** @public */\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: createTranslationExtension.translationDataRef,\n },\n factory: () => ({ resource: options.resource }),\n });\n}\n\n/** @public */\nexport namespace createTranslationExtension {\n export const translationDataRef = createExtensionDataRef<\n TranslationResource | TranslationMessages\n >().with({ id: 'core.translation.translation' });\n}\n"],"names":["createTranslationExtension"],"mappings":";;;;AAoBO,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,UAAU,0BAA2B,CAAA,kBAAA;AAAA,KACvC;AAAA,IACA,OAAS,EAAA,OAAO,EAAE,QAAA,EAAU,QAAQ,QAAS,EAAA,CAAA;AAAA,GAC9C,CAAA,CAAA;AACH,CAAA;AAAA,CAGO,CAAUA,2BAAV,KAAA;AACE,EAAMA,2BAAAA,CAAA,qBAAqB,sBAEhC,EAAA,CAAE,KAAK,EAAE,EAAA,EAAI,gCAAgC,CAAA,CAAA;AAAA,CAHhC,EAAA,0BAAA,KAAA,0BAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
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;;;;"}