html-flip-book-react 0.0.0-alpha.23 → 0.0.0-alpha.24
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 +2 -0
- package/dist/FlipBook.d.ts.map +1 -1
- package/dist/assets/html-flip-book.css +1 -1
- package/dist/download/types.d.ts +15 -0
- package/dist/download/types.d.ts.map +1 -0
- package/dist/flip-book.js +74 -70
- package/dist/flip-book.js.map +1 -1
- package/dist/i18n.d.ts +4 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.d.ts.map +1 -1
- package/dist/toolbar/DownloadDropdown.d.ts +21 -0
- package/dist/toolbar/DownloadDropdown.d.ts.map +1 -0
- package/dist/toolbar/FirstPageButton.d.ts.map +1 -1
- package/dist/toolbar/LastPageButton.d.ts.map +1 -1
- package/dist/toolbar/NextButton.d.ts.map +1 -1
- package/dist/toolbar/PageIndicator.d.ts.map +1 -1
- package/dist/toolbar/PrevButton.d.ts.map +1 -1
- package/dist/toolbar/TocButton.d.ts.map +1 -1
- package/dist/toolbar/Toolbar.d.ts +2 -0
- package/dist/toolbar/Toolbar.d.ts.map +1 -1
- package/dist/toolbar/ToolbarContext.d.ts +3 -0
- package/dist/toolbar/ToolbarContext.d.ts.map +1 -1
- package/dist/toolbar/index.d.ts +4 -1
- package/dist/toolbar/index.d.ts.map +1 -1
- package/dist/toolbar/index.js +544 -321
- package/dist/toolbar/index.js.map +1 -1
- package/package.json +2 -2
package/dist/toolbar/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
const
|
|
1
|
+
import { jsx as o, jsxs as L, Fragment as oe } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as _, useContext as Q, useMemo as J, useCallback as w, useEffect as W, useState as C, useRef as K, useLayoutEffect as ne } from "react";
|
|
3
|
+
const re = {
|
|
4
4
|
flipNext: [
|
|
5
5
|
{ key: "ArrowRight" },
|
|
6
6
|
{ key: "PageDown" },
|
|
@@ -12,7 +12,7 @@ const ee = {
|
|
|
12
12
|
goToLast: [{ key: "End" }],
|
|
13
13
|
goToToc: [{ key: "t" }],
|
|
14
14
|
toggleFullscreen: [{ key: "f" }]
|
|
15
|
-
},
|
|
15
|
+
}, ae = [
|
|
16
16
|
{
|
|
17
17
|
id: "flipNext",
|
|
18
18
|
name: "Next Page",
|
|
@@ -52,14 +52,14 @@ const ee = {
|
|
|
52
52
|
{
|
|
53
53
|
id: "goToToc",
|
|
54
54
|
name: "Table of Contents",
|
|
55
|
-
description: "
|
|
55
|
+
description: "Go to the table of contents (with flip)",
|
|
56
56
|
execute: ({ flipBookRef: e, data: t }) => {
|
|
57
|
-
const
|
|
58
|
-
e.current?.
|
|
57
|
+
const n = t?.tocPageIndex ?? 4;
|
|
58
|
+
e.current?.goToPage(n);
|
|
59
59
|
},
|
|
60
60
|
canExecute: ({ currentPage: e, data: t }) => {
|
|
61
|
-
const
|
|
62
|
-
return e !==
|
|
61
|
+
const n = t?.tocPageIndex ?? 4;
|
|
62
|
+
return e !== n;
|
|
63
63
|
}
|
|
64
64
|
},
|
|
65
65
|
{
|
|
@@ -71,108 +71,108 @@ const ee = {
|
|
|
71
71
|
document.fullscreenElement ? document.exitFullscreen().catch(console.warn) : (t?.current ?? document.documentElement).requestFullscreen().catch(console.warn);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
],
|
|
75
|
-
function
|
|
74
|
+
], Z = _(null);
|
|
75
|
+
function le(e, t) {
|
|
76
76
|
if (t.key !== e.key) return !1;
|
|
77
|
-
const
|
|
78
|
-
return !(!!
|
|
77
|
+
const n = e.modifiers ?? {};
|
|
78
|
+
return !(!!n.ctrl !== t.ctrlKey || !!n.shift !== t.shiftKey || !!n.alt !== t.altKey || !!n.meta !== t.metaKey);
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const se = ({
|
|
81
81
|
flipBookRef: e,
|
|
82
82
|
currentPage: t,
|
|
83
|
-
totalPages:
|
|
84
|
-
direction:
|
|
85
|
-
commands:
|
|
86
|
-
commandOptions:
|
|
87
|
-
disableHotkeys:
|
|
88
|
-
children:
|
|
83
|
+
totalPages: n,
|
|
84
|
+
direction: r = "ltr",
|
|
85
|
+
commands: i = [],
|
|
86
|
+
commandOptions: d = {},
|
|
87
|
+
disableHotkeys: g = !1,
|
|
88
|
+
children: m
|
|
89
89
|
}) => {
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
for (const
|
|
93
|
-
|
|
94
|
-
command:
|
|
95
|
-
options:
|
|
90
|
+
const c = J(() => {
|
|
91
|
+
const a = {};
|
|
92
|
+
for (const l of ae)
|
|
93
|
+
a[l.id] = {
|
|
94
|
+
command: l,
|
|
95
|
+
options: d[l.id] ?? {}
|
|
96
96
|
};
|
|
97
|
-
for (const
|
|
98
|
-
|
|
99
|
-
command:
|
|
100
|
-
options:
|
|
97
|
+
for (const l of i)
|
|
98
|
+
a[l.id] = {
|
|
99
|
+
command: l,
|
|
100
|
+
options: d[l.id] ?? {}
|
|
101
101
|
};
|
|
102
|
-
return
|
|
103
|
-
}, [
|
|
104
|
-
(
|
|
105
|
-
const
|
|
102
|
+
return a;
|
|
103
|
+
}, [i, d]), p = w(
|
|
104
|
+
(a) => {
|
|
105
|
+
const l = c[a]?.options ?? {};
|
|
106
106
|
return {
|
|
107
107
|
flipBookRef: e,
|
|
108
108
|
currentPage: t,
|
|
109
|
-
totalPages:
|
|
110
|
-
direction:
|
|
111
|
-
data:
|
|
109
|
+
totalPages: n,
|
|
110
|
+
direction: r,
|
|
111
|
+
data: l.data
|
|
112
112
|
};
|
|
113
113
|
},
|
|
114
|
-
[e, t,
|
|
115
|
-
),
|
|
116
|
-
(
|
|
117
|
-
const
|
|
118
|
-
if (!
|
|
119
|
-
console.warn(`Command "${
|
|
114
|
+
[e, t, n, r, c]
|
|
115
|
+
), h = w(
|
|
116
|
+
(a) => {
|
|
117
|
+
const l = c[a];
|
|
118
|
+
if (!l) {
|
|
119
|
+
console.warn(`Command "${a}" not found`);
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
-
const
|
|
123
|
-
|
|
122
|
+
const b = p(a);
|
|
123
|
+
l.command.canExecute && !l.command.canExecute(b) || l.command.execute(b);
|
|
124
124
|
},
|
|
125
|
-
[
|
|
126
|
-
),
|
|
127
|
-
(
|
|
128
|
-
const
|
|
129
|
-
if (!
|
|
130
|
-
const
|
|
131
|
-
return
|
|
125
|
+
[c, p]
|
|
126
|
+
), P = w(
|
|
127
|
+
(a) => {
|
|
128
|
+
const l = c[a];
|
|
129
|
+
if (!l) return !1;
|
|
130
|
+
const b = p(a);
|
|
131
|
+
return l.command.canExecute ? l.command.canExecute(b) : !0;
|
|
132
132
|
},
|
|
133
|
-
[
|
|
134
|
-
),
|
|
135
|
-
(
|
|
136
|
-
[
|
|
137
|
-
),
|
|
138
|
-
() => Object.values(
|
|
139
|
-
[
|
|
140
|
-
),
|
|
141
|
-
(
|
|
142
|
-
const
|
|
143
|
-
if (!(
|
|
144
|
-
for (const [
|
|
145
|
-
if (
|
|
146
|
-
const
|
|
147
|
-
for (const
|
|
148
|
-
if (
|
|
149
|
-
|
|
133
|
+
[c, p]
|
|
134
|
+
), y = w(
|
|
135
|
+
(a) => c[a]?.command,
|
|
136
|
+
[c]
|
|
137
|
+
), N = w(
|
|
138
|
+
() => Object.values(c).map((a) => a.command),
|
|
139
|
+
[c]
|
|
140
|
+
), x = w(
|
|
141
|
+
(a) => {
|
|
142
|
+
const l = a.target;
|
|
143
|
+
if (!(l.tagName === "INPUT" || l.tagName === "TEXTAREA" || l.isContentEditable))
|
|
144
|
+
for (const [b, v] of Object.entries(c)) {
|
|
145
|
+
if (v.options.disableHotkeys) continue;
|
|
146
|
+
const I = v.options.hotkeys ?? re[b] ?? [];
|
|
147
|
+
for (const R of I)
|
|
148
|
+
if (le(R, a)) {
|
|
149
|
+
a.preventDefault(), h(b);
|
|
150
150
|
return;
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
|
-
[
|
|
154
|
+
[c, h]
|
|
155
155
|
);
|
|
156
|
-
|
|
157
|
-
if (!
|
|
158
|
-
return document.addEventListener("keydown",
|
|
159
|
-
}, [
|
|
160
|
-
const
|
|
156
|
+
W(() => {
|
|
157
|
+
if (!g)
|
|
158
|
+
return document.addEventListener("keydown", x), () => document.removeEventListener("keydown", x);
|
|
159
|
+
}, [g, x]);
|
|
160
|
+
const E = J(
|
|
161
161
|
() => ({
|
|
162
|
-
executeCommand:
|
|
163
|
-
canExecute:
|
|
164
|
-
getCommand:
|
|
165
|
-
getAllCommands:
|
|
162
|
+
executeCommand: h,
|
|
163
|
+
canExecute: P,
|
|
164
|
+
getCommand: y,
|
|
165
|
+
getAllCommands: N
|
|
166
166
|
}),
|
|
167
|
-
[
|
|
167
|
+
[h, P, y, N]
|
|
168
168
|
);
|
|
169
|
-
return /* @__PURE__ */
|
|
170
|
-
},
|
|
171
|
-
const e =
|
|
169
|
+
return /* @__PURE__ */ o(Z.Provider, { value: E, children: m });
|
|
170
|
+
}, ve = () => {
|
|
171
|
+
const e = Q(Z);
|
|
172
172
|
if (!e)
|
|
173
173
|
throw new Error("useCommands must be used within a CommandProvider");
|
|
174
174
|
return e;
|
|
175
|
-
},
|
|
175
|
+
}, $ = { size: 24 }, ie = ({ size: e = $.size, className: t }) => /* @__PURE__ */ o(
|
|
176
176
|
"svg",
|
|
177
177
|
{
|
|
178
178
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -186,9 +186,9 @@ const oe = ({
|
|
|
186
186
|
strokeLinejoin: "round",
|
|
187
187
|
className: t,
|
|
188
188
|
"aria-hidden": "true",
|
|
189
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ o("path", { d: "m15 18-6-6 6-6" })
|
|
190
190
|
}
|
|
191
|
-
),
|
|
191
|
+
), ce = ({ size: e = $.size, className: t }) => /* @__PURE__ */ o(
|
|
192
192
|
"svg",
|
|
193
193
|
{
|
|
194
194
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -202,9 +202,9 @@ const oe = ({
|
|
|
202
202
|
strokeLinejoin: "round",
|
|
203
203
|
className: t,
|
|
204
204
|
"aria-hidden": "true",
|
|
205
|
-
children: /* @__PURE__ */
|
|
205
|
+
children: /* @__PURE__ */ o("path", { d: "m9 18 6-6-6-6" })
|
|
206
206
|
}
|
|
207
|
-
),
|
|
207
|
+
), de = ({ size: e = $.size, className: t }) => /* @__PURE__ */ L(
|
|
208
208
|
"svg",
|
|
209
209
|
{
|
|
210
210
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -219,11 +219,11 @@ const oe = ({
|
|
|
219
219
|
className: t,
|
|
220
220
|
"aria-hidden": "true",
|
|
221
221
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ o("path", { d: "m17 18-6-6 6-6" }),
|
|
223
|
+
/* @__PURE__ */ o("path", { d: "M7 6v12" })
|
|
224
224
|
]
|
|
225
225
|
}
|
|
226
|
-
),
|
|
226
|
+
), ue = ({ size: e = $.size, className: t }) => /* @__PURE__ */ L(
|
|
227
227
|
"svg",
|
|
228
228
|
{
|
|
229
229
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -238,11 +238,11 @@ const oe = ({
|
|
|
238
238
|
className: t,
|
|
239
239
|
"aria-hidden": "true",
|
|
240
240
|
children: [
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ o("path", { d: "m7 18 6-6-6-6" }),
|
|
242
|
+
/* @__PURE__ */ o("path", { d: "M17 6v12" })
|
|
243
243
|
]
|
|
244
244
|
}
|
|
245
|
-
),
|
|
245
|
+
), ge = ({ size: e = $.size, className: t }) => /* @__PURE__ */ L(
|
|
246
246
|
"svg",
|
|
247
247
|
{
|
|
248
248
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -257,13 +257,13 @@ const oe = ({
|
|
|
257
257
|
className: t,
|
|
258
258
|
"aria-hidden": "true",
|
|
259
259
|
children: [
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
/* @__PURE__ */
|
|
263
|
-
/* @__PURE__ */
|
|
260
|
+
/* @__PURE__ */ o("path", { d: "M8 3H5a2 2 0 0 0-2 2v3" }),
|
|
261
|
+
/* @__PURE__ */ o("path", { d: "M21 8V5a2 2 0 0 0-2-2h-3" }),
|
|
262
|
+
/* @__PURE__ */ o("path", { d: "M3 16v3a2 2 0 0 0 2 2h3" }),
|
|
263
|
+
/* @__PURE__ */ o("path", { d: "M16 21h3a2 2 0 0 0 2-2v-3" })
|
|
264
264
|
]
|
|
265
265
|
}
|
|
266
|
-
),
|
|
266
|
+
), he = ({ size: e = $.size, className: t }) => /* @__PURE__ */ L(
|
|
267
267
|
"svg",
|
|
268
268
|
{
|
|
269
269
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -278,16 +278,16 @@ const oe = ({
|
|
|
278
278
|
className: t,
|
|
279
279
|
"aria-hidden": "true",
|
|
280
280
|
children: [
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ o("path", { d: "M8 3v3a2 2 0 0 1-2 2H3" }),
|
|
282
|
+
/* @__PURE__ */ o("path", { d: "M21 8h-3a2 2 0 0 1-2-2V3" }),
|
|
283
|
+
/* @__PURE__ */ o("path", { d: "M3 16h3a2 2 0 0 1 2 2v3" }),
|
|
284
|
+
/* @__PURE__ */ o("path", { d: "M16 21v-3a2 2 0 0 1 2-2h3" })
|
|
285
285
|
]
|
|
286
286
|
}
|
|
287
|
-
),
|
|
288
|
-
size: e =
|
|
287
|
+
), me = ({
|
|
288
|
+
size: e = $.size,
|
|
289
289
|
className: t
|
|
290
|
-
}) => /* @__PURE__ */
|
|
290
|
+
}) => /* @__PURE__ */ L(
|
|
291
291
|
"svg",
|
|
292
292
|
{
|
|
293
293
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -302,15 +302,15 @@ const oe = ({
|
|
|
302
302
|
className: t,
|
|
303
303
|
"aria-hidden": "true",
|
|
304
304
|
children: [
|
|
305
|
-
/* @__PURE__ */
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ o("path", { d: "M16 5H3" }),
|
|
306
|
+
/* @__PURE__ */ o("path", { d: "M16 12H3" }),
|
|
307
|
+
/* @__PURE__ */ o("path", { d: "M16 19H3" }),
|
|
308
|
+
/* @__PURE__ */ o("path", { d: "M21 5h.01" }),
|
|
309
|
+
/* @__PURE__ */ o("path", { d: "M21 12h.01" }),
|
|
310
|
+
/* @__PURE__ */ o("path", { d: "M21 19h.01" })
|
|
311
311
|
]
|
|
312
312
|
}
|
|
313
|
-
),
|
|
313
|
+
), Pe = ({ size: e = $.size, className: t }) => /* @__PURE__ */ L(
|
|
314
314
|
"svg",
|
|
315
315
|
{
|
|
316
316
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -325,314 +325,537 @@ const oe = ({
|
|
|
325
325
|
className: t,
|
|
326
326
|
"aria-hidden": "true",
|
|
327
327
|
children: [
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
/* @__PURE__ */
|
|
332
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ o("path", { d: "M3 21h18" }),
|
|
329
|
+
/* @__PURE__ */ o("rect", { x: "4", y: "7", width: "3", height: "14", rx: "0.5" }),
|
|
330
|
+
/* @__PURE__ */ o("rect", { x: "8", y: "5", width: "3", height: "16", rx: "0.5" }),
|
|
331
|
+
/* @__PURE__ */ o("rect", { x: "12", y: "9", width: "3", height: "12", rx: "0.5" }),
|
|
332
|
+
/* @__PURE__ */ o("rect", { x: "16", y: "6", width: "4", height: "15", rx: "0.5" })
|
|
333
333
|
]
|
|
334
334
|
}
|
|
335
|
-
),
|
|
335
|
+
), fe = ({ size: e = $.size, className: t }) => /* @__PURE__ */ L(
|
|
336
|
+
"svg",
|
|
337
|
+
{
|
|
338
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
339
|
+
width: e,
|
|
340
|
+
height: e,
|
|
341
|
+
viewBox: "0 0 24 24",
|
|
342
|
+
fill: "none",
|
|
343
|
+
stroke: "currentColor",
|
|
344
|
+
strokeWidth: "2",
|
|
345
|
+
strokeLinecap: "round",
|
|
346
|
+
strokeLinejoin: "round",
|
|
347
|
+
className: t,
|
|
348
|
+
"aria-hidden": "true",
|
|
349
|
+
children: [
|
|
350
|
+
/* @__PURE__ */ o("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
|
|
351
|
+
/* @__PURE__ */ o("polyline", { points: "7 10 12 15 17 10" }),
|
|
352
|
+
/* @__PURE__ */ o("line", { x1: "12", x2: "12", y1: "15", y2: "3" })
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
), z = ({
|
|
336
356
|
onClick: e,
|
|
337
357
|
ariaLabel: t,
|
|
338
|
-
disabled:
|
|
339
|
-
children:
|
|
340
|
-
className:
|
|
341
|
-
title:
|
|
342
|
-
}) => /* @__PURE__ */
|
|
358
|
+
disabled: n = !1,
|
|
359
|
+
children: r,
|
|
360
|
+
className: i = "",
|
|
361
|
+
title: d
|
|
362
|
+
}) => /* @__PURE__ */ o(
|
|
343
363
|
"button",
|
|
344
364
|
{
|
|
345
365
|
type: "button",
|
|
346
366
|
onClick: e,
|
|
347
367
|
"aria-label": t,
|
|
348
|
-
disabled:
|
|
349
|
-
title:
|
|
350
|
-
className: `flipbook-toolbar-button ${
|
|
351
|
-
children:
|
|
368
|
+
disabled: n,
|
|
369
|
+
title: d ?? t,
|
|
370
|
+
className: `flipbook-toolbar-button ${i}`.trim(),
|
|
371
|
+
children: r
|
|
352
372
|
}
|
|
353
|
-
),
|
|
373
|
+
), Ce = ({
|
|
354
374
|
onClick: e,
|
|
355
375
|
ariaLabel: t,
|
|
356
|
-
children:
|
|
357
|
-
disabled:
|
|
358
|
-
className:
|
|
359
|
-
}) => /* @__PURE__ */
|
|
360
|
-
|
|
376
|
+
children: n,
|
|
377
|
+
disabled: r = !1,
|
|
378
|
+
className: i
|
|
379
|
+
}) => /* @__PURE__ */ o(
|
|
380
|
+
z,
|
|
361
381
|
{
|
|
362
382
|
onClick: e,
|
|
363
383
|
ariaLabel: t,
|
|
364
|
-
disabled:
|
|
365
|
-
className: `flipbook-toolbar-action ${
|
|
366
|
-
children:
|
|
384
|
+
disabled: r,
|
|
385
|
+
className: `flipbook-toolbar-action ${i ?? ""}`.trim(),
|
|
386
|
+
children: n
|
|
367
387
|
}
|
|
368
|
-
),
|
|
369
|
-
|
|
370
|
-
|
|
388
|
+
), X = {
|
|
389
|
+
en: {
|
|
390
|
+
"toolbar.download": "Download",
|
|
391
|
+
"toolbar.downloadEntireBook": "Download entire book",
|
|
392
|
+
"toolbar.downloadPageRange": "Download page range…",
|
|
393
|
+
"toolbar.toc": "Table of contents",
|
|
394
|
+
"toolbar.firstPage": "First page",
|
|
395
|
+
"toolbar.lastPage": "Last page",
|
|
396
|
+
"toolbar.prevPage": "Previous page",
|
|
397
|
+
"toolbar.nextPage": "Next page",
|
|
398
|
+
"toolbar.goToPage": "Go to page",
|
|
399
|
+
"download.from": "From",
|
|
400
|
+
"download.to": "To",
|
|
401
|
+
"download.download": "Download"
|
|
402
|
+
},
|
|
403
|
+
"he-IL": {
|
|
404
|
+
"toolbar.download": "הורדה",
|
|
405
|
+
"toolbar.downloadEntireBook": "הורד את כל הספר",
|
|
406
|
+
"toolbar.downloadPageRange": "הורד טווח עמודים…",
|
|
407
|
+
"toolbar.toc": "תוכן העניינים",
|
|
408
|
+
"toolbar.firstPage": "עמוד ראשון",
|
|
409
|
+
"toolbar.lastPage": "עמוד אחרון",
|
|
410
|
+
"toolbar.prevPage": "עמוד קודם",
|
|
411
|
+
"toolbar.nextPage": "עמוד הבא",
|
|
412
|
+
"toolbar.goToPage": "מעבר לעמוד",
|
|
413
|
+
"download.from": "מ",
|
|
414
|
+
"download.to": "עד",
|
|
415
|
+
"download.download": "הורד"
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
function D(e, t = "en") {
|
|
419
|
+
return X[t]?.[e] ?? X.en[e] ?? e;
|
|
420
|
+
}
|
|
421
|
+
function pe(e) {
|
|
422
|
+
return e === "he-IL";
|
|
423
|
+
}
|
|
424
|
+
const ee = _(null);
|
|
425
|
+
function S() {
|
|
426
|
+
const e = Q(ee);
|
|
371
427
|
if (!e)
|
|
372
428
|
throw new Error("Toolbar components must be used within a Toolbar");
|
|
373
429
|
return e;
|
|
374
430
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
431
|
+
function Y(e, t) {
|
|
432
|
+
try {
|
|
433
|
+
const n = atob(e.data), r = new Uint8Array(n.length);
|
|
434
|
+
for (let m = 0; m < n.length; m++)
|
|
435
|
+
r[m] = n.charCodeAt(m);
|
|
436
|
+
const i = new Blob([r]), d = URL.createObjectURL(i), g = document.createElement("a");
|
|
437
|
+
g.href = d, g.download = `${t}.${e.ext}`, g.click(), URL.revokeObjectURL(d);
|
|
438
|
+
} catch (n) {
|
|
439
|
+
console.error("Download failed:", n);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
function be(e, t) {
|
|
443
|
+
const n = [];
|
|
444
|
+
for (let r = 0; r < e; r++) {
|
|
445
|
+
const i = t?.indexToSemanticName(r) ?? String(r + 1), d = t?.indexToTitle(r) ?? `Page ${r + 1}`;
|
|
446
|
+
n.push({ pageIndex: r, semanticName: i, title: d });
|
|
447
|
+
}
|
|
448
|
+
return n;
|
|
449
|
+
}
|
|
450
|
+
const ye = ({
|
|
451
|
+
onDownloadSefer: e,
|
|
452
|
+
onDownloadPageRange: t,
|
|
453
|
+
downloadContext: n,
|
|
454
|
+
ariaLabel: r = "Download",
|
|
455
|
+
entireBookFilename: i = "book",
|
|
456
|
+
rangeFilename: d = "pages",
|
|
457
|
+
className: g
|
|
458
|
+
}) => {
|
|
459
|
+
const { totalPages: m, pageSemantics: c, locale: p } = S(), [h, P] = C(!1), [y, N] = C(!1), [x, E] = C(0), [a, l] = C(0), [b, v] = C(null), [I, R] = C(!1), k = K(null), H = K(null), B = be(m, c), j = !!e, A = !!t, q = j || A, F = w(() => {
|
|
460
|
+
P(!1), N(!1);
|
|
461
|
+
}, []);
|
|
462
|
+
ne(() => {
|
|
463
|
+
if (!h || !H.current || !k.current) return;
|
|
464
|
+
const s = H.current, M = k.current.querySelector(".flipbook-toolbar-download-trigger"), U = () => {
|
|
465
|
+
const f = M?.getBoundingClientRect();
|
|
466
|
+
if (!f) return;
|
|
467
|
+
const T = s.getBoundingClientRect().height, te = window.innerHeight - f.bottom;
|
|
468
|
+
R(te < T + 8);
|
|
469
|
+
};
|
|
470
|
+
U();
|
|
471
|
+
const u = new ResizeObserver(U);
|
|
472
|
+
return u.observe(s), () => u.disconnect();
|
|
473
|
+
}, [h]), W(() => {
|
|
474
|
+
if (!h) return;
|
|
475
|
+
const s = (M) => {
|
|
476
|
+
k.current && !k.current.contains(M.target) && F();
|
|
477
|
+
};
|
|
478
|
+
return document.addEventListener("mousedown", s), () => document.removeEventListener("mousedown", s);
|
|
479
|
+
}, [h, F]);
|
|
480
|
+
const O = w(async () => {
|
|
481
|
+
if (e) {
|
|
482
|
+
v("sefer");
|
|
483
|
+
try {
|
|
484
|
+
const s = await e();
|
|
485
|
+
s && Y(s, i), F();
|
|
486
|
+
} finally {
|
|
487
|
+
v(null);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}, [e, i, F]), V = w(() => {
|
|
491
|
+
E(0), l(Math.max(0, m - 1)), N(!0), P(!0);
|
|
492
|
+
}, [m]), G = w(async () => {
|
|
493
|
+
if (!t) return;
|
|
494
|
+
const s = Math.min(x, a), M = Math.max(x, a), U = [], u = [];
|
|
495
|
+
for (let f = s; f <= M; f++) {
|
|
496
|
+
U.push(f);
|
|
497
|
+
const T = B[f];
|
|
498
|
+
T && u.push(T);
|
|
499
|
+
}
|
|
500
|
+
v("range");
|
|
501
|
+
try {
|
|
502
|
+
const f = await t(U, u, n);
|
|
503
|
+
f && Y(f, `${d}-${s + 1}-${M + 1}`), F();
|
|
504
|
+
} finally {
|
|
505
|
+
v(null);
|
|
506
|
+
}
|
|
507
|
+
}, [
|
|
508
|
+
t,
|
|
509
|
+
x,
|
|
510
|
+
a,
|
|
511
|
+
B,
|
|
512
|
+
n,
|
|
513
|
+
d,
|
|
514
|
+
F
|
|
515
|
+
]);
|
|
516
|
+
return q ? /* @__PURE__ */ L("div", { className: `flipbook-toolbar-download-wrap ${g ?? ""}`.trim(), ref: k, children: [
|
|
517
|
+
/* @__PURE__ */ o(
|
|
518
|
+
"button",
|
|
519
|
+
{
|
|
520
|
+
type: "button",
|
|
521
|
+
className: "flipbook-toolbar-button flipbook-toolbar-download-trigger",
|
|
522
|
+
onClick: () => P((s) => !s),
|
|
523
|
+
"aria-label": r ?? D("toolbar.download", p),
|
|
524
|
+
"aria-expanded": h,
|
|
525
|
+
"aria-haspopup": "true",
|
|
526
|
+
disabled: b !== null,
|
|
527
|
+
children: /* @__PURE__ */ o(fe, { size: 18 })
|
|
528
|
+
}
|
|
529
|
+
),
|
|
530
|
+
h && /* @__PURE__ */ L(
|
|
531
|
+
"div",
|
|
532
|
+
{
|
|
533
|
+
ref: H,
|
|
534
|
+
className: `flipbook-toolbar-download-menu ${I ? "flipbook-toolbar-download-menu--open-up" : ""}`.trim(),
|
|
535
|
+
role: "menu",
|
|
536
|
+
dir: pe(p) ? "rtl" : "ltr",
|
|
537
|
+
children: [
|
|
538
|
+
j && /* @__PURE__ */ o(
|
|
539
|
+
"button",
|
|
540
|
+
{
|
|
541
|
+
type: "button",
|
|
542
|
+
role: "menuitem",
|
|
543
|
+
className: "flipbook-toolbar-download-menuitem",
|
|
544
|
+
onClick: O,
|
|
545
|
+
disabled: b !== null,
|
|
546
|
+
children: b === "sefer" ? "…" : D("toolbar.downloadEntireBook", p)
|
|
547
|
+
}
|
|
548
|
+
),
|
|
549
|
+
A && /* @__PURE__ */ L(oe, { children: [
|
|
550
|
+
/* @__PURE__ */ o(
|
|
551
|
+
"button",
|
|
552
|
+
{
|
|
553
|
+
type: "button",
|
|
554
|
+
role: "menuitem",
|
|
555
|
+
className: "flipbook-toolbar-download-menuitem",
|
|
556
|
+
onClick: V,
|
|
557
|
+
disabled: b !== null,
|
|
558
|
+
children: D("toolbar.downloadPageRange", p)
|
|
559
|
+
}
|
|
560
|
+
),
|
|
561
|
+
y && /* @__PURE__ */ L("div", { className: "flipbook-toolbar-download-range", children: [
|
|
562
|
+
/* @__PURE__ */ L("label", { className: "flipbook-toolbar-download-range-label", children: [
|
|
563
|
+
D("download.from", p),
|
|
564
|
+
/* @__PURE__ */ o(
|
|
565
|
+
"select",
|
|
566
|
+
{
|
|
567
|
+
value: x,
|
|
568
|
+
onChange: (s) => E(Number(s.target.value)),
|
|
569
|
+
className: "flipbook-toolbar-download-range-select",
|
|
570
|
+
children: B.map((s) => /* @__PURE__ */ o("option", { value: s.pageIndex, children: s.semanticName || s.title || `Page ${s.pageIndex + 1}` }, s.pageIndex))
|
|
571
|
+
}
|
|
572
|
+
)
|
|
573
|
+
] }),
|
|
574
|
+
/* @__PURE__ */ L("label", { className: "flipbook-toolbar-download-range-label", children: [
|
|
575
|
+
D("download.to", p),
|
|
576
|
+
/* @__PURE__ */ o(
|
|
577
|
+
"select",
|
|
578
|
+
{
|
|
579
|
+
value: a,
|
|
580
|
+
onChange: (s) => l(Number(s.target.value)),
|
|
581
|
+
className: "flipbook-toolbar-download-range-select",
|
|
582
|
+
children: B.map((s) => /* @__PURE__ */ o("option", { value: s.pageIndex, children: s.semanticName || s.title || `Page ${s.pageIndex + 1}` }, s.pageIndex))
|
|
583
|
+
}
|
|
584
|
+
)
|
|
585
|
+
] }),
|
|
586
|
+
/* @__PURE__ */ o(
|
|
587
|
+
"button",
|
|
588
|
+
{
|
|
589
|
+
type: "button",
|
|
590
|
+
className: "flipbook-toolbar-download-range-download",
|
|
591
|
+
onClick: G,
|
|
592
|
+
disabled: b !== null,
|
|
593
|
+
children: b === "range" ? "…" : D("download.download", p)
|
|
594
|
+
}
|
|
595
|
+
)
|
|
596
|
+
] })
|
|
597
|
+
] })
|
|
598
|
+
]
|
|
599
|
+
}
|
|
600
|
+
)
|
|
601
|
+
] }) : null;
|
|
602
|
+
}, Le = ({ children: e, className: t }) => {
|
|
603
|
+
const { flipBookRef: n, isFirstPage: r } = S(), i = () => {
|
|
604
|
+
n.current?.jumpToPage(0);
|
|
605
|
+
}, d = /* @__PURE__ */ o(de, { size: 18 });
|
|
606
|
+
return /* @__PURE__ */ o(
|
|
607
|
+
z,
|
|
381
608
|
{
|
|
382
|
-
onClick:
|
|
609
|
+
onClick: i,
|
|
383
610
|
ariaLabel: "First page",
|
|
384
|
-
disabled:
|
|
611
|
+
disabled: r,
|
|
385
612
|
className: `flipbook-toolbar-first ${t ?? ""}`.trim(),
|
|
386
|
-
children: e ??
|
|
613
|
+
children: e ?? d
|
|
387
614
|
}
|
|
388
615
|
);
|
|
389
|
-
},
|
|
616
|
+
}, Te = ({
|
|
390
617
|
targetRef: e,
|
|
391
618
|
enterIcon: t,
|
|
392
|
-
exitIcon:
|
|
393
|
-
ariaLabelEnter:
|
|
394
|
-
ariaLabelExit:
|
|
395
|
-
className:
|
|
619
|
+
exitIcon: n,
|
|
620
|
+
ariaLabelEnter: r = "Enter fullscreen",
|
|
621
|
+
ariaLabelExit: i = "Exit fullscreen",
|
|
622
|
+
className: d
|
|
396
623
|
}) => {
|
|
397
|
-
const [
|
|
398
|
-
|
|
624
|
+
const [g, m] = C(!1), c = w(() => {
|
|
625
|
+
m(!!document.fullscreenElement);
|
|
399
626
|
}, []);
|
|
400
|
-
|
|
401
|
-
document.removeEventListener("fullscreenchange",
|
|
402
|
-
}), [
|
|
403
|
-
const
|
|
627
|
+
W(() => (document.addEventListener("fullscreenchange", c), () => {
|
|
628
|
+
document.removeEventListener("fullscreenchange", c);
|
|
629
|
+
}), [c]);
|
|
630
|
+
const p = async () => {
|
|
404
631
|
try {
|
|
405
|
-
|
|
406
|
-
} catch (
|
|
407
|
-
console.warn("Fullscreen request failed:",
|
|
632
|
+
g ? await document.exitFullscreen() : await (e?.current ?? document.documentElement).requestFullscreen();
|
|
633
|
+
} catch (y) {
|
|
634
|
+
console.warn("Fullscreen request failed:", y);
|
|
408
635
|
}
|
|
409
|
-
},
|
|
410
|
-
return /* @__PURE__ */
|
|
411
|
-
|
|
636
|
+
}, h = g ? i : r, P = g ? n ?? /* @__PURE__ */ o(he, { size: 18 }) : t ?? /* @__PURE__ */ o(ge, { size: 18 });
|
|
637
|
+
return /* @__PURE__ */ o(
|
|
638
|
+
z,
|
|
412
639
|
{
|
|
413
|
-
onClick:
|
|
414
|
-
ariaLabel:
|
|
415
|
-
className: `flipbook-toolbar-fullscreen ${
|
|
416
|
-
children:
|
|
640
|
+
onClick: p,
|
|
641
|
+
ariaLabel: h,
|
|
642
|
+
className: `flipbook-toolbar-fullscreen ${g ? "flipbook-toolbar-fullscreen--active" : ""} ${d ?? ""}`.trim(),
|
|
643
|
+
children: P
|
|
417
644
|
}
|
|
418
645
|
);
|
|
419
|
-
},
|
|
420
|
-
const { flipBookRef:
|
|
421
|
-
|
|
422
|
-
}, g =
|
|
423
|
-
return /* @__PURE__ */
|
|
424
|
-
|
|
646
|
+
}, Ne = ({ children: e, className: t }) => {
|
|
647
|
+
const { flipBookRef: n, isLastPage: r, totalPages: i } = S(), d = () => {
|
|
648
|
+
n.current?.jumpToPage(i - 1);
|
|
649
|
+
}, g = /* @__PURE__ */ o(ue, { size: 18 });
|
|
650
|
+
return /* @__PURE__ */ o(
|
|
651
|
+
z,
|
|
425
652
|
{
|
|
426
|
-
onClick:
|
|
653
|
+
onClick: d,
|
|
427
654
|
ariaLabel: "Last page",
|
|
428
|
-
disabled:
|
|
655
|
+
disabled: r,
|
|
429
656
|
className: `flipbook-toolbar-last ${t ?? ""}`.trim(),
|
|
430
657
|
children: e ?? g
|
|
431
658
|
}
|
|
432
659
|
);
|
|
433
|
-
},
|
|
434
|
-
const { flipBookRef:
|
|
435
|
-
|
|
436
|
-
},
|
|
437
|
-
return /* @__PURE__ */
|
|
438
|
-
|
|
660
|
+
}, Ee = ({ children: e, className: t }) => {
|
|
661
|
+
const { flipBookRef: n, isLastPage: r, direction: i } = S(), d = () => {
|
|
662
|
+
n.current?.flipNext();
|
|
663
|
+
}, g = i === "rtl" ? "Previous page" : "Next page", m = /* @__PURE__ */ o(ce, { size: 20 });
|
|
664
|
+
return /* @__PURE__ */ o(
|
|
665
|
+
z,
|
|
439
666
|
{
|
|
440
|
-
onClick:
|
|
441
|
-
ariaLabel:
|
|
442
|
-
disabled:
|
|
667
|
+
onClick: d,
|
|
668
|
+
ariaLabel: g,
|
|
669
|
+
disabled: r,
|
|
443
670
|
className: `flipbook-toolbar-next ${t ?? ""}`.trim(),
|
|
444
|
-
children: e ??
|
|
671
|
+
children: e ?? m
|
|
445
672
|
}
|
|
446
673
|
);
|
|
447
|
-
},
|
|
674
|
+
}, Ie = ({
|
|
448
675
|
mode: e,
|
|
449
676
|
showTotal: t = !0,
|
|
450
|
-
placeholder:
|
|
451
|
-
editable:
|
|
452
|
-
className:
|
|
453
|
-
ariaLabel:
|
|
454
|
-
maxLength:
|
|
677
|
+
placeholder: n = "—",
|
|
678
|
+
editable: r,
|
|
679
|
+
className: i,
|
|
680
|
+
ariaLabel: d = "Go to page",
|
|
681
|
+
maxLength: g = 10
|
|
455
682
|
}) => {
|
|
456
|
-
const { flipBookRef:
|
|
457
|
-
(
|
|
458
|
-
[
|
|
459
|
-
),
|
|
460
|
-
|
|
461
|
-
for (let c = p - 1; c >= 0; c--) {
|
|
462
|
-
const v = r.indexToSemanticName(c);
|
|
463
|
-
if (v) return v;
|
|
464
|
-
}
|
|
465
|
-
return String(p);
|
|
466
|
-
}
|
|
467
|
-
return String(p);
|
|
468
|
-
}, [k, r, p]), X = f(() => {
|
|
469
|
-
const c = x === "rtl" ? B : I, v = x === "rtl" ? I : B;
|
|
683
|
+
const { flipBookRef: m, pageSemantics: c, direction: p, currentPage: h, totalPages: P, of: y } = S(), N = e ?? (c ? "semantic" : "index"), x = r ?? (N === "semantic" && !!c), [E, a] = C(""), [l, b] = C(!1), v = K(!1), I = K(h), R = h, k = h + 1 < P ? h + 1 : null, H = w(
|
|
684
|
+
(u) => N === "semantic" && c ? c.indexToSemanticName(u) || "" : String(u + 1),
|
|
685
|
+
[N, c]
|
|
686
|
+
), B = H(R), j = k != null ? H(k) : "", A = w(() => String(y), [y]), q = w(() => {
|
|
687
|
+
const u = B, f = j;
|
|
470
688
|
let T;
|
|
471
|
-
return !
|
|
472
|
-
}, [
|
|
473
|
-
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
}, [
|
|
477
|
-
const
|
|
478
|
-
(
|
|
479
|
-
|
|
689
|
+
return !u && !f ? T = n : u ? f ? u === f ? T = u : T = `${u} - ${f}` : T = u : T = f, t ? `${T} / ${A()}` : T;
|
|
690
|
+
}, [B, j, n, t, A]), F = p === "rtl" ? j || B : B || j, O = q();
|
|
691
|
+
W(() => {
|
|
692
|
+
const u = h !== I.current;
|
|
693
|
+
I.current = h, u && (v.current = !1), !l && !v.current && a(O);
|
|
694
|
+
}, [O, l, h]);
|
|
695
|
+
const V = w(
|
|
696
|
+
(u) => {
|
|
697
|
+
x && (b(!0), a(F), v.current = !1, requestAnimationFrame(() => u.target.select()));
|
|
480
698
|
},
|
|
481
|
-
[
|
|
482
|
-
),
|
|
483
|
-
|
|
484
|
-
}, [
|
|
485
|
-
(
|
|
486
|
-
if (
|
|
487
|
-
if (
|
|
488
|
-
const
|
|
489
|
-
|
|
699
|
+
[x, F]
|
|
700
|
+
), G = w(() => {
|
|
701
|
+
b(!1), v.current || a(O);
|
|
702
|
+
}, [O]), s = w(
|
|
703
|
+
(u) => {
|
|
704
|
+
if (u.key === "Enter") {
|
|
705
|
+
if (c && E.trim()) {
|
|
706
|
+
const f = c.semanticNameToIndex(E.trim());
|
|
707
|
+
f != null && f >= 0 && f < P && (m.current?.jumpToPage(f), v.current = !0);
|
|
490
708
|
}
|
|
491
|
-
|
|
492
|
-
} else
|
|
709
|
+
u.currentTarget.blur();
|
|
710
|
+
} else u.key === "Escape" && u.currentTarget.blur();
|
|
493
711
|
},
|
|
494
|
-
[
|
|
495
|
-
),
|
|
496
|
-
|
|
712
|
+
[E, c, P, m]
|
|
713
|
+
), M = w((u) => {
|
|
714
|
+
a(u.target.value);
|
|
497
715
|
}, []);
|
|
498
|
-
return
|
|
716
|
+
return x ? /* @__PURE__ */ o(
|
|
499
717
|
"input",
|
|
500
718
|
{
|
|
501
719
|
type: "text",
|
|
502
|
-
className: `flipbook-toolbar-indicator ${
|
|
503
|
-
value:
|
|
504
|
-
onFocus:
|
|
505
|
-
onBlur:
|
|
506
|
-
onKeyDown:
|
|
507
|
-
onChange:
|
|
508
|
-
"aria-label":
|
|
720
|
+
className: `flipbook-toolbar-indicator ${l ? "flipbook-toolbar-indicator--editing" : ""} ${i ?? ""}`.trim(),
|
|
721
|
+
value: E,
|
|
722
|
+
onFocus: V,
|
|
723
|
+
onBlur: G,
|
|
724
|
+
onKeyDown: s,
|
|
725
|
+
onChange: M,
|
|
726
|
+
"aria-label": d,
|
|
509
727
|
"aria-live": "polite",
|
|
510
728
|
"aria-atomic": "true",
|
|
511
|
-
maxLength:
|
|
512
|
-
readOnly: !
|
|
729
|
+
maxLength: g,
|
|
730
|
+
readOnly: !x
|
|
513
731
|
}
|
|
514
|
-
) : /* @__PURE__ */
|
|
732
|
+
) : /* @__PURE__ */ o(
|
|
515
733
|
"span",
|
|
516
734
|
{
|
|
517
|
-
className: `flipbook-toolbar-indicator ${
|
|
735
|
+
className: `flipbook-toolbar-indicator ${i ?? ""}`.trim(),
|
|
518
736
|
"aria-live": "polite",
|
|
519
737
|
"aria-atomic": "true",
|
|
520
|
-
children:
|
|
738
|
+
children: O
|
|
521
739
|
}
|
|
522
740
|
);
|
|
523
|
-
},
|
|
524
|
-
const { flipBookRef:
|
|
525
|
-
|
|
526
|
-
},
|
|
527
|
-
return /* @__PURE__ */
|
|
528
|
-
|
|
741
|
+
}, Be = ({ children: e, className: t }) => {
|
|
742
|
+
const { flipBookRef: n, isFirstPage: r, direction: i } = S(), d = () => {
|
|
743
|
+
n.current?.flipPrev();
|
|
744
|
+
}, g = i === "rtl" ? "Next page" : "Previous page", m = /* @__PURE__ */ o(ie, { size: 20 });
|
|
745
|
+
return /* @__PURE__ */ o(
|
|
746
|
+
z,
|
|
529
747
|
{
|
|
530
|
-
onClick:
|
|
531
|
-
ariaLabel:
|
|
532
|
-
disabled:
|
|
748
|
+
onClick: d,
|
|
749
|
+
ariaLabel: g,
|
|
750
|
+
disabled: r,
|
|
533
751
|
className: `flipbook-toolbar-prev ${t ?? ""}`.trim(),
|
|
534
|
-
children: e ??
|
|
752
|
+
children: e ?? m
|
|
535
753
|
}
|
|
536
754
|
);
|
|
537
|
-
},
|
|
755
|
+
}, Fe = ({
|
|
538
756
|
tocPageIndex: e = 4,
|
|
539
757
|
children: t,
|
|
540
|
-
ariaLabel:
|
|
541
|
-
className:
|
|
758
|
+
ariaLabel: n,
|
|
759
|
+
className: r
|
|
542
760
|
}) => {
|
|
543
|
-
const { flipBookRef:
|
|
544
|
-
return /* @__PURE__ */
|
|
545
|
-
|
|
761
|
+
const { flipBookRef: i, currentPage: d, locale: g } = S(), m = n ?? D("toolbar.toc", g);
|
|
762
|
+
return /* @__PURE__ */ o(
|
|
763
|
+
z,
|
|
546
764
|
{
|
|
547
765
|
onClick: () => {
|
|
548
|
-
|
|
766
|
+
i.current?.goToPage(e);
|
|
549
767
|
},
|
|
550
|
-
ariaLabel:
|
|
551
|
-
disabled:
|
|
552
|
-
className: `flipbook-toolbar-toc ${
|
|
553
|
-
children: t ?? /* @__PURE__ */
|
|
768
|
+
ariaLabel: m,
|
|
769
|
+
disabled: d === e,
|
|
770
|
+
className: `flipbook-toolbar-toc ${r ?? ""}`.trim(),
|
|
771
|
+
children: t ?? /* @__PURE__ */ o(me, { size: 18 })
|
|
554
772
|
}
|
|
555
773
|
);
|
|
556
|
-
},
|
|
774
|
+
}, $e = ({
|
|
557
775
|
flipBookRef: e,
|
|
558
776
|
direction: t = "ltr",
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
777
|
+
locale: n,
|
|
778
|
+
pageSemantics: r,
|
|
779
|
+
className: i = "",
|
|
780
|
+
children: d,
|
|
781
|
+
enableHotkeys: g = !0,
|
|
782
|
+
commands: m,
|
|
783
|
+
commandOptions: c
|
|
565
784
|
}) => {
|
|
566
|
-
const [
|
|
567
|
-
const
|
|
568
|
-
|
|
785
|
+
const p = n ?? (t === "rtl" ? "he-IL" : "en"), [h, P] = C(0), [y, N] = C(0), [x, E] = C(0), [a, l] = C(!0), [b, v] = C(!1), I = w(() => {
|
|
786
|
+
const k = e.current;
|
|
787
|
+
k && (P(k.getCurrentPageIndex()), N(k.getTotalPages()), E(k.getOf()), l(k.isFirstPage()), v(k.isLastPage()));
|
|
569
788
|
}, [e]);
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
const
|
|
573
|
-
return () => clearInterval(
|
|
574
|
-
}, [
|
|
575
|
-
const
|
|
576
|
-
|
|
789
|
+
W(() => {
|
|
790
|
+
I();
|
|
791
|
+
const k = setInterval(I, 200);
|
|
792
|
+
return () => clearInterval(k);
|
|
793
|
+
}, [I]);
|
|
794
|
+
const R = /* @__PURE__ */ o(
|
|
795
|
+
ee.Provider,
|
|
577
796
|
{
|
|
578
797
|
value: {
|
|
579
798
|
flipBookRef: e,
|
|
580
799
|
direction: t,
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
800
|
+
locale: p,
|
|
801
|
+
pageSemantics: r,
|
|
802
|
+
currentPage: h,
|
|
803
|
+
totalPages: y,
|
|
804
|
+
of: x,
|
|
805
|
+
isFirstPage: a,
|
|
806
|
+
isLastPage: b
|
|
586
807
|
},
|
|
587
|
-
children: /* @__PURE__ */
|
|
808
|
+
children: /* @__PURE__ */ o(
|
|
588
809
|
"div",
|
|
589
810
|
{
|
|
590
|
-
className: `flipbook-toolbar ${
|
|
811
|
+
className: `flipbook-toolbar ${t === "rtl" ? "flipbook-toolbar--rtl" : ""} ${i}`.trim(),
|
|
591
812
|
role: "toolbar",
|
|
592
813
|
"aria-label": "FlipBook navigation",
|
|
593
814
|
dir: t,
|
|
594
|
-
children:
|
|
815
|
+
children: d
|
|
595
816
|
}
|
|
596
817
|
)
|
|
597
818
|
}
|
|
598
819
|
);
|
|
599
|
-
return /* @__PURE__ */
|
|
600
|
-
|
|
820
|
+
return /* @__PURE__ */ o(
|
|
821
|
+
se,
|
|
601
822
|
{
|
|
602
823
|
flipBookRef: e,
|
|
603
|
-
currentPage:
|
|
604
|
-
totalPages:
|
|
824
|
+
currentPage: h,
|
|
825
|
+
totalPages: y,
|
|
605
826
|
direction: t,
|
|
606
|
-
commands:
|
|
607
|
-
commandOptions:
|
|
608
|
-
disableHotkeys: !
|
|
609
|
-
children:
|
|
827
|
+
commands: m,
|
|
828
|
+
commandOptions: c,
|
|
829
|
+
disableHotkeys: !g,
|
|
830
|
+
children: R
|
|
610
831
|
}
|
|
611
832
|
);
|
|
612
833
|
};
|
|
613
834
|
export {
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
835
|
+
Ce as ActionButton,
|
|
836
|
+
Pe as BookshelfIcon,
|
|
837
|
+
de as ChevronFirstIcon,
|
|
838
|
+
ue as ChevronLastIcon,
|
|
839
|
+
ie as ChevronLeftIcon,
|
|
840
|
+
ce as ChevronRightIcon,
|
|
841
|
+
re as DEFAULT_HOTKEYS,
|
|
842
|
+
ye as DownloadDropdown,
|
|
843
|
+
fe as DownloadIcon,
|
|
844
|
+
Le as FirstPageButton,
|
|
845
|
+
Te as FullscreenButton,
|
|
846
|
+
Ne as LastPageButton,
|
|
847
|
+
ge as MaximizeIcon,
|
|
848
|
+
he as MinimizeIcon,
|
|
849
|
+
Ee as NextButton,
|
|
850
|
+
Ie as PageIndicator,
|
|
851
|
+
Be as PrevButton,
|
|
852
|
+
Ie as SemanticPageIndicator,
|
|
853
|
+
me as TableOfContentsIcon,
|
|
854
|
+
Fe as TocButton,
|
|
855
|
+
$e as Toolbar,
|
|
856
|
+
z as ToolbarButton,
|
|
857
|
+
ae as defaultCommands,
|
|
858
|
+
ve as useCommands,
|
|
859
|
+
S as useToolbar
|
|
637
860
|
};
|
|
638
861
|
//# sourceMappingURL=index.js.map
|