@univer-cli/unit-layout-lint-command 1.6.2 → 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 _0xcca4(){const _0x445cde=['action','Slide\x20layout\x20lint:\x20','model','assign','error','pages','1763140bHtEKG','planOptions','--mode\x20<mode>','UnitLayoutLintCommandInputError','addOption','maximumAutomaticLabelDistance','--plan\x20<mode>','rule','lint','direction','pageId','88cXCeiK','3TVwWeh','ports','parse','rendered','Slide\x20or\x20Board\x20Unit\x20to\x20lint','2745470kUCHSB','--text-width-growth\x20<ratio>','origin','41073168QZfjAj','--maximum-automatic-label-distance\x20<board-units>','incomplete\x20\x20','--plan\x20text\x20requires\x20--plan-ids','board','set\x20graph\x20layout\x20options\x20as\x20a\x20JSON\x20object','--plan-options\x20accepts\x20direction,\x20layerGap,\x20itemGap,\x20origin,\x20maxNodes,\x20fixedElementIds\x20and\x20feedbackConnectorIds','Board\x20layout\x20lint:\x20','join','14pVcluv','loadUnit','writeErr','--plan-options\x20must\x20contain\x20a\x20JSON\x20object','--unit\x20<unit-id>','page\x20','length','--plan-labels','1482608VbzAzW','planPorts','requiredOption','exec','\x20pages\x20checked)','push','Lint\x20Slide\x20or\x20Board\x20layout\x20with\x20SDK\x20geometry\x20evidence','status','code','has','must\x20be\x20a\x20finite\x20ratio\x20from\x201\x20to\x202','page','unit','some','--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','--plan-ids\x20<id...>','graph','object','include\x20a\x20read-only\x20native\x20Board\x20layout\x20plan','configureOutput','coverage','Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage;\x20see\x20the\x20report','limit\x20text\x20sizing\x20width\x20growth\x20to\x20a\x20finite\x20ratio\x20from\x201\x20to\x202\x20for\x20graph\x20or\x20text\x20planning','--plan\x20requires\x20rendered\x20or\x20both\x20mode\x20and\x20cannot\x20be\x20combined\x20with\x20another\x20plan','text','Pages\x20or\x20page\x20IDs,\x20for\x20example\x201,3-5,cover','stringify','--plan-labels\x20requires\x20rendered\x20or\x20both\x20mode','planLabels','require\x20native\x20automatic\x20Board\x20labels\x20within\x20this\x20distance\x20of\x20their\x20rendered\x20stroke','both','string','plan','coverage:\x20','writeOut','textWidthGrowth','9454527clJdHK','name','6IMczxb','feedbackConnectorIds','findings','--pages\x20cannot\x20be\x20empty','include\x20a\x20read-only\x20native\x20Board\x20automatic\x20port-order\x20plan','--plan-ports\x20requires\x20rendered\x20or\x20both\x20mode','write\x20the\x20complete\x20lint\x20report\x20as\x20JSON','description','include\x20a\x20read-only\x20measured\x20text-size\x20plan\x20for\x20selected\x20generated\x20Board\x20shapes','trim','reason','fixedElementIds','unitType','choices','limit\x20the\x20layout\x20plan\x20to\x20generated\x20element\x20or\x20connector\x20IDs','must\x20be\x20a\x20finite\x20non-negative\x20number\x20of\x20Board\x20units','Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage','include\x20a\x20read-only\x20measured\x20Board\x20label\x20repair\x20plan','388JvSbNW','complete','source','--plan-text\x20requires\x20rendered\x20or\x20both\x20mode','option','\x20findings\x20(','--json','mode','779704MmJdoZ','planText','isFinite','split','limitations','UNIT_LAYOUT_LINT_BOARD_FAILED','--pages\x20expands\x20to\x20too\x20many\x20pages','4208UbtuuL','planIds','json','--text-width-growth\x20requires\x20--plan-text\x20or\x20--plan\x20graph/text'];_0xcca4=function(){return _0x445cde;};return _0xcca4();}(function(_0x2552ed,_0x4c10be){const _0x37a1de=_0x4b92,_0x5bb1b3=_0x2552ed();while(!![]){try{const _0x49ae70=parseInt(_0x37a1de(0x134))/0x1*(parseInt(_0x37a1de(0x125))/0x2)+parseInt(_0x37a1de(0x14a))/0x3*(parseInt(_0x37a1de(0xed))/0x4)+parseInt(_0x37a1de(0x14f))/0x5*(parseInt(_0x37a1de(0x113))/0x6)+parseInt(_0x37a1de(0xe5))/0x7*(parseInt(_0x37a1de(0x12d))/0x8)+parseInt(_0x37a1de(0x111))/0x9+-parseInt(_0x37a1de(0x13e))/0xa*(-parseInt(_0x37a1de(0x149))/0xb)+-parseInt(_0x37a1de(0xdc))/0xc;if(_0x49ae70===_0x4c10be)break;else _0x5bb1b3['push'](_0x5bb1b3['shift']());}catch(_0x31862b){_0x5bb1b3['push'](_0x5bb1b3['shift']());}}}(_0xcca4,0xeca3b));import{isUnitLayoutLintError as _0x472053}from'@univer-cli/unit-layout-lint';function _0x4b92(_0x2cf3d1,_0x20c258){_0x2cf3d1=_0x2cf3d1-0xdb;const _0xcca45e=_0xcca4();let _0x4b92d0=_0xcca45e[_0x2cf3d1];return _0x4b92d0;}import{Command as _0x165d17,InvalidArgumentError as _0x420daa,Option as _0x52902c}from'commander';var i=0x2710,a=class extends Error{constructor(_0x191630){const _0x1b7fd2=_0x4b92;super(_0x191630),this[_0x1b7fd2(0x112)]=_0x1b7fd2(0x141);}};function o(_0x4c1a2f){const _0x4cb469=_0x4b92;let _0x40613c=new _0x165d17('lint')[_0x4cb469(0x11a)](_0x4cb469(0xf3))[_0x4cb469(0xef)](_0x4cb469(0xe9),_0x4cb469(0x14e))['option']('--pages\x20<pages>',_0x4cb469(0x106))[_0x4cb469(0x142)](new _0x52902c(_0x4cb469(0x140),'Board\x20analysis\x20mode\x20(default:\x20both)')[_0x4cb469(0x120)](['model',_0x4cb469(0x14d),_0x4cb469(0x10b)]))[_0x4cb469(0x129)](_0x4cb469(0xdd),_0x4cb469(0x10a),p)[_0x4cb469(0x129)](_0x4cb469(0x12b),_0x4cb469(0x119))[_0x4cb469(0x142)](new _0x52902c(_0x4cb469(0x144),_0x4cb469(0xff))['choices'](['graph','routes',_0x4cb469(0x14b),'labels','text']))['option'](_0x4cb469(0xfc),_0x4cb469(0x121))[_0x4cb469(0x129)]('--plan-options\x20<json>',_0x4cb469(0xe1))[_0x4cb469(0x129)](_0x4cb469(0xec),_0x4cb469(0x124))[_0x4cb469(0x129)]('--plan-ports',_0x4cb469(0x117))[_0x4cb469(0x129)]('--plan-text\x20<element-id...>',_0x4cb469(0x11b))[_0x4cb469(0x129)](_0x4cb469(0x150),_0x4cb469(0x103),m)[_0x4cb469(0x138)](async _0x23508e=>{const _0x30455f=_0x4cb469;let _0x1f6d9b;try{let _0x1de09c=_0x23508e[_0x30455f(0x13d)]===void 0x0?void 0x0:d(_0x23508e[_0x30455f(0x13d)]),_0x598358=await _0x4c1a2f[_0x30455f(0xe6)]({'unitId':_0x23508e[_0x30455f(0xf9)]});if(_0x598358['unitType']==='slide'&&(_0x23508e[_0x30455f(0x12c)]!==void 0x0||_0x23508e[_0x30455f(0x10d)]!==void 0x0||_0x23508e[_0x30455f(0x135)]!==void 0x0||_0x23508e[_0x30455f(0x13f)]!==void 0x0||_0x23508e[_0x30455f(0x109)]===!0x0||_0x23508e[_0x30455f(0xee)]===!0x0||_0x23508e[_0x30455f(0x12e)]!==void 0x0||_0x23508e[_0x30455f(0x110)]!==void 0x0||_0x23508e[_0x30455f(0x143)]!==void 0x0))throw new a(_0x30455f(0xfb));if(_0x23508e['planLabels']===!0x0&&_0x23508e['mode']===_0x30455f(0x13a))throw new a(_0x30455f(0x108));if(_0x23508e[_0x30455f(0xee)]===!0x0&&_0x23508e['mode']===_0x30455f(0x13a))throw new a(_0x30455f(0x118));let _0x39c575=s(_0x23508e);if(_0x23508e[_0x30455f(0x110)]!==void 0x0&&!_0x39c575&&!_0x23508e['planText']?.[_0x30455f(0xeb)])throw new a(_0x30455f(0x137));if(_0x23508e['planText']!==void 0x0&&_0x23508e[_0x30455f(0x12c)]===_0x30455f(0x13a))throw new a(_0x30455f(0x128));if(_0x23508e[_0x30455f(0x143)]!==void 0x0&&_0x23508e[_0x30455f(0x12c)]===_0x30455f(0x13a))throw new a('--maximum-automatic-label-distance\x20requires\x20rendered\x20or\x20both\x20mode');_0x1f6d9b=await _0x4c1a2f[_0x30455f(0x146)][_0x30455f(0x146)]({..._0x598358,..._0x1de09c===void 0x0?{}:{'pages':_0x1de09c},..._0x598358[_0x30455f(0x11f)]===_0x30455f(0xe0)&&_0x39c575?{'layoutPlan':_0x39c575}:{},..._0x598358[_0x30455f(0x11f)]===_0x30455f(0xe0)&&_0x23508e['mode']!==void 0x0?{'mode':_0x23508e[_0x30455f(0x12c)]}:{},..._0x598358[_0x30455f(0x11f)]===_0x30455f(0xe0)&&_0x23508e['maximumAutomaticLabelDistance']!==void 0x0?{'maximumAutomaticLabelDistance':_0x23508e[_0x30455f(0x143)]}:{},..._0x598358['unitType']===_0x30455f(0xe0)&&_0x23508e[_0x30455f(0x12e)]!==void 0x0?{'textPlanElementIds':_0x23508e[_0x30455f(0x12e)]}:{},..._0x598358['unitType']===_0x30455f(0xe0)&&!_0x39c575&&_0x23508e[_0x30455f(0x110)]!==void 0x0?{'textPlanMaximumWidthGrowth':_0x23508e[_0x30455f(0x110)]}:{},..._0x598358[_0x30455f(0x11f)]===_0x30455f(0xe0)&&_0x23508e['planLabels']===!0x0?{'includeLabelPlan':!0x0}:{},..._0x598358['unitType']===_0x30455f(0xe0)&&_0x23508e['planPorts']===!0x0?{'includePortPlan':!0x0}:{}});}catch(_0x5a0ff9){throw(_0x5a0ff9 instanceof a||_0x472053(_0x5a0ff9)||f(_0x5a0ff9))&&_0x40613c[_0x30455f(0x13c)](''+(_0x30455f(0xf5)in _0x5a0ff9?String(_0x5a0ff9[_0x30455f(0xf5)])+':\x20':'')+_0x5a0ff9['message'],{'code':'unit-layout-lint.failed','exitCode':0x1}),_0x5a0ff9;}let _0x1119f4=_0x1f6d9b[_0x30455f(0x11f)]===_0x30455f(0xe0)&&(!_0x1f6d9b[_0x30455f(0x101)][_0x30455f(0x126)]||_0x1f6d9b[_0x30455f(0x115)][_0x30455f(0xfa)](({severity:_0x558401})=>_0x558401===_0x30455f(0x13c)));if(_0x1119f4&&_0x23508e[_0x30455f(0x136)]===!0x0){let _0x16c73d={..._0x40613c[_0x30455f(0x100)]()};_0x16c73d[_0x30455f(0xe7)]?.(JSON[_0x30455f(0x107)]({'ok':!0x1,'error':{'code':_0x30455f(0x132),'message':'Board\x20layout\x20lint\x20has\x20errors\x20or\x20incomplete\x20coverage','details':{'report':_0x1f6d9b}}})+'\x0a'),_0x40613c['configureOutput']({'outputError':()=>{}});try{_0x40613c['error'](_0x30455f(0x123),{'code':'UNIT_LAYOUT_LINT_BOARD_FAILED','exitCode':0x2});}catch(_0x318f6b){throw _0x318f6b instanceof Error&&Object[_0x30455f(0x13b)](_0x318f6b,{'details':{'report':_0x1f6d9b}}),_0x318f6b;}finally{_0x40613c[_0x30455f(0x100)](_0x16c73d);}}_0x40613c['configureOutput']()[_0x30455f(0x10f)]?.((_0x23508e[_0x30455f(0x136)]===!0x0?JSON['stringify'](_0x1f6d9b,null,0x2):l(_0x1f6d9b))+'\x0a'),_0x1119f4&&_0x40613c[_0x30455f(0x13c)](_0x30455f(0x102),{'code':_0x30455f(0x132),'exitCode':0x2});});return _0x40613c;}function s(_0xead148){const _0x34e20a=_0x4b92;let {plan:_0x4ef0aa,planIds:_0x45f966,planOptions:_0x63ca0e,textWidthGrowth:_0x4f2591}=_0xead148;if(_0x63ca0e!==void 0x0&&_0x4ef0aa!==_0x34e20a(0xfd))throw new a('--plan-options\x20requires\x20--plan\x20graph');if(_0x4ef0aa===void 0x0){if(_0x45f966!==void 0x0)throw new a('--plan-ids\x20requires\x20--plan');return;}if(_0xead148[_0x34e20a(0x12c)]==='model'||_0xead148['planLabels']||_0xead148[_0x34e20a(0xee)]||_0xead148['planText'])throw new a(_0x34e20a(0x104));if(_0x4f2591!==void 0x0&&_0x4ef0aa!==_0x34e20a(0xfd)&&_0x4ef0aa!==_0x34e20a(0x105))throw new a('--text-width-growth\x20requires\x20graph\x20or\x20text\x20planning');let _0x1133e8=_0x4f2591===void 0x0?{}:{'maximumWidthGrowth':_0x4f2591};if(_0x4ef0aa==='text'){if(!_0x45f966?.[_0x34e20a(0xeb)])throw new a(_0x34e20a(0xdf));return{'mode':_0x4ef0aa,'elementIds':_0x45f966,..._0x1133e8};}return _0x4ef0aa===_0x34e20a(0xfd)?{...c(_0x63ca0e),'mode':_0x4ef0aa,..._0x45f966===void 0x0?{}:{'elementIds':_0x45f966},..._0x1133e8}:{'mode':_0x4ef0aa,..._0x45f966===void 0x0?{}:{'connectorIds':_0x45f966}};}function c(_0x406069){const _0x774b42=_0x4b92;if(_0x406069===void 0x0)return{};let _0x2f90f5=new Set([_0x774b42(0x147),'layerGap','itemGap',_0x774b42(0xdb),'maxNodes',_0x774b42(0x11e),_0x774b42(0x114)]),_0xdda4bd;try{_0xdda4bd=JSON[_0x774b42(0x14c)](_0x406069);}catch{throw new a(_0x774b42(0xe8));}if(!_0xdda4bd||typeof _0xdda4bd!=_0x774b42(0xfe)||Array['isArray'](_0xdda4bd)||Object['keys'](_0xdda4bd)[_0x774b42(0xfa)](_0x4c0579=>!_0x2f90f5[_0x774b42(0xf6)](_0x4c0579)))throw new a(_0x774b42(0xe2));return _0xdda4bd;}function l(_0x5bfa31){const _0x5d0382=_0x4b92;if(_0x5bfa31[_0x5d0382(0x11f)]===_0x5d0382(0xe0)){let _0x2645b8=[_0x5d0382(0xe3)+_0x5bfa31[_0x5d0382(0xf4)]+'\x20('+String(_0x5bfa31[_0x5d0382(0x101)][_0x5d0382(0x13d)][_0x5d0382(0xeb)])+'\x20pages,\x20'+_0x5bfa31['mode']+')'];for(let _0x2802e7 of _0x5bfa31[_0x5d0382(0x115)])_0x2645b8[_0x5d0382(0xf2)](_0x5d0382(0xea)+String(_0x2802e7['page'])+'\x20\x20'+_0x2802e7[_0x5d0382(0x127)]+'\x20\x20'+_0x2802e7['severity']+'\x20\x20'+_0x2802e7['rule']+'\x20\x20'+_0x2802e7['id']);for(let _0x72d8a of _0x5bfa31['coverage']['incomplete'])_0x2645b8[_0x5d0382(0xf2)](_0x5d0382(0xde)+_0x72d8a[_0x5d0382(0x148)]+'\x20\x20'+_0x72d8a[_0x5d0382(0x127)]+'\x20\x20'+_0x72d8a[_0x5d0382(0x11d)]);for(let _0x599843 of _0x5bfa31[_0x5d0382(0x101)][_0x5d0382(0x131)])_0x2645b8['push'](_0x5d0382(0x10e)+_0x599843);return _0x2645b8['join']('\x0a');}if(_0x5bfa31['findings'][_0x5d0382(0xeb)]===0x0)return'Slide\x20layout\x20lint:\x20no\x20findings\x20('+String(_0x5bfa31[_0x5d0382(0x101)]['pages'][_0x5d0382(0xeb)])+_0x5d0382(0xf1);let _0x64abb7=[_0x5d0382(0x139)+String(_0x5bfa31[_0x5d0382(0x115)][_0x5d0382(0xeb)])+_0x5d0382(0x12a)+String(_0x5bfa31[_0x5d0382(0x101)][_0x5d0382(0x13d)][_0x5d0382(0xeb)])+_0x5d0382(0xf1)];for(let _0x5c1d92 of _0x5bfa31['findings'])_0x64abb7[_0x5d0382(0xf2)]('page\x20'+String(_0x5c1d92[_0x5d0382(0xf8)])+'\x20\x20'+_0x5c1d92[_0x5d0382(0x145)]+'\x20\x20'+_0x5c1d92['id']),_0x64abb7[_0x5d0382(0xf2)]('\x20\x20'+_0x5c1d92['detail']);return _0x64abb7[_0x5d0382(0xe4)]('\x0a');}function u(_0x280e61){return d(_0x280e61);}function d(_0x44765c){const _0x175e10=_0x4b92;if(_0x44765c[_0x175e10(0x11c)]()==='all')return;if(_0x44765c[_0x175e10(0x11c)]()==='')throw new a(_0x175e10(0x116));let _0x394600=[];for(let _0x2d12d5 of _0x44765c[_0x175e10(0x130)](',')){let _0x49f629=_0x2d12d5['trim']();if(_0x49f629==='')throw new a('--pages\x20contains\x20an\x20empty\x20selector');let _0x318d6b=/^(\d+)(?:-(\d+))?$/[_0x175e10(0xf0)](_0x49f629);if(_0x318d6b===null){_0x394600[_0x175e10(0xf2)](_0x49f629);continue;}let _0xb53317=Number(_0x318d6b[0x1]),_0x2dcb2b=Number(_0x318d6b[0x2]??_0x318d6b[0x1]);if(_0xb53317<0x1||_0x2dcb2b<_0xb53317)throw new a('Invalid\x20page\x20selector:\x20'+_0x49f629);if(_0x394600[_0x175e10(0xeb)]+_0x2dcb2b-_0xb53317+0x1>i)throw new a(_0x175e10(0x133));for(let _0x1a3b35=_0xb53317;_0x1a3b35<=_0x2dcb2b;_0x1a3b35+=0x1)_0x394600[_0x175e10(0xf2)](_0x1a3b35);}return _0x394600;}function f(_0x456280){const _0x267616=_0x4b92;return _0x456280 instanceof Error&&typeof _0x456280[_0x267616(0xf5)]==_0x267616(0x10c);}function p(_0x298cc7){const _0x527387=_0x4b92;let _0x545bcf=Number(_0x298cc7);if(_0x298cc7[_0x527387(0x11c)]()===''||!Number[_0x527387(0x12f)](_0x545bcf)||_0x545bcf<0x0)throw new _0x420daa(_0x527387(0x122));return _0x545bcf;}function m(_0x3b90d4){const _0x20901d=_0x4b92;let _0x2977b3=Number(_0x3b90d4);if(_0x3b90d4[_0x20901d(0x11c)]()===''||!Number['isFinite'](_0x2977b3)||_0x2977b3<0x1||_0x2977b3>0x2)throw new _0x420daa(_0x20901d(0xf7));return _0x2977b3;}export{a as UnitLayoutLintCommandInputError,o as createUnitLayoutLintCommand,u as parseUnitLayoutLintPages,l as renderUnitLayoutLint};
|
|
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"
|