blyuecode 0.7.2 → 0.8.0
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/core/deps.js +99 -0
- package/dist/core/image.js +69 -0
- package/dist/core/media.js +210 -0
- package/dist/core/player.js +208 -0
- package/dist/core/videoPlayer.js +44 -0
- package/dist/core/ytdlp.js +153 -0
- package/dist/ui/Chat.js +438 -1
- package/dist/ui/InputBar.js +8 -2
- package/dist/ui/MascotPrompt.js +27 -6
- package/package.json +1 -1
package/dist/ui/MascotPrompt.js
CHANGED
|
@@ -22,13 +22,29 @@ const FACES = {
|
|
|
22
22
|
granted: ['◉‿◉', '◉▽◉', '◉‿◉'],
|
|
23
23
|
denied: ['◔︵◔', '◔_◔', '◔︵◔'],
|
|
24
24
|
impatient: ['◕~◕', '⊙_⊙', '◕~◕', '⊙_⊙'],
|
|
25
|
+
playing: [],
|
|
25
26
|
};
|
|
26
27
|
const SPEEDS = {
|
|
27
28
|
idle: 500, typing: 700, thinking: 120,
|
|
28
29
|
success: 300, error: 400, jump: 70,
|
|
29
30
|
read: 220, write: 260, patch: 260, list: 260, command: 220,
|
|
30
|
-
automate: 200, permission: 450, granted: 180, denied: 350,
|
|
31
|
+
automate: 200, permission: 450, granted: 180, denied: 350,
|
|
32
|
+
impatient: 300, playing: 240,
|
|
31
33
|
};
|
|
34
|
+
const MUSIC_FRAMES = [
|
|
35
|
+
{ top: ' ', mid: ' ', face: '◉◡◉' },
|
|
36
|
+
{ top: ' ♪ ', mid: ' ', face: '◉◡◉' },
|
|
37
|
+
{ top: ' ', mid: ' ♪ ', face: '◉‿◉' },
|
|
38
|
+
{ top: ' ', mid: '♫ ', face: '◕‿◕' },
|
|
39
|
+
{ top: ' ♫', mid: ' ', face: '◕ω◕' },
|
|
40
|
+
{ top: ' ', mid: ' ♪', face: '◉‿◉' },
|
|
41
|
+
{ top: '♪ ', mid: ' ♪ ', face: '◉◡◉' },
|
|
42
|
+
{ top: ' ', mid: ' ', face: '◉◡◉' },
|
|
43
|
+
{ top: ' ♫ ', mid: ' ', face: '◕‿◕' },
|
|
44
|
+
{ top: ' ', mid: '♪ ', face: '◉◠◉' },
|
|
45
|
+
{ top: ' ♪', mid: ' ', face: '◉◡◉' },
|
|
46
|
+
{ top: ' ', mid: ' ♫', face: '◕ᴗ◕' },
|
|
47
|
+
];
|
|
32
48
|
const DROWSY_FACE = '–_–';
|
|
33
49
|
const SLEEPING_FACE = '-‿-';
|
|
34
50
|
const TOP_ROWS = 2;
|
|
@@ -61,7 +77,6 @@ function semanticColor(state) {
|
|
|
61
77
|
return theme.warning;
|
|
62
78
|
}
|
|
63
79
|
export const MascotPrompt = ({ state, keepAwake = false, }) => {
|
|
64
|
-
const frames = FACES[state];
|
|
65
80
|
const [i, setI] = useState(0);
|
|
66
81
|
const thresholds = defaultIdleThresholds();
|
|
67
82
|
const idle = useIdle({
|
|
@@ -69,19 +84,25 @@ export const MascotPrompt = ({ state, keepAwake = false, }) => {
|
|
|
69
84
|
disabled: keepAwake || idleDisabled(),
|
|
70
85
|
});
|
|
71
86
|
const slowColor = useSlowColor();
|
|
87
|
+
const frameCount = state === 'playing' ? MUSIC_FRAMES.length : FACES[state].length;
|
|
72
88
|
useEffect(() => {
|
|
73
89
|
setI(0);
|
|
74
|
-
if (
|
|
90
|
+
if (frameCount <= 1)
|
|
75
91
|
return;
|
|
76
|
-
const t = setInterval(() => setI((v) => (v + 1) %
|
|
92
|
+
const t = setInterval(() => setI((v) => (v + 1) % frameCount), SPEEDS[state]);
|
|
77
93
|
return () => clearInterval(t);
|
|
78
|
-
}, [state,
|
|
94
|
+
}, [state, frameCount]);
|
|
79
95
|
if (idle === 'sleeping') {
|
|
80
96
|
return (_jsxs(Box, { flexDirection: "column", height: TOP_ROWS + 1, children: [_jsx(Zzz, {}), _jsx(Text, { color: theme.muted, bold: true, children: ' ' + SLEEPING_FACE })] }));
|
|
81
97
|
}
|
|
82
98
|
if (idle === 'drowsy') {
|
|
83
99
|
return (_jsxs(Box, { flexDirection: "column", height: TOP_ROWS + 1, children: [_jsx(BlankRows, {}), _jsx(Text, { color: theme.muted, bold: true, children: ' ' + DROWSY_FACE })] }));
|
|
84
100
|
}
|
|
101
|
+
if (state === 'playing') {
|
|
102
|
+
const fr = MUSIC_FRAMES[i % MUSIC_FRAMES.length];
|
|
103
|
+
return (_jsxs(Box, { flexDirection: "column", height: TOP_ROWS + 1, children: [_jsx(Text, { color: slowColor, children: fr.top }), _jsx(Text, { color: slowColor, children: fr.mid }), _jsx(Text, { color: slowColor, bold: true, children: ' ' + fr.face })] }));
|
|
104
|
+
}
|
|
105
|
+
const frames = FACES[state];
|
|
85
106
|
const color = isSemantic(state) ? semanticColor(state) : slowColor;
|
|
86
|
-
return (_jsxs(Box, { flexDirection: "column", height: TOP_ROWS + 1, children: [_jsx(BlankRows, {}), _jsx(Text, { color: color, bold: true, children: ' ' + frames[i] })] }));
|
|
107
|
+
return (_jsxs(Box, { flexDirection: "column", height: TOP_ROWS + 1, children: [_jsx(BlankRows, {}), _jsx(Text, { color: color, bold: true, children: ' ' + frames[i % frames.length] })] }));
|
|
87
108
|
};
|