@univerjs/sheets-hyper-link-ui 0.16.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +455 -450
- package/lib/index.js +455 -450
- package/lib/types/index.d.ts +2 -2
- package/lib/types/plugin.d.ts +3 -1
- package/lib/umd/index.js +1 -1
- package/package.json +15 -15
- /package/lib/types/{controllers/config.schema.d.ts → config/config.d.ts} +0 -0
- /package/lib/types/{controllers → menu}/menu.d.ts +0 -0
- /package/lib/types/{controllers/menu.schema.d.ts → menu/schema.d.ts} +0 -0
package/lib/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var A = (t, e, n) =>
|
|
4
|
-
import { Tools as
|
|
5
|
-
import { SetSelectionsOperation as
|
|
6
|
-
import { ScrollToRangeOperation as
|
|
7
|
-
import { DocSelectionManagerService as
|
|
8
|
-
import { DocSelectionRenderService as
|
|
9
|
-
import { IRenderManagerService as
|
|
10
|
-
import { IMessageService as
|
|
11
|
-
import { Subject as
|
|
12
|
-
import { jsxs as fe, jsx as v, Fragment as
|
|
13
|
-
import { MessageType as
|
|
14
|
-
import { IDefinedNamesService as
|
|
15
|
-
import { RangeSelector as
|
|
16
|
-
import { SheetHyperLinkType as C, ERROR_RANGE as
|
|
17
|
-
import { useState as j, useMemo as
|
|
18
|
-
import { SheetDataValidationModel as
|
|
1
|
+
var Jn = Object.defineProperty;
|
|
2
|
+
var Qn = (t, e, n) => e in t ? Jn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var A = (t, e, n) => Qn(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { Tools as We, IUniverInstanceService as G, ICommandService as te, Inject as y, LocaleService as ct, IConfigService as Sn, UniverInstanceType as k, isValidRange as yn, RANGE_TYPE as cn, Rectangle as Ie, Disposable as K, IContextService as er, ThemeService as tr, DataStreamTreeTokenType as un, CustomRangeType as Ne, BuildTextUtils as ve, ColorKit as nr, DOCS_ZEN_EDITOR_UNIT_ID_KEY as x, DisposableCollection as rr, FOCUSING_SHEET as Ct, generateRandomId as kt, Injector as ut, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as _e, DataValidationType as St, CommandType as lt, Range as En, ObjectMatrix as ir, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as sr, IPermissionService as or, InterceptorEffectEnum as ar, DependentOn as cr, Plugin as ur, merge as lr } from "@univerjs/core";
|
|
5
|
+
import { SetSelectionsOperation as Rn, SetWorksheetActiveOperation as Pn, SheetsSelectionsService as Tt, getSheetCommandTarget as Nt, rangeToDiscreteRange as dr, RangeProtectionPermissionEditPoint as xt, WorksheetEditPermission as Ot, WorksheetSetCellValuePermission as Ln, WorksheetInsertHyperlinkPermission as Mt, WorkbookEditablePermission as Ut, IAutoFillService as pr, AUTO_FILL_APPLY_TYPE as we, AutoFillTools as hr, SheetPermissionCheckController as wn, RangeProtectionPermissionViewPoint as gr, WorksheetViewPermission as mr, WorkbookViewPermission as vr, WorkbookCopyPermission as fr, WorksheetCopyPermission as _r, ClearSelectionContentCommand as Ir, ClearSelectionAllCommand as Cr, ClearSelectionFormatCommand as Sr, SheetInterceptorService as yr, INTERCEPTOR_POINT as Er } from "@univerjs/sheets";
|
|
6
|
+
import { ScrollToRangeOperation as bn, IEditorBridgeService as ee, IMarkSelectionService as Rr, SheetCanvasPopManagerService as Pr, getEditingCustomRangePosition as Lr, getCustomRangePosition as wr, ISheetClipboardService as br, virtualizeDiscreteRanges as Pt, COPY_TYPE as kr, PREDEFINED_HOOK_NAME_PASTE as Ve, getRepeatRange as Tr, whenSheetEditorFocused as Nr, getCurrentRangeDisable$ as xr, HoverManagerService as Or, HoverRenderController as Mr, SheetSkeletonManagerService as ln } from "@univerjs/sheets-ui";
|
|
7
|
+
import { DocSelectionManagerService as Ue } from "@univerjs/docs";
|
|
8
|
+
import { DocSelectionRenderService as kn, DocBackScrollRenderController as Ur, DocCanvasPopManagerService as Hr, calcDocRangePositions as Dr, DocEventManagerService as dn, UniverDocsUIPlugin as $r } from "@univerjs/docs-ui";
|
|
9
|
+
import { IRenderManagerService as He } from "@univerjs/engine-render";
|
|
10
|
+
import { IMessageService as Tn, useDependency as S, useObservable as Ar, IZenZoneService as dt, useEvent as Vr, KeyCode as Lt, MenuItemType as Nn, MetaKeys as Br, getMenuHiddenObservable as pt, ContextMenuPosition as Fr, ContextMenuGroup as Wr, RibbonInsertGroup as jr, ComponentManager as Zr, IMenuManagerService as Gr, IShortcutService as Kr } from "@univerjs/ui";
|
|
11
|
+
import { Subject as Yr, BehaviorSubject as zr, of as oe, map as Ht, switchMap as xe, combineLatest as Xr, debounceTime as je, Observable as qr } from "rxjs";
|
|
12
|
+
import { jsxs as fe, jsx as v, Fragment as Jr } from "react/jsx-runtime";
|
|
13
|
+
import { MessageType as ke, clsx as Ze, FormLayout as ge, Input as pn, Select as yt, Button as hn, borderClassName as xn, Tooltip as Be } from "@univerjs/design";
|
|
14
|
+
import { IDefinedNamesService as On, deserializeRangeWithSheet as Ge, serializeRangeWithSheet as Qr, serializeRangeToRefString as ei, serializeRange as ti } from "@univerjs/engine-formula";
|
|
15
|
+
import { RangeSelector as ni } from "@univerjs/sheets-formula-ui";
|
|
16
|
+
import { SheetHyperLinkType as C, ERROR_RANGE as ri, SheetsHyperLinkParserService as Dt, UpdateRichHyperLinkCommand as ii, UpdateHyperLinkCommand as si, AddRichHyperLinkCommand as oi, AddHyperLinkCommand as ai, CancelRichHyperLinkCommand as ci, CancelHyperLinkCommand as ui, HyperLinkModel as ht, RemoveHyperLinkMutation as Oe, AddHyperLinkMutation as Me, UniverSheetsHyperLinkPlugin as li } from "@univerjs/sheets-hyper-link";
|
|
17
|
+
import { useState as j, useMemo as Et, useRef as Mn, useCallback as di, useEffect as Q, createElement as ue, forwardRef as Se } from "react";
|
|
18
|
+
import { SheetDataValidationModel as gn } from "@univerjs/sheets-data-validation";
|
|
19
19
|
var m = /* @__PURE__ */ ((t) => (t.EDITING = "editing", t.VIEWING = "viewing", t.ZEN_EDITOR = "zen_mode", t))(m || {});
|
|
20
|
-
function
|
|
21
|
-
return
|
|
20
|
+
function Ye(t) {
|
|
21
|
+
return We.isLegalUrl(t);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function pi(t) {
|
|
24
24
|
return /^[a-zA-Z]+:\/\//.test(t);
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function hi(t) {
|
|
27
27
|
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(t);
|
|
28
28
|
}
|
|
29
|
-
function
|
|
30
|
-
if (
|
|
31
|
-
const e =
|
|
29
|
+
function gi(t) {
|
|
30
|
+
if (Ye(t)) {
|
|
31
|
+
const e = pi(t) ? t : hi(t) ? `mailto://${t}` : `http://${t}`;
|
|
32
32
|
let n;
|
|
33
33
|
try {
|
|
34
34
|
n = new URL(e);
|
|
@@ -39,15 +39,15 @@ function hi(t) {
|
|
|
39
39
|
}
|
|
40
40
|
return t;
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
var
|
|
44
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
42
|
+
const Un = "sheets-hyper-link-ui.config", mn = {};
|
|
43
|
+
var mi = Object.getOwnPropertyDescriptor, vi = (t, e, n, i) => {
|
|
44
|
+
for (var r = i > 1 ? void 0 : i ? mi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
45
45
|
(o = t[s]) && (r = o(r) || r);
|
|
46
46
|
return r;
|
|
47
47
|
}, me = (t, e) => (n, i) => e(n, i, t);
|
|
48
|
-
function
|
|
48
|
+
function fi(t, e) {
|
|
49
49
|
const n = e.getMergeData(), i = e.getMaxColumns() - 1, r = e.getMaxRows() - 1;
|
|
50
|
-
if (i < t.endColumn && (t.endColumn = i), r < t.endRow && (t.endRow = r), t.rangeType ===
|
|
50
|
+
if (i < t.endColumn && (t.endColumn = i), r < t.endRow && (t.endRow = r), t.rangeType === cn.COLUMN || cn.ROW)
|
|
51
51
|
return t;
|
|
52
52
|
const s = [];
|
|
53
53
|
return n.forEach((o) => {
|
|
@@ -74,14 +74,14 @@ let ce = class {
|
|
|
74
74
|
if (!u) {
|
|
75
75
|
this._messageService.show({
|
|
76
76
|
content: this._localeService.t("hyperLink.message.refError"),
|
|
77
|
-
type:
|
|
77
|
+
type: ke.Error
|
|
78
78
|
});
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
if (u.isSheetHidden()) {
|
|
82
82
|
this._messageService.show({
|
|
83
83
|
content: this._localeService.t("hyperLink.message.hiddenSheet"),
|
|
84
|
-
type:
|
|
84
|
+
type: ke.Error
|
|
85
85
|
});
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
@@ -89,8 +89,8 @@ let ce = class {
|
|
|
89
89
|
}
|
|
90
90
|
if (e) {
|
|
91
91
|
if (n) {
|
|
92
|
-
const o =
|
|
93
|
-
|
|
92
|
+
const o = Ge(n);
|
|
93
|
+
yn(o.range) && n !== ri && this.navigateToRange(s, e, o.range);
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
96
|
this.navigateToSheetById(s, e);
|
|
@@ -99,9 +99,9 @@ let ce = class {
|
|
|
99
99
|
async navigateToRange(t, e, n, i) {
|
|
100
100
|
const r = await this.navigateToSheetById(t, e);
|
|
101
101
|
if (r) {
|
|
102
|
-
const s =
|
|
102
|
+
const s = fi(n, r);
|
|
103
103
|
await this._commandService.executeCommand(
|
|
104
|
-
|
|
104
|
+
Rn.id,
|
|
105
105
|
{
|
|
106
106
|
unitId: t,
|
|
107
107
|
subUnitId: e,
|
|
@@ -110,7 +110,7 @@ let ce = class {
|
|
|
110
110
|
primary: null
|
|
111
111
|
}]
|
|
112
112
|
}
|
|
113
|
-
), await this._commandService.executeCommand(
|
|
113
|
+
), await this._commandService.executeCommand(bn.id, {
|
|
114
114
|
range: s,
|
|
115
115
|
forceTop: i
|
|
116
116
|
});
|
|
@@ -128,10 +128,10 @@ let ce = class {
|
|
|
128
128
|
const r = n.getSheetBySheetId(e);
|
|
129
129
|
return r ? n.getHiddenWorksheets().indexOf(e) > -1 ? (this._messageService.show({
|
|
130
130
|
content: this._localeService.t("hyperLink.message.hiddenSheet"),
|
|
131
|
-
type:
|
|
132
|
-
}), !1) : await this._commandService.executeCommand(
|
|
131
|
+
type: ke.Error
|
|
132
|
+
}), !1) : await this._commandService.executeCommand(Pn.id, { unitId: t, subUnitId: e }) ? r : !1 : (this._messageService.show({
|
|
133
133
|
content: this._localeService.t("hyperLink.message.noSheet"),
|
|
134
|
-
type:
|
|
134
|
+
type: ke.Error
|
|
135
135
|
}), !1);
|
|
136
136
|
}
|
|
137
137
|
async navigateToDefineName(t, e) {
|
|
@@ -139,21 +139,21 @@ let ce = class {
|
|
|
139
139
|
}
|
|
140
140
|
async navigateToOtherWebsite(t) {
|
|
141
141
|
var n;
|
|
142
|
-
const e = this._configService.getConfig(
|
|
142
|
+
const e = this._configService.getConfig(Un);
|
|
143
143
|
if ((n = e == null ? void 0 : e.urlHandler) != null && n.navigateToOtherWebsite)
|
|
144
144
|
return e.urlHandler.navigateToOtherWebsite(t);
|
|
145
145
|
window.open(t, "_blank", "noopener noreferrer");
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
|
-
ce =
|
|
148
|
+
ce = vi([
|
|
149
149
|
me(0, G),
|
|
150
150
|
me(1, te),
|
|
151
|
-
me(2,
|
|
152
|
-
me(3,
|
|
151
|
+
me(2, On),
|
|
152
|
+
me(3, Tn),
|
|
153
153
|
me(4, y(ct)),
|
|
154
|
-
me(5,
|
|
154
|
+
me(5, Sn)
|
|
155
155
|
], ce);
|
|
156
|
-
class
|
|
156
|
+
class Hn extends K {
|
|
157
157
|
constructor() {
|
|
158
158
|
super(...arguments);
|
|
159
159
|
A(this, "_customHyperLinks", /* @__PURE__ */ new Map());
|
|
@@ -181,18 +181,18 @@ class Un extends K {
|
|
|
181
181
|
super.dispose(), this._customHyperLinks.clear();
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
const
|
|
185
|
-
var
|
|
186
|
-
const [t, e] = j(""), [n, i] = j(!1), [r, s] = j(""), [o, c] = j(!0), [u, p] = j(C.URL), [l, g] = j(""), d = S(ct), _ = S(
|
|
184
|
+
const ze = () => {
|
|
185
|
+
var Gt;
|
|
186
|
+
const [t, e] = j(""), [n, i] = j(!1), [r, s] = j(""), [o, c] = j(!0), [u, p] = j(C.URL), [l, g] = j(""), d = S(ct), _ = S(On), I = S(ee), f = S(G), w = S(Z), a = Ar(w.currentEditing$), b = S(Dt), M = S(ce), T = S(te), P = S(Hn), D = Et(() => P.getOptions(), [P]), $ = S(dt), Y = S(He), ne = S(Rr), De = S(Ue), re = S(er), ye = S(tr), Ee = S(Ue), [Re, $e] = j(!1), de = S(Tt), Gn = Et(() => de.getCurrentSelections(), []), Ae = Et(() => {
|
|
187
187
|
if (!P.isBuiltInLinkType(u))
|
|
188
188
|
return P.getCustomHyperLink(u);
|
|
189
|
-
}, [P, u]), [pe,
|
|
190
|
-
s(h.replaceAll(
|
|
189
|
+
}, [P, u]), [pe, Kn] = j(!1), [Pe, jt] = j(!1), H = Mn(!1), V = f.getCurrentUnitForType(k.UNIVER_SHEET), Yn = (V == null ? void 0 : V.getActiveSheet().getSheetId()) || "", X = di((h) => {
|
|
190
|
+
s(h.replaceAll(un.CUSTOM_RANGE_START, "").replaceAll(un.CUSTOM_RANGE_END, ""));
|
|
191
191
|
}, [s]);
|
|
192
192
|
Q(() => {
|
|
193
|
-
var h, E, R, L, O, B,
|
|
193
|
+
var h, E, R, L, O, B, Kt, Yt, zt, Xt, qt, Jt, Qt, en, tn, nn, rn;
|
|
194
194
|
if ((a == null ? void 0 : a.row) !== void 0 && a.col !== void 0) {
|
|
195
|
-
const { customRange: ie, row:
|
|
195
|
+
const { customRange: ie, row: _t, col: It } = a;
|
|
196
196
|
let { label: z } = a;
|
|
197
197
|
typeof z == "number" && (z = `${z}`);
|
|
198
198
|
let F;
|
|
@@ -201,35 +201,35 @@ const Ye = () => {
|
|
|
201
201
|
id: (h = ie == null ? void 0 : ie.rangeId) != null ? h : "",
|
|
202
202
|
display: z != null ? z : "",
|
|
203
203
|
payload: (R = (E = ie == null ? void 0 : ie.properties) == null ? void 0 : E.url) != null ? R : "",
|
|
204
|
-
row:
|
|
205
|
-
column:
|
|
204
|
+
row: _t,
|
|
205
|
+
column: It
|
|
206
206
|
};
|
|
207
207
|
else if (a.type === m.VIEWING) {
|
|
208
|
-
const N = f.getUnit(a.unitId), J = N == null ? void 0 : N.getSheetBySheetId(a.subUnitId), U = J == null ? void 0 : J.getCellRaw(a.row, a.col), he = (B = (O = (L = U == null ? void 0 : U.p) == null ? void 0 : L.body) == null ? void 0 : O.customRanges) == null ? void 0 : B.find((
|
|
209
|
-
var
|
|
210
|
-
return
|
|
211
|
-
}),
|
|
212
|
-
U && (!ve.transform.isEmptyDocument((
|
|
208
|
+
const N = f.getUnit(a.unitId), J = N == null ? void 0 : N.getSheetBySheetId(a.subUnitId), U = J == null ? void 0 : J.getCellRaw(a.row, a.col), he = (B = (O = (L = U == null ? void 0 : U.p) == null ? void 0 : L.body) == null ? void 0 : O.customRanges) == null ? void 0 : B.find((on) => {
|
|
209
|
+
var an;
|
|
210
|
+
return on.rangeType === Ne.HYPERLINK && ((an = on.properties) == null ? void 0 : an.url);
|
|
211
|
+
}), Le = U == null ? void 0 : U.v;
|
|
212
|
+
U && (!ve.transform.isEmptyDocument((Yt = (Kt = U.p) == null ? void 0 : Kt.body) == null ? void 0 : Yt.dataStream) || We.isDefine(Le)) && c(!1), F = {
|
|
213
213
|
id: "",
|
|
214
214
|
display: "",
|
|
215
|
-
payload: (
|
|
216
|
-
row:
|
|
217
|
-
column:
|
|
215
|
+
payload: (Xt = (zt = he == null ? void 0 : he.properties) == null ? void 0 : zt.url) != null ? Xt : "",
|
|
216
|
+
row: _t,
|
|
217
|
+
column: It
|
|
218
218
|
};
|
|
219
219
|
} else {
|
|
220
|
-
const N = f.getCurrentUnitForType(k.UNIVER_DOC), J =
|
|
220
|
+
const N = f.getCurrentUnitForType(k.UNIVER_DOC), J = De.getActiveTextRange(), U = N == null ? void 0 : N.getBody(), he = J && U ? J : null, Le = he && ((Jt = ve.customRange.getCustomRangesInterestsWithSelection(he, (qt = U == null ? void 0 : U.customRanges) != null ? qt : [])) == null ? void 0 : Jt[0]);
|
|
221
221
|
c(!1), F = {
|
|
222
222
|
id: "",
|
|
223
223
|
display: z != null ? z : "",
|
|
224
|
-
payload: (
|
|
225
|
-
row:
|
|
226
|
-
column:
|
|
224
|
+
payload: (en = (Qt = Le == null ? void 0 : Le.properties) == null ? void 0 : Qt.url) != null ? en : "",
|
|
225
|
+
row: _t,
|
|
226
|
+
column: It
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
229
|
e(F.id);
|
|
230
|
-
const
|
|
231
|
-
if (
|
|
232
|
-
const N =
|
|
230
|
+
const sn = P.findCustomHyperLink(F);
|
|
231
|
+
if (sn) {
|
|
232
|
+
const N = sn.convert(F);
|
|
233
233
|
p(N.type), g(N.payload), X(N.display);
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
@@ -241,7 +241,7 @@ const Ye = () => {
|
|
|
241
241
|
break;
|
|
242
242
|
}
|
|
243
243
|
case C.RANGE: {
|
|
244
|
-
const N = q.searchObj, J = N.gid && (
|
|
244
|
+
const N = q.searchObj, J = N.gid && (rn = (nn = (tn = f.getUnit(a.unitId)) == null ? void 0 : tn.getSheetBySheetId(N.gid)) == null ? void 0 : nn.getName()) != null ? rn : "", U = Qr(J, Ge(N.range).range);
|
|
245
245
|
g(U), U === F.display && (H.current = !0);
|
|
246
246
|
break;
|
|
247
247
|
}
|
|
@@ -260,10 +260,10 @@ const Ye = () => {
|
|
|
260
260
|
break;
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
}, [a, M, P,
|
|
263
|
+
}, [a, M, P, De, f]), Q(() => {
|
|
264
264
|
let h = null;
|
|
265
|
-
if (a && !a.customRangeId && a.type === m.VIEWING &&
|
|
266
|
-
const E = f.getUnit(a.unitId, k.UNIVER_SHEET), R = E == null ? void 0 : E.getSheetBySheetId(a.subUnitId), L = R == null ? void 0 : R.getMergedCell(a.row, a.col), O = new
|
|
265
|
+
if (a && !a.customRangeId && a.type === m.VIEWING && We.isDefine(a.row) && We.isDefine(a.col)) {
|
|
266
|
+
const E = f.getUnit(a.unitId, k.UNIVER_SHEET), R = E == null ? void 0 : E.getSheetBySheetId(a.subUnitId), L = R == null ? void 0 : R.getMergedCell(a.row, a.col), O = new nr(ye.getColorFromTheme("primary.600")).toRgb();
|
|
267
267
|
h = ne.addShape(
|
|
268
268
|
{
|
|
269
269
|
range: L != null ? L : {
|
|
@@ -288,12 +288,12 @@ const Ye = () => {
|
|
|
288
288
|
return () => {
|
|
289
289
|
h && ne.removeShape(h);
|
|
290
290
|
};
|
|
291
|
-
}, [a, ne,
|
|
292
|
-
|
|
291
|
+
}, [a, ne, ye, f]), Q(() => {
|
|
292
|
+
jt(u === C.RANGE);
|
|
293
293
|
}, [u]), Q(() => {
|
|
294
|
-
const h = (a == null ? void 0 : a.type) === m.ZEN_EDITOR ? Y.getRenderById(x) : Y.getRenderById(I.getCurrentEditorId()), E = new
|
|
294
|
+
const h = (a == null ? void 0 : a.type) === m.ZEN_EDITOR ? Y.getRenderById(x) : Y.getRenderById(I.getCurrentEditorId()), E = new rr();
|
|
295
295
|
if (h) {
|
|
296
|
-
const R = h.with(
|
|
296
|
+
const R = h.with(kn);
|
|
297
297
|
R.setReserveRangesStatus(!0), E.add(() => {
|
|
298
298
|
R.setReserveRangesStatus(!1);
|
|
299
299
|
});
|
|
@@ -301,17 +301,17 @@ const Ye = () => {
|
|
|
301
301
|
return () => {
|
|
302
302
|
I.disableForceKeepVisible(), E.dispose();
|
|
303
303
|
};
|
|
304
|
-
}, [a == null ? void 0 : a.type, I, Y]), Q(() => (
|
|
304
|
+
}, [a == null ? void 0 : a.type, I, Y]), Q(() => (Pe && w.setIsKeepVisible(Pe), w.setIsKeepVisible(Re), () => {
|
|
305
305
|
w.setIsKeepVisible(!1);
|
|
306
|
-
}), [
|
|
307
|
-
$.temporaryHidden && ($.show(), re.setContextValue(
|
|
306
|
+
}), [Pe, Re, w]), Q(() => () => {
|
|
307
|
+
$.temporaryHidden && ($.show(), re.setContextValue(Ct, !1));
|
|
308
308
|
}, [re, $]), Q(() => {
|
|
309
|
-
if (
|
|
309
|
+
if (Pe)
|
|
310
310
|
return I.enableForceKeepVisible(), () => {
|
|
311
311
|
I.disableForceKeepVisible();
|
|
312
312
|
};
|
|
313
|
-
}, [
|
|
314
|
-
const
|
|
313
|
+
}, [Pe, I]);
|
|
314
|
+
const zn = [
|
|
315
315
|
{
|
|
316
316
|
label: d.t("hyperLink.form.link"),
|
|
317
317
|
value: C.URL
|
|
@@ -332,68 +332,68 @@ const Ye = () => {
|
|
|
332
332
|
];
|
|
333
333
|
if (!V)
|
|
334
334
|
return;
|
|
335
|
-
const
|
|
335
|
+
const Xn = V.getHiddenWorksheets(), mt = V.getSheets().map((h) => ({ label: h.getName(), value: h.getSheetId() })).filter((h) => Xn.indexOf(h.value) === -1), vt = Object.values((Gt = _.getDefinedNameMap(V.getUnitId())) != null ? Gt : {}).map((h) => ({
|
|
336
336
|
label: h.name,
|
|
337
337
|
value: h.id
|
|
338
|
-
})),
|
|
338
|
+
})), Zt = (h, E) => {
|
|
339
339
|
if (h === C.URL)
|
|
340
|
-
return
|
|
340
|
+
return gi(E);
|
|
341
341
|
if (h === C.RANGE) {
|
|
342
|
-
const R =
|
|
342
|
+
const R = Ge(E), L = V.getSheetBySheetName(R.sheetName);
|
|
343
343
|
if (L)
|
|
344
|
-
return `#gid=${L.getSheetId()}&range=${
|
|
344
|
+
return `#gid=${L.getSheetId()}&range=${ti(R.range)}`;
|
|
345
345
|
}
|
|
346
346
|
return `#${h}=${E}`;
|
|
347
|
-
},
|
|
347
|
+
}, qn = Vr((h) => {
|
|
348
348
|
var O;
|
|
349
|
-
const R = h.split(",").map(
|
|
350
|
-
if (!R || !
|
|
349
|
+
const R = h.split(",").map(Ge)[0];
|
|
350
|
+
if (!R || !yn(R.range))
|
|
351
351
|
return;
|
|
352
352
|
R.sheetName || (R.sheetName = ((O = V.getActiveSheet()) == null ? void 0 : O.getName()) || "");
|
|
353
|
-
const L =
|
|
353
|
+
const L = ei(R);
|
|
354
354
|
g(L), L && (H.current || !r) && (X(L), H.current = !0);
|
|
355
|
-
}),
|
|
356
|
-
if (o && !r || !l || u === C.URL && !
|
|
357
|
-
|
|
355
|
+
}), ft = async () => {
|
|
356
|
+
if (o && !r || !l || u === C.URL && !Ye(l)) {
|
|
357
|
+
Kn(!0);
|
|
358
358
|
return;
|
|
359
359
|
}
|
|
360
360
|
if (a)
|
|
361
361
|
if (t) {
|
|
362
|
-
const h = a.type === m.ZEN_EDITOR || a.type === m.EDITING ?
|
|
362
|
+
const h = a.type === m.ZEN_EDITOR || a.type === m.EDITING ? ii.id : si.id;
|
|
363
363
|
await T.executeCommand(h, {
|
|
364
364
|
id: t,
|
|
365
365
|
unitId: a.unitId,
|
|
366
366
|
subUnitId: a.subUnitId,
|
|
367
367
|
payload: {
|
|
368
368
|
display: o ? r : "",
|
|
369
|
-
payload:
|
|
369
|
+
payload: Zt(u, l)
|
|
370
370
|
},
|
|
371
371
|
row: a.row,
|
|
372
372
|
column: a.col,
|
|
373
373
|
documentId: a.type === m.ZEN_EDITOR ? x : I.getCurrentEditorId()
|
|
374
374
|
});
|
|
375
375
|
} else {
|
|
376
|
-
const h = a.type === m.ZEN_EDITOR || a.type === m.EDITING ?
|
|
376
|
+
const h = a.type === m.ZEN_EDITOR || a.type === m.EDITING ? oi.id : ai.id;
|
|
377
377
|
await T.executeCommand(h, {
|
|
378
378
|
unitId: a.unitId,
|
|
379
379
|
subUnitId: a.subUnitId,
|
|
380
380
|
link: {
|
|
381
|
-
id:
|
|
381
|
+
id: kt(),
|
|
382
382
|
row: a.row,
|
|
383
383
|
column: a.col,
|
|
384
|
-
payload:
|
|
384
|
+
payload: Zt(u, l),
|
|
385
385
|
display: o ? r : ""
|
|
386
386
|
},
|
|
387
387
|
documentId: a.type === m.ZEN_EDITOR ? x : I.getCurrentEditorId()
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
390
|
if ((a == null ? void 0 : a.type) === m.VIEWING) {
|
|
391
|
-
await T.executeCommand(
|
|
391
|
+
await T.executeCommand(Pn.id, {
|
|
392
392
|
unitId: a.unitId,
|
|
393
393
|
subUnitId: a.subUnitId
|
|
394
394
|
});
|
|
395
395
|
const h = 1;
|
|
396
|
-
await T.executeCommand(
|
|
396
|
+
await T.executeCommand(bn.id, {
|
|
397
397
|
range: {
|
|
398
398
|
startRow: Math.max(a.row - h, 0),
|
|
399
399
|
endRow: a.row + h,
|
|
@@ -402,12 +402,12 @@ const Ye = () => {
|
|
|
402
402
|
}
|
|
403
403
|
});
|
|
404
404
|
}
|
|
405
|
-
T.executeCommand(
|
|
405
|
+
T.executeCommand(qe.id);
|
|
406
406
|
};
|
|
407
407
|
return a ? /* @__PURE__ */ fe(
|
|
408
408
|
"div",
|
|
409
409
|
{
|
|
410
|
-
className:
|
|
410
|
+
className: Ze("univer-box-border univer-w-[296px] univer-rounded-xl univer-bg-white univer-p-4 univer-shadow-md dark:!univer-bg-gray-900", xn),
|
|
411
411
|
children: [
|
|
412
412
|
o ? /* @__PURE__ */ v(
|
|
413
413
|
ge,
|
|
@@ -415,7 +415,7 @@ const Ye = () => {
|
|
|
415
415
|
label: d.t("hyperLink.form.label"),
|
|
416
416
|
error: pe && !r ? d.t("hyperLink.form.inputError") : "",
|
|
417
417
|
children: /* @__PURE__ */ v(
|
|
418
|
-
|
|
418
|
+
pn,
|
|
419
419
|
{
|
|
420
420
|
value: r,
|
|
421
421
|
onChange: (h) => {
|
|
@@ -424,17 +424,17 @@ const Ye = () => {
|
|
|
424
424
|
placeholder: d.t("hyperLink.form.labelPlaceholder"),
|
|
425
425
|
autoFocus: !0,
|
|
426
426
|
onKeyDown: (h) => {
|
|
427
|
-
h.keyCode ===
|
|
427
|
+
h.keyCode === Lt.ENTER && ft();
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
)
|
|
431
431
|
}
|
|
432
432
|
) : null,
|
|
433
433
|
/* @__PURE__ */ v(ge, { label: d.t("hyperLink.form.type"), children: /* @__PURE__ */ v(
|
|
434
|
-
|
|
434
|
+
yt,
|
|
435
435
|
{
|
|
436
436
|
className: "univer-w-full",
|
|
437
|
-
options:
|
|
437
|
+
options: zn,
|
|
438
438
|
value: u,
|
|
439
439
|
onChange: (h) => {
|
|
440
440
|
p(h), g("");
|
|
@@ -444,9 +444,9 @@ const Ye = () => {
|
|
|
444
444
|
u === C.URL && /* @__PURE__ */ v(
|
|
445
445
|
ge,
|
|
446
446
|
{
|
|
447
|
-
error: pe ? l ?
|
|
447
|
+
error: pe ? l ? Ye(l) ? "" : d.t("hyperLink.form.linkError") : d.t("hyperLink.form.inputError") : "",
|
|
448
448
|
children: /* @__PURE__ */ v(
|
|
449
|
-
|
|
449
|
+
pn,
|
|
450
450
|
{
|
|
451
451
|
value: l,
|
|
452
452
|
onChange: (h) => {
|
|
@@ -455,72 +455,72 @@ const Ye = () => {
|
|
|
455
455
|
placeholder: d.t("hyperLink.form.linkPlaceholder"),
|
|
456
456
|
autoFocus: !0,
|
|
457
457
|
onKeyDown: (h) => {
|
|
458
|
-
h.keyCode ===
|
|
458
|
+
h.keyCode === Lt.ENTER && ft();
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
)
|
|
462
462
|
}
|
|
463
463
|
),
|
|
464
464
|
u === C.RANGE && /* @__PURE__ */ v(ge, { error: pe && !l ? d.t("hyperLink.form.inputError") : "", children: /* @__PURE__ */ v(
|
|
465
|
-
|
|
465
|
+
ni,
|
|
466
466
|
{
|
|
467
467
|
unitId: V.getUnitId(),
|
|
468
|
-
subUnitId:
|
|
468
|
+
subUnitId: Yn,
|
|
469
469
|
maxRangeCount: 1,
|
|
470
470
|
supportAcrossSheet: !0,
|
|
471
471
|
initialValue: l,
|
|
472
|
-
resetRange:
|
|
473
|
-
onChange: (h, E) =>
|
|
472
|
+
resetRange: Gn,
|
|
473
|
+
onChange: (h, E) => qn(E),
|
|
474
474
|
onRangeSelectorDialogVisibleChange: async (h) => {
|
|
475
475
|
var E, R;
|
|
476
|
-
if (
|
|
477
|
-
a.type === m.ZEN_EDITOR && ($.hide(), re.setContextValue(
|
|
476
|
+
if ($e(h), h)
|
|
477
|
+
a.type === m.ZEN_EDITOR && ($.hide(), re.setContextValue(Ct, !0)), a.type !== m.VIEWING && I.enableForceKeepVisible(), i(!0);
|
|
478
478
|
else {
|
|
479
479
|
if (await M.navigateToRange(a.unitId, a.subUnitId, { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col }, !0), a.type === m.ZEN_EDITOR) {
|
|
480
|
-
await T.executeCommand(
|
|
480
|
+
await T.executeCommand(Rn.id, {
|
|
481
481
|
unitId: a.unitId,
|
|
482
482
|
subUnitId: a.subUnitId,
|
|
483
483
|
selections: [{ range: { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col } }]
|
|
484
|
-
}), $.show(), re.setContextValue(
|
|
485
|
-
const L = (E = Y.getRenderById(x)) == null ? void 0 : E.with(
|
|
486
|
-
L && O && (L.scrollToRange(O),
|
|
484
|
+
}), $.show(), re.setContextValue(Ct, !1);
|
|
485
|
+
const L = (E = Y.getRenderById(x)) == null ? void 0 : E.with(Ur), O = (R = Ee.getTextRanges({ unitId: x, subUnitId: x })) == null ? void 0 : R[0];
|
|
486
|
+
L && O && (L.scrollToRange(O), Ee.refreshSelection({ unitId: x, subUnitId: x }));
|
|
487
487
|
}
|
|
488
488
|
I.disableForceKeepVisible(), i(!1);
|
|
489
489
|
}
|
|
490
490
|
},
|
|
491
|
-
onFocusChange: (h) =>
|
|
491
|
+
onFocusChange: (h) => jt(h)
|
|
492
492
|
}
|
|
493
493
|
) }),
|
|
494
494
|
u === C.SHEET && /* @__PURE__ */ v(ge, { error: pe && !l ? d.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ v(
|
|
495
|
-
|
|
495
|
+
yt,
|
|
496
496
|
{
|
|
497
497
|
className: "univer-w-full",
|
|
498
|
-
options:
|
|
498
|
+
options: mt,
|
|
499
499
|
value: l,
|
|
500
500
|
onChange: (h) => {
|
|
501
501
|
var L, O;
|
|
502
502
|
g(h);
|
|
503
|
-
const E = (L =
|
|
503
|
+
const E = (L = mt.find((B) => B.value === h)) == null ? void 0 : L.label, R = (O = mt.find((B) => B.value === l)) == null ? void 0 : O.label;
|
|
504
504
|
E && (H.current || !r || r === R) && (X(E), H.current = !0);
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
) }),
|
|
508
508
|
u === C.DEFINE_NAME && /* @__PURE__ */ v(ge, { error: pe && !l ? d.t("hyperLink.form.selectError") : "", children: /* @__PURE__ */ v(
|
|
509
|
-
|
|
509
|
+
yt,
|
|
510
510
|
{
|
|
511
511
|
className: "univer-w-full",
|
|
512
|
-
options:
|
|
512
|
+
options: vt,
|
|
513
513
|
value: l,
|
|
514
514
|
onChange: (h) => {
|
|
515
515
|
var L, O;
|
|
516
516
|
g(h);
|
|
517
|
-
const E = (L =
|
|
517
|
+
const E = (L = vt.find((B) => B.value === h)) == null ? void 0 : L.label, R = (O = vt.find((B) => B.value === l)) == null ? void 0 : O.label;
|
|
518
518
|
E && (H.current || !r || r === R) && (X(E), H.current = !0);
|
|
519
519
|
}
|
|
520
520
|
}
|
|
521
521
|
) }),
|
|
522
|
-
(
|
|
523
|
-
|
|
522
|
+
(Ae == null ? void 0 : Ae.Form) && /* @__PURE__ */ v(
|
|
523
|
+
Ae.Form,
|
|
524
524
|
{
|
|
525
525
|
linkId: t,
|
|
526
526
|
payload: l,
|
|
@@ -535,20 +535,20 @@ const Ye = () => {
|
|
|
535
535
|
),
|
|
536
536
|
/* @__PURE__ */ fe("div", { className: "univer-flex univer-flex-row univer-justify-end univer-gap-2", children: [
|
|
537
537
|
/* @__PURE__ */ v(
|
|
538
|
-
|
|
538
|
+
hn,
|
|
539
539
|
{
|
|
540
540
|
onClick: () => {
|
|
541
|
-
a && M.navigateToRange(a.unitId, a.subUnitId, { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col }, !0), T.executeCommand(
|
|
541
|
+
a && M.navigateToRange(a.unitId, a.subUnitId, { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col }, !0), T.executeCommand(qe.id);
|
|
542
542
|
},
|
|
543
543
|
children: d.t("hyperLink.form.cancel")
|
|
544
544
|
}
|
|
545
545
|
),
|
|
546
546
|
/* @__PURE__ */ v(
|
|
547
|
-
|
|
547
|
+
hn,
|
|
548
548
|
{
|
|
549
549
|
variant: "primary",
|
|
550
550
|
onClick: async () => {
|
|
551
|
-
|
|
551
|
+
ft();
|
|
552
552
|
},
|
|
553
553
|
children: d.t("hyperLink.form.ok")
|
|
554
554
|
}
|
|
@@ -558,10 +558,10 @@ const Ye = () => {
|
|
|
558
558
|
}
|
|
559
559
|
) : null;
|
|
560
560
|
};
|
|
561
|
-
|
|
561
|
+
ze.componentKey = "univer.sheet.cell-link-edit";
|
|
562
562
|
function le({ ref: t, ...e }) {
|
|
563
|
-
const { icon: n, id: i, className: r, extend: s, ...o } = e, c = `univerjs-icon univerjs-icon-${i} ${r || ""}`.trim(), u =
|
|
564
|
-
return
|
|
563
|
+
const { icon: n, id: i, className: r, extend: s, ...o } = e, c = `univerjs-icon univerjs-icon-${i} ${r || ""}`.trim(), u = Mn(`_${Ci()}`);
|
|
564
|
+
return Dn(n, `${i}`, {
|
|
565
565
|
defIds: n.defIds,
|
|
566
566
|
idSuffix: u.current
|
|
567
567
|
}, {
|
|
@@ -570,14 +570,14 @@ function le({ ref: t, ...e }) {
|
|
|
570
570
|
...o
|
|
571
571
|
}, s);
|
|
572
572
|
}
|
|
573
|
-
function
|
|
573
|
+
function Dn(t, e, n, i, r) {
|
|
574
574
|
return ue(t.tag, {
|
|
575
575
|
key: e,
|
|
576
|
-
...
|
|
576
|
+
..._i(t, n, r),
|
|
577
577
|
...i
|
|
578
|
-
}, (
|
|
578
|
+
}, (Ii(t, n).children || []).map((s, o) => Dn(s, `${e}-${t.tag}-${o}`, n, void 0, r)));
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function _i(t, e, n) {
|
|
581
581
|
const i = { ...t.attrs };
|
|
582
582
|
n != null && n.colorChannel1 && i.fill === "colorChannel1" && (i.fill = n.colorChannel1), t.tag === "mask" && i.id && (i.id = i.id + e.idSuffix), Object.entries(i).forEach(([s, o]) => {
|
|
583
583
|
s === "mask" && typeof o == "string" && (i[s] = o.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
|
|
@@ -587,7 +587,7 @@ function fi(t, e, n) {
|
|
|
587
587
|
typeof o == "string" && (i[s] = o.replace(/url\(#(.*)\)/, `url(#$1${e.idSuffix})`));
|
|
588
588
|
})), i;
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function Ii(t, e) {
|
|
591
591
|
var i;
|
|
592
592
|
const { defIds: n } = e;
|
|
593
593
|
return !n || n.length === 0 ? t : t.tag === "defs" && ((i = t.children) != null && i.length) ? {
|
|
@@ -601,11 +601,11 @@ function _i(t, e) {
|
|
|
601
601
|
} : r)
|
|
602
602
|
} : t;
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function Ci() {
|
|
605
605
|
return Math.random().toString(36).substring(2, 8);
|
|
606
606
|
}
|
|
607
607
|
le.displayName = "UniverIcon";
|
|
608
|
-
const
|
|
608
|
+
const Si = {
|
|
609
609
|
tag: "svg",
|
|
610
610
|
attrs: {
|
|
611
611
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -623,15 +623,15 @@ const Ci = {
|
|
|
623
623
|
clipRule: "evenodd"
|
|
624
624
|
}
|
|
625
625
|
}]
|
|
626
|
-
},
|
|
626
|
+
}, Ke = Se(function(e, n) {
|
|
627
627
|
return ue(le, Object.assign({}, e, {
|
|
628
628
|
id: "all-border-icon",
|
|
629
629
|
ref: n,
|
|
630
|
-
icon:
|
|
630
|
+
icon: Si
|
|
631
631
|
}));
|
|
632
632
|
});
|
|
633
|
-
|
|
634
|
-
const
|
|
633
|
+
Ke.displayName = "AllBorderIcon";
|
|
634
|
+
const yi = {
|
|
635
635
|
tag: "svg",
|
|
636
636
|
attrs: {
|
|
637
637
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -649,15 +649,15 @@ const Si = {
|
|
|
649
649
|
clipRule: "evenodd"
|
|
650
650
|
}
|
|
651
651
|
}]
|
|
652
|
-
},
|
|
652
|
+
}, $n = Se(function(e, n) {
|
|
653
653
|
return ue(le, Object.assign({}, e, {
|
|
654
654
|
id: "copy-icon",
|
|
655
655
|
ref: n,
|
|
656
|
-
icon:
|
|
656
|
+
icon: yi
|
|
657
657
|
}));
|
|
658
658
|
});
|
|
659
|
-
|
|
660
|
-
const
|
|
659
|
+
$n.displayName = "CopyIcon";
|
|
660
|
+
const Ei = {
|
|
661
661
|
tag: "svg",
|
|
662
662
|
attrs: {
|
|
663
663
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -679,15 +679,15 @@ const yi = {
|
|
|
679
679
|
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"
|
|
680
680
|
}
|
|
681
681
|
}]
|
|
682
|
-
},
|
|
682
|
+
}, $t = Se(function(e, n) {
|
|
683
683
|
return ue(le, Object.assign({}, e, {
|
|
684
684
|
id: "link-icon",
|
|
685
685
|
ref: n,
|
|
686
|
-
icon:
|
|
686
|
+
icon: Ei
|
|
687
687
|
}));
|
|
688
688
|
});
|
|
689
|
-
|
|
690
|
-
const
|
|
689
|
+
$t.displayName = "LinkIcon";
|
|
690
|
+
const Ri = {
|
|
691
691
|
tag: "svg",
|
|
692
692
|
attrs: {
|
|
693
693
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -719,15 +719,15 @@ const Ei = {
|
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
721
|
]
|
|
722
|
-
},
|
|
722
|
+
}, An = Se(function(e, n) {
|
|
723
723
|
return ue(le, Object.assign({}, e, {
|
|
724
724
|
id: "unlink-icon",
|
|
725
725
|
ref: n,
|
|
726
|
-
icon:
|
|
726
|
+
icon: Ri
|
|
727
727
|
}));
|
|
728
728
|
});
|
|
729
|
-
|
|
730
|
-
const
|
|
729
|
+
An.displayName = "UnlinkIcon";
|
|
730
|
+
const Pi = {
|
|
731
731
|
tag: "svg",
|
|
732
732
|
attrs: {
|
|
733
733
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -751,15 +751,15 @@ const Ri = {
|
|
|
751
751
|
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"
|
|
752
752
|
}
|
|
753
753
|
}]
|
|
754
|
-
},
|
|
754
|
+
}, Vn = Se(function(e, n) {
|
|
755
755
|
return ue(le, Object.assign({}, e, {
|
|
756
756
|
id: "write-icon",
|
|
757
757
|
ref: n,
|
|
758
|
-
icon:
|
|
758
|
+
icon: Pi
|
|
759
759
|
}));
|
|
760
760
|
});
|
|
761
|
-
|
|
762
|
-
const
|
|
761
|
+
Vn.displayName = "WriteIcon";
|
|
762
|
+
const Li = {
|
|
763
763
|
tag: "svg",
|
|
764
764
|
attrs: {
|
|
765
765
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -793,36 +793,36 @@ const Pi = {
|
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
795
|
]
|
|
796
|
-
},
|
|
796
|
+
}, Bn = Se(function(e, n) {
|
|
797
797
|
return ue(le, Object.assign({}, e, {
|
|
798
798
|
id: "xlsx-multi-icon",
|
|
799
799
|
ref: n,
|
|
800
|
-
icon:
|
|
800
|
+
icon: Li
|
|
801
801
|
}));
|
|
802
802
|
});
|
|
803
|
-
|
|
804
|
-
const
|
|
805
|
-
[C.URL]: /* @__PURE__ */ v(
|
|
806
|
-
[C.SHEET]: /* @__PURE__ */ v(
|
|
807
|
-
[C.RANGE]: /* @__PURE__ */ v(
|
|
808
|
-
[C.DEFINE_NAME]: /* @__PURE__ */ v(
|
|
809
|
-
[C.INVALID]: /* @__PURE__ */ v(
|
|
810
|
-
},
|
|
803
|
+
Bn.displayName = "XlsxMultiIcon";
|
|
804
|
+
const wi = {
|
|
805
|
+
[C.URL]: /* @__PURE__ */ v($t, {}),
|
|
806
|
+
[C.SHEET]: /* @__PURE__ */ v(Bn, { className: "univer-text-green-500" }),
|
|
807
|
+
[C.RANGE]: /* @__PURE__ */ v(Ke, {}),
|
|
808
|
+
[C.DEFINE_NAME]: /* @__PURE__ */ v(Ke, {}),
|
|
809
|
+
[C.INVALID]: /* @__PURE__ */ v(Ke, {})
|
|
810
|
+
}, vn = (t) => {
|
|
811
811
|
var M, T;
|
|
812
|
-
const e = S(Z), n = S(te), i = S(
|
|
812
|
+
const e = S(Z), n = S(te), i = S(Tn), r = S(ct), s = S(ce), o = S(ee), c = S(Dt), u = S(dt), { customRange: p, row: l, col: g, unitId: d, subUnitId: _, editPermission: I, copyPermission: f, type: w } = t;
|
|
813
813
|
if (!((M = p == null ? void 0 : p.properties) != null && M.url))
|
|
814
814
|
return null;
|
|
815
815
|
const a = c.parseHyperLink((T = p.properties.url) != null ? T : ""), b = a.type === C.INVALID;
|
|
816
816
|
return /* @__PURE__ */ fe(
|
|
817
817
|
"div",
|
|
818
818
|
{
|
|
819
|
-
className:
|
|
819
|
+
className: Ze("univer-mb-1 univer-flex univer-max-w-80 univer-flex-row univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow-md dark:!univer-bg-gray-900", xn),
|
|
820
820
|
onClick: () => e.hideCurrentPopup(),
|
|
821
821
|
children: [
|
|
822
822
|
/* @__PURE__ */ fe(
|
|
823
823
|
"div",
|
|
824
824
|
{
|
|
825
|
-
className:
|
|
825
|
+
className: Ze("univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-flex-row univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-600", { "univer-text-red-500": b }),
|
|
826
826
|
onClick: () => {
|
|
827
827
|
u.visible || b || s.navigate(a);
|
|
828
828
|
},
|
|
@@ -831,10 +831,10 @@ const Li = {
|
|
|
831
831
|
"div",
|
|
832
832
|
{
|
|
833
833
|
className: "univer-mr-2 univer-flex univer-size-5 univer-flex-none univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white",
|
|
834
|
-
children:
|
|
834
|
+
children: wi[a.type]
|
|
835
835
|
}
|
|
836
836
|
),
|
|
837
|
-
/* @__PURE__ */ v(
|
|
837
|
+
/* @__PURE__ */ v(Be, { showIfEllipsis: !0, title: a.name, asChild: !0, children: /* @__PURE__ */ v("span", { className: "univer-flex-1 univer-truncate", children: a.name }) })
|
|
838
838
|
]
|
|
839
839
|
}
|
|
840
840
|
),
|
|
@@ -846,7 +846,7 @@ const Li = {
|
|
|
846
846
|
f && /* @__PURE__ */ v(
|
|
847
847
|
"div",
|
|
848
848
|
{
|
|
849
|
-
className:
|
|
849
|
+
className: Ze("univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700", { "univer-text-red-500": b }),
|
|
850
850
|
onClick: () => {
|
|
851
851
|
if (!b) {
|
|
852
852
|
if (a.type !== C.URL) {
|
|
@@ -856,20 +856,20 @@ const Li = {
|
|
|
856
856
|
navigator.clipboard.writeText(a.url);
|
|
857
857
|
i.show({
|
|
858
858
|
content: r.t("hyperLink.message.coped"),
|
|
859
|
-
type:
|
|
859
|
+
type: ke.Info
|
|
860
860
|
});
|
|
861
861
|
}
|
|
862
862
|
},
|
|
863
|
-
children: /* @__PURE__ */ v(
|
|
863
|
+
children: /* @__PURE__ */ v(Be, { placement: "bottom", title: r.t("hyperLink.popup.copy"), children: /* @__PURE__ */ v($n, { className: "dark:!univer-text-white" }) })
|
|
864
864
|
}
|
|
865
865
|
),
|
|
866
|
-
I && /* @__PURE__ */ fe(
|
|
866
|
+
I && /* @__PURE__ */ fe(Jr, { children: [
|
|
867
867
|
/* @__PURE__ */ v(
|
|
868
868
|
"div",
|
|
869
869
|
{
|
|
870
870
|
className: "univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
|
|
871
871
|
onClick: () => {
|
|
872
|
-
n.executeCommand(
|
|
872
|
+
n.executeCommand(Vt.id, {
|
|
873
873
|
unitId: d,
|
|
874
874
|
subUnitId: _,
|
|
875
875
|
row: l,
|
|
@@ -878,7 +878,7 @@ const Li = {
|
|
|
878
878
|
type: w
|
|
879
879
|
});
|
|
880
880
|
},
|
|
881
|
-
children: /* @__PURE__ */ v(
|
|
881
|
+
children: /* @__PURE__ */ v(Be, { placement: "bottom", title: r.t("hyperLink.popup.edit"), children: /* @__PURE__ */ v(Vn, { className: "dark:!univer-text-white" }) })
|
|
882
882
|
}
|
|
883
883
|
),
|
|
884
884
|
/* @__PURE__ */ v(
|
|
@@ -886,7 +886,7 @@ const Li = {
|
|
|
886
886
|
{
|
|
887
887
|
className: "univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-flex-row univer-items-center univer-justify-center univer-rounded univer-text-base hover:univer-bg-gray-100 dark:hover:!univer-bg-gray-700",
|
|
888
888
|
onClick: () => {
|
|
889
|
-
const P = w === m.EDITING || w === m.ZEN_EDITOR ?
|
|
889
|
+
const P = w === m.EDITING || w === m.ZEN_EDITOR ? ci.id : ui.id;
|
|
890
890
|
n.syncExecuteCommand(P, {
|
|
891
891
|
unitId: d,
|
|
892
892
|
subUnitId: _,
|
|
@@ -896,7 +896,7 @@ const Li = {
|
|
|
896
896
|
documentId: w === m.ZEN_EDITOR ? x : o.getCurrentEditorId()
|
|
897
897
|
}) && e.hideCurrentPopup(void 0, !0);
|
|
898
898
|
},
|
|
899
|
-
children: /* @__PURE__ */ v(
|
|
899
|
+
children: /* @__PURE__ */ v(Be, { placement: "bottom", title: r.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ v(An, { className: "dark:!univer-text-white" }) })
|
|
900
900
|
}
|
|
901
901
|
)
|
|
902
902
|
] })
|
|
@@ -906,7 +906,7 @@ const Li = {
|
|
|
906
906
|
]
|
|
907
907
|
}
|
|
908
908
|
);
|
|
909
|
-
},
|
|
909
|
+
}, Xe = () => {
|
|
910
910
|
var r, s;
|
|
911
911
|
const t = S(Z), [e, n] = j(null), i = S(G);
|
|
912
912
|
if (Q(() => {
|
|
@@ -921,17 +921,17 @@ const Li = {
|
|
|
921
921
|
return null;
|
|
922
922
|
if (e.showAll) {
|
|
923
923
|
const o = i.getUnit(e.unitId, k.UNIVER_SHEET), c = o == null ? void 0 : o.getSheetBySheetId(e.subUnitId), u = c == null ? void 0 : c.getCell(e.row, e.col), p = (s = (r = u == null ? void 0 : u.p) == null ? void 0 : r.body) == null ? void 0 : s.customRanges;
|
|
924
|
-
return p != null && p.length ? /* @__PURE__ */ v("div", { children: p.map((l) => /* @__PURE__ */ v(
|
|
924
|
+
return p != null && p.length ? /* @__PURE__ */ v("div", { children: p.map((l) => /* @__PURE__ */ v(vn, { ...e, customRange: l }, l.rangeId)) }) : null;
|
|
925
925
|
}
|
|
926
|
-
return /* @__PURE__ */ v(
|
|
926
|
+
return /* @__PURE__ */ v(vn, { ...e });
|
|
927
927
|
};
|
|
928
|
-
|
|
929
|
-
var
|
|
930
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
928
|
+
Xe.componentKey = "univer.sheet.cell-link-popup";
|
|
929
|
+
var bi = Object.getOwnPropertyDescriptor, ki = (t, e, n, i) => {
|
|
930
|
+
for (var r = i > 1 ? void 0 : i ? bi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
931
931
|
(o = t[s]) && (r = o(r) || r);
|
|
932
932
|
return r;
|
|
933
933
|
}, se = (t, e) => (n, i) => e(n, i, t);
|
|
934
|
-
const
|
|
934
|
+
const fn = (t, e) => {
|
|
935
935
|
var n, i;
|
|
936
936
|
return t.unitId === e.unitId && t.subUnitId === e.subUnitId && t.row === e.row && t.col === e.col && ((n = t.customRange) == null ? void 0 : n.rangeId) === ((i = e.customRange) == null ? void 0 : i.rangeId) && t.type === e.type;
|
|
937
937
|
};
|
|
@@ -939,10 +939,10 @@ let Z = class extends K {
|
|
|
939
939
|
constructor(e, n, i, r, s, o, c) {
|
|
940
940
|
super();
|
|
941
941
|
A(this, "_currentPopup", null);
|
|
942
|
-
A(this, "_currentPopup$", new
|
|
942
|
+
A(this, "_currentPopup$", new Yr());
|
|
943
943
|
A(this, "currentPopup$", this._currentPopup$.asObservable());
|
|
944
944
|
A(this, "_currentEditingPopup", null);
|
|
945
|
-
A(this, "_currentEditing$", new
|
|
945
|
+
A(this, "_currentEditing$", new zr(null));
|
|
946
946
|
A(this, "currentEditing$", this._currentEditing$.asObservable());
|
|
947
947
|
A(this, "_isKeepVisible", !1);
|
|
948
948
|
this._sheetCanvasPopManagerService = e, this._injector = n, this._univerInstanceService = i, this._editorBridgeService = r, this._textSelectionManagerService = s, this._docCanvasPopManagerService = o, this._zenZoneService = c, this.disposeWithMe(() => {
|
|
@@ -964,15 +964,15 @@ let Z = class extends K {
|
|
|
964
964
|
// eslint-disable-next-line max-lines-per-function
|
|
965
965
|
showPopup(e) {
|
|
966
966
|
var g;
|
|
967
|
-
if (this._currentPopup &&
|
|
967
|
+
if (this._currentPopup && fn(e, this._currentPopup) || (this.hideCurrentPopup(void 0, !0), e.type !== m.ZEN_EDITOR && this._zenZoneService.visible))
|
|
968
968
|
return;
|
|
969
969
|
const n = this._currentEditing$.getValue();
|
|
970
|
-
if (n &&
|
|
970
|
+
if (n && fn(e, n))
|
|
971
971
|
return;
|
|
972
972
|
const { unitId: i, subUnitId: r, row: s, col: o, customRangeRect: c, customRange: u } = e;
|
|
973
973
|
let p;
|
|
974
974
|
const l = {
|
|
975
|
-
componentKey:
|
|
975
|
+
componentKey: Xe.componentKey,
|
|
976
976
|
direction: "bottom",
|
|
977
977
|
onClickOutside: () => {
|
|
978
978
|
this.hideCurrentPopup();
|
|
@@ -1045,7 +1045,7 @@ let Z = class extends K {
|
|
|
1045
1045
|
collapsed: c.dataStream.length - 2 === 0,
|
|
1046
1046
|
label: ve.transform.getPlainText(c.dataStream)
|
|
1047
1047
|
};
|
|
1048
|
-
const u = ve.customRange.getCustomRangesInterestsWithSelection(o, (s = (r = c.customRanges) == null ? void 0 : r.filter((g) => g.rangeType ===
|
|
1048
|
+
const u = ve.customRange.getCustomRangesInterestsWithSelection(o, (s = (r = c.customRanges) == null ? void 0 : r.filter((g) => g.rangeType === Ne.HYPERLINK)) != null ? s : []);
|
|
1049
1049
|
let p = o.startOffset, l = o.endOffset;
|
|
1050
1050
|
return u.forEach((g) => {
|
|
1051
1051
|
p = Math.min(p, g.startIndex), l = Math.max(l, g.endIndex + 1);
|
|
@@ -1060,7 +1060,7 @@ let Z = class extends K {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
get _editPopup() {
|
|
1062
1062
|
return {
|
|
1063
|
-
componentKey:
|
|
1063
|
+
componentKey: ze.componentKey,
|
|
1064
1064
|
direction: "vertical",
|
|
1065
1065
|
onClickOutside: () => {
|
|
1066
1066
|
this.endEditing();
|
|
@@ -1096,10 +1096,10 @@ let Z = class extends K {
|
|
|
1096
1096
|
if (!l)
|
|
1097
1097
|
return;
|
|
1098
1098
|
this._textSelectionManagerService.replaceDocRanges([{ ...l }], { unitId: _e, subUnitId: _e });
|
|
1099
|
-
const g = this._injector.get(
|
|
1099
|
+
const g = this._injector.get(He).getRenderById(_e);
|
|
1100
1100
|
if (!g)
|
|
1101
1101
|
return;
|
|
1102
|
-
const d =
|
|
1102
|
+
const d = Dr(l, g);
|
|
1103
1103
|
if (!(d != null && d.length))
|
|
1104
1104
|
return;
|
|
1105
1105
|
this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(
|
|
@@ -1151,7 +1151,7 @@ let Z = class extends K {
|
|
|
1151
1151
|
x
|
|
1152
1152
|
);
|
|
1153
1153
|
} else if (e.type === m.EDITING) {
|
|
1154
|
-
const d =
|
|
1154
|
+
const d = Lr(this._injector, e.unitId, e.subUnitId, e.row, e.col, e.customRangeId);
|
|
1155
1155
|
if (!d || !((l = d.rects) != null && l.length))
|
|
1156
1156
|
return;
|
|
1157
1157
|
r = d.customRange, s = d.label, this._textSelectionManagerService.replaceTextRanges([
|
|
@@ -1166,7 +1166,7 @@ let Z = class extends K {
|
|
|
1166
1166
|
i
|
|
1167
1167
|
);
|
|
1168
1168
|
} else {
|
|
1169
|
-
const d = this._univerInstanceService.getUnit(n, k.UNIVER_SHEET), _ = d == null ? void 0 : d.getSheetBySheetId(i), I = _ == null ? void 0 : _.getCellRaw(e.row, e.col), f = d == null ? void 0 : d.getStyles().getStyleByCell(I), w = f == null ? void 0 : f.tr, a =
|
|
1169
|
+
const d = this._univerInstanceService.getUnit(n, k.UNIVER_SHEET), _ = d == null ? void 0 : d.getSheetBySheetId(i), I = _ == null ? void 0 : _.getCellRaw(e.row, e.col), f = d == null ? void 0 : d.getStyles().getStyleByCell(I), w = f == null ? void 0 : f.tr, a = wr(this._injector, e.unitId, e.subUnitId, e.row, e.col, e.customRangeId);
|
|
1170
1170
|
if (!a || !((g = a.rects) != null && g.length))
|
|
1171
1171
|
return;
|
|
1172
1172
|
r = a.customRange, s = a.label, w ? this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(
|
|
@@ -1200,43 +1200,43 @@ let Z = class extends K {
|
|
|
1200
1200
|
n && (!e || e === n.type) && ((i = this._currentEditingPopup) == null || i.dispose(), this._currentEditing$.next(null));
|
|
1201
1201
|
}
|
|
1202
1202
|
};
|
|
1203
|
-
Z =
|
|
1204
|
-
se(0, y(
|
|
1203
|
+
Z = ki([
|
|
1204
|
+
se(0, y(Pr)),
|
|
1205
1205
|
se(1, y(ut)),
|
|
1206
1206
|
se(2, G),
|
|
1207
1207
|
se(3, ee),
|
|
1208
|
-
se(4, y(
|
|
1209
|
-
se(5, y(
|
|
1208
|
+
se(4, y(Ue)),
|
|
1209
|
+
se(5, y(Hr)),
|
|
1210
1210
|
se(6, dt)
|
|
1211
1211
|
], Z);
|
|
1212
|
-
var
|
|
1213
|
-
const
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
]),
|
|
1212
|
+
var Te = /* @__PURE__ */ ((t) => (t[t.ALLOWED = 0] = "ALLOWED", t[t.DISABLED_BY_CELL = 1] = "DISABLED_BY_CELL", t[t.ALLOW_ON_EDITING = 2] = "ALLOW_ON_EDITING", t))(Te || {});
|
|
1213
|
+
const Ti = /* @__PURE__ */ new Set([
|
|
1214
|
+
St.CHECKBOX,
|
|
1215
|
+
St.LIST,
|
|
1216
|
+
St.LIST_MULTIPLE
|
|
1217
|
+
]), At = (t, e, n, i) => {
|
|
1218
1218
|
var c, u, p, l, g;
|
|
1219
1219
|
const r = e.getCell(n, i);
|
|
1220
1220
|
if (r != null && r.f || r != null && r.si || (p = (u = (c = r == null ? void 0 : r.p) == null ? void 0 : c.body) == null ? void 0 : u.customBlocks) != null && p.length)
|
|
1221
1221
|
return 1;
|
|
1222
|
-
const s = t.has(
|
|
1223
|
-
return o &&
|
|
1224
|
-
},
|
|
1222
|
+
const s = t.has(gn) ? t.get(gn) : null, o = s == null ? void 0 : s.getRuleByLocation(e.getUnitId(), e.getSheetId(), n, i);
|
|
1223
|
+
return o && Ti.has(o.type) ? !0 : (g = (l = r == null ? void 0 : r.p) == null ? void 0 : l.drawingsOrder) != null && g.length ? 2 : 0;
|
|
1224
|
+
}, Ni = (t) => {
|
|
1225
1225
|
const e = t.get(G).getCurrentUnitForType(k.UNIVER_SHEET);
|
|
1226
1226
|
if (!e)
|
|
1227
1227
|
return !0;
|
|
1228
|
-
const n = e.getActiveSheet(), i = t.get(
|
|
1228
|
+
const n = e.getActiveSheet(), i = t.get(Tt).getCurrentSelections();
|
|
1229
1229
|
if (!i.length)
|
|
1230
1230
|
return !0;
|
|
1231
1231
|
const r = i[0].range.startRow, s = i[0].range.startColumn;
|
|
1232
|
-
return
|
|
1233
|
-
},
|
|
1234
|
-
const e = t.get(
|
|
1232
|
+
return At(t, n, r, s) === 1;
|
|
1233
|
+
}, xi = (t) => {
|
|
1234
|
+
const e = t.get(Ue), n = t.get(G), i = e.getTextRanges();
|
|
1235
1235
|
if (!(i != null && i.length))
|
|
1236
1236
|
return !0;
|
|
1237
1237
|
const r = n.getCurrentUnitForType(k.UNIVER_DOC);
|
|
1238
1238
|
return !!(!r || i.every((o) => o.collapsed) || !r.getSelfOrHeaderFooterModel(i[0].segmentId).getBody());
|
|
1239
|
-
},
|
|
1239
|
+
}, Vt = {
|
|
1240
1240
|
type: lt.OPERATION,
|
|
1241
1241
|
id: "sheet.operation.open-hyper-link-edit-panel",
|
|
1242
1242
|
handler(t, e) {
|
|
@@ -1245,25 +1245,25 @@ const ki = /* @__PURE__ */ new Set([
|
|
|
1245
1245
|
const n = t.get(Z);
|
|
1246
1246
|
return e.customRangeId ? n.startEditing(e) : n.startAddEditing(e), !0;
|
|
1247
1247
|
}
|
|
1248
|
-
},
|
|
1248
|
+
}, qe = {
|
|
1249
1249
|
type: lt.OPERATION,
|
|
1250
1250
|
id: "sheet.operation.close-hyper-link-popup",
|
|
1251
1251
|
handler(t) {
|
|
1252
1252
|
return t.get(Z).endEditing(), !0;
|
|
1253
1253
|
}
|
|
1254
|
-
},
|
|
1254
|
+
}, Bt = {
|
|
1255
1255
|
type: lt.OPERATION,
|
|
1256
1256
|
id: "sheet.operation.insert-hyper-link",
|
|
1257
1257
|
handler(t) {
|
|
1258
1258
|
var g;
|
|
1259
|
-
const e = t.get(G), n =
|
|
1259
|
+
const e = t.get(G), n = Nt(e), i = t.get(ee);
|
|
1260
1260
|
if (!n)
|
|
1261
1261
|
return !1;
|
|
1262
|
-
const r = t.get(te), o = t.get(
|
|
1262
|
+
const r = t.get(te), o = t.get(Tt).getCurrentLastSelection();
|
|
1263
1263
|
if (!o)
|
|
1264
1264
|
return !1;
|
|
1265
1265
|
const c = o.range.startRow, u = o.range.startColumn, p = i.isVisible(), l = ((g = e.getFocusedUnit()) == null ? void 0 : g.getUnitId()) === x;
|
|
1266
|
-
return r.executeCommand(
|
|
1266
|
+
return r.executeCommand(Vt.id, {
|
|
1267
1267
|
unitId: n.unitId,
|
|
1268
1268
|
subUnitId: n.subUnitId,
|
|
1269
1269
|
row: c,
|
|
@@ -1275,18 +1275,18 @@ const ki = /* @__PURE__ */ new Set([
|
|
|
1275
1275
|
type: lt.OPERATION,
|
|
1276
1276
|
id: "sheet.operation.insert-hyper-link-toolbar",
|
|
1277
1277
|
handler(t) {
|
|
1278
|
-
if (
|
|
1278
|
+
if (Ni(t))
|
|
1279
1279
|
return !1;
|
|
1280
1280
|
const e = t.get(te);
|
|
1281
|
-
return t.get(Z).currentEditing ? e.executeCommand(
|
|
1281
|
+
return t.get(Z).currentEditing ? e.executeCommand(qe.id) : e.executeCommand(Bt.id);
|
|
1282
1282
|
}
|
|
1283
|
-
},
|
|
1284
|
-
var
|
|
1285
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1283
|
+
}, Ft = "SHEET_HYPER_LINK_UI_PLUGIN";
|
|
1284
|
+
var Oi = Object.getOwnPropertyDescriptor, Mi = (t, e, n, i) => {
|
|
1285
|
+
for (var r = i > 1 ? void 0 : i ? Oi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1286
1286
|
(o = t[s]) && (r = o(r) || r);
|
|
1287
1287
|
return r;
|
|
1288
|
-
},
|
|
1289
|
-
let
|
|
1288
|
+
}, Fe = (t, e) => (n, i) => e(n, i, t);
|
|
1289
|
+
let Je = class extends K {
|
|
1290
1290
|
constructor(e, n, i, r) {
|
|
1291
1291
|
super();
|
|
1292
1292
|
A(this, "_plainTextFilter", /* @__PURE__ */ new Set());
|
|
@@ -1307,27 +1307,27 @@ let qe = class extends K {
|
|
|
1307
1307
|
}
|
|
1308
1308
|
_initCopyPaste() {
|
|
1309
1309
|
this._sheetClipboardService.addClipboardHook({
|
|
1310
|
-
id:
|
|
1310
|
+
id: Ft,
|
|
1311
1311
|
onBeforeCopy: (e, n, i) => this._collect(e, n, i),
|
|
1312
1312
|
onPasteCells: (e, n, i, r) => {
|
|
1313
|
-
const { copyType: s =
|
|
1313
|
+
const { copyType: s = kr.COPY, pasteType: o } = r, { range: c } = e || {}, { range: u, unitId: p, subUnitId: l } = n;
|
|
1314
1314
|
return this._generateMutations(u, { copyType: s, pasteType: o, copyRange: c, unitId: p, subUnitId: l });
|
|
1315
1315
|
},
|
|
1316
1316
|
onPastePlainText: (e, n) => {
|
|
1317
1317
|
const i = this._filterPlainText(n);
|
|
1318
|
-
if (
|
|
1319
|
-
const { range: r, unitId: s, subUnitId: o } = e, { ranges: [c], mapFunc: u } =
|
|
1320
|
-
return
|
|
1318
|
+
if (Ye(n) && i) {
|
|
1319
|
+
const { range: r, unitId: s, subUnitId: o } = e, { ranges: [c], mapFunc: u } = Pt([r]), p = [], l = [];
|
|
1320
|
+
return En.foreach(c, (g, d) => {
|
|
1321
1321
|
const { row: _, col: I } = u(g, d), f = this._hyperLinkModel.getHyperLinkByLocation(s, o, _, I);
|
|
1322
1322
|
f && p.push({
|
|
1323
|
-
id:
|
|
1323
|
+
id: Oe.id,
|
|
1324
1324
|
params: {
|
|
1325
1325
|
unitId: s,
|
|
1326
1326
|
subUnitId: o,
|
|
1327
1327
|
id: f.id
|
|
1328
1328
|
}
|
|
1329
1329
|
}), f && l.push({
|
|
1330
|
-
id:
|
|
1330
|
+
id: Me.id,
|
|
1331
1331
|
params: {
|
|
1332
1332
|
unitId: s,
|
|
1333
1333
|
subUnitId: o,
|
|
@@ -1342,13 +1342,13 @@ let qe = class extends K {
|
|
|
1342
1342
|
});
|
|
1343
1343
|
}
|
|
1344
1344
|
_collect(e, n, i) {
|
|
1345
|
-
const r = new
|
|
1345
|
+
const r = new ir();
|
|
1346
1346
|
this._copyInfo = {
|
|
1347
1347
|
unitId: e,
|
|
1348
1348
|
subUnitId: n,
|
|
1349
1349
|
matrix: r
|
|
1350
1350
|
};
|
|
1351
|
-
const s = this._injector.invoke((u) =>
|
|
1351
|
+
const s = this._injector.invoke((u) => dr(i, u, e, n));
|
|
1352
1352
|
if (!s)
|
|
1353
1353
|
return;
|
|
1354
1354
|
const { rows: o, cols: c } = s;
|
|
@@ -1367,14 +1367,14 @@ let qe = class extends K {
|
|
|
1367
1367
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !n.copyRange)
|
|
1368
1368
|
return { redos: [], undos: [] };
|
|
1369
1369
|
if ([
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1370
|
+
Ve.SPECIAL_PASTE_COL_WIDTH,
|
|
1371
|
+
Ve.SPECIAL_PASTE_VALUE,
|
|
1372
|
+
Ve.SPECIAL_PASTE_FORMAT,
|
|
1373
|
+
Ve.SPECIAL_PASTE_FORMULA
|
|
1374
1374
|
].includes(n.pasteType))
|
|
1375
1375
|
return { redos: [], undos: [] };
|
|
1376
|
-
const { unitId: r, subUnitId: s } = this._copyInfo, o = [], c = [], { ranges: [u, p], mapFunc: l } =
|
|
1377
|
-
return
|
|
1376
|
+
const { unitId: r, subUnitId: s } = this._copyInfo, o = [], c = [], { ranges: [u, p], mapFunc: l } = Pt([n.copyRange, e]);
|
|
1377
|
+
return Tr(u, p, !0).forEach(({ startRange: d }) => {
|
|
1378
1378
|
var _;
|
|
1379
1379
|
(_ = this._copyInfo) == null || _.matrix.forValue((I, f, w) => {
|
|
1380
1380
|
const a = Ie.getPositionRange(
|
|
@@ -1385,16 +1385,16 @@ let qe = class extends K {
|
|
|
1385
1385
|
endColumn: f
|
|
1386
1386
|
},
|
|
1387
1387
|
d
|
|
1388
|
-
), b = this._hyperLinkModel.getHyperLink(r, s, w), { row: M, col: T } = l(a.startRow, a.startColumn), P = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, M, T), D =
|
|
1388
|
+
), b = this._hyperLinkModel.getHyperLink(r, s, w), { row: M, col: T } = l(a.startRow, a.startColumn), P = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, M, T), D = kt();
|
|
1389
1389
|
P && o.push({
|
|
1390
|
-
id:
|
|
1390
|
+
id: Oe.id,
|
|
1391
1391
|
params: {
|
|
1392
1392
|
unitId: n.unitId,
|
|
1393
1393
|
subUnitId: n.subUnitId,
|
|
1394
1394
|
id: P.id
|
|
1395
1395
|
}
|
|
1396
1396
|
}), b && (o.push({
|
|
1397
|
-
id:
|
|
1397
|
+
id: Me.id,
|
|
1398
1398
|
params: {
|
|
1399
1399
|
unitId: n.unitId,
|
|
1400
1400
|
subUnitId: n.subUnitId,
|
|
@@ -1406,14 +1406,14 @@ let qe = class extends K {
|
|
|
1406
1406
|
}
|
|
1407
1407
|
}
|
|
1408
1408
|
}), c.push({
|
|
1409
|
-
id:
|
|
1409
|
+
id: Oe.id,
|
|
1410
1410
|
params: {
|
|
1411
1411
|
unitId: n.unitId,
|
|
1412
1412
|
subUnitId: n.subUnitId,
|
|
1413
1413
|
id: D
|
|
1414
1414
|
}
|
|
1415
1415
|
})), P && c.push({
|
|
1416
|
-
id:
|
|
1416
|
+
id: Me.id,
|
|
1417
1417
|
params: {
|
|
1418
1418
|
unitId: n.unitId,
|
|
1419
1419
|
subUnitId: n.subUnitId,
|
|
@@ -1424,97 +1424,100 @@ let qe = class extends K {
|
|
|
1424
1424
|
}), { redos: o, undos: c };
|
|
1425
1425
|
}
|
|
1426
1426
|
};
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
],
|
|
1433
|
-
const
|
|
1427
|
+
Je = Mi([
|
|
1428
|
+
Fe(0, br),
|
|
1429
|
+
Fe(1, y(ht)),
|
|
1430
|
+
Fe(2, y(ut)),
|
|
1431
|
+
Fe(3, y(ce))
|
|
1432
|
+
], Je);
|
|
1433
|
+
const Wt = (t, e = x) => {
|
|
1434
1434
|
var r;
|
|
1435
|
-
const n = t.get(G), i = (r = t.get(
|
|
1436
|
-
return i ? i.textSelectionInner$.pipe(
|
|
1435
|
+
const n = t.get(G), i = (r = t.get(He).getRenderById(e)) == null ? void 0 : r.with(kn);
|
|
1436
|
+
return i ? i.textSelectionInner$.pipe(Ht(() => {
|
|
1437
1437
|
const o = t.get(ee).getEditCellState();
|
|
1438
1438
|
if (!o)
|
|
1439
1439
|
return !0;
|
|
1440
|
-
const c =
|
|
1441
|
-
return !(c != null && c.worksheet) ||
|
|
1440
|
+
const c = Nt(n, { unitId: o.unitId, subUnitId: o.sheetId });
|
|
1441
|
+
return !(c != null && c.worksheet) || At(t, c.worksheet, o.row, o.column) === 1 ? !0 : xi(t);
|
|
1442
1442
|
})) : oe(!0);
|
|
1443
|
-
},
|
|
1443
|
+
}, Fn = (t) => {
|
|
1444
1444
|
var r;
|
|
1445
1445
|
const e = t.get(G), n = t.has(ee) ? t.get(ee) : null;
|
|
1446
1446
|
return ((r = n == null ? void 0 : n.currentEditCellState$.pipe(
|
|
1447
|
-
|
|
1447
|
+
Ht((s) => {
|
|
1448
1448
|
if (!s)
|
|
1449
|
-
return
|
|
1450
|
-
const o =
|
|
1451
|
-
return o ?
|
|
1449
|
+
return Te.DISABLED_BY_CELL;
|
|
1450
|
+
const o = Nt(e, { unitId: s.unitId, subUnitId: s.sheetId });
|
|
1451
|
+
return o ? At(t, o.worksheet, s.row, s.column) : Te.DISABLED_BY_CELL;
|
|
1452
1452
|
}),
|
|
1453
|
-
|
|
1454
|
-
if (s ===
|
|
1453
|
+
xe((s) => {
|
|
1454
|
+
if (s === Te.DISABLED_BY_CELL)
|
|
1455
1455
|
return oe(!0);
|
|
1456
1456
|
const o = n ? n.visible$ : oe(null);
|
|
1457
|
-
return
|
|
1458
|
-
|
|
1459
|
-
([c, u]) => c != null && c.visible ? (u == null ? void 0 : u.getUnitId()) ===
|
|
1457
|
+
return Xr([o, e.getCurrentTypeOfUnit$(k.UNIVER_DOC)]).pipe(
|
|
1458
|
+
xe(
|
|
1459
|
+
([c, u]) => c != null && c.visible ? (u == null ? void 0 : u.getUnitId()) === sr ? oe(!0) : Wt(t, _e) : oe(s !== Te.ALLOWED)
|
|
1460
1460
|
)
|
|
1461
1461
|
);
|
|
1462
1462
|
})
|
|
1463
1463
|
)) != null ? r : oe(!0)).pipe(
|
|
1464
|
-
|
|
1464
|
+
xe((s) => s ? oe(!0) : xr(t, { workbookTypes: [Ut], worksheetTypes: [Ot, Ln, Mt], rangeTypes: [xt] }, !0))
|
|
1465
1465
|
);
|
|
1466
|
-
},
|
|
1467
|
-
commandId:
|
|
1468
|
-
type:
|
|
1466
|
+
}, Qe = {
|
|
1467
|
+
commandId: Bt.id,
|
|
1468
|
+
type: Nn.BUTTON,
|
|
1469
1469
|
title: "hyperLink.menu.add",
|
|
1470
1470
|
icon: "LinkIcon"
|
|
1471
|
-
},
|
|
1472
|
-
...
|
|
1473
|
-
id:
|
|
1471
|
+
}, et = (t) => `${t}-zen-editor`, Ui = (t) => ({
|
|
1472
|
+
...Qe,
|
|
1473
|
+
id: Qe.commandId,
|
|
1474
1474
|
hidden$: pt(t, k.UNIVER_SHEET),
|
|
1475
|
-
disabled$:
|
|
1475
|
+
disabled$: Fn(t)
|
|
1476
1476
|
// disabled$: getObservableWithExclusiveRange$(accessor, getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetEditPermission, WorksheetSetCellValuePermission, WorksheetInsertHyperlinkPermission], rangeTypes: [RangeProtectionPermissionEditPoint] })),
|
|
1477
|
-
}),
|
|
1478
|
-
...
|
|
1479
|
-
id: Qe
|
|
1477
|
+
}), Hi = (t) => ({
|
|
1478
|
+
...Qe,
|
|
1479
|
+
id: et(Qe.commandId),
|
|
1480
1480
|
hidden$: pt(t, k.UNIVER_DOC, x),
|
|
1481
|
-
disabled$:
|
|
1482
|
-
}),
|
|
1481
|
+
disabled$: Wt(t)
|
|
1482
|
+
}), tt = {
|
|
1483
1483
|
tooltip: "hyperLink.form.addTitle",
|
|
1484
1484
|
commandId: ae.id,
|
|
1485
|
-
type:
|
|
1485
|
+
type: Nn.BUTTON,
|
|
1486
1486
|
icon: "LinkIcon"
|
|
1487
|
-
},
|
|
1488
|
-
...
|
|
1489
|
-
id:
|
|
1487
|
+
}, Di = (t) => ({
|
|
1488
|
+
...tt,
|
|
1489
|
+
id: tt.commandId,
|
|
1490
1490
|
hidden$: pt(t, k.UNIVER_SHEET),
|
|
1491
|
-
disabled$:
|
|
1492
|
-
}),
|
|
1493
|
-
...
|
|
1494
|
-
id:
|
|
1491
|
+
disabled$: Fn(t)
|
|
1492
|
+
}), $i = (t) => ({
|
|
1493
|
+
...tt,
|
|
1494
|
+
id: et(tt.commandId),
|
|
1495
1495
|
hidden$: pt(t, k.UNIVER_DOC, x),
|
|
1496
|
-
disabled$:
|
|
1497
|
-
}),
|
|
1496
|
+
disabled$: Wt(t)
|
|
1497
|
+
}), Wn = {
|
|
1498
1498
|
id: ae.id,
|
|
1499
|
-
binding:
|
|
1500
|
-
preconditions:
|
|
1499
|
+
binding: Lt.K | Br.CTRL_COMMAND,
|
|
1500
|
+
preconditions: Nr
|
|
1501
|
+
}, Ai = "@univerjs/sheets-hyper-link-ui", Vi = "0.17.0", jn = {
|
|
1502
|
+
name: Ai,
|
|
1503
|
+
version: Vi
|
|
1501
1504
|
};
|
|
1502
|
-
var
|
|
1503
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1505
|
+
var Bi = Object.getOwnPropertyDescriptor, Fi = (t, e, n, i) => {
|
|
1506
|
+
for (var r = i > 1 ? void 0 : i ? Bi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1504
1507
|
(o = t[s]) && (r = o(r) || r);
|
|
1505
1508
|
return r;
|
|
1506
|
-
},
|
|
1507
|
-
let
|
|
1509
|
+
}, _n = (t, e) => (n, i) => e(n, i, t);
|
|
1510
|
+
let nt = class extends K {
|
|
1508
1511
|
constructor(t, e) {
|
|
1509
1512
|
super(), this._autoFillService = t, this._hyperLinkModel = e, this._initAutoFill();
|
|
1510
1513
|
}
|
|
1511
1514
|
// eslint-disable-next-line max-lines-per-function
|
|
1512
1515
|
_initAutoFill() {
|
|
1513
1516
|
const t = () => ({ redos: [], undos: [] }), e = (i, r) => {
|
|
1514
|
-
const { source: s, target: o, unitId: c, subUnitId: u } = i, p =
|
|
1517
|
+
const { source: s, target: o, unitId: c, subUnitId: u } = i, p = Pt([s, o]), [l, g] = p.ranges, { mapFunc: d } = p, _ = {
|
|
1515
1518
|
row: l.startRow,
|
|
1516
1519
|
col: l.startColumn
|
|
1517
|
-
}, I =
|
|
1520
|
+
}, I = hr.getAutoFillRepeatRange(l, g), f = [], w = [];
|
|
1518
1521
|
return I.forEach((a) => {
|
|
1519
1522
|
const b = a.repeatStartCell, M = a.relativeRange, T = {
|
|
1520
1523
|
startRow: _.row,
|
|
@@ -1527,7 +1530,7 @@ let tt = class extends K {
|
|
|
1527
1530
|
endColumn: b.col,
|
|
1528
1531
|
endRow: b.row
|
|
1529
1532
|
};
|
|
1530
|
-
|
|
1533
|
+
En.foreach(M, (D, $) => {
|
|
1531
1534
|
const Y = Ie.getPositionRange(
|
|
1532
1535
|
{
|
|
1533
1536
|
startRow: D,
|
|
@@ -1536,7 +1539,7 @@ let tt = class extends K {
|
|
|
1536
1539
|
endRow: D
|
|
1537
1540
|
},
|
|
1538
1541
|
T
|
|
1539
|
-
), { row: ne, col:
|
|
1542
|
+
), { row: ne, col: De } = d(Y.startRow, Y.startColumn), re = this._hyperLinkModel.getHyperLinkByLocation(c, u, ne, De), ye = Ie.getPositionRange(
|
|
1540
1543
|
{
|
|
1541
1544
|
startRow: D,
|
|
1542
1545
|
startColumn: $,
|
|
@@ -1544,35 +1547,35 @@ let tt = class extends K {
|
|
|
1544
1547
|
endRow: D
|
|
1545
1548
|
},
|
|
1546
1549
|
P
|
|
1547
|
-
), { row:
|
|
1550
|
+
), { row: Ee, col: Re } = d(ye.startRow, ye.startColumn), $e = kt(), de = this._hyperLinkModel.getHyperLinkByLocation(c, u, Ee, Re);
|
|
1548
1551
|
de && f.push({
|
|
1549
|
-
id:
|
|
1552
|
+
id: Oe.id,
|
|
1550
1553
|
params: {
|
|
1551
1554
|
unitId: c,
|
|
1552
1555
|
subUnitId: u,
|
|
1553
1556
|
id: de.id
|
|
1554
1557
|
}
|
|
1555
|
-
}), (
|
|
1556
|
-
id:
|
|
1558
|
+
}), (we.COPY === r || we.SERIES === r) && re && (f.push({
|
|
1559
|
+
id: Me.id,
|
|
1557
1560
|
params: {
|
|
1558
1561
|
unitId: c,
|
|
1559
1562
|
subUnitId: u,
|
|
1560
1563
|
link: {
|
|
1561
1564
|
...re,
|
|
1562
|
-
id:
|
|
1563
|
-
row:
|
|
1564
|
-
column:
|
|
1565
|
+
id: $e,
|
|
1566
|
+
row: Ee,
|
|
1567
|
+
column: Re
|
|
1565
1568
|
}
|
|
1566
1569
|
}
|
|
1567
1570
|
}), w.push({
|
|
1568
|
-
id:
|
|
1571
|
+
id: Oe.id,
|
|
1569
1572
|
params: {
|
|
1570
1573
|
unitId: c,
|
|
1571
1574
|
subUnitId: u,
|
|
1572
|
-
id:
|
|
1575
|
+
id: $e
|
|
1573
1576
|
}
|
|
1574
1577
|
})), de && w.push({
|
|
1575
|
-
id:
|
|
1578
|
+
id: Me.id,
|
|
1576
1579
|
params: {
|
|
1577
1580
|
unitId: c,
|
|
1578
1581
|
subUnitId: u,
|
|
@@ -1585,48 +1588,48 @@ let tt = class extends K {
|
|
|
1585
1588
|
redos: f
|
|
1586
1589
|
};
|
|
1587
1590
|
}, n = {
|
|
1588
|
-
id:
|
|
1589
|
-
onFillData: (i, r, s) => s ===
|
|
1591
|
+
id: Ft,
|
|
1592
|
+
onFillData: (i, r, s) => s === we.COPY || s === we.ONLY_FORMAT || s === we.SERIES ? e(i, s) : t()
|
|
1590
1593
|
};
|
|
1591
1594
|
this.disposeWithMe(this._autoFillService.addHook(n));
|
|
1592
1595
|
}
|
|
1593
1596
|
};
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
],
|
|
1598
|
-
var
|
|
1599
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1597
|
+
nt = Fi([
|
|
1598
|
+
_n(0, pr),
|
|
1599
|
+
_n(1, y(ht))
|
|
1600
|
+
], nt);
|
|
1601
|
+
var Wi = Object.getOwnPropertyDescriptor, ji = (t, e, n, i) => {
|
|
1602
|
+
for (var r = i > 1 ? void 0 : i ? Wi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1600
1603
|
(o = t[s]) && (r = o(r) || r);
|
|
1601
1604
|
return r;
|
|
1602
|
-
},
|
|
1603
|
-
let
|
|
1605
|
+
}, Rt = (t, e) => (n, i) => e(n, i, t);
|
|
1606
|
+
let rt = class extends K {
|
|
1604
1607
|
constructor(t, e, n) {
|
|
1605
1608
|
super(), this._localeService = t, this._commandService = e, this._sheetPermissionCheckController = n, this._commandExecutedListener();
|
|
1606
1609
|
}
|
|
1607
1610
|
_commandExecutedListener() {
|
|
1608
1611
|
this.disposeWithMe(
|
|
1609
1612
|
this._commandService.beforeCommandExecuted((t) => {
|
|
1610
|
-
t.id ===
|
|
1611
|
-
workbookTypes: [
|
|
1612
|
-
rangeTypes: [
|
|
1613
|
-
worksheetTypes: [
|
|
1613
|
+
t.id === Wn.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1614
|
+
workbookTypes: [Ut],
|
|
1615
|
+
rangeTypes: [xt],
|
|
1616
|
+
worksheetTypes: [Ot, Ln, Mt]
|
|
1614
1617
|
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.hyperLinkErr")));
|
|
1615
1618
|
})
|
|
1616
1619
|
);
|
|
1617
1620
|
}
|
|
1618
1621
|
};
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
],
|
|
1624
|
-
var
|
|
1625
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1622
|
+
rt = ji([
|
|
1623
|
+
Rt(0, y(ct)),
|
|
1624
|
+
Rt(1, te),
|
|
1625
|
+
Rt(2, y(wn))
|
|
1626
|
+
], rt);
|
|
1627
|
+
var Zi = Object.getOwnPropertyDescriptor, Gi = (t, e, n, i) => {
|
|
1628
|
+
for (var r = i > 1 ? void 0 : i ? Zi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1626
1629
|
(o = t[s]) && (r = o(r) || r);
|
|
1627
1630
|
return r;
|
|
1628
1631
|
}, W = (t, e) => (n, i) => e(n, i, t);
|
|
1629
|
-
let
|
|
1632
|
+
let it = class extends K {
|
|
1630
1633
|
constructor(t, e, n, i, r, s, o, c, u, p) {
|
|
1631
1634
|
super(), this._hoverManagerService = t, this._sheetsHyperLinkPopupService = e, this._renderManagerService = n, this._permissionService = i, this._sheetPermissionCheckController = r, this._commandService = s, this._editorBridgeService = o, this._textSelectionManagerService = c, this._univerInstanceService = u, this._zenZoneService = p, this._initHoverListener(), this._initCommandListener(), this._initHoverEditingListener(), this._initTextSelectionListener(), this._initZenEditor();
|
|
1632
1635
|
}
|
|
@@ -1639,18 +1642,18 @@ let rt = class extends K {
|
|
|
1639
1642
|
copyPermission: !1
|
|
1640
1643
|
};
|
|
1641
1644
|
const c = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1642
|
-
workbookTypes: [
|
|
1643
|
-
worksheetTypes: [
|
|
1644
|
-
rangeTypes: [
|
|
1645
|
+
workbookTypes: [vr],
|
|
1646
|
+
worksheetTypes: [mr],
|
|
1647
|
+
rangeTypes: [gr]
|
|
1645
1648
|
}, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }], e, n);
|
|
1646
1649
|
let u = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1647
|
-
workbookTypes: [
|
|
1648
|
-
worksheetTypes: [
|
|
1649
|
-
rangeTypes: [
|
|
1650
|
+
workbookTypes: [Ut],
|
|
1651
|
+
worksheetTypes: [Ot, Mt],
|
|
1652
|
+
rangeTypes: [xt]
|
|
1650
1653
|
}, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }], e, n);
|
|
1651
1654
|
const p = o.getCellRaw(i, r);
|
|
1652
1655
|
p != null && p.f && p.f.startsWith("=HYPERLINK(") && (u = !1);
|
|
1653
|
-
const l = this._permissionService.composePermission([new
|
|
1656
|
+
const l = this._permissionService.composePermission([new fr(e).id, new _r(e, n).id]).every((g) => g.value);
|
|
1654
1657
|
return {
|
|
1655
1658
|
viewPermission: c,
|
|
1656
1659
|
editPermission: u,
|
|
@@ -1660,9 +1663,9 @@ let rt = class extends K {
|
|
|
1660
1663
|
_initHoverListener() {
|
|
1661
1664
|
this.disposeWithMe(
|
|
1662
1665
|
// hover over not editing cell
|
|
1663
|
-
this._hoverManagerService.currentRichText$.pipe(
|
|
1666
|
+
this._hoverManagerService.currentRichText$.pipe(je(200)).subscribe((t) => {
|
|
1664
1667
|
var T, P, D;
|
|
1665
|
-
if (!t || ((T = t.customRange) == null ? void 0 : T.rangeType) !==
|
|
1668
|
+
if (!t || ((T = t.customRange) == null ? void 0 : T.rangeType) !== Ne.HYPERLINK) {
|
|
1666
1669
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1667
1670
|
return;
|
|
1668
1671
|
}
|
|
@@ -1672,11 +1675,11 @@ let rt = class extends K {
|
|
|
1672
1675
|
const o = this._univerInstanceService.getUnit(e, k.UNIVER_SHEET), c = o == null ? void 0 : o.getSheetBySheetId(n);
|
|
1673
1676
|
if (!c)
|
|
1674
1677
|
return;
|
|
1675
|
-
if (!s.with(
|
|
1678
|
+
if (!s.with(Mr).active) {
|
|
1676
1679
|
this._sheetsHyperLinkPopupService.hideCurrentPopup(m.VIEWING);
|
|
1677
1680
|
return;
|
|
1678
1681
|
}
|
|
1679
|
-
const p = (P = s == null ? void 0 : s.with(
|
|
1682
|
+
const p = (P = s == null ? void 0 : s.with(ln).getSkeletonParam(n)) == null ? void 0 : P.skeleton, l = r, g = i;
|
|
1680
1683
|
let d = g, _ = l;
|
|
1681
1684
|
p && p.overflowCache.forValue(($, Y, ne) => {
|
|
1682
1685
|
Ie.contains(ne, { startColumn: l, endColumn: l, startRow: g, endRow: g }) && (d = $, _ = Y);
|
|
@@ -1709,7 +1712,7 @@ let rt = class extends K {
|
|
|
1709
1712
|
_initHoverEditingListener() {
|
|
1710
1713
|
let t = null;
|
|
1711
1714
|
this.disposeWithMe(
|
|
1712
|
-
this._editorBridgeService.currentEditCellState$.pipe(
|
|
1715
|
+
this._editorBridgeService.currentEditCellState$.pipe(xe((e) => this._editorBridgeService.visible$.pipe(Ht((n) => ({ visible: n, state: e }))))).subscribe(({ visible: e, state: n }) => {
|
|
1713
1716
|
if (!n || n.editorUnitId !== _e)
|
|
1714
1717
|
return;
|
|
1715
1718
|
if (!e.visible) {
|
|
@@ -1719,16 +1722,16 @@ let rt = class extends K {
|
|
|
1719
1722
|
const { editorUnitId: i, unitId: r, sheetId: s, row: o, column: c } = n, u = this._renderManagerService.getRenderById(i);
|
|
1720
1723
|
if (!u)
|
|
1721
1724
|
return;
|
|
1722
|
-
const { editPermission: p, viewPermission: l, copyPermission: g } = this._getLinkPermission({ unitId: r, subUnitId: s, row: o, col: c }), d = u.with(
|
|
1723
|
-
l && (t == null || t.unsubscribe(), t = d.hoverCustomRanges$.pipe(
|
|
1725
|
+
const { editPermission: p, viewPermission: l, copyPermission: g } = this._getLinkPermission({ unitId: r, subUnitId: s, row: o, col: c }), d = u.with(dn);
|
|
1726
|
+
l && (t == null || t.unsubscribe(), t = d.hoverCustomRanges$.pipe(je(200)).subscribe((_) => {
|
|
1724
1727
|
var b, M;
|
|
1725
|
-
const I = _.find((T) => T.range.rangeType ===
|
|
1728
|
+
const I = _.find((T) => T.range.rangeType === Ne.HYPERLINK);
|
|
1726
1729
|
if (!I) {
|
|
1727
1730
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1728
1731
|
return;
|
|
1729
1732
|
}
|
|
1730
1733
|
const f = I.rects[I.rects.length - 1];
|
|
1731
|
-
if (!((M = (b = this._renderManagerService.getRenderById(r)) == null ? void 0 : b.with(
|
|
1734
|
+
if (!((M = (b = this._renderManagerService.getRenderById(r)) == null ? void 0 : b.with(ln).getSkeletonParam(s)) == null ? void 0 : M.skeleton) || !f)
|
|
1732
1735
|
return;
|
|
1733
1736
|
const a = u.engine.getCanvasElement().getBoundingClientRect();
|
|
1734
1737
|
this._sheetsHyperLinkPopupService.showPopup({
|
|
@@ -1760,14 +1763,14 @@ let rt = class extends K {
|
|
|
1760
1763
|
})
|
|
1761
1764
|
), this.disposeWithMe(
|
|
1762
1765
|
this._univerInstanceService.focused$.pipe(
|
|
1763
|
-
|
|
1766
|
+
xe((t) => {
|
|
1764
1767
|
const e = t === x ? this._renderManagerService.getRenderById(t) : null;
|
|
1765
|
-
return e ? e.with(
|
|
1768
|
+
return e ? e.with(dn).hoverCustomRanges$.pipe(je(200)) : new qr((n) => {
|
|
1766
1769
|
n.next(null);
|
|
1767
1770
|
});
|
|
1768
1771
|
})
|
|
1769
1772
|
).subscribe((t) => {
|
|
1770
|
-
const e = t == null ? void 0 : t.find((i) => i.range.rangeType ===
|
|
1773
|
+
const e = t == null ? void 0 : t.find((i) => i.range.rangeType === Ne.HYPERLINK), n = this._editorBridgeService.getEditCellState();
|
|
1771
1774
|
if (e && n) {
|
|
1772
1775
|
const { unitId: i, sheetId: r, row: s, column: o } = n, { editPermission: c, viewPermission: u, copyPermission: p } = this._getLinkPermission({ unitId: i, subUnitId: r, row: s, col: o });
|
|
1773
1776
|
u && this._sheetsHyperLinkPopupService.showPopup({
|
|
@@ -1793,30 +1796,30 @@ let rt = class extends K {
|
|
|
1793
1796
|
);
|
|
1794
1797
|
}
|
|
1795
1798
|
_initCommandListener() {
|
|
1796
|
-
const t = [
|
|
1799
|
+
const t = [Ir.id, Cr.id, Sr.id];
|
|
1797
1800
|
this.disposeWithMe(this._commandService.onCommandExecuted((e) => {
|
|
1798
1801
|
t.includes(e.id) && this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1799
1802
|
}));
|
|
1800
1803
|
}
|
|
1801
1804
|
};
|
|
1802
|
-
|
|
1803
|
-
W(0, y(
|
|
1805
|
+
it = Gi([
|
|
1806
|
+
W(0, y(Or)),
|
|
1804
1807
|
W(1, y(Z)),
|
|
1805
|
-
W(2, y(
|
|
1806
|
-
W(3, y(
|
|
1807
|
-
W(4, y(
|
|
1808
|
+
W(2, y(He)),
|
|
1809
|
+
W(3, y(or)),
|
|
1810
|
+
W(4, y(wn)),
|
|
1808
1811
|
W(5, te),
|
|
1809
1812
|
W(6, ee),
|
|
1810
|
-
W(7, y(
|
|
1813
|
+
W(7, y(Ue)),
|
|
1811
1814
|
W(8, G),
|
|
1812
1815
|
W(9, dt)
|
|
1813
|
-
],
|
|
1814
|
-
var
|
|
1815
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1816
|
+
], it);
|
|
1817
|
+
var Ki = Object.getOwnPropertyDescriptor, Zn = (t, e, n, i) => {
|
|
1818
|
+
for (var r = i > 1 ? void 0 : i ? Ki(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1816
1819
|
(o = t[s]) && (r = o(r) || r);
|
|
1817
1820
|
return r;
|
|
1818
|
-
},
|
|
1819
|
-
let
|
|
1821
|
+
}, wt = (t, e) => (n, i) => e(n, i, t);
|
|
1822
|
+
let bt = class extends K {
|
|
1820
1823
|
constructor(t, e) {
|
|
1821
1824
|
super(), this._context = t, this._hyperLinkModel = e, this._initSkeletonChange();
|
|
1822
1825
|
}
|
|
@@ -1825,24 +1828,24 @@ let wt = class extends K {
|
|
|
1825
1828
|
var e;
|
|
1826
1829
|
(e = this._context.mainComponent) == null || e.makeForceDirty();
|
|
1827
1830
|
};
|
|
1828
|
-
this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe(
|
|
1831
|
+
this.disposeWithMe(this._hyperLinkModel.linkUpdate$.pipe(je(16)).subscribe(() => {
|
|
1829
1832
|
t();
|
|
1830
1833
|
}));
|
|
1831
1834
|
}
|
|
1832
1835
|
};
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
],
|
|
1836
|
-
let
|
|
1836
|
+
bt = Zn([
|
|
1837
|
+
wt(1, y(ht))
|
|
1838
|
+
], bt);
|
|
1839
|
+
let st = class extends K {
|
|
1837
1840
|
constructor(t, e) {
|
|
1838
1841
|
super(), this._sheetInterceptorService = t, this._hyperLinkModel = e, this._initViewModelIntercept();
|
|
1839
1842
|
}
|
|
1840
1843
|
_initViewModelIntercept() {
|
|
1841
1844
|
this.disposeWithMe(
|
|
1842
1845
|
this._sheetInterceptorService.intercept(
|
|
1843
|
-
|
|
1846
|
+
Er.CELL_CONTENT,
|
|
1844
1847
|
{
|
|
1845
|
-
effect:
|
|
1848
|
+
effect: ar.Value,
|
|
1846
1849
|
priority: 100,
|
|
1847
1850
|
handler: (t, e, n) => {
|
|
1848
1851
|
const { row: i, col: r, unitId: s, subUnitId: o } = e, c = this._hyperLinkModel.getHyperLinkByLocation(s, o, i, r);
|
|
@@ -1853,83 +1856,83 @@ let it = class extends K {
|
|
|
1853
1856
|
);
|
|
1854
1857
|
}
|
|
1855
1858
|
};
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
],
|
|
1860
|
-
const
|
|
1861
|
-
[
|
|
1859
|
+
st = Zn([
|
|
1860
|
+
wt(0, y(yr)),
|
|
1861
|
+
wt(1, y(ht))
|
|
1862
|
+
], st);
|
|
1863
|
+
const Yi = {
|
|
1864
|
+
[jr.MEDIA]: {
|
|
1862
1865
|
[ae.id]: {
|
|
1863
1866
|
order: 1,
|
|
1864
|
-
menuItemFactory:
|
|
1867
|
+
menuItemFactory: Di
|
|
1865
1868
|
},
|
|
1866
|
-
[
|
|
1869
|
+
[et(ae.id)]: {
|
|
1867
1870
|
order: 1,
|
|
1868
|
-
menuItemFactory:
|
|
1871
|
+
menuItemFactory: $i
|
|
1869
1872
|
}
|
|
1870
1873
|
},
|
|
1871
|
-
[
|
|
1872
|
-
[
|
|
1874
|
+
[Fr.MAIN_AREA]: {
|
|
1875
|
+
[Wr.OTHERS]: {
|
|
1873
1876
|
order: 1,
|
|
1874
1877
|
[ae.id]: {
|
|
1875
1878
|
order: 0,
|
|
1876
|
-
menuItemFactory:
|
|
1879
|
+
menuItemFactory: Ui
|
|
1877
1880
|
},
|
|
1878
|
-
[
|
|
1881
|
+
[et(ae.id)]: {
|
|
1879
1882
|
order: 0,
|
|
1880
|
-
menuItemFactory:
|
|
1883
|
+
menuItemFactory: Hi
|
|
1881
1884
|
}
|
|
1882
1885
|
}
|
|
1883
1886
|
}
|
|
1884
1887
|
};
|
|
1885
|
-
var
|
|
1886
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1888
|
+
var zi = Object.getOwnPropertyDescriptor, Xi = (t, e, n, i) => {
|
|
1889
|
+
for (var r = i > 1 ? void 0 : i ? zi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1887
1890
|
(o = t[s]) && (r = o(r) || r);
|
|
1888
1891
|
return r;
|
|
1889
|
-
},
|
|
1890
|
-
let
|
|
1892
|
+
}, be = (t, e) => (n, i) => e(n, i, t);
|
|
1893
|
+
let ot = class extends K {
|
|
1891
1894
|
constructor(t, e, n, i, r) {
|
|
1892
1895
|
super(), this._componentManager = t, this._commandService = e, this._menuManagerService = n, this._injector = i, this._shortcutService = r, this._initComponents(), this._initCommands(), this._initMenus(), this._initShortCut();
|
|
1893
1896
|
}
|
|
1894
1897
|
_initComponents() {
|
|
1895
1898
|
[
|
|
1899
|
+
[Xe.componentKey, Xe],
|
|
1896
1900
|
[ze.componentKey, ze],
|
|
1897
|
-
[
|
|
1898
|
-
["LinkIcon", Dt]
|
|
1901
|
+
["LinkIcon", $t]
|
|
1899
1902
|
].forEach(([t, e]) => {
|
|
1900
1903
|
this._componentManager.register(t, e);
|
|
1901
1904
|
});
|
|
1902
1905
|
}
|
|
1903
1906
|
_initCommands() {
|
|
1904
1907
|
[
|
|
1905
|
-
At,
|
|
1906
|
-
Xe,
|
|
1907
1908
|
Vt,
|
|
1909
|
+
qe,
|
|
1910
|
+
Bt,
|
|
1908
1911
|
ae
|
|
1909
1912
|
].forEach((t) => {
|
|
1910
1913
|
this._commandService.registerCommand(t);
|
|
1911
1914
|
});
|
|
1912
1915
|
}
|
|
1913
1916
|
_initMenus() {
|
|
1914
|
-
this._menuManagerService.mergeMenu(
|
|
1917
|
+
this._menuManagerService.mergeMenu(Yi);
|
|
1915
1918
|
}
|
|
1916
1919
|
_initShortCut() {
|
|
1917
|
-
this._shortcutService.registerShortcut(
|
|
1920
|
+
this._shortcutService.registerShortcut(Wn);
|
|
1918
1921
|
}
|
|
1919
1922
|
};
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
],
|
|
1927
|
-
var
|
|
1928
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1923
|
+
ot = Xi([
|
|
1924
|
+
be(0, y(Zr)),
|
|
1925
|
+
be(1, te),
|
|
1926
|
+
be(2, Gr),
|
|
1927
|
+
be(3, y(ut)),
|
|
1928
|
+
be(4, y(Kr))
|
|
1929
|
+
], ot);
|
|
1930
|
+
var qi = Object.getOwnPropertyDescriptor, Ji = (t, e, n, i) => {
|
|
1931
|
+
for (var r = i > 1 ? void 0 : i ? qi(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1929
1932
|
(o = t[s]) && (r = o(r) || r);
|
|
1930
1933
|
return r;
|
|
1931
|
-
},
|
|
1932
|
-
let
|
|
1934
|
+
}, In = (t, e) => (n, i) => e(n, i, t);
|
|
1935
|
+
let at = class extends K {
|
|
1933
1936
|
constructor(t, e) {
|
|
1934
1937
|
super(), this._parserService = t, this._resolverService = e, this._handleInitUrl();
|
|
1935
1938
|
}
|
|
@@ -1941,61 +1944,63 @@ let ot = class extends K {
|
|
|
1941
1944
|
}
|
|
1942
1945
|
}
|
|
1943
1946
|
};
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
],
|
|
1948
|
-
var
|
|
1949
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1947
|
+
at = Ji([
|
|
1948
|
+
In(0, y(Dt)),
|
|
1949
|
+
In(1, y(ce))
|
|
1950
|
+
], at);
|
|
1951
|
+
var Qi = Object.defineProperty, es = Object.getOwnPropertyDescriptor, ts = (t, e, n) => e in t ? Qi(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ns = (t, e, n, i) => {
|
|
1952
|
+
for (var r = i > 1 ? void 0 : i ? es(e, n) : e, s = t.length - 1, o; s >= 0; s--)
|
|
1950
1953
|
(o = t[s]) && (r = o(r) || r);
|
|
1951
1954
|
return r;
|
|
1952
|
-
},
|
|
1953
|
-
let
|
|
1954
|
-
constructor(t =
|
|
1955
|
+
}, Cn = (t, e) => (n, i) => e(n, i, t), gt = (t, e, n) => ts(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1956
|
+
let Ce = class extends ur {
|
|
1957
|
+
constructor(t = mn, e, n) {
|
|
1955
1958
|
super(), this._config = t, this._injector = e, this._configService = n;
|
|
1956
|
-
const { menu: i, ...r } =
|
|
1959
|
+
const { menu: i, ...r } = lr(
|
|
1957
1960
|
{},
|
|
1958
|
-
|
|
1961
|
+
mn,
|
|
1959
1962
|
this._config
|
|
1960
1963
|
);
|
|
1961
|
-
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(
|
|
1964
|
+
i && this._configService.setConfig("menu", i, { merge: !0 }), this._configService.setConfig(Un, r);
|
|
1962
1965
|
}
|
|
1963
1966
|
onStarting() {
|
|
1964
1967
|
[
|
|
1965
1968
|
[ce],
|
|
1966
1969
|
[Z],
|
|
1967
|
-
[
|
|
1968
|
-
[it],
|
|
1969
|
-
[rt],
|
|
1970
|
+
[Hn],
|
|
1970
1971
|
[st],
|
|
1971
|
-
[
|
|
1972
|
-
[
|
|
1972
|
+
[it],
|
|
1973
|
+
[ot],
|
|
1973
1974
|
[nt],
|
|
1974
|
-
[
|
|
1975
|
-
|
|
1975
|
+
[Je],
|
|
1976
|
+
[rt],
|
|
1977
|
+
[at]
|
|
1978
|
+
].forEach((e) => this._injector.add(e)), this._injector.get(st);
|
|
1976
1979
|
}
|
|
1977
1980
|
onReady() {
|
|
1978
|
-
this._injector.get(
|
|
1981
|
+
this._injector.get(He).registerRenderModule(k.UNIVER_SHEET, [bt]), this._injector.get(nt), this._injector.get(Je), this._injector.get(ot);
|
|
1979
1982
|
}
|
|
1980
1983
|
onRendered() {
|
|
1981
|
-
this._injector.get(
|
|
1984
|
+
this._injector.get(rt), this._injector.get(at), this._injector.get(it);
|
|
1982
1985
|
}
|
|
1983
1986
|
};
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1987
|
+
gt(Ce, "pluginName", Ft);
|
|
1988
|
+
gt(Ce, "packageName", jn.name);
|
|
1989
|
+
gt(Ce, "version", jn.version);
|
|
1990
|
+
gt(Ce, "type", k.UNIVER_SHEET);
|
|
1991
|
+
Ce = ns([
|
|
1992
|
+
cr(li, $r),
|
|
1993
|
+
Cn(1, y(ut)),
|
|
1994
|
+
Cn(2, Sn)
|
|
1995
|
+
], Ce);
|
|
1991
1996
|
export {
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
+
qe as CloseHyperLinkPopupOperation,
|
|
1998
|
+
Bt as InsertHyperLinkOperation,
|
|
1999
|
+
Wn as InsertLinkShortcut,
|
|
2000
|
+
Vt as OpenHyperLinkEditPanelOperation,
|
|
2001
|
+
Je as SheetsHyperLinkCopyPasteController,
|
|
1997
2002
|
Z as SheetsHyperLinkPopupService,
|
|
1998
2003
|
ce as SheetsHyperLinkResolverService,
|
|
1999
|
-
|
|
2000
|
-
|
|
2004
|
+
Hn as SheetsHyperLinkSidePanelService,
|
|
2005
|
+
Ce as UniverSheetsHyperLinkUIPlugin
|
|
2001
2006
|
};
|