aksos-react-native-epub-reader 0.0.0-stage → 0.1.1

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.
Files changed (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +351 -2
  3. package/lib/EpubReader.d.ts +76 -0
  4. package/lib/EpubReader.js +284 -0
  5. package/lib/EpubReaderView.d.ts +31 -0
  6. package/lib/EpubReaderView.js +599 -0
  7. package/lib/assets/page-turn-1.wav +0 -0
  8. package/lib/assets/page-turn-2.wav +0 -0
  9. package/lib/assets/page-turn-3.wav +0 -0
  10. package/lib/assets/page-turn-4.wav +0 -0
  11. package/lib/engine/html.d.ts +1 -0
  12. package/lib/engine/html.js +5 -0
  13. package/lib/index.d.ts +9 -0
  14. package/lib/index.js +34 -0
  15. package/lib/sound.d.ts +1 -0
  16. package/lib/sound.js +71 -0
  17. package/lib/strings.d.ts +94 -0
  18. package/lib/strings.js +96 -0
  19. package/lib/themes.d.ts +60 -0
  20. package/lib/themes.js +166 -0
  21. package/lib/types.d.ts +149 -0
  22. package/lib/types.js +2 -0
  23. package/lib/ui/AppearanceSheet.d.ts +15 -0
  24. package/lib/ui/AppearanceSheet.js +134 -0
  25. package/lib/ui/ContentsSheet.d.ts +27 -0
  26. package/lib/ui/ContentsSheet.js +89 -0
  27. package/lib/ui/CustomizeSheet.d.ts +16 -0
  28. package/lib/ui/CustomizeSheet.js +141 -0
  29. package/lib/ui/Glass.d.ts +15 -0
  30. package/lib/ui/Glass.js +27 -0
  31. package/lib/ui/HighlightMenu.d.ts +25 -0
  32. package/lib/ui/HighlightMenu.js +45 -0
  33. package/lib/ui/Icons.d.ts +17 -0
  34. package/lib/ui/Icons.js +193 -0
  35. package/lib/ui/LineGuide.d.ts +21 -0
  36. package/lib/ui/LineGuide.js +92 -0
  37. package/lib/ui/NoteEditor.d.ts +12 -0
  38. package/lib/ui/NoteEditor.js +63 -0
  39. package/lib/ui/Scrubber.d.ts +15 -0
  40. package/lib/ui/Scrubber.js +86 -0
  41. package/lib/ui/SearchSheet.d.ts +14 -0
  42. package/lib/ui/SearchSheet.js +79 -0
  43. package/lib/ui/Sheet.d.ts +19 -0
  44. package/lib/ui/Sheet.js +40 -0
  45. package/lib/ui/Slider.d.ts +14 -0
  46. package/lib/ui/Slider.js +53 -0
  47. package/package.json +76 -6
  48. package/src/EpubReader.tsx +356 -0
  49. package/src/EpubReaderView.tsx +865 -0
  50. package/src/assets/page-turn-1.wav +0 -0
  51. package/src/assets/page-turn-2.wav +0 -0
  52. package/src/assets/page-turn-3.wav +0 -0
  53. package/src/assets/page-turn-4.wav +0 -0
  54. package/src/engine/html.ts +2 -0
  55. package/src/engine/reader.js +2047 -0
  56. package/src/index.ts +9 -0
  57. package/src/sound.ts +66 -0
  58. package/src/strings.ts +187 -0
  59. package/src/themes.ts +188 -0
  60. package/src/types.ts +154 -0
  61. package/src/ui/AppearanceSheet.tsx +176 -0
  62. package/src/ui/ContentsSheet.tsx +146 -0
  63. package/src/ui/CustomizeSheet.tsx +191 -0
  64. package/src/ui/Glass.tsx +37 -0
  65. package/src/ui/HighlightMenu.tsx +66 -0
  66. package/src/ui/Icons.tsx +246 -0
  67. package/src/ui/LineGuide.tsx +87 -0
  68. package/src/ui/NoteEditor.tsx +57 -0
  69. package/src/ui/Scrubber.tsx +78 -0
  70. package/src/ui/SearchSheet.tsx +95 -0
  71. package/src/ui/Sheet.tsx +71 -0
  72. package/src/ui/Slider.tsx +30 -0
@@ -0,0 +1,599 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.EpubReaderView = EpubReaderView;
37
+ const react_1 = __importStar(require("react"));
38
+ const react_native_1 = require("react-native");
39
+ const EpubReader_1 = require("./EpubReader");
40
+ const themes_1 = require("./themes");
41
+ const AppearanceSheet_1 = require("./ui/AppearanceSheet");
42
+ const ContentsSheet_1 = require("./ui/ContentsSheet");
43
+ const CustomizeSheet_1 = require("./ui/CustomizeSheet");
44
+ const sound_1 = require("./sound");
45
+ const strings_1 = require("./strings");
46
+ const Glass_1 = require("./ui/Glass");
47
+ const HighlightMenu_1 = require("./ui/HighlightMenu");
48
+ const Icons_1 = require("./ui/Icons");
49
+ const LineGuide_1 = require("./ui/LineGuide");
50
+ const NoteEditor_1 = require("./ui/NoteEditor");
51
+ const SearchSheet_1 = require("./ui/SearchSheet");
52
+ const RESET_THEME = {
53
+ fontId: 'original',
54
+ bold: false,
55
+ customize: false,
56
+ lineHeight: 1.5,
57
+ letterSpacing: 0,
58
+ wordSpacing: 0,
59
+ margins: 0,
60
+ columns: 'auto',
61
+ justify: false
62
+ };
63
+ // expo-screen-orientation is optional (needed for the rotation lock button)
64
+ let ScreenOrientation = null;
65
+ try {
66
+ // eslint-disable-next-line @typescript-eslint/no-var-requires
67
+ ScreenOrientation = require('expo-screen-orientation');
68
+ }
69
+ catch {
70
+ ScreenOrientation = null;
71
+ }
72
+ const DIM_IDS = [
73
+ { id: 'high', label: 'dimHigh' },
74
+ { id: 'medium', label: 'dimMedium' },
75
+ { id: 'low', label: 'dimLow' },
76
+ { id: 'none', label: 'dimNone' }
77
+ ];
78
+ const SAMPLE = 'The reader turned the page slowly, listening to the wind move across the empty hills.';
79
+ const uid = () => Date.now().toString(36) + Math.random().toString(36).slice(2, 7);
80
+ // Used when the host passes no safeInsets. A guess from the screen size; the exact values come from react-native-safe-area-context.
81
+ function defaultInsets(width, height) {
82
+ if (react_native_1.Platform.OS !== 'ios')
83
+ return { top: react_native_1.StatusBar.currentHeight || 24, bottom: 0 };
84
+ const long = Math.max(width, height);
85
+ const landscape = width > height;
86
+ const notch = long >= 812; // iPhone X and later (iPads are larger but have no notch: they are caught by the short side)
87
+ const phone = Math.min(width, height) < 600;
88
+ if (!phone)
89
+ return { top: 24, bottom: 20 };
90
+ if (!notch)
91
+ return { top: 20, bottom: 0 };
92
+ const top = long >= 852 ? 59 : 47;
93
+ return landscape ? { top: 0, bottom: 21, left: top, right: top } : { top, bottom: 34 };
94
+ }
95
+ /**
96
+ * Full reader screen. A different `source` (or Try again after an error) starts a fresh screen, so highlights,
97
+ * bookmarks and position of one book can never leak into another.
98
+ */
99
+ function EpubReaderView(props) {
100
+ const [attempt, setAttempt] = (0, react_1.useState)(0);
101
+ const labels = (0, react_1.useMemo)(() => (0, strings_1.mergeLabels)(props.labels), [props.labels]);
102
+ return (react_1.default.createElement(strings_1.LabelsProvider, { value: labels },
103
+ react_1.default.createElement(ReaderScreen, { key: `${(0, EpubReader_1.sourceKeyOf)(props.source)}#${attempt}`, ...props, onRetry: () => setAttempt((a) => a + 1) })));
104
+ }
105
+ function ReaderScreen(props) {
106
+ const L = (0, strings_1.useLabels)();
107
+ const screen = (0, react_native_1.useWindowDimensions)();
108
+ const safe = props.safeInsets || defaultInsets(screen.width, screen.height);
109
+ const systemDark = (0, react_native_1.useColorScheme)() === 'dark';
110
+ const reader = (0, react_1.useRef)(null);
111
+ const [settings, setSettings] = (0, react_1.useState)({ ...themes_1.DEFAULT_SETTINGS, ...props.initialSettings });
112
+ const [highlights, setHighlights] = (0, react_1.useState)(props.initialHighlights || []);
113
+ const [bookmarks, setBookmarks] = (0, react_1.useState)(props.initialBookmarks || []);
114
+ const [toc, setToc] = (0, react_1.useState)([]);
115
+ const [meta, setMeta] = (0, react_1.useState)(null);
116
+ const [rtl, setRtl] = (0, react_1.useState)(false);
117
+ const [loc, setLoc] = (0, react_1.useState)(null);
118
+ const [index, setIndex] = (0, react_1.useState)(null);
119
+ const [cpp, setCpp] = (0, react_1.useState)(1200); // characters per page, measured from the chapters seen so far
120
+ // reading starts with nothing but the running header/footer; a tap shows the close button and the menu button
121
+ const [chrome, setChrome] = (0, react_1.useState)(false);
122
+ const [menuOpen, setMenuOpen] = (0, react_1.useState)(false);
123
+ const [pillW, setPillW] = (0, react_1.useState)(0);
124
+ const [lineGuide, setLineGuide] = (0, react_1.useState)(false);
125
+ const [dimLevel, setDimLevel] = (0, react_1.useState)('high');
126
+ const [lineMenu, setLineMenu] = (0, react_1.useState)(false);
127
+ const [rotLocked, setRotLocked] = (0, react_1.useState)(false);
128
+ const [returnTo, setReturnTo] = (0, react_1.useState)(null);
129
+ const [sheet, setSheet] = (0, react_1.useState)(null);
130
+ const [active, setActive] = (0, react_1.useState)(null);
131
+ const [selection, setSelection] = (0, react_1.useState)(null);
132
+ const [noteFor, setNoteFor] = (0, react_1.useState)(null);
133
+ const [results, setResults] = (0, react_1.useState)([]);
134
+ const [searching, setSearching] = (0, react_1.useState)(false);
135
+ const [error, setError] = (0, react_1.useState)(null);
136
+ // the book could not be opened (or the reader engine stopped): a full screen with a way out
137
+ const [fatal, setFatal] = (0, react_1.useState)(null);
138
+ const [loaded, setLoaded] = (0, react_1.useState)(false);
139
+ const [reduceMotion, setReduceMotion] = (0, react_1.useState)(false);
140
+ const searchId = (0, react_1.useRef)(0);
141
+ const latestProps = (0, react_1.useRef)(props);
142
+ latestProps.current = props;
143
+ const settingsRef = (0, react_1.useRef)(settings);
144
+ const highlightsRef = (0, react_1.useRef)(highlights);
145
+ const bookmarksRef = (0, react_1.useRef)(bookmarks);
146
+ const lockedByUs = (0, react_1.useRef)(false);
147
+ const seen = (0, react_1.useRef)({});
148
+ const layoutKey = (0, react_1.useRef)('');
149
+ (0, react_1.useEffect)(() => {
150
+ let on = true;
151
+ react_native_1.AccessibilityInfo.isReduceMotionEnabled?.().then((v) => on && setReduceMotion(!!v)).catch(() => undefined);
152
+ const sub = react_native_1.AccessibilityInfo.addEventListener?.('reduceMotionChanged', (v) => setReduceMotion(!!v));
153
+ return () => {
154
+ on = false;
155
+ sub?.remove?.();
156
+ };
157
+ }, []);
158
+ // people who asked for less motion get the fade instead of the curl or slide
159
+ const readerSettings = (0, react_1.useMemo)(() => (reduceMotion && (settings.pageTurn === 'curl' || settings.pageTurn === 'slide') ? { ...settings, pageTurn: 'fade' } : settings), [settings, reduceMotion]);
160
+ const dark = (0, themes_1.isDark)(settings, systemDark);
161
+ const page = (0, themes_1.themeColors)(settings, systemDark);
162
+ const colors = (0, react_1.useMemo)(() => (0, themes_1.chromeColors)(page, dark), [page, dark]);
163
+ // ----- chrome visibility animation
164
+ const fade = (0, react_1.useRef)(new react_native_1.Animated.Value(1)).current;
165
+ (0, react_1.useEffect)(() => {
166
+ react_native_1.Animated.timing(fade, { toValue: chrome ? 1 : 0, duration: 180, useNativeDriver: true }).start();
167
+ }, [chrome, fade]);
168
+ const fadeOut = fade.interpolate({ inputRange: [0, 1], outputRange: [1, 0] });
169
+ const menuFade = (0, react_1.useRef)(new react_native_1.Animated.Value(0)).current;
170
+ (0, react_1.useEffect)(() => {
171
+ react_native_1.Animated.timing(menuFade, { toValue: menuOpen ? 1 : 0, duration: 160, useNativeDriver: true }).start();
172
+ }, [menuOpen, menuFade]);
173
+ (0, react_1.useEffect)(() => {
174
+ if (!chrome)
175
+ setMenuOpen(false);
176
+ }, [chrome]);
177
+ // ----- persistence helpers
178
+ // The next list is computed from a ref and the host is told outside of any state updater, so a callback
179
+ // never runs during render (StrictMode runs updaters twice) and quick successive edits never lose each other.
180
+ const updateHighlights = (0, react_1.useCallback)((fn) => {
181
+ const next = fn(highlightsRef.current);
182
+ highlightsRef.current = next;
183
+ setHighlights(next);
184
+ latestProps.current.onHighlightsChange?.(next);
185
+ }, []);
186
+ const updateBookmarks = (0, react_1.useCallback)((fn) => {
187
+ const next = fn(bookmarksRef.current);
188
+ bookmarksRef.current = next;
189
+ setBookmarks(next);
190
+ latestProps.current.onBookmarksChange?.(next);
191
+ }, []);
192
+ const changeSettings = (0, react_1.useCallback)((patch) => {
193
+ const next = { ...settingsRef.current, ...patch };
194
+ settingsRef.current = next;
195
+ setSettings(next);
196
+ latestProps.current.onSettingsChange?.(next);
197
+ }, []);
198
+ // ----- book page numbers (estimated from characters per page)
199
+ const onRelocate = (e) => {
200
+ const key = [settings.fontSize, settings.fontId, settings.lineHeight, settings.letterSpacing, settings.wordSpacing, settings.margins, settings.customize, settings.columns, settings.bold, settings.pageTurn === 'scroll'].join('|');
201
+ if (key !== layoutKey.current) {
202
+ layoutKey.current = key;
203
+ seen.current = {};
204
+ }
205
+ seen.current[e.spine] = { len: e.textLength, pc: e.pageCount };
206
+ let len = 0;
207
+ let pc = 0;
208
+ Object.values(seen.current).forEach((v) => {
209
+ len += v.len;
210
+ pc += v.pc;
211
+ });
212
+ const next = pc > 0 && len > 0 ? len / pc : 1200;
213
+ setCpp((old) => (Math.abs(old - next) / next > 0.01 ? next : old));
214
+ setLoc(e);
215
+ setLoaded(true);
216
+ setActive(null);
217
+ props.onLocationChange?.(e);
218
+ };
219
+ const pageOf = (0, react_1.useCallback)((spine, offset) => {
220
+ if (!index)
221
+ return spine + 1;
222
+ return Math.round(((index.cum[spine] || 0) + offset) / cpp) + 1;
223
+ }, [index, cpp]);
224
+ const totalPages = index ? Math.max(1, Math.round(index.totalLength / cpp)) : loc ? loc.pageCount * loc.spineCount : 1;
225
+ const curPage = loc ? Math.min(totalPages, pageOf(loc.spine, loc.offset)) : 1;
226
+ const percent = Math.round((loc?.progress ?? 0) * 100);
227
+ const pagesLeft = loc ? Math.max(0, loc.pageCount - loc.page - 1) : 0;
228
+ // header / footer drawn on the page: chapter title + page number, or "N pages left" + "x of y" while the controls are shown
229
+ (0, react_1.useEffect)(() => {
230
+ if (!loc)
231
+ return;
232
+ const header = chrome ? (pagesLeft === 0 ? L.lastPageInChapter : L.pagesLeft(pagesLeft)) : loc.chapter;
233
+ const footer = chrome ? L.pageOfTotal(curPage, totalPages) : L.formatNumber(curPage);
234
+ reader.current?.setLabels(header, footer);
235
+ }, [chrome, loc, curPage, totalPages, pagesLeft, L]);
236
+ // ----- bookmarks
237
+ const bookmarkHere = (0, react_1.useMemo)(() => (loc ? bookmarks.filter((b) => b.spine === loc.spine && b.offset >= loc.offset && b.offset < Math.max(loc.end, loc.offset + 1)) : []), [bookmarks, loc]);
238
+ const toggleBookmark = () => {
239
+ if (!loc)
240
+ return;
241
+ if (bookmarkHere.length) {
242
+ const ids = new Set(bookmarkHere.map((b) => b.id));
243
+ updateBookmarks((prev) => prev.filter((b) => !ids.has(b.id)));
244
+ }
245
+ else {
246
+ updateBookmarks((prev) => [
247
+ ...prev,
248
+ { id: uid(), spine: loc.spine, offset: loc.offset, chapter: loc.chapter, excerpt: loc.excerpt, progress: loc.progress, createdAt: Date.now() }
249
+ ]);
250
+ }
251
+ };
252
+ // ----- highlights
253
+ const createHighlight = (sel, withNote) => {
254
+ setSelection(null);
255
+ const h = {
256
+ id: uid(),
257
+ spine: sel.spine,
258
+ start: sel.start,
259
+ end: sel.end,
260
+ text: sel.text.replace(/\s+/g, ' ').trim(),
261
+ color: 'yellow',
262
+ chapter: loc?.chapter,
263
+ createdAt: Date.now()
264
+ };
265
+ updateHighlights((prev) => [...prev, h]);
266
+ reader.current?.clearSelection();
267
+ if (withNote)
268
+ setNoteFor(h.id);
269
+ else
270
+ setActive({ id: h.id, rect: sel.rect });
271
+ };
272
+ const patchHighlight = (id, patch) => updateHighlights((prev) => prev.map((h) => (h.id === id ? { ...h, ...patch } : h)));
273
+ const removeHighlight = (id) => {
274
+ updateHighlights((prev) => prev.filter((h) => h.id !== id));
275
+ setActive(null);
276
+ };
277
+ const activeHighlight = active ? highlights.find((h) => h.id === active.id) : undefined;
278
+ const noteHighlight = noteFor ? highlights.find((h) => h.id === noteFor) : undefined;
279
+ // ----- search
280
+ const runSearch = (q) => {
281
+ const id = ++searchId.current;
282
+ setResults([]);
283
+ if (q.trim().length < 2) {
284
+ setSearching(false);
285
+ reader.current?.cancelSearch(id);
286
+ return;
287
+ }
288
+ setSearching(true);
289
+ reader.current?.search(q, id);
290
+ };
291
+ const closeSheet = () => setSheet(null);
292
+ // remember where we were so the "back" pill can return after a jump (contents, search, bookmark ...)
293
+ const jump = (to) => {
294
+ if (loc)
295
+ setReturnTo({ spine: loc.spine, offset: loc.offset, page: curPage });
296
+ setChrome(false);
297
+ reader.current?.goTo(to);
298
+ };
299
+ // two modals cannot be presented at once on iOS, so switch sheets after the first one is gone
300
+ const switchSheet = (to) => {
301
+ setSheet(null);
302
+ setTimeout(() => setSheet(to), 380);
303
+ };
304
+ const toggleRotationLock = async () => {
305
+ if (!ScreenOrientation) {
306
+ react_native_1.Alert.alert(L.rotationLock, L.rotationLockNeedsPackage);
307
+ return;
308
+ }
309
+ try {
310
+ if (rotLocked) {
311
+ await ScreenOrientation.unlockAsync();
312
+ lockedByUs.current = false;
313
+ setRotLocked(false);
314
+ }
315
+ else {
316
+ const o = await ScreenOrientation.getOrientationAsync();
317
+ const O = ScreenOrientation.Orientation;
318
+ const L = ScreenOrientation.OrientationLock;
319
+ await ScreenOrientation.lockAsync(o === O.LANDSCAPE_LEFT ? L.LANDSCAPE_LEFT : o === O.LANDSCAPE_RIGHT ? L.LANDSCAPE_RIGHT : L.PORTRAIT_UP);
320
+ lockedByUs.current = true;
321
+ setRotLocked(true);
322
+ }
323
+ }
324
+ catch {
325
+ // not supported on this device
326
+ }
327
+ };
328
+ (0, react_1.useEffect)(() => () => {
329
+ // only release a lock this reader set: the host app may have its own orientation policy
330
+ if (ScreenOrientation && lockedByUs.current)
331
+ ScreenOrientation.unlockAsync().catch(() => undefined);
332
+ }, []);
333
+ const onLineGuideButton = () => {
334
+ setMenuOpen(false);
335
+ if (!lineGuide) {
336
+ setLineGuide(true);
337
+ setChrome(false);
338
+ }
339
+ else
340
+ setLineMenu(true);
341
+ };
342
+ const openLink = (href) => {
343
+ if (!/^(https?|mailto):/i.test(href))
344
+ return;
345
+ react_native_1.Alert.alert(L.openLink, href, [
346
+ { text: L.cancel, style: 'cancel' },
347
+ { text: L.open, onPress: () => react_native_1.Linking.openURL(href).catch(() => undefined) }
348
+ ]);
349
+ };
350
+ const share = () => {
351
+ const text = [loc?.excerpt, meta?.title && `— ${meta.title}`].filter(Boolean).join(' ');
352
+ react_native_1.Share.share({ message: text || meta?.title || '' }).catch(() => undefined);
353
+ };
354
+ const progressFill = Math.max(0, Math.min(1, loc?.progress ?? 0));
355
+ const tx = colors.text;
356
+ return (react_1.default.createElement(react_native_1.View, { style: [styles.root, { backgroundColor: page.bg }] },
357
+ react_1.default.createElement(EpubReader_1.EpubReader, { ref: reader, source: props.source, settings: readerSettings, systemDark: systemDark, safeInsets: safe, initialLocation: props.initialLocation, highlights: highlights, maxFileSize: props.maxFileSize, onReady: ({ metadata, rtl: isRtl }) => {
358
+ setMeta(metadata);
359
+ setRtl(isRtl);
360
+ props.onMetadata?.(metadata);
361
+ }, onToc: setToc, onCover: props.onCover, onIndexed: setIndex, onRelocate: onRelocate, onPageTurn: () => {
362
+ if (settings.pageSound)
363
+ (0, sound_1.playPageTurn)();
364
+ }, onTap: () => {
365
+ if (active)
366
+ setActive(null);
367
+ else if (menuOpen)
368
+ setMenuOpen(false);
369
+ else
370
+ setChrome((c) => !c);
371
+ }, onHighlightTap: (id, rect) => setActive({ id, rect }), onSelection: (sel) => {
372
+ setSelection(sel);
373
+ if (sel) {
374
+ setChrome(false);
375
+ setActive(null);
376
+ }
377
+ }, onLink: openLink, onLinkJump: (from) => setReturnTo({ spine: from.spine, offset: from.offset, page: pageOf(from.spine, from.offset) }), onDirectionChange: setRtl, onSearchResults: (id, found, done) => {
378
+ if (id !== searchId.current)
379
+ return;
380
+ setResults((prev) => prev.concat(found));
381
+ if (done)
382
+ setSearching(false);
383
+ }, onError: (m, info) => {
384
+ if (info.fatal || !loaded)
385
+ setFatal(m);
386
+ else
387
+ setError(m);
388
+ props.onError?.(m);
389
+ } }),
390
+ !chrome && (react_1.default.createElement(react_native_1.View, { pointerEvents: "none", accessible: true, accessibilityRole: "button", accessibilityLabel: L.readerMenu, accessibilityActions: [
391
+ { name: 'activate', label: L.readerMenu },
392
+ { name: 'increment', label: 'Next page' },
393
+ { name: 'decrement', label: 'Previous page' }
394
+ ], onAccessibilityAction: (e) => {
395
+ const a = e.nativeEvent.actionName;
396
+ if (a === 'increment')
397
+ reader.current?.next();
398
+ else if (a === 'decrement')
399
+ reader.current?.prev();
400
+ else
401
+ setChrome(true);
402
+ }, style: [styles.a11yHandle, { bottom: safe.bottom, left: safe.left || 0 }] })),
403
+ react_1.default.createElement(react_native_1.View, { pointerEvents: "none", style: [react_native_1.StyleSheet.absoluteFill, { backgroundColor: '#000000', opacity: (1 - settings.brightness) * 0.75 }] }),
404
+ lineGuide && (react_1.default.createElement(LineGuide_1.LineGuide, { bg: page.bg, dark: dark, dim: dimLevel, lineHeight: settings.fontSize * (settings.customize ? settings.lineHeight : 1.5), minY: safe.top + 30, maxY: screen.height - safe.bottom - 30 })),
405
+ bookmarkHere.length > 0 && (react_1.default.createElement(react_native_1.Animated.View, { pointerEvents: "none", style: [styles.ribbon, { right: 22, opacity: fadeOut }] },
406
+ react_1.default.createElement(react_native_1.View, { style: styles.ribbonBody }),
407
+ react_1.default.createElement(react_native_1.View, { style: styles.ribbonNotch }))),
408
+ react_1.default.createElement(react_native_1.Animated.View, { pointerEvents: chrome ? 'auto' : 'none', ...hiddenA11y(!chrome), style: [styles.closeWrap, { top: safe.top + 2, right: 16 + (safe.right || 0), opacity: fade }] },
409
+ react_1.default.createElement(react_native_1.Pressable, { onPress: props.onClose, hitSlop: 10, accessibilityRole: "button", accessibilityLabel: L.closeBook },
410
+ react_1.default.createElement(Glass_1.Glass, { dark: dark, background: colors.glass, border: colors.glassBorder, style: styles.circle },
411
+ react_1.default.createElement(Icons_1.Icon, { name: "close", color: tx, size: 22 })))),
412
+ returnTo && (react_1.default.createElement(react_native_1.Animated.View, { pointerEvents: chrome ? 'auto' : 'none', ...hiddenA11y(!chrome), style: [styles.returnWrap, { top: safe.top + 2, left: 16 + (safe.left || 0), opacity: fade }] },
413
+ react_1.default.createElement(react_native_1.Pressable, { onPress: () => {
414
+ reader.current?.goTo({ spine: returnTo.spine, offset: returnTo.offset });
415
+ setReturnTo(null);
416
+ }, hitSlop: 8, accessibilityRole: "button", accessibilityLabel: L.returnToPage(returnTo.page) },
417
+ react_1.default.createElement(Glass_1.Glass, { dark: dark, background: colors.glass, border: colors.glassBorder, style: styles.returnPill },
418
+ react_1.default.createElement(Icons_1.Icon, { name: "undo", color: tx, size: 22 }),
419
+ react_1.default.createElement(react_native_1.Text, { style: { color: tx, fontSize: 20, marginStart: 8 }, maxFontSizeMultiplier: 1.3 }, L.formatNumber(returnTo.page)))))),
420
+ react_1.default.createElement(react_native_1.Animated.View, { pointerEvents: chrome && !menuOpen ? 'auto' : 'none', ...hiddenA11y(!(chrome && !menuOpen)), style: [styles.menuBtnWrap, { bottom: safe.bottom + 14, right: 16 + (safe.right || 0), opacity: react_native_1.Animated.multiply(fade, react_native_1.Animated.subtract(1, menuFade)) }] },
421
+ react_1.default.createElement(react_native_1.Pressable, { onPress: () => setMenuOpen(true), accessibilityRole: "button", accessibilityLabel: L.readerMenu },
422
+ react_1.default.createElement(Glass_1.Glass, { dark: dark, background: colors.glass, border: colors.glassBorder, style: styles.menuBtn },
423
+ react_1.default.createElement(Icons_1.Icon, { name: "list", color: tx, size: 24 })))),
424
+ react_1.default.createElement(react_native_1.Animated.View, { pointerEvents: chrome && menuOpen ? 'box-none' : 'none', ...hiddenA11y(!(chrome && menuOpen)), style: [styles.controls, { bottom: safe.bottom + 44, right: 16 + (safe.right || 0), opacity: menuFade }] },
425
+ react_1.default.createElement(react_native_1.Pressable, { onPress: () => {
426
+ setMenuOpen(false);
427
+ setSheet('contents');
428
+ }, accessibilityRole: "button", accessibilityLabel: L.contents, style: styles.pillWrap },
429
+ react_1.default.createElement(Glass_1.Glass, { dark: dark, background: colors.glass, border: colors.glassBorder, style: styles.pill },
430
+ react_1.default.createElement(react_native_1.View, { style: styles.pillRow, onLayout: (e) => setPillW(e.nativeEvent.layout.width) },
431
+ react_1.default.createElement(react_native_1.Text, { style: [styles.pillText, { color: tx }], maxFontSizeMultiplier: 1.3 },
432
+ L.contents,
433
+ " \u2022 ",
434
+ L.formatNumber(percent),
435
+ "%"),
436
+ react_1.default.createElement(Icons_1.Icon, { name: "list", color: tx, size: 24 })),
437
+ react_1.default.createElement(react_native_1.View, { pointerEvents: "none", style: [styles.fill, { width: progressFill * pillW, backgroundColor: dark ? 'rgba(255,255,255,0.35)' : '#1c1408', [rtl ? 'right' : 'left']: 0 }] },
438
+ react_1.default.createElement(react_native_1.View, { style: [styles.pillRow, { position: 'absolute', top: 0, width: pillW, [rtl ? 'right' : 'left']: 0 }] },
439
+ react_1.default.createElement(react_native_1.Text, { style: [styles.pillText, { color: dark ? tx : '#ffffff' }], maxFontSizeMultiplier: 1.3 },
440
+ L.contents,
441
+ " \u2022 ",
442
+ L.formatNumber(percent),
443
+ "%"),
444
+ react_1.default.createElement(Icons_1.Icon, { name: "list", color: dark ? tx : '#ffffff', size: 24 }))))),
445
+ react_1.default.createElement(react_native_1.Pressable, { onPress: () => {
446
+ setMenuOpen(false);
447
+ setSheet('search');
448
+ }, accessibilityRole: "button", accessibilityLabel: L.searchBook, style: styles.pillWrap },
449
+ react_1.default.createElement(Glass_1.Glass, { dark: dark, background: colors.glass, border: colors.glassBorder, style: styles.pill },
450
+ react_1.default.createElement(react_native_1.View, { style: styles.pillRow },
451
+ react_1.default.createElement(react_native_1.Text, { style: [styles.pillText, { color: tx }], maxFontSizeMultiplier: 1.3 }, L.searchBook),
452
+ react_1.default.createElement(Icons_1.Icon, { name: "search", color: tx, size: 24 })))),
453
+ react_1.default.createElement(react_native_1.Pressable, { onPress: () => {
454
+ setMenuOpen(false);
455
+ setSheet('appearance');
456
+ }, accessibilityRole: "button", accessibilityLabel: L.themesSettings, style: styles.pillWrap },
457
+ react_1.default.createElement(Glass_1.Glass, { dark: dark, background: colors.glass, border: colors.glassBorder, style: styles.pill },
458
+ react_1.default.createElement(react_native_1.View, { style: styles.pillRow },
459
+ react_1.default.createElement(react_native_1.Text, { style: [styles.pillText, { color: tx }], maxFontSizeMultiplier: 1.3 }, L.themesSettings),
460
+ react_1.default.createElement(Icons_1.Icon, { name: "textSize", color: tx, size: 26 })))),
461
+ react_1.default.createElement(react_native_1.View, { style: styles.roundRow },
462
+ react_1.default.createElement(react_native_1.Pressable, { onPress: share, style: styles.roundWrap, accessibilityRole: "button", accessibilityLabel: L.share },
463
+ react_1.default.createElement(Glass_1.Glass, { dark: dark, background: colors.glass, border: colors.glassBorder, style: styles.round },
464
+ react_1.default.createElement(Icons_1.Icon, { name: "share", color: tx, size: 24 }))),
465
+ react_1.default.createElement(react_native_1.Pressable, { onPress: toggleRotationLock, style: styles.roundWrap, accessibilityRole: "button", accessibilityLabel: L.rotationLock, accessibilityState: { selected: rotLocked } },
466
+ react_1.default.createElement(Glass_1.Glass, { dark: dark, background: rotLocked ? (dark ? 'rgba(255,255,255,0.35)' : 'rgba(0,0,0,0.18)') : colors.glass, border: colors.glassBorder, style: styles.round },
467
+ react_1.default.createElement(Icons_1.Icon, { name: "rotationLock", color: tx, size: 26, active: rotLocked }))),
468
+ react_1.default.createElement(react_native_1.Pressable, { onPress: onLineGuideButton, style: styles.roundWrap, accessibilityRole: "button", accessibilityLabel: L.lineGuide, accessibilityState: { selected: lineGuide } },
469
+ react_1.default.createElement(Glass_1.Glass, { dark: dark, background: lineGuide ? (dark ? 'rgba(255,255,255,0.35)' : 'rgba(0,0,0,0.18)') : colors.glass, border: colors.glassBorder, style: styles.round },
470
+ react_1.default.createElement(Icons_1.Icon, { name: "lineGuide", color: tx, size: 26, active: lineGuide }))),
471
+ react_1.default.createElement(react_native_1.Pressable, { onPress: toggleBookmark, style: styles.roundWrap, accessibilityRole: "button", accessibilityLabel: L.bookmarkPage, accessibilityState: { selected: bookmarkHere.length > 0 } },
472
+ react_1.default.createElement(Glass_1.Glass, { dark: dark, background: colors.glass, border: colors.glassBorder, style: styles.round },
473
+ react_1.default.createElement(Icons_1.Icon, { name: "bookmark", color: tx, size: 24, active: bookmarkHere.length > 0 }))))),
474
+ selection && !active && !noteFor && (() => {
475
+ const w = Math.min(Math.max(214, screen.width * 0.5), screen.width - 16);
476
+ const r = selection.rect;
477
+ const left = Math.max(8, Math.min(screen.width - w - 8, r.x + r.width / 2 - w / 2));
478
+ // the system callout (Copy / Look Up) sits above the selection, so ours goes below it
479
+ const below = r.y + r.height + 16;
480
+ const top = below + 54 > screen.height - safe.bottom ? Math.max(safe.top + 8, r.y - 120) : below;
481
+ return (react_1.default.createElement(Glass_1.Glass, { dark: dark, background: colors.sheetGlass, border: colors.glassBorder, intensity: 55, style: [styles.selBar, { left, top, width: w }] },
482
+ react_1.default.createElement(react_native_1.Pressable, { style: styles.selBtn, onPress: () => createHighlight(selection, false), accessibilityRole: "button", accessibilityLabel: L.highlight },
483
+ react_1.default.createElement(Icons_1.Icon, { name: "highlighter", color: tx, size: 22 }),
484
+ react_1.default.createElement(react_native_1.Text, { style: [styles.selText, { color: tx }], numberOfLines: 1, maxFontSizeMultiplier: 1.2 }, L.highlight)),
485
+ react_1.default.createElement(react_native_1.View, { style: [styles.selSep, { backgroundColor: colors.separator }] }),
486
+ react_1.default.createElement(react_native_1.Pressable, { style: styles.selBtn, onPress: () => createHighlight(selection, true), accessibilityRole: "button", accessibilityLabel: L.addNote },
487
+ react_1.default.createElement(Icons_1.Icon, { name: "pencil", color: tx, size: 22 }),
488
+ react_1.default.createElement(react_native_1.Text, { style: [styles.selText, { color: tx }], numberOfLines: 1, maxFontSizeMultiplier: 1.2 }, L.note))));
489
+ })(),
490
+ activeHighlight && active && (react_1.default.createElement(HighlightMenu_1.HighlightMenu, { highlight: activeHighlight, rect: active.rect, screen: screen, colors: colors, onColor: (c) => patchHighlight(activeHighlight.id, { color: c }), onToggleUnderline: () => patchHighlight(activeHighlight.id, { style: activeHighlight.style === 'underline' ? 'highlight' : 'underline' }), onNote: () => {
491
+ setNoteFor(activeHighlight.id);
492
+ setActive(null);
493
+ }, onDelete: () => removeHighlight(activeHighlight.id), onDismiss: () => setActive(null) })),
494
+ !loaded && !fatal && (react_1.default.createElement(react_native_1.View, { style: [react_native_1.StyleSheet.absoluteFill, styles.splash, { backgroundColor: page.bg }], pointerEvents: "box-none" },
495
+ react_1.default.createElement(react_native_1.ActivityIndicator, { color: page.fg }),
496
+ react_1.default.createElement(react_native_1.Text, { style: { color: page.fg, opacity: 0.6, marginTop: 12, fontSize: 15 }, maxFontSizeMultiplier: 1.3 }, L.loading),
497
+ react_1.default.createElement(react_native_1.Pressable, { onPress: props.onClose, hitSlop: 10, accessibilityRole: "button", accessibilityLabel: L.closeBook, style: [styles.splashClose, { top: safe.top + 2, right: 16 + (safe.right || 0) }] },
498
+ react_1.default.createElement(Glass_1.Glass, { dark: dark, background: colors.glass, border: colors.glassBorder, style: styles.circle },
499
+ react_1.default.createElement(Icons_1.Icon, { name: "close", color: tx, size: 22 }))))),
500
+ !!fatal && (react_1.default.createElement(react_native_1.View, { style: [react_native_1.StyleSheet.absoluteFill, styles.splash, { backgroundColor: page.bg }], accessibilityViewIsModal: true },
501
+ react_1.default.createElement(react_native_1.Text, { style: { color: page.fg, fontSize: 18, fontWeight: '600', textAlign: 'center' }, accessibilityRole: "header" }, L.couldNotOpen),
502
+ react_1.default.createElement(react_native_1.Text, { style: { color: page.fg, opacity: 0.7, fontSize: 15, textAlign: 'center', marginTop: 10 }, accessibilityRole: "alert" }, fatal),
503
+ react_1.default.createElement(react_native_1.View, { style: styles.fatalButtons },
504
+ react_1.default.createElement(react_native_1.Pressable, { onPress: props.onRetry, style: [styles.fatalBtn, { backgroundColor: colors.accent }], accessibilityRole: "button" },
505
+ react_1.default.createElement(react_native_1.Text, { style: { color: '#ffffff', fontSize: 16, fontWeight: '600' } }, L.tryAgain)),
506
+ !!props.onClose && (react_1.default.createElement(react_native_1.Pressable, { onPress: props.onClose, style: [styles.fatalBtn, { backgroundColor: colors.card }], accessibilityRole: "button" },
507
+ react_1.default.createElement(react_native_1.Text, { style: { color: tx, fontSize: 16, fontWeight: '600' } }, L.close)))))),
508
+ error && !fatal && (react_1.default.createElement(react_native_1.View, { style: [styles.error, { backgroundColor: colors.sheet }], accessibilityRole: "alert" },
509
+ react_1.default.createElement(react_native_1.Text, { style: { color: colors.text, fontSize: 15, textAlign: 'center' } }, error),
510
+ react_1.default.createElement(react_native_1.Pressable, { onPress: () => setError(null), style: { marginTop: 12, padding: 8 }, accessibilityRole: "button" },
511
+ react_1.default.createElement(react_native_1.Text, { style: { color: colors.accent, fontSize: 16 } }, L.ok)))),
512
+ lineMenu && (react_1.default.createElement(react_1.default.Fragment, null,
513
+ react_1.default.createElement(react_native_1.Pressable, { style: react_native_1.StyleSheet.absoluteFill, onPress: () => setLineMenu(false), accessibilityLabel: L.dismiss }),
514
+ react_1.default.createElement(react_native_1.View, { style: [styles.lineMenu, { bottom: safe.bottom + 20, backgroundColor: colors.dark ? '#4a4742' : '#ffffff', borderColor: colors.glassBorder }] },
515
+ react_1.default.createElement(react_native_1.Text, { style: [styles.lineMenuHead, { color: colors.subtext }] }, L.backgroundDimming),
516
+ DIM_IDS.map((d) => (react_1.default.createElement(react_native_1.Pressable, { key: d.id, style: styles.lineItem, accessibilityRole: "button", accessibilityState: { selected: dimLevel === d.id }, onPress: () => {
517
+ setDimLevel(d.id);
518
+ setLineMenu(false);
519
+ } },
520
+ react_1.default.createElement(react_native_1.View, { style: styles.lineCheck }, dimLevel === d.id && react_1.default.createElement(Icons_1.Icon, { name: "check", color: tx, size: 20 })),
521
+ react_1.default.createElement(react_native_1.Text, { style: { color: tx, fontSize: 19 } }, L[d.label])))),
522
+ react_1.default.createElement(react_native_1.View, { style: [styles.lineSep, { backgroundColor: colors.separator }] }),
523
+ react_1.default.createElement(react_native_1.Pressable, { style: styles.lineItem, accessibilityRole: "button", onPress: () => {
524
+ setLineGuide(false);
525
+ setLineMenu(false);
526
+ } },
527
+ react_1.default.createElement(react_native_1.View, { style: styles.lineCheck }),
528
+ react_1.default.createElement(react_native_1.Text, { style: { color: tx, fontSize: 19 } }, L.turnOffLineGuide))))),
529
+ react_1.default.createElement(ContentsSheet_1.ContentsSheet, { visible: sheet === 'contents', colors: colors, title: meta?.title || props.title || '', subtitle: L.pageOfTotalLong(curPage, totalPages), toc: toc, currentSpine: loc?.spine ?? 0, pageOf: pageOf, bookmarks: bookmarks, highlights: highlights, onClose: closeSheet, onGoToc: (item) => {
530
+ closeSheet();
531
+ jump({ spine: item.spine, fragment: item.fragment });
532
+ }, onGoBookmark: (b) => {
533
+ closeSheet();
534
+ jump({ spine: b.spine, offset: b.offset });
535
+ }, onGoHighlight: (h) => {
536
+ closeSheet();
537
+ jump({ spine: h.spine, offset: h.start });
538
+ }, onDeleteBookmark: (id) => updateBookmarks((prev) => prev.filter((b) => b.id !== id)), onDeleteHighlight: (id) => updateHighlights((prev) => prev.filter((h) => h.id !== id)) }),
539
+ react_1.default.createElement(SearchSheet_1.SearchSheet, { visible: sheet === 'search', colors: colors, results: results, searching: searching, onClose: closeSheet, onSearch: runSearch, onPick: (r) => {
540
+ closeSheet();
541
+ if (loc)
542
+ setReturnTo({ spine: loc.spine, offset: loc.offset, page: curPage });
543
+ setChrome(false);
544
+ reader.current?.showSearchResult(r);
545
+ } }),
546
+ react_1.default.createElement(AppearanceSheet_1.AppearanceSheet, { visible: sheet === 'appearance', colors: colors, settings: settings, systemDark: systemDark, onChange: changeSettings, onCustomize: () => switchSheet('customize'), onClose: closeSheet }),
547
+ react_1.default.createElement(CustomizeSheet_1.CustomizeSheet, { visible: sheet === 'customize', colors: colors, page: page, settings: settings, sample: loc?.excerpt || SAMPLE, onChange: changeSettings, onReset: () => changeSettings(RESET_THEME), onClose: () => switchSheet('appearance') }),
548
+ react_1.default.createElement(NoteEditor_1.NoteEditor, { visible: !!noteHighlight, quote: noteHighlight?.text || '', initial: noteHighlight?.note || '', colors: colors, onCancel: () => setNoteFor(null), onSave: (text) => {
549
+ if (noteFor)
550
+ patchHighlight(noteFor, { note: text || undefined });
551
+ setNoteFor(null);
552
+ } })));
553
+ }
554
+ const styles = react_native_1.StyleSheet.create({
555
+ root: { flex: 1 },
556
+ closeWrap: { position: 'absolute' },
557
+ circle: { width: 42, height: 42, borderRadius: 21, alignItems: 'center', justifyContent: 'center' },
558
+ controls: { position: 'absolute', width: '68%', minWidth: 260, maxWidth: 420 },
559
+ selBar: { position: 'absolute', height: 48, borderRadius: 24, flexDirection: 'row', alignItems: 'center' },
560
+ selBtn: { flex: 1, height: '100%', flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 6 },
561
+ selText: { fontSize: 15, fontWeight: '600' },
562
+ selSep: { width: react_native_1.StyleSheet.hairlineWidth, height: 24 },
563
+ lineMenu: {
564
+ position: 'absolute', left: 16, width: 290, borderRadius: 28, paddingVertical: 10, borderWidth: react_native_1.StyleSheet.hairlineWidth,
565
+ shadowColor: '#000', shadowOpacity: 0.3, shadowRadius: 16, shadowOffset: { width: 0, height: 6 }, elevation: 12
566
+ },
567
+ lineMenuHead: { fontSize: 15, fontWeight: '600', marginStart: 52, marginTop: 8, marginBottom: 4 },
568
+ lineItem: { flexDirection: 'row', alignItems: 'center', paddingVertical: 12, paddingHorizontal: 18 },
569
+ lineCheck: { width: 34 },
570
+ lineSep: { height: react_native_1.StyleSheet.hairlineWidth, marginVertical: 6, marginHorizontal: 18 },
571
+ menuBtnWrap: { position: 'absolute' },
572
+ menuBtn: { width: 54, height: 54, borderRadius: 27, alignItems: 'center', justifyContent: 'center' },
573
+ returnWrap: { position: 'absolute' },
574
+ returnPill: { height: 46, borderRadius: 23, flexDirection: 'row', alignItems: 'center', paddingHorizontal: 16 },
575
+ pillRow: { height: 50, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: 22 },
576
+ pillWrap: { marginBottom: 8 },
577
+ pill: { height: 50, borderRadius: 25 },
578
+ pillText: { fontSize: 17, fontWeight: '500' },
579
+ fill: { position: 'absolute', top: 0, bottom: 0, overflow: 'hidden' },
580
+ roundRow: { flexDirection: 'row', gap: 8 },
581
+ roundWrap: { flex: 1 },
582
+ round: { height: 50, borderRadius: 25, alignItems: 'center', justifyContent: 'center' },
583
+ ribbon: { position: 'absolute', top: 0, width: 16 },
584
+ ribbonBody: { height: 26, backgroundColor: '#ff3b30' },
585
+ ribbonNotch: {
586
+ width: 0, height: 0, borderLeftWidth: 8, borderRightWidth: 8, borderBottomWidth: 7,
587
+ borderLeftColor: '#ff3b30', borderRightColor: '#ff3b30', borderBottomColor: 'transparent'
588
+ },
589
+ error: { position: 'absolute', left: 24, right: 24, top: '40%', padding: 20, borderRadius: 14, alignItems: 'center', elevation: 10 },
590
+ splash: { alignItems: 'center', justifyContent: 'center', paddingHorizontal: 32 },
591
+ splashClose: { position: 'absolute' },
592
+ fatalButtons: { flexDirection: 'row', gap: 12, marginTop: 24 },
593
+ fatalBtn: { minWidth: 110, height: 46, borderRadius: 23, alignItems: 'center', justifyContent: 'center', paddingHorizontal: 20 },
594
+ a11yHandle: { position: 'absolute', width: 48, height: 48, backgroundColor: 'transparent' }
595
+ });
596
+ // controls that are faded out must not stay reachable for VoiceOver / TalkBack
597
+ function hiddenA11y(hidden) {
598
+ return { accessibilityElementsHidden: hidden, importantForAccessibility: (hidden ? 'no-hide-descendants' : 'auto') };
599
+ }
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ export declare const READER_HTML: string;