@shell-shock/preset-script 0.1.1 → 0.1.2
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/README.md +1 -1
- package/dist/components/args-parser-logic.cjs +678 -0
- package/dist/components/args-parser-logic.cjs.map +1 -0
- package/dist/components/args-parser-logic.d.cts +45 -0
- package/dist/components/args-parser-logic.d.cts.map +1 -0
- package/dist/components/args-parser-logic.d.mts +45 -0
- package/dist/components/args-parser-logic.d.mts.map +1 -0
- package/dist/components/args-parser-logic.mjs +672 -0
- package/dist/components/args-parser-logic.mjs.map +1 -0
- package/dist/components/bin-entry.cjs +179 -0
- package/dist/components/bin-entry.cjs.map +1 -0
- package/dist/components/{entry/bin.d.cts → bin-entry.d.cts} +9 -3
- package/dist/components/bin-entry.d.cts.map +1 -0
- package/dist/components/{entry/bin.d.mts → bin-entry.d.mts} +9 -3
- package/dist/components/bin-entry.d.mts.map +1 -0
- package/dist/components/bin-entry.mjs +176 -0
- package/dist/components/bin-entry.mjs.map +1 -0
- package/dist/components/command-entry.cjs +162 -0
- package/dist/components/command-entry.cjs.map +1 -0
- package/dist/components/command-entry.d.cts +24 -0
- package/dist/components/command-entry.d.cts.map +1 -0
- package/dist/components/command-entry.d.mts +24 -0
- package/dist/components/command-entry.d.mts.map +1 -0
- package/dist/components/command-entry.mjs +158 -0
- package/dist/components/command-entry.mjs.map +1 -0
- package/dist/components/command-router.cjs +104 -74
- package/dist/components/command-router.cjs.map +1 -1
- package/dist/components/command-router.d.cts +13 -4
- package/dist/components/command-router.d.cts.map +1 -0
- package/dist/components/command-router.d.mts +13 -4
- package/dist/components/command-router.d.mts.map +1 -0
- package/dist/components/command-router.mjs +103 -73
- package/dist/components/command-router.mjs.map +1 -1
- package/dist/components/console-builtin.cjs +2083 -0
- package/dist/components/console-builtin.cjs.map +1 -0
- package/dist/components/console-builtin.d.cts +56 -0
- package/dist/components/console-builtin.d.cts.map +1 -0
- package/dist/components/console-builtin.d.mts +56 -0
- package/dist/components/console-builtin.d.mts.map +1 -0
- package/dist/components/console-builtin.mjs +2074 -0
- package/dist/components/console-builtin.mjs.map +1 -0
- package/dist/components/help.cjs +130 -0
- package/dist/components/help.cjs.map +1 -0
- package/dist/components/help.d.cts +57 -0
- package/dist/components/help.d.cts.map +1 -0
- package/dist/components/help.d.mts +57 -0
- package/dist/components/help.d.mts.map +1 -0
- package/dist/components/help.mjs +126 -0
- package/dist/components/help.mjs.map +1 -0
- package/dist/components/index.cjs +39 -15
- package/dist/components/index.d.cts +9 -7
- package/dist/components/index.d.mts +9 -7
- package/dist/components/index.mjs +8 -6
- package/dist/components/utils-builtin.cjs +612 -0
- package/dist/components/utils-builtin.cjs.map +1 -0
- package/dist/components/utils-builtin.d.cts +32 -0
- package/dist/components/utils-builtin.d.cts.map +1 -0
- package/dist/components/utils-builtin.d.mts +32 -0
- package/dist/components/utils-builtin.d.mts.map +1 -0
- package/dist/components/utils-builtin.mjs +605 -0
- package/dist/components/utils-builtin.mjs.map +1 -0
- package/dist/components/virtual-command-entry.cjs +133 -0
- package/dist/components/virtual-command-entry.cjs.map +1 -0
- package/dist/components/virtual-command-entry.d.cts +21 -0
- package/dist/components/virtual-command-entry.d.cts.map +1 -0
- package/dist/components/virtual-command-entry.d.mts +21 -0
- package/dist/components/virtual-command-entry.d.mts.map +1 -0
- package/dist/components/virtual-command-entry.mjs +130 -0
- package/dist/components/virtual-command-entry.mjs.map +1 -0
- package/dist/contexts/index.cjs +4 -0
- package/dist/contexts/index.d.cts +2 -0
- package/dist/contexts/index.d.mts +2 -0
- package/dist/contexts/index.mjs +3 -0
- package/dist/contexts/theme.d.cts +20 -0
- package/dist/contexts/theme.d.cts.map +1 -0
- package/dist/contexts/theme.d.mts +20 -0
- package/dist/contexts/theme.d.mts.map +1 -0
- package/dist/helpers/ansi-utils.cjs +28 -4
- package/dist/helpers/ansi-utils.cjs.map +1 -1
- package/dist/helpers/ansi-utils.d.cts +68 -0
- package/dist/helpers/ansi-utils.d.cts.map +1 -0
- package/dist/helpers/ansi-utils.d.mts +68 -0
- package/dist/helpers/ansi-utils.d.mts.map +1 -0
- package/dist/helpers/ansi-utils.mjs +28 -4
- package/dist/helpers/ansi-utils.mjs.map +1 -1
- package/dist/helpers/get-default-options.cjs +6 -13
- package/dist/helpers/get-default-options.cjs.map +1 -1
- package/dist/helpers/get-default-options.mjs +6 -13
- package/dist/helpers/get-default-options.mjs.map +1 -1
- package/dist/index.cjs +114 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +115 -28
- package/dist/index.mjs.map +1 -1
- package/dist/types/plugin.d.cts +1 -6
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +1 -6
- package/dist/types/plugin.d.mts.map +1 -0
- package/package.json +163 -71
- package/dist/components/builtin/console.cjs +0 -1232
- package/dist/components/builtin/console.cjs.map +0 -1
- package/dist/components/builtin/console.d.cts +0 -37
- package/dist/components/builtin/console.d.mts +0 -37
- package/dist/components/builtin/console.mjs +0 -1225
- package/dist/components/builtin/console.mjs.map +0 -1
- package/dist/components/builtin/index.cjs +0 -9
- package/dist/components/builtin/index.d.cts +0 -2
- package/dist/components/builtin/index.d.mts +0 -2
- package/dist/components/builtin/index.mjs +0 -3
- package/dist/components/entry/bin.cjs +0 -92
- package/dist/components/entry/bin.cjs.map +0 -1
- package/dist/components/entry/bin.mjs +0 -91
- package/dist/components/entry/bin.mjs.map +0 -1
- package/dist/components/entry/command.cjs +0 -54
- package/dist/components/entry/command.cjs.map +0 -1
- package/dist/components/entry/command.d.cts +0 -15
- package/dist/components/entry/command.d.mts +0 -15
- package/dist/components/entry/command.mjs +0 -53
- package/dist/components/entry/command.mjs.map +0 -1
- package/dist/components/entry/index.cjs +0 -3
- package/dist/components/entry/index.d.cts +0 -2
- package/dist/components/entry/index.d.mts +0 -2
- package/dist/components/entry/index.mjs +0 -3
- package/dist/components/shutdown.cjs +0 -93
- package/dist/components/shutdown.cjs.map +0 -1
- package/dist/components/shutdown.d.cts +0 -14
- package/dist/components/shutdown.d.mts +0 -14
- package/dist/components/shutdown.mjs +0 -91
- package/dist/components/shutdown.mjs.map +0 -1
- package/dist/contexts/command.cjs +0 -21
- package/dist/contexts/command.cjs.map +0 -1
- package/dist/contexts/command.mjs +0 -19
- package/dist/contexts/command.mjs.map +0 -1
|
@@ -0,0 +1,2083 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_contexts_theme = require('../contexts/theme.cjs');
|
|
3
|
+
let __alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
|
|
4
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
5
|
+
let __alloy_js_typescript = require("@alloy-js/typescript");
|
|
6
|
+
let __powerlines_plugin_alloy_typescript_components_tsdoc = require("@powerlines/plugin-alloy/typescript/components/tsdoc");
|
|
7
|
+
let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
8
|
+
let __powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
|
|
9
|
+
|
|
10
|
+
//#region src/components/console-builtin.tsx
|
|
11
|
+
/**
|
|
12
|
+
* A component to generate a console message function in a Shell Shock project.
|
|
13
|
+
*/
|
|
14
|
+
function ColorFunction({ ansi16, ansi256, ansi16m }) {
|
|
15
|
+
return __alloy_js_core.code` (text: string) => {
|
|
16
|
+
try {
|
|
17
|
+
if (!isColorSupported) {
|
|
18
|
+
return String(text);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (colorSupportLevels.stdout === 1) {
|
|
22
|
+
return wrapAnsi(text, "${ansi16.open}", "${ansi16.close}");
|
|
23
|
+
} else if (colorSupportLevels.stdout === 2) {
|
|
24
|
+
return wrapAnsi(text, "${ansi256.open}", "${ansi256.close}");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return wrapAnsi(text, "${ansi16m.open}", "${ansi16m.close}");
|
|
28
|
+
} catch {
|
|
29
|
+
return String(text);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A component to generate an object containing functions for coloring text in a Shell Shock project.
|
|
36
|
+
*/
|
|
37
|
+
function ColorsDeclaration() {
|
|
38
|
+
const colors = require_contexts_theme.useColors();
|
|
39
|
+
return [
|
|
40
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.TypeDeclaration, {
|
|
41
|
+
"export": true,
|
|
42
|
+
name: "AnsiColor",
|
|
43
|
+
doc: "The available ANSI colors for console text.",
|
|
44
|
+
get children() {
|
|
45
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
46
|
+
get each() {
|
|
47
|
+
return Object.keys(colors.ansi16).filter((color) => color !== "theme");
|
|
48
|
+
},
|
|
49
|
+
children: (color, idx) => `${idx > 0 ? " | " : ""}"${color}"`
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
54
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
55
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
56
|
+
__alloy_js_core.code`
|
|
57
|
+
/**
|
|
58
|
+
* A recursive type that defines theme colors for console text.
|
|
59
|
+
*
|
|
60
|
+
* @remarks
|
|
61
|
+
* This type allows for nested theme color definitions, enabling complex theming structures for console applications.
|
|
62
|
+
*/
|
|
63
|
+
export type ThemeColors<T> = T extends object ? { [K in keyof T]: ThemeColors<T[K]>; } : ((text: string) => string); `,
|
|
64
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
65
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
66
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.TypeDeclaration, {
|
|
67
|
+
"export": true,
|
|
68
|
+
name: "Colors",
|
|
69
|
+
doc: "An object containing functions for coloring console applications. Each function corresponds to a terminal color. See {@link AnsiColor} for available colors.",
|
|
70
|
+
children: __alloy_js_core.code`Record<AnsiColor, (text: string) => string> & ThemeColors<ThemeColorsResolvedConfig>`
|
|
71
|
+
}),
|
|
72
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
73
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
74
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, { heading: "An object containing functions for coloring console applications. Each function corresponds to a terminal color. See {@link Colors} for available colors." }),
|
|
75
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
76
|
+
"const": true,
|
|
77
|
+
"export": true,
|
|
78
|
+
name: "colors",
|
|
79
|
+
type: "Colors",
|
|
80
|
+
get initializer() {
|
|
81
|
+
return [
|
|
82
|
+
__alloy_js_core.code` {
|
|
83
|
+
`,
|
|
84
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
85
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.For, {
|
|
86
|
+
get each() {
|
|
87
|
+
return Object.keys(colors.ansi16).filter((color) => color !== "theme");
|
|
88
|
+
},
|
|
89
|
+
comma: true,
|
|
90
|
+
doubleHardline: true,
|
|
91
|
+
enderPunctuation: true,
|
|
92
|
+
children: (color) => [__alloy_js_core.code`${color}: `, (0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
93
|
+
get ansi16() {
|
|
94
|
+
return colors.ansi16[color];
|
|
95
|
+
},
|
|
96
|
+
get ansi256() {
|
|
97
|
+
return colors.ansi256[color];
|
|
98
|
+
},
|
|
99
|
+
get ansi16m() {
|
|
100
|
+
return colors.ansi16m[color];
|
|
101
|
+
}
|
|
102
|
+
})]
|
|
103
|
+
}),
|
|
104
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
105
|
+
__alloy_js_core.code`text: {
|
|
106
|
+
banner: {
|
|
107
|
+
title: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
108
|
+
get ansi16() {
|
|
109
|
+
return colors.ansi16.theme.text.banner.title;
|
|
110
|
+
},
|
|
111
|
+
get ansi256() {
|
|
112
|
+
return colors.ansi256.theme.text.banner.title;
|
|
113
|
+
},
|
|
114
|
+
get ansi16m() {
|
|
115
|
+
return colors.ansi16m.theme.text.banner.title;
|
|
116
|
+
}
|
|
117
|
+
})},
|
|
118
|
+
header: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
119
|
+
get ansi16() {
|
|
120
|
+
return colors.ansi16.theme.text.banner.header;
|
|
121
|
+
},
|
|
122
|
+
get ansi256() {
|
|
123
|
+
return colors.ansi256.theme.text.banner.header;
|
|
124
|
+
},
|
|
125
|
+
get ansi16m() {
|
|
126
|
+
return colors.ansi16m.theme.text.banner.header;
|
|
127
|
+
}
|
|
128
|
+
})},
|
|
129
|
+
footer: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
130
|
+
get ansi16() {
|
|
131
|
+
return colors.ansi16.theme.text.banner.footer;
|
|
132
|
+
},
|
|
133
|
+
get ansi256() {
|
|
134
|
+
return colors.ansi256.theme.text.banner.footer;
|
|
135
|
+
},
|
|
136
|
+
get ansi16m() {
|
|
137
|
+
return colors.ansi16m.theme.text.banner.footer;
|
|
138
|
+
}
|
|
139
|
+
})},
|
|
140
|
+
command: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
141
|
+
get ansi16() {
|
|
142
|
+
return colors.ansi16.theme.text.banner.command;
|
|
143
|
+
},
|
|
144
|
+
get ansi256() {
|
|
145
|
+
return colors.ansi256.theme.text.banner.command;
|
|
146
|
+
},
|
|
147
|
+
get ansi16m() {
|
|
148
|
+
return colors.ansi16m.theme.text.banner.command;
|
|
149
|
+
}
|
|
150
|
+
})},
|
|
151
|
+
description: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
152
|
+
get ansi16() {
|
|
153
|
+
return colors.ansi16.theme.text.banner.description;
|
|
154
|
+
},
|
|
155
|
+
get ansi256() {
|
|
156
|
+
return colors.ansi256.theme.text.banner.description;
|
|
157
|
+
},
|
|
158
|
+
get ansi16m() {
|
|
159
|
+
return colors.ansi16m.theme.text.banner.description;
|
|
160
|
+
}
|
|
161
|
+
})}
|
|
162
|
+
},
|
|
163
|
+
heading: {
|
|
164
|
+
primary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
165
|
+
get ansi16() {
|
|
166
|
+
return colors.ansi16.theme.text.heading.primary;
|
|
167
|
+
},
|
|
168
|
+
get ansi256() {
|
|
169
|
+
return colors.ansi256.theme.text.heading.primary;
|
|
170
|
+
},
|
|
171
|
+
get ansi16m() {
|
|
172
|
+
return colors.ansi16m.theme.text.heading.primary;
|
|
173
|
+
}
|
|
174
|
+
})},
|
|
175
|
+
secondary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
176
|
+
get ansi16() {
|
|
177
|
+
return colors.ansi16.theme.text.heading.secondary;
|
|
178
|
+
},
|
|
179
|
+
get ansi256() {
|
|
180
|
+
return colors.ansi256.theme.text.heading.secondary;
|
|
181
|
+
},
|
|
182
|
+
get ansi16m() {
|
|
183
|
+
return colors.ansi16m.theme.text.heading.secondary;
|
|
184
|
+
}
|
|
185
|
+
})},
|
|
186
|
+
tertiary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
187
|
+
get ansi16() {
|
|
188
|
+
return colors.ansi16.theme.text.heading.tertiary;
|
|
189
|
+
},
|
|
190
|
+
get ansi256() {
|
|
191
|
+
return colors.ansi256.theme.text.heading.tertiary;
|
|
192
|
+
},
|
|
193
|
+
get ansi16m() {
|
|
194
|
+
return colors.ansi16m.theme.text.heading.tertiary;
|
|
195
|
+
}
|
|
196
|
+
})}
|
|
197
|
+
},
|
|
198
|
+
body: {
|
|
199
|
+
primary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
200
|
+
get ansi16() {
|
|
201
|
+
return colors.ansi16.theme.text.body.primary;
|
|
202
|
+
},
|
|
203
|
+
get ansi256() {
|
|
204
|
+
return colors.ansi256.theme.text.body.primary;
|
|
205
|
+
},
|
|
206
|
+
get ansi16m() {
|
|
207
|
+
return colors.ansi16m.theme.text.body.primary;
|
|
208
|
+
}
|
|
209
|
+
})},
|
|
210
|
+
secondary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
211
|
+
get ansi16() {
|
|
212
|
+
return colors.ansi16.theme.text.body.secondary;
|
|
213
|
+
},
|
|
214
|
+
get ansi256() {
|
|
215
|
+
return colors.ansi256.theme.text.body.secondary;
|
|
216
|
+
},
|
|
217
|
+
get ansi16m() {
|
|
218
|
+
return colors.ansi16m.theme.text.body.secondary;
|
|
219
|
+
}
|
|
220
|
+
})},
|
|
221
|
+
tertiary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
222
|
+
get ansi16() {
|
|
223
|
+
return colors.ansi16.theme.text.body.tertiary;
|
|
224
|
+
},
|
|
225
|
+
get ansi256() {
|
|
226
|
+
return colors.ansi256.theme.text.body.tertiary;
|
|
227
|
+
},
|
|
228
|
+
get ansi16m() {
|
|
229
|
+
return colors.ansi16m.theme.text.body.tertiary;
|
|
230
|
+
}
|
|
231
|
+
})},
|
|
232
|
+
link: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
233
|
+
get ansi16() {
|
|
234
|
+
return colors.ansi16.theme.text.body.link;
|
|
235
|
+
},
|
|
236
|
+
get ansi256() {
|
|
237
|
+
return colors.ansi256.theme.text.body.link;
|
|
238
|
+
},
|
|
239
|
+
get ansi16m() {
|
|
240
|
+
return colors.ansi16m.theme.text.body.link;
|
|
241
|
+
}
|
|
242
|
+
})}
|
|
243
|
+
},
|
|
244
|
+
message: {
|
|
245
|
+
link: {
|
|
246
|
+
help: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
247
|
+
get ansi16() {
|
|
248
|
+
return colors.ansi16.theme.text.message.link.help;
|
|
249
|
+
},
|
|
250
|
+
get ansi256() {
|
|
251
|
+
return colors.ansi256.theme.text.message.link.help;
|
|
252
|
+
},
|
|
253
|
+
get ansi16m() {
|
|
254
|
+
return colors.ansi16m.theme.text.message.link.help;
|
|
255
|
+
}
|
|
256
|
+
})},
|
|
257
|
+
success: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
258
|
+
get ansi16() {
|
|
259
|
+
return colors.ansi16.theme.text.message.link.success;
|
|
260
|
+
},
|
|
261
|
+
get ansi256() {
|
|
262
|
+
return colors.ansi256.theme.text.message.link.success;
|
|
263
|
+
},
|
|
264
|
+
get ansi16m() {
|
|
265
|
+
return colors.ansi16m.theme.text.message.link.success;
|
|
266
|
+
}
|
|
267
|
+
})},
|
|
268
|
+
info: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
269
|
+
get ansi16() {
|
|
270
|
+
return colors.ansi16.theme.text.message.link.info;
|
|
271
|
+
},
|
|
272
|
+
get ansi256() {
|
|
273
|
+
return colors.ansi256.theme.text.message.link.info;
|
|
274
|
+
},
|
|
275
|
+
get ansi16m() {
|
|
276
|
+
return colors.ansi16m.theme.text.message.link.info;
|
|
277
|
+
}
|
|
278
|
+
})},
|
|
279
|
+
debug: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
280
|
+
get ansi16() {
|
|
281
|
+
return colors.ansi16.theme.text.message.link.debug;
|
|
282
|
+
},
|
|
283
|
+
get ansi256() {
|
|
284
|
+
return colors.ansi256.theme.text.message.link.debug;
|
|
285
|
+
},
|
|
286
|
+
get ansi16m() {
|
|
287
|
+
return colors.ansi16m.theme.text.message.link.debug;
|
|
288
|
+
}
|
|
289
|
+
})},
|
|
290
|
+
warning: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
291
|
+
get ansi16() {
|
|
292
|
+
return colors.ansi16.theme.text.message.link.warning;
|
|
293
|
+
},
|
|
294
|
+
get ansi256() {
|
|
295
|
+
return colors.ansi256.theme.text.message.link.warning;
|
|
296
|
+
},
|
|
297
|
+
get ansi16m() {
|
|
298
|
+
return colors.ansi16m.theme.text.message.link.warning;
|
|
299
|
+
}
|
|
300
|
+
})},
|
|
301
|
+
danger: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
302
|
+
get ansi16() {
|
|
303
|
+
return colors.ansi16.theme.text.message.link.danger;
|
|
304
|
+
},
|
|
305
|
+
get ansi256() {
|
|
306
|
+
return colors.ansi256.theme.text.message.link.danger;
|
|
307
|
+
},
|
|
308
|
+
get ansi16m() {
|
|
309
|
+
return colors.ansi16m.theme.text.message.link.danger;
|
|
310
|
+
}
|
|
311
|
+
})},
|
|
312
|
+
error: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
313
|
+
get ansi16() {
|
|
314
|
+
return colors.ansi16.theme.text.message.link.error;
|
|
315
|
+
},
|
|
316
|
+
get ansi256() {
|
|
317
|
+
return colors.ansi256.theme.text.message.link.error;
|
|
318
|
+
},
|
|
319
|
+
get ansi16m() {
|
|
320
|
+
return colors.ansi16m.theme.text.message.link.error;
|
|
321
|
+
}
|
|
322
|
+
})}
|
|
323
|
+
},
|
|
324
|
+
header: {
|
|
325
|
+
help: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
326
|
+
get ansi16() {
|
|
327
|
+
return colors.ansi16.theme.text.message.header.help;
|
|
328
|
+
},
|
|
329
|
+
get ansi256() {
|
|
330
|
+
return colors.ansi256.theme.text.message.header.help;
|
|
331
|
+
},
|
|
332
|
+
get ansi16m() {
|
|
333
|
+
return colors.ansi16m.theme.text.message.header.help;
|
|
334
|
+
}
|
|
335
|
+
})},
|
|
336
|
+
success: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
337
|
+
get ansi16() {
|
|
338
|
+
return colors.ansi16.theme.text.message.header.success;
|
|
339
|
+
},
|
|
340
|
+
get ansi256() {
|
|
341
|
+
return colors.ansi256.theme.text.message.header.success;
|
|
342
|
+
},
|
|
343
|
+
get ansi16m() {
|
|
344
|
+
return colors.ansi16m.theme.text.message.header.success;
|
|
345
|
+
}
|
|
346
|
+
})},
|
|
347
|
+
info: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
348
|
+
get ansi16() {
|
|
349
|
+
return colors.ansi16.theme.text.message.header.info;
|
|
350
|
+
},
|
|
351
|
+
get ansi256() {
|
|
352
|
+
return colors.ansi256.theme.text.message.header.info;
|
|
353
|
+
},
|
|
354
|
+
get ansi16m() {
|
|
355
|
+
return colors.ansi16m.theme.text.message.header.info;
|
|
356
|
+
}
|
|
357
|
+
})},
|
|
358
|
+
debug: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
359
|
+
get ansi16() {
|
|
360
|
+
return colors.ansi16.theme.text.message.header.debug;
|
|
361
|
+
},
|
|
362
|
+
get ansi256() {
|
|
363
|
+
return colors.ansi256.theme.text.message.header.debug;
|
|
364
|
+
},
|
|
365
|
+
get ansi16m() {
|
|
366
|
+
return colors.ansi16m.theme.text.message.header.debug;
|
|
367
|
+
}
|
|
368
|
+
})},
|
|
369
|
+
warning: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
370
|
+
get ansi16() {
|
|
371
|
+
return colors.ansi16.theme.text.message.header.warning;
|
|
372
|
+
},
|
|
373
|
+
get ansi256() {
|
|
374
|
+
return colors.ansi256.theme.text.message.header.warning;
|
|
375
|
+
},
|
|
376
|
+
get ansi16m() {
|
|
377
|
+
return colors.ansi16m.theme.text.message.header.warning;
|
|
378
|
+
}
|
|
379
|
+
})},
|
|
380
|
+
danger: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
381
|
+
get ansi16() {
|
|
382
|
+
return colors.ansi16.theme.text.message.header.danger;
|
|
383
|
+
},
|
|
384
|
+
get ansi256() {
|
|
385
|
+
return colors.ansi256.theme.text.message.header.danger;
|
|
386
|
+
},
|
|
387
|
+
get ansi16m() {
|
|
388
|
+
return colors.ansi16m.theme.text.message.header.danger;
|
|
389
|
+
}
|
|
390
|
+
})},
|
|
391
|
+
error: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
392
|
+
get ansi16() {
|
|
393
|
+
return colors.ansi16.theme.text.message.header.error;
|
|
394
|
+
},
|
|
395
|
+
get ansi256() {
|
|
396
|
+
return colors.ansi256.theme.text.message.header.error;
|
|
397
|
+
},
|
|
398
|
+
get ansi16m() {
|
|
399
|
+
return colors.ansi16m.theme.text.message.header.error;
|
|
400
|
+
}
|
|
401
|
+
})}
|
|
402
|
+
},
|
|
403
|
+
footer: {
|
|
404
|
+
help: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
405
|
+
get ansi16() {
|
|
406
|
+
return colors.ansi16.theme.text.message.footer.help;
|
|
407
|
+
},
|
|
408
|
+
get ansi256() {
|
|
409
|
+
return colors.ansi256.theme.text.message.footer.help;
|
|
410
|
+
},
|
|
411
|
+
get ansi16m() {
|
|
412
|
+
return colors.ansi16m.theme.text.message.footer.help;
|
|
413
|
+
}
|
|
414
|
+
})},
|
|
415
|
+
success: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
416
|
+
get ansi16() {
|
|
417
|
+
return colors.ansi16.theme.text.message.footer.success;
|
|
418
|
+
},
|
|
419
|
+
get ansi256() {
|
|
420
|
+
return colors.ansi256.theme.text.message.footer.success;
|
|
421
|
+
},
|
|
422
|
+
get ansi16m() {
|
|
423
|
+
return colors.ansi16m.theme.text.message.footer.success;
|
|
424
|
+
}
|
|
425
|
+
})},
|
|
426
|
+
info: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
427
|
+
get ansi16() {
|
|
428
|
+
return colors.ansi16.theme.text.message.footer.info;
|
|
429
|
+
},
|
|
430
|
+
get ansi256() {
|
|
431
|
+
return colors.ansi256.theme.text.message.footer.info;
|
|
432
|
+
},
|
|
433
|
+
get ansi16m() {
|
|
434
|
+
return colors.ansi16m.theme.text.message.footer.info;
|
|
435
|
+
}
|
|
436
|
+
})},
|
|
437
|
+
debug: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
438
|
+
get ansi16() {
|
|
439
|
+
return colors.ansi16.theme.text.message.footer.debug;
|
|
440
|
+
},
|
|
441
|
+
get ansi256() {
|
|
442
|
+
return colors.ansi256.theme.text.message.footer.debug;
|
|
443
|
+
},
|
|
444
|
+
get ansi16m() {
|
|
445
|
+
return colors.ansi16m.theme.text.message.footer.debug;
|
|
446
|
+
}
|
|
447
|
+
})},
|
|
448
|
+
warning: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
449
|
+
get ansi16() {
|
|
450
|
+
return colors.ansi16.theme.text.message.footer.warning;
|
|
451
|
+
},
|
|
452
|
+
get ansi256() {
|
|
453
|
+
return colors.ansi256.theme.text.message.footer.warning;
|
|
454
|
+
},
|
|
455
|
+
get ansi16m() {
|
|
456
|
+
return colors.ansi16m.theme.text.message.footer.warning;
|
|
457
|
+
}
|
|
458
|
+
})},
|
|
459
|
+
danger: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
460
|
+
get ansi16() {
|
|
461
|
+
return colors.ansi16.theme.text.message.footer.danger;
|
|
462
|
+
},
|
|
463
|
+
get ansi256() {
|
|
464
|
+
return colors.ansi256.theme.text.message.footer.danger;
|
|
465
|
+
},
|
|
466
|
+
get ansi16m() {
|
|
467
|
+
return colors.ansi16m.theme.text.message.footer.danger;
|
|
468
|
+
}
|
|
469
|
+
})},
|
|
470
|
+
error: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
471
|
+
get ansi16() {
|
|
472
|
+
return colors.ansi16.theme.text.message.footer.error;
|
|
473
|
+
},
|
|
474
|
+
get ansi256() {
|
|
475
|
+
return colors.ansi256.theme.text.message.footer.error;
|
|
476
|
+
},
|
|
477
|
+
get ansi16m() {
|
|
478
|
+
return colors.ansi16m.theme.text.message.footer.error;
|
|
479
|
+
}
|
|
480
|
+
})}
|
|
481
|
+
},
|
|
482
|
+
description: {
|
|
483
|
+
help: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
484
|
+
get ansi16() {
|
|
485
|
+
return colors.ansi16.theme.text.message.description.help;
|
|
486
|
+
},
|
|
487
|
+
get ansi256() {
|
|
488
|
+
return colors.ansi256.theme.text.message.description.help;
|
|
489
|
+
},
|
|
490
|
+
get ansi16m() {
|
|
491
|
+
return colors.ansi16m.theme.text.message.description.help;
|
|
492
|
+
}
|
|
493
|
+
})},
|
|
494
|
+
success: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
495
|
+
get ansi16() {
|
|
496
|
+
return colors.ansi16.theme.text.message.description.success;
|
|
497
|
+
},
|
|
498
|
+
get ansi256() {
|
|
499
|
+
return colors.ansi256.theme.text.message.description.success;
|
|
500
|
+
},
|
|
501
|
+
get ansi16m() {
|
|
502
|
+
return colors.ansi16m.theme.text.message.description.success;
|
|
503
|
+
}
|
|
504
|
+
})},
|
|
505
|
+
info: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
506
|
+
get ansi16() {
|
|
507
|
+
return colors.ansi16.theme.text.message.description.info;
|
|
508
|
+
},
|
|
509
|
+
get ansi256() {
|
|
510
|
+
return colors.ansi256.theme.text.message.description.info;
|
|
511
|
+
},
|
|
512
|
+
get ansi16m() {
|
|
513
|
+
return colors.ansi16m.theme.text.message.description.info;
|
|
514
|
+
}
|
|
515
|
+
})},
|
|
516
|
+
debug: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
517
|
+
get ansi16() {
|
|
518
|
+
return colors.ansi16.theme.text.message.description.debug;
|
|
519
|
+
},
|
|
520
|
+
get ansi256() {
|
|
521
|
+
return colors.ansi256.theme.text.message.description.debug;
|
|
522
|
+
},
|
|
523
|
+
get ansi16m() {
|
|
524
|
+
return colors.ansi16m.theme.text.message.description.debug;
|
|
525
|
+
}
|
|
526
|
+
})},
|
|
527
|
+
warning: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
528
|
+
get ansi16() {
|
|
529
|
+
return colors.ansi16.theme.text.message.description.warning;
|
|
530
|
+
},
|
|
531
|
+
get ansi256() {
|
|
532
|
+
return colors.ansi256.theme.text.message.description.warning;
|
|
533
|
+
},
|
|
534
|
+
get ansi16m() {
|
|
535
|
+
return colors.ansi16m.theme.text.message.description.warning;
|
|
536
|
+
}
|
|
537
|
+
})},
|
|
538
|
+
danger: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
539
|
+
get ansi16() {
|
|
540
|
+
return colors.ansi16.theme.text.message.description.danger;
|
|
541
|
+
},
|
|
542
|
+
get ansi256() {
|
|
543
|
+
return colors.ansi256.theme.text.message.description.danger;
|
|
544
|
+
},
|
|
545
|
+
get ansi16m() {
|
|
546
|
+
return colors.ansi16m.theme.text.message.description.danger;
|
|
547
|
+
}
|
|
548
|
+
})},
|
|
549
|
+
error: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
550
|
+
get ansi16() {
|
|
551
|
+
return colors.ansi16.theme.text.message.description.error;
|
|
552
|
+
},
|
|
553
|
+
get ansi256() {
|
|
554
|
+
return colors.ansi256.theme.text.message.description.error;
|
|
555
|
+
},
|
|
556
|
+
get ansi16m() {
|
|
557
|
+
return colors.ansi16m.theme.text.message.description.error;
|
|
558
|
+
}
|
|
559
|
+
})}
|
|
560
|
+
}
|
|
561
|
+
},
|
|
562
|
+
usage: {
|
|
563
|
+
bin: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
564
|
+
get ansi16() {
|
|
565
|
+
return colors.ansi16.theme.text.usage.bin;
|
|
566
|
+
},
|
|
567
|
+
get ansi256() {
|
|
568
|
+
return colors.ansi256.theme.text.usage.bin;
|
|
569
|
+
},
|
|
570
|
+
get ansi16m() {
|
|
571
|
+
return colors.ansi16m.theme.text.usage.bin;
|
|
572
|
+
}
|
|
573
|
+
})},
|
|
574
|
+
command: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
575
|
+
get ansi16() {
|
|
576
|
+
return colors.ansi16.theme.text.usage.command;
|
|
577
|
+
},
|
|
578
|
+
get ansi256() {
|
|
579
|
+
return colors.ansi256.theme.text.usage.command;
|
|
580
|
+
},
|
|
581
|
+
get ansi16m() {
|
|
582
|
+
return colors.ansi16m.theme.text.usage.command;
|
|
583
|
+
}
|
|
584
|
+
})},
|
|
585
|
+
subcommand: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
586
|
+
get ansi16() {
|
|
587
|
+
return colors.ansi16.theme.text.usage.subcommand;
|
|
588
|
+
},
|
|
589
|
+
get ansi256() {
|
|
590
|
+
return colors.ansi256.theme.text.usage.subcommand;
|
|
591
|
+
},
|
|
592
|
+
get ansi16m() {
|
|
593
|
+
return colors.ansi16m.theme.text.usage.subcommand;
|
|
594
|
+
}
|
|
595
|
+
})},
|
|
596
|
+
options: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
597
|
+
get ansi16() {
|
|
598
|
+
return colors.ansi16.theme.text.usage.options;
|
|
599
|
+
},
|
|
600
|
+
get ansi256() {
|
|
601
|
+
return colors.ansi256.theme.text.usage.options;
|
|
602
|
+
},
|
|
603
|
+
get ansi16m() {
|
|
604
|
+
return colors.ansi16m.theme.text.usage.options;
|
|
605
|
+
}
|
|
606
|
+
})},
|
|
607
|
+
params: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
608
|
+
get ansi16() {
|
|
609
|
+
return colors.ansi16.theme.text.usage.params;
|
|
610
|
+
},
|
|
611
|
+
get ansi256() {
|
|
612
|
+
return colors.ansi256.theme.text.usage.params;
|
|
613
|
+
},
|
|
614
|
+
get ansi16m() {
|
|
615
|
+
return colors.ansi16m.theme.text.usage.params;
|
|
616
|
+
}
|
|
617
|
+
})},
|
|
618
|
+
description: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
619
|
+
get ansi16() {
|
|
620
|
+
return colors.ansi16.theme.text.usage.description;
|
|
621
|
+
},
|
|
622
|
+
get ansi256() {
|
|
623
|
+
return colors.ansi256.theme.text.usage.description;
|
|
624
|
+
},
|
|
625
|
+
get ansi16m() {
|
|
626
|
+
return colors.ansi16m.theme.text.usage.description;
|
|
627
|
+
}
|
|
628
|
+
})}
|
|
629
|
+
}
|
|
630
|
+
},
|
|
631
|
+
border: {
|
|
632
|
+
banner: {
|
|
633
|
+
outline: {
|
|
634
|
+
primary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
635
|
+
get ansi16() {
|
|
636
|
+
return colors.ansi16.theme.border.banner.outline.primary;
|
|
637
|
+
},
|
|
638
|
+
get ansi256() {
|
|
639
|
+
return colors.ansi256.theme.border.banner.outline.primary;
|
|
640
|
+
},
|
|
641
|
+
get ansi16m() {
|
|
642
|
+
return colors.ansi16m.theme.border.banner.outline.primary;
|
|
643
|
+
}
|
|
644
|
+
})},
|
|
645
|
+
secondary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
646
|
+
get ansi16() {
|
|
647
|
+
return colors.ansi16.theme.border.banner.outline.secondary;
|
|
648
|
+
},
|
|
649
|
+
get ansi256() {
|
|
650
|
+
return colors.ansi256.theme.border.banner.outline.secondary;
|
|
651
|
+
},
|
|
652
|
+
get ansi16m() {
|
|
653
|
+
return colors.ansi16m.theme.border.banner.outline.secondary;
|
|
654
|
+
}
|
|
655
|
+
})},
|
|
656
|
+
tertiary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
657
|
+
get ansi16() {
|
|
658
|
+
return colors.ansi16.theme.border.banner.outline.tertiary;
|
|
659
|
+
},
|
|
660
|
+
get ansi256() {
|
|
661
|
+
return colors.ansi256.theme.border.banner.outline.tertiary;
|
|
662
|
+
},
|
|
663
|
+
get ansi16m() {
|
|
664
|
+
return colors.ansi16m.theme.border.banner.outline.tertiary;
|
|
665
|
+
}
|
|
666
|
+
})}
|
|
667
|
+
},
|
|
668
|
+
divider: {
|
|
669
|
+
primary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
670
|
+
get ansi16() {
|
|
671
|
+
return colors.ansi16.theme.border.banner.divider.primary;
|
|
672
|
+
},
|
|
673
|
+
get ansi256() {
|
|
674
|
+
return colors.ansi256.theme.border.banner.divider.primary;
|
|
675
|
+
},
|
|
676
|
+
get ansi16m() {
|
|
677
|
+
return colors.ansi16m.theme.border.banner.divider.primary;
|
|
678
|
+
}
|
|
679
|
+
})},
|
|
680
|
+
secondary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
681
|
+
get ansi16() {
|
|
682
|
+
return colors.ansi16.theme.border.banner.divider.secondary;
|
|
683
|
+
},
|
|
684
|
+
get ansi256() {
|
|
685
|
+
return colors.ansi256.theme.border.banner.divider.secondary;
|
|
686
|
+
},
|
|
687
|
+
get ansi16m() {
|
|
688
|
+
return colors.ansi16m.theme.border.banner.divider.secondary;
|
|
689
|
+
}
|
|
690
|
+
})},
|
|
691
|
+
tertiary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
692
|
+
get ansi16() {
|
|
693
|
+
return colors.ansi16.theme.border.banner.divider.tertiary;
|
|
694
|
+
},
|
|
695
|
+
get ansi256() {
|
|
696
|
+
return colors.ansi256.theme.border.banner.divider.tertiary;
|
|
697
|
+
},
|
|
698
|
+
get ansi16m() {
|
|
699
|
+
return colors.ansi16m.theme.border.banner.divider.tertiary;
|
|
700
|
+
}
|
|
701
|
+
})}
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
app: {
|
|
705
|
+
table: {
|
|
706
|
+
primary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
707
|
+
get ansi16() {
|
|
708
|
+
return colors.ansi16.theme.border.app.table.primary;
|
|
709
|
+
},
|
|
710
|
+
get ansi256() {
|
|
711
|
+
return colors.ansi256.theme.border.app.table.primary;
|
|
712
|
+
},
|
|
713
|
+
get ansi16m() {
|
|
714
|
+
return colors.ansi16m.theme.border.app.table.primary;
|
|
715
|
+
}
|
|
716
|
+
})},
|
|
717
|
+
secondary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
718
|
+
get ansi16() {
|
|
719
|
+
return colors.ansi16.theme.border.app.table.secondary;
|
|
720
|
+
},
|
|
721
|
+
get ansi256() {
|
|
722
|
+
return colors.ansi256.theme.border.app.table.secondary;
|
|
723
|
+
},
|
|
724
|
+
get ansi16m() {
|
|
725
|
+
return colors.ansi16m.theme.border.app.table.secondary;
|
|
726
|
+
}
|
|
727
|
+
})},
|
|
728
|
+
tertiary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
729
|
+
get ansi16() {
|
|
730
|
+
return colors.ansi16.theme.border.app.table.tertiary;
|
|
731
|
+
},
|
|
732
|
+
get ansi256() {
|
|
733
|
+
return colors.ansi256.theme.border.app.table.tertiary;
|
|
734
|
+
},
|
|
735
|
+
get ansi16m() {
|
|
736
|
+
return colors.ansi16m.theme.border.app.table.tertiary;
|
|
737
|
+
}
|
|
738
|
+
})}
|
|
739
|
+
},
|
|
740
|
+
divider: {
|
|
741
|
+
primary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
742
|
+
get ansi16() {
|
|
743
|
+
return colors.ansi16.theme.border.app.divider.primary;
|
|
744
|
+
},
|
|
745
|
+
get ansi256() {
|
|
746
|
+
return colors.ansi256.theme.border.app.divider.primary;
|
|
747
|
+
},
|
|
748
|
+
get ansi16m() {
|
|
749
|
+
return colors.ansi16m.theme.border.app.divider.primary;
|
|
750
|
+
}
|
|
751
|
+
})},
|
|
752
|
+
secondary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
753
|
+
get ansi16() {
|
|
754
|
+
return colors.ansi16.theme.border.app.divider.secondary;
|
|
755
|
+
},
|
|
756
|
+
get ansi256() {
|
|
757
|
+
return colors.ansi256.theme.border.app.divider.secondary;
|
|
758
|
+
},
|
|
759
|
+
get ansi16m() {
|
|
760
|
+
return colors.ansi16m.theme.border.app.divider.secondary;
|
|
761
|
+
}
|
|
762
|
+
})},
|
|
763
|
+
tertiary: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
764
|
+
get ansi16() {
|
|
765
|
+
return colors.ansi16.theme.border.app.divider.tertiary;
|
|
766
|
+
},
|
|
767
|
+
get ansi256() {
|
|
768
|
+
return colors.ansi256.theme.border.app.divider.tertiary;
|
|
769
|
+
},
|
|
770
|
+
get ansi16m() {
|
|
771
|
+
return colors.ansi16m.theme.border.app.divider.tertiary;
|
|
772
|
+
}
|
|
773
|
+
})}
|
|
774
|
+
}
|
|
775
|
+
},
|
|
776
|
+
message: {
|
|
777
|
+
outline: {
|
|
778
|
+
help: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
779
|
+
get ansi16() {
|
|
780
|
+
return colors.ansi16.theme.border.message.outline.help;
|
|
781
|
+
},
|
|
782
|
+
get ansi256() {
|
|
783
|
+
return colors.ansi256.theme.border.message.outline.help;
|
|
784
|
+
},
|
|
785
|
+
get ansi16m() {
|
|
786
|
+
return colors.ansi16m.theme.border.message.outline.help;
|
|
787
|
+
}
|
|
788
|
+
})},
|
|
789
|
+
success: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
790
|
+
get ansi16() {
|
|
791
|
+
return colors.ansi16.theme.border.message.outline.success;
|
|
792
|
+
},
|
|
793
|
+
get ansi256() {
|
|
794
|
+
return colors.ansi256.theme.border.message.outline.success;
|
|
795
|
+
},
|
|
796
|
+
get ansi16m() {
|
|
797
|
+
return colors.ansi16m.theme.border.message.outline.success;
|
|
798
|
+
}
|
|
799
|
+
})},
|
|
800
|
+
info: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
801
|
+
get ansi16() {
|
|
802
|
+
return colors.ansi16.theme.border.message.outline.info;
|
|
803
|
+
},
|
|
804
|
+
get ansi256() {
|
|
805
|
+
return colors.ansi256.theme.border.message.outline.info;
|
|
806
|
+
},
|
|
807
|
+
get ansi16m() {
|
|
808
|
+
return colors.ansi16m.theme.border.message.outline.info;
|
|
809
|
+
}
|
|
810
|
+
})},
|
|
811
|
+
debug: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
812
|
+
get ansi16() {
|
|
813
|
+
return colors.ansi16.theme.border.message.outline.debug;
|
|
814
|
+
},
|
|
815
|
+
get ansi256() {
|
|
816
|
+
return colors.ansi256.theme.border.message.outline.debug;
|
|
817
|
+
},
|
|
818
|
+
get ansi16m() {
|
|
819
|
+
return colors.ansi16m.theme.border.message.outline.debug;
|
|
820
|
+
}
|
|
821
|
+
})},
|
|
822
|
+
warning: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
823
|
+
get ansi16() {
|
|
824
|
+
return colors.ansi16.theme.border.message.outline.warning;
|
|
825
|
+
},
|
|
826
|
+
get ansi256() {
|
|
827
|
+
return colors.ansi256.theme.border.message.outline.warning;
|
|
828
|
+
},
|
|
829
|
+
get ansi16m() {
|
|
830
|
+
return colors.ansi16m.theme.border.message.outline.warning;
|
|
831
|
+
}
|
|
832
|
+
})},
|
|
833
|
+
danger: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
834
|
+
get ansi16() {
|
|
835
|
+
return colors.ansi16.theme.border.message.outline.danger;
|
|
836
|
+
},
|
|
837
|
+
get ansi256() {
|
|
838
|
+
return colors.ansi256.theme.border.message.outline.danger;
|
|
839
|
+
},
|
|
840
|
+
get ansi16m() {
|
|
841
|
+
return colors.ansi16m.theme.border.message.outline.danger;
|
|
842
|
+
}
|
|
843
|
+
})},
|
|
844
|
+
error: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
845
|
+
get ansi16() {
|
|
846
|
+
return colors.ansi16.theme.border.message.outline.error;
|
|
847
|
+
},
|
|
848
|
+
get ansi256() {
|
|
849
|
+
return colors.ansi256.theme.border.message.outline.error;
|
|
850
|
+
},
|
|
851
|
+
get ansi16m() {
|
|
852
|
+
return colors.ansi16m.theme.border.message.outline.error;
|
|
853
|
+
}
|
|
854
|
+
})}
|
|
855
|
+
},
|
|
856
|
+
divider: {
|
|
857
|
+
help: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
858
|
+
get ansi16() {
|
|
859
|
+
return colors.ansi16.theme.border.message.divider.help;
|
|
860
|
+
},
|
|
861
|
+
get ansi256() {
|
|
862
|
+
return colors.ansi256.theme.border.message.divider.help;
|
|
863
|
+
},
|
|
864
|
+
get ansi16m() {
|
|
865
|
+
return colors.ansi16m.theme.border.message.divider.help;
|
|
866
|
+
}
|
|
867
|
+
})},
|
|
868
|
+
success: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
869
|
+
get ansi16() {
|
|
870
|
+
return colors.ansi16.theme.border.message.divider.success;
|
|
871
|
+
},
|
|
872
|
+
get ansi256() {
|
|
873
|
+
return colors.ansi256.theme.border.message.divider.success;
|
|
874
|
+
},
|
|
875
|
+
get ansi16m() {
|
|
876
|
+
return colors.ansi16m.theme.border.message.divider.success;
|
|
877
|
+
}
|
|
878
|
+
})},
|
|
879
|
+
info: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
880
|
+
get ansi16() {
|
|
881
|
+
return colors.ansi16.theme.border.message.divider.info;
|
|
882
|
+
},
|
|
883
|
+
get ansi256() {
|
|
884
|
+
return colors.ansi256.theme.border.message.divider.info;
|
|
885
|
+
},
|
|
886
|
+
get ansi16m() {
|
|
887
|
+
return colors.ansi16m.theme.border.message.divider.info;
|
|
888
|
+
}
|
|
889
|
+
})},
|
|
890
|
+
debug: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
891
|
+
get ansi16() {
|
|
892
|
+
return colors.ansi16.theme.border.message.divider.debug;
|
|
893
|
+
},
|
|
894
|
+
get ansi256() {
|
|
895
|
+
return colors.ansi256.theme.border.message.divider.debug;
|
|
896
|
+
},
|
|
897
|
+
get ansi16m() {
|
|
898
|
+
return colors.ansi16m.theme.border.message.divider.debug;
|
|
899
|
+
}
|
|
900
|
+
})},
|
|
901
|
+
warning: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
902
|
+
get ansi16() {
|
|
903
|
+
return colors.ansi16.theme.border.message.divider.warning;
|
|
904
|
+
},
|
|
905
|
+
get ansi256() {
|
|
906
|
+
return colors.ansi256.theme.border.message.divider.warning;
|
|
907
|
+
},
|
|
908
|
+
get ansi16m() {
|
|
909
|
+
return colors.ansi16m.theme.border.message.divider.warning;
|
|
910
|
+
}
|
|
911
|
+
})},
|
|
912
|
+
danger: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
913
|
+
get ansi16() {
|
|
914
|
+
return colors.ansi16.theme.border.message.divider.danger;
|
|
915
|
+
},
|
|
916
|
+
get ansi256() {
|
|
917
|
+
return colors.ansi256.theme.border.message.divider.danger;
|
|
918
|
+
},
|
|
919
|
+
get ansi16m() {
|
|
920
|
+
return colors.ansi16m.theme.border.message.divider.danger;
|
|
921
|
+
}
|
|
922
|
+
})},
|
|
923
|
+
error: ${(0, __alloy_js_core_jsx_runtime.createComponent)(ColorFunction, {
|
|
924
|
+
get ansi16() {
|
|
925
|
+
return colors.ansi16.theme.border.message.divider.error;
|
|
926
|
+
},
|
|
927
|
+
get ansi256() {
|
|
928
|
+
return colors.ansi256.theme.border.message.divider.error;
|
|
929
|
+
},
|
|
930
|
+
get ansi16m() {
|
|
931
|
+
return colors.ansi16m.theme.border.message.divider.error;
|
|
932
|
+
}
|
|
933
|
+
})}
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
`
|
|
939
|
+
];
|
|
940
|
+
}
|
|
941
|
+
})
|
|
942
|
+
];
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* A component to generate the `writeLine` function in the `shell-shock:console` builtin module.
|
|
946
|
+
*/
|
|
947
|
+
function WriteLineFunctionDeclaration() {
|
|
948
|
+
const theme = require_contexts_theme.useTheme();
|
|
949
|
+
return [
|
|
950
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
951
|
+
heading: "Split text into multiple lines based on a maximum length.",
|
|
952
|
+
get children() {
|
|
953
|
+
return [
|
|
954
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This function splits the provided text into multiple lines based on the specified maximum length, ensuring that words are not broken in the middle.` }),
|
|
955
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
956
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
957
|
+
name: "text",
|
|
958
|
+
children: `The text to split into multiple lines.`
|
|
959
|
+
}),
|
|
960
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
961
|
+
name: "maxLength",
|
|
962
|
+
children: `The maximum length of each line.`
|
|
963
|
+
})
|
|
964
|
+
];
|
|
965
|
+
}
|
|
966
|
+
}),
|
|
967
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
968
|
+
name: "splitText",
|
|
969
|
+
parameters: [{
|
|
970
|
+
name: "text",
|
|
971
|
+
type: "string"
|
|
972
|
+
}, {
|
|
973
|
+
name: "maxLength",
|
|
974
|
+
type: "number"
|
|
975
|
+
}],
|
|
976
|
+
children: __alloy_js_core.code`
|
|
977
|
+
let line = text;
|
|
978
|
+
let result = [] as string[];
|
|
979
|
+
|
|
980
|
+
while (stripAnsi(line).length > maxLength) {
|
|
981
|
+
if (line.indexOf("\\n") !== -1 && stripAnsi(line).indexOf("\\n") <= maxLength) {
|
|
982
|
+
result.push(line.slice(0, line.indexOf("\\n")));
|
|
983
|
+
line = line.slice(line.indexOf("\\n") + 1);
|
|
984
|
+
} else {
|
|
985
|
+
const index = [" ", "/", "\\\\", ".", ",", "-", ":", "|", "@", "+"].reduce((ret, split) => {
|
|
986
|
+
let current = ret;
|
|
987
|
+
while (stripAnsi(line).indexOf(split, current + 1) !== -1 && stripAnsi(line).indexOf(split, current + 1) <= maxLength) {
|
|
988
|
+
current = line.indexOf(split, current + 1);
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
return current;
|
|
992
|
+
}, -1);
|
|
993
|
+
if (index === -1) {
|
|
994
|
+
break;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
result.push(line.slice(0, index));
|
|
998
|
+
line = line.slice(index + 1);
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
while (stripAnsi(line).length > maxLength) {
|
|
1003
|
+
result.push(line.slice(0, maxLength));
|
|
1004
|
+
line = line.slice(maxLength + 1);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
if (line.length > 0) {
|
|
1008
|
+
result.push(line);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
return result;
|
|
1012
|
+
`
|
|
1013
|
+
}),
|
|
1014
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1015
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1016
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceDeclaration, {
|
|
1017
|
+
"export": true,
|
|
1018
|
+
name: "WriteLineOptions",
|
|
1019
|
+
doc: "Options for writing a line to the console.",
|
|
1020
|
+
get children() {
|
|
1021
|
+
return [
|
|
1022
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1023
|
+
heading: "Padding to apply to the line",
|
|
1024
|
+
get children() {
|
|
1025
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The amount of padding (in spaces) to apply to the line when writing to the console. This value is applied to both the left and right sides of the line. If not specified, the default padding defined in the current theme configuration will be used.` });
|
|
1026
|
+
}
|
|
1027
|
+
}),
|
|
1028
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1029
|
+
name: "padding",
|
|
1030
|
+
optional: true,
|
|
1031
|
+
type: "number"
|
|
1032
|
+
}),
|
|
1033
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1034
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1035
|
+
heading: "Console function to use for writing the line",
|
|
1036
|
+
get children() {
|
|
1037
|
+
return [
|
|
1038
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The console function to use for writing the line. If not specified, the default console function \`console.log\` will be used.` }),
|
|
1039
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1040
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
1041
|
+
get type() {
|
|
1042
|
+
return __powerlines_deepkit_vendor_type.ReflectionKind.method;
|
|
1043
|
+
},
|
|
1044
|
+
defaultValue: `\`console.log\``
|
|
1045
|
+
})
|
|
1046
|
+
];
|
|
1047
|
+
}
|
|
1048
|
+
}),
|
|
1049
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1050
|
+
name: "consoleFn",
|
|
1051
|
+
optional: true,
|
|
1052
|
+
type: "(text: string) => void"
|
|
1053
|
+
}),
|
|
1054
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1055
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1056
|
+
heading: "Color of the line text",
|
|
1057
|
+
get children() {
|
|
1058
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The color to apply to the line text when writing to the console. This can be one of the predefined color themes: "primary", "secondary", or "tertiary". If not specified, no specific coloring will be applied to the text (the default/system terminal text color will likely be used).` }), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
1059
|
+
}
|
|
1060
|
+
}),
|
|
1061
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1062
|
+
name: "color",
|
|
1063
|
+
optional: true,
|
|
1064
|
+
type: "\"primary\" | \"secondary\" | \"tertiary\""
|
|
1065
|
+
})
|
|
1066
|
+
];
|
|
1067
|
+
}
|
|
1068
|
+
}),
|
|
1069
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1070
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1071
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1072
|
+
heading: "Write a line to the console.",
|
|
1073
|
+
get children() {
|
|
1074
|
+
return [
|
|
1075
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This function writes a line to the console, applying the appropriate padding as defined in the current theme configuration and wrapping as needed.` }),
|
|
1076
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1077
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1078
|
+
name: "text",
|
|
1079
|
+
children: `The line text to write to the console.`
|
|
1080
|
+
}),
|
|
1081
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1082
|
+
name: "options",
|
|
1083
|
+
children: `The options to apply when writing the line to the console.`
|
|
1084
|
+
})
|
|
1085
|
+
];
|
|
1086
|
+
}
|
|
1087
|
+
}),
|
|
1088
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
1089
|
+
"export": true,
|
|
1090
|
+
name: "writeLine",
|
|
1091
|
+
parameters: [{
|
|
1092
|
+
name: "text",
|
|
1093
|
+
type: "string | number | boolean | null",
|
|
1094
|
+
optional: true
|
|
1095
|
+
}, {
|
|
1096
|
+
name: "options",
|
|
1097
|
+
type: "WriteLineOptions",
|
|
1098
|
+
default: "{}"
|
|
1099
|
+
}],
|
|
1100
|
+
get children() {
|
|
1101
|
+
return __alloy_js_core.code`const consoleFn = options.consoleFn ?? console.log;
|
|
1102
|
+
const color = options.color;
|
|
1103
|
+
if (text === undefined || text === null || text === "") {
|
|
1104
|
+
consoleFn("");
|
|
1105
|
+
return;
|
|
1106
|
+
}
|
|
1107
|
+
|
|
1108
|
+
consoleFn(\`\${" ".repeat(Math.max(options.padding ?? ${theme.padding.app}, 0))}\${color ? colors.text.body[color](String(text)) : String(text)}\`);
|
|
1109
|
+
`;
|
|
1110
|
+
}
|
|
1111
|
+
})
|
|
1112
|
+
];
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* A component to generate the message functions in the `shell-shock:console` builtin module.
|
|
1116
|
+
*/
|
|
1117
|
+
function MessageFunctionDeclaration(props) {
|
|
1118
|
+
const { type, variant, consoleFnName, description, prefix, parameters } = props;
|
|
1119
|
+
const theme = require_contexts_theme.useTheme();
|
|
1120
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1121
|
+
get heading() {
|
|
1122
|
+
return `Write ${[
|
|
1123
|
+
"a",
|
|
1124
|
+
"e",
|
|
1125
|
+
"i",
|
|
1126
|
+
"o",
|
|
1127
|
+
"u"
|
|
1128
|
+
].includes(description.charAt(0)) ? "an" : "a"} ${description} message to the console.`;
|
|
1129
|
+
},
|
|
1130
|
+
get children() {
|
|
1131
|
+
return [
|
|
1132
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This function initializes the Powerlines environment configuration object.` }),
|
|
1133
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1134
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1135
|
+
name: "message",
|
|
1136
|
+
children: `The message to write to the console.`
|
|
1137
|
+
})
|
|
1138
|
+
];
|
|
1139
|
+
}
|
|
1140
|
+
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
1141
|
+
"export": true,
|
|
1142
|
+
name: type,
|
|
1143
|
+
parameters: parameters ?? [{
|
|
1144
|
+
name: "message",
|
|
1145
|
+
type: "string",
|
|
1146
|
+
optional: false
|
|
1147
|
+
}],
|
|
1148
|
+
get children() {
|
|
1149
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_core.Show, {
|
|
1150
|
+
get when() {
|
|
1151
|
+
return Boolean(prefix);
|
|
1152
|
+
},
|
|
1153
|
+
get children() {
|
|
1154
|
+
return [
|
|
1155
|
+
prefix,
|
|
1156
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1157
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
1158
|
+
];
|
|
1159
|
+
}
|
|
1160
|
+
}), (0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`
|
|
1161
|
+
if (!message) {
|
|
1162
|
+
return;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
writeLine(colors.border.message.outline.${variant}("${theme.borderStyles.message.outline[variant].topLeft}") + colors.border.message.outline.${variant}("${theme.borderStyles.message.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${(Math.max(theme.padding.app, 0) + Math.max(theme.padding.message, 0)) * 2 + theme.borderStyles.message.outline[variant].topLeft.length + theme.borderStyles.message.outline[variant].topRight.length}, 0) / ${theme.borderStyles.message.outline[variant].top.length ?? 1})) + colors.border.message.outline.${variant}("${theme.borderStyles.message.outline[variant].topRight}"), { consoleFn: console.${consoleFnName} });
|
|
1166
|
+
splitText(
|
|
1167
|
+
message,
|
|
1168
|
+
Math.max(process.stdout.columns - ${(Math.max(theme.padding.app, 0) + Math.max(theme.padding.message, 0)) * 2 + theme.borderStyles.message.outline[variant].left.length + theme.borderStyles.message.outline[variant].right.length}, 0)
|
|
1169
|
+
).forEach((line) => {
|
|
1170
|
+
writeLine(colors.border.message.outline.${variant}("${theme.borderStyles.message.outline[variant].left + " ".repeat(Math.max(theme.padding.message, 0))}") + line + colors.border.message.outline.${variant}("${" ".repeat(Math.max(theme.padding.message, 0)) + theme.borderStyles.message.outline[variant].right}"), { consoleFn: console.${consoleFnName} });
|
|
1171
|
+
});
|
|
1172
|
+
writeLine(colors.border.message.outline.${variant}("${theme.borderStyles.message.outline[variant].bottomLeft}") + colors.border.message.outline.${variant}("${theme.borderStyles.message.outline[variant].bottom}".repeat(Math.max(process.stdout.columns - ${(Math.max(theme.padding.app, 0) + Math.max(theme.padding.message, 0)) * 2 + theme.borderStyles.message.outline[variant].bottomLeft.length + theme.borderStyles.message.outline[variant].bottomRight.length}, 0) / ${theme.borderStyles.message.outline[variant].bottom.length ?? 1})) + colors.border.message.outline.${variant}("${theme.borderStyles.message.outline[variant].bottomRight}"), { consoleFn: console.${consoleFnName} });
|
|
1173
|
+
`)];
|
|
1174
|
+
}
|
|
1175
|
+
})];
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* A component to generate the `wrapAnsi` function in the `shell-shock:console` builtin module.
|
|
1179
|
+
*/
|
|
1180
|
+
function WrapAnsiFunction() {
|
|
1181
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1182
|
+
heading: "Applies ANSI escape codes to a string.",
|
|
1183
|
+
get children() {
|
|
1184
|
+
return [
|
|
1185
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `Split text by /\\\\u001b[\\[|\\]][0-9;]*m/ and wrap non-ANSI parts with open/closeing tags.` }),
|
|
1186
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocExample, { children: `const result = wrapAnsi("Hello\\\\u001b[31mWorld\\\\u001b[0mAgain", "\\\\u001b[36m", "\\\\u001b[39");\nconsole.log(result); // "\\\\u001b[36mHello\\\\u001b[39\\\\u001b[31mWorld\\\\u001b[0m\\\\u001b[36mAgain\\\\u001b[39"` }),
|
|
1187
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1188
|
+
name: "text",
|
|
1189
|
+
children: `The text to apply ANSI codes to.`
|
|
1190
|
+
}),
|
|
1191
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1192
|
+
name: "open",
|
|
1193
|
+
children: `The opening ANSI code.`
|
|
1194
|
+
}),
|
|
1195
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1196
|
+
name: "close",
|
|
1197
|
+
children: `The closing ANSI code.`
|
|
1198
|
+
}),
|
|
1199
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `The text with ANSI codes applied.` })
|
|
1200
|
+
];
|
|
1201
|
+
}
|
|
1202
|
+
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
1203
|
+
name: "wrapAnsi",
|
|
1204
|
+
parameters: [
|
|
1205
|
+
{
|
|
1206
|
+
name: "text",
|
|
1207
|
+
type: "string | number",
|
|
1208
|
+
optional: false
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
name: "open",
|
|
1212
|
+
type: "string",
|
|
1213
|
+
optional: false
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
name: "close",
|
|
1217
|
+
type: "string",
|
|
1218
|
+
optional: false
|
|
1219
|
+
}
|
|
1220
|
+
],
|
|
1221
|
+
children: __alloy_js_core.code`const str = String(text);
|
|
1222
|
+
const tokens = [] as string[];
|
|
1223
|
+
|
|
1224
|
+
let last = 0;
|
|
1225
|
+
let match: RegExpExecArray | null;
|
|
1226
|
+
while ((match = /\\\\u001b[\\[|\\]][0-9;]*m/g.exec(str)) !== null) {
|
|
1227
|
+
if (match.index > last) tokens.push(str.slice(last, match.index));
|
|
1228
|
+
tokens.push(match[0]);
|
|
1229
|
+
last = match.index + match[0].length;
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
if (last < str.length) {
|
|
1233
|
+
tokens.push(str.slice(last));
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
let result = "";
|
|
1237
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
1238
|
+
const seg = tokens[i]!;
|
|
1239
|
+
if (/^\\\\u001b[\\[|\\]][0-9;]*m$/.test(seg)) {
|
|
1240
|
+
result += seg;
|
|
1241
|
+
continue;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
if (!seg) {
|
|
1245
|
+
continue;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
result += i > 0 && /^\\\\u001b[\\[|\\]][0-9;]*m$/.test(tokens[i - 1]!) && i + 1 < tokens.length && /^\\\\u001b[\\[|\\]][0-9;]*m$/.test(tokens[i + 1]!)
|
|
1249
|
+
? seg
|
|
1250
|
+
: \`\${open}\${seg}\${close}\`;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
return result;
|
|
1254
|
+
`
|
|
1255
|
+
})];
|
|
1256
|
+
}
|
|
1257
|
+
/**
|
|
1258
|
+
* A component to generate the `stripAnsi` function in the `shell-shock:console` builtin module.
|
|
1259
|
+
*/
|
|
1260
|
+
function StripAnsiFunctionDeclaration() {
|
|
1261
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1262
|
+
heading: "Removes ANSI escape codes from a string.",
|
|
1263
|
+
get children() {
|
|
1264
|
+
return [
|
|
1265
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocExample, { children: `const result = stripAnsi("Hello\\\\u001b[31mWorld\\\\u001b[0mAgain"); // "HelloWorldAgain"` }),
|
|
1266
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1267
|
+
name: "text",
|
|
1268
|
+
children: `The text to strip ANSI codes from.`
|
|
1269
|
+
}),
|
|
1270
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `The text with ANSI codes removed.` })
|
|
1271
|
+
];
|
|
1272
|
+
}
|
|
1273
|
+
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
1274
|
+
"export": true,
|
|
1275
|
+
name: "stripAnsi",
|
|
1276
|
+
parameters: [{
|
|
1277
|
+
name: "text",
|
|
1278
|
+
type: "string | number",
|
|
1279
|
+
optional: false
|
|
1280
|
+
}],
|
|
1281
|
+
children: __alloy_js_core.code`return String(text).replace(new RegExp([
|
|
1282
|
+
String.raw\`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)\`,
|
|
1283
|
+
String.raw\`(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))\`
|
|
1284
|
+
].join("|"), "g"), "");`
|
|
1285
|
+
})];
|
|
1286
|
+
}
|
|
1287
|
+
/**
|
|
1288
|
+
* A component to generate the `stripAnsi` function in the `shell-shock:console` builtin module.
|
|
1289
|
+
*/
|
|
1290
|
+
function DividerFunctionDeclaration() {
|
|
1291
|
+
const theme = require_contexts_theme.useTheme();
|
|
1292
|
+
return [
|
|
1293
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceDeclaration, {
|
|
1294
|
+
"export": true,
|
|
1295
|
+
name: "DividerOptions",
|
|
1296
|
+
doc: "Options for formatting the divider line written to console.",
|
|
1297
|
+
get children() {
|
|
1298
|
+
return [
|
|
1299
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1300
|
+
name: "width",
|
|
1301
|
+
optional: true,
|
|
1302
|
+
type: "number",
|
|
1303
|
+
doc: "The width of the divider line. If not specified, the divider will span the full width of the console, minus the padding."
|
|
1304
|
+
}),
|
|
1305
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1306
|
+
heading: "The border of the divider line. Can be 'primary', 'secondary', 'tertiary', or 'none'. If not specified, the default border style will be used.",
|
|
1307
|
+
get children() {
|
|
1308
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The value provided will determine the border style and color based on the current theme configuration.` }), (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
1309
|
+
get type() {
|
|
1310
|
+
return __powerlines_deepkit_vendor_type.ReflectionKind.string;
|
|
1311
|
+
},
|
|
1312
|
+
defaultValue: "\"primary\""
|
|
1313
|
+
})];
|
|
1314
|
+
}
|
|
1315
|
+
}),
|
|
1316
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1317
|
+
name: "border",
|
|
1318
|
+
optional: true,
|
|
1319
|
+
type: "\"primary\" | \"secondary\" | \"tertiary\"",
|
|
1320
|
+
doc: "The border style/color of the divider line. Can be 'primary', 'secondary', 'tertiary', or 'none'. If not specified, the default border style will be used."
|
|
1321
|
+
}),
|
|
1322
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1323
|
+
heading: "Padding to apply to the line",
|
|
1324
|
+
get children() {
|
|
1325
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The amount of padding (in spaces) to apply to the line when writing to the console. This value is applied to both the left and right sides of the line. If not specified, the default padding defined in the current theme configuration will be used.` }), (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
1326
|
+
get type() {
|
|
1327
|
+
return __powerlines_deepkit_vendor_type.ReflectionKind.number;
|
|
1328
|
+
},
|
|
1329
|
+
get defaultValue() {
|
|
1330
|
+
return theme.padding.app * 4;
|
|
1331
|
+
}
|
|
1332
|
+
})];
|
|
1333
|
+
}
|
|
1334
|
+
}),
|
|
1335
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1336
|
+
name: "padding",
|
|
1337
|
+
optional: true,
|
|
1338
|
+
type: "number"
|
|
1339
|
+
})
|
|
1340
|
+
];
|
|
1341
|
+
}
|
|
1342
|
+
}),
|
|
1343
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1344
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1345
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1346
|
+
heading: "Write a divider line to the console.",
|
|
1347
|
+
get children() {
|
|
1348
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocExample, { children: `divider({ width: 50, border: "primary" }); // Writes a divider line of width 50 with primary border.` }), (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1349
|
+
name: "options",
|
|
1350
|
+
children: `Options for formatting the divider line.`
|
|
1351
|
+
})];
|
|
1352
|
+
}
|
|
1353
|
+
}),
|
|
1354
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
1355
|
+
"export": true,
|
|
1356
|
+
name: "divider",
|
|
1357
|
+
parameters: [{
|
|
1358
|
+
name: "options",
|
|
1359
|
+
type: "DividerOptions",
|
|
1360
|
+
optional: false
|
|
1361
|
+
}],
|
|
1362
|
+
get children() {
|
|
1363
|
+
return __alloy_js_core.code`const padding = options.padding ?? ${theme.padding.app * 4};
|
|
1364
|
+
const width = options.width ?? (process.stdout.columns - (Math.max(padding, 0) * 2));
|
|
1365
|
+
const border = options.border === "tertiary" ? colors.border.app.divider.tertiary("${theme.borderStyles.app.divider.tertiary.top}") : options.border === "secondary" ? colors.border.app.divider.secondary("${theme.borderStyles.app.divider.secondary.top}") : colors.border.app.divider.primary("${theme.borderStyles.app.divider.primary.top}");
|
|
1366
|
+
|
|
1367
|
+
writeLine(" ".repeat(padding) + border.repeat(Math.max(width / ${theme.borderStyles.app.divider.primary.top.length ?? 1}, 0)));
|
|
1368
|
+
`;
|
|
1369
|
+
}
|
|
1370
|
+
})
|
|
1371
|
+
];
|
|
1372
|
+
}
|
|
1373
|
+
/**
|
|
1374
|
+
* A component to generate the `link` function in the `shell-shock:console` builtin module.
|
|
1375
|
+
*/
|
|
1376
|
+
function LinkFunctionDeclaration() {
|
|
1377
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1378
|
+
heading: "Render a hyperlink in the console.",
|
|
1379
|
+
get children() {
|
|
1380
|
+
return [
|
|
1381
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1382
|
+
name: "url",
|
|
1383
|
+
children: `The URL to render as a hyperlink.`
|
|
1384
|
+
}),
|
|
1385
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1386
|
+
name: "text",
|
|
1387
|
+
children: `The text to display for the link. If not provided, the URL will be used as the text.`
|
|
1388
|
+
}),
|
|
1389
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocReturns, { children: `The formatted hyperlink string.` })
|
|
1390
|
+
];
|
|
1391
|
+
}
|
|
1392
|
+
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, {
|
|
1393
|
+
"export": true,
|
|
1394
|
+
name: "link",
|
|
1395
|
+
parameters: [{
|
|
1396
|
+
name: "url",
|
|
1397
|
+
type: "string",
|
|
1398
|
+
optional: false
|
|
1399
|
+
}, {
|
|
1400
|
+
name: "text",
|
|
1401
|
+
type: "string",
|
|
1402
|
+
optional: true
|
|
1403
|
+
}],
|
|
1404
|
+
get children() {
|
|
1405
|
+
return [
|
|
1406
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
1407
|
+
condition: __alloy_js_core.code`isHyperlinkSupported()`,
|
|
1408
|
+
children: __alloy_js_core.code`return \`\\u001b]8;;\${url}\\u0007\${text ?? url}\\u001b]8;;\\u0007\`;`
|
|
1409
|
+
}),
|
|
1410
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1411
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
1412
|
+
condition: __alloy_js_core.code`isColorSupported`,
|
|
1413
|
+
children: __alloy_js_core.code`return colors.underline(colors.text.body.link(\`$\{text ?? url\} $\{url\}\`));`
|
|
1414
|
+
}),
|
|
1415
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1416
|
+
__alloy_js_core.code`return \`$\{text ?? url\} $\{url\}\`;`
|
|
1417
|
+
];
|
|
1418
|
+
}
|
|
1419
|
+
})];
|
|
1420
|
+
}
|
|
1421
|
+
function extractBorderOptionsObject(direction, theme) {
|
|
1422
|
+
return `borderOptions.${direction} === "primary" ? colors.border.app.table.primary("${theme.borderStyles.app.table.primary[direction]}") : borderOptions.${direction} === "secondary" ? colors.border.app.table.secondary("${theme.borderStyles.app.table.secondary[direction]}") : borderOptions.${direction} === "tertiary" ? colors.border.app.table.tertiary("${theme.borderStyles.app.table.tertiary[direction]}") : !borderOptions.${direction} || borderOptions.${direction} === "none" ? "" : borderOptions.${direction}`;
|
|
1423
|
+
}
|
|
1424
|
+
function extractBorderOptionsString(direction, theme) {
|
|
1425
|
+
return `borderOptions === "primary" ? colors.border.app.table.primary("${theme.borderStyles.app.table.primary[direction]}") : borderOptions === "secondary" ? colors.border.app.table.secondary("${theme.borderStyles.app.table.secondary[direction]}") : borderOptions === "tertiary" ? colors.border.app.table.tertiary("${theme.borderStyles.app.table.tertiary[direction]}") : !borderOptions || borderOptions === "none" ? "" : borderOptions`;
|
|
1426
|
+
}
|
|
1427
|
+
/**
|
|
1428
|
+
* Props for the TableFunctionDeclaration component.
|
|
1429
|
+
*/
|
|
1430
|
+
/**
|
|
1431
|
+
* A component to generate the table functions in the `shell-shock:console` builtin module.
|
|
1432
|
+
*/
|
|
1433
|
+
function TableFunctionDeclaration(props) {
|
|
1434
|
+
const theme = require_contexts_theme.useTheme();
|
|
1435
|
+
return [
|
|
1436
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.TypeDeclaration, {
|
|
1437
|
+
"export": true,
|
|
1438
|
+
name: "BorderOption",
|
|
1439
|
+
doc: "The border options applied to table cells.",
|
|
1440
|
+
children: __alloy_js_core.code`"primary" | "secondary" | "tertiary" | "none" | string; `
|
|
1441
|
+
}),
|
|
1442
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1443
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1444
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceDeclaration, {
|
|
1445
|
+
"export": true,
|
|
1446
|
+
name: "TableOutputOptions",
|
|
1447
|
+
doc: "Options to customize the output of the {@link table} function.",
|
|
1448
|
+
get children() {
|
|
1449
|
+
return [
|
|
1450
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1451
|
+
heading: "Border variant for the table cell.",
|
|
1452
|
+
get children() {
|
|
1453
|
+
return [
|
|
1454
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The border variant to use for the table cell. This determines the color and style of the border around the cell.` }),
|
|
1455
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1456
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
1457
|
+
get type() {
|
|
1458
|
+
return __powerlines_deepkit_vendor_type.ReflectionKind.property;
|
|
1459
|
+
},
|
|
1460
|
+
defaultValue: "\"primary\""
|
|
1461
|
+
})
|
|
1462
|
+
];
|
|
1463
|
+
}
|
|
1464
|
+
}),
|
|
1465
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1466
|
+
name: "border",
|
|
1467
|
+
optional: true,
|
|
1468
|
+
type: "BorderOption | { top?: BorderOption; right?: BorderOption; bottom?: BorderOption; left?: BorderOption; topLeft?: BorderOption; topRight?: BorderOption; bottomLeft?: BorderOption; bottomRight?: BorderOption; }"
|
|
1469
|
+
}),
|
|
1470
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1471
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1472
|
+
heading: "Padding for the table cell.",
|
|
1473
|
+
get children() {
|
|
1474
|
+
return [
|
|
1475
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The amount of padding (in spaces) to apply to the table cell. This value is applied to both the left and right sides of the cell. If not specified, the default table padding defined in the current theme configuration will be used.` }),
|
|
1476
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1477
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
1478
|
+
get type() {
|
|
1479
|
+
return __powerlines_deepkit_vendor_type.ReflectionKind.property;
|
|
1480
|
+
},
|
|
1481
|
+
get defaultValue() {
|
|
1482
|
+
return `\`${theme.padding.table}\``;
|
|
1483
|
+
}
|
|
1484
|
+
})
|
|
1485
|
+
];
|
|
1486
|
+
}
|
|
1487
|
+
}),
|
|
1488
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1489
|
+
name: "padding",
|
|
1490
|
+
optional: true,
|
|
1491
|
+
type: "number"
|
|
1492
|
+
}),
|
|
1493
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1494
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1495
|
+
heading: "Alignment for the table cell.",
|
|
1496
|
+
get children() {
|
|
1497
|
+
return [
|
|
1498
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `The alignment for the table cell. This determines how the text within the cell is aligned. If not specified, the default alignment is "left".` }),
|
|
1499
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1500
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocDefaultValue, {
|
|
1501
|
+
get type() {
|
|
1502
|
+
return __powerlines_deepkit_vendor_type.ReflectionKind.property;
|
|
1503
|
+
},
|
|
1504
|
+
defaultValue: "\"left\""
|
|
1505
|
+
})
|
|
1506
|
+
];
|
|
1507
|
+
}
|
|
1508
|
+
}),
|
|
1509
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1510
|
+
name: "align",
|
|
1511
|
+
optional: true,
|
|
1512
|
+
type: "\"left\" | \"right\" | \"center\""
|
|
1513
|
+
}),
|
|
1514
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
1515
|
+
];
|
|
1516
|
+
}
|
|
1517
|
+
}),
|
|
1518
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1519
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1520
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceDeclaration, {
|
|
1521
|
+
"export": true,
|
|
1522
|
+
name: "TableCellOptions",
|
|
1523
|
+
"extends": "TableOutputOptions",
|
|
1524
|
+
doc: "Options for a specific table cell provided to the {@link table} function.",
|
|
1525
|
+
get children() {
|
|
1526
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1527
|
+
name: "value",
|
|
1528
|
+
optional: true,
|
|
1529
|
+
type: "string",
|
|
1530
|
+
doc: "The actual string value of the table cell."
|
|
1531
|
+
}), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
1532
|
+
}
|
|
1533
|
+
}),
|
|
1534
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1535
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1536
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceDeclaration, {
|
|
1537
|
+
"export": true,
|
|
1538
|
+
name: "TableRowOptions",
|
|
1539
|
+
"extends": "TableOutputOptions",
|
|
1540
|
+
doc: "Options for a specific table row provided to the {@link table} function.",
|
|
1541
|
+
get children() {
|
|
1542
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1543
|
+
name: "values",
|
|
1544
|
+
optional: true,
|
|
1545
|
+
type: "(string | TableCellOptions)[]",
|
|
1546
|
+
doc: "The actual string values of the table row's cells."
|
|
1547
|
+
}), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
1548
|
+
}
|
|
1549
|
+
}),
|
|
1550
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1551
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1552
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceDeclaration, {
|
|
1553
|
+
"export": true,
|
|
1554
|
+
name: "TableOptions",
|
|
1555
|
+
"extends": "TableOutputOptions",
|
|
1556
|
+
doc: "Options for a specific table cell provided to the {@link table} function.",
|
|
1557
|
+
get children() {
|
|
1558
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1559
|
+
name: "values",
|
|
1560
|
+
optional: true,
|
|
1561
|
+
type: "(string | TableCellOptions)[][]",
|
|
1562
|
+
doc: "The actual string values of the table's rows' cells."
|
|
1563
|
+
}), (0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
1564
|
+
}
|
|
1565
|
+
}),
|
|
1566
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1567
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1568
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceDeclaration, {
|
|
1569
|
+
name: "Dimensions",
|
|
1570
|
+
doc: "The height and width for a specific table/cell used internally in the {@link table} function.",
|
|
1571
|
+
get children() {
|
|
1572
|
+
return [
|
|
1573
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1574
|
+
name: "height",
|
|
1575
|
+
type: "number",
|
|
1576
|
+
doc: "The height of the row/cell (where 1 is a single line in the terminal)."
|
|
1577
|
+
}),
|
|
1578
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1579
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1580
|
+
name: "width",
|
|
1581
|
+
type: "number",
|
|
1582
|
+
doc: "The width of the row/cell (where 1 is a single character in the terminal)."
|
|
1583
|
+
}),
|
|
1584
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
1585
|
+
];
|
|
1586
|
+
}
|
|
1587
|
+
}),
|
|
1588
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1589
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1590
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceDeclaration, {
|
|
1591
|
+
name: "TableCellBorder",
|
|
1592
|
+
doc: "The resolved complete border styles for a table cell.",
|
|
1593
|
+
get children() {
|
|
1594
|
+
return [
|
|
1595
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1596
|
+
name: "top",
|
|
1597
|
+
type: "string",
|
|
1598
|
+
doc: "The top border style of the table cell."
|
|
1599
|
+
}),
|
|
1600
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1601
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1602
|
+
name: "bottom",
|
|
1603
|
+
type: "string",
|
|
1604
|
+
doc: "The bottom border style of the table cell."
|
|
1605
|
+
}),
|
|
1606
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1607
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1608
|
+
name: "right",
|
|
1609
|
+
type: "string",
|
|
1610
|
+
doc: "The right border style of the table cell."
|
|
1611
|
+
}),
|
|
1612
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1613
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1614
|
+
name: "left",
|
|
1615
|
+
type: "string",
|
|
1616
|
+
doc: "The left border style of the table cell."
|
|
1617
|
+
}),
|
|
1618
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1619
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1620
|
+
name: "topLeft",
|
|
1621
|
+
type: "string",
|
|
1622
|
+
doc: "The top-left border style of the table cell."
|
|
1623
|
+
}),
|
|
1624
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1625
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1626
|
+
name: "topRight",
|
|
1627
|
+
type: "string",
|
|
1628
|
+
doc: "The top-right border style of the table cell."
|
|
1629
|
+
}),
|
|
1630
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1631
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1632
|
+
name: "bottomLeft",
|
|
1633
|
+
type: "string",
|
|
1634
|
+
doc: "The bottom-left border style of the table cell."
|
|
1635
|
+
}),
|
|
1636
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1637
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.InterfaceMember, {
|
|
1638
|
+
name: "bottomRight",
|
|
1639
|
+
type: "string",
|
|
1640
|
+
doc: "The bottom-right border style of the table cell."
|
|
1641
|
+
}),
|
|
1642
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
1643
|
+
];
|
|
1644
|
+
}
|
|
1645
|
+
}),
|
|
1646
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1647
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1648
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.TypeDeclaration, {
|
|
1649
|
+
name: "TableCell",
|
|
1650
|
+
doc: "The internal state of a formatted table cell in the {@link table} function.",
|
|
1651
|
+
children: __alloy_js_core.code`Required<Omit<TableCellOptions, "border">> & Dimensions & {
|
|
1652
|
+
border: TableCellBorder;
|
|
1653
|
+
};
|
|
1654
|
+
`
|
|
1655
|
+
}),
|
|
1656
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1657
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1658
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDoc, {
|
|
1659
|
+
heading: "Write a table to the console.",
|
|
1660
|
+
get children() {
|
|
1661
|
+
return [
|
|
1662
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocRemarks, { children: `This function writes a table to the console, applying the appropriate padding as defined in the current theme configuration and wrapping as needed.` }),
|
|
1663
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1664
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
1665
|
+
name: "options",
|
|
1666
|
+
children: `Options to customize the table output.`
|
|
1667
|
+
})
|
|
1668
|
+
];
|
|
1669
|
+
}
|
|
1670
|
+
}),
|
|
1671
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.FunctionDeclaration, (0, __alloy_js_core_jsx_runtime.mergeProps)({ "export": true }, props, {
|
|
1672
|
+
name: "table",
|
|
1673
|
+
parameters: [{
|
|
1674
|
+
name: "options",
|
|
1675
|
+
type: "TableOptions | TableRowOptions[] | TableCellOptions[][] | string[] | string[][]",
|
|
1676
|
+
optional: false
|
|
1677
|
+
}],
|
|
1678
|
+
get children() {
|
|
1679
|
+
return [
|
|
1680
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
1681
|
+
condition: __alloy_js_core.code`!options ||
|
|
1682
|
+
(!Array.isArray(options) && (typeof options !== "object" || !options.values || !Array.isArray(options.values) || options.values.length === 0)) ||
|
|
1683
|
+
(Array.isArray(options) && !options.every(item => typeof item === "object" || typeof item === "string" || Array.isArray(item))) `,
|
|
1684
|
+
children: __alloy_js_core.code`return;`
|
|
1685
|
+
}),
|
|
1686
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1687
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1688
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
1689
|
+
"let": true,
|
|
1690
|
+
name: "cells",
|
|
1691
|
+
type: `TableCell[][]`,
|
|
1692
|
+
initializer: __alloy_js_core.code`[];`
|
|
1693
|
+
}),
|
|
1694
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1695
|
+
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`
|
|
1696
|
+
const extractTableCell = (cell: string | TableCellOptions, opts?: TableOutputOptions): TableCell => {
|
|
1697
|
+
if (typeof cell === "string") {
|
|
1698
|
+
const borderOptions = opts?.border || "primary";
|
|
1699
|
+
|
|
1700
|
+
let border = {} as TableCellBorder;
|
|
1701
|
+
if (typeof borderOptions === "object") {
|
|
1702
|
+
border = {
|
|
1703
|
+
top: ${extractBorderOptionsObject("top", theme)},
|
|
1704
|
+
bottom: ${extractBorderOptionsObject("bottom", theme)},
|
|
1705
|
+
left: ${extractBorderOptionsObject("left", theme)},
|
|
1706
|
+
right: ${extractBorderOptionsObject("right", theme)},
|
|
1707
|
+
topLeft: ${extractBorderOptionsObject("topLeft", theme)},
|
|
1708
|
+
topRight: ${extractBorderOptionsObject("topRight", theme)},
|
|
1709
|
+
bottomLeft: ${extractBorderOptionsObject("bottomLeft", theme)},
|
|
1710
|
+
bottomRight: ${extractBorderOptionsObject("bottomRight", theme)},
|
|
1711
|
+
};
|
|
1712
|
+
} else {
|
|
1713
|
+
border.top = ${extractBorderOptionsString("top", theme)};
|
|
1714
|
+
border.bottom = ${extractBorderOptionsString("bottom", theme)};
|
|
1715
|
+
border.left = ${extractBorderOptionsString("left", theme)};
|
|
1716
|
+
border.right = ${extractBorderOptionsString("right", theme)};
|
|
1717
|
+
border.topLeft = ${extractBorderOptionsString("topLeft", theme)};
|
|
1718
|
+
border.topRight = ${extractBorderOptionsString("topRight", theme)};
|
|
1719
|
+
border.bottomLeft = ${extractBorderOptionsString("bottomLeft", theme)};
|
|
1720
|
+
border.bottomRight = ${extractBorderOptionsString("bottomRight", theme)};
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
const padding = Math.max(0, opts?.padding ?? ${theme.padding.table});
|
|
1724
|
+
const value = cell ?? "";
|
|
1725
|
+
const width = stripAnsi(value).length + padding * 2;
|
|
1726
|
+
|
|
1727
|
+
return {
|
|
1728
|
+
value,
|
|
1729
|
+
height: 1,
|
|
1730
|
+
width,
|
|
1731
|
+
border,
|
|
1732
|
+
padding,
|
|
1733
|
+
align: opts?.align || "left",
|
|
1734
|
+
};
|
|
1735
|
+
} else {
|
|
1736
|
+
const borderOptions = cell.border || opts?.border || "primary";
|
|
1737
|
+
|
|
1738
|
+
let border = {} as TableCellBorder;
|
|
1739
|
+
if (typeof borderOptions === "object") {
|
|
1740
|
+
border = {
|
|
1741
|
+
top: ${extractBorderOptionsObject("top", theme)},
|
|
1742
|
+
bottom: ${extractBorderOptionsObject("bottom", theme)},
|
|
1743
|
+
left: ${extractBorderOptionsObject("left", theme)},
|
|
1744
|
+
right: ${extractBorderOptionsObject("right", theme)},
|
|
1745
|
+
topLeft: ${extractBorderOptionsObject("topLeft", theme)},
|
|
1746
|
+
topRight: ${extractBorderOptionsObject("topRight", theme)},
|
|
1747
|
+
bottomLeft: ${extractBorderOptionsObject("bottomLeft", theme)},
|
|
1748
|
+
bottomRight: ${extractBorderOptionsObject("bottomRight", theme)},
|
|
1749
|
+
};
|
|
1750
|
+
} else {
|
|
1751
|
+
border.top = ${extractBorderOptionsString("top", theme)};
|
|
1752
|
+
border.bottom = ${extractBorderOptionsString("bottom", theme)};
|
|
1753
|
+
border.left = ${extractBorderOptionsString("left", theme)};
|
|
1754
|
+
border.right = ${extractBorderOptionsString("right", theme)};
|
|
1755
|
+
border.topLeft = ${extractBorderOptionsString("topLeft", theme)};
|
|
1756
|
+
border.topRight = ${extractBorderOptionsString("topRight", theme)};
|
|
1757
|
+
border.bottomLeft = ${extractBorderOptionsString("bottomLeft", theme)};
|
|
1758
|
+
border.bottomRight = ${extractBorderOptionsString("bottomRight", theme)};
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
const padding = Math.max(0, cell.padding ?? opts?.padding ?? ${theme.padding.table});
|
|
1762
|
+
const value = cell.value ?? "";
|
|
1763
|
+
const width = stripAnsi(value).length + padding * 2;
|
|
1764
|
+
|
|
1765
|
+
return {
|
|
1766
|
+
value,
|
|
1767
|
+
height: 1,
|
|
1768
|
+
width,
|
|
1769
|
+
border,
|
|
1770
|
+
padding,
|
|
1771
|
+
align: cell.align || opts?.align || "left",
|
|
1772
|
+
};
|
|
1773
|
+
}
|
|
1774
|
+
};
|
|
1775
|
+
`),
|
|
1776
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1777
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
1778
|
+
condition: __alloy_js_core.code`Array.isArray(options)`,
|
|
1779
|
+
get children() {
|
|
1780
|
+
return [(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
1781
|
+
condition: __alloy_js_core.code`options.every(row => typeof row === "string" || (typeof row === "object" && !Array.isArray(row) && !("values" in row)))`,
|
|
1782
|
+
children: __alloy_js_core.code`cells.push(options.map(cell => extractTableCell(cell as string | TableCellOptions)));`
|
|
1783
|
+
}), (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseClause, { children: __alloy_js_core.code`
|
|
1784
|
+
cells.push(
|
|
1785
|
+
...options.map(row => Array.isArray(row)
|
|
1786
|
+
? row.reduce((cellRow, cell) => {
|
|
1787
|
+
cellRow.push(extractTableCell(cell));
|
|
1788
|
+
return cellRow;
|
|
1789
|
+
}, [] as TableCell[])
|
|
1790
|
+
: (row as TableRowOptions).values?.reduce((cellRow, cell) => {
|
|
1791
|
+
cellRow.push(extractTableCell(cell, row as TableRowOptions));
|
|
1792
|
+
return cellRow;
|
|
1793
|
+
}, [] as TableCell[]) ?? []
|
|
1794
|
+
)
|
|
1795
|
+
);
|
|
1796
|
+
` })];
|
|
1797
|
+
}
|
|
1798
|
+
}),
|
|
1799
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseClause, { children: __alloy_js_core.code`
|
|
1800
|
+
cells.push(
|
|
1801
|
+
...options.values!.map(row => Array.isArray(row)
|
|
1802
|
+
? row.reduce((cellRow, cell) => {
|
|
1803
|
+
cellRow.push(extractTableCell(cell));
|
|
1804
|
+
return cellRow;
|
|
1805
|
+
}, [] as TableCell[])
|
|
1806
|
+
: (row as TableRowOptions).values?.reduce((cellRow, cell) => {
|
|
1807
|
+
cellRow.push(extractTableCell(cell, options));
|
|
1808
|
+
return cellRow;
|
|
1809
|
+
}, [] as TableCell[]) ?? []
|
|
1810
|
+
)
|
|
1811
|
+
);
|
|
1812
|
+
|
|
1813
|
+
` }),
|
|
1814
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1815
|
+
(0, __alloy_js_core_jsx_runtime.memo)(() => __alloy_js_core.code`
|
|
1816
|
+
cells = cells.filter(row => row.length > 0);
|
|
1817
|
+
if (cells.length === 0) {
|
|
1818
|
+
return;
|
|
1819
|
+
}
|
|
1820
|
+
|
|
1821
|
+
// Calculate table dimensions
|
|
1822
|
+
let colWidths = [] as number[];
|
|
1823
|
+
let rowDims = [] as Dimensions[];
|
|
1824
|
+
|
|
1825
|
+
const calculateRowDimensions = () => {
|
|
1826
|
+
return cells.reduce((dims, row) => {
|
|
1827
|
+
dims.push(row.reduce((dim, cell) => {
|
|
1828
|
+
if (cell.width > dim.width) {
|
|
1829
|
+
dim.width = cell.width;
|
|
1830
|
+
}
|
|
1831
|
+
if (cell.height > dim.height) {
|
|
1832
|
+
dim.height = cell.height;
|
|
1833
|
+
}
|
|
1834
|
+
return dim;
|
|
1835
|
+
}, { width: 0, height: 0 } as Dimensions));
|
|
1836
|
+
|
|
1837
|
+
return dims;
|
|
1838
|
+
}, [] as Dimensions[]);
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
const maxWidth = Math.max(process.stdout.columns - ${Math.max(theme.padding.app, 0) * 2}, 0);
|
|
1842
|
+
rowDims = calculateRowDimensions();
|
|
1843
|
+
|
|
1844
|
+
let recalculate!: boolean;
|
|
1845
|
+
do {
|
|
1846
|
+
recalculate = false;
|
|
1847
|
+
rowDims.map((row, rowIndex) => {
|
|
1848
|
+
if (row.width > maxWidth) {
|
|
1849
|
+
const cell = cells[rowIndex]!.reduce((largestCell, cell) => {
|
|
1850
|
+
if (cell.width > largestCell.width) {
|
|
1851
|
+
return cell;
|
|
1852
|
+
}
|
|
1853
|
+
return largestCell;
|
|
1854
|
+
}, cells[rowIndex]![0]!);
|
|
1855
|
+
|
|
1856
|
+
const lines = splitText(
|
|
1857
|
+
cell.value,
|
|
1858
|
+
maxWidth - row.width - cell.width
|
|
1859
|
+
);
|
|
1860
|
+
|
|
1861
|
+
cell.value = lines.join("\\n");
|
|
1862
|
+
cell.height = lines.length;
|
|
1863
|
+
cell.width = Math.max(...lines.map(line => stripAnsi(line).length)) + cell.padding * 2;
|
|
1864
|
+
|
|
1865
|
+
recalculate = true;
|
|
1866
|
+
}
|
|
1867
|
+
});
|
|
1868
|
+
|
|
1869
|
+
if (recalculate) {
|
|
1870
|
+
rowDims = calculateRowDimensions();
|
|
1871
|
+
}
|
|
1872
|
+
} while (recalculate);
|
|
1873
|
+
|
|
1874
|
+
rowDims.map((row, rowIndex) => {
|
|
1875
|
+
cells[rowIndex]!.forEach(cell => {
|
|
1876
|
+
cell.height = row.height;
|
|
1877
|
+
});
|
|
1878
|
+
});
|
|
1879
|
+
|
|
1880
|
+
// Render table
|
|
1881
|
+
cells.forEach(row => {
|
|
1882
|
+
let line = "";
|
|
1883
|
+
row.forEach((cell, colIndex) => {
|
|
1884
|
+
const cellContent = cell.value;
|
|
1885
|
+
let paddedContent = "";
|
|
1886
|
+
const totalPadding = cell.padding * 2;
|
|
1887
|
+
const contentLength = stripAnsi(cellContent).length;
|
|
1888
|
+
const totalWidth = colWidths[colIndex] ?? contentLength + totalPadding;
|
|
1889
|
+
|
|
1890
|
+
switch (cell.align) {
|
|
1891
|
+
case "right":
|
|
1892
|
+
paddedContent = " ".repeat(totalWidth - contentLength - totalPadding) + cellContent + " ".repeat(totalPadding);
|
|
1893
|
+
break;
|
|
1894
|
+
case "center":
|
|
1895
|
+
const leftPadding = Math.floor((totalWidth - contentLength - totalPadding) / 2);
|
|
1896
|
+
const rightPadding = totalWidth - contentLength - totalPadding - leftPadding;
|
|
1897
|
+
paddedContent = " ".repeat(leftPadding) + cellContent + " ".repeat(rightPadding + totalPadding);
|
|
1898
|
+
break;
|
|
1899
|
+
case "left":
|
|
1900
|
+
default:
|
|
1901
|
+
paddedContent = " ".repeat(totalPadding) + cellContent + " ".repeat(totalWidth - contentLength - totalPadding);
|
|
1902
|
+
break;
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
line += cell.border.left + paddedContent;
|
|
1906
|
+
if (colIndex === row.length - 1) {
|
|
1907
|
+
line += paddedContent + cell.border.right;
|
|
1908
|
+
}
|
|
1909
|
+
});
|
|
1910
|
+
|
|
1911
|
+
writeLine(line);
|
|
1912
|
+
});
|
|
1913
|
+
`)
|
|
1914
|
+
];
|
|
1915
|
+
}
|
|
1916
|
+
}))
|
|
1917
|
+
];
|
|
1918
|
+
}
|
|
1919
|
+
/**
|
|
1920
|
+
* A built-in console utilities module for Shell Shock.
|
|
1921
|
+
*/
|
|
1922
|
+
function ConsoleBuiltin() {
|
|
1923
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, {
|
|
1924
|
+
id: "console",
|
|
1925
|
+
description: "A collection of helper utilities to assist in generating content meant for display in the console.",
|
|
1926
|
+
imports: { "@shell-shock/plugin-theme/types/theme": [{
|
|
1927
|
+
name: "ThemeColorsResolvedConfig",
|
|
1928
|
+
type: true
|
|
1929
|
+
}] },
|
|
1930
|
+
builtinImports: {
|
|
1931
|
+
utils: [
|
|
1932
|
+
"hasFlag",
|
|
1933
|
+
"isColorSupported",
|
|
1934
|
+
"colorSupportLevels",
|
|
1935
|
+
"isHyperlinkSupported"
|
|
1936
|
+
],
|
|
1937
|
+
env: [
|
|
1938
|
+
"env",
|
|
1939
|
+
"isDevelopment",
|
|
1940
|
+
"isDebug"
|
|
1941
|
+
]
|
|
1942
|
+
},
|
|
1943
|
+
get children() {
|
|
1944
|
+
return [
|
|
1945
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(StripAnsiFunctionDeclaration, {}),
|
|
1946
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1947
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1948
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(WrapAnsiFunction, {}),
|
|
1949
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1950
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1951
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(ColorsDeclaration, {}),
|
|
1952
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1953
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1954
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(WriteLineFunctionDeclaration, {}),
|
|
1955
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1956
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1957
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(LinkFunctionDeclaration, {}),
|
|
1958
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1959
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1960
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(DividerFunctionDeclaration, {}),
|
|
1961
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1962
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1963
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(MessageFunctionDeclaration, {
|
|
1964
|
+
type: "help",
|
|
1965
|
+
variant: "help",
|
|
1966
|
+
consoleFnName: "log",
|
|
1967
|
+
description: "help"
|
|
1968
|
+
}),
|
|
1969
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1970
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1971
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(MessageFunctionDeclaration, {
|
|
1972
|
+
type: "success",
|
|
1973
|
+
variant: "success",
|
|
1974
|
+
consoleFnName: "info",
|
|
1975
|
+
description: "success"
|
|
1976
|
+
}),
|
|
1977
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1978
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1979
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(MessageFunctionDeclaration, {
|
|
1980
|
+
type: "info",
|
|
1981
|
+
variant: "info",
|
|
1982
|
+
consoleFnName: "info",
|
|
1983
|
+
description: "informational"
|
|
1984
|
+
}),
|
|
1985
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1986
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
1987
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(MessageFunctionDeclaration, {
|
|
1988
|
+
type: "debug",
|
|
1989
|
+
variant: "debug",
|
|
1990
|
+
consoleFnName: "debug",
|
|
1991
|
+
description: "debug",
|
|
1992
|
+
get prefix() {
|
|
1993
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
1994
|
+
condition: __alloy_js_core.code`!isDevelopment && !isDebug && env.LOG_LEVEL !== "debug"`,
|
|
1995
|
+
children: __alloy_js_core.code`return; `
|
|
1996
|
+
});
|
|
1997
|
+
}
|
|
1998
|
+
}),
|
|
1999
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2000
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2001
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(MessageFunctionDeclaration, {
|
|
2002
|
+
type: "verbose",
|
|
2003
|
+
variant: "debug",
|
|
2004
|
+
consoleFnName: "debug",
|
|
2005
|
+
description: "verbose",
|
|
2006
|
+
get prefix() {
|
|
2007
|
+
return (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
2008
|
+
condition: __alloy_js_core.code`!(isDevelopment || isDebug || env.LOG_LEVEL === "debug" || hasFlag(["verbose", "verbose=true", "verbose=always", "debug", "debug=true", "debug=always"]))`,
|
|
2009
|
+
children: __alloy_js_core.code`return; `
|
|
2010
|
+
});
|
|
2011
|
+
}
|
|
2012
|
+
}),
|
|
2013
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2014
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2015
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(MessageFunctionDeclaration, {
|
|
2016
|
+
type: "warn",
|
|
2017
|
+
variant: "warning",
|
|
2018
|
+
consoleFnName: "warn",
|
|
2019
|
+
description: "warning"
|
|
2020
|
+
}),
|
|
2021
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2022
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2023
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(MessageFunctionDeclaration, {
|
|
2024
|
+
type: "danger",
|
|
2025
|
+
variant: "danger",
|
|
2026
|
+
consoleFnName: "error",
|
|
2027
|
+
description: "destructive/danger"
|
|
2028
|
+
}),
|
|
2029
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2030
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2031
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(MessageFunctionDeclaration, {
|
|
2032
|
+
type: "error",
|
|
2033
|
+
variant: "error",
|
|
2034
|
+
consoleFnName: "error",
|
|
2035
|
+
description: "error",
|
|
2036
|
+
parameters: [{
|
|
2037
|
+
name: "err",
|
|
2038
|
+
type: "string | Error",
|
|
2039
|
+
optional: false
|
|
2040
|
+
}],
|
|
2041
|
+
get prefix() {
|
|
2042
|
+
return [
|
|
2043
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.VarDeclaration, {
|
|
2044
|
+
"let": true,
|
|
2045
|
+
name: "message",
|
|
2046
|
+
type: "string | undefined"
|
|
2047
|
+
}),
|
|
2048
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2049
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2050
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
2051
|
+
condition: __alloy_js_core.code`(err as Error)?.message`,
|
|
2052
|
+
get children() {
|
|
2053
|
+
return [__alloy_js_core.code`message = (err as Error).message;`, (0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.IfStatement, {
|
|
2054
|
+
condition: __alloy_js_core.code`env.STACKTRACE && (err as Error)?.stack`,
|
|
2055
|
+
children: __alloy_js_core.code`message += " \\n\\n" + (err as Error).stack;`
|
|
2056
|
+
})];
|
|
2057
|
+
}
|
|
2058
|
+
}),
|
|
2059
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(__alloy_js_typescript.ElseClause, { children: __alloy_js_core.code`message = String(err);` })
|
|
2060
|
+
];
|
|
2061
|
+
}
|
|
2062
|
+
}),
|
|
2063
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2064
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2065
|
+
(0, __alloy_js_core_jsx_runtime.createComponent)(TableFunctionDeclaration, {}),
|
|
2066
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
2067
|
+
(0, __alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
2068
|
+
];
|
|
2069
|
+
}
|
|
2070
|
+
});
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
//#endregion
|
|
2074
|
+
exports.ColorsDeclaration = ColorsDeclaration;
|
|
2075
|
+
exports.ConsoleBuiltin = ConsoleBuiltin;
|
|
2076
|
+
exports.DividerFunctionDeclaration = DividerFunctionDeclaration;
|
|
2077
|
+
exports.LinkFunctionDeclaration = LinkFunctionDeclaration;
|
|
2078
|
+
exports.MessageFunctionDeclaration = MessageFunctionDeclaration;
|
|
2079
|
+
exports.StripAnsiFunctionDeclaration = StripAnsiFunctionDeclaration;
|
|
2080
|
+
exports.TableFunctionDeclaration = TableFunctionDeclaration;
|
|
2081
|
+
exports.WrapAnsiFunction = WrapAnsiFunction;
|
|
2082
|
+
exports.WriteLineFunctionDeclaration = WriteLineFunctionDeclaration;
|
|
2083
|
+
//# sourceMappingURL=console-builtin.cjs.map
|