@papyrus-sdk/ui-react-native 0.2.19 → 0.2.20
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.js +22 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -21310,6 +21310,12 @@ var buildCommentTapGestureDeps = ({
|
|
|
21310
21310
|
addAnnotationAt
|
|
21311
21311
|
];
|
|
21312
21312
|
|
|
21313
|
+
// components/pdfPageMetrics.ts
|
|
21314
|
+
var resolvePdfBasePageWidth = ({
|
|
21315
|
+
viewportWidth,
|
|
21316
|
+
horizontalPadding
|
|
21317
|
+
}) => Math.max(0, viewportWidth - horizontalPadding * 2);
|
|
21318
|
+
|
|
21313
21319
|
// components/PageRenderer.tsx
|
|
21314
21320
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
21315
21321
|
var TEXT_MARKUP_TOOLS = /* @__PURE__ */ new Set([
|
|
@@ -22271,7 +22277,10 @@ var PageRenderer = ({
|
|
|
22271
22277
|
}, [pageTheme]);
|
|
22272
22278
|
const aspectRatio = typeof pageAspectRatio === "number" && Number.isFinite(pageAspectRatio) && pageAspectRatio > 0 ? pageAspectRatio : pageSize && pageSize.width > 0 && pageSize.height > 0 ? pageSize.width / pageSize.height : 0.77;
|
|
22273
22279
|
const containerWidth = availableWidth ?? windowWidth;
|
|
22274
|
-
const baseWidth =
|
|
22280
|
+
const baseWidth = resolvePdfBasePageWidth({
|
|
22281
|
+
viewportWidth: containerWidth,
|
|
22282
|
+
horizontalPadding
|
|
22283
|
+
});
|
|
22275
22284
|
const pageWidth = isNative ? baseWidth * zoom : baseWidth;
|
|
22276
22285
|
const pageHeight = pageWidth / aspectRatio;
|
|
22277
22286
|
const pageFrameWidth = Math.max(
|
|
@@ -24418,7 +24427,10 @@ var Viewer = ({
|
|
|
24418
24427
|
const getPageWidthForZoom = useCallback3(
|
|
24419
24428
|
(pageIndex, zoomValue) => {
|
|
24420
24429
|
const safeZoom = Math.max(zoomValue, 0.25);
|
|
24421
|
-
const baseWidth =
|
|
24430
|
+
const baseWidth = resolvePdfBasePageWidth({
|
|
24431
|
+
viewportWidth: isDouble ? columnWidth : windowWidth,
|
|
24432
|
+
horizontalPadding: isDouble ? 8 : 16
|
|
24433
|
+
});
|
|
24422
24434
|
return baseWidth * safeZoom;
|
|
24423
24435
|
},
|
|
24424
24436
|
[columnWidth, isDouble, windowWidth]
|
|
@@ -24951,7 +24963,10 @@ var Viewer = ({
|
|
|
24951
24963
|
let offset = LIST_TOP_PADDING;
|
|
24952
24964
|
if (isDouble) {
|
|
24953
24965
|
const safeZoom2 = Math.max(zoom, 0.25);
|
|
24954
|
-
const pageWidth2 =
|
|
24966
|
+
const pageWidth2 = resolvePdfBasePageWidth({
|
|
24967
|
+
viewportWidth: columnWidth,
|
|
24968
|
+
horizontalPadding: 8
|
|
24969
|
+
}) * safeZoom2;
|
|
24955
24970
|
const estimatedLength2 = pageWidth2 / DEFAULT_PAGE_ASPECT_RATIO + DOUBLE_PAGE_SPACING;
|
|
24956
24971
|
for (let i = 0; i < rows.length; i += 1) {
|
|
24957
24972
|
const row = rows[i];
|
|
@@ -24967,7 +24982,10 @@ var Viewer = ({
|
|
|
24967
24982
|
return { offsets, lengths, estimatedLength: estimatedLength2 };
|
|
24968
24983
|
}
|
|
24969
24984
|
const safeZoom = Math.max(zoom, 0.25);
|
|
24970
|
-
const pageWidth =
|
|
24985
|
+
const pageWidth = resolvePdfBasePageWidth({
|
|
24986
|
+
viewportWidth: windowWidth,
|
|
24987
|
+
horizontalPadding: 16
|
|
24988
|
+
}) * safeZoom;
|
|
24971
24989
|
const estimatedLength = pageWidth / DEFAULT_PAGE_ASPECT_RATIO + CONTINUOUS_PAGE_SPACING;
|
|
24972
24990
|
for (let i = 0; i < pageCount; i += 1) {
|
|
24973
24991
|
const ratio = getPageAspectRatio(i);
|