@earendil-works/pi-tui 0.87.1 → 0.99.0
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/README.md +41 -3
- package/dist/alt-screen-search.d.ts.map +1 -1
- package/dist/alt-screen-search.js.map +1 -1
- package/dist/autocomplete.d.ts +1 -1
- package/dist/autocomplete.d.ts.map +1 -1
- package/dist/autocomplete.js +28 -8
- package/dist/autocomplete.js.map +1 -1
- package/dist/colors.d.ts +73 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +273 -0
- package/dist/colors.js.map +1 -0
- package/dist/components/alt-screen-flash.d.ts.map +1 -1
- package/dist/components/alt-screen-flash.js.map +1 -1
- package/dist/components/box.d.ts.map +1 -1
- package/dist/components/box.js +8 -8
- package/dist/components/box.js.map +1 -1
- package/dist/components/cancellable-loader.d.ts.map +1 -1
- package/dist/components/cancellable-loader.js.map +1 -1
- package/dist/components/editor.d.ts.map +1 -1
- package/dist/components/editor.js +4 -2
- package/dist/components/editor.js.map +1 -1
- package/dist/components/h-stack.d.ts.map +1 -1
- package/dist/components/h-stack.js.map +1 -1
- package/dist/components/image.d.ts.map +1 -1
- package/dist/components/image.js.map +1 -1
- package/dist/components/input.d.ts.map +1 -1
- package/dist/components/input.js.map +1 -1
- package/dist/components/loader.d.ts.map +1 -1
- package/dist/components/loader.js.map +1 -1
- package/dist/components/markdown.d.ts +1 -0
- package/dist/components/markdown.d.ts.map +1 -1
- package/dist/components/markdown.js +8 -2
- package/dist/components/markdown.js.map +1 -1
- package/dist/components/mouse-region.d.ts.map +1 -1
- package/dist/components/mouse-region.js.map +1 -1
- package/dist/components/scroll-view.d.ts.map +1 -1
- package/dist/components/scroll-view.js.map +1 -1
- package/dist/components/select-list.d.ts.map +1 -1
- package/dist/components/select-list.js.map +1 -1
- package/dist/components/settings-list.d.ts.map +1 -1
- package/dist/components/settings-list.js.map +1 -1
- package/dist/components/spacer.d.ts.map +1 -1
- package/dist/components/spacer.js.map +1 -1
- package/dist/components/stack.d.ts.map +1 -1
- package/dist/components/stack.js.map +1 -1
- package/dist/components/text.d.ts.map +1 -1
- package/dist/components/text.js.map +1 -1
- package/dist/components/truncated-text.d.ts.map +1 -1
- package/dist/components/truncated-text.js.map +1 -1
- package/dist/components/v-stack.d.ts.map +1 -1
- package/dist/components/v-stack.js.map +1 -1
- package/dist/editor-component.d.ts.map +1 -1
- package/dist/fuzzy.d.ts.map +1 -1
- package/dist/fuzzy.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/keybindings.d.ts.map +1 -1
- package/dist/keybindings.js.map +1 -1
- package/dist/keys.d.ts.map +1 -1
- package/dist/keys.js.map +1 -1
- package/dist/kill-ring.d.ts.map +1 -1
- package/dist/kill-ring.js.map +1 -1
- package/dist/latex.d.ts.map +1 -1
- package/dist/latex.js.map +1 -1
- package/dist/layout-node.d.ts.map +1 -1
- package/dist/layout-node.js.map +1 -1
- package/dist/layout.d.ts.map +1 -1
- package/dist/layout.js.map +1 -1
- package/dist/native-modifiers.d.ts.map +1 -1
- package/dist/native-modifiers.js.map +1 -1
- package/dist/native-module-path.d.ts.map +1 -1
- package/dist/native-module-path.js.map +1 -1
- package/dist/native-platform.d.ts +2 -0
- package/dist/native-platform.d.ts.map +1 -1
- package/dist/native-platform.js.map +1 -1
- package/dist/oklab.d.ts +43 -0
- package/dist/oklab.d.ts.map +1 -0
- package/dist/oklab.js +210 -0
- package/dist/oklab.js.map +1 -0
- package/dist/stdin-buffer.d.ts.map +1 -1
- package/dist/stdin-buffer.js.map +1 -1
- package/dist/terminal-colors.d.ts +19 -2
- package/dist/terminal-colors.d.ts.map +1 -1
- package/dist/terminal-colors.js +12 -7
- package/dist/terminal-colors.js.map +1 -1
- package/dist/terminal-image.d.ts +3 -1
- package/dist/terminal-image.d.ts.map +1 -1
- package/dist/terminal-image.js +33 -9
- package/dist/terminal-image.js.map +1 -1
- package/dist/terminal.d.ts +3 -0
- package/dist/terminal.d.ts.map +1 -1
- package/dist/terminal.js +15 -8
- package/dist/terminal.js.map +1 -1
- package/dist/tui-alt-screen.d.ts +8 -4
- package/dist/tui-alt-screen.d.ts.map +1 -1
- package/dist/tui-alt-screen.js +13 -12
- package/dist/tui-alt-screen.js.map +1 -1
- package/dist/tui-main-screen.d.ts.map +1 -1
- package/dist/tui-main-screen.js.map +1 -1
- package/dist/tui.d.ts +23 -22
- package/dist/tui.d.ts.map +1 -1
- package/dist/tui.js +85 -66
- package/dist/tui.js.map +1 -1
- package/dist/undo-stack.d.ts.map +1 -1
- package/dist/undo-stack.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +99 -55
- package/dist/utils.js.map +1 -1
- package/dist/wheel-scroll.d.ts +23 -0
- package/dist/wheel-scroll.d.ts.map +1 -0
- package/dist/wheel-scroll.js +73 -0
- package/dist/wheel-scroll.js.map +1 -0
- package/dist/word-navigation.d.ts.map +1 -1
- package/dist/word-navigation.js.map +1 -1
- package/native/clipboard.h +40 -2
- package/native/darwin/README.md +1 -1
- package/native/darwin/prebuilds/darwin-arm64/darwin-platform.node +0 -0
- package/native/darwin/prebuilds/darwin-x64/darwin-platform.node +0 -0
- package/native/darwin/src/darwin-platform.m +39 -0
- package/native/napi.h +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Lines moved per mouse-wheel event, or `"auto"` to accelerate fast wheel spins. */
|
|
2
|
+
export type WheelScrollLines = number | "auto";
|
|
3
|
+
/**
|
|
4
|
+
* Converts wheel events into line counts.
|
|
5
|
+
*
|
|
6
|
+
* In `"auto"` mode on terminals that do not accelerate wheel input, the count follows event
|
|
7
|
+
* velocity: an isolated notch moves one line, while a fast spin moves up to six lines per event.
|
|
8
|
+
* For example, notches 100 ms apart move 1 line each, 50 ms apart move 2, and 20 ms apart move 5.
|
|
9
|
+
*/
|
|
10
|
+
export declare class WheelScrollAccelerator {
|
|
11
|
+
private lines;
|
|
12
|
+
private readonly accelerate;
|
|
13
|
+
private lastTime;
|
|
14
|
+
private lastDirection;
|
|
15
|
+
private averageGap;
|
|
16
|
+
private carry;
|
|
17
|
+
constructor(lines?: WheelScrollLines, accelerate?: boolean);
|
|
18
|
+
setLines(lines: WheelScrollLines): void;
|
|
19
|
+
/** Return the positive line count for a wheel event in `direction` at time `now` (milliseconds). */
|
|
20
|
+
next(direction: -1 | 1, now: number): number;
|
|
21
|
+
private reset;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=wheel-scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wheel-scroll.d.ts","sourceRoot":"","sources":["../src/wheel-scroll.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAAC;AA0B/C;;;;;;GAMG;AACH,qBAAa,sBAAsB;IAClC,OAAO,CAAC,KAAK,CAAmB;IAChC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAU;IACrC,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,KAAK,CAAK;IAElB,YAAY,KAAK,GAAE,gBAAyB,EAAE,UAAU,UAA8B,EAGrF;IAED,QAAQ,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI,CAGtC;IAED,oGAAoG;IACpG,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAoB3C;IAED,OAAO,CAAC,KAAK;CAMb"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Several events closer than this belong to one physical notch (Ghostty emits them ~4 ms apart)
|
|
2
|
+
// or come from a high-resolution source. They move one line each and do not accelerate.
|
|
3
|
+
const BURST_GAP_MS = 5;
|
|
4
|
+
// A pause longer than this ends a scroll gesture.
|
|
5
|
+
const GESTURE_GAP_MS = 200;
|
|
6
|
+
// Average event gap that maps to one line per event. Faster events scale up proportionally.
|
|
7
|
+
const REFERENCE_GAP_MS = 100;
|
|
8
|
+
const MAX_AUTO_LINES = 6;
|
|
9
|
+
/**
|
|
10
|
+
* Local macOS terminals receive wheel and trackpad deltas that the OS has already accelerated,
|
|
11
|
+
* and they emit one event per line. Other platforms, and SSH sessions where the client platform
|
|
12
|
+
* is unknown, usually send one event per wheel notch.
|
|
13
|
+
*/
|
|
14
|
+
function terminalAcceleratesWheel() {
|
|
15
|
+
const env = process.env;
|
|
16
|
+
return (process.platform === "darwin" &&
|
|
17
|
+
env.SSH_CONNECTION === undefined &&
|
|
18
|
+
env.SSH_CLIENT === undefined &&
|
|
19
|
+
env.SSH_TTY === undefined);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Converts wheel events into line counts.
|
|
23
|
+
*
|
|
24
|
+
* In `"auto"` mode on terminals that do not accelerate wheel input, the count follows event
|
|
25
|
+
* velocity: an isolated notch moves one line, while a fast spin moves up to six lines per event.
|
|
26
|
+
* For example, notches 100 ms apart move 1 line each, 50 ms apart move 2, and 20 ms apart move 5.
|
|
27
|
+
*/
|
|
28
|
+
export class WheelScrollAccelerator {
|
|
29
|
+
lines;
|
|
30
|
+
accelerate;
|
|
31
|
+
lastTime = Number.NEGATIVE_INFINITY;
|
|
32
|
+
lastDirection = 0;
|
|
33
|
+
averageGap;
|
|
34
|
+
carry = 0;
|
|
35
|
+
constructor(lines = "auto", accelerate = !terminalAcceleratesWheel()) {
|
|
36
|
+
this.lines = lines;
|
|
37
|
+
this.accelerate = accelerate;
|
|
38
|
+
}
|
|
39
|
+
setLines(lines) {
|
|
40
|
+
this.lines = lines;
|
|
41
|
+
this.reset();
|
|
42
|
+
}
|
|
43
|
+
/** Return the positive line count for a wheel event in `direction` at time `now` (milliseconds). */
|
|
44
|
+
next(direction, now) {
|
|
45
|
+
if (this.lines !== "auto")
|
|
46
|
+
return Number.isFinite(this.lines) ? Math.max(1, Math.floor(this.lines)) : 1;
|
|
47
|
+
if (!this.accelerate)
|
|
48
|
+
return 1;
|
|
49
|
+
const gap = now - this.lastTime;
|
|
50
|
+
const sameGesture = direction === this.lastDirection && gap <= GESTURE_GAP_MS;
|
|
51
|
+
this.lastTime = now;
|
|
52
|
+
this.lastDirection = direction;
|
|
53
|
+
if (!sameGesture) {
|
|
54
|
+
this.averageGap = undefined;
|
|
55
|
+
this.carry = 0;
|
|
56
|
+
return 1;
|
|
57
|
+
}
|
|
58
|
+
if (gap < BURST_GAP_MS)
|
|
59
|
+
return 1;
|
|
60
|
+
this.averageGap = this.averageGap === undefined ? gap : (this.averageGap + gap) / 2;
|
|
61
|
+
const lines = Math.min(MAX_AUTO_LINES, Math.max(1, REFERENCE_GAP_MS / this.averageGap)) + this.carry;
|
|
62
|
+
const whole = Math.floor(lines);
|
|
63
|
+
this.carry = lines - whole;
|
|
64
|
+
return whole;
|
|
65
|
+
}
|
|
66
|
+
reset() {
|
|
67
|
+
this.lastTime = Number.NEGATIVE_INFINITY;
|
|
68
|
+
this.lastDirection = 0;
|
|
69
|
+
this.averageGap = undefined;
|
|
70
|
+
this.carry = 0;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=wheel-scroll.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wheel-scroll.js","sourceRoot":"","sources":["../src/wheel-scroll.ts"],"names":[],"mappings":"AAGA,gGAAgG;AAChG,wFAAwF;AACxF,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,kDAAkD;AAClD,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,4FAA4F;AAC5F,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAC7B,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB;;;;GAIG;AACH,SAAS,wBAAwB;IAChC,MAAM,GAAG,GAAG,OAAO,CAAC,GAA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AAI,CAAC,aAAa,GAAG,SAAS,CAAC;QAC/B,IAAI,CAAC,WAAW,EAAE,CAAC;YAClB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;YAC5B,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;YACf,OAAO,CAAC,CAAC;QACV,CAAC;QACD,IAAI,GAAG,GAAG,YAAY;YAAE,OAAO,CAAC,CAAC;QAEjC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACpF,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC;QACrG,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;QAC3B,OAAO,KAAK,CAAC;IACd,CAAC;IAEO,KAAK;QACZ,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,iBAAiB,CAAC;QACzC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IAChB,CAAC;CACD","sourcesContent":["/** Lines moved per mouse-wheel event, or `\"auto\"` to accelerate fast wheel spins. */\nexport type WheelScrollLines = number | \"auto\";\n\n// Several events closer than this belong to one physical notch (Ghostty emits them ~4 ms apart)\n// or come from a high-resolution source. They move one line each and do not accelerate.\nconst BURST_GAP_MS = 5;\n// A pause longer than this ends a scroll gesture.\nconst GESTURE_GAP_MS = 200;\n// Average event gap that maps to one line per event. Faster events scale up proportionally.\nconst REFERENCE_GAP_MS = 100;\nconst MAX_AUTO_LINES = 6;\n\n/**\n * Local macOS terminals receive wheel and trackpad deltas that the OS has already accelerated,\n * and they emit one event per line. Other platforms, and SSH sessions where the client platform\n * is unknown, usually send one event per wheel notch.\n */\nfunction terminalAcceleratesWheel(): boolean {\n\tconst env = process.env;\n\treturn (\n\t\tprocess.platform === \"darwin\" &&\n\t\tenv.SSH_CONNECTION === undefined &&\n\t\tenv.SSH_CLIENT === undefined &&\n\t\tenv.SSH_TTY === undefined\n\t);\n}\n\n/**\n * Converts wheel events into line counts.\n *\n * In `\"auto\"` mode on terminals that do not accelerate wheel input, the count follows event\n * velocity: an isolated notch moves one line, while a fast spin moves up to six lines per event.\n * For example, notches 100 ms apart move 1 line each, 50 ms apart move 2, and 20 ms apart move 5.\n */\nexport class WheelScrollAccelerator {\n\tprivate lines: WheelScrollLines;\n\tprivate readonly accelerate: boolean;\n\tprivate lastTime = Number.NEGATIVE_INFINITY;\n\tprivate lastDirection = 0;\n\tprivate averageGap: number | undefined;\n\tprivate carry = 0;\n\n\tconstructor(lines: WheelScrollLines = \"auto\", accelerate = !terminalAcceleratesWheel()) {\n\t\tthis.lines = lines;\n\t\tthis.accelerate = accelerate;\n\t}\n\n\tsetLines(lines: WheelScrollLines): void {\n\t\tthis.lines = lines;\n\t\tthis.reset();\n\t}\n\n\t/** Return the positive line count for a wheel event in `direction` at time `now` (milliseconds). */\n\tnext(direction: -1 | 1, now: number): number {\n\t\tif (this.lines !== \"auto\") return Number.isFinite(this.lines) ? Math.max(1, Math.floor(this.lines)) : 1;\n\t\tif (!this.accelerate) return 1;\n\n\t\tconst gap = now - this.lastTime;\n\t\tconst sameGesture = direction === this.lastDirection && gap <= GESTURE_GAP_MS;\n\t\tthis.lastTime = now;\n\t\tthis.lastDirection = direction;\n\t\tif (!sameGesture) {\n\t\t\tthis.averageGap = undefined;\n\t\t\tthis.carry = 0;\n\t\t\treturn 1;\n\t\t}\n\t\tif (gap < BURST_GAP_MS) return 1;\n\n\t\tthis.averageGap = this.averageGap === undefined ? gap : (this.averageGap + gap) / 2;\n\t\tconst lines = Math.min(MAX_AUTO_LINES, Math.max(1, REFERENCE_GAP_MS / this.averageGap)) + this.carry;\n\t\tconst whole = Math.floor(lines);\n\t\tthis.carry = lines - whole;\n\t\treturn whole;\n\t}\n\n\tprivate reset(): void {\n\t\tthis.lastTime = Number.NEGATIVE_INFINITY;\n\t\tthis.lastDirection = 0;\n\t\tthis.averageGap = undefined;\n\t\tthis.carry = 0;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"word-navigation.d.ts","sourceRoot":"","sources":["../src/word-navigation.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACrC,mEAAmE;IACnE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACvD,yGAAyG;IACzG,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAgDtG;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAuCrG"
|
|
1
|
+
{"version":3,"file":"word-navigation.d.ts","sourceRoot":"","sources":["../src/word-navigation.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACrC,mEAAmE;IACnE,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACvD,yGAAyG;IACzG,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAgDtG;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,CAuCrG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"word-navigation.js","sourceRoot":"","sources":["../src/word-navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEnF,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAazC;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,MAAc,EAAE,OAA+B
|
|
1
|
+
{"version":3,"file":"word-navigation.js","sourceRoot":"","sources":["../src/word-navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEnF,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;AAazC;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,MAAc,EAAE,OAA+B;IAC7F,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IAE1B,MAAM,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IAC/C,MAAM,SAAS,GAAG,OAAO,EAAE,OAAO,CAAC;IACnC,MAAM,QAAQ,GAAG,OAAO,EAAE,eAAe,CAAC;IAC1C,MAAM,QAAQ,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,gBAAgB,CAAC,CAAC,CAAC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B,CAAC","sourcesContent":["import { getWordSegmenter, isWhitespaceChar, PUNCTUATION_REGEX } from \"./utils.ts\";\n\nconst wordSegmenter = getWordSegmenter();\n\n/**\n * Options for word navigation functions.\n * When omitted, uses the default Intl.Segmenter word segmentation.\n */\nexport interface WordNavigationOptions {\n\t/** Custom segmenter returning word segments for the given text. */\n\tsegment?: (text: string) => Iterable<Intl.SegmentData>;\n\t/** Predicate identifying atomic segments that should be treated as single units (e.g. paste markers). */\n\tisAtomicSegment?: (segment: string) => boolean;\n}\n\n/**\n * Find the cursor position after moving one word backward from `cursor` in `text`.\n * Skips trailing whitespace, then stops at the next word/punctuation boundary.\n *\n * Pure function - does not mutate any state.\n */\nexport function findWordBackward(text: string, cursor: number, options?: WordNavigationOptions): number {\n\tif (cursor <= 0) return 0;\n\n\tconst textBeforeCursor = text.slice(0, cursor);\n\tconst segmentFn = options?.segment;\n\tconst isAtomic = options?.isAtomicSegment;\n\tconst segments = segmentFn ? [...segmentFn(textBeforeCursor)] : [...wordSegmenter.segment(textBeforeCursor)];\n\tlet newCursor = cursor;\n\n\t// Skip trailing whitespace\n\twhile (\n\t\tsegments.length > 0 &&\n\t\t!isAtomic?.(segments[segments.length - 1]?.segment || \"\") &&\n\t\tisWhitespaceChar(segments[segments.length - 1]?.segment || \"\")\n\t) {\n\t\tnewCursor -= segments.pop()?.segment.length || 0;\n\t}\n\n\tif (segments.length === 0) return newCursor;\n\n\tconst last = segments[segments.length - 1]!;\n\n\tif (isAtomic?.(last.segment)) {\n\t\t// Skip one atomic segment.\n\t\tnewCursor -= last.segment.length;\n\t} else if (last.isWordLike) {\n\t\t// Skip inside one word-like segment, preserving ASCII punctuation boundaries.\n\t\tconst segment = last.segment;\n\t\tconst matches = [...segment.matchAll(new RegExp(PUNCTUATION_REGEX, \"g\"))];\n\t\tif (matches.length <= 0) {\n\t\t\tnewCursor -= segment.length;\n\t\t} else {\n\t\t\tconst lastMatch = matches[matches.length - 1]!;\n\t\t\tnewCursor -= segment.length - (lastMatch.index + lastMatch[0].length);\n\t\t}\n\t} else {\n\t\t// Skip non-word non-whitespace run (punctuation)\n\t\twhile (\n\t\t\tsegments.length > 0 &&\n\t\t\t!isAtomic?.(segments[segments.length - 1]?.segment || \"\") &&\n\t\t\t!segments[segments.length - 1]?.isWordLike &&\n\t\t\t!isWhitespaceChar(segments[segments.length - 1]?.segment || \"\")\n\t\t) {\n\t\t\tnewCursor -= segments.pop()?.segment.length || 0;\n\t\t}\n\t}\n\n\treturn newCursor;\n}\n\n/**\n * Find the cursor position after moving one word forward from `cursor` in `text`.\n * Skips leading whitespace, then stops at the next word/punctuation boundary.\n *\n * Pure function - does not mutate any state.\n */\nexport function findWordForward(text: string, cursor: number, options?: WordNavigationOptions): number {\n\tif (cursor >= text.length) return text.length;\n\n\tconst textAfterCursor = text.slice(cursor);\n\tconst segmentFn = options?.segment;\n\tconst isAtomic = options?.isAtomicSegment;\n\tconst segments = segmentFn ? segmentFn(textAfterCursor) : wordSegmenter.segment(textAfterCursor);\n\tconst iterator = segments[Symbol.iterator]();\n\tlet next = iterator.next();\n\tlet newCursor = cursor;\n\n\t// Skip leading whitespace\n\twhile (!next.done && !isAtomic?.(next.value.segment) && isWhitespaceChar(next.value.segment)) {\n\t\tnewCursor += next.value.segment.length;\n\t\tnext = iterator.next();\n\t}\n\n\tif (next.done) return newCursor;\n\n\tif (isAtomic?.(next.value.segment)) {\n\t\t// Skip one atomic segment.\n\t\tnewCursor += next.value.segment.length;\n\t} else if (next.value.isWordLike) {\n\t\t// Skip inside one word-like segment, preserving ASCII punctuation boundaries.\n\t\tnewCursor += PUNCTUATION_REGEX.exec(next.value.segment)?.index ?? next.value.segment.length;\n\t} else {\n\t\t// Skip non-word non-whitespace run (punctuation)\n\t\twhile (\n\t\t\t!next.done &&\n\t\t\t!isAtomic?.(next.value.segment) &&\n\t\t\t!next.value.isWordLike &&\n\t\t\t!isWhitespaceChar(next.value.segment)\n\t\t) {\n\t\t\tnewCursor += next.value.segment.length;\n\t\t\tnext = iterator.next();\n\t\t}\n\t}\n\n\treturn newCursor;\n}\n"]}
|
package/native/clipboard.h
CHANGED
|
@@ -7,8 +7,17 @@
|
|
|
7
7
|
#include <string.h>
|
|
8
8
|
#endif
|
|
9
9
|
|
|
10
|
-
typedef enum { CLIPBOARD_TEXT, CLIPBOARD_IMAGE, CLIPBOARD_WRITE } clipboard_operation;
|
|
11
|
-
|
|
10
|
+
typedef enum { CLIPBOARD_TEXT, CLIPBOARD_IMAGE, CLIPBOARD_WRITE, CLIPBOARD_FILES } clipboard_operation;
|
|
11
|
+
// CLIPBOARD_PATHS stores concatenated, NUL-terminated UTF-8 paths in clipboard_job.data.
|
|
12
|
+
typedef enum {
|
|
13
|
+
CLIPBOARD_UNAVAILABLE,
|
|
14
|
+
CLIPBOARD_EMPTY,
|
|
15
|
+
CLIPBOARD_UTF8,
|
|
16
|
+
CLIPBOARD_LATIN1,
|
|
17
|
+
CLIPBOARD_UTF16,
|
|
18
|
+
CLIPBOARD_BUFFER,
|
|
19
|
+
CLIPBOARD_PATHS
|
|
20
|
+
} clipboard_format;
|
|
12
21
|
|
|
13
22
|
typedef struct {
|
|
14
23
|
napi_async_work work;
|
|
@@ -63,6 +72,33 @@ static void PI_NAPI_CALL execute_clipboard_work(napi_env env, void* data) {
|
|
|
63
72
|
clipboard_execute(data);
|
|
64
73
|
}
|
|
65
74
|
|
|
75
|
+
static int create_clipboard_paths_value(
|
|
76
|
+
napi_env env,
|
|
77
|
+
const clipboard_job* job,
|
|
78
|
+
napi_create_string_utf8_fn create_string,
|
|
79
|
+
napi_value* result
|
|
80
|
+
) {
|
|
81
|
+
napi_create_array_fn create_array = (napi_create_array_fn)node_symbol("napi_create_array");
|
|
82
|
+
napi_set_element_fn set_element = (napi_set_element_fn)node_symbol("napi_set_element");
|
|
83
|
+
if (!create_array || !set_element || create_array(env, result) != 0) return 1;
|
|
84
|
+
|
|
85
|
+
const char* cursor = job->data;
|
|
86
|
+
const char* end = cursor + job->length;
|
|
87
|
+
for (uint32_t index = 0; cursor < end; index++) {
|
|
88
|
+
const char* terminator = cursor;
|
|
89
|
+
while (terminator < end && *terminator != '\0') terminator++;
|
|
90
|
+
if (terminator == end) return 1;
|
|
91
|
+
|
|
92
|
+
napi_value item = 0;
|
|
93
|
+
if (create_string(env, cursor, (size_t)(terminator - cursor), &item) != 0 ||
|
|
94
|
+
set_element(env, *result, index, item) != 0) {
|
|
95
|
+
return 1;
|
|
96
|
+
}
|
|
97
|
+
cursor = terminator + 1;
|
|
98
|
+
}
|
|
99
|
+
return 0;
|
|
100
|
+
}
|
|
101
|
+
|
|
66
102
|
static void PI_NAPI_CALL complete_clipboard_work(napi_env env, int status, void* data) {
|
|
67
103
|
clipboard_job* job = data;
|
|
68
104
|
napi_create_string_utf8_fn create_string = (napi_create_string_utf8_fn)node_symbol("napi_create_string_utf8");
|
|
@@ -71,6 +107,8 @@ static void PI_NAPI_CALL complete_clipboard_work(napi_env env, int status, void*
|
|
|
71
107
|
if (!job->error && job->operation != CLIPBOARD_WRITE) {
|
|
72
108
|
if (job->format == CLIPBOARD_EMPTY) {
|
|
73
109
|
result = null_value(env);
|
|
110
|
+
} else if (job->format == CLIPBOARD_PATHS) {
|
|
111
|
+
status = create_clipboard_paths_value(env, job, create_string, &result);
|
|
74
112
|
} else if (job->format == CLIPBOARD_BUFFER) {
|
|
75
113
|
napi_create_buffer_copy_fn create_buffer = (napi_create_buffer_copy_fn)node_symbol("napi_create_buffer_copy");
|
|
76
114
|
status = create_buffer(env, job->length, job->data, 0, &result);
|
package/native/darwin/README.md
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -66,6 +66,40 @@ static void clipboard_execute(clipboard_job* job) {
|
|
|
66
66
|
} else {
|
|
67
67
|
clipboard_copy(job, text.UTF8String, [text lengthOfBytesUsingEncoding:NSUTF8StringEncoding], CLIPBOARD_UTF8);
|
|
68
68
|
}
|
|
69
|
+
} else if (job->operation == CLIPBOARD_FILES) {
|
|
70
|
+
NSArray* urls = [pasteboard readObjectsForClasses:@[[NSURL class]]
|
|
71
|
+
options:@{NSPasteboardURLReadingFileURLsOnlyKey: @YES}];
|
|
72
|
+
size_t total = 0;
|
|
73
|
+
for (NSURL* url in urls) {
|
|
74
|
+
const char* path = url.fileSystemRepresentation;
|
|
75
|
+
if (!path) continue;
|
|
76
|
+
size_t length = strlen(path);
|
|
77
|
+
if (length == SIZE_MAX || total > SIZE_MAX - length - 1) {
|
|
78
|
+
job->error = "Clipboard file paths are too large";
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
total += length + 1;
|
|
82
|
+
}
|
|
83
|
+
if (total == 0) {
|
|
84
|
+
job->format = CLIPBOARD_EMPTY;
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
char* paths = clipboard_alloc(total);
|
|
88
|
+
if (!paths) {
|
|
89
|
+
job->error = "Out of memory";
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
char* cursor = paths;
|
|
93
|
+
for (NSURL* url in urls) {
|
|
94
|
+
const char* path = url.fileSystemRepresentation;
|
|
95
|
+
if (!path) continue;
|
|
96
|
+
size_t length = strlen(path);
|
|
97
|
+
memcpy(cursor, path, length + 1);
|
|
98
|
+
cursor += length + 1;
|
|
99
|
+
}
|
|
100
|
+
job->data = paths;
|
|
101
|
+
job->length = total;
|
|
102
|
+
job->format = CLIPBOARD_PATHS;
|
|
69
103
|
} else {
|
|
70
104
|
if (![pasteboard availableTypeFromArray:@[ NSPasteboardTypePNG, NSPasteboardTypeTIFF ]]) {
|
|
71
105
|
job->format = CLIPBOARD_EMPTY;
|
|
@@ -84,10 +118,15 @@ static void clipboard_execute(clipboard_job* job) {
|
|
|
84
118
|
}
|
|
85
119
|
}
|
|
86
120
|
|
|
121
|
+
static napi_value PI_NAPI_CALL get_clipboard_file_paths(napi_env env, napi_callback_info info) {
|
|
122
|
+
return queue_clipboard(env, info, CLIPBOARD_FILES);
|
|
123
|
+
}
|
|
124
|
+
|
|
87
125
|
PI_NAPI_EXPORT napi_value napi_register_module_v1(napi_env env, napi_value exports) {
|
|
88
126
|
set_function_export(env, exports, "isModifierPressed", is_modifier_pressed);
|
|
89
127
|
set_function_export(env, exports, "getText", get_clipboard_text);
|
|
90
128
|
set_function_export(env, exports, "setText", set_clipboard_text);
|
|
91
129
|
set_function_export(env, exports, "getImage", get_clipboard_image);
|
|
130
|
+
set_function_export(env, exports, "getFilePaths", get_clipboard_file_paths);
|
|
92
131
|
return exports;
|
|
93
132
|
}
|
package/native/napi.h
CHANGED
|
@@ -26,6 +26,7 @@ typedef void* napi_deferred;
|
|
|
26
26
|
typedef void (PI_NAPI_CALL *napi_async_execute_callback)(napi_env, void*);
|
|
27
27
|
typedef void (PI_NAPI_CALL *napi_async_complete_callback)(napi_env, int, void*);
|
|
28
28
|
typedef int (PI_NAPI_CALL *napi_create_async_work_fn)(napi_env, napi_value, napi_value, napi_async_execute_callback, napi_async_complete_callback, void*, napi_async_work*);
|
|
29
|
+
typedef int (PI_NAPI_CALL *napi_create_array_fn)(napi_env, napi_value*);
|
|
29
30
|
typedef int (PI_NAPI_CALL *napi_async_work_fn)(napi_env, napi_async_work);
|
|
30
31
|
typedef int (PI_NAPI_CALL *napi_create_promise_fn)(napi_env, napi_deferred*, napi_value*);
|
|
31
32
|
typedef int (PI_NAPI_CALL *napi_settle_deferred_fn)(napi_env, napi_deferred, napi_value);
|
|
@@ -41,6 +42,7 @@ typedef int (PI_NAPI_CALL *napi_get_value_fn)(napi_env, napi_value*);
|
|
|
41
42
|
typedef int (PI_NAPI_CALL *napi_get_value_string_utf8_fn)(napi_env, napi_value, char*, size_t, size_t*);
|
|
42
43
|
typedef int (PI_NAPI_CALL *napi_get_value_string_utf16_fn)(napi_env, napi_value, uint16_t*, size_t, size_t*);
|
|
43
44
|
typedef int (PI_NAPI_CALL *napi_set_named_property_fn)(napi_env, napi_value, const char*, napi_value);
|
|
45
|
+
typedef int (PI_NAPI_CALL *napi_set_element_fn)(napi_env, napi_value, uint32_t, napi_value);
|
|
44
46
|
typedef int (PI_NAPI_CALL *napi_throw_error_fn)(napi_env, const char*, const char*);
|
|
45
47
|
|
|
46
48
|
static void* node_symbol(const char* name) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@earendil-works/pi-tui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.99.0",
|
|
4
4
|
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"clean": "shx rm -rf dist",
|
|
9
|
-
"build": "
|
|
9
|
+
"build": "tsc -p tsconfig.build.json",
|
|
10
10
|
"build:native:darwin": "native/darwin/build.sh",
|
|
11
11
|
"build:native:linux": "native/linux/build.sh",
|
|
12
12
|
"build:native:win32": "node native/win32/build.mjs",
|