@papyrus-sdk/ui-react-native 0.2.24 → 0.2.26
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 +38 -27
- package/dist/index.d.ts +38 -27
- package/dist/index.js +3939 -2799
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3723 -2586
- 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,36 @@ 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;
|
|
22
|
-
selectionActionLabel?: string;
|
|
23
14
|
}
|
|
24
15
|
declare const Viewer: React.FC<ViewerProps>;
|
|
25
16
|
|
|
17
|
+
type PerfSessionContext = {
|
|
18
|
+
runId?: string;
|
|
19
|
+
sampleId?: string;
|
|
20
|
+
documentLoadId?: string;
|
|
21
|
+
fixture: string;
|
|
22
|
+
};
|
|
23
|
+
type PerfSession = {
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
context: Readonly<PerfSessionContext>;
|
|
26
|
+
createId: (kind: string) => string;
|
|
27
|
+
emit: (name: string, payload?: Record<string, unknown>) => void;
|
|
28
|
+
};
|
|
29
|
+
type PerfSessionOptions = {
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
context: PerfSessionContext;
|
|
32
|
+
now?: () => number;
|
|
33
|
+
sink?: (line: string) => void;
|
|
34
|
+
};
|
|
35
|
+
declare function createPerfSession({ enabled, context, now, sink }: PerfSessionOptions): PerfSession;
|
|
36
|
+
declare function createRunId(): string;
|
|
37
|
+
|
|
38
|
+
declare function MobilePerfProvider({ session, context, children }: PropsWithChildren<{
|
|
39
|
+
session?: PerfSession;
|
|
40
|
+
context?: PerfSessionContext;
|
|
41
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
42
|
+
declare function useMobilePerf(): PerfSession;
|
|
43
|
+
|
|
26
44
|
type PageViewComponentType = React.ComponentType<PapyrusPageViewProps & React.RefAttributes<any>>;
|
|
27
45
|
interface PageRendererProps {
|
|
28
46
|
engine: DocumentEngine;
|
|
@@ -35,18 +53,13 @@ interface PageRendererProps {
|
|
|
35
53
|
horizontalPadding?: number;
|
|
36
54
|
spacing?: number;
|
|
37
55
|
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;
|
|
56
|
+
onPageTap?: () => void;
|
|
47
57
|
gestureScrollLockActive?: boolean;
|
|
48
58
|
lastPinchEndedAt?: number | null;
|
|
49
59
|
requestSelectionVerticalAutoscroll?: (absoluteY: number) => number;
|
|
60
|
+
onRenderReady?: (pageIndex: number, renderedZoom: number) => void;
|
|
61
|
+
surfaceId?: string;
|
|
62
|
+
gestureId?: string;
|
|
50
63
|
}
|
|
51
64
|
declare const _default: React.NamedExoticComponent<PageRendererProps>;
|
|
52
65
|
|
|
@@ -119,13 +132,8 @@ declare function ReadingShell({ engine, title, documentType, thumbsInitialCount,
|
|
|
119
132
|
|
|
120
133
|
type DedicatedAndroidPdfViewerProps = {
|
|
121
134
|
engine: DocumentEngine;
|
|
122
|
-
onDefineSelection?: (payload: {
|
|
123
|
-
text: string;
|
|
124
|
-
pageIndex: number;
|
|
125
|
-
}) => void;
|
|
126
|
-
selectionActionLabel?: string;
|
|
127
135
|
};
|
|
128
|
-
declare function DedicatedAndroidPdfViewer({ engine,
|
|
136
|
+
declare function DedicatedAndroidPdfViewer({ engine, }: DedicatedAndroidPdfViewerProps): react_jsx_runtime.JSX.Element;
|
|
129
137
|
|
|
130
138
|
type OverflowSheetProps = {
|
|
131
139
|
visible: boolean;
|
|
@@ -186,6 +194,9 @@ declare const MOBILE_CHROME_METRICS: {
|
|
|
186
194
|
readonly topbarPageButtonSize: 30;
|
|
187
195
|
readonly bottomBarItemPaddingHorizontal: 5;
|
|
188
196
|
readonly bottomBarItemPaddingVertical: 3;
|
|
197
|
+
readonly topbarHeight: 56;
|
|
198
|
+
readonly progressGap: 18;
|
|
199
|
+
readonly progressHorizontalOffset: 10;
|
|
189
200
|
};
|
|
190
201
|
|
|
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 };
|
|
202
|
+
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,36 @@ 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;
|
|
22
|
-
selectionActionLabel?: string;
|
|
23
14
|
}
|
|
24
15
|
declare const Viewer: React.FC<ViewerProps>;
|
|
25
16
|
|
|
17
|
+
type PerfSessionContext = {
|
|
18
|
+
runId?: string;
|
|
19
|
+
sampleId?: string;
|
|
20
|
+
documentLoadId?: string;
|
|
21
|
+
fixture: string;
|
|
22
|
+
};
|
|
23
|
+
type PerfSession = {
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
context: Readonly<PerfSessionContext>;
|
|
26
|
+
createId: (kind: string) => string;
|
|
27
|
+
emit: (name: string, payload?: Record<string, unknown>) => void;
|
|
28
|
+
};
|
|
29
|
+
type PerfSessionOptions = {
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
context: PerfSessionContext;
|
|
32
|
+
now?: () => number;
|
|
33
|
+
sink?: (line: string) => void;
|
|
34
|
+
};
|
|
35
|
+
declare function createPerfSession({ enabled, context, now, sink }: PerfSessionOptions): PerfSession;
|
|
36
|
+
declare function createRunId(): string;
|
|
37
|
+
|
|
38
|
+
declare function MobilePerfProvider({ session, context, children }: PropsWithChildren<{
|
|
39
|
+
session?: PerfSession;
|
|
40
|
+
context?: PerfSessionContext;
|
|
41
|
+
}>): react_jsx_runtime.JSX.Element;
|
|
42
|
+
declare function useMobilePerf(): PerfSession;
|
|
43
|
+
|
|
26
44
|
type PageViewComponentType = React.ComponentType<PapyrusPageViewProps & React.RefAttributes<any>>;
|
|
27
45
|
interface PageRendererProps {
|
|
28
46
|
engine: DocumentEngine;
|
|
@@ -35,18 +53,13 @@ interface PageRendererProps {
|
|
|
35
53
|
horizontalPadding?: number;
|
|
36
54
|
spacing?: number;
|
|
37
55
|
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;
|
|
56
|
+
onPageTap?: () => void;
|
|
47
57
|
gestureScrollLockActive?: boolean;
|
|
48
58
|
lastPinchEndedAt?: number | null;
|
|
49
59
|
requestSelectionVerticalAutoscroll?: (absoluteY: number) => number;
|
|
60
|
+
onRenderReady?: (pageIndex: number, renderedZoom: number) => void;
|
|
61
|
+
surfaceId?: string;
|
|
62
|
+
gestureId?: string;
|
|
50
63
|
}
|
|
51
64
|
declare const _default: React.NamedExoticComponent<PageRendererProps>;
|
|
52
65
|
|
|
@@ -119,13 +132,8 @@ declare function ReadingShell({ engine, title, documentType, thumbsInitialCount,
|
|
|
119
132
|
|
|
120
133
|
type DedicatedAndroidPdfViewerProps = {
|
|
121
134
|
engine: DocumentEngine;
|
|
122
|
-
onDefineSelection?: (payload: {
|
|
123
|
-
text: string;
|
|
124
|
-
pageIndex: number;
|
|
125
|
-
}) => void;
|
|
126
|
-
selectionActionLabel?: string;
|
|
127
135
|
};
|
|
128
|
-
declare function DedicatedAndroidPdfViewer({ engine,
|
|
136
|
+
declare function DedicatedAndroidPdfViewer({ engine, }: DedicatedAndroidPdfViewerProps): react_jsx_runtime.JSX.Element;
|
|
129
137
|
|
|
130
138
|
type OverflowSheetProps = {
|
|
131
139
|
visible: boolean;
|
|
@@ -186,6 +194,9 @@ declare const MOBILE_CHROME_METRICS: {
|
|
|
186
194
|
readonly topbarPageButtonSize: 30;
|
|
187
195
|
readonly bottomBarItemPaddingHorizontal: 5;
|
|
188
196
|
readonly bottomBarItemPaddingVertical: 3;
|
|
197
|
+
readonly topbarHeight: 56;
|
|
198
|
+
readonly progressGap: 18;
|
|
199
|
+
readonly progressHorizontalOffset: 10;
|
|
189
200
|
};
|
|
190
201
|
|
|
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 };
|
|
202
|
+
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 };
|