@memori.ai/memori-react 8.1.0 → 8.3.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/CHANGELOG.md +19 -0
- package/dist/components/ChatHistoryDrawer/ChatHistory.js +2 -2
- package/dist/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
- package/dist/helpers/stt/useSTT.js +76 -9
- package/dist/helpers/stt/useSTT.js.map +1 -1
- package/dist/index.js +37 -8
- package/dist/index.js.map +1 -1
- package/esm/components/ChatHistoryDrawer/ChatHistory.js +2 -2
- package/esm/components/ChatHistoryDrawer/ChatHistory.js.map +1 -1
- package/esm/helpers/stt/useSTT.js +76 -9
- package/esm/helpers/stt/useSTT.js.map +1 -1
- package/esm/index.js +37 -8
- package/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__snapshots__/index.test.tsx.snap +19 -0
- package/src/components/ChatHistoryDrawer/ChatHistory.tsx +2 -1
- package/src/helpers/stt/useSTT.ts +101 -16
- package/src/index.test.tsx +50 -0
- package/src/index.tsx +56 -38
package/src/index.tsx
CHANGED
|
@@ -283,11 +283,51 @@ const Memori: React.FC<Props> = ({
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
const
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
286
|
+
const ignoreClientAttributes =
|
|
287
|
+
layoutIntegrationConfig.ignoreClientAttributes ?? false;
|
|
288
|
+
|
|
289
|
+
const clientAttributes = ignoreClientAttributes
|
|
290
|
+
? {
|
|
291
|
+
initialContextVars: getParsedContext(
|
|
292
|
+
layoutIntegrationConfig.contextVars
|
|
293
|
+
),
|
|
294
|
+
initialQuestion: layoutIntegrationConfig.initialQuestion as
|
|
295
|
+
| string
|
|
296
|
+
| undefined,
|
|
297
|
+
showLogin: memori?.enableDeepThought,
|
|
298
|
+
memoriLang: memori?.culture?.split('-')?.[0],
|
|
299
|
+
autoStart: layout === 'HIDDEN_CHAT',
|
|
300
|
+
}
|
|
301
|
+
: {
|
|
302
|
+
...(tag && pin ? { personification: { tag, pin } } : {}),
|
|
303
|
+
multilingual,
|
|
304
|
+
showCopyButton,
|
|
305
|
+
showTranslationOriginal,
|
|
306
|
+
showSettings,
|
|
307
|
+
showChatHistory,
|
|
308
|
+
showShare,
|
|
309
|
+
showTypingText,
|
|
310
|
+
showClear,
|
|
311
|
+
showLogin: showLogin ?? memori?.enableDeepThought,
|
|
312
|
+
showUpload,
|
|
313
|
+
showReasoning,
|
|
314
|
+
showContextPerLine,
|
|
315
|
+
initialContextVars:
|
|
316
|
+
context ?? getParsedContext(layoutIntegrationConfig.contextVars),
|
|
317
|
+
initialQuestion:
|
|
318
|
+
initialQuestion ??
|
|
319
|
+
(layoutIntegrationConfig.initialQuestion as string | undefined),
|
|
320
|
+
autoStart:
|
|
321
|
+
autoStart !== undefined
|
|
322
|
+
? autoStart
|
|
323
|
+
: layout === 'HIDDEN_CHAT'
|
|
324
|
+
? true
|
|
325
|
+
: autoStart,
|
|
326
|
+
enableAudio,
|
|
327
|
+
defaultSpeakerActive,
|
|
328
|
+
useMathFormatting,
|
|
329
|
+
memoriLang: spokenLang ?? memori?.culture?.split('-')?.[0],
|
|
330
|
+
};
|
|
291
331
|
|
|
292
332
|
return (
|
|
293
333
|
<I18nWrapper>
|
|
@@ -295,6 +335,7 @@ const Memori: React.FC<Props> = ({
|
|
|
295
335
|
<Toaster position="top-center" reverseOrder={true} />
|
|
296
336
|
{memori ? (
|
|
297
337
|
<MemoriWidget
|
|
338
|
+
// General props
|
|
298
339
|
layout={layout}
|
|
299
340
|
customLayout={customLayout}
|
|
300
341
|
height={height}
|
|
@@ -312,49 +353,26 @@ const Memori: React.FC<Props> = ({
|
|
|
312
353
|
}}
|
|
313
354
|
ownerUserName={ownerUserName ?? memori.ownerUserName}
|
|
314
355
|
ownerUserID={ownerUserID ?? memori.ownerUserID}
|
|
315
|
-
tenantID={tenantID}
|
|
316
|
-
memoriLang={spokenLang ?? memori.culture?.split('-')?.[0]}
|
|
317
|
-
multilingual={multilingual}
|
|
318
|
-
showChatHistory={showChatHistory}
|
|
319
356
|
tenant={tenant}
|
|
320
|
-
|
|
357
|
+
tenantID={tenantID}
|
|
321
358
|
sessionID={sessionID}
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
showTranslationOriginal={showTranslationOriginal}
|
|
325
|
-
showSettings={showSettings}
|
|
326
|
-
showTypingText={showTypingText}
|
|
327
|
-
showClear={showClear}
|
|
328
|
-
showOnlyLastMessages={showOnlyLastMessages}
|
|
329
|
-
showInputs={showInputs}
|
|
330
|
-
showDates={showDates}
|
|
331
|
-
showContextPerLine={showContextPerLine}
|
|
332
|
-
showLogin={showLogin ?? memori?.enableDeepThought}
|
|
333
|
-
showUpload={showUpload}
|
|
334
|
-
showReasoning={showReasoning}
|
|
359
|
+
secret={secretToken}
|
|
360
|
+
ttsProvider={provider ? (provider as 'azure' | 'openai') : 'azure'}
|
|
335
361
|
integration={layoutIntegration}
|
|
336
|
-
initialContextVars={initialContextVars}
|
|
337
|
-
initialQuestion={initialQuestionLayout}
|
|
338
362
|
authToken={authToken}
|
|
339
|
-
ttsProvider={provider ? (provider as 'azure' | 'openai') : 'azure'}
|
|
340
|
-
autoStart={
|
|
341
|
-
autoStart !== undefined
|
|
342
|
-
? autoStart
|
|
343
|
-
: layout === 'HIDDEN_CHAT'
|
|
344
|
-
? true
|
|
345
|
-
: autoStart
|
|
346
|
-
}
|
|
347
|
-
enableAudio={enableAudio}
|
|
348
|
-
defaultSpeakerActive={defaultSpeakerActive}
|
|
349
|
-
disableTextEnteredEvents={disableTextEnteredEvents}
|
|
350
363
|
onStateChange={onStateChange}
|
|
351
364
|
additionalInfo={additionalInfo}
|
|
352
365
|
customMediaRenderer={customMediaRenderer}
|
|
353
366
|
additionalSettings={additionalSettings}
|
|
354
367
|
userAvatar={userAvatar}
|
|
355
|
-
useMathFormatting={useMathFormatting}
|
|
356
368
|
applyVarsToRoot={applyVarsToRoot}
|
|
357
|
-
{
|
|
369
|
+
disableTextEnteredEvents={disableTextEnteredEvents}
|
|
370
|
+
// From layout, from client if allowed
|
|
371
|
+
{...clientAttributes}
|
|
372
|
+
// Client only
|
|
373
|
+
showOnlyLastMessages={showOnlyLastMessages}
|
|
374
|
+
showInputs={showInputs}
|
|
375
|
+
showDates={showDates}
|
|
358
376
|
/>
|
|
359
377
|
) : (
|
|
360
378
|
<div
|