hsu-utils 0.0.19 → 0.0.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * hsu-utils v0.0.18
3
+ * hsu-utils v0.0.19
4
4
  *
5
5
  * some front-end utils
6
6
  *
@@ -27,8 +27,8 @@ function renderPage({ pdf, container, num, pixelRatio = 2, scale = 1 }) {
27
27
  pageDiv.appendChild(canvas);
28
28
  const ctx = canvas.getContext('2d');
29
29
  const devicePixelRatio = window.devicePixelRatio * pixelRatio;
30
- const viewport = page.getViewport({ scale: scale * devicePixelRatio });
31
- canvas.style.width = '100%';
30
+ const viewport = page.getViewport({ scale: 1 * devicePixelRatio });
31
+ canvas.style.width = `calc(100% * ${scale})`;
32
32
  canvas.style.height = '100%';
33
33
  canvas.width = viewport.width;
34
34
  canvas.height = viewport.height;
@@ -57,8 +57,8 @@ function renderPage(_a) {
57
57
  pageDiv.appendChild(canvas);
58
58
  var ctx = canvas.getContext('2d');
59
59
  var devicePixelRatio = window.devicePixelRatio * pixelRatio;
60
- var viewport = page.getViewport({ scale: scale * devicePixelRatio });
61
- canvas.style.width = '100%';
60
+ var viewport = page.getViewport({ scale: 1 * devicePixelRatio });
61
+ canvas.style.width = "calc(100% * ".concat(scale, ")");
62
62
  canvas.style.height = '100%';
63
63
  canvas.width = viewport.width;
64
64
  canvas.height = viewport.height;
package/package.json CHANGED
@@ -1,59 +1,59 @@
1
- {
2
- "name": "hsu-utils",
3
- "version": "0.0.19",
4
- "description": "some front-end utils",
5
- "repository": "git@github.com:VitaTsui/hsu-utils.git",
6
- "author": "VitaHsu <vitahsu7@gmail.com>",
7
- "license": "MIT",
8
- "main": "lib/index.js",
9
- "module": "es/index.js",
10
- "unpkg": "dist/hsu-utils.min.js",
11
- "files": [
12
- "es",
13
- "lib",
14
- "dist",
15
- "package.json",
16
- "README.md",
17
- "LICENSE"
18
- ],
19
- "sideEffects": [
20
- "es/*",
21
- "lib/*",
22
- "dist/*"
23
- ],
24
- "scripts": {
25
- "build": "yarn build:es && yarn build:cjs && rimraf dist && yarn build:umd",
26
- "build:es": "rimraf es && tsc -p build/tsconfig.es.json",
27
- "build:cjs": "rimraf lib && tsc -p build/tsconfig.cjs.json",
28
- "build:umd": "rimraf dist && yarn build:dev && yarn build:prod",
29
- "build:dev": "cross-env NODE_ENV=development webpack --config build/webpack.config.js",
30
- "build:prod": "cross-env NODE_ENV=production webpack --config build/webpack.config.js",
31
- "clear": "rimraf lib && rimraf es && rimraf dist",
32
- "test": "jest",
33
- "publish:patch": "yarn build && yarn publish --new-version patch",
34
- "publish:minor": "yarn build && yarn publish --new-version minor",
35
- "publish:major": "yarn build && yarn publish --new-version major",
36
- "publish:alpha": "yarn build && yarn publish --tag alpha"
37
- },
38
- "devDependencies": {
39
- "@jest/globals": "^29.5.0",
40
- "@testing-library/react-hooks": "^8.0.1",
41
- "@types/jest": "^29.5.2",
42
- "cross-env": "^7.0.3",
43
- "jest": "^29.5.0",
44
- "jest-canvas-mock": "^2.5.2",
45
- "jest-environment-jsdom": "^29.5.0",
46
- "jsdom": "^22.1.0",
47
- "rimraf": "^5.0.1",
48
- "terser-webpack-plugin": "^5.3.0",
49
- "ts-jest": "^29.1.0",
50
- "ts-loader": "^9.2.6",
51
- "ts-node": "^10.9.1",
52
- "typescript": "^5.1.3",
53
- "webpack": "^5.65.0",
54
- "webpack-cli": "^4.9.1"
55
- },
56
- "dependencies": {
57
- "pdfjs-dist": "2.13.216"
58
- }
59
- }
1
+ {
2
+ "name": "hsu-utils",
3
+ "version": "0.0.20",
4
+ "description": "some front-end utils",
5
+ "repository": "git@github.com:VitaTsui/hsu-utils.git",
6
+ "author": "VitaHsu <vitahsu7@gmail.com>",
7
+ "license": "MIT",
8
+ "main": "lib/index.js",
9
+ "module": "es/index.js",
10
+ "unpkg": "dist/hsu-utils.min.js",
11
+ "files": [
12
+ "es",
13
+ "lib",
14
+ "dist",
15
+ "package.json",
16
+ "README.md",
17
+ "LICENSE"
18
+ ],
19
+ "sideEffects": [
20
+ "es/*",
21
+ "lib/*",
22
+ "dist/*"
23
+ ],
24
+ "scripts": {
25
+ "build": "yarn build:es && yarn build:cjs && rimraf dist && yarn build:umd",
26
+ "build:es": "rimraf es && tsc -p build/tsconfig.es.json",
27
+ "build:cjs": "rimraf lib && tsc -p build/tsconfig.cjs.json",
28
+ "build:umd": "rimraf dist && yarn build:dev && yarn build:prod",
29
+ "build:dev": "cross-env NODE_ENV=development webpack --config build/webpack.config.js",
30
+ "build:prod": "cross-env NODE_ENV=production webpack --config build/webpack.config.js",
31
+ "clear": "rimraf lib && rimraf es && rimraf dist",
32
+ "test": "jest",
33
+ "publish:patch": "yarn build && yarn publish --new-version patch",
34
+ "publish:minor": "yarn build && yarn publish --new-version minor",
35
+ "publish:major": "yarn build && yarn publish --new-version major",
36
+ "publish:alpha": "yarn build && yarn publish --tag alpha"
37
+ },
38
+ "devDependencies": {
39
+ "@jest/globals": "^29.5.0",
40
+ "@testing-library/react-hooks": "^8.0.1",
41
+ "@types/jest": "^29.5.2",
42
+ "cross-env": "^7.0.3",
43
+ "jest": "^29.5.0",
44
+ "jest-canvas-mock": "^2.5.2",
45
+ "jest-environment-jsdom": "^29.5.0",
46
+ "jsdom": "^22.1.0",
47
+ "rimraf": "^5.0.1",
48
+ "terser-webpack-plugin": "^5.3.0",
49
+ "ts-jest": "^29.1.0",
50
+ "ts-loader": "^9.2.6",
51
+ "ts-node": "^10.9.1",
52
+ "typescript": "^5.1.3",
53
+ "webpack": "^5.65.0",
54
+ "webpack-cli": "^4.9.1"
55
+ },
56
+ "dependencies": {
57
+ "pdfjs-dist": "2.13.216"
58
+ }
59
+ }