@opencx/widget 3.0.44 → 3.0.46

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/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./widget.ctx-Z3nrC8tP.cjs");exports.PrimitiveState=t.PrimitiveState;exports.WidgetCtx=t.WidgetCtx;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./widget.ctx-BNJO1LYq.cjs");exports.PrimitiveState=t.PrimitiveState;exports.WidgetCtx=t.WidgetCtx;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { P as i, W as a } from "./widget.ctx-Db_LSB7d.js";
1
+ import { P as i, W as a } from "./widget.ctx-CUZ6Haa_.js";
2
2
  export {
3
3
  i as PrimitiveState,
4
4
  a as WidgetCtx
package/dist/react.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useUploadFiles-Bt32Tf5N.cjs");function a(t,s,u){const{widgetCtx:{api:i}}=e.useWidget();return e._default(async o=>i.vote({action:o==="up"?"upvote":"downvote",messagePublicId:t,sessionId:s}).then(u),[i,t,s,u])}exports.WidgetProvider=e.WidgetProvider;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.useVote=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useUploadFiles-_A41t5pq.cjs");function a(t,s,u){const{widgetCtx:{api:i}}=e.useWidget();return e._default(async o=>i.vote({action:o==="up"?"upvote":"downvote",messagePublicId:t,sessionId:s}).then(u),[i,t,s,u])}exports.WidgetProvider=e.WidgetProvider;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.useVote=a;
2
2
  //# sourceMappingURL=react.cjs.map
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
- import { u as o, _ as i } from "./useUploadFiles-BPZLXbFK.js";
2
- import { W as p, a as f, b as l, c, d as m, e as v, f as P, g as W, i as w, h as x } from "./useUploadFiles-BPZLXbFK.js";
1
+ import { u as o, _ as i } from "./useUploadFiles-BjBYf07F.js";
2
+ import { W as p, a as f, b as l, c, d as m, e as v, f as P, g as W, i as w, h as x } from "./useUploadFiles-BjBYf07F.js";
3
3
  function n(e, s, t) {
4
4
  const {
5
5
  widgetCtx: { api: a }
@@ -1,3 +1,4 @@
1
+ import { WidgetConfig } from '../types/widget-config';
1
2
  import { PrimitiveState } from '../utils/PrimitiveState';
2
3
  import { ContactCtx } from './contact.ctx';
3
4
  import { SessionCtx } from './session.ctx';
@@ -11,10 +12,12 @@ type RouterState = {
11
12
  };
12
13
  export declare class RouterCtx {
13
14
  state: PrimitiveState<RouterState>;
15
+ private config;
14
16
  private contactCtx;
15
17
  private sessionCtx;
16
18
  private resetChat;
17
- constructor({ contactCtx, sessionCtx, resetChat, }: {
19
+ constructor({ config, contactCtx, sessionCtx, resetChat, }: {
20
+ config: WidgetConfig;
18
21
  contactCtx: ContactCtx;
19
22
  sessionCtx: SessionCtx;
20
23
  resetChat: WidgetCtx["resetChat"];
@@ -70,6 +70,25 @@ export interface WidgetConfig {
70
70
  * @default undefined
71
71
  */
72
72
  user?: UserConfig;
73
+ /**
74
+ * Custom text content to override the defaults in the default widget.
75
+ */
76
+ textContent?: {
77
+ welcomeScreen?: {
78
+ title?: string;
79
+ description?: string;
80
+ };
81
+ };
82
+ /**
83
+ * Customize the router behavior.
84
+ */
85
+ router?: {
86
+ /**
87
+ * If true, the router will navigate to the `chat` screen instead of `sessions` screen if the contact has no previous sessions.
88
+ * @default true
89
+ */
90
+ goToChatIfNoSessions?: boolean;
91
+ };
73
92
  /**
74
93
  * Headers to be sent with each send-message request from the widget.
75
94
  * These headers will be sent with each AI action (AI tools) that the LLM can call.
@@ -3,7 +3,7 @@ var Yt = (e, t, n) => t in e ? zt(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var Je = (e, t, n) => Yt(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import z, { createContext as ot, useContext as st, useRef as H, useState as it, useMemo as Ve, useEffect as Me, useSyncExternalStore as kt, useLayoutEffect as Jt, useCallback as Ee, useDebugValue as Xt } from "react";
5
5
  import { jsx as Qt } from "react/jsx-runtime";
6
- import { W as Zt } from "./widget.ctx-Db_LSB7d.js";
6
+ import { W as Zt } from "./widget.ctx-CUZ6Haa_.js";
7
7
  import { v4 as en } from "uuid";
8
8
  class tn {
9
9
  constructor(t) {
@@ -39,7 +39,7 @@ function nn(e) {
39
39
  return r;
40
40
  }, t.Provider];
41
41
  }
42
- const rn = "3.0.44", [Y, on] = nn();
42
+ const rn = "3.0.46", [Y, on] = nn();
43
43
  function tr({
44
44
  options: e,
45
45
  children: t,
@@ -1339,4 +1339,4 @@ export {
1339
1339
  At as n,
1340
1340
  Y as u
1341
1341
  };
1342
- //# sourceMappingURL=useUploadFiles-BPZLXbFK.js.map
1342
+ //# sourceMappingURL=useUploadFiles-BjBYf07F.js.map