@fileverse-dev/fortune-core 1.2.89 → 1.2.90-bold
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/es/events/keyboard.js +5 -2
- package/lib/events/keyboard.js +5 -2
- package/package.json +1 -1
package/es/events/keyboard.js
CHANGED
|
@@ -234,6 +234,7 @@ function handleControlPlusArrowKey(ctx, e, shiftPressed) {
|
|
|
234
234
|
}
|
|
235
235
|
export function handleWithCtrlOrMetaKey(ctx, cache, e, cellInput, fxInput, handleUndo, handleRedo) {
|
|
236
236
|
var _a, _b, _c, _d;
|
|
237
|
+
console.log("handleWithCtrlOrMetaKey", e);
|
|
237
238
|
var flowdata = getFlowdata(ctx);
|
|
238
239
|
if (!flowdata) return;
|
|
239
240
|
if (e.shiftKey) {
|
|
@@ -382,6 +383,7 @@ export function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUnd
|
|
|
382
383
|
return __awaiter(this, void 0, void 0, function () {
|
|
383
384
|
var kcode, kstr, allowEdit, isFxInput, ignoredKeys, restCod, last, row_index, col_index, last, row_index, col_index;
|
|
384
385
|
return __generator(this, function (_d) {
|
|
386
|
+
console.log("handleGlobalKeyDown inside", e);
|
|
385
387
|
if (e.shiftKey && e.code === "Space") {
|
|
386
388
|
e.stopImmediatePropagation();
|
|
387
389
|
e.stopPropagation();
|
|
@@ -423,12 +425,12 @@ export function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUnd
|
|
|
423
425
|
isFxInput = (_b = (_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.contains("fortune-fx-input");
|
|
424
426
|
ignoredKeys = new Set(isFxInput ? ["Enter", "Tab", "ArrowLeft", "ArrowRight"] : ["Enter", "Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
|
|
425
427
|
restCod = !ignoredKeys.has(kstr);
|
|
426
|
-
if (ctx.luckysheetCellUpdate.length > 0 && restCod
|
|
428
|
+
if (ctx.luckysheetCellUpdate.length > 0 && restCod) {
|
|
427
429
|
return [2];
|
|
428
430
|
}
|
|
429
431
|
if (kstr === "Enter") {
|
|
430
432
|
if (!allowEdit) return [2];
|
|
431
|
-
|
|
433
|
+
handleGlobalEnter(ctx, cellInput, e, canvas);
|
|
432
434
|
} else if (kstr === "Tab") {
|
|
433
435
|
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
434
436
|
updateCell(ctx, ctx.luckysheetCellUpdate[0], ctx.luckysheetCellUpdate[1], cellInput, undefined, canvas);
|
|
@@ -457,6 +459,7 @@ export function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUnd
|
|
|
457
459
|
moveHighlightCell(ctx, "down", 0, "rangeOfSelect");
|
|
458
460
|
e.preventDefault();
|
|
459
461
|
} else {
|
|
462
|
+
console.log("kstr", kstr);
|
|
460
463
|
if (e.ctrlKey || e.metaKey) {
|
|
461
464
|
handleWithCtrlOrMetaKey(ctx, cache, e, cellInput, fxInput, handleUndo, handleRedo);
|
|
462
465
|
return [2];
|
package/lib/events/keyboard.js
CHANGED
|
@@ -244,6 +244,7 @@ function handleControlPlusArrowKey(ctx, e, shiftPressed) {
|
|
|
244
244
|
}
|
|
245
245
|
function handleWithCtrlOrMetaKey(ctx, cache, e, cellInput, fxInput, handleUndo, handleRedo) {
|
|
246
246
|
var _a, _b, _c, _d;
|
|
247
|
+
console.log("handleWithCtrlOrMetaKey", e);
|
|
247
248
|
var flowdata = (0, _context.getFlowdata)(ctx);
|
|
248
249
|
if (!flowdata) return;
|
|
249
250
|
if (e.shiftKey) {
|
|
@@ -392,6 +393,7 @@ function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, hand
|
|
|
392
393
|
return __awaiter(this, void 0, void 0, function () {
|
|
393
394
|
var kcode, kstr, allowEdit, isFxInput, ignoredKeys, restCod, last, row_index, col_index, last, row_index, col_index;
|
|
394
395
|
return __generator(this, function (_d) {
|
|
396
|
+
console.log("handleGlobalKeyDown inside", e);
|
|
395
397
|
if (e.shiftKey && e.code === "Space") {
|
|
396
398
|
e.stopImmediatePropagation();
|
|
397
399
|
e.stopPropagation();
|
|
@@ -433,12 +435,12 @@ function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, hand
|
|
|
433
435
|
isFxInput = (_b = (_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.classList) === null || _b === void 0 ? void 0 : _b.contains("fortune-fx-input");
|
|
434
436
|
ignoredKeys = new Set(isFxInput ? ["Enter", "Tab", "ArrowLeft", "ArrowRight"] : ["Enter", "Tab", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
|
|
435
437
|
restCod = !ignoredKeys.has(kstr);
|
|
436
|
-
if (ctx.luckysheetCellUpdate.length > 0 && restCod
|
|
438
|
+
if (ctx.luckysheetCellUpdate.length > 0 && restCod) {
|
|
437
439
|
return [2];
|
|
438
440
|
}
|
|
439
441
|
if (kstr === "Enter") {
|
|
440
442
|
if (!allowEdit) return [2];
|
|
441
|
-
|
|
443
|
+
handleGlobalEnter(ctx, cellInput, e, canvas);
|
|
442
444
|
} else if (kstr === "Tab") {
|
|
443
445
|
if (ctx.luckysheetCellUpdate.length > 0) {
|
|
444
446
|
(0, _cell.updateCell)(ctx, ctx.luckysheetCellUpdate[0], ctx.luckysheetCellUpdate[1], cellInput, undefined, canvas);
|
|
@@ -467,6 +469,7 @@ function handleGlobalKeyDown(ctx, cellInput, fxInput, e, cache, handleUndo, hand
|
|
|
467
469
|
(0, _selection.moveHighlightCell)(ctx, "down", 0, "rangeOfSelect");
|
|
468
470
|
e.preventDefault();
|
|
469
471
|
} else {
|
|
472
|
+
console.log("kstr", kstr);
|
|
470
473
|
if (e.ctrlKey || e.metaKey) {
|
|
471
474
|
handleWithCtrlOrMetaKey(ctx, cache, e, cellInput, fxInput, handleUndo, handleRedo);
|
|
472
475
|
return [2];
|