@univer-cli/svg-facade-command 1.0.2 → 1.0.3

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 _0x19f908=_0x2470;(function(_0x2d5504,_0x10905a){const _0x28c790=_0x2470,_0x24e9fb=_0x2d5504();while(!![]){try{const _0x107163=parseInt(_0x28c790(0x15d))/0x1*(parseInt(_0x28c790(0x166))/0x2)+parseInt(_0x28c790(0x150))/0x3+-parseInt(_0x28c790(0x151))/0x4+-parseInt(_0x28c790(0x156))/0x5+parseInt(_0x28c790(0x158))/0x6+parseInt(_0x28c790(0x169))/0x7+parseInt(_0x28c790(0x15a))/0x8*(-parseInt(_0x28c790(0x168))/0x9);if(_0x107163===_0x10905a)break;else _0x24e9fb['push'](_0x24e9fb['shift']());}catch(_0x452c51){_0x24e9fb['push'](_0x24e9fb['shift']());}}}(_0x2baa,0xef081));import{readFileSync as _0x32f85c,writeFileSync as _0x2da844}from'node:fs';import{dirname as _0x2538d6,resolve as _0x1bf106}from'node:path';import{builtinTextMeasurer as _0x2bbeee,compileSvgToFacade as _0x519807,isSvgFacadeError as _0x4ca889,wrapSlideScript as _0x137897}from'@univer-cli/svg-facade';function _0x2470(_0x44dbab,_0x22d8d0){_0x44dbab=_0x44dbab-0x14e;const _0x2baa7e=_0x2baa();let _0x247057=_0x2baa7e[_0x44dbab];return _0x247057;}import{Command as _0x4129d8,InvalidArgumentError as _0x4b8710}from'commander';var u=_0x19f908(0x178);function d(_0x48d2f1){const _0x3ac84f=_0x19f908;let _0x3525ae=new _0x4129d8(_0x3ac84f(0x153))[_0x3ac84f(0x152)]('Compile\x20SVG\x20into\x20Univer\x20Slide\x20Facade\x20code')[_0x3ac84f(0x16c)]('<file.svg>','SVG\x20source\x20file')[_0x3ac84f(0x163)](_0x3ac84f(0x177),_0x3ac84f(0x16d))[_0x3ac84f(0x163)]('--estimate-text-size',_0x3ac84f(0x165))[_0x3ac84f(0x163)](_0x3ac84f(0x15b),'wrap\x20the\x20result\x20for\x20a\x201-based\x20target\x20Slide\x20page',f)[_0x3ac84f(0x163)]('--add','overlay\x20onto\x20the\x20target\x20page\x20instead\x20of\x20clearing\x20it\x20first')[_0x3ac84f(0x163)](_0x3ac84f(0x16b),'write\x20generated\x20code\x20to\x20a\x20file')[_0x3ac84f(0x173)](async(_0x52e14a,_0x2b099c)=>{const _0xc42bd6=_0x3ac84f;p(_0x3525ae,_0x2b099c);try{let _0x592cbc=_0x32f85c(_0x52e14a,_0xc42bd6(0x154)),_0x307940=_0x2b099c['estimateTextSize']===!0x0,_0x4d893c=await _0x519807(_0x592cbc,{'assetResolver':_0xfa8430=>({'bytes':_0x32f85c(_0x1bf106(_0x2538d6(_0x52e14a),_0xfa8430))}),'textMeasurer':_0x307940?_0x2bbeee:_0x48d2f1[_0xc42bd6(0x15c)]}),_0x242cb6=_0x307940?[..._0x4d893c['lints'],u]:_0x4d893c[_0xc42bd6(0x159)],_0xf53e9d=_0x2b099c[_0xc42bd6(0x15f)]===!0x0?_0xc42bd6(0x15f):'replace',_0x4634bc=_0x2b099c[_0xc42bd6(0x157)]===void 0x0?_0x4d893c['code']:_0x137897(_0x4d893c[_0xc42bd6(0x14f)],{'page':_0x2b099c[_0xc42bd6(0x157)],'mode':_0xf53e9d,..._0x4d893c['viewport']});if(_0x2b099c[_0xc42bd6(0x170)]!==void 0x0&&_0x2da844(_0x2b099c[_0xc42bd6(0x170)],_0x4634bc+'\x0a',_0xc42bd6(0x154)),_0x2b099c[_0xc42bd6(0x16f)]===!0x0){h(_0x3525ae,{'code':_0x4634bc,'lints':_0x242cb6,'textMeasure':_0x4d893c[_0xc42bd6(0x176)],'viewport':_0x4d893c[_0xc42bd6(0x179)],'warnings':_0x4d893c[_0xc42bd6(0x172)],..._0x2b099c[_0xc42bd6(0x157)]===void 0x0?{}:{'mode':_0xf53e9d,'page':_0x2b099c['page']},..._0x2b099c[_0xc42bd6(0x170)]===void 0x0?{}:{'out':_0x2b099c[_0xc42bd6(0x170)]}});return;}m(_0x3525ae,_0x4d893c[_0xc42bd6(0x172)],_0x242cb6),_0x2b099c[_0xc42bd6(0x170)]===void 0x0?g(_0x3525ae,_0x4634bc):g(_0x3525ae,'generated\x20code:\x20'+_0x2b099c[_0xc42bd6(0x170)]);}catch(_0x4a14a1){throw _0x4ca889(_0x4a14a1)&&_0x3525ae[_0xc42bd6(0x155)](_0x4a14a1[_0xc42bd6(0x14f)]+':\x20'+_0x4a14a1[_0xc42bd6(0x175)],{'code':_0xc42bd6(0x161),'exitCode':0x1}),_0x4a14a1 instanceof Error&&_0x3525ae['error'](_0x4a14a1['message'],{'code':'compile-svg.failed','exitCode':0x1}),_0x4a14a1;}});return _0x3525ae;}function f(_0x302768){const _0x494d65=_0x19f908;let _0x544fa8=Number(_0x302768);if(!Number['isInteger'](_0x544fa8)||_0x544fa8<0x1)throw new _0x4b8710(_0x494d65(0x14e)+_0x302768+'\x22.');return _0x544fa8;}function _0x2baa(){const _0x1a24b1=['utf8','error','6096060TRSMLE','page','4068768VuSXmn','lints','1377528PymEbs','--page\x20<number>','textMeasurer','225733VOgZTF','writeErr','add','warning\x20=\x20unsupported\x20SVG\x20feature\x20degraded;\x20lint\x20=\x20review\x20suggestion,\x20nothing\x20was\x20dropped\x0a','compile-svg.failed','warning:\x20','option','lint:\x20','use\x20deterministic\x20text-size\x20estimation\x20instead\x20of\x20the\x20injected\x20measurer','10tSyYkO','stringify','81WGDqmq','2933154DRKZAX','configureOutput','--out\x20<path>','argument','write\x20structured\x20JSON','compile-svg.invalid-input','json','out','length','warnings','action','--add\x20and\x20--out\x20require\x20--page\x20<number>.','message','textMeasure','--json','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','Expected\x20an\x20integer\x20>=\x201;\x20received\x20\x22','code','5693610RwKvZm','1502724hensml','description','compile-svg'];_0x2baa=function(){return _0x1a24b1;};return _0x2baa();}function p(_0x43bab0,_0x1368f3){const _0x29c327=_0x19f908;_0x1368f3['page']===void 0x0&&(_0x1368f3[_0x29c327(0x15f)]===!0x0||_0x1368f3[_0x29c327(0x170)]!==void 0x0)&&_0x43bab0[_0x29c327(0x155)](_0x29c327(0x174),{'code':_0x29c327(0x16e),'exitCode':0x1});}function m(_0x5a9127,_0x119915,_0x15509b){const _0x16aad4=_0x19f908;let _0x4f62ae=_0x5a9127[_0x16aad4(0x16a)]();for(let _0x3854b3 of _0x119915)_0x4f62ae[_0x16aad4(0x15e)]?.(_0x16aad4(0x162)+_0x3854b3+'\x0a');for(let _0x381eb1 of _0x15509b)_0x4f62ae[_0x16aad4(0x15e)]?.(_0x16aad4(0x164)+_0x381eb1+'\x0a');(_0x119915[_0x16aad4(0x171)]>0x0||_0x15509b[_0x16aad4(0x171)]>0x0)&&_0x4f62ae[_0x16aad4(0x15e)]?.(_0x16aad4(0x160));}function h(_0x35d347,_0x4b3034){const _0x11bc61=_0x19f908;_0x35d347[_0x11bc61(0x16a)]()['writeOut']?.(JSON[_0x11bc61(0x167)](_0x4b3034,null,0x2)+'\x0a');}function g(_0x5f3283,_0x572ac3){const _0x2ee536=_0x19f908;_0x5f3283[_0x2ee536(0x16a)]()['writeOut']?.(_0x572ac3+'\x0a');}export{d as createCompileSvgCommand};
1
+ const _0x9cfecc=_0x2f67;(function(_0xd6201c,_0x25de79){const _0x5164de=_0x2f67,_0x41036a=_0xd6201c();while(!![]){try{const _0x2b97c6=-parseInt(_0x5164de(0x1ce))/0x1*(parseInt(_0x5164de(0x1d1))/0x2)+-parseInt(_0x5164de(0x1ca))/0x3*(parseInt(_0x5164de(0x1d9))/0x4)+-parseInt(_0x5164de(0x1c2))/0x5+parseInt(_0x5164de(0x1be))/0x6+parseInt(_0x5164de(0x1e2))/0x7*(-parseInt(_0x5164de(0x1bb))/0x8)+-parseInt(_0x5164de(0x1dc))/0x9+parseInt(_0x5164de(0x1c7))/0xa;if(_0x2b97c6===_0x25de79)break;else _0x41036a['push'](_0x41036a['shift']());}catch(_0x479a2a){_0x41036a['push'](_0x41036a['shift']());}}}(_0xf79d,0xb83de));import{readFileSync as _0x517009,writeFileSync as _0x124859}from'node:fs';function _0x2f67(_0x12d0ec,_0x28ce42){_0x12d0ec=_0x12d0ec-0x1b3;const _0xf79d67=_0xf79d();let _0x2f6727=_0xf79d67[_0x12d0ec];return _0x2f6727;}function _0xf79d(){const _0x4b2951=['3788Movxsz','code','compile-svg.invalid-input','662NpLzrL','write\x20structured\x20JSON','--page\x20<number>','argument','<file.svg>','configureOutput','--json','generated\x20code:\x20','184396cjUxhW','lints','action','6808005bvuFcd','write\x20generated\x20code\x20to\x20a\x20file','page','overlay\x20onto\x20the\x20target\x20page\x20instead\x20of\x20clearing\x20it\x20first','--add\x20and\x20--out\x20require\x20--page\x20<number>.','--estimate-text-size','168OUxGDA','option','message','stringify','--out\x20<path>','compile-svg.failed','error','warning\x20=\x20unsupported\x20SVG\x20feature\x20degraded;\x20lint\x20=\x20review\x20suggestion,\x20nothing\x20was\x20dropped\x0a','writeOut','replace','isInteger','utf8','377928ugftyV','out','--add','836244lTrbnr','compile-svg','length','Expected\x20an\x20integer\x20>=\x201;\x20received\x20\x22','5846165uvUoQL','warnings','description','estimateTextSize','textMeasure','49746690VzvfjH','add','writeErr','3uXHbsl','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','Compile\x20SVG\x20into\x20Univer\x20Slide\x20Facade\x20code'];_0xf79d=function(){return _0x4b2951;};return _0xf79d();}import{dirname as _0x343c6f,resolve as _0x3f9683}from'node:path';import{builtinTextMeasurer as _0x1cebce,compileSvgToFacade as _0x364a06,isSvgFacadeError as _0x127578,wrapSlideScript as _0x5167ff}from'@univer-cli/svg-facade';import{Command as _0x5a9e00,InvalidArgumentError as _0x248a18}from'commander';var u=_0x9cfecc(0x1cb);function d(_0x5af5c3){const _0x5506cf=_0x9cfecc;let _0x32b261=new _0x5a9e00(_0x5506cf(0x1bf))[_0x5506cf(0x1c4)](_0x5506cf(0x1cd))[_0x5506cf(0x1d4)](_0x5506cf(0x1d5),'SVG\x20source\x20file')['option'](_0x5506cf(0x1d7),_0x5506cf(0x1d2))[_0x5506cf(0x1e3)](_0x5506cf(0x1e1),'use\x20deterministic\x20text-size\x20estimation\x20instead\x20of\x20the\x20injected\x20measurer')['option'](_0x5506cf(0x1d3),'wrap\x20the\x20result\x20for\x20a\x201-based\x20target\x20Slide\x20page',f)[_0x5506cf(0x1e3)](_0x5506cf(0x1bd),_0x5506cf(0x1df))[_0x5506cf(0x1e3)](_0x5506cf(0x1b3),_0x5506cf(0x1dd))[_0x5506cf(0x1db)](async(_0x278668,_0x1becff)=>{const _0xb2a0a2=_0x5506cf;p(_0x32b261,_0x1becff);try{let _0x3b907=_0x517009(_0x278668,_0xb2a0a2(0x1ba)),_0x691e27=_0x1becff[_0xb2a0a2(0x1c5)]===!0x0,_0x152bed=await _0x364a06(_0x3b907,{'assetResolver':_0x29060f=>({'bytes':_0x517009(_0x3f9683(_0x343c6f(_0x278668),_0x29060f))}),'textMeasurer':_0x691e27?_0x1cebce:_0x5af5c3['textMeasurer']}),_0x14a7ea=_0x691e27?[..._0x152bed['lints'],u]:_0x152bed[_0xb2a0a2(0x1da)],_0x1f8d28=_0x1becff[_0xb2a0a2(0x1c8)]===!0x0?_0xb2a0a2(0x1c8):_0xb2a0a2(0x1b8),_0xa747e8=_0x1becff[_0xb2a0a2(0x1de)]===void 0x0?_0x152bed[_0xb2a0a2(0x1cf)]:_0x5167ff(_0x152bed[_0xb2a0a2(0x1cf)],{'page':_0x1becff['page'],'mode':_0x1f8d28,..._0x152bed[_0xb2a0a2(0x1cc)]});if(_0x1becff[_0xb2a0a2(0x1bc)]!==void 0x0&&_0x124859(_0x1becff[_0xb2a0a2(0x1bc)],_0xa747e8+'\x0a',_0xb2a0a2(0x1ba)),_0x1becff['json']===!0x0){h(_0x32b261,{'code':_0xa747e8,'lints':_0x14a7ea,'textMeasure':_0x152bed[_0xb2a0a2(0x1c6)],'viewport':_0x152bed[_0xb2a0a2(0x1cc)],'warnings':_0x152bed[_0xb2a0a2(0x1c3)],..._0x1becff[_0xb2a0a2(0x1de)]===void 0x0?{}:{'mode':_0x1f8d28,'page':_0x1becff['page']},..._0x1becff[_0xb2a0a2(0x1bc)]===void 0x0?{}:{'out':_0x1becff[_0xb2a0a2(0x1bc)]}});return;}m(_0x32b261,_0x152bed[_0xb2a0a2(0x1c3)],_0x14a7ea),_0x1becff['out']===void 0x0?g(_0x32b261,_0xa747e8):g(_0x32b261,_0xb2a0a2(0x1d8)+_0x1becff[_0xb2a0a2(0x1bc)]);}catch(_0x1b4015){throw _0x127578(_0x1b4015)&&_0x32b261[_0xb2a0a2(0x1b5)](_0x1b4015[_0xb2a0a2(0x1cf)]+':\x20'+_0x1b4015['message'],{'code':_0xb2a0a2(0x1b4),'exitCode':0x1}),_0x1b4015 instanceof Error&&_0x32b261[_0xb2a0a2(0x1b5)](_0x1b4015[_0xb2a0a2(0x1e4)],{'code':_0xb2a0a2(0x1b4),'exitCode':0x1}),_0x1b4015;}});return _0x32b261;}function f(_0x294d7c){const _0x191d93=_0x9cfecc;let _0x1023e1=Number(_0x294d7c);if(!Number[_0x191d93(0x1b9)](_0x1023e1)||_0x1023e1<0x1)throw new _0x248a18(_0x191d93(0x1c1)+_0x294d7c+'\x22.');return _0x1023e1;}function p(_0x552ef6,_0x5c69fc){const _0x1f608d=_0x9cfecc;_0x5c69fc[_0x1f608d(0x1de)]===void 0x0&&(_0x5c69fc[_0x1f608d(0x1c8)]===!0x0||_0x5c69fc[_0x1f608d(0x1bc)]!==void 0x0)&&_0x552ef6[_0x1f608d(0x1b5)](_0x1f608d(0x1e0),{'code':_0x1f608d(0x1d0),'exitCode':0x1});}function m(_0x37cd54,_0x82535a,_0x45d543){const _0x2823e0=_0x9cfecc;let _0x50274e=_0x37cd54['configureOutput']();for(let _0x227fd4 of _0x82535a)_0x50274e[_0x2823e0(0x1c9)]?.('warning:\x20'+_0x227fd4+'\x0a');for(let _0x293b4c of _0x45d543)_0x50274e['writeErr']?.('lint:\x20'+_0x293b4c+'\x0a');(_0x82535a[_0x2823e0(0x1c0)]>0x0||_0x45d543[_0x2823e0(0x1c0)]>0x0)&&_0x50274e[_0x2823e0(0x1c9)]?.(_0x2823e0(0x1b6));}function h(_0x4d1b9e,_0x18c53f){const _0x10c2f9=_0x9cfecc;_0x4d1b9e[_0x10c2f9(0x1d6)]()['writeOut']?.(JSON[_0x10c2f9(0x1e5)](_0x18c53f,null,0x2)+'\x0a');}function g(_0x3a5b20,_0x3e4a47){const _0x994860=_0x9cfecc;_0x3a5b20['configureOutput']()[_0x994860(0x1b7)]?.(_0x3e4a47+'\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.2",
4
+ "version": "1.0.3",
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.2"
21
+ "@univer-cli/svg-facade": "1.0.3"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "commander": "^15.0.0"