@flamingo-stack/openframe-frontend-core 0.0.197 → 0.0.198
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-IMDXOVYD.cjs → chunk-332L6IO7.cjs} +73 -93
- package/dist/chunk-332L6IO7.cjs.map +1 -0
- package/dist/{chunk-GIQZAYY5.js → chunk-5URU5DHE.js} +74 -94
- package/dist/chunk-5URU5DHE.js.map +1 -0
- package/dist/components/chat/chat-input.d.ts.map +1 -1
- package/dist/components/chat/chat-message-enhanced.d.ts.map +1 -1
- package/dist/components/chat/chat-message-skeleton.d.ts.map +1 -1
- package/dist/components/chat/types/component.types.d.ts +4 -0
- package/dist/components/chat/types/component.types.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 -2
- package/dist/components/index.js +1 -1
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/platform/ScriptArguments.d.ts.map +1 -1
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/tailwind.config.cjs +3 -0
- package/dist/tailwind.config.cjs.map +1 -1
- package/dist/tailwind.config.js +3 -0
- package/dist/tailwind.config.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chat/.chat-input.md +0 -1
- package/src/components/chat/chat-container.tsx +3 -3
- package/src/components/chat/chat-input.tsx +38 -51
- package/src/components/chat/chat-message-enhanced.tsx +21 -22
- package/src/components/chat/chat-message-list.tsx +6 -6
- package/src/components/chat/chat-message-skeleton.tsx +9 -10
- package/src/components/chat/types/component.types.ts +4 -0
- package/src/components/platform/ScriptArguments.tsx +7 -6
- package/tailwind.config.ts +4 -0
- package/dist/chunk-GIQZAYY5.js.map +0 -1
- package/dist/chunk-IMDXOVYD.cjs.map +0 -1
|
@@ -28,7 +28,9 @@ const ChatInput = forwardRef<ChatInputRef, ChatInputProps>(
|
|
|
28
28
|
sending = false,
|
|
29
29
|
awaitingResponse = false,
|
|
30
30
|
placeholder = "Enter your Request...",
|
|
31
|
-
|
|
31
|
+
// Accepted for back-compat; consumed and discarded so the prop never
|
|
32
|
+
// falls through to the underlying <textarea> as an unknown DOM attr.
|
|
33
|
+
reserveAvatarOffset: _reserveAvatarOffset,
|
|
32
34
|
disabled = false,
|
|
33
35
|
autoFocus = false,
|
|
34
36
|
...inputProps
|
|
@@ -283,65 +285,50 @@ const ChatInput = forwardRef<ChatInputRef, ChatInputProps>(
|
|
|
283
285
|
}
|
|
284
286
|
}, [onStop, isStopping])
|
|
285
287
|
|
|
286
|
-
if (awaitingResponse) {
|
|
287
|
-
return (
|
|
288
|
-
<div
|
|
289
|
-
className={cn(
|
|
290
|
-
"mx-auto w-full max-w-3xl items-end gap-6",
|
|
291
|
-
reserveAvatarOffset ? "grid grid-cols-[32px_1fr]" : "grid grid-cols-[1fr]",
|
|
292
|
-
"flex-shrink-0",
|
|
293
|
-
className,
|
|
294
|
-
)}
|
|
295
|
-
>
|
|
296
|
-
{reserveAvatarOffset && <div className="invisible h-8 w-8" aria-hidden />}
|
|
297
|
-
<div className="relative flex items-center justify-center gap-2 rounded-md bg-ods-card border border-ods-border px-3 py-3 transition-colors">
|
|
298
|
-
<ChatTypingIndicator size="sm" dotClassName="bg-ods-text-primary" />
|
|
299
|
-
<p className="text-h4 text-ods-text-secondary">Waiting for Technician Response</p>
|
|
300
|
-
</div>
|
|
301
|
-
</div>
|
|
302
|
-
)
|
|
303
|
-
}
|
|
304
|
-
|
|
305
288
|
const isStopMode = sending && !!onStop
|
|
306
289
|
const sendDisabled = sending || disabled || !value.trim()
|
|
307
290
|
|
|
308
291
|
return (
|
|
309
292
|
<div
|
|
310
293
|
className={cn(
|
|
311
|
-
"mx-auto w-full max-w-
|
|
312
|
-
reserveAvatarOffset ? "grid grid-cols-[32px_1fr]" : "grid grid-cols-[1fr]",
|
|
313
|
-
"flex-shrink-0",
|
|
294
|
+
"mx-auto w-full max-w-ods-content-narrow flex-shrink-0",
|
|
314
295
|
className,
|
|
315
296
|
)}
|
|
316
297
|
>
|
|
317
|
-
{
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
298
|
+
{awaitingResponse ? (
|
|
299
|
+
<div className="relative flex items-center justify-center gap-[var(--spacing-system-xs)] rounded-md bg-ods-card border border-ods-border px-[var(--spacing-system-s)] py-[var(--spacing-system-s)] transition-colors">
|
|
300
|
+
<ChatTypingIndicator size="sm" dotClassName="bg-ods-text-primary" />
|
|
301
|
+
<p className="text-h4 text-ods-text-secondary">Waiting for Technician Response</p>
|
|
302
|
+
</div>
|
|
303
|
+
) : (
|
|
304
|
+
<div className="relative">
|
|
305
|
+
<SlashCommandSuggestions
|
|
306
|
+
commands={slashPrefix !== null ? slashSuggestions : []}
|
|
307
|
+
highlightedIdx={highlightedIdx}
|
|
308
|
+
onHover={setHighlightedIdx}
|
|
309
|
+
onSelect={acceptSuggestion}
|
|
310
|
+
resolveSourceIcon={slashCommands?.resolveSourceIcon}
|
|
311
|
+
onAction={slashCommands?.onAction}
|
|
312
|
+
/>
|
|
313
|
+
<Textarea
|
|
314
|
+
ref={textareaRef}
|
|
315
|
+
value={value}
|
|
316
|
+
onChange={handleChange}
|
|
317
|
+
onKeyDown={handleKeyDown}
|
|
318
|
+
placeholder={disabled ? "Connection lost. Waiting to reconnect..." : placeholder}
|
|
319
|
+
disabled={sending || disabled}
|
|
320
|
+
rows={1}
|
|
321
|
+
endIcon={isStopMode ? <StopCircleIcon size={20} /> : <Send01Icon size={20} />}
|
|
322
|
+
endIconAsButton
|
|
323
|
+
endIconButtonProps={{
|
|
324
|
+
onClick: isStopMode ? handleStop : handleSubmit,
|
|
325
|
+
disabled: isStopMode ? isStopping : sendDisabled,
|
|
326
|
+
'aria-label': isStopMode ? 'Stop generation' : 'Send message',
|
|
327
|
+
}}
|
|
328
|
+
{...inputProps}
|
|
329
|
+
/>
|
|
330
|
+
</div>
|
|
331
|
+
)}
|
|
345
332
|
</div>
|
|
346
333
|
)
|
|
347
334
|
},
|
|
@@ -232,11 +232,7 @@ const ChatMessageEnhanced = forwardRef<HTMLDivElement, ChatMessageEnhancedProps>
|
|
|
232
232
|
variant: "round" as const,
|
|
233
233
|
className: cn(
|
|
234
234
|
"flex-shrink-0",
|
|
235
|
-
|
|
236
|
-
? "invisible"
|
|
237
|
-
: isMingo
|
|
238
|
-
? "bg-ods-flamingo-cyan"
|
|
239
|
-
: "bg-ods-flamingo-pink"
|
|
235
|
+
isMingo ? "bg-ods-flamingo-cyan" : "bg-ods-flamingo-pink"
|
|
240
236
|
)
|
|
241
237
|
}
|
|
242
238
|
}
|
|
@@ -249,30 +245,33 @@ const ChatMessageEnhanced = forwardRef<HTMLDivElement, ChatMessageEnhancedProps>
|
|
|
249
245
|
<div
|
|
250
246
|
ref={ref}
|
|
251
247
|
className={cn(
|
|
252
|
-
"
|
|
248
|
+
"relative py-[var(--spacing-system-s)]",
|
|
253
249
|
className
|
|
254
250
|
)}
|
|
255
251
|
{...props}
|
|
256
252
|
>
|
|
257
|
-
{/*
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
253
|
+
{/* Hanging-avatar layout — Figma spec parks the avatar in the 64px
|
|
254
|
+
gutter outside the 600px content column. Only rendered for
|
|
255
|
+
assistant messages; user and system messages have no avatar. */}
|
|
256
|
+
{showAvatar && !isSystem && !isUser && (
|
|
257
|
+
<div className="absolute -left-16 top-[var(--spacing-system-s)]">
|
|
258
|
+
{assistantIcon && !avatar ? (
|
|
259
|
+
<div className="flex items-center justify-center w-12 h-12 rounded-full bg-ods-accent">
|
|
260
|
+
{assistantIcon}
|
|
261
|
+
</div>
|
|
262
|
+
) : (
|
|
263
|
+
<SquareAvatar
|
|
264
|
+
{...avatarProps}
|
|
265
|
+
className={cn(avatarProps.className, "w-12 h-12")}
|
|
266
|
+
/>
|
|
267
|
+
)}
|
|
268
|
+
</div>
|
|
270
269
|
)}
|
|
271
270
|
|
|
272
|
-
{/* Message Content */}
|
|
273
|
-
<div className="flex flex-
|
|
271
|
+
{/* Message Content - full width */}
|
|
272
|
+
<div className="flex flex-col gap-[var(--spacing-system-xxs)] min-w-0">
|
|
274
273
|
{/* Name and Timestamp Row */}
|
|
275
|
-
<div className="flex items-center justify-between gap-
|
|
274
|
+
<div className="flex items-center justify-between gap-[var(--spacing-system-xxs)]">
|
|
276
275
|
<span className={cn(
|
|
277
276
|
"text-h3 !font-mono !font-medium flex-1",
|
|
278
277
|
authorType === 'system' ? "text-ods-open-yellow" :
|
|
@@ -432,8 +432,8 @@ const ChatMessageList = forwardRef<HTMLDivElement, ChatMessageListProps>(
|
|
|
432
432
|
<div
|
|
433
433
|
ref={setContentRef}
|
|
434
434
|
className={cn(
|
|
435
|
-
"mx-auto flex w-full max-w-
|
|
436
|
-
contentClassName
|
|
435
|
+
"mx-auto flex w-full max-w-ods-content-narrow flex-col pb-[var(--spacing-system-xs)] min-w-0",
|
|
436
|
+
contentClassName ?? "px-[var(--spacing-system-m)]",
|
|
437
437
|
)}
|
|
438
438
|
style={{ minHeight: '100%' }}
|
|
439
439
|
>
|
|
@@ -470,8 +470,8 @@ const ChatMessageList = forwardRef<HTMLDivElement, ChatMessageListProps>(
|
|
|
470
470
|
{showStreamingLoader && (
|
|
471
471
|
<div
|
|
472
472
|
className={cn(
|
|
473
|
-
"mx-auto w-full max-w-
|
|
474
|
-
contentClassName
|
|
473
|
+
"mx-auto w-full max-w-ods-content-narrow flex items-center gap-[var(--spacing-system-xxs)] py-[var(--spacing-system-xs)]",
|
|
474
|
+
contentClassName ?? "px-[var(--spacing-system-m)]",
|
|
475
475
|
)}
|
|
476
476
|
style={{ color: 'var(--color-text-muted)' }}
|
|
477
477
|
role="status"
|
|
@@ -491,8 +491,8 @@ const ChatMessageList = forwardRef<HTMLDivElement, ChatMessageListProps>(
|
|
|
491
491
|
{pendingApprovals && pendingApprovals.length > 0 && (
|
|
492
492
|
<div className={cn(
|
|
493
493
|
"border-t border-ods-border bg-ods-bg/95 backdrop-blur-sm",
|
|
494
|
-
"mx-auto w-full max-w-
|
|
495
|
-
contentClassName
|
|
494
|
+
"mx-auto w-full max-w-ods-content-narrow",
|
|
495
|
+
contentClassName ?? "px-[var(--spacing-system-m)]",
|
|
496
496
|
)}>
|
|
497
497
|
<ChatMessageEnhanced
|
|
498
498
|
role="assistant"
|
|
@@ -20,25 +20,24 @@ export function ChatMessageSkeleton({
|
|
|
20
20
|
return (
|
|
21
21
|
<div
|
|
22
22
|
className={cn(
|
|
23
|
-
"
|
|
23
|
+
"relative",
|
|
24
24
|
!isUser && "bg-ods-card/50 rounded-lg px-4 -mx-4",
|
|
25
25
|
className
|
|
26
26
|
)}
|
|
27
27
|
>
|
|
28
|
-
{/* Avatar Skeleton -
|
|
29
|
-
|
|
28
|
+
{/* Avatar Skeleton - absolutely positioned outside content area to match
|
|
29
|
+
the real ChatMessageEnhanced hanging-avatar layout. */}
|
|
30
|
+
{showAvatar && !isUser && (
|
|
30
31
|
<div className={cn(
|
|
31
|
-
"
|
|
32
|
-
|
|
33
|
-
? "invisible"
|
|
34
|
-
: isMingo
|
|
32
|
+
"absolute -left-16 top-[var(--spacing-system-s)] w-12 h-12 rounded-full animate-pulse",
|
|
33
|
+
isMingo
|
|
35
34
|
? "bg-gradient-to-br from-cyan-400/30 to-cyan-600/30"
|
|
36
35
|
: "bg-gradient-to-br from-pink-400/30 to-pink-600/30"
|
|
37
36
|
)} />
|
|
38
37
|
)}
|
|
39
|
-
|
|
38
|
+
|
|
40
39
|
{/* Message Content Skeleton */}
|
|
41
|
-
<div className="flex flex-
|
|
40
|
+
<div className="flex flex-col gap-1 min-w-0">
|
|
42
41
|
{/* Name and Timestamp Row Skeleton */}
|
|
43
42
|
<div className="flex items-center justify-between pr-2">
|
|
44
43
|
<div className="h-5 w-16 bg-ods-border rounded animate-pulse" />
|
|
@@ -92,7 +91,7 @@ export function ChatMessageListSkeleton({
|
|
|
92
91
|
className
|
|
93
92
|
)}
|
|
94
93
|
>
|
|
95
|
-
<div className={cn("mx-auto flex w-full max-w-
|
|
94
|
+
<div className={cn("mx-auto flex w-full max-w-ods-content-narrow flex-col pb-[var(--spacing-system-xs)] min-w-0", contentClassName ?? "px-[var(--spacing-system-m)]")} style={{ minHeight: '100%' }}>
|
|
96
95
|
<div className="flex-1" />
|
|
97
96
|
<div className="space-y-6">
|
|
98
97
|
{messages.map((message) => (
|
|
@@ -237,6 +237,10 @@ export interface ChatInputProps extends Omit<TextareaHTMLAttributes<HTMLTextArea
|
|
|
237
237
|
onStop?: () => void | Promise<void>
|
|
238
238
|
sending?: boolean
|
|
239
239
|
awaitingResponse?: boolean
|
|
240
|
+
/**
|
|
241
|
+
* @deprecated The avatar-offset layout was removed; this prop is accepted
|
|
242
|
+
* for back-compat but silently ignored. Safe to drop from call sites.
|
|
243
|
+
*/
|
|
240
244
|
reserveAvatarOffset?: boolean
|
|
241
245
|
disabled?: boolean
|
|
242
246
|
maxRows?: number
|
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
* Includes an "Add Script Argument" button to add new entries.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { Trash2 } from 'lucide-react'
|
|
10
10
|
import React from 'react'
|
|
11
|
-
import { cn } from '
|
|
11
|
+
import { cn } from '@/utils'
|
|
12
12
|
import { Button } from '../ui/button'
|
|
13
13
|
import { Input } from '../ui/input'
|
|
14
14
|
import { Label } from '../ui/label'
|
|
15
|
+
import {PlusCircleIcon} from "@/components/icons-v2-generated";
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Single script argument with key and value
|
|
@@ -156,12 +157,12 @@ export const ScriptArguments: React.FC<ScriptArgumentsProps> = ({
|
|
|
156
157
|
<div className="flex justify-start">
|
|
157
158
|
<Button
|
|
158
159
|
type="button"
|
|
159
|
-
variant="
|
|
160
|
-
|
|
160
|
+
variant="outline"
|
|
161
|
+
size="small"
|
|
161
162
|
onClick={handleAdd}
|
|
162
163
|
disabled={disabled}
|
|
163
|
-
|
|
164
|
-
|
|
164
|
+
className="self-start"
|
|
165
|
+
leftIcon={<PlusCircleIcon className="text-ods-text-secondary" />}
|
|
165
166
|
>
|
|
166
167
|
{addButtonLabel}
|
|
167
168
|
</Button>
|
package/tailwind.config.ts
CHANGED