@univerjs/sheets-drawing 0.8.2-nightly.202506261607 → 0.8.3-nightly.202506271607
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 +14 -14
- package/lib/index.js +14 -14
- package/lib/types/index.d.ts +3 -2
- package/lib/umd/index.js +1 -1
- package/package.json +5 -5
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@univerjs/core"),u=require("@univerjs/drawing")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@univerjs/core"),u=require("@univerjs/drawing");var f=(e=>(e.Position="0",e.Both="1",e.None="2",e))(f||{});class P extends u.UnitDrawingService{}const S=a.createIdentifier("sheets-drawing.sheet-drawing.service");var N=(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))(N||{});const D={id:"sheet.mutation.set-drawing-apply",type:a.CommandType.MUTATION,handler:(e,t)=>{const r=e.get(u.IDrawingManagerService),i=e.get(S),{op:n,unitId:s,subUnitId:c,type:l,objects:o}=t;switch(r.applyJson1(s,c,n),i.applyJson1(s,c,n),l){case 0:r.addNotification(o),i.addNotification(o);break;case 1:r.removeNotification(o),i.removeNotification(o);break;case 2:r.updateNotification(o),i.updateNotification(o);break;case 3:r.orderNotification(o),i.orderNotification(o);break;case 4:r.groupUpdateNotification(o);break;case 5:r.ungroupUpdateNotification(o);break}return!0}};var w=Object.getOwnPropertyDescriptor,E=(e,t,r,i)=>{for(var n=i>1?void 0:i?w(t,r):t,s=e.length-1,c;s>=0;s--)(c=e[s])&&(n=c(n)||n);return n},g=(e,t)=>(r,i)=>t(r,i,e);const _="SHEET_DRAWING_PLUGIN";let v=class extends a.Disposable{constructor(e,t,r,i){super(),this._commandService=e,this._sheetDrawingService=t,this._drawingManagerService=r,this._resourceManagerService=i,this._initSnapshot(),this.disposeWithMe(this._commandService.registerCommand(D))}_initSnapshot(){const e=(r,i)=>{const n=i||this._sheetDrawingService.getDrawingDataForUnit(r);return n?JSON.stringify(n):""},t=r=>{if(!r)return{};try{return JSON.parse(r)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:_,businesses:[a.UniverInstanceType.UNIVER_SHEET],toJson:(r,i)=>e(r,i),parseJson:r=>t(r),onUnLoad:r=>{this._sheetDrawingService.removeDrawingDataForUnit(r),this._drawingManagerService.removeDrawingDataForUnit(r)},onLoad:(r,i)=>{this._sheetDrawingService.registerDrawingData(r,i),this._drawingManagerService.registerDrawingData(r,i)}}))}};v=E([g(0,a.ICommandService),g(1,S),g(2,u.IDrawingManagerService),g(3,a.IResourceManagerService)],v);const I="sheets-drawing.config",h={};var m=Object.defineProperty,R=Object.getOwnPropertyDescriptor,O=(e,t,r)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b=(e,t,r,i)=>{for(var n=i>1?void 0:i?R(t,r):t,s=e.length-1,c;s>=0;s--)(c=e[s])&&(n=c(n)||n);return n},d=(e,t)=>(r,i)=>t(r,i,e),U=(e,t,r)=>O(e,typeof t!="symbol"?t+"":t,r);exports.UniverSheetsDrawingPlugin=class extends a.Plugin{constructor(t=h,r,i){super(),this._config=t,this._injector=r,this._configService=i;const{...n}=a.merge({},h,this._config);this._configService.setConfig(I,n)}onStarting(){[[v],[S,{useClass:P}]].forEach(t=>this._injector.add(t)),this._injector.get(v)}};U(exports.UniverSheetsDrawingPlugin,"pluginName",_);U(exports.UniverSheetsDrawingPlugin,"type",a.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsDrawingPlugin=b([a.DependentOn(u.UniverDrawingPlugin),d(1,a.Inject(a.Injector)),d(2,a.IConfigService)],exports.UniverSheetsDrawingPlugin);exports.DrawingApplyType=N;exports.ISheetDrawingService=S;exports.SHEET_DRAWING_PLUGIN=_;exports.SetDrawingApplyMutation=D;exports.SheetDrawingAnchorType=f;
|
package/lib/es/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { createIdentifier as U, CommandType as E, Disposable as P, UniverInstanceType as h, ICommandService as l, IResourceManagerService as D, DependentOn as I, Inject as w, Injector as R, IConfigService as O, Plugin as b, merge as M } from "@univerjs/core";
|
|
2
2
|
import { UnitDrawingService as p, IDrawingManagerService as S, UniverDrawingPlugin as G } from "@univerjs/drawing";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class j extends p {
|
|
3
|
+
var C = /* @__PURE__ */ ((e) => (e.Position = "0", e.Both = "1", e.None = "2", e))(C || {});
|
|
4
|
+
class J extends p {
|
|
6
5
|
}
|
|
7
6
|
const v = U("sheets-drawing.sheet-drawing.service");
|
|
8
|
-
var
|
|
9
|
-
const
|
|
7
|
+
var j = /* @__PURE__ */ ((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))(j || {});
|
|
8
|
+
const L = {
|
|
10
9
|
id: "sheet.mutation.set-drawing-apply",
|
|
11
10
|
type: E.MUTATION,
|
|
12
11
|
handler: (e, i) => {
|
|
@@ -34,15 +33,15 @@ const F = {
|
|
|
34
33
|
return !0;
|
|
35
34
|
}
|
|
36
35
|
};
|
|
37
|
-
var
|
|
38
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
36
|
+
var F = Object.getOwnPropertyDescriptor, H = (e, i, t, r) => {
|
|
37
|
+
for (var n = r > 1 ? void 0 : r ? F(i, t) : i, a = e.length - 1, o; a >= 0; a--)
|
|
39
38
|
(o = e[a]) && (n = o(n) || n);
|
|
40
39
|
return n;
|
|
41
40
|
}, c = (e, i) => (t, r) => i(t, r, e);
|
|
42
41
|
const f = "SHEET_DRAWING_PLUGIN";
|
|
43
42
|
let g = class extends P {
|
|
44
43
|
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(
|
|
44
|
+
super(), this._commandService = e, this._sheetDrawingService = i, this._drawingManagerService = t, this._resourceManagerService = r, this._initSnapshot(), this.disposeWithMe(this._commandService.registerCommand(L));
|
|
46
45
|
}
|
|
47
46
|
_initSnapshot() {
|
|
48
47
|
const e = (t, r) => {
|
|
@@ -73,12 +72,13 @@ let g = class extends P {
|
|
|
73
72
|
);
|
|
74
73
|
}
|
|
75
74
|
};
|
|
76
|
-
g =
|
|
75
|
+
g = H([
|
|
77
76
|
c(0, l),
|
|
78
77
|
c(1, v),
|
|
79
78
|
c(2, S),
|
|
80
79
|
c(3, D)
|
|
81
80
|
], g);
|
|
81
|
+
const W = "sheets-drawing.config", d = {};
|
|
82
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
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);
|
|
@@ -92,12 +92,12 @@ let _ = class extends b {
|
|
|
92
92
|
d,
|
|
93
93
|
this._config
|
|
94
94
|
);
|
|
95
|
-
this._configService.setConfig(
|
|
95
|
+
this._configService.setConfig(W, r);
|
|
96
96
|
}
|
|
97
97
|
onStarting() {
|
|
98
98
|
[
|
|
99
99
|
[g],
|
|
100
|
-
[v, { useClass:
|
|
100
|
+
[v, { useClass: J }]
|
|
101
101
|
].forEach((e) => this._injector.add(e)), this._injector.get(g);
|
|
102
102
|
}
|
|
103
103
|
};
|
|
@@ -109,10 +109,10 @@ _ = B([
|
|
|
109
109
|
u(2, O)
|
|
110
110
|
], _);
|
|
111
111
|
export {
|
|
112
|
-
|
|
112
|
+
j as DrawingApplyType,
|
|
113
113
|
v as ISheetDrawingService,
|
|
114
114
|
f as SHEET_DRAWING_PLUGIN,
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
L as SetDrawingApplyMutation,
|
|
116
|
+
C as SheetDrawingAnchorType,
|
|
117
117
|
_ as UniverSheetsDrawingPlugin
|
|
118
118
|
};
|
package/lib/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { createIdentifier as U, CommandType as E, Disposable as P, UniverInstanceType as h, ICommandService as l, IResourceManagerService as D, DependentOn as I, Inject as w, Injector as R, IConfigService as O, Plugin as b, merge as M } from "@univerjs/core";
|
|
2
2
|
import { UnitDrawingService as p, IDrawingManagerService as S, UniverDrawingPlugin as G } from "@univerjs/drawing";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class j extends p {
|
|
3
|
+
var C = /* @__PURE__ */ ((e) => (e.Position = "0", e.Both = "1", e.None = "2", e))(C || {});
|
|
4
|
+
class J extends p {
|
|
6
5
|
}
|
|
7
6
|
const v = U("sheets-drawing.sheet-drawing.service");
|
|
8
|
-
var
|
|
9
|
-
const
|
|
7
|
+
var j = /* @__PURE__ */ ((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))(j || {});
|
|
8
|
+
const L = {
|
|
10
9
|
id: "sheet.mutation.set-drawing-apply",
|
|
11
10
|
type: E.MUTATION,
|
|
12
11
|
handler: (e, i) => {
|
|
@@ -34,15 +33,15 @@ const F = {
|
|
|
34
33
|
return !0;
|
|
35
34
|
}
|
|
36
35
|
};
|
|
37
|
-
var
|
|
38
|
-
for (var n = r > 1 ? void 0 : r ?
|
|
36
|
+
var F = Object.getOwnPropertyDescriptor, H = (e, i, t, r) => {
|
|
37
|
+
for (var n = r > 1 ? void 0 : r ? F(i, t) : i, a = e.length - 1, o; a >= 0; a--)
|
|
39
38
|
(o = e[a]) && (n = o(n) || n);
|
|
40
39
|
return n;
|
|
41
40
|
}, c = (e, i) => (t, r) => i(t, r, e);
|
|
42
41
|
const f = "SHEET_DRAWING_PLUGIN";
|
|
43
42
|
let g = class extends P {
|
|
44
43
|
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(
|
|
44
|
+
super(), this._commandService = e, this._sheetDrawingService = i, this._drawingManagerService = t, this._resourceManagerService = r, this._initSnapshot(), this.disposeWithMe(this._commandService.registerCommand(L));
|
|
46
45
|
}
|
|
47
46
|
_initSnapshot() {
|
|
48
47
|
const e = (t, r) => {
|
|
@@ -73,12 +72,13 @@ let g = class extends P {
|
|
|
73
72
|
);
|
|
74
73
|
}
|
|
75
74
|
};
|
|
76
|
-
g =
|
|
75
|
+
g = H([
|
|
77
76
|
c(0, l),
|
|
78
77
|
c(1, v),
|
|
79
78
|
c(2, S),
|
|
80
79
|
c(3, D)
|
|
81
80
|
], g);
|
|
81
|
+
const W = "sheets-drawing.config", d = {};
|
|
82
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
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);
|
|
@@ -92,12 +92,12 @@ let _ = class extends b {
|
|
|
92
92
|
d,
|
|
93
93
|
this._config
|
|
94
94
|
);
|
|
95
|
-
this._configService.setConfig(
|
|
95
|
+
this._configService.setConfig(W, r);
|
|
96
96
|
}
|
|
97
97
|
onStarting() {
|
|
98
98
|
[
|
|
99
99
|
[g],
|
|
100
|
-
[v, { useClass:
|
|
100
|
+
[v, { useClass: J }]
|
|
101
101
|
].forEach((e) => this._injector.add(e)), this._injector.get(g);
|
|
102
102
|
}
|
|
103
103
|
};
|
|
@@ -109,10 +109,10 @@ _ = B([
|
|
|
109
109
|
u(2, O)
|
|
110
110
|
], _);
|
|
111
111
|
export {
|
|
112
|
-
|
|
112
|
+
j as DrawingApplyType,
|
|
113
113
|
v as ISheetDrawingService,
|
|
114
114
|
f as SHEET_DRAWING_PLUGIN,
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
L as SetDrawingApplyMutation,
|
|
116
|
+
C as SheetDrawingAnchorType,
|
|
117
117
|
_ as UniverSheetsDrawingPlugin
|
|
118
118
|
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
export { DrawingApplyType, type ISetDrawingApplyMutationParams, SetDrawingApplyMutation } from './commands/mutations/set-drawing-apply.mutation';
|
|
17
|
+
export type { IUniverSheetsDrawingConfig } from './controllers/config.schema';
|
|
18
|
+
export { SHEET_DRAWING_PLUGIN } from './controllers/sheet-drawing.controller';
|
|
16
19
|
export { UniverSheetsDrawingPlugin } from './plugin';
|
|
17
20
|
export { ISheetDrawingService, SheetDrawingAnchorType } from './services/sheet-drawing.service';
|
|
18
|
-
export { SHEET_DRAWING_PLUGIN } from './controllers/sheet-drawing.controller';
|
|
19
21
|
export type { IFloatDomData, ISheetDrawing, ISheetDrawingPosition, ISheetFloatDom, ISheetImage } from './services/sheet-drawing.service';
|
|
20
|
-
export { DrawingApplyType, type ISetDrawingApplyMutationParams, SetDrawingApplyMutation } from './commands/mutations/set-drawing-apply.mutation';
|
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";
|
|
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";var _=(e=>(e.Position="0",e.Both="1",e.None="2",e))(_||{});class w extends u.UnitDrawingService{}const v=a.createIdentifier("sheets-drawing.sheet-drawing.service");var f=(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))(f||{});const U={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 l=Object.getOwnPropertyDescriptor,m=(e,t,i,r)=>{for(var s=r>1?void 0:r?l(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(U))}_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=m([h(0,a.ICommandService),h(1,v),h(2,u.IDrawingManagerService),h(3,a.IResourceManagerService)],d);const E="sheets-drawing.config",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=D,i,r){super(),this._config=t,this._injector=i,this._configService=r;const{...s}=a.merge({},D,this._config);this._configService.setConfig(E,s)}onStarting(){[[d],[v,{useClass:w}]].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=f,n.ISheetDrawingService=v,n.SHEET_DRAWING_PLUGIN=S,n.SetDrawingApplyMutation=U,n.SheetDrawingAnchorType=_,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.8.
|
|
3
|
+
"version": "0.8.3-nightly.202506271607",
|
|
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.8.
|
|
47
|
-
"@univerjs/drawing": "0.8.
|
|
46
|
+
"@univerjs/core": "0.8.3-nightly.202506271607",
|
|
47
|
+
"@univerjs/drawing": "0.8.3-nightly.202506271607"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"typescript": "^5.8.3",
|
|
51
51
|
"vite": "^6.3.5",
|
|
52
52
|
"vitest": "^3.2.4",
|
|
53
|
-
"@univerjs-infra/shared": "0.8.
|
|
54
|
-
"@univerjs/sheets": "0.8.
|
|
53
|
+
"@univerjs-infra/shared": "0.8.3",
|
|
54
|
+
"@univerjs/sheets": "0.8.3-nightly.202506271607"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"test": "vitest run",
|