@univer-cli/unit-layout-lint 1.0.3 → 1.1.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
|
-
const _0xf669b1=_0x14b1;(function(_0x5baacd,_0x1c95c3){const _0x16d1ac=_0x14b1,_0x4fc758=_0x5baacd();while(!![]){try{const _0x45cb51=parseInt(_0x16d1ac(0x1cd))/0x1+-parseInt(_0x16d1ac(0x1be))/0x2*(-parseInt(_0x16d1ac(0x198))/0x3)+parseInt(_0x16d1ac(0x1c9))/0x4+-parseInt(_0x16d1ac(0x1e6))/0x5*(-parseInt(_0x16d1ac(0x1af))/0x6)+parseInt(_0x16d1ac(0x1d0))/0x7*(-parseInt(_0x16d1ac(0x1e0))/0x8)+-parseInt(_0x16d1ac(0x1a9))/0x9+parseInt(_0x16d1ac(0x1ae))/0xa*(-parseInt(_0x16d1ac(0x1d4))/0xb);if(_0x45cb51===_0x1c95c3)break;else _0x4fc758['push'](_0x4fc758['shift']());}catch(_0x43a4e4){_0x4fc758['push'](_0x4fc758['shift']());}}}(_0x4594,0x44162));var e=class extends Error{[_0xf669b1(0x1a0)];constructor(_0x72df5a,_0x4330b5,_0x2bdccb){const _0x7e5f58=_0xf669b1;super(_0x4330b5,_0x2bdccb),this[_0x7e5f58(0x1ce)]='UnitLayoutLintError',this['code']=_0x72df5a;}};function t(_0x3d0e90){return _0x3d0e90 instanceof e;}var n=0x2,r=0x6,i=0.02,a=0.15,o=0.5,s=new Set([_0xf669b1(0x1c7),_0xf669b1(0x1b8)]),c=[_0xf669b1(0x1ca),'text-escapes-container',_0xf669b1(0x194)];function l(_0xd16c){return{async 'lint'(_0x3256fc){const _0x118e31=_0x14b1;if(_0x3256fc[_0x118e31(0x1e8)]!==_0x118e31(0x1c1))throw new e(_0x118e31(0x1b1),_0x118e31(0x1ba));let _0x4f1cbe=O(_0x3256fc['unitData']['id']),_0x280011=u(_0x3256fc[_0x118e31(0x199)]['slideOrder']??[],_0x3256fc['pages']),_0x30de4f=await _0xd16c['runtime'][_0x118e31(0x1c4)]({'unitType':_0x118e31(0x1c1),'unitData':_0x3256fc['unitData'],..._0x3256fc['formulaReferenceUnits']===void 0x0?{}:{'formulaReferenceUnits':_0x3256fc[_0x118e31(0x1cc)]},'pages':_0x280011[_0x118e31(0x1d7)](({page:_0x35631c})=>_0x35631c),..._0x3256fc[_0x118e31(0x1ab)]===void 0x0?{}:{'signal':_0x3256fc[_0x118e31(0x1ab)]}});return d(_0x30de4f,_0x280011),{'kind':'unit-layout-lint','unitId':_0x4f1cbe,'unitType':_0x118e31(0x1c1),'coverage':{'pages':_0x280011,'rules':c},'findings':f(_0x30de4f)};}};}function u(_0x21d80a,_0x36de44){const _0x3aec75=_0xf669b1;if(_0x21d80a['length']===0x0)throw new e(_0x3aec75(0x1b1),'Slide\x20has\x20no\x20pages\x20to\x20lint');if(_0x36de44!==void 0x0&&_0x36de44['length']===0x0)throw new e(_0x3aec75(0x1b1),_0x3aec75(0x1d2));let _0x19f799=_0x36de44??_0x21d80a[_0x3aec75(0x1d7)]((_0x239a8b,_0x34378b)=>_0x34378b+0x1),_0x569e63=new Set(),_0x175166=[];for(let _0x1189de of _0x19f799){let _0x49acfb=typeof _0x1189de==_0x3aec75(0x1c6)?_0x1189de:_0x21d80a[_0x3aec75(0x1b4)](_0x275f0d=>_0x275f0d===_0x1189de)+0x1;if(!Number[_0x3aec75(0x1b2)](_0x49acfb)||_0x49acfb<0x1||_0x49acfb>_0x21d80a[_0x3aec75(0x1b5)])throw new e('INVALID_INPUT',_0x3aec75(0x1dc)+String(_0x1189de));let _0x5197fe=_0x21d80a[_0x49acfb-0x1];_0x569e63['has'](_0x5197fe)||(_0x569e63[_0x3aec75(0x1bc)](_0x5197fe),_0x175166[_0x3aec75(0x1a1)]({'page':_0x49acfb,'pageId':_0x5197fe}));}return _0x175166;}function d(_0x8ee114,_0xa72b48){const _0x1393ea=_0xf669b1;let _0x377060=new Map();for(let _0x37d2a2 of _0x8ee114['pages']){let _0x2cc98e=_0x377060[_0x1393ea(0x1ea)](_0x37d2a2[_0x1393ea(0x1a7)])??[];_0x2cc98e[_0x1393ea(0x1a1)](_0x37d2a2),_0x377060['set'](_0x37d2a2[_0x1393ea(0x1a7)],_0x2cc98e);}for(let _0x40264b of _0xa72b48){let _0x385c93=_0x377060[_0x1393ea(0x1ea)](_0x40264b[_0x1393ea(0x1a7)])??[];if(_0x385c93['length']!==0x1||_0x385c93[0x0]?.[_0x1393ea(0x1c8)]!==_0x40264b[_0x1393ea(0x1c8)])throw new e(_0x1393ea(0x1b7),'Render\x20result\x20does\x20not\x20contain\x20exactly\x20one\x20matching\x20page\x20'+_0x40264b[_0x1393ea(0x1a7)]);let _0x2b501e=_0x385c93[0x0][_0x1393ea(0x1ee)][_0x1393ea(0x1d7)](({elementId:_0x1a076e})=>_0x1a076e);if(new Set(_0x2b501e)[_0x1393ea(0x1bb)]!==_0x2b501e['length'])throw new e(_0x1393ea(0x1b7),_0x1393ea(0x19a)+_0x40264b[_0x1393ea(0x1a7)]);}if(_0x8ee114['pages'][_0x1393ea(0x1b5)]!==_0xa72b48[_0x1393ea(0x1b5)])throw new e(_0x1393ea(0x1b7),'Render\x20result\x20contains\x20unrequested\x20Slide\x20pages');}function f(_0x213ca5){const _0x1eb962=_0xf669b1;let _0x2066f4=[];for(let _0x109d52 of _0x213ca5['pages']){let _0x5e29f2=_0x109d52[_0x1eb962(0x1ee)]['filter'](_0x3bdccb=>!_0x3bdccb[_0x1eb962(0x1c3)]['startsWith'](_0x1eb962(0x1d5))),_0x4c09cf=_0x5e29f2[_0x1eb962(0x1e2)](_0x3ee58b=>_0x3ee58b[_0x1eb962(0x1ad)]!==void 0x0&&_0x3ee58b['text'][_0x1eb962(0x1db)][_0x1eb962(0x1e4)]()!=='');for(let _0x1036a8 of _0x4c09cf){let _0x354caa=m(_0x1036a8['text']['ink']),_0x1ddd24={..._0x354caa[_0x1eb962(0x1d9)]<-0x2?{'left':_(-_0x354caa[_0x1eb962(0x1d9)])}:{},..._0x354caa[_0x1eb962(0x1b9)]<-0x2?{'top':_(-_0x354caa[_0x1eb962(0x1b9)])}:{},..._0x354caa[_0x1eb962(0x1aa)]>_0x109d52[_0x1eb962(0x1bf)]+n?{'right':_(_0x354caa['right']-_0x109d52['pageWidth'])}:{},..._0x354caa[_0x1eb962(0x1c0)]>_0x109d52[_0x1eb962(0x1d3)]+n?{'bottom':_(_0x354caa[_0x1eb962(0x1c0)]-_0x109d52[_0x1eb962(0x1d3)])}:{}},_0x62888a=D(_0x1ddd24);if(_0x62888a!=='-'){let _0xf28c10=b(_0x1036a8),_0x4dc957=y({'left':0x0,'top':0x0,'width':_0x109d52[_0x1eb962(0x1bf)],'height':_0x109d52['pageHeight']});_0x2066f4[_0x1eb962(0x1a1)](p({'page':_0x109d52['page'],'pageId':_0x109d52['pageId'],'rule':_0x1eb962(0x1ca),'id':_0x1036a8[_0x1eb962(0x1c3)],'text':_0xf28c10,'pageBox':_0x4dc957,'overflow':_0x1ddd24,'detail':'text\x20\x22'+v(_0xf28c10[_0x1eb962(0x1db)])+'\x22\x20runs\x20off\x20the\x20page\x20('+_0x62888a+_0x1eb962(0x1cf)+w(_0xf28c10[_0x1eb962(0x1c5)])+_0x1eb962(0x1ef)+w(_0x4dc957)}));}}for(let _0x255268 of _0x4c09cf){let _0x2fff46=E(_0x255268,_0x5e29f2,_0x109d52);if(_0x2fff46===void 0x0)continue;let _0x5e496f=m(_0x255268['text'][_0x1eb962(0x1c5)]),_0x3e7a0e=m(_0x2fff46[_0x1eb962(0x1e9)]),_0x3d432b=Math[_0x1eb962(0x1d6)](r,i*(_0x3e7a0e['right']-_0x3e7a0e[_0x1eb962(0x1d9)])),_0x232d5c={..._0x3e7a0e[_0x1eb962(0x1d9)]-_0x5e496f[_0x1eb962(0x1d9)]>_0x3d432b?{'left':_(_0x3e7a0e[_0x1eb962(0x1d9)]-_0x5e496f['left'])}:{},..._0x5e496f[_0x1eb962(0x1aa)]-_0x3e7a0e[_0x1eb962(0x1aa)]>_0x3d432b?{'right':_(_0x5e496f[_0x1eb962(0x1aa)]-_0x3e7a0e['right'])}:{},..._0x5e496f[_0x1eb962(0x1c0)]-_0x3e7a0e['bottom']>_0x3d432b?{'bottom':_(_0x5e496f[_0x1eb962(0x1c0)]-_0x3e7a0e[_0x1eb962(0x1c0)])}:{}},_0xbaf9f5=D(_0x232d5c);if(_0xbaf9f5!=='-'){let _0x51a296=b(_0x255268),_0x32723b=S(_0x2fff46);_0x2066f4['push'](p({'page':_0x109d52[_0x1eb962(0x1c8)],'pageId':_0x109d52[_0x1eb962(0x1a7)],'rule':_0x1eb962(0x197),'id':_0x255268[_0x1eb962(0x1c3)],'related':_0x2fff46[_0x1eb962(0x1c3)],'text':_0x51a296,'container':_0x32723b,'overflow':_0x232d5c,'detail':_0x1eb962(0x1a4)+v(_0x51a296[_0x1eb962(0x1db)])+_0x1eb962(0x19c)+_0x32723b['id']+'\x20('+_0xbaf9f5+');\x20ink\x20'+w(_0x51a296[_0x1eb962(0x1c5)])+',\x20'+_0x32723b['id']+_0x1eb962(0x1e5)+_0x32723b[_0x1eb962(0x196)]+'\x20'+C(_0x32723b[_0x1eb962(0x1eb)])+'\x20'+w(_0x32723b[_0x1eb962(0x19b)])}));}}for(let _0x3f8622=0x0;_0x3f8622<_0x4c09cf[_0x1eb962(0x1b5)];_0x3f8622+=0x1)for(let _0x581200=_0x3f8622+0x1;_0x581200<_0x4c09cf['length'];_0x581200+=0x1){let _0x4a031d=_0x4c09cf[_0x3f8622],_0x4cb58e=_0x4c09cf[_0x581200],_0x2631ad=m(_0x4a031d['text'][_0x1eb962(0x1c5)]),_0x24e028=m(_0x4cb58e[_0x1eb962(0x1ad)][_0x1eb962(0x1c5)]),_0x398026=h(g(_0x2631ad,_0x24e028));if(_0x398026<=0x1)continue;let _0x5ab75e=_0x398026/Math['max'](0x1,Math[_0x1eb962(0x19f)](h(_0x2631ad),h(_0x24e028)));if(_0x5ab75e<=a)continue;let _0x27ca18=b(_0x4a031d),_0x361176=b(_0x4cb58e);_0x2066f4[_0x1eb962(0x1a1)](p({'page':_0x109d52['page'],'pageId':_0x109d52['pageId'],'rule':'text-overlaps-text','id':_0x4a031d['elementId'],'related':_0x4cb58e['elementId'],'text':_0x27ca18,'other':_0x361176,'overlapRatio':Math[_0x1eb962(0x193)](_0x5ab75e*0x64)/0x64,'detail':'text\x20\x22'+v(_0x27ca18[_0x1eb962(0x1db)])+'\x22'+x(_0x27ca18)+_0x1eb962(0x1d1)+v(_0x361176[_0x1eb962(0x1db)])+'\x22'+x(_0x361176)+_0x1eb962(0x1da)+Math[_0x1eb962(0x193)](_0x5ab75e*0x64)+_0x1eb962(0x1ed)+w(_0x27ca18[_0x1eb962(0x1c5)])+',\x20'+w(_0x361176[_0x1eb962(0x1c5)])}));}}return _0x2066f4['sort']((_0x5f4047,_0x4230ef)=>_0x5f4047[_0x1eb962(0x1df)][_0x1eb962(0x1b6)](_0x4230ef['fingerprint']));}function p(_0x129535){const _0x17bf89=_0xf669b1;return{..._0x129535,'fingerprint':[_0x129535[_0x17bf89(0x1b3)],_0x129535['pageId'],_0x129535['id'],_0x129535['related']??'']['join'](':'),'severity':_0x17bf89(0x1de)};}function m(_0x2048c9){const _0x280975=_0xf669b1;return{'left':_0x2048c9['left'],'top':_0x2048c9[_0x280975(0x1b9)],'right':_0x2048c9[_0x280975(0x1d9)]+_0x2048c9['width'],'bottom':_0x2048c9['top']+_0x2048c9['height']};}function h(_0x2f0eec){const _0x191cc3=_0xf669b1;return Math['max'](0x0,_0x2f0eec[_0x191cc3(0x1aa)]-_0x2f0eec[_0x191cc3(0x1d9)])*Math[_0x191cc3(0x1d6)](0x0,_0x2f0eec[_0x191cc3(0x1c0)]-_0x2f0eec[_0x191cc3(0x1b9)]);}function g(_0x371cbe,_0x4acdeb){const _0x294319=_0xf669b1;return{'left':Math['max'](_0x371cbe[_0x294319(0x1d9)],_0x4acdeb[_0x294319(0x1d9)]),'top':Math[_0x294319(0x1d6)](_0x371cbe[_0x294319(0x1b9)],_0x4acdeb[_0x294319(0x1b9)]),'right':Math[_0x294319(0x19f)](_0x371cbe['right'],_0x4acdeb['right']),'bottom':Math[_0x294319(0x19f)](_0x371cbe['bottom'],_0x4acdeb[_0x294319(0x1c0)])};}function _(_0x169a19){const _0x3c8ccb=_0xf669b1;return Math[_0x3c8ccb(0x193)](_0x169a19);}function v(_0x33855f){const _0x3ff166=_0xf669b1;let _0x22bd4e=_0x33855f[_0x3ff166(0x1e7)](/\s+/gu,'\x20')[_0x3ff166(0x1e4)]();return _0x22bd4e[_0x3ff166(0x1b5)]<=0x10?_0x22bd4e:_0x22bd4e[_0x3ff166(0x1ac)](0x0,0x10)+'…';}function y(_0x4f3d15){const _0x52fb7e=_0xf669b1;return{'left':_(_0x4f3d15['left']),'top':_(_0x4f3d15[_0x52fb7e(0x1b9)]),'width':_(_0x4f3d15[_0x52fb7e(0x1e1)]),'height':_(_0x4f3d15[_0x52fb7e(0x1a8)])};}function _0x4594(){const _0x51e031=[',\x20page\x20','round','text-overlaps-text','bottom\x20','type','text-escapes-container','718599kJiAEb','unitData','Render\x20result\x20contains\x20duplicate\x20element\x20identities\x20on\x20page\x20','box','\x22\x20escapes\x20','left\x20','opacity','min','code','push','Slide\x20unitData.id\x20is\x20required','shapeType','text\x20\x22','visible','zIndex','pageId','height','3165822EFkKde','right','signal','slice','text','1370fJendb','494136tQoYaD','join','INVALID_INPUT','isInteger','rule','findIndex','length','localeCompare','INVALID_RENDER_RESULT','roundRect','top','Unit\x20layout\x20lint\x20currently\x20supports\x20Slide\x20only','size','add','color','4eEarnx','pageWidth','bottom','slide','none','elementId','captureSlideLayout','ink','number','rect','page','2190472bfDfiL','text-off-page','has','formulaReferenceUnits','388639CHAYYN','name',');\x20ink\x20','15085cvxuUl','\x20overlaps\x20\x22','pages\x20must\x20not\x20be\x20empty','pageHeight','87934MSXiPJ','layout:','max','map','elementType','left','\x20by\x20','content','Slide\x20page\x20selector\x20is\x20invalid:\x20','string','warning','fingerprint','376wqJPUh','width','filter','right\x20','trim','\x20=\x20','25KYDRxH','replace','unitType','declared','get','fill','area','%\x20of\x20the\x20smaller\x20glyph\x20band;\x20ink\x20','elements'];_0x4594=function(){return _0x51e031;};return _0x4594();}function _0x14b1(_0x263b2f,_0x192dcf){_0x263b2f=_0x263b2f-0x193;const _0x4594f5=_0x4594();let _0x14b1cc=_0x4594f5[_0x263b2f];return _0x14b1cc;}function b(_0x198cce){const _0x23c587=_0xf669b1;let _0x55600a=_0x198cce[_0x23c587(0x1ad)];return{'id':_0x198cce[_0x23c587(0x1c3)],'content':_0x55600a[_0x23c587(0x1db)],'ink':y(_0x55600a[_0x23c587(0x1c5)]),..._0x55600a[_0x23c587(0x1bd)]===void 0x0?{}:{'color':_0x55600a[_0x23c587(0x1bd)]},..._0x55600a[_0x23c587(0x19e)]===void 0x0?{}:{'opacity':_0x55600a[_0x23c587(0x19e)]}};}function x(_0xa167f2){const _0x2d1e0a=_0xf669b1;return _0xa167f2[_0x2d1e0a(0x1bd)]===void 0x0&&_0xa167f2['opacity']===void 0x0?'':''+(_0xa167f2[_0x2d1e0a(0x1bd)]===void 0x0?'':'\x20\x20'+_0xa167f2[_0x2d1e0a(0x1bd)])+(_0xa167f2[_0x2d1e0a(0x19e)]===void 0x0?'':'\x20\x20opacity\x20'+_0xa167f2[_0x2d1e0a(0x19e)]);}function S(_0x3961f8){const _0x976973=_0xf669b1;return{'id':_0x3961f8[_0x976973(0x1c3)],'type':_0x3961f8[_0x976973(0x1a3)]===void 0x0?_0x3961f8[_0x976973(0x1d8)]:_0x3961f8[_0x976973(0x1d8)]+':'+_0x3961f8['shapeType'],..._0x3961f8[_0x976973(0x1eb)]===void 0x0?{}:{'fill':_0x3961f8['fill']},'box':y(_0x3961f8[_0x976973(0x1e9)])};}function C(_0x2f9458){const _0x5971cb=_0xf669b1;if(_0x2f9458===void 0x0)return'no\x20fill';let _0x3c789a=_0x2f9458[_0x5971cb(0x19e)]===void 0x0||_0x2f9458[_0x5971cb(0x19e)]===0x1?'':'\x20@'+_0x2f9458['opacity'];return((_0x2f9458['type']??'?')+'\x20'+(_0x2f9458[_0x5971cb(0x1bd)]??'')+_0x3c789a)[_0x5971cb(0x1e4)]();}function w(_0x4b8bd6){const _0x4f49d2=_0xf669b1;return'('+_0x4b8bd6[_0x4f49d2(0x1d9)]+','+_0x4b8bd6[_0x4f49d2(0x1b9)]+'\x20'+_0x4b8bd6[_0x4f49d2(0x1e1)]+'×'+_0x4b8bd6[_0x4f49d2(0x1a8)]+')';}function T(_0x203c8e){const _0x371cf0=_0xf669b1;let _0x2e9928=_0x203c8e['fill'];return!(_0x2e9928===void 0x0||_0x2e9928[_0x371cf0(0x196)]===_0x371cf0(0x1c2)||_0x2e9928['opacity']!==void 0x0&&_0x2e9928[_0x371cf0(0x19e)]<o||_0x203c8e[_0x371cf0(0x1a3)]===void 0x0||!s[_0x371cf0(0x1cb)](_0x203c8e['shapeType'])||_0x203c8e[_0x371cf0(0x1a5)]===!0x1);}function E(_0x3440c6,_0x49b129,_0x537939){const _0x50d674=_0xf669b1;let _0x1c2027=m(_0x3440c6[_0x50d674(0x1ad)][_0x50d674(0x1c5)]),_0x5a1f24;for(let _0x1b2daf of _0x49b129){if(_0x1b2daf[_0x50d674(0x1a6)]>=_0x3440c6[_0x50d674(0x1a6)]||!T(_0x1b2daf))continue;let _0x139c20=m(_0x1b2daf[_0x50d674(0x1e9)]),_0x5c77de=h(_0x139c20);if(_0x5c77de>=0.5*_0x537939[_0x50d674(0x1bf)]*_0x537939[_0x50d674(0x1d3)])continue;let _0x145da7=_0x1c2027[_0x50d674(0x1b9)]>=_0x139c20[_0x50d674(0x1b9)]-n&&_0x1c2027[_0x50d674(0x1c0)]<=_0x139c20[_0x50d674(0x1c0)]+n,_0x2f334c=_0x1c2027[_0x50d674(0x1d9)]>=_0x139c20[_0x50d674(0x1d9)]-n&&_0x1c2027['left']<=_0x139c20[_0x50d674(0x1aa)]+n&&_0x1c2027[_0x50d674(0x1b9)]>=_0x139c20[_0x50d674(0x1b9)]-n,_0x282898=h(g(_0x1c2027,_0x139c20))/Math['max'](h(_0x1c2027),0x1);!_0x145da7||!_0x2f334c||_0x282898<0.35||(_0x5a1f24===void 0x0||_0x5c77de<_0x5a1f24[_0x50d674(0x1ec)])&&(_0x5a1f24={'element':_0x1b2daf,'area':_0x5c77de});}return _0x5a1f24?.['element'];}function D(_0x24bbce){const _0x3b6b16=_0xf669b1;let _0x22b07a=[_0x24bbce[_0x3b6b16(0x1d9)]===void 0x0?'':_0x3b6b16(0x19d)+_0x24bbce[_0x3b6b16(0x1d9)]+'px',_0x24bbce[_0x3b6b16(0x1b9)]===void 0x0?'':'top\x20'+_0x24bbce[_0x3b6b16(0x1b9)]+'px',_0x24bbce[_0x3b6b16(0x1aa)]===void 0x0?'':_0x3b6b16(0x1e3)+_0x24bbce[_0x3b6b16(0x1aa)]+'px',_0x24bbce[_0x3b6b16(0x1c0)]===void 0x0?'':_0x3b6b16(0x195)+_0x24bbce[_0x3b6b16(0x1c0)]+'px'][_0x3b6b16(0x1e2)](_0x1d259c=>_0x1d259c!=='');return _0x22b07a[_0x3b6b16(0x1b5)]===0x0?'-':_0x22b07a[_0x3b6b16(0x1b0)](',\x20');}function O(_0x21f821){const _0x2dd19f=_0xf669b1;if(typeof _0x21f821!=_0x2dd19f(0x1dd)||_0x21f821[_0x2dd19f(0x1e4)]()==='')throw new e('INVALID_INPUT',_0x2dd19f(0x1a2));return _0x21f821;}export{e as UnitLayoutLintError,l as createUnitLayoutLint,t as isUnitLayoutLintError};
|
|
1
|
+
const _0x36629f=_0x53a5;(function(_0x284c65,_0x29f67b){const _0x5b59d0=_0x53a5,_0x6a22bd=_0x284c65();while(!![]){try{const _0x1ca410=-parseInt(_0x5b59d0(0x101))/0x1*(parseInt(_0x5b59d0(0xfb))/0x2)+parseInt(_0x5b59d0(0x105))/0x3+-parseInt(_0x5b59d0(0xf4))/0x4+-parseInt(_0x5b59d0(0x102))/0x5+parseInt(_0x5b59d0(0x108))/0x6*(-parseInt(_0x5b59d0(0xe2))/0x7)+parseInt(_0x5b59d0(0x114))/0x8*(-parseInt(_0x5b59d0(0x104))/0x9)+parseInt(_0x5b59d0(0x126))/0xa;if(_0x1ca410===_0x29f67b)break;else _0x6a22bd['push'](_0x6a22bd['shift']());}catch(_0x1c26ab){_0x6a22bd['push'](_0x6a22bd['shift']());}}}(_0x208c,0xd9ed3));var e=class extends Error{[_0x36629f(0x10f)];constructor(_0x1ea7b2,_0x397e7d,_0x30b85d){const _0x417eff=_0x36629f;super(_0x397e7d,_0x30b85d),this[_0x417eff(0xe1)]=_0x417eff(0xd7),this[_0x417eff(0x10f)]=_0x1ea7b2;}};function t(_0x35f2f3){return _0x35f2f3 instanceof e;}function _0x53a5(_0x287a1f,_0x520ba2){_0x287a1f=_0x287a1f-0xd5;const _0x208cf5=_0x208c();let _0x53a5df=_0x208cf5[_0x287a1f];return _0x53a5df;}var n=0x2,r=0x6,i=0.02,a=0.15,o=0.5,s=new Set([_0x36629f(0xeb),_0x36629f(0xdc)]),c=[_0x36629f(0xf1),'text-escapes-container',_0x36629f(0x10b)];function l(_0x5009b6){return{async 'lint'(_0x1a8a3b){const _0x4ba205=_0x53a5;if(_0x1a8a3b[_0x4ba205(0xd8)]!==_0x4ba205(0xee))throw new e(_0x4ba205(0xe9),_0x4ba205(0x106));let _0x1cd44f=O(_0x1a8a3b[_0x4ba205(0x125)]['id']),_0x3ffbc8=u(_0x1a8a3b[_0x4ba205(0x125)]['slideOrder']??[],_0x1a8a3b[_0x4ba205(0x10a)]),_0x494730=await _0x5009b6[_0x4ba205(0xf5)]['captureSlideLayout']({'unitType':_0x4ba205(0xee),'unitData':_0x1a8a3b[_0x4ba205(0x125)],..._0x1a8a3b['formulaReferenceUnits']===void 0x0?{}:{'formulaReferenceUnits':_0x1a8a3b['formulaReferenceUnits']},'pages':_0x3ffbc8[_0x4ba205(0x10d)](({page:_0x5e237e})=>_0x5e237e),..._0x1a8a3b[_0x4ba205(0xf7)]===void 0x0?{}:{'signal':_0x1a8a3b['signal']}});return d(_0x494730,_0x3ffbc8),{'kind':'unit-layout-lint','unitId':_0x1cd44f,'unitType':_0x4ba205(0xee),'coverage':{'pages':_0x3ffbc8,'rules':c},'findings':f(_0x494730)};}};}function u(_0x4a5696,_0x128cef){const _0x1a7cef=_0x36629f;if(_0x4a5696[_0x1a7cef(0xe3)]===0x0)throw new e(_0x1a7cef(0xe9),'Slide\x20has\x20no\x20pages\x20to\x20lint');if(_0x128cef!==void 0x0&&_0x128cef[_0x1a7cef(0xe3)]===0x0)throw new e(_0x1a7cef(0xe9),_0x1a7cef(0x117));let _0x209995=_0x128cef??_0x4a5696[_0x1a7cef(0x10d)]((_0x50d621,_0xe5d54)=>_0xe5d54+0x1),_0xb010b6=new Set(),_0x1363c9=[];for(let _0x305805 of _0x209995){let _0x4eef42=typeof _0x305805==_0x1a7cef(0x12a)?_0x305805:_0x4a5696[_0x1a7cef(0x131)](_0x1cef47=>_0x1cef47===_0x305805)+0x1;if(!Number[_0x1a7cef(0x121)](_0x4eef42)||_0x4eef42<0x1||_0x4eef42>_0x4a5696['length'])throw new e(_0x1a7cef(0xe9),_0x1a7cef(0x112)+String(_0x305805));let _0x3d2af0=_0x4a5696[_0x4eef42-0x1];_0xb010b6[_0x1a7cef(0x124)](_0x3d2af0)||(_0xb010b6[_0x1a7cef(0xde)](_0x3d2af0),_0x1363c9[_0x1a7cef(0x122)]({'page':_0x4eef42,'pageId':_0x3d2af0}));}return _0x1363c9;}function d(_0x423217,_0x270d28){const _0x531f3a=_0x36629f;let _0x2bf486=new Map();for(let _0x10e6b3 of _0x423217['pages']){let _0x39bc35=_0x2bf486['get'](_0x10e6b3[_0x531f3a(0xe8)])??[];_0x39bc35['push'](_0x10e6b3),_0x2bf486[_0x531f3a(0xe4)](_0x10e6b3[_0x531f3a(0xe8)],_0x39bc35);}for(let _0x176c13 of _0x270d28){let _0x47ba8f=_0x2bf486[_0x531f3a(0xf3)](_0x176c13[_0x531f3a(0xe8)])??[];if(_0x47ba8f['length']!==0x1||_0x47ba8f[0x0]?.[_0x531f3a(0xdf)]!==_0x176c13[_0x531f3a(0xdf)])throw new e('INVALID_RENDER_RESULT','Render\x20result\x20does\x20not\x20contain\x20exactly\x20one\x20matching\x20page\x20'+_0x176c13[_0x531f3a(0xe8)]);let _0x25337a=_0x47ba8f[0x0][_0x531f3a(0xd5)][_0x531f3a(0x10d)](({elementId:_0x5da1d1})=>_0x5da1d1);if(new Set(_0x25337a)['size']!==_0x25337a[_0x531f3a(0xe3)])throw new e(_0x531f3a(0xfd),_0x531f3a(0xda)+_0x176c13['pageId']);}if(_0x423217[_0x531f3a(0x10a)][_0x531f3a(0xe3)]!==_0x270d28[_0x531f3a(0xe3)])throw new e(_0x531f3a(0xfd),_0x531f3a(0x107));}function f(_0x124103){const _0x7194cf=_0x36629f;let _0xe0c529=[];for(let _0x1f7f5c of _0x124103[_0x7194cf(0x10a)]){let _0x17a2a7=_0x1f7f5c['elements'][_0x7194cf(0x111)](_0x27dbe5=>!_0x27dbe5['elementId'][_0x7194cf(0x12d)](_0x7194cf(0x11e))),_0x129888=_0x17a2a7[_0x7194cf(0x111)](_0x1fcd72=>_0x1fcd72[_0x7194cf(0xff)]!==void 0x0&&_0x1fcd72[_0x7194cf(0xff)]['content'][_0x7194cf(0x103)]()!=='');for(let _0x5e15a8 of _0x129888){let _0x2b9bb9=m(_0x5e15a8['text'][_0x7194cf(0x127)]),_0x16352b={..._0x2b9bb9['left']<-0x2?{'left':_(-_0x2b9bb9[_0x7194cf(0x110)])}:{},..._0x2b9bb9['top']<-0x2?{'top':_(-_0x2b9bb9[_0x7194cf(0x132)])}:{},..._0x2b9bb9[_0x7194cf(0x116)]>_0x1f7f5c[_0x7194cf(0x119)]+n?{'right':_(_0x2b9bb9[_0x7194cf(0x116)]-_0x1f7f5c[_0x7194cf(0x119)])}:{},..._0x2b9bb9[_0x7194cf(0x11c)]>_0x1f7f5c[_0x7194cf(0xea)]+n?{'bottom':_(_0x2b9bb9[_0x7194cf(0x11c)]-_0x1f7f5c[_0x7194cf(0xea)])}:{}},_0x1192f5=D(_0x16352b);if(_0x1192f5!=='-'){let _0xaf901=b(_0x5e15a8),_0x2598d6=y({'left':0x0,'top':0x0,'width':_0x1f7f5c[_0x7194cf(0x119)],'height':_0x1f7f5c['pageHeight']});_0xe0c529[_0x7194cf(0x122)](p({'page':_0x1f7f5c[_0x7194cf(0xdf)],'pageId':_0x1f7f5c[_0x7194cf(0xe8)],'rule':_0x7194cf(0xf1),'id':_0x5e15a8[_0x7194cf(0xe5)],'text':_0xaf901,'pageBox':_0x2598d6,'overflow':_0x16352b,'detail':_0x7194cf(0xf6)+v(_0xaf901['content'])+_0x7194cf(0xdd)+_0x1192f5+_0x7194cf(0x11d)+w(_0xaf901[_0x7194cf(0x127)])+',\x20page\x20'+w(_0x2598d6)}));}}for(let _0x413fd6 of _0x129888){let _0x426f16=E(_0x413fd6,_0x17a2a7,_0x1f7f5c);if(_0x426f16===void 0x0)continue;let _0x253ab0=m(_0x413fd6[_0x7194cf(0xff)][_0x7194cf(0x127)]),_0x50bb1b=m(_0x426f16[_0x7194cf(0xf9)]),_0x2cd77e=Math[_0x7194cf(0x10e)](r,i*(_0x50bb1b[_0x7194cf(0x116)]-_0x50bb1b[_0x7194cf(0x110)])),_0x47b343={..._0x50bb1b['left']-_0x253ab0[_0x7194cf(0x110)]>_0x2cd77e?{'left':_(_0x50bb1b[_0x7194cf(0x110)]-_0x253ab0['left'])}:{},..._0x253ab0[_0x7194cf(0x116)]-_0x50bb1b[_0x7194cf(0x116)]>_0x2cd77e?{'right':_(_0x253ab0[_0x7194cf(0x116)]-_0x50bb1b[_0x7194cf(0x116)])}:{},..._0x253ab0[_0x7194cf(0x11c)]-_0x50bb1b[_0x7194cf(0x11c)]>_0x2cd77e?{'bottom':_(_0x253ab0['bottom']-_0x50bb1b['bottom'])}:{}},_0x46c87d=D(_0x47b343);if(_0x46c87d!=='-'){let _0x37e419=b(_0x413fd6),_0x38d2b7=S(_0x426f16);_0xe0c529[_0x7194cf(0x122)](p({'page':_0x1f7f5c['page'],'pageId':_0x1f7f5c['pageId'],'rule':_0x7194cf(0xfa),'id':_0x413fd6['elementId'],'related':_0x426f16[_0x7194cf(0xe5)],'text':_0x37e419,'container':_0x38d2b7,'overflow':_0x47b343,'detail':_0x7194cf(0xf6)+v(_0x37e419['content'])+_0x7194cf(0xe0)+_0x38d2b7['id']+'\x20('+_0x46c87d+_0x7194cf(0x11d)+w(_0x37e419[_0x7194cf(0x127)])+',\x20'+_0x38d2b7['id']+_0x7194cf(0xf0)+_0x38d2b7['type']+'\x20'+C(_0x38d2b7['fill'])+'\x20'+w(_0x38d2b7[_0x7194cf(0x120)])}));}}for(let _0x3c0a0a=0x0;_0x3c0a0a<_0x129888[_0x7194cf(0xe3)];_0x3c0a0a+=0x1)for(let _0x2bb35d=_0x3c0a0a+0x1;_0x2bb35d<_0x129888[_0x7194cf(0xe3)];_0x2bb35d+=0x1){let _0x64a178=_0x129888[_0x3c0a0a],_0x2ff3a0=_0x129888[_0x2bb35d],_0x45147b=m(_0x64a178[_0x7194cf(0xff)][_0x7194cf(0x127)]),_0x39d02d=m(_0x2ff3a0[_0x7194cf(0xff)][_0x7194cf(0x127)]),_0xa16d7a=h(g(_0x45147b,_0x39d02d));if(_0xa16d7a<=0x1)continue;let _0x3c4e63=_0xa16d7a/Math[_0x7194cf(0x10e)](0x1,Math['min'](h(_0x45147b),h(_0x39d02d)));if(_0x3c4e63<=a)continue;let _0x4a4235=b(_0x64a178),_0x145c5c=b(_0x2ff3a0);_0xe0c529['push'](p({'page':_0x1f7f5c[_0x7194cf(0xdf)],'pageId':_0x1f7f5c[_0x7194cf(0xe8)],'rule':_0x7194cf(0x10b),'id':_0x64a178[_0x7194cf(0xe5)],'related':_0x2ff3a0[_0x7194cf(0xe5)],'text':_0x4a4235,'other':_0x145c5c,'overlapRatio':Math[_0x7194cf(0xef)](_0x3c4e63*0x64)/0x64,'detail':_0x7194cf(0xf6)+v(_0x4a4235[_0x7194cf(0xec)])+'\x22'+x(_0x4a4235)+_0x7194cf(0x109)+v(_0x145c5c['content'])+'\x22'+x(_0x145c5c)+_0x7194cf(0xfe)+Math[_0x7194cf(0xef)](_0x3c4e63*0x64)+'%\x20of\x20the\x20smaller\x20glyph\x20band;\x20ink\x20'+w(_0x4a4235['ink'])+',\x20'+w(_0x145c5c[_0x7194cf(0x127)])}));}}return _0xe0c529['sort']((_0x250300,_0x5b40bb)=>_0x250300[_0x7194cf(0x11b)][_0x7194cf(0x11f)](_0x5b40bb['fingerprint']));}function p(_0x1e94cd){return{..._0x1e94cd,'fingerprint':[_0x1e94cd['rule'],_0x1e94cd['pageId'],_0x1e94cd['id'],_0x1e94cd['related']??'']['join'](':'),'severity':'warning'};}function m(_0x1a67e3){const _0x42ba25=_0x36629f;return{'left':_0x1a67e3[_0x42ba25(0x110)],'top':_0x1a67e3['top'],'right':_0x1a67e3[_0x42ba25(0x110)]+_0x1a67e3['width'],'bottom':_0x1a67e3['top']+_0x1a67e3[_0x42ba25(0xe6)]};}function h(_0x374fa2){const _0xda647a=_0x36629f;return Math[_0xda647a(0x10e)](0x0,_0x374fa2[_0xda647a(0x116)]-_0x374fa2[_0xda647a(0x110)])*Math['max'](0x0,_0x374fa2['bottom']-_0x374fa2['top']);}function g(_0x45ebc3,_0x454d8a){const _0x3bc520=_0x36629f;return{'left':Math[_0x3bc520(0x10e)](_0x45ebc3['left'],_0x454d8a[_0x3bc520(0x110)]),'top':Math[_0x3bc520(0x10e)](_0x45ebc3[_0x3bc520(0x132)],_0x454d8a[_0x3bc520(0x132)]),'right':Math[_0x3bc520(0xd6)](_0x45ebc3[_0x3bc520(0x116)],_0x454d8a[_0x3bc520(0x116)]),'bottom':Math[_0x3bc520(0xd6)](_0x45ebc3[_0x3bc520(0x11c)],_0x454d8a['bottom'])};}function _(_0x5bbf7d){return Math['round'](_0x5bbf7d);}function v(_0x1520a5){const _0x51265d=_0x36629f;let _0x35683e=_0x1520a5[_0x51265d(0x130)](/\s+/gu,'\x20')[_0x51265d(0x103)]();return _0x35683e[_0x51265d(0xe3)]<=0x10?_0x35683e:_0x35683e['slice'](0x0,0x10)+'…';}function y(_0x511ad9){const _0x462a3e=_0x36629f;return{'left':_(_0x511ad9[_0x462a3e(0x110)]),'top':_(_0x511ad9[_0x462a3e(0x132)]),'width':_(_0x511ad9[_0x462a3e(0xe7)]),'height':_(_0x511ad9[_0x462a3e(0xe6)])};}function b(_0x4fef3){const _0x29667c=_0x36629f;let _0x3f915c=_0x4fef3[_0x29667c(0xff)];return{'id':_0x4fef3['elementId'],'content':_0x3f915c['content'],'ink':y(_0x3f915c[_0x29667c(0x127)]),..._0x3f915c[_0x29667c(0x128)]===void 0x0?{}:{'color':_0x3f915c[_0x29667c(0x128)]},..._0x3f915c['opacity']===void 0x0?{}:{'opacity':_0x3f915c[_0x29667c(0xf8)]}};}function x(_0x5b7bd9){const _0x4c414f=_0x36629f;return _0x5b7bd9[_0x4c414f(0x128)]===void 0x0&&_0x5b7bd9[_0x4c414f(0xf8)]===void 0x0?'':''+(_0x5b7bd9[_0x4c414f(0x128)]===void 0x0?'':'\x20\x20'+_0x5b7bd9[_0x4c414f(0x128)])+(_0x5b7bd9[_0x4c414f(0xf8)]===void 0x0?'':_0x4c414f(0x11a)+_0x5b7bd9[_0x4c414f(0xf8)]);}function S(_0x4f88a0){const _0x2e241b=_0x36629f;return{'id':_0x4f88a0[_0x2e241b(0xe5)],'type':_0x4f88a0[_0x2e241b(0xdb)]===void 0x0?_0x4f88a0['elementType']:_0x4f88a0[_0x2e241b(0xf2)]+':'+_0x4f88a0[_0x2e241b(0xdb)],..._0x4f88a0['fill']===void 0x0?{}:{'fill':_0x4f88a0[_0x2e241b(0x113)]},'box':y(_0x4f88a0[_0x2e241b(0xf9)])};}function C(_0x105169){const _0x3def8d=_0x36629f;if(_0x105169===void 0x0)return'no\x20fill';let _0x476ad8=_0x105169['opacity']===void 0x0||_0x105169['opacity']===0x1?'':'\x20@'+_0x105169[_0x3def8d(0xf8)];return((_0x105169[_0x3def8d(0xed)]??'?')+'\x20'+(_0x105169[_0x3def8d(0x128)]??'')+_0x476ad8)['trim']();}function w(_0x42b6da){const _0x28276c=_0x36629f;return'('+_0x42b6da[_0x28276c(0x110)]+','+_0x42b6da[_0x28276c(0x132)]+'\x20'+_0x42b6da[_0x28276c(0xe7)]+'×'+_0x42b6da[_0x28276c(0xe6)]+')';}function T(_0x3826df){const _0x50841c=_0x36629f;let _0x469e76=_0x3826df[_0x50841c(0x113)];return!(_0x469e76===void 0x0||_0x469e76[_0x50841c(0xed)]===_0x50841c(0x12c)||_0x469e76[_0x50841c(0xf8)]!==void 0x0&&_0x469e76[_0x50841c(0xf8)]<o||_0x3826df['shapeType']===void 0x0||!s['has'](_0x3826df[_0x50841c(0xdb)])||_0x3826df[_0x50841c(0x123)]===!0x1);}function E(_0x17c188,_0x4c66a7,_0x23c199){const _0x482d49=_0x36629f;let _0x20b15a=m(_0x17c188['text']['ink']),_0x283ae8;for(let _0x12f180 of _0x4c66a7){if(_0x12f180[_0x482d49(0xfc)]>=_0x17c188[_0x482d49(0xfc)]||!T(_0x12f180))continue;let _0x43d646=m(_0x12f180[_0x482d49(0xf9)]),_0x2aff85=h(_0x43d646);if(_0x2aff85>=0.5*_0x23c199[_0x482d49(0x119)]*_0x23c199[_0x482d49(0xea)])continue;let _0x3dfd20=_0x20b15a['top']>=_0x43d646['top']-n&&_0x20b15a[_0x482d49(0x11c)]<=_0x43d646['bottom']+n,_0x2a009d=_0x20b15a[_0x482d49(0x110)]>=_0x43d646['left']-n&&_0x20b15a[_0x482d49(0x110)]<=_0x43d646['right']+n&&_0x20b15a['top']>=_0x43d646[_0x482d49(0x132)]-n,_0x2c696a=h(g(_0x20b15a,_0x43d646))/Math[_0x482d49(0x10e)](h(_0x20b15a),0x1);!_0x3dfd20||!_0x2a009d||_0x2c696a<0.35||(_0x283ae8===void 0x0||_0x2aff85<_0x283ae8[_0x482d49(0x115)])&&(_0x283ae8={'element':_0x12f180,'area':_0x2aff85});}return _0x283ae8?.[_0x482d49(0xd9)];}function D(_0x544492){const _0x1b1637=_0x36629f;let _0x3d26d2=[_0x544492['left']===void 0x0?'':_0x1b1637(0x100)+_0x544492[_0x1b1637(0x110)]+'px',_0x544492[_0x1b1637(0x132)]===void 0x0?'':_0x1b1637(0x118)+_0x544492[_0x1b1637(0x132)]+'px',_0x544492[_0x1b1637(0x116)]===void 0x0?'':_0x1b1637(0x12e)+_0x544492[_0x1b1637(0x116)]+'px',_0x544492[_0x1b1637(0x11c)]===void 0x0?'':_0x1b1637(0x129)+_0x544492[_0x1b1637(0x11c)]+'px']['filter'](_0x521bdf=>_0x521bdf!=='');return _0x3d26d2[_0x1b1637(0xe3)]===0x0?'-':_0x3d26d2[_0x1b1637(0x12b)](',\x20');}function _0x208c(){const _0x5dcc7e=['Slide\x20unitData.id\x20is\x20required','map','max','code','left','filter','Slide\x20page\x20selector\x20is\x20invalid:\x20','fill','224wlvECv','area','right','pages\x20must\x20not\x20be\x20empty','top\x20','pageWidth','\x20\x20opacity\x20','fingerprint','bottom',');\x20ink\x20','layout:','localeCompare','box','isInteger','push','visible','has','unitData','27455220gmAdtL','ink','color','bottom\x20','number','join','none','startsWith','right\x20','string','replace','findIndex','top','elements','min','UnitLayoutLintError','unitType','element','Render\x20result\x20contains\x20duplicate\x20element\x20identities\x20on\x20page\x20','shapeType','roundRect','\x22\x20runs\x20off\x20the\x20page\x20(','add','page','\x22\x20escapes\x20','name','21Blnyxd','length','set','elementId','height','width','pageId','INVALID_INPUT','pageHeight','rect','content','type','slide','round','\x20=\x20','text-off-page','elementType','get','3698388ArUQUQ','runtime','text\x20\x22','signal','opacity','declared','text-escapes-container','2FsNUrM','zIndex','INVALID_RENDER_RESULT','\x20by\x20','text','left\x20','521764ghWJGO','289195iqWfBa','trim','143901GcmRFs','2101329XFQowP','Unit\x20layout\x20lint\x20currently\x20supports\x20Slide\x20only','Render\x20result\x20contains\x20unrequested\x20Slide\x20pages','1202892JyQzMf','\x20overlaps\x20\x22','pages','text-overlaps-text'];_0x208c=function(){return _0x5dcc7e;};return _0x208c();}function O(_0x591706){const _0x1795af=_0x36629f;if(typeof _0x591706!=_0x1795af(0x12f)||_0x591706[_0x1795af(0x103)]()==='')throw new e(_0x1795af(0xe9),_0x1795af(0x10c));return _0x591706;}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.0
|
|
4
|
+
"version": "1.1.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.0
|
|
21
|
+
"@univer-cli/univer-render-runtime": "1.1.0"
|
|
22
22
|
}
|
|
23
23
|
}
|