@asgard-js/react 0.0.37 → 0.0.38-canary.2
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/chatbot/chatbot-footer/chatbot-footer.d.ts.map +1 -1
- package/dist/components/chatbot/chatbot.d.ts +1 -0
- package/dist/components/chatbot/chatbot.d.ts.map +1 -1
- package/dist/context/asgard-service-context.d.ts +2 -0
- package/dist/context/asgard-service-context.d.ts.map +1 -1
- package/dist/index.js +727 -719
- package/package.json +2 -2
- package/src/components/chatbot/chatbot-footer/chatbot-footer.tsx +4 -2
- package/src/components/chatbot/chatbot.tsx +3 -0
- package/src/context/asgard-service-context.tsx +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asgard-js/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.38-canary.2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"vitest": "^1.6.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@asgard-js/core": "^0.0.
|
|
57
|
+
"@asgard-js/core": "^0.0.38-canary.2",
|
|
58
58
|
"react": "^18.0.0",
|
|
59
59
|
"react-dom": "^18.0.0"
|
|
60
60
|
},
|
|
@@ -16,7 +16,9 @@ import clsx from 'clsx';
|
|
|
16
16
|
import { useAsgardThemeContext } from '../../../context/asgard-theme-context';
|
|
17
17
|
|
|
18
18
|
export function ChatbotFooter(): ReactNode {
|
|
19
|
-
const { sendMessage, isConnecting } = useAsgardContext();
|
|
19
|
+
const { sendMessage, isConnecting, inputPlaceholder } = useAsgardContext();
|
|
20
|
+
|
|
21
|
+
console.log('ChatbotFooter inputPlaceholder:', inputPlaceholder);
|
|
20
22
|
|
|
21
23
|
const { chatbot } = useAsgardThemeContext();
|
|
22
24
|
|
|
@@ -106,7 +108,7 @@ export function ChatbotFooter(): ReactNode {
|
|
|
106
108
|
disabled={isConnecting}
|
|
107
109
|
cols={40}
|
|
108
110
|
value={value}
|
|
109
|
-
placeholder="Enter message"
|
|
111
|
+
placeholder={inputPlaceholder || "Enter message"}
|
|
110
112
|
onChange={onChange}
|
|
111
113
|
onKeyDown={onKeyDown}
|
|
112
114
|
onCompositionStart={() => setIsComposing(true)}
|
|
@@ -30,6 +30,7 @@ interface ChatbotProps extends AsgardTemplateContextValue {
|
|
|
30
30
|
fullScreen?: boolean;
|
|
31
31
|
avatar?: string;
|
|
32
32
|
botTypingPlaceholder?: string;
|
|
33
|
+
inputPlaceholder?: string;
|
|
33
34
|
enableLoadConfigFromService?: boolean;
|
|
34
35
|
maintainConnectionWhenClosed?: boolean;
|
|
35
36
|
asyncInitializers?: Record<string, () => Promise<unknown>>;
|
|
@@ -58,6 +59,7 @@ export const Chatbot = forwardRef(function Chatbot(
|
|
|
58
59
|
fullScreen = false,
|
|
59
60
|
avatar,
|
|
60
61
|
botTypingPlaceholder,
|
|
62
|
+
inputPlaceholder,
|
|
61
63
|
enableLoadConfigFromService = false,
|
|
62
64
|
maintainConnectionWhenClosed = false,
|
|
63
65
|
asyncInitializers = {},
|
|
@@ -88,6 +90,7 @@ export const Chatbot = forwardRef(function Chatbot(
|
|
|
88
90
|
initMessages={initMessages}
|
|
89
91
|
onSseMessage={onSseMessage}
|
|
90
92
|
botTypingPlaceholder={botTypingPlaceholder}
|
|
93
|
+
inputPlaceholder={inputPlaceholder}
|
|
91
94
|
>
|
|
92
95
|
<ChatbotContainer
|
|
93
96
|
fullScreen={fullScreen}
|
|
@@ -32,6 +32,7 @@ export interface AsgardServiceContextValue {
|
|
|
32
32
|
resetChannel?: UseChannelReturn['resetChannel'];
|
|
33
33
|
closeChannel?: UseChannelReturn['closeChannel'];
|
|
34
34
|
botTypingPlaceholder?: string;
|
|
35
|
+
inputPlaceholder?: string;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
export const AsgardServiceContext = createContext<AsgardServiceContextValue>({
|
|
@@ -43,6 +44,7 @@ export const AsgardServiceContext = createContext<AsgardServiceContextValue>({
|
|
|
43
44
|
messages: null,
|
|
44
45
|
messageBoxBottomRef: { current: null },
|
|
45
46
|
botTypingPlaceholder: undefined,
|
|
47
|
+
inputPlaceholder: undefined,
|
|
46
48
|
});
|
|
47
49
|
|
|
48
50
|
export interface AsgardServiceContextProviderProps {
|
|
@@ -53,6 +55,7 @@ export interface AsgardServiceContextProviderProps {
|
|
|
53
55
|
avatar?: string;
|
|
54
56
|
config: ClientConfig;
|
|
55
57
|
botTypingPlaceholder?: string;
|
|
58
|
+
inputPlaceholder?: string;
|
|
56
59
|
customChannelId: string;
|
|
57
60
|
customMessageId?: string;
|
|
58
61
|
delayTime?: number;
|
|
@@ -69,6 +72,7 @@ export function AsgardServiceContextProvider(
|
|
|
69
72
|
parentRef,
|
|
70
73
|
config,
|
|
71
74
|
botTypingPlaceholder,
|
|
75
|
+
inputPlaceholder,
|
|
72
76
|
customChannelId,
|
|
73
77
|
initMessages,
|
|
74
78
|
onSseMessage,
|
|
@@ -105,6 +109,7 @@ export function AsgardServiceContextProvider(
|
|
|
105
109
|
resetChannel,
|
|
106
110
|
closeChannel,
|
|
107
111
|
botTypingPlaceholder,
|
|
112
|
+
inputPlaceholder,
|
|
108
113
|
messageBoxBottomRef,
|
|
109
114
|
}),
|
|
110
115
|
[
|
|
@@ -118,6 +123,7 @@ export function AsgardServiceContextProvider(
|
|
|
118
123
|
resetChannel,
|
|
119
124
|
closeChannel,
|
|
120
125
|
botTypingPlaceholder,
|
|
126
|
+
inputPlaceholder,
|
|
121
127
|
]
|
|
122
128
|
);
|
|
123
129
|
|