@prose-reader/react-reader 1.231.0 → 1.233.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/annotations/bookmarks/BookmarkPageMarkers.d.ts +1 -0
- package/dist/annotations/useReaderWithAnnotations.d.ts +14 -15
- package/dist/common/useSpineItemReady.d.ts +4 -1
- package/dist/context/useReader.d.ts +14 -15
- package/dist/index.js +96 -102
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +2 -2
- package/dist/annotations/bookmarks/Bookmarks.d.ts +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BookmarkPageMarkers: import('react').MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
@@ -5,27 +5,26 @@ export declare const useReaderWithAnnotations: () => (Omit<Omit<Omit<Omit<{
|
|
|
5
5
|
cfi: {
|
|
6
6
|
generateCfiFromRange: (range: Range, item: import('@prose-reader/shared').Manifest[`spineItems`][number]) => string;
|
|
7
7
|
parseCfi: (cfi: string) => {
|
|
8
|
+
isCfiRange: boolean;
|
|
8
9
|
cleanedCfi: string;
|
|
9
|
-
itemIndex
|
|
10
|
-
offset
|
|
10
|
+
itemIndex: number;
|
|
11
|
+
offset: number;
|
|
11
12
|
};
|
|
12
13
|
generateCfiForSpineItemPage: (params: {
|
|
13
14
|
pageIndex: number;
|
|
14
15
|
spineItem: import('@prose-reader/core').SpineItem;
|
|
15
16
|
}) => string;
|
|
16
|
-
resolveCfi: (params: Omit<Parameters<resolveCfi>[0], "spineItemsManager">) => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
offset: number
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
offset?: undefined;
|
|
28
|
-
} | undefined;
|
|
17
|
+
resolveCfi: (params: Omit<Parameters<resolveCfi>[0], "spineItemsManager">) => Omit<{
|
|
18
|
+
isCfiRange: boolean;
|
|
19
|
+
cleanedCfi: string;
|
|
20
|
+
itemIndex: number;
|
|
21
|
+
offset: number;
|
|
22
|
+
}, "offset"> & {
|
|
23
|
+
offset?: number | undefined;
|
|
24
|
+
node?: Node | null;
|
|
25
|
+
range?: Range | null;
|
|
26
|
+
spineItem?: import('@prose-reader/core').SpineItem;
|
|
27
|
+
};
|
|
29
28
|
};
|
|
30
29
|
navigation: {
|
|
31
30
|
destroy: () => void;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export declare const useSpineItemReady: ({ absolutePageIndex, itemIndex, }: {
|
|
2
2
|
absolutePageIndex?: number;
|
|
3
3
|
itemIndex?: number;
|
|
4
|
-
}) =>
|
|
4
|
+
}) => {
|
|
5
|
+
spineItem: import('@prose-reader/core').SpineItem | undefined;
|
|
6
|
+
isReady: boolean | undefined;
|
|
7
|
+
};
|
|
@@ -9,27 +9,26 @@ export declare const useReader: () => (Omit<Omit<Omit<Omit<{
|
|
|
9
9
|
cfi: {
|
|
10
10
|
generateCfiFromRange: (range: Range, item: import('@prose-reader/shared').Manifest[`spineItems`][number]) => string;
|
|
11
11
|
parseCfi: (cfi: string) => {
|
|
12
|
+
isCfiRange: boolean;
|
|
12
13
|
cleanedCfi: string;
|
|
13
|
-
itemIndex
|
|
14
|
-
offset
|
|
14
|
+
itemIndex: number;
|
|
15
|
+
offset: number;
|
|
15
16
|
};
|
|
16
17
|
generateCfiForSpineItemPage: (params: {
|
|
17
18
|
pageIndex: number;
|
|
18
19
|
spineItem: import('@prose-reader/core').SpineItem;
|
|
19
20
|
}) => string;
|
|
20
|
-
resolveCfi: (params: Omit<Parameters<resolveCfi>[0], "spineItemsManager">) => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
offset: number
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
offset?: undefined;
|
|
32
|
-
} | undefined;
|
|
21
|
+
resolveCfi: (params: Omit<Parameters<resolveCfi>[0], "spineItemsManager">) => Omit<{
|
|
22
|
+
isCfiRange: boolean;
|
|
23
|
+
cleanedCfi: string;
|
|
24
|
+
itemIndex: number;
|
|
25
|
+
offset: number;
|
|
26
|
+
}, "offset"> & {
|
|
27
|
+
offset?: number | undefined;
|
|
28
|
+
node?: Node | null;
|
|
29
|
+
range?: Range | null;
|
|
30
|
+
spineItem?: import('@prose-reader/core').SpineItem;
|
|
31
|
+
};
|
|
33
32
|
};
|
|
34
33
|
navigation: {
|
|
35
34
|
destroy: () => void;
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as t, jsxs as c, Fragment as oe } from "react/jsx-runtime";
|
|
2
2
|
import * as z from "react";
|
|
3
|
-
import
|
|
4
|
-
import { signal as de, useSignalState as
|
|
5
|
-
import { Subject as he, tap as ue, map as
|
|
6
|
-
import { IconButton as I, Portal as ge, Dialog as S, List as w, Link as pe, Stack as R, Text as f, Tabs as O, Button as G, Presence as te, Box as P, createToaster as Ue, Toaster as qe, Toast as
|
|
3
|
+
import Be, { createContext as Me, memo as g, useMemo as Ce, useEffect as j, useContext as Le, useState as T, useLayoutEffect as $e, useCallback as N } from "react";
|
|
4
|
+
import { signal as de, useSignalState as Ie, useConstant as _e, useLiveRef as Ne, useSubscribe as E, useObserve as v, isDefined as ye, useSignalValue as Fe } from "reactjrx";
|
|
5
|
+
import { Subject as he, tap as ue, map as B, filter as ee, switchMap as F, EMPTY as le, of as Se, withLatestFrom as He, NEVER as re, startWith as ke, distinctUntilChanged as Te, throttleTime as We, first as we, combineLatest as je, finalize as Pe, mergeMap as Ge, skip as Re, merge as Ve, timer as Ye } from "rxjs";
|
|
6
|
+
import { IconButton as I, Portal as ge, Dialog as S, List as w, Link as pe, Stack as R, Text as f, Tabs as O, Button as G, Presence as te, Box as P, createToaster as Ue, Toaster as qe, Toast as M, Spinner as Qe, Heading as ae, HStack as D, Kbd as xe, Popover as L, Progress as H, chakra as Ke, Collapsible as se, Input as Ze } from "@chakra-ui/react";
|
|
7
7
|
import { LuX as Xe, LuNotebookPen as ne, LuBookmark as Je, LuArrowBigRight as et, LuArrowBigLeft as tt, LuChevronDown as nt, LuCircleHelp as ot, LuTableOfContents as rt, LuSearch as it, LuGalleryHorizontal as st, LuCircleCheck as ve } from "react-icons/lu";
|
|
8
8
|
import { createPortal as lt } from "react-dom";
|
|
9
9
|
import { isPositionInArea as at } from "@prose-reader/enhancer-gestures";
|
|
@@ -16,7 +16,7 @@ import vt from "rc-slider";
|
|
|
16
16
|
import "rc-slider/assets/index.css";
|
|
17
17
|
import { IoIosArrowBack as Ct, IoMdMore as It } from "react-icons/io";
|
|
18
18
|
import { MdFullscreenExit as yt, MdFullscreen as St } from "react-icons/md";
|
|
19
|
-
const
|
|
19
|
+
const Ae = Me({
|
|
20
20
|
reader: void 0,
|
|
21
21
|
quickMenuSignal: de({ default: !1 }),
|
|
22
22
|
notificationsSubject: new he()
|
|
@@ -27,13 +27,13 @@ const Pe = Ee({
|
|
|
27
27
|
quickMenuOpen: o,
|
|
28
28
|
onQuickMenuOpenChange: r
|
|
29
29
|
}) => {
|
|
30
|
-
const [, i] =
|
|
30
|
+
const [, i] = Ie(
|
|
31
31
|
() => de({
|
|
32
32
|
default: o
|
|
33
33
|
})
|
|
34
|
-
), s =
|
|
34
|
+
), s = _e(
|
|
35
35
|
() => new he()
|
|
36
|
-
), d =
|
|
36
|
+
), d = Ne(r), l = Ce(
|
|
37
37
|
() => ({
|
|
38
38
|
quickMenuSignal: i,
|
|
39
39
|
reader: n,
|
|
@@ -46,9 +46,9 @@ const Pe = Ee({
|
|
|
46
46
|
}, [o, i]), E(
|
|
47
47
|
() => i.pipe(ue(d.current)),
|
|
48
48
|
[i, d]
|
|
49
|
-
), /* @__PURE__ */ t(
|
|
49
|
+
), /* @__PURE__ */ t(Ae.Provider, { value: l, children: e });
|
|
50
50
|
}
|
|
51
|
-
),
|
|
51
|
+
), kt = z.forwardRef(function(n, o) {
|
|
52
52
|
return /* @__PURE__ */ t(I, { variant: "ghost", "aria-label": "Close", ref: o, ...n, children: n.children ?? /* @__PURE__ */ t(Xe, {}) });
|
|
53
53
|
}), V = z.forwardRef(function(n, o) {
|
|
54
54
|
const {
|
|
@@ -71,7 +71,7 @@ const Pe = Ee({
|
|
|
71
71
|
insetEnd: "2",
|
|
72
72
|
...n,
|
|
73
73
|
asChild: !0,
|
|
74
|
-
children: /* @__PURE__ */ t(
|
|
74
|
+
children: /* @__PURE__ */ t(kt, { size: "sm", ref: o, children: n.children })
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
77
|
}), U = S.Root, q = S.Footer, Q = S.Header, K = S.Body;
|
|
@@ -79,25 +79,25 @@ S.Backdrop;
|
|
|
79
79
|
const Z = S.Title;
|
|
80
80
|
S.Description;
|
|
81
81
|
S.Trigger;
|
|
82
|
-
const X = S.ActionTrigger, J = () =>
|
|
82
|
+
const X = S.ActionTrigger, J = () => Le(Ae), p = () => {
|
|
83
83
|
const { reader: e } = J();
|
|
84
84
|
return e;
|
|
85
|
-
},
|
|
85
|
+
}, Oe = (e) => !!e && "__PROSE_READER_ENHANCER_SEARCH" in e, W = (e) => !!e && "__PROSE_READER_ENHANCER_ANNOTATIONS" in e, De = (e) => !!e && "__PROSE_READER_ENHANCER_GALLERY" in e, Tt = (e) => {
|
|
86
86
|
const n = p(), o = W(n) ? n : void 0;
|
|
87
87
|
return { data: v(
|
|
88
88
|
() => o == null ? void 0 : o.annotations.annotations$.pipe(
|
|
89
|
-
|
|
90
|
-
ee(
|
|
89
|
+
B((i) => i.find((s) => s.id === e)),
|
|
90
|
+
ee(ye),
|
|
91
91
|
F((i) => o.locateResource(i))
|
|
92
92
|
),
|
|
93
93
|
[o]
|
|
94
94
|
) };
|
|
95
|
-
},
|
|
95
|
+
}, ze = ({
|
|
96
96
|
id: e,
|
|
97
97
|
onNavigate: n
|
|
98
98
|
}) => {
|
|
99
99
|
var i, s;
|
|
100
|
-
const o = p(), { data: r } =
|
|
100
|
+
const o = p(), { data: r } = Tt(e);
|
|
101
101
|
return /* @__PURE__ */ t(w.Item, { children: /* @__PURE__ */ c(
|
|
102
102
|
pe,
|
|
103
103
|
{
|
|
@@ -135,7 +135,7 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
|
|
|
135
135
|
}, wt = ({ onNavigate: e }) => {
|
|
136
136
|
const { data: n } = ie();
|
|
137
137
|
return /* @__PURE__ */ t(w.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: n == null ? void 0 : n.map((o) => /* @__PURE__ */ t(
|
|
138
|
-
|
|
138
|
+
ze,
|
|
139
139
|
{
|
|
140
140
|
id: o.resource.id,
|
|
141
141
|
onNavigate: e
|
|
@@ -145,12 +145,14 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
|
|
|
145
145
|
}, Pt = () => {
|
|
146
146
|
const { data: e } = ie();
|
|
147
147
|
return {
|
|
148
|
-
data: e == null ? void 0 : e.filter(
|
|
148
|
+
data: e == null ? void 0 : e.filter(
|
|
149
|
+
(n) => !n.meta.isCfiRange && !n.resource.notes
|
|
150
|
+
)
|
|
149
151
|
};
|
|
150
152
|
}, Rt = ({ onNavigate: e }) => {
|
|
151
153
|
const { data: n } = Pt();
|
|
152
154
|
return /* @__PURE__ */ t(w.Root, { overflowY: "auto", gap: 3, pt: 4, variant: "plain", children: n == null ? void 0 : n.map((o) => /* @__PURE__ */ t(
|
|
153
|
-
|
|
155
|
+
ze,
|
|
154
156
|
{
|
|
155
157
|
id: o.resource.id,
|
|
156
158
|
onNavigate: e
|
|
@@ -162,7 +164,7 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
|
|
|
162
164
|
onNavigate: e,
|
|
163
165
|
defaultTab: n
|
|
164
166
|
}) => {
|
|
165
|
-
const [o, r] =
|
|
167
|
+
const [o, r] = T(n ?? "bookmarks");
|
|
166
168
|
return /* @__PURE__ */ c(
|
|
167
169
|
O.Root,
|
|
168
170
|
{
|
|
@@ -221,31 +223,21 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
|
|
|
221
223
|
absolutePageIndex: e,
|
|
222
224
|
itemIndex: n
|
|
223
225
|
}) => {
|
|
224
|
-
const o = p()
|
|
225
|
-
() => o == null ? void 0 : o.spine.spineItemsManager.items$,
|
|
226
|
-
[o]
|
|
227
|
-
);
|
|
226
|
+
const o = p();
|
|
228
227
|
return {
|
|
229
|
-
spineItem:
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if (e !== void 0) {
|
|
233
|
-
const { itemIndex: s } = (o == null ? void 0 : o.spine.locator.getSpineInfoFromAbsolutePageIndex({
|
|
234
|
-
absolutePageIndex: e
|
|
235
|
-
})) ?? {};
|
|
236
|
-
return o == null ? void 0 : o.spine.spineItemsManager.get(s);
|
|
237
|
-
}
|
|
238
|
-
}, [n, e, o, r])
|
|
228
|
+
spineItem: v(() => o ? n !== void 0 ? Se(o.spine.spineItemsManager.get(n)) : e !== void 0 ? o.spine.pages.observeFromAbsolutePageIndex(e).pipe(
|
|
229
|
+
B((i) => o.spine.spineItemsManager.get(i == null ? void 0 : i.itemIndex))
|
|
230
|
+
) : le : le, [n, e, o])
|
|
239
231
|
};
|
|
240
232
|
}, Et = ({
|
|
241
233
|
absolutePageIndex: e,
|
|
242
234
|
itemIndex: n
|
|
243
235
|
}) => {
|
|
244
|
-
const { spineItem: o } = zt({ absolutePageIndex: e, itemIndex: n })
|
|
245
|
-
|
|
246
|
-
() => (o == null ? void 0 : o.isReady$) ?? Ne(!1),
|
|
236
|
+
const { spineItem: o } = zt({ absolutePageIndex: e, itemIndex: n }), r = v(
|
|
237
|
+
() => (o == null ? void 0 : o.isReady$) ?? Se(!1),
|
|
247
238
|
[o]
|
|
248
239
|
);
|
|
240
|
+
return { spineItem: o, isReady: r };
|
|
249
241
|
}, Bt = "data-bookmark-area", Mt = g(
|
|
250
242
|
({
|
|
251
243
|
absolutePageIndex: e,
|
|
@@ -253,7 +245,9 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
|
|
|
253
245
|
top: o,
|
|
254
246
|
width: r
|
|
255
247
|
}) => {
|
|
256
|
-
const
|
|
248
|
+
const { isReady: i } = Et({
|
|
249
|
+
absolutePageIndex: e
|
|
250
|
+
}), { data: s } = ie(), d = s == null ? void 0 : s.find(
|
|
257
251
|
(u) => {
|
|
258
252
|
var a;
|
|
259
253
|
return ((a = u == null ? void 0 : u.meta) == null ? void 0 : a.absolutePageIndex) === e && u.meta.range === void 0;
|
|
@@ -316,8 +310,8 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
|
|
|
316
310
|
j(() => e ? e.gestures.hooks.register(
|
|
317
311
|
"beforeTapGesture",
|
|
318
312
|
({ event$: r }) => r.pipe(
|
|
319
|
-
|
|
320
|
-
|
|
313
|
+
He(e == null ? void 0 : e.annotations.candidates$),
|
|
314
|
+
B(([i, s]) => {
|
|
321
315
|
if (!i.page) return !0;
|
|
322
316
|
const {
|
|
323
317
|
spineItem: d,
|
|
@@ -342,8 +336,8 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
|
|
|
342
336
|
if (!h) return !0;
|
|
343
337
|
const b = n == null ? void 0 : n.find(
|
|
344
338
|
(C) => {
|
|
345
|
-
var
|
|
346
|
-
return ((
|
|
339
|
+
var k;
|
|
340
|
+
return ((k = C == null ? void 0 : C.meta) == null ? void 0 : k.absolutePageIndex) === h.absolutePageIndex && C.meta.range === void 0;
|
|
347
341
|
}
|
|
348
342
|
);
|
|
349
343
|
if (b)
|
|
@@ -357,19 +351,19 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
|
|
|
357
351
|
})
|
|
358
352
|
)
|
|
359
353
|
) : void 0, [e, n]);
|
|
360
|
-
},
|
|
354
|
+
}, ce = Ue({
|
|
361
355
|
placement: "bottom-end",
|
|
362
356
|
pauseOnPageIdle: !0
|
|
363
|
-
}), Nt = () => /* @__PURE__ */ t(ge, { children: /* @__PURE__ */ t(qe, { toaster:
|
|
357
|
+
}), Nt = () => /* @__PURE__ */ t(ge, { children: /* @__PURE__ */ t(qe, { toaster: ce, insetInline: { mdDown: "4" }, children: (e) => {
|
|
364
358
|
var n;
|
|
365
|
-
return /* @__PURE__ */ c(
|
|
366
|
-
e.type === "loading" ? /* @__PURE__ */ t(Qe, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ t(
|
|
359
|
+
return /* @__PURE__ */ c(M.Root, { width: { md: "sm" }, children: [
|
|
360
|
+
e.type === "loading" ? /* @__PURE__ */ t(Qe, { size: "sm", color: "blue.solid" }) : /* @__PURE__ */ t(M.Indicator, {}),
|
|
367
361
|
/* @__PURE__ */ c(R, { gap: "1", flex: "1", maxWidth: "100%", children: [
|
|
368
|
-
e.title && /* @__PURE__ */ t(
|
|
369
|
-
e.description && /* @__PURE__ */ t(
|
|
362
|
+
e.title && /* @__PURE__ */ t(M.Title, { children: e.title }),
|
|
363
|
+
e.description && /* @__PURE__ */ t(M.Description, { children: e.description })
|
|
370
364
|
] }),
|
|
371
|
-
e.action && /* @__PURE__ */ t(
|
|
372
|
-
((n = e.meta) == null ? void 0 : n.closable) && /* @__PURE__ */ t(
|
|
365
|
+
e.action && /* @__PURE__ */ t(M.ActionTrigger, { children: e.action.label }),
|
|
366
|
+
((n = e.meta) == null ? void 0 : n.closable) && /* @__PURE__ */ t(M.CloseTrigger, {})
|
|
373
367
|
] });
|
|
374
368
|
} }) }), Ft = {
|
|
375
369
|
x: 0,
|
|
@@ -382,7 +376,7 @@ const X = S.ActionTrigger, J = () => Be(Pe), p = () => {
|
|
|
382
376
|
right: 0
|
|
383
377
|
};
|
|
384
378
|
function Ht() {
|
|
385
|
-
const [e, n] =
|
|
379
|
+
const [e, n] = T(null), [o, r] = T(Ft), i = Ce(
|
|
386
380
|
() => new ResizeObserver((s) => {
|
|
387
381
|
if (s[0]) {
|
|
388
382
|
const { x: d, y: l, width: u, height: a, top: m, left: h, bottom: b, right: y } = s[0].contentRect;
|
|
@@ -391,7 +385,7 @@ function Ht() {
|
|
|
391
385
|
}),
|
|
392
386
|
[]
|
|
393
387
|
);
|
|
394
|
-
return
|
|
388
|
+
return $e(() => {
|
|
395
389
|
if (e)
|
|
396
390
|
return i.observe(e), () => {
|
|
397
391
|
i.disconnect();
|
|
@@ -399,23 +393,23 @@ function Ht() {
|
|
|
399
393
|
}, [e, i]), [n, o, e];
|
|
400
394
|
}
|
|
401
395
|
const Wt = (e, n, o) => {
|
|
402
|
-
const r = p(), i =
|
|
396
|
+
const r = p(), i = De(r) ? r : void 0;
|
|
403
397
|
E(() => {
|
|
404
398
|
if (!i || !e) return re;
|
|
405
399
|
const s = n.layout.layout$.pipe(
|
|
406
|
-
|
|
407
|
-
|
|
400
|
+
ke(n.layout.layoutInfo),
|
|
401
|
+
Te(ct)
|
|
408
402
|
), d = dt(
|
|
409
403
|
e
|
|
410
|
-
).pipe(
|
|
404
|
+
).pipe(B((l) => l.some((u) => u.isIntersecting)));
|
|
411
405
|
return s.pipe(
|
|
412
|
-
|
|
406
|
+
We(100, void 0, { trailing: !0 }),
|
|
413
407
|
F(() => d.pipe(
|
|
414
408
|
ue((l) => {
|
|
415
409
|
l || (e.innerHTML = "");
|
|
416
410
|
}),
|
|
417
411
|
ee((l) => l),
|
|
418
|
-
|
|
412
|
+
we()
|
|
419
413
|
).pipe(
|
|
420
414
|
F(() => (e.innerHTML = "", i == null ? void 0 : i.gallery.snapshot(
|
|
421
415
|
n,
|
|
@@ -530,7 +524,7 @@ const Wt = (e, n, o) => {
|
|
|
530
524
|
}
|
|
531
525
|
);
|
|
532
526
|
}
|
|
533
|
-
), Vt = "@prose-reader/react-reader", Yt = "1.
|
|
527
|
+
), Vt = "@prose-reader/react-reader", Yt = "1.232.0", Ut = g(
|
|
534
528
|
({
|
|
535
529
|
open: e,
|
|
536
530
|
setOpen: n
|
|
@@ -546,7 +540,7 @@ const Wt = (e, n, o) => {
|
|
|
546
540
|
children: /* @__PURE__ */ c(V, { children: [
|
|
547
541
|
/* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(Z, { children: "Help" }) }),
|
|
548
542
|
/* @__PURE__ */ c(K, { overflowY: "auto", flex: 1, children: [
|
|
549
|
-
/* @__PURE__ */ t(
|
|
543
|
+
/* @__PURE__ */ t(ae, { mb: 2, as: "h3", size: "lg", children: "Shortcuts" }),
|
|
550
544
|
/* @__PURE__ */ c(D, { mb: 1, children: [
|
|
551
545
|
/* @__PURE__ */ t(xe, { children: /* @__PURE__ */ t(et, {}) }),
|
|
552
546
|
" ",
|
|
@@ -557,7 +551,7 @@ const Wt = (e, n, o) => {
|
|
|
557
551
|
" ",
|
|
558
552
|
/* @__PURE__ */ t(f, { children: "Navigate to left page" })
|
|
559
553
|
] }),
|
|
560
|
-
/* @__PURE__ */ t(
|
|
554
|
+
/* @__PURE__ */ t(ae, { mb: 2, mt: 4, as: "h3", size: "lg", children: "About" }),
|
|
561
555
|
/* @__PURE__ */ c(f, { children: [
|
|
562
556
|
Vt,
|
|
563
557
|
" version: ",
|
|
@@ -572,8 +566,8 @@ const Wt = (e, n, o) => {
|
|
|
572
566
|
), $ = () => {
|
|
573
567
|
const e = p();
|
|
574
568
|
return v(
|
|
575
|
-
() => e ?
|
|
576
|
-
|
|
569
|
+
() => e ? je([e.pagination.state$, e.context.state$]).pipe(
|
|
570
|
+
B(([n, o]) => {
|
|
577
571
|
var i;
|
|
578
572
|
const r = (i = o.manifest) == null ? void 0 : i.spineItems.every(
|
|
579
573
|
(s) => {
|
|
@@ -598,7 +592,7 @@ const Wt = (e, n, o) => {
|
|
|
598
592
|
" %"
|
|
599
593
|
] }) });
|
|
600
594
|
}, Qt = () => {
|
|
601
|
-
const [e, n] =
|
|
595
|
+
const [e, n] = T(/* @__PURE__ */ new Date());
|
|
602
596
|
return j(() => {
|
|
603
597
|
const o = setInterval(() => {
|
|
604
598
|
n(/* @__PURE__ */ new Date());
|
|
@@ -613,7 +607,7 @@ const Wt = (e, n, o) => {
|
|
|
613
607
|
}) });
|
|
614
608
|
}, me = () => {
|
|
615
609
|
const { quickMenuSignal: e } = J();
|
|
616
|
-
return [
|
|
610
|
+
return [Fe(e), e.setValue, e];
|
|
617
611
|
}, Zt = () => {
|
|
618
612
|
const [e] = me();
|
|
619
613
|
return /* @__PURE__ */ t(
|
|
@@ -646,7 +640,7 @@ const Wt = (e, n, o) => {
|
|
|
646
640
|
E(
|
|
647
641
|
() => e == null ? void 0 : e.zoom.isZooming$.pipe(
|
|
648
642
|
F((o) => {
|
|
649
|
-
if (!o) return
|
|
643
|
+
if (!o) return le;
|
|
650
644
|
const r = new he();
|
|
651
645
|
return n.next({
|
|
652
646
|
key: "zoom",
|
|
@@ -654,7 +648,7 @@ const Wt = (e, n, o) => {
|
|
|
654
648
|
duration: 999999,
|
|
655
649
|
abort: r
|
|
656
650
|
}), re.pipe(
|
|
657
|
-
|
|
651
|
+
Pe(() => {
|
|
658
652
|
r.next(), r.complete();
|
|
659
653
|
})
|
|
660
654
|
);
|
|
@@ -666,9 +660,9 @@ const Wt = (e, n, o) => {
|
|
|
666
660
|
const e = p(), { notificationsSubject: n } = J();
|
|
667
661
|
E(
|
|
668
662
|
() => e == null ? void 0 : e.settings.values$.pipe(
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
663
|
+
B(({ fontScale: o }) => o),
|
|
664
|
+
Te(),
|
|
665
|
+
Re(1),
|
|
672
666
|
ue((o) => {
|
|
673
667
|
n.next({
|
|
674
668
|
key: "fontScaleChange",
|
|
@@ -683,14 +677,14 @@ const Wt = (e, n, o) => {
|
|
|
683
677
|
const { notificationsSubject: e } = J();
|
|
684
678
|
en(), Jt(), E(
|
|
685
679
|
() => e.pipe(
|
|
686
|
-
ee(
|
|
680
|
+
ee(ye),
|
|
687
681
|
Ge((n) => {
|
|
688
|
-
const o = n.duration ?? 3e3, r =
|
|
682
|
+
const o = n.duration ?? 3e3, r = ce.create({
|
|
689
683
|
title: n.title,
|
|
690
684
|
description: n.description,
|
|
691
685
|
duration: o
|
|
692
686
|
}), i = e.pipe(
|
|
693
|
-
|
|
687
|
+
Re(1),
|
|
694
688
|
ee((s) => !!n.key && (s == null ? void 0 : s.key) === n.key)
|
|
695
689
|
);
|
|
696
690
|
return Ve(
|
|
@@ -698,9 +692,9 @@ const Wt = (e, n, o) => {
|
|
|
698
692
|
n.abort ?? re,
|
|
699
693
|
i
|
|
700
694
|
).pipe(
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
695
|
+
we(),
|
|
696
|
+
Pe(() => {
|
|
697
|
+
ce.dismiss(r);
|
|
704
698
|
})
|
|
705
699
|
);
|
|
706
700
|
})
|
|
@@ -718,14 +712,14 @@ const Wt = (e, n, o) => {
|
|
|
718
712
|
...u
|
|
719
713
|
} = n;
|
|
720
714
|
return /* @__PURE__ */ c(
|
|
721
|
-
|
|
715
|
+
L.Root,
|
|
722
716
|
{
|
|
723
717
|
...u,
|
|
724
718
|
positioning: { ...u.positioning, gutter: 4 },
|
|
725
719
|
children: [
|
|
726
|
-
/* @__PURE__ */ t(
|
|
727
|
-
/* @__PURE__ */ t(ge, { disabled: !s, container: l, children: /* @__PURE__ */ t(
|
|
728
|
-
|
|
720
|
+
/* @__PURE__ */ t(L.Trigger, { asChild: !0, children: i }),
|
|
721
|
+
/* @__PURE__ */ t(ge, { disabled: !s, container: l, children: /* @__PURE__ */ t(L.Positioner, { children: /* @__PURE__ */ c(
|
|
722
|
+
L.Content,
|
|
729
723
|
{
|
|
730
724
|
width: "auto",
|
|
731
725
|
px: "2",
|
|
@@ -734,7 +728,7 @@ const Wt = (e, n, o) => {
|
|
|
734
728
|
rounded: "sm",
|
|
735
729
|
ref: o,
|
|
736
730
|
children: [
|
|
737
|
-
r && /* @__PURE__ */ t(
|
|
731
|
+
r && /* @__PURE__ */ t(L.Arrow, { children: /* @__PURE__ */ t(L.ArrowTip, {}) }),
|
|
738
732
|
d
|
|
739
733
|
]
|
|
740
734
|
}
|
|
@@ -807,7 +801,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
807
801
|
] })
|
|
808
802
|
] })
|
|
809
803
|
] });
|
|
810
|
-
},
|
|
804
|
+
}, Ee = g(
|
|
811
805
|
({
|
|
812
806
|
children: e,
|
|
813
807
|
position: n,
|
|
@@ -892,7 +886,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
892
886
|
)
|
|
893
887
|
}
|
|
894
888
|
)), hn = () => {
|
|
895
|
-
const e = $(), n = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = fe(), i = n ? Math.floor((o || 0) / 2) : o, [s, d] =
|
|
889
|
+
const e = $(), n = e == null ? void 0 : e.isUsingSpread, { beginPageIndex: o, totalApproximatePages: r = 0 } = fe(), i = n ? Math.floor((o || 0) / 2) : o, [s, d] = Ie(
|
|
896
890
|
() => de({
|
|
897
891
|
default: i || 0
|
|
898
892
|
})
|
|
@@ -948,9 +942,9 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
948
942
|
open: e,
|
|
949
943
|
onItemClick: n
|
|
950
944
|
}) => {
|
|
951
|
-
const o = p(), r = v(() => o == null ? void 0 : o.navigation.state$, [o]), i = v(() => o == null ? void 0 : o.settings.values$, [o]), s = (i == null ? void 0 : i.computedPageTurnDirection) === "vertical", [d, l] =
|
|
945
|
+
const o = p(), r = v(() => o == null ? void 0 : o.navigation.state$, [o]), i = v(() => o == null ? void 0 : o.settings.values$, [o]), s = (i == null ? void 0 : i.computedPageTurnDirection) === "vertical", [d, l] = T(!0);
|
|
952
946
|
return /* @__PURE__ */ c(
|
|
953
|
-
|
|
947
|
+
Ee,
|
|
954
948
|
{
|
|
955
949
|
present: e,
|
|
956
950
|
position: "bottom",
|
|
@@ -1067,7 +1061,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1067
1061
|
children: /* @__PURE__ */ t(rt, {})
|
|
1068
1062
|
}
|
|
1069
1063
|
),
|
|
1070
|
-
|
|
1064
|
+
Oe(o) && /* @__PURE__ */ t(
|
|
1071
1065
|
I,
|
|
1072
1066
|
{
|
|
1073
1067
|
"aria-label": "Search",
|
|
@@ -1111,7 +1105,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1111
1105
|
children: /* @__PURE__ */ t(st, {})
|
|
1112
1106
|
}
|
|
1113
1107
|
),
|
|
1114
|
-
|
|
1108
|
+
De(o) && /* @__PURE__ */ t(
|
|
1115
1109
|
I,
|
|
1116
1110
|
{
|
|
1117
1111
|
"aria-label": "Gallery",
|
|
@@ -1130,7 +1124,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1130
1124
|
);
|
|
1131
1125
|
}
|
|
1132
1126
|
), pn = () => {
|
|
1133
|
-
const [e, n] =
|
|
1127
|
+
const [e, n] = T(!1), o = N(() => document.fullscreenElement ? document.exitFullscreen().catch(console.error).then(() => {
|
|
1134
1128
|
n(!1);
|
|
1135
1129
|
}) : document.documentElement.requestFullscreen({ navigationUI: "hide" }).catch(console.error).then(() => {
|
|
1136
1130
|
n(!0);
|
|
@@ -1153,7 +1147,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1153
1147
|
}) => {
|
|
1154
1148
|
const o = p(), r = v(() => o == null ? void 0 : o.context.manifest$, [o]), { isFullscreen: i, onToggleFullscreenClick: s } = pn();
|
|
1155
1149
|
return /* @__PURE__ */ c(
|
|
1156
|
-
|
|
1150
|
+
Ee,
|
|
1157
1151
|
{
|
|
1158
1152
|
present: e,
|
|
1159
1153
|
position: "top",
|
|
@@ -1269,7 +1263,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1269
1263
|
({
|
|
1270
1264
|
onNavigate: e
|
|
1271
1265
|
}) => {
|
|
1272
|
-
const [n, o] =
|
|
1266
|
+
const [n, o] = T(""), r = p(), i = Oe(r) ? r : void 0, s = (h) => {
|
|
1273
1267
|
o(h.target.value);
|
|
1274
1268
|
}, d = N(
|
|
1275
1269
|
(h) => {
|
|
@@ -1278,8 +1272,8 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1278
1272
|
[r, e]
|
|
1279
1273
|
), l = v(
|
|
1280
1274
|
() => i == null ? void 0 : i.search.search(n).pipe(
|
|
1281
|
-
|
|
1282
|
-
|
|
1275
|
+
B((h) => ({ type: "end", data: h })),
|
|
1276
|
+
ke({ type: "start" })
|
|
1283
1277
|
),
|
|
1284
1278
|
[r, n]
|
|
1285
1279
|
), u = (l == null ? void 0 : l.type) === "start", a = (l == null ? void 0 : l.type) === "end" ? l.data : [], m = v(
|
|
@@ -1308,16 +1302,16 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1308
1302
|
u && /* @__PURE__ */ t(f, { children: "Searching ..." }),
|
|
1309
1303
|
!u && a.length === 0 && /* @__PURE__ */ t("p", { children: "There are no results" }),
|
|
1310
1304
|
!u && a.length >= 0 && /* @__PURE__ */ c(R, { children: [
|
|
1311
|
-
/* @__PURE__ */ c(
|
|
1305
|
+
/* @__PURE__ */ c(ae, { as: "h2", size: "md", children: [
|
|
1312
1306
|
a.length,
|
|
1313
1307
|
" result(s)"
|
|
1314
1308
|
] }),
|
|
1315
1309
|
/* @__PURE__ */ t(R, { gap: 0, children: m == null ? void 0 : m.map((h, b) => {
|
|
1316
|
-
var y, C,
|
|
1310
|
+
var y, C, k, A, x, _, be;
|
|
1317
1311
|
return /* @__PURE__ */ t(
|
|
1318
1312
|
bn,
|
|
1319
1313
|
{
|
|
1320
|
-
contextText: ((
|
|
1314
|
+
contextText: ((k = (C = (y = h.meta) == null ? void 0 : y.range) == null ? void 0 : C.startContainer.parentElement) == null ? void 0 : k.textContent) ?? "",
|
|
1321
1315
|
pageIndex: (A = h.meta) == null ? void 0 : A.itemPageIndex,
|
|
1322
1316
|
startOffset: ((_ = (x = h.meta) == null ? void 0 : x.range) == null ? void 0 : _.startOffset) ?? 0,
|
|
1323
1317
|
text: n,
|
|
@@ -1366,7 +1360,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1366
1360
|
let a = s == null ? void 0 : s.beginChapterInfo;
|
|
1367
1361
|
for (; a != null && a.subChapter; )
|
|
1368
1362
|
a = a == null ? void 0 : a.subChapter;
|
|
1369
|
-
const m = (h, b, y) => /* @__PURE__ */ c(
|
|
1363
|
+
const m = (h, b, y) => /* @__PURE__ */ c(Be.Fragment, { children: [
|
|
1370
1364
|
/* @__PURE__ */ t(
|
|
1371
1365
|
w.Item,
|
|
1372
1366
|
{
|
|
@@ -1403,7 +1397,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1403
1397
|
}
|
|
1404
1398
|
),
|
|
1405
1399
|
h.contents.length > 0 && /* @__PURE__ */ t(w.Root, { as: "div", gap: 2, children: h.contents.map(
|
|
1406
|
-
(C,
|
|
1400
|
+
(C, k) => m(C, k, y + 1)
|
|
1407
1401
|
) })
|
|
1408
1402
|
] }, b);
|
|
1409
1403
|
return /* @__PURE__ */ t(w.Root, { gap: 3, overflowY: "auto", py: 4, flex: 1, children: i == null ? void 0 : i.toc.map((h, b) => m(h, b, 0)) });
|
|
@@ -1435,7 +1429,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1435
1429
|
enableFloatingProgress: n = !0,
|
|
1436
1430
|
onItemClick: o
|
|
1437
1431
|
}) => {
|
|
1438
|
-
const [r, i] =
|
|
1432
|
+
const [r, i] = T(!1), [s, d] = T(!1), [l, u] = T(!1), [a, m] = T(void 0), [h, b] = T(!1), [y, C] = me(), k = N(() => {
|
|
1439
1433
|
i(!1), d(!1), u(!1), m(void 0), C(!1), b(!1);
|
|
1440
1434
|
}, [C]), A = N(
|
|
1441
1435
|
(x) => {
|
|
@@ -1462,7 +1456,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1462
1456
|
{
|
|
1463
1457
|
open: r,
|
|
1464
1458
|
setOpen: i,
|
|
1465
|
-
onNavigate:
|
|
1459
|
+
onNavigate: k
|
|
1466
1460
|
}
|
|
1467
1461
|
),
|
|
1468
1462
|
/* @__PURE__ */ t(
|
|
@@ -1470,7 +1464,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1470
1464
|
{
|
|
1471
1465
|
open: l,
|
|
1472
1466
|
setOpen: u,
|
|
1473
|
-
onNavigate:
|
|
1467
|
+
onNavigate: k
|
|
1474
1468
|
}
|
|
1475
1469
|
),
|
|
1476
1470
|
/* @__PURE__ */ t(
|
|
@@ -1478,7 +1472,7 @@ const sn = H.Root, ln = H.ValueText, fe = () => {
|
|
|
1478
1472
|
{
|
|
1479
1473
|
openWith: a,
|
|
1480
1474
|
setOpen: (x) => m(x ? "annotations" : void 0),
|
|
1481
|
-
onNavigate:
|
|
1475
|
+
onNavigate: k
|
|
1482
1476
|
}
|
|
1483
1477
|
),
|
|
1484
1478
|
/* @__PURE__ */ t(
|