@papyrus-sdk/ui-react-native 0.2.32 → 0.2.34

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
@@ -83,11 +83,13 @@ await engine.load({ type: 'pdf', source: { uri: 'https://example.com/book.pdf' }
83
83
 
84
84
  ## Mobile Tuning Flags
85
85
 
86
- Performance tuning props are available on `Viewer` and `RightSheet`:
86
+ Layout and performance options are available on `Viewer` and `RightSheet`:
87
87
 
88
88
  ```tsx
89
89
  <Viewer
90
90
  engine={engine}
91
+ maxPageWidth={760}
92
+ fitPageToViewportHeight
91
93
  virtualWindowSize={8}
92
94
  maxToRenderPerBatch={6}
93
95
  removeClippedSubviews
@@ -97,6 +99,12 @@ Performance tuning props are available on `Viewer` and `RightSheet`:
97
99
  ```
98
100
 
99
101
  - `virtualWindowSize` (`Viewer`): FlatList window size. Default: `8`.
102
+ - `maxPageWidth` (`Viewer`): optional fit-zoom width limit in React Native points. A narrower page is centered in the viewport; pinch zoom may enlarge it. Omitted by default.
103
+ - `fitPageToViewportHeight` (`Viewer`): opt-in page fitting to the measured
104
+ viewer height while preserving each page's aspect ratio; pinch zoom may
105
+ enlarge it. Defaults to `false`. This option is only supported by the React
106
+ Native compatibility renderer; it is not applied by the WebView or dedicated
107
+ Android PDF renderer.
100
108
  - `maxToRenderPerBatch` (`Viewer`): max items per render batch. Default: `6`.
101
109
  - `removeClippedSubviews` (`Viewer`): detach offscreen rows. Default: `false`
102
110
  for Android `viewerMode="compat"` and `true` otherwise. An explicit value is
package/dist/index.d.mts CHANGED
@@ -6,6 +6,14 @@ import { StyleProp, ViewStyle } from 'react-native';
6
6
 
7
7
  interface ViewerProps {
8
8
  engine: DocumentEngine;
9
+ /** Maximum page width at fit zoom, in React Native points; pinch zoom may enlarge it. */
10
+ maxPageWidth?: number;
11
+ /**
12
+ * Fit each page's aspect ratio within the measured viewer height at fit zoom.
13
+ * Supported by the React Native compatibility renderer; not applied by the
14
+ * WebView or dedicated Android PDF renderer.
15
+ */
16
+ fitPageToViewportHeight?: boolean;
9
17
  virtualWindowSize?: number;
10
18
  maxToRenderPerBatch?: number;
11
19
  removeClippedSubviews?: boolean;
@@ -50,6 +58,8 @@ interface PageRendererProps {
50
58
  pageAspectRatio?: number;
51
59
  PageViewComponent?: PageViewComponentType;
52
60
  availableWidth?: number;
61
+ maxPageWidth?: number;
62
+ maxPageHeight?: number;
53
63
  pageViewportWidth?: number;
54
64
  horizontalPadding?: number;
55
65
  spacing?: number;
@@ -133,8 +143,9 @@ declare function ReadingShell({ engine, title, documentType, thumbsInitialCount,
133
143
 
134
144
  type DedicatedAndroidPdfViewerProps = {
135
145
  engine: DocumentEngine;
146
+ maxPageWidth?: number;
136
147
  };
137
- declare function DedicatedAndroidPdfViewer({ engine, }: DedicatedAndroidPdfViewerProps): react_jsx_runtime.JSX.Element;
148
+ declare function DedicatedAndroidPdfViewer({ engine, maxPageWidth, }: DedicatedAndroidPdfViewerProps): react_jsx_runtime.JSX.Element;
138
149
 
139
150
  type OverflowSheetProps = {
140
151
  visible: boolean;
package/dist/index.d.ts CHANGED
@@ -6,6 +6,14 @@ import { StyleProp, ViewStyle } from 'react-native';
6
6
 
7
7
  interface ViewerProps {
8
8
  engine: DocumentEngine;
9
+ /** Maximum page width at fit zoom, in React Native points; pinch zoom may enlarge it. */
10
+ maxPageWidth?: number;
11
+ /**
12
+ * Fit each page's aspect ratio within the measured viewer height at fit zoom.
13
+ * Supported by the React Native compatibility renderer; not applied by the
14
+ * WebView or dedicated Android PDF renderer.
15
+ */
16
+ fitPageToViewportHeight?: boolean;
9
17
  virtualWindowSize?: number;
10
18
  maxToRenderPerBatch?: number;
11
19
  removeClippedSubviews?: boolean;
@@ -50,6 +58,8 @@ interface PageRendererProps {
50
58
  pageAspectRatio?: number;
51
59
  PageViewComponent?: PageViewComponentType;
52
60
  availableWidth?: number;
61
+ maxPageWidth?: number;
62
+ maxPageHeight?: number;
53
63
  pageViewportWidth?: number;
54
64
  horizontalPadding?: number;
55
65
  spacing?: number;
@@ -133,8 +143,9 @@ declare function ReadingShell({ engine, title, documentType, thumbsInitialCount,
133
143
 
134
144
  type DedicatedAndroidPdfViewerProps = {
135
145
  engine: DocumentEngine;
146
+ maxPageWidth?: number;
136
147
  };
137
- declare function DedicatedAndroidPdfViewer({ engine, }: DedicatedAndroidPdfViewerProps): react_jsx_runtime.JSX.Element;
148
+ declare function DedicatedAndroidPdfViewer({ engine, maxPageWidth, }: DedicatedAndroidPdfViewerProps): react_jsx_runtime.JSX.Element;
138
149
 
139
150
  type OverflowSheetProps = {
140
151
  visible: boolean;