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