@visulima/ansi 4.0.0-alpha.7 → 4.0.0-alpha.8

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 (46) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/alternative-screen.js +8 -1
  3. package/dist/clear.d.ts +1 -1
  4. package/dist/clear.js +10 -1
  5. package/dist/cursor.d.ts +11 -11
  6. package/dist/cursor.js +3 -1
  7. package/dist/erase.d.ts +22 -22
  8. package/dist/erase.js +47 -1
  9. package/dist/hyperlink.js +5 -1
  10. package/dist/image.js +40 -1
  11. package/dist/index.js +26 -1
  12. package/dist/iterm2/iterm2-properties.d.ts +1 -1
  13. package/dist/iterm2/iterm2-sequences.d.ts +4 -4
  14. package/dist/iterm2.js +12 -1
  15. package/dist/mode.d.ts +11 -11
  16. package/dist/mode.js +245 -1
  17. package/dist/mouse.js +106 -1
  18. package/dist/packem_shared/IT2_AUTO-DyYWsxno.js +6 -0
  19. package/dist/packem_shared/ITerm2File-CUZDBk99.js +137 -0
  20. package/dist/packem_shared/constants-CE7WkXh_.js +9 -0
  21. package/dist/packem_shared/cursor-ChpV7cgs.js +72 -0
  22. package/dist/packem_shared/resetProgressBar-D9r2s7eV.js +18 -0
  23. package/dist/packem_shared/restoreCursor-GfYEeJqN.js +323 -0
  24. package/dist/passthrough.js +29 -1
  25. package/dist/reset.js +4 -1
  26. package/dist/screen.js +27 -1
  27. package/dist/scroll.js +18 -1
  28. package/dist/status.d.ts +6 -5
  29. package/dist/status.js +95 -1
  30. package/dist/strip.d.ts +0 -21
  31. package/dist/strip.js +13 -1
  32. package/dist/termcap.d.ts +1 -1
  33. package/dist/termcap.js +25 -1
  34. package/dist/title.d.ts +32 -34
  35. package/dist/title.js +19 -1
  36. package/dist/window-ops.d.ts +55 -55
  37. package/dist/window-ops.js +61 -1
  38. package/dist/xterm.d.ts +3 -3
  39. package/dist/xterm.js +33 -1
  40. package/package.json +1 -3
  41. package/dist/packem_shared/IT2_AUTO-BYrffRAq.js +0 -1
  42. package/dist/packem_shared/ITerm2File-C88DBJC-.js +0 -1
  43. package/dist/packem_shared/constants-D12jy2Zh.js +0 -1
  44. package/dist/packem_shared/cursor-8eSvcJ2I.js +0 -1
  45. package/dist/packem_shared/resetProgressBar-BtBbpWCM.js +0 -1
  46. package/dist/packem_shared/restoreCursor-CHy0jZuu.js +0 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## @visulima/ansi [4.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/ansi@4.0.0-alpha.7...@visulima/ansi@4.0.0-alpha.8) (2026-04-08)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **ansi:** correct DECSWT and DECSIN escape sequences ([#592](https://github.com/visulima/visulima/issues/592)) ([ca6b028](https://github.com/visulima/visulima/commit/ca6b0289d9ef3e453ad0e424172c6f7aee58b711))
6
+ * **ansi:** properly fix eslint errors in code ([6da2c5f](https://github.com/visulima/visulima/commit/6da2c5fbac6669163ba55e5b7b4062a10940de90))
7
+ * **ansi:** remove remaining eslint suppressions with proper code fixes ([27715b6](https://github.com/visulima/visulima/commit/27715b64843f0cd211f53b32bc752ef743bb52ef))
8
+ * **ansi:** resolve eslint errors ([c1ed26b](https://github.com/visulima/visulima/commit/c1ed26b7b528f388446e830a93ae6cc4abee636c))
9
+
10
+ ### Miscellaneous Chores
11
+
12
+ * **ansi:** add tsconfig.eslint.json for type-aware linting ([779ade8](https://github.com/visulima/visulima/commit/779ade858be2ec544486c354eed1dc8fc3f377f9))
13
+ * **ansi:** apply prettier formatting ([8ad7895](https://github.com/visulima/visulima/commit/8ad7895e4ad2fcaa78b542ce69e63f903208ee03))
14
+ * **ansi:** migrate .prettierrc.cjs to prettier.config.js ([1507e7a](https://github.com/visulima/visulima/commit/1507e7a245ff053929eedce92d2caf58b83ede40))
15
+ * **terminal:** remove empty dependency objects from package.json ([562c704](https://github.com/visulima/visulima/commit/562c704e5d90aa2d13eae942ebbdcfeb787c2b46))
16
+
17
+
18
+ ### Dependencies
19
+
20
+ * **@visulima/colorize:** upgraded to 2.0.0-alpha.8
21
+ * **@visulima/path:** upgraded to 3.0.0-alpha.8
22
+
1
23
  ## @visulima/ansi [4.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/ansi@4.0.0-alpha.6...@visulima/ansi@4.0.0-alpha.7) (2026-03-26)
2
24
 
3
25
  ### Features
@@ -1 +1,8 @@
1
- var c=Object.defineProperty;var t=(e,r)=>c(e,"name",{value:r,configurable:!0});import{C as a}from"./packem_shared/constants-D12jy2Zh.js";var f=Object.defineProperty,n=t((e,r)=>f(e,"name",{value:r,configurable:!0}),"t");const i=`${a}?1049h`,l=`${a}?1049l`,O=n(()=>i,"alternativeScreenOn"),S=n(()=>l,"alternativeScreenOff");export{l as ALT_SCREEN_OFF,i as ALT_SCREEN_ON,S as alternativeScreenOff,O as alternativeScreenOn};
1
+ import { C as CSI } from './packem_shared/constants-CE7WkXh_.js';
2
+
3
+ const ALT_SCREEN_ON = `${CSI}?1049h`;
4
+ const ALT_SCREEN_OFF = `${CSI}?1049l`;
5
+ const alternativeScreenOn = () => ALT_SCREEN_ON;
6
+ const alternativeScreenOff = () => ALT_SCREEN_OFF;
7
+
8
+ export { ALT_SCREEN_OFF, ALT_SCREEN_ON, alternativeScreenOff, alternativeScreenOn };
package/dist/clear.d.ts CHANGED
@@ -34,7 +34,7 @@ export declare const clearLineAndHomeCursor: string;
34
34
  *
35
35
  * Effective combined sequence: `CSI H CSI 2J`.
36
36
  * @remarks This is a very common sequence for clearing the visible terminal window.
37
- * @see {@link cursorPosition} (which `CSI H` relates to)
37
+ * @see `cursorPosition` from `./cursor` (which `CSI H` relates to)
38
38
  * @see {@link eraseDisplay}
39
39
  * @see {@link EraseDisplayMode.EntireScreen}
40
40
  */
package/dist/clear.js CHANGED
@@ -1 +1,10 @@
1
- import{C as n,E as o}from"./packem_shared/constants-D12jy2Zh.js";import{u as i,A as s}from"./packem_shared/cursor-8eSvcJ2I.js";import{eraseDisplay as e,EraseDisplayMode as r,eraseInLine as a,EraseLineMode as c}from"./erase.js";const S=i(0,0)+e(r.ToEnd),l=`${a(c.EntireLine)+n}G`,d=`${n}H${e(r.EntireScreen)}`,p=s?`${e(r.EntireScreen)+n}0f`:`${e(r.EntireScreen)+e(r.EntireScreenAndScrollback)+n}H${o}c`;export{l as clearLineAndHomeCursor,d as clearScreenAndHomeCursor,S as clearScreenFromTopLeft,p as resetTerminal};
1
+ import { C as CSI, E as ESC } from './packem_shared/constants-CE7WkXh_.js';
2
+ import { u as cursorTo, A as isWindows } from './packem_shared/cursor-ChpV7cgs.js';
3
+ import { eraseInLine, eraseDisplay, EraseDisplayMode, EraseLineMode } from './erase.js';
4
+
5
+ const clearScreenFromTopLeft = cursorTo(0, 0) + eraseDisplay(EraseDisplayMode.ToEnd);
6
+ const clearLineAndHomeCursor = `${eraseInLine(EraseLineMode.EntireLine)}${CSI}G`;
7
+ const clearScreenAndHomeCursor = `${CSI}H${eraseDisplay(EraseDisplayMode.EntireScreen)}`;
8
+ const resetTerminal = isWindows ? `${eraseDisplay(EraseDisplayMode.EntireScreen)}${CSI}0f` : `${eraseDisplay(EraseDisplayMode.EntireScreen)}${eraseDisplay(EraseDisplayMode.EntireScreenAndScrollback)}${CSI}H${ESC}c`;
9
+
10
+ export { clearLineAndHomeCursor, clearScreenAndHomeCursor, clearScreenFromTopLeft, resetTerminal };
package/dist/cursor.d.ts CHANGED
@@ -135,7 +135,7 @@ export declare const cursorForward: (count?: number) => string;
135
135
  * This is a DEC private mode. Visibility can be restored using {@link cursorShow} (`CSI ?25h`).
136
136
  * The appearance of the cursor (when visible) can often be controlled by {@link setCursorStyle}.
137
137
  * @see {@link cursorShow}
138
- * @see {@link TextCursorEnableMode} in `mode.ts` (represents DEC Mode 25).
138
+ * @see `TextCursorEnableMode` in `mode.ts` (represents DEC Mode 25).
139
139
  * @returns The ANSI escape sequence `CSI ?25l`.
140
140
  */
141
141
  export declare const cursorHide: string;
@@ -267,7 +267,7 @@ export declare const cursorSave: string;
267
267
  * This is a DEC private mode. Visibility can be hidden using {@link cursorHide} (`CSI ?25l`).
268
268
  * The appearance of the cursor (when visible) can often be controlled by {@link setCursorStyle}.
269
269
  * @see {@link cursorHide}
270
- * @see {@link TextCursorEnableMode} in `mode.ts` (represents DEC Mode 25).
270
+ * @see `TextCursorEnableMode` in `mode.ts` (represents DEC Mode 25).
271
271
  * @returns The ANSI escape sequence `CSI ?25h`.
272
272
  */
273
273
  export declare const cursorShow: string;
@@ -394,23 +394,23 @@ export declare const cursorUp: (count?: number) => string;
394
394
  * - Some terminals might not support all styles or DECSCUSR itself.
395
395
  */
396
396
  export declare enum CursorStyle {
397
- /** Blinking Bar (often an I-beam shape) cursor. (Corresponds to `Ps=5`) */
398
- BlinkingBar = 5,
399
- /** Blinking Block cursor. (Corresponds to `Ps=0` or `Ps=1` in `CSI Ps SP q`) */
400
- BlinkingBlock = 1,// Or 0, often interchangeable for default blinking block
401
- /** Blinking Underline cursor. (Corresponds to `Ps=3`) */
402
- BlinkingUnderline = 3,
403
397
  /**
404
398
  * Default cursor style (Ps=0). The appearance is terminal-dependent, typically a blinking block.
405
399
  * Using `0` explicitly can sometimes reset to the terminal's configured default if it differs from `1`.
406
400
  */
407
401
  Default = 0,
408
- /** Steady (non-blinking) Bar (I-beam) cursor. (Corresponds to `Ps=6`) */
409
- SteadyBar = 6,
402
+ /** Blinking Block cursor. (Corresponds to `Ps=0` or `Ps=1` in `CSI Ps SP q`) */
403
+ BlinkingBlock = 1,// Or 0, often interchangeable for default blinking block
410
404
  /** Steady (non-blinking) Block cursor. (Corresponds to `Ps=2`) */
411
405
  SteadyBlock = 2,
406
+ /** Blinking Underline cursor. (Corresponds to `Ps=3`) */
407
+ BlinkingUnderline = 3,
412
408
  /** Steady (non-blinking) Underline cursor. (Corresponds to `Ps=4`) */
413
- SteadyUnderline = 4
409
+ SteadyUnderline = 4,
410
+ /** Blinking Bar (often an I-beam shape) cursor. (Corresponds to `Ps=5`) */
411
+ BlinkingBar = 5,
412
+ /** Steady (non-blinking) Bar (I-beam) cursor. (Corresponds to `Ps=6`) */
413
+ SteadyBar = 6
414
414
  }
415
415
  /**
416
416
  * Sets the terminal cursor style using the DECSCUSR (Set Cursor Style) sequence.
package/dist/cursor.js CHANGED
@@ -1 +1,3 @@
1
- import"./packem_shared/constants-D12jy2Zh.js";import{C as o,a as u,b as e,c as R,B as c,R as t,d as S,e as C,S as _,f as O,g as E,h as U,i,j as l,k as T,l as n,m as D,n as d,o as w,p as A,q as b,r as f,s as m,t as p,u as N,v as P,w as v,x,y as B,z as I}from"./packem_shared/cursor-8eSvcJ2I.js";import{default as k}from"./packem_shared/restoreCursor-CHy0jZuu.js";export{o as CURSOR_BACKWARD_1,u as CURSOR_DOWN_1,e as CURSOR_FORWARD_1,R as CURSOR_UP_1,c as CursorStyle,t as REQUEST_CURSOR_POSITION,S as REQUEST_EXTENDED_CURSOR_POSITION,C as RESTORE_CURSOR_DEC,_ as SAVE_CURSOR_DEC,O as cursorBackward,E as cursorBackwardTab,U as cursorDown,i as cursorForward,l as cursorHide,T as cursorHorizontalAbsolute,n as cursorHorizontalForwardTab,D as cursorLeft,d as cursorMove,w as cursorNextLine,A as cursorPosition,b as cursorPreviousLine,f as cursorRestore,m as cursorSave,p as cursorShow,N as cursorTo,P as cursorToColumn1,v as cursorUp,x as cursorVerticalAbsolute,B as eraseCharacter,k as restoreCursor,I as setCursorStyle};
1
+ import './packem_shared/constants-CE7WkXh_.js';
2
+ export { C as CURSOR_BACKWARD_1, a as CURSOR_DOWN_1, b as CURSOR_FORWARD_1, c as CURSOR_UP_1, B as CursorStyle, R as REQUEST_CURSOR_POSITION, d as REQUEST_EXTENDED_CURSOR_POSITION, e as RESTORE_CURSOR_DEC, S as SAVE_CURSOR_DEC, f as cursorBackward, g as cursorBackwardTab, h as cursorDown, i as cursorForward, j as cursorHide, k as cursorHorizontalAbsolute, l as cursorHorizontalForwardTab, m as cursorLeft, n as cursorMove, o as cursorNextLine, p as cursorPosition, q as cursorPreviousLine, r as cursorRestore, s as cursorSave, t as cursorShow, u as cursorTo, v as cursorToColumn1, w as cursorUp, x as cursorVerticalAbsolute, y as eraseCharacter, z as setCursorStyle } from './packem_shared/cursor-ChpV7cgs.js';
3
+ export { default as restoreCursor } from './packem_shared/restoreCursor-GfYEeJqN.js';
package/dist/erase.d.ts CHANGED
@@ -6,6 +6,19 @@
6
6
  * @enum {number}
7
7
  */
8
8
  export declare enum EraseDisplayMode {
9
+ /**
10
+ * Clears from the current cursor position to the end of the screen (inclusive).
11
+ * If the cursor is at the top-left, this clears the entire screen.
12
+ * This corresponds to `Ps=0` (or `Ps` omitted) in `CSI Ps J`.
13
+ * Sequence: `CSI J` or `CSI 0J`.
14
+ */
15
+ ToEnd = 0,
16
+ /**
17
+ * Clears from the beginning of the screen to the current cursor position (inclusive).
18
+ * This corresponds to `Ps=1` in `CSI Ps J`.
19
+ * Sequence: `CSI 1J`.
20
+ */
21
+ ToBeginning = 1,
9
22
  /**
10
23
  * Clears the entire screen. The cursor position usually does not change, but this can be
11
24
  * terminal-dependent. Some terminals might move the cursor to the home position (top-left).
@@ -20,20 +33,7 @@ export declare enum EraseDisplayMode {
20
33
  * Sequence: `CSI 3J`.
21
34
  * @remarks This mode is particularly useful for a more complete "reset" of the terminal view.
22
35
  */
23
- EntireScreenAndScrollback = 3,
24
- /**
25
- * Clears from the beginning of the screen to the current cursor position (inclusive).
26
- * This corresponds to `Ps=1` in `CSI Ps J`.
27
- * Sequence: `CSI 1J`.
28
- */
29
- ToBeginning = 1,
30
- /**
31
- * Clears from the current cursor position to the end of the screen (inclusive).
32
- * If the cursor is at the top-left, this clears the entire screen.
33
- * This corresponds to `Ps=0` (or `Ps` omitted) in `CSI Ps J`.
34
- * Sequence: `CSI J` or `CSI 0J`.
35
- */
36
- ToEnd = 0
36
+ EntireScreenAndScrollback = 3
37
37
  }
38
38
  /**
39
39
  * Generates an ANSI escape sequence to erase parts of the display (ED - Erase in Display).
@@ -70,11 +70,11 @@ export declare const eraseDisplay: (mode: EraseDisplayMode | 0 | 1 | 2 | 3) => s
70
70
  */
71
71
  export declare enum EraseLineMode {
72
72
  /**
73
- * Clears the entire current line.
74
- * This corresponds to `Ps=2` in `CSI Ps K`.
75
- * Sequence: `CSI 2K`.
73
+ * Clears from the current cursor position to the end of the line (inclusive).
74
+ * This corresponds to `Ps=0` (or `Ps` omitted) in `CSI Ps K`.
75
+ * Sequence: `CSI K` or `CSI 0K`.
76
76
  */
77
- EntireLine = 2,
77
+ ToEnd = 0,
78
78
  /**
79
79
  * Clears from the beginning of the line to the current cursor position (inclusive).
80
80
  * This corresponds to `Ps=1` in `CSI Ps K`.
@@ -82,11 +82,11 @@ export declare enum EraseLineMode {
82
82
  */
83
83
  ToBeginning = 1,
84
84
  /**
85
- * Clears from the current cursor position to the end of the line (inclusive).
86
- * This corresponds to `Ps=0` (or `Ps` omitted) in `CSI Ps K`.
87
- * Sequence: `CSI K` or `CSI 0K`.
85
+ * Clears the entire current line.
86
+ * This corresponds to `Ps=2` in `CSI Ps K`.
87
+ * Sequence: `CSI 2K`.
88
88
  */
89
- ToEnd = 0
89
+ EntireLine = 2
90
90
  }
91
91
  /**
92
92
  * Generates an ANSI escape sequence to erase parts of the current line (EL - Erase in Line).
package/dist/erase.js CHANGED
@@ -1 +1,47 @@
1
- var t=Object.defineProperty;var s=(e,n)=>t(e,"name",{value:n,configurable:!0});import{C as c}from"./packem_shared/constants-D12jy2Zh.js";import{w as l,v as E}from"./packem_shared/cursor-8eSvcJ2I.js";var S=Object.defineProperty,a=s((e,n)=>S(e,"name",{value:n,configurable:!0}),"o"),d=(e=>(e[e.EntireScreen=2]="EntireScreen",e[e.EntireScreenAndScrollback=3]="EntireScreenAndScrollback",e[e.ToBeginning=1]="ToBeginning",e[e.ToEnd=0]="ToEnd",e))(d||{});const r=a(e=>{const n=e>=0&&e<=3?e:0;return`${c+(n===0?"":String(n))}J`},"eraseDisplay");var g=(e=>(e[e.EntireLine=2]="EntireLine",e[e.ToBeginning=1]="ToBeginning",e[e.ToEnd=0]="ToEnd",e))(g||{});const o=a(e=>{const n=e>=0&&e<=2?e:0;return`${c+(n===0?"":String(n))}K`},"eraseInLine"),f=r(0),u=o(2),m=o(0),v=o(1),b=a(e=>{if(e<=0)return"";let n="";for(let i=0;i<e;i+=1)n+=u,i<e-1&&(n+=l());return n+=E,n},"eraseLines"),y=r(2),B=r(1),D=r(3);export{d as EraseDisplayMode,g as EraseLineMode,r as eraseDisplay,f as eraseDown,o as eraseInLine,u as eraseLine,m as eraseLineEnd,v as eraseLineStart,b as eraseLines,y as eraseScreen,D as eraseScreenAndScrollback,B as eraseUp};
1
+ import { C as CSI } from './packem_shared/constants-CE7WkXh_.js';
2
+ import { w as cursorUp, v as cursorToColumn1 } from './packem_shared/cursor-ChpV7cgs.js';
3
+
4
+ var EraseDisplayMode = /* @__PURE__ */ ((EraseDisplayMode2) => {
5
+ EraseDisplayMode2[EraseDisplayMode2["ToEnd"] = 0] = "ToEnd";
6
+ EraseDisplayMode2[EraseDisplayMode2["ToBeginning"] = 1] = "ToBeginning";
7
+ EraseDisplayMode2[EraseDisplayMode2["EntireScreen"] = 2] = "EntireScreen";
8
+ EraseDisplayMode2[EraseDisplayMode2["EntireScreenAndScrollback"] = 3] = "EntireScreenAndScrollback";
9
+ return EraseDisplayMode2;
10
+ })(EraseDisplayMode || {});
11
+ const eraseDisplay = (mode) => {
12
+ const validMode = mode >= 0 && mode <= 3 ? mode : 0 /* ToEnd */;
13
+ return `${CSI}${validMode === 0 /* ToEnd */ ? "" : String(validMode)}J`;
14
+ };
15
+ var EraseLineMode = /* @__PURE__ */ ((EraseLineMode2) => {
16
+ EraseLineMode2[EraseLineMode2["ToEnd"] = 0] = "ToEnd";
17
+ EraseLineMode2[EraseLineMode2["ToBeginning"] = 1] = "ToBeginning";
18
+ EraseLineMode2[EraseLineMode2["EntireLine"] = 2] = "EntireLine";
19
+ return EraseLineMode2;
20
+ })(EraseLineMode || {});
21
+ const eraseInLine = (mode) => {
22
+ const validMode = mode >= 0 && mode <= 2 ? mode : 0 /* ToEnd */;
23
+ return `${CSI}${validMode === 0 /* ToEnd */ ? "" : String(validMode)}K`;
24
+ };
25
+ const eraseDown = eraseDisplay(0 /* ToEnd */);
26
+ const eraseLine = eraseInLine(2 /* EntireLine */);
27
+ const eraseLineEnd = eraseInLine(0 /* ToEnd */);
28
+ const eraseLineStart = eraseInLine(1 /* ToBeginning */);
29
+ const eraseLines = (count) => {
30
+ if (count <= 0) {
31
+ return "";
32
+ }
33
+ let clear = "";
34
+ for (let index = 0; index < count; index += 1) {
35
+ clear += eraseLine;
36
+ if (index < count - 1) {
37
+ clear += cursorUp();
38
+ }
39
+ }
40
+ clear += cursorToColumn1;
41
+ return clear;
42
+ };
43
+ const eraseScreen = eraseDisplay(2 /* EntireScreen */);
44
+ const eraseUp = eraseDisplay(1 /* ToBeginning */);
45
+ const eraseScreenAndScrollback = eraseDisplay(3 /* EntireScreenAndScrollback */);
46
+
47
+ export { EraseDisplayMode, EraseLineMode, eraseDisplay, eraseDown, eraseInLine, eraseLine, eraseLineEnd, eraseLineStart, eraseLines, eraseScreen, eraseScreenAndScrollback, eraseUp };
package/dist/hyperlink.js CHANGED
@@ -1 +1,5 @@
1
- var i=Object.defineProperty;var n=(e,a)=>i(e,"name",{value:a,configurable:!0});import{O as o,S as r,B as t}from"./packem_shared/constants-D12jy2Zh.js";var s=Object.defineProperty,f=n((e,a)=>s(e,"name",{value:a,configurable:!0}),"n");const u=f((e,a)=>[o,"8",r,r,a,t,e,o,"8",r,r,t].join(""),"hyperlink");export{u as default};
1
+ import { O as OSC, S as SEP, B as BEL } from './packem_shared/constants-CE7WkXh_.js';
2
+
3
+ const hyperlink = (text, url) => [OSC, "8", SEP, SEP, url, BEL, text, OSC, "8", SEP, SEP, BEL].join("");
4
+
5
+ export { hyperlink as default };
package/dist/image.js CHANGED
@@ -1 +1,40 @@
1
- var n=Object.defineProperty;var o=(r,e)=>n(r,"name",{value:e,configurable:!0});import{createRequire as a}from"node:module";import{O as l,B as p}from"./packem_shared/constants-D12jy2Zh.js";const c=a(import.meta.url),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=o(r=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[e,i]=t.versions.node.split(".").map(Number);if(e>22||e===22&&i>=3||e===20&&i>=16)return t.getBuiltinModule(r)}return c(r)},"__cjs_getBuiltinModule"),{Buffer:f}=u("node:buffer");var d=Object.defineProperty,g=o((r,e)=>d(r,"name",{value:e,configurable:!0}),"i");const v=g((r,e={})=>{if(!r)return"";let i=`${l}1337;File=inline=1`;e.width!==void 0&&(i+=`;width=${e.width}`),e.height!==void 0&&(i+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(i+=";preserveAspectRatio=0");const s=f.from(r).toString("base64");return`${i}:${s}${p}`},"image");export{v as image};
1
+ import { createRequire as __cjs_createRequire } from "node:module";
2
+
3
+ const __cjs_require = __cjs_createRequire(import.meta.url);
4
+
5
+ const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
6
+
7
+ const __cjs_getBuiltinModule = (module) => {
8
+ // Check if we're in Node.js and version supports getBuiltinModule
9
+ if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
10
+ const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
11
+ // Node.js 20.16.0+ and 22.3.0+
12
+ if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
13
+ return __cjs_getProcess.getBuiltinModule(module);
14
+ }
15
+ }
16
+ // Fallback to createRequire
17
+ return __cjs_require(module);
18
+ };
19
+
20
+ const {
21
+ Buffer
22
+ } = __cjs_getBuiltinModule("node:buffer");
23
+ import { O as OSC, B as BEL } from './packem_shared/constants-CE7WkXh_.js';
24
+
25
+ const image = (data, options = {}) => {
26
+ let returnValue = `${OSC}1337;File=inline=1`;
27
+ if (options.width !== void 0) {
28
+ returnValue += `;width=${String(options.width)}`;
29
+ }
30
+ if (options.height !== void 0) {
31
+ returnValue += `;height=${String(options.height)}`;
32
+ }
33
+ if (options.preserveAspectRatio === false) {
34
+ returnValue += ";preserveAspectRatio=0";
35
+ }
36
+ const base64Data = Buffer.from(data).toString("base64");
37
+ return `${returnValue}:${base64Data}${BEL}`;
38
+ };
39
+
40
+ export { image };
package/dist/index.js CHANGED
@@ -1 +1,26 @@
1
- import{ALT_SCREEN_OFF as t,ALT_SCREEN_ON as s,alternativeScreenOff as i,alternativeScreenOn as a}from"./alternative-screen.js";import{clearLineAndHomeCursor as d,clearScreenAndHomeCursor as u,clearScreenFromTopLeft as c,resetTerminal as S}from"./clear.js";import{C as M,a as l,b as p,c as m,R as D,d as T,e as E,S as C,f as P,g as A,h as L,i as f,j as y,k as x,l as O,m as b,n as _,o as q,p as I,q as N,r as g,s as w,t as h,u as v,v as U,w as B,x as K,y as W,z as F}from"./packem_shared/cursor-8eSvcJ2I.js";import{eraseDisplay as k,eraseDown as X,eraseInLine as H,eraseLine as Q,eraseLineEnd as V,eraseLineStart as Y,eraseLines as G,eraseScreen as j,eraseScreenAndScrollback as J,eraseUp as Z}from"./erase.js";import{default as ee}from"./hyperlink.js";import{image as oe}from"./image.js";import{iTerm2 as se}from"./iterm2.js";import{BDSM as ae,BiDirectionalSupportMode as ne,BracketedPasteMode as de,DECRPM as ue,DECRQM as ce,DisableModifiersMode as Se,IRM as Re,InBandResizeMode as Me,InsertReplaceMode as le,KAM as pe,KeyboardActionMode as me,LNM as De,LightDarkMode as Te,LineFeedNewLineMode as Ee,LocalEchoMode as Ce,OriginMode as Pe,RM as Ae,RequestBiDirectionalSupportMode as Le,RequestInBandResizeMode as fe,RequestInsertReplaceMode as ye,RequestKeyboardActionMode as xe,RequestLineFeedNewLineMode as Oe,RequestLocalEchoMode as be,RequestSendReceiveMode as _e,RequestUnicodeCoreMode as qe,ResetBiDirectionalSupportMode as Ie,ResetInBandResizeMode as Ne,ResetInsertReplaceMode as ge,ResetKeyboardActionMode as we,ResetLineFeedNewLineMode as he,ResetLocalEchoMode as ve,ResetSendReceiveMode as Ue,ResetUnicodeCoreMode as Be,SGRMouseMode as Ke,SM as We,SRM as Fe,SendFocusEventsMode as ze,SendReceiveMode as ke,SetBiDirectionalSupportMode as Xe,SetInBandResizeMode as He,SetInsertReplaceMode as Qe,SetKeyboardActionMode as Ve,SetLineFeedNewLineMode as Ye,SetLocalEchoMode as Ge,SetSendReceiveMode as je,SetUnicodeCoreMode as Je,TextCursorEnableMode as Ze,UnicodeCoreMode as $e,createAnsiMode as er,createDecMode as rr,isModeNotRecognized as or,isModePermanentlyReset as tr,isModePermanentlySet as sr,isModeReset as ir,isModeSet as ar,reportMode as nr,requestMode as dr,resetMode as ur,setMode as cr}from"./mode.js";import{MouseButton as Rr,disableAnyEventMouse as Mr,disableButtonEventMouse as lr,disableFocusTracking as pr,disableNormalMouse as mr,disableSgrMouse as Dr,disableX10Mouse as Tr,enableAnyEventMouse as Er,enableButtonEventMouse as Cr,enableFocusTracking as Pr,enableNormalMouse as Ar,enableSgrMouse as Lr,enableX10Mouse as fr,encodeMouseButtonByte as yr,mouseSgrSequence as xr,mouseX10Sequence as Or}from"./mouse.js";import{SCREEN_MAX_LEN_DEFAULT as _r,SCREEN_TYPICAL_LIMIT as qr,screenPassthrough as Ir,tmuxPassthrough as Nr}from"./passthrough.js";import{resetProgressBar as wr,setErrorProgressBar as hr,setIndeterminateProgressBar as vr,setProgressBar as Ur,setWarningProgressBar as Br}from"./packem_shared/resetProgressBar-BtBbpWCM.js";import{RESET_INITIAL_STATE as Wr,RIS as Fr}from"./reset.js";import{clearTabStop as kr,deleteCharacter as Xr,deleteLine as Hr,insertCharacter as Qr,insertLine as Vr,repeatPreviousCharacter as Yr,requestPresentationStateReport as Gr,setLeftRightMargins as jr,setTopBottomMargins as Jr}from"./screen.js";import{SCROLL_DOWN_1 as $r,SCROLL_UP_1 as eo,scrollDown as ro,scrollUp as oo}from"./scroll.js";import{CPR as so,DA1 as io,DA2 as ao,DA3 as no,DECXCPR as uo,DSR as co,DSR_KeyboardLanguageDEC as So,DSR_PrinterStatusDEC as Ro,DSR_TerminalStatus as Mo,DSR_UDKStatusDEC as lo,LightDarkReport as po,RequestLightDarkReport as mo,RequestNameVersion as Do,XTVERSION as To,createAnsiStatusReport as Eo,createDecStatusReport as Co,cursorPositionReport as Po,deviceStatusReport as Ao,extendedCursorPositionReport as Lo,reportKeyboardLanguageDEC as fo,reportPrimaryDeviceAttributes as yo,reportPrinterNoPaperDEC as xo,reportPrinterNotReadyDEC as Oo,reportPrinterReadyDEC as bo,reportSecondaryDeviceAttributes as _o,reportTerminalNotOK as qo,reportTerminalOK as Io,reportTertiaryDeviceAttributes as No,reportUDKLockedDEC as go,reportUDKUnlockedDEC as wo,requestCursorPositionReport as ho,requestExtendedCursorPositionReport as vo,requestKeyboardLanguageDEC as Uo,requestPrimaryDeviceAttributes as Bo,requestPrimaryDeviceAttributesParam0 as Ko,requestPrinterStatusDEC as Wo,requestSecondaryDeviceAttributes as Fo,requestSecondaryDeviceAttributesParam0 as zo,requestTerminalStatus as ko,requestTertiaryDeviceAttributes as Xo,requestTertiaryDeviceAttributesParam0 as Ho,requestUDKStatusDEC as Qo}from"./status.js";import{default as Yo}from"./strip.js";import{XTGETTCAP as jo,requestTermcap as Jo,requestTerminfo as Zo}from"./termcap.js";import{decsin as et,decswt as rt,setIconName as ot,setIconNameAndWindowTitle as tt,setIconNameAndWindowTitleWithST as st,setIconNameWithST as it,setWindowTitle as at,setWindowTitleWithST as nt}from"./title.js";import{XTWINOPS as ut,deiconifyWindow as ct,iconifyWindow as St,lowerWindow as Rt,maximizeWindow as Mt,moveWindow as lt,raiseWindow as pt,refreshWindow as mt,reportWindowPosition as Dt,reportWindowState as Tt,requestCellSizePixels as Et,requestTextAreaSizeChars as Ct,requestTextAreaSizePixels as Pt,resizeTextAreaChars as At,resizeTextAreaPixels as Lt,restoreMaximizedWindow as ft,setPageSizeLines as yt,xtermWindowOp as xt}from"./window-ops.js";import{XTMODKEYS as bt,XTQMODKEYS as _t,keyModifierOptions as qt,queryKeyModifierOptions as It,queryModifyOtherKeys as Nt,resetKeyModifierOptions as gt,resetModifyOtherKeys as wt,setKeyModifierOptions as ht,setModifyOtherKeys1 as vt,setModifyOtherKeys2 as Ut}from"./xterm.js";import{IT2_AUTO as Kt,it2Cells as Wt,it2Percent as Ft,it2Pixels as zt}from"./packem_shared/IT2_AUTO-BYrffRAq.js";import{ITerm2File as Xt,ITerm2FileEnd as Ht,ITerm2FilePart as Qt,ITerm2MultipartFileStart as Vt}from"./packem_shared/ITerm2File-C88DBJC-.js";const e="\x07";export{t as ALT_SCREEN_OFF,s as ALT_SCREEN_ON,ae as BDSM,ne as BiDirectionalSupportMode,de as BracketedPasteMode,so as CPR,M as CURSOR_BACKWARD_1,l as CURSOR_DOWN_1,p as CURSOR_FORWARD_1,m as CURSOR_UP_1,io as DA1,ao as DA2,no as DA3,ue as DECRPM,ce as DECRQM,uo as DECXCPR,co as DSR,So as DSR_KeyboardLanguageDEC,Ro as DSR_PrinterStatusDEC,Mo as DSR_TerminalStatus,lo as DSR_UDKStatusDEC,Se as DisableModifiersMode,Re as IRM,Kt as IT2_AUTO,Xt as ITerm2File,Ht as ITerm2FileEnd,Qt as ITerm2FilePart,Vt as ITerm2MultipartFileStart,Me as InBandResizeMode,le as InsertReplaceMode,pe as KAM,me as KeyboardActionMode,De as LNM,Te as LightDarkMode,po as LightDarkReport,Ee as LineFeedNewLineMode,Ce as LocalEchoMode,Rr as MouseButton,Pe as OriginMode,D as REQUEST_CURSOR_POSITION,T as REQUEST_EXTENDED_CURSOR_POSITION,Wr as RESET_INITIAL_STATE,E as RESTORE_CURSOR_DEC,Fr as RIS,Ae as RM,Le as RequestBiDirectionalSupportMode,fe as RequestInBandResizeMode,ye as RequestInsertReplaceMode,xe as RequestKeyboardActionMode,mo as RequestLightDarkReport,Oe as RequestLineFeedNewLineMode,be as RequestLocalEchoMode,Do as RequestNameVersion,_e as RequestSendReceiveMode,qe as RequestUnicodeCoreMode,Ie as ResetBiDirectionalSupportMode,Ne as ResetInBandResizeMode,ge as ResetInsertReplaceMode,we as ResetKeyboardActionMode,he as ResetLineFeedNewLineMode,ve as ResetLocalEchoMode,Ue as ResetSendReceiveMode,Be as ResetUnicodeCoreMode,C as SAVE_CURSOR_DEC,_r as SCREEN_MAX_LEN_DEFAULT,qr as SCREEN_TYPICAL_LIMIT,$r as SCROLL_DOWN_1,eo as SCROLL_UP_1,Ke as SGRMouseMode,We as SM,Fe as SRM,ze as SendFocusEventsMode,ke as SendReceiveMode,Xe as SetBiDirectionalSupportMode,He as SetInBandResizeMode,Qe as SetInsertReplaceMode,Ve as SetKeyboardActionMode,Ye as SetLineFeedNewLineMode,Ge as SetLocalEchoMode,je as SetSendReceiveMode,Je as SetUnicodeCoreMode,Ze as TextCursorEnableMode,$e as UnicodeCoreMode,jo as XTGETTCAP,bt as XTMODKEYS,_t as XTQMODKEYS,To as XTVERSION,ut as XTWINOPS,i as alternativeScreenOff,a as alternativeScreenOn,e as beep,d as clearLineAndHomeCursor,u as clearScreenAndHomeCursor,c as clearScreenFromTopLeft,kr as clearTabStop,er as createAnsiMode,Eo as createAnsiStatusReport,rr as createDecMode,Co as createDecStatusReport,P as cursorBackward,A as cursorBackwardTab,L as cursorDown,f as cursorForward,y as cursorHide,x as cursorHorizontalAbsolute,O as cursorHorizontalForwardTab,b as cursorLeft,_ as cursorMove,q as cursorNextLine,I as cursorPosition,Po as cursorPositionReport,N as cursorPreviousLine,g as cursorRestore,w as cursorSave,h as cursorShow,v as cursorTo,U as cursorToColumn1,B as cursorUp,K as cursorVerticalAbsolute,et as decsin,rt as decswt,ct as deiconifyWindow,Xr as deleteCharacter,Hr as deleteLine,Ao as deviceStatusReport,Mr as disableAnyEventMouse,lr as disableButtonEventMouse,pr as disableFocusTracking,mr as disableNormalMouse,Dr as disableSgrMouse,Tr as disableX10Mouse,Er as enableAnyEventMouse,Cr as enableButtonEventMouse,Pr as enableFocusTracking,Ar as enableNormalMouse,Lr as enableSgrMouse,fr as enableX10Mouse,yr as encodeMouseButtonByte,W as eraseCharacter,k as eraseDisplay,X as eraseDown,H as eraseInLine,Q as eraseLine,V as eraseLineEnd,Y as eraseLineStart,G as eraseLines,j as eraseScreen,J as eraseScreenAndScrollback,Z as eraseUp,Lo as extendedCursorPositionReport,ee as hyperlink,se as iTerm2,St as iconifyWindow,oe as image,Qr as insertCharacter,Vr as insertLine,or as isModeNotRecognized,tr as isModePermanentlyReset,sr as isModePermanentlySet,ir as isModeReset,ar as isModeSet,Wt as it2Cells,Ft as it2Percent,zt as it2Pixels,qt as keyModifierOptions,Rt as lowerWindow,Mt as maximizeWindow,xr as mouseSgrSequence,Or as mouseX10Sequence,lt as moveWindow,It as queryKeyModifierOptions,Nt as queryModifyOtherKeys,pt as raiseWindow,mt as refreshWindow,Yr as repeatPreviousCharacter,fo as reportKeyboardLanguageDEC,nr as reportMode,yo as reportPrimaryDeviceAttributes,xo as reportPrinterNoPaperDEC,Oo as reportPrinterNotReadyDEC,bo as reportPrinterReadyDEC,_o as reportSecondaryDeviceAttributes,qo as reportTerminalNotOK,Io as reportTerminalOK,No as reportTertiaryDeviceAttributes,go as reportUDKLockedDEC,wo as reportUDKUnlockedDEC,Dt as reportWindowPosition,Tt as reportWindowState,Et as requestCellSizePixels,ho as requestCursorPositionReport,vo as requestExtendedCursorPositionReport,Uo as requestKeyboardLanguageDEC,dr as requestMode,Gr as requestPresentationStateReport,Bo as requestPrimaryDeviceAttributes,Ko as requestPrimaryDeviceAttributesParam0,Wo as requestPrinterStatusDEC,Fo as requestSecondaryDeviceAttributes,zo as requestSecondaryDeviceAttributesParam0,Jo as requestTermcap,ko as requestTerminalStatus,Zo as requestTerminfo,Xo as requestTertiaryDeviceAttributes,Ho as requestTertiaryDeviceAttributesParam0,Ct as requestTextAreaSizeChars,Pt as requestTextAreaSizePixels,Qo as requestUDKStatusDEC,gt as resetKeyModifierOptions,ur as resetMode,wt as resetModifyOtherKeys,wr as resetProgressBar,S as resetTerminal,At as resizeTextAreaChars,Lt as resizeTextAreaPixels,ft as restoreMaximizedWindow,Ir as screenPassthrough,ro as scrollDown,oo as scrollUp,F as setCursorStyle,hr as setErrorProgressBar,ot as setIconName,tt as setIconNameAndWindowTitle,st as setIconNameAndWindowTitleWithST,it as setIconNameWithST,vr as setIndeterminateProgressBar,ht as setKeyModifierOptions,jr as setLeftRightMargins,cr as setMode,vt as setModifyOtherKeys1,Ut as setModifyOtherKeys2,yt as setPageSizeLines,Ur as setProgressBar,Jr as setTopBottomMargins,Br as setWarningProgressBar,at as setWindowTitle,nt as setWindowTitleWithST,Yo as strip,Nr as tmuxPassthrough,xt as xtermWindowOp};
1
+ export { ALT_SCREEN_OFF, ALT_SCREEN_ON, alternativeScreenOff, alternativeScreenOn } from './alternative-screen.js';
2
+ export { clearLineAndHomeCursor, clearScreenAndHomeCursor, clearScreenFromTopLeft, resetTerminal } from './clear.js';
3
+ export { C as CURSOR_BACKWARD_1, a as CURSOR_DOWN_1, b as CURSOR_FORWARD_1, c as CURSOR_UP_1, R as REQUEST_CURSOR_POSITION, d as REQUEST_EXTENDED_CURSOR_POSITION, e as RESTORE_CURSOR_DEC, S as SAVE_CURSOR_DEC, f as cursorBackward, g as cursorBackwardTab, h as cursorDown, i as cursorForward, j as cursorHide, k as cursorHorizontalAbsolute, l as cursorHorizontalForwardTab, m as cursorLeft, n as cursorMove, o as cursorNextLine, p as cursorPosition, q as cursorPreviousLine, r as cursorRestore, s as cursorSave, t as cursorShow, u as cursorTo, v as cursorToColumn1, w as cursorUp, x as cursorVerticalAbsolute, y as eraseCharacter, z as setCursorStyle } from './packem_shared/cursor-ChpV7cgs.js';
4
+ export { eraseDisplay, eraseDown, eraseInLine, eraseLine, eraseLineEnd, eraseLineStart, eraseLines, eraseScreen, eraseScreenAndScrollback, eraseUp } from './erase.js';
5
+ export { default as hyperlink } from './hyperlink.js';
6
+ export { image } from './image.js';
7
+ export { iTerm2 } from './iterm2.js';
8
+ export { BDSM, BiDirectionalSupportMode, BracketedPasteMode, DECRPM, DECRQM, DisableModifiersMode, IRM, InBandResizeMode, InsertReplaceMode, KAM, KeyboardActionMode, LNM, LightDarkMode, LineFeedNewLineMode, LocalEchoMode, OriginMode, RM, RequestBiDirectionalSupportMode, RequestInBandResizeMode, RequestInsertReplaceMode, RequestKeyboardActionMode, RequestLineFeedNewLineMode, RequestLocalEchoMode, RequestSendReceiveMode, RequestUnicodeCoreMode, ResetBiDirectionalSupportMode, ResetInBandResizeMode, ResetInsertReplaceMode, ResetKeyboardActionMode, ResetLineFeedNewLineMode, ResetLocalEchoMode, ResetSendReceiveMode, ResetUnicodeCoreMode, SGRMouseMode, SM, SRM, SendFocusEventsMode, SendReceiveMode, SetBiDirectionalSupportMode, SetInBandResizeMode, SetInsertReplaceMode, SetKeyboardActionMode, SetLineFeedNewLineMode, SetLocalEchoMode, SetSendReceiveMode, SetUnicodeCoreMode, TextCursorEnableMode, UnicodeCoreMode, createAnsiMode, createDecMode, isModeNotRecognized, isModePermanentlyReset, isModePermanentlySet, isModeReset, isModeSet, reportMode, requestMode, resetMode, setMode } from './mode.js';
9
+ export { MouseButton, disableAnyEventMouse, disableButtonEventMouse, disableFocusTracking, disableNormalMouse, disableSgrMouse, disableX10Mouse, enableAnyEventMouse, enableButtonEventMouse, enableFocusTracking, enableNormalMouse, enableSgrMouse, enableX10Mouse, encodeMouseButtonByte, mouseSgrSequence, mouseX10Sequence } from './mouse.js';
10
+ export { SCREEN_MAX_LEN_DEFAULT, SCREEN_TYPICAL_LIMIT, screenPassthrough, tmuxPassthrough } from './passthrough.js';
11
+ export { resetProgressBar, setErrorProgressBar, setIndeterminateProgressBar, setProgressBar, setWarningProgressBar } from './packem_shared/resetProgressBar-D9r2s7eV.js';
12
+ export { RESET_INITIAL_STATE, RIS } from './reset.js';
13
+ export { clearTabStop, deleteCharacter, deleteLine, insertCharacter, insertLine, repeatPreviousCharacter, requestPresentationStateReport, setLeftRightMargins, setTopBottomMargins } from './screen.js';
14
+ export { SCROLL_DOWN_1, SCROLL_UP_1, scrollDown, scrollUp } from './scroll.js';
15
+ export { CPR, DA1, DA2, DA3, DECXCPR, DSR, DSR_KeyboardLanguageDEC, DSR_PrinterStatusDEC, DSR_TerminalStatus, DSR_UDKStatusDEC, LightDarkReport, RequestLightDarkReport, RequestNameVersion, XTVERSION, createAnsiStatusReport, createDecStatusReport, cursorPositionReport, deviceStatusReport, extendedCursorPositionReport, reportKeyboardLanguageDEC, reportPrimaryDeviceAttributes, reportPrinterNoPaperDEC, reportPrinterNotReadyDEC, reportPrinterReadyDEC, reportSecondaryDeviceAttributes, reportTerminalNotOK, reportTerminalOK, reportTertiaryDeviceAttributes, reportUDKLockedDEC, reportUDKUnlockedDEC, requestCursorPositionReport, requestExtendedCursorPositionReport, requestKeyboardLanguageDEC, requestPrimaryDeviceAttributes, requestPrimaryDeviceAttributesParam0, requestPrinterStatusDEC, requestSecondaryDeviceAttributes, requestSecondaryDeviceAttributesParam0, requestTerminalStatus, requestTertiaryDeviceAttributes, requestTertiaryDeviceAttributesParam0, requestUDKStatusDEC } from './status.js';
16
+ export { default as strip } from './strip.js';
17
+ export { XTGETTCAP, requestTermcap, requestTerminfo } from './termcap.js';
18
+ export { decsin, decswt, setIconName, setIconNameAndWindowTitle, setIconNameAndWindowTitleWithST, setIconNameWithST, setWindowTitle, setWindowTitleWithST } from './title.js';
19
+ export { XTWINOPS, deiconifyWindow, iconifyWindow, lowerWindow, maximizeWindow, moveWindow, raiseWindow, refreshWindow, reportWindowPosition, reportWindowState, requestCellSizePixels, requestTextAreaSizeChars, requestTextAreaSizePixels, resizeTextAreaChars, resizeTextAreaPixels, restoreMaximizedWindow, setPageSizeLines, xtermWindowOp } from './window-ops.js';
20
+ export { XTMODKEYS, XTQMODKEYS, keyModifierOptions, queryKeyModifierOptions, queryModifyOtherKeys, resetKeyModifierOptions, resetModifyOtherKeys, setKeyModifierOptions, setModifyOtherKeys1, setModifyOtherKeys2 } from './xterm.js';
21
+ export { IT2_AUTO, it2Cells, it2Percent, it2Pixels } from './packem_shared/IT2_AUTO-DyYWsxno.js';
22
+ export { ITerm2File, ITerm2FileEnd, ITerm2FilePart, ITerm2MultipartFileStart } from './packem_shared/ITerm2File-CUZDBk99.js';
23
+
24
+ const beep = "\x07";
25
+
26
+ export { beep };
@@ -48,7 +48,7 @@ export declare const it2Percent: (n: number) => string;
48
48
  * An OSC 1337 sequence has the general form: `OSC 1337 ; &lt;payload_string> BEL`.
49
49
  * Objects implementing this interface are responsible for generating that `&lt;payload_string>`
50
50
  * via their `toString()` method. This allows for a structured way to build various iTerm2 commands.
51
- * @see {@link iTerm2} function which consumes objects of this type.
51
+ * @see `iTerm2` function in `iterm2.ts` which consumes objects of this type.
52
52
  */
53
53
  export interface IITerm2Payload {
54
54
  /**
@@ -7,14 +7,14 @@ import type { IITerm2Payload, ITerm2FileProperties } from "./iterm2-properties.d
7
7
  * - `File=[PROPERTIES]` (if content is not provided directly, e.g., for a download announcement)
8
8
  *
9
9
  * Implements {@link IITerm2Payload} for use with the generic `iTerm2` function.
10
- * @see {@link ITerm2FileProps} for property details.
11
- * @see {@link iTerm2} for the function that wraps this payload into a full escape sequence.
10
+ * @see {@link ITerm2FileProperties} for property details.
11
+ * @see `iTerm2` for the function that wraps this payload into a full escape sequence.
12
12
  */
13
13
  export declare class ITerm2File implements IITerm2Payload {
14
14
  private readonly fileProps;
15
15
  /**
16
16
  * Constructs an `ITerm2File` payload object.
17
- * @param properties An object containing properties for the file/image, as defined by {@link ITerm2FileProps}.
17
+ * @param properties An object containing properties for the file/image, as defined by {@link ITerm2FileProperties}.
18
18
  * The `name` property within `props` should be pre-Base64 encoded by the caller if it might
19
19
  * contain special characters (like `;`, `=`, or non-ASCII characters).
20
20
  * If `fileData` is provided, `props.content` will be overridden, and `props.size` will be
@@ -75,7 +75,7 @@ export declare class ITerm2FilePart implements IITerm2Payload {
75
75
  * This command initiates a transfer; the actual file data is sent in subsequent `FilePart` commands.
76
76
  *
77
77
  * Implements {@link IITerm2Payload} for use with the generic `iTerm2` function.
78
- * @see {@link ITerm2FileProps} for property details (omitting `content`).
78
+ * @see {@link ITerm2FileProperties} for property details (omitting `content`).
79
79
  * @see {@link ITerm2FilePart} for sending file chunks.
80
80
  * @see {@link ITerm2FileEnd} for finalizing the transfer.
81
81
  */
package/dist/iterm2.js CHANGED
@@ -1 +1,12 @@
1
- var i=Object.defineProperty;var r=(t,e)=>i(t,"name",{value:e,configurable:!0});import{O as o,B as m}from"./packem_shared/constants-D12jy2Zh.js";import{IT2_AUTO as I,it2Cells as c,it2Percent as s,it2Pixels as S}from"./packem_shared/IT2_AUTO-BYrffRAq.js";import{ITerm2File as g,ITerm2FileEnd as y,ITerm2FilePart as O,ITerm2MultipartFileStart as P}from"./packem_shared/ITerm2File-C88DBJC-.js";var n=Object.defineProperty,a=r((t,e)=>n(t,"name",{value:e,configurable:!0}),"t");const T=a(t=>{if(!t||typeof t.toString!="function"||t.toString===Object.prototype.toString)throw new Error("Invalid payload: must implement IITerm2Payload with a custom toString method");return`${o}1337;${t.toString()}${m}`},"iTerm2");export{I as IT2_AUTO,g as ITerm2File,y as ITerm2FileEnd,O as ITerm2FilePart,P as ITerm2MultipartFileStart,T as iTerm2,c as it2Cells,s as it2Percent,S as it2Pixels};
1
+ import { O as OSC, B as BEL } from './packem_shared/constants-CE7WkXh_.js';
2
+ export { IT2_AUTO, it2Cells, it2Percent, it2Pixels } from './packem_shared/IT2_AUTO-DyYWsxno.js';
3
+ export { ITerm2File, ITerm2FileEnd, ITerm2FilePart, ITerm2MultipartFileStart } from './packem_shared/ITerm2File-CUZDBk99.js';
4
+
5
+ const iTerm2 = (payload) => {
6
+ if (payload.toString === Object.prototype.toString) {
7
+ throw new Error("Invalid payload: must implement IITerm2Payload with a custom toString method");
8
+ }
9
+ return `${OSC}1337;${payload.toString()}${BEL}`;
10
+ };
11
+
12
+ export { iTerm2 };
package/dist/mode.d.ts CHANGED
@@ -14,25 +14,25 @@ export declare enum ModeSetting {
14
14
  */
15
15
  NotRecognized = 0,
16
16
  /**
17
- * Mode is permanently reset and cannot be changed (e.g., by RM or SM sequences).
18
- * (Parameter `Ps = 4` in DECRPM)
19
- */
20
- PermanentlyReset = 4,
21
- /**
22
- * Mode is permanently set and cannot be changed (e.g., by RM or SM sequences).
23
- * (Parameter `Ps = 3` in DECRPM)
17
+ * Mode is currently set.
18
+ * (Parameter `Ps = 1` in DECRPM)
24
19
  */
25
- PermanentlySet = 3,
20
+ Set = 1,
26
21
  /**
27
22
  * Mode is currently reset (not set).
28
23
  * (Parameter `Ps = 2` in DECRPM)
29
24
  */
30
25
  Reset = 2,
31
26
  /**
32
- * Mode is currently set.
33
- * (Parameter `Ps = 1` in DECRPM)
27
+ * Mode is permanently set and cannot be changed (e.g., by RM or SM sequences).
28
+ * (Parameter `Ps = 3` in DECRPM)
29
+ */
30
+ PermanentlySet = 3,
31
+ /**
32
+ * Mode is permanently reset and cannot be changed (e.g., by RM or SM sequences).
33
+ * (Parameter `Ps = 4` in DECRPM)
34
34
  */
35
- Set = 1
35
+ PermanentlyReset = 4
36
36
  }
37
37
  /**
38
38
  * Checks if the reported mode setting indicates that the mode is not recognized by the terminal.