@univer-cli/unit-layout-lint-command 1.6.1 → 1.7.0-alpha.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.
- package/dist/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x27a2a8,_0x2ab691){const _0x2a4d1f=_0x3689,_0x2e4dae=_0x27a2a8();while(!![]){try{const _0x597af8=parseInt(_0x2a4d1f(0x105))/0x1+-parseInt(_0x2a4d1f(0x106))/0x2*(parseInt(_0x2a4d1f(0x14e))/0x3)+-parseInt(_0x2a4d1f(0x120))/0x4*(-parseInt(_0x2a4d1f(0x12b))/0x5)+-parseInt(_0x2a4d1f(0x10d))/0x6+-parseInt(_0x2a4d1f(0x119))/0x7+-parseInt(_0x2a4d1f(0x135))/0x8+parseInt(_0x2a4d1f(0x14d))/0x9;if(_0x597af8===_0x2ab691)break;else _0x2e4dae['push'](_0x2e4dae['shift']());}catch(_0x1a6910){_0x2e4dae['push'](_0x2e4dae['shift']());}}}(_0x25a3,0x9b057));import{isUnitLayoutLintError as _0x2275bb}from'@univer-cli/unit-layout-lint';import{Command as _0x3a1273,InvalidArgumentError as _0x1019b6,Option as _0x38d019}from'commander';var i=0x2710,a=class extends Error{constructor(_0x64286){const _0xb99362=_0x3689;super(_0x64286),this[_0xb99362(0x10f)]=_0xb99362(0x138);}};function o(_0x44064b){const _0x9d61f6=_0x3689;let _0x4e17c1=new _0x3a1273(_0x9d61f6(0x147))[_0x9d61f6(0x143)](_0x9d61f6(0x174))[_0x9d61f6(0x113)](_0x9d61f6(0x146),_0x9d61f6(0x164))[_0x9d61f6(0x175)](_0x9d61f6(0x14b),_0x9d61f6(0x16b))[_0x9d61f6(0x10b)](new _0x38d019(_0x9d61f6(0x112),_0x9d61f6(0x13b))[_0x9d61f6(0x168)]([_0x9d61f6(0x14a),'rendered',_0x9d61f6(0x17d)]))[_0x9d61f6(0x175)](_0x9d61f6(0x177),_0x9d61f6(0x118),p)['option'](_0x9d61f6(0x167),_0x9d61f6(0x16d))[_0x9d61f6(0x10b)](new _0x38d019(_0x9d61f6(0x158),_0x9d61f6(0x11a))['choices']([_0x9d61f6(0x128),_0x9d61f6(0x155),'ports',_0x9d61f6(0x117),_0x9d61f6(0x129)]))['option'](_0x9d61f6(0x169),'limit\x20the\x20layout\x20plan\x20to\x20generated\x20element\x20or\x20connector\x20IDs')[_0x9d61f6(0x175)](_0x9d61f6(0x11f),_0x9d61f6(0x140))['option'](_0x9d61f6(0x107),_0x9d61f6(0x116))[_0x9d61f6(0x175)](_0x9d61f6(0x145),'include\x20a\x20read-only\x20native\x20Board\x20automatic\x20port-order\x20plan')[_0x9d61f6(0x175)]('--plan-text\x20<element-id...>',_0x9d61f6(0x144))[_0x9d61f6(0x175)](_0x9d61f6(0x162),_0x9d61f6(0x160),m)[_0x9d61f6(0x14c)](async _0x442aaf=>{const _0x5ac0e8=_0x9d61f6;let _0x4a2c15;try{let _0x5c2821=_0x442aaf['pages']===void 0x0?void 0x0:d(_0x442aaf[_0x5ac0e8(0x171)]),_0x50ca80=await _0x44064b['loadUnit']({'unitId':_0x442aaf['unit']});if(_0x50ca80[_0x5ac0e8(0x15f)]===_0x5ac0e8(0x125)&&(_0x442aaf[_0x5ac0e8(0x110)]!==void 0x0||_0x442aaf[_0x5ac0e8(0x142)]!==void 0x0||_0x442aaf['planIds']!==void 0x0||_0x442aaf['planOptions']!==void 0x0||_0x442aaf[_0x5ac0e8(0x150)]===!0x0||_0x442aaf[_0x5ac0e8(0x154)]===!0x0||_0x442aaf[_0x5ac0e8(0x157)]!==void 0x0||_0x442aaf[_0x5ac0e8(0x134)]!==void 0x0||_0x442aaf[_0x5ac0e8(0x17f)]!==void 0x0))throw new a(_0x5ac0e8(0x16e));if(_0x442aaf['planLabels']===!0x0&&_0x442aaf[_0x5ac0e8(0x110)]===_0x5ac0e8(0x14a))throw new a('--plan-labels\x20requires\x20rendered\x20or\x20both\x20mode');if(_0x442aaf[_0x5ac0e8(0x154)]===!0x0&&_0x442aaf['mode']===_0x5ac0e8(0x14a))throw new a('--plan-ports\x20requires\x20rendered\x20or\x20both\x20mode');let _0x1907a5=s(_0x442aaf);if(_0x442aaf['textWidthGrowth']!==void 0x0&&!_0x1907a5&&!_0x442aaf[_0x5ac0e8(0x157)]?.['length'])throw new a(_0x5ac0e8(0x170));if(_0x442aaf[_0x5ac0e8(0x157)]!==void 0x0&&_0x442aaf[_0x5ac0e8(0x110)]===_0x5ac0e8(0x14a))throw new a(_0x5ac0e8(0x109));if(_0x442aaf['maximumAutomaticLabelDistance']!==void 0x0&&_0x442aaf[_0x5ac0e8(0x110)]===_0x5ac0e8(0x14a))throw new a(_0x5ac0e8(0x11d));_0x4a2c15=await _0x44064b[_0x5ac0e8(0x147)][_0x5ac0e8(0x147)]({..._0x50ca80,..._0x5c2821===void 0x0?{}:{'pages':_0x5c2821},..._0x50ca80[_0x5ac0e8(0x15f)]===_0x5ac0e8(0x179)&&_0x1907a5?{'layoutPlan':_0x1907a5}:{},..._0x50ca80[_0x5ac0e8(0x15f)]===_0x5ac0e8(0x179)&&_0x442aaf[_0x5ac0e8(0x110)]!==void 0x0?{'mode':_0x442aaf[_0x5ac0e8(0x110)]}:{},..._0x50ca80[_0x5ac0e8(0x15f)]===_0x5ac0e8(0x179)&&_0x442aaf[_0x5ac0e8(0x17f)]!==void 0x0?{'maximumAutomaticLabelDistance':_0x442aaf['maximumAutomaticLabelDistance']}:{},..._0x50ca80['unitType']===_0x5ac0e8(0x179)&&_0x442aaf[_0x5ac0e8(0x157)]!==void 0x0?{'textPlanElementIds':_0x442aaf[_0x5ac0e8(0x157)]}:{},..._0x50ca80[_0x5ac0e8(0x15f)]===_0x5ac0e8(0x179)&&!_0x1907a5&&_0x442aaf[_0x5ac0e8(0x134)]!==void 0x0?{'textPlanMaximumWidthGrowth':_0x442aaf['textWidthGrowth']}:{},..._0x50ca80[_0x5ac0e8(0x15f)]===_0x5ac0e8(0x179)&&_0x442aaf[_0x5ac0e8(0x150)]===!0x0?{'includeLabelPlan':!0x0}:{},..._0x50ca80[_0x5ac0e8(0x15f)]===_0x5ac0e8(0x179)&&_0x442aaf[_0x5ac0e8(0x154)]===!0x0?{'includePortPlan':!0x0}:{}});}catch(_0x5b49df){throw(_0x5b49df instanceof a||_0x2275bb(_0x5b49df)||f(_0x5b49df))&&_0x4e17c1[_0x5ac0e8(0x151)](''+(_0x5ac0e8(0x166)in _0x5b49df?String(_0x5b49df[_0x5ac0e8(0x166)])+':\x20':'')+_0x5b49df[_0x5ac0e8(0x173)],{'code':'unit-layout-lint.failed','exitCode':0x1}),_0x5b49df;}let _0x2fa39a=_0x4a2c15[_0x5ac0e8(0x15f)]==='board'&&(!_0x4a2c15[_0x5ac0e8(0x152)][_0x5ac0e8(0x114)]||_0x4a2c15[_0x5ac0e8(0x126)]['some'](({severity:_0x7c9fb3})=>_0x7c9fb3===_0x5ac0e8(0x151)));if(_0x2fa39a&&_0x442aaf['json']===!0x0){let _0x42dab0={..._0x4e17c1[_0x5ac0e8(0x12d)]()};_0x42dab0[_0x5ac0e8(0x13d)]?.(JSON[_0x5ac0e8(0x13e)]({'ok':!0x1,'error':{'code':'UNIT_LAYOUT_LINT_BOARD_FAILED','message':_0x5ac0e8(0x10c),'details':{'report':_0x4a2c15}}})+'\x0a'),_0x4e17c1['configureOutput']({'outputError':()=>{}});try{_0x4e17c1['error'](_0x5ac0e8(0x10c),{'code':_0x5ac0e8(0x141),'exitCode':0x2});}catch(_0x3eeb7f){throw _0x3eeb7f instanceof Error&&Object[_0x5ac0e8(0x178)](_0x3eeb7f,{'details':{'report':_0x4a2c15}}),_0x3eeb7f;}finally{_0x4e17c1['configureOutput'](_0x42dab0);}}_0x4e17c1[_0x5ac0e8(0x12d)]()[_0x5ac0e8(0x15e)]?.((_0x442aaf[_0x5ac0e8(0x115)]===!0x0?JSON[_0x5ac0e8(0x13e)](_0x4a2c15,null,0x2):l(_0x4a2c15))+'\x0a'),_0x2fa39a&&_0x4e17c1[_0x5ac0e8(0x151)](_0x5ac0e8(0x17c),{'code':_0x5ac0e8(0x141),'exitCode':0x2});});return _0x4e17c1;}function s(_0x3ea531){const _0x3b9c3c=_0x3689;let {plan:_0x5b8440,planIds:_0x86415f,planOptions:_0xcb8f3d,textWidthGrowth:_0x43a38e}=_0x3ea531;if(_0xcb8f3d!==void 0x0&&_0x5b8440!==_0x3b9c3c(0x128))throw new a('--plan-options\x20requires\x20--plan\x20graph');if(_0x5b8440===void 0x0){if(_0x86415f!==void 0x0)throw new a(_0x3b9c3c(0x176));return;}if(_0x3ea531[_0x3b9c3c(0x110)]===_0x3b9c3c(0x14a)||_0x3ea531['planLabels']||_0x3ea531[_0x3b9c3c(0x154)]||_0x3ea531[_0x3b9c3c(0x157)])throw new a(_0x3b9c3c(0x15d));if(_0x43a38e!==void 0x0&&_0x5b8440!=='graph'&&_0x5b8440!=='text')throw new a(_0x3b9c3c(0x161));let _0x2bc2db=_0x43a38e===void 0x0?{}:{'maximumWidthGrowth':_0x43a38e};if(_0x5b8440===_0x3b9c3c(0x129)){if(!_0x86415f?.['length'])throw new a('--plan\x20text\x20requires\x20--plan-ids');return{'mode':_0x5b8440,'elementIds':_0x86415f,..._0x2bc2db};}return _0x5b8440===_0x3b9c3c(0x128)?{...c(_0xcb8f3d),'mode':_0x5b8440,..._0x86415f===void 0x0?{}:{'elementIds':_0x86415f},..._0x2bc2db}:{'mode':_0x5b8440,..._0x86415f===void 0x0?{}:{'connectorIds':_0x86415f}};}function c(_0x5bb52f){const _0x402c56=_0x3689;if(_0x5bb52f===void 0x0)return{};let _0x404075=new Set([_0x402c56(0x12e),_0x402c56(0x12f),'itemGap',_0x402c56(0x136),_0x402c56(0x124),_0x402c56(0x122),_0x402c56(0x14f)]),_0x48ae7d;try{_0x48ae7d=JSON[_0x402c56(0x149)](_0x5bb52f);}catch{throw new a(_0x402c56(0x11b));}if(!_0x48ae7d||typeof _0x48ae7d!=_0x402c56(0x15b)||Array[_0x402c56(0x163)](_0x48ae7d)||Object[_0x402c56(0x13f)](_0x48ae7d)[_0x402c56(0x111)](_0x195ba6=>!_0x404075[_0x402c56(0x156)](_0x195ba6)))throw new a(_0x402c56(0x17a));return _0x48ae7d;}function l(_0x54f42b){const _0x21066a=_0x3689;if(_0x54f42b[_0x21066a(0x15f)]==='board'){let _0x40f048=[_0x21066a(0x17e)+_0x54f42b[_0x21066a(0x153)]+'\x20('+String(_0x54f42b[_0x21066a(0x152)]['pages'][_0x21066a(0x165)])+'\x20pages,\x20'+_0x54f42b[_0x21066a(0x110)]+')'];for(let _0xf4cb60 of _0x54f42b['findings'])_0x40f048[_0x21066a(0x12a)](_0x21066a(0x13c)+String(_0xf4cb60[_0x21066a(0x180)])+'\x20\x20'+_0xf4cb60[_0x21066a(0x159)]+'\x20\x20'+_0xf4cb60[_0x21066a(0x13a)]+'\x20\x20'+_0xf4cb60['rule']+'\x20\x20'+_0xf4cb60['id']);for(let _0x5600b5 of _0x54f42b[_0x21066a(0x152)][_0x21066a(0x15c)])_0x40f048['push'](_0x21066a(0x131)+_0x5600b5[_0x21066a(0x123)]+'\x20\x20'+_0x5600b5['source']+'\x20\x20'+_0x5600b5[_0x21066a(0x127)]);for(let _0x134fab of _0x54f42b[_0x21066a(0x152)]['limitations'])_0x40f048['push'](_0x21066a(0x130)+_0x134fab);return _0x40f048[_0x21066a(0x11e)]('\x0a');}if(_0x54f42b[_0x21066a(0x126)][_0x21066a(0x165)]===0x0)return _0x21066a(0x148)+String(_0x54f42b[_0x21066a(0x152)][_0x21066a(0x171)]['length'])+_0x21066a(0x121);let _0x203f19=[_0x21066a(0x11c)+String(_0x54f42b['findings'][_0x21066a(0x165)])+_0x21066a(0x17b)+String(_0x54f42b[_0x21066a(0x152)][_0x21066a(0x171)][_0x21066a(0x165)])+_0x21066a(0x121)];for(let _0x4424c9 of _0x54f42b['findings'])_0x203f19[_0x21066a(0x12a)](_0x21066a(0x13c)+String(_0x4424c9[_0x21066a(0x180)])+'\x20\x20'+_0x4424c9['rule']+'\x20\x20'+_0x4424c9['id']),_0x203f19[_0x21066a(0x12a)]('\x20\x20'+_0x4424c9[_0x21066a(0x137)]);return _0x203f19['join']('\x0a');}function u(_0x52d896){return d(_0x52d896);}function d(_0xfbe706){const _0x310841=_0x3689;if(_0xfbe706[_0x310841(0x133)]()===_0x310841(0x16a))return;if(_0xfbe706['trim']()==='')throw new a(_0x310841(0x15a));let _0x29f413=[];for(let _0xd57c22 of _0xfbe706[_0x310841(0x108)](',')){let _0x149e57=_0xd57c22[_0x310841(0x133)]();if(_0x149e57==='')throw new a(_0x310841(0x10a));let _0x242041=/^(\d+)(?:-(\d+))?$/[_0x310841(0x12c)](_0x149e57);if(_0x242041===null){_0x29f413[_0x310841(0x12a)](_0x149e57);continue;}let _0x384d37=Number(_0x242041[0x1]),_0x1dda46=Number(_0x242041[0x2]??_0x242041[0x1]);if(_0x384d37<0x1||_0x1dda46<_0x384d37)throw new a(_0x310841(0x16c)+_0x149e57);if(_0x29f413[_0x310841(0x165)]+_0x1dda46-_0x384d37+0x1>i)throw new a(_0x310841(0x172));for(let _0x551cb2=_0x384d37;_0x551cb2<=_0x1dda46;_0x551cb2+=0x1)_0x29f413['push'](_0x551cb2);}return _0x29f413;}function _0x3689(_0x33ab4a,_0x505d58){_0x33ab4a=_0x33ab4a-0x105;const _0x25a3b4=_0x25a3();let _0x368948=_0x25a3b4[_0x33ab4a];return _0x368948;}function f(_0x5c81d8){const _0x30fd8c=_0x3689;return _0x5c81d8 instanceof Error&&typeof _0x5c81d8[_0x30fd8c(0x166)]==_0x30fd8c(0x132);}function p(_0x445f3b){const _0x4f5273=_0x3689;let _0x69a0df=Number(_0x445f3b);if(_0x445f3b['trim']()===''||!Number[_0x4f5273(0x10e)](_0x69a0df)||_0x69a0df<0x0)throw new _0x1019b6(_0x4f5273(0x139));return _0x69a0df;}function m(_0x17e741){const _0x44c39f=_0x3689;let _0x830c70=Number(_0x17e741);if(_0x17e741['trim']()===''||!Number[_0x44c39f(0x10e)](_0x830c70)||_0x830c70<0x1||_0x830c70>0x2)throw new _0x1019b6(_0x44c39f(0x16f));return _0x830c70;}export{a as UnitLayoutLintCommandInputError,o as createUnitLayoutLintCommand,u as parseUnitLayoutLintPages,l as renderUnitLayoutLint};function _0x25a3(){const _0x523adf=['--mode\x20<mode>','requiredOption','complete','json','include\x20a\x20read-only\x20measured\x20Board\x20label\x20repair\x20plan','labels','require\x20native\x20automatic\x20Board\x20labels\x20within\x20this\x20distance\x20of\x20their\x20rendered\x20stroke','4435557XknfdX','include\x20a\x20read-only\x20native\x20Board\x20layout\x20plan','--plan-options\x20must\x20contain\x20a\x20JSON\x20object','Slide\x20layout\x20lint:\x20','--maximum-automatic-label-distance\x20requires\x20rendered\x20or\x20both\x20mode','join','--plan-options\x20<json>','326104HxqkPS','\x20pages\x20checked)','fixedElementIds','pageId','maxNodes','slide','findings','reason','graph','text','push','10BjTWMF','exec','configureOutput','direction','layerGap','coverage:\x20','incomplete\x20\x20','string','trim','textWidthGrowth','6535664FiKlmN','origin','detail','UnitLayoutLintCommandInputError','must\x20be\x20a\x20finite\x20non-negative\x20number\x20of\x20Board\x20units','severity','Board\x20analysis\x20mode\x20(default:\x20both)','page\x20','writeErr','stringify','keys','set\x20graph\x20layout\x20options\x20as\x20a\x20JSON\x20object','UNIT_LAYOUT_LINT_BOARD_FAILED','plan','description','include\x20a\x20read-only\x20measured\x20text-size\x20plan\x20for\x20selected\x20generated\x20Board\x20shapes','--plan-ports','--unit\x20<unit-id>','lint','Slide\x20layout\x20lint:\x20no\x20findings\x20(','parse','model','--pages\x20<pages>','action','29495943Luvuhp','462jdexkm','feedbackConnectorIds','planLabels','error','coverage','status','planPorts','routes','has','planText','--plan\x20<mode>','source','--pages\x20cannot\x20be\x20empty','object','incomplete','--plan\x20requires\x20rendered\x20or\x20both\x20mode\x20and\x20cannot\x20be\x20combined\x20with\x20another\x20plan','writeOut','unitType','limit\x20text\x20sizing\x20width\x20growth\x20to\x20a\x20finite\x20ratio\x20from\x201\x20to\x202\x20for\x20graph\x20or\x20text\x20planning','--text-width-growth\x20requires\x20graph\x20or\x20text\x20planning','--text-width-growth\x20<ratio>','isArray','Slide\x20or\x20Board\x20Unit\x20to\x20lint','length','code','--json','choices','--plan-ids\x20<id...>','all','Pages\x20or\x20page\x20IDs,\x20for\x20example\x201,3-5,cover','Invalid\x20page\x20selector:\x20','write\x20the\x20complete\x20lint\x20report\x20as\x20JSON','--mode,\x20--plan,\x20--plan-ids,\x20--plan-options,\x20--plan-labels,\x20--plan-ports,\x20--plan-text,\x20--text-width-growth\x20and\x20--maximum-automatic-label-distance\x20are\x20only\x20supported\x20for\x20Board\x20Units','must\x20be\x20a\x20finite\x20ratio\x20from\x201\x20to\x202','--text-width-growth\x20requires\x20--plan-text\x20or\x20--plan\x20graph/text','pages','--pages\x20expands\x20to\x20too\x20many\x20pages','message','Lint\x20Slide\x20or\x20Board\x20layout\x20with\x20SDK\x20geometry\x20evidence','option','--plan-ids\x20requires\x20--plan','--maximum-automatic-label-distance\x20<board-units>','assign','board','--plan-options\x20accepts\x20direction,\x20layerGap,\x20itemGap,\x20origin,\x20maxNodes,\x20fixedElementIds\x20and\x20feedbackConnectorIds','\x20findings\x20(','Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage;\x20see\x20the\x20report','both','Board\x20layout\x20lint:\x20','maximumAutomaticLabelDistance','page','685881IDcazj','14836GerZht','--plan-labels','split','--plan-text\x20requires\x20rendered\x20or\x20both\x20mode','--pages\x20contains\x20an\x20empty\x20selector','addOption','Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage','5389872bLxvgK','isFinite','name','mode','some'];_0x25a3=function(){return _0x523adf;};return _0x25a3();}
|
|
1
|
+
(function(_0x44a485,_0x322361){const _0x39a109=_0x42db,_0x22a693=_0x44a485();while(!![]){try{const _0x344efd=parseInt(_0x39a109(0x1b1))/0x1*(parseInt(_0x39a109(0x185))/0x2)+parseInt(_0x39a109(0x16b))/0x3*(parseInt(_0x39a109(0x199))/0x4)+-parseInt(_0x39a109(0x1cb))/0x5*(-parseInt(_0x39a109(0x1be))/0x6)+parseInt(_0x39a109(0x1cc))/0x7*(-parseInt(_0x39a109(0x17a))/0x8)+-parseInt(_0x39a109(0x1a9))/0x9*(parseInt(_0x39a109(0x174))/0xa)+parseInt(_0x39a109(0x1b4))/0xb*(-parseInt(_0x39a109(0x1a7))/0xc)+parseInt(_0x39a109(0x1b2))/0xd*(parseInt(_0x39a109(0x176))/0xe);if(_0x344efd===_0x322361)break;else _0x22a693['push'](_0x22a693['shift']());}catch(_0x16931a){_0x22a693['push'](_0x22a693['shift']());}}}(_0x43a8,0x43fe9));import{isUnitLayoutLintError as _0x27a230}from'@univer-cli/unit-layout-lint';import{Command as _0x14234b,InvalidArgumentError as _0x447374,Option as _0x5c87f6}from'commander';function _0x43a8(){const _0x344856=['unit-layout-lint.failed','--plan-options\x20<json>','graph','maximumAutomaticLabelDistance','4239OulLfx','309972NUJCRO','--text-width-growth\x20requires\x20graph\x20or\x20text\x20planning','11oODvbM','page\x20','text','page','all','choices','mode','limitations','unit','--plan-options\x20must\x20contain\x20a\x20JSON\x20object','1378686rDCxfI','join','--pages\x20contains\x20an\x20empty\x20selector','pages','--mode\x20<mode>','error','trim','Slide\x20layout\x20lint:\x20','detail','limit\x20the\x20layout\x20plan\x20to\x20generated\x20element\x20or\x20connector\x20IDs','reason','planIds','--plan-text\x20<element-id...>','5VitUfv','7JmZvOl','json','action','set\x20graph\x20layout\x20options\x20as\x20a\x20JSON\x20object','keys','source','--mode,\x20--plan,\x20--plan-ids,\x20--plan-options,\x20--plan-labels,\x20--plan-ports,\x20--plan-text,\x20--text-width-growth\x20and\x20--maximum-automatic-label-distance\x20are\x20only\x20supported\x20for\x20Board\x20Units','both','Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage;\x20see\x20the\x20report','--plan-ports','board','Invalid\x20page\x20selector:\x20','rule','isFinite','description','--pages\x20cannot\x20be\x20empty','--plan-labels','textWidthGrowth','--plan-text\x20requires\x20rendered\x20or\x20both\x20mode','--plan\x20requires\x20rendered\x20or\x20both\x20mode\x20and\x20cannot\x20be\x20combined\x20with\x20another\x20plan','requiredOption','code','planLabels','include\x20a\x20read-only\x20native\x20Board\x20automatic\x20port-order\x20plan','Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage','24sRTsGu','configureOutput','some','write\x20the\x20complete\x20lint\x20report\x20as\x20JSON','include\x20a\x20read-only\x20measured\x20text-size\x20plan\x20for\x20selected\x20generated\x20Board\x20shapes','lint','plan','Pages\x20or\x20page\x20IDs,\x20for\x20example\x201,3-5,cover','\x20pages\x20checked)','51020yvwjKX','--text-width-growth\x20<ratio>','392WKrSGy','Slide\x20or\x20Board\x20Unit\x20to\x20lint','UNIT_LAYOUT_LINT_BOARD_FAILED','coverage','3946632tbxJBU','--json','model','writeOut','unitType','parse','writeErr','require\x20native\x20automatic\x20Board\x20labels\x20within\x20this\x20distance\x20of\x20their\x20rendered\x20stroke','--pages\x20expands\x20to\x20too\x20many\x20pages','--maximum-automatic-label-distance\x20requires\x20rendered\x20or\x20both\x20mode','feedbackConnectorIds','38ikOeLM','--plan-ids\x20requires\x20--plan','routes','addOption','itemGap','coverage:\x20','direction','--text-width-growth\x20requires\x20--plan-text\x20or\x20--plan\x20graph/text','--plan-ports\x20requires\x20rendered\x20or\x20both\x20mode','include\x20a\x20read-only\x20measured\x20Board\x20label\x20repair\x20plan','findings','--plan-labels\x20requires\x20rendered\x20or\x20both\x20mode','\x20findings\x20(','option','stringify','--maximum-automatic-label-distance\x20<board-units>','--pages\x20<pages>','has','push','pageId','117792HpWeVE','status','length','object','--plan-options\x20accepts\x20direction,\x20layerGap,\x20itemGap,\x20origin,\x20maxNodes,\x20fixedElementIds\x20and\x20feedbackConnectorIds','severity','message','planPorts','assign','include\x20a\x20read-only\x20native\x20Board\x20layout\x20plan','planText','Board\x20layout\x20lint:\x20','split','must\x20be\x20a\x20finite\x20non-negative\x20number\x20of\x20Board\x20units','1933128YRyAae','exec','495GGvwzs','--plan-options\x20requires\x20--plan\x20graph','limit\x20text\x20sizing\x20width\x20growth\x20to\x20a\x20finite\x20ratio\x20from\x201\x20to\x202\x20for\x20graph\x20or\x20text\x20planning','fixedElementIds'];_0x43a8=function(){return _0x344856;};return _0x43a8();}var i=0x2710,a=class extends Error{constructor(_0x48fe0c){super(_0x48fe0c),this['name']='UnitLayoutLintCommandInputError';}};function o(_0x4cccb7){const _0x2ee072=_0x42db;let _0x9664a9=new _0x14234b(_0x2ee072(0x170))[_0x2ee072(0x1da)]('Lint\x20Slide\x20or\x20Board\x20layout\x20with\x20SDK\x20geometry\x20evidence')[_0x2ee072(0x166)]('--unit\x20<unit-id>',_0x2ee072(0x177))[_0x2ee072(0x192)](_0x2ee072(0x195),_0x2ee072(0x172))['addOption'](new _0x5c87f6(_0x2ee072(0x1c2),'Board\x20analysis\x20mode\x20(default:\x20both)')[_0x2ee072(0x1b9)]([_0x2ee072(0x17c),'rendered',_0x2ee072(0x1d3)]))[_0x2ee072(0x192)](_0x2ee072(0x194),_0x2ee072(0x181),p)[_0x2ee072(0x192)](_0x2ee072(0x17b),_0x2ee072(0x16e))[_0x2ee072(0x188)](new _0x5c87f6('--plan\x20<mode>',_0x2ee072(0x1a2))[_0x2ee072(0x1b9)]([_0x2ee072(0x1af),_0x2ee072(0x187),'ports','labels',_0x2ee072(0x1b6)]))[_0x2ee072(0x192)]('--plan-ids\x20<id...>',_0x2ee072(0x1c7))[_0x2ee072(0x192)](_0x2ee072(0x1ae),_0x2ee072(0x1cf))['option'](_0x2ee072(0x162),_0x2ee072(0x18e))[_0x2ee072(0x192)](_0x2ee072(0x1d5),_0x2ee072(0x169))[_0x2ee072(0x192)](_0x2ee072(0x1ca),_0x2ee072(0x16f))['option'](_0x2ee072(0x175),_0x2ee072(0x1ab),m)[_0x2ee072(0x1ce)](async _0x50440c=>{const _0x18c209=_0x2ee072;let _0x5179a8;try{let _0x544e0b=_0x50440c[_0x18c209(0x1c1)]===void 0x0?void 0x0:d(_0x50440c[_0x18c209(0x1c1)]),_0x2815b2=await _0x4cccb7['loadUnit']({'unitId':_0x50440c[_0x18c209(0x1bc)]});if(_0x2815b2['unitType']==='slide'&&(_0x50440c['mode']!==void 0x0||_0x50440c[_0x18c209(0x171)]!==void 0x0||_0x50440c[_0x18c209(0x1c9)]!==void 0x0||_0x50440c['planOptions']!==void 0x0||_0x50440c[_0x18c209(0x168)]===!0x0||_0x50440c[_0x18c209(0x1a0)]===!0x0||_0x50440c[_0x18c209(0x1a3)]!==void 0x0||_0x50440c[_0x18c209(0x163)]!==void 0x0||_0x50440c[_0x18c209(0x1b0)]!==void 0x0))throw new a(_0x18c209(0x1d2));if(_0x50440c[_0x18c209(0x168)]===!0x0&&_0x50440c[_0x18c209(0x1ba)]===_0x18c209(0x17c))throw new a(_0x18c209(0x190));if(_0x50440c[_0x18c209(0x1a0)]===!0x0&&_0x50440c[_0x18c209(0x1ba)]===_0x18c209(0x17c))throw new a(_0x18c209(0x18d));let _0xb0d9f6=s(_0x50440c);if(_0x50440c['textWidthGrowth']!==void 0x0&&!_0xb0d9f6&&!_0x50440c[_0x18c209(0x1a3)]?.[_0x18c209(0x19b)])throw new a(_0x18c209(0x18c));if(_0x50440c[_0x18c209(0x1a3)]!==void 0x0&&_0x50440c[_0x18c209(0x1ba)]==='model')throw new a(_0x18c209(0x164));if(_0x50440c[_0x18c209(0x1b0)]!==void 0x0&&_0x50440c[_0x18c209(0x1ba)]===_0x18c209(0x17c))throw new a(_0x18c209(0x183));_0x5179a8=await _0x4cccb7[_0x18c209(0x170)][_0x18c209(0x170)]({..._0x2815b2,..._0x544e0b===void 0x0?{}:{'pages':_0x544e0b},..._0x2815b2['unitType']==='board'&&_0xb0d9f6?{'layoutPlan':_0xb0d9f6}:{},..._0x2815b2[_0x18c209(0x17e)]==='board'&&_0x50440c[_0x18c209(0x1ba)]!==void 0x0?{'mode':_0x50440c[_0x18c209(0x1ba)]}:{},..._0x2815b2[_0x18c209(0x17e)]===_0x18c209(0x1d6)&&_0x50440c[_0x18c209(0x1b0)]!==void 0x0?{'maximumAutomaticLabelDistance':_0x50440c[_0x18c209(0x1b0)]}:{},..._0x2815b2[_0x18c209(0x17e)]==='board'&&_0x50440c[_0x18c209(0x1a3)]!==void 0x0?{'textPlanElementIds':_0x50440c['planText']}:{},..._0x2815b2[_0x18c209(0x17e)]===_0x18c209(0x1d6)&&!_0xb0d9f6&&_0x50440c[_0x18c209(0x163)]!==void 0x0?{'textPlanMaximumWidthGrowth':_0x50440c[_0x18c209(0x163)]}:{},..._0x2815b2[_0x18c209(0x17e)]===_0x18c209(0x1d6)&&_0x50440c[_0x18c209(0x168)]===!0x0?{'includeLabelPlan':!0x0}:{},..._0x2815b2[_0x18c209(0x17e)]==='board'&&_0x50440c[_0x18c209(0x1a0)]===!0x0?{'includePortPlan':!0x0}:{}});}catch(_0x5a0cb0){throw(_0x5a0cb0 instanceof a||_0x27a230(_0x5a0cb0)||f(_0x5a0cb0))&&_0x9664a9['error'](''+(_0x18c209(0x167)in _0x5a0cb0?String(_0x5a0cb0[_0x18c209(0x167)])+':\x20':'')+_0x5a0cb0[_0x18c209(0x19f)],{'code':_0x18c209(0x1ad),'exitCode':0x1}),_0x5a0cb0;}let _0x46b658=_0x5179a8[_0x18c209(0x17e)]===_0x18c209(0x1d6)&&(!_0x5179a8[_0x18c209(0x179)]['complete']||_0x5179a8[_0x18c209(0x18f)][_0x18c209(0x16d)](({severity:_0x14cf93})=>_0x14cf93===_0x18c209(0x1c3)));if(_0x46b658&&_0x50440c[_0x18c209(0x1cd)]===!0x0){let _0x34aef0={..._0x9664a9['configureOutput']()};_0x34aef0[_0x18c209(0x180)]?.(JSON[_0x18c209(0x193)]({'ok':!0x1,'error':{'code':_0x18c209(0x178),'message':_0x18c209(0x16a),'details':{'report':_0x5179a8}}})+'\x0a'),_0x9664a9[_0x18c209(0x16c)]({'outputError':()=>{}});try{_0x9664a9[_0x18c209(0x1c3)]('Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage',{'code':_0x18c209(0x178),'exitCode':0x2});}catch(_0x288e51){throw _0x288e51 instanceof Error&&Object[_0x18c209(0x1a1)](_0x288e51,{'details':{'report':_0x5179a8}}),_0x288e51;}finally{_0x9664a9[_0x18c209(0x16c)](_0x34aef0);}}_0x9664a9[_0x18c209(0x16c)]()[_0x18c209(0x17d)]?.((_0x50440c[_0x18c209(0x1cd)]===!0x0?JSON[_0x18c209(0x193)](_0x5179a8,null,0x2):l(_0x5179a8))+'\x0a'),_0x46b658&&_0x9664a9[_0x18c209(0x1c3)](_0x18c209(0x1d4),{'code':'UNIT_LAYOUT_LINT_BOARD_FAILED','exitCode':0x2});});return _0x9664a9;}function s(_0x172d2c){const _0x376517=_0x42db;let {plan:_0x1d59ba,planIds:_0x5d2204,planOptions:_0xe8eec5,textWidthGrowth:_0x1fdfc5}=_0x172d2c;if(_0xe8eec5!==void 0x0&&_0x1d59ba!=='graph')throw new a(_0x376517(0x1aa));if(_0x1d59ba===void 0x0){if(_0x5d2204!==void 0x0)throw new a(_0x376517(0x186));return;}if(_0x172d2c[_0x376517(0x1ba)]===_0x376517(0x17c)||_0x172d2c['planLabels']||_0x172d2c[_0x376517(0x1a0)]||_0x172d2c[_0x376517(0x1a3)])throw new a(_0x376517(0x165));if(_0x1fdfc5!==void 0x0&&_0x1d59ba!==_0x376517(0x1af)&&_0x1d59ba!==_0x376517(0x1b6))throw new a(_0x376517(0x1b3));let _0x452bb1=_0x1fdfc5===void 0x0?{}:{'maximumWidthGrowth':_0x1fdfc5};if(_0x1d59ba===_0x376517(0x1b6)){if(!_0x5d2204?.[_0x376517(0x19b)])throw new a('--plan\x20text\x20requires\x20--plan-ids');return{'mode':_0x1d59ba,'elementIds':_0x5d2204,..._0x452bb1};}return _0x1d59ba===_0x376517(0x1af)?{...c(_0xe8eec5),'mode':_0x1d59ba,..._0x5d2204===void 0x0?{}:{'elementIds':_0x5d2204},..._0x452bb1}:{'mode':_0x1d59ba,..._0x5d2204===void 0x0?{}:{'connectorIds':_0x5d2204}};}function c(_0x3dfe2e){const _0x3ad736=_0x42db;if(_0x3dfe2e===void 0x0)return{};let _0x1655f7=new Set([_0x3ad736(0x18b),'layerGap',_0x3ad736(0x189),'origin','maxNodes',_0x3ad736(0x1ac),_0x3ad736(0x184)]),_0x566cc7;try{_0x566cc7=JSON[_0x3ad736(0x17f)](_0x3dfe2e);}catch{throw new a(_0x3ad736(0x1bd));}if(!_0x566cc7||typeof _0x566cc7!=_0x3ad736(0x19c)||Array['isArray'](_0x566cc7)||Object[_0x3ad736(0x1d0)](_0x566cc7)[_0x3ad736(0x16d)](_0x263b2c=>!_0x1655f7[_0x3ad736(0x196)](_0x263b2c)))throw new a(_0x3ad736(0x19d));return _0x566cc7;}function l(_0x4b7ec0){const _0x3f354b=_0x42db;if(_0x4b7ec0[_0x3f354b(0x17e)]==='board'){let _0x1e31a2=[_0x3f354b(0x1a4)+_0x4b7ec0[_0x3f354b(0x19a)]+'\x20('+String(_0x4b7ec0['coverage'][_0x3f354b(0x1c1)][_0x3f354b(0x19b)])+'\x20pages,\x20'+_0x4b7ec0[_0x3f354b(0x1ba)]+')'];for(let _0x48c3a1 of _0x4b7ec0[_0x3f354b(0x18f)])_0x1e31a2[_0x3f354b(0x197)](_0x3f354b(0x1b5)+String(_0x48c3a1['page'])+'\x20\x20'+_0x48c3a1[_0x3f354b(0x1d1)]+'\x20\x20'+_0x48c3a1[_0x3f354b(0x19e)]+'\x20\x20'+_0x48c3a1[_0x3f354b(0x1d8)]+'\x20\x20'+_0x48c3a1['id']);for(let _0x9e6c7f of _0x4b7ec0[_0x3f354b(0x179)]['incomplete'])_0x1e31a2[_0x3f354b(0x197)]('incomplete\x20\x20'+_0x9e6c7f[_0x3f354b(0x198)]+'\x20\x20'+_0x9e6c7f['source']+'\x20\x20'+_0x9e6c7f[_0x3f354b(0x1c8)]);for(let _0x3402c6 of _0x4b7ec0[_0x3f354b(0x179)][_0x3f354b(0x1bb)])_0x1e31a2['push'](_0x3f354b(0x18a)+_0x3402c6);return _0x1e31a2[_0x3f354b(0x1bf)]('\x0a');}if(_0x4b7ec0['findings'][_0x3f354b(0x19b)]===0x0)return'Slide\x20layout\x20lint:\x20no\x20findings\x20('+String(_0x4b7ec0[_0x3f354b(0x179)][_0x3f354b(0x1c1)][_0x3f354b(0x19b)])+_0x3f354b(0x173);let _0x395e6b=[_0x3f354b(0x1c5)+String(_0x4b7ec0[_0x3f354b(0x18f)][_0x3f354b(0x19b)])+_0x3f354b(0x191)+String(_0x4b7ec0[_0x3f354b(0x179)][_0x3f354b(0x1c1)][_0x3f354b(0x19b)])+_0x3f354b(0x173)];for(let _0x53102e of _0x4b7ec0[_0x3f354b(0x18f)])_0x395e6b[_0x3f354b(0x197)]('page\x20'+String(_0x53102e[_0x3f354b(0x1b7)])+'\x20\x20'+_0x53102e[_0x3f354b(0x1d8)]+'\x20\x20'+_0x53102e['id']),_0x395e6b[_0x3f354b(0x197)]('\x20\x20'+_0x53102e[_0x3f354b(0x1c6)]);return _0x395e6b[_0x3f354b(0x1bf)]('\x0a');}function u(_0x5e6adf){return d(_0x5e6adf);}function d(_0x34749a){const _0x4483c2=_0x42db;if(_0x34749a[_0x4483c2(0x1c4)]()===_0x4483c2(0x1b8))return;if(_0x34749a[_0x4483c2(0x1c4)]()==='')throw new a(_0x4483c2(0x161));let _0x310475=[];for(let _0xe5e0c4 of _0x34749a[_0x4483c2(0x1a5)](',')){let _0x30db7b=_0xe5e0c4[_0x4483c2(0x1c4)]();if(_0x30db7b==='')throw new a(_0x4483c2(0x1c0));let _0x13c4ce=/^(\d+)(?:-(\d+))?$/[_0x4483c2(0x1a8)](_0x30db7b);if(_0x13c4ce===null){_0x310475[_0x4483c2(0x197)](_0x30db7b);continue;}let _0x595cb7=Number(_0x13c4ce[0x1]),_0x4a7f80=Number(_0x13c4ce[0x2]??_0x13c4ce[0x1]);if(_0x595cb7<0x1||_0x4a7f80<_0x595cb7)throw new a(_0x4483c2(0x1d7)+_0x30db7b);if(_0x310475[_0x4483c2(0x19b)]+_0x4a7f80-_0x595cb7+0x1>i)throw new a(_0x4483c2(0x182));for(let _0x9bc5b=_0x595cb7;_0x9bc5b<=_0x4a7f80;_0x9bc5b+=0x1)_0x310475[_0x4483c2(0x197)](_0x9bc5b);}return _0x310475;}function f(_0x1028e5){const _0x340035=_0x42db;return _0x1028e5 instanceof Error&&typeof _0x1028e5[_0x340035(0x167)]=='string';}function p(_0x1002c4){const _0x2e0430=_0x42db;let _0x4c62ba=Number(_0x1002c4);if(_0x1002c4['trim']()===''||!Number['isFinite'](_0x4c62ba)||_0x4c62ba<0x0)throw new _0x447374(_0x2e0430(0x1a6));return _0x4c62ba;}function m(_0x2a1c5c){const _0x30141d=_0x42db;let _0x2da98d=Number(_0x2a1c5c);if(_0x2a1c5c[_0x30141d(0x1c4)]()===''||!Number[_0x30141d(0x1d9)](_0x2da98d)||_0x2da98d<0x1||_0x2da98d>0x2)throw new _0x447374('must\x20be\x20a\x20finite\x20ratio\x20from\x201\x20to\x202');return _0x2da98d;}function _0x42db(_0x1382fb,_0x32882b){_0x1382fb=_0x1382fb-0x161;const _0x43a8c7=_0x43a8();let _0x42db5c=_0x43a8c7[_0x1382fb];return _0x42db5c;}export{a as UnitLayoutLintCommandInputError,o as createUnitLayoutLintCommand,u as parseUnitLayoutLintPages,l as renderUnitLayoutLint};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univer-cli/unit-layout-lint-command",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.7.0-alpha.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/unit-layout-lint": "1.
|
|
21
|
+
"@univer-cli/unit-layout-lint": "1.7.0-alpha.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"commander": "^15.0.0"
|