@fileverse-dev/fortune-core 1.1.33 → 1.1.35

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,7 +348,12 @@ function handleShiftWithArrowKey(ctx, e) {
348
348
  e.preventDefault();
349
349
  }
350
350
  export function handleArrowKey(ctx, e) {
351
- if (ctx.luckysheetCellUpdate.length > 0 || ctx.luckysheet_cell_selected_move || ctx.luckysheet_cell_selected_extend) {
351
+ var _a;
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');
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) {
352
357
  return;
353
358
  }
354
359
  var moveCount = hideCRCount(ctx, e.key);
@@ -1119,7 +1119,7 @@ export function handlePaste(ctx, e) {
1119
1119
  }
1120
1120
  var data_1 = new Array(trList.length);
1121
1121
  var colLen_1 = 0;
1122
- _.forEach(trList[0].querySelectorAll("td"), function (td) {
1122
+ _.forEach(trList[0].querySelectorAll("td, th"), function (td) {
1123
1123
  var colspan = td.colSpan;
1124
1124
  if (Number.isNaN(colspan)) {
1125
1125
  colspan = 1;
@@ -1153,7 +1153,8 @@ export function handlePaste(ctx, e) {
1153
1153
  if (_.has(ctx.luckysheetfile[index_1].config.rowlen, targetR) && ctx.luckysheetfile[index_1].config.rowlen[targetR] !== targetRowHeight || !_.has(ctx.luckysheetfile[index_1].config.rowlen, targetR) && ctx.luckysheetfile[index_1].defaultRowHeight !== targetRowHeight) {
1154
1154
  rowHeightList_1[targetR] = targetRowHeight;
1155
1155
  }
1156
- _.forEach(tr.querySelectorAll("td"), function (td) {
1156
+ _.forEach(tr.querySelectorAll("td, th"), function (element) {
1157
+ var td = element;
1157
1158
  var className = td.className;
1158
1159
  var cell = {};
1159
1160
  var txt = td.innerText || td.innerHTML;
@@ -478,6 +478,7 @@ export function cancelNormalSelected(ctx) {
478
478
  }
479
479
  export function updateCell(ctx, r, c, $input, value, canvas) {
480
480
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
481
+ console.log("updateCell", r, c, $input, value);
481
482
  var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
482
483
  var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
483
484
  var flowdata = getFlowdata(ctx);
@@ -358,7 +358,12 @@ function handleShiftWithArrowKey(ctx, e) {
358
358
  e.preventDefault();
359
359
  }
360
360
  function handleArrowKey(ctx, e) {
361
- if (ctx.luckysheetCellUpdate.length > 0 || ctx.luckysheet_cell_selected_move || ctx.luckysheet_cell_selected_extend) {
361
+ var _a;
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');
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) {
362
367
  return;
363
368
  }
364
369
  var moveCount = (0, _2.hideCRCount)(ctx, e.key);
@@ -1128,7 +1128,7 @@ function handlePaste(ctx, e) {
1128
1128
  }
1129
1129
  var data_1 = new Array(trList.length);
1130
1130
  var colLen_1 = 0;
1131
- _lodash.default.forEach(trList[0].querySelectorAll("td"), function (td) {
1131
+ _lodash.default.forEach(trList[0].querySelectorAll("td, th"), function (td) {
1132
1132
  var colspan = td.colSpan;
1133
1133
  if (Number.isNaN(colspan)) {
1134
1134
  colspan = 1;
@@ -1162,7 +1162,8 @@ function handlePaste(ctx, e) {
1162
1162
  if (_lodash.default.has(ctx.luckysheetfile[index_1].config.rowlen, targetR) && ctx.luckysheetfile[index_1].config.rowlen[targetR] !== targetRowHeight || !_lodash.default.has(ctx.luckysheetfile[index_1].config.rowlen, targetR) && ctx.luckysheetfile[index_1].defaultRowHeight !== targetRowHeight) {
1163
1163
  rowHeightList_1[targetR] = targetRowHeight;
1164
1164
  }
1165
- _lodash.default.forEach(tr.querySelectorAll("td"), function (td) {
1165
+ _lodash.default.forEach(tr.querySelectorAll("td, th"), function (element) {
1166
+ var td = element;
1166
1167
  var className = td.className;
1167
1168
  var cell = {};
1168
1169
  var txt = td.innerText || td.innerHTML;
@@ -508,6 +508,7 @@ function cancelNormalSelected(ctx) {
508
508
  }
509
509
  function updateCell(ctx, r, c, $input, value, canvas) {
510
510
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
511
+ console.log("updateCell", r, c, $input, value);
511
512
  var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
512
513
  var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
513
514
  var flowdata = (0, _context.getFlowdata)(ctx);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.1.33",
3
+ "version": "1.1.35",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",