@sv-print/plugin-api-image 0.2.2 → 0.2.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/dist/index.js +1 -1
- package/dist/index.mjs +115 -115
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var O=(i,e,x)=>new Promise((t,s)=>{var u=o=>{try{I(x.next(o))}catch(d){s(d)}},p=o=>{try{I(x.throw(o))}catch(d){s(d)}},I=o=>o.done?t(o.value):Promise.resolve(o.value).then(u,p);I((x=x.apply(i,e)).next())});const J=require("@zumer/snapdom");(function(i,e){const x=A,t=i();for(;;)try{if(-parseInt(x(216))/1*(-parseInt(x(183))/2)+parseInt(x(235))/3+parseInt(x(206))/4*(parseInt(x(207))/5)+-parseInt(x(247))/6+parseInt(x(221))/7+-parseInt(x(249))/8+-parseInt(x(218))/9===e)break;t.push(t.shift())}catch(s){t.push(t.shift())}})(q,753416);function q(){const i=["appendChild","toType","height","470AUvIIr","body","26055369RzhPas","getHtml","none","9280992Jexvrk","download","add","getContext","toBlob","display",".jpg","createElement","toDataURL","remove","position:fixed","indexOf","href","push","2164002XcdVeJ","Deferred","src","then","onProgress","setAttribute","image/jpeg","forEach","style","limit","dpr","getTempContainer","6514098cBdrfs","canvas","1889760vqAnjU","start","click","devicePixelRatio","imageSmoothingEnabled","url","find","6124dPWpoh","loadAllImages",".hiprint-printPanel .hiprint-printPaper","html","type","hinnn","css","extend","toImage percent: ","onload","isDownload","toImage 失败(可能您的图片资源无法正常加载): ","log","end","pixelRatio","cur","quality","removeTempContainer","length","clear","queue","createTempContainer","resolve","1187224bzROpF","25dVjjIT","replace","error","drawImage","width","clearRect"];return q=function(){return i},q()}function A(i,e){const x=q();return A=function(t,s){return t=t-183,x[t]},A(i,e)}const L=function(i,e){return O(this,null,function*(){const x=A;let t=this,s=globalThis.$[x(236)](),u=!0,p=10,I=(o,d)=>{const f=x,w=Math.floor(o/d*100);console[f(195)](f(198),o,"total",d),console[f(195)](f(191),w+"%")};if(this.printPanels.length){let o=globalThis.$[x(190)]({backgroundColor:"#fff"},e||{}),d=yield this[x(219)](i,e);e&&(e[x(197)]&&(o[x(245)]=e[x(197)]),e.isDownload!=null&&(u=e[x(193)]),e[x(239)]!=null&&(I=e[x(239)]),e[x(244)]!=null&&(p=e[x(244)])),globalThis.$(d)[x(189)]("width","")[x(189)](x(215),""),this[x(204)]();let f=this[x(246)]();this.svg2canvas(d,o),f[x(186)](d[0]);let w=f[x(255)](x(185))[x(201)];globalThis.$(d)[x(189)](x(231)),this[x(184)](f,function(){const a=x;try{let _=[],D=Math.ceil(w/p),S=w%p||1;const b=document.createElement(a(248)),V=b[a(224)]("2d"),z=f.find(".hiprint-printPanel").eq(0)[a(211)](),F=z*(o[a(245)]||globalThis[a(252)]);for(let v=0;v<D;v++){V[a(212)](0,0,b[a(211)],b[a(215)]);const C=v==D-1;let U=0,B=C?S:p;for(let g=0;g<B;g++){V[a(212)](0,0,b.width,b[a(215)]);const c=v*p+g,y=f[a(255)](a(185))[c];globalThis[a(188)].queue[a(223)](function(k){const T=a;J.snapdom.toCanvas(y,o)[T(238)](function(m){const r=T;let h=m[r(224)]("2d");h[r(253)]=!1;let P=m[r(229)](r(241),o[r(199)]||.92),n=new Image;n[r(237)]=P,n[r(192)]=function(){const l=r;g===0&&(b.width=F,b[l(215)]=n[l(215)]*B),U+=n[l(215)],V[l(210)](n,0,U-n[l(215)],F,n.height),I(c+1,w),k()}})})}globalThis[a(188)][a(203)][a(223)](function(g){const c=a;let y=o[c(187)]||c(241),k=o[c(214)]||c(254),T=o.quality||.8;if(u){let m=b[c(229)](y,T),r=new Image;r[c(237)]=m,r[c(192)]=function(){const h=c;_[h(234)]({url:m,start:v*p+1,end:v*p+B}),C&&(globalThis[h(188)][h(203)][h(202)](),t[h(200)](),_[h(242)](P=>{const n=h;let l=document[n(228)]("a"),j=e.name||"download.jpg";j[n(232)](".")==-1&&(j+=n(227));let $=j.split(".").pop(),H=j[n(208)]("."+$,"")+"_"+P[n(250)]+"-"+P[n(196)]+"."+$;l[n(243)][n(226)]=n(220),l[n(240)](n(222),H),l.setAttribute(n(233),P.url),document[n(217)][n(213)](l),l[n(251)](),l[n(230)]()})),g()};return}if(k==c(254)){_.push(b[c(229)](y,T)),C&&(globalThis[c(188)][c(203)].clear(),t[c(200)](),s.resolve(_)),g();return}k=="blob"&&b[c(225)](function(m){const r=c;_[r(234)](m),C&&(globalThis.hinnn[r(203)][r(202)](),t[r(200)](),s[r(205)](_)),g()},y,T)})}globalThis.hinnn[a(203)].run()}catch(_){console[a(209)](a(194)),console.log(_)}})}return s.promise()})};(function(i,e){for(var x=R,t=i();;)try{var s=-parseInt(x(336))/1+parseInt(x(337))/2+parseInt(x(348))/3+parseInt(x(342))/4*(-parseInt(x(339))/5)+parseInt(x(345))/6*(parseInt(x(341))/7)+-parseInt(x(343))/8+-parseInt(x(344))/9*(-parseInt(x(334))/10);if(s===e)break;t.push(t.shift())}catch(u){t.push(t.shift())}})(E,115347);function R(i,e){var x=E();return R=function(t,s){t=t-333;var u=x[t];return u},R(i,e)}function M(i){var e=R;return{name:e(338),description:"add toImage Api",hooks:[{hook:e(333),name:e(335),description:e(335),priority:1,run:({template:x,options:t})=>{var s=e;Object[s(347)](x,s(346),{value:L,enumerable:!1,writable:!0,configurable:!0})}}],leastHiprintVersion:e(340)}}function E(){var i=["241410CCiTBm","add toImage Api to PrintTemplate","52473TYFaEg","394780CpdQAL","add toImage Api","12635wFfRUS","0.3.0","8449wkFfiw","188KkVqIa","530224jbykon","9oPChTq","60NhVjtG","toImage","defineProperty","357798eZBmgS","newPrintTemplate"];return E=function(){return i},E()}module.exports=M;
|
package/dist/index.mjs
CHANGED
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var O = (i, e, x) => new Promise((t, s) => {
|
|
2
|
+
var u = (o) => {
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
} catch (
|
|
6
|
-
|
|
4
|
+
I(x.next(o));
|
|
5
|
+
} catch (d) {
|
|
6
|
+
s(d);
|
|
7
7
|
}
|
|
8
|
-
},
|
|
8
|
+
}, p = (o) => {
|
|
9
9
|
try {
|
|
10
|
-
|
|
11
|
-
} catch (
|
|
12
|
-
|
|
10
|
+
I(x.throw(o));
|
|
11
|
+
} catch (d) {
|
|
12
|
+
s(d);
|
|
13
13
|
}
|
|
14
|
-
},
|
|
15
|
-
|
|
14
|
+
}, I = (o) => o.done ? t(o.value) : Promise.resolve(o.value).then(u, p);
|
|
15
|
+
I((x = x.apply(i, e)).next());
|
|
16
16
|
});
|
|
17
|
-
import { snapdom as
|
|
18
|
-
function
|
|
19
|
-
const
|
|
20
|
-
return j = function() {
|
|
21
|
-
return r;
|
|
22
|
-
}, j();
|
|
23
|
-
}
|
|
24
|
-
function R(r, e) {
|
|
25
|
-
const x = j();
|
|
26
|
-
return R = function(n, i) {
|
|
27
|
-
return n = n - 381, x[n];
|
|
28
|
-
}, R(r, e);
|
|
29
|
-
}
|
|
30
|
-
(function(r, e) {
|
|
31
|
-
const x = R, n = r();
|
|
17
|
+
import { snapdom as J } from "@zumer/snapdom";
|
|
18
|
+
(function(i, e) {
|
|
19
|
+
const x = q, t = i();
|
|
32
20
|
for (; ; )
|
|
33
21
|
try {
|
|
34
|
-
if (-parseInt(x(
|
|
35
|
-
|
|
36
|
-
} catch (
|
|
37
|
-
|
|
22
|
+
if (-parseInt(x(216)) / 1 * (-parseInt(x(183)) / 2) + parseInt(x(235)) / 3 + parseInt(x(206)) / 4 * (parseInt(x(207)) / 5) + -parseInt(x(247)) / 6 + parseInt(x(221)) / 7 + -parseInt(x(249)) / 8 + -parseInt(x(218)) / 9 === e) break;
|
|
23
|
+
t.push(t.shift());
|
|
24
|
+
} catch (s) {
|
|
25
|
+
t.push(t.shift());
|
|
38
26
|
}
|
|
39
|
-
})(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
27
|
+
})(A, 753416);
|
|
28
|
+
function A() {
|
|
29
|
+
const i = ["appendChild", "toType", "height", "470AUvIIr", "body", "26055369RzhPas", "getHtml", "none", "9280992Jexvrk", "download", "add", "getContext", "toBlob", "display", ".jpg", "createElement", "toDataURL", "remove", "position:fixed", "indexOf", "href", "push", "2164002XcdVeJ", "Deferred", "src", "then", "onProgress", "setAttribute", "image/jpeg", "forEach", "style", "limit", "dpr", "getTempContainer", "6514098cBdrfs", "canvas", "1889760vqAnjU", "start", "click", "devicePixelRatio", "imageSmoothingEnabled", "url", "find", "6124dPWpoh", "loadAllImages", ".hiprint-printPanel .hiprint-printPaper", "html", "type", "hinnn", "css", "extend", "toImage percent: ", "onload", "isDownload", "toImage 失败(可能您的图片资源无法正常加载): ", "log", "end", "pixelRatio", "cur", "quality", "removeTempContainer", "length", "clear", "queue", "createTempContainer", "resolve", "1187224bzROpF", "25dVjjIT", "replace", "error", "drawImage", "width", "clearRect"];
|
|
30
|
+
return A = function() {
|
|
31
|
+
return i;
|
|
32
|
+
}, A();
|
|
33
|
+
}
|
|
34
|
+
function q(i, e) {
|
|
35
|
+
const x = A();
|
|
36
|
+
return q = function(t, s) {
|
|
37
|
+
return t = t - 183, x[t];
|
|
38
|
+
}, q(i, e);
|
|
39
|
+
}
|
|
40
|
+
const L = function(i, e) {
|
|
41
|
+
return O(this, null, function* () {
|
|
42
|
+
const x = q;
|
|
43
|
+
let t = this, s = globalThis.$[x(236)](), u = !0, p = 10, I = (o, d) => {
|
|
44
|
+
const f = x, w = Math.floor(o / d * 100);
|
|
45
|
+
console[f(195)](f(198), o, "total", d), console[f(195)](f(191), w + "%");
|
|
46
46
|
};
|
|
47
|
-
if (this
|
|
48
|
-
let o = globalThis
|
|
49
|
-
e && (e[x(
|
|
50
|
-
let
|
|
51
|
-
this
|
|
52
|
-
let w =
|
|
53
|
-
globalThis.$(
|
|
54
|
-
const
|
|
47
|
+
if (this.printPanels.length) {
|
|
48
|
+
let o = globalThis.$[x(190)]({ backgroundColor: "#fff" }, e || {}), d = yield this[x(219)](i, e);
|
|
49
|
+
e && (e[x(197)] && (o[x(245)] = e[x(197)]), e.isDownload != null && (u = e[x(193)]), e[x(239)] != null && (I = e[x(239)]), e[x(244)] != null && (p = e[x(244)])), globalThis.$(d)[x(189)]("width", "")[x(189)](x(215), ""), this[x(204)]();
|
|
50
|
+
let f = this[x(246)]();
|
|
51
|
+
this.svg2canvas(d, o), f[x(186)](d[0]);
|
|
52
|
+
let w = f[x(255)](x(185))[x(201)];
|
|
53
|
+
globalThis.$(d)[x(189)](x(231)), this[x(184)](f, function() {
|
|
54
|
+
const a = x;
|
|
55
55
|
try {
|
|
56
|
-
let
|
|
57
|
-
const
|
|
58
|
-
for (let
|
|
59
|
-
|
|
60
|
-
const C =
|
|
61
|
-
let
|
|
62
|
-
for (let
|
|
63
|
-
|
|
64
|
-
const c =
|
|
65
|
-
globalThis[
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
let
|
|
72
|
-
|
|
73
|
-
const l =
|
|
74
|
-
|
|
56
|
+
let _ = [], D = Math.ceil(w / p), S = w % p || 1;
|
|
57
|
+
const b = document.createElement(a(248)), V = b[a(224)]("2d"), z = f.find(".hiprint-printPanel").eq(0)[a(211)](), F = z * (o[a(245)] || globalThis[a(252)]);
|
|
58
|
+
for (let v = 0; v < D; v++) {
|
|
59
|
+
V[a(212)](0, 0, b[a(211)], b[a(215)]);
|
|
60
|
+
const C = v == D - 1;
|
|
61
|
+
let U = 0, B = C ? S : p;
|
|
62
|
+
for (let g = 0; g < B; g++) {
|
|
63
|
+
V[a(212)](0, 0, b.width, b[a(215)]);
|
|
64
|
+
const c = v * p + g, y = f[a(255)](a(185))[c];
|
|
65
|
+
globalThis[a(188)].queue[a(223)](function(k) {
|
|
66
|
+
const T = a;
|
|
67
|
+
J.toCanvas(y, o)[T(238)](function(m) {
|
|
68
|
+
const r = T;
|
|
69
|
+
let h = m[r(224)]("2d");
|
|
70
|
+
h[r(253)] = !1;
|
|
71
|
+
let P = m[r(229)](r(241), o[r(199)] || 0.92), n = new Image();
|
|
72
|
+
n[r(237)] = P, n[r(192)] = function() {
|
|
73
|
+
const l = r;
|
|
74
|
+
g === 0 && (b.width = F, b[l(215)] = n[l(215)] * B), U += n[l(215)], V[l(210)](n, 0, U - n[l(215)], F, n.height), I(c + 1, w), k();
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
}
|
|
79
|
-
globalThis[
|
|
80
|
-
const c =
|
|
81
|
-
let y = o[c(
|
|
82
|
-
if (
|
|
83
|
-
let m =
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
let l = document[
|
|
89
|
-
|
|
90
|
-
let
|
|
91
|
-
l[
|
|
92
|
-
})),
|
|
79
|
+
globalThis[a(188)][a(203)][a(223)](function(g) {
|
|
80
|
+
const c = a;
|
|
81
|
+
let y = o[c(187)] || c(241), k = o[c(214)] || c(254), T = o.quality || 0.8;
|
|
82
|
+
if (u) {
|
|
83
|
+
let m = b[c(229)](y, T), r = new Image();
|
|
84
|
+
r[c(237)] = m, r[c(192)] = function() {
|
|
85
|
+
const h = c;
|
|
86
|
+
_[h(234)]({ url: m, start: v * p + 1, end: v * p + B }), C && (globalThis[h(188)][h(203)][h(202)](), t[h(200)](), _[h(242)]((P) => {
|
|
87
|
+
const n = h;
|
|
88
|
+
let l = document[n(228)]("a"), j = e.name || "download.jpg";
|
|
89
|
+
j[n(232)](".") == -1 && (j += n(227));
|
|
90
|
+
let $ = j.split(".").pop(), H = j[n(208)]("." + $, "") + "_" + P[n(250)] + "-" + P[n(196)] + "." + $;
|
|
91
|
+
l[n(243)][n(226)] = n(220), l[n(240)](n(222), H), l.setAttribute(n(233), P.url), document[n(217)][n(213)](l), l[n(251)](), l[n(230)]();
|
|
92
|
+
})), g();
|
|
93
93
|
};
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
-
if (k == c(
|
|
97
|
-
|
|
96
|
+
if (k == c(254)) {
|
|
97
|
+
_.push(b[c(229)](y, T)), C && (globalThis[c(188)][c(203)].clear(), t[c(200)](), s.resolve(_)), g();
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
k == "blob" &&
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
}, y,
|
|
100
|
+
k == "blob" && b[c(225)](function(m) {
|
|
101
|
+
const r = c;
|
|
102
|
+
_[r(234)](m), C && (globalThis.hinnn[r(203)][r(202)](), t[r(200)](), s[r(205)](_)), g();
|
|
103
|
+
}, y, T);
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
globalThis[
|
|
107
|
-
} catch (
|
|
108
|
-
console
|
|
106
|
+
globalThis.hinnn[a(203)].run();
|
|
107
|
+
} catch (_) {
|
|
108
|
+
console[a(209)](a(194)), console.log(_);
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
-
return
|
|
112
|
+
return s.promise();
|
|
113
113
|
});
|
|
114
114
|
};
|
|
115
|
-
function
|
|
116
|
-
var
|
|
117
|
-
return E = function() {
|
|
118
|
-
return r;
|
|
119
|
-
}, E();
|
|
120
|
-
}
|
|
121
|
-
(function(r, e) {
|
|
122
|
-
for (var x = F, n = r(); ; )
|
|
115
|
+
(function(i, e) {
|
|
116
|
+
for (var x = R, t = i(); ; )
|
|
123
117
|
try {
|
|
124
|
-
var
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
} catch (
|
|
128
|
-
|
|
118
|
+
var s = -parseInt(x(336)) / 1 + parseInt(x(337)) / 2 + parseInt(x(348)) / 3 + parseInt(x(342)) / 4 * (-parseInt(x(339)) / 5) + parseInt(x(345)) / 6 * (parseInt(x(341)) / 7) + -parseInt(x(343)) / 8 + -parseInt(x(344)) / 9 * (-parseInt(x(334)) / 10);
|
|
119
|
+
if (s === e) break;
|
|
120
|
+
t.push(t.shift());
|
|
121
|
+
} catch (u) {
|
|
122
|
+
t.push(t.shift());
|
|
129
123
|
}
|
|
130
|
-
})(E,
|
|
131
|
-
function
|
|
124
|
+
})(E, 115347);
|
|
125
|
+
function R(i, e) {
|
|
132
126
|
var x = E();
|
|
133
|
-
return
|
|
134
|
-
|
|
135
|
-
var
|
|
136
|
-
return
|
|
137
|
-
},
|
|
127
|
+
return R = function(t, s) {
|
|
128
|
+
t = t - 333;
|
|
129
|
+
var u = x[t];
|
|
130
|
+
return u;
|
|
131
|
+
}, R(i, e);
|
|
132
|
+
}
|
|
133
|
+
function K(i) {
|
|
134
|
+
var e = R;
|
|
135
|
+
return { name: e(338), description: "add toImage Api", hooks: [{ hook: e(333), name: e(335), description: e(335), priority: 1, run: ({ template: x, options: t }) => {
|
|
136
|
+
var s = e;
|
|
137
|
+
Object[s(347)](x, s(346), { value: L, enumerable: !1, writable: !0, configurable: !0 });
|
|
138
|
+
} }], leastHiprintVersion: e(340) };
|
|
138
139
|
}
|
|
139
|
-
function
|
|
140
|
-
var
|
|
141
|
-
return
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
} }], leastHiprintVersion: e(484) };
|
|
140
|
+
function E() {
|
|
141
|
+
var i = ["241410CCiTBm", "add toImage Api to PrintTemplate", "52473TYFaEg", "394780CpdQAL", "add toImage Api", "12635wFfRUS", "0.3.0", "8449wkFfiw", "188KkVqIa", "530224jbykon", "9oPChTq", "60NhVjtG", "toImage", "defineProperty", "357798eZBmgS", "newPrintTemplate"];
|
|
142
|
+
return E = function() {
|
|
143
|
+
return i;
|
|
144
|
+
}, E();
|
|
145
145
|
}
|
|
146
146
|
export {
|
|
147
|
-
|
|
147
|
+
K as default
|
|
148
148
|
};
|
package/dist/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(f
|
|
1
|
+
(function(h,f){typeof exports=="object"&&typeof module!="undefined"?module.exports=f(require("@zumer/snapdom")):typeof define=="function"&&define.amd?define(["@zumer/snapdom"],f):(h=typeof globalThis!="undefined"?globalThis:h||self,h.pluginApiImage=f(h.window))})(this,function(h){"use strict";var H=(h,f,b)=>new Promise((V,g)=>{var z=x=>{try{o(b.next(x))}catch(e){g(e)}},w=x=>{try{o(b.throw(x))}catch(e){g(e)}},o=x=>x.done?V(x.value):Promise.resolve(x.value).then(z,w);o((b=b.apply(h,f)).next())});(function(o,x){const e=b,n=o();for(;;)try{if(-parseInt(e(216))/1*(-parseInt(e(183))/2)+parseInt(e(235))/3+parseInt(e(206))/4*(parseInt(e(207))/5)+-parseInt(e(247))/6+parseInt(e(221))/7+-parseInt(e(249))/8+-parseInt(e(218))/9===x)break;n.push(n.shift())}catch(r){n.push(n.shift())}})(f,753416);function f(){const o=["appendChild","toType","height","470AUvIIr","body","26055369RzhPas","getHtml","none","9280992Jexvrk","download","add","getContext","toBlob","display",".jpg","createElement","toDataURL","remove","position:fixed","indexOf","href","push","2164002XcdVeJ","Deferred","src","then","onProgress","setAttribute","image/jpeg","forEach","style","limit","dpr","getTempContainer","6514098cBdrfs","canvas","1889760vqAnjU","start","click","devicePixelRatio","imageSmoothingEnabled","url","find","6124dPWpoh","loadAllImages",".hiprint-printPanel .hiprint-printPaper","html","type","hinnn","css","extend","toImage percent: ","onload","isDownload","toImage 失败(可能您的图片资源无法正常加载): ","log","end","pixelRatio","cur","quality","removeTempContainer","length","clear","queue","createTempContainer","resolve","1187224bzROpF","25dVjjIT","replace","error","drawImage","width","clearRect"];return f=function(){return o},f()}function b(o,x){const e=f();return b=function(n,r){return n=n-183,e[n]},b(o,x)}const V=function(o,x){return H(this,null,function*(){const e=b;let n=this,r=globalThis.$[e(236)](),y=!0,I=10,F=(d,v)=>{const l=e,j=Math.floor(d/v*100);console[l(195)](l(198),d,"total",v),console[l(195)](l(191),j+"%")};if(this.printPanels.length){let d=globalThis.$[e(190)]({backgroundColor:"#fff"},x||{}),v=yield this[e(219)](o,x);x&&(x[e(197)]&&(d[e(245)]=x[e(197)]),x.isDownload!=null&&(y=x[e(193)]),x[e(239)]!=null&&(F=x[e(239)]),x[e(244)]!=null&&(I=x[e(244)])),globalThis.$(v)[e(189)]("width","")[e(189)](e(215),""),this[e(204)]();let l=this[e(246)]();this.svg2canvas(v,d),l[e(186)](v[0]);let j=l[e(255)](e(185))[e(201)];globalThis.$(v)[e(189)](e(231)),this[e(184)](l,function(){const a=e;try{let _=[],U=Math.ceil(j/I),J=j%I||1;const p=document.createElement(a(248)),B=p[a(224)]("2d"),L=l.find(".hiprint-printPanel").eq(0)[a(211)](),$=L*(d[a(245)]||globalThis[a(252)]);for(let P=0;P<U;P++){B[a(212)](0,0,p[a(211)],p[a(215)]);const q=P==U-1;let O=0,D=q?J:I;for(let m=0;m<D;m++){B[a(212)](0,0,p.width,p[a(215)]);const i=P*I+m,k=l[a(255)](a(185))[i];globalThis[a(188)].queue[a(223)](function(R){const C=a;h.snapdom.toCanvas(k,d)[C(238)](function(T){const c=C;let u=T[c(224)]("2d");u[c(253)]=!1;let A=T[c(229)](c(241),d[c(199)]||.92),t=new Image;t[c(237)]=A,t[c(192)]=function(){const s=c;m===0&&(p.width=$,p[s(215)]=t[s(215)]*D),O+=t[s(215)],B[s(210)](t,0,O-t[s(215)],$,t.height),F(i+1,j),R()}})})}globalThis[a(188)][a(203)][a(223)](function(m){const i=a;let k=d[i(187)]||i(241),R=d[i(214)]||i(254),C=d.quality||.8;if(y){let T=p[i(229)](k,C),c=new Image;c[i(237)]=T,c[i(192)]=function(){const u=i;_[u(234)]({url:T,start:P*I+1,end:P*I+D}),q&&(globalThis[u(188)][u(203)][u(202)](),n[u(200)](),_[u(242)](A=>{const t=u;let s=document[t(228)]("a"),E=x.name||"download.jpg";E[t(232)](".")==-1&&(E+=t(227));let S=E.split(".").pop(),M=E[t(208)]("."+S,"")+"_"+A[t(250)]+"-"+A[t(196)]+"."+S;s[t(243)][t(226)]=t(220),s[t(240)](t(222),M),s.setAttribute(t(233),A.url),document[t(217)][t(213)](s),s[t(251)](),s[t(230)]()})),m()};return}if(R==i(254)){_.push(p[i(229)](k,C)),q&&(globalThis[i(188)][i(203)].clear(),n[i(200)](),r.resolve(_)),m();return}R=="blob"&&p[i(225)](function(T){const c=i;_[c(234)](T),q&&(globalThis.hinnn[c(203)][c(202)](),n[c(200)](),r[c(205)](_)),m()},k,C)})}globalThis.hinnn[a(203)].run()}catch(_){console[a(209)](a(194)),console.log(_)}})}return r.promise()})};(function(o,x){for(var e=g,n=o();;)try{var r=-parseInt(e(336))/1+parseInt(e(337))/2+parseInt(e(348))/3+parseInt(e(342))/4*(-parseInt(e(339))/5)+parseInt(e(345))/6*(parseInt(e(341))/7)+-parseInt(e(343))/8+-parseInt(e(344))/9*(-parseInt(e(334))/10);if(r===x)break;n.push(n.shift())}catch(y){n.push(n.shift())}})(w,115347);function g(o,x){var e=w();return g=function(n,r){n=n-333;var y=e[n];return y},g(o,x)}function z(o){var x=g;return{name:x(338),description:"add toImage Api",hooks:[{hook:x(333),name:x(335),description:x(335),priority:1,run:({template:e,options:n})=>{var r=x;Object[r(347)](e,r(346),{value:V,enumerable:!1,writable:!0,configurable:!0})}}],leastHiprintVersion:x(340)}}function w(){var o=["241410CCiTBm","add toImage Api to PrintTemplate","52473TYFaEg","394780CpdQAL","add toImage Api","12635wFfRUS","0.3.0","8449wkFfiw","188KkVqIa","530224jbykon","9oPChTq","60NhVjtG","toImage","defineProperty","357798eZBmgS","newPrintTemplate"];return w=function(){return o},w()}return z});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sv-print/plugin-api-image",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "add image api to print template",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"author": "",
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@zumer/snapdom": "^2.0.1"
|
|
36
|
-
"sv-print": "^0.2.0"
|
|
35
|
+
"@zumer/snapdom": "^2.0.1"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
38
|
+
"sv-print": "^0.2.0",
|
|
39
39
|
"vite-plugin-javascript-obfuscator": "^3.1.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|