@univerjs/sheets-hyper-link 0.24.0 → 0.25.0-insiders.20260608-e4336f7

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.
Files changed (109) hide show
  1. package/lib/cjs/facade.js +98 -91
  2. package/lib/cjs/index.js +13 -10
  3. package/lib/cjs/locale/ar-SA.js +6 -0
  4. package/lib/cjs/locale/ca-ES.js +6 -0
  5. package/lib/cjs/locale/de-DE.js +6 -0
  6. package/lib/cjs/locale/en-US.js +21 -0
  7. package/lib/cjs/locale/es-ES.js +6 -0
  8. package/lib/cjs/locale/fa-IR.js +6 -0
  9. package/lib/cjs/locale/fr-FR.js +6 -0
  10. package/lib/cjs/locale/id-ID.js +6 -0
  11. package/lib/cjs/locale/it-IT.js +6 -0
  12. package/lib/cjs/locale/ja-JP.js +6 -0
  13. package/lib/cjs/locale/ko-KR.js +6 -0
  14. package/lib/cjs/locale/pl-PL.js +6 -0
  15. package/lib/cjs/locale/pt-BR.js +6 -0
  16. package/lib/cjs/locale/ru-RU.js +6 -0
  17. package/lib/cjs/locale/sk-SK.js +6 -0
  18. package/lib/cjs/locale/vi-VN.js +6 -0
  19. package/lib/cjs/locale/zh-CN.js +6 -0
  20. package/lib/cjs/locale/zh-HK.js +6 -0
  21. package/lib/cjs/locale/zh-TW.js +6 -0
  22. package/lib/es/facade.js +98 -91
  23. package/lib/es/index.js +13 -10
  24. package/lib/es/locale/ar-SA.js +5 -0
  25. package/lib/es/locale/ca-ES.js +5 -0
  26. package/lib/es/locale/de-DE.js +5 -0
  27. package/lib/es/locale/en-US.js +20 -0
  28. package/lib/es/locale/es-ES.js +5 -0
  29. package/lib/es/locale/fa-IR.js +5 -0
  30. package/lib/es/locale/fr-FR.js +5 -0
  31. package/lib/es/locale/id-ID.js +5 -0
  32. package/lib/es/locale/it-IT.js +5 -0
  33. package/lib/es/locale/ja-JP.js +5 -0
  34. package/lib/es/locale/ko-KR.js +5 -0
  35. package/lib/es/locale/pl-PL.js +5 -0
  36. package/lib/es/locale/pt-BR.js +5 -0
  37. package/lib/es/locale/ru-RU.js +5 -0
  38. package/lib/es/locale/sk-SK.js +5 -0
  39. package/lib/es/locale/vi-VN.js +5 -0
  40. package/lib/es/locale/zh-CN.js +5 -0
  41. package/lib/es/locale/zh-HK.js +5 -0
  42. package/lib/es/locale/zh-TW.js +5 -0
  43. package/lib/facade.js +98 -91
  44. package/lib/index.js +13 -10
  45. package/lib/locale/ar-SA.js +5 -0
  46. package/lib/locale/ca-ES.js +5 -0
  47. package/lib/locale/de-DE.js +5 -0
  48. package/lib/locale/en-US.js +20 -0
  49. package/lib/locale/es-ES.js +5 -0
  50. package/lib/locale/fa-IR.js +5 -0
  51. package/lib/locale/fr-FR.js +5 -0
  52. package/lib/locale/id-ID.js +5 -0
  53. package/lib/locale/it-IT.js +5 -0
  54. package/lib/locale/ja-JP.js +5 -0
  55. package/lib/locale/ko-KR.js +5 -0
  56. package/lib/locale/pl-PL.js +5 -0
  57. package/lib/locale/pt-BR.js +5 -0
  58. package/lib/locale/ru-RU.js +5 -0
  59. package/lib/locale/sk-SK.js +5 -0
  60. package/lib/locale/vi-VN.js +5 -0
  61. package/lib/locale/zh-CN.js +5 -0
  62. package/lib/locale/zh-HK.js +5 -0
  63. package/lib/locale/zh-TW.js +5 -0
  64. package/lib/types/facade/f-range.d.ts +76 -46
  65. package/lib/types/facade/f-workbook.d.ts +40 -18
  66. package/lib/types/facade/f-worksheet.d.ts +3 -2
  67. package/lib/types/locale/ar-SA.d.ts +18 -0
  68. package/lib/types/locale/ca-ES.d.ts +18 -0
  69. package/lib/types/locale/de-DE.d.ts +18 -0
  70. package/lib/types/locale/en-US.d.ts +23 -0
  71. package/lib/types/locale/es-ES.d.ts +18 -0
  72. package/lib/types/locale/fa-IR.d.ts +18 -0
  73. package/lib/types/locale/fr-FR.d.ts +18 -0
  74. package/lib/types/locale/id-ID.d.ts +18 -0
  75. package/lib/types/locale/it-IT.d.ts +18 -0
  76. package/lib/types/locale/ja-JP.d.ts +18 -0
  77. package/lib/types/locale/ko-KR.d.ts +18 -0
  78. package/lib/types/locale/pl-PL.d.ts +18 -0
  79. package/lib/types/locale/pt-BR.d.ts +18 -0
  80. package/lib/types/locale/ru-RU.d.ts +18 -0
  81. package/lib/types/locale/sk-SK.d.ts +18 -0
  82. package/lib/types/locale/vi-VN.d.ts +18 -0
  83. package/lib/types/locale/zh-CN.d.ts +18 -0
  84. package/lib/types/locale/zh-HK.d.ts +18 -0
  85. package/lib/types/locale/zh-TW.d.ts +18 -0
  86. package/lib/types/services/parser.service.d.ts +2 -1
  87. package/lib/umd/facade.js +1 -1
  88. package/lib/umd/index.js +1 -1
  89. package/lib/umd/locale/ar-SA.js +1 -0
  90. package/lib/umd/locale/ca-ES.js +1 -0
  91. package/lib/umd/locale/de-DE.js +1 -0
  92. package/lib/umd/locale/en-US.js +1 -0
  93. package/lib/umd/locale/es-ES.js +1 -0
  94. package/lib/umd/locale/fa-IR.js +1 -0
  95. package/lib/umd/locale/fr-FR.js +1 -0
  96. package/lib/umd/locale/id-ID.js +1 -0
  97. package/lib/umd/locale/it-IT.js +1 -0
  98. package/lib/umd/locale/ja-JP.js +1 -0
  99. package/lib/umd/locale/ko-KR.js +1 -0
  100. package/lib/umd/locale/pl-PL.js +1 -0
  101. package/lib/umd/locale/pt-BR.js +1 -0
  102. package/lib/umd/locale/ru-RU.js +1 -0
  103. package/lib/umd/locale/sk-SK.js +1 -0
  104. package/lib/umd/locale/vi-VN.js +1 -0
  105. package/lib/umd/locale/zh-CN.js +1 -0
  106. package/lib/umd/locale/zh-HK.js +1 -0
  107. package/lib/umd/locale/zh-TW.js +1 -0
  108. package/package.json +12 -7
  109. package/LICENSE +0 -176
package/lib/cjs/facade.js CHANGED
@@ -1,44 +1,20 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- let _univerjs_core = require("@univerjs/core");
2
+ let _univerjs_engine_formula = require("@univerjs/engine-formula");
3
3
  let _univerjs_sheets_hyper_link = require("@univerjs/sheets-hyper-link");
4
4
  let _univerjs_sheets_facade = require("@univerjs/sheets/facade");
5
+ let _univerjs_core = require("@univerjs/core");
5
6
  let _univerjs_core_facade = require("@univerjs/core/facade");
6
7
 
7
- //#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
8
- function __decorateParam(paramIndex, decorator) {
9
- return function(target, key) {
10
- decorator(target, key, paramIndex);
11
- };
12
- }
13
-
14
- //#endregion
15
- //#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
16
- function __decorate(decorators, target, key, desc) {
17
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
18
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
19
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
20
- return c > 3 && r && Object.defineProperty(target, key, r), r;
21
- }
22
-
23
- //#endregion
24
8
  //#region src/facade/f-workbook.ts
25
- let SheetHyperLinkBuilder = class SheetHyperLinkBuilder {
26
- constructor(_workbook, _parserService) {
27
- this._workbook = _workbook;
28
- this._parserService = _parserService;
29
- }
30
- getRangeUrl(range) {
31
- this._parserService.buildHyperLink(this._workbook.getId(), range.getSheetId(), range.getRange());
32
- return this;
33
- }
34
- };
35
- SheetHyperLinkBuilder = __decorate([__decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_sheets_hyper_link.SheetsHyperLinkParserService))], SheetHyperLinkBuilder);
36
9
  var FWorkbookHyperlinkMixin = class extends _univerjs_sheets_facade.FWorkbook {
37
- /**
38
- * Parse the hyperlink string to get the hyperlink info.
39
- * @param {string} hyperlink the hyperlink string
40
- * @returns {ISheetHyperLinkInfo} the hyperlink info
41
- */
10
+ getUrlOfDefineName(name) {
11
+ const definedNameService = this._injector.get(_univerjs_engine_formula.IDefinedNamesService);
12
+ const parserService = this._injector.get(_univerjs_sheets_hyper_link.SheetsHyperLinkParserService);
13
+ const definedName = definedNameService.getValueByName(this._workbook.getUnitId(), name);
14
+ if (!definedName) throw new Error(`Defined name "${name}" does not exist.`);
15
+ if (definedName.formulaOrRefString.startsWith(_univerjs_engine_formula.operatorToken.EQUALS)) throw new Error(`Defined name "${name}" is not a reference range, cannot be converted to hyperlink.`);
16
+ return parserService.buildHyperLink(definedName.id);
17
+ }
42
18
  parseSheetHyperlink(hyperlink) {
43
19
  return this._injector.get(_univerjs_sheets_hyper_link.SheetsHyperLinkParserService).parseHyperLink(hyperlink);
44
20
  }
@@ -64,7 +40,7 @@ _univerjs_sheets_facade.FWorkbook.extend(FWorkbookHyperlinkMixin);
64
40
  */
65
41
  var FWorksheetHyperlinkMixin = class extends _univerjs_sheets_facade.FWorksheet {
66
42
  getUrl() {
67
- return this._injector.get(_univerjs_sheets_hyper_link.SheetsHyperLinkParserService).buildHyperLink(this._workbook.getUnitId(), this._worksheet.getSheetId());
43
+ return this._injector.get(_univerjs_sheets_hyper_link.SheetsHyperLinkParserService).buildHyperLink(null, this._worksheet.getSheetId());
68
44
  }
69
45
  };
70
46
  _univerjs_sheets_facade.FWorksheet.extend(FWorksheetHyperlinkMixin);
@@ -73,60 +49,84 @@ _univerjs_sheets_facade.FWorksheet.extend(FWorksheetHyperlinkMixin);
73
49
  //#region src/facade/f-range.ts
74
50
  var FRangeSheetsHyperlinkMixin = class extends _univerjs_sheets_facade.FRange {
75
51
  setHyperLink(url, label) {
76
- const params = {
52
+ return this._commandService.executeCommand(_univerjs_sheets_hyper_link.AddHyperLinkCommand.id, {
77
53
  unitId: this.getUnitId(),
78
54
  subUnitId: this._worksheet.getSheetId(),
79
55
  link: {
56
+ id: (0, _univerjs_core.generateRandomId)(),
80
57
  row: this._range.startRow,
81
58
  column: this._range.startColumn,
82
59
  payload: url,
83
- display: label,
84
- id: (0, _univerjs_core.generateRandomId)()
60
+ display: label
85
61
  }
86
- };
87
- return this._commandService.executeCommand(_univerjs_sheets_hyper_link.AddHyperLinkCommand.id, params);
62
+ });
88
63
  }
89
64
  getHyperLinks() {
90
- var _cellValue$p$body$cus, _cellValue$p$body;
91
- const cellValue = this._worksheet.getCellRaw(this._range.startRow, this._range.startColumn);
92
- if (!(cellValue === null || cellValue === void 0 ? void 0 : cellValue.p)) return [];
93
- return (_cellValue$p$body$cus = (_cellValue$p$body = cellValue.p.body) === null || _cellValue$p$body === void 0 || (_cellValue$p$body = _cellValue$p$body.customRanges) === null || _cellValue$p$body === void 0 ? void 0 : _cellValue$p$body.filter((range) => range.rangeType === _univerjs_core.CustomRangeType.HYPERLINK).map((range) => {
94
- var _range$properties$url, _range$properties, _cellValue$p$body$dat, _cellValue$p;
95
- return {
96
- id: `${range.rangeId}`,
97
- startIndex: range.startIndex,
98
- endIndex: range.endIndex,
99
- url: (_range$properties$url = (_range$properties = range.properties) === null || _range$properties === void 0 ? void 0 : _range$properties.url) !== null && _range$properties$url !== void 0 ? _range$properties$url : "",
100
- label: (_cellValue$p$body$dat = (_cellValue$p = cellValue.p) === null || _cellValue$p === void 0 || (_cellValue$p = _cellValue$p.body) === null || _cellValue$p === void 0 ? void 0 : _cellValue$p.dataStream.slice(range.startIndex, range.endIndex + 1).replaceAll(_univerjs_core.DataStreamTreeTokenType.CUSTOM_RANGE_START, "").replaceAll(_univerjs_core.DataStreamTreeTokenType.CUSTOM_RANGE_END, "")) !== null && _cellValue$p$body$dat !== void 0 ? _cellValue$p$body$dat : ""
101
- };
102
- })) !== null && _cellValue$p$body$cus !== void 0 ? _cellValue$p$body$cus : [];
65
+ const hyperlinks = [];
66
+ this.forEach((row, column, cell) => {
67
+ var _cell$p$body$customRa, _cell$p$body;
68
+ if (!cell.p) return;
69
+ const ranges = (_cell$p$body$customRa = (_cell$p$body = cell.p.body) === null || _cell$p$body === void 0 || (_cell$p$body = _cell$p$body.customRanges) === null || _cell$p$body === void 0 ? void 0 : _cell$p$body.filter((range) => range.rangeType === _univerjs_core.CustomRangeType.HYPERLINK)) !== null && _cell$p$body$customRa !== void 0 ? _cell$p$body$customRa : [];
70
+ if (ranges.length > 0) {
71
+ var _cell$p, _properties$url, _dataStream$slice$rep;
72
+ const dataStream = (_cell$p = cell.p) === null || _cell$p === void 0 || (_cell$p = _cell$p.body) === null || _cell$p === void 0 ? void 0 : _cell$p.dataStream;
73
+ const { rangeId, properties, startIndex, endIndex } = ranges[0];
74
+ const url = (_properties$url = properties === null || properties === void 0 ? void 0 : properties.url) !== null && _properties$url !== void 0 ? _properties$url : "";
75
+ const label = (_dataStream$slice$rep = dataStream === null || dataStream === void 0 ? void 0 : dataStream.slice(startIndex, endIndex + 1).replaceAll(_univerjs_core.DataStreamTreeTokenType.CUSTOM_RANGE_START, "").replaceAll(_univerjs_core.DataStreamTreeTokenType.CUSTOM_RANGE_END, "")) !== null && _dataStream$slice$rep !== void 0 ? _dataStream$slice$rep : "";
76
+ hyperlinks.push({
77
+ id: `${rangeId}`,
78
+ row,
79
+ column,
80
+ url,
81
+ label
82
+ });
83
+ }
84
+ });
85
+ return hyperlinks;
103
86
  }
104
- updateHyperLink(id, url, label) {
105
- const params = {
87
+ updateHyperLink(url, label) {
88
+ const hyperlink = this.getHyperLinks().find((link) => link.row === this._range.startRow && link.column === this._range.startColumn);
89
+ if (!hyperlink) return Promise.reject(/* @__PURE__ */ new Error("No hyperlink found in the top left cell of the range"));
90
+ const { id, row, column } = hyperlink;
91
+ return this._commandService.executeCommand(_univerjs_sheets_hyper_link.UpdateHyperLinkCommand.id, {
106
92
  unitId: this.getUnitId(),
107
93
  subUnitId: this._worksheet.getSheetId(),
108
- row: this._range.startRow,
109
- column: this._range.startColumn,
110
94
  id,
95
+ row,
96
+ column,
111
97
  payload: {
112
98
  payload: url,
113
99
  display: label
114
100
  }
115
- };
116
- return this._commandService.executeCommand(_univerjs_sheets_hyper_link.UpdateHyperLinkCommand.id, params);
101
+ });
117
102
  }
118
- cancelHyperLink(id) {
119
- const params = {
120
- unitId: this.getUnitId(),
121
- subUnitId: this._worksheet.getSheetId(),
122
- row: this._range.startRow,
123
- column: this._range.startColumn,
124
- id
125
- };
126
- return this._commandService.syncExecuteCommand(_univerjs_sheets_hyper_link.CancelHyperLinkCommand.id, params);
103
+ cancelHyperLink(hyperlink) {
104
+ if (hyperlink) {
105
+ const { id, row, column } = hyperlink;
106
+ return this._commandService.syncExecuteCommand(_univerjs_sheets_hyper_link.CancelHyperLinkCommand.id, {
107
+ unitId: this.getUnitId(),
108
+ subUnitId: this._worksheet.getSheetId(),
109
+ id,
110
+ row,
111
+ column
112
+ });
113
+ } else {
114
+ const hyperlinks = this.getHyperLinks();
115
+ if (hyperlinks.length === 0) return true;
116
+ return hyperlinks.every((link) => {
117
+ const { id, row, column } = link;
118
+ return this._commandService.syncExecuteCommand(_univerjs_sheets_hyper_link.CancelHyperLinkCommand.id, {
119
+ unitId: this.getUnitId(),
120
+ subUnitId: this._worksheet.getSheetId(),
121
+ id,
122
+ row,
123
+ column
124
+ });
125
+ });
126
+ }
127
127
  }
128
128
  getUrl() {
129
- return this._injector.get(_univerjs_sheets_hyper_link.SheetsHyperLinkParserService).buildHyperLink(this.getUnitId(), this.getSheetId(), this.getRange());
129
+ return this._injector.get(_univerjs_sheets_hyper_link.SheetsHyperLinkParserService).buildHyperLink(this.getRange(), this.getSheetId());
130
130
  }
131
131
  };
132
132
  _univerjs_sheets_facade.FRange.extend(FRangeSheetsHyperlinkMixin);
@@ -156,46 +156,53 @@ var FUniverSheetsHyperlinkMixin = class extends _univerjs_core_facade.FUniver {
156
156
  const commandService = injector.get(_univerjs_core.ICommandService);
157
157
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetLinkAdd, () => commandService.beforeCommandExecuted((commandInfo) => {
158
158
  if (commandInfo.id !== _univerjs_sheets_hyper_link.AddHyperLinkCommand.id) return;
159
- const eventTarget = this.getCommandSheetTarget(commandInfo);
160
- if (!eventTarget) return;
161
159
  const params = commandInfo.params;
160
+ const target = this.getSheetCommandTarget(params);
161
+ if (!target) return;
162
+ const { workbook, worksheet } = target;
163
+ const { link } = params;
164
+ const { row, column: col } = link;
162
165
  const eventParams = {
163
- workbook: eventTarget.workbook,
164
- worksheet: eventTarget.worksheet,
165
- row: params.link.row,
166
- col: params.link.column,
167
- link: params.link
166
+ workbook,
167
+ worksheet,
168
+ row,
169
+ col,
170
+ link
168
171
  };
169
172
  this.fireEvent(this.Event.BeforeSheetLinkAdd, eventParams);
170
173
  if (eventParams.cancel) throw new _univerjs_core.CanceledError();
171
174
  })));
172
175
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetLinkUpdate, () => commandService.beforeCommandExecuted((commandInfo) => {
173
176
  if (commandInfo.id !== _univerjs_sheets_hyper_link.UpdateHyperLinkCommand.id) return;
174
- const eventTarget = this.getCommandSheetTarget(commandInfo);
175
- if (!eventTarget) return;
176
177
  const params = commandInfo.params;
178
+ const target = this.getSheetCommandTarget(params);
179
+ if (!target) return;
180
+ const { workbook, worksheet } = target;
181
+ const { row, column, id, payload } = params;
177
182
  const eventParams = {
178
- workbook: eventTarget.workbook,
179
- worksheet: eventTarget.worksheet,
180
- row: params.row,
181
- column: params.column,
182
- id: params.id,
183
- payload: params.payload
183
+ workbook,
184
+ worksheet,
185
+ row,
186
+ column,
187
+ id,
188
+ payload
184
189
  };
185
190
  this.fireEvent(this.Event.BeforeSheetLinkUpdate, eventParams);
186
191
  if (eventParams.cancel) throw new _univerjs_core.CanceledError();
187
192
  })));
188
193
  this.disposeWithMe(this.registerEventHandler(this.Event.BeforeSheetLinkCancel, () => commandService.beforeCommandExecuted((commandInfo) => {
189
194
  if (commandInfo.id !== _univerjs_sheets_hyper_link.CancelHyperLinkCommand.id) return;
190
- const eventTarget = this.getCommandSheetTarget(commandInfo);
191
- if (!eventTarget) return;
192
195
  const params = commandInfo.params;
196
+ const target = this.getSheetCommandTarget(params);
197
+ if (!target) return;
198
+ const { workbook, worksheet } = target;
199
+ const { row, column, id } = params;
193
200
  const eventParams = {
194
- workbook: eventTarget.workbook,
195
- worksheet: eventTarget.worksheet,
196
- row: params.row,
197
- column: params.column,
198
- id: params.id
201
+ workbook,
202
+ worksheet,
203
+ row,
204
+ column,
205
+ id
199
206
  };
200
207
  this.fireEvent(this.Event.BeforeSheetLinkCancel, eventParams);
201
208
  if (eventParams.cancel) throw new _univerjs_core.CanceledError();
package/lib/cjs/index.js CHANGED
@@ -5,7 +5,7 @@ let _univerjs_sheets = require("@univerjs/sheets");
5
5
  let rxjs = require("rxjs");
6
6
  let _univerjs_engine_formula = require("@univerjs/engine-formula");
7
7
 
8
- //#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
8
+ //#region \0@oxc-project+runtime@0.134.0/helpers/esm/typeof.js
9
9
  function _typeof(o) {
10
10
  "@babel/helpers - typeof";
11
11
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -16,7 +16,7 @@ function _typeof(o) {
16
16
  }
17
17
 
18
18
  //#endregion
19
- //#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
19
+ //#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPrimitive.js
20
20
  function toPrimitive(t, r) {
21
21
  if ("object" != _typeof(t) || !t) return t;
22
22
  var e = t[Symbol.toPrimitive];
@@ -29,14 +29,14 @@ function toPrimitive(t, r) {
29
29
  }
30
30
 
31
31
  //#endregion
32
- //#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
32
+ //#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPropertyKey.js
33
33
  function toPropertyKey(t) {
34
34
  var i = toPrimitive(t, "string");
35
35
  return "symbol" == _typeof(i) ? i : i + "";
36
36
  }
37
37
 
38
38
  //#endregion
39
- //#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
39
+ //#region \0@oxc-project+runtime@0.134.0/helpers/esm/defineProperty.js
40
40
  function _defineProperty(e, r, t) {
41
41
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
42
42
  value: t,
@@ -47,7 +47,7 @@ function _defineProperty(e, r, t) {
47
47
  }
48
48
 
49
49
  //#endregion
50
- //#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
50
+ //#region \0@oxc-project+runtime@0.134.0/helpers/esm/decorateParam.js
51
51
  function __decorateParam(paramIndex, decorator) {
52
52
  return function(target, key) {
53
53
  decorator(target, key, paramIndex);
@@ -55,7 +55,7 @@ function __decorateParam(paramIndex, decorator) {
55
55
  }
56
56
 
57
57
  //#endregion
58
- //#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
58
+ //#region \0@oxc-project+runtime@0.134.0/helpers/esm/decorate.js
59
59
  function __decorate(decorators, target, key, desc) {
60
60
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
61
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -706,7 +706,7 @@ const UpdateRichHyperLinkMutation = {
706
706
  //#endregion
707
707
  //#region package.json
708
708
  var name = "@univerjs/sheets-hyper-link";
709
- var version = "0.24.0";
709
+ var version = "0.25.0-insiders.20260608-e4336f7";
710
710
 
711
711
  //#endregion
712
712
  //#region src/config/config.ts
@@ -1456,8 +1456,11 @@ let SheetsHyperLinkParserService = class SheetsHyperLinkParserService {
1456
1456
  this._localeService = _localeService;
1457
1457
  this._definedNamesService = _definedNamesService;
1458
1458
  }
1459
- buildHyperLink(unitId, sheetId, range) {
1460
- return `#${"gid"}=${sheetId}${range ? `&${typeof range === "string" ? "rangeid" : "range"}=${typeof range === "string" ? range : (0, _univerjs_engine_formula.serializeRange)(range)}` : ""}`;
1459
+ buildHyperLink(defineNameIdOrRange, sheetId) {
1460
+ if (typeof defineNameIdOrRange === "string") return `#${"rangeid"}=${defineNameIdOrRange}`;
1461
+ let result = `#${"gid"}=${sheetId}`;
1462
+ if (defineNameIdOrRange) result += `&${"range"}=${(0, _univerjs_engine_formula.serializeRange)(defineNameIdOrRange)}`;
1463
+ return result;
1461
1464
  }
1462
1465
  parseHyperLink(urlStr) {
1463
1466
  if (urlStr.startsWith("#")) {
@@ -1489,7 +1492,7 @@ let SheetsHyperLinkParserService = class SheetsHyperLinkParserService {
1489
1492
  const workbook = unitid ? this._univerInstanceService.getUnit(unitid, _univerjs_core.UniverInstanceType.UNIVER_SHEET) : this._univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET);
1490
1493
  const invalidLink = {
1491
1494
  type: "invalid",
1492
- name: this._localeService.t("hyperLink.message.refError")
1495
+ name: this._localeService.t("sheets-hyper-link.message.refError")
1493
1496
  };
1494
1497
  if (!workbook) return invalidLink;
1495
1498
  const sheet = gid ? workbook.getSheetBySheetId(gid) : workbook.getActiveSheet();
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/ar-SA.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "نطاق غير صالح" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/ca-ES.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "Interval no vàlid" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/de-DE.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "Ungültiger Bereich" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,21 @@
1
+
2
+ //#region src/locale/en-US.ts
3
+ /**
4
+ * Copyright 2023-present DreamNum Co., Ltd.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ const locale = { "sheets-hyper-link": { message: { refError: "Invalid Range" } } };
19
+
20
+ //#endregion
21
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/es-ES.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "Rango no válido" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/fa-IR.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "محدوده نامعتبر" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/fr-FR.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "Plage invalide" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/id-ID.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "Rentang Tidak Valid" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/it-IT.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "Intervallo non valido" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/ja-JP.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "無効な範囲です" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/ko-KR.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "잘못된 범위입니다" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/pl-PL.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "Nieprawidłowy zakres" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/pt-BR.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "Intervalo Inválido" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/ru-RU.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "Недопустимый диапазон" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/sk-SK.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "Neplatný rozsah" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/vi-VN.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "Tham chiếu lỗi" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/zh-CN.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "错误的引用" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/zh-HK.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "錯誤的引用" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;
@@ -0,0 +1,6 @@
1
+
2
+ //#region src/locale/zh-TW.ts
3
+ const locale = { "sheets-hyper-link": { message: { refError: "錯誤的引用" } } };
4
+
5
+ //#endregion
6
+ module.exports = locale;