@univerjs/docs-hyper-link-ui 0.6.6-nightly.202503241607 → 0.6.6-nightly.202503251606

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/es/index.js CHANGED
@@ -1,27 +1,27 @@
1
- var He = Object.defineProperty;
2
- var je = (n, e, t) => e in n ? He(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var P = (n, e, t) => je(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { CommandType as M, ICommandService as O, generateRandomId as Be, CustomRangeType as b, IUniverInstanceService as x, UniverInstanceType as _, getBodySlice as ye, LocaleService as Oe, Tools as Ke, BuildTextUtils as me, Inject as I, Disposable as N, DOCS_ZEN_EDITOR_UNIT_ID_KEY as Ae, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Fe, DependentOn as Ve, Injector as Ye, IConfigService as Ze, Plugin as We, merge as Ge } from "@univerjs/core";
5
- import { UniverDocsHyperLinkPlugin as ze } from "@univerjs/docs-hyper-link";
6
- import { IRenderManagerService as qe } from "@univerjs/engine-render";
7
- import { addCustomRangeBySelectionFactory as Je, DocSelectionManagerService as w, replaceSelectionFactory as Qe, deleteCustomRangeFactory as Xe, SetTextSelectionsOperation as en, DocSkeletonManagerService as nn, DocInterceptorService as tn, DOC_INTERCEPTOR_POINT as rn } from "@univerjs/docs";
8
- import { DocCanvasPopManagerService as on, DocEventManagerService as sn, DocRenderController as cn, whenDocAndEditorFocused as dn } from "@univerjs/docs-ui";
9
- import { BehaviorSubject as ve, distinctUntilChanged as an, pairwise as ln, Observable as un, debounceTime as pn } from "rxjs";
10
- import { jsxs as R, jsx as h } from "react/jsx-runtime";
11
- import { FormLayout as Ie, Input as _e, Button as Ce, clsx as ke, Tooltip as K, MessageType as gn } from "@univerjs/design";
12
- import { useDependency as k, useObservable as xe, KeyCode as ne, IMessageService as hn, MetaKeys as fn, getMenuHiddenObservable as mn, MenuItemType as vn, ContextMenuPosition as In, ContextMenuGroup as _n, RibbonStartGroup as Cn, ComponentManager as kn, IMenuManagerService as Sn, IShortcutService as Ln } from "@univerjs/ui";
13
- import { useState as q, useEffect as yn, forwardRef as U, useRef as On, createElement as T } from "react";
14
- const xn = "docs-hyper-link-ui.config", Se = {}, Pe = {
15
- type: M.COMMAND,
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 O = (n, e, t) => Te(n, typeof e != "symbol" ? e + "" : e, t);
4
+ import { CommandType as R, ICommandService as k, generateRandomId as $e, CustomRangeType as E, IUniverInstanceService as L, UniverInstanceType as _, getBodySlice as Se, LocaleService as ye, Tools as He, BuildTextUtils as ve, Inject as I, Disposable as D, DOCS_ZEN_EDITOR_UNIT_ID_KEY as je, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ke, DependentOn as Ae, Injector as Fe, IConfigService as Be, Plugin as Ve, merge as Ye } from "@univerjs/core";
5
+ import { UniverDocsHyperLinkPlugin as Ze } from "@univerjs/docs-hyper-link";
6
+ import { IRenderManagerService as ze } from "@univerjs/engine-render";
7
+ import { addCustomRangeBySelectionFactory as We, DocSelectionManagerService as w, replaceSelectionFactory as Ge, deleteCustomRangeFactory as qe, SetTextSelectionsOperation as Je, DocSkeletonManagerService as Qe, DocInterceptorService as Xe, DOC_INTERCEPTOR_POINT as en } from "@univerjs/docs";
8
+ import { DocCanvasPopManagerService as nn, DocEventManagerService as tn, DocRenderController as rn, whenDocAndEditorFocused as on } from "@univerjs/docs-ui";
9
+ import { BehaviorSubject as fe, distinctUntilChanged as sn, pairwise as cn, Observable as dn, debounceTime as an } from "rxjs";
10
+ import { jsxs as P, jsx as v } from "react/jsx-runtime";
11
+ import { FormLayout as he, Input as me, Button as Ie, Tooltip as K, MessageType as ln } from "@univerjs/design";
12
+ import { useDependency as S, useObservable as xe, KeyCode as X, IMessageService as un, MetaKeys as pn, getMenuHiddenObservable as gn, MenuItemType as vn, ContextMenuPosition as fn, ContextMenuGroup as hn, RibbonStartGroup as mn, ComponentManager as In, IMenuManagerService as _n, IShortcutService as Cn } from "@univerjs/ui";
13
+ import { useState as W, useEffect as Sn, forwardRef as N, useRef as yn, createElement as U } from "react";
14
+ const xn = "docs-hyper-link-ui.config", _e = {}, ke = {
15
+ type: R.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(O), s = Be(), c = Je(
20
+ const { payload: t, unitId: i, selections: r } = e, o = n.get(k), s = $e(), c = We(
21
21
  n,
22
22
  {
23
23
  rangeId: s,
24
- rangeType: b.HYPERLINK,
24
+ rangeType: E.HYPERLINK,
25
25
  properties: {
26
26
  url: t
27
27
  },
@@ -31,25 +31,25 @@ const xn = "docs-hyper-link-ui.config", Se = {}, Pe = {
31
31
  );
32
32
  return c ? o.syncExecuteCommand(c.id, c.params) : !1;
33
33
  }
34
- }, Re = {
34
+ }, Le = {
35
35
  id: "docs.command.update-hyper-link",
36
- type: M.COMMAND,
36
+ type: R.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(O), c = n.get(x), u = n.get(w).getActiveTextRange(), f = c.getUnit(t, _.UNIVER_DOC);
41
+ const { unitId: t, payload: i, segmentId: r, linkId: o } = e, s = n.get(k), c = n.get(L), u = n.get(w).getActiveTextRange(), f = c.getUnit(t, _.UNIVER_DOC);
42
42
  if (!u || !f)
43
43
  return !1;
44
- const g = (p = ye(f.getSelfOrHeaderFooterModel(r).getBody(), u.startOffset, u.endOffset).textRuns) == null ? void 0 : p[0];
44
+ const g = (p = Se(f.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 = Qe(n, {
46
+ const d = Ge(n, {
47
47
  unitId: t,
48
48
  body: {
49
49
  dataStream: `${e.label}`,
50
50
  customRanges: [{
51
51
  rangeId: o,
52
- rangeType: b.HYPERLINK,
52
+ rangeType: E.HYPERLINK,
53
53
  startIndex: 0,
54
54
  endIndex: e.label.length + 1,
55
55
  properties: {
@@ -67,50 +67,46 @@ const xn = "docs-hyper-link-ui.config", Se = {}, Pe = {
67
67
  });
68
68
  return d ? s.syncExecuteCommand(d.id, d.params) : !1;
69
69
  }
70
- }, Pn = "univer-docs-link-edit", Rn = "univer-docs-link-edit-buttons", En = "univer-docs-link-edit-button", A = {
71
- docsLinkEdit: Pn,
72
- docsLinkEditButtons: Rn,
73
- docsLinkEditButton: En
74
70
  };
75
- function Mn(n) {
71
+ function kn(n) {
76
72
  return /^[a-zA-Z]+:\/\//.test(n);
77
73
  }
78
- function wn(n) {
74
+ function Ln(n) {
79
75
  return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(n);
80
76
  }
81
- function Dn(n) {
82
- return Mn(n) ? n : wn(n) ? `mailto://${n}` : `https://${n}`;
77
+ function On(n) {
78
+ return kn(n) ? n : Ln(n) ? `mailto://${n}` : `https://${n}`;
83
79
  }
84
- const V = () => {
85
- const n = k(S), e = k(Oe), t = xe(n.editingLink$), i = k(O), r = k(x), o = k(w), [s, c] = q(""), [l, u] = q(""), [f, m] = q(!1), g = Ke.isLegalUrl(s), d = t ? r.getUnit(t.unitId, _.UNIVER_DOC) : r.getCurrentUnitForType(_.UNIVER_DOC);
86
- yn(() => {
87
- var ce, de, ae, le, ue, pe, ge, he, fe;
80
+ const F = () => {
81
+ const n = S(y), e = S(ye), t = xe(n.editingLink$), i = S(k), r = S(L), o = S(w), [s, c] = W(""), [l, u] = W(""), [f, h] = W(!1), g = He.isLegalUrl(s), d = t ? r.getUnit(t.unitId, _.UNIVER_DOC) : r.getCurrentUnitForType(_.UNIVER_DOC);
82
+ Sn(() => {
83
+ var oe, se, ce, de, ae, le, ue, pe, ge;
88
84
  const a = o.getActiveTextRange();
89
85
  if (!a)
90
86
  return;
91
87
  if (t) {
92
- const j = (ce = d == null ? void 0 : d.getSelfOrHeaderFooterModel(t.segmentId)) == null ? void 0 : ce.getBody(), B = (de = j == null ? void 0 : j.customRanges) == null ? void 0 : de.find((z) => (t == null ? void 0 : t.linkId) === z.rangeId && z.startIndex === t.startIndex && z.endIndex === t.endIndex);
93
- d && B && (c((le = (ae = B.properties) == null ? void 0 : ae.url) != null ? le : ""), u(me.transform.getPlainText(ye(j, B.startIndex, B.endIndex + 1).dataStream)));
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(ve.transform.getPlainText(Se(H, j.startIndex, j.endIndex + 1).dataStream)));
94
90
  return;
95
91
  }
96
- const L = (ue = d == null ? void 0 : d.getSelfOrHeaderFooterModel(a.segmentId)) == null ? void 0 : ue.getBody(), se = L ? a : null, H = se && ((ge = me.customRange.getCustomRangesInterestsWithSelection(se, (pe = L == null ? void 0 : L.customRanges) != null ? pe : [])) == null ? void 0 : ge[0]);
97
- d && H && c((fe = (he = H == null ? void 0 : H.properties) == null ? void 0 : he.url) != null ? fe : "");
92
+ const x = (ae = d == null ? void 0 : d.getSelfOrHeaderFooterModel(a.segmentId)) == null ? void 0 : ae.getBody(), re = x ? a : null, $ = re && ((ue = ve.customRange.getCustomRangesInterestsWithSelection(re, (le = x == null ? void 0 : x.customRanges) != null ? le : [])) == null ? void 0 : ue[0]);
93
+ d && $ && c((ge = (pe = $ == null ? void 0 : $.properties) == null ? void 0 : pe.url) != null ? ge : "");
98
94
  }, [d, t, o, r]);
99
95
  const p = () => {
100
96
  n.hideEditPopup();
101
97
  }, C = () => {
102
- if (m(!0), !g || !d)
98
+ if (h(!0), !g || !d)
103
99
  return;
104
- const a = Dn(s);
100
+ const a = On(s);
105
101
  if (!t)
106
- i.executeCommand(Pe.id, {
102
+ i.executeCommand(ke.id, {
107
103
  unitId: d.getUnitId(),
108
104
  payload: a
109
105
  });
110
106
  else {
111
107
  if (!l)
112
108
  return;
113
- i.executeCommand(Re.id, {
109
+ i.executeCommand(Le.id, {
114
110
  unitId: d.getUnitId(),
115
111
  payload: a,
116
112
  linkId: t.linkId,
@@ -121,94 +117,95 @@ const V = () => {
121
117
  n.hideEditPopup();
122
118
  };
123
119
  if (d)
124
- return /* @__PURE__ */ R("div", { className: A.docsLinkEdit, children: [
125
- /* @__PURE__ */ R("div", { children: [
126
- t ? /* @__PURE__ */ h(
127
- Ie,
128
- {
129
- label: e.t("docLink.edit.label"),
130
- error: f && !l ? e.t("docLink.edit.labelError") : "",
131
- children: /* @__PURE__ */ h(
132
- _e,
120
+ return /* @__PURE__ */ P(
121
+ "div",
122
+ {
123
+ className: `
124
+ univer-box-border univer-w-[328px] univer-rounded-xl univer-border univer-border-solid
125
+ univer-border-gray-200 univer-bg-white univer-px-6 univer-py-5 univer-shadow
126
+ `,
127
+ children: [
128
+ /* @__PURE__ */ P("div", { children: [
129
+ t ? /* @__PURE__ */ v(
130
+ he,
133
131
  {
134
- value: l,
135
- onChange: u,
136
- autoFocus: !0,
137
- onKeyDown: (a) => {
138
- a.keyCode === ne.ENTER && C();
139
- }
132
+ label: e.t("docLink.edit.label"),
133
+ error: f && !l ? e.t("docLink.edit.labelError") : "",
134
+ children: /* @__PURE__ */ v(
135
+ me,
136
+ {
137
+ value: l,
138
+ onChange: u,
139
+ autoFocus: !0,
140
+ onKeyDown: (a) => {
141
+ a.keyCode === X.ENTER && C();
142
+ }
143
+ }
144
+ )
145
+ }
146
+ ) : null,
147
+ /* @__PURE__ */ v(
148
+ he,
149
+ {
150
+ label: e.t("docLink.edit.address"),
151
+ error: f && !g ? e.t("docLink.edit.addressError") : "",
152
+ children: /* @__PURE__ */ v(
153
+ me,
154
+ {
155
+ value: s,
156
+ onChange: c,
157
+ autoFocus: !0,
158
+ onKeyDown: (a) => {
159
+ a.keyCode === X.ENTER && C();
160
+ }
161
+ }
162
+ )
140
163
  }
141
164
  )
142
- }
143
- ) : null,
144
- /* @__PURE__ */ h(
145
- Ie,
146
- {
147
- label: e.t("docLink.edit.address"),
148
- error: f && !g ? e.t("docLink.edit.addressError") : "",
149
- children: /* @__PURE__ */ h(
150
- _e,
165
+ ] }),
166
+ /* @__PURE__ */ P("div", { className: "univer-flex univer-justify-end univer-gap-3", children: [
167
+ /* @__PURE__ */ v(Ie, { onClick: p, children: e.t("docLink.edit.cancel") }),
168
+ /* @__PURE__ */ v(
169
+ Ie,
151
170
  {
152
- value: s,
153
- onChange: c,
154
- autoFocus: !0,
155
- onKeyDown: (a) => {
156
- a.keyCode === ne.ENTER && C();
157
- }
171
+ type: "primary",
172
+ disabled: !s,
173
+ onClick: C,
174
+ children: e.t("docLink.edit.confirm")
158
175
  }
159
176
  )
160
- }
161
- )
162
- ] }),
163
- /* @__PURE__ */ R("div", { className: A.docsLinkEditButtons, children: [
164
- /* @__PURE__ */ h(
165
- Ce,
166
- {
167
- className: A.docsLinkEditButton,
168
- onClick: p,
169
- children: e.t("docLink.edit.cancel")
170
- }
171
- ),
172
- /* @__PURE__ */ h(
173
- Ce,
174
- {
175
- disabled: !s,
176
- className: A.docsLinkEditButton,
177
- type: "primary",
178
- onClick: C,
179
- children: e.t("docLink.edit.confirm")
180
- }
181
- )
182
- ] })
183
- ] });
177
+ ] })
178
+ ]
179
+ }
180
+ );
184
181
  };
185
- V.componentKey = "docs-hyper-link-edit";
186
- var v = function() {
187
- return v = Object.assign || function(n) {
182
+ F.componentKey = "docs-hyper-link-edit";
183
+ var m = function() {
184
+ return m = Object.assign || function(n) {
188
185
  for (var e, t = 1, i = arguments.length; t < i; t++) {
189
186
  e = arguments[t];
190
187
  for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
191
188
  }
192
189
  return n;
193
- }, v.apply(this, arguments);
194
- }, bn = function(n, e) {
190
+ }, m.apply(this, arguments);
191
+ }, Pn = function(n, e) {
195
192
  var t = {};
196
193
  for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
197
194
  if (n != null && typeof Object.getOwnPropertySymbols == "function")
198
195
  for (var r = 0, i = Object.getOwnPropertySymbols(n); r < i.length; r++)
199
196
  e.indexOf(i[r]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[r]) && (t[i[r]] = n[i[r]]);
200
197
  return t;
201
- }, $ = U(function(n, e) {
202
- 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 = On("_".concat(Tn()));
203
- return Ee(t, "".concat(i), { defIds: t.defIds, idSuffix: l.current }, v({ ref: e, className: c }, s), o);
198
+ }, T = N(function(n, e) {
199
+ var t = n.icon, i = n.id, r = n.className, o = n.extend, s = Pn(n, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), l = yn("_".concat(wn()));
200
+ return Oe(t, "".concat(i), { defIds: t.defIds, idSuffix: l.current }, m({ ref: e, className: c }, s), o);
204
201
  });
205
- function Ee(n, e, t, i, r) {
206
- return T(n.tag, v(v({ key: e }, Nn(n, t, r)), i), (Un(n, t).children || []).map(function(o, s) {
207
- return Ee(o, "".concat(e, "-").concat(n.tag, "-").concat(s), t, void 0, r);
202
+ function Oe(n, e, t, i, r) {
203
+ return U(n.tag, m(m({ key: e }, bn(n, t, r)), i), (Rn(n, t).children || []).map(function(o, s) {
204
+ return Oe(o, "".concat(e, "-").concat(n.tag, "-").concat(s), t, void 0, r);
208
205
  }));
209
206
  }
210
- function Nn(n, e, t) {
211
- var i = v({}, n.attrs);
207
+ function bn(n, e, t) {
208
+ var i = m({}, n.attrs);
212
209
  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) {
213
210
  var s = o[0], c = o[1];
214
211
  s === "mask" && typeof c == "string" && (i[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
@@ -219,157 +216,182 @@ function Nn(n, e, t) {
219
216
  typeof c == "string" && (i[s] = c.replace(/url\(#(.*)\)/, "url(#$1".concat(e.idSuffix, ")")));
220
217
  })), i;
221
218
  }
222
- function Un(n, e) {
219
+ function Rn(n, e) {
223
220
  var t, i = e.defIds;
224
- return !i || i.length === 0 ? n : n.tag === "defs" && (!((t = n.children) === null || t === void 0) && t.length) ? v(v({}, n), { children: n.children.map(function(r) {
225
- return typeof r.attrs.id == "string" && i && i.indexOf(r.attrs.id) > -1 ? v(v({}, r), { attrs: v(v({}, r.attrs), { id: r.attrs.id + e.idSuffix }) }) : r;
221
+ 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
+ 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;
226
223
  }) }) : n;
227
224
  }
228
- function Tn() {
225
+ function wn() {
229
226
  return Math.random().toString(36).substring(2, 8);
230
227
  }
231
- $.displayName = "UniverIcon";
232
- var $n = { 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" } }] }, Me = U(function(n, e) {
233
- return T($, Object.assign({}, n, {
228
+ T.displayName = "UniverIcon";
229
+ var Mn = { 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" } }] }, Pe = N(function(n, e) {
230
+ return U(T, Object.assign({}, n, {
234
231
  id: "copy-single",
235
232
  ref: e,
236
- icon: $n
233
+ icon: Mn
237
234
  }));
238
235
  });
239
- Me.displayName = "CopySingle";
240
- var Hn = { 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" } }] }, oe = U(function(n, e) {
241
- return T($, Object.assign({}, n, {
236
+ Pe.displayName = "CopySingle";
237
+ var En = { 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
+ return U(T, Object.assign({}, n, {
242
239
  id: "link-single",
243
240
  ref: e,
244
- icon: Hn
241
+ icon: En
245
242
  }));
246
243
  });
247
- oe.displayName = "LinkSingle";
248
- 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" } }] }, we = U(function(n, e) {
249
- return T($, Object.assign({}, n, {
244
+ ie.displayName = "LinkSingle";
245
+ var Dn = { 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" } }] }, be = N(function(n, e) {
246
+ return U(T, Object.assign({}, n, {
250
247
  id: "unlink-single",
251
248
  ref: e,
252
- icon: jn
249
+ icon: Dn
253
250
  }));
254
251
  });
255
- we.displayName = "UnlinkSingle";
256
- var Bn = { 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" } }] }, De = U(function(n, e) {
257
- return T($, Object.assign({}, n, {
252
+ be.displayName = "UnlinkSingle";
253
+ var Nn = { 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" } }] }, Re = N(function(n, e) {
254
+ return U(T, Object.assign({}, n, {
258
255
  id: "write-single",
259
256
  ref: e,
260
- icon: Bn
257
+ icon: Nn
261
258
  }));
262
259
  });
263
- De.displayName = "WriteSingle";
264
- const be = {
265
- type: M.COMMAND,
260
+ Re.displayName = "WriteSingle";
261
+ const we = {
262
+ type: R.COMMAND,
266
263
  id: "docs.command.delete-hyper-link",
267
264
  async handler(n, e) {
268
265
  if (!e)
269
266
  return !1;
270
- const { unitId: t, linkId: i, segmentId: r } = e, o = n.get(O), s = Xe(n, { unitId: t, rangeId: i, segmentId: r });
267
+ const { unitId: t, linkId: i, segmentId: r } = e, o = n.get(k), s = qe(n, { unitId: t, rangeId: i, segmentId: r });
271
268
  return s ? await o.syncExecuteCommand(s.id, s.params) : !1;
272
269
  }
273
- }, Ne = (n) => {
274
- const e = n.get(w), t = n.get(x), i = e.getTextRanges();
270
+ }, Me = (n) => {
271
+ const e = n.get(w), t = n.get(L), i = e.getTextRanges();
275
272
  if (!(i != null && i.length))
276
273
  return !0;
277
274
  const r = i[0];
278
275
  return !!(!t.getCurrentUnitForType(_.UNIVER_DOC) || !r || r.collapsed);
279
- }, E = {
280
- type: M.OPERATION,
276
+ }, b = {
277
+ type: R.OPERATION,
281
278
  id: "doc.operation.show-hyper-link-edit-popup",
282
279
  handler(n, e) {
283
280
  var s;
284
- const t = e == null ? void 0 : e.link, i = n.get(x);
285
- if (Ne(n) && !t)
281
+ const t = e == null ? void 0 : e.link, i = n.get(L);
282
+ if (Me(n) && !t)
286
283
  return !1;
287
- const r = n.get(S), o = (t == null ? void 0 : t.unitId) || ((s = i.getCurrentUnitForType(_.UNIVER_DOC)) == null ? void 0 : s.getUnitId());
284
+ const r = n.get(y), o = (t == null ? void 0 : t.unitId) || ((s = i.getCurrentUnitForType(_.UNIVER_DOC)) == null ? void 0 : s.getUnitId());
288
285
  return o ? (r.showEditPopup(o, t), !0) : !1;
289
286
  }
290
- }, te = {
291
- type: M.OPERATION,
287
+ }, ee = {
288
+ type: R.OPERATION,
292
289
  id: "doc.operation.toggle-hyper-link-info-popup",
293
290
  handler(n, e) {
294
- const t = n.get(S);
291
+ const t = n.get(y);
295
292
  return e ? (t.showInfoPopup(e), !0) : (t.hideInfoPopup(), !0);
296
293
  }
297
- }, Ue = {
298
- type: M.OPERATION,
294
+ }, Ee = {
295
+ type: R.OPERATION,
299
296
  id: "doc.operation.click-hyper-link",
300
297
  handler(n, e) {
301
- var u, f, m;
298
+ var u, f, h;
302
299
  if (!e)
303
300
  return !1;
304
- const { unitId: t, linkId: i, segmentId: r } = e, s = n.get(x).getUnit(t, _.UNIVER_DOC), c = s == null ? void 0 : s.getSelfOrHeaderFooterModel(r).getBody(), l = (m = (f = (u = c == null ? void 0 : c.customRanges) == null ? void 0 : u.find((g) => g.rangeId === i && g.rangeType === b.HYPERLINK)) == null ? void 0 : f.properties) == null ? void 0 : m.url;
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 = (h = (f = (u = c == null ? void 0 : c.customRanges) == null ? void 0 : u.find((g) => g.rangeId === i && g.rangeType === E.HYPERLINK)) == null ? void 0 : f.properties) == null ? void 0 : h.url;
305
302
  return l && window.open(l, "_blank", "noopener noreferrer"), !0;
306
303
  }
307
- }, Kn = "univer-doc-link", An = "univer-doc-link-type", Fn = "univer-doc-link-content", Vn = "univer-doc-link-url", Yn = "univer-doc-link-operations", Zn = "univer-doc-link-operation", y = {
308
- docLink: Kn,
309
- docLinkType: An,
310
- docLinkContent: Fn,
311
- docLinkUrl: Vn,
312
- docLinkOperations: Yn,
313
- docLinkOperation: Zn
314
- }, Y = () => {
304
+ }, B = () => {
315
305
  var C, a;
316
- const n = k(S), e = k(O), t = k(hn), i = k(Oe), r = xe(n.showingLink$), o = k(x);
306
+ const n = S(y), e = S(k), t = S(un), i = S(ye), r = xe(n.showingLink$), o = S(L);
317
307
  if (!r)
318
308
  return null;
319
- const { unitId: s, linkId: c, segmentId: l, startIndex: u, endIndex: f } = r, m = o.getUnit(s, _.UNIVER_DOC), g = m == null ? void 0 : m.getSelfOrHeaderFooterModel(l).getBody(), d = (C = g == null ? void 0 : g.customRanges) == null ? void 0 : C.find((L) => L.rangeId === c && L.rangeType === b.HYPERLINK && L.startIndex === u && L.endIndex === f);
309
+ const { unitId: s, linkId: c, segmentId: l, startIndex: u, endIndex: f } = r, h = o.getUnit(s, _.UNIVER_DOC), g = h == null ? void 0 : h.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 === f);
320
310
  if (!d)
321
311
  return null;
322
312
  const p = (a = d.properties) == null ? void 0 : a.url;
323
- return /* @__PURE__ */ R(
313
+ return /* @__PURE__ */ P(
324
314
  "div",
325
315
  {
326
- className: y.docLink,
316
+ className: `
317
+ univer-box-border univer-flex univer-max-w-[328px] univer-items-center univer-justify-between
318
+ univer-overflow-hidden univer-rounded-lg univer-border univer-border-solid univer-border-gray-200
319
+ univer-bg-white univer-p-3 univer-shadow
320
+ `,
327
321
  onClick: () => {
328
322
  n.hideInfoPopup();
329
323
  },
330
324
  children: [
331
- /* @__PURE__ */ R("div", { className: ke(y.docLinkContent), onClick: () => window.open(p), children: [
332
- /* @__PURE__ */ h("div", { className: y.docLinkType, children: /* @__PURE__ */ h(oe, {}) }),
333
- /* @__PURE__ */ h(K, { showIfEllipsis: !0, title: p, children: /* @__PURE__ */ h("span", { className: y.docLinkUrl, children: p }) })
334
- ] }),
335
- /* @__PURE__ */ R("div", { className: y.docLinkOperations, children: [
336
- /* @__PURE__ */ h(
325
+ /* @__PURE__ */ P(
326
+ "div",
327
+ {
328
+ className: `
329
+ univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-items-center univer-truncate
330
+ univer-text-[13px] univer-leading-5 univer-text-primary-500
331
+ `,
332
+ onClick: () => window.open(p, void 0, "noopener,noreferrer"),
333
+ children: [
334
+ /* @__PURE__ */ v(
335
+ "div",
336
+ {
337
+ className: `
338
+ univer-mr-2 univer-flex univer-size-5 univer-flex-[0_0_auto] univer-items-center
339
+ univer-justify-center univer-text-base univer-text-black
340
+ `,
341
+ children: /* @__PURE__ */ v(ie, {})
342
+ }
343
+ ),
344
+ /* @__PURE__ */ v(K, { showIfEllipsis: !0, title: p, children: /* @__PURE__ */ v("span", { className: "univer-flex-1 univer-truncate", children: p }) })
345
+ ]
346
+ }
347
+ ),
348
+ /* @__PURE__ */ P("div", { className: "univer-flex univer-h-6 univer-flex-[0_0_auto] univer-items-center univer-justify-center", children: [
349
+ /* @__PURE__ */ v(
337
350
  "div",
338
351
  {
339
- className: ke(y.docLinkOperation),
352
+ className: `
353
+ univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center
354
+ univer-justify-center univer-rounded univer-text-base
355
+ `,
340
356
  onClick: () => {
341
357
  navigator.clipboard.writeText(p), t.show({
342
358
  content: i.t("docLink.info.coped"),
343
- type: gn.Info
359
+ type: ln.Info
344
360
  });
345
361
  },
346
- children: /* @__PURE__ */ h(K, { placement: "bottom", title: i.t("docLink.info.copy"), children: /* @__PURE__ */ h(Me, {}) })
362
+ children: /* @__PURE__ */ v(K, { placement: "bottom", title: i.t("docLink.info.copy"), children: /* @__PURE__ */ v(Pe, {}) })
347
363
  }
348
364
  ),
349
- /* @__PURE__ */ h(
365
+ /* @__PURE__ */ v(
350
366
  "div",
351
367
  {
352
- className: y.docLinkOperation,
368
+ className: `
369
+ univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center
370
+ univer-justify-center univer-rounded univer-text-base
371
+ `,
353
372
  onClick: () => {
354
- e.executeCommand(E.id, {
373
+ e.executeCommand(b.id, {
355
374
  link: r
356
375
  });
357
376
  },
358
- children: /* @__PURE__ */ h(K, { placement: "bottom", title: i.t("docLink.info.edit"), children: /* @__PURE__ */ h(De, {}) })
377
+ children: /* @__PURE__ */ v(K, { placement: "bottom", title: i.t("docLink.info.edit"), children: /* @__PURE__ */ v(Re, {}) })
359
378
  }
360
379
  ),
361
- /* @__PURE__ */ h(
380
+ /* @__PURE__ */ v(
362
381
  "div",
363
382
  {
364
- className: y.docLinkOperation,
383
+ className: `
384
+ univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center
385
+ univer-justify-center univer-rounded univer-text-base
386
+ `,
365
387
  onClick: () => {
366
- e.executeCommand(be.id, {
388
+ e.executeCommand(we.id, {
367
389
  unitId: s,
368
390
  linkId: d.rangeId,
369
391
  segmentId: l
370
392
  });
371
393
  },
372
- children: /* @__PURE__ */ h(K, { placement: "bottom", title: i.t("docLink.info.cancel"), children: /* @__PURE__ */ h(we, {}) })
394
+ children: /* @__PURE__ */ v(K, { placement: "bottom", title: i.t("docLink.info.cancel"), children: /* @__PURE__ */ v(be, {}) })
373
395
  }
374
396
  )
375
397
  ] })
@@ -377,21 +399,21 @@ const be = {
377
399
  }
378
400
  );
379
401
  };
380
- Y.componentKey = "univer.doc.link-info-popup";
381
- var Wn = Object.getOwnPropertyDescriptor, Gn = (n, e, t, i) => {
382
- for (var r = i > 1 ? void 0 : i ? Wn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
402
+ B.componentKey = "univer.doc.link-info-popup";
403
+ var Un = Object.getOwnPropertyDescriptor, Tn = (n, e, t, i) => {
404
+ for (var r = i > 1 ? void 0 : i ? Un(e, t) : e, o = n.length - 1, s; o >= 0; o--)
383
405
  (s = n[o]) && (r = s(r) || r);
384
406
  return r;
385
- }, J = (n, e) => (t, i) => e(t, i, n);
386
- let S = class extends N {
407
+ }, G = (n, e) => (t, i) => e(t, i, n);
408
+ let y = class extends D {
387
409
  constructor(e, t, i) {
388
410
  super();
389
- P(this, "_editingLink$", new ve(null));
390
- P(this, "_showingLink$", new ve(null));
391
- P(this, "editingLink$", this._editingLink$.asObservable());
392
- P(this, "showingLink$", this._showingLink$.asObservable());
393
- P(this, "_editPopup", null);
394
- P(this, "_infoPopup", null);
411
+ O(this, "_editingLink$", new fe(null));
412
+ O(this, "_showingLink$", new fe(null));
413
+ O(this, "editingLink$", this._editingLink$.asObservable());
414
+ O(this, "showingLink$", this._showingLink$.asObservable());
415
+ O(this, "_editPopup", null);
416
+ O(this, "_infoPopup", null);
395
417
  this._docCanvasPopupManagerService = e, this._textSelectionManagerService = t, this._univerInstanceService = i, this.disposeWithMe(() => {
396
418
  this._editingLink$.complete(), this._showingLink$.complete();
397
419
  });
@@ -422,7 +444,7 @@ let S = class extends N {
422
444
  return r ? (this._editPopup = this._docCanvasPopupManagerService.attachPopupToRange(
423
445
  r,
424
446
  {
425
- componentKey: V.componentKey,
447
+ componentKey: F.componentKey,
426
448
  direction: "bottom"
427
449
  },
428
450
  e
@@ -433,9 +455,9 @@ let S = class extends N {
433
455
  this._editingLink$.next(null), (e = this._editPopup) == null || e.dispose();
434
456
  }
435
457
  showInfoPopup(e) {
436
- var u, f, m, g, d, p;
458
+ var u, f, h, g, d, p;
437
459
  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 && ((f = this.showing) == null ? void 0 : f.unitId) === i && ((m = this.showing) == null ? void 0 : m.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))))
460
+ if (!(((u = this.showing) == null ? void 0 : u.linkId) === t && ((f = this.showing) == null ? void 0 : f.unitId) === i && ((h = this.showing) == null ? void 0 : h.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))))
439
461
  return this._showingLink$.next({ unitId: i, linkId: t, segmentId: r, segmentPage: o, startIndex: s, endIndex: c }), this._infoPopup = this._docCanvasPopupManagerService.attachPopupToRange(
440
462
  {
441
463
  collapsed: !1,
@@ -445,7 +467,7 @@ let S = class extends N {
445
467
  segmentPage: o
446
468
  },
447
469
  {
448
- componentKey: Y.componentKey,
470
+ componentKey: B.componentKey,
449
471
  direction: "top-center",
450
472
  multipleDirection: "top",
451
473
  onClickOutside: () => {
@@ -460,17 +482,17 @@ let S = class extends N {
460
482
  this._showingLink$.next(null), (e = this._infoPopup) == null || e.dispose();
461
483
  }
462
484
  };
463
- S = Gn([
464
- J(0, I(on)),
465
- J(1, I(w)),
466
- J(2, x)
467
- ], S);
468
- var zn = Object.getOwnPropertyDescriptor, qn = (n, e, t, i) => {
469
- for (var r = i > 1 ? void 0 : i ? zn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
485
+ y = Tn([
486
+ G(0, I(nn)),
487
+ G(1, I(w)),
488
+ G(2, L)
489
+ ], y);
490
+ var $n = Object.getOwnPropertyDescriptor, Hn = (n, e, t, i) => {
491
+ for (var r = i > 1 ? void 0 : i ? $n(e, t) : e, o = n.length - 1, s; o >= 0; o--)
470
492
  (s = n[o]) && (r = s(r) || r);
471
493
  return r;
472
- }, Q = (n, e) => (t, i) => e(t, i, n);
473
- let Z = class extends N {
494
+ }, q = (n, e) => (t, i) => e(t, i, n);
495
+ let V = class extends D {
474
496
  constructor(n, e, t) {
475
497
  super(), this._commandService = n, this._univerInstanceService = e, this._docHyperLinkService = t, this._initSelectionChange();
476
498
  }
@@ -478,18 +500,18 @@ let Z = class extends N {
478
500
  this.disposeWithMe(
479
501
  this._commandService.onCommandExecuted((n) => {
480
502
  var e, t, i;
481
- if (n.id === en.id) {
503
+ if (n.id === Je.id) {
482
504
  const r = n.params, { unitId: o, ranges: s, segmentId: c } = r, l = this._univerInstanceService.getUnit(o, _.UNIVER_DOC), u = s[0];
483
505
  if (u && l) {
484
- const { startOffset: f, endOffset: m, collapsed: g, segmentPage: d } = u, p = (t = (e = l.getSelfOrHeaderFooterModel(c)) == null ? void 0 : e.getBody()) == null ? void 0 : t.customRanges;
506
+ const { startOffset: f, endOffset: h, collapsed: g, segmentPage: d } = u, p = (t = (e = l.getSelfOrHeaderFooterModel(c)) == null ? void 0 : e.getBody()) == null ? void 0 : t.customRanges;
485
507
  if (g) {
486
- const C = (i = p == null ? void 0 : p.findIndex((a) => a.startIndex < f && a.endIndex > m - 1)) != null ? i : -1;
508
+ const C = (i = p == null ? void 0 : p.findIndex((a) => a.startIndex < f && a.endIndex > h - 1)) != null ? i : -1;
487
509
  if (C > -1) {
488
510
  const a = p[C];
489
511
  this._docHyperLinkService.showInfoPopup({ unitId: o, linkId: a.rangeId, segmentId: c, segmentPage: d, startIndex: a.startIndex, endIndex: a.endIndex });
490
512
  return;
491
513
  }
492
- } else if (p == null ? void 0 : p.find((a) => a.startIndex <= f && a.endIndex >= m - 1))
514
+ } else if (p == null ? void 0 : p.find((a) => a.startIndex <= f && a.endIndex >= h - 1))
493
515
  return;
494
516
  }
495
517
  this._docHyperLinkService.hideInfoPopup(), this._docHyperLinkService.hideEditPopup();
@@ -498,39 +520,39 @@ let Z = class extends N {
498
520
  );
499
521
  }
500
522
  };
501
- Z = qn([
502
- Q(0, O),
503
- Q(1, x),
504
- Q(2, I(S))
505
- ], Z);
506
- var Jn = Object.getOwnPropertyDescriptor, Qn = (n, e, t, i) => {
507
- for (var r = i > 1 ? void 0 : i ? Jn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
523
+ V = Hn([
524
+ q(0, k),
525
+ q(1, L),
526
+ q(2, I(y))
527
+ ], V);
528
+ var jn = Object.getOwnPropertyDescriptor, Kn = (n, e, t, i) => {
529
+ for (var r = i > 1 ? void 0 : i ? jn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
508
530
  (s = n[o]) && (r = s(r) || r);
509
531
  return r;
510
- }, D = (n, e) => (t, i) => e(t, i, n);
511
- let ie = class extends N {
532
+ }, M = (n, e) => (t, i) => e(t, i, n);
533
+ let ne = class extends D {
512
534
  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 === Ae || this._context.unitId === Fe) && (this._initHover(), this._initClick());
535
+ super(), this._context = n, this._docEventManagerService = e, this._commandService = t, this._hyperLinkPopupService = i, this._docSkeletonManagerService = r, this._docSelectionManagerService = o, !(this._context.unitId === je || this._context.unitId === Ke) && (this._initHover(), this._initClick());
514
536
  }
515
537
  get _skeleton() {
516
538
  return this._docSkeletonManagerService.getSkeleton();
517
539
  }
518
540
  _hideInfoPopup() {
519
541
  this._hyperLinkPopupService.showing && this._commandService.executeCommand(
520
- te.id
542
+ ee.id
521
543
  );
522
544
  }
523
545
  _initHover() {
524
546
  this.disposeWithMe(
525
547
  this._docEventManagerService.hoverCustomRanges$.subscribe((n) => {
526
548
  var r;
527
- const e = n.find((o) => o.range.rangeType === b.HYPERLINK), t = this._docSelectionManagerService.getTextRanges(), i = t == null ? void 0 : t[0].segmentId;
549
+ const e = n.find((o) => o.range.rangeType === E.HYPERLINK), t = this._docSelectionManagerService.getTextRanges(), i = t == null ? void 0 : t[0].segmentId;
528
550
  if (((r = e == null ? void 0 : e.segmentId) != null ? r : "") !== i) {
529
551
  this._hideInfoPopup();
530
552
  return;
531
553
  }
532
554
  e ? this._commandService.executeCommand(
533
- te.id,
555
+ ee.id,
534
556
  {
535
557
  unitId: this._context.unitId,
536
558
  linkId: e.range.rangeId,
@@ -549,7 +571,7 @@ let ie = class extends N {
549
571
  this._docEventManagerService.clickCustomRanges$.subscribe((n) => {
550
572
  const e = n.range;
551
573
  e && this._commandService.executeCommand(
552
- Ue.id,
574
+ Ee.id,
553
575
  {
554
576
  unitId: this._context.unitId,
555
577
  linkId: e.rangeId,
@@ -560,24 +582,24 @@ let ie = class extends N {
560
582
  );
561
583
  }
562
584
  };
563
- ie = Qn([
564
- D(1, I(sn)),
565
- D(2, O),
566
- D(3, I(S)),
567
- D(4, I(nn)),
568
- D(5, I(w))
569
- ], ie);
570
- var Xn = Object.getOwnPropertyDescriptor, et = (n, e, t, i) => {
571
- for (var r = i > 1 ? void 0 : i ? Xn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
585
+ ne = Kn([
586
+ M(1, I(tn)),
587
+ M(2, k),
588
+ M(3, I(y)),
589
+ M(4, I(Qe)),
590
+ M(5, I(w))
591
+ ], ne);
592
+ var An = Object.getOwnPropertyDescriptor, Fn = (n, e, t, i) => {
593
+ for (var r = i > 1 ? void 0 : i ? An(e, t) : e, o = n.length - 1, s; o >= 0; o--)
572
594
  (s = n[o]) && (r = s(r) || r);
573
595
  return r;
574
- }, X = (n, e) => (t, i) => e(t, i, n);
575
- let re = class extends N {
596
+ }, J = (n, e) => (t, i) => e(t, i, n);
597
+ let te = class extends D {
576
598
  constructor(n, e, t, i) {
577
599
  super(), this._context = n, this._docInterceptorService = e, this._hyperLinkService = t, this._docRenderController = i, this._init(), this._initReRender();
578
600
  }
579
601
  _init() {
580
- this._docInterceptorService.intercept(rn.CUSTOM_RANGE, {
602
+ this._docInterceptorService.intercept(en.CUSTOM_RANGE, {
581
603
  handler: (n, e, t) => {
582
604
  if (!n)
583
605
  return t(n);
@@ -597,30 +619,30 @@ let re = class extends N {
597
619
  }
598
620
  _initReRender() {
599
621
  this.disposeWithMe(this._hyperLinkService.showingLink$.pipe(
600
- an((n, e) => (n == null ? void 0 : n.linkId) === (e == null ? void 0 : e.linkId) && (n == null ? void 0 : n.unitId) === (e == null ? void 0 : e.unitId) && (n == null ? void 0 : n.startIndex) === (e == null ? void 0 : e.startIndex)),
601
- ln()
622
+ sn((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
+ cn()
602
624
  ).subscribe(([n, e]) => {
603
625
  e ? e.unitId === this._context.unitId && this._docRenderController.reRender(e.unitId) : n && n.unitId === this._context.unitId && this._docRenderController.reRender(n.unitId);
604
626
  }));
605
627
  }
606
628
  };
607
- re = et([
608
- X(1, I(tn)),
609
- X(2, I(S)),
610
- X(3, I(cn))
611
- ], re);
612
- const Te = "doc-hyper-link-icon";
613
- function Le(n) {
629
+ te = Fn([
630
+ J(1, I(Xe)),
631
+ J(2, I(y)),
632
+ J(3, I(rn))
633
+ ], te);
634
+ const De = "doc-hyper-link-icon";
635
+ function Ce(n) {
614
636
  return {
615
- id: E.id,
637
+ id: b.id,
616
638
  type: vn.BUTTON,
617
- icon: Te,
639
+ icon: De,
618
640
  title: "docLink.menu.tooltip",
619
641
  tooltip: "docLink.menu.tooltip",
620
- hidden$: mn(n, _.UNIVER_DOC),
621
- disabled$: new un(function(e) {
622
- const i = n.get(w).textSelection$.pipe(pn(16)).subscribe(() => {
623
- e.next(Ne(n));
642
+ hidden$: gn(n, _.UNIVER_DOC),
643
+ disabled$: new dn(function(e) {
644
+ const i = n.get(w).textSelection$.pipe(an(16)).subscribe(() => {
645
+ e.next(Me(n));
624
646
  });
625
647
  return () => {
626
648
  i.unsubscribe();
@@ -628,120 +650,120 @@ function Le(n) {
628
650
  })
629
651
  };
630
652
  }
631
- const nt = {
632
- id: E.id,
633
- binding: fn.CTRL_COMMAND | ne.K,
653
+ const Bn = {
654
+ id: b.id,
655
+ binding: pn.CTRL_COMMAND | X.K,
634
656
  description: "docLink.menu.tooltip",
635
- preconditions: dn
636
- }, tt = {
637
- [Cn.OTHERS]: {
638
- [E.id]: {
657
+ preconditions: on
658
+ }, Vn = {
659
+ [mn.OTHERS]: {
660
+ [b.id]: {
639
661
  order: 0,
640
- menuItemFactory: Le
662
+ menuItemFactory: Ce
641
663
  }
642
664
  },
643
- [In.MAIN_AREA]: {
644
- [_n.DATA]: {
645
- [E.id]: {
665
+ [fn.MAIN_AREA]: {
666
+ [hn.DATA]: {
667
+ [b.id]: {
646
668
  order: 0,
647
- menuItemFactory: Le
669
+ menuItemFactory: Ce
648
670
  }
649
671
  }
650
672
  }
651
673
  };
652
- var it = Object.getOwnPropertyDescriptor, rt = (n, e, t, i) => {
653
- for (var r = i > 1 ? void 0 : i ? it(e, t) : e, o = n.length - 1, s; o >= 0; o--)
674
+ var Yn = Object.getOwnPropertyDescriptor, Zn = (n, e, t, i) => {
675
+ for (var r = i > 1 ? void 0 : i ? Yn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
654
676
  (s = n[o]) && (r = s(r) || r);
655
677
  return r;
656
- }, F = (n, e) => (t, i) => e(t, i, n);
657
- let W = class extends N {
678
+ }, A = (n, e) => (t, i) => e(t, i, n);
679
+ let Y = class extends D {
658
680
  constructor(n, e, t, i) {
659
681
  super(), this._componentManager = n, this._commandService = e, this._menuManagerService = t, this._shortcutService = i, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortcut();
660
682
  }
661
683
  _initComponents() {
662
684
  [
663
- [V, V.componentKey],
664
- [Y, Y.componentKey],
665
- [oe, Te]
685
+ [F, F.componentKey],
686
+ [B, B.componentKey],
687
+ [ie, De]
666
688
  ].forEach(([n, e]) => {
667
689
  this._componentManager.register(e, n);
668
690
  });
669
691
  }
670
692
  _initCommands() {
671
693
  [
672
- Pe,
673
- Re,
674
- be,
675
- E,
676
- te,
677
- Ue
694
+ ke,
695
+ Le,
696
+ we,
697
+ b,
698
+ ee,
699
+ Ee
678
700
  ].forEach((n) => {
679
701
  this._commandService.registerCommand(n);
680
702
  });
681
703
  }
682
704
  _initShortcut() {
683
- [nt].forEach((n) => {
705
+ [Bn].forEach((n) => {
684
706
  this._shortcutService.registerShortcut(n);
685
707
  });
686
708
  }
687
709
  _initMenus() {
688
- this._menuManagerService.mergeMenu(tt);
710
+ this._menuManagerService.mergeMenu(Vn);
689
711
  }
690
712
  };
691
- W = rt([
692
- F(0, I(kn)),
693
- F(1, O),
694
- F(2, Sn),
695
- F(3, Ln)
696
- ], W);
697
- const ot = "DOC_HYPER_LINK_UI_PLUGIN";
698
- var st = Object.defineProperty, ct = Object.getOwnPropertyDescriptor, dt = (n, e, t) => e in n ? st(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, at = (n, e, t, i) => {
699
- for (var r = i > 1 ? void 0 : i ? ct(e, t) : e, o = n.length - 1, s; o >= 0; o--)
713
+ Y = Zn([
714
+ A(0, I(In)),
715
+ A(1, k),
716
+ A(2, _n),
717
+ A(3, Cn)
718
+ ], Y);
719
+ const zn = "DOC_HYPER_LINK_UI_PLUGIN";
720
+ var Wn = Object.defineProperty, Gn = Object.getOwnPropertyDescriptor, qn = (n, e, t) => e in n ? Wn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Jn = (n, e, t, i) => {
721
+ for (var r = i > 1 ? void 0 : i ? Gn(e, t) : e, o = n.length - 1, s; o >= 0; o--)
700
722
  (s = n[o]) && (r = s(r) || r);
701
723
  return r;
702
- }, ee = (n, e) => (t, i) => e(t, i, n), $e = (n, e, t) => dt(n, typeof e != "symbol" ? e + "" : e, t);
703
- let G = class extends We {
704
- constructor(n = Se, e, t, i) {
724
+ }, Q = (n, e) => (t, i) => e(t, i, n), Ne = (n, e, t) => qn(n, typeof e != "symbol" ? e + "" : e, t);
725
+ let Z = class extends Ve {
726
+ constructor(n = _e, e, t, i) {
705
727
  super(), this._config = n, this._injector = e, this._renderManagerSrv = t, this._configService = i;
706
- const { menu: r, ...o } = Ge(
728
+ const { menu: r, ...o } = Ye(
707
729
  {},
708
- Se,
730
+ _e,
709
731
  this._config
710
732
  );
711
733
  r && this._configService.setConfig("menu", r, { merge: !0 }), this._configService.setConfig(xn, o);
712
734
  }
713
735
  onStarting() {
714
736
  [
715
- [S],
716
- [W],
717
- [Z]
737
+ [y],
738
+ [Y],
739
+ [V]
718
740
  ].forEach((e) => {
719
741
  this._injector.add(e);
720
- }), this._injector.get(W);
742
+ }), this._injector.get(Y);
721
743
  }
722
744
  onReady() {
723
- this._injector.get(Z);
745
+ this._injector.get(V);
724
746
  }
725
747
  onRendered() {
726
748
  this._initRenderModule();
727
749
  }
728
750
  _initRenderModule() {
729
751
  [
730
- [re],
731
- [ie]
752
+ [te],
753
+ [ne]
732
754
  ].forEach((n) => {
733
755
  this._renderManagerSrv.registerRenderModule(_.UNIVER_DOC, n);
734
756
  });
735
757
  }
736
758
  };
737
- $e(G, "pluginName", ot);
738
- $e(G, "type", _.UNIVER_DOC);
739
- G = at([
740
- Ve(ze),
741
- ee(1, I(Ye)),
742
- ee(2, qe),
743
- ee(3, Ze)
744
- ], G);
759
+ Ne(Z, "pluginName", zn);
760
+ Ne(Z, "type", _.UNIVER_DOC);
761
+ Z = Jn([
762
+ Ae(Ze),
763
+ Q(1, I(Fe)),
764
+ Q(2, ze),
765
+ Q(3, Be)
766
+ ], Z);
745
767
  export {
746
- G as UniverDocsHyperLinkUIPlugin
768
+ Z as UniverDocsHyperLinkUIPlugin
747
769
  };