@trops/dash-core 0.1.635 → 0.1.637
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 +66 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +66 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2651,11 +2651,22 @@ var ThemeWrapper = function ThemeWrapper(_ref) {
|
|
|
2651
2651
|
written.push(name);
|
|
2652
2652
|
}
|
|
2653
2653
|
}
|
|
2654
|
+
// Expose the active light/dark variant as a data attribute so the
|
|
2655
|
+
// design system (dash-electron's design.css `[data-mode="light"]`
|
|
2656
|
+
// block) can flip its surface/text tokens to match. Nothing else
|
|
2657
|
+
// keys off this today, so it's purely additive.
|
|
2658
|
+
var prevMode = root.getAttribute("data-mode");
|
|
2659
|
+
root.setAttribute("data-mode", themeVariant);
|
|
2654
2660
|
return function () {
|
|
2655
2661
|
for (var _i2 = 0, _written = written; _i2 < _written.length; _i2++) {
|
|
2656
2662
|
var _name = _written[_i2];
|
|
2657
2663
|
root.style.removeProperty(_name);
|
|
2658
2664
|
}
|
|
2665
|
+
if (prevMode === null) {
|
|
2666
|
+
root.removeAttribute("data-mode");
|
|
2667
|
+
} else {
|
|
2668
|
+
root.setAttribute("data-mode", prevMode);
|
|
2669
|
+
}
|
|
2659
2670
|
};
|
|
2660
2671
|
}, [chosenTheme, themeVariant]);
|
|
2661
2672
|
|
|
@@ -26947,7 +26958,7 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
26947
26958
|
})
|
|
26948
26959
|
}) : useGridLayout ? scrollable ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26949
26960
|
id: "grid-container-".concat(id),
|
|
26950
|
-
className: "grid w-full min-h-24 p-3 ".concat(item.grid.gap || "gap-2"),
|
|
26961
|
+
className: "dr-grid ".concat(!item.grid.gap || item.grid.gap === "gap-2" ? "dr-grid-gap" : "", " grid w-full min-h-24 p-3 ").concat(item.grid.gap || "gap-2"),
|
|
26951
26962
|
style: {
|
|
26952
26963
|
gridTemplateRows: getRowTemplate(item.grid),
|
|
26953
26964
|
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
|
|
@@ -26958,7 +26969,7 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
26958
26969
|
className: "relative w-full ".concat(height, " min-h-24"),
|
|
26959
26970
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26960
26971
|
id: "grid-container-".concat(id),
|
|
26961
|
-
className: "absolute inset-0 grid p-3 ".concat(item.grid.gap || "gap-2"),
|
|
26972
|
+
className: "dr-grid ".concat(!item.grid.gap || item.grid.gap === "gap-2" ? "dr-grid-gap" : "", " absolute inset-0 grid p-3 ").concat(item.grid.gap || "gap-2"),
|
|
26962
26973
|
style: {
|
|
26963
26974
|
gridTemplateRows: hasExplicitRowModes() ? getRowTemplate(item.grid) : "repeat(".concat(item.grid.rows, ", minmax(0, 1fr))"),
|
|
26964
26975
|
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
|
|
@@ -29629,6 +29640,21 @@ var ThemeModel = function ThemeModel() {
|
|
|
29629
29640
|
cssVarsAll["--".concat(type, "-").concat(shade)] = hex;
|
|
29630
29641
|
}
|
|
29631
29642
|
}
|
|
29643
|
+
} else {
|
|
29644
|
+
// Named channel (e.g. "blue"): emit the shade-500 (brand) hex so
|
|
29645
|
+
// the design system's accent tokens — `var(--primary-500)` /
|
|
29646
|
+
// `var(--secondary-500)` in dash-electron's design.css — bind to
|
|
29647
|
+
// named themes too. Previously only hex themes produced cssVars,
|
|
29648
|
+
// so the Aurora accent fell back to a hardcoded default under any
|
|
29649
|
+
// named theme. cssValueFor resolves named colors via
|
|
29650
|
+
// TAILWIND_PALETTE and is variant-independent, so the accent stays
|
|
29651
|
+
// the same brand color in both light and dark (only surfaces flip).
|
|
29652
|
+
// Components still render via Tailwind class strings (bg-blue-700),
|
|
29653
|
+
// so this is purely additive — no named-theme rendering changes.
|
|
29654
|
+
var hex500 = cssValueFor(type, 500, channelValue);
|
|
29655
|
+
if (hex500) {
|
|
29656
|
+
cssVarsAll["--".concat(type, "-500")] = hex500;
|
|
29657
|
+
}
|
|
29632
29658
|
}
|
|
29633
29659
|
});
|
|
29634
29660
|
// Merge base channel vars with per-token override vars (collected
|
|
@@ -58035,7 +58061,7 @@ var DashTabBar = function DashTabBar(_ref) {
|
|
|
58035
58061
|
currentTheme = _useContext.currentTheme;
|
|
58036
58062
|
if (tabs.length === 0) return null;
|
|
58037
58063
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
58038
|
-
className: "flex flex-row items-center shrink-0 overflow-x-auto gap-1 px-2 py-2.5 border-t ".concat(currentTheme["border-primary-dark"] || "border-gray-700", " ").concat(currentTheme["bg-primary-dark"] || "bg-gray-900", " scrollbar-none"),
|
|
58064
|
+
className: "dr-tabstrip flex flex-row items-center shrink-0 overflow-x-auto gap-1 px-2 py-2.5 border-t ".concat(currentTheme["border-primary-dark"] || "border-gray-700", " ").concat(currentTheme["bg-primary-dark"] || "bg-gray-900", " scrollbar-none"),
|
|
58039
58065
|
children: tabs.map(function (tab) {
|
|
58040
58066
|
var isActive = tab.id === activeTabId;
|
|
58041
58067
|
return /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
@@ -58043,7 +58069,7 @@ var DashTabBar = function DashTabBar(_ref) {
|
|
|
58043
58069
|
onClick: function onClick() {
|
|
58044
58070
|
return onSwitchTab && onSwitchTab(tab.id);
|
|
58045
58071
|
},
|
|
58046
|
-
className: "group flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md whitespace-nowrap transition-all duration-100 cursor-pointer ".concat(isActive ? "bg-white/15 text-white" : "text-gray-400 hover:bg-white/10 hover:text-gray-200"),
|
|
58072
|
+
className: "dr-pill ".concat(isActive ? "dr-pill-active" : "", " group flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md whitespace-nowrap transition-all duration-100 cursor-pointer ").concat(isActive ? "bg-white/15 text-white" : "text-gray-400 hover:bg-white/10 hover:text-gray-200"),
|
|
58047
58073
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
58048
58074
|
className: "truncate max-w-[140px]",
|
|
58049
58075
|
children: (tab.name || "Untitled").replace(/^./, function (c) {
|
|
@@ -58175,7 +58201,7 @@ var PageTabBar = function PageTabBar(_ref) {
|
|
|
58175
58201
|
setDragOverId(null);
|
|
58176
58202
|
};
|
|
58177
58203
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
58178
|
-
className: "flex flex-row items-center shrink-0 overflow-x-auto gap-1 px-2 py-1.5 border-b ".concat(currentTheme["border-
|
|
58204
|
+
className: "dr-tabs flex flex-row items-center shrink-0 overflow-x-auto gap-1 px-2 py-1.5 border-b ".concat(currentTheme["border-neutral-dark"] || "border-neutral-800", " ").concat(currentTheme["bg-none"] || "bg-transparent", " scrollbar-none"),
|
|
58179
58205
|
children: [pages.length > 1 && sortedPages.map(function (page) {
|
|
58180
58206
|
var isActive = page.id === activePageId;
|
|
58181
58207
|
var isDragOver = page.id === dragOverId;
|
|
@@ -58198,7 +58224,7 @@ var PageTabBar = function PageTabBar(_ref) {
|
|
|
58198
58224
|
return handleDrop(e, page.id);
|
|
58199
58225
|
},
|
|
58200
58226
|
onDragEnd: handleDragEnd,
|
|
58201
|
-
className: "group flex items-center gap-1.5 px-3 py-1 text-xs rounded-md whitespace-nowrap transition-all duration-100 cursor-pointer ".concat(isActive ? "bg-white/15 text-white" : "text-gray-400 hover:bg-white/10 hover:text-gray-200", " ").concat(isDragOver ? "ring-1 ring-blue-400" : "", " ").concat(editMode ? "cursor-grab active:cursor-grabbing" : ""),
|
|
58227
|
+
className: "dr-tab ".concat(isActive ? "dr-tab-active" : "", " group flex items-center gap-1.5 px-3 py-1 text-xs rounded-md whitespace-nowrap transition-all duration-100 cursor-pointer ").concat(isActive ? "bg-white/15 text-white" : "text-gray-400 hover:bg-white/10 hover:text-gray-200", " ").concat(isDragOver ? "ring-1 ring-blue-400" : "", " ").concat(editMode ? "cursor-grab active:cursor-grabbing" : ""),
|
|
58202
58228
|
children: [editingId === page.id ? /*#__PURE__*/jsxRuntime.jsx("input", {
|
|
58203
58229
|
ref: inputRef,
|
|
58204
58230
|
type: "text",
|
|
@@ -58241,7 +58267,7 @@ var PageTabBar = function PageTabBar(_ref) {
|
|
|
58241
58267
|
}), editMode && onAddPage && /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
58242
58268
|
type: "button",
|
|
58243
58269
|
onClick: onAddPage,
|
|
58244
|
-
className: "flex items-center gap-1 px-2 py-1 text-xs rounded-md text-gray-500 hover:bg-white/10 hover:text-gray-300 transition-colors",
|
|
58270
|
+
className: "dr-tab flex items-center gap-1 px-2 py-1 text-xs rounded-md text-gray-500 hover:bg-white/10 hover:text-gray-300 transition-colors",
|
|
58245
58271
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
58246
58272
|
icon: "plus",
|
|
58247
58273
|
className: "h-2.5 w-2.5"
|
|
@@ -65828,7 +65854,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
65828
65854
|
}
|
|
65829
65855
|
}, [workspace, workspaceSelected]);
|
|
65830
65856
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
65831
|
-
className: "flex flex-row p-1 justify-between shrink items-center px-4 ".concat(currentTheme["bg-
|
|
65857
|
+
className: "dr-header flex flex-row p-1 justify-between shrink items-center px-4 ".concat(currentTheme["bg-none"], " py-2"),
|
|
65832
65858
|
children: preview === true ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
65833
65859
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
|
|
65834
65860
|
title: (workspaceSelected.name || "Untitled").replace(/^./, function (c) {
|
|
@@ -65841,11 +65867,11 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
65841
65867
|
children: [onPopout !== null && /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
65842
65868
|
icon: "arrow-up-right-from-square",
|
|
65843
65869
|
onClick: onPopout,
|
|
65844
|
-
hoverBackgroundColor: "hover:bg-
|
|
65870
|
+
hoverBackgroundColor: "hover:bg-neutral-700"
|
|
65845
65871
|
}), onClickEdit !== null && /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
65846
65872
|
icon: "pencil",
|
|
65847
65873
|
onClick: onClickEdit,
|
|
65848
|
-
hoverBackgroundColor: "hover:bg-
|
|
65874
|
+
hoverBackgroundColor: "hover:bg-neutral-700"
|
|
65849
65875
|
})]
|
|
65850
65876
|
})]
|
|
65851
65877
|
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -65857,7 +65883,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
65857
65883
|
onChange: onNameChange,
|
|
65858
65884
|
textSize: "text-lg",
|
|
65859
65885
|
placeholder: "My Workspace",
|
|
65860
|
-
bgColor: currentTheme["bg-
|
|
65886
|
+
bgColor: currentTheme["bg-neutral-very-dark"],
|
|
65861
65887
|
textColor: currentTheme["text-primary-medium"],
|
|
65862
65888
|
hasBorder: false,
|
|
65863
65889
|
autoFocus: true
|
|
@@ -65881,7 +65907,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
65881
65907
|
onFolderChange(menuId);
|
|
65882
65908
|
},
|
|
65883
65909
|
placeholder: "Folder",
|
|
65884
|
-
backgroundColor: currentTheme["bg-
|
|
65910
|
+
backgroundColor: currentTheme["bg-neutral-very-dark"],
|
|
65885
65911
|
textColor: currentTheme["text-primary-medium"],
|
|
65886
65912
|
borderColor: currentTheme["border-primary-dark"],
|
|
65887
65913
|
inputClassName: "py-1 text-sm",
|
|
@@ -65916,7 +65942,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
65916
65942
|
onThemeChange(themeKey);
|
|
65917
65943
|
},
|
|
65918
65944
|
placeholder: "Select a theme",
|
|
65919
|
-
backgroundColor: currentTheme["bg-
|
|
65945
|
+
backgroundColor: currentTheme["bg-neutral-very-dark"],
|
|
65920
65946
|
textColor: currentTheme["text-primary-medium"],
|
|
65921
65947
|
borderColor: currentTheme["border-primary-dark"],
|
|
65922
65948
|
inputClassName: "py-1 text-sm",
|
|
@@ -65939,7 +65965,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
65939
65965
|
icon: "xmark",
|
|
65940
65966
|
text: "Cancel",
|
|
65941
65967
|
onClick: onClickEdit,
|
|
65942
|
-
hoverBackgroundColor: "hover:bg-
|
|
65968
|
+
hoverBackgroundColor: "hover:bg-neutral-700"
|
|
65943
65969
|
}), onSaveChanges !== null && /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon2, {
|
|
65944
65970
|
icon: "check",
|
|
65945
65971
|
text: "Save",
|
|
@@ -65967,7 +65993,7 @@ function DashboardConfigButton(_ref8) {
|
|
|
65967
65993
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
65968
65994
|
icon: "sliders",
|
|
65969
65995
|
onClick: onClick,
|
|
65970
|
-
hoverBackgroundColor: "hover:bg-
|
|
65996
|
+
hoverBackgroundColor: "hover:bg-neutral-700"
|
|
65971
65997
|
}), unresolvedCount > 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
65972
65998
|
className: "absolute top-1 right-1 h-2 w-2 rounded-full bg-amber-400 border border-black/40 pointer-events-none",
|
|
65973
65999
|
title: "".concat(unresolvedCount, " unresolved provider").concat(unresolvedCount === 1 ? "" : "s")
|
|
@@ -67733,6 +67759,15 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
67733
67759
|
});
|
|
67734
67760
|
};
|
|
67735
67761
|
|
|
67762
|
+
var autoResize = function autoResize(el) {
|
|
67763
|
+
if (!el) return;
|
|
67764
|
+
el.style.height = "auto";
|
|
67765
|
+
if (el.scrollHeight === 0) {
|
|
67766
|
+
el.style.height = "";
|
|
67767
|
+
return;
|
|
67768
|
+
}
|
|
67769
|
+
el.style.height = Math.min(el.scrollHeight, 120) + "px";
|
|
67770
|
+
};
|
|
67736
67771
|
var ChatInput = function ChatInput(_ref) {
|
|
67737
67772
|
var onSend = _ref.onSend,
|
|
67738
67773
|
onStop = _ref.onStop,
|
|
@@ -67743,13 +67778,24 @@ var ChatInput = function ChatInput(_ref) {
|
|
|
67743
67778
|
input = _useState2[0],
|
|
67744
67779
|
setInput = _useState2[1];
|
|
67745
67780
|
var textareaRef = React.useRef(null);
|
|
67781
|
+
|
|
67782
|
+
// Auto-resize; re-measure once the input's container actually gets laid
|
|
67783
|
+
// out (e.g. the panel is expanded).
|
|
67746
67784
|
React.useEffect(function () {
|
|
67747
|
-
|
|
67748
|
-
if (el) {
|
|
67749
|
-
el.style.height = "auto";
|
|
67750
|
-
el.style.height = Math.min(el.scrollHeight, 120) + "px";
|
|
67751
|
-
}
|
|
67785
|
+
autoResize(textareaRef.current);
|
|
67752
67786
|
}, [input]);
|
|
67787
|
+
React.useEffect(function () {
|
|
67788
|
+
var el = textareaRef.current;
|
|
67789
|
+
var parent = el === null || el === void 0 ? void 0 : el.parentElement;
|
|
67790
|
+
if (!parent || typeof ResizeObserver === "undefined") return;
|
|
67791
|
+
var observer = new ResizeObserver(function () {
|
|
67792
|
+
return autoResize(el);
|
|
67793
|
+
});
|
|
67794
|
+
observer.observe(parent);
|
|
67795
|
+
return function () {
|
|
67796
|
+
return observer.disconnect();
|
|
67797
|
+
};
|
|
67798
|
+
}, []);
|
|
67753
67799
|
var handleSend = function handleSend() {
|
|
67754
67800
|
var trimmed = input.trim();
|
|
67755
67801
|
if (!trimmed || isLoading) return;
|