@univerjs/docs-hyper-link-ui 0.5.5-nightly.202501211606 → 0.5.5
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/LICENSE +176 -0
- package/lib/es/index.js +528 -541
- package/lib/es/locale/en-US.js +2 -2
- package/lib/es/locale/fa-IR.js +2 -2
- package/lib/es/locale/fr-FR.js +2 -2
- package/lib/es/locale/ru-RU.js +2 -2
- package/lib/es/locale/vi-VN.js +2 -2
- package/lib/es/locale/zh-CN.js +2 -2
- package/lib/es/locale/zh-TW.js +2 -2
- package/package.json +8 -8
package/lib/es/index.js
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
|
|
1
|
+
var Ke = Object.defineProperty;
|
|
2
|
+
var Fe = (n, e, t) => e in n ? Ke(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var P = (n, e, t) => Fe(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { CommandType as E, ICommandService as x, generateRandomId as Ve, CustomRangeType as D, IUniverInstanceService as O, UniverInstanceType as I, getBodySlice as Pe, useDependency as S, LocaleService as Re, useObservable as Ye, Tools as Ze, BuildTextUtils as _e, Disposable as N, Inject as v, DOCS_ZEN_EDITOR_UNIT_ID_KEY as We, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ge, DependentOn as qe, Injector as Je, Plugin as ze, merge as Qe, IConfigService as Xe } from "@univerjs/core";
|
|
5
|
+
import { UniverDocsHyperLinkPlugin as en } from "@univerjs/docs-hyper-link";
|
|
6
|
+
import { IRenderManagerService as nn } from "@univerjs/engine-render";
|
|
7
|
+
import { addCustomRangeBySelectionFactory as tn, DocSelectionManagerService as b, replaceSelectionFactory as rn, deleteCustomRangeFactory as on, SetTextSelectionsOperation as sn, DocSkeletonManagerService as cn, DocInterceptorService as dn, DOC_INTERCEPTOR_POINT as an } from "@univerjs/docs";
|
|
8
|
+
import { DocCanvasPopManagerService as ln, DocEventManagerService as un, DocRenderController as pn, whenDocAndEditorFocused as fn } from "@univerjs/docs-ui";
|
|
9
|
+
import { BehaviorSubject as ve, distinctUntilChanged as gn, pairwise as hn, Observable as mn, debounceTime as _n } from "rxjs";
|
|
10
|
+
import vn, { useState as J, useEffect as In, forwardRef as j, useRef as Cn, createElement as U } from "react";
|
|
11
|
+
import { FormLayout as Ie, Input as Ce, Button as Se, Tooltip as B, MessageType as Sn } from "@univerjs/design";
|
|
12
|
+
import { KeyCode as te, IMessageService as Ln, useObservable as yn, MetaKeys as kn, MenuItemType as xn, getMenuHiddenObservable as On, RibbonStartGroup as Pn, ContextMenuPosition as Rn, ContextMenuGroup as En, ComponentManager as bn, IMenuManagerService as Mn, IShortcutService as wn } from "@univerjs/ui";
|
|
13
|
+
const Dn = "docs-hyper-link-ui.config", Le = {};
|
|
14
|
+
var z = { exports: {} }, M = {};
|
|
16
15
|
/**
|
|
17
16
|
* @license React
|
|
18
17
|
* react-jsx-runtime.production.min.js
|
|
@@ -22,432 +21,421 @@ var jsxRuntime = { exports: {} }, reactJsxRuntime_production_min = {};
|
|
|
22
21
|
* This source code is licensed under the MIT license found in the
|
|
23
22
|
* LICENSE file in the root directory of this source tree.
|
|
24
23
|
*/
|
|
25
|
-
var
|
|
26
|
-
function
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
function
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
for (
|
|
34
|
-
if (c && c.defaultProps) for (
|
|
35
|
-
return { $$typeof:
|
|
36
|
-
}
|
|
37
|
-
return
|
|
24
|
+
var ye;
|
|
25
|
+
function Nn() {
|
|
26
|
+
if (ye) return M;
|
|
27
|
+
ye = 1;
|
|
28
|
+
var n = vn, e = Symbol.for("react.element"), t = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, r = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
29
|
+
function s(c, d, p) {
|
|
30
|
+
var l, h = {}, f = null, a = null;
|
|
31
|
+
p !== void 0 && (f = "" + p), d.key !== void 0 && (f = "" + d.key), d.ref !== void 0 && (a = d.ref);
|
|
32
|
+
for (l in d) i.call(d, l) && !o.hasOwnProperty(l) && (h[l] = d[l]);
|
|
33
|
+
if (c && c.defaultProps) for (l in d = c.defaultProps, d) h[l] === void 0 && (h[l] = d[l]);
|
|
34
|
+
return { $$typeof: e, type: c, key: f, ref: a, props: h, _owner: r.current };
|
|
35
|
+
}
|
|
36
|
+
return M.Fragment = t, M.jsx = s, M.jsxs = s, M;
|
|
38
37
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return hasRequiredJsxRuntime || (hasRequiredJsxRuntime = 1, jsxRuntime.exports = requireReactJsxRuntime_production_min()), jsxRuntime.exports;
|
|
38
|
+
var ke;
|
|
39
|
+
function jn() {
|
|
40
|
+
return ke || (ke = 1, z.exports = Nn()), z.exports;
|
|
43
41
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
type: CommandType.COMMAND,
|
|
42
|
+
var u = jn();
|
|
43
|
+
const Ee = {
|
|
44
|
+
type: E.COMMAND,
|
|
48
45
|
id: "docs.command.add-hyper-link",
|
|
49
|
-
async handler(
|
|
50
|
-
if (!
|
|
46
|
+
async handler(n, e) {
|
|
47
|
+
if (!e)
|
|
51
48
|
return !1;
|
|
52
|
-
const { payload, unitId, selections } =
|
|
53
|
-
|
|
49
|
+
const { payload: t, unitId: i, selections: r } = e, o = n.get(x), s = Ve(), c = tn(
|
|
50
|
+
n,
|
|
54
51
|
{
|
|
55
|
-
rangeId:
|
|
56
|
-
rangeType:
|
|
52
|
+
rangeId: s,
|
|
53
|
+
rangeType: D.HYPERLINK,
|
|
57
54
|
properties: {
|
|
58
|
-
url:
|
|
55
|
+
url: t
|
|
59
56
|
},
|
|
60
|
-
unitId,
|
|
61
|
-
selections
|
|
57
|
+
unitId: i,
|
|
58
|
+
selections: r
|
|
62
59
|
}
|
|
63
60
|
);
|
|
64
|
-
return
|
|
61
|
+
return c ? o.syncExecuteCommand(c.id, c.params) : !1;
|
|
65
62
|
}
|
|
66
|
-
},
|
|
63
|
+
}, be = {
|
|
67
64
|
id: "docs.command.update-hyper-link",
|
|
68
|
-
type:
|
|
69
|
-
handler(
|
|
70
|
-
var
|
|
71
|
-
if (!
|
|
65
|
+
type: E.COMMAND,
|
|
66
|
+
handler(n, e) {
|
|
67
|
+
var m;
|
|
68
|
+
if (!e)
|
|
72
69
|
return !1;
|
|
73
|
-
const { unitId, payload, segmentId, linkId } =
|
|
74
|
-
if (!
|
|
70
|
+
const { unitId: t, payload: i, segmentId: r, linkId: o } = e, s = n.get(x), c = n.get(O), p = n.get(b).getActiveTextRange(), l = c.getUnit(t, I.UNIVER_DOC);
|
|
71
|
+
if (!p || !l)
|
|
75
72
|
return !1;
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
unitId,
|
|
73
|
+
const f = (m = Pe(l.getSelfOrHeaderFooterModel(r).getBody(), p.startOffset, p.endOffset).textRuns) == null ? void 0 : m[0];
|
|
74
|
+
f && (f.ed = e.label.length + 1);
|
|
75
|
+
const a = rn(n, {
|
|
76
|
+
unitId: t,
|
|
80
77
|
body: {
|
|
81
|
-
dataStream: `${
|
|
78
|
+
dataStream: `${e.label}`,
|
|
82
79
|
customRanges: [{
|
|
83
|
-
rangeId:
|
|
84
|
-
rangeType:
|
|
80
|
+
rangeId: o,
|
|
81
|
+
rangeType: D.HYPERLINK,
|
|
85
82
|
startIndex: 0,
|
|
86
|
-
endIndex:
|
|
83
|
+
endIndex: e.label.length + 1,
|
|
87
84
|
properties: {
|
|
88
|
-
url:
|
|
85
|
+
url: i
|
|
89
86
|
}
|
|
90
87
|
}],
|
|
91
|
-
textRuns:
|
|
88
|
+
textRuns: f ? [f] : void 0
|
|
92
89
|
},
|
|
93
90
|
selection: {
|
|
94
|
-
startOffset:
|
|
95
|
-
endOffset:
|
|
91
|
+
startOffset: p.startOffset,
|
|
92
|
+
endOffset: p.endOffset,
|
|
96
93
|
collapsed: !1,
|
|
97
|
-
segmentId
|
|
94
|
+
segmentId: r
|
|
98
95
|
}
|
|
99
96
|
});
|
|
100
|
-
return
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
docsLinkEdit,
|
|
104
|
-
docsLinkEditTitle,
|
|
105
|
-
docsLinkEditClose,
|
|
106
|
-
docsLinkEditButtons,
|
|
107
|
-
docsLinkEditButton
|
|
97
|
+
return a ? s.syncExecuteCommand(a.id, a.params) : !1;
|
|
98
|
+
}
|
|
99
|
+
}, Un = "univer-docs-link-edit", $n = "univer-docs-link-edit-title", Tn = "univer-docs-link-edit-close", Hn = "univer-docs-link-edit-buttons", An = "univer-docs-link-edit-button", K = {
|
|
100
|
+
docsLinkEdit: Un,
|
|
101
|
+
docsLinkEditTitle: $n,
|
|
102
|
+
docsLinkEditClose: Tn,
|
|
103
|
+
docsLinkEditButtons: Hn,
|
|
104
|
+
docsLinkEditButton: An
|
|
108
105
|
};
|
|
109
|
-
function
|
|
110
|
-
return /^[a-zA-Z]+:\/\//.test(
|
|
106
|
+
function Bn(n) {
|
|
107
|
+
return /^[a-zA-Z]+:\/\//.test(n);
|
|
111
108
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(url);
|
|
109
|
+
function Kn(n) {
|
|
110
|
+
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(n);
|
|
115
111
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return hasProtocol(urlStr) ? urlStr : isEmail(urlStr) ? `mailto://${urlStr}` : `https://${urlStr}`;
|
|
112
|
+
function Fn(n) {
|
|
113
|
+
return Bn(n) ? n : Kn(n) ? `mailto://${n}` : `https://${n}`;
|
|
119
114
|
}
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (!activeRange)
|
|
115
|
+
const V = () => {
|
|
116
|
+
const n = S(L), e = S(Re), t = Ye(n.editingLink$), i = S(x), r = S(O), o = S(b), [s, c] = J(""), [d, p] = J(""), [l, h] = J(!1), f = Ze.isLegalUrl(s), a = t ? r.getUnit(t.unitId, I.UNIVER_DOC) : r.getCurrentUnitForType(I.UNIVER_DOC);
|
|
117
|
+
In(() => {
|
|
118
|
+
var de, ae, le, ue, pe, fe, ge, he, me;
|
|
119
|
+
const g = o.getActiveTextRange();
|
|
120
|
+
if (!g)
|
|
127
121
|
return;
|
|
128
|
-
if (
|
|
129
|
-
const
|
|
130
|
-
|
|
122
|
+
if (t) {
|
|
123
|
+
const H = (de = a == null ? void 0 : a.getSelfOrHeaderFooterModel(t.segmentId)) == null ? void 0 : de.getBody(), A = (ae = H == null ? void 0 : H.customRanges) == null ? void 0 : ae.find((q) => (t == null ? void 0 : t.linkId) === q.rangeId && q.startIndex === t.startIndex && q.endIndex === t.endIndex);
|
|
124
|
+
a && A && (c((ue = (le = A.properties) == null ? void 0 : le.url) != null ? ue : ""), p(_e.transform.getPlainText(Pe(H, A.startIndex, A.endIndex + 1).dataStream)));
|
|
131
125
|
return;
|
|
132
126
|
}
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
}, [
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
if (
|
|
127
|
+
const y = (pe = a == null ? void 0 : a.getSelfOrHeaderFooterModel(g.segmentId)) == null ? void 0 : pe.getBody(), ce = y ? g : null, T = ce && ((ge = _e.customRange.getCustomRangesInterestsWithSelection(ce, (fe = y == null ? void 0 : y.customRanges) != null ? fe : [])) == null ? void 0 : ge[0]);
|
|
128
|
+
a && T && c((me = (he = T == null ? void 0 : T.properties) == null ? void 0 : he.url) != null ? me : "");
|
|
129
|
+
}, [a, t, o, r]);
|
|
130
|
+
const m = () => {
|
|
131
|
+
n.hideEditPopup();
|
|
132
|
+
}, C = () => {
|
|
133
|
+
if (h(!0), !f || !a)
|
|
140
134
|
return;
|
|
141
|
-
const
|
|
142
|
-
if (!
|
|
143
|
-
|
|
144
|
-
unitId:
|
|
145
|
-
payload:
|
|
135
|
+
const g = Fn(s);
|
|
136
|
+
if (!t)
|
|
137
|
+
i.executeCommand(Ee.id, {
|
|
138
|
+
unitId: a.getUnitId(),
|
|
139
|
+
payload: g
|
|
146
140
|
});
|
|
147
141
|
else {
|
|
148
|
-
if (!
|
|
142
|
+
if (!d)
|
|
149
143
|
return;
|
|
150
|
-
|
|
151
|
-
unitId:
|
|
152
|
-
payload:
|
|
153
|
-
linkId:
|
|
154
|
-
label,
|
|
155
|
-
segmentId:
|
|
144
|
+
i.executeCommand(be.id, {
|
|
145
|
+
unitId: a.getUnitId(),
|
|
146
|
+
payload: g,
|
|
147
|
+
linkId: t.linkId,
|
|
148
|
+
label: d,
|
|
149
|
+
segmentId: t.segmentId
|
|
156
150
|
});
|
|
157
151
|
}
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
if (
|
|
161
|
-
return /* @__PURE__ */
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
|
|
164
|
-
|
|
152
|
+
n.hideEditPopup();
|
|
153
|
+
};
|
|
154
|
+
if (a)
|
|
155
|
+
return /* @__PURE__ */ u.jsxs("div", { className: K.docsLinkEdit, children: [
|
|
156
|
+
/* @__PURE__ */ u.jsxs("div", { children: [
|
|
157
|
+
t ? /* @__PURE__ */ u.jsx(
|
|
158
|
+
Ie,
|
|
165
159
|
{
|
|
166
|
-
label:
|
|
167
|
-
error:
|
|
168
|
-
children: /* @__PURE__ */
|
|
169
|
-
|
|
160
|
+
label: e.t("docLink.edit.label"),
|
|
161
|
+
error: l && !d ? e.t("docLink.edit.labelError") : "",
|
|
162
|
+
children: /* @__PURE__ */ u.jsx(
|
|
163
|
+
Ce,
|
|
170
164
|
{
|
|
171
|
-
value:
|
|
172
|
-
onChange:
|
|
165
|
+
value: d,
|
|
166
|
+
onChange: p,
|
|
173
167
|
autoFocus: !0,
|
|
174
|
-
onKeyDown:
|
|
175
|
-
|
|
176
|
-
}
|
|
168
|
+
onKeyDown: (g) => {
|
|
169
|
+
g.keyCode === te.ENTER && C();
|
|
170
|
+
}
|
|
177
171
|
}
|
|
178
172
|
)
|
|
179
173
|
}
|
|
180
174
|
) : null,
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
|
|
175
|
+
/* @__PURE__ */ u.jsx(
|
|
176
|
+
Ie,
|
|
183
177
|
{
|
|
184
|
-
label:
|
|
185
|
-
error:
|
|
186
|
-
children: /* @__PURE__ */
|
|
187
|
-
|
|
178
|
+
label: e.t("docLink.edit.address"),
|
|
179
|
+
error: l && !f ? e.t("docLink.edit.addressError") : "",
|
|
180
|
+
children: /* @__PURE__ */ u.jsx(
|
|
181
|
+
Ce,
|
|
188
182
|
{
|
|
189
|
-
value:
|
|
190
|
-
onChange:
|
|
183
|
+
value: s,
|
|
184
|
+
onChange: c,
|
|
191
185
|
autoFocus: !0,
|
|
192
|
-
onKeyDown:
|
|
193
|
-
|
|
194
|
-
}
|
|
186
|
+
onKeyDown: (g) => {
|
|
187
|
+
g.keyCode === te.ENTER && C();
|
|
188
|
+
}
|
|
195
189
|
}
|
|
196
190
|
)
|
|
197
191
|
}
|
|
198
192
|
)
|
|
199
193
|
] }),
|
|
200
|
-
/* @__PURE__ */
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
|
|
194
|
+
/* @__PURE__ */ u.jsxs("div", { className: K.docsLinkEditButtons, children: [
|
|
195
|
+
/* @__PURE__ */ u.jsx(
|
|
196
|
+
Se,
|
|
203
197
|
{
|
|
204
|
-
className:
|
|
205
|
-
onClick:
|
|
206
|
-
children:
|
|
198
|
+
className: K.docsLinkEditButton,
|
|
199
|
+
onClick: m,
|
|
200
|
+
children: e.t("docLink.edit.cancel")
|
|
207
201
|
}
|
|
208
202
|
),
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
-
|
|
203
|
+
/* @__PURE__ */ u.jsx(
|
|
204
|
+
Se,
|
|
211
205
|
{
|
|
212
|
-
disabled: !
|
|
213
|
-
className:
|
|
206
|
+
disabled: !s,
|
|
207
|
+
className: K.docsLinkEditButton,
|
|
214
208
|
type: "primary",
|
|
215
|
-
onClick:
|
|
216
|
-
children:
|
|
209
|
+
onClick: C,
|
|
210
|
+
children: e.t("docLink.edit.confirm")
|
|
217
211
|
}
|
|
218
212
|
)
|
|
219
213
|
] })
|
|
220
214
|
] });
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
var
|
|
224
|
-
return
|
|
225
|
-
for (var
|
|
226
|
-
|
|
227
|
-
for (var
|
|
215
|
+
};
|
|
216
|
+
V.componentKey = "docs-hyper-link-edit";
|
|
217
|
+
var _ = function() {
|
|
218
|
+
return _ = Object.assign || function(n) {
|
|
219
|
+
for (var e, t = 1, i = arguments.length; t < i; t++) {
|
|
220
|
+
e = arguments[t];
|
|
221
|
+
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
|
|
228
222
|
}
|
|
229
|
-
return
|
|
230
|
-
},
|
|
231
|
-
},
|
|
223
|
+
return n;
|
|
224
|
+
}, _.apply(this, arguments);
|
|
225
|
+
}, Vn = function(n, e) {
|
|
232
226
|
var t = {};
|
|
233
|
-
for (var
|
|
234
|
-
if (
|
|
235
|
-
for (var
|
|
236
|
-
e.indexOf(
|
|
227
|
+
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
|
|
228
|
+
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
229
|
+
for (var r = 0, i = Object.getOwnPropertySymbols(n); r < i.length; r++)
|
|
230
|
+
e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[r]) && (t[i[r]] = n[i[r]]);
|
|
237
231
|
return t;
|
|
238
|
-
},
|
|
239
|
-
var
|
|
240
|
-
return
|
|
232
|
+
}, $ = j(function(n, e) {
|
|
233
|
+
var t = n.icon, i = n.id, r = n.className, o = n.extend, s = Vn(n, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), d = Cn("_".concat(Wn()));
|
|
234
|
+
return Me(t, "".concat(i), { defIds: t.defIds, idSuffix: d.current }, _({ ref: e, className: c }, s), o);
|
|
241
235
|
});
|
|
242
|
-
function
|
|
243
|
-
return
|
|
244
|
-
return
|
|
236
|
+
function Me(n, e, t, i, r) {
|
|
237
|
+
return U(n.tag, _(_({ key: e }, Yn(n, t, r)), i), (Zn(n, t).children || []).map(function(o, s) {
|
|
238
|
+
return Me(o, "".concat(e, "-").concat(n.tag, "-").concat(s), t, void 0, r);
|
|
245
239
|
}));
|
|
246
240
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
})), attrs;
|
|
241
|
+
function Yn(n, e, t) {
|
|
242
|
+
var i = _({}, n.attrs);
|
|
243
|
+
t != null && t.colorChannel1 && i.fill === "colorChannel1" && (i.fill = t.colorChannel1);
|
|
244
|
+
var r = e.defIds;
|
|
245
|
+
return !r || r.length === 0 || (n.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(function(o) {
|
|
246
|
+
var s = o[0], c = o[1];
|
|
247
|
+
typeof c == "string" && (i[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
248
|
+
})), i;
|
|
256
249
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}) }) : node;
|
|
250
|
+
function Zn(n, e) {
|
|
251
|
+
var t, i = e.defIds;
|
|
252
|
+
return !i || i.length === 0 ? n : n.tag === "defs" && (!((t = n.children) === null || t === void 0) && t.length) ? _(_({}, n), { children: n.children.map(function(r) {
|
|
253
|
+
return typeof r.attrs.id == "string" && i && i.indexOf(r.attrs.id) > -1 ? _(_({}, r), { attrs: _(_({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
254
|
+
}) }) : n;
|
|
263
255
|
}
|
|
264
|
-
|
|
265
|
-
function generateShortUuid() {
|
|
256
|
+
function Wn() {
|
|
266
257
|
return Math.random().toString(36).substring(2, 8);
|
|
267
258
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
return createElement(IconBase, Object.assign({}, props, {
|
|
259
|
+
$.displayName = "UniverIcon";
|
|
260
|
+
var Gn = { 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" } }] }, we = j(function(n, e) {
|
|
261
|
+
return U($, Object.assign({}, n, {
|
|
272
262
|
id: "copy-single",
|
|
273
|
-
ref,
|
|
274
|
-
icon:
|
|
263
|
+
ref: e,
|
|
264
|
+
icon: Gn
|
|
275
265
|
}));
|
|
276
266
|
});
|
|
277
|
-
|
|
278
|
-
var
|
|
279
|
-
return
|
|
267
|
+
we.displayName = "CopySingle";
|
|
268
|
+
var qn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M9.8816 1.97978C11.0177 0.843607 12.862 0.884962 14.0004 2.02342C15.1389 3.16188 15.1803 5.00612 14.0441 6.14228L11.399 8.78737C11.1608 9.02559 10.7746 9.02559 10.5363 8.78737C10.2981 8.54915 10.2981 8.16292 10.5363 7.9247L13.1814 5.2796C13.8195 4.64155 13.8217 3.57006 13.1378 2.8861C12.4538 2.20211 11.3823 2.20438 10.7443 2.84245L7.6976 5.88911L7.69317 5.89349C7.05959 6.53211 7.05894 7.60014 7.74132 8.28252C7.97954 8.52074 7.97954 8.90697 7.74132 9.14519C7.5031 9.38341 7.11687 9.38341 6.87865 9.14519C5.74016 8.00671 5.69884 6.16251 6.83497 5.02633L6.84021 5.02116L9.8816 1.97978Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.61426 7.2364C4.85248 6.99818 5.23871 6.99818 5.47693 7.2364C5.71515 7.47462 5.71515 7.86085 5.47693 8.09907L2.83183 10.7442C2.19375 11.3823 2.1915 12.4537 2.87547 13.1377C3.55945 13.8217 4.6309 13.8194 5.26899 13.1813L8.31566 10.1347C8.32262 10.1277 8.32971 10.121 8.33691 10.1144C8.34408 10.1064 8.3515 10.0986 8.35916 10.091C8.99721 9.45291 8.99949 8.38145 8.3155 7.69746C8.07728 7.45924 8.07728 7.07301 8.3155 6.83479C8.55372 6.59657 8.93995 6.59657 9.17817 6.83479C10.3166 7.97327 10.358 9.81748 9.22183 10.9536C9.21487 10.9606 9.20779 10.9673 9.20058 10.9739C9.19341 10.9819 9.18599 10.9897 9.17833 10.9973L6.13166 14.044C4.99548 15.1802 3.15127 15.1389 2.01279 14.0004C0.874362 12.8619 0.83297 11.0177 1.96916 9.8815L4.61426 7.2364Z" } }] }, se = j(function(n, e) {
|
|
269
|
+
return U($, Object.assign({}, n, {
|
|
280
270
|
id: "link-single",
|
|
281
|
-
ref,
|
|
282
|
-
icon:
|
|
271
|
+
ref: e,
|
|
272
|
+
icon: qn
|
|
283
273
|
}));
|
|
284
274
|
});
|
|
285
|
-
|
|
286
|
-
var
|
|
287
|
-
return
|
|
275
|
+
se.displayName = "LinkSingle";
|
|
276
|
+
var Jn = { 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" } }] }, De = j(function(n, e) {
|
|
277
|
+
return U($, Object.assign({}, n, {
|
|
288
278
|
id: "unlink-single",
|
|
289
|
-
ref,
|
|
290
|
-
icon:
|
|
279
|
+
ref: e,
|
|
280
|
+
icon: Jn
|
|
291
281
|
}));
|
|
292
282
|
});
|
|
293
|
-
|
|
294
|
-
var
|
|
295
|
-
return
|
|
283
|
+
De.displayName = "UnlinkSingle";
|
|
284
|
+
var zn = { 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" } }] }, Ne = j(function(n, e) {
|
|
285
|
+
return U($, Object.assign({}, n, {
|
|
296
286
|
id: "write-single",
|
|
297
|
-
ref,
|
|
298
|
-
icon:
|
|
287
|
+
ref: e,
|
|
288
|
+
icon: zn
|
|
299
289
|
}));
|
|
300
290
|
});
|
|
301
|
-
|
|
302
|
-
function
|
|
303
|
-
var
|
|
304
|
-
if (typeof
|
|
305
|
-
else if (typeof
|
|
306
|
-
var
|
|
307
|
-
for (
|
|
308
|
-
} else for (
|
|
309
|
-
return
|
|
291
|
+
Ne.displayName = "WriteSingle";
|
|
292
|
+
function je(n) {
|
|
293
|
+
var e, t, i = "";
|
|
294
|
+
if (typeof n == "string" || typeof n == "number") i += n;
|
|
295
|
+
else if (typeof n == "object") if (Array.isArray(n)) {
|
|
296
|
+
var r = n.length;
|
|
297
|
+
for (e = 0; e < r; e++) n[e] && (t = je(n[e])) && (i && (i += " "), i += t);
|
|
298
|
+
} else for (t in n) n[t] && (i && (i += " "), i += t);
|
|
299
|
+
return i;
|
|
310
300
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
return n;
|
|
301
|
+
function xe() {
|
|
302
|
+
for (var n, e, t = 0, i = "", r = arguments.length; t < r; t++) (n = arguments[t]) && (e = je(n)) && (i && (i += " "), i += e);
|
|
303
|
+
return i;
|
|
315
304
|
}
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
type: CommandType.COMMAND,
|
|
305
|
+
const Ue = {
|
|
306
|
+
type: E.COMMAND,
|
|
319
307
|
id: "docs.command.delete-hyper-link",
|
|
320
|
-
async handler(
|
|
321
|
-
if (!
|
|
308
|
+
async handler(n, e) {
|
|
309
|
+
if (!e)
|
|
322
310
|
return !1;
|
|
323
|
-
const { unitId, linkId, segmentId } =
|
|
324
|
-
return
|
|
311
|
+
const { unitId: t, linkId: i, segmentId: r } = e, o = n.get(x), s = on(n, { unitId: t, rangeId: i, segmentId: r });
|
|
312
|
+
return s ? await o.syncExecuteCommand(s.id, s.params) : !1;
|
|
325
313
|
}
|
|
326
|
-
},
|
|
327
|
-
const
|
|
328
|
-
if (!(
|
|
314
|
+
}, $e = (n) => {
|
|
315
|
+
const e = n.get(b), t = n.get(O), i = e.getTextRanges();
|
|
316
|
+
if (!(i != null && i.length))
|
|
329
317
|
return !0;
|
|
330
|
-
const
|
|
331
|
-
return !!(!
|
|
332
|
-
},
|
|
333
|
-
type:
|
|
318
|
+
const r = i[0];
|
|
319
|
+
return !!(!t.getCurrentUnitForType(I.UNIVER_DOC) || !r || r.collapsed);
|
|
320
|
+
}, R = {
|
|
321
|
+
type: E.OPERATION,
|
|
334
322
|
id: "doc.operation.show-hyper-link-edit-popup",
|
|
335
|
-
handler(
|
|
336
|
-
var
|
|
337
|
-
const
|
|
338
|
-
if (
|
|
323
|
+
handler(n, e) {
|
|
324
|
+
var s;
|
|
325
|
+
const t = e == null ? void 0 : e.link, i = n.get(O);
|
|
326
|
+
if ($e(n) && !t)
|
|
339
327
|
return !1;
|
|
340
|
-
const
|
|
341
|
-
return
|
|
328
|
+
const r = n.get(L), o = (t == null ? void 0 : t.unitId) || ((s = i.getCurrentUnitForType(I.UNIVER_DOC)) == null ? void 0 : s.getUnitId());
|
|
329
|
+
return o ? (r.showEditPopup(o, t), !0) : !1;
|
|
342
330
|
}
|
|
343
|
-
},
|
|
344
|
-
type:
|
|
331
|
+
}, ie = {
|
|
332
|
+
type: E.OPERATION,
|
|
345
333
|
id: "doc.operation.toggle-hyper-link-info-popup",
|
|
346
|
-
handler(
|
|
347
|
-
const
|
|
348
|
-
return
|
|
334
|
+
handler(n, e) {
|
|
335
|
+
const t = n.get(L);
|
|
336
|
+
return e ? (t.showInfoPopup(e), !0) : (t.hideInfoPopup(), !0);
|
|
349
337
|
}
|
|
350
|
-
},
|
|
351
|
-
type:
|
|
338
|
+
}, Te = {
|
|
339
|
+
type: E.OPERATION,
|
|
352
340
|
id: "doc.operation.click-hyper-link",
|
|
353
|
-
handler(
|
|
354
|
-
var
|
|
355
|
-
if (!
|
|
341
|
+
handler(n, e) {
|
|
342
|
+
var p, l, h;
|
|
343
|
+
if (!e)
|
|
356
344
|
return !1;
|
|
357
|
-
const { unitId, linkId, segmentId } =
|
|
358
|
-
return
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
docLink,
|
|
362
|
-
docLinkType,
|
|
363
|
-
docLinkContent,
|
|
364
|
-
docLinkContentError,
|
|
365
|
-
docLinkUrl,
|
|
366
|
-
docLinkOperations,
|
|
367
|
-
docLinkOperation,
|
|
368
|
-
docLinkOperationError
|
|
369
|
-
},
|
|
370
|
-
var
|
|
371
|
-
const
|
|
372
|
-
if (!
|
|
345
|
+
const { unitId: t, linkId: i, segmentId: r } = e, s = n.get(O).getUnit(t, I.UNIVER_DOC), c = s == null ? void 0 : s.getSelfOrHeaderFooterModel(r).getBody(), d = (h = (l = (p = c == null ? void 0 : c.customRanges) == null ? void 0 : p.find((f) => f.rangeId === i && f.rangeType === D.HYPERLINK)) == null ? void 0 : l.properties) == null ? void 0 : h.url;
|
|
346
|
+
return d && window.open(d, "_blank", "noopener noreferrer"), !0;
|
|
347
|
+
}
|
|
348
|
+
}, 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 = {
|
|
349
|
+
docLink: Qn,
|
|
350
|
+
docLinkType: Xn,
|
|
351
|
+
docLinkContent: et,
|
|
352
|
+
docLinkContentError: nt,
|
|
353
|
+
docLinkUrl: tt,
|
|
354
|
+
docLinkOperations: it,
|
|
355
|
+
docLinkOperation: rt,
|
|
356
|
+
docLinkOperationError: ot
|
|
357
|
+
}, Y = () => {
|
|
358
|
+
var C, g;
|
|
359
|
+
const n = S(L), e = S(x), t = S(Ln), i = S(Re), r = yn(n.showingLink$), o = S(O);
|
|
360
|
+
if (!r)
|
|
373
361
|
return null;
|
|
374
|
-
const { unitId, linkId, segmentId, startIndex, endIndex } =
|
|
375
|
-
if (!
|
|
362
|
+
const { unitId: s, linkId: c, segmentId: d, startIndex: p, endIndex: l } = r, h = o.getUnit(s, I.UNIVER_DOC), f = h == null ? void 0 : h.getSelfOrHeaderFooterModel(d).getBody(), a = (C = f == null ? void 0 : f.customRanges) == null ? void 0 : C.find((y) => y.rangeId === c && y.rangeType === D.HYPERLINK && y.startIndex === p && y.endIndex === l);
|
|
363
|
+
if (!a)
|
|
376
364
|
return null;
|
|
377
|
-
const
|
|
378
|
-
return /* @__PURE__ */
|
|
365
|
+
const m = (g = a.properties) == null ? void 0 : g.url;
|
|
366
|
+
return /* @__PURE__ */ u.jsxs(
|
|
379
367
|
"div",
|
|
380
368
|
{
|
|
381
|
-
className:
|
|
382
|
-
onClick:
|
|
383
|
-
|
|
384
|
-
},
|
|
369
|
+
className: k.docLink,
|
|
370
|
+
onClick: () => {
|
|
371
|
+
n.hideInfoPopup();
|
|
372
|
+
},
|
|
385
373
|
children: [
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
388
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ u.jsxs("div", { className: xe(k.docLinkContent), onClick: () => window.open(m), children: [
|
|
375
|
+
/* @__PURE__ */ u.jsx("div", { className: k.docLinkType, children: /* @__PURE__ */ u.jsx(se, {}) }),
|
|
376
|
+
/* @__PURE__ */ u.jsx(B, { showIfEllipsis: !0, title: m, children: /* @__PURE__ */ u.jsx("span", { className: k.docLinkUrl, children: m }) })
|
|
389
377
|
] }),
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ u.jsxs("div", { className: k.docLinkOperations, children: [
|
|
379
|
+
/* @__PURE__ */ u.jsx(
|
|
392
380
|
"div",
|
|
393
381
|
{
|
|
394
|
-
className:
|
|
395
|
-
onClick:
|
|
396
|
-
navigator.clipboard.writeText(
|
|
397
|
-
content:
|
|
398
|
-
type:
|
|
382
|
+
className: xe(k.docLinkOperation),
|
|
383
|
+
onClick: () => {
|
|
384
|
+
navigator.clipboard.writeText(m), t.show({
|
|
385
|
+
content: i.t("docLink.info.coped"),
|
|
386
|
+
type: Sn.Info
|
|
399
387
|
});
|
|
400
|
-
},
|
|
401
|
-
children: /* @__PURE__ */
|
|
388
|
+
},
|
|
389
|
+
children: /* @__PURE__ */ u.jsx(B, { placement: "bottom", title: i.t("docLink.info.copy"), children: /* @__PURE__ */ u.jsx(we, {}) })
|
|
402
390
|
}
|
|
403
391
|
),
|
|
404
|
-
/* @__PURE__ */
|
|
392
|
+
/* @__PURE__ */ u.jsx(
|
|
405
393
|
"div",
|
|
406
394
|
{
|
|
407
|
-
className:
|
|
408
|
-
onClick:
|
|
409
|
-
|
|
410
|
-
link:
|
|
395
|
+
className: k.docLinkOperation,
|
|
396
|
+
onClick: () => {
|
|
397
|
+
e.executeCommand(R.id, {
|
|
398
|
+
link: r
|
|
411
399
|
});
|
|
412
|
-
},
|
|
413
|
-
children: /* @__PURE__ */
|
|
400
|
+
},
|
|
401
|
+
children: /* @__PURE__ */ u.jsx(B, { placement: "bottom", title: i.t("docLink.info.edit"), children: /* @__PURE__ */ u.jsx(Ne, {}) })
|
|
414
402
|
}
|
|
415
403
|
),
|
|
416
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ u.jsx(
|
|
417
405
|
"div",
|
|
418
406
|
{
|
|
419
|
-
className:
|
|
420
|
-
onClick:
|
|
421
|
-
|
|
422
|
-
unitId,
|
|
423
|
-
linkId:
|
|
424
|
-
segmentId
|
|
407
|
+
className: k.docLinkOperation,
|
|
408
|
+
onClick: () => {
|
|
409
|
+
e.executeCommand(Ue.id, {
|
|
410
|
+
unitId: s,
|
|
411
|
+
linkId: a.rangeId,
|
|
412
|
+
segmentId: d
|
|
425
413
|
});
|
|
426
|
-
},
|
|
427
|
-
children: /* @__PURE__ */
|
|
414
|
+
},
|
|
415
|
+
children: /* @__PURE__ */ u.jsx(B, { placement: "bottom", title: i.t("docLink.info.cancel"), children: /* @__PURE__ */ u.jsx(De, {}) })
|
|
428
416
|
}
|
|
429
417
|
)
|
|
430
418
|
] })
|
|
431
419
|
]
|
|
432
420
|
}
|
|
433
421
|
);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
var
|
|
437
|
-
for (var
|
|
438
|
-
(
|
|
439
|
-
return
|
|
440
|
-
},
|
|
441
|
-
let
|
|
442
|
-
constructor(
|
|
422
|
+
};
|
|
423
|
+
Y.componentKey = "univer.doc.link-info-popup";
|
|
424
|
+
var st = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, dt = (n, e, t, i) => {
|
|
425
|
+
for (var r = i > 1 ? void 0 : i ? ct(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
426
|
+
(s = n[o]) && (r = (i ? s(e, t, r) : s(r)) || r);
|
|
427
|
+
return i && r && st(e, t, r), r;
|
|
428
|
+
}, Q = (n, e) => (t, i) => e(t, i, n);
|
|
429
|
+
let L = class extends N {
|
|
430
|
+
constructor(e, t, i) {
|
|
443
431
|
super();
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
this._docCanvasPopupManagerService =
|
|
432
|
+
P(this, "_editingLink$", new ve(null));
|
|
433
|
+
P(this, "_showingLink$", new ve(null));
|
|
434
|
+
P(this, "editingLink$", this._editingLink$.asObservable());
|
|
435
|
+
P(this, "showingLink$", this._showingLink$.asObservable());
|
|
436
|
+
P(this, "_editPopup", null);
|
|
437
|
+
P(this, "_infoPopup", null);
|
|
438
|
+
this._docCanvasPopupManagerService = e, this._textSelectionManagerService = t, this._univerInstanceService = i, this.disposeWithMe(() => {
|
|
451
439
|
this._editingLink$.complete(), this._showingLink$.complete();
|
|
452
440
|
});
|
|
453
441
|
}
|
|
@@ -457,94 +445,94 @@ let DocHyperLinkPopupService = (_a = class extends Disposable {
|
|
|
457
445
|
get showing() {
|
|
458
446
|
return this._showingLink$.value;
|
|
459
447
|
}
|
|
460
|
-
showEditPopup(
|
|
461
|
-
this._editPopup && this._editPopup.dispose(), this._editingLink$.next(
|
|
462
|
-
const
|
|
463
|
-
let
|
|
464
|
-
if (
|
|
465
|
-
const { segmentId, segmentPage, startIndex, endIndex } =
|
|
466
|
-
|
|
448
|
+
showEditPopup(e, t) {
|
|
449
|
+
this._editPopup && this._editPopup.dispose(), this._editingLink$.next(t);
|
|
450
|
+
const i = this._textSelectionManagerService.getTextRanges({ unitId: e, subUnitId: e });
|
|
451
|
+
let r = i == null ? void 0 : i[i.length - 1];
|
|
452
|
+
if (t) {
|
|
453
|
+
const { segmentId: o, segmentPage: s, startIndex: c, endIndex: d } = t;
|
|
454
|
+
r = {
|
|
467
455
|
collapsed: !1,
|
|
468
|
-
startOffset:
|
|
469
|
-
endOffset:
|
|
470
|
-
segmentId,
|
|
471
|
-
segmentPage
|
|
456
|
+
startOffset: c,
|
|
457
|
+
endOffset: d + 1,
|
|
458
|
+
segmentId: o,
|
|
459
|
+
segmentPage: s
|
|
472
460
|
}, this._textSelectionManagerService.replaceDocRanges([{
|
|
473
|
-
startOffset:
|
|
474
|
-
endOffset:
|
|
461
|
+
startOffset: c,
|
|
462
|
+
endOffset: d + 1
|
|
475
463
|
}]);
|
|
476
464
|
}
|
|
477
|
-
return
|
|
478
|
-
|
|
465
|
+
return r ? (this._editPopup = this._docCanvasPopupManagerService.attachPopupToRange(
|
|
466
|
+
r,
|
|
479
467
|
{
|
|
480
|
-
componentKey:
|
|
468
|
+
componentKey: V.componentKey,
|
|
481
469
|
direction: "bottom"
|
|
482
470
|
},
|
|
483
|
-
|
|
471
|
+
e
|
|
484
472
|
), this._editPopup) : null;
|
|
485
473
|
}
|
|
486
474
|
hideEditPopup() {
|
|
487
|
-
var
|
|
488
|
-
this._editingLink$.next(null), (
|
|
489
|
-
}
|
|
490
|
-
showInfoPopup(
|
|
491
|
-
var
|
|
492
|
-
const { linkId, unitId, segmentId, segmentPage, startIndex, endIndex } =
|
|
493
|
-
if (!(((
|
|
494
|
-
return this._showingLink$.next({ unitId, linkId, segmentId, segmentPage, startIndex, endIndex }), this._infoPopup = this._docCanvasPopupManagerService.attachPopupToRange(
|
|
475
|
+
var e;
|
|
476
|
+
this._editingLink$.next(null), (e = this._editPopup) == null || e.dispose();
|
|
477
|
+
}
|
|
478
|
+
showInfoPopup(e) {
|
|
479
|
+
var p, l, h, f, a, m;
|
|
480
|
+
const { linkId: t, unitId: i, segmentId: r, segmentPage: o, startIndex: s, endIndex: c } = e;
|
|
481
|
+
if (!(((p = this.showing) == null ? void 0 : p.linkId) === t && ((l = this.showing) == null ? void 0 : l.unitId) === i && ((h = this.showing) == null ? void 0 : h.segmentId) === r && ((f = this.showing) == null ? void 0 : f.segmentPage) === o && ((a = this.showing) == null ? void 0 : a.startIndex) === s && ((m = this.showing) == null ? void 0 : m.endIndex) === c || (this._infoPopup && this._infoPopup.dispose(), !this._univerInstanceService.getUnit(i, I.UNIVER_DOC))))
|
|
482
|
+
return this._showingLink$.next({ unitId: i, linkId: t, segmentId: r, segmentPage: o, startIndex: s, endIndex: c }), this._infoPopup = this._docCanvasPopupManagerService.attachPopupToRange(
|
|
495
483
|
{
|
|
496
484
|
collapsed: !1,
|
|
497
|
-
startOffset:
|
|
498
|
-
endOffset:
|
|
499
|
-
segmentId,
|
|
500
|
-
segmentPage
|
|
485
|
+
startOffset: s,
|
|
486
|
+
endOffset: c + 1,
|
|
487
|
+
segmentId: r,
|
|
488
|
+
segmentPage: o
|
|
501
489
|
},
|
|
502
490
|
{
|
|
503
|
-
componentKey:
|
|
491
|
+
componentKey: Y.componentKey,
|
|
504
492
|
direction: "top-center",
|
|
505
493
|
multipleDirection: "top",
|
|
506
|
-
onClickOutside:
|
|
494
|
+
onClickOutside: () => {
|
|
507
495
|
this.hideInfoPopup();
|
|
508
|
-
}
|
|
496
|
+
}
|
|
509
497
|
},
|
|
510
|
-
|
|
498
|
+
i
|
|
511
499
|
), this._infoPopup;
|
|
512
500
|
}
|
|
513
501
|
hideInfoPopup() {
|
|
514
|
-
var
|
|
515
|
-
this._showingLink$.next(null), (
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
],
|
|
523
|
-
var
|
|
524
|
-
for (var
|
|
525
|
-
(
|
|
526
|
-
return
|
|
527
|
-
},
|
|
528
|
-
let
|
|
529
|
-
constructor(
|
|
530
|
-
super(), this._commandService =
|
|
502
|
+
var e;
|
|
503
|
+
this._showingLink$.next(null), (e = this._infoPopup) == null || e.dispose();
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
L = dt([
|
|
507
|
+
Q(0, v(ln)),
|
|
508
|
+
Q(1, v(b)),
|
|
509
|
+
Q(2, O)
|
|
510
|
+
], L);
|
|
511
|
+
var at = Object.defineProperty, lt = Object.getOwnPropertyDescriptor, ut = (n, e, t, i) => {
|
|
512
|
+
for (var r = i > 1 ? void 0 : i ? lt(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
513
|
+
(s = n[o]) && (r = (i ? s(e, t, r) : s(r)) || r);
|
|
514
|
+
return i && r && at(e, t, r), r;
|
|
515
|
+
}, X = (n, e) => (t, i) => e(t, i, n);
|
|
516
|
+
let Z = class extends N {
|
|
517
|
+
constructor(n, e, t) {
|
|
518
|
+
super(), this._commandService = n, this._univerInstanceService = e, this._docHyperLinkService = t, this._initSelectionChange();
|
|
531
519
|
}
|
|
532
520
|
_initSelectionChange() {
|
|
533
521
|
this.disposeWithMe(
|
|
534
|
-
this._commandService.onCommandExecuted((
|
|
535
|
-
var
|
|
536
|
-
if (
|
|
537
|
-
const
|
|
538
|
-
if (
|
|
539
|
-
const { startOffset, endOffset, collapsed, segmentPage } =
|
|
540
|
-
if (
|
|
541
|
-
const
|
|
542
|
-
if (
|
|
543
|
-
const
|
|
544
|
-
this._docHyperLinkService.showInfoPopup({ unitId, linkId:
|
|
522
|
+
this._commandService.onCommandExecuted((n) => {
|
|
523
|
+
var e, t, i;
|
|
524
|
+
if (n.id === sn.id) {
|
|
525
|
+
const r = n.params, { unitId: o, ranges: s, segmentId: c } = r, d = this._univerInstanceService.getUnit(o, I.UNIVER_DOC), p = s[0];
|
|
526
|
+
if (p && d) {
|
|
527
|
+
const { startOffset: l, endOffset: h, collapsed: f, segmentPage: a } = p, m = (t = (e = d.getSelfOrHeaderFooterModel(c)) == null ? void 0 : e.getBody()) == null ? void 0 : t.customRanges;
|
|
528
|
+
if (f) {
|
|
529
|
+
const C = (i = m == null ? void 0 : m.findIndex((g) => g.startIndex < l && g.endIndex > h - 1)) != null ? i : -1;
|
|
530
|
+
if (C > -1) {
|
|
531
|
+
const g = m[C];
|
|
532
|
+
this._docHyperLinkService.showInfoPopup({ unitId: o, linkId: g.rangeId, segmentId: c, segmentPage: a, startIndex: g.startIndex, endIndex: g.endIndex });
|
|
545
533
|
return;
|
|
546
534
|
}
|
|
547
|
-
} else if (
|
|
535
|
+
} else if (m == null ? void 0 : m.find((g) => g.startIndex <= l && g.endIndex >= h - 1))
|
|
548
536
|
return;
|
|
549
537
|
}
|
|
550
538
|
this._docHyperLinkService.hideInfoPopup(), this._docHyperLinkService.hideEditPopup();
|
|
@@ -552,48 +540,48 @@ let DocHyperLinkSelectionController = (_a2 = class extends Disposable {
|
|
|
552
540
|
})
|
|
553
541
|
);
|
|
554
542
|
}
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
],
|
|
561
|
-
var
|
|
562
|
-
for (var
|
|
563
|
-
(
|
|
564
|
-
return
|
|
565
|
-
},
|
|
566
|
-
let
|
|
567
|
-
constructor(
|
|
568
|
-
super(), this._context =
|
|
543
|
+
};
|
|
544
|
+
Z = ut([
|
|
545
|
+
X(0, x),
|
|
546
|
+
X(1, O),
|
|
547
|
+
X(2, v(L))
|
|
548
|
+
], Z);
|
|
549
|
+
var pt = Object.defineProperty, ft = Object.getOwnPropertyDescriptor, gt = (n, e, t, i) => {
|
|
550
|
+
for (var r = i > 1 ? void 0 : i ? ft(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
551
|
+
(s = n[o]) && (r = (i ? s(e, t, r) : s(r)) || r);
|
|
552
|
+
return i && r && pt(e, t, r), r;
|
|
553
|
+
}, w = (n, e) => (t, i) => e(t, i, n);
|
|
554
|
+
let re = class extends N {
|
|
555
|
+
constructor(n, e, t, i, r, o) {
|
|
556
|
+
super(), this._context = n, this._docEventManagerService = e, this._commandService = t, this._hyperLinkPopupService = i, this._docSkeletonManagerService = r, this._docSelectionManagerService = o, !(this._context.unitId === We || this._context.unitId === Ge) && (this._initHover(), this._initClick());
|
|
569
557
|
}
|
|
570
558
|
get _skeleton() {
|
|
571
559
|
return this._docSkeletonManagerService.getSkeleton();
|
|
572
560
|
}
|
|
573
561
|
_hideInfoPopup() {
|
|
574
562
|
this._hyperLinkPopupService.showing && this._commandService.executeCommand(
|
|
575
|
-
|
|
563
|
+
ie.id
|
|
576
564
|
);
|
|
577
565
|
}
|
|
578
566
|
_initHover() {
|
|
579
567
|
this.disposeWithMe(
|
|
580
|
-
this._docEventManagerService.hoverCustomRanges$.subscribe((
|
|
581
|
-
var
|
|
582
|
-
const
|
|
583
|
-
if (((
|
|
568
|
+
this._docEventManagerService.hoverCustomRanges$.subscribe((n) => {
|
|
569
|
+
var r;
|
|
570
|
+
const e = n.find((o) => o.range.rangeType === D.HYPERLINK), t = this._docSelectionManagerService.getTextRanges(), i = t == null ? void 0 : t[0].segmentId;
|
|
571
|
+
if (((r = e == null ? void 0 : e.segmentId) != null ? r : "") !== i) {
|
|
584
572
|
this._hideInfoPopup();
|
|
585
573
|
return;
|
|
586
574
|
}
|
|
587
|
-
|
|
588
|
-
|
|
575
|
+
e ? this._commandService.executeCommand(
|
|
576
|
+
ie.id,
|
|
589
577
|
{
|
|
590
578
|
unitId: this._context.unitId,
|
|
591
|
-
linkId:
|
|
592
|
-
segmentId:
|
|
593
|
-
segmentPage:
|
|
594
|
-
rangeId:
|
|
595
|
-
startIndex:
|
|
596
|
-
endIndex:
|
|
579
|
+
linkId: e.range.rangeId,
|
|
580
|
+
segmentId: e.segmentId,
|
|
581
|
+
segmentPage: e.segmentPageIndex,
|
|
582
|
+
rangeId: e.range.rangeId,
|
|
583
|
+
startIndex: e.range.startIndex,
|
|
584
|
+
endIndex: e.range.endIndex
|
|
597
585
|
}
|
|
598
586
|
) : this._hideInfoPopup();
|
|
599
587
|
})
|
|
@@ -601,203 +589,202 @@ let DocHyperLinkEventRenderController = (_a3 = class extends Disposable {
|
|
|
601
589
|
}
|
|
602
590
|
_initClick() {
|
|
603
591
|
this.disposeWithMe(
|
|
604
|
-
this._docEventManagerService.clickCustomRanges$.subscribe((
|
|
605
|
-
const
|
|
606
|
-
|
|
607
|
-
|
|
592
|
+
this._docEventManagerService.clickCustomRanges$.subscribe((n) => {
|
|
593
|
+
const e = n.range;
|
|
594
|
+
e && this._commandService.executeCommand(
|
|
595
|
+
Te.id,
|
|
608
596
|
{
|
|
609
597
|
unitId: this._context.unitId,
|
|
610
|
-
linkId:
|
|
611
|
-
segmentId:
|
|
598
|
+
linkId: e.rangeId,
|
|
599
|
+
segmentId: n.segmentId
|
|
612
600
|
}
|
|
613
601
|
);
|
|
614
602
|
})
|
|
615
603
|
);
|
|
616
604
|
}
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
],
|
|
625
|
-
var
|
|
626
|
-
for (var
|
|
627
|
-
(
|
|
628
|
-
return
|
|
629
|
-
},
|
|
630
|
-
let
|
|
631
|
-
constructor(
|
|
632
|
-
super(), this._context =
|
|
605
|
+
};
|
|
606
|
+
re = gt([
|
|
607
|
+
w(1, v(un)),
|
|
608
|
+
w(2, x),
|
|
609
|
+
w(3, v(L)),
|
|
610
|
+
w(4, v(cn)),
|
|
611
|
+
w(5, v(b))
|
|
612
|
+
], re);
|
|
613
|
+
var ht = Object.defineProperty, mt = Object.getOwnPropertyDescriptor, _t = (n, e, t, i) => {
|
|
614
|
+
for (var r = i > 1 ? void 0 : i ? mt(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
615
|
+
(s = n[o]) && (r = (i ? s(e, t, r) : s(r)) || r);
|
|
616
|
+
return i && r && ht(e, t, r), r;
|
|
617
|
+
}, ee = (n, e) => (t, i) => e(t, i, n);
|
|
618
|
+
let oe = class extends N {
|
|
619
|
+
constructor(n, e, t, i) {
|
|
620
|
+
super(), this._context = n, this._docInterceptorService = e, this._hyperLinkService = t, this._docRenderController = i, this._init(), this._initReRender();
|
|
633
621
|
}
|
|
634
622
|
_init() {
|
|
635
|
-
this._docInterceptorService.intercept(
|
|
636
|
-
handler:
|
|
637
|
-
if (!
|
|
638
|
-
return
|
|
639
|
-
const { unitId, index } =
|
|
640
|
-
if (!
|
|
641
|
-
return
|
|
642
|
-
...
|
|
623
|
+
this._docInterceptorService.intercept(an.CUSTOM_RANGE, {
|
|
624
|
+
handler: (n, e, t) => {
|
|
625
|
+
if (!n)
|
|
626
|
+
return t(n);
|
|
627
|
+
const { unitId: i, index: r } = e, o = this._hyperLinkService.showing;
|
|
628
|
+
if (!o)
|
|
629
|
+
return t({
|
|
630
|
+
...n,
|
|
643
631
|
active: !1
|
|
644
632
|
});
|
|
645
|
-
const { linkId, unitId:
|
|
646
|
-
return
|
|
647
|
-
...
|
|
648
|
-
active:
|
|
633
|
+
const { linkId: s, unitId: c, startIndex: d, endIndex: p } = o, l = c === i && n.rangeId === s && r >= d && r <= p;
|
|
634
|
+
return t({
|
|
635
|
+
...n,
|
|
636
|
+
active: l
|
|
649
637
|
});
|
|
650
|
-
}
|
|
638
|
+
}
|
|
651
639
|
});
|
|
652
640
|
}
|
|
653
641
|
_initReRender() {
|
|
654
642
|
this.disposeWithMe(this._hyperLinkService.showingLink$.pipe(
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
).subscribe(([
|
|
658
|
-
|
|
643
|
+
gn((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)),
|
|
644
|
+
hn()
|
|
645
|
+
).subscribe(([n, e]) => {
|
|
646
|
+
e ? e.unitId === this._context.unitId && this._docRenderController.reRender(e.unitId) : n && n.unitId === this._context.unitId && this._docRenderController.reRender(n.unitId);
|
|
659
647
|
}));
|
|
660
648
|
}
|
|
661
|
-
}
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
],
|
|
667
|
-
const
|
|
668
|
-
function
|
|
649
|
+
};
|
|
650
|
+
oe = _t([
|
|
651
|
+
ee(1, v(dn)),
|
|
652
|
+
ee(2, v(L)),
|
|
653
|
+
ee(3, v(pn))
|
|
654
|
+
], oe);
|
|
655
|
+
const He = "doc-hyper-link-icon";
|
|
656
|
+
function Oe(n) {
|
|
669
657
|
return {
|
|
670
|
-
id:
|
|
671
|
-
type:
|
|
672
|
-
icon:
|
|
658
|
+
id: R.id,
|
|
659
|
+
type: xn.BUTTON,
|
|
660
|
+
icon: He,
|
|
673
661
|
title: "docLink.menu.tooltip",
|
|
674
662
|
tooltip: "docLink.menu.tooltip",
|
|
675
|
-
hidden$:
|
|
676
|
-
disabled$: new
|
|
677
|
-
const
|
|
678
|
-
|
|
663
|
+
hidden$: On(n, I.UNIVER_DOC),
|
|
664
|
+
disabled$: new mn(function(e) {
|
|
665
|
+
const i = n.get(b).textSelection$.pipe(_n(16)).subscribe(() => {
|
|
666
|
+
e.next($e(n));
|
|
679
667
|
});
|
|
680
668
|
return () => {
|
|
681
|
-
|
|
669
|
+
i.unsubscribe();
|
|
682
670
|
};
|
|
683
671
|
})
|
|
684
672
|
};
|
|
685
673
|
}
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
binding: MetaKeys.CTRL_COMMAND | KeyCode.K,
|
|
674
|
+
const vt = {
|
|
675
|
+
id: R.id,
|
|
676
|
+
binding: kn.CTRL_COMMAND | te.K,
|
|
690
677
|
description: "docLink.menu.tooltip",
|
|
691
|
-
preconditions:
|
|
692
|
-
},
|
|
693
|
-
[
|
|
694
|
-
[
|
|
678
|
+
preconditions: fn
|
|
679
|
+
}, It = {
|
|
680
|
+
[Pn.OTHERS]: {
|
|
681
|
+
[R.id]: {
|
|
695
682
|
order: 0,
|
|
696
|
-
menuItemFactory:
|
|
683
|
+
menuItemFactory: Oe
|
|
697
684
|
}
|
|
698
685
|
},
|
|
699
|
-
[
|
|
700
|
-
[
|
|
701
|
-
[
|
|
686
|
+
[Rn.MAIN_AREA]: {
|
|
687
|
+
[En.DATA]: {
|
|
688
|
+
[R.id]: {
|
|
702
689
|
order: 0,
|
|
703
|
-
menuItemFactory:
|
|
690
|
+
menuItemFactory: Oe
|
|
704
691
|
}
|
|
705
692
|
}
|
|
706
693
|
}
|
|
707
694
|
};
|
|
708
|
-
var
|
|
709
|
-
for (var
|
|
710
|
-
(
|
|
711
|
-
return
|
|
712
|
-
},
|
|
713
|
-
let
|
|
714
|
-
constructor(
|
|
715
|
-
super(), this._componentManager =
|
|
695
|
+
var Ct = Object.defineProperty, St = Object.getOwnPropertyDescriptor, Lt = (n, e, t, i) => {
|
|
696
|
+
for (var r = i > 1 ? void 0 : i ? St(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
697
|
+
(s = n[o]) && (r = (i ? s(e, t, r) : s(r)) || r);
|
|
698
|
+
return i && r && Ct(e, t, r), r;
|
|
699
|
+
}, F = (n, e) => (t, i) => e(t, i, n);
|
|
700
|
+
let W = class extends N {
|
|
701
|
+
constructor(n, e, t, i) {
|
|
702
|
+
super(), this._componentManager = n, this._commandService = e, this._menuManagerService = t, this._shortcutService = i, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortcut();
|
|
716
703
|
}
|
|
717
704
|
_initComponents() {
|
|
718
705
|
[
|
|
719
|
-
[
|
|
720
|
-
[
|
|
721
|
-
[
|
|
722
|
-
].forEach(([
|
|
723
|
-
this._componentManager.register(
|
|
706
|
+
[V, V.componentKey],
|
|
707
|
+
[Y, Y.componentKey],
|
|
708
|
+
[se, He]
|
|
709
|
+
].forEach(([n, e]) => {
|
|
710
|
+
this._componentManager.register(e, n);
|
|
724
711
|
});
|
|
725
712
|
}
|
|
726
713
|
_initCommands() {
|
|
727
714
|
[
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
].forEach((
|
|
735
|
-
this._commandService.registerCommand(
|
|
715
|
+
Ee,
|
|
716
|
+
be,
|
|
717
|
+
Ue,
|
|
718
|
+
R,
|
|
719
|
+
ie,
|
|
720
|
+
Te
|
|
721
|
+
].forEach((n) => {
|
|
722
|
+
this._commandService.registerCommand(n);
|
|
736
723
|
});
|
|
737
724
|
}
|
|
738
725
|
_initShortcut() {
|
|
739
|
-
[
|
|
740
|
-
this._shortcutService.registerShortcut(
|
|
726
|
+
[vt].forEach((n) => {
|
|
727
|
+
this._shortcutService.registerShortcut(n);
|
|
741
728
|
});
|
|
742
729
|
}
|
|
743
730
|
_initMenus() {
|
|
744
|
-
this._menuManagerService.mergeMenu(
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
],
|
|
753
|
-
const
|
|
754
|
-
var
|
|
755
|
-
for (var
|
|
756
|
-
(
|
|
757
|
-
return
|
|
758
|
-
},
|
|
759
|
-
let
|
|
760
|
-
constructor(
|
|
761
|
-
super(), this._config =
|
|
762
|
-
const { menu, ...
|
|
731
|
+
this._menuManagerService.mergeMenu(It);
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
W = Lt([
|
|
735
|
+
F(0, v(bn)),
|
|
736
|
+
F(1, x),
|
|
737
|
+
F(2, Mn),
|
|
738
|
+
F(3, wn)
|
|
739
|
+
], W);
|
|
740
|
+
const yt = "DOC_HYPER_LINK_UI_PLUGIN";
|
|
741
|
+
var Ae = Object.defineProperty, kt = Object.getOwnPropertyDescriptor, xt = (n, e, t) => e in n ? Ae(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Ot = (n, e, t, i) => {
|
|
742
|
+
for (var r = i > 1 ? void 0 : i ? kt(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
743
|
+
(s = n[o]) && (r = (i ? s(e, t, r) : s(r)) || r);
|
|
744
|
+
return i && r && Ae(e, t, r), r;
|
|
745
|
+
}, ne = (n, e) => (t, i) => e(t, i, n), Be = (n, e, t) => xt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
746
|
+
let G = class extends ze {
|
|
747
|
+
constructor(n = Le, e, t, i) {
|
|
748
|
+
super(), this._config = n, this._injector = e, this._renderManagerSrv = t, this._configService = i;
|
|
749
|
+
const { menu: r, ...o } = Qe(
|
|
763
750
|
{},
|
|
764
|
-
|
|
751
|
+
Le,
|
|
765
752
|
this._config
|
|
766
753
|
);
|
|
767
|
-
|
|
754
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Dn, o);
|
|
768
755
|
}
|
|
769
756
|
onStarting() {
|
|
770
757
|
[
|
|
771
|
-
[
|
|
772
|
-
[
|
|
773
|
-
[
|
|
774
|
-
].forEach((
|
|
775
|
-
this._injector.add(
|
|
776
|
-
}), this._injector.get(
|
|
758
|
+
[L],
|
|
759
|
+
[W],
|
|
760
|
+
[Z]
|
|
761
|
+
].forEach((e) => {
|
|
762
|
+
this._injector.add(e);
|
|
763
|
+
}), this._injector.get(W);
|
|
777
764
|
}
|
|
778
765
|
onReady() {
|
|
779
|
-
this._injector.get(
|
|
766
|
+
this._injector.get(Z);
|
|
780
767
|
}
|
|
781
768
|
onRendered() {
|
|
782
769
|
this._initRenderModule();
|
|
783
770
|
}
|
|
784
771
|
_initRenderModule() {
|
|
785
772
|
[
|
|
786
|
-
[
|
|
787
|
-
[
|
|
788
|
-
].forEach((
|
|
789
|
-
this._renderManagerSrv.registerRenderModule(
|
|
773
|
+
[oe],
|
|
774
|
+
[re]
|
|
775
|
+
].forEach((n) => {
|
|
776
|
+
this._renderManagerSrv.registerRenderModule(I.UNIVER_DOC, n);
|
|
790
777
|
});
|
|
791
778
|
}
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
],
|
|
779
|
+
};
|
|
780
|
+
Be(G, "pluginName", yt);
|
|
781
|
+
Be(G, "type", I.UNIVER_DOC);
|
|
782
|
+
G = Ot([
|
|
783
|
+
qe(en),
|
|
784
|
+
ne(1, v(Je)),
|
|
785
|
+
ne(2, nn),
|
|
786
|
+
ne(3, Xe)
|
|
787
|
+
], G);
|
|
801
788
|
export {
|
|
802
|
-
UniverDocsHyperLinkUIPlugin
|
|
789
|
+
G as UniverDocsHyperLinkUIPlugin
|
|
803
790
|
};
|