react-native-simple-epub-reader 0.1.0 → 0.1.2
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/README.md +155 -12
- package/lib/module/components/Reader.js +30 -5
- package/lib/module/components/Reader.js.map +1 -1
- package/lib/module/constants/internalEvents.js +5 -0
- package/lib/module/constants/internalEvents.js.map +1 -0
- package/lib/module/constants/template.js +255 -214
- package/lib/module/constants/template.js.map +1 -1
- package/lib/module/context/ReaderContext.js +29 -26
- package/lib/module/context/ReaderContext.js.map +1 -1
- package/lib/typescript/src/components/Reader.d.ts +1 -1
- package/lib/typescript/src/components/Reader.d.ts.map +1 -1
- package/lib/typescript/src/constants/internalEvents.d.ts +3 -0
- package/lib/typescript/src/constants/internalEvents.d.ts.map +1 -0
- package/lib/typescript/src/constants/template.d.ts +1 -1
- package/lib/typescript/src/constants/template.d.ts.map +1 -1
- package/lib/typescript/src/context/ReaderContext.d.ts.map +1 -1
- package/lib/typescript/src/types/index.d.ts +1 -0
- package/lib/typescript/src/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/Reader.tsx +32 -4
- package/src/constants/internalEvents.ts +27 -0
- package/src/constants/template.ts +255 -214
- package/src/context/ReaderContext.tsx +29 -27
- package/src/types/index.ts +1 -0
package/README.md
CHANGED
|
@@ -1,26 +1,173 @@
|
|
|
1
1
|
# react-native-simple-epub-reader
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A lightweight React Native ePub reader powered by `react-native-webview`, with support for:
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- remote `.epub` files,
|
|
6
|
+
- swipe navigation,
|
|
7
|
+
- pinch-to-zoom font scaling,
|
|
8
|
+
- reading progress and location callbacks,
|
|
9
|
+
- imperative controls through `ReaderContext`.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- Fast setup with a single `Reader` component.
|
|
14
|
+
- Built-in gestures: tap, swipe left/right, pinch.
|
|
15
|
+
- Progress events (`onLocationChange`, `onLocationsReady`, `onBeginning`, `onFinish`).
|
|
16
|
+
- Programmatic controls: `goNext`, `goPrevious`, `goToLocation`, `changeTheme`, `changeFontSize`.
|
|
17
|
+
- Works with TypeScript out of the box.
|
|
6
18
|
|
|
19
|
+
## Installation
|
|
7
20
|
|
|
8
|
-
```
|
|
21
|
+
```bash
|
|
9
22
|
npm install react-native-simple-epub-reader
|
|
10
23
|
```
|
|
11
24
|
|
|
25
|
+
Install peer dependencies:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm install react-native-webview react-native-gesture-handler expo-file-system @expo/vector-icons
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If your app uses Expo, make sure native modules are installed and configured:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx expo install react-native-webview react-native-gesture-handler expo-file-system @expo/vector-icons
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
Wrap your app with `ReaderProvider`:
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { ReaderProvider } from 'react-native-simple-epub-reader';
|
|
43
|
+
import Viewer from './Viewer';
|
|
44
|
+
|
|
45
|
+
export default function App() {
|
|
46
|
+
return (
|
|
47
|
+
<ReaderProvider>
|
|
48
|
+
<Viewer />
|
|
49
|
+
</ReaderProvider>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Render a book:
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
import { Reader } from 'react-native-simple-epub-reader';
|
|
58
|
+
|
|
59
|
+
export function Viewer() {
|
|
60
|
+
return <Reader src="https://example.com/my-book.epub" />;
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Reader API
|
|
65
|
+
|
|
66
|
+
### Props
|
|
67
|
+
|
|
68
|
+
| Prop | Type | Required | Description |
|
|
69
|
+
| ------------------ | ------------------------------ | -------- | -------------------------------------------------------- |
|
|
70
|
+
| `src` | `string` | Yes | Remote URL to an `.epub` file. |
|
|
71
|
+
| `initialLocation` | `string` | No | Initial CFI location (`epubcfi(...)`). |
|
|
72
|
+
| `onTap` | `() => void` | No | Called on tap gesture. |
|
|
73
|
+
| `onSwipeLeft` | `() => void` | No | Called before built-in `goNext()`. |
|
|
74
|
+
| `onSwipeRight` | `() => void` | No | Called before built-in `goPrevious()`. |
|
|
75
|
+
| `onPinch` | `(e) => void` | No | Called on pinch gesture. |
|
|
76
|
+
| `onLocationChange` | `(data) => void` | No | Reading position/progress update. |
|
|
77
|
+
| `onLocationsReady` | `(epubKey, locations) => void` | No | Called when locations are generated. |
|
|
78
|
+
| `onBeginning` | `() => void` | No | Called when user reaches beginning of the book. |
|
|
79
|
+
| `onFinish` | `() => void` | No | Called when user reaches end of the book. |
|
|
80
|
+
| `onWebViewMessage` | `(event) => void` | No | Receives custom WebView messages not handled internally. |
|
|
81
|
+
| `LoaderComponent` | `React.ComponentType` | No | Custom loading component. |
|
|
82
|
+
|
|
83
|
+
### `onLocationChange` payload
|
|
84
|
+
|
|
85
|
+
```ts
|
|
86
|
+
type LocationChangeData = {
|
|
87
|
+
totalLocations: number;
|
|
88
|
+
currentLocation: Location;
|
|
89
|
+
progress: number;
|
|
90
|
+
currentSection: Section | null;
|
|
91
|
+
};
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## ReaderContext API
|
|
12
95
|
|
|
13
|
-
|
|
96
|
+
Use `ReaderContext` to control reader state from your own UI:
|
|
14
97
|
|
|
98
|
+
```tsx
|
|
99
|
+
import { useContext } from 'react';
|
|
100
|
+
import { ReaderContext } from 'react-native-simple-epub-reader';
|
|
15
101
|
|
|
16
|
-
|
|
17
|
-
|
|
102
|
+
export function Controls() {
|
|
103
|
+
const { goNext, goPrevious, progress, changeFontSize } =
|
|
104
|
+
useContext(ReaderContext);
|
|
18
105
|
|
|
19
|
-
|
|
106
|
+
return <>{/* your custom controls */}</>;
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Available methods and state include:
|
|
111
|
+
|
|
112
|
+
- `goNext()`
|
|
113
|
+
- `goPrevious()`
|
|
114
|
+
- `goToLocation(cfi)`
|
|
115
|
+
- `changeTheme(theme)`
|
|
116
|
+
- `changeFontSize(fontSize)` (example: `"12pt"`)
|
|
117
|
+
- `injectJavascript(script)`
|
|
118
|
+
- `progress`, `currentLocation`, `locations`, `meta`, `atStart`, `atEnd`, `fontSize`
|
|
20
119
|
|
|
21
|
-
|
|
120
|
+
## Theming
|
|
121
|
+
|
|
122
|
+
Theme shape:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
type Theme = {
|
|
126
|
+
[selector: string]: {
|
|
127
|
+
[cssProperty: string]: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
22
130
|
```
|
|
23
131
|
|
|
132
|
+
Example:
|
|
133
|
+
|
|
134
|
+
```ts
|
|
135
|
+
const darkTheme = {
|
|
136
|
+
body: { background: '#111' },
|
|
137
|
+
p: { color: '#f5f5f5' },
|
|
138
|
+
h1: { color: '#ffffff' },
|
|
139
|
+
a: { color: '#7cc7ff' },
|
|
140
|
+
};
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Then call `changeTheme(darkTheme)` through `ReaderContext`.
|
|
144
|
+
|
|
145
|
+
## Notes and Limitations
|
|
146
|
+
|
|
147
|
+
- `src` should point to an accessible remote `.epub` URL.
|
|
148
|
+
- The reader internally caches files in `expo-file-system` document storage.
|
|
149
|
+
- Internal WebView event names are consumed by the library; `onWebViewMessage` receives non-internal/custom events only.
|
|
150
|
+
|
|
151
|
+
## Troubleshooting
|
|
152
|
+
|
|
153
|
+
### Book does not render
|
|
154
|
+
|
|
155
|
+
- Verify that `src` is a valid `.epub` URL.
|
|
156
|
+
- Ensure network access and CORS/server rules allow download.
|
|
157
|
+
- Confirm `react-native-webview` and `expo-file-system` are installed.
|
|
158
|
+
|
|
159
|
+
### Gestures do not work
|
|
160
|
+
|
|
161
|
+
- Confirm `react-native-gesture-handler` is installed and configured in your app entrypoint.
|
|
162
|
+
|
|
163
|
+
### Loading never ends
|
|
164
|
+
|
|
165
|
+
- Check Metro/device logs for WebView or file system errors.
|
|
166
|
+
- Verify the downloaded file is not blocked or corrupted.
|
|
167
|
+
|
|
168
|
+
## Example App
|
|
169
|
+
|
|
170
|
+
This repository includes a working app in [example](example) showing minimal integration.
|
|
24
171
|
|
|
25
172
|
## Contributing
|
|
26
173
|
|
|
@@ -31,7 +178,3 @@ const result = multiply(3, 7);
|
|
|
31
178
|
## License
|
|
32
179
|
|
|
33
180
|
MIT
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
@@ -12,6 +12,7 @@ import WebView from 'react-native-webview';
|
|
|
12
12
|
import GestureHandler from "./GestureHandler/index.js";
|
|
13
13
|
import { defaultTheme as initialTheme } from "../constants/theme.js";
|
|
14
14
|
import { ReaderContext } from "../context/ReaderContext.js";
|
|
15
|
+
import INTERNAL_EVENTS from "../constants/internalEvents.js";
|
|
15
16
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
16
17
|
const Reader = ({
|
|
17
18
|
src,
|
|
@@ -24,9 +25,11 @@ const Reader = ({
|
|
|
24
25
|
onFinish = () => {},
|
|
25
26
|
onBeginning = () => {},
|
|
26
27
|
onPinch = () => {},
|
|
27
|
-
LoaderComponent
|
|
28
|
+
LoaderComponent,
|
|
29
|
+
onWebViewMessage
|
|
28
30
|
}) => {
|
|
29
31
|
const [templateUri, setTemplateUri] = useState('');
|
|
32
|
+
const [isReaderReady, setIsReaderReady] = useState(false);
|
|
30
33
|
const {
|
|
31
34
|
registerBook,
|
|
32
35
|
goNext,
|
|
@@ -49,7 +52,17 @@ const Reader = ({
|
|
|
49
52
|
} = useInjectWebViewVariables();
|
|
50
53
|
const bookRef = useRef(null);
|
|
51
54
|
const onMessage = event => {
|
|
52
|
-
|
|
55
|
+
let parsedEvent;
|
|
56
|
+
try {
|
|
57
|
+
parsedEvent = JSON.parse(event.nativeEvent.data);
|
|
58
|
+
} catch (error) {
|
|
59
|
+
console.warn('Failed to parse WebView message:', error);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
console.log(parsedEvent.type);
|
|
63
|
+
if (!INTERNAL_EVENTS.includes(parsedEvent?.type) && onWebViewMessage) {
|
|
64
|
+
return onWebViewMessage(parsedEvent);
|
|
65
|
+
}
|
|
53
66
|
switch (parsedEvent.type) {
|
|
54
67
|
case 'onLocationChange':
|
|
55
68
|
const {
|
|
@@ -83,10 +96,16 @@ const Reader = ({
|
|
|
83
96
|
setProgress(props.progress);
|
|
84
97
|
return onLocationsReady(props.epubKey, parsedEvent.locations);
|
|
85
98
|
case 'onReady':
|
|
99
|
+
setIsReaderReady(true);
|
|
100
|
+
setIsLoading(false);
|
|
86
101
|
if (initialLocation) {
|
|
87
102
|
goToLocation(initialLocation);
|
|
88
103
|
}
|
|
89
104
|
break;
|
|
105
|
+
case 'onDisplayError':
|
|
106
|
+
setIsLoading(false);
|
|
107
|
+
console.error('Reader display error:', parsedEvent.reason);
|
|
108
|
+
break;
|
|
90
109
|
case 'onBeginning':
|
|
91
110
|
setAtStart(true);
|
|
92
111
|
return onBeginning();
|
|
@@ -101,14 +120,17 @@ const Reader = ({
|
|
|
101
120
|
onTap?.();
|
|
102
121
|
};
|
|
103
122
|
const handleOnSwipeLeft = () => {
|
|
123
|
+
if (!isReaderReady) return;
|
|
104
124
|
onSwipeLeft?.();
|
|
105
125
|
goNext();
|
|
106
126
|
};
|
|
107
127
|
const handleOnSwipeRight = () => {
|
|
128
|
+
if (!isReaderReady) return;
|
|
108
129
|
onSwipeRight?.();
|
|
109
130
|
goPrevious();
|
|
110
131
|
};
|
|
111
132
|
const handleOnPinch = e => {
|
|
133
|
+
if (!isReaderReady) return;
|
|
112
134
|
const fontSizeValue = parseInt(fontSize.replace('pt', ''), 10);
|
|
113
135
|
const scaleValue = e.scale > 1 ? e.scale * 0.5 : e.scale;
|
|
114
136
|
const newFontSize = fontSizeValue * scaleValue;
|
|
@@ -129,6 +151,8 @@ const Reader = ({
|
|
|
129
151
|
const prepareReader = async () => {
|
|
130
152
|
try {
|
|
131
153
|
setIsLoading(true);
|
|
154
|
+
setIsReaderReady(false);
|
|
155
|
+
setTemplateUri('');
|
|
132
156
|
const [, jszip, epubjs] = await loadScripts();
|
|
133
157
|
if (!jszip || !epubjs) throw new Error('Failed to load scripts');
|
|
134
158
|
const localEpubUri = await downloadEpub(src, epubFileName);
|
|
@@ -146,8 +170,9 @@ const Reader = ({
|
|
|
146
170
|
}
|
|
147
171
|
} catch (error) {
|
|
148
172
|
console.error('Reader Error:', error);
|
|
149
|
-
|
|
150
|
-
|
|
173
|
+
if (isMounted) {
|
|
174
|
+
setIsLoading(false);
|
|
175
|
+
}
|
|
151
176
|
}
|
|
152
177
|
};
|
|
153
178
|
prepareReader();
|
|
@@ -155,7 +180,7 @@ const Reader = ({
|
|
|
155
180
|
isMounted = false;
|
|
156
181
|
};
|
|
157
182
|
}, [src, htmlTemplateName, epubFileName, injectWebViewVariables, setIsLoading]);
|
|
158
|
-
if (isLoading) {
|
|
183
|
+
if (isLoading || !templateUri) {
|
|
159
184
|
return LoaderComponent ? /*#__PURE__*/_jsx(LoaderComponent, {}) : /*#__PURE__*/_jsxs(View, {
|
|
160
185
|
style: styles.loaderContainer,
|
|
161
186
|
children: [/*#__PURE__*/_jsx(ActivityIndicator, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["View","Text","ActivityIndicator","StyleSheet","SourceType","useCallback","useContext","useEffect","useMemo","useRef","useState","loadScripts","saveTemplateToFile","downloadEpub","Paths","useInjectWebViewVariables","WebView","GestureHandler","defaultTheme","initialTheme","ReaderContext","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Reader","src","onTap","onSwipeLeft","onSwipeRight","initialLocation","onLocationsReady","onLocationChange","onFinish","onBeginning","onPinch","LoaderComponent","templateUri","setTemplateUri","registerBook","goNext","goPrevious","setMeta","setLocations","setTotalLocations","setCurrentLocation","setProgress","goToLocation","setAtEnd","setAtStart","fontSize","changeFontSize","setIsLoading","isLoading","injectWebViewVariables","bookRef","onMessage","event","parsedEvent","JSON","parse","nativeEvent","data","type","totalLocations","currentLocation","progress","currentSection","atStart","atEnd","metadata","props","locations","epubKey","
|
|
1
|
+
{"version":3,"names":["View","Text","ActivityIndicator","StyleSheet","SourceType","useCallback","useContext","useEffect","useMemo","useRef","useState","loadScripts","saveTemplateToFile","downloadEpub","Paths","useInjectWebViewVariables","WebView","GestureHandler","defaultTheme","initialTheme","ReaderContext","INTERNAL_EVENTS","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","Reader","src","onTap","onSwipeLeft","onSwipeRight","initialLocation","onLocationsReady","onLocationChange","onFinish","onBeginning","onPinch","LoaderComponent","onWebViewMessage","templateUri","setTemplateUri","isReaderReady","setIsReaderReady","registerBook","goNext","goPrevious","setMeta","setLocations","setTotalLocations","setCurrentLocation","setProgress","goToLocation","setAtEnd","setAtStart","fontSize","changeFontSize","setIsLoading","isLoading","injectWebViewVariables","bookRef","onMessage","event","parsedEvent","JSON","parse","nativeEvent","data","error","console","warn","log","type","includes","totalLocations","currentLocation","progress","currentSection","atStart","atEnd","metadata","props","locations","epubKey","reason","handleOnTap","handleOnSwipeLeft","handleOnSwipeRight","handleOnPinch","e","fontSizeValue","parseInt","replace","scaleValue","scale","newFontSize","clampedFontSize","Math","min","max","htmlTemplateName","split","pop","epubFileName","handleBookRef","instance","current","isMounted","prepareReader","jszip","epubjs","Error","localEpubUri","generatedTemplate","EPUB","allowScriptedContent","book","theme","uri","style","styles","loaderContainer","children","size","pointerEvents","ref","source","showsVerticalScrollIndicator","javaScriptEnabled","originWhitelist","scrollEnabled","mixedContentMode","allowingReadAccessToURL","document","allowUniversalAccessFromFileURLs","allowFileAccessFromFileURLs","allowFileAccess","javaScriptCanOpenWindowsAutomatically","container","create","flex","justifyContent","alignItems"],"sourceRoot":"../../../src","sources":["components/Reader.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,IAAI,EAAEC,iBAAiB,EAAEC,UAAU,QAAQ,cAAc;AACxE,SAASC,UAAU,QAA0B,mBAAU;AACvD,SACEC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,WAAW,QAAQ,2BAAwB;AACpD,SAASC,kBAAkB,QAAQ,kCAA+B;AAClE,SAASC,YAAY,QAAQ,4BAAyB;AACtD,SAASC,KAAK,QAAQ,kBAAkB;AACxC,SAASC,yBAAyB,QAAQ,uCAAoC;AAC9E,OAAOC,OAAO,MAAM,sBAAsB;AAC1C,OAAOC,cAAc,MAAM,2BAAkB;AAC7C,SAASC,YAAY,IAAIC,YAAY,QAAQ,uBAAoB;AACjE,SAASC,aAAa,QAAQ,6BAA0B;AAKxD,OAAOC,eAAe,MAAM,gCAA6B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAE1D,MAAMC,MAAM,GAAGA,CAAC;EACdC,GAAG;EACHC,KAAK;EACLC,WAAW;EACXC,YAAY;EACZC,eAAe;EACfC,gBAAgB,GAAGA,CAAA,KAAM,CAAC,CAAC;EAC3BC,gBAAgB,GAAGA,CAAA,KAAM,CAAC,CAAC;EAC3BC,QAAQ,GAAGA,CAAA,KAAM,CAAC,CAAC;EACnBC,WAAW,GAAGA,CAAA,KAAM,CAAC,CAAC;EACtBC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClBC,eAAe;EACfC;AACW,CAAC,KAAK;EACjB,MAAM,CAACC,WAAW,EAAEC,cAAc,CAAC,GAAGhC,QAAQ,CAAS,EAAE,CAAC;EAC1D,MAAM,CAACiC,aAAa,EAAEC,gBAA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ACF,CAAC,CAAC;AAEF,eAAenH,MAAM","ignoreList":[]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const INTERNAL_EVENTS = ['meta', 'onStarted', 'onReady', 'onDisplayError', 'onResized', 'onLocationChange', 'onSearch', 'onLocationsReady', 'onSelected', 'onOrientationChange', 'onBeginning', 'onFinish', 'onRendered', 'onLayout', 'onNavigationLoaded', 'onAddAnnotation', 'onChangeAnnotations', 'onSetInitialAnnotations', 'onPressAnnotation', 'onAddBookmark', 'onRemoveBookmark', 'onRemoveBookmarks', 'onUpdateBookmark'];
|
|
4
|
+
export default INTERNAL_EVENTS;
|
|
5
|
+
//# sourceMappingURL=internalEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["INTERNAL_EVENTS"],"sourceRoot":"../../../src","sources":["constants/internalEvents.ts"],"mappings":";;AAAA,MAAMA,eAAe,GAAG,CACtB,MAAM,EACN,WAAW,EACX,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,YAAY,EACZ,UAAU,EACV,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,CACnB;AAED,eAAeA,eAAe","ignoreList":[]}
|