@trops/dash-core 0.1.421 → 0.1.422

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
@@ -18794,7 +18794,32 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
18794
18794
  var isWidgetMissing = (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component) && !widgetConfig;
18795
18795
 
18796
18796
  // Get widget name from config or item
18797
- var widgetName = (widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.name) || (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.name) || (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component);
18797
+ var widgetName = (widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.displayName) || (widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.name) || (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.name) || (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component);
18798
+
18799
+ // Build a scope/package subtitle so ambiguous component names like
18800
+ // `ProspectListColumn` (which might come from `@ai-built/…` or
18801
+ // `@trops/pipeline`) are disambiguated in the layout builder. Derives
18802
+ // from whatever identity the config / layout item carries:
18803
+ // - widgetConfig.id: e.g. "@ai-built/prospectlistcolumn.ProspectListColumn"
18804
+ // - widgetConfig.package: e.g. "@ai-built/prospectlistcolumn"
18805
+ // - widgetItem.workspace: fallback hint ("ai-built" / "@trops/pipeline")
18806
+ // Falls back to empty string so we can skip rendering if we have
18807
+ // nothing meaningful beyond the component name itself.
18808
+ var packageLabel = function () {
18809
+ var dropTrailingComponent = function dropTrailingComponent(s) {
18810
+ if (typeof s !== "string") return "";
18811
+ var lastDot = s.lastIndexOf(".");
18812
+ return lastDot > 0 ? s.slice(0, lastDot) : s;
18813
+ };
18814
+ var fromId = dropTrailingComponent((widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.id) || "");
18815
+ if (fromId) return fromId;
18816
+ if (widgetConfig !== null && widgetConfig !== void 0 && widgetConfig["package"]) return String(widgetConfig["package"]);
18817
+ var wsHint = widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.workspace;
18818
+ if (typeof wsHint === "string" && wsHint && wsHint !== "layout") {
18819
+ return wsHint.startsWith("@") ? wsHint : "@".concat(wsHint);
18820
+ }
18821
+ return "";
18822
+ }();
18798
18823
 
18799
18824
  // Get provider requirements from widget config (not from item directly)
18800
18825
  // Filter out providerClass: "api" so only user-configurable providers show badges
@@ -18933,11 +18958,18 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
18933
18958
  children: [/*#__PURE__*/jsx(WidgetIcon, {
18934
18959
  icon: isWidgetMissing ? "triangle-exclamation" : widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.icon,
18935
18960
  className: "h-4 w-4 flex-shrink-0 ".concat(isWidgetMissing ? "text-amber-500" : "text-white/60")
18936
- }), /*#__PURE__*/jsxs("span", {
18937
- className: "font-medium text-sm text-gray-100 truncate",
18938
- children: [widgetName || cellNumber || "Empty", isWidgetMissing && /*#__PURE__*/jsx("span", {
18939
- className: "text-amber-500/70 font-normal ml-1",
18940
- children: "(not found)"
18961
+ }), /*#__PURE__*/jsxs("div", {
18962
+ className: "flex flex-col min-w-0 leading-tight",
18963
+ children: [/*#__PURE__*/jsxs("span", {
18964
+ className: "font-medium text-sm text-gray-100 truncate",
18965
+ children: [widgetName || cellNumber || "Empty", isWidgetMissing && /*#__PURE__*/jsx("span", {
18966
+ className: "text-amber-500/70 font-normal ml-1",
18967
+ children: "(not found)"
18968
+ })]
18969
+ }), packageLabel && /*#__PURE__*/jsxs("span", {
18970
+ className: "text-[10px] text-gray-500 truncate",
18971
+ title: "".concat(packageLabel, " \xB7 ").concat((widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component) || ""),
18972
+ children: [packageLabel, widgetItem !== null && widgetItem !== void 0 && widgetItem.component && widgetItem.component !== widgetName ? " \xB7 ".concat(widgetItem.component) : ""]
18941
18973
  })]
18942
18974
  })]
18943
18975
  }), (providerRequirements.length > 0 || overflowActions.length > 0 || onMoreOptions) && /*#__PURE__*/jsxs("div", {
@@ -20692,6 +20724,17 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
20692
20724
  wsRef.current = currentWorkspace;
20693
20725
  }, [currentWorkspace]);
20694
20726
 
20727
+ // Stable ref to onWorkspaceChange so the window-event handlers below can
20728
+ // propagate mutations upstream without resubscribing on every render.
20729
+ // Without this, swap/place handlers only update LayoutBuilder-local
20730
+ // state — the parent (PinnedSidebar / PageLayoutBuilder) never learns
20731
+ // about the change, so the next parent re-render reverts it via the
20732
+ // `[workspace]` useEffect above and the save path reads stale state.
20733
+ var onWorkspaceChangeRef = useRef(onWorkspaceChange);
20734
+ useEffect(function () {
20735
+ onWorkspaceChangeRef.current = onWorkspaceChange;
20736
+ }, [onWorkspaceChange]);
20737
+
20695
20738
  // Listen for AI widget builder placement — modifies layout state directly
20696
20739
  useEffect(function () {
20697
20740
  var handler = function handler(e) {
@@ -20728,6 +20771,9 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
20728
20771
  var newWorkspace = JSON.parse(JSON.stringify(ws));
20729
20772
  newWorkspace.layout = newLayout;
20730
20773
  setCurrentWorkspace(newWorkspace);
20774
+ if (typeof onWorkspaceChangeRef.current === "function") {
20775
+ onWorkspaceChangeRef.current(newWorkspace);
20776
+ }
20731
20777
  } catch (err) {
20732
20778
  }
20733
20779
  };
@@ -20762,6 +20808,9 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
20762
20808
  var newWorkspace = JSON.parse(JSON.stringify(ws));
20763
20809
  newWorkspace.layout = newLayout;
20764
20810
  setCurrentWorkspace(newWorkspace);
20811
+ if (typeof onWorkspaceChangeRef.current === "function") {
20812
+ onWorkspaceChangeRef.current(newWorkspace);
20813
+ }
20765
20814
  } catch (err) {
20766
20815
  }
20767
20816
  };