@univerjs/docs-hyper-link-ui 0.10.12 → 0.10.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/es/index.js +363 -267
- package/lib/es/locale/ru-RU.js +3 -3
- package/lib/index.js +363 -267
- package/lib/locale/ru-RU.js +3 -3
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/package.json +10 -10
package/lib/es/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { CommandType as
|
|
5
|
-
import { UniverDocsHyperLinkPlugin as
|
|
6
|
-
import { IRenderManagerService as
|
|
7
|
-
import { addCustomRangeBySelectionFactory as
|
|
8
|
-
import { DocCanvasPopManagerService as
|
|
9
|
-
import { BehaviorSubject as
|
|
10
|
-
import { jsxs as
|
|
11
|
-
import { clsx as
|
|
12
|
-
import { useDependency as
|
|
13
|
-
import { useState as
|
|
14
|
-
const
|
|
15
|
-
type:
|
|
1
|
+
var Ue = Object.defineProperty;
|
|
2
|
+
var Te = (n, e, t) => e in n ? Ue(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var L = (n, e, t) => Te(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { CommandType as P, ICommandService as x, generateRandomId as He, CustomRangeType as b, IUniverInstanceService as k, UniverInstanceType as I, getBodySlice as Ce, LocaleService as Se, Tools as je, BuildTextUtils as ge, Inject as m, Disposable as D, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Ae, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ke, DependentOn as Fe, Injector as Be, IConfigService as Ve, Plugin as Ze, merge as Ye } from "@univerjs/core";
|
|
5
|
+
import { UniverDocsHyperLinkPlugin as We } from "@univerjs/docs-hyper-link";
|
|
6
|
+
import { IRenderManagerService as Ge } from "@univerjs/engine-render";
|
|
7
|
+
import { addCustomRangeBySelectionFactory as ze, DocSelectionManagerService as R, replaceSelectionFactory as qe, deleteCustomRangeFactory as Je, SetTextSelectionsOperation as Qe, DocSkeletonManagerService as Xe, DocInterceptorService as en, DOC_INTERCEPTOR_POINT as nn } from "@univerjs/docs";
|
|
8
|
+
import { DocCanvasPopManagerService as tn, DocEventManagerService as rn, DocRenderController as on, whenDocAndEditorFocused as sn } from "@univerjs/docs-ui";
|
|
9
|
+
import { BehaviorSubject as he, distinctUntilChanged as cn, pairwise as dn, Observable as an, debounceTime as ln } from "rxjs";
|
|
10
|
+
import { jsxs as O, jsx as h } from "react/jsx-runtime";
|
|
11
|
+
import { clsx as ye, FormLayout as ve, Input as fe, Button as me, borderClassName as xe, Tooltip as H, MessageType as un } from "@univerjs/design";
|
|
12
|
+
import { useDependency as C, useObservable as ke, KeyCode as Q, IMessageService as pn, MetaKeys as gn, getMenuHiddenObservable as hn, MenuItemType as vn, ContextMenuPosition as fn, ContextMenuGroup as mn, RibbonInsertGroup as In, ComponentManager as _n, IMenuManagerService as Cn, IShortcutService as Sn } from "@univerjs/ui";
|
|
13
|
+
import { useState as W, useEffect as yn, useRef as xn, createElement as E, forwardRef as Z } from "react";
|
|
14
|
+
const kn = "docs-hyper-link-ui.config", Ie = {}, Le = {
|
|
15
|
+
type: P.COMMAND,
|
|
16
16
|
id: "docs.command.add-hyper-link",
|
|
17
17
|
async handler(n, e) {
|
|
18
18
|
if (!e)
|
|
19
19
|
return !1;
|
|
20
|
-
const { payload: t, unitId: i, selections: r } = e, o = n.get(
|
|
20
|
+
const { payload: t, unitId: i, selections: r } = e, o = n.get(x), s = He(), c = ze(
|
|
21
21
|
n,
|
|
22
22
|
{
|
|
23
23
|
rangeId: s,
|
|
24
|
-
rangeType:
|
|
24
|
+
rangeType: b.HYPERLINK,
|
|
25
25
|
properties: {
|
|
26
26
|
url: t
|
|
27
27
|
},
|
|
@@ -31,25 +31,25 @@ const Ln = "docs-hyper-link-ui.config", _e = {}, Oe = {
|
|
|
31
31
|
);
|
|
32
32
|
return c ? o.syncExecuteCommand(c.id, c.params) : !1;
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, Oe = {
|
|
35
35
|
id: "docs.command.update-hyper-link",
|
|
36
|
-
type:
|
|
36
|
+
type: P.COMMAND,
|
|
37
37
|
handler(n, e) {
|
|
38
38
|
var p;
|
|
39
39
|
if (!e)
|
|
40
40
|
return !1;
|
|
41
|
-
const { unitId: t, payload: i, segmentId: r, linkId: o } = e, s = n.get(
|
|
41
|
+
const { unitId: t, payload: i, segmentId: r, linkId: o } = e, s = n.get(x), c = n.get(k), u = n.get(R).getActiveTextRange(), v = c.getUnit(t, I.UNIVER_DOC);
|
|
42
42
|
if (!u || !v)
|
|
43
43
|
return !1;
|
|
44
|
-
const g = (p =
|
|
44
|
+
const g = (p = Ce(v.getSelfOrHeaderFooterModel(r).getBody(), u.startOffset, u.endOffset).textRuns) == null ? void 0 : p[0];
|
|
45
45
|
g && (g.ed = e.label.length + 1);
|
|
46
|
-
const d =
|
|
46
|
+
const d = qe(n, {
|
|
47
47
|
unitId: t,
|
|
48
48
|
body: {
|
|
49
49
|
dataStream: `${e.label}`,
|
|
50
50
|
customRanges: [{
|
|
51
51
|
rangeId: o,
|
|
52
|
-
rangeType:
|
|
52
|
+
rangeType: b.HYPERLINK,
|
|
53
53
|
startIndex: 0,
|
|
54
54
|
endIndex: e.label.length + 1,
|
|
55
55
|
properties: {
|
|
@@ -68,45 +68,45 @@ const Ln = "docs-hyper-link-ui.config", _e = {}, Oe = {
|
|
|
68
68
|
return d ? s.syncExecuteCommand(d.id, d.params) : !1;
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
function
|
|
71
|
+
function Ln(n) {
|
|
72
72
|
return /^[a-zA-Z]+:\/\//.test(n);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function On(n) {
|
|
75
75
|
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(n);
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return
|
|
77
|
+
function wn(n) {
|
|
78
|
+
return Ln(n) ? n : On(n) ? `mailto://${n}` : `https://${n}`;
|
|
79
79
|
}
|
|
80
|
-
const
|
|
81
|
-
const n =
|
|
82
|
-
|
|
83
|
-
var oe, se, ce, de, ae, le, ue, pe
|
|
80
|
+
const A = () => {
|
|
81
|
+
const n = C(S), e = C(Se), t = ke(n.editingLink$), i = C(x), r = C(k), o = C(R), [s, c] = W(""), [l, u] = W(""), [v, f] = W(!1), g = je.isLegalUrl(s), d = t ? r.getUnit(t.unitId, I.UNIVER_DOC) : r.getCurrentUnitForType(I.UNIVER_DOC);
|
|
82
|
+
yn(() => {
|
|
83
|
+
var re, oe, se, ce, de, ae, le, ue, pe;
|
|
84
84
|
const a = o.getActiveTextRange();
|
|
85
85
|
if (!a)
|
|
86
86
|
return;
|
|
87
87
|
if (t) {
|
|
88
|
-
const
|
|
89
|
-
d &&
|
|
88
|
+
const U = (re = d == null ? void 0 : d.getSelfOrHeaderFooterModel(t.segmentId)) == null ? void 0 : re.getBody(), T = (oe = U == null ? void 0 : U.customRanges) == null ? void 0 : oe.find((Y) => (t == null ? void 0 : t.linkId) === Y.rangeId && Y.startIndex === t.startIndex && Y.endIndex === t.endIndex);
|
|
89
|
+
d && T && (c((ce = (se = T.properties) == null ? void 0 : se.url) != null ? ce : ""), u(ge.transform.getPlainText(Ce(U, T.startIndex, T.endIndex + 1).dataStream)));
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
const
|
|
93
|
-
d &&
|
|
92
|
+
const y = (de = d == null ? void 0 : d.getSelfOrHeaderFooterModel(a.segmentId)) == null ? void 0 : de.getBody(), ie = y ? a : null, $ = ie && ((le = ge.customRange.getCustomRangesInterestsWithSelection(ie, (ae = y == null ? void 0 : y.customRanges) != null ? ae : [])) == null ? void 0 : le[0]);
|
|
93
|
+
d && $ && c((pe = (ue = $ == null ? void 0 : $.properties) == null ? void 0 : ue.url) != null ? pe : "");
|
|
94
94
|
}, [d, t, o, r]);
|
|
95
95
|
const p = () => {
|
|
96
96
|
n.hideEditPopup();
|
|
97
|
-
},
|
|
97
|
+
}, _ = () => {
|
|
98
98
|
if (f(!0), !g || !d)
|
|
99
99
|
return;
|
|
100
|
-
const a =
|
|
100
|
+
const a = wn(s);
|
|
101
101
|
if (!t)
|
|
102
|
-
i.executeCommand(
|
|
102
|
+
i.executeCommand(Le.id, {
|
|
103
103
|
unitId: d.getUnitId(),
|
|
104
104
|
payload: a
|
|
105
105
|
});
|
|
106
106
|
else {
|
|
107
107
|
if (!l)
|
|
108
108
|
return;
|
|
109
|
-
i.executeCommand(
|
|
109
|
+
i.executeCommand(Oe.id, {
|
|
110
110
|
unitId: d.getUnitId(),
|
|
111
111
|
payload: a,
|
|
112
112
|
linkId: t.linkId,
|
|
@@ -117,57 +117,57 @@ const F = () => {
|
|
|
117
117
|
n.hideEditPopup();
|
|
118
118
|
};
|
|
119
119
|
if (d)
|
|
120
|
-
return /* @__PURE__ */
|
|
120
|
+
return /* @__PURE__ */ O(
|
|
121
121
|
"div",
|
|
122
122
|
{
|
|
123
|
-
className:
|
|
123
|
+
className: ye("univer-box-border univer-w-[328px] univer-rounded-xl univer-bg-white univer-px-6 univer-py-5 univer-shadow dark:!univer-bg-gray-900", xe),
|
|
124
124
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ O("div", { children: [
|
|
126
126
|
t ? /* @__PURE__ */ h(
|
|
127
|
-
|
|
127
|
+
ve,
|
|
128
128
|
{
|
|
129
129
|
label: e.t("docLink.edit.label"),
|
|
130
130
|
error: v && !l ? e.t("docLink.edit.labelError") : "",
|
|
131
131
|
children: /* @__PURE__ */ h(
|
|
132
|
-
|
|
132
|
+
fe,
|
|
133
133
|
{
|
|
134
134
|
value: l,
|
|
135
135
|
onChange: u,
|
|
136
136
|
autoFocus: !0,
|
|
137
137
|
onKeyDown: (a) => {
|
|
138
|
-
a.keyCode ===
|
|
138
|
+
a.keyCode === Q.ENTER && _();
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
)
|
|
142
142
|
}
|
|
143
143
|
) : null,
|
|
144
144
|
/* @__PURE__ */ h(
|
|
145
|
-
|
|
145
|
+
ve,
|
|
146
146
|
{
|
|
147
147
|
label: e.t("docLink.edit.address"),
|
|
148
148
|
error: v && !g ? e.t("docLink.edit.addressError") : "",
|
|
149
149
|
children: /* @__PURE__ */ h(
|
|
150
|
-
|
|
150
|
+
fe,
|
|
151
151
|
{
|
|
152
152
|
value: s,
|
|
153
153
|
onChange: c,
|
|
154
154
|
autoFocus: !0,
|
|
155
155
|
onKeyDown: (a) => {
|
|
156
|
-
a.keyCode ===
|
|
156
|
+
a.keyCode === Q.ENTER && _();
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
)
|
|
160
160
|
}
|
|
161
161
|
)
|
|
162
162
|
] }),
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
/* @__PURE__ */ h(
|
|
163
|
+
/* @__PURE__ */ O("div", { className: "univer-flex univer-justify-end univer-gap-3", children: [
|
|
164
|
+
/* @__PURE__ */ h(me, { onClick: p, children: e.t("docLink.edit.cancel") }),
|
|
165
165
|
/* @__PURE__ */ h(
|
|
166
|
-
|
|
166
|
+
me,
|
|
167
167
|
{
|
|
168
168
|
variant: "primary",
|
|
169
169
|
disabled: !s,
|
|
170
|
-
onClick:
|
|
170
|
+
onClick: _,
|
|
171
171
|
children: e.t("docLink.edit.confirm")
|
|
172
172
|
}
|
|
173
173
|
)
|
|
@@ -176,146 +176,242 @@ const F = () => {
|
|
|
176
176
|
}
|
|
177
177
|
);
|
|
178
178
|
};
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
|
|
191
|
-
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
192
|
-
for (var r = 0, i = Object.getOwnPropertySymbols(n); r < i.length; r++)
|
|
193
|
-
e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[r]) && (t[i[r]] = n[i[r]]);
|
|
194
|
-
return t;
|
|
195
|
-
}, $ = N(function(n, e) {
|
|
196
|
-
var t = n.icon, i = n.id, r = n.className, o = n.extend, s = bn(n, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), l = kn("_".concat(Dn()));
|
|
197
|
-
return Pe(t, "".concat(i), { defIds: t.defIds, idSuffix: l.current }, m({ ref: e, className: c }, s), o);
|
|
198
|
-
});
|
|
199
|
-
function Pe(n, e, t, i, r) {
|
|
200
|
-
return U(n.tag, m(m({ key: e }, Rn(n, t, r)), i), (Mn(n, t).children || []).map(function(o, s) {
|
|
201
|
-
return Pe(o, "".concat(e, "-").concat(n.tag, "-").concat(s), t, void 0, r);
|
|
202
|
-
}));
|
|
179
|
+
A.componentKey = "docs-hyper-link-edit";
|
|
180
|
+
function N({ ref: n, ...e }) {
|
|
181
|
+
const { icon: t, id: i, className: r, extend: o, ...s } = e, c = `univerjs-icon univerjs-icon-${i} ${r || ""}`.trim(), l = xn(`_${Mn()}`);
|
|
182
|
+
return we(t, `${i}`, {
|
|
183
|
+
defIds: t.defIds,
|
|
184
|
+
idSuffix: l.current
|
|
185
|
+
}, {
|
|
186
|
+
ref: n,
|
|
187
|
+
className: c,
|
|
188
|
+
...s
|
|
189
|
+
}, o);
|
|
203
190
|
}
|
|
204
|
-
function
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
191
|
+
function we(n, e, t, i, r) {
|
|
192
|
+
return E(n.tag, {
|
|
193
|
+
key: e,
|
|
194
|
+
...Pn(n, t, r),
|
|
195
|
+
...i
|
|
196
|
+
}, (Rn(n, t).children || []).map((o, s) => we(o, `${e}-${n.tag}-${s}`, t, void 0, r)));
|
|
197
|
+
}
|
|
198
|
+
function Pn(n, e, t) {
|
|
199
|
+
const i = { ...n.attrs };
|
|
200
|
+
t != null && t.colorChannel1 && i.fill === "colorChannel1" && (i.fill = t.colorChannel1), n.tag === "mask" && i.id && (i.id = i.id + e.idSuffix), Object.entries(i).forEach(([o, s]) => {
|
|
201
|
+
o === "mask" && typeof s == "string" && (i[o] = s.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
|
|
209
202
|
});
|
|
210
|
-
|
|
211
|
-
return !r || r.length === 0 || (n.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(
|
|
212
|
-
|
|
213
|
-
typeof c == "string" && (i[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
203
|
+
const { defIds: r } = e;
|
|
204
|
+
return !r || r.length === 0 || (n.tag === "use" && i["xlink:href"] && (i["xlink:href"] = i["xlink:href"] + e.idSuffix), Object.entries(i).forEach(([o, s]) => {
|
|
205
|
+
typeof s == "string" && (i[o] = s.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
|
|
214
206
|
})), i;
|
|
215
207
|
}
|
|
216
|
-
function
|
|
217
|
-
var
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
208
|
+
function Rn(n, e) {
|
|
209
|
+
var i;
|
|
210
|
+
const { defIds: t } = e;
|
|
211
|
+
return !t || t.length === 0 ? n : n.tag === "defs" && ((i = n.children) != null && i.length) ? {
|
|
212
|
+
...n,
|
|
213
|
+
children: n.children.map((r) => typeof r.attrs.id == "string" && t && t.includes(r.attrs.id) ? {
|
|
214
|
+
...r,
|
|
215
|
+
attrs: {
|
|
216
|
+
...r.attrs,
|
|
217
|
+
id: r.attrs.id + e.idSuffix
|
|
218
|
+
}
|
|
219
|
+
} : r)
|
|
220
|
+
} : n;
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function Mn() {
|
|
223
223
|
return Math.random().toString(36).substring(2, 8);
|
|
224
224
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
225
|
+
N.displayName = "UniverIcon";
|
|
226
|
+
const bn = {
|
|
227
|
+
tag: "svg",
|
|
228
|
+
attrs: {
|
|
229
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
230
|
+
fill: "none",
|
|
231
|
+
viewBox: "0 0 16 16",
|
|
232
|
+
width: "1em",
|
|
233
|
+
height: "1em"
|
|
234
|
+
},
|
|
235
|
+
children: [{
|
|
236
|
+
tag: "path",
|
|
237
|
+
attrs: {
|
|
238
|
+
fill: "currentColor",
|
|
239
|
+
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",
|
|
240
|
+
fillRule: "evenodd",
|
|
241
|
+
clipRule: "evenodd"
|
|
242
|
+
}
|
|
243
|
+
}]
|
|
244
|
+
}, Pe = Z(function(e, t) {
|
|
245
|
+
return E(N, Object.assign({}, e, {
|
|
228
246
|
id: "copy-icon",
|
|
229
|
-
ref:
|
|
230
|
-
icon:
|
|
247
|
+
ref: t,
|
|
248
|
+
icon: bn
|
|
231
249
|
}));
|
|
232
250
|
});
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
251
|
+
Pe.displayName = "CopyIcon";
|
|
252
|
+
const Dn = {
|
|
253
|
+
tag: "svg",
|
|
254
|
+
attrs: {
|
|
255
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
256
|
+
fill: "none",
|
|
257
|
+
viewBox: "0 0 16 16",
|
|
258
|
+
width: "1em",
|
|
259
|
+
height: "1em"
|
|
260
|
+
},
|
|
261
|
+
children: [{
|
|
262
|
+
tag: "path",
|
|
263
|
+
attrs: {
|
|
264
|
+
fill: "currentColor",
|
|
265
|
+
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"
|
|
266
|
+
}
|
|
267
|
+
}, {
|
|
268
|
+
tag: "path",
|
|
269
|
+
attrs: {
|
|
270
|
+
fill: "currentColor",
|
|
271
|
+
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"
|
|
272
|
+
}
|
|
273
|
+
}]
|
|
274
|
+
}, te = Z(function(e, t) {
|
|
275
|
+
return E(N, Object.assign({}, e, {
|
|
236
276
|
id: "link-icon",
|
|
237
|
-
ref:
|
|
238
|
-
icon:
|
|
277
|
+
ref: t,
|
|
278
|
+
icon: Dn
|
|
239
279
|
}));
|
|
240
280
|
});
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
281
|
+
te.displayName = "LinkIcon";
|
|
282
|
+
const En = {
|
|
283
|
+
tag: "svg",
|
|
284
|
+
attrs: {
|
|
285
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
286
|
+
fill: "none",
|
|
287
|
+
viewBox: "0 0 16 17",
|
|
288
|
+
width: "1em",
|
|
289
|
+
height: "1em"
|
|
290
|
+
},
|
|
291
|
+
children: [
|
|
292
|
+
{
|
|
293
|
+
tag: "path",
|
|
294
|
+
attrs: {
|
|
295
|
+
fill: "currentColor",
|
|
296
|
+
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.76157C6.75249 4.52725 6.75249 4.14735 6.98681 3.91304L8.27535 2.62449C9.70209 1.19776 12.0153 1.19776 13.442 2.62449C14.8688 4.05123 14.8688 6.36442 13.442 7.79116L12.1535 9.0797C11.9192 9.31402 11.5393 9.31402 11.3049 9.0797C11.0706 8.84539 11.0706 8.46549 11.3049 8.23117L12.5935 6.94263C13.5516 5.98452 13.5516 4.43113 12.5935 3.47302Z"
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
tag: "path",
|
|
301
|
+
attrs: {
|
|
302
|
+
fill: "currentColor",
|
|
303
|
+
d: "M3.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.05395C4.4606 6.81963 4.0807 6.81963 3.84639 7.05395L2.55784 8.34249C1.13111 9.76923 1.13111 12.0824 2.55784 13.5092C3.98458 14.9359 6.29777 14.9359 7.72451 13.5092L9.01305 12.2206C9.24737 11.9863 9.24737 11.6064 9.01305 11.3721C8.77874 11.1378 8.39884 11.1378 8.16452 11.3721L6.87598 12.6606C5.91787 13.6187 4.36448 13.6187 3.40637 12.6606Z"
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
tag: "path",
|
|
308
|
+
attrs: {
|
|
309
|
+
fill: "currentColor",
|
|
310
|
+
d: "M3.5852 2.80332C3.35088 2.569 2.97098 2.569 2.73667 2.80332C2.50235 3.03763 2.50235 3.41753 2.73667 3.65185L12.4151 13.3302C12.6494 13.5646 13.0293 13.5646 13.2636 13.3302C13.4979 13.0959 13.4979 12.716 13.2636 12.4817L3.5852 2.80332Z"
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
]
|
|
314
|
+
}, Re = Z(function(e, t) {
|
|
315
|
+
return E(N, Object.assign({}, e, {
|
|
244
316
|
id: "unlink-icon",
|
|
245
|
-
ref:
|
|
246
|
-
icon:
|
|
317
|
+
ref: t,
|
|
318
|
+
icon: En
|
|
247
319
|
}));
|
|
248
320
|
});
|
|
249
321
|
Re.displayName = "UnlinkIcon";
|
|
250
|
-
|
|
251
|
-
|
|
322
|
+
const Nn = {
|
|
323
|
+
tag: "svg",
|
|
324
|
+
attrs: {
|
|
325
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
326
|
+
fill: "none",
|
|
327
|
+
viewBox: "0 0 17 16",
|
|
328
|
+
width: "1em",
|
|
329
|
+
height: "1em"
|
|
330
|
+
},
|
|
331
|
+
children: [{
|
|
332
|
+
tag: "path",
|
|
333
|
+
attrs: {
|
|
334
|
+
fill: "currentColor",
|
|
335
|
+
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",
|
|
336
|
+
fillRule: "evenodd",
|
|
337
|
+
clipRule: "evenodd"
|
|
338
|
+
}
|
|
339
|
+
}, {
|
|
340
|
+
tag: "path",
|
|
341
|
+
attrs: {
|
|
342
|
+
fill: "currentColor",
|
|
343
|
+
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"
|
|
344
|
+
}
|
|
345
|
+
}]
|
|
346
|
+
}, Me = Z(function(e, t) {
|
|
347
|
+
return E(N, Object.assign({}, e, {
|
|
252
348
|
id: "write-icon",
|
|
253
|
-
ref:
|
|
254
|
-
icon:
|
|
349
|
+
ref: t,
|
|
350
|
+
icon: Nn
|
|
255
351
|
}));
|
|
256
352
|
});
|
|
257
353
|
Me.displayName = "WriteIcon";
|
|
258
|
-
const
|
|
259
|
-
type:
|
|
354
|
+
const be = {
|
|
355
|
+
type: P.COMMAND,
|
|
260
356
|
id: "docs.command.delete-hyper-link",
|
|
261
357
|
async handler(n, e) {
|
|
262
358
|
if (!e)
|
|
263
359
|
return !1;
|
|
264
|
-
const { unitId: t, linkId: i, segmentId: r } = e, o = n.get(
|
|
360
|
+
const { unitId: t, linkId: i, segmentId: r } = e, o = n.get(x), s = Je(n, { unitId: t, rangeId: i, segmentId: r });
|
|
265
361
|
return s ? await o.syncExecuteCommand(s.id, s.params) : !1;
|
|
266
362
|
}
|
|
267
|
-
},
|
|
268
|
-
const e = n.get(R), t = n.get(
|
|
363
|
+
}, De = (n) => {
|
|
364
|
+
const e = n.get(R), t = n.get(k), i = e.getTextRanges();
|
|
269
365
|
if (!(i != null && i.length))
|
|
270
366
|
return !0;
|
|
271
367
|
const r = i[0];
|
|
272
|
-
return !!(!t.getCurrentUnitForType(
|
|
273
|
-
},
|
|
274
|
-
type:
|
|
368
|
+
return !!(!t.getCurrentUnitForType(I.UNIVER_DOC) || !r || r.collapsed);
|
|
369
|
+
}, w = {
|
|
370
|
+
type: P.OPERATION,
|
|
275
371
|
id: "doc.operation.show-hyper-link-edit-popup",
|
|
276
372
|
handler(n, e) {
|
|
277
373
|
var s;
|
|
278
|
-
const t = e == null ? void 0 : e.link, i = n.get(
|
|
279
|
-
if (
|
|
374
|
+
const t = e == null ? void 0 : e.link, i = n.get(k);
|
|
375
|
+
if (De(n) && !t)
|
|
280
376
|
return !1;
|
|
281
|
-
const r = n.get(S), o = (t == null ? void 0 : t.unitId) || ((s = i.getCurrentUnitForType(
|
|
377
|
+
const r = n.get(S), o = (t == null ? void 0 : t.unitId) || ((s = i.getCurrentUnitForType(I.UNIVER_DOC)) == null ? void 0 : s.getUnitId());
|
|
282
378
|
return o ? (r.showEditPopup(o, t), !0) : !1;
|
|
283
379
|
}
|
|
284
|
-
},
|
|
285
|
-
type:
|
|
380
|
+
}, X = {
|
|
381
|
+
type: P.OPERATION,
|
|
286
382
|
id: "doc.operation.toggle-hyper-link-info-popup",
|
|
287
383
|
handler(n, e) {
|
|
288
384
|
const t = n.get(S);
|
|
289
385
|
return e ? (t.showInfoPopup(e), !0) : (t.hideInfoPopup(), !0);
|
|
290
386
|
}
|
|
291
|
-
},
|
|
292
|
-
type:
|
|
387
|
+
}, Ee = {
|
|
388
|
+
type: P.OPERATION,
|
|
293
389
|
id: "doc.operation.click-hyper-link",
|
|
294
390
|
handler(n, e) {
|
|
295
391
|
var u, v, f;
|
|
296
392
|
if (!e)
|
|
297
393
|
return !1;
|
|
298
|
-
const { unitId: t, linkId: i, segmentId: r } = e, s = n.get(
|
|
394
|
+
const { unitId: t, linkId: i, segmentId: r } = e, s = n.get(k).getUnit(t, I.UNIVER_DOC), c = s == null ? void 0 : s.getSelfOrHeaderFooterModel(r).getBody(), l = (f = (v = (u = c == null ? void 0 : c.customRanges) == null ? void 0 : u.find((g) => g.rangeId === i && g.rangeType === b.HYPERLINK)) == null ? void 0 : v.properties) == null ? void 0 : f.url;
|
|
299
395
|
return l && window.open(l, "_blank", "noopener noreferrer"), !0;
|
|
300
396
|
}
|
|
301
|
-
},
|
|
302
|
-
var
|
|
303
|
-
const n =
|
|
397
|
+
}, K = () => {
|
|
398
|
+
var _, a;
|
|
399
|
+
const n = C(S), e = C(x), t = C(pn), i = C(Se), r = ke(n.showingLink$), o = C(k);
|
|
304
400
|
if (!r)
|
|
305
401
|
return null;
|
|
306
|
-
const { unitId: s, linkId: c, segmentId: l, startIndex: u, endIndex: v } = r, f = o.getUnit(s,
|
|
402
|
+
const { unitId: s, linkId: c, segmentId: l, startIndex: u, endIndex: v } = r, f = o.getUnit(s, I.UNIVER_DOC), g = f == null ? void 0 : f.getSelfOrHeaderFooterModel(l).getBody(), d = (_ = g == null ? void 0 : g.customRanges) == null ? void 0 : _.find((y) => y.rangeId === c && y.rangeType === b.HYPERLINK && y.startIndex === u && y.endIndex === v);
|
|
307
403
|
if (!d)
|
|
308
404
|
return null;
|
|
309
405
|
const p = (a = d.properties) == null ? void 0 : a.url;
|
|
310
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ O(
|
|
311
407
|
"div",
|
|
312
408
|
{
|
|
313
|
-
className:
|
|
409
|
+
className: ye("univer-box-border univer-flex univer-max-w-80 univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow dark:!univer-bg-gray-900", xe),
|
|
314
410
|
onClick: () => {
|
|
315
411
|
n.hideInfoPopup();
|
|
316
412
|
},
|
|
317
413
|
children: [
|
|
318
|
-
/* @__PURE__ */
|
|
414
|
+
/* @__PURE__ */ O(
|
|
319
415
|
"div",
|
|
320
416
|
{
|
|
321
417
|
className: "univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-500",
|
|
@@ -325,14 +421,14 @@ const De = {
|
|
|
325
421
|
"div",
|
|
326
422
|
{
|
|
327
423
|
className: "univer-mr-2 univer-flex univer-size-5 univer-flex-[0_0_auto] univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white",
|
|
328
|
-
children: /* @__PURE__ */ h(
|
|
424
|
+
children: /* @__PURE__ */ h(te, {})
|
|
329
425
|
}
|
|
330
426
|
),
|
|
331
|
-
/* @__PURE__ */ h(
|
|
427
|
+
/* @__PURE__ */ h(H, { showIfEllipsis: !0, title: p, children: /* @__PURE__ */ h("span", { className: "univer-flex-1 univer-truncate", children: p }) })
|
|
332
428
|
]
|
|
333
429
|
}
|
|
334
430
|
),
|
|
335
|
-
/* @__PURE__ */
|
|
431
|
+
/* @__PURE__ */ O("div", { className: "univer-flex univer-h-6 univer-flex-[0_0_auto] univer-items-center univer-justify-center", children: [
|
|
336
432
|
/* @__PURE__ */ h(
|
|
337
433
|
"div",
|
|
338
434
|
{
|
|
@@ -340,10 +436,10 @@ const De = {
|
|
|
340
436
|
onClick: () => {
|
|
341
437
|
navigator.clipboard.writeText(p), t.show({
|
|
342
438
|
content: i.t("docLink.info.coped"),
|
|
343
|
-
type:
|
|
439
|
+
type: un.Info
|
|
344
440
|
});
|
|
345
441
|
},
|
|
346
|
-
children: /* @__PURE__ */ h(
|
|
442
|
+
children: /* @__PURE__ */ h(H, { placement: "bottom", title: i.t("docLink.info.copy"), children: /* @__PURE__ */ h(Pe, {}) })
|
|
347
443
|
}
|
|
348
444
|
),
|
|
349
445
|
/* @__PURE__ */ h(
|
|
@@ -351,11 +447,11 @@ const De = {
|
|
|
351
447
|
{
|
|
352
448
|
className: "univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base",
|
|
353
449
|
onClick: () => {
|
|
354
|
-
e.executeCommand(
|
|
450
|
+
e.executeCommand(w.id, {
|
|
355
451
|
link: r
|
|
356
452
|
});
|
|
357
453
|
},
|
|
358
|
-
children: /* @__PURE__ */ h(
|
|
454
|
+
children: /* @__PURE__ */ h(H, { placement: "bottom", title: i.t("docLink.info.edit"), children: /* @__PURE__ */ h(Me, {}) })
|
|
359
455
|
}
|
|
360
456
|
),
|
|
361
457
|
/* @__PURE__ */ h(
|
|
@@ -363,13 +459,13 @@ const De = {
|
|
|
363
459
|
{
|
|
364
460
|
className: "univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base",
|
|
365
461
|
onClick: () => {
|
|
366
|
-
e.executeCommand(
|
|
462
|
+
e.executeCommand(be.id, {
|
|
367
463
|
unitId: s,
|
|
368
464
|
linkId: d.rangeId,
|
|
369
465
|
segmentId: l
|
|
370
466
|
});
|
|
371
467
|
},
|
|
372
|
-
children: /* @__PURE__ */ h(
|
|
468
|
+
children: /* @__PURE__ */ h(H, { placement: "bottom", title: i.t("docLink.info.cancel"), children: /* @__PURE__ */ h(Re, {}) })
|
|
373
469
|
}
|
|
374
470
|
)
|
|
375
471
|
] })
|
|
@@ -377,21 +473,21 @@ const De = {
|
|
|
377
473
|
}
|
|
378
474
|
);
|
|
379
475
|
};
|
|
380
|
-
|
|
381
|
-
var
|
|
382
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
476
|
+
K.componentKey = "univer.doc.link-info-popup";
|
|
477
|
+
var $n = Object.getOwnPropertyDescriptor, Un = (n, e, t, i) => {
|
|
478
|
+
for (var r = i > 1 ? void 0 : i ? $n(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
383
479
|
(s = n[o]) && (r = s(r) || r);
|
|
384
480
|
return r;
|
|
385
|
-
},
|
|
386
|
-
let S = class extends
|
|
481
|
+
}, G = (n, e) => (t, i) => e(t, i, n);
|
|
482
|
+
let S = class extends D {
|
|
387
483
|
constructor(e, t, i) {
|
|
388
484
|
super();
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
485
|
+
L(this, "_editingLink$", new he(null));
|
|
486
|
+
L(this, "_showingLink$", new he(null));
|
|
487
|
+
L(this, "editingLink$", this._editingLink$.asObservable());
|
|
488
|
+
L(this, "showingLink$", this._showingLink$.asObservable());
|
|
489
|
+
L(this, "_editPopup", null);
|
|
490
|
+
L(this, "_infoPopup", null);
|
|
395
491
|
this._docCanvasPopupManagerService = e, this._textSelectionManagerService = t, this._univerInstanceService = i, this.disposeWithMe(() => {
|
|
396
492
|
this._editingLink$.complete(), this._showingLink$.complete();
|
|
397
493
|
});
|
|
@@ -422,7 +518,7 @@ let S = class extends E {
|
|
|
422
518
|
return r ? (this._editPopup = this._docCanvasPopupManagerService.attachPopupToRange(
|
|
423
519
|
r,
|
|
424
520
|
{
|
|
425
|
-
componentKey:
|
|
521
|
+
componentKey: A.componentKey,
|
|
426
522
|
direction: "bottom"
|
|
427
523
|
},
|
|
428
524
|
e
|
|
@@ -435,7 +531,7 @@ let S = class extends E {
|
|
|
435
531
|
showInfoPopup(e) {
|
|
436
532
|
var u, v, f, g, d, p;
|
|
437
533
|
const { linkId: t, unitId: i, segmentId: r, segmentPage: o, startIndex: s, endIndex: c } = e;
|
|
438
|
-
if (!(((u = this.showing) == null ? void 0 : u.linkId) === t && ((v = this.showing) == null ? void 0 : v.unitId) === i && ((f = this.showing) == null ? void 0 : f.segmentId) === r && ((g = this.showing) == null ? void 0 : g.segmentPage) === o && ((d = this.showing) == null ? void 0 : d.startIndex) === s && ((p = this.showing) == null ? void 0 : p.endIndex) === c || (this._infoPopup && this._infoPopup.dispose(), !this._univerInstanceService.getUnit(i,
|
|
534
|
+
if (!(((u = this.showing) == null ? void 0 : u.linkId) === t && ((v = this.showing) == null ? void 0 : v.unitId) === i && ((f = this.showing) == null ? void 0 : f.segmentId) === r && ((g = this.showing) == null ? void 0 : g.segmentPage) === o && ((d = this.showing) == null ? void 0 : d.startIndex) === s && ((p = this.showing) == null ? void 0 : p.endIndex) === c || (this._infoPopup && this._infoPopup.dispose(), !this._univerInstanceService.getUnit(i, I.UNIVER_DOC))))
|
|
439
535
|
return this._showingLink$.next({ unitId: i, linkId: t, segmentId: r, segmentPage: o, startIndex: s, endIndex: c }), this._infoPopup = this._docCanvasPopupManagerService.attachPopupToRange(
|
|
440
536
|
{
|
|
441
537
|
collapsed: !1,
|
|
@@ -445,7 +541,7 @@ let S = class extends E {
|
|
|
445
541
|
segmentPage: o
|
|
446
542
|
},
|
|
447
543
|
{
|
|
448
|
-
componentKey:
|
|
544
|
+
componentKey: K.componentKey,
|
|
449
545
|
direction: "top-center",
|
|
450
546
|
multipleDirection: "top",
|
|
451
547
|
onClickOutside: () => {
|
|
@@ -460,17 +556,17 @@ let S = class extends E {
|
|
|
460
556
|
this._showingLink$.next(null), (e = this._infoPopup) == null || e.dispose();
|
|
461
557
|
}
|
|
462
558
|
};
|
|
463
|
-
S =
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
559
|
+
S = Un([
|
|
560
|
+
G(0, m(tn)),
|
|
561
|
+
G(1, m(R)),
|
|
562
|
+
G(2, k)
|
|
467
563
|
], S);
|
|
468
|
-
var
|
|
469
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
564
|
+
var Tn = Object.getOwnPropertyDescriptor, Hn = (n, e, t, i) => {
|
|
565
|
+
for (var r = i > 1 ? void 0 : i ? Tn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
470
566
|
(s = n[o]) && (r = s(r) || r);
|
|
471
567
|
return r;
|
|
472
|
-
},
|
|
473
|
-
let
|
|
568
|
+
}, z = (n, e) => (t, i) => e(t, i, n);
|
|
569
|
+
let F = class extends D {
|
|
474
570
|
constructor(n, e, t) {
|
|
475
571
|
super(), this._commandService = n, this._univerInstanceService = e, this._docHyperLinkService = t, this._initSelectionChange();
|
|
476
572
|
}
|
|
@@ -478,14 +574,14 @@ let V = class extends E {
|
|
|
478
574
|
this.disposeWithMe(
|
|
479
575
|
this._commandService.onCommandExecuted((n) => {
|
|
480
576
|
var e, t, i;
|
|
481
|
-
if (n.id ===
|
|
482
|
-
const r = n.params, { unitId: o, ranges: s, segmentId: c } = r, l = this._univerInstanceService.getUnit(o,
|
|
577
|
+
if (n.id === Qe.id) {
|
|
578
|
+
const r = n.params, { unitId: o, ranges: s, segmentId: c } = r, l = this._univerInstanceService.getUnit(o, I.UNIVER_DOC), u = s[0];
|
|
483
579
|
if (u && l) {
|
|
484
580
|
const { startOffset: v, endOffset: f, collapsed: g, segmentPage: d } = u, p = (t = (e = l.getSelfOrHeaderFooterModel(c)) == null ? void 0 : e.getBody()) == null ? void 0 : t.customRanges;
|
|
485
581
|
if (g) {
|
|
486
|
-
const
|
|
487
|
-
if (
|
|
488
|
-
const a = p[
|
|
582
|
+
const _ = (i = p == null ? void 0 : p.findIndex((a) => a.startIndex < v && a.endIndex > f - 1)) != null ? i : -1;
|
|
583
|
+
if (_ > -1) {
|
|
584
|
+
const a = p[_];
|
|
489
585
|
this._docHyperLinkService.showInfoPopup({ unitId: o, linkId: a.rangeId, segmentId: c, segmentPage: d, startIndex: a.startIndex, endIndex: a.endIndex });
|
|
490
586
|
return;
|
|
491
587
|
}
|
|
@@ -498,39 +594,39 @@ let V = class extends E {
|
|
|
498
594
|
);
|
|
499
595
|
}
|
|
500
596
|
};
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
],
|
|
506
|
-
var
|
|
507
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
597
|
+
F = Hn([
|
|
598
|
+
z(0, x),
|
|
599
|
+
z(1, k),
|
|
600
|
+
z(2, m(S))
|
|
601
|
+
], F);
|
|
602
|
+
var jn = Object.getOwnPropertyDescriptor, An = (n, e, t, i) => {
|
|
603
|
+
for (var r = i > 1 ? void 0 : i ? jn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
508
604
|
(s = n[o]) && (r = s(r) || r);
|
|
509
605
|
return r;
|
|
510
606
|
}, M = (n, e) => (t, i) => e(t, i, n);
|
|
511
|
-
let
|
|
607
|
+
let ee = class extends D {
|
|
512
608
|
constructor(n, e, t, i, r, o) {
|
|
513
|
-
super(), this._context = n, this._docEventManagerService = e, this._commandService = t, this._hyperLinkPopupService = i, this._docSkeletonManagerService = r, this._docSelectionManagerService = o, !(this._context.unitId ===
|
|
609
|
+
super(), this._context = n, this._docEventManagerService = e, this._commandService = t, this._hyperLinkPopupService = i, this._docSkeletonManagerService = r, this._docSelectionManagerService = o, !(this._context.unitId === Ae || this._context.unitId === Ke) && (this._initHover(), this._initClick());
|
|
514
610
|
}
|
|
515
611
|
get _skeleton() {
|
|
516
612
|
return this._docSkeletonManagerService.getSkeleton();
|
|
517
613
|
}
|
|
518
614
|
_hideInfoPopup() {
|
|
519
615
|
this._hyperLinkPopupService.showing && this._commandService.executeCommand(
|
|
520
|
-
|
|
616
|
+
X.id
|
|
521
617
|
);
|
|
522
618
|
}
|
|
523
619
|
_initHover() {
|
|
524
620
|
this.disposeWithMe(
|
|
525
621
|
this._docEventManagerService.hoverCustomRanges$.subscribe((n) => {
|
|
526
622
|
var r;
|
|
527
|
-
const e = n.find((o) => o.range.rangeType ===
|
|
623
|
+
const e = n.find((o) => o.range.rangeType === b.HYPERLINK), t = this._docSelectionManagerService.getTextRanges(), i = t == null ? void 0 : t[0].segmentId;
|
|
528
624
|
if (((r = e == null ? void 0 : e.segmentId) != null ? r : "") !== i) {
|
|
529
625
|
this._hideInfoPopup();
|
|
530
626
|
return;
|
|
531
627
|
}
|
|
532
628
|
e ? this._commandService.executeCommand(
|
|
533
|
-
|
|
629
|
+
X.id,
|
|
534
630
|
{
|
|
535
631
|
unitId: this._context.unitId,
|
|
536
632
|
linkId: e.range.rangeId,
|
|
@@ -549,7 +645,7 @@ let ne = class extends E {
|
|
|
549
645
|
this._docEventManagerService.clickCustomRanges$.subscribe((n) => {
|
|
550
646
|
const e = n.range;
|
|
551
647
|
e && this._commandService.executeCommand(
|
|
552
|
-
|
|
648
|
+
Ee.id,
|
|
553
649
|
{
|
|
554
650
|
unitId: this._context.unitId,
|
|
555
651
|
linkId: e.rangeId,
|
|
@@ -560,24 +656,24 @@ let ne = class extends E {
|
|
|
560
656
|
);
|
|
561
657
|
}
|
|
562
658
|
};
|
|
563
|
-
|
|
564
|
-
M(1,
|
|
565
|
-
M(2,
|
|
566
|
-
M(3,
|
|
567
|
-
M(4,
|
|
568
|
-
M(5,
|
|
569
|
-
],
|
|
570
|
-
var
|
|
571
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
659
|
+
ee = An([
|
|
660
|
+
M(1, m(rn)),
|
|
661
|
+
M(2, x),
|
|
662
|
+
M(3, m(S)),
|
|
663
|
+
M(4, m(Xe)),
|
|
664
|
+
M(5, m(R))
|
|
665
|
+
], ee);
|
|
666
|
+
var Kn = Object.getOwnPropertyDescriptor, Fn = (n, e, t, i) => {
|
|
667
|
+
for (var r = i > 1 ? void 0 : i ? Kn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
572
668
|
(s = n[o]) && (r = s(r) || r);
|
|
573
669
|
return r;
|
|
574
|
-
},
|
|
575
|
-
let
|
|
670
|
+
}, q = (n, e) => (t, i) => e(t, i, n);
|
|
671
|
+
let ne = class extends D {
|
|
576
672
|
constructor(n, e, t, i) {
|
|
577
673
|
super(), this._context = n, this._docInterceptorService = e, this._hyperLinkService = t, this._docRenderController = i, this._init(), this._initReRender();
|
|
578
674
|
}
|
|
579
675
|
_init() {
|
|
580
|
-
this._docInterceptorService.intercept(
|
|
676
|
+
this._docInterceptorService.intercept(nn.CUSTOM_RANGE, {
|
|
581
677
|
handler: (n, e, t) => {
|
|
582
678
|
if (!n)
|
|
583
679
|
return t(n);
|
|
@@ -597,30 +693,30 @@ let te = class extends E {
|
|
|
597
693
|
}
|
|
598
694
|
_initReRender() {
|
|
599
695
|
this.disposeWithMe(this._hyperLinkService.showingLink$.pipe(
|
|
600
|
-
|
|
601
|
-
|
|
696
|
+
cn((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)),
|
|
697
|
+
dn()
|
|
602
698
|
).subscribe(([n, e]) => {
|
|
603
699
|
e ? e.unitId === this._context.unitId && this._docRenderController.reRender(e.unitId) : n && n.unitId === this._context.unitId && this._docRenderController.reRender(n.unitId);
|
|
604
700
|
}));
|
|
605
701
|
}
|
|
606
702
|
};
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
],
|
|
612
|
-
const
|
|
613
|
-
function
|
|
703
|
+
ne = Fn([
|
|
704
|
+
q(1, m(en)),
|
|
705
|
+
q(2, m(S)),
|
|
706
|
+
q(3, m(on))
|
|
707
|
+
], ne);
|
|
708
|
+
const Ne = "doc-hyper-link-icon";
|
|
709
|
+
function _e(n) {
|
|
614
710
|
return {
|
|
615
|
-
id:
|
|
616
|
-
type:
|
|
617
|
-
icon:
|
|
711
|
+
id: w.id,
|
|
712
|
+
type: vn.BUTTON,
|
|
713
|
+
icon: Ne,
|
|
618
714
|
title: "docLink.menu.tooltip",
|
|
619
715
|
tooltip: "docLink.menu.tooltip",
|
|
620
|
-
hidden$:
|
|
621
|
-
disabled$: new
|
|
622
|
-
const i = n.get(R).textSelection$.pipe(
|
|
623
|
-
e.next(
|
|
716
|
+
hidden$: hn(n, I.UNIVER_DOC),
|
|
717
|
+
disabled$: new an(function(e) {
|
|
718
|
+
const i = n.get(R).textSelection$.pipe(ln(16)).subscribe(() => {
|
|
719
|
+
e.next(De(n));
|
|
624
720
|
});
|
|
625
721
|
return () => {
|
|
626
722
|
i.unsubscribe();
|
|
@@ -628,41 +724,41 @@ function Ce(n) {
|
|
|
628
724
|
})
|
|
629
725
|
};
|
|
630
726
|
}
|
|
631
|
-
const
|
|
632
|
-
id:
|
|
633
|
-
binding:
|
|
727
|
+
const Bn = {
|
|
728
|
+
id: w.id,
|
|
729
|
+
binding: gn.CTRL_COMMAND | Q.K,
|
|
634
730
|
description: "docLink.menu.tooltip",
|
|
635
|
-
preconditions:
|
|
636
|
-
},
|
|
637
|
-
[
|
|
638
|
-
[
|
|
731
|
+
preconditions: sn
|
|
732
|
+
}, Vn = {
|
|
733
|
+
[In.MEDIA]: {
|
|
734
|
+
[w.id]: {
|
|
639
735
|
order: 1,
|
|
640
|
-
menuItemFactory:
|
|
736
|
+
menuItemFactory: _e
|
|
641
737
|
}
|
|
642
738
|
},
|
|
643
|
-
[
|
|
644
|
-
[
|
|
645
|
-
[
|
|
739
|
+
[fn.MAIN_AREA]: {
|
|
740
|
+
[mn.DATA]: {
|
|
741
|
+
[w.id]: {
|
|
646
742
|
order: 0,
|
|
647
|
-
menuItemFactory:
|
|
743
|
+
menuItemFactory: _e
|
|
648
744
|
}
|
|
649
745
|
}
|
|
650
746
|
}
|
|
651
747
|
};
|
|
652
|
-
var
|
|
653
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
748
|
+
var Zn = Object.getOwnPropertyDescriptor, Yn = (n, e, t, i) => {
|
|
749
|
+
for (var r = i > 1 ? void 0 : i ? Zn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
654
750
|
(s = n[o]) && (r = s(r) || r);
|
|
655
751
|
return r;
|
|
656
|
-
},
|
|
657
|
-
let
|
|
752
|
+
}, j = (n, e) => (t, i) => e(t, i, n);
|
|
753
|
+
let B = class extends D {
|
|
658
754
|
constructor(n, e, t, i) {
|
|
659
755
|
super(), this._componentManager = n, this._commandService = e, this._menuManagerService = t, this._shortcutService = i, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortcut();
|
|
660
756
|
}
|
|
661
757
|
_initComponents() {
|
|
662
758
|
[
|
|
663
|
-
[
|
|
664
|
-
[
|
|
665
|
-
[
|
|
759
|
+
[A.componentKey, A],
|
|
760
|
+
[K.componentKey, K],
|
|
761
|
+
[Ne, te]
|
|
666
762
|
].forEach(([n, e]) => {
|
|
667
763
|
this.disposeWithMe(
|
|
668
764
|
this._componentManager.register(n, e)
|
|
@@ -671,79 +767,79 @@ let Z = class extends E {
|
|
|
671
767
|
}
|
|
672
768
|
_initCommands() {
|
|
673
769
|
[
|
|
770
|
+
Le,
|
|
674
771
|
Oe,
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
Ne
|
|
772
|
+
be,
|
|
773
|
+
w,
|
|
774
|
+
X,
|
|
775
|
+
Ee
|
|
680
776
|
].forEach((n) => {
|
|
681
777
|
this._commandService.registerCommand(n);
|
|
682
778
|
});
|
|
683
779
|
}
|
|
684
780
|
_initShortcut() {
|
|
685
|
-
[
|
|
781
|
+
[Bn].forEach((n) => {
|
|
686
782
|
this._shortcutService.registerShortcut(n);
|
|
687
783
|
});
|
|
688
784
|
}
|
|
689
785
|
_initMenus() {
|
|
690
|
-
this._menuManagerService.mergeMenu(
|
|
786
|
+
this._menuManagerService.mergeMenu(Vn);
|
|
691
787
|
}
|
|
692
788
|
};
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
],
|
|
699
|
-
const
|
|
700
|
-
var
|
|
701
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
789
|
+
B = Yn([
|
|
790
|
+
j(0, m(_n)),
|
|
791
|
+
j(1, x),
|
|
792
|
+
j(2, Cn),
|
|
793
|
+
j(3, Sn)
|
|
794
|
+
], B);
|
|
795
|
+
const Wn = "DOC_HYPER_LINK_UI_PLUGIN";
|
|
796
|
+
var Gn = Object.defineProperty, zn = Object.getOwnPropertyDescriptor, qn = (n, e, t) => e in n ? Gn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Jn = (n, e, t, i) => {
|
|
797
|
+
for (var r = i > 1 ? void 0 : i ? zn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
702
798
|
(s = n[o]) && (r = s(r) || r);
|
|
703
799
|
return r;
|
|
704
|
-
},
|
|
705
|
-
let
|
|
706
|
-
constructor(n =
|
|
800
|
+
}, J = (n, e) => (t, i) => e(t, i, n), $e = (n, e, t) => qn(n, typeof e != "symbol" ? e + "" : e, t);
|
|
801
|
+
let V = class extends Ze {
|
|
802
|
+
constructor(n = Ie, e, t, i) {
|
|
707
803
|
super(), this._config = n, this._injector = e, this._renderManagerSrv = t, this._configService = i;
|
|
708
|
-
const { menu: r, ...o } =
|
|
804
|
+
const { menu: r, ...o } = Ye(
|
|
709
805
|
{},
|
|
710
|
-
|
|
806
|
+
Ie,
|
|
711
807
|
this._config
|
|
712
808
|
);
|
|
713
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
809
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(kn, o);
|
|
714
810
|
}
|
|
715
811
|
onStarting() {
|
|
716
812
|
[
|
|
717
813
|
[S],
|
|
718
|
-
[
|
|
719
|
-
[
|
|
814
|
+
[B],
|
|
815
|
+
[F]
|
|
720
816
|
].forEach((e) => {
|
|
721
817
|
this._injector.add(e);
|
|
722
|
-
}), this._injector.get(
|
|
818
|
+
}), this._injector.get(B);
|
|
723
819
|
}
|
|
724
820
|
onReady() {
|
|
725
|
-
this._injector.get(
|
|
821
|
+
this._injector.get(F);
|
|
726
822
|
}
|
|
727
823
|
onRendered() {
|
|
728
824
|
this._initRenderModule();
|
|
729
825
|
}
|
|
730
826
|
_initRenderModule() {
|
|
731
827
|
[
|
|
732
|
-
[
|
|
733
|
-
[
|
|
828
|
+
[ne],
|
|
829
|
+
[ee]
|
|
734
830
|
].forEach((n) => {
|
|
735
|
-
this._renderManagerSrv.registerRenderModule(
|
|
831
|
+
this._renderManagerSrv.registerRenderModule(I.UNIVER_DOC, n);
|
|
736
832
|
});
|
|
737
833
|
}
|
|
738
834
|
};
|
|
739
|
-
$e(
|
|
740
|
-
$e(
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
],
|
|
835
|
+
$e(V, "pluginName", Wn);
|
|
836
|
+
$e(V, "type", I.UNIVER_DOC);
|
|
837
|
+
V = Jn([
|
|
838
|
+
Fe(We),
|
|
839
|
+
J(1, m(Be)),
|
|
840
|
+
J(2, Ge),
|
|
841
|
+
J(3, Ve)
|
|
842
|
+
], V);
|
|
747
843
|
export {
|
|
748
|
-
|
|
844
|
+
V as UniverDocsHyperLinkUIPlugin
|
|
749
845
|
};
|