@papyrus-sdk/ui-react-native 0.2.35-beta.8 → 0.2.35
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/LICENSE +21 -0
- package/dist/index.d.mts +17 -3
- package/dist/index.d.ts +17 -3
- package/dist/index.js +2423 -1793
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2033 -1409
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -13
- package/runtime/comicRuntime.test.ts +9 -9
- package/runtime/epubAnnotations.js +121 -0
- package/runtime/epubAnnotations.test.ts +35 -0
- package/runtime/epubReader.js +58 -0
- package/runtime/epubReader.test.ts +74 -0
- package/runtime/epubRuntime.test.ts +48 -0
- package/runtime/epubSelectionMenu.test.ts +39 -0
- package/runtime/index.html +449 -67
- package/runtime/runtime.js +449 -67
- package/runtime/syncComicRuntime.mjs +8 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Papyrus Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.mts
CHANGED
|
@@ -5,7 +5,10 @@ import { PapyrusPageViewProps } from '@papyrus-sdk/engine-native';
|
|
|
5
5
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
6
6
|
|
|
7
7
|
interface ViewerProps {
|
|
8
|
+
documentType?: string;
|
|
8
9
|
engine: DocumentEngine;
|
|
10
|
+
/** Stable file identity, never the native engine/session ID. */
|
|
11
|
+
documentId?: string;
|
|
9
12
|
/** Maximum page width at fit zoom, in React Native points; pinch zoom may enlarge it. */
|
|
10
13
|
maxPageWidth?: number;
|
|
11
14
|
/**
|
|
@@ -77,6 +80,7 @@ declare function useMobilePerf(): PerfSession;
|
|
|
77
80
|
type PageViewComponentType = React.ComponentType<PapyrusPageViewProps & React.RefAttributes<any>>;
|
|
78
81
|
interface PageRendererProps {
|
|
79
82
|
engine: DocumentEngine;
|
|
83
|
+
documentId?: string;
|
|
80
84
|
pageIndex: number;
|
|
81
85
|
scale?: number;
|
|
82
86
|
pageAspectRatio?: number;
|
|
@@ -100,6 +104,7 @@ declare const _default: React.NamedExoticComponent<PageRendererProps>;
|
|
|
100
104
|
|
|
101
105
|
interface TopbarProps {
|
|
102
106
|
engine: DocumentEngine;
|
|
107
|
+
documentType?: string;
|
|
103
108
|
onOpenSettings?: () => void;
|
|
104
109
|
onOpenOverflow?: () => void;
|
|
105
110
|
title?: string;
|
|
@@ -121,12 +126,17 @@ interface RightSheetProps {
|
|
|
121
126
|
}
|
|
122
127
|
declare const RightSheet: React.FC<RightSheetProps>;
|
|
123
128
|
|
|
124
|
-
declare const AnnotationEditor: React.FC
|
|
129
|
+
declare const AnnotationEditor: React.FC<{
|
|
130
|
+
documentId?: string;
|
|
131
|
+
}>;
|
|
125
132
|
|
|
126
133
|
type BottomBarProps = {
|
|
127
134
|
documentType: DocumentType;
|
|
128
135
|
onOpenInfo: () => void;
|
|
129
136
|
onOpenSettings: () => void;
|
|
137
|
+
onTurnPage?: (direction: -1 | 1) => void;
|
|
138
|
+
onNavigateToPage?: (page: number) => void;
|
|
139
|
+
onOpenPages?: () => void;
|
|
130
140
|
onOpenDestination?: (destination: MobilePrimaryDestination) => void;
|
|
131
141
|
};
|
|
132
142
|
declare const BottomBar: React.FC<BottomBarProps>;
|
|
@@ -136,6 +146,7 @@ interface SettingsSheetProps {
|
|
|
136
146
|
visible: boolean;
|
|
137
147
|
onClose: () => void;
|
|
138
148
|
documentType?: DocumentType;
|
|
149
|
+
onOpenInfo?: () => void;
|
|
139
150
|
}
|
|
140
151
|
declare const SettingsSheet: React.FC<SettingsSheetProps>;
|
|
141
152
|
|
|
@@ -168,6 +179,7 @@ declare function ReadingShell({ engine, title, documentType, thumbsInitialCount,
|
|
|
168
179
|
|
|
169
180
|
type NativePdfDocumentViewerProps = {
|
|
170
181
|
engine: DocumentEngine;
|
|
182
|
+
documentId?: string;
|
|
171
183
|
maxPageWidth?: number;
|
|
172
184
|
onTextSelected?: (payload: {
|
|
173
185
|
text: string;
|
|
@@ -179,7 +191,7 @@ type NativePdfDocumentViewerProps = {
|
|
|
179
191
|
}) => void;
|
|
180
192
|
defineSelectionMode?: "selection" | "single-word";
|
|
181
193
|
};
|
|
182
|
-
declare function NativePdfDocumentViewer({ engine, maxPageWidth, onTextSelected, onDefineSelection, defineSelectionMode, }: NativePdfDocumentViewerProps): react_jsx_runtime.JSX.Element;
|
|
194
|
+
declare function NativePdfDocumentViewer({ engine, documentId, maxPageWidth, onTextSelected, onDefineSelection, defineSelectionMode, }: NativePdfDocumentViewerProps): react_jsx_runtime.JSX.Element;
|
|
183
195
|
|
|
184
196
|
type OverflowSheetProps = {
|
|
185
197
|
visible: boolean;
|
|
@@ -204,12 +216,14 @@ declare function DocumentActionsSheet({ visible, onClose, }: DocumentActionsShee
|
|
|
204
216
|
|
|
205
217
|
type ProgressPillProps = {
|
|
206
218
|
documentType: DocumentType;
|
|
219
|
+
navigationInDock?: boolean;
|
|
207
220
|
onPress: () => void;
|
|
208
221
|
onOpenPageJump?: () => void;
|
|
209
222
|
onNavigateToPage?: (page: number) => void;
|
|
223
|
+
onTurnPage?: (direction: -1 | 1) => void;
|
|
210
224
|
onScrubbingChange?: (active: boolean) => void;
|
|
211
225
|
};
|
|
212
|
-
declare function ProgressPill({ documentType, onPress, onOpenPageJump, onNavigateToPage, onScrubbingChange, }: ProgressPillProps): react_jsx_runtime.JSX.Element;
|
|
226
|
+
declare function ProgressPill({ documentType, navigationInDock, onPress, onOpenPageJump, onNavigateToPage, onTurnPage, onScrubbingChange, }: ProgressPillProps): react_jsx_runtime.JSX.Element;
|
|
213
227
|
|
|
214
228
|
type SearchOverlayProps = {
|
|
215
229
|
engine: DocumentEngine;
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,10 @@ import { PapyrusPageViewProps } from '@papyrus-sdk/engine-native';
|
|
|
5
5
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
6
6
|
|
|
7
7
|
interface ViewerProps {
|
|
8
|
+
documentType?: string;
|
|
8
9
|
engine: DocumentEngine;
|
|
10
|
+
/** Stable file identity, never the native engine/session ID. */
|
|
11
|
+
documentId?: string;
|
|
9
12
|
/** Maximum page width at fit zoom, in React Native points; pinch zoom may enlarge it. */
|
|
10
13
|
maxPageWidth?: number;
|
|
11
14
|
/**
|
|
@@ -77,6 +80,7 @@ declare function useMobilePerf(): PerfSession;
|
|
|
77
80
|
type PageViewComponentType = React.ComponentType<PapyrusPageViewProps & React.RefAttributes<any>>;
|
|
78
81
|
interface PageRendererProps {
|
|
79
82
|
engine: DocumentEngine;
|
|
83
|
+
documentId?: string;
|
|
80
84
|
pageIndex: number;
|
|
81
85
|
scale?: number;
|
|
82
86
|
pageAspectRatio?: number;
|
|
@@ -100,6 +104,7 @@ declare const _default: React.NamedExoticComponent<PageRendererProps>;
|
|
|
100
104
|
|
|
101
105
|
interface TopbarProps {
|
|
102
106
|
engine: DocumentEngine;
|
|
107
|
+
documentType?: string;
|
|
103
108
|
onOpenSettings?: () => void;
|
|
104
109
|
onOpenOverflow?: () => void;
|
|
105
110
|
title?: string;
|
|
@@ -121,12 +126,17 @@ interface RightSheetProps {
|
|
|
121
126
|
}
|
|
122
127
|
declare const RightSheet: React.FC<RightSheetProps>;
|
|
123
128
|
|
|
124
|
-
declare const AnnotationEditor: React.FC
|
|
129
|
+
declare const AnnotationEditor: React.FC<{
|
|
130
|
+
documentId?: string;
|
|
131
|
+
}>;
|
|
125
132
|
|
|
126
133
|
type BottomBarProps = {
|
|
127
134
|
documentType: DocumentType;
|
|
128
135
|
onOpenInfo: () => void;
|
|
129
136
|
onOpenSettings: () => void;
|
|
137
|
+
onTurnPage?: (direction: -1 | 1) => void;
|
|
138
|
+
onNavigateToPage?: (page: number) => void;
|
|
139
|
+
onOpenPages?: () => void;
|
|
130
140
|
onOpenDestination?: (destination: MobilePrimaryDestination) => void;
|
|
131
141
|
};
|
|
132
142
|
declare const BottomBar: React.FC<BottomBarProps>;
|
|
@@ -136,6 +146,7 @@ interface SettingsSheetProps {
|
|
|
136
146
|
visible: boolean;
|
|
137
147
|
onClose: () => void;
|
|
138
148
|
documentType?: DocumentType;
|
|
149
|
+
onOpenInfo?: () => void;
|
|
139
150
|
}
|
|
140
151
|
declare const SettingsSheet: React.FC<SettingsSheetProps>;
|
|
141
152
|
|
|
@@ -168,6 +179,7 @@ declare function ReadingShell({ engine, title, documentType, thumbsInitialCount,
|
|
|
168
179
|
|
|
169
180
|
type NativePdfDocumentViewerProps = {
|
|
170
181
|
engine: DocumentEngine;
|
|
182
|
+
documentId?: string;
|
|
171
183
|
maxPageWidth?: number;
|
|
172
184
|
onTextSelected?: (payload: {
|
|
173
185
|
text: string;
|
|
@@ -179,7 +191,7 @@ type NativePdfDocumentViewerProps = {
|
|
|
179
191
|
}) => void;
|
|
180
192
|
defineSelectionMode?: "selection" | "single-word";
|
|
181
193
|
};
|
|
182
|
-
declare function NativePdfDocumentViewer({ engine, maxPageWidth, onTextSelected, onDefineSelection, defineSelectionMode, }: NativePdfDocumentViewerProps): react_jsx_runtime.JSX.Element;
|
|
194
|
+
declare function NativePdfDocumentViewer({ engine, documentId, maxPageWidth, onTextSelected, onDefineSelection, defineSelectionMode, }: NativePdfDocumentViewerProps): react_jsx_runtime.JSX.Element;
|
|
183
195
|
|
|
184
196
|
type OverflowSheetProps = {
|
|
185
197
|
visible: boolean;
|
|
@@ -204,12 +216,14 @@ declare function DocumentActionsSheet({ visible, onClose, }: DocumentActionsShee
|
|
|
204
216
|
|
|
205
217
|
type ProgressPillProps = {
|
|
206
218
|
documentType: DocumentType;
|
|
219
|
+
navigationInDock?: boolean;
|
|
207
220
|
onPress: () => void;
|
|
208
221
|
onOpenPageJump?: () => void;
|
|
209
222
|
onNavigateToPage?: (page: number) => void;
|
|
223
|
+
onTurnPage?: (direction: -1 | 1) => void;
|
|
210
224
|
onScrubbingChange?: (active: boolean) => void;
|
|
211
225
|
};
|
|
212
|
-
declare function ProgressPill({ documentType, onPress, onOpenPageJump, onNavigateToPage, onScrubbingChange, }: ProgressPillProps): react_jsx_runtime.JSX.Element;
|
|
226
|
+
declare function ProgressPill({ documentType, navigationInDock, onPress, onOpenPageJump, onNavigateToPage, onTurnPage, onScrubbingChange, }: ProgressPillProps): react_jsx_runtime.JSX.Element;
|
|
213
227
|
|
|
214
228
|
type SearchOverlayProps = {
|
|
215
229
|
engine: DocumentEngine;
|