html-flip-book-react 0.0.0-alpha.36 → 0.0.0-alpha.38
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/FlipBook.d.ts +7 -2
- package/dist/FlipBook.d.ts.map +1 -1
- package/dist/assets/html-flip-book.css +1 -1
- package/dist/flip-book.js +139 -122
- package/dist/flip-book.js.map +1 -1
- package/dist/toolbar/MouseModeButton.d.ts +8 -0
- package/dist/toolbar/MouseModeButton.d.ts.map +1 -0
- package/dist/toolbar/Toolbar.d.ts.map +1 -1
- package/dist/toolbar/ToolbarButton.d.ts +1 -0
- package/dist/toolbar/ToolbarButton.d.ts.map +1 -1
- package/dist/toolbar/ToolbarContext.d.ts +2 -1
- package/dist/toolbar/ToolbarContext.d.ts.map +1 -1
- package/dist/toolbar/index.d.ts +2 -0
- package/dist/toolbar/index.d.ts.map +1 -1
- package/dist/toolbar/index.js +298 -269
- package/dist/toolbar/index.js.map +1 -1
- package/package.json +2 -2
package/dist/toolbar/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { createContext as
|
|
1
|
+
import { jsx as t, jsxs as T } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as ce, useContext as ie, useMemo as Q, useCallback as v, useEffect as z, useState as I, useRef as J, useLayoutEffect as he } from "react";
|
|
3
3
|
let pe = 4;
|
|
4
4
|
function re() {
|
|
5
5
|
return pe;
|
|
@@ -85,7 +85,7 @@ const fe = {
|
|
|
85
85
|
const o = e.handle?.getTocPageIndex?.() ?? re();
|
|
86
86
|
return e.handle?.getCurrentPageIndex() !== o;
|
|
87
87
|
}
|
|
88
|
-
}, Pe = [{ key: "d", modifiers: { ctrl: !0, alt: !0 } }],
|
|
88
|
+
}, Pe = [{ key: "d", modifiers: { ctrl: !0, alt: !0 } }], Te = {
|
|
89
89
|
id: "toggleDebug",
|
|
90
90
|
enName: "Toggle Debug Toolbar",
|
|
91
91
|
enDescription: "Show or hide the debug toolbar (Ctrl+Alt+D)",
|
|
@@ -95,13 +95,13 @@ const fe = {
|
|
|
95
95
|
execute: (e) => {
|
|
96
96
|
e.handle?.toggleDebugBar?.();
|
|
97
97
|
}
|
|
98
|
-
},
|
|
98
|
+
}, ye = [{ key: "F11" }], Ce = {
|
|
99
99
|
id: "toggleFullscreen",
|
|
100
100
|
enName: "Toggle Fullscreen",
|
|
101
101
|
enDescription: "Enter or exit fullscreen mode",
|
|
102
102
|
nameKey: "command.toggleFullscreen",
|
|
103
103
|
descriptionKey: "command.toggleFullscreenDesc",
|
|
104
|
-
hotkeys:
|
|
104
|
+
hotkeys: ye,
|
|
105
105
|
execute: (e) => {
|
|
106
106
|
const o = e.data;
|
|
107
107
|
document.fullscreenElement ? document.exitFullscreen().catch(console.warn) : (o?.getFullscreenTarget?.() ?? document.documentElement).requestFullscreen().catch(console.warn);
|
|
@@ -113,7 +113,7 @@ const fe = {
|
|
|
113
113
|
oe,
|
|
114
114
|
te,
|
|
115
115
|
Ce,
|
|
116
|
-
|
|
116
|
+
Te,
|
|
117
117
|
fe
|
|
118
118
|
];
|
|
119
119
|
function De(e, o) {
|
|
@@ -124,62 +124,62 @@ function Ne(e, o, a) {
|
|
|
124
124
|
const n = e.modifiers ?? {};
|
|
125
125
|
return !(!!n.ctrl !== o.ctrlKey || !!n.shift !== o.shiftKey || !!n.alt !== o.altKey || !!n.meta !== o.metaKey);
|
|
126
126
|
}
|
|
127
|
-
const de =
|
|
127
|
+
const de = ce(null), Le = ({
|
|
128
128
|
flipBookRef: e,
|
|
129
129
|
currentPage: o,
|
|
130
130
|
totalPages: a,
|
|
131
131
|
direction: n = "ltr",
|
|
132
|
-
commands:
|
|
133
|
-
commandOptions:
|
|
132
|
+
commands: r = [],
|
|
133
|
+
commandOptions: c = {},
|
|
134
134
|
disableHotkeys: s = !1,
|
|
135
|
-
children:
|
|
135
|
+
children: i
|
|
136
136
|
}) => {
|
|
137
137
|
const h = Q(() => {
|
|
138
138
|
const d = {};
|
|
139
139
|
for (const u of Ie)
|
|
140
140
|
d[u.id] = {
|
|
141
141
|
command: u,
|
|
142
|
-
options:
|
|
142
|
+
options: c[u.id] ?? {}
|
|
143
143
|
};
|
|
144
|
-
for (const u of
|
|
144
|
+
for (const u of r)
|
|
145
145
|
d[u.id] = {
|
|
146
146
|
command: u,
|
|
147
|
-
options:
|
|
147
|
+
options: c[u.id] ?? {}
|
|
148
148
|
};
|
|
149
149
|
return d;
|
|
150
|
-
}, [
|
|
150
|
+
}, [r, c]), f = v(
|
|
151
151
|
(d, u) => {
|
|
152
|
-
const b = h[d.id]?.options ?? {},
|
|
152
|
+
const b = h[d.id]?.options ?? {}, F = u ? { ...b.data, ...u } : b.data;
|
|
153
153
|
return {
|
|
154
154
|
handle: e.current,
|
|
155
|
-
data:
|
|
155
|
+
data: F
|
|
156
156
|
};
|
|
157
157
|
},
|
|
158
158
|
[e, h]
|
|
159
|
-
), m =
|
|
159
|
+
), m = v(
|
|
160
160
|
(d, u) => {
|
|
161
161
|
const b = f(d, u);
|
|
162
162
|
d.canExecute && !d.canExecute(b) || d.execute(b);
|
|
163
163
|
},
|
|
164
164
|
[f]
|
|
165
|
-
), y =
|
|
165
|
+
), y = v(
|
|
166
166
|
(d) => {
|
|
167
167
|
const u = f(d);
|
|
168
168
|
return d.canExecute ? d.canExecute(u) : !0;
|
|
169
169
|
},
|
|
170
170
|
[f]
|
|
171
|
-
),
|
|
171
|
+
), D = v(
|
|
172
172
|
() => Object.values(h).map((d) => d.command),
|
|
173
173
|
[h]
|
|
174
|
-
),
|
|
174
|
+
), P = v(
|
|
175
175
|
(d) => {
|
|
176
176
|
const u = d.target;
|
|
177
177
|
if (!(u.tagName === "INPUT" || u.tagName === "TEXTAREA" || u.isContentEditable))
|
|
178
178
|
for (const b of Object.values(h)) {
|
|
179
179
|
if (b.options.disableHotkeys) continue;
|
|
180
|
-
const
|
|
181
|
-
for (const
|
|
182
|
-
if (Ne(
|
|
180
|
+
const F = b.options.hotkeys ?? b.command.hotkeys ?? [];
|
|
181
|
+
for (const M of F)
|
|
182
|
+
if (Ne(M, d, n)) {
|
|
183
183
|
d.preventDefault(), m(b.command);
|
|
184
184
|
return;
|
|
185
185
|
}
|
|
@@ -187,21 +187,21 @@ const de = ie(null), Le = ({
|
|
|
187
187
|
},
|
|
188
188
|
[h, m, n]
|
|
189
189
|
);
|
|
190
|
-
|
|
190
|
+
z(() => {
|
|
191
191
|
if (!s)
|
|
192
|
-
return document.addEventListener("keydown",
|
|
193
|
-
}, [s,
|
|
194
|
-
const
|
|
192
|
+
return document.addEventListener("keydown", P), () => document.removeEventListener("keydown", P);
|
|
193
|
+
}, [s, P]);
|
|
194
|
+
const C = Q(
|
|
195
195
|
() => ({
|
|
196
196
|
execute: m,
|
|
197
197
|
canExecute: y,
|
|
198
|
-
getAllCommands:
|
|
198
|
+
getAllCommands: D
|
|
199
199
|
}),
|
|
200
|
-
[m, y,
|
|
200
|
+
[m, y, D]
|
|
201
201
|
);
|
|
202
|
-
return /* @__PURE__ */ t(de.Provider, { value:
|
|
202
|
+
return /* @__PURE__ */ t(de.Provider, { value: C, children: i });
|
|
203
203
|
}, _ = () => {
|
|
204
|
-
const e =
|
|
204
|
+
const e = ie(de);
|
|
205
205
|
if (!e)
|
|
206
206
|
throw new Error("useCommands must be used within a CommandProvider");
|
|
207
207
|
return e;
|
|
@@ -237,7 +237,7 @@ const de = ie(null), Le = ({
|
|
|
237
237
|
"aria-hidden": "true",
|
|
238
238
|
children: /* @__PURE__ */ t("path", { d: "m9 18 6-6-6-6" })
|
|
239
239
|
}
|
|
240
|
-
), je = ({ size: e = S.size, className: o }) => /* @__PURE__ */
|
|
240
|
+
), je = ({ size: e = S.size, className: o }) => /* @__PURE__ */ T(
|
|
241
241
|
"svg",
|
|
242
242
|
{
|
|
243
243
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -256,7 +256,7 @@ const de = ie(null), Le = ({
|
|
|
256
256
|
/* @__PURE__ */ t("path", { d: "M7 6v12" })
|
|
257
257
|
]
|
|
258
258
|
}
|
|
259
|
-
),
|
|
259
|
+
), Me = ({ size: e = S.size, className: o }) => /* @__PURE__ */ T(
|
|
260
260
|
"svg",
|
|
261
261
|
{
|
|
262
262
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -275,7 +275,7 @@ const de = ie(null), Le = ({
|
|
|
275
275
|
/* @__PURE__ */ t("path", { d: "M17 6v12" })
|
|
276
276
|
]
|
|
277
277
|
}
|
|
278
|
-
),
|
|
278
|
+
), $e = ({ size: e = S.size, className: o }) => /* @__PURE__ */ T(
|
|
279
279
|
"svg",
|
|
280
280
|
{
|
|
281
281
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -296,7 +296,7 @@ const de = ie(null), Le = ({
|
|
|
296
296
|
/* @__PURE__ */ t("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
|
|
297
297
|
]
|
|
298
298
|
}
|
|
299
|
-
),
|
|
299
|
+
), Be = ({ size: e = S.size, className: o }) => /* @__PURE__ */ T(
|
|
300
300
|
"svg",
|
|
301
301
|
{
|
|
302
302
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -317,10 +317,10 @@ const de = ie(null), Le = ({
|
|
|
317
317
|
/* @__PURE__ */ t("path", { d: "M16 21v-3a2 2 0 0 1 2-2h3" })
|
|
318
318
|
]
|
|
319
319
|
}
|
|
320
|
-
),
|
|
320
|
+
), Re = ({
|
|
321
321
|
size: e = S.size,
|
|
322
322
|
className: o
|
|
323
|
-
}) => /* @__PURE__ */
|
|
323
|
+
}) => /* @__PURE__ */ T(
|
|
324
324
|
"svg",
|
|
325
325
|
{
|
|
326
326
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -343,7 +343,7 @@ const de = ie(null), Le = ({
|
|
|
343
343
|
/* @__PURE__ */ t("path", { d: "M21 19h.01" })
|
|
344
344
|
]
|
|
345
345
|
}
|
|
346
|
-
), Ve = ({ size: e = S.size, className: o }) => /* @__PURE__ */
|
|
346
|
+
), Ve = ({ size: e = S.size, className: o }) => /* @__PURE__ */ T(
|
|
347
347
|
"svg",
|
|
348
348
|
{
|
|
349
349
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -365,7 +365,7 @@ const de = ie(null), Le = ({
|
|
|
365
365
|
/* @__PURE__ */ t("rect", { x: "16", y: "6", width: "4", height: "15", rx: "0.5" })
|
|
366
366
|
]
|
|
367
367
|
}
|
|
368
|
-
), Se = ({ size: e = S.size, className: o }) => /* @__PURE__ */
|
|
368
|
+
), Se = ({ size: e = S.size, className: o }) => /* @__PURE__ */ T(
|
|
369
369
|
"svg",
|
|
370
370
|
{
|
|
371
371
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -385,37 +385,39 @@ const de = ie(null), Le = ({
|
|
|
385
385
|
/* @__PURE__ */ t("line", { x1: "12", x2: "12", y1: "15", y2: "3" })
|
|
386
386
|
]
|
|
387
387
|
}
|
|
388
|
-
),
|
|
388
|
+
), U = ({
|
|
389
389
|
onClick: e,
|
|
390
390
|
ariaLabel: o,
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
391
|
+
ariaPressed: a,
|
|
392
|
+
disabled: n = !1,
|
|
393
|
+
children: r,
|
|
394
|
+
className: c = "",
|
|
395
|
+
title: s
|
|
395
396
|
}) => /* @__PURE__ */ t(
|
|
396
397
|
"button",
|
|
397
398
|
{
|
|
398
399
|
type: "button",
|
|
399
400
|
onClick: e,
|
|
400
401
|
"aria-label": o,
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
402
|
+
"aria-pressed": a,
|
|
403
|
+
disabled: n,
|
|
404
|
+
title: s ?? o,
|
|
405
|
+
className: `flipbook-toolbar-button ${c}`.trim(),
|
|
406
|
+
children: r
|
|
405
407
|
}
|
|
406
408
|
), Ge = ({
|
|
407
409
|
onClick: e,
|
|
408
410
|
ariaLabel: o,
|
|
409
411
|
children: a,
|
|
410
412
|
disabled: n = !1,
|
|
411
|
-
className:
|
|
413
|
+
className: r
|
|
412
414
|
}) => /* @__PURE__ */ t(
|
|
413
|
-
|
|
415
|
+
U,
|
|
414
416
|
{
|
|
415
417
|
onClick: e,
|
|
416
418
|
ariaLabel: o,
|
|
417
419
|
disabled: n,
|
|
418
|
-
className: `flipbook-toolbar-action ${
|
|
420
|
+
className: `flipbook-toolbar-action ${r ?? ""}`.trim(),
|
|
419
421
|
children: a
|
|
420
422
|
}
|
|
421
423
|
), Ke = {
|
|
@@ -437,7 +439,9 @@ const de = ie(null), Le = ({
|
|
|
437
439
|
"command.toggleFullscreenDesc": "Enter or exit fullscreen mode",
|
|
438
440
|
"command.toggleDebug": "Toggle debug toolbar",
|
|
439
441
|
"command.toggleDebugDesc": "Show or hide the debug toolbar (Ctrl+Alt+D)",
|
|
440
|
-
"toolbarItem.goToPage": "Go to page"
|
|
442
|
+
"toolbarItem.goToPage": "Go to page",
|
|
443
|
+
"toolbarItem.selectText": "Select text with mouse",
|
|
444
|
+
"toolbarItem.selectionLetters": "Aa"
|
|
441
445
|
}
|
|
442
446
|
}, Ae = {
|
|
443
447
|
align: "right",
|
|
@@ -458,7 +462,9 @@ const de = ie(null), Le = ({
|
|
|
458
462
|
"command.toggleFullscreenDesc": "כניסה או יציאה ממסך מלא",
|
|
459
463
|
"command.toggleDebug": "סרגל כלים לדיבוג",
|
|
460
464
|
"command.toggleDebugDesc": "הצג או הסתר סרגל הדיבוג (Ctrl+Alt+D)",
|
|
461
|
-
"toolbarItem.goToPage": "מעבר לעמוד"
|
|
465
|
+
"toolbarItem.goToPage": "מעבר לעמוד",
|
|
466
|
+
"toolbarItem.selectText": "בחירת טקסט עם העכבר",
|
|
467
|
+
"toolbarItem.selectionLetters": "אב"
|
|
462
468
|
}
|
|
463
469
|
}, ne = {
|
|
464
470
|
"en-US": Ke,
|
|
@@ -490,15 +496,15 @@ function me(e) {
|
|
|
490
496
|
function ze(e) {
|
|
491
497
|
return me(e) ? "rtl" : "ltr";
|
|
492
498
|
}
|
|
493
|
-
function
|
|
499
|
+
function L(e, o) {
|
|
494
500
|
const a = ue(o).translations[e];
|
|
495
501
|
if (a !== void 0 && a !== "") return a;
|
|
496
502
|
const n = ne[ae].translations[e];
|
|
497
503
|
return n !== void 0 && n !== "" ? n : Oe[e] ?? e;
|
|
498
504
|
}
|
|
499
|
-
const ge =
|
|
500
|
-
function
|
|
501
|
-
const e =
|
|
505
|
+
const ge = ce(null);
|
|
506
|
+
function K() {
|
|
507
|
+
const e = ie(ge);
|
|
502
508
|
if (!e)
|
|
503
509
|
throw new Error("Toolbar components must be used within a Toolbar");
|
|
504
510
|
return e;
|
|
@@ -506,13 +512,13 @@ function O() {
|
|
|
506
512
|
function le(e) {
|
|
507
513
|
return e.replace(/[׳'״"]/g, "");
|
|
508
514
|
}
|
|
509
|
-
function
|
|
515
|
+
function se(e, o) {
|
|
510
516
|
try {
|
|
511
517
|
const a = atob(e.data), n = new Uint8Array(a.length);
|
|
512
|
-
for (let
|
|
513
|
-
n[
|
|
514
|
-
const
|
|
515
|
-
s.href =
|
|
518
|
+
for (let i = 0; i < a.length; i++)
|
|
519
|
+
n[i] = a.charCodeAt(i);
|
|
520
|
+
const r = new Blob([n]), c = URL.createObjectURL(r), s = document.createElement("a");
|
|
521
|
+
s.href = c, s.download = `${o}.${e.ext}`, s.click(), URL.revokeObjectURL(c);
|
|
516
522
|
} catch (a) {
|
|
517
523
|
console.error("Download failed:", a);
|
|
518
524
|
}
|
|
@@ -520,15 +526,15 @@ function ce(e, o) {
|
|
|
520
526
|
function Ue(e, o) {
|
|
521
527
|
const a = [];
|
|
522
528
|
for (let n = 0; n < e; n++) {
|
|
523
|
-
const
|
|
524
|
-
if (!
|
|
529
|
+
const r = o?.indexToSemanticName(n) ?? "", c = o?.indexToTitle(n) ?? "";
|
|
530
|
+
if (!r && !c) {
|
|
525
531
|
o || a.push({ pageIndex: n, semanticName: String(n + 1), title: `Page ${n + 1}` });
|
|
526
532
|
continue;
|
|
527
533
|
}
|
|
528
534
|
a.push({
|
|
529
535
|
pageIndex: n,
|
|
530
|
-
semanticName:
|
|
531
|
-
title:
|
|
536
|
+
semanticName: r || String(n + 1),
|
|
537
|
+
title: c || r
|
|
532
538
|
});
|
|
533
539
|
}
|
|
534
540
|
return a;
|
|
@@ -540,116 +546,116 @@ const Je = ({
|
|
|
540
546
|
const {
|
|
541
547
|
totalPages: a,
|
|
542
548
|
pageSemantics: n,
|
|
543
|
-
locale:
|
|
544
|
-
openDownloadMenuRef:
|
|
549
|
+
locale: r,
|
|
550
|
+
openDownloadMenuRef: c,
|
|
545
551
|
downloadExecutorRef: s,
|
|
546
|
-
flipBookRef:
|
|
547
|
-
} =
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
}), [
|
|
551
|
-
const [y,
|
|
552
|
+
flipBookRef: i
|
|
553
|
+
} = K(), h = i.current?.getDownloadConfig?.() ?? void 0, [f, m] = I(!1);
|
|
554
|
+
z(() => (c.current = () => m(!0), () => {
|
|
555
|
+
c.current = null;
|
|
556
|
+
}), [c]);
|
|
557
|
+
const [y, D] = I("entire"), [P, C] = I(0), [d, u] = I(0), [b, F] = I(null), [M, q] = I(!1), B = J(null), A = J(null), j = Q(
|
|
552
558
|
() => Ue(a, n),
|
|
553
559
|
[a, n]
|
|
554
|
-
),
|
|
555
|
-
|
|
556
|
-
f && (
|
|
557
|
-
}, [f,
|
|
558
|
-
const
|
|
560
|
+
), $ = !!h?.onDownloadSefer, R = !!h?.onDownloadPageRange, V = $ || R, O = j[0]?.pageIndex ?? 0, H = j[j.length - 1]?.pageIndex ?? 0;
|
|
561
|
+
z(() => {
|
|
562
|
+
f && (D($ ? "entire" : "range"), C(O), u(H));
|
|
563
|
+
}, [f, $, O, H]);
|
|
564
|
+
const N = v(() => {
|
|
559
565
|
m(!1);
|
|
560
566
|
}, []);
|
|
561
567
|
he(() => {
|
|
562
|
-
if (!f || !
|
|
563
|
-
const
|
|
568
|
+
if (!f || !A.current || !B.current) return;
|
|
569
|
+
const l = A.current, w = B.current.querySelector(".flipbook-toolbar-download-trigger"), E = () => {
|
|
564
570
|
const p = w?.getBoundingClientRect();
|
|
565
571
|
if (!p) return;
|
|
566
|
-
const
|
|
567
|
-
|
|
572
|
+
const k = l.getBoundingClientRect().height, G = window.innerHeight - p.bottom;
|
|
573
|
+
q(G < k + 8);
|
|
568
574
|
};
|
|
569
|
-
|
|
570
|
-
const g = new ResizeObserver(
|
|
571
|
-
return g.observe(
|
|
572
|
-
}, [f]),
|
|
575
|
+
E();
|
|
576
|
+
const g = new ResizeObserver(E);
|
|
577
|
+
return g.observe(l), () => g.disconnect();
|
|
578
|
+
}, [f]), z(() => {
|
|
573
579
|
if (!f) return;
|
|
574
|
-
const
|
|
575
|
-
|
|
580
|
+
const l = (w) => {
|
|
581
|
+
B.current && !B.current.contains(w.target) && N();
|
|
576
582
|
};
|
|
577
|
-
return document.addEventListener("mousedown",
|
|
578
|
-
}, [f,
|
|
579
|
-
const
|
|
580
|
-
const
|
|
581
|
-
if (
|
|
582
|
-
|
|
583
|
+
return document.addEventListener("mousedown", l), () => document.removeEventListener("mousedown", l);
|
|
584
|
+
}, [f, N]);
|
|
585
|
+
const x = v(async () => {
|
|
586
|
+
const l = i.current?.getDownloadConfig?.();
|
|
587
|
+
if (l?.onDownloadSefer) {
|
|
588
|
+
F("sefer");
|
|
583
589
|
try {
|
|
584
|
-
const w = await
|
|
585
|
-
w &&
|
|
590
|
+
const w = await l.onDownloadSefer();
|
|
591
|
+
w && se(w, l.entireBookFilename ?? "book"), N();
|
|
586
592
|
} finally {
|
|
587
|
-
|
|
593
|
+
F(null);
|
|
588
594
|
}
|
|
589
595
|
}
|
|
590
|
-
}, [
|
|
591
|
-
async (
|
|
592
|
-
const
|
|
593
|
-
if (!
|
|
596
|
+
}, [i, N]), W = v(
|
|
597
|
+
async (l, w) => {
|
|
598
|
+
const E = i.current?.getDownloadConfig?.();
|
|
599
|
+
if (!E?.onDownloadPageRange) return;
|
|
594
600
|
const g = [], p = [];
|
|
595
|
-
for (let
|
|
596
|
-
g.push(
|
|
597
|
-
const
|
|
598
|
-
|
|
601
|
+
for (let k = l; k <= w; k++) {
|
|
602
|
+
g.push(k);
|
|
603
|
+
const G = j.find((X) => X.pageIndex === k);
|
|
604
|
+
G && p.push(G);
|
|
599
605
|
}
|
|
600
|
-
|
|
606
|
+
F("range");
|
|
601
607
|
try {
|
|
602
|
-
const
|
|
608
|
+
const k = await E.onDownloadPageRange(
|
|
603
609
|
g,
|
|
604
610
|
p,
|
|
605
|
-
|
|
611
|
+
E.downloadContext
|
|
606
612
|
);
|
|
607
|
-
if (
|
|
608
|
-
const
|
|
613
|
+
if (k) {
|
|
614
|
+
const G = le(p[0]?.semanticName ?? String(l)), X = le(
|
|
609
615
|
p[p.length - 1]?.semanticName ?? String(w)
|
|
610
616
|
);
|
|
611
|
-
|
|
617
|
+
se(k, `${E.rangeFilename ?? "pages"}-${G}-${X}`);
|
|
612
618
|
}
|
|
613
|
-
|
|
619
|
+
N();
|
|
614
620
|
} finally {
|
|
615
|
-
|
|
621
|
+
F(null);
|
|
616
622
|
}
|
|
617
623
|
},
|
|
618
|
-
[
|
|
624
|
+
[i, j, N]
|
|
619
625
|
);
|
|
620
|
-
return
|
|
621
|
-
|
|
626
|
+
return z(() => (s.current = (l, w) => {
|
|
627
|
+
l === void 0 && w === void 0 ? x() : l !== void 0 && w !== void 0 && W(l, w);
|
|
622
628
|
}, () => {
|
|
623
629
|
s.current = null;
|
|
624
|
-
}), [s,
|
|
630
|
+
}), [s, x, W]), V ? /* @__PURE__ */ T("div", { className: `flipbook-toolbar-download-wrap ${o ?? ""}`.trim(), ref: B, children: [
|
|
625
631
|
/* @__PURE__ */ t(
|
|
626
632
|
"button",
|
|
627
633
|
{
|
|
628
634
|
type: "button",
|
|
629
635
|
className: "flipbook-toolbar-button flipbook-toolbar-download-trigger",
|
|
630
|
-
onClick: () => m((
|
|
631
|
-
"aria-label": e ??
|
|
636
|
+
onClick: () => m((l) => !l),
|
|
637
|
+
"aria-label": e ?? L("toolbarItem.download", r),
|
|
632
638
|
"aria-expanded": f,
|
|
633
639
|
"aria-haspopup": "true",
|
|
634
640
|
disabled: b !== null,
|
|
635
641
|
children: /* @__PURE__ */ t(Se, { size: 18 })
|
|
636
642
|
}
|
|
637
643
|
),
|
|
638
|
-
f && /* @__PURE__ */
|
|
644
|
+
f && /* @__PURE__ */ T(
|
|
639
645
|
"div",
|
|
640
646
|
{
|
|
641
|
-
ref:
|
|
642
|
-
className: `flipbook-toolbar-download-menu ${
|
|
647
|
+
ref: A,
|
|
648
|
+
className: `flipbook-toolbar-download-menu ${M ? "flipbook-toolbar-download-menu--open-up" : ""}`.trim(),
|
|
643
649
|
role: "menu",
|
|
644
|
-
dir: me(
|
|
650
|
+
dir: me(r) ? "rtl" : "ltr",
|
|
645
651
|
children: [
|
|
646
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ T(
|
|
647
653
|
"fieldset",
|
|
648
654
|
{
|
|
649
655
|
className: "flipbook-toolbar-download-mode",
|
|
650
|
-
"aria-label":
|
|
656
|
+
"aria-label": L("toolbarItem.download", r),
|
|
651
657
|
children: [
|
|
652
|
-
|
|
658
|
+
$ && /* @__PURE__ */ T("label", { className: "flipbook-toolbar-download-radio-label", children: [
|
|
653
659
|
/* @__PURE__ */ t(
|
|
654
660
|
"input",
|
|
655
661
|
{
|
|
@@ -657,12 +663,12 @@ const Je = ({
|
|
|
657
663
|
name: "download-mode",
|
|
658
664
|
className: "flipbook-toolbar-download-radio",
|
|
659
665
|
checked: y === "entire",
|
|
660
|
-
onChange: () =>
|
|
666
|
+
onChange: () => D("entire")
|
|
661
667
|
}
|
|
662
668
|
),
|
|
663
|
-
/* @__PURE__ */ t("span", { children:
|
|
669
|
+
/* @__PURE__ */ t("span", { children: L("command.downloadEntireBook", r) })
|
|
664
670
|
] }),
|
|
665
|
-
R && /* @__PURE__ */
|
|
671
|
+
R && /* @__PURE__ */ T("label", { className: "flipbook-toolbar-download-radio-label", children: [
|
|
666
672
|
/* @__PURE__ */ t(
|
|
667
673
|
"input",
|
|
668
674
|
{
|
|
@@ -670,36 +676,36 @@ const Je = ({
|
|
|
670
676
|
name: "download-mode",
|
|
671
677
|
className: "flipbook-toolbar-download-radio",
|
|
672
678
|
checked: y === "range",
|
|
673
|
-
onChange: () =>
|
|
679
|
+
onChange: () => D("range")
|
|
674
680
|
}
|
|
675
681
|
),
|
|
676
|
-
/* @__PURE__ */ t("span", { children:
|
|
682
|
+
/* @__PURE__ */ t("span", { children: L("toolbarItem.downloadPageRange", r) })
|
|
677
683
|
] })
|
|
678
684
|
]
|
|
679
685
|
}
|
|
680
686
|
),
|
|
681
|
-
y === "range" && /* @__PURE__ */
|
|
682
|
-
/* @__PURE__ */
|
|
683
|
-
|
|
687
|
+
y === "range" && /* @__PURE__ */ T("div", { className: "flipbook-toolbar-download-range", children: [
|
|
688
|
+
/* @__PURE__ */ T("label", { className: "flipbook-toolbar-download-range-label", children: [
|
|
689
|
+
L("toolbarItem.download.from", r),
|
|
684
690
|
/* @__PURE__ */ t(
|
|
685
691
|
"select",
|
|
686
692
|
{
|
|
687
|
-
value:
|
|
688
|
-
onChange: (
|
|
693
|
+
value: P,
|
|
694
|
+
onChange: (l) => C(Number(l.target.value)),
|
|
689
695
|
className: "flipbook-toolbar-download-range-select",
|
|
690
|
-
children:
|
|
696
|
+
children: j.map((l) => /* @__PURE__ */ t("option", { value: l.pageIndex, children: l.semanticName || l.title || `Page ${l.pageIndex + 1}` }, l.pageIndex))
|
|
691
697
|
}
|
|
692
698
|
)
|
|
693
699
|
] }),
|
|
694
|
-
/* @__PURE__ */
|
|
695
|
-
|
|
700
|
+
/* @__PURE__ */ T("label", { className: "flipbook-toolbar-download-range-label", children: [
|
|
701
|
+
L("toolbarItem.download.to", r),
|
|
696
702
|
/* @__PURE__ */ t(
|
|
697
703
|
"select",
|
|
698
704
|
{
|
|
699
705
|
value: d,
|
|
700
|
-
onChange: (
|
|
706
|
+
onChange: (l) => u(Number(l.target.value)),
|
|
701
707
|
className: "flipbook-toolbar-download-range-select",
|
|
702
|
-
children:
|
|
708
|
+
children: j.map((l) => /* @__PURE__ */ t("option", { value: l.pageIndex, children: l.semanticName || l.title || `Page ${l.pageIndex + 1}` }, l.pageIndex))
|
|
703
709
|
}
|
|
704
710
|
)
|
|
705
711
|
] })
|
|
@@ -712,16 +718,16 @@ const Je = ({
|
|
|
712
718
|
className: "flipbook-toolbar-download-menuitem flipbook-toolbar-download-primary",
|
|
713
719
|
onClick: () => {
|
|
714
720
|
if (y === "entire")
|
|
715
|
-
|
|
721
|
+
x();
|
|
716
722
|
else {
|
|
717
|
-
const
|
|
718
|
-
let
|
|
719
|
-
if (
|
|
720
|
-
|
|
723
|
+
const l = i.current?.getTotalPages?.() ?? a, w = Math.min(P, d);
|
|
724
|
+
let E = Math.max(P, d);
|
|
725
|
+
if (l > 0 && E >= l && (E = l - 1), E < w) return;
|
|
726
|
+
W(w, E);
|
|
721
727
|
}
|
|
722
728
|
},
|
|
723
729
|
disabled: b !== null,
|
|
724
|
-
children: b === "sefer" || b === "range" ? "…" :
|
|
730
|
+
children: b === "sefer" || b === "range" ? "…" : L("toolbarItem.download.download", r)
|
|
725
731
|
}
|
|
726
732
|
)
|
|
727
733
|
]
|
|
@@ -729,16 +735,16 @@ const Je = ({
|
|
|
729
735
|
)
|
|
730
736
|
] }) : null;
|
|
731
737
|
}, _e = ({ children: e, className: o }) => {
|
|
732
|
-
const { locale: a } =
|
|
738
|
+
const { locale: a } = K(), { execute: n, canExecute: r } = _(), c = () => {
|
|
733
739
|
n(ee);
|
|
734
|
-
}, s = /* @__PURE__ */ t(je, { size: 18 }),
|
|
740
|
+
}, s = /* @__PURE__ */ t(je, { size: 18 }), i = L("command.jumpToFirstPage", a);
|
|
735
741
|
return /* @__PURE__ */ t(
|
|
736
|
-
|
|
742
|
+
U,
|
|
737
743
|
{
|
|
738
|
-
onClick:
|
|
739
|
-
ariaLabel:
|
|
740
|
-
title:
|
|
741
|
-
disabled: !
|
|
744
|
+
onClick: c,
|
|
745
|
+
ariaLabel: i,
|
|
746
|
+
title: i,
|
|
747
|
+
disabled: !r(ee),
|
|
742
748
|
className: `flipbook-toolbar-first ${o ?? ""}`.trim(),
|
|
743
749
|
children: e ?? s
|
|
744
750
|
}
|
|
@@ -748,159 +754,180 @@ const Je = ({
|
|
|
748
754
|
enterIcon: o,
|
|
749
755
|
exitIcon: a,
|
|
750
756
|
ariaLabelEnter: n = "Enter fullscreen",
|
|
751
|
-
ariaLabelExit:
|
|
752
|
-
className:
|
|
757
|
+
ariaLabelExit: r = "Exit fullscreen",
|
|
758
|
+
className: c
|
|
753
759
|
}) => {
|
|
754
|
-
const [s,
|
|
755
|
-
|
|
760
|
+
const [s, i] = I(!1), h = K(), f = e ?? h.fullscreenTargetRef, m = v(() => {
|
|
761
|
+
i(!!document.fullscreenElement);
|
|
756
762
|
}, []);
|
|
757
|
-
|
|
763
|
+
z(() => (document.addEventListener("fullscreenchange", m), () => {
|
|
758
764
|
document.removeEventListener("fullscreenchange", m);
|
|
759
765
|
}), [m]);
|
|
760
766
|
const y = async () => {
|
|
761
767
|
try {
|
|
762
768
|
s ? await document.exitFullscreen() : await (f?.current ?? document.documentElement).requestFullscreen();
|
|
763
|
-
} catch (
|
|
764
|
-
console.warn("Fullscreen request failed:",
|
|
769
|
+
} catch (C) {
|
|
770
|
+
console.warn("Fullscreen request failed:", C);
|
|
765
771
|
}
|
|
766
|
-
},
|
|
772
|
+
}, D = s ? r : n, P = s ? a ?? /* @__PURE__ */ t(Be, { size: 18 }) : o ?? /* @__PURE__ */ t($e, { size: 18 });
|
|
767
773
|
return /* @__PURE__ */ t(
|
|
768
|
-
|
|
774
|
+
U,
|
|
769
775
|
{
|
|
770
776
|
onClick: y,
|
|
771
|
-
ariaLabel:
|
|
772
|
-
className: `flipbook-toolbar-fullscreen ${s ? "flipbook-toolbar-fullscreen--active" : ""} ${
|
|
773
|
-
children:
|
|
777
|
+
ariaLabel: D,
|
|
778
|
+
className: `flipbook-toolbar-fullscreen ${s ? "flipbook-toolbar-fullscreen--active" : ""} ${c ?? ""}`.trim(),
|
|
779
|
+
children: P
|
|
774
780
|
}
|
|
775
781
|
);
|
|
776
782
|
}, Qe = ({ children: e, className: o }) => {
|
|
777
|
-
const { locale: a } =
|
|
783
|
+
const { locale: a } = K(), { execute: n, canExecute: r } = _(), c = () => {
|
|
778
784
|
n(oe);
|
|
779
|
-
}, s = /* @__PURE__ */ t(
|
|
785
|
+
}, s = /* @__PURE__ */ t(Me, { size: 18 }), i = L("command.jumpToLastPage", a);
|
|
780
786
|
return /* @__PURE__ */ t(
|
|
781
|
-
|
|
787
|
+
U,
|
|
782
788
|
{
|
|
783
|
-
onClick:
|
|
784
|
-
ariaLabel:
|
|
785
|
-
title:
|
|
786
|
-
disabled: !
|
|
789
|
+
onClick: c,
|
|
790
|
+
ariaLabel: i,
|
|
791
|
+
title: i,
|
|
792
|
+
disabled: !r(oe),
|
|
787
793
|
className: `flipbook-toolbar-last ${o ?? ""}`.trim(),
|
|
788
794
|
children: e ?? s
|
|
789
795
|
}
|
|
790
796
|
);
|
|
791
|
-
}, Ye = ({
|
|
792
|
-
|
|
797
|
+
}, Ye = ({
|
|
798
|
+
letters: e,
|
|
799
|
+
ariaLabel: o,
|
|
800
|
+
className: a
|
|
801
|
+
}) => {
|
|
802
|
+
const { flipBookRef: n, locale: r, mouseMode: c } = K(), s = o ?? L("toolbarItem.selectText", r);
|
|
803
|
+
return /* @__PURE__ */ t(
|
|
804
|
+
U,
|
|
805
|
+
{
|
|
806
|
+
onClick: () => {
|
|
807
|
+
n.current?.setMouseMode(c === "turn" ? "select" : "turn"), window.getSelection()?.removeAllRanges();
|
|
808
|
+
},
|
|
809
|
+
ariaLabel: s,
|
|
810
|
+
ariaPressed: c === "select",
|
|
811
|
+
className: `flipbook-toolbar-mouse-mode ${a ?? ""}`.trim(),
|
|
812
|
+
children: /* @__PURE__ */ T("span", { className: "flipbook-toolbar-mouse-mode-icon", "aria-hidden": "true", children: [
|
|
813
|
+
/* @__PURE__ */ t("span", { className: "flipbook-toolbar-mouse-mode-caret" }),
|
|
814
|
+
/* @__PURE__ */ t("span", { children: e ?? L("toolbarItem.selectionLetters", r) })
|
|
815
|
+
] })
|
|
816
|
+
}
|
|
817
|
+
);
|
|
818
|
+
}, Ze = ({ children: e, className: o }) => {
|
|
819
|
+
const { locale: a } = K(), { execute: n, canExecute: r } = _(), c = () => {
|
|
793
820
|
n(Y);
|
|
794
|
-
}, s =
|
|
821
|
+
}, s = L("command.jumpToNextPage", a), i = /* @__PURE__ */ t(Ee, { size: 20 });
|
|
795
822
|
return /* @__PURE__ */ t(
|
|
796
|
-
|
|
823
|
+
U,
|
|
797
824
|
{
|
|
798
|
-
onClick:
|
|
825
|
+
onClick: c,
|
|
799
826
|
ariaLabel: s,
|
|
800
827
|
title: s,
|
|
801
|
-
disabled: !
|
|
828
|
+
disabled: !r(Y),
|
|
802
829
|
className: `flipbook-toolbar-next ${o ?? ""}`.trim(),
|
|
803
|
-
children: e ??
|
|
830
|
+
children: e ?? i
|
|
804
831
|
}
|
|
805
832
|
);
|
|
806
|
-
},
|
|
833
|
+
}, eo = ({
|
|
807
834
|
mode: e,
|
|
808
835
|
showTotal: o = !0,
|
|
809
836
|
placeholder: a = "—",
|
|
810
837
|
editable: n,
|
|
811
|
-
className:
|
|
812
|
-
ariaLabel:
|
|
838
|
+
className: r,
|
|
839
|
+
ariaLabel: c = "Go to page",
|
|
813
840
|
maxLength: s = 10
|
|
814
841
|
}) => {
|
|
815
|
-
const { flipBookRef:
|
|
816
|
-
(g) =>
|
|
817
|
-
[
|
|
818
|
-
),
|
|
819
|
-
const g =
|
|
820
|
-
let
|
|
821
|
-
return !g && !p ?
|
|
822
|
-
}, [
|
|
823
|
-
|
|
824
|
-
const g = m !==
|
|
825
|
-
|
|
826
|
-
}, [
|
|
827
|
-
const
|
|
842
|
+
const { flipBookRef: i, pageSemantics: h, direction: f, currentPage: m, totalPages: y, of: D } = K(), P = e ?? (h ? "semantic" : "index"), C = n ?? (P === "semantic" && !!h), [d, u] = I(""), [b, F] = I(!1), M = J(!1), q = J(m), B = m, A = m + 1 < y ? m + 1 : null, j = v(
|
|
843
|
+
(g) => P === "semantic" && h ? h.indexToSemanticName(g) || "" : String(g + 1),
|
|
844
|
+
[P, h]
|
|
845
|
+
), $ = j(B), R = A != null ? j(A) : "", V = v(() => String(D), [D]), O = v(() => {
|
|
846
|
+
const g = $, p = R;
|
|
847
|
+
let k;
|
|
848
|
+
return !g && !p ? k = a : g ? p ? g === p ? k = g : k = `${g} - ${p}` : k = g : k = p, o ? `${k} / ${V()}` : k;
|
|
849
|
+
}, [$, R, a, o, V]), H = f === "rtl" ? R || $ : $ || R, N = O();
|
|
850
|
+
z(() => {
|
|
851
|
+
const g = m !== q.current;
|
|
852
|
+
q.current = m, g && (M.current = !1), !b && !M.current && u(N);
|
|
853
|
+
}, [N, b, m]);
|
|
854
|
+
const x = v(
|
|
828
855
|
(g) => {
|
|
829
|
-
if (
|
|
830
|
-
|
|
856
|
+
if (C) {
|
|
857
|
+
F(!0), u(H), M.current = !1;
|
|
831
858
|
const p = () => g.target.select();
|
|
832
859
|
typeof requestAnimationFrame < "u" ? requestAnimationFrame(p) : p();
|
|
833
860
|
}
|
|
834
861
|
},
|
|
835
|
-
[
|
|
836
|
-
),
|
|
837
|
-
|
|
838
|
-
}, [
|
|
862
|
+
[C, H]
|
|
863
|
+
), W = v(() => {
|
|
864
|
+
F(!1), M.current || u(N);
|
|
865
|
+
}, [N]), l = v(
|
|
839
866
|
(g) => {
|
|
840
867
|
if (g.key === "Enter") {
|
|
841
868
|
if (h && d.trim()) {
|
|
842
869
|
const p = h.semanticNameToIndex(d.trim());
|
|
843
|
-
p != null && p >= 0 && p < y && (
|
|
870
|
+
p != null && p >= 0 && p < y && (i.current?.jumpToPage(p), M.current = !0);
|
|
844
871
|
}
|
|
845
872
|
g.currentTarget.blur();
|
|
846
873
|
} else g.key === "Escape" && g.currentTarget.blur();
|
|
847
874
|
},
|
|
848
|
-
[d, h, y,
|
|
849
|
-
), w =
|
|
875
|
+
[d, h, y, i]
|
|
876
|
+
), w = v((g) => {
|
|
850
877
|
u(g.target.value);
|
|
851
878
|
}, []);
|
|
852
|
-
return
|
|
879
|
+
return C ? /* @__PURE__ */ t(
|
|
853
880
|
"input",
|
|
854
881
|
{
|
|
855
882
|
type: "text",
|
|
856
|
-
className: `flipbook-toolbar-indicator ${b ? "flipbook-toolbar-indicator--editing" : ""} ${
|
|
883
|
+
className: `flipbook-toolbar-indicator ${b ? "flipbook-toolbar-indicator--editing" : ""} ${r ?? ""}`.trim(),
|
|
857
884
|
value: d,
|
|
858
|
-
onFocus:
|
|
859
|
-
onBlur:
|
|
860
|
-
onKeyDown:
|
|
885
|
+
onFocus: x,
|
|
886
|
+
onBlur: W,
|
|
887
|
+
onKeyDown: l,
|
|
861
888
|
onChange: w,
|
|
862
|
-
"aria-label":
|
|
889
|
+
"aria-label": c,
|
|
863
890
|
"aria-live": "polite",
|
|
864
891
|
"aria-atomic": "true",
|
|
865
892
|
maxLength: s,
|
|
866
|
-
readOnly: !
|
|
893
|
+
readOnly: !C
|
|
867
894
|
}
|
|
868
895
|
) : /* @__PURE__ */ t(
|
|
869
896
|
"span",
|
|
870
897
|
{
|
|
871
|
-
className: `flipbook-toolbar-indicator ${
|
|
898
|
+
className: `flipbook-toolbar-indicator ${r ?? ""}`.trim(),
|
|
872
899
|
"aria-live": "polite",
|
|
873
900
|
"aria-atomic": "true",
|
|
874
|
-
children:
|
|
901
|
+
children: N
|
|
875
902
|
}
|
|
876
903
|
);
|
|
877
|
-
},
|
|
878
|
-
const { locale: a } =
|
|
904
|
+
}, oo = ({ children: e, className: o }) => {
|
|
905
|
+
const { locale: a } = K(), { execute: n, canExecute: r } = _(), c = () => {
|
|
879
906
|
n(Z);
|
|
880
|
-
}, s =
|
|
907
|
+
}, s = L("command.jumpToPrevPage", a), i = /* @__PURE__ */ t(Fe, { size: 20 });
|
|
881
908
|
return /* @__PURE__ */ t(
|
|
882
|
-
|
|
909
|
+
U,
|
|
883
910
|
{
|
|
884
|
-
onClick:
|
|
911
|
+
onClick: c,
|
|
885
912
|
ariaLabel: s,
|
|
886
913
|
title: s,
|
|
887
|
-
disabled: !
|
|
914
|
+
disabled: !r(Z),
|
|
888
915
|
className: `flipbook-toolbar-prev ${o ?? ""}`.trim(),
|
|
889
|
-
children: e ??
|
|
916
|
+
children: e ?? i
|
|
890
917
|
}
|
|
891
918
|
);
|
|
892
|
-
},
|
|
893
|
-
const { locale: n } =
|
|
894
|
-
|
|
895
|
-
}, h = !
|
|
919
|
+
}, to = ({ children: e, ariaLabel: o, className: a }) => {
|
|
920
|
+
const { locale: n } = K(), { execute: r, canExecute: c } = _(), s = o ?? L("command.jumpToToc", n), i = () => {
|
|
921
|
+
r(te);
|
|
922
|
+
}, h = !c(te);
|
|
896
923
|
return /* @__PURE__ */ t(
|
|
897
|
-
|
|
924
|
+
U,
|
|
898
925
|
{
|
|
899
|
-
onClick:
|
|
926
|
+
onClick: i,
|
|
900
927
|
ariaLabel: s,
|
|
901
928
|
disabled: h,
|
|
902
929
|
className: `flipbook-toolbar-toc ${a ?? ""}`.trim(),
|
|
903
|
-
children: e ?? /* @__PURE__ */ t(
|
|
930
|
+
children: e ?? /* @__PURE__ */ t(Re, { size: 18 })
|
|
904
931
|
}
|
|
905
932
|
);
|
|
906
933
|
}, He = {
|
|
@@ -913,19 +940,19 @@ const Je = ({
|
|
|
913
940
|
e.data?.open?.();
|
|
914
941
|
},
|
|
915
942
|
canExecute: (e) => typeof e.data?.open == "function"
|
|
916
|
-
},
|
|
943
|
+
}, no = ({
|
|
917
944
|
flipBookRef: e,
|
|
918
945
|
direction: o,
|
|
919
946
|
locale: a,
|
|
920
947
|
pageSemantics: n,
|
|
921
|
-
className:
|
|
922
|
-
children:
|
|
948
|
+
className: r = "",
|
|
949
|
+
children: c,
|
|
923
950
|
enableHotkeys: s = !0,
|
|
924
|
-
commands:
|
|
951
|
+
commands: i,
|
|
925
952
|
commandOptions: h,
|
|
926
953
|
fullscreenTargetRef: f
|
|
927
954
|
}) => {
|
|
928
|
-
const m = o ?? ze(a ?? ae), y = a ?? (m === "rtl" ? "he-IL" : "en-US"),
|
|
955
|
+
const m = o ?? ze(a ?? ae), y = a ?? (m === "rtl" ? "he-IL" : "en-US"), D = J(null), P = J(null), [C, d] = I(0), [u, b] = I(0), [F, M] = I(0), [q, B] = I(!0), [A, j] = I(!1), [$, R] = I("turn"), V = {
|
|
929
956
|
...f ? {
|
|
930
957
|
toggleFullscreen: {
|
|
931
958
|
data: {
|
|
@@ -934,23 +961,23 @@ const Je = ({
|
|
|
934
961
|
}
|
|
935
962
|
} : {},
|
|
936
963
|
openDownloadMenu: {
|
|
937
|
-
data: { open: () =>
|
|
964
|
+
data: { open: () => D.current?.() }
|
|
938
965
|
},
|
|
939
966
|
download: {
|
|
940
967
|
data: {
|
|
941
|
-
onDownload: (
|
|
968
|
+
onDownload: (x, W) => P.current?.(x, W)
|
|
942
969
|
}
|
|
943
970
|
},
|
|
944
971
|
...h
|
|
945
|
-
},
|
|
946
|
-
const
|
|
947
|
-
|
|
972
|
+
}, O = v(() => {
|
|
973
|
+
const x = e.current;
|
|
974
|
+
x && (d(x.getCurrentPageIndex()), b(x.getTotalPages()), M(x.getOf()), B(x.isFirstPage()), j(x.isLastPage()), R(x.getMouseMode?.() ?? "turn"));
|
|
948
975
|
}, [e]);
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
const
|
|
952
|
-
return () => clearInterval(
|
|
953
|
-
}, [
|
|
976
|
+
z(() => {
|
|
977
|
+
O();
|
|
978
|
+
const x = setInterval(O, 200);
|
|
979
|
+
return () => clearInterval(x);
|
|
980
|
+
}, [O]);
|
|
954
981
|
const H = /* @__PURE__ */ t(
|
|
955
982
|
ge.Provider,
|
|
956
983
|
{
|
|
@@ -959,36 +986,37 @@ const Je = ({
|
|
|
959
986
|
direction: m,
|
|
960
987
|
locale: y,
|
|
961
988
|
pageSemantics: n,
|
|
962
|
-
currentPage:
|
|
989
|
+
currentPage: C,
|
|
963
990
|
totalPages: u,
|
|
964
|
-
of:
|
|
965
|
-
isFirstPage:
|
|
966
|
-
isLastPage:
|
|
967
|
-
|
|
968
|
-
|
|
991
|
+
of: F,
|
|
992
|
+
isFirstPage: q,
|
|
993
|
+
isLastPage: A,
|
|
994
|
+
mouseMode: $,
|
|
995
|
+
openDownloadMenuRef: D,
|
|
996
|
+
downloadExecutorRef: P,
|
|
969
997
|
fullscreenTargetRef: f
|
|
970
998
|
},
|
|
971
999
|
children: /* @__PURE__ */ t(
|
|
972
1000
|
"div",
|
|
973
1001
|
{
|
|
974
|
-
className: `flipbook-toolbar ${m === "rtl" ? "flipbook-toolbar--rtl" : ""} ${
|
|
1002
|
+
className: `flipbook-toolbar ${m === "rtl" ? "flipbook-toolbar--rtl" : ""} ${r}`.trim(),
|
|
975
1003
|
role: "toolbar",
|
|
976
1004
|
"aria-label": "FlipBook navigation",
|
|
977
1005
|
dir: m,
|
|
978
|
-
children:
|
|
1006
|
+
children: c
|
|
979
1007
|
}
|
|
980
1008
|
)
|
|
981
1009
|
}
|
|
982
|
-
),
|
|
1010
|
+
), N = [He, ...i ?? []];
|
|
983
1011
|
return /* @__PURE__ */ t(
|
|
984
1012
|
Le,
|
|
985
1013
|
{
|
|
986
1014
|
flipBookRef: e,
|
|
987
|
-
currentPage:
|
|
1015
|
+
currentPage: C,
|
|
988
1016
|
totalPages: u,
|
|
989
1017
|
direction: m,
|
|
990
|
-
commands:
|
|
991
|
-
commandOptions:
|
|
1018
|
+
commands: N,
|
|
1019
|
+
commandOptions: V,
|
|
992
1020
|
disableHotkeys: !s,
|
|
993
1021
|
children: H
|
|
994
1022
|
}
|
|
@@ -998,7 +1026,7 @@ export {
|
|
|
998
1026
|
Ge as ActionButton,
|
|
999
1027
|
Ve as BookshelfIcon,
|
|
1000
1028
|
je as ChevronFirstIcon,
|
|
1001
|
-
|
|
1029
|
+
Me as ChevronLastIcon,
|
|
1002
1030
|
Fe as ChevronLeftIcon,
|
|
1003
1031
|
Ee as ChevronRightIcon,
|
|
1004
1032
|
Je as DownloadDropdown,
|
|
@@ -1006,16 +1034,17 @@ export {
|
|
|
1006
1034
|
_e as FirstPageButton,
|
|
1007
1035
|
Xe as FullscreenButton,
|
|
1008
1036
|
Qe as LastPageButton,
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
Ye as
|
|
1012
|
-
Ze as
|
|
1013
|
-
eo as
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
to as
|
|
1018
|
-
|
|
1037
|
+
$e as MaximizeIcon,
|
|
1038
|
+
Be as MinimizeIcon,
|
|
1039
|
+
Ye as MouseModeButton,
|
|
1040
|
+
Ze as NextButton,
|
|
1041
|
+
eo as PageIndicator,
|
|
1042
|
+
oo as PrevButton,
|
|
1043
|
+
eo as SemanticPageIndicator,
|
|
1044
|
+
Re as TableOfContentsIcon,
|
|
1045
|
+
to as TocButton,
|
|
1046
|
+
no as Toolbar,
|
|
1047
|
+
U as ToolbarButton,
|
|
1019
1048
|
Ie as defaultCommands,
|
|
1020
1049
|
fe as downloadCommand,
|
|
1021
1050
|
Y as flipNextCommand,
|
|
@@ -1023,9 +1052,9 @@ export {
|
|
|
1023
1052
|
ee as goToFirstCommand,
|
|
1024
1053
|
oe as goToLastCommand,
|
|
1025
1054
|
te as goToTocCommand,
|
|
1026
|
-
|
|
1055
|
+
Te as toggleDebugCommand,
|
|
1027
1056
|
Ce as toggleFullscreenCommand,
|
|
1028
1057
|
_ as useCommands,
|
|
1029
|
-
|
|
1058
|
+
K as useToolbar
|
|
1030
1059
|
};
|
|
1031
1060
|
//# sourceMappingURL=index.js.map
|