@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 CHANGED
@@ -2,7 +2,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
2
  import _typeof from '@babel/runtime/helpers/typeof';
3
3
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
4
4
  import * as DashReact from '@trops/dash-react';
5
- import { isObject, ThemeContext, FontAwesomeIcon, Modal, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, Tag, Button3, Button2, Paragraph, Sidebar, Panel, Stepper, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorVS, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, ButtonIcon2, DropdownPanel, MenuItem2, useStatusTokens, Caption2, ConfirmationModal, DropComponent, DragComponent, getStyleName, capitalizeFirstLetter, isHexColor as isHexColor$1, deriveShades, colorTypes, TAILWIND_PALETTE, Toggle, normalizeHex as normalizeHex$1, contrastRatio, Caption, getColorFamilies, getCuratedColorGrid, DashPanel, hexToRgb as hexToRgb$1, themeVariants, SubHeading, Heading2, Paragraph2, Paragraph3, ButtonIcon3, Tag2, Alert, Alert2, Alert3, Toast, Toast2, Toast3, ProgressBar, ProgressBar2, ProgressBar3, MenuItem, Breadcrumbs, Breadcrumbs2, Breadcrumbs3, Caption3, Code, Code2, Code3, Divider, Divider2, Divider3, DashPanel2, DashPanel3, Tabs, Tabs2, Tabs3, Accordion, Accordion2, Accordion3, Toggle2, Toggle3, TextArea, Checkbox, Slider, RadioGroup, AlertBanner, StatusBadge as StatusBadge$1, Skeleton, StatCard, DataList, EmptyState, Card, Panel2, ThemeFromUrlPane, AlgoliaSearchBox, CodeEditorInline, Icon2, SectionLabel, SegmentedControl, useResizableWidth, ResizeHandle, ChoiceMenu, CommandPalette, useSidebar, FilterMenu, Navbar, withRouter, Menu as Menu$1 } from '@trops/dash-react';
5
+ import { isObject, ThemeContext, FontAwesomeIcon, Modal, deepCopy, MainSection, getUUID, getStylesForItem, themeObjects, Heading, SearchInput, ButtonIcon, SubHeading3, InputText, Button, Tag, Button3, Button2, Paragraph, Sidebar, Panel, Stepper, Tag3, Card2, Card3, Heading3, MenuItem3, FormLabel, SelectMenu, Switch, SelectInput, CodeEditorVS, SettingsModal, SubHeading2, tailwindHeightFractions, Menu3, Panel3, ButtonIcon2, DropdownPanel, MenuItem2, useStatusTokens, Caption2, ConfirmationModal, DropComponent, DragComponent, getStyleName, capitalizeFirstLetter, isHexColor as isHexColor$1, deriveShades, colorTypes, TAILWIND_PALETTE, Toggle, normalizeHex as normalizeHex$1, contrastRatio, Caption, getColorFamilies, getCuratedColorGrid, DashPanel, hexToRgb as hexToRgb$1, themeVariants, SubHeading, Heading2, Paragraph2, Paragraph3, ButtonIcon3, Tag2, Alert, Alert2, Alert3, Toast, Toast2, Toast3, ProgressBar, ProgressBar2, ProgressBar3, MenuItem, Breadcrumbs, Breadcrumbs2, Breadcrumbs3, Caption3, Code, Code2, Code3, Divider, Divider2, Divider3, DashPanel2, DashPanel3, Tabs, Tabs2, Tabs3, Accordion, Accordion2, Accordion3, Toggle2, Toggle3, TextArea, Checkbox, Slider, RadioGroup, AlertBanner, StatusBadge as StatusBadge$1, Skeleton, StatCard, DataList, EmptyState, Card, Panel2, ThemeFromUrlPane, AlgoliaSearchBox, CodeEditorInline, Icon2, SectionLabel, SegmentedControl, ChatMessage, ChatComposer, ListRow, useResizableWidth, ResizeHandle, PanelHeader, ChoiceMenu, CommandPalette, useSidebar, FilterMenu, Navbar, withRouter, Menu as Menu$1, ChatToolCall } from '@trops/dash-react';
6
6
  export * from '@trops/dash-react';
7
7
  export { FontAwesomeIcon, ThemeContext } from '@trops/dash-react';
8
8
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
@@ -56751,70 +56751,6 @@ var PlanSketch = function PlanSketch(_ref) {
56751
56751
  });
56752
56752
  };
56753
56753
 
56754
- function useBubbleTokens() {
56755
- var _ref = useContext(ThemeContext) || {},
56756
- currentTheme = _ref.currentTheme;
56757
- return {
56758
- reply: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-secondary-dark"]) || (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-dark"]) || "",
56759
- you: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-medium"]) || "",
56760
- text: (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["text-primary-medium"]) || ""
56761
- };
56762
- }
56763
-
56764
- /** What the user said, right-aligned. */
56765
- var YouBubble = function YouBubble(_ref2) {
56766
- var children = _ref2.children;
56767
- var t = useBubbleTokens();
56768
- return /*#__PURE__*/jsx("div", {
56769
- className: "flex justify-end",
56770
- children: /*#__PURE__*/jsxs("div", {
56771
- className: "max-w-xl",
56772
- children: [/*#__PURE__*/jsx(Caption2, {
56773
- block: true,
56774
- className: "font-semibold uppercase tracking-wider mb-1 text-right",
56775
- children: "You"
56776
- }), /*#__PURE__*/jsx("div", {
56777
- className: "px-3 py-2 rounded-lg text-sm whitespace-pre-wrap break-words leading-relaxed ".concat(t.you, " ").concat(t.text),
56778
- children: children
56779
- })]
56780
- })
56781
- });
56782
- };
56783
-
56784
- /**
56785
- * A team member's reply: its label ("Planner"), an optional meta line
56786
- * (model · tokens), the text, and anything below it (a button).
56787
- */
56788
- var TeamBubble = function TeamBubble(_ref3) {
56789
- var _ref3$label = _ref3.label,
56790
- label = _ref3$label === void 0 ? "Planner" : _ref3$label,
56791
- _ref3$meta = _ref3.meta,
56792
- meta = _ref3$meta === void 0 ? null : _ref3$meta,
56793
- _ref3$muted = _ref3.muted,
56794
- muted = _ref3$muted === void 0 ? false : _ref3$muted,
56795
- testId = _ref3.testId,
56796
- children = _ref3.children,
56797
- _ref3$footer = _ref3.footer,
56798
- footer = _ref3$footer === void 0 ? null : _ref3$footer;
56799
- var t = useBubbleTokens();
56800
- return /*#__PURE__*/jsxs("div", {
56801
- className: "flex flex-col gap-1",
56802
- "data-testid": testId,
56803
- children: [/*#__PURE__*/jsxs("div", {
56804
- className: "flex flex-row items-center gap-2",
56805
- children: [/*#__PURE__*/jsx(Caption2, {
56806
- className: "font-semibold uppercase tracking-wider",
56807
- children: label
56808
- }), meta ? /*#__PURE__*/jsx(Caption2, {
56809
- children: meta
56810
- }) : null]
56811
- }), /*#__PURE__*/jsx("div", {
56812
- 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" : ""),
56813
- children: children
56814
- }), footer]
56815
- });
56816
- };
56817
-
56818
56754
  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; }
56819
56755
  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; }
56820
56756
  function reopenedRequest(original, plan, text) {
@@ -57388,19 +57324,30 @@ var CreatePlanStep = function CreatePlanStep(_ref2) {
57388
57324
  children: /*#__PURE__*/jsxs("div", {
57389
57325
  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"),
57390
57326
  children: [messages.map(function (m, i) {
57391
- return m.who === "you" ? /*#__PURE__*/jsx(YouBubble, {
57327
+ return m.who === "you" ? /*#__PURE__*/jsx(ChatMessage, {
57328
+ role: "you",
57392
57329
  children: m.text
57393
- }, i) : m.who === "note" ? /*#__PURE__*/jsx("span", {
57394
- className: "text-xs ".concat(muted),
57330
+ }, i) : m.who === "note" ? /*#__PURE__*/jsx(ChatMessage, {
57331
+ role: "note",
57395
57332
  children: m.text
57396
- }, i) : /*#__PURE__*/jsx(TeamBubble, {
57333
+ }, i) : /*#__PURE__*/jsx(ChatMessage, {
57334
+ role: "reply",
57335
+ label: "Planner",
57397
57336
  meta: m.meta,
57398
57337
  testId: "planner-message",
57399
- children: m.text
57338
+ children: /*#__PURE__*/jsx("span", {
57339
+ className: "whitespace-pre-wrap",
57340
+ children: m.text
57341
+ })
57400
57342
  }, i);
57401
- }), busy ? /*#__PURE__*/jsx(TeamBubble, {
57402
- muted: true,
57403
- children: withoutPlan(soFar) || "Thinking…"
57343
+ }), busy ? /*#__PURE__*/jsx(ChatMessage, {
57344
+ role: "reply",
57345
+ label: "Planner",
57346
+ streaming: true,
57347
+ children: /*#__PURE__*/jsx("span", {
57348
+ className: "whitespace-pre-wrap",
57349
+ children: withoutPlan(soFar) || "Thinking…"
57350
+ })
57404
57351
  }) : null, !busy && questions.length ? /*#__PURE__*/jsxs("div", {
57405
57352
  className: "flex flex-col gap-3",
57406
57353
  "data-testid": "plan-questions",
@@ -57664,33 +57611,22 @@ var CreatePlanStep = function CreatePlanStep(_ref2) {
57664
57611
  setWalking(false);
57665
57612
  }
57666
57613
  }) : null, /*#__PURE__*/jsx("div", {
57667
- className: "flex-shrink-0 border-t ".concat(hairline),
57668
- children: /*#__PURE__*/jsxs("div", {
57669
- className: "mx-auto w-full max-w-3xl flex flex-row items-end gap-2 ".concat(compact ? "px-3 py-2" : "px-6 py-3"),
57670
- children: [/*#__PURE__*/jsx("div", {
57671
- className: "flex-1",
57672
- children: /*#__PURE__*/jsx(TextArea, {
57673
- "aria-label": "Reply to the Planner",
57674
- value: reply,
57675
- onChange: function onChange(v) {
57676
- return setReply(v);
57677
- },
57678
- placeholder: busy ? "The Planner is working…" : "Answer, or ask for changes…",
57679
- rows: 2,
57680
- onKeyDown: function onKeyDown(e) {
57681
- if (e.key === "Enter" && !e.shiftKey) {
57682
- e.preventDefault();
57683
- answer(reply);
57684
- }
57685
- }
57686
- })
57687
- }), /*#__PURE__*/jsx(Button, {
57688
- title: "Send",
57689
- onClick: function onClick() {
57614
+ className: "flex-shrink-0",
57615
+ children: /*#__PURE__*/jsx("div", {
57616
+ className: "mx-auto w-full max-w-3xl",
57617
+ children: /*#__PURE__*/jsx(ChatComposer, {
57618
+ ariaLabel: "Reply to the Planner",
57619
+ value: reply,
57620
+ onChange: function onChange(v) {
57621
+ return setReply(v);
57622
+ },
57623
+ onSend: function onSend() {
57690
57624
  return answer(reply);
57691
57625
  },
57692
- disabled: busy || !reply.trim()
57693
- })]
57626
+ busy: busy,
57627
+ placeholder: busy ? "The Planner is working…" : "Answer, or ask for changes…",
57628
+ className: compact ? "" : "px-6 py-3"
57629
+ })
57694
57630
  })
57695
57631
  })]
57696
57632
  });
@@ -57999,56 +57935,30 @@ var ICONS = {
57999
57935
  "widget-draft": "pen-to-square"
58000
57936
  };
58001
57937
 
58002
- /** One row: icon, title, then status · age underneath — left-aligned. */
57938
+ /**
57939
+ * One row (dash-react ListRow — design guide "List rows"): icon, title, then
57940
+ * status · age underneath; Remove (×) shows on hover, outside the row button.
57941
+ */
58003
57942
  var RecentRow = function RecentRow(_ref) {
58004
57943
  var row = _ref.row,
58005
57944
  onOpen = _ref.onOpen,
58006
57945
  onRemove = _ref.onRemove;
58007
- var _useConfigTokens = useConfigTokens(),
58008
- muted = _useConfigTokens.muted,
58009
- strong = _useConfigTokens.strong;
58010
- return /*#__PURE__*/jsxs("div", {
58011
- className: "flex flex-row items-center gap-2",
58012
- "data-testid": "recent-row",
58013
- children: [/*#__PURE__*/jsx("div", {
58014
- className: "flex-1 min-w-0",
58015
- children: /*#__PURE__*/jsx(Button3, {
58016
- size: "sm",
58017
- block: true,
58018
- onClick: function onClick() {
58019
- return onOpen(row);
58020
- },
58021
- children: /*#__PURE__*/jsxs("span", {
58022
- className: "flex flex-row items-start gap-2 w-full text-left"
58023
- // Buttons don't wrap or left-align their text; a row must.
58024
- ,
58025
- style: {
58026
- whiteSpace: "normal",
58027
- minWidth: 0
58028
- },
58029
- "aria-label": recentLine(row),
58030
- children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
58031
- icon: ICONS[row.kind] || "pen-to-square",
58032
- className: "h-3.5 w-3.5 mt-0.5 flex-shrink-0"
58033
- }), /*#__PURE__*/jsxs("span", {
58034
- className: "flex flex-col min-w-0",
58035
- children: [/*#__PURE__*/jsx("span", {
58036
- className: "truncate ".concat(strong),
58037
- children: row.title
58038
- }), /*#__PURE__*/jsxs("span", {
58039
- className: "text-xs ".concat(muted),
58040
- children: [row.status, " \xB7 ", draftAge(row.updatedAt)]
58041
- })]
58042
- })]
58043
- })
58044
- })
58045
- }), onRemove && row.kind !== "widget-draft" ? /*#__PURE__*/jsx(ButtonIcon, {
57946
+ return /*#__PURE__*/jsx(ListRow, {
57947
+ testId: "recent-row",
57948
+ icon: ICONS[row.kind] || "pen-to-square",
57949
+ title: row.title,
57950
+ meta: "".concat(row.status, " \xB7 ").concat(draftAge(row.updatedAt)),
57951
+ ariaLabel: recentLine(row),
57952
+ onClick: function onClick() {
57953
+ return onOpen(row);
57954
+ },
57955
+ trailing: onRemove && row.kind !== "widget-draft" ? /*#__PURE__*/jsx(ButtonIcon, {
58046
57956
  icon: "xmark",
58047
57957
  ariaLabel: "Remove ".concat(row.title, " from Recent"),
58048
57958
  onClick: function onClick() {
58049
57959
  return onRemove(row);
58050
57960
  }
58051
- }) : null]
57961
+ }) : null
58052
57962
  });
58053
57963
  };
58054
57964
 
@@ -58572,9 +58482,6 @@ var AskStep = function AskStep(_ref) {
58572
58482
  recentId = _ref$recentId === void 0 ? null : _ref$recentId,
58573
58483
  _ref$onOpenPlan = _ref.onOpenPlan,
58574
58484
  onOpenPlan = _ref$onOpenPlan === void 0 ? null : _ref$onOpenPlan;
58575
- var _useConfigTokens = useConfigTokens(),
58576
- muted = _useConfigTokens.muted,
58577
- hairline = _useConfigTokens.hairline;
58578
58485
  // [{ who: "you" | "planner" | "note", text, meta?, plan? }]
58579
58486
  var _useState = useState(recentId ? [] : [{
58580
58487
  who: "you",
@@ -58758,56 +58665,54 @@ var AskStep = function AskStep(_ref) {
58758
58665
  children: /*#__PURE__*/jsxs("div", {
58759
58666
  className: "flex flex-col gap-3 px-3 py-3",
58760
58667
  children: [messages.map(function (m, i) {
58761
- return m.who === "you" ? /*#__PURE__*/jsx(YouBubble, {
58668
+ return m.who === "you" ? /*#__PURE__*/jsx(ChatMessage, {
58669
+ role: "you",
58762
58670
  children: m.text
58763
- }, i) : m.who === "note" ? /*#__PURE__*/jsx("span", {
58764
- className: "text-xs ".concat(muted),
58671
+ }, i) : m.who === "note" ? /*#__PURE__*/jsx(ChatMessage, {
58672
+ role: "note",
58765
58673
  children: m.text
58766
- }, i) : /*#__PURE__*/jsx(TeamBubble, {
58674
+ }, i) : /*#__PURE__*/jsx(ChatMessage, {
58675
+ role: "reply",
58676
+ label: "Planner",
58767
58677
  meta: m.meta,
58768
58678
  testId: "ask-answer",
58769
- footer: m.plan && onOpenPlan ? /*#__PURE__*/jsx("div", {
58770
- children: /*#__PURE__*/jsx(Button3, {
58771
- size: "sm",
58772
- title: "Open as a plan",
58773
- onClick: function onClick() {
58774
- return onOpenPlan(planSeed(m.asked, m.plan));
58775
- }
58776
- })
58679
+ footer: m.plan && onOpenPlan ? /*#__PURE__*/jsx(Button3, {
58680
+ size: "sm",
58681
+ title: "Open as a plan",
58682
+ onClick: function onClick() {
58683
+ return onOpenPlan(planSeed(m.asked, m.plan));
58684
+ }
58777
58685
  }) : null,
58778
- children: m.text
58686
+ children: /*#__PURE__*/jsx("span", {
58687
+ className: "whitespace-pre-wrap",
58688
+ children: m.text
58689
+ })
58779
58690
  }, i);
58780
- }), busy ? /*#__PURE__*/jsx(TeamBubble, {
58781
- muted: true,
58782
- children: withoutPlan(soFar) || "Looking…"
58691
+ }), busy ? /*#__PURE__*/jsx(ChatMessage, {
58692
+ role: "reply",
58693
+ label: "Planner",
58694
+ streaming: true,
58695
+ children: /*#__PURE__*/jsx("span", {
58696
+ className: "whitespace-pre-wrap",
58697
+ children: withoutPlan(soFar) || "Looking…"
58698
+ })
58783
58699
  }) : null]
58784
58700
  })
58785
- }), /*#__PURE__*/jsxs("div", {
58786
- className: "flex-shrink-0 flex flex-row items-end gap-2 px-3 py-2 border-t ".concat(hairline),
58787
- children: [/*#__PURE__*/jsx("div", {
58788
- className: "flex-1",
58789
- children: /*#__PURE__*/jsx(TextArea, {
58790
- "aria-label": "Ask a follow-up",
58791
- value: reply,
58792
- onChange: function onChange(v) {
58793
- return setReply(v);
58794
- },
58795
- placeholder: busy ? "The Planner is looking…" : "Ask a follow-up…",
58796
- rows: 2,
58797
- onKeyDown: function onKeyDown(e) {
58798
- if (e.key === "Enter" && !e.shiftKey) {
58799
- e.preventDefault();
58800
- send(reply);
58801
- }
58802
- }
58803
- })
58804
- }), /*#__PURE__*/jsx(Button, {
58805
- title: "Send",
58806
- onClick: function onClick() {
58807
- return send(reply);
58808
- },
58809
- disabled: busy || !reply.trim()
58810
- })]
58701
+ }), /*#__PURE__*/jsx(ChatComposer, {
58702
+ ariaLabel: "Ask a follow-up",
58703
+ value: reply,
58704
+ onChange: function onChange(v) {
58705
+ return setReply(v);
58706
+ },
58707
+ onSend: function onSend() {
58708
+ return send(reply);
58709
+ },
58710
+ busy: busy,
58711
+ placeholder: busy ? "The Planner is looking…" : "Ask a follow-up…"
58712
+ // Same word as the dock's first question (one label per action).
58713
+ ,
58714
+ sendLabel: "Ask",
58715
+ className: "flex-shrink-0"
58811
58716
  })]
58812
58717
  });
58813
58718
  };
@@ -58832,8 +58737,6 @@ var CreateDockPanel = function CreateDockPanel(_ref) {
58832
58737
  _ref$onCollapse = _ref.onCollapse,
58833
58738
  onCollapse = _ref$onCollapse === void 0 ? null : _ref$onCollapse;
58834
58739
  var _useConfigTokens = useConfigTokens(),
58835
- muted = _useConfigTokens.muted,
58836
- strong = _useConfigTokens.strong,
58837
58740
  hairline = _useConfigTokens.hairline;
58838
58741
  // { recentId, title, kind?: "question", question? } — the conversation
58839
58742
  // folded here (a new question has no recentId yet), or null (Recent).
@@ -58854,7 +58757,8 @@ var CreateDockPanel = function CreateDockPanel(_ref) {
58854
58757
  drafts = _useState8[0],
58855
58758
  setDrafts = _useState8[1];
58856
58759
  var _useResizableWidth = useResizableWidth({
58857
- defaultWidth: 420,
58760
+ // Same default as the AI Assistant and Bot Activity docks.
58761
+ defaultWidth: 384,
58858
58762
  min: 340,
58859
58763
  max: 720,
58860
58764
  edge: "left",
@@ -58934,6 +58838,24 @@ var CreateDockPanel = function CreateDockPanel(_ref) {
58934
58838
  var sections = recentSections(plans, drafts, {
58935
58839
  conversations: 12
58936
58840
  });
58841
+ var hasRecent = sections.conversations.length + sections.drafts.length > 0;
58842
+ // A secondary button, not a link: it leaves the dock for Create full size.
58843
+ var makeNew = /*#__PURE__*/jsx(Button2, {
58844
+ size: "sm",
58845
+ onClick: function onClick() {
58846
+ return openCreate({
58847
+ type: "dashboard"
58848
+ });
58849
+ },
58850
+ ariaLabel: "Make something new \u2014 opens Create full size",
58851
+ children: /*#__PURE__*/jsxs("span", {
58852
+ className: "inline-flex items-center gap-2",
58853
+ children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
58854
+ icon: "up-right-and-down-left-from-center",
58855
+ className: "h-3 w-3"
58856
+ }), "Make something new\u2026"]
58857
+ })
58858
+ });
58937
58859
  var askNow = function askNow() {
58938
58860
  var q = asking.trim();
58939
58861
  if (!q) return;
@@ -58962,29 +58884,24 @@ var CreateDockPanel = function CreateDockPanel(_ref) {
58962
58884
  "aria-label": "Create",
58963
58885
  children: [/*#__PURE__*/jsx(ResizeHandle, _objectSpread$E(_objectSpread$E({}, handleProps), {}, {
58964
58886
  ariaLabel: "Resize Create"
58965
- })), /*#__PURE__*/jsxs("div", {
58966
- className: "flex-shrink-0 flex flex-row items-center gap-2 px-3 py-2 border-b ".concat(hairline),
58967
- children: [folded ? /*#__PURE__*/jsx(ButtonIcon, {
58968
- icon: "arrow-left",
58969
- ariaLabel: "Back to Recent",
58970
- onClick: function onClick() {
58971
- return setFolded(null);
58972
- }
58973
- }) : /*#__PURE__*/jsx(FontAwesomeIcon, {
58974
- icon: "plus",
58975
- className: "h-3.5 w-3.5 opacity-70"
58976
- }), /*#__PURE__*/jsx("span", {
58977
- className: "flex-1 min-w-0 truncate text-sm font-semibold ".concat(strong),
58978
- children: folded ? folded.title || (folded.kind === "question" ? "Question" : "Plan a dashboard") : "Create"
58979
- }), folded && folded.kind !== "question" ? /*#__PURE__*/jsx(ButtonIcon, {
58980
- icon: "up-right-and-down-left-from-center",
58981
- ariaLabel: "Expand",
58982
- onClick: expand
58983
- }) : null, onCollapse ? /*#__PURE__*/jsx(ButtonIcon, {
58984
- icon: "xmark",
58985
- ariaLabel: "Close Create panel",
58986
- onClick: onCollapse
58987
- }) : null]
58887
+ })), /*#__PURE__*/jsx(PanelHeader, {
58888
+ testId: "create-dock-header",
58889
+ onBack: folded ? function () {
58890
+ return setFolded(null);
58891
+ } : null,
58892
+ backLabel: "Back to Recent",
58893
+ title: folded ? folded.title || (folded.kind === "question" ? "Question" : "Plan a dashboard") : "Create",
58894
+ actions: /*#__PURE__*/jsxs(Fragment, {
58895
+ children: [folded && folded.kind !== "question" ? /*#__PURE__*/jsx(ButtonIcon, {
58896
+ icon: "up-right-and-down-left-from-center",
58897
+ ariaLabel: "Expand",
58898
+ onClick: expand
58899
+ }) : null, onCollapse ? /*#__PURE__*/jsx(ButtonIcon, {
58900
+ icon: "xmark",
58901
+ ariaLabel: "Close Create panel",
58902
+ onClick: onCollapse
58903
+ }) : null]
58904
+ })
58988
58905
  }), folded && folded.kind === "question" ? /*#__PURE__*/jsx("div", {
58989
58906
  className: "flex-1 min-h-0 flex flex-col",
58990
58907
  children: /*#__PURE__*/jsx(AskStep, {
@@ -59007,59 +58924,32 @@ var CreateDockPanel = function CreateDockPanel(_ref) {
59007
58924
  }
59008
58925
  }, folded.recentId)
59009
58926
  }) : /*#__PURE__*/jsxs("div", {
59010
- className: "flex-1 min-h-0 overflow-y-auto flex flex-col gap-2 p-3",
59011
- "data-testid": "create-dock-recent",
58927
+ className: "flex-1 min-h-0 flex flex-col",
59012
58928
  children: [/*#__PURE__*/jsxs("div", {
59013
- className: "flex flex-col gap-2 pb-2",
59014
- "data-testid": "ask-box",
59015
- children: [/*#__PURE__*/jsx(TextArea, {
59016
- "aria-label": "Ask about your dashboards and bots",
59017
- value: asking,
59018
- onChange: function onChange(v) {
59019
- return setAsking(v);
59020
- },
59021
- placeholder: "Ask about your dashboards and bots \u2014 e.g. what did my bots find today?",
59022
- rows: 2,
59023
- onKeyDown: function onKeyDown(e) {
59024
- if (e.key === "Enter" && !e.shiftKey) {
59025
- e.preventDefault();
59026
- askNow();
59027
- }
59028
- }
59029
- }), /*#__PURE__*/jsx("div", {
59030
- className: "flex flex-row justify-end",
59031
- children: /*#__PURE__*/jsx(Button, {
59032
- size: "sm",
59033
- title: "Ask",
59034
- onClick: askNow,
59035
- disabled: !asking.trim()
59036
- })
59037
- })]
59038
- }), /*#__PURE__*/jsx(RecentList, {
59039
- sections: sections,
59040
- onOpen: openRow,
59041
- empty: /*#__PURE__*/jsx("span", {
59042
- className: "text-sm ".concat(muted),
59043
- children: "Nothing yet. Questions, plans and unfinished widgets show up here."
59044
- })
59045
- }), /*#__PURE__*/jsx("div", {
59046
- className: "pt-2",
59047
- children: /*#__PURE__*/jsx(Button3, {
59048
- size: "sm",
59049
- onClick: function onClick() {
59050
- return openCreate({
59051
- type: "dashboard"
59052
- });
59053
- },
59054
- ariaLabel: "Make something new \u2014 opens Create full size",
59055
- children: /*#__PURE__*/jsxs("span", {
59056
- className: "inline-flex items-center gap-2",
59057
- children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
59058
- icon: "up-right-and-down-left-from-center",
59059
- className: "h-3 w-3"
59060
- }), "Make something new\u2026"]
58929
+ className: "flex-1 min-h-0 overflow-y-auto flex flex-col gap-4 p-4",
58930
+ "data-testid": "create-dock-recent",
58931
+ children: [/*#__PURE__*/jsx(RecentList, {
58932
+ sections: sections,
58933
+ onOpen: openRow,
58934
+ empty: /*#__PURE__*/jsx(EmptyState, {
58935
+ testId: "create-dock-empty",
58936
+ className: "my-auto",
58937
+ title: "Nothing here yet",
58938
+ description: "Ask about your dashboards and bots below. Questions, plans and unfinished widgets show up here.",
58939
+ children: makeNew
59061
58940
  })
59062
- })
58941
+ }), hasRecent ? /*#__PURE__*/jsx("div", {
58942
+ children: makeNew
58943
+ }) : null]
58944
+ }), /*#__PURE__*/jsx(ChatComposer, {
58945
+ value: asking,
58946
+ onChange: function onChange(v) {
58947
+ return setAsking(v);
58948
+ },
58949
+ onSend: askNow,
58950
+ ariaLabel: "Ask about your dashboards and bots",
58951
+ placeholder: "Ask about your dashboards and bots\u2026",
58952
+ sendLabel: "Ask"
59063
58953
  })]
59064
58954
  })]
59065
58955
  });
@@ -87805,6 +87695,15 @@ var StreamingText = function StreamingText(_ref) {
87805
87695
  });
87806
87696
  };
87807
87697
 
87698
+ /**
87699
+ * ToolCallBlock
87700
+ *
87701
+ * One MCP tool call in a chat, drawn with dash-react's ChatToolCall: status
87702
+ * dot, tool name, where it ran, and a disclosure with the input and result.
87703
+ */
87704
+ var pretty = function pretty(v) {
87705
+ return typeof v === "string" ? v : JSON.stringify(v, null, 2);
87706
+ };
87808
87707
  var ToolCallBlock = function ToolCallBlock(_ref) {
87809
87708
  var toolName = _ref.toolName,
87810
87709
  serverName = _ref.serverName,
@@ -87812,62 +87711,36 @@ var ToolCallBlock = function ToolCallBlock(_ref) {
87812
87711
  result = _ref.result,
87813
87712
  isError = _ref.isError,
87814
87713
  isLoading = _ref.isLoading;
87815
- var _useState = useState(false),
87816
- _useState2 = _slicedToArray(_useState, 2),
87817
- expanded = _useState2[0],
87818
- setExpanded = _useState2[1];
87819
- var _ref2 = useContext(ThemeContext) || {},
87820
- currentTheme = _ref2.currentTheme;
87821
87714
  var statusTokens = useStatusTokens();
87822
- var t = function t(key) {
87823
- return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
87824
- };
87825
- var dotColor = isLoading ? "".concat(statusTokens.warning.solidBg, " animate-pulse") : isError ? statusTokens.error.solidBg : statusTokens.success.solidBg;
87826
- var preBase = "p-1.5 rounded overflow-x-auto overflow-y-auto font-mono";
87827
- var preNeutral = "".concat(t("bg-primary-very-dark"), " ").concat(t("text-primary-medium"));
87828
- return /*#__PURE__*/jsxs("div", {
87829
- className: "my-1.5 border rounded-md overflow-hidden text-xs ".concat(t("border-primary-dark")),
87830
- children: [/*#__PURE__*/jsxs("button", {
87831
- onClick: function onClick() {
87832
- return setExpanded(!expanded);
87833
- },
87834
- 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")),
87835
- children: [/*#__PURE__*/jsx("span", {
87836
- className: "inline-block w-2 h-2 rounded-full ".concat(dotColor)
87837
- }), /*#__PURE__*/jsx("span", {
87838
- className: "font-mono ".concat(t("text-secondary-medium")),
87839
- children: toolName
87840
- }), serverName && /*#__PURE__*/jsxs(Caption2, {
87841
- children: ["via ", serverName]
87842
- }), /*#__PURE__*/jsx(Caption2, {
87843
- className: "ml-auto",
87844
- children: expanded ? "▲" : "▼"
87845
- })]
87846
- }), expanded && /*#__PURE__*/jsxs("div", {
87847
- className: "px-2.5 py-2 space-y-2 ".concat(t("bg-primary-dark")),
87848
- children: [input && /*#__PURE__*/jsxs("div", {
87715
+ var status = isLoading ? "running" : isError ? "error" : "done";
87716
+ var hasDetails = input !== undefined || result !== undefined;
87717
+ var pre = "p-1.5 rounded overflow-auto font-mono text-xs";
87718
+ return /*#__PURE__*/jsx(ChatToolCall, {
87719
+ name: toolName,
87720
+ source: serverName ? "via ".concat(serverName) : null,
87721
+ status: status,
87722
+ children: hasDetails ? /*#__PURE__*/jsxs("div", {
87723
+ className: "space-y-2",
87724
+ children: [input !== undefined && input !== null && input !== "" ? /*#__PURE__*/jsxs("div", {
87849
87725
  children: [/*#__PURE__*/jsx(Caption2, {
87850
87726
  block: true,
87851
87727
  className: "mb-0.5",
87852
87728
  children: "Input:"
87853
87729
  }), /*#__PURE__*/jsx("pre", {
87854
- className: "".concat(preBase, " max-h-32 ").concat(preNeutral),
87855
- children: typeof input === "string" ? input : JSON.stringify(input, null, 2)
87730
+ className: "".concat(pre, " max-h-32"),
87731
+ children: pretty(input)
87856
87732
  })]
87857
- }), result !== undefined && /*#__PURE__*/jsxs("div", {
87733
+ }) : null, result !== undefined ? /*#__PURE__*/jsxs("div", {
87858
87734
  children: [/*#__PURE__*/jsx(Caption2, {
87859
87735
  block: true,
87860
87736
  className: "mb-0.5",
87861
87737
  children: "Result:"
87862
87738
  }), /*#__PURE__*/jsx("pre", {
87863
- className: "".concat(preBase, " max-h-48 ").concat(isError ? "".concat(statusTokens.error.bg, " ").concat(statusTokens.error.text) : preNeutral),
87864
- children: typeof result === "string" ? result : JSON.stringify(result, null, 2)
87739
+ className: "".concat(pre, " max-h-48 ").concat(isError ? "".concat(statusTokens.error.bg, " ").concat(statusTokens.error.text) : ""),
87740
+ children: pretty(result)
87865
87741
  })]
87866
- }), isLoading && /*#__PURE__*/jsx("div", {
87867
- className: "italic ".concat(statusTokens.warning.icon),
87868
- children: "Running..."
87869
- })]
87870
- })]
87742
+ }) : null]
87743
+ }) : null
87871
87744
  });
87872
87745
  };
87873
87746
 
@@ -87989,18 +87862,7 @@ var MessageBubble = function MessageBubble(_ref2) {
87989
87862
  content = message.content,
87990
87863
  toolCalls = message.toolCalls,
87991
87864
  hidden = message.hidden;
87992
- var _ref3 = useContext(ThemeContext) || {},
87993
- currentTheme = _ref3.currentTheme;
87994
87865
  var statusTokens = useStatusTokens();
87995
- // Theme-provided colors so the chat follows the active light/dark
87996
- // theme. No hardcoded fallbacks — they only read correctly on dark.
87997
- var bubbleBg = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-secondary-dark"]) || (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-dark"]) || "";
87998
- // The user's bubble uses the primary surface so it stands apart from the
87999
- // Assistant/lead bubbles (secondary). "bg-primary-medium" is a real
88000
- // ThemeModel key; the old "bg-primary-bright"/"bg-primary" don't exist,
88001
- // which left the user's text with no bubble at all.
88002
- var userBubbleBg = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-medium"]) || "";
88003
- var bubbleText = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["text-primary-medium"]) || "";
88004
87866
 
88005
87867
  // App-injected priming messages (e.g. widget-builder "Hello…" seed)
88006
87868
  // are kept in state for conversation continuity but suppressed from
@@ -88012,19 +87874,13 @@ var MessageBubble = function MessageBubble(_ref2) {
88012
87874
  }).map(function (c) {
88013
87875
  return c.text;
88014
87876
  }).join("") : "";
88015
- return /*#__PURE__*/jsx("div", {
88016
- className: "flex justify-end mb-4",
88017
- children: /*#__PURE__*/jsxs("div", {
88018
- className: "max-w-md",
88019
- children: [/*#__PURE__*/jsx(Caption2, {
88020
- block: true,
88021
- className: "font-semibold uppercase tracking-wider mb-1 text-right",
88022
- children: message.to ? "You \u2192 ".concat(leadLabel(message.to)) : "You"
88023
- }), /*#__PURE__*/jsx("div", {
88024
- className: "px-3 py-2 rounded-lg text-sm whitespace-pre-wrap break-words leading-relaxed ".concat(userBubbleBg, " ").concat(bubbleText),
88025
- children: text
88026
- })]
88027
- })
87877
+ return /*#__PURE__*/jsxs(ChatMessage, {
87878
+ role: "you",
87879
+ testId: "user-bubble",
87880
+ children: [message.to ? /*#__PURE__*/jsxs("span", {
87881
+ className: "block text-xs opacity-70 mb-0.5",
87882
+ children: ["To ", leadLabel(message.to)]
87883
+ }) : null, text]
88028
87884
  });
88029
87885
  }
88030
87886
  if (role === "assistant") {
@@ -88095,51 +87951,39 @@ var MessageBubble = function MessageBubble(_ref2) {
88095
87951
  // indicator so the user knows the AI is working.
88096
87952
  if (!isStreaming && !_text && toolBlocks.length === 0) {
88097
87953
  if (isLast) {
88098
- return /*#__PURE__*/jsxs("div", {
88099
- className: "mb-4",
88100
- children: [/*#__PURE__*/jsx(Caption2, {
88101
- block: true,
88102
- className: "font-semibold uppercase tracking-wider mb-1",
88103
- children: "Assistant"
88104
- }), /*#__PURE__*/jsx("div", {
88105
- className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg),
88106
- children: /*#__PURE__*/jsx(Caption2, {
88107
- className: "italic",
88108
- children: "Thinking..."
88109
- })
88110
- })]
87954
+ return /*#__PURE__*/jsx(ChatMessage, {
87955
+ role: "reply",
87956
+ label: "Assistant",
87957
+ streaming: true,
87958
+ children: "Thinking..."
88111
87959
  });
88112
87960
  }
88113
87961
  return null;
88114
87962
  }
88115
87963
  return /*#__PURE__*/jsxs("div", {
88116
- className: "mb-4",
88117
- children: [/*#__PURE__*/jsx(Caption2, {
88118
- block: true,
88119
- className: "font-semibold uppercase tracking-wider mb-1",
88120
- children: "Assistant"
88121
- }), /*#__PURE__*/jsxs("div", {
88122
- className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg, " ").concat(bubbleText),
88123
- children: [isStreaming && /*#__PURE__*/jsx("div", {
88124
- children: /*#__PURE__*/jsx(StreamingText, {
88125
- text: codeNote ? collapseCodeBlocks(streamingText, codeNote, {
88126
- plain: true
88127
- }) : streamingText,
88128
- isStreaming: true
88129
- })
88130
- }), !isStreaming && _text && /*#__PURE__*/jsx(AssistantTextContent, {
87964
+ className: "flex flex-col gap-2",
87965
+ children: [toolBlocks.map(function (block) {
87966
+ return /*#__PURE__*/jsx(ToolCallBlock, {
87967
+ toolName: block.name,
87968
+ serverName: block.serverName,
87969
+ input: block.input,
87970
+ result: block.result,
87971
+ isError: block.isError,
87972
+ isLoading: block.isLoading
87973
+ }, block.id);
87974
+ }), isStreaming || _text ? /*#__PURE__*/jsx(ChatMessage, {
87975
+ role: "reply",
87976
+ label: "Assistant",
87977
+ streaming: isStreaming && !streamingText,
87978
+ children: isStreaming ? /*#__PURE__*/jsx(StreamingText, {
87979
+ text: codeNote ? collapseCodeBlocks(streamingText, codeNote, {
87980
+ plain: true
87981
+ }) : streamingText,
87982
+ isStreaming: true
87983
+ }) : /*#__PURE__*/jsx(AssistantTextContent, {
88131
87984
  text: codeNote ? collapseCodeBlocks(_text, codeNote) : _text
88132
- }), toolBlocks.map(function (block) {
88133
- return /*#__PURE__*/jsx(ToolCallBlock, {
88134
- toolName: block.name,
88135
- serverName: block.serverName,
88136
- input: block.input,
88137
- result: block.result,
88138
- isError: block.isError,
88139
- isLoading: block.isLoading
88140
- }, block.id);
88141
- })]
88142
- })]
87985
+ })
87986
+ }) : null]
88143
87987
  });
88144
87988
  }
88145
87989
 
@@ -88147,25 +87991,20 @@ var MessageBubble = function MessageBubble(_ref2) {
88147
87991
  // lead and its dashboard.
88148
87992
  if (role === "lead") {
88149
87993
  var _text2 = typeof content === "string" ? content : textOfContent(content);
88150
- return /*#__PURE__*/jsxs("div", {
88151
- className: "mb-4",
88152
- "data-testid": "lead-bubble",
88153
- children: [/*#__PURE__*/jsx(Caption2, {
88154
- block: true,
88155
- className: "font-semibold uppercase tracking-wider mb-1",
88156
- children: leadLabel(message.from)
88157
- }), /*#__PURE__*/jsx("div", {
88158
- className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg, " ").concat(bubbleText),
88159
- children: message.error ? /*#__PURE__*/jsx("span", {
88160
- className: statusTokens.error.icon,
88161
- children: message.error
88162
- }) : _text2 ? /*#__PURE__*/jsx(AssistantTextContent, {
88163
- text: _text2
88164
- }) : /*#__PURE__*/jsx(Caption2, {
88165
- className: "italic",
88166
- children: message.streaming ? "Working…" : "No answer."
88167
- })
88168
- })]
87994
+ return /*#__PURE__*/jsx(ChatMessage, {
87995
+ role: "reply",
87996
+ label: leadLabel(message.from),
87997
+ streaming: !!message.streaming && !_text2,
87998
+ testId: "lead-bubble",
87999
+ children: message.error ? /*#__PURE__*/jsx("span", {
88000
+ className: statusTokens.error.icon,
88001
+ children: message.error
88002
+ }) : _text2 ? /*#__PURE__*/jsx(AssistantTextContent, {
88003
+ text: _text2
88004
+ }) : /*#__PURE__*/jsx("span", {
88005
+ className: "italic",
88006
+ children: message.streaming ? "Working…" : "No answer."
88007
+ })
88169
88008
  });
88170
88009
  }
88171
88010
  return null;
@@ -88193,11 +88032,6 @@ var ChatMessages = function ChatMessages(_ref) {
88193
88032
  _ref$codeNote = _ref.codeNote,
88194
88033
  codeNote = _ref$codeNote === void 0 ? null : _ref$codeNote;
88195
88034
  var scrollRef = useRef(null);
88196
- var _ref2 = useContext(ThemeContext) || {},
88197
- currentTheme = _ref2.currentTheme;
88198
- var t = function t(key) {
88199
- return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
88200
- };
88201
88035
  useEffect(function () {
88202
88036
  if (scrollRef.current) {
88203
88037
  scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
@@ -88205,23 +88039,17 @@ var ChatMessages = function ChatMessages(_ref) {
88205
88039
  }, [messages, streamingText]);
88206
88040
  if (messages.length === 0) {
88207
88041
  return /*#__PURE__*/jsx("div", {
88208
- className: "flex-1 flex items-center justify-center",
88209
- children: /*#__PURE__*/jsxs("div", {
88210
- className: "text-center space-y-1",
88211
- children: [/*#__PURE__*/jsx("div", {
88212
- className: "text-2xl",
88213
- children: "\uD83D\uDCAC"
88214
- }), /*#__PURE__*/jsx(Caption2, {
88215
- block: true,
88216
- className: "text-sm",
88217
- children: "Send a message to start chatting"
88218
- })]
88042
+ className: "flex-1 flex items-center justify-center px-4",
88043
+ children: /*#__PURE__*/jsx(Caption2, {
88044
+ block: true,
88045
+ className: "text-sm text-center",
88046
+ children: "Send a message to start chatting"
88219
88047
  })
88220
88048
  });
88221
88049
  }
88222
88050
  return /*#__PURE__*/jsxs("div", {
88223
88051
  ref: scrollRef,
88224
- className: "flex-1 overflow-y-auto px-4 py-3 scroll-smooth",
88052
+ className: "flex-1 overflow-y-auto px-4 py-3 scroll-smooth flex flex-col gap-3",
88225
88053
  children: [messages.map(function (message, index) {
88226
88054
  var isLastAssistant = message.role === "assistant" && index === messages.length - 1;
88227
88055
  var isStreaming = isLastAssistant && streamingRequestId !== null;
@@ -88232,34 +88060,11 @@ var ChatMessages = function ChatMessages(_ref) {
88232
88060
  isLast: index === messages.length - 1,
88233
88061
  codeNote: codeNote
88234
88062
  }, message.id || index);
88235
- }), isLoading && !streamingRequestId && ((_messages = messages[messages.length - 1]) === null || _messages === void 0 ? void 0 : _messages.role) === "user" && /*#__PURE__*/jsxs("div", {
88236
- className: "mb-4",
88237
- children: [/*#__PURE__*/jsx(Caption2, {
88238
- block: true,
88239
- className: "font-semibold uppercase tracking-wider mb-1",
88240
- children: "Assistant"
88241
- }), /*#__PURE__*/jsxs("div", {
88242
- 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")),
88243
- children: [/*#__PURE__*/jsxs("span", {
88244
- className: "inline-flex gap-0.5",
88245
- children: [/*#__PURE__*/jsx("span", {
88246
- className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
88247
- style: {
88248
- animationDelay: "0ms"
88249
- }
88250
- }), /*#__PURE__*/jsx("span", {
88251
- className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
88252
- style: {
88253
- animationDelay: "150ms"
88254
- }
88255
- }), /*#__PURE__*/jsx("span", {
88256
- className: "w-1.5 h-1.5 rounded-full animate-bounce ".concat(t("bg-primary-medium")),
88257
- style: {
88258
- animationDelay: "300ms"
88259
- }
88260
- })]
88261
- }), "Thinking..."]
88262
- })]
88063
+ }), isLoading && !streamingRequestId && ((_messages = messages[messages.length - 1]) === null || _messages === void 0 ? void 0 : _messages.role) === "user" && /*#__PURE__*/jsx(ChatMessage, {
88064
+ role: "reply",
88065
+ label: "Assistant",
88066
+ streaming: true,
88067
+ children: "Thinking..."
88263
88068
  })]
88264
88069
  });
88265
88070
  };
@@ -88322,12 +88127,9 @@ var ChatInput = function ChatInput(_ref) {
88322
88127
  _ref$leads = _ref.leads,
88323
88128
  leads = _ref$leads === void 0 ? null : _ref$leads,
88324
88129
  _ref$onPickRecipient = _ref.onPickRecipient,
88325
- onPickRecipient = _ref$onPickRecipient === void 0 ? null : _ref$onPickRecipient;
88326
- var _ref2 = useContext(ThemeContext) || {},
88327
- currentTheme = _ref2.currentTheme;
88328
- var t = function t(key) {
88329
- return (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme[key]) || "";
88330
- };
88130
+ onPickRecipient = _ref$onPickRecipient === void 0 ? null : _ref$onPickRecipient,
88131
+ _ref$recipientPicker = _ref.recipientPicker,
88132
+ recipientPicker = _ref$recipientPicker === void 0 ? null : _ref$recipientPicker;
88331
88133
  var _useState = useState(""),
88332
88134
  _useState2 = _slicedToArray(_useState, 2),
88333
88135
  input = _useState2[0],
@@ -88442,37 +88244,27 @@ var ChatInput = function ChatInput(_ref) {
88442
88244
  handleSend();
88443
88245
  }
88444
88246
  };
88445
- return /*#__PURE__*/jsxs("div", {
88446
- className: "flex flex-col gap-1 px-3 py-2 border-t ".concat(t("border-primary-dark")),
88447
- children: [mentionOpen && /*#__PURE__*/jsx(LeadMentionMenu, {
88448
- options: mentionOptions,
88449
- activeIndex: mentionIndex,
88450
- onPick: pickMention
88451
- }), /*#__PURE__*/jsxs("div", {
88452
- className: "flex items-end gap-2",
88453
- children: [/*#__PURE__*/jsx("textarea", {
88454
- ref: textareaRef,
88455
- value: input,
88456
- onChange: handleChange,
88457
- onKeyDown: handleKeyDown,
88458
- placeholder: "Type a message...",
88459
- disabled: disabled,
88460
- rows: 1,
88461
- className: "flex-1 px-3 py-2 border rounded-lg text-sm focus:outline-none resize-none disabled:opacity-50 ".concat(t("bg-primary-dark"), " ").concat(t("border-primary-dark"), " ").concat(t("text-primary-medium"))
88462
- }), isLoading ? /*#__PURE__*/jsx(Button, {
88463
- title: "Stop",
88464
- danger: true,
88465
- onClick: onStop,
88466
- className: "shrink-0"
88467
- }) : /*#__PURE__*/jsx(Button, {
88468
- title: "Send",
88469
- onClick: handleSend,
88470
- disabled: !input.trim() || disabled,
88471
- className: "shrink-0"
88472
- })]
88473
- }), queued && /*#__PURE__*/jsx(Caption2, {
88474
- children: "Sends when the current reply finishes"
88475
- })]
88247
+ return /*#__PURE__*/jsx(ChatComposer, {
88248
+ ref: textareaRef,
88249
+ value: input,
88250
+ onChange: function onChange(_value, e) {
88251
+ return handleChange(e);
88252
+ },
88253
+ onKeyDown: handleKeyDown,
88254
+ onSend: handleSend,
88255
+ onStop: onStop,
88256
+ busy: !!isLoading,
88257
+ disabled: disabled,
88258
+ rows: 1,
88259
+ placeholder: "Type a message...",
88260
+ hint: queued ? "Sends when the current reply finishes" : "Enter to send · Shift+Enter for a new line",
88261
+ above: recipientPicker || mentionOpen ? /*#__PURE__*/jsxs(Fragment, {
88262
+ children: [recipientPicker, mentionOpen ? /*#__PURE__*/jsx(LeadMentionMenu, {
88263
+ options: mentionOptions,
88264
+ activeIndex: mentionIndex,
88265
+ onPick: pickMention
88266
+ }) : null]
88267
+ }) : null
88476
88268
  });
88477
88269
  };
88478
88270
 
@@ -88614,33 +88406,37 @@ var RecipientPicker = function RecipientPicker(_ref) {
88614
88406
  group: "Team leads"
88615
88407
  };
88616
88408
  })));
88617
- return /*#__PURE__*/jsxs("div", {
88618
- className: "flex flex-wrap items-center gap-2 px-3 pt-2",
88619
- children: [/*#__PURE__*/jsx(Caption2, {
88620
- children: "To:"
88621
- }), /*#__PURE__*/jsx(SelectInput, {
88622
- label: "",
88623
- placeholder: "Send to",
88624
- value: recipient ? recipient.botId : ASSISTANT_VALUE,
88625
- options: options,
88626
- disabled: disabled,
88627
- className: "flex-1 min-w-0",
88628
- inputClassName: "text-xs py-1",
88629
- onChange: function onChange(value) {
88630
- if (value === ASSISTANT_VALUE) {
88631
- _onChange(null);
88632
- return;
88409
+ return (
88410
+ /*#__PURE__*/
88411
+ // Inside the message box (ChatInput's `recipientPicker`): the box's own
88412
+ // padding spaces it, so no padding here.
88413
+ jsxs("div", {
88414
+ className: "flex flex-wrap items-center gap-2",
88415
+ children: [/*#__PURE__*/jsx(Caption2, {
88416
+ children: "To:"
88417
+ }), /*#__PURE__*/jsx(SelectInput, {
88418
+ label: "",
88419
+ placeholder: "Send to",
88420
+ value: recipient ? recipient.botId : ASSISTANT_VALUE,
88421
+ options: options,
88422
+ disabled: disabled,
88423
+ className: "flex-1 min-w-0",
88424
+ inputClassName: "text-sm py-1",
88425
+ onChange: function onChange(value) {
88426
+ if (value === ASSISTANT_VALUE) {
88427
+ _onChange(null);
88428
+ return;
88429
+ }
88430
+ var lead = leads.find(function (l) {
88431
+ return l.botId === value;
88432
+ });
88433
+ if (lead) _onChange(lead);
88633
88434
  }
88634
- var lead = leads.find(function (l) {
88635
- return l.botId === value;
88636
- });
88637
- if (lead) _onChange(lead);
88638
- }
88639
- }), leads.length === 0 && /*#__PURE__*/jsx(Caption2, {
88640
- className: "opacity-70",
88641
- children: "No team leads yet \u2014 turn one on in a dashboard's Bots view."
88642
- })]
88643
- });
88435
+ }), leads.length === 0 && /*#__PURE__*/jsx(Caption2, {
88436
+ children: "No team leads yet \u2014 turn one on in a dashboard's Bots view."
88437
+ })]
88438
+ })
88439
+ );
88644
88440
  };
88645
88441
 
88646
88442
  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; }
@@ -89498,11 +89294,6 @@ function ChatCore(_ref) {
89498
89294
  return setLeadNotice(null);
89499
89295
  }
89500
89296
  })
89501
- }), enableLeadRecipients && /*#__PURE__*/jsx(RecipientPicker, {
89502
- leads: leads,
89503
- recipient: recipient,
89504
- onChange: handleRecipientChange,
89505
- disabled: isLoading
89506
89297
  }), /*#__PURE__*/jsx(ChatInput, {
89507
89298
  onSend: handleSend,
89508
89299
  onStop: handleStop,
@@ -89512,7 +89303,13 @@ function ChatCore(_ref) {
89512
89303
  // elsewhere "@" stays plain text (TEAM-013 AC6).
89513
89304
  ,
89514
89305
  leads: enableLeadRecipients ? leads : null,
89515
- onPickRecipient: enableLeadRecipients ? handleRecipientChange : null
89306
+ onPickRecipient: enableLeadRecipients ? handleRecipientChange : null,
89307
+ recipientPicker: enableLeadRecipients ? /*#__PURE__*/jsx(RecipientPicker, {
89308
+ leads: leads,
89309
+ recipient: recipient,
89310
+ onChange: handleRecipientChange,
89311
+ disabled: isLoading
89312
+ }) : null
89516
89313
  })]
89517
89314
  });
89518
89315
  }