@emeryld/manager 0.7.7 → 0.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/colors-shared.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
const ansi = (code) => (text) => `\x1b[${code}m${text}\x1b[0m`;
|
|
2
2
|
export const colors = {
|
|
3
|
-
|
|
3
|
+
black: ansi(30),
|
|
4
|
+
red: ansi(31),
|
|
4
5
|
green: ansi(32),
|
|
5
6
|
yellow: ansi(33),
|
|
7
|
+
blue: ansi(34),
|
|
6
8
|
magenta: ansi(35),
|
|
7
|
-
|
|
9
|
+
cyan: ansi(36),
|
|
10
|
+
white: ansi(37),
|
|
11
|
+
gray: ansi(90),
|
|
12
|
+
brightRed: ansi(91),
|
|
13
|
+
brightGreen: ansi(92),
|
|
14
|
+
brightYellow: ansi(93),
|
|
15
|
+
brightBlue: ansi(94),
|
|
16
|
+
brightMagenta: ansi(95),
|
|
17
|
+
brightCyan: ansi(96),
|
|
18
|
+
brightWhite: ansi(97),
|
|
8
19
|
bold: ansi(1),
|
|
9
20
|
dim: ansi(2),
|
|
10
|
-
gray: ansi(90),
|
|
11
21
|
};
|
|
@@ -63,16 +63,14 @@ function formatInteractiveLines(state, selectedIndex, title, searchState) {
|
|
|
63
63
|
state.options.forEach((option, index) => {
|
|
64
64
|
const isSelected = index === selectedIndex;
|
|
65
65
|
const pointer = isSelected ? `${colors.green('➤')} ` : '';
|
|
66
|
-
const
|
|
66
|
+
const entryColorizer = option.type === 'entry' && option.entry.color
|
|
67
67
|
? getEntryColor(option.entry)
|
|
68
68
|
: colors.cyan;
|
|
69
|
-
const
|
|
69
|
+
const numberLabelColorizer = isSelected ? colors.green : entryColorizer;
|
|
70
|
+
const numberLabel = numberLabelColorizer(`${option.hotkey}`.padStart(2, ' '));
|
|
70
71
|
if (option.type === 'entry') {
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
: isSelected
|
|
74
|
-
? colors.green(option.entry.displayName)
|
|
75
|
-
: option.entry.displayName;
|
|
72
|
+
const labelColorizer = isSelected ? colors.green : entryColorizer;
|
|
73
|
+
const label = labelColorizer(option.entry.displayName);
|
|
76
74
|
const runHint = searchState?.active &&
|
|
77
75
|
searchState.hasResults &&
|
|
78
76
|
index === selectedIndex
|
|
@@ -91,7 +89,11 @@ function formatInteractiveLines(state, selectedIndex, title, searchState) {
|
|
|
91
89
|
: option.action === 'next'
|
|
92
90
|
? 'Next page'
|
|
93
91
|
: 'Back';
|
|
94
|
-
const navLabel = option.enabled
|
|
92
|
+
const navLabel = isSelected && option.enabled
|
|
93
|
+
? colors.green(baseLabel)
|
|
94
|
+
: option.enabled
|
|
95
|
+
? baseLabel
|
|
96
|
+
: colors.dim(baseLabel);
|
|
95
97
|
lines.push(`${pointer}${numberLabel}. ${icon} ${navLabel}`);
|
|
96
98
|
});
|
|
97
99
|
if (searchState?.active && !searchState.hasResults) {
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { readdir, readFile } from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { pathToFileURL } from 'node:url';
|
|
4
|
-
const DEFAULT_COLOR_PALETTE = [
|
|
4
|
+
const DEFAULT_COLOR_PALETTE = [
|
|
5
|
+
'blue',
|
|
6
|
+
'brightBlue',
|
|
7
|
+
'cyan',
|
|
8
|
+
'brightCyan',
|
|
9
|
+
'green',
|
|
10
|
+
'brightGreen',
|
|
11
|
+
'magenta',
|
|
12
|
+
'brightMagenta',
|
|
13
|
+
'red',
|
|
14
|
+
'brightRed',
|
|
15
|
+
'yellow',
|
|
16
|
+
'brightYellow',
|
|
17
|
+
'white',
|
|
18
|
+
'brightWhite',
|
|
19
|
+
];
|
|
5
20
|
const IGNORED_DIRS = new Set([
|
|
6
21
|
'node_modules',
|
|
7
22
|
'.git',
|