@prose-reader/react-reader 9.0.0 → 11.0.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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -17
- package/dist/index.js.map +1 -1
- package/dist/navigation/SpreadRotationHint.d.ts +6 -3
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { FaEdit as H } from "react-icons/fa";
|
|
|
6
6
|
import { LuArrowBigLeft as U, LuArrowBigRight as W, LuBookmark as G, LuCheck as K, LuChevronDown as q, LuCircleCheck as J, LuCircleHelp as ee, LuGalleryHorizontal as te, LuNotebookPen as ne, LuPause as re, LuPlay as ie, LuSearch as ae, LuTableOfContents as oe, LuX as se, LuZoomIn as ce, LuZoomOut as le } from "react-icons/lu";
|
|
7
7
|
import { isDefined as ue, signal as de, useConstant as fe, useLiveRef as pe, useMemoCompare as me, useObserve as Y, useSignalState as he, useSignalValue as ge, useSubscribe as _e } from "reactjrx";
|
|
8
8
|
import { BehaviorSubject as ve, EMPTY as ye, NEVER as be, Observable as xe, Subject as Se, animationFrameScheduler as Ce, combineLatest as we, debounceTime as Te, distinctUntilChanged as Ee, filter as De, finalize as Oe, first as ke, map as X, merge as Ae, mergeMap as je, of as Me, shareReplay as Ne, skip as Pe, startWith as Fe, switchMap as Ie, tap as Le, throttleTime as Re, timer as ze, withLatestFrom as Be } from "rxjs";
|
|
9
|
-
import { isHtmlTagElement as Ve, isShallowEqual as He, observeIntersection as Ue, pick as We, setPropertyIfChanged as Ge, setStylePropertyIfChanged as Ke,
|
|
9
|
+
import { isHtmlTagElement as Ve, isShallowEqual as He, observeIntersection as Ue, pick as We, setPropertyIfChanged as Ge, setStylePropertyIfChanged as Ke, shouldUseSpreadModeForViewport as qe, watchKeys as Je } from "@prose-reader/core";
|
|
10
10
|
import { Fragment as Ye, jsx as Z, jsxs as Q } from "react/jsx-runtime";
|
|
11
11
|
import { createPortal as Xe } from "react-dom";
|
|
12
12
|
import { isShallowEqual as Ze } from "@prose-reader/shared";
|
|
@@ -1502,7 +1502,7 @@ var Er = F((n) => {
|
|
|
1502
1502
|
contentProps: s,
|
|
1503
1503
|
children: d
|
|
1504
1504
|
}), r[8] = i, r[9] = a, r[10] = d, r[11] = f) : f = r[11], f;
|
|
1505
|
-
}), Or = "@prose-reader/react-reader", kr = "
|
|
1505
|
+
}), Or = "@prose-reader/react-reader", kr = "10.0.0", Ar = F((t) => {
|
|
1506
1506
|
let n = e(12), { open: r, setOpen: i } = t, a;
|
|
1507
1507
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = {
|
|
1508
1508
|
overflowY: "auto",
|
|
@@ -1684,17 +1684,19 @@ var Pr = {
|
|
|
1684
1684
|
}, Wr = {
|
|
1685
1685
|
base: "moderate",
|
|
1686
1686
|
_motionReduce: "0ms"
|
|
1687
|
-
}, Gr = ({ manifest: e,
|
|
1687
|
+
}, Gr = ({ manifest: e, spreadMode: t, viewport: n }) => n.width !== n.height && qe({
|
|
1688
|
+
spreadMode: t,
|
|
1688
1689
|
manifest: e,
|
|
1689
1690
|
viewport: {
|
|
1690
|
-
height:
|
|
1691
|
-
width:
|
|
1691
|
+
height: n.width,
|
|
1692
|
+
width: n.height
|
|
1692
1693
|
}
|
|
1693
|
-
}), Kr = ({ manifest: e, pagination: t,
|
|
1694
|
-
if (
|
|
1694
|
+
}), Kr = ({ manifest: e, pagination: t, spreadMode: n, isSpread: r, viewportState: i, viewport: a, isPanorama: o }) => {
|
|
1695
|
+
if (i === "free" && !r && Gr({
|
|
1695
1696
|
manifest: e,
|
|
1696
|
-
|
|
1697
|
-
|
|
1697
|
+
spreadMode: n,
|
|
1698
|
+
viewport: a
|
|
1699
|
+
}) && o) return [
|
|
1698
1700
|
t.beginSpineItemIndex,
|
|
1699
1701
|
t.beginPageIndexInSpineItem,
|
|
1700
1702
|
t.endSpineItemIndex,
|
|
@@ -1721,19 +1723,24 @@ var Pr = {
|
|
|
1721
1723
|
}), r = Dt(e) ? e : void 0;
|
|
1722
1724
|
return we([
|
|
1723
1725
|
t,
|
|
1724
|
-
e.settings.watch(["computedSpreadMode"]),
|
|
1725
1726
|
e.viewportState$,
|
|
1726
|
-
e.viewport.watch([
|
|
1727
|
+
e.viewport.watch([
|
|
1728
|
+
"width",
|
|
1729
|
+
"height",
|
|
1730
|
+
"isSpread"
|
|
1731
|
+
]),
|
|
1732
|
+
e.settings.watch(["spreadMode"]),
|
|
1727
1733
|
n
|
|
1728
|
-
]).pipe(Te(Vr), X(([t, n, i, a, {
|
|
1729
|
-
let
|
|
1734
|
+
]).pipe(Te(Vr), X(([t, n, { isSpread: i, ...a }, { spreadMode: o }, { spineItem: s, isReady: c }]) => {
|
|
1735
|
+
let l = e.context.manifest;
|
|
1730
1736
|
return Kr({
|
|
1731
|
-
manifest:
|
|
1737
|
+
manifest: l,
|
|
1732
1738
|
pagination: t,
|
|
1733
|
-
|
|
1734
|
-
|
|
1739
|
+
spreadMode: o,
|
|
1740
|
+
isSpread: i,
|
|
1741
|
+
viewportState: n,
|
|
1735
1742
|
viewport: a,
|
|
1736
|
-
isPanorama:
|
|
1743
|
+
isPanorama: c && r !== void 0 && s !== void 0 && r.cbz.isPanoramaSpineItem(s)
|
|
1737
1744
|
});
|
|
1738
1745
|
}), Ee());
|
|
1739
1746
|
}, Xr = () => {
|