@univerjs-pro/sheets-shape 0.15.3-insiders.20260131-cbd5fac
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/lib/cjs/index.js +1 -0
- package/lib/es/index.js +1 -0
- package/lib/index.js +1 -0
- package/lib/types/commands/command/update-shape-type.command.d.ts +9 -0
- package/lib/types/commands/mutation/add-shape.mutation.d.ts +9 -0
- package/lib/types/commands/mutation/remove-shape.mutation.d.ts +6 -0
- package/lib/types/commands/mutation/update-shape-data.mutation.d.ts +9 -0
- package/lib/types/commands/mutation/update-shape-type.mutation.d.ts +9 -0
- package/lib/types/controllers/config.schema.d.ts +5 -0
- package/lib/types/index.d.ts +12 -0
- package/lib/types/model/shape-manager.d.ts +31 -0
- package/lib/types/plugin.d.ts +15 -0
- package/lib/types/services/sheet-shape-services.d.ts +37 -0
- package/lib/umd/index.js +1 -0
- package/package.json +79 -0
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';const _0x2d9039=_0x4b7f;(function(_0x216084,_0x38a547){const _0x2c5cd9=_0x4b7f,_0x13c51d=_0x216084();while(!![]){try{const _0x4d0205=parseInt(_0x2c5cd9(0x1a3))/0x1*(-parseInt(_0x2c5cd9(0x16d))/0x2)+-parseInt(_0x2c5cd9(0x17b))/0x3*(parseInt(_0x2c5cd9(0x1b2))/0x4)+-parseInt(_0x2c5cd9(0x173))/0x5*(-parseInt(_0x2c5cd9(0x182))/0x6)+parseInt(_0x2c5cd9(0x183))/0x7+parseInt(_0x2c5cd9(0x198))/0x8+-parseInt(_0x2c5cd9(0x194))/0x9*(parseInt(_0x2c5cd9(0x15e))/0xa)+-parseInt(_0x2c5cd9(0x166))/0xb*(parseInt(_0x2c5cd9(0x15b))/0xc);if(_0x4d0205===_0x38a547)break;else _0x13c51d['push'](_0x13c51d['shift']());}catch(_0x4ecd45){_0x13c51d['push'](_0x13c51d['shift']());}}}(_0x4ab1,0xcaaea));var D=Object['defineProperty'],C=(_0x409463,_0x4da7dc,_0x368815)=>_0x4da7dc in _0x409463?D(_0x409463,_0x4da7dc,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x368815}):_0x409463[_0x4da7dc]=_0x368815,S=(_0x4fffca,_0xebd487,_0x2377d3)=>C(_0x4fffca,typeof _0xebd487!=_0x2d9039(0x1b3)?_0xebd487+'':_0xebd487,_0x2377d3);function _0x4b7f(_0x55a830,_0x397790){_0x55a830=_0x55a830-0x159;const _0x4ab147=_0x4ab1();let _0x4b7fe0=_0x4ab147[_0x55a830];return _0x4b7fe0;}Object[_0x2d9039(0x164)](exports,Symbol['toStringTag'],{'value':_0x2d9039(0x180)});const p=require('@univerjs/core'),l=require('@univerjs-pro/engine-shape'),b=require('@univerjs-pro/license');function _0x4ab1(){const _0x20ff36=['264BclcHn','from','ShapeModel','getBasicShapeType','add','_serializeShapeForUnit','SHEET_SHAPE_PLUGIN','2940386mDmhXu','length','dispose','has','DependentOn','getShapeData','23935fZLvho','UNIVER_SHEET','_deserializeShapeForUnit','clear','getOwnPropertyDescriptor','IConfigService','_disposed','type','2274mHKsAP','Inject','RemoveSheetsShapeMutation','toJSON','keys','Module','sheet.mutation.update-shape-type','1962bFgJtb','3125920KCqkZp','_resourcesManagerService','shapeData','push','_linesIds','COMMAND','pushUndoRedo','IUndoRedoService','addShape','UniverSheetsShapePlugin','syncExecuteCommand','_injector','IResourceManagerService','forEach','sheets-shape.config','stringify','setConfig','946557rtFDLh','setShapeType','getLineShapeRelation','registerCommand','11407264uZibpq','SheetsShapeServices','_configService','registerPluginResource','onStarting','delete','insertShape','_shapeModelManagerMap','_shapes','isLineShape','CommandType','1Wxrtcc','fromJSON','getShapeDataById','_initSnapshot','setShapeData','get','UniverInstanceType','_initCommands','every','onRendered','MUTATION','params','Injector','merge','isConnectorShape','1916EFCUwm','symbol','_config','getShapeRelation','ICommandService','getShapeModel','_ensureShapeModelManager','Plugin','_commandService','UniverLicensePlugin','sheet.mutation.update-shape-data','getShapeTypeById','176832WoVGvI','set','getShapeType','40qQgiRq','parse','Disposable','hasShape','_groupIds','pluginName','defineProperty','removeShape'];_0x4ab1=function(){return _0x20ff36;};return _0x4ab1();}class f extends p[_0x2d9039(0x160)]{constructor(){const _0x458330=_0x2d9039;super(),S(this,'_shapes',new Map()),S(this,_0x458330(0x187),new Set()),S(this,_0x458330(0x162),new Set());}['addShape'](_0x344c5e,_0x32bfda,_0x5442a4){const _0x285972=_0x2d9039,_0x2e0f81=new l[(_0x285972(0x168))](_0x344c5e,_0x32bfda,_0x5442a4);return this[_0x285972(0x1a0)][_0x285972(0x15c)](_0x32bfda,_0x2e0f81),l[_0x285972(0x1b1)](_0x344c5e)&&this[_0x285972(0x187)][_0x285972(0x16a)](_0x32bfda),_0x2e0f81;}['getBasicShapeRelation'](_0x549600){const _0x4779d8=_0x2d9039;var _0x1c3215,_0x24d7b0;const _0x16074d=[];for(const _0x3748c8 of this[_0x4779d8(0x187)]){const _0x57ab83=this[_0x4779d8(0x1a0)][_0x4779d8(0x1a8)](_0x3748c8);if(_0x57ab83){const _0x10a874=_0x57ab83[_0x4779d8(0x1b5)]();_0x10a874&&(((_0x1c3215=_0x10a874[_0x4779d8(0x167)])==null?void 0x0:_0x1c3215['shapeId'])===_0x549600&&_0x16074d['push']({..._0x10a874['from'],'lineShapeId':_0x3748c8,'isFrom':!0x0}),((_0x24d7b0=_0x10a874['to'])==null?void 0x0:_0x24d7b0['shapeId'])===_0x549600&&_0x16074d['push']({..._0x10a874['to'],'lineShapeId':_0x3748c8,'isFrom':!0x1}));}}return _0x16074d;}[_0x2d9039(0x196)](_0x14af45){const _0x469e14=_0x2d9039,_0x28a8b2=this['_shapes'][_0x469e14(0x1a8)](_0x14af45);if(_0x28a8b2)return _0x28a8b2[_0x469e14(0x1b5)]();}[_0x2d9039(0x15d)](_0x175c57){const _0x38e9e6=_0x2d9039,_0xb6f351=this[_0x38e9e6(0x1a0)]['get'](_0x175c57);if(_0xb6f351)return _0xb6f351['getShapeType']();}['hasShape'](_0x130dcc){const _0x25777f=_0x2d9039;return this[_0x25777f(0x1a0)][_0x25777f(0x170)](_0x130dcc);}[_0x2d9039(0x165)](_0x42984f){const _0x4c0614=_0x2d9039,_0x5c3c36=this['_shapes'][_0x4c0614(0x1a8)](_0x42984f);_0x5c3c36&&(l['isConnectorShape'](_0x5c3c36[_0x4c0614(0x15d)]())&&this[_0x4c0614(0x187)][_0x4c0614(0x19d)](_0x42984f),this[_0x4c0614(0x1a0)]['delete'](_0x42984f));}[_0x2d9039(0x17e)](){const _0x41629d=_0x2d9039,_0x5e622f=[];return this['_shapes'][_0x41629d(0x190)](_0x15498d=>{const _0x5913b6=_0x41629d;_0x5e622f['push'](_0x15498d[_0x5913b6(0x17e)]());}),_0x5e622f;}['fromJSON'](_0x25324d){const _0x331ab3=_0x2d9039;for(const _0x1a3fdb of _0x25324d){const {id:_0x193b38,shapeType:_0xfab9a8}=_0x1a3fdb,_0x54b4ad=this[_0x331ab3(0x18b)](_0xfab9a8,_0x193b38,_0x1a3fdb[_0x331ab3(0x185)]);_0x54b4ad&&_0x54b4ad[_0x331ab3(0x1a1)]()&&this[_0x331ab3(0x187)][_0x331ab3(0x16a)](_0x193b38);}}[_0x2d9039(0x16f)](){const _0x71ad7c=_0x2d9039;this[_0x71ad7c(0x179)]||(this[_0x71ad7c(0x1a0)]['forEach'](_0x23558a=>{const _0x2c809a=_0x71ad7c;_0x23558a[_0x2c809a(0x16f)]();}),this[_0x71ad7c(0x1a0)]['clear'](),this['_linesIds'][_0x71ad7c(0x176)](),this[_0x71ad7c(0x162)][_0x71ad7c(0x176)](),super['dispose']());}}var R=Object[_0x2d9039(0x177)],J=(_0x5bd820,_0x438917,_0x3b2a31,_0x1140f5)=>{const _0x2661bb=_0x2d9039;for(var _0x5dbf89=_0x1140f5>0x1?void 0x0:_0x1140f5?R(_0x438917,_0x3b2a31):_0x438917,_0x4550c3=_0x5bd820[_0x2661bb(0x16e)]-0x1,_0xcffa0a;_0x4550c3>=0x0;_0x4550c3--)(_0xcffa0a=_0x5bd820[_0x4550c3])&&(_0x5dbf89=_0xcffa0a(_0x5dbf89)||_0x5dbf89);return _0x5dbf89;},j=(_0x2ed4e5,_0x368c62)=>(_0x3ce84f,_0x5ccd1e)=>_0x368c62(_0x3ce84f,_0x5ccd1e,_0x2ed4e5);const w=_0x2d9039(0x16c);exports[_0x2d9039(0x199)]=class extends p['Disposable']{constructor(_0xbe5bbb){const _0x23620d=_0x2d9039;super(),S(this,_0x23620d(0x19f),new Map()),(this['_resourcesManagerService']=_0xbe5bbb,this[_0x23620d(0x1a6)]());}[_0x2d9039(0x1b8)](_0x24c891,_0x4678ed){const _0x49d73a=_0x2d9039;let _0xf06b8c=this[_0x49d73a(0x19f)][_0x49d73a(0x1a8)](_0x24c891);_0xf06b8c||(_0xf06b8c=new Map(),this[_0x49d73a(0x19f)][_0x49d73a(0x15c)](_0x24c891,_0xf06b8c));let _0x2c36d7=_0xf06b8c[_0x49d73a(0x1a8)](_0x4678ed);return _0x2c36d7||(_0x2c36d7=new f(),_0xf06b8c[_0x49d73a(0x15c)](_0x4678ed,_0x2c36d7)),_0x2c36d7;}[_0x2d9039(0x19e)](_0x19682a,_0x3b8d9a,_0x18e5c4,_0x2e5d70,_0x2cf7f3){const _0x13d650=_0x2d9039;this[_0x13d650(0x1b8)](_0x19682a,_0x3b8d9a)[_0x13d650(0x18b)](_0x18e5c4,_0x2e5d70,_0x2cf7f3);}[_0x2d9039(0x165)](_0x582a55,_0x1f164c,_0x3725b9){this['_ensureShapeModelManager'](_0x582a55,_0x1f164c)['removeShape'](_0x3725b9);}[_0x2d9039(0x169)](_0x37ea56,_0x44245b,_0x333762){const _0x22378c=_0x2d9039;return this[_0x22378c(0x1b8)](_0x37ea56,_0x44245b)[_0x22378c(0x15d)](_0x333762);}[_0x2d9039(0x15d)](_0xf0af41,_0x54260c,_0x1eb57f){const _0x4bb2e4=_0x2d9039;return this[_0x4bb2e4(0x1b8)](_0xf0af41,_0x54260c)[_0x4bb2e4(0x15d)](_0x1eb57f);}[_0x2d9039(0x161)](_0x4beb2e,_0x250cb4,_0x314da6){const _0x3371a4=_0x2d9039;return this[_0x3371a4(0x1b8)](_0x4beb2e,_0x250cb4)[_0x3371a4(0x161)](_0x314da6);}[_0x2d9039(0x15a)](_0x2d1ec8,_0x2a6017,_0x436597){const _0x4b509a=_0x2d9039;return this[_0x4b509a(0x1b8)](_0x2d1ec8,_0x2a6017)['getShapeType'](_0x436597);}[_0x2d9039(0x1a5)](_0x4c8adb,_0xe521c0,_0x221666){const _0x2d0a4c=_0x2d9039,_0x2285b2=this[_0x2d0a4c(0x1b8)](_0x4c8adb,_0xe521c0);if(!_0x2285b2[_0x2d0a4c(0x15d)](_0x221666))return;const _0x30d214=_0x2285b2[_0x2d0a4c(0x1a0)][_0x2d0a4c(0x1a8)](_0x221666);if(_0x30d214)return _0x30d214[_0x2d0a4c(0x172)]();}[_0x2d9039(0x1b7)](_0x1ed548,_0x485c58,_0x4a485e){const _0x767bc=_0x2d9039;return this[_0x767bc(0x1b8)](_0x1ed548,_0x485c58)['_shapes']['get'](_0x4a485e);}['getBasicShapeRelation'](_0x3388aa,_0x176ddb,_0x1ebda6){const _0x1ac5a1=_0x2d9039;return this[_0x1ac5a1(0x1b8)](_0x3388aa,_0x176ddb)['getBasicShapeRelation'](_0x1ebda6);}['getLineShapeRelation'](_0x52811a,_0x170ec0,_0x1c79c2){const _0x131a6f=_0x2d9039,_0x15210b=this[_0x131a6f(0x1b8)](_0x52811a,_0x170ec0)['_shapes']['get'](_0x1c79c2);if(_0x15210b)return _0x15210b[_0x131a6f(0x1b5)]();}[_0x2d9039(0x195)](){}[_0x2d9039(0x16b)](_0x163df6){const _0x395b61=_0x2d9039,_0x174088={},_0x393454=this['_shapeModelManagerMap'][_0x395b61(0x1a8)](_0x163df6);return _0x393454&&_0x393454['forEach']((_0x2dde27,_0x33dad7)=>{const _0x4936f4=_0x395b61;_0x174088[_0x33dad7]=_0x2dde27[_0x4936f4(0x17e)]();}),JSON[_0x395b61(0x192)](_0x174088);}[_0x2d9039(0x175)](_0x46f59b,_0x5e55ca){const _0x3ed859=_0x2d9039;Object[_0x3ed859(0x17f)](_0x5e55ca)['forEach'](_0x5410ef=>{const _0x4a8a9c=_0x3ed859;this[_0x4a8a9c(0x1b8)](_0x46f59b,_0x5410ef)[_0x4a8a9c(0x1a4)](_0x5e55ca[_0x5410ef]);});}['toJSON'](){const _0x46fb8f=_0x2d9039,_0x4494e0={};return this[_0x46fb8f(0x19f)][_0x46fb8f(0x190)]((_0x4509d5,_0x289ad7)=>{const _0x54ca34=_0x46fb8f;_0x4494e0[_0x289ad7]={},_0x4509d5[_0x54ca34(0x190)]((_0x2d2f11,_0x596882)=>{_0x4494e0[_0x289ad7][_0x596882]=_0x2d2f11['toJSON']();});}),_0x4494e0;}[_0x2d9039(0x1a4)](_0x5dd390){const _0x4a3b55=_0x2d9039;Object[_0x4a3b55(0x17f)](_0x5dd390)[_0x4a3b55(0x190)](_0x22d53b=>{const _0x45e6da=_0x4a3b55,_0x529ab6=_0x5dd390[_0x22d53b];Object['keys'](_0x529ab6)[_0x45e6da(0x190)](_0x35e9d6=>{const _0x4d6b8d=_0x45e6da;this[_0x4d6b8d(0x1b8)](_0x22d53b,_0x35e9d6)['fromJSON'](_0x529ab6[_0x35e9d6]);});});}[_0x2d9039(0x1a6)](){const _0x51b1b1=_0x2d9039;this[_0x51b1b1(0x184)][_0x51b1b1(0x19b)]({'pluginName':w,'businesses':[p[_0x51b1b1(0x1a9)][_0x51b1b1(0x174)]],'toJson':_0x2894ff=>this[_0x51b1b1(0x16b)](_0x2894ff),'parseJson':_0x4b62e1=>JSON[_0x51b1b1(0x15f)](_0x4b62e1),'onLoad':(_0x301c34,_0x4f2555)=>{this['_deserializeShapeForUnit'](_0x301c34,_0x4f2555);},'onUnLoad':_0x635dba=>{const _0x37afc1=_0x51b1b1,_0x25855a=this[_0x37afc1(0x19f)][_0x37afc1(0x1a8)](_0x635dba);_0x25855a&&(_0x25855a[_0x37afc1(0x190)](_0x25b33e=>{const _0x1e88e1=_0x37afc1;_0x25b33e[_0x1e88e1(0x16f)]();}),this[_0x37afc1(0x19f)]['delete'](_0x635dba));}});}['dispose'](){const _0x3f41a3=_0x2d9039;this['_shapeModelManagerMap'][_0x3f41a3(0x190)](_0x38eec9=>{const _0x3afb95=_0x3f41a3;_0x38eec9[_0x3afb95(0x190)](_0x476631=>{const _0xc4ba36=_0x3afb95;_0x476631[_0xc4ba36(0x16f)]();});});}},exports[_0x2d9039(0x199)]=J([j(0x0,p[_0x2d9039(0x18f)])],exports[_0x2d9039(0x199)]);const d={'id':_0x2d9039(0x181),'type':p[_0x2d9039(0x1a2)]['MUTATION'],'handler':(_0x529fa6,_0x435dde)=>{const _0x3530e6=_0x2d9039,{unitId:_0x2d97da,subUnitId:_0x17d24b,shapeType:_0xa8b645,shapeId:_0x1d68de,shapeData:_0x1298c9}=_0x435dde,_0x599c87=_0x529fa6['get'](exports[_0x3530e6(0x199)])[_0x3530e6(0x1b7)](_0x2d97da,_0x17d24b,_0x1d68de);return _0x599c87&&(_0x599c87[_0x3530e6(0x195)](_0xa8b645),_0x1298c9&&(_0x599c87==null||_0x599c87[_0x3530e6(0x1a7)](_0x1298c9))),!0x0;}},H={'id':'sheet.command.update-shape-type','type':p[_0x2d9039(0x1a2)][_0x2d9039(0x188)],'handler':(_0x3d03e6,_0x45f77d)=>{const _0x15fca=_0x2d9039;if(!_0x45f77d)return!0x1;const _0x69bfd9=_0x3d03e6[_0x15fca(0x1a8)](p[_0x15fca(0x1b6)]),_0x19bf51=_0x3d03e6[_0x15fca(0x1a8)](exports[_0x15fca(0x199)]),_0x4fd0f9=_0x3d03e6[_0x15fca(0x1a8)](p[_0x15fca(0x18a)]),_0x4f19ec=[],_0x22048b=[],{unitId:_0x4a15b8,subUnitId:_0x5c46e9,shapeId:_0x97d5da,shapeType:_0x522054,shapeData:_0xbdccd4}=_0x45f77d,_0x46bad0=_0x19bf51[_0x15fca(0x1b7)](_0x4a15b8,_0x5c46e9,_0x97d5da);if(_0x46bad0){const _0x400fe4=_0x46bad0['getShapeType'](),_0x2c78ce=Object['assign']({},_0x46bad0[_0x15fca(0x172)]()),_0x1e39b1={'unitId':_0x4a15b8,'subUnitId':_0x5c46e9,'shapeId':_0x97d5da,'shapeType':_0x522054,'shapeData':_0xbdccd4},_0x522b31={'unitId':_0x4a15b8,'subUnitId':_0x5c46e9,'shapeId':_0x97d5da,'shapeType':_0x400fe4,'shapeData':_0x2c78ce};return _0x4f19ec['push']({'id':d['id'],'params':_0x1e39b1}),_0x22048b[_0x15fca(0x186)]({'id':d['id'],'params':_0x522b31}),_0x4f19ec[_0x15fca(0x1ab)](_0x223817=>_0x69bfd9[_0x15fca(0x18d)](_0x223817['id'],_0x223817[_0x15fca(0x1ae)]))&&_0x4fd0f9[_0x15fca(0x189)]({'unitID':_0x4a15b8,'redoMutations':[..._0x4f19ec],'undoMutations':[..._0x22048b]}),!0x0;}return!0x1;}},m={'id':'sheet.mutation.insert-shape','type':p[_0x2d9039(0x1a2)][_0x2d9039(0x1ad)],'handler':(_0x3afc47,_0x6343ca)=>{const _0x323494=_0x2d9039,{unitId:_0x1a5e70,subUnitId:_0x4304c9,shapeType:_0x28a8fc,shapeId:_0x1c467c,shapeData:_0x493e29}=_0x6343ca;return _0x3afc47[_0x323494(0x1a8)](exports[_0x323494(0x199)])[_0x323494(0x19e)](_0x1a5e70,_0x4304c9,_0x28a8fc,_0x1c467c,_0x493e29),!0x0;}},v={'id':'sheet.mutation.remove-shape','type':p[_0x2d9039(0x1a2)][_0x2d9039(0x1ad)],'handler':(_0x4cc9e6,_0x392977)=>{const _0x52ad0e=_0x2d9039,{unitId:_0x2c22df,subUnitId:_0x13b6c1,shapeId:_0x4d13a5}=_0x392977;return _0x4cc9e6[_0x52ad0e(0x1a8)](exports[_0x52ad0e(0x199)])['removeShape'](_0x2c22df,_0x13b6c1,_0x4d13a5),!0x0;}},y={'id':_0x2d9039(0x159),'type':p[_0x2d9039(0x1a2)]['MUTATION'],'handler':(_0x1f2644,_0xc7ee71)=>{const _0x142dc4=_0x2d9039,{unitId:_0x1375d5,subUnitId:_0x1f4b30,shapeType:_0x2fe614,shapeId:_0x3184d7,shapeData:_0x2a11fe}=_0xc7ee71,_0x202cc4=_0x1f2644[_0x142dc4(0x1a8)](exports['SheetsShapeServices'])['getShapeModel'](_0x1375d5,_0x1f4b30,_0x3184d7);return _0x202cc4&&(_0x2fe614!==void 0x0&&_0x202cc4['setShapeType'](_0x2fe614),_0x2a11fe&&(_0x202cc4==null||_0x202cc4[_0x142dc4(0x1a7)](_0x2a11fe,!0x0))),!0x0;}},A=_0x2d9039(0x191),_={};var L=Object[_0x2d9039(0x164)],F=Object[_0x2d9039(0x177)],B=(_0x5f2ca3,_0x49c3bf,_0x39cda5)=>_0x49c3bf in _0x5f2ca3?L(_0x5f2ca3,_0x49c3bf,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x39cda5}):_0x5f2ca3[_0x49c3bf]=_0x39cda5,G=(_0x3fdd12,_0x255aed,_0x17e2e1,_0xa3bb43)=>{for(var _0x5db6b5=_0xa3bb43>0x1?void 0x0:_0xa3bb43?F(_0x255aed,_0x17e2e1):_0x255aed,_0x1001e5=_0x3fdd12['length']-0x1,_0x36f04b;_0x1001e5>=0x0;_0x1001e5--)(_0x36f04b=_0x3fdd12[_0x1001e5])&&(_0x5db6b5=_0x36f04b(_0x5db6b5)||_0x5db6b5);return _0x5db6b5;},g=(_0x30aef8,_0x4dc125)=>(_0x336831,_0x1247d7)=>_0x4dc125(_0x336831,_0x1247d7,_0x30aef8),T=(_0x46a129,_0x112478,_0x14c910)=>B(_0x46a129,typeof _0x112478!='symbol'?_0x112478+'':_0x112478,_0x14c910);const x=_0x2d9039(0x16c);exports[_0x2d9039(0x18c)]=class extends p[_0x2d9039(0x1b9)]{constructor(_0x592161=_,_0x3ebdb7,_0x5a153d,_0x51865e){const _0x55e435=_0x2d9039;super(),this[_0x55e435(0x1b4)]=_0x592161,this[_0x55e435(0x18e)]=_0x3ebdb7,this[_0x55e435(0x1ba)]=_0x5a153d,this[_0x55e435(0x19a)]=_0x51865e;const {..._0x13a36b}=p[_0x55e435(0x1b0)]({},_,this[_0x55e435(0x1b4)]);this['_configService'][_0x55e435(0x193)](A,_0x13a36b),this[_0x55e435(0x1aa)]();}[_0x2d9039(0x1ac)](){const _0x10a7f0=_0x2d9039;p['touchDependencies'](this[_0x10a7f0(0x18e)],[]);}[_0x2d9039(0x19c)](){const _0x21f865=_0x2d9039,_0x4445aa=this[_0x21f865(0x18e)];[[f],[exports['SheetsShapeServices']]][_0x21f865(0x190)](_0xefd47f=>_0x4445aa[_0x21f865(0x16a)](_0xefd47f));}['_initCommands'](){const _0x56d11a=_0x2d9039;[m,v,d,y]['forEach'](_0x47144b=>this['disposeWithMe'](this[_0x56d11a(0x1ba)][_0x56d11a(0x197)](_0x47144b)));}},T(exports[_0x2d9039(0x18c)],_0x2d9039(0x17a),p[_0x2d9039(0x1a9)][_0x2d9039(0x174)]),T(exports['UniverSheetsShapePlugin'],_0x2d9039(0x163),x),exports['UniverSheetsShapePlugin']=G([p[_0x2d9039(0x171)](b[_0x2d9039(0x1bb)]),g(0x1,p[_0x2d9039(0x17c)](p[_0x2d9039(0x1af)])),g(0x2,p[_0x2d9039(0x1b6)]),g(0x3,p[_0x2d9039(0x178)])],exports[_0x2d9039(0x18c)]),exports['InsertSheetsShapeMutation']=m,exports[_0x2d9039(0x17d)]=v,exports['UpdateSheetsShapeDataMutation']=y,exports['UpdateSheetsShapeTypeCommand']=H,exports['UpdateSheetsShapeTypeMutation']=d;
|
package/lib/es/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x53c5(_0x142596,_0x3e65ba){_0x142596=_0x142596-0x16a;const _0x202ae0=_0x202a();let _0x53c5b8=_0x202ae0[_0x142596];return _0x53c5b8;}const _0x5484a7=_0x53c5;(function(_0x13dc11,_0x23de19){const _0xdd380d=_0x53c5,_0x2f29ee=_0x13dc11();while(!![]){try{const _0x313a74=parseInt(_0xdd380d(0x17f))/0x1*(parseInt(_0xdd380d(0x1b1))/0x2)+-parseInt(_0xdd380d(0x1af))/0x3*(-parseInt(_0xdd380d(0x16f))/0x4)+parseInt(_0xdd380d(0x189))/0x5*(-parseInt(_0xdd380d(0x1a1))/0x6)+-parseInt(_0xdd380d(0x188))/0x7*(parseInt(_0xdd380d(0x181))/0x8)+-parseInt(_0xdd380d(0x17c))/0x9*(-parseInt(_0xdd380d(0x1b3))/0xa)+-parseInt(_0xdd380d(0x1a2))/0xb+-parseInt(_0xdd380d(0x191))/0xc*(-parseInt(_0xdd380d(0x1a3))/0xd);if(_0x313a74===_0x23de19)break;else _0x2f29ee['push'](_0x2f29ee['shift']());}catch(_0x20830e){_0x2f29ee['push'](_0x2f29ee['shift']());}}}(_0x202a,0x6b540));var R=Object[_0x5484a7(0x178)],C=(_0x49a341,_0x4ec6ca,_0x34fa90)=>_0x4ec6ca in _0x49a341?R(_0x49a341,_0x4ec6ca,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x34fa90}):_0x49a341[_0x4ec6ca]=_0x34fa90,d=(_0x5ee393,_0x11a108,_0x38a5a6)=>C(_0x5ee393,typeof _0x11a108!=_0x5484a7(0x1a5)?_0x11a108+'':_0x11a108,_0x38a5a6);import{Disposable as _0x461310,UniverInstanceType as _0x1791e7,IResourceManagerService as _0xfb96d4,CommandType as _0x3e44b9,ICommandService as _0x5c5b2b,IUndoRedoService as _0x22d773,DependentOn as _0x502eab,Inject as _0x546027,Injector as _0x58fdc6,Plugin as _0xa33e95,merge as _0xfa4b98,touchDependencies as _0x1fc7ee,IConfigService as _0x499a85}from'@univerjs/core';import{ShapeModel as _0x21ca7f,isConnectorShape as _0x20df5d}from'@univerjs-pro/engine-shape';import{UniverLicensePlugin as _0x3b4c6e}from'@univerjs-pro/license';function _0x202a(){const _0x40eb86=['disposeWithMe','28HgzUtQ','pluginName','onRendered','UNIVER_SHEET','_initSnapshot','sheet.mutation.remove-shape','setShapeType','setShapeData','getBasicShapeRelation','defineProperty','_ensureShapeModelManager','getShapeType','pushUndoRedo','963koCWEo','stringify','isLineShape','1MXqAEl','hasShape','464248MHJDwo','sheet.command.update-shape-type','every','_configService','_initCommands','getBasicShapeType','_deserializeShapeForUnit','21ZkyBgd','153955CAgwnv','_linesIds','shapeId','params','from','length','_config','get','25248qmETbG','_resourcesManagerService','delete','_commandService','registerCommand','clear','sheets-shape.config','onStarting','fromJSON','dispose','getShapeData','push','getShapeModel','COMMAND','_shapeModelManagerMap','toJSON','144dBHzZg','2174084elDzaz','52RSrDkA','set','symbol','addShape','syncExecuteCommand','keys','_serializeShapeForUnit','_injector','forEach','getShapeRelation','insertShape','getOwnPropertyDescriptor','350868boQLsl','add','1063612AUQgja','_groupIds','17890QqDEMr','setConfig','removeShape','getShapeTypeById','_shapes','getLineShapeRelation','SHEET_SHAPE_PLUGIN','registerPluginResource','parse','has','type'];_0x202a=function(){return _0x40eb86;};return _0x202a();}class T extends _0x461310{constructor(){const _0xaf3abd=_0x5484a7;super(),d(this,_0xaf3abd(0x1b7),new Map()),d(this,_0xaf3abd(0x18a),new Set()),d(this,'_groupIds',new Set());}[_0x5484a7(0x1a6)](_0x140b42,_0x5bbe0b,_0x27e03b){const _0x49c52b=_0x5484a7,_0x484bea=new _0x21ca7f(_0x140b42,_0x5bbe0b,_0x27e03b);return this[_0x49c52b(0x1b7)][_0x49c52b(0x1a4)](_0x5bbe0b,_0x484bea),_0x20df5d(_0x140b42)&&this['_linesIds']['add'](_0x5bbe0b),_0x484bea;}[_0x5484a7(0x177)](_0x40a3fd){const _0xaa56a1=_0x5484a7;var _0x505ddc,_0x48ecc7;const _0x8039f0=[];for(const _0x2d2724 of this[_0xaa56a1(0x18a)]){const _0x52eee5=this['_shapes']['get'](_0x2d2724);if(_0x52eee5){const _0x42dfbd=_0x52eee5[_0xaa56a1(0x1ac)]();_0x42dfbd&&(((_0x505ddc=_0x42dfbd['from'])==null?void 0x0:_0x505ddc[_0xaa56a1(0x18b)])===_0x40a3fd&&_0x8039f0[_0xaa56a1(0x19c)]({..._0x42dfbd[_0xaa56a1(0x18d)],'lineShapeId':_0x2d2724,'isFrom':!0x0}),((_0x48ecc7=_0x42dfbd['to'])==null?void 0x0:_0x48ecc7[_0xaa56a1(0x18b)])===_0x40a3fd&&_0x8039f0[_0xaa56a1(0x19c)]({..._0x42dfbd['to'],'lineShapeId':_0x2d2724,'isFrom':!0x1}));}}return _0x8039f0;}[_0x5484a7(0x1b8)](_0x7581bd){const _0x320a72=_0x5484a7,_0x525bc4=this[_0x320a72(0x1b7)]['get'](_0x7581bd);if(_0x525bc4)return _0x525bc4[_0x320a72(0x1ac)]();}[_0x5484a7(0x17a)](_0x1221d1){const _0x19f6d3=_0x5484a7,_0x19e6c0=this[_0x19f6d3(0x1b7)]['get'](_0x1221d1);if(_0x19e6c0)return _0x19e6c0[_0x19f6d3(0x17a)]();}['hasShape'](_0x2071de){const _0x448ec7=_0x5484a7;return this['_shapes'][_0x448ec7(0x16c)](_0x2071de);}['removeShape'](_0x37902c){const _0x298ef9=_0x5484a7,_0x4165de=this['_shapes'][_0x298ef9(0x190)](_0x37902c);_0x4165de&&(_0x20df5d(_0x4165de[_0x298ef9(0x17a)]())&&this['_linesIds'][_0x298ef9(0x193)](_0x37902c),this[_0x298ef9(0x1b7)][_0x298ef9(0x193)](_0x37902c));}[_0x5484a7(0x1a0)](){const _0x3aaa16=_0x5484a7,_0x3d62c0=[];return this[_0x3aaa16(0x1b7)][_0x3aaa16(0x1ab)](_0x1ea13c=>{const _0x5669bb=_0x3aaa16;_0x3d62c0[_0x5669bb(0x19c)](_0x1ea13c['toJSON']());}),_0x3d62c0;}[_0x5484a7(0x199)](_0x575f1c){const _0x2b791a=_0x5484a7;for(const _0x1ccbd4 of _0x575f1c){const {id:_0x337e45,shapeType:_0x5cf444}=_0x1ccbd4,_0x1c9f37=this[_0x2b791a(0x1a6)](_0x5cf444,_0x337e45,_0x1ccbd4['shapeData']);_0x1c9f37&&_0x1c9f37[_0x2b791a(0x17e)]()&&this[_0x2b791a(0x18a)]['add'](_0x337e45);}}[_0x5484a7(0x19a)](){const _0x394d45=_0x5484a7;this['_disposed']||(this[_0x394d45(0x1b7)][_0x394d45(0x1ab)](_0x48640d=>{const _0x126a9a=_0x394d45;_0x48640d[_0x126a9a(0x19a)]();}),this['_shapes'][_0x394d45(0x196)](),this[_0x394d45(0x18a)][_0x394d45(0x196)](),this[_0x394d45(0x1b2)]['clear'](),super['dispose']());}}var $=Object[_0x5484a7(0x1ae)],V=(_0x169079,_0xd1d8bc,_0x1cd2cb,_0x13d387)=>{for(var _0x3ce50b=_0x13d387>0x1?void 0x0:_0x13d387?$(_0xd1d8bc,_0x1cd2cb):_0xd1d8bc,_0x4375cd=_0x169079['length']-0x1,_0x459f5b;_0x4375cd>=0x0;_0x4375cd--)(_0x459f5b=_0x169079[_0x4375cd])&&(_0x3ce50b=_0x459f5b(_0x3ce50b)||_0x3ce50b);return _0x3ce50b;},K=(_0x5b87a3,_0x1401d7)=>(_0xdea9ed,_0x44f4c1)=>_0x1401d7(_0xdea9ed,_0x44f4c1,_0x5b87a3);const W=_0x5484a7(0x1b9);let i=class extends _0x461310{constructor(_0x4a648d){const _0x385fbc=_0x5484a7;super(),d(this,_0x385fbc(0x19f),new Map()),(this[_0x385fbc(0x192)]=_0x4a648d,this[_0x385fbc(0x173)]());}[_0x5484a7(0x179)](_0x4b6a80,_0x4b9af7){const _0x100423=_0x5484a7;let _0x5a40ab=this['_shapeModelManagerMap']['get'](_0x4b6a80);_0x5a40ab||(_0x5a40ab=new Map(),this[_0x100423(0x19f)]['set'](_0x4b6a80,_0x5a40ab));let _0x12dc88=_0x5a40ab[_0x100423(0x190)](_0x4b9af7);return _0x12dc88||(_0x12dc88=new T(),_0x5a40ab['set'](_0x4b9af7,_0x12dc88)),_0x12dc88;}['insertShape'](_0x21ce5c,_0x49fe53,_0x1b4106,_0x171cbc,_0x2cd4c0){const _0x38cb77=_0x5484a7;this[_0x38cb77(0x179)](_0x21ce5c,_0x49fe53)['addShape'](_0x1b4106,_0x171cbc,_0x2cd4c0);}[_0x5484a7(0x1b5)](_0xbb8dfc,_0x3b7fc9,_0x480964){const _0x1d2f7f=_0x5484a7;this['_ensureShapeModelManager'](_0xbb8dfc,_0x3b7fc9)[_0x1d2f7f(0x1b5)](_0x480964);}[_0x5484a7(0x186)](_0x52d495,_0x460604,_0x4b7e5d){const _0x3add13=_0x5484a7;return this[_0x3add13(0x179)](_0x52d495,_0x460604)[_0x3add13(0x17a)](_0x4b7e5d);}[_0x5484a7(0x17a)](_0xcfdf0f,_0x323688,_0x3cf854){const _0x2461bd=_0x5484a7;return this['_ensureShapeModelManager'](_0xcfdf0f,_0x323688)[_0x2461bd(0x17a)](_0x3cf854);}[_0x5484a7(0x180)](_0x4c8ecd,_0x42c8a1,_0x342e6b){return this['_ensureShapeModelManager'](_0x4c8ecd,_0x42c8a1)['hasShape'](_0x342e6b);}[_0x5484a7(0x1b6)](_0x21ac25,_0x27a265,_0x3f3881){const _0x217483=_0x5484a7;return this[_0x217483(0x179)](_0x21ac25,_0x27a265)[_0x217483(0x17a)](_0x3f3881);}['getShapeDataById'](_0xadd018,_0x2a7703,_0x4dc936){const _0x415271=_0x5484a7,_0x3ef2c=this[_0x415271(0x179)](_0xadd018,_0x2a7703);if(!_0x3ef2c[_0x415271(0x17a)](_0x4dc936))return;const _0x6715d0=_0x3ef2c[_0x415271(0x1b7)][_0x415271(0x190)](_0x4dc936);if(_0x6715d0)return _0x6715d0[_0x415271(0x19b)]();}[_0x5484a7(0x19d)](_0xf2719,_0xb4631d,_0x553b32){const _0xa57aaa=_0x5484a7;return this[_0xa57aaa(0x179)](_0xf2719,_0xb4631d)['_shapes']['get'](_0x553b32);}[_0x5484a7(0x177)](_0x5d547d,_0x564ead,_0x1af1b7){const _0xa86de1=_0x5484a7;return this[_0xa86de1(0x179)](_0x5d547d,_0x564ead)['getBasicShapeRelation'](_0x1af1b7);}[_0x5484a7(0x1b8)](_0x4ffeea,_0xc99d3b,_0x5861ef){const _0x101b06=_0x5484a7,_0x2f172d=this[_0x101b06(0x179)](_0x4ffeea,_0xc99d3b)[_0x101b06(0x1b7)]['get'](_0x5861ef);if(_0x2f172d)return _0x2f172d[_0x101b06(0x1ac)]();}['setShapeType'](){}[_0x5484a7(0x1a9)](_0x11d836){const _0x3d9fd8=_0x5484a7,_0x51b0de={},_0x54c2f3=this['_shapeModelManagerMap'][_0x3d9fd8(0x190)](_0x11d836);return _0x54c2f3&&_0x54c2f3[_0x3d9fd8(0x1ab)]((_0x31f174,_0x5f1faf)=>{_0x51b0de[_0x5f1faf]=_0x31f174['toJSON']();}),JSON[_0x3d9fd8(0x17d)](_0x51b0de);}['_deserializeShapeForUnit'](_0x3ba1e0,_0x3a32d9){const _0x20c7d6=_0x5484a7;Object[_0x20c7d6(0x1a8)](_0x3a32d9)[_0x20c7d6(0x1ab)](_0xc68d26=>{const _0x1e9202=_0x20c7d6;this[_0x1e9202(0x179)](_0x3ba1e0,_0xc68d26)[_0x1e9202(0x199)](_0x3a32d9[_0xc68d26]);});}[_0x5484a7(0x1a0)](){const _0x3f950c=_0x5484a7,_0xdb1cf={};return this[_0x3f950c(0x19f)][_0x3f950c(0x1ab)]((_0x394323,_0x4e55a9)=>{const _0x2d7c7b=_0x3f950c;_0xdb1cf[_0x4e55a9]={},_0x394323[_0x2d7c7b(0x1ab)]((_0x363a79,_0x4d3fcb)=>{const _0x53ce35=_0x2d7c7b;_0xdb1cf[_0x4e55a9][_0x4d3fcb]=_0x363a79[_0x53ce35(0x1a0)]();});}),_0xdb1cf;}[_0x5484a7(0x199)](_0x1d275e){const _0x4ef4c9=_0x5484a7;Object[_0x4ef4c9(0x1a8)](_0x1d275e)[_0x4ef4c9(0x1ab)](_0x548fc4=>{const _0x5a60a6=_0x4ef4c9,_0x212df4=_0x1d275e[_0x548fc4];Object[_0x5a60a6(0x1a8)](_0x212df4)[_0x5a60a6(0x1ab)](_0x475c27=>{const _0x40225e=_0x5a60a6;this[_0x40225e(0x179)](_0x548fc4,_0x475c27)[_0x40225e(0x199)](_0x212df4[_0x475c27]);});});}[_0x5484a7(0x173)](){const _0x236c48=_0x5484a7;this[_0x236c48(0x192)][_0x236c48(0x16a)]({'pluginName':W,'businesses':[_0x1791e7[_0x236c48(0x172)]],'toJson':_0x156aa8=>this['_serializeShapeForUnit'](_0x156aa8),'parseJson':_0xe3bdf1=>JSON[_0x236c48(0x16b)](_0xe3bdf1),'onLoad':(_0x51a9e6,_0x219321)=>{const _0x2a8d69=_0x236c48;this[_0x2a8d69(0x187)](_0x51a9e6,_0x219321);},'onUnLoad':_0x56d7f7=>{const _0x252f5c=_0x236c48,_0x277ac6=this['_shapeModelManagerMap'][_0x252f5c(0x190)](_0x56d7f7);_0x277ac6&&(_0x277ac6[_0x252f5c(0x1ab)](_0x5b2c87=>{_0x5b2c87['dispose']();}),this['_shapeModelManagerMap'][_0x252f5c(0x193)](_0x56d7f7));}});}[_0x5484a7(0x19a)](){const _0x300fdb=_0x5484a7;this[_0x300fdb(0x19f)][_0x300fdb(0x1ab)](_0x18ac97=>{const _0x411960=_0x300fdb;_0x18ac97[_0x411960(0x1ab)](_0x17ba38=>{const _0x42318b=_0x411960;_0x17ba38[_0x42318b(0x19a)]();});});}};i=V([K(0x0,_0xfb96d4)],i);const u={'id':'sheet.mutation.update-shape-type','type':_0x3e44b9['MUTATION'],'handler':(_0x2ef8ee,_0x1627fc)=>{const _0x392e91=_0x5484a7,{unitId:_0x28fd7b,subUnitId:_0x2a40e7,shapeType:_0x18fc9d,shapeId:_0x565bb5,shapeData:_0x2bfc3a}=_0x1627fc,_0x353560=_0x2ef8ee[_0x392e91(0x190)](i)[_0x392e91(0x19d)](_0x28fd7b,_0x2a40e7,_0x565bb5);return _0x353560&&(_0x353560[_0x392e91(0x175)](_0x18fc9d),_0x2bfc3a&&(_0x353560==null||_0x353560[_0x392e91(0x176)](_0x2bfc3a))),!0x0;}},pe={'id':_0x5484a7(0x182),'type':_0x3e44b9[_0x5484a7(0x19e)],'handler':(_0x10eb92,_0x10b5b5)=>{const _0x166da3=_0x5484a7;if(!_0x10b5b5)return!0x1;const _0x43c5cd=_0x10eb92[_0x166da3(0x190)](_0x5c5b2b),_0x2aaf2f=_0x10eb92[_0x166da3(0x190)](i),_0x27b118=_0x10eb92[_0x166da3(0x190)](_0x22d773),_0x2e151f=[],_0x3bd88c=[],{unitId:_0x186ab1,subUnitId:_0x29dcd3,shapeId:_0x1b57ce,shapeType:_0x5bfbd7,shapeData:_0x5b3f9a}=_0x10b5b5,_0x451da3=_0x2aaf2f[_0x166da3(0x19d)](_0x186ab1,_0x29dcd3,_0x1b57ce);if(_0x451da3){const _0x41f2ab=_0x451da3['getShapeType'](),_0x15ceb5=Object['assign']({},_0x451da3[_0x166da3(0x19b)]()),_0x207375={'unitId':_0x186ab1,'subUnitId':_0x29dcd3,'shapeId':_0x1b57ce,'shapeType':_0x5bfbd7,'shapeData':_0x5b3f9a},_0x5ec5ef={'unitId':_0x186ab1,'subUnitId':_0x29dcd3,'shapeId':_0x1b57ce,'shapeType':_0x41f2ab,'shapeData':_0x15ceb5};return _0x2e151f[_0x166da3(0x19c)]({'id':u['id'],'params':_0x207375}),_0x3bd88c['push']({'id':u['id'],'params':_0x5ec5ef}),_0x2e151f[_0x166da3(0x183)](_0x24cced=>_0x43c5cd[_0x166da3(0x1a7)](_0x24cced['id'],_0x24cced[_0x166da3(0x18c)]))&&_0x27b118[_0x166da3(0x17b)]({'unitID':_0x186ab1,'redoMutations':[..._0x2e151f],'undoMutations':[..._0x3bd88c]}),!0x0;}return!0x1;}},Y={'id':'sheet.mutation.insert-shape','type':_0x3e44b9['MUTATION'],'handler':(_0x472274,_0x4c3942)=>{const _0x39d78c=_0x5484a7,{unitId:_0x13c95d,subUnitId:_0x3834b7,shapeType:_0x3a4235,shapeId:_0x2ca697,shapeData:_0x52c544}=_0x4c3942;return _0x472274[_0x39d78c(0x190)](i)[_0x39d78c(0x1ad)](_0x13c95d,_0x3834b7,_0x3a4235,_0x2ca697,_0x52c544),!0x0;}},q={'id':_0x5484a7(0x174),'type':_0x3e44b9['MUTATION'],'handler':(_0x9e368d,_0xb67243)=>{const _0x178b0e=_0x5484a7,{unitId:_0x1e5373,subUnitId:_0x2264e2,shapeId:_0x22c6bd}=_0xb67243;return _0x9e368d[_0x178b0e(0x190)](i)[_0x178b0e(0x1b5)](_0x1e5373,_0x2264e2,_0x22c6bd),!0x0;}},Q={'id':'sheet.mutation.update-shape-data','type':_0x3e44b9['MUTATION'],'handler':(_0x21b6b3,_0x1603f5)=>{const _0x188291=_0x5484a7,{unitId:_0x20a699,subUnitId:_0x10c123,shapeType:_0x1dd402,shapeId:_0x21056c,shapeData:_0x2077d5}=_0x1603f5,_0x580e2a=_0x21b6b3[_0x188291(0x190)](i)[_0x188291(0x19d)](_0x20a699,_0x10c123,_0x21056c);return _0x580e2a&&(_0x1dd402!==void 0x0&&_0x580e2a[_0x188291(0x175)](_0x1dd402),_0x2077d5&&(_0x580e2a==null||_0x580e2a[_0x188291(0x176)](_0x2077d5,!0x0))),!0x0;}},X=_0x5484a7(0x197),m={};var Z=Object[_0x5484a7(0x178)],k=Object[_0x5484a7(0x1ae)],ee=(_0x5bae1e,_0x1836ff,_0x22034d)=>_0x1836ff in _0x5bae1e?Z(_0x5bae1e,_0x1836ff,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x22034d}):_0x5bae1e[_0x1836ff]=_0x22034d,ae=(_0x245025,_0x471ea7,_0x3b436d,_0xa4736d)=>{const _0x2d8427=_0x5484a7;for(var _0x4e712f=_0xa4736d>0x1?void 0x0:_0xa4736d?k(_0x471ea7,_0x3b436d):_0x471ea7,_0x47829a=_0x245025[_0x2d8427(0x18e)]-0x1,_0x4f0d42;_0x47829a>=0x0;_0x47829a--)(_0x4f0d42=_0x245025[_0x47829a])&&(_0x4e712f=_0x4f0d42(_0x4e712f)||_0x4e712f);return _0x4e712f;},g=(_0x3e6958,_0x3fee72)=>(_0x3d5f5b,_0x23131d)=>_0x3fee72(_0x3d5f5b,_0x23131d,_0x3e6958),E=(_0x32c9d1,_0x3bbbb8,_0x1eda98)=>ee(_0x32c9d1,typeof _0x3bbbb8!=_0x5484a7(0x1a5)?_0x3bbbb8+'':_0x3bbbb8,_0x1eda98);const se='SHEET_SHAPE_PLUGIN';let S=class extends _0xa33e95{constructor(_0xfcf7dc=m,_0x5e99dd,_0x37305d,_0x58324b){const _0x324889=_0x5484a7;super(),this['_config']=_0xfcf7dc,this[_0x324889(0x1aa)]=_0x5e99dd,this['_commandService']=_0x37305d,this[_0x324889(0x184)]=_0x58324b;const {..._0x497b9c}=_0xfa4b98({},m,this[_0x324889(0x18f)]);this[_0x324889(0x184)][_0x324889(0x1b4)](X,_0x497b9c),this[_0x324889(0x185)]();}[_0x5484a7(0x171)](){const _0x444c72=_0x5484a7;_0x1fc7ee(this[_0x444c72(0x1aa)],[]);}[_0x5484a7(0x198)](){const _0x255190=_0x5484a7,_0x48559f=this[_0x255190(0x1aa)];[[T],[i]][_0x255190(0x1ab)](_0x44d62d=>_0x48559f[_0x255190(0x1b0)](_0x44d62d));}[_0x5484a7(0x185)](){const _0x34c94a=_0x5484a7;[Y,q,u,Q][_0x34c94a(0x1ab)](_0x4e99a3=>this[_0x34c94a(0x16e)](this[_0x34c94a(0x194)][_0x34c94a(0x195)](_0x4e99a3)));}};E(S,_0x5484a7(0x16d),_0x1791e7['UNIVER_SHEET']),E(S,_0x5484a7(0x170),se),S=ae([_0x502eab(_0x3b4c6e),g(0x1,_0x546027(_0x58fdc6)),g(0x2,_0x5c5b2b),g(0x3,_0x499a85)],S);export{Y as InsertSheetsShapeMutation,q as RemoveSheetsShapeMutation,i as SheetsShapeServices,S as UniverSheetsShapePlugin,Q as UpdateSheetsShapeDataMutation,pe as UpdateSheetsShapeTypeCommand,u as UpdateSheetsShapeTypeMutation};
|
package/lib/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x53c5(_0x142596,_0x3e65ba){_0x142596=_0x142596-0x16a;const _0x202ae0=_0x202a();let _0x53c5b8=_0x202ae0[_0x142596];return _0x53c5b8;}const _0x5484a7=_0x53c5;(function(_0x13dc11,_0x23de19){const _0xdd380d=_0x53c5,_0x2f29ee=_0x13dc11();while(!![]){try{const _0x313a74=parseInt(_0xdd380d(0x17f))/0x1*(parseInt(_0xdd380d(0x1b1))/0x2)+-parseInt(_0xdd380d(0x1af))/0x3*(-parseInt(_0xdd380d(0x16f))/0x4)+parseInt(_0xdd380d(0x189))/0x5*(-parseInt(_0xdd380d(0x1a1))/0x6)+-parseInt(_0xdd380d(0x188))/0x7*(parseInt(_0xdd380d(0x181))/0x8)+-parseInt(_0xdd380d(0x17c))/0x9*(-parseInt(_0xdd380d(0x1b3))/0xa)+-parseInt(_0xdd380d(0x1a2))/0xb+-parseInt(_0xdd380d(0x191))/0xc*(-parseInt(_0xdd380d(0x1a3))/0xd);if(_0x313a74===_0x23de19)break;else _0x2f29ee['push'](_0x2f29ee['shift']());}catch(_0x20830e){_0x2f29ee['push'](_0x2f29ee['shift']());}}}(_0x202a,0x6b540));var R=Object[_0x5484a7(0x178)],C=(_0x49a341,_0x4ec6ca,_0x34fa90)=>_0x4ec6ca in _0x49a341?R(_0x49a341,_0x4ec6ca,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x34fa90}):_0x49a341[_0x4ec6ca]=_0x34fa90,d=(_0x5ee393,_0x11a108,_0x38a5a6)=>C(_0x5ee393,typeof _0x11a108!=_0x5484a7(0x1a5)?_0x11a108+'':_0x11a108,_0x38a5a6);import{Disposable as _0x461310,UniverInstanceType as _0x1791e7,IResourceManagerService as _0xfb96d4,CommandType as _0x3e44b9,ICommandService as _0x5c5b2b,IUndoRedoService as _0x22d773,DependentOn as _0x502eab,Inject as _0x546027,Injector as _0x58fdc6,Plugin as _0xa33e95,merge as _0xfa4b98,touchDependencies as _0x1fc7ee,IConfigService as _0x499a85}from'@univerjs/core';import{ShapeModel as _0x21ca7f,isConnectorShape as _0x20df5d}from'@univerjs-pro/engine-shape';import{UniverLicensePlugin as _0x3b4c6e}from'@univerjs-pro/license';function _0x202a(){const _0x40eb86=['disposeWithMe','28HgzUtQ','pluginName','onRendered','UNIVER_SHEET','_initSnapshot','sheet.mutation.remove-shape','setShapeType','setShapeData','getBasicShapeRelation','defineProperty','_ensureShapeModelManager','getShapeType','pushUndoRedo','963koCWEo','stringify','isLineShape','1MXqAEl','hasShape','464248MHJDwo','sheet.command.update-shape-type','every','_configService','_initCommands','getBasicShapeType','_deserializeShapeForUnit','21ZkyBgd','153955CAgwnv','_linesIds','shapeId','params','from','length','_config','get','25248qmETbG','_resourcesManagerService','delete','_commandService','registerCommand','clear','sheets-shape.config','onStarting','fromJSON','dispose','getShapeData','push','getShapeModel','COMMAND','_shapeModelManagerMap','toJSON','144dBHzZg','2174084elDzaz','52RSrDkA','set','symbol','addShape','syncExecuteCommand','keys','_serializeShapeForUnit','_injector','forEach','getShapeRelation','insertShape','getOwnPropertyDescriptor','350868boQLsl','add','1063612AUQgja','_groupIds','17890QqDEMr','setConfig','removeShape','getShapeTypeById','_shapes','getLineShapeRelation','SHEET_SHAPE_PLUGIN','registerPluginResource','parse','has','type'];_0x202a=function(){return _0x40eb86;};return _0x202a();}class T extends _0x461310{constructor(){const _0xaf3abd=_0x5484a7;super(),d(this,_0xaf3abd(0x1b7),new Map()),d(this,_0xaf3abd(0x18a),new Set()),d(this,'_groupIds',new Set());}[_0x5484a7(0x1a6)](_0x140b42,_0x5bbe0b,_0x27e03b){const _0x49c52b=_0x5484a7,_0x484bea=new _0x21ca7f(_0x140b42,_0x5bbe0b,_0x27e03b);return this[_0x49c52b(0x1b7)][_0x49c52b(0x1a4)](_0x5bbe0b,_0x484bea),_0x20df5d(_0x140b42)&&this['_linesIds']['add'](_0x5bbe0b),_0x484bea;}[_0x5484a7(0x177)](_0x40a3fd){const _0xaa56a1=_0x5484a7;var _0x505ddc,_0x48ecc7;const _0x8039f0=[];for(const _0x2d2724 of this[_0xaa56a1(0x18a)]){const _0x52eee5=this['_shapes']['get'](_0x2d2724);if(_0x52eee5){const _0x42dfbd=_0x52eee5[_0xaa56a1(0x1ac)]();_0x42dfbd&&(((_0x505ddc=_0x42dfbd['from'])==null?void 0x0:_0x505ddc[_0xaa56a1(0x18b)])===_0x40a3fd&&_0x8039f0[_0xaa56a1(0x19c)]({..._0x42dfbd[_0xaa56a1(0x18d)],'lineShapeId':_0x2d2724,'isFrom':!0x0}),((_0x48ecc7=_0x42dfbd['to'])==null?void 0x0:_0x48ecc7[_0xaa56a1(0x18b)])===_0x40a3fd&&_0x8039f0[_0xaa56a1(0x19c)]({..._0x42dfbd['to'],'lineShapeId':_0x2d2724,'isFrom':!0x1}));}}return _0x8039f0;}[_0x5484a7(0x1b8)](_0x7581bd){const _0x320a72=_0x5484a7,_0x525bc4=this[_0x320a72(0x1b7)]['get'](_0x7581bd);if(_0x525bc4)return _0x525bc4[_0x320a72(0x1ac)]();}[_0x5484a7(0x17a)](_0x1221d1){const _0x19f6d3=_0x5484a7,_0x19e6c0=this[_0x19f6d3(0x1b7)]['get'](_0x1221d1);if(_0x19e6c0)return _0x19e6c0[_0x19f6d3(0x17a)]();}['hasShape'](_0x2071de){const _0x448ec7=_0x5484a7;return this['_shapes'][_0x448ec7(0x16c)](_0x2071de);}['removeShape'](_0x37902c){const _0x298ef9=_0x5484a7,_0x4165de=this['_shapes'][_0x298ef9(0x190)](_0x37902c);_0x4165de&&(_0x20df5d(_0x4165de[_0x298ef9(0x17a)]())&&this['_linesIds'][_0x298ef9(0x193)](_0x37902c),this[_0x298ef9(0x1b7)][_0x298ef9(0x193)](_0x37902c));}[_0x5484a7(0x1a0)](){const _0x3aaa16=_0x5484a7,_0x3d62c0=[];return this[_0x3aaa16(0x1b7)][_0x3aaa16(0x1ab)](_0x1ea13c=>{const _0x5669bb=_0x3aaa16;_0x3d62c0[_0x5669bb(0x19c)](_0x1ea13c['toJSON']());}),_0x3d62c0;}[_0x5484a7(0x199)](_0x575f1c){const _0x2b791a=_0x5484a7;for(const _0x1ccbd4 of _0x575f1c){const {id:_0x337e45,shapeType:_0x5cf444}=_0x1ccbd4,_0x1c9f37=this[_0x2b791a(0x1a6)](_0x5cf444,_0x337e45,_0x1ccbd4['shapeData']);_0x1c9f37&&_0x1c9f37[_0x2b791a(0x17e)]()&&this[_0x2b791a(0x18a)]['add'](_0x337e45);}}[_0x5484a7(0x19a)](){const _0x394d45=_0x5484a7;this['_disposed']||(this[_0x394d45(0x1b7)][_0x394d45(0x1ab)](_0x48640d=>{const _0x126a9a=_0x394d45;_0x48640d[_0x126a9a(0x19a)]();}),this['_shapes'][_0x394d45(0x196)](),this[_0x394d45(0x18a)][_0x394d45(0x196)](),this[_0x394d45(0x1b2)]['clear'](),super['dispose']());}}var $=Object[_0x5484a7(0x1ae)],V=(_0x169079,_0xd1d8bc,_0x1cd2cb,_0x13d387)=>{for(var _0x3ce50b=_0x13d387>0x1?void 0x0:_0x13d387?$(_0xd1d8bc,_0x1cd2cb):_0xd1d8bc,_0x4375cd=_0x169079['length']-0x1,_0x459f5b;_0x4375cd>=0x0;_0x4375cd--)(_0x459f5b=_0x169079[_0x4375cd])&&(_0x3ce50b=_0x459f5b(_0x3ce50b)||_0x3ce50b);return _0x3ce50b;},K=(_0x5b87a3,_0x1401d7)=>(_0xdea9ed,_0x44f4c1)=>_0x1401d7(_0xdea9ed,_0x44f4c1,_0x5b87a3);const W=_0x5484a7(0x1b9);let i=class extends _0x461310{constructor(_0x4a648d){const _0x385fbc=_0x5484a7;super(),d(this,_0x385fbc(0x19f),new Map()),(this[_0x385fbc(0x192)]=_0x4a648d,this[_0x385fbc(0x173)]());}[_0x5484a7(0x179)](_0x4b6a80,_0x4b9af7){const _0x100423=_0x5484a7;let _0x5a40ab=this['_shapeModelManagerMap']['get'](_0x4b6a80);_0x5a40ab||(_0x5a40ab=new Map(),this[_0x100423(0x19f)]['set'](_0x4b6a80,_0x5a40ab));let _0x12dc88=_0x5a40ab[_0x100423(0x190)](_0x4b9af7);return _0x12dc88||(_0x12dc88=new T(),_0x5a40ab['set'](_0x4b9af7,_0x12dc88)),_0x12dc88;}['insertShape'](_0x21ce5c,_0x49fe53,_0x1b4106,_0x171cbc,_0x2cd4c0){const _0x38cb77=_0x5484a7;this[_0x38cb77(0x179)](_0x21ce5c,_0x49fe53)['addShape'](_0x1b4106,_0x171cbc,_0x2cd4c0);}[_0x5484a7(0x1b5)](_0xbb8dfc,_0x3b7fc9,_0x480964){const _0x1d2f7f=_0x5484a7;this['_ensureShapeModelManager'](_0xbb8dfc,_0x3b7fc9)[_0x1d2f7f(0x1b5)](_0x480964);}[_0x5484a7(0x186)](_0x52d495,_0x460604,_0x4b7e5d){const _0x3add13=_0x5484a7;return this[_0x3add13(0x179)](_0x52d495,_0x460604)[_0x3add13(0x17a)](_0x4b7e5d);}[_0x5484a7(0x17a)](_0xcfdf0f,_0x323688,_0x3cf854){const _0x2461bd=_0x5484a7;return this['_ensureShapeModelManager'](_0xcfdf0f,_0x323688)[_0x2461bd(0x17a)](_0x3cf854);}[_0x5484a7(0x180)](_0x4c8ecd,_0x42c8a1,_0x342e6b){return this['_ensureShapeModelManager'](_0x4c8ecd,_0x42c8a1)['hasShape'](_0x342e6b);}[_0x5484a7(0x1b6)](_0x21ac25,_0x27a265,_0x3f3881){const _0x217483=_0x5484a7;return this[_0x217483(0x179)](_0x21ac25,_0x27a265)[_0x217483(0x17a)](_0x3f3881);}['getShapeDataById'](_0xadd018,_0x2a7703,_0x4dc936){const _0x415271=_0x5484a7,_0x3ef2c=this[_0x415271(0x179)](_0xadd018,_0x2a7703);if(!_0x3ef2c[_0x415271(0x17a)](_0x4dc936))return;const _0x6715d0=_0x3ef2c[_0x415271(0x1b7)][_0x415271(0x190)](_0x4dc936);if(_0x6715d0)return _0x6715d0[_0x415271(0x19b)]();}[_0x5484a7(0x19d)](_0xf2719,_0xb4631d,_0x553b32){const _0xa57aaa=_0x5484a7;return this[_0xa57aaa(0x179)](_0xf2719,_0xb4631d)['_shapes']['get'](_0x553b32);}[_0x5484a7(0x177)](_0x5d547d,_0x564ead,_0x1af1b7){const _0xa86de1=_0x5484a7;return this[_0xa86de1(0x179)](_0x5d547d,_0x564ead)['getBasicShapeRelation'](_0x1af1b7);}[_0x5484a7(0x1b8)](_0x4ffeea,_0xc99d3b,_0x5861ef){const _0x101b06=_0x5484a7,_0x2f172d=this[_0x101b06(0x179)](_0x4ffeea,_0xc99d3b)[_0x101b06(0x1b7)]['get'](_0x5861ef);if(_0x2f172d)return _0x2f172d[_0x101b06(0x1ac)]();}['setShapeType'](){}[_0x5484a7(0x1a9)](_0x11d836){const _0x3d9fd8=_0x5484a7,_0x51b0de={},_0x54c2f3=this['_shapeModelManagerMap'][_0x3d9fd8(0x190)](_0x11d836);return _0x54c2f3&&_0x54c2f3[_0x3d9fd8(0x1ab)]((_0x31f174,_0x5f1faf)=>{_0x51b0de[_0x5f1faf]=_0x31f174['toJSON']();}),JSON[_0x3d9fd8(0x17d)](_0x51b0de);}['_deserializeShapeForUnit'](_0x3ba1e0,_0x3a32d9){const _0x20c7d6=_0x5484a7;Object[_0x20c7d6(0x1a8)](_0x3a32d9)[_0x20c7d6(0x1ab)](_0xc68d26=>{const _0x1e9202=_0x20c7d6;this[_0x1e9202(0x179)](_0x3ba1e0,_0xc68d26)[_0x1e9202(0x199)](_0x3a32d9[_0xc68d26]);});}[_0x5484a7(0x1a0)](){const _0x3f950c=_0x5484a7,_0xdb1cf={};return this[_0x3f950c(0x19f)][_0x3f950c(0x1ab)]((_0x394323,_0x4e55a9)=>{const _0x2d7c7b=_0x3f950c;_0xdb1cf[_0x4e55a9]={},_0x394323[_0x2d7c7b(0x1ab)]((_0x363a79,_0x4d3fcb)=>{const _0x53ce35=_0x2d7c7b;_0xdb1cf[_0x4e55a9][_0x4d3fcb]=_0x363a79[_0x53ce35(0x1a0)]();});}),_0xdb1cf;}[_0x5484a7(0x199)](_0x1d275e){const _0x4ef4c9=_0x5484a7;Object[_0x4ef4c9(0x1a8)](_0x1d275e)[_0x4ef4c9(0x1ab)](_0x548fc4=>{const _0x5a60a6=_0x4ef4c9,_0x212df4=_0x1d275e[_0x548fc4];Object[_0x5a60a6(0x1a8)](_0x212df4)[_0x5a60a6(0x1ab)](_0x475c27=>{const _0x40225e=_0x5a60a6;this[_0x40225e(0x179)](_0x548fc4,_0x475c27)[_0x40225e(0x199)](_0x212df4[_0x475c27]);});});}[_0x5484a7(0x173)](){const _0x236c48=_0x5484a7;this[_0x236c48(0x192)][_0x236c48(0x16a)]({'pluginName':W,'businesses':[_0x1791e7[_0x236c48(0x172)]],'toJson':_0x156aa8=>this['_serializeShapeForUnit'](_0x156aa8),'parseJson':_0xe3bdf1=>JSON[_0x236c48(0x16b)](_0xe3bdf1),'onLoad':(_0x51a9e6,_0x219321)=>{const _0x2a8d69=_0x236c48;this[_0x2a8d69(0x187)](_0x51a9e6,_0x219321);},'onUnLoad':_0x56d7f7=>{const _0x252f5c=_0x236c48,_0x277ac6=this['_shapeModelManagerMap'][_0x252f5c(0x190)](_0x56d7f7);_0x277ac6&&(_0x277ac6[_0x252f5c(0x1ab)](_0x5b2c87=>{_0x5b2c87['dispose']();}),this['_shapeModelManagerMap'][_0x252f5c(0x193)](_0x56d7f7));}});}[_0x5484a7(0x19a)](){const _0x300fdb=_0x5484a7;this[_0x300fdb(0x19f)][_0x300fdb(0x1ab)](_0x18ac97=>{const _0x411960=_0x300fdb;_0x18ac97[_0x411960(0x1ab)](_0x17ba38=>{const _0x42318b=_0x411960;_0x17ba38[_0x42318b(0x19a)]();});});}};i=V([K(0x0,_0xfb96d4)],i);const u={'id':'sheet.mutation.update-shape-type','type':_0x3e44b9['MUTATION'],'handler':(_0x2ef8ee,_0x1627fc)=>{const _0x392e91=_0x5484a7,{unitId:_0x28fd7b,subUnitId:_0x2a40e7,shapeType:_0x18fc9d,shapeId:_0x565bb5,shapeData:_0x2bfc3a}=_0x1627fc,_0x353560=_0x2ef8ee[_0x392e91(0x190)](i)[_0x392e91(0x19d)](_0x28fd7b,_0x2a40e7,_0x565bb5);return _0x353560&&(_0x353560[_0x392e91(0x175)](_0x18fc9d),_0x2bfc3a&&(_0x353560==null||_0x353560[_0x392e91(0x176)](_0x2bfc3a))),!0x0;}},pe={'id':_0x5484a7(0x182),'type':_0x3e44b9[_0x5484a7(0x19e)],'handler':(_0x10eb92,_0x10b5b5)=>{const _0x166da3=_0x5484a7;if(!_0x10b5b5)return!0x1;const _0x43c5cd=_0x10eb92[_0x166da3(0x190)](_0x5c5b2b),_0x2aaf2f=_0x10eb92[_0x166da3(0x190)](i),_0x27b118=_0x10eb92[_0x166da3(0x190)](_0x22d773),_0x2e151f=[],_0x3bd88c=[],{unitId:_0x186ab1,subUnitId:_0x29dcd3,shapeId:_0x1b57ce,shapeType:_0x5bfbd7,shapeData:_0x5b3f9a}=_0x10b5b5,_0x451da3=_0x2aaf2f[_0x166da3(0x19d)](_0x186ab1,_0x29dcd3,_0x1b57ce);if(_0x451da3){const _0x41f2ab=_0x451da3['getShapeType'](),_0x15ceb5=Object['assign']({},_0x451da3[_0x166da3(0x19b)]()),_0x207375={'unitId':_0x186ab1,'subUnitId':_0x29dcd3,'shapeId':_0x1b57ce,'shapeType':_0x5bfbd7,'shapeData':_0x5b3f9a},_0x5ec5ef={'unitId':_0x186ab1,'subUnitId':_0x29dcd3,'shapeId':_0x1b57ce,'shapeType':_0x41f2ab,'shapeData':_0x15ceb5};return _0x2e151f[_0x166da3(0x19c)]({'id':u['id'],'params':_0x207375}),_0x3bd88c['push']({'id':u['id'],'params':_0x5ec5ef}),_0x2e151f[_0x166da3(0x183)](_0x24cced=>_0x43c5cd[_0x166da3(0x1a7)](_0x24cced['id'],_0x24cced[_0x166da3(0x18c)]))&&_0x27b118[_0x166da3(0x17b)]({'unitID':_0x186ab1,'redoMutations':[..._0x2e151f],'undoMutations':[..._0x3bd88c]}),!0x0;}return!0x1;}},Y={'id':'sheet.mutation.insert-shape','type':_0x3e44b9['MUTATION'],'handler':(_0x472274,_0x4c3942)=>{const _0x39d78c=_0x5484a7,{unitId:_0x13c95d,subUnitId:_0x3834b7,shapeType:_0x3a4235,shapeId:_0x2ca697,shapeData:_0x52c544}=_0x4c3942;return _0x472274[_0x39d78c(0x190)](i)[_0x39d78c(0x1ad)](_0x13c95d,_0x3834b7,_0x3a4235,_0x2ca697,_0x52c544),!0x0;}},q={'id':_0x5484a7(0x174),'type':_0x3e44b9['MUTATION'],'handler':(_0x9e368d,_0xb67243)=>{const _0x178b0e=_0x5484a7,{unitId:_0x1e5373,subUnitId:_0x2264e2,shapeId:_0x22c6bd}=_0xb67243;return _0x9e368d[_0x178b0e(0x190)](i)[_0x178b0e(0x1b5)](_0x1e5373,_0x2264e2,_0x22c6bd),!0x0;}},Q={'id':'sheet.mutation.update-shape-data','type':_0x3e44b9['MUTATION'],'handler':(_0x21b6b3,_0x1603f5)=>{const _0x188291=_0x5484a7,{unitId:_0x20a699,subUnitId:_0x10c123,shapeType:_0x1dd402,shapeId:_0x21056c,shapeData:_0x2077d5}=_0x1603f5,_0x580e2a=_0x21b6b3[_0x188291(0x190)](i)[_0x188291(0x19d)](_0x20a699,_0x10c123,_0x21056c);return _0x580e2a&&(_0x1dd402!==void 0x0&&_0x580e2a[_0x188291(0x175)](_0x1dd402),_0x2077d5&&(_0x580e2a==null||_0x580e2a[_0x188291(0x176)](_0x2077d5,!0x0))),!0x0;}},X=_0x5484a7(0x197),m={};var Z=Object[_0x5484a7(0x178)],k=Object[_0x5484a7(0x1ae)],ee=(_0x5bae1e,_0x1836ff,_0x22034d)=>_0x1836ff in _0x5bae1e?Z(_0x5bae1e,_0x1836ff,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x22034d}):_0x5bae1e[_0x1836ff]=_0x22034d,ae=(_0x245025,_0x471ea7,_0x3b436d,_0xa4736d)=>{const _0x2d8427=_0x5484a7;for(var _0x4e712f=_0xa4736d>0x1?void 0x0:_0xa4736d?k(_0x471ea7,_0x3b436d):_0x471ea7,_0x47829a=_0x245025[_0x2d8427(0x18e)]-0x1,_0x4f0d42;_0x47829a>=0x0;_0x47829a--)(_0x4f0d42=_0x245025[_0x47829a])&&(_0x4e712f=_0x4f0d42(_0x4e712f)||_0x4e712f);return _0x4e712f;},g=(_0x3e6958,_0x3fee72)=>(_0x3d5f5b,_0x23131d)=>_0x3fee72(_0x3d5f5b,_0x23131d,_0x3e6958),E=(_0x32c9d1,_0x3bbbb8,_0x1eda98)=>ee(_0x32c9d1,typeof _0x3bbbb8!=_0x5484a7(0x1a5)?_0x3bbbb8+'':_0x3bbbb8,_0x1eda98);const se='SHEET_SHAPE_PLUGIN';let S=class extends _0xa33e95{constructor(_0xfcf7dc=m,_0x5e99dd,_0x37305d,_0x58324b){const _0x324889=_0x5484a7;super(),this['_config']=_0xfcf7dc,this[_0x324889(0x1aa)]=_0x5e99dd,this['_commandService']=_0x37305d,this[_0x324889(0x184)]=_0x58324b;const {..._0x497b9c}=_0xfa4b98({},m,this[_0x324889(0x18f)]);this[_0x324889(0x184)][_0x324889(0x1b4)](X,_0x497b9c),this[_0x324889(0x185)]();}[_0x5484a7(0x171)](){const _0x444c72=_0x5484a7;_0x1fc7ee(this[_0x444c72(0x1aa)],[]);}[_0x5484a7(0x198)](){const _0x255190=_0x5484a7,_0x48559f=this[_0x255190(0x1aa)];[[T],[i]][_0x255190(0x1ab)](_0x44d62d=>_0x48559f[_0x255190(0x1b0)](_0x44d62d));}[_0x5484a7(0x185)](){const _0x34c94a=_0x5484a7;[Y,q,u,Q][_0x34c94a(0x1ab)](_0x4e99a3=>this[_0x34c94a(0x16e)](this[_0x34c94a(0x194)][_0x34c94a(0x195)](_0x4e99a3)));}};E(S,_0x5484a7(0x16d),_0x1791e7['UNIVER_SHEET']),E(S,_0x5484a7(0x170),se),S=ae([_0x502eab(_0x3b4c6e),g(0x1,_0x546027(_0x58fdc6)),g(0x2,_0x5c5b2b),g(0x3,_0x499a85)],S);export{Y as InsertSheetsShapeMutation,q as RemoveSheetsShapeMutation,i as SheetsShapeServices,S as UniverSheetsShapePlugin,Q as UpdateSheetsShapeDataMutation,pe as UpdateSheetsShapeTypeCommand,u as UpdateSheetsShapeTypeMutation};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IShapeData, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
|
|
2
|
+
import { ICommand } from '@univerjs/core';
|
|
3
|
+
import { ISheetCommandSharedParams } from '@univerjs/sheets';
|
|
4
|
+
export interface IUpdateSheetsShapeTypeCommandParams extends ISheetCommandSharedParams {
|
|
5
|
+
shapeId: string;
|
|
6
|
+
shapeType: ShapeTypeEnum;
|
|
7
|
+
shapeData?: IShapeData;
|
|
8
|
+
}
|
|
9
|
+
export declare const UpdateSheetsShapeTypeCommand: ICommand<IUpdateSheetsShapeTypeCommandParams>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IShapeData, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
|
|
2
|
+
import { IMutation } from '@univerjs/core';
|
|
3
|
+
import { ISheetCommandSharedParams } from '@univerjs/sheets';
|
|
4
|
+
export interface IInsertSheetsShapeMutationParams extends ISheetCommandSharedParams {
|
|
5
|
+
shapeId: string;
|
|
6
|
+
shapeType: ShapeTypeEnum;
|
|
7
|
+
shapeData?: IShapeData;
|
|
8
|
+
}
|
|
9
|
+
export declare const InsertSheetsShapeMutation: IMutation<IInsertSheetsShapeMutationParams>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IMutation } from '@univerjs/core';
|
|
2
|
+
import { ISheetCommandSharedParams } from '@univerjs/sheets';
|
|
3
|
+
export interface IRemoveSheetsShapeMutationParams extends ISheetCommandSharedParams {
|
|
4
|
+
shapeId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const RemoveSheetsShapeMutation: IMutation<IRemoveSheetsShapeMutationParams>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IShapeData, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
|
|
2
|
+
import { IMutation } from '@univerjs/core';
|
|
3
|
+
import { ISheetCommandSharedParams } from '@univerjs/sheets';
|
|
4
|
+
export interface IUpdateSheetsShapeDataMutationParams extends ISheetCommandSharedParams {
|
|
5
|
+
shapeId: string;
|
|
6
|
+
shapeType: ShapeTypeEnum;
|
|
7
|
+
shapeData?: IShapeData;
|
|
8
|
+
}
|
|
9
|
+
export declare const UpdateSheetsShapeDataMutation: IMutation<IUpdateSheetsShapeDataMutationParams>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IShapeData, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
|
|
2
|
+
import { IMutation } from '@univerjs/core';
|
|
3
|
+
import { ISheetCommandSharedParams } from '@univerjs/sheets';
|
|
4
|
+
export interface IUpdateSheetsShapeTypeMutationParams extends ISheetCommandSharedParams {
|
|
5
|
+
shapeId: string;
|
|
6
|
+
shapeType: ShapeTypeEnum;
|
|
7
|
+
shapeData?: IShapeData;
|
|
8
|
+
}
|
|
9
|
+
export declare const UpdateSheetsShapeTypeMutation: IMutation<IUpdateSheetsShapeTypeMutationParams>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { UpdateSheetsShapeTypeCommand } from './commands/command/update-shape-type.command';
|
|
2
|
+
export type { IUpdateSheetsShapeTypeCommandParams } from './commands/command/update-shape-type.command';
|
|
3
|
+
export { InsertSheetsShapeMutation } from './commands/mutation/add-shape.mutation';
|
|
4
|
+
export type { IInsertSheetsShapeMutationParams } from './commands/mutation/add-shape.mutation';
|
|
5
|
+
export { RemoveSheetsShapeMutation } from './commands/mutation/remove-shape.mutation';
|
|
6
|
+
export type { IRemoveSheetsShapeMutationParams } from './commands/mutation/remove-shape.mutation';
|
|
7
|
+
export { UpdateSheetsShapeDataMutation } from './commands/mutation/update-shape-data.mutation';
|
|
8
|
+
export type { IUpdateSheetsShapeDataMutationParams } from './commands/mutation/update-shape-data.mutation';
|
|
9
|
+
export { UpdateSheetsShapeTypeMutation } from './commands/mutation/update-shape-type.mutation';
|
|
10
|
+
export type { IUpdateSheetsShapeTypeMutationParams } from './commands/mutation/update-shape-type.mutation';
|
|
11
|
+
export { UniverSheetsShapePlugin } from './plugin';
|
|
12
|
+
export { SheetsShapeServices } from './services/sheet-shape-services';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { IShapeData, IShapeJSONData, IShapeRelation, IShapeRelationItem, ShapeTypeEnum, ShapeModel } from '@univerjs-pro/engine-shape';
|
|
2
|
+
import { Disposable } from '@univerjs/core';
|
|
3
|
+
export type IShapeRelationItemWithLineId = IShapeRelationItem & {
|
|
4
|
+
lineShapeId: string;
|
|
5
|
+
isFrom: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare class SheetShapeModelManager extends Disposable {
|
|
8
|
+
_shapes: Map<string, ShapeModel>;
|
|
9
|
+
_linesIds: Set<string>;
|
|
10
|
+
_groupIds: Set<string>;
|
|
11
|
+
constructor();
|
|
12
|
+
addShape(shapeType: ShapeTypeEnum, id: string, shapeData?: IShapeData): ShapeModel;
|
|
13
|
+
/**
|
|
14
|
+
* Get all shape relations associated with a basic shape
|
|
15
|
+
* @param {string} id The basic shape ID
|
|
16
|
+
* @returns {IShapeRelationItemWithLineId[]} List of shape relation items associated with the basic shape
|
|
17
|
+
*/
|
|
18
|
+
getBasicShapeRelation(id: string): IShapeRelationItemWithLineId[];
|
|
19
|
+
/**
|
|
20
|
+
* Get the line shape relation info
|
|
21
|
+
* @param lineShapeId The line shape ID
|
|
22
|
+
* @returns {IShapeRelationItem | undefined} The shape relation info for the given line shape ID
|
|
23
|
+
*/
|
|
24
|
+
getLineShapeRelation(lineShapeId: string): IShapeRelation | undefined;
|
|
25
|
+
getShapeType(id: string): ShapeTypeEnum | undefined;
|
|
26
|
+
hasShape(id: string): boolean;
|
|
27
|
+
removeShape(id: string): void;
|
|
28
|
+
toJSON(): IShapeJSONData[];
|
|
29
|
+
fromJSON(data: IShapeJSONData[]): void;
|
|
30
|
+
dispose(): void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IUniverSheetsShapeConfig } from './controllers/config.schema';
|
|
2
|
+
import { ICommandService, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
|
+
export declare const SHEET_SHAPE_PLUGIN_NAME = "SHEET_SHAPE_PLUGIN";
|
|
4
|
+
export declare class UniverSheetsShapePlugin extends Plugin {
|
|
5
|
+
private readonly _config;
|
|
6
|
+
protected readonly _injector: Injector;
|
|
7
|
+
private readonly _commandService;
|
|
8
|
+
private readonly _configService;
|
|
9
|
+
static type: UniverInstanceType;
|
|
10
|
+
static pluginName: string;
|
|
11
|
+
constructor(_config: IUniverSheetsShapeConfig | undefined, _injector: Injector, _commandService: ICommandService, _configService: IConfigService);
|
|
12
|
+
onRendered(): void;
|
|
13
|
+
onStarting(): void;
|
|
14
|
+
private _initCommands;
|
|
15
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IShapeData, IShapeJSONData, ShapeTypeEnum } from '@univerjs-pro/engine-shape';
|
|
2
|
+
import { Disposable, IResourceManagerService } from '@univerjs/core';
|
|
3
|
+
export interface ISheetsShapeResource {
|
|
4
|
+
[subUnitId: string]: IShapeJSONData[];
|
|
5
|
+
}
|
|
6
|
+
export declare const SHEET_SHAPE_PLUGIN = "SHEET_SHAPE_PLUGIN";
|
|
7
|
+
export declare class SheetsShapeServices extends Disposable {
|
|
8
|
+
private readonly _resourcesManagerService;
|
|
9
|
+
private _shapeModelManagerMap;
|
|
10
|
+
constructor(_resourcesManagerService: IResourceManagerService);
|
|
11
|
+
private _ensureShapeModelManager;
|
|
12
|
+
insertShape(unitId: string, subUnitId: string, shapeType: ShapeTypeEnum, shapeId: string, shapeData?: IShapeData): void;
|
|
13
|
+
removeShape(unitId: string, subUnitId: string, shapeId: string): void;
|
|
14
|
+
getBasicShapeType(unitId: string, subUnitId: string, shapeId: string): ShapeTypeEnum | undefined;
|
|
15
|
+
getShapeType(unitId: string, subUnitId: string, shapeId: string): ShapeTypeEnum | undefined;
|
|
16
|
+
hasShape(unitId: string, subUnitId: string, shapeId: string): boolean;
|
|
17
|
+
getShapeTypeById(unitId: string, subUnitId: string, shapeId: string): ShapeTypeEnum | undefined;
|
|
18
|
+
getShapeDataById(unitId: string, subUnitId: string, shapeId: string): IShapeData | undefined;
|
|
19
|
+
getShapeModel(unitId: string, subUnitId: string, shapeId: string): import('@univerjs-pro/engine-shape').ShapeModel | undefined;
|
|
20
|
+
getBasicShapeRelation(unitId: string, subUnitId: string, shapeId: string): import('../model/shape-manager').IShapeRelationItemWithLineId[];
|
|
21
|
+
getLineShapeRelation(unitId: string, subUnitId: string, shapeId: string): import('@univerjs-pro/engine-shape').IShapeRelation | undefined;
|
|
22
|
+
setShapeType(): void;
|
|
23
|
+
private _serializeShapeForUnit;
|
|
24
|
+
private _deserializeShapeForUnit;
|
|
25
|
+
toJSON(): {
|
|
26
|
+
[unitId: string]: {
|
|
27
|
+
[subUnitId: string]: IShapeJSONData[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
fromJSON(data: {
|
|
31
|
+
[unitId: string]: {
|
|
32
|
+
[subUnitId: string]: IShapeJSONData[];
|
|
33
|
+
};
|
|
34
|
+
}): void;
|
|
35
|
+
private _initSnapshot;
|
|
36
|
+
dispose(): void;
|
|
37
|
+
}
|
package/lib/umd/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x10dd(_0x2685ce,_0x55e90f){_0x2685ce=_0x2685ce-0xd0;const _0x4e7cd2=_0x4e7c();let _0x10dddf=_0x4e7cd2[_0x2685ce];return _0x10dddf;}function _0x4e7c(){const _0x4628a9=['add','stringify','IConfigService','_shapeModelManagerMap','toJSON','960207UEkxwl','hasShape','addShape','UniverSheetsShapePlugin','_resourcesManagerService','forEach','insertShape','COMMAND','registerPluginResource','merge','61018VSMgmm','179838vsAjWT','touchDependencies','_linesIds','18506SjWlWL','_disposed','keys','toStringTag','2760784LqiAOI','_groupIds','getLineShapeRelation','sheet.command.update-shape-type','type','_config','Injector','delete','_shapes','getShapeRelation','getBasicShapeType','Module','shapeId','setShapeType','MUTATION','@univerjs-pro/engine-shape','from','getShapeType','getBasicShapeRelation','amd','CommandType','has','IResourceManagerService','UniverCore','fromJSON','dispose','284cPXsrH','UpdateSheetsShapeDataMutation','ShapeModel','UniverInstanceType','1057455ipYnRr','pushUndoRedo','_initCommands','defineProperty','Disposable','ICommandService','isLineShape','_serializeShapeForUnit','24785aduSYY','_injector','push','getShapeModel','length','onStarting','parse','clear','onRendered','UniverProSheetsShape','assign','shapeData','removeShape','_commandService','getShapeDataById','function','SheetsShapeServices','symbol','_ensureShapeModelManager','setShapeData','DependentOn','@univerjs/core','set','UNIVER_SHEET','getShapeTypeById','Plugin','getShapeData','pluginName','SHEET_SHAPE_PLUGIN','getOwnPropertyDescriptor','sheet.mutation.insert-shape','InsertSheetsShapeMutation','object','UniverProLicense','_deserializeShapeForUnit','UniverLicensePlugin','_initSnapshot','sheets-shape.config','every','IUndoRedoService','get','UpdateSheetsShapeTypeCommand'];_0x4e7c=function(){return _0x4628a9;};return _0x4e7c();}(function(_0x520bdf,_0x5b1dc4){const _0x41d95c=_0x10dd,_0x1c0bfc=_0x520bdf();while(!![]){try{const _0x253c40=-parseInt(_0x41d95c(0xe1))/0x1+-parseInt(_0x41d95c(0xe5))/0x2+-parseInt(_0x41d95c(0xd7))/0x3+-parseInt(_0x41d95c(0x103))/0x4*(-parseInt(_0x41d95c(0x10f))/0x5)+parseInt(_0x41d95c(0xe2))/0x6+-parseInt(_0x41d95c(0x107))/0x7+parseInt(_0x41d95c(0xe9))/0x8;if(_0x253c40===_0x5b1dc4)break;else _0x1c0bfc['push'](_0x1c0bfc['shift']());}catch(_0x51b370){_0x1c0bfc['push'](_0x1c0bfc['shift']());}}}(_0x4e7c,0x2d50d),function(_0x29c179,_0x52ebfd){const _0x4455d5=_0x10dd;typeof exports==_0x4455d5(0x12f)&&typeof module<'u'?_0x52ebfd(exports,require('@univerjs/core'),require('@univerjs-pro/engine-shape'),require('@univerjs-pro/license')):typeof define==_0x4455d5(0x11e)&&define[_0x4455d5(0xfc)]?define(['exports',_0x4455d5(0x124),_0x4455d5(0xf8),'@univerjs-pro/license'],_0x52ebfd):(_0x29c179=typeof globalThis<'u'?globalThis:_0x29c179||self,_0x52ebfd(_0x29c179[_0x4455d5(0x118)]={},_0x29c179[_0x4455d5(0x100)],_0x29c179['UniverProEngineShape'],_0x29c179[_0x4455d5(0x130)]));}(this,function(_0x4ab130,_0x2b7f8f,_0x1ac12b,_0x3186de){'use strict';const _0x297a7f=_0x10dd;var _0x541fc3=Object[_0x297a7f(0x10a)],_0x48b129=(_0x54a83d,_0x5d8e7a,_0x4b9ffb)=>_0x5d8e7a in _0x54a83d?_0x541fc3(_0x54a83d,_0x5d8e7a,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x4b9ffb}):_0x54a83d[_0x5d8e7a]=_0x4b9ffb,_0x3bbaa8=(_0x2f2b7c,_0x3de5ee,_0xce69d8)=>_0x48b129(_0x2f2b7c,typeof _0x3de5ee!=_0x297a7f(0x120)?_0x3de5ee+'':_0x3de5ee,_0xce69d8);class _0x2b1b1b extends _0x2b7f8f[_0x297a7f(0x10b)]{constructor(){const _0x5a8547=_0x297a7f;super(),_0x3bbaa8(this,'_shapes',new Map()),_0x3bbaa8(this,_0x5a8547(0xe4),new Set()),_0x3bbaa8(this,_0x5a8547(0xea),new Set());}[_0x297a7f(0xd9)](_0x3275b3,_0x50b69e,_0x18388b){const _0x2b70bc=_0x297a7f,_0xc17d49=new _0x1ac12b[(_0x2b70bc(0x105))](_0x3275b3,_0x50b69e,_0x18388b);return this[_0x2b70bc(0xf1)][_0x2b70bc(0x125)](_0x50b69e,_0xc17d49),_0x1ac12b['isConnectorShape'](_0x3275b3)&&this['_linesIds']['add'](_0x50b69e),_0xc17d49;}[_0x297a7f(0xfb)](_0x2b35ca){const _0x1c5a44=_0x297a7f;var _0x56d382,_0x445569;const _0x4a9815=[];for(const _0x21ba4d of this[_0x1c5a44(0xe4)]){const _0xe79be9=this['_shapes']['get'](_0x21ba4d);if(_0xe79be9){const _0x20e416=_0xe79be9[_0x1c5a44(0xf2)]();_0x20e416&&(((_0x56d382=_0x20e416[_0x1c5a44(0xf9)])==null?void 0x0:_0x56d382[_0x1c5a44(0xf5)])===_0x2b35ca&&_0x4a9815[_0x1c5a44(0x111)]({..._0x20e416[_0x1c5a44(0xf9)],'lineShapeId':_0x21ba4d,'isFrom':!0x0}),((_0x445569=_0x20e416['to'])==null?void 0x0:_0x445569['shapeId'])===_0x2b35ca&&_0x4a9815['push']({..._0x20e416['to'],'lineShapeId':_0x21ba4d,'isFrom':!0x1}));}}return _0x4a9815;}[_0x297a7f(0xeb)](_0x977c08){const _0x3cfce4=_0x297a7f,_0x5f03c8=this['_shapes']['get'](_0x977c08);if(_0x5f03c8)return _0x5f03c8[_0x3cfce4(0xf2)]();}['getShapeType'](_0x391835){const _0x5dad1f=_0x297a7f,_0xa3afd=this['_shapes'][_0x5dad1f(0xd0)](_0x391835);if(_0xa3afd)return _0xa3afd[_0x5dad1f(0xfa)]();}[_0x297a7f(0xd8)](_0x4304aa){const _0x104ebd=_0x297a7f;return this[_0x104ebd(0xf1)][_0x104ebd(0xfe)](_0x4304aa);}[_0x297a7f(0x11b)](_0x3a26c5){const _0x6480b4=_0x297a7f,_0x27d5cf=this[_0x6480b4(0xf1)][_0x6480b4(0xd0)](_0x3a26c5);_0x27d5cf&&(_0x1ac12b['isConnectorShape'](_0x27d5cf[_0x6480b4(0xfa)]())&&this[_0x6480b4(0xe4)][_0x6480b4(0xf0)](_0x3a26c5),this['_shapes'][_0x6480b4(0xf0)](_0x3a26c5));}[_0x297a7f(0xd6)](){const _0x55db51=_0x297a7f,_0x2f95b6=[];return this[_0x55db51(0xf1)][_0x55db51(0xdc)](_0x12fad9=>{const _0x33b364=_0x55db51;_0x2f95b6[_0x33b364(0x111)](_0x12fad9['toJSON']());}),_0x2f95b6;}['fromJSON'](_0x49398e){const _0x230aa4=_0x297a7f;for(const _0x33a77d of _0x49398e){const {id:_0x1e80c4,shapeType:_0x3b5d4e}=_0x33a77d,_0x4780cb=this[_0x230aa4(0xd9)](_0x3b5d4e,_0x1e80c4,_0x33a77d[_0x230aa4(0x11a)]);_0x4780cb&&_0x4780cb[_0x230aa4(0x10d)]()&&this[_0x230aa4(0xe4)][_0x230aa4(0xd2)](_0x1e80c4);}}['dispose'](){const _0x16b185=_0x297a7f;this[_0x16b185(0xe6)]||(this[_0x16b185(0xf1)]['forEach'](_0x596156=>{const _0x472031=_0x16b185;_0x596156[_0x472031(0x102)]();}),this['_shapes'][_0x16b185(0x116)](),this[_0x16b185(0xe4)]['clear'](),this[_0x16b185(0xea)][_0x16b185(0x116)](),super[_0x16b185(0x102)]());}}var _0x9f5db3=Object[_0x297a7f(0x12c)],_0x49e747=(_0x5b4693,_0x4b0484,_0x57f32f,_0x5d7fbf)=>{const _0x2c0158=_0x297a7f;for(var _0x4ee3bb=_0x5d7fbf>0x1?void 0x0:_0x5d7fbf?_0x9f5db3(_0x4b0484,_0x57f32f):_0x4b0484,_0x20a268=_0x5b4693[_0x2c0158(0x113)]-0x1,_0x5f150a;_0x20a268>=0x0;_0x20a268--)(_0x5f150a=_0x5b4693[_0x20a268])&&(_0x4ee3bb=_0x5f150a(_0x4ee3bb)||_0x4ee3bb);return _0x4ee3bb;},_0x3ccee9=(_0x534beb,_0x330dfd)=>(_0x30704a,_0x23c223)=>_0x330dfd(_0x30704a,_0x23c223,_0x534beb);const _0x41ed77=_0x297a7f(0x12b);_0x4ab130['SheetsShapeServices']=class extends _0x2b7f8f['Disposable']{constructor(_0x39672e){const _0x4719a7=_0x297a7f;super(),_0x3bbaa8(this,'_shapeModelManagerMap',new Map()),(this[_0x4719a7(0xdb)]=_0x39672e,this[_0x4719a7(0x133)]());}[_0x297a7f(0x121)](_0x5b4b99,_0x55ad44){const _0x496811=_0x297a7f;let _0x1dc6ab=this[_0x496811(0xd5)][_0x496811(0xd0)](_0x5b4b99);_0x1dc6ab||(_0x1dc6ab=new Map(),this[_0x496811(0xd5)][_0x496811(0x125)](_0x5b4b99,_0x1dc6ab));let _0x2237b4=_0x1dc6ab[_0x496811(0xd0)](_0x55ad44);return _0x2237b4||(_0x2237b4=new _0x2b1b1b(),_0x1dc6ab[_0x496811(0x125)](_0x55ad44,_0x2237b4)),_0x2237b4;}['insertShape'](_0x1b2508,_0x2b4500,_0x504b15,_0x18dbe6,_0x59c9d3){const _0x3a865e=_0x297a7f;this[_0x3a865e(0x121)](_0x1b2508,_0x2b4500)[_0x3a865e(0xd9)](_0x504b15,_0x18dbe6,_0x59c9d3);}[_0x297a7f(0x11b)](_0x43e228,_0x521ec1,_0x4ad21e){const _0x22d1cc=_0x297a7f;this[_0x22d1cc(0x121)](_0x43e228,_0x521ec1)[_0x22d1cc(0x11b)](_0x4ad21e);}[_0x297a7f(0xf3)](_0x4ed42f,_0x2dd619,_0x4cb8a7){const _0x4e4133=_0x297a7f;return this[_0x4e4133(0x121)](_0x4ed42f,_0x2dd619)['getShapeType'](_0x4cb8a7);}[_0x297a7f(0xfa)](_0x4807eb,_0x141ed9,_0xc6aba){const _0x176af2=_0x297a7f;return this[_0x176af2(0x121)](_0x4807eb,_0x141ed9)['getShapeType'](_0xc6aba);}[_0x297a7f(0xd8)](_0x5ee3b8,_0x1a4ae8,_0x2ab8fb){const _0x1f7d61=_0x297a7f;return this[_0x1f7d61(0x121)](_0x5ee3b8,_0x1a4ae8)['hasShape'](_0x2ab8fb);}[_0x297a7f(0x127)](_0x4bc7c0,_0x528918,_0x55cfe4){return this['_ensureShapeModelManager'](_0x4bc7c0,_0x528918)['getShapeType'](_0x55cfe4);}[_0x297a7f(0x11d)](_0x2990a0,_0x1cdaba,_0x413130){const _0x4d8136=_0x297a7f,_0x1a63b3=this[_0x4d8136(0x121)](_0x2990a0,_0x1cdaba);if(!_0x1a63b3[_0x4d8136(0xfa)](_0x413130))return;const _0x36be87=_0x1a63b3[_0x4d8136(0xf1)]['get'](_0x413130);if(_0x36be87)return _0x36be87['getShapeData']();}[_0x297a7f(0x112)](_0x21ac45,_0x3c2957,_0x2ee8c0){const _0x244253=_0x297a7f;return this[_0x244253(0x121)](_0x21ac45,_0x3c2957)['_shapes'][_0x244253(0xd0)](_0x2ee8c0);}[_0x297a7f(0xfb)](_0xeede6a,_0x19826d,_0x542232){const _0x518938=_0x297a7f;return this[_0x518938(0x121)](_0xeede6a,_0x19826d)[_0x518938(0xfb)](_0x542232);}[_0x297a7f(0xeb)](_0x5385e0,_0x35fb9d,_0x264612){const _0x3a70a0=_0x297a7f,_0x5a2002=this['_ensureShapeModelManager'](_0x5385e0,_0x35fb9d)['_shapes'][_0x3a70a0(0xd0)](_0x264612);if(_0x5a2002)return _0x5a2002[_0x3a70a0(0xf2)]();}['setShapeType'](){}['_serializeShapeForUnit'](_0x3ae52e){const _0x26b9e5=_0x297a7f,_0x43b1eb={},_0x469506=this[_0x26b9e5(0xd5)]['get'](_0x3ae52e);return _0x469506&&_0x469506['forEach']((_0x1adf8f,_0x3d28be)=>{_0x43b1eb[_0x3d28be]=_0x1adf8f['toJSON']();}),JSON[_0x26b9e5(0xd3)](_0x43b1eb);}[_0x297a7f(0x131)](_0x3ec5df,_0x5c2657){const _0x4aa374=_0x297a7f;Object[_0x4aa374(0xe7)](_0x5c2657)['forEach'](_0x32d274=>{const _0x5689e2=_0x4aa374;this[_0x5689e2(0x121)](_0x3ec5df,_0x32d274)[_0x5689e2(0x101)](_0x5c2657[_0x32d274]);});}[_0x297a7f(0xd6)](){const _0x501fcc=_0x297a7f,_0x7a168a={};return this[_0x501fcc(0xd5)][_0x501fcc(0xdc)]((_0x2a2c88,_0x172ae4)=>{_0x7a168a[_0x172ae4]={},_0x2a2c88['forEach']((_0x2c3245,_0x27fadd)=>{const _0x1cadd4=_0x10dd;_0x7a168a[_0x172ae4][_0x27fadd]=_0x2c3245[_0x1cadd4(0xd6)]();});}),_0x7a168a;}[_0x297a7f(0x101)](_0x7d93a7){const _0x4fde07=_0x297a7f;Object[_0x4fde07(0xe7)](_0x7d93a7)[_0x4fde07(0xdc)](_0x4a0679=>{const _0x54abee=_0x4fde07,_0x4e7cc9=_0x7d93a7[_0x4a0679];Object[_0x54abee(0xe7)](_0x4e7cc9)['forEach'](_0x5955cb=>{const _0x3ceb0d=_0x54abee;this[_0x3ceb0d(0x121)](_0x4a0679,_0x5955cb)[_0x3ceb0d(0x101)](_0x4e7cc9[_0x5955cb]);});});}[_0x297a7f(0x133)](){const _0x6ab14b=_0x297a7f;this[_0x6ab14b(0xdb)][_0x6ab14b(0xdf)]({'pluginName':_0x41ed77,'businesses':[_0x2b7f8f[_0x6ab14b(0x106)][_0x6ab14b(0x126)]],'toJson':_0x50dfc9=>this[_0x6ab14b(0x10e)](_0x50dfc9),'parseJson':_0x26221b=>JSON[_0x6ab14b(0x115)](_0x26221b),'onLoad':(_0x598228,_0x512e2c)=>{const _0x31603b=_0x6ab14b;this[_0x31603b(0x131)](_0x598228,_0x512e2c);},'onUnLoad':_0x3e66af=>{const _0x45d6bc=_0x6ab14b,_0x289664=this[_0x45d6bc(0xd5)][_0x45d6bc(0xd0)](_0x3e66af);_0x289664&&(_0x289664['forEach'](_0x10b737=>{const _0x184b2a=_0x45d6bc;_0x10b737[_0x184b2a(0x102)]();}),this['_shapeModelManagerMap']['delete'](_0x3e66af));}});}['dispose'](){const _0x2e1ff0=_0x297a7f;this[_0x2e1ff0(0xd5)]['forEach'](_0x4a2901=>{const _0x3cc263=_0x2e1ff0;_0x4a2901[_0x3cc263(0xdc)](_0x26ff0a=>{const _0x4ca1b5=_0x3cc263;_0x26ff0a[_0x4ca1b5(0x102)]();});});}},_0x4ab130[_0x297a7f(0x11f)]=_0x49e747([_0x3ccee9(0x0,_0x2b7f8f[_0x297a7f(0xff)])],_0x4ab130[_0x297a7f(0x11f)]);const _0x21b8fb={'id':'sheet.mutation.update-shape-type','type':_0x2b7f8f[_0x297a7f(0xfd)][_0x297a7f(0xf7)],'handler':(_0x468ab8,_0xb86374)=>{const _0x1abd95=_0x297a7f,{unitId:_0x57d44d,subUnitId:_0xbd19f2,shapeType:_0x455e78,shapeId:_0x156170,shapeData:_0x3dc1f4}=_0xb86374,_0x4d1f24=_0x468ab8[_0x1abd95(0xd0)](_0x4ab130['SheetsShapeServices'])[_0x1abd95(0x112)](_0x57d44d,_0xbd19f2,_0x156170);return _0x4d1f24&&(_0x4d1f24[_0x1abd95(0xf6)](_0x455e78),_0x3dc1f4&&(_0x4d1f24==null||_0x4d1f24[_0x1abd95(0x122)](_0x3dc1f4))),!0x0;}},_0x5f9682={'id':_0x297a7f(0xec),'type':_0x2b7f8f[_0x297a7f(0xfd)][_0x297a7f(0xde)],'handler':(_0xb9d7d7,_0x444407)=>{const _0x154814=_0x297a7f;if(!_0x444407)return!0x1;const _0x3fa9da=_0xb9d7d7[_0x154814(0xd0)](_0x2b7f8f['ICommandService']),_0x26441e=_0xb9d7d7[_0x154814(0xd0)](_0x4ab130[_0x154814(0x11f)]),_0x40f9d5=_0xb9d7d7[_0x154814(0xd0)](_0x2b7f8f[_0x154814(0x136)]),_0x38d07b=[],_0x23efe7=[],{unitId:_0x508363,subUnitId:_0x601841,shapeId:_0x4c90e0,shapeType:_0x28c84e,shapeData:_0x2ba043}=_0x444407,_0x3b9608=_0x26441e[_0x154814(0x112)](_0x508363,_0x601841,_0x4c90e0);if(_0x3b9608){const _0xddbf40=_0x3b9608['getShapeType'](),_0x5c6d4e=Object[_0x154814(0x119)]({},_0x3b9608[_0x154814(0x129)]()),_0x421c45={'unitId':_0x508363,'subUnitId':_0x601841,'shapeId':_0x4c90e0,'shapeType':_0x28c84e,'shapeData':_0x2ba043},_0x2db446={'unitId':_0x508363,'subUnitId':_0x601841,'shapeId':_0x4c90e0,'shapeType':_0xddbf40,'shapeData':_0x5c6d4e};return _0x38d07b[_0x154814(0x111)]({'id':_0x21b8fb['id'],'params':_0x421c45}),_0x23efe7[_0x154814(0x111)]({'id':_0x21b8fb['id'],'params':_0x2db446}),_0x38d07b[_0x154814(0x135)](_0x27df98=>_0x3fa9da['syncExecuteCommand'](_0x27df98['id'],_0x27df98['params']))&&_0x40f9d5[_0x154814(0x108)]({'unitID':_0x508363,'redoMutations':[..._0x38d07b],'undoMutations':[..._0x23efe7]}),!0x0;}return!0x1;}},_0x4826bf={'id':_0x297a7f(0x12d),'type':_0x2b7f8f['CommandType'][_0x297a7f(0xf7)],'handler':(_0xaa5eaa,_0x412579)=>{const _0x15f87f=_0x297a7f,{unitId:_0x44f7e5,subUnitId:_0x367349,shapeType:_0x323f05,shapeId:_0x56bf9,shapeData:_0x17d59f}=_0x412579;return _0xaa5eaa[_0x15f87f(0xd0)](_0x4ab130[_0x15f87f(0x11f)])[_0x15f87f(0xdd)](_0x44f7e5,_0x367349,_0x323f05,_0x56bf9,_0x17d59f),!0x0;}},_0x21ddb3={'id':'sheet.mutation.remove-shape','type':_0x2b7f8f[_0x297a7f(0xfd)]['MUTATION'],'handler':(_0x1db28b,_0x1da58f)=>{const _0x146de5=_0x297a7f,{unitId:_0x44a80d,subUnitId:_0x287cf1,shapeId:_0x47794d}=_0x1da58f;return _0x1db28b[_0x146de5(0xd0)](_0x4ab130[_0x146de5(0x11f)])[_0x146de5(0x11b)](_0x44a80d,_0x287cf1,_0x47794d),!0x0;}},_0x5b2120={'id':'sheet.mutation.update-shape-data','type':_0x2b7f8f['CommandType'][_0x297a7f(0xf7)],'handler':(_0x38a98e,_0x56d0a2)=>{const _0x3bedcf=_0x297a7f,{unitId:_0x10807c,subUnitId:_0x16a6bf,shapeType:_0x41c0f1,shapeId:_0x4f31e4,shapeData:_0x222cde}=_0x56d0a2,_0x55c8f6=_0x38a98e[_0x3bedcf(0xd0)](_0x4ab130['SheetsShapeServices'])[_0x3bedcf(0x112)](_0x10807c,_0x16a6bf,_0x4f31e4);return _0x55c8f6&&(_0x41c0f1!==void 0x0&&_0x55c8f6['setShapeType'](_0x41c0f1),_0x222cde&&(_0x55c8f6==null||_0x55c8f6['setShapeData'](_0x222cde,!0x0))),!0x0;}},_0x49ce73=_0x297a7f(0x134),_0x206c06={};var _0x5a0e25=Object[_0x297a7f(0x10a)],_0x1b5b47=Object[_0x297a7f(0x12c)],_0x48ff39=(_0x2b3126,_0x4667cd,_0x2372ec)=>_0x4667cd in _0x2b3126?_0x5a0e25(_0x2b3126,_0x4667cd,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2372ec}):_0x2b3126[_0x4667cd]=_0x2372ec,_0x5dbe0f=(_0x8d00e6,_0x42c87c,_0x341c6d,_0x46383a)=>{for(var _0x41f464=_0x46383a>0x1?void 0x0:_0x46383a?_0x1b5b47(_0x42c87c,_0x341c6d):_0x42c87c,_0x4a182c=_0x8d00e6['length']-0x1,_0x4d1ab5;_0x4a182c>=0x0;_0x4a182c--)(_0x4d1ab5=_0x8d00e6[_0x4a182c])&&(_0x41f464=_0x4d1ab5(_0x41f464)||_0x41f464);return _0x41f464;},_0x272674=(_0x25a63a,_0x49fcb4)=>(_0x27a700,_0x2d1817)=>_0x49fcb4(_0x27a700,_0x2d1817,_0x25a63a),_0x3aec7f=(_0x5ec026,_0x3fd318,_0xcaca84)=>_0x48ff39(_0x5ec026,typeof _0x3fd318!=_0x297a7f(0x120)?_0x3fd318+'':_0x3fd318,_0xcaca84);const _0x37131e=_0x297a7f(0x12b);_0x4ab130['UniverSheetsShapePlugin']=class extends _0x2b7f8f[_0x297a7f(0x128)]{constructor(_0x371679=_0x206c06,_0x744bd7,_0x362a23,_0xeb12ae){const _0x247db2=_0x297a7f;super(),this[_0x247db2(0xee)]=_0x371679,this[_0x247db2(0x110)]=_0x744bd7,this[_0x247db2(0x11c)]=_0x362a23,this['_configService']=_0xeb12ae;const {..._0x56607c}=_0x2b7f8f[_0x247db2(0xe0)]({},_0x206c06,this['_config']);this['_configService']['setConfig'](_0x49ce73,_0x56607c),this[_0x247db2(0x109)]();}[_0x297a7f(0x117)](){const _0x1c2c25=_0x297a7f;_0x2b7f8f[_0x1c2c25(0xe3)](this[_0x1c2c25(0x110)],[]);}[_0x297a7f(0x114)](){const _0x1955d8=_0x297a7f,_0x3989aa=this[_0x1955d8(0x110)];[[_0x2b1b1b],[_0x4ab130[_0x1955d8(0x11f)]]][_0x1955d8(0xdc)](_0x520088=>_0x3989aa[_0x1955d8(0xd2)](_0x520088));}['_initCommands'](){[_0x4826bf,_0x21ddb3,_0x21b8fb,_0x5b2120]['forEach'](_0x4c55b4=>this['disposeWithMe'](this['_commandService']['registerCommand'](_0x4c55b4)));}},_0x3aec7f(_0x4ab130[_0x297a7f(0xda)],_0x297a7f(0xed),_0x2b7f8f['UniverInstanceType'][_0x297a7f(0x126)]),_0x3aec7f(_0x4ab130[_0x297a7f(0xda)],_0x297a7f(0x12a),_0x37131e),_0x4ab130[_0x297a7f(0xda)]=_0x5dbe0f([_0x2b7f8f[_0x297a7f(0x123)](_0x3186de[_0x297a7f(0x132)]),_0x272674(0x1,_0x2b7f8f['Inject'](_0x2b7f8f[_0x297a7f(0xef)])),_0x272674(0x2,_0x2b7f8f[_0x297a7f(0x10c)]),_0x272674(0x3,_0x2b7f8f[_0x297a7f(0xd4)])],_0x4ab130[_0x297a7f(0xda)]),_0x4ab130[_0x297a7f(0x12e)]=_0x4826bf,_0x4ab130['RemoveSheetsShapeMutation']=_0x21ddb3,_0x4ab130[_0x297a7f(0x104)]=_0x5b2120,_0x4ab130[_0x297a7f(0xd1)]=_0x5f9682,_0x4ab130['UpdateSheetsShapeTypeMutation']=_0x21b8fb,Object[_0x297a7f(0x10a)](_0x4ab130,Symbol[_0x297a7f(0xe8)],{'value':_0x297a7f(0xf4)});}));
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@univerjs-pro/sheets-shape",
|
|
3
|
+
"version": "0.15.3-insiders.20260131-cbd5fac",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "shape for Univer.",
|
|
6
|
+
"author": "DreamNum <developer@univer.ai>",
|
|
7
|
+
"funding": {
|
|
8
|
+
"type": "opencollective",
|
|
9
|
+
"url": "https://opencollective.com/univer"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://univer.ai",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/dream-num/univer"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/dream-num/univer/issues"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"univer",
|
|
21
|
+
"shape",
|
|
22
|
+
"preset shape",
|
|
23
|
+
"drawing shape",
|
|
24
|
+
"adjust point",
|
|
25
|
+
"connector line"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"import": "./lib/es/index.js",
|
|
30
|
+
"require": "./lib/cjs/index.js",
|
|
31
|
+
"types": "./lib/types/index.d.ts"
|
|
32
|
+
},
|
|
33
|
+
"./*": {
|
|
34
|
+
"import": "./lib/es/*",
|
|
35
|
+
"require": "./lib/cjs/*",
|
|
36
|
+
"types": "./lib/types/index.d.ts"
|
|
37
|
+
},
|
|
38
|
+
"./lib/*": "./lib/*"
|
|
39
|
+
},
|
|
40
|
+
"main": "./lib/es/index.js",
|
|
41
|
+
"module": "./lib/es/index.js",
|
|
42
|
+
"types": "./lib/types/index.d.ts",
|
|
43
|
+
"publishConfig": {
|
|
44
|
+
"access": "public"
|
|
45
|
+
},
|
|
46
|
+
"directories": {
|
|
47
|
+
"lib": "lib"
|
|
48
|
+
},
|
|
49
|
+
"files": [
|
|
50
|
+
"lib"
|
|
51
|
+
],
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": ">=16.0.0",
|
|
54
|
+
"npm": ">=8.0.0"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"rxjs": ">=7.0.0"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@univerjs-pro/engine-shape": "0.15.3-insiders.20260131-cbd5fac",
|
|
61
|
+
"@univerjs/core": "0.15.3-insiders.20260131-cbd5fac",
|
|
62
|
+
"@univerjs-pro/license": "0.15.3-insiders.20260131-cbd5fac"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"rxjs": "7.8.2",
|
|
66
|
+
"typescript": "^5.9.3",
|
|
67
|
+
"vite": "^7.3.1",
|
|
68
|
+
"vitest": "^4.0.18",
|
|
69
|
+
"@univerjs-infra/shared": "0.15.3",
|
|
70
|
+
"@univerjs/sheets": "0.15.3-insiders.20260131-cbd5fac"
|
|
71
|
+
},
|
|
72
|
+
"scripts": {
|
|
73
|
+
"test": "vitest run",
|
|
74
|
+
"test:watch": "vitest",
|
|
75
|
+
"coverage": "vitest run --coverage",
|
|
76
|
+
"typecheck": "tsc --noEmit",
|
|
77
|
+
"build": "univer-cli build"
|
|
78
|
+
}
|
|
79
|
+
}
|