@prose-reader/core 1.366.0 → 1.368.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.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +37 -22
- package/dist/index.js.map +1 -1
- package/dist/spineItem/SpineItem.d.ts +1 -0
- package/dist/spineItem/SpineItem.test.d.ts +1 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -4276,25 +4276,30 @@ var ai = (e) => (t) => e(t), oi = (e, t, n) => {
|
|
|
4276
4276
|
this.spineItemsManager.items.forEach((e) => {
|
|
4277
4277
|
e.markDirty();
|
|
4278
4278
|
});
|
|
4279
|
-
}), ee((e) => e.immediate ? D(void 0) : ve(50)), A(() =>
|
|
4280
|
-
let
|
|
4281
|
-
return a.
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4279
|
+
}), ee((e) => e.immediate ? D(void 0) : ve(50)), A(() => {
|
|
4280
|
+
let t = [];
|
|
4281
|
+
return this.spineItemsManager.items.reduce((a, o, s) => a.pipe(y(({ horizontalOffset: a, verticalOffset: c }) => {
|
|
4282
|
+
let l = a % i.absoluteViewport.width === 0, u = s === e.items.length - 1, d = r.values.computedPageTurnDirection === "vertical", f = n.isRTL(), p = this.getSpreadPosition(l, f), { edgeX: m, edgeY: h } = this.getStartEdges(d, l, a, c, i.absoluteViewport.height);
|
|
4283
|
+
return o.layout({
|
|
4284
|
+
spreadPosition: p,
|
|
4285
|
+
horizontalOffset: a,
|
|
4286
|
+
isLastItem: u,
|
|
4287
|
+
edgeX: m,
|
|
4288
|
+
edgeY: h
|
|
4289
|
+
}).pipe(T(({ width: e, height: n }) => {
|
|
4290
|
+
let r = this.createSpineItemLayout(d, f, m, h, e, n, i.absoluteViewport.width);
|
|
4291
|
+
return t[s] = r, {
|
|
4292
|
+
horizontalOffset: m + e,
|
|
4293
|
+
verticalOffset: d ? h + n : 0
|
|
4294
|
+
};
|
|
4295
|
+
}));
|
|
4296
|
+
})), D({
|
|
4297
|
+
horizontalOffset: 0,
|
|
4298
|
+
verticalOffset: 0
|
|
4299
|
+
})).pipe(M(() => {
|
|
4300
|
+
this.spineItemsRelativeLayouts = t;
|
|
4293
4301
|
}));
|
|
4294
|
-
})),
|
|
4295
|
-
horizontalOffset: 0,
|
|
4296
|
-
verticalOffset: 0
|
|
4297
|
-
}))), j(this.destroy$), O()), this.layout$.subscribe(), this.watchForVerticalWritingUpdate();
|
|
4302
|
+
}), j(this.destroy$), O()), this.layout$.subscribe(), this.watchForVerticalWritingUpdate();
|
|
4298
4303
|
}
|
|
4299
4304
|
watchForVerticalWritingUpdate() {
|
|
4300
4305
|
this.spineItemsObserver.itemLoad$.pipe(M((e) => {
|
|
@@ -4511,7 +4516,7 @@ var ai = (e) => (t) => e(t), oi = (e, t, n) => {
|
|
|
4511
4516
|
}, this.unload = () => {
|
|
4512
4517
|
this.renderer.unload();
|
|
4513
4518
|
}, this.markDirty = () => {
|
|
4514
|
-
this.
|
|
4519
|
+
this.updateState({ isDirty: !0 });
|
|
4515
4520
|
}, this.destroy = () => {
|
|
4516
4521
|
this.isDestroyed || (super.destroy(), this._layout.destroy(), this.renderer.destroy(), this.containerElement.remove());
|
|
4517
4522
|
}, this.isUsingVerticalWriting = () => !!this.renderer.writingMode?.startsWith("vertical"), this.layout = (e) => this._layout.layout(e), this.containerElement = $a(e, t.document);
|
|
@@ -4528,19 +4533,29 @@ var ai = (e) => (t) => e(t), oi = (e, t, n) => {
|
|
|
4528
4533
|
};
|
|
4529
4534
|
this.renderer = o ? o(s) : new Xa(s), this._layout = new Za(e, this.containerElement, t, r, this.renderer, this.settings, this.viewport);
|
|
4530
4535
|
let c = this.renderer.state$.pipe(I(({ state: e, error: t }) => {
|
|
4531
|
-
this.
|
|
4536
|
+
this.updateState({
|
|
4532
4537
|
isLoaded: e === "loaded",
|
|
4533
4538
|
isError: e === "error",
|
|
4534
4539
|
error: e === "error" ? t : void 0
|
|
4535
4540
|
});
|
|
4536
4541
|
}));
|
|
4537
4542
|
this.didLayout$ = this._layout.didLayout$.pipe(I(() => {
|
|
4538
|
-
this.
|
|
4543
|
+
this.updateState({
|
|
4539
4544
|
isDirty: !1,
|
|
4540
|
-
isReady:
|
|
4545
|
+
isReady: !0
|
|
4541
4546
|
});
|
|
4542
4547
|
}), Te()), E(c, this.didLayout$).pipe(F(this.destroy$)).subscribe();
|
|
4543
4548
|
}
|
|
4549
|
+
updateState(e) {
|
|
4550
|
+
let t = {
|
|
4551
|
+
...this.value,
|
|
4552
|
+
...e
|
|
4553
|
+
};
|
|
4554
|
+
this.mergeCompare({
|
|
4555
|
+
...t,
|
|
4556
|
+
isReady: t.isReady && t.isLoaded
|
|
4557
|
+
});
|
|
4558
|
+
}
|
|
4544
4559
|
get isReady$() {
|
|
4545
4560
|
return this.watch("isReady");
|
|
4546
4561
|
}
|