@visulima/ansi 1.0.13 → 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 CHANGED
@@ -1,3 +1,15 @@
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
+
1
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)
2
14
 
3
15
 
@@ -1 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./packem_shared/constants-DNNXUmVx.cjs"),t=e.E+"?1049h",n=e.E+"?1049l";exports.alternativeScreenEnter=t;exports.alternativeScreenExit=n;
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 e}from"./packem_shared/constants-DeW8ueso.mjs";const r=e+"?1049h",n=e+"?1049l";export{r as alternativeScreenEnter,n as alternativeScreenExit};
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
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./packem_shared/constants-DNNXUmVx.cjs"),r=require("./erase.cjs"),c=require("./packem_shared/cursor-BRifAEIY.cjs"),l=e.E+"1;1H"+e.E+"J",a=r.eraseLine+e.C+"0D",n=e.E+"H"+e.E+"2J",s=e.E+"2J",t=c.n?r.eraseScreen+e.E+"0f":r.eraseScreen+e.E+"3J"+e.E+"H"+e.E+"c";exports.clearLine=a;exports.clearScreen=n;exports.clearScrollbar=s;exports.clearTerminal=t;exports.fullReset=l;
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 e,C as a}from"./packem_shared/constants-DeW8ueso.mjs";import{eraseLine as o,eraseScreen as r}from"./erase.mjs";import{n as c}from"./packem_shared/cursor-DPv4LJZn.mjs";const n=e+"1;1H"+e+"J",m=o+a+"0D",t=e+"H"+e+"2J",f=e+"2J",S=c?r+e+"0f":r+e+"3J"+e+"H"+e+"c";export{m as clearLine,t as clearScreen,f as clearScrollbar,S as clearTerminal,n as fullReset};
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
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./packem_shared/constants-DNNXUmVx.cjs");const r=require("./packem_shared/cursor-BRifAEIY.cjs"),o=require("./packem_shared/restoreCursor-7AxUIcBE.cjs");exports.cursorBackward=r.c;exports.cursorDown=r.a;exports.cursorForward=r.b;exports.cursorHide=r.d;exports.cursorLeft=r.e;exports.cursorMove=r.f;exports.cursorNextLine=r.g;exports.cursorPreviousLine=r.h;exports.cursorRestore=r.i;exports.cursorSave=r.j;exports.cursorShow=r.k;exports.cursorTo=r.l;exports.cursorUp=r.m;exports.restoreCursor=o;
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"./packem_shared/constants-DeW8ueso.mjs";import{c as a,a as e,b as u,d as c,e as t,f as i,g as d,h as f,i as m,j as p,k as w,l as n,m as v}from"./packem_shared/cursor-DPv4LJZn.mjs";import{default as L}from"./packem_shared/restoreCursor-uO8SZYVx.mjs";export{a as cursorBackward,e as cursorDown,u as cursorForward,c as cursorHide,t as cursorLeft,i as cursorMove,d as cursorNextLine,f as cursorPreviousLine,m as cursorRestore,p as cursorSave,w as cursorShow,n as cursorTo,v as cursorUp,L as restoreCursor};
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
- "use strict";var c=Object.defineProperty;var t=(e,r)=>c(e,"name",{value:r,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./packem_shared/constants-DNNXUmVx.cjs"),i=require("./packem_shared/cursor-BRifAEIY.cjs");var u=Object.defineProperty,n=t((e,r)=>u(e,"name",{value:r,configurable:!0}),"o");const L=n((e=1)=>`${a.C}J`.repeat(e),"eraseDown"),o=`${a.C}2K`,l=`${a.C}K`,p=`${a.C}1K`,C=n(e=>{let r="";for(let s=0;s<e;s++)r+=o+(s<e-1?i.m():"");return e&&(r+=i.e),r},"eraseLines"),S=`${a.C}2J`,$=n((e=1)=>`${a.C}1J`.repeat(e),"eraseUp");exports.eraseDown=L;exports.eraseLine=o;exports.eraseLineEnd=l;exports.eraseLineStart=p;exports.eraseLines=C;exports.eraseScreen=S;exports.eraseUp=$;
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
- var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});import{C as a}from"./packem_shared/constants-DeW8ueso.mjs";import{m as i,e as p}from"./packem_shared/cursor-DPv4LJZn.mjs";var c=Object.defineProperty,n=t((e,r)=>c(e,"name",{value:r,configurable:!0}),"o");const u=n((e=1)=>`${a}J`.repeat(e),"eraseDown"),f=`${a}2K`,l=`${a}K`,v=`${a}1K`,J=n(e=>{let r="";for(let s=0;s<e;s++)r+=f+(s<e-1?i():"");return e&&(r+=p),r},"eraseLines"),K=`${a}2J`,S=n((e=1)=>`${a}1J`.repeat(e),"eraseUp");export{u as eraseDown,f as eraseLine,l as eraseLineEnd,v as eraseLineStart,J as eraseLines,K as eraseScreen,S as eraseUp};
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
- "use strict";var a=Object.defineProperty;var r=(t,e)=>a(t,"name",{value:e,configurable:!0});const s=require("./packem_shared/constants-DNNXUmVx.cjs");var n=Object.defineProperty,o=r((t,e)=>n(t,"name",{value:e,configurable:!0}),"i");const h=o((t,e={})=>{let i=`${s.O}1337;File=inline=1`;return e.width&&(i+=`;width=${e.width}`),e.height&&(i+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(i+=";preserveAspectRatio=0"),i+":"+Buffer.from(t).toString("base64")+s.B},"image");module.exports=h;
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
- var a=Object.defineProperty;var r=(t,e)=>a(t,"name",{value:e,configurable:!0});import{B as o,O as h}from"./packem_shared/constants-DeW8ueso.mjs";var s=Object.defineProperty,n=r((t,e)=>s(t,"name",{value:e,configurable:!0}),"i");const g=n((t,e={})=>{let i=`${h}1337;File=inline=1`;return e.width&&(i+=`;width=${e.width}`),e.height&&(i+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(i+=";preserveAspectRatio=0"),i+":"+Buffer.from(t).toString("base64")+o},"image");export{g as default};
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
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./alternative-screen.cjs"),a=require("./clear.cjs"),e=require("./packem_shared/cursor-BRifAEIY.cjs"),r=require("./erase.cjs"),n=require("./image.cjs"),i=require("./link.cjs"),c=require("./scroll.cjs"),l=require("./strip.cjs"),o="\x07";exports.alternativeScreenEnter=s.alternativeScreenEnter;exports.alternativeScreenExit=s.alternativeScreenExit;exports.clearLine=a.clearLine;exports.clearScreen=a.clearScreen;exports.clearScrollbar=a.clearScrollbar;exports.clearTerminal=a.clearTerminal;exports.fullReset=a.fullReset;exports.cursorBackward=e.c;exports.cursorDown=e.a;exports.cursorForward=e.b;exports.cursorHide=e.d;exports.cursorLeft=e.e;exports.cursorMove=e.f;exports.cursorNextLine=e.g;exports.cursorPreviousLine=e.h;exports.cursorRestore=e.i;exports.cursorSave=e.j;exports.cursorShow=e.k;exports.cursorTo=e.l;exports.cursorUp=e.m;exports.eraseDown=r.eraseDown;exports.eraseLine=r.eraseLine;exports.eraseLineEnd=r.eraseLineEnd;exports.eraseLineStart=r.eraseLineStart;exports.eraseLines=r.eraseLines;exports.eraseScreen=r.eraseScreen;exports.eraseUp=r.eraseUp;exports.image=n;exports.link=i;exports.scrollDown=c.scrollDown;exports.scrollUp=c.scrollUp;exports.strip=l;exports.beep=o;
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
- import{alternativeScreenEnter as a,alternativeScreenExit as o}from"./alternative-screen.mjs";import{clearLine as t,clearScreen as n,clearScrollbar as l,clearTerminal as u,fullReset as i}from"./clear.mjs";import{c as p,a as x,b as m,d,e as L,f as S,g as w,h as v,i as b,j as k,k as D,l as E,m as U}from"./packem_shared/cursor-DPv4LJZn.mjs";import{eraseDown as h,eraseLine as R,eraseLineEnd as T,eraseLineStart as j,eraseLines as B,eraseScreen as F,eraseUp as H}from"./erase.mjs";import{default as N}from"./image.mjs";import{default as q}from"./link.mjs";import{scrollDown as z,scrollUp as A}from"./scroll.mjs";import{default as G}from"./strip.mjs";const r="\x07";export{a as alternativeScreenEnter,o as alternativeScreenExit,r as beep,t as clearLine,n as clearScreen,l as clearScrollbar,u as clearTerminal,p as cursorBackward,x as cursorDown,m as cursorForward,d as cursorHide,L as cursorLeft,S as cursorMove,w as cursorNextLine,v as cursorPreviousLine,b as cursorRestore,k as cursorSave,D as cursorShow,E as cursorTo,U as cursorUp,h as eraseDown,R as eraseLine,T as eraseLineEnd,j as eraseLineStart,B as eraseLines,F as eraseScreen,H as eraseUp,i as fullReset,N as image,q as link,z as scrollDown,A as scrollUp,G as strip};
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
- "use strict";var o=Object.defineProperty;var t=(r,n)=>o(r,"name",{value:n,configurable:!0});const e=require("./packem_shared/constants-DNNXUmVx.cjs");var s=Object.defineProperty,a=t((r,n)=>s(r,"name",{value:n,configurable:!0}),"r");const c=a((r,n)=>[e.O,"8",e.S,e.S,n,e.B,r,e.O,"8",e.S,e.S,e.B].join(""),"link");module.exports=c;
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
- var i=Object.defineProperty;var o=(a,e)=>i(a,"name",{value:e,configurable:!0});import{O as n,S as r,B as t}from"./packem_shared/constants-DeW8ueso.mjs";var s=Object.defineProperty,f=o((a,e)=>s(a,"name",{value:e,configurable:!0}),"r");const m=f((a,e)=>[n,"8",r,r,e,t,a,n,"8",r,r,t].join(""),"link");export{m as default};
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,7 @@
1
+ const ESC = "\x1B";
2
+ const CSI = `${ESC}[`;
3
+ const OSC = "\x1B]";
4
+ const BEL = "\x07";
5
+ const SEP = ";";
6
+
7
+ export { BEL as B, CSI as C, ESC as E, OSC as O, SEP as S };
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ const ESC = "\x1B";
4
+ const CSI = `${ESC}[`;
5
+ const OSC = "\x1B]";
6
+ const BEL = "\x07";
7
+ const SEP = ";";
8
+
9
+ exports.BEL = BEL;
10
+ exports.CSI = CSI;
11
+ exports.ESC = ESC;
12
+ exports.OSC = OSC;
13
+ exports.SEP = SEP;
@@ -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;