@opencx/widget-react 5.14.1 → 5.15.1

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"});require("react/jsx-runtime");require("@radix-ui/react-popover");require("framer-motion");require("react");require("@opencx/widget-react-headless");const e=require("./index-C0iV9yZX.cjs");exports.HostedSpecRenderer=e.HostedSpecRenderer;exports.Widget=e.Widget;exports.segmentContent=e.segmentContent;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("@radix-ui/react-popover");require("framer-motion");require("react");require("@opencx/widget-react-headless");const e=require("./index-BL79m0xq.cjs");exports.HostedSpecRenderer=e.HostedSpecRenderer;exports.Widget=e.Widget;exports.segmentContent=e.segmentContent;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import "@radix-ui/react-popover";
3
3
  import "framer-motion";
4
4
  import "react";
5
5
  import "@opencx/widget-react-headless";
6
- import { H as s, W as n, s as a } from "./index-DkV3KG39.js";
6
+ import { H as s, W as n, s as a } from "./index-kk04QaK9.js";
7
7
  export {
8
8
  s as HostedSpecRenderer,
9
9
  n as Widget,
@@ -1,7 +1,7 @@
1
1
  declare const _default: {
2
2
  "name": "@opencx/widget-react",
3
3
  "private": false,
4
- "version": "5.14.1",
4
+ "version": "5.15.1",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "rm -rf node_modules dist .turbo",
@@ -1,9 +1,21 @@
1
+ import { RenewUserTokenResult } from '@opencx/widget-core';
1
2
  import { default as React } from 'react';
2
3
  export type WidgetRef = {
3
4
  /** Open the widget on a fresh conversation, optionally sending its first message. */
4
5
  newChat: (options?: {
5
6
  message?: string;
6
7
  }) => Promise<void>;
8
+ /**
9
+ * Hand the widget a renewed `user.token` for the signed-in visitor, on your
10
+ * own schedule, instead of (or as well as) answering `user.refreshToken`.
11
+ * The open session is kept and an ended one comes back. A token for another
12
+ * visitor, an expired one, or anything that isn't a user token is refused
13
+ * with a reason and a console error: switch visitors through
14
+ * `options.user.token`. Rendering again with the same `options.user.token`
15
+ * keeps the token handed over here; a different one replaces it, and a
16
+ * remounted widget starts from `options.user.token` again.
17
+ */
18
+ renewUserToken: (token: string) => RenewUserTokenResult;
7
19
  };
8
20
  export declare function WidgetImperativeHandler({ widgetRef, }: {
9
21
  widgetRef: React.Ref<WidgetRef>;
@@ -1 +1 @@
1
- {"version":3,"file":"WidgetImperativeHandler.d.ts","sourceRoot":"","sources":["../../src/WidgetImperativeHandler.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,MAAM,MAAM,SAAS,GAAG;IACtB,qFAAqF;IACrF,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5D,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,GACV,EAAE;IACD,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;CACjC,QA4BA"}
1
+ {"version":3,"file":"WidgetImperativeHandler.d.ts","sourceRoot":"","sources":["../../src/WidgetImperativeHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,MAAM,MAAM,SAAS,GAAG;IACtB,qFAAqF;IACrF,OAAO,EAAE,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D;;;;;;;;;OASG;IACH,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,oBAAoB,CAAC;CACzD,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,GACV,EAAE;IACD,SAAS,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;CACjC,QA8BA"}
@@ -5,13 +5,15 @@ export declare const STICKY_QUESTIONS_DELAY_MS = 5000;
5
5
  * The configured `stickyQuestions` to show above the composer right now, or
6
6
  * an empty list. They come back {@link STICKY_QUESTIONS_DELAY_MS} after the
7
7
  * AI's latest reply (system checkpoints after it don't count as a reply, and a
8
- * failed reply's error bubble doesn't start the timer), and
8
+ * failed reply's error bubble doesn't start the timer). They stay hidden once
9
+ * the session is handed off to the team, and
9
10
  * yield while a reply streams, while the visitor is typing, and while another
10
11
  * row of suggestions is up.
11
12
  */
12
- export declare function useStickyQuestions({ stickyQuestions, messages, isStreaming, isTyping, otherSuggestionsShowing, }: {
13
+ export declare function useStickyQuestions({ stickyQuestions, messages, isHandedOff, isStreaming, isTyping, otherSuggestionsShowing, }: {
13
14
  stickyQuestions: string[] | undefined;
14
15
  messages: WidgetMessageU[];
16
+ isHandedOff: boolean;
15
17
  isStreaming: boolean;
16
18
  isTyping: boolean;
17
19
  otherSuggestionsShowing: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"useStickyQuestions.d.ts","sourceRoot":"","sources":["../../../src/hooks/useStickyQuestions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,uEAAuE;AACvE,eAAO,MAAM,yBAAyB,OAAQ,CAAC;AAE/C;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,eAAe,EACf,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,uBAAuB,GACxB,EAAE;IACD,eAAe,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACtC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,uBAAuB,EAAE,OAAO,CAAC;CAClC,GAAG,MAAM,EAAE,CA6BX"}
1
+ {"version":3,"file":"useStickyQuestions.d.ts","sourceRoot":"","sources":["../../../src/hooks/useStickyQuestions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,uEAAuE;AACvE,eAAO,MAAM,yBAAyB,OAAQ,CAAC;AAE/C;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,eAAe,EACf,QAAQ,EACR,WAAW,EACX,WAAW,EACX,QAAQ,EACR,uBAAuB,GACxB,EAAE;IACD,eAAe,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACtC,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,uBAAuB,EAAE,OAAO,CAAC;CAClC,GAAG,MAAM,EAAE,CA8BX"}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatFooter.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/ChatFooter.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,MAAM,OAAO,CAAC;AA6E1B,wBAAgB,UAAU,sBA6FzB"}
1
+ {"version":3,"file":"ChatFooter.d.ts","sourceRoot":"","sources":["../../../../src/screens/chat/ChatFooter.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,MAAM,OAAO,CAAC;AA6E1B,wBAAgB,UAAU,sBA+FzB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opencx/widget-react",
3
3
  "private": false,
4
- "version": "5.14.1",
4
+ "version": "5.15.1",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -36,8 +36,8 @@
36
36
  "tailwind-merge": "^2.4.0",
37
37
  "tinycolor2": "^1.6.0",
38
38
  "zod": "^4.6.7",
39
- "@opencx/widget-core": "5.14.1",
40
- "@opencx/widget-react-headless": "5.14.1"
39
+ "@opencx/widget-core": "5.15.1",
40
+ "@opencx/widget-react-headless": "5.15.1"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@types/react": ">=18 <20",