@fileverse-dev/fortune-core 1.1.35 → 1.1.36

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.
@@ -348,12 +348,13 @@ function handleShiftWithArrowKey(ctx, e) {
348
348
  e.preventDefault();
349
349
  }
350
350
  export function handleArrowKey(ctx, e) {
351
- var _a;
351
+ var _a, _b;
352
352
  var parser = new DOMParser();
353
- var doc = parser.parseFromString("<div>".concat((_a = document.getElementById("luckysheet-rich-text-editor")) === null || _a === void 0 ? void 0 : _a.innerHTML, "</div>"), 'text/html');
354
- var spans = doc.querySelectorAll('span');
353
+ var doc = parser.parseFromString("<div>".concat((_a = document.getElementById("luckysheet-rich-text-editor")) === null || _a === void 0 ? void 0 : _a.innerHTML, "</div>"), "text/html");
354
+ var spans = doc.querySelectorAll("span");
355
355
  var lastSpan = spans[spans.length - 1];
356
- if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(')')) || !(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes('(')) && (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.length) > 2) {
356
+ var notFunctionInit = !((_b = document.getElementById("luckysheet-rich-text-editor")) === null || _b === void 0 ? void 0 : _b.innerText.includes('('));
357
+ if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || notFunctionInit && (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.length) > 3) {
357
358
  return;
358
359
  }
359
360
  var moveCount = hideCRCount(ctx, e.key);
@@ -358,12 +358,13 @@ function handleShiftWithArrowKey(ctx, e) {
358
358
  e.preventDefault();
359
359
  }
360
360
  function handleArrowKey(ctx, e) {
361
- var _a;
361
+ var _a, _b;
362
362
  var parser = new DOMParser();
363
- var doc = parser.parseFromString("<div>".concat((_a = document.getElementById("luckysheet-rich-text-editor")) === null || _a === void 0 ? void 0 : _a.innerHTML, "</div>"), 'text/html');
364
- var spans = doc.querySelectorAll('span');
363
+ var doc = parser.parseFromString("<div>".concat((_a = document.getElementById("luckysheet-rich-text-editor")) === null || _a === void 0 ? void 0 : _a.innerHTML, "</div>"), "text/html");
364
+ var spans = doc.querySelectorAll("span");
365
365
  var lastSpan = spans[spans.length - 1];
366
- if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(')')) || !(lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes('(')) && (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.length) > 2) {
366
+ var notFunctionInit = !((_b = document.getElementById("luckysheet-rich-text-editor")) === null || _b === void 0 ? void 0 : _b.innerText.includes('('));
367
+ if ((lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.includes(")")) || notFunctionInit && (lastSpan === null || lastSpan === void 0 ? void 0 : lastSpan.innerText.length) > 3) {
367
368
  return;
368
369
  }
369
370
  var moveCount = (0, _2.hideCRCount)(ctx, e.key);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.1.35",
3
+ "version": "1.1.36",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",