@salla.sa/ui-ai-kit-core 1.0.0
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/LICENSE +21 -0
- package/dist/cjs/ai-card.cjs.entry.js +25 -0
- package/dist/cjs/ai-chat-container.cjs.entry.js +138 -0
- package/dist/cjs/ai-chat-header.cjs.entry.js +79 -0
- package/dist/cjs/ai-chat-message.cjs.entry.js +164 -0
- package/dist/cjs/ai-icon.cjs.entry.js +25 -0
- package/dist/cjs/ai-link.cjs.entry.js +34 -0
- package/dist/cjs/ai-loading.cjs.entry.js +77 -0
- package/dist/cjs/ai-message-input.cjs.entry.js +65 -0
- package/dist/cjs/ai-rating.cjs.entry.js +57 -0
- package/dist/cjs/ai-suggestion.cjs.entry.js +31 -0
- package/dist/cjs/ai-voice-input.cjs.entry.js +233 -0
- package/dist/cjs/icon-registry-dmfLA-Dj.js +82 -0
- package/dist/cjs/index-DLJcLHFH.js +1622 -0
- package/dist/cjs/index.cjs.js +7 -0
- package/dist/cjs/loader.cjs.js +12 -0
- package/dist/cjs/ui-ai-kit.cjs.js +24 -0
- package/dist/collection/collection-manifest.json +23 -0
- package/dist/collection/components/ai-card/ai-card.css +40 -0
- package/dist/collection/components/ai-card/ai-card.js +70 -0
- package/dist/collection/components/ai-card/ai-card.stories.js +52 -0
- package/dist/collection/components/ai-chat-container/ai-chat-container.css +137 -0
- package/dist/collection/components/ai-chat-container/ai-chat-container.js +270 -0
- package/dist/collection/components/ai-chat-container/ai-chat-container.stories.js +160 -0
- package/dist/collection/components/ai-chat-header/ai-chat-header.css +186 -0
- package/dist/collection/components/ai-chat-header/ai-chat-header.js +311 -0
- package/dist/collection/components/ai-chat-header/ai-chat-header.stories.js +138 -0
- package/dist/collection/components/ai-chat-message/ai-chat-message.css +304 -0
- package/dist/collection/components/ai-chat-message/ai-chat-message.js +379 -0
- package/dist/collection/components/ai-chat-message/ai-chat-message.stories.js +164 -0
- package/dist/collection/components/ai-icon/ai-icon.css +9 -0
- package/dist/collection/components/ai-icon/ai-icon.js +76 -0
- package/dist/collection/components/ai-link/ai-link.css +62 -0
- package/dist/collection/components/ai-link/ai-link.js +119 -0
- package/dist/collection/components/ai-link/ai-link.stories.js +79 -0
- package/dist/collection/components/ai-loading/ai-loading.css +202 -0
- package/dist/collection/components/ai-loading/ai-loading.js +244 -0
- package/dist/collection/components/ai-loading/ai-loading.stories.js +145 -0
- package/dist/collection/components/ai-message-input/ai-message-input.css +175 -0
- package/dist/collection/components/ai-message-input/ai-message-input.js +192 -0
- package/dist/collection/components/ai-message-input/ai-message-input.stories.js +125 -0
- package/dist/collection/components/ai-rating/ai-rating.css +145 -0
- package/dist/collection/components/ai-rating/ai-rating.js +176 -0
- package/dist/collection/components/ai-rating/ai-rating.stories.js +78 -0
- package/dist/collection/components/ai-suggestion/ai-suggestion.css +69 -0
- package/dist/collection/components/ai-suggestion/ai-suggestion.js +93 -0
- package/dist/collection/components/ai-suggestion/ai-suggestion.stories.js +62 -0
- package/dist/collection/components/ai-voice-input/ai-voice-input.css +136 -0
- package/dist/collection/components/ai-voice-input/ai-voice-input.js +341 -0
- package/dist/collection/components/ai-voice-input/ai-voice-input.stories.js +118 -0
- package/dist/collection/index.js +10 -0
- package/dist/collection/utils/icon-registry.js +78 -0
- package/dist/collection/utils/utils.js +3 -0
- package/dist/components/ai-card.d.ts +11 -0
- package/dist/components/ai-card.js +1 -0
- package/dist/components/ai-chat-container.d.ts +11 -0
- package/dist/components/ai-chat-container.js +1 -0
- package/dist/components/ai-chat-header.d.ts +11 -0
- package/dist/components/ai-chat-header.js +1 -0
- package/dist/components/ai-chat-message.d.ts +11 -0
- package/dist/components/ai-chat-message.js +1 -0
- package/dist/components/ai-icon.d.ts +11 -0
- package/dist/components/ai-icon.js +1 -0
- package/dist/components/ai-link.d.ts +11 -0
- package/dist/components/ai-link.js +1 -0
- package/dist/components/ai-loading.d.ts +11 -0
- package/dist/components/ai-loading.js +1 -0
- package/dist/components/ai-message-input.d.ts +11 -0
- package/dist/components/ai-message-input.js +1 -0
- package/dist/components/ai-rating.d.ts +11 -0
- package/dist/components/ai-rating.js +1 -0
- package/dist/components/ai-suggestion.d.ts +11 -0
- package/dist/components/ai-suggestion.js +1 -0
- package/dist/components/ai-voice-input.d.ts +11 -0
- package/dist/components/ai-voice-input.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-CWjXxYJI.js +1 -0
- package/dist/components/p-CY6emva2.js +1 -0
- package/dist/components/p-DYv5ef4M.js +1 -0
- package/dist/esm/ai-card.entry.js +23 -0
- package/dist/esm/ai-chat-container.entry.js +136 -0
- package/dist/esm/ai-chat-header.entry.js +77 -0
- package/dist/esm/ai-chat-message.entry.js +162 -0
- package/dist/esm/ai-icon.entry.js +23 -0
- package/dist/esm/ai-link.entry.js +32 -0
- package/dist/esm/ai-loading.entry.js +75 -0
- package/dist/esm/ai-message-input.entry.js +63 -0
- package/dist/esm/ai-rating.entry.js +55 -0
- package/dist/esm/ai-suggestion.entry.js +29 -0
- package/dist/esm/ai-voice-input.entry.js +231 -0
- package/dist/esm/icon-registry-DYv5ef4M.js +80 -0
- package/dist/esm/index-7hrZ8FOQ.js +1612 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/loader.js +10 -0
- package/dist/esm/ui-ai-kit.js +20 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/ai-card/ai-card.d.ts +7 -0
- package/dist/types/components/ai-card/ai-card.stories.d.ts +7 -0
- package/dist/types/components/ai-chat-container/ai-chat-container.d.ts +28 -0
- package/dist/types/components/ai-chat-container/ai-chat-container.stories.d.ts +7 -0
- package/dist/types/components/ai-chat-header/ai-chat-header.d.ts +38 -0
- package/dist/types/components/ai-chat-header/ai-chat-header.stories.d.ts +8 -0
- package/dist/types/components/ai-chat-message/ai-chat-message.d.ts +27 -0
- package/dist/types/components/ai-chat-message/ai-chat-message.stories.d.ts +10 -0
- package/dist/types/components/ai-icon/ai-icon.d.ts +8 -0
- package/dist/types/components/ai-link/ai-link.d.ts +12 -0
- package/dist/types/components/ai-link/ai-link.stories.d.ts +8 -0
- package/dist/types/components/ai-loading/ai-loading.d.ts +33 -0
- package/dist/types/components/ai-loading/ai-loading.stories.d.ts +10 -0
- package/dist/types/components/ai-message-input/ai-message-input.d.ts +22 -0
- package/dist/types/components/ai-message-input/ai-message-input.stories.d.ts +13 -0
- package/dist/types/components/ai-rating/ai-rating.d.ts +17 -0
- package/dist/types/components/ai-rating/ai-rating.stories.d.ts +8 -0
- package/dist/types/components/ai-suggestion/ai-suggestion.d.ts +10 -0
- package/dist/types/components/ai-suggestion/ai-suggestion.stories.d.ts +8 -0
- package/dist/types/components/ai-voice-input/ai-voice-input.d.ts +43 -0
- package/dist/types/components/ai-voice-input/ai-voice-input.stories.d.ts +9 -0
- package/dist/types/components.d.ts +860 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/utils/icon-registry.d.ts +5 -0
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/ui-ai-kit/index.esm.js +1 -0
- package/dist/ui-ai-kit/p-11facfad.entry.js +1 -0
- package/dist/ui-ai-kit/p-128a2ed4.entry.js +1 -0
- package/dist/ui-ai-kit/p-227bdb8f.entry.js +1 -0
- package/dist/ui-ai-kit/p-455daa17.entry.js +1 -0
- package/dist/ui-ai-kit/p-56163e8c.entry.js +1 -0
- package/dist/ui-ai-kit/p-6d21d0fd.entry.js +1 -0
- package/dist/ui-ai-kit/p-6ddcd77b.entry.js +1 -0
- package/dist/ui-ai-kit/p-7hrZ8FOQ.js +2 -0
- package/dist/ui-ai-kit/p-8e90143e.entry.js +1 -0
- package/dist/ui-ai-kit/p-9938c277.entry.js +1 -0
- package/dist/ui-ai-kit/p-DYv5ef4M.js +1 -0
- package/dist/ui-ai-kit/p-dc5b4a7f.entry.js +1 -0
- package/dist/ui-ai-kit/p-fb1702de.entry.js +1 -0
- package/dist/ui-ai-kit/ui-ai-kit.css +1 -0
- package/dist/ui-ai-kit/ui-ai-kit.esm.js +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +77 -0
- package/readme.md +111 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { g as globalScripts, b as bootstrapLazy } from './index-7hrZ8FOQ.js';
|
|
2
|
+
export { s as setNonce } from './index-7hrZ8FOQ.js';
|
|
3
|
+
|
|
4
|
+
const defineCustomElements = async (win, options) => {
|
|
5
|
+
if (typeof window === 'undefined') return undefined;
|
|
6
|
+
await globalScripts();
|
|
7
|
+
return bootstrapLazy([["ai-chat-container",[[769,"ai-chat-container",{"isOpen":[4,"is-open"],"position":[1],"width":[1],"autoScroll":[4,"auto-scroll"],"showWatermark":[4,"show-watermark"],"floatHeight":[1,"float-height"],"isMobile":[32]},null,{"position":[{"positionChanged":0}]}]]],["ai-message-input",[[513,"ai-message-input",{"placeholder":[1],"disabled":[4],"showVoiceButton":[4,"show-voice-button"],"inputValue":[32],"setInputValue":[64]}]]],["ai-voice-input",[[513,"ai-voice-input",{"disabled":[4],"showWaveform":[4,"show-waveform"],"autoStart":[4,"auto-start"],"state":[32],"error":[32],"recordingDuration":[32]}]]],["ai-card",[[769,"ai-card",{"noPadding":[4,"no-padding"],"noShadow":[4,"no-shadow"]}]]],["ai-chat-header",[[513,"ai-chat-header",{"mode":[1],"conversation":[1],"agentName":[1,"agent-name"],"agentStatus":[1,"agent-status"],"agentAvatar":[1,"agent-avatar"],"showBack":[4,"show-back"],"isDraggable":[4,"is-draggable"]}]]],["ai-chat-message",[[769,"ai-chat-message",{"role":[1],"content":[1],"format":[1],"agentName":[1,"agent-name"],"timestamp":[1],"showActions":[4,"show-actions"],"enableRegenerate":[4,"enable-regenerate"],"feedbackValue":[1025,"feedback-value"],"copySuccess":[32]}]]],["ai-link",[[769,"ai-link",{"label":[1],"href":[1],"target":[1],"rel":[1]}]]],["ai-loading",[[513,"ai-loading",{"mode":[1],"statusText":[1,"status-text"],"steps":[1],"headerTitle":[1,"header-title"],"expanded":[1028],"collapsible":[4],"_expanded":[32]}]]],["ai-rating",[[513,"ai-rating",{"question":[1],"subtitle":[1],"value":[1026],"disabled":[4],"hovered":[32]}]]],["ai-suggestion",[[769,"ai-suggestion",{"label":[1],"disabled":[4]}]]],["ai-icon",[[513,"ai-icon",{"name":[1],"size":[2]}]]]], options);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { defineCustomElements };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { p as promiseResolve, g as globalScripts, b as bootstrapLazy } from './index-7hrZ8FOQ.js';
|
|
2
|
+
export { s as setNonce } from './index-7hrZ8FOQ.js';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
Stencil Client Patch Browser v4.43.2 | MIT Licensed | https://stenciljs.com
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
var patchBrowser = () => {
|
|
9
|
+
const importMeta = import.meta.url;
|
|
10
|
+
const opts = {};
|
|
11
|
+
if (importMeta !== "") {
|
|
12
|
+
opts.resourcesUrl = new URL(".", importMeta).href;
|
|
13
|
+
}
|
|
14
|
+
return promiseResolve(opts);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
patchBrowser().then(async (options) => {
|
|
18
|
+
await globalScripts();
|
|
19
|
+
return bootstrapLazy([["ai-chat-container",[[769,"ai-chat-container",{"isOpen":[4,"is-open"],"position":[1],"width":[1],"autoScroll":[4,"auto-scroll"],"showWatermark":[4,"show-watermark"],"floatHeight":[1,"float-height"],"isMobile":[32]},null,{"position":[{"positionChanged":0}]}]]],["ai-message-input",[[513,"ai-message-input",{"placeholder":[1],"disabled":[4],"showVoiceButton":[4,"show-voice-button"],"inputValue":[32],"setInputValue":[64]}]]],["ai-voice-input",[[513,"ai-voice-input",{"disabled":[4],"showWaveform":[4,"show-waveform"],"autoStart":[4,"auto-start"],"state":[32],"error":[32],"recordingDuration":[32]}]]],["ai-card",[[769,"ai-card",{"noPadding":[4,"no-padding"],"noShadow":[4,"no-shadow"]}]]],["ai-chat-header",[[513,"ai-chat-header",{"mode":[1],"conversation":[1],"agentName":[1,"agent-name"],"agentStatus":[1,"agent-status"],"agentAvatar":[1,"agent-avatar"],"showBack":[4,"show-back"],"isDraggable":[4,"is-draggable"]}]]],["ai-chat-message",[[769,"ai-chat-message",{"role":[1],"content":[1],"format":[1],"agentName":[1,"agent-name"],"timestamp":[1],"showActions":[4,"show-actions"],"enableRegenerate":[4,"enable-regenerate"],"feedbackValue":[1025,"feedback-value"],"copySuccess":[32]}]]],["ai-link",[[769,"ai-link",{"label":[1],"href":[1],"target":[1],"rel":[1]}]]],["ai-loading",[[513,"ai-loading",{"mode":[1],"statusText":[1,"status-text"],"steps":[1],"headerTitle":[1,"header-title"],"expanded":[1028],"collapsible":[4],"_expanded":[32]}]]],["ai-rating",[[513,"ai-rating",{"question":[1],"subtitle":[1],"value":[1026],"disabled":[4],"hovered":[32]}]]],["ai-suggestion",[[769,"ai-suggestion",{"label":[1],"disabled":[4]}]]],["ai-icon",[[513,"ai-icon",{"name":[1],"size":[2]}]]]], options);
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./cjs/index.cjs.js');
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './esm/index.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare class ChatContainer {
|
|
2
|
+
el: HTMLElement;
|
|
3
|
+
/** Controls visibility of the chat panel */
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
/** Position of the panel: 'left', 'right', or 'float' */
|
|
6
|
+
position: 'left' | 'right' | 'float';
|
|
7
|
+
/** Width of the panel (CSS value, e.g., '400px', '30%', '28rem') */
|
|
8
|
+
width: string;
|
|
9
|
+
/** Enable/disable auto-scroll to latest message */
|
|
10
|
+
autoScroll: boolean;
|
|
11
|
+
/** Show AI watermark in the top half of the container */
|
|
12
|
+
showWatermark: boolean;
|
|
13
|
+
/** Height of the panel when position='float' */
|
|
14
|
+
floatHeight: string;
|
|
15
|
+
isMobile: boolean;
|
|
16
|
+
private containerRef;
|
|
17
|
+
private dragState;
|
|
18
|
+
private resizeObserver;
|
|
19
|
+
componentWillLoad(): void;
|
|
20
|
+
componentDidLoad(): void;
|
|
21
|
+
positionChanged(newVal: string): void;
|
|
22
|
+
disconnectedCallback(): void;
|
|
23
|
+
private checkMobile;
|
|
24
|
+
private setupDrag;
|
|
25
|
+
private getContainerClasses;
|
|
26
|
+
private getContainerStyle;
|
|
27
|
+
render(): any;
|
|
28
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const StickyRight: Story;
|
|
6
|
+
export declare const FloatMode: Story;
|
|
7
|
+
export declare const ShowcaseConversation: Story;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class AiChatHeader {
|
|
3
|
+
/** Layout variant */
|
|
4
|
+
mode: 'agent' | 'human';
|
|
5
|
+
/** Agent mode: conversation title */
|
|
6
|
+
conversation: string;
|
|
7
|
+
/** Human mode: agent's display name */
|
|
8
|
+
agentName: string;
|
|
9
|
+
/** Human mode: status label (e.g. "Active") */
|
|
10
|
+
agentStatus: string;
|
|
11
|
+
/** Human mode: avatar image URL */
|
|
12
|
+
agentAvatar: string;
|
|
13
|
+
/** Human mode: show the back button */
|
|
14
|
+
showBack: boolean;
|
|
15
|
+
isDraggable: boolean;
|
|
16
|
+
/** Cancel / close button */
|
|
17
|
+
closeClick: EventEmitter<void>;
|
|
18
|
+
/** Pencil-edit button (agent mode) */
|
|
19
|
+
editClick: EventEmitter<void>;
|
|
20
|
+
/** Title / chevron click → open conversation list (agent mode) */
|
|
21
|
+
dropdownClick: EventEmitter<void>;
|
|
22
|
+
/** Chevron-down button (human mode) */
|
|
23
|
+
moreClick: EventEmitter<void>;
|
|
24
|
+
/** Back-arrow button (human mode) */
|
|
25
|
+
backClick: EventEmitter<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Fired on pointerdown of the drag handle.
|
|
28
|
+
* Composed + bubbling so ai-chat-container can receive it across shadow roots.
|
|
29
|
+
*/
|
|
30
|
+
headerDragStart: EventEmitter<{
|
|
31
|
+
clientX: number;
|
|
32
|
+
clientY: number;
|
|
33
|
+
}>;
|
|
34
|
+
private renderIcon;
|
|
35
|
+
private renderAgentMode;
|
|
36
|
+
private renderHumanMode;
|
|
37
|
+
render(): any;
|
|
38
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const AgentMode: Story;
|
|
6
|
+
export declare const HumanMode: Story;
|
|
7
|
+
export declare const HumanWithoutBack: Story;
|
|
8
|
+
export declare const InChatContainer: Story;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class AiChatMessage {
|
|
3
|
+
role: 'user' | 'agent';
|
|
4
|
+
content: string;
|
|
5
|
+
format: 'text' | 'markdown';
|
|
6
|
+
agentName: string;
|
|
7
|
+
timestamp: string;
|
|
8
|
+
showActions: boolean;
|
|
9
|
+
enableRegenerate: boolean;
|
|
10
|
+
feedbackValue: 'up' | 'down' | null;
|
|
11
|
+
messageCopy: EventEmitter<void>;
|
|
12
|
+
messageFeedback: EventEmitter<'up' | 'down'>;
|
|
13
|
+
messageRegenerate: EventEmitter<void>;
|
|
14
|
+
private copySuccess;
|
|
15
|
+
private copyTimeout;
|
|
16
|
+
disconnectedCallback(): void;
|
|
17
|
+
private renderIcon;
|
|
18
|
+
private parseMarkdown;
|
|
19
|
+
private getRenderedContent;
|
|
20
|
+
private getRelativeTime;
|
|
21
|
+
private handleCopy;
|
|
22
|
+
private handleFeedback;
|
|
23
|
+
private renderActionsBar;
|
|
24
|
+
private renderUserMessage;
|
|
25
|
+
private renderAgentMessage;
|
|
26
|
+
render(): any;
|
|
27
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const UserMessage: Story;
|
|
6
|
+
export declare const AgentMessageSimple: Story;
|
|
7
|
+
export declare const AgentMessageMarkdown: Story;
|
|
8
|
+
export declare const FeedbackSelected: Story;
|
|
9
|
+
export declare const WithSlottedContent: Story;
|
|
10
|
+
export declare const ConversationThread: Story;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class AiLink {
|
|
2
|
+
/** Link display label */
|
|
3
|
+
label: string;
|
|
4
|
+
/** Href URL */
|
|
5
|
+
href: string;
|
|
6
|
+
/** Link target */
|
|
7
|
+
target: '_blank' | '_self' | '_parent' | '_top';
|
|
8
|
+
/** Rel attribute — defaults to noopener noreferrer for _blank */
|
|
9
|
+
rel: string;
|
|
10
|
+
private renderShareIcon;
|
|
11
|
+
render(): any;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const Playground: Story;
|
|
6
|
+
export declare const MultipleLinks: Story;
|
|
7
|
+
export declare const InsideCard: Story;
|
|
8
|
+
export declare const FullMessageContext: Story;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export interface LoadingStep {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
status: 'pending' | 'executing' | 'completed' | 'failed';
|
|
6
|
+
agent?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class AiLoading {
|
|
9
|
+
/** Main mode switch */
|
|
10
|
+
mode: 'thinking' | 'steps';
|
|
11
|
+
/** Thinking mode status text */
|
|
12
|
+
statusText: string;
|
|
13
|
+
/** Steps as JSON string array of LoadingStep */
|
|
14
|
+
steps: string;
|
|
15
|
+
/** Steps mode title */
|
|
16
|
+
headerTitle: string;
|
|
17
|
+
/** Steps mode expand state */
|
|
18
|
+
expanded: boolean;
|
|
19
|
+
/** Whether steps card is collapsible */
|
|
20
|
+
collapsible: boolean;
|
|
21
|
+
toggleExpand: EventEmitter<boolean>;
|
|
22
|
+
stepClick: EventEmitter<LoadingStep>;
|
|
23
|
+
private _expanded;
|
|
24
|
+
componentWillLoad(): void;
|
|
25
|
+
private renderIcon;
|
|
26
|
+
private renderSparkleAvatar;
|
|
27
|
+
private renderStepBadge;
|
|
28
|
+
private getStepsList;
|
|
29
|
+
private handleToggle;
|
|
30
|
+
private renderThinkingMode;
|
|
31
|
+
private renderStepsMode;
|
|
32
|
+
render(): any;
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const Thinking: Story;
|
|
6
|
+
export declare const ThinkingCustomText: Story;
|
|
7
|
+
export declare const StepsInProgress: Story;
|
|
8
|
+
export declare const StepsAllCompleted: Story;
|
|
9
|
+
export declare const StepsCollapsed: Story;
|
|
10
|
+
export declare const StepsCustomTitle: Story;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class MessageInput {
|
|
3
|
+
el: HTMLElement;
|
|
4
|
+
/** Placeholder text for the textarea */
|
|
5
|
+
placeholder: string;
|
|
6
|
+
/** Whether the input is disabled */
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
/** Whether to show the voice recording button */
|
|
9
|
+
showVoiceButton: boolean;
|
|
10
|
+
inputValue: string;
|
|
11
|
+
private textareaRef;
|
|
12
|
+
/** Event emitted when a message is sent */
|
|
13
|
+
sendMessage: EventEmitter<string>;
|
|
14
|
+
/** Event emitted when the voice button is clicked — caller controls rendering the voice recorder */
|
|
15
|
+
voiceButtonClick: EventEmitter<void>;
|
|
16
|
+
/** Set the textarea value programmatically (e.g. after speech-to-text transcription) */
|
|
17
|
+
setInputValue(value: string): Promise<void>;
|
|
18
|
+
private handleSendMessage;
|
|
19
|
+
private handleKeyPress;
|
|
20
|
+
private handleInputChange;
|
|
21
|
+
render(): any;
|
|
22
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const Default: Story;
|
|
6
|
+
export declare const Disabled: Story;
|
|
7
|
+
/**
|
|
8
|
+
* Demonstrates the full voice toggle pattern:
|
|
9
|
+
* clicking the mic button hides the message input and shows ai-voice-input.
|
|
10
|
+
* After recording (or cancel) the voice input is hidden and message input is restored.
|
|
11
|
+
* When audio is recorded, setInputValue() pre-fills the textarea for review.
|
|
12
|
+
*/
|
|
13
|
+
export declare const WithVoiceToggle: Story;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export type RatingValue = 1 | 2 | 3 | 4 | 5;
|
|
3
|
+
export declare class AiRating {
|
|
4
|
+
/** Main question label */
|
|
5
|
+
question: string;
|
|
6
|
+
/** Sub-label below the question */
|
|
7
|
+
subtitle: string;
|
|
8
|
+
/** Currently selected rating value (1–5) */
|
|
9
|
+
value: RatingValue | null;
|
|
10
|
+
/** Disable interaction */
|
|
11
|
+
disabled: boolean;
|
|
12
|
+
private hovered;
|
|
13
|
+
ratingChange: EventEmitter<RatingValue>;
|
|
14
|
+
private select;
|
|
15
|
+
private get selectedLabel();
|
|
16
|
+
render(): any;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const Standalone: Story;
|
|
6
|
+
export declare const InsideCard: Story;
|
|
7
|
+
export declare const PreSelected: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class AiSuggestion {
|
|
3
|
+
/** Suggestion text label */
|
|
4
|
+
label: string;
|
|
5
|
+
/** Disabled state */
|
|
6
|
+
disabled: boolean;
|
|
7
|
+
suggestionClick: EventEmitter<string>;
|
|
8
|
+
private handleClick;
|
|
9
|
+
render(): any;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const Playground: Story;
|
|
6
|
+
export declare const SuggestionGroup: Story;
|
|
7
|
+
export declare const Disabled: Story;
|
|
8
|
+
export declare const InChatContext: Story;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
type RecordingState = 'idle' | 'recording';
|
|
3
|
+
export declare class VoiceInput {
|
|
4
|
+
/** Whether the voice input is disabled */
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
/** Whether to show the waveform animation */
|
|
7
|
+
showWaveform: boolean;
|
|
8
|
+
/** Whether to auto-start recording on mount */
|
|
9
|
+
autoStart: boolean;
|
|
10
|
+
/** Internal state */
|
|
11
|
+
state: RecordingState;
|
|
12
|
+
error: string | null;
|
|
13
|
+
recordingDuration: number;
|
|
14
|
+
/** Event emitted when audio blob is ready */
|
|
15
|
+
audioRecorded: EventEmitter<{
|
|
16
|
+
blob: Blob;
|
|
17
|
+
duration: number;
|
|
18
|
+
}>;
|
|
19
|
+
/** Event emitted when recording is canceled */
|
|
20
|
+
recordingCancel: EventEmitter<void>;
|
|
21
|
+
private streamRef;
|
|
22
|
+
private audioContextRef;
|
|
23
|
+
private analyserRef;
|
|
24
|
+
private mediaRecorderRef;
|
|
25
|
+
private audioChunks;
|
|
26
|
+
private recordingStartTime;
|
|
27
|
+
private recordingTimer;
|
|
28
|
+
private maxTimeoutRef;
|
|
29
|
+
private canvasRef;
|
|
30
|
+
private animationFrameId;
|
|
31
|
+
private prevHeights;
|
|
32
|
+
componentDidLoad(): void;
|
|
33
|
+
disconnectedCallback(): void;
|
|
34
|
+
private cleanup;
|
|
35
|
+
private startRecording;
|
|
36
|
+
private setupMediaRecorder;
|
|
37
|
+
private stopRecording;
|
|
38
|
+
private cancelRecording;
|
|
39
|
+
private drawWaveform;
|
|
40
|
+
private formatDuration;
|
|
41
|
+
render(): any;
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/web-components';
|
|
2
|
+
declare const meta: Meta;
|
|
3
|
+
export default meta;
|
|
4
|
+
type Story = StoryObj;
|
|
5
|
+
export declare const Default: Story;
|
|
6
|
+
export declare const AutoStart: Story;
|
|
7
|
+
export declare const WithoutWaveform: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
9
|
+
export declare const WithEventHandlers: Story;
|