@univerjs/sheets-hyper-link-ui 1.0.0-alpha.8 → 1.0.0-beta.1
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 +32 -36
- package/lib/cjs/locale/ar-SA.js +0 -1
- package/lib/cjs/locale/ca-ES.js +0 -1
- package/lib/cjs/locale/de-DE.js +0 -1
- package/lib/cjs/locale/en-US.js +0 -1
- package/lib/cjs/locale/es-ES.js +0 -1
- package/lib/cjs/locale/fa-IR.js +0 -1
- package/lib/cjs/locale/fr-FR.js +0 -1
- package/lib/cjs/locale/id-ID.js +0 -1
- package/lib/cjs/locale/it-IT.js +0 -1
- package/lib/cjs/locale/ja-JP.js +0 -1
- package/lib/cjs/locale/ko-KR.js +0 -1
- package/lib/cjs/locale/pl-PL.js +0 -1
- package/lib/cjs/locale/pt-BR.js +0 -1
- package/lib/cjs/locale/ru-RU.js +0 -1
- package/lib/cjs/locale/sk-SK.js +0 -1
- package/lib/cjs/locale/vi-VN.js +0 -1
- package/lib/cjs/locale/zh-CN.js +0 -1
- package/lib/cjs/locale/zh-HK.js +1 -2
- package/lib/cjs/locale/zh-TW.js +1 -2
- package/lib/es/index.js +33 -37
- package/lib/es/locale/ar-SA.js +0 -1
- package/lib/es/locale/ca-ES.js +0 -1
- package/lib/es/locale/de-DE.js +0 -1
- package/lib/es/locale/en-US.js +0 -1
- package/lib/es/locale/es-ES.js +0 -1
- package/lib/es/locale/fa-IR.js +0 -1
- package/lib/es/locale/fr-FR.js +0 -1
- package/lib/es/locale/id-ID.js +0 -1
- package/lib/es/locale/it-IT.js +0 -1
- package/lib/es/locale/ja-JP.js +0 -1
- package/lib/es/locale/ko-KR.js +0 -1
- package/lib/es/locale/pl-PL.js +0 -1
- package/lib/es/locale/pt-BR.js +0 -1
- package/lib/es/locale/ru-RU.js +0 -1
- package/lib/es/locale/sk-SK.js +0 -1
- package/lib/es/locale/vi-VN.js +0 -1
- package/lib/es/locale/zh-CN.js +0 -1
- package/lib/es/locale/zh-HK.js +1 -2
- package/lib/es/locale/zh-TW.js +1 -2
- package/lib/index.css +4 -4
- package/lib/index.js +33 -37
- package/lib/locale/ar-SA.js +0 -1
- package/lib/locale/ca-ES.js +0 -1
- package/lib/locale/de-DE.js +0 -1
- package/lib/locale/en-US.js +0 -1
- package/lib/locale/es-ES.js +0 -1
- package/lib/locale/fa-IR.js +0 -1
- package/lib/locale/fr-FR.js +0 -1
- package/lib/locale/id-ID.js +0 -1
- package/lib/locale/it-IT.js +0 -1
- package/lib/locale/ja-JP.js +0 -1
- package/lib/locale/ko-KR.js +0 -1
- package/lib/locale/pl-PL.js +0 -1
- package/lib/locale/pt-BR.js +0 -1
- package/lib/locale/ru-RU.js +0 -1
- package/lib/locale/sk-SK.js +0 -1
- package/lib/locale/vi-VN.js +0 -1
- package/lib/locale/zh-CN.js +0 -1
- package/lib/locale/zh-HK.js +1 -2
- package/lib/locale/zh-TW.js +1 -2
- package/lib/types/locale/en-US.d.ts +0 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +16 -16
package/lib/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { Button, FormLayout, Input, MessageType, Select, Tooltip, borderClassNam
|
|
|
9
9
|
import { IDefinedNamesService, UniverFormulaEnginePlugin, deserializeRangeWithSheet, serializeRange, serializeRangeToRefString, serializeRangeWithSheet } from "@univerjs/engine-formula";
|
|
10
10
|
import { RangeSelector } from "@univerjs/sheets-formula-ui";
|
|
11
11
|
import { AddHyperLinkCommand, AddHyperLinkMutation, AddRichHyperLinkCommand, CancelHyperLinkCommand, CancelRichHyperLinkCommand, ERROR_RANGE, HyperLinkModel, RemoveHyperLinkMutation, SheetHyperLinkType, SheetsHyperLinkParserService, UniverSheetsHyperLinkPlugin, UpdateHyperLinkCommand, UpdateRichHyperLinkCommand } from "@univerjs/sheets-hyper-link";
|
|
12
|
-
import { ComponentManager, ContextMenuGroup, ContextMenuPosition, IMenuManagerService, IMessageService, IShortcutService, IconManager, KeyCode, MenuItemType, MetaKeys, RibbonInsertGroup,
|
|
12
|
+
import { ComponentManager, ContextMenuGroup, ContextMenuPosition, IMenuManagerService, IMessageService, IShortcutService, IconManager, KeyCode, MenuItemType, MetaKeys, RibbonInsertGroup, getMenuHiddenObservable, useDependency, useEvent, useObservable } from "@univerjs/ui";
|
|
13
13
|
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
14
14
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
import { AllBorderIcon, CopyIcon, LinkIcon, SheetsMultiIcon, UnlinkIcon, WriteIcon } from "@univerjs/icons";
|
|
@@ -314,7 +314,6 @@ function resolveRangePayload(rangeText, defaultSheetName) {
|
|
|
314
314
|
//#endregion
|
|
315
315
|
//#region src/views/CellLinkEdit.tsx
|
|
316
316
|
const CellLinkEdit = () => {
|
|
317
|
-
var _definedNameService$g;
|
|
318
317
|
const [id, setId] = useState("");
|
|
319
318
|
const [hide, setHide] = useState(false);
|
|
320
319
|
const [display, _setDisplay] = useState("");
|
|
@@ -362,16 +361,16 @@ const CellLinkEdit = () => {
|
|
|
362
361
|
if (typeof label === "number") label = `${label}`;
|
|
363
362
|
let link;
|
|
364
363
|
if (customRange) {
|
|
365
|
-
var _customRange$
|
|
364
|
+
var _customRange$properti;
|
|
366
365
|
link = {
|
|
367
|
-
id: (
|
|
368
|
-
display:
|
|
369
|
-
payload: (
|
|
366
|
+
id: (customRange === null || customRange === void 0 ? void 0 : customRange.rangeId) ?? "",
|
|
367
|
+
display: label ?? "",
|
|
368
|
+
payload: (customRange === null || customRange === void 0 || (_customRange$properti = customRange.properties) === null || _customRange$properti === void 0 ? void 0 : _customRange$properti.url) ?? "",
|
|
370
369
|
row,
|
|
371
370
|
column: col
|
|
372
371
|
};
|
|
373
372
|
} else if (editing.type === "viewing") {
|
|
374
|
-
var _cell$p, _cell$p2, _range$
|
|
373
|
+
var _cell$p, _cell$p2, _range$properties2;
|
|
375
374
|
const workbook = univerInstanceService.getUnit(editing.unitId);
|
|
376
375
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(editing.subUnitId);
|
|
377
376
|
const cell = worksheet === null || worksheet === void 0 ? void 0 : worksheet.getCellRaw(editing.row, editing.col);
|
|
@@ -384,22 +383,22 @@ const CellLinkEdit = () => {
|
|
|
384
383
|
link = {
|
|
385
384
|
id: "",
|
|
386
385
|
display: "",
|
|
387
|
-
payload: (
|
|
386
|
+
payload: (range === null || range === void 0 || (_range$properties2 = range.properties) === null || _range$properties2 === void 0 ? void 0 : _range$properties2.url) ?? "",
|
|
388
387
|
row,
|
|
389
388
|
column: col
|
|
390
389
|
};
|
|
391
390
|
} else {
|
|
392
|
-
var _BuildTextUtils$custo,
|
|
391
|
+
var _BuildTextUtils$custo, _customRange$properti2;
|
|
393
392
|
const doc = univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_DOC);
|
|
394
393
|
const currentSelection = textSelectionService.getActiveTextRange();
|
|
395
394
|
const body = doc === null || doc === void 0 ? void 0 : doc.getBody();
|
|
396
395
|
const selection = currentSelection && body ? currentSelection : null;
|
|
397
|
-
const customRange = selection && ((_BuildTextUtils$custo = BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(selection, (
|
|
396
|
+
const customRange = selection && ((_BuildTextUtils$custo = BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(selection, (body === null || body === void 0 ? void 0 : body.customRanges) ?? [])) === null || _BuildTextUtils$custo === void 0 ? void 0 : _BuildTextUtils$custo[0]);
|
|
398
397
|
setShowLabel(false);
|
|
399
398
|
link = {
|
|
400
399
|
id: "",
|
|
401
|
-
display:
|
|
402
|
-
payload: (
|
|
400
|
+
display: label ?? "",
|
|
401
|
+
payload: (customRange === null || customRange === void 0 || (_customRange$properti2 = customRange.properties) === null || _customRange$properti2 === void 0 ? void 0 : _customRange$properti2.url) ?? "",
|
|
403
402
|
row,
|
|
404
403
|
column: col
|
|
405
404
|
};
|
|
@@ -422,9 +421,9 @@ const CellLinkEdit = () => {
|
|
|
422
421
|
if (linkInfo.url === link.display) setDisplaySyncedWithPayload(true);
|
|
423
422
|
break;
|
|
424
423
|
case SheetHyperLinkType.RANGE: {
|
|
425
|
-
var _univerInstanceServic
|
|
424
|
+
var _univerInstanceServic;
|
|
426
425
|
const params = linkInfo.searchObj;
|
|
427
|
-
const payload = serializeRangeWithSheet(params.gid ? (_univerInstanceServic =
|
|
426
|
+
const payload = serializeRangeWithSheet(params.gid ? ((_univerInstanceServic = univerInstanceService.getUnit(editing.unitId)) === null || _univerInstanceServic === void 0 || (_univerInstanceServic = _univerInstanceServic.getSheetBySheetId(params.gid)) === null || _univerInstanceServic === void 0 ? void 0 : _univerInstanceServic.getName()) ?? "" : "", deserializeRangeWithSheet(params.range).range);
|
|
428
427
|
setPayload(payload);
|
|
429
428
|
if (payload === link.display) setDisplaySyncedWithPayload(true);
|
|
430
429
|
break;
|
|
@@ -459,7 +458,7 @@ const CellLinkEdit = () => {
|
|
|
459
458
|
const mergeInfo = worksheet === null || worksheet === void 0 ? void 0 : worksheet.getMergedCell(editing.row, editing.col);
|
|
460
459
|
const color = new ColorKit(themeService.getColorFromTheme("primary.600")).toRgb();
|
|
461
460
|
id = markSelectionService.addShape({
|
|
462
|
-
range: mergeInfo
|
|
461
|
+
range: mergeInfo ?? {
|
|
463
462
|
startColumn: editing.col,
|
|
464
463
|
endColumn: editing.col,
|
|
465
464
|
startRow: editing.row,
|
|
@@ -558,7 +557,7 @@ const CellLinkEdit = () => {
|
|
|
558
557
|
label: sheet.getName(),
|
|
559
558
|
value: sheet.getSheetId()
|
|
560
559
|
})).filter((opt) => hiddens.indexOf(opt.value) === -1);
|
|
561
|
-
const definedNames = Object.values(
|
|
560
|
+
const definedNames = Object.values(definedNameService.getDefinedNameMap(workbook.getUnitId()) ?? {}).map((value) => ({
|
|
562
561
|
label: value.name,
|
|
563
562
|
value: value.id
|
|
564
563
|
}));
|
|
@@ -622,7 +621,7 @@ const CellLinkEdit = () => {
|
|
|
622
621
|
};
|
|
623
622
|
if (!editing) return null;
|
|
624
623
|
return /* @__PURE__ */ jsxs("div", {
|
|
625
|
-
className: clsx("univer-box-border univer-w-[296px] univer-rounded-xl univer-bg-
|
|
624
|
+
className: clsx("univer-box-border univer-w-[296px] univer-rounded-xl univer-bg-gray-0 univer-p-4 univer-shadow-md dark:!univer-bg-gray-900", borderClassName),
|
|
626
625
|
children: [
|
|
627
626
|
showLabel ? /* @__PURE__ */ jsx(FormLayout, {
|
|
628
627
|
label: localeService.t("sheets-hyper-link-ui.form.label"),
|
|
@@ -784,7 +783,7 @@ const iconsMap = {
|
|
|
784
783
|
[SheetHyperLinkType.INVALID]: /* @__PURE__ */ jsx(AllBorderIcon, {})
|
|
785
784
|
};
|
|
786
785
|
const CellLinkPopupPure = (props) => {
|
|
787
|
-
var _customRange$properti
|
|
786
|
+
var _customRange$properti;
|
|
788
787
|
const popupService = useDependency(SheetsHyperLinkPopupService);
|
|
789
788
|
const commandService = useDependency(ICommandService);
|
|
790
789
|
const messageService = useDependency(IMessageService);
|
|
@@ -794,10 +793,10 @@ const CellLinkPopupPure = (props) => {
|
|
|
794
793
|
const parserHyperLinkService = useDependency(SheetsHyperLinkParserService);
|
|
795
794
|
const { customRange, row, col, unitId, subUnitId, editPermission, copyPermission, type } = props;
|
|
796
795
|
if (!(customRange === null || customRange === void 0 || (_customRange$properti = customRange.properties) === null || _customRange$properti === void 0 ? void 0 : _customRange$properti.url)) return null;
|
|
797
|
-
const linkObj = parserHyperLinkService.parseHyperLink(
|
|
796
|
+
const linkObj = parserHyperLinkService.parseHyperLink(customRange.properties.url ?? "");
|
|
798
797
|
const isError = linkObj.type === SheetHyperLinkType.INVALID;
|
|
799
798
|
return /* @__PURE__ */ jsxs("div", {
|
|
800
|
-
className: clsx("univer-mb-1 univer-flex univer-max-w-80 univer-flex-row univer-items-center univer-justify-between univer-gap-2 univer-overflow-hidden univer-rounded-lg univer-bg-
|
|
799
|
+
className: clsx("univer-mb-1 univer-flex univer-max-w-80 univer-flex-row univer-items-center univer-justify-between univer-gap-2 univer-overflow-hidden univer-rounded-lg univer-bg-gray-0 univer-p-2 univer-shadow-md dark:!univer-bg-gray-900", borderClassName),
|
|
801
800
|
onClick: () => popupService.hideCurrentPopup(),
|
|
802
801
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
803
802
|
className: clsx("univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-flex-row univer-items-center univer-gap-1 univer-truncate univer-text-sm univer-leading-5 univer-text-primary-600", { "univer-text-red-500": isError }),
|
|
@@ -806,7 +805,7 @@ const CellLinkPopupPure = (props) => {
|
|
|
806
805
|
resolverService.navigate(linkObj);
|
|
807
806
|
},
|
|
808
807
|
children: [/* @__PURE__ */ jsx("div", {
|
|
809
|
-
className: "univer-flex univer-size-5 univer-flex-none univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-
|
|
808
|
+
className: "univer-flex univer-size-5 univer-flex-none univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-gray-0",
|
|
810
809
|
children: iconsMap[linkObj.type]
|
|
811
810
|
}), /* @__PURE__ */ jsx(Tooltip, {
|
|
812
811
|
showIfEllipsis: true,
|
|
@@ -836,7 +835,7 @@ const CellLinkPopupPure = (props) => {
|
|
|
836
835
|
children: /* @__PURE__ */ jsx(Tooltip, {
|
|
837
836
|
placement: "bottom",
|
|
838
837
|
title: localeService.t("sheets-hyper-link-ui.popup.copy"),
|
|
839
|
-
children: /* @__PURE__ */ jsx(CopyIcon, { className: "dark:!univer-text-
|
|
838
|
+
children: /* @__PURE__ */ jsx(CopyIcon, { className: "dark:!univer-text-gray-0" })
|
|
840
839
|
})
|
|
841
840
|
}), editPermission && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
842
841
|
"data-u-comp": "cell-link-popup-edit",
|
|
@@ -854,7 +853,7 @@ const CellLinkPopupPure = (props) => {
|
|
|
854
853
|
children: /* @__PURE__ */ jsx(Tooltip, {
|
|
855
854
|
placement: "bottom",
|
|
856
855
|
title: localeService.t("sheets-hyper-link-ui.popup.edit"),
|
|
857
|
-
children: /* @__PURE__ */ jsx(WriteIcon, { className: "dark:!univer-text-
|
|
856
|
+
children: /* @__PURE__ */ jsx(WriteIcon, { className: "dark:!univer-text-gray-0" })
|
|
858
857
|
})
|
|
859
858
|
}), /* @__PURE__ */ jsx("div", {
|
|
860
859
|
"data-u-comp": "cell-link-popup-remove",
|
|
@@ -873,7 +872,7 @@ const CellLinkPopupPure = (props) => {
|
|
|
873
872
|
children: /* @__PURE__ */ jsx(Tooltip, {
|
|
874
873
|
placement: "bottom",
|
|
875
874
|
title: localeService.t("sheets-hyper-link-ui.popup.cancel"),
|
|
876
|
-
children: /* @__PURE__ */ jsx(UnlinkIcon, { className: "dark:!univer-text-
|
|
875
|
+
children: /* @__PURE__ */ jsx(UnlinkIcon, { className: "dark:!univer-text-gray-0" })
|
|
877
876
|
})
|
|
878
877
|
})] })]
|
|
879
878
|
})]
|
|
@@ -1006,7 +1005,7 @@ let SheetsHyperLinkPopupService = class SheetsHyperLinkPopupService extends Disp
|
|
|
1006
1005
|
const visible = this._editorBridgeService.isVisible().visible;
|
|
1007
1006
|
const state = this._editorBridgeService.getEditCellState();
|
|
1008
1007
|
if (visible && state) {
|
|
1009
|
-
var _state$documentLayout, _body$customRanges
|
|
1008
|
+
var _state$documentLayout, _body$customRanges;
|
|
1010
1009
|
const textRange = this._textSelectionManagerService.getActiveTextRange();
|
|
1011
1010
|
const body = (_state$documentLayout = state.documentLayoutObject.documentModel) === null || _state$documentLayout === void 0 ? void 0 : _state$documentLayout.getBody();
|
|
1012
1011
|
if (!body) return null;
|
|
@@ -1016,7 +1015,7 @@ let SheetsHyperLinkPopupService = class SheetsHyperLinkPopupService extends Disp
|
|
|
1016
1015
|
collapsed: body.dataStream.length - 2 === 0,
|
|
1017
1016
|
label: BuildTextUtils.transform.getPlainText(body.dataStream)
|
|
1018
1017
|
};
|
|
1019
|
-
const links = BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(textRange, (
|
|
1018
|
+
const links = BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(textRange, ((_body$customRanges = body.customRanges) === null || _body$customRanges === void 0 ? void 0 : _body$customRanges.filter((i) => i.rangeType === CustomRangeType.HYPERLINK)) ?? []);
|
|
1020
1019
|
let start = textRange.startOffset;
|
|
1021
1020
|
let end = textRange.endOffset;
|
|
1022
1021
|
links.forEach((link) => {
|
|
@@ -1048,7 +1047,6 @@ let SheetsHyperLinkPopupService = class SheetsHyperLinkPopupService extends Disp
|
|
|
1048
1047
|
startAddEditing(link) {
|
|
1049
1048
|
const { unitId, subUnitId, type } = link;
|
|
1050
1049
|
if (type === "editing") {
|
|
1051
|
-
var _range$label;
|
|
1052
1050
|
const range = this._getEditingRange();
|
|
1053
1051
|
if (!range) return;
|
|
1054
1052
|
this._textSelectionManagerService.replaceDocRanges([{ ...range }], {
|
|
@@ -1062,17 +1060,17 @@ let SheetsHyperLinkPopupService = class SheetsHyperLinkPopupService extends Disp
|
|
|
1062
1060
|
this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(rects.pop(), this._editPopup, unitId, subUnitId);
|
|
1063
1061
|
this._currentEditing$.next({
|
|
1064
1062
|
...link,
|
|
1065
|
-
label: (
|
|
1063
|
+
label: (range === null || range === void 0 ? void 0 : range.label) ?? ""
|
|
1066
1064
|
});
|
|
1067
1065
|
} else {
|
|
1068
|
-
var _cell$p$body
|
|
1066
|
+
var _cell$p$body;
|
|
1069
1067
|
this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(link.row, link.col, this._editPopup, unitId, subUnitId);
|
|
1070
1068
|
const workbook = this._univerInstanceService.getUnit(unitId, UniverInstanceType.UNIVER_SHEET);
|
|
1071
1069
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
1072
1070
|
const cell = worksheet === null || worksheet === void 0 ? void 0 : worksheet.getCellRaw(link.row, link.col);
|
|
1073
1071
|
this._currentEditing$.next({
|
|
1074
1072
|
...link,
|
|
1075
|
-
label: (cell === null || cell === void 0 ? void 0 : cell.p) ? BuildTextUtils.transform.getPlainText((
|
|
1073
|
+
label: (cell === null || cell === void 0 ? void 0 : cell.p) ? BuildTextUtils.transform.getPlainText(((_cell$p$body = cell.p.body) === null || _cell$p$body === void 0 ? void 0 : _cell$p$body.dataStream) ?? "") : ((cell === null || cell === void 0 ? void 0 : cell.v) ?? "").toString()
|
|
1076
1074
|
});
|
|
1077
1075
|
}
|
|
1078
1076
|
}
|
|
@@ -1345,9 +1343,8 @@ let SheetsHyperLinkCopyPasteController = class SheetsHyperLinkCopyPasteControlle
|
|
|
1345
1343
|
const { rows, cols } = discreteRange;
|
|
1346
1344
|
rows.forEach((row, rowIndex) => {
|
|
1347
1345
|
cols.forEach((col, colIndex) => {
|
|
1348
|
-
var _link$id;
|
|
1349
1346
|
const link = this._hyperLinkModel.getHyperLinkByLocation(unitId, subUnitId, row, col);
|
|
1350
|
-
matrix.setValue(rowIndex, colIndex, (
|
|
1347
|
+
matrix.setValue(rowIndex, colIndex, (link === null || link === void 0 ? void 0 : link.id) ?? "");
|
|
1351
1348
|
});
|
|
1352
1349
|
});
|
|
1353
1350
|
}
|
|
@@ -1460,10 +1457,9 @@ const getEditingLinkDisable$ = (accessor, unitId = DOCS_NORMAL_EDITOR_UNIT_ID_KE
|
|
|
1460
1457
|
}));
|
|
1461
1458
|
};
|
|
1462
1459
|
const getLinkDisable$ = (accessor) => {
|
|
1463
|
-
var _editorBridgeService$;
|
|
1464
1460
|
const univerInstanceService = accessor.get(IUniverInstanceService);
|
|
1465
1461
|
const editorBridgeService = accessor.has(IEditorBridgeService) ? accessor.get(IEditorBridgeService) : null;
|
|
1466
|
-
return ((
|
|
1462
|
+
return ((editorBridgeService === null || editorBridgeService === void 0 ? void 0 : editorBridgeService.currentEditCellState$.pipe(map((state) => {
|
|
1467
1463
|
if (!state) return 1;
|
|
1468
1464
|
const target = getSheetCommandTarget(univerInstanceService, {
|
|
1469
1465
|
unitId: state.unitId,
|
|
@@ -1476,7 +1472,7 @@ const getLinkDisable$ = (accessor) => {
|
|
|
1476
1472
|
return combineLatest([editorBridgeService ? editorBridgeService.visible$ : of(null), univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_DOC)]).pipe(switchMap(([editing, focusingDoc]) => {
|
|
1477
1473
|
return (editing === null || editing === void 0 ? void 0 : editing.visible) ? (focusingDoc === null || focusingDoc === void 0 ? void 0 : focusingDoc.getUnitId()) === DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY ? of(true) : getEditingLinkDisable$(accessor, DOCS_NORMAL_EDITOR_UNIT_ID_KEY) : of(disableCell !== 0);
|
|
1478
1474
|
}));
|
|
1479
|
-
})))
|
|
1475
|
+
}))) ?? of(true)).pipe(switchMap((disableCell) => {
|
|
1480
1476
|
if (disableCell) return of(true);
|
|
1481
1477
|
else return getCurrentRangeDisable$(accessor, {
|
|
1482
1478
|
workbookTypes: [WorkbookEditablePermission],
|
|
@@ -1542,7 +1538,7 @@ const menuSchema = {
|
|
|
1542
1538
|
//#endregion
|
|
1543
1539
|
//#region package.json
|
|
1544
1540
|
var name = "@univerjs/sheets-hyper-link-ui";
|
|
1545
|
-
var version = "1.0.0-
|
|
1541
|
+
var version = "1.0.0-beta.1";
|
|
1546
1542
|
|
|
1547
1543
|
//#endregion
|
|
1548
1544
|
//#region src/controllers/auto-fill.controller.ts
|
|
@@ -2080,7 +2076,7 @@ _defineProperty(UniverSheetsHyperLinkUIPlugin, "packageName", name);
|
|
|
2080
2076
|
_defineProperty(UniverSheetsHyperLinkUIPlugin, "version", version);
|
|
2081
2077
|
_defineProperty(UniverSheetsHyperLinkUIPlugin, "type", UniverInstanceType.UNIVER_SHEET);
|
|
2082
2078
|
UniverSheetsHyperLinkUIPlugin = __decorate([
|
|
2083
|
-
DependentOn(UniverDocsPlugin, UniverFormulaEnginePlugin, UniverRenderEnginePlugin, UniverSheetsPlugin,
|
|
2079
|
+
DependentOn(UniverDocsPlugin, UniverFormulaEnginePlugin, UniverRenderEnginePlugin, UniverSheetsPlugin, UniverDocsUIPlugin, UniverSheetsHyperLinkPlugin, UniverSheetsUIPlugin),
|
|
2084
2080
|
__decorateParam(1, Inject(Injector)),
|
|
2085
2081
|
__decorateParam(2, IConfigService)
|
|
2086
2082
|
], UniverSheetsHyperLinkUIPlugin);
|
package/lib/locale/ar-SA.js
CHANGED
package/lib/locale/ca-ES.js
CHANGED
package/lib/locale/de-DE.js
CHANGED
package/lib/locale/en-US.js
CHANGED
package/lib/locale/es-ES.js
CHANGED
package/lib/locale/fa-IR.js
CHANGED
package/lib/locale/fr-FR.js
CHANGED
package/lib/locale/id-ID.js
CHANGED
package/lib/locale/it-IT.js
CHANGED
package/lib/locale/ja-JP.js
CHANGED
package/lib/locale/ko-KR.js
CHANGED
package/lib/locale/pl-PL.js
CHANGED
package/lib/locale/pt-BR.js
CHANGED
package/lib/locale/ru-RU.js
CHANGED
package/lib/locale/sk-SK.js
CHANGED
package/lib/locale/vi-VN.js
CHANGED
package/lib/locale/zh-CN.js
CHANGED
package/lib/locale/zh-HK.js
CHANGED
package/lib/locale/zh-TW.js
CHANGED