@papyrus-sdk/ui-react-native 0.2.23 → 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/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
- onTextSelected?: (payload: {
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, onDefineSelection, selectionActionLabel, }: DedicatedAndroidPdfViewerProps): react_jsx_runtime.JSX.Element;
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 };