@prose-reader/core 1.131.0 → 1.132.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.
@@ -5674,11 +5674,6 @@
5674
5674
  }),
5675
5675
  operators.share()
5676
5676
  );
5677
- this.layout$ = layoutProcess$.pipe(
5678
- operators.filter((event) => event.type === `end`),
5679
- operators.map((event) => event.data),
5680
- operators.share()
5681
- );
5682
5677
  this.isReady$ = layoutProcess$.pipe(
5683
5678
  operators.withLatestFrom(this.renderer.isLoaded$),
5684
5679
  operators.map(([event, loaded]) => !!(event.type === `end` && loaded)),
@@ -5686,8 +5681,22 @@
5686
5681
  operators.distinctUntilChanged(),
5687
5682
  operators.shareReplay({ refCount: true, bufferSize: 1 })
5688
5683
  );
5684
+ this.layout$ = layoutProcess$.pipe(
5685
+ operators.filter((event) => event.type === `end`),
5686
+ operators.map((event) => event.data),
5687
+ operators.share()
5688
+ );
5689
5689
  this.needsLayout$ = rxjs.merge(this.unloaded$, this.loaded$);
5690
- rxjs.merge(this.layout$, this.isReady$).pipe(operators.takeUntil(this.destroy$)).subscribe();
5690
+ rxjs.merge(
5691
+ /**
5692
+ * @important
5693
+ * The order is important here. We want to ensure the isReady value
5694
+ * is set before dispatching the layout event. Elements reacting
5695
+ * to layout changes may rely on the isReady value.
5696
+ */
5697
+ this.isReady$,
5698
+ this.layout$
5699
+ ).pipe(operators.takeUntil(this.destroy$)).subscribe();
5691
5700
  }
5692
5701
  get element() {
5693
5702
  return this.containerElement;