@univerjs/sheets-drawing 0.5.0 → 0.5.1
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";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"),l="sheets-drawing.config",w={};var d=(e=>(e.Position="0",e.Both="1",e.None="2",e))(d||{});class E extends u.UnitDrawingService{}const _=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 N={id:"sheet.mutation.set-drawing-apply",type:a.CommandType.MUTATION,handler:(e,i)=>{const r=e.get(u.IDrawingManagerService),t=e.get(_),{op:n,unitId:s,subUnitId:o,type:U,objects:c}=i;switch(r.applyJson1(s,o,n),t.applyJson1(s,o,n),U){case 0:r.addNotification(c),t.addNotification(c);break;case 1:r.removeNotification(c),t.removeNotification(c);break;case 2:r.updateNotification(c),t.updateNotification(c);break;case 3:r.orderNotification(c),t.orderNotification(c);break;case 4:r.groupUpdateNotification(c);break;case 5:r.ungroupUpdateNotification(c);break}return!0}};var I=Object.defineProperty,m=Object.getOwnPropertyDescriptor,p=(e,i,r,t)=>{for(var n=t>1?void 0:t?m(i,r):i,s=e.length-1,o;s>=0;s--)(o=e[s])&&(n=(t?o(i,r,n):o(n))||n);return t&&n&&I(i,r,n),n},g=(e,i)=>(r,t)=>i(r,t,e);const S="SHEET_DRAWING_PLUGIN";let v=class extends a.Disposable{constructor(e,i,r,t){super(),this._commandService=e,this._sheetDrawingService=i,this._drawingManagerService=r,this._resourceManagerService=t,this._initSnapshot(),this.disposeWithMe(this._commandService.registerCommand(N))}_initSnapshot(){const e=(r,t)=>{const n=t||this._sheetDrawingService.getDrawingDataForUnit(r);return n?JSON.stringify(n):""},i=r=>{if(!r)return{};try{return JSON.parse(r)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:S,businesses:[a.UniverInstanceType.UNIVER_SHEET],toJson:(r,t)=>e(r,t),parseJson:r=>i(r),onUnLoad:r=>{this._sheetDrawingService.removeDrawingDataForUnit(r),this._drawingManagerService.removeDrawingDataForUnit(r)},onLoad:(r,t)=>{this._sheetDrawingService.registerDrawingData(r,t),this._drawingManagerService.registerDrawingData(r,t)}}))}};v=p([g(0,a.ICommandService),g(1,_),g(2,u.IDrawingManagerService),g(3,a.IResourceManagerService)],v);var P=Object.defineProperty,O=Object.getOwnPropertyDescriptor,R=(e,i,r)=>i in e?P(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r,b=(e,i,r,t)=>{for(var n=t>1?void 0:t?O(i,r):i,s=e.length-1,o;s>=0;s--)(o=e[s])&&(n=(t?o(i,r,n):o(n))||n);return t&&n&&P(i,r,n),n},h=(e,i)=>(r,t)=>i(r,t,e),D=(e,i,r)=>R(e,typeof i!="symbol"?i+"":i,r);exports.UniverSheetsDrawingPlugin=class extends a.Plugin{constructor(i=w,r,t){super(),this._config=i,this._injector=r,this._configService=t;const{...n}=this._config;this._configService.setConfig(l,n)}onStarting(){[[v],[_,{useClass:E}]].forEach(i=>this._injector.add(i)),this._injector.get(v)}};D(exports.UniverSheetsDrawingPlugin,"pluginName",S);D(exports.UniverSheetsDrawingPlugin,"type",a.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsDrawingPlugin=b([a.DependentOn(u.UniverDrawingPlugin),h(1,a.Inject(a.Injector)),h(2,a.IConfigService)],exports.UniverSheetsDrawingPlugin);exports.DrawingApplyType=f;exports.ISheetDrawingService=_;exports.SHEET_DRAWING_PLUGIN=S;exports.SetDrawingApplyMutation=N;exports.SheetDrawingAnchorType=d;
|
package/lib/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createIdentifier as P, CommandType as U, Disposable as
|
|
1
|
+
import { createIdentifier as P, CommandType as U, Disposable as E, UniverInstanceType as h, ICommandService as l, IResourceManagerService as D, DependentOn as I, Inject as w, Injector as O, Plugin as R, IConfigService as b } from "@univerjs/core";
|
|
2
2
|
import { UnitDrawingService as p, IDrawingManagerService as f, UniverDrawingPlugin as M } from "@univerjs/drawing";
|
|
3
3
|
const G = "sheets-drawing.config", C = {};
|
|
4
4
|
var J = /* @__PURE__ */ ((e) => (e.Position = "0", e.Both = "1", e.None = "2", e))(J || {});
|
|
@@ -34,13 +34,13 @@ const F = {
|
|
|
34
34
|
return !0;
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
var
|
|
38
|
-
for (var n = t > 1 ? void 0 : t ?
|
|
37
|
+
var H = Object.defineProperty, W = Object.getOwnPropertyDescriptor, x = (e, i, r, t) => {
|
|
38
|
+
for (var n = t > 1 ? void 0 : t ? W(i, r) : i, a = e.length - 1, s; a >= 0; a--)
|
|
39
39
|
(s = e[a]) && (n = (t ? s(i, r, n) : s(n)) || n);
|
|
40
|
-
return t && n &&
|
|
40
|
+
return t && n && H(i, r, n), n;
|
|
41
41
|
}, c = (e, i) => (r, t) => i(r, t, e);
|
|
42
42
|
const d = "SHEET_DRAWING_PLUGIN";
|
|
43
|
-
let
|
|
43
|
+
let _ = class extends E {
|
|
44
44
|
constructor(e, i, r, t) {
|
|
45
45
|
super(), this._commandService = e, this._sheetDrawingService = i, this._drawingManagerService = r, this._resourceManagerService = t, this._initSnapshot(), this.disposeWithMe(this._commandService.registerCommand(F));
|
|
46
46
|
}
|
|
@@ -73,18 +73,18 @@ let g = class extends l {
|
|
|
73
73
|
);
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
|
-
|
|
77
|
-
c(0,
|
|
76
|
+
_ = x([
|
|
77
|
+
c(0, l),
|
|
78
78
|
c(1, v),
|
|
79
79
|
c(2, f),
|
|
80
80
|
c(3, D)
|
|
81
|
-
],
|
|
82
|
-
var S = Object.defineProperty,
|
|
83
|
-
for (var n = t > 1 ? void 0 : t ?
|
|
81
|
+
], _);
|
|
82
|
+
var S = Object.defineProperty, V = Object.getOwnPropertyDescriptor, $ = (e, i, r) => i in e ? S(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, s; a >= 0; a--)
|
|
84
84
|
(s = e[a]) && (n = (t ? s(i, r, n) : s(n)) || n);
|
|
85
85
|
return t && n && S(i, r, n), n;
|
|
86
86
|
}, u = (e, i) => (r, t) => i(r, t, e), N = (e, i, r) => $(e, typeof i != "symbol" ? i + "" : i, r);
|
|
87
|
-
let
|
|
87
|
+
let g = class extends R {
|
|
88
88
|
constructor(e = C, i, r) {
|
|
89
89
|
super(), this._config = e, this._injector = i, this._configService = r;
|
|
90
90
|
const { ...t } = this._config;
|
|
@@ -92,23 +92,23 @@ let _ = class extends R {
|
|
|
92
92
|
}
|
|
93
93
|
onStarting() {
|
|
94
94
|
[
|
|
95
|
-
[
|
|
95
|
+
[_],
|
|
96
96
|
[v, { useClass: j }]
|
|
97
|
-
].forEach((e) => this._injector.add(e)), this._injector.get(
|
|
97
|
+
].forEach((e) => this._injector.add(e)), this._injector.get(_);
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
-
N(
|
|
101
|
-
N(
|
|
102
|
-
|
|
100
|
+
N(g, "pluginName", d);
|
|
101
|
+
N(g, "type", h.UNIVER_SHEET);
|
|
102
|
+
g = B([
|
|
103
103
|
I(M),
|
|
104
104
|
u(1, w(O)),
|
|
105
105
|
u(2, b)
|
|
106
|
-
],
|
|
106
|
+
], g);
|
|
107
107
|
export {
|
|
108
108
|
L as DrawingApplyType,
|
|
109
109
|
v as ISheetDrawingService,
|
|
110
110
|
d as SHEET_DRAWING_PLUGIN,
|
|
111
111
|
F as SetDrawingApplyMutation,
|
|
112
112
|
J as SheetDrawingAnchorType,
|
|
113
|
-
|
|
113
|
+
g as UniverSheetsDrawingPlugin
|
|
114
114
|
};
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare const
|
|
16
|
+
export declare const SHEETS_DRAWING_PLUGIN_CONFIG_KEY = "sheets-drawing.config";
|
|
17
17
|
export declare const configSymbol: unique symbol;
|
|
18
18
|
export interface IUniverSheetsDrawingConfig {
|
|
19
19
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Serializable } from '@univerjs/core';
|
|
2
|
-
import {
|
|
1
|
+
import { IDrawingParam, IRotationSkewFlipTransform, Serializable } from '@univerjs/core';
|
|
2
|
+
import { IImageData, IUnitDrawingService, UnitDrawingService } from '@univerjs/drawing';
|
|
3
3
|
interface ICellPosition {
|
|
4
4
|
column: number;
|
|
5
5
|
columnOffset: number;
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(a,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/drawing")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/drawing"],s):(a=typeof globalThis<"u"?globalThis:a||self,s(a.UniverSheetsDrawing={},a.UniverCore,a.UniverDrawing))})(this,function(a,s,u){"use strict";const w="sheets-drawing.config",l={};var f=(e=>(e.Position="0",e.Both="1",e.None="2",e))(f||{});class m extends u.UnitDrawingService{}const v=s.createIdentifier("sheets-drawing.sheet-drawing.service");var d=(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))(d||{});const U={id:"sheet.mutation.set-drawing-apply",type:s.CommandType.MUTATION,handler:(e,r)=>{const i=e.get(u.IDrawingManagerService),n=e.get(v),{op:t,unitId:o,subUnitId:c,type:M,objects:g}=r;switch(i.applyJson1(o,c,t),n.applyJson1(o,c,t),M){case 0:i.addNotification(g),n.addNotification(g);break;case 1:i.removeNotification(g),n.removeNotification(g);break;case 2:i.updateNotification(g),n.updateNotification(g);break;case 3:i.orderNotification(g),n.orderNotification(g);break;case 4:i.groupUpdateNotification(g);break;case 5:i.ungroupUpdateNotification(g);break}return!0}};var
|
|
1
|
+
(function(a,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/drawing")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/drawing"],s):(a=typeof globalThis<"u"?globalThis:a||self,s(a.UniverSheetsDrawing={},a.UniverCore,a.UniverDrawing))})(this,function(a,s,u){"use strict";const w="sheets-drawing.config",l={};var f=(e=>(e.Position="0",e.Both="1",e.None="2",e))(f||{});class m extends u.UnitDrawingService{}const v=s.createIdentifier("sheets-drawing.sheet-drawing.service");var d=(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))(d||{});const U={id:"sheet.mutation.set-drawing-apply",type:s.CommandType.MUTATION,handler:(e,r)=>{const i=e.get(u.IDrawingManagerService),n=e.get(v),{op:t,unitId:o,subUnitId:c,type:M,objects:g}=r;switch(i.applyJson1(o,c,t),n.applyJson1(o,c,t),M){case 0:i.addNotification(g),n.addNotification(g);break;case 1:i.removeNotification(g),n.removeNotification(g);break;case 2:i.updateNotification(g),n.updateNotification(g);break;case 3:i.orderNotification(g),n.orderNotification(g);break;case 4:i.groupUpdateNotification(g);break;case 5:i.ungroupUpdateNotification(g);break}return!0}};var E=Object.defineProperty,I=Object.getOwnPropertyDescriptor,O=(e,r,i,n)=>{for(var t=n>1?void 0:n?I(r,i):r,o=e.length-1,c;o>=0;o--)(c=e[o])&&(t=(n?c(r,i,t):c(t))||t);return n&&t&&E(r,i,t),t},h=(e,r)=>(i,n)=>r(i,n,e);const _="SHEET_DRAWING_PLUGIN";let S=class extends s.Disposable{constructor(e,r,i,n){super(),this._commandService=e,this._sheetDrawingService=r,this._drawingManagerService=i,this._resourceManagerService=n,this._initSnapshot(),this.disposeWithMe(this._commandService.registerCommand(U))}_initSnapshot(){const e=(i,n)=>{const t=n||this._sheetDrawingService.getDrawingDataForUnit(i);return t?JSON.stringify(t):""},r=i=>{if(!i)return{};try{return JSON.parse(i)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:_,businesses:[s.UniverInstanceType.UNIVER_SHEET],toJson:(i,n)=>e(i,n),parseJson:i=>r(i),onUnLoad:i=>{this._sheetDrawingService.removeDrawingDataForUnit(i),this._drawingManagerService.removeDrawingDataForUnit(i)},onLoad:(i,n)=>{this._sheetDrawingService.registerDrawingData(i,n),this._drawingManagerService.registerDrawingData(i,n)}}))}};S=O([h(0,s.ICommandService),h(1,v),h(2,u.IDrawingManagerService),h(3,s.IResourceManagerService)],S);var D=Object.defineProperty,R=Object.getOwnPropertyDescriptor,b=(e,r,i)=>r in e?D(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i,p=(e,r,i,n)=>{for(var t=n>1?void 0:n?R(r,i):r,o=e.length-1,c;o>=0;o--)(c=e[o])&&(t=(n?c(r,i,t):c(t))||t);return n&&t&&D(r,i,t),t},N=(e,r)=>(i,n)=>r(i,n,e),P=(e,r,i)=>b(e,typeof r!="symbol"?r+"":r,i);a.UniverSheetsDrawingPlugin=class extends s.Plugin{constructor(r=l,i,n){super(),this._config=r,this._injector=i,this._configService=n;const{...t}=this._config;this._configService.setConfig(w,t)}onStarting(){[[S],[v,{useClass:m}]].forEach(r=>this._injector.add(r)),this._injector.get(S)}},P(a.UniverSheetsDrawingPlugin,"pluginName",_),P(a.UniverSheetsDrawingPlugin,"type",s.UniverInstanceType.UNIVER_SHEET),a.UniverSheetsDrawingPlugin=p([s.DependentOn(u.UniverDrawingPlugin),N(1,s.Inject(s.Injector)),N(2,s.IConfigService)],a.UniverSheetsDrawingPlugin),a.DrawingApplyType=d,a.ISheetDrawingService=v,a.SHEET_DRAWING_PLUGIN=_,a.SetDrawingApplyMutation=U,a.SheetDrawingAnchorType=f,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-drawing",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"lib"
|
|
44
44
|
],
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@univerjs/core": "0.5.
|
|
47
|
-
"@univerjs/drawing": "0.5.
|
|
46
|
+
"@univerjs/core": "0.5.1",
|
|
47
|
+
"@univerjs/drawing": "0.5.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"typescript": "^5.
|
|
51
|
-
"vite": "^
|
|
52
|
-
"vitest": "^2.1.
|
|
53
|
-
"@univerjs-infra/shared": "0.5.
|
|
50
|
+
"typescript": "^5.7.2",
|
|
51
|
+
"vite": "^6.0.1",
|
|
52
|
+
"vitest": "^2.1.6",
|
|
53
|
+
"@univerjs-infra/shared": "0.5.1"
|
|
54
54
|
},
|
|
55
55
|
"space": {
|
|
56
56
|
".": {
|