@univerjs/sheets-hyper-link-ui 0.5.2 → 0.5.3-experimental.20250106-e3b7a39
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 +2 -2
- package/lib/es/index.js +141 -141
- package/lib/index.css +1 -1
- package/lib/types/controllers/hyper-link-permission.controller.d.ts +3 -3
- package/lib/types/controllers/popup.controller.d.ts +4 -3
- package/lib/types/facade/f-workbook.d.ts +5 -1
- package/lib/umd/index.js +2 -2
- package/package.json +16 -40
- package/LICENSE +0 -176
package/lib/es/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var rr = Object.defineProperty;
|
|
2
2
|
var ir = (t, e, n) => e in t ? rr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
-
var
|
|
4
|
-
import { Tools as
|
|
5
|
-
import { SheetHyperLinkType as S, ERROR_RANGE as fr, HyperLinkModel as dt, RemoveHyperLinkMutation as Ue, AddHyperLinkMutation as He, SheetsHyperLinkParserService as kt, UpdateRichHyperLinkCommand as vr, UpdateHyperLinkCommand as _r, AddRichHyperLinkCommand as Sr, AddHyperLinkCommand as
|
|
6
|
-
import { ScrollToRangeOperation as wn, COPY_TYPE as Rr, virtualizeDiscreteRanges as Lt, rangeToDiscreteRange as Lr, PREDEFINED_HOOK_NAME as
|
|
7
|
-
import { MessageType as xe, FormLayout as ve, Input as cn, Select as yt, Button as ln, Tooltip as
|
|
8
|
-
import { deserializeRangeWithSheet as Fe, IDefinedNamesService as
|
|
9
|
-
import { SetSelectionsOperation as
|
|
3
|
+
var A = (t, e, n) => ir(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { Tools as Ce, Inject as R, LocaleService as ct, UniverInstanceType as O, isValidRange as Rn, IUniverInstanceService as K, ICommandService as ie, IConfigService as Ln, RANGE_TYPE as sn, Rectangle as ye, Injector as lt, Disposable as Y, Range as Pn, ObjectMatrix as sr, useDependency as E, IContextService as bn, ThemeService as or, DataStreamTreeTokenType as on, CustomRangeType as Ge, BuildTextUtils as Se, ColorKit as ar, DOCS_ZEN_EDITOR_UNIT_ID_KEY as x, DisposableCollection as cr, FOCUSING_SHEET as Ct, generateRandomId as lr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Ie, DataValidationType as It, CommandType as ut, FOCUSING_FX_BAR_EDITOR as ur, IPermissionService as dr, InterceptorEffectEnum as pr, DependentOn as hr, Plugin as gr, merge as mr } from "@univerjs/core";
|
|
5
|
+
import { SheetHyperLinkType as S, ERROR_RANGE as fr, HyperLinkModel as dt, RemoveHyperLinkMutation as Ue, AddHyperLinkMutation as He, SheetsHyperLinkParserService as kt, UpdateRichHyperLinkCommand as vr, UpdateHyperLinkCommand as _r, AddRichHyperLinkCommand as Sr, AddHyperLinkCommand as Cr, CancelRichHyperLinkCommand as Ir, CancelHyperLinkCommand as yr, UniverSheetsHyperLinkPlugin as Er } from "@univerjs/sheets-hyper-link";
|
|
6
|
+
import { ScrollToRangeOperation as wn, COPY_TYPE as Rr, virtualizeDiscreteRanges as Lt, rangeToDiscreteRange as Lr, PREDEFINED_HOOK_NAME as Ae, getRepeatRange as Pr, ISheetClipboardService as br, IEditorBridgeService as re, IMarkSelectionService as wr, SheetCanvasPopManagerService as Or, getEditingCustomRangePosition as kr, getCustomRangePosition as Tr, whenSheetEditorFocused as xr, getCurrentRangeDisable$ as Nr, IAutoFillService as Mr, APPLY_TYPE as Oe, getAutoFillRepeatRange as Ur, HoverManagerService as Hr, HoverRenderController as Dr, SheetSkeletonManagerService as an } from "@univerjs/sheets-ui";
|
|
7
|
+
import { MessageType as xe, FormLayout as ve, Input as cn, Select as yt, Button as ln, Tooltip as Be } from "@univerjs/design";
|
|
8
|
+
import { deserializeRangeWithSheet as Fe, IDefinedNamesService as On, serializeRangeWithSheet as $r, serializeRangeToRefString as jr, serializeRange as Ar } from "@univerjs/engine-formula";
|
|
9
|
+
import { SetSelectionsOperation as kn, SetWorksheetActiveOperation as Tn, SheetsSelectionsService as Tt, getSheetCommandTarget as xn, WorkbookEditablePermission as xt, WorksheetEditPermission as Nt, WorksheetSetCellValuePermission as Nn, WorksheetInsertHyperlinkPermission as Mt, RangeProtectionPermissionEditPoint as Ut, SheetPermissionCheckController as Mn, WorkbookViewPermission as Br, WorksheetViewPermission as Vr, RangeProtectionPermissionViewPoint as Fr, WorkbookCopyPermission as Wr, WorksheetCopyPermission as Zr, ClearSelectionContentCommand as Gr, ClearSelectionAllCommand as Kr, ClearSelectionFormatCommand as Yr, SheetInterceptorService as zr, INTERCEPTOR_POINT as qr } from "@univerjs/sheets";
|
|
10
10
|
import { IMessageService as Un, useObservable as Jr, IZenZoneService as pt, useEvent as Xr, KeyCode as Pt, MenuItemType as Hn, MetaKeys as Qr, getMenuHiddenObservable as ht, RibbonStartGroup as ei, ContextMenuPosition as ti, ContextMenuGroup as ni, ComponentManager as ri, IShortcutService as ii, IMenuManagerService as si } from "@univerjs/ui";
|
|
11
11
|
import { DocSelectionRenderService as Dn, DocBackScrollRenderController as oi, DocCanvasPopManagerService as ai, calcDocRangePositions as ci, DocEventManagerService as un, UniverDocsUIPlugin as li } from "@univerjs/docs-ui";
|
|
12
12
|
import { IRenderManagerService as $e } from "@univerjs/engine-render";
|
|
@@ -16,7 +16,7 @@ import mi, { useState as J, useMemo as pn, useRef as bt, useCallback as fi, useE
|
|
|
16
16
|
import { RangeSelector as vi } from "@univerjs/sheets-formula-ui";
|
|
17
17
|
import { SheetDataValidationModel as hn } from "@univerjs/sheets-data-validation";
|
|
18
18
|
function Ke(t) {
|
|
19
|
-
return
|
|
19
|
+
return Ce.isLegalUrl(t);
|
|
20
20
|
}
|
|
21
21
|
function _i(t) {
|
|
22
22
|
return /^[a-zA-Z]+:\/\//.test(t);
|
|
@@ -24,7 +24,7 @@ function _i(t) {
|
|
|
24
24
|
function Si(t) {
|
|
25
25
|
return /^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(t);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function Ci(t) {
|
|
28
28
|
if (Ke(t)) {
|
|
29
29
|
const e = _i(t) ? t : Si(t) ? `mailto://${t}` : `http://${t}`;
|
|
30
30
|
let n;
|
|
@@ -38,10 +38,10 @@ function Ii(t) {
|
|
|
38
38
|
return t;
|
|
39
39
|
}
|
|
40
40
|
const $n = "sheets-hyper-link-ui.config", gn = {};
|
|
41
|
-
var
|
|
41
|
+
var Ii = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, Ei = (t, e, n, i) => {
|
|
42
42
|
for (var r = i > 1 ? void 0 : i ? yi(e, n) : e, o = t.length - 1, s; o >= 0; o--)
|
|
43
43
|
(s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
|
|
44
|
-
return i && r &&
|
|
44
|
+
return i && r && Ii(e, n, r), r;
|
|
45
45
|
}, _e = (t, e) => (n, i) => e(n, i, t);
|
|
46
46
|
function Ri(t, e) {
|
|
47
47
|
const n = e.getMergeData(), i = e.getMaxColumns() - 1, r = e.getMaxRows() - 1;
|
|
@@ -105,7 +105,7 @@ let pe = class {
|
|
|
105
105
|
if (r) {
|
|
106
106
|
const o = Ri(n, r);
|
|
107
107
|
await this._commandService.executeCommand(
|
|
108
|
-
|
|
108
|
+
kn.id,
|
|
109
109
|
{
|
|
110
110
|
unitId: t,
|
|
111
111
|
subUnitId: e,
|
|
@@ -133,7 +133,7 @@ let pe = class {
|
|
|
133
133
|
return r ? n.getHiddenWorksheets().indexOf(e) > -1 ? (this._messageService.show({
|
|
134
134
|
content: this._localeService.t("hyperLink.message.hiddenSheet"),
|
|
135
135
|
type: xe.Error
|
|
136
|
-
}), !1) : await this._commandService.executeCommand(
|
|
136
|
+
}), !1) : await this._commandService.executeCommand(Tn.id, { unitId: t, subUnitId: e }) ? r : !1 : (this._messageService.show({
|
|
137
137
|
content: this._localeService.t("hyperLink.message.noSheet"),
|
|
138
138
|
type: xe.Error
|
|
139
139
|
}), !1);
|
|
@@ -152,7 +152,7 @@ let pe = class {
|
|
|
152
152
|
pe = Ei([
|
|
153
153
|
_e(0, K),
|
|
154
154
|
_e(1, ie),
|
|
155
|
-
_e(2,
|
|
155
|
+
_e(2, On),
|
|
156
156
|
_e(3, Un),
|
|
157
157
|
_e(4, R(ct)),
|
|
158
158
|
_e(5, Ln)
|
|
@@ -166,8 +166,8 @@ var Li = Object.defineProperty, Pi = Object.getOwnPropertyDescriptor, bi = (t, e
|
|
|
166
166
|
let Ye = class extends Y {
|
|
167
167
|
constructor(e, n, i, r) {
|
|
168
168
|
super();
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
A(this, "_plainTextFilter", /* @__PURE__ */ new Set());
|
|
170
|
+
A(this, "_copyInfo");
|
|
171
171
|
this._sheetClipboardService = e, this._hyperLinkModel = n, this._injector = i, this._resolverService = r, this._initCopyPaste(), this.disposeWithMe(() => {
|
|
172
172
|
this._plainTextFilter.clear();
|
|
173
173
|
});
|
|
@@ -195,7 +195,7 @@ let Ye = class extends Y {
|
|
|
195
195
|
if (Ke(n) && i) {
|
|
196
196
|
const { range: r, unitId: o, subUnitId: s } = e, { ranges: [c], mapFunc: l } = Lt([r]), p = [], u = [];
|
|
197
197
|
return Pn.foreach(c, (g, d) => {
|
|
198
|
-
const { row: v, col:
|
|
198
|
+
const { row: v, col: C } = l(g, d), _ = this._hyperLinkModel.getHyperLinkByLocation(o, s, v, C);
|
|
199
199
|
_ && p.push({
|
|
200
200
|
id: Ue.id,
|
|
201
201
|
params: {
|
|
@@ -244,10 +244,10 @@ let Ye = class extends Y {
|
|
|
244
244
|
if (!this._copyInfo || !this._copyInfo.matrix.getSizeOf() || !n.copyRange)
|
|
245
245
|
return { redos: [], undos: [] };
|
|
246
246
|
if ([
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
247
|
+
Ae.SPECIAL_PASTE_COL_WIDTH,
|
|
248
|
+
Ae.SPECIAL_PASTE_VALUE,
|
|
249
|
+
Ae.SPECIAL_PASTE_FORMAT,
|
|
250
|
+
Ae.SPECIAL_PASTE_FORMULA
|
|
251
251
|
].includes(
|
|
252
252
|
n.pasteType
|
|
253
253
|
))
|
|
@@ -255,16 +255,16 @@ let Ye = class extends Y {
|
|
|
255
255
|
const { unitId: i, subUnitId: r } = this._copyInfo, o = [], s = [], { ranges: [c, l], mapFunc: p } = Lt([n.copyRange, e]);
|
|
256
256
|
return Pr(c, l, !0).forEach(({ startRange: g }) => {
|
|
257
257
|
var d;
|
|
258
|
-
(d = this._copyInfo) == null || d.matrix.forValue((v,
|
|
258
|
+
(d = this._copyInfo) == null || d.matrix.forValue((v, C, _) => {
|
|
259
259
|
const b = ye.getPositionRange(
|
|
260
260
|
{
|
|
261
261
|
startRow: v,
|
|
262
262
|
endRow: v,
|
|
263
|
-
startColumn:
|
|
264
|
-
endColumn:
|
|
263
|
+
startColumn: C,
|
|
264
|
+
endColumn: C
|
|
265
265
|
},
|
|
266
266
|
g
|
|
267
|
-
), a = this._hyperLinkModel.getHyperLink(i, r, _), { row: w, col: M } = p(b.startRow, b.startColumn), L = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, w, M), k =
|
|
267
|
+
), a = this._hyperLinkModel.getHyperLink(i, r, _), { row: w, col: M } = p(b.startRow, b.startColumn), L = this._hyperLinkModel.getHyperLinkByLocation(n.unitId, n.subUnitId, w, M), k = Ce.generateRandomId();
|
|
268
268
|
L && o.push({
|
|
269
269
|
id: Ue.id,
|
|
270
270
|
params: {
|
|
@@ -341,7 +341,7 @@ var m = Oi();
|
|
|
341
341
|
class jn extends Y {
|
|
342
342
|
constructor() {
|
|
343
343
|
super(...arguments);
|
|
344
|
-
|
|
344
|
+
A(this, "_customHyperLinks", /* @__PURE__ */ new Map());
|
|
345
345
|
}
|
|
346
346
|
isBuiltInLinkType(n) {
|
|
347
347
|
return n !== S.URL;
|
|
@@ -371,14 +371,14 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
371
371
|
cellLinkEditButtons: Ti
|
|
372
372
|
}, ze = () => {
|
|
373
373
|
var Ft;
|
|
374
|
-
const [t, e] = J(""), [n, i] = J(!1), [r, o] = J(""), [s, c] = J(!0), [l, p] = J(S.URL), [u, g] = J(""), d = E(ct), v = E(
|
|
374
|
+
const [t, e] = J(""), [n, i] = J(!1), [r, o] = J(""), [s, c] = J(!0), [l, p] = J(S.URL), [u, g] = J(""), d = E(ct), v = E(On), C = E(re), _ = E(K), b = E(G), a = Jr(b.currentEditing$), w = E(kt), M = E(pe), L = E(ie), k = E(jn), X = pn(() => k.getOptions(), [k]), D = E(pt), z = E($e), Ee = E(wr), je = E(De), se = E(bn), Re = E(or), Le = E(De), Pe = bt({}), oe = pn(() => {
|
|
375
375
|
if (!k.isBuiltInLinkType(l))
|
|
376
376
|
return k.getCustomHyperLink(l);
|
|
377
|
-
}, [k, l]), [j, Jn] = J(!1), [be, gt] = J(!1), H = bt(!1),
|
|
377
|
+
}, [k, l]), [j, Jn] = J(!1), [be, gt] = J(!1), H = bt(!1), B = _.getCurrentUnitForType(O.UNIVER_SHEET), Xn = (B == null ? void 0 : B.getActiveSheet().getSheetId()) || "", Q = fi((h) => {
|
|
378
378
|
o(h.replaceAll(on.CUSTOM_RANGE_START, "").replaceAll(on.CUSTOM_RANGE_END, ""));
|
|
379
379
|
}, [o]);
|
|
380
380
|
ne(() => {
|
|
381
|
-
var h, y,
|
|
381
|
+
var h, y, I, P, N, V, Wt, Zt, Gt, Kt, Yt, zt, qt, Jt, Xt, Qt, en;
|
|
382
382
|
if ((a == null ? void 0 : a.row) !== void 0 && a.col !== void 0) {
|
|
383
383
|
const { customRange: ae, row: _t, col: St } = a;
|
|
384
384
|
let { label: q } = a;
|
|
@@ -388,7 +388,7 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
388
388
|
F = {
|
|
389
389
|
id: (h = ae == null ? void 0 : ae.rangeId) != null ? h : "",
|
|
390
390
|
display: q != null ? q : "",
|
|
391
|
-
payload: (
|
|
391
|
+
payload: (I = (y = ae == null ? void 0 : ae.properties) == null ? void 0 : y.url) != null ? I : "",
|
|
392
392
|
row: _t,
|
|
393
393
|
column: St
|
|
394
394
|
};
|
|
@@ -397,7 +397,7 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
397
397
|
var rn;
|
|
398
398
|
return nn.rangeType === Ge.HYPERLINK && ((rn = nn.properties) == null ? void 0 : rn.url);
|
|
399
399
|
}), we = U == null ? void 0 : U.v;
|
|
400
|
-
U && (!Se.transform.isEmptyDocument((Zt = (Wt = U.p) == null ? void 0 : Wt.body) == null ? void 0 : Zt.dataStream) ||
|
|
400
|
+
U && (!Se.transform.isEmptyDocument((Zt = (Wt = U.p) == null ? void 0 : Wt.body) == null ? void 0 : Zt.dataStream) || Ce.isDefine(we)) && c(!1), F = {
|
|
401
401
|
id: "",
|
|
402
402
|
display: "",
|
|
403
403
|
payload: (Kt = (Gt = fe == null ? void 0 : fe.properties) == null ? void 0 : Gt.url) != null ? Kt : "",
|
|
@@ -450,8 +450,8 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
450
450
|
}
|
|
451
451
|
}, [a, M, k, je, _]), ne(() => {
|
|
452
452
|
let h = null;
|
|
453
|
-
if (a && !a.customRangeId && a.type === f.VIEWING &&
|
|
454
|
-
const y = _.getUnit(a.unitId, O.UNIVER_SHEET),
|
|
453
|
+
if (a && !a.customRangeId && a.type === f.VIEWING && Ce.isDefine(a.row) && Ce.isDefine(a.col)) {
|
|
454
|
+
const y = _.getUnit(a.unitId, O.UNIVER_SHEET), I = y == null ? void 0 : y.getSheetBySheetId(a.subUnitId), P = I == null ? void 0 : I.getMergedCell(a.row, a.col), N = new ar(Re.getCurrentTheme().hyacinth500).toRgb();
|
|
455
455
|
h = Ee.addShape(
|
|
456
456
|
{
|
|
457
457
|
range: P != null ? P : {
|
|
@@ -479,26 +479,26 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
479
479
|
}, [a, Ee, Re, _]), ne(() => {
|
|
480
480
|
gt(l === S.RANGE);
|
|
481
481
|
}, [l]), ne(() => {
|
|
482
|
-
const h = (a == null ? void 0 : a.type) === f.ZEN_EDITOR ? z.getRenderById(x) : z.getRenderById(
|
|
482
|
+
const h = (a == null ? void 0 : a.type) === f.ZEN_EDITOR ? z.getRenderById(x) : z.getRenderById(C.getCurrentEditorId()), y = new cr();
|
|
483
483
|
if (h) {
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
|
|
484
|
+
const I = h.with(Dn);
|
|
485
|
+
I.setReserveRangesStatus(!0), y.add(() => {
|
|
486
|
+
I.setReserveRangesStatus(!1);
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
489
|
return () => {
|
|
490
|
-
|
|
490
|
+
C.disableForceKeepVisible(), y.dispose();
|
|
491
491
|
};
|
|
492
|
-
}, [a == null ? void 0 : a.type,
|
|
492
|
+
}, [a == null ? void 0 : a.type, C, z]), ne(() => (b.setIsKeepVisible(be), () => {
|
|
493
493
|
b.setIsKeepVisible(!1);
|
|
494
494
|
}), [be, b]), ne(() => () => {
|
|
495
|
-
D.temporaryHidden && (D.show(), se.setContextValue(
|
|
495
|
+
D.temporaryHidden && (D.show(), se.setContextValue(Ct, !1));
|
|
496
496
|
}, [se, D]), ne(() => {
|
|
497
497
|
if (be)
|
|
498
|
-
return
|
|
499
|
-
|
|
498
|
+
return C.enableForceKeepVisible(), () => {
|
|
499
|
+
C.disableForceKeepVisible();
|
|
500
500
|
};
|
|
501
|
-
}, [be,
|
|
501
|
+
}, [be, C]);
|
|
502
502
|
const Qn = [
|
|
503
503
|
{
|
|
504
504
|
label: d.t("hyperLink.form.link"),
|
|
@@ -518,27 +518,27 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
518
518
|
},
|
|
519
519
|
...X
|
|
520
520
|
];
|
|
521
|
-
if (!
|
|
521
|
+
if (!B)
|
|
522
522
|
return;
|
|
523
|
-
const er =
|
|
523
|
+
const er = B.getHiddenWorksheets(), mt = B.getSheets().map((h) => ({ label: h.getName(), value: h.getSheetId() })).filter((h) => er.indexOf(h.value) === -1), ft = Object.values((Ft = v.getDefinedNameMap(B.getUnitId())) != null ? Ft : {}).map((h) => ({
|
|
524
524
|
label: h.name,
|
|
525
525
|
value: h.id
|
|
526
526
|
})), Vt = (h, y) => {
|
|
527
527
|
if (h === S.URL)
|
|
528
|
-
return
|
|
528
|
+
return Ci(y);
|
|
529
529
|
if (h === S.RANGE) {
|
|
530
|
-
const
|
|
530
|
+
const I = Fe(y), P = B.getSheetBySheetName(I.sheetName);
|
|
531
531
|
if (P)
|
|
532
|
-
return `#gid=${P.getSheetId()}&range=${
|
|
532
|
+
return `#gid=${P.getSheetId()}&range=${Ar(I.range)}`;
|
|
533
533
|
}
|
|
534
534
|
return `#${h}=${y}`;
|
|
535
535
|
}, tr = Xr((h) => {
|
|
536
536
|
var N;
|
|
537
|
-
const
|
|
538
|
-
if (!
|
|
537
|
+
const I = h.split(",").map(Fe)[0];
|
|
538
|
+
if (!I || !Rn(I.range))
|
|
539
539
|
return;
|
|
540
|
-
|
|
541
|
-
const P = jr(
|
|
540
|
+
I.sheetName || (I.sheetName = ((N = B.getActiveSheet()) == null ? void 0 : N.getName()) || "");
|
|
541
|
+
const P = jr(I);
|
|
542
542
|
g(P), P && (H.current || !r) && (Q(P), H.current = !0);
|
|
543
543
|
}), vt = async () => {
|
|
544
544
|
if (s && !r || !u || l === S.URL && !Ke(u)) {
|
|
@@ -558,10 +558,10 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
558
558
|
},
|
|
559
559
|
row: a.row,
|
|
560
560
|
column: a.col,
|
|
561
|
-
documentId: a.type === f.ZEN_EDITOR ? x :
|
|
561
|
+
documentId: a.type === f.ZEN_EDITOR ? x : C.getCurrentEditorId()
|
|
562
562
|
});
|
|
563
563
|
} else {
|
|
564
|
-
const h = a.type === f.ZEN_EDITOR || a.type === f.EDITING ? Sr.id :
|
|
564
|
+
const h = a.type === f.ZEN_EDITOR || a.type === f.EDITING ? Sr.id : Cr.id;
|
|
565
565
|
await L.executeCommand(h, {
|
|
566
566
|
unitId: a.unitId,
|
|
567
567
|
subUnitId: a.subUnitId,
|
|
@@ -572,11 +572,11 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
572
572
|
payload: Vt(l, u),
|
|
573
573
|
display: s ? r : ""
|
|
574
574
|
},
|
|
575
|
-
documentId: a.type === f.ZEN_EDITOR ? x :
|
|
575
|
+
documentId: a.type === f.ZEN_EDITOR ? x : C.getCurrentEditorId()
|
|
576
576
|
});
|
|
577
577
|
}
|
|
578
578
|
if ((a == null ? void 0 : a.type) === f.VIEWING) {
|
|
579
|
-
await L.executeCommand(
|
|
579
|
+
await L.executeCommand(Tn.id, {
|
|
580
580
|
unitId: a.unitId,
|
|
581
581
|
subUnitId: a.subUnitId
|
|
582
582
|
});
|
|
@@ -592,10 +592,10 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
592
592
|
}
|
|
593
593
|
L.executeCommand(Je.id);
|
|
594
594
|
}, nr = (h) => {
|
|
595
|
-
var
|
|
595
|
+
var I;
|
|
596
596
|
if (l !== S.RANGE)
|
|
597
597
|
return;
|
|
598
|
-
const y = (
|
|
598
|
+
const y = (I = Pe.current) == null ? void 0 : I.handleOutClick;
|
|
599
599
|
y && y(h, () => gt(!1));
|
|
600
600
|
};
|
|
601
601
|
return a ? /* @__PURE__ */ m.jsxs("div", { className: vn.cellLinkEdit, style: { display: n ? "none" : "block" }, onClick: nr, children: [
|
|
@@ -653,7 +653,7 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
653
653
|
l === S.RANGE && /* @__PURE__ */ m.jsx(ve, { error: j && !u ? d.t("hyperLink.form.inputError") : "", children: /* @__PURE__ */ m.jsx(
|
|
654
654
|
vi,
|
|
655
655
|
{
|
|
656
|
-
unitId:
|
|
656
|
+
unitId: B.getUnitId(),
|
|
657
657
|
subUnitId: Xn,
|
|
658
658
|
isOnlyOneRange: !0,
|
|
659
659
|
isSupportAcrossSheet: !0,
|
|
@@ -663,20 +663,20 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
663
663
|
onFocus: () => gt(!0),
|
|
664
664
|
actions: Pe.current,
|
|
665
665
|
onRangeSelectorDialogVisibleChange: async (h) => {
|
|
666
|
-
var y,
|
|
666
|
+
var y, I;
|
|
667
667
|
if (h)
|
|
668
|
-
a.type === f.ZEN_EDITOR && (D.hide(), se.setContextValue(
|
|
668
|
+
a.type === f.ZEN_EDITOR && (D.hide(), se.setContextValue(Ct, !0)), a.type !== f.VIEWING && C.enableForceKeepVisible(), i(!0);
|
|
669
669
|
else {
|
|
670
670
|
if (await M.navigateToRange(a.unitId, a.subUnitId, { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col }, !0), a.type === f.ZEN_EDITOR) {
|
|
671
|
-
await L.executeCommand(
|
|
671
|
+
await L.executeCommand(kn.id, {
|
|
672
672
|
unitId: a.unitId,
|
|
673
673
|
subUnitId: a.subUnitId,
|
|
674
674
|
selections: [{ range: { startRow: a.row, endRow: a.row, startColumn: a.col, endColumn: a.col } }]
|
|
675
|
-
}), D.show(), se.setContextValue(
|
|
676
|
-
const P = (y = z.getRenderById(x)) == null ? void 0 : y.with(oi), N = (
|
|
675
|
+
}), D.show(), se.setContextValue(Ct, !1);
|
|
676
|
+
const P = (y = z.getRenderById(x)) == null ? void 0 : y.with(oi), N = (I = Le.getTextRanges({ unitId: x, subUnitId: x })) == null ? void 0 : I[0];
|
|
677
677
|
P && N && (P.scrollToRange(N), Le.refreshSelection({ unitId: x, subUnitId: x }));
|
|
678
678
|
}
|
|
679
|
-
|
|
679
|
+
C.disableForceKeepVisible(), i(!1);
|
|
680
680
|
}
|
|
681
681
|
}
|
|
682
682
|
}
|
|
@@ -689,8 +689,8 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
689
689
|
onChange: (h) => {
|
|
690
690
|
var P, N;
|
|
691
691
|
g(h);
|
|
692
|
-
const y = (P = mt.find((V) => V.value === h)) == null ? void 0 : P.label,
|
|
693
|
-
y && (H.current || !r || r ===
|
|
692
|
+
const y = (P = mt.find((V) => V.value === h)) == null ? void 0 : P.label, I = (N = mt.find((V) => V.value === u)) == null ? void 0 : N.label;
|
|
693
|
+
y && (H.current || !r || r === I) && (Q(y), H.current = !0);
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
696
|
) }),
|
|
@@ -702,8 +702,8 @@ const ki = "univer-cell-link-edit", Ti = "univer-cell-link-edit-buttons", vn = {
|
|
|
702
702
|
onChange: (h) => {
|
|
703
703
|
var P, N;
|
|
704
704
|
g(h);
|
|
705
|
-
const y = (P = ft.find((V) => V.value === h)) == null ? void 0 : P.label,
|
|
706
|
-
y && (H.current || !r || r ===
|
|
705
|
+
const y = (P = ft.find((V) => V.value === h)) == null ? void 0 : P.label, I = (N = ft.find((V) => V.value === u)) == null ? void 0 : N.label;
|
|
706
|
+
y && (H.current || !r || r === I) && (Q(y), H.current = !0);
|
|
707
707
|
}
|
|
708
708
|
}
|
|
709
709
|
) }),
|
|
@@ -763,11 +763,11 @@ var $ = function() {
|
|
|
763
763
|
return n;
|
|
764
764
|
}, me = he(function(t, e) {
|
|
765
765
|
var n = t.icon, i = t.id, r = t.className, o = t.extend, s = xi(t, ["icon", "id", "className", "extend"]), c = "univerjs-icon univerjs-icon-".concat(i, " ").concat(r || "").trim(), l = bt("_".concat(Ui()));
|
|
766
|
-
return
|
|
766
|
+
return An(n, "".concat(i), { defIds: n.defIds, idSuffix: l.current }, $({ ref: e, className: c }, s), o);
|
|
767
767
|
});
|
|
768
|
-
function
|
|
768
|
+
function An(t, e, n, i, r) {
|
|
769
769
|
return ge(t.tag, $($({ key: e }, Ni(t, n, r)), i), (Mi(t, n).children || []).map(function(o, s) {
|
|
770
|
-
return
|
|
770
|
+
return An(o, "".concat(e, "-").concat(t.tag, "-").concat(s), n, void 0, r);
|
|
771
771
|
}));
|
|
772
772
|
}
|
|
773
773
|
function Ni(t, e, n) {
|
|
@@ -797,14 +797,14 @@ var Hi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em"
|
|
|
797
797
|
}));
|
|
798
798
|
});
|
|
799
799
|
Ze.displayName = "AllBorderSingle";
|
|
800
|
-
var Di = { 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" } }] },
|
|
800
|
+
var Di = { 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" } }] }, Bn = he(function(t, e) {
|
|
801
801
|
return ge(me, Object.assign({}, t, {
|
|
802
802
|
id: "copy-single",
|
|
803
803
|
ref: e,
|
|
804
804
|
icon: Di
|
|
805
805
|
}));
|
|
806
806
|
});
|
|
807
|
-
|
|
807
|
+
Bn.displayName = "CopySingle";
|
|
808
808
|
var $i = { 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" } }] }, Dt = he(function(t, e) {
|
|
809
809
|
return ge(me, Object.assign({}, t, {
|
|
810
810
|
id: "link-single",
|
|
@@ -821,19 +821,19 @@ var ji = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 17", width: "1em"
|
|
|
821
821
|
}));
|
|
822
822
|
});
|
|
823
823
|
Vn.displayName = "UnlinkSingle";
|
|
824
|
-
var
|
|
824
|
+
var Ai = { 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" } }] }, Fn = he(function(t, e) {
|
|
825
825
|
return ge(me, Object.assign({}, t, {
|
|
826
826
|
id: "write-single",
|
|
827
827
|
ref: e,
|
|
828
|
-
icon:
|
|
828
|
+
icon: Ai
|
|
829
829
|
}));
|
|
830
830
|
});
|
|
831
831
|
Fn.displayName = "WriteSingle";
|
|
832
|
-
var
|
|
832
|
+
var Bi = { tag: "svg", attrs: { fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "#35BD4B", d: "M3.4535 1.12549C2.7002 1.12549 2.08954 1.73615 2.08954 2.48945V13.5104C2.08954 14.2637 2.7002 14.8744 3.4535 14.8744H12.5465C13.2998 14.8744 13.9105 14.2637 13.9105 13.5104V5.0992L10.0091 1.12549H3.4535Z" } }, { tag: "path", attrs: { fill: "#32A846", d: "M10.0075 1.12549L13.9104 5.09842H10.6742C10.306 5.09842 10.0075 4.79994 10.0075 4.43175V1.12549Z" } }, { tag: "path", attrs: { fill: "#fff", d: "M7.8088 10.2949L6.3764 12.403C6.26259 12.5705 6.03455 12.614 5.86705 12.5002C5.69955 12.3864 5.65603 12.1584 5.76984 11.9909L7.3655 9.64252L5.94042 7.54519C5.82661 7.37769 5.87013 7.14964 6.03763 7.03583C6.20512 6.92202 6.43317 6.96555 6.54698 7.13304L7.8088 8.9901L9.07062 7.13304C9.18443 6.96555 9.41248 6.92202 9.57997 7.03583C9.74747 7.14964 9.79099 7.37769 9.67718 7.54519L8.2521 9.64252L9.84776 11.9909C9.96157 12.1584 9.91805 12.3864 9.75055 12.5002C9.58305 12.614 9.35501 12.5705 9.2412 12.403L7.8088 10.2949Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Wn = he(function(t, e) {
|
|
833
833
|
return ge(me, Object.assign({}, t, {
|
|
834
834
|
id: "xlsx",
|
|
835
835
|
ref: e,
|
|
836
|
-
icon:
|
|
836
|
+
icon: Bi
|
|
837
837
|
}));
|
|
838
838
|
});
|
|
839
839
|
Wn.displayName = "Xlsx";
|
|
@@ -867,7 +867,7 @@ const Vi = "univer-cell-link", Fi = "univer-cell-link-type", Wi = "univer-cell-l
|
|
|
867
867
|
[S.INVALID]: /* @__PURE__ */ m.jsx(Ze, {})
|
|
868
868
|
}, Sn = (t) => {
|
|
869
869
|
var M, L;
|
|
870
|
-
const e = E(G), n = E(ie), i = E(Un), r = E(ct), o = E(pe), s = E(re), c = E(kt), l = E(pt), { customRange: p, row: u, col: g, unitId: d, subUnitId: v, editPermission:
|
|
870
|
+
const e = E(G), n = E(ie), i = E(Un), r = E(ct), o = E(pe), s = E(re), c = E(kt), l = E(pt), { customRange: p, row: u, col: g, unitId: d, subUnitId: v, editPermission: C, copyPermission: _, type: b } = t;
|
|
871
871
|
if (!((M = p == null ? void 0 : p.properties) != null && M.url))
|
|
872
872
|
return null;
|
|
873
873
|
const a = c.parseHyperLink((L = p.properties.url) != null ? L : ""), w = a.type === S.INVALID;
|
|
@@ -881,7 +881,7 @@ const Vi = "univer-cell-link", Fi = "univer-cell-link-type", Wi = "univer-cell-l
|
|
|
881
881
|
},
|
|
882
882
|
children: [
|
|
883
883
|
/* @__PURE__ */ m.jsx("div", { className: W.cellLinkType, children: qi[a.type] }),
|
|
884
|
-
/* @__PURE__ */ m.jsx(
|
|
884
|
+
/* @__PURE__ */ m.jsx(Be, { showIfEllipsis: !0, title: a.name, asChild: !0, children: /* @__PURE__ */ m.jsx("span", { className: W.cellLinkUrl, children: a.name }) })
|
|
885
885
|
]
|
|
886
886
|
}
|
|
887
887
|
),
|
|
@@ -903,10 +903,10 @@ const Vi = "univer-cell-link", Fi = "univer-cell-link-type", Wi = "univer-cell-l
|
|
|
903
903
|
});
|
|
904
904
|
}
|
|
905
905
|
},
|
|
906
|
-
children: /* @__PURE__ */ m.jsx(
|
|
906
|
+
children: /* @__PURE__ */ m.jsx(Be, { placement: "bottom", title: r.t("hyperLink.popup.copy"), children: /* @__PURE__ */ m.jsx(Bn, {}) })
|
|
907
907
|
}
|
|
908
908
|
),
|
|
909
|
-
|
|
909
|
+
C && /* @__PURE__ */ m.jsxs(m.Fragment, { children: [
|
|
910
910
|
/* @__PURE__ */ m.jsx(
|
|
911
911
|
"div",
|
|
912
912
|
{
|
|
@@ -921,7 +921,7 @@ const Vi = "univer-cell-link", Fi = "univer-cell-link-type", Wi = "univer-cell-l
|
|
|
921
921
|
type: b
|
|
922
922
|
});
|
|
923
923
|
},
|
|
924
|
-
children: /* @__PURE__ */ m.jsx(
|
|
924
|
+
children: /* @__PURE__ */ m.jsx(Be, { placement: "bottom", title: r.t("hyperLink.popup.edit"), children: /* @__PURE__ */ m.jsx(Fn, {}) })
|
|
925
925
|
}
|
|
926
926
|
),
|
|
927
927
|
/* @__PURE__ */ m.jsx(
|
|
@@ -929,7 +929,7 @@ const Vi = "univer-cell-link", Fi = "univer-cell-link-type", Wi = "univer-cell-l
|
|
|
929
929
|
{
|
|
930
930
|
className: W.cellLinkOperation,
|
|
931
931
|
onClick: () => {
|
|
932
|
-
const k = b === f.EDITING || b === f.ZEN_EDITOR ?
|
|
932
|
+
const k = b === f.EDITING || b === f.ZEN_EDITOR ? Ir.id : yr.id;
|
|
933
933
|
n.syncExecuteCommand(k, {
|
|
934
934
|
unitId: d,
|
|
935
935
|
subUnitId: v,
|
|
@@ -939,7 +939,7 @@ const Vi = "univer-cell-link", Fi = "univer-cell-link-type", Wi = "univer-cell-l
|
|
|
939
939
|
documentId: b === f.ZEN_EDITOR ? x : s.getCurrentEditorId()
|
|
940
940
|
}) && e.hideCurrentPopup(void 0, !0);
|
|
941
941
|
},
|
|
942
|
-
children: /* @__PURE__ */ m.jsx(
|
|
942
|
+
children: /* @__PURE__ */ m.jsx(Be, { placement: "bottom", title: r.t("hyperLink.popup.cancel"), children: /* @__PURE__ */ m.jsx(Vn, {}) })
|
|
943
943
|
}
|
|
944
944
|
)
|
|
945
945
|
] })
|
|
@@ -970,20 +970,20 @@ var Ji = Object.defineProperty, Xi = Object.getOwnPropertyDescriptor, Qi = (t, e
|
|
|
970
970
|
(s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
|
|
971
971
|
return i && r && Ji(e, n, r), r;
|
|
972
972
|
}, ce = (t, e) => (n, i) => e(n, i, t);
|
|
973
|
-
const
|
|
973
|
+
const Cn = (t, e) => {
|
|
974
974
|
var n, i;
|
|
975
975
|
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;
|
|
976
976
|
};
|
|
977
977
|
let G = class extends Y {
|
|
978
978
|
constructor(e, n, i, r, o, s, c) {
|
|
979
979
|
super();
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
980
|
+
A(this, "_currentPopup", null);
|
|
981
|
+
A(this, "_currentPopup$", new ui());
|
|
982
|
+
A(this, "currentPopup$", this._currentPopup$.asObservable());
|
|
983
|
+
A(this, "_currentEditingPopup", null);
|
|
984
|
+
A(this, "_currentEditing$", new di(null));
|
|
985
|
+
A(this, "currentEditing$", this._currentEditing$.asObservable());
|
|
986
|
+
A(this, "_isKeepVisible", !1);
|
|
987
987
|
this._sheetCanvasPopManagerService = e, this._injector = n, this._univerInstanceService = i, this._editorBridgeService = r, this._textSelectionManagerService = o, this._docCanvasPopManagerService = s, this._zenZoneService = c, this.disposeWithMe(() => {
|
|
988
988
|
this.hideCurrentPopup(), this.endEditing(), this._currentEditing$.complete(), this._currentPopup$.complete();
|
|
989
989
|
});
|
|
@@ -1001,10 +1001,10 @@ let G = class extends Y {
|
|
|
1001
1001
|
return this._isKeepVisible;
|
|
1002
1002
|
}
|
|
1003
1003
|
showPopup(e) {
|
|
1004
|
-
if (this._currentPopup &&
|
|
1004
|
+
if (this._currentPopup && Cn(e, this._currentPopup) || (this.hideCurrentPopup(void 0, !0), e.type !== f.ZEN_EDITOR && this._zenZoneService.visible))
|
|
1005
1005
|
return;
|
|
1006
1006
|
const n = this._currentEditing$.getValue();
|
|
1007
|
-
if (n &&
|
|
1007
|
+
if (n && Cn(e, n))
|
|
1008
1008
|
return;
|
|
1009
1009
|
const { unitId: i, subUnitId: r, row: o, col: s, customRangeRect: c, customRange: l } = e;
|
|
1010
1010
|
let p;
|
|
@@ -1129,8 +1129,8 @@ let G = class extends Y {
|
|
|
1129
1129
|
const u = this._getEditingRange();
|
|
1130
1130
|
if (!u)
|
|
1131
1131
|
return;
|
|
1132
|
-
this._textSelectionManagerService.replaceDocRanges([{ ...u }], { unitId:
|
|
1133
|
-
const g = this._injector.get($e).getRenderById(
|
|
1132
|
+
this._textSelectionManagerService.replaceDocRanges([{ ...u }], { unitId: Ie, subUnitId: Ie });
|
|
1133
|
+
const g = this._injector.get($e).getRenderById(Ie);
|
|
1134
1134
|
if (!g)
|
|
1135
1135
|
return;
|
|
1136
1136
|
const d = ci(u, g);
|
|
@@ -1200,7 +1200,7 @@ let G = class extends Y {
|
|
|
1200
1200
|
i
|
|
1201
1201
|
);
|
|
1202
1202
|
} else {
|
|
1203
|
-
const d = this._univerInstanceService.getUnit(n, O.UNIVER_SHEET), v = d == null ? void 0 : d.getSheetBySheetId(i),
|
|
1203
|
+
const d = this._univerInstanceService.getUnit(n, O.UNIVER_SHEET), v = d == null ? void 0 : d.getSheetBySheetId(i), C = v == null ? void 0 : v.getCellRaw(e.row, e.col), _ = d == null ? void 0 : d.getStyles().getStyleByCell(C), b = _ == null ? void 0 : _.tr, a = Tr(this._injector, e.unitId, e.subUnitId, e.row, e.col, e.customRangeId);
|
|
1204
1204
|
if (!a || !((g = a.rects) != null && g.length))
|
|
1205
1205
|
return;
|
|
1206
1206
|
r = a.customRange, o = a.label, b ? this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(
|
|
@@ -1243,9 +1243,9 @@ G = Qi([
|
|
|
1243
1243
|
], G);
|
|
1244
1244
|
var Me = /* @__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))(Me || {});
|
|
1245
1245
|
const es = /* @__PURE__ */ new Set([
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1246
|
+
It.CHECKBOX,
|
|
1247
|
+
It.LIST,
|
|
1248
|
+
It.LIST_MULTIPLE
|
|
1249
1249
|
]), $t = (t, e, n, i) => {
|
|
1250
1250
|
var c, l;
|
|
1251
1251
|
const r = e.getCell(n, i);
|
|
@@ -1283,12 +1283,12 @@ const es = /* @__PURE__ */ new Set([
|
|
|
1283
1283
|
handler(t) {
|
|
1284
1284
|
return t.get(G).endEditing(), !0;
|
|
1285
1285
|
}
|
|
1286
|
-
},
|
|
1286
|
+
}, At = {
|
|
1287
1287
|
type: ut.OPERATION,
|
|
1288
1288
|
id: "sheet.operation.insert-hyper-link",
|
|
1289
1289
|
handler(t) {
|
|
1290
1290
|
var g;
|
|
1291
|
-
const e = t.get(K), n =
|
|
1291
|
+
const e = t.get(K), n = xn(e), i = t.get(re);
|
|
1292
1292
|
if (!n)
|
|
1293
1293
|
return !1;
|
|
1294
1294
|
const r = t.get(ie), s = t.get(Tt).getCurrentLastSelection();
|
|
@@ -1310,20 +1310,20 @@ const es = /* @__PURE__ */ new Set([
|
|
|
1310
1310
|
if (ts(t))
|
|
1311
1311
|
return !1;
|
|
1312
1312
|
const e = t.get(ie);
|
|
1313
|
-
return t.get(G).currentEditing ? e.executeCommand(Je.id) : e.executeCommand(
|
|
1313
|
+
return t.get(G).currentEditing ? e.executeCommand(Je.id) : e.executeCommand(At.id);
|
|
1314
1314
|
}
|
|
1315
|
-
},
|
|
1315
|
+
}, Bt = (t, e = x) => {
|
|
1316
1316
|
var r;
|
|
1317
1317
|
const n = t.get(K), i = (r = t.get($e).getRenderById(e)) == null ? void 0 : r.with(Dn);
|
|
1318
1318
|
return i ? i.textSelectionInner$.pipe(le(() => {
|
|
1319
1319
|
const s = t.get(re).getEditCellState();
|
|
1320
1320
|
if (!s)
|
|
1321
1321
|
return !0;
|
|
1322
|
-
const c =
|
|
1322
|
+
const c = xn(n, { unitId: s.unitId, subUnitId: s.sheetId });
|
|
1323
1323
|
return !(c != null && c.worksheet) || $t(t, c.worksheet, s.row, s.column) === 1 ? !0 : ns(t);
|
|
1324
1324
|
})) : Ne(!0);
|
|
1325
1325
|
}, Gn = (t) => {
|
|
1326
|
-
const e = Nr(t, { workbookTypes: [xt], worksheetTypes: [Nt,
|
|
1326
|
+
const e = Nr(t, { workbookTypes: [xt], worksheetTypes: [Nt, Nn, Mt], rangeTypes: [Ut] }, !0), n = t.get(K), i = t.get(Tt), r = t.has(re) ? t.get(re) : null, o = n.focused$.pipe(
|
|
1327
1327
|
dn((s) => !!s),
|
|
1328
1328
|
le((s) => n.getUnit(s, O.UNIVER_SHEET)),
|
|
1329
1329
|
dn((s) => !!s),
|
|
@@ -1341,10 +1341,10 @@ const es = /* @__PURE__ */ new Set([
|
|
|
1341
1341
|
ue((s) => {
|
|
1342
1342
|
if (s === Me.DISABLED_BY_CELL)
|
|
1343
1343
|
return Ne(!0);
|
|
1344
|
-
const c = (r ? r.visible$ : Ne(null)).pipe(le((p) => p != null && p.visible ?
|
|
1344
|
+
const c = (r ? r.visible$ : Ne(null)).pipe(le((p) => p != null && p.visible ? Ie : void 0)), l = t.get(bn).subscribeContextValue$(ur);
|
|
1345
1345
|
return pi([c, l]).pipe(
|
|
1346
1346
|
ue(
|
|
1347
|
-
([p, u]) => p ? u ? Ne(!0) :
|
|
1347
|
+
([p, u]) => p ? u ? Ne(!0) : Bt(t, p) : Ne(s === Me.ALLOW_ON_EDITING)
|
|
1348
1348
|
)
|
|
1349
1349
|
);
|
|
1350
1350
|
})
|
|
@@ -1354,7 +1354,7 @@ const es = /* @__PURE__ */ new Set([
|
|
|
1354
1354
|
ue((s) => o.pipe(le((c) => s || c)))
|
|
1355
1355
|
);
|
|
1356
1356
|
}, Xe = {
|
|
1357
|
-
commandId:
|
|
1357
|
+
commandId: At.id,
|
|
1358
1358
|
type: Hn.BUTTON,
|
|
1359
1359
|
title: "hyperLink.menu.add",
|
|
1360
1360
|
icon: "LinkSingle"
|
|
@@ -1368,7 +1368,7 @@ const es = /* @__PURE__ */ new Set([
|
|
|
1368
1368
|
...Xe,
|
|
1369
1369
|
id: Qe(Xe.commandId),
|
|
1370
1370
|
hidden$: ht(t, O.UNIVER_DOC, x),
|
|
1371
|
-
disabled$:
|
|
1371
|
+
disabled$: Bt(t)
|
|
1372
1372
|
}), et = {
|
|
1373
1373
|
tooltip: "hyperLink.form.addTitle",
|
|
1374
1374
|
commandId: de.id,
|
|
@@ -1383,7 +1383,7 @@ const es = /* @__PURE__ */ new Set([
|
|
|
1383
1383
|
...et,
|
|
1384
1384
|
id: Qe(et.commandId),
|
|
1385
1385
|
hidden$: ht(t, O.UNIVER_DOC, x),
|
|
1386
|
-
disabled$:
|
|
1386
|
+
disabled$: Bt(t)
|
|
1387
1387
|
}), Kn = {
|
|
1388
1388
|
id: de.id,
|
|
1389
1389
|
binding: Pt.K | Qr.CTRL_COMMAND,
|
|
@@ -1393,7 +1393,7 @@ var as = Object.defineProperty, cs = Object.getOwnPropertyDescriptor, ls = (t, e
|
|
|
1393
1393
|
for (var r = i > 1 ? void 0 : i ? cs(e, n) : e, o = t.length - 1, s; o >= 0; o--)
|
|
1394
1394
|
(s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
|
|
1395
1395
|
return i && r && as(e, n, r), r;
|
|
1396
|
-
},
|
|
1396
|
+
}, In = (t, e) => (n, i) => e(n, i, t);
|
|
1397
1397
|
let tt = class extends Y {
|
|
1398
1398
|
constructor(t, e) {
|
|
1399
1399
|
super(), this._autoFillService = t, this._hyperLinkModel = e, this._initAutoFill();
|
|
@@ -1404,8 +1404,8 @@ let tt = class extends Y {
|
|
|
1404
1404
|
const { source: o, target: s, unitId: c, subUnitId: l } = i, p = Lt([o, s]), [u, g] = p.ranges, { mapFunc: d } = p, v = {
|
|
1405
1405
|
row: u.startRow,
|
|
1406
1406
|
col: u.startColumn
|
|
1407
|
-
},
|
|
1408
|
-
return
|
|
1407
|
+
}, C = Ur(u, g), _ = [], b = [];
|
|
1408
|
+
return C.forEach((a) => {
|
|
1409
1409
|
const w = a.repeatStartCell, M = a.relativeRange, L = {
|
|
1410
1410
|
startRow: v.row,
|
|
1411
1411
|
startColumn: v.col,
|
|
@@ -1434,7 +1434,7 @@ let tt = class extends Y {
|
|
|
1434
1434
|
endRow: X
|
|
1435
1435
|
},
|
|
1436
1436
|
k
|
|
1437
|
-
), { row: Le, col: Pe } = d(Re.startRow, Re.startColumn), oe =
|
|
1437
|
+
), { row: Le, col: Pe } = d(Re.startRow, Re.startColumn), oe = Ce.generateRandomId(), j = this._hyperLinkModel.getHyperLinkByLocation(c, l, Le, Pe);
|
|
1438
1438
|
j && _.push({
|
|
1439
1439
|
id: Ue.id,
|
|
1440
1440
|
params: {
|
|
@@ -1482,8 +1482,8 @@ let tt = class extends Y {
|
|
|
1482
1482
|
}
|
|
1483
1483
|
};
|
|
1484
1484
|
tt = ls([
|
|
1485
|
-
|
|
1486
|
-
|
|
1485
|
+
In(0, Mr),
|
|
1486
|
+
In(1, R(dt))
|
|
1487
1487
|
], tt);
|
|
1488
1488
|
var us = Object.defineProperty, ds = Object.getOwnPropertyDescriptor, ps = (t, e, n, i) => {
|
|
1489
1489
|
for (var r = i > 1 ? void 0 : i ? ds(e, n) : e, o = t.length - 1, s; o >= 0; o--)
|
|
@@ -1492,16 +1492,16 @@ var us = Object.defineProperty, ds = Object.getOwnPropertyDescriptor, ps = (t, e
|
|
|
1492
1492
|
}, Rt = (t, e) => (n, i) => e(n, i, t);
|
|
1493
1493
|
let nt = class extends Y {
|
|
1494
1494
|
constructor(t, e, n) {
|
|
1495
|
-
super(), this._localeService = t, this._commandService = e, this.
|
|
1495
|
+
super(), this._localeService = t, this._commandService = e, this._sheetPermissionCheckController = n, this._commandExecutedListener();
|
|
1496
1496
|
}
|
|
1497
1497
|
_commandExecutedListener() {
|
|
1498
1498
|
this.disposeWithMe(
|
|
1499
1499
|
this._commandService.beforeCommandExecuted((t) => {
|
|
1500
|
-
t.id === Kn.id && (this.
|
|
1500
|
+
t.id === Kn.id && (this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1501
1501
|
workbookTypes: [xt],
|
|
1502
1502
|
rangeTypes: [Ut],
|
|
1503
|
-
worksheetTypes: [Nt,
|
|
1504
|
-
}) || this.
|
|
1503
|
+
worksheetTypes: [Nt, Nn, Mt]
|
|
1504
|
+
}) || this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.hyperLinkErr")));
|
|
1505
1505
|
})
|
|
1506
1506
|
);
|
|
1507
1507
|
}
|
|
@@ -1509,7 +1509,7 @@ let nt = class extends Y {
|
|
|
1509
1509
|
nt = ps([
|
|
1510
1510
|
Rt(0, R(ct)),
|
|
1511
1511
|
Rt(1, ie),
|
|
1512
|
-
Rt(2, R(
|
|
1512
|
+
Rt(2, R(Mn))
|
|
1513
1513
|
], nt);
|
|
1514
1514
|
var hs = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, ms = (t, e, n, i) => {
|
|
1515
1515
|
for (var r = i > 1 ? void 0 : i ? gs(e, n) : e, o = t.length - 1, s; o >= 0; o--)
|
|
@@ -1518,7 +1518,7 @@ var hs = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, ms = (t, e
|
|
|
1518
1518
|
}, Z = (t, e) => (n, i) => e(n, i, t);
|
|
1519
1519
|
let rt = class extends Y {
|
|
1520
1520
|
constructor(t, e, n, i, r, o, s, c, l, p) {
|
|
1521
|
-
super(), this._hoverManagerService = t, this._sheetsHyperLinkPopupService = e, this._renderManagerService = n, this._permissionService = i, this.
|
|
1521
|
+
super(), this._hoverManagerService = t, this._sheetsHyperLinkPopupService = e, this._renderManagerService = n, this._permissionService = i, this._sheetPermissionCheckController = r, this._commandService = o, this._editorBridgeService = s, this._textSelectionManagerService = c, this._univerInstanceService = l, this._zenZoneService = p, this._initHoverListener(), this._initCommandListener(), this._initHoverEditingListener(), this._initTextSelectionListener(), this._initZenEditor();
|
|
1522
1522
|
}
|
|
1523
1523
|
_getLinkPermission(t) {
|
|
1524
1524
|
const { unitId: e, subUnitId: n, row: i, col: r } = t, o = this._univerInstanceService.getUnit(e, O.UNIVER_SHEET);
|
|
@@ -1528,11 +1528,11 @@ let rt = class extends Y {
|
|
|
1528
1528
|
editPermission: !1,
|
|
1529
1529
|
copyPermission: !1
|
|
1530
1530
|
};
|
|
1531
|
-
const c = this.
|
|
1532
|
-
workbookTypes: [
|
|
1531
|
+
const c = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1532
|
+
workbookTypes: [Br],
|
|
1533
1533
|
worksheetTypes: [Vr],
|
|
1534
1534
|
rangeTypes: [Fr]
|
|
1535
|
-
}, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]), l = this.
|
|
1535
|
+
}, [{ startRow: i, startColumn: r, endRow: i, endColumn: r }]), l = this._sheetPermissionCheckController.permissionCheckWithRanges({
|
|
1536
1536
|
workbookTypes: [xt],
|
|
1537
1537
|
worksheetTypes: [Nt, Mt],
|
|
1538
1538
|
rangeTypes: [Ut]
|
|
@@ -1567,8 +1567,8 @@ let rt = class extends Y {
|
|
|
1567
1567
|
p && p.overflowCache.forValue((X, D, z) => {
|
|
1568
1568
|
ye.contains(z, { startColumn: u, endColumn: u, startRow: g, endRow: g }) && (d = X, v = D);
|
|
1569
1569
|
});
|
|
1570
|
-
const { viewPermission:
|
|
1571
|
-
if (!
|
|
1570
|
+
const { viewPermission: C, editPermission: _, copyPermission: b } = this._getLinkPermission(t);
|
|
1571
|
+
if (!C) {
|
|
1572
1572
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1573
1573
|
return;
|
|
1574
1574
|
}
|
|
@@ -1596,7 +1596,7 @@ let rt = class extends Y {
|
|
|
1596
1596
|
let t = null;
|
|
1597
1597
|
this.disposeWithMe(
|
|
1598
1598
|
this._editorBridgeService.currentEditCellState$.pipe(ue((e) => this._editorBridgeService.visible$.pipe(le((n) => ({ visible: n, state: e }))))).subscribe(({ visible: e, state: n }) => {
|
|
1599
|
-
if (!n || n.editorUnitId !==
|
|
1599
|
+
if (!n || n.editorUnitId !== Ie)
|
|
1600
1600
|
return;
|
|
1601
1601
|
if (!e.visible) {
|
|
1602
1602
|
t == null || t.unsubscribe(), this._sheetsHyperLinkPopupService.hideCurrentPopup(f.EDITING), this._sheetsHyperLinkPopupService.endEditing(f.EDITING);
|
|
@@ -1608,12 +1608,12 @@ let rt = class extends Y {
|
|
|
1608
1608
|
const { editPermission: p, viewPermission: u, copyPermission: g } = this._getLinkPermission({ unitId: r, subUnitId: o, row: s, col: c }), d = l.with(un);
|
|
1609
1609
|
u && (t == null || t.unsubscribe(), t = d.hoverCustomRanges$.pipe(We(200)).subscribe((v) => {
|
|
1610
1610
|
var w, M;
|
|
1611
|
-
const
|
|
1612
|
-
if (!
|
|
1611
|
+
const C = v.find((L) => L.range.rangeType === Ge.HYPERLINK);
|
|
1612
|
+
if (!C) {
|
|
1613
1613
|
this._sheetsHyperLinkPopupService.hideCurrentPopup();
|
|
1614
1614
|
return;
|
|
1615
1615
|
}
|
|
1616
|
-
const _ =
|
|
1616
|
+
const _ = C.rects[C.rects.length - 1];
|
|
1617
1617
|
if (!((M = (w = this._renderManagerService.getRenderById(r)) == null ? void 0 : w.with(an).getWorksheetSkeleton(o)) == null ? void 0 : M.skeleton) || !_)
|
|
1618
1618
|
return;
|
|
1619
1619
|
const a = l.engine.getCanvasElement().getBoundingClientRect();
|
|
@@ -1622,7 +1622,7 @@ let rt = class extends Y {
|
|
|
1622
1622
|
subUnitId: o,
|
|
1623
1623
|
row: s,
|
|
1624
1624
|
col: c,
|
|
1625
|
-
customRange:
|
|
1625
|
+
customRange: C.range,
|
|
1626
1626
|
customRangeRect: {
|
|
1627
1627
|
left: _.left + a.left,
|
|
1628
1628
|
top: _.top + a.top,
|
|
@@ -1674,7 +1674,7 @@ let rt = class extends Y {
|
|
|
1674
1674
|
_initTextSelectionListener() {
|
|
1675
1675
|
this.disposeWithMe(
|
|
1676
1676
|
this._textSelectionManagerService.textSelection$.subscribe((t) => {
|
|
1677
|
-
t && t.unitId ===
|
|
1677
|
+
t && t.unitId === Ie && this._sheetsHyperLinkPopupService.endEditing(f.EDITING);
|
|
1678
1678
|
})
|
|
1679
1679
|
);
|
|
1680
1680
|
}
|
|
@@ -1690,7 +1690,7 @@ rt = ms([
|
|
|
1690
1690
|
Z(1, R(G)),
|
|
1691
1691
|
Z(2, R($e)),
|
|
1692
1692
|
Z(3, R(dr)),
|
|
1693
|
-
Z(4, R(
|
|
1693
|
+
Z(4, R(Mn)),
|
|
1694
1694
|
Z(5, ie),
|
|
1695
1695
|
Z(6, re),
|
|
1696
1696
|
Z(7, R(De)),
|
|
@@ -1772,8 +1772,8 @@ const _s = {
|
|
|
1772
1772
|
}
|
|
1773
1773
|
}
|
|
1774
1774
|
};
|
|
1775
|
-
var Ss = Object.defineProperty,
|
|
1776
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
1775
|
+
var Ss = Object.defineProperty, Cs = Object.getOwnPropertyDescriptor, Is = (t, e, n, i) => {
|
|
1776
|
+
for (var r = i > 1 ? void 0 : i ? Cs(e, n) : e, o = t.length - 1, s; o >= 0; o--)
|
|
1777
1777
|
(s = t[o]) && (r = (i ? s(e, n, r) : s(r)) || r);
|
|
1778
1778
|
return i && r && Ss(e, n, r), r;
|
|
1779
1779
|
}, Te = (t, e) => (n, i) => e(n, i, t);
|
|
@@ -1794,7 +1794,7 @@ let st = class extends Y {
|
|
|
1794
1794
|
[
|
|
1795
1795
|
jt,
|
|
1796
1796
|
Je,
|
|
1797
|
-
|
|
1797
|
+
At,
|
|
1798
1798
|
de
|
|
1799
1799
|
].forEach((t) => {
|
|
1800
1800
|
this._commandService.registerCommand(t);
|
|
@@ -1807,7 +1807,7 @@ let st = class extends Y {
|
|
|
1807
1807
|
this._shortcutService.registerShortcut(Kn);
|
|
1808
1808
|
}
|
|
1809
1809
|
};
|
|
1810
|
-
st =
|
|
1810
|
+
st = Is([
|
|
1811
1811
|
Te(0, R(ri)),
|
|
1812
1812
|
Te(1, ie),
|
|
1813
1813
|
Te(2, si),
|
|
@@ -1880,7 +1880,7 @@ at = bs([
|
|
|
1880
1880
|
], at);
|
|
1881
1881
|
export {
|
|
1882
1882
|
Je as CloseHyperLinkPopupOperation,
|
|
1883
|
-
|
|
1883
|
+
At as InsertHyperLinkOperation,
|
|
1884
1884
|
Kn as InsertLinkShortcut,
|
|
1885
1885
|
jt as OpenHyperLinkEditPanelOperation,
|
|
1886
1886
|
Ye as SheetsHyperLinkCopyPasteController,
|