pdfjs-viewer-element 2.6.5 → 2.7.0
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.
- package/README.md +37 -18
- package/dist/pdfjs-viewer-element.js +96 -123
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -10,15 +10,22 @@ Supported in all [major browsers](https://caniuse.com/custom-elementsv1), and wo
|
|
|
10
10
|
See [demo pages](https://github.com/alekswebnet/pdfjs-viewer-element/tree/master/demo) for various usecases.
|
|
11
11
|
See [live examples](https://alekswebnet.github.io/pdfjs-viewer-element/#demo) of usage with frameworks.
|
|
12
12
|
|
|
13
|
+
# Features
|
|
14
|
+
|
|
15
|
+
- Simple PDF.js viewer integration to any web application
|
|
16
|
+
- PDF.js viewer options and parameters support, access to the viewer application instance
|
|
17
|
+
- Ability to customize viewer styles and themes
|
|
18
|
+
|
|
13
19
|
## How it works
|
|
14
20
|
|
|
15
|
-
**⚠️ This is an important part !!!**
|
|
21
|
+
**⚠️ This is an important part, please read this firstly !!!**
|
|
16
22
|
|
|
17
23
|
**You should download and place the PDF.js prebuilt files in the project.**
|
|
18
24
|
|
|
19
25
|
`pdfjs-viewer-element` requires PDF.js [prebuilt](http://mozilla.github.io/pdf.js/getting_started/), that includes the generic build of PDF.js and the viewer.
|
|
20
26
|
|
|
21
|
-
The prebuilt comes with each PDF.js release.
|
|
27
|
+
The prebuilt comes with each PDF.js release.
|
|
28
|
+
All v4 and v3 [releases](https://github.com/mozilla/pdf.js/releases) are supported.
|
|
22
29
|
|
|
23
30
|
Then specify the path to the directory with the `viewer-path` property (`/pdfjs` by default) and PDF file URL with `src` property (should refer to the [same origin](https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#can-i-load-a-pdf-from-another-server-cross-domain-request)).
|
|
24
31
|
|
|
@@ -64,7 +71,7 @@ Using browser:
|
|
|
64
71
|
## Usage
|
|
65
72
|
|
|
66
73
|
```html
|
|
67
|
-
<pdfjs-viewer-element src="/file.pdf" viewer-path="/pdfjs-4.
|
|
74
|
+
<pdfjs-viewer-element src="/file.pdf" viewer-path="/pdfjs-4.10.38-dist"></pdfjs-viewer-element>
|
|
68
75
|
```
|
|
69
76
|
|
|
70
77
|
## Attributes
|
|
@@ -73,27 +80,39 @@ Using browser:
|
|
|
73
80
|
|
|
74
81
|
`viewer-path` - Path to PDF.js [prebuilt](http://mozilla.github.io/pdf.js/getting_started/)
|
|
75
82
|
|
|
76
|
-
`
|
|
83
|
+
`page` - Page number.
|
|
84
|
+
|
|
85
|
+
`nameddest` - Go to a named destination.
|
|
86
|
+
|
|
87
|
+
`search` - Search text.
|
|
88
|
+
|
|
89
|
+
`phrase` - Search by phrase, `true` to enable.
|
|
90
|
+
|
|
91
|
+
`zoom` - Zoom level.
|
|
92
|
+
|
|
93
|
+
`pagemode` - Page mode, `thumbs | bookmarks | attachments | layers | none`.
|
|
94
|
+
|
|
95
|
+
`disable-worker` - Disables the worker, `true` to enable.
|
|
77
96
|
|
|
78
|
-
`text-layer` -
|
|
97
|
+
`text-layer` - Disables or reveals the text layer that is used for text selection, `off | visible | shadow | hover`.
|
|
79
98
|
|
|
80
|
-
`
|
|
99
|
+
`disable-font-face` - Disables standard `@font-face` font loading and uses the internal font renderer instead, `true` to enable.
|
|
81
100
|
|
|
82
|
-
`
|
|
101
|
+
`disable-range` - Disables HTTP range requests when fetching the document, `true` to enable.
|
|
83
102
|
|
|
84
|
-
`
|
|
103
|
+
`disable-stream` - Disables streaming when fetching the document, `true` to enable.
|
|
85
104
|
|
|
86
|
-
`
|
|
105
|
+
`disable-auto-fetch`- Disables auto fetching of the document; only gets necessary data to display the current view. Note: streaming also needs to be disabled for this to have any effect, `true` to enable.
|
|
87
106
|
|
|
88
|
-
`
|
|
107
|
+
`verbosity`- Specifies the verbosity level of console messages. `0` - only errors, `1` - warnings and errors, `5` - warnings, errors and information messages.
|
|
89
108
|
|
|
90
|
-
`
|
|
109
|
+
`locale` - Specifies which language to use in the viewer UI, `en-US | ...`. [Available locales](https://github.com/mozilla/pdf.js/tree/master/l10n)
|
|
91
110
|
|
|
92
|
-
`viewer-css-theme` - Apply automatic, light, or dark theme `AUTOMATIC | LIGHT | DARK`
|
|
111
|
+
`viewer-css-theme` - Apply automatic, light, or dark theme, `AUTOMATIC | LIGHT | DARK`
|
|
93
112
|
|
|
94
|
-
`viewer-extra-styles` - Add your CSS rules to the viewer application
|
|
113
|
+
`viewer-extra-styles` - Add your CSS rules to the viewer application, pass a string with styles.
|
|
95
114
|
|
|
96
|
-
`viewer-extra-styles-urls` - Add external CSS files to the viewer application
|
|
115
|
+
`viewer-extra-styles-urls` - Add external CSS files to the viewer application, pass an array with URLs.
|
|
97
116
|
|
|
98
117
|
Play with attributes on [Api docs page](https://alekswebnet.github.io/pdfjs-viewer-element/#api).
|
|
99
118
|
|
|
@@ -104,19 +123,19 @@ Use `viewer-css-theme` attribute to set light or dark theme manually:
|
|
|
104
123
|
```html
|
|
105
124
|
<pdfjs-viewer-element
|
|
106
125
|
src="/file.pdf"
|
|
107
|
-
viewer-path="/pdfjs-4.
|
|
126
|
+
viewer-path="/pdfjs-4.10.38-dist"
|
|
108
127
|
viewer-css-theme="DARK">
|
|
109
128
|
</pdfjs-viewer-element>
|
|
110
129
|
```
|
|
111
130
|
|
|
112
|
-
## Viewer
|
|
131
|
+
## Viewer custom styles
|
|
113
132
|
|
|
114
133
|
You can add your own CSS rules to the viewer application using `viewer-extra-styles` or `viewer-extra-styles-urls` attribute:
|
|
115
134
|
|
|
116
135
|
```html
|
|
117
136
|
<pdfjs-viewer-element
|
|
118
137
|
src="/file.pdf"
|
|
119
|
-
viewer-path="/pdfjs-4.
|
|
138
|
+
viewer-path="/pdfjs-4.10.38-dist"
|
|
120
139
|
viewer-extra-styles="#toolbarViewerMiddle { display: none; }"
|
|
121
140
|
viewer-extra-styles-urls="['/demo/viewer-custom-theme.css']">
|
|
122
141
|
</pdfjs-viewer-element>
|
|
@@ -149,7 +168,7 @@ Build your own theme with viewer's custom variables and `viewer-extra-styles-url
|
|
|
149
168
|
`initialize` - using this method you can access PDFViewerApplication and use methods and events of PDF.js default viewer
|
|
150
169
|
|
|
151
170
|
```html
|
|
152
|
-
<pdfjs-viewer-element viewer-path="/pdfjs-4.
|
|
171
|
+
<pdfjs-viewer-element viewer-path="/pdfjs-4.10.38-dist"></pdfjs-viewer-element>
|
|
153
172
|
```
|
|
154
173
|
|
|
155
174
|
```javascript
|
|
@@ -1,154 +1,127 @@
|
|
|
1
|
-
const
|
|
2
|
-
let
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
new MutationObserver((n, t) => {
|
|
8
|
-
Array.from(e.querySelectorAll(m)).forEach((i) => {
|
|
9
|
-
s(i), t.disconnect();
|
|
10
|
-
});
|
|
11
|
-
}).observe(e, {
|
|
12
|
-
childList: !0,
|
|
13
|
-
subtree: !0
|
|
14
|
-
});
|
|
15
|
-
}), g = {
|
|
16
|
-
trailing: !0
|
|
17
|
-
};
|
|
18
|
-
function v(m, e = 25, s = {}) {
|
|
19
|
-
if (s = { ...g, ...s }, !Number.isFinite(e))
|
|
20
|
-
throw new TypeError("Expected `wait` to be a finite number");
|
|
21
|
-
let r, n, t = [], i, a;
|
|
22
|
-
const o = (l, h) => (i = b(m, l, h), i.finally(() => {
|
|
23
|
-
if (i = null, s.trailing && a && !n) {
|
|
24
|
-
const u = o(l, a);
|
|
25
|
-
return a = null, u;
|
|
26
|
-
}
|
|
27
|
-
}), i);
|
|
28
|
-
return function(...l) {
|
|
29
|
-
return i ? (s.trailing && (a = l), i) : new Promise((h) => {
|
|
30
|
-
const u = !n && s.leading;
|
|
31
|
-
clearTimeout(n), n = setTimeout(() => {
|
|
32
|
-
n = null;
|
|
33
|
-
const d = s.leading ? r : o(this, l);
|
|
34
|
-
for (const y of t)
|
|
35
|
-
y(d);
|
|
36
|
-
t = [];
|
|
37
|
-
}, e), u ? (r = o(this, l), h(r)) : t.push(h);
|
|
1
|
+
const y = (p, t) => new Promise((o) => {
|
|
2
|
+
let s = t.querySelector(p);
|
|
3
|
+
s ? o(s) : new MutationObserver((r, e) => {
|
|
4
|
+
Array.from(t.querySelectorAll(p)).forEach((i) => {
|
|
5
|
+
o(i), e.disconnect();
|
|
38
6
|
});
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return await m.apply(e, s);
|
|
43
|
-
}
|
|
44
|
-
const c = {
|
|
45
|
-
viewerPath: "/pdfjs",
|
|
46
|
-
viewerEntry: "/web/viewer.html",
|
|
47
|
-
src: "",
|
|
48
|
-
page: "",
|
|
49
|
-
search: "",
|
|
50
|
-
phrase: "",
|
|
51
|
-
zoom: "",
|
|
52
|
-
pagemode: "none",
|
|
53
|
-
locale: "",
|
|
54
|
-
textLayer: "",
|
|
55
|
-
viewerCssTheme: "AUTOMATIC",
|
|
56
|
-
viewerExtraStyles: "",
|
|
57
|
-
viewerExtraStylesUrls: "",
|
|
58
|
-
nameddest: ""
|
|
59
|
-
}, w = {
|
|
60
|
-
AUTOMATIC: 0,
|
|
61
|
-
// Default value.
|
|
62
|
-
LIGHT: 1,
|
|
63
|
-
DARK: 2
|
|
64
|
-
}, A = ["src", "viewer-path", "locale", "text-layer", "viewer-css-theme", "viewer-extra-styles", "viewer-extra-styles-urls"];
|
|
65
|
-
class p extends HTMLElement {
|
|
7
|
+
}).observe(t, { childList: !0, subtree: !0 });
|
|
8
|
+
}), T = { trailing: !0 }, S = "/pdfjs", D = "/web/viewer.html", A = "", C = "", P = "", k = "", R = "", V = "none", F = "", O = "", L = "", I = "", j = "", q = "", M = "", W = "", v = "AUTOMATIC", $ = "", z = "", H = "", b = { AUTOMATIC: 0, LIGHT: 1, DARK: 2 }, N = ["src", "viewer-path", "disable-worker", "text-layer", "disable-font-face", "disable-range", "disable-stream", "disable-auto-fetch", "verbosity", "locale", "viewer-css-theme", "viewer-extra-styles", "viewer-extra-styles-urls"];
|
|
9
|
+
class x extends HTMLElement {
|
|
66
10
|
constructor() {
|
|
67
|
-
super(), this.onIframeReady =
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
11
|
+
super(), this.onIframeReady = function(s, r = 25, e = {}) {
|
|
12
|
+
if (e = { ...T, ...e }, !Number.isFinite(r))
|
|
13
|
+
throw new TypeError("Expected `wait` to be a finite number");
|
|
14
|
+
let i, n, a, l, h = [];
|
|
15
|
+
const f = (c, m) => (a = async function(d, u, w) {
|
|
16
|
+
return await d.apply(u, w);
|
|
17
|
+
}(s, c, m), a.finally(() => {
|
|
18
|
+
if (a = null, e.trailing && l && !n) {
|
|
19
|
+
const d = f(c, l);
|
|
20
|
+
return l = null, d;
|
|
21
|
+
}
|
|
22
|
+
}), a);
|
|
23
|
+
return function(...c) {
|
|
24
|
+
return a ? (e.trailing && (l = c), a) : new Promise((m) => {
|
|
25
|
+
const d = !n && e.leading;
|
|
26
|
+
clearTimeout(n), n = setTimeout(() => {
|
|
27
|
+
n = null;
|
|
28
|
+
const u = e.leading ? i : f(this, c);
|
|
29
|
+
for (const w of h)
|
|
30
|
+
w(u);
|
|
31
|
+
h = [];
|
|
32
|
+
}, r), d ? (i = f(this, c), m(i)) : h.push(m);
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
}(async (s) => {
|
|
36
|
+
await y("iframe", this.shadowRoot), s();
|
|
37
|
+
}, 0, { leading: !0 }), this.setViewerExtraStyles = (s, r = "extra") => {
|
|
38
|
+
var i, n, a, l, h;
|
|
39
|
+
if (!s)
|
|
40
|
+
return void ((n = (i = this.iframe.contentDocument) == null ? void 0 : i.head.querySelector(`style[${r}]`)) == null ? void 0 : n.remove());
|
|
41
|
+
if (((l = (a = this.iframe.contentDocument) == null ? void 0 : a.head.querySelector(`style[${r}]`)) == null ? void 0 : l.innerHTML) === s)
|
|
73
42
|
return;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
if (!r)
|
|
81
|
-
return;
|
|
82
|
-
r.replace(/'|]|\[/g, "").split(",").map((t) => t.trim()).forEach((t) => {
|
|
83
|
-
var o, l;
|
|
84
|
-
if ((o = this.iframe.contentDocument) == null ? void 0 : o.head.querySelector(`link[href="${t}"]`))
|
|
43
|
+
const e = document.createElement("style");
|
|
44
|
+
e.innerHTML = s, e.setAttribute(r, ""), (h = this.iframe.contentDocument) == null || h.head.appendChild(e);
|
|
45
|
+
}, this.injectExtraStylesLinks = (s) => {
|
|
46
|
+
s && s.replace(/'|]|\[/g, "").split(",").map((r) => r.trim()).forEach((r) => {
|
|
47
|
+
var n, a;
|
|
48
|
+
if ((n = this.iframe.contentDocument) == null ? void 0 : n.head.querySelector(`link[href="${r}"]`))
|
|
85
49
|
return;
|
|
86
|
-
const
|
|
87
|
-
|
|
50
|
+
const i = document.createElement("link");
|
|
51
|
+
i.rel = "stylesheet", i.href = r, (a = this.iframe.contentDocument) == null || a.head.appendChild(i);
|
|
88
52
|
});
|
|
89
|
-
}, this.initialize = () => new Promise(async (
|
|
90
|
-
var
|
|
91
|
-
await
|
|
92
|
-
var
|
|
93
|
-
await ((i = (
|
|
53
|
+
}, this.initialize = () => new Promise(async (s) => {
|
|
54
|
+
var r;
|
|
55
|
+
await y("iframe", this.shadowRoot), (r = this.iframe) == null || r.addEventListener("load", async () => {
|
|
56
|
+
var e, i, n;
|
|
57
|
+
await ((i = (e = this.iframe.contentWindow) == null ? void 0 : e.PDFViewerApplication) == null ? void 0 : i.initializedPromise), s((n = this.iframe.contentWindow) == null ? void 0 : n.PDFViewerApplication);
|
|
94
58
|
}, { once: !0 });
|
|
95
59
|
});
|
|
96
|
-
const
|
|
97
|
-
|
|
60
|
+
const t = this.attachShadow({ mode: "open" }), o = document.createElement("template");
|
|
61
|
+
o.innerHTML = `
|
|
98
62
|
<style>:host{width:100%;display:block;overflow:hidden}:host iframe{height:100%}</style>
|
|
99
63
|
<iframe frameborder="0" width="100%" loading="lazy"></iframe>
|
|
100
|
-
`,
|
|
64
|
+
`, t.appendChild(o.content.cloneNode(!0));
|
|
101
65
|
}
|
|
102
66
|
static get observedAttributes() {
|
|
103
|
-
return ["src", "viewer-path", "
|
|
67
|
+
return ["src", "viewer-path", "page", "search", "phrase", "zoom", "pagemode", "disable-worker", "text-layer", "disable-font-face", "disable-range", "disable-stream", "disable-auto-fetch", "verbosity", "locale", "viewer-css-theme", "viewer-extra-styles", "viewer-extra-styles-urls", "nameddest"];
|
|
104
68
|
}
|
|
105
69
|
connectedCallback() {
|
|
106
70
|
this.iframe = this.shadowRoot.querySelector("iframe"), document.addEventListener("webviewerloaded", async () => {
|
|
107
|
-
var
|
|
108
|
-
this.setCssTheme(this.getCssThemeOption()), this.injectExtraStylesLinks(this.getAttribute("viewer-extra-styles-urls") ??
|
|
71
|
+
var t, o, s, r, e, i, n, a;
|
|
72
|
+
this.setCssTheme(this.getCssThemeOption()), this.injectExtraStylesLinks(this.getAttribute("viewer-extra-styles-urls") ?? z), this.setViewerExtraStyles(this.getAttribute("viewer-extra-styles") ?? $), this.getAttribute("src") !== A && ((o = (t = this.iframe.contentWindow) == null ? void 0 : t.PDFViewerApplicationOptions) == null || o.set("defaultUrl", "")), (r = (s = this.iframe.contentWindow) == null ? void 0 : s.PDFViewerApplicationOptions) == null || r.set("disablePreferences", !0), (i = (e = this.iframe.contentWindow) == null ? void 0 : e.PDFViewerApplicationOptions) == null || i.set("pdfBugEnabled", !0), (a = (n = this.iframe.contentWindow) == null ? void 0 : n.PDFViewerApplicationOptions) == null || a.set("eventBusDispatchToDOM", !0);
|
|
109
73
|
});
|
|
110
74
|
}
|
|
111
|
-
attributeChangedCallback(
|
|
112
|
-
|
|
113
|
-
this.
|
|
114
|
-
|
|
115
|
-
});
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
this.onIframeReady(() => this.mountViewer(this.getIframeSrc()));
|
|
75
|
+
attributeChangedCallback(t) {
|
|
76
|
+
N.includes(t) ? this.onIframeReady(() => this.mountViewer(this.getIframeSrc())) : this.onIframeReady(() => {
|
|
77
|
+
this.iframe.src = this.getIframeSrc();
|
|
78
|
+
});
|
|
119
79
|
}
|
|
120
80
|
getIframeSrc() {
|
|
121
|
-
const
|
|
122
|
-
return
|
|
81
|
+
const t = this.getFullPath(this.getAttribute("src") || A), o = this.getFullPath(this.getAttribute("viewer-path") || S), s = this.getAttribute("page") || C, r = this.getAttribute("search") || P, e = this.getAttribute("phrase") || k, i = this.getAttribute("zoom") || R, n = this.getAttribute("pagemode") || V, a = this.getAttribute("disable-worker") || O, l = this.getAttribute("text-layer") || L, h = this.getAttribute("disable-font-face") || I, f = this.getAttribute("disable-range") || j, c = this.getAttribute("disable-stream") || q, m = this.getAttribute("disable-auto-fetch") || M, d = this.getAttribute("verbosity") || W, u = this.getAttribute("locale") || F, w = this.getAttribute("viewer-css-theme") || v, E = !!(this.getAttribute("viewer-extra-styles") || $), g = this.getAttribute("nameddest") || H;
|
|
82
|
+
return `
|
|
83
|
+
${o}${D}?file=
|
|
84
|
+
${encodeURIComponent(t)}#page=${s}&zoom=${i}&pagemode=${n}&search=${r}&phrase=${e}&textLayer=
|
|
85
|
+
${l}&disableWorker=
|
|
86
|
+
${a}&disableFontFace=
|
|
87
|
+
${h}&disableRange=
|
|
88
|
+
${f}&disableStream=
|
|
89
|
+
${c}&disableAutoFetch=
|
|
90
|
+
${m}&verbosity=
|
|
91
|
+
${d}
|
|
92
|
+
${u ? "&locale=" + u : ""}&viewerCssTheme=
|
|
93
|
+
${w}&viewerExtraStyles=
|
|
94
|
+
${E}
|
|
95
|
+
${g ? "&nameddest=" + g : ""}`;
|
|
123
96
|
}
|
|
124
|
-
mountViewer(
|
|
125
|
-
|
|
97
|
+
mountViewer(t) {
|
|
98
|
+
t && this.iframe && (this.shadowRoot.replaceChild(this.iframe.cloneNode(), this.iframe), this.iframe = this.shadowRoot.querySelector("iframe"), this.iframe.src = t);
|
|
126
99
|
}
|
|
127
|
-
getFullPath(
|
|
128
|
-
return
|
|
100
|
+
getFullPath(t) {
|
|
101
|
+
return t.startsWith("/") ? `${window.location.origin}${t}` : t;
|
|
129
102
|
}
|
|
130
103
|
getCssThemeOption() {
|
|
131
|
-
const
|
|
132
|
-
return Object.keys(
|
|
104
|
+
const t = this.getAttribute("viewer-css-theme");
|
|
105
|
+
return Object.keys(b).includes(t) ? b[t] : b[v];
|
|
133
106
|
}
|
|
134
|
-
setCssTheme(
|
|
135
|
-
var s, r
|
|
136
|
-
if (
|
|
137
|
-
const
|
|
107
|
+
setCssTheme(t) {
|
|
108
|
+
var o, s, r;
|
|
109
|
+
if (t === b.DARK) {
|
|
110
|
+
const e = (o = this.iframe.contentDocument) == null ? void 0 : o.styleSheets[0], i = (e == null ? void 0 : e.cssRules) || [], n = Object.keys(i).filter((a) => {
|
|
138
111
|
var l;
|
|
139
|
-
return ((l = i[Number(
|
|
140
|
-
}).map((
|
|
112
|
+
return ((l = i[Number(a)]) == null ? void 0 : l.conditionText) === "(prefers-color-scheme: dark)";
|
|
113
|
+
}).map((a) => i[Number(a)].cssText.split(`@media (prefers-color-scheme: dark) {
|
|
141
114
|
`)[1].split(`
|
|
142
115
|
}`)[0]);
|
|
143
|
-
this.setViewerExtraStyles(
|
|
116
|
+
this.setViewerExtraStyles(n.join(""), "theme");
|
|
144
117
|
} else
|
|
145
|
-
(
|
|
118
|
+
(r = (s = this.iframe.contentDocument) == null ? void 0 : s.head.querySelector("style[theme]")) == null || r.remove();
|
|
146
119
|
}
|
|
147
120
|
}
|
|
148
|
-
window.customElements.get("pdfjs-viewer-element") || (window.PdfjsViewerElement =
|
|
121
|
+
window.customElements.get("pdfjs-viewer-element") || (window.PdfjsViewerElement = x, window.customElements.define("pdfjs-viewer-element", x));
|
|
149
122
|
export {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
123
|
+
x as PdfjsViewerElement,
|
|
124
|
+
b as ViewerCssTheme,
|
|
125
|
+
x as default,
|
|
126
|
+
N as hardRefreshAttributes
|
|
154
127
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pdfjs-viewer-element",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Oleksandr Shevchuk",
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
"pdfjs",
|
|
12
12
|
"pdf viewer",
|
|
13
13
|
"pdfjs viewer",
|
|
14
|
-
"web component"
|
|
14
|
+
"web component",
|
|
15
|
+
"pdfjs viewer element",
|
|
16
|
+
"pdf"
|
|
15
17
|
],
|
|
16
18
|
"main": "./dist/pdfjs-viewer-element.js",
|
|
17
19
|
"module": "./dist/pdfjs-viewer-element.js",
|
|
@@ -31,15 +33,18 @@
|
|
|
31
33
|
],
|
|
32
34
|
"devDependencies": {
|
|
33
35
|
"@awlsn/pdfjs-full": "^4.2.392",
|
|
36
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
34
37
|
"@types/node": "^18.19.31",
|
|
35
38
|
"@vitest/browser": "^1.5.0",
|
|
36
39
|
"jsdom": "^22.1.0",
|
|
37
|
-
"perfect-debounce": "^1.0.0",
|
|
38
40
|
"typescript": "^4.9.5",
|
|
39
41
|
"vite": "^5.2.9",
|
|
40
42
|
"vitest": "^1.5.0",
|
|
41
43
|
"webdriverio": "^8.36.1"
|
|
42
44
|
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"perfect-debounce": "^1.0.0"
|
|
47
|
+
},
|
|
43
48
|
"scripts": {
|
|
44
49
|
"dev": "vite",
|
|
45
50
|
"build": "tsc && vite build",
|