@univerjs/docs-hyper-link-ui 0.4.2 → 0.5.0-beta.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/index.js +9 -1
- 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/index.js +586 -557
- package/lib/es/locale/en-US.js +26 -0
- package/lib/es/locale/fa-IR.js +26 -0
- package/lib/es/locale/ru-RU.js +26 -0
- package/lib/es/locale/vi-VN.js +26 -0
- package/lib/es/locale/zh-CN.js +26 -0
- package/lib/es/locale/zh-TW.js +26 -0
- package/lib/types/commands/operations/popup.operation.d.ts +4 -0
- package/lib/types/controllers/render-controllers/hyper-link-event.render-controller.d.ts +2 -2
- package/lib/types/services/hyper-link-popup.service.d.ts +3 -1
- package/lib/umd/index.js +9 -1
- 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 +29 -21
- package/lib/locale/en-US.json +0 -23
- package/lib/locale/fa-IR.json +0 -23
- package/lib/locale/ru-RU.json +0 -23
- package/lib/locale/vi-VN.json +0 -23
- package/lib/locale/zh-CN.json +0 -23
- package/lib/locale/zh-TW.json +0 -23
package/lib/es/index.js
CHANGED
|
@@ -1,418 +1,448 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { FormLayout, Input, Button, Tooltip, MessageType } from "@univerjs/design";
|
|
12
|
-
import { KeyCode, IMessageService, useObservable as
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
var Be = Object.defineProperty;
|
|
2
|
+
var Ae = (n, e, t) => e in n ? Be(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var P = (n, e, t) => Ae(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { CommandType as E, ICommandService as x, generateRandomId as Fe, CustomRangeType as b, IUniverInstanceService as O, UniverInstanceType as I, getBodySlice as ye, useDependency as L, LocaleService as ke, useObservable as Ke, Tools as Ve, BuildTextUtils as ne, Disposable as D, Inject as _, DependentOn as We, Injector as Ye, Plugin as Ge, IConfigService as Ze } from "@univerjs/core";
|
|
5
|
+
import { UniverDocsHyperLinkPlugin as ze } from "@univerjs/docs-hyper-link";
|
|
6
|
+
import { IRenderManagerService as qe } from "@univerjs/engine-render";
|
|
7
|
+
import { addCustomRangeBySelectionFactory as Je, DocSelectionManagerService as M, replaceSelectionFactory as Qe, deleteCustomRangeFactory as Xe, SetTextSelectionsOperation as en, DocSkeletonManagerService as nn, DocInterceptorService as tn, DOC_INTERCEPTOR_POINT as rn } from "@univerjs/docs";
|
|
8
|
+
import { DocCanvasPopManagerService as on, DocEventManagerService as sn, DocRenderController as cn, whenDocAndEditorFocused as dn } from "@univerjs/docs-ui";
|
|
9
|
+
import { BehaviorSubject as me, distinctUntilChanged as an, pairwise as ln, Observable as un, debounceTime as pn } from "rxjs";
|
|
10
|
+
import fn, { useState as q, useEffect as gn, forwardRef as N, useRef as hn, createElement as j } from "react";
|
|
11
|
+
import { FormLayout as _e, Input as Ie, Button as Ce, Tooltip as B, MessageType as vn } from "@univerjs/design";
|
|
12
|
+
import { KeyCode as te, IMessageService as mn, useObservable as _n, MetaKeys as In, MenuItemType as Cn, getMenuHiddenObservable as Ln, RibbonStartGroup as Sn, ContextMenuPosition as yn, ContextMenuGroup as kn, ComponentManager as xn, IMenuManagerService as On, IShortcutService as Pn } from "@univerjs/ui";
|
|
13
|
+
const Rn = "docs-hyper-link-ui.config", En = {};
|
|
14
|
+
var xe = { exports: {} }, Z = {};
|
|
15
|
+
/**
|
|
16
|
+
* @license React
|
|
17
|
+
* react-jsx-runtime.production.min.js
|
|
18
|
+
*
|
|
19
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
20
|
+
*
|
|
21
|
+
* This source code is licensed under the MIT license found in the
|
|
22
|
+
* LICENSE file in the root directory of this source tree.
|
|
23
|
+
*/
|
|
24
|
+
var bn = fn, Mn = Symbol.for("react.element"), wn = Symbol.for("react.fragment"), Dn = Object.prototype.hasOwnProperty, Nn = bn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, jn = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
25
|
+
function Oe(n, e, t) {
|
|
26
|
+
var i, r = {}, s = null, o = null;
|
|
27
|
+
t !== void 0 && (s = "" + t), e.key !== void 0 && (s = "" + e.key), e.ref !== void 0 && (o = e.ref);
|
|
28
|
+
for (i in e) Dn.call(e, i) && !jn.hasOwnProperty(i) && (r[i] = e[i]);
|
|
29
|
+
if (n && n.defaultProps) for (i in e = n.defaultProps, e) r[i] === void 0 && (r[i] = e[i]);
|
|
30
|
+
return { $$typeof: Mn, type: n, key: s, ref: o, props: r, _owner: Nn.current };
|
|
31
|
+
}
|
|
32
|
+
Z.Fragment = wn;
|
|
33
|
+
Z.jsx = Oe;
|
|
34
|
+
Z.jsxs = Oe;
|
|
35
|
+
xe.exports = Z;
|
|
36
|
+
var a = xe.exports;
|
|
37
|
+
const Pe = {
|
|
38
|
+
type: E.COMMAND,
|
|
16
39
|
id: "docs.command.add-hyper-link",
|
|
17
|
-
async handler(
|
|
18
|
-
if (!
|
|
40
|
+
async handler(n, e) {
|
|
41
|
+
if (!e)
|
|
19
42
|
return !1;
|
|
20
|
-
const { payload, unitId, selection } =
|
|
21
|
-
|
|
43
|
+
const { payload: t, unitId: i, selection: r } = e, s = n.get(x), o = Fe(), c = Je(
|
|
44
|
+
n,
|
|
22
45
|
{
|
|
23
|
-
rangeId:
|
|
24
|
-
rangeType:
|
|
46
|
+
rangeId: o,
|
|
47
|
+
rangeType: b.HYPERLINK,
|
|
25
48
|
properties: {
|
|
26
|
-
url:
|
|
49
|
+
url: t
|
|
27
50
|
},
|
|
28
|
-
unitId,
|
|
29
|
-
selection
|
|
51
|
+
unitId: i,
|
|
52
|
+
selection: r
|
|
30
53
|
}
|
|
31
54
|
);
|
|
32
|
-
return
|
|
55
|
+
return c ? s.syncExecuteCommand(c.id, c.params) : !1;
|
|
33
56
|
}
|
|
34
|
-
},
|
|
57
|
+
}, Re = {
|
|
35
58
|
id: "docs.command.update-hyper-link",
|
|
36
|
-
type:
|
|
37
|
-
handler(
|
|
38
|
-
var
|
|
39
|
-
if (!
|
|
59
|
+
type: E.COMMAND,
|
|
60
|
+
handler(n, e) {
|
|
61
|
+
var h;
|
|
62
|
+
if (!e)
|
|
40
63
|
return !1;
|
|
41
|
-
const { unitId, payload, segmentId } =
|
|
42
|
-
if (!
|
|
64
|
+
const { unitId: t, payload: i, segmentId: r, linkId: s } = e, o = n.get(x), c = n.get(O), l = n.get(M).getActiveTextRange(), u = c.getUnit(t, I.UNIVER_DOC);
|
|
65
|
+
if (!l || !u)
|
|
43
66
|
return !1;
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
const
|
|
47
|
-
unitId,
|
|
67
|
+
const p = (h = ye(u.getSelfOrHeaderFooterModel(r).getBody(), l.startOffset, l.endOffset).textRuns) == null ? void 0 : h[0];
|
|
68
|
+
p && (p.ed = e.label.length + 1);
|
|
69
|
+
const d = Qe(n, {
|
|
70
|
+
unitId: t,
|
|
48
71
|
body: {
|
|
49
|
-
dataStream: `${
|
|
72
|
+
dataStream: `${e.label}`,
|
|
50
73
|
customRanges: [{
|
|
51
|
-
rangeId:
|
|
52
|
-
rangeType:
|
|
74
|
+
rangeId: s,
|
|
75
|
+
rangeType: b.HYPERLINK,
|
|
53
76
|
startIndex: 0,
|
|
54
|
-
endIndex:
|
|
77
|
+
endIndex: e.label.length + 1,
|
|
55
78
|
properties: {
|
|
56
|
-
url:
|
|
79
|
+
url: i
|
|
57
80
|
}
|
|
58
81
|
}],
|
|
59
|
-
textRuns:
|
|
82
|
+
textRuns: p ? [p] : void 0
|
|
60
83
|
},
|
|
61
84
|
selection: {
|
|
62
|
-
startOffset:
|
|
63
|
-
endOffset:
|
|
85
|
+
startOffset: l.startOffset,
|
|
86
|
+
endOffset: l.endOffset,
|
|
64
87
|
collapsed: !1,
|
|
65
|
-
segmentId
|
|
88
|
+
segmentId: r
|
|
66
89
|
}
|
|
67
90
|
});
|
|
68
|
-
return
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
docsLinkEdit,
|
|
72
|
-
docsLinkEditTitle,
|
|
73
|
-
docsLinkEditClose,
|
|
74
|
-
docsLinkEditButtons,
|
|
75
|
-
docsLinkEditButton
|
|
91
|
+
return d ? o.syncExecuteCommand(d.id, d.params) : !1;
|
|
92
|
+
}
|
|
93
|
+
}, $n = "univer-docs-link-edit", Un = "univer-docs-link-edit-title", Tn = "univer-docs-link-edit-close", Hn = "univer-docs-link-edit-buttons", Bn = "univer-docs-link-edit-button", A = {
|
|
94
|
+
docsLinkEdit: $n,
|
|
95
|
+
docsLinkEditTitle: Un,
|
|
96
|
+
docsLinkEditClose: Tn,
|
|
97
|
+
docsLinkEditButtons: Hn,
|
|
98
|
+
docsLinkEditButton: Bn
|
|
76
99
|
};
|
|
77
|
-
function
|
|
78
|
-
return /^[a-zA-Z]+:\/\//.test(
|
|
100
|
+
function An(n) {
|
|
101
|
+
return /^[a-zA-Z]+:\/\//.test(n);
|
|
79
102
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(url);
|
|
103
|
+
function Fn(n) {
|
|
104
|
+
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(n);
|
|
83
105
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return hasProtocol(urlStr) ? urlStr : isEmail(urlStr) ? `mailto://${urlStr}` : `https://${urlStr}`;
|
|
106
|
+
function Kn(n) {
|
|
107
|
+
return An(n) ? n : Fn(n) ? `mailto://${n}` : `https://${n}`;
|
|
87
108
|
}
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (!activeRange)
|
|
109
|
+
const K = () => {
|
|
110
|
+
const n = L(S), e = L(ke), t = Ke(n.editingLink$), i = L(x), r = L(O), s = L(M), [o, c] = q(""), [g, l] = q(""), [u, v] = q(!1), p = Ve.isLegalUrl(o), d = t ? r.getUnit(t.unitId, I.UNIVER_DOC) : r.getCurrentUnitForType(I.UNIVER_DOC);
|
|
111
|
+
gn(() => {
|
|
112
|
+
var de, ae, le, ue, pe, fe, ge, he, ve;
|
|
113
|
+
const f = s.getActiveTextRange();
|
|
114
|
+
if (!f)
|
|
95
115
|
return;
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
98
|
-
|
|
116
|
+
if (t) {
|
|
117
|
+
const T = (de = d == null ? void 0 : d.getSelfOrHeaderFooterModel(t.segmentId)) == null ? void 0 : de.getBody(), H = (ae = T == null ? void 0 : T.customRanges) == null ? void 0 : ae.find((z) => (t == null ? void 0 : t.linkId) === z.rangeId && z.startIndex === t.startIndex && z.endIndex === t.endIndex);
|
|
118
|
+
d && H && (c((ue = (le = H.properties) == null ? void 0 : le.url) != null ? ue : ""), l(ne.transform.getPlainText(ye(T, H.startIndex, H.endIndex + 1).dataStream)));
|
|
99
119
|
return;
|
|
100
120
|
}
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
}, [
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
if (
|
|
121
|
+
const y = (pe = d == null ? void 0 : d.getSelfOrHeaderFooterModel(f.segmentId)) == null ? void 0 : pe.getBody(), ce = y ? f : null, U = ce && ((ge = ne.customRange.getCustomRangesInterestsWithSelection(ce, (fe = y == null ? void 0 : y.customRanges) != null ? fe : [])) == null ? void 0 : ge[0]);
|
|
122
|
+
d && U && c((ve = (he = U == null ? void 0 : U.properties) == null ? void 0 : he.url) != null ? ve : "");
|
|
123
|
+
}, [d, t, s, r]);
|
|
124
|
+
const h = () => {
|
|
125
|
+
n.hideEditPopup();
|
|
126
|
+
}, C = () => {
|
|
127
|
+
if (v(!0), !p || !d)
|
|
108
128
|
return;
|
|
109
|
-
const
|
|
110
|
-
if (!
|
|
111
|
-
|
|
112
|
-
unitId:
|
|
113
|
-
payload:
|
|
129
|
+
const f = Kn(o);
|
|
130
|
+
if (!t)
|
|
131
|
+
i.executeCommand(Pe.id, {
|
|
132
|
+
unitId: d.getUnitId(),
|
|
133
|
+
payload: f
|
|
114
134
|
});
|
|
115
135
|
else {
|
|
116
|
-
if (!
|
|
136
|
+
if (!g)
|
|
117
137
|
return;
|
|
118
|
-
|
|
119
|
-
unitId:
|
|
120
|
-
payload:
|
|
121
|
-
linkId:
|
|
122
|
-
label,
|
|
123
|
-
segmentId:
|
|
138
|
+
i.executeCommand(Re.id, {
|
|
139
|
+
unitId: d.getUnitId(),
|
|
140
|
+
payload: f,
|
|
141
|
+
linkId: t.linkId,
|
|
142
|
+
label: g,
|
|
143
|
+
segmentId: t.segmentId
|
|
124
144
|
});
|
|
125
145
|
}
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
if (
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
146
|
+
n.hideEditPopup();
|
|
147
|
+
};
|
|
148
|
+
if (d)
|
|
149
|
+
return /* @__PURE__ */ a.jsxs("div", { className: A.docsLinkEdit, children: [
|
|
150
|
+
/* @__PURE__ */ a.jsxs("div", { children: [
|
|
151
|
+
t ? /* @__PURE__ */ a.jsx(
|
|
152
|
+
_e,
|
|
153
|
+
{
|
|
154
|
+
label: e.t("docLink.edit.label"),
|
|
155
|
+
error: u && !g ? e.t("docLink.edit.labelError") : "",
|
|
156
|
+
children: /* @__PURE__ */ a.jsx(
|
|
157
|
+
Ie,
|
|
158
|
+
{
|
|
159
|
+
value: g,
|
|
160
|
+
onChange: l,
|
|
161
|
+
autoFocus: !0,
|
|
162
|
+
onKeyDown: (f) => {
|
|
163
|
+
f.keyCode === te.ENTER && C();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
) : null,
|
|
169
|
+
/* @__PURE__ */ a.jsx(
|
|
170
|
+
_e,
|
|
171
|
+
{
|
|
172
|
+
label: e.t("docLink.edit.address"),
|
|
173
|
+
error: u && !p ? e.t("docLink.edit.addressError") : "",
|
|
174
|
+
children: /* @__PURE__ */ a.jsx(
|
|
175
|
+
Ie,
|
|
176
|
+
{
|
|
177
|
+
value: o,
|
|
178
|
+
onChange: c,
|
|
179
|
+
autoFocus: !0,
|
|
180
|
+
onKeyDown: (f) => {
|
|
181
|
+
f.keyCode === te.ENTER && C();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
] }),
|
|
188
|
+
/* @__PURE__ */ a.jsxs("div", { className: A.docsLinkEditButtons, children: [
|
|
189
|
+
/* @__PURE__ */ a.jsx(
|
|
190
|
+
Ce,
|
|
191
|
+
{
|
|
192
|
+
className: A.docsLinkEditButton,
|
|
193
|
+
onClick: h,
|
|
194
|
+
children: e.t("docLink.edit.cancel")
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
/* @__PURE__ */ a.jsx(
|
|
198
|
+
Ce,
|
|
199
|
+
{
|
|
200
|
+
disabled: !o,
|
|
201
|
+
className: A.docsLinkEditButton,
|
|
202
|
+
type: "primary",
|
|
203
|
+
onClick: C,
|
|
204
|
+
children: e.t("docLink.edit.confirm")
|
|
205
|
+
}
|
|
206
|
+
)
|
|
207
|
+
] })
|
|
208
|
+
] });
|
|
209
|
+
};
|
|
210
|
+
K.componentKey = "docs-hyper-link-edit";
|
|
211
|
+
var m = function() {
|
|
212
|
+
return m = Object.assign || function(n) {
|
|
213
|
+
for (var e, t = 1, i = arguments.length; t < i; t++) {
|
|
214
|
+
e = arguments[t];
|
|
215
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
|
|
187
216
|
}
|
|
188
|
-
return
|
|
189
|
-
},
|
|
190
|
-
},
|
|
217
|
+
return n;
|
|
218
|
+
}, m.apply(this, arguments);
|
|
219
|
+
}, Vn = function(n, e) {
|
|
191
220
|
var t = {};
|
|
192
|
-
for (var
|
|
193
|
-
if (
|
|
194
|
-
for (var
|
|
195
|
-
e.indexOf(
|
|
221
|
+
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
|
|
222
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
223
|
+
for (var r = 0, i = Object.getOwnPropertySymbols(n); r < i.length; r++)
|
|
224
|
+
e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[r]) && (t[i[r]] = n[i[r]]);
|
|
196
225
|
return t;
|
|
197
|
-
},
|
|
198
|
-
var
|
|
199
|
-
return
|
|
226
|
+
}, $ = N(function(n, e) {
|
|
227
|
+
var t = n.icon, i = n.id, r = n.className, s = n.extend, o = Vn(n, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), g = hn("_".concat(Gn()));
|
|
228
|
+
return Ee(t, "".concat(i), { defIds: t.defIds, idSuffix: g.current }, m({ ref: e, className: c }, o), s);
|
|
200
229
|
});
|
|
201
|
-
function
|
|
202
|
-
return
|
|
203
|
-
return
|
|
230
|
+
function Ee(n, e, t, i, r) {
|
|
231
|
+
return j(n.tag, m(m({ key: e }, Wn(n, t, r)), i), (Yn(n, t).children || []).map(function(s, o) {
|
|
232
|
+
return Ee(s, "".concat(e, "-").concat(n.tag, "-").concat(o), t, void 0, r);
|
|
204
233
|
}));
|
|
205
234
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
})), attrs;
|
|
235
|
+
function Wn(n, e, t) {
|
|
236
|
+
var i = m({}, n.attrs);
|
|
237
|
+
t != null && t.colorChannel1 && i.fill === "colorChannel1" && (i.fill = t.colorChannel1);
|
|
238
|
+
var r = e.defIds;
|
|
239
|
+
return !r || r.length === 0 || (n.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(function(s) {
|
|
240
|
+
var o = s[0], c = s[1];
|
|
241
|
+
typeof c == "string" && (i[o] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
242
|
+
})), i;
|
|
215
243
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}) }) : node;
|
|
244
|
+
function Yn(n, e) {
|
|
245
|
+
var t, i = e.defIds;
|
|
246
|
+
return !i || i.length === 0 ? n : n.tag === "defs" && (!((t = n.children) === null || t === void 0) && t.length) ? m(m({}, n), { children: n.children.map(function(r) {
|
|
247
|
+
return typeof r.attrs.id == "string" && i && i.indexOf(r.attrs.id) > -1 ? m(m({}, r), { attrs: m(m({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
248
|
+
}) }) : n;
|
|
222
249
|
}
|
|
223
|
-
|
|
224
|
-
function generateShortUuid() {
|
|
250
|
+
function Gn() {
|
|
225
251
|
return Math.random().toString(36).substring(2, 8);
|
|
226
252
|
}
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
253
|
+
$.displayName = "UniverIcon";
|
|
254
|
+
var Zn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, be = N(function(n, e) {
|
|
255
|
+
return j($, Object.assign({}, n, {
|
|
231
256
|
id: "copy-single",
|
|
232
|
-
ref,
|
|
233
|
-
icon:
|
|
257
|
+
ref: e,
|
|
258
|
+
icon: Zn
|
|
234
259
|
}));
|
|
235
260
|
});
|
|
236
|
-
|
|
237
|
-
var
|
|
238
|
-
return
|
|
261
|
+
be.displayName = "CopySingle";
|
|
262
|
+
var zn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.9564 2.91332C4.91407 1.87102 3.22413 1.87101 2.18182 2.91333L2.18182 2.91333C1.13953 3.95567 1.13952 5.6456 2.18182 6.68791L8.27777 12.7838C9.72408 14.2302 12.069 14.2302 13.5154 12.7839L13.0911 12.3596L13.5154 12.7839C14.9617 11.3375 14.9617 8.99257 13.5154 7.54626L8.39476 2.42566C8.16044 2.19134 7.78054 2.19134 7.54623 2.42566C7.31191 2.65997 7.31191 3.03987 7.54623 3.27419L12.6668 8.39479L13.0911 7.97052L12.6668 8.39479C13.6445 9.37247 13.6445 10.9576 12.6668 11.9353L13.0399 12.3084L12.6668 11.9353C11.6891 12.913 10.104 12.913 9.1263 11.9353L3.03035 5.83938C2.45668 5.26571 2.45667 4.33556 3.03036 3.76184C3.60403 3.18818 4.53416 3.18817 5.10788 3.76185C5.10788 3.76186 5.10788 3.76186 5.10789 3.76186L11.2038 9.8578L11.601 9.46061L11.2038 9.8578C11.3735 10.0275 11.3735 10.3026 11.2038 10.4723L11.2038 10.4723C11.0341 10.642 10.759 10.642 10.5893 10.4723L5.46874 5.35171C5.23442 5.1174 4.85452 5.1174 4.62021 5.35171C4.38589 5.58602 4.38589 5.96592 4.62021 6.20024L9.74078 11.3208C10.3791 11.9591 11.414 11.9591 12.0523 11.3208C12.0523 11.3208 12.0523 11.3208 12.0523 11.3208M12.0523 11.3208C12.6907 10.6825 12.6906 9.64757 12.0523 9.00927L5.95641 2.91333L5.9564 2.91332", fillRule: "evenodd", clipRule: "evenodd" } }] }, se = N(function(n, e) {
|
|
263
|
+
return j($, Object.assign({}, n, {
|
|
239
264
|
id: "link-single",
|
|
240
|
-
ref,
|
|
241
|
-
icon:
|
|
265
|
+
ref: e,
|
|
266
|
+
icon: zn
|
|
242
267
|
}));
|
|
243
268
|
});
|
|
244
|
-
|
|
245
|
-
var
|
|
246
|
-
return
|
|
269
|
+
se.displayName = "LinkSingle";
|
|
270
|
+
var qn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 17", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.5935 3.47302C11.6354 2.51492 10.082 2.51492 9.12388 3.47302L7.83534 4.76157C7.60102 4.99588 7.22112 4.99588 6.98681 4.76157 6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449 14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797 11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302zM3.40637 12.6606C2.44827 11.7025 2.44827 10.1491 3.40637 9.19102L4.69492 7.90248C4.92923 7.66816 4.92923 7.28826 4.69492 7.05395 4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092 3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721 8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606zM3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332 2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302 13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332z" } }] }, Me = N(function(n, e) {
|
|
271
|
+
return j($, Object.assign({}, n, {
|
|
247
272
|
id: "unlink-single",
|
|
248
|
-
ref,
|
|
249
|
-
icon:
|
|
273
|
+
ref: e,
|
|
274
|
+
icon: qn
|
|
250
275
|
}));
|
|
251
276
|
});
|
|
252
|
-
|
|
253
|
-
var
|
|
254
|
-
return
|
|
277
|
+
Me.displayName = "UnlinkSingle";
|
|
278
|
+
var Jn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 17 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6551 1.98906C11.7476 1.08113 10.2757 1.08149 9.3686 1.98987L4.82542 6.53955C4.75087 6.61421 4.69336 6.70411 4.65682 6.80309L3.2461 10.625C3.16506 10.8446 3.21909 11.0912 3.3845 11.2568C3.54991 11.4224 3.79651 11.4767 4.01616 11.3959L7.85031 9.98517C7.94979 9.94856 8.04014 9.89077 8.11508 9.81579L12.6552 5.27327C13.5618 4.36621 13.5618 2.89607 12.6551 1.98906ZM10.2177 2.83779C10.6562 2.39869 11.3677 2.39851 11.8064 2.8374C12.2447 3.27584 12.2447 3.9865 11.8065 4.42497L7.3392 8.89457L4.82213 9.82068L5.74706 7.31487L10.2177 2.83779Z", fillRule: "evenodd", clipRule: "evenodd" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.79238 13.2999C1.46101 13.2999 1.19238 13.5685 1.19238 13.8999C1.19238 14.2313 1.46101 14.4999 1.79238 14.4999H14.4924C14.8238 14.4999 15.0924 14.2313 15.0924 13.8999C15.0924 13.5685 14.8238 13.2999 14.4924 13.2999H1.79238Z" } }] }, we = N(function(n, e) {
|
|
279
|
+
return j($, Object.assign({}, n, {
|
|
255
280
|
id: "write-single",
|
|
256
|
-
ref,
|
|
257
|
-
icon:
|
|
281
|
+
ref: e,
|
|
282
|
+
icon: Jn
|
|
258
283
|
}));
|
|
259
284
|
});
|
|
260
|
-
|
|
261
|
-
function
|
|
262
|
-
var
|
|
263
|
-
if (typeof
|
|
264
|
-
else if (typeof
|
|
265
|
-
var
|
|
266
|
-
for (
|
|
267
|
-
} else for (
|
|
268
|
-
return
|
|
285
|
+
we.displayName = "WriteSingle";
|
|
286
|
+
function De(n) {
|
|
287
|
+
var e, t, i = "";
|
|
288
|
+
if (typeof n == "string" || typeof n == "number") i += n;
|
|
289
|
+
else if (typeof n == "object") if (Array.isArray(n)) {
|
|
290
|
+
var r = n.length;
|
|
291
|
+
for (e = 0; e < r; e++) n[e] && (t = De(n[e])) && (i && (i += " "), i += t);
|
|
292
|
+
} else for (t in n) n[t] && (i && (i += " "), i += t);
|
|
293
|
+
return i;
|
|
269
294
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
return n;
|
|
295
|
+
function Le() {
|
|
296
|
+
for (var n, e, t = 0, i = "", r = arguments.length; t < r; t++) (n = arguments[t]) && (e = De(n)) && (i && (i += " "), i += e);
|
|
297
|
+
return i;
|
|
274
298
|
}
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
type: CommandType.COMMAND,
|
|
299
|
+
const Ne = {
|
|
300
|
+
type: E.COMMAND,
|
|
278
301
|
id: "docs.command.delete-hyper-link",
|
|
279
|
-
async handler(
|
|
280
|
-
if (!
|
|
302
|
+
async handler(n, e) {
|
|
303
|
+
if (!e)
|
|
281
304
|
return !1;
|
|
282
|
-
const { unitId, linkId, segmentId } =
|
|
283
|
-
return
|
|
305
|
+
const { unitId: t, linkId: i, segmentId: r } = e, s = n.get(x), o = Xe(n, { unitId: t, rangeId: i, segmentId: r });
|
|
306
|
+
return o ? await s.syncExecuteCommand(o.id, o.params) : !1;
|
|
284
307
|
}
|
|
285
|
-
},
|
|
286
|
-
var
|
|
287
|
-
const
|
|
288
|
-
if (!
|
|
308
|
+
}, je = (n) => {
|
|
309
|
+
var l;
|
|
310
|
+
const e = n.get(M), t = n.get(O), i = e.getDocRanges();
|
|
311
|
+
if (!i.length || i.length > 1)
|
|
289
312
|
return !0;
|
|
290
|
-
const
|
|
291
|
-
if (!
|
|
313
|
+
const r = i[0], s = t.getCurrentUnitForType(I.UNIVER_DOC);
|
|
314
|
+
if (!s || !r || r.collapsed)
|
|
292
315
|
return !0;
|
|
293
|
-
const
|
|
294
|
-
if (!
|
|
316
|
+
const o = s.getSelfOrHeaderFooterModel(r.segmentId).getBody(), c = o == null ? void 0 : o.paragraphs;
|
|
317
|
+
if (!c)
|
|
295
318
|
return !0;
|
|
296
|
-
for (let
|
|
297
|
-
const p =
|
|
298
|
-
if (
|
|
319
|
+
for (let u = 0, v = c.length; u < v; u++) {
|
|
320
|
+
const p = c[u];
|
|
321
|
+
if (r.startOffset <= p.startIndex && r.endOffset > p.startIndex)
|
|
299
322
|
return !0;
|
|
300
|
-
if (p.startIndex >
|
|
323
|
+
if (p.startIndex > r.endOffset)
|
|
301
324
|
break;
|
|
302
325
|
}
|
|
303
|
-
return !
|
|
304
|
-
},
|
|
305
|
-
type:
|
|
326
|
+
return !ne.customRange.getCustomRangesInterestsWithSelection(r, (l = o.customRanges) != null ? l : []).every((u) => u.rangeType === b.HYPERLINK);
|
|
327
|
+
}, R = {
|
|
328
|
+
type: E.OPERATION,
|
|
306
329
|
id: "doc.operation.show-hyper-link-edit-popup",
|
|
307
|
-
handler(
|
|
308
|
-
var
|
|
309
|
-
const
|
|
310
|
-
if (
|
|
330
|
+
handler(n, e) {
|
|
331
|
+
var o;
|
|
332
|
+
const t = e == null ? void 0 : e.link, i = n.get(O);
|
|
333
|
+
if (je(n) && !t)
|
|
311
334
|
return !1;
|
|
312
|
-
const
|
|
313
|
-
return
|
|
335
|
+
const r = n.get(S), s = (t == null ? void 0 : t.unitId) || ((o = i.getCurrentUnitForType(I.UNIVER_DOC)) == null ? void 0 : o.getUnitId());
|
|
336
|
+
return s ? (r.showEditPopup(s, t), !0) : !1;
|
|
314
337
|
}
|
|
315
|
-
},
|
|
316
|
-
type:
|
|
338
|
+
}, ie = {
|
|
339
|
+
type: E.OPERATION,
|
|
317
340
|
id: "doc.operation.toggle-hyper-link-info-popup",
|
|
318
|
-
handler(
|
|
319
|
-
const
|
|
320
|
-
return
|
|
341
|
+
handler(n, e) {
|
|
342
|
+
const t = n.get(S);
|
|
343
|
+
return e ? (t.showInfoPopup(e), !0) : (t.hideInfoPopup(), !0);
|
|
321
344
|
}
|
|
322
|
-
},
|
|
323
|
-
type:
|
|
345
|
+
}, $e = {
|
|
346
|
+
type: E.OPERATION,
|
|
324
347
|
id: "doc.operation.click-hyper-link",
|
|
325
|
-
handler(
|
|
326
|
-
var
|
|
327
|
-
if (!
|
|
348
|
+
handler(n, e) {
|
|
349
|
+
var l, u, v;
|
|
350
|
+
if (!e)
|
|
328
351
|
return !1;
|
|
329
|
-
const { unitId, linkId, segmentId } =
|
|
330
|
-
return
|
|
331
|
-
}
|
|
332
|
-
},
|
|
333
|
-
docLink,
|
|
334
|
-
docLinkType,
|
|
335
|
-
docLinkContent,
|
|
336
|
-
docLinkContentError,
|
|
337
|
-
docLinkUrl,
|
|
338
|
-
docLinkOperations,
|
|
339
|
-
docLinkOperation,
|
|
340
|
-
docLinkOperationError
|
|
341
|
-
},
|
|
342
|
-
var
|
|
343
|
-
const
|
|
344
|
-
if (!
|
|
352
|
+
const { unitId: t, linkId: i, segmentId: r } = e, o = n.get(O).getUnit(t, I.UNIVER_DOC), c = o == null ? void 0 : o.getSelfOrHeaderFooterModel(r).getBody(), g = (v = (u = (l = c == null ? void 0 : c.customRanges) == null ? void 0 : l.find((p) => p.rangeId === i && p.rangeType === b.HYPERLINK)) == null ? void 0 : u.properties) == null ? void 0 : v.url;
|
|
353
|
+
return g && window.open(g, "_blank", "noopener noreferrer"), !0;
|
|
354
|
+
}
|
|
355
|
+
}, Qn = "univer-doc-link", Xn = "univer-doc-link-type", et = "univer-doc-link-content", nt = "univer-doc-link-content-error", tt = "univer-doc-link-url", it = "univer-doc-link-operations", rt = "univer-doc-link-operation", ot = "univer-doc-link-operation-error", k = {
|
|
356
|
+
docLink: Qn,
|
|
357
|
+
docLinkType: Xn,
|
|
358
|
+
docLinkContent: et,
|
|
359
|
+
docLinkContentError: nt,
|
|
360
|
+
docLinkUrl: tt,
|
|
361
|
+
docLinkOperations: it,
|
|
362
|
+
docLinkOperation: rt,
|
|
363
|
+
docLinkOperationError: ot
|
|
364
|
+
}, V = () => {
|
|
365
|
+
var C, f;
|
|
366
|
+
const n = L(S), e = L(x), t = L(mn), i = L(ke), r = _n(n.showingLink$), s = L(O);
|
|
367
|
+
if (!r)
|
|
345
368
|
return null;
|
|
346
|
-
const { unitId, linkId, segmentId } =
|
|
347
|
-
if (!
|
|
369
|
+
const { unitId: o, linkId: c, segmentId: g, startIndex: l, endIndex: u } = r, v = s.getUnit(o, I.UNIVER_DOC), p = v == null ? void 0 : v.getSelfOrHeaderFooterModel(g).getBody(), d = (C = p == null ? void 0 : p.customRanges) == null ? void 0 : C.find((y) => y.rangeId === c && y.rangeType === b.HYPERLINK && y.startIndex === l && y.endIndex === u);
|
|
370
|
+
if (!d)
|
|
348
371
|
return null;
|
|
349
|
-
const
|
|
350
|
-
return /* @__PURE__ */
|
|
372
|
+
const h = (f = d.properties) == null ? void 0 : f.url;
|
|
373
|
+
return /* @__PURE__ */ a.jsxs(
|
|
351
374
|
"div",
|
|
352
375
|
{
|
|
353
|
-
className:
|
|
354
|
-
onClick:
|
|
355
|
-
|
|
356
|
-
}, "onClick")
|
|
357
|
-
},
|
|
358
|
-
/* @__PURE__ */ React.createElement("div", { className: clsx(styles.docLinkContent), onClick: /* @__PURE__ */ __name(() => window.open(url), "onClick") }, /* @__PURE__ */ React.createElement("div", { className: styles.docLinkType }, /* @__PURE__ */ React.createElement(LinkSingle, null)), /* @__PURE__ */ React.createElement(Tooltip, { showIfEllipsis: !0, title: url }, /* @__PURE__ */ React.createElement("span", { className: styles.docLinkUrl }, url))),
|
|
359
|
-
/* @__PURE__ */ React.createElement("div", { className: styles.docLinkOperations }, /* @__PURE__ */ React.createElement(
|
|
360
|
-
"div",
|
|
361
|
-
{
|
|
362
|
-
className: clsx(styles.docLinkOperation),
|
|
363
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
364
|
-
navigator.clipboard.writeText(url), messageService.show({
|
|
365
|
-
content: localeService.t("docLink.info.coped"),
|
|
366
|
-
type: MessageType.Info
|
|
367
|
-
});
|
|
368
|
-
}, "onClick")
|
|
369
|
-
},
|
|
370
|
-
/* @__PURE__ */ React.createElement(Tooltip, { placement: "bottom", title: localeService.t("docLink.info.copy") }, /* @__PURE__ */ React.createElement(CopySingle, null))
|
|
371
|
-
), /* @__PURE__ */ React.createElement(
|
|
372
|
-
"div",
|
|
373
|
-
{
|
|
374
|
-
className: styles.docLinkOperation,
|
|
375
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
376
|
-
commandService.executeCommand(ShowDocHyperLinkEditPopupOperation.id, {
|
|
377
|
-
link: currentPopup
|
|
378
|
-
});
|
|
379
|
-
}, "onClick")
|
|
380
|
-
},
|
|
381
|
-
/* @__PURE__ */ React.createElement(Tooltip, { placement: "bottom", title: localeService.t("docLink.info.edit") }, /* @__PURE__ */ React.createElement(WriteSingle, null))
|
|
382
|
-
), /* @__PURE__ */ React.createElement(
|
|
383
|
-
"div",
|
|
384
|
-
{
|
|
385
|
-
className: styles.docLinkOperation,
|
|
386
|
-
onClick: /* @__PURE__ */ __name(() => {
|
|
387
|
-
commandService.executeCommand(DeleteDocHyperLinkCommand.id, {
|
|
388
|
-
unitId,
|
|
389
|
-
linkId: link.rangeId,
|
|
390
|
-
segmentId
|
|
391
|
-
});
|
|
392
|
-
}, "onClick")
|
|
376
|
+
className: k.docLink,
|
|
377
|
+
onClick: () => {
|
|
378
|
+
n.hideInfoPopup();
|
|
393
379
|
},
|
|
394
|
-
|
|
395
|
-
|
|
380
|
+
children: [
|
|
381
|
+
/* @__PURE__ */ a.jsxs("div", { className: Le(k.docLinkContent), onClick: () => window.open(h), children: [
|
|
382
|
+
/* @__PURE__ */ a.jsx("div", { className: k.docLinkType, children: /* @__PURE__ */ a.jsx(se, {}) }),
|
|
383
|
+
/* @__PURE__ */ a.jsx(B, { showIfEllipsis: !0, title: h, children: /* @__PURE__ */ a.jsx("span", { className: k.docLinkUrl, children: h }) })
|
|
384
|
+
] }),
|
|
385
|
+
/* @__PURE__ */ a.jsxs("div", { className: k.docLinkOperations, children: [
|
|
386
|
+
/* @__PURE__ */ a.jsx(
|
|
387
|
+
"div",
|
|
388
|
+
{
|
|
389
|
+
className: Le(k.docLinkOperation),
|
|
390
|
+
onClick: () => {
|
|
391
|
+
navigator.clipboard.writeText(h), t.show({
|
|
392
|
+
content: i.t("docLink.info.coped"),
|
|
393
|
+
type: vn.Info
|
|
394
|
+
});
|
|
395
|
+
},
|
|
396
|
+
children: /* @__PURE__ */ a.jsx(B, { placement: "bottom", title: i.t("docLink.info.copy"), children: /* @__PURE__ */ a.jsx(be, {}) })
|
|
397
|
+
}
|
|
398
|
+
),
|
|
399
|
+
/* @__PURE__ */ a.jsx(
|
|
400
|
+
"div",
|
|
401
|
+
{
|
|
402
|
+
className: k.docLinkOperation,
|
|
403
|
+
onClick: () => {
|
|
404
|
+
e.executeCommand(R.id, {
|
|
405
|
+
link: r
|
|
406
|
+
});
|
|
407
|
+
},
|
|
408
|
+
children: /* @__PURE__ */ a.jsx(B, { placement: "bottom", title: i.t("docLink.info.edit"), children: /* @__PURE__ */ a.jsx(we, {}) })
|
|
409
|
+
}
|
|
410
|
+
),
|
|
411
|
+
/* @__PURE__ */ a.jsx(
|
|
412
|
+
"div",
|
|
413
|
+
{
|
|
414
|
+
className: k.docLinkOperation,
|
|
415
|
+
onClick: () => {
|
|
416
|
+
e.executeCommand(Ne.id, {
|
|
417
|
+
unitId: o,
|
|
418
|
+
linkId: d.rangeId,
|
|
419
|
+
segmentId: g
|
|
420
|
+
});
|
|
421
|
+
},
|
|
422
|
+
children: /* @__PURE__ */ a.jsx(B, { placement: "bottom", title: i.t("docLink.info.cancel"), children: /* @__PURE__ */ a.jsx(Me, {}) })
|
|
423
|
+
}
|
|
424
|
+
)
|
|
425
|
+
] })
|
|
426
|
+
]
|
|
427
|
+
}
|
|
396
428
|
);
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
var
|
|
400
|
-
for (var
|
|
401
|
-
(
|
|
402
|
-
return
|
|
403
|
-
},
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
let DocHyperLinkPopupService = (_a = class extends Disposable {
|
|
407
|
-
constructor(_docCanvasPopupManagerService, _textSelectionManagerService, _univerInstanceService) {
|
|
429
|
+
};
|
|
430
|
+
V.componentKey = "univer.doc.link-info-popup";
|
|
431
|
+
var st = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, dt = (n, e, t, i) => {
|
|
432
|
+
for (var r = i > 1 ? void 0 : i ? ct(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
433
|
+
(o = n[s]) && (r = (i ? o(e, t, r) : o(r)) || r);
|
|
434
|
+
return i && r && st(e, t, r), r;
|
|
435
|
+
}, J = (n, e) => (t, i) => e(t, i, n);
|
|
436
|
+
let S = class extends D {
|
|
437
|
+
constructor(e, t, i) {
|
|
408
438
|
super();
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
this._docCanvasPopupManagerService =
|
|
439
|
+
P(this, "_editingLink$", new me(null));
|
|
440
|
+
P(this, "_showingLink$", new me(null));
|
|
441
|
+
P(this, "editingLink$", this._editingLink$.asObservable());
|
|
442
|
+
P(this, "showingLink$", this._showingLink$.asObservable());
|
|
443
|
+
P(this, "_editPopup", null);
|
|
444
|
+
P(this, "_infoPopup", null);
|
|
445
|
+
this._docCanvasPopupManagerService = e, this._textSelectionManagerService = t, this._univerInstanceService = i, this.disposeWithMe(() => {
|
|
416
446
|
this._editingLink$.complete(), this._showingLink$.complete();
|
|
417
447
|
});
|
|
418
448
|
}
|
|
@@ -422,101 +452,93 @@ let DocHyperLinkPopupService = (_a = class extends Disposable {
|
|
|
422
452
|
get showing() {
|
|
423
453
|
return this._showingLink$.value;
|
|
424
454
|
}
|
|
425
|
-
showEditPopup(
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
range && (activeRange = {
|
|
455
|
+
showEditPopup(e, t) {
|
|
456
|
+
this._editPopup && this._editPopup.dispose(), this._editingLink$.next(t);
|
|
457
|
+
let i = this._textSelectionManagerService.getActiveTextRange();
|
|
458
|
+
if (t) {
|
|
459
|
+
const { segmentId: r, segmentPage: s, startIndex: o, endIndex: c } = t;
|
|
460
|
+
i = {
|
|
432
461
|
collapsed: !1,
|
|
433
|
-
startOffset:
|
|
434
|
-
endOffset:
|
|
435
|
-
segmentId,
|
|
436
|
-
segmentPage
|
|
437
|
-
}, this._textSelectionManagerService.
|
|
438
|
-
startOffset:
|
|
439
|
-
endOffset:
|
|
440
|
-
}])
|
|
462
|
+
startOffset: o,
|
|
463
|
+
endOffset: c + 1,
|
|
464
|
+
segmentId: r,
|
|
465
|
+
segmentPage: s
|
|
466
|
+
}, this._textSelectionManagerService.replaceDocRanges([{
|
|
467
|
+
startOffset: o,
|
|
468
|
+
endOffset: c + 1
|
|
469
|
+
}]);
|
|
441
470
|
}
|
|
442
|
-
return
|
|
443
|
-
|
|
471
|
+
return i ? (this._editPopup = this._docCanvasPopupManagerService.attachPopupToRange(
|
|
472
|
+
i,
|
|
444
473
|
{
|
|
445
|
-
componentKey:
|
|
474
|
+
componentKey: K.componentKey,
|
|
446
475
|
direction: "bottom"
|
|
447
476
|
},
|
|
448
|
-
|
|
477
|
+
e
|
|
449
478
|
), this._editPopup) : null;
|
|
450
479
|
}
|
|
451
480
|
hideEditPopup() {
|
|
452
|
-
var
|
|
453
|
-
this._editingLink$.next(null), (
|
|
454
|
-
}
|
|
455
|
-
showInfoPopup(
|
|
456
|
-
var
|
|
457
|
-
const { linkId, unitId, segmentId, segmentPage } =
|
|
458
|
-
if (((
|
|
459
|
-
return
|
|
460
|
-
this._infoPopup && this._infoPopup.dispose();
|
|
461
|
-
const doc = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_DOC);
|
|
462
|
-
if (!doc)
|
|
463
|
-
return;
|
|
464
|
-
const range = (_f = (_e = doc.getSelfOrHeaderFooterModel(info.segmentId).getBody()) == null ? void 0 : _e.customRanges) == null ? void 0 : _f.find((i) => i.rangeId === linkId);
|
|
465
|
-
if (this._showingLink$.next({ unitId, linkId, segmentId, segmentPage }), !!range)
|
|
466
|
-
return this._infoPopup = this._docCanvasPopupManagerService.attachPopupToRange(
|
|
481
|
+
var e;
|
|
482
|
+
this._editingLink$.next(null), (e = this._editPopup) == null || e.dispose();
|
|
483
|
+
}
|
|
484
|
+
showInfoPopup(e) {
|
|
485
|
+
var l, u, v, p, d, h;
|
|
486
|
+
const { linkId: t, unitId: i, segmentId: r, segmentPage: s, startIndex: o, endIndex: c } = e;
|
|
487
|
+
if (!(((l = this.showing) == null ? void 0 : l.linkId) === t && ((u = this.showing) == null ? void 0 : u.unitId) === i && ((v = this.showing) == null ? void 0 : v.segmentId) === r && ((p = this.showing) == null ? void 0 : p.segmentPage) === s && ((d = this.showing) == null ? void 0 : d.startIndex) === o && ((h = this.showing) == null ? void 0 : h.endIndex) === c || (this._infoPopup && this._infoPopup.dispose(), !this._univerInstanceService.getUnit(i, I.UNIVER_DOC))))
|
|
488
|
+
return this._showingLink$.next({ unitId: i, linkId: t, segmentId: r, segmentPage: s, startIndex: o, endIndex: c }), this._infoPopup = this._docCanvasPopupManagerService.attachPopupToRange(
|
|
467
489
|
{
|
|
468
490
|
collapsed: !1,
|
|
469
|
-
startOffset:
|
|
470
|
-
endOffset:
|
|
471
|
-
segmentId:
|
|
472
|
-
segmentPage:
|
|
491
|
+
startOffset: o,
|
|
492
|
+
endOffset: c + 1,
|
|
493
|
+
segmentId: r,
|
|
494
|
+
segmentPage: s
|
|
473
495
|
},
|
|
474
496
|
{
|
|
475
|
-
componentKey:
|
|
497
|
+
componentKey: V.componentKey,
|
|
476
498
|
direction: "top-center",
|
|
477
499
|
multipleDirection: "top",
|
|
478
|
-
onClickOutside:
|
|
500
|
+
onClickOutside: () => {
|
|
479
501
|
this.hideInfoPopup();
|
|
480
|
-
}
|
|
502
|
+
}
|
|
481
503
|
},
|
|
482
|
-
|
|
504
|
+
i
|
|
483
505
|
), this._infoPopup;
|
|
484
506
|
}
|
|
485
507
|
hideInfoPopup() {
|
|
486
|
-
var
|
|
487
|
-
this._showingLink$.next(null), (
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
],
|
|
495
|
-
var
|
|
496
|
-
for (var
|
|
497
|
-
(
|
|
498
|
-
return
|
|
499
|
-
},
|
|
500
|
-
let
|
|
501
|
-
constructor(
|
|
502
|
-
super(), this._commandService =
|
|
508
|
+
var e;
|
|
509
|
+
this._showingLink$.next(null), (e = this._infoPopup) == null || e.dispose();
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
S = dt([
|
|
513
|
+
J(0, _(on)),
|
|
514
|
+
J(1, _(M)),
|
|
515
|
+
J(2, O)
|
|
516
|
+
], S);
|
|
517
|
+
var at = Object.defineProperty, lt = Object.getOwnPropertyDescriptor, ut = (n, e, t, i) => {
|
|
518
|
+
for (var r = i > 1 ? void 0 : i ? lt(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
519
|
+
(o = n[s]) && (r = (i ? o(e, t, r) : o(r)) || r);
|
|
520
|
+
return i && r && at(e, t, r), r;
|
|
521
|
+
}, Q = (n, e) => (t, i) => e(t, i, n);
|
|
522
|
+
let W = class extends D {
|
|
523
|
+
constructor(n, e, t) {
|
|
524
|
+
super(), this._commandService = n, this._univerInstanceService = e, this._docHyperLinkService = t, this._initSelectionChange();
|
|
503
525
|
}
|
|
504
526
|
_initSelectionChange() {
|
|
505
527
|
this.disposeWithMe(
|
|
506
|
-
this._commandService.onCommandExecuted((
|
|
507
|
-
var
|
|
508
|
-
if (
|
|
509
|
-
const
|
|
510
|
-
if (
|
|
511
|
-
const { startOffset, endOffset, collapsed, segmentPage } =
|
|
512
|
-
if (
|
|
513
|
-
const
|
|
514
|
-
if (
|
|
515
|
-
const
|
|
516
|
-
this._docHyperLinkService.showInfoPopup({ unitId, linkId:
|
|
528
|
+
this._commandService.onCommandExecuted((n) => {
|
|
529
|
+
var e, t, i;
|
|
530
|
+
if (n.id === en.id) {
|
|
531
|
+
const r = n.params, { unitId: s, ranges: o, segmentId: c } = r, g = this._univerInstanceService.getUnit(s, I.UNIVER_DOC), l = o[0];
|
|
532
|
+
if (l && g) {
|
|
533
|
+
const { startOffset: u, endOffset: v, collapsed: p, segmentPage: d } = l, h = (t = (e = g.getSelfOrHeaderFooterModel(c)) == null ? void 0 : e.getBody()) == null ? void 0 : t.customRanges;
|
|
534
|
+
if (p) {
|
|
535
|
+
const C = (i = h == null ? void 0 : h.findIndex((f) => f.startIndex < u && f.endIndex > v - 1)) != null ? i : -1;
|
|
536
|
+
if (C > -1) {
|
|
537
|
+
const f = h[C];
|
|
538
|
+
this._docHyperLinkService.showInfoPopup({ unitId: s, linkId: f.rangeId, segmentId: c, segmentPage: d, startIndex: f.startIndex, endIndex: f.endIndex });
|
|
517
539
|
return;
|
|
518
540
|
}
|
|
519
|
-
} else if (
|
|
541
|
+
} else if (h == null ? void 0 : h.find((f) => f.startIndex <= u && f.endIndex >= v - 1))
|
|
520
542
|
return;
|
|
521
543
|
}
|
|
522
544
|
this._docHyperLinkService.hideInfoPopup(), this._docHyperLinkService.hideEditPopup();
|
|
@@ -524,46 +546,48 @@ let DocHyperLinkSelectionController = (_a2 = class extends Disposable {
|
|
|
524
546
|
})
|
|
525
547
|
);
|
|
526
548
|
}
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
],
|
|
533
|
-
var
|
|
534
|
-
for (var
|
|
535
|
-
(
|
|
536
|
-
return
|
|
537
|
-
},
|
|
538
|
-
let
|
|
539
|
-
constructor(
|
|
540
|
-
super(), this._context =
|
|
549
|
+
};
|
|
550
|
+
W = ut([
|
|
551
|
+
Q(0, x),
|
|
552
|
+
Q(1, O),
|
|
553
|
+
Q(2, _(S))
|
|
554
|
+
], W);
|
|
555
|
+
var pt = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, gt = (n, e, t, i) => {
|
|
556
|
+
for (var r = i > 1 ? void 0 : i ? ft(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
557
|
+
(o = n[s]) && (r = (i ? o(e, t, r) : o(r)) || r);
|
|
558
|
+
return i && r && pt(e, t, r), r;
|
|
559
|
+
}, w = (n, e) => (t, i) => e(t, i, n);
|
|
560
|
+
let re = class extends D {
|
|
561
|
+
constructor(n, e, t, i, r, s) {
|
|
562
|
+
super(), this._context = n, this._docEventManagerService = e, this._commandService = t, this._hyperLinkPopupService = i, this._docSkeletonManagerService = r, this._docSelectionManagerService = s, this._initHover(), this._initClick();
|
|
541
563
|
}
|
|
542
564
|
get _skeleton() {
|
|
543
565
|
return this._docSkeletonManagerService.getSkeleton();
|
|
544
566
|
}
|
|
545
567
|
_hideInfoPopup() {
|
|
546
568
|
this._hyperLinkPopupService.showing && this._commandService.executeCommand(
|
|
547
|
-
|
|
569
|
+
ie.id
|
|
548
570
|
);
|
|
549
571
|
}
|
|
550
572
|
_initHover() {
|
|
551
573
|
this.disposeWithMe(
|
|
552
|
-
this._docEventManagerService.hoverCustomRanges$.subscribe((
|
|
553
|
-
var
|
|
554
|
-
const
|
|
555
|
-
if (((
|
|
574
|
+
this._docEventManagerService.hoverCustomRanges$.subscribe((n) => {
|
|
575
|
+
var r;
|
|
576
|
+
const e = n.find((s) => s.range.rangeType === b.HYPERLINK), t = this._docSelectionManagerService.getTextRanges(), i = t == null ? void 0 : t[0].segmentId;
|
|
577
|
+
if (((r = e == null ? void 0 : e.segmentId) != null ? r : "") !== i) {
|
|
556
578
|
this._hideInfoPopup();
|
|
557
579
|
return;
|
|
558
580
|
}
|
|
559
|
-
|
|
560
|
-
|
|
581
|
+
e ? this._commandService.executeCommand(
|
|
582
|
+
ie.id,
|
|
561
583
|
{
|
|
562
584
|
unitId: this._context.unitId,
|
|
563
|
-
linkId:
|
|
564
|
-
segmentId:
|
|
565
|
-
segmentPage:
|
|
566
|
-
rangeId:
|
|
585
|
+
linkId: e.range.rangeId,
|
|
586
|
+
segmentId: e.segmentId,
|
|
587
|
+
segmentPage: e.segmentPageIndex,
|
|
588
|
+
rangeId: e.range.rangeId,
|
|
589
|
+
startIndex: e.range.startIndex,
|
|
590
|
+
endIndex: e.range.endIndex
|
|
567
591
|
}
|
|
568
592
|
) : this._hideInfoPopup();
|
|
569
593
|
})
|
|
@@ -571,193 +595,198 @@ let DocHyperLinkEventRenderController = (_a3 = class extends Disposable {
|
|
|
571
595
|
}
|
|
572
596
|
_initClick() {
|
|
573
597
|
this.disposeWithMe(
|
|
574
|
-
this._docEventManagerService.clickCustomRanges$.subscribe((
|
|
575
|
-
const
|
|
576
|
-
|
|
577
|
-
|
|
598
|
+
this._docEventManagerService.clickCustomRanges$.subscribe((n) => {
|
|
599
|
+
const e = n.range;
|
|
600
|
+
e && this._commandService.executeCommand(
|
|
601
|
+
$e.id,
|
|
578
602
|
{
|
|
579
603
|
unitId: this._context.unitId,
|
|
580
|
-
linkId:
|
|
581
|
-
segmentId:
|
|
604
|
+
linkId: e.rangeId,
|
|
605
|
+
segmentId: n.segmentId
|
|
582
606
|
}
|
|
583
607
|
);
|
|
584
608
|
})
|
|
585
609
|
);
|
|
586
610
|
}
|
|
587
|
-
}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
],
|
|
595
|
-
var
|
|
596
|
-
for (var
|
|
597
|
-
(
|
|
598
|
-
return
|
|
599
|
-
},
|
|
600
|
-
let
|
|
601
|
-
constructor(
|
|
602
|
-
super(), this._context =
|
|
611
|
+
};
|
|
612
|
+
re = gt([
|
|
613
|
+
w(1, _(sn)),
|
|
614
|
+
w(2, x),
|
|
615
|
+
w(3, _(S)),
|
|
616
|
+
w(4, _(nn)),
|
|
617
|
+
w(5, _(M))
|
|
618
|
+
], re);
|
|
619
|
+
var ht = Object.defineProperty, vt = Object.getOwnPropertyDescriptor, mt = (n, e, t, i) => {
|
|
620
|
+
for (var r = i > 1 ? void 0 : i ? vt(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
621
|
+
(o = n[s]) && (r = (i ? o(e, t, r) : o(r)) || r);
|
|
622
|
+
return i && r && ht(e, t, r), r;
|
|
623
|
+
}, X = (n, e) => (t, i) => e(t, i, n);
|
|
624
|
+
let oe = class extends D {
|
|
625
|
+
constructor(n, e, t, i) {
|
|
626
|
+
super(), this._context = n, this._docInterceptorService = e, this._hyperLinkService = t, this._docRenderController = i, this._init(), this._initReRender();
|
|
603
627
|
}
|
|
604
628
|
_init() {
|
|
605
|
-
this._docInterceptorService.intercept(
|
|
606
|
-
handler:
|
|
607
|
-
if (!
|
|
608
|
-
return
|
|
609
|
-
const { unitId
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
629
|
+
this._docInterceptorService.intercept(rn.CUSTOM_RANGE, {
|
|
630
|
+
handler: (n, e, t) => {
|
|
631
|
+
if (!n)
|
|
632
|
+
return t(n);
|
|
633
|
+
const { unitId: i, index: r } = e, s = this._hyperLinkService.showing;
|
|
634
|
+
if (!s)
|
|
635
|
+
return t({
|
|
636
|
+
...n,
|
|
637
|
+
active: !1
|
|
638
|
+
});
|
|
639
|
+
const { linkId: o, unitId: c, startIndex: g, endIndex: l } = s, u = c === i && n.rangeId === o && r >= g && r <= l;
|
|
640
|
+
return t({
|
|
641
|
+
...n,
|
|
642
|
+
active: u
|
|
613
643
|
});
|
|
614
|
-
}
|
|
644
|
+
}
|
|
615
645
|
});
|
|
616
646
|
}
|
|
617
647
|
_initReRender() {
|
|
618
648
|
this.disposeWithMe(this._hyperLinkService.showingLink$.pipe(
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
).subscribe(([
|
|
622
|
-
|
|
649
|
+
an((n, e) => (n == null ? void 0 : n.linkId) === (e == null ? void 0 : e.linkId) && (n == null ? void 0 : n.unitId) === (e == null ? void 0 : e.unitId) && (n == null ? void 0 : n.startIndex) === (e == null ? void 0 : e.startIndex)),
|
|
650
|
+
ln()
|
|
651
|
+
).subscribe(([n, e]) => {
|
|
652
|
+
e ? e.unitId === this._context.unitId && this._docRenderController.reRender(e.unitId) : n && n.unitId === this._context.unitId && this._docRenderController.reRender(n.unitId);
|
|
623
653
|
}));
|
|
624
654
|
}
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
],
|
|
631
|
-
const
|
|
632
|
-
function
|
|
655
|
+
};
|
|
656
|
+
oe = mt([
|
|
657
|
+
X(1, _(tn)),
|
|
658
|
+
X(2, _(S)),
|
|
659
|
+
X(3, _(cn))
|
|
660
|
+
], oe);
|
|
661
|
+
const Ue = "doc-hyper-link-icon";
|
|
662
|
+
function Se(n) {
|
|
633
663
|
return {
|
|
634
|
-
id:
|
|
635
|
-
type:
|
|
636
|
-
icon:
|
|
664
|
+
id: R.id,
|
|
665
|
+
type: Cn.BUTTON,
|
|
666
|
+
icon: Ue,
|
|
637
667
|
title: "docLink.menu.tooltip",
|
|
638
668
|
tooltip: "docLink.menu.tooltip",
|
|
639
|
-
hidden$:
|
|
640
|
-
disabled$: new
|
|
641
|
-
const
|
|
642
|
-
|
|
669
|
+
hidden$: Ln(n, I.UNIVER_DOC),
|
|
670
|
+
disabled$: new un(function(e) {
|
|
671
|
+
const i = n.get(M).textSelection$.pipe(pn(16)).subscribe(() => {
|
|
672
|
+
e.next(je(n));
|
|
643
673
|
});
|
|
644
674
|
return () => {
|
|
645
|
-
|
|
675
|
+
i.unsubscribe();
|
|
646
676
|
};
|
|
647
677
|
})
|
|
648
678
|
};
|
|
649
679
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
binding: MetaKeys.CTRL_COMMAND | KeyCode.K,
|
|
680
|
+
const _t = {
|
|
681
|
+
id: R.id,
|
|
682
|
+
binding: In.CTRL_COMMAND | te.K,
|
|
654
683
|
description: "docLink.menu.tooltip",
|
|
655
|
-
preconditions:
|
|
656
|
-
},
|
|
657
|
-
[
|
|
658
|
-
[
|
|
684
|
+
preconditions: dn
|
|
685
|
+
}, It = {
|
|
686
|
+
[Sn.OTHERS]: {
|
|
687
|
+
[R.id]: {
|
|
659
688
|
order: 0,
|
|
660
|
-
menuItemFactory:
|
|
689
|
+
menuItemFactory: Se
|
|
661
690
|
}
|
|
662
691
|
},
|
|
663
|
-
[
|
|
664
|
-
[
|
|
665
|
-
[
|
|
692
|
+
[yn.MAIN_AREA]: {
|
|
693
|
+
[kn.DATA]: {
|
|
694
|
+
[R.id]: {
|
|
666
695
|
order: 0,
|
|
667
|
-
menuItemFactory:
|
|
696
|
+
menuItemFactory: Se
|
|
668
697
|
}
|
|
669
698
|
}
|
|
670
699
|
}
|
|
671
700
|
};
|
|
672
|
-
var
|
|
673
|
-
for (var
|
|
674
|
-
(
|
|
675
|
-
return
|
|
676
|
-
},
|
|
677
|
-
let
|
|
678
|
-
constructor(
|
|
679
|
-
super(), this._componentManager =
|
|
701
|
+
var Ct = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, St = (n, e, t, i) => {
|
|
702
|
+
for (var r = i > 1 ? void 0 : i ? Lt(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
703
|
+
(o = n[s]) && (r = (i ? o(e, t, r) : o(r)) || r);
|
|
704
|
+
return i && r && Ct(e, t, r), r;
|
|
705
|
+
}, F = (n, e) => (t, i) => e(t, i, n);
|
|
706
|
+
let Y = class extends D {
|
|
707
|
+
constructor(n, e, t, i) {
|
|
708
|
+
super(), this._componentManager = n, this._commandService = e, this._menuManagerService = t, this._shortcutService = i, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortcut();
|
|
680
709
|
}
|
|
681
710
|
_initComponents() {
|
|
682
711
|
[
|
|
683
|
-
[
|
|
684
|
-
[
|
|
685
|
-
[
|
|
686
|
-
].forEach(([
|
|
687
|
-
this._componentManager.register(
|
|
712
|
+
[K, K.componentKey],
|
|
713
|
+
[V, V.componentKey],
|
|
714
|
+
[se, Ue]
|
|
715
|
+
].forEach(([n, e]) => {
|
|
716
|
+
this._componentManager.register(e, n);
|
|
688
717
|
});
|
|
689
718
|
}
|
|
690
719
|
_initCommands() {
|
|
691
720
|
[
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
].forEach((
|
|
699
|
-
this._commandService.registerCommand(
|
|
721
|
+
Pe,
|
|
722
|
+
Re,
|
|
723
|
+
Ne,
|
|
724
|
+
R,
|
|
725
|
+
ie,
|
|
726
|
+
$e
|
|
727
|
+
].forEach((n) => {
|
|
728
|
+
this._commandService.registerCommand(n);
|
|
700
729
|
});
|
|
701
730
|
}
|
|
702
731
|
_initShortcut() {
|
|
703
|
-
[
|
|
704
|
-
this._shortcutService.registerShortcut(
|
|
732
|
+
[_t].forEach((n) => {
|
|
733
|
+
this._shortcutService.registerShortcut(n);
|
|
705
734
|
});
|
|
706
735
|
}
|
|
707
736
|
_initMenus() {
|
|
708
|
-
this._menuManagerService.mergeMenu(
|
|
709
|
-
}
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
],
|
|
717
|
-
const
|
|
718
|
-
var
|
|
719
|
-
for (var
|
|
720
|
-
(
|
|
721
|
-
return
|
|
722
|
-
},
|
|
723
|
-
let
|
|
724
|
-
constructor(
|
|
725
|
-
super(), this._config =
|
|
726
|
-
const { menu, ...
|
|
727
|
-
|
|
737
|
+
this._menuManagerService.mergeMenu(It);
|
|
738
|
+
}
|
|
739
|
+
};
|
|
740
|
+
Y = St([
|
|
741
|
+
F(0, _(xn)),
|
|
742
|
+
F(1, x),
|
|
743
|
+
F(2, On),
|
|
744
|
+
F(3, Pn)
|
|
745
|
+
], Y);
|
|
746
|
+
const yt = "DOC_HYPER_LINK_UI_PLUGIN";
|
|
747
|
+
var Te = Object.defineProperty, kt = Object.getOwnPropertyDescriptor, xt = (n, e, t) => e in n ? Te(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Ot = (n, e, t, i) => {
|
|
748
|
+
for (var r = i > 1 ? void 0 : i ? kt(e, t) : e, s = n.length - 1, o; s >= 0; s--)
|
|
749
|
+
(o = n[s]) && (r = (i ? o(e, t, r) : o(r)) || r);
|
|
750
|
+
return i && r && Te(e, t, r), r;
|
|
751
|
+
}, ee = (n, e) => (t, i) => e(t, i, n), He = (n, e, t) => xt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
752
|
+
let G = class extends Ge {
|
|
753
|
+
constructor(n = En, e, t, i) {
|
|
754
|
+
super(), this._config = n, this._injector = e, this._renderManagerSrv = t, this._configService = i;
|
|
755
|
+
const { menu: r, ...s } = this._config;
|
|
756
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Rn, s);
|
|
728
757
|
}
|
|
729
758
|
onStarting() {
|
|
730
759
|
[
|
|
731
|
-
[
|
|
732
|
-
[
|
|
733
|
-
[
|
|
734
|
-
].forEach((
|
|
735
|
-
this._injector.add(
|
|
736
|
-
}), this._injector.get(
|
|
760
|
+
[S],
|
|
761
|
+
[Y],
|
|
762
|
+
[W]
|
|
763
|
+
].forEach((e) => {
|
|
764
|
+
this._injector.add(e);
|
|
765
|
+
}), this._injector.get(Y);
|
|
737
766
|
}
|
|
738
767
|
onReady() {
|
|
739
|
-
this._injector.get(
|
|
768
|
+
this._injector.get(W);
|
|
740
769
|
}
|
|
741
770
|
onRendered() {
|
|
742
771
|
this._initRenderModule();
|
|
743
772
|
}
|
|
744
773
|
_initRenderModule() {
|
|
745
774
|
[
|
|
746
|
-
[
|
|
747
|
-
[
|
|
748
|
-
].forEach((
|
|
749
|
-
this._renderManagerSrv.registerRenderModule(
|
|
775
|
+
[oe],
|
|
776
|
+
[re]
|
|
777
|
+
].forEach((n) => {
|
|
778
|
+
this._renderManagerSrv.registerRenderModule(I.UNIVER_DOC, n);
|
|
750
779
|
});
|
|
751
780
|
}
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
],
|
|
781
|
+
};
|
|
782
|
+
He(G, "pluginName", yt);
|
|
783
|
+
He(G, "type", I.UNIVER_DOC);
|
|
784
|
+
G = Ot([
|
|
785
|
+
We(ze),
|
|
786
|
+
ee(1, _(Ye)),
|
|
787
|
+
ee(2, qe),
|
|
788
|
+
ee(3, Ze)
|
|
789
|
+
], G);
|
|
761
790
|
export {
|
|
762
|
-
UniverDocsHyperLinkUIPlugin
|
|
791
|
+
G as UniverDocsHyperLinkUIPlugin
|
|
763
792
|
};
|