@prose-reader/react-native 13.0.5 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/index.d.ts +5 -3
- package/dist/web/index.cjs +1 -1
- package/dist/web/index.d.ts +1 -1
- package/dist/web/index.js +2 -2
- package/package.json +7 -7
package/dist/shared/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContextState, createReader, EnhancerPaginationInfo } from '@prose-reader/core';
|
|
1
|
+
import { ContextState, createReader, EnhancerPaginationInfo, NavigationTarget } from '@prose-reader/core';
|
|
2
2
|
import { Bridge, BridgeStore } from '@webview-bridge/react-native';
|
|
3
3
|
type ReaderOptions = Parameters<typeof createReader>[0];
|
|
4
4
|
type RnContextState = Omit<ContextState, "rootElement">;
|
|
@@ -6,9 +6,11 @@ type RnContextState = Omit<ContextState, "rootElement">;
|
|
|
6
6
|
* What the native side decides about the reader a `load` creates: the book,
|
|
7
7
|
* and where to open it. They are the reader options that cross the bridge,
|
|
8
8
|
* named as the reader names them, so the web side's factory spreads them into
|
|
9
|
-
* the rest.
|
|
9
|
+
* the rest. Only the targets that are plain data can cross it.
|
|
10
10
|
*/
|
|
11
|
-
export type ReaderLoadOptions = Pick<ReaderOptions, "manifest"
|
|
11
|
+
export type ReaderLoadOptions = Pick<ReaderOptions, "manifest"> & {
|
|
12
|
+
target?: NavigationTarget<"cfi" | "spineItem">;
|
|
13
|
+
};
|
|
12
14
|
/**
|
|
13
15
|
* What the web side reports of the reader of the book last loaded. Each value
|
|
14
16
|
* is `null` until that reader has reported it: `null` rather than `undefined`
|
package/dist/web/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@webview-bridge/web"),t=require("rxjs");var n=()=>(0,e.linkBridge)({onReady:async()=>{}}),r=({bridge:e,createReader:n,containerElement:r})=>{let i;return e.addEventListener(`load`,({load:a,options:{manifest:o,
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@webview-bridge/web"),t=require("rxjs");var n=()=>(0,e.linkBridge)({onReady:async()=>{}}),r=({bridge:e,createReader:n,containerElement:r})=>{let i;return e.addEventListener(`load`,({load:a,options:{manifest:o,target:s}})=>{i?.subscription.unsubscribe(),i?.reader.destroy(),i=void 0;let c=n({manifest:o,target:s}),l=new t.Subscription;i={reader:c,subscription:l},c.mount(r);let u=(0,t.merge)(c.pagination.state$.pipe((0,t.map)(e=>({pagination:e}))),c.context.pipe((0,t.map)(({rootElement:e,...t})=>({context:t}))),c.navigation.readingPosition$.pipe((0,t.map)(e=>({readingPosition:e}))));l.add(u.subscribe(t=>{e.report(a,t)}))}),e.addEventListener(`turnRight`,()=>{i?.reader.navigation.turnRight()}),e.addEventListener(`turnLeft`,()=>{i?.reader.navigation.turnLeft()}),{getReader:()=>i?.reader}};exports.bridgeReader=r,exports.createReaderBridge=n;
|
package/dist/web/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare const createReaderBridge: () => import('@webview-bridge/web').Lin
|
|
|
11
11
|
export declare const bridgeReader: ({ bridge, createReader, containerElement, }: {
|
|
12
12
|
/**
|
|
13
13
|
* Factory invoked for every `load` event coming from the native side, with
|
|
14
|
-
* the options that event carries: the manifest, and
|
|
14
|
+
* the options that event carries: the manifest, and where to open it.
|
|
15
15
|
* A reader renders a single book: a subsequent `load` destroys the
|
|
16
16
|
* previous reader and creates a fresh one from the new options.
|
|
17
17
|
*/
|
package/dist/web/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import { Subscription as t, map as n, merge as r } from "rxjs";
|
|
|
3
3
|
//#region src/web/index.ts
|
|
4
4
|
var i = () => e({ onReady: async () => {} }), a = ({ bridge: e, createReader: i, containerElement: a }) => {
|
|
5
5
|
let o;
|
|
6
|
-
return e.addEventListener("load", ({ load: s, options: { manifest: c,
|
|
6
|
+
return e.addEventListener("load", ({ load: s, options: { manifest: c, target: l } }) => {
|
|
7
7
|
o?.subscription.unsubscribe(), o?.reader.destroy(), o = void 0;
|
|
8
8
|
let u = i({
|
|
9
9
|
manifest: c,
|
|
10
|
-
|
|
10
|
+
target: l
|
|
11
11
|
}), d = new t();
|
|
12
12
|
o = {
|
|
13
13
|
reader: u,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prose-reader/react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/native/index.cjs",
|
|
6
6
|
"module": "./dist/native/index.js",
|
|
@@ -43,16 +43,16 @@
|
|
|
43
43
|
"react-native-webview": "13.16.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@prose-reader/archive-reader": "^
|
|
47
|
-
"@prose-reader/core": "^
|
|
48
|
-
"@prose-reader/shared": "^
|
|
49
|
-
"@prose-reader/streamer": "^
|
|
46
|
+
"@prose-reader/archive-reader": "^15.0.0",
|
|
47
|
+
"@prose-reader/core": "^15.0.0",
|
|
48
|
+
"@prose-reader/shared": "^15.0.0",
|
|
49
|
+
"@prose-reader/streamer": "^15.0.0",
|
|
50
50
|
"@webview-bridge/react-native": "^1.7.7",
|
|
51
51
|
"@webview-bridge/web": "^1.7.7",
|
|
52
52
|
"expo-file-system": "^57.0.0",
|
|
53
53
|
"react": "19.x",
|
|
54
54
|
"react-native-webview": "*",
|
|
55
|
-
"rxjs": "
|
|
55
|
+
"rxjs": "^7.5.5"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "0a989651b686de1223542b0f4572a0efad9323f1"
|
|
58
58
|
}
|