@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/cjs/index.js
CHANGED
|
@@ -315,7 +315,6 @@ function resolveRangePayload(rangeText, defaultSheetName) {
|
|
|
315
315
|
//#endregion
|
|
316
316
|
//#region src/views/CellLinkEdit.tsx
|
|
317
317
|
const CellLinkEdit = () => {
|
|
318
|
-
var _definedNameService$g;
|
|
319
318
|
const [id, setId] = (0, react.useState)("");
|
|
320
319
|
const [hide, setHide] = (0, react.useState)(false);
|
|
321
320
|
const [display, _setDisplay] = (0, react.useState)("");
|
|
@@ -363,16 +362,16 @@ const CellLinkEdit = () => {
|
|
|
363
362
|
if (typeof label === "number") label = `${label}`;
|
|
364
363
|
let link;
|
|
365
364
|
if (customRange) {
|
|
366
|
-
var _customRange$
|
|
365
|
+
var _customRange$properti;
|
|
367
366
|
link = {
|
|
368
|
-
id: (
|
|
369
|
-
display:
|
|
370
|
-
payload: (
|
|
367
|
+
id: (customRange === null || customRange === void 0 ? void 0 : customRange.rangeId) ?? "",
|
|
368
|
+
display: label ?? "",
|
|
369
|
+
payload: (customRange === null || customRange === void 0 || (_customRange$properti = customRange.properties) === null || _customRange$properti === void 0 ? void 0 : _customRange$properti.url) ?? "",
|
|
371
370
|
row,
|
|
372
371
|
column: col
|
|
373
372
|
};
|
|
374
373
|
} else if (editing.type === "viewing") {
|
|
375
|
-
var _cell$p, _cell$p2, _range$
|
|
374
|
+
var _cell$p, _cell$p2, _range$properties2;
|
|
376
375
|
const workbook = univerInstanceService.getUnit(editing.unitId);
|
|
377
376
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(editing.subUnitId);
|
|
378
377
|
const cell = worksheet === null || worksheet === void 0 ? void 0 : worksheet.getCellRaw(editing.row, editing.col);
|
|
@@ -385,22 +384,22 @@ const CellLinkEdit = () => {
|
|
|
385
384
|
link = {
|
|
386
385
|
id: "",
|
|
387
386
|
display: "",
|
|
388
|
-
payload: (
|
|
387
|
+
payload: (range === null || range === void 0 || (_range$properties2 = range.properties) === null || _range$properties2 === void 0 ? void 0 : _range$properties2.url) ?? "",
|
|
389
388
|
row,
|
|
390
389
|
column: col
|
|
391
390
|
};
|
|
392
391
|
} else {
|
|
393
|
-
var _BuildTextUtils$custo,
|
|
392
|
+
var _BuildTextUtils$custo, _customRange$properti2;
|
|
394
393
|
const doc = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_DOC);
|
|
395
394
|
const currentSelection = textSelectionService.getActiveTextRange();
|
|
396
395
|
const body = doc === null || doc === void 0 ? void 0 : doc.getBody();
|
|
397
396
|
const selection = currentSelection && body ? currentSelection : null;
|
|
398
|
-
const customRange = selection && ((_BuildTextUtils$custo = _univerjs_core.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(selection, (
|
|
397
|
+
const customRange = selection && ((_BuildTextUtils$custo = _univerjs_core.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(selection, (body === null || body === void 0 ? void 0 : body.customRanges) ?? [])) === null || _BuildTextUtils$custo === void 0 ? void 0 : _BuildTextUtils$custo[0]);
|
|
399
398
|
setShowLabel(false);
|
|
400
399
|
link = {
|
|
401
400
|
id: "",
|
|
402
|
-
display:
|
|
403
|
-
payload: (
|
|
401
|
+
display: label ?? "",
|
|
402
|
+
payload: (customRange === null || customRange === void 0 || (_customRange$properti2 = customRange.properties) === null || _customRange$properti2 === void 0 ? void 0 : _customRange$properti2.url) ?? "",
|
|
404
403
|
row,
|
|
405
404
|
column: col
|
|
406
405
|
};
|
|
@@ -423,9 +422,9 @@ const CellLinkEdit = () => {
|
|
|
423
422
|
if (linkInfo.url === link.display) setDisplaySyncedWithPayload(true);
|
|
424
423
|
break;
|
|
425
424
|
case _univerjs_sheets_hyper_link.SheetHyperLinkType.RANGE: {
|
|
426
|
-
var _univerInstanceServic
|
|
425
|
+
var _univerInstanceServic;
|
|
427
426
|
const params = linkInfo.searchObj;
|
|
428
|
-
const payload = (0, _univerjs_engine_formula.serializeRangeWithSheet)(params.gid ? (_univerInstanceServic =
|
|
427
|
+
const payload = (0, _univerjs_engine_formula.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()) ?? "" : "", (0, _univerjs_engine_formula.deserializeRangeWithSheet)(params.range).range);
|
|
429
428
|
setPayload(payload);
|
|
430
429
|
if (payload === link.display) setDisplaySyncedWithPayload(true);
|
|
431
430
|
break;
|
|
@@ -460,7 +459,7 @@ const CellLinkEdit = () => {
|
|
|
460
459
|
const mergeInfo = worksheet === null || worksheet === void 0 ? void 0 : worksheet.getMergedCell(editing.row, editing.col);
|
|
461
460
|
const color = new _univerjs_core.ColorKit(themeService.getColorFromTheme("primary.600")).toRgb();
|
|
462
461
|
id = markSelectionService.addShape({
|
|
463
|
-
range: mergeInfo
|
|
462
|
+
range: mergeInfo ?? {
|
|
464
463
|
startColumn: editing.col,
|
|
465
464
|
endColumn: editing.col,
|
|
466
465
|
startRow: editing.row,
|
|
@@ -559,7 +558,7 @@ const CellLinkEdit = () => {
|
|
|
559
558
|
label: sheet.getName(),
|
|
560
559
|
value: sheet.getSheetId()
|
|
561
560
|
})).filter((opt) => hiddens.indexOf(opt.value) === -1);
|
|
562
|
-
const definedNames = Object.values(
|
|
561
|
+
const definedNames = Object.values(definedNameService.getDefinedNameMap(workbook.getUnitId()) ?? {}).map((value) => ({
|
|
563
562
|
label: value.name,
|
|
564
563
|
value: value.id
|
|
565
564
|
}));
|
|
@@ -623,7 +622,7 @@ const CellLinkEdit = () => {
|
|
|
623
622
|
};
|
|
624
623
|
if (!editing) return null;
|
|
625
624
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
626
|
-
className: (0, _univerjs_design.clsx)("univer-box-border univer-w-[296px] univer-rounded-xl univer-bg-
|
|
625
|
+
className: (0, _univerjs_design.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", _univerjs_design.borderClassName),
|
|
627
626
|
children: [
|
|
628
627
|
showLabel ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.FormLayout, {
|
|
629
628
|
label: localeService.t("sheets-hyper-link-ui.form.label"),
|
|
@@ -785,7 +784,7 @@ const iconsMap = {
|
|
|
785
784
|
[_univerjs_sheets_hyper_link.SheetHyperLinkType.INVALID]: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.AllBorderIcon, {})
|
|
786
785
|
};
|
|
787
786
|
const CellLinkPopupPure = (props) => {
|
|
788
|
-
var _customRange$properti
|
|
787
|
+
var _customRange$properti;
|
|
789
788
|
const popupService = (0, _univerjs_ui.useDependency)(SheetsHyperLinkPopupService);
|
|
790
789
|
const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
|
|
791
790
|
const messageService = (0, _univerjs_ui.useDependency)(_univerjs_ui.IMessageService);
|
|
@@ -795,10 +794,10 @@ const CellLinkPopupPure = (props) => {
|
|
|
795
794
|
const parserHyperLinkService = (0, _univerjs_ui.useDependency)(_univerjs_sheets_hyper_link.SheetsHyperLinkParserService);
|
|
796
795
|
const { customRange, row, col, unitId, subUnitId, editPermission, copyPermission, type } = props;
|
|
797
796
|
if (!(customRange === null || customRange === void 0 || (_customRange$properti = customRange.properties) === null || _customRange$properti === void 0 ? void 0 : _customRange$properti.url)) return null;
|
|
798
|
-
const linkObj = parserHyperLinkService.parseHyperLink(
|
|
797
|
+
const linkObj = parserHyperLinkService.parseHyperLink(customRange.properties.url ?? "");
|
|
799
798
|
const isError = linkObj.type === _univerjs_sheets_hyper_link.SheetHyperLinkType.INVALID;
|
|
800
799
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
801
|
-
className: (0, _univerjs_design.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-
|
|
800
|
+
className: (0, _univerjs_design.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", _univerjs_design.borderClassName),
|
|
802
801
|
onClick: () => popupService.hideCurrentPopup(),
|
|
803
802
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
804
803
|
className: (0, _univerjs_design.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 }),
|
|
@@ -807,7 +806,7 @@ const CellLinkPopupPure = (props) => {
|
|
|
807
806
|
resolverService.navigate(linkObj);
|
|
808
807
|
},
|
|
809
808
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
810
|
-
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-
|
|
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-gray-0",
|
|
811
810
|
children: iconsMap[linkObj.type]
|
|
812
811
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
|
|
813
812
|
showIfEllipsis: true,
|
|
@@ -837,7 +836,7 @@ const CellLinkPopupPure = (props) => {
|
|
|
837
836
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
|
|
838
837
|
placement: "bottom",
|
|
839
838
|
title: localeService.t("sheets-hyper-link-ui.popup.copy"),
|
|
840
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.CopyIcon, { className: "dark:!univer-text-
|
|
839
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.CopyIcon, { className: "dark:!univer-text-gray-0" })
|
|
841
840
|
})
|
|
842
841
|
}), editPermission && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
843
842
|
"data-u-comp": "cell-link-popup-edit",
|
|
@@ -855,7 +854,7 @@ const CellLinkPopupPure = (props) => {
|
|
|
855
854
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
|
|
856
855
|
placement: "bottom",
|
|
857
856
|
title: localeService.t("sheets-hyper-link-ui.popup.edit"),
|
|
858
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.WriteIcon, { className: "dark:!univer-text-
|
|
857
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.WriteIcon, { className: "dark:!univer-text-gray-0" })
|
|
859
858
|
})
|
|
860
859
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
861
860
|
"data-u-comp": "cell-link-popup-remove",
|
|
@@ -874,7 +873,7 @@ const CellLinkPopupPure = (props) => {
|
|
|
874
873
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Tooltip, {
|
|
875
874
|
placement: "bottom",
|
|
876
875
|
title: localeService.t("sheets-hyper-link-ui.popup.cancel"),
|
|
877
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.UnlinkIcon, { className: "dark:!univer-text-
|
|
876
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_icons.UnlinkIcon, { className: "dark:!univer-text-gray-0" })
|
|
878
877
|
})
|
|
879
878
|
})] })]
|
|
880
879
|
})]
|
|
@@ -1007,7 +1006,7 @@ let SheetsHyperLinkPopupService = class SheetsHyperLinkPopupService extends _uni
|
|
|
1007
1006
|
const visible = this._editorBridgeService.isVisible().visible;
|
|
1008
1007
|
const state = this._editorBridgeService.getEditCellState();
|
|
1009
1008
|
if (visible && state) {
|
|
1010
|
-
var _state$documentLayout, _body$customRanges
|
|
1009
|
+
var _state$documentLayout, _body$customRanges;
|
|
1011
1010
|
const textRange = this._textSelectionManagerService.getActiveTextRange();
|
|
1012
1011
|
const body = (_state$documentLayout = state.documentLayoutObject.documentModel) === null || _state$documentLayout === void 0 ? void 0 : _state$documentLayout.getBody();
|
|
1013
1012
|
if (!body) return null;
|
|
@@ -1017,7 +1016,7 @@ let SheetsHyperLinkPopupService = class SheetsHyperLinkPopupService extends _uni
|
|
|
1017
1016
|
collapsed: body.dataStream.length - 2 === 0,
|
|
1018
1017
|
label: _univerjs_core.BuildTextUtils.transform.getPlainText(body.dataStream)
|
|
1019
1018
|
};
|
|
1020
|
-
const links = _univerjs_core.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(textRange, (
|
|
1019
|
+
const links = _univerjs_core.BuildTextUtils.customRange.getCustomRangesInterestsWithSelection(textRange, ((_body$customRanges = body.customRanges) === null || _body$customRanges === void 0 ? void 0 : _body$customRanges.filter((i) => i.rangeType === _univerjs_core.CustomRangeType.HYPERLINK)) ?? []);
|
|
1021
1020
|
let start = textRange.startOffset;
|
|
1022
1021
|
let end = textRange.endOffset;
|
|
1023
1022
|
links.forEach((link) => {
|
|
@@ -1049,7 +1048,6 @@ let SheetsHyperLinkPopupService = class SheetsHyperLinkPopupService extends _uni
|
|
|
1049
1048
|
startAddEditing(link) {
|
|
1050
1049
|
const { unitId, subUnitId, type } = link;
|
|
1051
1050
|
if (type === "editing") {
|
|
1052
|
-
var _range$label;
|
|
1053
1051
|
const range = this._getEditingRange();
|
|
1054
1052
|
if (!range) return;
|
|
1055
1053
|
this._textSelectionManagerService.replaceDocRanges([{ ...range }], {
|
|
@@ -1063,17 +1061,17 @@ let SheetsHyperLinkPopupService = class SheetsHyperLinkPopupService extends _uni
|
|
|
1063
1061
|
this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToAbsolutePosition(rects.pop(), this._editPopup, unitId, subUnitId);
|
|
1064
1062
|
this._currentEditing$.next({
|
|
1065
1063
|
...link,
|
|
1066
|
-
label: (
|
|
1064
|
+
label: (range === null || range === void 0 ? void 0 : range.label) ?? ""
|
|
1067
1065
|
});
|
|
1068
1066
|
} else {
|
|
1069
|
-
var _cell$p$body
|
|
1067
|
+
var _cell$p$body;
|
|
1070
1068
|
this._currentEditingPopup = this._sheetCanvasPopManagerService.attachPopupToCell(link.row, link.col, this._editPopup, unitId, subUnitId);
|
|
1071
1069
|
const workbook = this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
1072
1070
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
1073
1071
|
const cell = worksheet === null || worksheet === void 0 ? void 0 : worksheet.getCellRaw(link.row, link.col);
|
|
1074
1072
|
this._currentEditing$.next({
|
|
1075
1073
|
...link,
|
|
1076
|
-
label: (cell === null || cell === void 0 ? void 0 : cell.p) ? _univerjs_core.BuildTextUtils.transform.getPlainText((
|
|
1074
|
+
label: (cell === null || cell === void 0 ? void 0 : cell.p) ? _univerjs_core.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()
|
|
1077
1075
|
});
|
|
1078
1076
|
}
|
|
1079
1077
|
}
|
|
@@ -1346,9 +1344,8 @@ let SheetsHyperLinkCopyPasteController = class SheetsHyperLinkCopyPasteControlle
|
|
|
1346
1344
|
const { rows, cols } = discreteRange;
|
|
1347
1345
|
rows.forEach((row, rowIndex) => {
|
|
1348
1346
|
cols.forEach((col, colIndex) => {
|
|
1349
|
-
var _link$id;
|
|
1350
1347
|
const link = this._hyperLinkModel.getHyperLinkByLocation(unitId, subUnitId, row, col);
|
|
1351
|
-
matrix.setValue(rowIndex, colIndex, (
|
|
1348
|
+
matrix.setValue(rowIndex, colIndex, (link === null || link === void 0 ? void 0 : link.id) ?? "");
|
|
1352
1349
|
});
|
|
1353
1350
|
});
|
|
1354
1351
|
}
|
|
@@ -1461,10 +1458,9 @@ const getEditingLinkDisable$ = (accessor, unitId = _univerjs_core.DOCS_NORMAL_ED
|
|
|
1461
1458
|
}));
|
|
1462
1459
|
};
|
|
1463
1460
|
const getLinkDisable$ = (accessor) => {
|
|
1464
|
-
var _editorBridgeService$;
|
|
1465
1461
|
const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
|
|
1466
1462
|
const editorBridgeService = accessor.has(_univerjs_sheets_ui.IEditorBridgeService) ? accessor.get(_univerjs_sheets_ui.IEditorBridgeService) : null;
|
|
1467
|
-
return ((
|
|
1463
|
+
return ((editorBridgeService === null || editorBridgeService === void 0 ? void 0 : editorBridgeService.currentEditCellState$.pipe((0, rxjs.map)((state) => {
|
|
1468
1464
|
if (!state) return 1;
|
|
1469
1465
|
const target = (0, _univerjs_sheets.getSheetCommandTarget)(univerInstanceService, {
|
|
1470
1466
|
unitId: state.unitId,
|
|
@@ -1477,7 +1473,7 @@ const getLinkDisable$ = (accessor) => {
|
|
|
1477
1473
|
return (0, rxjs.combineLatest)([editorBridgeService ? editorBridgeService.visible$ : (0, rxjs.of)(null), univerInstanceService.getCurrentTypeOfUnit$(_univerjs_core.UniverInstanceType.UNIVER_DOC)]).pipe((0, rxjs.switchMap)(([editing, focusingDoc]) => {
|
|
1478
1474
|
return (editing === null || editing === void 0 ? void 0 : editing.visible) ? (focusingDoc === null || focusingDoc === void 0 ? void 0 : focusingDoc.getUnitId()) === _univerjs_core.DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY ? (0, rxjs.of)(true) : getEditingLinkDisable$(accessor, _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY) : (0, rxjs.of)(disableCell !== 0);
|
|
1479
1475
|
}));
|
|
1480
|
-
})))
|
|
1476
|
+
}))) ?? (0, rxjs.of)(true)).pipe((0, rxjs.switchMap)((disableCell) => {
|
|
1481
1477
|
if (disableCell) return (0, rxjs.of)(true);
|
|
1482
1478
|
else return (0, _univerjs_sheets_ui.getCurrentRangeDisable$)(accessor, {
|
|
1483
1479
|
workbookTypes: [_univerjs_sheets.WorkbookEditablePermission],
|
|
@@ -1543,7 +1539,7 @@ const menuSchema = {
|
|
|
1543
1539
|
//#endregion
|
|
1544
1540
|
//#region package.json
|
|
1545
1541
|
var name = "@univerjs/sheets-hyper-link-ui";
|
|
1546
|
-
var version = "1.0.0-
|
|
1542
|
+
var version = "1.0.0-beta.1";
|
|
1547
1543
|
|
|
1548
1544
|
//#endregion
|
|
1549
1545
|
//#region src/controllers/auto-fill.controller.ts
|
|
@@ -2081,7 +2077,7 @@ _defineProperty(UniverSheetsHyperLinkUIPlugin, "packageName", name);
|
|
|
2081
2077
|
_defineProperty(UniverSheetsHyperLinkUIPlugin, "version", version);
|
|
2082
2078
|
_defineProperty(UniverSheetsHyperLinkUIPlugin, "type", _univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
2083
2079
|
UniverSheetsHyperLinkUIPlugin = __decorate([
|
|
2084
|
-
(0, _univerjs_core.DependentOn)(_univerjs_docs.UniverDocsPlugin, _univerjs_engine_formula.UniverFormulaEnginePlugin, _univerjs_engine_render.UniverRenderEnginePlugin, _univerjs_sheets.UniverSheetsPlugin,
|
|
2080
|
+
(0, _univerjs_core.DependentOn)(_univerjs_docs.UniverDocsPlugin, _univerjs_engine_formula.UniverFormulaEnginePlugin, _univerjs_engine_render.UniverRenderEnginePlugin, _univerjs_sheets.UniverSheetsPlugin, _univerjs_docs_ui.UniverDocsUIPlugin, _univerjs_sheets_hyper_link.UniverSheetsHyperLinkPlugin, _univerjs_sheets_ui.UniverSheetsUIPlugin),
|
|
2085
2081
|
__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
|
|
2086
2082
|
__decorateParam(2, _univerjs_core.IConfigService)
|
|
2087
2083
|
], UniverSheetsHyperLinkUIPlugin);
|
package/lib/cjs/locale/ar-SA.js
CHANGED
package/lib/cjs/locale/ca-ES.js
CHANGED
package/lib/cjs/locale/de-DE.js
CHANGED
package/lib/cjs/locale/en-US.js
CHANGED
package/lib/cjs/locale/es-ES.js
CHANGED
package/lib/cjs/locale/fa-IR.js
CHANGED
package/lib/cjs/locale/fr-FR.js
CHANGED
package/lib/cjs/locale/id-ID.js
CHANGED
package/lib/cjs/locale/it-IT.js
CHANGED
package/lib/cjs/locale/ja-JP.js
CHANGED
package/lib/cjs/locale/ko-KR.js
CHANGED
package/lib/cjs/locale/pl-PL.js
CHANGED
package/lib/cjs/locale/pt-BR.js
CHANGED
package/lib/cjs/locale/ru-RU.js
CHANGED
package/lib/cjs/locale/sk-SK.js
CHANGED
package/lib/cjs/locale/vi-VN.js
CHANGED
package/lib/cjs/locale/zh-CN.js
CHANGED
package/lib/cjs/locale/zh-HK.js
CHANGED