@trops/dash-core 0.1.636 → 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 +40 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +40 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26958,7 +26958,7 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
26958
26958
|
})
|
|
26959
26959
|
}) : useGridLayout ? scrollable ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26960
26960
|
id: "grid-container-".concat(id),
|
|
26961
|
-
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"),
|
|
26962
26962
|
style: {
|
|
26963
26963
|
gridTemplateRows: getRowTemplate(item.grid),
|
|
26964
26964
|
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
|
|
@@ -26969,7 +26969,7 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
26969
26969
|
className: "relative w-full ".concat(height, " min-h-24"),
|
|
26970
26970
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
26971
26971
|
id: "grid-container-".concat(id),
|
|
26972
|
-
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"),
|
|
26973
26973
|
style: {
|
|
26974
26974
|
gridTemplateRows: hasExplicitRowModes() ? getRowTemplate(item.grid) : "repeat(".concat(item.grid.rows, ", minmax(0, 1fr))"),
|
|
26975
26975
|
gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
|
|
@@ -58061,7 +58061,7 @@ var DashTabBar = function DashTabBar(_ref) {
|
|
|
58061
58061
|
currentTheme = _useContext.currentTheme;
|
|
58062
58062
|
if (tabs.length === 0) return null;
|
|
58063
58063
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
58064
|
-
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"),
|
|
58065
58065
|
children: tabs.map(function (tab) {
|
|
58066
58066
|
var isActive = tab.id === activeTabId;
|
|
58067
58067
|
return /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
@@ -58069,7 +58069,7 @@ var DashTabBar = function DashTabBar(_ref) {
|
|
|
58069
58069
|
onClick: function onClick() {
|
|
58070
58070
|
return onSwitchTab && onSwitchTab(tab.id);
|
|
58071
58071
|
},
|
|
58072
|
-
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"),
|
|
58073
58073
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
58074
58074
|
className: "truncate max-w-[140px]",
|
|
58075
58075
|
children: (tab.name || "Untitled").replace(/^./, function (c) {
|
|
@@ -58201,7 +58201,7 @@ var PageTabBar = function PageTabBar(_ref) {
|
|
|
58201
58201
|
setDragOverId(null);
|
|
58202
58202
|
};
|
|
58203
58203
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
58204
|
-
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"),
|
|
58205
58205
|
children: [pages.length > 1 && sortedPages.map(function (page) {
|
|
58206
58206
|
var isActive = page.id === activePageId;
|
|
58207
58207
|
var isDragOver = page.id === dragOverId;
|
|
@@ -58224,7 +58224,7 @@ var PageTabBar = function PageTabBar(_ref) {
|
|
|
58224
58224
|
return handleDrop(e, page.id);
|
|
58225
58225
|
},
|
|
58226
58226
|
onDragEnd: handleDragEnd,
|
|
58227
|
-
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" : ""),
|
|
58228
58228
|
children: [editingId === page.id ? /*#__PURE__*/jsxRuntime.jsx("input", {
|
|
58229
58229
|
ref: inputRef,
|
|
58230
58230
|
type: "text",
|
|
@@ -58267,7 +58267,7 @@ var PageTabBar = function PageTabBar(_ref) {
|
|
|
58267
58267
|
}), editMode && onAddPage && /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
58268
58268
|
type: "button",
|
|
58269
58269
|
onClick: onAddPage,
|
|
58270
|
-
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",
|
|
58271
58271
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
58272
58272
|
icon: "plus",
|
|
58273
58273
|
className: "h-2.5 w-2.5"
|
|
@@ -65854,7 +65854,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
65854
65854
|
}
|
|
65855
65855
|
}, [workspace, workspaceSelected]);
|
|
65856
65856
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
65857
|
-
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"),
|
|
65858
65858
|
children: preview === true ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
65859
65859
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
|
|
65860
65860
|
title: (workspaceSelected.name || "Untitled").replace(/^./, function (c) {
|
|
@@ -65867,11 +65867,11 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
65867
65867
|
children: [onPopout !== null && /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
65868
65868
|
icon: "arrow-up-right-from-square",
|
|
65869
65869
|
onClick: onPopout,
|
|
65870
|
-
hoverBackgroundColor: "hover:bg-
|
|
65870
|
+
hoverBackgroundColor: "hover:bg-neutral-700"
|
|
65871
65871
|
}), onClickEdit !== null && /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
65872
65872
|
icon: "pencil",
|
|
65873
65873
|
onClick: onClickEdit,
|
|
65874
|
-
hoverBackgroundColor: "hover:bg-
|
|
65874
|
+
hoverBackgroundColor: "hover:bg-neutral-700"
|
|
65875
65875
|
})]
|
|
65876
65876
|
})]
|
|
65877
65877
|
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
@@ -65883,7 +65883,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
65883
65883
|
onChange: onNameChange,
|
|
65884
65884
|
textSize: "text-lg",
|
|
65885
65885
|
placeholder: "My Workspace",
|
|
65886
|
-
bgColor: currentTheme["bg-
|
|
65886
|
+
bgColor: currentTheme["bg-neutral-very-dark"],
|
|
65887
65887
|
textColor: currentTheme["text-primary-medium"],
|
|
65888
65888
|
hasBorder: false,
|
|
65889
65889
|
autoFocus: true
|
|
@@ -65907,7 +65907,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
65907
65907
|
onFolderChange(menuId);
|
|
65908
65908
|
},
|
|
65909
65909
|
placeholder: "Folder",
|
|
65910
|
-
backgroundColor: currentTheme["bg-
|
|
65910
|
+
backgroundColor: currentTheme["bg-neutral-very-dark"],
|
|
65911
65911
|
textColor: currentTheme["text-primary-medium"],
|
|
65912
65912
|
borderColor: currentTheme["border-primary-dark"],
|
|
65913
65913
|
inputClassName: "py-1 text-sm",
|
|
@@ -65942,7 +65942,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
65942
65942
|
onThemeChange(themeKey);
|
|
65943
65943
|
},
|
|
65944
65944
|
placeholder: "Select a theme",
|
|
65945
|
-
backgroundColor: currentTheme["bg-
|
|
65945
|
+
backgroundColor: currentTheme["bg-neutral-very-dark"],
|
|
65946
65946
|
textColor: currentTheme["text-primary-medium"],
|
|
65947
65947
|
borderColor: currentTheme["border-primary-dark"],
|
|
65948
65948
|
inputClassName: "py-1 text-sm",
|
|
@@ -65965,7 +65965,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
65965
65965
|
icon: "xmark",
|
|
65966
65966
|
text: "Cancel",
|
|
65967
65967
|
onClick: onClickEdit,
|
|
65968
|
-
hoverBackgroundColor: "hover:bg-
|
|
65968
|
+
hoverBackgroundColor: "hover:bg-neutral-700"
|
|
65969
65969
|
}), onSaveChanges !== null && /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon2, {
|
|
65970
65970
|
icon: "check",
|
|
65971
65971
|
text: "Save",
|
|
@@ -65993,7 +65993,7 @@ function DashboardConfigButton(_ref8) {
|
|
|
65993
65993
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
65994
65994
|
icon: "sliders",
|
|
65995
65995
|
onClick: onClick,
|
|
65996
|
-
hoverBackgroundColor: "hover:bg-
|
|
65996
|
+
hoverBackgroundColor: "hover:bg-neutral-700"
|
|
65997
65997
|
}), unresolvedCount > 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
65998
65998
|
className: "absolute top-1 right-1 h-2 w-2 rounded-full bg-amber-400 border border-black/40 pointer-events-none",
|
|
65999
65999
|
title: "".concat(unresolvedCount, " unresolved provider").concat(unresolvedCount === 1 ? "" : "s")
|
|
@@ -67759,6 +67759,15 @@ var ChatMessages = function ChatMessages(_ref) {
|
|
|
67759
67759
|
});
|
|
67760
67760
|
};
|
|
67761
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
|
+
};
|
|
67762
67771
|
var ChatInput = function ChatInput(_ref) {
|
|
67763
67772
|
var onSend = _ref.onSend,
|
|
67764
67773
|
onStop = _ref.onStop,
|
|
@@ -67769,13 +67778,24 @@ var ChatInput = function ChatInput(_ref) {
|
|
|
67769
67778
|
input = _useState2[0],
|
|
67770
67779
|
setInput = _useState2[1];
|
|
67771
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).
|
|
67772
67784
|
React.useEffect(function () {
|
|
67773
|
-
|
|
67774
|
-
if (el) {
|
|
67775
|
-
el.style.height = "auto";
|
|
67776
|
-
el.style.height = Math.min(el.scrollHeight, 120) + "px";
|
|
67777
|
-
}
|
|
67785
|
+
autoResize(textareaRef.current);
|
|
67778
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
|
+
}, []);
|
|
67779
67799
|
var handleSend = function handleSend() {
|
|
67780
67800
|
var trimmed = input.trim();
|
|
67781
67801
|
if (!trimmed || isLoading) return;
|