@univerjs/sheets-hyper-link-ui 1.0.0-alpha.7 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +39 -43
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +44 -48
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/index.js +44 -48
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/umd/index.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
|
@@ -63,7 +63,7 @@ const configSymbol = Symbol(SHEETS_HYPER_LINK_UI_PLUGIN_CONFIG_KEY);
|
|
|
63
63
|
const defaultPluginConfig = {};
|
|
64
64
|
|
|
65
65
|
//#endregion
|
|
66
|
-
//#region \0@oxc-project+runtime@0.
|
|
66
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
|
|
67
67
|
function __decorateParam(paramIndex, decorator) {
|
|
68
68
|
return function(target, key) {
|
|
69
69
|
decorator(target, key, paramIndex);
|
|
@@ -71,7 +71,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
//#endregion
|
|
74
|
-
//#region \0@oxc-project+runtime@0.
|
|
74
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
|
|
75
75
|
function __decorate(decorators, target, key, desc) {
|
|
76
76
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
77
77
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -212,7 +212,7 @@ SheetsHyperLinkResolverService = __decorate([
|
|
|
212
212
|
], SheetsHyperLinkResolverService);
|
|
213
213
|
|
|
214
214
|
//#endregion
|
|
215
|
-
//#region \0@oxc-project+runtime@0.
|
|
215
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
|
|
216
216
|
function _typeof(o) {
|
|
217
217
|
"@babel/helpers - typeof";
|
|
218
218
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -223,7 +223,7 @@ function _typeof(o) {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
//#endregion
|
|
226
|
-
//#region \0@oxc-project+runtime@0.
|
|
226
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
|
|
227
227
|
function toPrimitive(t, r) {
|
|
228
228
|
if ("object" != _typeof(t) || !t) return t;
|
|
229
229
|
var e = t[Symbol.toPrimitive];
|
|
@@ -236,14 +236,14 @@ function toPrimitive(t, r) {
|
|
|
236
236
|
}
|
|
237
237
|
|
|
238
238
|
//#endregion
|
|
239
|
-
//#region \0@oxc-project+runtime@0.
|
|
239
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
|
|
240
240
|
function toPropertyKey(t) {
|
|
241
241
|
var i = toPrimitive(t, "string");
|
|
242
242
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
//#endregion
|
|
246
|
-
//#region \0@oxc-project+runtime@0.
|
|
246
|
+
//#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
|
|
247
247
|
function _defineProperty(e, r, t) {
|
|
248
248
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
249
249
|
value: t,
|
|
@@ -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,
|
|
@@ -488,7 +487,7 @@ const CellLinkEdit = () => {
|
|
|
488
487
|
setIsFocusRangeSelector(type === _univerjs_sheets_hyper_link.SheetHyperLinkType.RANGE);
|
|
489
488
|
}, [type]);
|
|
490
489
|
(0, react.useEffect)(() => {
|
|
491
|
-
const render = renderManagerService.
|
|
490
|
+
const render = renderManagerService.getRenderUnitById(editorBridgeService.getCurrentEditorId());
|
|
492
491
|
const disposeCollection = new _univerjs_core.DisposableCollection();
|
|
493
492
|
if (render) {
|
|
494
493
|
const selectionRenderService = render.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
@@ -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
|
}));
|
|
@@ -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,7 +794,7 @@ 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
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-white univer-p-2 univer-shadow-md dark:!univer-bg-gray-900", _univerjs_design.borderClassName),
|
|
@@ -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,31 +1048,30 @@ 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 }], {
|
|
1056
1054
|
unitId: _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY,
|
|
1057
1055
|
subUnitId: _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY
|
|
1058
1056
|
});
|
|
1059
|
-
const currentRender = this._injector.get(_univerjs_engine_render.IRenderManagerService).
|
|
1057
|
+
const currentRender = this._injector.get(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(_univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY);
|
|
1060
1058
|
if (!currentRender) return;
|
|
1061
1059
|
const rects = (0, _univerjs_docs_ui.calcDocRangePositions)(range, currentRender);
|
|
1062
1060
|
if (!(rects === null || rects === void 0 ? void 0 : rects.length)) return;
|
|
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
|
}
|
|
@@ -1090,7 +1088,7 @@ let SheetsHyperLinkPopupService = class SheetsHyperLinkPopupService extends _uni
|
|
|
1090
1088
|
if (!customRangeInfo || !((_customRangeInfo$rect = customRangeInfo.rects) === null || _customRangeInfo$rect === void 0 ? void 0 : _customRangeInfo$rect.length)) return;
|
|
1091
1089
|
customRange = customRangeInfo.customRange;
|
|
1092
1090
|
label = customRangeInfo.label;
|
|
1093
|
-
this._textSelectionManagerService.
|
|
1091
|
+
this._textSelectionManagerService.replaceDocRanges([{
|
|
1094
1092
|
startOffset: customRange.startIndex,
|
|
1095
1093
|
endOffset: customRange.endIndex + 1
|
|
1096
1094
|
}]);
|
|
@@ -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
|
}
|
|
@@ -1446,7 +1443,7 @@ SheetsHyperLinkCopyPasteController = __decorate([
|
|
|
1446
1443
|
const getEditingLinkDisable$ = (accessor, unitId = _univerjs_core.DOCS_NORMAL_EDITOR_UNIT_ID_KEY) => {
|
|
1447
1444
|
var _accessor$get$getRend;
|
|
1448
1445
|
const univerInstanceService = accessor.get(_univerjs_core.IUniverInstanceService);
|
|
1449
|
-
const docSelctionService = (_accessor$get$getRend = accessor.get(_univerjs_engine_render.IRenderManagerService).
|
|
1446
|
+
const docSelctionService = (_accessor$get$getRend = accessor.get(_univerjs_engine_render.IRenderManagerService).getRenderUnitById(unitId)) === null || _accessor$get$getRend === void 0 ? void 0 : _accessor$get$getRend.with(_univerjs_docs_ui.DocSelectionRenderService);
|
|
1450
1447
|
if (!docSelctionService) return (0, rxjs.of)(true);
|
|
1451
1448
|
return docSelctionService.textSelectionInner$.pipe((0, rxjs.map)(() => {
|
|
1452
1449
|
const state = accessor.get(_univerjs_sheets_ui.IEditorBridgeService).getEditCellState();
|
|
@@ -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.0";
|
|
1547
1543
|
|
|
1548
1544
|
//#endregion
|
|
1549
1545
|
//#region src/controllers/auto-fill.controller.ts
|
|
@@ -1795,7 +1791,7 @@ let SheetsHyperLinkPopupController = class SheetsHyperLinkPopupController extend
|
|
|
1795
1791
|
return;
|
|
1796
1792
|
}
|
|
1797
1793
|
const { unitId, subUnitId, row, col } = currentCell;
|
|
1798
|
-
const renderer = this._renderManagerService.
|
|
1794
|
+
const renderer = this._renderManagerService.getRenderUnitById(unitId);
|
|
1799
1795
|
if (!renderer) return;
|
|
1800
1796
|
const workbook = this._univerInstanceService.getUnit(unitId, _univerjs_core.UniverInstanceType.UNIVER_SHEET);
|
|
1801
1797
|
const worksheet = workbook === null || workbook === void 0 ? void 0 : workbook.getSheetBySheetId(subUnitId);
|
|
@@ -1861,7 +1857,7 @@ let SheetsHyperLinkPopupController = class SheetsHyperLinkPopupController extend
|
|
|
1861
1857
|
return;
|
|
1862
1858
|
}
|
|
1863
1859
|
const { editorUnitId, unitId, sheetId, row, column } = state;
|
|
1864
|
-
const renderer = this._renderManagerService.
|
|
1860
|
+
const renderer = this._renderManagerService.getRenderUnitById(editorUnitId);
|
|
1865
1861
|
if (!renderer) return;
|
|
1866
1862
|
const { editPermission, viewPermission, copyPermission } = this._getLinkPermission({
|
|
1867
1863
|
unitId,
|
|
@@ -1880,7 +1876,7 @@ let SheetsHyperLinkPopupController = class SheetsHyperLinkPopupController extend
|
|
|
1880
1876
|
return;
|
|
1881
1877
|
}
|
|
1882
1878
|
const rect = customRange.rects[customRange.rects.length - 1];
|
|
1883
|
-
if (!((_this$_renderManagerS = this._renderManagerService.
|
|
1879
|
+
if (!((_this$_renderManagerS = this._renderManagerService.getRenderUnitById(unitId)) === null || _this$_renderManagerS === void 0 || (_this$_renderManagerS = _this$_renderManagerS.with(_univerjs_sheets_ui.SheetSkeletonManagerService).getSkeletonParam(sheetId)) === null || _this$_renderManagerS === void 0 ? void 0 : _this$_renderManagerS.skeleton) || !rect) return;
|
|
1884
1880
|
const canvasClientRect = renderer.engine.getCanvasElement().getBoundingClientRect();
|
|
1885
1881
|
this._sheetsHyperLinkPopupService.showPopup({
|
|
1886
1882
|
unitId,
|
|
@@ -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_sheets_hyper_link.UniverSheetsHyperLinkPlugin,
|
|
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/zh-HK.js
CHANGED