@fileverse-dev/fortune-react 1.1.41 → 1.1.43

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.
@@ -203,6 +203,7 @@ var InputBox = function InputBox() {
203
203
  var _a, _b;
204
204
  lastKeyDownEventRef.current = new KeyboardEvent(e.type, e.nativeEvent);
205
205
  preText.current = inputRef.current.innerText;
206
+ var allowListNavigation = true;
206
207
  if (e.key === "Delete" || e.key === "Backspace") {
207
208
  setTimeout(function () {
208
209
  moveCursorToEnd(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current);
@@ -226,12 +227,14 @@ var InputBox = function InputBox() {
226
227
  var notFunctionInit = !((_b = document.getElementById("luckysheet-rich-text-editor")) === null || _b === void 0 ? void 0 : _b.innerText.includes("("));
227
228
  var arrowRefNotAllowed = (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || notFunctionInit && /^[a-zA-Z]+$/.test(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) && !_.includes(["="], lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText);
228
229
  if (((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) === "(" || (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) === "," || (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(":")) || (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) !== ")") && !isLetterNumberPattern(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) && !arrowRefNotAllowed) {
230
+ allowListNavigation = false;
229
231
  inputRef.current.innerHTML = "".concat(inputRef.current.innerHTML, "<span class=\"fortune-formula-functionrange-cell\" rangeindex=\"0\" dir=\"auto\" style=\"color:#c1232b;\">").concat(refCell, "</span>");
230
232
  setTimeout(function () {
231
233
  moveCursorToEnd(inputRef.current);
232
234
  }, 1);
233
235
  }
234
236
  if (isLetterNumberPattern(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
237
+ allowListNavigation = false;
235
238
  var htmlR = removeLastSpan(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current.innerHTML);
236
239
  inputRef.current.innerHTML = "".concat(htmlR, "<span class=\"fortune-formula-functionrange-cell\" rangeindex=\"0\" dir=\"auto\" style=\"color:#c1232b;\">").concat(refCell, "</span>");
237
240
  moveCursorToEnd(inputRef.current);
@@ -257,7 +260,7 @@ var InputBox = function InputBox() {
257
260
  e.preventDefault();
258
261
  } else if (e.key === "F4" && context.luckysheetCellUpdate.length > 0) {
259
262
  e.preventDefault();
260
- } else if (e.key === "ArrowUp" && context.luckysheetCellUpdate.length > 0) {
263
+ } else if (e.key === "ArrowUp" && context.luckysheetCellUpdate.length > 0 && allowListNavigation) {
261
264
  if (document.getElementById("luckysheet-formula-search-c")) {
262
265
  var formulaSearchContainer = document.getElementById("luckysheet-formula-search-c");
263
266
  var activeItem = formulaSearchContainer === null || formulaSearchContainer === void 0 ? void 0 : formulaSearchContainer.querySelector(".luckysheet-formula-search-item-active");
@@ -276,7 +279,7 @@ var InputBox = function InputBox() {
276
279
  }
277
280
  }
278
281
  e.preventDefault();
279
- } else if (e.key === "ArrowDown" && context.luckysheetCellUpdate.length > 0) {
282
+ } else if (e.key === "ArrowDown" && context.luckysheetCellUpdate.length > 0 && allowListNavigation) {
280
283
  if (document.getElementById("luckysheet-formula-search-c")) {
281
284
  var formulaSearchContainer = document.getElementById("luckysheet-formula-search-c");
282
285
  var activeItem = formulaSearchContainer === null || formulaSearchContainer === void 0 ? void 0 : formulaSearchContainer.querySelector(".luckysheet-formula-search-item-active");
@@ -4,7 +4,7 @@
4
4
  /* background: #fafafc; */
5
5
  position: relative;
6
6
  padding: 4px 8px;
7
- border-bottom: 1px solid #d4d4d4;
7
+ border-bottom: 1px solid #E8EBEC;
8
8
  white-space: nowrap;
9
9
  align-items: center;
10
10
  gap: 4px;
@@ -212,6 +212,7 @@ var InputBox = function InputBox() {
212
212
  var _a, _b;
213
213
  lastKeyDownEventRef.current = new KeyboardEvent(e.type, e.nativeEvent);
214
214
  preText.current = inputRef.current.innerText;
215
+ var allowListNavigation = true;
215
216
  if (e.key === "Delete" || e.key === "Backspace") {
216
217
  setTimeout(function () {
217
218
  (0, _helper.moveCursorToEnd)(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current);
@@ -235,12 +236,14 @@ var InputBox = function InputBox() {
235
236
  var notFunctionInit = !((_b = document.getElementById("luckysheet-rich-text-editor")) === null || _b === void 0 ? void 0 : _b.innerText.includes("("));
236
237
  var arrowRefNotAllowed = (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || notFunctionInit && /^[a-zA-Z]+$/.test(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) && !_lodash.default.includes(["="], lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText);
237
238
  if (((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) === "(" || (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) === "," || (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(":")) || (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) !== ")") && !(0, _helper.isLetterNumberPattern)(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText) && !arrowRefNotAllowed) {
239
+ allowListNavigation = false;
238
240
  inputRef.current.innerHTML = "".concat(inputRef.current.innerHTML, "<span class=\"fortune-formula-functionrange-cell\" rangeindex=\"0\" dir=\"auto\" style=\"color:#c1232b;\">").concat(refCell, "</span>");
239
241
  setTimeout(function () {
240
242
  (0, _helper.moveCursorToEnd)(inputRef.current);
241
243
  }, 1);
242
244
  }
243
245
  if ((0, _helper.isLetterNumberPattern)(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText)) {
246
+ allowListNavigation = false;
244
247
  var htmlR = (0, _helper.removeLastSpan)(inputRef === null || inputRef === void 0 ? void 0 : inputRef.current.innerHTML);
245
248
  inputRef.current.innerHTML = "".concat(htmlR, "<span class=\"fortune-formula-functionrange-cell\" rangeindex=\"0\" dir=\"auto\" style=\"color:#c1232b;\">").concat(refCell, "</span>");
246
249
  (0, _helper.moveCursorToEnd)(inputRef.current);
@@ -266,7 +269,7 @@ var InputBox = function InputBox() {
266
269
  e.preventDefault();
267
270
  } else if (e.key === "F4" && context.luckysheetCellUpdate.length > 0) {
268
271
  e.preventDefault();
269
- } else if (e.key === "ArrowUp" && context.luckysheetCellUpdate.length > 0) {
272
+ } else if (e.key === "ArrowUp" && context.luckysheetCellUpdate.length > 0 && allowListNavigation) {
270
273
  if (document.getElementById("luckysheet-formula-search-c")) {
271
274
  var formulaSearchContainer = document.getElementById("luckysheet-formula-search-c");
272
275
  var activeItem = formulaSearchContainer === null || formulaSearchContainer === void 0 ? void 0 : formulaSearchContainer.querySelector(".luckysheet-formula-search-item-active");
@@ -285,7 +288,7 @@ var InputBox = function InputBox() {
285
288
  }
286
289
  }
287
290
  e.preventDefault();
288
- } else if (e.key === "ArrowDown" && context.luckysheetCellUpdate.length > 0) {
291
+ } else if (e.key === "ArrowDown" && context.luckysheetCellUpdate.length > 0 && allowListNavigation) {
289
292
  if (document.getElementById("luckysheet-formula-search-c")) {
290
293
  var formulaSearchContainer = document.getElementById("luckysheet-formula-search-c");
291
294
  var activeItem = formulaSearchContainer === null || formulaSearchContainer === void 0 ? void 0 : formulaSearchContainer.querySelector(".luckysheet-formula-search-item-active");
@@ -4,7 +4,7 @@
4
4
  /* background: #fafafc; */
5
5
  position: relative;
6
6
  padding: 4px 8px;
7
- border-bottom: 1px solid #d4d4d4;
7
+ border-bottom: 1px solid #E8EBEC;
8
8
  white-space: nowrap;
9
9
  align-items: center;
10
10
  gap: 4px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-react",
3
- "version": "1.1.41",
3
+ "version": "1.1.43",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "module": "es/index.js",
@@ -16,7 +16,7 @@
16
16
  "tsc": "tsc"
17
17
  },
18
18
  "dependencies": {
19
- "@fileverse-dev/fortune-core": "1.1.41",
19
+ "@fileverse-dev/fortune-core": "1.1.43",
20
20
  "@fileverse/ui": "^4.1.7-patch-21",
21
21
  "@tippyjs/react": "^4.2.6",
22
22
  "@types/regenerator-runtime": "^0.13.6",