@opencx/widget 3.0.9 → 3.0.11
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/{basic.cjs → designs.cjs} +3 -3
- package/dist/designs.cjs.map +1 -0
- package/dist/designs.d.ts +2 -0
- package/dist/{basic.js → designs.js} +36 -38
- package/dist/designs.js.map +1 -0
- 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/index.d.ts +5 -8
- package/dist/src/designs/react/{basic/utils → utils}/group-messages-by-type.d.ts +1 -1
- package/dist/src/embedded/index.d.ts +11 -0
- package/dist/src/headless/core/api.d.ts +42 -16
- package/dist/src/headless/core/context/session.d.ts +28 -50
- package/dist/src/headless/core/sdk/schema.d.ts +80 -4
- package/dist/src/headless/core/types/WidgetConfig.d.ts +22 -9
- package/dist/src/headless/react/hooks/useSession.d.ts +6 -0
- package/dist/{useUploadFiles-BsYBWtZE.js → useUploadFiles-B-HZXbPR.js} +3 -3
- package/dist/{useUploadFiles-BsYBWtZE.js.map → useUploadFiles-B-HZXbPR.js.map} +1 -1
- package/dist/{useUploadFiles-CVNyTftw.cjs → useUploadFiles-WylOvupS.cjs} +2 -2
- package/dist/{useUploadFiles-CVNyTftw.cjs.map → useUploadFiles-WylOvupS.cjs.map} +1 -1
- package/dist/widget-6i5ISSQC.cjs +2 -0
- package/dist/widget-6i5ISSQC.cjs.map +1 -0
- package/dist/{widget-BeNOCqB5.js → widget-BOaF1U-p.js} +128 -69
- package/dist/widget-BOaF1U-p.js.map +1 -0
- package/dist-embed/script.js +115 -115
- package/dist-embed/script.js.map +1 -1
- package/package.json +5 -5
- package/dist/basic.cjs.map +0 -1
- package/dist/basic.d.ts +0 -2
- package/dist/basic.js.map +0 -1
- package/dist/src/designs/react/basic/index.d.ts +0 -10
- package/dist/src/designs/react/basic/widget-interaction-tests/widget.test.d.ts +0 -1
- package/dist/src/designs/react/render.d.ts +0 -2
- package/dist/style.css +0 -1
- package/dist/widget-BeNOCqB5.js.map +0 -1
- package/dist/widget-DlAUwHzU.cjs +0 -2
- package/dist/widget-DlAUwHzU.cjs.map +0 -1
- /package/dist/src/designs/react/{basic/WidgetPopoverTrigger.d.ts → WidgetPopoverTrigger.d.ts} +0 -0
- /package/dist/src/designs/react/{basic/screens → screens}/chat-screen/ChatFooter.d.ts +0 -0
- /package/dist/src/designs/react/{basic/screens → screens}/chat-screen/ChatHeader.d.ts +0 -0
- /package/dist/src/designs/react/{basic/screens → screens}/chat-screen/ChatMain.d.ts +0 -0
- /package/dist/src/designs/react/{basic/screens → screens}/chat-screen/ChatScreen.d.ts +0 -0
- /package/dist/src/designs/react/{basic/screens → screens}/root-screen.d.ts +0 -0
- /package/dist/src/designs/react/{basic/screens → screens}/welcome-screen/WelcomeScreen.d.ts +0 -0
|
@@ -6,7 +6,7 @@ import { motion as Uf, AnimatePresence as Bm } from "framer-motion";
|
|
|
6
6
|
import { PaperclipIcon as nI, CircleDashed as rI, SendHorizonal as aI, CheckCheckIcon as iI, XIcon as rk, AlertCircle as oI, Loader2 as uI, FileAudio as sI, FileIcon as lI, ChevronRight as cI, Check as dI, Circle as fI, EllipsisVerticalIcon as hI, RotateCcw as pI, SendHorizontal as mI } from "lucide-react";
|
|
7
7
|
import { useDropzone as gI } from "react-dropzone";
|
|
8
8
|
import s_ from "react-hot-toast";
|
|
9
|
-
import { u as Gf, g as jT, d as VT, h as vI, c as ak, e as YT, a as Hm, b as ik, _ as yI, i as Xs, j as ok, k as EI, l as l_, m as bI, W as wI } from "./useUploadFiles-
|
|
9
|
+
import { u as Gf, g as jT, d as VT, h as vI, c as ak, e as YT, a as Hm, b as ik, _ as yI, i as Xs, j as ok, k as EI, l as l_, m as bI, W as wI } from "./useUploadFiles-B-HZXbPR.js";
|
|
10
10
|
import * as zm from "@radix-ui/react-tooltip";
|
|
11
11
|
import { clsx as uk } from "clsx";
|
|
12
12
|
import { Slot as WT } from "@radix-ui/react-slot";
|
|
@@ -2860,7 +2860,7 @@ const jm = () => {
|
|
|
2860
2860
|
}), window.addEventListener("languagechange", a), () => {
|
|
2861
2861
|
s.disconnect(), window.removeEventListener("languagechange", a);
|
|
2862
2862
|
};
|
|
2863
|
-
}, []),
|
|
2863
|
+
}, []), e;
|
|
2864
2864
|
};
|
|
2865
2865
|
function S5({
|
|
2866
2866
|
file: { status: e, file: n, error: a },
|
|
@@ -3318,10 +3318,17 @@ function U5() {
|
|
|
3318
3318
|
function B5() {
|
|
3319
3319
|
var s;
|
|
3320
3320
|
const { data: e, isLoading: n } = YT(), a = jm();
|
|
3321
|
-
return /* @__PURE__ */ X("header", { className: "p-2 border-b bg-background", children: /* @__PURE__ */ Nt(
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3321
|
+
return /* @__PURE__ */ X("header", { className: "p-2 border-b bg-background", children: /* @__PURE__ */ Nt(
|
|
3322
|
+
"div",
|
|
3323
|
+
{
|
|
3324
|
+
dir: a,
|
|
3325
|
+
className: "flex items-center rtl:flex-row-reverse gap-2",
|
|
3326
|
+
children: [
|
|
3327
|
+
/* @__PURE__ */ X("div", { className: "flex-1 pl-2", children: n ? /* @__PURE__ */ X(F5, { className: "h-4 w-2/3" }) : /* @__PURE__ */ X("h2", { className: "font-semibold", children: (s = e == null ? void 0 : e.data) == null ? void 0 : s.organizationName }) }),
|
|
3328
|
+
/* @__PURE__ */ X(U5, {})
|
|
3329
|
+
]
|
|
3330
|
+
}
|
|
3331
|
+
) });
|
|
3325
3332
|
}
|
|
3326
3333
|
function H5(e) {
|
|
3327
3334
|
const n = [];
|
|
@@ -3475,6 +3482,7 @@ function Y5({
|
|
|
3475
3482
|
function W5({
|
|
3476
3483
|
messages: e
|
|
3477
3484
|
}) {
|
|
3485
|
+
var a, s;
|
|
3478
3486
|
const { user: n } = Hm();
|
|
3479
3487
|
return /* @__PURE__ */ Nt(
|
|
3480
3488
|
"div",
|
|
@@ -3484,8 +3492,8 @@ function W5({
|
|
|
3484
3492
|
"flex flex-col gap-2 justify-end items-end"
|
|
3485
3493
|
),
|
|
3486
3494
|
children: [
|
|
3487
|
-
/* @__PURE__ */ X(j1, { className: "bg-primary text-primary-foreground", children: /* @__PURE__ */ X($T, { src: n == null ? void 0 : n.avatarUrl, alt: (n == null ? void 0 : n.name) || "User avatar" }) }),
|
|
3488
|
-
e.map((
|
|
3495
|
+
/* @__PURE__ */ X(j1, { className: "bg-primary text-primary-foreground", children: /* @__PURE__ */ X($T, { src: (a = n == null ? void 0 : n.data) == null ? void 0 : a.avatarUrl, alt: ((s = n == null ? void 0 : n.data) == null ? void 0 : s.name) || "User avatar" }) }),
|
|
3496
|
+
e.map((f) => /* @__PURE__ */ X(Y5, { message: f }, f.id))
|
|
3489
3497
|
]
|
|
3490
3498
|
}
|
|
3491
3499
|
);
|
|
@@ -15003,7 +15011,7 @@ Check the render method of \`` + t + "`." : "";
|
|
|
15003
15011
|
};
|
|
15004
15012
|
}
|
|
15005
15013
|
}
|
|
15006
|
-
function
|
|
15014
|
+
function UY(t) {
|
|
15007
15015
|
return t;
|
|
15008
15016
|
}
|
|
15009
15017
|
function JN(t) {
|
|
@@ -17233,10 +17241,10 @@ Incoming: %s`, me, "[" + r.join(", ") + "]", "[" + t.join(", ") + "]");
|
|
|
17233
17241
|
}
|
|
17234
17242
|
return [_, v];
|
|
17235
17243
|
}
|
|
17236
|
-
function UY(t, r, u) {
|
|
17237
|
-
}
|
|
17238
17244
|
function BY(t, r, u) {
|
|
17239
17245
|
}
|
|
17246
|
+
function HY(t, r, u) {
|
|
17247
|
+
}
|
|
17240
17248
|
function nb(t, r, u) {
|
|
17241
17249
|
var l = Wt, h = Ro(), v, T = Ar();
|
|
17242
17250
|
if (T) {
|
|
@@ -25480,7 +25488,7 @@ var n3 = ie.forwardRef(function(e, n) {
|
|
|
25480
25488
|
return ie.createElement(q1, Xs({}, e, { ref: n, sideCar: RP }));
|
|
25481
25489
|
});
|
|
25482
25490
|
n3.classNames = q1.classNames;
|
|
25483
|
-
var rx = "Popover", [r3,
|
|
25491
|
+
var rx = "Popover", [r3, ZY] = nM(rx, [
|
|
25484
25492
|
Uk
|
|
25485
25493
|
]), Ym = Uk(), [NP, kc] = r3(rx), a3 = (e) => {
|
|
25486
25494
|
const {
|
|
@@ -25539,7 +25547,7 @@ var o3 = "PopoverTrigger", u3 = ie.forwardRef(
|
|
|
25539
25547
|
}
|
|
25540
25548
|
);
|
|
25541
25549
|
u3.displayName = o3;
|
|
25542
|
-
var OP = "PopoverPortal", [
|
|
25550
|
+
var OP = "PopoverPortal", [eW, LP] = r3(OP, {
|
|
25543
25551
|
forceMount: void 0
|
|
25544
25552
|
}), Wf = "PopoverContent", s3 = ie.forwardRef(
|
|
25545
25553
|
(e, n) => {
|
|
@@ -40866,21 +40874,17 @@ html, body {
|
|
|
40866
40874
|
<body>
|
|
40867
40875
|
</body>
|
|
40868
40876
|
</html>`;
|
|
40869
|
-
function
|
|
40870
|
-
|
|
40871
|
-
|
|
40872
|
-
...a
|
|
40873
|
-
}) {
|
|
40874
|
-
const s = Gf(), f = jm(), { theme: p } = Hm(), [d, g] = Uo(n);
|
|
40875
|
-
return /* @__PURE__ */ Nt(BP, { open: d, onOpenChange: g, children: [
|
|
40877
|
+
function FY() {
|
|
40878
|
+
const e = Gf(), n = jm(), { theme: a } = Hm(), [s, f] = Uo(!1);
|
|
40879
|
+
return /* @__PURE__ */ Nt(BP, { open: s, onOpenChange: f, children: [
|
|
40876
40880
|
/* @__PURE__ */ X("style", { children: m3 }),
|
|
40877
|
-
/* @__PURE__ */ X(WP, { isOpen:
|
|
40881
|
+
/* @__PURE__ */ X(WP, { isOpen: s }),
|
|
40878
40882
|
/* @__PURE__ */ X(
|
|
40879
40883
|
HP,
|
|
40880
40884
|
{
|
|
40881
|
-
onInteractOutside: (
|
|
40885
|
+
onInteractOutside: (p) => p.preventDefault(),
|
|
40882
40886
|
side: "top",
|
|
40883
|
-
"data-aria-expanded":
|
|
40887
|
+
"data-aria-expanded": s,
|
|
40884
40888
|
"data-testid": "widget-popover-content",
|
|
40885
40889
|
forceMount: !0,
|
|
40886
40890
|
style: {
|
|
@@ -40890,12 +40894,12 @@ function eW({
|
|
|
40890
40894
|
sideOffset: 8,
|
|
40891
40895
|
"data-chat-widget": !0,
|
|
40892
40896
|
"data-chat-widget-content-root": !0,
|
|
40893
|
-
align:
|
|
40897
|
+
align: n === "rtl" ? "start" : "end",
|
|
40894
40898
|
asChild: !0,
|
|
40895
40899
|
children: /* @__PURE__ */ X(
|
|
40896
40900
|
Uf.div,
|
|
40897
40901
|
{
|
|
40898
|
-
animate:
|
|
40902
|
+
animate: s ? "visible" : "hidden",
|
|
40899
40903
|
initial: "hidden",
|
|
40900
40904
|
variants: {
|
|
40901
40905
|
hidden: {
|
|
@@ -40949,16 +40953,14 @@ function eW({
|
|
|
40949
40953
|
{
|
|
40950
40954
|
style: {
|
|
40951
40955
|
...sk(
|
|
40952
|
-
{ primary:
|
|
40956
|
+
{ primary: a == null ? void 0 : a.primaryColor }
|
|
40953
40957
|
// { triggerOffset: theme.triggerOffset },
|
|
40954
40958
|
)
|
|
40955
40959
|
},
|
|
40956
|
-
|
|
40957
|
-
"data-version": s.version,
|
|
40960
|
+
"data-version": e.version,
|
|
40958
40961
|
"data-chat-widget": !0,
|
|
40959
40962
|
className: Ft(
|
|
40960
|
-
"antialiased font-inter bg-primary size-full overflow-hidden isolate relative text-secondary-foreground"
|
|
40961
|
-
e
|
|
40963
|
+
"antialiased font-inter bg-primary size-full overflow-hidden isolate relative text-secondary-foreground"
|
|
40962
40964
|
),
|
|
40963
40965
|
children: /* @__PURE__ */ X(Z5, {})
|
|
40964
40966
|
}
|
|
@@ -40975,10 +40977,7 @@ function eW({
|
|
|
40975
40977
|
)
|
|
40976
40978
|
] });
|
|
40977
40979
|
}
|
|
40978
|
-
function tW({
|
|
40979
|
-
options: e,
|
|
40980
|
-
children: n
|
|
40981
|
-
}) {
|
|
40980
|
+
function tW({ options: e }) {
|
|
40982
40981
|
return /* @__PURE__ */ X(
|
|
40983
40982
|
wI,
|
|
40984
40983
|
{
|
|
@@ -41002,12 +41001,11 @@ function tW({
|
|
|
41002
41001
|
// TODO allow accepting components from the outside to support UI components
|
|
41003
41002
|
],
|
|
41004
41003
|
options: e,
|
|
41005
|
-
children:
|
|
41004
|
+
children: /* @__PURE__ */ X(FY, {})
|
|
41006
41005
|
}
|
|
41007
41006
|
);
|
|
41008
41007
|
}
|
|
41009
41008
|
export {
|
|
41010
|
-
|
|
41011
|
-
tW as WidgetRoot
|
|
41009
|
+
tW as Widget
|
|
41012
41010
|
};
|
|
41013
|
-
//# sourceMappingURL=
|
|
41011
|
+
//# sourceMappingURL=designs.js.map
|