@trillet-ai/web-sdk 1.10.0 → 1.11.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/dist/widget/index.d.ts +74 -0
- package/dist/widget/index.js +290 -69
- package/dist/widget/index.js.map +1 -1
- package/dist/widget.umd.js +13 -13
- package/dist/widget.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/widget/index.d.ts
CHANGED
|
@@ -2,6 +2,71 @@ import * as React from 'react';
|
|
|
2
2
|
import { TrilletRoomDetails } from '../server.js';
|
|
3
3
|
import { T as Transcript } from '../TranscriptManager-Bh-JJm_m.js';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Built-in widget copy per language.
|
|
7
|
+
*
|
|
8
|
+
* Every visitor-facing string the widget renders on its own lives here, so a site in
|
|
9
|
+
* German, French or Italian gets a fully localised widget without setting a dozen
|
|
10
|
+
* text attributes. Explicit text attributes and the saved dashboard design still win
|
|
11
|
+
* over these defaults (see configFromElement).
|
|
12
|
+
*/
|
|
13
|
+
declare const WIDGET_LANGUAGES: readonly ["en", "de", "fr", "it"];
|
|
14
|
+
type WidgetLanguage = (typeof WIDGET_LANGUAGES)[number];
|
|
15
|
+
interface WidgetCopy {
|
|
16
|
+
startCallText: string;
|
|
17
|
+
startChatText: string;
|
|
18
|
+
endCallText: string;
|
|
19
|
+
endChatText: string;
|
|
20
|
+
endConversationText: string;
|
|
21
|
+
messageText: string;
|
|
22
|
+
callLabel: string;
|
|
23
|
+
chatLabel: string;
|
|
24
|
+
switchToTextText: string;
|
|
25
|
+
switchToVoiceText: string;
|
|
26
|
+
listeningText: string;
|
|
27
|
+
speakingText: string;
|
|
28
|
+
expandText: string;
|
|
29
|
+
collapseText: string;
|
|
30
|
+
recaptchaText: string;
|
|
31
|
+
inputPlaceholder: string;
|
|
32
|
+
askAnything: string;
|
|
33
|
+
/** `{name}` is replaced with the agent or brand name. */
|
|
34
|
+
askNamed: string;
|
|
35
|
+
chooseModePrompt: string;
|
|
36
|
+
talkToUs: string;
|
|
37
|
+
connecting: string;
|
|
38
|
+
online: string;
|
|
39
|
+
callEnded: string;
|
|
40
|
+
chatEnded: string;
|
|
41
|
+
startNewChat: string;
|
|
42
|
+
backToChat: string;
|
|
43
|
+
/** `{name}` is replaced with the agent or brand name. */
|
|
44
|
+
chatWithNamed: string;
|
|
45
|
+
chat: string;
|
|
46
|
+
send: string;
|
|
47
|
+
close: string;
|
|
48
|
+
typing: string;
|
|
49
|
+
muteMic: string;
|
|
50
|
+
unmuteMic: string;
|
|
51
|
+
terms: string;
|
|
52
|
+
termsTitle: string;
|
|
53
|
+
termsAccept: string;
|
|
54
|
+
termsDecline: string;
|
|
55
|
+
feedbackQuestion: string;
|
|
56
|
+
feedbackThanks: string;
|
|
57
|
+
errorNotEnabled: string;
|
|
58
|
+
errorUnavailable: string;
|
|
59
|
+
errorTooMany: string;
|
|
60
|
+
errorGeneric: string;
|
|
61
|
+
feedbackGood: string;
|
|
62
|
+
feedbackBad: string;
|
|
63
|
+
openChat: string;
|
|
64
|
+
minimize: string;
|
|
65
|
+
typeInstead: string;
|
|
66
|
+
showConversation: string;
|
|
67
|
+
talkInstead: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
5
70
|
type WidgetVariant = 'compact' | 'expanded';
|
|
6
71
|
type WidgetVariantInput = WidgetVariant | 'tiny' | 'full';
|
|
7
72
|
type WidgetMode = 'voice' | 'text' | 'both';
|
|
@@ -38,6 +103,8 @@ interface RemoteWidgetConfig {
|
|
|
38
103
|
startCallText?: string | null;
|
|
39
104
|
messageText?: string | null;
|
|
40
105
|
suggestedPrompts?: string[];
|
|
106
|
+
/** Widget UI language (en | de | fr | it). Absent: the host page's <html lang>. */
|
|
107
|
+
language?: string | null;
|
|
41
108
|
}
|
|
42
109
|
interface WidgetBrand {
|
|
43
110
|
logo?: string;
|
|
@@ -71,6 +138,9 @@ interface WidgetConfig {
|
|
|
71
138
|
variant: WidgetVariant;
|
|
72
139
|
placement: WidgetPlacement;
|
|
73
140
|
dismissible: boolean;
|
|
141
|
+
/** Resolved UI language and its built-in copy (see ./i18n). */
|
|
142
|
+
language: WidgetLanguage;
|
|
143
|
+
copy: WidgetCopy;
|
|
74
144
|
actionText?: string;
|
|
75
145
|
startCallText: string;
|
|
76
146
|
endCallText: string;
|
|
@@ -152,6 +222,10 @@ interface TrilletWidgetProps {
|
|
|
152
222
|
actionText?: string;
|
|
153
223
|
startCallText?: string;
|
|
154
224
|
endCallText?: string;
|
|
225
|
+
/** Label for ending a text chat (default from `language`, e.g. "End chat" / "Chat beenden"). */
|
|
226
|
+
endChatText?: string;
|
|
227
|
+
/** UI language for the built-in labels: en | de | fr | it. Default: the page's <html lang>. */
|
|
228
|
+
language?: string;
|
|
155
229
|
/** Label for the text/chat entry point in mode="both" (default "Message"). */
|
|
156
230
|
messageText?: string;
|
|
157
231
|
switchToTextText?: string;
|