@univer-cli/svg-facade-command 1.0.0 → 1.0.1

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
- const _0x35ca7c=_0x17b8;(function(_0x584607,_0x14d7c6){const _0x25f268=_0x17b8,_0x3565b2=_0x584607();while(!![]){try{const _0x25e2a6=-parseInt(_0x25f268(0xee))/0x1+parseInt(_0x25f268(0x100))/0x2*(-parseInt(_0x25f268(0xed))/0x3)+-parseInt(_0x25f268(0xff))/0x4*(parseInt(_0x25f268(0xf9))/0x5)+-parseInt(_0x25f268(0xf1))/0x6+-parseInt(_0x25f268(0xe0))/0x7+-parseInt(_0x25f268(0xec))/0x8*(parseInt(_0x25f268(0xd3))/0x9)+parseInt(_0x25f268(0xe1))/0xa;if(_0x25e2a6===_0x14d7c6)break;else _0x3565b2['push'](_0x3565b2['shift']());}catch(_0x2f379f){_0x3565b2['push'](_0x3565b2['shift']());}}}(_0x54b6,0x94ba6));import{readFileSync as _0x3967b8,writeFileSync as _0x284607}from'node:fs';function _0x54b6(){const _0x3648d4=['27478510rgLKpk','write\x20generated\x20code\x20to\x20a\x20file','stringify','code','add','error','compile-svg.failed','configureOutput','--out\x20<path>','SVG\x20source\x20file','estimateTextSize','32LEddKd','234sNHgcn','528448UsKbPX','out','lints','1122798ahKkhv','writeOut','warnings','replace','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','viewport','isInteger','utf8','30zoHfAf','action','warning\x20=\x20unsupported\x20SVG\x20feature\x20degraded;\x20lint\x20=\x20review\x20suggestion,\x20nothing\x20was\x20dropped\x0a','--estimate-text-size','writeErr','page','82464IWSdnr','16906uSJipK','215361LJKhiM','wrap\x20the\x20result\x20for\x20a\x201-based\x20target\x20Slide\x20page','argument','description','Compile\x20SVG\x20into\x20Univer\x20Slide\x20Facade\x20code','overlay\x20onto\x20the\x20target\x20page\x20instead\x20of\x20clearing\x20it\x20first','length','textMeasurer','compile-svg','generated\x20code:\x20','use\x20deterministic\x20text-size\x20estimation\x20instead\x20of\x20the\x20injected\x20measurer','option','Expected\x20an\x20integer\x20>=\x201;\x20received\x20\x22','3810338sWCKgm'];_0x54b6=function(){return _0x3648d4;};return _0x54b6();}import{dirname as _0x224da8,resolve as _0x16dd37}from'node:path';import{builtinTextMeasurer as _0x55b4ea,compileSvgToFacade as _0x3ef72a,isSvgFacadeError as _0xb647dd,wrapSlideScript as _0x446a52}from'@univer-cli/svg-facade';import{Command as _0x385c83,InvalidArgumentError as _0x4b9da2}from'commander';var u=_0x35ca7c(0xf5);function d(_0x488363){const _0x4d277a=_0x35ca7c;let _0x34bb4c=new _0x385c83(_0x4d277a(0xdb))[_0x4d277a(0xd6)](_0x4d277a(0xd7))[_0x4d277a(0xd5)]('<file.svg>',_0x4d277a(0xea))['option']('--json','write\x20structured\x20JSON')['option'](_0x4d277a(0xfc),_0x4d277a(0xdd))[_0x4d277a(0xde)]('--page\x20<number>',_0x4d277a(0xd4),f)[_0x4d277a(0xde)]('--add',_0x4d277a(0xd8))['option'](_0x4d277a(0xe9),_0x4d277a(0xe2))[_0x4d277a(0xfa)](async(_0x32d1ec,_0x2d56d0)=>{const _0x374517=_0x4d277a;p(_0x34bb4c,_0x2d56d0);try{let _0x50e2cf=_0x3967b8(_0x32d1ec,_0x374517(0xf8)),_0x44dde9=_0x2d56d0[_0x374517(0xeb)]===!0x0,_0x5ec471=await _0x3ef72a(_0x50e2cf,{'assetResolver':_0x4dc1bd=>({'bytes':_0x3967b8(_0x16dd37(_0x224da8(_0x32d1ec),_0x4dc1bd))}),'textMeasurer':_0x44dde9?_0x55b4ea:_0x488363[_0x374517(0xda)]}),_0x12111d=_0x44dde9?[..._0x5ec471[_0x374517(0xf0)],u]:_0x5ec471['lints'],_0x132d01=_0x2d56d0[_0x374517(0xe5)]===!0x0?_0x374517(0xe5):_0x374517(0xf4),_0x2f4a9a=_0x2d56d0[_0x374517(0xfe)]===void 0x0?_0x5ec471['code']:_0x446a52(_0x5ec471[_0x374517(0xe4)],{'page':_0x2d56d0['page'],'mode':_0x132d01,..._0x5ec471['viewport']});if(_0x2d56d0[_0x374517(0xef)]!==void 0x0&&_0x284607(_0x2d56d0['out'],_0x2f4a9a+'\x0a',_0x374517(0xf8)),_0x2d56d0['json']===!0x0){h(_0x34bb4c,{'code':_0x2f4a9a,'lints':_0x12111d,'textMeasure':_0x5ec471['textMeasure'],'viewport':_0x5ec471[_0x374517(0xf6)],'warnings':_0x5ec471[_0x374517(0xf3)],..._0x2d56d0['page']===void 0x0?{}:{'mode':_0x132d01,'page':_0x2d56d0[_0x374517(0xfe)]},..._0x2d56d0['out']===void 0x0?{}:{'out':_0x2d56d0[_0x374517(0xef)]}});return;}m(_0x34bb4c,_0x5ec471[_0x374517(0xf3)],_0x12111d),_0x2d56d0[_0x374517(0xef)]===void 0x0?g(_0x34bb4c,_0x2f4a9a):g(_0x34bb4c,_0x374517(0xdc)+_0x2d56d0[_0x374517(0xef)]);}catch(_0x5f574f){throw _0xb647dd(_0x5f574f)&&_0x34bb4c[_0x374517(0xe6)](_0x5f574f['code']+':\x20'+_0x5f574f['message'],{'code':_0x374517(0xe7),'exitCode':0x1}),_0x5f574f instanceof Error&&_0x34bb4c[_0x374517(0xe6)](_0x5f574f['message'],{'code':_0x374517(0xe7),'exitCode':0x1}),_0x5f574f;}});return _0x34bb4c;}function f(_0xc411d8){const _0x10039f=_0x35ca7c;let _0x808d8c=Number(_0xc411d8);if(!Number[_0x10039f(0xf7)](_0x808d8c)||_0x808d8c<0x1)throw new _0x4b9da2(_0x10039f(0xdf)+_0xc411d8+'\x22.');return _0x808d8c;}function p(_0x3b9bba,_0x2c2d80){const _0x4d3d95=_0x35ca7c;_0x2c2d80[_0x4d3d95(0xfe)]===void 0x0&&(_0x2c2d80[_0x4d3d95(0xe5)]===!0x0||_0x2c2d80[_0x4d3d95(0xef)]!==void 0x0)&&_0x3b9bba[_0x4d3d95(0xe6)]('--add\x20and\x20--out\x20require\x20--page\x20<number>.',{'code':'compile-svg.invalid-input','exitCode':0x1});}function _0x17b8(_0x5a990d,_0x590338){_0x5a990d=_0x5a990d-0xd3;const _0x54b67c=_0x54b6();let _0x17b84b=_0x54b67c[_0x5a990d];return _0x17b84b;}function m(_0x416017,_0x47cc7c,_0x1382d9){const _0x2cb04f=_0x35ca7c;let _0x166077=_0x416017['configureOutput']();for(let _0x267e1d of _0x47cc7c)_0x166077[_0x2cb04f(0xfd)]?.('warning:\x20'+_0x267e1d+'\x0a');for(let _0x4eea0b of _0x1382d9)_0x166077['writeErr']?.('lint:\x20'+_0x4eea0b+'\x0a');(_0x47cc7c[_0x2cb04f(0xd9)]>0x0||_0x1382d9[_0x2cb04f(0xd9)]>0x0)&&_0x166077[_0x2cb04f(0xfd)]?.(_0x2cb04f(0xfb));}function h(_0x401f9d,_0x32b158){const _0x5c99a6=_0x35ca7c;_0x401f9d['configureOutput']()[_0x5c99a6(0xf2)]?.(JSON[_0x5c99a6(0xe3)](_0x32b158,null,0x2)+'\x0a');}function g(_0x1bb8c3,_0x257b48){const _0x1c7b46=_0x35ca7c;_0x1bb8c3[_0x1c7b46(0xe8)]()['writeOut']?.(_0x257b48+'\x0a');}export{d as createCompileSvgCommand};
1
+ (function(_0x4a851a,_0xce4c9){const _0x151fbb=_0x54d9,_0x2f7541=_0x4a851a();while(!![]){try{const _0x439fd2=parseInt(_0x151fbb(0x119))/0x1+-parseInt(_0x151fbb(0x113))/0x2+parseInt(_0x151fbb(0x10c))/0x3*(-parseInt(_0x151fbb(0x118))/0x4)+-parseInt(_0x151fbb(0xf0))/0x5+-parseInt(_0x151fbb(0x102))/0x6*(parseInt(_0x151fbb(0x10a))/0x7)+parseInt(_0x151fbb(0x114))/0x8*(parseInt(_0x151fbb(0xff))/0x9)+parseInt(_0x151fbb(0xf8))/0xa;if(_0x439fd2===_0xce4c9)break;else _0x2f7541['push'](_0x2f7541['shift']());}catch(_0x51e8a7){_0x2f7541['push'](_0x2f7541['shift']());}}}(_0x1e08,0x3b5ac));import{readFileSync as _0xac476,writeFileSync as _0x318aec}from'node:fs';import{dirname as _0x515a44,resolve as _0x4e99e0}from'node:path';function _0x1e08(){const _0x2da5ce=['textMeasure','use\x20deterministic\x20text-size\x20estimation\x20instead\x20of\x20the\x20injected\x20measurer','add','1072790ePysgQ','--page\x20<number>','configureOutput','--json','isInteger','overlay\x20onto\x20the\x20target\x20page\x20instead\x20of\x20clearing\x20it\x20first','description','writeOut','1466600xXiKFe','--out\x20<path>','message','compile-svg.failed','warnings','<file.svg>','textMeasurer','9ugXzyr','Compile\x20SVG\x20into\x20Univer\x20Slide\x20Facade\x20code','code','102geSuxR','length','warning:\x20','--add\x20and\x20--out\x20require\x20--page\x20<number>.','lints','page','--add','wrap\x20the\x20result\x20for\x20a\x201-based\x20target\x20Slide\x20page','51548BwOGOo','error','406398tepIwB','replace','warning\x20=\x20unsupported\x20SVG\x20feature\x20degraded;\x20lint\x20=\x20review\x20suggestion,\x20nothing\x20was\x20dropped\x0a','utf8','json','Expected\x20an\x20integer\x20>=\x201;\x20received\x20\x22','argument','275156LQyXpC','2618456AhKCPA','option','out','writeErr','4urXees','381939TsRWRI','--estimate-text-size','action'];_0x1e08=function(){return _0x2da5ce;};return _0x1e08();}import{builtinTextMeasurer as _0x2e0e09,compileSvgToFacade as _0x44eb43,isSvgFacadeError as _0x340c61,wrapSlideScript as _0x2663dd}from'@univer-cli/svg-facade';import{Command as _0x17437e,InvalidArgumentError as _0x3ee90f}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(_0x1cfed2){const _0x57091f=_0x54d9;let _0x1010ab=new _0x17437e('compile-svg')[_0x57091f(0xf6)](_0x57091f(0x100))[_0x57091f(0x112)](_0x57091f(0xfd),'SVG\x20source\x20file')[_0x57091f(0x115)](_0x57091f(0xf3),'write\x20structured\x20JSON')[_0x57091f(0x115)](_0x57091f(0xeb),_0x57091f(0xee))['option'](_0x57091f(0xf1),_0x57091f(0x109),f)[_0x57091f(0x115)](_0x57091f(0x108),_0x57091f(0xf5))[_0x57091f(0x115)](_0x57091f(0xf9),'write\x20generated\x20code\x20to\x20a\x20file')[_0x57091f(0xec)](async(_0xe5c7a6,_0x176e63)=>{const _0x55cee8=_0x57091f;p(_0x1010ab,_0x176e63);try{let _0x30ff64=_0xac476(_0xe5c7a6,'utf8'),_0x1df79a=_0x176e63['estimateTextSize']===!0x0,_0x2f26f3=await _0x44eb43(_0x30ff64,{'assetResolver':_0x3af512=>({'bytes':_0xac476(_0x4e99e0(_0x515a44(_0xe5c7a6),_0x3af512))}),'textMeasurer':_0x1df79a?_0x2e0e09:_0x1cfed2[_0x55cee8(0xfe)]}),_0x24d8c6=_0x1df79a?[..._0x2f26f3['lints'],u]:_0x2f26f3[_0x55cee8(0x106)],_0x4701f5=_0x176e63['add']===!0x0?_0x55cee8(0xef):_0x55cee8(0x10d),_0x9365fb=_0x176e63[_0x55cee8(0x107)]===void 0x0?_0x2f26f3[_0x55cee8(0x101)]:_0x2663dd(_0x2f26f3[_0x55cee8(0x101)],{'page':_0x176e63['page'],'mode':_0x4701f5,..._0x2f26f3['viewport']});if(_0x176e63[_0x55cee8(0x116)]!==void 0x0&&_0x318aec(_0x176e63['out'],_0x9365fb+'\x0a',_0x55cee8(0x10f)),_0x176e63[_0x55cee8(0x110)]===!0x0){h(_0x1010ab,{'code':_0x9365fb,'lints':_0x24d8c6,'textMeasure':_0x2f26f3[_0x55cee8(0xed)],'viewport':_0x2f26f3['viewport'],'warnings':_0x2f26f3[_0x55cee8(0xfc)],..._0x176e63['page']===void 0x0?{}:{'mode':_0x4701f5,'page':_0x176e63['page']},..._0x176e63[_0x55cee8(0x116)]===void 0x0?{}:{'out':_0x176e63[_0x55cee8(0x116)]}});return;}m(_0x1010ab,_0x2f26f3[_0x55cee8(0xfc)],_0x24d8c6),_0x176e63['out']===void 0x0?g(_0x1010ab,_0x9365fb):g(_0x1010ab,'generated\x20code:\x20'+_0x176e63[_0x55cee8(0x116)]);}catch(_0x504211){throw _0x340c61(_0x504211)&&_0x1010ab[_0x55cee8(0x10b)](_0x504211['code']+':\x20'+_0x504211[_0x55cee8(0xfa)],{'code':_0x55cee8(0xfb),'exitCode':0x1}),_0x504211 instanceof Error&&_0x1010ab[_0x55cee8(0x10b)](_0x504211[_0x55cee8(0xfa)],{'code':_0x55cee8(0xfb),'exitCode':0x1}),_0x504211;}});return _0x1010ab;}function f(_0x2eb883){const _0x7d2db6=_0x54d9;let _0x12c212=Number(_0x2eb883);if(!Number[_0x7d2db6(0xf4)](_0x12c212)||_0x12c212<0x1)throw new _0x3ee90f(_0x7d2db6(0x111)+_0x2eb883+'\x22.');return _0x12c212;}function p(_0x2b5fe0,_0x3e9bf9){const _0x1f50b1=_0x54d9;_0x3e9bf9[_0x1f50b1(0x107)]===void 0x0&&(_0x3e9bf9[_0x1f50b1(0xef)]===!0x0||_0x3e9bf9['out']!==void 0x0)&&_0x2b5fe0[_0x1f50b1(0x10b)](_0x1f50b1(0x105),{'code':'compile-svg.invalid-input','exitCode':0x1});}function m(_0x5a0ea9,_0x347685,_0x573d0a){const _0x2a1ed0=_0x54d9;let _0x17790d=_0x5a0ea9['configureOutput']();for(let _0x273b21 of _0x347685)_0x17790d[_0x2a1ed0(0x117)]?.(_0x2a1ed0(0x104)+_0x273b21+'\x0a');for(let _0x51cfb7 of _0x573d0a)_0x17790d[_0x2a1ed0(0x117)]?.('lint:\x20'+_0x51cfb7+'\x0a');(_0x347685[_0x2a1ed0(0x103)]>0x0||_0x573d0a[_0x2a1ed0(0x103)]>0x0)&&_0x17790d['writeErr']?.(_0x2a1ed0(0x10e));}function _0x54d9(_0xf0fe3,_0x9f325a){_0xf0fe3=_0xf0fe3-0xeb;const _0x1e0890=_0x1e08();let _0x54d9e2=_0x1e0890[_0xf0fe3];return _0x54d9e2;}function h(_0x7835aa,_0x232c86){const _0x452cf3=_0x54d9;_0x7835aa[_0x452cf3(0xf2)]()['writeOut']?.(JSON['stringify'](_0x232c86,null,0x2)+'\x0a');}function g(_0x525d02,_0x35af5d){const _0x371d82=_0x54d9;_0x525d02[_0x371d82(0xf2)]()[_0x371d82(0xf7)]?.(_0x35af5d+'\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.0.0",
4
+ "version": "1.0.1",
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.0.0"
21
+ "@univer-cli/svg-facade": "1.0.1"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "commander": "^15.0.0"