@papyrus-sdk/ui-react-native 0.2.12 → 0.2.15

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
@@ -5,10 +5,10 @@ React Native UI components for Papyrus viewers.
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- npm install @papyrus-sdk/ui-react-native @papyrus-sdk/engine-native @papyrus-sdk/core @papyrus-sdk/types react-native-gesture-handler
8
+ npm install @papyrus-sdk/ui-react-native @papyrus-sdk/engine-native @papyrus-sdk/core @papyrus-sdk/types react-native-gesture-handler react-native-reanimated
9
9
  ```
10
10
 
11
- `@papyrus-sdk/core`, `@papyrus-sdk/types`, and `react-native-gesture-handler` are required peer dependencies.
11
+ `@papyrus-sdk/core`, `@papyrus-sdk/types`, `react-native-gesture-handler`, and `react-native-reanimated` are required peer dependencies.
12
12
 
13
13
  Wrap the app root with `GestureHandlerRootView` before rendering Papyrus components:
14
14
 
@@ -62,6 +62,14 @@ await engine.load({ type: 'pdf', source: { uri: 'https://example.com/book.pdf' }
62
62
  - `logo`: custom logo node (can be icon, image, or even a `Pressable`).
63
63
  - `onLogoPress`: optional callback to make the logo area act like a button.
64
64
 
65
+ ## Icon Guidelines
66
+
67
+ - UI icons for this package live in `packages/ui-react-native/icons.tsx`.
68
+ - Prefer inline SVG paths implemented with `react-native-svg` instead of adding a new icon runtime dependency.
69
+ - When a product icon does not already exist in the file, prefer using the outline SVG from [Tabler Icons](https://tabler.io/icons) as the visual baseline and adapt it to the local `IconProps` pattern.
70
+ - Keep icons stroke-based when possible, preserve `color`/`strokeWidth` as props, and simplify paths only when needed for better balance in mobile chrome.
71
+ - If an icon is intentionally derived from Tabler, keep that shape direction consistent for nearby controls so the toolbar/bottom-bar language stays coherent.
72
+
65
73
  ## Mobile Tuning Flags
66
74
 
67
75
  Performance tuning props are available on `Viewer` and `RightSheet`:
@@ -34,12 +34,12 @@ var isToolDockToolSelected = ({
34
34
  toolId
35
35
  }) => toolId === "select" ? activeTool === "select" && interactionMode === "select" : activeTool === toolId;
36
36
  var getToolDockDismissState = ({
37
- activeTool,
38
- interactionMode
37
+ activeTool: _activeTool,
38
+ interactionMode: _interactionMode
39
39
  }) => ({
40
40
  toolDockOpen: false,
41
- activeTool,
42
- interactionMode: activeTool === "select" && interactionMode === "select" ? "pan" : interactionMode
41
+ activeTool: "select",
42
+ interactionMode: "pan"
43
43
  });
44
44
  var getSelectionEdgeAutoscroll = ({
45
45
  x,
@@ -60,4 +60,4 @@ export {
60
60
  getToolDockDismissState,
61
61
  getSelectionEdgeAutoscroll
62
62
  };
63
- //# sourceMappingURL=chunk-GCVUTXFR.mjs.map
63
+ //# sourceMappingURL=chunk-KXNP73MZ.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../gesture/selectionInteraction.ts"],"sourcesContent":["export type ViewerScrollState = {\n selectionDragActive: boolean;\n gestureScrollLockActive?: boolean;\n};\n\nexport type SelectionGestureTool =\n | \"select\"\n | \"highlight\"\n | \"underline\"\n | \"squiggly\"\n | \"strikeout\"\n | \"text\"\n | \"comment\"\n | \"ink\";\n\nexport type SelectionInteractionMode = \"pan\" | \"select\";\n\nexport type SelectionGestureActivationInput = {\n activeTool: SelectionGestureTool;\n interactionMode: SelectionInteractionMode;\n};\n\nexport type ToolDockSelectionState = SelectionGestureActivationInput & {\n toolId: SelectionGestureTool;\n};\n\nexport type ToolDockDismissState = SelectionGestureActivationInput & {\n toolDockOpen: boolean;\n};\n\nexport type SelectionEdgeAutoscrollInput = {\n x: number;\n y: number;\n width: number;\n height: number;\n threshold: number;\n maxStep: number;\n};\n\nexport type SelectionEdgeAutoscroll = {\n dx: number;\n dy: number;\n};\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nconst DRAG_SELECTION_TOOLS = new Set<SelectionGestureTool>([\n \"highlight\",\n \"underline\",\n \"squiggly\",\n \"strikeout\",\n]);\n\nconst resolveAxisAutoscroll = (\n coordinate: number,\n size: number,\n threshold: number,\n maxStep: number\n) => {\n if (size <= 0 || threshold <= 0 || maxStep <= 0) return 0;\n\n const startDistance = clamp(coordinate, 0, size);\n if (startDistance < threshold) {\n const intensity = 1 - startDistance / threshold;\n return -Math.round(maxStep * intensity);\n }\n\n const endDistance = clamp(size - coordinate, 0, size);\n if (endDistance < threshold) {\n const intensity = 1 - endDistance / threshold;\n return Math.round(maxStep * intensity);\n }\n\n return 0;\n};\n\nexport const shouldEnableViewerScroll = ({\n selectionDragActive,\n gestureScrollLockActive = false,\n}: ViewerScrollState) => !selectionDragActive && !gestureScrollLockActive;\n\nexport const shouldEnableSelectionDrag = ({\n activeTool,\n interactionMode,\n}: SelectionGestureActivationInput) =>\n DRAG_SELECTION_TOOLS.has(activeTool) ||\n (activeTool === \"select\" && interactionMode === \"select\");\n\nexport const isToolDockToolSelected = ({\n activeTool,\n interactionMode,\n toolId,\n}: ToolDockSelectionState) =>\n toolId === \"select\"\n ? activeTool === \"select\" && interactionMode === \"select\"\n : activeTool === toolId;\n\nexport const getToolDockDismissState = ({\n activeTool,\n interactionMode,\n}: SelectionGestureActivationInput): ToolDockDismissState => ({\n toolDockOpen: false,\n activeTool,\n interactionMode:\n activeTool === \"select\" && interactionMode === \"select\"\n ? \"pan\"\n : interactionMode,\n});\n\nexport const getSelectionEdgeAutoscroll = ({\n x,\n y,\n width,\n height,\n threshold,\n maxStep,\n}: SelectionEdgeAutoscrollInput): SelectionEdgeAutoscroll => ({\n dx: resolveAxisAutoscroll(x, width, threshold, maxStep),\n dy: resolveAxisAutoscroll(y, height, threshold, maxStep),\n});\n"],"mappings":";AA4CA,IAAM,QAAQ,CAAC,OAAe,KAAa,QACzC,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAEpC,IAAM,uBAAuB,oBAAI,IAA0B;AAAA,EACzD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,wBAAwB,CAC5B,YACA,MACA,WACA,YACG;AACH,MAAI,QAAQ,KAAK,aAAa,KAAK,WAAW,EAAG,QAAO;AAExD,QAAM,gBAAgB,MAAM,YAAY,GAAG,IAAI;AAC/C,MAAI,gBAAgB,WAAW;AAC7B,UAAM,YAAY,IAAI,gBAAgB;AACtC,WAAO,CAAC,KAAK,MAAM,UAAU,SAAS;AAAA,EACxC;AAEA,QAAM,cAAc,MAAM,OAAO,YAAY,GAAG,IAAI;AACpD,MAAI,cAAc,WAAW;AAC3B,UAAM,YAAY,IAAI,cAAc;AACpC,WAAO,KAAK,MAAM,UAAU,SAAS;AAAA,EACvC;AAEA,SAAO;AACT;AAEO,IAAM,2BAA2B,CAAC;AAAA,EACvC;AAAA,EACA,0BAA0B;AAC5B,MAAyB,CAAC,uBAAuB,CAAC;AAE3C,IAAM,4BAA4B,CAAC;AAAA,EACxC;AAAA,EACA;AACF,MACE,qBAAqB,IAAI,UAAU,KAClC,eAAe,YAAY,oBAAoB;AAE3C,IAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACF,MACE,WAAW,WACP,eAAe,YAAY,oBAAoB,WAC/C,eAAe;AAEd,IAAM,0BAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AACF,OAA8D;AAAA,EAC5D,cAAc;AAAA,EACd;AAAA,EACA,iBACE,eAAe,YAAY,oBAAoB,WAC3C,QACA;AACR;AAEO,IAAM,6BAA6B,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,OAA8D;AAAA,EAC5D,IAAI,sBAAsB,GAAG,OAAO,WAAW,OAAO;AAAA,EACtD,IAAI,sBAAsB,GAAG,QAAQ,WAAW,OAAO;AACzD;","names":[]}
1
+ {"version":3,"sources":["../gesture/selectionInteraction.ts"],"sourcesContent":["export type ViewerScrollState = {\n selectionDragActive: boolean;\n gestureScrollLockActive?: boolean;\n};\n\nexport type SelectionGestureTool =\n | \"select\"\n | \"highlight\"\n | \"underline\"\n | \"squiggly\"\n | \"strikeout\"\n | \"text\"\n | \"comment\"\n | \"ink\";\n\nexport type SelectionInteractionMode = \"pan\" | \"select\";\n\nexport type SelectionGestureActivationInput = {\n activeTool: SelectionGestureTool;\n interactionMode: SelectionInteractionMode;\n};\n\nexport type ToolDockSelectionState = SelectionGestureActivationInput & {\n toolId: SelectionGestureTool;\n};\n\nexport type ToolDockDismissState = SelectionGestureActivationInput & {\n toolDockOpen: boolean;\n};\n\nexport type SelectionEdgeAutoscrollInput = {\n x: number;\n y: number;\n width: number;\n height: number;\n threshold: number;\n maxStep: number;\n};\n\nexport type SelectionEdgeAutoscroll = {\n dx: number;\n dy: number;\n};\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nconst DRAG_SELECTION_TOOLS = new Set<SelectionGestureTool>([\n \"highlight\",\n \"underline\",\n \"squiggly\",\n \"strikeout\",\n]);\n\nconst resolveAxisAutoscroll = (\n coordinate: number,\n size: number,\n threshold: number,\n maxStep: number\n) => {\n if (size <= 0 || threshold <= 0 || maxStep <= 0) return 0;\n\n const startDistance = clamp(coordinate, 0, size);\n if (startDistance < threshold) {\n const intensity = 1 - startDistance / threshold;\n return -Math.round(maxStep * intensity);\n }\n\n const endDistance = clamp(size - coordinate, 0, size);\n if (endDistance < threshold) {\n const intensity = 1 - endDistance / threshold;\n return Math.round(maxStep * intensity);\n }\n\n return 0;\n};\n\nexport const shouldEnableViewerScroll = ({\n selectionDragActive,\n gestureScrollLockActive = false,\n}: ViewerScrollState) => !selectionDragActive && !gestureScrollLockActive;\n\nexport const shouldEnableSelectionDrag = ({\n activeTool,\n interactionMode,\n}: SelectionGestureActivationInput) =>\n DRAG_SELECTION_TOOLS.has(activeTool) ||\n (activeTool === \"select\" && interactionMode === \"select\");\n\nexport const isToolDockToolSelected = ({\n activeTool,\n interactionMode,\n toolId,\n}: ToolDockSelectionState) =>\n toolId === \"select\"\n ? activeTool === \"select\" && interactionMode === \"select\"\n : activeTool === toolId;\n\nexport const getToolDockDismissState = ({\n activeTool: _activeTool,\n interactionMode: _interactionMode,\n}: SelectionGestureActivationInput): ToolDockDismissState => ({\n toolDockOpen: false,\n activeTool: \"select\",\n interactionMode: \"pan\",\n});\n\nexport const getSelectionEdgeAutoscroll = ({\n x,\n y,\n width,\n height,\n threshold,\n maxStep,\n}: SelectionEdgeAutoscrollInput): SelectionEdgeAutoscroll => ({\n dx: resolveAxisAutoscroll(x, width, threshold, maxStep),\n dy: resolveAxisAutoscroll(y, height, threshold, maxStep),\n});\n"],"mappings":";AA4CA,IAAM,QAAQ,CAAC,OAAe,KAAa,QACzC,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAEpC,IAAM,uBAAuB,oBAAI,IAA0B;AAAA,EACzD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,wBAAwB,CAC5B,YACA,MACA,WACA,YACG;AACH,MAAI,QAAQ,KAAK,aAAa,KAAK,WAAW,EAAG,QAAO;AAExD,QAAM,gBAAgB,MAAM,YAAY,GAAG,IAAI;AAC/C,MAAI,gBAAgB,WAAW;AAC7B,UAAM,YAAY,IAAI,gBAAgB;AACtC,WAAO,CAAC,KAAK,MAAM,UAAU,SAAS;AAAA,EACxC;AAEA,QAAM,cAAc,MAAM,OAAO,YAAY,GAAG,IAAI;AACpD,MAAI,cAAc,WAAW;AAC3B,UAAM,YAAY,IAAI,cAAc;AACpC,WAAO,KAAK,MAAM,UAAU,SAAS;AAAA,EACvC;AAEA,SAAO;AACT;AAEO,IAAM,2BAA2B,CAAC;AAAA,EACvC;AAAA,EACA,0BAA0B;AAC5B,MAAyB,CAAC,uBAAuB,CAAC;AAE3C,IAAM,4BAA4B,CAAC;AAAA,EACxC;AAAA,EACA;AACF,MACE,qBAAqB,IAAI,UAAU,KAClC,eAAe,YAAY,oBAAoB;AAE3C,IAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACF,MACE,WAAW,WACP,eAAe,YAAY,oBAAoB,WAC/C,eAAe;AAEd,IAAM,0BAA0B,CAAC;AAAA,EACtC,YAAY;AAAA,EACZ,iBAAiB;AACnB,OAA8D;AAAA,EAC5D,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,iBAAiB;AACnB;AAEO,IAAM,6BAA6B,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,OAA8D;AAAA,EAC5D,IAAI,sBAAsB,GAAG,OAAO,WAAW,OAAO;AAAA,EACtD,IAAI,sBAAsB,GAAG,QAAQ,WAAW,OAAO;AACzD;","names":[]}
@@ -0,0 +1,36 @@
1
+ type PinchTouchPoint = {
2
+ pageX: number;
3
+ pageY: number;
4
+ };
5
+ type PinchSession = {
6
+ initialDistance: number;
7
+ initialZoom: number;
8
+ };
9
+ type PinchZoomBounds = {
10
+ minZoom: number;
11
+ maxZoom: number;
12
+ };
13
+ type AnchoredViewportOffsetInput = {
14
+ viewportOffset: number;
15
+ startScrollOffset: number;
16
+ startItemOffset: number;
17
+ startItemLength: number;
18
+ endItemOffset: number;
19
+ endItemLength: number;
20
+ viewportLength: number;
21
+ endContentLength: number;
22
+ };
23
+ declare const DEFAULT_PINCH_ZOOM_BOUNDS: PinchZoomBounds;
24
+ declare const PINCH_PRESS_SUPPRESSION_MS = 120;
25
+ declare const getTouchDistance: (touches: PinchTouchPoint[]) => number;
26
+ declare const isPinchTouchList: (touches: PinchTouchPoint[]) => boolean;
27
+ declare const createPinchSession: (touches: PinchTouchPoint[], zoom: number, bounds?: PinchZoomBounds) => PinchSession;
28
+ declare const resolvePinchZoomChange: (session: PinchSession, touches: PinchTouchPoint[], bounds?: PinchZoomBounds) => number;
29
+ declare const resolvePinchPreviewScale: (startZoom: number, previewZoom: number) => number;
30
+ declare const sanitizePinchPreviewScale: (value: number) => number;
31
+ declare const resolvePinchGestureZoom: (startZoom: number, scaleFactor: number, bounds?: PinchZoomBounds) => number;
32
+ declare const resolveAnchoredViewportOffset: ({ viewportOffset, startScrollOffset, startItemOffset, startItemLength, endItemOffset, endItemLength, viewportLength, endContentLength, }: AnchoredViewportOffsetInput) => number;
33
+ declare const resolveClampedScrollOffset: (offset: number, contentLength: number, viewportLength: number) => number;
34
+ declare const shouldSuppressPressAfterPinch: (lastPinchEndedAt: number | null | undefined, now?: number, windowMs?: number) => boolean;
35
+
36
+ export { type AnchoredViewportOffsetInput, DEFAULT_PINCH_ZOOM_BOUNDS, PINCH_PRESS_SUPPRESSION_MS, type PinchSession, type PinchTouchPoint, type PinchZoomBounds, createPinchSession, getTouchDistance, isPinchTouchList, resolveAnchoredViewportOffset, resolveClampedScrollOffset, resolvePinchGestureZoom, resolvePinchPreviewScale, resolvePinchZoomChange, sanitizePinchPreviewScale, shouldSuppressPressAfterPinch };
@@ -0,0 +1,36 @@
1
+ type PinchTouchPoint = {
2
+ pageX: number;
3
+ pageY: number;
4
+ };
5
+ type PinchSession = {
6
+ initialDistance: number;
7
+ initialZoom: number;
8
+ };
9
+ type PinchZoomBounds = {
10
+ minZoom: number;
11
+ maxZoom: number;
12
+ };
13
+ type AnchoredViewportOffsetInput = {
14
+ viewportOffset: number;
15
+ startScrollOffset: number;
16
+ startItemOffset: number;
17
+ startItemLength: number;
18
+ endItemOffset: number;
19
+ endItemLength: number;
20
+ viewportLength: number;
21
+ endContentLength: number;
22
+ };
23
+ declare const DEFAULT_PINCH_ZOOM_BOUNDS: PinchZoomBounds;
24
+ declare const PINCH_PRESS_SUPPRESSION_MS = 120;
25
+ declare const getTouchDistance: (touches: PinchTouchPoint[]) => number;
26
+ declare const isPinchTouchList: (touches: PinchTouchPoint[]) => boolean;
27
+ declare const createPinchSession: (touches: PinchTouchPoint[], zoom: number, bounds?: PinchZoomBounds) => PinchSession;
28
+ declare const resolvePinchZoomChange: (session: PinchSession, touches: PinchTouchPoint[], bounds?: PinchZoomBounds) => number;
29
+ declare const resolvePinchPreviewScale: (startZoom: number, previewZoom: number) => number;
30
+ declare const sanitizePinchPreviewScale: (value: number) => number;
31
+ declare const resolvePinchGestureZoom: (startZoom: number, scaleFactor: number, bounds?: PinchZoomBounds) => number;
32
+ declare const resolveAnchoredViewportOffset: ({ viewportOffset, startScrollOffset, startItemOffset, startItemLength, endItemOffset, endItemLength, viewportLength, endContentLength, }: AnchoredViewportOffsetInput) => number;
33
+ declare const resolveClampedScrollOffset: (offset: number, contentLength: number, viewportLength: number) => number;
34
+ declare const shouldSuppressPressAfterPinch: (lastPinchEndedAt: number | null | undefined, now?: number, windowMs?: number) => boolean;
35
+
36
+ export { type AnchoredViewportOffsetInput, DEFAULT_PINCH_ZOOM_BOUNDS, PINCH_PRESS_SUPPRESSION_MS, type PinchSession, type PinchTouchPoint, type PinchZoomBounds, createPinchSession, getTouchDistance, isPinchTouchList, resolveAnchoredViewportOffset, resolveClampedScrollOffset, resolvePinchGestureZoom, resolvePinchPreviewScale, resolvePinchZoomChange, sanitizePinchPreviewScale, shouldSuppressPressAfterPinch };
@@ -0,0 +1,35 @@
1
+ type ViewerScrollState = {
2
+ selectionDragActive: boolean;
3
+ gestureScrollLockActive?: boolean;
4
+ };
5
+ type SelectionGestureTool = "select" | "highlight" | "underline" | "squiggly" | "strikeout" | "text" | "comment" | "ink";
6
+ type SelectionInteractionMode = "pan" | "select";
7
+ type SelectionGestureActivationInput = {
8
+ activeTool: SelectionGestureTool;
9
+ interactionMode: SelectionInteractionMode;
10
+ };
11
+ type ToolDockSelectionState = SelectionGestureActivationInput & {
12
+ toolId: SelectionGestureTool;
13
+ };
14
+ type ToolDockDismissState = SelectionGestureActivationInput & {
15
+ toolDockOpen: boolean;
16
+ };
17
+ type SelectionEdgeAutoscrollInput = {
18
+ x: number;
19
+ y: number;
20
+ width: number;
21
+ height: number;
22
+ threshold: number;
23
+ maxStep: number;
24
+ };
25
+ type SelectionEdgeAutoscroll = {
26
+ dx: number;
27
+ dy: number;
28
+ };
29
+ declare const shouldEnableViewerScroll: ({ selectionDragActive, gestureScrollLockActive, }: ViewerScrollState) => boolean;
30
+ declare const shouldEnableSelectionDrag: ({ activeTool, interactionMode, }: SelectionGestureActivationInput) => boolean;
31
+ declare const isToolDockToolSelected: ({ activeTool, interactionMode, toolId, }: ToolDockSelectionState) => boolean;
32
+ declare const getToolDockDismissState: ({ activeTool: _activeTool, interactionMode: _interactionMode, }: SelectionGestureActivationInput) => ToolDockDismissState;
33
+ declare const getSelectionEdgeAutoscroll: ({ x, y, width, height, threshold, maxStep, }: SelectionEdgeAutoscrollInput) => SelectionEdgeAutoscroll;
34
+
35
+ export { type SelectionEdgeAutoscroll, type SelectionEdgeAutoscrollInput, type SelectionGestureActivationInput, type SelectionGestureTool, type SelectionInteractionMode, type ToolDockDismissState, type ToolDockSelectionState, type ViewerScrollState, getSelectionEdgeAutoscroll, getToolDockDismissState, isToolDockToolSelected, shouldEnableSelectionDrag, shouldEnableViewerScroll };
@@ -0,0 +1,35 @@
1
+ type ViewerScrollState = {
2
+ selectionDragActive: boolean;
3
+ gestureScrollLockActive?: boolean;
4
+ };
5
+ type SelectionGestureTool = "select" | "highlight" | "underline" | "squiggly" | "strikeout" | "text" | "comment" | "ink";
6
+ type SelectionInteractionMode = "pan" | "select";
7
+ type SelectionGestureActivationInput = {
8
+ activeTool: SelectionGestureTool;
9
+ interactionMode: SelectionInteractionMode;
10
+ };
11
+ type ToolDockSelectionState = SelectionGestureActivationInput & {
12
+ toolId: SelectionGestureTool;
13
+ };
14
+ type ToolDockDismissState = SelectionGestureActivationInput & {
15
+ toolDockOpen: boolean;
16
+ };
17
+ type SelectionEdgeAutoscrollInput = {
18
+ x: number;
19
+ y: number;
20
+ width: number;
21
+ height: number;
22
+ threshold: number;
23
+ maxStep: number;
24
+ };
25
+ type SelectionEdgeAutoscroll = {
26
+ dx: number;
27
+ dy: number;
28
+ };
29
+ declare const shouldEnableViewerScroll: ({ selectionDragActive, gestureScrollLockActive, }: ViewerScrollState) => boolean;
30
+ declare const shouldEnableSelectionDrag: ({ activeTool, interactionMode, }: SelectionGestureActivationInput) => boolean;
31
+ declare const isToolDockToolSelected: ({ activeTool, interactionMode, toolId, }: ToolDockSelectionState) => boolean;
32
+ declare const getToolDockDismissState: ({ activeTool: _activeTool, interactionMode: _interactionMode, }: SelectionGestureActivationInput) => ToolDockDismissState;
33
+ declare const getSelectionEdgeAutoscroll: ({ x, y, width, height, threshold, maxStep, }: SelectionEdgeAutoscrollInput) => SelectionEdgeAutoscroll;
34
+
35
+ export { type SelectionEdgeAutoscroll, type SelectionEdgeAutoscrollInput, type SelectionGestureActivationInput, type SelectionGestureTool, type SelectionInteractionMode, type ToolDockDismissState, type ToolDockSelectionState, type ViewerScrollState, getSelectionEdgeAutoscroll, getToolDockDismissState, isToolDockToolSelected, shouldEnableSelectionDrag, shouldEnableViewerScroll };
@@ -61,12 +61,12 @@ var isToolDockToolSelected = ({
61
61
  toolId
62
62
  }) => toolId === "select" ? activeTool === "select" && interactionMode === "select" : activeTool === toolId;
63
63
  var getToolDockDismissState = ({
64
- activeTool,
65
- interactionMode
64
+ activeTool: _activeTool,
65
+ interactionMode: _interactionMode
66
66
  }) => ({
67
67
  toolDockOpen: false,
68
- activeTool,
69
- interactionMode: activeTool === "select" && interactionMode === "select" ? "pan" : interactionMode
68
+ activeTool: "select",
69
+ interactionMode: "pan"
70
70
  });
71
71
  var getSelectionEdgeAutoscroll = ({
72
72
  x,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../gesture/selectionInteraction.ts"],"sourcesContent":["export type ViewerScrollState = {\n selectionDragActive: boolean;\n gestureScrollLockActive?: boolean;\n};\n\nexport type SelectionGestureTool =\n | \"select\"\n | \"highlight\"\n | \"underline\"\n | \"squiggly\"\n | \"strikeout\"\n | \"text\"\n | \"comment\"\n | \"ink\";\n\nexport type SelectionInteractionMode = \"pan\" | \"select\";\n\nexport type SelectionGestureActivationInput = {\n activeTool: SelectionGestureTool;\n interactionMode: SelectionInteractionMode;\n};\n\nexport type ToolDockSelectionState = SelectionGestureActivationInput & {\n toolId: SelectionGestureTool;\n};\n\nexport type ToolDockDismissState = SelectionGestureActivationInput & {\n toolDockOpen: boolean;\n};\n\nexport type SelectionEdgeAutoscrollInput = {\n x: number;\n y: number;\n width: number;\n height: number;\n threshold: number;\n maxStep: number;\n};\n\nexport type SelectionEdgeAutoscroll = {\n dx: number;\n dy: number;\n};\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nconst DRAG_SELECTION_TOOLS = new Set<SelectionGestureTool>([\n \"highlight\",\n \"underline\",\n \"squiggly\",\n \"strikeout\",\n]);\n\nconst resolveAxisAutoscroll = (\n coordinate: number,\n size: number,\n threshold: number,\n maxStep: number\n) => {\n if (size <= 0 || threshold <= 0 || maxStep <= 0) return 0;\n\n const startDistance = clamp(coordinate, 0, size);\n if (startDistance < threshold) {\n const intensity = 1 - startDistance / threshold;\n return -Math.round(maxStep * intensity);\n }\n\n const endDistance = clamp(size - coordinate, 0, size);\n if (endDistance < threshold) {\n const intensity = 1 - endDistance / threshold;\n return Math.round(maxStep * intensity);\n }\n\n return 0;\n};\n\nexport const shouldEnableViewerScroll = ({\n selectionDragActive,\n gestureScrollLockActive = false,\n}: ViewerScrollState) => !selectionDragActive && !gestureScrollLockActive;\n\nexport const shouldEnableSelectionDrag = ({\n activeTool,\n interactionMode,\n}: SelectionGestureActivationInput) =>\n DRAG_SELECTION_TOOLS.has(activeTool) ||\n (activeTool === \"select\" && interactionMode === \"select\");\n\nexport const isToolDockToolSelected = ({\n activeTool,\n interactionMode,\n toolId,\n}: ToolDockSelectionState) =>\n toolId === \"select\"\n ? activeTool === \"select\" && interactionMode === \"select\"\n : activeTool === toolId;\n\nexport const getToolDockDismissState = ({\n activeTool,\n interactionMode,\n}: SelectionGestureActivationInput): ToolDockDismissState => ({\n toolDockOpen: false,\n activeTool,\n interactionMode:\n activeTool === \"select\" && interactionMode === \"select\"\n ? \"pan\"\n : interactionMode,\n});\n\nexport const getSelectionEdgeAutoscroll = ({\n x,\n y,\n width,\n height,\n threshold,\n maxStep,\n}: SelectionEdgeAutoscrollInput): SelectionEdgeAutoscroll => ({\n dx: resolveAxisAutoscroll(x, width, threshold, maxStep),\n dy: resolveAxisAutoscroll(y, height, threshold, maxStep),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4CA,IAAM,QAAQ,CAAC,OAAe,KAAa,QACzC,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAEpC,IAAM,uBAAuB,oBAAI,IAA0B;AAAA,EACzD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,wBAAwB,CAC5B,YACA,MACA,WACA,YACG;AACH,MAAI,QAAQ,KAAK,aAAa,KAAK,WAAW,EAAG,QAAO;AAExD,QAAM,gBAAgB,MAAM,YAAY,GAAG,IAAI;AAC/C,MAAI,gBAAgB,WAAW;AAC7B,UAAM,YAAY,IAAI,gBAAgB;AACtC,WAAO,CAAC,KAAK,MAAM,UAAU,SAAS;AAAA,EACxC;AAEA,QAAM,cAAc,MAAM,OAAO,YAAY,GAAG,IAAI;AACpD,MAAI,cAAc,WAAW;AAC3B,UAAM,YAAY,IAAI,cAAc;AACpC,WAAO,KAAK,MAAM,UAAU,SAAS;AAAA,EACvC;AAEA,SAAO;AACT;AAEO,IAAM,2BAA2B,CAAC;AAAA,EACvC;AAAA,EACA,0BAA0B;AAC5B,MAAyB,CAAC,uBAAuB,CAAC;AAE3C,IAAM,4BAA4B,CAAC;AAAA,EACxC;AAAA,EACA;AACF,MACE,qBAAqB,IAAI,UAAU,KAClC,eAAe,YAAY,oBAAoB;AAE3C,IAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACF,MACE,WAAW,WACP,eAAe,YAAY,oBAAoB,WAC/C,eAAe;AAEd,IAAM,0BAA0B,CAAC;AAAA,EACtC;AAAA,EACA;AACF,OAA8D;AAAA,EAC5D,cAAc;AAAA,EACd;AAAA,EACA,iBACE,eAAe,YAAY,oBAAoB,WAC3C,QACA;AACR;AAEO,IAAM,6BAA6B,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,OAA8D;AAAA,EAC5D,IAAI,sBAAsB,GAAG,OAAO,WAAW,OAAO;AAAA,EACtD,IAAI,sBAAsB,GAAG,QAAQ,WAAW,OAAO;AACzD;","names":[]}
1
+ {"version":3,"sources":["../../gesture/selectionInteraction.ts"],"sourcesContent":["export type ViewerScrollState = {\n selectionDragActive: boolean;\n gestureScrollLockActive?: boolean;\n};\n\nexport type SelectionGestureTool =\n | \"select\"\n | \"highlight\"\n | \"underline\"\n | \"squiggly\"\n | \"strikeout\"\n | \"text\"\n | \"comment\"\n | \"ink\";\n\nexport type SelectionInteractionMode = \"pan\" | \"select\";\n\nexport type SelectionGestureActivationInput = {\n activeTool: SelectionGestureTool;\n interactionMode: SelectionInteractionMode;\n};\n\nexport type ToolDockSelectionState = SelectionGestureActivationInput & {\n toolId: SelectionGestureTool;\n};\n\nexport type ToolDockDismissState = SelectionGestureActivationInput & {\n toolDockOpen: boolean;\n};\n\nexport type SelectionEdgeAutoscrollInput = {\n x: number;\n y: number;\n width: number;\n height: number;\n threshold: number;\n maxStep: number;\n};\n\nexport type SelectionEdgeAutoscroll = {\n dx: number;\n dy: number;\n};\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nconst DRAG_SELECTION_TOOLS = new Set<SelectionGestureTool>([\n \"highlight\",\n \"underline\",\n \"squiggly\",\n \"strikeout\",\n]);\n\nconst resolveAxisAutoscroll = (\n coordinate: number,\n size: number,\n threshold: number,\n maxStep: number\n) => {\n if (size <= 0 || threshold <= 0 || maxStep <= 0) return 0;\n\n const startDistance = clamp(coordinate, 0, size);\n if (startDistance < threshold) {\n const intensity = 1 - startDistance / threshold;\n return -Math.round(maxStep * intensity);\n }\n\n const endDistance = clamp(size - coordinate, 0, size);\n if (endDistance < threshold) {\n const intensity = 1 - endDistance / threshold;\n return Math.round(maxStep * intensity);\n }\n\n return 0;\n};\n\nexport const shouldEnableViewerScroll = ({\n selectionDragActive,\n gestureScrollLockActive = false,\n}: ViewerScrollState) => !selectionDragActive && !gestureScrollLockActive;\n\nexport const shouldEnableSelectionDrag = ({\n activeTool,\n interactionMode,\n}: SelectionGestureActivationInput) =>\n DRAG_SELECTION_TOOLS.has(activeTool) ||\n (activeTool === \"select\" && interactionMode === \"select\");\n\nexport const isToolDockToolSelected = ({\n activeTool,\n interactionMode,\n toolId,\n}: ToolDockSelectionState) =>\n toolId === \"select\"\n ? activeTool === \"select\" && interactionMode === \"select\"\n : activeTool === toolId;\n\nexport const getToolDockDismissState = ({\n activeTool: _activeTool,\n interactionMode: _interactionMode,\n}: SelectionGestureActivationInput): ToolDockDismissState => ({\n toolDockOpen: false,\n activeTool: \"select\",\n interactionMode: \"pan\",\n});\n\nexport const getSelectionEdgeAutoscroll = ({\n x,\n y,\n width,\n height,\n threshold,\n maxStep,\n}: SelectionEdgeAutoscrollInput): SelectionEdgeAutoscroll => ({\n dx: resolveAxisAutoscroll(x, width, threshold, maxStep),\n dy: resolveAxisAutoscroll(y, height, threshold, maxStep),\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4CA,IAAM,QAAQ,CAAC,OAAe,KAAa,QACzC,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAEpC,IAAM,uBAAuB,oBAAI,IAA0B;AAAA,EACzD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,wBAAwB,CAC5B,YACA,MACA,WACA,YACG;AACH,MAAI,QAAQ,KAAK,aAAa,KAAK,WAAW,EAAG,QAAO;AAExD,QAAM,gBAAgB,MAAM,YAAY,GAAG,IAAI;AAC/C,MAAI,gBAAgB,WAAW;AAC7B,UAAM,YAAY,IAAI,gBAAgB;AACtC,WAAO,CAAC,KAAK,MAAM,UAAU,SAAS;AAAA,EACxC;AAEA,QAAM,cAAc,MAAM,OAAO,YAAY,GAAG,IAAI;AACpD,MAAI,cAAc,WAAW;AAC3B,UAAM,YAAY,IAAI,cAAc;AACpC,WAAO,KAAK,MAAM,UAAU,SAAS;AAAA,EACvC;AAEA,SAAO;AACT;AAEO,IAAM,2BAA2B,CAAC;AAAA,EACvC;AAAA,EACA,0BAA0B;AAC5B,MAAyB,CAAC,uBAAuB,CAAC;AAE3C,IAAM,4BAA4B,CAAC;AAAA,EACxC;AAAA,EACA;AACF,MACE,qBAAqB,IAAI,UAAU,KAClC,eAAe,YAAY,oBAAoB;AAE3C,IAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AACF,MACE,WAAW,WACP,eAAe,YAAY,oBAAoB,WAC/C,eAAe;AAEd,IAAM,0BAA0B,CAAC;AAAA,EACtC,YAAY;AAAA,EACZ,iBAAiB;AACnB,OAA8D;AAAA,EAC5D,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,iBAAiB;AACnB;AAEO,IAAM,6BAA6B,CAAC;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,OAA8D;AAAA,EAC5D,IAAI,sBAAsB,GAAG,OAAO,WAAW,OAAO;AAAA,EACtD,IAAI,sBAAsB,GAAG,QAAQ,WAAW,OAAO;AACzD;","names":[]}
@@ -4,7 +4,7 @@ import {
4
4
  isToolDockToolSelected,
5
5
  shouldEnableSelectionDrag,
6
6
  shouldEnableViewerScroll
7
- } from "../chunk-GCVUTXFR.mjs";
7
+ } from "../chunk-KXNP73MZ.mjs";
8
8
  import "../chunk-ZD7AOCMD.mjs";
9
9
  export {
10
10
  getSelectionEdgeAutoscroll,
package/dist/index.d.mts CHANGED
@@ -1,11 +1,165 @@
1
- import type React from "react";
2
-
3
- export declare const Viewer: React.ComponentType<any>;
4
- export declare const PageRenderer: React.ComponentType<any>;
5
- export declare const Topbar: React.ComponentType<any>;
6
- export declare const ToolDock: React.ComponentType<any>;
7
- export declare const RightSheet: React.ComponentType<any>;
8
- export declare const AnnotationEditor: React.ComponentType<any>;
9
- export declare const BottomBar: React.ComponentType<any>;
10
- export declare const SettingsSheet: React.ComponentType<any>;
11
- export declare const CoverPreview: React.ComponentType<any>;
1
+ import React from 'react';
2
+ import { DocumentEngine, DocumentType, MobilePrimaryDestination, DocumentSource } from '@papyrus-sdk/types';
3
+ import { PapyrusPageViewProps } from '@papyrus-sdk/engine-native';
4
+ import { StyleProp, ViewStyle } from 'react-native';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
6
+
7
+ interface ViewerProps {
8
+ engine: DocumentEngine;
9
+ virtualWindowSize?: number;
10
+ maxToRenderPerBatch?: number;
11
+ removeClippedSubviews?: boolean;
12
+ }
13
+ declare const Viewer: React.FC<ViewerProps>;
14
+
15
+ type PageViewComponentType = React.ComponentType<PapyrusPageViewProps & React.RefAttributes<any>>;
16
+ interface PageRendererProps {
17
+ engine: DocumentEngine;
18
+ pageIndex: number;
19
+ scale?: number;
20
+ pageAspectRatio?: number;
21
+ PageViewComponent?: PageViewComponentType;
22
+ availableWidth?: number;
23
+ horizontalPadding?: number;
24
+ spacing?: number;
25
+ onSelectionDragActiveChange?: (active: boolean) => void;
26
+ gestureScrollLockActive?: boolean;
27
+ lastPinchEndedAt?: number | null;
28
+ onHorizontalScrollOffsetChange?: (pageIndex: number, offsetX: number) => void;
29
+ horizontalScrollRestore?: {
30
+ requestId: number;
31
+ offsetX: number;
32
+ } | null;
33
+ requestSelectionVerticalAutoscroll?: (absoluteY: number) => number;
34
+ }
35
+ declare const _default: React.NamedExoticComponent<PageRendererProps>;
36
+
37
+ interface TopbarProps {
38
+ engine: DocumentEngine;
39
+ onOpenSettings?: () => void;
40
+ onOpenOverflow?: () => void;
41
+ title?: string;
42
+ logo?: React.ReactNode;
43
+ onLogoPress?: () => void;
44
+ logoAccessibilityLabel?: string;
45
+ showPageNavigationControls?: boolean;
46
+ onOpenPageJump?: () => void;
47
+ }
48
+ declare const Topbar: React.FC<TopbarProps>;
49
+
50
+ declare const ToolDock: React.FC;
51
+
52
+ interface RightSheetProps {
53
+ engine: DocumentEngine;
54
+ documentType: DocumentType;
55
+ thumbsInitialCount?: number;
56
+ onOpenPageJump?: () => void;
57
+ }
58
+ declare const RightSheet: React.FC<RightSheetProps>;
59
+
60
+ declare const AnnotationEditor: React.FC;
61
+
62
+ type BottomBarProps = {
63
+ documentType: DocumentType;
64
+ onOpenInfo: () => void;
65
+ onOpenSettings: () => void;
66
+ onOpenDestination?: (destination: MobilePrimaryDestination) => void;
67
+ };
68
+ declare const BottomBar: React.FC<BottomBarProps>;
69
+
70
+ interface SettingsSheetProps {
71
+ engine: DocumentEngine;
72
+ visible: boolean;
73
+ onClose: () => void;
74
+ }
75
+ declare const SettingsSheet: React.FC<SettingsSheetProps>;
76
+
77
+ type CoverPreviewProps = {
78
+ source: DocumentSource;
79
+ type?: DocumentType;
80
+ pageIndex?: number;
81
+ visible?: boolean;
82
+ keepAlive?: boolean;
83
+ allowInteraction?: boolean;
84
+ renderScale?: number;
85
+ showLoading?: boolean;
86
+ loadingIndicator?: React.ReactNode;
87
+ placeholder?: React.ReactNode;
88
+ style?: StyleProp<ViewStyle>;
89
+ onLoadStart?: () => void;
90
+ onLoadEnd?: () => void;
91
+ onError?: (error: Error) => void;
92
+ };
93
+ declare const CoverPreview: React.FC<CoverPreviewProps>;
94
+
95
+ type ReadingShellProps = {
96
+ engine: DocumentEngine;
97
+ title?: string;
98
+ documentType?: DocumentType;
99
+ thumbsInitialCount?: number;
100
+ viewerProps?: React.ComponentProps<typeof Viewer>;
101
+ };
102
+ declare function ReadingShell({ engine, title, documentType, thumbsInitialCount, viewerProps, }: ReadingShellProps): react_jsx_runtime.JSX.Element;
103
+
104
+ type OverflowSheetProps = {
105
+ visible: boolean;
106
+ onClose: () => void;
107
+ onOpenActions: () => void;
108
+ };
109
+ declare function OverflowSheet({ visible, onClose, onOpenActions, }: OverflowSheetProps): react_jsx_runtime.JSX.Element;
110
+
111
+ type InfoSheetProps = {
112
+ visible: boolean;
113
+ title?: string;
114
+ documentType: DocumentType;
115
+ onClose: () => void;
116
+ };
117
+ declare function InfoSheet({ visible, title, documentType, onClose, }: InfoSheetProps): react_jsx_runtime.JSX.Element;
118
+
119
+ type DocumentActionsSheetProps = {
120
+ visible: boolean;
121
+ onClose: () => void;
122
+ };
123
+ declare function DocumentActionsSheet({ visible, onClose, }: DocumentActionsSheetProps): react_jsx_runtime.JSX.Element;
124
+
125
+ type ProgressPillProps = {
126
+ documentType: DocumentType;
127
+ onPress: () => void;
128
+ onOpenPageJump?: () => void;
129
+ };
130
+ declare function ProgressPill({ documentType, onPress, onOpenPageJump, }: ProgressPillProps): react_jsx_runtime.JSX.Element;
131
+
132
+ type SearchOverlayProps = {
133
+ engine: DocumentEngine;
134
+ documentType: DocumentType;
135
+ visible: boolean;
136
+ onClose: () => void;
137
+ onOpenResults: () => void;
138
+ };
139
+ declare function SearchOverlay({ engine, documentType, visible, onClose, onOpenResults, }: SearchOverlayProps): react_jsx_runtime.JSX.Element;
140
+
141
+ type SearchResultsSheetProps = {
142
+ documentType: DocumentType;
143
+ visible: boolean;
144
+ onClose: () => void;
145
+ };
146
+ declare function SearchResultsSheet({ documentType, visible, onClose, }: SearchResultsSheetProps): react_jsx_runtime.JSX.Element;
147
+
148
+ declare const MOBILE_CHROME_METRICS: {
149
+ readonly screenPadding: 16;
150
+ readonly maxFloatingWidth: 360;
151
+ readonly maxToolDockWidth: 420;
152
+ readonly toolDockPaddingTop: 4;
153
+ readonly toolDockHistoryIconSize: 18;
154
+ readonly toolDockHistoryGap: 2;
155
+ readonly toolDockDisabledIconColorDark: "#64748b";
156
+ readonly toolDockDisabledIconColorLight: "#6b7280";
157
+ readonly toolDockDisabledOpacity: 0.72;
158
+ readonly iconSize: 20;
159
+ readonly iconBoxSize: 28;
160
+ readonly topbarPageButtonSize: 30;
161
+ readonly bottomBarItemPaddingHorizontal: 5;
162
+ readonly bottomBarItemPaddingVertical: 3;
163
+ };
164
+
165
+ export { AnnotationEditor, BottomBar, CoverPreview, DocumentActionsSheet, InfoSheet, MOBILE_CHROME_METRICS, OverflowSheet, _default as PageRenderer, ProgressPill, ReadingShell, RightSheet, SearchOverlay, SearchResultsSheet, SettingsSheet, ToolDock, Topbar, Viewer };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,165 @@
1
- import type React from "react";
2
-
3
- export declare const Viewer: React.ComponentType<any>;
4
- export declare const PageRenderer: React.ComponentType<any>;
5
- export declare const Topbar: React.ComponentType<any>;
6
- export declare const ToolDock: React.ComponentType<any>;
7
- export declare const RightSheet: React.ComponentType<any>;
8
- export declare const AnnotationEditor: React.ComponentType<any>;
9
- export declare const BottomBar: React.ComponentType<any>;
10
- export declare const SettingsSheet: React.ComponentType<any>;
11
- export declare const CoverPreview: React.ComponentType<any>;
1
+ import React from 'react';
2
+ import { DocumentEngine, DocumentType, MobilePrimaryDestination, DocumentSource } from '@papyrus-sdk/types';
3
+ import { PapyrusPageViewProps } from '@papyrus-sdk/engine-native';
4
+ import { StyleProp, ViewStyle } from 'react-native';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
6
+
7
+ interface ViewerProps {
8
+ engine: DocumentEngine;
9
+ virtualWindowSize?: number;
10
+ maxToRenderPerBatch?: number;
11
+ removeClippedSubviews?: boolean;
12
+ }
13
+ declare const Viewer: React.FC<ViewerProps>;
14
+
15
+ type PageViewComponentType = React.ComponentType<PapyrusPageViewProps & React.RefAttributes<any>>;
16
+ interface PageRendererProps {
17
+ engine: DocumentEngine;
18
+ pageIndex: number;
19
+ scale?: number;
20
+ pageAspectRatio?: number;
21
+ PageViewComponent?: PageViewComponentType;
22
+ availableWidth?: number;
23
+ horizontalPadding?: number;
24
+ spacing?: number;
25
+ onSelectionDragActiveChange?: (active: boolean) => void;
26
+ gestureScrollLockActive?: boolean;
27
+ lastPinchEndedAt?: number | null;
28
+ onHorizontalScrollOffsetChange?: (pageIndex: number, offsetX: number) => void;
29
+ horizontalScrollRestore?: {
30
+ requestId: number;
31
+ offsetX: number;
32
+ } | null;
33
+ requestSelectionVerticalAutoscroll?: (absoluteY: number) => number;
34
+ }
35
+ declare const _default: React.NamedExoticComponent<PageRendererProps>;
36
+
37
+ interface TopbarProps {
38
+ engine: DocumentEngine;
39
+ onOpenSettings?: () => void;
40
+ onOpenOverflow?: () => void;
41
+ title?: string;
42
+ logo?: React.ReactNode;
43
+ onLogoPress?: () => void;
44
+ logoAccessibilityLabel?: string;
45
+ showPageNavigationControls?: boolean;
46
+ onOpenPageJump?: () => void;
47
+ }
48
+ declare const Topbar: React.FC<TopbarProps>;
49
+
50
+ declare const ToolDock: React.FC;
51
+
52
+ interface RightSheetProps {
53
+ engine: DocumentEngine;
54
+ documentType: DocumentType;
55
+ thumbsInitialCount?: number;
56
+ onOpenPageJump?: () => void;
57
+ }
58
+ declare const RightSheet: React.FC<RightSheetProps>;
59
+
60
+ declare const AnnotationEditor: React.FC;
61
+
62
+ type BottomBarProps = {
63
+ documentType: DocumentType;
64
+ onOpenInfo: () => void;
65
+ onOpenSettings: () => void;
66
+ onOpenDestination?: (destination: MobilePrimaryDestination) => void;
67
+ };
68
+ declare const BottomBar: React.FC<BottomBarProps>;
69
+
70
+ interface SettingsSheetProps {
71
+ engine: DocumentEngine;
72
+ visible: boolean;
73
+ onClose: () => void;
74
+ }
75
+ declare const SettingsSheet: React.FC<SettingsSheetProps>;
76
+
77
+ type CoverPreviewProps = {
78
+ source: DocumentSource;
79
+ type?: DocumentType;
80
+ pageIndex?: number;
81
+ visible?: boolean;
82
+ keepAlive?: boolean;
83
+ allowInteraction?: boolean;
84
+ renderScale?: number;
85
+ showLoading?: boolean;
86
+ loadingIndicator?: React.ReactNode;
87
+ placeholder?: React.ReactNode;
88
+ style?: StyleProp<ViewStyle>;
89
+ onLoadStart?: () => void;
90
+ onLoadEnd?: () => void;
91
+ onError?: (error: Error) => void;
92
+ };
93
+ declare const CoverPreview: React.FC<CoverPreviewProps>;
94
+
95
+ type ReadingShellProps = {
96
+ engine: DocumentEngine;
97
+ title?: string;
98
+ documentType?: DocumentType;
99
+ thumbsInitialCount?: number;
100
+ viewerProps?: React.ComponentProps<typeof Viewer>;
101
+ };
102
+ declare function ReadingShell({ engine, title, documentType, thumbsInitialCount, viewerProps, }: ReadingShellProps): react_jsx_runtime.JSX.Element;
103
+
104
+ type OverflowSheetProps = {
105
+ visible: boolean;
106
+ onClose: () => void;
107
+ onOpenActions: () => void;
108
+ };
109
+ declare function OverflowSheet({ visible, onClose, onOpenActions, }: OverflowSheetProps): react_jsx_runtime.JSX.Element;
110
+
111
+ type InfoSheetProps = {
112
+ visible: boolean;
113
+ title?: string;
114
+ documentType: DocumentType;
115
+ onClose: () => void;
116
+ };
117
+ declare function InfoSheet({ visible, title, documentType, onClose, }: InfoSheetProps): react_jsx_runtime.JSX.Element;
118
+
119
+ type DocumentActionsSheetProps = {
120
+ visible: boolean;
121
+ onClose: () => void;
122
+ };
123
+ declare function DocumentActionsSheet({ visible, onClose, }: DocumentActionsSheetProps): react_jsx_runtime.JSX.Element;
124
+
125
+ type ProgressPillProps = {
126
+ documentType: DocumentType;
127
+ onPress: () => void;
128
+ onOpenPageJump?: () => void;
129
+ };
130
+ declare function ProgressPill({ documentType, onPress, onOpenPageJump, }: ProgressPillProps): react_jsx_runtime.JSX.Element;
131
+
132
+ type SearchOverlayProps = {
133
+ engine: DocumentEngine;
134
+ documentType: DocumentType;
135
+ visible: boolean;
136
+ onClose: () => void;
137
+ onOpenResults: () => void;
138
+ };
139
+ declare function SearchOverlay({ engine, documentType, visible, onClose, onOpenResults, }: SearchOverlayProps): react_jsx_runtime.JSX.Element;
140
+
141
+ type SearchResultsSheetProps = {
142
+ documentType: DocumentType;
143
+ visible: boolean;
144
+ onClose: () => void;
145
+ };
146
+ declare function SearchResultsSheet({ documentType, visible, onClose, }: SearchResultsSheetProps): react_jsx_runtime.JSX.Element;
147
+
148
+ declare const MOBILE_CHROME_METRICS: {
149
+ readonly screenPadding: 16;
150
+ readonly maxFloatingWidth: 360;
151
+ readonly maxToolDockWidth: 420;
152
+ readonly toolDockPaddingTop: 4;
153
+ readonly toolDockHistoryIconSize: 18;
154
+ readonly toolDockHistoryGap: 2;
155
+ readonly toolDockDisabledIconColorDark: "#64748b";
156
+ readonly toolDockDisabledIconColorLight: "#6b7280";
157
+ readonly toolDockDisabledOpacity: 0.72;
158
+ readonly iconSize: 20;
159
+ readonly iconBoxSize: 28;
160
+ readonly topbarPageButtonSize: 30;
161
+ readonly bottomBarItemPaddingHorizontal: 5;
162
+ readonly bottomBarItemPaddingVertical: 3;
163
+ };
164
+
165
+ export { AnnotationEditor, BottomBar, CoverPreview, DocumentActionsSheet, InfoSheet, MOBILE_CHROME_METRICS, OverflowSheet, _default as PageRenderer, ProgressPill, ReadingShell, RightSheet, SearchOverlay, SearchResultsSheet, SettingsSheet, ToolDock, Topbar, Viewer };