@cuekit-ai/react 1.6.7 → 1.6.8
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/{chunk-JVYSFKMO.mjs → chunk-ZP7AXODE.mjs} +673 -993
- package/dist/index.d.mts +32 -10
- package/dist/index.d.ts +32 -10
- package/dist/index.js +782 -924
- package/dist/index.mjs +232 -55
- package/dist/{webrtc-service-KN5SEJKS.mjs → webrtc-service-IMARTHNM.mjs} +1 -1
- package/package.json +6 -4
package/dist/index.mjs
CHANGED
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
setWebRTCCallbacks,
|
|
38
38
|
setWebRTCConfig,
|
|
39
39
|
validateDynamicElements
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-ZP7AXODE.mjs";
|
|
41
41
|
|
|
42
42
|
// node_modules/inline-style-parser/index.js
|
|
43
43
|
var require_inline_style_parser = __commonJS({
|
|
@@ -389,7 +389,7 @@ var require_core = __commonJS({
|
|
|
389
389
|
root4.CryptoJS = factory();
|
|
390
390
|
}
|
|
391
391
|
})(exports, function() {
|
|
392
|
-
var CryptoJS = CryptoJS ||
|
|
392
|
+
var CryptoJS = CryptoJS || function(Math2, undefined2) {
|
|
393
393
|
var crypto;
|
|
394
394
|
if (typeof window !== "undefined" && window.crypto) {
|
|
395
395
|
crypto = window.crypto;
|
|
@@ -429,7 +429,7 @@ var require_core = __commonJS({
|
|
|
429
429
|
}
|
|
430
430
|
throw new Error("Native crypto module could not be used to get secure random number.");
|
|
431
431
|
};
|
|
432
|
-
var create2 = Object.create || /* @__PURE__ */
|
|
432
|
+
var create2 = Object.create || /* @__PURE__ */ function() {
|
|
433
433
|
function F2() {
|
|
434
434
|
}
|
|
435
435
|
return function(obj) {
|
|
@@ -439,10 +439,10 @@ var require_core = __commonJS({
|
|
|
439
439
|
F2.prototype = null;
|
|
440
440
|
return subtype;
|
|
441
441
|
};
|
|
442
|
-
}
|
|
442
|
+
}();
|
|
443
443
|
var C = {};
|
|
444
444
|
var C_lib = C.lib = {};
|
|
445
|
-
var Base = C_lib.Base = /* @__PURE__ */
|
|
445
|
+
var Base = C_lib.Base = /* @__PURE__ */ function() {
|
|
446
446
|
return {
|
|
447
447
|
/**
|
|
448
448
|
* Creates a new object that inherits from this object.
|
|
@@ -541,7 +541,7 @@ var require_core = __commonJS({
|
|
|
541
541
|
return this.init.prototype.extend(this);
|
|
542
542
|
}
|
|
543
543
|
};
|
|
544
|
-
}
|
|
544
|
+
}();
|
|
545
545
|
var WordArray = C_lib.WordArray = Base.extend({
|
|
546
546
|
/**
|
|
547
547
|
* Initializes a newly created word array.
|
|
@@ -979,7 +979,7 @@ var require_core = __commonJS({
|
|
|
979
979
|
});
|
|
980
980
|
var C_algo = C.algo = {};
|
|
981
981
|
return C;
|
|
982
|
-
}
|
|
982
|
+
}(Math);
|
|
983
983
|
return CryptoJS;
|
|
984
984
|
});
|
|
985
985
|
}
|
|
@@ -1222,6 +1222,45 @@ var initWebRTC = (apiKey) => {
|
|
|
1222
1222
|
return initWebRTCWithDeployedBackend(apiKey);
|
|
1223
1223
|
};
|
|
1224
1224
|
|
|
1225
|
+
// src/utils/colors.ts
|
|
1226
|
+
function hexToHSL(hex) {
|
|
1227
|
+
hex = hex.replace(/^#/, "");
|
|
1228
|
+
if (hex.length === 3) {
|
|
1229
|
+
hex = hex.split("").map((char) => char + char).join("");
|
|
1230
|
+
}
|
|
1231
|
+
if (hex.length !== 6) return null;
|
|
1232
|
+
const r2 = parseInt(hex.substring(0, 2), 16) / 255;
|
|
1233
|
+
const g = parseInt(hex.substring(2, 4), 16) / 255;
|
|
1234
|
+
const b2 = parseInt(hex.substring(4, 6), 16) / 255;
|
|
1235
|
+
const max = Math.max(r2, g, b2), min = Math.min(r2, g, b2);
|
|
1236
|
+
let h = 0, s = 0, l = (max + min) / 2;
|
|
1237
|
+
if (max !== min) {
|
|
1238
|
+
const d = max - min;
|
|
1239
|
+
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
1240
|
+
switch (max) {
|
|
1241
|
+
case r2:
|
|
1242
|
+
h = (g - b2) / d + (g < b2 ? 6 : 0);
|
|
1243
|
+
break;
|
|
1244
|
+
case g:
|
|
1245
|
+
h = (b2 - r2) / d + 2;
|
|
1246
|
+
break;
|
|
1247
|
+
case b2:
|
|
1248
|
+
h = (r2 - g) / d + 4;
|
|
1249
|
+
break;
|
|
1250
|
+
}
|
|
1251
|
+
h /= 6;
|
|
1252
|
+
}
|
|
1253
|
+
const res = {
|
|
1254
|
+
h: Math.round(h * 360),
|
|
1255
|
+
s: Math.round(s * 100),
|
|
1256
|
+
l: Math.round(l * 100)
|
|
1257
|
+
};
|
|
1258
|
+
return {
|
|
1259
|
+
...res,
|
|
1260
|
+
toString: () => `${res.h} ${res.s}% ${res.l}%`
|
|
1261
|
+
};
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1225
1264
|
// src/providers/ansyr-provider.tsx
|
|
1226
1265
|
if (typeof window !== "undefined" && !globalThis.AnsyrStore) {
|
|
1227
1266
|
globalThis.AnsyrStore = {
|
|
@@ -1271,9 +1310,52 @@ var AnsyrProvider = ({
|
|
|
1271
1310
|
title = "ansyr.ai",
|
|
1272
1311
|
showLogo = true,
|
|
1273
1312
|
showAIIcon = true,
|
|
1274
|
-
showUserIcon = true
|
|
1313
|
+
showUserIcon = true,
|
|
1314
|
+
theme,
|
|
1315
|
+
emptyStateMessage
|
|
1275
1316
|
}) => {
|
|
1276
1317
|
const [internalDeviceId, setInternalDeviceId] = useState(deviceId);
|
|
1318
|
+
const generateThemeStyles2 = (theme2) => {
|
|
1319
|
+
if (!theme2) return {};
|
|
1320
|
+
const mapColorsToVars = (colors) => {
|
|
1321
|
+
const mapping = {
|
|
1322
|
+
primary: "--voice-accent",
|
|
1323
|
+
background: "--voice-bg",
|
|
1324
|
+
surface: "--voice-surface",
|
|
1325
|
+
border: "--voice-border",
|
|
1326
|
+
text: "--voice-text",
|
|
1327
|
+
textMuted: "--voice-text-muted",
|
|
1328
|
+
userBubble: "--voice-user-bubble",
|
|
1329
|
+
userText: "--voice-user-text",
|
|
1330
|
+
aiBubble: "--voice-ai-bubble",
|
|
1331
|
+
aiText: "--voice-ai-text"
|
|
1332
|
+
};
|
|
1333
|
+
const styles2 = {};
|
|
1334
|
+
Object.entries(colors).forEach(([key, value]) => {
|
|
1335
|
+
const varName = mapping[key];
|
|
1336
|
+
if (varName && value) {
|
|
1337
|
+
const hsl = hexToHSL(value);
|
|
1338
|
+
if (hsl) {
|
|
1339
|
+
styles2[varName] = hsl.toString();
|
|
1340
|
+
if (key === "primary") {
|
|
1341
|
+
styles2["--indicator-bg"] = hsl.toString();
|
|
1342
|
+
styles2["--voice-accent-light"] = `${hsl.h} ${hsl.s}% 96%`;
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
});
|
|
1347
|
+
return styles2;
|
|
1348
|
+
};
|
|
1349
|
+
const styles = {};
|
|
1350
|
+
if (theme2.light) {
|
|
1351
|
+
const lightStyles = mapColorsToVars(theme2.light);
|
|
1352
|
+
Object.entries(lightStyles).forEach(([key, value]) => {
|
|
1353
|
+
styles[key] = value;
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
return styles;
|
|
1357
|
+
};
|
|
1358
|
+
const themeStyles = generateThemeStyles2(theme);
|
|
1277
1359
|
useEffect(() => {
|
|
1278
1360
|
InitCuekit({ apiKey, appId });
|
|
1279
1361
|
}, [apiKey, appId]);
|
|
@@ -1293,7 +1375,7 @@ var AnsyrProvider = ({
|
|
|
1293
1375
|
};
|
|
1294
1376
|
}, [navigationHandler]);
|
|
1295
1377
|
useEffect(() => {
|
|
1296
|
-
import("./webrtc-service-
|
|
1378
|
+
import("./webrtc-service-IMARTHNM.mjs").then(({ setWebRTCCallbacks: setWebRTCCallbacks2 }) => {
|
|
1297
1379
|
setWebRTCCallbacks2({
|
|
1298
1380
|
onNavigationCommand: (command) => {
|
|
1299
1381
|
const data = command.data ?? command;
|
|
@@ -1380,10 +1462,12 @@ var AnsyrProvider = ({
|
|
|
1380
1462
|
title,
|
|
1381
1463
|
showLogo,
|
|
1382
1464
|
showAIIcon,
|
|
1383
|
-
showUserIcon
|
|
1465
|
+
showUserIcon,
|
|
1466
|
+
theme,
|
|
1467
|
+
emptyStateMessage
|
|
1384
1468
|
}
|
|
1385
1469
|
},
|
|
1386
|
-
children
|
|
1470
|
+
/* @__PURE__ */ React.createElement("div", { style: themeStyles }, children)
|
|
1387
1471
|
);
|
|
1388
1472
|
};
|
|
1389
1473
|
|
|
@@ -9387,7 +9471,7 @@ var convert = (
|
|
|
9387
9471
|
* @param {Test} [test]
|
|
9388
9472
|
* @returns {Check}
|
|
9389
9473
|
*/
|
|
9390
|
-
|
|
9474
|
+
function(test) {
|
|
9391
9475
|
if (test === null || test === void 0) {
|
|
9392
9476
|
return ok2;
|
|
9393
9477
|
}
|
|
@@ -9401,7 +9485,7 @@ var convert = (
|
|
|
9401
9485
|
return typeFactory(test);
|
|
9402
9486
|
}
|
|
9403
9487
|
throw new Error("Expected function, string, or object as test");
|
|
9404
|
-
}
|
|
9488
|
+
}
|
|
9405
9489
|
);
|
|
9406
9490
|
function anyFactory(tests) {
|
|
9407
9491
|
const checks2 = [];
|
|
@@ -10581,7 +10665,7 @@ var CallableInstance = (
|
|
|
10581
10665
|
* @param {string | symbol} property
|
|
10582
10666
|
* @returns {(...parameters: Array<unknown>) => unknown}
|
|
10583
10667
|
*/
|
|
10584
|
-
|
|
10668
|
+
function(property) {
|
|
10585
10669
|
const self2 = this;
|
|
10586
10670
|
const constr = self2.constructor;
|
|
10587
10671
|
const proto = (
|
|
@@ -10596,7 +10680,7 @@ var CallableInstance = (
|
|
|
10596
10680
|
};
|
|
10597
10681
|
Object.setPrototypeOf(apply, proto);
|
|
10598
10682
|
return apply;
|
|
10599
|
-
}
|
|
10683
|
+
}
|
|
10600
10684
|
);
|
|
10601
10685
|
|
|
10602
10686
|
// node_modules/unified/lib/index.js
|
|
@@ -15188,6 +15272,38 @@ var useDraggableResizableContainer = (storageKey) => {
|
|
|
15188
15272
|
};
|
|
15189
15273
|
|
|
15190
15274
|
// src/components/chat-popup.tsx
|
|
15275
|
+
var generateThemeStyles = (theme, currentTheme = "dark") => {
|
|
15276
|
+
if (!theme) return {};
|
|
15277
|
+
const colors = currentTheme === "light" ? theme.light : theme.dark;
|
|
15278
|
+
if (!colors) return {};
|
|
15279
|
+
const mapping = {
|
|
15280
|
+
primary: "--voice-accent",
|
|
15281
|
+
background: "--voice-bg",
|
|
15282
|
+
surface: "--voice-surface",
|
|
15283
|
+
border: "--voice-border",
|
|
15284
|
+
text: "--voice-text",
|
|
15285
|
+
textMuted: "--voice-text-muted",
|
|
15286
|
+
userBubble: "--voice-user-bubble",
|
|
15287
|
+
userText: "--voice-user-text",
|
|
15288
|
+
aiBubble: "--voice-ai-bubble",
|
|
15289
|
+
aiText: "--voice-ai-text"
|
|
15290
|
+
};
|
|
15291
|
+
const styles = {};
|
|
15292
|
+
Object.entries(colors).forEach(([key, value]) => {
|
|
15293
|
+
const varName = mapping[key];
|
|
15294
|
+
if (varName && value) {
|
|
15295
|
+
const hsl = hexToHSL(value);
|
|
15296
|
+
if (hsl) {
|
|
15297
|
+
styles[varName] = hsl.toString();
|
|
15298
|
+
if (key === "primary") {
|
|
15299
|
+
styles["--indicator-bg"] = hsl.toString();
|
|
15300
|
+
styles["--voice-accent-light"] = currentTheme === "light" ? `${hsl.h} ${hsl.s}% 96%` : `${hsl.h} ${hsl.s}% 25%`;
|
|
15301
|
+
}
|
|
15302
|
+
}
|
|
15303
|
+
}
|
|
15304
|
+
});
|
|
15305
|
+
return styles;
|
|
15306
|
+
};
|
|
15191
15307
|
var ChatPopup = ({
|
|
15192
15308
|
isOpen,
|
|
15193
15309
|
isMinimized,
|
|
@@ -15215,9 +15331,20 @@ var ChatPopup = ({
|
|
|
15215
15331
|
onSizeChange,
|
|
15216
15332
|
persistPosition = true,
|
|
15217
15333
|
persistSize = true,
|
|
15218
|
-
storageKey = "chat-popup"
|
|
15334
|
+
storageKey = "chat-popup",
|
|
15335
|
+
theme: localTheme,
|
|
15336
|
+
emptyStateMessage: localEmptyStateMessage
|
|
15219
15337
|
}) => {
|
|
15220
|
-
const {
|
|
15338
|
+
const {
|
|
15339
|
+
title,
|
|
15340
|
+
showLogo,
|
|
15341
|
+
showAIIcon,
|
|
15342
|
+
showUserIcon,
|
|
15343
|
+
theme: contextTheme,
|
|
15344
|
+
emptyStateMessage: contextEmptyStateMessage
|
|
15345
|
+
} = useAnsyrContext();
|
|
15346
|
+
const theme = localTheme || contextTheme;
|
|
15347
|
+
const emptyStateMessage = localEmptyStateMessage || contextEmptyStateMessage;
|
|
15221
15348
|
const [inputText, setInputText] = useState6("");
|
|
15222
15349
|
const [isSending, setIsSending] = useState6(false);
|
|
15223
15350
|
const messagesEndRef = useRef5(null);
|
|
@@ -15312,7 +15439,8 @@ var ChatPopup = ({
|
|
|
15312
15439
|
animation: "scaleIn 0.3s ease-out",
|
|
15313
15440
|
flexDirection: "column",
|
|
15314
15441
|
fontFamily: "Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif",
|
|
15315
|
-
overflow: "hidden"
|
|
15442
|
+
overflow: "hidden",
|
|
15443
|
+
...generateThemeStyles(theme, currentTheme)
|
|
15316
15444
|
}
|
|
15317
15445
|
},
|
|
15318
15446
|
/* @__PURE__ */ React10.createElement(
|
|
@@ -15507,7 +15635,7 @@ var ChatPopup = ({
|
|
|
15507
15635
|
fontSize: "14px"
|
|
15508
15636
|
}
|
|
15509
15637
|
},
|
|
15510
|
-
"Start a conversation with CueKit AI"
|
|
15638
|
+
emptyStateMessage || "Start a conversation with CueKit AI"
|
|
15511
15639
|
) : messages.map((message, index2) => /* @__PURE__ */ React10.createElement(
|
|
15512
15640
|
"div",
|
|
15513
15641
|
{
|
|
@@ -16010,7 +16138,7 @@ var Me = { exports: {} };
|
|
|
16010
16138
|
var Or = Me.exports;
|
|
16011
16139
|
var kt;
|
|
16012
16140
|
function kr() {
|
|
16013
|
-
return kt || (kt = 1,
|
|
16141
|
+
return kt || (kt = 1, function(e2) {
|
|
16014
16142
|
(function(t, n) {
|
|
16015
16143
|
e2.exports ? e2.exports = n() : t.log = n();
|
|
16016
16144
|
})(Or, function() {
|
|
@@ -16154,7 +16282,7 @@ function kr() {
|
|
|
16154
16282
|
return o;
|
|
16155
16283
|
}, s.default = s, s;
|
|
16156
16284
|
});
|
|
16157
|
-
}
|
|
16285
|
+
}(Me)), Me.exports;
|
|
16158
16286
|
}
|
|
16159
16287
|
var _r = kr();
|
|
16160
16288
|
var Lr = /* @__PURE__ */ Ar(_r);
|
|
@@ -16377,7 +16505,7 @@ function Ue(e2, t) {
|
|
|
16377
16505
|
0 <= n && e2.splice(n, 1);
|
|
16378
16506
|
}
|
|
16379
16507
|
}
|
|
16380
|
-
var Oe =
|
|
16508
|
+
var Oe = function() {
|
|
16381
16509
|
function e2(t) {
|
|
16382
16510
|
this.initialTeardown = t, this.closed = false, this._parentage = null, this._finalizers = null;
|
|
16383
16511
|
}
|
|
@@ -16461,11 +16589,11 @@ var Oe = (function() {
|
|
|
16461
16589
|
}, e2.prototype.remove = function(t) {
|
|
16462
16590
|
var n = this._finalizers;
|
|
16463
16591
|
n && Ue(n, t), t instanceof e2 && t._removeParent(this);
|
|
16464
|
-
}, e2.EMPTY =
|
|
16592
|
+
}, e2.EMPTY = function() {
|
|
16465
16593
|
var t = new e2();
|
|
16466
16594
|
return t.closed = true, t;
|
|
16467
|
-
}
|
|
16468
|
-
}
|
|
16595
|
+
}(), e2;
|
|
16596
|
+
}();
|
|
16469
16597
|
var an = Oe.EMPTY;
|
|
16470
16598
|
function cn(e2) {
|
|
16471
16599
|
return e2 instanceof Oe || e2 && "closed" in e2 && P(e2.remove) && P(e2.add) && P(e2.unsubscribe);
|
|
@@ -16497,7 +16625,7 @@ function je() {
|
|
|
16497
16625
|
function Re(e2) {
|
|
16498
16626
|
e2();
|
|
16499
16627
|
}
|
|
16500
|
-
var gt =
|
|
16628
|
+
var gt = function(e2) {
|
|
16501
16629
|
te(t, e2);
|
|
16502
16630
|
function t(n) {
|
|
16503
16631
|
var r2 = e2.call(this) || this;
|
|
@@ -16528,8 +16656,8 @@ var gt = (function(e2) {
|
|
|
16528
16656
|
this.unsubscribe();
|
|
16529
16657
|
}
|
|
16530
16658
|
}, t;
|
|
16531
|
-
}
|
|
16532
|
-
var Nr =
|
|
16659
|
+
}(Oe);
|
|
16660
|
+
var Nr = function() {
|
|
16533
16661
|
function e2(t) {
|
|
16534
16662
|
this.partialObserver = t;
|
|
16535
16663
|
}
|
|
@@ -16560,8 +16688,8 @@ var Nr = (function() {
|
|
|
16560
16688
|
Le(n);
|
|
16561
16689
|
}
|
|
16562
16690
|
}, e2;
|
|
16563
|
-
}
|
|
16564
|
-
var Ce =
|
|
16691
|
+
}();
|
|
16692
|
+
var Ce = function(e2) {
|
|
16565
16693
|
te(t, e2);
|
|
16566
16694
|
function t(n, r2, i2) {
|
|
16567
16695
|
var o = e2.call(this) || this, s;
|
|
@@ -16572,7 +16700,7 @@ var Ce = (function(e2) {
|
|
|
16572
16700
|
} : s = n, o.destination = new Nr(s), o;
|
|
16573
16701
|
}
|
|
16574
16702
|
return t;
|
|
16575
|
-
}
|
|
16703
|
+
}(gt);
|
|
16576
16704
|
function Le(e2) {
|
|
16577
16705
|
un(e2);
|
|
16578
16706
|
}
|
|
@@ -16585,9 +16713,9 @@ var Ur = {
|
|
|
16585
16713
|
error: Fr,
|
|
16586
16714
|
complete: je
|
|
16587
16715
|
};
|
|
16588
|
-
var bt =
|
|
16716
|
+
var bt = function() {
|
|
16589
16717
|
return typeof Symbol == "function" && Symbol.observable || "@@observable";
|
|
16590
|
-
}
|
|
16718
|
+
}();
|
|
16591
16719
|
function Ge(e2) {
|
|
16592
16720
|
return e2;
|
|
16593
16721
|
}
|
|
@@ -16598,7 +16726,7 @@ function jr(e2) {
|
|
|
16598
16726
|
}, n);
|
|
16599
16727
|
};
|
|
16600
16728
|
}
|
|
16601
|
-
var k =
|
|
16729
|
+
var k = function() {
|
|
16602
16730
|
function e2(t) {
|
|
16603
16731
|
t && (this._subscribe = t);
|
|
16604
16732
|
}
|
|
@@ -16657,7 +16785,7 @@ var k = (function() {
|
|
|
16657
16785
|
}, e2.create = function(t) {
|
|
16658
16786
|
return new e2(t);
|
|
16659
16787
|
}, e2;
|
|
16660
|
-
}
|
|
16788
|
+
}();
|
|
16661
16789
|
function Lt(e2) {
|
|
16662
16790
|
var t;
|
|
16663
16791
|
return (t = e2 ?? Dr.Promise) !== null && t !== void 0 ? t : Promise;
|
|
@@ -16687,7 +16815,7 @@ function j(e2) {
|
|
|
16687
16815
|
function F(e2, t, n, r2, i2) {
|
|
16688
16816
|
return new Hr(e2, t, n, r2, i2);
|
|
16689
16817
|
}
|
|
16690
|
-
var Hr =
|
|
16818
|
+
var Hr = function(e2) {
|
|
16691
16819
|
te(t, e2);
|
|
16692
16820
|
function t(n, r2, i2, o, s, a) {
|
|
16693
16821
|
var c = e2.call(this, n) || this;
|
|
@@ -16722,13 +16850,13 @@ var Hr = (function(e2) {
|
|
|
16722
16850
|
e2.prototype.unsubscribe.call(this), !r2 && ((n = this.onFinalize) === null || n === void 0 || n.call(this));
|
|
16723
16851
|
}
|
|
16724
16852
|
}, t;
|
|
16725
|
-
}
|
|
16853
|
+
}(gt);
|
|
16726
16854
|
var zr = mt(function(e2) {
|
|
16727
16855
|
return function() {
|
|
16728
16856
|
e2(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
|
|
16729
16857
|
};
|
|
16730
16858
|
});
|
|
16731
|
-
var ee =
|
|
16859
|
+
var ee = function(e2) {
|
|
16732
16860
|
te(t, e2);
|
|
16733
16861
|
function t() {
|
|
16734
16862
|
var n = e2.call(this) || this;
|
|
@@ -16807,8 +16935,8 @@ var ee = (function(e2) {
|
|
|
16807
16935
|
}, t.create = function(n, r2) {
|
|
16808
16936
|
return new It(n, r2);
|
|
16809
16937
|
}, t;
|
|
16810
|
-
}
|
|
16811
|
-
var It =
|
|
16938
|
+
}(k);
|
|
16939
|
+
var It = function(e2) {
|
|
16812
16940
|
te(t, e2);
|
|
16813
16941
|
function t(n, r2) {
|
|
16814
16942
|
var i2 = e2.call(this) || this;
|
|
@@ -16827,8 +16955,8 @@ var It = (function(e2) {
|
|
|
16827
16955
|
var r2, i2;
|
|
16828
16956
|
return (i2 = (r2 = this.source) === null || r2 === void 0 ? void 0 : r2.subscribe(n)) !== null && i2 !== void 0 ? i2 : an;
|
|
16829
16957
|
}, t;
|
|
16830
|
-
}
|
|
16831
|
-
var ln =
|
|
16958
|
+
}(ee);
|
|
16959
|
+
var ln = function(e2) {
|
|
16832
16960
|
te(t, e2);
|
|
16833
16961
|
function t(n) {
|
|
16834
16962
|
var r2 = e2.call(this) || this;
|
|
@@ -16851,13 +16979,13 @@ var ln = (function(e2) {
|
|
|
16851
16979
|
}, t.prototype.next = function(n) {
|
|
16852
16980
|
e2.prototype.next.call(this, this._value = n);
|
|
16853
16981
|
}, t;
|
|
16854
|
-
}
|
|
16982
|
+
}(ee);
|
|
16855
16983
|
var Yr = {
|
|
16856
16984
|
now: function() {
|
|
16857
16985
|
return Date.now();
|
|
16858
16986
|
}
|
|
16859
16987
|
};
|
|
16860
|
-
var qr =
|
|
16988
|
+
var qr = function(e2) {
|
|
16861
16989
|
te(t, e2);
|
|
16862
16990
|
function t(n, r2) {
|
|
16863
16991
|
return e2.call(this) || this;
|
|
@@ -16865,7 +16993,7 @@ var qr = (function(e2) {
|
|
|
16865
16993
|
return t.prototype.schedule = function(n, r2) {
|
|
16866
16994
|
return this;
|
|
16867
16995
|
}, t;
|
|
16868
|
-
}
|
|
16996
|
+
}(Oe);
|
|
16869
16997
|
var Mt = {
|
|
16870
16998
|
setInterval: function(e2, t) {
|
|
16871
16999
|
for (var n = [], r2 = 2; r2 < arguments.length; r2++)
|
|
@@ -16877,7 +17005,7 @@ var Mt = {
|
|
|
16877
17005
|
},
|
|
16878
17006
|
delegate: void 0
|
|
16879
17007
|
};
|
|
16880
|
-
var Kr =
|
|
17008
|
+
var Kr = function(e2) {
|
|
16881
17009
|
te(t, e2);
|
|
16882
17010
|
function t(n, r2) {
|
|
16883
17011
|
var i2 = e2.call(this, n, r2) || this;
|
|
@@ -16919,16 +17047,16 @@ var Kr = (function(e2) {
|
|
|
16919
17047
|
this.work = this.state = this.scheduler = null, this.pending = false, Ue(o, this), r2 != null && (this.id = this.recycleAsyncId(i2, r2, null)), this.delay = null, e2.prototype.unsubscribe.call(this);
|
|
16920
17048
|
}
|
|
16921
17049
|
}, t;
|
|
16922
|
-
}
|
|
16923
|
-
var Rt =
|
|
17050
|
+
}(qr);
|
|
17051
|
+
var Rt = function() {
|
|
16924
17052
|
function e2(t, n) {
|
|
16925
17053
|
n === void 0 && (n = e2.now), this.schedulerActionCtor = t, this.now = n;
|
|
16926
17054
|
}
|
|
16927
17055
|
return e2.prototype.schedule = function(t, n, r2) {
|
|
16928
17056
|
return n === void 0 && (n = 0), new this.schedulerActionCtor(this, t).schedule(r2, n);
|
|
16929
17057
|
}, e2.now = Yr.now, e2;
|
|
16930
|
-
}
|
|
16931
|
-
var Gr =
|
|
17058
|
+
}();
|
|
17059
|
+
var Gr = function(e2) {
|
|
16932
17060
|
te(t, e2);
|
|
16933
17061
|
function t(n, r2) {
|
|
16934
17062
|
r2 === void 0 && (r2 = Rt.now);
|
|
@@ -16953,7 +17081,7 @@ var Gr = (function(e2) {
|
|
|
16953
17081
|
throw i2;
|
|
16954
17082
|
}
|
|
16955
17083
|
}, t;
|
|
16956
|
-
}
|
|
17084
|
+
}(Rt);
|
|
16957
17085
|
var Qr = new Gr(Kr);
|
|
16958
17086
|
function Jr(e2) {
|
|
16959
17087
|
return e2 && P(e2.schedule);
|
|
@@ -18074,7 +18202,7 @@ var MicButton = ({
|
|
|
18074
18202
|
onLanguageChange,
|
|
18075
18203
|
showLanguageDropdown = true
|
|
18076
18204
|
}) => {
|
|
18077
|
-
const { apiKey, appId } = useAnsyrContext();
|
|
18205
|
+
const { apiKey, appId, theme, emptyStateMessage } = useAnsyrContext();
|
|
18078
18206
|
const [showBodyGlow, setShowBodyGlow] = useState12(false);
|
|
18079
18207
|
const [currentTheme, setCurrentTheme] = useState12("dark");
|
|
18080
18208
|
const [showLanguageSelector, setShowLanguageSelector] = useState12(false);
|
|
@@ -18363,7 +18491,50 @@ var MicButton = ({
|
|
|
18363
18491
|
};
|
|
18364
18492
|
}
|
|
18365
18493
|
};
|
|
18366
|
-
const
|
|
18494
|
+
const generateMicButtonGradient = () => {
|
|
18495
|
+
const colors = currentTheme === "light" ? theme?.light : theme?.dark;
|
|
18496
|
+
if (colors?.primary) {
|
|
18497
|
+
const hsl = hexToHSL(colors.primary);
|
|
18498
|
+
if (hsl) {
|
|
18499
|
+
const lightHsl = `${hsl.h} ${hsl.s}% ${Math.min(hsl.l + 10, 100)}%`;
|
|
18500
|
+
return `radial-gradient(circle at 50% 0%, hsl(${lightHsl}), hsl(${hsl.toString()}))`;
|
|
18501
|
+
}
|
|
18502
|
+
}
|
|
18503
|
+
return currentTheme === "dark" ? "radial-gradient(circle at 50% 0%, #9a92f6, #5447cd)" : "radial-gradient(circle at 50% 0%, #9a92f6, #6257d9)";
|
|
18504
|
+
};
|
|
18505
|
+
const generateThemeStyles2 = (theme2, currentTheme2 = "dark") => {
|
|
18506
|
+
if (!theme2) return {};
|
|
18507
|
+
const colors = currentTheme2 === "light" ? theme2.light : theme2.dark;
|
|
18508
|
+
if (!colors) return {};
|
|
18509
|
+
const mapping = {
|
|
18510
|
+
primary: "--voice-accent",
|
|
18511
|
+
background: "--voice-bg",
|
|
18512
|
+
surface: "--voice-surface",
|
|
18513
|
+
border: "--voice-border",
|
|
18514
|
+
text: "--voice-text",
|
|
18515
|
+
textMuted: "--voice-text-muted",
|
|
18516
|
+
userBubble: "--voice-user-bubble",
|
|
18517
|
+
userText: "--voice-user-text",
|
|
18518
|
+
aiBubble: "--voice-ai-bubble",
|
|
18519
|
+
aiText: "--voice-ai-text"
|
|
18520
|
+
};
|
|
18521
|
+
const styles = {};
|
|
18522
|
+
Object.entries(colors).forEach(([key, value]) => {
|
|
18523
|
+
const varName = mapping[key];
|
|
18524
|
+
if (varName && value) {
|
|
18525
|
+
const hsl = hexToHSL(value);
|
|
18526
|
+
if (hsl) {
|
|
18527
|
+
styles[varName] = hsl.toString();
|
|
18528
|
+
if (key === "primary") {
|
|
18529
|
+
styles["--indicator-bg"] = hsl.toString();
|
|
18530
|
+
styles["--voice-accent-light"] = currentTheme2 === "light" ? `${hsl.h} ${hsl.s}% 96%` : `${hsl.h} ${hsl.s}% 25%`;
|
|
18531
|
+
}
|
|
18532
|
+
}
|
|
18533
|
+
}
|
|
18534
|
+
});
|
|
18535
|
+
return styles;
|
|
18536
|
+
};
|
|
18537
|
+
const micButtonGradient = generateMicButtonGradient();
|
|
18367
18538
|
const buttonStyles = {
|
|
18368
18539
|
container: {
|
|
18369
18540
|
position: "relative",
|
|
@@ -18419,7 +18590,11 @@ var MicButton = ({
|
|
|
18419
18590
|
{
|
|
18420
18591
|
"data-cuekit-ignore": true,
|
|
18421
18592
|
className: `cuekit-voice-popup ${currentTheme === "dark" ? "cuekit-dark" : ""}`,
|
|
18422
|
-
style: {
|
|
18593
|
+
style: {
|
|
18594
|
+
...buttonStyles.container,
|
|
18595
|
+
...getPositionStyle(),
|
|
18596
|
+
...generateThemeStyles2(theme, currentTheme)
|
|
18597
|
+
}
|
|
18423
18598
|
},
|
|
18424
18599
|
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(
|
|
18425
18600
|
LanguageSelector,
|
|
@@ -18540,7 +18715,9 @@ var MicButton = ({
|
|
|
18540
18715
|
resizable: true,
|
|
18541
18716
|
persistPosition: true,
|
|
18542
18717
|
persistSize: true,
|
|
18543
|
-
storageKey: "cuekit-chat-popup"
|
|
18718
|
+
storageKey: "cuekit-chat-popup",
|
|
18719
|
+
theme,
|
|
18720
|
+
emptyStateMessage
|
|
18544
18721
|
}
|
|
18545
18722
|
), isChatOpen && isChatMinimized && /* @__PURE__ */ React15.createElement(
|
|
18546
18723
|
"button",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuekit-ai/react",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.8",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -36,12 +36,14 @@
|
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": "^18.2.0 || ^19.0.0",
|
|
39
|
-
"react-dom": "^18.2.0 || ^19.0.0"
|
|
39
|
+
"react-dom": "^18.2.0 || ^19.0.0",
|
|
40
|
+
"@types/react": "^18.2.0 || ^19.0.0",
|
|
41
|
+
"@types/react-dom": "^18.2.0 || ^19.0.0"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
44
|
"@types/node": "^24.2.1",
|
|
43
|
-
"@types/react": "^
|
|
44
|
-
"@types/react-dom": "^
|
|
45
|
+
"@types/react": "^19.0.0",
|
|
46
|
+
"@types/react-dom": "^19.0.0",
|
|
45
47
|
"@types/crypto-js": "^4.2.2",
|
|
46
48
|
"tsup": "^8.5.0",
|
|
47
49
|
"typescript": "^5.4.5"
|