@univerjs/docs-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 +11 -11
- package/lib/index.js +11 -11
- package/lib/types/index.d.ts +3 -2
- package/lib/umd/index.js +1 -1
- package/package.json +4 -4
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var U=Object.defineProperty;var p=(i,e,t)=>e in i?U(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var _=(i,e,t)=>p(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@univerjs/core"),h=require("@univerjs/drawing")
|
|
1
|
+
"use strict";var U=Object.defineProperty;var p=(i,e,t)=>e in i?U(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var _=(i,e,t)=>p(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@univerjs/core"),h=require("@univerjs/drawing");class d extends h.UnitDrawingService{}const v=o.createIdentifier("univer.doc.plugin.doc-drawing.service");var f=Object.getOwnPropertyDescriptor,I=(i,e,t,r)=>{for(var n=r>1?void 0:r?f(e,t):e,a=i.length-1,s;a>=0;a--)(s=i[a])&&(n=s(n)||n);return n},g=(i,e)=>(t,r)=>e(t,r,i);const l="DOC_DRAWING_PLUGIN";exports.DocDrawingController=class extends o.Disposable{constructor(e,t,r,n){super(),this._docDrawingService=e,this._drawingManagerService=t,this._resourceManagerService=r,this._univerInstanceService=n,this._init()}_init(){this._initSnapshot()}_initSnapshot(){const e=r=>{const n=this._univerInstanceService.getUnit(r,o.UniverInstanceType.UNIVER_DOC);if(n){const a=n.getSnapshot().drawings,s=n.getSnapshot().drawingsOrder,c={data:a!=null?a:{},order:s!=null?s:[]};return JSON.stringify(c)}return""},t=r=>{if(!r)return{data:{},order:[]};try{return JSON.parse(r)}catch{return{data:{},order:[]}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:l,businesses:[o.UniverInstanceType.UNIVER_DOC],toJson:r=>e(r),parseJson:r=>t(r),onUnLoad:r=>{this._setDrawingDataForUnit(r,{data:{},order:[]})},onLoad:(r,n)=>{var a,s;this._setDrawingDataForUnit(r,{data:(a=n.data)!=null?a:{},order:(s=n.order)!=null?s:[]})}}))}_setDrawingDataForUnit(e,t){const r=this._univerInstanceService.getUnit(e);r!=null&&(r.resetDrawing(t.data,t.order),this.loadDrawingDataForUnit(e))}loadDrawingDataForUnit(e){const t=this._univerInstanceService.getUnit(e,o.UniverInstanceType.UNIVER_DOC);if(!t)return!1;const r=e,n=t.getDrawings(),a=t.getDrawingsOrder();if(!n||!a)return!1;Object.keys(n).forEach(c=>{const S=n[c];n[c]={...S}});const s={[r]:{unitId:e,subUnitId:r,data:n,order:a}};return this._docDrawingService.registerDrawingData(e,s),this._drawingManagerService.registerDrawingData(e,s),!0}};exports.DocDrawingController=I([g(0,v),g(1,h.IDrawingManagerService),g(2,o.IResourceManagerService),g(3,o.IUniverInstanceService)],exports.DocDrawingController);const C="docs-drawing.config",u={};var O=Object.getOwnPropertyDescriptor,P=(i,e,t,r)=>{for(var n=r>1?void 0:r?O(e,t):e,a=i.length-1,s;a>=0;a--)(s=i[a])&&(n=s(n)||n);return n},w=(i,e)=>(t,r)=>e(t,r,i),D;exports.UniverDocsDrawingPlugin=(D=class extends o.Plugin{constructor(e=u,t,r){super(),this._config=e,this._injector=t,this._configService=r;const{...n}=o.merge({},u,this._config);this._configService.setConfig(C,n)}onStarting(){[[exports.DocDrawingController],[d],[v,{useClass:d}]].forEach(e=>this._injector.add(e)),o.touchDependencies(this._injector,[[exports.DocDrawingController]])}},_(D,"pluginName",l),_(D,"type",o.UniverInstanceType.UNIVER_DOC),D);exports.UniverDocsDrawingPlugin=P([w(1,o.Inject(o.Injector)),w(2,o.IConfigService)],exports.UniverDocsDrawingPlugin);exports.DOCS_DRAWING_PLUGIN=l;exports.DocDrawingService=d;exports.IDocDrawingService=v;
|
package/lib/es/index.js
CHANGED
|
@@ -3,12 +3,11 @@ var p = (r, t, e) => t in r ? f(r, t, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var _ = (r, t, e) => p(r, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { createIdentifier as U, Disposable as I, UniverInstanceType as g, IResourceManagerService as O, IUniverInstanceService as C, Plugin as N, merge as P, touchDependencies as M, Inject as m, Injector as R, IConfigService as b } from "@univerjs/core";
|
|
5
5
|
import { UnitDrawingService as j, IDrawingManagerService as y } from "@univerjs/drawing";
|
|
6
|
-
|
|
7
|
-
class v extends j {
|
|
6
|
+
class d extends j {
|
|
8
7
|
}
|
|
9
8
|
const l = U("univer.doc.plugin.doc-drawing.service");
|
|
10
|
-
var
|
|
11
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
9
|
+
var E = Object.getOwnPropertyDescriptor, G = (r, t, e, n) => {
|
|
10
|
+
for (var i = n > 1 ? void 0 : n ? E(t, e) : t, a = r.length - 1, s; a >= 0; a--)
|
|
12
11
|
(s = r[a]) && (i = s(i) || i);
|
|
13
12
|
return i;
|
|
14
13
|
}, o = (r, t) => (e, n) => t(e, n, r);
|
|
@@ -82,32 +81,33 @@ let D = class extends I {
|
|
|
82
81
|
return this._docDrawingService.registerDrawingData(r, a), this._drawingManagerService.registerDrawingData(r, a), !0;
|
|
83
82
|
}
|
|
84
83
|
};
|
|
85
|
-
D =
|
|
84
|
+
D = G([
|
|
86
85
|
o(0, l),
|
|
87
86
|
o(1, y),
|
|
88
87
|
o(2, O),
|
|
89
88
|
o(3, C)
|
|
90
89
|
], D);
|
|
90
|
+
const F = "docs-drawing.config", v = {};
|
|
91
91
|
var J = Object.getOwnPropertyDescriptor, L = (r, t, e, n) => {
|
|
92
92
|
for (var i = n > 1 ? void 0 : n ? J(t, e) : t, a = r.length - 1, s; a >= 0; a--)
|
|
93
93
|
(s = r[a]) && (i = s(i) || i);
|
|
94
94
|
return i;
|
|
95
95
|
}, u = (r, t) => (e, n) => t(e, n, r), c;
|
|
96
96
|
let h = (c = class extends N {
|
|
97
|
-
constructor(r =
|
|
97
|
+
constructor(r = v, t, e) {
|
|
98
98
|
super(), this._config = r, this._injector = t, this._configService = e;
|
|
99
99
|
const { ...n } = P(
|
|
100
100
|
{},
|
|
101
|
-
|
|
101
|
+
v,
|
|
102
102
|
this._config
|
|
103
103
|
);
|
|
104
|
-
this._configService.setConfig(
|
|
104
|
+
this._configService.setConfig(F, n);
|
|
105
105
|
}
|
|
106
106
|
onStarting() {
|
|
107
107
|
[
|
|
108
108
|
[D],
|
|
109
|
-
[
|
|
110
|
-
[l, { useClass:
|
|
109
|
+
[d],
|
|
110
|
+
[l, { useClass: d }]
|
|
111
111
|
].forEach((r) => this._injector.add(r)), M(this._injector, [
|
|
112
112
|
[D]
|
|
113
113
|
]);
|
|
@@ -120,7 +120,7 @@ h = L([
|
|
|
120
120
|
export {
|
|
121
121
|
w as DOCS_DRAWING_PLUGIN,
|
|
122
122
|
D as DocDrawingController,
|
|
123
|
-
|
|
123
|
+
d as DocDrawingService,
|
|
124
124
|
l as IDocDrawingService,
|
|
125
125
|
h as UniverDocsDrawingPlugin
|
|
126
126
|
};
|
package/lib/index.js
CHANGED
|
@@ -3,12 +3,11 @@ var p = (r, t, e) => t in r ? f(r, t, { enumerable: !0, configurable: !0, writab
|
|
|
3
3
|
var _ = (r, t, e) => p(r, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
import { createIdentifier as U, Disposable as I, UniverInstanceType as g, IResourceManagerService as O, IUniverInstanceService as C, Plugin as N, merge as P, touchDependencies as M, Inject as m, Injector as R, IConfigService as b } from "@univerjs/core";
|
|
5
5
|
import { UnitDrawingService as j, IDrawingManagerService as y } from "@univerjs/drawing";
|
|
6
|
-
|
|
7
|
-
class v extends j {
|
|
6
|
+
class d extends j {
|
|
8
7
|
}
|
|
9
8
|
const l = U("univer.doc.plugin.doc-drawing.service");
|
|
10
|
-
var
|
|
11
|
-
for (var i = n > 1 ? void 0 : n ?
|
|
9
|
+
var E = Object.getOwnPropertyDescriptor, G = (r, t, e, n) => {
|
|
10
|
+
for (var i = n > 1 ? void 0 : n ? E(t, e) : t, a = r.length - 1, s; a >= 0; a--)
|
|
12
11
|
(s = r[a]) && (i = s(i) || i);
|
|
13
12
|
return i;
|
|
14
13
|
}, o = (r, t) => (e, n) => t(e, n, r);
|
|
@@ -82,32 +81,33 @@ let D = class extends I {
|
|
|
82
81
|
return this._docDrawingService.registerDrawingData(r, a), this._drawingManagerService.registerDrawingData(r, a), !0;
|
|
83
82
|
}
|
|
84
83
|
};
|
|
85
|
-
D =
|
|
84
|
+
D = G([
|
|
86
85
|
o(0, l),
|
|
87
86
|
o(1, y),
|
|
88
87
|
o(2, O),
|
|
89
88
|
o(3, C)
|
|
90
89
|
], D);
|
|
90
|
+
const F = "docs-drawing.config", v = {};
|
|
91
91
|
var J = Object.getOwnPropertyDescriptor, L = (r, t, e, n) => {
|
|
92
92
|
for (var i = n > 1 ? void 0 : n ? J(t, e) : t, a = r.length - 1, s; a >= 0; a--)
|
|
93
93
|
(s = r[a]) && (i = s(i) || i);
|
|
94
94
|
return i;
|
|
95
95
|
}, u = (r, t) => (e, n) => t(e, n, r), c;
|
|
96
96
|
let h = (c = class extends N {
|
|
97
|
-
constructor(r =
|
|
97
|
+
constructor(r = v, t, e) {
|
|
98
98
|
super(), this._config = r, this._injector = t, this._configService = e;
|
|
99
99
|
const { ...n } = P(
|
|
100
100
|
{},
|
|
101
|
-
|
|
101
|
+
v,
|
|
102
102
|
this._config
|
|
103
103
|
);
|
|
104
|
-
this._configService.setConfig(
|
|
104
|
+
this._configService.setConfig(F, n);
|
|
105
105
|
}
|
|
106
106
|
onStarting() {
|
|
107
107
|
[
|
|
108
108
|
[D],
|
|
109
|
-
[
|
|
110
|
-
[l, { useClass:
|
|
109
|
+
[d],
|
|
110
|
+
[l, { useClass: d }]
|
|
111
111
|
].forEach((r) => this._injector.add(r)), M(this._injector, [
|
|
112
112
|
[D]
|
|
113
113
|
]);
|
|
@@ -120,7 +120,7 @@ h = L([
|
|
|
120
120
|
export {
|
|
121
121
|
w as DOCS_DRAWING_PLUGIN,
|
|
122
122
|
D as DocDrawingController,
|
|
123
|
-
|
|
123
|
+
d as DocDrawingService,
|
|
124
124
|
l as IDocDrawingService,
|
|
125
125
|
h as UniverDocsDrawingPlugin
|
|
126
126
|
};
|
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 {
|
|
17
|
-
export { DocDrawingService, type IDocDrawing, IDocDrawingService, type IDocImage } from './services/doc-drawing.service';
|
|
16
|
+
export type { IUniverDocsDrawingConfig } from './controllers/config.schema';
|
|
18
17
|
export { DOCS_DRAWING_PLUGIN, type IDocDrawingModel } from './controllers/doc-drawing.controller';
|
|
19
18
|
export { DocDrawingController } from './controllers/doc-drawing.controller';
|
|
19
|
+
export { UniverDocsDrawingPlugin } from './plugin';
|
|
20
|
+
export { DocDrawingService, type IDocDrawing, IDocDrawingService, type IDocImage } from './services/doc-drawing.service';
|
|
20
21
|
export { type IDocFloatDom } from './services/doc-drawing.service';
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(t,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@univerjs/core"),require("@univerjs/drawing")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/drawing"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t.UniverDocsDrawing={},t.UniverCore,t.UniverDrawing))})(this,function(t,r,g){"use strict";var P=Object.defineProperty;var N=(t,r,g)=>r in t?P(t,r,{enumerable:!0,configurable:!0,writable:!0,value:g}):t[r]=g;var w=(t,r,g)=>N(t,typeof r!="symbol"?r+"":r,g);var d;
|
|
1
|
+
(function(t,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("@univerjs/core"),require("@univerjs/drawing")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/drawing"],r):(t=typeof globalThis<"u"?globalThis:t||self,r(t.UniverDocsDrawing={},t.UniverCore,t.UniverDrawing))})(this,function(t,r,g){"use strict";var P=Object.defineProperty;var N=(t,r,g)=>r in t?P(t,r,{enumerable:!0,configurable:!0,writable:!0,value:g}):t[r]=g;var w=(t,r,g)=>N(t,typeof r!="symbol"?r+"":r,g);var d;class u extends g.UnitDrawingService{}const _=r.createIdentifier("univer.doc.plugin.doc-drawing.service");var S=Object.getOwnPropertyDescriptor,U=(c,i,a,e)=>{for(var n=e>1?void 0:e?S(i,a):i,s=c.length-1,o;s>=0;s--)(o=c[s])&&(n=o(n)||n);return n},D=(c,i)=>(a,e)=>i(a,e,c);const l="DOC_DRAWING_PLUGIN";t.DocDrawingController=class extends r.Disposable{constructor(i,a,e,n){super(),this._docDrawingService=i,this._drawingManagerService=a,this._resourceManagerService=e,this._univerInstanceService=n,this._init()}_init(){this._initSnapshot()}_initSnapshot(){const i=e=>{const n=this._univerInstanceService.getUnit(e,r.UniverInstanceType.UNIVER_DOC);if(n){const s=n.getSnapshot().drawings,o=n.getSnapshot().drawingsOrder,v={data:s!=null?s:{},order:o!=null?o:[]};return JSON.stringify(v)}return""},a=e=>{if(!e)return{data:{},order:[]};try{return JSON.parse(e)}catch{return{data:{},order:[]}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:l,businesses:[r.UniverInstanceType.UNIVER_DOC],toJson:e=>i(e),parseJson:e=>a(e),onUnLoad:e=>{this._setDrawingDataForUnit(e,{data:{},order:[]})},onLoad:(e,n)=>{var s,o;this._setDrawingDataForUnit(e,{data:(s=n.data)!=null?s:{},order:(o=n.order)!=null?o:[]})}}))}_setDrawingDataForUnit(i,a){const e=this._univerInstanceService.getUnit(i);e!=null&&(e.resetDrawing(a.data,a.order),this.loadDrawingDataForUnit(i))}loadDrawingDataForUnit(i){const a=this._univerInstanceService.getUnit(i,r.UniverInstanceType.UNIVER_DOC);if(!a)return!1;const e=i,n=a.getDrawings(),s=a.getDrawingsOrder();if(!n||!s)return!1;Object.keys(n).forEach(v=>{const O=n[v];n[v]={...O}});const o={[e]:{unitId:i,subUnitId:e,data:n,order:s}};return this._docDrawingService.registerDrawingData(i,o),this._drawingManagerService.registerDrawingData(i,o),!0}},t.DocDrawingController=U([D(0,_),D(1,g.IDrawingManagerService),D(2,r.IResourceManagerService),D(3,r.IUniverInstanceService)],t.DocDrawingController);const I="docs-drawing.config",h={};var p=Object.getOwnPropertyDescriptor,C=(c,i,a,e)=>{for(var n=e>1?void 0:e?p(i,a):i,s=c.length-1,o;s>=0;s--)(o=c[s])&&(n=o(n)||n);return n},f=(c,i)=>(a,e)=>i(a,e,c);t.UniverDocsDrawingPlugin=(d=class extends r.Plugin{constructor(i=h,a,e){super(),this._config=i,this._injector=a,this._configService=e;const{...n}=r.merge({},h,this._config);this._configService.setConfig(I,n)}onStarting(){[[t.DocDrawingController],[u],[_,{useClass:u}]].forEach(i=>this._injector.add(i)),r.touchDependencies(this._injector,[[t.DocDrawingController]])}},w(d,"pluginName",l),w(d,"type",r.UniverInstanceType.UNIVER_DOC),d),t.UniverDocsDrawingPlugin=C([f(1,r.Inject(r.Injector)),f(2,r.IConfigService)],t.UniverDocsDrawingPlugin),t.DOCS_DRAWING_PLUGIN=l,t.DocDrawingService=u,t.IDocDrawingService=_,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/docs-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,14 +43,14 @@
|
|
|
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.
|
|
53
|
+
"@univerjs-infra/shared": "0.8.3"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"test": "vitest run",
|