@prose-reader/core 1.131.0 → 1.133.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
@@ -541,8 +541,8 @@ const layoutEnhancer = (next) => (options) => {
541
541
  height: ${columnHeight}px !important;
542
542
  }
543
543
  img, video, audio, object, svg {
544
- max-width: ${columnWidth}px !important;
545
- max-height: ${columnHeight}px !important;
544
+ -max-width: ${columnWidth}px !important;
545
+ -max-height: ${columnHeight}px !important;
546
546
  }
547
547
  table {
548
548
  max-width: ${columnWidth}px !important;
@@ -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;
@@ -8093,8 +8102,8 @@ const buildStyleWithMultiColumn = ({
8093
8102
  ``}
8094
8103
  img, video, audio, object, svg {
8095
8104
  max-width: 100%;
8096
- max-width: ${columnWidth}px !important;
8097
- max-height: ${columnHeight}px !important;
8105
+ -max-width: ${columnWidth}px !important;
8106
+ -max-height: ${columnHeight}px !important;
8098
8107
  -pointer-events: none;
8099
8108
  -webkit-column-break-inside: avoid;
8100
8109
  page-break-inside: avoid;