@asgard-js/react 0.0.42-canary.1 → 0.0.42-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.d.ts.map +1 -1
- package/dist/index.js +7706 -7686
- package/package.json +1 -1
- package/src/components/chatbot/chatbot.tsx +58 -35
package/package.json
CHANGED
|
@@ -158,41 +158,64 @@ export const Chatbot = forwardRef(function Chatbot(
|
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
fullScreen={fullScreen}
|
|
182
|
-
className={className}
|
|
183
|
-
style={style}
|
|
161
|
+
// Don't initialize SSE connection when explicitly needing API key or in error state
|
|
162
|
+
if (authState !== 'needApiKey' && authState !== 'error') {
|
|
163
|
+
return (
|
|
164
|
+
<AsgardAppInitializationContextProvider
|
|
165
|
+
enabled={enableLoadConfigFromService}
|
|
166
|
+
config={config}
|
|
167
|
+
asyncInitializers={asyncInitializers}
|
|
168
|
+
loadingComponent={loadingComponent}
|
|
169
|
+
>
|
|
170
|
+
<AsgardThemeContextProvider theme={theme}>
|
|
171
|
+
<AsgardServiceContextProvider
|
|
172
|
+
parentRef={ref}
|
|
173
|
+
avatar={avatar}
|
|
174
|
+
config={config}
|
|
175
|
+
customChannelId={customChannelId}
|
|
176
|
+
initMessages={initMessages}
|
|
177
|
+
onSseMessage={onSseMessage}
|
|
178
|
+
onAuthError={onAuthError}
|
|
179
|
+
botTypingPlaceholder={botTypingPlaceholder}
|
|
180
|
+
inputPlaceholder={inputPlaceholder}
|
|
184
181
|
>
|
|
185
|
-
<
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
182
|
+
<ChatbotContainer
|
|
183
|
+
fullScreen={fullScreen}
|
|
184
|
+
className={className}
|
|
185
|
+
style={style}
|
|
186
|
+
>
|
|
187
|
+
<ChatbotHeader
|
|
188
|
+
title={title}
|
|
189
|
+
onReset={onReset}
|
|
190
|
+
onClose={onClose}
|
|
191
|
+
customActions={customActions}
|
|
192
|
+
maintainConnectionWhenClosed={maintainConnectionWhenClosed}
|
|
193
|
+
/>
|
|
194
|
+
{renderContent()}
|
|
195
|
+
</ChatbotContainer>
|
|
196
|
+
</AsgardServiceContextProvider>
|
|
197
|
+
</AsgardThemeContextProvider>
|
|
198
|
+
</AsgardAppInitializationContextProvider>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// For non-authenticated states, render without AsgardServiceContextProvider
|
|
203
|
+
return (
|
|
204
|
+
<AsgardThemeContextProvider theme={theme}>
|
|
205
|
+
<ChatbotContainer
|
|
206
|
+
fullScreen={fullScreen}
|
|
207
|
+
className={className}
|
|
208
|
+
style={style}
|
|
209
|
+
>
|
|
210
|
+
<ChatbotHeader
|
|
211
|
+
title={title}
|
|
212
|
+
onReset={onReset}
|
|
213
|
+
onClose={onClose}
|
|
214
|
+
customActions={customActions}
|
|
215
|
+
maintainConnectionWhenClosed={maintainConnectionWhenClosed}
|
|
216
|
+
/>
|
|
217
|
+
{renderContent()}
|
|
218
|
+
</ChatbotContainer>
|
|
219
|
+
</AsgardThemeContextProvider>
|
|
197
220
|
);
|
|
198
221
|
});
|