@univer-cli/unit-layout-lint 1.0.0 → 1.0.1

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 _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};
1
+ const _0x38ad1f=_0x3410;(function(_0x4cbb98,_0x4723fd){const _0x2f4f13=_0x3410,_0x568e4f=_0x4cbb98();while(!![]){try{const _0x4bf629=parseInt(_0x2f4f13(0x1d7))/0x1*(-parseInt(_0x2f4f13(0x1ec))/0x2)+parseInt(_0x2f4f13(0x1e3))/0x3+parseInt(_0x2f4f13(0x1db))/0x4*(-parseInt(_0x2f4f13(0x19d))/0x5)+-parseInt(_0x2f4f13(0x1c7))/0x6+-parseInt(_0x2f4f13(0x19b))/0x7+parseInt(_0x2f4f13(0x1e0))/0x8*(-parseInt(_0x2f4f13(0x1d5))/0x9)+parseInt(_0x2f4f13(0x1dd))/0xa*(parseInt(_0x2f4f13(0x1c8))/0xb);if(_0x4bf629===_0x4723fd)break;else _0x568e4f['push'](_0x568e4f['shift']());}catch(_0x4d3968){_0x568e4f['push'](_0x568e4f['shift']());}}}(_0x41f0,0xd30e5));var e=class extends Error{[_0x38ad1f(0x1ce)];constructor(_0x51f699,_0x53ab23,_0xf079df){const _0x292869=_0x38ad1f;super(_0x53ab23,_0xf079df),this[_0x292869(0x1ed)]='UnitLayoutLintError',this[_0x292869(0x1ce)]=_0x51f699;}};function t(_0x25f6ca){return _0x25f6ca instanceof e;}var n=0x2,r=0x6,i=0.02,a=0.15,o=0.5,s=new Set(['rect','roundRect']),c=[_0x38ad1f(0x1b8),_0x38ad1f(0x1b9),'text-overlaps-text'];function _0x41f0(){const _0x288e6a=['set','\x22\x20escapes\x20','4YcNvhK','no\x20fill','20cFxqQF','fingerprint','map','3550056YxWfQR','text\x20\x22','page','624543rcZBCI','elementType','INVALID_INPUT','startsWith','unitData','fill','round','height','\x20\x20opacity\x20','2VGVyNf','name','findIndex','top','get','slideOrder','Slide\x20unitData.id\x20is\x20required','join','push','left\x20','type','related','left','warning','Render\x20result\x20does\x20not\x20contain\x20exactly\x20one\x20matching\x20page\x20','INVALID_RENDER_RESULT','slice','text-overlaps-text','9664557cHUjjG','isInteger','1478935ybnqmU','declared','Slide\x20page\x20selector\x20is\x20invalid:\x20','shapeType','size','\x20by\x20','min','pages\x20must\x20not\x20be\x20empty','sort','bottom\x20','pageId','filter','pages','Slide\x20has\x20no\x20pages\x20to\x20lint','opacity','width','pageWidth','zIndex','elements','unit-layout-lint','ink','max','captureSlideLayout','elementId','top\x20','text','element','text-off-page','text-escapes-container','\x20=\x20','bottom','add','formulaReferenceUnits','color','signal','has','\x20overlaps\x20\x22','replace','%\x20of\x20the\x20smaller\x20glyph\x20band;\x20ink\x20','none','layout:','right\x20','6546276IFQrbQ','30835783AFzdWV','slide','length','box','\x22\x20runs\x20off\x20the\x20page\x20(','Unit\x20layout\x20lint\x20currently\x20supports\x20Slide\x20only','code','trim','visible','rule','content','pageHeight','runtime','27EfzqDX','Render\x20result\x20contains\x20unrequested\x20Slide\x20pages','851447yPROYZ','right'];_0x41f0=function(){return _0x288e6a;};return _0x41f0();}function l(_0x21c7c9){return{async 'lint'(_0x580fb5){const _0x2e48ba=_0x3410;if(_0x580fb5['unitType']!==_0x2e48ba(0x1c9))throw new e('INVALID_INPUT',_0x2e48ba(0x1cd));let _0x5d1dd6=O(_0x580fb5['unitData']['id']),_0x364a9a=u(_0x580fb5['unitData'][_0x2e48ba(0x1f1)]??[],_0x580fb5[_0x2e48ba(0x1a9)]),_0xbe7cdc=await _0x21c7c9[_0x2e48ba(0x1d4)][_0x2e48ba(0x1b3)]({'unitType':'slide','unitData':_0x580fb5[_0x2e48ba(0x1e7)],..._0x580fb5['formulaReferenceUnits']===void 0x0?{}:{'formulaReferenceUnits':_0x580fb5[_0x2e48ba(0x1bd)]},'pages':_0x364a9a[_0x2e48ba(0x1df)](({page:_0x27029f})=>_0x27029f),..._0x580fb5['signal']===void 0x0?{}:{'signal':_0x580fb5[_0x2e48ba(0x1bf)]}});return d(_0xbe7cdc,_0x364a9a),{'kind':_0x2e48ba(0x1b0),'unitId':_0x5d1dd6,'unitType':_0x2e48ba(0x1c9),'coverage':{'pages':_0x364a9a,'rules':c},'findings':f(_0xbe7cdc)};}};}function u(_0x367bea,_0x585e20){const _0x39a43b=_0x38ad1f;if(_0x367bea[_0x39a43b(0x1ca)]===0x0)throw new e(_0x39a43b(0x1e5),_0x39a43b(0x1aa));if(_0x585e20!==void 0x0&&_0x585e20[_0x39a43b(0x1ca)]===0x0)throw new e(_0x39a43b(0x1e5),_0x39a43b(0x1a4));let _0x5ce59=_0x585e20??_0x367bea['map']((_0x5d6a7a,_0x71477b)=>_0x71477b+0x1),_0x5d2198=new Set(),_0x575da4=[];for(let _0x88be09 of _0x5ce59){let _0x5377c1=typeof _0x88be09=='number'?_0x88be09:_0x367bea[_0x39a43b(0x1ee)](_0x14e8ab=>_0x14e8ab===_0x88be09)+0x1;if(!Number[_0x39a43b(0x19c)](_0x5377c1)||_0x5377c1<0x1||_0x5377c1>_0x367bea[_0x39a43b(0x1ca)])throw new e('INVALID_INPUT',_0x39a43b(0x19f)+String(_0x88be09));let _0x289af4=_0x367bea[_0x5377c1-0x1];_0x5d2198[_0x39a43b(0x1c0)](_0x289af4)||(_0x5d2198[_0x39a43b(0x1bc)](_0x289af4),_0x575da4[_0x39a43b(0x1f4)]({'page':_0x5377c1,'pageId':_0x289af4}));}return _0x575da4;}function d(_0x330435,_0x12c12e){const _0xa62662=_0x38ad1f;let _0x5f29e7=new Map();for(let _0x4d0558 of _0x330435[_0xa62662(0x1a9)]){let _0x2fe25b=_0x5f29e7[_0xa62662(0x1f0)](_0x4d0558['pageId'])??[];_0x2fe25b['push'](_0x4d0558),_0x5f29e7[_0xa62662(0x1d9)](_0x4d0558['pageId'],_0x2fe25b);}for(let _0xcf26f9 of _0x12c12e){let _0x18d67f=_0x5f29e7[_0xa62662(0x1f0)](_0xcf26f9[_0xa62662(0x1a7)])??[];if(_0x18d67f[_0xa62662(0x1ca)]!==0x1||_0x18d67f[0x0]?.[_0xa62662(0x1e2)]!==_0xcf26f9[_0xa62662(0x1e2)])throw new e(_0xa62662(0x198),_0xa62662(0x197)+_0xcf26f9[_0xa62662(0x1a7)]);let _0x22cb2b=_0x18d67f[0x0][_0xa62662(0x1af)][_0xa62662(0x1df)](({elementId:_0x254795})=>_0x254795);if(new Set(_0x22cb2b)[_0xa62662(0x1a1)]!==_0x22cb2b[_0xa62662(0x1ca)])throw new e('INVALID_RENDER_RESULT','Render\x20result\x20contains\x20duplicate\x20element\x20identities\x20on\x20page\x20'+_0xcf26f9[_0xa62662(0x1a7)]);}if(_0x330435['pages']['length']!==_0x12c12e[_0xa62662(0x1ca)])throw new e('INVALID_RENDER_RESULT',_0xa62662(0x1d6));}function f(_0x566149){const _0x157b71=_0x38ad1f;let _0x2c80c0=[];for(let _0x32cbda of _0x566149['pages']){let _0x3c6f12=_0x32cbda[_0x157b71(0x1af)][_0x157b71(0x1a8)](_0x35738d=>!_0x35738d[_0x157b71(0x1b4)][_0x157b71(0x1e6)](_0x157b71(0x1c5))),_0x1ac318=_0x3c6f12[_0x157b71(0x1a8)](_0x3a86db=>_0x3a86db[_0x157b71(0x1b6)]!==void 0x0&&_0x3a86db['text'][_0x157b71(0x1d2)][_0x157b71(0x1cf)]()!=='');for(let _0x1b61c3 of _0x1ac318){let _0x4fba11=m(_0x1b61c3['text'][_0x157b71(0x1b1)]),_0x401561={..._0x4fba11[_0x157b71(0x1f8)]<-0x2?{'left':_(-_0x4fba11[_0x157b71(0x1f8)])}:{},..._0x4fba11[_0x157b71(0x1ef)]<-0x2?{'top':_(-_0x4fba11[_0x157b71(0x1ef)])}:{},..._0x4fba11['right']>_0x32cbda['pageWidth']+n?{'right':_(_0x4fba11[_0x157b71(0x1d8)]-_0x32cbda[_0x157b71(0x1ad)])}:{},..._0x4fba11[_0x157b71(0x1bb)]>_0x32cbda[_0x157b71(0x1d3)]+n?{'bottom':_(_0x4fba11[_0x157b71(0x1bb)]-_0x32cbda['pageHeight'])}:{}},_0x5a163b=D(_0x401561);if(_0x5a163b!=='-'){let _0x5737d9=b(_0x1b61c3),_0x3d5466=y({'left':0x0,'top':0x0,'width':_0x32cbda[_0x157b71(0x1ad)],'height':_0x32cbda[_0x157b71(0x1d3)]});_0x2c80c0[_0x157b71(0x1f4)](p({'page':_0x32cbda['page'],'pageId':_0x32cbda[_0x157b71(0x1a7)],'rule':_0x157b71(0x1b8),'id':_0x1b61c3[_0x157b71(0x1b4)],'text':_0x5737d9,'pageBox':_0x3d5466,'overflow':_0x401561,'detail':_0x157b71(0x1e1)+v(_0x5737d9['content'])+_0x157b71(0x1cc)+_0x5a163b+');\x20ink\x20'+w(_0x5737d9[_0x157b71(0x1b1)])+',\x20page\x20'+w(_0x3d5466)}));}}for(let _0x34bb27 of _0x1ac318){let _0x1257ee=E(_0x34bb27,_0x3c6f12,_0x32cbda);if(_0x1257ee===void 0x0)continue;let _0x4ef5b8=m(_0x34bb27['text'][_0x157b71(0x1b1)]),_0x51b317=m(_0x1257ee[_0x157b71(0x19e)]),_0x436c18=Math[_0x157b71(0x1b2)](r,i*(_0x51b317[_0x157b71(0x1d8)]-_0x51b317[_0x157b71(0x1f8)])),_0x2cb2e9={..._0x51b317[_0x157b71(0x1f8)]-_0x4ef5b8[_0x157b71(0x1f8)]>_0x436c18?{'left':_(_0x51b317[_0x157b71(0x1f8)]-_0x4ef5b8[_0x157b71(0x1f8)])}:{},..._0x4ef5b8[_0x157b71(0x1d8)]-_0x51b317[_0x157b71(0x1d8)]>_0x436c18?{'right':_(_0x4ef5b8[_0x157b71(0x1d8)]-_0x51b317[_0x157b71(0x1d8)])}:{},..._0x4ef5b8[_0x157b71(0x1bb)]-_0x51b317['bottom']>_0x436c18?{'bottom':_(_0x4ef5b8[_0x157b71(0x1bb)]-_0x51b317[_0x157b71(0x1bb)])}:{}},_0x4fcb05=D(_0x2cb2e9);if(_0x4fcb05!=='-'){let _0x3447d8=b(_0x34bb27),_0x21b364=S(_0x1257ee);_0x2c80c0[_0x157b71(0x1f4)](p({'page':_0x32cbda[_0x157b71(0x1e2)],'pageId':_0x32cbda[_0x157b71(0x1a7)],'rule':_0x157b71(0x1b9),'id':_0x34bb27['elementId'],'related':_0x1257ee[_0x157b71(0x1b4)],'text':_0x3447d8,'container':_0x21b364,'overflow':_0x2cb2e9,'detail':_0x157b71(0x1e1)+v(_0x3447d8[_0x157b71(0x1d2)])+_0x157b71(0x1da)+_0x21b364['id']+'\x20('+_0x4fcb05+');\x20ink\x20'+w(_0x3447d8[_0x157b71(0x1b1)])+',\x20'+_0x21b364['id']+_0x157b71(0x1ba)+_0x21b364[_0x157b71(0x1f6)]+'\x20'+C(_0x21b364[_0x157b71(0x1e8)])+'\x20'+w(_0x21b364[_0x157b71(0x1cb)])}));}}for(let _0x3a8332=0x0;_0x3a8332<_0x1ac318[_0x157b71(0x1ca)];_0x3a8332+=0x1)for(let _0xe8a2e6=_0x3a8332+0x1;_0xe8a2e6<_0x1ac318[_0x157b71(0x1ca)];_0xe8a2e6+=0x1){let _0xa97a5b=_0x1ac318[_0x3a8332],_0x36aa31=_0x1ac318[_0xe8a2e6],_0x5e6452=m(_0xa97a5b[_0x157b71(0x1b6)][_0x157b71(0x1b1)]),_0x55244a=m(_0x36aa31[_0x157b71(0x1b6)][_0x157b71(0x1b1)]),_0x14b04f=h(g(_0x5e6452,_0x55244a));if(_0x14b04f<=0x1)continue;let _0x5413b9=_0x14b04f/Math[_0x157b71(0x1b2)](0x1,Math[_0x157b71(0x1a3)](h(_0x5e6452),h(_0x55244a)));if(_0x5413b9<=a)continue;let _0x4c8a19=b(_0xa97a5b),_0x2a8c1c=b(_0x36aa31);_0x2c80c0[_0x157b71(0x1f4)](p({'page':_0x32cbda['page'],'pageId':_0x32cbda['pageId'],'rule':_0x157b71(0x19a),'id':_0xa97a5b[_0x157b71(0x1b4)],'related':_0x36aa31[_0x157b71(0x1b4)],'text':_0x4c8a19,'other':_0x2a8c1c,'overlapRatio':Math['round'](_0x5413b9*0x64)/0x64,'detail':'text\x20\x22'+v(_0x4c8a19['content'])+'\x22'+x(_0x4c8a19)+_0x157b71(0x1c1)+v(_0x2a8c1c['content'])+'\x22'+x(_0x2a8c1c)+_0x157b71(0x1a2)+Math[_0x157b71(0x1e9)](_0x5413b9*0x64)+_0x157b71(0x1c3)+w(_0x4c8a19['ink'])+',\x20'+w(_0x2a8c1c[_0x157b71(0x1b1)])}));}}return _0x2c80c0[_0x157b71(0x1a5)]((_0x3f8496,_0x1fa4bb)=>_0x3f8496[_0x157b71(0x1de)]['localeCompare'](_0x1fa4bb[_0x157b71(0x1de)]));}function p(_0x37862e){const _0x57fed0=_0x38ad1f;return{..._0x37862e,'fingerprint':[_0x37862e[_0x57fed0(0x1d1)],_0x37862e[_0x57fed0(0x1a7)],_0x37862e['id'],_0x37862e[_0x57fed0(0x1f7)]??''][_0x57fed0(0x1f3)](':'),'severity':_0x57fed0(0x1f9)};}function m(_0x5bf82c){const _0x43db13=_0x38ad1f;return{'left':_0x5bf82c[_0x43db13(0x1f8)],'top':_0x5bf82c[_0x43db13(0x1ef)],'right':_0x5bf82c[_0x43db13(0x1f8)]+_0x5bf82c[_0x43db13(0x1ac)],'bottom':_0x5bf82c[_0x43db13(0x1ef)]+_0x5bf82c[_0x43db13(0x1ea)]};}function h(_0x315acf){const _0x41e3cd=_0x38ad1f;return Math[_0x41e3cd(0x1b2)](0x0,_0x315acf[_0x41e3cd(0x1d8)]-_0x315acf[_0x41e3cd(0x1f8)])*Math[_0x41e3cd(0x1b2)](0x0,_0x315acf['bottom']-_0x315acf['top']);}function g(_0x3d8965,_0x420ba9){const _0x4ef2ae=_0x38ad1f;return{'left':Math['max'](_0x3d8965[_0x4ef2ae(0x1f8)],_0x420ba9[_0x4ef2ae(0x1f8)]),'top':Math[_0x4ef2ae(0x1b2)](_0x3d8965[_0x4ef2ae(0x1ef)],_0x420ba9[_0x4ef2ae(0x1ef)]),'right':Math['min'](_0x3d8965[_0x4ef2ae(0x1d8)],_0x420ba9[_0x4ef2ae(0x1d8)]),'bottom':Math[_0x4ef2ae(0x1a3)](_0x3d8965[_0x4ef2ae(0x1bb)],_0x420ba9[_0x4ef2ae(0x1bb)])};}function _(_0x200e59){return Math['round'](_0x200e59);}function v(_0x37f004){const _0x46eac1=_0x38ad1f;let _0x3c4b72=_0x37f004[_0x46eac1(0x1c2)](/\s+/gu,'\x20')['trim']();return _0x3c4b72['length']<=0x10?_0x3c4b72:_0x3c4b72[_0x46eac1(0x199)](0x0,0x10)+'…';}function y(_0x20b636){const _0x15fcaa=_0x38ad1f;return{'left':_(_0x20b636[_0x15fcaa(0x1f8)]),'top':_(_0x20b636['top']),'width':_(_0x20b636[_0x15fcaa(0x1ac)]),'height':_(_0x20b636['height'])};}function b(_0x4cb89b){const _0x4ef211=_0x38ad1f;let _0x55c1f2=_0x4cb89b['text'];return{'id':_0x4cb89b[_0x4ef211(0x1b4)],'content':_0x55c1f2[_0x4ef211(0x1d2)],'ink':y(_0x55c1f2[_0x4ef211(0x1b1)]),..._0x55c1f2[_0x4ef211(0x1be)]===void 0x0?{}:{'color':_0x55c1f2['color']},..._0x55c1f2['opacity']===void 0x0?{}:{'opacity':_0x55c1f2[_0x4ef211(0x1ab)]}};}function x(_0xe4334){const _0x2f3fd0=_0x38ad1f;return _0xe4334['color']===void 0x0&&_0xe4334[_0x2f3fd0(0x1ab)]===void 0x0?'':''+(_0xe4334['color']===void 0x0?'':'\x20\x20'+_0xe4334['color'])+(_0xe4334['opacity']===void 0x0?'':_0x2f3fd0(0x1eb)+_0xe4334['opacity']);}function _0x3410(_0x40e312,_0x4bc2a1){_0x40e312=_0x40e312-0x197;const _0x41f03e=_0x41f0();let _0x3410aa=_0x41f03e[_0x40e312];return _0x3410aa;}function S(_0x37ae34){const _0x4f651a=_0x38ad1f;return{'id':_0x37ae34[_0x4f651a(0x1b4)],'type':_0x37ae34['shapeType']===void 0x0?_0x37ae34[_0x4f651a(0x1e4)]:_0x37ae34[_0x4f651a(0x1e4)]+':'+_0x37ae34[_0x4f651a(0x1a0)],..._0x37ae34[_0x4f651a(0x1e8)]===void 0x0?{}:{'fill':_0x37ae34[_0x4f651a(0x1e8)]},'box':y(_0x37ae34[_0x4f651a(0x19e)])};}function C(_0x251c03){const _0x29c37b=_0x38ad1f;if(_0x251c03===void 0x0)return _0x29c37b(0x1dc);let _0x26c53a=_0x251c03[_0x29c37b(0x1ab)]===void 0x0||_0x251c03[_0x29c37b(0x1ab)]===0x1?'':'\x20@'+_0x251c03[_0x29c37b(0x1ab)];return((_0x251c03['type']??'?')+'\x20'+(_0x251c03['color']??'')+_0x26c53a)[_0x29c37b(0x1cf)]();}function w(_0x358fcb){const _0x209ee7=_0x38ad1f;return'('+_0x358fcb[_0x209ee7(0x1f8)]+','+_0x358fcb[_0x209ee7(0x1ef)]+'\x20'+_0x358fcb['width']+'×'+_0x358fcb[_0x209ee7(0x1ea)]+')';}function T(_0x288610){const _0x3619af=_0x38ad1f;let _0x23cc36=_0x288610['fill'];return!(_0x23cc36===void 0x0||_0x23cc36[_0x3619af(0x1f6)]===_0x3619af(0x1c4)||_0x23cc36[_0x3619af(0x1ab)]!==void 0x0&&_0x23cc36[_0x3619af(0x1ab)]<o||_0x288610[_0x3619af(0x1a0)]===void 0x0||!s['has'](_0x288610[_0x3619af(0x1a0)])||_0x288610[_0x3619af(0x1d0)]===!0x1);}function E(_0x2fc7e6,_0x518994,_0x4d4dc0){const _0x37a4ca=_0x38ad1f;let _0x470add=m(_0x2fc7e6['text'][_0x37a4ca(0x1b1)]),_0x17c563;for(let _0x41a7e3 of _0x518994){if(_0x41a7e3[_0x37a4ca(0x1ae)]>=_0x2fc7e6[_0x37a4ca(0x1ae)]||!T(_0x41a7e3))continue;let _0x14ba6b=m(_0x41a7e3[_0x37a4ca(0x19e)]),_0x248b79=h(_0x14ba6b);if(_0x248b79>=0.5*_0x4d4dc0[_0x37a4ca(0x1ad)]*_0x4d4dc0[_0x37a4ca(0x1d3)])continue;let _0x3b5688=_0x470add['top']>=_0x14ba6b[_0x37a4ca(0x1ef)]-n&&_0x470add[_0x37a4ca(0x1bb)]<=_0x14ba6b[_0x37a4ca(0x1bb)]+n,_0x5582d0=_0x470add[_0x37a4ca(0x1f8)]>=_0x14ba6b['left']-n&&_0x470add[_0x37a4ca(0x1f8)]<=_0x14ba6b['right']+n&&_0x470add[_0x37a4ca(0x1ef)]>=_0x14ba6b['top']-n,_0x35475d=h(g(_0x470add,_0x14ba6b))/Math[_0x37a4ca(0x1b2)](h(_0x470add),0x1);!_0x3b5688||!_0x5582d0||_0x35475d<0.35||(_0x17c563===void 0x0||_0x248b79<_0x17c563['area'])&&(_0x17c563={'element':_0x41a7e3,'area':_0x248b79});}return _0x17c563?.[_0x37a4ca(0x1b7)];}function D(_0xbd8045){const _0x242dab=_0x38ad1f;let _0x40cd45=[_0xbd8045[_0x242dab(0x1f8)]===void 0x0?'':_0x242dab(0x1f5)+_0xbd8045[_0x242dab(0x1f8)]+'px',_0xbd8045[_0x242dab(0x1ef)]===void 0x0?'':_0x242dab(0x1b5)+_0xbd8045[_0x242dab(0x1ef)]+'px',_0xbd8045[_0x242dab(0x1d8)]===void 0x0?'':_0x242dab(0x1c6)+_0xbd8045[_0x242dab(0x1d8)]+'px',_0xbd8045[_0x242dab(0x1bb)]===void 0x0?'':_0x242dab(0x1a6)+_0xbd8045[_0x242dab(0x1bb)]+'px']['filter'](_0x44eed8=>_0x44eed8!=='');return _0x40cd45[_0x242dab(0x1ca)]===0x0?'-':_0x40cd45[_0x242dab(0x1f3)](',\x20');}function O(_0x552061){const _0x25c242=_0x38ad1f;if(typeof _0x552061!='string'||_0x552061[_0x25c242(0x1cf)]()==='')throw new e('INVALID_INPUT',_0x25c242(0x1f2));return _0x552061;}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",
4
+ "version": "1.0.1",
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"
21
+ "@univer-cli/univer-render-runtime": "1.0.1"
22
22
  }
23
23
  }