@trops/dash-core 0.1.384 → 0.1.385

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.js CHANGED
@@ -51625,6 +51625,8 @@ var FooterPopover = function FooterPopover(_ref3) {
51625
51625
  _useState2 = _slicedToArray(_useState, 2),
51626
51626
  doNotDisturb = _useState2[0],
51627
51627
  setDoNotDisturb = _useState2[1];
51628
+ var _ref4 = React.useContext(DashReact.ThemeContext) || {},
51629
+ currentTheme = _ref4.currentTheme;
51628
51630
  var displayName = authStatus === "authenticated" && authProfile ? authProfile.displayName || authProfile.username : "Account";
51629
51631
 
51630
51632
  // Load initial DND state
@@ -51663,10 +51665,10 @@ var FooterPopover = function FooterPopover(_ref3) {
51663
51665
  }
51664
51666
  return /*#__PURE__*/jsxRuntime.jsx(react.Popover, {
51665
51667
  className: "relative",
51666
- children: function children(_ref4) {
51668
+ children: function children(_ref5) {
51667
51669
  var _rect$left;
51668
- var open = _ref4.open,
51669
- close = _ref4.close;
51670
+ var open = _ref5.open,
51671
+ close = _ref5.close;
51670
51672
  var rect = open && buttonRef.current ? buttonRef.current.getBoundingClientRect() : null;
51671
51673
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
51672
51674
  children: [/*#__PURE__*/jsxRuntime.jsxs(react.Popover.Button, {
@@ -51696,7 +51698,7 @@ var FooterPopover = function FooterPopover(_ref3) {
51696
51698
  onClick: close
51697
51699
  }), /*#__PURE__*/jsxRuntime.jsx(react.Popover.Panel, {
51698
51700
  "static": true,
51699
- className: "fixed w-52 rounded-lg border border-white/10 bg-neutral-900 shadow-xl",
51701
+ 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"),
51700
51702
  style: {
51701
51703
  zIndex: 9999,
51702
51704
  left: (_rect$left = rect === null || rect === void 0 ? void 0 : rect.left) !== null && _rect$left !== void 0 ? _rect$left : 0,
@@ -51747,12 +51749,12 @@ var FooterPopover = function FooterPopover(_ref3) {
51747
51749
  }
51748
51750
  });
51749
51751
  };
51750
- var PopoverItem = function PopoverItem(_ref5) {
51751
- var icon = _ref5.icon,
51752
- label = _ref5.label,
51753
- onClick = _ref5.onClick,
51754
- _ref5$active = _ref5.active,
51755
- active = _ref5$active === void 0 ? false : _ref5$active;
51752
+ var PopoverItem = function PopoverItem(_ref6) {
51753
+ var icon = _ref6.icon,
51754
+ label = _ref6.label,
51755
+ onClick = _ref6.onClick,
51756
+ _ref6$active = _ref6.active,
51757
+ active = _ref6$active === void 0 ? false : _ref6$active;
51756
51758
  return /*#__PURE__*/jsxRuntime.jsxs("button", {
51757
51759
  type: "button",
51758
51760
  onClick: onClick,
@@ -53423,6 +53425,23 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
53423
53425
  // eslint-disable-next-line react-hooks/exhaustive-deps
53424
53426
  }, []);
53425
53427
 
53428
+ // ─── Listen for external "apply theme" requests ─────────────────
53429
+ // MCP-driven apply_theme updates settings in the main process; this
53430
+ // listener pulls the new theme into ThemeContext without a remount.
53431
+ React.useEffect(function () {
53432
+ var handler = function handler(e) {
53433
+ var _e$detail;
53434
+ var themeKey = e === null || e === void 0 || (_e$detail = e.detail) === null || _e$detail === void 0 ? void 0 : _e$detail.themeKey;
53435
+ if (themeKey && typeof changeCurrentTheme === "function") {
53436
+ changeCurrentTheme(themeKey);
53437
+ }
53438
+ };
53439
+ window.addEventListener("dash:apply-theme", handler);
53440
+ return function () {
53441
+ return window.removeEventListener("dash:apply-theme", handler);
53442
+ };
53443
+ }, [changeCurrentTheme]);
53444
+
53426
53445
  // ─── Listen for external "open workspace" requests ──────────────
53427
53446
  // Fired by: Dash.js notification click, MCP state-changed for
53428
53447
  // create_dashboard, etc. Any code that wants to switch the active
@@ -53438,8 +53457,8 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
53438
53457
  setPendingOpenWorkspaceId = _useState50[1];
53439
53458
  React.useEffect(function () {
53440
53459
  var handler = function handler(e) {
53441
- var _e$detail;
53442
- var id = e === null || e === void 0 || (_e$detail = e.detail) === null || _e$detail === void 0 ? void 0 : _e$detail.workspaceId;
53460
+ var _e$detail2;
53461
+ var id = e === null || e === void 0 || (_e$detail2 = e.detail) === null || _e$detail2 === void 0 ? void 0 : _e$detail2.workspaceId;
53443
53462
  if (id != null) setPendingOpenWorkspaceId(Number(id));
53444
53463
  };
53445
53464
  window.addEventListener("dash:navigate-workspace", handler);
@@ -53864,8 +53883,8 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
53864
53883
  if (prev) setActivePageId(prev); // bypass history recording
53865
53884
  }
53866
53885
  function onSetNavSidebar(e) {
53867
- var _e$detail2;
53868
- setSidebarCollapsed(!!((_e$detail2 = e.detail) !== null && _e$detail2 !== void 0 && _e$detail2.collapsed));
53886
+ var _e$detail3;
53887
+ setSidebarCollapsed(!!((_e$detail3 = e.detail) !== null && _e$detail3 !== void 0 && _e$detail3.collapsed));
53869
53888
  }
53870
53889
  function onToggleNavSidebar() {
53871
53890
  setSidebarCollapsed(function (c) {
@@ -53933,8 +53952,8 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
53933
53952
  // Listen for open/close dashboard actions via DashboardActionsApi
53934
53953
  React.useEffect(function () {
53935
53954
  function onOpen(e) {
53936
- var _e$detail3;
53937
- var name = (_e$detail3 = e.detail) === null || _e$detail3 === void 0 ? void 0 : _e$detail3.name;
53955
+ var _e$detail4;
53956
+ var name = (_e$detail4 = e.detail) === null || _e$detail4 === void 0 ? void 0 : _e$detail4.name;
53938
53957
  if (!name) return;
53939
53958
  var ws = (workspaceConfigRef.current || []).find(function (w) {
53940
53959
  return (w.name || "").toLowerCase() === name.toLowerCase();
@@ -53942,8 +53961,8 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
53942
53961
  if (ws && handleOpenTabRef.current) handleOpenTabRef.current(ws);
53943
53962
  }
53944
53963
  function onClose(e) {
53945
- var _e$detail4;
53946
- var name = (_e$detail4 = e.detail) === null || _e$detail4 === void 0 ? void 0 : _e$detail4.name;
53964
+ var _e$detail5;
53965
+ var name = (_e$detail5 = e.detail) === null || _e$detail5 === void 0 ? void 0 : _e$detail5.name;
53947
53966
  if (name) {
53948
53967
  var tab = (openTabsRef.current || []).find(function (t) {
53949
53968
  return (t.name || "").toLowerCase() === name.toLowerCase();
@@ -56616,6 +56635,13 @@ var MessageBubble = function MessageBubble(_ref2) {
56616
56635
  content = message.content,
56617
56636
  toolCalls = message.toolCalls,
56618
56637
  hidden = message.hidden;
56638
+ var _ref3 = React.useContext(DashReact.ThemeContext) || {},
56639
+ currentTheme = _ref3.currentTheme;
56640
+ // Prefer theme-provided panel colors so assistant chrome follows the
56641
+ // active app theme. Fall back to the original muted neutral if no
56642
+ // theme is in scope.
56643
+ 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";
56644
+ 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";
56619
56645
 
56620
56646
  // App-injected priming messages (e.g. widget-builder "Hello…" seed)
56621
56647
  // are kept in state for conversation continuity but suppressed from
@@ -56635,7 +56661,7 @@ var MessageBubble = function MessageBubble(_ref2) {
56635
56661
  className: "text-[10px] font-semibold uppercase tracking-wider text-indigo-400 mb-1 text-right",
56636
56662
  children: "You"
56637
56663
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
56638
- className: "px-3 py-2 rounded-lg bg-indigo-700/40 text-sm text-gray-100 whitespace-pre-wrap break-words leading-relaxed",
56664
+ className: "px-3 py-2 rounded-lg text-sm text-gray-100 whitespace-pre-wrap break-words leading-relaxed ".concat(userBubbleBg),
56639
56665
  children: text
56640
56666
  })]
56641
56667
  })
@@ -56715,7 +56741,7 @@ var MessageBubble = function MessageBubble(_ref2) {
56715
56741
  className: "text-[10px] font-semibold uppercase tracking-wider text-gray-500 mb-1",
56716
56742
  children: "Assistant"
56717
56743
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
56718
- className: "text-sm leading-relaxed px-3 py-2 rounded-lg bg-gray-800/40 text-gray-500 italic",
56744
+ className: "text-sm leading-relaxed px-3 py-2 rounded-lg text-gray-500 italic ".concat(bubbleBg),
56719
56745
  children: "Thinking..."
56720
56746
  })]
56721
56747
  });
@@ -56728,7 +56754,7 @@ var MessageBubble = function MessageBubble(_ref2) {
56728
56754
  className: "text-[10px] font-semibold uppercase tracking-wider text-gray-500 mb-1",
56729
56755
  children: "Assistant"
56730
56756
  }), /*#__PURE__*/jsxRuntime.jsxs("div", {
56731
- className: "text-sm leading-relaxed px-3 py-2 rounded-lg bg-gray-800/40",
56757
+ className: "text-sm leading-relaxed px-3 py-2 rounded-lg ".concat(bubbleBg),
56732
56758
  children: [isStreaming && /*#__PURE__*/jsxRuntime.jsx("div", {
56733
56759
  className: "text-gray-200",
56734
56760
  children: /*#__PURE__*/jsxRuntime.jsx(StreamingText, {