@univerjs/sheets-drawing 0.2.8 → 0.2.10
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 -1
- package/lib/es/index.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +8 -8
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@univerjs/core"),drawing=require("@univerjs/drawing");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=>{const map=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=>toJson(unitId),"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)},"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,__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"),_a2;exports.UniverSheetsDrawingPlugin=(_a2=class extends core.Plugin{constructor(_config,_injector){super(),this._config=_config,this._injector=_injector}onStarting(){[[SheetsDrawingLoadController],[ISheetDrawingService,{useClass:SheetDrawingService}]].forEach(dependency=>this._injector.add(dependency))}},__name(_a2,"UniverSheetsDrawingPlugin"),__publicField(_a2,"pluginName",SHEET_DRAWING_PLUGIN),__publicField(_a2,"type",core.UniverInstanceType.UNIVER_SHEET),_a2);exports.UniverSheetsDrawingPlugin=__decorateClass([__decorateParam(1,core.Inject(core.Injector))],exports.UniverSheetsDrawingPlugin);exports.DrawingApplyType=DrawingApplyType;exports.ISheetDrawingService=ISheetDrawingService;exports.SetDrawingApplyMutation=SetDrawingApplyMutation;exports.SheetDrawingAnchorType=SheetDrawingAnchorType;
|
|
1
|
+
"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@univerjs/core"),drawing=require("@univerjs/drawing");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=>{const map=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=>toJson(unitId),"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,__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"),_a2;exports.UniverSheetsDrawingPlugin=(_a2=class extends core.Plugin{constructor(_config,_injector){super(),this._config=_config,this._injector=_injector}onStarting(){[[SheetsDrawingLoadController],[ISheetDrawingService,{useClass:SheetDrawingService}]].forEach(dependency=>this._injector.add(dependency))}},__name(_a2,"UniverSheetsDrawingPlugin"),__publicField(_a2,"pluginName",SHEET_DRAWING_PLUGIN),__publicField(_a2,"type",core.UniverInstanceType.UNIVER_SHEET),_a2);exports.UniverSheetsDrawingPlugin=__decorateClass([__decorateParam(1,core.Inject(core.Injector))],exports.UniverSheetsDrawingPlugin);exports.DrawingApplyType=DrawingApplyType;exports.ISheetDrawingService=ISheetDrawingService;exports.SetDrawingApplyMutation=SetDrawingApplyMutation;exports.SheetDrawingAnchorType=SheetDrawingAnchorType;
|
package/lib/es/index.js
CHANGED
|
@@ -73,7 +73,7 @@ let SheetsDrawingLoadController = (_a = class extends Disposable {
|
|
|
73
73
|
this._sheetDrawingService.removeDrawingDataForUnit(unitId), this._drawingManagerService.removeDrawingDataForUnit(unitId);
|
|
74
74
|
}, "onUnLoad"),
|
|
75
75
|
onLoad: /* @__PURE__ */ __name((unitId, value) => {
|
|
76
|
-
this._sheetDrawingService.registerDrawingData(unitId, value);
|
|
76
|
+
this._sheetDrawingService.registerDrawingData(unitId, value), this._drawingManagerService.registerDrawingData(unitId, value);
|
|
77
77
|
}, "onLoad")
|
|
78
78
|
})
|
|
79
79
|
);
|
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 __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);var _a,_b;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=>{const map=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=>toJson(unitId),"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)},"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,__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");exports2.UniverSheetsDrawingPlugin=(_b=class extends core.Plugin{constructor(_config,_injector){super(),this._config=_config,this._injector=_injector}onStarting(){[[SheetsDrawingLoadController],[ISheetDrawingService,{useClass:SheetDrawingService}]].forEach(dependency=>this._injector.add(dependency))}},__name(_b,"UniverSheetsDrawingPlugin"),__publicField(_b,"pluginName",SHEET_DRAWING_PLUGIN),__publicField(_b,"type",core.UniverInstanceType.UNIVER_SHEET),_b),exports2.UniverSheetsDrawingPlugin=__decorateClass([__decorateParam(1,core.Inject(core.Injector))],exports2.UniverSheetsDrawingPlugin),exports2.DrawingApplyType=DrawingApplyType,exports2.ISheetDrawingService=ISheetDrawingService,exports2.SetDrawingApplyMutation=SetDrawingApplyMutation,exports2.SheetDrawingAnchorType=SheetDrawingAnchorType,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
|
|
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 __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __name=(target,value)=>__defProp(target,"name",{value,configurable:!0});var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);var _a,_b;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=>{const map=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=>toJson(unitId),"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,__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");exports2.UniverSheetsDrawingPlugin=(_b=class extends core.Plugin{constructor(_config,_injector){super(),this._config=_config,this._injector=_injector}onStarting(){[[SheetsDrawingLoadController],[ISheetDrawingService,{useClass:SheetDrawingService}]].forEach(dependency=>this._injector.add(dependency))}},__name(_b,"UniverSheetsDrawingPlugin"),__publicField(_b,"pluginName",SHEET_DRAWING_PLUGIN),__publicField(_b,"type",core.UniverInstanceType.UNIVER_SHEET),_b),exports2.UniverSheetsDrawingPlugin=__decorateClass([__decorateParam(1,core.Inject(core.Injector))],exports2.UniverSheetsDrawingPlugin),exports2.DrawingApplyType=DrawingApplyType,exports2.ISheetDrawingService=ISheetDrawingService,exports2.SetDrawingApplyMutation=SetDrawingApplyMutation,exports2.SheetDrawingAnchorType=SheetDrawingAnchorType,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-drawing",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -44,17 +44,17 @@
|
|
|
44
44
|
"lib"
|
|
45
45
|
],
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@univerjs/
|
|
48
|
-
"@univerjs/
|
|
47
|
+
"@univerjs/core": "0.2.10",
|
|
48
|
+
"@univerjs/drawing": "0.2.10"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"typescript": "^5.5.4",
|
|
52
|
-
"vite": "^5.4.
|
|
52
|
+
"vite": "^5.4.2",
|
|
53
53
|
"vitest": "^2.0.5",
|
|
54
|
-
"@univerjs/core": "0.2.
|
|
55
|
-
"@univerjs/drawing": "0.2.
|
|
56
|
-
"@univerjs/sheets": "0.2.
|
|
57
|
-
"@univerjs/shared": "0.2.
|
|
54
|
+
"@univerjs/core": "0.2.10",
|
|
55
|
+
"@univerjs/drawing": "0.2.10",
|
|
56
|
+
"@univerjs/sheets": "0.2.10",
|
|
57
|
+
"@univerjs/shared": "0.2.10"
|
|
58
58
|
},
|
|
59
59
|
"univerSpace": {
|
|
60
60
|
".": {
|