@trops/dash-core 0.1.326 → 0.1.329
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 +149 -139
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +149 -138
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -606,6 +606,30 @@ var DashboardApi = {
|
|
|
606
606
|
}
|
|
607
607
|
};
|
|
608
608
|
|
|
609
|
+
/**
|
|
610
|
+
* DashboardActionsApi
|
|
611
|
+
*
|
|
612
|
+
* Provides programmatic control over dashboard-level actions.
|
|
613
|
+
* Widgets can call these methods directly (not via events) to
|
|
614
|
+
* control the dashboard they are rendered in.
|
|
615
|
+
*
|
|
616
|
+
* Internally dispatches CustomEvents on `window` so the API
|
|
617
|
+
* stays decoupled from the React component tree.
|
|
618
|
+
*/
|
|
619
|
+
var DashboardActionsApi = {
|
|
620
|
+
/**
|
|
621
|
+
* Switch the active page in the current dashboard.
|
|
622
|
+
* @param {string} pageId - The ID of the page to switch to
|
|
623
|
+
*/
|
|
624
|
+
switchPage: function switchPage(pageId) {
|
|
625
|
+
window.dispatchEvent(new CustomEvent("dash:switch-page", {
|
|
626
|
+
detail: {
|
|
627
|
+
pageId: pageId
|
|
628
|
+
}
|
|
629
|
+
}));
|
|
630
|
+
}
|
|
631
|
+
};
|
|
632
|
+
|
|
609
633
|
var SECURE_STORE_ENCRYPTION_CHECK = "secure-storage-encryption-check";
|
|
610
634
|
var SECURE_STORE_ENCRYPTION_CHECK_COMPLETE = "secure-storage-encryption-check-complete";
|
|
611
635
|
var SECURE_STORE_ENCRYPTION_CHECK_ERROR = "secure-storage-encryption-check-error";
|
|
@@ -1895,6 +1919,7 @@ var DashboardContext = /*#__PURE__*/React.createContext({
|
|
|
1895
1919
|
pub: DashboardPublisher,
|
|
1896
1920
|
widgetApi: buildWidgetApi(),
|
|
1897
1921
|
dashApi: null,
|
|
1922
|
+
dashboardApi: DashboardActionsApi,
|
|
1898
1923
|
providers: {}
|
|
1899
1924
|
});
|
|
1900
1925
|
|
|
@@ -2623,6 +2648,7 @@ var DashboardWrapper = function DashboardWrapper(_ref) {
|
|
|
2623
2648
|
widgetApi: widgetApi,
|
|
2624
2649
|
pub: DashboardPublisher,
|
|
2625
2650
|
dashApi: dashApi,
|
|
2651
|
+
dashboardApi: DashboardActionsApi,
|
|
2626
2652
|
credentials: credentials,
|
|
2627
2653
|
providers: providers
|
|
2628
2654
|
};
|
|
@@ -23925,7 +23951,8 @@ var WidgetRenderer = function WidgetRenderer(_ref) {
|
|
|
23925
23951
|
publishEvent: function publishEvent(eventName, payload) {
|
|
23926
23952
|
return helpers.publishEvent(eventName, payload);
|
|
23927
23953
|
},
|
|
23928
|
-
api: w
|
|
23954
|
+
api: w,
|
|
23955
|
+
dashboardApi: DashboardActionsApi
|
|
23929
23956
|
}, params), userPrefs), {}, {
|
|
23930
23957
|
backgroundColor: bgColor,
|
|
23931
23958
|
widgetConfig: helpers.config(),
|
|
@@ -23938,6 +23965,7 @@ var WidgetRenderer = function WidgetRenderer(_ref) {
|
|
|
23938
23965
|
return helpers.publishEvent(eventName, payload);
|
|
23939
23966
|
},
|
|
23940
23967
|
api: w,
|
|
23968
|
+
dashboardApi: DashboardActionsApi,
|
|
23941
23969
|
id: "widget-kids-".concat(widgetKey)
|
|
23942
23970
|
}, params), userPrefs), {}, {
|
|
23943
23971
|
backgroundColor: bgColor,
|
|
@@ -27609,15 +27637,22 @@ var DashboardModel = /*#__PURE__*/function () {
|
|
|
27609
27637
|
this.sidebarLayout = "sidebarLayout" in obj ? obj.sidebarLayout : [];
|
|
27610
27638
|
this.sidebarWidth = "sidebarWidth" in obj ? obj.sidebarWidth : 280;
|
|
27611
27639
|
|
|
27612
|
-
// Multi-page support:
|
|
27640
|
+
// Multi-page support: every workspace always has at least one page.
|
|
27641
|
+
// Existing multi-page workspaces load as-is; single-page workspaces
|
|
27642
|
+
// are auto-migrated by wrapping their layout into a page.
|
|
27613
27643
|
if ("pages" in obj && Array.isArray(obj.pages) && obj.pages.length > 0) {
|
|
27614
27644
|
this.pages = obj.pages;
|
|
27615
27645
|
this.activePageId = obj.activePageId || obj.pages[0].id;
|
|
27616
27646
|
} else {
|
|
27617
|
-
//
|
|
27618
|
-
|
|
27619
|
-
|
|
27620
|
-
|
|
27647
|
+
// Auto-migrate: wrap existing layout into a single page
|
|
27648
|
+
var page = {
|
|
27649
|
+
id: "page-".concat(this.id || Date.now()),
|
|
27650
|
+
name: this.name || "Page 1",
|
|
27651
|
+
order: 0,
|
|
27652
|
+
layout: this.layout
|
|
27653
|
+
};
|
|
27654
|
+
this.pages = [page];
|
|
27655
|
+
this.activePageId = page.id;
|
|
27621
27656
|
}
|
|
27622
27657
|
obj = null;
|
|
27623
27658
|
|
|
@@ -27630,12 +27665,12 @@ var DashboardModel = /*#__PURE__*/function () {
|
|
|
27630
27665
|
_step;
|
|
27631
27666
|
try {
|
|
27632
27667
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
27633
|
-
var
|
|
27634
|
-
if (
|
|
27668
|
+
var _page = _step.value;
|
|
27669
|
+
if (_page.layout) {
|
|
27635
27670
|
var saved = this.layout;
|
|
27636
|
-
this.layout =
|
|
27671
|
+
this.layout = _page.layout;
|
|
27637
27672
|
this._normalizeAllGrids();
|
|
27638
|
-
|
|
27673
|
+
_page.layout = this.layout;
|
|
27639
27674
|
this.layout = saved;
|
|
27640
27675
|
}
|
|
27641
27676
|
}
|
|
@@ -27709,10 +27744,8 @@ var DashboardModel = /*#__PURE__*/function () {
|
|
|
27709
27744
|
themeKey: this.themeKey,
|
|
27710
27745
|
selectedProviders: this.selectedProviders
|
|
27711
27746
|
};
|
|
27712
|
-
|
|
27713
|
-
|
|
27714
|
-
ws.activePageId = this.activePageId;
|
|
27715
|
-
}
|
|
27747
|
+
ws.pages = this.pages;
|
|
27748
|
+
ws.activePageId = this.activePageId;
|
|
27716
27749
|
if (this.sidebarEnabled || ((_this$sidebarLayout = this.sidebarLayout) === null || _this$sidebarLayout === void 0 ? void 0 : _this$sidebarLayout.length) > 0) {
|
|
27717
27750
|
ws.sidebarEnabled = this.sidebarEnabled;
|
|
27718
27751
|
ws.sidebarLayout = this.sidebarLayout;
|
|
@@ -48804,7 +48837,11 @@ var PageTabBar = function PageTabBar(_ref) {
|
|
|
48804
48837
|
_ref$onReorderPages = _ref.onReorderPages,
|
|
48805
48838
|
onReorderPages = _ref$onReorderPages === void 0 ? null : _ref$onReorderPages,
|
|
48806
48839
|
_ref$editMode = _ref.editMode,
|
|
48807
|
-
editMode = _ref$editMode === void 0 ? false : _ref$editMode
|
|
48840
|
+
editMode = _ref$editMode === void 0 ? false : _ref$editMode,
|
|
48841
|
+
_ref$scrollableEnable = _ref.scrollableEnabled,
|
|
48842
|
+
scrollableEnabled = _ref$scrollableEnable === void 0 ? false : _ref$scrollableEnable,
|
|
48843
|
+
_ref$onScrollableChan = _ref.onScrollableChange,
|
|
48844
|
+
onScrollableChange = _ref$onScrollableChan === void 0 ? null : _ref$onScrollableChan;
|
|
48808
48845
|
var _useContext = React.useContext(DashReact.ThemeContext),
|
|
48809
48846
|
currentTheme = _useContext.currentTheme;
|
|
48810
48847
|
var _useState = React.useState(null),
|
|
@@ -48957,6 +48994,13 @@ var PageTabBar = function PageTabBar(_ref) {
|
|
|
48957
48994
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
48958
48995
|
children: "Add Page"
|
|
48959
48996
|
})]
|
|
48997
|
+
}), editMode && onScrollableChange && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
48998
|
+
className: "ml-auto flex items-center shrink-0",
|
|
48999
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.Toggle, {
|
|
49000
|
+
text: "Scrollable",
|
|
49001
|
+
enabled: scrollableEnabled,
|
|
49002
|
+
setEnabled: onScrollableChange
|
|
49003
|
+
})
|
|
48960
49004
|
})]
|
|
48961
49005
|
});
|
|
48962
49006
|
};
|
|
@@ -51470,38 +51514,37 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
51470
51514
|
_useState48 = _slicedToArray(_useState47, 2),
|
|
51471
51515
|
activePageId = _useState48[0],
|
|
51472
51516
|
setActivePageId = _useState48[1];
|
|
51517
|
+
|
|
51518
|
+
// Listen for programmatic page switches via DashboardActionsApi
|
|
51519
|
+
React.useEffect(function () {
|
|
51520
|
+
function onSwitchPage(e) {
|
|
51521
|
+
var _ref4 = e.detail || {},
|
|
51522
|
+
pageId = _ref4.pageId;
|
|
51523
|
+
if (pageId) setActivePageId(pageId);
|
|
51524
|
+
}
|
|
51525
|
+
window.addEventListener("dash:switch-page", onSwitchPage);
|
|
51526
|
+
return function () {
|
|
51527
|
+
return window.removeEventListener("dash:switch-page", onSwitchPage);
|
|
51528
|
+
};
|
|
51529
|
+
}, []);
|
|
51473
51530
|
var workspacePages = (workspaceSelected === null || workspaceSelected === void 0 ? void 0 : workspaceSelected.pages) || [];
|
|
51474
|
-
var hasPages = workspacePages.length > 0;
|
|
51475
51531
|
|
|
51476
51532
|
// Memoize sorted pages so page object references stay stable across re-renders
|
|
51477
51533
|
var sortedPagesForRender = React.useMemo(function () {
|
|
51478
|
-
return
|
|
51534
|
+
return _toConsumableArray(workspacePages).sort(function (a, b) {
|
|
51479
51535
|
return (a.order || 0) - (b.order || 0);
|
|
51480
|
-
})
|
|
51536
|
+
});
|
|
51481
51537
|
},
|
|
51482
51538
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
51483
|
-
[
|
|
51539
|
+
[workspacePages.length,
|
|
51484
51540
|
// Re-sort when page names/order change but not on every parent render
|
|
51485
51541
|
workspacePages.map(function (p) {
|
|
51486
51542
|
return "".concat(p.id, ":").concat(p.order, ":").concat(p.name);
|
|
51487
51543
|
}).join(",")]);
|
|
51488
51544
|
var currentActivePageId = activePageId || (workspaceSelected === null || workspaceSelected === void 0 ? void 0 : workspaceSelected.activePageId) || ((_workspacePages$0$id = (_workspacePages$ = workspacePages[0]) === null || _workspacePages$ === void 0 ? void 0 : _workspacePages$.id) !== null && _workspacePages$0$id !== void 0 ? _workspacePages$0$id : null);
|
|
51489
51545
|
function handleAddPage() {
|
|
51490
|
-
var _workspaceSelected$la;
|
|
51491
51546
|
if (!workspaceSelected) return;
|
|
51492
51547
|
var existingPages = _toConsumableArray(workspacePages);
|
|
51493
|
-
|
|
51494
|
-
// If this is the first time adding a page to a single-page dashboard,
|
|
51495
|
-
// migrate the existing layout into page 1 first.
|
|
51496
|
-
if (existingPages.length === 0 && ((_workspaceSelected$la = workspaceSelected.layout) === null || _workspaceSelected$la === void 0 ? void 0 : _workspaceSelected$la.length) > 0) {
|
|
51497
|
-
var page1 = {
|
|
51498
|
-
id: "page-".concat(Date.now() - 1),
|
|
51499
|
-
name: workspaceSelected.name || "Page 1",
|
|
51500
|
-
order: 0,
|
|
51501
|
-
layout: workspaceSelected.layout
|
|
51502
|
-
};
|
|
51503
|
-
existingPages = [page1];
|
|
51504
|
-
}
|
|
51505
51548
|
var newPage = DashboardModel.createPage("Page ".concat(existingPages.length + 1));
|
|
51506
51549
|
newPage.order = existingPages.length;
|
|
51507
51550
|
var updatedWorkspace = _objectSpread$5(_objectSpread$5({}, workspaceSelected), {}, {
|
|
@@ -51533,17 +51576,6 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
51533
51576
|
});
|
|
51534
51577
|
var newActiveId = currentActivePageId === pageId ? (_updatedPages$ = updatedPages[0]) === null || _updatedPages$ === void 0 ? void 0 : _updatedPages$.id : currentActivePageId;
|
|
51535
51578
|
setActivePageId(newActiveId);
|
|
51536
|
-
|
|
51537
|
-
// If only one page remains, convert back to single-page mode
|
|
51538
|
-
if (updatedPages.length === 1) {
|
|
51539
|
-
handleWorkspaceChange(_objectSpread$5(_objectSpread$5({}, workspaceSelected), {}, {
|
|
51540
|
-
layout: updatedPages[0].layout,
|
|
51541
|
-
pages: [],
|
|
51542
|
-
activePageId: null
|
|
51543
|
-
}));
|
|
51544
|
-
setActivePageId(null);
|
|
51545
|
-
return;
|
|
51546
|
-
}
|
|
51547
51579
|
handleWorkspaceChange(_objectSpread$5(_objectSpread$5({}, workspaceSelected), {}, {
|
|
51548
51580
|
pages: updatedPages,
|
|
51549
51581
|
activePageId: newActiveId
|
|
@@ -51602,45 +51634,28 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
51602
51634
|
function renderComponent(workspaceItem) {
|
|
51603
51635
|
try {
|
|
51604
51636
|
if (workspaceItem === undefined) return null;
|
|
51605
|
-
|
|
51606
|
-
|
|
51607
|
-
|
|
51608
|
-
|
|
51609
|
-
|
|
51610
|
-
|
|
51611
|
-
|
|
51612
|
-
|
|
51613
|
-
|
|
51614
|
-
|
|
51615
|
-
|
|
51616
|
-
|
|
51617
|
-
|
|
51618
|
-
|
|
51619
|
-
|
|
51620
|
-
|
|
51621
|
-
|
|
51622
|
-
|
|
51623
|
-
|
|
51624
|
-
|
|
51625
|
-
|
|
51626
|
-
|
|
51627
|
-
}, page.id);
|
|
51628
|
-
})
|
|
51629
|
-
});
|
|
51630
|
-
}
|
|
51631
|
-
|
|
51632
|
-
// Single-page mode (backward compatible)
|
|
51633
|
-
return /*#__PURE__*/jsxRuntime.jsx(LayoutBuilder, {
|
|
51634
|
-
dashboardId: workspaceItem["id"],
|
|
51635
|
-
preview: previewMode,
|
|
51636
|
-
workspace: workspaceItem,
|
|
51637
|
-
onWorkspaceChange: handleWorkspaceChange,
|
|
51638
|
-
onProviderSelect: handleProviderSelect,
|
|
51639
|
-
onTogglePreview: handleToggleEditMode,
|
|
51640
|
-
editMode: editMode,
|
|
51641
|
-
workspaceRef: currentWorkspaceRef,
|
|
51642
|
-
onWidgetPopout: popout ? null : handleWidgetPopout
|
|
51643
|
-
}, "LayoutBuilder-".concat(workspaceItem["id"]));
|
|
51637
|
+
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
51638
|
+
children: sortedPagesForRender.map(function (page) {
|
|
51639
|
+
var isActive = page.id === currentActivePageId;
|
|
51640
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
51641
|
+
style: {
|
|
51642
|
+
display: isActive ? "flex" : "none"
|
|
51643
|
+
},
|
|
51644
|
+
className: "flex-col w-full flex-1",
|
|
51645
|
+
children: /*#__PURE__*/jsxRuntime.jsx(PageLayoutBuilder, {
|
|
51646
|
+
page: page,
|
|
51647
|
+
workspaceItem: workspaceItem,
|
|
51648
|
+
previewMode: previewMode,
|
|
51649
|
+
editMode: editMode,
|
|
51650
|
+
onPageWorkspaceChange: handlePageWorkspaceChange,
|
|
51651
|
+
onProviderSelect: stableProviderSelect,
|
|
51652
|
+
onTogglePreview: stableTogglePreview,
|
|
51653
|
+
workspaceRef: getPageRef(page.id),
|
|
51654
|
+
onWidgetPopout: stableWidgetPopout
|
|
51655
|
+
})
|
|
51656
|
+
}, page.id);
|
|
51657
|
+
})
|
|
51658
|
+
});
|
|
51644
51659
|
} catch (e) {
|
|
51645
51660
|
return null;
|
|
51646
51661
|
}
|
|
@@ -51734,27 +51749,43 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
51734
51749
|
updateTabWorkspace(tempWorkspace);
|
|
51735
51750
|
}
|
|
51736
51751
|
function handleScrollableChange(enabled) {
|
|
51737
|
-
var _tempWorkspace$layout;
|
|
51738
51752
|
if (!workspaceSelected) return;
|
|
51739
51753
|
var tempWorkspace = DashReact.deepCopy(currentWorkspaceRef.current || workspaceSelected);
|
|
51740
|
-
//
|
|
51741
|
-
|
|
51742
|
-
|
|
51754
|
+
// Update the active page's root layout item
|
|
51755
|
+
tempWorkspace.pages = (tempWorkspace.pages || []).map(function (page) {
|
|
51756
|
+
if (page.id !== currentActivePageId) return page;
|
|
51757
|
+
return _objectSpread$5(_objectSpread$5({}, page), {}, {
|
|
51758
|
+
layout: (page.layout || []).map(function (item) {
|
|
51759
|
+
return item.parent === 0 ? _objectSpread$5(_objectSpread$5({}, item), {}, {
|
|
51760
|
+
scrollable: enabled
|
|
51761
|
+
}) : item;
|
|
51762
|
+
})
|
|
51763
|
+
});
|
|
51743
51764
|
});
|
|
51744
|
-
|
|
51745
|
-
|
|
51765
|
+
// Update page ref immediately so getRootScrollable() reads the new value
|
|
51766
|
+
var pageRef = pageRefsMap.current[currentActivePageId];
|
|
51767
|
+
if (pageRef !== null && pageRef !== void 0 && pageRef.current) {
|
|
51768
|
+
pageRef.current.layout = (pageRef.current.layout || []).map(function (item) {
|
|
51769
|
+
return item.parent === 0 ? _objectSpread$5(_objectSpread$5({}, item), {}, {
|
|
51770
|
+
scrollable: enabled
|
|
51771
|
+
}) : item;
|
|
51772
|
+
});
|
|
51746
51773
|
}
|
|
51747
|
-
// Update ref immediately so getRootScrollable() reads the new value
|
|
51748
|
-
// before LayoutBuilder's async useEffect syncs it
|
|
51749
51774
|
currentWorkspaceRef.current = tempWorkspace;
|
|
51750
51775
|
updateTabWorkspace(tempWorkspace);
|
|
51751
51776
|
}
|
|
51752
51777
|
|
|
51753
|
-
// Derive scrollable state from root layout item
|
|
51778
|
+
// Derive scrollable state from the active page's root layout item
|
|
51754
51779
|
function getRootScrollable() {
|
|
51780
|
+
var _pageRef$current, _ws$pages;
|
|
51755
51781
|
var ws = currentWorkspaceRef.current || workspaceSelected;
|
|
51756
|
-
if (!
|
|
51757
|
-
var
|
|
51782
|
+
if (!ws) return false;
|
|
51783
|
+
var pageRef = pageRefsMap.current[currentActivePageId];
|
|
51784
|
+
var layout = (pageRef === null || pageRef === void 0 || (_pageRef$current = pageRef.current) === null || _pageRef$current === void 0 ? void 0 : _pageRef$current.layout) || ((_ws$pages = ws.pages) === null || _ws$pages === void 0 || (_ws$pages = _ws$pages.find(function (p) {
|
|
51785
|
+
return p.id === currentActivePageId;
|
|
51786
|
+
})) === null || _ws$pages === void 0 ? void 0 : _ws$pages.layout);
|
|
51787
|
+
if (!layout) return false;
|
|
51788
|
+
var rootItem = layout.find(function (item) {
|
|
51758
51789
|
return item.parent === 0;
|
|
51759
51790
|
});
|
|
51760
51791
|
return (rootItem === null || rootItem === void 0 ? void 0 : rootItem.scrollable) || false;
|
|
@@ -51764,48 +51795,27 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
51764
51795
|
var _sidebarWorkspaceRef$;
|
|
51765
51796
|
// we have to remove the widgetConfig which contains the component
|
|
51766
51797
|
// sanitize the workspace layout remove widgetConfig items
|
|
51767
|
-
|
|
51768
|
-
|
|
51769
|
-
|
|
51770
|
-
|
|
51771
|
-
|
|
51772
|
-
|
|
51773
|
-
|
|
51774
|
-
|
|
51775
|
-
|
|
51776
|
-
|
|
51777
|
-
|
|
51778
|
-
|
|
51779
|
-
return copy;
|
|
51780
|
-
})
|
|
51781
|
-
});
|
|
51782
|
-
});
|
|
51783
|
-
workspaceToSave.activePageId = currentActivePageId;
|
|
51784
|
-
// Also sanitize the root layout (may be stale from pre-pages era)
|
|
51785
|
-
workspaceToSave.layout = (workspaceToSave.layout || []).map(function (item) {
|
|
51786
|
-
var copy = _objectSpread$5({}, item);
|
|
51787
|
-
delete copy.widgetConfig;
|
|
51788
|
-
return copy;
|
|
51798
|
+
// Gather latest layout from each page's LayoutBuilder ref
|
|
51799
|
+
var workspaceToSave = DashReact.deepCopy(workspaceSelected);
|
|
51800
|
+
workspaceToSave.pages = (workspaceToSave.pages || []).map(function (page) {
|
|
51801
|
+
var _pageRef$current2;
|
|
51802
|
+
var pageRef = pageRefsMap.current[page.id];
|
|
51803
|
+
var latestLayout = (pageRef === null || pageRef === void 0 || (_pageRef$current2 = pageRef.current) === null || _pageRef$current2 === void 0 ? void 0 : _pageRef$current2.layout) || page.layout || [];
|
|
51804
|
+
return _objectSpread$5(_objectSpread$5({}, page), {}, {
|
|
51805
|
+
layout: latestLayout.map(function (item) {
|
|
51806
|
+
var copy = _objectSpread$5({}, item);
|
|
51807
|
+
delete copy.widgetConfig;
|
|
51808
|
+
return copy;
|
|
51809
|
+
})
|
|
51789
51810
|
});
|
|
51790
|
-
}
|
|
51791
|
-
|
|
51792
|
-
|
|
51793
|
-
|
|
51794
|
-
|
|
51795
|
-
|
|
51796
|
-
|
|
51797
|
-
|
|
51798
|
-
if (refLayout) {
|
|
51799
|
-
workspaceToSave["layout"] = refLayout.map(function (layoutItem) {
|
|
51800
|
-
delete layoutItem["widgetConfig"];
|
|
51801
|
-
return layoutItem;
|
|
51802
|
-
});
|
|
51803
|
-
} else {
|
|
51804
|
-
workspaceToSave["layout"] = (workspaceToSave["layout"] || []).map(function (layoutItem) {
|
|
51805
|
-
delete layoutItem["widgetConfig"];
|
|
51806
|
-
return layoutItem;
|
|
51807
|
-
});
|
|
51808
|
-
}
|
|
51811
|
+
});
|
|
51812
|
+
workspaceToSave.activePageId = currentActivePageId;
|
|
51813
|
+
// Sync root layout from active page for backward compat
|
|
51814
|
+
var activePage = workspaceToSave.pages.find(function (p) {
|
|
51815
|
+
return p.id === currentActivePageId;
|
|
51816
|
+
});
|
|
51817
|
+
if (activePage) {
|
|
51818
|
+
workspaceToSave.layout = activePage.layout;
|
|
51809
51819
|
}
|
|
51810
51820
|
|
|
51811
51821
|
// Gather sidebar layout from its LayoutBuilder ref
|
|
@@ -52055,8 +52065,6 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
52055
52065
|
themes: themes || {},
|
|
52056
52066
|
onFolderChange: popout ? null : handleWorkspaceFolderChange,
|
|
52057
52067
|
onThemeChange: popout ? null : handleWorkspaceThemeChange,
|
|
52058
|
-
scrollableEnabled: getRootScrollable(),
|
|
52059
|
-
onScrollableChange: popout ? null : handleScrollableChange,
|
|
52060
52068
|
sidebarEnabled: sidebarEnabled,
|
|
52061
52069
|
onSidebarChange: popout ? null : handleSidebarToggle
|
|
52062
52070
|
}), /*#__PURE__*/jsxRuntime.jsxs(DashboardThemeProvider, {
|
|
@@ -52089,7 +52097,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
52089
52097
|
className: "h-3 w-3"
|
|
52090
52098
|
})
|
|
52091
52099
|
})]
|
|
52092
|
-
}),
|
|
52100
|
+
}), /*#__PURE__*/jsxRuntime.jsx(PageTabBar, {
|
|
52093
52101
|
pages: workspacePages,
|
|
52094
52102
|
activePageId: currentActivePageId,
|
|
52095
52103
|
onSwitchPage: handleSwitchPage,
|
|
@@ -52097,7 +52105,9 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
52097
52105
|
onRenamePage: handleRenamePage,
|
|
52098
52106
|
onDeletePage: handleDeletePage,
|
|
52099
52107
|
onReorderPages: handleReorderPages,
|
|
52100
|
-
editMode: !previewMode
|
|
52108
|
+
editMode: !previewMode,
|
|
52109
|
+
scrollableEnabled: getRootScrollable(),
|
|
52110
|
+
onScrollableChange: popout ? null : handleScrollableChange
|
|
52101
52111
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
52102
52112
|
className: "flex flex-row flex-1 min-h-0 overflow-hidden",
|
|
52103
52113
|
children: [sidebarEnabled && !popout && /*#__PURE__*/jsxRuntime.jsx(PinnedSidebar, {
|
|
@@ -54913,6 +54923,7 @@ exports.DashNavbar = DashNavbar;
|
|
|
54913
54923
|
exports.DashSidebar = DashSidebar;
|
|
54914
54924
|
exports.DashTabBar = DashTabBar;
|
|
54915
54925
|
exports.Dashboard = DashboardStage;
|
|
54926
|
+
exports.DashboardActionsApi = DashboardActionsApi;
|
|
54916
54927
|
exports.DashboardApi = DashboardApi;
|
|
54917
54928
|
exports.DashboardContext = DashboardContext;
|
|
54918
54929
|
exports.DashboardFooter = DashboardFooter;
|