@tato30/vue-pdf
Advanced tools
Comparing version 1.3.4 to 1.4.0-beta.0
{ | ||
"name": "@tato30/vue-pdf", | ||
"version": "1.4.0-beta.0", | ||
"description": "PDF viewer for Vue 3", | ||
"version": "1.3.4", | ||
"author": { | ||
"name": "Aldo Hernandez", | ||
"url": "https://github.com/TaTo30" | ||
}, | ||
"license": "MIT", | ||
"main": "cjs/index.js", | ||
"module": "esm/index.js", | ||
"homepage": "https://github.com/TaTo30/VuePDF/", | ||
"repository": { | ||
@@ -15,3 +18,2 @@ "type": "git", | ||
}, | ||
"homepage": "https://github.com/TaTo30/VuePDF/", | ||
"keywords": [ | ||
@@ -22,37 +24,45 @@ "pdf", | ||
], | ||
"author": { | ||
"name": "Aldo Hernandez", | ||
"url": "https://github.com/TaTo30" | ||
"exports": { | ||
".": { | ||
"require": "./dist/lib/index.cjs", | ||
"import": "./dist/lib/index.mjs" | ||
}, | ||
"./src/*": "./src/*" | ||
}, | ||
"main": "./dist/lib/index.cjs", | ||
"module": "./dist/lib/index.mjs", | ||
"types": "./dist/types/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"src" | ||
], | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "rollup -c", | ||
"dev": "vite --config vite.playground.ts", | ||
"build": "npm run build:lib && npm run build:dts", | ||
"build:lib": "vite build", | ||
"build:dts": "vue-tsc --declaration --emitDeclarationOnly -p tsconfig.build.json", | ||
"publish": "npm publish --access public", | ||
"preview": "vite preview --port 5050", | ||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore" | ||
"lint": "eslint .", | ||
"lint:fix": "eslint --fix ." | ||
}, | ||
"peerDependencies": { | ||
"vue": "^3.2.33" | ||
}, | ||
"dependencies": { | ||
"pdfjs-dist": "^2.14.305" | ||
"pdfjs-dist": "^2.16.105" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.18.2", | ||
"@rushstack/eslint-patch": "^1.1.0", | ||
"@vitejs/plugin-vue": "^2.3.1", | ||
"@vue/compiler-sfc": "^3.2.36", | ||
"@vue/eslint-config-prettier": "^7.0.0", | ||
"babel-loader": "^8.2.5", | ||
"eslint": "^8.16.0", | ||
"eslint-plugin-vue": "^8.2.0", | ||
"prettier": "^2.5.1", | ||
"rollup": "^2.75.4", | ||
"rollup-plugin-css-only": "^3.1.0", | ||
"rollup-plugin-peer-deps-external": "^2.2.4", | ||
"rollup-plugin-vue": "^6.0.0", | ||
"vite": "^2.9.5", | ||
"vue": "^3.2.33", | ||
"vue-loader": "^16.8.3" | ||
}, | ||
"peerDependencies": { | ||
"vue": "^3.2.33" | ||
"@antfu/eslint-config": "^0.38.5", | ||
"@babel/core": "^7.21.8", | ||
"@originjs/vite-plugin-commonjs": "^1.0.3", | ||
"@types/node": "^18.16.3", | ||
"@vitejs/plugin-vue": "^4.2.1", | ||
"@vue/eslint-config-prettier": "^7.1.0", | ||
"eslint": "^8.39.0", | ||
"typescript": "^4.9.4", | ||
"vite": "^4.3.4", | ||
"vue": "^3.2.47", | ||
"vue-tsc": "^1.6.3" | ||
} | ||
} |
@@ -35,8 +35,4 @@ # VuePDF | ||
```vue | ||
<template> | ||
<VuePDF :pdf="pdf" :page="1" /> | ||
</template> | ||
<script> | ||
import {usePDF, VuePDF} from '@tato30/vue-pdf' | ||
import { VuePDF, usePDF } from '@tato30/vue-pdf' | ||
@@ -47,4 +43,4 @@ export default { | ||
}, | ||
setup(){ | ||
const { pdf, pages, info } = usePDF("document.pdf") | ||
setup() { | ||
const { pdf, pages, info } = usePDF('document.pdf') | ||
@@ -60,2 +56,6 @@ console.log(`Document has ${pages} pages`) | ||
</script> | ||
<template> | ||
<VuePDF :pdf="pdf" :page="1" /> | ||
</template> | ||
``` | ||
@@ -77,3 +77,3 @@ | ||
```js | ||
const { pdf, pages, info } = usePDF("document.pdf") | ||
const { pdf, pages, info } = usePDF('document.pdf') | ||
``` | ||
@@ -92,3 +92,3 @@ | ||
```js | ||
const onPassword = (updatePassword, reason) => { | ||
function onPassword(updatePassword, reason) { | ||
console.log(`Reason for callback: ${reason}`) | ||
@@ -98,14 +98,14 @@ updatePassword('documentpassword1234') | ||
const onProgress = ({loaded, total}) => { | ||
console.log(`${loaded / total * 100}% Loaded`); | ||
function onProgress({ loaded, total }) { | ||
console.log(`${loaded / total * 100}% Loaded`) | ||
} | ||
const onError = (reason) => { | ||
function onError(reason) { | ||
console.error(`PDF loading error: ${reason}`) | ||
} | ||
const { pdf, pages, info } = usePDF("document.pdf", { | ||
onPassword: onPassword, | ||
onProgress: onProgress, | ||
onError: onError | ||
const { pdf, pages, info } = usePDF('document.pdf', { | ||
onPassword, | ||
onProgress, | ||
onError | ||
}) | ||
@@ -266,10 +266,10 @@ ``` | ||
<template> | ||
<VuePDF :pdf="pdf" :page="2" ref="VPDF" /> | ||
<VuePDF ref="VPDF" :pdf="pdf" :page="2" /> | ||
</template> | ||
setup(){ | ||
setup(){ | ||
const VPDF = ref({}) | ||
return { | ||
VPDF, | ||
someEvent: () => { | ||
someEvent: () => { | ||
VPDF.value.reload() | ||
@@ -279,3 +279,2 @@ }, | ||
} | ||
``` | ||
@@ -291,3 +290,3 @@ | ||
<template> | ||
<VuePDF :pdf="pdf" :page="2" @loaded="loadedEvent" /> | ||
<VuePDF :pdf="pdf" :page="2" @loaded="loadedEvent" /> | ||
</template> | ||
@@ -298,3 +297,2 @@ | ||
}, | ||
``` | ||
@@ -306,4 +304,4 @@ | ||
```json | ||
{ | ||
"viewBox": [ 0, 0, 595.276, 841.89 ], | ||
{ | ||
"viewBox": [0, 0, 595.276, 841.89], | ||
"scale": 1, | ||
@@ -313,3 +311,3 @@ "rotation": 90, | ||
"offsetY": 0, | ||
"transform": [ 0, 1, 1, 0, 0, 0 ], | ||
"transform": [0, 1, 1, 0, 0, 0], | ||
"width": 841.89, | ||
@@ -327,3 +325,3 @@ "height": 595.276, | ||
<template> | ||
<VuePDF :pdf="pdf" :page="2" @annotation="annotationEvent" /> | ||
<VuePDF :pdf="pdf" :page="2" @annotation="annotationEvent" /> | ||
</template> | ||
@@ -350,3 +348,3 @@ | ||
"referencedPage": 3, | ||
"offset": { | ||
"offset": { | ||
"left": 82, | ||
@@ -441,3 +439,3 @@ "bottom": 716 | ||
"defaultValue": "Beer", | ||
"options": [ "Water", "Beer", "Wine", "Milk" ] | ||
"options": ["Water", "Beer", "Wine", "Milk"] | ||
} | ||
@@ -455,3 +453,3 @@ } | ||
"actions": { | ||
"Mouse Down": [ "Print()" ] | ||
"Mouse Down": ["Print()"] | ||
}, | ||
@@ -458,0 +456,0 @@ "reset": false |
Sorry, the diff of this file is not supported yet
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10628570
11
20
21868
1
444
1
Updatedpdfjs-dist@^2.16.105