@file-viewer/vue3 3.0.2 → 3.0.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.
package/README.en.md CHANGED
@@ -49,8 +49,8 @@ Every standard component package shares `@file-viewer/core` as the only common f
49
49
 
50
50
  | Framework | Standard npm package | Entrypoints | GitHub | Gitee | Historical aliases |
51
51
  | --- | --- | --- | --- | --- | --- |
52
- | Vanilla JS / Pure Web | `@file-viewer/web` | ESM, type declarations, script tag IIFE | [file-viewer-web](https://github.com/flyfish-dev/file-viewer-web) | [file-viewer-web](https://gitee.com/flyfish-dev/file-viewer-web) | `@flyfish-group/file-viewer-web` |
53
- | Vanilla JS / Pure Web Full | `@file-viewer/web-full` | ESM, type declarations, script tag IIFE | [file-viewer-web-full](https://github.com/flyfish-dev/file-viewer-web-full) | [file-viewer-web-full](https://gitee.com/flyfish-dev/file-viewer-web-full) | none |
52
+ | Vanilla JS / Pure Web | `@file-viewer/web` | ESM, type declarations, script tag IIFE, RequireJS AMD | [file-viewer-web](https://github.com/flyfish-dev/file-viewer-web) | [file-viewer-web](https://gitee.com/flyfish-dev/file-viewer-web) | `@flyfish-group/file-viewer-web` |
53
+ | Vanilla JS / Pure Web Full | `@file-viewer/web-full` | ESM, type declarations, script tag IIFE, RequireJS AMD | [file-viewer-web-full](https://github.com/flyfish-dev/file-viewer-web-full) | [file-viewer-web-full](https://gitee.com/flyfish-dev/file-viewer-web-full) | none |
54
54
  | Vue 3 | `@file-viewer/vue3` | ESM, type declarations | [file-viewer-vue3](https://github.com/flyfish-dev/file-viewer-vue3) | [file-viewer-vue3](https://gitee.com/flyfish-dev/file-viewer-vue3) | `@flyfish-group/file-viewer3`, `file-viewer3` |
55
55
  | Vue 3 Full | `@file-viewer/vue3-full` | ESM, type declarations | [file-viewer-vue3-full](https://github.com/flyfish-dev/file-viewer-vue3-full) | [file-viewer-vue3-full](https://gitee.com/flyfish-dev/file-viewer-vue3-full) | none |
56
56
  | Vue 2.7 | `@file-viewer/vue2.7` | ESM, type declarations | [file-viewer-vue2.7](https://github.com/flyfish-dev/file-viewer-vue2.7) | [file-viewer-vue2.7](https://gitee.com/flyfish-dev/file-viewer-vue2.7) | `@flyfish-group/file-viewer` |
package/README.md CHANGED
@@ -52,8 +52,8 @@ English README: [README.en.md](./README.en.md)。
52
52
 
53
53
  | 框架 | 标准 npm 包 | 入口格式 | GitHub | Gitee | 兼容历史包 |
54
54
  | --- | --- | --- | --- | --- | --- |
55
- | Vanilla JS / Pure Web | `@file-viewer/web` | ESM, 类型声明, script 标签 IIFE | [file-viewer-web](https://github.com/flyfish-dev/file-viewer-web) | [file-viewer-web](https://gitee.com/flyfish-dev/file-viewer-web) | `@flyfish-group/file-viewer-web` |
56
- | Vanilla JS / Pure Web Full | `@file-viewer/web-full` | ESM, 类型声明, script 标签 IIFE | [file-viewer-web-full](https://github.com/flyfish-dev/file-viewer-web-full) | [file-viewer-web-full](https://gitee.com/flyfish-dev/file-viewer-web-full) | 无 |
55
+ | Vanilla JS / Pure Web | `@file-viewer/web` | ESM, 类型声明, script 标签 IIFE, RequireJS AMD | [file-viewer-web](https://github.com/flyfish-dev/file-viewer-web) | [file-viewer-web](https://gitee.com/flyfish-dev/file-viewer-web) | `@flyfish-group/file-viewer-web` |
56
+ | Vanilla JS / Pure Web Full | `@file-viewer/web-full` | ESM, 类型声明, script 标签 IIFE, RequireJS AMD | [file-viewer-web-full](https://github.com/flyfish-dev/file-viewer-web-full) | [file-viewer-web-full](https://gitee.com/flyfish-dev/file-viewer-web-full) | 无 |
57
57
  | Vue 3 | `@file-viewer/vue3` | ESM, 类型声明 | [file-viewer-vue3](https://github.com/flyfish-dev/file-viewer-vue3) | [file-viewer-vue3](https://gitee.com/flyfish-dev/file-viewer-vue3) | `@flyfish-group/file-viewer3`, `file-viewer3` |
58
58
  | Vue 3 Full | `@file-viewer/vue3-full` | ESM, 类型声明 | [file-viewer-vue3-full](https://github.com/flyfish-dev/file-viewer-vue3-full) | [file-viewer-vue3-full](https://gitee.com/flyfish-dev/file-viewer-vue3-full) | 无 |
59
59
  | Vue 2.7 | `@file-viewer/vue2.7` | ESM, 类型声明 | [file-viewer-vue2.7](https://github.com/flyfish-dev/file-viewer-vue2.7) | [file-viewer-vue2.7](https://gitee.com/flyfish-dev/file-viewer-vue2.7) | `@flyfish-group/file-viewer` |
@@ -1 +1,158 @@
1
- (function(j,k){const A=g,m=j();while(!![]){try{const p=-parseInt(A(0x1d4))/0x1+parseInt(A(0x1bb))/0x2+-parseInt(A(0x1d7))/0x3*(parseInt(A(0x1bf))/0x4)+-parseInt(A(0x1c2))/0x5*(parseInt(A(0x1d3))/0x6)+parseInt(A(0x1bd))/0x7*(parseInt(A(0x1d0))/0x8)+-parseInt(A(0x1d5))/0x9+-parseInt(A(0x1c5))/0xa*(-parseInt(A(0x1c4))/0xb);if(p===k)break;else m['push'](m['shift']());}catch(q){m['push'](m['shift']());}}}(b,0x974dc));function g(a,c){a=a-0x1b8;const d=b();let e=d[a];return e;}function b(){const Q=['8436501NVmMpH','match','1671qfRpSm','fromCharCode','data:','addEventListener','972074WeeaYM','toDataURL','7DXRVbR','error','524tobaeu','length','complete','2855xDadYg','Buffer','253pXjlAb','809710iCaBJY','querySelectorAll','bind','from','click','join','0\x20auto','map','remove','noopener','setTimeout','671720ESyEDG','apply','requestAnimationFrame','816DKTrmj','724583pLhiSb'];b=function(){return Q;};return b();}import{t as h}from'./asyncToGenerator.js';var t=(j,k)=>{let m=URL['createObjectURL'](j),p=document['createElement']('a');p['href']=m,p['download']=k,p['rel']='noopener',document['body']['appendChild'](p),p['click'](),p['remove'](),window['setTimeout'](()=>URL['revokeObjectURL'](m),0xfa0);},n=(j,k)=>{const B=g;let m=document['createElement']('a');m['href']=j,m['download']=k,m['rel']=B(0x1ce),m['target']='_blank',document['body']['appendChild'](m),m[B(0x1c9)](),m[B(0x1cd)]();},r=(j,k)=>{const C=g;let m=Array['from'](j['querySelectorAll']('canvas'));Array[C(0x1c8)](k['querySelectorAll']('canvas'))['forEach']((p,q)=>{const D=C;let v=m[q];if(v)try{let w=j['ownerDocument']['createElement']('img');w['src']=v[D(0x1bc)]('image/png'),w['alt']='rendered\x20canvas',w['style']['maxWidth']='100%',w['style']['display']='block',w['style']['margin']=D(0x1cb),p['replaceWith'](w);}catch(x){}});},i=j=>new Promise(k=>{const E=g;let m=j||globalThis['window'];if(!m||typeof m['requestAnimationFrame']!='function'){(m!=null&&m[E(0x1cf)]?m['setTimeout']['bind'](m):globalThis['setTimeout'][E(0x1c7)](globalThis))(()=>k(),0x0);return;}let p=m[E(0x1d2)]['bind'](m);p(()=>{p(()=>k());});}),a=(function(){var j=h(function*(k){const F=g;if(!k||typeof k[F(0x1c6)]!='function')return;let m=Array['from'](k['querySelectorAll']('img'));yield Promise['all'](m['map']((function(){var p=h(function*(q){if(!q['complete']){if('decode'in q)try{yield q['decode']();return;}catch(v){}yield new Promise(w=>{const G=g;q['addEventListener']('load',()=>w(),{'once':!0x0}),q['addEventListener'](G(0x1be),()=>w(),{'once':!0x0});});}});return function(q){return p['apply'](this,arguments);};}())));});return function(k){return j['apply'](this,arguments);};}()),o=(j,k)=>{const H=g;let m=k||'application/octet-stream',p=globalThis[H(0x1c3)];if(p)return H(0x1b9)+m+';base64,'+p['from'](j)['toString']('base64');let q='',v=new Uint8Array(j);for(let w=0x0;w<v['length'];w+=0x1)q+=String[H(0x1b8)](v[w]);return'data:'+m+';base64,'+btoa(q);},s=(function(){var j=h(function*(k){if(typeof FileReader=='function')try{return yield new Promise((m,p)=>{let q=new FileReader();q['onload']=()=>m(String(q['result']||'')),q['onerror']=()=>p(q['error']||Error('Failed\x20to\x20read\x20blob')),q['readAsDataURL'](k);});}catch(m){}return o(yield k['arrayBuffer'](),k['type']||'application/octet-stream');});return function(k){return j['apply'](this,arguments);};}()),c=j=>{const I=g;let k=j[I(0x1d6)](/blob:[^\s"'<>)\\]+/g)||[];return Array['from'](new Set(k));},l=(function(){var j=h(function*(k){const J=g;if(!k['includes']('blob:')||typeof fetch!='function')return k;let m=c(k);if(!m[J(0x1c0)])return k;let p=yield Promise['all'](m['map']((function(){var v=h(function*(w){try{let x=yield fetch(w);if(!x['ok'])return null;let y=yield s(yield x['blob']());return y?[w,y]:null;}catch(z){return null;}});return function(w){const K=g;return v[K(0x1d1)](this,arguments);};}()))),q=k;for(let v of p){if(!v)continue;let [w,x]=v;q=q['split'](w)[J(0x1ca)](x);}return q;});return function(k){return j['apply'](this,arguments);};}()),u=(function(){var j=h(function*(k){const L=g;let {document:m}=k;m['readyState']!==L(0x1c1)&&(yield new Promise(p=>{const M=L;k[M(0x1ba)]('load',()=>p(),{'once':!0x0}),k['setTimeout'](()=>p(),0x4b0);})),yield Promise['all'](Array['from'](m['images'])[L(0x1cc)]((function(){var p=h(function*(q){const N=g;if(!q[N(0x1c1)]){if('decode'in q)try{yield q['decode']();return;}catch(v){}yield new Promise(w=>{const O=N;q['addEventListener']('load',()=>w(),{'once':!0x0}),q[O(0x1ba)]('error',()=>w(),{'once':!0x0}),k['setTimeout'](()=>w(),0x5dc);});}});return function(q){const P=g;return p[P(0x1d1)](this,arguments);};}()))),yield new Promise(p=>{let q=!0x1,v,w=()=>{q||(q=!0x0,v!==void 0x0&&k['clearTimeout'](v),p());};v=k['setTimeout'](w,0xfa);try{k['requestAnimationFrame'](()=>{k['requestAnimationFrame'](w);});}catch(x){w();}});});return function(k){return j['apply'](this,arguments);};}()),d=(function(){var j=h(function*(k,m){return m['mode']!=='print'||!(k!=null&&k['printStyle'])?'':typeof k['printStyle']=='function'?yield k['printStyle'](m):k['printStyle'];});return function(k,m){return j['apply'](this,arguments);};}()),f=(function(){var j=h(function*(k,m){var p;yield(p=m==null?void 0x0:m['beforeSnapshot'])==null?void 0x0:p['call'](m),yield i(k['ownerDocument']['defaultView']||void 0x0),yield a(k);});return function(k,m){return j['apply'](this,arguments);};}());export{t as a,i as c,d as i,u as l,f as n,n as o,r,a as s,l as t};
1
+ import { r as e } from "./objectSpread2.js";
2
+ //#region ../../core/dist/output/export.js
3
+ var t = (e, t) => {
4
+ let n = URL.createObjectURL(e), r = document.createElement("a");
5
+ r.href = n, r.download = t, r.rel = "noopener", document.body.appendChild(r), r.click(), r.remove(), window.setTimeout(() => URL.revokeObjectURL(n), 4e3);
6
+ }, n = (e, t) => {
7
+ let n = document.createElement("a");
8
+ n.href = e, n.download = t, n.rel = "noopener", n.target = "_blank", document.body.appendChild(n), n.click(), n.remove();
9
+ }, r = (e, t) => {
10
+ let n = Array.from(e.querySelectorAll("canvas"));
11
+ Array.from(t.querySelectorAll("canvas")).forEach((t, r) => {
12
+ let i = n[r];
13
+ if (i) try {
14
+ let n = e.ownerDocument.createElement("img");
15
+ n.src = i.toDataURL("image/png"), n.alt = "rendered canvas", n.style.maxWidth = "100%", n.style.display = "block", n.style.margin = "0 auto", t.replaceWith(n);
16
+ } catch (e) {}
17
+ });
18
+ }, i = (e) => new Promise((t) => {
19
+ let n = e || globalThis.window;
20
+ if (!n || typeof n.requestAnimationFrame != "function") {
21
+ (n != null && n.setTimeout ? n.setTimeout.bind(n) : globalThis.setTimeout.bind(globalThis))(() => t(), 0);
22
+ return;
23
+ }
24
+ let r = n.requestAnimationFrame.bind(n);
25
+ r(() => {
26
+ r(() => t());
27
+ });
28
+ }), a = function() {
29
+ var t = e(function* (t) {
30
+ if (!t || typeof t.querySelectorAll != "function") return;
31
+ let n = Array.from(t.querySelectorAll("img"));
32
+ yield Promise.all(n.map(function() {
33
+ var t = e(function* (e) {
34
+ if (!e.complete) {
35
+ if ("decode" in e) try {
36
+ yield e.decode();
37
+ return;
38
+ } catch (e) {}
39
+ yield new Promise((t) => {
40
+ e.addEventListener("load", () => t(), { once: !0 }), e.addEventListener("error", () => t(), { once: !0 });
41
+ });
42
+ }
43
+ });
44
+ return function(e) {
45
+ return t.apply(this, arguments);
46
+ };
47
+ }()));
48
+ });
49
+ return function(e) {
50
+ return t.apply(this, arguments);
51
+ };
52
+ }(), o = (e, t) => {
53
+ let n = t || "application/octet-stream", r = globalThis.Buffer;
54
+ if (r) return `data:${n};base64,${r.from(e).toString("base64")}`;
55
+ let i = "", a = new Uint8Array(e);
56
+ for (let e = 0; e < a.length; e += 1) i += String.fromCharCode(a[e]);
57
+ return `data:${n};base64,${btoa(i)}`;
58
+ }, s = function() {
59
+ var t = e(function* (e) {
60
+ if (typeof FileReader == "function") try {
61
+ return yield new Promise((t, n) => {
62
+ let r = new FileReader();
63
+ r.onload = () => t(String(r.result || "")), r.onerror = () => n(r.error || /* @__PURE__ */ Error("Failed to read blob")), r.readAsDataURL(e);
64
+ });
65
+ } catch (e) {}
66
+ return o(yield e.arrayBuffer(), e.type || "application/octet-stream");
67
+ });
68
+ return function(e) {
69
+ return t.apply(this, arguments);
70
+ };
71
+ }(), c = (e) => {
72
+ let t = e.match(/blob:[^\s"'<>)\\]+/g) || [];
73
+ return Array.from(new Set(t));
74
+ }, l = function() {
75
+ var t = e(function* (t) {
76
+ if (!t.includes("blob:") || typeof fetch != "function") return t;
77
+ let n = c(t);
78
+ if (!n.length) return t;
79
+ let r = yield Promise.all(n.map(function() {
80
+ var t = e(function* (e) {
81
+ try {
82
+ let t = yield fetch(e);
83
+ if (!t.ok) return null;
84
+ let n = yield s(yield t.blob());
85
+ return n ? [e, n] : null;
86
+ } catch (e) {
87
+ return null;
88
+ }
89
+ });
90
+ return function(e) {
91
+ return t.apply(this, arguments);
92
+ };
93
+ }())), i = t;
94
+ for (let e of r) {
95
+ if (!e) continue;
96
+ let [t, n] = e;
97
+ i = i.split(t).join(n);
98
+ }
99
+ return i;
100
+ });
101
+ return function(e) {
102
+ return t.apply(this, arguments);
103
+ };
104
+ }(), u = function() {
105
+ var t = e(function* (t) {
106
+ let { document: n } = t;
107
+ n.readyState !== "complete" && (yield new Promise((e) => {
108
+ t.addEventListener("load", () => e(), { once: !0 }), t.setTimeout(() => e(), 1200);
109
+ })), yield Promise.all(Array.from(n.images).map(function() {
110
+ var n = e(function* (e) {
111
+ if (!e.complete) {
112
+ if ("decode" in e) try {
113
+ yield e.decode();
114
+ return;
115
+ } catch (e) {}
116
+ yield new Promise((n) => {
117
+ e.addEventListener("load", () => n(), { once: !0 }), e.addEventListener("error", () => n(), { once: !0 }), t.setTimeout(() => n(), 1500);
118
+ });
119
+ }
120
+ });
121
+ return function(e) {
122
+ return n.apply(this, arguments);
123
+ };
124
+ }())), yield new Promise((e) => {
125
+ let n = !1, r, i = () => {
126
+ n || (n = !0, r !== void 0 && t.clearTimeout(r), e());
127
+ };
128
+ r = t.setTimeout(i, 250);
129
+ try {
130
+ t.requestAnimationFrame(() => {
131
+ t.requestAnimationFrame(i);
132
+ });
133
+ } catch (e) {
134
+ i();
135
+ }
136
+ });
137
+ });
138
+ return function(e) {
139
+ return t.apply(this, arguments);
140
+ };
141
+ }(), d = function() {
142
+ var t = e(function* (e, t) {
143
+ return t.mode !== "print" || !(e != null && e.printStyle) ? "" : typeof e.printStyle == "function" ? yield e.printStyle(t) : e.printStyle;
144
+ });
145
+ return function(e, n) {
146
+ return t.apply(this, arguments);
147
+ };
148
+ }(), f = function() {
149
+ var t = e(function* (e, t) {
150
+ var n;
151
+ yield (n = t == null ? void 0 : t.beforeSnapshot) == null ? void 0 : n.call(t), yield i(e.ownerDocument.defaultView || void 0), yield a(e);
152
+ });
153
+ return function(e, n) {
154
+ return t.apply(this, arguments);
155
+ };
156
+ }();
157
+ //#endregion
158
+ export { t as a, i as c, d as i, u as l, f as n, n as o, r, a as s, l as t };