@mohamedatia/fly-design-system 2.6.0 → 2.6.2

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.
@@ -437,8 +437,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
437
437
  class FlyRemoteRouter {
438
438
  windowData = inject(WINDOW_DATA, { optional: true });
439
439
  router = inject(Router, { optional: true });
440
- /** True when this remote is rendered inside the FlyOS desktop shell. */
441
- isEmbedded = this.windowData != null;
440
+ /**
441
+ * True when this remote is rendered inside the FlyOS desktop shell.
442
+ *
443
+ * Detection order:
444
+ * 1. `WINDOW_DATA` is provided — the canonical signal, works when the
445
+ * design-system module is genuinely shared via Native Federation's
446
+ * `sharedMappings` and the InjectionToken identity matches.
447
+ * 2. `globalThis.__FLYOS_SHELL__ === true` — set by the shell's `main.ts`
448
+ * before `initFederation`. A plain JS global is shared across all
449
+ * module instances in the same browser context, so this works even
450
+ * when the InjectionToken splits between host and remote bundles
451
+ * (a known Native Federation edge case).
452
+ */
453
+ isEmbedded = this.windowData != null
454
+ || (typeof globalThis !== 'undefined'
455
+ && globalThis.__FLYOS_SHELL__ === true);
442
456
  _url = signal('/', ...(ngDevMode ? [{ debugName: "_url" }] : /* istanbul ignore next */ []));
443
457
  /**
444
458
  * Current logical URL of the remote — `/signals/abc` etc.