@anaralabs/lector 3.12.1 → 3.12.3

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -2
  2. package/package.json +101 -101
package/dist/index.js CHANGED
@@ -5099,13 +5099,16 @@ var useViewportContainer = ({
5099
5099
  const elementRect = currentElement.getBoundingClientRect();
5100
5100
  const containerRect = currentContainer.getBoundingClientRect();
5101
5101
  const currentZoom = transformations.current.zoom;
5102
+ const containerStyle = getComputedStyle(currentContainer);
5103
+ const paddingTop = parseFloat(containerStyle.paddingTop) || 0;
5104
+ const paddingLeft = parseFloat(containerStyle.paddingLeft) || 0;
5102
5105
  const contentPosition = [
5103
5106
  origin[0] - elementRect.left,
5104
5107
  origin[1] - elementRect.top
5105
5108
  ];
5106
5109
  const containerPosition = [
5107
- origin[0] - containerRect.left,
5108
- origin[1] - containerRect.top
5110
+ origin[0] - containerRect.left - paddingLeft,
5111
+ origin[1] - containerRect.top - paddingTop
5109
5112
  ];
5110
5113
  originRef.current = [
5111
5114
  contentPosition[0] / currentZoom,
package/package.json CHANGED
@@ -1,103 +1,103 @@
1
1
  {
2
- "name": "@anaralabs/lector",
3
- "version": "3.12.1",
4
- "description": "A headless PDF viewer for React",
5
- "author": "andrewdr (https://github.com/andrewdoro)",
6
- "license": "MIT",
7
- "type": "module",
8
- "sideEffects": false,
9
- "module": "dist/index.js",
10
- "types": "dist/index.d.ts",
11
- "exports": {
12
- ".": {
13
- "types": "./dist/index.d.ts",
14
- "import": "./dist/index.js",
15
- "require": "./esm-only.cjs"
16
- }
17
- },
18
- "files": [
19
- "dist"
20
- ],
21
- "publishConfig": {
22
- "access": "public"
23
- },
24
- "scripts": {
25
- "dev": "tsup --watch --onSuccess 'yalc push'",
26
- "prebuild": "rm -rf dist",
27
- "build": "tsup",
28
- "lint": "biome check .",
29
- "format": "biome format --write .",
30
- "postbuild": "size-limit --json > size.json",
31
- "test": "pnpm run '/^test:/'",
32
- "test:unit": "vitest run",
33
- "test:size": "size-limit",
34
- "prepack": "./scripts/prepack.sh"
35
- },
36
- "devDependencies": {
37
- "@microsoft/api-extractor": "^7.48.1",
38
- "@size-limit/preset-small-lib": "^11.1.6",
39
- "@testing-library/react": "^16.0.0",
40
- "@types/node": "^22.9.0",
41
- "@types/react": "^19.0.1",
42
- "@types/react-dom": "^19.0.2",
43
- "@use-gesture/react": "^10.3.1",
44
- "@vitejs/plugin-react": "^4.3.4",
45
- "@vitest/browser": "^2.0.4",
46
- "clsx": "^2.1.1",
47
- "pdfjs-dist": "^5.5.207",
48
- "playwright": "^1.45.3",
49
- "react": "^19.1.1",
50
- "size-limit": "^11.1.6",
51
- "tsc-alias": "^1.8.10",
52
- "tslib": "^2.6.3",
53
- "tsup": "^8.3.5",
54
- "typescript": "^5.5.3",
55
- "vite": "^5.3.3",
56
- "vitest": "^2.0.4",
57
- "webdriverio": "^8.39.1"
58
- },
59
- "peerDependencies": {
60
- "pdfjs-dist": "^5.5.207",
61
- "react": ">=19"
62
- },
63
- "dependencies": {
64
- "@floating-ui/react": "^0.26.28",
65
- "@radix-ui/react-slot": "^1.1.0",
66
- "@tanstack/react-virtual": "^3.10.9",
67
- "react-dom": "^19.1.1",
68
- "use-debounce": "^10.0.4",
69
- "uuid": "^11.1.0",
70
- "zustand": "^5.0.2"
71
- },
72
- "optionalDependencies": {
73
- "@rollup/rollup-linux-x64-gnu": "^4.28.1"
74
- },
75
- "keywords": [
76
- "pdf",
77
- "react",
78
- "headless",
79
- "viewer",
80
- "react-pdf",
81
- "anaralabs",
82
- "typescript"
83
- ],
84
- "repository": {
85
- "type": "git",
86
- "url": "git+https://github.com/anaralabs/lector.git",
87
- "directory": "packages/lector"
88
- },
89
- "bugs": {
90
- "url": "https://github.com/anaralabs/lector/issues"
91
- },
92
- "homepage": "https://github.com/anaralabs/lector",
93
- "size-limit": [
94
- {
95
- "name": "Client",
96
- "path": "dist/index.js",
97
- "limit": "150 kB",
98
- "ignore": [
99
- "react"
100
- ]
101
- }
102
- ]
2
+ "name": "@anaralabs/lector",
3
+ "version": "3.12.3",
4
+ "description": "A headless PDF viewer for React",
5
+ "author": "andrewdr (https://github.com/andrewdoro)",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "sideEffects": false,
9
+ "module": "dist/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js",
15
+ "require": "./esm-only.cjs"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "scripts": {
25
+ "dev": "tsup --watch --onSuccess 'yalc push'",
26
+ "prebuild": "rm -rf dist",
27
+ "build": "tsup",
28
+ "lint": "biome check .",
29
+ "format": "biome format --write .",
30
+ "postbuild": "size-limit --json > size.json",
31
+ "test": "pnpm run '/^test:/'",
32
+ "test:unit": "vitest run",
33
+ "test:size": "size-limit",
34
+ "prepack": "./scripts/prepack.sh"
35
+ },
36
+ "devDependencies": {
37
+ "@microsoft/api-extractor": "^7.48.1",
38
+ "@size-limit/preset-small-lib": "^11.1.6",
39
+ "@testing-library/react": "^16.0.0",
40
+ "@types/node": "^22.9.0",
41
+ "@types/react": "^19.0.1",
42
+ "@types/react-dom": "^19.0.2",
43
+ "@use-gesture/react": "^10.3.1",
44
+ "@vitejs/plugin-react": "^4.3.4",
45
+ "@vitest/browser": "^3.2.4",
46
+ "clsx": "^2.1.1",
47
+ "pdfjs-dist": "^5.5.207",
48
+ "playwright": "^1.45.3",
49
+ "react": "^19.1.1",
50
+ "size-limit": "^11.1.6",
51
+ "tsc-alias": "^1.8.10",
52
+ "tslib": "^2.6.3",
53
+ "tsup": "^8.3.5",
54
+ "typescript": "^5.5.3",
55
+ "vite": "^6.4.2",
56
+ "vitest": "^3.2.4",
57
+ "webdriverio": "^8.39.1"
58
+ },
59
+ "peerDependencies": {
60
+ "pdfjs-dist": "^5.5.207",
61
+ "react": ">=19"
62
+ },
63
+ "dependencies": {
64
+ "@floating-ui/react": "^0.26.28",
65
+ "@radix-ui/react-slot": "^1.1.0",
66
+ "@tanstack/react-virtual": "^3.10.9",
67
+ "react-dom": "^19.1.1",
68
+ "use-debounce": "^10.0.4",
69
+ "uuid": "^11.1.1",
70
+ "zustand": "^5.0.2"
71
+ },
72
+ "optionalDependencies": {
73
+ "@rollup/rollup-linux-x64-gnu": "^4.28.1"
74
+ },
75
+ "keywords": [
76
+ "pdf",
77
+ "react",
78
+ "headless",
79
+ "viewer",
80
+ "react-pdf",
81
+ "anaralabs",
82
+ "typescript"
83
+ ],
84
+ "repository": {
85
+ "type": "git",
86
+ "url": "git+https://github.com/anaralabs/lector.git",
87
+ "directory": "packages/lector"
88
+ },
89
+ "bugs": {
90
+ "url": "https://github.com/anaralabs/lector/issues"
91
+ },
92
+ "homepage": "https://github.com/anaralabs/lector",
93
+ "size-limit": [
94
+ {
95
+ "name": "Client",
96
+ "path": "dist/index.js",
97
+ "limit": "150 kB",
98
+ "ignore": [
99
+ "react"
100
+ ]
101
+ }
102
+ ]
103
103
  }