@univerjs/sheets-drawing 0.6.1 → 0.6.2

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/es/index.js CHANGED
@@ -10,49 +10,49 @@ const F = {
10
10
  id: "sheet.mutation.set-drawing-apply",
11
11
  type: E.MUTATION,
12
12
  handler: (e, i) => {
13
- const r = e.get(S), t = e.get(v), { op: n, unitId: a, subUnitId: o, type: m, objects: s } = i;
14
- switch (r.applyJson1(a, o, n), t.applyJson1(a, o, n), m) {
13
+ const t = e.get(S), r = e.get(v), { op: n, unitId: a, subUnitId: o, type: m, objects: s } = i;
14
+ switch (t.applyJson1(a, o, n), r.applyJson1(a, o, n), m) {
15
15
  case 0:
16
- r.addNotification(s), t.addNotification(s);
16
+ t.addNotification(s), r.addNotification(s);
17
17
  break;
18
18
  case 1:
19
- r.removeNotification(s), t.removeNotification(s);
19
+ t.removeNotification(s), r.removeNotification(s);
20
20
  break;
21
21
  case 2:
22
- r.updateNotification(s), t.updateNotification(s);
22
+ t.updateNotification(s), r.updateNotification(s);
23
23
  break;
24
24
  case 3:
25
- r.orderNotification(s), t.orderNotification(s);
25
+ t.orderNotification(s), r.orderNotification(s);
26
26
  break;
27
27
  case 4:
28
- r.groupUpdateNotification(s);
28
+ t.groupUpdateNotification(s);
29
29
  break;
30
30
  case 5:
31
- r.ungroupUpdateNotification(s);
31
+ t.ungroupUpdateNotification(s);
32
32
  break;
33
33
  }
34
34
  return !0;
35
35
  }
36
36
  };
37
- var H = Object.getOwnPropertyDescriptor, W = (e, i, r, t) => {
38
- for (var n = t > 1 ? void 0 : t ? H(i, r) : i, a = e.length - 1, o; a >= 0; a--)
37
+ var H = Object.getOwnPropertyDescriptor, W = (e, i, t, r) => {
38
+ for (var n = r > 1 ? void 0 : r ? H(i, t) : i, a = e.length - 1, o; a >= 0; a--)
39
39
  (o = e[a]) && (n = o(n) || n);
40
40
  return n;
41
- }, c = (e, i) => (r, t) => i(r, t, e);
41
+ }, c = (e, i) => (t, r) => i(t, r, e);
42
42
  const f = "SHEET_DRAWING_PLUGIN";
43
43
  let g = class extends P {
44
- constructor(e, i, r, t) {
45
- super(), this._commandService = e, this._sheetDrawingService = i, this._drawingManagerService = r, this._resourceManagerService = t, this._initSnapshot(), this.disposeWithMe(this._commandService.registerCommand(F));
44
+ constructor(e, i, t, r) {
45
+ super(), this._commandService = e, this._sheetDrawingService = i, this._drawingManagerService = t, this._resourceManagerService = r, this._initSnapshot(), this.disposeWithMe(this._commandService.registerCommand(F));
46
46
  }
47
47
  _initSnapshot() {
48
- const e = (r, t) => {
49
- const n = t || this._sheetDrawingService.getDrawingDataForUnit(r);
48
+ const e = (t, r) => {
49
+ const n = r || this._sheetDrawingService.getDrawingDataForUnit(t);
50
50
  return n ? JSON.stringify(n) : "";
51
- }, i = (r) => {
52
- if (!r)
51
+ }, i = (t) => {
52
+ if (!t)
53
53
  return {};
54
54
  try {
55
- return JSON.parse(r);
55
+ return JSON.parse(t);
56
56
  } catch {
57
57
  return {};
58
58
  }
@@ -61,13 +61,13 @@ let g = class extends P {
61
61
  this._resourceManagerService.registerPluginResource({
62
62
  pluginName: f,
63
63
  businesses: [h.UNIVER_SHEET],
64
- toJson: (r, t) => e(r, t),
65
- parseJson: (r) => i(r),
66
- onUnLoad: (r) => {
67
- this._sheetDrawingService.removeDrawingDataForUnit(r), this._drawingManagerService.removeDrawingDataForUnit(r);
64
+ toJson: (t, r) => e(t, r),
65
+ parseJson: (t) => i(t),
66
+ onUnLoad: (t) => {
67
+ this._sheetDrawingService.removeDrawingDataForUnit(t), this._drawingManagerService.removeDrawingDataForUnit(t);
68
68
  },
69
- onLoad: (r, t) => {
70
- this._sheetDrawingService.registerDrawingData(r, t), this._drawingManagerService.registerDrawingData(r, t);
69
+ onLoad: (t, r) => {
70
+ this._sheetDrawingService.registerDrawingData(t, r), this._drawingManagerService.registerDrawingData(t, r);
71
71
  }
72
72
  })
73
73
  );
@@ -79,20 +79,20 @@ g = W([
79
79
  c(2, S),
80
80
  c(3, D)
81
81
  ], g);
82
- var x = Object.defineProperty, V = Object.getOwnPropertyDescriptor, $ = (e, i, r) => i in e ? x(e, i, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[i] = r, B = (e, i, r, t) => {
83
- for (var n = t > 1 ? void 0 : t ? V(i, r) : i, a = e.length - 1, o; a >= 0; a--)
82
+ var x = Object.defineProperty, V = Object.getOwnPropertyDescriptor, $ = (e, i, t) => i in e ? x(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, B = (e, i, t, r) => {
83
+ for (var n = r > 1 ? void 0 : r ? V(i, t) : i, a = e.length - 1, o; a >= 0; a--)
84
84
  (o = e[a]) && (n = o(n) || n);
85
85
  return n;
86
- }, u = (e, i) => (r, t) => i(r, t, e), N = (e, i, r) => $(e, typeof i != "symbol" ? i + "" : i, r);
86
+ }, u = (e, i) => (t, r) => i(t, r, e), N = (e, i, t) => $(e, typeof i != "symbol" ? i + "" : i, t);
87
87
  let _ = class extends b {
88
- constructor(e = d, i, r) {
89
- super(), this._config = e, this._injector = i, this._configService = r;
90
- const { ...t } = M(
88
+ constructor(e = d, i, t) {
89
+ super(), this._config = e, this._injector = i, this._configService = t;
90
+ const { ...r } = M(
91
91
  {},
92
92
  d,
93
93
  this._config
94
94
  );
95
- this._configService.setConfig(C, t);
95
+ this._configService.setConfig(C, r);
96
96
  }
97
97
  onStarting() {
98
98
  [
package/lib/umd/index.js CHANGED
@@ -1 +1 @@
1
- (function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/drawing")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/drawing"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.UniverSheetsDrawing={},n.UniverCore,n.UniverDrawing))})(this,function(n,a,u){"use strict";const w="sheets-drawing.config",_={};var f=(e=>(e.Position="0",e.Both="1",e.None="2",e))(f||{});class l extends u.UnitDrawingService{}const v=a.createIdentifier("sheets-drawing.sheet-drawing.service");var U=(e=>(e[e.INSERT=0]="INSERT",e[e.REMOVE=1]="REMOVE",e[e.UPDATE=2]="UPDATE",e[e.ARRANGE=3]="ARRANGE",e[e.GROUP=4]="GROUP",e[e.UNGROUP=5]="UNGROUP",e))(U||{});const D={id:"sheet.mutation.set-drawing-apply",type:a.CommandType.MUTATION,handler:(e,r)=>{const i=e.get(u.IDrawingManagerService),t=e.get(v),{op:s,unitId:o,subUnitId:g,type:M,objects:c}=r;switch(i.applyJson1(o,g,s),t.applyJson1(o,g,s),M){case 0:i.addNotification(c),t.addNotification(c);break;case 1:i.removeNotification(c),t.removeNotification(c);break;case 2:i.updateNotification(c),t.updateNotification(c);break;case 3:i.orderNotification(c),t.orderNotification(c);break;case 4:i.groupUpdateNotification(c);break;case 5:i.ungroupUpdateNotification(c);break}return!0}};var m=Object.getOwnPropertyDescriptor,E=(e,r,i,t)=>{for(var s=t>1?void 0:t?m(r,i):r,o=e.length-1,g;o>=0;o--)(g=e[o])&&(s=g(s)||s);return s},h=(e,r)=>(i,t)=>r(i,t,e);const S="SHEET_DRAWING_PLUGIN";let d=class extends a.Disposable{constructor(e,r,i,t){super(),this._commandService=e,this._sheetDrawingService=r,this._drawingManagerService=i,this._resourceManagerService=t,this._initSnapshot(),this.disposeWithMe(this._commandService.registerCommand(D))}_initSnapshot(){const e=(i,t)=>{const s=t||this._sheetDrawingService.getDrawingDataForUnit(i);return s?JSON.stringify(s):""},r=i=>{if(!i)return{};try{return JSON.parse(i)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:S,businesses:[a.UniverInstanceType.UNIVER_SHEET],toJson:(i,t)=>e(i,t),parseJson:i=>r(i),onUnLoad:i=>{this._sheetDrawingService.removeDrawingDataForUnit(i),this._drawingManagerService.removeDrawingDataForUnit(i)},onLoad:(i,t)=>{this._sheetDrawingService.registerDrawingData(i,t),this._drawingManagerService.registerDrawingData(i,t)}}))}};d=E([h(0,a.ICommandService),h(1,v),h(2,u.IDrawingManagerService),h(3,a.IResourceManagerService)],d);var I=Object.defineProperty,R=Object.getOwnPropertyDescriptor,O=(e,r,i)=>r in e?I(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,b=(e,r,i,t)=>{for(var s=t>1?void 0:t?R(r,i):r,o=e.length-1,g;o>=0;o--)(g=e[o])&&(s=g(s)||s);return s},N=(e,r)=>(i,t)=>r(i,t,e),P=(e,r,i)=>O(e,typeof r!="symbol"?r+"":r,i);n.UniverSheetsDrawingPlugin=class extends a.Plugin{constructor(r=_,i,t){super(),this._config=r,this._injector=i,this._configService=t;const{...s}=a.merge({},_,this._config);this._configService.setConfig(w,s)}onStarting(){[[d],[v,{useClass:l}]].forEach(r=>this._injector.add(r)),this._injector.get(d)}},P(n.UniverSheetsDrawingPlugin,"pluginName",S),P(n.UniverSheetsDrawingPlugin,"type",a.UniverInstanceType.UNIVER_SHEET),n.UniverSheetsDrawingPlugin=b([a.DependentOn(u.UniverDrawingPlugin),N(1,a.Inject(a.Injector)),N(2,a.IConfigService)],n.UniverSheetsDrawingPlugin),n.DrawingApplyType=U,n.ISheetDrawingService=v,n.SHEET_DRAWING_PLUGIN=S,n.SetDrawingApplyMutation=D,n.SheetDrawingAnchorType=f,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
1
+ (function(n,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("@univerjs/core"),require("@univerjs/drawing")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/drawing"],a):(n=typeof globalThis<"u"?globalThis:n||self,a(n.UniverSheetsDrawing={},n.UniverCore,n.UniverDrawing))})(this,function(n,a,u){"use strict";const w="sheets-drawing.config",_={};var f=(e=>(e.Position="0",e.Both="1",e.None="2",e))(f||{});class l extends u.UnitDrawingService{}const v=a.createIdentifier("sheets-drawing.sheet-drawing.service");var U=(e=>(e[e.INSERT=0]="INSERT",e[e.REMOVE=1]="REMOVE",e[e.UPDATE=2]="UPDATE",e[e.ARRANGE=3]="ARRANGE",e[e.GROUP=4]="GROUP",e[e.UNGROUP=5]="UNGROUP",e))(U||{});const D={id:"sheet.mutation.set-drawing-apply",type:a.CommandType.MUTATION,handler:(e,t)=>{const i=e.get(u.IDrawingManagerService),r=e.get(v),{op:s,unitId:o,subUnitId:g,type:M,objects:c}=t;switch(i.applyJson1(o,g,s),r.applyJson1(o,g,s),M){case 0:i.addNotification(c),r.addNotification(c);break;case 1:i.removeNotification(c),r.removeNotification(c);break;case 2:i.updateNotification(c),r.updateNotification(c);break;case 3:i.orderNotification(c),r.orderNotification(c);break;case 4:i.groupUpdateNotification(c);break;case 5:i.ungroupUpdateNotification(c);break}return!0}};var m=Object.getOwnPropertyDescriptor,E=(e,t,i,r)=>{for(var s=r>1?void 0:r?m(t,i):t,o=e.length-1,g;o>=0;o--)(g=e[o])&&(s=g(s)||s);return s},h=(e,t)=>(i,r)=>t(i,r,e);const S="SHEET_DRAWING_PLUGIN";let d=class extends a.Disposable{constructor(e,t,i,r){super(),this._commandService=e,this._sheetDrawingService=t,this._drawingManagerService=i,this._resourceManagerService=r,this._initSnapshot(),this.disposeWithMe(this._commandService.registerCommand(D))}_initSnapshot(){const e=(i,r)=>{const s=r||this._sheetDrawingService.getDrawingDataForUnit(i);return s?JSON.stringify(s):""},t=i=>{if(!i)return{};try{return JSON.parse(i)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:S,businesses:[a.UniverInstanceType.UNIVER_SHEET],toJson:(i,r)=>e(i,r),parseJson:i=>t(i),onUnLoad:i=>{this._sheetDrawingService.removeDrawingDataForUnit(i),this._drawingManagerService.removeDrawingDataForUnit(i)},onLoad:(i,r)=>{this._sheetDrawingService.registerDrawingData(i,r),this._drawingManagerService.registerDrawingData(i,r)}}))}};d=E([h(0,a.ICommandService),h(1,v),h(2,u.IDrawingManagerService),h(3,a.IResourceManagerService)],d);var I=Object.defineProperty,R=Object.getOwnPropertyDescriptor,O=(e,t,i)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,b=(e,t,i,r)=>{for(var s=r>1?void 0:r?R(t,i):t,o=e.length-1,g;o>=0;o--)(g=e[o])&&(s=g(s)||s);return s},N=(e,t)=>(i,r)=>t(i,r,e),P=(e,t,i)=>O(e,typeof t!="symbol"?t+"":t,i);n.UniverSheetsDrawingPlugin=class extends a.Plugin{constructor(t=_,i,r){super(),this._config=t,this._injector=i,this._configService=r;const{...s}=a.merge({},_,this._config);this._configService.setConfig(w,s)}onStarting(){[[d],[v,{useClass:l}]].forEach(t=>this._injector.add(t)),this._injector.get(d)}},P(n.UniverSheetsDrawingPlugin,"pluginName",S),P(n.UniverSheetsDrawingPlugin,"type",a.UniverInstanceType.UNIVER_SHEET),n.UniverSheetsDrawingPlugin=b([a.DependentOn(u.UniverDrawingPlugin),N(1,a.Inject(a.Injector)),N(2,a.IConfigService)],n.UniverSheetsDrawingPlugin),n.DrawingApplyType=U,n.ISheetDrawingService=v,n.SHEET_DRAWING_PLUGIN=S,n.SetDrawingApplyMutation=D,n.SheetDrawingAnchorType=f,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/sheets-drawing",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -43,15 +43,15 @@
43
43
  "lib"
44
44
  ],
45
45
  "dependencies": {
46
- "@univerjs/core": "0.6.1",
47
- "@univerjs/drawing": "0.6.1"
46
+ "@univerjs/core": "0.6.2",
47
+ "@univerjs/drawing": "0.6.2"
48
48
  },
49
49
  "devDependencies": {
50
50
  "typescript": "^5.7.3",
51
- "vite": "^6.1.1",
52
- "vitest": "^3.0.6",
53
- "@univerjs-infra/shared": "0.6.1",
54
- "@univerjs/sheets": "0.6.1"
51
+ "vite": "^6.2.0",
52
+ "vitest": "^3.0.7",
53
+ "@univerjs-infra/shared": "0.6.2",
54
+ "@univerjs/sheets": "0.6.2"
55
55
  },
56
56
  "scripts": {
57
57
  "test": "vitest run",