@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.
Files changed (45) hide show
  1. package/dist/{basic.cjs → designs.cjs} +3 -3
  2. package/dist/designs.cjs.map +1 -0
  3. package/dist/designs.d.ts +2 -0
  4. package/dist/{basic.js → designs.js} +36 -38
  5. package/dist/designs.js.map +1 -0
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/react.cjs +1 -1
  9. package/dist/react.js +2 -2
  10. package/dist/src/designs/react/index.d.ts +5 -8
  11. package/dist/src/designs/react/{basic/utils → utils}/group-messages-by-type.d.ts +1 -1
  12. package/dist/src/embedded/index.d.ts +11 -0
  13. package/dist/src/headless/core/api.d.ts +42 -16
  14. package/dist/src/headless/core/context/session.d.ts +28 -50
  15. package/dist/src/headless/core/sdk/schema.d.ts +80 -4
  16. package/dist/src/headless/core/types/WidgetConfig.d.ts +22 -9
  17. package/dist/src/headless/react/hooks/useSession.d.ts +6 -0
  18. package/dist/{useUploadFiles-BsYBWtZE.js → useUploadFiles-B-HZXbPR.js} +3 -3
  19. package/dist/{useUploadFiles-BsYBWtZE.js.map → useUploadFiles-B-HZXbPR.js.map} +1 -1
  20. package/dist/{useUploadFiles-CVNyTftw.cjs → useUploadFiles-WylOvupS.cjs} +2 -2
  21. package/dist/{useUploadFiles-CVNyTftw.cjs.map → useUploadFiles-WylOvupS.cjs.map} +1 -1
  22. package/dist/widget-6i5ISSQC.cjs +2 -0
  23. package/dist/widget-6i5ISSQC.cjs.map +1 -0
  24. package/dist/{widget-BeNOCqB5.js → widget-BOaF1U-p.js} +128 -69
  25. package/dist/widget-BOaF1U-p.js.map +1 -0
  26. package/dist-embed/script.js +115 -115
  27. package/dist-embed/script.js.map +1 -1
  28. package/package.json +5 -5
  29. package/dist/basic.cjs.map +0 -1
  30. package/dist/basic.d.ts +0 -2
  31. package/dist/basic.js.map +0 -1
  32. package/dist/src/designs/react/basic/index.d.ts +0 -10
  33. package/dist/src/designs/react/basic/widget-interaction-tests/widget.test.d.ts +0 -1
  34. package/dist/src/designs/react/render.d.ts +0 -2
  35. package/dist/style.css +0 -1
  36. package/dist/widget-BeNOCqB5.js.map +0 -1
  37. package/dist/widget-DlAUwHzU.cjs +0 -2
  38. package/dist/widget-DlAUwHzU.cjs.map +0 -1
  39. /package/dist/src/designs/react/{basic/WidgetPopoverTrigger.d.ts → WidgetPopoverTrigger.d.ts} +0 -0
  40. /package/dist/src/designs/react/{basic/screens → screens}/chat-screen/ChatFooter.d.ts +0 -0
  41. /package/dist/src/designs/react/{basic/screens → screens}/chat-screen/ChatHeader.d.ts +0 -0
  42. /package/dist/src/designs/react/{basic/screens → screens}/chat-screen/ChatMain.d.ts +0 -0
  43. /package/dist/src/designs/react/{basic/screens → screens}/chat-screen/ChatScreen.d.ts +0 -0
  44. /package/dist/src/designs/react/{basic/screens → screens}/root-screen.d.ts +0 -0
  45. /package/dist/src/designs/react/{basic/screens → screens}/welcome-screen/WelcomeScreen.d.ts +0 -0
@@ -0,0 +1,2 @@
1
+ export * from './src/designs/react/index'
2
+ export {}
@@ -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-BsYBWtZE.js";
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
- }, []), console.log(e), e;
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("div", { dir: a, className: "flex items-center rtl:flex-row-reverse gap-2", children: [
3322
- /* @__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 }) }),
3323
- /* @__PURE__ */ X(U5, {})
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((a) => /* @__PURE__ */ X(Y5, { message: a }, a.id))
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 FY(t) {
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, JY] = nM(rx, [
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", [ZY, LP] = r3(OP, {
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 eW({
40870
- className: e,
40871
- opened: n = !1,
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: d }),
40881
+ /* @__PURE__ */ X(WP, { isOpen: s }),
40878
40882
  /* @__PURE__ */ X(
40879
40883
  HP,
40880
40884
  {
40881
- onInteractOutside: (E) => E.preventDefault(),
40885
+ onInteractOutside: (p) => p.preventDefault(),
40882
40886
  side: "top",
40883
- "data-aria-expanded": d,
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: f === "rtl" ? "start" : "end",
40897
+ align: n === "rtl" ? "start" : "end",
40894
40898
  asChild: !0,
40895
40899
  children: /* @__PURE__ */ X(
40896
40900
  Uf.div,
40897
40901
  {
40898
- animate: d ? "visible" : "hidden",
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: p == null ? void 0 : p.primaryColor }
40956
+ { primary: a == null ? void 0 : a.primaryColor }
40953
40957
  // { triggerOffset: theme.triggerOffset },
40954
40958
  )
40955
40959
  },
40956
- ...a,
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: n
41004
+ children: /* @__PURE__ */ X(FY, {})
41006
41005
  }
41007
41006
  );
41008
41007
  }
41009
41008
  export {
41010
- eW as Widget,
41011
- tW as WidgetRoot
41009
+ tW as Widget
41012
41010
  };
41013
- //# sourceMappingURL=basic.js.map
41011
+ //# sourceMappingURL=designs.js.map