@mohamedatia/fly-design-system 2.3.0 → 2.3.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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, signal, computed, Injectable, inject, ErrorHandler, PLATFORM_ID, Pipe, DOCUMENT, ElementRef, input, output, HostListener, ViewChild, ChangeDetectionStrategy, Component, EventEmitter, DestroyRef, Output, Input, forwardRef, viewChild, effect, ViewEncapsulation, model } from '@angular/core';
2
+ import { InjectionToken, signal, computed, Injectable, inject, ErrorHandler, PLATFORM_ID, Pipe, DOCUMENT, ElementRef, input, output, HostListener, ViewChild, ChangeDetectionStrategy, Component, EventEmitter, DestroyRef, Output, Input, forwardRef, Injector, viewChild, effect, afterNextRender, ViewEncapsulation, model } from '@angular/core';
3
3
  import * as i1$1 from '@angular/common';
4
4
  import { isPlatformBrowser, CommonModule } from '@angular/common';
5
5
  import { Router } from '@angular/router';
@@ -1765,6 +1765,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.5", ngImpor
1765
1765
  */
1766
1766
  class FlyImageUploadComponent {
1767
1767
  http = inject(HttpClient);
1768
+ injector = inject(Injector);
1768
1769
  // ── Inputs ──
1769
1770
  aspectRatio = input(16 / 9, ...(ngDevMode ? [{ debugName: "aspectRatio" }] : /* istanbul ignore next */ []));
1770
1771
  maxSizeBytes = input(5 * 1024 * 1024, ...(ngDevMode ? [{ debugName: "maxSizeBytes" }] : /* istanbul ignore next */ []));
@@ -1877,8 +1878,12 @@ class FlyImageUploadComponent {
1877
1878
  const url = URL.createObjectURL(file);
1878
1879
  this.rawImageUrl.set(url);
1879
1880
  this.showCropper.set(true);
1880
- // Wait for next tick so cropImage element is in DOM
1881
- setTimeout(() => this.initCropper(), 0);
1881
+ // Init cropperjs after the @if (showCropper()) block has rendered and
1882
+ // the #cropImage signal viewQuery is populated. setTimeout(0) used to
1883
+ // race here under Native Federation when fewer host CD passes happen
1884
+ // before the macrotask fires (cropImage() returned undefined and
1885
+ // initCropper bailed). afterNextRender is deterministic.
1886
+ afterNextRender(() => this.initCropper(), { injector: this.injector });
1882
1887
  }
1883
1888
  initCropper() {
1884
1889
  this.destroyCropper();