@herdingbits/trailhead-core 0.0.10 → 0.0.11

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
@@ -15,12 +15,23 @@ export declare class Trailhead {
15
15
  readonly basePath: string;
16
16
  private readonly shellResourceUrl;
17
17
  readonly adapter: DesignSystemAdapter;
18
+ private readyPromise;
19
+ private readyResolve;
18
20
  constructor(config: ShellConfig);
19
21
  /**
20
22
  * Get navigation items loaded from navigation.json
21
23
  * @returns Array of navigation items
22
24
  */
23
25
  getNavigation(): NavItem[];
26
+ /**
27
+ * Wait for shell to be ready (adapter has rendered)
28
+ * @returns Promise that resolves when shell is ready
29
+ */
30
+ waitForReady(): Promise<void>;
31
+ /**
32
+ * Notify that shell is ready (called by adapter after rendering)
33
+ */
34
+ notifyReady(): void;
24
35
  /**
25
36
  * Initialize shell
26
37
  */
@@ -1 +1 @@
1
- {"version":3,"file":"shell.d.ts","sourceRoot":"","sources":["../src/shell.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAY,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC9D,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;;;OAGG;IACI,aAAa,IAAI,OAA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,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;IAsBnB;;OAEG;IACH,OAAO,CAAC,eAAe;IAavB;;OAEG;YACW,UAAU;CAsCzB"}
package/dist/shell.js CHANGED
@@ -7,6 +7,9 @@ export class Trailhead {
7
7
  this.basePath = config.basePath || "";
8
8
  this.shellResourceUrl = config.shellResourceUrl || this.basePath;
9
9
  this.adapter = config.adapter;
10
+ this.readyPromise = new Promise((resolve) => {
11
+ this.readyResolve = resolve;
12
+ });
10
13
  this.init(config.apiUrl);
11
14
  }
12
15
  /**
@@ -16,6 +19,19 @@ export class Trailhead {
16
19
  getNavigation() {
17
20
  return this.navigation;
18
21
  }
22
+ /**
23
+ * Wait for shell to be ready (adapter has rendered)
24
+ * @returns Promise that resolves when shell is ready
25
+ */
26
+ waitForReady() {
27
+ return this.readyPromise;
28
+ }
29
+ /**
30
+ * Notify that shell is ready (called by adapter after rendering)
31
+ */
32
+ notifyReady() {
33
+ this.readyResolve();
34
+ }
19
35
  /**
20
36
  * Initialize shell
21
37
  */
@@ -33,8 +49,10 @@ export class Trailhead {
33
49
  this.setupRouting();
34
50
  // Render navigation
35
51
  this.renderNavigation();
36
- // Load initial route
37
- this.handleRoute();
52
+ // Wait for adapter to be ready, then load initial route
53
+ this.waitForReady().then(() => {
54
+ this.handleRoute();
55
+ });
38
56
  }
39
57
  /**
40
58
  * Initialize design system adapter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@herdingbits/trailhead-core",
3
- "version": "0.0.10",
3
+ "version": "0.0.11",
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",