@automattic/agenttic-ui 0.1.0 → 0.1.1
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 +23 -5
- package/dist/components/AgentUI.d.ts +65 -0
- package/dist/components/AgentUI.d.ts.map +1 -0
- package/dist/components/animations/index.d.ts +22 -0
- package/dist/components/animations/index.d.ts.map +1 -0
- package/dist/components/chat/Chat.d.ts +3 -0
- package/dist/components/chat/Chat.d.ts.map +1 -0
- package/dist/components/chat/Chat.stories.d.ts +38 -0
- package/dist/components/chat/Chat.stories.d.ts.map +1 -0
- package/dist/components/chat/ChatFooter.d.ts +20 -0
- package/dist/components/chat/ChatFooter.d.ts.map +1 -0
- package/dist/components/chat/ChatHeader.d.ts +6 -0
- package/dist/components/chat/ChatHeader.d.ts.map +1 -0
- package/dist/components/chat/ChatHeader.stories.d.ts +20 -0
- package/dist/components/chat/ChatHeader.stories.d.ts.map +1 -0
- package/dist/components/chat/ChatInput.d.ts +18 -0
- package/dist/components/chat/ChatInput.d.ts.map +1 -0
- package/dist/components/chat/ChatInput.stories.d.ts +15 -0
- package/dist/components/chat/ChatInput.stories.d.ts.map +1 -0
- package/dist/components/chat/MarkdownExamples.stories.d.ts +23 -0
- package/dist/components/chat/MarkdownExamples.stories.d.ts.map +1 -0
- package/dist/components/chat/Message.d.ts +11 -0
- package/dist/components/chat/Message.d.ts.map +1 -0
- package/dist/components/chat/Message.stories.d.ts +24 -0
- package/dist/components/chat/Message.stories.d.ts.map +1 -0
- package/dist/components/chat/MessageActions.d.ts +7 -0
- package/dist/components/chat/MessageActions.d.ts.map +1 -0
- package/dist/components/chat/MessageActions.stories.d.ts +23 -0
- package/dist/components/chat/MessageActions.stories.d.ts.map +1 -0
- package/dist/components/chat/Messages.d.ts +15 -0
- package/dist/components/chat/Messages.d.ts.map +1 -0
- package/dist/components/chat/Messages.stories.d.ts +41 -0
- package/dist/components/chat/Messages.stories.d.ts.map +1 -0
- package/dist/components/chat/Notice.d.ts +14 -0
- package/dist/components/chat/Notice.d.ts.map +1 -0
- package/dist/components/chat/Notice.stories.d.ts +18 -0
- package/dist/components/chat/Notice.stories.d.ts.map +1 -0
- package/dist/components/chat/Suggestions.d.ts +9 -0
- package/dist/components/chat/Suggestions.d.ts.map +1 -0
- package/dist/components/chat/ThinkingMessage.d.ts +6 -0
- package/dist/components/chat/ThinkingMessage.d.ts.map +1 -0
- package/dist/components/chat/ThinkingMessage.stories.d.ts +14 -0
- package/dist/components/chat/ThinkingMessage.stories.d.ts.map +1 -0
- package/dist/components/chat/index.d.ts +13 -0
- package/dist/components/chat/index.d.ts.map +1 -0
- package/dist/components/icons/ArrowUpIcon.d.ts +7 -0
- package/dist/components/icons/ArrowUpIcon.d.ts.map +1 -0
- package/dist/components/icons/BigSkyIcon.d.ts +7 -0
- package/dist/components/icons/BigSkyIcon.d.ts.map +1 -0
- package/dist/components/icons/ChevronDownIcon.d.ts +7 -0
- package/dist/components/icons/ChevronDownIcon.d.ts.map +1 -0
- package/dist/components/icons/ChevronUpIcon.d.ts +7 -0
- package/dist/components/icons/ChevronUpIcon.d.ts.map +1 -0
- package/dist/components/icons/CopyIcon.d.ts +7 -0
- package/dist/components/icons/CopyIcon.d.ts.map +1 -0
- package/dist/components/icons/Icons.stories.d.ts +40 -0
- package/dist/components/icons/Icons.stories.d.ts.map +1 -0
- package/dist/components/icons/StopIcon.d.ts +7 -0
- package/dist/components/icons/StopIcon.d.ts.map +1 -0
- package/dist/components/icons/StylesIcon.d.ts +7 -0
- package/dist/components/icons/StylesIcon.d.ts.map +1 -0
- package/dist/components/icons/ThumbsDownIcon.d.ts +7 -0
- package/dist/components/icons/ThumbsDownIcon.d.ts.map +1 -0
- package/dist/components/icons/ThumbsUpIcon.d.ts +7 -0
- package/dist/components/icons/ThumbsUpIcon.d.ts.map +1 -0
- package/dist/components/icons/XIcon.d.ts +7 -0
- package/dist/components/icons/XIcon.d.ts.map +1 -0
- package/dist/components/index.d.ts +17 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.stories.d.ts +17 -0
- package/dist/components/ui/button.stories.d.ts.map +1 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.stories.d.ts +44 -0
- package/dist/components/ui/textarea.stories.d.ts.map +1 -0
- package/dist/components/views/ChatViews.stories.d.ts +33 -0
- package/dist/components/views/ChatViews.stories.d.ts.map +1 -0
- package/dist/components/views/CollapsedView.d.ts +10 -0
- package/dist/components/views/CollapsedView.d.ts.map +1 -0
- package/dist/components/views/CompactView.d.ts +17 -0
- package/dist/components/views/CompactView.d.ts.map +1 -0
- package/dist/components/views/ConversationView.d.ts +31 -0
- package/dist/components/views/ConversationView.d.ts.map +1 -0
- package/dist/hooks/useChat.d.ts +3 -0
- package/dist/hooks/useChat.d.ts.map +1 -0
- package/dist/hooks/useInput.d.ts +17 -0
- package/dist/hooks/useInput.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1270 -1221
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/stories/charts/BarChart.stories.d.ts +26 -0
- package/dist/stories/charts/BarChart.stories.d.ts.map +1 -0
- package/dist/stories/charts/LineChart.stories.d.ts +26 -0
- package/dist/stories/charts/LineChart.stories.d.ts.map +1 -0
- package/dist/stories/gfm/GithubFlavoredMarkdown.stories.d.ts +36 -0
- package/dist/stories/gfm/GithubFlavoredMarkdown.stories.d.ts.map +1 -0
- package/dist/stories/mocks/messageActions.d.ts +20 -0
- package/dist/stories/mocks/messageActions.d.ts.map +1 -0
- package/dist/types/index.d.ts +85 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/utils/classNames.d.ts +11 -0
- package/dist/utils/classNames.d.ts.map +1 -0
- package/dist/utils/message-helpers.d.ts +64 -0
- package/dist/utils/message-helpers.d.ts.map +1 -0
- package/dist/utils/theme.d.ts +8 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/package.json +101 -100
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ChartBlock } from '@automattic/agenttic-client';
|
|
3
|
+
declare const meta: Meta<typeof ChartBlock>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
/**
|
|
7
|
+
* Default bar chart showing item comparison data
|
|
8
|
+
*/
|
|
9
|
+
export declare const Default: Story;
|
|
10
|
+
/**
|
|
11
|
+
* Time comparison bar chart showing data over time periods
|
|
12
|
+
*/
|
|
13
|
+
export declare const TimeComparison: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Bar chart with currency formatting
|
|
16
|
+
*/
|
|
17
|
+
export declare const WithCurrency: Story;
|
|
18
|
+
/**
|
|
19
|
+
* Bar chart without title demonstration
|
|
20
|
+
*/
|
|
21
|
+
export declare const NoTitle: Story;
|
|
22
|
+
/**
|
|
23
|
+
* Error state demonstration with invalid data structure
|
|
24
|
+
*/
|
|
25
|
+
export declare const ErrorState: Story;
|
|
26
|
+
//# sourceMappingURL=BarChart.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/charts/BarChart.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,UAAU,CAoBE,CAAC;AAEtC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,IAAI,CAAE,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAoCrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,KAoC5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAuC1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAiCrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAuBxB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ChartBlock } from '@automattic/agenttic-client';
|
|
3
|
+
declare const meta: Meta<typeof ChartBlock>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
/**
|
|
7
|
+
* Default line chart showing time-series data
|
|
8
|
+
*/
|
|
9
|
+
export declare const Default: Story;
|
|
10
|
+
/**
|
|
11
|
+
* Multi-series line chart with revenue and visitors
|
|
12
|
+
*/
|
|
13
|
+
export declare const MultiSeries: Story;
|
|
14
|
+
/**
|
|
15
|
+
* Line chart with currency formatting
|
|
16
|
+
*/
|
|
17
|
+
export declare const WithCurrency: Story;
|
|
18
|
+
/**
|
|
19
|
+
* Line chart without title
|
|
20
|
+
*/
|
|
21
|
+
export declare const NoTitle: Story;
|
|
22
|
+
/**
|
|
23
|
+
* Error state demonstration
|
|
24
|
+
*/
|
|
25
|
+
export declare const ErrorState: Story;
|
|
26
|
+
//# sourceMappingURL=LineChart.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/charts/LineChart.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAEzD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAE,OAAO,UAAU,CAoBE,CAAC;AAEtC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,IAAI,CAAE,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAoCrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAiDzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,KAyC1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAmCrB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,KAuBxB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import { Messages } from '../../components/chat/Messages';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof Messages;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
tags: string[];
|
|
15
|
+
argTypes: {
|
|
16
|
+
messages: {
|
|
17
|
+
control: false;
|
|
18
|
+
description: string;
|
|
19
|
+
};
|
|
20
|
+
isProcessing: {
|
|
21
|
+
control: "boolean";
|
|
22
|
+
description: string;
|
|
23
|
+
};
|
|
24
|
+
messageRenderer: {
|
|
25
|
+
control: false;
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export default meta;
|
|
31
|
+
type Story = StoryObj<typeof meta>;
|
|
32
|
+
export declare const Tables: Story;
|
|
33
|
+
export declare const Strikethrough: Story;
|
|
34
|
+
export declare const TaskLists: Story;
|
|
35
|
+
export declare const CompleteExample: Story;
|
|
36
|
+
//# sourceMappingURL=GithubFlavoredMarkdown.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GithubFlavoredMarkdown.stories.d.ts","sourceRoot":"","sources":["../../../src/stories/gfm/GithubFlavoredMarkdown.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAGvD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAG1D,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDyB,CAAC;AAEpC,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAE,OAAO,IAAI,CAAE,CAAC;AASrC,eAAO,MAAM,MAAM,EAAE,KAgDpB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAuC3B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAwDvB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA2D7B,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Message, MessageAction } from '../../types';
|
|
2
|
+
export declare const mockAgentMessage: Message;
|
|
3
|
+
export declare const mockUserMessage: Message;
|
|
4
|
+
export declare const mockLongAgentMessage: Message;
|
|
5
|
+
export declare const mockHandlers: {
|
|
6
|
+
onCopy: (message: Message) => Promise<void>;
|
|
7
|
+
onFeedback: (messageId: string, feedback: "up" | "down") => Promise<void>;
|
|
8
|
+
onShare: (message: Message) => Promise<void>;
|
|
9
|
+
onEdit: (message: Message) => Promise<void>;
|
|
10
|
+
onRetry: (message: Message) => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
export declare const copyAction: MessageAction;
|
|
13
|
+
export declare const shareAction: MessageAction;
|
|
14
|
+
export declare const editAction: MessageAction;
|
|
15
|
+
export declare const retryAction: MessageAction;
|
|
16
|
+
export declare function createMessageWithActions(base: Message, actions: MessageAction[]): Message;
|
|
17
|
+
export declare function createMessageWithFeedback(base: Message, feedbackState?: 'up' | 'down'): Message;
|
|
18
|
+
export declare function createCustomIcon(letter: string, color?: string): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare const mockMessageThread: Message[];
|
|
20
|
+
//# sourceMappingURL=messageActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageActions.d.ts","sourceRoot":"","sources":["../../../src/stories/mocks/messageActions.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAI1D,eAAO,MAAM,gBAAgB,EAAE,OAY9B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,OAY7B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,OAiClC,CAAC;AAGF,eAAO,MAAM,YAAY;sBACC,OAAO;4BAUD,MAAM,YAAY,IAAI,GAAG,MAAM;uBAKpC,OAAO;sBAKR,OAAO;uBAKN,OAAO;CAIjC,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,aAMxB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aA8BzB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,aA6BxB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aA6BzB,CAAC;AAGF,wBAAgB,wBAAwB,CACvC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,aAAa,EAAE,GACtB,OAAO,CAKT;AAGD,wBAAgB,yBAAyB,CACxC,IAAI,EAAE,OAAO,EACb,aAAa,CAAC,EAAE,IAAI,GAAG,MAAM,GAC3B,OAAO,CA0BT;AAGD,wBAAgB,gBAAgB,CAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,MAAkB,2CAmB1E;AAGD,eAAO,MAAM,iBAAiB,EAAE,OAAO,EAkBtC,CAAC"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
export interface Suggestion {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
prompt: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Message {
|
|
8
|
+
id: string;
|
|
9
|
+
role: 'user' | 'agent';
|
|
10
|
+
content: Array<{
|
|
11
|
+
type: 'text' | 'image_url' | 'component';
|
|
12
|
+
text?: string;
|
|
13
|
+
image_url?: string;
|
|
14
|
+
component?: React.ComponentType;
|
|
15
|
+
componentProps?: any;
|
|
16
|
+
}>;
|
|
17
|
+
timestamp: number;
|
|
18
|
+
archived: boolean;
|
|
19
|
+
showIcon: boolean;
|
|
20
|
+
icon?: string;
|
|
21
|
+
actions?: MessageAction[];
|
|
22
|
+
}
|
|
23
|
+
export interface MessageAction {
|
|
24
|
+
id: string;
|
|
25
|
+
icon: React.ReactNode;
|
|
26
|
+
label: string;
|
|
27
|
+
onClick: (message: Message) => void | Promise<void>;
|
|
28
|
+
tooltip?: string;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare const DEFAULT_PLACEHOLDER: import("@wordpress/i18n").TranslatableText<"Ask anything">;
|
|
32
|
+
export interface AgentUIProps {
|
|
33
|
+
messages: Message[];
|
|
34
|
+
isProcessing: boolean;
|
|
35
|
+
error?: string | null;
|
|
36
|
+
onSubmit: (message: string) => void;
|
|
37
|
+
className?: string;
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
variant?: 'floating' | 'embedded';
|
|
40
|
+
triggerIcon?: React.ReactNode;
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
notice?: NoticeConfig;
|
|
43
|
+
onOpen?: () => void;
|
|
44
|
+
onExpand?: () => void;
|
|
45
|
+
onClose?: () => void;
|
|
46
|
+
emptyView?: React.ReactNode;
|
|
47
|
+
floatingChatState?: ChatState;
|
|
48
|
+
suggestions?: Suggestion[];
|
|
49
|
+
clearSuggestions?: () => void;
|
|
50
|
+
messageRenderer?: ComponentType<{
|
|
51
|
+
children: string;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
export interface NoticeConfig {
|
|
55
|
+
icon?: React.ReactNode;
|
|
56
|
+
message: string;
|
|
57
|
+
action?: {
|
|
58
|
+
label: string;
|
|
59
|
+
onClick: () => void;
|
|
60
|
+
};
|
|
61
|
+
dismissible?: boolean;
|
|
62
|
+
onDismiss?: () => void;
|
|
63
|
+
}
|
|
64
|
+
export interface ChatProps extends AgentUIProps {
|
|
65
|
+
floatingChatState?: ChatState;
|
|
66
|
+
}
|
|
67
|
+
export type ChatState = 'collapsed' | 'compact' | 'expanded';
|
|
68
|
+
export interface UseChatReturn {
|
|
69
|
+
state: ChatState;
|
|
70
|
+
initialState: ChatState;
|
|
71
|
+
setState: (state: ChatState) => void;
|
|
72
|
+
isOpen: boolean;
|
|
73
|
+
open: () => void;
|
|
74
|
+
close: () => void;
|
|
75
|
+
toggle: () => void;
|
|
76
|
+
}
|
|
77
|
+
export interface UseInputReturn {
|
|
78
|
+
value: string;
|
|
79
|
+
setValue: (value: string) => void;
|
|
80
|
+
clear: () => void;
|
|
81
|
+
textareaRef: React.RefObject<HTMLTextAreaElement>;
|
|
82
|
+
handleKeyDown: (e: React.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
83
|
+
adjustHeight: () => void;
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,MAAM,WAAW,UAAU;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,OAAO;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,OAAO,EAAE,KAAK,C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IAAI,CAAC;IAClB,WAAW,EAAE,KAAK,CAAC,SAAS,CAAE,mBAAmB,CAAE,CAAC;IACpD,aAAa,EAAE,CAAE,CAAC,EAAE,KAAK,CAAC,aAAa,CAAE,mBAAmB,CAAE,KAAM,IAAI,CAAC;IACzE,YAAY,EAAE,MAAM,IAAI,CAAC;CACzB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility for combining class names, similar to clsx
|
|
3
|
+
* Supports strings, objects, arrays, and conditional classes
|
|
4
|
+
* @param {...any} inputs
|
|
5
|
+
*/
|
|
6
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
7
|
+
type ClassValue = string | number | null | undefined | ClassValue[] | {
|
|
8
|
+
[key: string]: boolean | null | undefined;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=classNames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classNames.d.ts","sourceRoot":"","sources":["../../src/utils/classNames.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,EAAE,CAAE,GAAG,MAAM,EAAE,UAAU,EAAE,GAAI,MAAM,CAsBpD;AAED,KAAK,UAAU,GACZ,MAAM,GACN,MAAM,GACN,IAAI,GACJ,SAAS,GACT,UAAU,EAAE,GACZ;IAAE,CAAE,GAAG,EAAE,MAAM,GAAI,OAAO,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Message } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Format a timestamp for display
|
|
4
|
+
* @param timestamp
|
|
5
|
+
*/
|
|
6
|
+
export declare const formatTimestamp: (timestamp: number) => string;
|
|
7
|
+
/**
|
|
8
|
+
* Extract text content from a message
|
|
9
|
+
* @param message
|
|
10
|
+
*/
|
|
11
|
+
export declare const getMessageText: (message: Message) => string;
|
|
12
|
+
/**
|
|
13
|
+
* Check if a message has image content
|
|
14
|
+
* @param message
|
|
15
|
+
*/
|
|
16
|
+
export declare const hasImageContent: (message: Message) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Get image URLs from a message
|
|
19
|
+
* @param message
|
|
20
|
+
*/
|
|
21
|
+
export declare const getImageUrls: (message: Message) => string[];
|
|
22
|
+
/**
|
|
23
|
+
* Check if a message has component content
|
|
24
|
+
* @param message
|
|
25
|
+
*/
|
|
26
|
+
export declare const hasComponentContent: (message: Message) => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Get React components from a message
|
|
29
|
+
* @param message
|
|
30
|
+
*/
|
|
31
|
+
export declare const getComponents: (message: Message) => React.ComponentType[];
|
|
32
|
+
/**
|
|
33
|
+
* Check if a message is a thinking message
|
|
34
|
+
* @param message
|
|
35
|
+
*/
|
|
36
|
+
export declare const isThinkingMessage: (message: Message) => boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Check if a message is a completed plan message
|
|
39
|
+
* @param message
|
|
40
|
+
*/
|
|
41
|
+
export declare const isCompletedPlanMessage: (message: Message) => boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Create a user message
|
|
44
|
+
* @param text
|
|
45
|
+
* @param imageUrls
|
|
46
|
+
*/
|
|
47
|
+
export declare const createUserMessage: (text: string, imageUrls?: string[]) => Message;
|
|
48
|
+
/**
|
|
49
|
+
* Create an agent message
|
|
50
|
+
* @param text
|
|
51
|
+
* @param additionalProps
|
|
52
|
+
*/
|
|
53
|
+
export declare const createAgentMessage: (text: string, additionalProps?: Partial<Message>) => Message;
|
|
54
|
+
/**
|
|
55
|
+
* Sort messages by creation time
|
|
56
|
+
* @param messages
|
|
57
|
+
*/
|
|
58
|
+
export declare const sortMessagesByTime: (messages: Message[]) => Message[];
|
|
59
|
+
/**
|
|
60
|
+
* Filter out archived messages
|
|
61
|
+
* @param messages
|
|
62
|
+
*/
|
|
63
|
+
export declare const getActiveMessages: (messages: Message[]) => Message[];
|
|
64
|
+
//# sourceMappingURL=message-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
|
1
|
+
/**
|
|
2
|
+
* Utility to get CSS variable values
|
|
3
|
+
* Note: OKLCH colors are automatically converted to RGB by the browser
|
|
4
|
+
* @param variableName
|
|
5
|
+
* @param fallback
|
|
6
|
+
*/
|
|
7
|
+
export declare const getCSSVariable: (variableName: string, fallback?: string) => string;
|
|
8
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAC1B,cAAc,MAAM,EACpB,WAAU,MAAW,KACnB,MAYF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,101 +1,102 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
2
|
+
"name": "@automattic/agenttic-ui",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "UI components for the Agenttic framework",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./index.css": "./dist/index.css"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "pnpm run clean && vite build && tsc --project tsconfig.json --emitDeclarationOnly",
|
|
22
|
+
"dev": "vite",
|
|
23
|
+
"clean": "rm -rf dist",
|
|
24
|
+
"type-check": "tsc --noEmit",
|
|
25
|
+
"lint": "wp-scripts lint-js src --ext .ts,.tsx",
|
|
26
|
+
"lint:fix": "wp-scripts lint-js src --ext .ts,.tsx --fix",
|
|
27
|
+
"test": "vitest run",
|
|
28
|
+
"prepublishOnly": "pnpm run build",
|
|
29
|
+
"storybook": "storybook dev -p 6006",
|
|
30
|
+
"build-storybook": "storybook build -o storybook-static",
|
|
31
|
+
"i18n:extract": "npx --no-install @wordpress/i18n-command make-pot src --output=languages/a8c-agenttic.pot --domain=a8c-agenttic",
|
|
32
|
+
"i18n:update": "npx --no-install @wordpress/i18n-command make-json languages --domain=a8c-agenttic"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [
|
|
35
|
+
"agenttic",
|
|
36
|
+
"ui",
|
|
37
|
+
"components",
|
|
38
|
+
"react",
|
|
39
|
+
"typescript",
|
|
40
|
+
"ai",
|
|
41
|
+
"agent"
|
|
42
|
+
],
|
|
43
|
+
"author": "Automattic",
|
|
44
|
+
"license": "MIT",
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18.0.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@automattic/charts": "^0.14.0",
|
|
50
|
+
"@mdx-js/react": "^3.1.0",
|
|
51
|
+
"@storybook/addon-a11y": "^9.0.18",
|
|
52
|
+
"@storybook/addon-docs": "^9.0.18",
|
|
53
|
+
"@storybook/addon-essentials": "9.0.0-alpha.12",
|
|
54
|
+
"@storybook/addon-links": "^9.0.18",
|
|
55
|
+
"@storybook/addon-onboarding": "^9.0.18",
|
|
56
|
+
"@storybook/blocks": "9.0.0-alpha.17",
|
|
57
|
+
"@storybook/manager-api": "^8.6.14",
|
|
58
|
+
"@storybook/react": "^9.0.18",
|
|
59
|
+
"@storybook/react-vite": "^9.0.18",
|
|
60
|
+
"@storybook/test": "9.0.0-alpha.2",
|
|
61
|
+
"@types/node": "^20.0.0",
|
|
62
|
+
"@types/react": "^18.0.0",
|
|
63
|
+
"@types/react-dom": "^18.0.0",
|
|
64
|
+
"@wordpress/prettier-config": "^4.2.0",
|
|
65
|
+
"@wordpress/scripts": "^27.9.0",
|
|
66
|
+
"autoprefixer": "^10.4.0",
|
|
67
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
68
|
+
"jsdom": "^24.0.0",
|
|
69
|
+
"postcss": "^8.4.0",
|
|
70
|
+
"storybook": "^9.0.18",
|
|
71
|
+
"typescript": "^5.0.0",
|
|
72
|
+
"vite": "^5.0.0",
|
|
73
|
+
"vite-plugin-lib-inject-css": "^2.2.2",
|
|
74
|
+
"vitest": "^1.0.0"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"@automattic/agenttic-client": "workspace:*",
|
|
78
|
+
"@radix-ui/react-scroll-area": "^1.2.9",
|
|
79
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
80
|
+
"@visx/xychart": "^3.12.0",
|
|
81
|
+
"@wordpress/data": "^10.0.0",
|
|
82
|
+
"@wordpress/element": "^6.24.0",
|
|
83
|
+
"@wordpress/i18n": "^6.1.0",
|
|
84
|
+
"class-variance-authority": "^0.7.1",
|
|
85
|
+
"clsx": "^2.1.1",
|
|
86
|
+
"framer-motion": "^12.23.0",
|
|
87
|
+
"lucide-react": "^0.525.0",
|
|
88
|
+
"react": "^18.0.0",
|
|
89
|
+
"react-dom": "^18.0.0",
|
|
90
|
+
"react-markdown": "^10.1.0",
|
|
91
|
+
"react-textarea-autosize": "^8.5.9"
|
|
92
|
+
},
|
|
93
|
+
"peerDependencies": {
|
|
94
|
+
"@automattic/charts": "^0.14.0",
|
|
95
|
+
"react": "^18.0.0",
|
|
96
|
+
"react-dom": "^18.0.0"
|
|
97
|
+
},
|
|
98
|
+
"publishConfig": {
|
|
99
|
+
"access": "public",
|
|
100
|
+
"branch": "trunk"
|
|
101
|
+
}
|
|
102
|
+
}
|