@tui-sandbox/library 12.5.0 → 12.5.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tui-sandbox/library",
3
- "version": "12.5.0",
3
+ "version": "12.5.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mikavilpas/tui-sandbox"
@@ -53,6 +53,7 @@
53
53
  "express": "5.2.1",
54
54
  "neovim": "5.4.0",
55
55
  "prettier": "3.8.3",
56
+ "string-width": "8.2.1",
56
57
  "tsx": "4.21.0",
57
58
  "winston": "3.19.0",
58
59
  "zigpty": "0.1.6",
@@ -66,7 +67,7 @@
66
67
  "cypress": "15.14.1",
67
68
  "nodemon": "3.1.14",
68
69
  "type-fest": "5.6.0",
69
- "vite": "8.0.9",
70
+ "vite": "8.0.10",
70
71
  "vitest": "4.1.5"
71
72
  },
72
73
  "peerDependencies": {
@@ -8,7 +8,7 @@ import type {
8
8
  GenericTerminalBrowserApi,
9
9
  } from "@tui-sandbox/library/browser/neovim-client.js"
10
10
  import type { MyNeovimConfigModification } from "@tui-sandbox/library/client"
11
- import { drawTextBox } from "@tui-sandbox/library/client"
11
+ import { drawTextBox, extractTerminalContent } from "@tui-sandbox/library/client"
12
12
  import type {
13
13
  AllKeys,
14
14
  BlockingCommandClientInput,
@@ -308,19 +308,8 @@ afterEach(function () {
308
308
  /** Read the current terminal content from the xterm.js DOM. */
309
309
  function getTerminalContent(): string | undefined {
310
310
  const rows = Cypress.$("div.xterm-rows > div")
311
- if (rows.length === 0) return undefined
312
-
313
- const lines: string[] = []
314
- rows.each((_, row) => {
315
- lines.push(Cypress.$(row).text())
316
- })
317
-
318
- // Trim trailing empty lines for readability
319
- while (lines.length > 0 && lines[lines.length - 1]?.trim() === "") {
320
- lines.pop()
321
- }
322
-
323
- return lines.length > 0 ? lines.join("\n") : undefined
311
+ const rowTexts = rows.toArray().map(row => Cypress.$(row).text())
312
+ return extractTerminalContent(rowTexts)
324
313
  }
325
314
 
326
315
  // On test failure in headless mode (cypress run / CI), append the terminal