@univer-cli/svg-facade-command 1.3.1 → 1.5.2

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.
Files changed (2) hide show
  1. package/dist/index.mjs +1 -1
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- (function(_0x34056e,_0x8202e4){const _0x15c3a2=_0x500e,_0x1b8ede=_0x34056e();while(!![]){try{const _0x378b61=parseInt(_0x15c3a2(0x1dd))/0x1*(-parseInt(_0x15c3a2(0x1d3))/0x2)+-parseInt(_0x15c3a2(0x1e4))/0x3*(-parseInt(_0x15c3a2(0x1d5))/0x4)+-parseInt(_0x15c3a2(0x1ee))/0x5*(-parseInt(_0x15c3a2(0x1c5))/0x6)+-parseInt(_0x15c3a2(0x1e2))/0x7+parseInt(_0x15c3a2(0x1c4))/0x8+-parseInt(_0x15c3a2(0x1c9))/0x9*(parseInt(_0x15c3a2(0x1c2))/0xa)+parseInt(_0x15c3a2(0x1eb))/0xb*(parseInt(_0x15c3a2(0x1cd))/0xc);if(_0x378b61===_0x8202e4)break;else _0x1b8ede['push'](_0x1b8ede['shift']());}catch(_0x2846c4){_0x1b8ede['push'](_0x1b8ede['shift']());}}}(_0x336f,0x6df6e));import{readFileSync as _0x42be98,writeFileSync as _0x350e03}from'node:fs';import{dirname as _0x23feb5,resolve as _0x2954f5}from'node:path';import{builtinTextMeasurer as _0x224216,compileSvgToFacade as _0x55956c,isSvgFacadeError as _0xdce029,wrapSlideScript as _0x4e4236}from'@univer-cli/svg-facade';import{Command as _0x1e629a,InvalidArgumentError as _0x6908a9}from'commander';var u='text\x20boxes\x20were\x20sized\x20by\x20estimation\x20(--estimate-text-size),\x20not\x20by\x20real\x20font\x20metrics:\x20text\x20can\x20sit\x20off-position,\x20especially\x20centred\x20or\x20right-aligned\x20lines;\x20recompile\x20without\x20the\x20flag\x20(with\x20a\x20browser)\x20before\x20you\x20ship';function d(_0x11ca7f){const _0x54f56a=_0x500e;let _0x2921af=new _0x1e629a(_0x54f56a(0x1ca))[_0x54f56a(0x1ce)](_0x54f56a(0x1c8))[_0x54f56a(0x1e0)]('<file.svg>',_0x54f56a(0x1ec))[_0x54f56a(0x1db)](_0x54f56a(0x1c3),'write\x20structured\x20JSON')[_0x54f56a(0x1db)](_0x54f56a(0x1e1),_0x54f56a(0x1df))['option']('--page\x20<number>',_0x54f56a(0x1ea),f)[_0x54f56a(0x1db)]('--add',_0x54f56a(0x1e6))[_0x54f56a(0x1db)]('--out\x20<path>',_0x54f56a(0x1ef))['action'](async(_0x464857,_0x49cad6)=>{const _0xcee42c=_0x54f56a;p(_0x2921af,_0x49cad6);try{let _0x404121=_0x42be98(_0x464857,_0xcee42c(0x1d6)),_0x24f599=_0x49cad6[_0xcee42c(0x1e5)]===!0x0,_0x156222=await _0x55956c(_0x404121,{'assetResolver':_0x123642=>({'bytes':_0x42be98(_0x2954f5(_0x23feb5(_0x464857),_0x123642))}),'textMeasurer':_0x24f599?_0x224216:_0x11ca7f[_0xcee42c(0x1e9)]}),_0x34b639=_0x24f599?[..._0x156222[_0xcee42c(0x1dc)],u]:_0x156222[_0xcee42c(0x1dc)],_0x4da128=_0x49cad6[_0xcee42c(0x1cf)]===!0x0?_0xcee42c(0x1cf):_0xcee42c(0x1d4),_0x3d2e2d=_0x49cad6[_0xcee42c(0x1d1)]===void 0x0?_0x156222[_0xcee42c(0x1f0)]:_0x4e4236(_0x156222[_0xcee42c(0x1f0)],{'page':_0x49cad6[_0xcee42c(0x1d1)],'mode':_0x4da128,..._0x156222[_0xcee42c(0x1d7)]});if(_0x49cad6[_0xcee42c(0x1d9)]!==void 0x0&&_0x350e03(_0x49cad6[_0xcee42c(0x1d9)],_0x3d2e2d+'\x0a',_0xcee42c(0x1d6)),_0x49cad6[_0xcee42c(0x1cb)]===!0x0){h(_0x2921af,{'code':_0x3d2e2d,'lints':_0x34b639,'textMeasure':_0x156222[_0xcee42c(0x1e8)],'viewport':_0x156222[_0xcee42c(0x1d7)],'warnings':_0x156222[_0xcee42c(0x1cc)],..._0x49cad6[_0xcee42c(0x1d1)]===void 0x0?{}:{'mode':_0x4da128,'page':_0x49cad6['page']},..._0x49cad6[_0xcee42c(0x1d9)]===void 0x0?{}:{'out':_0x49cad6[_0xcee42c(0x1d9)]}});return;}m(_0x2921af,_0x156222[_0xcee42c(0x1cc)],_0x34b639),_0x49cad6[_0xcee42c(0x1d9)]===void 0x0?g(_0x2921af,_0x3d2e2d):g(_0x2921af,'generated\x20code:\x20'+_0x49cad6[_0xcee42c(0x1d9)]);}catch(_0x529c1d){throw _0xdce029(_0x529c1d)&&_0x2921af[_0xcee42c(0x1de)](_0x529c1d[_0xcee42c(0x1f0)]+':\x20'+_0x529c1d['message'],{'code':_0xcee42c(0x1d2),'exitCode':0x1}),_0x529c1d instanceof Error&&_0x2921af[_0xcee42c(0x1de)](_0x529c1d[_0xcee42c(0x1d0)],{'code':_0xcee42c(0x1d2),'exitCode':0x1}),_0x529c1d;}});return _0x2921af;}function _0x500e(_0x57a567,_0x19495e){_0x57a567=_0x57a567-0x1c0;const _0x336fb8=_0x336f();let _0x500e35=_0x336fb8[_0x57a567];return _0x500e35;}function f(_0x3668d4){const _0x20967a=_0x500e;let _0x465417=Number(_0x3668d4);if(!Number['isInteger'](_0x465417)||_0x465417<0x1)throw new _0x6908a9(_0x20967a(0x1c7)+_0x3668d4+'\x22.');return _0x465417;}function p(_0x208bed,_0x4eb94d){const _0x5431c8=_0x500e;_0x4eb94d[_0x5431c8(0x1d1)]===void 0x0&&(_0x4eb94d['add']===!0x0||_0x4eb94d['out']!==void 0x0)&&_0x208bed['error']('--add\x20and\x20--out\x20require\x20--page\x20<number>.',{'code':_0x5431c8(0x1da),'exitCode':0x1});}function m(_0x502970,_0x2d3bda,_0x4aedda){const _0x254979=_0x500e;let _0x5acd87=_0x502970[_0x254979(0x1c6)]();for(let _0x5a6f7d of _0x2d3bda)_0x5acd87['writeErr']?.(_0x254979(0x1ed)+_0x5a6f7d+'\x0a');for(let _0x3fcc86 of _0x4aedda)_0x5acd87[_0x254979(0x1d8)]?.('lint:\x20'+_0x3fcc86+'\x0a');(_0x2d3bda[_0x254979(0x1e3)]>0x0||_0x4aedda['length']>0x0)&&_0x5acd87['writeErr']?.(_0x254979(0x1e7));}function h(_0x4c2fbe,_0x1ead88){const _0x25b0af=_0x500e;_0x4c2fbe[_0x25b0af(0x1c6)]()[_0x25b0af(0x1c1)]?.(JSON[_0x25b0af(0x1c0)](_0x1ead88,null,0x2)+'\x0a');}function g(_0x29b6b0,_0x277077){const _0x143c45=_0x500e;_0x29b6b0['configureOutput']()[_0x143c45(0x1c1)]?.(_0x277077+'\x0a');}function _0x336f(){const _0x1a9317=['wrap\x20the\x20result\x20for\x20a\x201-based\x20target\x20Slide\x20page','11GVpadK','SVG\x20source\x20file','warning:\x20','2100255Wjhzka','write\x20generated\x20code\x20to\x20a\x20file','code','stringify','writeOut','4610230lPARKa','--json','3441592wIzEPu','6sUTYsa','configureOutput','Expected\x20an\x20integer\x20>=\x201;\x20received\x20\x22','Compile\x20SVG\x20into\x20Univer\x20Slide\x20Facade\x20code','9odneeB','compile-svg','json','warnings','7965108ulhpAw','description','add','message','page','compile-svg.failed','16lbThCW','replace','55492gDhiMl','utf8','viewport','writeErr','out','compile-svg.invalid-input','option','lints','108758ZGHrwt','error','use\x20deterministic\x20text-size\x20estimation\x20instead\x20of\x20the\x20injected\x20measurer','argument','--estimate-text-size','3080217HTjzlh','length','153qsWbEO','estimateTextSize','overlay\x20onto\x20the\x20target\x20page\x20instead\x20of\x20clearing\x20it\x20first','warning\x20=\x20unsupported\x20SVG\x20feature\x20degraded;\x20lint\x20=\x20review\x20suggestion,\x20nothing\x20was\x20dropped\x0a','textMeasure','textMeasurer'];_0x336f=function(){return _0x1a9317;};return _0x336f();}export{d as createCompileSvgCommand};
1
+ const _0x17de68=_0x1eb2;(function(_0x4a7acb,_0x3e735d){const _0x3c39bc=_0x1eb2,_0x290d4a=_0x4a7acb();while(!![]){try{const _0x2d8317=parseInt(_0x3c39bc(0x13a))/0x1+parseInt(_0x3c39bc(0x14c))/0x2*(parseInt(_0x3c39bc(0x165))/0x3)+parseInt(_0x3c39bc(0x13f))/0x4+-parseInt(_0x3c39bc(0x155))/0x5+-parseInt(_0x3c39bc(0x144))/0x6+parseInt(_0x3c39bc(0x137))/0x7*(-parseInt(_0x3c39bc(0x13e))/0x8)+-parseInt(_0x3c39bc(0x13c))/0x9*(parseInt(_0x3c39bc(0x15d))/0xa);if(_0x2d8317===_0x3e735d)break;else _0x290d4a['push'](_0x290d4a['shift']());}catch(_0x588559){_0x290d4a['push'](_0x290d4a['shift']());}}}(_0x53cb,0x1c151));import{readFileSync as _0x3d9bdc,writeFileSync as _0x34a858}from'node:fs';import{dirname as _0x3d91a5,resolve as _0x272c40}from'node:path';import{builtinTextMeasurer as _0x5bea0b,compileSvgToFacade as _0x4995ee,isSvgFacadeError as _0x76d74b,wrapSlideScript as _0x5b8f4e}from'@univer-cli/svg-facade';function _0x53cb(){const _0x53aaa7=['--json','writeErr','writeOut','message','stringify','lints','380395mWDPiS','wrap\x20the\x20result\x20for\x20a\x201-based\x20target\x20Slide\x20page','viewport','add','Expected\x20an\x20integer\x20>=\x201;\x20received\x20\x22','text\x20boxes\x20were\x20sized\x20by\x20estimation\x20(--estimate-text-size),\x20not\x20by\x20real\x20font\x20metrics:\x20text\x20can\x20sit\x20off-position,\x20especially\x20centred\x20or\x20right-aligned\x20lines;\x20recompile\x20without\x20the\x20flag\x20(with\x20a\x20browser)\x20before\x20you\x20ship','error','compile-svg.failed','10dWYnGi','utf8','replace','code','compile-svg.invalid-input','write\x20structured\x20JSON','out','textMeasurer','30813ibczVD','use\x20deterministic\x20text-size\x20estimation\x20instead\x20of\x20the\x20injected\x20measurer','68719MixzwK','--out\x20<path>','description','77000UqWhFd','--page\x20<number>','53964NUzQVF','isInteger','24XnIZIz','792036cZEMcV','argument','warnings','estimateTextSize','--add\x20and\x20--out\x20require\x20--page\x20<number>.','352374JALZEd','generated\x20code:\x20','configureOutput','compile-svg','SVG\x20source\x20file','page','<file.svg>','option','2HmCYvy','action','--add'];_0x53cb=function(){return _0x53aaa7;};return _0x53cb();}import{Command as _0x187930,InvalidArgumentError as _0x12e195}from'commander';var u=_0x17de68(0x15a);function d(_0x5b27b0){const _0x3907c9=_0x17de68;let _0x437864=new _0x187930(_0x3907c9(0x147))[_0x3907c9(0x139)]('Compile\x20SVG\x20into\x20Univer\x20Slide\x20Facade\x20code')[_0x3907c9(0x140)](_0x3907c9(0x14a),_0x3907c9(0x148))[_0x3907c9(0x14b)](_0x3907c9(0x14f),_0x3907c9(0x162))[_0x3907c9(0x14b)]('--estimate-text-size',_0x3907c9(0x166))[_0x3907c9(0x14b)](_0x3907c9(0x13b),_0x3907c9(0x156),f)[_0x3907c9(0x14b)](_0x3907c9(0x14e),'overlay\x20onto\x20the\x20target\x20page\x20instead\x20of\x20clearing\x20it\x20first')['option'](_0x3907c9(0x138),'write\x20generated\x20code\x20to\x20a\x20file')[_0x3907c9(0x14d)](async(_0x53fc79,_0x5287d1)=>{const _0x4c7574=_0x3907c9;p(_0x437864,_0x5287d1);try{let _0x13c2ca=_0x3d9bdc(_0x53fc79,'utf8'),_0x151bb6=_0x5287d1[_0x4c7574(0x142)]===!0x0,_0x327d30=await _0x4995ee(_0x13c2ca,{'assetResolver':_0x1d6830=>({'bytes':_0x3d9bdc(_0x272c40(_0x3d91a5(_0x53fc79),_0x1d6830))}),'textMeasurer':_0x151bb6?_0x5bea0b:_0x5b27b0[_0x4c7574(0x164)]}),_0x91ccf4=_0x151bb6?[..._0x327d30[_0x4c7574(0x154)],u]:_0x327d30['lints'],_0x36a38d=_0x5287d1[_0x4c7574(0x158)]===!0x0?_0x4c7574(0x158):_0x4c7574(0x15f),_0x2703f5=_0x5287d1['page']===void 0x0?_0x327d30[_0x4c7574(0x160)]:_0x5b8f4e(_0x327d30['code'],{'page':_0x5287d1['page'],'mode':_0x36a38d,..._0x327d30[_0x4c7574(0x157)]});if(_0x5287d1[_0x4c7574(0x163)]!==void 0x0&&_0x34a858(_0x5287d1[_0x4c7574(0x163)],_0x2703f5+'\x0a',_0x4c7574(0x15e)),_0x5287d1['json']===!0x0){h(_0x437864,{'code':_0x2703f5,'lints':_0x91ccf4,'textMeasure':_0x327d30['textMeasure'],'viewport':_0x327d30[_0x4c7574(0x157)],'warnings':_0x327d30['warnings'],..._0x5287d1[_0x4c7574(0x149)]===void 0x0?{}:{'mode':_0x36a38d,'page':_0x5287d1['page']},..._0x5287d1[_0x4c7574(0x163)]===void 0x0?{}:{'out':_0x5287d1[_0x4c7574(0x163)]}});return;}m(_0x437864,_0x327d30[_0x4c7574(0x141)],_0x91ccf4),_0x5287d1[_0x4c7574(0x163)]===void 0x0?g(_0x437864,_0x2703f5):g(_0x437864,_0x4c7574(0x145)+_0x5287d1[_0x4c7574(0x163)]);}catch(_0x239dde){throw _0x76d74b(_0x239dde)&&_0x437864[_0x4c7574(0x15b)](_0x239dde['code']+':\x20'+_0x239dde[_0x4c7574(0x152)],{'code':'compile-svg.failed','exitCode':0x1}),_0x239dde instanceof Error&&_0x437864[_0x4c7574(0x15b)](_0x239dde[_0x4c7574(0x152)],{'code':_0x4c7574(0x15c),'exitCode':0x1}),_0x239dde;}});return _0x437864;}function f(_0x4c57ba){const _0x1d8d97=_0x17de68;let _0x2e14b2=Number(_0x4c57ba);if(!Number[_0x1d8d97(0x13d)](_0x2e14b2)||_0x2e14b2<0x1)throw new _0x12e195(_0x1d8d97(0x159)+_0x4c57ba+'\x22.');return _0x2e14b2;}function p(_0x465d75,_0x54253c){const _0x3f6400=_0x17de68;_0x54253c[_0x3f6400(0x149)]===void 0x0&&(_0x54253c['add']===!0x0||_0x54253c[_0x3f6400(0x163)]!==void 0x0)&&_0x465d75[_0x3f6400(0x15b)](_0x3f6400(0x143),{'code':_0x3f6400(0x161),'exitCode':0x1});}function m(_0x464505,_0x4d80fb,_0x5a83bb){const _0x47c55a=_0x17de68;let _0x874c5d=_0x464505[_0x47c55a(0x146)]();for(let _0x58875b of _0x4d80fb)_0x874c5d['writeErr']?.('warning:\x20'+_0x58875b+'\x0a');for(let _0x1fcbc0 of _0x5a83bb)_0x874c5d[_0x47c55a(0x150)]?.('lint:\x20'+_0x1fcbc0+'\x0a');(_0x4d80fb['length']>0x0||_0x5a83bb['length']>0x0)&&_0x874c5d[_0x47c55a(0x150)]?.('warning\x20=\x20unsupported\x20SVG\x20feature\x20degraded;\x20lint\x20=\x20review\x20suggestion,\x20nothing\x20was\x20dropped\x0a');}function _0x1eb2(_0x360b77,_0x11ab36){_0x360b77=_0x360b77-0x137;const _0x53cb58=_0x53cb();let _0x1eb292=_0x53cb58[_0x360b77];return _0x1eb292;}function h(_0x18f924,_0x4882a9){const _0x3f0d49=_0x17de68;_0x18f924[_0x3f0d49(0x146)]()['writeOut']?.(JSON[_0x3f0d49(0x153)](_0x4882a9,null,0x2)+'\x0a');}function g(_0x480d76,_0x3232d5){const _0x1a723d=_0x17de68;_0x480d76[_0x1a723d(0x146)]()[_0x1a723d(0x151)]?.(_0x3232d5+'\x0a');}export{d as createCompileSvgCommand};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univer-cli/svg-facade-command",
3
3
  "type": "module",
4
- "version": "1.3.1",
4
+ "version": "1.5.2",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "README.zh-CN.md"
19
19
  ],
20
20
  "dependencies": {
21
- "@univer-cli/svg-facade": "1.3.1"
21
+ "@univer-cli/svg-facade": "1.5.2"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "commander": "^15.0.0"