@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.esm.js
CHANGED
|
@@ -588,6 +588,30 @@ var DashboardApi = {
|
|
|
588
588
|
}
|
|
589
589
|
};
|
|
590
590
|
|
|
591
|
+
/**
|
|
592
|
+
* DashboardActionsApi
|
|
593
|
+
*
|
|
594
|
+
* Provides programmatic control over dashboard-level actions.
|
|
595
|
+
* Widgets can call these methods directly (not via events) to
|
|
596
|
+
* control the dashboard they are rendered in.
|
|
597
|
+
*
|
|
598
|
+
* Internally dispatches CustomEvents on `window` so the API
|
|
599
|
+
* stays decoupled from the React component tree.
|
|
600
|
+
*/
|
|
601
|
+
var DashboardActionsApi = {
|
|
602
|
+
/**
|
|
603
|
+
* Switch the active page in the current dashboard.
|
|
604
|
+
* @param {string} pageId - The ID of the page to switch to
|
|
605
|
+
*/
|
|
606
|
+
switchPage: function switchPage(pageId) {
|
|
607
|
+
window.dispatchEvent(new CustomEvent("dash:switch-page", {
|
|
608
|
+
detail: {
|
|
609
|
+
pageId: pageId
|
|
610
|
+
}
|
|
611
|
+
}));
|
|
612
|
+
}
|
|
613
|
+
};
|
|
614
|
+
|
|
591
615
|
var SECURE_STORE_ENCRYPTION_CHECK = "secure-storage-encryption-check";
|
|
592
616
|
var SECURE_STORE_ENCRYPTION_CHECK_COMPLETE = "secure-storage-encryption-check-complete";
|
|
593
617
|
var SECURE_STORE_ENCRYPTION_CHECK_ERROR = "secure-storage-encryption-check-error";
|
|
@@ -1877,6 +1901,7 @@ var DashboardContext = /*#__PURE__*/createContext({
|
|
|
1877
1901
|
pub: DashboardPublisher,
|
|
1878
1902
|
widgetApi: buildWidgetApi(),
|
|
1879
1903
|
dashApi: null,
|
|
1904
|
+
dashboardApi: DashboardActionsApi,
|
|
1880
1905
|
providers: {}
|
|
1881
1906
|
});
|
|
1882
1907
|
|
|
@@ -2605,6 +2630,7 @@ var DashboardWrapper = function DashboardWrapper(_ref) {
|
|
|
2605
2630
|
widgetApi: widgetApi,
|
|
2606
2631
|
pub: DashboardPublisher,
|
|
2607
2632
|
dashApi: dashApi,
|
|
2633
|
+
dashboardApi: DashboardActionsApi,
|
|
2608
2634
|
credentials: credentials,
|
|
2609
2635
|
providers: providers
|
|
2610
2636
|
};
|
|
@@ -23907,7 +23933,8 @@ var WidgetRenderer = function WidgetRenderer(_ref) {
|
|
|
23907
23933
|
publishEvent: function publishEvent(eventName, payload) {
|
|
23908
23934
|
return helpers.publishEvent(eventName, payload);
|
|
23909
23935
|
},
|
|
23910
|
-
api: w
|
|
23936
|
+
api: w,
|
|
23937
|
+
dashboardApi: DashboardActionsApi
|
|
23911
23938
|
}, params), userPrefs), {}, {
|
|
23912
23939
|
backgroundColor: bgColor,
|
|
23913
23940
|
widgetConfig: helpers.config(),
|
|
@@ -23920,6 +23947,7 @@ var WidgetRenderer = function WidgetRenderer(_ref) {
|
|
|
23920
23947
|
return helpers.publishEvent(eventName, payload);
|
|
23921
23948
|
},
|
|
23922
23949
|
api: w,
|
|
23950
|
+
dashboardApi: DashboardActionsApi,
|
|
23923
23951
|
id: "widget-kids-".concat(widgetKey)
|
|
23924
23952
|
}, params), userPrefs), {}, {
|
|
23925
23953
|
backgroundColor: bgColor,
|
|
@@ -27591,15 +27619,22 @@ var DashboardModel = /*#__PURE__*/function () {
|
|
|
27591
27619
|
this.sidebarLayout = "sidebarLayout" in obj ? obj.sidebarLayout : [];
|
|
27592
27620
|
this.sidebarWidth = "sidebarWidth" in obj ? obj.sidebarWidth : 280;
|
|
27593
27621
|
|
|
27594
|
-
// Multi-page support:
|
|
27622
|
+
// Multi-page support: every workspace always has at least one page.
|
|
27623
|
+
// Existing multi-page workspaces load as-is; single-page workspaces
|
|
27624
|
+
// are auto-migrated by wrapping their layout into a page.
|
|
27595
27625
|
if ("pages" in obj && Array.isArray(obj.pages) && obj.pages.length > 0) {
|
|
27596
27626
|
this.pages = obj.pages;
|
|
27597
27627
|
this.activePageId = obj.activePageId || obj.pages[0].id;
|
|
27598
27628
|
} else {
|
|
27599
|
-
//
|
|
27600
|
-
|
|
27601
|
-
|
|
27602
|
-
|
|
27629
|
+
// Auto-migrate: wrap existing layout into a single page
|
|
27630
|
+
var page = {
|
|
27631
|
+
id: "page-".concat(this.id || Date.now()),
|
|
27632
|
+
name: this.name || "Page 1",
|
|
27633
|
+
order: 0,
|
|
27634
|
+
layout: this.layout
|
|
27635
|
+
};
|
|
27636
|
+
this.pages = [page];
|
|
27637
|
+
this.activePageId = page.id;
|
|
27603
27638
|
}
|
|
27604
27639
|
obj = null;
|
|
27605
27640
|
|
|
@@ -27612,12 +27647,12 @@ var DashboardModel = /*#__PURE__*/function () {
|
|
|
27612
27647
|
_step;
|
|
27613
27648
|
try {
|
|
27614
27649
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
27615
|
-
var
|
|
27616
|
-
if (
|
|
27650
|
+
var _page = _step.value;
|
|
27651
|
+
if (_page.layout) {
|
|
27617
27652
|
var saved = this.layout;
|
|
27618
|
-
this.layout =
|
|
27653
|
+
this.layout = _page.layout;
|
|
27619
27654
|
this._normalizeAllGrids();
|
|
27620
|
-
|
|
27655
|
+
_page.layout = this.layout;
|
|
27621
27656
|
this.layout = saved;
|
|
27622
27657
|
}
|
|
27623
27658
|
}
|
|
@@ -27691,10 +27726,8 @@ var DashboardModel = /*#__PURE__*/function () {
|
|
|
27691
27726
|
themeKey: this.themeKey,
|
|
27692
27727
|
selectedProviders: this.selectedProviders
|
|
27693
27728
|
};
|
|
27694
|
-
|
|
27695
|
-
|
|
27696
|
-
ws.activePageId = this.activePageId;
|
|
27697
|
-
}
|
|
27729
|
+
ws.pages = this.pages;
|
|
27730
|
+
ws.activePageId = this.activePageId;
|
|
27698
27731
|
if (this.sidebarEnabled || ((_this$sidebarLayout = this.sidebarLayout) === null || _this$sidebarLayout === void 0 ? void 0 : _this$sidebarLayout.length) > 0) {
|
|
27699
27732
|
ws.sidebarEnabled = this.sidebarEnabled;
|
|
27700
27733
|
ws.sidebarLayout = this.sidebarLayout;
|
|
@@ -48786,7 +48819,11 @@ var PageTabBar = function PageTabBar(_ref) {
|
|
|
48786
48819
|
_ref$onReorderPages = _ref.onReorderPages,
|
|
48787
48820
|
onReorderPages = _ref$onReorderPages === void 0 ? null : _ref$onReorderPages,
|
|
48788
48821
|
_ref$editMode = _ref.editMode,
|
|
48789
|
-
editMode = _ref$editMode === void 0 ? false : _ref$editMode
|
|
48822
|
+
editMode = _ref$editMode === void 0 ? false : _ref$editMode,
|
|
48823
|
+
_ref$scrollableEnable = _ref.scrollableEnabled,
|
|
48824
|
+
scrollableEnabled = _ref$scrollableEnable === void 0 ? false : _ref$scrollableEnable,
|
|
48825
|
+
_ref$onScrollableChan = _ref.onScrollableChange,
|
|
48826
|
+
onScrollableChange = _ref$onScrollableChan === void 0 ? null : _ref$onScrollableChan;
|
|
48790
48827
|
var _useContext = useContext(ThemeContext),
|
|
48791
48828
|
currentTheme = _useContext.currentTheme;
|
|
48792
48829
|
var _useState = useState(null),
|
|
@@ -48939,6 +48976,13 @@ var PageTabBar = function PageTabBar(_ref) {
|
|
|
48939
48976
|
}), /*#__PURE__*/jsx("span", {
|
|
48940
48977
|
children: "Add Page"
|
|
48941
48978
|
})]
|
|
48979
|
+
}), editMode && onScrollableChange && /*#__PURE__*/jsx("div", {
|
|
48980
|
+
className: "ml-auto flex items-center shrink-0",
|
|
48981
|
+
children: /*#__PURE__*/jsx(Toggle, {
|
|
48982
|
+
text: "Scrollable",
|
|
48983
|
+
enabled: scrollableEnabled,
|
|
48984
|
+
setEnabled: onScrollableChange
|
|
48985
|
+
})
|
|
48942
48986
|
})]
|
|
48943
48987
|
});
|
|
48944
48988
|
};
|
|
@@ -51452,38 +51496,37 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
51452
51496
|
_useState48 = _slicedToArray(_useState47, 2),
|
|
51453
51497
|
activePageId = _useState48[0],
|
|
51454
51498
|
setActivePageId = _useState48[1];
|
|
51499
|
+
|
|
51500
|
+
// Listen for programmatic page switches via DashboardActionsApi
|
|
51501
|
+
useEffect(function () {
|
|
51502
|
+
function onSwitchPage(e) {
|
|
51503
|
+
var _ref4 = e.detail || {},
|
|
51504
|
+
pageId = _ref4.pageId;
|
|
51505
|
+
if (pageId) setActivePageId(pageId);
|
|
51506
|
+
}
|
|
51507
|
+
window.addEventListener("dash:switch-page", onSwitchPage);
|
|
51508
|
+
return function () {
|
|
51509
|
+
return window.removeEventListener("dash:switch-page", onSwitchPage);
|
|
51510
|
+
};
|
|
51511
|
+
}, []);
|
|
51455
51512
|
var workspacePages = (workspaceSelected === null || workspaceSelected === void 0 ? void 0 : workspaceSelected.pages) || [];
|
|
51456
|
-
var hasPages = workspacePages.length > 0;
|
|
51457
51513
|
|
|
51458
51514
|
// Memoize sorted pages so page object references stay stable across re-renders
|
|
51459
51515
|
var sortedPagesForRender = useMemo(function () {
|
|
51460
|
-
return
|
|
51516
|
+
return _toConsumableArray(workspacePages).sort(function (a, b) {
|
|
51461
51517
|
return (a.order || 0) - (b.order || 0);
|
|
51462
|
-
})
|
|
51518
|
+
});
|
|
51463
51519
|
},
|
|
51464
51520
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
51465
|
-
[
|
|
51521
|
+
[workspacePages.length,
|
|
51466
51522
|
// Re-sort when page names/order change but not on every parent render
|
|
51467
51523
|
workspacePages.map(function (p) {
|
|
51468
51524
|
return "".concat(p.id, ":").concat(p.order, ":").concat(p.name);
|
|
51469
51525
|
}).join(",")]);
|
|
51470
51526
|
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);
|
|
51471
51527
|
function handleAddPage() {
|
|
51472
|
-
var _workspaceSelected$la;
|
|
51473
51528
|
if (!workspaceSelected) return;
|
|
51474
51529
|
var existingPages = _toConsumableArray(workspacePages);
|
|
51475
|
-
|
|
51476
|
-
// If this is the first time adding a page to a single-page dashboard,
|
|
51477
|
-
// migrate the existing layout into page 1 first.
|
|
51478
|
-
if (existingPages.length === 0 && ((_workspaceSelected$la = workspaceSelected.layout) === null || _workspaceSelected$la === void 0 ? void 0 : _workspaceSelected$la.length) > 0) {
|
|
51479
|
-
var page1 = {
|
|
51480
|
-
id: "page-".concat(Date.now() - 1),
|
|
51481
|
-
name: workspaceSelected.name || "Page 1",
|
|
51482
|
-
order: 0,
|
|
51483
|
-
layout: workspaceSelected.layout
|
|
51484
|
-
};
|
|
51485
|
-
existingPages = [page1];
|
|
51486
|
-
}
|
|
51487
51530
|
var newPage = DashboardModel.createPage("Page ".concat(existingPages.length + 1));
|
|
51488
51531
|
newPage.order = existingPages.length;
|
|
51489
51532
|
var updatedWorkspace = _objectSpread$5(_objectSpread$5({}, workspaceSelected), {}, {
|
|
@@ -51515,17 +51558,6 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
51515
51558
|
});
|
|
51516
51559
|
var newActiveId = currentActivePageId === pageId ? (_updatedPages$ = updatedPages[0]) === null || _updatedPages$ === void 0 ? void 0 : _updatedPages$.id : currentActivePageId;
|
|
51517
51560
|
setActivePageId(newActiveId);
|
|
51518
|
-
|
|
51519
|
-
// If only one page remains, convert back to single-page mode
|
|
51520
|
-
if (updatedPages.length === 1) {
|
|
51521
|
-
handleWorkspaceChange(_objectSpread$5(_objectSpread$5({}, workspaceSelected), {}, {
|
|
51522
|
-
layout: updatedPages[0].layout,
|
|
51523
|
-
pages: [],
|
|
51524
|
-
activePageId: null
|
|
51525
|
-
}));
|
|
51526
|
-
setActivePageId(null);
|
|
51527
|
-
return;
|
|
51528
|
-
}
|
|
51529
51561
|
handleWorkspaceChange(_objectSpread$5(_objectSpread$5({}, workspaceSelected), {}, {
|
|
51530
51562
|
pages: updatedPages,
|
|
51531
51563
|
activePageId: newActiveId
|
|
@@ -51584,45 +51616,28 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
51584
51616
|
function renderComponent(workspaceItem) {
|
|
51585
51617
|
try {
|
|
51586
51618
|
if (workspaceItem === undefined) return null;
|
|
51587
|
-
|
|
51588
|
-
|
|
51589
|
-
|
|
51590
|
-
|
|
51591
|
-
|
|
51592
|
-
|
|
51593
|
-
|
|
51594
|
-
|
|
51595
|
-
|
|
51596
|
-
|
|
51597
|
-
|
|
51598
|
-
|
|
51599
|
-
|
|
51600
|
-
|
|
51601
|
-
|
|
51602
|
-
|
|
51603
|
-
|
|
51604
|
-
|
|
51605
|
-
|
|
51606
|
-
|
|
51607
|
-
|
|
51608
|
-
|
|
51609
|
-
}, page.id);
|
|
51610
|
-
})
|
|
51611
|
-
});
|
|
51612
|
-
}
|
|
51613
|
-
|
|
51614
|
-
// Single-page mode (backward compatible)
|
|
51615
|
-
return /*#__PURE__*/jsx(LayoutBuilder, {
|
|
51616
|
-
dashboardId: workspaceItem["id"],
|
|
51617
|
-
preview: previewMode,
|
|
51618
|
-
workspace: workspaceItem,
|
|
51619
|
-
onWorkspaceChange: handleWorkspaceChange,
|
|
51620
|
-
onProviderSelect: handleProviderSelect,
|
|
51621
|
-
onTogglePreview: handleToggleEditMode,
|
|
51622
|
-
editMode: editMode,
|
|
51623
|
-
workspaceRef: currentWorkspaceRef,
|
|
51624
|
-
onWidgetPopout: popout ? null : handleWidgetPopout
|
|
51625
|
-
}, "LayoutBuilder-".concat(workspaceItem["id"]));
|
|
51619
|
+
return /*#__PURE__*/jsx(Fragment, {
|
|
51620
|
+
children: sortedPagesForRender.map(function (page) {
|
|
51621
|
+
var isActive = page.id === currentActivePageId;
|
|
51622
|
+
return /*#__PURE__*/jsx("div", {
|
|
51623
|
+
style: {
|
|
51624
|
+
display: isActive ? "flex" : "none"
|
|
51625
|
+
},
|
|
51626
|
+
className: "flex-col w-full flex-1",
|
|
51627
|
+
children: /*#__PURE__*/jsx(PageLayoutBuilder, {
|
|
51628
|
+
page: page,
|
|
51629
|
+
workspaceItem: workspaceItem,
|
|
51630
|
+
previewMode: previewMode,
|
|
51631
|
+
editMode: editMode,
|
|
51632
|
+
onPageWorkspaceChange: handlePageWorkspaceChange,
|
|
51633
|
+
onProviderSelect: stableProviderSelect,
|
|
51634
|
+
onTogglePreview: stableTogglePreview,
|
|
51635
|
+
workspaceRef: getPageRef(page.id),
|
|
51636
|
+
onWidgetPopout: stableWidgetPopout
|
|
51637
|
+
})
|
|
51638
|
+
}, page.id);
|
|
51639
|
+
})
|
|
51640
|
+
});
|
|
51626
51641
|
} catch (e) {
|
|
51627
51642
|
return null;
|
|
51628
51643
|
}
|
|
@@ -51716,27 +51731,43 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
51716
51731
|
updateTabWorkspace(tempWorkspace);
|
|
51717
51732
|
}
|
|
51718
51733
|
function handleScrollableChange(enabled) {
|
|
51719
|
-
var _tempWorkspace$layout;
|
|
51720
51734
|
if (!workspaceSelected) return;
|
|
51721
51735
|
var tempWorkspace = deepCopy(currentWorkspaceRef.current || workspaceSelected);
|
|
51722
|
-
//
|
|
51723
|
-
|
|
51724
|
-
|
|
51736
|
+
// Update the active page's root layout item
|
|
51737
|
+
tempWorkspace.pages = (tempWorkspace.pages || []).map(function (page) {
|
|
51738
|
+
if (page.id !== currentActivePageId) return page;
|
|
51739
|
+
return _objectSpread$5(_objectSpread$5({}, page), {}, {
|
|
51740
|
+
layout: (page.layout || []).map(function (item) {
|
|
51741
|
+
return item.parent === 0 ? _objectSpread$5(_objectSpread$5({}, item), {}, {
|
|
51742
|
+
scrollable: enabled
|
|
51743
|
+
}) : item;
|
|
51744
|
+
})
|
|
51745
|
+
});
|
|
51725
51746
|
});
|
|
51726
|
-
|
|
51727
|
-
|
|
51747
|
+
// Update page ref immediately so getRootScrollable() reads the new value
|
|
51748
|
+
var pageRef = pageRefsMap.current[currentActivePageId];
|
|
51749
|
+
if (pageRef !== null && pageRef !== void 0 && pageRef.current) {
|
|
51750
|
+
pageRef.current.layout = (pageRef.current.layout || []).map(function (item) {
|
|
51751
|
+
return item.parent === 0 ? _objectSpread$5(_objectSpread$5({}, item), {}, {
|
|
51752
|
+
scrollable: enabled
|
|
51753
|
+
}) : item;
|
|
51754
|
+
});
|
|
51728
51755
|
}
|
|
51729
|
-
// Update ref immediately so getRootScrollable() reads the new value
|
|
51730
|
-
// before LayoutBuilder's async useEffect syncs it
|
|
51731
51756
|
currentWorkspaceRef.current = tempWorkspace;
|
|
51732
51757
|
updateTabWorkspace(tempWorkspace);
|
|
51733
51758
|
}
|
|
51734
51759
|
|
|
51735
|
-
// Derive scrollable state from root layout item
|
|
51760
|
+
// Derive scrollable state from the active page's root layout item
|
|
51736
51761
|
function getRootScrollable() {
|
|
51762
|
+
var _pageRef$current, _ws$pages;
|
|
51737
51763
|
var ws = currentWorkspaceRef.current || workspaceSelected;
|
|
51738
|
-
if (!
|
|
51739
|
-
var
|
|
51764
|
+
if (!ws) return false;
|
|
51765
|
+
var pageRef = pageRefsMap.current[currentActivePageId];
|
|
51766
|
+
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) {
|
|
51767
|
+
return p.id === currentActivePageId;
|
|
51768
|
+
})) === null || _ws$pages === void 0 ? void 0 : _ws$pages.layout);
|
|
51769
|
+
if (!layout) return false;
|
|
51770
|
+
var rootItem = layout.find(function (item) {
|
|
51740
51771
|
return item.parent === 0;
|
|
51741
51772
|
});
|
|
51742
51773
|
return (rootItem === null || rootItem === void 0 ? void 0 : rootItem.scrollable) || false;
|
|
@@ -51746,48 +51777,27 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
51746
51777
|
var _sidebarWorkspaceRef$;
|
|
51747
51778
|
// we have to remove the widgetConfig which contains the component
|
|
51748
51779
|
// sanitize the workspace layout remove widgetConfig items
|
|
51749
|
-
|
|
51750
|
-
|
|
51751
|
-
|
|
51752
|
-
|
|
51753
|
-
|
|
51754
|
-
|
|
51755
|
-
|
|
51756
|
-
|
|
51757
|
-
|
|
51758
|
-
|
|
51759
|
-
|
|
51760
|
-
|
|
51761
|
-
return copy;
|
|
51762
|
-
})
|
|
51763
|
-
});
|
|
51764
|
-
});
|
|
51765
|
-
workspaceToSave.activePageId = currentActivePageId;
|
|
51766
|
-
// Also sanitize the root layout (may be stale from pre-pages era)
|
|
51767
|
-
workspaceToSave.layout = (workspaceToSave.layout || []).map(function (item) {
|
|
51768
|
-
var copy = _objectSpread$5({}, item);
|
|
51769
|
-
delete copy.widgetConfig;
|
|
51770
|
-
return copy;
|
|
51780
|
+
// Gather latest layout from each page's LayoutBuilder ref
|
|
51781
|
+
var workspaceToSave = deepCopy(workspaceSelected);
|
|
51782
|
+
workspaceToSave.pages = (workspaceToSave.pages || []).map(function (page) {
|
|
51783
|
+
var _pageRef$current2;
|
|
51784
|
+
var pageRef = pageRefsMap.current[page.id];
|
|
51785
|
+
var latestLayout = (pageRef === null || pageRef === void 0 || (_pageRef$current2 = pageRef.current) === null || _pageRef$current2 === void 0 ? void 0 : _pageRef$current2.layout) || page.layout || [];
|
|
51786
|
+
return _objectSpread$5(_objectSpread$5({}, page), {}, {
|
|
51787
|
+
layout: latestLayout.map(function (item) {
|
|
51788
|
+
var copy = _objectSpread$5({}, item);
|
|
51789
|
+
delete copy.widgetConfig;
|
|
51790
|
+
return copy;
|
|
51791
|
+
})
|
|
51771
51792
|
});
|
|
51772
|
-
}
|
|
51773
|
-
|
|
51774
|
-
|
|
51775
|
-
|
|
51776
|
-
|
|
51777
|
-
|
|
51778
|
-
|
|
51779
|
-
|
|
51780
|
-
if (refLayout) {
|
|
51781
|
-
workspaceToSave["layout"] = refLayout.map(function (layoutItem) {
|
|
51782
|
-
delete layoutItem["widgetConfig"];
|
|
51783
|
-
return layoutItem;
|
|
51784
|
-
});
|
|
51785
|
-
} else {
|
|
51786
|
-
workspaceToSave["layout"] = (workspaceToSave["layout"] || []).map(function (layoutItem) {
|
|
51787
|
-
delete layoutItem["widgetConfig"];
|
|
51788
|
-
return layoutItem;
|
|
51789
|
-
});
|
|
51790
|
-
}
|
|
51793
|
+
});
|
|
51794
|
+
workspaceToSave.activePageId = currentActivePageId;
|
|
51795
|
+
// Sync root layout from active page for backward compat
|
|
51796
|
+
var activePage = workspaceToSave.pages.find(function (p) {
|
|
51797
|
+
return p.id === currentActivePageId;
|
|
51798
|
+
});
|
|
51799
|
+
if (activePage) {
|
|
51800
|
+
workspaceToSave.layout = activePage.layout;
|
|
51791
51801
|
}
|
|
51792
51802
|
|
|
51793
51803
|
// Gather sidebar layout from its LayoutBuilder ref
|
|
@@ -52037,8 +52047,6 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
52037
52047
|
themes: themes || {},
|
|
52038
52048
|
onFolderChange: popout ? null : handleWorkspaceFolderChange,
|
|
52039
52049
|
onThemeChange: popout ? null : handleWorkspaceThemeChange,
|
|
52040
|
-
scrollableEnabled: getRootScrollable(),
|
|
52041
|
-
onScrollableChange: popout ? null : handleScrollableChange,
|
|
52042
52050
|
sidebarEnabled: sidebarEnabled,
|
|
52043
52051
|
onSidebarChange: popout ? null : handleSidebarToggle
|
|
52044
52052
|
}), /*#__PURE__*/jsxs(DashboardThemeProvider, {
|
|
@@ -52071,7 +52079,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
52071
52079
|
className: "h-3 w-3"
|
|
52072
52080
|
})
|
|
52073
52081
|
})]
|
|
52074
|
-
}),
|
|
52082
|
+
}), /*#__PURE__*/jsx(PageTabBar, {
|
|
52075
52083
|
pages: workspacePages,
|
|
52076
52084
|
activePageId: currentActivePageId,
|
|
52077
52085
|
onSwitchPage: handleSwitchPage,
|
|
@@ -52079,7 +52087,9 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
52079
52087
|
onRenamePage: handleRenamePage,
|
|
52080
52088
|
onDeletePage: handleDeletePage,
|
|
52081
52089
|
onReorderPages: handleReorderPages,
|
|
52082
|
-
editMode: !previewMode
|
|
52090
|
+
editMode: !previewMode,
|
|
52091
|
+
scrollableEnabled: getRootScrollable(),
|
|
52092
|
+
onScrollableChange: popout ? null : handleScrollableChange
|
|
52083
52093
|
}), /*#__PURE__*/jsxs("div", {
|
|
52084
52094
|
className: "flex flex-row flex-1 min-h-0 overflow-hidden",
|
|
52085
52095
|
children: [sidebarEnabled && !popout && /*#__PURE__*/jsx(PinnedSidebar, {
|
|
@@ -54851,5 +54861,5 @@ function ChatCore(_ref) {
|
|
|
54851
54861
|
|
|
54852
54862
|
ComponentManager.registerContainerTypes(LayoutContainer, LayoutGridContainer);
|
|
54853
54863
|
|
|
54854
|
-
export { ALGOLIA_ANALYTICS_FOR_QUERY, ALGOLIA_ANALYTICS_FOR_QUERY_COMPLETE, ALGOLIA_ANALYTICS_FOR_QUERY_ERROR, ALGOLIA_LIST_INDICES, ALGOLIA_LIST_INDICES_COMPLETE, ALGOLIA_LIST_INDICES_ERROR, AVAILABLE_COLORS, AddMenuItemModal, AdvancedMcpConfig, AppContext, AppSettingsModal, AppThemeScope, AppWrapper, CHOOSE_FILE, CHOOSE_FILE_COMPLETE, CHOOSE_FILE_ERROR, ChatCore, ChatInput, ChatMessages, ColorModel, ComponentConfigModel, ComponentManager, ContextModel, DATA_JSON_TO_CSV_FILE, DATA_JSON_TO_CSV_FILE_COMPLETE, DATA_JSON_TO_CSV_FILE_ERROR, DATA_JSON_TO_CSV_STRING, DATA_JSON_TO_CSV_STRING_COMPLETE, DATA_JSON_TO_CSV_STRING_ERROR, DATA_READ_FROM_FILE, DATA_READ_FROM_FILE_COMPLETE, DATA_READ_FROM_FILE_ERROR, DATA_SAVE_TO_FILE, DATA_SAVE_TO_FILE_COMPLETE, DATA_SAVE_TO_FILE_ERROR, DashCommandPalette, DashNavbar, DashSidebar, DashTabBar, DashboardStage as Dashboard, DashboardApi, DashboardContext, DashboardFooter, DashboardHeader, DashboardMenuItem, DashboardModel, DashboardMonitor, DashboardPublisher, DashboardStage, DashboardThemeProvider, DashboardWizardModal, DashboardWrapper, ElectronDashboardApi, ErrorBoundary, ExternalWidget, GRID_CELL_WIDGET_TYPE, HARMONY_STRATEGIES, LAYOUT_LIST, LAYOUT_LIST_COMPLETE, LAYOUT_LIST_ERROR, LAYOUT_SAVE, LAYOUT_SAVE_COMPLETE, LAYOUT_SAVE_ERROR, Layout, LayoutBuilder, LayoutBuilderAddItemModal, LayoutBuilderConfigContainerMenuItem, LayoutBuilderConfigMenuItem, LayoutBuilderConfigModal, LayoutBuilderEditItemModal, LayoutBuilderEventModal, LayoutBuilderGridItem, LayoutContainer, LayoutDragBuilder, LayoutDragBuilderEdit, LayoutGridContainer, LayoutManagerModal, LayoutModel, LayoutQuickAddMenu, MCP_CALL_TOOL_COMPLETE, MCP_CALL_TOOL_ERROR, MCP_GET_CATALOG_COMPLETE, MCP_GET_CATALOG_ERROR, MCP_LIST_RESOURCES_COMPLETE, MCP_LIST_RESOURCES_ERROR, MCP_LIST_TOOLS_COMPLETE, MCP_LIST_TOOLS_ERROR, MCP_READ_RESOURCE_COMPLETE, MCP_READ_RESOURCE_ERROR, MCP_RUN_AUTH_COMPLETE, MCP_RUN_AUTH_ERROR, MCP_SERVER_STATUS_COMPLETE, MCP_SERVER_STATUS_ERROR, MCP_START_SERVER_COMPLETE, MCP_START_SERVER_ERROR, MCP_STOP_SERVER_COMPLETE, MCP_STOP_SERVER_ERROR, MENU_ITEMS_DELETE, MENU_ITEMS_DELETE_COMPLETE, MENU_ITEMS_DELETE_ERROR, MENU_ITEMS_LIST, MENU_ITEMS_LIST_COMPLETE, MENU_ITEMS_LIST_ERROR, MENU_ITEMS_SAVE, MENU_ITEMS_SAVE_COMPLETE, MENU_ITEMS_SAVE_ERROR, MainMenu, MainMenuItem, MainMenuSection, McpServerPicker, MenuItemModel, MenuSlideOverlay, MergeCellsModal, MessageBubble, MissingProviderPrompt, MockDashboardApi, PROVIDER_DELETE_COMPLETE, PROVIDER_DELETE_ERROR, PROVIDER_GET_COMPLETE, PROVIDER_GET_ERROR, PROVIDER_LIST_COMPLETE, PROVIDER_LIST_ERROR, PROVIDER_SAVE_COMPLETE, PROVIDER_SAVE_ERROR, PageTabBar, PanelCode, PanelEditItem, PanelEditItemHandlers, PanelEditItemNotifications, PinnedSidebar, ProviderContext, ProviderErrorBoundary, ProviderForm, ProviderSelector, SECURE_STORAGE_ENCRYPT_STRING, SECURE_STORAGE_ENCRYPT_STRING_COMPLETE, SECURE_STORAGE_ENCRYPT_STRING_ERROR, SECURE_STORE_ENCRYPTION_CHECK, SECURE_STORE_ENCRYPTION_CHECK_COMPLETE, SECURE_STORE_ENCRYPTION_CHECK_ERROR, SECURE_STORE_GET_DATA, SECURE_STORE_GET_DATA_COMPLETE, SECURE_STORE_GET_DATA_ERROR, SECURE_STORE_SET_DATA, SECURE_STORE_SET_DATA_COMPLETE, SECURE_STORE_SET_DATA_ERROR, SETTINGS_GET, SETTINGS_GET_COMPLETE, SETTINGS_GET_ERROR, SETTINGS_SAVE, SETTINGS_SAVE_COMPLETE, SETTINGS_SAVE_ERROR, SIDEBAR_WIDGET_TYPE, SettingsModel, SideMenu, SplitCellModal, StreamingText, THEME_DELETE, THEME_DELETE_COMPLETE, THEME_DELETE_ERROR, THEME_EXTRACT_FROM_URL, THEME_EXTRACT_FROM_URL_COMPLETE, THEME_EXTRACT_FROM_URL_ERROR, THEME_LIST, THEME_LIST_COMPLETE, THEME_LIST_ERROR, THEME_MAP_PALETTE, THEME_MAP_PALETTE_COMPLETE, THEME_MAP_PALETTE_ERROR, THEME_SAVE, THEME_SAVE_COMPLETE, THEME_SAVE_ERROR, ThemeApi, ThemeColorDots, ThemeManagerModal, ThemeModel, ThemeWrapper, ToolCallBlock, ToolSelector, WELCOME_STORAGE_KEY, WORKSPACE_DELETE, WORKSPACE_DELETE_COMPLETE, WORKSPACE_DELETE_ERROR, WORKSPACE_LIST, WORKSPACE_LIST_COMPLETE, WORKSPACE_LIST_ERROR, WORKSPACE_SAVE, WORKSPACE_SAVE_COMPLETE, WORKSPACE_SAVE_ERROR, WebDashboardApi, WelcomePrompt, Widget, WidgetApi, WidgetConfigPanel, WidgetContext, WidgetFactory, WidgetNotFound, WidgetPopoutStage, WidgetProviderWrapper, WidgetSidebar, WizardCustomizeStep, WizardDiscoverStep, Workspace, WorkspaceContext, WorkspaceFooter, WorkspaceMenu, WorkspaceModel, addChildToLayoutItem, addItemToItemLayout, buildMcpConfigFromOverrides, canHaveChildren, changeDirectionForLayoutItem, createProviderRegistry, deriveFormFields, envMappingToRows, evaluateBundle, extractWidgetConfigs, formStateToMcpJson, formatFieldName, generateCustomTheme, generateHarmonyTheme, generateRandomTheme, generateThemeName, getBorderStyle, getChildrenForLayoutItem, getComponentInLayout, getContainerBorderColor, getContainerColor, getIndexOfLayoutChildrenForItem, getIndexOfLayoutItem, getLayoutItemById, getLayoutItemForWorkspace, getNearestParentWorkspace, getNextHighestId, getNextHighestItemInLayout, getNextHighestOrder, getNextHighestParentId, getNextLowestItemInLayout, getParentForLayoutItem, getParentWorkspaceForItem, getThemePresets, getUserConfigurableProviders, getWidgetsForWorkspace, getWorkspacesForWorkspace, headerTemplateToRows, isContainer, isLikelySecret, isMaxOrderForItem, isMinOrderForItem, isWidget, isWidgetResolvable, isWorkspace, layoutItemHasWorkspaceAsChild, loadWidgetBundle, mcpJsonToFormState, numChildrenForLayout, removeItemFromLayout, renderComponent, renderGridLayout, renderGridLayoutFlow, _renderLayout as renderLayout, renderLayoutMenu, replaceItemInLayout, resolveIcon, setHostModules, traverseParentTree, updateLayoutItem, updateParentForItem, useDashboard, useMcpDashServer, useMcpProvider, useNotifications, useProvider, useProviderClient, useScheduler, useWebSocketProvider, useWidgetEvents, useWidgetProviders, useWidgetSchedulerStatus, useWizardState, validateCellMerge, validateGridCell, validateGridPlacement, validateWidgetPlacement, widgetCountToTemplate, withProviderDetection };
|
|
54864
|
+
export { ALGOLIA_ANALYTICS_FOR_QUERY, ALGOLIA_ANALYTICS_FOR_QUERY_COMPLETE, ALGOLIA_ANALYTICS_FOR_QUERY_ERROR, ALGOLIA_LIST_INDICES, ALGOLIA_LIST_INDICES_COMPLETE, ALGOLIA_LIST_INDICES_ERROR, AVAILABLE_COLORS, AddMenuItemModal, AdvancedMcpConfig, AppContext, AppSettingsModal, AppThemeScope, AppWrapper, CHOOSE_FILE, CHOOSE_FILE_COMPLETE, CHOOSE_FILE_ERROR, ChatCore, ChatInput, ChatMessages, ColorModel, ComponentConfigModel, ComponentManager, ContextModel, DATA_JSON_TO_CSV_FILE, DATA_JSON_TO_CSV_FILE_COMPLETE, DATA_JSON_TO_CSV_FILE_ERROR, DATA_JSON_TO_CSV_STRING, DATA_JSON_TO_CSV_STRING_COMPLETE, DATA_JSON_TO_CSV_STRING_ERROR, DATA_READ_FROM_FILE, DATA_READ_FROM_FILE_COMPLETE, DATA_READ_FROM_FILE_ERROR, DATA_SAVE_TO_FILE, DATA_SAVE_TO_FILE_COMPLETE, DATA_SAVE_TO_FILE_ERROR, DashCommandPalette, DashNavbar, DashSidebar, DashTabBar, DashboardStage as Dashboard, DashboardActionsApi, DashboardApi, DashboardContext, DashboardFooter, DashboardHeader, DashboardMenuItem, DashboardModel, DashboardMonitor, DashboardPublisher, DashboardStage, DashboardThemeProvider, DashboardWizardModal, DashboardWrapper, ElectronDashboardApi, ErrorBoundary, ExternalWidget, GRID_CELL_WIDGET_TYPE, HARMONY_STRATEGIES, LAYOUT_LIST, LAYOUT_LIST_COMPLETE, LAYOUT_LIST_ERROR, LAYOUT_SAVE, LAYOUT_SAVE_COMPLETE, LAYOUT_SAVE_ERROR, Layout, LayoutBuilder, LayoutBuilderAddItemModal, LayoutBuilderConfigContainerMenuItem, LayoutBuilderConfigMenuItem, LayoutBuilderConfigModal, LayoutBuilderEditItemModal, LayoutBuilderEventModal, LayoutBuilderGridItem, LayoutContainer, LayoutDragBuilder, LayoutDragBuilderEdit, LayoutGridContainer, LayoutManagerModal, LayoutModel, LayoutQuickAddMenu, MCP_CALL_TOOL_COMPLETE, MCP_CALL_TOOL_ERROR, MCP_GET_CATALOG_COMPLETE, MCP_GET_CATALOG_ERROR, MCP_LIST_RESOURCES_COMPLETE, MCP_LIST_RESOURCES_ERROR, MCP_LIST_TOOLS_COMPLETE, MCP_LIST_TOOLS_ERROR, MCP_READ_RESOURCE_COMPLETE, MCP_READ_RESOURCE_ERROR, MCP_RUN_AUTH_COMPLETE, MCP_RUN_AUTH_ERROR, MCP_SERVER_STATUS_COMPLETE, MCP_SERVER_STATUS_ERROR, MCP_START_SERVER_COMPLETE, MCP_START_SERVER_ERROR, MCP_STOP_SERVER_COMPLETE, MCP_STOP_SERVER_ERROR, MENU_ITEMS_DELETE, MENU_ITEMS_DELETE_COMPLETE, MENU_ITEMS_DELETE_ERROR, MENU_ITEMS_LIST, MENU_ITEMS_LIST_COMPLETE, MENU_ITEMS_LIST_ERROR, MENU_ITEMS_SAVE, MENU_ITEMS_SAVE_COMPLETE, MENU_ITEMS_SAVE_ERROR, MainMenu, MainMenuItem, MainMenuSection, McpServerPicker, MenuItemModel, MenuSlideOverlay, MergeCellsModal, MessageBubble, MissingProviderPrompt, MockDashboardApi, PROVIDER_DELETE_COMPLETE, PROVIDER_DELETE_ERROR, PROVIDER_GET_COMPLETE, PROVIDER_GET_ERROR, PROVIDER_LIST_COMPLETE, PROVIDER_LIST_ERROR, PROVIDER_SAVE_COMPLETE, PROVIDER_SAVE_ERROR, PageTabBar, PanelCode, PanelEditItem, PanelEditItemHandlers, PanelEditItemNotifications, PinnedSidebar, ProviderContext, ProviderErrorBoundary, ProviderForm, ProviderSelector, SECURE_STORAGE_ENCRYPT_STRING, SECURE_STORAGE_ENCRYPT_STRING_COMPLETE, SECURE_STORAGE_ENCRYPT_STRING_ERROR, SECURE_STORE_ENCRYPTION_CHECK, SECURE_STORE_ENCRYPTION_CHECK_COMPLETE, SECURE_STORE_ENCRYPTION_CHECK_ERROR, SECURE_STORE_GET_DATA, SECURE_STORE_GET_DATA_COMPLETE, SECURE_STORE_GET_DATA_ERROR, SECURE_STORE_SET_DATA, SECURE_STORE_SET_DATA_COMPLETE, SECURE_STORE_SET_DATA_ERROR, SETTINGS_GET, SETTINGS_GET_COMPLETE, SETTINGS_GET_ERROR, SETTINGS_SAVE, SETTINGS_SAVE_COMPLETE, SETTINGS_SAVE_ERROR, SIDEBAR_WIDGET_TYPE, SettingsModel, SideMenu, SplitCellModal, StreamingText, THEME_DELETE, THEME_DELETE_COMPLETE, THEME_DELETE_ERROR, THEME_EXTRACT_FROM_URL, THEME_EXTRACT_FROM_URL_COMPLETE, THEME_EXTRACT_FROM_URL_ERROR, THEME_LIST, THEME_LIST_COMPLETE, THEME_LIST_ERROR, THEME_MAP_PALETTE, THEME_MAP_PALETTE_COMPLETE, THEME_MAP_PALETTE_ERROR, THEME_SAVE, THEME_SAVE_COMPLETE, THEME_SAVE_ERROR, ThemeApi, ThemeColorDots, ThemeManagerModal, ThemeModel, ThemeWrapper, ToolCallBlock, ToolSelector, WELCOME_STORAGE_KEY, WORKSPACE_DELETE, WORKSPACE_DELETE_COMPLETE, WORKSPACE_DELETE_ERROR, WORKSPACE_LIST, WORKSPACE_LIST_COMPLETE, WORKSPACE_LIST_ERROR, WORKSPACE_SAVE, WORKSPACE_SAVE_COMPLETE, WORKSPACE_SAVE_ERROR, WebDashboardApi, WelcomePrompt, Widget, WidgetApi, WidgetConfigPanel, WidgetContext, WidgetFactory, WidgetNotFound, WidgetPopoutStage, WidgetProviderWrapper, WidgetSidebar, WizardCustomizeStep, WizardDiscoverStep, Workspace, WorkspaceContext, WorkspaceFooter, WorkspaceMenu, WorkspaceModel, addChildToLayoutItem, addItemToItemLayout, buildMcpConfigFromOverrides, canHaveChildren, changeDirectionForLayoutItem, createProviderRegistry, deriveFormFields, envMappingToRows, evaluateBundle, extractWidgetConfigs, formStateToMcpJson, formatFieldName, generateCustomTheme, generateHarmonyTheme, generateRandomTheme, generateThemeName, getBorderStyle, getChildrenForLayoutItem, getComponentInLayout, getContainerBorderColor, getContainerColor, getIndexOfLayoutChildrenForItem, getIndexOfLayoutItem, getLayoutItemById, getLayoutItemForWorkspace, getNearestParentWorkspace, getNextHighestId, getNextHighestItemInLayout, getNextHighestOrder, getNextHighestParentId, getNextLowestItemInLayout, getParentForLayoutItem, getParentWorkspaceForItem, getThemePresets, getUserConfigurableProviders, getWidgetsForWorkspace, getWorkspacesForWorkspace, headerTemplateToRows, isContainer, isLikelySecret, isMaxOrderForItem, isMinOrderForItem, isWidget, isWidgetResolvable, isWorkspace, layoutItemHasWorkspaceAsChild, loadWidgetBundle, mcpJsonToFormState, numChildrenForLayout, removeItemFromLayout, renderComponent, renderGridLayout, renderGridLayoutFlow, _renderLayout as renderLayout, renderLayoutMenu, replaceItemInLayout, resolveIcon, setHostModules, traverseParentTree, updateLayoutItem, updateParentForItem, useDashboard, useMcpDashServer, useMcpProvider, useNotifications, useProvider, useProviderClient, useScheduler, useWebSocketProvider, useWidgetEvents, useWidgetProviders, useWidgetSchedulerStatus, useWizardState, validateCellMerge, validateGridCell, validateGridPlacement, validateWidgetPlacement, widgetCountToTemplate, withProviderDetection };
|
|
54855
54865
|
//# sourceMappingURL=index.esm.js.map
|