@oxecli/oxe 1.0.36 → 1.0.38

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.
Files changed (2) hide show
  1. package/dist/ui.js +19 -2
  2. package/package.json +1 -1
package/dist/ui.js CHANGED
@@ -615,7 +615,15 @@ function wrapRuns(runs, width) {
615
615
  while (rest.length > 0) {
616
616
  if (curLen >= width)
617
617
  flush();
618
- const take = Math.min(rest.length, width - curLen);
618
+ let take = Math.min(rest.length, width - curLen);
619
+ // Keep normal text readable by wrapping at a word boundary. A single
620
+ // oversized token still falls back to a hard wrap so the frame stays
621
+ // within its width.
622
+ if (take < rest.length && curLen > 0) {
623
+ const lastSpace = rest.slice(0, take).lastIndexOf(" ");
624
+ if (lastSpace > 0)
625
+ take = lastSpace + 1;
626
+ }
619
627
  const chunk = rest.slice(0, take);
620
628
  cur += run.style ? run.style + chunk + "\x1b[0m" : chunk;
621
629
  curLen += take;
@@ -1131,11 +1139,20 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
1131
1139
  pasteBurstTimer = setTimeout(() => {
1132
1140
  pasteBurst = false;
1133
1141
  pasteBurstTimer = null;
1134
- }, 90);
1142
+ }, 500);
1135
1143
  };
1136
1144
  const onKeypress = (str, key) => {
1137
1145
  if (consumeBracketedPaste(str, key))
1138
1146
  return;
1147
+ // A normal typed character after an unbracketed paste ends the fallback
1148
+ // window, so the next Enter can submit immediately. Multi-character
1149
+ // clipboard chunks keep the window alive until their rows arrive.
1150
+ if (pasteBurst && str && str.length === 1 && !key?.ctrl && !key?.meta) {
1151
+ pasteBurst = false;
1152
+ if (pasteBurstTimer)
1153
+ clearTimeout(pasteBurstTimer);
1154
+ pasteBurstTimer = null;
1155
+ }
1139
1156
  if (key && key.ctrl && key.name === "c") {
1140
1157
  settle(new Error("interrupt"), true);
1141
1158
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxecli/oxe",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },