@univerjs/docs-hyper-link-ui 0.7.0-nightly.202505081607 → 0.7.0-nightly.202505101606
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 +13 -13
- package/lib/es/index.js +177 -177
- package/lib/index.css +1 -1
- package/lib/index.js +177 -177
- package/lib/umd/index.js +13 -13
- package/package.json +9 -9
package/lib/index.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var O = (n, e, t) =>
|
|
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 P, jsx as
|
|
11
|
-
import { FormLayout as
|
|
12
|
-
import { useDependency as S, useObservable as
|
|
13
|
-
import { useState as W, useEffect as
|
|
14
|
-
const
|
|
15
|
-
type:
|
|
1
|
+
var $e = Object.defineProperty;
|
|
2
|
+
var He = (n, e, t) => e in n ? $e(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var O = (n, e, t) => He(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import { CommandType as b, ICommandService as k, generateRandomId as je, CustomRangeType as E, IUniverInstanceService as L, UniverInstanceType as _, getBodySlice as Se, LocaleService as ye, Tools as Ke, BuildTextUtils as fe, Inject as I, Disposable as D, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Ae, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Fe, DependentOn as Be, Injector as Ve, IConfigService as Ye, Plugin as Ze, merge as ze } 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 qe, DocSelectionManagerService as w, replaceSelectionFactory as Je, deleteCustomRangeFactory as Qe, SetTextSelectionsOperation as Xe, DocSkeletonManagerService as en, DocInterceptorService as nn, DOC_INTERCEPTOR_POINT as tn } from "@univerjs/docs";
|
|
8
|
+
import { DocCanvasPopManagerService as rn, DocEventManagerService as on, DocRenderController as sn, whenDocAndEditorFocused as cn } from "@univerjs/docs-ui";
|
|
9
|
+
import { BehaviorSubject as he, distinctUntilChanged as dn, pairwise as an, Observable as ln, debounceTime as un } from "rxjs";
|
|
10
|
+
import { jsxs as P, jsx as f } from "react/jsx-runtime";
|
|
11
|
+
import { clsx as xe, FormLayout as ve, Input as me, Button as Ie, borderClassName as ke, Tooltip as K, MessageType as pn } from "@univerjs/design";
|
|
12
|
+
import { useDependency as S, useObservable as Le, KeyCode as X, IMessageService as gn, MetaKeys as fn, getMenuHiddenObservable as hn, MenuItemType as vn, ContextMenuPosition as mn, ContextMenuGroup as In, RibbonStartGroup as _n, ComponentManager as Cn, IMenuManagerService as Sn, IShortcutService as yn } from "@univerjs/ui";
|
|
13
|
+
import { useState as W, useEffect as xn, forwardRef as N, useRef as kn, createElement as U } from "react";
|
|
14
|
+
const Ln = "docs-hyper-link-ui.config", _e = {}, Oe = {
|
|
15
|
+
type: b.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(k), s =
|
|
20
|
+
const { payload: t, unitId: i, selections: r } = e, o = n.get(k), s = je(), c = qe(
|
|
21
21
|
n,
|
|
22
22
|
{
|
|
23
23
|
rangeId: s,
|
|
@@ -31,19 +31,19 @@ const xn = "docs-hyper-link-ui.config", _e = {}, ke = {
|
|
|
31
31
|
);
|
|
32
32
|
return c ? o.syncExecuteCommand(c.id, c.params) : !1;
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, Pe = {
|
|
35
35
|
id: "docs.command.update-hyper-link",
|
|
36
|
-
type:
|
|
36
|
+
type: b.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(k), c = n.get(L), u = n.get(w).getActiveTextRange(),
|
|
42
|
-
if (!u || !
|
|
41
|
+
const { unitId: t, payload: i, segmentId: r, linkId: o } = e, s = n.get(k), c = n.get(L), u = n.get(w).getActiveTextRange(), h = c.getUnit(t, _.UNIVER_DOC);
|
|
42
|
+
if (!u || !h)
|
|
43
43
|
return !1;
|
|
44
|
-
const g = (p = Se(
|
|
44
|
+
const g = (p = Se(h.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 = Je(n, {
|
|
47
47
|
unitId: t,
|
|
48
48
|
body: {
|
|
49
49
|
dataStream: `${e.label}`,
|
|
@@ -68,45 +68,45 @@ const xn = "docs-hyper-link-ui.config", _e = {}, ke = {
|
|
|
68
68
|
return d ? s.syncExecuteCommand(d.id, d.params) : !1;
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
function
|
|
71
|
+
function On(n) {
|
|
72
72
|
return /^[a-zA-Z]+:\/\//.test(n);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Pn(n) {
|
|
75
75
|
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(n);
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
return
|
|
77
|
+
function Rn(n) {
|
|
78
|
+
return On(n) ? n : Pn(n) ? `mailto://${n}` : `https://${n}`;
|
|
79
79
|
}
|
|
80
80
|
const F = () => {
|
|
81
|
-
const n = S(y), e = S(ye), t =
|
|
82
|
-
|
|
81
|
+
const n = S(y), e = S(ye), t = Le(n.editingLink$), i = S(k), r = S(L), o = S(w), [s, c] = W(""), [l, u] = W(""), [h, v] = W(!1), g = Ke.isLegalUrl(s), d = t ? r.getUnit(t.unitId, _.UNIVER_DOC) : r.getCurrentUnitForType(_.UNIVER_DOC);
|
|
82
|
+
xn(() => {
|
|
83
83
|
var oe, se, ce, de, ae, le, ue, pe, ge;
|
|
84
84
|
const a = o.getActiveTextRange();
|
|
85
85
|
if (!a)
|
|
86
86
|
return;
|
|
87
87
|
if (t) {
|
|
88
88
|
const H = (oe = d == null ? void 0 : d.getSelfOrHeaderFooterModel(t.segmentId)) == null ? void 0 : oe.getBody(), j = (se = H == null ? void 0 : H.customRanges) == null ? void 0 : se.find((z) => (t == null ? void 0 : t.linkId) === z.rangeId && z.startIndex === t.startIndex && z.endIndex === t.endIndex);
|
|
89
|
-
d && j && (c((de = (ce = j.properties) == null ? void 0 : ce.url) != null ? de : ""), u(
|
|
89
|
+
d && j && (c((de = (ce = j.properties) == null ? void 0 : ce.url) != null ? de : ""), u(fe.transform.getPlainText(Se(H, j.startIndex, j.endIndex + 1).dataStream)));
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
const x = (ae = d == null ? void 0 : d.getSelfOrHeaderFooterModel(a.segmentId)) == null ? void 0 : ae.getBody(), re = x ? a : null, $ = re && ((ue =
|
|
92
|
+
const x = (ae = d == null ? void 0 : d.getSelfOrHeaderFooterModel(a.segmentId)) == null ? void 0 : ae.getBody(), re = x ? a : null, $ = re && ((ue = fe.customRange.getCustomRangesInterestsWithSelection(re, (le = x == null ? void 0 : x.customRanges) != null ? le : [])) == null ? void 0 : ue[0]);
|
|
93
93
|
d && $ && c((ge = (pe = $ == null ? void 0 : $.properties) == null ? void 0 : pe.url) != null ? ge : "");
|
|
94
94
|
}, [d, t, o, r]);
|
|
95
95
|
const p = () => {
|
|
96
96
|
n.hideEditPopup();
|
|
97
97
|
}, C = () => {
|
|
98
|
-
if (
|
|
98
|
+
if (v(!0), !g || !d)
|
|
99
99
|
return;
|
|
100
|
-
const a =
|
|
100
|
+
const a = Rn(s);
|
|
101
101
|
if (!t)
|
|
102
|
-
i.executeCommand(
|
|
102
|
+
i.executeCommand(Oe.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(Pe.id, {
|
|
110
110
|
unitId: d.getUnitId(),
|
|
111
111
|
payload: a,
|
|
112
112
|
linkId: t.linkId,
|
|
@@ -120,18 +120,17 @@ const F = () => {
|
|
|
120
120
|
return /* @__PURE__ */ P(
|
|
121
121
|
"div",
|
|
122
122
|
{
|
|
123
|
-
className: `
|
|
124
|
-
univer-box-border univer-w-[328px] univer-rounded-xl univer-
|
|
125
|
-
|
|
126
|
-
`,
|
|
123
|
+
className: xe(`
|
|
124
|
+
univer-box-border univer-w-[328px] univer-rounded-xl univer-bg-white univer-px-6 univer-py-5 univer-shadow
|
|
125
|
+
`, ke),
|
|
127
126
|
children: [
|
|
128
127
|
/* @__PURE__ */ P("div", { children: [
|
|
129
|
-
t ? /* @__PURE__ */
|
|
130
|
-
|
|
128
|
+
t ? /* @__PURE__ */ f(
|
|
129
|
+
ve,
|
|
131
130
|
{
|
|
132
131
|
label: e.t("docLink.edit.label"),
|
|
133
|
-
error:
|
|
134
|
-
children: /* @__PURE__ */
|
|
132
|
+
error: h && !l ? e.t("docLink.edit.labelError") : "",
|
|
133
|
+
children: /* @__PURE__ */ f(
|
|
135
134
|
me,
|
|
136
135
|
{
|
|
137
136
|
value: l,
|
|
@@ -144,12 +143,12 @@ const F = () => {
|
|
|
144
143
|
)
|
|
145
144
|
}
|
|
146
145
|
) : null,
|
|
147
|
-
/* @__PURE__ */
|
|
148
|
-
|
|
146
|
+
/* @__PURE__ */ f(
|
|
147
|
+
ve,
|
|
149
148
|
{
|
|
150
149
|
label: e.t("docLink.edit.address"),
|
|
151
|
-
error:
|
|
152
|
-
children: /* @__PURE__ */
|
|
150
|
+
error: h && !g ? e.t("docLink.edit.addressError") : "",
|
|
151
|
+
children: /* @__PURE__ */ f(
|
|
153
152
|
me,
|
|
154
153
|
{
|
|
155
154
|
value: s,
|
|
@@ -164,8 +163,8 @@ const F = () => {
|
|
|
164
163
|
)
|
|
165
164
|
] }),
|
|
166
165
|
/* @__PURE__ */ P("div", { className: "univer-flex univer-justify-end univer-gap-3", children: [
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ f(Ie, { onClick: p, children: e.t("docLink.edit.cancel") }),
|
|
167
|
+
/* @__PURE__ */ f(
|
|
169
168
|
Ie,
|
|
170
169
|
{
|
|
171
170
|
variant: "primary",
|
|
@@ -188,7 +187,7 @@ var m = function() {
|
|
|
188
187
|
}
|
|
189
188
|
return n;
|
|
190
189
|
}, m.apply(this, arguments);
|
|
191
|
-
},
|
|
190
|
+
}, bn = function(n, e) {
|
|
192
191
|
var t = {};
|
|
193
192
|
for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
|
|
194
193
|
if (n != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -196,15 +195,15 @@ var m = function() {
|
|
|
196
195
|
e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[r]) && (t[i[r]] = n[i[r]]);
|
|
197
196
|
return t;
|
|
198
197
|
}, T = N(function(n, e) {
|
|
199
|
-
var t = n.icon, i = n.id, r = n.className, o = n.extend, s =
|
|
200
|
-
return
|
|
198
|
+
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(En()));
|
|
199
|
+
return Re(t, "".concat(i), { defIds: t.defIds, idSuffix: l.current }, m({ ref: e, className: c }, s), o);
|
|
201
200
|
});
|
|
202
|
-
function
|
|
203
|
-
return U(n.tag, m(m({ key: e },
|
|
204
|
-
return
|
|
201
|
+
function Re(n, e, t, i, r) {
|
|
202
|
+
return U(n.tag, m(m({ key: e }, wn(n, t, r)), i), (Mn(n, t).children || []).map(function(o, s) {
|
|
203
|
+
return Re(o, "".concat(e, "-").concat(n.tag, "-").concat(s), t, void 0, r);
|
|
205
204
|
}));
|
|
206
205
|
}
|
|
207
|
-
function
|
|
206
|
+
function wn(n, e, t) {
|
|
208
207
|
var i = m({}, n.attrs);
|
|
209
208
|
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(function(o) {
|
|
210
209
|
var s = o[0], c = o[1];
|
|
@@ -216,108 +215,108 @@ function bn(n, e, t) {
|
|
|
216
215
|
typeof c == "string" && (i[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
|
|
217
216
|
})), i;
|
|
218
217
|
}
|
|
219
|
-
function
|
|
218
|
+
function Mn(n, e) {
|
|
220
219
|
var t, i = e.defIds;
|
|
221
220
|
return !i || i.length === 0 ? n : n.tag === "defs" && (!((t = n.children) === null || t === void 0) && t.length) ? m(m({}, n), { children: n.children.map(function(r) {
|
|
222
221
|
return typeof r.attrs.id == "string" && i && i.indexOf(r.attrs.id) > -1 ? m(m({}, r), { attrs: m(m({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
|
|
223
222
|
}) }) : n;
|
|
224
223
|
}
|
|
225
|
-
function
|
|
224
|
+
function En() {
|
|
226
225
|
return Math.random().toString(36).substring(2, 8);
|
|
227
226
|
}
|
|
228
227
|
T.displayName = "UniverIcon";
|
|
229
|
-
var
|
|
228
|
+
var Dn = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M4.1302 12.4251C4.25802 13.7417 5.36779 14.7708 6.71792 14.7708H11.7179C13.1539 14.7708 14.3179 13.6067 14.3179 12.1708V6.1708C14.3179 4.78586 13.2351 3.65383 11.8698 3.57517C11.742 2.25858 10.6323 1.22949 9.28213 1.22949H4.28213C2.84619 1.22949 1.68213 2.39355 1.68213 3.82949V9.82949C1.68213 11.2144 2.76497 12.3465 4.1302 12.4251ZM10.6583 3.5708H6.71792C5.28198 3.5708 4.11792 4.73486 4.11792 6.1708V11.22C3.4221 11.1387 2.88213 10.5471 2.88213 9.82949V3.82949C2.88213 3.05629 3.50893 2.42949 4.28213 2.42949H9.28213C9.96695 2.42949 10.5369 2.92119 10.6583 3.5708ZM13.1179 6.1708C13.1179 5.3976 12.4911 4.7708 11.7179 4.7708H6.71792C5.94472 4.7708 5.31792 5.3976 5.31792 6.1708V12.1708C5.31792 12.944 5.94472 13.5708 6.71792 13.5708H11.7179C12.4911 13.5708 13.1179 12.944 13.1179 12.1708V6.1708Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, be = N(function(n, e) {
|
|
230
229
|
return U(T, Object.assign({}, n, {
|
|
231
230
|
id: "copy-single",
|
|
232
231
|
ref: e,
|
|
233
|
-
icon:
|
|
232
|
+
icon: Dn
|
|
234
233
|
}));
|
|
235
234
|
});
|
|
236
|
-
|
|
237
|
-
var
|
|
235
|
+
be.displayName = "CopySingle";
|
|
236
|
+
var Nn = { 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" } }] }, ie = N(function(n, e) {
|
|
238
237
|
return U(T, Object.assign({}, n, {
|
|
239
238
|
id: "link-single",
|
|
240
239
|
ref: e,
|
|
241
|
-
icon:
|
|
240
|
+
icon: Nn
|
|
242
241
|
}));
|
|
243
242
|
});
|
|
244
243
|
ie.displayName = "LinkSingle";
|
|
245
|
-
var
|
|
244
|
+
var Un = { 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" } }] }, we = N(function(n, e) {
|
|
246
245
|
return U(T, Object.assign({}, n, {
|
|
247
246
|
id: "unlink-single",
|
|
248
247
|
ref: e,
|
|
249
|
-
icon:
|
|
248
|
+
icon: Un
|
|
250
249
|
}));
|
|
251
250
|
});
|
|
252
|
-
|
|
253
|
-
var
|
|
251
|
+
we.displayName = "UnlinkSingle";
|
|
252
|
+
var Tn = { 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" } }] }, Me = N(function(n, e) {
|
|
254
253
|
return U(T, Object.assign({}, n, {
|
|
255
254
|
id: "write-single",
|
|
256
255
|
ref: e,
|
|
257
|
-
icon:
|
|
256
|
+
icon: Tn
|
|
258
257
|
}));
|
|
259
258
|
});
|
|
260
|
-
|
|
261
|
-
const
|
|
262
|
-
type:
|
|
259
|
+
Me.displayName = "WriteSingle";
|
|
260
|
+
const Ee = {
|
|
261
|
+
type: b.COMMAND,
|
|
263
262
|
id: "docs.command.delete-hyper-link",
|
|
264
263
|
async handler(n, e) {
|
|
265
264
|
if (!e)
|
|
266
265
|
return !1;
|
|
267
|
-
const { unitId: t, linkId: i, segmentId: r } = e, o = n.get(k), s =
|
|
266
|
+
const { unitId: t, linkId: i, segmentId: r } = e, o = n.get(k), s = Qe(n, { unitId: t, rangeId: i, segmentId: r });
|
|
268
267
|
return s ? await o.syncExecuteCommand(s.id, s.params) : !1;
|
|
269
268
|
}
|
|
270
|
-
},
|
|
269
|
+
}, De = (n) => {
|
|
271
270
|
const e = n.get(w), t = n.get(L), i = e.getTextRanges();
|
|
272
271
|
if (!(i != null && i.length))
|
|
273
272
|
return !0;
|
|
274
273
|
const r = i[0];
|
|
275
274
|
return !!(!t.getCurrentUnitForType(_.UNIVER_DOC) || !r || r.collapsed);
|
|
276
|
-
},
|
|
277
|
-
type:
|
|
275
|
+
}, R = {
|
|
276
|
+
type: b.OPERATION,
|
|
278
277
|
id: "doc.operation.show-hyper-link-edit-popup",
|
|
279
278
|
handler(n, e) {
|
|
280
279
|
var s;
|
|
281
280
|
const t = e == null ? void 0 : e.link, i = n.get(L);
|
|
282
|
-
if (
|
|
281
|
+
if (De(n) && !t)
|
|
283
282
|
return !1;
|
|
284
283
|
const r = n.get(y), o = (t == null ? void 0 : t.unitId) || ((s = i.getCurrentUnitForType(_.UNIVER_DOC)) == null ? void 0 : s.getUnitId());
|
|
285
284
|
return o ? (r.showEditPopup(o, t), !0) : !1;
|
|
286
285
|
}
|
|
287
286
|
}, ee = {
|
|
288
|
-
type:
|
|
287
|
+
type: b.OPERATION,
|
|
289
288
|
id: "doc.operation.toggle-hyper-link-info-popup",
|
|
290
289
|
handler(n, e) {
|
|
291
290
|
const t = n.get(y);
|
|
292
291
|
return e ? (t.showInfoPopup(e), !0) : (t.hideInfoPopup(), !0);
|
|
293
292
|
}
|
|
294
|
-
},
|
|
295
|
-
type:
|
|
293
|
+
}, Ne = {
|
|
294
|
+
type: b.OPERATION,
|
|
296
295
|
id: "doc.operation.click-hyper-link",
|
|
297
296
|
handler(n, e) {
|
|
298
|
-
var u,
|
|
297
|
+
var u, h, v;
|
|
299
298
|
if (!e)
|
|
300
299
|
return !1;
|
|
301
|
-
const { unitId: t, linkId: i, segmentId: r } = e, s = n.get(L).getUnit(t, _.UNIVER_DOC), c = s == null ? void 0 : s.getSelfOrHeaderFooterModel(r).getBody(), l = (
|
|
300
|
+
const { unitId: t, linkId: i, segmentId: r } = e, s = n.get(L).getUnit(t, _.UNIVER_DOC), c = s == null ? void 0 : s.getSelfOrHeaderFooterModel(r).getBody(), l = (v = (h = (u = c == null ? void 0 : c.customRanges) == null ? void 0 : u.find((g) => g.rangeId === i && g.rangeType === E.HYPERLINK)) == null ? void 0 : h.properties) == null ? void 0 : v.url;
|
|
302
301
|
return l && window.open(l, "_blank", "noopener noreferrer"), !0;
|
|
303
302
|
}
|
|
304
303
|
}, B = () => {
|
|
305
304
|
var C, a;
|
|
306
|
-
const n = S(y), e = S(k), t = S(
|
|
305
|
+
const n = S(y), e = S(k), t = S(gn), i = S(ye), r = Le(n.showingLink$), o = S(L);
|
|
307
306
|
if (!r)
|
|
308
307
|
return null;
|
|
309
|
-
const { unitId: s, linkId: c, segmentId: l, startIndex: u, endIndex:
|
|
308
|
+
const { unitId: s, linkId: c, segmentId: l, startIndex: u, endIndex: h } = r, v = o.getUnit(s, _.UNIVER_DOC), g = v == null ? void 0 : v.getSelfOrHeaderFooterModel(l).getBody(), d = (C = g == null ? void 0 : g.customRanges) == null ? void 0 : C.find((x) => x.rangeId === c && x.rangeType === E.HYPERLINK && x.startIndex === u && x.endIndex === h);
|
|
310
309
|
if (!d)
|
|
311
310
|
return null;
|
|
312
311
|
const p = (a = d.properties) == null ? void 0 : a.url;
|
|
313
312
|
return /* @__PURE__ */ P(
|
|
314
313
|
"div",
|
|
315
314
|
{
|
|
316
|
-
className: `
|
|
317
|
-
univer-box-border univer-flex univer-max-w-
|
|
318
|
-
univer-overflow-hidden univer-rounded-lg univer-
|
|
319
|
-
univer-bg-
|
|
320
|
-
`,
|
|
315
|
+
className: xe(`
|
|
316
|
+
univer-box-border univer-flex univer-max-w-80 univer-items-center univer-justify-between
|
|
317
|
+
univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow
|
|
318
|
+
dark:univer-bg-gray-900
|
|
319
|
+
`, ke),
|
|
321
320
|
onClick: () => {
|
|
322
321
|
n.hideInfoPopup();
|
|
323
322
|
},
|
|
@@ -327,26 +326,27 @@ const we = {
|
|
|
327
326
|
{
|
|
328
327
|
className: `
|
|
329
328
|
univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-items-center univer-truncate
|
|
330
|
-
univer-text-
|
|
329
|
+
univer-text-sm univer-leading-5 univer-text-primary-500
|
|
331
330
|
`,
|
|
332
331
|
onClick: () => window.open(p, void 0, "noopener,noreferrer"),
|
|
333
332
|
children: [
|
|
334
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ f(
|
|
335
334
|
"div",
|
|
336
335
|
{
|
|
337
336
|
className: `
|
|
338
337
|
univer-mr-2 univer-flex univer-size-5 univer-flex-[0_0_auto] univer-items-center
|
|
339
338
|
univer-justify-center univer-text-base univer-text-gray-900
|
|
339
|
+
dark:univer-text-white
|
|
340
340
|
`,
|
|
341
|
-
children: /* @__PURE__ */
|
|
341
|
+
children: /* @__PURE__ */ f(ie, {})
|
|
342
342
|
}
|
|
343
343
|
),
|
|
344
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ f(K, { showIfEllipsis: !0, title: p, children: /* @__PURE__ */ f("span", { className: "univer-flex-1 univer-truncate", children: p }) })
|
|
345
345
|
]
|
|
346
346
|
}
|
|
347
347
|
),
|
|
348
348
|
/* @__PURE__ */ P("div", { className: "univer-flex univer-h-6 univer-flex-[0_0_auto] univer-items-center univer-justify-center", children: [
|
|
349
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ f(
|
|
350
350
|
"div",
|
|
351
351
|
{
|
|
352
352
|
className: `
|
|
@@ -356,13 +356,13 @@ const we = {
|
|
|
356
356
|
onClick: () => {
|
|
357
357
|
navigator.clipboard.writeText(p), t.show({
|
|
358
358
|
content: i.t("docLink.info.coped"),
|
|
359
|
-
type:
|
|
359
|
+
type: pn.Info
|
|
360
360
|
});
|
|
361
361
|
},
|
|
362
|
-
children: /* @__PURE__ */
|
|
362
|
+
children: /* @__PURE__ */ f(K, { placement: "bottom", title: i.t("docLink.info.copy"), children: /* @__PURE__ */ f(be, {}) })
|
|
363
363
|
}
|
|
364
364
|
),
|
|
365
|
-
/* @__PURE__ */
|
|
365
|
+
/* @__PURE__ */ f(
|
|
366
366
|
"div",
|
|
367
367
|
{
|
|
368
368
|
className: `
|
|
@@ -370,14 +370,14 @@ const we = {
|
|
|
370
370
|
univer-justify-center univer-rounded univer-text-base
|
|
371
371
|
`,
|
|
372
372
|
onClick: () => {
|
|
373
|
-
e.executeCommand(
|
|
373
|
+
e.executeCommand(R.id, {
|
|
374
374
|
link: r
|
|
375
375
|
});
|
|
376
376
|
},
|
|
377
|
-
children: /* @__PURE__ */
|
|
377
|
+
children: /* @__PURE__ */ f(K, { placement: "bottom", title: i.t("docLink.info.edit"), children: /* @__PURE__ */ f(Me, {}) })
|
|
378
378
|
}
|
|
379
379
|
),
|
|
380
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ f(
|
|
381
381
|
"div",
|
|
382
382
|
{
|
|
383
383
|
className: `
|
|
@@ -385,13 +385,13 @@ const we = {
|
|
|
385
385
|
univer-justify-center univer-rounded univer-text-base
|
|
386
386
|
`,
|
|
387
387
|
onClick: () => {
|
|
388
|
-
e.executeCommand(
|
|
388
|
+
e.executeCommand(Ee.id, {
|
|
389
389
|
unitId: s,
|
|
390
390
|
linkId: d.rangeId,
|
|
391
391
|
segmentId: l
|
|
392
392
|
});
|
|
393
393
|
},
|
|
394
|
-
children: /* @__PURE__ */
|
|
394
|
+
children: /* @__PURE__ */ f(K, { placement: "bottom", title: i.t("docLink.info.cancel"), children: /* @__PURE__ */ f(we, {}) })
|
|
395
395
|
}
|
|
396
396
|
)
|
|
397
397
|
] })
|
|
@@ -400,16 +400,16 @@ const we = {
|
|
|
400
400
|
);
|
|
401
401
|
};
|
|
402
402
|
B.componentKey = "univer.doc.link-info-popup";
|
|
403
|
-
var
|
|
404
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
403
|
+
var $n = Object.getOwnPropertyDescriptor, Hn = (n, e, t, i) => {
|
|
404
|
+
for (var r = i > 1 ? void 0 : i ? $n(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
405
405
|
(s = n[o]) && (r = s(r) || r);
|
|
406
406
|
return r;
|
|
407
407
|
}, G = (n, e) => (t, i) => e(t, i, n);
|
|
408
408
|
let y = class extends D {
|
|
409
409
|
constructor(e, t, i) {
|
|
410
410
|
super();
|
|
411
|
-
O(this, "_editingLink$", new
|
|
412
|
-
O(this, "_showingLink$", new
|
|
411
|
+
O(this, "_editingLink$", new he(null));
|
|
412
|
+
O(this, "_showingLink$", new he(null));
|
|
413
413
|
O(this, "editingLink$", this._editingLink$.asObservable());
|
|
414
414
|
O(this, "showingLink$", this._showingLink$.asObservable());
|
|
415
415
|
O(this, "_editPopup", null);
|
|
@@ -455,9 +455,9 @@ let y = class extends D {
|
|
|
455
455
|
this._editingLink$.next(null), (e = this._editPopup) == null || e.dispose();
|
|
456
456
|
}
|
|
457
457
|
showInfoPopup(e) {
|
|
458
|
-
var u,
|
|
458
|
+
var u, h, v, g, d, p;
|
|
459
459
|
const { linkId: t, unitId: i, segmentId: r, segmentPage: o, startIndex: s, endIndex: c } = e;
|
|
460
|
-
if (!(((u = this.showing) == null ? void 0 : u.linkId) === t && ((
|
|
460
|
+
if (!(((u = this.showing) == null ? void 0 : u.linkId) === t && ((h = this.showing) == null ? void 0 : h.unitId) === i && ((v = this.showing) == null ? void 0 : v.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, _.UNIVER_DOC))))
|
|
461
461
|
return this._showingLink$.next({ unitId: i, linkId: t, segmentId: r, segmentPage: o, startIndex: s, endIndex: c }), this._infoPopup = this._docCanvasPopupManagerService.attachPopupToRange(
|
|
462
462
|
{
|
|
463
463
|
collapsed: !1,
|
|
@@ -482,13 +482,13 @@ let y = class extends D {
|
|
|
482
482
|
this._showingLink$.next(null), (e = this._infoPopup) == null || e.dispose();
|
|
483
483
|
}
|
|
484
484
|
};
|
|
485
|
-
y =
|
|
486
|
-
G(0, I(
|
|
485
|
+
y = Hn([
|
|
486
|
+
G(0, I(rn)),
|
|
487
487
|
G(1, I(w)),
|
|
488
488
|
G(2, L)
|
|
489
489
|
], y);
|
|
490
|
-
var
|
|
491
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
490
|
+
var jn = Object.getOwnPropertyDescriptor, Kn = (n, e, t, i) => {
|
|
491
|
+
for (var r = i > 1 ? void 0 : i ? jn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
492
492
|
(s = n[o]) && (r = s(r) || r);
|
|
493
493
|
return r;
|
|
494
494
|
}, q = (n, e) => (t, i) => e(t, i, n);
|
|
@@ -500,18 +500,18 @@ let V = class extends D {
|
|
|
500
500
|
this.disposeWithMe(
|
|
501
501
|
this._commandService.onCommandExecuted((n) => {
|
|
502
502
|
var e, t, i;
|
|
503
|
-
if (n.id ===
|
|
503
|
+
if (n.id === Xe.id) {
|
|
504
504
|
const r = n.params, { unitId: o, ranges: s, segmentId: c } = r, l = this._univerInstanceService.getUnit(o, _.UNIVER_DOC), u = s[0];
|
|
505
505
|
if (u && l) {
|
|
506
|
-
const { startOffset:
|
|
506
|
+
const { startOffset: h, endOffset: v, collapsed: g, segmentPage: d } = u, p = (t = (e = l.getSelfOrHeaderFooterModel(c)) == null ? void 0 : e.getBody()) == null ? void 0 : t.customRanges;
|
|
507
507
|
if (g) {
|
|
508
|
-
const C = (i = p == null ? void 0 : p.findIndex((a) => a.startIndex <
|
|
508
|
+
const C = (i = p == null ? void 0 : p.findIndex((a) => a.startIndex < h && a.endIndex > v - 1)) != null ? i : -1;
|
|
509
509
|
if (C > -1) {
|
|
510
510
|
const a = p[C];
|
|
511
511
|
this._docHyperLinkService.showInfoPopup({ unitId: o, linkId: a.rangeId, segmentId: c, segmentPage: d, startIndex: a.startIndex, endIndex: a.endIndex });
|
|
512
512
|
return;
|
|
513
513
|
}
|
|
514
|
-
} else if (p == null ? void 0 : p.find((a) => a.startIndex <=
|
|
514
|
+
} else if (p == null ? void 0 : p.find((a) => a.startIndex <= h && a.endIndex >= v - 1))
|
|
515
515
|
return;
|
|
516
516
|
}
|
|
517
517
|
this._docHyperLinkService.hideInfoPopup(), this._docHyperLinkService.hideEditPopup();
|
|
@@ -520,19 +520,19 @@ let V = class extends D {
|
|
|
520
520
|
);
|
|
521
521
|
}
|
|
522
522
|
};
|
|
523
|
-
V =
|
|
523
|
+
V = Kn([
|
|
524
524
|
q(0, k),
|
|
525
525
|
q(1, L),
|
|
526
526
|
q(2, I(y))
|
|
527
527
|
], V);
|
|
528
|
-
var
|
|
529
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
528
|
+
var An = Object.getOwnPropertyDescriptor, Fn = (n, e, t, i) => {
|
|
529
|
+
for (var r = i > 1 ? void 0 : i ? An(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
530
530
|
(s = n[o]) && (r = s(r) || r);
|
|
531
531
|
return r;
|
|
532
532
|
}, M = (n, e) => (t, i) => e(t, i, n);
|
|
533
533
|
let ne = class extends D {
|
|
534
534
|
constructor(n, e, t, i, r, o) {
|
|
535
|
-
super(), this._context = n, this._docEventManagerService = e, this._commandService = t, this._hyperLinkPopupService = i, this._docSkeletonManagerService = r, this._docSelectionManagerService = o, !(this._context.unitId ===
|
|
535
|
+
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 === Fe) && (this._initHover(), this._initClick());
|
|
536
536
|
}
|
|
537
537
|
get _skeleton() {
|
|
538
538
|
return this._docSkeletonManagerService.getSkeleton();
|
|
@@ -571,7 +571,7 @@ let ne = class extends D {
|
|
|
571
571
|
this._docEventManagerService.clickCustomRanges$.subscribe((n) => {
|
|
572
572
|
const e = n.range;
|
|
573
573
|
e && this._commandService.executeCommand(
|
|
574
|
-
|
|
574
|
+
Ne.id,
|
|
575
575
|
{
|
|
576
576
|
unitId: this._context.unitId,
|
|
577
577
|
linkId: e.rangeId,
|
|
@@ -582,15 +582,15 @@ let ne = class extends D {
|
|
|
582
582
|
);
|
|
583
583
|
}
|
|
584
584
|
};
|
|
585
|
-
ne =
|
|
586
|
-
M(1, I(
|
|
585
|
+
ne = Fn([
|
|
586
|
+
M(1, I(on)),
|
|
587
587
|
M(2, k),
|
|
588
588
|
M(3, I(y)),
|
|
589
|
-
M(4, I(
|
|
589
|
+
M(4, I(en)),
|
|
590
590
|
M(5, I(w))
|
|
591
591
|
], ne);
|
|
592
|
-
var
|
|
593
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
592
|
+
var Bn = Object.getOwnPropertyDescriptor, Vn = (n, e, t, i) => {
|
|
593
|
+
for (var r = i > 1 ? void 0 : i ? Bn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
594
594
|
(s = n[o]) && (r = s(r) || r);
|
|
595
595
|
return r;
|
|
596
596
|
}, J = (n, e) => (t, i) => e(t, i, n);
|
|
@@ -599,7 +599,7 @@ let te = class extends D {
|
|
|
599
599
|
super(), this._context = n, this._docInterceptorService = e, this._hyperLinkService = t, this._docRenderController = i, this._init(), this._initReRender();
|
|
600
600
|
}
|
|
601
601
|
_init() {
|
|
602
|
-
this._docInterceptorService.intercept(
|
|
602
|
+
this._docInterceptorService.intercept(tn.CUSTOM_RANGE, {
|
|
603
603
|
handler: (n, e, t) => {
|
|
604
604
|
if (!n)
|
|
605
605
|
return t(n);
|
|
@@ -609,40 +609,40 @@ let te = class extends D {
|
|
|
609
609
|
...n,
|
|
610
610
|
active: !1
|
|
611
611
|
});
|
|
612
|
-
const { linkId: s, unitId: c, startIndex: l, endIndex: u } = o,
|
|
612
|
+
const { linkId: s, unitId: c, startIndex: l, endIndex: u } = o, h = c === i && n.rangeId === s && r >= l && r <= u;
|
|
613
613
|
return t({
|
|
614
614
|
...n,
|
|
615
|
-
active:
|
|
615
|
+
active: h
|
|
616
616
|
});
|
|
617
617
|
}
|
|
618
618
|
});
|
|
619
619
|
}
|
|
620
620
|
_initReRender() {
|
|
621
621
|
this.disposeWithMe(this._hyperLinkService.showingLink$.pipe(
|
|
622
|
-
|
|
623
|
-
|
|
622
|
+
dn((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)),
|
|
623
|
+
an()
|
|
624
624
|
).subscribe(([n, e]) => {
|
|
625
625
|
e ? e.unitId === this._context.unitId && this._docRenderController.reRender(e.unitId) : n && n.unitId === this._context.unitId && this._docRenderController.reRender(n.unitId);
|
|
626
626
|
}));
|
|
627
627
|
}
|
|
628
628
|
};
|
|
629
|
-
te =
|
|
630
|
-
J(1, I(
|
|
629
|
+
te = Vn([
|
|
630
|
+
J(1, I(nn)),
|
|
631
631
|
J(2, I(y)),
|
|
632
|
-
J(3, I(
|
|
632
|
+
J(3, I(sn))
|
|
633
633
|
], te);
|
|
634
|
-
const
|
|
634
|
+
const Ue = "doc-hyper-link-icon";
|
|
635
635
|
function Ce(n) {
|
|
636
636
|
return {
|
|
637
|
-
id:
|
|
637
|
+
id: R.id,
|
|
638
638
|
type: vn.BUTTON,
|
|
639
|
-
icon:
|
|
639
|
+
icon: Ue,
|
|
640
640
|
title: "docLink.menu.tooltip",
|
|
641
641
|
tooltip: "docLink.menu.tooltip",
|
|
642
|
-
hidden$:
|
|
643
|
-
disabled$: new
|
|
644
|
-
const i = n.get(w).textSelection$.pipe(
|
|
645
|
-
e.next(
|
|
642
|
+
hidden$: hn(n, _.UNIVER_DOC),
|
|
643
|
+
disabled$: new ln(function(e) {
|
|
644
|
+
const i = n.get(w).textSelection$.pipe(un(16)).subscribe(() => {
|
|
645
|
+
e.next(De(n));
|
|
646
646
|
});
|
|
647
647
|
return () => {
|
|
648
648
|
i.unsubscribe();
|
|
@@ -650,29 +650,29 @@ function Ce(n) {
|
|
|
650
650
|
})
|
|
651
651
|
};
|
|
652
652
|
}
|
|
653
|
-
const
|
|
654
|
-
id:
|
|
655
|
-
binding:
|
|
653
|
+
const Yn = {
|
|
654
|
+
id: R.id,
|
|
655
|
+
binding: fn.CTRL_COMMAND | X.K,
|
|
656
656
|
description: "docLink.menu.tooltip",
|
|
657
|
-
preconditions:
|
|
658
|
-
},
|
|
659
|
-
[
|
|
660
|
-
[
|
|
657
|
+
preconditions: cn
|
|
658
|
+
}, Zn = {
|
|
659
|
+
[_n.OTHERS]: {
|
|
660
|
+
[R.id]: {
|
|
661
661
|
order: 0,
|
|
662
662
|
menuItemFactory: Ce
|
|
663
663
|
}
|
|
664
664
|
},
|
|
665
|
-
[
|
|
666
|
-
[
|
|
667
|
-
[
|
|
665
|
+
[mn.MAIN_AREA]: {
|
|
666
|
+
[In.DATA]: {
|
|
667
|
+
[R.id]: {
|
|
668
668
|
order: 0,
|
|
669
669
|
menuItemFactory: Ce
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
};
|
|
674
|
-
var
|
|
675
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
674
|
+
var zn = Object.getOwnPropertyDescriptor, Wn = (n, e, t, i) => {
|
|
675
|
+
for (var r = i > 1 ? void 0 : i ? zn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
676
676
|
(s = n[o]) && (r = s(r) || r);
|
|
677
677
|
return r;
|
|
678
678
|
}, A = (n, e) => (t, i) => e(t, i, n);
|
|
@@ -684,53 +684,53 @@ let Y = class extends D {
|
|
|
684
684
|
[
|
|
685
685
|
[F, F.componentKey],
|
|
686
686
|
[B, B.componentKey],
|
|
687
|
-
[ie,
|
|
687
|
+
[ie, Ue]
|
|
688
688
|
].forEach(([n, e]) => {
|
|
689
689
|
this._componentManager.register(e, n);
|
|
690
690
|
});
|
|
691
691
|
}
|
|
692
692
|
_initCommands() {
|
|
693
693
|
[
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
694
|
+
Oe,
|
|
695
|
+
Pe,
|
|
696
|
+
Ee,
|
|
697
|
+
R,
|
|
698
698
|
ee,
|
|
699
|
-
|
|
699
|
+
Ne
|
|
700
700
|
].forEach((n) => {
|
|
701
701
|
this._commandService.registerCommand(n);
|
|
702
702
|
});
|
|
703
703
|
}
|
|
704
704
|
_initShortcut() {
|
|
705
|
-
[
|
|
705
|
+
[Yn].forEach((n) => {
|
|
706
706
|
this._shortcutService.registerShortcut(n);
|
|
707
707
|
});
|
|
708
708
|
}
|
|
709
709
|
_initMenus() {
|
|
710
|
-
this._menuManagerService.mergeMenu(
|
|
710
|
+
this._menuManagerService.mergeMenu(Zn);
|
|
711
711
|
}
|
|
712
712
|
};
|
|
713
|
-
Y =
|
|
714
|
-
A(0, I(
|
|
713
|
+
Y = Wn([
|
|
714
|
+
A(0, I(Cn)),
|
|
715
715
|
A(1, k),
|
|
716
|
-
A(2,
|
|
717
|
-
A(3,
|
|
716
|
+
A(2, Sn),
|
|
717
|
+
A(3, yn)
|
|
718
718
|
], Y);
|
|
719
|
-
const
|
|
720
|
-
var
|
|
721
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
719
|
+
const Gn = "DOC_HYPER_LINK_UI_PLUGIN";
|
|
720
|
+
var qn = Object.defineProperty, Jn = Object.getOwnPropertyDescriptor, Qn = (n, e, t) => e in n ? qn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Xn = (n, e, t, i) => {
|
|
721
|
+
for (var r = i > 1 ? void 0 : i ? Jn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
|
|
722
722
|
(s = n[o]) && (r = s(r) || r);
|
|
723
723
|
return r;
|
|
724
|
-
}, Q = (n, e) => (t, i) => e(t, i, n),
|
|
725
|
-
let Z = class extends
|
|
724
|
+
}, Q = (n, e) => (t, i) => e(t, i, n), Te = (n, e, t) => Qn(n, typeof e != "symbol" ? e + "" : e, t);
|
|
725
|
+
let Z = class extends Ze {
|
|
726
726
|
constructor(n = _e, e, t, i) {
|
|
727
727
|
super(), this._config = n, this._injector = e, this._renderManagerSrv = t, this._configService = i;
|
|
728
|
-
const { menu: r, ...o } =
|
|
728
|
+
const { menu: r, ...o } = ze(
|
|
729
729
|
{},
|
|
730
730
|
_e,
|
|
731
731
|
this._config
|
|
732
732
|
);
|
|
733
|
-
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(
|
|
733
|
+
r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(Ln, o);
|
|
734
734
|
}
|
|
735
735
|
onStarting() {
|
|
736
736
|
[
|
|
@@ -756,13 +756,13 @@ let Z = class extends Ve {
|
|
|
756
756
|
});
|
|
757
757
|
}
|
|
758
758
|
};
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
Z =
|
|
762
|
-
|
|
763
|
-
Q(1, I(
|
|
764
|
-
Q(2,
|
|
765
|
-
Q(3,
|
|
759
|
+
Te(Z, "pluginName", Gn);
|
|
760
|
+
Te(Z, "type", _.UNIVER_DOC);
|
|
761
|
+
Z = Xn([
|
|
762
|
+
Be(We),
|
|
763
|
+
Q(1, I(Ve)),
|
|
764
|
+
Q(2, Ge),
|
|
765
|
+
Q(3, Ye)
|
|
766
766
|
], Z);
|
|
767
767
|
export {
|
|
768
768
|
Z as UniverDocsHyperLinkUIPlugin
|