@unctad-ai/voice-agent-ui 5.3.0 → 5.3.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.
@@ -5,7 +5,7 @@ import {
5
5
  SliderSetting,
6
6
  ToggleSetting,
7
7
  VoiceSettingsView
8
- } from "./chunk-SS2HS7NJ.js";
8
+ } from "./chunk-QXFECZAT.js";
9
9
  export {
10
10
  Divider,
11
11
  SelectSetting,
@@ -14,4 +14,4 @@ export {
14
14
  ToggleSetting,
15
15
  VoiceSettingsView as default
16
16
  };
17
- //# sourceMappingURL=VoiceSettingsView-JUZMLSHG.js.map
17
+ //# sourceMappingURL=VoiceSettingsView-U7O5H5PC.js.map
@@ -1903,7 +1903,7 @@ function VoiceSettingsView({ onBack, onVolumeChange }) {
1903
1903
  ) : /* @__PURE__ */ jsx3("span", {}),
1904
1904
  /* @__PURE__ */ jsxs2("span", { children: [
1905
1905
  "Kit v",
1906
- /* @__PURE__ */ jsx3("span", { style: { fontWeight: 500, color: "#6b7280" }, children: "5.3.0" })
1906
+ /* @__PURE__ */ jsx3("span", { style: { fontWeight: 500, color: "#6b7280" }, children: "5.3.1" })
1907
1907
  ] })
1908
1908
  ] }) })
1909
1909
  ]
@@ -1995,4 +1995,4 @@ export {
1995
1995
  SettingsSection,
1996
1996
  Divider
1997
1997
  };
1998
- //# sourceMappingURL=chunk-SS2HS7NJ.js.map
1998
+ //# sourceMappingURL=chunk-QXFECZAT.js.map
package/dist/index.d.ts CHANGED
@@ -229,10 +229,8 @@ interface VoiceTranscriptProps {
229
229
  feedbackSentTurns?: Record<number, string>;
230
230
  /** Callback to submit a text message (for suggested prompt chips) */
231
231
  onTextSubmit?: (text: string) => void;
232
- /** Portrait image URL for empty state avatar */
233
- portraitSrc?: string;
234
232
  }
235
- declare function VoiceTranscript({ messages, isTyping, variant, voiceError, voiceState, onStartMic, onSwitchToKeyboard, onReport, feedbackSentTurns, onTextSubmit, portraitSrc, }: VoiceTranscriptProps): react_jsx_runtime.JSX.Element;
233
+ declare function VoiceTranscript({ messages, isTyping, variant, voiceError, voiceState, onStartMic, onSwitchToKeyboard, onReport, feedbackSentTurns, onTextSubmit, }: VoiceTranscriptProps): react_jsx_runtime.JSX.Element;
236
234
 
237
235
  interface VoiceWaveformCanvasProps {
238
236
  analyserNode: AnalyserNode | null;
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  VoiceSettingsProvider,
9
9
  VoiceSettingsView,
10
10
  useVoiceSettings
11
- } from "./chunk-SS2HS7NJ.js";
11
+ } from "./chunk-QXFECZAT.js";
12
12
 
13
13
  // src/VoiceAgentProvider.tsx
14
14
  import { SiteConfigProvider } from "@unctad-ai/voice-agent-core";
@@ -918,8 +918,7 @@ function VoiceTranscript({
918
918
  onSwitchToKeyboard,
919
919
  onReport,
920
920
  feedbackSentTurns,
921
- onTextSubmit,
922
- portraitSrc
921
+ onTextSubmit
923
922
  }) {
924
923
  const config = useSiteConfig3();
925
924
  const fontFamily = config.fontFamily ?? DEFAULT_FONT_FAMILY;
@@ -1205,7 +1204,7 @@ function VoiceTranscript({
1205
1204
  )
1206
1205
  ]
1207
1206
  }
1208
- ) : /* @__PURE__ */ jsx4("div", { style: { paddingTop: 40 }, children: /* @__PURE__ */ jsx4(EmptyStateGraphic, { primaryColor: config.colors.primary, onTextSubmit, portraitSrc }) })),
1207
+ ) : /* @__PURE__ */ jsx4("div", { style: { paddingTop: 40 }, children: /* @__PURE__ */ jsx4(EmptyStateGraphic, { primaryColor: config.colors.primary, onTextSubmit }) })),
1209
1208
  isTyping && visible.length === 0 && /* @__PURE__ */ jsx4(
1210
1209
  motion.p,
1211
1210
  {
@@ -1328,8 +1327,7 @@ function VoiceTranscript({
1328
1327
  voiceState,
1329
1328
  onStartMic,
1330
1329
  onSwitchToKeyboard,
1331
- onTextSubmit,
1332
- portraitSrc
1330
+ onTextSubmit
1333
1331
  }
1334
1332
  ),
1335
1333
  isTyping && visible.length === 0 && /* @__PURE__ */ jsx4(
@@ -1346,12 +1344,11 @@ function VoiceTranscript({
1346
1344
  }
1347
1345
  );
1348
1346
  }
1349
- function EmptyStateGraphic({ primaryColor, voiceState, onStartMic, onSwitchToKeyboard, onTextSubmit, portraitSrc }) {
1347
+ function EmptyStateGraphic({ primaryColor, voiceState, onStartMic, onSwitchToKeyboard, onTextSubmit }) {
1350
1348
  const config = useSiteConfig3();
1351
1349
  const isListening = voiceState === "LISTENING" || voiceState === "USER_SPEAKING";
1352
1350
  const greeting = config.greetingMessage || "How can I help you today?";
1353
1351
  const prompts = config.suggestedPrompts ?? ["What services are available?", "Help me with an application"];
1354
- const sentRef = useRef3(false);
1355
1352
  if (isListening) {
1356
1353
  return /* @__PURE__ */ jsxs3(
1357
1354
  motion.div,
@@ -1393,11 +1390,7 @@ function EmptyStateGraphic({ primaryColor, voiceState, onStartMic, onSwitchToKey
1393
1390
  /* @__PURE__ */ jsx4("div", { style: { display: "flex", flexWrap: "wrap", gap: 8, justifyContent: "center", maxWidth: 320 }, children: prompts.map((prompt) => /* @__PURE__ */ jsx4(
1394
1391
  "button",
1395
1392
  {
1396
- onClick: () => {
1397
- if (sentRef.current) return;
1398
- sentRef.current = true;
1399
- onTextSubmit?.(prompt);
1400
- },
1393
+ onClick: () => onTextSubmit?.(prompt),
1401
1394
  style: {
1402
1395
  padding: "8px 16px",
1403
1396
  borderRadius: 18,
@@ -1768,7 +1761,7 @@ function PipelineMetricsBar({
1768
1761
 
1769
1762
  // src/components/GlassCopilotPanel.tsx
1770
1763
  import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1771
- var VoiceSettingsView2 = lazy(() => import("./VoiceSettingsView-JUZMLSHG.js"));
1764
+ var VoiceSettingsView2 = lazy(() => import("./VoiceSettingsView-U7O5H5PC.js"));
1772
1765
  var RETRY_INITIAL_MS = 3e3;
1773
1766
  var RETRY_MAX_MS = 3e4;
1774
1767
  var STATE_LABELS = {
@@ -2663,7 +2656,7 @@ function ExpandedContent({
2663
2656
  }
2664
2657
  ),
2665
2658
  /* @__PURE__ */ jsxs8("div", { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column", overflow: "hidden" }, children: [
2666
- /* @__PURE__ */ jsx9("div", { "data-testid": "voice-agent-transcript", style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsx9(VoiceTranscript, { messages, isTyping, variant: "panel", voiceError, voiceState, onStartMic, onSwitchToKeyboard, onReport, feedbackSentTurns, onTextSubmit, portraitSrc }) }),
2659
+ /* @__PURE__ */ jsx9("div", { "data-testid": "voice-agent-transcript", style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsx9(VoiceTranscript, { messages, isTyping, variant: "panel", voiceError, voiceState, onStartMic, onSwitchToKeyboard, onReport, feedbackSentTurns, onTextSubmit }) }),
2667
2660
  /* @__PURE__ */ jsxs8("div", { style: { flexShrink: 0 }, children: [
2668
2661
  /* @__PURE__ */ jsx9(PipelineMetricsBar, { timings: lastTimings ?? null, show: showPipelineMetrics, autoHideMs: pipelineMetricsAutoHideMs }),
2669
2662
  isOffline && onRetry && /* @__PURE__ */ jsx9("div", { style: { padding: "0 16px 8px", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ jsxs8(motion5.button, { whileHover: { scale: 1.04 }, whileTap: { scale: 0.96 }, onClick: onRetry, disabled: isRetrying, className: "inline-flex items-center gap-2 rounded-full cursor-pointer transition-colors", style: { padding: "8px 18px", fontSize: "13px", fontWeight: 500, color: isRetrying ? "rgba(0,0,0,0.35)" : "rgba(220,38,38,0.8)", backgroundColor: isRetrying ? "rgba(0,0,0,0.04)" : "rgba(220,38,38,0.08)", border: "1px solid", borderColor: isRetrying ? "rgba(0,0,0,0.06)" : "rgba(220,38,38,0.15)" }, "aria-label": "Retry connection", children: [
@@ -2936,7 +2929,7 @@ function WiredPanelInner({
2936
2929
  timings: lastTimings ?? void 0,
2937
2930
  route: window.location.pathname,
2938
2931
  copilotName: config.copilotName,
2939
- kitVersion: "5.3.0"
2932
+ kitVersion: "5.3.1"
2940
2933
  })
2941
2934
  });
2942
2935
  const body = await res.json().catch(() => ({ ticketId: void 0 }));