@swisper.ai/web-chat-ui 0.3.3 → 0.4.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/dist/components/chat-prompt-box/chat-prompt-box-context.d.ts +10 -1
- package/dist/components/chat-prompt-box/chat-prompt-box-context.d.ts.map +1 -1
- package/dist/components/chat-prompt-box/chat-prompt-box-voice-motion.d.ts +85 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-voice-motion.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-voice.d.ts +20 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-voice.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-voice.stories.d.ts +45 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-voice.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts +24 -1
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts.map +1 -1
- package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts.map +1 -1
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/chat-prompt-box-voice-bar-icon.d.ts +31 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/chat-prompt-box-voice-bar-icon.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/chat-prompt-box-voice-bar-icon.stories.d.ts +17 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/chat-prompt-box-voice-bar-icon.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-button/chat-prompt-box-voice-button.d.ts +29 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-button/chat-prompt-box-voice-button.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-button/chat-prompt-box-voice-button.stories.d.ts +12 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-button/chat-prompt-box-voice-button.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-button/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-button/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-light/chat-prompt-box-voice-light.d.ts +44 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-light/chat-prompt-box-voice-light.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-light/chat-prompt-box-voice-light.stories.d.ts +17 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-light/chat-prompt-box-voice-light.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-light/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-light/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/chat-prompt-box-voice-mic-button.d.ts +14 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/chat-prompt-box-voice-mic-button.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/chat-prompt-box-voice-mic-button.stories.d.ts +11 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/chat-prompt-box-voice-mic-button.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-panel/chat-prompt-box-voice-panel.d.ts +18 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-panel/chat-prompt-box-voice-panel.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-panel/chat-prompt-box-voice-panel.stories.d.ts +18 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-panel/chat-prompt-box-voice-panel.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-panel/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-panel/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.d.ts +14 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.stories.d.ts +11 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/index.d.ts +7 -0
- package/dist/components/chat-prompt-box/components/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/index.d.ts +5 -1
- package/dist/components/chat-prompt-box/index.d.ts.map +1 -1
- package/dist/components/chat-prompt-box/use-voice-motion.d.ts +22 -0
- package/dist/components/chat-prompt-box/use-voice-motion.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.es.js +2285 -1443
- package/dist/index.es.js.map +1 -1
- package/package.json +3 -3
- package/src/components/chat-prompt-box/chat-prompt-box-context.tsx +35 -1
- package/src/components/chat-prompt-box/chat-prompt-box-voice-motion.ts +436 -0
- package/src/components/chat-prompt-box/chat-prompt-box-voice.stories.tsx +243 -0
- package/src/components/chat-prompt-box/chat-prompt-box-voice.tsx +191 -0
- package/src/components/chat-prompt-box/chat-prompt-box.json +66 -7
- package/src/components/chat-prompt-box/chat-prompt-box.stories.tsx +16 -0
- package/src/components/chat-prompt-box/chat-prompt-box.tsx +131 -77
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/chat-prompt-box-voice-bar-icon.stories.tsx +155 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/chat-prompt-box-voice-bar-icon.tsx +80 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/index.ts +5 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-button/chat-prompt-box-voice-button.stories.tsx +107 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-button/chat-prompt-box-voice-button.tsx +101 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-button/index.ts +5 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-light/chat-prompt-box-voice-light.stories.tsx +177 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-light/chat-prompt-box-voice-light.tsx +283 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-light/index.ts +5 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/chat-prompt-box-voice-mic-button.stories.tsx +50 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/chat-prompt-box-voice-mic-button.tsx +46 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/index.ts +2 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-panel/chat-prompt-box-voice-panel.stories.tsx +149 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-panel/chat-prompt-box-voice-panel.tsx +55 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-panel/index.ts +5 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.stories.tsx +50 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.tsx +46 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/index.ts +2 -0
- package/src/components/chat-prompt-box/components/index.ts +6 -0
- package/src/components/chat-prompt-box/index.ts +23 -0
- package/src/components/chat-prompt-box/use-voice-motion.ts +184 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-prompt-box-voice-sound-button.d.ts","sourceRoot":"","sources":["../../../../../src/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAElE,MAAM,WAAW,kCAAmC,SAAQ,IAAI,CAC9D,eAAe,EACf,SAAS,GAAG,MAAM,GAAG,UAAU,GAAG,cAAc,CACjD;IACC,8FAA8F;IAC9F,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,4DAA4D;IAC5D,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,iKAuBxC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ChatPromptBoxVoiceSoundButton } from './chat-prompt-box-voice-sound-button';
|
|
3
|
+
declare const meta: Meta<typeof ChatPromptBoxVoiceSoundButton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ChatPromptBoxVoiceSoundButton>;
|
|
6
|
+
export declare const Playground: Story;
|
|
7
|
+
/** On, then off. */
|
|
8
|
+
export declare const AllStates: Story;
|
|
9
|
+
/** Click it: the icon swaps and `aria-pressed` flips. */
|
|
10
|
+
export declare const Toggle: Story;
|
|
11
|
+
//# sourceMappingURL=chat-prompt-box-voice-sound-button.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-prompt-box-voice-sound-button.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAI5D,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAErF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,6BAA6B,CAepD,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAE5D,eAAO,MAAM,UAAU,EAAE,KAAU,CAAC;AAEpC,oBAAoB;AACpB,eAAO,MAAM,SAAS,EAAE,KAQvB,CAAC;AAQF,yDAAyD;AACzD,eAAO,MAAM,MAAM,EAAE,KAGpB,CAAC"}
|
package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACrF,YAAY,EAAE,kCAAkC,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './chat-prompt-box-voice-bar-icon';
|
|
2
|
+
export * from './chat-prompt-box-voice-button';
|
|
3
|
+
export * from './chat-prompt-box-voice-light';
|
|
4
|
+
export * from './chat-prompt-box-voice-mic-button';
|
|
5
|
+
export * from './chat-prompt-box-voice-panel';
|
|
6
|
+
export * from './chat-prompt-box-voice-sound-button';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-prompt-box/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { ChatPromptBox, ChatPromptBoxInput, ChatPromptBoxToolbar, ChatPromptBoxContent, ChatPromptBoxActionsLeft, ChatPromptBoxActionsRight, } from './chat-prompt-box';
|
|
2
|
-
export type { ChatPromptBoxProps, ChatPromptBoxInputProps, ChatPromptBoxToolbarProps, ChatPromptBoxContentProps, ChatPromptBoxActionsLeftProps, ChatPromptBoxActionsRightProps, } from './chat-prompt-box';
|
|
2
|
+
export type { ChatPromptBoxMode, ChatPromptBoxProps, ChatPromptBoxInputProps, ChatPromptBoxToolbarProps, ChatPromptBoxContentProps, ChatPromptBoxActionsLeftProps, ChatPromptBoxActionsRightProps, } from './chat-prompt-box';
|
|
3
|
+
export { ChatPromptBoxVoiceStateWord } from './chat-prompt-box-voice';
|
|
4
|
+
export type { ChatPromptBoxVoiceStateWordProps } from './chat-prompt-box-voice';
|
|
5
|
+
export { ChatPromptBoxVoiceBarIcon, ChatPromptBoxVoiceButton, ChatPromptBoxVoiceLight, ChatPromptBoxVoiceMicButton, ChatPromptBoxVoicePanel, ChatPromptBoxVoiceSoundButton, } from './components';
|
|
6
|
+
export type { ChatPromptBoxVoiceBarIconProps, ChatPromptBoxVoiceBarIconState, ChatPromptBoxVoiceButtonProps, ChatPromptBoxVoiceButtonShow, ChatPromptBoxVoiceLightProps, ChatPromptBoxVoiceLightState, ChatPromptBoxVoiceMicButtonProps, ChatPromptBoxVoicePanelDevice, ChatPromptBoxVoicePanelProps, ChatPromptBoxVoiceSoundButtonProps, } from './components';
|
|
3
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/chat-prompt-box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/chat-prompt-box/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,uBAAuB,EACvB,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACtE,YAAY,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,8BAA8B,EAC9B,8BAA8B,EAC9B,6BAA6B,EAC7B,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,gCAAgC,EAChC,6BAA6B,EAC7B,4BAA4B,EAC5B,kCAAkC,GACnC,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Ref } from 'react';
|
|
2
|
+
import { VoiceMotionKinds } from './chat-prompt-box-voice-motion';
|
|
3
|
+
/** The parts the clock moves: the border ring, the light behind the box and the voice bars. */
|
|
4
|
+
export type VoiceMotionChannel = 'ring' | 'light' | 'bars';
|
|
5
|
+
export interface VoiceMotionRegistry {
|
|
6
|
+
register: (channel: VoiceMotionChannel, element: HTMLElement) => void;
|
|
7
|
+
unregister: (channel: VoiceMotionChannel, element: HTMLElement) => void;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Runs the voice motion (see `chat-prompt-box-voice-motion.ts`) on one `requestAnimationFrame`
|
|
11
|
+
* clock while `kinds` is set, and writes it as CSS variables on the elements registered for each
|
|
12
|
+
* part. Only those elements restyle each frame. `voice` (the speaker's loudness, 0 to 1) is read
|
|
13
|
+
* each frame, so changing it doesn't restart the clock. With reduced motion there is no clock: each
|
|
14
|
+
* state rests on its Base look, and the voice states still follow `voice`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useVoiceMotion(kinds: VoiceMotionKinds | null, voice: number | undefined): VoiceMotionRegistry;
|
|
17
|
+
/**
|
|
18
|
+
* A callback ref that registers its element with `registry` for `channel`, merged with `forwarded`.
|
|
19
|
+
* With no registry the element is left alone.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useVoiceMotionRef<T extends HTMLElement>(registry: VoiceMotionRegistry | null, channel: VoiceMotionChannel, forwarded?: Ref<T>): (element: T | null) => void;
|
|
22
|
+
//# sourceMappingURL=use-voice-motion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-voice-motion.d.ts","sourceRoot":"","sources":["../../../src/components/chat-prompt-box/use-voice-motion.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4D,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAI3F,OAAO,EAML,KAAK,gBAAgB,EACtB,MAAM,gCAAgC,CAAC;AAIxC,+FAA+F;AAC/F,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACtE,UAAU,EAAE,CAAC,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;CACzE;AAyCD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,gBAAgB,GAAG,IAAI,EAC9B,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,mBAAmB,CAoFrB;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,EACrD,QAAQ,EAAE,mBAAmB,GAAG,IAAI,EACpC,OAAO,EAAE,kBAAkB,EAC3B,SAAS,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,aAKN,CAAC,GAAG,IAAI,UAarB"}
|