@trops/dash-core 0.1.323 → 0.1.325

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
@@ -51696,12 +51696,19 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
51696
51696
  if (!workspaceSelected) return;
51697
51697
  var tempWorkspace = deepCopy(currentWorkspaceRef.current || workspaceSelected);
51698
51698
  tempWorkspace["menuId"] = Number(menuId);
51699
+ if (currentWorkspaceRef.current) {
51700
+ currentWorkspaceRef.current.menuId = Number(menuId);
51701
+ }
51699
51702
  updateTabWorkspace(tempWorkspace);
51700
51703
  }
51701
51704
  function handleWorkspaceThemeChange(themeKey) {
51702
51705
  if (!workspaceSelected) return;
51703
51706
  var tempWorkspace = deepCopy(currentWorkspaceRef.current || workspaceSelected);
51704
51707
  tempWorkspace["themeKey"] = themeKey || null;
51708
+ // Sync themeKey to the LayoutBuilder ref so save picks it up
51709
+ if (currentWorkspaceRef.current) {
51710
+ currentWorkspaceRef.current.themeKey = themeKey || null;
51711
+ }
51705
51712
  updateTabWorkspace(tempWorkspace);
51706
51713
  }
51707
51714
  function handleScrollableChange(enabled) {
@@ -51759,13 +51766,24 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
51759
51766
  return copy;
51760
51767
  });
51761
51768
  } else {
51762
- // Single-page: use workspaceRef as before
51763
- workspaceToSave = deepCopy(currentWorkspaceRef.current || workspaceSelected);
51764
- var layout = workspaceToSave["layout"].map(function (layoutItem) {
51765
- delete layoutItem["widgetConfig"];
51766
- return layoutItem;
51767
- });
51768
- workspaceToSave["layout"] = layout;
51769
+ var _currentWorkspaceRef$;
51770
+ // Single-page: merge workspace-level properties (themeKey, name, menuId, etc.)
51771
+ // from workspaceSelected with the latest layout from currentWorkspaceRef.
51772
+ // The ref only tracks layout changes; header-level property changes
51773
+ // (theme, folder, scrollable) are tracked in workspaceSelected.
51774
+ workspaceToSave = deepCopy(workspaceSelected);
51775
+ var refLayout = (_currentWorkspaceRef$ = currentWorkspaceRef.current) === null || _currentWorkspaceRef$ === void 0 ? void 0 : _currentWorkspaceRef$.layout;
51776
+ if (refLayout) {
51777
+ workspaceToSave["layout"] = refLayout.map(function (layoutItem) {
51778
+ delete layoutItem["widgetConfig"];
51779
+ return layoutItem;
51780
+ });
51781
+ } else {
51782
+ workspaceToSave["layout"] = (workspaceToSave["layout"] || []).map(function (layoutItem) {
51783
+ delete layoutItem["widgetConfig"];
51784
+ return layoutItem;
51785
+ });
51786
+ }
51769
51787
  }
51770
51788
 
51771
51789
  // Gather sidebar layout from its LayoutBuilder ref