@flamingo-stack/openframe-frontend-core 0.0.181 → 0.0.182
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/{chunk-VEOBMVF5.js → chunk-CLZ3QQMJ.js} +4211 -4123
- package/dist/chunk-CLZ3QQMJ.js.map +1 -0
- package/dist/{chunk-L5AAJ3QN.cjs → chunk-IWMK4MH4.cjs} +615 -527
- package/dist/chunk-IWMK4MH4.cjs.map +1 -0
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/chat-message-list.d.ts.map +1 -1
- package/dist/components/chat/cycling-phrase.d.ts +30 -0
- package/dist/components/chat/cycling-phrase.d.ts.map +1 -0
- package/dist/components/chat/hooks/index.d.ts +0 -1
- package/dist/components/chat/hooks/index.d.ts.map +1 -1
- package/dist/components/chat/index.d.ts +0 -1
- package/dist/components/chat/index.d.ts.map +1 -1
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/index.cjs +2 -6
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +1 -5
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/ui/index.cjs +2 -6
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +1 -5
- package/dist/index.cjs +2 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -5
- package/package.json +1 -1
- package/src/components/chat/chat-message-enhanced.tsx +37 -5
- package/src/components/chat/chat-message-list.tsx +51 -179
- package/src/components/chat/cycling-phrase.tsx +129 -0
- package/src/components/chat/hooks/index.ts +0 -1
- package/src/components/chat/index.ts +0 -1
- package/dist/chunk-L5AAJ3QN.cjs.map +0 -1
- package/dist/chunk-VEOBMVF5.js.map +0 -1
- package/dist/components/chat/chat-message-loader.d.ts +0 -23
- package/dist/components/chat/chat-message-loader.d.ts.map +0 -1
- package/dist/components/chat/hooks/use-delayed-flag.d.ts +0 -25
- package/dist/components/chat/hooks/use-delayed-flag.d.ts.map +0 -1
- package/src/components/chat/chat-message-loader.tsx +0 -67
- package/src/components/chat/hooks/use-delayed-flag.ts +0 -56
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
interface ChatMessageListLoaderProps {
|
|
3
|
-
className?: string;
|
|
4
|
-
/**
|
|
5
|
-
* Brand mark rendered at the centre of the loader. When omitted, a neutral
|
|
6
|
-
* MingoIcon is used (color derived from `assistantType`). Pass a custom
|
|
7
|
-
* element to match a different brand.
|
|
8
|
-
*/
|
|
9
|
-
assistantIcon?: ReactNode;
|
|
10
|
-
assistantType?: 'mingo' | 'fae';
|
|
11
|
-
/** Defaults to `"Loading conversation..."`. */
|
|
12
|
-
label?: string;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Centered loading indicator for the chat message list. Replaces the
|
|
16
|
-
* multi-row skeleton with a single, brand-neutral pulsating mark — the same
|
|
17
|
-
* pattern Claude/ChatGPT use when fetching a conversation: don't fake the
|
|
18
|
-
* shape of the content, just signal "we're working on it" and let the real
|
|
19
|
-
* messages fade in once they arrive.
|
|
20
|
-
*/
|
|
21
|
-
export declare function ChatMessageListLoader({ className, assistantIcon, assistantType, label, }: ChatMessageListLoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=chat-message-loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chat-message-loader.d.ts","sourceRoot":"","sources":["../../../src/components/chat/chat-message-loader.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC,UAAU,0BAA0B;IAClC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,SAAS,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,GAAG,KAAK,CAAA;IAC/B,+CAA+C;IAC/C,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,aAAa,EACb,aAAqB,EACrB,KAAiC,GAClC,EAAE,0BAA0B,2CAkC5B"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
interface UseDelayedFlagOptions {
|
|
2
|
-
/** Wait this long before flipping the returned flag to `true`. Default 200ms. */
|
|
3
|
-
delay?: number;
|
|
4
|
-
/**
|
|
5
|
-
* Once the flag has gone `true`, hold it for at least this long even if
|
|
6
|
-
* the source signal flips back to `false` sooner. Prevents a sub-frame
|
|
7
|
-
* flash when the operation finishes right after the loader appeared.
|
|
8
|
-
* Default 400ms.
|
|
9
|
-
*/
|
|
10
|
-
minDuration?: number;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Debounce + min-hold gate for transient boolean flags (most useful for
|
|
14
|
-
* loading indicators).
|
|
15
|
-
*
|
|
16
|
-
* - source `true` → wait `delay` ms; if still true, flip output to `true`
|
|
17
|
-
* - source `false` → if output is `true`, hold for `minDuration - elapsed`
|
|
18
|
-
* ms before flipping back; otherwise flip immediately
|
|
19
|
-
*
|
|
20
|
-
* The net effect: fast operations never trigger the indicator, and slow
|
|
21
|
-
* ones always show it for long enough to avoid a flicker.
|
|
22
|
-
*/
|
|
23
|
-
export declare function useDelayedFlag(source: boolean, { delay, minDuration }?: UseDelayedFlagOptions): boolean;
|
|
24
|
-
export {};
|
|
25
|
-
//# sourceMappingURL=use-delayed-flag.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-delayed-flag.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/hooks/use-delayed-flag.ts"],"names":[],"mappings":"AAIA,UAAU,qBAAqB;IAC7B,iFAAiF;IACjF,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,OAAO,EACf,EAAE,KAAW,EAAE,WAAiB,EAAE,GAAE,qBAA0B,GAC7D,OAAO,CAyBT"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import type { ReactNode } from "react"
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../utils/cn"
|
|
6
|
-
import { MingoIcon } from "../icons/mingo-icon"
|
|
7
|
-
|
|
8
|
-
interface ChatMessageListLoaderProps {
|
|
9
|
-
className?: string
|
|
10
|
-
/**
|
|
11
|
-
* Brand mark rendered at the centre of the loader. When omitted, a neutral
|
|
12
|
-
* MingoIcon is used (color derived from `assistantType`). Pass a custom
|
|
13
|
-
* element to match a different brand.
|
|
14
|
-
*/
|
|
15
|
-
assistantIcon?: ReactNode
|
|
16
|
-
assistantType?: 'mingo' | 'fae'
|
|
17
|
-
/** Defaults to `"Loading conversation..."`. */
|
|
18
|
-
label?: string
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Centered loading indicator for the chat message list. Replaces the
|
|
23
|
-
* multi-row skeleton with a single, brand-neutral pulsating mark — the same
|
|
24
|
-
* pattern Claude/ChatGPT use when fetching a conversation: don't fake the
|
|
25
|
-
* shape of the content, just signal "we're working on it" and let the real
|
|
26
|
-
* messages fade in once they arrive.
|
|
27
|
-
*/
|
|
28
|
-
export function ChatMessageListLoader({
|
|
29
|
-
className,
|
|
30
|
-
assistantIcon,
|
|
31
|
-
assistantType = 'fae',
|
|
32
|
-
label = 'Loading conversation...',
|
|
33
|
-
}: ChatMessageListLoaderProps) {
|
|
34
|
-
const accentColor =
|
|
35
|
-
assistantType === 'mingo'
|
|
36
|
-
? 'var(--ods-flamingo-cyan-base)'
|
|
37
|
-
: 'var(--ods-flamingo-pink-base)'
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<div
|
|
41
|
-
role="status"
|
|
42
|
-
aria-live="polite"
|
|
43
|
-
aria-busy="true"
|
|
44
|
-
className={cn(
|
|
45
|
-
"relative flex-1 min-h-0 flex flex-col items-center justify-center gap-3 px-8",
|
|
46
|
-
"animate-in fade-in duration-300",
|
|
47
|
-
className,
|
|
48
|
-
)}
|
|
49
|
-
>
|
|
50
|
-
<div className="relative flex items-center justify-center w-10 h-10">
|
|
51
|
-
<span
|
|
52
|
-
className="absolute inset-0 rounded-full opacity-30 blur-md animate-pulse"
|
|
53
|
-
style={{ backgroundColor: accentColor }}
|
|
54
|
-
aria-hidden="true"
|
|
55
|
-
/>
|
|
56
|
-
<div className="relative motion-safe:animate-pulse">
|
|
57
|
-
{assistantIcon ?? (
|
|
58
|
-
<MingoIcon className="w-8 h-8" eyesColor={accentColor} cornerColor={accentColor} />
|
|
59
|
-
)}
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
<span className="text-sm font-medium text-ods-text-secondary tracking-tight motion-safe:animate-pulse">
|
|
63
|
-
{label}
|
|
64
|
-
</span>
|
|
65
|
-
</div>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import { useEffect, useRef, useState } from "react"
|
|
4
|
-
|
|
5
|
-
interface UseDelayedFlagOptions {
|
|
6
|
-
/** Wait this long before flipping the returned flag to `true`. Default 200ms. */
|
|
7
|
-
delay?: number
|
|
8
|
-
/**
|
|
9
|
-
* Once the flag has gone `true`, hold it for at least this long even if
|
|
10
|
-
* the source signal flips back to `false` sooner. Prevents a sub-frame
|
|
11
|
-
* flash when the operation finishes right after the loader appeared.
|
|
12
|
-
* Default 400ms.
|
|
13
|
-
*/
|
|
14
|
-
minDuration?: number
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Debounce + min-hold gate for transient boolean flags (most useful for
|
|
19
|
-
* loading indicators).
|
|
20
|
-
*
|
|
21
|
-
* - source `true` → wait `delay` ms; if still true, flip output to `true`
|
|
22
|
-
* - source `false` → if output is `true`, hold for `minDuration - elapsed`
|
|
23
|
-
* ms before flipping back; otherwise flip immediately
|
|
24
|
-
*
|
|
25
|
-
* The net effect: fast operations never trigger the indicator, and slow
|
|
26
|
-
* ones always show it for long enough to avoid a flicker.
|
|
27
|
-
*/
|
|
28
|
-
export function useDelayedFlag(
|
|
29
|
-
source: boolean,
|
|
30
|
-
{ delay = 200, minDuration = 400 }: UseDelayedFlagOptions = {},
|
|
31
|
-
): boolean {
|
|
32
|
-
const [active, setActive] = useState(false)
|
|
33
|
-
const activatedAtRef = useRef<number | null>(null)
|
|
34
|
-
|
|
35
|
-
useEffect(() => {
|
|
36
|
-
if (source) {
|
|
37
|
-
if (active) return
|
|
38
|
-
const timer = window.setTimeout(() => {
|
|
39
|
-
activatedAtRef.current = Date.now()
|
|
40
|
-
setActive(true)
|
|
41
|
-
}, delay)
|
|
42
|
-
return () => window.clearTimeout(timer)
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (!active) return
|
|
46
|
-
const elapsed = activatedAtRef.current ? Date.now() - activatedAtRef.current : minDuration
|
|
47
|
-
const remaining = Math.max(0, minDuration - elapsed)
|
|
48
|
-
const timer = window.setTimeout(() => {
|
|
49
|
-
activatedAtRef.current = null
|
|
50
|
-
setActive(false)
|
|
51
|
-
}, remaining)
|
|
52
|
-
return () => window.clearTimeout(timer)
|
|
53
|
-
}, [source, active, delay, minDuration])
|
|
54
|
-
|
|
55
|
-
return active
|
|
56
|
-
}
|