@papyrus-sdk/ui-react-native 0.2.24 → 0.2.27
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 +3 -1
- package/dist/{chunk-B36LWZCX.mjs → chunk-K2ZLYLHR.mjs} +84 -1
- package/dist/chunk-K2ZLYLHR.mjs.map +1 -0
- package/dist/{chunk-B25KK4VL.mjs → chunk-KXNP73MZ.mjs} +1 -7
- package/dist/chunk-KXNP73MZ.mjs.map +1 -0
- package/dist/gesture/pinchZoom.d.mts +35 -1
- package/dist/gesture/pinchZoom.d.ts +35 -1
- package/dist/gesture/pinchZoom.js +89 -2
- package/dist/gesture/pinchZoom.js.map +1 -1
- package/dist/gesture/pinchZoom.mjs +11 -3
- package/dist/gesture/selectionInteraction.d.mts +1 -6
- package/dist/gesture/selectionInteraction.d.ts +1 -6
- package/dist/gesture/selectionInteraction.js +0 -7
- package/dist/gesture/selectionInteraction.js.map +1 -1
- package/dist/gesture/selectionInteraction.mjs +1 -3
- package/dist/index.d.mts +42 -28
- package/dist/index.d.ts +42 -28
- package/dist/index.js +4285 -2827
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4083 -2621
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -2
- package/runtime/comicRuntime.test.ts +151 -0
- package/runtime/documentLoadRuntime.test.ts +172 -0
- package/runtime/epubScrollDiagnostics.test.ts +107 -0
- package/runtime/epubScrollDiagnostics.ts +127 -0
- package/runtime/index.html +1529 -956
- package/runtime/runtime.js +590 -24
- package/runtime/syncComicRuntime.mjs +22 -6
- package/dist/chunk-B25KK4VL.mjs.map +0 -1
- package/dist/chunk-B36LWZCX.mjs.map +0 -1
|
@@ -2,16 +2,14 @@ import {
|
|
|
2
2
|
getSelectionEdgeAutoscroll,
|
|
3
3
|
getToolDockDismissState,
|
|
4
4
|
isToolDockToolSelected,
|
|
5
|
-
shouldAcceptSelectionRect,
|
|
6
5
|
shouldEnableSelectionDrag,
|
|
7
6
|
shouldEnableViewerScroll
|
|
8
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-KXNP73MZ.mjs";
|
|
9
8
|
import "../chunk-ZD7AOCMD.mjs";
|
|
10
9
|
export {
|
|
11
10
|
getSelectionEdgeAutoscroll,
|
|
12
11
|
getToolDockDismissState,
|
|
13
12
|
isToolDockToolSelected,
|
|
14
|
-
shouldAcceptSelectionRect,
|
|
15
13
|
shouldEnableSelectionDrag,
|
|
16
14
|
shouldEnableViewerScroll
|
|
17
15
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { DocumentEngine, PdfViewerMode, DocumentType, MobilePrimaryDestination, DocumentSource } from '@papyrus-sdk/types';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
4
|
import { PapyrusPageViewProps } from '@papyrus-sdk/engine-native';
|
|
4
5
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
5
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
interface ViewerProps {
|
|
8
8
|
engine: DocumentEngine;
|
|
@@ -11,18 +11,37 @@ interface ViewerProps {
|
|
|
11
11
|
removeClippedSubviews?: boolean;
|
|
12
12
|
useDedicatedAndroidPdfViewer?: boolean;
|
|
13
13
|
viewerMode?: PdfViewerMode;
|
|
14
|
-
|
|
15
|
-
text: string;
|
|
16
|
-
pageIndex: number;
|
|
17
|
-
}) => void;
|
|
18
|
-
onDefineSelection?: (payload: {
|
|
19
|
-
text: string;
|
|
20
|
-
pageIndex: number;
|
|
21
|
-
}) => void;
|
|
22
|
-
selectionActionLabel?: string;
|
|
14
|
+
pageScrubActive?: boolean;
|
|
23
15
|
}
|
|
24
16
|
declare const Viewer: React.FC<ViewerProps>;
|
|
25
17
|
|
|
18
|
+
type PerfSessionContext = {
|
|
19
|
+
runId?: string;
|
|
20
|
+
sampleId?: string;
|
|
21
|
+
documentLoadId?: string;
|
|
22
|
+
fixture: string;
|
|
23
|
+
};
|
|
24
|
+
type PerfSession = {
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
context: Readonly<PerfSessionContext>;
|
|
27
|
+
createId: (kind: string) => string;
|
|
28
|
+
emit: (name: string, payload?: Record<string, unknown>) => void;
|
|
29
|
+
};
|
|
30
|
+
type PerfSessionOptions = {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
context: PerfSessionContext;
|
|
33
|
+
now?: () => number;
|
|
34
|
+
sink?: (line: string) => void;
|
|
35
|
+
};
|
|
36
|
+
declare function createPerfSession({ enabled, context, now, sink }: PerfSessionOptions): PerfSession;
|
|
37
|
+
declare function createRunId(): string;
|
|
38
|
+
|
|
39
|
+
declare function MobilePerfProvider({ session, context, children }: PropsWithChildren<{
|
|
40
|
+
session?: PerfSession;
|
|
41
|
+
context?: PerfSessionContext;
|
|
42
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
43
|
+
declare function useMobilePerf(): PerfSession;
|
|
44
|
+
|
|
26
45
|
type PageViewComponentType = React.ComponentType<PapyrusPageViewProps & React.RefAttributes<any>>;
|
|
27
46
|
interface PageRendererProps {
|
|
28
47
|
engine: DocumentEngine;
|
|
@@ -35,18 +54,13 @@ interface PageRendererProps {
|
|
|
35
54
|
horizontalPadding?: number;
|
|
36
55
|
spacing?: number;
|
|
37
56
|
onSelectionDragActiveChange?: (active: boolean) => void;
|
|
38
|
-
|
|
39
|
-
text: string;
|
|
40
|
-
pageIndex: number;
|
|
41
|
-
}) => void;
|
|
42
|
-
onDefineSelection?: (payload: {
|
|
43
|
-
text: string;
|
|
44
|
-
pageIndex: number;
|
|
45
|
-
}) => void;
|
|
46
|
-
selectionActionLabel?: string;
|
|
57
|
+
onPageTap?: () => void;
|
|
47
58
|
gestureScrollLockActive?: boolean;
|
|
48
59
|
lastPinchEndedAt?: number | null;
|
|
49
60
|
requestSelectionVerticalAutoscroll?: (absoluteY: number) => number;
|
|
61
|
+
onRenderReady?: (pageIndex: number, renderedZoom: number) => void;
|
|
62
|
+
surfaceId?: string;
|
|
63
|
+
gestureId?: string;
|
|
50
64
|
}
|
|
51
65
|
declare const _default: React.NamedExoticComponent<PageRendererProps>;
|
|
52
66
|
|
|
@@ -119,13 +133,8 @@ declare function ReadingShell({ engine, title, documentType, thumbsInitialCount,
|
|
|
119
133
|
|
|
120
134
|
type DedicatedAndroidPdfViewerProps = {
|
|
121
135
|
engine: DocumentEngine;
|
|
122
|
-
onDefineSelection?: (payload: {
|
|
123
|
-
text: string;
|
|
124
|
-
pageIndex: number;
|
|
125
|
-
}) => void;
|
|
126
|
-
selectionActionLabel?: string;
|
|
127
136
|
};
|
|
128
|
-
declare function DedicatedAndroidPdfViewer({ engine,
|
|
137
|
+
declare function DedicatedAndroidPdfViewer({ engine, }: DedicatedAndroidPdfViewerProps): react_jsx_runtime.JSX.Element;
|
|
129
138
|
|
|
130
139
|
type OverflowSheetProps = {
|
|
131
140
|
visible: boolean;
|
|
@@ -152,8 +161,10 @@ type ProgressPillProps = {
|
|
|
152
161
|
documentType: DocumentType;
|
|
153
162
|
onPress: () => void;
|
|
154
163
|
onOpenPageJump?: () => void;
|
|
164
|
+
onNavigateToPage?: (page: number) => void;
|
|
165
|
+
onScrubbingChange?: (active: boolean) => void;
|
|
155
166
|
};
|
|
156
|
-
declare function ProgressPill({ documentType, onPress, onOpenPageJump, }: ProgressPillProps): react_jsx_runtime.JSX.Element;
|
|
167
|
+
declare function ProgressPill({ documentType, onPress, onOpenPageJump, onNavigateToPage, onScrubbingChange, }: ProgressPillProps): react_jsx_runtime.JSX.Element;
|
|
157
168
|
|
|
158
169
|
type SearchOverlayProps = {
|
|
159
170
|
engine: DocumentEngine;
|
|
@@ -186,6 +197,9 @@ declare const MOBILE_CHROME_METRICS: {
|
|
|
186
197
|
readonly topbarPageButtonSize: 30;
|
|
187
198
|
readonly bottomBarItemPaddingHorizontal: 5;
|
|
188
199
|
readonly bottomBarItemPaddingVertical: 3;
|
|
200
|
+
readonly topbarHeight: 56;
|
|
201
|
+
readonly progressGap: 18;
|
|
202
|
+
readonly progressHorizontalOffset: 10;
|
|
189
203
|
};
|
|
190
204
|
|
|
191
|
-
export { AnnotationEditor, BottomBar, CoverPreview, DocumentActionsSheet, InfoSheet, MOBILE_CHROME_METRICS, DedicatedAndroidPdfViewer as NativePdfDocumentViewer, OverflowSheet, _default as PageRenderer, ProgressPill, ReadingShell, RightSheet, SearchOverlay, SearchResultsSheet, SettingsSheet, ToolDock, Topbar, Viewer };
|
|
205
|
+
export { AnnotationEditor, BottomBar, CoverPreview, DocumentActionsSheet, InfoSheet, MOBILE_CHROME_METRICS, MobilePerfProvider, DedicatedAndroidPdfViewer as NativePdfDocumentViewer, OverflowSheet, _default as PageRenderer, ProgressPill, ReadingShell, RightSheet, SearchOverlay, SearchResultsSheet, SettingsSheet, ToolDock, Topbar, Viewer, createPerfSession, createRunId, useMobilePerf };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
2
|
import { DocumentEngine, PdfViewerMode, DocumentType, MobilePrimaryDestination, DocumentSource } from '@papyrus-sdk/types';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
4
|
import { PapyrusPageViewProps } from '@papyrus-sdk/engine-native';
|
|
4
5
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
5
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
|
|
7
7
|
interface ViewerProps {
|
|
8
8
|
engine: DocumentEngine;
|
|
@@ -11,18 +11,37 @@ interface ViewerProps {
|
|
|
11
11
|
removeClippedSubviews?: boolean;
|
|
12
12
|
useDedicatedAndroidPdfViewer?: boolean;
|
|
13
13
|
viewerMode?: PdfViewerMode;
|
|
14
|
-
|
|
15
|
-
text: string;
|
|
16
|
-
pageIndex: number;
|
|
17
|
-
}) => void;
|
|
18
|
-
onDefineSelection?: (payload: {
|
|
19
|
-
text: string;
|
|
20
|
-
pageIndex: number;
|
|
21
|
-
}) => void;
|
|
22
|
-
selectionActionLabel?: string;
|
|
14
|
+
pageScrubActive?: boolean;
|
|
23
15
|
}
|
|
24
16
|
declare const Viewer: React.FC<ViewerProps>;
|
|
25
17
|
|
|
18
|
+
type PerfSessionContext = {
|
|
19
|
+
runId?: string;
|
|
20
|
+
sampleId?: string;
|
|
21
|
+
documentLoadId?: string;
|
|
22
|
+
fixture: string;
|
|
23
|
+
};
|
|
24
|
+
type PerfSession = {
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
context: Readonly<PerfSessionContext>;
|
|
27
|
+
createId: (kind: string) => string;
|
|
28
|
+
emit: (name: string, payload?: Record<string, unknown>) => void;
|
|
29
|
+
};
|
|
30
|
+
type PerfSessionOptions = {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
context: PerfSessionContext;
|
|
33
|
+
now?: () => number;
|
|
34
|
+
sink?: (line: string) => void;
|
|
35
|
+
};
|
|
36
|
+
declare function createPerfSession({ enabled, context, now, sink }: PerfSessionOptions): PerfSession;
|
|
37
|
+
declare function createRunId(): string;
|
|
38
|
+
|
|
39
|
+
declare function MobilePerfProvider({ session, context, children }: PropsWithChildren<{
|
|
40
|
+
session?: PerfSession;
|
|
41
|
+
context?: PerfSessionContext;
|
|
42
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
43
|
+
declare function useMobilePerf(): PerfSession;
|
|
44
|
+
|
|
26
45
|
type PageViewComponentType = React.ComponentType<PapyrusPageViewProps & React.RefAttributes<any>>;
|
|
27
46
|
interface PageRendererProps {
|
|
28
47
|
engine: DocumentEngine;
|
|
@@ -35,18 +54,13 @@ interface PageRendererProps {
|
|
|
35
54
|
horizontalPadding?: number;
|
|
36
55
|
spacing?: number;
|
|
37
56
|
onSelectionDragActiveChange?: (active: boolean) => void;
|
|
38
|
-
|
|
39
|
-
text: string;
|
|
40
|
-
pageIndex: number;
|
|
41
|
-
}) => void;
|
|
42
|
-
onDefineSelection?: (payload: {
|
|
43
|
-
text: string;
|
|
44
|
-
pageIndex: number;
|
|
45
|
-
}) => void;
|
|
46
|
-
selectionActionLabel?: string;
|
|
57
|
+
onPageTap?: () => void;
|
|
47
58
|
gestureScrollLockActive?: boolean;
|
|
48
59
|
lastPinchEndedAt?: number | null;
|
|
49
60
|
requestSelectionVerticalAutoscroll?: (absoluteY: number) => number;
|
|
61
|
+
onRenderReady?: (pageIndex: number, renderedZoom: number) => void;
|
|
62
|
+
surfaceId?: string;
|
|
63
|
+
gestureId?: string;
|
|
50
64
|
}
|
|
51
65
|
declare const _default: React.NamedExoticComponent<PageRendererProps>;
|
|
52
66
|
|
|
@@ -119,13 +133,8 @@ declare function ReadingShell({ engine, title, documentType, thumbsInitialCount,
|
|
|
119
133
|
|
|
120
134
|
type DedicatedAndroidPdfViewerProps = {
|
|
121
135
|
engine: DocumentEngine;
|
|
122
|
-
onDefineSelection?: (payload: {
|
|
123
|
-
text: string;
|
|
124
|
-
pageIndex: number;
|
|
125
|
-
}) => void;
|
|
126
|
-
selectionActionLabel?: string;
|
|
127
136
|
};
|
|
128
|
-
declare function DedicatedAndroidPdfViewer({ engine,
|
|
137
|
+
declare function DedicatedAndroidPdfViewer({ engine, }: DedicatedAndroidPdfViewerProps): react_jsx_runtime.JSX.Element;
|
|
129
138
|
|
|
130
139
|
type OverflowSheetProps = {
|
|
131
140
|
visible: boolean;
|
|
@@ -152,8 +161,10 @@ type ProgressPillProps = {
|
|
|
152
161
|
documentType: DocumentType;
|
|
153
162
|
onPress: () => void;
|
|
154
163
|
onOpenPageJump?: () => void;
|
|
164
|
+
onNavigateToPage?: (page: number) => void;
|
|
165
|
+
onScrubbingChange?: (active: boolean) => void;
|
|
155
166
|
};
|
|
156
|
-
declare function ProgressPill({ documentType, onPress, onOpenPageJump, }: ProgressPillProps): react_jsx_runtime.JSX.Element;
|
|
167
|
+
declare function ProgressPill({ documentType, onPress, onOpenPageJump, onNavigateToPage, onScrubbingChange, }: ProgressPillProps): react_jsx_runtime.JSX.Element;
|
|
157
168
|
|
|
158
169
|
type SearchOverlayProps = {
|
|
159
170
|
engine: DocumentEngine;
|
|
@@ -186,6 +197,9 @@ declare const MOBILE_CHROME_METRICS: {
|
|
|
186
197
|
readonly topbarPageButtonSize: 30;
|
|
187
198
|
readonly bottomBarItemPaddingHorizontal: 5;
|
|
188
199
|
readonly bottomBarItemPaddingVertical: 3;
|
|
200
|
+
readonly topbarHeight: 56;
|
|
201
|
+
readonly progressGap: 18;
|
|
202
|
+
readonly progressHorizontalOffset: 10;
|
|
189
203
|
};
|
|
190
204
|
|
|
191
|
-
export { AnnotationEditor, BottomBar, CoverPreview, DocumentActionsSheet, InfoSheet, MOBILE_CHROME_METRICS, DedicatedAndroidPdfViewer as NativePdfDocumentViewer, OverflowSheet, _default as PageRenderer, ProgressPill, ReadingShell, RightSheet, SearchOverlay, SearchResultsSheet, SettingsSheet, ToolDock, Topbar, Viewer };
|
|
205
|
+
export { AnnotationEditor, BottomBar, CoverPreview, DocumentActionsSheet, InfoSheet, MOBILE_CHROME_METRICS, MobilePerfProvider, DedicatedAndroidPdfViewer as NativePdfDocumentViewer, OverflowSheet, _default as PageRenderer, ProgressPill, ReadingShell, RightSheet, SearchOverlay, SearchResultsSheet, SettingsSheet, ToolDock, Topbar, Viewer, createPerfSession, createRunId, useMobilePerf };
|