@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.js
CHANGED
|
@@ -21501,6 +21501,12 @@ var buildCommentTapGestureDeps = ({
|
|
|
21501
21501
|
addAnnotationAt
|
|
21502
21502
|
];
|
|
21503
21503
|
|
|
21504
|
+
// components/pdfPageMetrics.ts
|
|
21505
|
+
var resolvePdfBasePageWidth = ({
|
|
21506
|
+
viewportWidth,
|
|
21507
|
+
horizontalPadding
|
|
21508
|
+
}) => Math.max(0, viewportWidth - horizontalPadding * 2);
|
|
21509
|
+
|
|
21504
21510
|
// components/PageRenderer.tsx
|
|
21505
21511
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
21506
21512
|
var TEXT_MARKUP_TOOLS = /* @__PURE__ */ new Set([
|
|
@@ -22462,7 +22468,10 @@ var PageRenderer = ({
|
|
|
22462
22468
|
}, [pageTheme]);
|
|
22463
22469
|
const aspectRatio = typeof pageAspectRatio === "number" && Number.isFinite(pageAspectRatio) && pageAspectRatio > 0 ? pageAspectRatio : pageSize && pageSize.width > 0 && pageSize.height > 0 ? pageSize.width / pageSize.height : 0.77;
|
|
22464
22470
|
const containerWidth = availableWidth ?? windowWidth;
|
|
22465
|
-
const baseWidth =
|
|
22471
|
+
const baseWidth = resolvePdfBasePageWidth({
|
|
22472
|
+
viewportWidth: containerWidth,
|
|
22473
|
+
horizontalPadding
|
|
22474
|
+
});
|
|
22466
22475
|
const pageWidth = isNative ? baseWidth * zoom : baseWidth;
|
|
22467
22476
|
const pageHeight = pageWidth / aspectRatio;
|
|
22468
22477
|
const pageFrameWidth = Math.max(
|
|
@@ -24600,7 +24609,10 @@ var Viewer = ({
|
|
|
24600
24609
|
const getPageWidthForZoom = (0, import_react4.useCallback)(
|
|
24601
24610
|
(pageIndex, zoomValue) => {
|
|
24602
24611
|
const safeZoom = Math.max(zoomValue, 0.25);
|
|
24603
|
-
const baseWidth =
|
|
24612
|
+
const baseWidth = resolvePdfBasePageWidth({
|
|
24613
|
+
viewportWidth: isDouble ? columnWidth : windowWidth,
|
|
24614
|
+
horizontalPadding: isDouble ? 8 : 16
|
|
24615
|
+
});
|
|
24604
24616
|
return baseWidth * safeZoom;
|
|
24605
24617
|
},
|
|
24606
24618
|
[columnWidth, isDouble, windowWidth]
|
|
@@ -25133,7 +25145,10 @@ var Viewer = ({
|
|
|
25133
25145
|
let offset = LIST_TOP_PADDING;
|
|
25134
25146
|
if (isDouble) {
|
|
25135
25147
|
const safeZoom2 = Math.max(zoom, 0.25);
|
|
25136
|
-
const pageWidth2 =
|
|
25148
|
+
const pageWidth2 = resolvePdfBasePageWidth({
|
|
25149
|
+
viewportWidth: columnWidth,
|
|
25150
|
+
horizontalPadding: 8
|
|
25151
|
+
}) * safeZoom2;
|
|
25137
25152
|
const estimatedLength2 = pageWidth2 / DEFAULT_PAGE_ASPECT_RATIO + DOUBLE_PAGE_SPACING;
|
|
25138
25153
|
for (let i = 0; i < rows.length; i += 1) {
|
|
25139
25154
|
const row = rows[i];
|
|
@@ -25149,7 +25164,10 @@ var Viewer = ({
|
|
|
25149
25164
|
return { offsets, lengths, estimatedLength: estimatedLength2 };
|
|
25150
25165
|
}
|
|
25151
25166
|
const safeZoom = Math.max(zoom, 0.25);
|
|
25152
|
-
const pageWidth =
|
|
25167
|
+
const pageWidth = resolvePdfBasePageWidth({
|
|
25168
|
+
viewportWidth: windowWidth,
|
|
25169
|
+
horizontalPadding: 16
|
|
25170
|
+
}) * safeZoom;
|
|
25153
25171
|
const estimatedLength = pageWidth / DEFAULT_PAGE_ASPECT_RATIO + CONTINUOUS_PAGE_SPACING;
|
|
25154
25172
|
for (let i = 0; i < pageCount; i += 1) {
|
|
25155
25173
|
const ratio = getPageAspectRatio(i);
|