@simon_he/vue-tui 1.1.10 → 1.1.12

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.
@@ -3693,7 +3693,11 @@ const TInput = defineComponent({
3693
3693
  if ((e.key === "u" || e.key === "U") && e.ctrlKey && !e.metaKey && !e.altKey) {
3694
3694
  e.preventDefault();
3695
3695
  e.stopPropagation();
3696
- clearAll();
3696
+ const next = deleteToLineBoundary(value, "start");
3697
+ if (next.deleted) {
3698
+ pushUndoSnapshot(next.value);
3699
+ applyEdit(next.value, next.cursor);
3700
+ }
3697
3701
  return;
3698
3702
  }
3699
3703
  if ((e.key === "w" || e.key === "W") && e.ctrlKey && !e.metaKey && !e.altKey) {
@@ -3702,6 +3706,38 @@ const TInput = defineComponent({
3702
3706
  clearAll();
3703
3707
  return;
3704
3708
  }
3709
+ if (e.key === "Backspace" && e.altKey && !e.ctrlKey && !e.metaKey) {
3710
+ e.preventDefault();
3711
+ e.stopPropagation();
3712
+ const { value: afterDelete, cursor: nextCursor, deleted } = deleteSelectionIfAny(value);
3713
+ if (deleted) {
3714
+ pushUndoSnapshot(afterDelete);
3715
+ applyEdit(afterDelete, nextCursor);
3716
+ return;
3717
+ }
3718
+ const next = deleteRangeIfAny(value, findWordLeft(value, cursor.value), cursor.value);
3719
+ if (next.deleted) {
3720
+ pushUndoSnapshot(next.value);
3721
+ applyEdit(next.value, next.cursor);
3722
+ }
3723
+ return;
3724
+ }
3725
+ if ((e.key === "Delete" || e.key === "d" || e.key === "D") && e.altKey && !e.ctrlKey && !e.metaKey) {
3726
+ e.preventDefault();
3727
+ e.stopPropagation();
3728
+ const { value: afterDelete, cursor: nextCursor, deleted } = deleteSelectionIfAny(value);
3729
+ if (deleted) {
3730
+ pushUndoSnapshot(afterDelete);
3731
+ applyEdit(afterDelete, nextCursor);
3732
+ return;
3733
+ }
3734
+ const next = deleteRangeIfAny(value, cursor.value, findWordRight(value, cursor.value));
3735
+ if (next.deleted) {
3736
+ pushUndoSnapshot(next.value);
3737
+ applyEdit(next.value, next.cursor);
3738
+ }
3739
+ return;
3740
+ }
3705
3741
  if (e.key === "Backspace") {
3706
3742
  const mentions = props.mentions ?? [];
3707
3743
  if (!value && cursor.value <= 0 && mentions.length > 0) {
@@ -9,7 +9,7 @@ import { createFramePerfStore, createTraceStore } from "./trace-Bh8WnoMo.js";
9
9
  import { envFlag, envString, firstNonEmptyEnv } from "./env-Cl8qmNFN.js";
10
10
  import { createTerminalSelectionController } from "./terminal-selection-4W1SJj4c.js";
11
11
  import { createDebugLogger, isDebugEnabled } from "./debug-logger-CmsGI4of.js";
12
- import { TBox, TInput, TRenderPlane, resolveOverlayPlacement } from "./TSelect-CUDPduI4.js";
12
+ import { TBox, TInput, TRenderPlane, resolveOverlayPlacement } from "./TSelect-C-WzsLAD.js";
13
13
  import { TText, TView, createFrameMailbox } from "./frame-mailbox-DaTrfyaF.js";
14
14
  import { applyWheelScroll, createWheelScrollState, resetWheelScrollState } from "./wheel-scroll-CQ22Hcyj.js";
15
15
  import { computed, defineComponent, effectScope, getCurrentInstance, h, inject, nextTick, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, ref, shallowReactive, shallowRef, toRef, watch, watchEffect } from "vue";
package/dist/agent.cjs CHANGED
@@ -4298,13 +4298,37 @@ var nextImeOwnerId = 0, nextPasteImageId = 0, TInput = (0, import_vue12.defineCo
4298
4298
  return;
4299
4299
  }
4300
4300
  if ((e.key === "u" || e.key === "U") && e.ctrlKey && !e.metaKey && !e.altKey) {
4301
- e.preventDefault(), e.stopPropagation(), clearAll();
4301
+ e.preventDefault(), e.stopPropagation();
4302
+ let next = deleteToLineBoundary(value, "start");
4303
+ next.deleted && (pushUndoSnapshot(next.value), applyEdit(next.value, next.cursor));
4302
4304
  return;
4303
4305
  }
4304
4306
  if ((e.key === "w" || e.key === "W") && e.ctrlKey && !e.metaKey && !e.altKey) {
4305
4307
  e.preventDefault(), e.stopPropagation(), clearAll();
4306
4308
  return;
4307
4309
  }
4310
+ if (e.key === "Backspace" && e.altKey && !e.ctrlKey && !e.metaKey) {
4311
+ e.preventDefault(), e.stopPropagation();
4312
+ let { value: afterDelete, cursor: nextCursor, deleted } = deleteSelectionIfAny(value);
4313
+ if (deleted) {
4314
+ pushUndoSnapshot(afterDelete), applyEdit(afterDelete, nextCursor);
4315
+ return;
4316
+ }
4317
+ let next = deleteRangeIfAny(value, findWordLeft(value, cursor.value), cursor.value);
4318
+ next.deleted && (pushUndoSnapshot(next.value), applyEdit(next.value, next.cursor));
4319
+ return;
4320
+ }
4321
+ if ((e.key === "Delete" || e.key === "d" || e.key === "D") && e.altKey && !e.ctrlKey && !e.metaKey) {
4322
+ e.preventDefault(), e.stopPropagation();
4323
+ let { value: afterDelete, cursor: nextCursor, deleted } = deleteSelectionIfAny(value);
4324
+ if (deleted) {
4325
+ pushUndoSnapshot(afterDelete), applyEdit(afterDelete, nextCursor);
4326
+ return;
4327
+ }
4328
+ let next = deleteRangeIfAny(value, cursor.value, findWordRight(value, cursor.value));
4329
+ next.deleted && (pushUndoSnapshot(next.value), applyEdit(next.value, next.cursor));
4330
+ return;
4331
+ }
4308
4332
  if (e.key === "Backspace") {
4309
4333
  let mentions = props.mentions ?? [];
4310
4334
  if (!value && cursor.value <= 0 && mentions.length > 0) {
package/dist/agent.js CHANGED
@@ -6,7 +6,7 @@ import "./frame-perf-CHpWhbC4.js";
6
6
  import "./env-Cl8qmNFN.js";
7
7
  import "./terminal-selection-4W1SJj4c.js";
8
8
  import "./debug-logger-CmsGI4of.js";
9
- import { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, computeCommandPaletteMatchRanges } from "./TSelect-CUDPduI4.js";
9
+ import { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, computeCommandPaletteMatchRanges } from "./TSelect-C-WzsLAD.js";
10
10
  import { TText, TView } from "./frame-mailbox-DaTrfyaF.js";
11
11
  import "./path-BI9W15Zt.js";
12
12
  import "./wheel-scroll-CQ22Hcyj.js";
package/dist/cli.cjs CHANGED
@@ -1436,6 +1436,8 @@ function parseCsi(sequence) {
1436
1436
  return { handled: !0, event: keyEvent("Tab", "Tab", mods2) };
1437
1437
  if (cp === 27)
1438
1438
  return { handled: !0, event: keyEvent("Escape", "Escape", mods2) };
1439
+ if (cp === 127)
1440
+ return { handled: !0, event: keyEvent("Backspace", "Backspace", mods2) };
1439
1441
  if (cp >= 32)
1440
1442
  try {
1441
1443
  return {
@@ -1981,6 +1983,10 @@ function createStdinDriver(options) {
1981
1983
  dispatchEvent(keyEvent("Tab", "Tab", { altKey: !0 }), "alt");
1982
1984
  return;
1983
1985
  }
1986
+ if (code === 127) {
1987
+ dispatchEvent(keyEvent("Backspace", "Backspace", { altKey: !0 }), "alt");
1988
+ return;
1989
+ }
1984
1990
  }
1985
1991
  if (sequence === "\x1B") {
1986
1992
  dispatchEvent(keyEvent("Escape", "Escape"), "escape");
package/dist/cli.js CHANGED
@@ -1523,6 +1523,10 @@ function parseCsi(sequence) {
1523
1523
  handled: true,
1524
1524
  event: keyEvent("Escape", "Escape", mods2)
1525
1525
  };
1526
+ if (cp === 127) return {
1527
+ handled: true,
1528
+ event: keyEvent("Backspace", "Backspace", mods2)
1529
+ };
1526
1530
  if (cp >= 32) try {
1527
1531
  return {
1528
1532
  handled: true,
@@ -2303,6 +2307,10 @@ function createStdinDriver(options) {
2303
2307
  dispatchEvent(keyEvent("Tab", "Tab", { altKey: true }), "alt");
2304
2308
  return;
2305
2309
  }
2310
+ if (code === 127) {
2311
+ dispatchEvent(keyEvent("Backspace", "Backspace", { altKey: true }), "alt");
2312
+ return;
2313
+ }
2306
2314
  }
2307
2315
  if (sequence === "\x1B") {
2308
2316
  dispatchEvent(keyEvent("Escape", "Escape"), "escape");
package/dist/index.cjs CHANGED
@@ -9935,13 +9935,37 @@ var nextImeOwnerId = 0, nextPasteImageId = 0, TInput = (0, import_vue20.defineCo
9935
9935
  return;
9936
9936
  }
9937
9937
  if ((e.key === "u" || e.key === "U") && e.ctrlKey && !e.metaKey && !e.altKey) {
9938
- e.preventDefault(), e.stopPropagation(), clearAll();
9938
+ e.preventDefault(), e.stopPropagation();
9939
+ let next = deleteToLineBoundary(value, "start");
9940
+ next.deleted && (pushUndoSnapshot(next.value), applyEdit(next.value, next.cursor));
9939
9941
  return;
9940
9942
  }
9941
9943
  if ((e.key === "w" || e.key === "W") && e.ctrlKey && !e.metaKey && !e.altKey) {
9942
9944
  e.preventDefault(), e.stopPropagation(), clearAll();
9943
9945
  return;
9944
9946
  }
9947
+ if (e.key === "Backspace" && e.altKey && !e.ctrlKey && !e.metaKey) {
9948
+ e.preventDefault(), e.stopPropagation();
9949
+ let { value: afterDelete, cursor: nextCursor, deleted } = deleteSelectionIfAny(value);
9950
+ if (deleted) {
9951
+ pushUndoSnapshot(afterDelete), applyEdit(afterDelete, nextCursor);
9952
+ return;
9953
+ }
9954
+ let next = deleteRangeIfAny(value, findWordLeft(value, cursor.value), cursor.value);
9955
+ next.deleted && (pushUndoSnapshot(next.value), applyEdit(next.value, next.cursor));
9956
+ return;
9957
+ }
9958
+ if ((e.key === "Delete" || e.key === "d" || e.key === "D") && e.altKey && !e.ctrlKey && !e.metaKey) {
9959
+ e.preventDefault(), e.stopPropagation();
9960
+ let { value: afterDelete, cursor: nextCursor, deleted } = deleteSelectionIfAny(value);
9961
+ if (deleted) {
9962
+ pushUndoSnapshot(afterDelete), applyEdit(afterDelete, nextCursor);
9963
+ return;
9964
+ }
9965
+ let next = deleteRangeIfAny(value, cursor.value, findWordRight(value, cursor.value));
9966
+ next.deleted && (pushUndoSnapshot(next.value), applyEdit(next.value, next.cursor));
9967
+ return;
9968
+ }
9945
9969
  if (e.key === "Backspace") {
9946
9970
  let mentions = props.mentions ?? [];
9947
9971
  if (!value && cursor.value <= 0 && mentions.length > 0) {
package/dist/index.js CHANGED
@@ -8,10 +8,10 @@ import "./runtime-Byf8XXOT.js";
8
8
  import "./frame-perf-CHpWhbC4.js";
9
9
  import "./trace-Bh8WnoMo.js";
10
10
  import "./env-Cl8qmNFN.js";
11
- import { TAutocompleteInput, TBadge, TCheckbox, TCode, TDataTable, TDivider, TFormField, TLink, TLinkifyText, TList, TPasswordInput, TRadioGroup, TSlider, TSwitch, TTable, TTag, TTree, TerminalProvider, createTInputHostPlugin } from "./TTree-CYXTAY4k.js";
11
+ import { TAutocompleteInput, TBadge, TCheckbox, TCode, TDataTable, TDivider, TFormField, TLink, TLinkifyText, TList, TPasswordInput, TRadioGroup, TSlider, TSwitch, TTable, TTag, TTree, TerminalProvider, createTInputHostPlugin } from "./TTree-1JP-PZ2T.js";
12
12
  import "./terminal-selection-4W1SJj4c.js";
13
13
  import "./debug-logger-CmsGI4of.js";
14
- import { TBox, TCommandPalette, TDialog, TInput, TSelect, computeCommandPaletteMatchRanges } from "./TSelect-CUDPduI4.js";
14
+ import { TBox, TCommandPalette, TDialog, TInput, TSelect, computeCommandPaletteMatchRanges } from "./TSelect-C-WzsLAD.js";
15
15
  import { TText, TView } from "./frame-mailbox-DaTrfyaF.js";
16
16
  import "./path-BI9W15Zt.js";
17
17
  import "./wheel-scroll-CQ22Hcyj.js";
package/dist/vue.cjs CHANGED
@@ -5082,13 +5082,37 @@ var nextImeOwnerId = 0, nextPasteImageId = 0, TInput = (0, import_vue15.defineCo
5082
5082
  return;
5083
5083
  }
5084
5084
  if ((e.key === "u" || e.key === "U") && e.ctrlKey && !e.metaKey && !e.altKey) {
5085
- e.preventDefault(), e.stopPropagation(), clearAll();
5085
+ e.preventDefault(), e.stopPropagation();
5086
+ let next = deleteToLineBoundary(value, "start");
5087
+ next.deleted && (pushUndoSnapshot(next.value), applyEdit(next.value, next.cursor));
5086
5088
  return;
5087
5089
  }
5088
5090
  if ((e.key === "w" || e.key === "W") && e.ctrlKey && !e.metaKey && !e.altKey) {
5089
5091
  e.preventDefault(), e.stopPropagation(), clearAll();
5090
5092
  return;
5091
5093
  }
5094
+ if (e.key === "Backspace" && e.altKey && !e.ctrlKey && !e.metaKey) {
5095
+ e.preventDefault(), e.stopPropagation();
5096
+ let { value: afterDelete, cursor: nextCursor, deleted } = deleteSelectionIfAny(value);
5097
+ if (deleted) {
5098
+ pushUndoSnapshot(afterDelete), applyEdit(afterDelete, nextCursor);
5099
+ return;
5100
+ }
5101
+ let next = deleteRangeIfAny(value, findWordLeft(value, cursor.value), cursor.value);
5102
+ next.deleted && (pushUndoSnapshot(next.value), applyEdit(next.value, next.cursor));
5103
+ return;
5104
+ }
5105
+ if ((e.key === "Delete" || e.key === "d" || e.key === "D") && e.altKey && !e.ctrlKey && !e.metaKey) {
5106
+ e.preventDefault(), e.stopPropagation();
5107
+ let { value: afterDelete, cursor: nextCursor, deleted } = deleteSelectionIfAny(value);
5108
+ if (deleted) {
5109
+ pushUndoSnapshot(afterDelete), applyEdit(afterDelete, nextCursor);
5110
+ return;
5111
+ }
5112
+ let next = deleteRangeIfAny(value, cursor.value, findWordRight(value, cursor.value));
5113
+ next.deleted && (pushUndoSnapshot(next.value), applyEdit(next.value, next.cursor));
5114
+ return;
5115
+ }
5092
5116
  if (e.key === "Backspace") {
5093
5117
  let mentions = props.mentions ?? [];
5094
5118
  if (!value && cursor.value <= 0 && mentions.length > 0) {
package/dist/vue.js CHANGED
@@ -8,10 +8,10 @@ import "./runtime-Byf8XXOT.js";
8
8
  import "./frame-perf-CHpWhbC4.js";
9
9
  import "./trace-Bh8WnoMo.js";
10
10
  import "./env-Cl8qmNFN.js";
11
- import { TAutocompleteInput, TBadge, TCheckbox, TCode, TDataTable, TDivider, TForm, TFormContextKey, TFormField, TLink, TLinkifyText, TList, TPasswordInput, TProgress, TRadioGroup, TSlider, TSpinner, TSwitch, TTable, TTag, TToastViewport, TTree, TerminalProvider, createTInputHostPlugin, useTForm } from "./TTree-CYXTAY4k.js";
11
+ import { TAutocompleteInput, TBadge, TCheckbox, TCode, TDataTable, TDivider, TForm, TFormContextKey, TFormField, TLink, TLinkifyText, TList, TPasswordInput, TProgress, TRadioGroup, TSlider, TSpinner, TSwitch, TTable, TTag, TToastViewport, TTree, TerminalProvider, createTInputHostPlugin, useTForm } from "./TTree-1JP-PZ2T.js";
12
12
  import "./terminal-selection-4W1SJj4c.js";
13
13
  import "./debug-logger-CmsGI4of.js";
14
- import { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, clamp$1, computeCommandPaletteMatchRanges, createOverlayFocusStack, isCommitMention, isWhitespace, mentionChipStyle, padEndByCells as padEndByCells$1, resolveOverlayPlacement, sliceByCellsWindow, textCellWidth as textCellWidth$1 } from "./TSelect-CUDPduI4.js";
14
+ import { TBox, TCommandPalette, TDialog, TInput, TRenderPlane, TSelect, clamp$1, computeCommandPaletteMatchRanges, createOverlayFocusStack, isCommitMention, isWhitespace, mentionChipStyle, padEndByCells as padEndByCells$1, resolveOverlayPlacement, sliceByCellsWindow, textCellWidth as textCellWidth$1 } from "./TSelect-C-WzsLAD.js";
15
15
  import { TText, TView } from "./frame-mailbox-DaTrfyaF.js";
16
16
  import { normalizePath, stripTrailingSlash } from "./path-BI9W15Zt.js";
17
17
  import { applyWheelScroll, createWheelScrollState } from "./wheel-scroll-CQ22Hcyj.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simon_he/vue-tui",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "Vue 3 terminal UI components and renderers for browser DOM, CLI stdout, logs, markdown transcripts, and agent consoles",
5
5
  "keywords": [
6
6
  "agent-console",