@gguf/coder 0.2.3 → 0.2.4
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import Spinner from 'ink-spinner';
|
|
2
2
|
import type { ComponentProps } from 'react';
|
|
3
|
-
export default function RandomSpinner(props: Omit<ComponentProps<typeof Spinner>, 'type'>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default function RandomSpinner(props: Omit<ComponentProps<typeof Spinner>, 'type' | 'spinner'>): import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
//# sourceMappingURL=random-spinner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random-spinner.d.ts","sourceRoot":"","sources":["../../source/components/random-spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"random-spinner.d.ts","sourceRoot":"","sources":["../../source/components/random-spinner.tsx"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAwB5C,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,2CAUpG"}
|
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Spinner from 'ink-spinner';
|
|
3
3
|
import { useMemo } from 'react';
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
// Define the available spinner options.
|
|
5
|
+
// Some use built-in 'type' strings from cli-spinners, others use custom 'spinner' objects.
|
|
6
|
+
const SPINNER_OPTIONS = [
|
|
7
|
+
{ type: 'dots' },
|
|
8
|
+
// Star style: ✶✸✹✺✹✷
|
|
9
|
+
{
|
|
10
|
+
spinner: {
|
|
11
|
+
interval: 80,
|
|
12
|
+
frames: ['✶', '✸', '✹', '✺', '✹', '✷'],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
{ type: 'triangle' },
|
|
16
|
+
// Hamburger style: ☱☲☴
|
|
17
|
+
{
|
|
18
|
+
spinner: {
|
|
19
|
+
interval: 100,
|
|
20
|
+
frames: ['☱', '☲', '☴'],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
];
|
|
9
24
|
export default function RandomSpinner(props) {
|
|
10
|
-
// Select a random spinner
|
|
11
|
-
const
|
|
12
|
-
const randomIndex = Math.floor(Math.random() *
|
|
13
|
-
return
|
|
25
|
+
// Select a random spinner configuration once on mount
|
|
26
|
+
const spinnerConfig = useMemo(() => {
|
|
27
|
+
const randomIndex = Math.floor(Math.random() * SPINNER_OPTIONS.length);
|
|
28
|
+
return SPINNER_OPTIONS[randomIndex];
|
|
14
29
|
}, []);
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
return _jsx(Spinner, {
|
|
30
|
+
// Spread the selected configuration (type or spinner) onto the Spinner component
|
|
31
|
+
// Cast to any to handle the mixed types of SPINNER_OPTIONS flexible props
|
|
32
|
+
return _jsx(Spinner, { ...spinnerConfig, ...props });
|
|
18
33
|
}
|
|
19
34
|
//# sourceMappingURL=random-spinner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random-spinner.js","sourceRoot":"","sources":["../../source/components/random-spinner.tsx"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,
|
|
1
|
+
{"version":3,"file":"random-spinner.js","sourceRoot":"","sources":["../../source/components/random-spinner.tsx"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,aAAa,CAAC;AAElC,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,wCAAwC;AACxC,2FAA2F;AAC3F,MAAM,eAAe,GAAG;IACpB,EAAE,IAAI,EAAE,MAAM,EAAE;IAChB,qBAAqB;IACrB;QACI,OAAO,EAAE;YACL,QAAQ,EAAE,EAAE;YACZ,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;SACzC;KACJ;IACD,EAAE,IAAI,EAAE,UAAU,EAAE;IACpB,uBAAuB;IACvB;QACI,OAAO,EAAE;YACL,QAAQ,EAAE,GAAG;YACb,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;SAC1B;KACJ;CACJ,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,KAA+D;IACjG,sDAAsD;IACtD,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE;QAC/B,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACvE,OAAO,eAAe,CAAC,WAAW,CAAC,CAAC;IACxC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,iFAAiF;IACjF,0EAA0E;IAC1E,OAAO,KAAC,OAAO,OAAM,aAAqB,KAAM,KAAK,GAAI,CAAC;AAC9D,CAAC"}
|