@univerjs/watermark 0.17.0 → 0.18.0
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/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -41
- package/lib/es/index.js +1 -201
- package/lib/facade.js +1 -41
- package/lib/index.js +1 -201
- package/lib/types/common/const.d.ts +16 -1
- package/lib/types/config/config.d.ts +16 -1
- package/lib/types/controllers/watermark.render.controller.d.ts +18 -2
- package/lib/types/facade/f-univer.d.ts +17 -1
- package/lib/types/plugin.d.ts +16 -1
- package/lib/types/services/watermark.service.d.ts +20 -4
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +8 -7
- package/lib/types/controllers/watermark.render.controller.spec.d.ts +0 -16
- package/lib/types/facade/f-univer.spec.d.ts +0 -16
- package/lib/types/services/watermark.service.spec.d.ts +0 -16
package/lib/cjs/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
let e=require(`@univerjs/core/facade`),t=require(`@univerjs/engine-render`),n=require(`@univerjs/watermark`);var r=class extends e.FUniver{addWatermark(e,r){let i=this._injector.get(n.WatermarkService);if(e===t.IWatermarkTypeEnum.Text)i.updateWatermarkConfig({type:t.IWatermarkTypeEnum.Text,config:{text:{...n.WatermarkTextBaseConfig,...r}}});else if(e===t.IWatermarkTypeEnum.Image)i.updateWatermarkConfig({type:t.IWatermarkTypeEnum.Image,config:{image:{...n.WatermarkImageBaseConfig,...r}}});else throw Error(`Unknown watermark type`);return this}deleteWatermark(){return this._injector.get(n.WatermarkService).deleteWatermarkConfig(),this}},i=class{get IWatermarkTypeEnum(){return t.IWatermarkTypeEnum}};e.FUniver.extend(r),e.FEnum.extend(i);
|
package/lib/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`@univerjs/core`),t=require(`@univerjs/engine-render`),n=require(`rxjs`);const r=[`image/png`,`image/jpeg`,`image/jpg`,`image/bmp`],i={content:``,fontSize:16,color:`rgb(0,0,0)`,bold:!1,italic:!1,direction:`ltr`,x:60,y:36,repeat:!0,spacingX:200,spacingY:100,rotate:0,opacity:.15},a={url:``,width:100,height:100,maintainAspectRatio:!0,originRatio:1,x:60,y:36,repeat:!0,spacingX:200,spacingY:100,rotate:0,opacity:.15},o={name:!0,email:!1,phone:!1,uid:!1,fontSize:16,color:`rgb(0,0,0)`,bold:!1,italic:!1,direction:`ltr`,x:60,y:60,repeat:!0,spacingX:200,spacingY:100,rotate:-30,opacity:.15};var s=`@univerjs/watermark`,c=`0.18.0`;const l=`watermark.config`;Symbol(l);const u={};function d(e){"@babel/helpers - typeof";return d=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},d(e)}function f(e,t){if(d(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(d(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function p(e){var t=f(e,`string`);return d(t)==`symbol`?t:t+``}function m(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function h(e,t){return function(n,r){t(n,r,e)}}function g(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let _=class extends e.Disposable{constructor(e){super(),this._localStorageService=e,m(this,`_updateConfig$`,new n.Subject),m(this,`updateConfig$`,this._updateConfig$.asObservable()),m(this,`_refresh$`,new n.Subject),m(this,`refresh$`,this._refresh$.asObservable())}async getWatermarkConfig(){return await this._localStorageService.getItem(t.UNIVER_WATERMARK_STORAGE_KEY)}updateWatermarkConfig(e){this._localStorageService.setItem(t.UNIVER_WATERMARK_STORAGE_KEY,e),this._updateConfig$.next(e)}deleteWatermarkConfig(){this._localStorageService.removeItem(t.UNIVER_WATERMARK_STORAGE_KEY),this._updateConfig$.next(null)}refresh(){this._refresh$.next(Math.random())}dispose(){this._refresh$.complete(),this._updateConfig$.complete()}};_=g([h(0,(0,e.Inject)(e.ILocalStorageService))],_);let v=class extends e.RxDisposable{constructor(e,n,r,i){super(),this._context=e,this._watermarkService=n,this._localStorageService=r,this._userManagerService=i,m(this,`_watermarkLayer`,void 0),this._watermarkLayer=new t.WatermarkLayer(e.scene,[],t.UNIVER_WATERMARK_LAYER_INDEX),this._initAddRender(),this._initWatermarkUpdate(),this._initWatermarkConfig()}_initAddRender(){let{scene:e}=this._context;e.addLayer(this._watermarkLayer)}async _initWatermarkConfig(){let e=await this._localStorageService.getItem(t.UNIVER_WATERMARK_STORAGE_KEY);if(e){var n;this._watermarkService.updateWatermarkConfig(e),(n=this._context.mainComponent)==null||n.makeDirty()}}_initWatermarkUpdate(){this.disposeWithMe(this._watermarkService.updateConfig$.subscribe(e=>{var n;if(!e){var r;this._watermarkLayer.updateConfig(),(r=this._context.mainComponent)==null||r.makeDirty();return}e.type===t.IWatermarkTypeEnum.UserInfo?this._watermarkLayer.updateConfig(e,this._userManagerService.getCurrentUser()):this._watermarkLayer.updateConfig(e),(n=this._context.mainComponent)==null||n.makeDirty()}))}};v=g([h(1,(0,e.Inject)(_)),h(2,(0,e.Inject)(e.ILocalStorageService)),h(3,(0,e.Inject)(e.UserManagerService))],v);let y=class extends e.Plugin{constructor(t=u,n,r,i,a){super(),this._config=t,this._injector=n,this._configService=r,this._renderManagerSrv=i,this._localStorageService=a;let{...o}=(0,e.merge)({},u,this._config);this._configService.setConfig(l,o),this._initWatermarkStorage(),this._initDependencies()}async _initWatermarkStorage(){let n=this._configService.getConfig(l);if(!n)return;let{userWatermarkSettings:r,textWatermarkSettings:s,imageWatermarkSettings:c}=n;if(r)this._localStorageService.setItem(t.UNIVER_WATERMARK_STORAGE_KEY,{type:t.IWatermarkTypeEnum.UserInfo,config:{userInfo:(0,e.merge)({},o,r)}});else if(s)this._localStorageService.setItem(t.UNIVER_WATERMARK_STORAGE_KEY,{type:t.IWatermarkTypeEnum.Text,config:{text:(0,e.merge)({},i,s)}});else if(c)this._localStorageService.setItem(t.UNIVER_WATERMARK_STORAGE_KEY,{type:t.IWatermarkTypeEnum.Image,config:{image:(0,e.merge)({},a,c)}});else{let e=await this._localStorageService.getItem(t.UNIVER_WATERMARK_STORAGE_KEY);(e==null?void 0:e.type)===t.IWatermarkTypeEnum.UserInfo&&this._localStorageService.removeItem(t.UNIVER_WATERMARK_STORAGE_KEY)}}_initDependencies(){[[_]].forEach(e=>{this._injector.add(e)})}onRendered(){this._injector.get(_),this._initRenderDependencies()}_initRenderDependencies(){[[v]].forEach(t=>{this._renderManagerSrv.registerRenderModule(e.UniverInstanceType.UNIVER_SHEET,t),this._renderManagerSrv.registerRenderModule(e.UniverInstanceType.UNIVER_DOC,t)})}};m(y,`pluginName`,`UNIVER_WATERMARK_PLUGIN`),m(y,`packageName`,s),m(y,`version`,c),y=g([h(1,(0,e.Inject)(e.Injector)),h(2,e.IConfigService),h(3,t.IRenderManagerService),h(4,(0,e.Inject)(e.ILocalStorageService))],y),Object.defineProperty(exports,`UniverWatermarkPlugin`,{enumerable:!0,get:function(){return y}}),exports.WATERMARK_IMAGE_ALLOW_IMAGE_LIST=r,exports.WatermarkImageBaseConfig=a,Object.defineProperty(exports,`WatermarkService`,{enumerable:!0,get:function(){return _}}),exports.WatermarkTextBaseConfig=i,exports.WatermarkUserInfoBaseConfig=o;
|
package/lib/es/facade.js
CHANGED
|
@@ -1,41 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IWatermarkTypeEnum as e } from "@univerjs/engine-render";
|
|
3
|
-
import { WatermarkService as m, WatermarkTextBaseConfig as k, WatermarkImageBaseConfig as s } from "@univerjs/watermark";
|
|
4
|
-
class g extends n {
|
|
5
|
-
addWatermark(r, t) {
|
|
6
|
-
const a = this._injector.get(m);
|
|
7
|
-
if (r === e.Text)
|
|
8
|
-
a.updateWatermarkConfig({
|
|
9
|
-
type: e.Text,
|
|
10
|
-
config: {
|
|
11
|
-
text: {
|
|
12
|
-
...k,
|
|
13
|
-
...t
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
else if (r === e.Image)
|
|
18
|
-
a.updateWatermarkConfig({
|
|
19
|
-
type: e.Image,
|
|
20
|
-
config: {
|
|
21
|
-
image: {
|
|
22
|
-
...s,
|
|
23
|
-
...t
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
else
|
|
28
|
-
throw new Error("Unknown watermark type");
|
|
29
|
-
return this;
|
|
30
|
-
}
|
|
31
|
-
deleteWatermark() {
|
|
32
|
-
return this._injector.get(m).deleteWatermarkConfig(), this;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
class W {
|
|
36
|
-
get IWatermarkTypeEnum() {
|
|
37
|
-
return e;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
n.extend(g);
|
|
41
|
-
o.extend(W);
|
|
1
|
+
import{FEnum as e,FUniver as t}from"@univerjs/core/facade";import{IWatermarkTypeEnum as n}from"@univerjs/engine-render";import{WatermarkImageBaseConfig as r,WatermarkService as i,WatermarkTextBaseConfig as a}from"@univerjs/watermark";var o=class extends t{addWatermark(e,t){let o=this._injector.get(i);if(e===n.Text)o.updateWatermarkConfig({type:n.Text,config:{text:{...a,...t}}});else if(e===n.Image)o.updateWatermarkConfig({type:n.Image,config:{image:{...r,...t}}});else throw Error(`Unknown watermark type`);return this}deleteWatermark(){return this._injector.get(i).deleteWatermarkConfig(),this}},s=class{get IWatermarkTypeEnum(){return n}};t.extend(o),e.extend(s);export{};
|
package/lib/es/index.js
CHANGED
|
@@ -1,201 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var W = (t, e, r) => e in t ? R(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
-
var s = (t, e, r) => W(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { Inject as g, ILocalStorageService as d, Disposable as w, UserManagerService as E, RxDisposable as x, Injector as A, IConfigService as M, Plugin as $, merge as p, UniverInstanceType as S } from "@univerjs/core";
|
|
5
|
-
import { UNIVER_WATERMARK_STORAGE_KEY as o, WatermarkLayer as b, UNIVER_WATERMARK_LAYER_INDEX as D, IWatermarkTypeEnum as m, IRenderManagerService as U } from "@univerjs/engine-render";
|
|
6
|
-
import { Subject as u } from "rxjs";
|
|
7
|
-
const J = ["image/png", "image/jpeg", "image/jpg", "image/bmp"], L = {
|
|
8
|
-
content: "",
|
|
9
|
-
fontSize: 16,
|
|
10
|
-
color: "rgb(0,0,0)",
|
|
11
|
-
bold: !1,
|
|
12
|
-
italic: !1,
|
|
13
|
-
direction: "ltr",
|
|
14
|
-
x: 60,
|
|
15
|
-
y: 36,
|
|
16
|
-
repeat: !0,
|
|
17
|
-
spacingX: 200,
|
|
18
|
-
spacingY: 100,
|
|
19
|
-
rotate: 0,
|
|
20
|
-
opacity: 0.15
|
|
21
|
-
}, O = {
|
|
22
|
-
url: "",
|
|
23
|
-
width: 100,
|
|
24
|
-
height: 100,
|
|
25
|
-
maintainAspectRatio: !0,
|
|
26
|
-
originRatio: 1,
|
|
27
|
-
x: 60,
|
|
28
|
-
y: 36,
|
|
29
|
-
repeat: !0,
|
|
30
|
-
spacingX: 200,
|
|
31
|
-
spacingY: 100,
|
|
32
|
-
rotate: 0,
|
|
33
|
-
opacity: 0.15
|
|
34
|
-
}, j = {
|
|
35
|
-
name: !0,
|
|
36
|
-
email: !1,
|
|
37
|
-
phone: !1,
|
|
38
|
-
uid: !1,
|
|
39
|
-
fontSize: 16,
|
|
40
|
-
color: "rgb(0,0,0)",
|
|
41
|
-
bold: !1,
|
|
42
|
-
italic: !1,
|
|
43
|
-
direction: "ltr",
|
|
44
|
-
x: 60,
|
|
45
|
-
y: 60,
|
|
46
|
-
repeat: !0,
|
|
47
|
-
spacingX: 200,
|
|
48
|
-
spacingY: 100,
|
|
49
|
-
rotate: -30,
|
|
50
|
-
opacity: 0.15
|
|
51
|
-
}, P = "@univerjs/watermark", T = "0.17.0", I = {
|
|
52
|
-
name: P,
|
|
53
|
-
version: T
|
|
54
|
-
}, k = "watermark.config", C = {};
|
|
55
|
-
var N = Object.getOwnPropertyDescriptor, K = (t, e, r, a) => {
|
|
56
|
-
for (var i = a > 1 ? void 0 : a ? N(e, r) : e, n = t.length - 1, c; n >= 0; n--)
|
|
57
|
-
(c = t[n]) && (i = c(i) || i);
|
|
58
|
-
return i;
|
|
59
|
-
}, G = (t, e) => (r, a) => e(r, a, t);
|
|
60
|
-
let l = class extends w {
|
|
61
|
-
constructor(e) {
|
|
62
|
-
super();
|
|
63
|
-
s(this, "_updateConfig$", new u());
|
|
64
|
-
s(this, "updateConfig$", this._updateConfig$.asObservable());
|
|
65
|
-
s(this, "_refresh$", new u());
|
|
66
|
-
s(this, "refresh$", this._refresh$.asObservable());
|
|
67
|
-
this._localStorageService = e;
|
|
68
|
-
}
|
|
69
|
-
async getWatermarkConfig() {
|
|
70
|
-
return await this._localStorageService.getItem(o);
|
|
71
|
-
}
|
|
72
|
-
updateWatermarkConfig(e) {
|
|
73
|
-
this._localStorageService.setItem(o, e), this._updateConfig$.next(e);
|
|
74
|
-
}
|
|
75
|
-
deleteWatermarkConfig() {
|
|
76
|
-
this._localStorageService.removeItem(o), this._updateConfig$.next(null);
|
|
77
|
-
}
|
|
78
|
-
refresh() {
|
|
79
|
-
this._refresh$.next(Math.random());
|
|
80
|
-
}
|
|
81
|
-
dispose() {
|
|
82
|
-
this._refresh$.complete(), this._updateConfig$.complete();
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
l = K([
|
|
86
|
-
G(0, g(d))
|
|
87
|
-
], l);
|
|
88
|
-
var Y = Object.getOwnPropertyDescriptor, V = (t, e, r, a) => {
|
|
89
|
-
for (var i = a > 1 ? void 0 : a ? Y(e, r) : e, n = t.length - 1, c; n >= 0; n--)
|
|
90
|
-
(c = t[n]) && (i = c(i) || i);
|
|
91
|
-
return i;
|
|
92
|
-
}, h = (t, e) => (r, a) => e(r, a, t);
|
|
93
|
-
let v = class extends x {
|
|
94
|
-
constructor(e, r, a, i) {
|
|
95
|
-
super();
|
|
96
|
-
s(this, "_watermarkLayer");
|
|
97
|
-
this._context = e, this._watermarkService = r, this._localStorageService = a, this._userManagerService = i, this._watermarkLayer = new b(e.scene, [], D), this._initAddRender(), this._initWatermarkUpdate(), this._initWatermarkConfig();
|
|
98
|
-
}
|
|
99
|
-
_initAddRender() {
|
|
100
|
-
const { scene: e } = this._context;
|
|
101
|
-
e.addLayer(this._watermarkLayer);
|
|
102
|
-
}
|
|
103
|
-
async _initWatermarkConfig() {
|
|
104
|
-
var r;
|
|
105
|
-
const e = await this._localStorageService.getItem(o);
|
|
106
|
-
e && (this._watermarkService.updateWatermarkConfig(e), (r = this._context.mainComponent) == null || r.makeDirty());
|
|
107
|
-
}
|
|
108
|
-
_initWatermarkUpdate() {
|
|
109
|
-
this.disposeWithMe(
|
|
110
|
-
this._watermarkService.updateConfig$.subscribe((e) => {
|
|
111
|
-
var r, a;
|
|
112
|
-
if (!e) {
|
|
113
|
-
this._watermarkLayer.updateConfig(), (r = this._context.mainComponent) == null || r.makeDirty();
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
e.type === m.UserInfo ? this._watermarkLayer.updateConfig(e, this._userManagerService.getCurrentUser()) : this._watermarkLayer.updateConfig(e), (a = this._context.mainComponent) == null || a.makeDirty();
|
|
117
|
-
})
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
v = V([
|
|
122
|
-
h(1, g(l)),
|
|
123
|
-
h(2, g(d)),
|
|
124
|
-
h(3, g(E))
|
|
125
|
-
], v);
|
|
126
|
-
var X = Object.getOwnPropertyDescriptor, B = (t, e, r, a) => {
|
|
127
|
-
for (var i = a > 1 ? void 0 : a ? X(e, r) : e, n = t.length - 1, c; n >= 0; n--)
|
|
128
|
-
(c = t[n]) && (i = c(i) || i);
|
|
129
|
-
return i;
|
|
130
|
-
}, f = (t, e) => (r, a) => e(r, a, t), _;
|
|
131
|
-
let y = (_ = class extends $ {
|
|
132
|
-
constructor(t = C, e, r, a, i) {
|
|
133
|
-
super(), this._config = t, this._injector = e, this._configService = r, this._renderManagerSrv = a, this._localStorageService = i;
|
|
134
|
-
const { ...n } = p(
|
|
135
|
-
{},
|
|
136
|
-
C,
|
|
137
|
-
this._config
|
|
138
|
-
);
|
|
139
|
-
this._configService.setConfig(k, n), this._initWatermarkStorage(), this._initDependencies();
|
|
140
|
-
}
|
|
141
|
-
async _initWatermarkStorage() {
|
|
142
|
-
const t = this._configService.getConfig(k);
|
|
143
|
-
if (!t)
|
|
144
|
-
return;
|
|
145
|
-
const { userWatermarkSettings: e, textWatermarkSettings: r, imageWatermarkSettings: a } = t;
|
|
146
|
-
if (e)
|
|
147
|
-
this._localStorageService.setItem(o, {
|
|
148
|
-
type: m.UserInfo,
|
|
149
|
-
config: {
|
|
150
|
-
userInfo: p({}, j, e)
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
else if (r)
|
|
154
|
-
this._localStorageService.setItem(o, {
|
|
155
|
-
type: m.Text,
|
|
156
|
-
config: {
|
|
157
|
-
text: p({}, L, r)
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
else if (a)
|
|
161
|
-
this._localStorageService.setItem(o, {
|
|
162
|
-
type: m.Image,
|
|
163
|
-
config: {
|
|
164
|
-
image: p({}, O, a)
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
else {
|
|
168
|
-
const i = await this._localStorageService.getItem(o);
|
|
169
|
-
(i == null ? void 0 : i.type) === m.UserInfo && this._localStorageService.removeItem(o);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
_initDependencies() {
|
|
173
|
-
[[l]].forEach((t) => {
|
|
174
|
-
this._injector.add(t);
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
onRendered() {
|
|
178
|
-
this._injector.get(l), this._initRenderDependencies();
|
|
179
|
-
}
|
|
180
|
-
_initRenderDependencies() {
|
|
181
|
-
[
|
|
182
|
-
[v]
|
|
183
|
-
].forEach((t) => {
|
|
184
|
-
this._renderManagerSrv.registerRenderModule(S.UNIVER_SHEET, t), this._renderManagerSrv.registerRenderModule(S.UNIVER_DOC, t);
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
}, s(_, "pluginName", "UNIVER_WATERMARK_PLUGIN"), s(_, "packageName", I.name), s(_, "version", I.version), _);
|
|
188
|
-
y = B([
|
|
189
|
-
f(1, g(A)),
|
|
190
|
-
f(2, M),
|
|
191
|
-
f(3, U),
|
|
192
|
-
f(4, g(d))
|
|
193
|
-
], y);
|
|
194
|
-
export {
|
|
195
|
-
y as UniverWatermarkPlugin,
|
|
196
|
-
J as WATERMARK_IMAGE_ALLOW_IMAGE_LIST,
|
|
197
|
-
O as WatermarkImageBaseConfig,
|
|
198
|
-
l as WatermarkService,
|
|
199
|
-
L as WatermarkTextBaseConfig,
|
|
200
|
-
j as WatermarkUserInfoBaseConfig
|
|
201
|
-
};
|
|
1
|
+
import{Disposable as e,IConfigService as t,ILocalStorageService as n,Inject as r,Injector as i,Plugin as a,RxDisposable as o,UniverInstanceType as s,UserManagerService as c,merge as l}from"@univerjs/core";import{IRenderManagerService as u,IWatermarkTypeEnum as d,UNIVER_WATERMARK_LAYER_INDEX as f,UNIVER_WATERMARK_STORAGE_KEY as p,WatermarkLayer as m}from"@univerjs/engine-render";import{Subject as h}from"rxjs";const g=[`image/png`,`image/jpeg`,`image/jpg`,`image/bmp`],_={content:``,fontSize:16,color:`rgb(0,0,0)`,bold:!1,italic:!1,direction:`ltr`,x:60,y:36,repeat:!0,spacingX:200,spacingY:100,rotate:0,opacity:.15},v={url:``,width:100,height:100,maintainAspectRatio:!0,originRatio:1,x:60,y:36,repeat:!0,spacingX:200,spacingY:100,rotate:0,opacity:.15},y={name:!0,email:!1,phone:!1,uid:!1,fontSize:16,color:`rgb(0,0,0)`,bold:!1,italic:!1,direction:`ltr`,x:60,y:60,repeat:!0,spacingX:200,spacingY:100,rotate:-30,opacity:.15};var b=`@univerjs/watermark`,x=`0.18.0`;const S=`watermark.config`;Symbol(S);const C={};function w(e){"@babel/helpers - typeof";return w=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},w(e)}function T(e,t){if(w(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(w(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function E(e){var t=T(e,`string`);return w(t)==`symbol`?t:t+``}function D(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e,t){return function(n,r){t(n,r,e)}}function k(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let A=class extends e{constructor(e){super(),this._localStorageService=e,D(this,`_updateConfig$`,new h),D(this,`updateConfig$`,this._updateConfig$.asObservable()),D(this,`_refresh$`,new h),D(this,`refresh$`,this._refresh$.asObservable())}async getWatermarkConfig(){return await this._localStorageService.getItem(p)}updateWatermarkConfig(e){this._localStorageService.setItem(p,e),this._updateConfig$.next(e)}deleteWatermarkConfig(){this._localStorageService.removeItem(p),this._updateConfig$.next(null)}refresh(){this._refresh$.next(Math.random())}dispose(){this._refresh$.complete(),this._updateConfig$.complete()}};A=k([O(0,r(n))],A);let j=class extends o{constructor(e,t,n,r){super(),this._context=e,this._watermarkService=t,this._localStorageService=n,this._userManagerService=r,D(this,`_watermarkLayer`,void 0),this._watermarkLayer=new m(e.scene,[],f),this._initAddRender(),this._initWatermarkUpdate(),this._initWatermarkConfig()}_initAddRender(){let{scene:e}=this._context;e.addLayer(this._watermarkLayer)}async _initWatermarkConfig(){let e=await this._localStorageService.getItem(p);if(e){var t;this._watermarkService.updateWatermarkConfig(e),(t=this._context.mainComponent)==null||t.makeDirty()}}_initWatermarkUpdate(){this.disposeWithMe(this._watermarkService.updateConfig$.subscribe(e=>{var t;if(!e){var n;this._watermarkLayer.updateConfig(),(n=this._context.mainComponent)==null||n.makeDirty();return}e.type===d.UserInfo?this._watermarkLayer.updateConfig(e,this._userManagerService.getCurrentUser()):this._watermarkLayer.updateConfig(e),(t=this._context.mainComponent)==null||t.makeDirty()}))}};j=k([O(1,r(A)),O(2,r(n)),O(3,r(c))],j);let M=class extends a{constructor(e=C,t,n,r,i){super(),this._config=e,this._injector=t,this._configService=n,this._renderManagerSrv=r,this._localStorageService=i;let{...a}=l({},C,this._config);this._configService.setConfig(S,a),this._initWatermarkStorage(),this._initDependencies()}async _initWatermarkStorage(){let e=this._configService.getConfig(S);if(!e)return;let{userWatermarkSettings:t,textWatermarkSettings:n,imageWatermarkSettings:r}=e;if(t)this._localStorageService.setItem(p,{type:d.UserInfo,config:{userInfo:l({},y,t)}});else if(n)this._localStorageService.setItem(p,{type:d.Text,config:{text:l({},_,n)}});else if(r)this._localStorageService.setItem(p,{type:d.Image,config:{image:l({},v,r)}});else{let e=await this._localStorageService.getItem(p);(e==null?void 0:e.type)===d.UserInfo&&this._localStorageService.removeItem(p)}}_initDependencies(){[[A]].forEach(e=>{this._injector.add(e)})}onRendered(){this._injector.get(A),this._initRenderDependencies()}_initRenderDependencies(){[[j]].forEach(e=>{this._renderManagerSrv.registerRenderModule(s.UNIVER_SHEET,e),this._renderManagerSrv.registerRenderModule(s.UNIVER_DOC,e)})}};D(M,`pluginName`,`UNIVER_WATERMARK_PLUGIN`),D(M,`packageName`,b),D(M,`version`,x),M=k([O(1,r(i)),O(2,t),O(3,u),O(4,r(n))],M);export{M as UniverWatermarkPlugin,g as WATERMARK_IMAGE_ALLOW_IMAGE_LIST,v as WatermarkImageBaseConfig,A as WatermarkService,_ as WatermarkTextBaseConfig,y as WatermarkUserInfoBaseConfig};
|
package/lib/facade.js
CHANGED
|
@@ -1,41 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { IWatermarkTypeEnum as e } from "@univerjs/engine-render";
|
|
3
|
-
import { WatermarkService as m, WatermarkTextBaseConfig as k, WatermarkImageBaseConfig as s } from "@univerjs/watermark";
|
|
4
|
-
class g extends n {
|
|
5
|
-
addWatermark(r, t) {
|
|
6
|
-
const a = this._injector.get(m);
|
|
7
|
-
if (r === e.Text)
|
|
8
|
-
a.updateWatermarkConfig({
|
|
9
|
-
type: e.Text,
|
|
10
|
-
config: {
|
|
11
|
-
text: {
|
|
12
|
-
...k,
|
|
13
|
-
...t
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
else if (r === e.Image)
|
|
18
|
-
a.updateWatermarkConfig({
|
|
19
|
-
type: e.Image,
|
|
20
|
-
config: {
|
|
21
|
-
image: {
|
|
22
|
-
...s,
|
|
23
|
-
...t
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
else
|
|
28
|
-
throw new Error("Unknown watermark type");
|
|
29
|
-
return this;
|
|
30
|
-
}
|
|
31
|
-
deleteWatermark() {
|
|
32
|
-
return this._injector.get(m).deleteWatermarkConfig(), this;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
class W {
|
|
36
|
-
get IWatermarkTypeEnum() {
|
|
37
|
-
return e;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
n.extend(g);
|
|
41
|
-
o.extend(W);
|
|
1
|
+
import{FEnum as e,FUniver as t}from"@univerjs/core/facade";import{IWatermarkTypeEnum as n}from"@univerjs/engine-render";import{WatermarkImageBaseConfig as r,WatermarkService as i,WatermarkTextBaseConfig as a}from"@univerjs/watermark";var o=class extends t{addWatermark(e,t){let o=this._injector.get(i);if(e===n.Text)o.updateWatermarkConfig({type:n.Text,config:{text:{...a,...t}}});else if(e===n.Image)o.updateWatermarkConfig({type:n.Image,config:{image:{...r,...t}}});else throw Error(`Unknown watermark type`);return this}deleteWatermark(){return this._injector.get(i).deleteWatermarkConfig(),this}},s=class{get IWatermarkTypeEnum(){return n}};t.extend(o),e.extend(s);export{};
|
package/lib/index.js
CHANGED
|
@@ -1,201 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
var W = (t, e, r) => e in t ? R(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
-
var s = (t, e, r) => W(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { Inject as g, ILocalStorageService as d, Disposable as w, UserManagerService as E, RxDisposable as x, Injector as A, IConfigService as M, Plugin as $, merge as p, UniverInstanceType as S } from "@univerjs/core";
|
|
5
|
-
import { UNIVER_WATERMARK_STORAGE_KEY as o, WatermarkLayer as b, UNIVER_WATERMARK_LAYER_INDEX as D, IWatermarkTypeEnum as m, IRenderManagerService as U } from "@univerjs/engine-render";
|
|
6
|
-
import { Subject as u } from "rxjs";
|
|
7
|
-
const J = ["image/png", "image/jpeg", "image/jpg", "image/bmp"], L = {
|
|
8
|
-
content: "",
|
|
9
|
-
fontSize: 16,
|
|
10
|
-
color: "rgb(0,0,0)",
|
|
11
|
-
bold: !1,
|
|
12
|
-
italic: !1,
|
|
13
|
-
direction: "ltr",
|
|
14
|
-
x: 60,
|
|
15
|
-
y: 36,
|
|
16
|
-
repeat: !0,
|
|
17
|
-
spacingX: 200,
|
|
18
|
-
spacingY: 100,
|
|
19
|
-
rotate: 0,
|
|
20
|
-
opacity: 0.15
|
|
21
|
-
}, O = {
|
|
22
|
-
url: "",
|
|
23
|
-
width: 100,
|
|
24
|
-
height: 100,
|
|
25
|
-
maintainAspectRatio: !0,
|
|
26
|
-
originRatio: 1,
|
|
27
|
-
x: 60,
|
|
28
|
-
y: 36,
|
|
29
|
-
repeat: !0,
|
|
30
|
-
spacingX: 200,
|
|
31
|
-
spacingY: 100,
|
|
32
|
-
rotate: 0,
|
|
33
|
-
opacity: 0.15
|
|
34
|
-
}, j = {
|
|
35
|
-
name: !0,
|
|
36
|
-
email: !1,
|
|
37
|
-
phone: !1,
|
|
38
|
-
uid: !1,
|
|
39
|
-
fontSize: 16,
|
|
40
|
-
color: "rgb(0,0,0)",
|
|
41
|
-
bold: !1,
|
|
42
|
-
italic: !1,
|
|
43
|
-
direction: "ltr",
|
|
44
|
-
x: 60,
|
|
45
|
-
y: 60,
|
|
46
|
-
repeat: !0,
|
|
47
|
-
spacingX: 200,
|
|
48
|
-
spacingY: 100,
|
|
49
|
-
rotate: -30,
|
|
50
|
-
opacity: 0.15
|
|
51
|
-
}, P = "@univerjs/watermark", T = "0.17.0", I = {
|
|
52
|
-
name: P,
|
|
53
|
-
version: T
|
|
54
|
-
}, k = "watermark.config", C = {};
|
|
55
|
-
var N = Object.getOwnPropertyDescriptor, K = (t, e, r, a) => {
|
|
56
|
-
for (var i = a > 1 ? void 0 : a ? N(e, r) : e, n = t.length - 1, c; n >= 0; n--)
|
|
57
|
-
(c = t[n]) && (i = c(i) || i);
|
|
58
|
-
return i;
|
|
59
|
-
}, G = (t, e) => (r, a) => e(r, a, t);
|
|
60
|
-
let l = class extends w {
|
|
61
|
-
constructor(e) {
|
|
62
|
-
super();
|
|
63
|
-
s(this, "_updateConfig$", new u());
|
|
64
|
-
s(this, "updateConfig$", this._updateConfig$.asObservable());
|
|
65
|
-
s(this, "_refresh$", new u());
|
|
66
|
-
s(this, "refresh$", this._refresh$.asObservable());
|
|
67
|
-
this._localStorageService = e;
|
|
68
|
-
}
|
|
69
|
-
async getWatermarkConfig() {
|
|
70
|
-
return await this._localStorageService.getItem(o);
|
|
71
|
-
}
|
|
72
|
-
updateWatermarkConfig(e) {
|
|
73
|
-
this._localStorageService.setItem(o, e), this._updateConfig$.next(e);
|
|
74
|
-
}
|
|
75
|
-
deleteWatermarkConfig() {
|
|
76
|
-
this._localStorageService.removeItem(o), this._updateConfig$.next(null);
|
|
77
|
-
}
|
|
78
|
-
refresh() {
|
|
79
|
-
this._refresh$.next(Math.random());
|
|
80
|
-
}
|
|
81
|
-
dispose() {
|
|
82
|
-
this._refresh$.complete(), this._updateConfig$.complete();
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
l = K([
|
|
86
|
-
G(0, g(d))
|
|
87
|
-
], l);
|
|
88
|
-
var Y = Object.getOwnPropertyDescriptor, V = (t, e, r, a) => {
|
|
89
|
-
for (var i = a > 1 ? void 0 : a ? Y(e, r) : e, n = t.length - 1, c; n >= 0; n--)
|
|
90
|
-
(c = t[n]) && (i = c(i) || i);
|
|
91
|
-
return i;
|
|
92
|
-
}, h = (t, e) => (r, a) => e(r, a, t);
|
|
93
|
-
let v = class extends x {
|
|
94
|
-
constructor(e, r, a, i) {
|
|
95
|
-
super();
|
|
96
|
-
s(this, "_watermarkLayer");
|
|
97
|
-
this._context = e, this._watermarkService = r, this._localStorageService = a, this._userManagerService = i, this._watermarkLayer = new b(e.scene, [], D), this._initAddRender(), this._initWatermarkUpdate(), this._initWatermarkConfig();
|
|
98
|
-
}
|
|
99
|
-
_initAddRender() {
|
|
100
|
-
const { scene: e } = this._context;
|
|
101
|
-
e.addLayer(this._watermarkLayer);
|
|
102
|
-
}
|
|
103
|
-
async _initWatermarkConfig() {
|
|
104
|
-
var r;
|
|
105
|
-
const e = await this._localStorageService.getItem(o);
|
|
106
|
-
e && (this._watermarkService.updateWatermarkConfig(e), (r = this._context.mainComponent) == null || r.makeDirty());
|
|
107
|
-
}
|
|
108
|
-
_initWatermarkUpdate() {
|
|
109
|
-
this.disposeWithMe(
|
|
110
|
-
this._watermarkService.updateConfig$.subscribe((e) => {
|
|
111
|
-
var r, a;
|
|
112
|
-
if (!e) {
|
|
113
|
-
this._watermarkLayer.updateConfig(), (r = this._context.mainComponent) == null || r.makeDirty();
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
e.type === m.UserInfo ? this._watermarkLayer.updateConfig(e, this._userManagerService.getCurrentUser()) : this._watermarkLayer.updateConfig(e), (a = this._context.mainComponent) == null || a.makeDirty();
|
|
117
|
-
})
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
v = V([
|
|
122
|
-
h(1, g(l)),
|
|
123
|
-
h(2, g(d)),
|
|
124
|
-
h(3, g(E))
|
|
125
|
-
], v);
|
|
126
|
-
var X = Object.getOwnPropertyDescriptor, B = (t, e, r, a) => {
|
|
127
|
-
for (var i = a > 1 ? void 0 : a ? X(e, r) : e, n = t.length - 1, c; n >= 0; n--)
|
|
128
|
-
(c = t[n]) && (i = c(i) || i);
|
|
129
|
-
return i;
|
|
130
|
-
}, f = (t, e) => (r, a) => e(r, a, t), _;
|
|
131
|
-
let y = (_ = class extends $ {
|
|
132
|
-
constructor(t = C, e, r, a, i) {
|
|
133
|
-
super(), this._config = t, this._injector = e, this._configService = r, this._renderManagerSrv = a, this._localStorageService = i;
|
|
134
|
-
const { ...n } = p(
|
|
135
|
-
{},
|
|
136
|
-
C,
|
|
137
|
-
this._config
|
|
138
|
-
);
|
|
139
|
-
this._configService.setConfig(k, n), this._initWatermarkStorage(), this._initDependencies();
|
|
140
|
-
}
|
|
141
|
-
async _initWatermarkStorage() {
|
|
142
|
-
const t = this._configService.getConfig(k);
|
|
143
|
-
if (!t)
|
|
144
|
-
return;
|
|
145
|
-
const { userWatermarkSettings: e, textWatermarkSettings: r, imageWatermarkSettings: a } = t;
|
|
146
|
-
if (e)
|
|
147
|
-
this._localStorageService.setItem(o, {
|
|
148
|
-
type: m.UserInfo,
|
|
149
|
-
config: {
|
|
150
|
-
userInfo: p({}, j, e)
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
else if (r)
|
|
154
|
-
this._localStorageService.setItem(o, {
|
|
155
|
-
type: m.Text,
|
|
156
|
-
config: {
|
|
157
|
-
text: p({}, L, r)
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
else if (a)
|
|
161
|
-
this._localStorageService.setItem(o, {
|
|
162
|
-
type: m.Image,
|
|
163
|
-
config: {
|
|
164
|
-
image: p({}, O, a)
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
else {
|
|
168
|
-
const i = await this._localStorageService.getItem(o);
|
|
169
|
-
(i == null ? void 0 : i.type) === m.UserInfo && this._localStorageService.removeItem(o);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
_initDependencies() {
|
|
173
|
-
[[l]].forEach((t) => {
|
|
174
|
-
this._injector.add(t);
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
onRendered() {
|
|
178
|
-
this._injector.get(l), this._initRenderDependencies();
|
|
179
|
-
}
|
|
180
|
-
_initRenderDependencies() {
|
|
181
|
-
[
|
|
182
|
-
[v]
|
|
183
|
-
].forEach((t) => {
|
|
184
|
-
this._renderManagerSrv.registerRenderModule(S.UNIVER_SHEET, t), this._renderManagerSrv.registerRenderModule(S.UNIVER_DOC, t);
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
}, s(_, "pluginName", "UNIVER_WATERMARK_PLUGIN"), s(_, "packageName", I.name), s(_, "version", I.version), _);
|
|
188
|
-
y = B([
|
|
189
|
-
f(1, g(A)),
|
|
190
|
-
f(2, M),
|
|
191
|
-
f(3, U),
|
|
192
|
-
f(4, g(d))
|
|
193
|
-
], y);
|
|
194
|
-
export {
|
|
195
|
-
y as UniverWatermarkPlugin,
|
|
196
|
-
J as WATERMARK_IMAGE_ALLOW_IMAGE_LIST,
|
|
197
|
-
O as WatermarkImageBaseConfig,
|
|
198
|
-
l as WatermarkService,
|
|
199
|
-
L as WatermarkTextBaseConfig,
|
|
200
|
-
j as WatermarkUserInfoBaseConfig
|
|
201
|
-
};
|
|
1
|
+
import{Disposable as e,IConfigService as t,ILocalStorageService as n,Inject as r,Injector as i,Plugin as a,RxDisposable as o,UniverInstanceType as s,UserManagerService as c,merge as l}from"@univerjs/core";import{IRenderManagerService as u,IWatermarkTypeEnum as d,UNIVER_WATERMARK_LAYER_INDEX as f,UNIVER_WATERMARK_STORAGE_KEY as p,WatermarkLayer as m}from"@univerjs/engine-render";import{Subject as h}from"rxjs";const g=[`image/png`,`image/jpeg`,`image/jpg`,`image/bmp`],_={content:``,fontSize:16,color:`rgb(0,0,0)`,bold:!1,italic:!1,direction:`ltr`,x:60,y:36,repeat:!0,spacingX:200,spacingY:100,rotate:0,opacity:.15},v={url:``,width:100,height:100,maintainAspectRatio:!0,originRatio:1,x:60,y:36,repeat:!0,spacingX:200,spacingY:100,rotate:0,opacity:.15},y={name:!0,email:!1,phone:!1,uid:!1,fontSize:16,color:`rgb(0,0,0)`,bold:!1,italic:!1,direction:`ltr`,x:60,y:60,repeat:!0,spacingX:200,spacingY:100,rotate:-30,opacity:.15};var b=`@univerjs/watermark`,x=`0.18.0`;const S=`watermark.config`;Symbol(S);const C={};function w(e){"@babel/helpers - typeof";return w=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},w(e)}function T(e,t){if(w(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(w(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function E(e){var t=T(e,`string`);return w(t)==`symbol`?t:t+``}function D(e,t,n){return(t=E(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e,t){return function(n,r){t(n,r,e)}}function k(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let A=class extends e{constructor(e){super(),this._localStorageService=e,D(this,`_updateConfig$`,new h),D(this,`updateConfig$`,this._updateConfig$.asObservable()),D(this,`_refresh$`,new h),D(this,`refresh$`,this._refresh$.asObservable())}async getWatermarkConfig(){return await this._localStorageService.getItem(p)}updateWatermarkConfig(e){this._localStorageService.setItem(p,e),this._updateConfig$.next(e)}deleteWatermarkConfig(){this._localStorageService.removeItem(p),this._updateConfig$.next(null)}refresh(){this._refresh$.next(Math.random())}dispose(){this._refresh$.complete(),this._updateConfig$.complete()}};A=k([O(0,r(n))],A);let j=class extends o{constructor(e,t,n,r){super(),this._context=e,this._watermarkService=t,this._localStorageService=n,this._userManagerService=r,D(this,`_watermarkLayer`,void 0),this._watermarkLayer=new m(e.scene,[],f),this._initAddRender(),this._initWatermarkUpdate(),this._initWatermarkConfig()}_initAddRender(){let{scene:e}=this._context;e.addLayer(this._watermarkLayer)}async _initWatermarkConfig(){let e=await this._localStorageService.getItem(p);if(e){var t;this._watermarkService.updateWatermarkConfig(e),(t=this._context.mainComponent)==null||t.makeDirty()}}_initWatermarkUpdate(){this.disposeWithMe(this._watermarkService.updateConfig$.subscribe(e=>{var t;if(!e){var n;this._watermarkLayer.updateConfig(),(n=this._context.mainComponent)==null||n.makeDirty();return}e.type===d.UserInfo?this._watermarkLayer.updateConfig(e,this._userManagerService.getCurrentUser()):this._watermarkLayer.updateConfig(e),(t=this._context.mainComponent)==null||t.makeDirty()}))}};j=k([O(1,r(A)),O(2,r(n)),O(3,r(c))],j);let M=class extends a{constructor(e=C,t,n,r,i){super(),this._config=e,this._injector=t,this._configService=n,this._renderManagerSrv=r,this._localStorageService=i;let{...a}=l({},C,this._config);this._configService.setConfig(S,a),this._initWatermarkStorage(),this._initDependencies()}async _initWatermarkStorage(){let e=this._configService.getConfig(S);if(!e)return;let{userWatermarkSettings:t,textWatermarkSettings:n,imageWatermarkSettings:r}=e;if(t)this._localStorageService.setItem(p,{type:d.UserInfo,config:{userInfo:l({},y,t)}});else if(n)this._localStorageService.setItem(p,{type:d.Text,config:{text:l({},_,n)}});else if(r)this._localStorageService.setItem(p,{type:d.Image,config:{image:l({},v,r)}});else{let e=await this._localStorageService.getItem(p);(e==null?void 0:e.type)===d.UserInfo&&this._localStorageService.removeItem(p)}}_initDependencies(){[[A]].forEach(e=>{this._injector.add(e)})}onRendered(){this._injector.get(A),this._initRenderDependencies()}_initRenderDependencies(){[[j]].forEach(e=>{this._renderManagerSrv.registerRenderModule(s.UNIVER_SHEET,e),this._renderManagerSrv.registerRenderModule(s.UNIVER_DOC,e)})}};D(M,`pluginName`,`UNIVER_WATERMARK_PLUGIN`),D(M,`packageName`,b),D(M,`version`,x),M=k([O(1,r(i)),O(2,t),O(3,u),O(4,r(n))],M);export{M as UniverWatermarkPlugin,g as WATERMARK_IMAGE_ALLOW_IMAGE_LIST,v as WatermarkImageBaseConfig,A as WatermarkService,_ as WatermarkTextBaseConfig,y as WatermarkUserInfoBaseConfig};
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IImageWatermarkConfig, ITextWatermarkConfig, IUserInfoWatermarkConfig } from '@univerjs/engine-render';
|
|
2
17
|
export declare const UNIVER_WATERMARK_MENU = "UNIVER_WATERMARK_MENU";
|
|
3
18
|
export declare const WATERMARK_PANEL = "WATERMARK_PANEL";
|
|
4
19
|
export declare const WATERMARK_PANEL_FOOTER = "WATERMARK_PANEL_FOOTER";
|
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IImageWatermarkConfig, ITextWatermarkConfig, IUserInfoWatermarkConfig } from '@univerjs/engine-render';
|
|
2
17
|
export declare const WATERMARK_PLUGIN_CONFIG_KEY = "watermark.config";
|
|
3
18
|
export declare const configSymbol: unique symbol;
|
|
4
19
|
export interface IUniverWatermarkConfig {
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { UnitModel } from '@univerjs/core';
|
|
17
|
+
import type { IRenderContext, IRenderModule } from '@univerjs/engine-render';
|
|
18
|
+
import { ILocalStorageService, RxDisposable, UserManagerService } from '@univerjs/core';
|
|
3
19
|
import { WatermarkService } from '../services/watermark.service';
|
|
4
20
|
export declare class WatermarkRenderController extends RxDisposable implements IRenderModule {
|
|
5
21
|
private readonly _context;
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IImageWatermarkConfig, ITextWatermarkConfig } from '@univerjs/engine-render';
|
|
2
17
|
import { FUniver } from '@univerjs/core/facade';
|
|
18
|
+
import { IWatermarkTypeEnum } from '@univerjs/engine-render';
|
|
3
19
|
/**
|
|
4
20
|
* @ignore
|
|
5
21
|
*/
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IUniverWatermarkConfig } from './config/config';
|
|
2
17
|
import { IConfigService, ILocalStorageService, Injector, Plugin } from '@univerjs/core';
|
|
3
18
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
4
19
|
export declare class UniverWatermarkPlugin extends Plugin {
|
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { Nullable } from '@univerjs/core';
|
|
17
|
+
import type { IWatermarkConfigWithType } from '@univerjs/engine-render';
|
|
18
|
+
import { Disposable, ILocalStorageService } from '@univerjs/core';
|
|
3
19
|
export declare class WatermarkService extends Disposable {
|
|
4
20
|
private _localStorageService;
|
|
5
21
|
private readonly _updateConfig$;
|
|
6
|
-
readonly updateConfig$: import(
|
|
22
|
+
readonly updateConfig$: import("rxjs").Observable<Nullable<IWatermarkConfigWithType>>;
|
|
7
23
|
private readonly _refresh$;
|
|
8
|
-
readonly refresh$: import(
|
|
24
|
+
readonly refresh$: import("rxjs").Observable<number>;
|
|
9
25
|
constructor(_localStorageService: ILocalStorageService);
|
|
10
26
|
getWatermarkConfig(): Promise<IWatermarkConfigWithType | null>;
|
|
11
27
|
updateWatermarkConfig(config: IWatermarkConfigWithType): void;
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(require(`@univerjs/core/facade`),require(`@univerjs/engine-render`),require(`@univerjs/watermark`)):typeof define==`function`&&define.amd?define([`@univerjs/core/facade`,`@univerjs/engine-render`,`@univerjs/watermark`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverCoreFacade,e.UniverEngineRender,e.UniverWatermark))})(this,function(e,t,n){var r=class extends e.FUniver{addWatermark(e,r){let i=this._injector.get(n.WatermarkService);if(e===t.IWatermarkTypeEnum.Text)i.updateWatermarkConfig({type:t.IWatermarkTypeEnum.Text,config:{text:{...n.WatermarkTextBaseConfig,...r}}});else if(e===t.IWatermarkTypeEnum.Image)i.updateWatermarkConfig({type:t.IWatermarkTypeEnum.Image,config:{image:{...n.WatermarkImageBaseConfig,...r}}});else throw Error(`Unknown watermark type`);return this}deleteWatermark(){return this._injector.get(n.WatermarkService).deleteWatermarkConfig(),this}},i=class{get IWatermarkTypeEnum(){return t.IWatermarkTypeEnum}};e.FUniver.extend(r),e.FEnum.extend(i)});
|
package/lib/umd/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/engine-render`),require(`rxjs`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/engine-render`,`rxjs`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverWatermark={},e.UniverCore,e.UniverEngineRender,e.rxjs))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let i=[`image/png`,`image/jpeg`,`image/jpg`,`image/bmp`],a={content:``,fontSize:16,color:`rgb(0,0,0)`,bold:!1,italic:!1,direction:`ltr`,x:60,y:36,repeat:!0,spacingX:200,spacingY:100,rotate:0,opacity:.15},o={url:``,width:100,height:100,maintainAspectRatio:!0,originRatio:1,x:60,y:36,repeat:!0,spacingX:200,spacingY:100,rotate:0,opacity:.15},s={name:!0,email:!1,phone:!1,uid:!1,fontSize:16,color:`rgb(0,0,0)`,bold:!1,italic:!1,direction:`ltr`,x:60,y:60,repeat:!0,spacingX:200,spacingY:100,rotate:-30,opacity:.15};var c=`@univerjs/watermark`,l=`0.18.0`;let u=`watermark.config`;Symbol(u);let d={};function f(e){"@babel/helpers - typeof";return f=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},f(e)}function p(e,t){if(f(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(f(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function m(e){var t=p(e,`string`);return f(t)==`symbol`?t:t+``}function h(e,t,n){return(t=m(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){return function(n,r){t(n,r,e)}}function _(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let v=class extends t.Disposable{constructor(e){super(),this._localStorageService=e,h(this,`_updateConfig$`,new r.Subject),h(this,`updateConfig$`,this._updateConfig$.asObservable()),h(this,`_refresh$`,new r.Subject),h(this,`refresh$`,this._refresh$.asObservable())}async getWatermarkConfig(){return await this._localStorageService.getItem(n.UNIVER_WATERMARK_STORAGE_KEY)}updateWatermarkConfig(e){this._localStorageService.setItem(n.UNIVER_WATERMARK_STORAGE_KEY,e),this._updateConfig$.next(e)}deleteWatermarkConfig(){this._localStorageService.removeItem(n.UNIVER_WATERMARK_STORAGE_KEY),this._updateConfig$.next(null)}refresh(){this._refresh$.next(Math.random())}dispose(){this._refresh$.complete(),this._updateConfig$.complete()}};v=_([g(0,(0,t.Inject)(t.ILocalStorageService))],v);let y=class extends t.RxDisposable{constructor(e,t,r,i){super(),this._context=e,this._watermarkService=t,this._localStorageService=r,this._userManagerService=i,h(this,`_watermarkLayer`,void 0),this._watermarkLayer=new n.WatermarkLayer(e.scene,[],n.UNIVER_WATERMARK_LAYER_INDEX),this._initAddRender(),this._initWatermarkUpdate(),this._initWatermarkConfig()}_initAddRender(){let{scene:e}=this._context;e.addLayer(this._watermarkLayer)}async _initWatermarkConfig(){let e=await this._localStorageService.getItem(n.UNIVER_WATERMARK_STORAGE_KEY);if(e){var t;this._watermarkService.updateWatermarkConfig(e),(t=this._context.mainComponent)==null||t.makeDirty()}}_initWatermarkUpdate(){this.disposeWithMe(this._watermarkService.updateConfig$.subscribe(e=>{var t;if(!e){var r;this._watermarkLayer.updateConfig(),(r=this._context.mainComponent)==null||r.makeDirty();return}e.type===n.IWatermarkTypeEnum.UserInfo?this._watermarkLayer.updateConfig(e,this._userManagerService.getCurrentUser()):this._watermarkLayer.updateConfig(e),(t=this._context.mainComponent)==null||t.makeDirty()}))}};y=_([g(1,(0,t.Inject)(v)),g(2,(0,t.Inject)(t.ILocalStorageService)),g(3,(0,t.Inject)(t.UserManagerService))],y);let b=class extends t.Plugin{constructor(e=d,n,r,i,a){super(),this._config=e,this._injector=n,this._configService=r,this._renderManagerSrv=i,this._localStorageService=a;let{...o}=(0,t.merge)({},d,this._config);this._configService.setConfig(u,o),this._initWatermarkStorage(),this._initDependencies()}async _initWatermarkStorage(){let e=this._configService.getConfig(u);if(!e)return;let{userWatermarkSettings:r,textWatermarkSettings:i,imageWatermarkSettings:c}=e;if(r)this._localStorageService.setItem(n.UNIVER_WATERMARK_STORAGE_KEY,{type:n.IWatermarkTypeEnum.UserInfo,config:{userInfo:(0,t.merge)({},s,r)}});else if(i)this._localStorageService.setItem(n.UNIVER_WATERMARK_STORAGE_KEY,{type:n.IWatermarkTypeEnum.Text,config:{text:(0,t.merge)({},a,i)}});else if(c)this._localStorageService.setItem(n.UNIVER_WATERMARK_STORAGE_KEY,{type:n.IWatermarkTypeEnum.Image,config:{image:(0,t.merge)({},o,c)}});else{let e=await this._localStorageService.getItem(n.UNIVER_WATERMARK_STORAGE_KEY);(e==null?void 0:e.type)===n.IWatermarkTypeEnum.UserInfo&&this._localStorageService.removeItem(n.UNIVER_WATERMARK_STORAGE_KEY)}}_initDependencies(){[[v]].forEach(e=>{this._injector.add(e)})}onRendered(){this._injector.get(v),this._initRenderDependencies()}_initRenderDependencies(){[[y]].forEach(e=>{this._renderManagerSrv.registerRenderModule(t.UniverInstanceType.UNIVER_SHEET,e),this._renderManagerSrv.registerRenderModule(t.UniverInstanceType.UNIVER_DOC,e)})}};h(b,`pluginName`,`UNIVER_WATERMARK_PLUGIN`),h(b,`packageName`,c),h(b,`version`,l),b=_([g(1,(0,t.Inject)(t.Injector)),g(2,t.IConfigService),g(3,n.IRenderManagerService),g(4,(0,t.Inject)(t.ILocalStorageService))],b),Object.defineProperty(e,`UniverWatermarkPlugin`,{enumerable:!0,get:function(){return b}}),e.WATERMARK_IMAGE_ALLOW_IMAGE_LIST=i,e.WatermarkImageBaseConfig=o,Object.defineProperty(e,`WatermarkService`,{enumerable:!0,get:function(){return v}}),e.WatermarkTextBaseConfig=a,e.WatermarkUserInfoBaseConfig=s});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/watermark",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "univer watermark plugin",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -58,22 +58,23 @@
|
|
|
58
58
|
"rxjs": ">=7.0.0"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@univerjs/core": "0.
|
|
62
|
-
"@univerjs/engine-render": "0.
|
|
61
|
+
"@univerjs/core": "0.18.0",
|
|
62
|
+
"@univerjs/engine-render": "0.18.0"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"rxjs": "^7.8.2",
|
|
66
66
|
"typescript": "^5.9.3",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"@univerjs-infra/shared": "0.17.0"
|
|
67
|
+
"vitest": "^4.1.0",
|
|
68
|
+
"@univerjs-infra/shared": "0.18.0"
|
|
70
69
|
},
|
|
71
70
|
"scripts": {
|
|
72
71
|
"test": "vitest run",
|
|
73
72
|
"test:watch": "vitest",
|
|
74
73
|
"coverage": "vitest run --coverage",
|
|
75
74
|
"typecheck": "tsc --noEmit",
|
|
76
|
-
"build": "univer-cli build"
|
|
75
|
+
"build:bundle": "univer-cli build",
|
|
76
|
+
"build:types": "tsc -p tsconfig.node.json",
|
|
77
|
+
"build": "pnpm run build:bundle && pnpm run build:types"
|
|
77
78
|
},
|
|
78
79
|
"module": "./lib/es/index.js"
|
|
79
80
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
export {};
|