@prose-reader/react-reader 1.186.0 → 1.187.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 +433 -272
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/dist/src/ReactReader.d.ts +4 -4
- package/dist/src/context/useReader.d.ts +2 -0
- package/dist/src/navigation/QuickMenu/BottomBar.d.ts +2 -1
- package/dist/src/navigation/QuickMenu/QuickMenu.d.ts +2 -1
- package/dist/src/search/SearchDialog.d.ts +5 -0
- package/dist/src/search/SearchDialogContent.d.ts +4 -0
- package/dist/src/search/SearchListItem.d.ts +9 -0
- package/package.json +8 -2
- /package/dist/src/{navigation/help → help}/HelpDialog.d.ts +0 -0
- /package/dist/src/{navigation/toc → toc}/TableOfContentsDialog.d.ts +0 -0
- /package/dist/src/{navigation/toc → toc}/TableOfContentsDialogContent.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,122 +1,192 @@
|
|
|
1
|
-
import { jsx as t, jsxs as a, Fragment as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { signal as
|
|
5
|
-
import { tap as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { RxDoubleArrowUp as
|
|
9
|
-
import { HiOutlineInformationCircle as
|
|
10
|
-
import
|
|
1
|
+
import { jsx as t, jsxs as a, Fragment as F } from "react/jsx-runtime";
|
|
2
|
+
import * as w from "react";
|
|
3
|
+
import he, { createContext as ue, memo as p, useMemo as ge, useEffect as M, useContext as oe, useState as T, useCallback as H } from "react";
|
|
4
|
+
import { signal as me, useSignal as re, useLiveRef as fe, useSubscribe as le, useObserve as I, useSignalValue as pe } from "reactjrx";
|
|
5
|
+
import { tap as be, NEVER as xe, combineLatest as Ce, map as ie, startWith as ve } from "rxjs";
|
|
6
|
+
import { IconButton as b, Portal as se, Dialog as f, Heading as L, HStack as k, Kbd as te, Text as m, Button as _, Box as R, Popover as y, Progress as B, Stack as v, Presence as $, chakra as Ie, Collapsible as E, Link as ae, Input as Se, List as z } from "@chakra-ui/react";
|
|
7
|
+
import { LuX as Pe, LuArrowBigRight as Te, LuArrowBigLeft as ke, LuChevronDown as we, LuCircleHelp as ye, LuTableOfContents as Re, LuSearch as Oe, LuCircleCheck as ne } from "react-icons/lu";
|
|
8
|
+
import { RxDoubleArrowUp as De, RxDoubleArrowLeft as Ae, RxDoubleArrowDown as ze, RxDoubleArrowRight as Be } from "react-icons/rx";
|
|
9
|
+
import { HiOutlineInformationCircle as Me } from "react-icons/hi";
|
|
10
|
+
import Ee from "rc-slider";
|
|
11
11
|
import "rc-slider/assets/index.css";
|
|
12
|
-
import { IoIosArrowBack as
|
|
13
|
-
import { MdFullscreenExit as
|
|
14
|
-
const
|
|
12
|
+
import { IoIosArrowBack as Le, IoMdMore as $e } from "react-icons/io";
|
|
13
|
+
import { MdFullscreenExit as Fe, MdFullscreen as He } from "react-icons/md";
|
|
14
|
+
const N = ue({
|
|
15
15
|
reader: void 0,
|
|
16
|
-
quickMenuSignal:
|
|
17
|
-
}),
|
|
16
|
+
quickMenuSignal: me({ default: !1 })
|
|
17
|
+
}), kt = p(
|
|
18
18
|
({
|
|
19
19
|
children: e,
|
|
20
20
|
reader: n,
|
|
21
21
|
quickMenuOpen: r,
|
|
22
|
-
onQuickMenuOpenChange:
|
|
22
|
+
onQuickMenuOpenChange: l
|
|
23
23
|
}) => {
|
|
24
|
-
const [, o] =
|
|
24
|
+
const [, o] = re({
|
|
25
25
|
default: r
|
|
26
|
-
}),
|
|
26
|
+
}), i = fe(l), c = ge(
|
|
27
27
|
() => ({
|
|
28
28
|
quickMenuSignal: o,
|
|
29
29
|
reader: n
|
|
30
30
|
}),
|
|
31
31
|
[o, n]
|
|
32
32
|
);
|
|
33
|
-
return
|
|
33
|
+
return M(() => {
|
|
34
34
|
o.setValue(r);
|
|
35
|
-
}, [r, o]),
|
|
36
|
-
() => o.subject.pipe(
|
|
37
|
-
[o,
|
|
38
|
-
), /* @__PURE__ */ t(
|
|
35
|
+
}, [r, o]), le(
|
|
36
|
+
() => o.subject.pipe(be(i.current)),
|
|
37
|
+
[o, i]
|
|
38
|
+
), /* @__PURE__ */ t(N.Provider, { value: c, children: e });
|
|
39
39
|
}
|
|
40
|
-
),
|
|
41
|
-
|
|
40
|
+
), _e = "@prose-reader/react-reader", Ne = "1.186.0", We = w.forwardRef(function(n, r) {
|
|
41
|
+
return /* @__PURE__ */ t(b, { variant: "ghost", "aria-label": "Close", ref: r, ...n, children: n.children ?? /* @__PURE__ */ t(Pe, {}) });
|
|
42
|
+
}), W = w.forwardRef(function(n, r) {
|
|
43
|
+
const {
|
|
44
|
+
children: l,
|
|
45
|
+
portalled: o = !0,
|
|
46
|
+
portalRef: i,
|
|
47
|
+
backdrop: c = !0,
|
|
48
|
+
...d
|
|
49
|
+
} = n;
|
|
50
|
+
return /* @__PURE__ */ a(se, { disabled: !o, container: i, children: [
|
|
51
|
+
c && /* @__PURE__ */ t(f.Backdrop, {}),
|
|
52
|
+
/* @__PURE__ */ t(f.Positioner, { children: /* @__PURE__ */ t(f.Content, { ref: r, ...d, asChild: !1, children: l }) })
|
|
53
|
+
] });
|
|
54
|
+
}), j = w.forwardRef(function(n, r) {
|
|
55
|
+
return /* @__PURE__ */ t(
|
|
56
|
+
f.CloseTrigger,
|
|
57
|
+
{
|
|
58
|
+
position: "absolute",
|
|
59
|
+
top: "2",
|
|
60
|
+
insetEnd: "2",
|
|
61
|
+
...n,
|
|
62
|
+
asChild: !0,
|
|
63
|
+
children: /* @__PURE__ */ t(We, { size: "sm", ref: r, children: n.children })
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}), V = f.Root, q = f.Footer, U = f.Header, Y = f.Body;
|
|
67
|
+
f.Backdrop;
|
|
68
|
+
const Q = f.Title;
|
|
69
|
+
f.Description;
|
|
70
|
+
f.Trigger;
|
|
71
|
+
const G = f.ActionTrigger, je = p(
|
|
72
|
+
({
|
|
73
|
+
open: e,
|
|
74
|
+
setOpen: n
|
|
75
|
+
}) => /* @__PURE__ */ t(
|
|
76
|
+
V,
|
|
77
|
+
{
|
|
78
|
+
lazyMount: !0,
|
|
79
|
+
placement: "center",
|
|
80
|
+
open: e,
|
|
81
|
+
onOpenChange: (r) => n(r.open),
|
|
82
|
+
size: { mdDown: "full", md: "lg" },
|
|
83
|
+
scrollBehavior: "inside",
|
|
84
|
+
children: /* @__PURE__ */ a(W, { children: [
|
|
85
|
+
/* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(Q, { children: "Help" }) }),
|
|
86
|
+
/* @__PURE__ */ a(Y, { overflowY: "auto", flex: 1, children: [
|
|
87
|
+
/* @__PURE__ */ t(L, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
|
|
88
|
+
/* @__PURE__ */ a(k, { mb: 1, children: [
|
|
89
|
+
/* @__PURE__ */ t(te, { children: /* @__PURE__ */ t(Te, {}) }),
|
|
90
|
+
" ",
|
|
91
|
+
/* @__PURE__ */ t(m, { children: "Navigate to right page" })
|
|
92
|
+
] }),
|
|
93
|
+
/* @__PURE__ */ a(k, { mb: 1, children: [
|
|
94
|
+
/* @__PURE__ */ t(te, { children: /* @__PURE__ */ t(ke, {}) }),
|
|
95
|
+
" ",
|
|
96
|
+
/* @__PURE__ */ t(m, { children: "Navigate to left page" })
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ t(L, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
|
|
99
|
+
/* @__PURE__ */ a(m, { children: [
|
|
100
|
+
_e,
|
|
101
|
+
" version: ",
|
|
102
|
+
Ne
|
|
103
|
+
] })
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
|
|
106
|
+
/* @__PURE__ */ t(j, {})
|
|
107
|
+
] })
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
), O = () => {
|
|
111
|
+
const { reader: e } = oe(N);
|
|
42
112
|
return e;
|
|
43
|
-
},
|
|
44
|
-
const e =
|
|
45
|
-
return
|
|
46
|
-
() => e ?
|
|
47
|
-
|
|
113
|
+
}, ce = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, D = () => {
|
|
114
|
+
const e = O();
|
|
115
|
+
return I(
|
|
116
|
+
() => e ? Ce([e.pagination.state$, e.context.state$]).pipe(
|
|
117
|
+
ie(([n, r]) => {
|
|
48
118
|
var o;
|
|
49
|
-
const
|
|
50
|
-
(
|
|
119
|
+
const l = (o = r.manifest) == null ? void 0 : o.spineItems.every(
|
|
120
|
+
(i) => {
|
|
51
121
|
var c;
|
|
52
|
-
return (c =
|
|
122
|
+
return (c = i.mediaType) == null ? void 0 : c.startsWith("image/");
|
|
53
123
|
}
|
|
54
124
|
);
|
|
55
125
|
return {
|
|
56
126
|
...n,
|
|
57
|
-
hasChapters: !r.isFullyPrePaginated && !
|
|
127
|
+
hasChapters: !r.isFullyPrePaginated && !l
|
|
58
128
|
};
|
|
59
129
|
})
|
|
60
|
-
) :
|
|
130
|
+
) : xe,
|
|
61
131
|
[e]
|
|
62
132
|
);
|
|
63
|
-
},
|
|
64
|
-
const e =
|
|
133
|
+
}, Ve = () => {
|
|
134
|
+
const e = D(), n = Math.floor(
|
|
65
135
|
((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100
|
|
66
136
|
), r = n > 0 ? n : 1;
|
|
67
|
-
return (e == null ? void 0 : e.percentageEstimateOfBook) === void 0 ? null : /* @__PURE__ */ t(
|
|
137
|
+
return (e == null ? void 0 : e.percentageEstimateOfBook) === void 0 ? null : /* @__PURE__ */ t(R, { position: "absolute", right: 0, bottom: 0, p: 2, color: "black", children: /* @__PURE__ */ a(m, { fontSize: "sm", children: [
|
|
68
138
|
r,
|
|
69
139
|
" %"
|
|
70
140
|
] }) });
|
|
71
|
-
},
|
|
72
|
-
const [e, n] =
|
|
73
|
-
return
|
|
141
|
+
}, qe = () => {
|
|
142
|
+
const [e, n] = T(/* @__PURE__ */ new Date());
|
|
143
|
+
return M(() => {
|
|
74
144
|
const r = setInterval(() => {
|
|
75
145
|
n(/* @__PURE__ */ new Date());
|
|
76
146
|
}, 6e4);
|
|
77
147
|
return () => clearInterval(r);
|
|
78
148
|
}, []), e;
|
|
79
|
-
},
|
|
80
|
-
const n =
|
|
149
|
+
}, Ue = (e) => {
|
|
150
|
+
const n = qe();
|
|
81
151
|
return /* @__PURE__ */ t(m, { fontSize: "xs", ...e, children: n.toLocaleTimeString(navigator.language, {
|
|
82
152
|
hour: "2-digit",
|
|
83
153
|
minute: "2-digit"
|
|
84
154
|
}) });
|
|
85
|
-
},
|
|
86
|
-
const { quickMenuSignal: e } =
|
|
87
|
-
return [
|
|
88
|
-
},
|
|
89
|
-
const [e] =
|
|
155
|
+
}, K = () => {
|
|
156
|
+
const { quickMenuSignal: e } = oe(N);
|
|
157
|
+
return [pe(e), e.setValue, e];
|
|
158
|
+
}, Ye = () => {
|
|
159
|
+
const [e] = K();
|
|
90
160
|
return /* @__PURE__ */ t(
|
|
91
|
-
|
|
161
|
+
R,
|
|
92
162
|
{
|
|
93
163
|
position: "absolute",
|
|
94
164
|
left: 0,
|
|
95
165
|
bottom: 0,
|
|
96
166
|
p: 2,
|
|
97
167
|
color: e ? void 0 : "colorPalette.contrast",
|
|
98
|
-
children: /* @__PURE__ */ t(
|
|
168
|
+
children: /* @__PURE__ */ t(Ue, {})
|
|
99
169
|
}
|
|
100
170
|
);
|
|
101
|
-
},
|
|
171
|
+
}, Qe = w.forwardRef(
|
|
102
172
|
function(n, r) {
|
|
103
173
|
const {
|
|
104
|
-
showArrow:
|
|
174
|
+
showArrow: l,
|
|
105
175
|
children: o,
|
|
106
|
-
portalled:
|
|
176
|
+
portalled: i = !0,
|
|
107
177
|
content: c,
|
|
108
178
|
portalRef: d,
|
|
109
179
|
...u
|
|
110
180
|
} = n;
|
|
111
181
|
return /* @__PURE__ */ a(
|
|
112
|
-
|
|
182
|
+
y.Root,
|
|
113
183
|
{
|
|
114
184
|
...u,
|
|
115
185
|
positioning: { ...u.positioning, gutter: 4 },
|
|
116
186
|
children: [
|
|
117
|
-
/* @__PURE__ */ t(
|
|
118
|
-
/* @__PURE__ */ t(
|
|
119
|
-
|
|
187
|
+
/* @__PURE__ */ t(y.Trigger, { asChild: !0, children: o }),
|
|
188
|
+
/* @__PURE__ */ t(se, { disabled: !i, container: d, children: /* @__PURE__ */ t(y.Positioner, { children: /* @__PURE__ */ a(
|
|
189
|
+
y.Content,
|
|
120
190
|
{
|
|
121
191
|
width: "auto",
|
|
122
192
|
px: "2",
|
|
@@ -125,7 +195,7 @@ const F = le({
|
|
|
125
195
|
rounded: "sm",
|
|
126
196
|
ref: r,
|
|
127
197
|
children: [
|
|
128
|
-
|
|
198
|
+
l && /* @__PURE__ */ t(y.Arrow, { children: /* @__PURE__ */ t(y.ArrowTip, {}) }),
|
|
129
199
|
c
|
|
130
200
|
]
|
|
131
201
|
}
|
|
@@ -134,61 +204,61 @@ const F = le({
|
|
|
134
204
|
}
|
|
135
205
|
);
|
|
136
206
|
}
|
|
137
|
-
),
|
|
138
|
-
const { children:
|
|
139
|
-
return /* @__PURE__ */ t(
|
|
140
|
-
|
|
207
|
+
), Ge = w.forwardRef(function(n, r) {
|
|
208
|
+
const { children: l, ...o } = n;
|
|
209
|
+
return /* @__PURE__ */ t(Qe, { content: l, ...o, ref: r, children: /* @__PURE__ */ t(
|
|
210
|
+
b,
|
|
141
211
|
{
|
|
142
212
|
variant: "ghost",
|
|
143
213
|
"aria-label": "info",
|
|
144
214
|
size: "2xs",
|
|
145
215
|
colorPalette: "gray",
|
|
146
|
-
children: /* @__PURE__ */ t(
|
|
216
|
+
children: /* @__PURE__ */ t(Me, {})
|
|
147
217
|
}
|
|
148
218
|
) });
|
|
149
|
-
}),
|
|
150
|
-
return /* @__PURE__ */ t(
|
|
219
|
+
}), Ke = w.forwardRef(function(n, r) {
|
|
220
|
+
return /* @__PURE__ */ t(B.Track, { ...n, ref: r, children: /* @__PURE__ */ t(B.Range, {}) });
|
|
151
221
|
});
|
|
152
|
-
|
|
153
|
-
const { children:
|
|
154
|
-
return /* @__PURE__ */ a(
|
|
155
|
-
|
|
156
|
-
o && /* @__PURE__ */ t(
|
|
222
|
+
w.forwardRef(function(n, r) {
|
|
223
|
+
const { children: l, info: o, ...i } = n;
|
|
224
|
+
return /* @__PURE__ */ a(B.Label, { ...i, ref: r, children: [
|
|
225
|
+
l,
|
|
226
|
+
o && /* @__PURE__ */ t(Ge, { children: o })
|
|
157
227
|
] });
|
|
158
228
|
});
|
|
159
|
-
const
|
|
160
|
-
const e =
|
|
229
|
+
const Xe = B.Root, Je = B.ValueText, X = () => {
|
|
230
|
+
const e = D(), n = (e == null ? void 0 : e.numberOfTotalPages) === 1, r = ((e == null ? void 0 : e.beginNumberOfPagesInSpineItem) ?? 0) > 1, l = ((e == null ? void 0 : e.endNumberOfPagesInSpineItem) ?? 0) > 1, o = (e != null && e.hasChapters ? e == null ? void 0 : e.beginPageIndexInSpineItem : e == null ? void 0 : e.beginAbsolutePageIndex) ?? 0, i = (e != null && e.hasChapters ? e == null ? void 0 : e.endPageIndexInSpineItem : e == null ? void 0 : e.endAbsolutePageIndex) ?? 0, [c = 0, d = 0] = [
|
|
161
231
|
o,
|
|
162
|
-
|
|
163
|
-
].sort((
|
|
232
|
+
i
|
|
233
|
+
].sort((g, h) => g - h), u = (e == null ? void 0 : e.beginPageIndexInSpineItem) !== (e == null ? void 0 : e.endPageIndexInSpineItem) || (e == null ? void 0 : e.beginSpineItemIndex) !== (e == null ? void 0 : e.endSpineItemIndex), s = e != null && e.hasChapters ? e == null ? void 0 : e.beginNumberOfPagesInSpineItem : e == null ? void 0 : e.numberOfTotalPages;
|
|
164
234
|
return {
|
|
165
235
|
hasOnlyOnePage: n,
|
|
166
236
|
beginPageIndex: o,
|
|
167
|
-
endPageIndex:
|
|
237
|
+
endPageIndex: i,
|
|
168
238
|
isBeginWithinChapter: r,
|
|
169
|
-
isEndWithinChapter:
|
|
239
|
+
isEndWithinChapter: l,
|
|
170
240
|
beginAndEndAreDifferent: u,
|
|
171
241
|
totalApproximatePages: s,
|
|
172
242
|
leftPageIndex: c,
|
|
173
243
|
rightPageIndex: d
|
|
174
244
|
};
|
|
175
|
-
},
|
|
176
|
-
const e =
|
|
245
|
+
}, Ze = () => {
|
|
246
|
+
const e = D(), {
|
|
177
247
|
hasOnlyOnePage: n,
|
|
178
248
|
leftPageIndex: r,
|
|
179
|
-
rightPageIndex:
|
|
249
|
+
rightPageIndex: l,
|
|
180
250
|
totalApproximatePages: o,
|
|
181
|
-
beginAndEndAreDifferent:
|
|
182
|
-
} =
|
|
183
|
-
return /* @__PURE__ */ a(
|
|
184
|
-
/* @__PURE__ */ t(
|
|
185
|
-
/* @__PURE__ */ t(
|
|
186
|
-
/* @__PURE__ */ t(
|
|
251
|
+
beginAndEndAreDifferent: i
|
|
252
|
+
} = X(), c = Math.round(((e == null ? void 0 : e.percentageEstimateOfBook) ?? 0) * 100), d = (s) => s != null && s.subChapter ? `${s.title} / ${d(s.subChapter)}` : (s == null ? void 0 : s.title) || "", u = d(e == null ? void 0 : e.beginChapterInfo);
|
|
253
|
+
return /* @__PURE__ */ a(v, { alignItems: "center", gap: 1, maxW: "100%", overflow: "auto", children: [
|
|
254
|
+
/* @__PURE__ */ t(Xe, { value: c, size: "xs", width: 150, children: /* @__PURE__ */ a(k, { justifyContent: "space-between", children: [
|
|
255
|
+
/* @__PURE__ */ t(Ke, { width: 110 }),
|
|
256
|
+
/* @__PURE__ */ t(Je, { children: `${c}%` })
|
|
187
257
|
] }) }),
|
|
188
258
|
/* @__PURE__ */ t(m, { truncate: !0, maxWidth: "100%", fontSize: "sm", mt: 1, children: u ? `Chapter: ${u}` : " " }),
|
|
189
|
-
!n && /* @__PURE__ */ a(
|
|
190
|
-
/* @__PURE__ */ t(m, { fontSize: "xs", children:
|
|
191
|
-
!!(e != null && e.hasChapters) && /* @__PURE__ */ a(
|
|
259
|
+
!n && /* @__PURE__ */ a(k, { children: [
|
|
260
|
+
/* @__PURE__ */ t(m, { fontSize: "xs", children: i ? `${r + 1} - ${l + 1} of ${o}` : `${r + 1} of ${o}` }),
|
|
261
|
+
!!(e != null && e.hasChapters) && /* @__PURE__ */ a(F, { children: [
|
|
192
262
|
/* @__PURE__ */ t(m, { children: "-" }),
|
|
193
263
|
/* @__PURE__ */ a(m, { fontSize: "xs", children: [
|
|
194
264
|
"(",
|
|
@@ -198,13 +268,13 @@ const We = O.Root, je = O.ValueText, H = () => {
|
|
|
198
268
|
] })
|
|
199
269
|
] })
|
|
200
270
|
] });
|
|
201
|
-
},
|
|
271
|
+
}, de = p(
|
|
202
272
|
({
|
|
203
273
|
children: e,
|
|
204
274
|
position: n,
|
|
205
275
|
...r
|
|
206
276
|
}) => /* @__PURE__ */ t(
|
|
207
|
-
|
|
277
|
+
$,
|
|
208
278
|
{
|
|
209
279
|
display: "flex",
|
|
210
280
|
flexDirection: "row",
|
|
@@ -228,8 +298,8 @@ const We = O.Root, je = O.ValueText, H = () => {
|
|
|
228
298
|
children: e
|
|
229
299
|
}
|
|
230
300
|
)
|
|
231
|
-
),
|
|
232
|
-
|
|
301
|
+
), et = Ie(Ee), tt = p((e) => /* @__PURE__ */ t(
|
|
302
|
+
R,
|
|
233
303
|
{
|
|
234
304
|
display: "contents",
|
|
235
305
|
css: {
|
|
@@ -238,7 +308,7 @@ const We = O.Root, je = O.ValueText, H = () => {
|
|
|
238
308
|
"--color-solid": "colors.colorPalette.solid"
|
|
239
309
|
},
|
|
240
310
|
children: /* @__PURE__ */ t(
|
|
241
|
-
|
|
311
|
+
et,
|
|
242
312
|
{
|
|
243
313
|
keyboard: !1,
|
|
244
314
|
style: {
|
|
@@ -282,87 +352,88 @@ const We = O.Root, je = O.ValueText, H = () => {
|
|
|
282
352
|
}
|
|
283
353
|
)
|
|
284
354
|
}
|
|
285
|
-
)),
|
|
286
|
-
const e =
|
|
355
|
+
)), nt = () => {
|
|
356
|
+
const e = D(), n = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: r, totalApproximatePages: l = 0 } = X(), o = n ? Math.floor((r || 0) / 2) : r, [i, c] = re({
|
|
287
357
|
default: o || 0
|
|
288
358
|
}), d = 0, u = Math.max(
|
|
289
359
|
0,
|
|
290
|
-
n ? Math.floor((
|
|
360
|
+
n ? Math.floor((l - 1) / 2) : l - 1
|
|
291
361
|
);
|
|
292
|
-
return
|
|
362
|
+
return M(() => {
|
|
293
363
|
c.setValue(o || 0);
|
|
294
364
|
}, [o, c]), {
|
|
295
|
-
value:
|
|
365
|
+
value: i,
|
|
296
366
|
valueSignal: c,
|
|
297
367
|
min: d,
|
|
298
368
|
max: u
|
|
299
369
|
};
|
|
300
|
-
},
|
|
301
|
-
const e =
|
|
302
|
-
(
|
|
303
|
-
const [
|
|
304
|
-
|
|
305
|
-
const
|
|
370
|
+
}, ot = () => {
|
|
371
|
+
const e = O(), n = D(), { manifest: r } = I(() => e == null ? void 0 : e.context.state$, []) ?? {}, l = (r == null ? void 0 : r.readingDirection) === "rtl", o = n == null ? void 0 : n.isUsingSpread, { totalApproximatePages: i = 0, isBeginWithinChapter: c } = X(), d = 1, u = c, { value: s, valueSignal: g, min: h, max: S } = nt(), P = H(
|
|
372
|
+
(x) => {
|
|
373
|
+
const [C = 0] = Array.isArray(x) ? x : [x];
|
|
374
|
+
g.setValue(C);
|
|
375
|
+
const A = o ? Math.floor(C) * 2 : Math.floor(C);
|
|
306
376
|
u ? e == null || e.navigation.goToPageOfSpineItem({
|
|
307
|
-
pageIndex:
|
|
377
|
+
pageIndex: A,
|
|
308
378
|
spineItemId: e.pagination.getState().beginSpineItemIndex ?? 0,
|
|
309
379
|
animation: !1
|
|
310
380
|
}) : e == null || e.navigation.goToAbsolutePageIndex({
|
|
311
|
-
absolutePageIndex:
|
|
381
|
+
absolutePageIndex: A,
|
|
312
382
|
animation: !1
|
|
313
383
|
});
|
|
314
384
|
},
|
|
315
|
-
[e, o,
|
|
385
|
+
[e, o, g, u]
|
|
316
386
|
);
|
|
317
|
-
return
|
|
387
|
+
return le(
|
|
318
388
|
() => e == null ? void 0 : e.navigation.throttleLock({
|
|
319
389
|
duration: 100,
|
|
320
|
-
trigger:
|
|
390
|
+
trigger: g.subject
|
|
321
391
|
}),
|
|
322
|
-
[e,
|
|
323
|
-
),
|
|
324
|
-
|
|
392
|
+
[e, g]
|
|
393
|
+
), i === 1 || o && i === 2 ? null : /* @__PURE__ */ t(
|
|
394
|
+
tt,
|
|
325
395
|
{
|
|
326
396
|
value: [s],
|
|
327
397
|
max: S,
|
|
328
398
|
min: h,
|
|
329
|
-
reverse:
|
|
399
|
+
reverse: l,
|
|
330
400
|
step: d,
|
|
331
|
-
onChange:
|
|
401
|
+
onChange: P
|
|
332
402
|
}
|
|
333
403
|
);
|
|
334
|
-
},
|
|
404
|
+
}, rt = p(
|
|
335
405
|
({
|
|
336
406
|
open: e,
|
|
337
407
|
onTableOfContentsClick: n,
|
|
338
|
-
onHelpClick: r
|
|
408
|
+
onHelpClick: r,
|
|
409
|
+
onSearchClick: l
|
|
339
410
|
}) => {
|
|
340
|
-
const
|
|
411
|
+
const o = O(), i = I(() => o == null ? void 0 : o.navigation.state$, [o]), c = I(() => o == null ? void 0 : o.settings.values$, [o]), d = (c == null ? void 0 : c.computedPageTurnDirection) === "vertical", [u, s] = T(!0);
|
|
341
412
|
return /* @__PURE__ */ t(
|
|
342
|
-
|
|
413
|
+
de,
|
|
343
414
|
{
|
|
344
415
|
present: e,
|
|
345
416
|
position: "bottom",
|
|
346
417
|
children: /* @__PURE__ */ a(
|
|
347
|
-
|
|
418
|
+
v,
|
|
348
419
|
{
|
|
349
420
|
flex: 1,
|
|
350
421
|
children: [
|
|
351
|
-
/* @__PURE__ */ a(
|
|
422
|
+
/* @__PURE__ */ a(k, { flex: 1, alignItems: "center", justifyContent: "center", children: [
|
|
352
423
|
/* @__PURE__ */ t(
|
|
353
|
-
|
|
424
|
+
b,
|
|
354
425
|
{
|
|
355
426
|
"aria-label": "left",
|
|
356
427
|
size: "lg",
|
|
357
428
|
variant: "ghost",
|
|
358
429
|
flexShrink: 0,
|
|
359
|
-
onClick: () =>
|
|
360
|
-
disabled: !(
|
|
361
|
-
children:
|
|
430
|
+
onClick: () => o == null ? void 0 : o.navigation.goToLeftOrTopSpineItem(),
|
|
431
|
+
disabled: !(i != null && i.canGoLeftSpineItem) && !(i != null && i.canGoTopSpineItem),
|
|
432
|
+
children: d ? /* @__PURE__ */ t(De, {}) : /* @__PURE__ */ t(Ae, {})
|
|
362
433
|
}
|
|
363
434
|
),
|
|
364
435
|
/* @__PURE__ */ a(
|
|
365
|
-
|
|
436
|
+
v,
|
|
366
437
|
{
|
|
367
438
|
flex: 1,
|
|
368
439
|
maxW: 400,
|
|
@@ -371,82 +442,92 @@ const We = O.Root, je = O.ValueText, H = () => {
|
|
|
371
442
|
overflow: "visible",
|
|
372
443
|
px: 4,
|
|
373
444
|
children: [
|
|
374
|
-
/* @__PURE__ */ t(
|
|
375
|
-
/* @__PURE__ */ t(
|
|
445
|
+
/* @__PURE__ */ t(Ze, {}),
|
|
446
|
+
/* @__PURE__ */ t(R, { height: 5, maxW: 300, width: "100%", overflow: "visible", children: /* @__PURE__ */ t(ot, {}) })
|
|
376
447
|
]
|
|
377
448
|
}
|
|
378
449
|
),
|
|
379
450
|
/* @__PURE__ */ t(
|
|
380
|
-
|
|
451
|
+
b,
|
|
381
452
|
{
|
|
382
453
|
"aria-label": "right",
|
|
383
454
|
size: "lg",
|
|
384
455
|
flexShrink: 0,
|
|
385
456
|
variant: "ghost",
|
|
386
|
-
disabled: !(
|
|
457
|
+
disabled: !(i != null && i.canGoRightSpineItem) && !(i != null && i.canGoBottomSpineItem),
|
|
387
458
|
onClick: () => {
|
|
388
|
-
|
|
459
|
+
o == null || o.navigation.goToRightOrBottomSpineItem();
|
|
389
460
|
},
|
|
390
|
-
children:
|
|
461
|
+
children: d ? /* @__PURE__ */ t(ze, {}) : /* @__PURE__ */ t(Be, {})
|
|
391
462
|
}
|
|
392
463
|
)
|
|
393
464
|
] }),
|
|
394
465
|
/* @__PURE__ */ t(
|
|
395
|
-
|
|
466
|
+
k,
|
|
396
467
|
{
|
|
397
468
|
alignItems: "center",
|
|
398
469
|
justifyContent: "center",
|
|
399
470
|
children: /* @__PURE__ */ a(
|
|
400
|
-
|
|
471
|
+
E.Root,
|
|
401
472
|
{
|
|
402
|
-
open:
|
|
473
|
+
open: u,
|
|
403
474
|
flex: 1,
|
|
404
|
-
onOpenChange: ({ open:
|
|
405
|
-
|
|
475
|
+
onOpenChange: ({ open: g }) => {
|
|
476
|
+
s(g);
|
|
406
477
|
},
|
|
407
478
|
children: [
|
|
408
479
|
/* @__PURE__ */ t(
|
|
409
|
-
|
|
480
|
+
E.Trigger,
|
|
410
481
|
{
|
|
411
482
|
paddingY: "3",
|
|
412
483
|
width: "100%",
|
|
413
484
|
display: "flex",
|
|
414
485
|
justifyContent: "center",
|
|
415
486
|
children: /* @__PURE__ */ t(
|
|
416
|
-
|
|
487
|
+
we,
|
|
417
488
|
{
|
|
418
489
|
style: {
|
|
419
|
-
transform:
|
|
490
|
+
transform: u ? "rotate(0deg)" : "rotate(180deg)"
|
|
420
491
|
}
|
|
421
492
|
}
|
|
422
493
|
)
|
|
423
494
|
}
|
|
424
495
|
),
|
|
425
496
|
/* @__PURE__ */ a(
|
|
426
|
-
|
|
497
|
+
E.Content,
|
|
427
498
|
{
|
|
428
499
|
display: "flex",
|
|
429
500
|
justifyContent: "center",
|
|
430
501
|
gap: 2,
|
|
431
502
|
children: [
|
|
432
503
|
/* @__PURE__ */ t(
|
|
433
|
-
|
|
504
|
+
b,
|
|
434
505
|
{
|
|
435
506
|
"aria-label": "Help",
|
|
436
507
|
size: "lg",
|
|
437
508
|
variant: "ghost",
|
|
438
509
|
onClick: r,
|
|
439
|
-
children: /* @__PURE__ */ t(
|
|
510
|
+
children: /* @__PURE__ */ t(ye, {})
|
|
440
511
|
}
|
|
441
512
|
),
|
|
442
513
|
/* @__PURE__ */ t(
|
|
443
|
-
|
|
514
|
+
b,
|
|
444
515
|
{
|
|
445
516
|
"aria-label": "Table of contents",
|
|
446
517
|
size: "lg",
|
|
447
518
|
variant: "ghost",
|
|
448
519
|
onClick: n,
|
|
449
|
-
children: /* @__PURE__ */ t(
|
|
520
|
+
children: /* @__PURE__ */ t(Re, {})
|
|
521
|
+
}
|
|
522
|
+
),
|
|
523
|
+
ce(o) && /* @__PURE__ */ t(
|
|
524
|
+
b,
|
|
525
|
+
{
|
|
526
|
+
"aria-label": "Search",
|
|
527
|
+
size: "lg",
|
|
528
|
+
variant: "ghost",
|
|
529
|
+
onClick: l,
|
|
530
|
+
children: /* @__PURE__ */ t(Oe, {})
|
|
450
531
|
}
|
|
451
532
|
)
|
|
452
533
|
]
|
|
@@ -463,31 +544,31 @@ const We = O.Root, je = O.ValueText, H = () => {
|
|
|
463
544
|
}
|
|
464
545
|
);
|
|
465
546
|
}
|
|
466
|
-
),
|
|
467
|
-
const [e, n] =
|
|
547
|
+
), lt = () => {
|
|
548
|
+
const [e, n] = T(!1), r = H(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
|
|
468
549
|
n(!1);
|
|
469
550
|
}) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
|
|
470
551
|
n(!0);
|
|
471
552
|
}), []);
|
|
472
|
-
return
|
|
473
|
-
function
|
|
553
|
+
return M(() => {
|
|
554
|
+
function l() {
|
|
474
555
|
n(!!document.fullscreenElement);
|
|
475
556
|
}
|
|
476
|
-
return document.addEventListener("fullscreenchange",
|
|
477
|
-
document.removeEventListener("fullscreenchange",
|
|
557
|
+
return document.addEventListener("fullscreenchange", l), () => {
|
|
558
|
+
document.removeEventListener("fullscreenchange", l);
|
|
478
559
|
};
|
|
479
560
|
}, []), {
|
|
480
561
|
isFullscreen: e,
|
|
481
562
|
onToggleFullscreenClick: r
|
|
482
563
|
};
|
|
483
|
-
},
|
|
564
|
+
}, it = ({
|
|
484
565
|
open: e,
|
|
485
566
|
onBackClick: n,
|
|
486
567
|
onMoreClick: r
|
|
487
568
|
}) => {
|
|
488
|
-
const
|
|
569
|
+
const l = O(), o = I(() => l == null ? void 0 : l.context.manifest$, [l]), { isFullscreen: i, onToggleFullscreenClick: c } = lt();
|
|
489
570
|
return /* @__PURE__ */ a(
|
|
490
|
-
|
|
571
|
+
de,
|
|
491
572
|
{
|
|
492
573
|
present: e,
|
|
493
574
|
position: "top",
|
|
@@ -495,18 +576,18 @@ const We = O.Root, je = O.ValueText, H = () => {
|
|
|
495
576
|
justifyContent: "space-between",
|
|
496
577
|
children: [
|
|
497
578
|
/* @__PURE__ */ t(
|
|
498
|
-
|
|
579
|
+
b,
|
|
499
580
|
{
|
|
500
581
|
"aria-label": "left",
|
|
501
582
|
size: "lg",
|
|
502
583
|
variant: "ghost",
|
|
503
584
|
flexShrink: 0,
|
|
504
585
|
onClick: n,
|
|
505
|
-
children: /* @__PURE__ */ t(
|
|
586
|
+
children: /* @__PURE__ */ t(Le, {})
|
|
506
587
|
}
|
|
507
588
|
),
|
|
508
589
|
/* @__PURE__ */ t(
|
|
509
|
-
|
|
590
|
+
v,
|
|
510
591
|
{
|
|
511
592
|
flex: 1,
|
|
512
593
|
maxW: 600,
|
|
@@ -517,161 +598,228 @@ const We = O.Root, je = O.ValueText, H = () => {
|
|
|
517
598
|
children: /* @__PURE__ */ t(m, { truncate: !0, maxWidth: "100%", children: o == null ? void 0 : o.title })
|
|
518
599
|
}
|
|
519
600
|
),
|
|
520
|
-
/* @__PURE__ */ a(
|
|
601
|
+
/* @__PURE__ */ a(k, { children: [
|
|
521
602
|
/* @__PURE__ */ t(
|
|
522
|
-
|
|
603
|
+
b,
|
|
523
604
|
{
|
|
524
605
|
"aria-label": "right",
|
|
525
606
|
size: "lg",
|
|
526
607
|
flexShrink: 0,
|
|
527
608
|
variant: "ghost",
|
|
528
609
|
onClick: r,
|
|
529
|
-
children: /* @__PURE__ */ t(
|
|
610
|
+
children: /* @__PURE__ */ t($e, {})
|
|
530
611
|
}
|
|
531
612
|
),
|
|
532
613
|
/* @__PURE__ */ t(
|
|
533
|
-
|
|
614
|
+
b,
|
|
534
615
|
{
|
|
535
616
|
"aria-label": "right",
|
|
536
617
|
size: "lg",
|
|
537
618
|
flexShrink: 0,
|
|
538
619
|
variant: "ghost",
|
|
539
620
|
onClick: c,
|
|
540
|
-
children:
|
|
621
|
+
children: i ? /* @__PURE__ */ t(Fe, {}) : /* @__PURE__ */ t(He, {})
|
|
541
622
|
}
|
|
542
623
|
)
|
|
543
624
|
] })
|
|
544
625
|
]
|
|
545
626
|
}
|
|
546
627
|
);
|
|
547
|
-
},
|
|
628
|
+
}, st = p(
|
|
548
629
|
({
|
|
549
630
|
onBackClick: e,
|
|
550
631
|
onMoreClick: n,
|
|
551
632
|
onTableOfContentsClick: r,
|
|
552
|
-
onHelpClick:
|
|
633
|
+
onHelpClick: l,
|
|
634
|
+
onSearchClick: o
|
|
553
635
|
}) => {
|
|
554
|
-
const [
|
|
555
|
-
return /* @__PURE__ */ a(
|
|
636
|
+
const [i] = K();
|
|
637
|
+
return /* @__PURE__ */ a(F, { children: [
|
|
556
638
|
/* @__PURE__ */ t(
|
|
557
|
-
|
|
639
|
+
it,
|
|
558
640
|
{
|
|
559
|
-
open:
|
|
641
|
+
open: i,
|
|
560
642
|
onBackClick: e,
|
|
561
643
|
onMoreClick: n
|
|
562
644
|
}
|
|
563
645
|
),
|
|
564
646
|
/* @__PURE__ */ t(
|
|
565
|
-
|
|
647
|
+
rt,
|
|
566
648
|
{
|
|
567
|
-
open:
|
|
649
|
+
open: i,
|
|
568
650
|
onTableOfContentsClick: r,
|
|
569
|
-
onHelpClick:
|
|
651
|
+
onHelpClick: l,
|
|
652
|
+
onSearchClick: o
|
|
570
653
|
}
|
|
571
654
|
)
|
|
572
655
|
] });
|
|
573
656
|
}
|
|
574
|
-
),
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
657
|
+
), at = p(
|
|
658
|
+
({
|
|
659
|
+
contextText: e = "",
|
|
660
|
+
startOffset: n = 0,
|
|
661
|
+
text: r,
|
|
662
|
+
cfi: l = "#",
|
|
663
|
+
onClick: o,
|
|
664
|
+
absolutePageIndex: i
|
|
665
|
+
}) => {
|
|
666
|
+
const d = e.substring(
|
|
667
|
+
Math.max(n - 15, 0),
|
|
668
|
+
Math.max(n, 0)
|
|
669
|
+
), u = e.substring(
|
|
670
|
+
Math.min(n + r.length, e.length - 1),
|
|
671
|
+
Math.min(
|
|
672
|
+
n + r.length + 15,
|
|
673
|
+
e.length - 1
|
|
674
|
+
)
|
|
675
|
+
);
|
|
676
|
+
return /* @__PURE__ */ a(
|
|
677
|
+
ae,
|
|
678
|
+
{
|
|
679
|
+
href: l,
|
|
680
|
+
style: { margin: 5, overflow: "hidden" },
|
|
681
|
+
onClick: (s) => {
|
|
682
|
+
s.preventDefault(), o(l);
|
|
683
|
+
},
|
|
684
|
+
display: "flex",
|
|
685
|
+
flexDirection: "column",
|
|
686
|
+
alignItems: "flex-start",
|
|
687
|
+
gap: 0,
|
|
688
|
+
children: [
|
|
689
|
+
/* @__PURE__ */ a(m, { lineClamp: 1, as: "cite", style: { display: "block" }, children: [
|
|
690
|
+
'"',
|
|
691
|
+
d,
|
|
692
|
+
/* @__PURE__ */ t("b", { children: r }),
|
|
693
|
+
u,
|
|
694
|
+
'"'
|
|
695
|
+
] }),
|
|
696
|
+
/* @__PURE__ */ t(m, { fontSize: "sm", color: "gray.500", style: { textDecoration: "none" }, children: `Book page: ${i !== void 0 ? i + 1 : "unknown (not loaded)"}` })
|
|
697
|
+
]
|
|
698
|
+
}
|
|
699
|
+
);
|
|
700
|
+
}
|
|
701
|
+
), ct = p(
|
|
702
|
+
({
|
|
703
|
+
onNavigate: e
|
|
704
|
+
}) => {
|
|
705
|
+
const [n, r] = T(""), l = O(), o = ce(l) ? l : void 0, i = (h) => {
|
|
706
|
+
r(h.target.value);
|
|
707
|
+
}, c = H(
|
|
708
|
+
(h) => {
|
|
709
|
+
e(), l == null || l.navigation.goToCfi(h);
|
|
710
|
+
},
|
|
711
|
+
[l, e]
|
|
712
|
+
), d = I(
|
|
713
|
+
() => o == null ? void 0 : o.search.search(n).pipe(
|
|
714
|
+
ie((h) => ({ type: "end", data: h })),
|
|
715
|
+
ve({ type: "start" })
|
|
716
|
+
),
|
|
717
|
+
[l, n]
|
|
718
|
+
), u = (d == null ? void 0 : d.type) === "start", s = (d == null ? void 0 : d.type) === "end" ? d.data : [], g = I(
|
|
719
|
+
() => l == null ? void 0 : l.pagination.locate(s.slice(0, 100)),
|
|
720
|
+
[s]
|
|
721
|
+
);
|
|
722
|
+
return /* @__PURE__ */ a(v, { flex: 1, height: "100%", children: [
|
|
723
|
+
/* @__PURE__ */ t(R, { px: 4, children: /* @__PURE__ */ t(
|
|
724
|
+
Se,
|
|
725
|
+
{
|
|
726
|
+
placeholder: "Type something...",
|
|
727
|
+
value: n,
|
|
728
|
+
onChange: i,
|
|
729
|
+
borderRadius: 0
|
|
730
|
+
}
|
|
731
|
+
) }),
|
|
732
|
+
/* @__PURE__ */ a(
|
|
733
|
+
R,
|
|
734
|
+
{
|
|
735
|
+
px: 4,
|
|
736
|
+
pb: 4,
|
|
737
|
+
mt: 2,
|
|
738
|
+
flex: 1,
|
|
739
|
+
style: { overflow: "hidden", overflowY: "auto" },
|
|
740
|
+
children: [
|
|
741
|
+
u && /* @__PURE__ */ t(m, { children: "Searching ..." }),
|
|
742
|
+
!u && s.length === 0 && /* @__PURE__ */ t("p", { children: "There are no results" }),
|
|
743
|
+
!u && s.length >= 0 && /* @__PURE__ */ a(v, { children: [
|
|
744
|
+
/* @__PURE__ */ a(L, { as: "h2", size: "md", children: [
|
|
745
|
+
s.length,
|
|
746
|
+
" result(s)"
|
|
747
|
+
] }),
|
|
748
|
+
/* @__PURE__ */ t(v, { gap: 0, children: g == null ? void 0 : g.map((h, S) => {
|
|
749
|
+
var P, x, C, A, J, Z, ee;
|
|
750
|
+
return /* @__PURE__ */ t(
|
|
751
|
+
at,
|
|
752
|
+
{
|
|
753
|
+
contextText: ((C = (x = (P = h.meta) == null ? void 0 : P.range) == null ? void 0 : x.startContainer.parentElement) == null ? void 0 : C.textContent) ?? "",
|
|
754
|
+
pageIndex: (A = h.meta) == null ? void 0 : A.itemPageIndex,
|
|
755
|
+
startOffset: ((Z = (J = h.meta) == null ? void 0 : J.range) == null ? void 0 : Z.startOffset) ?? 0,
|
|
756
|
+
text: n,
|
|
757
|
+
cfi: h.cfi,
|
|
758
|
+
onClick: c,
|
|
759
|
+
absolutePageIndex: (ee = h.meta) == null ? void 0 : ee.absolutePageIndex
|
|
760
|
+
},
|
|
761
|
+
S
|
|
762
|
+
);
|
|
763
|
+
}) })
|
|
764
|
+
] })
|
|
765
|
+
]
|
|
766
|
+
}
|
|
767
|
+
)
|
|
768
|
+
] });
|
|
769
|
+
}
|
|
770
|
+
), dt = p(
|
|
606
771
|
({
|
|
607
772
|
open: e,
|
|
608
|
-
setOpen: n
|
|
773
|
+
setOpen: n,
|
|
774
|
+
onNavigate: r
|
|
609
775
|
}) => /* @__PURE__ */ t(
|
|
610
|
-
|
|
776
|
+
V,
|
|
611
777
|
{
|
|
612
778
|
lazyMount: !0,
|
|
613
779
|
placement: "center",
|
|
614
780
|
open: e,
|
|
615
|
-
onOpenChange: (
|
|
781
|
+
onOpenChange: (l) => n(l.open),
|
|
616
782
|
size: { mdDown: "full", md: "lg" },
|
|
617
783
|
scrollBehavior: "inside",
|
|
618
|
-
children: /* @__PURE__ */ a(
|
|
619
|
-
/* @__PURE__ */ t(
|
|
620
|
-
/* @__PURE__ */
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
/* @__PURE__ */ t(N, { children: /* @__PURE__ */ t(ve, {}) }),
|
|
624
|
-
" ",
|
|
625
|
-
/* @__PURE__ */ t(m, { children: "Navigate to right page" })
|
|
626
|
-
] }),
|
|
627
|
-
/* @__PURE__ */ a(x, { mb: 1, children: [
|
|
628
|
-
/* @__PURE__ */ t(N, { children: /* @__PURE__ */ t(Pe, {}) }),
|
|
629
|
-
" ",
|
|
630
|
-
/* @__PURE__ */ t(m, { children: "Navigate to left page" })
|
|
631
|
-
] }),
|
|
632
|
-
/* @__PURE__ */ t(j, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
|
|
633
|
-
/* @__PURE__ */ a(m, { children: [
|
|
634
|
-
Xe,
|
|
635
|
-
" version: ",
|
|
636
|
-
Je
|
|
637
|
-
] })
|
|
638
|
-
] }),
|
|
639
|
-
/* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(re, { asChild: !0, children: /* @__PURE__ */ t(G, { variant: "outline", children: "Cancel" }) }) }),
|
|
640
|
-
/* @__PURE__ */ t(J, {})
|
|
784
|
+
children: /* @__PURE__ */ a(W, { height: "100%", children: [
|
|
785
|
+
/* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(Q, { children: "Search" }) }),
|
|
786
|
+
/* @__PURE__ */ t(Y, { flex: 1, children: /* @__PURE__ */ t(ct, { onNavigate: r }) }),
|
|
787
|
+
/* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
|
|
788
|
+
/* @__PURE__ */ t(j, {})
|
|
641
789
|
] })
|
|
642
790
|
}
|
|
643
791
|
)
|
|
644
|
-
),
|
|
792
|
+
), ht = p(
|
|
645
793
|
({
|
|
646
794
|
onNavigate: e
|
|
647
795
|
}) => {
|
|
648
|
-
const n =
|
|
796
|
+
const n = O(), { manifest: r, assumedRenditionLayout: l } = I(() => n == null ? void 0 : n.context.state$, [n]) ?? {}, { nav: o } = r ?? {}, i = D();
|
|
649
797
|
o != null && o.toc;
|
|
650
|
-
const { beginSpineItemIndex: c, beginPageIndexInSpineItem: d } =
|
|
651
|
-
console.log({ assumedRenditionLayout:
|
|
652
|
-
let s =
|
|
798
|
+
const { beginSpineItemIndex: c, beginPageIndexInSpineItem: d } = i ?? {}, u = (l === "reflowable" ? d : c) || 0;
|
|
799
|
+
console.log({ assumedRenditionLayout: l, currentSpineItemOrChapterPageIndex: u });
|
|
800
|
+
let s = i == null ? void 0 : i.beginChapterInfo;
|
|
653
801
|
for (; s != null && s.subChapter; )
|
|
654
802
|
s = s == null ? void 0 : s.subChapter;
|
|
655
|
-
const
|
|
803
|
+
const g = (h, S, P) => /* @__PURE__ */ a(he.Fragment, { children: [
|
|
656
804
|
/* @__PURE__ */ t(
|
|
657
|
-
|
|
805
|
+
z.Item,
|
|
658
806
|
{
|
|
659
|
-
pl: 4 * (
|
|
807
|
+
pl: 4 * (P + 1),
|
|
660
808
|
style: {
|
|
661
809
|
display: "flex",
|
|
662
810
|
alignItems: "center"
|
|
663
811
|
},
|
|
664
812
|
children: /* @__PURE__ */ a(
|
|
665
|
-
|
|
813
|
+
ae,
|
|
666
814
|
{
|
|
667
815
|
onClick: () => {
|
|
668
816
|
e(), n == null || n.navigation.goToUrl(h.href);
|
|
669
817
|
},
|
|
670
818
|
href: "#",
|
|
671
819
|
children: [
|
|
672
|
-
(s == null ? void 0 : s.path) === h.path && /* @__PURE__ */ t(
|
|
673
|
-
(s == null ? void 0 : s.path) !== h.path && /* @__PURE__ */ t(
|
|
674
|
-
/* @__PURE__ */ a(
|
|
820
|
+
(s == null ? void 0 : s.path) === h.path && /* @__PURE__ */ t(z.Indicator, { asChild: !0, children: /* @__PURE__ */ t(ne, {}) }),
|
|
821
|
+
(s == null ? void 0 : s.path) !== h.path && /* @__PURE__ */ t(z.Indicator, { asChild: !0, visibility: "hidden", children: /* @__PURE__ */ t(ne, {}) }),
|
|
822
|
+
/* @__PURE__ */ a(v, { gap: 0, children: [
|
|
675
823
|
/* @__PURE__ */ t(m, { fontSize: "md", children: h.title || h.path }),
|
|
676
824
|
(s == null ? void 0 : s.path) === h.path && /* @__PURE__ */ t(
|
|
677
825
|
m,
|
|
@@ -688,83 +836,96 @@ const re = g.ActionTrigger, et = b(
|
|
|
688
836
|
)
|
|
689
837
|
}
|
|
690
838
|
),
|
|
691
|
-
h.contents.length > 0 && /* @__PURE__ */ t(
|
|
692
|
-
(
|
|
839
|
+
h.contents.length > 0 && /* @__PURE__ */ t(z.Root, { as: "div", gap: 2, children: h.contents.map(
|
|
840
|
+
(x, C) => g(x, C, P + 1)
|
|
693
841
|
) })
|
|
694
842
|
] }, S);
|
|
695
|
-
return /* @__PURE__ */ t(
|
|
843
|
+
return /* @__PURE__ */ t(z.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: o == null ? void 0 : o.toc.map((h, S) => g(h, S, 0)) });
|
|
696
844
|
}
|
|
697
|
-
),
|
|
845
|
+
), ut = p(
|
|
698
846
|
({
|
|
699
847
|
open: e,
|
|
700
848
|
setOpen: n,
|
|
701
849
|
onNavigate: r
|
|
702
850
|
}) => /* @__PURE__ */ t(
|
|
703
|
-
|
|
851
|
+
V,
|
|
704
852
|
{
|
|
705
853
|
lazyMount: !0,
|
|
706
854
|
placement: "center",
|
|
707
855
|
open: e,
|
|
708
|
-
onOpenChange: (
|
|
856
|
+
onOpenChange: (l) => n(l.open),
|
|
709
857
|
size: { mdDown: "full", md: "lg" },
|
|
710
858
|
scrollBehavior: "inside",
|
|
711
|
-
children: /* @__PURE__ */ a(
|
|
712
|
-
/* @__PURE__ */ t(
|
|
713
|
-
/* @__PURE__ */ t(
|
|
714
|
-
/* @__PURE__ */ t(
|
|
715
|
-
/* @__PURE__ */ t(
|
|
859
|
+
children: /* @__PURE__ */ a(W, { children: [
|
|
860
|
+
/* @__PURE__ */ t(U, { children: /* @__PURE__ */ t(Q, { children: "Table of Contents" }) }),
|
|
861
|
+
/* @__PURE__ */ t(Y, { overflowY: "auto", flex: 1, children: /* @__PURE__ */ t(ht, { onNavigate: r }) }),
|
|
862
|
+
/* @__PURE__ */ t(q, { children: /* @__PURE__ */ t(G, { asChild: !0, children: /* @__PURE__ */ t(_, { variant: "outline", children: "Cancel" }) }) }),
|
|
863
|
+
/* @__PURE__ */ t(j, {})
|
|
716
864
|
] })
|
|
717
865
|
}
|
|
718
866
|
)
|
|
719
|
-
),
|
|
867
|
+
), wt = ({
|
|
720
868
|
enableFloatingTime: e = !0,
|
|
721
869
|
enableFloatingProgress: n = !0,
|
|
722
|
-
|
|
870
|
+
onBackClick: r,
|
|
871
|
+
onMoreClick: l
|
|
723
872
|
}) => {
|
|
724
|
-
const [i,
|
|
725
|
-
return /* @__PURE__ */ a(
|
|
873
|
+
const [o, i] = T(!1), [c, d] = T(!1), [u, s] = T(!1), [g, h] = K();
|
|
874
|
+
return /* @__PURE__ */ a(F, { children: [
|
|
726
875
|
n && /* @__PURE__ */ t(
|
|
727
|
-
|
|
876
|
+
$,
|
|
728
877
|
{
|
|
729
|
-
present: !
|
|
878
|
+
present: !g,
|
|
730
879
|
animationName: { _open: "fade-in", _closed: "fade-out" },
|
|
731
880
|
animationDuration: "moderate",
|
|
732
|
-
children: /* @__PURE__ */ t(
|
|
881
|
+
children: /* @__PURE__ */ t(Ve, {})
|
|
733
882
|
}
|
|
734
883
|
),
|
|
735
884
|
/* @__PURE__ */ t(
|
|
736
|
-
|
|
885
|
+
st,
|
|
737
886
|
{
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
887
|
+
onBackClick: r,
|
|
888
|
+
onMoreClick: l,
|
|
889
|
+
onTableOfContentsClick: () => i(!0),
|
|
890
|
+
onHelpClick: () => d(!0),
|
|
891
|
+
onSearchClick: () => s(!0)
|
|
892
|
+
}
|
|
893
|
+
),
|
|
894
|
+
/* @__PURE__ */ t(je, { open: c, setOpen: d }),
|
|
895
|
+
/* @__PURE__ */ t(
|
|
896
|
+
ut,
|
|
897
|
+
{
|
|
898
|
+
open: o,
|
|
899
|
+
setOpen: i,
|
|
900
|
+
onNavigate: () => {
|
|
901
|
+
i(!1), h(!1);
|
|
902
|
+
}
|
|
741
903
|
}
|
|
742
904
|
),
|
|
743
|
-
/* @__PURE__ */ t(et, { open: l, setOpen: c }),
|
|
744
905
|
/* @__PURE__ */ t(
|
|
745
|
-
|
|
906
|
+
dt,
|
|
746
907
|
{
|
|
747
|
-
open:
|
|
748
|
-
setOpen:
|
|
908
|
+
open: u,
|
|
909
|
+
setOpen: s,
|
|
749
910
|
onNavigate: () => {
|
|
750
|
-
|
|
911
|
+
s(!1), h(!1);
|
|
751
912
|
}
|
|
752
913
|
}
|
|
753
914
|
),
|
|
754
915
|
/* @__PURE__ */ t(
|
|
755
|
-
|
|
916
|
+
$,
|
|
756
917
|
{
|
|
757
|
-
present: e ||
|
|
918
|
+
present: e || g,
|
|
758
919
|
animationName: { _open: "fade-in", _closed: "fade-out" },
|
|
759
920
|
animationDuration: "slow",
|
|
760
921
|
overflow: "hidden",
|
|
761
|
-
children: /* @__PURE__ */ t(
|
|
922
|
+
children: /* @__PURE__ */ t(Ye, {})
|
|
762
923
|
}
|
|
763
924
|
)
|
|
764
925
|
] });
|
|
765
926
|
};
|
|
766
927
|
export {
|
|
767
|
-
|
|
768
|
-
|
|
928
|
+
wt as ReactReader,
|
|
929
|
+
kt as ReactReaderProvider
|
|
769
930
|
};
|
|
770
931
|
//# sourceMappingURL=index.js.map
|