@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.
package/dist/index.js CHANGED
@@ -5674,11 +5674,6 @@ class SpineItem extends DestroyableClass {
5674
5674
  }),
5675
5675
  share$1()
5676
5676
  );
5677
- this.layout$ = layoutProcess$.pipe(
5678
- filter((event) => event.type === `end`),
5679
- map((event) => event.data),
5680
- share$1()
5681
- );
5682
5677
  this.isReady$ = layoutProcess$.pipe(
5683
5678
  withLatestFrom$1(this.renderer.isLoaded$),
5684
5679
  map(([event, loaded]) => !!(event.type === `end` && loaded)),
@@ -5686,8 +5681,22 @@ class SpineItem extends DestroyableClass {
5686
5681
  distinctUntilChanged(),
5687
5682
  shareReplay({ refCount: true, bufferSize: 1 })
5688
5683
  );
5684
+ this.layout$ = layoutProcess$.pipe(
5685
+ filter((event) => event.type === `end`),
5686
+ map((event) => event.data),
5687
+ share$1()
5688
+ );
5689
5689
  this.needsLayout$ = merge(this.unloaded$, this.loaded$);
5690
- merge(this.layout$, this.isReady$).pipe(takeUntil$1(this.destroy$)).subscribe();
5690
+ 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(takeUntil$1(this.destroy$)).subscribe();
5691
5700
  }
5692
5701
  get element() {
5693
5702
  return this.containerElement;