@opencx/widget 3.0.82 → 3.0.84
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/designs.cjs +21 -21
- package/dist/designs.cjs.map +1 -1
- package/dist/designs.js +3321 -3335
- package/dist/designs.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/react.cjs +1 -1
- package/dist/react.js +2 -2
- package/dist/src/designs/react/components/lib/MotionDiv.d.ts +1 -0
- package/dist/src/designs/translation/es.locale.d.ts +2 -0
- package/dist/src/designs/translation/index.d.ts +1 -0
- package/dist/src/designs/translation/translation.types.d.ts +1 -1
- package/dist/src/headless/core/types/widget-config.d.ts +9 -1
- package/dist/src/headless/react/hooks/useSessions.d.ts +31 -0
- package/dist/{useWidgetTrigger-B6FKEL-h.js → useWidgetTrigger-38gyi4gE.js} +354 -348
- package/dist/useWidgetTrigger-38gyi4gE.js.map +1 -0
- package/dist/{useWidgetTrigger-BYK9pFBJ.cjs → useWidgetTrigger-OXlF9nHb.cjs} +4 -4
- package/dist/useWidgetTrigger-OXlF9nHb.cjs.map +1 -0
- package/dist/{widget.ctx-C_ukAHJS.cjs → widget.ctx-CoJrM0OY.cjs} +2 -2
- package/dist/{widget.ctx-C_ukAHJS.cjs.map → widget.ctx-CoJrM0OY.cjs.map} +1 -1
- package/dist/{widget.ctx-Br9aZd2F.js → widget.ctx-r2Nzp00O.js} +3 -2
- package/dist/{widget.ctx-Br9aZd2F.js.map → widget.ctx-r2Nzp00O.js.map} +1 -1
- package/dist-embed/script.js +82 -102
- package/dist-embed/script.js.map +1 -1
- package/package.json +1 -1
- package/dist/useWidgetTrigger-B6FKEL-h.js.map +0 -1
- package/dist/useWidgetTrigger-BYK9pFBJ.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./widget.ctx-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./widget.ctx-CoJrM0OY.cjs");exports.PrimitiveState=t.PrimitiveState;exports.WidgetCtx=t.WidgetCtx;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
package/dist/react.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useWidgetTrigger-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useWidgetTrigger-OXlF9nHb.cjs");function g(t,i,s){const{widgetCtx:{api:u}}=e.useWidget();return e._default(async r=>u.vote({action:r==="up"?"upvote":"downvote",messagePublicId:t,sessionId:i}).then(s),[u,t,i,s])}exports.WidgetProvider=e.WidgetProvider;exports.WidgetTriggerProvider=e.WidgetTriggerProvider;exports.useConfig=e.useConfig;exports.useContact=e.useContact;exports.useIsAwaitingBotReply=e.useIsAwaitingBotReply;exports.useMessages=e.useMessages;exports.usePreludeData=e.usePreludeData;exports.usePrimitiveState=e.usePrimitiveState;exports.useSessions=e.useSessions;exports.useUploadFiles=e.useUploadFiles;exports.useWidget=e.useWidget;exports.useWidgetRouter=e.useWidgetRouter;exports.useWidgetTrigger=e.useWidgetTrigger;exports.useVote=g;
|
|
2
2
|
//# sourceMappingURL=react.cjs.map
|
package/dist/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u, _ as r } from "./useWidgetTrigger-
|
|
2
|
-
import { W as p, k as f, a as l, b as v, c as W, d as c, e as m, f as P, g as w, i as x, h as C, j as b } from "./useWidgetTrigger-
|
|
1
|
+
import { u, _ as r } from "./useWidgetTrigger-38gyi4gE.js";
|
|
2
|
+
import { W as p, k as f, a as l, b as v, c as W, d as c, e as m, f as P, g as w, i as x, h as C, j as b } from "./useWidgetTrigger-38gyi4gE.js";
|
|
3
3
|
function g(e, s, t) {
|
|
4
4
|
const {
|
|
5
5
|
widgetCtx: { api: a }
|
|
@@ -6,6 +6,7 @@ declare const locales: {
|
|
|
6
6
|
readonly fr: import('./translation.types').TranslationInterface;
|
|
7
7
|
readonly de: import('./translation.types').TranslationInterface;
|
|
8
8
|
readonly pt: import('./translation.types').TranslationInterface;
|
|
9
|
+
readonly es: import('./translation.types').TranslationInterface;
|
|
9
10
|
};
|
|
10
11
|
export declare const LOCALES: (keyof typeof locales)[];
|
|
11
12
|
export type Locale = (typeof LOCALES)[number];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type TranslationKeysU = 'ok' | 'yes' | 'no' | 'agree' | 'cancel' | 'yes-exit' | 'yes-reset' | 'no-cancel' | 'are-you-sure' | 'recording' | 'thank-you' | 'sorry-try-again' | 'error-occurred' | 'please-try-again' | 'write-a-message' | 'send-message' | 'connected' | 'connecting' | 'reconnecting' | 'reconnected' | 'disconnecting' | 'disconnected' | 'error' | 'persist-session' | 'settings' | 'close' | 'help' | 'chat' | 'send' | 'copy' | 'copied' | 'sound-effects' | 'language' | 'select' | 'agent' | 'user' | 'bot' | 'close-widget' | 'got-any-questions' | 'typical-response-time' | 'session-closed-lead' | 'create-new-ticket' | 'exit' | 'reset-conversation' | 'new-conversation' | 'welcome-title' | 'welcome-description' | 'your-name' | 'your-email' | 'start-chat' | 'starting-chat' | 'hello-greeting' | 'i-need-more-help' | 'this-was-helpful' | 'optional' | 'no-conversations-yet';
|
|
1
|
+
export type TranslationKeysU = 'ok' | 'yes' | 'no' | 'agree' | 'cancel' | 'yes-exit' | 'yes-reset' | 'no-cancel' | 'are-you-sure' | 'recording' | 'thank-you' | 'sorry-try-again' | 'error-occurred' | 'please-try-again' | 'write-a-message' | 'send-message' | 'connected' | 'connecting' | 'reconnecting' | 'reconnected' | 'disconnecting' | 'disconnected' | 'error' | 'persist-session' | 'settings' | 'close' | 'help' | 'chat' | 'send' | 'copy' | 'copied' | 'sound-effects' | 'language' | 'select' | 'agent' | 'user' | 'bot' | 'close-widget' | 'got-any-questions' | 'typical-response-time' | 'session-closed-lead' | 'create-new-ticket' | 'exit' | 'reset-conversation' | 'new-conversation' | 'welcome-title' | 'welcome-description' | 'your-name' | 'your-email' | 'start-chat' | 'starting-chat' | 'hello-greeting' | 'i-need-more-help' | 'this-was-helpful' | 'optional' | 'no-conversations-yet' | 'back-to-conversations' | 'closed-conversations';
|
|
2
2
|
export type TranslationInterface = {
|
|
3
3
|
[K in TranslationKeysU]: string;
|
|
4
4
|
};
|
|
@@ -21,7 +21,7 @@ export type UserConfig = UserBaseConfig & {
|
|
|
21
21
|
};
|
|
22
22
|
type ThemeOptions = {
|
|
23
23
|
/**
|
|
24
|
-
* @default '
|
|
24
|
+
* @default 'stone'
|
|
25
25
|
*/
|
|
26
26
|
palette?: 'neutral' | 'stone' | 'zinc' | 'slate';
|
|
27
27
|
primaryColor?: string;
|
|
@@ -215,6 +215,14 @@ export interface WidgetConfig {
|
|
|
215
215
|
*/
|
|
216
216
|
goToChatIfNoSessions?: boolean;
|
|
217
217
|
};
|
|
218
|
+
/**
|
|
219
|
+
* By default, the user can have multiple open sessions.
|
|
220
|
+
*
|
|
221
|
+
* Setting this option to `true` will hide the `new conversation` button if there is an open session.
|
|
222
|
+
*
|
|
223
|
+
* @default false
|
|
224
|
+
*/
|
|
225
|
+
oneOpenSessionAllowed?: boolean;
|
|
218
226
|
/**
|
|
219
227
|
* The target attribute for all links in the AI or human agents responses.
|
|
220
228
|
*
|
|
@@ -11,4 +11,35 @@ export declare function useSessions(): {
|
|
|
11
11
|
isInitialFetchLoading: boolean;
|
|
12
12
|
};
|
|
13
13
|
loadMoreSessions: () => Promise<void>;
|
|
14
|
+
openSessions: {
|
|
15
|
+
id: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
isHandedOff: boolean;
|
|
19
|
+
isOpened: boolean;
|
|
20
|
+
assignee: {
|
|
21
|
+
kind: "human" | "ai" | "none" | "unknown";
|
|
22
|
+
name: string | null;
|
|
23
|
+
avatarUrl: string | null;
|
|
24
|
+
};
|
|
25
|
+
channel: string;
|
|
26
|
+
isVerified: boolean;
|
|
27
|
+
lastMessage: string | null;
|
|
28
|
+
}[];
|
|
29
|
+
closedSessions: {
|
|
30
|
+
id: string;
|
|
31
|
+
createdAt: string;
|
|
32
|
+
updatedAt: string;
|
|
33
|
+
isHandedOff: boolean;
|
|
34
|
+
isOpened: boolean;
|
|
35
|
+
assignee: {
|
|
36
|
+
kind: "human" | "ai" | "none" | "unknown";
|
|
37
|
+
name: string | null;
|
|
38
|
+
avatarUrl: string | null;
|
|
39
|
+
};
|
|
40
|
+
channel: string;
|
|
41
|
+
isVerified: boolean;
|
|
42
|
+
lastMessage: string | null;
|
|
43
|
+
}[];
|
|
44
|
+
canCreateNewSession: boolean;
|
|
14
45
|
};
|