@emblemvault/hustle-react 1.5.0 → 1.5.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.
- package/dist/browser/hustle-react.js +42 -2
- package/dist/browser/hustle-react.js.map +1 -1
- package/dist/components/index.cjs +42 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +5 -1
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +42 -2
- package/dist/components/index.js.map +1 -1
- package/dist/index.cjs +42 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +42 -2
- package/dist/index.js.map +1 -1
- package/package.json +12 -11
|
@@ -15265,6 +15265,8 @@ function HustleChat({
|
|
|
15265
15265
|
className = "",
|
|
15266
15266
|
placeholder = "Type a message...",
|
|
15267
15267
|
showSettings = false,
|
|
15268
|
+
settingsPanelOpen: controlledSettingsPanelOpen,
|
|
15269
|
+
onSettingsPanelOpenChange,
|
|
15268
15270
|
showDebug = false,
|
|
15269
15271
|
hideHeader = false,
|
|
15270
15272
|
initialSystemPrompt = "",
|
|
@@ -15304,7 +15306,17 @@ function HustleChat({
|
|
|
15304
15306
|
const [isStreaming, setIsStreaming] = useState(false);
|
|
15305
15307
|
const [attachments, setAttachments] = useState([]);
|
|
15306
15308
|
const [currentToolCalls, setCurrentToolCalls] = useState([]);
|
|
15307
|
-
const [
|
|
15309
|
+
const [internalShowSettingsPanel, setInternalShowSettingsPanel] = useState(false);
|
|
15310
|
+
const isSettingsControlled = controlledSettingsPanelOpen !== void 0;
|
|
15311
|
+
const showSettingsPanel = isSettingsControlled ? controlledSettingsPanelOpen : internalShowSettingsPanel;
|
|
15312
|
+
const setShowSettingsPanel = (open) => {
|
|
15313
|
+
const newValue = typeof open === "function" ? open(showSettingsPanel) : open;
|
|
15314
|
+
if (isSettingsControlled) {
|
|
15315
|
+
onSettingsPanelOpenChange?.(newValue);
|
|
15316
|
+
} else {
|
|
15317
|
+
setInternalShowSettingsPanel(newValue);
|
|
15318
|
+
}
|
|
15319
|
+
};
|
|
15308
15320
|
const [speechToTextEnabled, setSpeechToTextEnabled] = useState(() => {
|
|
15309
15321
|
if (typeof window !== "undefined") {
|
|
15310
15322
|
const stored = localStorage.getItem(`hustle-stt-enabled-${instanceId}`);
|
|
@@ -16177,6 +16189,12 @@ function CloseIcon() {
|
|
|
16177
16189
|
/* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
16178
16190
|
] });
|
|
16179
16191
|
}
|
|
16192
|
+
function SettingsIcon2() {
|
|
16193
|
+
return /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
16194
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "3" }),
|
|
16195
|
+
/* @__PURE__ */ jsx("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z" })
|
|
16196
|
+
] });
|
|
16197
|
+
}
|
|
16180
16198
|
function ExpandIcon() {
|
|
16181
16199
|
return /* @__PURE__ */ jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
16182
16200
|
/* @__PURE__ */ jsx("polyline", { points: "15 3 21 3 21 9" }),
|
|
@@ -16225,6 +16243,8 @@ function HustleChatWidget({
|
|
|
16225
16243
|
const [isHovered, setIsHovered] = useState(false);
|
|
16226
16244
|
const [closeHovered, setCloseHovered] = useState(false);
|
|
16227
16245
|
const [mounted, setMounted] = useState(false);
|
|
16246
|
+
const [settingsOpen, setSettingsOpen] = useState(false);
|
|
16247
|
+
const { showSettings, ...restChatProps } = chatProps;
|
|
16228
16248
|
useEffect(() => {
|
|
16229
16249
|
setMounted(true);
|
|
16230
16250
|
if (storageKey && typeof window !== "undefined") {
|
|
@@ -16334,6 +16354,18 @@ function HustleChatWidget({
|
|
|
16334
16354
|
] })
|
|
16335
16355
|
] }),
|
|
16336
16356
|
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: tokens.spacing.xs }, children: [
|
|
16357
|
+
showSettings && /* @__PURE__ */ jsx(
|
|
16358
|
+
"button",
|
|
16359
|
+
{
|
|
16360
|
+
onClick: () => setSettingsOpen(!settingsOpen),
|
|
16361
|
+
style: {
|
|
16362
|
+
...widgetStyles.closeBtn,
|
|
16363
|
+
...settingsOpen ? { background: tokens.colors.bgSecondary } : {}
|
|
16364
|
+
},
|
|
16365
|
+
title: "Settings",
|
|
16366
|
+
children: /* @__PURE__ */ jsx(SettingsIcon2, {})
|
|
16367
|
+
}
|
|
16368
|
+
),
|
|
16337
16369
|
size === "sideDock" && /* @__PURE__ */ jsx(
|
|
16338
16370
|
"button",
|
|
16339
16371
|
{
|
|
@@ -16368,7 +16400,15 @@ function HustleChatWidget({
|
|
|
16368
16400
|
]
|
|
16369
16401
|
}
|
|
16370
16402
|
),
|
|
16371
|
-
/* @__PURE__ */ jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: /* @__PURE__ */ jsx(
|
|
16403
|
+
/* @__PURE__ */ jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", overflow: "hidden" }, children: /* @__PURE__ */ jsx(
|
|
16404
|
+
HustleChatInner,
|
|
16405
|
+
{
|
|
16406
|
+
...restChatProps,
|
|
16407
|
+
showSettings,
|
|
16408
|
+
settingsPanelOpen: settingsOpen,
|
|
16409
|
+
onSettingsPanelOpenChange: setSettingsOpen
|
|
16410
|
+
}
|
|
16411
|
+
) })
|
|
16372
16412
|
]
|
|
16373
16413
|
}
|
|
16374
16414
|
),
|