@opencx/widget-react 5.3.0 → 5.4.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/{Chart.impl-C2mZFFw3.js → Chart.impl-DHL9WtSk.js} +2 -2
- package/dist/{Chart.impl-C2mZFFw3.js.map → Chart.impl-DHL9WtSk.js.map} +1 -1
- package/dist/{Chart.impl-D-zWNzAD.cjs → Chart.impl-Ds2iAr8P.cjs} +2 -2
- package/dist/{Chart.impl-D-zWNzAD.cjs.map → Chart.impl-Ds2iAr8P.cjs.map} +1 -1
- package/dist/index-D-LXlHO4.cjs +390 -0
- package/dist/index-D-LXlHO4.cjs.map +1 -0
- package/dist/{index-B4ebVsXX.js → index-uTBDmBjX.js} +4855 -4730
- package/dist/index-uTBDmBjX.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/package.json.d.ts +1 -1
- package/dist/src/WidgetPopoverTrigger.d.ts.map +1 -1
- package/dist/src/companion/RestingPill.d.ts +4 -1
- package/dist/src/companion/RestingPill.d.ts.map +1 -1
- package/dist/src/companion/WidgetCompanion.d.ts.map +1 -1
- package/dist/src/components/UnreadBadge.d.ts +42 -0
- package/dist/src/components/UnreadBadge.d.ts.map +1 -0
- package/dist/src/components/UnreadViewing.d.ts +8 -0
- package/dist/src/components/UnreadViewing.d.ts.map +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/screens/sessions/index.d.ts.map +1 -1
- package/dist/src/utils/render-custom-trigger.d.ts +1 -1
- package/dist/src/utils/render-custom-trigger.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/index-B4ebVsXX.js.map +0 -1
- package/dist/index-bFvv5AK0.cjs +0 -375
- package/dist/index-bFvv5AK0.cjs.map +0 -1
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-
|
|
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-D-LXlHO4.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-
|
|
6
|
+
import { H as s, W as n, s as a } from "./index-uTBDmBjX.js";
|
|
7
7
|
export {
|
|
8
8
|
s as HostedSpecRenderer,
|
|
9
9
|
n as Widget,
|
package/dist/package.json.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetPopoverTrigger.d.ts","sourceRoot":"","sources":["../../src/WidgetPopoverTrigger.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WidgetPopoverTrigger.d.ts","sourceRoot":"","sources":["../../src/WidgetPopoverTrigger.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAmC1B,iBAAS,oBAAoB,6BAsJ5B;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export declare function RestingPill({ visible, docked, label, icon, pillBackground, dir, measureRef, activeCount, countLabel, onOpenChats, pickerOpen, working, sessions, }: {
|
|
2
|
+
export declare function RestingPill({ visible, docked, label, icon, pillBackground, dir, measureRef, activeCount, countLabel, onOpenChats, pickerOpen, working, sessions, unreadCount, unreadShowCount, }: {
|
|
3
3
|
/** The shell is resting as a pill (vs. morphed open) — show this look */
|
|
4
4
|
sessions?: React.ReactNode;
|
|
5
5
|
activeCount?: number;
|
|
6
|
+
/** Sessions with a reply the visitor has not looked at; marks the disc. */
|
|
7
|
+
unreadCount?: number;
|
|
8
|
+
unreadShowCount?: boolean;
|
|
6
9
|
countLabel?: string;
|
|
7
10
|
onOpenChats?: (anchor: HTMLButtonElement, pointer: boolean) => void;
|
|
8
11
|
pickerOpen?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RestingPill.d.ts","sourceRoot":"","sources":["../../../src/companion/RestingPill.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RestingPill.d.ts","sourceRoot":"","sources":["../../../src/companion/RestingPill.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAyE1B,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,MAAM,EACN,KAAK,EACL,IAAI,EACJ,cAAc,EACd,GAAG,EACH,UAAU,EACV,WAAe,EACf,UAAU,EACV,WAAW,EACX,UAAkB,EAClB,OAAe,EACf,QAAQ,EACR,WAAe,EACf,eAAuB,GACxB,EAAE;IACD,yEAAyE;IACzE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACpE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,mEAAmE;IACnE,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,+EAA+E;IAC/E,UAAU,EAAE,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;CACnD,qBAmJA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WidgetCompanion.d.ts","sourceRoot":"","sources":["../../../src/companion/WidgetCompanion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAMN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WidgetCompanion.d.ts","sourceRoot":"","sources":["../../../src/companion/WidgetCompanion.tsx"],"names":[],"mappings":"AAEA,OAAO,KAMN,MAAM,OAAO,CAAC;AA+Df,wBAAgB,eAAe,6BAwwB9B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { OpenCxComponentNameU, WidgetConfig } from '@opencx/widget-core';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
type UnreadLook = NonNullable<WidgetConfig['unreadIndicator']>;
|
|
4
|
+
/** Pixel size of the mark; keep in sync with the `data-unread-look` rules. */
|
|
5
|
+
export declare const unreadMarkSize: (showCount: boolean) => 9 | 16;
|
|
6
|
+
/**
|
|
7
|
+
* Inset from a round launcher's top/end edges that centers the mark on the
|
|
8
|
+
* circle's edge at 45°, where a badge sits on a disc. Negative when the mark
|
|
9
|
+
* is larger than the room the corner leaves.
|
|
10
|
+
*/
|
|
11
|
+
export declare const unreadMarkInsetOnDisc: (discSize: number, showCount: boolean) => number;
|
|
12
|
+
/**
|
|
13
|
+
* The red mark for sessions holding a reply the visitor has not looked at.
|
|
14
|
+
* Decorative: the control carrying it names the count (`useUnreadLabel`).
|
|
15
|
+
* Its look lives in the stylesheet under `[data-component='trigger/unread']`
|
|
16
|
+
* / `'sessions/unread'` plus `[data-unread-look='dot' | 'count']`, so
|
|
17
|
+
* `cssOverrides` restyle it like any other part; callers only pass where it
|
|
18
|
+
* sits. The companion pill renders in the host page, outside the iframe
|
|
19
|
+
* stylesheet, so it mounts `UnreadMarkHostStyles` beside the mark.
|
|
20
|
+
*/
|
|
21
|
+
export declare function UnreadMark({ count, showCount, component, style, }: {
|
|
22
|
+
count: number;
|
|
23
|
+
showCount: boolean;
|
|
24
|
+
component?: OpenCxComponentNameU;
|
|
25
|
+
style?: React.CSSProperties;
|
|
26
|
+
}): React.JSX.Element | null;
|
|
27
|
+
/** Mirror of the `index.css` rule for marks rendered in the host page. */
|
|
28
|
+
export declare function UnreadMarkHostStyles(): React.JSX.Element;
|
|
29
|
+
/** `config.unreadIndicator`, defaulting to the dot. */
|
|
30
|
+
export declare function useUnreadLook(): UnreadLook | false;
|
|
31
|
+
/** The mark, as the embed configured it. */
|
|
32
|
+
export declare function UnreadBadge({ count, indicator, component, style, }: {
|
|
33
|
+
count: number;
|
|
34
|
+
/** Force a look; defaults to `config.unreadIndicator`. */
|
|
35
|
+
indicator?: UnreadLook;
|
|
36
|
+
component?: OpenCxComponentNameU;
|
|
37
|
+
style?: React.CSSProperties;
|
|
38
|
+
}): React.JSX.Element | null;
|
|
39
|
+
/** What a control carrying the mark appends to its accessible name. */
|
|
40
|
+
export declare function useUnreadLabel(count: number): string | null;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=UnreadBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnreadBadge.d.ts","sourceRoot":"","sources":["../../../src/components/UnreadBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAG9E,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,KAAK,UAAU,GAAG,WAAW,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAE/D,8EAA8E;AAC9E,eAAO,MAAM,cAAc,GAAI,WAAW,OAAO,WAAyB,CAAC;AAE3E;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,UAAU,MAAM,EAAE,WAAW,OAAO,WACL,CAAC;AAEtE;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,SAA4B,EAC5B,KAAK,GACN,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,4BAmBA;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,sBAmBnC;AAED,uDAAuD;AACvD,wBAAgB,aAAa,IAAI,UAAU,GAAG,KAAK,CAElD;AAED,4CAA4C;AAC5C,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,SAAS,EACT,SAAS,EACT,KAAK,GACN,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B,4BAWA;AAED,uEAAuE;AACvE,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK3D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reports which session is on screen, so the backend can clear its unread
|
|
3
|
+
* mark. Each shell mounts one and says whether its transcript is showing.
|
|
4
|
+
*/
|
|
5
|
+
export declare function UnreadViewing({ transcriptVisible, }: {
|
|
6
|
+
transcriptVisible?: boolean;
|
|
7
|
+
}): null;
|
|
8
|
+
//# sourceMappingURL=UnreadViewing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnreadViewing.d.ts","sourceRoot":"","sources":["../../../src/components/UnreadViewing.tsx"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,aAAa,CAAC,EAC5B,iBAAwB,GACzB,EAAE;IACD,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,QAGA"}
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAGV,YAAY,EACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAGV,YAAY,EACb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,+BAA+B,CAAC;AAYvC,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAEL,KAAK,SAAS,EACf,MAAM,2BAA2B,CAAC;AA8EnC,QAAA,MAAM,MAAM;aAGC,YAAY;iBACR,mBAAmB,EAAE;uBACf,KAAK,CAAC,SAAS;qBACjB,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,CAAC,SAAS;mCAyDpD,CAAC;AAGH,OAAO,EAAE,MAAM,EAAE,CAAC;AAClB;;;;;GAKG;AACH,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,KAAK,cAAc,GACpB,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,SAAS,GACV,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/screens/sessions/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/screens/sessions/index.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,MAAM,OAAO,CAAC;AAiO1B,wBAAgB,cAAc,sBA0B7B"}
|
|
@@ -6,6 +6,6 @@ type CustomTrigger = NonNullable<NonNullable<WidgetConfig['customComponents']>['
|
|
|
6
6
|
* shared contract: it replaces the built-in launcher entirely and drives the
|
|
7
7
|
* widget via `setIsOpen`. One invocation shape for popover and companion.
|
|
8
8
|
*/
|
|
9
|
-
export declare function renderCustomTrigger(customTrigger: CustomTrigger, isOpen: boolean, setIsOpen: (open: boolean) => void): React.ReactElement<{}, string | React.JSXElementConstructor<any>> | null;
|
|
9
|
+
export declare function renderCustomTrigger(customTrigger: CustomTrigger, isOpen: boolean, setIsOpen: (open: boolean) => void, unreadCount: number): React.ReactElement<{}, string | React.JSXElementConstructor<any>> | null;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=render-custom-trigger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-custom-trigger.d.ts","sourceRoot":"","sources":["../../../src/utils/render-custom-trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,KAAK,aAAa,GAAG,WAAW,CAC9B,WAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,eAAe,CAAC,CAC/D,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,
|
|
1
|
+
{"version":3,"file":"render-custom-trigger.d.ts","sourceRoot":"","sources":["../../../src/utils/render-custom-trigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,KAAK,aAAa,GAAG,WAAW,CAC9B,WAAW,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,eAAe,CAAC,CAC/D,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EAClC,WAAW,EAAE,MAAM,4EAQpB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencx/widget-react",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.4.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"tailwind-merge": "^2.4.0",
|
|
41
41
|
"tinycolor2": "^1.6.0",
|
|
42
42
|
"zod": "^4.3.6",
|
|
43
|
-
"@opencx/widget-core": "5.
|
|
44
|
-
"@opencx/widget-react-headless": "5.
|
|
43
|
+
"@opencx/widget-core": "5.4.1",
|
|
44
|
+
"@opencx/widget-react-headless": "5.4.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@types/react": ">=18 <20",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"tailwindcss-animate": "^1.0.7",
|
|
64
64
|
"tsx": "^4.19.2",
|
|
65
65
|
"vite-plugin-qrcode": "^0.3.0",
|
|
66
|
-
"@opencx/
|
|
67
|
-
"@opencx/
|
|
66
|
+
"@opencx/tsconfig": "0.0.2",
|
|
67
|
+
"@opencx/eslint-config": "0.0.1"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"clean": "rm -rf node_modules dist .turbo",
|