@trops/dash-core 0.1.384 → 0.1.386

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
@@ -51607,6 +51607,8 @@ var FooterPopover = function FooterPopover(_ref3) {
51607
51607
  _useState2 = _slicedToArray(_useState, 2),
51608
51608
  doNotDisturb = _useState2[0],
51609
51609
  setDoNotDisturb = _useState2[1];
51610
+ var _ref4 = useContext(ThemeContext) || {},
51611
+ currentTheme = _ref4.currentTheme;
51610
51612
  var displayName = authStatus === "authenticated" && authProfile ? authProfile.displayName || authProfile.username : "Account";
51611
51613
 
51612
51614
  // Load initial DND state
@@ -51645,10 +51647,10 @@ var FooterPopover = function FooterPopover(_ref3) {
51645
51647
  }
51646
51648
  return /*#__PURE__*/jsx(Popover, {
51647
51649
  className: "relative",
51648
- children: function children(_ref4) {
51650
+ children: function children(_ref5) {
51649
51651
  var _rect$left;
51650
- var open = _ref4.open,
51651
- close = _ref4.close;
51652
+ var open = _ref5.open,
51653
+ close = _ref5.close;
51652
51654
  var rect = open && buttonRef.current ? buttonRef.current.getBoundingClientRect() : null;
51653
51655
  return /*#__PURE__*/jsxs(Fragment, {
51654
51656
  children: [/*#__PURE__*/jsxs(Popover.Button, {
@@ -51678,7 +51680,7 @@ var FooterPopover = function FooterPopover(_ref3) {
51678
51680
  onClick: close
51679
51681
  }), /*#__PURE__*/jsx(Popover.Panel, {
51680
51682
  "static": true,
51681
- className: "fixed w-52 rounded-lg border border-white/10 bg-neutral-900 shadow-xl",
51683
+ className: "fixed w-52 rounded-lg border border-white/10 ".concat((currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-dark"]) || "bg-neutral-900", " shadow-xl"),
51682
51684
  style: {
51683
51685
  zIndex: 9999,
51684
51686
  left: (_rect$left = rect === null || rect === void 0 ? void 0 : rect.left) !== null && _rect$left !== void 0 ? _rect$left : 0,
@@ -51729,12 +51731,12 @@ var FooterPopover = function FooterPopover(_ref3) {
51729
51731
  }
51730
51732
  });
51731
51733
  };
51732
- var PopoverItem = function PopoverItem(_ref5) {
51733
- var icon = _ref5.icon,
51734
- label = _ref5.label,
51735
- onClick = _ref5.onClick,
51736
- _ref5$active = _ref5.active,
51737
- active = _ref5$active === void 0 ? false : _ref5$active;
51734
+ var PopoverItem = function PopoverItem(_ref6) {
51735
+ var icon = _ref6.icon,
51736
+ label = _ref6.label,
51737
+ onClick = _ref6.onClick,
51738
+ _ref6$active = _ref6.active,
51739
+ active = _ref6$active === void 0 ? false : _ref6$active;
51738
51740
  return /*#__PURE__*/jsxs("button", {
51739
51741
  type: "button",
51740
51742
  onClick: onClick,
@@ -53405,6 +53407,23 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
53405
53407
  // eslint-disable-next-line react-hooks/exhaustive-deps
53406
53408
  }, []);
53407
53409
 
53410
+ // ─── Listen for external "apply theme" requests ─────────────────
53411
+ // MCP-driven apply_theme updates settings in the main process; this
53412
+ // listener pulls the new theme into ThemeContext without a remount.
53413
+ useEffect(function () {
53414
+ var handler = function handler(e) {
53415
+ var _e$detail;
53416
+ var themeKey = e === null || e === void 0 || (_e$detail = e.detail) === null || _e$detail === void 0 ? void 0 : _e$detail.themeKey;
53417
+ if (themeKey && typeof changeCurrentTheme === "function") {
53418
+ changeCurrentTheme(themeKey);
53419
+ }
53420
+ };
53421
+ window.addEventListener("dash:apply-theme", handler);
53422
+ return function () {
53423
+ return window.removeEventListener("dash:apply-theme", handler);
53424
+ };
53425
+ }, [changeCurrentTheme]);
53426
+
53408
53427
  // ─── Listen for external "open workspace" requests ──────────────
53409
53428
  // Fired by: Dash.js notification click, MCP state-changed for
53410
53429
  // create_dashboard, etc. Any code that wants to switch the active
@@ -53420,8 +53439,8 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
53420
53439
  setPendingOpenWorkspaceId = _useState50[1];
53421
53440
  useEffect(function () {
53422
53441
  var handler = function handler(e) {
53423
- var _e$detail;
53424
- var id = e === null || e === void 0 || (_e$detail = e.detail) === null || _e$detail === void 0 ? void 0 : _e$detail.workspaceId;
53442
+ var _e$detail2;
53443
+ var id = e === null || e === void 0 || (_e$detail2 = e.detail) === null || _e$detail2 === void 0 ? void 0 : _e$detail2.workspaceId;
53425
53444
  if (id != null) setPendingOpenWorkspaceId(Number(id));
53426
53445
  };
53427
53446
  window.addEventListener("dash:navigate-workspace", handler);
@@ -53846,8 +53865,8 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
53846
53865
  if (prev) setActivePageId(prev); // bypass history recording
53847
53866
  }
53848
53867
  function onSetNavSidebar(e) {
53849
- var _e$detail2;
53850
- setSidebarCollapsed(!!((_e$detail2 = e.detail) !== null && _e$detail2 !== void 0 && _e$detail2.collapsed));
53868
+ var _e$detail3;
53869
+ setSidebarCollapsed(!!((_e$detail3 = e.detail) !== null && _e$detail3 !== void 0 && _e$detail3.collapsed));
53851
53870
  }
53852
53871
  function onToggleNavSidebar() {
53853
53872
  setSidebarCollapsed(function (c) {
@@ -53915,8 +53934,8 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
53915
53934
  // Listen for open/close dashboard actions via DashboardActionsApi
53916
53935
  useEffect(function () {
53917
53936
  function onOpen(e) {
53918
- var _e$detail3;
53919
- var name = (_e$detail3 = e.detail) === null || _e$detail3 === void 0 ? void 0 : _e$detail3.name;
53937
+ var _e$detail4;
53938
+ var name = (_e$detail4 = e.detail) === null || _e$detail4 === void 0 ? void 0 : _e$detail4.name;
53920
53939
  if (!name) return;
53921
53940
  var ws = (workspaceConfigRef.current || []).find(function (w) {
53922
53941
  return (w.name || "").toLowerCase() === name.toLowerCase();
@@ -53924,8 +53943,8 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
53924
53943
  if (ws && handleOpenTabRef.current) handleOpenTabRef.current(ws);
53925
53944
  }
53926
53945
  function onClose(e) {
53927
- var _e$detail4;
53928
- var name = (_e$detail4 = e.detail) === null || _e$detail4 === void 0 ? void 0 : _e$detail4.name;
53946
+ var _e$detail5;
53947
+ var name = (_e$detail5 = e.detail) === null || _e$detail5 === void 0 ? void 0 : _e$detail5.name;
53929
53948
  if (name) {
53930
53949
  var tab = (openTabsRef.current || []).find(function (t) {
53931
53950
  return (t.name || "").toLowerCase() === name.toLowerCase();
@@ -56598,6 +56617,13 @@ var MessageBubble = function MessageBubble(_ref2) {
56598
56617
  content = message.content,
56599
56618
  toolCalls = message.toolCalls,
56600
56619
  hidden = message.hidden;
56620
+ var _ref3 = useContext(ThemeContext) || {},
56621
+ currentTheme = _ref3.currentTheme;
56622
+ // Prefer theme-provided panel colors so assistant chrome follows the
56623
+ // active app theme. Fall back to the original muted neutral if no
56624
+ // theme is in scope.
56625
+ var bubbleBg = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-secondary-dark"]) || (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-dark"]) || "bg-gray-800/40";
56626
+ var userBubbleBg = (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary-bright"]) || (currentTheme === null || currentTheme === void 0 ? void 0 : currentTheme["bg-primary"]) || "bg-indigo-700/40";
56601
56627
 
56602
56628
  // App-injected priming messages (e.g. widget-builder "Hello…" seed)
56603
56629
  // are kept in state for conversation continuity but suppressed from
@@ -56617,7 +56643,7 @@ var MessageBubble = function MessageBubble(_ref2) {
56617
56643
  className: "text-[10px] font-semibold uppercase tracking-wider text-indigo-400 mb-1 text-right",
56618
56644
  children: "You"
56619
56645
  }), /*#__PURE__*/jsx("div", {
56620
- className: "px-3 py-2 rounded-lg bg-indigo-700/40 text-sm text-gray-100 whitespace-pre-wrap break-words leading-relaxed",
56646
+ className: "px-3 py-2 rounded-lg text-sm text-gray-100 whitespace-pre-wrap break-words leading-relaxed ".concat(userBubbleBg),
56621
56647
  children: text
56622
56648
  })]
56623
56649
  })
@@ -56697,7 +56723,7 @@ var MessageBubble = function MessageBubble(_ref2) {
56697
56723
  className: "text-[10px] font-semibold uppercase tracking-wider text-gray-500 mb-1",
56698
56724
  children: "Assistant"
56699
56725
  }), /*#__PURE__*/jsx("div", {
56700
- className: "text-sm leading-relaxed px-3 py-2 rounded-lg bg-gray-800/40 text-gray-500 italic",
56726
+ className: "text-sm leading-relaxed px-3 py-2 rounded-lg text-gray-500 italic ".concat(bubbleBg),
56701
56727
  children: "Thinking..."
56702
56728
  })]
56703
56729
  });
@@ -56710,7 +56736,7 @@ var MessageBubble = function MessageBubble(_ref2) {
56710
56736
  className: "text-[10px] font-semibold uppercase tracking-wider text-gray-500 mb-1",
56711
56737
  children: "Assistant"
56712
56738
  }), /*#__PURE__*/jsxs("div", {
56713
- className: "text-sm leading-relaxed px-3 py-2 rounded-lg bg-gray-800/40",
56739
+ className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg),
56714
56740
  children: [isStreaming && /*#__PURE__*/jsx("div", {
56715
56741
  className: "text-gray-200",
56716
56742
  children: /*#__PURE__*/jsx(StreamingText, {