@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 CHANGED
@@ -26940,7 +26940,7 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
26940
26940
  })
26941
26941
  }) : useGridLayout ? scrollable ? /*#__PURE__*/jsx("div", {
26942
26942
  id: "grid-container-".concat(id),
26943
- className: "grid w-full min-h-24 p-3 ".concat(item.grid.gap || "gap-2"),
26943
+ 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"),
26944
26944
  style: {
26945
26945
  gridTemplateRows: getRowTemplate(item.grid),
26946
26946
  gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
@@ -26951,7 +26951,7 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
26951
26951
  className: "relative w-full ".concat(height, " min-h-24"),
26952
26952
  children: /*#__PURE__*/jsx("div", {
26953
26953
  id: "grid-container-".concat(id),
26954
- className: "absolute inset-0 grid p-3 ".concat(item.grid.gap || "gap-2"),
26954
+ 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"),
26955
26955
  style: {
26956
26956
  gridTemplateRows: hasExplicitRowModes() ? getRowTemplate(item.grid) : "repeat(".concat(item.grid.rows, ", minmax(0, 1fr))"),
26957
26957
  gridTemplateColumns: hasExplicitColModes() ? getColTemplate(item.grid) : "repeat(".concat(item.grid.cols, ", 1fr)"),
@@ -58043,7 +58043,7 @@ var DashTabBar = function DashTabBar(_ref) {
58043
58043
  currentTheme = _useContext.currentTheme;
58044
58044
  if (tabs.length === 0) return null;
58045
58045
  return /*#__PURE__*/jsx("div", {
58046
- 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"),
58046
+ 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"),
58047
58047
  children: tabs.map(function (tab) {
58048
58048
  var isActive = tab.id === activeTabId;
58049
58049
  return /*#__PURE__*/jsxs("button", {
@@ -58051,7 +58051,7 @@ var DashTabBar = function DashTabBar(_ref) {
58051
58051
  onClick: function onClick() {
58052
58052
  return onSwitchTab && onSwitchTab(tab.id);
58053
58053
  },
58054
- 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"),
58054
+ 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"),
58055
58055
  children: [/*#__PURE__*/jsx("span", {
58056
58056
  className: "truncate max-w-[140px]",
58057
58057
  children: (tab.name || "Untitled").replace(/^./, function (c) {
@@ -58183,7 +58183,7 @@ var PageTabBar = function PageTabBar(_ref) {
58183
58183
  setDragOverId(null);
58184
58184
  };
58185
58185
  return /*#__PURE__*/jsxs("div", {
58186
- className: "flex flex-row items-center shrink-0 overflow-x-auto gap-1 px-2 py-1.5 border-b ".concat(currentTheme["border-primary-dark"] || "border-gray-700", " ").concat(currentTheme["bg-primary-medium"] || "bg-gray-800/50", " scrollbar-none"),
58186
+ 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"),
58187
58187
  children: [pages.length > 1 && sortedPages.map(function (page) {
58188
58188
  var isActive = page.id === activePageId;
58189
58189
  var isDragOver = page.id === dragOverId;
@@ -58206,7 +58206,7 @@ var PageTabBar = function PageTabBar(_ref) {
58206
58206
  return handleDrop(e, page.id);
58207
58207
  },
58208
58208
  onDragEnd: handleDragEnd,
58209
- 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" : ""),
58209
+ 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" : ""),
58210
58210
  children: [editingId === page.id ? /*#__PURE__*/jsx("input", {
58211
58211
  ref: inputRef,
58212
58212
  type: "text",
@@ -58249,7 +58249,7 @@ var PageTabBar = function PageTabBar(_ref) {
58249
58249
  }), editMode && onAddPage && /*#__PURE__*/jsxs("button", {
58250
58250
  type: "button",
58251
58251
  onClick: onAddPage,
58252
- 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",
58252
+ 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",
58253
58253
  children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
58254
58254
  icon: "plus",
58255
58255
  className: "h-2.5 w-2.5"
@@ -65836,7 +65836,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
65836
65836
  }
65837
65837
  }, [workspace, workspaceSelected]);
65838
65838
  return /*#__PURE__*/jsx("div", {
65839
- className: "flex flex-row p-1 justify-between shrink items-center px-4 ".concat(currentTheme["bg-primary-dark"], " py-2"),
65839
+ className: "dr-header flex flex-row p-1 justify-between shrink items-center px-4 ".concat(currentTheme["bg-none"], " py-2"),
65840
65840
  children: preview === true ? /*#__PURE__*/jsxs(Fragment, {
65841
65841
  children: [/*#__PURE__*/jsx(SubHeading3, {
65842
65842
  title: (workspaceSelected.name || "Untitled").replace(/^./, function (c) {
@@ -65849,11 +65849,11 @@ var DashboardHeader = function DashboardHeader(_ref) {
65849
65849
  children: [onPopout !== null && /*#__PURE__*/jsx(ButtonIcon, {
65850
65850
  icon: "arrow-up-right-from-square",
65851
65851
  onClick: onPopout,
65852
- hoverBackgroundColor: "hover:bg-indigo-700"
65852
+ hoverBackgroundColor: "hover:bg-neutral-700"
65853
65853
  }), onClickEdit !== null && /*#__PURE__*/jsx(ButtonIcon, {
65854
65854
  icon: "pencil",
65855
65855
  onClick: onClickEdit,
65856
- hoverBackgroundColor: "hover:bg-indigo-700"
65856
+ hoverBackgroundColor: "hover:bg-neutral-700"
65857
65857
  })]
65858
65858
  })]
65859
65859
  }) : /*#__PURE__*/jsxs(Fragment, {
@@ -65865,7 +65865,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
65865
65865
  onChange: onNameChange,
65866
65866
  textSize: "text-lg",
65867
65867
  placeholder: "My Workspace",
65868
- bgColor: currentTheme["bg-primary-very-dark"],
65868
+ bgColor: currentTheme["bg-neutral-very-dark"],
65869
65869
  textColor: currentTheme["text-primary-medium"],
65870
65870
  hasBorder: false,
65871
65871
  autoFocus: true
@@ -65889,7 +65889,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
65889
65889
  onFolderChange(menuId);
65890
65890
  },
65891
65891
  placeholder: "Folder",
65892
- backgroundColor: currentTheme["bg-primary-very-dark"],
65892
+ backgroundColor: currentTheme["bg-neutral-very-dark"],
65893
65893
  textColor: currentTheme["text-primary-medium"],
65894
65894
  borderColor: currentTheme["border-primary-dark"],
65895
65895
  inputClassName: "py-1 text-sm",
@@ -65924,7 +65924,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
65924
65924
  onThemeChange(themeKey);
65925
65925
  },
65926
65926
  placeholder: "Select a theme",
65927
- backgroundColor: currentTheme["bg-primary-very-dark"],
65927
+ backgroundColor: currentTheme["bg-neutral-very-dark"],
65928
65928
  textColor: currentTheme["text-primary-medium"],
65929
65929
  borderColor: currentTheme["border-primary-dark"],
65930
65930
  inputClassName: "py-1 text-sm",
@@ -65947,7 +65947,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
65947
65947
  icon: "xmark",
65948
65948
  text: "Cancel",
65949
65949
  onClick: onClickEdit,
65950
- hoverBackgroundColor: "hover:bg-indigo-700"
65950
+ hoverBackgroundColor: "hover:bg-neutral-700"
65951
65951
  }), onSaveChanges !== null && /*#__PURE__*/jsx(ButtonIcon2, {
65952
65952
  icon: "check",
65953
65953
  text: "Save",
@@ -65975,7 +65975,7 @@ function DashboardConfigButton(_ref8) {
65975
65975
  children: [/*#__PURE__*/jsx(ButtonIcon, {
65976
65976
  icon: "sliders",
65977
65977
  onClick: onClick,
65978
- hoverBackgroundColor: "hover:bg-indigo-700"
65978
+ hoverBackgroundColor: "hover:bg-neutral-700"
65979
65979
  }), unresolvedCount > 0 && /*#__PURE__*/jsx("span", {
65980
65980
  className: "absolute top-1 right-1 h-2 w-2 rounded-full bg-amber-400 border border-black/40 pointer-events-none",
65981
65981
  title: "".concat(unresolvedCount, " unresolved provider").concat(unresolvedCount === 1 ? "" : "s")
@@ -67741,6 +67741,15 @@ var ChatMessages = function ChatMessages(_ref) {
67741
67741
  });
67742
67742
  };
67743
67743
 
67744
+ var autoResize = function autoResize(el) {
67745
+ if (!el) return;
67746
+ el.style.height = "auto";
67747
+ if (el.scrollHeight === 0) {
67748
+ el.style.height = "";
67749
+ return;
67750
+ }
67751
+ el.style.height = Math.min(el.scrollHeight, 120) + "px";
67752
+ };
67744
67753
  var ChatInput = function ChatInput(_ref) {
67745
67754
  var onSend = _ref.onSend,
67746
67755
  onStop = _ref.onStop,
@@ -67751,13 +67760,24 @@ var ChatInput = function ChatInput(_ref) {
67751
67760
  input = _useState2[0],
67752
67761
  setInput = _useState2[1];
67753
67762
  var textareaRef = useRef(null);
67763
+
67764
+ // Auto-resize; re-measure once the input's container actually gets laid
67765
+ // out (e.g. the panel is expanded).
67754
67766
  useEffect(function () {
67755
- var el = textareaRef.current;
67756
- if (el) {
67757
- el.style.height = "auto";
67758
- el.style.height = Math.min(el.scrollHeight, 120) + "px";
67759
- }
67767
+ autoResize(textareaRef.current);
67760
67768
  }, [input]);
67769
+ useEffect(function () {
67770
+ var el = textareaRef.current;
67771
+ var parent = el === null || el === void 0 ? void 0 : el.parentElement;
67772
+ if (!parent || typeof ResizeObserver === "undefined") return;
67773
+ var observer = new ResizeObserver(function () {
67774
+ return autoResize(el);
67775
+ });
67776
+ observer.observe(parent);
67777
+ return function () {
67778
+ return observer.disconnect();
67779
+ };
67780
+ }, []);
67761
67781
  var handleSend = function handleSend() {
67762
67782
  var trimmed = input.trim();
67763
67783
  if (!trimmed || isLoading) return;