@univer-cli/unit-layout-lint 1.3.1 → 1.4.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
- const _0xc44795=_0xc7f9;(function(_0x19d0e7,_0x29ff32){const _0x6bfa8d=_0xc7f9,_0x5279b8=_0x19d0e7();while(!![]){try{const _0x36e5d5=-parseInt(_0x6bfa8d(0x170))/0x1+-parseInt(_0x6bfa8d(0x121))/0x2*(-parseInt(_0x6bfa8d(0x16c))/0x3)+parseInt(_0x6bfa8d(0x133))/0x4*(parseInt(_0x6bfa8d(0x143))/0x5)+-parseInt(_0x6bfa8d(0x126))/0x6*(parseInt(_0x6bfa8d(0x169))/0x7)+parseInt(_0x6bfa8d(0x15d))/0x8+-parseInt(_0x6bfa8d(0x163))/0x9*(parseInt(_0x6bfa8d(0x145))/0xa)+parseInt(_0x6bfa8d(0x128))/0xb;if(_0x36e5d5===_0x29ff32)break;else _0x5279b8['push'](_0x5279b8['shift']());}catch(_0x3a978f){_0x5279b8['push'](_0x5279b8['shift']());}}}(_0x2014,0x2004a));var e=class extends Error{[_0xc44795(0x11a)];constructor(_0x509d0c,_0xae8e3e,_0x4b5ef1){const _0x58a591=_0xc44795;super(_0xae8e3e,_0x4b5ef1),this[_0x58a591(0x135)]=_0x58a591(0x14f),this['code']=_0x509d0c;}};function t(_0x210b2d){return _0x210b2d instanceof e;}var n=0x2,r=0x6,i=0.02,a=0.15,o=0.5,s=new Set([_0xc44795(0x12b),_0xc44795(0x11d)]),c=['text-off-page',_0xc44795(0x13c),'text-overlaps-text'];function l(_0x4faa9e){return{async 'lint'(_0x5f382d){const _0x2a503a=_0xc7f9;if(_0x5f382d['unitType']!==_0x2a503a(0x142))throw new e(_0x2a503a(0x15a),_0x2a503a(0x124));let _0x4007f1=O(_0x5f382d[_0x2a503a(0x117)]['id']),_0x1406e9=u(_0x5f382d[_0x2a503a(0x117)][_0x2a503a(0x12e)]??[],_0x5f382d['pages']),_0x3c8558=await _0x4faa9e[_0x2a503a(0x14b)][_0x2a503a(0x125)]({'unitType':_0x2a503a(0x142),'unitData':_0x5f382d[_0x2a503a(0x117)],..._0x5f382d[_0x2a503a(0x152)]===void 0x0?{}:{'formulaReferenceUnits':_0x5f382d[_0x2a503a(0x152)]},'pages':_0x1406e9[_0x2a503a(0x11e)](({page:_0x52135b})=>_0x52135b),..._0x5f382d['signal']===void 0x0?{}:{'signal':_0x5f382d['signal']}});return d(_0x3c8558,_0x1406e9),{'kind':_0x2a503a(0x13d),'unitId':_0x4007f1,'unitType':'slide','coverage':{'pages':_0x1406e9,'rules':c},'findings':f(_0x3c8558)};}};}function u(_0x441c66,_0x5be4a8){const _0x57b4b1=_0xc44795;if(_0x441c66['length']===0x0)throw new e('INVALID_INPUT',_0x57b4b1(0x149));if(_0x5be4a8!==void 0x0&&_0x5be4a8['length']===0x0)throw new e(_0x57b4b1(0x15a),_0x57b4b1(0x118));let _0x54dd0d=_0x5be4a8??_0x441c66[_0x57b4b1(0x11e)]((_0x2984ef,_0xed85b2)=>_0xed85b2+0x1),_0x4a3b0d=new Set(),_0x3ff1ff=[];for(let _0x5f59e2 of _0x54dd0d){let _0x26c7aa=typeof _0x5f59e2==_0x57b4b1(0x129)?_0x5f59e2:_0x441c66['findIndex'](_0x3c9557=>_0x3c9557===_0x5f59e2)+0x1;if(!Number[_0x57b4b1(0x160)](_0x26c7aa)||_0x26c7aa<0x1||_0x26c7aa>_0x441c66[_0x57b4b1(0x15e)])throw new e('INVALID_INPUT',_0x57b4b1(0x139)+String(_0x5f59e2));let _0x5413b4=_0x441c66[_0x26c7aa-0x1];_0x4a3b0d['has'](_0x5413b4)||(_0x4a3b0d[_0x57b4b1(0x122)](_0x5413b4),_0x3ff1ff[_0x57b4b1(0x14a)]({'page':_0x26c7aa,'pageId':_0x5413b4}));}return _0x3ff1ff;}function d(_0x437828,_0xa8a7dd){const _0x27a6d5=_0xc44795;let _0x44201b=new Map();for(let _0x415c83 of _0x437828[_0x27a6d5(0x138)]){let _0x3232d6=_0x44201b[_0x27a6d5(0x151)](_0x415c83[_0x27a6d5(0x12c)])??[];_0x3232d6[_0x27a6d5(0x14a)](_0x415c83),_0x44201b['set'](_0x415c83[_0x27a6d5(0x12c)],_0x3232d6);}for(let _0x3668eb of _0xa8a7dd){let _0x2d5e0e=_0x44201b[_0x27a6d5(0x151)](_0x3668eb[_0x27a6d5(0x12c)])??[];if(_0x2d5e0e[_0x27a6d5(0x15e)]!==0x1||_0x2d5e0e[0x0]?.[_0x27a6d5(0x14e)]!==_0x3668eb[_0x27a6d5(0x14e)])throw new e(_0x27a6d5(0x14c),_0x27a6d5(0x130)+_0x3668eb[_0x27a6d5(0x12c)]);let _0x51fbe3=_0x2d5e0e[0x0][_0x27a6d5(0x127)][_0x27a6d5(0x11e)](({elementId:_0xd51387})=>_0xd51387);if(new Set(_0x51fbe3)['size']!==_0x51fbe3[_0x27a6d5(0x15e)])throw new e(_0x27a6d5(0x14c),_0x27a6d5(0x11c)+_0x3668eb[_0x27a6d5(0x12c)]);}if(_0x437828[_0x27a6d5(0x138)][_0x27a6d5(0x15e)]!==_0xa8a7dd[_0x27a6d5(0x15e)])throw new e(_0x27a6d5(0x14c),'Render\x20result\x20contains\x20unrequested\x20Slide\x20pages');}function f(_0x58e554){const _0xd97228=_0xc44795;let _0x551b17=[];for(let _0x154097 of _0x58e554[_0xd97228(0x138)]){let _0x20581c=_0x154097[_0xd97228(0x127)][_0xd97228(0x132)](_0x52b0c2=>!_0x52b0c2['elementId'][_0xd97228(0x150)]('layout:')),_0x4cb1ae=_0x20581c['filter'](_0x92e491=>_0x92e491[_0xd97228(0x15c)]!==void 0x0&&_0x92e491['text']['content'][_0xd97228(0x167)]()!=='');for(let _0x1a91a9 of _0x4cb1ae){let _0x51c5ba=m(_0x1a91a9[_0xd97228(0x15c)][_0xd97228(0x16e)]),_0x214b80={..._0x51c5ba[_0xd97228(0x13b)]<-0x2?{'left':_(-_0x51c5ba[_0xd97228(0x13b)])}:{},..._0x51c5ba['top']<-0x2?{'top':_(-_0x51c5ba[_0xd97228(0x137)])}:{},..._0x51c5ba[_0xd97228(0x158)]>_0x154097[_0xd97228(0x16b)]+n?{'right':_(_0x51c5ba[_0xd97228(0x158)]-_0x154097[_0xd97228(0x16b)])}:{},..._0x51c5ba['bottom']>_0x154097[_0xd97228(0x120)]+n?{'bottom':_(_0x51c5ba[_0xd97228(0x15b)]-_0x154097[_0xd97228(0x120)])}:{}},_0x5bd2aa=D(_0x214b80);if(_0x5bd2aa!=='-'){let _0x481554=b(_0x1a91a9),_0xee36b3=y({'left':0x0,'top':0x0,'width':_0x154097[_0xd97228(0x16b)],'height':_0x154097[_0xd97228(0x120)]});_0x551b17[_0xd97228(0x14a)](p({'page':_0x154097[_0xd97228(0x14e)],'pageId':_0x154097[_0xd97228(0x12c)],'rule':_0xd97228(0x162),'id':_0x1a91a9[_0xd97228(0x144)],'text':_0x481554,'pageBox':_0xee36b3,'overflow':_0x214b80,'detail':_0xd97228(0x114)+v(_0x481554['content'])+_0xd97228(0x161)+_0x5bd2aa+_0xd97228(0x16d)+w(_0x481554[_0xd97228(0x16e)])+',\x20page\x20'+w(_0xee36b3)}));}}for(let _0x8d205d of _0x4cb1ae){let _0x2d083a=E(_0x8d205d,_0x20581c,_0x154097);if(_0x2d083a===void 0x0)continue;let _0x14fd65=m(_0x8d205d[_0xd97228(0x15c)]['ink']),_0x36a200=m(_0x2d083a[_0xd97228(0x131)]),_0xcd53a5=Math[_0xd97228(0x141)](r,i*(_0x36a200[_0xd97228(0x158)]-_0x36a200[_0xd97228(0x13b)])),_0x3a0278={..._0x36a200[_0xd97228(0x13b)]-_0x14fd65[_0xd97228(0x13b)]>_0xcd53a5?{'left':_(_0x36a200[_0xd97228(0x13b)]-_0x14fd65[_0xd97228(0x13b)])}:{},..._0x14fd65[_0xd97228(0x158)]-_0x36a200[_0xd97228(0x158)]>_0xcd53a5?{'right':_(_0x14fd65[_0xd97228(0x158)]-_0x36a200[_0xd97228(0x158)])}:{},..._0x14fd65[_0xd97228(0x15b)]-_0x36a200['bottom']>_0xcd53a5?{'bottom':_(_0x14fd65[_0xd97228(0x15b)]-_0x36a200['bottom'])}:{}},_0x37bce0=D(_0x3a0278);if(_0x37bce0!=='-'){let _0x4534a9=b(_0x8d205d),_0x305554=S(_0x2d083a);_0x551b17['push'](p({'page':_0x154097[_0xd97228(0x14e)],'pageId':_0x154097['pageId'],'rule':'text-escapes-container','id':_0x8d205d[_0xd97228(0x144)],'related':_0x2d083a[_0xd97228(0x144)],'text':_0x4534a9,'container':_0x305554,'overflow':_0x3a0278,'detail':_0xd97228(0x114)+v(_0x4534a9[_0xd97228(0x13a)])+'\x22\x20escapes\x20'+_0x305554['id']+'\x20('+_0x37bce0+_0xd97228(0x16d)+w(_0x4534a9['ink'])+',\x20'+_0x305554['id']+_0xd97228(0x154)+_0x305554['type']+'\x20'+C(_0x305554[_0xd97228(0x12d)])+'\x20'+w(_0x305554['box'])}));}}for(let _0xdb79ca=0x0;_0xdb79ca<_0x4cb1ae[_0xd97228(0x15e)];_0xdb79ca+=0x1)for(let _0x25c659=_0xdb79ca+0x1;_0x25c659<_0x4cb1ae[_0xd97228(0x15e)];_0x25c659+=0x1){let _0x3b89ea=_0x4cb1ae[_0xdb79ca],_0x311504=_0x4cb1ae[_0x25c659],_0x1227da=m(_0x3b89ea[_0xd97228(0x15c)][_0xd97228(0x16e)]),_0x48422d=m(_0x311504[_0xd97228(0x15c)][_0xd97228(0x16e)]),_0x5f29b6=h(g(_0x1227da,_0x48422d));if(_0x5f29b6<=0x1)continue;let _0x2d652a=_0x5f29b6/Math[_0xd97228(0x141)](0x1,Math['min'](h(_0x1227da),h(_0x48422d)));if(_0x2d652a<=a)continue;let _0x159712=b(_0x3b89ea),_0x314731=b(_0x311504);_0x551b17[_0xd97228(0x14a)](p({'page':_0x154097[_0xd97228(0x14e)],'pageId':_0x154097[_0xd97228(0x12c)],'rule':_0xd97228(0x14d),'id':_0x3b89ea[_0xd97228(0x144)],'related':_0x311504[_0xd97228(0x144)],'text':_0x159712,'other':_0x314731,'overlapRatio':Math[_0xd97228(0x113)](_0x2d652a*0x64)/0x64,'detail':_0xd97228(0x114)+v(_0x159712[_0xd97228(0x13a)])+'\x22'+x(_0x159712)+_0xd97228(0x140)+v(_0x314731[_0xd97228(0x13a)])+'\x22'+x(_0x314731)+_0xd97228(0x16a)+Math[_0xd97228(0x113)](_0x2d652a*0x64)+_0xd97228(0x11b)+w(_0x159712['ink'])+',\x20'+w(_0x314731['ink'])}));}}return _0x551b17[_0xd97228(0x166)]((_0x163b3a,_0x5120ad)=>_0x163b3a[_0xd97228(0x147)][_0xd97228(0x155)](_0x5120ad[_0xd97228(0x147)]));}function p(_0x25db60){const _0xe98648=_0xc44795;return{..._0x25db60,'fingerprint':[_0x25db60['rule'],_0x25db60[_0xe98648(0x12c)],_0x25db60['id'],_0x25db60[_0xe98648(0x168)]??''][_0xe98648(0x13f)](':'),'severity':_0xe98648(0x146)};}function _0xc7f9(_0x4ed639,_0xa1ca03){_0x4ed639=_0x4ed639-0x113;const _0x2014ea=_0x2014();let _0xc7f9d1=_0x2014ea[_0x4ed639];return _0xc7f9d1;}function m(_0x5b5f17){const _0x11f4e1=_0xc44795;return{'left':_0x5b5f17['left'],'top':_0x5b5f17[_0x11f4e1(0x137)],'right':_0x5b5f17[_0x11f4e1(0x13b)]+_0x5b5f17['width'],'bottom':_0x5b5f17[_0x11f4e1(0x137)]+_0x5b5f17[_0x11f4e1(0x164)]};}function h(_0x34b842){const _0x43295e=_0xc44795;return Math['max'](0x0,_0x34b842[_0x43295e(0x158)]-_0x34b842[_0x43295e(0x13b)])*Math[_0x43295e(0x141)](0x0,_0x34b842[_0x43295e(0x15b)]-_0x34b842[_0x43295e(0x137)]);}function g(_0x24ee46,_0x6886d3){const _0x11abbb=_0xc44795;return{'left':Math['max'](_0x24ee46[_0x11abbb(0x13b)],_0x6886d3[_0x11abbb(0x13b)]),'top':Math[_0x11abbb(0x141)](_0x24ee46[_0x11abbb(0x137)],_0x6886d3[_0x11abbb(0x137)]),'right':Math[_0x11abbb(0x159)](_0x24ee46[_0x11abbb(0x158)],_0x6886d3[_0x11abbb(0x158)]),'bottom':Math[_0x11abbb(0x159)](_0x24ee46[_0x11abbb(0x15b)],_0x6886d3[_0x11abbb(0x15b)])};}function _0x2014(){const _0x2258ef=['right','min','INVALID_INPUT','bottom','text','515144jHHJRp','length','zIndex','isInteger','\x22\x20runs\x20off\x20the\x20page\x20(','text-off-page','985833fKFHMN','height','element','sort','trim','related','14Allpiu','\x20by\x20','pageWidth','331719bWccLh',');\x20ink\x20','ink','Slide\x20unitData.id\x20is\x20required','215689mxYAnE','round','text\x20\x22','elementType','bottom\x20','unitData','pages\x20must\x20not\x20be\x20empty','no\x20fill','code','%\x20of\x20the\x20smaller\x20glyph\x20band;\x20ink\x20','Render\x20result\x20contains\x20duplicate\x20element\x20identities\x20on\x20page\x20','roundRect','map','none','pageHeight','4qJTScU','add','right\x20','Unit\x20layout\x20lint\x20currently\x20supports\x20Slide\x20only','captureSlideLayout','288726ZZtVXx','elements','2712589hPbvDG','number','width','rect','pageId','fill','slideOrder','top\x20','Render\x20result\x20does\x20not\x20contain\x20exactly\x20one\x20matching\x20page\x20','declared','filter','8uaNjVD','replace','name','opacity','top','pages','Slide\x20page\x20selector\x20is\x20invalid:\x20','content','left','text-escapes-container','unit-layout-lint','color','join','\x20overlaps\x20\x22','max','slide','51190borNxv','elementId','10fcKjik','warning','fingerprint','visible','Slide\x20has\x20no\x20pages\x20to\x20lint','push','runtime','INVALID_RENDER_RESULT','text-overlaps-text','page','UnitLayoutLintError','startsWith','get','formulaReferenceUnits','shapeType','\x20=\x20','localeCompare','type','left\x20'];_0x2014=function(){return _0x2258ef;};return _0x2014();}function _(_0x224070){const _0x5568cf=_0xc44795;return Math[_0x5568cf(0x113)](_0x224070);}function v(_0x4faeb4){const _0x17d9ae=_0xc44795;let _0xdd1d0b=_0x4faeb4[_0x17d9ae(0x134)](/\s+/gu,'\x20')[_0x17d9ae(0x167)]();return _0xdd1d0b[_0x17d9ae(0x15e)]<=0x10?_0xdd1d0b:_0xdd1d0b['slice'](0x0,0x10)+'…';}function y(_0x2f4a72){const _0x23e1e8=_0xc44795;return{'left':_(_0x2f4a72[_0x23e1e8(0x13b)]),'top':_(_0x2f4a72[_0x23e1e8(0x137)]),'width':_(_0x2f4a72[_0x23e1e8(0x12a)]),'height':_(_0x2f4a72['height'])};}function b(_0x5480a5){const _0x3777d7=_0xc44795;let _0x31cb99=_0x5480a5[_0x3777d7(0x15c)];return{'id':_0x5480a5[_0x3777d7(0x144)],'content':_0x31cb99[_0x3777d7(0x13a)],'ink':y(_0x31cb99[_0x3777d7(0x16e)]),..._0x31cb99['color']===void 0x0?{}:{'color':_0x31cb99[_0x3777d7(0x13e)]},..._0x31cb99[_0x3777d7(0x136)]===void 0x0?{}:{'opacity':_0x31cb99[_0x3777d7(0x136)]}};}function x(_0x43d0e9){const _0x21fc44=_0xc44795;return _0x43d0e9['color']===void 0x0&&_0x43d0e9[_0x21fc44(0x136)]===void 0x0?'':''+(_0x43d0e9[_0x21fc44(0x13e)]===void 0x0?'':'\x20\x20'+_0x43d0e9[_0x21fc44(0x13e)])+(_0x43d0e9[_0x21fc44(0x136)]===void 0x0?'':'\x20\x20opacity\x20'+_0x43d0e9['opacity']);}function S(_0xe8a28b){const _0x2d9e27=_0xc44795;return{'id':_0xe8a28b['elementId'],'type':_0xe8a28b[_0x2d9e27(0x153)]===void 0x0?_0xe8a28b['elementType']:_0xe8a28b[_0x2d9e27(0x115)]+':'+_0xe8a28b[_0x2d9e27(0x153)],..._0xe8a28b[_0x2d9e27(0x12d)]===void 0x0?{}:{'fill':_0xe8a28b[_0x2d9e27(0x12d)]},'box':y(_0xe8a28b['declared'])};}function C(_0x1822ae){const _0x5ad58d=_0xc44795;if(_0x1822ae===void 0x0)return _0x5ad58d(0x119);let _0x4932a4=_0x1822ae[_0x5ad58d(0x136)]===void 0x0||_0x1822ae[_0x5ad58d(0x136)]===0x1?'':'\x20@'+_0x1822ae[_0x5ad58d(0x136)];return((_0x1822ae[_0x5ad58d(0x156)]??'?')+'\x20'+(_0x1822ae[_0x5ad58d(0x13e)]??'')+_0x4932a4)[_0x5ad58d(0x167)]();}function w(_0x2e9bb5){const _0x1e176c=_0xc44795;return'('+_0x2e9bb5[_0x1e176c(0x13b)]+','+_0x2e9bb5[_0x1e176c(0x137)]+'\x20'+_0x2e9bb5[_0x1e176c(0x12a)]+'×'+_0x2e9bb5[_0x1e176c(0x164)]+')';}function T(_0x10efc9){const _0x109650=_0xc44795;let _0x1b1232=_0x10efc9['fill'];return!(_0x1b1232===void 0x0||_0x1b1232[_0x109650(0x156)]===_0x109650(0x11f)||_0x1b1232[_0x109650(0x136)]!==void 0x0&&_0x1b1232[_0x109650(0x136)]<o||_0x10efc9['shapeType']===void 0x0||!s['has'](_0x10efc9[_0x109650(0x153)])||_0x10efc9[_0x109650(0x148)]===!0x1);}function E(_0x5017a,_0x37fdf0,_0x2f9fab){const _0x15d3a0=_0xc44795;let _0x3dfcf0=m(_0x5017a[_0x15d3a0(0x15c)][_0x15d3a0(0x16e)]),_0x1d294f;for(let _0x28c0a0 of _0x37fdf0){if(_0x28c0a0[_0x15d3a0(0x15f)]>=_0x5017a['zIndex']||!T(_0x28c0a0))continue;let _0x1b6685=m(_0x28c0a0[_0x15d3a0(0x131)]),_0x12c689=h(_0x1b6685);if(_0x12c689>=0.5*_0x2f9fab[_0x15d3a0(0x16b)]*_0x2f9fab['pageHeight'])continue;let _0x409a24=_0x3dfcf0['top']>=_0x1b6685[_0x15d3a0(0x137)]-n&&_0x3dfcf0[_0x15d3a0(0x15b)]<=_0x1b6685[_0x15d3a0(0x15b)]+n,_0x306665=_0x3dfcf0[_0x15d3a0(0x13b)]>=_0x1b6685[_0x15d3a0(0x13b)]-n&&_0x3dfcf0[_0x15d3a0(0x13b)]<=_0x1b6685[_0x15d3a0(0x158)]+n&&_0x3dfcf0[_0x15d3a0(0x137)]>=_0x1b6685[_0x15d3a0(0x137)]-n,_0x44d3e7=h(g(_0x3dfcf0,_0x1b6685))/Math['max'](h(_0x3dfcf0),0x1);!_0x409a24||!_0x306665||_0x44d3e7<0.35||(_0x1d294f===void 0x0||_0x12c689<_0x1d294f['area'])&&(_0x1d294f={'element':_0x28c0a0,'area':_0x12c689});}return _0x1d294f?.[_0x15d3a0(0x165)];}function D(_0x44b33a){const _0x97771b=_0xc44795;let _0x52f1b7=[_0x44b33a[_0x97771b(0x13b)]===void 0x0?'':_0x97771b(0x157)+_0x44b33a[_0x97771b(0x13b)]+'px',_0x44b33a['top']===void 0x0?'':_0x97771b(0x12f)+_0x44b33a[_0x97771b(0x137)]+'px',_0x44b33a[_0x97771b(0x158)]===void 0x0?'':_0x97771b(0x123)+_0x44b33a[_0x97771b(0x158)]+'px',_0x44b33a[_0x97771b(0x15b)]===void 0x0?'':_0x97771b(0x116)+_0x44b33a['bottom']+'px'][_0x97771b(0x132)](_0x33cf2d=>_0x33cf2d!=='');return _0x52f1b7['length']===0x0?'-':_0x52f1b7['join'](',\x20');}function O(_0x55d2ea){const _0x2cfaaf=_0xc44795;if(typeof _0x55d2ea!='string'||_0x55d2ea[_0x2cfaaf(0x167)]()==='')throw new e(_0x2cfaaf(0x15a),_0x2cfaaf(0x16f));return _0x55d2ea;}export{e as UnitLayoutLintError,l as createUnitLayoutLint,t as isUnitLayoutLintError};
1
+ const _0x4037ef=_0x8b3d;(function(_0x2be0c1,_0x2b4799){const _0x2e6992=_0x8b3d,_0x2f7f24=_0x2be0c1();while(!![]){try{const _0x31c6a0=parseInt(_0x2e6992(0x17d))/0x1+parseInt(_0x2e6992(0x171))/0x2+-parseInt(_0x2e6992(0x1ad))/0x3+-parseInt(_0x2e6992(0x19b))/0x4+-parseInt(_0x2e6992(0x16b))/0x5*(parseInt(_0x2e6992(0x1b7))/0x6)+-parseInt(_0x2e6992(0x167))/0x7*(-parseInt(_0x2e6992(0x181))/0x8)+parseInt(_0x2e6992(0x187))/0x9;if(_0x31c6a0===_0x2b4799)break;else _0x2f7f24['push'](_0x2f7f24['shift']());}catch(_0x23928a){_0x2f7f24['push'](_0x2f7f24['shift']());}}}(_0x48af,0x80f6c));var e=class extends Error{[_0x4037ef(0x18b)];constructor(_0x5b5a7b,_0x55b503,_0x1d1410){const _0x153639=_0x4037ef;super(_0x55b503,_0x1d1410),this['name']=_0x153639(0x162),this['code']=_0x5b5a7b;}};function t(_0xe504d4){return _0xe504d4 instanceof e;}var n=0x2,r=0x6,i=0.02,a=0.15,o=0.5,s=new Set([_0x4037ef(0x183),_0x4037ef(0x163)]),c=[_0x4037ef(0x16a),_0x4037ef(0x160),_0x4037ef(0x1b4)];function l(_0x1dfbd5){return{async 'lint'(_0x41c49){const _0x4eefc5=_0x8b3d;if(_0x41c49[_0x4eefc5(0x172)]!==_0x4eefc5(0x16d))throw new e(_0x4eefc5(0x18d),'Unit\x20layout\x20lint\x20currently\x20supports\x20Slide\x20only');let _0x579d63=O(_0x41c49[_0x4eefc5(0x1a4)]['id']),_0x42c436=u(_0x41c49[_0x4eefc5(0x1a4)][_0x4eefc5(0x1a9)]??[],_0x41c49[_0x4eefc5(0x1b5)]),_0x306d14=await _0x1dfbd5[_0x4eefc5(0x1b1)][_0x4eefc5(0x1a1)]({'unitType':_0x4eefc5(0x16d),'unitData':_0x41c49[_0x4eefc5(0x1a4)],..._0x41c49[_0x4eefc5(0x17f)]===void 0x0?{}:{'formulaReferenceUnits':_0x41c49[_0x4eefc5(0x17f)]},'pages':_0x42c436[_0x4eefc5(0x16f)](({page:_0x2e915c})=>_0x2e915c),..._0x41c49[_0x4eefc5(0x15d)]===void 0x0?{}:{'signal':_0x41c49[_0x4eefc5(0x15d)]}});return d(_0x306d14,_0x42c436),{'kind':_0x4eefc5(0x166),'unitId':_0x579d63,'unitType':_0x4eefc5(0x16d),'coverage':{'pages':_0x42c436,'rules':c},'findings':f(_0x306d14)};}};}function u(_0x190aad,_0x4a3110){const _0x5bfc52=_0x4037ef;if(_0x190aad[_0x5bfc52(0x17c)]===0x0)throw new e(_0x5bfc52(0x18d),'Slide\x20has\x20no\x20pages\x20to\x20lint');if(_0x4a3110!==void 0x0&&_0x4a3110[_0x5bfc52(0x17c)]===0x0)throw new e(_0x5bfc52(0x18d),_0x5bfc52(0x18f));let _0x53a22c=_0x4a3110??_0x190aad['map']((_0x287f86,_0x4ec611)=>_0x4ec611+0x1),_0x1adbac=new Set(),_0x5e61b5=[];for(let _0x3b158f of _0x53a22c){let _0x24110e=typeof _0x3b158f=='number'?_0x3b158f:_0x190aad[_0x5bfc52(0x17b)](_0x464c7d=>_0x464c7d===_0x3b158f)+0x1;if(!Number[_0x5bfc52(0x195)](_0x24110e)||_0x24110e<0x1||_0x24110e>_0x190aad[_0x5bfc52(0x17c)])throw new e(_0x5bfc52(0x18d),'Slide\x20page\x20selector\x20is\x20invalid:\x20'+String(_0x3b158f));let _0x1a326c=_0x190aad[_0x24110e-0x1];_0x1adbac[_0x5bfc52(0x169)](_0x1a326c)||(_0x1adbac[_0x5bfc52(0x1a7)](_0x1a326c),_0x5e61b5[_0x5bfc52(0x164)]({'page':_0x24110e,'pageId':_0x1a326c}));}return _0x5e61b5;}function d(_0xd6c6ce,_0x3c96e1){const _0x319ec1=_0x4037ef;let _0x4891aa=new Map();for(let _0x3a29cd of _0xd6c6ce['pages']){let _0xc8d074=_0x4891aa[_0x319ec1(0x1ae)](_0x3a29cd[_0x319ec1(0x15c)])??[];_0xc8d074[_0x319ec1(0x164)](_0x3a29cd),_0x4891aa[_0x319ec1(0x1a0)](_0x3a29cd['pageId'],_0xc8d074);}for(let _0x133b9b of _0x3c96e1){let _0x28dc2c=_0x4891aa[_0x319ec1(0x1ae)](_0x133b9b[_0x319ec1(0x15c)])??[];if(_0x28dc2c[_0x319ec1(0x17c)]!==0x1||_0x28dc2c[0x0]?.[_0x319ec1(0x197)]!==_0x133b9b['page'])throw new e('INVALID_RENDER_RESULT',_0x319ec1(0x178)+_0x133b9b[_0x319ec1(0x15c)]);let _0x43b09c=_0x28dc2c[0x0][_0x319ec1(0x1af)]['map'](({elementId:_0x1c318e})=>_0x1c318e);if(new Set(_0x43b09c)['size']!==_0x43b09c['length'])throw new e('INVALID_RENDER_RESULT',_0x319ec1(0x18e)+_0x133b9b[_0x319ec1(0x15c)]);}if(_0xd6c6ce[_0x319ec1(0x1b5)][_0x319ec1(0x17c)]!==_0x3c96e1['length'])throw new e(_0x319ec1(0x180),_0x319ec1(0x182));}function f(_0x2f6065){const _0x2ec414=_0x4037ef;let _0x4520be=[];for(let _0x49c629 of _0x2f6065[_0x2ec414(0x1b5)]){let _0x35e53c=_0x49c629[_0x2ec414(0x1af)][_0x2ec414(0x158)](_0xaec813=>!_0xaec813[_0x2ec414(0x16e)][_0x2ec414(0x175)](_0x2ec414(0x15e))),_0x184e07=_0x35e53c[_0x2ec414(0x158)](_0x2088de=>_0x2088de[_0x2ec414(0x1b2)]!==void 0x0&&_0x2088de[_0x2ec414(0x1b2)]['content']['trim']()!=='');for(let _0x2a5d71 of _0x184e07){let _0x5e7245=m(_0x2a5d71[_0x2ec414(0x1b2)]['ink']),_0xf573c1={..._0x5e7245[_0x2ec414(0x1a5)]<-0x2?{'left':_(-_0x5e7245[_0x2ec414(0x1a5)])}:{},..._0x5e7245[_0x2ec414(0x1a3)]<-0x2?{'top':_(-_0x5e7245[_0x2ec414(0x1a3)])}:{},..._0x5e7245[_0x2ec414(0x1b3)]>_0x49c629['pageWidth']+n?{'right':_(_0x5e7245[_0x2ec414(0x1b3)]-_0x49c629['pageWidth'])}:{},..._0x5e7245[_0x2ec414(0x176)]>_0x49c629[_0x2ec414(0x196)]+n?{'bottom':_(_0x5e7245['bottom']-_0x49c629[_0x2ec414(0x196)])}:{}},_0x21da8c=D(_0xf573c1);if(_0x21da8c!=='-'){let _0x5727a3=b(_0x2a5d71),_0x5f9ad2=y({'left':0x0,'top':0x0,'width':_0x49c629[_0x2ec414(0x15a)],'height':_0x49c629[_0x2ec414(0x196)]});_0x4520be[_0x2ec414(0x164)](p({'page':_0x49c629[_0x2ec414(0x197)],'pageId':_0x49c629[_0x2ec414(0x15c)],'rule':_0x2ec414(0x16a),'id':_0x2a5d71[_0x2ec414(0x16e)],'text':_0x5727a3,'pageBox':_0x5f9ad2,'overflow':_0xf573c1,'detail':_0x2ec414(0x159)+v(_0x5727a3[_0x2ec414(0x177)])+_0x2ec414(0x179)+_0x21da8c+_0x2ec414(0x18c)+w(_0x5727a3[_0x2ec414(0x16c)])+_0x2ec414(0x189)+w(_0x5f9ad2)}));}}for(let _0x4c99d3 of _0x184e07){let _0x407d51=E(_0x4c99d3,_0x35e53c,_0x49c629);if(_0x407d51===void 0x0)continue;let _0x2376d0=m(_0x4c99d3[_0x2ec414(0x1b2)]['ink']),_0x164536=m(_0x407d51[_0x2ec414(0x1a8)]),_0x1bb2f1=Math[_0x2ec414(0x198)](r,i*(_0x164536[_0x2ec414(0x1b3)]-_0x164536[_0x2ec414(0x1a5)])),_0x493c40={..._0x164536[_0x2ec414(0x1a5)]-_0x2376d0['left']>_0x1bb2f1?{'left':_(_0x164536[_0x2ec414(0x1a5)]-_0x2376d0[_0x2ec414(0x1a5)])}:{},..._0x2376d0[_0x2ec414(0x1b3)]-_0x164536[_0x2ec414(0x1b3)]>_0x1bb2f1?{'right':_(_0x2376d0[_0x2ec414(0x1b3)]-_0x164536[_0x2ec414(0x1b3)])}:{},..._0x2376d0[_0x2ec414(0x176)]-_0x164536[_0x2ec414(0x176)]>_0x1bb2f1?{'bottom':_(_0x2376d0[_0x2ec414(0x176)]-_0x164536[_0x2ec414(0x176)])}:{}},_0x329524=D(_0x493c40);if(_0x329524!=='-'){let _0x4a04c3=b(_0x4c99d3),_0x581e94=S(_0x407d51);_0x4520be['push'](p({'page':_0x49c629['page'],'pageId':_0x49c629['pageId'],'rule':_0x2ec414(0x160),'id':_0x4c99d3[_0x2ec414(0x16e)],'related':_0x407d51['elementId'],'text':_0x4a04c3,'container':_0x581e94,'overflow':_0x493c40,'detail':_0x2ec414(0x159)+v(_0x4a04c3[_0x2ec414(0x177)])+_0x2ec414(0x188)+_0x581e94['id']+'\x20('+_0x329524+_0x2ec414(0x18c)+w(_0x4a04c3[_0x2ec414(0x16c)])+',\x20'+_0x581e94['id']+'\x20=\x20'+_0x581e94[_0x2ec414(0x194)]+'\x20'+C(_0x581e94['fill'])+'\x20'+w(_0x581e94[_0x2ec414(0x1b6)])}));}}for(let _0x4e28b4=0x0;_0x4e28b4<_0x184e07['length'];_0x4e28b4+=0x1)for(let _0x5c13a9=_0x4e28b4+0x1;_0x5c13a9<_0x184e07[_0x2ec414(0x17c)];_0x5c13a9+=0x1){let _0x502e27=_0x184e07[_0x4e28b4],_0x428d1e=_0x184e07[_0x5c13a9],_0x58faa6=m(_0x502e27[_0x2ec414(0x1b2)][_0x2ec414(0x16c)]),_0x3209b7=m(_0x428d1e[_0x2ec414(0x1b2)][_0x2ec414(0x16c)]),_0x366fce=h(g(_0x58faa6,_0x3209b7));if(_0x366fce<=0x1)continue;let _0x199e68=_0x366fce/Math['max'](0x1,Math[_0x2ec414(0x17e)](h(_0x58faa6),h(_0x3209b7)));if(_0x199e68<=a)continue;let _0x597a97=b(_0x502e27),_0x4f8de0=b(_0x428d1e);_0x4520be[_0x2ec414(0x164)](p({'page':_0x49c629[_0x2ec414(0x197)],'pageId':_0x49c629[_0x2ec414(0x15c)],'rule':'text-overlaps-text','id':_0x502e27[_0x2ec414(0x16e)],'related':_0x428d1e[_0x2ec414(0x16e)],'text':_0x597a97,'other':_0x4f8de0,'overlapRatio':Math['round'](_0x199e68*0x64)/0x64,'detail':_0x2ec414(0x159)+v(_0x597a97[_0x2ec414(0x177)])+'\x22'+x(_0x597a97)+_0x2ec414(0x1a2)+v(_0x4f8de0[_0x2ec414(0x177)])+'\x22'+x(_0x4f8de0)+_0x2ec414(0x15b)+Math[_0x2ec414(0x1a6)](_0x199e68*0x64)+_0x2ec414(0x19e)+w(_0x597a97['ink'])+',\x20'+w(_0x4f8de0[_0x2ec414(0x16c)])}));}}return _0x4520be[_0x2ec414(0x170)]((_0x234939,_0x126d97)=>_0x234939[_0x2ec414(0x190)]['localeCompare'](_0x126d97[_0x2ec414(0x190)]));}function p(_0x16de96){const _0x217d0b=_0x4037ef;return{..._0x16de96,'fingerprint':[_0x16de96[_0x217d0b(0x19a)],_0x16de96[_0x217d0b(0x15c)],_0x16de96['id'],_0x16de96['related']??''][_0x217d0b(0x173)](':'),'severity':_0x217d0b(0x17a)};}function m(_0x539211){const _0x4a33f6=_0x4037ef;return{'left':_0x539211[_0x4a33f6(0x1a5)],'top':_0x539211[_0x4a33f6(0x1a3)],'right':_0x539211[_0x4a33f6(0x1a5)]+_0x539211[_0x4a33f6(0x15f)],'bottom':_0x539211[_0x4a33f6(0x1a3)]+_0x539211[_0x4a33f6(0x174)]};}function h(_0xdf5e1){const _0x96f3bd=_0x4037ef;return Math[_0x96f3bd(0x198)](0x0,_0xdf5e1[_0x96f3bd(0x1b3)]-_0xdf5e1[_0x96f3bd(0x1a5)])*Math[_0x96f3bd(0x198)](0x0,_0xdf5e1[_0x96f3bd(0x176)]-_0xdf5e1[_0x96f3bd(0x1a3)]);}function g(_0x5f3d22,_0x351e29){const _0x598d38=_0x4037ef;return{'left':Math[_0x598d38(0x198)](_0x5f3d22[_0x598d38(0x1a5)],_0x351e29[_0x598d38(0x1a5)]),'top':Math['max'](_0x5f3d22['top'],_0x351e29[_0x598d38(0x1a3)]),'right':Math[_0x598d38(0x17e)](_0x5f3d22[_0x598d38(0x1b3)],_0x351e29[_0x598d38(0x1b3)]),'bottom':Math['min'](_0x5f3d22[_0x598d38(0x176)],_0x351e29[_0x598d38(0x176)])};}function _(_0x560feb){return Math['round'](_0x560feb);}function v(_0x37a956){const _0x399da2=_0x4037ef;let _0x2f53e1=_0x37a956[_0x399da2(0x1aa)](/\s+/gu,'\x20')[_0x399da2(0x161)]();return _0x2f53e1['length']<=0x10?_0x2f53e1:_0x2f53e1[_0x399da2(0x18a)](0x0,0x10)+'…';}function _0x48af(){const _0x4a5586=['round','add','declared','slideOrder','replace','area','opacity','2276211FjmpSe','get','elements','top\x20','runtime','text','right','text-overlaps-text','pages','box','758994EozBxi','filter','text\x20\x22','pageWidth','\x20by\x20','pageId','signal','layout:','width','text-escapes-container','trim','UnitLayoutLintError','roundRect','push','\x20\x20opacity\x20','unit-layout-lint','1554vkrsRn','right\x20','has','text-off-page','5BJtbGo','ink','slide','elementId','map','sort','84556EPqGKJ','unitType','join','height','startsWith','bottom','content','Render\x20result\x20does\x20not\x20contain\x20exactly\x20one\x20matching\x20page\x20','\x22\x20runs\x20off\x20the\x20page\x20(','warning','findIndex','length','1024262mPmeic','min','formulaReferenceUnits','INVALID_RENDER_RESULT','2432SQnWsE','Render\x20result\x20contains\x20unrequested\x20Slide\x20pages','rect','zIndex','Slide\x20unitData.id\x20is\x20required','string','12012102VwfFeX','\x22\x20escapes\x20',',\x20page\x20','slice','code',');\x20ink\x20','INVALID_INPUT','Render\x20result\x20contains\x20duplicate\x20element\x20identities\x20on\x20page\x20','pages\x20must\x20not\x20be\x20empty','fingerprint','left\x20','elementType','shapeType','type','isInteger','pageHeight','page','max','none','rule','4220936ZxPDCY','fill','visible','%\x20of\x20the\x20smaller\x20glyph\x20band;\x20ink\x20','color','set','captureSlideLayout','\x20overlaps\x20\x22','top','unitData','left'];_0x48af=function(){return _0x4a5586;};return _0x48af();}function y(_0x640070){const _0x5083c=_0x4037ef;return{'left':_(_0x640070['left']),'top':_(_0x640070[_0x5083c(0x1a3)]),'width':_(_0x640070[_0x5083c(0x15f)]),'height':_(_0x640070[_0x5083c(0x174)])};}function b(_0x20aea8){const _0x53ab31=_0x4037ef;let _0x33ab42=_0x20aea8[_0x53ab31(0x1b2)];return{'id':_0x20aea8['elementId'],'content':_0x33ab42[_0x53ab31(0x177)],'ink':y(_0x33ab42[_0x53ab31(0x16c)]),..._0x33ab42[_0x53ab31(0x19f)]===void 0x0?{}:{'color':_0x33ab42[_0x53ab31(0x19f)]},..._0x33ab42[_0x53ab31(0x1ac)]===void 0x0?{}:{'opacity':_0x33ab42['opacity']}};}function x(_0x4f3d61){const _0x522e61=_0x4037ef;return _0x4f3d61['color']===void 0x0&&_0x4f3d61[_0x522e61(0x1ac)]===void 0x0?'':''+(_0x4f3d61['color']===void 0x0?'':'\x20\x20'+_0x4f3d61[_0x522e61(0x19f)])+(_0x4f3d61[_0x522e61(0x1ac)]===void 0x0?'':_0x522e61(0x165)+_0x4f3d61['opacity']);}function S(_0x1d061c){const _0x1732f9=_0x4037ef;return{'id':_0x1d061c[_0x1732f9(0x16e)],'type':_0x1d061c[_0x1732f9(0x193)]===void 0x0?_0x1d061c['elementType']:_0x1d061c[_0x1732f9(0x192)]+':'+_0x1d061c[_0x1732f9(0x193)],..._0x1d061c[_0x1732f9(0x19c)]===void 0x0?{}:{'fill':_0x1d061c['fill']},'box':y(_0x1d061c[_0x1732f9(0x1a8)])};}function C(_0x139055){const _0x125e11=_0x4037ef;if(_0x139055===void 0x0)return'no\x20fill';let _0x3298e0=_0x139055[_0x125e11(0x1ac)]===void 0x0||_0x139055['opacity']===0x1?'':'\x20@'+_0x139055[_0x125e11(0x1ac)];return((_0x139055[_0x125e11(0x194)]??'?')+'\x20'+(_0x139055[_0x125e11(0x19f)]??'')+_0x3298e0)['trim']();}function w(_0x39c893){const _0x1ca126=_0x4037ef;return'('+_0x39c893['left']+','+_0x39c893[_0x1ca126(0x1a3)]+'\x20'+_0x39c893['width']+'×'+_0x39c893[_0x1ca126(0x174)]+')';}function _0x8b3d(_0xdc88d4,_0x288875){_0xdc88d4=_0xdc88d4-0x158;const _0x48af68=_0x48af();let _0x8b3d6=_0x48af68[_0xdc88d4];return _0x8b3d6;}function T(_0x1cd1f6){const _0x2711df=_0x4037ef;let _0x15b026=_0x1cd1f6[_0x2711df(0x19c)];return!(_0x15b026===void 0x0||_0x15b026[_0x2711df(0x194)]===_0x2711df(0x199)||_0x15b026[_0x2711df(0x1ac)]!==void 0x0&&_0x15b026[_0x2711df(0x1ac)]<o||_0x1cd1f6[_0x2711df(0x193)]===void 0x0||!s['has'](_0x1cd1f6['shapeType'])||_0x1cd1f6[_0x2711df(0x19d)]===!0x1);}function E(_0x4e1f48,_0x4ab562,_0x45223e){const _0x636423=_0x4037ef;let _0xcb77e2=m(_0x4e1f48['text'][_0x636423(0x16c)]),_0x5130c9;for(let _0xd67824 of _0x4ab562){if(_0xd67824[_0x636423(0x184)]>=_0x4e1f48['zIndex']||!T(_0xd67824))continue;let _0x59bfc3=m(_0xd67824['declared']),_0xccae15=h(_0x59bfc3);if(_0xccae15>=0.5*_0x45223e[_0x636423(0x15a)]*_0x45223e[_0x636423(0x196)])continue;let _0x392b55=_0xcb77e2[_0x636423(0x1a3)]>=_0x59bfc3[_0x636423(0x1a3)]-n&&_0xcb77e2['bottom']<=_0x59bfc3['bottom']+n,_0x21e857=_0xcb77e2[_0x636423(0x1a5)]>=_0x59bfc3[_0x636423(0x1a5)]-n&&_0xcb77e2['left']<=_0x59bfc3['right']+n&&_0xcb77e2[_0x636423(0x1a3)]>=_0x59bfc3['top']-n,_0x10e002=h(g(_0xcb77e2,_0x59bfc3))/Math[_0x636423(0x198)](h(_0xcb77e2),0x1);!_0x392b55||!_0x21e857||_0x10e002<0.35||(_0x5130c9===void 0x0||_0xccae15<_0x5130c9[_0x636423(0x1ab)])&&(_0x5130c9={'element':_0xd67824,'area':_0xccae15});}return _0x5130c9?.['element'];}function D(_0x4d3927){const _0x4f658a=_0x4037ef;let _0x3fa086=[_0x4d3927['left']===void 0x0?'':_0x4f658a(0x191)+_0x4d3927['left']+'px',_0x4d3927['top']===void 0x0?'':_0x4f658a(0x1b0)+_0x4d3927[_0x4f658a(0x1a3)]+'px',_0x4d3927['right']===void 0x0?'':_0x4f658a(0x168)+_0x4d3927[_0x4f658a(0x1b3)]+'px',_0x4d3927[_0x4f658a(0x176)]===void 0x0?'':'bottom\x20'+_0x4d3927[_0x4f658a(0x176)]+'px'][_0x4f658a(0x158)](_0x350f7d=>_0x350f7d!=='');return _0x3fa086[_0x4f658a(0x17c)]===0x0?'-':_0x3fa086[_0x4f658a(0x173)](',\x20');}function O(_0x15c5a7){const _0x3de663=_0x4037ef;if(typeof _0x15c5a7!=_0x3de663(0x186)||_0x15c5a7[_0x3de663(0x161)]()==='')throw new e(_0x3de663(0x18d),_0x3de663(0x185));return _0x15c5a7;}export{e as UnitLayoutLintError,l as createUnitLayoutLint,t as isUnitLayoutLintError};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@univer-cli/unit-layout-lint",
3
3
  "type": "module",
4
- "version": "1.3.1",
4
+ "version": "1.4.0",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -18,6 +18,6 @@
18
18
  "README.zh-CN.md"
19
19
  ],
20
20
  "dependencies": {
21
- "@univer-cli/univer-render-runtime": "1.3.1"
21
+ "@univer-cli/univer-render-runtime": "1.4.0"
22
22
  }
23
23
  }