@opencx/widget 3.0.81 → 3.0.83
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 +4 -4
- package/dist/designs.cjs.map +1 -1
- package/dist/designs.js +147 -89
- 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/translation/es.locale.d.ts +2 -0
- package/dist/src/designs/translation/index.d.ts +1 -0
- package/dist/src/headless/core/__tests__/test-utils.d.ts +3 -0
- package/dist/src/headless/core/api/api-caller.d.ts +3 -0
- package/dist/src/headless/core/api/schema.d.ts +5 -0
- package/dist/src/headless/core/context/message.ctx.d.ts +1 -0
- package/dist/src/headless/core/types/widget-config.d.ts +7 -0
- package/dist/src/headless/react/hooks/useMessages.d.ts +1 -0
- package/dist/{useWidgetTrigger-ims5I4zH.js → useWidgetTrigger-CiXxBOLI.js} +3 -3
- package/dist/{useWidgetTrigger-ims5I4zH.js.map → useWidgetTrigger-CiXxBOLI.js.map} +1 -1
- package/dist/{useWidgetTrigger-DL9e5ISu.cjs → useWidgetTrigger-ClIdKwZT.cjs} +2 -2
- package/dist/{useWidgetTrigger-DL9e5ISu.cjs.map → useWidgetTrigger-ClIdKwZT.cjs.map} +1 -1
- package/dist/{widget.ctx-sL-dW2kY.cjs → widget.ctx-CoJrM0OY.cjs} +2 -2
- package/dist/widget.ctx-CoJrM0OY.cjs.map +1 -0
- package/dist/{widget.ctx-DRC-z8Ql.js → widget.ctx-r2Nzp00O.js} +45 -40
- package/dist/widget.ctx-r2Nzp00O.js.map +1 -0
- package/dist-embed/script.js +3 -3
- package/dist-embed/script.js.map +1 -1
- package/package.json +1 -1
- package/dist/widget.ctx-DRC-z8Ql.js.map +0 -1
- package/dist/widget.ctx-sL-dW2kY.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-ClIdKwZT.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-CiXxBOLI.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-CiXxBOLI.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];
|
|
@@ -180,6 +180,9 @@ export declare const TestUtils: {
|
|
|
180
180
|
clientContext?: {
|
|
181
181
|
[key: string]: unknown;
|
|
182
182
|
} | null;
|
|
183
|
+
custom_data?: {
|
|
184
|
+
[key: string]: unknown;
|
|
185
|
+
} | null;
|
|
183
186
|
};
|
|
184
187
|
signal: AbortSignal | undefined;
|
|
185
188
|
}, `${string}/${string}`>> | undefined): void;
|
|
@@ -283,9 +283,14 @@ export interface components {
|
|
|
283
283
|
type: string;
|
|
284
284
|
url: string;
|
|
285
285
|
}[] | null;
|
|
286
|
+
/** @description Context for the AI to be sent with each contact message */
|
|
286
287
|
clientContext?: {
|
|
287
288
|
[key: string]: unknown;
|
|
288
289
|
} | null;
|
|
290
|
+
/** @description Custom data to be sent with each contact message */
|
|
291
|
+
custom_data?: {
|
|
292
|
+
[key: string]: unknown;
|
|
293
|
+
} | null;
|
|
289
294
|
};
|
|
290
295
|
UploadWidgetFileResponseDto: {
|
|
291
296
|
fileName: string;
|
|
@@ -28,6 +28,7 @@ export declare class MessageCtx {
|
|
|
28
28
|
sendMessage: (input: {
|
|
29
29
|
content: SendMessageDto["content"];
|
|
30
30
|
attachments?: SendMessageDto["attachments"];
|
|
31
|
+
customData?: SendMessageDto["custom_data"];
|
|
31
32
|
}) => Promise<void>;
|
|
32
33
|
private toUserMessage;
|
|
33
34
|
private toBotMessage;
|
|
@@ -243,8 +243,15 @@ export interface WidgetConfig {
|
|
|
243
243
|
/**
|
|
244
244
|
* Dynamic context to be sent with each send-message request from the widget.
|
|
245
245
|
* Useful if you want to send data regarding the current page the user is viewing.
|
|
246
|
+
* @default undefined
|
|
246
247
|
*/
|
|
247
248
|
context?: Record<string, unknown>;
|
|
249
|
+
/**
|
|
250
|
+
* Dynamic custom data to be sent with each contact message.
|
|
251
|
+
* This custom data is intended for human use only; the AI will not see it and it will not affect the AI's response.
|
|
252
|
+
* @default undefined
|
|
253
|
+
*/
|
|
254
|
+
messageCustomData?: Record<string, unknown>;
|
|
248
255
|
/**
|
|
249
256
|
* An apiUrl to override production backend.
|
|
250
257
|
* This is for us to test the widget locally, you don't need to play with this option 😊.
|
|
@@ -8,5 +8,6 @@ export declare function useMessages(): {
|
|
|
8
8
|
sendMessage: (input: {
|
|
9
9
|
content: import('../../core').SendMessageDto["content"];
|
|
10
10
|
attachments?: import('../../core').SendMessageDto["attachments"];
|
|
11
|
+
customData?: import('../../core').SendMessageDto["custom_data"];
|
|
11
12
|
}) => Promise<void>;
|
|
12
13
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import z, { createContext as Ne, useRef as W, useState as Fe, useMemo as Me, useEffect as oe, useContext as Ue, useSyncExternalStore as kt, useLayoutEffect as Jt, useCallback as ve, useDebugValue as Xt } from "react";
|
|
2
2
|
import { v4 as Qt } from "uuid";
|
|
3
3
|
import { jsx as it } from "react/jsx-runtime";
|
|
4
|
-
import { W as Zt } from "./widget.ctx-
|
|
5
|
-
const en = "3.0.
|
|
4
|
+
import { W as Zt } from "./widget.ctx-r2Nzp00O.js";
|
|
5
|
+
const en = "3.0.83";
|
|
6
6
|
class tn {
|
|
7
7
|
constructor(t) {
|
|
8
8
|
this.components = [];
|
|
@@ -1354,4 +1354,4 @@ export {
|
|
|
1354
1354
|
nr as m,
|
|
1355
1355
|
Y as u
|
|
1356
1356
|
};
|
|
1357
|
-
//# sourceMappingURL=useWidgetTrigger-
|
|
1357
|
+
//# sourceMappingURL=useWidgetTrigger-CiXxBOLI.js.map
|