@ciridae/ui-agent 0.3.2 → 0.3.6
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/README.md +8 -2
- package/dist/ciridae-agent.css +5 -0
- package/dist/ciridae-agent.css.d.ts +2 -0
- package/dist/components/agentic/agent-card.d.ts +28 -0
- package/dist/components/agentic/agent-card.js +27 -0
- package/dist/components/agentic/agent-composer.d.ts +42 -0
- package/dist/components/agentic/agent-composer.js +89 -0
- package/dist/components/agentic/agent-context.d.ts +28 -0
- package/dist/components/agentic/agent-context.js +102 -0
- package/dist/components/agentic/agent-plan.js +1 -1
- package/dist/components/agentic/approval-request.d.ts +1 -1
- package/dist/components/agentic/assistant-mark-icon.d.ts +9 -0
- package/dist/components/agentic/assistant-mark-icon.js +12 -0
- package/dist/components/agentic/attachments-actions.d.ts +10 -0
- package/dist/components/agentic/attachments-actions.js +142 -0
- package/dist/components/agentic/attachments-context.d.ts +25 -0
- package/dist/components/agentic/attachments-context.js +196 -0
- package/dist/components/agentic/attachments-model.d.ts +23 -0
- package/dist/components/agentic/attachments-model.js +226 -0
- package/dist/components/agentic/attachments-preview.d.ts +7 -0
- package/dist/components/agentic/attachments-preview.js +25 -0
- package/dist/components/agentic/attachments-types.d.ts +87 -0
- package/dist/components/agentic/attachments-types.js +1 -0
- package/dist/components/agentic/attachments-ui.d.ts +14 -0
- package/dist/components/agentic/attachments-ui.js +90 -0
- package/dist/components/agentic/attachments.d.ts +5 -124
- package/dist/components/agentic/attachments.js +5 -591
- package/dist/components/agentic/audio-player.d.ts +16 -0
- package/dist/components/agentic/audio-player.js +21 -0
- package/dist/components/agentic/breathing-grid-icon.css +45 -0
- package/dist/components/agentic/breathing-grid-icon.css.d.ts +2 -0
- package/dist/components/agentic/breathing-grid-icon.d.ts +6 -0
- package/dist/components/agentic/breathing-grid-icon.js +7 -0
- package/dist/components/agentic/canvas.d.ts +10 -0
- package/dist/components/agentic/canvas.js +22 -0
- package/dist/components/agentic/code-block.js +1 -1
- package/dist/components/agentic/commit.d.ts +57 -0
- package/dist/components/agentic/commit.js +85 -0
- package/dist/components/agentic/connection.d.ts +3 -0
- package/dist/components/agentic/connection.js +8 -0
- package/dist/components/agentic/controls.d.ts +6 -0
- package/dist/components/agentic/controls.js +7 -0
- package/dist/components/agentic/conversation.d.ts +1 -1
- package/dist/components/agentic/edge.d.ts +8 -0
- package/dist/components/agentic/edge.js +65 -0
- package/dist/components/agentic/effort-selector.d.ts +43 -0
- package/dist/components/agentic/effort-selector.js +47 -0
- package/dist/components/agentic/environment-variables.d.ts +32 -0
- package/dist/components/agentic/environment-variables.js +66 -0
- package/dist/components/agentic/jsx-preview.d.ts +19 -0
- package/dist/components/agentic/jsx-preview.js +34 -0
- package/dist/components/agentic/message.d.ts +4 -4
- package/dist/components/agentic/message.js +48 -8
- package/dist/components/agentic/mic-selector.d.ts +58 -0
- package/dist/components/agentic/mic-selector.js +173 -0
- package/dist/components/agentic/node.d.ts +26 -0
- package/dist/components/agentic/node.js +29 -0
- package/dist/components/agentic/open-in-chat.d.ts +9 -0
- package/dist/components/agentic/open-in-chat.js +8 -0
- package/dist/components/agentic/package-info.d.ts +30 -0
- package/dist/components/agentic/package-info.js +44 -0
- package/dist/components/agentic/panel.d.ts +6 -0
- package/dist/components/agentic/panel.js +7 -0
- package/dist/components/agentic/persona.d.ts +16 -0
- package/dist/components/agentic/persona.js +116 -0
- package/dist/components/agentic/prompt-input-select.js +1 -1
- package/dist/components/agentic/prompt-input.d.ts +9 -9
- package/dist/components/agentic/prompt-input.js +7 -7
- package/dist/components/agentic/reasoning.d.ts +1 -1
- package/dist/components/agentic/reasoning.js +2 -2
- package/dist/components/agentic/run-checkpoint.d.ts +1 -1
- package/dist/components/agentic/shimmer.d.ts +2 -2
- package/dist/components/agentic/speech-input.d.ts +24 -0
- package/dist/components/agentic/speech-input.js +30 -0
- package/dist/components/agentic/stack-trace.d.ts +27 -0
- package/dist/components/agentic/stack-trace.js +76 -0
- package/dist/components/agentic/suggestion.d.ts +12 -0
- package/dist/components/agentic/suggestion.js +15 -0
- package/dist/components/agentic/test-results.d.ts +51 -0
- package/dist/components/agentic/test-results.js +83 -0
- package/dist/components/agentic/theme.d.ts +5 -0
- package/dist/components/agentic/theme.js +31 -0
- package/dist/components/agentic/tool.d.ts +1 -1
- package/dist/components/agentic/toolbar.d.ts +6 -0
- package/dist/components/agentic/toolbar.js +7 -0
- package/dist/components/agentic/transcription.d.ts +20 -0
- package/dist/components/agentic/transcription.js +32 -0
- package/dist/components/agentic/use-controllable-state.d.ts +6 -0
- package/dist/components/agentic/use-controllable-state.js +13 -0
- package/dist/components/agentic/voice-selector.d.ts +69 -0
- package/dist/components/agentic/voice-selector.js +122 -0
- package/dist/components/blocks/artifact-workbench.d.ts +9 -0
- package/dist/components/blocks/artifact-workbench.js +28 -0
- package/dist/components/blocks/tool-approval-panel.d.ts +11 -0
- package/dist/components/blocks/tool-approval-panel.js +11 -0
- package/dist/components/blocks/voice-agent-panel.d.ts +14 -0
- package/dist/components/blocks/voice-agent-panel.js +60 -0
- package/dist/components/blocks/workflow-canvas-panel.d.ts +18 -0
- package/dist/components/blocks/workflow-canvas-panel.js +106 -0
- package/dist/entries/agent-card.d.ts +1 -0
- package/dist/entries/agent-card.js +1 -0
- package/dist/entries/agent-composer.d.ts +1 -0
- package/dist/entries/agent-composer.js +1 -0
- package/dist/entries/agent-context.d.ts +1 -0
- package/dist/entries/agent-context.js +1 -0
- package/dist/entries/agent-plan.d.ts +1 -0
- package/dist/entries/agent-plan.js +1 -0
- package/dist/entries/agent-queue.d.ts +1 -0
- package/dist/entries/agent-queue.js +1 -0
- package/dist/entries/agent-task.d.ts +1 -0
- package/dist/entries/agent-task.js +1 -0
- package/dist/entries/agentic-types.d.ts +1 -0
- package/dist/entries/agentic-types.js +1 -0
- package/dist/entries/approval-request.d.ts +1 -0
- package/dist/entries/approval-request.js +1 -0
- package/dist/entries/artifact-workbench.d.ts +1 -0
- package/dist/entries/artifact-workbench.js +1 -0
- package/dist/entries/artifact.d.ts +1 -0
- package/dist/entries/artifact.js +1 -0
- package/dist/entries/assistant-mark-icon.d.ts +1 -0
- package/dist/entries/assistant-mark-icon.js +1 -0
- package/dist/entries/attachments-actions.d.ts +1 -0
- package/dist/entries/attachments-actions.js +1 -0
- package/dist/entries/attachments-context.d.ts +1 -0
- package/dist/entries/attachments-context.js +1 -0
- package/dist/entries/attachments-model.d.ts +1 -0
- package/dist/entries/attachments-model.js +1 -0
- package/dist/entries/attachments-preview.d.ts +1 -0
- package/dist/entries/attachments-preview.js +1 -0
- package/dist/entries/attachments-types.d.ts +1 -0
- package/dist/entries/attachments-types.js +1 -0
- package/dist/entries/attachments-ui.d.ts +1 -0
- package/dist/entries/attachments-ui.js +1 -0
- package/dist/entries/attachments.d.ts +1 -0
- package/dist/entries/attachments.js +1 -0
- package/dist/entries/audio-player.d.ts +1 -0
- package/dist/entries/audio-player.js +1 -0
- package/dist/entries/breathing-grid-icon.d.ts +1 -0
- package/dist/entries/breathing-grid-icon.js +1 -0
- package/dist/entries/canvas.d.ts +1 -0
- package/dist/entries/canvas.js +1 -0
- package/dist/entries/clipboard.d.ts +1 -0
- package/dist/entries/clipboard.js +1 -0
- package/dist/entries/code-block.d.ts +1 -0
- package/dist/entries/code-block.js +1 -0
- package/dist/entries/commit.d.ts +1 -0
- package/dist/entries/commit.js +1 -0
- package/dist/entries/connection.d.ts +1 -0
- package/dist/entries/connection.js +1 -0
- package/dist/entries/controls.d.ts +1 -0
- package/dist/entries/controls.js +1 -0
- package/dist/entries/conversation.d.ts +1 -0
- package/dist/entries/conversation.js +1 -0
- package/dist/entries/edge.d.ts +1 -0
- package/dist/entries/edge.js +1 -0
- package/dist/entries/effort-selector.d.ts +1 -0
- package/dist/entries/effort-selector.js +1 -0
- package/dist/entries/environment-variables.d.ts +1 -0
- package/dist/entries/environment-variables.js +1 -0
- package/dist/entries/file-tree.d.ts +1 -0
- package/dist/entries/file-tree.js +1 -0
- package/dist/entries/image.d.ts +1 -0
- package/dist/entries/image.js +1 -0
- package/dist/entries/inline-citation.d.ts +1 -0
- package/dist/entries/inline-citation.js +1 -0
- package/dist/entries/jsx-preview.d.ts +1 -0
- package/dist/entries/jsx-preview.js +1 -0
- package/dist/entries/message-branch.d.ts +1 -0
- package/dist/entries/message-branch.js +1 -0
- package/dist/entries/message.d.ts +1 -0
- package/dist/entries/message.js +1 -0
- package/dist/entries/mic-selector.d.ts +1 -0
- package/dist/entries/mic-selector.js +1 -0
- package/dist/entries/model-selector.d.ts +1 -0
- package/dist/entries/model-selector.js +1 -0
- package/dist/entries/node.d.ts +1 -0
- package/dist/entries/node.js +1 -0
- package/dist/entries/open-in-chat.d.ts +1 -0
- package/dist/entries/open-in-chat.js +1 -0
- package/dist/entries/package-info.d.ts +1 -0
- package/dist/entries/package-info.js +1 -0
- package/dist/entries/panel.d.ts +1 -0
- package/dist/entries/panel.js +1 -0
- package/dist/entries/persona.d.ts +1 -0
- package/dist/entries/persona.js +1 -0
- package/dist/entries/prompt-input-action-menu.d.ts +1 -0
- package/dist/entries/prompt-input-action-menu.js +1 -0
- package/dist/entries/prompt-input-command.d.ts +1 -0
- package/dist/entries/prompt-input-command.js +1 -0
- package/dist/entries/prompt-input-hover-card.d.ts +1 -0
- package/dist/entries/prompt-input-hover-card.js +1 -0
- package/dist/entries/prompt-input-select.d.ts +1 -0
- package/dist/entries/prompt-input-select.js +1 -0
- package/dist/entries/prompt-input-tabs.d.ts +1 -0
- package/dist/entries/prompt-input-tabs.js +1 -0
- package/dist/entries/prompt-input.d.ts +1 -0
- package/dist/entries/prompt-input.js +1 -0
- package/dist/entries/reasoning.d.ts +1 -0
- package/dist/entries/reasoning.js +1 -0
- package/dist/entries/run-checkpoint.d.ts +1 -0
- package/dist/entries/run-checkpoint.js +1 -0
- package/dist/entries/run-trace.d.ts +1 -0
- package/dist/entries/run-trace.js +1 -0
- package/dist/entries/sandbox.d.ts +1 -0
- package/dist/entries/sandbox.js +1 -0
- package/dist/entries/schema-display.d.ts +1 -0
- package/dist/entries/schema-display.js +1 -0
- package/dist/entries/shimmer.d.ts +1 -0
- package/dist/entries/shimmer.js +1 -0
- package/dist/entries/snippet.d.ts +1 -0
- package/dist/entries/snippet.js +1 -0
- package/dist/entries/sources.d.ts +1 -0
- package/dist/entries/sources.js +1 -0
- package/dist/entries/speech-input.d.ts +1 -0
- package/dist/entries/speech-input.js +1 -0
- package/dist/entries/stack-trace.d.ts +1 -0
- package/dist/entries/stack-trace.js +1 -0
- package/dist/entries/suggestion.d.ts +1 -0
- package/dist/entries/suggestion.js +1 -0
- package/dist/entries/terminal.d.ts +1 -0
- package/dist/entries/terminal.js +1 -0
- package/dist/entries/test-results.d.ts +1 -0
- package/dist/entries/test-results.js +1 -0
- package/dist/entries/theme.d.ts +1 -0
- package/dist/entries/theme.js +1 -0
- package/dist/entries/tool-approval-panel.d.ts +1 -0
- package/dist/entries/tool-approval-panel.js +1 -0
- package/dist/entries/tool.d.ts +1 -0
- package/dist/entries/tool.js +1 -0
- package/dist/entries/toolbar.d.ts +1 -0
- package/dist/entries/toolbar.js +1 -0
- package/dist/entries/transcription.d.ts +1 -0
- package/dist/entries/transcription.js +1 -0
- package/dist/entries/types.d.ts +1 -0
- package/dist/entries/types.js +1 -0
- package/dist/entries/use-controllable-state.d.ts +1 -0
- package/dist/entries/use-controllable-state.js +1 -0
- package/dist/entries/voice-agent-panel.d.ts +1 -0
- package/dist/entries/voice-agent-panel.js +1 -0
- package/dist/entries/voice-selector.d.ts +1 -0
- package/dist/entries/voice-selector.js +1 -0
- package/dist/entries/web-preview.d.ts +1 -0
- package/dist/entries/web-preview.js +1 -0
- package/dist/entries/workflow-canvas-panel.d.ts +1 -0
- package/dist/entries/workflow-canvas-panel.js +1 -0
- package/dist/style-imports.d.ts +3 -0
- package/dist/styled-system/styles.css +422 -0
- package/dist/styled-system/styles.css.d.ts +2 -0
- package/dist/styles.css +7 -0
- package/package.json +17 -137
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { FileTextIcon, GlobeIcon, ImageIcon, Music2Icon, PaperclipIcon, VideoIcon, } from "lucide-react";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { AttachmentRemove } from "./attachments-actions";
|
|
5
|
+
import { AttachmentStatus, renderAttachmentPreview } from "./attachments-preview";
|
|
6
|
+
import { AttachmentItemContext, AttachmentsContext, useAttachmentContext, useAttachmentsContext, useOptionalAttachments, } from "./attachments-context";
|
|
7
|
+
import { getAttachmentLabel, getAttachmentMeta, getMediaCategory } from "./attachments-model";
|
|
8
|
+
import { HoverCard, HoverCardContent, HoverCardTrigger } from "@ciridae/ui/hover-card";
|
|
9
|
+
import { cn } from "@ciridae/ui/utils";
|
|
10
|
+
const mediaCategoryIcons = {
|
|
11
|
+
audio: Music2Icon,
|
|
12
|
+
document: FileTextIcon,
|
|
13
|
+
image: ImageIcon,
|
|
14
|
+
source: GlobeIcon,
|
|
15
|
+
unknown: PaperclipIcon,
|
|
16
|
+
video: VideoIcon,
|
|
17
|
+
};
|
|
18
|
+
function Attachments({ variant = "grid", className, children, ...props }) {
|
|
19
|
+
const controller = useOptionalAttachments();
|
|
20
|
+
const shouldRenderFiles = !children && controller && controller.files.length > 0;
|
|
21
|
+
const contextValue = React.useMemo(() => ({ variant }), [variant]);
|
|
22
|
+
if (!children && controller && controller.files.length === 0)
|
|
23
|
+
return null;
|
|
24
|
+
return (_jsx(AttachmentsContext.Provider, { value: contextValue, children: _jsx("div", { "data-slot": "attachments", "data-variant": variant, className: cn("flex min-w-0 items-start", variant === "grid" && "ml-auto w-fit flex-wrap gap-2", variant === "inline" && "flex-wrap gap-1.5", variant === "list" && "w-full flex-col gap-2", className), ...props, children: shouldRenderFiles
|
|
25
|
+
? controller.files.map((attachment) => (_jsxs(Attachment, { data: attachment, onRemove: () => controller.remove(attachment.id), children: [_jsx(AttachmentPreview, {}), _jsx(AttachmentInfo, { showMediaType: variant === "list" }), _jsx(AttachmentStatus, { status: attachment.status }), _jsx(AttachmentRemove, {})] }, attachment.id)))
|
|
26
|
+
: children }) }));
|
|
27
|
+
}
|
|
28
|
+
function AttachmentList({ variant = "inline", ...props }) {
|
|
29
|
+
return _jsx(Attachments, { variant: variant, ...props });
|
|
30
|
+
}
|
|
31
|
+
function Attachment({ attachment, children, className, data, onRemove, ...props }) {
|
|
32
|
+
const { variant } = useAttachmentsContext();
|
|
33
|
+
const controller = useOptionalAttachments();
|
|
34
|
+
const resolvedData = data ?? attachment;
|
|
35
|
+
const contextValue = React.useMemo(() => {
|
|
36
|
+
if (!resolvedData)
|
|
37
|
+
return null;
|
|
38
|
+
const resolvedOnRemove = onRemove ??
|
|
39
|
+
(resolvedData.id && controller ? () => controller.remove(resolvedData.id) : undefined);
|
|
40
|
+
return {
|
|
41
|
+
data: resolvedData,
|
|
42
|
+
mediaCategory: getMediaCategory(resolvedData),
|
|
43
|
+
onRemove: resolvedOnRemove,
|
|
44
|
+
variant,
|
|
45
|
+
};
|
|
46
|
+
}, [controller, onRemove, resolvedData, variant]);
|
|
47
|
+
if (!contextValue)
|
|
48
|
+
return null;
|
|
49
|
+
return (_jsx(AttachmentItemContext.Provider, { value: contextValue, children: _jsx("div", { "data-kind": contextValue.data.kind, "data-slot": "attachment", "data-status": contextValue.data.status, "data-variant": variant, className: cn("group/attachment relative min-w-0 text-sm text-foreground", variant === "grid" && "size-24 overflow-hidden rounded-lg border bg-muted/40", variant === "inline" && [
|
|
50
|
+
"flex h-8 max-w-full cursor-pointer items-center gap-1.5 rounded-md border bg-background px-1.5 select-none",
|
|
51
|
+
"font-medium transition-colors hover:bg-accent hover:text-accent-foreground",
|
|
52
|
+
], variant === "list" && [
|
|
53
|
+
"flex w-full items-center gap-3 rounded-lg border bg-background p-3 transition-colors",
|
|
54
|
+
"hover:bg-accent/50",
|
|
55
|
+
], "data-[status=error]:border-destructive/40 data-[status=error]:bg-destructive/5", className), ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(AttachmentPreview, {}), _jsx(AttachmentInfo, { showMediaType: variant === "list" }), _jsx(AttachmentStatus, { status: contextValue.data.status }), _jsx(AttachmentRemove, {})] })) }) }));
|
|
56
|
+
}
|
|
57
|
+
function AttachmentPreview({ fallbackIcon, className, ...props }) {
|
|
58
|
+
const { data, mediaCategory, variant } = useAttachmentContext();
|
|
59
|
+
const Icon = mediaCategoryIcons[mediaCategory];
|
|
60
|
+
const iconClassName = variant === "inline" ? "size-3" : "size-4";
|
|
61
|
+
return (_jsx("div", { "data-slot": "attachment-preview", className: cn("flex shrink-0 items-center justify-center overflow-hidden", variant === "grid" && "size-full bg-muted", variant === "inline" && "size-5 rounded bg-muted/60", variant === "list" && "size-12 rounded-md bg-muted/60", className), ...props, children: renderAttachmentPreview(data, mediaCategory, variant) ?? fallbackIcon ?? (_jsx(Icon, { className: cn(iconClassName, "text-muted-foreground") })) }));
|
|
62
|
+
}
|
|
63
|
+
function AttachmentInfo({ showMediaType = false, className, ...props }) {
|
|
64
|
+
const { data, variant } = useAttachmentContext();
|
|
65
|
+
if (variant === "grid")
|
|
66
|
+
return null;
|
|
67
|
+
return (_jsxs("div", { "data-slot": "attachment-info", className: cn("grid min-w-0 flex-1 gap-0.5", className), ...props, children: [_jsx("span", { className: "block min-w-0 truncate text-xs leading-none font-medium", children: getAttachmentLabel(data) }), showMediaType || data.error ? (_jsx("span", { className: "block min-w-0 truncate text-[0.6875rem] leading-none text-muted-foreground", children: data.error ?? getAttachmentMeta(data) })) : null] }));
|
|
68
|
+
}
|
|
69
|
+
function AttachmentName({ className, children, ...props }) {
|
|
70
|
+
const context = React.useContext(AttachmentItemContext);
|
|
71
|
+
return (_jsx("span", { "data-slot": "attachment-name", className: cn("min-w-0 truncate text-xs leading-none font-medium", className), ...props, children: children ?? (context ? getAttachmentLabel(context.data) : undefined) }));
|
|
72
|
+
}
|
|
73
|
+
function AttachmentMeta({ attachment, children, className, data, ...props }) {
|
|
74
|
+
const context = React.useContext(AttachmentItemContext);
|
|
75
|
+
const resolvedData = data ?? attachment ?? context?.data;
|
|
76
|
+
return (_jsx("span", { "data-slot": "attachment-meta", className: cn("min-w-0 truncate text-[0.6875rem] leading-none text-muted-foreground", className), ...props, children: children ?? getAttachmentMeta(resolvedData) }));
|
|
77
|
+
}
|
|
78
|
+
function AttachmentHoverCard({ closeDelay = 0, openDelay = 0, ...props }) {
|
|
79
|
+
return _jsx(HoverCard, { closeDelay: closeDelay, openDelay: openDelay, ...props });
|
|
80
|
+
}
|
|
81
|
+
function AttachmentHoverCardTrigger(props) {
|
|
82
|
+
return _jsx(HoverCardTrigger, { ...props });
|
|
83
|
+
}
|
|
84
|
+
function AttachmentHoverCardContent({ align = "start", className, ...props }) {
|
|
85
|
+
return _jsx(HoverCardContent, { align: align, className: cn("w-auto p-2", className), ...props });
|
|
86
|
+
}
|
|
87
|
+
function AttachmentEmpty({ className, children, ...props }) {
|
|
88
|
+
return (_jsx("div", { "data-slot": "attachment-empty", className: cn("flex items-center justify-center rounded-lg border border-dashed p-4 text-sm text-muted-foreground", className), ...props, children: children ?? "No attachments" }));
|
|
89
|
+
}
|
|
90
|
+
export { Attachment, AttachmentEmpty, AttachmentHoverCard, AttachmentHoverCardContent, AttachmentHoverCardTrigger, AttachmentInfo, AttachmentList, AttachmentMeta, AttachmentName, AttachmentPreview, Attachments, };
|
|
@@ -1,124 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type AgenticAttachment
|
|
6
|
-
file?: File;
|
|
7
|
-
filename?: string;
|
|
8
|
-
title?: string;
|
|
9
|
-
type?: "file" | "source-document";
|
|
10
|
-
};
|
|
11
|
-
type AttachmentData = AgenticAttachment;
|
|
12
|
-
type AttachmentMediaCategory = "image" | "video" | "audio" | "document" | "source" | "unknown";
|
|
13
|
-
type AttachmentVariant = "grid" | "inline" | "list";
|
|
14
|
-
type AttachmentErrorCode = "accept" | "max_attachments" | "max_attachment_size";
|
|
15
|
-
type AttachmentError = {
|
|
16
|
-
code: AttachmentErrorCode;
|
|
17
|
-
message: string;
|
|
18
|
-
};
|
|
19
|
-
type AttachmentAddOptions = {
|
|
20
|
-
kind?: AgenticPromptAttachmentKind;
|
|
21
|
-
};
|
|
22
|
-
type AttachmentScreenshotStatus = "idle" | "capturing" | "unavailable" | "error";
|
|
23
|
-
type AttachmentControllerContextValue = {
|
|
24
|
-
accept?: string;
|
|
25
|
-
add: (files: File[] | FileList, options?: AttachmentAddOptions) => void;
|
|
26
|
-
clear: () => void;
|
|
27
|
-
error?: AttachmentError;
|
|
28
|
-
files: AgenticAttachment[];
|
|
29
|
-
maxAttachmentSizeMb?: number;
|
|
30
|
-
maxAttachments?: number;
|
|
31
|
-
openFileDialog: () => void;
|
|
32
|
-
remove: (id: string) => void;
|
|
33
|
-
screenshotStatus: AttachmentScreenshotStatus;
|
|
34
|
-
takeScreenshot: () => Promise<void>;
|
|
35
|
-
};
|
|
36
|
-
type AttachmentProviderProps = {
|
|
37
|
-
accept?: string;
|
|
38
|
-
attachments?: AgenticAttachment[];
|
|
39
|
-
children: React.ReactNode;
|
|
40
|
-
defaultAttachments?: AgenticAttachment[];
|
|
41
|
-
maxAttachmentSizeMb?: number;
|
|
42
|
-
maxAttachments?: number;
|
|
43
|
-
multiple?: boolean;
|
|
44
|
-
onAttachmentError?: (error: AttachmentError) => void;
|
|
45
|
-
onAttachmentsChange?: (attachments: AgenticAttachment[]) => void;
|
|
46
|
-
onCaptureScreenshot?: () => File | null | Promise<File | null>;
|
|
47
|
-
};
|
|
48
|
-
type AttachmentsProps = React.ComponentProps<"div"> & {
|
|
49
|
-
variant?: AttachmentVariant;
|
|
50
|
-
};
|
|
51
|
-
type AttachmentProps = React.ComponentProps<"div"> & {
|
|
52
|
-
attachment?: AttachmentData;
|
|
53
|
-
data?: AttachmentData;
|
|
54
|
-
onRemove?: () => void;
|
|
55
|
-
};
|
|
56
|
-
type AttachmentPreviewProps = React.ComponentProps<"div"> & {
|
|
57
|
-
fallbackIcon?: React.ReactNode;
|
|
58
|
-
};
|
|
59
|
-
type AttachmentInfoProps = React.ComponentProps<"div"> & {
|
|
60
|
-
showMediaType?: boolean;
|
|
61
|
-
};
|
|
62
|
-
type AttachmentRemoveProps = React.ComponentProps<typeof Button> & {
|
|
63
|
-
attachmentId?: string;
|
|
64
|
-
label?: string;
|
|
65
|
-
};
|
|
66
|
-
type AttachmentHoverCardProps = React.ComponentProps<typeof HoverCard>;
|
|
67
|
-
type AttachmentHoverCardTriggerProps = React.ComponentProps<typeof HoverCardTrigger>;
|
|
68
|
-
type AttachmentHoverCardContentProps = React.ComponentProps<typeof HoverCardContent>;
|
|
69
|
-
type AttachmentEmptyProps = React.ComponentProps<"div">;
|
|
70
|
-
type AttachmentListProps = AttachmentsProps;
|
|
71
|
-
type AttachmentNameProps = React.ComponentProps<"span">;
|
|
72
|
-
type AttachmentMetaProps = React.ComponentProps<"span"> & {
|
|
73
|
-
attachment?: AttachmentData;
|
|
74
|
-
data?: AttachmentData;
|
|
75
|
-
};
|
|
76
|
-
type AttachmentActionRenderAs = "button" | "menu-item";
|
|
77
|
-
type AttachmentActionAddFilesProps = React.ComponentProps<typeof Button> & {
|
|
78
|
-
label?: string;
|
|
79
|
-
renderAs?: AttachmentActionRenderAs;
|
|
80
|
-
tooltip?: string;
|
|
81
|
-
};
|
|
82
|
-
type AttachmentActionAddScreenshotProps = React.ComponentProps<typeof Button> & {
|
|
83
|
-
label?: string;
|
|
84
|
-
renderAs?: AttachmentActionRenderAs;
|
|
85
|
-
status?: AttachmentScreenshotStatus;
|
|
86
|
-
tooltip?: string;
|
|
87
|
-
};
|
|
88
|
-
declare function AttachmentProvider({ accept, attachments, children, defaultAttachments, maxAttachmentSizeMb, maxAttachments, multiple, onAttachmentError, onAttachmentsChange, onCaptureScreenshot, }: AttachmentProviderProps): React.JSX.Element;
|
|
89
|
-
declare function useAttachments(): AttachmentControllerContextValue;
|
|
90
|
-
declare function useOptionalAttachments(): AttachmentControllerContextValue | null;
|
|
91
|
-
declare function useAttachmentsContext(): {
|
|
92
|
-
variant: AttachmentVariant;
|
|
93
|
-
};
|
|
94
|
-
declare function useAttachmentContext(): {
|
|
95
|
-
data: AttachmentData;
|
|
96
|
-
mediaCategory: AttachmentMediaCategory;
|
|
97
|
-
onRemove?: () => void;
|
|
98
|
-
variant: AttachmentVariant;
|
|
99
|
-
};
|
|
100
|
-
declare function Attachments({ variant, className, children, ...props }: AttachmentsProps): React.JSX.Element | null;
|
|
101
|
-
declare function AttachmentList({ variant, ...props }: AttachmentListProps): React.JSX.Element;
|
|
102
|
-
declare function Attachment({ attachment, children, className, data, onRemove, ...props }: AttachmentProps): React.JSX.Element | null;
|
|
103
|
-
declare function AttachmentPreview({ fallbackIcon, className, ...props }: AttachmentPreviewProps): React.JSX.Element;
|
|
104
|
-
declare function AttachmentInfo({ showMediaType, className, ...props }: AttachmentInfoProps): React.JSX.Element | null;
|
|
105
|
-
declare function AttachmentName({ className, children, ...props }: AttachmentNameProps): React.JSX.Element;
|
|
106
|
-
declare function AttachmentMeta({ attachment, children, className, data, ...props }: AttachmentMetaProps): React.JSX.Element;
|
|
107
|
-
declare function AttachmentRemove({ attachmentId, children, className, label, onClick, size, type, variant: buttonVariant, ...props }: AttachmentRemoveProps): React.JSX.Element | null;
|
|
108
|
-
declare function AttachmentHoverCard({ closeDelay, openDelay, ...props }: AttachmentHoverCardProps): React.JSX.Element;
|
|
109
|
-
declare function AttachmentHoverCardTrigger(props: AttachmentHoverCardTriggerProps): React.JSX.Element;
|
|
110
|
-
declare function AttachmentHoverCardContent({ align, className, ...props }: AttachmentHoverCardContentProps): React.JSX.Element;
|
|
111
|
-
declare function AttachmentEmpty({ className, children, ...props }: AttachmentEmptyProps): React.JSX.Element;
|
|
112
|
-
declare function AttachmentActionAddFiles({ children, className, label, onClick, renderAs, size, tooltip, type, variant, ...props }: AttachmentActionAddFilesProps): React.JSX.Element;
|
|
113
|
-
declare function AttachmentActionAddScreenshot({ children, className, disabled, label, onClick, renderAs, size, status, tooltip, type, variant, ...props }: AttachmentActionAddScreenshotProps): React.JSX.Element;
|
|
114
|
-
declare function useAttachmentDropTarget({ global, ref, }: {
|
|
115
|
-
global?: boolean;
|
|
116
|
-
ref: React.RefObject<HTMLElement | null>;
|
|
117
|
-
}): void;
|
|
118
|
-
declare function prepareAttachmentsForSubmit(attachments: AgenticAttachment[]): Promise<AgenticAttachment[]>;
|
|
119
|
-
declare function fileToAttachment(file: File, kind?: AgenticPromptAttachmentKind): AgenticAttachment;
|
|
120
|
-
declare function getMediaCategory(data: AttachmentData): AttachmentMediaCategory;
|
|
121
|
-
declare function getAttachmentLabel(data: AttachmentData): string;
|
|
122
|
-
declare function captureBrowserScreenshot(): Promise<File | null>;
|
|
123
|
-
export { Attachment, AttachmentActionAddFiles, AttachmentActionAddScreenshot, AttachmentEmpty, AttachmentHoverCard, AttachmentHoverCardContent, AttachmentHoverCardTrigger, AttachmentInfo, AttachmentList, AttachmentMeta, AttachmentName, AttachmentPreview, AttachmentProvider, AttachmentRemove, Attachments, captureBrowserScreenshot, fileToAttachment, getAttachmentLabel, getMediaCategory, prepareAttachmentsForSubmit, useAttachmentContext, useAttachmentDropTarget, useAttachments, useAttachmentsContext, useOptionalAttachments, };
|
|
124
|
-
export type { AgenticAttachment, AttachmentActionAddFilesProps, AttachmentActionAddScreenshotProps, AttachmentAddOptions, AttachmentControllerContextValue as AttachmentContextValue, AttachmentData, AttachmentEmptyProps, AttachmentError, AttachmentErrorCode, AttachmentHoverCardContentProps, AttachmentHoverCardProps, AttachmentHoverCardTriggerProps, AttachmentInfoProps, AttachmentListProps, AttachmentMediaCategory, AttachmentMetaProps, AttachmentNameProps, AttachmentPreviewProps, AttachmentProps, AttachmentProviderProps, AttachmentRemoveProps, AttachmentScreenshotStatus, AttachmentVariant, AttachmentsProps, };
|
|
1
|
+
export { AttachmentActionAddFiles, AttachmentActionAddScreenshot, AttachmentRemove, useAttachmentDropTarget, } from "./attachments-actions";
|
|
2
|
+
export { AttachmentProvider, useAttachmentContext, useAttachments, useAttachmentsContext, useOptionalAttachments, } from "./attachments-context";
|
|
3
|
+
export { captureBrowserScreenshot, fileToAttachment, getAttachmentLabel, getMediaCategory, prepareAttachmentsForSubmit, } from "./attachments-model";
|
|
4
|
+
export { Attachment, AttachmentEmpty, AttachmentHoverCard, AttachmentHoverCardContent, AttachmentHoverCardTrigger, AttachmentInfo, AttachmentList, AttachmentMeta, AttachmentName, AttachmentPreview, Attachments, } from "./attachments-ui";
|
|
5
|
+
export type { AgenticAttachment, AttachmentActionAddFilesProps, AttachmentActionAddScreenshotProps, AttachmentAddOptions, AttachmentControllerContextValue as AttachmentContextValue, AttachmentData, AttachmentEmptyProps, AttachmentError, AttachmentErrorCode, AttachmentHoverCardContentProps, AttachmentHoverCardProps, AttachmentHoverCardTriggerProps, AttachmentInfoProps, AttachmentListProps, AttachmentMediaCategory, AttachmentMetaProps, AttachmentNameProps, AttachmentPreviewProps, AttachmentProps, AttachmentProviderProps, AttachmentRemoveProps, AttachmentScreenshotStatus, AttachmentVariant, AttachmentsProps, } from "./attachments-types";
|