@univerjs-pro/print 0.21.1 → 0.22.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 +26 -8
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/index.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +11 -5
package/README.md
CHANGED
|
@@ -1,16 +1,34 @@
|
|
|
1
1
|
# @univerjs-pro/print
|
|
2
2
|
|
|
3
|
-
[](https://npmjs.
|
|
4
|
-
[](https://npmjs.com/package/@univerjs-pro/print)
|
|
4
|
+
[](https://npmjs.com/package/@univerjs-pro/print)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
`@univerjs-pro/print` provides shared print utilities for Univer Pro.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
## Package Overview
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
| Package | UMD global | CSS | Locales | Facade entry |
|
|
11
|
+
| --- | --- | :---: | :---: | :---: |
|
|
12
|
+
| `@univerjs-pro/print` | `UniverProPrint` | No | No | No |
|
|
11
13
|
|
|
12
|
-
|
|
14
|
+
## Installation
|
|
13
15
|
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
+
```sh
|
|
17
|
+
pnpm add @univerjs-pro/print
|
|
18
|
+
# or
|
|
19
|
+
npm install @univerjs-pro/print
|
|
16
20
|
```
|
|
21
|
+
|
|
22
|
+
Keep all `@univerjs/*` and `@univerjs-pro/*` packages on the same version.
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import { createPrintStyle, PrintPaperMargin } from '@univerjs-pro/print';
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Resources
|
|
31
|
+
|
|
32
|
+
- [Documentation](https://docs.univer.ai/guides/pro)
|
|
33
|
+
- [NPM package](https://npmjs.com/package/@univerjs-pro/print)
|
|
34
|
+
|
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x59e9f5=_0x2cf7;(function(_0x298ed2,_0xc0a90a){const _0x14e899=_0x2cf7,_0x406fc6=_0x298ed2();while(!![]){try{const _0x3b3ca3=-parseInt(_0x14e899(0x149))/0x1*(parseInt(_0x14e899(0x158))/0x2)+parseInt(_0x14e899(0x13e))/0x3+parseInt(_0x14e899(0x164))/0x4+parseInt(_0x14e899(0x15d))/0x5*(-parseInt(_0x14e899(0x154))/0x6)+-parseInt(_0x14e899(0x150))/0x7*(-parseInt(_0x14e899(0x145))/0x8)+parseInt(_0x14e899(0x147))/0x9+-parseInt(_0x14e899(0x155))/0xa*(parseInt(_0x14e899(0x14b))/0xb);if(_0x3b3ca3===_0xc0a90a)break;else _0x406fc6['push'](_0x406fc6['shift']());}catch(_0xfbebc1){_0x406fc6['push'](_0x406fc6['shift']());}}}(_0x9b30,0x2636f),Object['defineProperty'](exports,Symbol['toStringTag'],{'value':'Module'}));function _0x9b30(){const _0x41baf8=['Middle','printing-canvas','\x0a\x20\x20\x20\x20.','12565exIMSm','None','FitPage','Custom','createElement','\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20page-break-after:\x20always!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20','End','117600eOXfRa','px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20','PrintAlign','px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}','834438ZxfwKq','PaperMarginMap','printing-canvas-container','PrintPaperMargin','offline-printing-css','\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20@media\x20print\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20html\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20body\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20auto\x20!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20size:\x20','px;\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20visibility:\x20hidden;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20body\x20>\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20none!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.','1147784BuANmU','Start','1462986LpxaPR','Wide','47254bWMhYJ','Origin','22LaJRzq','className','FitHeight','PrintScale','Narrow','7ryycOG','innerHTML','Normal','Portrait','96afKTAX','1847920LSFsRv','PRINT_CANVAS_CLASS',',\x20.','2TgXrRm','\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20block!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20visible;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20top:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.'];_0x9b30=function(){return _0x41baf8;};return _0x9b30();}function _0x2cf7(_0x459316,_0xe2fd20){_0x459316=_0x459316-0x13e;const _0x9b3044=_0x9b30();let _0x2cf725=_0x9b3044[_0x459316];return _0x2cf725;}let PrintDirection=function(_0x13375b){const _0x3d43d7=_0x2cf7;return _0x13375b[_0x3d43d7(0x153)]='Portrait',_0x13375b['Landscape']='Landscape',_0x13375b;}({}),PrintScale=function(_0x28fbe1){const _0x55d082=_0x2cf7;return _0x28fbe1[_0x55d082(0x14a)]='Origin',_0x28fbe1['FitWidth']='FitWidth',_0x28fbe1[_0x55d082(0x14d)]=_0x55d082(0x14d),_0x28fbe1[_0x55d082(0x15f)]='FitPage',_0x28fbe1[_0x55d082(0x160)]='Custom',_0x28fbe1;}({}),PrintAlign=function(_0x2b9fd9){const _0x16c50c=_0x2cf7;return _0x2b9fd9[_0x16c50c(0x146)]=_0x16c50c(0x146),_0x2b9fd9[_0x16c50c(0x163)]=_0x16c50c(0x163),_0x2b9fd9[_0x16c50c(0x15a)]=_0x16c50c(0x15a),_0x2b9fd9;}({}),PrintPaperMargin=function(_0x2ceb29){const _0x36802b=_0x2cf7;return _0x2ceb29[_0x36802b(0x152)]=_0x36802b(0x152),_0x2ceb29[_0x36802b(0x14f)]=_0x36802b(0x14f),_0x2ceb29[_0x36802b(0x148)]=_0x36802b(0x148),_0x2ceb29[_0x36802b(0x15e)]='None',_0x2ceb29[_0x36802b(0x160)]=_0x36802b(0x160),_0x2ceb29;}({});const PaperMarginMap={[_0x59e9f5(0x152)]:{'left':0x35,'right':0x35,'top':0x38,'bottom':0x38},[_0x59e9f5(0x14f)]:{'left':0x13,'right':0x13,'top':0x38,'bottom':0x38},['Wide']:{'left':0x4b,'right':0x4b,'top':0x4b,'bottom':0x4b},[_0x59e9f5(0x15e)]:{'left':0x0,'right':0x0,'top':0x0,'bottom':0x0},[_0x59e9f5(0x160)]:{'left':0x0,'right':0x0,'top':0x0,'bottom':0x0}},PRINT_CONTAINER_CLASS=_0x59e9f5(0x140),PRINT_CANVAS_CLASS=_0x59e9f5(0x15b);function createPrintStyle(_0x56feb3,_0x3918be,_0x3aea59){const _0x2e1b28=_0x59e9f5,_0x49a509=_0x3aea59==='Portrait'?_0x56feb3:_0x3918be,_0x5ed71c=_0x3aea59===_0x2e1b28(0x153)?_0x3918be:_0x56feb3,_0x4f3ec0=_0x2e1b28(0x15c)+PRINT_CANVAS_CLASS+_0x2e1b28(0x143)+_0x49a509+'px\x20'+_0x5ed71c+_0x2e1b28(0x144)+PRINT_CONTAINER_CLASS+_0x2e1b28(0x157)+PRINT_CONTAINER_CLASS+_0x2e1b28(0x159)+PRINT_CANVAS_CLASS+_0x2e1b28(0x162)+_0x5ed71c+_0x2e1b28(0x165)+_0x49a509+_0x2e1b28(0x167),_0x14ca7b=document[_0x2e1b28(0x161)]('style');return _0x14ca7b[_0x2e1b28(0x151)]=_0x4f3ec0,_0x14ca7b[_0x2e1b28(0x14c)]=_0x2e1b28(0x142),_0x14ca7b;}exports[_0x59e9f5(0x156)]=PRINT_CANVAS_CLASS,exports['PRINT_CONTAINER_CLASS']=PRINT_CONTAINER_CLASS,exports[_0x59e9f5(0x13f)]=PaperMarginMap,exports[_0x59e9f5(0x166)]=PrintAlign,exports['PrintDirection']=PrintDirection,exports[_0x59e9f5(0x141)]=PrintPaperMargin,exports[_0x59e9f5(0x14e)]=PrintScale,exports['createPrintStyle']=createPrintStyle;
|
package/lib/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x5f25(){const _0x4f2e5e=['\x0a\x20\x20\x20\x20.','createElement','Origin','356520XauUJJ','Wide','153HIEzoC','innerHTML','printing-canvas','offline-printing-css','44sPDHGl','None','px\x20',',\x20.','Custom','Landscape','7267645cJzIPJ','3748482pNRqGH','Normal','4sMoZCM','Narrow','Middle','printing-canvas-container','20FJCuAz','className','FitHeight','Portrait','139896ilnqNC','576510GkBWhQ','326032Axguua','FitWidth','625133qmSpDi','px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20','12COCZTp','End','FitPage','Start','\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20block!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20visible;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20top:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.'];_0x5f25=function(){return _0x4f2e5e;};return _0x5f25();}const _0x7197f7=_0x46ce;(function(_0x33143e,_0x44ea7a){const _0x1ebbda=_0x46ce,_0x3370a1=_0x33143e();while(!![]){try{const _0x5df4da=parseInt(_0x1ebbda(0x1c4))/0x1*(-parseInt(_0x1ebbda(0x1dd))/0x2)+-parseInt(_0x1ebbda(0x1db))/0x3+parseInt(_0x1ebbda(0x1d4))/0x4*(parseInt(_0x1ebbda(0x1c1))/0x5)+-parseInt(_0x1ebbda(0x1c6))/0x6*(-parseInt(_0x1ebbda(0x1c2))/0x7)+parseInt(_0x1ebbda(0x1ce))/0x8*(parseInt(_0x1ebbda(0x1d0))/0x9)+parseInt(_0x1ebbda(0x1bc))/0xa*(parseInt(_0x1ebbda(0x1da))/0xb)+-parseInt(_0x1ebbda(0x1c0))/0xc;if(_0x5df4da===_0x44ea7a)break;else _0x3370a1['push'](_0x3370a1['shift']());}catch(_0x5103f8){_0x3370a1['push'](_0x3370a1['shift']());}}}(_0x5f25,0xe2d1b));function _0x46ce(_0x33e613,_0x393a34){_0x33e613=_0x33e613-0x1ba;const _0x5f25ce=_0x5f25();let _0x46ce4a=_0x5f25ce[_0x33e613];return _0x46ce4a;}let PrintDirection=function(_0x30518e){const _0x52a1d0=_0x46ce;return _0x30518e[_0x52a1d0(0x1bf)]='Portrait',_0x30518e[_0x52a1d0(0x1d9)]=_0x52a1d0(0x1d9),_0x30518e;}({}),PrintScale=function(_0x19cf9b){const _0x1c417b=_0x46ce;return _0x19cf9b['Origin']=_0x1c417b(0x1cd),_0x19cf9b[_0x1c417b(0x1c3)]='FitWidth',_0x19cf9b[_0x1c417b(0x1be)]=_0x1c417b(0x1be),_0x19cf9b['FitPage']=_0x1c417b(0x1c8),_0x19cf9b[_0x1c417b(0x1d8)]=_0x1c417b(0x1d8),_0x19cf9b;}({}),PrintAlign=function(_0x2e3b0f){const _0xb439c2=_0x46ce;return _0x2e3b0f[_0xb439c2(0x1c9)]=_0xb439c2(0x1c9),_0x2e3b0f[_0xb439c2(0x1c7)]=_0xb439c2(0x1c7),_0x2e3b0f[_0xb439c2(0x1ba)]='Middle',_0x2e3b0f;}({}),PrintPaperMargin=function(_0xbb7c79){const _0x56dfdc=_0x46ce;return _0xbb7c79[_0x56dfdc(0x1dc)]=_0x56dfdc(0x1dc),_0xbb7c79[_0x56dfdc(0x1de)]=_0x56dfdc(0x1de),_0xbb7c79[_0x56dfdc(0x1cf)]=_0x56dfdc(0x1cf),_0xbb7c79[_0x56dfdc(0x1d5)]=_0x56dfdc(0x1d5),_0xbb7c79[_0x56dfdc(0x1d8)]=_0x56dfdc(0x1d8),_0xbb7c79;}({});const PaperMarginMap={[_0x7197f7(0x1dc)]:{'left':0x35,'right':0x35,'top':0x38,'bottom':0x38},[_0x7197f7(0x1de)]:{'left':0x13,'right':0x13,'top':0x38,'bottom':0x38},[_0x7197f7(0x1cf)]:{'left':0x4b,'right':0x4b,'top':0x4b,'bottom':0x4b},[_0x7197f7(0x1d5)]:{'left':0x0,'right':0x0,'top':0x0,'bottom':0x0},[_0x7197f7(0x1d8)]:{'left':0x0,'right':0x0,'top':0x0,'bottom':0x0}},PRINT_CONTAINER_CLASS=_0x7197f7(0x1bb),PRINT_CANVAS_CLASS=_0x7197f7(0x1d2);function createPrintStyle(_0x1fcee2,_0x17a8a2,_0x479752){const _0x5519a6=_0x7197f7,_0x22cbb9=_0x479752==='Portrait'?_0x1fcee2:_0x17a8a2,_0x324d3a=_0x479752===_0x5519a6(0x1bf)?_0x17a8a2:_0x1fcee2,_0x3dbe13=_0x5519a6(0x1cb)+PRINT_CANVAS_CLASS+'\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20@media\x20print\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20html\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20body\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20auto\x20!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20size:\x20'+_0x22cbb9+_0x5519a6(0x1d6)+_0x324d3a+'px;\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20visibility:\x20hidden;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20body\x20>\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20none!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.'+PRINT_CONTAINER_CLASS+_0x5519a6(0x1d7)+PRINT_CONTAINER_CLASS+_0x5519a6(0x1ca)+PRINT_CANVAS_CLASS+'\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20page-break-after:\x20always!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20'+_0x324d3a+_0x5519a6(0x1c5)+_0x22cbb9+'px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}',_0x23b968=document[_0x5519a6(0x1cc)]('style');return _0x23b968[_0x5519a6(0x1d1)]=_0x3dbe13,_0x23b968[_0x5519a6(0x1bd)]=_0x5519a6(0x1d3),_0x23b968;}export{PRINT_CANVAS_CLASS,PRINT_CONTAINER_CLASS,PaperMarginMap,PrintAlign,PrintDirection,PrintPaperMargin,PrintScale,createPrintStyle};
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x5f25(){const _0x4f2e5e=['\x0a\x20\x20\x20\x20.','createElement','Origin','356520XauUJJ','Wide','153HIEzoC','innerHTML','printing-canvas','offline-printing-css','44sPDHGl','None','px\x20',',\x20.','Custom','Landscape','7267645cJzIPJ','3748482pNRqGH','Normal','4sMoZCM','Narrow','Middle','printing-canvas-container','20FJCuAz','className','FitHeight','Portrait','139896ilnqNC','576510GkBWhQ','326032Axguua','FitWidth','625133qmSpDi','px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20','12COCZTp','End','FitPage','Start','\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20block!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20visible;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20top:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.'];_0x5f25=function(){return _0x4f2e5e;};return _0x5f25();}const _0x7197f7=_0x46ce;(function(_0x33143e,_0x44ea7a){const _0x1ebbda=_0x46ce,_0x3370a1=_0x33143e();while(!![]){try{const _0x5df4da=parseInt(_0x1ebbda(0x1c4))/0x1*(-parseInt(_0x1ebbda(0x1dd))/0x2)+-parseInt(_0x1ebbda(0x1db))/0x3+parseInt(_0x1ebbda(0x1d4))/0x4*(parseInt(_0x1ebbda(0x1c1))/0x5)+-parseInt(_0x1ebbda(0x1c6))/0x6*(-parseInt(_0x1ebbda(0x1c2))/0x7)+parseInt(_0x1ebbda(0x1ce))/0x8*(parseInt(_0x1ebbda(0x1d0))/0x9)+parseInt(_0x1ebbda(0x1bc))/0xa*(parseInt(_0x1ebbda(0x1da))/0xb)+-parseInt(_0x1ebbda(0x1c0))/0xc;if(_0x5df4da===_0x44ea7a)break;else _0x3370a1['push'](_0x3370a1['shift']());}catch(_0x5103f8){_0x3370a1['push'](_0x3370a1['shift']());}}}(_0x5f25,0xe2d1b));function _0x46ce(_0x33e613,_0x393a34){_0x33e613=_0x33e613-0x1ba;const _0x5f25ce=_0x5f25();let _0x46ce4a=_0x5f25ce[_0x33e613];return _0x46ce4a;}let PrintDirection=function(_0x30518e){const _0x52a1d0=_0x46ce;return _0x30518e[_0x52a1d0(0x1bf)]='Portrait',_0x30518e[_0x52a1d0(0x1d9)]=_0x52a1d0(0x1d9),_0x30518e;}({}),PrintScale=function(_0x19cf9b){const _0x1c417b=_0x46ce;return _0x19cf9b['Origin']=_0x1c417b(0x1cd),_0x19cf9b[_0x1c417b(0x1c3)]='FitWidth',_0x19cf9b[_0x1c417b(0x1be)]=_0x1c417b(0x1be),_0x19cf9b['FitPage']=_0x1c417b(0x1c8),_0x19cf9b[_0x1c417b(0x1d8)]=_0x1c417b(0x1d8),_0x19cf9b;}({}),PrintAlign=function(_0x2e3b0f){const _0xb439c2=_0x46ce;return _0x2e3b0f[_0xb439c2(0x1c9)]=_0xb439c2(0x1c9),_0x2e3b0f[_0xb439c2(0x1c7)]=_0xb439c2(0x1c7),_0x2e3b0f[_0xb439c2(0x1ba)]='Middle',_0x2e3b0f;}({}),PrintPaperMargin=function(_0xbb7c79){const _0x56dfdc=_0x46ce;return _0xbb7c79[_0x56dfdc(0x1dc)]=_0x56dfdc(0x1dc),_0xbb7c79[_0x56dfdc(0x1de)]=_0x56dfdc(0x1de),_0xbb7c79[_0x56dfdc(0x1cf)]=_0x56dfdc(0x1cf),_0xbb7c79[_0x56dfdc(0x1d5)]=_0x56dfdc(0x1d5),_0xbb7c79[_0x56dfdc(0x1d8)]=_0x56dfdc(0x1d8),_0xbb7c79;}({});const PaperMarginMap={[_0x7197f7(0x1dc)]:{'left':0x35,'right':0x35,'top':0x38,'bottom':0x38},[_0x7197f7(0x1de)]:{'left':0x13,'right':0x13,'top':0x38,'bottom':0x38},[_0x7197f7(0x1cf)]:{'left':0x4b,'right':0x4b,'top':0x4b,'bottom':0x4b},[_0x7197f7(0x1d5)]:{'left':0x0,'right':0x0,'top':0x0,'bottom':0x0},[_0x7197f7(0x1d8)]:{'left':0x0,'right':0x0,'top':0x0,'bottom':0x0}},PRINT_CONTAINER_CLASS=_0x7197f7(0x1bb),PRINT_CANVAS_CLASS=_0x7197f7(0x1d2);function createPrintStyle(_0x1fcee2,_0x17a8a2,_0x479752){const _0x5519a6=_0x7197f7,_0x22cbb9=_0x479752==='Portrait'?_0x1fcee2:_0x17a8a2,_0x324d3a=_0x479752===_0x5519a6(0x1bf)?_0x17a8a2:_0x1fcee2,_0x3dbe13=_0x5519a6(0x1cb)+PRINT_CANVAS_CLASS+'\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20@media\x20print\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20html\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20body\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20auto\x20!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20size:\x20'+_0x22cbb9+_0x5519a6(0x1d6)+_0x324d3a+'px;\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20visibility:\x20hidden;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20body\x20>\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20none!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.'+PRINT_CONTAINER_CLASS+_0x5519a6(0x1d7)+PRINT_CONTAINER_CLASS+_0x5519a6(0x1ca)+PRINT_CANVAS_CLASS+'\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20page-break-after:\x20always!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20'+_0x324d3a+_0x5519a6(0x1c5)+_0x22cbb9+'px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}',_0x23b968=document[_0x5519a6(0x1cc)]('style');return _0x23b968[_0x5519a6(0x1d1)]=_0x3dbe13,_0x23b968[_0x5519a6(0x1bd)]=_0x5519a6(0x1d3),_0x23b968;}export{PRINT_CANVAS_CLASS,PRINT_CONTAINER_CLASS,PaperMarginMap,PrintAlign,PrintDirection,PrintPaperMargin,PrintScale,createPrintStyle};
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x17a0(){const _0x4d6b49=['PaperMarginMap','11514753tJyzJf','End','Middle','UniverProPrint','innerHTML','Start','984535pWYRrM','Narrow','155919BEllnr','px;\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20margin:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20visibility:\x20hidden;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20body\x20>\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20none!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.','offline-printing-css','20kUrccS','393418IPmlbQ','FitHeight','FitWidth','\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20}\x0a\x20\x20\x20\x20@media\x20print\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20html\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20body\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20auto\x20!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20@page\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20size:\x20','exports','printing-canvas','object','px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20relative;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20}','defineProperty','style','\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20page-break-after:\x20always!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20','amd','Custom','Normal','PrintAlign','Wide','12013110kRjnnt','Landscape','FitPage',',\x20.','Origin','6LqZCxR','PRINT_CANVAS_CLASS','112nmyzOq','function','Portrait','None','826231nACgLW','PrintScale','2630645cRwMPQ'];_0x17a0=function(){return _0x4d6b49;};return _0x17a0();}function _0x3874(_0x44e365,_0x46c7bf){_0x44e365=_0x44e365-0x1e4;const _0x17a0b1=_0x17a0();let _0x387406=_0x17a0b1[_0x44e365];return _0x387406;}(function(_0x5262ac,_0x48f7ae){const _0x236316=_0x3874,_0x58604e=_0x5262ac();while(!![]){try{const _0x266e17=-parseInt(_0x236316(0x20d))/0x1+parseInt(_0x236316(0x1e8))/0x2+parseInt(_0x236316(0x1e4))/0x3*(parseInt(_0x236316(0x1e7))/0x4)+-parseInt(_0x236316(0x205))/0x5*(-parseInt(_0x236316(0x1fd))/0x6)+parseInt(_0x236316(0x203))/0x7*(-parseInt(_0x236316(0x1ff))/0x8)+parseInt(_0x236316(0x207))/0x9+parseInt(_0x236316(0x1f8))/0xa;if(_0x266e17===_0x48f7ae)break;else _0x58604e['push'](_0x58604e['shift']());}catch(_0x5b2f2f){_0x58604e['push'](_0x58604e['shift']());}}}(_0x17a0,0xc9c42),function(_0x3626d5,_0x32c9dc){const _0x2e601b=_0x3874;typeof exports==_0x2e601b(0x1ee)&&typeof module<'u'?_0x32c9dc(exports):typeof define==_0x2e601b(0x200)&&define[_0x2e601b(0x1f3)]?define([_0x2e601b(0x1ec)],_0x32c9dc):(_0x3626d5=typeof globalThis<'u'?globalThis:_0x3626d5||self,_0x32c9dc(_0x3626d5[_0x2e601b(0x20a)]={}));}(this,function(_0x29ad85){const _0xfeec24=_0x3874;Object[_0xfeec24(0x1f0)](_0x29ad85,Symbol['toStringTag'],{'value':'Module'});let _0xae90dd=function(_0x310400){const _0x5b86d0=_0xfeec24;return _0x310400[_0x5b86d0(0x201)]='Portrait',_0x310400[_0x5b86d0(0x1f9)]='Landscape',_0x310400;}({}),_0x44d468=function(_0x14154e){const _0x1e29ce=_0xfeec24;return _0x14154e[_0x1e29ce(0x1fc)]=_0x1e29ce(0x1fc),_0x14154e[_0x1e29ce(0x1ea)]=_0x1e29ce(0x1ea),_0x14154e['FitHeight']=_0x1e29ce(0x1e9),_0x14154e[_0x1e29ce(0x1fa)]=_0x1e29ce(0x1fa),_0x14154e[_0x1e29ce(0x1f4)]=_0x1e29ce(0x1f4),_0x14154e;}({}),_0x4a19cb=function(_0x46a574){const _0x28c6ca=_0xfeec24;return _0x46a574[_0x28c6ca(0x20c)]=_0x28c6ca(0x20c),_0x46a574[_0x28c6ca(0x208)]=_0x28c6ca(0x208),_0x46a574[_0x28c6ca(0x209)]=_0x28c6ca(0x209),_0x46a574;}({}),_0x7c24cc=function(_0x195fce){const _0xc73839=_0xfeec24;return _0x195fce['Normal']=_0xc73839(0x1f5),_0x195fce[_0xc73839(0x20e)]=_0xc73839(0x20e),_0x195fce[_0xc73839(0x1f7)]='Wide',_0x195fce[_0xc73839(0x202)]=_0xc73839(0x202),_0x195fce[_0xc73839(0x1f4)]=_0xc73839(0x1f4),_0x195fce;}({}),_0x4e6c97={'Normal':{'left':0x35,'right':0x35,'top':0x38,'bottom':0x38},'Narrow':{'left':0x13,'right':0x13,'top':0x38,'bottom':0x38},'Wide':{'left':0x4b,'right':0x4b,'top':0x4b,'bottom':0x4b},'None':{'left':0x0,'right':0x0,'top':0x0,'bottom':0x0},'Custom':{'left':0x0,'right':0x0,'top':0x0,'bottom':0x0}},_0x553bc8='printing-canvas-container',_0x266882=_0xfeec24(0x1ed);function _0x5dd6b0(_0x1086c2,_0x32da9c,_0x3e70e2){const _0x274f15=_0xfeec24;let _0x2752f2=_0x3e70e2===_0x274f15(0x201)?_0x1086c2:_0x32da9c,_0x3ed9ac=_0x3e70e2==='Portrait'?_0x32da9c:_0x1086c2,_0x1f6e83='\x0a\x20\x20\x20\x20.'+_0x266882+_0x274f15(0x1eb)+_0x2752f2+'px\x20'+_0x3ed9ac+_0x274f15(0x1e5)+_0x553bc8+_0x274f15(0x1fb)+_0x553bc8+'\x20*\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20block!important;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20overflow:\x20visible;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20top:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20fit-content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20.'+_0x266882+_0x274f15(0x1f2)+_0x3ed9ac+'px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20'+_0x2752f2+_0x274f15(0x1ef),_0x19ad6a=document['createElement'](_0x274f15(0x1f1));return _0x19ad6a[_0x274f15(0x20b)]=_0x1f6e83,_0x19ad6a['className']=_0x274f15(0x1e6),_0x19ad6a;}_0x29ad85[_0xfeec24(0x1fe)]=_0x266882,_0x29ad85['PRINT_CONTAINER_CLASS']=_0x553bc8,_0x29ad85[_0xfeec24(0x206)]=_0x4e6c97,_0x29ad85[_0xfeec24(0x1f6)]=_0x4a19cb,_0x29ad85['PrintDirection']=_0xae90dd,_0x29ad85['PrintPaperMargin']=_0x7c24cc,_0x29ad85[_0xfeec24(0x204)]=_0x44d468,_0x29ad85['createPrintStyle']=_0x5dd6b0;}));
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs-pro/print",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "
|
|
6
|
-
"author": "DreamNum <developer@univer.ai>",
|
|
5
|
+
"description": "Shared print utilities for Univer Pro.",
|
|
6
|
+
"author": "DreamNum Co., Ltd. <developer@univer.ai>",
|
|
7
7
|
"funding": {
|
|
8
8
|
"type": "opencollective",
|
|
9
9
|
"url": "https://opencollective.com/univer"
|
|
@@ -16,7 +16,13 @@
|
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/dream-num/univer/issues"
|
|
18
18
|
},
|
|
19
|
-
"keywords": [
|
|
19
|
+
"keywords": [
|
|
20
|
+
"univer",
|
|
21
|
+
"univer-pro",
|
|
22
|
+
"print",
|
|
23
|
+
"printing",
|
|
24
|
+
"utilities"
|
|
25
|
+
],
|
|
20
26
|
"exports": {
|
|
21
27
|
".": {
|
|
22
28
|
"import": "./lib/es/index.js",
|
|
@@ -44,7 +50,7 @@
|
|
|
44
50
|
"devDependencies": {
|
|
45
51
|
"typescript": "^6.0.3",
|
|
46
52
|
"vitest": "^4.1.4",
|
|
47
|
-
"@univerjs-infra/shared": "0.
|
|
53
|
+
"@univerjs-infra/shared": "0.22.0"
|
|
48
54
|
},
|
|
49
55
|
"scripts": {
|
|
50
56
|
"test": "vitest run",
|