@visulima/ansi 1.0.12 → 1.0.14
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/CHANGELOG.md +20 -0
- package/dist/alternative-screen.cjs +11 -1
- package/dist/alternative-screen.mjs +6 -1
- package/dist/clear.cjs +25 -1
- package/dist/clear.mjs +17 -1
- package/dist/cursor.cjs +24 -1
- package/dist/cursor.mjs +3 -1
- package/dist/erase.cjs +33 -1
- package/dist/erase.mjs +23 -1
- package/dist/image.cjs +21 -1
- package/dist/image.mjs +19 -1
- package/dist/index.cjs +48 -1
- package/dist/index.mjs +12 -1
- package/dist/link.cjs +9 -1
- package/dist/link.mjs +7 -1
- package/dist/packem_shared/constants-CqXMfQy0.mjs +7 -0
- package/dist/packem_shared/constants-D8u2npjW.cjs +13 -0
- package/dist/packem_shared/cursor-BzPDI1bk.mjs +42 -0
- package/dist/packem_shared/cursor-DSN9nA2g.cjs +57 -0
- package/dist/packem_shared/restoreCursor-Bjacc7pa.cjs +359 -0
- package/dist/packem_shared/restoreCursor-UYYzYxTZ.mjs +353 -0
- package/dist/scroll.cjs +13 -1
- package/dist/scroll.mjs +8 -1
- package/dist/strip.cjs +20 -1
- package/dist/strip.mjs +18 -1
- package/package.json +14 -14
- package/dist/packem_shared/constants-DNNXUmVx.cjs +0 -1
- package/dist/packem_shared/constants-DeW8ueso.mjs +0 -1
- package/dist/packem_shared/cursor-BRifAEIY.cjs +0 -1
- package/dist/packem_shared/cursor-DPv4LJZn.mjs +0 -1
- package/dist/packem_shared/restoreCursor-7AxUIcBE.cjs +0 -2
- package/dist/packem_shared/restoreCursor-uO8SZYVx.mjs +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## @visulima/ansi [1.0.14](https://github.com/visulima/visulima/compare/@visulima/ansi@1.0.13...@visulima/ansi@1.0.14) (2025-01-12)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* updated @visulima/packem, and all other dev dependencies ([7797a1c](https://github.com/visulima/visulima/commit/7797a1c3e6f1fc532895247bd88285a8a9883c40))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Dependencies
|
|
9
|
+
|
|
10
|
+
* **@visulima/colorize:** upgraded to 1.4.17
|
|
11
|
+
* **@visulima/path:** upgraded to 1.3.2
|
|
12
|
+
|
|
13
|
+
## @visulima/ansi [1.0.13](https://github.com/visulima/visulima/compare/@visulima/ansi@1.0.12...@visulima/ansi@1.0.13) (2025-01-08)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Dependencies
|
|
17
|
+
|
|
18
|
+
* **@visulima/colorize:** upgraded to 1.4.16
|
|
19
|
+
* **@visulima/path:** upgraded to 1.3.1
|
|
20
|
+
|
|
1
21
|
## @visulima/ansi [1.0.12](https://github.com/visulima/visulima/compare/@visulima/ansi@1.0.11...@visulima/ansi@1.0.12) (2025-01-08)
|
|
2
22
|
|
|
3
23
|
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const constants = require('./packem_shared/constants-D8u2npjW.cjs');
|
|
6
|
+
|
|
7
|
+
const alternativeScreenEnter = constants.ESC + "?1049h";
|
|
8
|
+
const alternativeScreenExit = constants.ESC + "?1049l";
|
|
9
|
+
|
|
10
|
+
exports.alternativeScreenEnter = alternativeScreenEnter;
|
|
11
|
+
exports.alternativeScreenExit = alternativeScreenExit;
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import{E as
|
|
1
|
+
import { E as ESC } from './packem_shared/constants-CqXMfQy0.mjs';
|
|
2
|
+
|
|
3
|
+
const alternativeScreenEnter = ESC + "?1049h";
|
|
4
|
+
const alternativeScreenExit = ESC + "?1049l";
|
|
5
|
+
|
|
6
|
+
export { alternativeScreenEnter, alternativeScreenExit };
|
package/dist/clear.cjs
CHANGED
|
@@ -1 +1,25 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const constants = require('./packem_shared/constants-D8u2npjW.cjs');
|
|
6
|
+
const erase = require('./erase.cjs');
|
|
7
|
+
const cursor = require('./packem_shared/cursor-DSN9nA2g.cjs');
|
|
8
|
+
|
|
9
|
+
const fullReset = constants.ESC + "1;1H" + constants.ESC + "J";
|
|
10
|
+
const clearLine = erase.eraseLine + constants.CSI + "0D";
|
|
11
|
+
const clearScreen = constants.ESC + "H" + constants.ESC + "2J";
|
|
12
|
+
const clearScrollbar = constants.ESC + "2J";
|
|
13
|
+
const clearTerminal = cursor.isWindows ? erase.eraseScreen + constants.ESC + "0f" : (
|
|
14
|
+
// 1. Erases the screen (Only done in case `2` is not supported)
|
|
15
|
+
// 2. Erases the whole screen including scrollback buffer
|
|
16
|
+
// 3. Moves cursor to the top-left position
|
|
17
|
+
// More info: https://www.real-world-systems.com/docs/ANSIcode.html
|
|
18
|
+
erase.eraseScreen + constants.ESC + "3J" + constants.ESC + "H" + constants.ESC + "c"
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
exports.clearLine = clearLine;
|
|
22
|
+
exports.clearScreen = clearScreen;
|
|
23
|
+
exports.clearScrollbar = clearScrollbar;
|
|
24
|
+
exports.clearTerminal = clearTerminal;
|
|
25
|
+
exports.fullReset = fullReset;
|
package/dist/clear.mjs
CHANGED
|
@@ -1 +1,17 @@
|
|
|
1
|
-
import{E as
|
|
1
|
+
import { E as ESC, C as CSI } from './packem_shared/constants-CqXMfQy0.mjs';
|
|
2
|
+
import { eraseLine, eraseScreen } from './erase.mjs';
|
|
3
|
+
import { n as isWindows } from './packem_shared/cursor-BzPDI1bk.mjs';
|
|
4
|
+
|
|
5
|
+
const fullReset = ESC + "1;1H" + ESC + "J";
|
|
6
|
+
const clearLine = eraseLine + CSI + "0D";
|
|
7
|
+
const clearScreen = ESC + "H" + ESC + "2J";
|
|
8
|
+
const clearScrollbar = ESC + "2J";
|
|
9
|
+
const clearTerminal = isWindows ? eraseScreen + ESC + "0f" : (
|
|
10
|
+
// 1. Erases the screen (Only done in case `2` is not supported)
|
|
11
|
+
// 2. Erases the whole screen including scrollback buffer
|
|
12
|
+
// 3. Moves cursor to the top-left position
|
|
13
|
+
// More info: https://www.real-world-systems.com/docs/ANSIcode.html
|
|
14
|
+
eraseScreen + ESC + "3J" + ESC + "H" + ESC + "c"
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export { clearLine, clearScreen, clearScrollbar, clearTerminal, fullReset };
|
package/dist/cursor.cjs
CHANGED
|
@@ -1 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
require('./packem_shared/constants-D8u2npjW.cjs');
|
|
6
|
+
const cursor = require('./packem_shared/cursor-DSN9nA2g.cjs');
|
|
7
|
+
const restoreCursor = require('./packem_shared/restoreCursor-Bjacc7pa.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.cursorBackward = cursor.cursorBackward;
|
|
12
|
+
exports.cursorDown = cursor.cursorDown;
|
|
13
|
+
exports.cursorForward = cursor.cursorForward;
|
|
14
|
+
exports.cursorHide = cursor.cursorHide;
|
|
15
|
+
exports.cursorLeft = cursor.cursorLeft;
|
|
16
|
+
exports.cursorMove = cursor.cursorMove;
|
|
17
|
+
exports.cursorNextLine = cursor.cursorNextLine;
|
|
18
|
+
exports.cursorPreviousLine = cursor.cursorPreviousLine;
|
|
19
|
+
exports.cursorRestore = cursor.cursorRestore;
|
|
20
|
+
exports.cursorSave = cursor.cursorSave;
|
|
21
|
+
exports.cursorShow = cursor.cursorShow;
|
|
22
|
+
exports.cursorTo = cursor.cursorTo;
|
|
23
|
+
exports.cursorUp = cursor.cursorUp;
|
|
24
|
+
exports.restoreCursor = restoreCursor;
|
package/dist/cursor.mjs
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './packem_shared/constants-CqXMfQy0.mjs';
|
|
2
|
+
export { c as cursorBackward, a as cursorDown, b as cursorForward, d as cursorHide, e as cursorLeft, f as cursorMove, g as cursorNextLine, h as cursorPreviousLine, i as cursorRestore, j as cursorSave, k as cursorShow, l as cursorTo, m as cursorUp } from './packem_shared/cursor-BzPDI1bk.mjs';
|
|
3
|
+
export { default as restoreCursor } from './packem_shared/restoreCursor-UYYzYxTZ.mjs';
|
package/dist/erase.cjs
CHANGED
|
@@ -1 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const constants = require('./packem_shared/constants-D8u2npjW.cjs');
|
|
6
|
+
const cursor = require('./packem_shared/cursor-DSN9nA2g.cjs');
|
|
7
|
+
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
+
const eraseDown = /* @__PURE__ */ __name((count = 1) => `${constants.CSI}J`.repeat(count), "eraseDown");
|
|
11
|
+
const eraseLine = `${constants.CSI}2K`;
|
|
12
|
+
const eraseLineEnd = `${constants.CSI}K`;
|
|
13
|
+
const eraseLineStart = `${constants.CSI}1K`;
|
|
14
|
+
const eraseLines = /* @__PURE__ */ __name((count) => {
|
|
15
|
+
let clear = "";
|
|
16
|
+
for (let index = 0; index < count; index++) {
|
|
17
|
+
clear += eraseLine + (index < count - 1 ? cursor.cursorUp() : "");
|
|
18
|
+
}
|
|
19
|
+
if (count) {
|
|
20
|
+
clear += cursor.cursorLeft;
|
|
21
|
+
}
|
|
22
|
+
return clear;
|
|
23
|
+
}, "eraseLines");
|
|
24
|
+
const eraseScreen = `${constants.CSI}2J`;
|
|
25
|
+
const eraseUp = /* @__PURE__ */ __name((count = 1) => `${constants.CSI}1J`.repeat(count), "eraseUp");
|
|
26
|
+
|
|
27
|
+
exports.eraseDown = eraseDown;
|
|
28
|
+
exports.eraseLine = eraseLine;
|
|
29
|
+
exports.eraseLineEnd = eraseLineEnd;
|
|
30
|
+
exports.eraseLineStart = eraseLineStart;
|
|
31
|
+
exports.eraseLines = eraseLines;
|
|
32
|
+
exports.eraseScreen = eraseScreen;
|
|
33
|
+
exports.eraseUp = eraseUp;
|
package/dist/erase.mjs
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import { C as CSI } from './packem_shared/constants-CqXMfQy0.mjs';
|
|
2
|
+
import { m as cursorUp, e as cursorLeft } from './packem_shared/cursor-BzPDI1bk.mjs';
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
const eraseDown = /* @__PURE__ */ __name((count = 1) => `${CSI}J`.repeat(count), "eraseDown");
|
|
7
|
+
const eraseLine = `${CSI}2K`;
|
|
8
|
+
const eraseLineEnd = `${CSI}K`;
|
|
9
|
+
const eraseLineStart = `${CSI}1K`;
|
|
10
|
+
const eraseLines = /* @__PURE__ */ __name((count) => {
|
|
11
|
+
let clear = "";
|
|
12
|
+
for (let index = 0; index < count; index++) {
|
|
13
|
+
clear += eraseLine + (index < count - 1 ? cursorUp() : "");
|
|
14
|
+
}
|
|
15
|
+
if (count) {
|
|
16
|
+
clear += cursorLeft;
|
|
17
|
+
}
|
|
18
|
+
return clear;
|
|
19
|
+
}, "eraseLines");
|
|
20
|
+
const eraseScreen = `${CSI}2J`;
|
|
21
|
+
const eraseUp = /* @__PURE__ */ __name((count = 1) => `${CSI}1J`.repeat(count), "eraseUp");
|
|
22
|
+
|
|
23
|
+
export { eraseDown, eraseLine, eraseLineEnd, eraseLineStart, eraseLines, eraseScreen, eraseUp };
|
package/dist/image.cjs
CHANGED
|
@@ -1 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const constants = require('./packem_shared/constants-D8u2npjW.cjs');
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
const image = /* @__PURE__ */ __name((data, options = {}) => {
|
|
8
|
+
let returnValue = `${constants.OSC}1337;File=inline=1`;
|
|
9
|
+
if (options.width) {
|
|
10
|
+
returnValue += `;width=${options.width}`;
|
|
11
|
+
}
|
|
12
|
+
if (options.height) {
|
|
13
|
+
returnValue += `;height=${options.height}`;
|
|
14
|
+
}
|
|
15
|
+
if (options.preserveAspectRatio === false) {
|
|
16
|
+
returnValue += ";preserveAspectRatio=0";
|
|
17
|
+
}
|
|
18
|
+
return returnValue + ":" + Buffer.from(data).toString("base64") + constants.BEL;
|
|
19
|
+
}, "image");
|
|
20
|
+
|
|
21
|
+
module.exports = image;
|
package/dist/image.mjs
CHANGED
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { B as BEL, O as OSC } from './packem_shared/constants-CqXMfQy0.mjs';
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
+
const image = /* @__PURE__ */ __name((data, options = {}) => {
|
|
6
|
+
let returnValue = `${OSC}1337;File=inline=1`;
|
|
7
|
+
if (options.width) {
|
|
8
|
+
returnValue += `;width=${options.width}`;
|
|
9
|
+
}
|
|
10
|
+
if (options.height) {
|
|
11
|
+
returnValue += `;height=${options.height}`;
|
|
12
|
+
}
|
|
13
|
+
if (options.preserveAspectRatio === false) {
|
|
14
|
+
returnValue += ";preserveAspectRatio=0";
|
|
15
|
+
}
|
|
16
|
+
return returnValue + ":" + Buffer.from(data).toString("base64") + BEL;
|
|
17
|
+
}, "image");
|
|
18
|
+
|
|
19
|
+
export { image as default };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const alternativeScreen = require('./alternative-screen.cjs');
|
|
6
|
+
const clear = require('./clear.cjs');
|
|
7
|
+
const cursor = require('./packem_shared/cursor-DSN9nA2g.cjs');
|
|
8
|
+
const erase = require('./erase.cjs');
|
|
9
|
+
const image = require('./image.cjs');
|
|
10
|
+
const link = require('./link.cjs');
|
|
11
|
+
const scroll = require('./scroll.cjs');
|
|
12
|
+
const strip = require('./strip.cjs');
|
|
13
|
+
|
|
14
|
+
const beep = "\x07";
|
|
15
|
+
|
|
16
|
+
exports.alternativeScreenEnter = alternativeScreen.alternativeScreenEnter;
|
|
17
|
+
exports.alternativeScreenExit = alternativeScreen.alternativeScreenExit;
|
|
18
|
+
exports.clearLine = clear.clearLine;
|
|
19
|
+
exports.clearScreen = clear.clearScreen;
|
|
20
|
+
exports.clearScrollbar = clear.clearScrollbar;
|
|
21
|
+
exports.clearTerminal = clear.clearTerminal;
|
|
22
|
+
exports.fullReset = clear.fullReset;
|
|
23
|
+
exports.cursorBackward = cursor.cursorBackward;
|
|
24
|
+
exports.cursorDown = cursor.cursorDown;
|
|
25
|
+
exports.cursorForward = cursor.cursorForward;
|
|
26
|
+
exports.cursorHide = cursor.cursorHide;
|
|
27
|
+
exports.cursorLeft = cursor.cursorLeft;
|
|
28
|
+
exports.cursorMove = cursor.cursorMove;
|
|
29
|
+
exports.cursorNextLine = cursor.cursorNextLine;
|
|
30
|
+
exports.cursorPreviousLine = cursor.cursorPreviousLine;
|
|
31
|
+
exports.cursorRestore = cursor.cursorRestore;
|
|
32
|
+
exports.cursorSave = cursor.cursorSave;
|
|
33
|
+
exports.cursorShow = cursor.cursorShow;
|
|
34
|
+
exports.cursorTo = cursor.cursorTo;
|
|
35
|
+
exports.cursorUp = cursor.cursorUp;
|
|
36
|
+
exports.eraseDown = erase.eraseDown;
|
|
37
|
+
exports.eraseLine = erase.eraseLine;
|
|
38
|
+
exports.eraseLineEnd = erase.eraseLineEnd;
|
|
39
|
+
exports.eraseLineStart = erase.eraseLineStart;
|
|
40
|
+
exports.eraseLines = erase.eraseLines;
|
|
41
|
+
exports.eraseScreen = erase.eraseScreen;
|
|
42
|
+
exports.eraseUp = erase.eraseUp;
|
|
43
|
+
exports.image = image;
|
|
44
|
+
exports.link = link;
|
|
45
|
+
exports.scrollDown = scroll.scrollDown;
|
|
46
|
+
exports.scrollUp = scroll.scrollUp;
|
|
47
|
+
exports.strip = strip;
|
|
48
|
+
exports.beep = beep;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
export { alternativeScreenEnter, alternativeScreenExit } from './alternative-screen.mjs';
|
|
2
|
+
export { clearLine, clearScreen, clearScrollbar, clearTerminal, fullReset } from './clear.mjs';
|
|
3
|
+
export { c as cursorBackward, a as cursorDown, b as cursorForward, d as cursorHide, e as cursorLeft, f as cursorMove, g as cursorNextLine, h as cursorPreviousLine, i as cursorRestore, j as cursorSave, k as cursorShow, l as cursorTo, m as cursorUp } from './packem_shared/cursor-BzPDI1bk.mjs';
|
|
4
|
+
export { eraseDown, eraseLine, eraseLineEnd, eraseLineStart, eraseLines, eraseScreen, eraseUp } from './erase.mjs';
|
|
5
|
+
export { default as image } from './image.mjs';
|
|
6
|
+
export { default as link } from './link.mjs';
|
|
7
|
+
export { scrollDown, scrollUp } from './scroll.mjs';
|
|
8
|
+
export { default as strip } from './strip.mjs';
|
|
9
|
+
|
|
10
|
+
const beep = "\x07";
|
|
11
|
+
|
|
12
|
+
export { beep };
|
package/dist/link.cjs
CHANGED
|
@@ -1 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const constants = require('./packem_shared/constants-D8u2npjW.cjs');
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
const link = /* @__PURE__ */ __name((text, url) => [constants.OSC, "8", constants.SEP, constants.SEP, url, constants.BEL, text, constants.OSC, "8", constants.SEP, constants.SEP, constants.BEL].join(""), "link");
|
|
8
|
+
|
|
9
|
+
module.exports = link;
|
package/dist/link.mjs
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { O as OSC, S as SEP, B as BEL } from './packem_shared/constants-CqXMfQy0.mjs';
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
+
const link = /* @__PURE__ */ __name((text, url) => [OSC, "8", SEP, SEP, url, BEL, text, OSC, "8", SEP, SEP, BEL].join(""), "link");
|
|
6
|
+
|
|
7
|
+
export { link as default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { C as CSI, E as ESC, S as SEP } from './constants-CqXMfQy0.mjs';
|
|
2
|
+
import './restoreCursor-UYYzYxTZ.mjs';
|
|
3
|
+
|
|
4
|
+
const isBrowser = globalThis?.window?.document !== undefined;
|
|
5
|
+
const isTerminalApp = !isBrowser && process.env.TERM_PROGRAM === "Apple_Terminal";
|
|
6
|
+
const isWindows = !isBrowser && process.platform === "win32";
|
|
7
|
+
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
+
const cursorBackward = /* @__PURE__ */ __name((count = 1) => CSI + count + "D", "cursorBackward");
|
|
11
|
+
const cursorDown = /* @__PURE__ */ __name((count = 1) => CSI + count + "B", "cursorDown");
|
|
12
|
+
const cursorForward = /* @__PURE__ */ __name((count = 1) => CSI + count + "C", "cursorForward");
|
|
13
|
+
const cursorHide = CSI + "?25l";
|
|
14
|
+
const cursorLeft = CSI + "G";
|
|
15
|
+
const cursorMove = /* @__PURE__ */ __name((x, y) => {
|
|
16
|
+
let returnValue = "";
|
|
17
|
+
if (x < 0) {
|
|
18
|
+
returnValue += CSI + -x + "D";
|
|
19
|
+
} else if (x > 0) {
|
|
20
|
+
returnValue += CSI + x + "C";
|
|
21
|
+
}
|
|
22
|
+
if (y < 0) {
|
|
23
|
+
returnValue += CSI + -y + "A";
|
|
24
|
+
} else if (y > 0) {
|
|
25
|
+
returnValue += CSI + y + "B";
|
|
26
|
+
}
|
|
27
|
+
return returnValue;
|
|
28
|
+
}, "cursorMove");
|
|
29
|
+
const cursorNextLine = /* @__PURE__ */ __name((count = 1) => (CSI + "E").repeat(count), "cursorNextLine");
|
|
30
|
+
const cursorPreviousLine = /* @__PURE__ */ __name((count = 1) => (CSI + "F").repeat(count), "cursorPreviousLine");
|
|
31
|
+
const cursorRestore = isTerminalApp ? ESC + "8" : ESC + "u";
|
|
32
|
+
const cursorSave = isTerminalApp ? ESC + "7" : ESC + "s";
|
|
33
|
+
const cursorShow = CSI + "?25h";
|
|
34
|
+
const cursorTo = /* @__PURE__ */ __name((x, y) => {
|
|
35
|
+
if (!y && y !== 0) {
|
|
36
|
+
return CSI + (x + 1) + "G";
|
|
37
|
+
}
|
|
38
|
+
return CSI + (y + 1) + SEP + (x + 1) + "H";
|
|
39
|
+
}, "cursorTo");
|
|
40
|
+
const cursorUp = /* @__PURE__ */ __name((count = 1) => CSI + count + "A", "cursorUp");
|
|
41
|
+
|
|
42
|
+
export { cursorDown as a, cursorForward as b, cursorBackward as c, cursorHide as d, cursorLeft as e, cursorMove as f, cursorNextLine as g, cursorPreviousLine as h, cursorRestore as i, cursorSave as j, cursorShow as k, cursorTo as l, cursorUp as m, isWindows as n };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const constants = require('./constants-D8u2npjW.cjs');
|
|
4
|
+
require('./restoreCursor-Bjacc7pa.cjs');
|
|
5
|
+
|
|
6
|
+
const isBrowser = globalThis?.window?.document !== undefined;
|
|
7
|
+
const isTerminalApp = !isBrowser && process.env.TERM_PROGRAM === "Apple_Terminal";
|
|
8
|
+
const isWindows = !isBrowser && process.platform === "win32";
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
12
|
+
const cursorBackward = /* @__PURE__ */ __name((count = 1) => constants.CSI + count + "D", "cursorBackward");
|
|
13
|
+
const cursorDown = /* @__PURE__ */ __name((count = 1) => constants.CSI + count + "B", "cursorDown");
|
|
14
|
+
const cursorForward = /* @__PURE__ */ __name((count = 1) => constants.CSI + count + "C", "cursorForward");
|
|
15
|
+
const cursorHide = constants.CSI + "?25l";
|
|
16
|
+
const cursorLeft = constants.CSI + "G";
|
|
17
|
+
const cursorMove = /* @__PURE__ */ __name((x, y) => {
|
|
18
|
+
let returnValue = "";
|
|
19
|
+
if (x < 0) {
|
|
20
|
+
returnValue += constants.CSI + -x + "D";
|
|
21
|
+
} else if (x > 0) {
|
|
22
|
+
returnValue += constants.CSI + x + "C";
|
|
23
|
+
}
|
|
24
|
+
if (y < 0) {
|
|
25
|
+
returnValue += constants.CSI + -y + "A";
|
|
26
|
+
} else if (y > 0) {
|
|
27
|
+
returnValue += constants.CSI + y + "B";
|
|
28
|
+
}
|
|
29
|
+
return returnValue;
|
|
30
|
+
}, "cursorMove");
|
|
31
|
+
const cursorNextLine = /* @__PURE__ */ __name((count = 1) => (constants.CSI + "E").repeat(count), "cursorNextLine");
|
|
32
|
+
const cursorPreviousLine = /* @__PURE__ */ __name((count = 1) => (constants.CSI + "F").repeat(count), "cursorPreviousLine");
|
|
33
|
+
const cursorRestore = isTerminalApp ? constants.ESC + "8" : constants.ESC + "u";
|
|
34
|
+
const cursorSave = isTerminalApp ? constants.ESC + "7" : constants.ESC + "s";
|
|
35
|
+
const cursorShow = constants.CSI + "?25h";
|
|
36
|
+
const cursorTo = /* @__PURE__ */ __name((x, y) => {
|
|
37
|
+
if (!y && y !== 0) {
|
|
38
|
+
return constants.CSI + (x + 1) + "G";
|
|
39
|
+
}
|
|
40
|
+
return constants.CSI + (y + 1) + constants.SEP + (x + 1) + "H";
|
|
41
|
+
}, "cursorTo");
|
|
42
|
+
const cursorUp = /* @__PURE__ */ __name((count = 1) => constants.CSI + count + "A", "cursorUp");
|
|
43
|
+
|
|
44
|
+
exports.cursorBackward = cursorBackward;
|
|
45
|
+
exports.cursorDown = cursorDown;
|
|
46
|
+
exports.cursorForward = cursorForward;
|
|
47
|
+
exports.cursorHide = cursorHide;
|
|
48
|
+
exports.cursorLeft = cursorLeft;
|
|
49
|
+
exports.cursorMove = cursorMove;
|
|
50
|
+
exports.cursorNextLine = cursorNextLine;
|
|
51
|
+
exports.cursorPreviousLine = cursorPreviousLine;
|
|
52
|
+
exports.cursorRestore = cursorRestore;
|
|
53
|
+
exports.cursorSave = cursorSave;
|
|
54
|
+
exports.cursorShow = cursorShow;
|
|
55
|
+
exports.cursorTo = cursorTo;
|
|
56
|
+
exports.cursorUp = cursorUp;
|
|
57
|
+
exports.isWindows = isWindows;
|