@papyrus-sdk/ui-react-native 0.2.20 → 0.2.22

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 CHANGED
@@ -20,12 +20,23 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler';
20
20
  </GestureHandlerRootView>
21
21
  ```
22
22
 
23
- For EPUB/TXT previews on mobile:
23
+ For EPUB/TXT/CBZ previews on mobile:
24
24
 
25
25
  ```bash
26
26
  npm install react-native-webview
27
27
  ```
28
28
 
29
+ `MobileDocumentEngine` recognizes `.cbz` as `comic` and renders it in the
30
+ same WebView runtime used by the mobile reader: continuous scrolling, lazy
31
+ page extraction, bounded object-URL cache, and on-demand page previews in the
32
+ navigation sheet. CBR is intentionally kept out of the base mobile runtime;
33
+ RAR support needs the optional libarchive worker/WASM payload.
34
+
35
+ CBR mobile support is experimental and requires
36
+ `@papyrus-sdk/engine-cbr-mobile`. Its Android WebView flow is not a substitute
37
+ for device validation on iOS or Android, especially for picker-provided
38
+ `content://` and `file://` sources.
39
+
29
40
  ## Usage
30
41
 
31
42
  ```tsx
package/dist/index.d.mts CHANGED
@@ -11,6 +11,14 @@ interface ViewerProps {
11
11
  removeClippedSubviews?: boolean;
12
12
  useDedicatedAndroidPdfViewer?: boolean;
13
13
  viewerMode?: PdfViewerMode;
14
+ onTextSelected?: (payload: {
15
+ text: string;
16
+ pageIndex: number;
17
+ }) => void;
18
+ onDefineSelection?: (payload: {
19
+ text: string;
20
+ pageIndex: number;
21
+ }) => void;
14
22
  }
15
23
  declare const Viewer: React.FC<ViewerProps>;
16
24
 
@@ -26,6 +34,14 @@ interface PageRendererProps {
26
34
  horizontalPadding?: number;
27
35
  spacing?: number;
28
36
  onSelectionDragActiveChange?: (active: boolean) => void;
37
+ onTextSelected?: (payload: {
38
+ text: string;
39
+ pageIndex: number;
40
+ }) => void;
41
+ onDefineSelection?: (payload: {
42
+ text: string;
43
+ pageIndex: number;
44
+ }) => void;
29
45
  gestureScrollLockActive?: boolean;
30
46
  lastPinchEndedAt?: number | null;
31
47
  requestSelectionVerticalAutoscroll?: (absoluteY: number) => number;
@@ -95,7 +111,7 @@ type ReadingShellProps = {
95
111
  title?: string;
96
112
  documentType?: DocumentType;
97
113
  thumbsInitialCount?: number;
98
- viewerProps?: React.ComponentProps<typeof Viewer>;
114
+ viewerProps?: Omit<React.ComponentProps<typeof Viewer>, "engine">;
99
115
  };
100
116
  declare function ReadingShell({ engine, title, documentType, thumbsInitialCount, viewerProps, }: ReadingShellProps): react_jsx_runtime.JSX.Element;
101
117
 
package/dist/index.d.ts CHANGED
@@ -11,6 +11,14 @@ interface ViewerProps {
11
11
  removeClippedSubviews?: boolean;
12
12
  useDedicatedAndroidPdfViewer?: boolean;
13
13
  viewerMode?: PdfViewerMode;
14
+ onTextSelected?: (payload: {
15
+ text: string;
16
+ pageIndex: number;
17
+ }) => void;
18
+ onDefineSelection?: (payload: {
19
+ text: string;
20
+ pageIndex: number;
21
+ }) => void;
14
22
  }
15
23
  declare const Viewer: React.FC<ViewerProps>;
16
24
 
@@ -26,6 +34,14 @@ interface PageRendererProps {
26
34
  horizontalPadding?: number;
27
35
  spacing?: number;
28
36
  onSelectionDragActiveChange?: (active: boolean) => void;
37
+ onTextSelected?: (payload: {
38
+ text: string;
39
+ pageIndex: number;
40
+ }) => void;
41
+ onDefineSelection?: (payload: {
42
+ text: string;
43
+ pageIndex: number;
44
+ }) => void;
29
45
  gestureScrollLockActive?: boolean;
30
46
  lastPinchEndedAt?: number | null;
31
47
  requestSelectionVerticalAutoscroll?: (absoluteY: number) => number;
@@ -95,7 +111,7 @@ type ReadingShellProps = {
95
111
  title?: string;
96
112
  documentType?: DocumentType;
97
113
  thumbsInitialCount?: number;
98
- viewerProps?: React.ComponentProps<typeof Viewer>;
114
+ viewerProps?: Omit<React.ComponentProps<typeof Viewer>, "engine">;
99
115
  };
100
116
  declare function ReadingShell({ engine, title, documentType, thumbsInitialCount, viewerProps, }: ReadingShellProps): react_jsx_runtime.JSX.Element;
101
117