@univerjs-pro/print 0.4.2 → 0.5.0-nightly.202411091605
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/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/types/index.d.ts +63 -1
- package/lib/umd/index.js +1 -1
- package/package.json +9 -9
- package/lib/types/common/constant.d.ts +0 -10
- package/lib/types/common/index.d.ts +0 -3
- package/lib/types/common/types.d.ts +0 -41
- package/lib/types/common/util.d.ts +0 -2
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';function _0x4353(){const _0x18eca8=['className','Portrait','createElement','FitWidth','PrintPaperSize','Module','Letter','PrintDirection','3119280sCWYrh','Start','Narrow','printing-canvas','FitHeight','PRINT_CONTAINER_CLASS','1275176dxWGxW','\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20page-break-after:\x20always!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20height:\x20','Legal','Folio','PRINT_CANVAS_CLASS','Origin','PrintPaperMargin','1407484vttXZq','32NipyvW','Normal','PrintAlign','4917339lydflv','px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20}\x0a}','None','Statement','Wide','Tabloid','FitPage','\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20display:\x20block!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20height:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20visible;\x0a\x20\x20\x20\x20\x20\x20\x20\x20top:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.','px;\x20\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20visibility:\x20hidden;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20body\x20>\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20display:\x20none!important;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.','3iTXlCs',',\x20.','262058cGQiLR','Custom','4200072UsFvMa','PrintScale','PaperMarginMap','Landscape','toStringTag','Executive','End','109299mRXMnK','px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20','Middle','printing-canvas-container','innerHTML'];_0x4353=function(){return _0x18eca8;};return _0x4353();}const _0x31437b=_0x2863;(function(_0x451656,_0x25955a){const _0x566a5a=_0x2863,_0x50fcaa=_0x451656();while(!![]){try{const _0xb8fa1f=parseInt(_0x566a5a(0x1cd))/0x1+-parseInt(_0x566a5a(0x1f6))/0x2+parseInt(_0x566a5a(0x1f4))/0x3*(parseInt(_0x566a5a(0x1e7))/0x4)+parseInt(_0x566a5a(0x1da))/0x5+parseInt(_0x566a5a(0x1f8))/0x6+parseInt(_0x566a5a(0x1e0))/0x7*(-parseInt(_0x566a5a(0x1e8))/0x8)+-parseInt(_0x566a5a(0x1eb))/0x9;if(_0xb8fa1f===_0x25955a)break;else _0x50fcaa['push'](_0x50fcaa['shift']());}catch(_0x3d4004){_0x50fcaa['push'](_0x50fcaa['shift']());}}}(_0x4353,0x5c856));function _0x2863(_0xeb4c6a,_0x826fdf){const _0x4353a1=_0x4353();return _0x2863=function(_0x28637b,_0x21f7e8){_0x28637b=_0x28637b-0x1c9;let _0x72b844=_0x4353a1[_0x28637b];return _0x72b844;},_0x2863(_0xeb4c6a,_0x826fdf);}Object['defineProperty'](exports,Symbol[_0x31437b(0x1ca)],{'value':_0x31437b(0x1d7)});var e=(_0x4a1eeb=>(_0x4a1eeb[_0x31437b(0x1d8)]=_0x31437b(0x1d8),_0x4a1eeb[_0x31437b(0x1f0)]=_0x31437b(0x1f0),_0x4a1eeb[_0x31437b(0x1e2)]=_0x31437b(0x1e2),_0x4a1eeb['Statement']=_0x31437b(0x1ee),_0x4a1eeb[_0x31437b(0x1cb)]=_0x31437b(0x1cb),_0x4a1eeb[_0x31437b(0x1e3)]=_0x31437b(0x1e3),_0x4a1eeb['A3']='A3',_0x4a1eeb['A4']='A4',_0x4a1eeb['A5']='A5',_0x4a1eeb['B4']='B4',_0x4a1eeb['B5']='B5',_0x4a1eeb))(e||{}),i=(_0x20d86f=>(_0x20d86f[_0x31437b(0x1d3)]=_0x31437b(0x1d3),_0x20d86f[_0x31437b(0x1c9)]='Landscape',_0x20d86f))(i||{}),c=(_0x3aa690=>(_0x3aa690['Origin']=_0x31437b(0x1e5),_0x3aa690['FitWidth']=_0x31437b(0x1d5),_0x3aa690[_0x31437b(0x1de)]=_0x31437b(0x1de),_0x3aa690['FitPage']=_0x31437b(0x1f1),_0x3aa690[_0x31437b(0x1f7)]=_0x31437b(0x1f7),_0x3aa690))(c||{}),g=(_0x2220ea=>(_0x2220ea[_0x31437b(0x1db)]=_0x31437b(0x1db),_0x2220ea[_0x31437b(0x1cc)]=_0x31437b(0x1cc),_0x2220ea[_0x31437b(0x1cf)]=_0x31437b(0x1cf),_0x2220ea))(g||{}),o=(_0x5e9dcd=>(_0x5e9dcd[_0x31437b(0x1e9)]='Normal',_0x5e9dcd[_0x31437b(0x1dc)]=_0x31437b(0x1dc),_0x5e9dcd[_0x31437b(0x1ef)]=_0x31437b(0x1ef),_0x5e9dcd['None']=_0x31437b(0x1ed),_0x5e9dcd))(o||{});const m={[e['A3']]:{'w':0x463,'h':0x633},[e['A4']]:{'w':0x31a,'h':0x464},[e['A5']]:{'w':0x22f,'h':0x31a},[e['B4']]:{'w':0x3b0,'h':0x540},[e['B5']]:{'w':0x299,'h':0x3b0},[e[_0x31437b(0x1cb)]]:{'w':0x2b8,'h':0x3f0},[e['Folio']]:{'w':0x330,'h':0x4e0},[e[_0x31437b(0x1e2)]]:{'w':0x330,'h':0x540},[e[_0x31437b(0x1d8)]]:{'w':0x330,'h':0x420},[e['Statement']]:{'w':0x210,'h':0x330},[e[_0x31437b(0x1f0)]]:{'w':0x420,'h':0x660}},N={[o[_0x31437b(0x1e9)]]:{'left':0x35,'right':0x35,'top':0x38,'bottom':0x38},[o['Narrow']]:{'left':0x13,'right':0x13,'top':0x38,'bottom':0x38},[o[_0x31437b(0x1ef)]]:{'left':0x4b,'right':0x4b,'top':0x4b,'bottom':0x4b},[o['None']]:{'left':0x0,'right':0x0,'top':0x0,'bottom':0x0}},n=_0x31437b(0x1d0),p=_0x31437b(0x1dd);function A(_0x325993,_0x5c5c7d){const _0x3817fa=_0x31437b,{w:_0x2b0b6d,h:_0x3ff603}=m[_0x325993],_0x1d1d04=_0x5c5c7d===i[_0x3817fa(0x1d3)]?_0x2b0b6d:_0x3ff603,_0x3ce905=_0x5c5c7d===i[_0x3817fa(0x1d3)]?_0x3ff603:_0x2b0b6d,_0x3c0f29='\x0a@media\x20print\x20{\x0a\x20\x20\x20\x20html\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20body\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20auto\x20!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20size:\x20'+_0x1d1d04+'px\x20'+_0x3ce905+_0x3817fa(0x1f3)+n+_0x3817fa(0x1f5)+n+_0x3817fa(0x1f2)+p+_0x3817fa(0x1e1)+_0x3ce905+_0x3817fa(0x1ce)+_0x1d1d04+_0x3817fa(0x1ec),_0x38dd06=document[_0x3817fa(0x1d4)]('style');return _0x38dd06[_0x3817fa(0x1d1)]=_0x3c0f29,_0x38dd06[_0x3817fa(0x1d2)]='offline-printing-css',_0x38dd06;}exports[_0x31437b(0x1e4)]=p,exports[_0x31437b(0x1df)]=n,exports[_0x31437b(0x1fa)]=N,exports['PaperSizePxMap']=m,exports[_0x31437b(0x1ea)]=g,exports[_0x31437b(0x1d9)]=i,exports[_0x31437b(0x1e6)]=o,exports[_0x31437b(0x1d6)]=e,exports[_0x31437b(0x1f9)]=c,exports['createPrintStyle']=A;
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0xa4e671=_0x1cd4;function _0x110f(){const _0x45b9f0=['Portrait','585048ZYDmQI','1073262BYJLuC','91792LcYECD','Custom','printing-canvas','style','7rjfyaT','Tabloid','className','FitPage','innerHTML','px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20','Statement','\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20page-break-after:\x20always!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20height:\x20','Legal','Executive','Wide','offline-printing-css','px\x20','Folio','Start','Normal','198640FrfDcP','Landscape','px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20}\x0a}','Letter','Middle','FitWidth','\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20display:\x20block!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20height:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20visible;\x0a\x20\x20\x20\x20\x20\x20\x20\x20top:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.','64fLOZLP','26193wKzjbS','Narrow','None','printing-canvas-container','px;\x20\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20visibility:\x20hidden;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20body\x20>\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20display:\x20none!important;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.','24sNVmUG','520038RuvPGF','Origin','4796800zhjrJQ','\x0a@media\x20print\x20{\x0a\x20\x20\x20\x20html\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20body\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20auto\x20!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20size:\x20','End',',\x20.'];_0x110f=function(){return _0x45b9f0;};return _0x110f();}(function(_0x43e273,_0x2e134b){const _0x17bbda=_0x1cd4,_0x2877b8=_0x43e273();while(!![]){try{const _0x363605=-parseInt(_0x17bbda(0xc2))/0x1+parseInt(_0x17bbda(0xdd))/0x2*(-parseInt(_0x17bbda(0xde))/0x3)+parseInt(_0x17bbda(0xc0))/0x4+-parseInt(_0x17bbda(0xd6))/0x5+-parseInt(_0x17bbda(0xc1))/0x6*(-parseInt(_0x17bbda(0xc6))/0x7)+parseInt(_0x17bbda(0xb8))/0x8*(-parseInt(_0x17bbda(0xb9))/0x9)+parseInt(_0x17bbda(0xbb))/0xa;if(_0x363605===_0x2e134b)break;else _0x2877b8['push'](_0x2877b8['shift']());}catch(_0x48d824){_0x2877b8['push'](_0x2877b8['shift']());}}}(_0x110f,0x35d91));var o=(_0x1b6e90=>(_0x1b6e90[_0xa4e671(0xd9)]=_0xa4e671(0xd9),_0x1b6e90['Tabloid']=_0xa4e671(0xc7),_0x1b6e90[_0xa4e671(0xce)]=_0xa4e671(0xce),_0x1b6e90[_0xa4e671(0xcc)]=_0xa4e671(0xcc),_0x1b6e90['Executive']=_0xa4e671(0xcf),_0x1b6e90['Folio']=_0xa4e671(0xd3),_0x1b6e90['A3']='A3',_0x1b6e90['A4']='A4',_0x1b6e90['A5']='A5',_0x1b6e90['B4']='B4',_0x1b6e90['B5']='B5',_0x1b6e90))(o||{}),i=(_0x3e2ca2=>(_0x3e2ca2['Portrait']='Portrait',_0x3e2ca2[_0xa4e671(0xd7)]='Landscape',_0x3e2ca2))(i||{}),w=(_0x59ca49=>(_0x59ca49[_0xa4e671(0xba)]=_0xa4e671(0xba),_0x59ca49[_0xa4e671(0xdb)]='FitWidth',_0x59ca49['FitHeight']='FitHeight',_0x59ca49['FitPage']=_0xa4e671(0xc9),_0x59ca49[_0xa4e671(0xc3)]=_0xa4e671(0xc3),_0x59ca49))(w||{}),m=(_0x16e932=>(_0x16e932[_0xa4e671(0xd4)]='Start',_0x16e932[_0xa4e671(0xbd)]='End',_0x16e932['Middle']=_0xa4e671(0xda),_0x16e932))(m||{}),e=(_0x34295c=>(_0x34295c[_0xa4e671(0xd5)]=_0xa4e671(0xd5),_0x34295c['Narrow']=_0xa4e671(0xb4),_0x34295c[_0xa4e671(0xd0)]='Wide',_0x34295c[_0xa4e671(0xb5)]=_0xa4e671(0xb5),_0x34295c))(e||{});const g={[o['A3']]:{'w':0x463,'h':0x633},[o['A4']]:{'w':0x31a,'h':0x464},[o['A5']]:{'w':0x22f,'h':0x31a},[o['B4']]:{'w':0x3b0,'h':0x540},[o['B5']]:{'w':0x299,'h':0x3b0},[o['Executive']]:{'w':0x2b8,'h':0x3f0},[o[_0xa4e671(0xd3)]]:{'w':0x330,'h':0x4e0},[o['Legal']]:{'w':0x330,'h':0x540},[o[_0xa4e671(0xd9)]]:{'w':0x330,'h':0x420},[o[_0xa4e671(0xcc)]]:{'w':0x210,'h':0x330},[o[_0xa4e671(0xc7)]]:{'w':0x420,'h':0x660}},v={[e[_0xa4e671(0xd5)]]:{'left':0x35,'right':0x35,'top':0x38,'bottom':0x38},[e[_0xa4e671(0xb4)]]:{'left':0x13,'right':0x13,'top':0x38,'bottom':0x38},[e[_0xa4e671(0xd0)]]:{'left':0x4b,'right':0x4b,'top':0x4b,'bottom':0x4b},[e[_0xa4e671(0xb5)]]:{'left':0x0,'right':0x0,'top':0x0,'bottom':0x0}},l=_0xa4e671(0xb6),p=_0xa4e671(0xc4);function _0x1cd4(_0x1fad40,_0x13a1bd){const _0x110fb5=_0x110f();return _0x1cd4=function(_0x1cd42d,_0x556f3d){_0x1cd42d=_0x1cd42d-0xb4;let _0x173d34=_0x110fb5[_0x1cd42d];return _0x173d34;},_0x1cd4(_0x1fad40,_0x13a1bd);}function N(_0x1a9ef8,_0x434659){const _0x301d15=_0xa4e671,{w:_0x29db41,h:_0x2f0e58}=g[_0x1a9ef8],_0x57c5bf=_0x434659===i[_0x301d15(0xbf)]?_0x29db41:_0x2f0e58,_0x2f1cc6=_0x434659===i[_0x301d15(0xbf)]?_0x2f0e58:_0x29db41,_0x243710=_0x301d15(0xbc)+_0x57c5bf+_0x301d15(0xd2)+_0x2f1cc6+_0x301d15(0xb7)+l+_0x301d15(0xbe)+l+_0x301d15(0xdc)+p+_0x301d15(0xcd)+_0x2f1cc6+_0x301d15(0xcb)+_0x57c5bf+_0x301d15(0xd8),_0x293278=document['createElement'](_0x301d15(0xc5));return _0x293278[_0x301d15(0xca)]=_0x243710,_0x293278[_0x301d15(0xc8)]=_0x301d15(0xd1),_0x293278;}export{p as PRINT_CANVAS_CLASS,l as PRINT_CONTAINER_CLASS,v as PaperMarginMap,g as PaperSizePxMap,m as PrintAlign,i as PrintDirection,e as PrintPaperMargin,o as PrintPaperSize,w as PrintScale,N as createPrintStyle};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1 +1,63 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function createPrintStyle(paperSize: PrintPaperSize, direction: PrintDirection): HTMLStyleElement;
|
|
2
|
+
|
|
3
|
+
declare interface IPaperSize {
|
|
4
|
+
w: number;
|
|
5
|
+
h: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export declare interface IPrintMargin {
|
|
9
|
+
top: number;
|
|
10
|
+
left: number;
|
|
11
|
+
right: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export declare const PaperMarginMap: Record<PrintPaperMargin, IPrintMargin>;
|
|
16
|
+
|
|
17
|
+
export declare const PaperSizePxMap: Record<PrintPaperSize, IPaperSize>;
|
|
18
|
+
|
|
19
|
+
export declare const PRINT_CANVAS_CLASS = "printing-canvas";
|
|
20
|
+
|
|
21
|
+
export declare const PRINT_CONTAINER_CLASS = "printing-canvas-container";
|
|
22
|
+
|
|
23
|
+
export declare enum PrintAlign {
|
|
24
|
+
Start = "Start",
|
|
25
|
+
End = "End",
|
|
26
|
+
Middle = "Middle"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export declare enum PrintDirection {
|
|
30
|
+
Portrait = "Portrait",
|
|
31
|
+
Landscape = "Landscape"
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export declare enum PrintPaperMargin {
|
|
35
|
+
Normal = "Normal",
|
|
36
|
+
Narrow = "Narrow",
|
|
37
|
+
Wide = "Wide",
|
|
38
|
+
None = "None"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export declare enum PrintPaperSize {
|
|
42
|
+
Letter = "Letter",
|
|
43
|
+
Tabloid = "Tabloid",
|
|
44
|
+
Legal = "Legal",
|
|
45
|
+
Statement = "Statement",
|
|
46
|
+
Executive = "Executive",
|
|
47
|
+
Folio = "Folio",
|
|
48
|
+
A3 = "A3",
|
|
49
|
+
A4 = "A4",
|
|
50
|
+
A5 = "A5",
|
|
51
|
+
B4 = "B4",
|
|
52
|
+
B5 = "B5"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export declare enum PrintScale {
|
|
56
|
+
Origin = "Origin",
|
|
57
|
+
FitWidth = "FitWidth",
|
|
58
|
+
FitHeight = "FitHeight",
|
|
59
|
+
FitPage = "FitPage",
|
|
60
|
+
Custom = "Custom"
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { }
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xfa10d1,_0xd5de62){const _0x205972=_0x1ac5,_0x125f95=_0xfa10d1();while(!![]){try{const _0x5f3810=parseInt(_0x205972(0x10b))/0x1*(-parseInt(_0x205972(0x102))/0x2)+-parseInt(_0x205972(0x103))/0x3+parseInt(_0x205972(0x11c))/0x4*(-parseInt(_0x205972(0xf8))/0x5)+parseInt(_0x205972(0x112))/0x6*(-parseInt(_0x205972(0x10a))/0x7)+parseInt(_0x205972(0xf7))/0x8+-parseInt(_0x205972(0x100))/0x9+parseInt(_0x205972(0x110))/0xa;if(_0x5f3810===_0xd5de62)break;else _0x125f95['push'](_0x125f95['shift']());}catch(_0x4b5cea){_0x125f95['push'](_0x125f95['shift']());}}}(_0x36bc,0x27af5),function(_0x1783b5,_0x21aa97){const _0x444d73=_0x1ac5;typeof exports==_0x444d73(0x11d)&&typeof module<'u'?_0x21aa97(exports):typeof define=='function'&&define[_0x444d73(0x108)]?define([_0x444d73(0x118)],_0x21aa97):(_0x1783b5=typeof globalThis<'u'?globalThis:_0x1783b5||self,_0x21aa97(_0x1783b5[_0x444d73(0xf9)]={}));}(this,function(_0x5d3050){'use strict';const _0x5d1c6a=_0x1ac5;var _0x2807d1=(_0xfcd3e0=>(_0xfcd3e0[_0x5d1c6a(0x116)]='Letter',_0xfcd3e0['Tabloid']=_0x5d1c6a(0xfc),_0xfcd3e0[_0x5d1c6a(0xef)]='Legal',_0xfcd3e0[_0x5d1c6a(0xed)]=_0x5d1c6a(0xed),_0xfcd3e0[_0x5d1c6a(0xe7)]=_0x5d1c6a(0xe7),_0xfcd3e0[_0x5d1c6a(0xea)]=_0x5d1c6a(0xea),_0xfcd3e0['A3']='A3',_0xfcd3e0['A4']='A4',_0xfcd3e0['A5']='A5',_0xfcd3e0['B4']='B4',_0xfcd3e0['B5']='B5',_0xfcd3e0))(_0x2807d1||{}),_0xb0b3e9=(_0x214746=>(_0x214746[_0x5d1c6a(0x10d)]=_0x5d1c6a(0x10d),_0x214746[_0x5d1c6a(0xe9)]=_0x5d1c6a(0xe9),_0x214746))(_0xb0b3e9||{}),_0x349f6a=(_0x3f929e=>(_0x3f929e[_0x5d1c6a(0xfa)]=_0x5d1c6a(0xfa),_0x3f929e[_0x5d1c6a(0x114)]=_0x5d1c6a(0x114),_0x3f929e[_0x5d1c6a(0x106)]=_0x5d1c6a(0x106),_0x3f929e[_0x5d1c6a(0xfd)]=_0x5d1c6a(0xfd),_0x3f929e[_0x5d1c6a(0xee)]=_0x5d1c6a(0xee),_0x3f929e))(_0x349f6a||{}),_0x2318a9=(_0x9f072e=>(_0x9f072e[_0x5d1c6a(0x105)]='Start',_0x9f072e['End']=_0x5d1c6a(0xf4),_0x9f072e['Middle']=_0x5d1c6a(0x10f),_0x9f072e))(_0x2318a9||{}),_0x2acc4f=(_0x5d0140=>(_0x5d0140[_0x5d1c6a(0xf1)]=_0x5d1c6a(0xf1),_0x5d0140['Narrow']=_0x5d1c6a(0x104),_0x5d0140[_0x5d1c6a(0x115)]=_0x5d1c6a(0x115),_0x5d0140[_0x5d1c6a(0xf0)]='None',_0x5d0140))(_0x2acc4f||{});const _0x363e58={[_0x2807d1['A3']]:{'w':0x463,'h':0x633},[_0x2807d1['A4']]:{'w':0x31a,'h':0x464},[_0x2807d1['A5']]:{'w':0x22f,'h':0x31a},[_0x2807d1['B4']]:{'w':0x3b0,'h':0x540},[_0x2807d1['B5']]:{'w':0x299,'h':0x3b0},[_0x2807d1[_0x5d1c6a(0xe7)]]:{'w':0x2b8,'h':0x3f0},[_0x2807d1['Folio']]:{'w':0x330,'h':0x4e0},[_0x2807d1[_0x5d1c6a(0xef)]]:{'w':0x330,'h':0x540},[_0x2807d1[_0x5d1c6a(0x116)]]:{'w':0x330,'h':0x420},[_0x2807d1[_0x5d1c6a(0xed)]]:{'w':0x210,'h':0x330},[_0x2807d1['Tabloid']]:{'w':0x420,'h':0x660}},_0x1aed8b={[_0x2acc4f[_0x5d1c6a(0xf1)]]:{'left':0x35,'right':0x35,'top':0x38,'bottom':0x38},[_0x2acc4f[_0x5d1c6a(0x104)]]:{'left':0x13,'right':0x13,'top':0x38,'bottom':0x38},[_0x2acc4f[_0x5d1c6a(0x115)]]:{'left':0x4b,'right':0x4b,'top':0x4b,'bottom':0x4b},[_0x2acc4f[_0x5d1c6a(0xf0)]]:{'left':0x0,'right':0x0,'top':0x0,'bottom':0x0}},_0x505e18=_0x5d1c6a(0x117),_0x536b52=_0x5d1c6a(0xeb);function _0x3fc0d4(_0xe1d5fb,_0x17061a){const _0x297992=_0x5d1c6a,{w:_0x5b9bf9,h:_0x54978b}=_0x363e58[_0xe1d5fb],_0x3662df=_0x17061a===_0xb0b3e9['Portrait']?_0x5b9bf9:_0x54978b,_0x4120a0=_0x17061a===_0xb0b3e9[_0x297992(0x10d)]?_0x54978b:_0x5b9bf9,_0xd00899=_0x297992(0xfb)+_0x3662df+_0x297992(0x11a)+_0x4120a0+_0x297992(0xf2)+_0x505e18+_0x297992(0xe8)+_0x505e18+'\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20display:\x20block!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20height:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20visible;\x0a\x20\x20\x20\x20\x20\x20\x20\x20top:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.'+_0x536b52+_0x297992(0x10c)+_0x4120a0+_0x297992(0xf5)+_0x3662df+_0x297992(0x107),_0x338d93=document[_0x297992(0xec)]('style');return _0x338d93[_0x297992(0x11e)]=_0xd00899,_0x338d93[_0x297992(0xff)]='offline-printing-css',_0x338d93;}_0x5d3050[_0x5d1c6a(0x119)]=_0x536b52,_0x5d3050['PRINT_CONTAINER_CLASS']=_0x505e18,_0x5d3050[_0x5d1c6a(0x10e)]=_0x1aed8b,_0x5d3050[_0x5d1c6a(0xf6)]=_0x363e58,_0x5d3050[_0x5d1c6a(0x113)]=_0x2318a9,_0x5d3050[_0x5d1c6a(0x11b)]=_0xb0b3e9,_0x5d3050[_0x5d1c6a(0x101)]=_0x2acc4f,_0x5d3050[_0x5d1c6a(0xfe)]=_0x2807d1,_0x5d3050['PrintScale']=_0x349f6a,_0x5d3050[_0x5d1c6a(0x111)]=_0x3fc0d4,Object['defineProperty'](_0x5d3050,Symbol[_0x5d1c6a(0x109)],{'value':_0x5d1c6a(0xf3)});}));function _0x1ac5(_0x15768d,_0x1de49f){const _0x36bcbe=_0x36bc();return _0x1ac5=function(_0x1ac5cd,_0xed20e8){_0x1ac5cd=_0x1ac5cd-0xe7;let _0x1950be=_0x36bcbe[_0x1ac5cd];return _0x1950be;},_0x1ac5(_0x15768d,_0x1de49f);}function _0x36bc(){const _0x2c6b57=['Module','End','px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20','PaperSizePxMap','1308224PKslKk','5XPvoGW','UniverPrint','Origin','\x0a@media\x20print\x20{\x0a\x20\x20\x20\x20html\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20body\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20auto\x20!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20size:\x20','Tabloid','FitPage','PrintPaperSize','className','2605293gOsMjo','PrintPaperMargin','79022LCySvU','968043IoDzSc','Narrow','Start','FitHeight','px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20}\x0a}','amd','toStringTag','229173yaWCKJ','5jxnOuX','\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20page-break-after:\x20always!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20height:\x20','Portrait','PaperMarginMap','Middle','13637140fTRYSB','createPrintStyle','54JVYQKG','PrintAlign','FitWidth','Wide','Letter','printing-canvas-container','exports','PRINT_CANVAS_CLASS','px\x20','PrintDirection','1041316ehVZVI','object','innerHTML','Executive',',\x20.','Landscape','Folio','printing-canvas','createElement','Statement','Custom','Legal','None','Normal','px;\x20\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20visibility:\x20hidden;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20body\x20>\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20display:\x20none!important;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20.'];_0x36bc=function(){return _0x2c6b57;};return _0x36bc();}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/print",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-nightly.202411091605",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Print module for UniverJS",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -30,8 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"./lib/*": "./lib/*"
|
|
32
32
|
},
|
|
33
|
-
"main": "./lib/
|
|
34
|
-
"module": "./lib/es/index.js",
|
|
33
|
+
"main": "./lib/es/index.js",
|
|
35
34
|
"types": "./lib/types/index.d.ts",
|
|
36
35
|
"publishConfig": {
|
|
37
36
|
"access": "public"
|
|
@@ -44,11 +43,11 @@
|
|
|
44
43
|
],
|
|
45
44
|
"devDependencies": {
|
|
46
45
|
"typescript": "5.6.3",
|
|
47
|
-
"vite": "^5.4.
|
|
48
|
-
"vitest": "^2.1.
|
|
49
|
-
"@univerjs-infra/shared": "0.
|
|
46
|
+
"vite": "^5.4.10",
|
|
47
|
+
"vitest": "^2.1.4",
|
|
48
|
+
"@univerjs-infra/shared": "0.5.0-alpha.0"
|
|
50
49
|
},
|
|
51
|
-
"
|
|
50
|
+
"space": {
|
|
52
51
|
".": {
|
|
53
52
|
"import": "./lib/es/index.js",
|
|
54
53
|
"require": "./lib/cjs/index.js",
|
|
@@ -66,6 +65,7 @@
|
|
|
66
65
|
"test:watch": "vitest",
|
|
67
66
|
"coverage": "vitest run --coverage",
|
|
68
67
|
"lint:types": "tsc --noEmit",
|
|
69
|
-
"build": "
|
|
70
|
-
}
|
|
68
|
+
"build": "tsx build.ts"
|
|
69
|
+
},
|
|
70
|
+
"module": "./lib/es/index.js"
|
|
71
71
|
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PrintPaperMargin, PrintPaperSize, IPrintMargin } from './types';
|
|
2
|
-
interface IPaperSize {
|
|
3
|
-
w: number;
|
|
4
|
-
h: number;
|
|
5
|
-
}
|
|
6
|
-
export declare const PaperSizePxMap: Record<PrintPaperSize, IPaperSize>;
|
|
7
|
-
export declare const PaperMarginMap: Record<PrintPaperMargin, IPrintMargin>;
|
|
8
|
-
export declare const PRINT_CONTAINER_CLASS = "printing-canvas-container";
|
|
9
|
-
export declare const PRINT_CANVAS_CLASS = "printing-canvas";
|
|
10
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export declare enum PrintPaperSize {
|
|
2
|
-
Letter = "Letter",
|
|
3
|
-
Tabloid = "Tabloid",
|
|
4
|
-
Legal = "Legal",
|
|
5
|
-
Statement = "Statement",
|
|
6
|
-
Executive = "Executive",
|
|
7
|
-
Folio = "Folio",
|
|
8
|
-
A3 = "A3",
|
|
9
|
-
A4 = "A4",
|
|
10
|
-
A5 = "A5",
|
|
11
|
-
B4 = "B4",
|
|
12
|
-
B5 = "B5"
|
|
13
|
-
}
|
|
14
|
-
export declare enum PrintDirection {
|
|
15
|
-
Portrait = "Portrait",
|
|
16
|
-
Landscape = "Landscape"
|
|
17
|
-
}
|
|
18
|
-
export declare enum PrintScale {
|
|
19
|
-
Origin = "Origin",
|
|
20
|
-
FitWidth = "FitWidth",
|
|
21
|
-
FitHeight = "FitHeight",
|
|
22
|
-
FitPage = "FitPage",
|
|
23
|
-
Custom = "Custom"
|
|
24
|
-
}
|
|
25
|
-
export declare enum PrintAlign {
|
|
26
|
-
Start = "Start",
|
|
27
|
-
End = "End",
|
|
28
|
-
Middle = "Middle"
|
|
29
|
-
}
|
|
30
|
-
export declare enum PrintPaperMargin {
|
|
31
|
-
Normal = "Normal",
|
|
32
|
-
Narrow = "Narrow",
|
|
33
|
-
Wide = "Wide",
|
|
34
|
-
None = "None"
|
|
35
|
-
}
|
|
36
|
-
export interface IPrintMargin {
|
|
37
|
-
top: number;
|
|
38
|
-
left: number;
|
|
39
|
-
right: number;
|
|
40
|
-
bottom: number;
|
|
41
|
-
}
|