@contentgrowth/llm-service 0.9.2 → 0.9.3
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/ui/react/components/index.cjs +242 -119
- package/dist/ui/react/components/index.cjs.map +1 -1
- package/dist/ui/react/components/index.d.cts +12 -1
- package/dist/ui/react/components/index.d.ts +12 -1
- package/dist/ui/react/components/index.js +236 -114
- package/dist/ui/react/components/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -37,6 +37,7 @@ __export(components_exports, {
|
|
|
37
37
|
ConnectionStatus: () => ConnectionStatus,
|
|
38
38
|
MessageBubble: () => MessageBubble,
|
|
39
39
|
Spinner: () => Spinner,
|
|
40
|
+
TapToTalk: () => TapToTalk,
|
|
40
41
|
createWhisperVoiceConfig: () => createWhisperVoiceConfig,
|
|
41
42
|
transcribeAudio: () => transcribeAudio,
|
|
42
43
|
useAudioRecorder: () => useAudioRecorder,
|
|
@@ -734,18 +735,139 @@ var ChatInputArea = (0, import_react5.forwardRef)(({
|
|
|
734
735
|
});
|
|
735
736
|
ChatInputArea.displayName = "ChatInputArea";
|
|
736
737
|
|
|
738
|
+
// src/ui/react/components/TapToTalk.tsx
|
|
739
|
+
var import_react6 = require("react");
|
|
740
|
+
var import_outline2 = require("@heroicons/react/24/outline");
|
|
741
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
742
|
+
var TapToTalk = ({
|
|
743
|
+
onResult,
|
|
744
|
+
voiceConfig: propVoiceConfig,
|
|
745
|
+
className = "",
|
|
746
|
+
disabled = false,
|
|
747
|
+
tooltip = "Tap to speak",
|
|
748
|
+
onFocusTarget,
|
|
749
|
+
accentColor = "bg-emerald-600"
|
|
750
|
+
}) => {
|
|
751
|
+
var _a;
|
|
752
|
+
const globalConfig = useChatConfig();
|
|
753
|
+
const voiceConfig = propVoiceConfig || ((_a = globalConfig.voice) == null ? void 0 : _a.config);
|
|
754
|
+
const [isTranscribing, setIsTranscribing] = (0, import_react6.useState)(false);
|
|
755
|
+
const [voiceTrigger, setVoiceTrigger] = (0, import_react6.useState)(null);
|
|
756
|
+
const [errorMsg, setErrorMsg] = (0, import_react6.useState)(null);
|
|
757
|
+
const handleVoiceResult = (0, import_react6.useCallback)((text, isFinal) => {
|
|
758
|
+
if (isFinal) {
|
|
759
|
+
onResult(text);
|
|
760
|
+
setErrorMsg(null);
|
|
761
|
+
setVoiceTrigger(null);
|
|
762
|
+
}
|
|
763
|
+
}, [onResult]);
|
|
764
|
+
const handleVoiceEnd = (0, import_react6.useCallback)(() => {
|
|
765
|
+
setVoiceTrigger(null);
|
|
766
|
+
}, []);
|
|
767
|
+
const nativeSpeech = useSpeechRecognition(handleVoiceResult, handleVoiceEnd, voiceConfig == null ? void 0 : voiceConfig.language);
|
|
768
|
+
const customRecorder = useAudioRecorder(async (blob) => {
|
|
769
|
+
setVoiceTrigger(null);
|
|
770
|
+
setIsTranscribing(true);
|
|
771
|
+
setErrorMsg(null);
|
|
772
|
+
if (blob.type === "audio/simulated") {
|
|
773
|
+
console.log("[TapToTalk] Handling simulated audio capture");
|
|
774
|
+
await new Promise((resolve) => setTimeout(resolve, 1500));
|
|
775
|
+
onResult("This is a simulated transcription for development testing.");
|
|
776
|
+
setIsTranscribing(false);
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
if ((voiceConfig == null ? void 0 : voiceConfig.mode) === "custom" && voiceConfig.onAudioCapture) {
|
|
780
|
+
try {
|
|
781
|
+
const text = await voiceConfig.onAudioCapture(blob);
|
|
782
|
+
if (text) onResult(text);
|
|
783
|
+
} catch (error) {
|
|
784
|
+
console.error("[TapToTalk] Custom transcription failed:", error);
|
|
785
|
+
setErrorMsg(error.message || "Transcription failed");
|
|
786
|
+
} finally {
|
|
787
|
+
setIsTranscribing(false);
|
|
788
|
+
}
|
|
789
|
+
} else {
|
|
790
|
+
setIsTranscribing(false);
|
|
791
|
+
}
|
|
792
|
+
});
|
|
793
|
+
const isListening = !!voiceTrigger || nativeSpeech.isListening || customRecorder.isRecording;
|
|
794
|
+
const isActive = isListening || isTranscribing;
|
|
795
|
+
const toggleVoice = async () => {
|
|
796
|
+
if (isActive) {
|
|
797
|
+
if (isTranscribing && !isListening) return;
|
|
798
|
+
if ((voiceConfig == null ? void 0 : voiceConfig.mode) === "native") {
|
|
799
|
+
nativeSpeech.stop();
|
|
800
|
+
} else {
|
|
801
|
+
customRecorder.stop();
|
|
802
|
+
}
|
|
803
|
+
setVoiceTrigger(null);
|
|
804
|
+
} else {
|
|
805
|
+
setErrorMsg(null);
|
|
806
|
+
onFocusTarget == null ? void 0 : onFocusTarget();
|
|
807
|
+
setVoiceTrigger("click");
|
|
808
|
+
if ((voiceConfig == null ? void 0 : voiceConfig.mode) === "custom") {
|
|
809
|
+
try {
|
|
810
|
+
await customRecorder.start();
|
|
811
|
+
} catch (e) {
|
|
812
|
+
setErrorMsg("Mic access denied");
|
|
813
|
+
setVoiceTrigger(null);
|
|
814
|
+
}
|
|
815
|
+
} else {
|
|
816
|
+
if (!nativeSpeech.isSupported) {
|
|
817
|
+
setErrorMsg("Speech not supported");
|
|
818
|
+
setVoiceTrigger(null);
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
821
|
+
nativeSpeech.start();
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
};
|
|
825
|
+
let bgColor = accentColor;
|
|
826
|
+
let label = "Tap to Talk";
|
|
827
|
+
let Icon = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_outline2.MicrophoneIcon, { className: "h-5 w-5" });
|
|
828
|
+
if (isListening) {
|
|
829
|
+
bgColor = "bg-orange-500";
|
|
830
|
+
label = "Listening ... Tap to stop";
|
|
831
|
+
Icon = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_outline2.MicrophoneIcon, { className: "h-5 w-5 animate-pulse" });
|
|
832
|
+
} else if (isTranscribing) {
|
|
833
|
+
bgColor = "bg-orange-500";
|
|
834
|
+
label = "Transcribing ...";
|
|
835
|
+
Icon = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("svg", { className: "animate-spin h-5 w-5 text-white", xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", children: [
|
|
836
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
837
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
838
|
+
] });
|
|
839
|
+
}
|
|
840
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
841
|
+
"button",
|
|
842
|
+
{
|
|
843
|
+
onClick: toggleVoice,
|
|
844
|
+
disabled: disabled || isTranscribing && !isListening,
|
|
845
|
+
className: `flex items-center justify-center gap-3 px-6 py-3 rounded-xl transition-all duration-300 w-full font-medium shadow-md active:scale-[0.98]
|
|
846
|
+
${bgColor} text-white
|
|
847
|
+
${disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
|
|
848
|
+
${className}`,
|
|
849
|
+
title: label,
|
|
850
|
+
children: [
|
|
851
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex items-center justify-center shrink-0", children: Icon }),
|
|
852
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "truncate", children: label }),
|
|
853
|
+
errorMsg && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-[10px] bg-white/20 px-1.5 py-0.5 rounded text-red-100 animate-in fade-in slide-in-from-right-1", children: errorMsg })
|
|
854
|
+
]
|
|
855
|
+
}
|
|
856
|
+
);
|
|
857
|
+
};
|
|
858
|
+
|
|
737
859
|
// src/ui/react/components/ChatMessageList.tsx
|
|
738
|
-
var
|
|
860
|
+
var import_react10 = require("react");
|
|
739
861
|
|
|
740
862
|
// src/ui/react/components/interactive/ConfirmInteraction.tsx
|
|
741
|
-
var
|
|
742
|
-
var
|
|
863
|
+
var import_react7 = require("react");
|
|
864
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
743
865
|
var ConfirmInteraction = ({
|
|
744
866
|
parameters,
|
|
745
867
|
onResponse,
|
|
746
868
|
isResponseSubmitted
|
|
747
869
|
}) => {
|
|
748
|
-
const [selectedOption, setSelectedOption] = (0,
|
|
870
|
+
const [selectedOption, setSelectedOption] = (0, import_react7.useState)(null);
|
|
749
871
|
const params = parameters;
|
|
750
872
|
const { yesPrompt, noPrompt } = params;
|
|
751
873
|
console.log("[ConfirmInteraction] Parameters:", params);
|
|
@@ -754,8 +876,8 @@ var ConfirmInteraction = ({
|
|
|
754
876
|
setSelectedOption(buttonText);
|
|
755
877
|
onResponse(value);
|
|
756
878
|
};
|
|
757
|
-
return /* @__PURE__ */ (0,
|
|
758
|
-
/* @__PURE__ */ (0,
|
|
879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "mt-2 mb-4", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex space-x-2", children: [
|
|
880
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
759
881
|
"button",
|
|
760
882
|
{
|
|
761
883
|
onClick: () => handleOptionClick(true, yesPrompt),
|
|
@@ -764,7 +886,7 @@ var ConfirmInteraction = ({
|
|
|
764
886
|
children: yesPrompt
|
|
765
887
|
}
|
|
766
888
|
),
|
|
767
|
-
/* @__PURE__ */ (0,
|
|
889
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
768
890
|
"button",
|
|
769
891
|
{
|
|
770
892
|
onClick: () => handleOptionClick(false, noPrompt),
|
|
@@ -778,19 +900,19 @@ var ConfirmInteraction = ({
|
|
|
778
900
|
var ConfirmInteraction_default = ConfirmInteraction;
|
|
779
901
|
|
|
780
902
|
// src/ui/react/components/interactive/SelectInteraction.tsx
|
|
781
|
-
var
|
|
782
|
-
var
|
|
903
|
+
var import_react8 = require("react");
|
|
904
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
783
905
|
var SelectInteraction = ({
|
|
784
906
|
parameters,
|
|
785
907
|
onResponse,
|
|
786
908
|
isResponseSubmitted,
|
|
787
909
|
message
|
|
788
910
|
}) => {
|
|
789
|
-
const [selectedOption, setSelectedOption] = (0,
|
|
790
|
-
const [customOption, setCustomOption] = (0,
|
|
911
|
+
const [selectedOption, setSelectedOption] = (0, import_react8.useState)(null);
|
|
912
|
+
const [customOption, setCustomOption] = (0, import_react8.useState)(null);
|
|
791
913
|
const params = parameters;
|
|
792
914
|
const { question, options, placeholder } = params;
|
|
793
|
-
(0,
|
|
915
|
+
(0, import_react8.useEffect)(() => {
|
|
794
916
|
if (isResponseSubmitted && (message == null ? void 0 : message.responseValue)) {
|
|
795
917
|
const responseValueStr = String(message.responseValue);
|
|
796
918
|
setSelectedOption(responseValueStr);
|
|
@@ -805,8 +927,8 @@ var SelectInteraction = ({
|
|
|
805
927
|
setCustomOption(null);
|
|
806
928
|
onResponse(option);
|
|
807
929
|
};
|
|
808
|
-
return /* @__PURE__ */ (0,
|
|
809
|
-
/* @__PURE__ */ (0,
|
|
930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mt-2 mb-4", children: [
|
|
931
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex flex-wrap gap-2", children: options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
810
932
|
"button",
|
|
811
933
|
{
|
|
812
934
|
onClick: () => handleOptionClick(option),
|
|
@@ -816,9 +938,9 @@ var SelectInteraction = ({
|
|
|
816
938
|
},
|
|
817
939
|
index
|
|
818
940
|
)) }),
|
|
819
|
-
customOption && isResponseSubmitted && /* @__PURE__ */ (0,
|
|
941
|
+
customOption && isResponseSubmitted && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mt-2 text-sm text-amber-600 bg-amber-50 p-2 rounded", children: [
|
|
820
942
|
"User provided custom option: ",
|
|
821
|
-
/* @__PURE__ */ (0,
|
|
943
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "font-semibold", children: [
|
|
822
944
|
'"',
|
|
823
945
|
customOption,
|
|
824
946
|
'"'
|
|
@@ -829,20 +951,20 @@ var SelectInteraction = ({
|
|
|
829
951
|
var SelectInteraction_default = SelectInteraction;
|
|
830
952
|
|
|
831
953
|
// src/ui/react/components/interactive/FormInteraction.tsx
|
|
832
|
-
var
|
|
954
|
+
var import_react9 = require("react");
|
|
833
955
|
var import_lucide_react = require("lucide-react");
|
|
834
|
-
var
|
|
956
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
835
957
|
var FormInteraction = ({
|
|
836
958
|
parameters,
|
|
837
959
|
onResponse,
|
|
838
960
|
isResponseSubmitted,
|
|
839
961
|
submittedValues
|
|
840
962
|
}) => {
|
|
841
|
-
const [isModalOpen, setIsModalOpen] = (0,
|
|
842
|
-
const [formValues, setFormValues] = (0,
|
|
843
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
844
|
-
const [parsedFields, setParsedFields] = (0,
|
|
845
|
-
const formButtonsRef = (0,
|
|
963
|
+
const [isModalOpen, setIsModalOpen] = (0, import_react9.useState)(false);
|
|
964
|
+
const [formValues, setFormValues] = (0, import_react9.useState)({});
|
|
965
|
+
const [isExpanded, setIsExpanded] = (0, import_react9.useState)(false);
|
|
966
|
+
const [parsedFields, setParsedFields] = (0, import_react9.useState)([]);
|
|
967
|
+
const formButtonsRef = (0, import_react9.useRef)(null);
|
|
846
968
|
const parseParameters = () => {
|
|
847
969
|
const { prompt, description, submitText = "Submit", cancelText = "Cancel" } = parameters;
|
|
848
970
|
let fieldsArray = [];
|
|
@@ -903,7 +1025,7 @@ var FormInteraction = ({
|
|
|
903
1025
|
};
|
|
904
1026
|
};
|
|
905
1027
|
const params = parseParameters();
|
|
906
|
-
(0,
|
|
1028
|
+
(0, import_react9.useEffect)(() => {
|
|
907
1029
|
const processedParams = parseParameters();
|
|
908
1030
|
setParsedFields(processedParams.fields);
|
|
909
1031
|
const initialValues = {};
|
|
@@ -921,7 +1043,7 @@ var FormInteraction = ({
|
|
|
921
1043
|
setIsModalOpen(true);
|
|
922
1044
|
}
|
|
923
1045
|
}, [parameters, isResponseSubmitted]);
|
|
924
|
-
(0,
|
|
1046
|
+
(0, import_react9.useEffect)(() => {
|
|
925
1047
|
if (isModalOpen && formButtonsRef.current) {
|
|
926
1048
|
setTimeout(() => {
|
|
927
1049
|
var _a;
|
|
@@ -951,12 +1073,12 @@ var FormInteraction = ({
|
|
|
951
1073
|
case "email":
|
|
952
1074
|
case "number":
|
|
953
1075
|
case "password":
|
|
954
|
-
return /* @__PURE__ */ (0,
|
|
955
|
-
/* @__PURE__ */ (0,
|
|
1076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-4 flex items-center space-x-4", children: [
|
|
1077
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { htmlFor: name, className: "text-sm font-medium text-gray-700 min-w-[120px]", children: [
|
|
956
1078
|
label,
|
|
957
|
-
required && /* @__PURE__ */ (0,
|
|
1079
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-red-500", children: "*" })
|
|
958
1080
|
] }),
|
|
959
|
-
/* @__PURE__ */ (0,
|
|
1081
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
960
1082
|
"input",
|
|
961
1083
|
{
|
|
962
1084
|
type: type === "string" ? "text" : type,
|
|
@@ -972,12 +1094,12 @@ var FormInteraction = ({
|
|
|
972
1094
|
)
|
|
973
1095
|
] }, name);
|
|
974
1096
|
case "textarea":
|
|
975
|
-
return /* @__PURE__ */ (0,
|
|
976
|
-
/* @__PURE__ */ (0,
|
|
1097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-4 flex items-start space-x-4", children: [
|
|
1098
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { htmlFor: name, className: "text-sm font-medium text-gray-700 min-w-[120px] pt-2", children: [
|
|
977
1099
|
label,
|
|
978
|
-
required && /* @__PURE__ */ (0,
|
|
1100
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-red-500", children: "*" })
|
|
979
1101
|
] }),
|
|
980
|
-
/* @__PURE__ */ (0,
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
981
1103
|
"textarea",
|
|
982
1104
|
{
|
|
983
1105
|
id: name,
|
|
@@ -993,12 +1115,12 @@ var FormInteraction = ({
|
|
|
993
1115
|
)
|
|
994
1116
|
] }, name);
|
|
995
1117
|
case "select":
|
|
996
|
-
return /* @__PURE__ */ (0,
|
|
997
|
-
/* @__PURE__ */ (0,
|
|
1118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-4 flex items-center space-x-4", children: [
|
|
1119
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { htmlFor: name, className: "text-sm font-medium text-gray-700 min-w-[120px]", children: [
|
|
998
1120
|
label,
|
|
999
|
-
required && /* @__PURE__ */ (0,
|
|
1121
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1000
1122
|
] }),
|
|
1001
|
-
/* @__PURE__ */ (0,
|
|
1123
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1002
1124
|
"select",
|
|
1003
1125
|
{
|
|
1004
1126
|
id: name,
|
|
@@ -1009,17 +1131,17 @@ var FormInteraction = ({
|
|
|
1009
1131
|
disabled: isResponseSubmitted,
|
|
1010
1132
|
className: "flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",
|
|
1011
1133
|
children: [
|
|
1012
|
-
/* @__PURE__ */ (0,
|
|
1013
|
-
options == null ? void 0 : options.map((option, index) => /* @__PURE__ */ (0,
|
|
1134
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "", disabled: true, children: placeholder || "Select an option" }),
|
|
1135
|
+
options == null ? void 0 : options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: option, children: option }, index))
|
|
1014
1136
|
]
|
|
1015
1137
|
}
|
|
1016
1138
|
)
|
|
1017
1139
|
] }, name);
|
|
1018
1140
|
case "checkbox":
|
|
1019
|
-
return /* @__PURE__ */ (0,
|
|
1020
|
-
/* @__PURE__ */ (0,
|
|
1021
|
-
/* @__PURE__ */ (0,
|
|
1022
|
-
/* @__PURE__ */ (0,
|
|
1141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-4 flex items-center space-x-4", children: [
|
|
1142
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "min-w-[120px]" }),
|
|
1143
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center", children: [
|
|
1144
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1023
1145
|
"input",
|
|
1024
1146
|
{
|
|
1025
1147
|
type: "checkbox",
|
|
@@ -1032,20 +1154,20 @@ var FormInteraction = ({
|
|
|
1032
1154
|
className: "h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"
|
|
1033
1155
|
}
|
|
1034
1156
|
),
|
|
1035
|
-
/* @__PURE__ */ (0,
|
|
1157
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { htmlFor: name, className: "ml-2 text-sm text-gray-700", children: [
|
|
1036
1158
|
label,
|
|
1037
|
-
required && /* @__PURE__ */ (0,
|
|
1159
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1038
1160
|
] })
|
|
1039
1161
|
] })
|
|
1040
1162
|
] }, name);
|
|
1041
1163
|
case "radio":
|
|
1042
|
-
return /* @__PURE__ */ (0,
|
|
1043
|
-
/* @__PURE__ */ (0,
|
|
1164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mb-4 flex space-x-4", children: [
|
|
1165
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "text-sm font-medium text-gray-700 min-w-[120px] pt-2", children: [
|
|
1044
1166
|
label,
|
|
1045
|
-
required && /* @__PURE__ */ (0,
|
|
1167
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1046
1168
|
] }),
|
|
1047
|
-
/* @__PURE__ */ (0,
|
|
1048
|
-
/* @__PURE__ */ (0,
|
|
1169
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex-1 space-y-2", children: options == null ? void 0 : options.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center", children: [
|
|
1170
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1049
1171
|
"input",
|
|
1050
1172
|
{
|
|
1051
1173
|
id: `${name}-${index}`,
|
|
@@ -1059,7 +1181,7 @@ var FormInteraction = ({
|
|
|
1059
1181
|
className: "h-4 w-4 text-blue-600 border-gray-300 focus:ring-blue-500"
|
|
1060
1182
|
}
|
|
1061
1183
|
),
|
|
1062
|
-
/* @__PURE__ */ (0,
|
|
1184
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: `${name}-${index}`, className: "ml-2 text-sm text-gray-700", children: option })
|
|
1063
1185
|
] }, index)) })
|
|
1064
1186
|
] }, name);
|
|
1065
1187
|
default:
|
|
@@ -1067,27 +1189,27 @@ var FormInteraction = ({
|
|
|
1067
1189
|
}
|
|
1068
1190
|
};
|
|
1069
1191
|
if (isResponseSubmitted) {
|
|
1070
|
-
return /* @__PURE__ */ (0,
|
|
1071
|
-
/* @__PURE__ */ (0,
|
|
1072
|
-
/* @__PURE__ */ (0,
|
|
1192
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "mt-2 bg-gray-50 p-3 rounded-md border border-gray-200", children: [
|
|
1193
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex justify-between items-center cursor-pointer", onClick: () => setIsExpanded(!isExpanded), children: [
|
|
1194
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "font-medium text-gray-700", children: [
|
|
1073
1195
|
isExpanded ? "Hide" : "Show",
|
|
1074
1196
|
" Form Responses"
|
|
1075
1197
|
] }),
|
|
1076
|
-
isExpanded ? /* @__PURE__ */ (0,
|
|
1198
|
+
isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react.ChevronUpIcon, { className: "h-5 w-5 text-gray-500" }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react.ChevronDownIcon, { className: "h-5 w-5 text-gray-500" })
|
|
1077
1199
|
] }),
|
|
1078
|
-
isExpanded && /* @__PURE__ */ (0,
|
|
1079
|
-
/* @__PURE__ */ (0,
|
|
1200
|
+
isExpanded && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-2 space-y-2", children: parsedFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex", children: [
|
|
1201
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "text-sm font-medium text-gray-600 mr-2", children: [
|
|
1080
1202
|
field.label,
|
|
1081
1203
|
":"
|
|
1082
1204
|
] }),
|
|
1083
|
-
/* @__PURE__ */ (0,
|
|
1205
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm text-gray-800", children: typeof (submittedValues == null ? void 0 : submittedValues[field.name]) === "boolean" ? submittedValues[field.name] ? "Yes" : "No" : (submittedValues == null ? void 0 : submittedValues[field.name]) || "Not provided" })
|
|
1084
1206
|
] }, field.name)) })
|
|
1085
1207
|
] });
|
|
1086
1208
|
}
|
|
1087
|
-
return /* @__PURE__ */ (0,
|
|
1209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mt-2", children: isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "p-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("form", { onSubmit: handleSubmit, className: "mt-4", children: [
|
|
1088
1210
|
parsedFields.map((field) => renderField(field)),
|
|
1089
|
-
/* @__PURE__ */ (0,
|
|
1090
|
-
/* @__PURE__ */ (0,
|
|
1211
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { ref: formButtonsRef, className: "flex justify-end mt-4 space-x-2", children: [
|
|
1212
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1091
1213
|
"button",
|
|
1092
1214
|
{
|
|
1093
1215
|
type: "button",
|
|
@@ -1097,7 +1219,7 @@ var FormInteraction = ({
|
|
|
1097
1219
|
children: params.cancelText
|
|
1098
1220
|
}
|
|
1099
1221
|
),
|
|
1100
|
-
/* @__PURE__ */ (0,
|
|
1222
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1101
1223
|
"button",
|
|
1102
1224
|
{
|
|
1103
1225
|
type: "submit",
|
|
@@ -1112,12 +1234,12 @@ var FormInteraction = ({
|
|
|
1112
1234
|
var FormInteraction_default = FormInteraction;
|
|
1113
1235
|
|
|
1114
1236
|
// src/ui/react/components/interactive/PresentInteraction.tsx
|
|
1115
|
-
var
|
|
1237
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1116
1238
|
var ReactMarkdown2;
|
|
1117
1239
|
try {
|
|
1118
1240
|
ReactMarkdown2 = require("react-markdown");
|
|
1119
1241
|
} catch (error) {
|
|
1120
|
-
ReactMarkdown2 = ({ children }) => /* @__PURE__ */ (0,
|
|
1242
|
+
ReactMarkdown2 = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap", children });
|
|
1121
1243
|
}
|
|
1122
1244
|
var PresentInteraction = ({
|
|
1123
1245
|
parameters
|
|
@@ -1155,15 +1277,15 @@ var PresentInteraction = ({
|
|
|
1155
1277
|
}
|
|
1156
1278
|
};
|
|
1157
1279
|
const styles = getLevelStyles();
|
|
1158
|
-
return /* @__PURE__ */ (0,
|
|
1159
|
-
title && /* @__PURE__ */ (0,
|
|
1160
|
-
/* @__PURE__ */ (0,
|
|
1280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `mt-2 mb-4 p-4 ${styles.container} border rounded-md`, children: [
|
|
1281
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `font-medium ${styles.title} mb-2`, children: title }),
|
|
1282
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `text-sm ${styles.content}`, children: format === "markdown" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ReactMarkdown2, { className: "prose prose-sm max-w-none", children: content }) : format === "html" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { dangerouslySetInnerHTML: { __html: content } }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "whitespace-pre-wrap", children: content }) })
|
|
1161
1283
|
] });
|
|
1162
1284
|
};
|
|
1163
1285
|
var PresentInteraction_default = PresentInteraction;
|
|
1164
1286
|
|
|
1165
1287
|
// src/ui/react/components/interactive/InteractiveMessageHandler.tsx
|
|
1166
|
-
var
|
|
1288
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1167
1289
|
var InteractiveMessageHandler = ({
|
|
1168
1290
|
message,
|
|
1169
1291
|
onResponse,
|
|
@@ -1174,7 +1296,7 @@ var InteractiveMessageHandler = ({
|
|
|
1174
1296
|
const submittedResponse = parentMessage == null ? void 0 : parentMessage.responseValue;
|
|
1175
1297
|
switch (functionType) {
|
|
1176
1298
|
case "confirm":
|
|
1177
|
-
return /* @__PURE__ */ (0,
|
|
1299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1178
1300
|
ConfirmInteraction_default,
|
|
1179
1301
|
{
|
|
1180
1302
|
parameters,
|
|
@@ -1183,7 +1305,7 @@ var InteractiveMessageHandler = ({
|
|
|
1183
1305
|
}
|
|
1184
1306
|
);
|
|
1185
1307
|
case "select":
|
|
1186
|
-
return /* @__PURE__ */ (0,
|
|
1308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1187
1309
|
SelectInteraction_default,
|
|
1188
1310
|
{
|
|
1189
1311
|
parameters,
|
|
@@ -1193,7 +1315,7 @@ var InteractiveMessageHandler = ({
|
|
|
1193
1315
|
}
|
|
1194
1316
|
);
|
|
1195
1317
|
case "form":
|
|
1196
|
-
return /* @__PURE__ */ (0,
|
|
1318
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1197
1319
|
FormInteraction_default,
|
|
1198
1320
|
{
|
|
1199
1321
|
parameters,
|
|
@@ -1203,7 +1325,7 @@ var InteractiveMessageHandler = ({
|
|
|
1203
1325
|
}
|
|
1204
1326
|
);
|
|
1205
1327
|
case "present":
|
|
1206
|
-
return /* @__PURE__ */ (0,
|
|
1328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1207
1329
|
PresentInteraction_default,
|
|
1208
1330
|
{
|
|
1209
1331
|
parameters
|
|
@@ -1219,8 +1341,8 @@ var InteractiveMessageHandler = ({
|
|
|
1219
1341
|
var InteractiveMessageHandler_default = InteractiveMessageHandler;
|
|
1220
1342
|
|
|
1221
1343
|
// src/ui/react/components/ChatMessageList.tsx
|
|
1222
|
-
var
|
|
1223
|
-
var
|
|
1344
|
+
var import_outline3 = require("@heroicons/react/24/outline");
|
|
1345
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1224
1346
|
var ChatMessageList = ({
|
|
1225
1347
|
chatHistory,
|
|
1226
1348
|
isProcessing,
|
|
@@ -1229,10 +1351,10 @@ var ChatMessageList = ({
|
|
|
1229
1351
|
getContextExample,
|
|
1230
1352
|
onInteractiveResponse
|
|
1231
1353
|
}) => {
|
|
1232
|
-
const chatContainerRef = (0,
|
|
1233
|
-
const lastMessageRef = (0,
|
|
1234
|
-
const processingIndicatorRef = (0,
|
|
1235
|
-
(0,
|
|
1354
|
+
const chatContainerRef = (0, import_react10.useRef)(null);
|
|
1355
|
+
const lastMessageRef = (0, import_react10.useRef)(null);
|
|
1356
|
+
const processingIndicatorRef = (0, import_react10.useRef)(null);
|
|
1357
|
+
(0, import_react10.useEffect)(() => {
|
|
1236
1358
|
if (isProcessing && processingIndicatorRef.current) {
|
|
1237
1359
|
processingIndicatorRef.current.scrollIntoView({ behavior: "smooth" });
|
|
1238
1360
|
return;
|
|
@@ -1248,15 +1370,15 @@ var ChatMessageList = ({
|
|
|
1248
1370
|
onInteractiveResponse(messageId, response);
|
|
1249
1371
|
}
|
|
1250
1372
|
};
|
|
1251
|
-
return /* @__PURE__ */ (0,
|
|
1373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1252
1374
|
"div",
|
|
1253
1375
|
{
|
|
1254
1376
|
ref: chatContainerRef,
|
|
1255
1377
|
className: "flex-1 overflow-y-auto p-4 space-y-8 bg-gray-50",
|
|
1256
1378
|
children: [
|
|
1257
|
-
chatHistory.length === 0 && !isProcessing && /* @__PURE__ */ (0,
|
|
1258
|
-
/* @__PURE__ */ (0,
|
|
1259
|
-
/* @__PURE__ */ (0,
|
|
1379
|
+
chatHistory.length === 0 && !isProcessing && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "text-center py-8", children: [
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "text-lg font-medium text-gray-700 mb-2", children: "How can I help you today?" }),
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "text-sm text-gray-500 mb-4", children: [
|
|
1260
1382
|
"Try asking me something like ",
|
|
1261
1383
|
getContextExample()
|
|
1262
1384
|
] })
|
|
@@ -1265,14 +1387,14 @@ var ChatMessageList = ({
|
|
|
1265
1387
|
const isLastMessage = index === chatHistory.length - 1;
|
|
1266
1388
|
const isUser = message.role === "user";
|
|
1267
1389
|
const isError = message.role === "error";
|
|
1268
|
-
return /* @__PURE__ */ (0,
|
|
1390
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1269
1391
|
"div",
|
|
1270
1392
|
{
|
|
1271
1393
|
ref: isLastMessage ? lastMessageRef : void 0,
|
|
1272
1394
|
className: `flex flex-col w-full ${isUser ? "items-end" : "items-start"}`,
|
|
1273
1395
|
children: [
|
|
1274
|
-
/* @__PURE__ */ (0,
|
|
1275
|
-
/* @__PURE__ */ (0,
|
|
1396
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "text-xs text-gray-400 mb-1 px-1", children: message.timestamp ? `${isUser ? "Sent" : "Received"} at ${new Date(message.timestamp).toLocaleString()}` : "" }),
|
|
1397
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-full", children: message.interactive && message.interactiveData ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `max-w-[85%] ${isUser ? "ml-auto" : "mr-auto"}`, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1276
1398
|
InteractiveMessageHandler_default,
|
|
1277
1399
|
{
|
|
1278
1400
|
message: message.interactiveData,
|
|
@@ -1284,16 +1406,16 @@ var ChatMessageList = ({
|
|
|
1284
1406
|
isResponseSubmitted: !!message.isResponseSubmitted,
|
|
1285
1407
|
parentMessage: message
|
|
1286
1408
|
}
|
|
1287
|
-
) }) : /* @__PURE__ */ (0,
|
|
1409
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1288
1410
|
MessageBubble,
|
|
1289
1411
|
{
|
|
1290
1412
|
message,
|
|
1291
1413
|
isUser
|
|
1292
1414
|
}
|
|
1293
1415
|
) }),
|
|
1294
|
-
isUser && message.interactive && /* @__PURE__ */ (0,
|
|
1295
|
-
/* @__PURE__ */ (0,
|
|
1296
|
-
/* @__PURE__ */ (0,
|
|
1416
|
+
isUser && message.interactive && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center mt-1 space-x-1 text-xs text-gray-500 italic", children: [
|
|
1417
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_outline3.InformationCircleIcon, { className: "h-3 w-3 text-blue-400" }),
|
|
1418
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
|
|
1297
1419
|
message.request === "form" && "Response to form submission",
|
|
1298
1420
|
message.request === "select" && "Response to selection prompt",
|
|
1299
1421
|
message.request === "confirm" && "Response to confirmation prompt"
|
|
@@ -1304,29 +1426,29 @@ var ChatMessageList = ({
|
|
|
1304
1426
|
message.id || `message-${index}`
|
|
1305
1427
|
);
|
|
1306
1428
|
}),
|
|
1307
|
-
isProcessing && /* @__PURE__ */ (0,
|
|
1429
|
+
isProcessing && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1308
1430
|
"div",
|
|
1309
1431
|
{
|
|
1310
1432
|
ref: processingIndicatorRef,
|
|
1311
1433
|
className: "flex justify-start my-4",
|
|
1312
|
-
children: /* @__PURE__ */ (0,
|
|
1313
|
-
/* @__PURE__ */ (0,
|
|
1314
|
-
/* @__PURE__ */ (0,
|
|
1315
|
-
/* @__PURE__ */ (0,
|
|
1316
|
-
/* @__PURE__ */ (0,
|
|
1317
|
-
/* @__PURE__ */ (0,
|
|
1434
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "bg-white text-gray-800 border border-gray-200 rounded-lg px-4 py-2 max-w-[85%]", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center", children: [
|
|
1435
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-sm", children: processingHint }),
|
|
1436
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "ml-2 flex space-x-1", children: [
|
|
1437
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "h-2 w-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
|
|
1438
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "h-2 w-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
|
|
1439
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "h-2 w-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
|
|
1318
1440
|
] })
|
|
1319
1441
|
] }) })
|
|
1320
1442
|
}
|
|
1321
1443
|
),
|
|
1322
|
-
currentTask && !currentTask.complete && /* @__PURE__ */ (0,
|
|
1323
|
-
/* @__PURE__ */ (0,
|
|
1444
|
+
currentTask && !currentTask.complete && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mt-4 bg-blue-50 border border-blue-100 rounded-lg p-3", children: [
|
|
1445
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "text-sm text-blue-800 mb-1", children: [
|
|
1324
1446
|
"Task in progress: Step ",
|
|
1325
1447
|
currentTask.currentStep,
|
|
1326
1448
|
" of ",
|
|
1327
1449
|
currentTask.steps
|
|
1328
1450
|
] }),
|
|
1329
|
-
/* @__PURE__ */ (0,
|
|
1451
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-full bg-blue-200 rounded-full h-2", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1330
1452
|
"div",
|
|
1331
1453
|
{
|
|
1332
1454
|
className: "bg-blue-500 h-2 rounded-full",
|
|
@@ -1341,34 +1463,34 @@ var ChatMessageList = ({
|
|
|
1341
1463
|
|
|
1342
1464
|
// src/ui/react/components/ConnectionStatus.tsx
|
|
1343
1465
|
var import_lucide_react2 = require("lucide-react");
|
|
1344
|
-
var
|
|
1466
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1345
1467
|
var ConnectionStatus = ({
|
|
1346
1468
|
connectionStatus,
|
|
1347
1469
|
onReconnect
|
|
1348
1470
|
}) => {
|
|
1349
|
-
return /* @__PURE__ */ (0,
|
|
1350
|
-
/* @__PURE__ */ (0,
|
|
1351
|
-
connectionStatus === "connected" && /* @__PURE__ */ (0,
|
|
1352
|
-
/* @__PURE__ */ (0,
|
|
1353
|
-
/* @__PURE__ */ (0,
|
|
1471
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "bg-amber-100 connection-status flex items-center justify-between px-4 py-1 text-xs", children: [
|
|
1472
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "text-gray-700 font-medium", children: "You are talking with your personal Content Strategist" }),
|
|
1473
|
+
connectionStatus === "connected" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center text-green-600", children: [
|
|
1474
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react2.Wifi, { className: "w-3 h-3 mr-1" }),
|
|
1475
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Connected" })
|
|
1354
1476
|
] }),
|
|
1355
|
-
connectionStatus === "reconnecting" && /* @__PURE__ */ (0,
|
|
1356
|
-
/* @__PURE__ */ (0,
|
|
1357
|
-
/* @__PURE__ */ (0,
|
|
1477
|
+
connectionStatus === "reconnecting" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center text-amber-600", children: [
|
|
1478
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react2.RefreshCw, { className: "w-3 h-3 mr-1 animate-spin" }),
|
|
1479
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Reconnecting..." })
|
|
1358
1480
|
] }),
|
|
1359
|
-
connectionStatus === "disconnected" && /* @__PURE__ */ (0,
|
|
1360
|
-
/* @__PURE__ */ (0,
|
|
1361
|
-
/* @__PURE__ */ (0,
|
|
1362
|
-
/* @__PURE__ */ (0,
|
|
1481
|
+
connectionStatus === "disconnected" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
1482
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "text-red-600 flex items-center", children: [
|
|
1483
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react2.WifiOff, { className: "w-3 h-3 mr-1" }),
|
|
1484
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Disconnected" })
|
|
1363
1485
|
] }),
|
|
1364
|
-
/* @__PURE__ */ (0,
|
|
1486
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
1365
1487
|
"button",
|
|
1366
1488
|
{
|
|
1367
1489
|
onClick: onReconnect,
|
|
1368
1490
|
className: "text-blue-600 hover:text-blue-800 flex items-center",
|
|
1369
1491
|
children: [
|
|
1370
|
-
/* @__PURE__ */ (0,
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1492
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react2.RefreshCw, { className: "w-3 h-3 mr-1" }),
|
|
1493
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: "Reconnect" })
|
|
1372
1494
|
]
|
|
1373
1495
|
}
|
|
1374
1496
|
)
|
|
@@ -1377,7 +1499,7 @@ var ConnectionStatus = ({
|
|
|
1377
1499
|
};
|
|
1378
1500
|
|
|
1379
1501
|
// src/ui/react/components/Spinner.tsx
|
|
1380
|
-
var
|
|
1502
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1381
1503
|
var Spinner = ({
|
|
1382
1504
|
size = "md",
|
|
1383
1505
|
className = "",
|
|
@@ -1389,7 +1511,7 @@ var Spinner = ({
|
|
|
1389
1511
|
lg: "h-8 w-8",
|
|
1390
1512
|
xl: "h-12 w-12"
|
|
1391
1513
|
};
|
|
1392
|
-
return /* @__PURE__ */ (0,
|
|
1514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
1393
1515
|
"svg",
|
|
1394
1516
|
{
|
|
1395
1517
|
className: `animate-spin ${sizeClasses[size]} ${color} ${className}`,
|
|
@@ -1397,7 +1519,7 @@ var Spinner = ({
|
|
|
1397
1519
|
fill: "none",
|
|
1398
1520
|
viewBox: "0 0 24 24",
|
|
1399
1521
|
children: [
|
|
1400
|
-
/* @__PURE__ */ (0,
|
|
1522
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1401
1523
|
"circle",
|
|
1402
1524
|
{
|
|
1403
1525
|
className: "opacity-25",
|
|
@@ -1408,7 +1530,7 @@ var Spinner = ({
|
|
|
1408
1530
|
strokeWidth: "4"
|
|
1409
1531
|
}
|
|
1410
1532
|
),
|
|
1411
|
-
/* @__PURE__ */ (0,
|
|
1533
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1412
1534
|
"path",
|
|
1413
1535
|
{
|
|
1414
1536
|
className: "opacity-75",
|
|
@@ -1472,6 +1594,7 @@ function createWhisperVoiceConfig(config, callbacks) {
|
|
|
1472
1594
|
ConnectionStatus,
|
|
1473
1595
|
MessageBubble,
|
|
1474
1596
|
Spinner,
|
|
1597
|
+
TapToTalk,
|
|
1475
1598
|
createWhisperVoiceConfig,
|
|
1476
1599
|
transcribeAudio,
|
|
1477
1600
|
useAudioRecorder,
|