@sprucelabs/spruce-heartwood-utils 21.0.36 → 21.1.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.
@@ -9,7 +9,7 @@ export default class RemoteViewControllerFactoryImpl implements RemoteViewContro
9
9
  private themesByNamespace;
10
10
  static Factory(options: RemoteFactoryOptions): RemoteViewControllerFactory;
11
11
  static reset(): void;
12
- private constructor();
12
+ protected constructor(options: RemoteFactoryOptions);
13
13
  hasController(name: string): boolean;
14
14
  getTheme(namespace?: string): SkillTheme;
15
15
  Controller<N extends ViewControllerId, O extends ControllerOptions<N>>(name: N, options: O): ViewControllerMap[N];
@@ -19,7 +19,7 @@ export default class RemoteViewControllerFactoryImpl implements RemoteViewContro
19
19
  id: string;
20
20
  }>;
21
21
  RemoteController(name: string, options: Record<string, any>): Promise<any>;
22
- private optionallyLoadController;
22
+ protected optionallyLoadController(name: string): Promise<void>;
23
23
  private fetchFromUrl;
24
24
  }
25
25
  type Theme = SkillTheme;
@@ -63,11 +63,14 @@ class RemoteViewControllerFactoryImpl {
63
63
  source = yield this.fetchFromUrl(sourceUrl);
64
64
  }
65
65
  const importer = ViewControllerImporter.Importer();
66
- const { controllers: skillViews, plugins } = importer.import(source);
66
+ const { controllers: skillViews, plugins, App, } = importer.import(source);
67
67
  skillViews.forEach((sv) => {
68
68
  sv.id = `${namespace}.${sv.id}`;
69
69
  });
70
- this.vcFactory.importControllers(skillViews, plugins);
70
+ if (App) {
71
+ App.id = namespace;
72
+ }
73
+ this.vcFactory.importControllers(skillViews, plugins, App);
71
74
  if (theme) {
72
75
  this.themesByNamespace[namespace] = Object.assign(Object.assign({}, theme), { slug: namespace, name: namespace });
73
76
  }
@@ -9,7 +9,7 @@ export default class RemoteViewControllerFactoryImpl implements RemoteViewContro
9
9
  private themesByNamespace;
10
10
  static Factory(options: RemoteFactoryOptions): RemoteViewControllerFactory;
11
11
  static reset(): void;
12
- private constructor();
12
+ protected constructor(options: RemoteFactoryOptions);
13
13
  hasController(name: string): boolean;
14
14
  getTheme(namespace?: string): SkillTheme;
15
15
  Controller<N extends ViewControllerId, O extends ControllerOptions<N>>(name: N, options: O): ViewControllerMap[N];
@@ -19,7 +19,7 @@ export default class RemoteViewControllerFactoryImpl implements RemoteViewContro
19
19
  id: string;
20
20
  }>;
21
21
  RemoteController(name: string, options: Record<string, any>): Promise<any>;
22
- private optionallyLoadController;
22
+ protected optionallyLoadController(name: string): Promise<void>;
23
23
  private fetchFromUrl;
24
24
  }
25
25
  type Theme = SkillTheme;
@@ -54,11 +54,14 @@ class RemoteViewControllerFactoryImpl {
54
54
  source = await this.fetchFromUrl(sourceUrl);
55
55
  }
56
56
  const importer = heartwood_view_controllers_1.ViewControllerImporter.Importer();
57
- const { controllers: skillViews, plugins } = importer.import(source);
57
+ const { controllers: skillViews, plugins, App, } = importer.import(source);
58
58
  skillViews.forEach((sv) => {
59
59
  sv.id = `${namespace}.${sv.id}`;
60
60
  });
61
- this.vcFactory.importControllers(skillViews, plugins);
61
+ if (App) {
62
+ App.id = namespace;
63
+ }
64
+ this.vcFactory.importControllers(skillViews, plugins, App);
62
65
  if (theme) {
63
66
  this.themesByNamespace[namespace] = Object.assign(Object.assign({}, theme), { slug: namespace, name: namespace });
64
67
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sprucelabs/spruce-heartwood-utils",
3
3
  "description": "Heartwood Utilities",
4
- "version": "21.0.36",
4
+ "version": "21.1.0",
5
5
  "skill": {
6
6
  "namespace": "heartwood"
7
7
  },