@univerjs/sheets-drawing 0.1.13 → 0.1.15
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 +3 -3
- package/lib/types/plugin.d.ts +2 -1
- package/lib/umd/index.js +1 -1
- package/package.json +25 -12
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var m=Object.defineProperty;var E=(
|
|
1
|
+
"use strict";var m=Object.defineProperty;var E=(r,t,e)=>t in r?m(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var d=(r,t,e)=>(E(r,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("@univerjs/core"),_=require("@wendellhu/redi"),f=require("@univerjs/drawing");var l=(r=>(r.Position="0",r.Both="1",r.None="2",r))(l||{});class I extends f.UnitDrawingService{}const h=_.createIdentifier("sheets-drawing.sheet-drawing.service");var D=(r=>(r[r.INSERT=0]="INSERT",r[r.REMOVE=1]="REMOVE",r[r.UPDATE=2]="UPDATE",r[r.ARRANGE=3]="ARRANGE",r[r.GROUP=4]="GROUP",r[r.UNGROUP=5]="UNGROUP",r))(D||{});const N={id:"sheet.mutation.set-drawing-apply",type:a.CommandType.MUTATION,handler:(r,t)=>{const e=r.get(f.IDrawingManagerService),i=r.get(h),{op:n,unitId:s,subUnitId:o,type:P,objects:c}=t;switch(e.applyJson1(s,o,n),i.applyJson1(s,o,n),P){case 0:e.addNotification(c),i.addNotification(c);break;case 1:e.removeNotification(c),i.removeNotification(c);break;case 2:e.updateNotification(c),i.updateNotification(c);break;case 3:e.orderNotification(c),i.orderNotification(c);break;case 4:e.groupUpdateNotification(c);break;case 5:e.ungroupUpdateNotification(c);break}return!0}};var O=Object.defineProperty,R=Object.getOwnPropertyDescriptor,U=(r,t,e,i)=>{for(var n=i>1?void 0:i?R(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&O(t,e,n),n},v=(r,t)=>(e,i)=>t(e,i,r);const w="SHEET_DRAWING_PLUGIN";let S=class extends a.Disposable{constructor(r){super(),this._commandService=r,this.disposeWithMe(this._commandService.registerCommand(N))}};S=U([a.OnLifecycle(a.LifecycleStages.Starting,S),v(0,a.ICommandService)],S);let u=class extends a.Disposable{constructor(r,t,e){super(),this._sheetDrawingService=r,this._drawingManagerService=t,this._resourceManagerService=e,this._init()}_init(){this._initSnapshot()}_initSnapshot(){const r=e=>{const i=this._sheetDrawingService.getDrawingDataForUnit(e);return i?JSON.stringify(i):""},t=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:w,businesses:[a.UniverInstanceType.UNIVER_SHEET],toJson:e=>r(e),parseJson:e=>t(e),onUnLoad:e=>{this._sheetDrawingService.removeDrawingDataForUnit(e),this._drawingManagerService.removeDrawingDataForUnit(e)},onLoad:(e,i)=>{this._sheetDrawingService.registerDrawingData(e,i),this._drawingManagerService.registerDrawingData(e,i)}}))}};u=U([a.OnLifecycle(a.LifecycleStages.Ready,u),v(0,h),v(1,f.IDrawingManagerService),v(2,a.IResourceManagerService)],u);var p=Object.defineProperty,b=Object.getOwnPropertyDescriptor,M=(r,t,e,i)=>{for(var n=i>1?void 0:i?b(t,e):t,s=r.length-1,o;s>=0;s--)(o=r[s])&&(n=(i?o(t,e,n):o(n))||n);return i&&n&&p(t,e,n),n},G=(r,t)=>(e,i)=>t(e,i,r),g;exports.UniverSheetsDrawingPlugin=(g=class extends a.Plugin{constructor(t,e){super(),this._config=t,this._injector=e}onStarting(t){[[S],[u],[h,{useClass:I}]].forEach(e=>t.add(e))}},d(g,"pluginName",w),d(g,"type",a.UniverInstanceType.UNIVER_SHEET),g);exports.UniverSheetsDrawingPlugin=M([G(1,_.Inject(_.Injector))],exports.UniverSheetsDrawingPlugin);exports.DrawingApplyType=D;exports.ISheetDrawingService=h;exports.SetDrawingApplyMutation=N;exports.SheetDrawingAnchorType=l;
|
package/lib/es/index.js
CHANGED
|
@@ -100,8 +100,8 @@ var W = Object.defineProperty, $ = Object.getOwnPropertyDescriptor, F = (e, r, t
|
|
|
100
100
|
return i && a && W(r, t, a), a;
|
|
101
101
|
}, B = (e, r) => (t, i) => r(t, i, e), c;
|
|
102
102
|
let S = (c = class extends b {
|
|
103
|
-
constructor(e) {
|
|
104
|
-
super(), this._injector =
|
|
103
|
+
constructor(e, r) {
|
|
104
|
+
super(), this._config = e, this._injector = r;
|
|
105
105
|
}
|
|
106
106
|
onStarting(e) {
|
|
107
107
|
[
|
|
@@ -112,7 +112,7 @@ let S = (c = class extends b {
|
|
|
112
112
|
}
|
|
113
113
|
}, h(c, "pluginName", E), h(c, "type", m.UNIVER_SHEET), c);
|
|
114
114
|
S = F([
|
|
115
|
-
B(
|
|
115
|
+
B(1, p(G))
|
|
116
116
|
], S);
|
|
117
117
|
export {
|
|
118
118
|
L as DrawingApplyType,
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import { Plugin, UniverInstanceType } from '@univerjs/core';
|
|
|
2
2
|
import { Injector } from '@wendellhu/redi';
|
|
3
3
|
|
|
4
4
|
export declare class UniverSheetsDrawingPlugin extends Plugin {
|
|
5
|
+
private readonly _config;
|
|
5
6
|
readonly _injector: Injector;
|
|
6
7
|
static pluginName: string;
|
|
7
8
|
static type: UniverInstanceType;
|
|
8
|
-
constructor(_injector: Injector);
|
|
9
|
+
constructor(_config: unknown, _injector: Injector);
|
|
9
10
|
onStarting(_injector: Injector): void;
|
|
10
11
|
}
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(a,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@univerjs/core"),require("@wendellhu/redi"),require("@univerjs/drawing")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@wendellhu/redi","@univerjs/drawing"],r):(a=typeof globalThis<"u"?globalThis:a||self,r(a.UniverSheetsDrawing={},a.UniverCore,a["@wendellhu/redi"],a.UniverDrawing))})(this,function(a,r,v,_){"use strict";var j=Object.defineProperty;var G=(a,r,v)=>r in a?j(a,r,{enumerable:!0,configurable:!0,writable:!0,value:v}):a[r]=v;var l=(a,r,v)=>(G(a,typeof r!="symbol"?r+"":r,v),v);var f;var w=(
|
|
1
|
+
(function(a,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@univerjs/core"),require("@wendellhu/redi"),require("@univerjs/drawing")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@wendellhu/redi","@univerjs/drawing"],r):(a=typeof globalThis<"u"?globalThis:a||self,r(a.UniverSheetsDrawing={},a.UniverCore,a["@wendellhu/redi"],a.UniverDrawing))})(this,function(a,r,v,_){"use strict";var j=Object.defineProperty;var G=(a,r,v)=>r in a?j(a,r,{enumerable:!0,configurable:!0,writable:!0,value:v}):a[r]=v;var l=(a,r,v)=>(G(a,typeof r!="symbol"?r+"":r,v),v);var f;var w=(i=>(i.Position="0",i.Both="1",i.None="2",i))(w||{});class m extends _.UnitDrawingService{}const g=v.createIdentifier("sheets-drawing.sheet-drawing.service");var D=(i=>(i[i.INSERT=0]="INSERT",i[i.REMOVE=1]="REMOVE",i[i.UPDATE=2]="UPDATE",i[i.ARRANGE=3]="ARRANGE",i[i.GROUP=4]="GROUP",i[i.UNGROUP=5]="UNGROUP",i))(D||{});const U={id:"sheet.mutation.set-drawing-apply",type:r.CommandType.MUTATION,handler:(i,n)=>{const e=i.get(_.IDrawingManagerService),t=i.get(g),{op:s,unitId:o,subUnitId:c,type:b,objects:u}=n;switch(e.applyJson1(o,c,s),t.applyJson1(o,c,s),b){case 0:e.addNotification(u),t.addNotification(u);break;case 1:e.removeNotification(u),t.removeNotification(u);break;case 2:e.updateNotification(u),t.updateNotification(u);break;case 3:e.orderNotification(u),t.orderNotification(u);break;case 4:e.groupUpdateNotification(u);break;case 5:e.ungroupUpdateNotification(u);break}return!0}};var E=Object.defineProperty,I=Object.getOwnPropertyDescriptor,N=(i,n,e,t)=>{for(var s=t>1?void 0:t?I(n,e):n,o=i.length-1,c;o>=0;o--)(c=i[o])&&(s=(t?c(n,e,s):c(s))||s);return t&&s&&E(n,e,s),s},d=(i,n)=>(e,t)=>n(e,t,i);const P="SHEET_DRAWING_PLUGIN";let h=class extends r.Disposable{constructor(i){super(),this._commandService=i,this.disposeWithMe(this._commandService.registerCommand(U))}};h=N([r.OnLifecycle(r.LifecycleStages.Starting,h),d(0,r.ICommandService)],h);let S=class extends r.Disposable{constructor(i,n,e){super(),this._sheetDrawingService=i,this._drawingManagerService=n,this._resourceManagerService=e,this._init()}_init(){this._initSnapshot()}_initSnapshot(){const i=e=>{const t=this._sheetDrawingService.getDrawingDataForUnit(e);return t?JSON.stringify(t):""},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:P,businesses:[r.UniverInstanceType.UNIVER_SHEET],toJson:e=>i(e),parseJson:e=>n(e),onUnLoad:e=>{this._sheetDrawingService.removeDrawingDataForUnit(e),this._drawingManagerService.removeDrawingDataForUnit(e)},onLoad:(e,t)=>{this._sheetDrawingService.registerDrawingData(e,t),this._drawingManagerService.registerDrawingData(e,t)}}))}};S=N([r.OnLifecycle(r.LifecycleStages.Ready,S),d(0,g),d(1,_.IDrawingManagerService),d(2,r.IResourceManagerService)],S);var O=Object.defineProperty,R=Object.getOwnPropertyDescriptor,p=(i,n,e,t)=>{for(var s=t>1?void 0:t?R(n,e):n,o=i.length-1,c;o>=0;o--)(c=i[o])&&(s=(t?c(n,e,s):c(s))||s);return t&&s&&O(n,e,s),s},M=(i,n)=>(e,t)=>n(e,t,i);a.UniverSheetsDrawingPlugin=(f=class extends r.Plugin{constructor(n,e){super(),this._config=n,this._injector=e}onStarting(n){[[h],[S],[g,{useClass:m}]].forEach(e=>n.add(e))}},l(f,"pluginName",P),l(f,"type",r.UniverInstanceType.UNIVER_SHEET),f),a.UniverSheetsDrawingPlugin=p([M(1,v.Inject(v.Injector))],a.UniverSheetsDrawingPlugin),a.DrawingApplyType=D,a.ISheetDrawingService=g,a.SetDrawingApplyMutation=U,a.SheetDrawingAnchorType=w,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.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -44,26 +44,39 @@
|
|
|
44
44
|
"lib"
|
|
45
45
|
],
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@wendellhu/redi": "0.15.
|
|
48
|
-
"@univerjs/drawing": "0.1.
|
|
49
|
-
"@univerjs/core": "0.1.
|
|
47
|
+
"@wendellhu/redi": "0.15.4",
|
|
48
|
+
"@univerjs/drawing": "0.1.15",
|
|
49
|
+
"@univerjs/core": "0.1.15"
|
|
50
50
|
},
|
|
51
|
-
"dependencies": {},
|
|
52
51
|
"devDependencies": {
|
|
53
|
-
"@wendellhu/redi": "^0.15.
|
|
52
|
+
"@wendellhu/redi": "^0.15.4",
|
|
54
53
|
"typescript": "^5.4.5",
|
|
55
|
-
"vite": "^5.2.
|
|
54
|
+
"vite": "^5.2.13",
|
|
56
55
|
"vitest": "^1.6.0",
|
|
57
|
-
"@univerjs/
|
|
58
|
-
"@univerjs/drawing": "0.1.
|
|
59
|
-
"@univerjs/
|
|
60
|
-
"@univerjs/sheets": "0.1.
|
|
56
|
+
"@univerjs/core": "0.1.15",
|
|
57
|
+
"@univerjs/drawing": "0.1.15",
|
|
58
|
+
"@univerjs/shared": "0.1.15",
|
|
59
|
+
"@univerjs/sheets": "0.1.15"
|
|
60
|
+
},
|
|
61
|
+
"univerSpace": {
|
|
62
|
+
".": {
|
|
63
|
+
"import": "./lib/es/index.js",
|
|
64
|
+
"require": "./lib/cjs/index.js",
|
|
65
|
+
"types": "./lib/types/index.d.ts"
|
|
66
|
+
},
|
|
67
|
+
"./*": {
|
|
68
|
+
"import": "./lib/es/*",
|
|
69
|
+
"require": "./lib/cjs/*",
|
|
70
|
+
"types": "./lib/types/index.d.ts"
|
|
71
|
+
},
|
|
72
|
+
"./lib/*": "./lib/*"
|
|
61
73
|
},
|
|
62
74
|
"scripts": {
|
|
63
75
|
"test": "vitest run",
|
|
64
76
|
"test:watch": "vitest",
|
|
65
77
|
"coverage": "vitest run --coverage",
|
|
66
78
|
"lint:types": "tsc --noEmit",
|
|
67
|
-
"build": "tsc && vite build"
|
|
79
|
+
"build": "tsc && vite build",
|
|
80
|
+
"sync:cnpm": "cnpm sync"
|
|
68
81
|
}
|
|
69
82
|
}
|