@cuekit-ai/react 1.6.5 → 1.6.6

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.
@@ -23658,6 +23658,14 @@ function findDOMElementById(elementId) {
23658
23658
  }
23659
23659
 
23660
23660
  // src/utils/webrtc-service.ts
23661
+ function normalizeToNavigationCommand(message) {
23662
+ if (!message || typeof message !== "object") return message;
23663
+ if (message.type === "ai_intent" && message.data != null) return message;
23664
+ if ("actionType" in message && typeof message.actionType === "string") {
23665
+ return { type: "ai_intent", data: message };
23666
+ }
23667
+ return message;
23668
+ }
23661
23669
  var room = null;
23662
23670
  var reconnectTimeout = null;
23663
23671
  var serverUrl = WEBRTC_BACKEND_SERVER_URL || "https://api-webrtc.ansyr.ai";
@@ -23787,7 +23795,7 @@ function setupEventListeners() {
23787
23795
  try {
23788
23796
  const message = JSON.parse(jsonPart);
23789
23797
  console.log("\u{1F4E1} WebRTC Parsed JSON message:", message);
23790
- callbacks.onNavigationCommand?.(message);
23798
+ callbacks.onNavigationCommand?.(normalizeToNavigationCommand(message));
23791
23799
  } catch (error) {
23792
23800
  console.log("\u{1F4E1} WebRTC JSON parse error for JSON part:", error, "JSON part:", jsonPart);
23793
23801
  }
@@ -23796,7 +23804,7 @@ function setupEventListeners() {
23796
23804
  try {
23797
23805
  const message = JSON.parse(decodedPayload);
23798
23806
  console.log("\u{1F4E1} WebRTC Parsed message:", message);
23799
- callbacks.onNavigationCommand?.(message);
23807
+ callbacks.onNavigationCommand?.(normalizeToNavigationCommand(message));
23800
23808
  } catch (error) {
23801
23809
  console.log("\u{1F4E1} WebRTC JSON parse error:", error, "Raw payload:", decodedPayload);
23802
23810
  const message = decodedPayload;
package/dist/cuekit.css CHANGED
@@ -2,27 +2,42 @@
2
2
 
3
3
  /* Global CSS Variables for CueKit */
4
4
  :root {
5
- /* Light theme (default) */
5
+ /* Custom Color Palette - Purple */
6
+ --color-primary-25: #fafaff;
7
+ --color-primary-50: #f6f5ff;
8
+ --color-primary-100: #ecebff;
9
+ --color-primary-200: #dad7fe;
10
+ --color-primary-300: #c0bbfb;
11
+ --color-primary-400: #9a92f6;
12
+ --color-primary-500: #8177ed;
13
+ --color-primary-600: #6257d9;
14
+ --color-primary-700: #5447cd;
15
+ --color-primary-800: #42389e;
16
+ --color-primary-900: #38307d;
17
+ --color-primary-950: #241c5f;
18
+
19
+ /* Light theme (default) - Purple */
6
20
  --voice-bg: 0 0% 100%;
7
21
  --voice-surface: 0 0% 100%;
8
- --voice-border: 214.3 31.8% 91.4%;
22
+ --voice-border: 252 31% 91%;
9
23
  --voice-text: 222.2 84% 4.9%;
10
- --voice-text-muted: 215.4 16.3% 46.9%;
11
- --voice-accent: 200 98% 39%;
12
- --voice-accent-light: 200 98% 95%;
13
- --voice-user-bubble: 200 98% 39%;
24
+ --voice-text-muted: 252 16% 47%;
25
+ --voice-accent: 252 81% 60%;
26
+ --voice-accent-light: 252 100% 96%;
27
+ --voice-user-bubble: 252 81% 60%;
14
28
  --voice-user-text: 0 0% 100%;
15
29
  --voice-ai-bubble: 0 0% 100%;
16
30
  --voice-ai-text: 222.2 84% 4.9%;
17
- --indicator-bg: 200 98% 39%;
18
- --voice-placeholder: 215.4 16.3% 46.9%;
31
+ --indicator-bg: 252 81% 60%;
32
+ --voice-placeholder: 252 16% 47%;
19
33
 
20
- /* Gradients Light */
21
- --gradient-primary: linear-gradient(135deg, hsl(200 98% 39%), hsl(200 98% 50%));
22
- --gradient-surface: linear-gradient(180deg, hsl(0 0% 100%), hsl(210 40% 98%));
34
+ /* Gradients Light - Purple */
35
+ --gradient-primary: linear-gradient(135deg, hsl(252 81% 60%), hsl(252 88% 70%));
36
+ --gradient-surface: linear-gradient(180deg, hsl(0 0% 100%), hsl(252 40% 98%));
37
+ --gradient-mic-button: radial-gradient(circle at 50% 0%, hsl(252 88% 77%), hsl(252 66% 59%));
23
38
 
24
39
  /* Shadows Light */
25
- --shadow-soft: 0 4px 20px -2px hsl(200 98% 39% / 0.1);
40
+ --shadow-soft: 0 4px 20px -2px hsl(252 81% 60% / 0.1);
26
41
  --shadow-card: 0 10px 40px -10px hsl(0 0% 0% / 0.05);
27
42
  }
28
43
 
@@ -31,45 +46,47 @@
31
46
  .cuekit-voice-popup:not(.cuekit-dark) {
32
47
  --voice-bg: 0 0% 100%;
33
48
  --voice-surface: 0 0% 100%;
34
- --voice-border: 214.3 31.8% 91.4%;
49
+ --voice-border: 252 31% 91%;
35
50
  --voice-text: 222.2 84% 4.9%;
36
- --voice-text-muted: 215.4 16.3% 46.9%;
37
- --voice-accent: 200 98% 39%;
38
- --voice-accent-light: 200 98% 95%;
39
- --voice-user-bubble: 200 98% 39%;
51
+ --voice-text-muted: 252 16% 47%;
52
+ --voice-accent: 252 81% 60%;
53
+ --voice-accent-light: 252 100% 96%;
54
+ --voice-user-bubble: 252 81% 60%;
40
55
  --voice-user-text: 0 0% 100%;
41
56
  --voice-ai-bubble: 0 0% 100%;
42
57
  --voice-ai-text: 222.2 84% 4.9%;
43
- --indicator-bg: 200 98% 39%;
44
- --voice-placeholder: 215.4 16.3% 46.9%;
45
- --gradient-primary: linear-gradient(135deg, hsl(200 98% 39%), hsl(200 98% 50%));
46
- --gradient-surface: linear-gradient(180deg, hsl(0 0% 100%), hsl(210 40% 98%));
47
- --shadow-soft: 0 4px 20px -2px hsl(200 98% 39% / 0.1);
58
+ --indicator-bg: 252 81% 60%;
59
+ --voice-placeholder: 252 16% 47%;
60
+ --gradient-primary: linear-gradient(135deg, hsl(252 81% 60%), hsl(252 88% 70%));
61
+ --gradient-surface: linear-gradient(180deg, hsl(0 0% 100%), hsl(252 40% 98%));
62
+ --gradient-mic-button: radial-gradient(circle at 50% 0%, hsl(252 88% 77%), hsl(252 66% 59%));
63
+ --shadow-soft: 0 4px 20px -2px hsl(252 81% 60% / 0.1);
48
64
  --shadow-card: 0 10px 40px -10px hsl(0 0% 0% / 0.05);
49
65
  }
50
66
 
51
67
  .cuekit-voice-popup.cuekit-dark {
52
- /* Dark theme */
53
- --voice-bg: 211 32% 11%;
54
- --voice-surface: 217.2 32.6% 17.5%;
55
- --voice-border: 217.2 32.6% 17.5%;
56
- --voice-text: 210 40% 98%;
57
- --voice-text-muted: 215 20.2% 65.1%;
58
- --voice-accent: 200 98% 60%;
59
- --voice-accent-light: 200 98% 20%;
60
- --voice-user-bubble: 200.12 80.39% 60%;
68
+ /* Dark theme - Purple */
69
+ --voice-bg: 248 35% 11%;
70
+ --voice-surface: 248 32% 17.5%;
71
+ --voice-border: 248 32% 22%;
72
+ --voice-text: 252 40% 98%;
73
+ --voice-text-muted: 252 20% 65%;
74
+ --voice-accent: 252 88% 70%;
75
+ --voice-accent-light: 252 47% 25%;
76
+ --voice-user-bubble: 252 88% 70%;
61
77
  --voice-user-text: 0 0% 100%;
62
- --voice-ai-bubble: 200.57 32.71% 20.98%;
78
+ --voice-ai-bubble: 252 32% 21%;
63
79
  --voice-ai-text: 0 0% 100%;
64
- --indicator-bg: 200.12 80.39% 60%;
65
- --voice-placeholder: 215 20.2% 65.1%;
80
+ --indicator-bg: 252 88% 70%;
81
+ --voice-placeholder: 252 20% 65%;
66
82
 
67
- /* Gradients Dark */
68
- --gradient-primary: linear-gradient(135deg, hsl(200 98% 60%), hsl(200 98% 70%));
69
- --gradient-surface: linear-gradient(180deg, hsl(217.2 32.6% 17.5%), hsl(211 32% 11%));
83
+ /* Gradients Dark - Purple */
84
+ --gradient-primary: linear-gradient(135deg, hsl(252 88% 70%), hsl(252 88% 77%));
85
+ --gradient-surface: linear-gradient(180deg, hsl(248 32% 17.5%), hsl(248 35% 11%));
86
+ --gradient-mic-button: radial-gradient(circle at 50% 0%, hsl(252 88% 77%), hsl(252 59% 54%));
70
87
 
71
88
  /* Shadows Dark */
72
- --shadow-soft: 0 4px 20px -2px hsl(200 98% 60% / 0.2);
89
+ --shadow-soft: 0 4px 20px -2px hsl(252 88% 70% / 0.2);
73
90
  --shadow-card: 0 10px 40px -10px hsl(0 0% 0% / 0.3);
74
91
  }
75
92
 
package/dist/index.d.mts CHANGED
@@ -85,6 +85,7 @@ type MicButtonProps = {
85
85
  language?: Language;
86
86
  defaultLanguage?: Language;
87
87
  onLanguageChange?: (language: Language) => void;
88
+ showLanguageDropdown?: boolean;
88
89
  };
89
90
 
90
91
  declare const MicButton: React__default.FC<MicButtonProps>;
package/dist/index.d.ts CHANGED
@@ -85,6 +85,7 @@ type MicButtonProps = {
85
85
  language?: Language;
86
86
  defaultLanguage?: Language;
87
87
  onLanguageChange?: (language: Language) => void;
88
+ showLanguageDropdown?: boolean;
88
89
  };
89
90
 
90
91
  declare const MicButton: React__default.FC<MicButtonProps>;
package/dist/index.js CHANGED
@@ -23682,6 +23682,14 @@ __export(webrtc_service_exports, {
23682
23682
  setServerUrl: () => setServerUrl,
23683
23683
  setWebRTCCallbacks: () => setWebRTCCallbacks
23684
23684
  });
23685
+ function normalizeToNavigationCommand(message) {
23686
+ if (!message || typeof message !== "object") return message;
23687
+ if (message.type === "ai_intent" && message.data != null) return message;
23688
+ if ("actionType" in message && typeof message.actionType === "string") {
23689
+ return { type: "ai_intent", data: message };
23690
+ }
23691
+ return message;
23692
+ }
23685
23693
  function setServerUrl(url) {
23686
23694
  serverUrl = url;
23687
23695
  }
@@ -23803,7 +23811,7 @@ function setupEventListeners() {
23803
23811
  try {
23804
23812
  const message = JSON.parse(jsonPart);
23805
23813
  console.log("\u{1F4E1} WebRTC Parsed JSON message:", message);
23806
- callbacks.onNavigationCommand?.(message);
23814
+ callbacks.onNavigationCommand?.(normalizeToNavigationCommand(message));
23807
23815
  } catch (error) {
23808
23816
  console.log("\u{1F4E1} WebRTC JSON parse error for JSON part:", error, "JSON part:", jsonPart);
23809
23817
  }
@@ -23812,7 +23820,7 @@ function setupEventListeners() {
23812
23820
  try {
23813
23821
  const message = JSON.parse(decodedPayload);
23814
23822
  console.log("\u{1F4E1} WebRTC Parsed message:", message);
23815
- callbacks.onNavigationCommand?.(message);
23823
+ callbacks.onNavigationCommand?.(normalizeToNavigationCommand(message));
23816
23824
  } catch (error) {
23817
23825
  console.log("\u{1F4E1} WebRTC JSON parse error:", error, "Raw payload:", decodedPayload);
23818
23826
  const message = decodedPayload;
@@ -25250,12 +25258,14 @@ var AnsyrProvider = ({
25250
25258
  Promise.resolve().then(() => (init_webrtc_service(), webrtc_service_exports)).then(({ setWebRTCCallbacks: setWebRTCCallbacks2 }) => {
25251
25259
  setWebRTCCallbacks2({
25252
25260
  onNavigationCommand: (command) => {
25253
- if (command.data.actionType === "navigate" && command.data.routeName) {
25261
+ const data = command.data ?? command;
25262
+ if (!data?.actionType) return;
25263
+ if (data.actionType === "navigate" && data.routeName) {
25254
25264
  if (navigationHandler2) {
25255
- navigationHandler2(command.data.routeName);
25265
+ navigationHandler2(data.routeName);
25256
25266
  }
25257
- } else if (command.data.actionType === "click" && command.data.elementId) {
25258
- console.log("AI intent: Click element", command.data.elementId);
25267
+ } else if (data.actionType === "click" && data.elementId) {
25268
+ console.log("AI intent: Click element", data.elementId);
25259
25269
  }
25260
25270
  },
25261
25271
  onConnectionStateChange: (state) => {
@@ -39849,7 +39859,7 @@ var BorderGlow = ({ isActive }) => {
39849
39859
  right: 0,
39850
39860
  bottom: 0,
39851
39861
  width: "4px",
39852
- background: "linear-gradient(to bottom, #06b6d4, #3b82f6, #2563eb)",
39862
+ background: "linear-gradient(to bottom, #A39EEC, #8177ed, #6257d9)",
39853
39863
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
39854
39864
  opacity: 0.8
39855
39865
  },
@@ -39859,7 +39869,7 @@ var BorderGlow = ({ isActive }) => {
39859
39869
  right: 0,
39860
39870
  bottom: 0,
39861
39871
  width: "8px",
39862
- background: "linear-gradient(to bottom, #22d3ee, #3b82f6, #3b82f6)",
39872
+ background: "linear-gradient(to bottom, #c0bbfb, #8177ed, #8177ed)",
39863
39873
  filter: "blur(4px)",
39864
39874
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
39865
39875
  opacity: 0.6
@@ -39870,7 +39880,7 @@ var BorderGlow = ({ isActive }) => {
39870
39880
  right: 0,
39871
39881
  bottom: 0,
39872
39882
  width: "16px",
39873
- background: "linear-gradient(to bottom, #67e8f9, #3b82f6, #60a5fa)",
39883
+ background: "linear-gradient(to bottom, #dad7fe, #8177ed, #9a92f6)",
39874
39884
  filter: "blur(12px)",
39875
39885
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
39876
39886
  opacity: 0.4
@@ -39881,7 +39891,7 @@ var BorderGlow = ({ isActive }) => {
39881
39891
  left: 0,
39882
39892
  bottom: 0,
39883
39893
  width: "4px",
39884
- background: "linear-gradient(to bottom, #f59e0b, #3b82f6, #2563eb)",
39894
+ background: "linear-gradient(to bottom, #A39EEC, #8177ed, #6257d9)",
39885
39895
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
39886
39896
  opacity: 0.8
39887
39897
  },
@@ -39891,7 +39901,7 @@ var BorderGlow = ({ isActive }) => {
39891
39901
  left: 0,
39892
39902
  bottom: 0,
39893
39903
  width: "8px",
39894
- background: "linear-gradient(to bottom, #f59e0b, #3b82f6, #3b82f6)",
39904
+ background: "linear-gradient(to bottom, #c0bbfb, #8177ed, #8177ed)",
39895
39905
  filter: "blur(4px)",
39896
39906
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
39897
39907
  opacity: 0.6
@@ -39902,7 +39912,7 @@ var BorderGlow = ({ isActive }) => {
39902
39912
  left: 0,
39903
39913
  bottom: 0,
39904
39914
  width: "16px",
39905
- background: "linear-gradient(to bottom, #f59e0b, #3b82f6, #60a5fa)",
39915
+ background: "linear-gradient(to bottom, #dad7fe, #8177ed, #9a92f6)",
39906
39916
  filter: "blur(12px)",
39907
39917
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
39908
39918
  opacity: 0.4
@@ -39913,7 +39923,7 @@ var BorderGlow = ({ isActive }) => {
39913
39923
  left: 0,
39914
39924
  width: "32px",
39915
39925
  height: "32px",
39916
- background: "#f59e0b",
39926
+ background: "#9a92f6",
39917
39927
  borderBottomRightRadius: "50%",
39918
39928
  filter: "blur(16px)",
39919
39929
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
@@ -39925,7 +39935,7 @@ var BorderGlow = ({ isActive }) => {
39925
39935
  right: 0,
39926
39936
  width: "32px",
39927
39937
  height: "32px",
39928
- background: "#06b6d4",
39938
+ background: "#A39EEC",
39929
39939
  borderBottomLeftRadius: "50%",
39930
39940
  filter: "blur(16px)",
39931
39941
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
@@ -39937,7 +39947,7 @@ var BorderGlow = ({ isActive }) => {
39937
39947
  right: 0,
39938
39948
  width: "32px",
39939
39949
  height: "32px",
39940
- background: "#3b82f6",
39950
+ background: "#8177ed",
39941
39951
  borderTopLeftRadius: "50%",
39942
39952
  filter: "blur(16px)",
39943
39953
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
@@ -39949,7 +39959,7 @@ var BorderGlow = ({ isActive }) => {
39949
39959
  left: 0,
39950
39960
  width: "32px",
39951
39961
  height: "32px",
39952
- background: "#2563eb",
39962
+ background: "#6257d9",
39953
39963
  borderTopRightRadius: "50%",
39954
39964
  filter: "blur(16px)",
39955
39965
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
@@ -42055,7 +42065,8 @@ var MicButton = ({
42055
42065
  showBorderGlow = false,
42056
42066
  language,
42057
42067
  defaultLanguage,
42058
- onLanguageChange
42068
+ onLanguageChange,
42069
+ showLanguageDropdown = true
42059
42070
  }) => {
42060
42071
  const { apiKey, appId } = useAnsyrContext();
42061
42072
  const [showBodyGlow, setShowBodyGlow] = (0, import_react20.useState)(false);
@@ -42214,6 +42225,7 @@ var MicButton = ({
42214
42225
  );
42215
42226
  const handleLanguageConfirm = (0, import_react20.useCallback)(() => {
42216
42227
  setShowLanguageSelector(false);
42228
+ openChat();
42217
42229
  voiceConnect(`user_${Date.now()}`, apiKey, appId, selectedLanguage).then(() => {
42218
42230
  if (showBorderGlow) setShowBodyGlow(true);
42219
42231
  openChat();
@@ -42230,10 +42242,11 @@ var MicButton = ({
42230
42242
  }).catch((error) => {
42231
42243
  });
42232
42244
  } else {
42233
- if (!language && !defaultLanguage && !selectedLanguage) {
42245
+ if (showLanguageDropdown && !language && !defaultLanguage && !selectedLanguage) {
42234
42246
  setShowLanguageSelector(true);
42235
42247
  return;
42236
42248
  }
42249
+ openChat();
42237
42250
  voiceConnect(`user_${Date.now()}`, apiKey, appId, selectedLanguage).then(() => {
42238
42251
  if (showBorderGlow) setShowBodyGlow(true);
42239
42252
  openChat();
@@ -42252,6 +42265,7 @@ var MicButton = ({
42252
42265
  appId,
42253
42266
  language,
42254
42267
  selectedLanguage,
42268
+ showLanguageDropdown,
42255
42269
  openChat,
42256
42270
  showBorderGlow,
42257
42271
  sendChatMessage,
@@ -42358,7 +42372,7 @@ var MicButton = ({
42358
42372
  width: `${buttonSize}px`,
42359
42373
  height: `${buttonSize}px`,
42360
42374
  borderRadius: "50%",
42361
- background: "oklch(0.23 0.08 252.75)",
42375
+ background: "var(--gradient-mic-button)",
42362
42376
  transition: "all 0.5s",
42363
42377
  border: "none",
42364
42378
  boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
@@ -42377,18 +42391,18 @@ var MicButton = ({
42377
42391
  switch (micState) {
42378
42392
  case "listening":
42379
42393
  baseStyle.transform = "scale(1.05)";
42380
- baseStyle.boxShadow = "0 25px 50px -12px rgba(59, 130, 246, 0.6)";
42394
+ baseStyle.boxShadow = "0 25px 50px -12px rgba(129, 119, 237, 0.6)";
42381
42395
  break;
42382
42396
  case "thinking":
42383
42397
  baseStyle.transform = "scale(1.02)";
42384
- baseStyle.boxShadow = "0 20px 25px -5px rgba(196, 132, 252, 0.4)";
42398
+ baseStyle.boxShadow = "0 20px 25px -5px rgba(154, 146, 246, 0.4)";
42385
42399
  break;
42386
42400
  case "replying":
42387
42401
  baseStyle.transform = "scale(1.02)";
42388
- baseStyle.boxShadow = "0 20px 25px -5px rgba(34, 211, 238, 0.4)";
42402
+ baseStyle.boxShadow = "0 20px 25px -5px rgba(129, 119, 237, 0.4)";
42389
42403
  break;
42390
42404
  default:
42391
- baseStyle.boxShadow = "0 10px 15px -3px rgba(59, 130, 246, 0.3)";
42405
+ baseStyle.boxShadow = "0 10px 15px -3px rgba(129, 119, 237, 0.3)";
42392
42406
  break;
42393
42407
  }
42394
42408
  return baseStyle;
@@ -42400,7 +42414,7 @@ var MicButton = ({
42400
42414
  className: `cuekit-voice-popup ${currentTheme === "dark" ? "cuekit-dark" : ""}`,
42401
42415
  style: { ...buttonStyles.container, ...getPositionStyle() }
42402
42416
  },
42403
- showLanguageSelector ? /* @__PURE__ */ import_react20.default.createElement("div", { className: "voice-chat-language-selection" }, /* @__PURE__ */ import_react20.default.createElement("div", { className: "voice-chat-language-header" }, /* @__PURE__ */ import_react20.default.createElement("div", { className: "voice-chat-language-icon" }, /* @__PURE__ */ import_react20.default.createElement(mic_default, { width: 20, height: 20 })), /* @__PURE__ */ import_react20.default.createElement("span", { className: "voice-chat-language-title" }, "Select Language")), /* @__PURE__ */ import_react20.default.createElement(
42417
+ showLanguageSelector && showLanguageDropdown ? /* @__PURE__ */ import_react20.default.createElement("div", { className: "voice-chat-language-selection" }, /* @__PURE__ */ import_react20.default.createElement("div", { className: "voice-chat-language-header" }, /* @__PURE__ */ import_react20.default.createElement("div", { className: "voice-chat-language-icon" }, /* @__PURE__ */ import_react20.default.createElement(mic_default, { width: 20, height: 20 })), /* @__PURE__ */ import_react20.default.createElement("span", { className: "voice-chat-language-title" }, "Select Language")), /* @__PURE__ */ import_react20.default.createElement(
42404
42418
  LanguageSelector,
42405
42419
  {
42406
42420
  selectedLanguage,
@@ -42416,7 +42430,7 @@ var MicButton = ({
42416
42430
  onClick: () => setShowLanguageSelector(false)
42417
42431
  },
42418
42432
  "Cancel"
42419
- ), /* @__PURE__ */ import_react20.default.createElement("button", { className: "voice-chat-confirm-button", onClick: handleLanguageConfirm }, "Start Voice Chat"))) : /* @__PURE__ */ import_react20.default.createElement("div", { className: "voice-chat-main-button" }, /* @__PURE__ */ import_react20.default.createElement(
42433
+ ), /* @__PURE__ */ import_react20.default.createElement("button", { className: "voice-chat-confirm-button", onClick: handleLanguageConfirm }, "Start Voice Chat"))) : /* @__PURE__ */ import_react20.default.createElement("div", { className: "voice-chat-main-button" }, showLanguageDropdown && /* @__PURE__ */ import_react20.default.createElement(
42420
42434
  LanguageSelector,
42421
42435
  {
42422
42436
  selectedLanguage,
@@ -42432,18 +42446,18 @@ var MicButton = ({
42432
42446
  {
42433
42447
  "data-testid": "ignore",
42434
42448
  onClick: handleMicClick,
42435
- disabled: micState === "thinking" || micState === "replying",
42449
+ disabled: micState === "thinking" || micState === "replying" || isConnecting,
42436
42450
  style: getDynamicButtonStyle(),
42437
42451
  onMouseEnter: (e3) => {
42438
42452
  if (micState === "idle") {
42439
42453
  e3.currentTarget.style.transform = "scale(1.05)";
42440
- e3.currentTarget.style.boxShadow = "0 20px 25px -5px rgba(59, 130, 246, 0.4)";
42454
+ e3.currentTarget.style.boxShadow = "0 20px 25px -5px rgba(129, 119, 237, 0.4)";
42441
42455
  }
42442
42456
  },
42443
42457
  onMouseLeave: (e3) => {
42444
42458
  if (micState === "idle") {
42445
42459
  e3.currentTarget.style.transform = "scale(1)";
42446
- e3.currentTarget.style.boxShadow = "0 10px 15px -3px rgba(59, 130, 246, 0.3)";
42460
+ e3.currentTarget.style.boxShadow = "0 10px 15px -3px rgba(129, 119, 237, 0.3)";
42447
42461
  }
42448
42462
  },
42449
42463
  "aria-label": micState === "thinking" ? "Processing..." : micState === "replying" ? "AI is responding..." : isListening ? "Stop listening" : "Start listening"
@@ -42510,7 +42524,7 @@ var MicButton = ({
42510
42524
  onClick: restoreChat,
42511
42525
  style: {
42512
42526
  position: "fixed",
42513
- zIndex: 5e5,
42527
+ zIndex: 999,
42514
42528
  bottom: bottomSpace + buttonSize + 30,
42515
42529
  right: screenPosition === "bottom-right" ? 20 : void 0,
42516
42530
  left: screenPosition === "bottom-left" ? 20 : screenPosition === "bottom-center" ? "50%" : void 0,
package/dist/index.mjs CHANGED
@@ -37,7 +37,7 @@ import {
37
37
  setWebRTCCallbacks,
38
38
  setWebRTCConfig,
39
39
  validateDynamicElements
40
- } from "./chunk-WBAYQSGF.mjs";
40
+ } from "./chunk-JVYSFKMO.mjs";
41
41
 
42
42
  // node_modules/inline-style-parser/index.js
43
43
  var require_inline_style_parser = __commonJS({
@@ -1293,15 +1293,17 @@ var AnsyrProvider = ({
1293
1293
  };
1294
1294
  }, [navigationHandler]);
1295
1295
  useEffect(() => {
1296
- import("./webrtc-service-CJ34OHJN.mjs").then(({ setWebRTCCallbacks: setWebRTCCallbacks2 }) => {
1296
+ import("./webrtc-service-KN5SEJKS.mjs").then(({ setWebRTCCallbacks: setWebRTCCallbacks2 }) => {
1297
1297
  setWebRTCCallbacks2({
1298
1298
  onNavigationCommand: (command) => {
1299
- if (command.data.actionType === "navigate" && command.data.routeName) {
1299
+ const data = command.data ?? command;
1300
+ if (!data?.actionType) return;
1301
+ if (data.actionType === "navigate" && data.routeName) {
1300
1302
  if (navigationHandler) {
1301
- navigationHandler(command.data.routeName);
1303
+ navigationHandler(data.routeName);
1302
1304
  }
1303
- } else if (command.data.actionType === "click" && command.data.elementId) {
1304
- console.log("AI intent: Click element", command.data.elementId);
1305
+ } else if (data.actionType === "click" && data.elementId) {
1306
+ console.log("AI intent: Click element", data.elementId);
1305
1307
  }
1306
1308
  },
1307
1309
  onConnectionStateChange: (state) => {
@@ -15889,7 +15891,7 @@ var BorderGlow = ({ isActive }) => {
15889
15891
  right: 0,
15890
15892
  bottom: 0,
15891
15893
  width: "4px",
15892
- background: "linear-gradient(to bottom, #06b6d4, #3b82f6, #2563eb)",
15894
+ background: "linear-gradient(to bottom, #A39EEC, #8177ed, #6257d9)",
15893
15895
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
15894
15896
  opacity: 0.8
15895
15897
  },
@@ -15899,7 +15901,7 @@ var BorderGlow = ({ isActive }) => {
15899
15901
  right: 0,
15900
15902
  bottom: 0,
15901
15903
  width: "8px",
15902
- background: "linear-gradient(to bottom, #22d3ee, #3b82f6, #3b82f6)",
15904
+ background: "linear-gradient(to bottom, #c0bbfb, #8177ed, #8177ed)",
15903
15905
  filter: "blur(4px)",
15904
15906
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
15905
15907
  opacity: 0.6
@@ -15910,7 +15912,7 @@ var BorderGlow = ({ isActive }) => {
15910
15912
  right: 0,
15911
15913
  bottom: 0,
15912
15914
  width: "16px",
15913
- background: "linear-gradient(to bottom, #67e8f9, #3b82f6, #60a5fa)",
15915
+ background: "linear-gradient(to bottom, #dad7fe, #8177ed, #9a92f6)",
15914
15916
  filter: "blur(12px)",
15915
15917
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
15916
15918
  opacity: 0.4
@@ -15921,7 +15923,7 @@ var BorderGlow = ({ isActive }) => {
15921
15923
  left: 0,
15922
15924
  bottom: 0,
15923
15925
  width: "4px",
15924
- background: "linear-gradient(to bottom, #f59e0b, #3b82f6, #2563eb)",
15926
+ background: "linear-gradient(to bottom, #A39EEC, #8177ed, #6257d9)",
15925
15927
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
15926
15928
  opacity: 0.8
15927
15929
  },
@@ -15931,7 +15933,7 @@ var BorderGlow = ({ isActive }) => {
15931
15933
  left: 0,
15932
15934
  bottom: 0,
15933
15935
  width: "8px",
15934
- background: "linear-gradient(to bottom, #f59e0b, #3b82f6, #3b82f6)",
15936
+ background: "linear-gradient(to bottom, #c0bbfb, #8177ed, #8177ed)",
15935
15937
  filter: "blur(4px)",
15936
15938
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
15937
15939
  opacity: 0.6
@@ -15942,7 +15944,7 @@ var BorderGlow = ({ isActive }) => {
15942
15944
  left: 0,
15943
15945
  bottom: 0,
15944
15946
  width: "16px",
15945
- background: "linear-gradient(to bottom, #f59e0b, #3b82f6, #60a5fa)",
15947
+ background: "linear-gradient(to bottom, #dad7fe, #8177ed, #9a92f6)",
15946
15948
  filter: "blur(12px)",
15947
15949
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
15948
15950
  opacity: 0.4
@@ -15953,7 +15955,7 @@ var BorderGlow = ({ isActive }) => {
15953
15955
  left: 0,
15954
15956
  width: "32px",
15955
15957
  height: "32px",
15956
- background: "#f59e0b",
15958
+ background: "#9a92f6",
15957
15959
  borderBottomRightRadius: "50%",
15958
15960
  filter: "blur(16px)",
15959
15961
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
@@ -15965,7 +15967,7 @@ var BorderGlow = ({ isActive }) => {
15965
15967
  right: 0,
15966
15968
  width: "32px",
15967
15969
  height: "32px",
15968
- background: "#06b6d4",
15970
+ background: "#A39EEC",
15969
15971
  borderBottomLeftRadius: "50%",
15970
15972
  filter: "blur(16px)",
15971
15973
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
@@ -15977,7 +15979,7 @@ var BorderGlow = ({ isActive }) => {
15977
15979
  right: 0,
15978
15980
  width: "32px",
15979
15981
  height: "32px",
15980
- background: "#3b82f6",
15982
+ background: "#8177ed",
15981
15983
  borderTopLeftRadius: "50%",
15982
15984
  filter: "blur(16px)",
15983
15985
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
@@ -15989,7 +15991,7 @@ var BorderGlow = ({ isActive }) => {
15989
15991
  left: 0,
15990
15992
  width: "32px",
15991
15993
  height: "32px",
15992
- background: "#2563eb",
15994
+ background: "#6257d9",
15993
15995
  borderTopRightRadius: "50%",
15994
15996
  filter: "blur(16px)",
15995
15997
  animation: "borderPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
@@ -18086,7 +18088,8 @@ var MicButton = ({
18086
18088
  showBorderGlow = false,
18087
18089
  language,
18088
18090
  defaultLanguage,
18089
- onLanguageChange
18091
+ onLanguageChange,
18092
+ showLanguageDropdown = true
18090
18093
  }) => {
18091
18094
  const { apiKey, appId } = useAnsyrContext();
18092
18095
  const [showBodyGlow, setShowBodyGlow] = useState12(false);
@@ -18245,6 +18248,7 @@ var MicButton = ({
18245
18248
  );
18246
18249
  const handleLanguageConfirm = useCallback6(() => {
18247
18250
  setShowLanguageSelector(false);
18251
+ openChat();
18248
18252
  voiceConnect(`user_${Date.now()}`, apiKey, appId, selectedLanguage).then(() => {
18249
18253
  if (showBorderGlow) setShowBodyGlow(true);
18250
18254
  openChat();
@@ -18261,10 +18265,11 @@ var MicButton = ({
18261
18265
  }).catch((error) => {
18262
18266
  });
18263
18267
  } else {
18264
- if (!language && !defaultLanguage && !selectedLanguage) {
18268
+ if (showLanguageDropdown && !language && !defaultLanguage && !selectedLanguage) {
18265
18269
  setShowLanguageSelector(true);
18266
18270
  return;
18267
18271
  }
18272
+ openChat();
18268
18273
  voiceConnect(`user_${Date.now()}`, apiKey, appId, selectedLanguage).then(() => {
18269
18274
  if (showBorderGlow) setShowBodyGlow(true);
18270
18275
  openChat();
@@ -18283,6 +18288,7 @@ var MicButton = ({
18283
18288
  appId,
18284
18289
  language,
18285
18290
  selectedLanguage,
18291
+ showLanguageDropdown,
18286
18292
  openChat,
18287
18293
  showBorderGlow,
18288
18294
  sendChatMessage,
@@ -18389,7 +18395,7 @@ var MicButton = ({
18389
18395
  width: `${buttonSize}px`,
18390
18396
  height: `${buttonSize}px`,
18391
18397
  borderRadius: "50%",
18392
- background: "oklch(0.23 0.08 252.75)",
18398
+ background: "var(--gradient-mic-button)",
18393
18399
  transition: "all 0.5s",
18394
18400
  border: "none",
18395
18401
  boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.25)",
@@ -18408,18 +18414,18 @@ var MicButton = ({
18408
18414
  switch (micState) {
18409
18415
  case "listening":
18410
18416
  baseStyle.transform = "scale(1.05)";
18411
- baseStyle.boxShadow = "0 25px 50px -12px rgba(59, 130, 246, 0.6)";
18417
+ baseStyle.boxShadow = "0 25px 50px -12px rgba(129, 119, 237, 0.6)";
18412
18418
  break;
18413
18419
  case "thinking":
18414
18420
  baseStyle.transform = "scale(1.02)";
18415
- baseStyle.boxShadow = "0 20px 25px -5px rgba(196, 132, 252, 0.4)";
18421
+ baseStyle.boxShadow = "0 20px 25px -5px rgba(154, 146, 246, 0.4)";
18416
18422
  break;
18417
18423
  case "replying":
18418
18424
  baseStyle.transform = "scale(1.02)";
18419
- baseStyle.boxShadow = "0 20px 25px -5px rgba(34, 211, 238, 0.4)";
18425
+ baseStyle.boxShadow = "0 20px 25px -5px rgba(129, 119, 237, 0.4)";
18420
18426
  break;
18421
18427
  default:
18422
- baseStyle.boxShadow = "0 10px 15px -3px rgba(59, 130, 246, 0.3)";
18428
+ baseStyle.boxShadow = "0 10px 15px -3px rgba(129, 119, 237, 0.3)";
18423
18429
  break;
18424
18430
  }
18425
18431
  return baseStyle;
@@ -18431,7 +18437,7 @@ var MicButton = ({
18431
18437
  className: `cuekit-voice-popup ${currentTheme === "dark" ? "cuekit-dark" : ""}`,
18432
18438
  style: { ...buttonStyles.container, ...getPositionStyle() }
18433
18439
  },
18434
- showLanguageSelector ? /* @__PURE__ */ React15.createElement("div", { className: "voice-chat-language-selection" }, /* @__PURE__ */ React15.createElement("div", { className: "voice-chat-language-header" }, /* @__PURE__ */ React15.createElement("div", { className: "voice-chat-language-icon" }, /* @__PURE__ */ React15.createElement(mic_default, { width: 20, height: 20 })), /* @__PURE__ */ React15.createElement("span", { className: "voice-chat-language-title" }, "Select Language")), /* @__PURE__ */ React15.createElement(
18440
+ showLanguageSelector && showLanguageDropdown ? /* @__PURE__ */ React15.createElement("div", { className: "voice-chat-language-selection" }, /* @__PURE__ */ React15.createElement("div", { className: "voice-chat-language-header" }, /* @__PURE__ */ React15.createElement("div", { className: "voice-chat-language-icon" }, /* @__PURE__ */ React15.createElement(mic_default, { width: 20, height: 20 })), /* @__PURE__ */ React15.createElement("span", { className: "voice-chat-language-title" }, "Select Language")), /* @__PURE__ */ React15.createElement(
18435
18441
  LanguageSelector,
18436
18442
  {
18437
18443
  selectedLanguage,
@@ -18447,7 +18453,7 @@ var MicButton = ({
18447
18453
  onClick: () => setShowLanguageSelector(false)
18448
18454
  },
18449
18455
  "Cancel"
18450
- ), /* @__PURE__ */ React15.createElement("button", { className: "voice-chat-confirm-button", onClick: handleLanguageConfirm }, "Start Voice Chat"))) : /* @__PURE__ */ React15.createElement("div", { className: "voice-chat-main-button" }, /* @__PURE__ */ React15.createElement(
18456
+ ), /* @__PURE__ */ React15.createElement("button", { className: "voice-chat-confirm-button", onClick: handleLanguageConfirm }, "Start Voice Chat"))) : /* @__PURE__ */ React15.createElement("div", { className: "voice-chat-main-button" }, showLanguageDropdown && /* @__PURE__ */ React15.createElement(
18451
18457
  LanguageSelector,
18452
18458
  {
18453
18459
  selectedLanguage,
@@ -18463,18 +18469,18 @@ var MicButton = ({
18463
18469
  {
18464
18470
  "data-testid": "ignore",
18465
18471
  onClick: handleMicClick,
18466
- disabled: micState === "thinking" || micState === "replying",
18472
+ disabled: micState === "thinking" || micState === "replying" || isConnecting,
18467
18473
  style: getDynamicButtonStyle(),
18468
18474
  onMouseEnter: (e2) => {
18469
18475
  if (micState === "idle") {
18470
18476
  e2.currentTarget.style.transform = "scale(1.05)";
18471
- e2.currentTarget.style.boxShadow = "0 20px 25px -5px rgba(59, 130, 246, 0.4)";
18477
+ e2.currentTarget.style.boxShadow = "0 20px 25px -5px rgba(129, 119, 237, 0.4)";
18472
18478
  }
18473
18479
  },
18474
18480
  onMouseLeave: (e2) => {
18475
18481
  if (micState === "idle") {
18476
18482
  e2.currentTarget.style.transform = "scale(1)";
18477
- e2.currentTarget.style.boxShadow = "0 10px 15px -3px rgba(59, 130, 246, 0.3)";
18483
+ e2.currentTarget.style.boxShadow = "0 10px 15px -3px rgba(129, 119, 237, 0.3)";
18478
18484
  }
18479
18485
  },
18480
18486
  "aria-label": micState === "thinking" ? "Processing..." : micState === "replying" ? "AI is responding..." : isListening ? "Stop listening" : "Start listening"
@@ -18541,7 +18547,7 @@ var MicButton = ({
18541
18547
  onClick: restoreChat,
18542
18548
  style: {
18543
18549
  position: "fixed",
18544
- zIndex: 5e5,
18550
+ zIndex: 999,
18545
18551
  bottom: bottomSpace + buttonSize + 30,
18546
18552
  right: screenPosition === "bottom-right" ? 20 : void 0,
18547
18553
  left: screenPosition === "bottom-left" ? 20 : screenPosition === "bottom-center" ? "50%" : void 0,
@@ -15,7 +15,7 @@ import {
15
15
  setAudioContainer,
16
16
  setServerUrl,
17
17
  setWebRTCCallbacks
18
- } from "./chunk-WBAYQSGF.mjs";
18
+ } from "./chunk-JVYSFKMO.mjs";
19
19
  export {
20
20
  authenticate,
21
21
  connectToRoom,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cuekit-ai/react",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {