@univer-cli/svg-facade-command 1.2.0 → 1.3.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 _0x1973(){const _0x257129=['utf8','1266zUXkZa','viewport','8424072SrHeXc','isInteger','compile-svg','argument','writeErr','option','use\x20deterministic\x20text-size\x20estimation\x20instead\x20of\x20the\x20injected\x20measurer','add','12079136DEWNEH','page','configureOutput','--add\x20and\x20--out\x20require\x20--page\x20<number>.','721KvaCZP','length','estimateTextSize','code','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','1076763gHbMYd','write\x20structured\x20JSON','SVG\x20source\x20file','Expected\x20an\x20integer\x20>=\x201;\x20received\x20\x22','<file.svg>','message','error','generated\x20code:\x20','description','stringify','492MXtdGo','warning\x20=\x20unsupported\x20SVG\x20feature\x20degraded;\x20lint\x20=\x20review\x20suggestion,\x20nothing\x20was\x20dropped\x0a','compile-svg.failed','out','textMeasurer','warning:\x20','4532904bBOwoU','20PemRHO','writeOut','lint:\x20','4237219rVjChF','37780ngiXEe','lints','--estimate-text-size','--json','wrap\x20the\x20result\x20for\x20a\x201-based\x20target\x20Slide\x20page'];_0x1973=function(){return _0x257129;};return _0x1973();}const _0x590d17=_0x3703;(function(_0x4dd3a4,_0x1a49ca){const _0x953a69=_0x3703,_0x190b6b=_0x4dd3a4();while(!![]){try{const _0x5f5b46=-parseInt(_0x953a69(0x128))/0x1*(-parseInt(_0x953a69(0x11a))/0x2)+parseInt(_0x953a69(0x12d))/0x3+-parseInt(_0x953a69(0x109))/0x4*(parseInt(_0x953a69(0x114))/0x5)+parseInt(_0x953a69(0x10f))/0x6+parseInt(_0x953a69(0x113))/0x7+parseInt(_0x953a69(0x124))/0x8+parseInt(_0x953a69(0x11c))/0x9*(-parseInt(_0x953a69(0x110))/0xa);if(_0x5f5b46===_0x1a49ca)break;else _0x190b6b['push'](_0x190b6b['shift']());}catch(_0x58ef85){_0x190b6b['push'](_0x190b6b['shift']());}}}(_0x1973,0xd7f7b));import{readFileSync as _0x37a315,writeFileSync as _0x1f8cb3}from'node:fs';import{dirname as _0x3d0045,resolve as _0x586595}from'node:path';function _0x3703(_0x828d0d,_0xa023de){_0x828d0d=_0x828d0d-0x103;const _0x1973a1=_0x1973();let _0x3703fd=_0x1973a1[_0x828d0d];return _0x3703fd;}import{builtinTextMeasurer as _0x13981e,compileSvgToFacade as _0x3bd710,isSvgFacadeError as _0x430454,wrapSlideScript as _0x524926}from'@univer-cli/svg-facade';import{Command as _0x3525ef,InvalidArgumentError as _0x5cb36f}from'commander';var u=_0x590d17(0x12c);function d(_0x5e0942){const _0x4251a3=_0x590d17;let _0x5ebc24=new _0x3525ef(_0x4251a3(0x11e))[_0x4251a3(0x107)]('Compile\x20SVG\x20into\x20Univer\x20Slide\x20Facade\x20code')[_0x4251a3(0x11f)](_0x4251a3(0x103),_0x4251a3(0x12f))[_0x4251a3(0x121)](_0x4251a3(0x117),_0x4251a3(0x12e))[_0x4251a3(0x121)](_0x4251a3(0x116),_0x4251a3(0x122))[_0x4251a3(0x121)]('--page\x20<number>',_0x4251a3(0x118),f)['option']('--add','overlay\x20onto\x20the\x20target\x20page\x20instead\x20of\x20clearing\x20it\x20first')[_0x4251a3(0x121)]('--out\x20<path>','write\x20generated\x20code\x20to\x20a\x20file')['action'](async(_0x1d6072,_0x15e934)=>{const _0x3a16cd=_0x4251a3;p(_0x5ebc24,_0x15e934);try{let _0x302e7b=_0x37a315(_0x1d6072,_0x3a16cd(0x119)),_0x1b7e13=_0x15e934[_0x3a16cd(0x12a)]===!0x0,_0x74ed5b=await _0x3bd710(_0x302e7b,{'assetResolver':_0x2b7b57=>({'bytes':_0x37a315(_0x586595(_0x3d0045(_0x1d6072),_0x2b7b57))}),'textMeasurer':_0x1b7e13?_0x13981e:_0x5e0942[_0x3a16cd(0x10d)]}),_0x362cce=_0x1b7e13?[..._0x74ed5b[_0x3a16cd(0x115)],u]:_0x74ed5b[_0x3a16cd(0x115)],_0x40ba49=_0x15e934[_0x3a16cd(0x123)]===!0x0?_0x3a16cd(0x123):'replace',_0x5cbffa=_0x15e934[_0x3a16cd(0x125)]===void 0x0?_0x74ed5b[_0x3a16cd(0x12b)]:_0x524926(_0x74ed5b[_0x3a16cd(0x12b)],{'page':_0x15e934[_0x3a16cd(0x125)],'mode':_0x40ba49,..._0x74ed5b[_0x3a16cd(0x11b)]});if(_0x15e934[_0x3a16cd(0x10c)]!==void 0x0&&_0x1f8cb3(_0x15e934[_0x3a16cd(0x10c)],_0x5cbffa+'\x0a',_0x3a16cd(0x119)),_0x15e934['json']===!0x0){h(_0x5ebc24,{'code':_0x5cbffa,'lints':_0x362cce,'textMeasure':_0x74ed5b['textMeasure'],'viewport':_0x74ed5b['viewport'],'warnings':_0x74ed5b['warnings'],..._0x15e934[_0x3a16cd(0x125)]===void 0x0?{}:{'mode':_0x40ba49,'page':_0x15e934[_0x3a16cd(0x125)]},..._0x15e934[_0x3a16cd(0x10c)]===void 0x0?{}:{'out':_0x15e934[_0x3a16cd(0x10c)]}});return;}m(_0x5ebc24,_0x74ed5b['warnings'],_0x362cce),_0x15e934[_0x3a16cd(0x10c)]===void 0x0?g(_0x5ebc24,_0x5cbffa):g(_0x5ebc24,_0x3a16cd(0x106)+_0x15e934['out']);}catch(_0x19acb6){throw _0x430454(_0x19acb6)&&_0x5ebc24[_0x3a16cd(0x105)](_0x19acb6[_0x3a16cd(0x12b)]+':\x20'+_0x19acb6[_0x3a16cd(0x104)],{'code':'compile-svg.failed','exitCode':0x1}),_0x19acb6 instanceof Error&&_0x5ebc24[_0x3a16cd(0x105)](_0x19acb6['message'],{'code':_0x3a16cd(0x10b),'exitCode':0x1}),_0x19acb6;}});return _0x5ebc24;}function f(_0x28f655){const _0x2e7324=_0x590d17;let _0x1d9ee5=Number(_0x28f655);if(!Number[_0x2e7324(0x11d)](_0x1d9ee5)||_0x1d9ee5<0x1)throw new _0x5cb36f(_0x2e7324(0x130)+_0x28f655+'\x22.');return _0x1d9ee5;}function p(_0x7589ed,_0x1c86fa){const _0x3a822b=_0x590d17;_0x1c86fa['page']===void 0x0&&(_0x1c86fa[_0x3a822b(0x123)]===!0x0||_0x1c86fa[_0x3a822b(0x10c)]!==void 0x0)&&_0x7589ed[_0x3a822b(0x105)](_0x3a822b(0x127),{'code':'compile-svg.invalid-input','exitCode':0x1});}function m(_0x192004,_0x358416,_0x545c46){const _0x5b9749=_0x590d17;let _0xdf5f7f=_0x192004[_0x5b9749(0x126)]();for(let _0x57eedd of _0x358416)_0xdf5f7f[_0x5b9749(0x120)]?.(_0x5b9749(0x10e)+_0x57eedd+'\x0a');for(let _0x15ba19 of _0x545c46)_0xdf5f7f['writeErr']?.(_0x5b9749(0x112)+_0x15ba19+'\x0a');(_0x358416['length']>0x0||_0x545c46[_0x5b9749(0x129)]>0x0)&&_0xdf5f7f[_0x5b9749(0x120)]?.(_0x5b9749(0x10a));}function h(_0x3cea,_0x50be0a){const _0x251140=_0x590d17;_0x3cea[_0x251140(0x126)]()[_0x251140(0x111)]?.(JSON[_0x251140(0x108)](_0x50be0a,null,0x2)+'\x0a');}function g(_0xe15b87,_0x48796b){const _0x563084=_0x590d17;_0xe15b87[_0x563084(0x126)]()[_0x563084(0x111)]?.(_0x48796b+'\x0a');}export{d as createCompileSvgCommand};
1
+ const _0x135777=_0x2c60;(function(_0x5dffd6,_0x1099fa){const _0x36d623=_0x2c60,_0x2cad17=_0x5dffd6();while(!![]){try{const _0x1f1c4e=-parseInt(_0x36d623(0xed))/0x1*(parseInt(_0x36d623(0xf8))/0x2)+-parseInt(_0x36d623(0xeb))/0x3+-parseInt(_0x36d623(0xe4))/0x4*(parseInt(_0x36d623(0xdc))/0x5)+parseInt(_0x36d623(0xe3))/0x6*(-parseInt(_0x36d623(0x10b))/0x7)+-parseInt(_0x36d623(0xdf))/0x8*(-parseInt(_0x36d623(0xe8))/0x9)+parseInt(_0x36d623(0xff))/0xa*(-parseInt(_0x36d623(0x105))/0xb)+-parseInt(_0x36d623(0xf0))/0xc*(-parseInt(_0x36d623(0xde))/0xd);if(_0x1f1c4e===_0x1099fa)break;else _0x2cad17['push'](_0x2cad17['shift']());}catch(_0xf1fc2b){_0x2cad17['push'](_0x2cad17['shift']());}}}(_0x1a92,0x70dd8));import{readFileSync as _0x37ab7f,writeFileSync as _0x57a891}from'node:fs';import{dirname as _0x548beb,resolve as _0x1d01dc}from'node:path';import{builtinTextMeasurer as _0x31654c,compileSvgToFacade as _0x163adf,isSvgFacadeError as _0x59c801,wrapSlideScript as _0x947850}from'@univer-cli/svg-facade';import{Command as _0x1e7747,InvalidArgumentError as _0x10d20f}from'commander';var u=_0x135777(0xfe);function _0x2c60(_0x131b40,_0x241d36){_0x131b40=_0x131b40-0xdc;const _0x1a92d1=_0x1a92();let _0x2c6011=_0x1a92d1[_0x131b40];return _0x2c6011;}function _0x1a92(){const _0x5a2dfb=['utf8','overlay\x20onto\x20the\x20target\x20page\x20instead\x20of\x20clearing\x20it\x20first','--add\x20and\x20--out\x20require\x20--page\x20<number>.','json','--json','62111LtfPFD','warning:\x20','--add','40NEWldG','warnings','25367095edWvLn','86512ZKkajg','compile-svg','use\x20deterministic\x20text-size\x20estimation\x20instead\x20of\x20the\x20injected\x20measurer','argument','474JGZxHu','7552nPgEKi','add','lint:\x20','writeErr','171Mowvpd','compile-svg.failed','writeOut','1333695TOQUDW','code','2ZLUzcM','Expected\x20an\x20integer\x20>=\x201;\x20received\x20\x22','--out\x20<path>','12rKJgke','textMeasurer','page','--estimate-text-size','--page\x20<number>','length','write\x20structured\x20JSON','lints','392650rRKsYy','message','textMeasure','option','<file.svg>','isInteger','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','10UUFEHq','estimateTextSize','compile-svg.invalid-input','out','configureOutput','error','1553189FVkCcp'];_0x1a92=function(){return _0x5a2dfb;};return _0x1a92();}function d(_0x36c9eb){const _0x3a8e10=_0x135777;let _0x704161=new _0x1e7747(_0x3a8e10(0xe0))['description']('Compile\x20SVG\x20into\x20Univer\x20Slide\x20Facade\x20code')[_0x3a8e10(0xe2)](_0x3a8e10(0xfc),'SVG\x20source\x20file')[_0x3a8e10(0xfb)](_0x3a8e10(0x10a),_0x3a8e10(0xf6))[_0x3a8e10(0xfb)](_0x3a8e10(0xf3),_0x3a8e10(0xe1))[_0x3a8e10(0xfb)](_0x3a8e10(0xf4),'wrap\x20the\x20result\x20for\x20a\x201-based\x20target\x20Slide\x20page',f)[_0x3a8e10(0xfb)](_0x3a8e10(0x10d),_0x3a8e10(0x107))[_0x3a8e10(0xfb)](_0x3a8e10(0xef),'write\x20generated\x20code\x20to\x20a\x20file')['action'](async(_0x25adad,_0x216eba)=>{const _0xd9e5e6=_0x3a8e10;p(_0x704161,_0x216eba);try{let _0x6a4ef=_0x37ab7f(_0x25adad,_0xd9e5e6(0x106)),_0x5c58b=_0x216eba[_0xd9e5e6(0x100)]===!0x0,_0x240a24=await _0x163adf(_0x6a4ef,{'assetResolver':_0x59809b=>({'bytes':_0x37ab7f(_0x1d01dc(_0x548beb(_0x25adad),_0x59809b))}),'textMeasurer':_0x5c58b?_0x31654c:_0x36c9eb[_0xd9e5e6(0xf1)]}),_0xc00855=_0x5c58b?[..._0x240a24[_0xd9e5e6(0xf7)],u]:_0x240a24[_0xd9e5e6(0xf7)],_0x554520=_0x216eba[_0xd9e5e6(0xe5)]===!0x0?_0xd9e5e6(0xe5):'replace',_0x43b02c=_0x216eba['page']===void 0x0?_0x240a24['code']:_0x947850(_0x240a24[_0xd9e5e6(0xec)],{'page':_0x216eba['page'],'mode':_0x554520,..._0x240a24['viewport']});if(_0x216eba[_0xd9e5e6(0x102)]!==void 0x0&&_0x57a891(_0x216eba['out'],_0x43b02c+'\x0a',_0xd9e5e6(0x106)),_0x216eba[_0xd9e5e6(0x109)]===!0x0){h(_0x704161,{'code':_0x43b02c,'lints':_0xc00855,'textMeasure':_0x240a24[_0xd9e5e6(0xfa)],'viewport':_0x240a24['viewport'],'warnings':_0x240a24[_0xd9e5e6(0xdd)],..._0x216eba['page']===void 0x0?{}:{'mode':_0x554520,'page':_0x216eba[_0xd9e5e6(0xf2)]},..._0x216eba['out']===void 0x0?{}:{'out':_0x216eba[_0xd9e5e6(0x102)]}});return;}m(_0x704161,_0x240a24[_0xd9e5e6(0xdd)],_0xc00855),_0x216eba['out']===void 0x0?g(_0x704161,_0x43b02c):g(_0x704161,'generated\x20code:\x20'+_0x216eba[_0xd9e5e6(0x102)]);}catch(_0x2e3f54){throw _0x59c801(_0x2e3f54)&&_0x704161[_0xd9e5e6(0x104)](_0x2e3f54[_0xd9e5e6(0xec)]+':\x20'+_0x2e3f54['message'],{'code':_0xd9e5e6(0xe9),'exitCode':0x1}),_0x2e3f54 instanceof Error&&_0x704161['error'](_0x2e3f54[_0xd9e5e6(0xf9)],{'code':_0xd9e5e6(0xe9),'exitCode':0x1}),_0x2e3f54;}});return _0x704161;}function f(_0x3ca4c4){const _0x266906=_0x135777;let _0x404c3c=Number(_0x3ca4c4);if(!Number[_0x266906(0xfd)](_0x404c3c)||_0x404c3c<0x1)throw new _0x10d20f(_0x266906(0xee)+_0x3ca4c4+'\x22.');return _0x404c3c;}function p(_0x37377d,_0xf0b6e8){const _0x88f7d4=_0x135777;_0xf0b6e8[_0x88f7d4(0xf2)]===void 0x0&&(_0xf0b6e8['add']===!0x0||_0xf0b6e8[_0x88f7d4(0x102)]!==void 0x0)&&_0x37377d['error'](_0x88f7d4(0x108),{'code':_0x88f7d4(0x101),'exitCode':0x1});}function m(_0x5e0f51,_0x38866c,_0x5e987b){const _0x55cd1b=_0x135777;let _0x4c0598=_0x5e0f51['configureOutput']();for(let _0x2bd762 of _0x38866c)_0x4c0598[_0x55cd1b(0xe7)]?.(_0x55cd1b(0x10c)+_0x2bd762+'\x0a');for(let _0x50a1fc of _0x5e987b)_0x4c0598['writeErr']?.(_0x55cd1b(0xe6)+_0x50a1fc+'\x0a');(_0x38866c[_0x55cd1b(0xf5)]>0x0||_0x5e987b['length']>0x0)&&_0x4c0598[_0x55cd1b(0xe7)]?.('warning\x20=\x20unsupported\x20SVG\x20feature\x20degraded;\x20lint\x20=\x20review\x20suggestion,\x20nothing\x20was\x20dropped\x0a');}function h(_0x14a45f,_0x16c80c){const _0x455d90=_0x135777;_0x14a45f['configureOutput']()[_0x455d90(0xea)]?.(JSON['stringify'](_0x16c80c,null,0x2)+'\x0a');}function g(_0x194470,_0x532efa){const _0x326f48=_0x135777;_0x194470[_0x326f48(0x103)]()[_0x326f48(0xea)]?.(_0x532efa+'\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.2.0",
4
+ "version": "1.3.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.2.0"
21
+ "@univer-cli/svg-facade": "1.3.0"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "commander": "^15.0.0"