@univer-cli/unit-layout-lint 1.0.0-rc.0 → 1.0.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
- function _0x391a(){const _0xd1360c=['text-escapes-container','layout:','slice','fill','top\x20','shapeType','opacity','none','Render\x20result\x20contains\x20unrequested\x20Slide\x20pages','Slide\x20has\x20no\x20pages\x20to\x20lint','width','left','text','filter','add','push','pageId','ink','%\x20of\x20the\x20smaller\x20glyph\x20band;\x20ink\x20','element','\x22\x20escapes\x20','elementType','length','visible','slideOrder','44748UskkWK','Slide\x20unitData.id\x20is\x20required','height','type','1676162DOnvJr','right\x20','\x20=\x20','UnitLayoutLintError','round','7AGTedv','sort','1923108AKTwPi','roundRect','bottom\x20','right','elements','7102068tvDHYv','no\x20fill','left\x20','isInteger','startsWith','unitData','INVALID_RENDER_RESULT','INVALID_INPUT','text\x20\x22','rect','page','bottom','top','map','min','\x20\x20opacity\x20','captureSlideLayout','slide','formulaReferenceUnits','set','signal','1193284laFrcJ','join','has','13980072xBrkxW','rule','text-off-page','area','\x22\x20runs\x20off\x20the\x20page\x20(','Render\x20result\x20does\x20not\x20contain\x20exactly\x20one\x20matching\x20page\x20','pageWidth','pages','text-overlaps-text','pageHeight','code','color','elementId','warning','declared','runtime','related',');\x20ink\x20','unitType','box','fingerprint','replace','string',',\x20page\x20','trim','get','\x20by\x20','size','localeCompare','content','zIndex','number','max','2215270PfaqBj'];_0x391a=function(){return _0xd1360c;};return _0x391a();}const _0x3235e2=_0x5627;(function(_0x20a742,_0x4370bc){const _0x524919=_0x5627,_0x1d93b7=_0x20a742();while(!![]){try{const _0x4b011c=-parseInt(_0x524919(0x19b))/0x1+-parseInt(_0x524919(0x19f))/0x2+-parseInt(_0x524919(0x1a6))/0x3+-parseInt(_0x524919(0x1c0))/0x4+-parseInt(_0x524919(0x1e4))/0x5+parseInt(_0x524919(0x1ab))/0x6+-parseInt(_0x524919(0x1a4))/0x7*(-parseInt(_0x524919(0x1c3))/0x8);if(_0x4b011c===_0x4370bc)break;else _0x1d93b7['push'](_0x1d93b7['shift']());}catch(_0x4572a1){_0x1d93b7['push'](_0x1d93b7['shift']());}}}(_0x391a,0xa295b));var e=class extends Error{[_0x3235e2(0x1cd)];constructor(_0x59ba5f,_0xed12d6,_0x20ecc8){const _0x124cd2=_0x3235e2;super(_0xed12d6,_0x20ecc8),this['name']=_0x124cd2(0x1a2),this['code']=_0x59ba5f;}};function t(_0x4318f8){return _0x4318f8 instanceof e;}var n=0x2,r=0x6,i=0.02,a=0.15,o=0.5,s=new Set([_0x3235e2(0x1b4),_0x3235e2(0x1a7)]),c=['text-off-page','text-escapes-container','text-overlaps-text'];function l(_0x1a3cdc){return{async 'lint'(_0x61bd00){const _0x9c810d=_0x5627;if(_0x61bd00[_0x9c810d(0x1d5)]!==_0x9c810d(0x1bc))throw new e(_0x9c810d(0x1b2),'Unit\x20layout\x20lint\x20currently\x20supports\x20Slide\x20only');let _0x5d1ff4=O(_0x61bd00[_0x9c810d(0x1b0)]['id']),_0x1e5d5f=u(_0x61bd00[_0x9c810d(0x1b0)][_0x9c810d(0x19a)]??[],_0x61bd00[_0x9c810d(0x1ca)]),_0x1db3cb=await _0x1a3cdc[_0x9c810d(0x1d2)][_0x9c810d(0x1bb)]({'unitType':'slide','unitData':_0x61bd00[_0x9c810d(0x1b0)],..._0x61bd00['formulaReferenceUnits']===void 0x0?{}:{'formulaReferenceUnits':_0x61bd00[_0x9c810d(0x1bd)]},'pages':_0x1e5d5f[_0x9c810d(0x1b8)](({page:_0x100437})=>_0x100437),..._0x61bd00['signal']===void 0x0?{}:{'signal':_0x61bd00[_0x9c810d(0x1bf)]}});return d(_0x1db3cb,_0x1e5d5f),{'kind':'unit-layout-lint','unitId':_0x5d1ff4,'unitType':_0x9c810d(0x1bc),'coverage':{'pages':_0x1e5d5f,'rules':c},'findings':f(_0x1db3cb)};}};}function _0x5627(_0x2a0198,_0x19cb56){_0x2a0198=_0x2a0198-0x189;const _0x391ad3=_0x391a();let _0x562756=_0x391ad3[_0x2a0198];return _0x562756;}function u(_0x3b125b,_0x4eae55){const _0x5ca0cf=_0x3235e2;if(_0x3b125b['length']===0x0)throw new e(_0x5ca0cf(0x1b2),_0x5ca0cf(0x18b));if(_0x4eae55!==void 0x0&&_0x4eae55[_0x5ca0cf(0x198)]===0x0)throw new e(_0x5ca0cf(0x1b2),'pages\x20must\x20not\x20be\x20empty');let _0x4c1cb0=_0x4eae55??_0x3b125b[_0x5ca0cf(0x1b8)]((_0x3a486f,_0x2949f1)=>_0x2949f1+0x1),_0x6f852e=new Set(),_0xb066da=[];for(let _0x1d56ef of _0x4c1cb0){let _0x61d03c=typeof _0x1d56ef==_0x5ca0cf(0x1e2)?_0x1d56ef:_0x3b125b['findIndex'](_0x333760=>_0x333760===_0x1d56ef)+0x1;if(!Number[_0x5ca0cf(0x1ae)](_0x61d03c)||_0x61d03c<0x1||_0x61d03c>_0x3b125b[_0x5ca0cf(0x198)])throw new e(_0x5ca0cf(0x1b2),'Slide\x20page\x20selector\x20is\x20invalid:\x20'+String(_0x1d56ef));let _0x11c22e=_0x3b125b[_0x61d03c-0x1];_0x6f852e[_0x5ca0cf(0x1c2)](_0x11c22e)||(_0x6f852e[_0x5ca0cf(0x190)](_0x11c22e),_0xb066da[_0x5ca0cf(0x191)]({'page':_0x61d03c,'pageId':_0x11c22e}));}return _0xb066da;}function d(_0x299425,_0xedfb1b){const _0x183e12=_0x3235e2;let _0x6b8936=new Map();for(let _0x15d574 of _0x299425[_0x183e12(0x1ca)]){let _0x1dcb12=_0x6b8936[_0x183e12(0x1dc)](_0x15d574[_0x183e12(0x192)])??[];_0x1dcb12[_0x183e12(0x191)](_0x15d574),_0x6b8936[_0x183e12(0x1be)](_0x15d574[_0x183e12(0x192)],_0x1dcb12);}for(let _0x1d30dd of _0xedfb1b){let _0x5c2de0=_0x6b8936[_0x183e12(0x1dc)](_0x1d30dd[_0x183e12(0x192)])??[];if(_0x5c2de0[_0x183e12(0x198)]!==0x1||_0x5c2de0[0x0]?.['page']!==_0x1d30dd[_0x183e12(0x1b5)])throw new e(_0x183e12(0x1b1),_0x183e12(0x1c8)+_0x1d30dd[_0x183e12(0x192)]);let _0x58d4ee=_0x5c2de0[0x0]['elements']['map'](({elementId:_0x1e2634})=>_0x1e2634);if(new Set(_0x58d4ee)[_0x183e12(0x1de)]!==_0x58d4ee['length'])throw new e('INVALID_RENDER_RESULT','Render\x20result\x20contains\x20duplicate\x20element\x20identities\x20on\x20page\x20'+_0x1d30dd['pageId']);}if(_0x299425[_0x183e12(0x1ca)][_0x183e12(0x198)]!==_0xedfb1b[_0x183e12(0x198)])throw new e(_0x183e12(0x1b1),_0x183e12(0x18a));}function f(_0x16ad3b){const _0xb02b11=_0x3235e2;let _0x660984=[];for(let _0x366d0c of _0x16ad3b[_0xb02b11(0x1ca)]){let _0x4da05a=_0x366d0c[_0xb02b11(0x1aa)][_0xb02b11(0x18f)](_0x25dae9=>!_0x25dae9[_0xb02b11(0x1cf)][_0xb02b11(0x1af)](_0xb02b11(0x1e6))),_0x3bd033=_0x4da05a[_0xb02b11(0x18f)](_0x73b15f=>_0x73b15f[_0xb02b11(0x18e)]!==void 0x0&&_0x73b15f[_0xb02b11(0x18e)][_0xb02b11(0x1e0)]['trim']()!=='');for(let _0x3dba92 of _0x3bd033){let _0x3c8acb=m(_0x3dba92[_0xb02b11(0x18e)]['ink']),_0x5f4921={..._0x3c8acb[_0xb02b11(0x18d)]<-0x2?{'left':_(-_0x3c8acb['left'])}:{},..._0x3c8acb[_0xb02b11(0x1b7)]<-0x2?{'top':_(-_0x3c8acb[_0xb02b11(0x1b7)])}:{},..._0x3c8acb[_0xb02b11(0x1a9)]>_0x366d0c[_0xb02b11(0x1c9)]+n?{'right':_(_0x3c8acb['right']-_0x366d0c[_0xb02b11(0x1c9)])}:{},..._0x3c8acb[_0xb02b11(0x1b6)]>_0x366d0c[_0xb02b11(0x1cc)]+n?{'bottom':_(_0x3c8acb['bottom']-_0x366d0c[_0xb02b11(0x1cc)])}:{}},_0x43e8ca=D(_0x5f4921);if(_0x43e8ca!=='-'){let _0x451d1e=b(_0x3dba92),_0x32bec5=y({'left':0x0,'top':0x0,'width':_0x366d0c['pageWidth'],'height':_0x366d0c[_0xb02b11(0x1cc)]});_0x660984[_0xb02b11(0x191)](p({'page':_0x366d0c[_0xb02b11(0x1b5)],'pageId':_0x366d0c[_0xb02b11(0x192)],'rule':_0xb02b11(0x1c5),'id':_0x3dba92['elementId'],'text':_0x451d1e,'pageBox':_0x32bec5,'overflow':_0x5f4921,'detail':_0xb02b11(0x1b3)+v(_0x451d1e[_0xb02b11(0x1e0)])+_0xb02b11(0x1c7)+_0x43e8ca+_0xb02b11(0x1d4)+w(_0x451d1e[_0xb02b11(0x193)])+_0xb02b11(0x1da)+w(_0x32bec5)}));}}for(let _0x27f1f6 of _0x3bd033){let _0x501c3f=E(_0x27f1f6,_0x4da05a,_0x366d0c);if(_0x501c3f===void 0x0)continue;let _0x157c23=m(_0x27f1f6[_0xb02b11(0x18e)]['ink']),_0x1e185e=m(_0x501c3f[_0xb02b11(0x1d1)]),_0x20a7f6=Math[_0xb02b11(0x1e3)](r,i*(_0x1e185e['right']-_0x1e185e[_0xb02b11(0x18d)])),_0xf92407={..._0x1e185e[_0xb02b11(0x18d)]-_0x157c23[_0xb02b11(0x18d)]>_0x20a7f6?{'left':_(_0x1e185e[_0xb02b11(0x18d)]-_0x157c23[_0xb02b11(0x18d)])}:{},..._0x157c23[_0xb02b11(0x1a9)]-_0x1e185e[_0xb02b11(0x1a9)]>_0x20a7f6?{'right':_(_0x157c23[_0xb02b11(0x1a9)]-_0x1e185e[_0xb02b11(0x1a9)])}:{},..._0x157c23[_0xb02b11(0x1b6)]-_0x1e185e[_0xb02b11(0x1b6)]>_0x20a7f6?{'bottom':_(_0x157c23[_0xb02b11(0x1b6)]-_0x1e185e['bottom'])}:{}},_0x2638d2=D(_0xf92407);if(_0x2638d2!=='-'){let _0x17e01a=b(_0x27f1f6),_0x18f0c5=S(_0x501c3f);_0x660984[_0xb02b11(0x191)](p({'page':_0x366d0c['page'],'pageId':_0x366d0c['pageId'],'rule':_0xb02b11(0x1e5),'id':_0x27f1f6['elementId'],'related':_0x501c3f[_0xb02b11(0x1cf)],'text':_0x17e01a,'container':_0x18f0c5,'overflow':_0xf92407,'detail':'text\x20\x22'+v(_0x17e01a['content'])+_0xb02b11(0x196)+_0x18f0c5['id']+'\x20('+_0x2638d2+');\x20ink\x20'+w(_0x17e01a['ink'])+',\x20'+_0x18f0c5['id']+_0xb02b11(0x1a1)+_0x18f0c5[_0xb02b11(0x19e)]+'\x20'+C(_0x18f0c5[_0xb02b11(0x1e8)])+'\x20'+w(_0x18f0c5[_0xb02b11(0x1d6)])}));}}for(let _0x1462a5=0x0;_0x1462a5<_0x3bd033[_0xb02b11(0x198)];_0x1462a5+=0x1)for(let _0x2b5592=_0x1462a5+0x1;_0x2b5592<_0x3bd033[_0xb02b11(0x198)];_0x2b5592+=0x1){let _0x5e317f=_0x3bd033[_0x1462a5],_0x2ebbdb=_0x3bd033[_0x2b5592],_0x405ea6=m(_0x5e317f[_0xb02b11(0x18e)][_0xb02b11(0x193)]),_0x2d75b3=m(_0x2ebbdb['text'][_0xb02b11(0x193)]),_0x4d80a0=h(g(_0x405ea6,_0x2d75b3));if(_0x4d80a0<=0x1)continue;let _0x332734=_0x4d80a0/Math[_0xb02b11(0x1e3)](0x1,Math[_0xb02b11(0x1b9)](h(_0x405ea6),h(_0x2d75b3)));if(_0x332734<=a)continue;let _0x30546d=b(_0x5e317f),_0x57db2d=b(_0x2ebbdb);_0x660984[_0xb02b11(0x191)](p({'page':_0x366d0c[_0xb02b11(0x1b5)],'pageId':_0x366d0c[_0xb02b11(0x192)],'rule':_0xb02b11(0x1cb),'id':_0x5e317f['elementId'],'related':_0x2ebbdb[_0xb02b11(0x1cf)],'text':_0x30546d,'other':_0x57db2d,'overlapRatio':Math[_0xb02b11(0x1a3)](_0x332734*0x64)/0x64,'detail':_0xb02b11(0x1b3)+v(_0x30546d['content'])+'\x22'+x(_0x30546d)+'\x20overlaps\x20\x22'+v(_0x57db2d[_0xb02b11(0x1e0)])+'\x22'+x(_0x57db2d)+_0xb02b11(0x1dd)+Math['round'](_0x332734*0x64)+_0xb02b11(0x194)+w(_0x30546d[_0xb02b11(0x193)])+',\x20'+w(_0x57db2d[_0xb02b11(0x193)])}));}}return _0x660984[_0xb02b11(0x1a5)]((_0x279c23,_0x7ccd40)=>_0x279c23[_0xb02b11(0x1d7)][_0xb02b11(0x1df)](_0x7ccd40[_0xb02b11(0x1d7)]));}function p(_0x1e8bda){const _0x4d6e1c=_0x3235e2;return{..._0x1e8bda,'fingerprint':[_0x1e8bda[_0x4d6e1c(0x1c4)],_0x1e8bda[_0x4d6e1c(0x192)],_0x1e8bda['id'],_0x1e8bda[_0x4d6e1c(0x1d3)]??''][_0x4d6e1c(0x1c1)](':'),'severity':_0x4d6e1c(0x1d0)};}function m(_0x1aa362){const _0x494fe=_0x3235e2;return{'left':_0x1aa362[_0x494fe(0x18d)],'top':_0x1aa362[_0x494fe(0x1b7)],'right':_0x1aa362['left']+_0x1aa362['width'],'bottom':_0x1aa362[_0x494fe(0x1b7)]+_0x1aa362[_0x494fe(0x19d)]};}function h(_0x131563){const _0x7a770a=_0x3235e2;return Math[_0x7a770a(0x1e3)](0x0,_0x131563[_0x7a770a(0x1a9)]-_0x131563[_0x7a770a(0x18d)])*Math[_0x7a770a(0x1e3)](0x0,_0x131563[_0x7a770a(0x1b6)]-_0x131563[_0x7a770a(0x1b7)]);}function g(_0xc47c95,_0x26ac74){const _0x4dcea0=_0x3235e2;return{'left':Math[_0x4dcea0(0x1e3)](_0xc47c95['left'],_0x26ac74['left']),'top':Math[_0x4dcea0(0x1e3)](_0xc47c95[_0x4dcea0(0x1b7)],_0x26ac74['top']),'right':Math['min'](_0xc47c95[_0x4dcea0(0x1a9)],_0x26ac74[_0x4dcea0(0x1a9)]),'bottom':Math[_0x4dcea0(0x1b9)](_0xc47c95['bottom'],_0x26ac74['bottom'])};}function _(_0x52a4bd){const _0x450c37=_0x3235e2;return Math[_0x450c37(0x1a3)](_0x52a4bd);}function v(_0xd362f8){const _0x32be7d=_0x3235e2;let _0x35fa43=_0xd362f8[_0x32be7d(0x1d8)](/\s+/gu,'\x20')[_0x32be7d(0x1db)]();return _0x35fa43[_0x32be7d(0x198)]<=0x10?_0x35fa43:_0x35fa43[_0x32be7d(0x1e7)](0x0,0x10)+'…';}function y(_0x5c4fd1){const _0x38c179=_0x3235e2;return{'left':_(_0x5c4fd1[_0x38c179(0x18d)]),'top':_(_0x5c4fd1[_0x38c179(0x1b7)]),'width':_(_0x5c4fd1['width']),'height':_(_0x5c4fd1[_0x38c179(0x19d)])};}function b(_0x36f59b){const _0x40144a=_0x3235e2;let _0x234a92=_0x36f59b[_0x40144a(0x18e)];return{'id':_0x36f59b[_0x40144a(0x1cf)],'content':_0x234a92[_0x40144a(0x1e0)],'ink':y(_0x234a92[_0x40144a(0x193)]),..._0x234a92[_0x40144a(0x1ce)]===void 0x0?{}:{'color':_0x234a92[_0x40144a(0x1ce)]},..._0x234a92[_0x40144a(0x1eb)]===void 0x0?{}:{'opacity':_0x234a92[_0x40144a(0x1eb)]}};}function x(_0x1cfcd8){const _0x410a78=_0x3235e2;return _0x1cfcd8[_0x410a78(0x1ce)]===void 0x0&&_0x1cfcd8[_0x410a78(0x1eb)]===void 0x0?'':''+(_0x1cfcd8[_0x410a78(0x1ce)]===void 0x0?'':'\x20\x20'+_0x1cfcd8[_0x410a78(0x1ce)])+(_0x1cfcd8[_0x410a78(0x1eb)]===void 0x0?'':_0x410a78(0x1ba)+_0x1cfcd8[_0x410a78(0x1eb)]);}function S(_0x553269){const _0x47511c=_0x3235e2;return{'id':_0x553269[_0x47511c(0x1cf)],'type':_0x553269[_0x47511c(0x1ea)]===void 0x0?_0x553269[_0x47511c(0x197)]:_0x553269[_0x47511c(0x197)]+':'+_0x553269[_0x47511c(0x1ea)],..._0x553269[_0x47511c(0x1e8)]===void 0x0?{}:{'fill':_0x553269[_0x47511c(0x1e8)]},'box':y(_0x553269[_0x47511c(0x1d1)])};}function C(_0x39c60b){const _0x56b7e7=_0x3235e2;if(_0x39c60b===void 0x0)return _0x56b7e7(0x1ac);let _0x3ec8d1=_0x39c60b[_0x56b7e7(0x1eb)]===void 0x0||_0x39c60b[_0x56b7e7(0x1eb)]===0x1?'':'\x20@'+_0x39c60b[_0x56b7e7(0x1eb)];return((_0x39c60b[_0x56b7e7(0x19e)]??'?')+'\x20'+(_0x39c60b[_0x56b7e7(0x1ce)]??'')+_0x3ec8d1)[_0x56b7e7(0x1db)]();}function w(_0x196687){const _0x4ff52d=_0x3235e2;return'('+_0x196687[_0x4ff52d(0x18d)]+','+_0x196687[_0x4ff52d(0x1b7)]+'\x20'+_0x196687[_0x4ff52d(0x18c)]+'×'+_0x196687[_0x4ff52d(0x19d)]+')';}function T(_0x41be01){const _0x85f61f=_0x3235e2;let _0x3c21ea=_0x41be01[_0x85f61f(0x1e8)];return!(_0x3c21ea===void 0x0||_0x3c21ea[_0x85f61f(0x19e)]===_0x85f61f(0x189)||_0x3c21ea['opacity']!==void 0x0&&_0x3c21ea[_0x85f61f(0x1eb)]<o||_0x41be01[_0x85f61f(0x1ea)]===void 0x0||!s[_0x85f61f(0x1c2)](_0x41be01['shapeType'])||_0x41be01[_0x85f61f(0x199)]===!0x1);}function E(_0x2cb9a5,_0x21ecc7,_0x30d8cd){const _0x2dbc00=_0x3235e2;let _0x11f5a7=m(_0x2cb9a5[_0x2dbc00(0x18e)]['ink']),_0x240ad4;for(let _0x460f42 of _0x21ecc7){if(_0x460f42[_0x2dbc00(0x1e1)]>=_0x2cb9a5['zIndex']||!T(_0x460f42))continue;let _0x4d70ce=m(_0x460f42[_0x2dbc00(0x1d1)]),_0x9592e9=h(_0x4d70ce);if(_0x9592e9>=0.5*_0x30d8cd['pageWidth']*_0x30d8cd[_0x2dbc00(0x1cc)])continue;let _0x2081e2=_0x11f5a7[_0x2dbc00(0x1b7)]>=_0x4d70ce[_0x2dbc00(0x1b7)]-n&&_0x11f5a7['bottom']<=_0x4d70ce['bottom']+n,_0x34f608=_0x11f5a7[_0x2dbc00(0x18d)]>=_0x4d70ce['left']-n&&_0x11f5a7[_0x2dbc00(0x18d)]<=_0x4d70ce['right']+n&&_0x11f5a7[_0x2dbc00(0x1b7)]>=_0x4d70ce[_0x2dbc00(0x1b7)]-n,_0x338efa=h(g(_0x11f5a7,_0x4d70ce))/Math[_0x2dbc00(0x1e3)](h(_0x11f5a7),0x1);!_0x2081e2||!_0x34f608||_0x338efa<0.35||(_0x240ad4===void 0x0||_0x9592e9<_0x240ad4[_0x2dbc00(0x1c6)])&&(_0x240ad4={'element':_0x460f42,'area':_0x9592e9});}return _0x240ad4?.[_0x2dbc00(0x195)];}function D(_0xa5107){const _0x379b56=_0x3235e2;let _0x4ebe76=[_0xa5107[_0x379b56(0x18d)]===void 0x0?'':_0x379b56(0x1ad)+_0xa5107[_0x379b56(0x18d)]+'px',_0xa5107[_0x379b56(0x1b7)]===void 0x0?'':_0x379b56(0x1e9)+_0xa5107[_0x379b56(0x1b7)]+'px',_0xa5107[_0x379b56(0x1a9)]===void 0x0?'':_0x379b56(0x1a0)+_0xa5107['right']+'px',_0xa5107[_0x379b56(0x1b6)]===void 0x0?'':_0x379b56(0x1a8)+_0xa5107[_0x379b56(0x1b6)]+'px'][_0x379b56(0x18f)](_0x3427df=>_0x3427df!=='');return _0x4ebe76[_0x379b56(0x198)]===0x0?'-':_0x4ebe76[_0x379b56(0x1c1)](',\x20');}function O(_0x28d6c8){const _0x40608f=_0x3235e2;if(typeof _0x28d6c8!=_0x40608f(0x1d9)||_0x28d6c8[_0x40608f(0x1db)]()==='')throw new e(_0x40608f(0x1b2),_0x40608f(0x19c));return _0x28d6c8;}export{e as UnitLayoutLintError,l as createUnitLayoutLint,t as isUnitLayoutLintError};
1
+ const _0x350487=_0x4c64;(function(_0x20038b,_0x7a1338){const _0x5d6e51=_0x4c64,_0x4e8f60=_0x20038b();while(!![]){try{const _0x18cb28=-parseInt(_0x5d6e51(0xa8))/0x1*(parseInt(_0x5d6e51(0xaf))/0x2)+parseInt(_0x5d6e51(0x96))/0x3+parseInt(_0x5d6e51(0x78))/0x4*(-parseInt(_0x5d6e51(0x87))/0x5)+-parseInt(_0x5d6e51(0xc1))/0x6*(parseInt(_0x5d6e51(0xab))/0x7)+-parseInt(_0x5d6e51(0xa7))/0x8+parseInt(_0x5d6e51(0x93))/0x9*(parseInt(_0x5d6e51(0xc5))/0xa)+parseInt(_0x5d6e51(0xb6))/0xb;if(_0x18cb28===_0x7a1338)break;else _0x4e8f60['push'](_0x4e8f60['shift']());}catch(_0x439fcb){_0x4e8f60['push'](_0x4e8f60['shift']());}}}(_0x1a16,0xb959a));var e=class extends Error{['code'];constructor(_0x1381de,_0x12b0e7,_0x2ca292){const _0x5e9b86=_0x4c64;super(_0x12b0e7,_0x2ca292),this[_0x5e9b86(0xa4)]='UnitLayoutLintError',this[_0x5e9b86(0x91)]=_0x1381de;}};function t(_0x2092e2){return _0x2092e2 instanceof e;}function _0x1a16(){const _0x3b8792=['elementId','join','fill','page','\x20by\x20','formulaReferenceUnits','push','signal','rule','warning','declared','452UITIaO','width','left','rect','\x22\x20runs\x20off\x20the\x20page\x20(','slide','max','number','height','top','pages','text\x20\x22','elementType','has','\x20=\x20','48905mrXpQn','pages\x20must\x20not\x20be\x20empty','layout:','bottom\x20','opacity','map','visible','\x22\x20escapes\x20','content','min','code','startsWith','7648848nZDfGR','type','bottom','2046999HrRXET','findIndex','right','filter','zIndex','text-off-page','box','text','pageHeight','round','%\x20of\x20the\x20smaller\x20glyph\x20band;\x20ink\x20',',\x20page\x20','Slide\x20unitData.id\x20is\x20required','Slide\x20has\x20no\x20pages\x20to\x20lint','name','Render\x20result\x20contains\x20duplicate\x20element\x20identities\x20on\x20page\x20','INVALID_INPUT','6817184jKUhrU','35842zLATpl','pageId','top\x20','115045BXkINg','\x20overlaps\x20\x22','isInteger','color','58ZsXilo','unitData','right\x20','localeCompare','Render\x20result\x20does\x20not\x20contain\x20exactly\x20one\x20matching\x20page\x20','unitType','pageWidth','26088953iSVwEc','get','no\x20fill','elements','roundRect','shapeType','ink','area',');\x20ink\x20','element','text-escapes-container','54DgptQS','fingerprint','none','Slide\x20page\x20selector\x20is\x20invalid:\x20','10OyNRRI','add','length','captureSlideLayout','unit-layout-lint','INVALID_RENDER_RESULT','related','set','trim'];_0x1a16=function(){return _0x3b8792;};return _0x1a16();}var n=0x2,r=0x6,i=0.02,a=0.15,o=0.5,s=new Set([_0x350487(0x7b),_0x350487(0xba)]),c=[_0x350487(0x9b),_0x350487(0xc0),'text-overlaps-text'];function l(_0x4bf57e){return{async 'lint'(_0x50c50f){const _0x1de35f=_0x4c64;if(_0x50c50f[_0x1de35f(0xb4)]!==_0x1de35f(0x7d))throw new e(_0x1de35f(0xa6),'Unit\x20layout\x20lint\x20currently\x20supports\x20Slide\x20only');let _0x2b483d=O(_0x50c50f['unitData']['id']),_0x37b80e=u(_0x50c50f[_0x1de35f(0xb0)]['slideOrder']??[],_0x50c50f[_0x1de35f(0x82)]),_0xe4d5d4=await _0x4bf57e['runtime'][_0x1de35f(0xc8)]({'unitType':_0x1de35f(0x7d),'unitData':_0x50c50f[_0x1de35f(0xb0)],..._0x50c50f['formulaReferenceUnits']===void 0x0?{}:{'formulaReferenceUnits':_0x50c50f[_0x1de35f(0x72)]},'pages':_0x37b80e[_0x1de35f(0x8c)](({page:_0x4a7939})=>_0x4a7939),..._0x50c50f[_0x1de35f(0x74)]===void 0x0?{}:{'signal':_0x50c50f[_0x1de35f(0x74)]}});return d(_0xe4d5d4,_0x37b80e),{'kind':_0x1de35f(0xc9),'unitId':_0x2b483d,'unitType':_0x1de35f(0x7d),'coverage':{'pages':_0x37b80e,'rules':c},'findings':f(_0xe4d5d4)};}};}function u(_0x21335d,_0x169fd3){const _0x56939b=_0x350487;if(_0x21335d[_0x56939b(0xc7)]===0x0)throw new e(_0x56939b(0xa6),_0x56939b(0xa3));if(_0x169fd3!==void 0x0&&_0x169fd3[_0x56939b(0xc7)]===0x0)throw new e(_0x56939b(0xa6),_0x56939b(0x88));let _0x1929cd=_0x169fd3??_0x21335d[_0x56939b(0x8c)]((_0xbc2070,_0x3a59a6)=>_0x3a59a6+0x1),_0x421bbc=new Set(),_0x1309e1=[];for(let _0x566ed9 of _0x1929cd){let _0x18f405=typeof _0x566ed9==_0x56939b(0x7f)?_0x566ed9:_0x21335d[_0x56939b(0x97)](_0x1f2de1=>_0x1f2de1===_0x566ed9)+0x1;if(!Number[_0x56939b(0xad)](_0x18f405)||_0x18f405<0x1||_0x18f405>_0x21335d[_0x56939b(0xc7)])throw new e('INVALID_INPUT',_0x56939b(0xc4)+String(_0x566ed9));let _0x376678=_0x21335d[_0x18f405-0x1];_0x421bbc[_0x56939b(0x85)](_0x376678)||(_0x421bbc[_0x56939b(0xc6)](_0x376678),_0x1309e1[_0x56939b(0x73)]({'page':_0x18f405,'pageId':_0x376678}));}return _0x1309e1;}function d(_0x756f51,_0x2f3247){const _0x557b9d=_0x350487;let _0x47f5a9=new Map();for(let _0x29afbe of _0x756f51[_0x557b9d(0x82)]){let _0x46b883=_0x47f5a9[_0x557b9d(0xb7)](_0x29afbe[_0x557b9d(0xa9)])??[];_0x46b883[_0x557b9d(0x73)](_0x29afbe),_0x47f5a9[_0x557b9d(0xcc)](_0x29afbe[_0x557b9d(0xa9)],_0x46b883);}for(let _0x2dadf6 of _0x2f3247){let _0x56c787=_0x47f5a9[_0x557b9d(0xb7)](_0x2dadf6['pageId'])??[];if(_0x56c787['length']!==0x1||_0x56c787[0x0]?.[_0x557b9d(0x70)]!==_0x2dadf6[_0x557b9d(0x70)])throw new e('INVALID_RENDER_RESULT',_0x557b9d(0xb3)+_0x2dadf6[_0x557b9d(0xa9)]);let _0x19b223=_0x56c787[0x0][_0x557b9d(0xb9)][_0x557b9d(0x8c)](({elementId:_0x51815a})=>_0x51815a);if(new Set(_0x19b223)['size']!==_0x19b223[_0x557b9d(0xc7)])throw new e(_0x557b9d(0xca),_0x557b9d(0xa5)+_0x2dadf6['pageId']);}if(_0x756f51[_0x557b9d(0x82)]['length']!==_0x2f3247[_0x557b9d(0xc7)])throw new e(_0x557b9d(0xca),'Render\x20result\x20contains\x20unrequested\x20Slide\x20pages');}function f(_0xeadd83){const _0x310643=_0x350487;let _0x4706be=[];for(let _0x44cdb4 of _0xeadd83[_0x310643(0x82)]){let _0xad44ca=_0x44cdb4[_0x310643(0xb9)][_0x310643(0x99)](_0x4a830a=>!_0x4a830a[_0x310643(0xce)][_0x310643(0x92)](_0x310643(0x89))),_0x25b121=_0xad44ca[_0x310643(0x99)](_0x1e360e=>_0x1e360e['text']!==void 0x0&&_0x1e360e[_0x310643(0x9d)][_0x310643(0x8f)][_0x310643(0xcd)]()!=='');for(let _0x5f0689 of _0x25b121){let _0x2345eb=m(_0x5f0689['text'][_0x310643(0xbc)]),_0x5192e3={..._0x2345eb['left']<-0x2?{'left':_(-_0x2345eb[_0x310643(0x7a)])}:{},..._0x2345eb[_0x310643(0x81)]<-0x2?{'top':_(-_0x2345eb[_0x310643(0x81)])}:{},..._0x2345eb['right']>_0x44cdb4['pageWidth']+n?{'right':_(_0x2345eb[_0x310643(0x98)]-_0x44cdb4[_0x310643(0xb5)])}:{},..._0x2345eb[_0x310643(0x95)]>_0x44cdb4[_0x310643(0x9e)]+n?{'bottom':_(_0x2345eb[_0x310643(0x95)]-_0x44cdb4[_0x310643(0x9e)])}:{}},_0x56d980=D(_0x5192e3);if(_0x56d980!=='-'){let _0x1839f1=b(_0x5f0689),_0x2c589b=y({'left':0x0,'top':0x0,'width':_0x44cdb4['pageWidth'],'height':_0x44cdb4['pageHeight']});_0x4706be[_0x310643(0x73)](p({'page':_0x44cdb4[_0x310643(0x70)],'pageId':_0x44cdb4[_0x310643(0xa9)],'rule':_0x310643(0x9b),'id':_0x5f0689[_0x310643(0xce)],'text':_0x1839f1,'pageBox':_0x2c589b,'overflow':_0x5192e3,'detail':'text\x20\x22'+v(_0x1839f1[_0x310643(0x8f)])+_0x310643(0x7c)+_0x56d980+_0x310643(0xbe)+w(_0x1839f1[_0x310643(0xbc)])+_0x310643(0xa1)+w(_0x2c589b)}));}}for(let _0x5e43c8 of _0x25b121){let _0x4dca35=E(_0x5e43c8,_0xad44ca,_0x44cdb4);if(_0x4dca35===void 0x0)continue;let _0x38a2d1=m(_0x5e43c8[_0x310643(0x9d)][_0x310643(0xbc)]),_0x546dc6=m(_0x4dca35[_0x310643(0x77)]),_0x458f35=Math[_0x310643(0x7e)](r,i*(_0x546dc6['right']-_0x546dc6['left'])),_0x58aacc={..._0x546dc6[_0x310643(0x7a)]-_0x38a2d1[_0x310643(0x7a)]>_0x458f35?{'left':_(_0x546dc6[_0x310643(0x7a)]-_0x38a2d1[_0x310643(0x7a)])}:{},..._0x38a2d1[_0x310643(0x98)]-_0x546dc6[_0x310643(0x98)]>_0x458f35?{'right':_(_0x38a2d1[_0x310643(0x98)]-_0x546dc6[_0x310643(0x98)])}:{},..._0x38a2d1[_0x310643(0x95)]-_0x546dc6[_0x310643(0x95)]>_0x458f35?{'bottom':_(_0x38a2d1[_0x310643(0x95)]-_0x546dc6[_0x310643(0x95)])}:{}},_0x7af79d=D(_0x58aacc);if(_0x7af79d!=='-'){let _0x420ad9=b(_0x5e43c8),_0x296b2b=S(_0x4dca35);_0x4706be[_0x310643(0x73)](p({'page':_0x44cdb4[_0x310643(0x70)],'pageId':_0x44cdb4[_0x310643(0xa9)],'rule':_0x310643(0xc0),'id':_0x5e43c8[_0x310643(0xce)],'related':_0x4dca35[_0x310643(0xce)],'text':_0x420ad9,'container':_0x296b2b,'overflow':_0x58aacc,'detail':_0x310643(0x83)+v(_0x420ad9[_0x310643(0x8f)])+_0x310643(0x8e)+_0x296b2b['id']+'\x20('+_0x7af79d+_0x310643(0xbe)+w(_0x420ad9[_0x310643(0xbc)])+',\x20'+_0x296b2b['id']+_0x310643(0x86)+_0x296b2b[_0x310643(0x94)]+'\x20'+C(_0x296b2b[_0x310643(0x6f)])+'\x20'+w(_0x296b2b[_0x310643(0x9c)])}));}}for(let _0xa6facb=0x0;_0xa6facb<_0x25b121['length'];_0xa6facb+=0x1)for(let _0x253f36=_0xa6facb+0x1;_0x253f36<_0x25b121[_0x310643(0xc7)];_0x253f36+=0x1){let _0x424fbf=_0x25b121[_0xa6facb],_0x3407b2=_0x25b121[_0x253f36],_0x30ecc1=m(_0x424fbf[_0x310643(0x9d)][_0x310643(0xbc)]),_0xf003cf=m(_0x3407b2[_0x310643(0x9d)]['ink']),_0x403ebb=h(g(_0x30ecc1,_0xf003cf));if(_0x403ebb<=0x1)continue;let _0xb84de8=_0x403ebb/Math['max'](0x1,Math[_0x310643(0x90)](h(_0x30ecc1),h(_0xf003cf)));if(_0xb84de8<=a)continue;let _0x3bb40d=b(_0x424fbf),_0x93c991=b(_0x3407b2);_0x4706be['push'](p({'page':_0x44cdb4[_0x310643(0x70)],'pageId':_0x44cdb4[_0x310643(0xa9)],'rule':'text-overlaps-text','id':_0x424fbf[_0x310643(0xce)],'related':_0x3407b2[_0x310643(0xce)],'text':_0x3bb40d,'other':_0x93c991,'overlapRatio':Math[_0x310643(0x9f)](_0xb84de8*0x64)/0x64,'detail':'text\x20\x22'+v(_0x3bb40d['content'])+'\x22'+x(_0x3bb40d)+_0x310643(0xac)+v(_0x93c991[_0x310643(0x8f)])+'\x22'+x(_0x93c991)+_0x310643(0x71)+Math['round'](_0xb84de8*0x64)+_0x310643(0xa0)+w(_0x3bb40d['ink'])+',\x20'+w(_0x93c991[_0x310643(0xbc)])}));}}return _0x4706be['sort']((_0x3ab857,_0x2825c6)=>_0x3ab857[_0x310643(0xc2)][_0x310643(0xb2)](_0x2825c6[_0x310643(0xc2)]));}function p(_0x142049){const _0x2de7ec=_0x350487;return{..._0x142049,'fingerprint':[_0x142049[_0x2de7ec(0x75)],_0x142049[_0x2de7ec(0xa9)],_0x142049['id'],_0x142049[_0x2de7ec(0xcb)]??''][_0x2de7ec(0x6e)](':'),'severity':_0x2de7ec(0x76)};}function m(_0x556ba0){const _0x3664d7=_0x350487;return{'left':_0x556ba0[_0x3664d7(0x7a)],'top':_0x556ba0['top'],'right':_0x556ba0[_0x3664d7(0x7a)]+_0x556ba0[_0x3664d7(0x79)],'bottom':_0x556ba0['top']+_0x556ba0[_0x3664d7(0x80)]};}function h(_0x2fd55b){const _0x3cfded=_0x350487;return Math['max'](0x0,_0x2fd55b['right']-_0x2fd55b[_0x3cfded(0x7a)])*Math['max'](0x0,_0x2fd55b[_0x3cfded(0x95)]-_0x2fd55b['top']);}function g(_0x5309f0,_0x198f14){const _0x4cadbf=_0x350487;return{'left':Math[_0x4cadbf(0x7e)](_0x5309f0['left'],_0x198f14[_0x4cadbf(0x7a)]),'top':Math[_0x4cadbf(0x7e)](_0x5309f0[_0x4cadbf(0x81)],_0x198f14[_0x4cadbf(0x81)]),'right':Math['min'](_0x5309f0[_0x4cadbf(0x98)],_0x198f14['right']),'bottom':Math[_0x4cadbf(0x90)](_0x5309f0[_0x4cadbf(0x95)],_0x198f14[_0x4cadbf(0x95)])};}function _(_0x363454){const _0x2db684=_0x350487;return Math[_0x2db684(0x9f)](_0x363454);}function v(_0x3ec592){const _0x4e57fa=_0x350487;let _0x18f97b=_0x3ec592['replace'](/\s+/gu,'\x20')[_0x4e57fa(0xcd)]();return _0x18f97b[_0x4e57fa(0xc7)]<=0x10?_0x18f97b:_0x18f97b['slice'](0x0,0x10)+'…';}function y(_0x451d66){const _0x341c8e=_0x350487;return{'left':_(_0x451d66[_0x341c8e(0x7a)]),'top':_(_0x451d66[_0x341c8e(0x81)]),'width':_(_0x451d66[_0x341c8e(0x79)]),'height':_(_0x451d66[_0x341c8e(0x80)])};}function b(_0xdacd4c){const _0x44fd30=_0x350487;let _0x43e494=_0xdacd4c[_0x44fd30(0x9d)];return{'id':_0xdacd4c[_0x44fd30(0xce)],'content':_0x43e494[_0x44fd30(0x8f)],'ink':y(_0x43e494['ink']),..._0x43e494[_0x44fd30(0xae)]===void 0x0?{}:{'color':_0x43e494[_0x44fd30(0xae)]},..._0x43e494[_0x44fd30(0x8b)]===void 0x0?{}:{'opacity':_0x43e494[_0x44fd30(0x8b)]}};}function x(_0x40aa65){const _0x57e345=_0x350487;return _0x40aa65[_0x57e345(0xae)]===void 0x0&&_0x40aa65[_0x57e345(0x8b)]===void 0x0?'':''+(_0x40aa65[_0x57e345(0xae)]===void 0x0?'':'\x20\x20'+_0x40aa65[_0x57e345(0xae)])+(_0x40aa65[_0x57e345(0x8b)]===void 0x0?'':'\x20\x20opacity\x20'+_0x40aa65[_0x57e345(0x8b)]);}function S(_0x25d893){const _0x1b1143=_0x350487;return{'id':_0x25d893[_0x1b1143(0xce)],'type':_0x25d893[_0x1b1143(0xbb)]===void 0x0?_0x25d893['elementType']:_0x25d893[_0x1b1143(0x84)]+':'+_0x25d893[_0x1b1143(0xbb)],..._0x25d893[_0x1b1143(0x6f)]===void 0x0?{}:{'fill':_0x25d893[_0x1b1143(0x6f)]},'box':y(_0x25d893['declared'])};}function _0x4c64(_0x22e7a2,_0x4c8019){_0x22e7a2=_0x22e7a2-0x6e;const _0x1a16b3=_0x1a16();let _0x4c64bd=_0x1a16b3[_0x22e7a2];return _0x4c64bd;}function C(_0x5d4f64){const _0x367b7a=_0x350487;if(_0x5d4f64===void 0x0)return _0x367b7a(0xb8);let _0x5f0932=_0x5d4f64[_0x367b7a(0x8b)]===void 0x0||_0x5d4f64['opacity']===0x1?'':'\x20@'+_0x5d4f64['opacity'];return((_0x5d4f64[_0x367b7a(0x94)]??'?')+'\x20'+(_0x5d4f64['color']??'')+_0x5f0932)[_0x367b7a(0xcd)]();}function w(_0x4dd2a7){const _0x3d9bff=_0x350487;return'('+_0x4dd2a7[_0x3d9bff(0x7a)]+','+_0x4dd2a7[_0x3d9bff(0x81)]+'\x20'+_0x4dd2a7[_0x3d9bff(0x79)]+'×'+_0x4dd2a7[_0x3d9bff(0x80)]+')';}function T(_0x16bfb0){const _0x1a1d07=_0x350487;let _0x48c4d0=_0x16bfb0[_0x1a1d07(0x6f)];return!(_0x48c4d0===void 0x0||_0x48c4d0[_0x1a1d07(0x94)]===_0x1a1d07(0xc3)||_0x48c4d0[_0x1a1d07(0x8b)]!==void 0x0&&_0x48c4d0[_0x1a1d07(0x8b)]<o||_0x16bfb0[_0x1a1d07(0xbb)]===void 0x0||!s[_0x1a1d07(0x85)](_0x16bfb0[_0x1a1d07(0xbb)])||_0x16bfb0[_0x1a1d07(0x8d)]===!0x1);}function E(_0x4718f7,_0x25dd00,_0x5a5e0f){const _0x4d99c6=_0x350487;let _0x88ad53=m(_0x4718f7[_0x4d99c6(0x9d)][_0x4d99c6(0xbc)]),_0x21d381;for(let _0x21496b of _0x25dd00){if(_0x21496b['zIndex']>=_0x4718f7[_0x4d99c6(0x9a)]||!T(_0x21496b))continue;let _0x1b2074=m(_0x21496b[_0x4d99c6(0x77)]),_0x1e1d57=h(_0x1b2074);if(_0x1e1d57>=0.5*_0x5a5e0f['pageWidth']*_0x5a5e0f['pageHeight'])continue;let _0x23badc=_0x88ad53['top']>=_0x1b2074['top']-n&&_0x88ad53[_0x4d99c6(0x95)]<=_0x1b2074[_0x4d99c6(0x95)]+n,_0x1cb891=_0x88ad53['left']>=_0x1b2074[_0x4d99c6(0x7a)]-n&&_0x88ad53[_0x4d99c6(0x7a)]<=_0x1b2074['right']+n&&_0x88ad53['top']>=_0x1b2074['top']-n,_0x2cea65=h(g(_0x88ad53,_0x1b2074))/Math[_0x4d99c6(0x7e)](h(_0x88ad53),0x1);!_0x23badc||!_0x1cb891||_0x2cea65<0.35||(_0x21d381===void 0x0||_0x1e1d57<_0x21d381[_0x4d99c6(0xbd)])&&(_0x21d381={'element':_0x21496b,'area':_0x1e1d57});}return _0x21d381?.[_0x4d99c6(0xbf)];}function D(_0xa1138){const _0x7f62bd=_0x350487;let _0xd0d9c9=[_0xa1138[_0x7f62bd(0x7a)]===void 0x0?'':'left\x20'+_0xa1138[_0x7f62bd(0x7a)]+'px',_0xa1138['top']===void 0x0?'':_0x7f62bd(0xaa)+_0xa1138['top']+'px',_0xa1138[_0x7f62bd(0x98)]===void 0x0?'':_0x7f62bd(0xb1)+_0xa1138[_0x7f62bd(0x98)]+'px',_0xa1138['bottom']===void 0x0?'':_0x7f62bd(0x8a)+_0xa1138[_0x7f62bd(0x95)]+'px'][_0x7f62bd(0x99)](_0x13db47=>_0x13db47!=='');return _0xd0d9c9[_0x7f62bd(0xc7)]===0x0?'-':_0xd0d9c9[_0x7f62bd(0x6e)](',\x20');}function O(_0x134a65){const _0xde49e3=_0x350487;if(typeof _0x134a65!='string'||_0x134a65['trim']()==='')throw new e(_0xde49e3(0xa6),_0xde49e3(0xa2));return _0x134a65;}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.0-rc.0",
4
+ "version": "1.0.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.0-rc.0"
21
+ "@univer-cli/univer-render-runtime": "1.0.0"
22
22
  }
23
23
  }