@herdingbits/trailhead-core 0.0.5 → 0.0.7

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/dist/shell.d.ts CHANGED
@@ -3,11 +3,13 @@ export interface ShellConfig {
3
3
  adapter: DesignSystemAdapter;
4
4
  basePath?: string;
5
5
  apiUrl?: string;
6
+ shellResourceUrl?: string;
6
7
  }
7
8
  export declare class Trailhead {
8
9
  private navigation;
9
10
  private routeChangeCallbacks;
10
11
  readonly basePath: string;
12
+ private readonly shellResourceUrl;
11
13
  readonly adapter: DesignSystemAdapter;
12
14
  constructor(config: ShellConfig);
13
15
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../src/shell.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAI/D,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,oBAAoB,CAAqC;IACjE,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,SAAgB,OAAO,EAAE,mBAAmB,CAAC;gBAEjC,MAAM,EAAE,WAAW;IAM/B;;OAEG;YACW,IAAI;IAwBlB;;OAEG;YACW,WAAW;IAUzB;;OAEG;IACH,OAAO,CAAC,SAAS;IAmFjB;;OAEG;YACW,cAAc;IAU5B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA6BxB;;OAEG;IACH,OAAO,CAAC,YAAY;IAMpB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAIhB;;OAEG;IACH,OAAO,CAAC,WAAW;IAenB;;OAEG;IACH,OAAO,CAAC,eAAe;IAavB;;OAEG;YACW,UAAU;CAsCzB"}
1
+ {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../src/shell.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAI/D,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,mBAAmB,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,oBAAoB,CAAqC;IACjE,SAAgB,QAAQ,EAAE,MAAM,CAAC;IACjC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAS;IAC1C,SAAgB,OAAO,EAAE,mBAAmB,CAAC;gBAEjC,MAAM,EAAE,WAAW;IAO/B;;OAEG;YACW,IAAI;IAwBlB;;OAEG;YACW,WAAW;IAUzB;;OAEG;IACH,OAAO,CAAC,SAAS;IAmFjB;;OAEG;YACW,cAAc;IAU5B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IA6BxB;;OAEG;IACH,OAAO,CAAC,YAAY;IAMpB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAIhB;;OAEG;IACH,OAAO,CAAC,WAAW;IAenB;;OAEG;IACH,OAAO,CAAC,eAAe;IAavB;;OAEG;YACW,UAAU;CAsCzB"}
package/dist/shell.js CHANGED
@@ -5,6 +5,7 @@ export class Trailhead {
5
5
  this.navigation = [];
6
6
  this.routeChangeCallbacks = [];
7
7
  this.basePath = config.basePath || "";
8
+ this.shellResourceUrl = config.shellResourceUrl || this.basePath;
8
9
  this.adapter = config.adapter;
9
10
  this.init(config.apiUrl);
10
11
  }
@@ -116,7 +117,7 @@ export class Trailhead {
116
117
  */
117
118
  async loadNavigation() {
118
119
  try {
119
- const response = await fetch(`${this.basePath}/navigation.json`);
120
+ const response = await fetch(`${this.shellResourceUrl}/navigation.json`);
120
121
  this.navigation = await response.json();
121
122
  }
122
123
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herdingbits/trailhead-core",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Simple application shell that orchestrates multiple SPAs. No webpack magic, just the browser's native module system.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",