@fusion.dev/helix-terminal 0.236.0 → 0.237.1

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.
@@ -1,5 +1,6 @@
1
1
  import { linesOf } from './lines.js';
2
2
  const stopping = (disposable) => () => disposable.dispose();
3
+ const FAINT = '.xterm .xterm-rows span.xterm-dim:not([class*="xterm-fg-"]) { color: var(--helix-color-foreground-muted); }';
3
4
  const SHOW_CURSOR = '\u001b[?25h';
4
5
  const HIDE_CURSOR = '\u001b[?25l';
5
6
  export const xtermDriver = (terminal, addons = {}) => {
@@ -13,6 +14,21 @@ export const xtermDriver = (terminal, addons = {}) => {
13
14
  smoothScrollDuration: terminal.options.smoothScrollDuration ?? 0,
14
15
  };
15
16
  let cursorShown = true;
17
+ let faint;
18
+ const holdFaint = (held) => {
19
+ if (!held) {
20
+ faint?.remove();
21
+ faint = undefined;
22
+ return;
23
+ }
24
+ const element = terminal.element;
25
+ if (!element || faint?.isConnected) {
26
+ return;
27
+ }
28
+ faint = element.ownerDocument.createElement('style');
29
+ faint.textContent = FAINT;
30
+ element.append(faint);
31
+ };
16
32
  const { fit, search, webLinks } = addons;
17
33
  if (fit) {
18
34
  terminal.loadAddon(fit);
@@ -55,6 +71,7 @@ export const xtermDriver = (terminal, addons = {}) => {
55
71
  options: (options) => {
56
72
  terminal.options.disableStdin = !options.input;
57
73
  terminal.options.minimumContrastRatio = options.contrast;
74
+ holdFaint(options.contrast > 1);
58
75
  terminal.options.screenReaderMode = options.screenReader;
59
76
  terminal.options.cursorBlink = options.motion && made.cursorBlink;
60
77
  terminal.options.smoothScrollDuration = options.motion ? made.smoothScrollDuration : 0;
@@ -77,6 +94,7 @@ export const xtermDriver = (terminal, addons = {}) => {
77
94
  terminal.options.minimumContrastRatio = made.minimumContrastRatio;
78
95
  terminal.options.screenReaderMode = made.screenReaderMode;
79
96
  terminal.options.smoothScrollDuration = made.smoothScrollDuration;
97
+ holdFaint(false);
80
98
  if (!cursorShown) {
81
99
  cursorShown = true;
82
100
  terminal.write(SHOW_CURSOR);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix-terminal",
3
3
  "description": "Connects the Helix Terminal frame to a terminal emulator: xterm.js, or a driver of your own, themed with your tokens.",
4
- "version": "0.236.0",
4
+ "version": "0.237.1",
5
5
  "license": "MIT",
6
6
  "author": "Fusion Development Group",
7
7
  "repository": {
@@ -36,11 +36,11 @@
36
36
  },
37
37
  "bugs": "https://github.com/project-fusion/fusion/issues",
38
38
  "dependencies": {
39
- "@fusion.dev/helix-core": "0.236.0"
39
+ "@fusion.dev/helix-core": "0.237.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@fusion.dev/helix-headless": "0.236.0",
43
- "@fusion.dev/helix-testing": "0.236.0",
42
+ "@fusion.dev/helix-headless": "0.237.1",
43
+ "@fusion.dev/helix-testing": "0.237.1",
44
44
  "@types/bun": "^1.4.4",
45
45
  "@xterm/addon-fit": "^0.11.0",
46
46
  "@xterm/addon-search": "^0.16.0",