@univer-cli/svg-facade-command 1.4.0 → 1.6.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.
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(_0x465234,_0x595a80){const _0x11b54b=_0x5b32,_0x2e776b=_0x465234();while(!![]){try{const _0x76d23b=-parseInt(_0x11b54b(0x169))/0x1*(parseInt(_0x11b54b(0x172))/0x2)+parseInt(_0x11b54b(0x17d))/0x3+-parseInt(_0x11b54b(0x17c))/0x4+-parseInt(_0x11b54b(0x16d))/0x5+-parseInt(_0x11b54b(0x17a))/0x6*(-parseInt(_0x11b54b(0x177))/0x7)+parseInt(_0x11b54b(0x176))/0x8+parseInt(_0x11b54b(0x173))/0x9;if(_0x76d23b===_0x595a80)break;else _0x2e776b['push'](_0x2e776b['shift']());}catch(_0x192ee7){_0x2e776b['push'](_0x2e776b['shift']());}}}(_0x5f4b,0x2230f));import{readFileSync as _0x52ca73,writeFileSync as _0x1ffcf4}from'node:fs';function _0x5b32(_0x2f3add,_0x433025){_0x2f3add=_0x2f3add-0x158;const _0x5f4b73=_0x5f4b();let _0x5b3275=_0x5f4b73[_0x2f3add];return _0x5b3275;}import{dirname as _0x64530f,resolve as _0x5e8e5b}from'node:path';import{builtinTextMeasurer as _0x5bdf14,compileSvgToFacade as _0x3b5943,isSvgFacadeError as _0x3ce7bc,wrapSlideScript as _0x5ec053}from'@univer-cli/svg-facade';function _0x5f4b(){const _0xa02a4a=['--page\x20<number>','write\x20structured\x20JSON','Expected\x20an\x20integer\x20>=\x201;\x20received\x20\x22','message','isInteger','length','page','Compile\x20SVG\x20into\x20Univer\x20Slide\x20Facade\x20code','1GUSTKJ','wrap\x20the\x20result\x20for\x20a\x201-based\x20target\x20Slide\x20page','writeOut','--json','1006520cHMaqe','compile-svg.failed','viewport','replace','--estimate-text-size','103198WIMJio','1695402obvULJ','compile-svg.invalid-input','SVG\x20source\x20file','2092072pfsHKv','511Ydntoa','out','textMeasurer','3978MGnFNG','lints','553336kZaWmz','98994HxcPuY','json','--add\x20and\x20--out\x20require\x20--page\x20<number>.','textMeasure','warnings','overlay\x20onto\x20the\x20target\x20page\x20instead\x20of\x20clearing\x20it\x20first','add','description','write\x20generated\x20code\x20to\x20a\x20file','use\x20deterministic\x20text-size\x20estimation\x20instead\x20of\x20the\x20injected\x20measurer','estimateTextSize','warning\x20=\x20unsupported\x20SVG\x20feature\x20degraded;\x20lint\x20=\x20review\x20suggestion,\x20nothing\x20was\x20dropped\x0a','compile-svg','<file.svg>','writeErr','option','configureOutput','error','code'];_0x5f4b=function(){return _0xa02a4a;};return _0x5f4b();}import{Command as _0x25f7d7,InvalidArgumentError as _0x2aa486}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(_0x292cbf){const _0x13ad14=_0x5b32;let _0x139fdc=new _0x25f7d7(_0x13ad14(0x15a))[_0x13ad14(0x184)](_0x13ad14(0x168))['argument'](_0x13ad14(0x15b),_0x13ad14(0x175))[_0x13ad14(0x15d)](_0x13ad14(0x16c),_0x13ad14(0x162))[_0x13ad14(0x15d)](_0x13ad14(0x171),_0x13ad14(0x186))[_0x13ad14(0x15d)](_0x13ad14(0x161),_0x13ad14(0x16a),f)[_0x13ad14(0x15d)]('--add',_0x13ad14(0x182))[_0x13ad14(0x15d)]('--out\x20<path>',_0x13ad14(0x185))['action'](async(_0xfb35f1,_0x3c601e)=>{const _0x43ea65=_0x13ad14;p(_0x139fdc,_0x3c601e);try{let _0x3984ef=_0x52ca73(_0xfb35f1,'utf8'),_0x3f2b2c=_0x3c601e[_0x43ea65(0x158)]===!0x0,_0x30fcb8=await _0x3b5943(_0x3984ef,{'assetResolver':_0x57e4c4=>({'bytes':_0x52ca73(_0x5e8e5b(_0x64530f(_0xfb35f1),_0x57e4c4))}),'textMeasurer':_0x3f2b2c?_0x5bdf14:_0x292cbf[_0x43ea65(0x179)]}),_0x518cad=_0x3f2b2c?[..._0x30fcb8[_0x43ea65(0x17b)],u]:_0x30fcb8[_0x43ea65(0x17b)],_0x40bde7=_0x3c601e[_0x43ea65(0x183)]===!0x0?_0x43ea65(0x183):_0x43ea65(0x170),_0x231913=_0x3c601e[_0x43ea65(0x167)]===void 0x0?_0x30fcb8[_0x43ea65(0x160)]:_0x5ec053(_0x30fcb8[_0x43ea65(0x160)],{'page':_0x3c601e[_0x43ea65(0x167)],'mode':_0x40bde7,..._0x30fcb8['viewport']});if(_0x3c601e[_0x43ea65(0x178)]!==void 0x0&&_0x1ffcf4(_0x3c601e[_0x43ea65(0x178)],_0x231913+'\x0a','utf8'),_0x3c601e[_0x43ea65(0x17e)]===!0x0){h(_0x139fdc,{'code':_0x231913,'lints':_0x518cad,'textMeasure':_0x30fcb8[_0x43ea65(0x180)],'viewport':_0x30fcb8[_0x43ea65(0x16f)],'warnings':_0x30fcb8['warnings'],..._0x3c601e['page']===void 0x0?{}:{'mode':_0x40bde7,'page':_0x3c601e[_0x43ea65(0x167)]},..._0x3c601e[_0x43ea65(0x178)]===void 0x0?{}:{'out':_0x3c601e[_0x43ea65(0x178)]}});return;}m(_0x139fdc,_0x30fcb8[_0x43ea65(0x181)],_0x518cad),_0x3c601e[_0x43ea65(0x178)]===void 0x0?g(_0x139fdc,_0x231913):g(_0x139fdc,'generated\x20code:\x20'+_0x3c601e[_0x43ea65(0x178)]);}catch(_0x176bb7){throw _0x3ce7bc(_0x176bb7)&&_0x139fdc['error'](_0x176bb7[_0x43ea65(0x160)]+':\x20'+_0x176bb7['message'],{'code':_0x43ea65(0x16e),'exitCode':0x1}),_0x176bb7 instanceof Error&&_0x139fdc['error'](_0x176bb7[_0x43ea65(0x164)],{'code':'compile-svg.failed','exitCode':0x1}),_0x176bb7;}});return _0x139fdc;}function f(_0x6e704a){const _0x5034da=_0x5b32;let _0x26f7e5=Number(_0x6e704a);if(!Number[_0x5034da(0x165)](_0x26f7e5)||_0x26f7e5<0x1)throw new _0x2aa486(_0x5034da(0x163)+_0x6e704a+'\x22.');return _0x26f7e5;}function p(_0x3667fa,_0x5b0473){const _0x2b8d97=_0x5b32;_0x5b0473[_0x2b8d97(0x167)]===void 0x0&&(_0x5b0473[_0x2b8d97(0x183)]===!0x0||_0x5b0473[_0x2b8d97(0x178)]!==void 0x0)&&_0x3667fa[_0x2b8d97(0x15f)](_0x2b8d97(0x17f),{'code':_0x2b8d97(0x174),'exitCode':0x1});}function m(_0x2d340c,_0x336b26,_0x3b2b5c){const _0xd726cb=_0x5b32;let _0x30ca7c=_0x2d340c['configureOutput']();for(let _0x5ae22b of _0x336b26)_0x30ca7c[_0xd726cb(0x15c)]?.('warning:\x20'+_0x5ae22b+'\x0a');for(let _0x19fa23 of _0x3b2b5c)_0x30ca7c[_0xd726cb(0x15c)]?.('lint:\x20'+_0x19fa23+'\x0a');(_0x336b26[_0xd726cb(0x166)]>0x0||_0x3b2b5c[_0xd726cb(0x166)]>0x0)&&_0x30ca7c['writeErr']?.(_0xd726cb(0x159));}function h(_0x526316,_0x5dacc7){const _0x45afca=_0x5b32;_0x526316[_0x45afca(0x15e)]()[_0x45afca(0x16b)]?.(JSON['stringify'](_0x5dacc7,null,0x2)+'\x0a');}function g(_0xa57c34,_0x215bcb){const _0x5894cf=_0x5b32;_0xa57c34[_0x5894cf(0x15e)]()[_0x5894cf(0x16b)]?.(_0x215bcb+'\x0a');}export{d as createCompileSvgCommand};
1
+ const _0x503b21=_0x203d;(function(_0x4bb5c1,_0x12649e){const _0x5c05b4=_0x203d,_0x290364=_0x4bb5c1();while(!![]){try{const _0xe7ec89=-parseInt(_0x5c05b4(0x162))/0x1*(-parseInt(_0x5c05b4(0x17f))/0x2)+parseInt(_0x5c05b4(0x16e))/0x3+parseInt(_0x5c05b4(0x160))/0x4*(parseInt(_0x5c05b4(0x16f))/0x5)+-parseInt(_0x5c05b4(0x17d))/0x6*(-parseInt(_0x5c05b4(0x172))/0x7)+-parseInt(_0x5c05b4(0x182))/0x8*(parseInt(_0x5c05b4(0x181))/0x9)+parseInt(_0x5c05b4(0x17b))/0xa*(-parseInt(_0x5c05b4(0x15a))/0xb)+-parseInt(_0x5c05b4(0x164))/0xc;if(_0xe7ec89===_0x12649e)break;else _0x290364['push'](_0x290364['shift']());}catch(_0x3e4ee1){_0x290364['push'](_0x290364['shift']());}}}(_0x4852,0x2e0a1));import{readFileSync as _0x5dda30,writeFileSync as _0x52cd5d}from'node:fs';import{dirname as _0x2aa9c3,resolve as _0x3a9308}from'node:path';import{builtinTextMeasurer as _0x49bae3,compileSvgToFacade as _0x324aad,isSvgFacadeError as _0x529526,wrapSlideScript as _0x1bc99d}from'@univer-cli/svg-facade';function _0x4852(){const _0x284f88=['12pEPKMf','--out\x20<path>','5UVLSBL','lints','2886036pSOOpJ','--add\x20and\x20--out\x20require\x20--page\x20<number>.','--json','--page\x20<number>','--add','description','warning\x20=\x20unsupported\x20SVG\x20feature\x20degraded;\x20lint\x20=\x20review\x20suggestion,\x20nothing\x20was\x20dropped\x0a','length','out','writeOut','330078QKIpFI','431565gzQrIG','Expected\x20an\x20integer\x20>=\x201;\x20received\x20\x22','compile-svg','7paMFez','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','compile-svg.failed','argument','Compile\x20SVG\x20into\x20Univer\x20Slide\x20Facade\x20code','page','write\x20generated\x20code\x20to\x20a\x20file','<file.svg>','configureOutput','20tNIcHg','isInteger','645222MYzKHA','add','126930wMWdcH','utf8','9zFHHln','1909032iNPUDN','use\x20deterministic\x20text-size\x20estimation\x20instead\x20of\x20the\x20injected\x20measurer','option','lint:\x20','stringify','SVG\x20source\x20file','textMeasure','generated\x20code:\x20','write\x20structured\x20JSON','error','writeErr','viewport','overlay\x20onto\x20the\x20target\x20page\x20instead\x20of\x20clearing\x20it\x20first','code','693649BApvYJ','warnings','message','wrap\x20the\x20result\x20for\x20a\x201-based\x20target\x20Slide\x20page','textMeasurer','json'];_0x4852=function(){return _0x284f88;};return _0x4852();}import{Command as _0x7439f9,InvalidArgumentError as _0x458eb3}from'commander';var u=_0x503b21(0x173);function d(_0x17df32){const _0x562e1d=_0x503b21;let _0x1d7ab1=new _0x7439f9(_0x562e1d(0x171))[_0x562e1d(0x169)](_0x562e1d(0x176))[_0x562e1d(0x175)](_0x562e1d(0x179),_0x562e1d(0x151))['option'](_0x562e1d(0x166),_0x562e1d(0x154))[_0x562e1d(0x14e)]('--estimate-text-size',_0x562e1d(0x183))[_0x562e1d(0x14e)](_0x562e1d(0x167),_0x562e1d(0x15d),f)[_0x562e1d(0x14e)](_0x562e1d(0x168),_0x562e1d(0x158))[_0x562e1d(0x14e)](_0x562e1d(0x161),_0x562e1d(0x178))['action'](async(_0x261a3d,_0x10a76e)=>{const _0x1fa712=_0x562e1d;p(_0x1d7ab1,_0x10a76e);try{let _0x28ab2c=_0x5dda30(_0x261a3d,_0x1fa712(0x180)),_0x12afbf=_0x10a76e['estimateTextSize']===!0x0,_0x52bdc8=await _0x324aad(_0x28ab2c,{'assetResolver':_0x37c533=>({'bytes':_0x5dda30(_0x3a9308(_0x2aa9c3(_0x261a3d),_0x37c533))}),'textMeasurer':_0x12afbf?_0x49bae3:_0x17df32[_0x1fa712(0x15e)]}),_0x3ae45d=_0x12afbf?[..._0x52bdc8['lints'],u]:_0x52bdc8[_0x1fa712(0x163)],_0x309976=_0x10a76e[_0x1fa712(0x17e)]===!0x0?_0x1fa712(0x17e):'replace',_0x588c68=_0x10a76e[_0x1fa712(0x177)]===void 0x0?_0x52bdc8[_0x1fa712(0x159)]:_0x1bc99d(_0x52bdc8['code'],{'page':_0x10a76e[_0x1fa712(0x177)],'mode':_0x309976,..._0x52bdc8['viewport']});if(_0x10a76e['out']!==void 0x0&&_0x52cd5d(_0x10a76e[_0x1fa712(0x16c)],_0x588c68+'\x0a',_0x1fa712(0x180)),_0x10a76e[_0x1fa712(0x15f)]===!0x0){h(_0x1d7ab1,{'code':_0x588c68,'lints':_0x3ae45d,'textMeasure':_0x52bdc8[_0x1fa712(0x152)],'viewport':_0x52bdc8[_0x1fa712(0x157)],'warnings':_0x52bdc8[_0x1fa712(0x15b)],..._0x10a76e[_0x1fa712(0x177)]===void 0x0?{}:{'mode':_0x309976,'page':_0x10a76e[_0x1fa712(0x177)]},..._0x10a76e[_0x1fa712(0x16c)]===void 0x0?{}:{'out':_0x10a76e[_0x1fa712(0x16c)]}});return;}m(_0x1d7ab1,_0x52bdc8[_0x1fa712(0x15b)],_0x3ae45d),_0x10a76e[_0x1fa712(0x16c)]===void 0x0?g(_0x1d7ab1,_0x588c68):g(_0x1d7ab1,_0x1fa712(0x153)+_0x10a76e[_0x1fa712(0x16c)]);}catch(_0x1d18d2){throw _0x529526(_0x1d18d2)&&_0x1d7ab1[_0x1fa712(0x155)](_0x1d18d2['code']+':\x20'+_0x1d18d2[_0x1fa712(0x15c)],{'code':_0x1fa712(0x174),'exitCode':0x1}),_0x1d18d2 instanceof Error&&_0x1d7ab1[_0x1fa712(0x155)](_0x1d18d2['message'],{'code':_0x1fa712(0x174),'exitCode':0x1}),_0x1d18d2;}});return _0x1d7ab1;}function f(_0x3d3d01){const _0x2c4f4a=_0x503b21;let _0x189e2b=Number(_0x3d3d01);if(!Number[_0x2c4f4a(0x17c)](_0x189e2b)||_0x189e2b<0x1)throw new _0x458eb3(_0x2c4f4a(0x170)+_0x3d3d01+'\x22.');return _0x189e2b;}function p(_0x2c1632,_0x31893e){const _0x2feaef=_0x503b21;_0x31893e[_0x2feaef(0x177)]===void 0x0&&(_0x31893e['add']===!0x0||_0x31893e[_0x2feaef(0x16c)]!==void 0x0)&&_0x2c1632[_0x2feaef(0x155)](_0x2feaef(0x165),{'code':'compile-svg.invalid-input','exitCode':0x1});}function m(_0x331bdf,_0x4481b1,_0x31949c){const _0x2c1687=_0x503b21;let _0x34c2af=_0x331bdf[_0x2c1687(0x17a)]();for(let _0x5e3327 of _0x4481b1)_0x34c2af[_0x2c1687(0x156)]?.('warning:\x20'+_0x5e3327+'\x0a');for(let _0x1eec26 of _0x31949c)_0x34c2af[_0x2c1687(0x156)]?.(_0x2c1687(0x14f)+_0x1eec26+'\x0a');(_0x4481b1[_0x2c1687(0x16b)]>0x0||_0x31949c[_0x2c1687(0x16b)]>0x0)&&_0x34c2af['writeErr']?.(_0x2c1687(0x16a));}function h(_0x373c9d,_0x1e31cf){const _0x29b76e=_0x503b21;_0x373c9d[_0x29b76e(0x17a)]()[_0x29b76e(0x16d)]?.(JSON[_0x29b76e(0x150)](_0x1e31cf,null,0x2)+'\x0a');}function _0x203d(_0x979a76,_0x583120){_0x979a76=_0x979a76-0x14e;const _0x4852a9=_0x4852();let _0x203d6b=_0x4852a9[_0x979a76];return _0x203d6b;}function g(_0x14973d,_0x97ad27){_0x14973d['configureOutput']()['writeOut']?.(_0x97ad27+'\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.4.0",
4
+ "version": "1.6.0",
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.4.0"
21
+ "@univer-cli/svg-facade": "1.6.0"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "commander": "^15.0.0"