@paramms/chat-widget 1.6.3 → 1.7.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/chatlist.d.ts +4 -0
- package/dist/chatlist2.js +406 -353
- package/dist/chatlist2.js.map +1 -1
- package/dist/embed-lite.js +3 -3
- package/dist/embed-lite.js.map +1 -1
- package/dist/embed.d.ts +3 -0
- package/dist/embed.js +3 -3
- package/dist/embed.js.map +1 -1
- package/dist/i18n.d.ts +41 -0
- package/dist/index.d.ts +8 -13
- package/dist/index.js +389 -370
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +7 -3
- package/dist/react.js +322 -312
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type WidgetLocale = 'en' | 'ko';
|
|
2
|
+
/** The auto-localized string set (everything except the two special keys above). */
|
|
3
|
+
export interface WidgetStrings {
|
|
4
|
+
placeholder: string;
|
|
5
|
+
offline: string;
|
|
6
|
+
online: string;
|
|
7
|
+
away: string;
|
|
8
|
+
aiAssistant: string;
|
|
9
|
+
resolved: string;
|
|
10
|
+
reopen: string;
|
|
11
|
+
sources: string;
|
|
12
|
+
helpful: string;
|
|
13
|
+
notHelpful: string;
|
|
14
|
+
title: string;
|
|
15
|
+
newChat: string;
|
|
16
|
+
startChat: string;
|
|
17
|
+
all: string;
|
|
18
|
+
empty: string;
|
|
19
|
+
error: string;
|
|
20
|
+
retry: string;
|
|
21
|
+
search: string;
|
|
22
|
+
unread: string;
|
|
23
|
+
close: string;
|
|
24
|
+
}
|
|
25
|
+
/** Host overrides: any built-in string, plus the two special override-only keys. */
|
|
26
|
+
export type WidgetI18nOverrides = Partial<WidgetStrings> & {
|
|
27
|
+
poweredBy?: string;
|
|
28
|
+
send?: string;
|
|
29
|
+
};
|
|
30
|
+
/** Resolve a supported locale from an explicit option or the browser. KO⇄EN
|
|
31
|
+
* only — anything that isn't Korean resolves to English. Accepts full BCP-47
|
|
32
|
+
* tags ('ko-KR'), bare codes ('ko'), or names ('korean'/'한국어'). */
|
|
33
|
+
export declare function resolveLocale(explicit?: string): WidgetLocale;
|
|
34
|
+
/** The full string set for the resolved locale, with host per-key overrides
|
|
35
|
+
* applied on top (overrides win; blank/undefined override values are ignored so
|
|
36
|
+
* a partial override object never blanks a built-in string). The result may
|
|
37
|
+
* also carry `poweredBy`/`send` when the host provided them. */
|
|
38
|
+
export declare function resolveStrings(locale?: string, overrides?: WidgetI18nOverrides): WidgetStrings & {
|
|
39
|
+
poweredBy?: string;
|
|
40
|
+
send?: string;
|
|
41
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { asConversationId } from './protocol/index.js';
|
|
2
2
|
import { type WidgetConfig } from './renderer.js';
|
|
3
|
+
import { type WidgetI18nOverrides } from './i18n.js';
|
|
3
4
|
export interface UserInfo {
|
|
4
5
|
/** Display name shown in the conversation (e.g. "Sarah Chen"). */
|
|
5
6
|
name?: string;
|
|
@@ -98,19 +99,13 @@ export interface MountOptions {
|
|
|
98
99
|
csat?: boolean;
|
|
99
100
|
deflection?: boolean;
|
|
100
101
|
};
|
|
101
|
-
/**
|
|
102
|
-
*
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
online?: string;
|
|
109
|
-
away?: string;
|
|
110
|
-
aiAssistant?: string;
|
|
111
|
-
resolved?: string;
|
|
112
|
-
reopen?: string;
|
|
113
|
-
};
|
|
102
|
+
/** UI language for built-in strings. A BCP-47 tag ('ko', 'ko-KR'), bare code,
|
|
103
|
+
* or name. Omit to auto-detect from the visitor's browser (navigator.language).
|
|
104
|
+
* Currently Korean ⇄ English; anything non-Korean resolves to English. */
|
|
105
|
+
locale?: string;
|
|
106
|
+
/** i18n: override UI strings. All keys are optional — omitted keys use the
|
|
107
|
+
* built-in dictionary for the resolved `locale` (English by default). */
|
|
108
|
+
i18n?: WidgetI18nOverrides;
|
|
114
109
|
}
|
|
115
110
|
export interface WidgetHandle {
|
|
116
111
|
close(): void;
|