@univerjs/sheets-drawing 0.3.0-alpha.0 → 0.3.0-nightly.202410101606

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 CHANGED
@@ -1 +1 @@
1
- "use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@univerjs/core"),drawing=require("@univerjs/drawing"),PLUGIN_CONFIG_KEY="sheets-drawing.config",defaultPluginConfig={};var SheetDrawingAnchorType=(SheetDrawingAnchorType2=>(SheetDrawingAnchorType2.Position="0",SheetDrawingAnchorType2.Both="1",SheetDrawingAnchorType2.None="2",SheetDrawingAnchorType2))(SheetDrawingAnchorType||{});const _SheetDrawingService=class _SheetDrawingService extends drawing.UnitDrawingService{};__name(_SheetDrawingService,"SheetDrawingService");let SheetDrawingService=_SheetDrawingService;const ISheetDrawingService=core.createIdentifier("sheets-drawing.sheet-drawing.service");var DrawingApplyType=(DrawingApplyType2=>(DrawingApplyType2[DrawingApplyType2.INSERT=0]="INSERT",DrawingApplyType2[DrawingApplyType2.REMOVE=1]="REMOVE",DrawingApplyType2[DrawingApplyType2.UPDATE=2]="UPDATE",DrawingApplyType2[DrawingApplyType2.ARRANGE=3]="ARRANGE",DrawingApplyType2[DrawingApplyType2.GROUP=4]="GROUP",DrawingApplyType2[DrawingApplyType2.UNGROUP=5]="UNGROUP",DrawingApplyType2))(DrawingApplyType||{});const SetDrawingApplyMutation={id:"sheet.mutation.set-drawing-apply",type:core.CommandType.MUTATION,handler:__name((accessor,params)=>{const drawingManagerService=accessor.get(drawing.IDrawingManagerService),sheetDrawingService=accessor.get(ISheetDrawingService),{op,unitId,subUnitId,type,objects}=params;switch(drawingManagerService.applyJson1(unitId,subUnitId,op),sheetDrawingService.applyJson1(unitId,subUnitId,op),type){case 0:drawingManagerService.addNotification(objects),sheetDrawingService.addNotification(objects);break;case 1:drawingManagerService.removeNotification(objects),sheetDrawingService.removeNotification(objects);break;case 2:drawingManagerService.updateNotification(objects),sheetDrawingService.updateNotification(objects);break;case 3:drawingManagerService.orderNotification(objects),sheetDrawingService.orderNotification(objects);break;case 4:drawingManagerService.groupUpdateNotification(objects);break;case 5:drawingManagerService.ungroupUpdateNotification(objects);break}return!0},"handler")};var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1");const SHEET_DRAWING_PLUGIN="SHEET_DRAWING_PLUGIN";var _a;let SheetsDrawingLoadController=(_a=class extends core.Disposable{constructor(_commandService,_sheetDrawingService,_drawingManagerService,_resourceManagerService){super(),this._commandService=_commandService,this._sheetDrawingService=_sheetDrawingService,this._drawingManagerService=_drawingManagerService,this._resourceManagerService=_resourceManagerService,this._initSnapshot(),this.disposeWithMe(this._commandService.registerCommand(SetDrawingApplyMutation))}_initSnapshot(){const toJson=__name((unitId,model)=>{const map=model||this._sheetDrawingService.getDrawingDataForUnit(unitId);return map?JSON.stringify(map):""},"toJson"),parseJson=__name(json=>{if(!json)return{};try{return JSON.parse(json)}catch{return{}}},"parseJson");this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:SHEET_DRAWING_PLUGIN,businesses:[core.UniverInstanceType.UNIVER_SHEET],toJson:__name((unitId,model)=>toJson(unitId,model),"toJson"),parseJson:__name(json=>parseJson(json),"parseJson"),onUnLoad:__name(unitId=>{this._sheetDrawingService.removeDrawingDataForUnit(unitId),this._drawingManagerService.removeDrawingDataForUnit(unitId)},"onUnLoad"),onLoad:__name((unitId,value)=>{this._sheetDrawingService.registerDrawingData(unitId,value),this._drawingManagerService.registerDrawingData(unitId,value)},"onLoad")}))}},__name(_a,"SheetsDrawingLoadController"),_a);SheetsDrawingLoadController=__decorateClass$1([core.OnLifecycle(core.LifecycleStages.Starting,SheetsDrawingLoadController),__decorateParam$1(0,core.ICommandService),__decorateParam$1(1,ISheetDrawingService),__decorateParam$1(2,drawing.IDrawingManagerService),__decorateParam$1(3,core.IResourceManagerService)],SheetsDrawingLoadController);var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__defNormalProp=__name((obj,key,value)=>key in obj?__defProp2(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,"__defNormalProp"),__decorateClass=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),__decorateParam=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam"),__publicField=__name((obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value),"__publicField"),_a2;exports.UniverSheetsDrawingPlugin=(_a2=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_configService){super(),this._config=_config,this._injector=_injector,this._configService=_configService;const{...rest}=this._config;this._configService.setConfig(PLUGIN_CONFIG_KEY,rest)}onStarting(){[[SheetsDrawingLoadController],[ISheetDrawingService,{useClass:SheetDrawingService}]].forEach(dependency=>this._injector.add(dependency))}},__name(_a2,"UniverSheetsDrawingPlugin"),_a2);__publicField(exports.UniverSheetsDrawingPlugin,"pluginName",SHEET_DRAWING_PLUGIN);__publicField(exports.UniverSheetsDrawingPlugin,"type",core.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsDrawingPlugin=__decorateClass([core.DependentOn(drawing.UniverDrawingPlugin),__decorateParam(1,core.Inject(core.Injector)),__decorateParam(2,core.IConfigService)],exports.UniverSheetsDrawingPlugin);exports.DrawingApplyType=DrawingApplyType;exports.ISheetDrawingService=ISheetDrawingService;exports.SHEET_DRAWING_PLUGIN=SHEET_DRAWING_PLUGIN;exports.SetDrawingApplyMutation=SetDrawingApplyMutation;exports.SheetDrawingAnchorType=SheetDrawingAnchorType;
1
+ 'use strict';var _0x28ab99=_0x250c;(function(_0x2443de,_0x5aa6cf){var _0x4f76f4=_0x250c,_0x4e7959=_0x2443de();while(!![]){try{var _0x595979=parseInt(_0x4f76f4(0x187))/0x1*(parseInt(_0x4f76f4(0x152))/0x2)+parseInt(_0x4f76f4(0x195))/0x3+parseInt(_0x4f76f4(0x163))/0x4*(-parseInt(_0x4f76f4(0x18f))/0x5)+parseInt(_0x4f76f4(0x181))/0x6+-parseInt(_0x4f76f4(0x180))/0x7+-parseInt(_0x4f76f4(0x191))/0x8+parseInt(_0x4f76f4(0x157))/0x9;if(_0x595979===_0x5aa6cf)break;else _0x4e7959['push'](_0x4e7959['shift']());}catch(_0x19d104){_0x4e7959['push'](_0x4e7959['shift']());}}}(_0x540e,0xab25e));var __defProp=Object[_0x28ab99(0x161)],__name=(_0x32c503,_0x3d900e)=>__defProp(_0x32c503,_0x28ab99(0x149),{'value':_0x3d900e,'configurable':!0x0});Object['defineProperty'](exports,Symbol[_0x28ab99(0x175)],{'value':_0x28ab99(0x18d)});const core=require(_0x28ab99(0x186)),drawing=require(_0x28ab99(0x167)),PLUGIN_CONFIG_KEY=_0x28ab99(0x184),defaultPluginConfig={};var SheetDrawingAnchorType=(_0xd0ce71=>(_0xd0ce71[_0x28ab99(0x18a)]='0',_0xd0ce71[_0x28ab99(0x159)]='1',_0xd0ce71[_0x28ab99(0x197)]='2',_0xd0ce71))(SheetDrawingAnchorType||{});const _SheetDrawingService=class _SheetDrawingService extends drawing[_0x28ab99(0x16d)]{};__name(_SheetDrawingService,_0x28ab99(0x16b));function _0x250c(_0x54c790,_0xe74b58){var _0x540e3e=_0x540e();return _0x250c=function(_0x250cce,_0x97876b){_0x250cce=_0x250cce-0x145;var _0x2503a5=_0x540e3e[_0x250cce];return _0x2503a5;},_0x250c(_0x54c790,_0xe74b58);}let SheetDrawingService=_SheetDrawingService;const ISheetDrawingService=core['createIdentifier'](_0x28ab99(0x16f));var DrawingApplyType=(_0xdbf117=>(_0xdbf117[_0xdbf117[_0x28ab99(0x162)]=0x0]=_0x28ab99(0x162),_0xdbf117[_0xdbf117[_0x28ab99(0x156)]=0x1]=_0x28ab99(0x156),_0xdbf117[_0xdbf117[_0x28ab99(0x15e)]=0x2]=_0x28ab99(0x15e),_0xdbf117[_0xdbf117[_0x28ab99(0x165)]=0x3]=_0x28ab99(0x165),_0xdbf117[_0xdbf117[_0x28ab99(0x14c)]=0x4]='GROUP',_0xdbf117[_0xdbf117[_0x28ab99(0x172)]=0x5]='UNGROUP',_0xdbf117))(DrawingApplyType||{});const SetDrawingApplyMutation={'id':'sheet.mutation.set-drawing-apply','type':core[_0x28ab99(0x17f)][_0x28ab99(0x173)],'handler':__name((_0x10894e,_0x7ab474)=>{var _0x3571f9=_0x28ab99;const _0x136e07=_0x10894e[_0x3571f9(0x15d)](drawing[_0x3571f9(0x18b)]),_0x33475e=_0x10894e['get'](ISheetDrawingService),{op:_0x253230,unitId:_0x4a3077,subUnitId:_0x68d120,type:_0xc200e4,objects:_0x389cf1}=_0x7ab474;switch(_0x136e07['applyJson1'](_0x4a3077,_0x68d120,_0x253230),_0x33475e[_0x3571f9(0x17c)](_0x4a3077,_0x68d120,_0x253230),_0xc200e4){case 0x0:_0x136e07[_0x3571f9(0x193)](_0x389cf1),_0x33475e[_0x3571f9(0x193)](_0x389cf1);break;case 0x1:_0x136e07['removeNotification'](_0x389cf1),_0x33475e[_0x3571f9(0x14a)](_0x389cf1);break;case 0x2:_0x136e07[_0x3571f9(0x150)](_0x389cf1),_0x33475e['updateNotification'](_0x389cf1);break;case 0x3:_0x136e07[_0x3571f9(0x158)](_0x389cf1),_0x33475e['orderNotification'](_0x389cf1);break;case 0x4:_0x136e07[_0x3571f9(0x16c)](_0x389cf1);break;case 0x5:_0x136e07[_0x3571f9(0x192)](_0x389cf1);break;}return!0x0;},_0x28ab99(0x151))};var __defProp$1=Object[_0x28ab99(0x161)],__getOwnPropDesc$1=Object['getOwnPropertyDescriptor'],__decorateClass$1=__name((_0x2417c4,_0x5d9afd,_0x22f2a3,_0x1068c5)=>{var _0x23f5b2=_0x28ab99;for(var _0x7cd5fe=_0x1068c5>0x1?void 0x0:_0x1068c5?__getOwnPropDesc$1(_0x5d9afd,_0x22f2a3):_0x5d9afd,_0x45768a=_0x2417c4[_0x23f5b2(0x18e)]-0x1,_0x1462be;_0x45768a>=0x0;_0x45768a--)(_0x1462be=_0x2417c4[_0x45768a])&&(_0x7cd5fe=(_0x1068c5?_0x1462be(_0x5d9afd,_0x22f2a3,_0x7cd5fe):_0x1462be(_0x7cd5fe))||_0x7cd5fe);return _0x1068c5&&_0x7cd5fe&&__defProp$1(_0x5d9afd,_0x22f2a3,_0x7cd5fe),_0x7cd5fe;},'__decorateClass$1'),__decorateParam$1=__name((_0x40f60e,_0x437244)=>(_0x256609,_0x5c737f)=>_0x437244(_0x256609,_0x5c737f,_0x40f60e),_0x28ab99(0x146));const SHEET_DRAWING_PLUGIN='SHEET_DRAWING_PLUGIN';var _a;let SheetsDrawingLoadController=(_a=class extends core[_0x28ab99(0x154)]{constructor(_0x4f92a0,_0x476048,_0x575cc5,_0x2a4408){var _0x57a9be=_0x28ab99;super(),this[_0x57a9be(0x174)]=_0x4f92a0,this[_0x57a9be(0x185)]=_0x476048,this[_0x57a9be(0x17e)]=_0x575cc5,this['_resourceManagerService']=_0x2a4408,this[_0x57a9be(0x164)](),this[_0x57a9be(0x14e)](this[_0x57a9be(0x174)][_0x57a9be(0x18c)](SetDrawingApplyMutation));}[_0x28ab99(0x164)](){var _0x41d900=_0x28ab99;const _0x122d8a=__name((_0x39295d,_0x36d73e)=>{var _0x3cdda0=_0x250c;const _0x53ec83=_0x36d73e||this[_0x3cdda0(0x185)][_0x3cdda0(0x179)](_0x39295d);return _0x53ec83?JSON['stringify'](_0x53ec83):'';},_0x41d900(0x15c)),_0xcc6fc0=__name(_0x4c5cde=>{if(!_0x4c5cde)return{};try{return JSON['parse'](_0x4c5cde);}catch{return{};}},_0x41d900(0x188));this[_0x41d900(0x14e)](this[_0x41d900(0x171)][_0x41d900(0x147)]({'pluginName':SHEET_DRAWING_PLUGIN,'businesses':[core[_0x41d900(0x160)][_0x41d900(0x166)]],'toJson':__name((_0x3b56d4,_0x50fbb4)=>_0x122d8a(_0x3b56d4,_0x50fbb4),_0x41d900(0x15c)),'parseJson':__name(_0x2b7043=>_0xcc6fc0(_0x2b7043),_0x41d900(0x188)),'onUnLoad':__name(_0x55b922=>{var _0x310f22=_0x41d900;this[_0x310f22(0x185)][_0x310f22(0x183)](_0x55b922),this[_0x310f22(0x17e)][_0x310f22(0x183)](_0x55b922);},_0x41d900(0x15f)),'onLoad':__name((_0xbdccf1,_0x45392f)=>{var _0x1f04e1=_0x41d900;this['_sheetDrawingService'][_0x1f04e1(0x16a)](_0xbdccf1,_0x45392f),this['_drawingManagerService'][_0x1f04e1(0x16a)](_0xbdccf1,_0x45392f);},'onLoad')}));}},__name(_a,_0x28ab99(0x170)),_a);function _0x540e(){var _0x4ffcd6=['Position','IDrawingManagerService','registerCommand','Module','length','5ELNETT','DependentOn','3332256UqfNaX','ungroupUpdateNotification','addNotification','IConfigService','1157331llFuVm','_injector','None','SHEET_DRAWING_PLUGIN','__decorateParam$1','registerPluginResource','Inject','name','removeNotification','onStarting','GROUP','add','disposeWithMe','ICommandService','updateNotification','handler','18ftjLFG','__publicField','Disposable','DrawingApplyType','REMOVE','9409428duysJv','orderNotification','Both','SetDrawingApplyMutation','__decorateParam','toJson','get','UPDATE','onUnLoad','UniverInstanceType','defineProperty','INSERT','4723644stXRxm','_initSnapshot','ARRANGE','UNIVER_SHEET','@univerjs/drawing','UniverDrawingPlugin','ISheetDrawingService','registerDrawingData','SheetDrawingService','groupUpdateNotification','UnitDrawingService','Plugin','sheets-drawing.sheet-drawing.service','SheetsDrawingLoadController','_resourceManagerService','UNGROUP','MUTATION','_commandService','toStringTag','IResourceManagerService','Injector','__defNormalProp','getDrawingDataForUnit','forEach','SheetDrawingAnchorType','applyJson1','_config','_drawingManagerService','CommandType','5459601WlSRNC','5258112jiJKeI','UniverSheetsDrawingPlugin','removeDrawingDataForUnit','sheets-drawing.config','_sheetDrawingService','@univerjs/core','85643PKUenM','parseJson','pluginName'];_0x540e=function(){return _0x4ffcd6;};return _0x540e();}SheetsDrawingLoadController=__decorateClass$1([__decorateParam$1(0x0,core[_0x28ab99(0x14f)]),__decorateParam$1(0x1,ISheetDrawingService),__decorateParam$1(0x2,drawing[_0x28ab99(0x18b)]),__decorateParam$1(0x3,core[_0x28ab99(0x176)])],SheetsDrawingLoadController);var __defProp2=Object[_0x28ab99(0x161)],__getOwnPropDesc=Object['getOwnPropertyDescriptor'],__defNormalProp=__name((_0x3d9f06,_0x1d18d5,_0x2edf09)=>_0x1d18d5 in _0x3d9f06?__defProp2(_0x3d9f06,_0x1d18d5,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x2edf09}):_0x3d9f06[_0x1d18d5]=_0x2edf09,_0x28ab99(0x178)),__decorateClass=__name((_0x3d0eeb,_0x252fbd,_0x117e44,_0xe71d37)=>{var _0xa2eefe=_0x28ab99;for(var _0x3c14d7=_0xe71d37>0x1?void 0x0:_0xe71d37?__getOwnPropDesc(_0x252fbd,_0x117e44):_0x252fbd,_0x4dd1b7=_0x3d0eeb[_0xa2eefe(0x18e)]-0x1,_0x5adad2;_0x4dd1b7>=0x0;_0x4dd1b7--)(_0x5adad2=_0x3d0eeb[_0x4dd1b7])&&(_0x3c14d7=(_0xe71d37?_0x5adad2(_0x252fbd,_0x117e44,_0x3c14d7):_0x5adad2(_0x3c14d7))||_0x3c14d7);return _0xe71d37&&_0x3c14d7&&__defProp2(_0x252fbd,_0x117e44,_0x3c14d7),_0x3c14d7;},'__decorateClass'),__decorateParam=__name((_0x3b1e9b,_0x57ea0c)=>(_0x1152e5,_0xf30921)=>_0x57ea0c(_0x1152e5,_0xf30921,_0x3b1e9b),_0x28ab99(0x15b)),__publicField=__name((_0x12b476,_0x46b4f3,_0x1b0dc3)=>__defNormalProp(_0x12b476,typeof _0x46b4f3!='symbol'?_0x46b4f3+'':_0x46b4f3,_0x1b0dc3),_0x28ab99(0x153)),_a2;exports[_0x28ab99(0x182)]=(_a2=class extends core[_0x28ab99(0x16e)]{constructor(_0x46fcb0=defaultPluginConfig,_0x50c435,_0x1bdfeb){var _0x39e33c=_0x28ab99;super(),this[_0x39e33c(0x17d)]=_0x46fcb0,this[_0x39e33c(0x196)]=_0x50c435,this['_configService']=_0x1bdfeb;const {..._0x5b5545}=this[_0x39e33c(0x17d)];this['_configService']['setConfig'](PLUGIN_CONFIG_KEY,_0x5b5545);}[_0x28ab99(0x14b)](){var _0x8b8477=_0x28ab99;[[SheetsDrawingLoadController],[ISheetDrawingService,{'useClass':SheetDrawingService}]][_0x8b8477(0x17a)](_0xbc39ad=>this[_0x8b8477(0x196)][_0x8b8477(0x14d)](_0xbc39ad)),this[_0x8b8477(0x196)]['get'](SheetsDrawingLoadController);}},__name(_a2,_0x28ab99(0x182)),_a2),__publicField(exports[_0x28ab99(0x182)],_0x28ab99(0x189),SHEET_DRAWING_PLUGIN),__publicField(exports[_0x28ab99(0x182)],'type',core['UniverInstanceType'][_0x28ab99(0x166)]),exports['UniverSheetsDrawingPlugin']=__decorateClass([core[_0x28ab99(0x190)](drawing[_0x28ab99(0x168)]),__decorateParam(0x1,core[_0x28ab99(0x148)](core[_0x28ab99(0x177)])),__decorateParam(0x2,core[_0x28ab99(0x194)])],exports[_0x28ab99(0x182)]),exports[_0x28ab99(0x155)]=DrawingApplyType,exports[_0x28ab99(0x169)]=ISheetDrawingService,exports[_0x28ab99(0x145)]=SHEET_DRAWING_PLUGIN,exports[_0x28ab99(0x15a)]=SetDrawingApplyMutation,exports[_0x28ab99(0x17b)]=SheetDrawingAnchorType;
package/lib/es/index.js CHANGED
@@ -1,120 +1 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
3
- import { createIdentifier, CommandType, OnLifecycle, LifecycleStages, Disposable, UniverInstanceType, ICommandService, IResourceManagerService, DependentOn, Inject, Injector, Plugin, IConfigService } from "@univerjs/core";
4
- import { UnitDrawingService, IDrawingManagerService, UniverDrawingPlugin } from "@univerjs/drawing";
5
- const PLUGIN_CONFIG_KEY = "sheets-drawing.config", defaultPluginConfig = {};
6
- var SheetDrawingAnchorType = /* @__PURE__ */ ((SheetDrawingAnchorType2) => (SheetDrawingAnchorType2.Position = "0", SheetDrawingAnchorType2.Both = "1", SheetDrawingAnchorType2.None = "2", SheetDrawingAnchorType2))(SheetDrawingAnchorType || {});
7
- const _SheetDrawingService = class _SheetDrawingService extends UnitDrawingService {
8
- };
9
- __name(_SheetDrawingService, "SheetDrawingService");
10
- let SheetDrawingService = _SheetDrawingService;
11
- const ISheetDrawingService = createIdentifier("sheets-drawing.sheet-drawing.service");
12
- var DrawingApplyType = /* @__PURE__ */ ((DrawingApplyType2) => (DrawingApplyType2[DrawingApplyType2.INSERT = 0] = "INSERT", DrawingApplyType2[DrawingApplyType2.REMOVE = 1] = "REMOVE", DrawingApplyType2[DrawingApplyType2.UPDATE = 2] = "UPDATE", DrawingApplyType2[DrawingApplyType2.ARRANGE = 3] = "ARRANGE", DrawingApplyType2[DrawingApplyType2.GROUP = 4] = "GROUP", DrawingApplyType2[DrawingApplyType2.UNGROUP = 5] = "UNGROUP", DrawingApplyType2))(DrawingApplyType || {});
13
- const SetDrawingApplyMutation = {
14
- id: "sheet.mutation.set-drawing-apply",
15
- type: CommandType.MUTATION,
16
- handler: /* @__PURE__ */ __name((accessor, params) => {
17
- const drawingManagerService = accessor.get(IDrawingManagerService), sheetDrawingService = accessor.get(ISheetDrawingService), { op, unitId, subUnitId, type, objects } = params;
18
- switch (drawingManagerService.applyJson1(unitId, subUnitId, op), sheetDrawingService.applyJson1(unitId, subUnitId, op), type) {
19
- case 0:
20
- drawingManagerService.addNotification(objects), sheetDrawingService.addNotification(objects);
21
- break;
22
- case 1:
23
- drawingManagerService.removeNotification(objects), sheetDrawingService.removeNotification(objects);
24
- break;
25
- case 2:
26
- drawingManagerService.updateNotification(objects), sheetDrawingService.updateNotification(objects);
27
- break;
28
- case 3:
29
- drawingManagerService.orderNotification(objects), sheetDrawingService.orderNotification(objects);
30
- break;
31
- case 4:
32
- drawingManagerService.groupUpdateNotification(objects);
33
- break;
34
- case 5:
35
- drawingManagerService.ungroupUpdateNotification(objects);
36
- break;
37
- }
38
- return !0;
39
- }, "handler")
40
- };
41
- var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
42
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
43
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
44
- return kind && result && __defProp$1(target, key, result), result;
45
- }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam$1");
46
- const SHEET_DRAWING_PLUGIN = "SHEET_DRAWING_PLUGIN";
47
- var _a;
48
- let SheetsDrawingLoadController = (_a = class extends Disposable {
49
- constructor(_commandService, _sheetDrawingService, _drawingManagerService, _resourceManagerService) {
50
- super(), this._commandService = _commandService, this._sheetDrawingService = _sheetDrawingService, this._drawingManagerService = _drawingManagerService, this._resourceManagerService = _resourceManagerService, this._initSnapshot(), this.disposeWithMe(this._commandService.registerCommand(SetDrawingApplyMutation));
51
- }
52
- _initSnapshot() {
53
- const toJson = /* @__PURE__ */ __name((unitId, model) => {
54
- const map = model || this._sheetDrawingService.getDrawingDataForUnit(unitId);
55
- return map ? JSON.stringify(map) : "";
56
- }, "toJson"), parseJson = /* @__PURE__ */ __name((json) => {
57
- if (!json)
58
- return {};
59
- try {
60
- return JSON.parse(json);
61
- } catch {
62
- return {};
63
- }
64
- }, "parseJson");
65
- this.disposeWithMe(
66
- this._resourceManagerService.registerPluginResource({
67
- pluginName: SHEET_DRAWING_PLUGIN,
68
- businesses: [UniverInstanceType.UNIVER_SHEET],
69
- toJson: /* @__PURE__ */ __name((unitId, model) => toJson(unitId, model), "toJson"),
70
- parseJson: /* @__PURE__ */ __name((json) => parseJson(json), "parseJson"),
71
- onUnLoad: /* @__PURE__ */ __name((unitId) => {
72
- this._sheetDrawingService.removeDrawingDataForUnit(unitId), this._drawingManagerService.removeDrawingDataForUnit(unitId);
73
- }, "onUnLoad"),
74
- onLoad: /* @__PURE__ */ __name((unitId, value) => {
75
- this._sheetDrawingService.registerDrawingData(unitId, value), this._drawingManagerService.registerDrawingData(unitId, value);
76
- }, "onLoad")
77
- })
78
- );
79
- }
80
- }, __name(_a, "SheetsDrawingLoadController"), _a);
81
- SheetsDrawingLoadController = __decorateClass$1([
82
- OnLifecycle(LifecycleStages.Starting, SheetsDrawingLoadController),
83
- __decorateParam$1(0, ICommandService),
84
- __decorateParam$1(1, ISheetDrawingService),
85
- __decorateParam$1(2, IDrawingManagerService),
86
- __decorateParam$1(3, IResourceManagerService)
87
- ], SheetsDrawingLoadController);
88
- var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __defNormalProp = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, "__defNormalProp"), __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
89
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
90
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
91
- return kind && result && __defProp2(target, key, result), result;
92
- }, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index, decorator) => (target, key) => decorator(target, key, index), "__decorateParam"), __publicField = /* @__PURE__ */ __name((obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value), "__publicField"), _a2;
93
- let UniverSheetsDrawingPlugin = (_a2 = class extends Plugin {
94
- constructor(_config = defaultPluginConfig, _injector, _configService) {
95
- super(), this._config = _config, this._injector = _injector, this._configService = _configService;
96
- const { ...rest } = this._config;
97
- this._configService.setConfig(PLUGIN_CONFIG_KEY, rest);
98
- }
99
- onStarting() {
100
- [
101
- [SheetsDrawingLoadController],
102
- [ISheetDrawingService, { useClass: SheetDrawingService }]
103
- ].forEach((dependency) => this._injector.add(dependency));
104
- }
105
- }, __name(_a2, "UniverSheetsDrawingPlugin"), _a2);
106
- __publicField(UniverSheetsDrawingPlugin, "pluginName", SHEET_DRAWING_PLUGIN);
107
- __publicField(UniverSheetsDrawingPlugin, "type", UniverInstanceType.UNIVER_SHEET);
108
- UniverSheetsDrawingPlugin = __decorateClass([
109
- DependentOn(UniverDrawingPlugin),
110
- __decorateParam(1, Inject(Injector)),
111
- __decorateParam(2, IConfigService)
112
- ], UniverSheetsDrawingPlugin);
113
- export {
114
- DrawingApplyType,
115
- ISheetDrawingService,
116
- SHEET_DRAWING_PLUGIN,
117
- SetDrawingApplyMutation,
118
- SheetDrawingAnchorType,
119
- UniverSheetsDrawingPlugin
120
- };
1
+ var _0xf8547b=_0x21e1;(function(_0x127ef2,_0x467f16){var _0x4e1c49=_0x21e1,_0xfb5fbd=_0x127ef2();while(!![]){try{var _0x575b0a=-parseInt(_0x4e1c49(0xdb))/0x1*(-parseInt(_0x4e1c49(0xed))/0x2)+parseInt(_0x4e1c49(0xe8))/0x3+-parseInt(_0x4e1c49(0xf9))/0x4*(-parseInt(_0x4e1c49(0xfd))/0x5)+parseInt(_0x4e1c49(0xd5))/0x6*(-parseInt(_0x4e1c49(0xe2))/0x7)+parseInt(_0x4e1c49(0xec))/0x8+-parseInt(_0x4e1c49(0xe6))/0x9+parseInt(_0x4e1c49(0xc8))/0xa*(parseInt(_0x4e1c49(0xfa))/0xb);if(_0x575b0a===_0x467f16)break;else _0xfb5fbd['push'](_0xfb5fbd['shift']());}catch(_0x1748c0){_0xfb5fbd['push'](_0xfb5fbd['shift']());}}}(_0x3e21,0xafa2e));var __defProp=Object[_0xf8547b(0xee)],__name=(_0x1da347,_0x1b2339)=>__defProp(_0x1da347,_0xf8547b(0xf2),{'value':_0x1b2339,'configurable':!0x0});import{createIdentifier,CommandType,Disposable,UniverInstanceType,ICommandService,IResourceManagerService,DependentOn,Inject,Injector,Plugin,IConfigService}from'@univerjs/core';import{UnitDrawingService,IDrawingManagerService,UniverDrawingPlugin}from'@univerjs/drawing';const PLUGIN_CONFIG_KEY=_0xf8547b(0xdc),defaultPluginConfig={};var SheetDrawingAnchorType=(_0x490f0f=>(_0x490f0f[_0xf8547b(0xe3)]='0',_0x490f0f[_0xf8547b(0xcb)]='1',_0x490f0f[_0xf8547b(0xde)]='2',_0x490f0f))(SheetDrawingAnchorType||{});function _0x3e21(){var _0x328876=['disposeWithMe','__decorateClass','UniverSheetsDrawingPlugin','sheets-drawing.sheet-drawing.service','length','forEach','toJson','applyJson1','orderNotification','SheetsDrawingLoadController','_sheetDrawingService','getOwnPropertyDescriptor','473740qRqTeF','__decorateParam$1','removeDrawingDataForUnit','Both','registerDrawingData','sheet.mutation.set-drawing-apply','ARRANGE','type','parseJson','INSERT','parse','UPDATE','getDrawingDataForUnit','6KalOVB','_injector','groupUpdateNotification','_drawingManagerService','UNGROUP','_initSnapshot','11474huQoJo','sheets-drawing.config','MUTATION','None','_configService','_commandService','GROUP','8628914cTyDMt','Position','addNotification','SheetDrawingService','9576468eGhQtP','__decorateParam','1809018BSfFtP','__decorateClass$1','REMOVE','stringify','843960HslROs','24ShbRks','defineProperty','SHEET_DRAWING_PLUGIN','get','registerPluginResource','name','updateNotification','UNIVER_SHEET','__publicField','symbol','removeNotification','onUnLoad','4hCpaWt','385ivXzzu','onStarting','_resourceManagerService','2559405WOdAdH','handler','setConfig','_config'];_0x3e21=function(){return _0x328876;};return _0x3e21();}const _SheetDrawingService=class _SheetDrawingService extends UnitDrawingService{};__name(_SheetDrawingService,_0xf8547b(0xe5));function _0x21e1(_0x39d2fb,_0x2d0bb9){var _0x3e2119=_0x3e21();return _0x21e1=function(_0x21e1e3,_0x17b451){_0x21e1e3=_0x21e1e3-0xbc;var _0x164e77=_0x3e2119[_0x21e1e3];return _0x164e77;},_0x21e1(_0x39d2fb,_0x2d0bb9);}let SheetDrawingService=_SheetDrawingService;const ISheetDrawingService=createIdentifier(_0xf8547b(0xbf));var DrawingApplyType=(_0x5ec310=>(_0x5ec310[_0x5ec310[_0xf8547b(0xd1)]=0x0]=_0xf8547b(0xd1),_0x5ec310[_0x5ec310[_0xf8547b(0xea)]=0x1]=_0xf8547b(0xea),_0x5ec310[_0x5ec310[_0xf8547b(0xd3)]=0x2]=_0xf8547b(0xd3),_0x5ec310[_0x5ec310[_0xf8547b(0xce)]=0x3]='ARRANGE',_0x5ec310[_0x5ec310[_0xf8547b(0xe1)]=0x4]=_0xf8547b(0xe1),_0x5ec310[_0x5ec310[_0xf8547b(0xd9)]=0x5]=_0xf8547b(0xd9),_0x5ec310))(DrawingApplyType||{});const SetDrawingApplyMutation={'id':_0xf8547b(0xcd),'type':CommandType[_0xf8547b(0xdd)],'handler':__name((_0x41c458,_0x370913)=>{var _0x1501b3=_0xf8547b;const _0x40df=_0x41c458['get'](IDrawingManagerService),_0x3f195c=_0x41c458[_0x1501b3(0xf0)](ISheetDrawingService),{op:_0x39e816,unitId:_0x3caf19,subUnitId:_0x551cb6,type:_0x291f34,objects:_0x51c75c}=_0x370913;switch(_0x40df[_0x1501b3(0xc3)](_0x3caf19,_0x551cb6,_0x39e816),_0x3f195c['applyJson1'](_0x3caf19,_0x551cb6,_0x39e816),_0x291f34){case 0x0:_0x40df[_0x1501b3(0xe4)](_0x51c75c),_0x3f195c[_0x1501b3(0xe4)](_0x51c75c);break;case 0x1:_0x40df[_0x1501b3(0xf7)](_0x51c75c),_0x3f195c[_0x1501b3(0xf7)](_0x51c75c);break;case 0x2:_0x40df[_0x1501b3(0xf3)](_0x51c75c),_0x3f195c['updateNotification'](_0x51c75c);break;case 0x3:_0x40df[_0x1501b3(0xc4)](_0x51c75c),_0x3f195c[_0x1501b3(0xc4)](_0x51c75c);break;case 0x4:_0x40df[_0x1501b3(0xd7)](_0x51c75c);break;case 0x5:_0x40df['ungroupUpdateNotification'](_0x51c75c);break;}return!0x0;},_0xf8547b(0xfe))};var __defProp$1=Object[_0xf8547b(0xee)],__getOwnPropDesc$1=Object[_0xf8547b(0xc7)],__decorateClass$1=__name((_0x18c7ef,_0xe79c4,_0x59e995,_0x114f9b)=>{var _0x30a5b9=_0xf8547b;for(var _0x8a2262=_0x114f9b>0x1?void 0x0:_0x114f9b?__getOwnPropDesc$1(_0xe79c4,_0x59e995):_0xe79c4,_0x51a731=_0x18c7ef[_0x30a5b9(0xc0)]-0x1,_0x1eea46;_0x51a731>=0x0;_0x51a731--)(_0x1eea46=_0x18c7ef[_0x51a731])&&(_0x8a2262=(_0x114f9b?_0x1eea46(_0xe79c4,_0x59e995,_0x8a2262):_0x1eea46(_0x8a2262))||_0x8a2262);return _0x114f9b&&_0x8a2262&&__defProp$1(_0xe79c4,_0x59e995,_0x8a2262),_0x8a2262;},_0xf8547b(0xe9)),__decorateParam$1=__name((_0x5bd26e,_0x51ff4a)=>(_0x4da0e1,_0x4373eb)=>_0x51ff4a(_0x4da0e1,_0x4373eb,_0x5bd26e),_0xf8547b(0xc9));const SHEET_DRAWING_PLUGIN=_0xf8547b(0xef);var _a;let SheetsDrawingLoadController=(_a=class extends Disposable{constructor(_0x3b2743,_0x1d2336,_0x28c87b,_0x35b393){var _0x643f27=_0xf8547b;super(),this[_0x643f27(0xe0)]=_0x3b2743,this['_sheetDrawingService']=_0x1d2336,this[_0x643f27(0xd8)]=_0x28c87b,this[_0x643f27(0xfc)]=_0x35b393,this[_0x643f27(0xda)](),this[_0x643f27(0xbc)](this['_commandService']['registerCommand'](SetDrawingApplyMutation));}[_0xf8547b(0xda)](){var _0x263e89=_0xf8547b;const _0x11c765=__name((_0x3ff4b9,_0x449353)=>{var _0x49742d=_0x21e1;const _0x15ebed=_0x449353||this[_0x49742d(0xc6)][_0x49742d(0xd4)](_0x3ff4b9);return _0x15ebed?JSON[_0x49742d(0xeb)](_0x15ebed):'';},_0x263e89(0xc2)),_0x3fb81e=__name(_0x2f21a5=>{var _0x36e193=_0x263e89;if(!_0x2f21a5)return{};try{return JSON[_0x36e193(0xd2)](_0x2f21a5);}catch{return{};}},_0x263e89(0xd0));this['disposeWithMe'](this[_0x263e89(0xfc)][_0x263e89(0xf1)]({'pluginName':SHEET_DRAWING_PLUGIN,'businesses':[UniverInstanceType[_0x263e89(0xf4)]],'toJson':__name((_0xa7b4b5,_0x5c1d0e)=>_0x11c765(_0xa7b4b5,_0x5c1d0e),'toJson'),'parseJson':__name(_0x44c77b=>_0x3fb81e(_0x44c77b),_0x263e89(0xd0)),'onUnLoad':__name(_0x3ec7ce=>{var _0x54adb2=_0x263e89;this['_sheetDrawingService'][_0x54adb2(0xca)](_0x3ec7ce),this[_0x54adb2(0xd8)][_0x54adb2(0xca)](_0x3ec7ce);},_0x263e89(0xf8)),'onLoad':__name((_0x11a5d6,_0x127bf8)=>{var _0x535843=_0x263e89;this['_sheetDrawingService'][_0x535843(0xcc)](_0x11a5d6,_0x127bf8),this[_0x535843(0xd8)][_0x535843(0xcc)](_0x11a5d6,_0x127bf8);},'onLoad')}));}},__name(_a,_0xf8547b(0xc5)),_a);SheetsDrawingLoadController=__decorateClass$1([__decorateParam$1(0x0,ICommandService),__decorateParam$1(0x1,ISheetDrawingService),__decorateParam$1(0x2,IDrawingManagerService),__decorateParam$1(0x3,IResourceManagerService)],SheetsDrawingLoadController);var __defProp2=Object['defineProperty'],__getOwnPropDesc=Object[_0xf8547b(0xc7)],__defNormalProp=__name((_0x3b5968,_0x1a7355,_0x147a97)=>_0x1a7355 in _0x3b5968?__defProp2(_0x3b5968,_0x1a7355,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x147a97}):_0x3b5968[_0x1a7355]=_0x147a97,'__defNormalProp'),__decorateClass=__name((_0x499413,_0x5db482,_0x1119a2,_0x291c23)=>{var _0x7c507a=_0xf8547b;for(var _0x210dff=_0x291c23>0x1?void 0x0:_0x291c23?__getOwnPropDesc(_0x5db482,_0x1119a2):_0x5db482,_0x3be5b6=_0x499413[_0x7c507a(0xc0)]-0x1,_0xfe30f7;_0x3be5b6>=0x0;_0x3be5b6--)(_0xfe30f7=_0x499413[_0x3be5b6])&&(_0x210dff=(_0x291c23?_0xfe30f7(_0x5db482,_0x1119a2,_0x210dff):_0xfe30f7(_0x210dff))||_0x210dff);return _0x291c23&&_0x210dff&&__defProp2(_0x5db482,_0x1119a2,_0x210dff),_0x210dff;},_0xf8547b(0xbd)),__decorateParam=__name((_0x290c5c,_0x1b4676)=>(_0x1fb3f3,_0x220794)=>_0x1b4676(_0x1fb3f3,_0x220794,_0x290c5c),_0xf8547b(0xe7)),__publicField=__name((_0xb45951,_0x1891f9,_0x1db435)=>__defNormalProp(_0xb45951,typeof _0x1891f9!=_0xf8547b(0xf6)?_0x1891f9+'':_0x1891f9,_0x1db435),_0xf8547b(0xf5)),_a2;let UniverSheetsDrawingPlugin=(_a2=class extends Plugin{constructor(_0x533811=defaultPluginConfig,_0x4a9cfa,_0x673927){var _0x6f1409=_0xf8547b;super(),this[_0x6f1409(0x100)]=_0x533811,this[_0x6f1409(0xd6)]=_0x4a9cfa,this['_configService']=_0x673927;const {..._0x3dc427}=this[_0x6f1409(0x100)];this[_0x6f1409(0xdf)][_0x6f1409(0xff)](PLUGIN_CONFIG_KEY,_0x3dc427);}[_0xf8547b(0xfb)](){var _0x3c831f=_0xf8547b;[[SheetsDrawingLoadController],[ISheetDrawingService,{'useClass':SheetDrawingService}]][_0x3c831f(0xc1)](_0x578c44=>this[_0x3c831f(0xd6)]['add'](_0x578c44)),this[_0x3c831f(0xd6)][_0x3c831f(0xf0)](SheetsDrawingLoadController);}},__name(_a2,_0xf8547b(0xbe)),_a2);__publicField(UniverSheetsDrawingPlugin,'pluginName',SHEET_DRAWING_PLUGIN),__publicField(UniverSheetsDrawingPlugin,_0xf8547b(0xcf),UniverInstanceType['UNIVER_SHEET']),UniverSheetsDrawingPlugin=__decorateClass([DependentOn(UniverDrawingPlugin),__decorateParam(0x1,Inject(Injector)),__decorateParam(0x2,IConfigService)],UniverSheetsDrawingPlugin);export{DrawingApplyType,ISheetDrawingService,SHEET_DRAWING_PLUGIN,SetDrawingApplyMutation,SheetDrawingAnchorType,UniverSheetsDrawingPlugin};
@@ -1,5 +1,5 @@
1
- import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
2
1
  import { IUniverSheetsDrawingConfig } from './controllers/config.schema';
2
+ import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
3
3
  export declare class UniverSheetsDrawingPlugin extends Plugin {
4
4
  private readonly _config;
5
5
  readonly _injector: Injector;
package/lib/umd/index.js CHANGED
@@ -1 +1 @@
1
- (function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@univerjs/core"),require("@univerjs/drawing")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/drawing"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global.UniverSheetsDrawing={},global.UniverCore,global.UniverDrawing))})(this,function(exports2,core,drawing){"use strict";var __defProp=Object.defineProperty;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var _a,_b;const PLUGIN_CONFIG_KEY="sheets-drawing.config",defaultPluginConfig={};var SheetDrawingAnchorType=(SheetDrawingAnchorType2=>(SheetDrawingAnchorType2.Position="0",SheetDrawingAnchorType2.Both="1",SheetDrawingAnchorType2.None="2",SheetDrawingAnchorType2))(SheetDrawingAnchorType||{});const _SheetDrawingService=class _SheetDrawingService extends drawing.UnitDrawingService{};__name(_SheetDrawingService,"SheetDrawingService");let SheetDrawingService=_SheetDrawingService;const ISheetDrawingService=core.createIdentifier("sheets-drawing.sheet-drawing.service");var DrawingApplyType=(DrawingApplyType2=>(DrawingApplyType2[DrawingApplyType2.INSERT=0]="INSERT",DrawingApplyType2[DrawingApplyType2.REMOVE=1]="REMOVE",DrawingApplyType2[DrawingApplyType2.UPDATE=2]="UPDATE",DrawingApplyType2[DrawingApplyType2.ARRANGE=3]="ARRANGE",DrawingApplyType2[DrawingApplyType2.GROUP=4]="GROUP",DrawingApplyType2[DrawingApplyType2.UNGROUP=5]="UNGROUP",DrawingApplyType2))(DrawingApplyType||{});const SetDrawingApplyMutation={id:"sheet.mutation.set-drawing-apply",type:core.CommandType.MUTATION,handler:__name((accessor,params)=>{const drawingManagerService=accessor.get(drawing.IDrawingManagerService),sheetDrawingService=accessor.get(ISheetDrawingService),{op,unitId,subUnitId,type,objects}=params;switch(drawingManagerService.applyJson1(unitId,subUnitId,op),sheetDrawingService.applyJson1(unitId,subUnitId,op),type){case 0:drawingManagerService.addNotification(objects),sheetDrawingService.addNotification(objects);break;case 1:drawingManagerService.removeNotification(objects),sheetDrawingService.removeNotification(objects);break;case 2:drawingManagerService.updateNotification(objects),sheetDrawingService.updateNotification(objects);break;case 3:drawingManagerService.orderNotification(objects),sheetDrawingService.orderNotification(objects);break;case 4:drawingManagerService.groupUpdateNotification(objects);break;case 5:drawingManagerService.ungroupUpdateNotification(objects);break}return!0},"handler")};var __defProp$1=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$1=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc$1(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp$1(target,key,result),result},"__decorateClass$1"),__decorateParam$1=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam$1");const SHEET_DRAWING_PLUGIN="SHEET_DRAWING_PLUGIN";let SheetsDrawingLoadController=(_a=class extends core.Disposable{constructor(_commandService,_sheetDrawingService,_drawingManagerService,_resourceManagerService){super(),this._commandService=_commandService,this._sheetDrawingService=_sheetDrawingService,this._drawingManagerService=_drawingManagerService,this._resourceManagerService=_resourceManagerService,this._initSnapshot(),this.disposeWithMe(this._commandService.registerCommand(SetDrawingApplyMutation))}_initSnapshot(){const toJson=__name((unitId,model)=>{const map=model||this._sheetDrawingService.getDrawingDataForUnit(unitId);return map?JSON.stringify(map):""},"toJson"),parseJson=__name(json=>{if(!json)return{};try{return JSON.parse(json)}catch{return{}}},"parseJson");this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:SHEET_DRAWING_PLUGIN,businesses:[core.UniverInstanceType.UNIVER_SHEET],toJson:__name((unitId,model)=>toJson(unitId,model),"toJson"),parseJson:__name(json=>parseJson(json),"parseJson"),onUnLoad:__name(unitId=>{this._sheetDrawingService.removeDrawingDataForUnit(unitId),this._drawingManagerService.removeDrawingDataForUnit(unitId)},"onUnLoad"),onLoad:__name((unitId,value)=>{this._sheetDrawingService.registerDrawingData(unitId,value),this._drawingManagerService.registerDrawingData(unitId,value)},"onLoad")}))}},__name(_a,"SheetsDrawingLoadController"),_a);SheetsDrawingLoadController=__decorateClass$1([core.OnLifecycle(core.LifecycleStages.Starting,SheetsDrawingLoadController),__decorateParam$1(0,core.ICommandService),__decorateParam$1(1,ISheetDrawingService),__decorateParam$1(2,drawing.IDrawingManagerService),__decorateParam$1(3,core.IResourceManagerService)],SheetsDrawingLoadController);var __defProp2=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__defNormalProp=__name((obj,key,value)=>key in obj?__defProp2(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value,"__defNormalProp"),__decorateClass=__name((decorators,target,key,kind)=>{for(var result=kind>1?void 0:kind?__getOwnPropDesc(target,key):target,i=decorators.length-1,decorator;i>=0;i--)(decorator=decorators[i])&&(result=(kind?decorator(target,key,result):decorator(result))||result);return kind&&result&&__defProp2(target,key,result),result},"__decorateClass"),__decorateParam=__name((index,decorator)=>(target,key)=>decorator(target,key,index),"__decorateParam"),__publicField=__name((obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value),"__publicField");exports2.UniverSheetsDrawingPlugin=(_b=class extends core.Plugin{constructor(_config=defaultPluginConfig,_injector,_configService){super(),this._config=_config,this._injector=_injector,this._configService=_configService;const{...rest}=this._config;this._configService.setConfig(PLUGIN_CONFIG_KEY,rest)}onStarting(){[[SheetsDrawingLoadController],[ISheetDrawingService,{useClass:SheetDrawingService}]].forEach(dependency=>this._injector.add(dependency))}},__name(_b,"UniverSheetsDrawingPlugin"),_b),__publicField(exports2.UniverSheetsDrawingPlugin,"pluginName",SHEET_DRAWING_PLUGIN),__publicField(exports2.UniverSheetsDrawingPlugin,"type",core.UniverInstanceType.UNIVER_SHEET),exports2.UniverSheetsDrawingPlugin=__decorateClass([core.DependentOn(drawing.UniverDrawingPlugin),__decorateParam(1,core.Inject(core.Injector)),__decorateParam(2,core.IConfigService)],exports2.UniverSheetsDrawingPlugin),exports2.DrawingApplyType=DrawingApplyType,exports2.ISheetDrawingService=ISheetDrawingService,exports2.SHEET_DRAWING_PLUGIN=SHEET_DRAWING_PLUGIN,exports2.SetDrawingApplyMutation=SetDrawingApplyMutation,exports2.SheetDrawingAnchorType=SheetDrawingAnchorType,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
1
+ function _0x372c(_0x37f968,_0x264f26){var _0x394c8a=_0x394c();return _0x372c=function(_0x372c69,_0x4eef79){_0x372c69=_0x372c69-0x167;var _0x1cabd9=_0x394c8a[_0x372c69];return _0x1cabd9;},_0x372c(_0x37f968,_0x264f26);}(function(_0x273942,_0x3db20c){var _0x9a6219=_0x372c,_0x2789af=_0x273942();while(!![]){try{var _0x3ba639=-parseInt(_0x9a6219(0x1ac))/0x1*(-parseInt(_0x9a6219(0x188))/0x2)+parseInt(_0x9a6219(0x179))/0x3*(parseInt(_0x9a6219(0x18b))/0x4)+-parseInt(_0x9a6219(0x17f))/0x5+parseInt(_0x9a6219(0x1bb))/0x6*(-parseInt(_0x9a6219(0x195))/0x7)+-parseInt(_0x9a6219(0x1a9))/0x8+parseInt(_0x9a6219(0x1af))/0x9*(-parseInt(_0x9a6219(0x171))/0xa)+parseInt(_0x9a6219(0x167))/0xb*(parseInt(_0x9a6219(0x169))/0xc);if(_0x3ba639===_0x3db20c)break;else _0x2789af['push'](_0x2789af['shift']());}catch(_0x256dda){_0x2789af['push'](_0x2789af['shift']());}}}(_0x394c,0x530e8),function(_0x427254,_0x2984fd){var _0x1a1e7c=_0x372c;typeof exports==_0x1a1e7c(0x1b8)&&typeof module<'u'?_0x2984fd(exports,require('@univerjs/core'),require(_0x1a1e7c(0x187))):typeof define==_0x1a1e7c(0x1ae)&&define[_0x1a1e7c(0x18a)]?define([_0x1a1e7c(0x19f),_0x1a1e7c(0x183),_0x1a1e7c(0x187)],_0x2984fd):(_0x427254=typeof globalThis<'u'?globalThis:_0x427254||self,_0x2984fd(_0x427254['UniverSheetsDrawing']={},_0x427254[_0x1a1e7c(0x19e)],_0x427254[_0x1a1e7c(0x197)]));}(this,function(_0x2d135a,_0x1952ac,_0x592953){'use strict';var _0x22db8f=_0x372c;var _0x991014=Object[_0x22db8f(0x1b5)],_0x4482e2=(_0x2d8b30,_0x3cfe59)=>_0x991014(_0x2d8b30,_0x22db8f(0x180),{'value':_0x3cfe59,'configurable':!0x0}),_0x2e10ba,_0xa44ee5;const _0x4162d2='sheets-drawing.config',_0x2a97c4={};var _0x1ebb36=(_0x2cee6c=>(_0x2cee6c['Position']='0',_0x2cee6c[_0x22db8f(0x192)]='1',_0x2cee6c[_0x22db8f(0x1a1)]='2',_0x2cee6c))(_0x1ebb36||{});const _0x47e896=class _0x21f2e2 extends _0x592953[_0x22db8f(0x18f)]{};_0x4482e2(_0x47e896,_0x22db8f(0x199));let _0x443798=_0x47e896;const _0x323f48=_0x1952ac['createIdentifier'](_0x22db8f(0x1ad));var _0x3d0c8d=(_0x27c948=>(_0x27c948[_0x27c948[_0x22db8f(0x1b0)]=0x0]=_0x22db8f(0x1b0),_0x27c948[_0x27c948['REMOVE']=0x1]='REMOVE',_0x27c948[_0x27c948[_0x22db8f(0x173)]=0x2]='UPDATE',_0x27c948[_0x27c948[_0x22db8f(0x1aa)]=0x3]=_0x22db8f(0x1aa),_0x27c948[_0x27c948[_0x22db8f(0x182)]=0x4]=_0x22db8f(0x182),_0x27c948[_0x27c948['UNGROUP']=0x5]='UNGROUP',_0x27c948))(_0x3d0c8d||{});const _0x135bb1={'id':_0x22db8f(0x1b1),'type':_0x1952ac[_0x22db8f(0x176)][_0x22db8f(0x1a5)],'handler':_0x4482e2((_0x500cc3,_0x1c02a6)=>{var _0x3a57be=_0x22db8f;const _0x1b1abe=_0x500cc3[_0x3a57be(0x186)](_0x592953[_0x3a57be(0x170)]),_0x417d50=_0x500cc3[_0x3a57be(0x186)](_0x323f48),{op:_0x4c8fcd,unitId:_0x4c5bd3,subUnitId:_0x2832a8,type:_0x40ddb4,objects:_0x5efd07}=_0x1c02a6;switch(_0x1b1abe[_0x3a57be(0x19c)](_0x4c5bd3,_0x2832a8,_0x4c8fcd),_0x417d50[_0x3a57be(0x19c)](_0x4c5bd3,_0x2832a8,_0x4c8fcd),_0x40ddb4){case 0x0:_0x1b1abe[_0x3a57be(0x17c)](_0x5efd07),_0x417d50[_0x3a57be(0x17c)](_0x5efd07);break;case 0x1:_0x1b1abe[_0x3a57be(0x175)](_0x5efd07),_0x417d50[_0x3a57be(0x175)](_0x5efd07);break;case 0x2:_0x1b1abe[_0x3a57be(0x19d)](_0x5efd07),_0x417d50[_0x3a57be(0x19d)](_0x5efd07);break;case 0x3:_0x1b1abe['orderNotification'](_0x5efd07),_0x417d50['orderNotification'](_0x5efd07);break;case 0x4:_0x1b1abe[_0x3a57be(0x191)](_0x5efd07);break;case 0x5:_0x1b1abe['ungroupUpdateNotification'](_0x5efd07);break;}return!0x0;},_0x22db8f(0x1a0))};var _0x1275f7=Object[_0x22db8f(0x1b5)],_0x411cdc=Object[_0x22db8f(0x178)],_0x279818=_0x4482e2((_0x3bbd3a,_0x5ba557,_0x566cce,_0x1ef723)=>{var _0x2f4983=_0x22db8f;for(var _0x5b6258=_0x1ef723>0x1?void 0x0:_0x1ef723?_0x411cdc(_0x5ba557,_0x566cce):_0x5ba557,_0x3aa9e5=_0x3bbd3a[_0x2f4983(0x1bd)]-0x1,_0x3e4fa0;_0x3aa9e5>=0x0;_0x3aa9e5--)(_0x3e4fa0=_0x3bbd3a[_0x3aa9e5])&&(_0x5b6258=(_0x1ef723?_0x3e4fa0(_0x5ba557,_0x566cce,_0x5b6258):_0x3e4fa0(_0x5b6258))||_0x5b6258);return _0x1ef723&&_0x5b6258&&_0x1275f7(_0x5ba557,_0x566cce,_0x5b6258),_0x5b6258;},_0x22db8f(0x1a2)),_0x5db73c=_0x4482e2((_0xe1c3fe,_0x1f0358)=>(_0x590f26,_0xde5cdc)=>_0x1f0358(_0x590f26,_0xde5cdc,_0xe1c3fe),_0x22db8f(0x1b7));const _0x2f2bb8='SHEET_DRAWING_PLUGIN';let _0x134167=(_0x2e10ba=class extends _0x1952ac['Disposable']{constructor(_0x3f92d5,_0x43ebf3,_0xecacee,_0x24c255){var _0x4242cd=_0x22db8f;super(),this[_0x4242cd(0x19a)]=_0x3f92d5,this[_0x4242cd(0x198)]=_0x43ebf3,this[_0x4242cd(0x1a3)]=_0xecacee,this[_0x4242cd(0x168)]=_0x24c255,this[_0x4242cd(0x185)](),this[_0x4242cd(0x174)](this[_0x4242cd(0x19a)]['registerCommand'](_0x135bb1));}[_0x22db8f(0x185)](){var _0x9e0b7c=_0x22db8f;const _0x52a93d=_0x4482e2((_0x24daa0,_0x386d30)=>{var _0x478e6d=_0x372c;const _0x3ab8f3=_0x386d30||this[_0x478e6d(0x198)]['getDrawingDataForUnit'](_0x24daa0);return _0x3ab8f3?JSON[_0x478e6d(0x16a)](_0x3ab8f3):'';},_0x9e0b7c(0x1b9)),_0x580b34=_0x4482e2(_0x11a589=>{var _0x280263=_0x9e0b7c;if(!_0x11a589)return{};try{return JSON[_0x280263(0x17a)](_0x11a589);}catch{return{};}},_0x9e0b7c(0x17d));this['disposeWithMe'](this[_0x9e0b7c(0x168)][_0x9e0b7c(0x194)]({'pluginName':_0x2f2bb8,'businesses':[_0x1952ac[_0x9e0b7c(0x1b4)][_0x9e0b7c(0x18e)]],'toJson':_0x4482e2((_0x38f230,_0x351e9d)=>_0x52a93d(_0x38f230,_0x351e9d),_0x9e0b7c(0x1b9)),'parseJson':_0x4482e2(_0x5372e7=>_0x580b34(_0x5372e7),_0x9e0b7c(0x17d)),'onUnLoad':_0x4482e2(_0x54c9ca=>{var _0x49a7ea=_0x9e0b7c;this[_0x49a7ea(0x198)][_0x49a7ea(0x193)](_0x54c9ca),this['_drawingManagerService'][_0x49a7ea(0x193)](_0x54c9ca);},_0x9e0b7c(0x16b)),'onLoad':_0x4482e2((_0x60275d,_0x35d184)=>{var _0x5b6aae=_0x9e0b7c;this[_0x5b6aae(0x198)][_0x5b6aae(0x1ba)](_0x60275d,_0x35d184),this[_0x5b6aae(0x1a3)][_0x5b6aae(0x1ba)](_0x60275d,_0x35d184);},'onLoad')}));}},_0x4482e2(_0x2e10ba,_0x22db8f(0x189)),_0x2e10ba);_0x134167=_0x279818([_0x5db73c(0x0,_0x1952ac[_0x22db8f(0x19b)]),_0x5db73c(0x1,_0x323f48),_0x5db73c(0x2,_0x592953['IDrawingManagerService']),_0x5db73c(0x3,_0x1952ac[_0x22db8f(0x1a8)])],_0x134167);var _0x5006c9=Object[_0x22db8f(0x1b5)],_0xcdbfa6=Object['getOwnPropertyDescriptor'],_0xf61fdd=_0x4482e2((_0x28a3cc,_0xc74155,_0x29e560)=>_0xc74155 in _0x28a3cc?_0x5006c9(_0x28a3cc,_0xc74155,{'enumerable':!0x0,'configurable':!0x0,'writable':!0x0,'value':_0x29e560}):_0x28a3cc[_0xc74155]=_0x29e560,_0x22db8f(0x1a4)),_0x4dfaa8=_0x4482e2((_0x1b3dcf,_0x5a8c8e,_0x563d8b,_0x259448)=>{for(var _0x34d1e4=_0x259448>0x1?void 0x0:_0x259448?_0xcdbfa6(_0x5a8c8e,_0x563d8b):_0x5a8c8e,_0xa1798a=_0x1b3dcf['length']-0x1,_0x3268d6;_0xa1798a>=0x0;_0xa1798a--)(_0x3268d6=_0x1b3dcf[_0xa1798a])&&(_0x34d1e4=(_0x259448?_0x3268d6(_0x5a8c8e,_0x563d8b,_0x34d1e4):_0x3268d6(_0x34d1e4))||_0x34d1e4);return _0x259448&&_0x34d1e4&&_0x5006c9(_0x5a8c8e,_0x563d8b,_0x34d1e4),_0x34d1e4;},'__decorateClass'),_0x4acd92=_0x4482e2((_0x3be22b,_0x3f2e79)=>(_0x18ddf5,_0x1af696)=>_0x3f2e79(_0x18ddf5,_0x1af696,_0x3be22b),'__decorateParam'),_0x3b80cd=_0x4482e2((_0xa04df8,_0x3abbff,_0x4f2dd4)=>_0xf61fdd(_0xa04df8,typeof _0x3abbff!='symbol'?_0x3abbff+'':_0x3abbff,_0x4f2dd4),_0x22db8f(0x1b2));_0x2d135a['UniverSheetsDrawingPlugin']=(_0xa44ee5=class extends _0x1952ac['Plugin']{constructor(_0x1f9c1a=_0x2a97c4,_0x5a1b73,_0x412614){var _0xfee829=_0x22db8f;super(),this['_config']=_0x1f9c1a,this[_0xfee829(0x16d)]=_0x5a1b73,this['_configService']=_0x412614;const {..._0x7e5092}=this[_0xfee829(0x1b6)];this['_configService'][_0xfee829(0x190)](_0x4162d2,_0x7e5092);}[_0x22db8f(0x1a6)](){var _0x5cc220=_0x22db8f;[[_0x134167],[_0x323f48,{'useClass':_0x443798}]][_0x5cc220(0x196)](_0x14ad61=>this[_0x5cc220(0x16d)][_0x5cc220(0x172)](_0x14ad61)),this[_0x5cc220(0x16d)][_0x5cc220(0x186)](_0x134167);}},_0x4482e2(_0xa44ee5,'UniverSheetsDrawingPlugin'),_0xa44ee5),_0x3b80cd(_0x2d135a[_0x22db8f(0x16f)],'pluginName',_0x2f2bb8),_0x3b80cd(_0x2d135a[_0x22db8f(0x16f)],_0x22db8f(0x16e),_0x1952ac[_0x22db8f(0x1b4)][_0x22db8f(0x18e)]),_0x2d135a[_0x22db8f(0x16f)]=_0x4dfaa8([_0x1952ac[_0x22db8f(0x1ab)](_0x592953[_0x22db8f(0x17e)]),_0x4acd92(0x1,_0x1952ac[_0x22db8f(0x1bc)](_0x1952ac[_0x22db8f(0x181)])),_0x4acd92(0x2,_0x1952ac[_0x22db8f(0x17b)])],_0x2d135a[_0x22db8f(0x16f)]),_0x2d135a[_0x22db8f(0x18c)]=_0x3d0c8d,_0x2d135a[_0x22db8f(0x1b3)]=_0x323f48,_0x2d135a[_0x22db8f(0x16c)]=_0x2f2bb8,_0x2d135a[_0x22db8f(0x177)]=_0x135bb1,_0x2d135a[_0x22db8f(0x1a7)]=_0x1ebb36,Object['defineProperty'](_0x2d135a,Symbol[_0x22db8f(0x184)],{'value':_0x22db8f(0x18d)});}));function _0x394c(){var _0x541026=['object','toJson','registerDrawingData','6330EfAFua','Inject','length','1276msihtI','_resourceManagerService','40380FJTNqn','stringify','onUnLoad','SHEET_DRAWING_PLUGIN','_injector','type','UniverSheetsDrawingPlugin','IDrawingManagerService','145120YprUSl','add','UPDATE','disposeWithMe','removeNotification','CommandType','SetDrawingApplyMutation','getOwnPropertyDescriptor','6465OuWXPP','parse','IConfigService','addNotification','parseJson','UniverDrawingPlugin','1502085rHlsgq','name','Injector','GROUP','@univerjs/core','toStringTag','_initSnapshot','get','@univerjs/drawing','273794DhcgZq','SheetsDrawingLoadController','amd','1108AKgono','DrawingApplyType','Module','UNIVER_SHEET','UnitDrawingService','setConfig','groupUpdateNotification','Both','removeDrawingDataForUnit','registerPluginResource','14EzSbwf','forEach','UniverDrawing','_sheetDrawingService','SheetDrawingService','_commandService','ICommandService','applyJson1','updateNotification','UniverCore','exports','handler','None','__decorateClass$1','_drawingManagerService','__defNormalProp','MUTATION','onStarting','SheetDrawingAnchorType','IResourceManagerService','2094648qykNRO','ARRANGE','DependentOn','3rgRDuO','sheets-drawing.sheet-drawing.service','function','306jpmrEg','INSERT','sheet.mutation.set-drawing-apply','__publicField','ISheetDrawingService','UniverInstanceType','defineProperty','_config','__decorateParam$1'];_0x394c=function(){return _0x541026;};return _0x394c();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-drawing",
3
- "version": "0.3.0-alpha.0",
3
+ "version": "0.3.0-nightly.202410101606",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -44,19 +44,19 @@
44
44
  "lib"
45
45
  ],
46
46
  "peerDependencies": {
47
- "@univerjs/drawing": "0.3.0-alpha.0",
48
- "@univerjs/core": "0.3.0-alpha.0"
47
+ "@univerjs/core": "0.3.0-nightly.202410101606",
48
+ "@univerjs/drawing": "0.3.0-nightly.202410101606"
49
49
  },
50
50
  "dependencies": {
51
- "@univerjs/core": "0.3.0-alpha.0",
52
- "@univerjs/drawing": "0.3.0-alpha.0",
53
- "@univerjs/sheets": "0.3.0-alpha.0"
51
+ "@univerjs/sheets": "0.3.0-nightly.202410101606",
52
+ "@univerjs/drawing": "0.3.0-nightly.202410101606",
53
+ "@univerjs/core": "0.3.0-nightly.202410101606"
54
54
  },
55
55
  "devDependencies": {
56
56
  "typescript": "^5.6.2",
57
57
  "vite": "^5.4.8",
58
58
  "vitest": "^2.1.1",
59
- "@univerjs-infra/shared": "0.3.0-alpha.0"
59
+ "@univerjs-infra/shared": "0.3.0"
60
60
  },
61
61
  "univerSpace": {
62
62
  ".": {
@@ -76,7 +76,6 @@
76
76
  "test:watch": "vitest",
77
77
  "coverage": "vitest run --coverage",
78
78
  "lint:types": "tsc --noEmit",
79
- "build": "tsc && vite build",
80
- "sync:cnpm": "cnpm sync"
79
+ "build": "tsc && vite build"
81
80
  }
82
81
  }
package/LICENSE DELETED
@@ -1,176 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS