@anaralabs/lector 3.7.0 → 3.7.2

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.
@@ -145,7 +145,7 @@ export declare const CanvasLayer: ({ style, background, ...props }: HTMLProps<HT
145
145
  background?: string;
146
146
  }) => JSX.Element;
147
147
 
148
- export declare const clamp: (value: number, min: number, max: number) => number;
148
+ export declare const clamp: (value: number, minimum: number, maximum: number) => number;
149
149
 
150
150
  declare type CollapsibleSelection = {
151
151
  highlights: HighlightRect[];
package/dist/index.js CHANGED
@@ -14,8 +14,8 @@ import { useVirtualizer, elementScroll, debounce } from '@tanstack/react-virtual
14
14
  // src/components/annotation-tooltip.tsx
15
15
 
16
16
  // src/lib/clamp.ts
17
- var clamp = (value, min, max) => {
18
- return Math.min(Math.max(value, min), max);
17
+ var clamp = (value, minimum, maximum) => {
18
+ return Math.min(Math.max(value, minimum), maximum);
19
19
  };
20
20
 
21
21
  // src/lib/zoom.ts
@@ -1267,7 +1267,7 @@ var useDetailCanvasLayer = ({
1267
1267
  );
1268
1268
  const visibleWidth = Math.max(0, visibleRight - visibleLeft);
1269
1269
  const visibleHeight = Math.max(0, visibleBottom - visibleTop);
1270
- const targetDetailScale = dpr * zoom / 2;
1270
+ const targetDetailScale = dpr * zoom * 1.3;
1271
1271
  const baseTargetScale = dpr * Math.min(zoom, 1);
1272
1272
  const baseScale = clampScaleForPage(baseTargetScale, pageWidth, pageHeight);
1273
1273
  const needsDetail = zoom > 1 && targetDetailScale - baseScale > 1e-3;
@@ -4543,7 +4543,7 @@ function parseMergedHandlers(mergedHandlers, mergedConfig) {
4543
4543
  };
4544
4544
  }
4545
4545
 
4546
- // ../../node_modules/.pnpm/@use-gesture+react@10.3.1_react@18.3.1/node_modules/@use-gesture/react/dist/use-gesture-react.esm.js
4546
+ // ../../node_modules/.pnpm/@use-gesture+react@10.3.1_react@19.2.0/node_modules/@use-gesture/react/dist/use-gesture-react.esm.js
4547
4547
  function useRecognizers(handlers, config = {}, gestureKey, nativeHandlers) {
4548
4548
  const ctrl = React.useMemo(() => new Controller(handlers), []);
4549
4549
  ctrl.applyHandlers(handlers, nativeHandlers);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anaralabs/lector",
3
- "version": "3.7.0",
3
+ "version": "3.7.2",
4
4
  "description": "Headless PDF viewer for React",
5
5
  "author": "andrewdr (https://github.com/andrewdoro)",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  "clsx": "^2.1.1",
47
47
  "pdfjs-dist": "^4.10.38",
48
48
  "playwright": "^1.45.3",
49
- "react": "^18.3.1",
49
+ "react": "^19.1.1",
50
50
  "size-limit": "^11.1.6",
51
51
  "tsc-alias": "^1.8.10",
52
52
  "tslib": "^2.6.3",
@@ -58,13 +58,13 @@
58
58
  },
59
59
  "peerDependencies": {
60
60
  "pdfjs-dist": "^4.9",
61
- "react": ">=18"
61
+ "react": ">=19"
62
62
  },
63
63
  "dependencies": {
64
64
  "@floating-ui/react": "^0.26.28",
65
65
  "@radix-ui/react-slot": "^1.1.0",
66
66
  "@tanstack/react-virtual": "^3.10.9",
67
- "react-dom": "18.3.1",
67
+ "react-dom": "^19.1.1",
68
68
  "use-debounce": "^10.0.4",
69
69
  "uuid": "^11.1.0",
70
70
  "zustand": "^5.0.2"