topazcube 0.1.31 → 0.1.35
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/LICENSE.txt +0 -0
- package/README.md +0 -0
- package/dist/Renderer.cjs +20844 -0
- package/dist/Renderer.cjs.map +1 -0
- package/dist/Renderer.js +20827 -0
- package/dist/Renderer.js.map +1 -0
- package/dist/client.cjs +91 -260
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +68 -215
- package/dist/client.js.map +1 -1
- package/dist/server.cjs +165 -432
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +117 -370
- package/dist/server.js.map +1 -1
- package/dist/terminal.cjs +113 -200
- package/dist/terminal.cjs.map +1 -1
- package/dist/terminal.js +50 -51
- package/dist/terminal.js.map +1 -1
- package/dist/utils-CRhi1BDa.cjs +259 -0
- package/dist/utils-CRhi1BDa.cjs.map +1 -0
- package/dist/utils-D7tXt6-2.js +260 -0
- package/dist/utils-D7tXt6-2.js.map +1 -0
- package/package.json +19 -15
- package/src/{client.ts → network/client.js} +170 -403
- package/src/{compress-browser.ts → network/compress-browser.js} +2 -4
- package/src/{compress-node.ts → network/compress-node.js} +8 -14
- package/src/{server.ts → network/server.js} +229 -317
- package/src/{terminal.js → network/terminal.js} +0 -0
- package/src/{topazcube.ts → network/topazcube.js} +2 -2
- package/src/network/utils.js +375 -0
- package/src/renderer/Camera.js +191 -0
- package/src/renderer/DebugUI.js +703 -0
- package/src/renderer/Geometry.js +1049 -0
- package/src/renderer/Material.js +64 -0
- package/src/renderer/Mesh.js +211 -0
- package/src/renderer/Node.js +112 -0
- package/src/renderer/Pipeline.js +645 -0
- package/src/renderer/Renderer.js +1496 -0
- package/src/renderer/Skin.js +792 -0
- package/src/renderer/Texture.js +584 -0
- package/src/renderer/core/AssetManager.js +394 -0
- package/src/renderer/core/CullingSystem.js +308 -0
- package/src/renderer/core/EntityManager.js +541 -0
- package/src/renderer/core/InstanceManager.js +343 -0
- package/src/renderer/core/ParticleEmitter.js +358 -0
- package/src/renderer/core/ParticleSystem.js +564 -0
- package/src/renderer/core/SpriteSystem.js +349 -0
- package/src/renderer/gltf.js +563 -0
- package/src/renderer/math.js +161 -0
- package/src/renderer/rendering/HistoryBufferManager.js +333 -0
- package/src/renderer/rendering/ProbeCapture.js +1495 -0
- package/src/renderer/rendering/ReflectionProbeManager.js +352 -0
- package/src/renderer/rendering/RenderGraph.js +2258 -0
- package/src/renderer/rendering/passes/AOPass.js +308 -0
- package/src/renderer/rendering/passes/AmbientCapturePass.js +593 -0
- package/src/renderer/rendering/passes/BasePass.js +101 -0
- package/src/renderer/rendering/passes/BloomPass.js +420 -0
- package/src/renderer/rendering/passes/CRTPass.js +724 -0
- package/src/renderer/rendering/passes/FogPass.js +445 -0
- package/src/renderer/rendering/passes/GBufferPass.js +730 -0
- package/src/renderer/rendering/passes/HiZPass.js +744 -0
- package/src/renderer/rendering/passes/LightingPass.js +753 -0
- package/src/renderer/rendering/passes/ParticlePass.js +841 -0
- package/src/renderer/rendering/passes/PlanarReflectionPass.js +456 -0
- package/src/renderer/rendering/passes/PostProcessPass.js +405 -0
- package/src/renderer/rendering/passes/ReflectionPass.js +157 -0
- package/src/renderer/rendering/passes/RenderPostPass.js +364 -0
- package/src/renderer/rendering/passes/SSGIPass.js +266 -0
- package/src/renderer/rendering/passes/SSGITilePass.js +305 -0
- package/src/renderer/rendering/passes/ShadowPass.js +2072 -0
- package/src/renderer/rendering/passes/TransparentPass.js +831 -0
- package/src/renderer/rendering/passes/VolumetricFogPass.js +715 -0
- package/src/renderer/rendering/shaders/ao.wgsl +182 -0
- package/src/renderer/rendering/shaders/bloom.wgsl +97 -0
- package/src/renderer/rendering/shaders/bloom_blur.wgsl +80 -0
- package/src/renderer/rendering/shaders/crt.wgsl +455 -0
- package/src/renderer/rendering/shaders/depth_copy.wgsl +17 -0
- package/src/renderer/rendering/shaders/geometry.wgsl +580 -0
- package/src/renderer/rendering/shaders/hiz_reduce.wgsl +114 -0
- package/src/renderer/rendering/shaders/light_culling.wgsl +204 -0
- package/src/renderer/rendering/shaders/lighting.wgsl +932 -0
- package/src/renderer/rendering/shaders/lighting_common.wgsl +143 -0
- package/src/renderer/rendering/shaders/particle_render.wgsl +672 -0
- package/src/renderer/rendering/shaders/particle_simulate.wgsl +440 -0
- package/src/renderer/rendering/shaders/postproc.wgsl +293 -0
- package/src/renderer/rendering/shaders/render_post.wgsl +289 -0
- package/src/renderer/rendering/shaders/shadow.wgsl +117 -0
- package/src/renderer/rendering/shaders/ssgi.wgsl +266 -0
- package/src/renderer/rendering/shaders/ssgi_accumulate.wgsl +114 -0
- package/src/renderer/rendering/shaders/ssgi_propagate.wgsl +132 -0
- package/src/renderer/rendering/shaders/volumetric_blur.wgsl +80 -0
- package/src/renderer/rendering/shaders/volumetric_composite.wgsl +80 -0
- package/src/renderer/rendering/shaders/volumetric_raymarch.wgsl +634 -0
- package/src/renderer/utils/BoundingSphere.js +439 -0
- package/src/renderer/utils/Frustum.js +281 -0
- package/src/renderer/utils/Raycaster.js +761 -0
- package/dist/client.d.cts +0 -211
- package/dist/client.d.ts +0 -211
- package/dist/server.d.cts +0 -120
- package/dist/server.d.ts +0 -120
- package/dist/terminal.d.cts +0 -64
- package/dist/terminal.d.ts +0 -64
- package/src/utils.ts +0 -403
package/dist/terminal.cjs
CHANGED
|
@@ -1,138 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
T_FG_BRIGHT_DEFAULT: () => T_FG_BRIGHT_DEFAULT,
|
|
53
|
-
T_FG_BRIGHT_GREEN: () => T_FG_BRIGHT_GREEN,
|
|
54
|
-
T_FG_BRIGHT_MAGENTA: () => T_FG_BRIGHT_MAGENTA,
|
|
55
|
-
T_FG_BRIGHT_RED: () => T_FG_BRIGHT_RED,
|
|
56
|
-
T_FG_BRIGHT_WHITE: () => T_FG_BRIGHT_WHITE,
|
|
57
|
-
T_FG_BRIGHT_YELLOW: () => T_FG_BRIGHT_YELLOW,
|
|
58
|
-
T_FG_CYAN: () => T_FG_CYAN,
|
|
59
|
-
T_FG_DEFAULT: () => T_FG_DEFAULT,
|
|
60
|
-
T_FG_GREEN: () => T_FG_GREEN,
|
|
61
|
-
T_FG_MAGENTA: () => T_FG_MAGENTA,
|
|
62
|
-
T_FG_RED: () => T_FG_RED,
|
|
63
|
-
T_FG_WHITE: () => T_FG_WHITE,
|
|
64
|
-
T_FG_YELLOW: () => T_FG_YELLOW,
|
|
65
|
-
T_HIDE: () => T_HIDE,
|
|
66
|
-
T_HIDE_OFF: () => T_HIDE_OFF,
|
|
67
|
-
T_RESET: () => T_RESET,
|
|
68
|
-
T_REVERSE: () => T_REVERSE,
|
|
69
|
-
T_REVERSE_OFF: () => T_REVERSE_OFF,
|
|
70
|
-
T_UNDERLINE: () => T_UNDERLINE,
|
|
71
|
-
T_UNDERLINE_OFF: () => T_UNDERLINE_OFF,
|
|
72
|
-
clear: () => clear,
|
|
73
|
-
clearLine: () => clearLine,
|
|
74
|
-
cursorBackward: () => cursorBackward,
|
|
75
|
-
cursorDown: () => cursorDown,
|
|
76
|
-
cursorForward: () => cursorForward,
|
|
77
|
-
cursorPosition: () => cursorPosition,
|
|
78
|
-
cursorUp: () => cursorUp,
|
|
79
|
-
eraseEOL: () => eraseEOL,
|
|
80
|
-
resetColor: () => resetColor,
|
|
81
|
-
restoreCursor: () => restoreCursor,
|
|
82
|
-
saveCursor: () => saveCursor,
|
|
83
|
-
setColor: () => setColor,
|
|
84
|
-
setTitle: () => setTitle
|
|
85
|
-
});
|
|
86
|
-
module.exports = __toCommonJS(terminal_exports);
|
|
87
|
-
var T_RESET = 0;
|
|
88
|
-
var T_BOLD = 1;
|
|
89
|
-
var T_DIM = 2;
|
|
90
|
-
var T_UNDERLINE = 4;
|
|
91
|
-
var T_BLINK = 5;
|
|
92
|
-
var T_REVERSE = 7;
|
|
93
|
-
var T_HIDE = 8;
|
|
94
|
-
var T_BOLD_OFF = 21;
|
|
95
|
-
var T_DIM_OFF = 22;
|
|
96
|
-
var T_UNDERLINE_OFF = 24;
|
|
97
|
-
var T_BLINK_OFF = 25;
|
|
98
|
-
var T_REVERSE_OFF = 27;
|
|
99
|
-
var T_HIDE_OFF = 28;
|
|
100
|
-
var T_FG_BLACK = 30;
|
|
101
|
-
var T_FG_RED = 31;
|
|
102
|
-
var T_FG_GREEN = 32;
|
|
103
|
-
var T_FG_YELLOW = 33;
|
|
104
|
-
var T_FG_BLUE = 34;
|
|
105
|
-
var T_FG_MAGENTA = 35;
|
|
106
|
-
var T_FG_CYAN = 36;
|
|
107
|
-
var T_FG_WHITE = 37;
|
|
108
|
-
var T_FG_DEFAULT = 39;
|
|
109
|
-
var T_BG_BLACK = 40;
|
|
110
|
-
var T_BG_RED = 41;
|
|
111
|
-
var T_BG_GREEN = 42;
|
|
112
|
-
var T_BG_YELLOW = 43;
|
|
113
|
-
var T_BG_BLUE = 44;
|
|
114
|
-
var T_BG_MAGENTA = 45;
|
|
115
|
-
var T_BG_CYAN = 46;
|
|
116
|
-
var T_BG_WHITE = 47;
|
|
117
|
-
var T_BG_DEFAULT = 49;
|
|
118
|
-
var T_FG_BRIGHT_BLACK = 90;
|
|
119
|
-
var T_FG_BRIGHT_RED = 91;
|
|
120
|
-
var T_FG_BRIGHT_GREEN = 92;
|
|
121
|
-
var T_FG_BRIGHT_YELLOW = 93;
|
|
122
|
-
var T_FG_BRIGHT_BLUE = 94;
|
|
123
|
-
var T_FG_BRIGHT_MAGENTA = 95;
|
|
124
|
-
var T_FG_BRIGHT_CYAN = 96;
|
|
125
|
-
var T_FG_BRIGHT_WHITE = 97;
|
|
126
|
-
var T_FG_BRIGHT_DEFAULT = 99;
|
|
127
|
-
var T_BG_BRIGHT_BLACK = 100;
|
|
128
|
-
var T_BG_BRIGHT_RED = 101;
|
|
129
|
-
var T_BG_BRIGHT_GREEN = 102;
|
|
130
|
-
var T_BG_BRIGHT_YELLOW = 103;
|
|
131
|
-
var T_BG_BRIGHT_BLUE = 104;
|
|
132
|
-
var T_BG_BRIGHT_MAGENTA = 105;
|
|
133
|
-
var T_BG_BRIGHT_CYAN = 106;
|
|
134
|
-
var T_BG_BRIGHT_WHITE = 107;
|
|
135
|
-
var T_BG_BRIGHT_DEFAULT = 109;
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const T_RESET = 0;
|
|
4
|
+
const T_BOLD = 1;
|
|
5
|
+
const T_DIM = 2;
|
|
6
|
+
const T_UNDERLINE = 4;
|
|
7
|
+
const T_BLINK = 5;
|
|
8
|
+
const T_REVERSE = 7;
|
|
9
|
+
const T_HIDE = 8;
|
|
10
|
+
const T_BOLD_OFF = 21;
|
|
11
|
+
const T_DIM_OFF = 22;
|
|
12
|
+
const T_UNDERLINE_OFF = 24;
|
|
13
|
+
const T_BLINK_OFF = 25;
|
|
14
|
+
const T_REVERSE_OFF = 27;
|
|
15
|
+
const T_HIDE_OFF = 28;
|
|
16
|
+
const T_FG_BLACK = 30;
|
|
17
|
+
const T_FG_RED = 31;
|
|
18
|
+
const T_FG_GREEN = 32;
|
|
19
|
+
const T_FG_YELLOW = 33;
|
|
20
|
+
const T_FG_BLUE = 34;
|
|
21
|
+
const T_FG_MAGENTA = 35;
|
|
22
|
+
const T_FG_CYAN = 36;
|
|
23
|
+
const T_FG_WHITE = 37;
|
|
24
|
+
const T_FG_DEFAULT = 39;
|
|
25
|
+
const T_BG_BLACK = 40;
|
|
26
|
+
const T_BG_RED = 41;
|
|
27
|
+
const T_BG_GREEN = 42;
|
|
28
|
+
const T_BG_YELLOW = 43;
|
|
29
|
+
const T_BG_BLUE = 44;
|
|
30
|
+
const T_BG_MAGENTA = 45;
|
|
31
|
+
const T_BG_CYAN = 46;
|
|
32
|
+
const T_BG_WHITE = 47;
|
|
33
|
+
const T_BG_DEFAULT = 49;
|
|
34
|
+
const T_FG_BRIGHT_BLACK = 90;
|
|
35
|
+
const T_FG_BRIGHT_RED = 91;
|
|
36
|
+
const T_FG_BRIGHT_GREEN = 92;
|
|
37
|
+
const T_FG_BRIGHT_YELLOW = 93;
|
|
38
|
+
const T_FG_BRIGHT_BLUE = 94;
|
|
39
|
+
const T_FG_BRIGHT_MAGENTA = 95;
|
|
40
|
+
const T_FG_BRIGHT_CYAN = 96;
|
|
41
|
+
const T_FG_BRIGHT_WHITE = 97;
|
|
42
|
+
const T_FG_BRIGHT_DEFAULT = 99;
|
|
43
|
+
const T_BG_BRIGHT_BLACK = 100;
|
|
44
|
+
const T_BG_BRIGHT_RED = 101;
|
|
45
|
+
const T_BG_BRIGHT_GREEN = 102;
|
|
46
|
+
const T_BG_BRIGHT_YELLOW = 103;
|
|
47
|
+
const T_BG_BRIGHT_BLUE = 104;
|
|
48
|
+
const T_BG_BRIGHT_MAGENTA = 105;
|
|
49
|
+
const T_BG_BRIGHT_CYAN = 106;
|
|
50
|
+
const T_BG_BRIGHT_WHITE = 107;
|
|
51
|
+
const T_BG_BRIGHT_DEFAULT = 109;
|
|
136
52
|
function setTitle(title) {
|
|
137
53
|
process.stdout.write("\x1B]0;" + title + "\x07");
|
|
138
54
|
}
|
|
@@ -172,69 +88,66 @@ function saveCursor() {
|
|
|
172
88
|
function restoreCursor() {
|
|
173
89
|
process.stdout.write("\x1B[u");
|
|
174
90
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
setTitle
|
|
239
|
-
});
|
|
240
|
-
//# sourceMappingURL=terminal.cjs.map
|
|
91
|
+
exports.T_BG_BLACK = T_BG_BLACK;
|
|
92
|
+
exports.T_BG_BLUE = T_BG_BLUE;
|
|
93
|
+
exports.T_BG_BRIGHT_BLACK = T_BG_BRIGHT_BLACK;
|
|
94
|
+
exports.T_BG_BRIGHT_BLUE = T_BG_BRIGHT_BLUE;
|
|
95
|
+
exports.T_BG_BRIGHT_CYAN = T_BG_BRIGHT_CYAN;
|
|
96
|
+
exports.T_BG_BRIGHT_DEFAULT = T_BG_BRIGHT_DEFAULT;
|
|
97
|
+
exports.T_BG_BRIGHT_GREEN = T_BG_BRIGHT_GREEN;
|
|
98
|
+
exports.T_BG_BRIGHT_MAGENTA = T_BG_BRIGHT_MAGENTA;
|
|
99
|
+
exports.T_BG_BRIGHT_RED = T_BG_BRIGHT_RED;
|
|
100
|
+
exports.T_BG_BRIGHT_WHITE = T_BG_BRIGHT_WHITE;
|
|
101
|
+
exports.T_BG_BRIGHT_YELLOW = T_BG_BRIGHT_YELLOW;
|
|
102
|
+
exports.T_BG_CYAN = T_BG_CYAN;
|
|
103
|
+
exports.T_BG_DEFAULT = T_BG_DEFAULT;
|
|
104
|
+
exports.T_BG_GREEN = T_BG_GREEN;
|
|
105
|
+
exports.T_BG_MAGENTA = T_BG_MAGENTA;
|
|
106
|
+
exports.T_BG_RED = T_BG_RED;
|
|
107
|
+
exports.T_BG_WHITE = T_BG_WHITE;
|
|
108
|
+
exports.T_BG_YELLOW = T_BG_YELLOW;
|
|
109
|
+
exports.T_BLINK = T_BLINK;
|
|
110
|
+
exports.T_BLINK_OFF = T_BLINK_OFF;
|
|
111
|
+
exports.T_BOLD = T_BOLD;
|
|
112
|
+
exports.T_BOLD_OFF = T_BOLD_OFF;
|
|
113
|
+
exports.T_DIM = T_DIM;
|
|
114
|
+
exports.T_DIM_OFF = T_DIM_OFF;
|
|
115
|
+
exports.T_FG_BLACK = T_FG_BLACK;
|
|
116
|
+
exports.T_FG_BLUE = T_FG_BLUE;
|
|
117
|
+
exports.T_FG_BRIGHT_BLACK = T_FG_BRIGHT_BLACK;
|
|
118
|
+
exports.T_FG_BRIGHT_BLUE = T_FG_BRIGHT_BLUE;
|
|
119
|
+
exports.T_FG_BRIGHT_CYAN = T_FG_BRIGHT_CYAN;
|
|
120
|
+
exports.T_FG_BRIGHT_DEFAULT = T_FG_BRIGHT_DEFAULT;
|
|
121
|
+
exports.T_FG_BRIGHT_GREEN = T_FG_BRIGHT_GREEN;
|
|
122
|
+
exports.T_FG_BRIGHT_MAGENTA = T_FG_BRIGHT_MAGENTA;
|
|
123
|
+
exports.T_FG_BRIGHT_RED = T_FG_BRIGHT_RED;
|
|
124
|
+
exports.T_FG_BRIGHT_WHITE = T_FG_BRIGHT_WHITE;
|
|
125
|
+
exports.T_FG_BRIGHT_YELLOW = T_FG_BRIGHT_YELLOW;
|
|
126
|
+
exports.T_FG_CYAN = T_FG_CYAN;
|
|
127
|
+
exports.T_FG_DEFAULT = T_FG_DEFAULT;
|
|
128
|
+
exports.T_FG_GREEN = T_FG_GREEN;
|
|
129
|
+
exports.T_FG_MAGENTA = T_FG_MAGENTA;
|
|
130
|
+
exports.T_FG_RED = T_FG_RED;
|
|
131
|
+
exports.T_FG_WHITE = T_FG_WHITE;
|
|
132
|
+
exports.T_FG_YELLOW = T_FG_YELLOW;
|
|
133
|
+
exports.T_HIDE = T_HIDE;
|
|
134
|
+
exports.T_HIDE_OFF = T_HIDE_OFF;
|
|
135
|
+
exports.T_RESET = T_RESET;
|
|
136
|
+
exports.T_REVERSE = T_REVERSE;
|
|
137
|
+
exports.T_REVERSE_OFF = T_REVERSE_OFF;
|
|
138
|
+
exports.T_UNDERLINE = T_UNDERLINE;
|
|
139
|
+
exports.T_UNDERLINE_OFF = T_UNDERLINE_OFF;
|
|
140
|
+
exports.clear = clear;
|
|
141
|
+
exports.clearLine = clearLine;
|
|
142
|
+
exports.cursorBackward = cursorBackward;
|
|
143
|
+
exports.cursorDown = cursorDown;
|
|
144
|
+
exports.cursorForward = cursorForward;
|
|
145
|
+
exports.cursorPosition = cursorPosition;
|
|
146
|
+
exports.cursorUp = cursorUp;
|
|
147
|
+
exports.eraseEOL = eraseEOL;
|
|
148
|
+
exports.resetColor = resetColor;
|
|
149
|
+
exports.restoreCursor = restoreCursor;
|
|
150
|
+
exports.saveCursor = saveCursor;
|
|
151
|
+
exports.setColor = setColor;
|
|
152
|
+
exports.setTitle = setTitle;
|
|
153
|
+
//# sourceMappingURL=terminal.cjs.map
|
package/dist/terminal.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/terminal.js"],"sourcesContent":["/*\r\n┌─────────┬─────────┬──────┬───────────┬─────────────┬──────────────────┐\r\n│ Color │ Example │ Text │ Background│ Bright Text │ Bright Background│\r\n├─────────┼─────────┼──────┼───────────┼─────────────┼──────────────────┤\r\n│ Black │ Black │ 30 │ 40 │ 90 │ 100 │\r\n│ Red │ Red │ 31 │ 41 │ 91 │ 101 │\r\n│ Green │ Green │ 32 │ 42 │ 92 │ 102 │\r\n│ Yellow │ Yellow │ 33 │ 43 │ 93 │ 103 │\r\n│ Blue │ Blue │ 34 │ 44 │ 94 │ 104 │\r\n│ Magenta │ Magenta │ 35 │ 45 │ 95 │ 105 │\r\n│ Cyan │ Cyan │ 36 │ 46 │ 96 │ 106 │\r\n│ White │ White │ 37 │ 47 │ 97 │ 107 │\r\n│ Default │ │ 39 │ 49 │ 99 │ 109 │\r\n└─────────┴─────────┴──────┴───────────┴─────────────┴──────────────────┘\r\n\r\n┌───────────┬─────┬─────┐\r\n│ Effect │ On │ Off │\r\n├───────────┼─────┼─────┤\r\n│ Bold │ 1 │ 21 │\r\n│ Dim │ 2 │ 22 │\r\n│ Underline │ 4 │ 24 │\r\n│ Blink │ 5 │ 25 │\r\n│ Reverse │ 7 │ 27 │\r\n│ Hide │ 8 │ 28 │\r\n└───────────┴─────┴─────┘\r\n*/\r\n\r\n// Terminal control code constants\r\nexport const T_RESET = 0;\r\nexport const T_BOLD = 1;\r\nexport const T_DIM = 2;\r\nexport const T_UNDERLINE = 4;\r\nexport const T_BLINK = 5;\r\nexport const T_REVERSE = 7;\r\nexport const T_HIDE = 8;\r\nexport const T_BOLD_OFF = 21;\r\nexport const T_DIM_OFF = 22;\r\nexport const T_UNDERLINE_OFF = 24;\r\nexport const T_BLINK_OFF = 25;\r\nexport const T_REVERSE_OFF = 27;\r\nexport const T_HIDE_OFF = 28;\r\n\r\nexport const T_FG_BLACK = 30;\r\nexport const T_FG_RED = 31;\r\nexport const T_FG_GREEN = 32;\r\nexport const T_FG_YELLOW = 33;\r\nexport const T_FG_BLUE = 34;\r\nexport const T_FG_MAGENTA = 35;\r\nexport const T_FG_CYAN = 36;\r\nexport const T_FG_WHITE = 37;\r\nexport const T_FG_DEFAULT = 39;\r\n\r\nexport const T_BG_BLACK = 40;\r\nexport const T_BG_RED = 41;\r\nexport const T_BG_GREEN = 42;\r\nexport const T_BG_YELLOW = 43;\r\nexport const T_BG_BLUE = 44;\r\nexport const T_BG_MAGENTA = 45;\r\nexport const T_BG_CYAN = 46;\r\nexport const T_BG_WHITE = 47;\r\nexport const T_BG_DEFAULT = 49;\r\n\r\nexport const T_FG_BRIGHT_BLACK = 90;\r\nexport const T_FG_BRIGHT_RED = 91;\r\nexport const T_FG_BRIGHT_GREEN = 92;\r\nexport const T_FG_BRIGHT_YELLOW = 93;\r\nexport const T_FG_BRIGHT_BLUE = 94;\r\nexport const T_FG_BRIGHT_MAGENTA = 95;\r\nexport const T_FG_BRIGHT_CYAN = 96;\r\nexport const T_FG_BRIGHT_WHITE = 97;\r\nexport const T_FG_BRIGHT_DEFAULT = 99;\r\n\r\nexport const T_BG_BRIGHT_BLACK = 100;\r\nexport const T_BG_BRIGHT_RED = 101;\r\nexport const T_BG_BRIGHT_GREEN = 102;\r\nexport const T_BG_BRIGHT_YELLOW = 103;\r\nexport const T_BG_BRIGHT_BLUE = 104;\r\nexport const T_BG_BRIGHT_MAGENTA = 105;\r\nexport const T_BG_BRIGHT_CYAN = 106;\r\nexport const T_BG_BRIGHT_WHITE = 107;\r\nexport const T_BG_BRIGHT_DEFAULT = 109;\r\n\r\n\r\n// Set terminal title\r\nexport function setTitle(title) {\r\n process.stdout.write(\"\\x1b]0;\" + title + \"\\x07\");\r\n}\r\n\r\n// Set terminal color / effect\r\nexport function setColor(color) {\r\n process.stdout.write(`\\x1b[${color}m`);\r\n}\r\n\r\n// Reset terminal color\r\nexport function resetColor() {\r\n setColor(T_RESET);\r\n}\r\n\r\n// Clear line\r\nexport function clearLine() {\r\n process.stdout.write(\"\\x1b[2K\");\r\n}\r\n\r\n// Erase to end of line\r\nexport function eraseEOL() {\r\n process.stdout.write(\"\\x1b[K\");\r\n}\r\n\r\n// Clear screen\r\nexport function clear() {\r\n process.stdout.write(\"\\x1b[2J\");\r\n}\r\n\r\n// Set cursor position\r\nexport function cursorPosition(line, column) {\r\n process.stdout.write(`\\x1b[${line};${column}H`);\r\n}\r\n// Move cursor up\r\nexport function cursorUp(lines = 1) {\r\n process.stdout.write(`\\x1b[${lines}A`);\r\n}\r\n// Move cursor down\r\nexport function cursorDown(lines = 1) {\r\n process.stdout.write(`\\x1b[${lines}B`);\r\n}\r\n\r\n// Move cursor forward\r\nexport function cursorForward(columns = 1) {\r\n process.stdout.write(`\\x1b[${columns}C`);\r\n}\r\n// Move cursor backward\r\nexport function cursorBackward(columns = 1) {\r\n process.stdout.write(`\\x1b[${columns}D`);\r\n}\r\n\r\n// Save cursor position\r\nexport function saveCursor() {\r\n process.stdout.write(\"\\x1b[s\");\r\n}\r\n\r\n// Restore cursor position\r\nexport function restoreCursor() {\r\n process.stdout.write(\"\\x1b[u\");\r\n}\r\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"terminal.cjs","sources":["../src/network/terminal.js"],"sourcesContent":["/*\r\n┌─────────┬─────────┬──────┬───────────┬─────────────┬──────────────────┐\r\n│ Color │ Example │ Text │ Background│ Bright Text │ Bright Background│\r\n├─────────┼─────────┼──────┼───────────┼─────────────┼──────────────────┤\r\n│ Black │ Black │ 30 │ 40 │ 90 │ 100 │\r\n│ Red │ Red │ 31 │ 41 │ 91 │ 101 │\r\n│ Green │ Green │ 32 │ 42 │ 92 │ 102 │\r\n│ Yellow │ Yellow │ 33 │ 43 │ 93 │ 103 │\r\n│ Blue │ Blue │ 34 │ 44 │ 94 │ 104 │\r\n│ Magenta │ Magenta │ 35 │ 45 │ 95 │ 105 │\r\n│ Cyan │ Cyan │ 36 │ 46 │ 96 │ 106 │\r\n│ White │ White │ 37 │ 47 │ 97 │ 107 │\r\n│ Default │ │ 39 │ 49 │ 99 │ 109 │\r\n└─────────┴─────────┴──────┴───────────┴─────────────┴──────────────────┘\r\n\r\n┌───────────┬─────┬─────┐\r\n│ Effect │ On │ Off │\r\n├───────────┼─────┼─────┤\r\n│ Bold │ 1 │ 21 │\r\n│ Dim │ 2 │ 22 │\r\n│ Underline │ 4 │ 24 │\r\n│ Blink │ 5 │ 25 │\r\n│ Reverse │ 7 │ 27 │\r\n│ Hide │ 8 │ 28 │\r\n└───────────┴─────┴─────┘\r\n*/\r\n\r\n// Terminal control code constants\r\nexport const T_RESET = 0;\r\nexport const T_BOLD = 1;\r\nexport const T_DIM = 2;\r\nexport const T_UNDERLINE = 4;\r\nexport const T_BLINK = 5;\r\nexport const T_REVERSE = 7;\r\nexport const T_HIDE = 8;\r\nexport const T_BOLD_OFF = 21;\r\nexport const T_DIM_OFF = 22;\r\nexport const T_UNDERLINE_OFF = 24;\r\nexport const T_BLINK_OFF = 25;\r\nexport const T_REVERSE_OFF = 27;\r\nexport const T_HIDE_OFF = 28;\r\n\r\nexport const T_FG_BLACK = 30;\r\nexport const T_FG_RED = 31;\r\nexport const T_FG_GREEN = 32;\r\nexport const T_FG_YELLOW = 33;\r\nexport const T_FG_BLUE = 34;\r\nexport const T_FG_MAGENTA = 35;\r\nexport const T_FG_CYAN = 36;\r\nexport const T_FG_WHITE = 37;\r\nexport const T_FG_DEFAULT = 39;\r\n\r\nexport const T_BG_BLACK = 40;\r\nexport const T_BG_RED = 41;\r\nexport const T_BG_GREEN = 42;\r\nexport const T_BG_YELLOW = 43;\r\nexport const T_BG_BLUE = 44;\r\nexport const T_BG_MAGENTA = 45;\r\nexport const T_BG_CYAN = 46;\r\nexport const T_BG_WHITE = 47;\r\nexport const T_BG_DEFAULT = 49;\r\n\r\nexport const T_FG_BRIGHT_BLACK = 90;\r\nexport const T_FG_BRIGHT_RED = 91;\r\nexport const T_FG_BRIGHT_GREEN = 92;\r\nexport const T_FG_BRIGHT_YELLOW = 93;\r\nexport const T_FG_BRIGHT_BLUE = 94;\r\nexport const T_FG_BRIGHT_MAGENTA = 95;\r\nexport const T_FG_BRIGHT_CYAN = 96;\r\nexport const T_FG_BRIGHT_WHITE = 97;\r\nexport const T_FG_BRIGHT_DEFAULT = 99;\r\n\r\nexport const T_BG_BRIGHT_BLACK = 100;\r\nexport const T_BG_BRIGHT_RED = 101;\r\nexport const T_BG_BRIGHT_GREEN = 102;\r\nexport const T_BG_BRIGHT_YELLOW = 103;\r\nexport const T_BG_BRIGHT_BLUE = 104;\r\nexport const T_BG_BRIGHT_MAGENTA = 105;\r\nexport const T_BG_BRIGHT_CYAN = 106;\r\nexport const T_BG_BRIGHT_WHITE = 107;\r\nexport const T_BG_BRIGHT_DEFAULT = 109;\r\n\r\n\r\n// Set terminal title\r\nexport function setTitle(title) {\r\n process.stdout.write(\"\\x1b]0;\" + title + \"\\x07\");\r\n}\r\n\r\n// Set terminal color / effect\r\nexport function setColor(color) {\r\n process.stdout.write(`\\x1b[${color}m`);\r\n}\r\n\r\n// Reset terminal color\r\nexport function resetColor() {\r\n setColor(T_RESET);\r\n}\r\n\r\n// Clear line\r\nexport function clearLine() {\r\n process.stdout.write(\"\\x1b[2K\");\r\n}\r\n\r\n// Erase to end of line\r\nexport function eraseEOL() {\r\n process.stdout.write(\"\\x1b[K\");\r\n}\r\n\r\n// Clear screen\r\nexport function clear() {\r\n process.stdout.write(\"\\x1b[2J\");\r\n}\r\n\r\n// Set cursor position\r\nexport function cursorPosition(line, column) {\r\n process.stdout.write(`\\x1b[${line};${column}H`);\r\n}\r\n// Move cursor up\r\nexport function cursorUp(lines = 1) {\r\n process.stdout.write(`\\x1b[${lines}A`);\r\n}\r\n// Move cursor down\r\nexport function cursorDown(lines = 1) {\r\n process.stdout.write(`\\x1b[${lines}B`);\r\n}\r\n\r\n// Move cursor forward\r\nexport function cursorForward(columns = 1) {\r\n process.stdout.write(`\\x1b[${columns}C`);\r\n}\r\n// Move cursor backward\r\nexport function cursorBackward(columns = 1) {\r\n process.stdout.write(`\\x1b[${columns}D`);\r\n}\r\n\r\n// Save cursor position\r\nexport function saveCursor() {\r\n process.stdout.write(\"\\x1b[s\");\r\n}\r\n\r\n// Restore cursor position\r\nexport function restoreCursor() {\r\n process.stdout.write(\"\\x1b[u\");\r\n}\r\n"],"names":[],"mappings":";;AA4BY,MAAC,UAAU;AACX,MAAC,SAAS;AACV,MAAC,QAAQ;AACT,MAAC,cAAc;AACf,MAAC,UAAU;AACX,MAAC,YAAY;AACb,MAAC,SAAS;AACV,MAAC,aAAa;AACd,MAAC,YAAY;AACb,MAAC,kBAAkB;AACnB,MAAC,cAAc;AACf,MAAC,gBAAgB;AACjB,MAAC,aAAa;AAEd,MAAC,aAAa;AACd,MAAC,WAAW;AACZ,MAAC,aAAa;AACd,MAAC,cAAc;AACf,MAAC,YAAY;AACb,MAAC,eAAe;AAChB,MAAC,YAAY;AACb,MAAC,aAAa;AACd,MAAC,eAAe;AAEhB,MAAC,aAAa;AACd,MAAC,WAAW;AACZ,MAAC,aAAa;AACd,MAAC,cAAc;AACf,MAAC,YAAY;AACb,MAAC,eAAe;AAChB,MAAC,YAAY;AACb,MAAC,aAAa;AACd,MAAC,eAAe;AAEhB,MAAC,oBAAoB;AACrB,MAAC,kBAAkB;AACnB,MAAC,oBAAoB;AACrB,MAAC,qBAAqB;AACtB,MAAC,mBAAmB;AACpB,MAAC,sBAAsB;AACvB,MAAC,mBAAmB;AACpB,MAAC,oBAAoB;AACrB,MAAC,sBAAsB;AAEvB,MAAC,oBAAoB;AACrB,MAAC,kBAAkB;AACnB,MAAC,oBAAoB;AACrB,MAAC,qBAAqB;AACtB,MAAC,mBAAmB;AACpB,MAAC,sBAAsB;AACvB,MAAC,mBAAmB;AACpB,MAAC,oBAAoB;AACrB,MAAC,sBAAsB;AAI5B,SAAS,SAAS,OAAO;AAC9B,UAAQ,OAAO,MAAM,YAAY,QAAQ,MAAM;AACjD;AAGO,SAAS,SAAS,OAAO;AAC9B,UAAQ,OAAO,MAAM,QAAQ,KAAK,GAAG;AACvC;AAGO,SAAS,aAAa;AAC3B,WAAS,OAAO;AAClB;AAGO,SAAS,YAAY;AAC1B,UAAQ,OAAO,MAAM,SAAS;AAChC;AAGO,SAAS,WAAW;AACzB,UAAQ,OAAO,MAAM,QAAQ;AAC/B;AAGO,SAAS,QAAQ;AACtB,UAAQ,OAAO,MAAM,SAAS;AAChC;AAGO,SAAS,eAAe,MAAM,QAAQ;AAC3C,UAAQ,OAAO,MAAM,QAAQ,IAAI,IAAI,MAAM,GAAG;AAChD;AAEO,SAAS,SAAS,QAAQ,GAAG;AAClC,UAAQ,OAAO,MAAM,QAAQ,KAAK,GAAG;AACvC;AAEO,SAAS,WAAW,QAAQ,GAAG;AACpC,UAAQ,OAAO,MAAM,QAAQ,KAAK,GAAG;AACvC;AAGO,SAAS,cAAc,UAAU,GAAG;AACzC,UAAQ,OAAO,MAAM,QAAQ,OAAO,GAAG;AACzC;AAEO,SAAS,eAAe,UAAU,GAAG;AAC1C,UAAQ,OAAO,MAAM,QAAQ,OAAO,GAAG;AACzC;AAGO,SAAS,aAAa;AAC3B,UAAQ,OAAO,MAAM,QAAQ;AAC/B;AAGO,SAAS,gBAAgB;AAC9B,UAAQ,OAAO,MAAM,QAAQ;AAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/terminal.js
CHANGED
|
@@ -1,53 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var T_BG_BRIGHT_DEFAULT = 109;
|
|
1
|
+
const T_RESET = 0;
|
|
2
|
+
const T_BOLD = 1;
|
|
3
|
+
const T_DIM = 2;
|
|
4
|
+
const T_UNDERLINE = 4;
|
|
5
|
+
const T_BLINK = 5;
|
|
6
|
+
const T_REVERSE = 7;
|
|
7
|
+
const T_HIDE = 8;
|
|
8
|
+
const T_BOLD_OFF = 21;
|
|
9
|
+
const T_DIM_OFF = 22;
|
|
10
|
+
const T_UNDERLINE_OFF = 24;
|
|
11
|
+
const T_BLINK_OFF = 25;
|
|
12
|
+
const T_REVERSE_OFF = 27;
|
|
13
|
+
const T_HIDE_OFF = 28;
|
|
14
|
+
const T_FG_BLACK = 30;
|
|
15
|
+
const T_FG_RED = 31;
|
|
16
|
+
const T_FG_GREEN = 32;
|
|
17
|
+
const T_FG_YELLOW = 33;
|
|
18
|
+
const T_FG_BLUE = 34;
|
|
19
|
+
const T_FG_MAGENTA = 35;
|
|
20
|
+
const T_FG_CYAN = 36;
|
|
21
|
+
const T_FG_WHITE = 37;
|
|
22
|
+
const T_FG_DEFAULT = 39;
|
|
23
|
+
const T_BG_BLACK = 40;
|
|
24
|
+
const T_BG_RED = 41;
|
|
25
|
+
const T_BG_GREEN = 42;
|
|
26
|
+
const T_BG_YELLOW = 43;
|
|
27
|
+
const T_BG_BLUE = 44;
|
|
28
|
+
const T_BG_MAGENTA = 45;
|
|
29
|
+
const T_BG_CYAN = 46;
|
|
30
|
+
const T_BG_WHITE = 47;
|
|
31
|
+
const T_BG_DEFAULT = 49;
|
|
32
|
+
const T_FG_BRIGHT_BLACK = 90;
|
|
33
|
+
const T_FG_BRIGHT_RED = 91;
|
|
34
|
+
const T_FG_BRIGHT_GREEN = 92;
|
|
35
|
+
const T_FG_BRIGHT_YELLOW = 93;
|
|
36
|
+
const T_FG_BRIGHT_BLUE = 94;
|
|
37
|
+
const T_FG_BRIGHT_MAGENTA = 95;
|
|
38
|
+
const T_FG_BRIGHT_CYAN = 96;
|
|
39
|
+
const T_FG_BRIGHT_WHITE = 97;
|
|
40
|
+
const T_FG_BRIGHT_DEFAULT = 99;
|
|
41
|
+
const T_BG_BRIGHT_BLACK = 100;
|
|
42
|
+
const T_BG_BRIGHT_RED = 101;
|
|
43
|
+
const T_BG_BRIGHT_GREEN = 102;
|
|
44
|
+
const T_BG_BRIGHT_YELLOW = 103;
|
|
45
|
+
const T_BG_BRIGHT_BLUE = 104;
|
|
46
|
+
const T_BG_BRIGHT_MAGENTA = 105;
|
|
47
|
+
const T_BG_BRIGHT_CYAN = 106;
|
|
48
|
+
const T_BG_BRIGHT_WHITE = 107;
|
|
49
|
+
const T_BG_BRIGHT_DEFAULT = 109;
|
|
51
50
|
function setTitle(title) {
|
|
52
51
|
process.stdout.write("\x1B]0;" + title + "\x07");
|
|
53
52
|
}
|
|
@@ -151,4 +150,4 @@ export {
|
|
|
151
150
|
setColor,
|
|
152
151
|
setTitle
|
|
153
152
|
};
|
|
154
|
-
//# sourceMappingURL=terminal.js.map
|
|
153
|
+
//# sourceMappingURL=terminal.js.map
|
package/dist/terminal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/terminal.js"],"sourcesContent":["/*\r\n┌─────────┬─────────┬──────┬───────────┬─────────────┬──────────────────┐\r\n│ Color │ Example │ Text │ Background│ Bright Text │ Bright Background│\r\n├─────────┼─────────┼──────┼───────────┼─────────────┼──────────────────┤\r\n│ Black │ Black │ 30 │ 40 │ 90 │ 100 │\r\n│ Red │ Red │ 31 │ 41 │ 91 │ 101 │\r\n│ Green │ Green │ 32 │ 42 │ 92 │ 102 │\r\n│ Yellow │ Yellow │ 33 │ 43 │ 93 │ 103 │\r\n│ Blue │ Blue │ 34 │ 44 │ 94 │ 104 │\r\n│ Magenta │ Magenta │ 35 │ 45 │ 95 │ 105 │\r\n│ Cyan │ Cyan │ 36 │ 46 │ 96 │ 106 │\r\n│ White │ White │ 37 │ 47 │ 97 │ 107 │\r\n│ Default │ │ 39 │ 49 │ 99 │ 109 │\r\n└─────────┴─────────┴──────┴───────────┴─────────────┴──────────────────┘\r\n\r\n┌───────────┬─────┬─────┐\r\n│ Effect │ On │ Off │\r\n├───────────┼─────┼─────┤\r\n│ Bold │ 1 │ 21 │\r\n│ Dim │ 2 │ 22 │\r\n│ Underline │ 4 │ 24 │\r\n│ Blink │ 5 │ 25 │\r\n│ Reverse │ 7 │ 27 │\r\n│ Hide │ 8 │ 28 │\r\n└───────────┴─────┴─────┘\r\n*/\r\n\r\n// Terminal control code constants\r\nexport const T_RESET = 0;\r\nexport const T_BOLD = 1;\r\nexport const T_DIM = 2;\r\nexport const T_UNDERLINE = 4;\r\nexport const T_BLINK = 5;\r\nexport const T_REVERSE = 7;\r\nexport const T_HIDE = 8;\r\nexport const T_BOLD_OFF = 21;\r\nexport const T_DIM_OFF = 22;\r\nexport const T_UNDERLINE_OFF = 24;\r\nexport const T_BLINK_OFF = 25;\r\nexport const T_REVERSE_OFF = 27;\r\nexport const T_HIDE_OFF = 28;\r\n\r\nexport const T_FG_BLACK = 30;\r\nexport const T_FG_RED = 31;\r\nexport const T_FG_GREEN = 32;\r\nexport const T_FG_YELLOW = 33;\r\nexport const T_FG_BLUE = 34;\r\nexport const T_FG_MAGENTA = 35;\r\nexport const T_FG_CYAN = 36;\r\nexport const T_FG_WHITE = 37;\r\nexport const T_FG_DEFAULT = 39;\r\n\r\nexport const T_BG_BLACK = 40;\r\nexport const T_BG_RED = 41;\r\nexport const T_BG_GREEN = 42;\r\nexport const T_BG_YELLOW = 43;\r\nexport const T_BG_BLUE = 44;\r\nexport const T_BG_MAGENTA = 45;\r\nexport const T_BG_CYAN = 46;\r\nexport const T_BG_WHITE = 47;\r\nexport const T_BG_DEFAULT = 49;\r\n\r\nexport const T_FG_BRIGHT_BLACK = 90;\r\nexport const T_FG_BRIGHT_RED = 91;\r\nexport const T_FG_BRIGHT_GREEN = 92;\r\nexport const T_FG_BRIGHT_YELLOW = 93;\r\nexport const T_FG_BRIGHT_BLUE = 94;\r\nexport const T_FG_BRIGHT_MAGENTA = 95;\r\nexport const T_FG_BRIGHT_CYAN = 96;\r\nexport const T_FG_BRIGHT_WHITE = 97;\r\nexport const T_FG_BRIGHT_DEFAULT = 99;\r\n\r\nexport const T_BG_BRIGHT_BLACK = 100;\r\nexport const T_BG_BRIGHT_RED = 101;\r\nexport const T_BG_BRIGHT_GREEN = 102;\r\nexport const T_BG_BRIGHT_YELLOW = 103;\r\nexport const T_BG_BRIGHT_BLUE = 104;\r\nexport const T_BG_BRIGHT_MAGENTA = 105;\r\nexport const T_BG_BRIGHT_CYAN = 106;\r\nexport const T_BG_BRIGHT_WHITE = 107;\r\nexport const T_BG_BRIGHT_DEFAULT = 109;\r\n\r\n\r\n// Set terminal title\r\nexport function setTitle(title) {\r\n process.stdout.write(\"\\x1b]0;\" + title + \"\\x07\");\r\n}\r\n\r\n// Set terminal color / effect\r\nexport function setColor(color) {\r\n process.stdout.write(`\\x1b[${color}m`);\r\n}\r\n\r\n// Reset terminal color\r\nexport function resetColor() {\r\n setColor(T_RESET);\r\n}\r\n\r\n// Clear line\r\nexport function clearLine() {\r\n process.stdout.write(\"\\x1b[2K\");\r\n}\r\n\r\n// Erase to end of line\r\nexport function eraseEOL() {\r\n process.stdout.write(\"\\x1b[K\");\r\n}\r\n\r\n// Clear screen\r\nexport function clear() {\r\n process.stdout.write(\"\\x1b[2J\");\r\n}\r\n\r\n// Set cursor position\r\nexport function cursorPosition(line, column) {\r\n process.stdout.write(`\\x1b[${line};${column}H`);\r\n}\r\n// Move cursor up\r\nexport function cursorUp(lines = 1) {\r\n process.stdout.write(`\\x1b[${lines}A`);\r\n}\r\n// Move cursor down\r\nexport function cursorDown(lines = 1) {\r\n process.stdout.write(`\\x1b[${lines}B`);\r\n}\r\n\r\n// Move cursor forward\r\nexport function cursorForward(columns = 1) {\r\n process.stdout.write(`\\x1b[${columns}C`);\r\n}\r\n// Move cursor backward\r\nexport function cursorBackward(columns = 1) {\r\n process.stdout.write(`\\x1b[${columns}D`);\r\n}\r\n\r\n// Save cursor position\r\nexport function saveCursor() {\r\n process.stdout.write(\"\\x1b[s\");\r\n}\r\n\r\n// Restore cursor position\r\nexport function restoreCursor() {\r\n process.stdout.write(\"\\x1b[u\");\r\n}\r\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"terminal.js","sources":["../src/network/terminal.js"],"sourcesContent":["/*\r\n┌─────────┬─────────┬──────┬───────────┬─────────────┬──────────────────┐\r\n│ Color │ Example │ Text │ Background│ Bright Text │ Bright Background│\r\n├─────────┼─────────┼──────┼───────────┼─────────────┼──────────────────┤\r\n│ Black │ Black │ 30 │ 40 │ 90 │ 100 │\r\n│ Red │ Red │ 31 │ 41 │ 91 │ 101 │\r\n│ Green │ Green │ 32 │ 42 │ 92 │ 102 │\r\n│ Yellow │ Yellow │ 33 │ 43 │ 93 │ 103 │\r\n│ Blue │ Blue │ 34 │ 44 │ 94 │ 104 │\r\n│ Magenta │ Magenta │ 35 │ 45 │ 95 │ 105 │\r\n│ Cyan │ Cyan │ 36 │ 46 │ 96 │ 106 │\r\n│ White │ White │ 37 │ 47 │ 97 │ 107 │\r\n│ Default │ │ 39 │ 49 │ 99 │ 109 │\r\n└─────────┴─────────┴──────┴───────────┴─────────────┴──────────────────┘\r\n\r\n┌───────────┬─────┬─────┐\r\n│ Effect │ On │ Off │\r\n├───────────┼─────┼─────┤\r\n│ Bold │ 1 │ 21 │\r\n│ Dim │ 2 │ 22 │\r\n│ Underline │ 4 │ 24 │\r\n│ Blink │ 5 │ 25 │\r\n│ Reverse │ 7 │ 27 │\r\n│ Hide │ 8 │ 28 │\r\n└───────────┴─────┴─────┘\r\n*/\r\n\r\n// Terminal control code constants\r\nexport const T_RESET = 0;\r\nexport const T_BOLD = 1;\r\nexport const T_DIM = 2;\r\nexport const T_UNDERLINE = 4;\r\nexport const T_BLINK = 5;\r\nexport const T_REVERSE = 7;\r\nexport const T_HIDE = 8;\r\nexport const T_BOLD_OFF = 21;\r\nexport const T_DIM_OFF = 22;\r\nexport const T_UNDERLINE_OFF = 24;\r\nexport const T_BLINK_OFF = 25;\r\nexport const T_REVERSE_OFF = 27;\r\nexport const T_HIDE_OFF = 28;\r\n\r\nexport const T_FG_BLACK = 30;\r\nexport const T_FG_RED = 31;\r\nexport const T_FG_GREEN = 32;\r\nexport const T_FG_YELLOW = 33;\r\nexport const T_FG_BLUE = 34;\r\nexport const T_FG_MAGENTA = 35;\r\nexport const T_FG_CYAN = 36;\r\nexport const T_FG_WHITE = 37;\r\nexport const T_FG_DEFAULT = 39;\r\n\r\nexport const T_BG_BLACK = 40;\r\nexport const T_BG_RED = 41;\r\nexport const T_BG_GREEN = 42;\r\nexport const T_BG_YELLOW = 43;\r\nexport const T_BG_BLUE = 44;\r\nexport const T_BG_MAGENTA = 45;\r\nexport const T_BG_CYAN = 46;\r\nexport const T_BG_WHITE = 47;\r\nexport const T_BG_DEFAULT = 49;\r\n\r\nexport const T_FG_BRIGHT_BLACK = 90;\r\nexport const T_FG_BRIGHT_RED = 91;\r\nexport const T_FG_BRIGHT_GREEN = 92;\r\nexport const T_FG_BRIGHT_YELLOW = 93;\r\nexport const T_FG_BRIGHT_BLUE = 94;\r\nexport const T_FG_BRIGHT_MAGENTA = 95;\r\nexport const T_FG_BRIGHT_CYAN = 96;\r\nexport const T_FG_BRIGHT_WHITE = 97;\r\nexport const T_FG_BRIGHT_DEFAULT = 99;\r\n\r\nexport const T_BG_BRIGHT_BLACK = 100;\r\nexport const T_BG_BRIGHT_RED = 101;\r\nexport const T_BG_BRIGHT_GREEN = 102;\r\nexport const T_BG_BRIGHT_YELLOW = 103;\r\nexport const T_BG_BRIGHT_BLUE = 104;\r\nexport const T_BG_BRIGHT_MAGENTA = 105;\r\nexport const T_BG_BRIGHT_CYAN = 106;\r\nexport const T_BG_BRIGHT_WHITE = 107;\r\nexport const T_BG_BRIGHT_DEFAULT = 109;\r\n\r\n\r\n// Set terminal title\r\nexport function setTitle(title) {\r\n process.stdout.write(\"\\x1b]0;\" + title + \"\\x07\");\r\n}\r\n\r\n// Set terminal color / effect\r\nexport function setColor(color) {\r\n process.stdout.write(`\\x1b[${color}m`);\r\n}\r\n\r\n// Reset terminal color\r\nexport function resetColor() {\r\n setColor(T_RESET);\r\n}\r\n\r\n// Clear line\r\nexport function clearLine() {\r\n process.stdout.write(\"\\x1b[2K\");\r\n}\r\n\r\n// Erase to end of line\r\nexport function eraseEOL() {\r\n process.stdout.write(\"\\x1b[K\");\r\n}\r\n\r\n// Clear screen\r\nexport function clear() {\r\n process.stdout.write(\"\\x1b[2J\");\r\n}\r\n\r\n// Set cursor position\r\nexport function cursorPosition(line, column) {\r\n process.stdout.write(`\\x1b[${line};${column}H`);\r\n}\r\n// Move cursor up\r\nexport function cursorUp(lines = 1) {\r\n process.stdout.write(`\\x1b[${lines}A`);\r\n}\r\n// Move cursor down\r\nexport function cursorDown(lines = 1) {\r\n process.stdout.write(`\\x1b[${lines}B`);\r\n}\r\n\r\n// Move cursor forward\r\nexport function cursorForward(columns = 1) {\r\n process.stdout.write(`\\x1b[${columns}C`);\r\n}\r\n// Move cursor backward\r\nexport function cursorBackward(columns = 1) {\r\n process.stdout.write(`\\x1b[${columns}D`);\r\n}\r\n\r\n// Save cursor position\r\nexport function saveCursor() {\r\n process.stdout.write(\"\\x1b[s\");\r\n}\r\n\r\n// Restore cursor position\r\nexport function restoreCursor() {\r\n process.stdout.write(\"\\x1b[u\");\r\n}\r\n"],"names":[],"mappings":"AA4BY,MAAC,UAAU;AACX,MAAC,SAAS;AACV,MAAC,QAAQ;AACT,MAAC,cAAc;AACf,MAAC,UAAU;AACX,MAAC,YAAY;AACb,MAAC,SAAS;AACV,MAAC,aAAa;AACd,MAAC,YAAY;AACb,MAAC,kBAAkB;AACnB,MAAC,cAAc;AACf,MAAC,gBAAgB;AACjB,MAAC,aAAa;AAEd,MAAC,aAAa;AACd,MAAC,WAAW;AACZ,MAAC,aAAa;AACd,MAAC,cAAc;AACf,MAAC,YAAY;AACb,MAAC,eAAe;AAChB,MAAC,YAAY;AACb,MAAC,aAAa;AACd,MAAC,eAAe;AAEhB,MAAC,aAAa;AACd,MAAC,WAAW;AACZ,MAAC,aAAa;AACd,MAAC,cAAc;AACf,MAAC,YAAY;AACb,MAAC,eAAe;AAChB,MAAC,YAAY;AACb,MAAC,aAAa;AACd,MAAC,eAAe;AAEhB,MAAC,oBAAoB;AACrB,MAAC,kBAAkB;AACnB,MAAC,oBAAoB;AACrB,MAAC,qBAAqB;AACtB,MAAC,mBAAmB;AACpB,MAAC,sBAAsB;AACvB,MAAC,mBAAmB;AACpB,MAAC,oBAAoB;AACrB,MAAC,sBAAsB;AAEvB,MAAC,oBAAoB;AACrB,MAAC,kBAAkB;AACnB,MAAC,oBAAoB;AACrB,MAAC,qBAAqB;AACtB,MAAC,mBAAmB;AACpB,MAAC,sBAAsB;AACvB,MAAC,mBAAmB;AACpB,MAAC,oBAAoB;AACrB,MAAC,sBAAsB;AAI5B,SAAS,SAAS,OAAO;AAC9B,UAAQ,OAAO,MAAM,YAAY,QAAQ,MAAM;AACjD;AAGO,SAAS,SAAS,OAAO;AAC9B,UAAQ,OAAO,MAAM,QAAQ,KAAK,GAAG;AACvC;AAGO,SAAS,aAAa;AAC3B,WAAS,OAAO;AAClB;AAGO,SAAS,YAAY;AAC1B,UAAQ,OAAO,MAAM,SAAS;AAChC;AAGO,SAAS,WAAW;AACzB,UAAQ,OAAO,MAAM,QAAQ;AAC/B;AAGO,SAAS,QAAQ;AACtB,UAAQ,OAAO,MAAM,SAAS;AAChC;AAGO,SAAS,eAAe,MAAM,QAAQ;AAC3C,UAAQ,OAAO,MAAM,QAAQ,IAAI,IAAI,MAAM,GAAG;AAChD;AAEO,SAAS,SAAS,QAAQ,GAAG;AAClC,UAAQ,OAAO,MAAM,QAAQ,KAAK,GAAG;AACvC;AAEO,SAAS,WAAW,QAAQ,GAAG;AACpC,UAAQ,OAAO,MAAM,QAAQ,KAAK,GAAG;AACvC;AAGO,SAAS,cAAc,UAAU,GAAG;AACzC,UAAQ,OAAO,MAAM,QAAQ,OAAO,GAAG;AACzC;AAEO,SAAS,eAAe,UAAU,GAAG;AAC1C,UAAQ,OAAO,MAAM,QAAQ,OAAO,GAAG;AACzC;AAGO,SAAS,aAAa;AAC3B,UAAQ,OAAO,MAAM,QAAQ;AAC/B;AAGO,SAAS,gBAAgB;AAC9B,UAAQ,OAAO,MAAM,QAAQ;AAC/B;"}
|