@teaui/core 1.17.16 → 1.19.16

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 (72) hide show
  1. package/.dist/Buffer.d.ts +5 -0
  2. package/.dist/Buffer.js +47 -5
  3. package/.dist/Buffer.js.map +1 -1
  4. package/.dist/Screen.d.ts +17 -4
  5. package/.dist/Screen.js +90 -44
  6. package/.dist/Screen.js.map +1 -1
  7. package/.dist/StringTerminal.d.ts +2 -2
  8. package/.dist/StringTerminal.js +34 -26
  9. package/.dist/StringTerminal.js.map +1 -1
  10. package/.dist/Style.d.ts +9 -1
  11. package/.dist/Style.js +69 -23
  12. package/.dist/Style.js.map +1 -1
  13. package/.dist/TerminalProgram.js +4 -2
  14. package/.dist/TerminalProgram.js.map +1 -1
  15. package/.dist/TestScreen.js +8 -4
  16. package/.dist/TestScreen.js.map +1 -1
  17. package/.dist/TestTerminal.js +23 -13
  18. package/.dist/TestTerminal.js.map +1 -1
  19. package/.dist/Viewport.js +7 -3
  20. package/.dist/Viewport.js.map +1 -1
  21. package/.dist/ansi.d.ts +1 -0
  22. package/.dist/ansi.js +2 -0
  23. package/.dist/ansi.js.map +1 -1
  24. package/.dist/components/AbstractLegend.js +10 -5
  25. package/.dist/components/AbstractLegend.js.map +1 -1
  26. package/.dist/components/At.js +8 -4
  27. package/.dist/components/At.js.map +1 -1
  28. package/.dist/components/Box.js +4 -2
  29. package/.dist/components/Box.js.map +1 -1
  30. package/.dist/components/Calendar.js +14 -7
  31. package/.dist/components/Calendar.js.map +1 -1
  32. package/.dist/components/Canvas.js +20 -10
  33. package/.dist/components/Canvas.js.map +1 -1
  34. package/.dist/components/Drawer.d.ts +3 -0
  35. package/.dist/components/Drawer.js +104 -41
  36. package/.dist/components/Drawer.js.map +1 -1
  37. package/.dist/components/Input.js +2 -1
  38. package/.dist/components/Input.js.map +1 -1
  39. package/.dist/components/Logo.js +4 -2
  40. package/.dist/components/Logo.js.map +1 -1
  41. package/.dist/components/Notification.js +2 -1
  42. package/.dist/components/Notification.js.map +1 -1
  43. package/.dist/components/Page.js +14 -7
  44. package/.dist/components/Page.js.map +1 -1
  45. package/.dist/components/Pane.js +6 -3
  46. package/.dist/components/Pane.js.map +1 -1
  47. package/.dist/components/Plot.js +16 -8
  48. package/.dist/components/Plot.js.map +1 -1
  49. package/.dist/components/Slider.js +2 -1
  50. package/.dist/components/Slider.js.map +1 -1
  51. package/.dist/components/Tabs.js +2 -1
  52. package/.dist/components/Tabs.js.map +1 -1
  53. package/.dist/components/Text.js +36 -25
  54. package/.dist/components/Text.js.map +1 -1
  55. package/.dist/components/ZStack.js +8 -4
  56. package/.dist/components/ZStack.js.map +1 -1
  57. package/.dist/components/charts/BarChart.js +18 -9
  58. package/.dist/components/charts/BarChart.js.map +1 -1
  59. package/.dist/components/charts/Chart.js +2 -1
  60. package/.dist/components/charts/Chart.js.map +1 -1
  61. package/.dist/components/charts/LineChart.js +26 -13
  62. package/.dist/components/charts/LineChart.js.map +1 -1
  63. package/.dist/events/key.js +8 -4
  64. package/.dist/events/key.js.map +1 -1
  65. package/.dist/events/translate.js +8 -4
  66. package/.dist/events/translate.js.map +1 -1
  67. package/.dist/geometry.js +2 -1
  68. package/.dist/geometry.js.map +1 -1
  69. package/.dist/index.d.ts +2 -0
  70. package/.dist/index.js.map +1 -1
  71. package/.dist/types.d.ts +6 -6
  72. package/package.json +4 -4
package/.dist/types.d.ts CHANGED
@@ -31,11 +31,16 @@ export interface ScreenOptions {
31
31
  display?: ScreenDisplay;
32
32
  }
33
33
  export type Unsubscribe = () => void;
34
+ /** The input side of a Program, independent of rendering or transport lifecycle. */
35
+ export interface EventSource {
36
+ /** Subscribe to system events. Returns a function that detaches this listener. */
37
+ onEvents(listener: (event: SystemEvent) => void): Unsubscribe;
38
+ }
34
39
  /**
35
40
  * The abstract interface that Screen depends on. Any terminal backend
36
41
  * (real terminal, test harness, web adapter, etc.) can implement this.
37
42
  */
38
- export interface Program extends SGRTerminal {
43
+ export interface Program extends SGRTerminal, EventSource {
39
44
  /**
40
45
  * Prepare the terminal for application mode (e.g. configure the display,
41
46
  * enable mouse, hide cursor). Called once before the first render.
@@ -54,11 +59,6 @@ export interface Program extends SGRTerminal {
54
59
  * Refresh the terminal height. Returns whether the height changed.
55
60
  */
56
61
  refreshHeight(): Promise<boolean>;
57
- /**
58
- * Subscribe to system events (key, mouse, paste, focus/blur).
59
- * Returns an unsubscribe function.
60
- */
61
- onEvents(listener: (event: SystemEvent) => void): () => void;
62
62
  /**
63
63
  * Subscribe to terminal resize events.
64
64
  * Returns an unsubscribe function.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "contributors": [
6
6
  "Shawn Chen <meishangchen@gmail.com>"
7
7
  ],
8
- "version": "1.17.16",
8
+ "version": "1.19.16",
9
9
  "license": "MIT",
10
10
  "type": "module",
11
11
  "preferGlobal": false,
@@ -38,11 +38,11 @@
38
38
  "node": ">= 18.12.0"
39
39
  },
40
40
  "dependencies": {
41
- "@teaui/inspect": "1.17.16",
42
- "@teaui/term": "1.17.16"
41
+ "@teaui/term": "1.19.16",
42
+ "@teaui/inspect": "1.19.16"
43
43
  },
44
44
  "devDependencies": {
45
- "@teaui/shared": "1.17.16"
45
+ "@teaui/shared": "1.19.16"
46
46
  },
47
47
  "publishConfig": {
48
48
  "access": "public"