open-chat-studio-widget 0.4.1 → 0.4.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/README.md +75 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/open-chat-studio-widget.cjs.entry.js +48 -26
- package/dist/cjs/open-chat-studio-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/open-chat-studio-widget.cjs.js +1 -1
- package/dist/collection/components/ocs-chat/ocs-chat.css +537 -379
- package/dist/collection/components/ocs-chat/ocs-chat.js +86 -25
- package/dist/collection/components/ocs-chat/ocs-chat.js.map +1 -1
- package/dist/components/open-chat-studio-widget.js +51 -26
- package/dist/components/open-chat-studio-widget.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/open-chat-studio-widget.entry.js +48 -26
- package/dist/esm/open-chat-studio-widget.entry.js.map +1 -1
- package/dist/esm/open-chat-studio-widget.js +1 -1
- package/dist/open-chat-studio-widget/open-chat-studio-widget.esm.js +1 -1
- package/dist/open-chat-studio-widget/open-chat-studio-widget.esm.js.map +1 -1
- package/dist/open-chat-studio-widget/{p-eb89e6d7.entry.js → p-d47dbd2f.entry.js} +3 -3
- package/dist/open-chat-studio-widget/p-d47dbd2f.entry.js.map +1 -0
- package/dist/types/components/ocs-chat/ocs-chat.d.ts +10 -0
- package/dist/types/components.d.ts +16 -0
- package/package.json +3 -2
- package/dist/open-chat-studio-widget/p-eb89e6d7.entry.js.map +0 -1
|
@@ -59,6 +59,14 @@ export declare class OcsChat {
|
|
|
59
59
|
* Array of starter questions that users can click to send (JSON array of strings)
|
|
60
60
|
*/
|
|
61
61
|
starterQuestions?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Used to associate chat sessions with a specific user across multiple visits/sessions
|
|
64
|
+
*/
|
|
65
|
+
userId?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Display name for the user.
|
|
68
|
+
*/
|
|
69
|
+
userName?: string;
|
|
62
70
|
/**
|
|
63
71
|
* Whether to persist session data to local storage to allow resuming previous conversations after page reload.
|
|
64
72
|
*/
|
|
@@ -97,6 +105,7 @@ export declare class OcsChat {
|
|
|
97
105
|
showStarterQuestions: boolean;
|
|
98
106
|
parsedWelcomeMessages: string[];
|
|
99
107
|
parsedStarterQuestions: string[];
|
|
108
|
+
generatedUserId?: string;
|
|
100
109
|
isFullscreen: boolean;
|
|
101
110
|
private messageListRef?;
|
|
102
111
|
private textareaRef?;
|
|
@@ -156,6 +165,7 @@ export declare class OcsChat {
|
|
|
156
165
|
private getStorageKeys;
|
|
157
166
|
private saveSessionToStorage;
|
|
158
167
|
private loadSessionFromStorage;
|
|
168
|
+
private getOrGenerateUserId;
|
|
159
169
|
private clearSessionStorage;
|
|
160
170
|
private isLocalStorageAvailable;
|
|
161
171
|
private startNewChat;
|
|
@@ -47,6 +47,14 @@ export namespace Components {
|
|
|
47
47
|
* Array of starter questions that users can click to send (JSON array of strings)
|
|
48
48
|
*/
|
|
49
49
|
"starterQuestions"?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Used to associate chat sessions with a specific user across multiple visits/sessions
|
|
52
|
+
*/
|
|
53
|
+
"userId"?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Display name for the user.
|
|
56
|
+
*/
|
|
57
|
+
"userName"?: string;
|
|
50
58
|
/**
|
|
51
59
|
* Whether the chat widget is visible on load.
|
|
52
60
|
*/
|
|
@@ -110,6 +118,14 @@ declare namespace LocalJSX {
|
|
|
110
118
|
* Array of starter questions that users can click to send (JSON array of strings)
|
|
111
119
|
*/
|
|
112
120
|
"starterQuestions"?: string;
|
|
121
|
+
/**
|
|
122
|
+
* Used to associate chat sessions with a specific user across multiple visits/sessions
|
|
123
|
+
*/
|
|
124
|
+
"userId"?: string;
|
|
125
|
+
/**
|
|
126
|
+
* Display name for the user.
|
|
127
|
+
*/
|
|
128
|
+
"userName"?: string;
|
|
113
129
|
/**
|
|
114
130
|
* Whether the chat widget is visible on load.
|
|
115
131
|
*/
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-chat-studio-widget",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "Chat component for Open Chat Studio",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
|
+
"exports": "./dist/esm/open-chat-studio-widget.js",
|
|
7
|
+
"unpkg": "dist/open-chat-studio-widget/open-chat-studio-widget.esm.js",
|
|
6
8
|
"module": "dist/index.js",
|
|
7
9
|
"es2015": "dist/esm/index.mjs",
|
|
8
10
|
"es2017": "dist/esm/index.mjs",
|
|
9
11
|
"types": "dist/types/index.d.ts",
|
|
10
12
|
"collection": "dist/collection/collection-manifest.json",
|
|
11
13
|
"collection:main": "dist/collection/index.js",
|
|
12
|
-
"unpkg": "dist/open-chat-studio-widget/open-chat-studio-widget.esm.js",
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
15
16
|
"url": "https://github.com/dimagi/open-chat-studio.git"
|