@prose-reader/core 1.365.0 → 1.367.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
@@ -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(() => this.spineItemsManager.items.reduce((t, a, o) => t.pipe(y(({ horizontalOffset: t, verticalOffset: s }) => {
4280
- let c = t % i.absoluteViewport.width === 0, l = o === e.items.length - 1, u = r.values.computedPageTurnDirection === "vertical", d = n.isRTL(), f = this.getSpreadPosition(c, d), { edgeX: p, edgeY: m } = this.getStartEdges(u, c, t, s, i.absoluteViewport.height);
4281
- return a.layout({
4282
- spreadPosition: f,
4283
- horizontalOffset: t,
4284
- isLastItem: l,
4285
- edgeX: p,
4286
- edgeY: m
4287
- }).pipe(T(({ width: e, height: t }) => {
4288
- let n = this.createSpineItemLayout(u, d, p, m, e, t, i.absoluteViewport.width);
4289
- return this.spineItemsRelativeLayouts[o] = n, {
4290
- horizontalOffset: p + e,
4291
- verticalOffset: u ? m + t : 0
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
- })), D({
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) => {