@trops/dash-core 0.1.757 → 0.1.759
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/index.esm.js +297 -500
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +296 -499
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -56769,70 +56769,6 @@ var PlanSketch = function PlanSketch(_ref) {
|
|
|
56769
56769
|
});
|
|
56770
56770
|
};
|
|
56771
56771
|
|
|
56772
|
-
function useBubbleTokens() {
|
|
56773
|
-
var _ref = React.useContext(DashReact.ThemeContext) || {},
|
|
56774
|
-
currentTheme = _ref.currentTheme;
|
|
56775
|
-
return {
|
|
56776
|
-
reply: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-secondary-dark"]) || (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-dark"]) || "",
|
|
56777
|
-
you: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-medium"]) || "",
|
|
56778
|
-
text: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["text-primary-medium"]) || ""
|
|
56779
|
-
};
|
|
56780
|
-
}
|
|
56781
|
-
|
|
56782
|
-
/** What the user said, right-aligned. */
|
|
56783
|
-
var YouBubble = function YouBubble(_ref2) {
|
|
56784
|
-
var children = _ref2.children;
|
|
56785
|
-
var t = useBubbleTokens();
|
|
56786
|
-
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
56787
|
-
className: "flex justify-end",
|
|
56788
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
56789
|
-
className: "max-w-xl",
|
|
56790
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
56791
|
-
block: true,
|
|
56792
|
-
className: "font-semibold uppercase tracking-wider mb-1 text-right",
|
|
56793
|
-
children: "You"
|
|
56794
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
56795
|
-
className: "px-3 py-2 rounded-lg text-sm whitespace-pre-wrap break-words leading-relaxed ".concat(t.you, " ").concat(t.text),
|
|
56796
|
-
children: children
|
|
56797
|
-
})]
|
|
56798
|
-
})
|
|
56799
|
-
});
|
|
56800
|
-
};
|
|
56801
|
-
|
|
56802
|
-
/**
|
|
56803
|
-
* A team member's reply: its label ("Planner"), an optional meta line
|
|
56804
|
-
* (model · tokens), the text, and anything below it (a button).
|
|
56805
|
-
*/
|
|
56806
|
-
var TeamBubble = function TeamBubble(_ref3) {
|
|
56807
|
-
var _ref3$label = _ref3.label,
|
|
56808
|
-
label = _ref3$label === void 0 ? "Planner" : _ref3$label,
|
|
56809
|
-
_ref3$meta = _ref3.meta,
|
|
56810
|
-
meta = _ref3$meta === void 0 ? null : _ref3$meta,
|
|
56811
|
-
_ref3$muted = _ref3.muted,
|
|
56812
|
-
muted = _ref3$muted === void 0 ? false : _ref3$muted,
|
|
56813
|
-
testId = _ref3.testId,
|
|
56814
|
-
children = _ref3.children,
|
|
56815
|
-
_ref3$footer = _ref3.footer,
|
|
56816
|
-
footer = _ref3$footer === void 0 ? null : _ref3$footer;
|
|
56817
|
-
var t = useBubbleTokens();
|
|
56818
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
56819
|
-
className: "flex flex-col gap-1",
|
|
56820
|
-
"data-testid": testId,
|
|
56821
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
56822
|
-
className: "flex flex-row items-center gap-2",
|
|
56823
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
56824
|
-
className: "font-semibold uppercase tracking-wider",
|
|
56825
|
-
children: label
|
|
56826
|
-
}), meta ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
56827
|
-
children: meta
|
|
56828
|
-
}) : null]
|
|
56829
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
56830
|
-
className: "px-3 py-2 rounded-lg text-sm whitespace-pre-wrap break-words leading-relaxed ".concat(t.reply, " ").concat(t.text, " ").concat(muted ? "opacity-70 italic" : ""),
|
|
56831
|
-
children: children
|
|
56832
|
-
}), footer]
|
|
56833
|
-
});
|
|
56834
|
-
};
|
|
56835
|
-
|
|
56836
56772
|
function ownKeys$J(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
56837
56773
|
function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$J(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$J(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
56838
56774
|
function reopenedRequest(original, plan, text) {
|
|
@@ -57406,19 +57342,30 @@ var CreatePlanStep = function CreatePlanStep(_ref2) {
|
|
|
57406
57342
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
57407
57343
|
className: "mx-auto w-full max-w-3xl flex flex-col ".concat(compact ? "gap-3 px-3 py-3" : "gap-4 px-6 py-8"),
|
|
57408
57344
|
children: [messages.map(function (m, i) {
|
|
57409
|
-
return m.who === "you" ? /*#__PURE__*/jsxRuntime.jsx(
|
|
57345
|
+
return m.who === "you" ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatMessage, {
|
|
57346
|
+
role: "you",
|
|
57410
57347
|
children: m.text
|
|
57411
|
-
}, i) : m.who === "note" ? /*#__PURE__*/jsxRuntime.jsx(
|
|
57412
|
-
|
|
57348
|
+
}, i) : m.who === "note" ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatMessage, {
|
|
57349
|
+
role: "note",
|
|
57413
57350
|
children: m.text
|
|
57414
|
-
}, i) : /*#__PURE__*/jsxRuntime.jsx(
|
|
57351
|
+
}, i) : /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatMessage, {
|
|
57352
|
+
role: "reply",
|
|
57353
|
+
label: "Planner",
|
|
57415
57354
|
meta: m.meta,
|
|
57416
57355
|
testId: "planner-message",
|
|
57417
|
-
children:
|
|
57356
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
57357
|
+
className: "whitespace-pre-wrap",
|
|
57358
|
+
children: m.text
|
|
57359
|
+
})
|
|
57418
57360
|
}, i);
|
|
57419
|
-
}), busy ? /*#__PURE__*/jsxRuntime.jsx(
|
|
57420
|
-
|
|
57421
|
-
|
|
57361
|
+
}), busy ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatMessage, {
|
|
57362
|
+
role: "reply",
|
|
57363
|
+
label: "Planner",
|
|
57364
|
+
streaming: true,
|
|
57365
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
57366
|
+
className: "whitespace-pre-wrap",
|
|
57367
|
+
children: withoutPlan(soFar) || "Thinking…"
|
|
57368
|
+
})
|
|
57422
57369
|
}) : null, !busy && questions.length ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
57423
57370
|
className: "flex flex-col gap-3",
|
|
57424
57371
|
"data-testid": "plan-questions",
|
|
@@ -57682,33 +57629,22 @@ var CreatePlanStep = function CreatePlanStep(_ref2) {
|
|
|
57682
57629
|
setWalking(false);
|
|
57683
57630
|
}
|
|
57684
57631
|
}) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
57685
|
-
className: "flex-shrink-0
|
|
57686
|
-
children: /*#__PURE__*/jsxRuntime.
|
|
57687
|
-
className: "mx-auto w-full max-w-3xl
|
|
57688
|
-
children:
|
|
57689
|
-
|
|
57690
|
-
|
|
57691
|
-
|
|
57692
|
-
|
|
57693
|
-
|
|
57694
|
-
|
|
57695
|
-
},
|
|
57696
|
-
placeholder: busy ? "The Planner is working…" : "Answer, or ask for changes…",
|
|
57697
|
-
rows: 2,
|
|
57698
|
-
onKeyDown: function onKeyDown(e) {
|
|
57699
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
57700
|
-
e.preventDefault();
|
|
57701
|
-
answer(reply);
|
|
57702
|
-
}
|
|
57703
|
-
}
|
|
57704
|
-
})
|
|
57705
|
-
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
57706
|
-
title: "Send",
|
|
57707
|
-
onClick: function onClick() {
|
|
57632
|
+
className: "flex-shrink-0",
|
|
57633
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
57634
|
+
className: "mx-auto w-full max-w-3xl",
|
|
57635
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatComposer, {
|
|
57636
|
+
ariaLabel: "Reply to the Planner",
|
|
57637
|
+
value: reply,
|
|
57638
|
+
onChange: function onChange(v) {
|
|
57639
|
+
return setReply(v);
|
|
57640
|
+
},
|
|
57641
|
+
onSend: function onSend() {
|
|
57708
57642
|
return answer(reply);
|
|
57709
57643
|
},
|
|
57710
|
-
|
|
57711
|
-
|
|
57644
|
+
busy: busy,
|
|
57645
|
+
placeholder: busy ? "The Planner is working…" : "Answer, or ask for changes…",
|
|
57646
|
+
className: compact ? "" : "px-6 py-3"
|
|
57647
|
+
})
|
|
57712
57648
|
})
|
|
57713
57649
|
})]
|
|
57714
57650
|
});
|
|
@@ -58017,56 +57953,30 @@ var ICONS = {
|
|
|
58017
57953
|
"widget-draft": "pen-to-square"
|
|
58018
57954
|
};
|
|
58019
57955
|
|
|
58020
|
-
/**
|
|
57956
|
+
/**
|
|
57957
|
+
* One row (dash-react ListRow — design guide "List rows"): icon, title, then
|
|
57958
|
+
* status · age underneath; Remove (×) shows on hover, outside the row button.
|
|
57959
|
+
*/
|
|
58021
57960
|
var RecentRow = function RecentRow(_ref) {
|
|
58022
57961
|
var row = _ref.row,
|
|
58023
57962
|
onOpen = _ref.onOpen,
|
|
58024
57963
|
onRemove = _ref.onRemove;
|
|
58025
|
-
|
|
58026
|
-
|
|
58027
|
-
|
|
58028
|
-
|
|
58029
|
-
|
|
58030
|
-
|
|
58031
|
-
|
|
58032
|
-
|
|
58033
|
-
|
|
58034
|
-
|
|
58035
|
-
block: true,
|
|
58036
|
-
onClick: function onClick() {
|
|
58037
|
-
return onOpen(row);
|
|
58038
|
-
},
|
|
58039
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
58040
|
-
className: "flex flex-row items-start gap-2 w-full text-left"
|
|
58041
|
-
// Buttons don't wrap or left-align their text; a row must.
|
|
58042
|
-
,
|
|
58043
|
-
style: {
|
|
58044
|
-
whiteSpace: "normal",
|
|
58045
|
-
minWidth: 0
|
|
58046
|
-
},
|
|
58047
|
-
"aria-label": recentLine(row),
|
|
58048
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
58049
|
-
icon: ICONS[row.kind] || "pen-to-square",
|
|
58050
|
-
className: "h-3.5 w-3.5 mt-0.5 flex-shrink-0"
|
|
58051
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
58052
|
-
className: "flex flex-col min-w-0",
|
|
58053
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
58054
|
-
className: "truncate ".concat(strong),
|
|
58055
|
-
children: row.title
|
|
58056
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
58057
|
-
className: "text-xs ".concat(muted),
|
|
58058
|
-
children: [row.status, " \xB7 ", draftAge(row.updatedAt)]
|
|
58059
|
-
})]
|
|
58060
|
-
})]
|
|
58061
|
-
})
|
|
58062
|
-
})
|
|
58063
|
-
}), onRemove && row.kind !== "widget-draft" ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
57964
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.ListRow, {
|
|
57965
|
+
testId: "recent-row",
|
|
57966
|
+
icon: ICONS[row.kind] || "pen-to-square",
|
|
57967
|
+
title: row.title,
|
|
57968
|
+
meta: "".concat(row.status, " \xB7 ").concat(draftAge(row.updatedAt)),
|
|
57969
|
+
ariaLabel: recentLine(row),
|
|
57970
|
+
onClick: function onClick() {
|
|
57971
|
+
return onOpen(row);
|
|
57972
|
+
},
|
|
57973
|
+
trailing: onRemove && row.kind !== "widget-draft" ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
58064
57974
|
icon: "xmark",
|
|
58065
57975
|
ariaLabel: "Remove ".concat(row.title, " from Recent"),
|
|
58066
57976
|
onClick: function onClick() {
|
|
58067
57977
|
return onRemove(row);
|
|
58068
57978
|
}
|
|
58069
|
-
}) : null
|
|
57979
|
+
}) : null
|
|
58070
57980
|
});
|
|
58071
57981
|
};
|
|
58072
57982
|
|
|
@@ -58590,9 +58500,6 @@ var AskStep = function AskStep(_ref) {
|
|
|
58590
58500
|
recentId = _ref$recentId === void 0 ? null : _ref$recentId,
|
|
58591
58501
|
_ref$onOpenPlan = _ref.onOpenPlan,
|
|
58592
58502
|
onOpenPlan = _ref$onOpenPlan === void 0 ? null : _ref$onOpenPlan;
|
|
58593
|
-
var _useConfigTokens = useConfigTokens(),
|
|
58594
|
-
muted = _useConfigTokens.muted,
|
|
58595
|
-
hairline = _useConfigTokens.hairline;
|
|
58596
58503
|
// [{ who: "you" | "planner" | "note", text, meta?, plan? }]
|
|
58597
58504
|
var _useState = React.useState(recentId ? [] : [{
|
|
58598
58505
|
who: "you",
|
|
@@ -58776,56 +58683,54 @@ var AskStep = function AskStep(_ref) {
|
|
|
58776
58683
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
58777
58684
|
className: "flex flex-col gap-3 px-3 py-3",
|
|
58778
58685
|
children: [messages.map(function (m, i) {
|
|
58779
|
-
return m.who === "you" ? /*#__PURE__*/jsxRuntime.jsx(
|
|
58686
|
+
return m.who === "you" ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatMessage, {
|
|
58687
|
+
role: "you",
|
|
58780
58688
|
children: m.text
|
|
58781
|
-
}, i) : m.who === "note" ? /*#__PURE__*/jsxRuntime.jsx(
|
|
58782
|
-
|
|
58689
|
+
}, i) : m.who === "note" ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatMessage, {
|
|
58690
|
+
role: "note",
|
|
58783
58691
|
children: m.text
|
|
58784
|
-
}, i) : /*#__PURE__*/jsxRuntime.jsx(
|
|
58692
|
+
}, i) : /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatMessage, {
|
|
58693
|
+
role: "reply",
|
|
58694
|
+
label: "Planner",
|
|
58785
58695
|
meta: m.meta,
|
|
58786
58696
|
testId: "ask-answer",
|
|
58787
|
-
footer: m.plan && onOpenPlan ? /*#__PURE__*/jsxRuntime.jsx(
|
|
58788
|
-
|
|
58789
|
-
|
|
58790
|
-
|
|
58791
|
-
|
|
58792
|
-
|
|
58793
|
-
}
|
|
58794
|
-
})
|
|
58697
|
+
footer: m.plan && onOpenPlan ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
|
|
58698
|
+
size: "sm",
|
|
58699
|
+
title: "Open as a plan",
|
|
58700
|
+
onClick: function onClick() {
|
|
58701
|
+
return onOpenPlan(planSeed(m.asked, m.plan));
|
|
58702
|
+
}
|
|
58795
58703
|
}) : null,
|
|
58796
|
-
children:
|
|
58704
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
58705
|
+
className: "whitespace-pre-wrap",
|
|
58706
|
+
children: m.text
|
|
58707
|
+
})
|
|
58797
58708
|
}, i);
|
|
58798
|
-
}), busy ? /*#__PURE__*/jsxRuntime.jsx(
|
|
58799
|
-
|
|
58800
|
-
|
|
58709
|
+
}), busy ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatMessage, {
|
|
58710
|
+
role: "reply",
|
|
58711
|
+
label: "Planner",
|
|
58712
|
+
streaming: true,
|
|
58713
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
58714
|
+
className: "whitespace-pre-wrap",
|
|
58715
|
+
children: withoutPlan(soFar) || "Looking…"
|
|
58716
|
+
})
|
|
58801
58717
|
}) : null]
|
|
58802
58718
|
})
|
|
58803
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
58804
|
-
|
|
58805
|
-
|
|
58806
|
-
|
|
58807
|
-
|
|
58808
|
-
|
|
58809
|
-
|
|
58810
|
-
|
|
58811
|
-
|
|
58812
|
-
|
|
58813
|
-
|
|
58814
|
-
|
|
58815
|
-
|
|
58816
|
-
|
|
58817
|
-
|
|
58818
|
-
send(reply);
|
|
58819
|
-
}
|
|
58820
|
-
}
|
|
58821
|
-
})
|
|
58822
|
-
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
58823
|
-
title: "Send",
|
|
58824
|
-
onClick: function onClick() {
|
|
58825
|
-
return send(reply);
|
|
58826
|
-
},
|
|
58827
|
-
disabled: busy || !reply.trim()
|
|
58828
|
-
})]
|
|
58719
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatComposer, {
|
|
58720
|
+
ariaLabel: "Ask a follow-up",
|
|
58721
|
+
value: reply,
|
|
58722
|
+
onChange: function onChange(v) {
|
|
58723
|
+
return setReply(v);
|
|
58724
|
+
},
|
|
58725
|
+
onSend: function onSend() {
|
|
58726
|
+
return send(reply);
|
|
58727
|
+
},
|
|
58728
|
+
busy: busy,
|
|
58729
|
+
placeholder: busy ? "The Planner is looking…" : "Ask a follow-up…"
|
|
58730
|
+
// Same word as the dock's first question (one label per action).
|
|
58731
|
+
,
|
|
58732
|
+
sendLabel: "Ask",
|
|
58733
|
+
className: "flex-shrink-0"
|
|
58829
58734
|
})]
|
|
58830
58735
|
});
|
|
58831
58736
|
};
|
|
@@ -58850,8 +58755,6 @@ var CreateDockPanel = function CreateDockPanel(_ref) {
|
|
|
58850
58755
|
_ref$onCollapse = _ref.onCollapse,
|
|
58851
58756
|
onCollapse = _ref$onCollapse === void 0 ? null : _ref$onCollapse;
|
|
58852
58757
|
var _useConfigTokens = useConfigTokens(),
|
|
58853
|
-
muted = _useConfigTokens.muted,
|
|
58854
|
-
strong = _useConfigTokens.strong,
|
|
58855
58758
|
hairline = _useConfigTokens.hairline;
|
|
58856
58759
|
// { recentId, title, kind?: "question", question? } — the conversation
|
|
58857
58760
|
// folded here (a new question has no recentId yet), or null (Recent).
|
|
@@ -58872,7 +58775,8 @@ var CreateDockPanel = function CreateDockPanel(_ref) {
|
|
|
58872
58775
|
drafts = _useState8[0],
|
|
58873
58776
|
setDrafts = _useState8[1];
|
|
58874
58777
|
var _useResizableWidth = DashReact.useResizableWidth({
|
|
58875
|
-
|
|
58778
|
+
// Same default as the AI Assistant and Bot Activity docks.
|
|
58779
|
+
defaultWidth: 384,
|
|
58876
58780
|
min: 340,
|
|
58877
58781
|
max: 720,
|
|
58878
58782
|
edge: "left",
|
|
@@ -58952,6 +58856,24 @@ var CreateDockPanel = function CreateDockPanel(_ref) {
|
|
|
58952
58856
|
var sections = recentSections(plans, drafts, {
|
|
58953
58857
|
conversations: 12
|
|
58954
58858
|
});
|
|
58859
|
+
var hasRecent = sections.conversations.length + sections.drafts.length > 0;
|
|
58860
|
+
// A secondary button, not a link: it leaves the dock for Create full size.
|
|
58861
|
+
var makeNew = /*#__PURE__*/jsxRuntime.jsx(DashReact.Button2, {
|
|
58862
|
+
size: "sm",
|
|
58863
|
+
onClick: function onClick() {
|
|
58864
|
+
return openCreate({
|
|
58865
|
+
type: "dashboard"
|
|
58866
|
+
});
|
|
58867
|
+
},
|
|
58868
|
+
ariaLabel: "Make something new \u2014 opens Create full size",
|
|
58869
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
58870
|
+
className: "inline-flex items-center gap-2",
|
|
58871
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
58872
|
+
icon: "up-right-and-down-left-from-center",
|
|
58873
|
+
className: "h-3 w-3"
|
|
58874
|
+
}), "Make something new\u2026"]
|
|
58875
|
+
})
|
|
58876
|
+
});
|
|
58955
58877
|
var askNow = function askNow() {
|
|
58956
58878
|
var q = asking.trim();
|
|
58957
58879
|
if (!q) return;
|
|
@@ -58980,29 +58902,24 @@ var CreateDockPanel = function CreateDockPanel(_ref) {
|
|
|
58980
58902
|
"aria-label": "Create",
|
|
58981
58903
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.ResizeHandle, _objectSpread$E(_objectSpread$E({}, handleProps), {}, {
|
|
58982
58904
|
ariaLabel: "Resize Create"
|
|
58983
|
-
})), /*#__PURE__*/jsxRuntime.
|
|
58984
|
-
|
|
58985
|
-
|
|
58986
|
-
|
|
58987
|
-
|
|
58988
|
-
|
|
58989
|
-
|
|
58990
|
-
|
|
58991
|
-
|
|
58992
|
-
|
|
58993
|
-
|
|
58994
|
-
|
|
58995
|
-
|
|
58996
|
-
|
|
58997
|
-
|
|
58998
|
-
|
|
58999
|
-
|
|
59000
|
-
|
|
59001
|
-
}) : null, onCollapse ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
59002
|
-
icon: "xmark",
|
|
59003
|
-
ariaLabel: "Close Create panel",
|
|
59004
|
-
onClick: onCollapse
|
|
59005
|
-
}) : null]
|
|
58905
|
+
})), /*#__PURE__*/jsxRuntime.jsx(DashReact.PanelHeader, {
|
|
58906
|
+
testId: "create-dock-header",
|
|
58907
|
+
onBack: folded ? function () {
|
|
58908
|
+
return setFolded(null);
|
|
58909
|
+
} : null,
|
|
58910
|
+
backLabel: "Back to Recent",
|
|
58911
|
+
title: folded ? folded.title || (folded.kind === "question" ? "Question" : "Plan a dashboard") : "Create",
|
|
58912
|
+
actions: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
58913
|
+
children: [folded && folded.kind !== "question" ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
58914
|
+
icon: "up-right-and-down-left-from-center",
|
|
58915
|
+
ariaLabel: "Expand",
|
|
58916
|
+
onClick: expand
|
|
58917
|
+
}) : null, onCollapse ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
58918
|
+
icon: "xmark",
|
|
58919
|
+
ariaLabel: "Close Create panel",
|
|
58920
|
+
onClick: onCollapse
|
|
58921
|
+
}) : null]
|
|
58922
|
+
})
|
|
59006
58923
|
}), folded && folded.kind === "question" ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
59007
58924
|
className: "flex-1 min-h-0 flex flex-col",
|
|
59008
58925
|
children: /*#__PURE__*/jsxRuntime.jsx(AskStep, {
|
|
@@ -59025,59 +58942,32 @@ var CreateDockPanel = function CreateDockPanel(_ref) {
|
|
|
59025
58942
|
}
|
|
59026
58943
|
}, folded.recentId)
|
|
59027
58944
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
59028
|
-
className: "flex-1 min-h-0
|
|
59029
|
-
"data-testid": "create-dock-recent",
|
|
58945
|
+
className: "flex-1 min-h-0 flex flex-col",
|
|
59030
58946
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
59031
|
-
className: "flex flex-col gap-
|
|
59032
|
-
"data-testid": "
|
|
59033
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(
|
|
59034
|
-
|
|
59035
|
-
|
|
59036
|
-
|
|
59037
|
-
|
|
59038
|
-
|
|
59039
|
-
|
|
59040
|
-
|
|
59041
|
-
|
|
59042
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
59043
|
-
e.preventDefault();
|
|
59044
|
-
askNow();
|
|
59045
|
-
}
|
|
59046
|
-
}
|
|
59047
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
59048
|
-
className: "flex flex-row justify-end",
|
|
59049
|
-
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
59050
|
-
size: "sm",
|
|
59051
|
-
title: "Ask",
|
|
59052
|
-
onClick: askNow,
|
|
59053
|
-
disabled: !asking.trim()
|
|
59054
|
-
})
|
|
59055
|
-
})]
|
|
59056
|
-
}), /*#__PURE__*/jsxRuntime.jsx(RecentList, {
|
|
59057
|
-
sections: sections,
|
|
59058
|
-
onOpen: openRow,
|
|
59059
|
-
empty: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
59060
|
-
className: "text-sm ".concat(muted),
|
|
59061
|
-
children: "Nothing yet. Questions, plans and unfinished widgets show up here."
|
|
59062
|
-
})
|
|
59063
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
59064
|
-
className: "pt-2",
|
|
59065
|
-
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Button3, {
|
|
59066
|
-
size: "sm",
|
|
59067
|
-
onClick: function onClick() {
|
|
59068
|
-
return openCreate({
|
|
59069
|
-
type: "dashboard"
|
|
59070
|
-
});
|
|
59071
|
-
},
|
|
59072
|
-
ariaLabel: "Make something new \u2014 opens Create full size",
|
|
59073
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
59074
|
-
className: "inline-flex items-center gap-2",
|
|
59075
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
59076
|
-
icon: "up-right-and-down-left-from-center",
|
|
59077
|
-
className: "h-3 w-3"
|
|
59078
|
-
}), "Make something new\u2026"]
|
|
58947
|
+
className: "flex-1 min-h-0 overflow-y-auto flex flex-col gap-4 p-4",
|
|
58948
|
+
"data-testid": "create-dock-recent",
|
|
58949
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(RecentList, {
|
|
58950
|
+
sections: sections,
|
|
58951
|
+
onOpen: openRow,
|
|
58952
|
+
empty: /*#__PURE__*/jsxRuntime.jsx(DashReact.EmptyState, {
|
|
58953
|
+
testId: "create-dock-empty",
|
|
58954
|
+
className: "my-auto",
|
|
58955
|
+
title: "Nothing here yet",
|
|
58956
|
+
description: "Ask about your dashboards and bots below. Questions, plans and unfinished widgets show up here.",
|
|
58957
|
+
children: makeNew
|
|
59079
58958
|
})
|
|
59080
|
-
})
|
|
58959
|
+
}), hasRecent ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
58960
|
+
children: makeNew
|
|
58961
|
+
}) : null]
|
|
58962
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatComposer, {
|
|
58963
|
+
value: asking,
|
|
58964
|
+
onChange: function onChange(v) {
|
|
58965
|
+
return setAsking(v);
|
|
58966
|
+
},
|
|
58967
|
+
onSend: askNow,
|
|
58968
|
+
ariaLabel: "Ask about your dashboards and bots",
|
|
58969
|
+
placeholder: "Ask about your dashboards and bots\u2026",
|
|
58970
|
+
sendLabel: "Ask"
|
|
59081
58971
|
})]
|
|
59082
58972
|
})]
|
|
59083
58973
|
});
|
|
@@ -87823,6 +87713,15 @@ var StreamingText = function StreamingText(_ref) {
|
|
|
87823
87713
|
});
|
|
87824
87714
|
};
|
|
87825
87715
|
|
|
87716
|
+
/**
|
|
87717
|
+
* ToolCallBlock
|
|
87718
|
+
*
|
|
87719
|
+
* One MCP tool call in a chat, drawn with dash-react's ChatToolCall: status
|
|
87720
|
+
* dot, tool name, where it ran, and a disclosure with the input and result.
|
|
87721
|
+
*/
|
|
87722
|
+
var pretty = function pretty(v) {
|
|
87723
|
+
return typeof v === "string" ? v : JSON.stringify(v, null, 2);
|
|
87724
|
+
};
|
|
87826
87725
|
var ToolCallBlock = function ToolCallBlock(_ref) {
|
|
87827
87726
|
var toolName = _ref.toolName,
|
|
87828
87727
|
serverName = _ref.serverName,
|
|
@@ -87830,62 +87729,36 @@ var ToolCallBlock = function ToolCallBlock(_ref) {
|
|
|
87830
87729
|
result = _ref.result,
|
|
87831
87730
|
isError = _ref.isError,
|
|
87832
87731
|
isLoading = _ref.isLoading;
|
|
87833
|
-
var _useState = React.useState(false),
|
|
87834
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
87835
|
-
expanded = _useState2[0],
|
|
87836
|
-
setExpanded = _useState2[1];
|
|
87837
|
-
var _ref2 = React.useContext(DashReact.ThemeContext) || {},
|
|
87838
|
-
currentTheme = _ref2.currentTheme;
|
|
87839
87732
|
var statusTokens = DashReact.useStatusTokens();
|
|
87840
|
-
var
|
|
87841
|
-
|
|
87842
|
-
|
|
87843
|
-
|
|
87844
|
-
|
|
87845
|
-
|
|
87846
|
-
|
|
87847
|
-
|
|
87848
|
-
|
|
87849
|
-
|
|
87850
|
-
return setExpanded(!expanded);
|
|
87851
|
-
},
|
|
87852
|
-
className: "w-full flex items-center gap-2 px-2.5 py-1.5 transition-colors text-left ".concat(t("bg-primary-dark"), " ").concat(t("hover-bg-primary-dark")),
|
|
87853
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
87854
|
-
className: "inline-block w-2 h-2 rounded-full ".concat(dotColor)
|
|
87855
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
87856
|
-
className: "font-mono ".concat(t("text-secondary-medium")),
|
|
87857
|
-
children: toolName
|
|
87858
|
-
}), serverName && /*#__PURE__*/jsxRuntime.jsxs(DashReact.Caption2, {
|
|
87859
|
-
children: ["via ", serverName]
|
|
87860
|
-
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
87861
|
-
className: "ml-auto",
|
|
87862
|
-
children: expanded ? "▲" : "▼"
|
|
87863
|
-
})]
|
|
87864
|
-
}), expanded && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
87865
|
-
className: "px-2.5 py-2 space-y-2 ".concat(t("bg-primary-dark")),
|
|
87866
|
-
children: [input && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
87733
|
+
var status = isLoading ? "running" : isError ? "error" : "done";
|
|
87734
|
+
var hasDetails = input !== undefined || result !== undefined;
|
|
87735
|
+
var pre = "p-1.5 rounded overflow-auto font-mono text-xs";
|
|
87736
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatToolCall, {
|
|
87737
|
+
name: toolName,
|
|
87738
|
+
source: serverName ? "via ".concat(serverName) : null,
|
|
87739
|
+
status: status,
|
|
87740
|
+
children: hasDetails ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
87741
|
+
className: "space-y-2",
|
|
87742
|
+
children: [input !== undefined && input !== null && input !== "" ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
87867
87743
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
87868
87744
|
block: true,
|
|
87869
87745
|
className: "mb-0.5",
|
|
87870
87746
|
children: "Input:"
|
|
87871
87747
|
}), /*#__PURE__*/jsxRuntime.jsx("pre", {
|
|
87872
|
-
className: "".concat(
|
|
87873
|
-
children:
|
|
87748
|
+
className: "".concat(pre, " max-h-32"),
|
|
87749
|
+
children: pretty(input)
|
|
87874
87750
|
})]
|
|
87875
|
-
}), result !== undefined
|
|
87751
|
+
}) : null, result !== undefined ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
87876
87752
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
87877
87753
|
block: true,
|
|
87878
87754
|
className: "mb-0.5",
|
|
87879
87755
|
children: "Result:"
|
|
87880
87756
|
}), /*#__PURE__*/jsxRuntime.jsx("pre", {
|
|
87881
|
-
className: "".concat(
|
|
87882
|
-
children:
|
|
87757
|
+
className: "".concat(pre, " max-h-48 ").concat(isError ? "".concat(statusTokens.error.bg, " ").concat(statusTokens.error.text) : ""),
|
|
87758
|
+
children: pretty(result)
|
|
87883
87759
|
})]
|
|
87884
|
-
})
|
|
87885
|
-
|
|
87886
|
-
children: "Running..."
|
|
87887
|
-
})]
|
|
87888
|
-
})]
|
|
87760
|
+
}) : null]
|
|
87761
|
+
}) : null
|
|
87889
87762
|
});
|
|
87890
87763
|
};
|
|
87891
87764
|
|
|
@@ -88007,18 +87880,7 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
88007
87880
|
content = message.content,
|
|
88008
87881
|
toolCalls = message.toolCalls,
|
|
88009
87882
|
hidden = message.hidden;
|
|
88010
|
-
var _ref3 = React.useContext(DashReact.ThemeContext) || {},
|
|
88011
|
-
currentTheme = _ref3.currentTheme;
|
|
88012
87883
|
var statusTokens = DashReact.useStatusTokens();
|
|
88013
|
-
// Theme-provided colors so the chat follows the active light/dark
|
|
88014
|
-
// theme. No hardcoded fallbacks — they only read correctly on dark.
|
|
88015
|
-
var bubbleBg = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-secondary-dark"]) || (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-dark"]) || "";
|
|
88016
|
-
// The user's bubble uses the primary surface so it stands apart from the
|
|
88017
|
-
// Assistant/lead bubbles (secondary). "bg-primary-medium" is a real
|
|
88018
|
-
// ThemeModel key; the old "bg-primary-bright"/"bg-primary" don't exist,
|
|
88019
|
-
// which left the user's text with no bubble at all.
|
|
88020
|
-
var userBubbleBg = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-medium"]) || "";
|
|
88021
|
-
var bubbleText = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["text-primary-medium"]) || "";
|
|
88022
87884
|
|
|
88023
87885
|
// App-injected priming messages (e.g. widget-builder "Hello…" seed)
|
|
88024
87886
|
// are kept in state for conversation continuity but suppressed from
|
|
@@ -88030,19 +87892,13 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
88030
87892
|
}).map(function (c) {
|
|
88031
87893
|
return c.text;
|
|
88032
87894
|
}).join("") : "";
|
|
88033
|
-
return /*#__PURE__*/jsxRuntime.
|
|
88034
|
-
|
|
88035
|
-
|
|
88036
|
-
|
|
88037
|
-
|
|
88038
|
-
|
|
88039
|
-
|
|
88040
|
-
children: message.to ? "You \u2192 ".concat(leadLabel(message.to)) : "You"
|
|
88041
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
88042
|
-
className: "px-3 py-2 rounded-lg text-sm whitespace-pre-wrap break-words leading-relaxed ".concat(userBubbleBg, " ").concat(bubbleText),
|
|
88043
|
-
children: text
|
|
88044
|
-
})]
|
|
88045
|
-
})
|
|
87895
|
+
return /*#__PURE__*/jsxRuntime.jsxs(DashReact.ChatMessage, {
|
|
87896
|
+
role: "you",
|
|
87897
|
+
testId: "user-bubble",
|
|
87898
|
+
children: [message.to ? /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
87899
|
+
className: "block text-xs opacity-70 mb-0.5",
|
|
87900
|
+
children: ["To ", leadLabel(message.to)]
|
|
87901
|
+
}) : null, text]
|
|
88046
87902
|
});
|
|
88047
87903
|
}
|
|
88048
87904
|
if (role === "assistant") {
|
|
@@ -88113,51 +87969,39 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
88113
87969
|
// indicator so the user knows the AI is working.
|
|
88114
87970
|
if (!isStreaming && !_text && toolBlocks.length === 0) {
|
|
88115
87971
|
if (isLast) {
|
|
88116
|
-
return /*#__PURE__*/jsxRuntime.
|
|
88117
|
-
|
|
88118
|
-
|
|
88119
|
-
|
|
88120
|
-
|
|
88121
|
-
children: "Assistant"
|
|
88122
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
88123
|
-
className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg),
|
|
88124
|
-
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
88125
|
-
className: "italic",
|
|
88126
|
-
children: "Thinking..."
|
|
88127
|
-
})
|
|
88128
|
-
})]
|
|
87972
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatMessage, {
|
|
87973
|
+
role: "reply",
|
|
87974
|
+
label: "Assistant",
|
|
87975
|
+
streaming: true,
|
|
87976
|
+
children: "Thinking..."
|
|
88129
87977
|
});
|
|
88130
87978
|
}
|
|
88131
87979
|
return null;
|
|
88132
87980
|
}
|
|
88133
87981
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
88134
|
-
className: "
|
|
88135
|
-
children: [
|
|
88136
|
-
|
|
88137
|
-
|
|
88138
|
-
|
|
88139
|
-
|
|
88140
|
-
|
|
88141
|
-
|
|
88142
|
-
|
|
88143
|
-
|
|
88144
|
-
|
|
88145
|
-
|
|
88146
|
-
|
|
88147
|
-
|
|
88148
|
-
|
|
87982
|
+
className: "flex flex-col gap-2",
|
|
87983
|
+
children: [toolBlocks.map(function (block) {
|
|
87984
|
+
return /*#__PURE__*/jsxRuntime.jsx(ToolCallBlock, {
|
|
87985
|
+
toolName: block.name,
|
|
87986
|
+
serverName: block.serverName,
|
|
87987
|
+
input: block.input,
|
|
87988
|
+
result: block.result,
|
|
87989
|
+
isError: block.isError,
|
|
87990
|
+
isLoading: block.isLoading
|
|
87991
|
+
}, block.id);
|
|
87992
|
+
}), isStreaming || _text ? /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatMessage, {
|
|
87993
|
+
role: "reply",
|
|
87994
|
+
label: "Assistant",
|
|
87995
|
+
streaming: isStreaming && !streamingText,
|
|
87996
|
+
children: isStreaming ? /*#__PURE__*/jsxRuntime.jsx(StreamingText, {
|
|
87997
|
+
text: codeNote ? collapseCodeBlocks(streamingText, codeNote, {
|
|
87998
|
+
plain: true
|
|
87999
|
+
}) : streamingText,
|
|
88000
|
+
isStreaming: true
|
|
88001
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(AssistantTextContent, {
|
|
88149
88002
|
text: codeNote ? collapseCodeBlocks(_text, codeNote) : _text
|
|
88150
|
-
})
|
|
88151
|
-
|
|
88152
|
-
toolName: block.name,
|
|
88153
|
-
serverName: block.serverName,
|
|
88154
|
-
input: block.input,
|
|
88155
|
-
result: block.result,
|
|
88156
|
-
isError: block.isError,
|
|
88157
|
-
isLoading: block.isLoading
|
|
88158
|
-
}, block.id);
|
|
88159
|
-
})]
|
|
88160
|
-
})]
|
|
88003
|
+
})
|
|
88004
|
+
}) : null]
|
|
88161
88005
|
});
|
|
88162
88006
|
}
|
|
88163
88007
|
|
|
@@ -88165,25 +88009,20 @@ var MessageBubble = function MessageBubble(_ref2) {
|
|
|
88165
88009
|
// lead and its dashboard.
|
|
88166
88010
|
if (role === "lead") {
|
|
88167
88011
|
var _text2 = typeof content === "string" ? content : textOfContent(content);
|
|
88168
|
-
return /*#__PURE__*/jsxRuntime.
|
|
88169
|
-
|
|
88170
|
-
|
|
88171
|
-
|
|
88172
|
-
|
|
88173
|
-
|
|
88174
|
-
|
|
88175
|
-
|
|
88176
|
-
|
|
88177
|
-
|
|
88178
|
-
|
|
88179
|
-
|
|
88180
|
-
|
|
88181
|
-
|
|
88182
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
88183
|
-
className: "italic",
|
|
88184
|
-
children: message.streaming ? "Working…" : "No answer."
|
|
88185
|
-
})
|
|
88186
|
-
})]
|
|
88012
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatMessage, {
|
|
88013
|
+
role: "reply",
|
|
88014
|
+
label: leadLabel(message.from),
|
|
88015
|
+
streaming: !!message.streaming && !_text2,
|
|
88016
|
+
testId: "lead-bubble",
|
|
88017
|
+
children: message.error ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
88018
|
+
className: statusTokens.error.icon,
|
|
88019
|
+
children: message.error
|
|
88020
|
+
}) : _text2 ? /*#__PURE__*/jsxRuntime.jsx(AssistantTextContent, {
|
|
88021
|
+
text: _text2
|
|
88022
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
88023
|
+
className: "italic",
|
|
88024
|
+
children: message.streaming ? "Working…" : "No answer."
|
|
88025
|
+
})
|
|
88187
88026
|
});
|
|
88188
88027
|
}
|
|
88189
88028
|
return null;
|
|
@@ -88211,11 +88050,6 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
88211
88050
|
_ref$codeNote = _ref.codeNote,
|
|
88212
88051
|
codeNote = _ref$codeNote === void 0 ? null : _ref$codeNote;
|
|
88213
88052
|
var scrollRef = React.useRef(null);
|
|
88214
|
-
var _ref2 = React.useContext(DashReact.ThemeContext) || {},
|
|
88215
|
-
currentTheme = _ref2.currentTheme;
|
|
88216
|
-
var t = function t(key) {
|
|
88217
|
-
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
88218
|
-
};
|
|
88219
88053
|
React.useEffect(function () {
|
|
88220
88054
|
if (scrollRef.current) {
|
|
88221
88055
|
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
@@ -88223,23 +88057,17 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
88223
88057
|
}, [messages, streamingText]);
|
|
88224
88058
|
if (messages.length === 0) {
|
|
88225
88059
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
88226
|
-
className: "flex-1 flex items-center justify-center",
|
|
88227
|
-
children: /*#__PURE__*/jsxRuntime.
|
|
88228
|
-
|
|
88229
|
-
|
|
88230
|
-
|
|
88231
|
-
children: "\uD83D\uDCAC"
|
|
88232
|
-
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
88233
|
-
block: true,
|
|
88234
|
-
className: "text-sm",
|
|
88235
|
-
children: "Send a message to start chatting"
|
|
88236
|
-
})]
|
|
88060
|
+
className: "flex-1 flex items-center justify-center px-4",
|
|
88061
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
88062
|
+
block: true,
|
|
88063
|
+
className: "text-sm text-center",
|
|
88064
|
+
children: "Send a message to start chatting"
|
|
88237
88065
|
})
|
|
88238
88066
|
});
|
|
88239
88067
|
}
|
|
88240
88068
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
88241
88069
|
ref: scrollRef,
|
|
88242
|
-
className: "flex-1 overflow-y-auto px-4 py-3 scroll-smooth",
|
|
88070
|
+
className: "flex-1 overflow-y-auto px-4 py-3 scroll-smooth flex flex-col gap-3",
|
|
88243
88071
|
children: [messages.map(function (message, index) {
|
|
88244
88072
|
var isLastAssistant = message.role === "assistant" && index === messages.length - 1;
|
|
88245
88073
|
var isStreaming = isLastAssistant && streamingRequestId !== null;
|
|
@@ -88250,34 +88078,11 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
88250
88078
|
isLast: index === messages.length - 1,
|
|
88251
88079
|
codeNote: codeNote
|
|
88252
88080
|
}, message.id || index);
|
|
88253
|
-
}), isLoading && !streamingRequestId && ((_messages = messages[messages.length - 1]) === null || _messages === void 0 ? void 0 : _messages.role) === "user" && /*#__PURE__*/jsxRuntime.
|
|
88254
|
-
|
|
88255
|
-
|
|
88256
|
-
|
|
88257
|
-
|
|
88258
|
-
children: "Assistant"
|
|
88259
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
88260
|
-
className: "text-sm leading-relaxed px-3 py-2 rounded-lg italic flex items-center gap-2 opacity-70 ".concat(t("bg-primary-dark"), " ").concat(t("text-primary-medium")),
|
|
88261
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
88262
|
-
className: "inline-flex gap-0.5",
|
|
88263
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
88264
|
-
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
|
|
88265
|
-
style: {
|
|
88266
|
-
animationDelay: "0ms"
|
|
88267
|
-
}
|
|
88268
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
88269
|
-
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
|
|
88270
|
-
style: {
|
|
88271
|
-
animationDelay: "150ms"
|
|
88272
|
-
}
|
|
88273
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
88274
|
-
className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
|
|
88275
|
-
style: {
|
|
88276
|
-
animationDelay: "300ms"
|
|
88277
|
-
}
|
|
88278
|
-
})]
|
|
88279
|
-
}), "Thinking..."]
|
|
88280
|
-
})]
|
|
88081
|
+
}), isLoading && !streamingRequestId && ((_messages = messages[messages.length - 1]) === null || _messages === void 0 ? void 0 : _messages.role) === "user" && /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatMessage, {
|
|
88082
|
+
role: "reply",
|
|
88083
|
+
label: "Assistant",
|
|
88084
|
+
streaming: true,
|
|
88085
|
+
children: "Thinking..."
|
|
88281
88086
|
})]
|
|
88282
88087
|
});
|
|
88283
88088
|
};
|
|
@@ -88340,12 +88145,9 @@ var ChatInput = function ChatInput(_ref) {
|
|
|
88340
88145
|
_ref$leads = _ref.leads,
|
|
88341
88146
|
leads = _ref$leads === void 0 ? null : _ref$leads,
|
|
88342
88147
|
_ref$onPickRecipient = _ref.onPickRecipient,
|
|
88343
|
-
onPickRecipient = _ref$onPickRecipient === void 0 ? null : _ref$onPickRecipient
|
|
88344
|
-
|
|
88345
|
-
|
|
88346
|
-
var t = function t(key) {
|
|
88347
|
-
return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
|
|
88348
|
-
};
|
|
88148
|
+
onPickRecipient = _ref$onPickRecipient === void 0 ? null : _ref$onPickRecipient,
|
|
88149
|
+
_ref$recipientPicker = _ref.recipientPicker,
|
|
88150
|
+
recipientPicker = _ref$recipientPicker === void 0 ? null : _ref$recipientPicker;
|
|
88349
88151
|
var _useState = React.useState(""),
|
|
88350
88152
|
_useState2 = _slicedToArray(_useState, 2),
|
|
88351
88153
|
input = _useState2[0],
|
|
@@ -88460,37 +88262,27 @@ var ChatInput = function ChatInput(_ref) {
|
|
|
88460
88262
|
handleSend();
|
|
88461
88263
|
}
|
|
88462
88264
|
};
|
|
88463
|
-
return /*#__PURE__*/jsxRuntime.
|
|
88464
|
-
|
|
88465
|
-
|
|
88466
|
-
|
|
88467
|
-
|
|
88468
|
-
|
|
88469
|
-
|
|
88470
|
-
|
|
88471
|
-
|
|
88472
|
-
|
|
88473
|
-
|
|
88474
|
-
|
|
88475
|
-
|
|
88476
|
-
|
|
88477
|
-
|
|
88478
|
-
|
|
88479
|
-
|
|
88480
|
-
|
|
88481
|
-
|
|
88482
|
-
|
|
88483
|
-
|
|
88484
|
-
className: "shrink-0"
|
|
88485
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
88486
|
-
title: "Send",
|
|
88487
|
-
onClick: handleSend,
|
|
88488
|
-
disabled: !input.trim() || disabled,
|
|
88489
|
-
className: "shrink-0"
|
|
88490
|
-
})]
|
|
88491
|
-
}), queued && /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
88492
|
-
children: "Sends when the current reply finishes"
|
|
88493
|
-
})]
|
|
88265
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.ChatComposer, {
|
|
88266
|
+
ref: textareaRef,
|
|
88267
|
+
value: input,
|
|
88268
|
+
onChange: function onChange(_value, e) {
|
|
88269
|
+
return handleChange(e);
|
|
88270
|
+
},
|
|
88271
|
+
onKeyDown: handleKeyDown,
|
|
88272
|
+
onSend: handleSend,
|
|
88273
|
+
onStop: onStop,
|
|
88274
|
+
busy: !!isLoading,
|
|
88275
|
+
disabled: disabled,
|
|
88276
|
+
rows: 1,
|
|
88277
|
+
placeholder: "Type a message...",
|
|
88278
|
+
hint: queued ? "Sends when the current reply finishes" : "Enter to send · Shift+Enter for a new line",
|
|
88279
|
+
above: recipientPicker || mentionOpen ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
88280
|
+
children: [recipientPicker, mentionOpen ? /*#__PURE__*/jsxRuntime.jsx(LeadMentionMenu, {
|
|
88281
|
+
options: mentionOptions,
|
|
88282
|
+
activeIndex: mentionIndex,
|
|
88283
|
+
onPick: pickMention
|
|
88284
|
+
}) : null]
|
|
88285
|
+
}) : null
|
|
88494
88286
|
});
|
|
88495
88287
|
};
|
|
88496
88288
|
|
|
@@ -88632,33 +88424,37 @@ var RecipientPicker = function RecipientPicker(_ref) {
|
|
|
88632
88424
|
group: "Team leads"
|
|
88633
88425
|
};
|
|
88634
88426
|
})));
|
|
88635
|
-
return
|
|
88636
|
-
|
|
88637
|
-
|
|
88638
|
-
|
|
88639
|
-
|
|
88640
|
-
|
|
88641
|
-
|
|
88642
|
-
|
|
88643
|
-
|
|
88644
|
-
|
|
88645
|
-
|
|
88646
|
-
|
|
88647
|
-
|
|
88648
|
-
|
|
88649
|
-
|
|
88650
|
-
|
|
88427
|
+
return (
|
|
88428
|
+
/*#__PURE__*/
|
|
88429
|
+
// Inside the message box (ChatInput's `recipientPicker`): the box's own
|
|
88430
|
+
// padding spaces it, so no padding here.
|
|
88431
|
+
jsxRuntime.jsxs("div", {
|
|
88432
|
+
className: "flex flex-wrap items-center gap-2",
|
|
88433
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
88434
|
+
children: "To:"
|
|
88435
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
|
|
88436
|
+
label: "",
|
|
88437
|
+
placeholder: "Send to",
|
|
88438
|
+
value: recipient ? recipient.botId : ASSISTANT_VALUE,
|
|
88439
|
+
options: options,
|
|
88440
|
+
disabled: disabled,
|
|
88441
|
+
className: "flex-1 min-w-0",
|
|
88442
|
+
inputClassName: "text-sm py-1",
|
|
88443
|
+
onChange: function onChange(value) {
|
|
88444
|
+
if (value === ASSISTANT_VALUE) {
|
|
88445
|
+
_onChange(null);
|
|
88446
|
+
return;
|
|
88447
|
+
}
|
|
88448
|
+
var lead = leads.find(function (l) {
|
|
88449
|
+
return l.botId === value;
|
|
88450
|
+
});
|
|
88451
|
+
if (lead) _onChange(lead);
|
|
88651
88452
|
}
|
|
88652
|
-
|
|
88653
|
-
|
|
88654
|
-
|
|
88655
|
-
|
|
88656
|
-
|
|
88657
|
-
}), leads.length === 0 && /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
88658
|
-
className: "opacity-70",
|
|
88659
|
-
children: "No team leads yet \u2014 turn one on in a dashboard's Bots view."
|
|
88660
|
-
})]
|
|
88661
|
-
});
|
|
88453
|
+
}), leads.length === 0 && /*#__PURE__*/jsxRuntime.jsx(DashReact.Caption2, {
|
|
88454
|
+
children: "No team leads yet \u2014 turn one on in a dashboard's Bots view."
|
|
88455
|
+
})]
|
|
88456
|
+
})
|
|
88457
|
+
);
|
|
88662
88458
|
};
|
|
88663
88459
|
|
|
88664
88460
|
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -89516,11 +89312,6 @@ function ChatCore(_ref) {
|
|
|
89516
89312
|
return setLeadNotice(null);
|
|
89517
89313
|
}
|
|
89518
89314
|
})
|
|
89519
|
-
}), enableLeadRecipients && /*#__PURE__*/jsxRuntime.jsx(RecipientPicker, {
|
|
89520
|
-
leads: leads,
|
|
89521
|
-
recipient: recipient,
|
|
89522
|
-
onChange: handleRecipientChange,
|
|
89523
|
-
disabled: isLoading
|
|
89524
89315
|
}), /*#__PURE__*/jsxRuntime.jsx(ChatInput, {
|
|
89525
89316
|
onSend: handleSend,
|
|
89526
89317
|
onStop: handleStop,
|
|
@@ -89530,7 +89321,13 @@ function ChatCore(_ref) {
|
|
|
89530
89321
|
// elsewhere "@" stays plain text (TEAM-013 AC6).
|
|
89531
89322
|
,
|
|
89532
89323
|
leads: enableLeadRecipients ? leads : null,
|
|
89533
|
-
onPickRecipient: enableLeadRecipients ? handleRecipientChange : null
|
|
89324
|
+
onPickRecipient: enableLeadRecipients ? handleRecipientChange : null,
|
|
89325
|
+
recipientPicker: enableLeadRecipients ? /*#__PURE__*/jsxRuntime.jsx(RecipientPicker, {
|
|
89326
|
+
leads: leads,
|
|
89327
|
+
recipient: recipient,
|
|
89328
|
+
onChange: handleRecipientChange,
|
|
89329
|
+
disabled: isLoading
|
|
89330
|
+
}) : null
|
|
89534
89331
|
})]
|
|
89535
89332
|
});
|
|
89536
89333
|
}
|