@tato30/vue-pdf
Advanced tools
Comparing version 1.1.0-beta.0 to 1.1.0
@@ -196,7 +196,7 @@ 'use strict'; | ||
// Clear all childnodes of layer elements | ||
TextlayerREF.value.replaceChildren(); | ||
AnnotationlayerRef.value.replaceChildren(); | ||
TextlayerREF.value.replaceChildren?.(); | ||
AnnotationlayerRef.value.replaceChildren?.(); | ||
// Clear event listeners of annotation layer | ||
AnnotationlayerRef.value.removeEventListener('click', annotationEventsHandler); | ||
AnnotationlayerRef.value.removeEventListener('mouseover', annotationEventsHandler); | ||
AnnotationlayerRef.value.removeEventListener?.('click', annotationEventsHandler); | ||
AnnotationlayerRef.value.removeEventListener?.('mouseover', annotationEventsHandler); | ||
}; | ||
@@ -239,4 +239,3 @@ | ||
// When scale change rework render task | ||
if (TextLayerLoaded && AnnotationLayerLoaded) | ||
clearLayers(); | ||
clearLayers(); | ||
renderPage(props.page); | ||
@@ -247,4 +246,3 @@ }); | ||
// When page change rework render task | ||
if (TextLayerLoaded && AnnotationLayerLoaded) | ||
clearLayers(); | ||
clearLayers(); | ||
renderPage(page); | ||
@@ -275,3 +273,2 @@ }); | ||
const _hoisted_3 = { | ||
key: 0, | ||
ref: "AnnotationlayerRef", | ||
@@ -282,3 +279,2 @@ class: "annotationLayer", | ||
const _hoisted_4 = { | ||
key: 1, | ||
ref: "TextlayerREF", | ||
@@ -292,8 +288,8 @@ class: "textLayer", | ||
vue.createElementVNode("canvas", _hoisted_2, null, 512 /* NEED_PATCH */), | ||
(_ctx.annotationLayer) | ||
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, null, 512 /* NEED_PATCH */)) | ||
: vue.createCommentVNode("v-if", true), | ||
(_ctx.textLayer) | ||
? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, null, 512 /* NEED_PATCH */)) | ||
: vue.createCommentVNode("v-if", true) | ||
vue.withDirectives(vue.createElementVNode("div", _hoisted_3, null, 512 /* NEED_PATCH */), [ | ||
[vue.vShow, _ctx.annotationLayer] | ||
]), | ||
vue.withDirectives(vue.createElementVNode("div", _hoisted_4, null, 512 /* NEED_PATCH */), [ | ||
[vue.vShow, _ctx.textLayer] | ||
]) | ||
])) | ||
@@ -344,3 +340,2 @@ } | ||
return { | ||
@@ -347,0 +342,0 @@ pdf, |
import * as PDFJSLib from 'pdfjs-dist/build/pdf'; | ||
import { SimpleLinkService } from 'pdfjs-dist/web/pdf_viewer'; | ||
import 'pdfjs-dist/web/pdf_viewer.css'; | ||
import { ref, watch, onMounted, openBlock, createElementBlock, createElementVNode, createCommentVNode } from 'vue'; | ||
import { ref, watch, onMounted, openBlock, createElementBlock, createElementVNode, withDirectives, vShow } from 'vue'; | ||
import PDFJSWorker from 'pdfjs-dist/build/pdf.worker.entry'; | ||
@@ -169,7 +169,7 @@ | ||
// Clear all childnodes of layer elements | ||
TextlayerREF.value.replaceChildren(); | ||
AnnotationlayerRef.value.replaceChildren(); | ||
TextlayerREF.value.replaceChildren?.(); | ||
AnnotationlayerRef.value.replaceChildren?.(); | ||
// Clear event listeners of annotation layer | ||
AnnotationlayerRef.value.removeEventListener('click', annotationEventsHandler); | ||
AnnotationlayerRef.value.removeEventListener('mouseover', annotationEventsHandler); | ||
AnnotationlayerRef.value.removeEventListener?.('click', annotationEventsHandler); | ||
AnnotationlayerRef.value.removeEventListener?.('mouseover', annotationEventsHandler); | ||
}; | ||
@@ -212,4 +212,3 @@ | ||
// When scale change rework render task | ||
if (TextLayerLoaded && AnnotationLayerLoaded) | ||
clearLayers(); | ||
clearLayers(); | ||
renderPage(props.page); | ||
@@ -220,4 +219,3 @@ }); | ||
// When page change rework render task | ||
if (TextLayerLoaded && AnnotationLayerLoaded) | ||
clearLayers(); | ||
clearLayers(); | ||
renderPage(page); | ||
@@ -248,3 +246,2 @@ }); | ||
const _hoisted_3 = { | ||
key: 0, | ||
ref: "AnnotationlayerRef", | ||
@@ -255,3 +252,2 @@ class: "annotationLayer", | ||
const _hoisted_4 = { | ||
key: 1, | ||
ref: "TextlayerREF", | ||
@@ -265,8 +261,8 @@ class: "textLayer", | ||
createElementVNode("canvas", _hoisted_2, null, 512 /* NEED_PATCH */), | ||
(_ctx.annotationLayer) | ||
? (openBlock(), createElementBlock("div", _hoisted_3, null, 512 /* NEED_PATCH */)) | ||
: createCommentVNode("v-if", true), | ||
(_ctx.textLayer) | ||
? (openBlock(), createElementBlock("div", _hoisted_4, null, 512 /* NEED_PATCH */)) | ||
: createCommentVNode("v-if", true) | ||
withDirectives(createElementVNode("div", _hoisted_3, null, 512 /* NEED_PATCH */), [ | ||
[vShow, _ctx.annotationLayer] | ||
]), | ||
withDirectives(createElementVNode("div", _hoisted_4, null, 512 /* NEED_PATCH */), [ | ||
[vShow, _ctx.textLayer] | ||
]) | ||
])) | ||
@@ -317,3 +313,2 @@ } | ||
return { | ||
@@ -320,0 +315,0 @@ pdf, |
{ | ||
"name": "@tato30/vue-pdf", | ||
"description": "A vue 3 PDFJS wrapper", | ||
"version": "1.1.0-beta.0", | ||
"description": "PDF viewer for Vue 3", | ||
"version": "1.1.0", | ||
"license": "MIT", | ||
@@ -29,3 +29,5 @@ "main": "cjs/index.js", | ||
"preview": "vite preview --port 5050", | ||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore" | ||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore", | ||
"storybook": "start-storybook -p 6006", | ||
"build-storybook": "build-storybook" | ||
}, | ||
@@ -36,3 +38,3 @@ "dependencies": { | ||
"devDependencies": { | ||
"vue": "^3.2.33", | ||
"@babel/core": "^7.18.2", | ||
"@rushstack/eslint-patch": "^1.1.0", | ||
@@ -42,2 +44,3 @@ "@vitejs/plugin-vue": "^2.3.1", | ||
"@vue/eslint-config-prettier": "^7.0.0", | ||
"babel-loader": "^8.2.5", | ||
"eslint": "^8.16.0", | ||
@@ -50,3 +53,5 @@ "eslint-plugin-vue": "^8.2.0", | ||
"rollup-plugin-vue": "^6.0.0", | ||
"vite": "^2.9.5" | ||
"vite": "^2.9.5", | ||
"vue": "^3.2.33", | ||
"vue-loader": "^16.8.3" | ||
}, | ||
@@ -53,0 +58,0 @@ "peerDependencies": { |
@@ -0,0 +0,0 @@ # VuePDF |
@@ -45,3 +45,2 @@ import { ref } from "vue"; | ||
return { | ||
@@ -48,0 +47,0 @@ pdf, |
@@ -0,0 +0,0 @@ import { fileURLToPath, URL } from "url"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
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
0
38603
16
704