@univerjs/watermark 0.4.2 → 0.5.0-alpha.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 -0
- package/lib/cjs/index.js +2 -2
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/facade.js +33 -0
- package/lib/es/index.js +581 -598
- package/lib/es/locale/en-US.js +35 -0
- package/lib/es/locale/fa-IR.js +35 -0
- package/lib/es/locale/ru-RU.js +35 -0
- package/lib/es/locale/vi-VN.js +35 -0
- package/lib/es/locale/zh-CN.js +35 -0
- package/lib/es/locale/zh-TW.js +35 -0
- package/lib/types/facade/f-univer.d.ts +26 -0
- package/lib/types/facade/index.d.ts +16 -0
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +38 -20
- package/lib/locale/en-US.json +0 -32
- package/lib/locale/fa-IR.json +0 -32
- package/lib/locale/ru-RU.json +0 -32
- package/lib/locale/vi-VN.json +0 -32
- package/lib/locale/zh-CN.json +0 -32
- package/lib/locale/zh-TW.json +0 -32
package/lib/es/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
const UNIVER_WATERMARK_MENU = "UNIVER_WATERMARK_MENU", WATERMARK_PANEL = "WATERMARK_PANEL", WATERMARK_PANEL_FOOTER = "WATERMARK_PANEL_FOOTER", UNIVER_WATERMARK_STORAGE_KEY = "UNIVER_WATERMARK_STORAGE_KEY", UNIVER_WATERMARK_LAYER_INDEX = 10, WATERMARK_IMAGE_ALLOW_IMAGE_LIST = ["image/png", "image/jpeg", "image/jpg", "image/bmp"], WatermarkTextBaseConfig = {
|
|
1
|
+
var he = Object.defineProperty;
|
|
2
|
+
var ve = (e, t, a) => t in e ? he(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var k = (e, t, a) => ve(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
+
import { CommandType as fe, LocaleService as R, Inject as j, ILocalStorageService as F, Disposable as ee, useDependency as x, useObservable as we, IUniverInstanceService as ke, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Se, UserManagerService as xe, RxDisposable as _e, Injector as ye, ICommandService as Ce, Plugin as Ie, UniverInstanceType as V, IConfigService as je } from "@univerjs/core";
|
|
5
|
+
import { Layer as Ne, IRenderManagerService as Te } from "@univerjs/engine-render";
|
|
6
|
+
import { ISidebarService as te, ILocalFileService as We, IClipboardInterfaceService as be, MenuItemType as Re, RibbonStartGroup as Pe, ComponentManager as Le, IMenuManagerService as Me } from "@univerjs/ui";
|
|
7
|
+
import Oe, { forwardRef as P, useRef as Ee, createElement as L, useState as z, useCallback as Fe, useEffect as Ae } from "react";
|
|
8
|
+
import { Button as Y, InputNumber as g, Checkbox as X, Input as Ue, Select as re, Dropdown as $e, ColorPicker as De } from "@univerjs/design";
|
|
9
|
+
import { Subject as G, switchMap as He, of as Z } from "rxjs";
|
|
10
|
+
const ae = "UNIVER_WATERMARK_MENU", ne = "WATERMARK_PANEL", ie = "WATERMARK_PANEL_FOOTER", S = "UNIVER_WATERMARK_STORAGE_KEY", Ye = 10, Xe = ["image/png", "image/jpeg", "image/jpg", "image/bmp"], O = {
|
|
12
11
|
content: "",
|
|
13
12
|
fontSize: 16,
|
|
14
13
|
color: "rgb(0,0,0)",
|
|
@@ -22,7 +21,7 @@ const UNIVER_WATERMARK_MENU = "UNIVER_WATERMARK_MENU", WATERMARK_PANEL = "WATERM
|
|
|
22
21
|
spacingY: 100,
|
|
23
22
|
rotate: 0,
|
|
24
23
|
opacity: 0.15
|
|
25
|
-
},
|
|
24
|
+
}, se = {
|
|
26
25
|
url: "",
|
|
27
26
|
width: 100,
|
|
28
27
|
height: 100,
|
|
@@ -35,7 +34,7 @@ const UNIVER_WATERMARK_MENU = "UNIVER_WATERMARK_MENU", WATERMARK_PANEL = "WATERM
|
|
|
35
34
|
spacingY: 100,
|
|
36
35
|
rotate: 0,
|
|
37
36
|
opacity: 0.15
|
|
38
|
-
},
|
|
37
|
+
}, Be = {
|
|
39
38
|
name: !0,
|
|
40
39
|
email: !1,
|
|
41
40
|
phone: !1,
|
|
@@ -52,101 +51,97 @@ const UNIVER_WATERMARK_MENU = "UNIVER_WATERMARK_MENU", WATERMARK_PANEL = "WATERM
|
|
|
52
51
|
spacingY: 100,
|
|
53
52
|
rotate: -30,
|
|
54
53
|
opacity: 0.15
|
|
55
|
-
},
|
|
56
|
-
type:
|
|
54
|
+
}, K = {
|
|
55
|
+
type: fe.OPERATION,
|
|
57
56
|
id: "univer.operation.open-watermark-panel",
|
|
58
|
-
handler(
|
|
59
|
-
const
|
|
60
|
-
return
|
|
61
|
-
header: { title:
|
|
62
|
-
children: { label:
|
|
63
|
-
footer: { label:
|
|
64
|
-
onClose:
|
|
65
|
-
},
|
|
57
|
+
handler(e) {
|
|
58
|
+
const t = e.get(te), a = e.get(R);
|
|
59
|
+
return t.open({
|
|
60
|
+
header: { title: a.t("univer-watermark.title") },
|
|
61
|
+
children: { label: ne },
|
|
62
|
+
footer: { label: ie },
|
|
63
|
+
onClose: () => {
|
|
64
|
+
},
|
|
66
65
|
width: 330
|
|
67
66
|
}), !0;
|
|
68
67
|
}
|
|
69
68
|
};
|
|
70
|
-
var
|
|
71
|
-
return
|
|
72
|
-
for (var
|
|
73
|
-
|
|
74
|
-
for (var
|
|
69
|
+
var m = /* @__PURE__ */ ((e) => (e.UserInfo = "userInfo", e.Text = "text", e.Image = "image", e))(m || {}), f = function() {
|
|
70
|
+
return f = Object.assign || function(e) {
|
|
71
|
+
for (var t, a = 1, r = arguments.length; a < r; a++) {
|
|
72
|
+
t = arguments[a];
|
|
73
|
+
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
75
74
|
}
|
|
76
|
-
return
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
var
|
|
80
|
-
for (var
|
|
81
|
-
if (
|
|
82
|
-
for (var
|
|
83
|
-
|
|
84
|
-
return
|
|
85
|
-
},
|
|
86
|
-
var
|
|
87
|
-
return
|
|
75
|
+
return e;
|
|
76
|
+
}, f.apply(this, arguments);
|
|
77
|
+
}, Ke = function(e, t) {
|
|
78
|
+
var a = {};
|
|
79
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (a[r] = e[r]);
|
|
80
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
81
|
+
for (var n = 0, r = Object.getOwnPropertySymbols(e); n < r.length; n++)
|
|
82
|
+
t.indexOf(r[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[n]) && (a[r[n]] = e[r[n]]);
|
|
83
|
+
return a;
|
|
84
|
+
}, M = P(function(e, t) {
|
|
85
|
+
var a = e.icon, r = e.id, n = e.className, i = e.extend, l = Ke(e, ["icon", "id", "className", "extend"]), d = "univerjs-icon univerjs-icon-".concat(r, " ").concat(n || "").trim(), u = Ee("_".concat(Ge()));
|
|
86
|
+
return oe(a, "".concat(r), { defIds: a.defIds, idSuffix: u.current }, f({ ref: t, className: d }, l), i);
|
|
88
87
|
});
|
|
89
|
-
function
|
|
90
|
-
return
|
|
91
|
-
return
|
|
88
|
+
function oe(e, t, a, r, n) {
|
|
89
|
+
return L(e.tag, f(f({ key: t }, Ve(e, a, n)), r), (ze(e, a).children || []).map(function(i, l) {
|
|
90
|
+
return oe(i, "".concat(t, "-").concat(e.tag, "-").concat(l), a, void 0, n);
|
|
92
91
|
}));
|
|
93
92
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
})), attrs;
|
|
93
|
+
function Ve(e, t, a) {
|
|
94
|
+
var r = f({}, e.attrs);
|
|
95
|
+
a != null && a.colorChannel1 && r.fill === "colorChannel1" && (r.fill = a.colorChannel1);
|
|
96
|
+
var n = t.defIds;
|
|
97
|
+
return !n || n.length === 0 || (e.tag === "use" && r["xlink:href"] && (r["xlink:href"] = r["xlink:href"] + t.idSuffix), Object.entries(r).forEach(function(i) {
|
|
98
|
+
var l = i[0], d = i[1];
|
|
99
|
+
typeof d == "string" && (r[l] = d.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
|
|
100
|
+
})), r;
|
|
103
101
|
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}) }) : node;
|
|
102
|
+
function ze(e, t) {
|
|
103
|
+
var a, r = t.defIds;
|
|
104
|
+
return !r || r.length === 0 ? e : e.tag === "defs" && (!((a = e.children) === null || a === void 0) && a.length) ? f(f({}, e), { children: e.children.map(function(n) {
|
|
105
|
+
return typeof n.attrs.id == "string" && r && r.indexOf(n.attrs.id) > -1 ? f(f({}, n), { attrs: f(f({}, n.attrs), { id: n.attrs.id + t.idSuffix }) }) : n;
|
|
106
|
+
}) }) : e;
|
|
110
107
|
}
|
|
111
|
-
|
|
112
|
-
function generateShortUuid() {
|
|
108
|
+
function Ge() {
|
|
113
109
|
return Math.random().toString(36).substring(2, 8);
|
|
114
110
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
111
|
+
M.displayName = "UniverIcon";
|
|
112
|
+
var Ze = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.65791 1.30005C3.77355 1.30005 3.05664 2.01696 3.05664 2.90132V12.8588C3.05664 13.8755 3.88086 14.6998 4.89759 14.6998H9.1016C11.2233 14.6998 12.9433 12.9798 12.9433 10.8581C12.9433 9.13925 11.8145 7.68407 10.2578 7.1934C10.8806 6.56856 11.2655 5.70659 11.2655 4.75472C11.2655 2.84676 9.71883 1.30005 7.81087 1.30005H4.65791ZM4.25664 2.90132C4.25664 2.6797 4.4363 2.50005 4.65791 2.50005H7.81087C9.05609 2.50005 10.0655 3.5095 10.0655 4.75472C10.0655 5.99993 9.05609 7.00938 7.81087 7.00938H4.25664V2.90132ZM4.25664 12.8588V8.21636H9.1016C10.5606 8.21636 11.7433 9.39909 11.7433 10.8581C11.7433 12.317 10.5606 13.4998 9.1016 13.4998H4.89759C4.5436 13.4998 4.25664 13.2128 4.25664 12.8588Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, le = P(function(e, t) {
|
|
113
|
+
return L(M, Object.assign({}, e, {
|
|
119
114
|
id: "bold-single",
|
|
120
|
-
ref,
|
|
121
|
-
icon:
|
|
115
|
+
ref: t,
|
|
116
|
+
icon: Ze
|
|
122
117
|
}));
|
|
123
118
|
});
|
|
124
|
-
|
|
125
|
-
var
|
|
126
|
-
return
|
|
119
|
+
le.displayName = "BoldSingle";
|
|
120
|
+
var qe = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "mask", attrs: { id: "mask0_102_1198", style: { maskType: "alpha" }, width: 16, height: 16, x: 0, y: 0, maskUnits: "userSpaceOnUse" }, children: [{ tag: "path", attrs: { fill: "#DCDCDC", d: "M0 0H16V16H0z" } }] }, { tag: "g", attrs: { mask: "url(#mask0_102_1198)" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.68731 9.98425C5.73282 9.87144 5.77827 9.75442 5.82366 9.63323L6.3312 8.27586H9.65859L10.3523 10.1159C10.405 10.284 10.4868 10.4276 10.6023 10.5378C10.74 10.669 10.9119 10.7236 11.1014 10.714C11.3544 10.7131 11.5919 10.6379 11.6996 10.4032L11.7013 10.3992C11.7901 10.1937 11.7749 9.9634 11.6929 9.7289L8.85351 1.86337C8.79546 1.68828 8.6901 1.54881 8.54213 1.45002C8.38836 1.33863 8.1989 1.29112 7.98798 1.29112C7.78272 1.29112 7.59752 1.34014 7.4446 1.45198C7.30481 1.55223 7.20617 1.69184 7.14935 1.86343L4.324 9.70145L4.32281 9.70495C4.27002 9.86052 4.23828 10.0056 4.23828 10.1346C4.23828 10.2646 4.27116 10.3937 4.36281 10.4909C4.50256 10.6468 4.6921 10.714 4.90604 10.714C5.0369 10.714 5.15805 10.6745 5.26156 10.5916C5.3633 10.5247 5.44621 10.4332 5.51101 10.3217C5.57988 10.2177 5.63858 10.1051 5.68731 9.98425ZM6.72105 7.00152L8.00144 3.32827L9.28183 7.00152H6.72105Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "rect", attrs: { width: 11.58, height: 2.56, x: 2.21, y: 12.2, fill: "colorChannel1", rx: 1.28 } }] }] }, ce = P(function(e, t) {
|
|
121
|
+
return L(M, Object.assign({}, e, {
|
|
127
122
|
id: "font-color",
|
|
128
|
-
ref,
|
|
129
|
-
icon:
|
|
123
|
+
ref: t,
|
|
124
|
+
icon: qe
|
|
130
125
|
}));
|
|
131
126
|
});
|
|
132
|
-
|
|
133
|
-
var
|
|
134
|
-
return
|
|
127
|
+
ce.displayName = "FontColor";
|
|
128
|
+
var Je = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M9.80385 1.40005H11.9997C12.3311 1.40005 12.5997 1.66868 12.5997 2.00005C12.5997 2.33143 12.3311 2.60005 11.9997 2.60005H10.1185L7.12251 13.4001H9.33324C9.66461 13.4001 9.93324 13.6687 9.93324 14.0001C9.93324 14.3314 9.66461 14.6001 9.33324 14.6001H6.34785C6.33847 14.6003 6.32905 14.6003 6.31962 14.6001H3.9999C3.66853 14.6001 3.3999 14.3314 3.3999 14.0001C3.3999 13.6687 3.66853 13.4001 3.9999 13.4001H5.87719L8.87322 2.60005H6.66641C6.33504 2.60005 6.06641 2.33143 6.06641 2.00005C6.06641 1.66868 6.33504 1.40005 6.66641 1.40005H9.52916C9.61698 1.37929 9.71064 1.3781 9.80385 1.40005Z" } }] }, me = P(function(e, t) {
|
|
129
|
+
return L(M, Object.assign({}, e, {
|
|
135
130
|
id: "italic-single",
|
|
136
|
-
ref,
|
|
137
|
-
icon:
|
|
131
|
+
ref: t,
|
|
132
|
+
icon: Je
|
|
138
133
|
}));
|
|
139
134
|
});
|
|
140
|
-
|
|
141
|
-
var
|
|
142
|
-
return
|
|
135
|
+
me.displayName = "ItalicSingle";
|
|
136
|
+
var Qe = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M1.93949 12.3363L1.94048 12.3357 1.95034 12.33C1.95981 12.3245 1.97499 12.3158 1.99548 12.3043 2.0365 12.2813 2.09866 12.2474 2.17888 12.2061 2.33971 12.1234 2.57112 12.0123 2.84885 11.9012 3.41339 11.6754 4.12822 11.4664 4.81552 11.4664 5.82167 11.4664 6.71309 11.8774 7.74399 12.3643 7.7595 12.3717 7.77504 12.379 7.79061 12.3864 8.77119 12.8497 9.88765 13.3772 11.185 13.3772 12.0901 13.3772 12.9676 13.1085 13.5973 12.8566 13.9167 12.7289 14.1829 12.6011 14.3704 12.5047 14.4644 12.4564 14.5391 12.4157 14.5914 12.3864 14.6175 12.3717 14.6381 12.3599 14.6527 12.3514L14.6702 12.3412 14.6755 12.3381 14.6772 12.337 14.6782 12.3365C14.6782 12.3365 14.6784 12.3363 14.3697 11.8218L14.6782 12.3365C14.9623 12.166 15.0547 11.7973 14.8842 11.5131 14.7138 11.2291 14.3454 11.1369 14.0613 11.3071L14.06 11.3079 14.0502 11.3137C14.0407 11.3192 14.0255 11.3279 14.005 11.3394 13.964 11.3623 13.9019 11.3963 13.8216 11.4375 13.6608 11.5202 13.4294 11.6314 13.1517 11.7424 12.5871 11.9683 11.8723 12.1772 11.185 12.1772 10.1788 12.1772 9.28742 11.7663 8.25652 11.2793 8.24101 11.272 8.22547 11.2646 8.2099 11.2573 7.22931 10.7939 6.11286 10.2664 4.81552 10.2664 3.91046 10.2664 3.03292 10.5351 2.40318 10.787 2.08377 10.9148 1.81757 11.0425 1.63007 11.139 1.53613 11.1873 1.46144 11.228 1.40916 11.2573 1.383 11.2719 1.36241 11.2837 1.34778 11.2922L1.33033 11.3024 1.32504 11.3056 1.32327 11.3066 1.32233 11.3072C1.32233 11.3072 1.32209 11.3073 1.63068 11.8217L1.32233 11.3072C1.03818 11.4777.945803 11.8464 1.11629 12.1305 1.28674 12.4146 1.65536 12.5066 1.93949 12.3363zM1.93949 8.51464L1.94048 8.51406 1.95034 8.50829C1.95981 8.50279 1.97499 8.49407 1.99548 8.4826 2.0365 8.45963 2.09866 8.4257 2.17888 8.38443 2.33971 8.30172 2.57112 8.19061 2.84885 8.07952 3.41339 7.85371 4.12822 7.64473 4.81552 7.64473 5.82167 7.64473 6.71309 8.05572 7.74399 8.54267 7.7595 8.54999 7.77504 8.55733 7.79061 8.56469 8.77119 9.02803 9.88765 9.55557 11.185 9.55557 12.0901 9.55557 12.9676 9.28684 13.5973 9.03494 13.9167 8.90718 14.1829 8.77943 14.3704 8.683 14.4644 8.63469 14.5391 8.59398 14.5914 8.5647 14.6175 8.55006 14.6381 8.53825 14.6527 8.52975L14.6702 8.51954 14.6755 8.51641 14.6772 8.51535 14.6782 8.51479C14.6782 8.51479 14.6784 8.51464 14.3697 8.00015L14.6782 8.51479C14.9623 8.3443 15.0547 7.9756 14.8842 7.69145 14.7138 7.4074 14.3454 7.31523 14.0613 7.48547L14.06 7.48623 14.0502 7.492C14.0407 7.4975 14.0255 7.50622 14.005 7.5177 13.964 7.54067 13.9019 7.5746 13.8216 7.61586 13.6608 7.69857 13.4294 7.80968 13.1517 7.92077 12.5871 8.14659 11.8723 8.35557 11.185 8.35557 10.1788 8.35557 9.28742 7.94457 8.25652 7.45762 8.24101 7.4503 8.22547 7.44296 8.2099 7.4356 7.22931 6.97226 6.11286 6.44473 4.81552 6.44473 3.91046 6.44473 3.03292 6.71346 2.40318 6.96535 2.08377 7.09311 1.81757 7.22086 1.63007 7.31729 1.53613 7.3656 1.46144 7.40631 1.40916 7.43559 1.383 7.45024 1.36241 7.46205 1.34778 7.47054L1.33033 7.48075 1.32504 7.48389 1.32327 7.48494 1.32233 7.48551C1.32233 7.48551 1.32209 7.48565 1.63068 7.99997L1.32233 7.48551C1.03818 7.656.945803 8.0247 1.11629 8.30884 1.28674 8.59292 1.65536 8.68496 1.93949 8.51464zM1.93949 4.69296L1.94048 4.69238 1.95034 4.68661C1.95981 4.68111 1.97499 4.67239 1.99548 4.66092 2.0365 4.63795 2.09866 4.60402 2.17888 4.56276 2.33971 4.48004 2.57112 4.36893 2.84885 4.25784 3.41339 4.03203 4.12822 3.82305 4.81552 3.82305 5.82167 3.82305 6.71309 4.23404 7.74399 4.72099 7.7595 4.72831 7.77504 4.73566 7.79061 4.74301 8.77119 5.20635 9.88765 5.73389 11.185 5.73389 12.0901 5.73389 12.9676 5.46516 13.5973 5.21326 13.9167 5.0855 14.1829 4.95775 14.3704 4.86132 14.4644 4.81301 14.5391 4.7723 14.5914 4.74302 14.6175 4.72838 14.6381 4.71657 14.6527 4.70807L14.6702 4.69786 14.6755 4.69473 14.6772 4.69367 14.6782 4.69311C14.6782 4.69311 14.6784 4.69296 14.3697 4.17847L14.6782 4.69311C14.9623 4.52262 15.0547 4.15392 14.8842 3.86977 14.7138 3.58572 14.3454 3.49355 14.0613 3.66379L14.06 3.66455 14.0502 3.67032C14.0407 3.67582 14.0255 3.68454 14.005 3.69602 13.964 3.71899 13.9019 3.75292 13.8216 3.79418 13.6608 3.87689 13.4294 3.988 13.1517 4.09909 12.5871 4.32491 11.8723 4.53389 11.185 4.53389 10.1788 4.53389 9.28742 4.12289 8.25652 3.63594 8.24101 3.62862 8.22547 3.62128 8.2099 3.61392 7.22931 3.15058 6.11286 2.62305 4.81552 2.62305 3.91046 2.62305 3.03292 2.89178 2.40318 3.14367 2.08377 3.27143 1.81757 3.39918 1.63007 3.49561 1.53613 3.54392 1.46144 3.58463 1.40916 3.61391 1.383 3.62856 1.36241 3.64037 1.34778 3.64886L1.33033 3.65907 1.32504 3.66221 1.32327 3.66326 1.32233 3.66383C1.32233 3.66383 1.32209 3.66397 1.63068 4.17829L1.32233 3.66383C1.03818 3.83432.945803 4.20302 1.11629 4.48716 1.28674 4.77124 1.65536 4.86329 1.93949 4.69296z", fillRule: "evenodd", clipRule: "evenodd" } }] }, de = P(function(e, t) {
|
|
137
|
+
return L(M, Object.assign({}, e, {
|
|
143
138
|
id: "watermark-single",
|
|
144
|
-
ref,
|
|
145
|
-
icon:
|
|
139
|
+
ref: t,
|
|
140
|
+
icon: Qe
|
|
146
141
|
}));
|
|
147
142
|
});
|
|
148
|
-
|
|
149
|
-
var
|
|
143
|
+
de.displayName = "WatermarkSingle";
|
|
144
|
+
var ue = { exports: {} }, A = {};
|
|
150
145
|
/**
|
|
151
146
|
* @license React
|
|
152
147
|
* react-jsx-runtime.production.min.js
|
|
@@ -156,41 +151,40 @@ var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
|
|
|
156
151
|
* This source code is licensed under the MIT license found in the
|
|
157
152
|
* LICENSE file in the root directory of this source tree.
|
|
158
153
|
*/
|
|
159
|
-
var
|
|
160
|
-
function
|
|
161
|
-
var
|
|
162
|
-
|
|
163
|
-
for (
|
|
164
|
-
if (
|
|
165
|
-
return { $$typeof:
|
|
154
|
+
var et = Oe, tt = Symbol.for("react.element"), rt = Symbol.for("react.fragment"), at = Object.prototype.hasOwnProperty, nt = et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, it = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
155
|
+
function pe(e, t, a) {
|
|
156
|
+
var r, n = {}, i = null, l = null;
|
|
157
|
+
a !== void 0 && (i = "" + a), t.key !== void 0 && (i = "" + t.key), t.ref !== void 0 && (l = t.ref);
|
|
158
|
+
for (r in t) at.call(t, r) && !it.hasOwnProperty(r) && (n[r] = t[r]);
|
|
159
|
+
if (e && e.defaultProps) for (r in t = e.defaultProps, t) n[r] === void 0 && (n[r] = t[r]);
|
|
160
|
+
return { $$typeof: tt, type: e, key: i, ref: l, props: n, _owner: nt.current };
|
|
166
161
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
var
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
constructor(_localStorageService) {
|
|
162
|
+
A.Fragment = rt;
|
|
163
|
+
A.jsx = pe;
|
|
164
|
+
A.jsxs = pe;
|
|
165
|
+
ue.exports = A;
|
|
166
|
+
var s = ue.exports, st = Object.defineProperty, ot = Object.getOwnPropertyDescriptor, lt = (e, t, a, r) => {
|
|
167
|
+
for (var n = r > 1 ? void 0 : r ? ot(t, a) : t, i = e.length - 1, l; i >= 0; i--)
|
|
168
|
+
(l = e[i]) && (n = (r ? l(t, a, n) : l(n)) || n);
|
|
169
|
+
return r && n && st(t, a, n), n;
|
|
170
|
+
}, ct = (e, t) => (a, r) => t(a, r, e);
|
|
171
|
+
let T = class extends ee {
|
|
172
|
+
constructor(t) {
|
|
179
173
|
super();
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
this._localStorageService =
|
|
174
|
+
k(this, "_updateConfig$", new G());
|
|
175
|
+
k(this, "updateConfig$", this._updateConfig$.asObservable());
|
|
176
|
+
k(this, "_refresh$", new G());
|
|
177
|
+
k(this, "refresh$", this._refresh$.asObservable());
|
|
178
|
+
this._localStorageService = t;
|
|
185
179
|
}
|
|
186
180
|
async getWatermarkConfig() {
|
|
187
|
-
return await this._localStorageService.getItem(
|
|
181
|
+
return await this._localStorageService.getItem(S);
|
|
188
182
|
}
|
|
189
|
-
updateWatermarkConfig(
|
|
190
|
-
this._localStorageService.setItem(
|
|
183
|
+
updateWatermarkConfig(t) {
|
|
184
|
+
this._localStorageService.setItem(S, t), this._updateConfig$.next(t);
|
|
191
185
|
}
|
|
192
186
|
deleteWatermarkConfig() {
|
|
193
|
-
this._localStorageService.removeItem(
|
|
187
|
+
this._localStorageService.removeItem(S), this._updateConfig$.next(null);
|
|
194
188
|
}
|
|
195
189
|
refresh() {
|
|
196
190
|
this._refresh$.next(Math.random());
|
|
@@ -198,714 +192,703 @@ let WatermarkService = (_a = class extends Disposable {
|
|
|
198
192
|
dispose() {
|
|
199
193
|
this._refresh$.complete(), this._updateConfig$.complete();
|
|
200
194
|
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
],
|
|
205
|
-
const
|
|
206
|
-
watermarkPanel,
|
|
207
|
-
watermarkPanelTypeTitle,
|
|
208
|
-
watermarkPanelTypeSelect,
|
|
209
|
-
watermarkPanelSetting,
|
|
210
|
-
watermarkPanelFooter,
|
|
211
|
-
watermarkPanelFooterButtonWrapper,
|
|
212
|
-
watermarkPanelFooterReset,
|
|
213
|
-
watermarkTextSetting,
|
|
214
|
-
watermarkTextSettingHeader,
|
|
215
|
-
watermarkTextSettingFontContent,
|
|
216
|
-
watermarkTextSettingFontStylePart,
|
|
217
|
-
watermarkTextSettingLayoutFontWrapper,
|
|
218
|
-
watermarkImageSetting,
|
|
219
|
-
watermarkInput,
|
|
220
|
-
watermarkInputContent,
|
|
221
|
-
watermarkIcon,
|
|
222
|
-
watermarkIconWrapper,
|
|
223
|
-
watermarkIconWrapperSelect,
|
|
224
|
-
watermarkColorPickerWrapper
|
|
225
|
-
},
|
|
226
|
-
const
|
|
227
|
-
if (!
|
|
228
|
-
const
|
|
229
|
-
const
|
|
195
|
+
};
|
|
196
|
+
T = lt([
|
|
197
|
+
ct(0, j(F))
|
|
198
|
+
], T);
|
|
199
|
+
const mt = "univer-watermark-panel", dt = "univer-watermark-panel-type-title", ut = "univer-watermark-panel-type-select", pt = "univer-watermark-panel-setting", gt = "univer-watermark-panel-footer", ht = "univer-watermark-panel-footer-button-wrapper", vt = "univer-watermark-panel-footer-reset", ft = "univer-watermark-text-setting", wt = "univer-watermark-text-setting-header", kt = "univer-watermark-text-setting-font-content", St = "univer-watermark-text-setting-font-style-part", xt = "univer-watermark-text-setting-layout-font-wrapper", _t = "univer-watermark-image-setting", yt = "univer-watermark-input", Ct = "univer-watermark-input-content", It = "univer-watermark-icon", jt = "univer-watermark-icon-wrapper", Nt = "univer-watermark-icon-wrapper-select", Tt = "univer-watermark-color-picker-wrapper", o = {
|
|
200
|
+
watermarkPanel: mt,
|
|
201
|
+
watermarkPanelTypeTitle: dt,
|
|
202
|
+
watermarkPanelTypeSelect: ut,
|
|
203
|
+
watermarkPanelSetting: pt,
|
|
204
|
+
watermarkPanelFooter: gt,
|
|
205
|
+
watermarkPanelFooterButtonWrapper: ht,
|
|
206
|
+
watermarkPanelFooterReset: vt,
|
|
207
|
+
watermarkTextSetting: ft,
|
|
208
|
+
watermarkTextSettingHeader: wt,
|
|
209
|
+
watermarkTextSettingFontContent: kt,
|
|
210
|
+
watermarkTextSettingFontStylePart: St,
|
|
211
|
+
watermarkTextSettingLayoutFontWrapper: xt,
|
|
212
|
+
watermarkImageSetting: _t,
|
|
213
|
+
watermarkInput: yt,
|
|
214
|
+
watermarkInputContent: Ct,
|
|
215
|
+
watermarkIcon: It,
|
|
216
|
+
watermarkIconWrapper: jt,
|
|
217
|
+
watermarkIconWrapperSelect: Nt,
|
|
218
|
+
watermarkColorPickerWrapper: Tt
|
|
219
|
+
}, Wt = ({ config: e, onChange: t }) => {
|
|
220
|
+
const a = x(We), r = x(R);
|
|
221
|
+
if (!e) return null;
|
|
222
|
+
const n = async () => {
|
|
223
|
+
const i = await a.openFile({
|
|
230
224
|
multiple: !1,
|
|
231
|
-
accept:
|
|
225
|
+
accept: Xe.map((p) => `.${p.replace("image/", "")}`).join(",")
|
|
232
226
|
});
|
|
233
|
-
if (
|
|
227
|
+
if (i.length === 0)
|
|
234
228
|
return !1;
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
var
|
|
238
|
-
if ((
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
},
|
|
229
|
+
const d = i[0], u = new FileReader();
|
|
230
|
+
u.onload = function(p) {
|
|
231
|
+
var c;
|
|
232
|
+
if ((c = p.target) != null && c.result) {
|
|
233
|
+
const h = p.target.result, v = new Image();
|
|
234
|
+
v.onload = function() {
|
|
235
|
+
t({ ...e, url: h, width: Math.max(20, v.width), height: Math.max(v.height, 20), originRatio: v.width / v.height });
|
|
236
|
+
}, v.src = h;
|
|
243
237
|
}
|
|
244
|
-
},
|
|
245
|
-
}
|
|
246
|
-
return /* @__PURE__ */
|
|
247
|
-
/* @__PURE__ */
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
|
|
238
|
+
}, u.readAsDataURL(d);
|
|
239
|
+
};
|
|
240
|
+
return /* @__PURE__ */ s.jsxs("div", { className: o.watermarkImageSetting, children: [
|
|
241
|
+
/* @__PURE__ */ s.jsx("div", { className: o.watermarkTextSettingHeader, children: r.t("univer-watermark.image") }),
|
|
242
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayout, children: [
|
|
243
|
+
/* @__PURE__ */ s.jsx("span", { children: r.t("univer-watermark.image") }),
|
|
244
|
+
/* @__PURE__ */ s.jsx(
|
|
245
|
+
Y,
|
|
252
246
|
{
|
|
253
|
-
onClick:
|
|
247
|
+
onClick: n,
|
|
254
248
|
style: { marginLeft: 8 },
|
|
255
|
-
children:
|
|
249
|
+
children: e.url ? r.t("univer-watermark.replaceImage") : r.t("univer-watermark.uploadImage")
|
|
256
250
|
}
|
|
257
251
|
),
|
|
258
|
-
/* @__PURE__ */
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
|
|
252
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingFontStylePart, children: [
|
|
253
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
254
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.opacity") }),
|
|
255
|
+
/* @__PURE__ */ s.jsx(
|
|
256
|
+
g,
|
|
263
257
|
{
|
|
264
|
-
value:
|
|
265
|
-
onChange:
|
|
266
|
-
|
|
267
|
-
},
|
|
258
|
+
value: e.opacity,
|
|
259
|
+
onChange: (i) => {
|
|
260
|
+
i != null && t({ ...e, opacity: Number.parseFloat(i.toString()) });
|
|
261
|
+
},
|
|
268
262
|
max: 1,
|
|
269
263
|
min: 0,
|
|
270
264
|
step: 0.05,
|
|
271
|
-
className:
|
|
265
|
+
className: o.watermarkInput
|
|
272
266
|
}
|
|
273
267
|
)
|
|
274
268
|
] }),
|
|
275
|
-
/* @__PURE__ */
|
|
276
|
-
/* @__PURE__ */
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
-
|
|
269
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
270
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.keepRatio") }),
|
|
271
|
+
/* @__PURE__ */ s.jsx(
|
|
272
|
+
X,
|
|
279
273
|
{
|
|
280
|
-
checked:
|
|
281
|
-
onChange:
|
|
282
|
-
|
|
283
|
-
}
|
|
274
|
+
checked: e.maintainAspectRatio,
|
|
275
|
+
onChange: (i) => {
|
|
276
|
+
t(i === !0 ? { ...e, maintainAspectRatio: i, height: Math.round(e.width / e.originRatio) } : { ...e, maintainAspectRatio: i });
|
|
277
|
+
}
|
|
284
278
|
}
|
|
285
279
|
)
|
|
286
280
|
] })
|
|
287
281
|
] })
|
|
288
282
|
] }),
|
|
289
|
-
/* @__PURE__ */
|
|
290
|
-
/* @__PURE__ */
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
-
|
|
283
|
+
/* @__PURE__ */ s.jsx("div", { className: o.watermarkTextSettingLayout, children: /* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingFontStylePart, children: [
|
|
284
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
285
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.width") }),
|
|
286
|
+
/* @__PURE__ */ s.jsx(
|
|
287
|
+
g,
|
|
294
288
|
{
|
|
295
|
-
value:
|
|
296
|
-
onChange:
|
|
297
|
-
if (
|
|
298
|
-
const
|
|
299
|
-
|
|
289
|
+
value: e.width,
|
|
290
|
+
onChange: (i) => {
|
|
291
|
+
if (i != null) {
|
|
292
|
+
const l = Math.max(20, Number.parseInt(i.toString()));
|
|
293
|
+
e.maintainAspectRatio ? t({ ...e, width: l, height: Math.round(l / e.originRatio) }) : t({ ...e, width: l });
|
|
300
294
|
}
|
|
301
|
-
},
|
|
295
|
+
},
|
|
302
296
|
min: 20,
|
|
303
|
-
className:
|
|
297
|
+
className: o.watermarkInput
|
|
304
298
|
}
|
|
305
299
|
)
|
|
306
300
|
] }),
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
310
|
-
|
|
301
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
302
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.height") }),
|
|
303
|
+
/* @__PURE__ */ s.jsx(
|
|
304
|
+
g,
|
|
311
305
|
{
|
|
312
|
-
value:
|
|
313
|
-
onChange:
|
|
314
|
-
if (
|
|
315
|
-
const
|
|
316
|
-
|
|
306
|
+
value: e.height,
|
|
307
|
+
onChange: (i) => {
|
|
308
|
+
if (i != null) {
|
|
309
|
+
const l = Math.max(20, Number.parseInt(i.toString()));
|
|
310
|
+
e.maintainAspectRatio ? t({ ...e, height: l, width: Math.round(l * e.originRatio) }) : t({ ...e, height: Number.parseInt(i.toString()) });
|
|
317
311
|
}
|
|
318
|
-
},
|
|
312
|
+
},
|
|
319
313
|
min: 20,
|
|
320
|
-
className:
|
|
314
|
+
className: o.watermarkInput
|
|
321
315
|
}
|
|
322
316
|
)
|
|
323
317
|
] })
|
|
324
318
|
] }) }),
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
-
/* @__PURE__ */
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
/* @__PURE__ */
|
|
331
|
-
|
|
319
|
+
/* @__PURE__ */ s.jsx("div", { className: o.watermarkTextSettingHeader, children: r.t("univer-watermark.layout") }),
|
|
320
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayout, children: [
|
|
321
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingFontStylePart, children: [
|
|
322
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
323
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.rotate") }),
|
|
324
|
+
/* @__PURE__ */ s.jsx(
|
|
325
|
+
g,
|
|
332
326
|
{
|
|
333
|
-
value:
|
|
334
|
-
onChange:
|
|
335
|
-
|
|
336
|
-
},
|
|
327
|
+
value: e.rotate,
|
|
328
|
+
onChange: (i) => {
|
|
329
|
+
i != null && t({ ...e, rotate: Number.parseInt(i.toString()) });
|
|
330
|
+
},
|
|
337
331
|
max: 360,
|
|
338
332
|
min: -360,
|
|
339
|
-
className:
|
|
333
|
+
className: o.watermarkInput
|
|
340
334
|
}
|
|
341
335
|
)
|
|
342
336
|
] }),
|
|
343
|
-
/* @__PURE__ */
|
|
344
|
-
/* @__PURE__ */
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
-
|
|
337
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
338
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.repeat") }),
|
|
339
|
+
/* @__PURE__ */ s.jsx(
|
|
340
|
+
X,
|
|
347
341
|
{
|
|
348
|
-
checked:
|
|
349
|
-
onChange:
|
|
342
|
+
checked: e.repeat,
|
|
343
|
+
onChange: (i) => t({ ...e, repeat: i })
|
|
350
344
|
}
|
|
351
345
|
)
|
|
352
346
|
] })
|
|
353
347
|
] }),
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
|
|
348
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingFontStylePart, children: [
|
|
349
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
350
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.spacingX") }),
|
|
351
|
+
/* @__PURE__ */ s.jsx(
|
|
352
|
+
g,
|
|
359
353
|
{
|
|
360
|
-
value:
|
|
361
|
-
onChange:
|
|
362
|
-
|
|
363
|
-
},
|
|
354
|
+
value: e.spacingX,
|
|
355
|
+
onChange: (i) => {
|
|
356
|
+
i != null && t({ ...e, spacingX: Number.parseInt(i.toString()) });
|
|
357
|
+
},
|
|
364
358
|
min: 0,
|
|
365
|
-
className:
|
|
359
|
+
className: o.watermarkInput
|
|
366
360
|
}
|
|
367
361
|
)
|
|
368
362
|
] }),
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
-
/* @__PURE__ */
|
|
372
|
-
|
|
363
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
364
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.spacingY") }),
|
|
365
|
+
/* @__PURE__ */ s.jsx(
|
|
366
|
+
g,
|
|
373
367
|
{
|
|
374
|
-
value:
|
|
375
|
-
onChange:
|
|
376
|
-
|
|
377
|
-
},
|
|
368
|
+
value: e.spacingY,
|
|
369
|
+
onChange: (i) => {
|
|
370
|
+
i != null && t({ ...e, spacingY: Number.parseInt(i.toString()) });
|
|
371
|
+
},
|
|
378
372
|
min: 0,
|
|
379
|
-
className:
|
|
373
|
+
className: o.watermarkInput
|
|
380
374
|
}
|
|
381
375
|
)
|
|
382
376
|
] })
|
|
383
377
|
] }),
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
|
|
378
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingFontStylePart, children: [
|
|
379
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
380
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.startX") }),
|
|
381
|
+
/* @__PURE__ */ s.jsx(
|
|
382
|
+
g,
|
|
389
383
|
{
|
|
390
|
-
value:
|
|
391
|
-
onChange:
|
|
392
|
-
|
|
393
|
-
},
|
|
384
|
+
value: e.x,
|
|
385
|
+
onChange: (i) => {
|
|
386
|
+
i != null && t({ ...e, x: Number.parseInt(i.toString()) });
|
|
387
|
+
},
|
|
394
388
|
min: 0,
|
|
395
|
-
className:
|
|
389
|
+
className: o.watermarkInput
|
|
396
390
|
}
|
|
397
391
|
)
|
|
398
392
|
] }),
|
|
399
|
-
/* @__PURE__ */
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
-
/* @__PURE__ */
|
|
402
|
-
|
|
393
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
394
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.startY") }),
|
|
395
|
+
/* @__PURE__ */ s.jsx(
|
|
396
|
+
g,
|
|
403
397
|
{
|
|
404
|
-
value:
|
|
405
|
-
onChange:
|
|
406
|
-
|
|
407
|
-
},
|
|
398
|
+
value: e.y,
|
|
399
|
+
onChange: (i) => {
|
|
400
|
+
i != null && t({ ...e, y: Number.parseInt(i.toString()) });
|
|
401
|
+
},
|
|
408
402
|
min: 0,
|
|
409
|
-
className:
|
|
403
|
+
className: o.watermarkInput
|
|
410
404
|
}
|
|
411
405
|
)
|
|
412
406
|
] })
|
|
413
407
|
] })
|
|
414
408
|
] })
|
|
415
409
|
] });
|
|
416
|
-
}
|
|
417
|
-
function
|
|
418
|
-
var t,
|
|
419
|
-
if (typeof e == "string" || typeof e == "number")
|
|
410
|
+
};
|
|
411
|
+
function ge(e) {
|
|
412
|
+
var t, a, r = "";
|
|
413
|
+
if (typeof e == "string" || typeof e == "number") r += e;
|
|
420
414
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
421
|
-
var
|
|
422
|
-
for (t = 0; t <
|
|
423
|
-
} else for (
|
|
424
|
-
return
|
|
415
|
+
var n = e.length;
|
|
416
|
+
for (t = 0; t < n; t++) e[t] && (a = ge(e[t])) && (r && (r += " "), r += a);
|
|
417
|
+
} else for (a in e) e[a] && (r && (r += " "), r += a);
|
|
418
|
+
return r;
|
|
425
419
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
return n2;
|
|
420
|
+
function q() {
|
|
421
|
+
for (var e, t, a = 0, r = "", n = arguments.length; a < n; a++) (e = arguments[a]) && (t = ge(e)) && (r && (r += " "), r += t);
|
|
422
|
+
return r;
|
|
430
423
|
}
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
|
|
438
|
-
/* @__PURE__ */
|
|
439
|
-
|
|
440
|
-
Input,
|
|
424
|
+
const bt = (e) => {
|
|
425
|
+
var n;
|
|
426
|
+
const { config: t, onChange: a } = e, r = x(R);
|
|
427
|
+
return t ? /* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSetting, children: [
|
|
428
|
+
/* @__PURE__ */ s.jsx("div", { className: o.watermarkTextSettingHeader, children: r.t("univer-watermark.style") }),
|
|
429
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingFontContent, children: [
|
|
430
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.content") }),
|
|
431
|
+
/* @__PURE__ */ s.jsx(
|
|
432
|
+
Ue,
|
|
441
433
|
{
|
|
442
|
-
value:
|
|
443
|
-
onChange:
|
|
444
|
-
className:
|
|
445
|
-
placeholder:
|
|
434
|
+
value: t.content,
|
|
435
|
+
onChange: (i) => a({ ...t, content: i }),
|
|
436
|
+
className: o.watermarkInputContent,
|
|
437
|
+
placeholder: r.t("univer-watermark.textPlaceholder")
|
|
446
438
|
}
|
|
447
439
|
)
|
|
448
440
|
] }),
|
|
449
|
-
/* @__PURE__ */
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
|
|
441
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingFontStyle, children: [
|
|
442
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingFontStylePart, children: [
|
|
443
|
+
/* @__PURE__ */ s.jsxs("div", { children: [
|
|
444
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.fontSize") }),
|
|
445
|
+
/* @__PURE__ */ s.jsx(
|
|
446
|
+
g,
|
|
455
447
|
{
|
|
456
|
-
value:
|
|
457
|
-
onChange:
|
|
458
|
-
|
|
459
|
-
},
|
|
448
|
+
value: t.fontSize,
|
|
449
|
+
onChange: (i) => {
|
|
450
|
+
i != null && a({ ...t, fontSize: Number.parseInt(i.toString()) });
|
|
451
|
+
},
|
|
460
452
|
max: 72,
|
|
461
453
|
min: 12,
|
|
462
|
-
className:
|
|
454
|
+
className: o.watermarkInput
|
|
463
455
|
}
|
|
464
456
|
)
|
|
465
457
|
] }),
|
|
466
|
-
/* @__PURE__ */
|
|
467
|
-
/* @__PURE__ */
|
|
468
|
-
/* @__PURE__ */
|
|
469
|
-
|
|
458
|
+
/* @__PURE__ */ s.jsxs("div", { style: { margin: "0 8px" }, children: [
|
|
459
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.direction") }),
|
|
460
|
+
/* @__PURE__ */ s.jsx(
|
|
461
|
+
re,
|
|
470
462
|
{
|
|
471
|
-
value:
|
|
472
|
-
onChange:
|
|
463
|
+
value: t.direction,
|
|
464
|
+
onChange: (i) => a({ ...t, direction: i }),
|
|
473
465
|
options: [
|
|
474
|
-
{ label:
|
|
475
|
-
{ label:
|
|
466
|
+
{ label: r.t("univer-watermark.ltr"), value: "ltr" },
|
|
467
|
+
{ label: r.t("univer-watermark.rtl"), value: "rtl" }
|
|
476
468
|
]
|
|
477
469
|
}
|
|
478
470
|
)
|
|
479
471
|
] }),
|
|
480
|
-
/* @__PURE__ */
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
|
|
472
|
+
/* @__PURE__ */ s.jsxs("div", { children: [
|
|
473
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.opacity") }),
|
|
474
|
+
/* @__PURE__ */ s.jsx(
|
|
475
|
+
g,
|
|
484
476
|
{
|
|
485
|
-
value:
|
|
486
|
-
onChange:
|
|
487
|
-
|
|
488
|
-
},
|
|
477
|
+
value: t.opacity,
|
|
478
|
+
onChange: (i) => {
|
|
479
|
+
i != null && a({ ...t, opacity: Number.parseFloat(i.toString()) });
|
|
480
|
+
},
|
|
489
481
|
max: 1,
|
|
490
482
|
min: 0,
|
|
491
483
|
step: 0.05,
|
|
492
|
-
className:
|
|
484
|
+
className: o.watermarkInput
|
|
493
485
|
}
|
|
494
486
|
)
|
|
495
487
|
] })
|
|
496
488
|
] }),
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
/* @__PURE__ */
|
|
499
|
-
|
|
489
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingFontStylePart, children: [
|
|
490
|
+
/* @__PURE__ */ s.jsx("div", { className: o.watermarkIconWrapper, children: /* @__PURE__ */ s.jsx(
|
|
491
|
+
$e,
|
|
500
492
|
{
|
|
501
|
-
overlay: /* @__PURE__ */
|
|
502
|
-
children: /* @__PURE__ */
|
|
493
|
+
overlay: /* @__PURE__ */ s.jsx("div", { className: o.watermarkColorPickerWrapper, children: /* @__PURE__ */ s.jsx(De, { color: t.color, onChange: (i) => a({ ...t, color: i }) }) }),
|
|
494
|
+
children: /* @__PURE__ */ s.jsx(ce, { className: o.watermarkIcon, extend: { colorChannel1: (n = t.color) != null ? n : "rgb(var(--primary-color))" } })
|
|
503
495
|
}
|
|
504
496
|
) }),
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
|
|
507
|
-
},
|
|
508
|
-
/* @__PURE__ */
|
|
509
|
-
|
|
510
|
-
},
|
|
497
|
+
/* @__PURE__ */ s.jsx("div", { className: q(o.watermarkIconWrapper, { [o.watermarkIconWrapperSelect]: t.bold }), onClick: () => {
|
|
498
|
+
a({ ...t, bold: !t.bold });
|
|
499
|
+
}, children: /* @__PURE__ */ s.jsx(le, { className: o.watermarkIcon }) }),
|
|
500
|
+
/* @__PURE__ */ s.jsx("div", { className: q(o.watermarkIconWrapper, { [o.watermarkIconWrapperSelect]: t.italic }), onClick: () => {
|
|
501
|
+
a({ ...t, italic: !t.italic });
|
|
502
|
+
}, children: /* @__PURE__ */ s.jsx(me, { className: o.watermarkIcon }) })
|
|
511
503
|
] })
|
|
512
504
|
] }),
|
|
513
|
-
/* @__PURE__ */
|
|
514
|
-
/* @__PURE__ */
|
|
515
|
-
/* @__PURE__ */
|
|
516
|
-
/* @__PURE__ */
|
|
517
|
-
/* @__PURE__ */
|
|
518
|
-
/* @__PURE__ */
|
|
519
|
-
|
|
505
|
+
/* @__PURE__ */ s.jsx("div", { className: o.watermarkTextSettingHeader, children: r.t("univer-watermark.layout") }),
|
|
506
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayout, children: [
|
|
507
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingFontStylePart, children: [
|
|
508
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
509
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.rotate") }),
|
|
510
|
+
/* @__PURE__ */ s.jsx(
|
|
511
|
+
g,
|
|
520
512
|
{
|
|
521
|
-
value:
|
|
522
|
-
onChange:
|
|
523
|
-
|
|
524
|
-
},
|
|
513
|
+
value: t.rotate,
|
|
514
|
+
onChange: (i) => {
|
|
515
|
+
i != null && a({ ...t, rotate: Number.parseInt(i.toString()) });
|
|
516
|
+
},
|
|
525
517
|
max: 360,
|
|
526
518
|
min: -360,
|
|
527
|
-
className:
|
|
519
|
+
className: o.watermarkInput
|
|
528
520
|
}
|
|
529
521
|
)
|
|
530
522
|
] }),
|
|
531
|
-
/* @__PURE__ */
|
|
532
|
-
/* @__PURE__ */
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
-
|
|
523
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
524
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.repeat") }),
|
|
525
|
+
/* @__PURE__ */ s.jsx(
|
|
526
|
+
X,
|
|
535
527
|
{
|
|
536
|
-
checked:
|
|
537
|
-
onChange:
|
|
528
|
+
checked: t.repeat,
|
|
529
|
+
onChange: (i) => a({ ...t, repeat: i })
|
|
538
530
|
}
|
|
539
531
|
)
|
|
540
532
|
] })
|
|
541
533
|
] }),
|
|
542
|
-
/* @__PURE__ */
|
|
543
|
-
/* @__PURE__ */
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */
|
|
546
|
-
|
|
534
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingFontStylePart, children: [
|
|
535
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
536
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.spacingX") }),
|
|
537
|
+
/* @__PURE__ */ s.jsx(
|
|
538
|
+
g,
|
|
547
539
|
{
|
|
548
|
-
value:
|
|
549
|
-
onChange:
|
|
550
|
-
|
|
551
|
-
},
|
|
540
|
+
value: t.spacingX,
|
|
541
|
+
onChange: (i) => {
|
|
542
|
+
i != null && a({ ...t, spacingX: Number.parseInt(i.toString()) });
|
|
543
|
+
},
|
|
552
544
|
min: 0,
|
|
553
|
-
className:
|
|
545
|
+
className: o.watermarkInput
|
|
554
546
|
}
|
|
555
547
|
)
|
|
556
548
|
] }),
|
|
557
|
-
/* @__PURE__ */
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
|
|
549
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
550
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.spacingY") }),
|
|
551
|
+
/* @__PURE__ */ s.jsx(
|
|
552
|
+
g,
|
|
561
553
|
{
|
|
562
|
-
value:
|
|
563
|
-
onChange:
|
|
564
|
-
|
|
565
|
-
},
|
|
554
|
+
value: t.spacingY,
|
|
555
|
+
onChange: (i) => {
|
|
556
|
+
i != null && a({ ...t, spacingY: Number.parseInt(i.toString()) });
|
|
557
|
+
},
|
|
566
558
|
min: 0,
|
|
567
|
-
className:
|
|
559
|
+
className: o.watermarkInput
|
|
568
560
|
}
|
|
569
561
|
)
|
|
570
562
|
] })
|
|
571
563
|
] }),
|
|
572
|
-
/* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
-
/* @__PURE__ */
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
|
|
564
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingFontStylePart, children: [
|
|
565
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
566
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.startX") }),
|
|
567
|
+
/* @__PURE__ */ s.jsx(
|
|
568
|
+
g,
|
|
577
569
|
{
|
|
578
|
-
value:
|
|
579
|
-
onChange:
|
|
580
|
-
|
|
581
|
-
},
|
|
570
|
+
value: t.x,
|
|
571
|
+
onChange: (i) => {
|
|
572
|
+
i != null && a({ ...t, x: Number.parseInt(i.toString()) });
|
|
573
|
+
},
|
|
582
574
|
min: 0,
|
|
583
|
-
className:
|
|
575
|
+
className: o.watermarkInput
|
|
584
576
|
}
|
|
585
577
|
)
|
|
586
578
|
] }),
|
|
587
|
-
/* @__PURE__ */
|
|
588
|
-
/* @__PURE__ */
|
|
589
|
-
/* @__PURE__ */
|
|
590
|
-
|
|
579
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkTextSettingLayoutFontWrapper, children: [
|
|
580
|
+
/* @__PURE__ */ s.jsx("div", { children: r.t("univer-watermark.startY") }),
|
|
581
|
+
/* @__PURE__ */ s.jsx(
|
|
582
|
+
g,
|
|
591
583
|
{
|
|
592
|
-
value:
|
|
593
|
-
onChange:
|
|
594
|
-
|
|
595
|
-
},
|
|
584
|
+
value: t.y,
|
|
585
|
+
onChange: (i) => {
|
|
586
|
+
i != null && a({ ...t, y: Number.parseInt(i.toString()) });
|
|
587
|
+
},
|
|
596
588
|
min: 0,
|
|
597
|
-
className:
|
|
589
|
+
className: o.watermarkInput
|
|
598
590
|
}
|
|
599
591
|
)
|
|
600
592
|
] })
|
|
601
593
|
] })
|
|
602
594
|
] })
|
|
603
595
|
] }) : null;
|
|
604
|
-
},
|
|
605
|
-
const [
|
|
606
|
-
function
|
|
607
|
-
|
|
596
|
+
}, Rt = () => {
|
|
597
|
+
const [e, t] = z(m.Text), [a, r] = z(), n = x(T), i = x(F), l = we(n.refresh$), d = x(R);
|
|
598
|
+
function u(c, h) {
|
|
599
|
+
r(c), n.updateWatermarkConfig({ type: h != null ? h : e, config: c });
|
|
608
600
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
watermarkConfig ? (setWatermarkType(watermarkConfig.type), setConfig(watermarkConfig.config)) : setConfig({ text: WatermarkTextBaseConfig });
|
|
601
|
+
const p = Fe(async () => {
|
|
602
|
+
const c = await i.getItem(S);
|
|
603
|
+
c ? (t(c.type), r(c.config)) : r({ text: O });
|
|
613
604
|
}, []);
|
|
614
|
-
return
|
|
615
|
-
|
|
616
|
-
}, [
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
-
/* @__PURE__ */
|
|
619
|
-
|
|
605
|
+
return Ae(() => {
|
|
606
|
+
p();
|
|
607
|
+
}, [l, p]), /* @__PURE__ */ s.jsxs("div", { className: o.watermarkPanel, children: [
|
|
608
|
+
/* @__PURE__ */ s.jsx("div", { className: o.watermarkPanelTypeTitle, children: d.t("univer-watermark.type") }),
|
|
609
|
+
/* @__PURE__ */ s.jsx(
|
|
610
|
+
re,
|
|
620
611
|
{
|
|
621
|
-
value:
|
|
622
|
-
onChange:
|
|
623
|
-
|
|
624
|
-
},
|
|
612
|
+
value: e,
|
|
613
|
+
onChange: (c) => {
|
|
614
|
+
t(c), c === m.Text ? u({ text: O }, m.Text) : c === m.Image && u({ image: se }, m.Image);
|
|
615
|
+
},
|
|
625
616
|
options: [
|
|
626
|
-
{ label:
|
|
627
|
-
{ label:
|
|
617
|
+
{ label: d.t("univer-watermark.text"), value: m.Text },
|
|
618
|
+
{ label: d.t("univer-watermark.image"), value: m.Image }
|
|
628
619
|
],
|
|
629
|
-
className:
|
|
620
|
+
className: o.watermarkPanelTypeSelect
|
|
630
621
|
}
|
|
631
622
|
),
|
|
632
|
-
/* @__PURE__ */
|
|
633
|
-
|
|
634
|
-
|
|
623
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkPanelSetting, children: [
|
|
624
|
+
e === m.Text && /* @__PURE__ */ s.jsx(bt, { config: a == null ? void 0 : a.text, onChange: (c) => u({ text: c }) }),
|
|
625
|
+
e === m.Image && /* @__PURE__ */ s.jsx(Wt, { config: a == null ? void 0 : a.image, onChange: (c) => u({ image: c }) })
|
|
635
626
|
] })
|
|
636
627
|
] });
|
|
637
|
-
},
|
|
638
|
-
const
|
|
639
|
-
return /* @__PURE__ */
|
|
640
|
-
/* @__PURE__ */
|
|
628
|
+
}, Pt = () => {
|
|
629
|
+
const e = x(te), t = x(T), a = x(R), r = x(be);
|
|
630
|
+
return /* @__PURE__ */ s.jsxs("div", { className: o.watermarkPanelFooter, children: [
|
|
631
|
+
/* @__PURE__ */ s.jsx(
|
|
641
632
|
"div",
|
|
642
633
|
{
|
|
643
|
-
className:
|
|
644
|
-
onClick:
|
|
645
|
-
|
|
646
|
-
type:
|
|
647
|
-
config: { text:
|
|
648
|
-
}),
|
|
649
|
-
},
|
|
650
|
-
children:
|
|
634
|
+
className: o.watermarkPanelFooterReset,
|
|
635
|
+
onClick: () => {
|
|
636
|
+
t.updateWatermarkConfig({
|
|
637
|
+
type: m.Text,
|
|
638
|
+
config: { text: O }
|
|
639
|
+
}), t.refresh();
|
|
640
|
+
},
|
|
641
|
+
children: a.t("univer-watermark.cancel")
|
|
651
642
|
}
|
|
652
643
|
),
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
-
|
|
644
|
+
/* @__PURE__ */ s.jsxs("div", { className: o.watermarkPanelFooterButtonWrapper, children: [
|
|
645
|
+
/* @__PURE__ */ s.jsx(
|
|
646
|
+
Y,
|
|
656
647
|
{
|
|
657
648
|
style: { marginRight: 8 },
|
|
658
|
-
onClick:
|
|
659
|
-
const
|
|
660
|
-
let
|
|
661
|
-
(
|
|
662
|
-
},
|
|
663
|
-
children:
|
|
649
|
+
onClick: async () => {
|
|
650
|
+
const n = await t.getWatermarkConfig();
|
|
651
|
+
let i;
|
|
652
|
+
(n == null ? void 0 : n.type) === m.Text ? i = n.config.text : (n == null ? void 0 : n.type) === m.Image && (i = n.config.image), r.writeText(JSON.stringify(i));
|
|
653
|
+
},
|
|
654
|
+
children: a.t("univer-watermark.copy")
|
|
664
655
|
}
|
|
665
656
|
),
|
|
666
|
-
/* @__PURE__ */
|
|
667
|
-
|
|
657
|
+
/* @__PURE__ */ s.jsx(
|
|
658
|
+
Y,
|
|
668
659
|
{
|
|
669
|
-
onClick:
|
|
670
|
-
var
|
|
671
|
-
const
|
|
672
|
-
((
|
|
673
|
-
},
|
|
674
|
-
children:
|
|
660
|
+
onClick: async () => {
|
|
661
|
+
var i, l;
|
|
662
|
+
const n = await t.getWatermarkConfig();
|
|
663
|
+
((n == null ? void 0 : n.type) === m.Text && !((i = n.config.text) != null && i.content) || (n == null ? void 0 : n.type) === m.Image && !((l = n.config.image) != null && l.url)) && t.deleteWatermarkConfig(), e.close();
|
|
664
|
+
},
|
|
665
|
+
children: a.t("univer-watermark.close")
|
|
675
666
|
}
|
|
676
667
|
)
|
|
677
668
|
] })
|
|
678
669
|
] });
|
|
679
|
-
}
|
|
680
|
-
function
|
|
670
|
+
};
|
|
671
|
+
function Lt(e) {
|
|
681
672
|
return {
|
|
682
|
-
id:
|
|
673
|
+
id: K.id,
|
|
683
674
|
title: "univer-watermark.title",
|
|
684
675
|
tooltip: "univer-watermark.title",
|
|
685
|
-
icon:
|
|
686
|
-
type:
|
|
687
|
-
hidden$:
|
|
676
|
+
icon: ae,
|
|
677
|
+
type: Re.BUTTON,
|
|
678
|
+
hidden$: Mt(e)
|
|
688
679
|
};
|
|
689
680
|
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
switchMap((id) => id === DOCS_ZEN_EDITOR_UNIT_ID_KEY ? of(!0) : of(!1))
|
|
681
|
+
function Mt(e) {
|
|
682
|
+
return e.get(ke).focused$.pipe(
|
|
683
|
+
He((a) => a === Se ? Z(!0) : Z(!1))
|
|
694
684
|
);
|
|
695
685
|
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
[OpenWatermarkPanelOperation.id]: {
|
|
686
|
+
const Ot = {
|
|
687
|
+
[Pe.OTHERS]: {
|
|
688
|
+
[K.id]: {
|
|
700
689
|
order: 0,
|
|
701
|
-
menuItemFactory:
|
|
690
|
+
menuItemFactory: Lt
|
|
702
691
|
}
|
|
703
692
|
}
|
|
704
693
|
};
|
|
705
|
-
var
|
|
706
|
-
for (var
|
|
707
|
-
(
|
|
708
|
-
return
|
|
709
|
-
},
|
|
710
|
-
let
|
|
711
|
-
constructor(
|
|
712
|
-
super(), this._menuManagerService =
|
|
694
|
+
var Et = Object.defineProperty, Ft = Object.getOwnPropertyDescriptor, At = (e, t, a, r) => {
|
|
695
|
+
for (var n = r > 1 ? void 0 : r ? Ft(t, a) : t, i = e.length - 1, l; i >= 0; i--)
|
|
696
|
+
(l = e[i]) && (n = (r ? l(t, a, n) : l(n)) || n);
|
|
697
|
+
return r && n && Et(t, a, n), n;
|
|
698
|
+
}, J = (e, t) => (a, r) => t(a, r, e);
|
|
699
|
+
let E = class extends ee {
|
|
700
|
+
constructor(e, t) {
|
|
701
|
+
super(), this._menuManagerService = e, this._componentManager = t, this._initMenu(), this._initComponents();
|
|
713
702
|
}
|
|
714
703
|
_initComponents() {
|
|
715
704
|
[
|
|
716
|
-
[
|
|
717
|
-
[
|
|
718
|
-
[
|
|
719
|
-
].forEach(([
|
|
720
|
-
this.disposeWithMe(this._componentManager.register(
|
|
705
|
+
[ae, de],
|
|
706
|
+
[ne, Rt],
|
|
707
|
+
[ie, Pt]
|
|
708
|
+
].forEach(([e, t]) => {
|
|
709
|
+
this.disposeWithMe(this._componentManager.register(e, t));
|
|
721
710
|
});
|
|
722
711
|
}
|
|
723
712
|
_initMenu() {
|
|
724
|
-
this._menuManagerService.mergeMenu(
|
|
713
|
+
this._menuManagerService.mergeMenu(Ot);
|
|
725
714
|
}
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
],
|
|
731
|
-
function
|
|
732
|
-
const
|
|
733
|
-
|
|
715
|
+
};
|
|
716
|
+
E = At([
|
|
717
|
+
J(0, Me),
|
|
718
|
+
J(1, j(Le))
|
|
719
|
+
], E);
|
|
720
|
+
function Ut(e, t, a, r) {
|
|
721
|
+
const n = t.type, i = t.config;
|
|
722
|
+
n === m.UserInfo && i.userInfo ? $t(e, i.userInfo, r) : n === m.Image && i.image ? Ht(e, i.image, a) : n === m.Text && i.text && Dt(e, i.text);
|
|
734
723
|
}
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
if (!userInfo)
|
|
724
|
+
function $t(e, t, a) {
|
|
725
|
+
const { x: r, y: n, repeat: i, spacingX: l, spacingY: d, rotate: u, opacity: p, name: c, fontSize: h, color: v, bold: W, italic: N, direction: w } = t;
|
|
726
|
+
if (!a)
|
|
739
727
|
return;
|
|
740
|
-
let
|
|
741
|
-
if (
|
|
728
|
+
let _ = "";
|
|
729
|
+
if (c && (_ += `${a.name} `), !_)
|
|
742
730
|
return;
|
|
743
|
-
|
|
744
|
-
let
|
|
745
|
-
if (
|
|
746
|
-
const
|
|
747
|
-
for (let
|
|
748
|
-
for (let
|
|
749
|
-
|
|
731
|
+
e.save(), e.globalAlpha = p, e.direction = w;
|
|
732
|
+
let I = "";
|
|
733
|
+
if (N && (I += "italic "), W && (I += "bold "), I += `${h}px Arial`, e.font = I, e.fillStyle = v, i) {
|
|
734
|
+
const y = e.canvas.width, C = e.canvas.height;
|
|
735
|
+
for (let U = n; U < C; U += h + d)
|
|
736
|
+
for (let $ = r; $ < y; $ += e.measureText(_).width + l)
|
|
737
|
+
e.save(), e.translate($, U), e.rotate(Math.PI / 180 * u), e.fillText(_, 0, 0), e.restore();
|
|
750
738
|
} else
|
|
751
|
-
|
|
752
|
-
|
|
739
|
+
e.save(), e.translate(r, n), e.rotate(Math.PI / 180 * u), e.fillText(_, 0, 0), e.restore();
|
|
740
|
+
e.restore();
|
|
753
741
|
}
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
ctx.save(), ctx.translate(posX, posY), ctx.rotate(Math.PI / 180 * rotate), ctx.fillText(content, 0, 0), ctx.restore();
|
|
742
|
+
function Dt(e, t) {
|
|
743
|
+
const { x: a, y: r, repeat: n, spacingX: i, spacingY: l, rotate: d, opacity: u, content: p, fontSize: c, color: h, bold: v, italic: W, direction: N } = t;
|
|
744
|
+
e.save(), e.globalAlpha = u, e.direction = N;
|
|
745
|
+
let w = "";
|
|
746
|
+
if (W && (w += "italic "), v && (w += "bold "), w += `${c}px Arial`, e.font = w, e.fillStyle = h, p)
|
|
747
|
+
if (n) {
|
|
748
|
+
const _ = e.canvas.width, I = e.canvas.height;
|
|
749
|
+
for (let y = r; y < I; y += c + l)
|
|
750
|
+
for (let C = a; C < _; C += e.measureText(p).width + i)
|
|
751
|
+
e.save(), e.translate(C, y), e.rotate(Math.PI / 180 * d), e.fillText(p, 0, 0), e.restore();
|
|
765
752
|
} else
|
|
766
|
-
|
|
767
|
-
|
|
753
|
+
e.save(), e.translate(a, r), e.rotate(Math.PI / 180 * d), e.fillText(p, 0, 0), e.restore();
|
|
754
|
+
e.restore();
|
|
768
755
|
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
if (!(image != null && image.complete))
|
|
756
|
+
function Ht(e, t, a) {
|
|
757
|
+
const { x: r, y: n, repeat: i, spacingX: l, spacingY: d, rotate: u, opacity: p, width: c, height: h, maintainAspectRatio: v, originRatio: W } = t;
|
|
758
|
+
if (!(a != null && a.complete))
|
|
773
759
|
return;
|
|
774
|
-
|
|
775
|
-
const
|
|
776
|
-
if (
|
|
777
|
-
const
|
|
778
|
-
for (let
|
|
779
|
-
for (let
|
|
780
|
-
|
|
760
|
+
e.save(), e.globalAlpha = p;
|
|
761
|
+
const N = c, w = v ? c / W : h;
|
|
762
|
+
if (i) {
|
|
763
|
+
const _ = e.canvas.width, I = e.canvas.height;
|
|
764
|
+
for (let y = n; y < I; y += w + d)
|
|
765
|
+
for (let C = r; C < _; C += N + l)
|
|
766
|
+
e.save(), e.translate(C, y), e.rotate(Math.PI / 180 * u), e.drawImage(a, 0, 0, N, w), e.restore();
|
|
781
767
|
} else
|
|
782
|
-
|
|
783
|
-
|
|
768
|
+
e.save(), e.translate(r, n), e.rotate(Math.PI / 180 * u), e.drawImage(a, 0, 0, N, w), e.restore();
|
|
769
|
+
e.restore();
|
|
784
770
|
}
|
|
785
|
-
|
|
786
|
-
const _WatermarkLayer = class _WatermarkLayer extends Layer {
|
|
771
|
+
class Yt extends Ne {
|
|
787
772
|
constructor() {
|
|
788
773
|
super(...arguments);
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
774
|
+
k(this, "_config");
|
|
775
|
+
k(this, "_image");
|
|
776
|
+
k(this, "_user");
|
|
792
777
|
}
|
|
793
|
-
render(
|
|
794
|
-
var
|
|
795
|
-
super.render(
|
|
796
|
-
const
|
|
797
|
-
return
|
|
778
|
+
render(a, r = !1) {
|
|
779
|
+
var i;
|
|
780
|
+
super.render(a, r);
|
|
781
|
+
const n = a || ((i = this.scene.getEngine()) == null ? void 0 : i.getCanvas().getContext());
|
|
782
|
+
return n && n.getId() && this._renderWatermark(n), this;
|
|
798
783
|
}
|
|
799
|
-
updateConfig(
|
|
800
|
-
var
|
|
801
|
-
this._config =
|
|
784
|
+
updateConfig(a, r) {
|
|
785
|
+
var n;
|
|
786
|
+
this._config = a, ((n = this._config) == null ? void 0 : n.type) === m.Image && this._config.config.image && (this._image = new Image(), this._image.src = this._config.config.image.url), r && (this._user = r);
|
|
802
787
|
}
|
|
803
|
-
_renderWatermark(
|
|
804
|
-
this._config &&
|
|
788
|
+
_renderWatermark(a) {
|
|
789
|
+
this._config && Ut(a, this._config, this._image, this._user);
|
|
805
790
|
}
|
|
806
|
-
}
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
let WatermarkRenderController = (_a3 = class extends RxDisposable {
|
|
815
|
-
constructor(_context, _watermarkService, _localStorageService, _userManagerService) {
|
|
791
|
+
}
|
|
792
|
+
var Xt = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, Kt = (e, t, a, r) => {
|
|
793
|
+
for (var n = r > 1 ? void 0 : r ? Bt(t, a) : t, i = e.length - 1, l; i >= 0; i--)
|
|
794
|
+
(l = e[i]) && (n = (r ? l(t, a, n) : l(n)) || n);
|
|
795
|
+
return r && n && Xt(t, a, n), n;
|
|
796
|
+
}, D = (e, t) => (a, r) => t(a, r, e);
|
|
797
|
+
let B = class extends _e {
|
|
798
|
+
constructor(t, a, r, n) {
|
|
816
799
|
super();
|
|
817
|
-
|
|
818
|
-
this._context =
|
|
800
|
+
k(this, "_watermarkLayer");
|
|
801
|
+
this._context = t, this._watermarkService = a, this._localStorageService = r, this._userManagerService = n, this._watermarkLayer = new Yt(t.scene, [], Ye), this._initAddRender(), this._initWatermarkUpdate(), this._initWatermarkConfig();
|
|
819
802
|
}
|
|
820
803
|
_initAddRender() {
|
|
821
|
-
const { scene } = this._context;
|
|
822
|
-
|
|
804
|
+
const { scene: t } = this._context;
|
|
805
|
+
t.addLayer(this._watermarkLayer);
|
|
823
806
|
}
|
|
824
807
|
async _initWatermarkConfig() {
|
|
825
|
-
var
|
|
826
|
-
const
|
|
827
|
-
|
|
808
|
+
var a;
|
|
809
|
+
const t = await this._localStorageService.getItem(S);
|
|
810
|
+
t && (this._watermarkService.updateWatermarkConfig(t), (a = this._context.mainComponent) == null || a.makeDirty());
|
|
828
811
|
}
|
|
829
812
|
_initWatermarkUpdate() {
|
|
830
813
|
this.disposeWithMe(
|
|
831
|
-
this._watermarkService.updateConfig$.subscribe((
|
|
832
|
-
var
|
|
833
|
-
if (!
|
|
834
|
-
this._watermarkLayer.updateConfig(), (
|
|
814
|
+
this._watermarkService.updateConfig$.subscribe((t) => {
|
|
815
|
+
var a, r;
|
|
816
|
+
if (!t) {
|
|
817
|
+
this._watermarkLayer.updateConfig(), (a = this._context.mainComponent) == null || a.makeDirty();
|
|
835
818
|
return;
|
|
836
819
|
}
|
|
837
|
-
|
|
820
|
+
t.type === m.UserInfo ? this._watermarkLayer.updateConfig(t, this._userManagerService.getCurrentUser()) : this._watermarkLayer.updateConfig(t), (r = this._context.mainComponent) == null || r.makeDirty();
|
|
838
821
|
})
|
|
839
822
|
);
|
|
840
823
|
}
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
],
|
|
847
|
-
var
|
|
848
|
-
for (var
|
|
849
|
-
(
|
|
850
|
-
return
|
|
851
|
-
},
|
|
852
|
-
const
|
|
853
|
-
var
|
|
854
|
-
let
|
|
855
|
-
constructor(
|
|
856
|
-
super(), this._config =
|
|
857
|
-
const { menu } = this._config;
|
|
858
|
-
|
|
824
|
+
};
|
|
825
|
+
B = Kt([
|
|
826
|
+
D(1, j(T)),
|
|
827
|
+
D(2, j(F)),
|
|
828
|
+
D(3, j(xe))
|
|
829
|
+
], B);
|
|
830
|
+
var Vt = Object.defineProperty, zt = Object.getOwnPropertyDescriptor, Gt = (e, t, a, r) => {
|
|
831
|
+
for (var n = r > 1 ? void 0 : r ? zt(t, a) : t, i = e.length - 1, l; i >= 0; i--)
|
|
832
|
+
(l = e[i]) && (n = (r ? l(t, a, n) : l(n)) || n);
|
|
833
|
+
return r && n && Vt(t, a, n), n;
|
|
834
|
+
}, b = (e, t) => (a, r) => t(a, r, e);
|
|
835
|
+
const Zt = "UNIVER_WATERMARK_PLUGIN";
|
|
836
|
+
var H;
|
|
837
|
+
let Q = (H = class extends Ie {
|
|
838
|
+
constructor(e = {}, t, a, r, n, i) {
|
|
839
|
+
super(), this._config = e, this._injector = t, this._configService = a, this._commandService = r, this._renderManagerSrv = n, this._localStorageService = i;
|
|
840
|
+
const { menu: l } = this._config;
|
|
841
|
+
l && this._configService.setConfig("menu", l, { merge: !0 }), this._initWatermarkStorage(), this._initDependencies(), this._initRegisterCommand();
|
|
859
842
|
}
|
|
860
843
|
async _initWatermarkStorage() {
|
|
861
|
-
const { menu, ...
|
|
862
|
-
if (
|
|
863
|
-
this._localStorageService.setItem(
|
|
864
|
-
else if (
|
|
865
|
-
this._localStorageService.setItem(
|
|
866
|
-
else if (
|
|
867
|
-
this._localStorageService.setItem(
|
|
844
|
+
const { menu: e, ...t } = this._config;
|
|
845
|
+
if (t.userWatermarkSettings)
|
|
846
|
+
this._localStorageService.setItem(S, { type: m.UserInfo, config: { userInfo: { ...Be, ...t.userWatermarkSettings } } });
|
|
847
|
+
else if (t.textWatermarkSettings)
|
|
848
|
+
this._localStorageService.setItem(S, { type: m.Text, config: { text: { ...O, ...t.textWatermarkSettings } } });
|
|
849
|
+
else if (t.imageWatermarkSettings)
|
|
850
|
+
this._localStorageService.setItem(S, { type: m.Image, config: { image: { ...se, ...t.imageWatermarkSettings } } });
|
|
868
851
|
else {
|
|
869
|
-
const
|
|
870
|
-
(
|
|
852
|
+
const a = await this._localStorageService.getItem(S);
|
|
853
|
+
(a == null ? void 0 : a.type) === m.UserInfo && this._localStorageService.removeItem(S);
|
|
871
854
|
}
|
|
872
855
|
}
|
|
873
856
|
_initDependencies() {
|
|
874
|
-
[[
|
|
875
|
-
this._injector.add(
|
|
857
|
+
[[T], [E]].forEach((e) => {
|
|
858
|
+
this._injector.add(e);
|
|
876
859
|
});
|
|
877
860
|
}
|
|
878
861
|
_initRegisterCommand() {
|
|
879
862
|
[
|
|
880
|
-
|
|
881
|
-
].forEach((
|
|
863
|
+
K
|
|
864
|
+
].forEach((e) => this._commandService.registerCommand(e));
|
|
882
865
|
}
|
|
883
866
|
onRendered() {
|
|
884
|
-
const
|
|
885
|
-
|
|
886
|
-
const { userWatermarkSettings, textWatermarkSettings, imageWatermarkSettings, showMenu = !0 } = this._config;
|
|
887
|
-
!(
|
|
867
|
+
const e = this._injector;
|
|
868
|
+
e.get(T);
|
|
869
|
+
const { userWatermarkSettings: t, textWatermarkSettings: a, imageWatermarkSettings: r, showMenu: n = !0 } = this._config;
|
|
870
|
+
!(t || a || r) && n && e.get(E), this._initRenderDependencies();
|
|
888
871
|
}
|
|
889
872
|
_initRenderDependencies() {
|
|
890
873
|
[
|
|
891
|
-
[
|
|
892
|
-
].forEach((
|
|
893
|
-
this._renderManagerSrv.registerRenderModule(
|
|
874
|
+
[B]
|
|
875
|
+
].forEach((e) => {
|
|
876
|
+
this._renderManagerSrv.registerRenderModule(V.UNIVER_SHEET, e), this._renderManagerSrv.registerRenderModule(V.UNIVER_DOC, e);
|
|
894
877
|
});
|
|
895
878
|
}
|
|
896
|
-
},
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
],
|
|
879
|
+
}, k(H, "pluginName", Zt), H);
|
|
880
|
+
Q = Gt([
|
|
881
|
+
b(1, j(ye)),
|
|
882
|
+
b(2, je),
|
|
883
|
+
b(3, j(Ce)),
|
|
884
|
+
b(4, Te),
|
|
885
|
+
b(5, j(F))
|
|
886
|
+
], Q);
|
|
904
887
|
export {
|
|
905
|
-
IWatermarkTypeEnum,
|
|
906
|
-
UniverWatermarkPlugin,
|
|
907
|
-
WatermarkImageBaseConfig,
|
|
908
|
-
WatermarkService,
|
|
909
|
-
WatermarkTextBaseConfig,
|
|
910
|
-
WatermarkUserInfoBaseConfig
|
|
888
|
+
m as IWatermarkTypeEnum,
|
|
889
|
+
Q as UniverWatermarkPlugin,
|
|
890
|
+
se as WatermarkImageBaseConfig,
|
|
891
|
+
T as WatermarkService,
|
|
892
|
+
O as WatermarkTextBaseConfig,
|
|
893
|
+
Be as WatermarkUserInfoBaseConfig
|
|
911
894
|
};
|