@opentui/core 0.0.0-20251108-0c7899b1 → 0.0.0-20251112-a24ada2d

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/index.js CHANGED
@@ -136,7 +136,7 @@ import {
136
136
  white,
137
137
  wrapWithDelegates,
138
138
  yellow
139
- } from "./index-z5bb2h2z.js";
139
+ } from "./index-kj9k00yt.js";
140
140
  // src/text-buffer-view.ts
141
141
  class TextBufferView {
142
142
  lib;
@@ -4226,12 +4226,7 @@ class ScrollBoxRenderable extends BoxRenderable {
4226
4226
  this.internalId = ScrollBoxRenderable.idCounter++;
4227
4227
  this._stickyScroll = stickyScroll;
4228
4228
  this._stickyStart = stickyStart;
4229
- if (scrollAcceleration) {
4230
- this.scrollAccel = scrollAcceleration;
4231
- } else if (process.platform === "darwin") {
4232
- this.scrollAccel = new MacOSScrollAccel;
4233
- }
4234
- this.scrollAccel ??= new LinearScrollAccel;
4229
+ this.scrollAccel = scrollAcceleration ?? new LinearScrollAccel;
4235
4230
  this.wrapper = new BoxRenderable(ctx, {
4236
4231
  flexDirection: "column",
4237
4232
  flexGrow: 1,
@@ -5763,7 +5758,7 @@ function mergeKeyBindings(defaults, custom) {
5763
5758
  return Array.from(map.values());
5764
5759
  }
5765
5760
  function getKeyBindingKey(binding) {
5766
- return `${binding.name}:${!!binding.ctrl}:${!!binding.shift}:${!!binding.meta}`;
5761
+ return `${binding.name}:${binding.ctrl ? 1 : 0}:${binding.shift ? 1 : 0}:${binding.meta ? 1 : 0}:${binding.super ? 1 : 0}`;
5767
5762
  }
5768
5763
  function buildKeyBindingsMap(bindings) {
5769
5764
  const map = new Map;
@@ -5790,27 +5785,33 @@ var defaultTextareaKeybindings = [
5790
5785
  { name: "end", shift: true, action: "select-line-end" },
5791
5786
  { name: "a", ctrl: true, action: "buffer-home" },
5792
5787
  { name: "e", ctrl: true, action: "buffer-end" },
5793
- { name: "d", ctrl: true, action: "delete-line" },
5788
+ { name: "f", ctrl: true, action: "move-right" },
5789
+ { name: "b", ctrl: true, action: "move-left" },
5790
+ { name: "d", ctrl: true, action: "delete-word-forward" },
5791
+ { name: "w", ctrl: true, action: "delete-word-backward" },
5794
5792
  { name: "k", ctrl: true, action: "delete-to-line-end" },
5793
+ { name: "u", ctrl: true, action: "delete-to-line-start" },
5795
5794
  { name: "backspace", action: "backspace" },
5795
+ { name: "backspace", shift: true, action: "backspace" },
5796
5796
  { name: "delete", action: "delete" },
5797
+ { name: "delete", shift: true, action: "delete" },
5797
5798
  { name: "return", action: "newline" },
5798
5799
  { name: "linefeed", action: "newline" },
5799
5800
  { name: "return", meta: true, action: "submit" },
5800
- { name: "z", ctrl: true, action: "undo" },
5801
- { name: "Z", ctrl: true, shift: true, action: "redo" },
5802
- { name: "y", ctrl: true, action: "redo" },
5801
+ { name: "-", ctrl: true, action: "undo" },
5802
+ { name: ".", ctrl: true, action: "redo" },
5803
+ { name: "z", super: true, action: "undo" },
5804
+ { name: "z", super: true, shift: true, action: "redo" },
5803
5805
  { name: "f", meta: true, action: "word-forward" },
5804
5806
  { name: "b", meta: true, action: "word-backward" },
5805
5807
  { name: "right", meta: true, action: "word-forward" },
5806
5808
  { name: "left", meta: true, action: "word-backward" },
5807
- { name: "F", meta: true, shift: true, action: "select-word-forward" },
5808
- { name: "B", meta: true, shift: true, action: "select-word-backward" },
5809
+ { name: "f", meta: true, shift: true, action: "select-word-forward" },
5810
+ { name: "b", meta: true, shift: true, action: "select-word-backward" },
5809
5811
  { name: "right", meta: true, shift: true, action: "select-word-forward" },
5810
5812
  { name: "left", meta: true, shift: true, action: "select-word-backward" },
5811
- { name: "d", meta: true, action: "delete-word-forward" },
5812
- { name: "backspace", meta: true, action: "delete-word-backward" },
5813
- { name: "w", ctrl: true, action: "delete-word-backward" }
5813
+ { name: "d", meta: true, action: "delete-line" },
5814
+ { name: "backspace", meta: true, action: "delete-word-backward" }
5814
5815
  ];
5815
5816
 
5816
5817
  class TextareaRenderable extends EditBufferRenderable {
@@ -5885,6 +5886,7 @@ class TextareaRenderable extends EditBufferRenderable {
5885
5886
  ["buffer-end", () => this.gotoBufferEnd()],
5886
5887
  ["delete-line", () => this.deleteLine()],
5887
5888
  ["delete-to-line-end", () => this.deleteToLineEnd()],
5889
+ ["delete-to-line-start", () => this.deleteToLineStart()],
5888
5890
  ["backspace", () => this.deleteCharBackward()],
5889
5891
  ["delete", () => this.deleteChar()],
5890
5892
  ["newline", () => this.newLine()],
@@ -5908,11 +5910,13 @@ class TextareaRenderable extends EditBufferRenderable {
5908
5910
  const keyCtrl = typeof key === "string" ? false : key.ctrl;
5909
5911
  const keyShift = typeof key === "string" ? false : key.shift;
5910
5912
  const keyMeta = typeof key === "string" ? false : key.meta;
5913
+ const keySuper = typeof key === "string" ? false : key.super;
5911
5914
  const bindingKey = getKeyBindingKey({
5912
5915
  name: keyName,
5913
5916
  ctrl: keyCtrl,
5914
5917
  shift: keyShift,
5915
5918
  meta: keyMeta,
5919
+ super: keySuper,
5916
5920
  action: "move-left"
5917
5921
  });
5918
5922
  const action = this._keyBindingsMap.get(bindingKey);
@@ -6065,6 +6069,14 @@ class TextareaRenderable extends EditBufferRenderable {
6065
6069
  this.requestRender();
6066
6070
  return true;
6067
6071
  }
6072
+ deleteToLineStart() {
6073
+ const cursor = this.editorView.getCursor();
6074
+ if (cursor.col > 0) {
6075
+ this.editBuffer.deleteRange(cursor.row, 0, cursor.row, cursor.col);
6076
+ }
6077
+ this.requestRender();
6078
+ return true;
6079
+ }
6068
6080
  undo() {
6069
6081
  this._ctx.clearSelection();
6070
6082
  this.editBuffer.undo();
@@ -6405,5 +6417,5 @@ export {
6405
6417
  ASCIIFont
6406
6418
  };
6407
6419
 
6408
- //# debugId=33D29679C10495BA64756E2164756E21
6420
+ //# debugId=1245366BCDEC541D64756E2164756E21
6409
6421
  //# sourceMappingURL=index.js.map