@univer-cli/unit-layout-lint 1.3.0 → 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 _0x46dd64=_0xccdd;(function(_0x4ae1f9,_0x311486){const _0x53af12=_0xccdd,_0x2214a4=_0x4ae1f9();while(!![]){try{const _0x91a040=parseInt(_0x53af12(0x7f))/0x1*(-parseInt(_0x53af12(0x7b))/0x2)+-parseInt(_0x53af12(0xa1))/0x3+parseInt(_0x53af12(0xc7))/0x4+-parseInt(_0x53af12(0x8b))/0x5+-parseInt(_0x53af12(0xc5))/0x6*(parseInt(_0x53af12(0xa8))/0x7)+parseInt(_0x53af12(0x88))/0x8+parseInt(_0x53af12(0x80))/0x9;if(_0x91a040===_0x311486)break;else _0x2214a4['push'](_0x2214a4['shift']());}catch(_0x49b83c){_0x2214a4['push'](_0x2214a4['shift']());}}}(_0x5667,0xa25fa));var e=class extends Error{[_0x46dd64(0xa5)];constructor(_0x3e9a70,_0x156469,_0x1dbc3d){const _0x12bafb=_0x46dd64;super(_0x156469,_0x1dbc3d),this[_0x12bafb(0xae)]=_0x12bafb(0x95),this[_0x12bafb(0xa5)]=_0x3e9a70;}};function t(_0x5f4f9d){return _0x5f4f9d instanceof e;}var n=0x2,r=0x6,i=0.02,a=0.15,o=0.5,s=new Set([_0x46dd64(0x94),_0x46dd64(0xb1)]),c=[_0x46dd64(0x76),_0x46dd64(0xa6),_0x46dd64(0xd2)];function l(_0xa0cee8){return{async 'lint'(_0x18d68b){const _0x46bab1=_0xccdd;if(_0x18d68b['unitType']!==_0x46bab1(0x92))throw new e(_0x46bab1(0x78),'Unit\x20layout\x20lint\x20currently\x20supports\x20Slide\x20only');let _0x5c4472=O(_0x18d68b[_0x46bab1(0x9f)]['id']),_0x2b342b=u(_0x18d68b[_0x46bab1(0x9f)][_0x46bab1(0xcb)]??[],_0x18d68b[_0x46bab1(0x86)]),_0x22849b=await _0xa0cee8[_0x46bab1(0x99)][_0x46bab1(0xb2)]({'unitType':_0x46bab1(0x92),'unitData':_0x18d68b['unitData'],..._0x18d68b[_0x46bab1(0x96)]===void 0x0?{}:{'formulaReferenceUnits':_0x18d68b[_0x46bab1(0x96)]},'pages':_0x2b342b[_0x46bab1(0xd6)](({page:_0x174c53})=>_0x174c53),..._0x18d68b[_0x46bab1(0xc9)]===void 0x0?{}:{'signal':_0x18d68b[_0x46bab1(0xc9)]}});return d(_0x22849b,_0x2b342b),{'kind':_0x46bab1(0x82),'unitId':_0x5c4472,'unitType':_0x46bab1(0x92),'coverage':{'pages':_0x2b342b,'rules':c},'findings':f(_0x22849b)};}};}function u(_0x281b09,_0x21c976){const _0x415f78=_0x46dd64;if(_0x281b09[_0x415f78(0x81)]===0x0)throw new e(_0x415f78(0x78),_0x415f78(0xc8));if(_0x21c976!==void 0x0&&_0x21c976['length']===0x0)throw new e(_0x415f78(0x78),_0x415f78(0x9c));let _0xd2489f=_0x21c976??_0x281b09['map']((_0x2dfe2a,_0xc6f566)=>_0xc6f566+0x1),_0x110c5a=new Set(),_0x2aeaa5=[];for(let _0xdd5773 of _0xd2489f){let _0x48925c=typeof _0xdd5773==_0x415f78(0xbc)?_0xdd5773:_0x281b09[_0x415f78(0x84)](_0x347155=>_0x347155===_0xdd5773)+0x1;if(!Number[_0x415f78(0x9d)](_0x48925c)||_0x48925c<0x1||_0x48925c>_0x281b09['length'])throw new e('INVALID_INPUT',_0x415f78(0xcf)+String(_0xdd5773));let _0x18edfc=_0x281b09[_0x48925c-0x1];_0x110c5a[_0x415f78(0xc2)](_0x18edfc)||(_0x110c5a[_0x415f78(0xc6)](_0x18edfc),_0x2aeaa5[_0x415f78(0x93)]({'page':_0x48925c,'pageId':_0x18edfc}));}return _0x2aeaa5;}function d(_0x5e02d9,_0x38dc19){const _0x244518=_0x46dd64;let _0x2e613a=new Map();for(let _0x5058dd of _0x5e02d9[_0x244518(0x86)]){let _0x23c770=_0x2e613a['get'](_0x5058dd[_0x244518(0xab)])??[];_0x23c770[_0x244518(0x93)](_0x5058dd),_0x2e613a['set'](_0x5058dd[_0x244518(0xab)],_0x23c770);}for(let _0x9319ca of _0x38dc19){let _0x4d2af4=_0x2e613a[_0x244518(0xc4)](_0x9319ca[_0x244518(0xab)])??[];if(_0x4d2af4[_0x244518(0x81)]!==0x1||_0x4d2af4[0x0]?.[_0x244518(0xb9)]!==_0x9319ca[_0x244518(0xb9)])throw new e(_0x244518(0xd0),_0x244518(0xa3)+_0x9319ca[_0x244518(0xab)]);let _0x3ee098=_0x4d2af4[0x0][_0x244518(0xbe)][_0x244518(0xd6)](({elementId:_0x1ab198})=>_0x1ab198);if(new Set(_0x3ee098)[_0x244518(0xd4)]!==_0x3ee098[_0x244518(0x81)])throw new e(_0x244518(0xd0),_0x244518(0xc0)+_0x9319ca[_0x244518(0xab)]);}if(_0x5e02d9['pages'][_0x244518(0x81)]!==_0x38dc19[_0x244518(0x81)])throw new e(_0x244518(0xd0),_0x244518(0xa4));}function f(_0x5eb57a){const _0x3f317b=_0x46dd64;let _0x879ec3=[];for(let _0x4ba595 of _0x5eb57a[_0x3f317b(0x86)]){let _0x37a2c7=_0x4ba595[_0x3f317b(0xbe)]['filter'](_0x473303=>!_0x473303[_0x3f317b(0xcc)]['startsWith'](_0x3f317b(0xb4))),_0x5e649d=_0x37a2c7[_0x3f317b(0x9a)](_0x36e818=>_0x36e818[_0x3f317b(0xad)]!==void 0x0&&_0x36e818[_0x3f317b(0xad)]['content'][_0x3f317b(0xc3)]()!=='');for(let _0xeb5213 of _0x5e649d){let _0x5343a1=m(_0xeb5213['text'][_0x3f317b(0x8d)]),_0x56ecb9={..._0x5343a1['left']<-0x2?{'left':_(-_0x5343a1['left'])}:{},..._0x5343a1['top']<-0x2?{'top':_(-_0x5343a1[_0x3f317b(0x87)])}:{},..._0x5343a1['right']>_0x4ba595[_0x3f317b(0xbb)]+n?{'right':_(_0x5343a1[_0x3f317b(0xb6)]-_0x4ba595[_0x3f317b(0xbb)])}:{},..._0x5343a1[_0x3f317b(0xd5)]>_0x4ba595[_0x3f317b(0xce)]+n?{'bottom':_(_0x5343a1[_0x3f317b(0xd5)]-_0x4ba595['pageHeight'])}:{}},_0x513d53=D(_0x56ecb9);if(_0x513d53!=='-'){let _0x4a68a6=b(_0xeb5213),_0xe4a008=y({'left':0x0,'top':0x0,'width':_0x4ba595['pageWidth'],'height':_0x4ba595[_0x3f317b(0xce)]});_0x879ec3['push'](p({'page':_0x4ba595[_0x3f317b(0xb9)],'pageId':_0x4ba595[_0x3f317b(0xab)],'rule':'text-off-page','id':_0xeb5213[_0x3f317b(0xcc)],'text':_0x4a68a6,'pageBox':_0xe4a008,'overflow':_0x56ecb9,'detail':'text\x20\x22'+v(_0x4a68a6[_0x3f317b(0x90)])+_0x3f317b(0x74)+_0x513d53+');\x20ink\x20'+w(_0x4a68a6[_0x3f317b(0x8d)])+_0x3f317b(0x79)+w(_0xe4a008)}));}}for(let _0x7f7c85 of _0x5e649d){let _0x3ab711=E(_0x7f7c85,_0x37a2c7,_0x4ba595);if(_0x3ab711===void 0x0)continue;let _0x5c0afd=m(_0x7f7c85[_0x3f317b(0xad)][_0x3f317b(0x8d)]),_0x12977a=m(_0x3ab711['declared']),_0x3596d9=Math['max'](r,i*(_0x12977a[_0x3f317b(0xb6)]-_0x12977a[_0x3f317b(0x85)])),_0x26138a={..._0x12977a['left']-_0x5c0afd[_0x3f317b(0x85)]>_0x3596d9?{'left':_(_0x12977a[_0x3f317b(0x85)]-_0x5c0afd['left'])}:{},..._0x5c0afd['right']-_0x12977a[_0x3f317b(0xb6)]>_0x3596d9?{'right':_(_0x5c0afd[_0x3f317b(0xb6)]-_0x12977a[_0x3f317b(0xb6)])}:{},..._0x5c0afd['bottom']-_0x12977a[_0x3f317b(0xd5)]>_0x3596d9?{'bottom':_(_0x5c0afd[_0x3f317b(0xd5)]-_0x12977a[_0x3f317b(0xd5)])}:{}},_0x442cfb=D(_0x26138a);if(_0x442cfb!=='-'){let _0x5f15d3=b(_0x7f7c85),_0x3c1855=S(_0x3ab711);_0x879ec3[_0x3f317b(0x93)](p({'page':_0x4ba595[_0x3f317b(0xb9)],'pageId':_0x4ba595[_0x3f317b(0xab)],'rule':_0x3f317b(0xa6),'id':_0x7f7c85['elementId'],'related':_0x3ab711[_0x3f317b(0xcc)],'text':_0x5f15d3,'container':_0x3c1855,'overflow':_0x26138a,'detail':_0x3f317b(0xbd)+v(_0x5f15d3['content'])+'\x22\x20escapes\x20'+_0x3c1855['id']+'\x20('+_0x442cfb+_0x3f317b(0xac)+w(_0x5f15d3[_0x3f317b(0x8d)])+',\x20'+_0x3c1855['id']+_0x3f317b(0x7a)+_0x3c1855[_0x3f317b(0xa9)]+'\x20'+C(_0x3c1855[_0x3f317b(0x7d)])+'\x20'+w(_0x3c1855[_0x3f317b(0xc1)])}));}}for(let _0x49c12e=0x0;_0x49c12e<_0x5e649d[_0x3f317b(0x81)];_0x49c12e+=0x1)for(let _0x5e1348=_0x49c12e+0x1;_0x5e1348<_0x5e649d['length'];_0x5e1348+=0x1){let _0x346ad9=_0x5e649d[_0x49c12e],_0x222fa4=_0x5e649d[_0x5e1348],_0x4b0611=m(_0x346ad9[_0x3f317b(0xad)][_0x3f317b(0x8d)]),_0x567421=m(_0x222fa4[_0x3f317b(0xad)]['ink']),_0x59210d=h(g(_0x4b0611,_0x567421));if(_0x59210d<=0x1)continue;let _0x2886bc=_0x59210d/Math[_0x3f317b(0x97)](0x1,Math[_0x3f317b(0x89)](h(_0x4b0611),h(_0x567421)));if(_0x2886bc<=a)continue;let _0x945a9=b(_0x346ad9),_0x583968=b(_0x222fa4);_0x879ec3['push'](p({'page':_0x4ba595[_0x3f317b(0xb9)],'pageId':_0x4ba595['pageId'],'rule':'text-overlaps-text','id':_0x346ad9[_0x3f317b(0xcc)],'related':_0x222fa4[_0x3f317b(0xcc)],'text':_0x945a9,'other':_0x583968,'overlapRatio':Math[_0x3f317b(0xb5)](_0x2886bc*0x64)/0x64,'detail':_0x3f317b(0xbd)+v(_0x945a9['content'])+'\x22'+x(_0x945a9)+_0x3f317b(0xca)+v(_0x583968[_0x3f317b(0x90)])+'\x22'+x(_0x583968)+_0x3f317b(0xaa)+Math['round'](_0x2886bc*0x64)+'%\x20of\x20the\x20smaller\x20glyph\x20band;\x20ink\x20'+w(_0x945a9[_0x3f317b(0x8d)])+',\x20'+w(_0x583968['ink'])}));}}return _0x879ec3[_0x3f317b(0xd3)]((_0x50d7f9,_0x823c4d)=>_0x50d7f9[_0x3f317b(0x83)][_0x3f317b(0xa0)](_0x823c4d['fingerprint']));}function p(_0x5218aa){const _0x464a2c=_0x46dd64;return{..._0x5218aa,'fingerprint':[_0x5218aa[_0x464a2c(0x8a)],_0x5218aa['pageId'],_0x5218aa['id'],_0x5218aa[_0x464a2c(0x75)]??'']['join'](':'),'severity':_0x464a2c(0x98)};}function m(_0x563e6a){const _0x21a10f=_0x46dd64;return{'left':_0x563e6a[_0x21a10f(0x85)],'top':_0x563e6a[_0x21a10f(0x87)],'right':_0x563e6a[_0x21a10f(0x85)]+_0x563e6a[_0x21a10f(0x91)],'bottom':_0x563e6a[_0x21a10f(0x87)]+_0x563e6a[_0x21a10f(0x9e)]};}function h(_0x1aaeea){const _0x28a52b=_0x46dd64;return Math[_0x28a52b(0x97)](0x0,_0x1aaeea[_0x28a52b(0xb6)]-_0x1aaeea[_0x28a52b(0x85)])*Math[_0x28a52b(0x97)](0x0,_0x1aaeea[_0x28a52b(0xd5)]-_0x1aaeea[_0x28a52b(0x87)]);}function g(_0x348a04,_0x863402){const _0x542c10=_0x46dd64;return{'left':Math[_0x542c10(0x97)](_0x348a04[_0x542c10(0x85)],_0x863402[_0x542c10(0x85)]),'top':Math[_0x542c10(0x97)](_0x348a04[_0x542c10(0x87)],_0x863402[_0x542c10(0x87)]),'right':Math[_0x542c10(0x89)](_0x348a04['right'],_0x863402[_0x542c10(0xb6)]),'bottom':Math[_0x542c10(0x89)](_0x348a04['bottom'],_0x863402[_0x542c10(0xd5)])};}function _(_0x209a40){const _0x5a3eb0=_0x46dd64;return Math[_0x5a3eb0(0xb5)](_0x209a40);}function v(_0x299152){const _0x4d7c35=_0x46dd64;let _0x24fafc=_0x299152[_0x4d7c35(0x8c)](/\s+/gu,'\x20')[_0x4d7c35(0xc3)]();return _0x24fafc[_0x4d7c35(0x81)]<=0x10?_0x24fafc:_0x24fafc[_0x4d7c35(0xaf)](0x0,0x10)+'…';}function y(_0x42a9e9){const _0x345af1=_0x46dd64;return{'left':_(_0x42a9e9[_0x345af1(0x85)]),'top':_(_0x42a9e9[_0x345af1(0x87)]),'width':_(_0x42a9e9[_0x345af1(0x91)]),'height':_(_0x42a9e9[_0x345af1(0x9e)])};}function b(_0x3198ba){const _0x3fa01c=_0x46dd64;let _0x8fa012=_0x3198ba[_0x3fa01c(0xad)];return{'id':_0x3198ba[_0x3fa01c(0xcc)],'content':_0x8fa012[_0x3fa01c(0x90)],'ink':y(_0x8fa012['ink']),..._0x8fa012['color']===void 0x0?{}:{'color':_0x8fa012[_0x3fa01c(0x7c)]},..._0x8fa012['opacity']===void 0x0?{}:{'opacity':_0x8fa012[_0x3fa01c(0xa7)]}};}function x(_0x42afcd){const _0x4e0eeb=_0x46dd64;return _0x42afcd[_0x4e0eeb(0x7c)]===void 0x0&&_0x42afcd[_0x4e0eeb(0xa7)]===void 0x0?'':''+(_0x42afcd[_0x4e0eeb(0x7c)]===void 0x0?'':'\x20\x20'+_0x42afcd['color'])+(_0x42afcd['opacity']===void 0x0?'':_0x4e0eeb(0xd1)+_0x42afcd['opacity']);}function S(_0x2cf9ed){const _0x19c568=_0x46dd64;return{'id':_0x2cf9ed[_0x19c568(0xcc)],'type':_0x2cf9ed['shapeType']===void 0x0?_0x2cf9ed[_0x19c568(0xb3)]:_0x2cf9ed[_0x19c568(0xb3)]+':'+_0x2cf9ed[_0x19c568(0xb8)],..._0x2cf9ed[_0x19c568(0x7d)]===void 0x0?{}:{'fill':_0x2cf9ed[_0x19c568(0x7d)]},'box':y(_0x2cf9ed['declared'])};}function C(_0x591991){const _0x377d7b=_0x46dd64;if(_0x591991===void 0x0)return _0x377d7b(0xbf);let _0x38e4a1=_0x591991['opacity']===void 0x0||_0x591991['opacity']===0x1?'':'\x20@'+_0x591991['opacity'];return((_0x591991[_0x377d7b(0xa9)]??'?')+'\x20'+(_0x591991['color']??'')+_0x38e4a1)['trim']();}function w(_0x29d344){const _0x50464b=_0x46dd64;return'('+_0x29d344[_0x50464b(0x85)]+','+_0x29d344[_0x50464b(0x87)]+'\x20'+_0x29d344['width']+'×'+_0x29d344[_0x50464b(0x9e)]+')';}function _0xccdd(_0xe06d3f,_0x9ca436){_0xe06d3f=_0xe06d3f-0x74;const _0x5667a1=_0x5667();let _0xccddf1=_0x5667a1[_0xe06d3f];return _0xccddf1;}function T(_0x54fba7){const _0x294b7f=_0x46dd64;let _0x5074b8=_0x54fba7[_0x294b7f(0x7d)];return!(_0x5074b8===void 0x0||_0x5074b8[_0x294b7f(0xa9)]===_0x294b7f(0xd7)||_0x5074b8[_0x294b7f(0xa7)]!==void 0x0&&_0x5074b8[_0x294b7f(0xa7)]<o||_0x54fba7[_0x294b7f(0xb8)]===void 0x0||!s['has'](_0x54fba7['shapeType'])||_0x54fba7['visible']===!0x1);}function E(_0x3b02cd,_0x549da3,_0x1ec545){const _0x468f43=_0x46dd64;let _0xfc4cc3=m(_0x3b02cd[_0x468f43(0xad)][_0x468f43(0x8d)]),_0x586db8;for(let _0x28c8b2 of _0x549da3){if(_0x28c8b2[_0x468f43(0xcd)]>=_0x3b02cd[_0x468f43(0xcd)]||!T(_0x28c8b2))continue;let _0x4c2db6=m(_0x28c8b2['declared']),_0xcede10=h(_0x4c2db6);if(_0xcede10>=0.5*_0x1ec545[_0x468f43(0xbb)]*_0x1ec545[_0x468f43(0xce)])continue;let _0xd4862c=_0xfc4cc3[_0x468f43(0x87)]>=_0x4c2db6[_0x468f43(0x87)]-n&&_0xfc4cc3[_0x468f43(0xd5)]<=_0x4c2db6['bottom']+n,_0x2cad73=_0xfc4cc3['left']>=_0x4c2db6[_0x468f43(0x85)]-n&&_0xfc4cc3[_0x468f43(0x85)]<=_0x4c2db6[_0x468f43(0xb6)]+n&&_0xfc4cc3[_0x468f43(0x87)]>=_0x4c2db6['top']-n,_0x11b918=h(g(_0xfc4cc3,_0x4c2db6))/Math['max'](h(_0xfc4cc3),0x1);!_0xd4862c||!_0x2cad73||_0x11b918<0.35||(_0x586db8===void 0x0||_0xcede10<_0x586db8[_0x468f43(0x77)])&&(_0x586db8={'element':_0x28c8b2,'area':_0xcede10});}return _0x586db8?.[_0x468f43(0xba)];}function D(_0x28e4f9){const _0x137162=_0x46dd64;let _0xc8e941=[_0x28e4f9[_0x137162(0x85)]===void 0x0?'':_0x137162(0x9b)+_0x28e4f9['left']+'px',_0x28e4f9[_0x137162(0x87)]===void 0x0?'':_0x137162(0x8f)+_0x28e4f9[_0x137162(0x87)]+'px',_0x28e4f9[_0x137162(0xb6)]===void 0x0?'':_0x137162(0xb0)+_0x28e4f9[_0x137162(0xb6)]+'px',_0x28e4f9[_0x137162(0xd5)]===void 0x0?'':_0x137162(0xa2)+_0x28e4f9[_0x137162(0xd5)]+'px'][_0x137162(0x9a)](_0x2c0800=>_0x2c0800!=='');return _0xc8e941['length']===0x0?'-':_0xc8e941[_0x137162(0x7e)](',\x20');}function _0x5667(){const _0x5866cb=['related','text-off-page','area','INVALID_INPUT',',\x20page\x20','\x20=\x20','6DxRmkz','color','fill','join','392979RDEjQZ','19000404EGnEgU','length','unit-layout-lint','fingerprint','findIndex','left','pages','top','1801792CbKxBd','min','rule','2157190bkMMRn','replace','ink','string','top\x20','content','width','slide','push','rect','UnitLayoutLintError','formulaReferenceUnits','max','warning','runtime','filter','left\x20','pages\x20must\x20not\x20be\x20empty','isInteger','height','unitData','localeCompare','137247aQWBwc','bottom\x20','Render\x20result\x20does\x20not\x20contain\x20exactly\x20one\x20matching\x20page\x20','Render\x20result\x20contains\x20unrequested\x20Slide\x20pages','code','text-escapes-container','opacity','174664VQuTJO','type','\x20by\x20','pageId',');\x20ink\x20','text','name','slice','right\x20','roundRect','captureSlideLayout','elementType','layout:','round','right','Slide\x20unitData.id\x20is\x20required','shapeType','page','element','pageWidth','number','text\x20\x22','elements','no\x20fill','Render\x20result\x20contains\x20duplicate\x20element\x20identities\x20on\x20page\x20','box','has','trim','get','258CLDXAj','add','4231048GaCidy','Slide\x20has\x20no\x20pages\x20to\x20lint','signal','\x20overlaps\x20\x22','slideOrder','elementId','zIndex','pageHeight','Slide\x20page\x20selector\x20is\x20invalid:\x20','INVALID_RENDER_RESULT','\x20\x20opacity\x20','text-overlaps-text','sort','size','bottom','map','none','\x22\x20runs\x20off\x20the\x20page\x20('];_0x5667=function(){return _0x5866cb;};return _0x5667();}function O(_0x4e4e05){const _0x2dfc89=_0x46dd64;if(typeof _0x4e4e05!=_0x2dfc89(0x8e)||_0x4e4e05[_0x2dfc89(0xc3)]()==='')throw new e('INVALID_INPUT',_0x2dfc89(0xb7));return _0x4e4e05;}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.0",
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.0"
21
+ "@univer-cli/univer-render-runtime": "1.4.0"
22
22
  }
23
23
  }