@trops/dash-core 0.1.723 → 0.1.725
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 +586 -407
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +586 -407
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22179,6 +22179,18 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22179
22179
|
onWorkspaceChangeRef.current = onWorkspaceChange;
|
|
22180
22180
|
}, [onWorkspaceChange]);
|
|
22181
22181
|
|
|
22182
|
+
// Every layout edit goes through here: update LayoutBuilder's own state
|
|
22183
|
+
// AND tell the parent, so the dashboard is marked dirty (Cancel and the
|
|
22184
|
+
// close guard see it) and a parent re-render can't revert it. Only the
|
|
22185
|
+
// [workspace] prop-sync effect above sets state without this — a load,
|
|
22186
|
+
// not an edit.
|
|
22187
|
+
function commitWorkspace(nextWorkspace) {
|
|
22188
|
+
setCurrentWorkspace(nextWorkspace);
|
|
22189
|
+
if (typeof onWorkspaceChangeRef.current === "function") {
|
|
22190
|
+
onWorkspaceChangeRef.current(nextWorkspace);
|
|
22191
|
+
}
|
|
22192
|
+
}
|
|
22193
|
+
|
|
22182
22194
|
// Listen for AI widget builder placement — modifies layout state directly
|
|
22183
22195
|
React.useEffect(function () {
|
|
22184
22196
|
var handler = function handler(e) {
|
|
@@ -22228,10 +22240,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22228
22240
|
}
|
|
22229
22241
|
var newWorkspace = JSON.parse(JSON.stringify(ws));
|
|
22230
22242
|
newWorkspace.layout = newLayout;
|
|
22231
|
-
|
|
22232
|
-
if (typeof onWorkspaceChangeRef.current === "function") {
|
|
22233
|
-
onWorkspaceChangeRef.current(newWorkspace);
|
|
22234
|
-
}
|
|
22243
|
+
commitWorkspace(newWorkspace);
|
|
22235
22244
|
} catch (err) {
|
|
22236
22245
|
}
|
|
22237
22246
|
};
|
|
@@ -22278,10 +22287,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22278
22287
|
}
|
|
22279
22288
|
var newWorkspace = JSON.parse(JSON.stringify(ws));
|
|
22280
22289
|
newWorkspace.layout = newLayout;
|
|
22281
|
-
|
|
22282
|
-
if (typeof onWorkspaceChangeRef.current === "function") {
|
|
22283
|
-
onWorkspaceChangeRef.current(newWorkspace);
|
|
22284
|
-
}
|
|
22290
|
+
commitWorkspace(newWorkspace);
|
|
22285
22291
|
} catch (err) {
|
|
22286
22292
|
}
|
|
22287
22293
|
};
|
|
@@ -22348,7 +22354,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22348
22354
|
newWorkspace.selectedProviders = newWorkspace.selectedProviders || {};
|
|
22349
22355
|
newWorkspace.selectedProviders[newWidget.uuid] = newWidget.selectedProviders;
|
|
22350
22356
|
}
|
|
22351
|
-
|
|
22357
|
+
commitWorkspace(newWorkspace);
|
|
22352
22358
|
setTargetCellNumber(null); // Clear cell number after use
|
|
22353
22359
|
setShowWidgetDropdown(false);
|
|
22354
22360
|
} else {
|
|
@@ -22363,28 +22369,22 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22363
22369
|
_newWorkspace.selectedProviders = _newWorkspace.selectedProviders || {};
|
|
22364
22370
|
_newWorkspace.selectedProviders[_newWidget.uuid] = _newWidget.selectedProviders;
|
|
22365
22371
|
}
|
|
22366
|
-
|
|
22372
|
+
commitWorkspace(_newWorkspace);
|
|
22367
22373
|
setIsAddWidgetModalOpen(false);
|
|
22368
22374
|
}
|
|
22369
22375
|
} catch (e) {
|
|
22370
22376
|
}
|
|
22371
22377
|
}
|
|
22372
22378
|
function handleSaveNewWorkspace(newWorkspace) {
|
|
22373
|
-
|
|
22374
|
-
return newWorkspace;
|
|
22375
|
-
});
|
|
22379
|
+
commitWorkspace(newWorkspace);
|
|
22376
22380
|
setIsConfigModalOpen(false);
|
|
22377
|
-
onWorkspaceChange(newWorkspace);
|
|
22378
22381
|
}
|
|
22379
22382
|
function onClickRemove(id) {
|
|
22380
22383
|
try {
|
|
22381
22384
|
var dashboard = new DashboardModel(currentWorkspace);
|
|
22382
22385
|
dashboard.removeItemFromLayout(id);
|
|
22383
22386
|
var nextWorkspace = dashboard.workspace();
|
|
22384
|
-
|
|
22385
|
-
if (typeof onWorkspaceChangeRef.current === "function") {
|
|
22386
|
-
onWorkspaceChangeRef.current(nextWorkspace);
|
|
22387
|
-
}
|
|
22387
|
+
commitWorkspace(nextWorkspace);
|
|
22388
22388
|
} catch (e) {
|
|
22389
22389
|
}
|
|
22390
22390
|
}
|
|
@@ -22445,9 +22445,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22445
22445
|
if (newLayout) {
|
|
22446
22446
|
var newWorkspace = JSON.parse(JSON.stringify(currentWorkspace));
|
|
22447
22447
|
newWorkspace["layout"] = newLayout;
|
|
22448
|
-
|
|
22449
|
-
return newWorkspace;
|
|
22450
|
-
});
|
|
22448
|
+
commitWorkspace(newWorkspace);
|
|
22451
22449
|
} else {
|
|
22452
22450
|
// console.log("failed new layout", newLayout);
|
|
22453
22451
|
}
|
|
@@ -22466,7 +22464,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22466
22464
|
var newLayout = changeDirectionForLayoutItem(layout, id);
|
|
22467
22465
|
var newWorkspace = JSON.parse(JSON.stringify(currentWorkspace));
|
|
22468
22466
|
newWorkspace["layout"] = newLayout;
|
|
22469
|
-
|
|
22467
|
+
commitWorkspace(newWorkspace);
|
|
22470
22468
|
}
|
|
22471
22469
|
function onChangeOrder(item, direction) {
|
|
22472
22470
|
var currentOrder = parseInt(item["order"], 10);
|
|
@@ -22511,13 +22509,11 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22511
22509
|
}
|
|
22512
22510
|
|
|
22513
22511
|
// // newWorkspace['layout'] = newLayout;
|
|
22514
|
-
|
|
22515
|
-
return newWorkspace;
|
|
22516
|
-
});
|
|
22512
|
+
commitWorkspace(newWorkspace);
|
|
22517
22513
|
}
|
|
22518
22514
|
function handleSaveConfiguration(data) {
|
|
22519
22515
|
var newWorkspace = saveItemToWorkspace(data);
|
|
22520
|
-
|
|
22516
|
+
commitWorkspace(newWorkspace);
|
|
22521
22517
|
setIsConfigOpen(false);
|
|
22522
22518
|
setIsWidgetModalOpen(false);
|
|
22523
22519
|
setSelectedItem(null);
|
|
@@ -22660,15 +22656,11 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22660
22656
|
newWorkspace.selectedProviders = newWorkspace.selectedProviders || {};
|
|
22661
22657
|
newWorkspace.selectedProviders[uuid] = _objectSpread$19(_objectSpread$19({}, newWorkspace.selectedProviders[uuid] || {}), {}, _defineProperty({}, providerType, providerId));
|
|
22662
22658
|
}
|
|
22663
|
-
|
|
22664
|
-
//
|
|
22665
|
-
// — what the dashboard config bulk-edit modal reads
|
|
22666
|
-
// stays in sync with per-widget provider edits.
|
|
22667
|
-
|
|
22668
|
-
// this, the bulk modal opens with stale provider bindings.
|
|
22669
|
-
if (typeof onWorkspaceChangeRef.current === "function") {
|
|
22670
|
-
onWorkspaceChangeRef.current(newWorkspace);
|
|
22671
|
-
}
|
|
22659
|
+
|
|
22660
|
+
// commitWorkspace also propagates to the parent (DashboardStage), so
|
|
22661
|
+
// workspaceSelected — what the dashboard config bulk-edit modal reads
|
|
22662
|
+
// from — stays in sync with per-widget provider edits.
|
|
22663
|
+
commitWorkspace(newWorkspace);
|
|
22672
22664
|
}
|
|
22673
22665
|
}
|
|
22674
22666
|
function handleCreateProvider(providerName, credentials) {
|
|
@@ -22719,7 +22711,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22719
22711
|
var result = dashboard.splitGridCell(gridContainer.id, cellNumber, direction, count);
|
|
22720
22712
|
if (result) {
|
|
22721
22713
|
var newWorkspace = dashboard.workspace();
|
|
22722
|
-
|
|
22714
|
+
commitWorkspace(newWorkspace);
|
|
22723
22715
|
} else {
|
|
22724
22716
|
}
|
|
22725
22717
|
} catch (e) {
|
|
@@ -22745,7 +22737,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22745
22737
|
});
|
|
22746
22738
|
}
|
|
22747
22739
|
var newWorkspace = dashboard.workspace();
|
|
22748
|
-
|
|
22740
|
+
commitWorkspace(newWorkspace);
|
|
22749
22741
|
} else {
|
|
22750
22742
|
}
|
|
22751
22743
|
} catch (e) {
|
|
@@ -22757,7 +22749,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22757
22749
|
var result = dashboard.addGridRow(gridContainerId, afterRow);
|
|
22758
22750
|
if (result) {
|
|
22759
22751
|
var newWorkspace = dashboard.workspace();
|
|
22760
|
-
|
|
22752
|
+
commitWorkspace(newWorkspace);
|
|
22761
22753
|
} else {
|
|
22762
22754
|
}
|
|
22763
22755
|
} catch (e) {
|
|
@@ -22769,7 +22761,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22769
22761
|
var result = dashboard.deleteGridRow(gridContainerId, rowNumber);
|
|
22770
22762
|
if (result) {
|
|
22771
22763
|
var newWorkspace = dashboard.workspace();
|
|
22772
|
-
|
|
22764
|
+
commitWorkspace(newWorkspace);
|
|
22773
22765
|
} else {
|
|
22774
22766
|
}
|
|
22775
22767
|
} catch (e) {
|
|
@@ -22781,7 +22773,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22781
22773
|
var result = dashboard.addGridColumn(gridContainerId, afterCol);
|
|
22782
22774
|
if (result) {
|
|
22783
22775
|
var newWorkspace = dashboard.workspace();
|
|
22784
|
-
|
|
22776
|
+
commitWorkspace(newWorkspace);
|
|
22785
22777
|
} else {
|
|
22786
22778
|
}
|
|
22787
22779
|
} catch (e) {
|
|
@@ -22793,7 +22785,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22793
22785
|
var result = dashboard.deleteGridColumn(gridContainerId, colNumber);
|
|
22794
22786
|
if (result) {
|
|
22795
22787
|
var newWorkspace = dashboard.workspace();
|
|
22796
|
-
|
|
22788
|
+
commitWorkspace(newWorkspace);
|
|
22797
22789
|
} else {
|
|
22798
22790
|
}
|
|
22799
22791
|
} catch (e) {
|
|
@@ -22838,10 +22830,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22838
22830
|
}
|
|
22839
22831
|
var newWorkspace = JSON.parse(JSON.stringify(_workspace));
|
|
22840
22832
|
newWorkspace["layout"] = newLayout;
|
|
22841
|
-
|
|
22842
|
-
if (typeof onWorkspaceChangeRef.current === "function") {
|
|
22843
|
-
onWorkspaceChangeRef.current(newWorkspace);
|
|
22844
|
-
}
|
|
22833
|
+
commitWorkspace(newWorkspace);
|
|
22845
22834
|
} catch (e) {
|
|
22846
22835
|
}
|
|
22847
22836
|
}
|
|
@@ -22850,10 +22839,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22850
22839
|
var dashboard = new DashboardModel(currentWorkspace);
|
|
22851
22840
|
dashboard.moveWidgetToCell(gridContainerId, sourceCellNumber, targetCellNumber);
|
|
22852
22841
|
var newWorkspace = dashboard.workspace();
|
|
22853
|
-
|
|
22854
|
-
if (typeof onWorkspaceChangeRef.current === "function") {
|
|
22855
|
-
onWorkspaceChangeRef.current(newWorkspace);
|
|
22856
|
-
}
|
|
22842
|
+
commitWorkspace(newWorkspace);
|
|
22857
22843
|
} catch (e) {
|
|
22858
22844
|
}
|
|
22859
22845
|
}
|
|
@@ -22863,7 +22849,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22863
22849
|
var result = dashboard.changeRowHeight(gridContainerId, rowNumber, multiplier);
|
|
22864
22850
|
if (result) {
|
|
22865
22851
|
var newWorkspace = dashboard.workspace();
|
|
22866
|
-
|
|
22852
|
+
commitWorkspace(newWorkspace);
|
|
22867
22853
|
} else {
|
|
22868
22854
|
}
|
|
22869
22855
|
} catch (e) {
|
|
@@ -22875,7 +22861,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22875
22861
|
var result = dashboard.changeRowMode(gridContainerId, rowNumber, mode);
|
|
22876
22862
|
if (result) {
|
|
22877
22863
|
var newWorkspace = dashboard.workspace();
|
|
22878
|
-
|
|
22864
|
+
commitWorkspace(newWorkspace);
|
|
22879
22865
|
} else {
|
|
22880
22866
|
}
|
|
22881
22867
|
} catch (e) {
|
|
@@ -22889,7 +22875,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22889
22875
|
dashboard.changeRowHeight(gridContainerId, rowNumber, multiplier);
|
|
22890
22876
|
}
|
|
22891
22877
|
var newWorkspace = dashboard.workspace();
|
|
22892
|
-
|
|
22878
|
+
commitWorkspace(newWorkspace);
|
|
22893
22879
|
} catch (e) {
|
|
22894
22880
|
}
|
|
22895
22881
|
}
|
|
@@ -22899,7 +22885,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22899
22885
|
var result = dashboard.changeColMode(gridContainerId, colNumber, mode);
|
|
22900
22886
|
if (result) {
|
|
22901
22887
|
var newWorkspace = dashboard.workspace();
|
|
22902
|
-
|
|
22888
|
+
commitWorkspace(newWorkspace);
|
|
22903
22889
|
} else {
|
|
22904
22890
|
}
|
|
22905
22891
|
} catch (e) {
|
|
@@ -22944,9 +22930,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22944
22930
|
var componentToAdd = ComponentManager.getComponent(widgetName);
|
|
22945
22931
|
var widget = LayoutModel(componentToAdd, dashboard.workspace(), dashboard.id);
|
|
22946
22932
|
dashboard.addChildToLayoutItem(widget, component.id, cellNumber);
|
|
22947
|
-
|
|
22948
|
-
return dashboard.workspace();
|
|
22949
|
-
});
|
|
22933
|
+
commitWorkspace(dashboard.workspace());
|
|
22950
22934
|
} catch (e) {
|
|
22951
22935
|
}
|
|
22952
22936
|
}
|
|
@@ -47556,6 +47540,52 @@ var PopoverItem = function PopoverItem(_ref7) {
|
|
|
47556
47540
|
});
|
|
47557
47541
|
};
|
|
47558
47542
|
|
|
47543
|
+
/**
|
|
47544
|
+
* Where a widget in the Add panel comes from (create-entry CRE-010 AC2):
|
|
47545
|
+
* - "builtin" ships with Dash (`dash.*` keys)
|
|
47546
|
+
* - "mine" my @ai-built/ scope, or my registry username's scope
|
|
47547
|
+
* - "installed" anyone else's package
|
|
47548
|
+
*
|
|
47549
|
+
* A widget's scope comes from its `package` ("@scope/name") when present,
|
|
47550
|
+
* else from its component key ("scope.name.Component").
|
|
47551
|
+
*/
|
|
47552
|
+
|
|
47553
|
+
var clean = function clean(s) {
|
|
47554
|
+
return String(s || "").trim().replace(/^@/, "").toLowerCase();
|
|
47555
|
+
};
|
|
47556
|
+
function scopeOf$1(_ref) {
|
|
47557
|
+
var key = _ref.key,
|
|
47558
|
+
widget = _ref.widget;
|
|
47559
|
+
var pkg = widget && widget["package"];
|
|
47560
|
+
if (typeof pkg === "string" && pkg.startsWith("@") && pkg.includes("/")) {
|
|
47561
|
+
return clean(pkg.split("/")[0]);
|
|
47562
|
+
}
|
|
47563
|
+
var parts = String(key || "").split(".");
|
|
47564
|
+
return parts.length > 1 ? clean(parts[0]) : "";
|
|
47565
|
+
}
|
|
47566
|
+
|
|
47567
|
+
/**
|
|
47568
|
+
* @param {{ key: string, widget: object }} entry
|
|
47569
|
+
* @param {string} [username] the signed-in registry username, if any
|
|
47570
|
+
* @returns {"builtin"|"mine"|"installed"}
|
|
47571
|
+
*/
|
|
47572
|
+
function widgetSource(entry) {
|
|
47573
|
+
var username = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
47574
|
+
var scope = scopeOf$1(entry);
|
|
47575
|
+
if (scope === "dash") return "builtin";
|
|
47576
|
+
if (scope === "ai-built") return "mine";
|
|
47577
|
+
var me = clean(username);
|
|
47578
|
+
if (me && scope === me) return "mine";
|
|
47579
|
+
return "installed";
|
|
47580
|
+
}
|
|
47581
|
+
|
|
47582
|
+
/** Does `entry` pass the Add panel's source filter ("all" passes all)? */
|
|
47583
|
+
function matchesSource(entry, filter) {
|
|
47584
|
+
var username = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
47585
|
+
if (!filter || filter === "all") return true;
|
|
47586
|
+
return widgetSource(entry, username) === filter;
|
|
47587
|
+
}
|
|
47588
|
+
|
|
47559
47589
|
function _createForOfIteratorHelper$x(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$x(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
47560
47590
|
function _unsupportedIterableToArray$x(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$x(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$x(r, a) : void 0; } }
|
|
47561
47591
|
function _arrayLikeToArray$x(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -48008,9 +48038,19 @@ var SidebarDiscoverContent = function SidebarDiscoverContent(_ref2) {
|
|
|
48008
48038
|
|
|
48009
48039
|
/* ─── Main Sidebar ─────────────────────────────────────────────────── */
|
|
48010
48040
|
|
|
48041
|
+
/**
|
|
48042
|
+
* @param {boolean} [embedded] shown inside the dashboard Edit panel's Add
|
|
48043
|
+
* tab (phase 1b): always expanded, no collapse trigger, full width.
|
|
48044
|
+
* @param {string} [username] signed-in registry username, for the Mine filter.
|
|
48045
|
+
*/
|
|
48011
48046
|
var WidgetSidebar = function WidgetSidebar(_ref4) {
|
|
48012
|
-
var
|
|
48013
|
-
onCollapsedChange = _ref4.onCollapsedChange
|
|
48047
|
+
var collapsedProp = _ref4.collapsed,
|
|
48048
|
+
onCollapsedChange = _ref4.onCollapsedChange,
|
|
48049
|
+
_ref4$embedded = _ref4.embedded,
|
|
48050
|
+
embedded = _ref4$embedded === void 0 ? false : _ref4$embedded,
|
|
48051
|
+
_ref4$username = _ref4.username,
|
|
48052
|
+
username = _ref4$username === void 0 ? "" : _ref4$username;
|
|
48053
|
+
var collapsed = embedded ? false : collapsedProp;
|
|
48014
48054
|
var _useContext = React.useContext(DashReact.ThemeContext),
|
|
48015
48055
|
currentTheme = _useContext.currentTheme;
|
|
48016
48056
|
|
|
@@ -48048,6 +48088,11 @@ var WidgetSidebar = function WidgetSidebar(_ref4) {
|
|
|
48048
48088
|
_useState22 = _slicedToArray(_useState21, 2),
|
|
48049
48089
|
filterHasHandlers = _useState22[0],
|
|
48050
48090
|
setFilterHasHandlers = _useState22[1];
|
|
48091
|
+
// Mine / Installed / Built in (create-entry CRE-010 AC2).
|
|
48092
|
+
var _useState23 = React.useState("all"),
|
|
48093
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
48094
|
+
filterSource = _useState24[0],
|
|
48095
|
+
setFilterSource = _useState24[1];
|
|
48051
48096
|
|
|
48052
48097
|
// Counter from the shared `dash:widgets-updated` event so the
|
|
48053
48098
|
// sidebar re-derives whenever widgets install / update / uninstall.
|
|
@@ -48068,10 +48113,10 @@ var WidgetSidebar = function WidgetSidebar(_ref4) {
|
|
|
48068
48113
|
|
|
48069
48114
|
// Set of installed package identifiers for "Installed" badge in Discover tab.
|
|
48070
48115
|
// Stores folder names, package names, and "author/name" keys for matching.
|
|
48071
|
-
var
|
|
48072
|
-
|
|
48073
|
-
installedPackageNames =
|
|
48074
|
-
setInstalledPackageNames =
|
|
48116
|
+
var _useState25 = React.useState(new Set()),
|
|
48117
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
48118
|
+
installedPackageNames = _useState26[0],
|
|
48119
|
+
setInstalledPackageNames = _useState26[1];
|
|
48075
48120
|
React.useEffect(function () {
|
|
48076
48121
|
var cancelled = false;
|
|
48077
48122
|
var loadInstalled = /*#__PURE__*/function () {
|
|
@@ -48176,6 +48221,13 @@ var WidgetSidebar = function WidgetSidebar(_ref4) {
|
|
|
48176
48221
|
var matchesSearch = (widget.name || "").toLowerCase().includes(q) || key.toLowerCase().includes(q) || (widget.description || "").toLowerCase().includes(q);
|
|
48177
48222
|
if (!matchesSearch) return false;
|
|
48178
48223
|
}
|
|
48224
|
+
// Source filter (Mine / Installed / Built in)
|
|
48225
|
+
if (!matchesSource({
|
|
48226
|
+
key: key,
|
|
48227
|
+
widget: widget
|
|
48228
|
+
}, filterSource, username)) {
|
|
48229
|
+
return false;
|
|
48230
|
+
}
|
|
48179
48231
|
// Group filter (package > author > "Other")
|
|
48180
48232
|
if (filterAuthor !== "all") {
|
|
48181
48233
|
if ((widget["package"] || widget.author || "Other") !== filterAuthor) return false;
|
|
@@ -48221,14 +48273,15 @@ var WidgetSidebar = function WidgetSidebar(_ref4) {
|
|
|
48221
48273
|
});
|
|
48222
48274
|
});
|
|
48223
48275
|
return groups;
|
|
48224
|
-
}, [allWidgets, searchQuery, filterAuthor, filterProvider, filterHasEvents, filterHasHandlers]);
|
|
48276
|
+
}, [allWidgets, searchQuery, filterAuthor, filterProvider, filterHasEvents, filterHasHandlers, filterSource, username]);
|
|
48225
48277
|
var filteredCount = Object.values(filteredGrouped).reduce(function (sum, arr) {
|
|
48226
48278
|
return sum + arr.length;
|
|
48227
48279
|
}, 0);
|
|
48228
48280
|
var totalCount = allWidgets.length;
|
|
48229
|
-
var hasActiveFilters = searchQuery || filterAuthor !== "all" || filterProvider !== "all" || filterHasEvents !== "all" || filterHasHandlers !== "all";
|
|
48281
|
+
var hasActiveFilters = searchQuery || filterSource !== "all" || filterAuthor !== "all" || filterProvider !== "all" || filterHasEvents !== "all" || filterHasHandlers !== "all";
|
|
48230
48282
|
var clearFilters = function clearFilters() {
|
|
48231
48283
|
setSearchQuery("");
|
|
48284
|
+
setFilterSource("all");
|
|
48232
48285
|
setFilterAuthor("all");
|
|
48233
48286
|
setFilterProvider("all");
|
|
48234
48287
|
setFilterHasEvents("all");
|
|
@@ -48252,12 +48305,12 @@ var WidgetSidebar = function WidgetSidebar(_ref4) {
|
|
|
48252
48305
|
collapsed: collapsed,
|
|
48253
48306
|
onCollapsedChange: onCollapsedChange,
|
|
48254
48307
|
side: "right",
|
|
48255
|
-
width: "w-64",
|
|
48308
|
+
width: embedded ? "w-full" : "w-64",
|
|
48256
48309
|
collapsedWidth: "w-12",
|
|
48257
48310
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Header, {
|
|
48258
48311
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
48259
48312
|
className: "flex items-center justify-between",
|
|
48260
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Trigger, {}), !collapsed && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
48313
|
+
children: [embedded ? /*#__PURE__*/jsxRuntime.jsx("span", {}) : /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Trigger, {}), !collapsed && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
48261
48314
|
className: "flex bg-white/5 rounded-md p-0.5",
|
|
48262
48315
|
children: [/*#__PURE__*/jsxRuntime.jsx("button", {
|
|
48263
48316
|
type: "button",
|
|
@@ -48272,7 +48325,7 @@ var WidgetSidebar = function WidgetSidebar(_ref4) {
|
|
|
48272
48325
|
return setActiveTab("discover");
|
|
48273
48326
|
},
|
|
48274
48327
|
className: "px-2 py-0.5 rounded text-[11px] transition-colors ".concat(activeTab === "discover" ? "bg-white/10 font-medium opacity-90" : "opacity-50 hover:opacity-70"),
|
|
48275
|
-
children: "Discover"
|
|
48328
|
+
children: embedded ? "Registry" : "Discover"
|
|
48276
48329
|
})]
|
|
48277
48330
|
})]
|
|
48278
48331
|
})
|
|
@@ -48283,6 +48336,26 @@ var WidgetSidebar = function WidgetSidebar(_ref4) {
|
|
|
48283
48336
|
onChange: setSearchQuery,
|
|
48284
48337
|
placeholder: "Search widgets...",
|
|
48285
48338
|
inputClassName: "py-1.5 text-xs"
|
|
48339
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("select", {
|
|
48340
|
+
"aria-label": "Show",
|
|
48341
|
+
value: filterSource,
|
|
48342
|
+
onChange: function onChange(e) {
|
|
48343
|
+
return setFilterSource(e.target.value);
|
|
48344
|
+
},
|
|
48345
|
+
className: selectClassName,
|
|
48346
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("option", {
|
|
48347
|
+
value: "all",
|
|
48348
|
+
children: "All widgets"
|
|
48349
|
+
}), /*#__PURE__*/jsxRuntime.jsx("option", {
|
|
48350
|
+
value: "mine",
|
|
48351
|
+
children: "Mine"
|
|
48352
|
+
}), /*#__PURE__*/jsxRuntime.jsx("option", {
|
|
48353
|
+
value: "installed",
|
|
48354
|
+
children: "Installed"
|
|
48355
|
+
}), /*#__PURE__*/jsxRuntime.jsx("option", {
|
|
48356
|
+
value: "builtin",
|
|
48357
|
+
children: "Built in"
|
|
48358
|
+
})]
|
|
48286
48359
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
48287
48360
|
className: "grid grid-cols-2 gap-1.5",
|
|
48288
48361
|
children: [/*#__PURE__*/jsxRuntime.jsxs("select", {
|
|
@@ -48440,6 +48513,166 @@ var WidgetSidebar = function WidgetSidebar(_ref4) {
|
|
|
48440
48513
|
});
|
|
48441
48514
|
};
|
|
48442
48515
|
|
|
48516
|
+
var EditPanel = function EditPanel(_ref) {
|
|
48517
|
+
var _ws$menuId;
|
|
48518
|
+
var workspace = _ref.workspace,
|
|
48519
|
+
_ref$menuItems = _ref.menuItems,
|
|
48520
|
+
menuItems = _ref$menuItems === void 0 ? [] : _ref$menuItems,
|
|
48521
|
+
_ref$themes = _ref.themes,
|
|
48522
|
+
themes = _ref$themes === void 0 ? {} : _ref$themes,
|
|
48523
|
+
_ref$username = _ref.username,
|
|
48524
|
+
username = _ref$username === void 0 ? "" : _ref$username,
|
|
48525
|
+
_ref$onNameChange = _ref.onNameChange,
|
|
48526
|
+
onNameChange = _ref$onNameChange === void 0 ? null : _ref$onNameChange,
|
|
48527
|
+
_ref$onFolderChange = _ref.onFolderChange,
|
|
48528
|
+
onFolderChange = _ref$onFolderChange === void 0 ? null : _ref$onFolderChange,
|
|
48529
|
+
_ref$onThemeChange = _ref.onThemeChange,
|
|
48530
|
+
onThemeChange = _ref$onThemeChange === void 0 ? null : _ref$onThemeChange,
|
|
48531
|
+
_ref$scrollableEnable = _ref.scrollableEnabled,
|
|
48532
|
+
scrollableEnabled = _ref$scrollableEnable === void 0 ? false : _ref$scrollableEnable,
|
|
48533
|
+
_ref$onScrollableChan = _ref.onScrollableChange,
|
|
48534
|
+
onScrollableChange = _ref$onScrollableChan === void 0 ? null : _ref$onScrollableChan,
|
|
48535
|
+
_ref$sidebarEnabled = _ref.sidebarEnabled,
|
|
48536
|
+
sidebarEnabled = _ref$sidebarEnabled === void 0 ? false : _ref$sidebarEnabled,
|
|
48537
|
+
_ref$onSidebarChange = _ref.onSidebarChange,
|
|
48538
|
+
onSidebarChange = _ref$onSidebarChange === void 0 ? null : _ref$onSidebarChange,
|
|
48539
|
+
_ref$onOpenConfig = _ref.onOpenConfig,
|
|
48540
|
+
onOpenConfig = _ref$onOpenConfig === void 0 ? null : _ref$onOpenConfig,
|
|
48541
|
+
_ref$configUnresolved = _ref.configUnresolvedCount,
|
|
48542
|
+
configUnresolvedCount = _ref$configUnresolved === void 0 ? 0 : _ref$configUnresolved;
|
|
48543
|
+
var _useContext = React.useContext(DashReact.ThemeContext),
|
|
48544
|
+
_useContext$currentTh = _useContext.currentTheme,
|
|
48545
|
+
currentTheme = _useContext$currentTh === void 0 ? {} : _useContext$currentTh,
|
|
48546
|
+
contextThemes = _useContext.themes;
|
|
48547
|
+
var _useState = React.useState("add"),
|
|
48548
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
48549
|
+
tab = _useState2[0],
|
|
48550
|
+
setTab = _useState2[1];
|
|
48551
|
+
var allThemes = themes && Object.keys(themes).length > 0 ? themes : contextThemes || {};
|
|
48552
|
+
var ws = workspace || {};
|
|
48553
|
+
var themeOptions = Object.entries(allThemes).sort(function (_ref2, _ref3) {
|
|
48554
|
+
var _ref4 = _slicedToArray(_ref2, 2),
|
|
48555
|
+
a = _ref4[1];
|
|
48556
|
+
var _ref5 = _slicedToArray(_ref3, 2),
|
|
48557
|
+
b = _ref5[1];
|
|
48558
|
+
return (a.name || "").localeCompare(b.name || "");
|
|
48559
|
+
}).map(function (_ref6) {
|
|
48560
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
48561
|
+
key = _ref7[0],
|
|
48562
|
+
t = _ref7[1];
|
|
48563
|
+
return {
|
|
48564
|
+
value: key,
|
|
48565
|
+
label: /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
48566
|
+
className: "inline-flex items-center gap-2",
|
|
48567
|
+
children: [t.name || key, /*#__PURE__*/jsxRuntime.jsx(ThemeColorDots, {
|
|
48568
|
+
theme: t
|
|
48569
|
+
})]
|
|
48570
|
+
})
|
|
48571
|
+
};
|
|
48572
|
+
});
|
|
48573
|
+
return /*#__PURE__*/jsxRuntime.jsx("aside", {
|
|
48574
|
+
"aria-label": "Edit dashboard",
|
|
48575
|
+
className: "flex flex-col w-80 flex-shrink-0 h-full min-h-0 border-l ".concat(currentTheme["border-primary-dark"] || "", " ").concat(currentTheme["bg-primary-very-dark"] || ""),
|
|
48576
|
+
children: /*#__PURE__*/jsxRuntime.jsxs(DashReact.Tabs3, {
|
|
48577
|
+
value: tab,
|
|
48578
|
+
onValueChange: setTab,
|
|
48579
|
+
className: "flex flex-col flex-1 min-h-0 border-0",
|
|
48580
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(DashReact.Tabs3.List, {
|
|
48581
|
+
className: "mx-3 mt-3 self-start",
|
|
48582
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Trigger, {
|
|
48583
|
+
value: "add",
|
|
48584
|
+
children: "Add"
|
|
48585
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Trigger, {
|
|
48586
|
+
value: "dashboard",
|
|
48587
|
+
children: "Dashboard"
|
|
48588
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Trigger, {
|
|
48589
|
+
value: "theme",
|
|
48590
|
+
children: "Theme"
|
|
48591
|
+
})]
|
|
48592
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Content, {
|
|
48593
|
+
value: "add",
|
|
48594
|
+
className: "flex flex-1 min-h-0",
|
|
48595
|
+
children: /*#__PURE__*/jsxRuntime.jsx(WidgetSidebar, {
|
|
48596
|
+
embedded: true,
|
|
48597
|
+
username: username
|
|
48598
|
+
})
|
|
48599
|
+
}), /*#__PURE__*/jsxRuntime.jsxs(DashReact.Tabs3.Content, {
|
|
48600
|
+
value: "dashboard",
|
|
48601
|
+
className: "flex flex-col gap-4 p-4 overflow-y-auto",
|
|
48602
|
+
children: [onNameChange && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
48603
|
+
className: "flex flex-col gap-1",
|
|
48604
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SectionLabel, {
|
|
48605
|
+
children: "Name"
|
|
48606
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
48607
|
+
name: "name",
|
|
48608
|
+
value: ws.name || "",
|
|
48609
|
+
onChange: onNameChange,
|
|
48610
|
+
placeholder: "Dashboard name"
|
|
48611
|
+
})]
|
|
48612
|
+
}), onFolderChange && menuItems.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
48613
|
+
className: "flex flex-col gap-1",
|
|
48614
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SectionLabel, {
|
|
48615
|
+
children: "Folder"
|
|
48616
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
|
|
48617
|
+
value: (_ws$menuId = ws.menuId) !== null && _ws$menuId !== void 0 ? _ws$menuId : "",
|
|
48618
|
+
options: menuItems.map(function (m) {
|
|
48619
|
+
return {
|
|
48620
|
+
label: m.name,
|
|
48621
|
+
value: m.id,
|
|
48622
|
+
icon: m.icon || m.folder || "folder"
|
|
48623
|
+
};
|
|
48624
|
+
}).sort(function (a, b) {
|
|
48625
|
+
return (a.label || "").localeCompare(b.label || "");
|
|
48626
|
+
}),
|
|
48627
|
+
onChange: onFolderChange,
|
|
48628
|
+
placeholder: "Folder"
|
|
48629
|
+
})]
|
|
48630
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
48631
|
+
className: "flex flex-col gap-2",
|
|
48632
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SectionLabel, {
|
|
48633
|
+
children: "Layout"
|
|
48634
|
+
}), onScrollableChange && /*#__PURE__*/jsxRuntime.jsx(DashReact.Toggle, {
|
|
48635
|
+
text: "Scrollable",
|
|
48636
|
+
enabled: scrollableEnabled,
|
|
48637
|
+
setEnabled: onScrollableChange
|
|
48638
|
+
}), onSidebarChange && /*#__PURE__*/jsxRuntime.jsx(DashReact.Toggle, {
|
|
48639
|
+
text: "Pinned sidebar",
|
|
48640
|
+
enabled: sidebarEnabled,
|
|
48641
|
+
setEnabled: onSidebarChange
|
|
48642
|
+
})]
|
|
48643
|
+
}), onOpenConfig && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
48644
|
+
className: "flex flex-col gap-2",
|
|
48645
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SectionLabel, {
|
|
48646
|
+
children: "Providers, listeners and bots"
|
|
48647
|
+
}), configUnresolvedCount > 0 && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
48648
|
+
className: "text-sm ".concat(currentTheme["text-primary-medium"] || ""),
|
|
48649
|
+
children: [configUnresolvedCount, " widget", configUnresolvedCount === 1 ? " needs" : "s need", " a provider."]
|
|
48650
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
48651
|
+
title: "Open Dashboard Config",
|
|
48652
|
+
onClick: onOpenConfig,
|
|
48653
|
+
size: "sm"
|
|
48654
|
+
})]
|
|
48655
|
+
})]
|
|
48656
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Content, {
|
|
48657
|
+
value: "theme",
|
|
48658
|
+
className: "flex flex-col p-4 overflow-y-auto",
|
|
48659
|
+
children: onThemeChange && themeOptions.length > 0 ? /*#__PURE__*/jsxRuntime.jsx(DashReact.RadioGroup, {
|
|
48660
|
+
label: "Theme",
|
|
48661
|
+
name: "dashboard-theme",
|
|
48662
|
+
value: ws.themeKey || "",
|
|
48663
|
+
onChange: function onChange(key) {
|
|
48664
|
+
return onThemeChange(key);
|
|
48665
|
+
},
|
|
48666
|
+
options: themeOptions
|
|
48667
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
48668
|
+
className: "text-sm opacity-60",
|
|
48669
|
+
children: "No themes yet."
|
|
48670
|
+
})
|
|
48671
|
+
})]
|
|
48672
|
+
})
|
|
48673
|
+
});
|
|
48674
|
+
};
|
|
48675
|
+
|
|
48443
48676
|
/**
|
|
48444
48677
|
* useMissingWidgets — detects unresolvable widget components in a workspace layout.
|
|
48445
48678
|
*
|
|
@@ -74746,6 +74979,60 @@ function _unsupportedIterableToArray$8(r, a) { if (r) { if ("string" == typeof r
|
|
|
74746
74979
|
function _arrayLikeToArray$8(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
74747
74980
|
function ownKeys$a(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
74748
74981
|
function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
74982
|
+
/**
|
|
74983
|
+
* Edit-mode staging helpers (create-entry CRE-006 AC6).
|
|
74984
|
+
*
|
|
74985
|
+
* While a dashboard is being edited, every change waits for Save. Save reads
|
|
74986
|
+
* each page's layout from `pageRefsMap` and the pinned sidebar's layout from
|
|
74987
|
+
* `sidebarWorkspaceRef` (LayoutBuilder keeps those current), so a change made
|
|
74988
|
+
* outside LayoutBuilder — a provider pick, a Dashboard Config bulk edit, a
|
|
74989
|
+
* grid ↔ sidebar move — must be mirrored into them or Save writes the stale
|
|
74990
|
+
* layout.
|
|
74991
|
+
*/
|
|
74992
|
+
|
|
74993
|
+
/**
|
|
74994
|
+
* Mirror a workspace's page layouts and sidebar layout into Save's refs.
|
|
74995
|
+
* Updates an existing page ref in place (a mounted LayoutBuilder holds that
|
|
74996
|
+
* object), and creates one for a page that has none yet.
|
|
74997
|
+
*
|
|
74998
|
+
* @param {object|null} ws
|
|
74999
|
+
* @param {{ pageRefsMap: { current: object },
|
|
75000
|
+
* sidebarWorkspaceRef: { current: object|null } }} refs
|
|
75001
|
+
*/
|
|
75002
|
+
function syncLayoutRefs(ws, _ref) {
|
|
75003
|
+
var pageRefsMap = _ref.pageRefsMap,
|
|
75004
|
+
sidebarWorkspaceRef = _ref.sidebarWorkspaceRef;
|
|
75005
|
+
if (!ws) return;
|
|
75006
|
+
if (Array.isArray(ws.sidebarLayout)) {
|
|
75007
|
+
sidebarWorkspaceRef.current = _objectSpread$a(_objectSpread$a({}, sidebarWorkspaceRef.current || {}), {}, {
|
|
75008
|
+
layout: ws.sidebarLayout
|
|
75009
|
+
});
|
|
75010
|
+
}
|
|
75011
|
+
if (!Array.isArray(ws.pages)) return;
|
|
75012
|
+
var _iterator = _createForOfIteratorHelper$8(ws.pages),
|
|
75013
|
+
_step;
|
|
75014
|
+
try {
|
|
75015
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
75016
|
+
var page = _step.value;
|
|
75017
|
+
if (!page || !page.id || !Array.isArray(page.layout)) continue;
|
|
75018
|
+
if (!pageRefsMap.current[page.id]) {
|
|
75019
|
+
pageRefsMap.current[page.id] = {
|
|
75020
|
+
current: null
|
|
75021
|
+
};
|
|
75022
|
+
}
|
|
75023
|
+
pageRefsMap.current[page.id].current = _objectSpread$a(_objectSpread$a({}, pageRefsMap.current[page.id].current || {}), {}, {
|
|
75024
|
+
layout: page.layout
|
|
75025
|
+
});
|
|
75026
|
+
}
|
|
75027
|
+
} catch (err) {
|
|
75028
|
+
_iterator.e(err);
|
|
75029
|
+
} finally {
|
|
75030
|
+
_iterator.f();
|
|
75031
|
+
}
|
|
75032
|
+
}
|
|
75033
|
+
|
|
75034
|
+
function ownKeys$9(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
75035
|
+
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
74749
75036
|
var DashboardStage = function DashboardStage(_ref) {
|
|
74750
75037
|
var dashApi = _ref.dashApi,
|
|
74751
75038
|
credentials = _ref.credentials,
|
|
@@ -74810,7 +75097,7 @@ var PageLayoutBuilder = /*#__PURE__*/React.memo(function PageLayoutBuilder(_ref2
|
|
|
74810
75097
|
workspaceRef = _ref2.workspaceRef,
|
|
74811
75098
|
onWidgetPopout = _ref2.onWidgetPopout;
|
|
74812
75099
|
var pageWorkspace = React.useMemo(function () {
|
|
74813
|
-
return _objectSpread$
|
|
75100
|
+
return _objectSpread$9(_objectSpread$9({}, workspaceItem), {}, {
|
|
74814
75101
|
layout: page.layout || []
|
|
74815
75102
|
});
|
|
74816
75103
|
},
|
|
@@ -74912,33 +75199,29 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
74912
75199
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
74913
75200
|
sidebarCollapsed = _useState8[0],
|
|
74914
75201
|
setSidebarCollapsed = _useState8[1];
|
|
74915
|
-
var _useState9 = React.useState(true),
|
|
74916
|
-
_useState0 = _slicedToArray(_useState9, 2),
|
|
74917
|
-
widgetSidebarCollapsed = _useState0[0],
|
|
74918
|
-
setWidgetSidebarCollapsed = _useState0[1];
|
|
74919
75202
|
|
|
74920
75203
|
// ─── In-app toasts (driven by DashboardActionsApi.notify) ────────
|
|
74921
|
-
var
|
|
74922
|
-
|
|
74923
|
-
toasts =
|
|
74924
|
-
setToasts =
|
|
75204
|
+
var _useState9 = React.useState([]),
|
|
75205
|
+
_useState0 = _slicedToArray(_useState9, 2),
|
|
75206
|
+
toasts = _useState0[0],
|
|
75207
|
+
setToasts = _useState0[1];
|
|
74925
75208
|
|
|
74926
75209
|
// ─── Recents + Session ──────────────────────────────────────────
|
|
74927
|
-
var
|
|
74928
|
-
|
|
74929
|
-
recentDashboards =
|
|
74930
|
-
setRecentDashboards =
|
|
75210
|
+
var _useState1 = React.useState([]),
|
|
75211
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
75212
|
+
recentDashboards = _useState10[0],
|
|
75213
|
+
setRecentDashboards = _useState10[1];
|
|
74931
75214
|
var sessionRestored = React.useRef(false);
|
|
74932
75215
|
|
|
74933
75216
|
// ─── Registry Auth (for sidebar) ────────────────────────────────
|
|
74934
|
-
var
|
|
75217
|
+
var _useState11 = React.useState("loading"),
|
|
75218
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
75219
|
+
authStatus = _useState12[0],
|
|
75220
|
+
setAuthStatus = _useState12[1];
|
|
75221
|
+
var _useState13 = React.useState(null),
|
|
74935
75222
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
74936
|
-
|
|
74937
|
-
|
|
74938
|
-
var _useState15 = React.useState(null),
|
|
74939
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
74940
|
-
authProfile = _useState16[0],
|
|
74941
|
-
setAuthProfile = _useState16[1];
|
|
75223
|
+
authProfile = _useState14[0],
|
|
75224
|
+
setAuthProfile = _useState14[1];
|
|
74942
75225
|
|
|
74943
75226
|
// Derive workspaceSelected from active tab. A Manage page tab
|
|
74944
75227
|
// (`page:<key>`, app-navigation NAV-002) has no workspace, so everything
|
|
@@ -74949,14 +75232,14 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
74949
75232
|
var activePageKey = pageKeyOf(activeTabId);
|
|
74950
75233
|
// Settings deep links carried into a page: Dashboards' Folders view, and a
|
|
74951
75234
|
// provider to select / create (a new nonce re-applies it).
|
|
75235
|
+
var _useState15 = React.useState(null),
|
|
75236
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
75237
|
+
pageSubsection = _useState16[0],
|
|
75238
|
+
setPageSubsection = _useState16[1];
|
|
74952
75239
|
var _useState17 = React.useState(null),
|
|
74953
75240
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
74954
|
-
|
|
74955
|
-
|
|
74956
|
-
var _useState19 = React.useState(null),
|
|
74957
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
74958
|
-
providerLink = _useState20[0],
|
|
74959
|
-
setProviderLink = _useState20[1];
|
|
75241
|
+
providerLink = _useState18[0],
|
|
75242
|
+
setProviderLink = _useState18[1];
|
|
74960
75243
|
// Bot approvals waiting anywhere — the sidebar's Bots dot (NAV-001 AC3).
|
|
74961
75244
|
var pendingApprovals = usePendingApprovalCount();
|
|
74962
75245
|
// Providers that still need a credential — the Providers item's dot.
|
|
@@ -74965,35 +75248,39 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
74965
75248
|
/**
|
|
74966
75249
|
* @param {Boolean} previewMode this is a toggle telling the dash we are editing
|
|
74967
75250
|
*/
|
|
74968
|
-
var
|
|
74969
|
-
|
|
74970
|
-
previewMode =
|
|
74971
|
-
setPreviewMode =
|
|
75251
|
+
var _useState19 = React.useState(preview),
|
|
75252
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
75253
|
+
previewMode = _useState20[0],
|
|
75254
|
+
setPreviewMode = _useState20[1];
|
|
75255
|
+
// For callbacks whose closures can be stale (memoized page handlers, the
|
|
75256
|
+
// cross-container move listener): are we editing right now?
|
|
75257
|
+
var previewModeRef = React.useRef(previewMode);
|
|
75258
|
+
previewModeRef.current = previewMode;
|
|
74972
75259
|
|
|
74973
75260
|
/**
|
|
74974
75261
|
* @param {String["layout", "workspace", "widget"]} editMode this is the actual mode we are in
|
|
74975
75262
|
*/
|
|
74976
|
-
var
|
|
74977
|
-
|
|
74978
|
-
editMode =
|
|
75263
|
+
var _useState21 = React.useState("all"),
|
|
75264
|
+
_useState22 = _slicedToArray(_useState21, 1),
|
|
75265
|
+
editMode = _useState22[0]; // for the time being use "all" as our "old" way
|
|
74979
75266
|
|
|
74980
75267
|
// Workspace Management (loading)
|
|
75268
|
+
var _useState23 = React.useState(false),
|
|
75269
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
75270
|
+
isLoadingWorkspaces = _useState24[0],
|
|
75271
|
+
setIsLoadingWorkspaces = _useState24[1];
|
|
74981
75272
|
var _useState25 = React.useState(false),
|
|
74982
75273
|
_useState26 = _slicedToArray(_useState25, 2),
|
|
74983
|
-
|
|
74984
|
-
|
|
74985
|
-
var _useState27 = React.useState(
|
|
75274
|
+
isLoadingMenuItems = _useState26[0],
|
|
75275
|
+
setIsLoadingMenuItems = _useState26[1];
|
|
75276
|
+
var _useState27 = React.useState([]),
|
|
74986
75277
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
74987
|
-
|
|
74988
|
-
|
|
75278
|
+
menuItems = _useState28[0],
|
|
75279
|
+
setMenuItems = _useState28[1];
|
|
74989
75280
|
var _useState29 = React.useState([]),
|
|
74990
75281
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
74991
|
-
|
|
74992
|
-
|
|
74993
|
-
var _useState31 = React.useState([]),
|
|
74994
|
-
_useState32 = _slicedToArray(_useState31, 2),
|
|
74995
|
-
workspaceConfig = _useState32[0],
|
|
74996
|
-
setWorkspaceConfig = _useState32[1];
|
|
75282
|
+
workspaceConfig = _useState30[0],
|
|
75283
|
+
setWorkspaceConfig = _useState30[1];
|
|
74997
75284
|
|
|
74998
75285
|
// This dashboard's team, live — the Bots switch's attention badge and the
|
|
74999
75286
|
// Bots view (bot-teams TEAM-011). Popouts too (B3).
|
|
@@ -75004,15 +75291,20 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75004
75291
|
// Dashboard | Bots, per dashboard. The Bots view is a viewing mode: it
|
|
75005
75292
|
// shows in preview and in popouts, never in edit mode. A popout opened from
|
|
75006
75293
|
// the Bot monitor starts in it.
|
|
75007
|
-
var
|
|
75294
|
+
var _useState31 = React.useState(function () {
|
|
75008
75295
|
return popout && popoutView === "bots" && popoutWorkspaceId !== null ? _defineProperty({}, popoutWorkspaceId, "bots") : {};
|
|
75009
75296
|
}),
|
|
75010
|
-
|
|
75011
|
-
stageModeByWorkspace =
|
|
75012
|
-
setStageModeByWorkspace =
|
|
75297
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
75298
|
+
stageModeByWorkspace = _useState32[0],
|
|
75299
|
+
setStageModeByWorkspace = _useState32[1];
|
|
75013
75300
|
var stageMode = (popout || previewMode) && workspaceSelected ? stageModeByWorkspace[workspaceSelected.id] || "dashboard" : "dashboard";
|
|
75301
|
+
// Full-screen edit (create-entry phase 1b): while a dashboard is being
|
|
75302
|
+
// edited the app's left rail, open-tabs bar and assistant rail hide and
|
|
75303
|
+
// the EditPanel sits on the right. The dashboard column keeps its place in
|
|
75304
|
+
// the tree, so widgets don't remount on entering or leaving edit mode.
|
|
75305
|
+
var isEditingDashboard = !popout && !previewMode && stageMode === "dashboard" && workspaceSelected !== null;
|
|
75014
75306
|
// Which bot the Bots view should open on ({ workspaceId, botId, tab, seq }).
|
|
75015
|
-
var
|
|
75307
|
+
var _useState33 = React.useState(function () {
|
|
75016
75308
|
return popout && popoutView === "bots" && popoutBotId ? {
|
|
75017
75309
|
workspaceId: String(popoutWorkspaceId),
|
|
75018
75310
|
botId: popoutBotId,
|
|
@@ -75020,12 +75312,12 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75020
75312
|
seq: 1
|
|
75021
75313
|
} : null;
|
|
75022
75314
|
}),
|
|
75023
|
-
|
|
75024
|
-
botsFocus =
|
|
75025
|
-
setBotsFocus =
|
|
75315
|
+
_useState34 = _slicedToArray(_useState33, 2),
|
|
75316
|
+
botsFocus = _useState34[0],
|
|
75317
|
+
setBotsFocus = _useState34[1];
|
|
75026
75318
|
var focusBot = React.useCallback(function (workspaceId, botId, tab) {
|
|
75027
75319
|
setStageModeByWorkspace(function (prev) {
|
|
75028
|
-
return _objectSpread$
|
|
75320
|
+
return _objectSpread$9(_objectSpread$9({}, prev), {}, _defineProperty({}, workspaceId, "bots"));
|
|
75029
75321
|
});
|
|
75030
75322
|
setBotsFocus(function (prev) {
|
|
75031
75323
|
return {
|
|
@@ -75039,17 +75331,17 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75039
75331
|
var setStageMode = React.useCallback(function (mode) {
|
|
75040
75332
|
if (!workspaceSelected) return;
|
|
75041
75333
|
setStageModeByWorkspace(function (prev) {
|
|
75042
|
-
return _objectSpread$
|
|
75334
|
+
return _objectSpread$9(_objectSpread$9({}, prev), {}, _defineProperty({}, workspaceSelected.id, mode));
|
|
75043
75335
|
});
|
|
75044
75336
|
}, [workspaceSelected]);
|
|
75045
75337
|
|
|
75046
75338
|
// Unsaved bot edits in the Bots view's Settings tab. Leaving the Bots view
|
|
75047
75339
|
// (the header's Dashboard switch, or the edit button) asks first.
|
|
75048
75340
|
var botsDirtyRef = React.useRef(false);
|
|
75049
|
-
var
|
|
75050
|
-
|
|
75051
|
-
pendingLeaveBots =
|
|
75052
|
-
setPendingLeaveBots =
|
|
75341
|
+
var _useState35 = React.useState(null),
|
|
75342
|
+
_useState36 = _slicedToArray(_useState35, 2),
|
|
75343
|
+
pendingLeaveBots = _useState36[0],
|
|
75344
|
+
setPendingLeaveBots = _useState36[1];
|
|
75053
75345
|
var leaveBotsGuarded = function leaveBotsGuarded(action) {
|
|
75054
75346
|
if (stageMode === "bots" && botsDirtyRef.current) {
|
|
75055
75347
|
setPendingLeaveBots(function () {
|
|
@@ -75139,28 +75431,28 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75139
75431
|
}, [popout, workspaceSelected === null || workspaceSelected === void 0 ? void 0 : workspaceSelected.id, workspaceSelectedIsSaved]);
|
|
75140
75432
|
|
|
75141
75433
|
// Modal state
|
|
75142
|
-
var
|
|
75143
|
-
|
|
75144
|
-
isThemeManagerOpen =
|
|
75145
|
-
setIsThemeManagerOpen =
|
|
75434
|
+
var _useState37 = React.useState(false),
|
|
75435
|
+
_useState38 = _slicedToArray(_useState37, 2),
|
|
75436
|
+
isThemeManagerOpen = _useState38[0],
|
|
75437
|
+
setIsThemeManagerOpen = _useState38[1];
|
|
75146
75438
|
// The theme the editor opens on (Themes page › Edit theme); null = the
|
|
75147
75439
|
// app theme.
|
|
75148
|
-
var
|
|
75440
|
+
var _useState39 = React.useState(null),
|
|
75441
|
+
_useState40 = _slicedToArray(_useState39, 2),
|
|
75442
|
+
themeEditorKey = _useState40[0],
|
|
75443
|
+
setThemeEditorKey = _useState40[1];
|
|
75444
|
+
var _useState41 = React.useState(false),
|
|
75149
75445
|
_useState42 = _slicedToArray(_useState41, 2),
|
|
75150
|
-
|
|
75151
|
-
|
|
75446
|
+
isDashboardLoaderOpen = _useState42[0],
|
|
75447
|
+
setIsDashboardLoaderOpen = _useState42[1];
|
|
75152
75448
|
var _useState43 = React.useState(false),
|
|
75153
75449
|
_useState44 = _slicedToArray(_useState43, 2),
|
|
75154
|
-
|
|
75155
|
-
|
|
75450
|
+
isLayoutPickerOpen = _useState44[0],
|
|
75451
|
+
setIsLayoutPickerOpen = _useState44[1];
|
|
75156
75452
|
var _useState45 = React.useState(false),
|
|
75157
75453
|
_useState46 = _slicedToArray(_useState45, 2),
|
|
75158
|
-
|
|
75159
|
-
|
|
75160
|
-
var _useState47 = React.useState(false),
|
|
75161
|
-
_useState48 = _slicedToArray(_useState47, 2),
|
|
75162
|
-
isWizardOpen = _useState48[0],
|
|
75163
|
-
setIsWizardOpen = _useState48[1];
|
|
75454
|
+
isWizardOpen = _useState46[0],
|
|
75455
|
+
setIsWizardOpen = _useState46[1];
|
|
75164
75456
|
|
|
75165
75457
|
// First-run onboarding (Phase 3A). Tri-state:
|
|
75166
75458
|
// null — status not yet loaded from main; do not render anything
|
|
@@ -75168,47 +75460,47 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75168
75460
|
// false — onboarding already completed (or app is not first-run)
|
|
75169
75461
|
// The status read happens once per mount; subsequent dismiss/complete
|
|
75170
75462
|
// flips this to false without re-fetching.
|
|
75171
|
-
var
|
|
75172
|
-
|
|
75173
|
-
isOnboardingOpen =
|
|
75174
|
-
setIsOnboardingOpen =
|
|
75463
|
+
var _useState47 = React.useState(null),
|
|
75464
|
+
_useState48 = _slicedToArray(_useState47, 2),
|
|
75465
|
+
isOnboardingOpen = _useState48[0],
|
|
75466
|
+
setIsOnboardingOpen = _useState48[1];
|
|
75175
75467
|
|
|
75176
75468
|
// Missing widgets detection
|
|
75177
75469
|
var _useMissingWidgets = useMissingWidgets(workspaceSelected),
|
|
75178
75470
|
missingComponents = _useMissingWidgets.missingComponents,
|
|
75179
75471
|
hasMissing = _useMissingWidgets.hasMissing;
|
|
75180
|
-
var
|
|
75472
|
+
var _useState49 = React.useState(false),
|
|
75473
|
+
_useState50 = _slicedToArray(_useState49, 2),
|
|
75474
|
+
isMissingWidgetsModalOpen = _useState50[0],
|
|
75475
|
+
setIsMissingWidgetsModalOpen = _useState50[1];
|
|
75476
|
+
var _useState51 = React.useState(new Set()),
|
|
75181
75477
|
_useState52 = _slicedToArray(_useState51, 2),
|
|
75182
|
-
|
|
75183
|
-
|
|
75184
|
-
var _useState53 = React.useState(new Set()),
|
|
75185
|
-
_useState54 = _slicedToArray(_useState53, 2),
|
|
75186
|
-
dismissedMissingForWorkspace = _useState54[0],
|
|
75187
|
-
setDismissedMissingForWorkspace = _useState54[1];
|
|
75478
|
+
dismissedMissingForWorkspace = _useState52[0],
|
|
75479
|
+
setDismissedMissingForWorkspace = _useState52[1];
|
|
75188
75480
|
|
|
75189
75481
|
// Dashboard Config modal — bulk provider wiring for the current
|
|
75190
75482
|
// workspace. Auto-opens on first load of a workspace with unresolved
|
|
75191
75483
|
// providers (tracked per session via `configModalAutoOpenedFor` so
|
|
75192
75484
|
// switching tabs doesn't re-fire the modal).
|
|
75193
|
-
var
|
|
75194
|
-
|
|
75195
|
-
isConfigModalOpen =
|
|
75196
|
-
setIsConfigModalOpen =
|
|
75485
|
+
var _useState53 = React.useState(false),
|
|
75486
|
+
_useState54 = _slicedToArray(_useState53, 2),
|
|
75487
|
+
isConfigModalOpen = _useState54[0],
|
|
75488
|
+
setIsConfigModalOpen = _useState54[1];
|
|
75197
75489
|
React.useRef(new Set());
|
|
75198
|
-
var
|
|
75199
|
-
|
|
75200
|
-
dismissedUnresolvedForWorkspace =
|
|
75201
|
-
setDismissedUnresolvedForWorkspace =
|
|
75490
|
+
var _useState55 = React.useState(new Set()),
|
|
75491
|
+
_useState56 = _slicedToArray(_useState55, 2),
|
|
75492
|
+
dismissedUnresolvedForWorkspace = _useState56[0],
|
|
75493
|
+
setDismissedUnresolvedForWorkspace = _useState56[1];
|
|
75202
75494
|
|
|
75203
75495
|
// Unified App Settings Modal
|
|
75204
|
-
var
|
|
75496
|
+
var _useState57 = React.useState(false),
|
|
75497
|
+
_useState58 = _slicedToArray(_useState57, 2),
|
|
75498
|
+
isAppSettingsOpen = _useState58[0],
|
|
75499
|
+
setIsAppSettingsOpen = _useState58[1];
|
|
75500
|
+
var _useState59 = React.useState("general"),
|
|
75205
75501
|
_useState60 = _slicedToArray(_useState59, 2),
|
|
75206
|
-
|
|
75207
|
-
|
|
75208
|
-
var _useState61 = React.useState("general"),
|
|
75209
|
-
_useState62 = _slicedToArray(_useState61, 2),
|
|
75210
|
-
appSettingsInitialSection = _useState62[0],
|
|
75211
|
-
setAppSettingsInitialSection = _useState62[1];
|
|
75502
|
+
appSettingsInitialSection = _useState60[0],
|
|
75503
|
+
setAppSettingsInitialSection = _useState60[1];
|
|
75212
75504
|
|
|
75213
75505
|
// Opens Settings at a section — or, for the sections that became Manage
|
|
75214
75506
|
// pages (Dashboards, Folders, Providers, Bots, Widgets, Themes), that
|
|
@@ -75300,14 +75592,14 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75300
75592
|
// editing. Shapes:
|
|
75301
75593
|
// { kind: "open-workspace", workspace } — sidebar switch
|
|
75302
75594
|
// { kind: "cancel-edit" } — Cancel button
|
|
75303
|
-
var
|
|
75595
|
+
var _useState61 = React.useState(false),
|
|
75596
|
+
_useState62 = _slicedToArray(_useState61, 2),
|
|
75597
|
+
isDirty = _useState62[0],
|
|
75598
|
+
setIsDirty = _useState62[1];
|
|
75599
|
+
var _useState63 = React.useState(null),
|
|
75304
75600
|
_useState64 = _slicedToArray(_useState63, 2),
|
|
75305
|
-
|
|
75306
|
-
|
|
75307
|
-
var _useState65 = React.useState(null),
|
|
75308
|
-
_useState66 = _slicedToArray(_useState65, 2),
|
|
75309
|
-
pendingNavigation = _useState66[0],
|
|
75310
|
-
setPendingNavigation = _useState66[1];
|
|
75601
|
+
pendingNavigation = _useState64[0],
|
|
75602
|
+
setPendingNavigation = _useState64[1];
|
|
75311
75603
|
React.useEffect(function () {
|
|
75312
75604
|
if (typeof globalThis !== "undefined") {
|
|
75313
75605
|
globalThis.__dashboardIsDirty = isDirty;
|
|
@@ -75479,10 +75771,10 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75479
75771
|
// We record the requested ID and open it once it appears in
|
|
75480
75772
|
// workspaceConfig — handles the case where the workspace was just
|
|
75481
75773
|
// created and the config reload is still in flight.
|
|
75482
|
-
var
|
|
75483
|
-
|
|
75484
|
-
pendingOpenWorkspaceId =
|
|
75485
|
-
setPendingOpenWorkspaceId =
|
|
75774
|
+
var _useState65 = React.useState(null),
|
|
75775
|
+
_useState66 = _slicedToArray(_useState65, 2),
|
|
75776
|
+
pendingOpenWorkspaceId = _useState66[0],
|
|
75777
|
+
setPendingOpenWorkspaceId = _useState66[1];
|
|
75486
75778
|
React.useEffect(function () {
|
|
75487
75779
|
var handler = function handler(e) {
|
|
75488
75780
|
var _e$detail2;
|
|
@@ -75521,10 +75813,10 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75521
75813
|
// Only once the saved session has been read: saving the first render's
|
|
75522
75814
|
// empty tabs used to overwrite it before restore ran (after dashboards
|
|
75523
75815
|
// load), so nothing ever came back. `sessionReady` re-runs this then.
|
|
75524
|
-
var
|
|
75525
|
-
|
|
75526
|
-
sessionReady =
|
|
75527
|
-
setSessionReady =
|
|
75816
|
+
var _useState67 = React.useState(false),
|
|
75817
|
+
_useState68 = _slicedToArray(_useState67, 2),
|
|
75818
|
+
sessionReady = _useState68[0],
|
|
75819
|
+
setSessionReady = _useState68[1];
|
|
75528
75820
|
React.useEffect(function () {
|
|
75529
75821
|
var _window$mainApi9;
|
|
75530
75822
|
if (popout || !sessionRestored.current) return;
|
|
@@ -75670,7 +75962,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75670
75962
|
var _pageRef$current;
|
|
75671
75963
|
var pageRef = pageRefsMap.current[page.id];
|
|
75672
75964
|
var liveLayout = pageRef === null || pageRef === void 0 || (_pageRef$current = pageRef.current) === null || _pageRef$current === void 0 ? void 0 : _pageRef$current.layout;
|
|
75673
|
-
return liveLayout ? _objectSpread$
|
|
75965
|
+
return liveLayout ? _objectSpread$9(_objectSpread$9({}, page), {}, {
|
|
75674
75966
|
layout: liveLayout
|
|
75675
75967
|
}) : page;
|
|
75676
75968
|
});
|
|
@@ -75696,7 +75988,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75696
75988
|
};
|
|
75697
75989
|
});
|
|
75698
75990
|
if (sidebarWorkspaceRef.current) {
|
|
75699
|
-
sidebarWorkspaceRef.current = _objectSpread$
|
|
75991
|
+
sidebarWorkspaceRef.current = _objectSpread$9(_objectSpread$9({}, sidebarWorkspaceRef.current || {}), {}, {
|
|
75700
75992
|
layout: updated.sidebarLayout || []
|
|
75701
75993
|
});
|
|
75702
75994
|
}
|
|
@@ -75705,17 +75997,10 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75705
75997
|
// moves can orphan listener bindings and provider entries when a
|
|
75706
75998
|
// widget ends up outside the layout during the move.
|
|
75707
75999
|
var reconciled = reconcileWorkspaceAfterLayoutChange(updated);
|
|
75708
|
-
|
|
75709
|
-
|
|
75710
|
-
|
|
75711
|
-
|
|
75712
|
-
return (void 0);
|
|
75713
|
-
}, function (err) {
|
|
75714
|
-
return (void 0);
|
|
75715
|
-
});
|
|
75716
|
-
} catch (err) {
|
|
75717
|
-
}
|
|
75718
|
-
}
|
|
76000
|
+
// Moves only happen while editing: stage like any other edit. (This
|
|
76001
|
+
// used to save the whole dashboard on the spot, committing every
|
|
76002
|
+
// other unsaved edit even if the user then pressed Cancel.)
|
|
76003
|
+
stageWorkspaceEdit(reconciled);
|
|
75719
76004
|
};
|
|
75720
76005
|
window.addEventListener("dash:cross-container-widget-move", handler);
|
|
75721
76006
|
return function () {
|
|
@@ -75735,7 +76020,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75735
76020
|
// Sync fresh workspace data to existing tab
|
|
75736
76021
|
setOpenTabs(function (prev) {
|
|
75737
76022
|
return prev.map(function (tab) {
|
|
75738
|
-
return tab.id === existingTab.id ? _objectSpread$
|
|
76023
|
+
return tab.id === existingTab.id ? _objectSpread$9(_objectSpread$9({}, tab), {}, {
|
|
75739
76024
|
name: workspaceItem.name || "Untitled",
|
|
75740
76025
|
workspace: workspaceItem
|
|
75741
76026
|
}) : tab;
|
|
@@ -75860,7 +76145,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75860
76145
|
function handleOpenDashboardBotsView(ws) {
|
|
75861
76146
|
if (!ws) return;
|
|
75862
76147
|
setStageModeByWorkspace(function (prev) {
|
|
75863
|
-
return _objectSpread$
|
|
76148
|
+
return _objectSpread$9(_objectSpread$9({}, prev), {}, _defineProperty({}, ws.id, "bots"));
|
|
75864
76149
|
});
|
|
75865
76150
|
handleOpenTabGuarded(ws);
|
|
75866
76151
|
}
|
|
@@ -75874,10 +76159,10 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75874
76159
|
|
|
75875
76160
|
// "Dashboard Config": open the dashboard; once it's showing (the effect
|
|
75876
76161
|
// below), enter edit mode the usual way and open Config.
|
|
75877
|
-
var
|
|
75878
|
-
|
|
75879
|
-
pendingConfigFor =
|
|
75880
|
-
setPendingConfigFor =
|
|
76162
|
+
var _useState69 = React.useState(null),
|
|
76163
|
+
_useState70 = _slicedToArray(_useState69, 2),
|
|
76164
|
+
pendingConfigFor = _useState70[0],
|
|
76165
|
+
setPendingConfigFor = _useState70[1];
|
|
75881
76166
|
function handleOpenDashboardConfig(ws) {
|
|
75882
76167
|
if (!ws) return;
|
|
75883
76168
|
setPendingConfigFor(ws.id);
|
|
@@ -75889,7 +76174,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75889
76174
|
if (!ws) return;
|
|
75890
76175
|
setOpenTabs(function (prev) {
|
|
75891
76176
|
return prev.map(function (tab) {
|
|
75892
|
-
return tab.id === ws.id ? _objectSpread$
|
|
76177
|
+
return tab.id === ws.id ? _objectSpread$9(_objectSpread$9({}, tab), {}, {
|
|
75893
76178
|
name: ws.name || "Untitled",
|
|
75894
76179
|
workspace: ws
|
|
75895
76180
|
}) : tab;
|
|
@@ -75897,6 +76182,20 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
75897
76182
|
});
|
|
75898
76183
|
}
|
|
75899
76184
|
|
|
76185
|
+
// While editing, a change made outside LayoutBuilder (provider pick,
|
|
76186
|
+
// Dashboard Config bulk edit, grid ↔ sidebar move) waits for Save like
|
|
76187
|
+
// every other edit: update the tab, mirror its layouts into the refs Save
|
|
76188
|
+
// reads, and mark the dashboard dirty so Cancel can undo it.
|
|
76189
|
+
function stageWorkspaceEdit(ws) {
|
|
76190
|
+
if (!ws) return;
|
|
76191
|
+
updateTabWorkspace(ws);
|
|
76192
|
+
syncLayoutRefs(ws, {
|
|
76193
|
+
pageRefsMap: pageRefsMap,
|
|
76194
|
+
sidebarWorkspaceRef: sidebarWorkspaceRef
|
|
76195
|
+
});
|
|
76196
|
+
setIsDirty(true);
|
|
76197
|
+
}
|
|
76198
|
+
|
|
75900
76199
|
// ─── New Workspace from Empty State ───────────────────────────────
|
|
75901
76200
|
|
|
75902
76201
|
function handleClickNewFromEmpty() {
|
|
@@ -76012,7 +76311,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76012
76311
|
return Number(w.id) === Number(tab.id);
|
|
76013
76312
|
});
|
|
76014
76313
|
if (!fresh) return tab; // workspace was deleted; leave tab for handleCloseTab to reap
|
|
76015
|
-
return _objectSpread$
|
|
76314
|
+
return _objectSpread$9(_objectSpread$9({}, tab), {}, {
|
|
76016
76315
|
name: fresh.name || tab.name,
|
|
76017
76316
|
workspace: fresh
|
|
76018
76317
|
});
|
|
@@ -76039,7 +76338,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76039
76338
|
if (activeTabId) {
|
|
76040
76339
|
setOpenTabs(function (prev) {
|
|
76041
76340
|
return prev.map(function (tab) {
|
|
76042
|
-
return tab.id === activeTabId ? _objectSpread$
|
|
76341
|
+
return tab.id === activeTabId ? _objectSpread$9(_objectSpread$9({}, tab), {}, {
|
|
76043
76342
|
name: wsModel.name || "Untitled",
|
|
76044
76343
|
workspace: wsModel
|
|
76045
76344
|
}) : tab;
|
|
@@ -76055,33 +76354,10 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76055
76354
|
// `handleClickSaveWorkspace` reads from those refs FIRST — so it
|
|
76056
76355
|
// clobbered the new sidebarLayout with the stale ref contents on
|
|
76057
76356
|
// save. Keeping everything in sync here closes that window.
|
|
76058
|
-
|
|
76059
|
-
|
|
76060
|
-
|
|
76061
|
-
|
|
76062
|
-
}
|
|
76063
|
-
if (Array.isArray(wsModel.pages)) {
|
|
76064
|
-
var _iterator = _createForOfIteratorHelper$8(wsModel.pages),
|
|
76065
|
-
_step;
|
|
76066
|
-
try {
|
|
76067
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
76068
|
-
var page = _step.value;
|
|
76069
|
-
if (!page || !page.id || !Array.isArray(page.layout)) continue;
|
|
76070
|
-
if (!pageRefsMap.current[page.id]) {
|
|
76071
|
-
pageRefsMap.current[page.id] = {
|
|
76072
|
-
current: null
|
|
76073
|
-
};
|
|
76074
|
-
}
|
|
76075
|
-
pageRefsMap.current[page.id].current = _objectSpread$a(_objectSpread$a({}, pageRefsMap.current[page.id].current || {}), {}, {
|
|
76076
|
-
layout: page.layout
|
|
76077
|
-
});
|
|
76078
|
-
}
|
|
76079
|
-
} catch (err) {
|
|
76080
|
-
_iterator.e(err);
|
|
76081
|
-
} finally {
|
|
76082
|
-
_iterator.f();
|
|
76083
|
-
}
|
|
76084
|
-
}
|
|
76357
|
+
syncLayoutRefs(wsModel, {
|
|
76358
|
+
pageRefsMap: pageRefsMap,
|
|
76359
|
+
sidebarWorkspaceRef: sidebarWorkspaceRef
|
|
76360
|
+
});
|
|
76085
76361
|
}
|
|
76086
76362
|
}
|
|
76087
76363
|
function handleProviderSelect(event) {
|
|
@@ -76100,11 +76376,16 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76100
76376
|
if (workspaceSelected && widgetId) {
|
|
76101
76377
|
// Build widget-specific provider selections
|
|
76102
76378
|
var currentSelections = workspaceSelected.selectedProviders || {};
|
|
76103
|
-
var updatedWorkspace = _objectSpread$
|
|
76104
|
-
selectedProviders: _objectSpread$
|
|
76379
|
+
var updatedWorkspace = _objectSpread$9(_objectSpread$9({}, workspaceSelected), {}, {
|
|
76380
|
+
selectedProviders: _objectSpread$9(_objectSpread$9({}, currentSelections), {}, _defineProperty({}, widgetId, updatedProviders))
|
|
76105
76381
|
});
|
|
76106
76382
|
var reconciled = reconcileWorkspaceAfterLayoutChange(updatedWorkspace);
|
|
76107
|
-
//
|
|
76383
|
+
// Editing: wait for Save (Cancel must be able to undo it).
|
|
76384
|
+
if (!previewModeRef.current) {
|
|
76385
|
+
stageWorkspaceEdit(reconciled);
|
|
76386
|
+
return;
|
|
76387
|
+
}
|
|
76388
|
+
// Not editing: a one-off pick, saved straight away.
|
|
76108
76389
|
updateTabWorkspace(reconciled);
|
|
76109
76390
|
|
|
76110
76391
|
// Persist to main app via IPC
|
|
@@ -76135,6 +76416,11 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76135
76416
|
var updatedWorkspace = applyBulkProviderBindings(workspaceSelected, changes);
|
|
76136
76417
|
if (updatedWorkspace === workspaceSelected) return; // no-op
|
|
76137
76418
|
var reconciled = reconcileWorkspaceAfterLayoutChange(updatedWorkspace);
|
|
76419
|
+
// Editing: wait for Save (Cancel must be able to undo it).
|
|
76420
|
+
if (!previewModeRef.current) {
|
|
76421
|
+
stageWorkspaceEdit(reconciled);
|
|
76422
|
+
return;
|
|
76423
|
+
}
|
|
76138
76424
|
updateTabWorkspace(reconciled);
|
|
76139
76425
|
try {
|
|
76140
76426
|
dashApi.saveWorkspace(credentials.appId, reconciled, function (e, result) {
|
|
@@ -76164,6 +76450,11 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76164
76450
|
// in through React state serialization.
|
|
76165
76451
|
var updatedWorkspace = applyBulkUserPrefs(workspaceSelected, changes);
|
|
76166
76452
|
var reconciled = reconcileWorkspaceAfterLayoutChange(updatedWorkspace);
|
|
76453
|
+
// Editing: wait for Save (Cancel must be able to undo it).
|
|
76454
|
+
if (!previewModeRef.current) {
|
|
76455
|
+
stageWorkspaceEdit(reconciled);
|
|
76456
|
+
return;
|
|
76457
|
+
}
|
|
76167
76458
|
updateTabWorkspace(reconciled);
|
|
76168
76459
|
try {
|
|
76169
76460
|
dashApi.saveWorkspace(credentials.appId, reconciled, function (e, result) {
|
|
@@ -76187,6 +76478,11 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76187
76478
|
}
|
|
76188
76479
|
var updatedWorkspace = applyWiringChanges(workspaceSelected, changes);
|
|
76189
76480
|
var reconciled = reconcileWorkspaceAfterLayoutChange(updatedWorkspace);
|
|
76481
|
+
// Editing: wait for Save (Cancel must be able to undo it).
|
|
76482
|
+
if (!previewModeRef.current) {
|
|
76483
|
+
stageWorkspaceEdit(reconciled);
|
|
76484
|
+
return;
|
|
76485
|
+
}
|
|
76190
76486
|
updateTabWorkspace(reconciled);
|
|
76191
76487
|
try {
|
|
76192
76488
|
dashApi.saveWorkspace(credentials.appId, reconciled, function (e, result) {
|
|
@@ -76231,16 +76527,16 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76231
76527
|
var sidebarWorkspaceRef = React.useRef(null);
|
|
76232
76528
|
function handleSidebarToggle(enabled) {
|
|
76233
76529
|
if (!workspaceSelected) return;
|
|
76234
|
-
handleWorkspaceChange(_objectSpread$
|
|
76530
|
+
handleWorkspaceChange(_objectSpread$9(_objectSpread$9({}, workspaceSelected), {}, {
|
|
76235
76531
|
sidebarEnabled: enabled
|
|
76236
76532
|
}));
|
|
76237
76533
|
}
|
|
76238
76534
|
|
|
76239
76535
|
// ─── Page State ──────────────────────────────────────────────────
|
|
76240
|
-
var
|
|
76241
|
-
|
|
76242
|
-
activePageId =
|
|
76243
|
-
setActivePageId =
|
|
76536
|
+
var _useState71 = React.useState(null),
|
|
76537
|
+
_useState72 = _slicedToArray(_useState71, 2),
|
|
76538
|
+
activePageId = _useState72[0],
|
|
76539
|
+
setActivePageId = _useState72[1];
|
|
76244
76540
|
|
|
76245
76541
|
// Page history stack for goBack() — pushes the previous page id
|
|
76246
76542
|
// whenever a navigation happens through navigateToPage().
|
|
@@ -76310,7 +76606,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76310
76606
|
}
|
|
76311
76607
|
function onNotify(e) {
|
|
76312
76608
|
var id = "".concat(Date.now(), "-").concat(Math.random());
|
|
76313
|
-
var toast = _objectSpread$
|
|
76609
|
+
var toast = _objectSpread$9({
|
|
76314
76610
|
id: id
|
|
76315
76611
|
}, e.detail || {});
|
|
76316
76612
|
setToasts(function (prev) {
|
|
@@ -76428,13 +76724,13 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76428
76724
|
var _pageRef$current2;
|
|
76429
76725
|
var pageRef = pageRefsMap.current[p.id];
|
|
76430
76726
|
var liveLayout = pageRef === null || pageRef === void 0 || (_pageRef$current2 = pageRef.current) === null || _pageRef$current2 === void 0 ? void 0 : _pageRef$current2.layout;
|
|
76431
|
-
return liveLayout ? _objectSpread$
|
|
76727
|
+
return liveLayout ? _objectSpread$9(_objectSpread$9({}, p), {}, {
|
|
76432
76728
|
layout: liveLayout
|
|
76433
76729
|
}) : p;
|
|
76434
76730
|
});
|
|
76435
76731
|
var newPage = DashboardModel.createPage("Page ".concat(existingPages.length + 1));
|
|
76436
76732
|
newPage.order = existingPages.length;
|
|
76437
|
-
var updatedWorkspace = _objectSpread$
|
|
76733
|
+
var updatedWorkspace = _objectSpread$9(_objectSpread$9({}, workspaceSelected), {}, {
|
|
76438
76734
|
pages: [].concat(_toConsumableArray(existingPages), [newPage]),
|
|
76439
76735
|
activePageId: newPage.id
|
|
76440
76736
|
});
|
|
@@ -76447,11 +76743,11 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76447
76743
|
function handleRenamePage(pageId, newName) {
|
|
76448
76744
|
if (!workspaceSelected) return;
|
|
76449
76745
|
var updatedPages = workspacePages.map(function (p) {
|
|
76450
|
-
return p.id === pageId ? _objectSpread$
|
|
76746
|
+
return p.id === pageId ? _objectSpread$9(_objectSpread$9({}, p), {}, {
|
|
76451
76747
|
name: newName
|
|
76452
76748
|
}) : p;
|
|
76453
76749
|
});
|
|
76454
|
-
handleWorkspaceChange(_objectSpread$
|
|
76750
|
+
handleWorkspaceChange(_objectSpread$9(_objectSpread$9({}, workspaceSelected), {}, {
|
|
76455
76751
|
pages: updatedPages
|
|
76456
76752
|
}));
|
|
76457
76753
|
}
|
|
@@ -76463,14 +76759,14 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76463
76759
|
});
|
|
76464
76760
|
var newActiveId = currentActivePageId === pageId ? (_updatedPages$ = updatedPages[0]) === null || _updatedPages$ === void 0 ? void 0 : _updatedPages$.id : currentActivePageId;
|
|
76465
76761
|
setActivePageId(newActiveId);
|
|
76466
|
-
handleWorkspaceChange(_objectSpread$
|
|
76762
|
+
handleWorkspaceChange(_objectSpread$9(_objectSpread$9({}, workspaceSelected), {}, {
|
|
76467
76763
|
pages: updatedPages,
|
|
76468
76764
|
activePageId: newActiveId
|
|
76469
76765
|
}));
|
|
76470
76766
|
}
|
|
76471
76767
|
function handleReorderPages(reorderedPages) {
|
|
76472
76768
|
if (!workspaceSelected) return;
|
|
76473
|
-
handleWorkspaceChange(_objectSpread$
|
|
76769
|
+
handleWorkspaceChange(_objectSpread$9(_objectSpread$9({}, workspaceSelected), {}, {
|
|
76474
76770
|
pages: reorderedPages
|
|
76475
76771
|
}));
|
|
76476
76772
|
}
|
|
@@ -76492,6 +76788,8 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76492
76788
|
pageRefsMap.current[pageId] = {
|
|
76493
76789
|
current: updatedWorkspace
|
|
76494
76790
|
};
|
|
76791
|
+
// A main-grid edit: mark dirty so Cancel and the close guard see it.
|
|
76792
|
+
if (!previewModeRef.current) setIsDirty(true);
|
|
76495
76793
|
|
|
76496
76794
|
// Also update the React state so workspaceSelected (which the
|
|
76497
76795
|
// dashboard config bulk-edit modal reads) stays in sync. Before
|
|
@@ -76514,12 +76812,12 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76514
76812
|
var tabWs = tab.workspace;
|
|
76515
76813
|
if (!tabWs) return tab;
|
|
76516
76814
|
var nextPages = Array.isArray(tabWs.pages) ? tabWs.pages.map(function (p) {
|
|
76517
|
-
return p && p.id === pageId ? _objectSpread$
|
|
76815
|
+
return p && p.id === pageId ? _objectSpread$9(_objectSpread$9({}, p), {}, {
|
|
76518
76816
|
layout: updatedWorkspace.layout
|
|
76519
76817
|
}) : p;
|
|
76520
76818
|
}) : tabWs.pages;
|
|
76521
|
-
return _objectSpread$
|
|
76522
|
-
workspace: _objectSpread$
|
|
76819
|
+
return _objectSpread$9(_objectSpread$9({}, tab), {}, {
|
|
76820
|
+
workspace: _objectSpread$9(_objectSpread$9({}, tabWs), {}, {
|
|
76523
76821
|
pages: nextPages,
|
|
76524
76822
|
selectedProviders: (_updatedWorkspace$sel = updatedWorkspace.selectedProviders) !== null && _updatedWorkspace$sel !== void 0 ? _updatedWorkspace$sel : tabWs.selectedProviders
|
|
76525
76823
|
})
|
|
@@ -76692,6 +76990,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76692
76990
|
currentWorkspaceRef.current.menuId = Number(menuId);
|
|
76693
76991
|
}
|
|
76694
76992
|
updateTabWorkspace(tempWorkspace);
|
|
76993
|
+
setIsDirty(true);
|
|
76695
76994
|
}
|
|
76696
76995
|
function handleWorkspaceThemeChange(themeKey) {
|
|
76697
76996
|
if (!workspaceSelected) return;
|
|
@@ -76702,6 +77001,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76702
77001
|
currentWorkspaceRef.current.themeKey = themeKey || null;
|
|
76703
77002
|
}
|
|
76704
77003
|
updateTabWorkspace(tempWorkspace);
|
|
77004
|
+
setIsDirty(true);
|
|
76705
77005
|
}
|
|
76706
77006
|
function handleScrollableChange(enabled) {
|
|
76707
77007
|
if (!workspaceSelected) return;
|
|
@@ -76709,9 +77009,9 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76709
77009
|
// Update the active page's root layout item
|
|
76710
77010
|
tempWorkspace.pages = (tempWorkspace.pages || []).map(function (page) {
|
|
76711
77011
|
if (page.id !== currentActivePageId) return page;
|
|
76712
|
-
return _objectSpread$
|
|
77012
|
+
return _objectSpread$9(_objectSpread$9({}, page), {}, {
|
|
76713
77013
|
layout: (page.layout || []).map(function (item) {
|
|
76714
|
-
return item.parent === 0 ? _objectSpread$
|
|
77014
|
+
return item.parent === 0 ? _objectSpread$9(_objectSpread$9({}, item), {}, {
|
|
76715
77015
|
scrollable: enabled
|
|
76716
77016
|
}) : item;
|
|
76717
77017
|
})
|
|
@@ -76721,13 +77021,14 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76721
77021
|
var pageRef = pageRefsMap.current[currentActivePageId];
|
|
76722
77022
|
if (pageRef !== null && pageRef !== void 0 && pageRef.current) {
|
|
76723
77023
|
pageRef.current.layout = (pageRef.current.layout || []).map(function (item) {
|
|
76724
|
-
return item.parent === 0 ? _objectSpread$
|
|
77024
|
+
return item.parent === 0 ? _objectSpread$9(_objectSpread$9({}, item), {}, {
|
|
76725
77025
|
scrollable: enabled
|
|
76726
77026
|
}) : item;
|
|
76727
77027
|
});
|
|
76728
77028
|
}
|
|
76729
77029
|
currentWorkspaceRef.current = tempWorkspace;
|
|
76730
77030
|
updateTabWorkspace(tempWorkspace);
|
|
77031
|
+
setIsDirty(true);
|
|
76731
77032
|
}
|
|
76732
77033
|
|
|
76733
77034
|
// Derive scrollable state from the active page's root layout item
|
|
@@ -76756,9 +77057,9 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76756
77057
|
var _pageRef$current4;
|
|
76757
77058
|
var pageRef = pageRefsMap.current[page.id];
|
|
76758
77059
|
var latestLayout = (pageRef === null || pageRef === void 0 || (_pageRef$current4 = pageRef.current) === null || _pageRef$current4 === void 0 ? void 0 : _pageRef$current4.layout) || page.layout || [];
|
|
76759
|
-
return _objectSpread$
|
|
77060
|
+
return _objectSpread$9(_objectSpread$9({}, page), {}, {
|
|
76760
77061
|
layout: latestLayout.map(function (item) {
|
|
76761
|
-
var copy = _objectSpread$
|
|
77062
|
+
var copy = _objectSpread$9({}, item);
|
|
76762
77063
|
delete copy.widgetConfig;
|
|
76763
77064
|
return copy;
|
|
76764
77065
|
})
|
|
@@ -76776,7 +77077,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76776
77077
|
// Gather sidebar layout from its LayoutBuilder ref
|
|
76777
77078
|
if ((_sidebarWorkspaceRef$2 = sidebarWorkspaceRef.current) !== null && _sidebarWorkspaceRef$2 !== void 0 && _sidebarWorkspaceRef$2.layout) {
|
|
76778
77079
|
workspaceToSave.sidebarLayout = sidebarWorkspaceRef.current.layout.map(function (item) {
|
|
76779
|
-
var copy = _objectSpread$
|
|
77080
|
+
var copy = _objectSpread$9({}, item);
|
|
76780
77081
|
delete copy.widgetConfig;
|
|
76781
77082
|
return copy;
|
|
76782
77083
|
});
|
|
@@ -76834,7 +77135,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
76834
77135
|
if (savedWs) {
|
|
76835
77136
|
setOpenTabs(function (prev) {
|
|
76836
77137
|
return prev.map(function (tab) {
|
|
76837
|
-
return tab.id === activeTabId ? _objectSpread$
|
|
77138
|
+
return tab.id === activeTabId ? _objectSpread$9(_objectSpread$9({}, tab), {}, {
|
|
76838
77139
|
name: savedWs.name || "Untitled",
|
|
76839
77140
|
workspace: savedWs
|
|
76840
77141
|
}) : tab;
|
|
@@ -77020,7 +77321,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
77020
77321
|
backend: reactDndHtml5Backend.HTML5Backend,
|
|
77021
77322
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
77022
77323
|
className: "flex flex-row flex-1 overflow-hidden",
|
|
77023
|
-
children: [!popout && /*#__PURE__*/jsxRuntime.jsx(DashSidebar, {
|
|
77324
|
+
children: [!popout && !isEditingDashboard && /*#__PURE__*/jsxRuntime.jsx(DashSidebar, {
|
|
77024
77325
|
collapsed: sidebarCollapsed,
|
|
77025
77326
|
onCollapsedChange: setSidebarCollapsed,
|
|
77026
77327
|
workspaces: workspaceConfig,
|
|
@@ -77053,24 +77354,11 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
77053
77354
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashboardHeader, {
|
|
77054
77355
|
workspace: workspaceSelected,
|
|
77055
77356
|
preview: popout ? true : previewMode,
|
|
77056
|
-
onNameChange: handleWorkspaceNameChange,
|
|
77057
77357
|
onClickEdit: popout ? null : function () {
|
|
77058
77358
|
return leaveBotsGuarded(handleToggleEditMode);
|
|
77059
77359
|
},
|
|
77060
77360
|
onPopout: popout ? null : handlePopout,
|
|
77061
77361
|
onSaveChanges: popout ? null : handleClickSaveWorkspace,
|
|
77062
|
-
menuItems: menuItems,
|
|
77063
|
-
themes: themes || {},
|
|
77064
|
-
onFolderChange: popout ? null : handleWorkspaceFolderChange,
|
|
77065
|
-
onThemeChange: popout ? null : handleWorkspaceThemeChange,
|
|
77066
|
-
sidebarEnabled: sidebarEnabled,
|
|
77067
|
-
onSidebarChange: popout ? null : handleSidebarToggle,
|
|
77068
|
-
scrollableEnabled: workspacePages.length <= 1 ? getRootScrollable() : undefined,
|
|
77069
|
-
onScrollableChange: workspacePages.length <= 1 && !popout ? handleScrollableChange : null,
|
|
77070
|
-
onOpenConfig: popout || previewMode ? null : function () {
|
|
77071
|
-
return setIsConfigModalOpen(true);
|
|
77072
|
-
},
|
|
77073
|
-
configUnresolvedCount: unresolvedCount,
|
|
77074
77362
|
stageMode: stageMode,
|
|
77075
77363
|
onStageModeChange: popout || previewMode ? function (mode) {
|
|
77076
77364
|
return mode === "bots" ? setStageMode(mode) : leaveBotsGuarded(function () {
|
|
@@ -77239,7 +77527,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
77239
77527
|
})]
|
|
77240
77528
|
})
|
|
77241
77529
|
})
|
|
77242
|
-
}), !popout && openTabs.length > 0 && /*#__PURE__*/jsxRuntime.jsx(DashTabBar, {
|
|
77530
|
+
}), !popout && !isEditingDashboard && openTabs.length > 0 && /*#__PURE__*/jsxRuntime.jsx(DashTabBar, {
|
|
77243
77531
|
tabs: openTabs,
|
|
77244
77532
|
activeTabId: activeTabId,
|
|
77245
77533
|
onSwitchTab: function onSwitchTab(tabId) {
|
|
@@ -77253,10 +77541,23 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
77253
77541
|
}) : handleCloseTab(tabId);
|
|
77254
77542
|
}
|
|
77255
77543
|
})]
|
|
77256
|
-
}),
|
|
77257
|
-
|
|
77258
|
-
|
|
77259
|
-
|
|
77544
|
+
}), isEditingDashboard && /*#__PURE__*/jsxRuntime.jsx(EditPanel, {
|
|
77545
|
+
workspace: workspaceSelected,
|
|
77546
|
+
menuItems: menuItems,
|
|
77547
|
+
themes: themes || {},
|
|
77548
|
+
username: (authProfile === null || authProfile === void 0 ? void 0 : authProfile.username) || "",
|
|
77549
|
+
onNameChange: handleWorkspaceNameChange,
|
|
77550
|
+
onFolderChange: handleWorkspaceFolderChange,
|
|
77551
|
+
onThemeChange: handleWorkspaceThemeChange,
|
|
77552
|
+
scrollableEnabled: getRootScrollable(),
|
|
77553
|
+
onScrollableChange: workspacePages.length <= 1 ? handleScrollableChange : null,
|
|
77554
|
+
sidebarEnabled: sidebarEnabled,
|
|
77555
|
+
onSidebarChange: handleSidebarToggle,
|
|
77556
|
+
onOpenConfig: function onOpenConfig() {
|
|
77557
|
+
return setIsConfigModalOpen(true);
|
|
77558
|
+
},
|
|
77559
|
+
configUnresolvedCount: unresolvedCount
|
|
77560
|
+
}), !popout && !isEditingDashboard && /*#__PURE__*/jsxRuntime.jsx(WorkspaceContext.Provider, {
|
|
77260
77561
|
value: dockWorkspaceContext,
|
|
77261
77562
|
children: renderAiAssistant
|
|
77262
77563
|
})]
|
|
@@ -77346,7 +77647,7 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
|
|
|
77346
77647
|
setIsConfigModalOpen(false);
|
|
77347
77648
|
if (workspaceSelected) {
|
|
77348
77649
|
setStageModeByWorkspace(function (prev) {
|
|
77349
|
-
return _objectSpread$
|
|
77650
|
+
return _objectSpread$9(_objectSpread$9({}, prev), {}, _defineProperty({}, workspaceSelected.id, "bots"));
|
|
77350
77651
|
});
|
|
77351
77652
|
}
|
|
77352
77653
|
handleToggleEditMode();
|
|
@@ -77625,39 +77926,15 @@ var DashboardFooter = function DashboardFooter(_ref) {
|
|
|
77625
77926
|
});
|
|
77626
77927
|
};
|
|
77627
77928
|
|
|
77628
|
-
function ownKeys$9(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
77629
|
-
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
77630
77929
|
var DashboardHeader = function DashboardHeader(_ref) {
|
|
77631
|
-
var _workspaceSelected$me;
|
|
77632
77930
|
var workspace = _ref.workspace,
|
|
77633
77931
|
preview = _ref.preview,
|
|
77634
77932
|
_ref$onClickEdit = _ref.onClickEdit,
|
|
77635
77933
|
onClickEdit = _ref$onClickEdit === void 0 ? null : _ref$onClickEdit,
|
|
77636
77934
|
_ref$onPopout = _ref.onPopout,
|
|
77637
77935
|
onPopout = _ref$onPopout === void 0 ? null : _ref$onPopout,
|
|
77638
|
-
onNameChange = _ref.onNameChange,
|
|
77639
77936
|
_ref$onSaveChanges = _ref.onSaveChanges,
|
|
77640
77937
|
onSaveChanges = _ref$onSaveChanges === void 0 ? null : _ref$onSaveChanges,
|
|
77641
|
-
_ref$menuItems = _ref.menuItems,
|
|
77642
|
-
menuItems = _ref$menuItems === void 0 ? [] : _ref$menuItems,
|
|
77643
|
-
_ref$themes = _ref.themes,
|
|
77644
|
-
themes = _ref$themes === void 0 ? {} : _ref$themes,
|
|
77645
|
-
_ref$onFolderChange = _ref.onFolderChange,
|
|
77646
|
-
onFolderChange = _ref$onFolderChange === void 0 ? null : _ref$onFolderChange,
|
|
77647
|
-
_ref$onThemeChange = _ref.onThemeChange,
|
|
77648
|
-
onThemeChange = _ref$onThemeChange === void 0 ? null : _ref$onThemeChange,
|
|
77649
|
-
_ref$scrollableEnable = _ref.scrollableEnabled,
|
|
77650
|
-
scrollableEnabled = _ref$scrollableEnable === void 0 ? false : _ref$scrollableEnable,
|
|
77651
|
-
_ref$onScrollableChan = _ref.onScrollableChange,
|
|
77652
|
-
onScrollableChange = _ref$onScrollableChan === void 0 ? null : _ref$onScrollableChan,
|
|
77653
|
-
_ref$sidebarEnabled = _ref.sidebarEnabled,
|
|
77654
|
-
sidebarEnabled = _ref$sidebarEnabled === void 0 ? false : _ref$sidebarEnabled,
|
|
77655
|
-
_ref$onSidebarChange = _ref.onSidebarChange,
|
|
77656
|
-
onSidebarChange = _ref$onSidebarChange === void 0 ? null : _ref$onSidebarChange,
|
|
77657
|
-
_ref$onOpenConfig = _ref.onOpenConfig,
|
|
77658
|
-
onOpenConfig = _ref$onOpenConfig === void 0 ? null : _ref$onOpenConfig,
|
|
77659
|
-
_ref$configUnresolved = _ref.configUnresolvedCount,
|
|
77660
|
-
configUnresolvedCount = _ref$configUnresolved === void 0 ? 0 : _ref$configUnresolved,
|
|
77661
77938
|
_ref$stageMode = _ref.stageMode,
|
|
77662
77939
|
stageMode = _ref$stageMode === void 0 ? "dashboard" : _ref$stageMode,
|
|
77663
77940
|
_ref$onStageModeChang = _ref.onStageModeChange,
|
|
@@ -77669,9 +77946,7 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
77669
77946
|
workspaceSelected = _useState2[0],
|
|
77670
77947
|
setWorkspaceSelected = _useState2[1];
|
|
77671
77948
|
var _useContext = React.useContext(DashReact.ThemeContext),
|
|
77672
|
-
currentTheme = _useContext.currentTheme
|
|
77673
|
-
contextThemes = _useContext.themes;
|
|
77674
|
-
var resolvedThemes = themes && Object.keys(themes).length > 0 ? themes : contextThemes || {};
|
|
77949
|
+
currentTheme = _useContext.currentTheme;
|
|
77675
77950
|
React.useEffect(function () {
|
|
77676
77951
|
if (deepEqual(workspace, workspaceSelected) === false) {
|
|
77677
77952
|
setWorkspaceSelected(function () {
|
|
@@ -77726,92 +78001,19 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
77726
78001
|
})]
|
|
77727
78002
|
}) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
77728
78003
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
77729
|
-
className: "flex flex-row items-center gap-
|
|
77730
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.
|
|
77731
|
-
|
|
77732
|
-
|
|
77733
|
-
|
|
77734
|
-
|
|
77735
|
-
placeholder: "My Workspace",
|
|
77736
|
-
bgColor: currentTheme["bg-neutral-very-dark"],
|
|
77737
|
-
textColor: currentTheme["text-primary-medium"],
|
|
77738
|
-
hasBorder: false,
|
|
77739
|
-
autoFocus: true
|
|
77740
|
-
}), onFolderChange && menuItems.length > 0 && /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
|
|
77741
|
-
value: (_workspaceSelected$me = workspaceSelected.menuId) !== null && _workspaceSelected$me !== void 0 ? _workspaceSelected$me : "",
|
|
77742
|
-
options: menuItems.map(function (m) {
|
|
77743
|
-
return {
|
|
77744
|
-
label: m.name,
|
|
77745
|
-
value: m.id,
|
|
77746
|
-
icon: m.icon || m.folder || "folder"
|
|
77747
|
-
};
|
|
77748
|
-
}).sort(function (a, b) {
|
|
77749
|
-
return (a.label || "").localeCompare(b.label || "");
|
|
77750
|
-
}),
|
|
77751
|
-
onChange: function onChange(menuId) {
|
|
77752
|
-
setWorkspaceSelected(function (prev) {
|
|
77753
|
-
return _objectSpread$9(_objectSpread$9({}, prev), {}, {
|
|
77754
|
-
menuId: menuId
|
|
77755
|
-
});
|
|
77756
|
-
});
|
|
77757
|
-
onFolderChange(menuId);
|
|
77758
|
-
},
|
|
77759
|
-
placeholder: "Folder",
|
|
77760
|
-
backgroundColor: currentTheme["bg-neutral-very-dark"],
|
|
77761
|
-
textColor: currentTheme["text-primary-medium"],
|
|
77762
|
-
borderColor: currentTheme["border-primary-dark"],
|
|
77763
|
-
inputClassName: "py-1 text-sm",
|
|
77764
|
-
className: "w-40 shrink-0"
|
|
77765
|
-
}), onThemeChange && Object.keys(resolvedThemes).length > 0 && /*#__PURE__*/jsxRuntime.jsx(DashReact.SelectInput, {
|
|
77766
|
-
value: workspaceSelected.themeKey || "",
|
|
77767
|
-
options: Object.entries(resolvedThemes).sort(function (_ref2, _ref3) {
|
|
77768
|
-
var _ref4 = _slicedToArray(_ref2, 2),
|
|
77769
|
-
a = _ref4[1];
|
|
77770
|
-
var _ref5 = _slicedToArray(_ref3, 2),
|
|
77771
|
-
b = _ref5[1];
|
|
77772
|
-
return (a.name || "").localeCompare(b.name || "");
|
|
77773
|
-
}).map(function (_ref6) {
|
|
77774
|
-
var _ref7 = _slicedToArray(_ref6, 2),
|
|
77775
|
-
key = _ref7[0],
|
|
77776
|
-
t = _ref7[1];
|
|
77777
|
-
return {
|
|
77778
|
-
label: t.name || key,
|
|
77779
|
-
value: key,
|
|
77780
|
-
icon: "palette",
|
|
77781
|
-
badge: /*#__PURE__*/jsxRuntime.jsx(ThemeColorDots, {
|
|
77782
|
-
theme: t
|
|
77783
|
-
})
|
|
77784
|
-
};
|
|
78004
|
+
className: "flex flex-row items-center gap-3 flex-1 min-w-0",
|
|
78005
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Tag, {
|
|
78006
|
+
text: "Editing"
|
|
78007
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
|
|
78008
|
+
title: (workspaceSelected.name || "Untitled").replace(/^./, function (c) {
|
|
78009
|
+
return c.toUpperCase();
|
|
77785
78010
|
}),
|
|
77786
|
-
|
|
77787
|
-
|
|
77788
|
-
return _objectSpread$9(_objectSpread$9({}, prev), {}, {
|
|
77789
|
-
themeKey: themeKey
|
|
77790
|
-
});
|
|
77791
|
-
});
|
|
77792
|
-
onThemeChange(themeKey);
|
|
77793
|
-
},
|
|
77794
|
-
placeholder: "Select a theme",
|
|
77795
|
-
backgroundColor: currentTheme["bg-neutral-very-dark"],
|
|
77796
|
-
textColor: currentTheme["text-primary-medium"],
|
|
77797
|
-
borderColor: currentTheme["border-primary-dark"],
|
|
77798
|
-
inputClassName: "py-1 text-sm",
|
|
77799
|
-
className: "w-40 shrink-0"
|
|
77800
|
-
}), onScrollableChange && /*#__PURE__*/jsxRuntime.jsx(DashReact.Toggle, {
|
|
77801
|
-
text: "Scrollable",
|
|
77802
|
-
enabled: scrollableEnabled,
|
|
77803
|
-
setEnabled: onScrollableChange
|
|
77804
|
-
}), onSidebarChange && /*#__PURE__*/jsxRuntime.jsx(DashReact.Toggle, {
|
|
77805
|
-
text: "Sidebar",
|
|
77806
|
-
enabled: sidebarEnabled,
|
|
77807
|
-
setEnabled: onSidebarChange
|
|
78011
|
+
padding: false,
|
|
78012
|
+
className: "font-bold text-base truncate"
|
|
77808
78013
|
})]
|
|
77809
78014
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
77810
78015
|
className: "flex flex-row space-x-1 shrink-0 items-center",
|
|
77811
|
-
children: [
|
|
77812
|
-
onClick: onOpenConfig,
|
|
77813
|
-
unresolvedCount: configUnresolvedCount
|
|
77814
|
-
}), onClickEdit !== null && /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon2, {
|
|
78016
|
+
children: [onClickEdit !== null && /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon2, {
|
|
77815
78017
|
icon: "xmark",
|
|
77816
78018
|
text: "Cancel",
|
|
77817
78019
|
onClick: onClickEdit,
|
|
@@ -77828,29 +78030,6 @@ var DashboardHeader = function DashboardHeader(_ref) {
|
|
|
77828
78030
|
});
|
|
77829
78031
|
};
|
|
77830
78032
|
|
|
77831
|
-
/**
|
|
77832
|
-
* DashboardConfigButton — gear icon with an optional amber dot when the
|
|
77833
|
-
* current dashboard has unresolved provider bindings. Opens the
|
|
77834
|
-
* Dashboard Config modal. Kept local to DashboardHeader because no
|
|
77835
|
-
* other caller needs it.
|
|
77836
|
-
*/
|
|
77837
|
-
function DashboardConfigButton(_ref8) {
|
|
77838
|
-
var onClick = _ref8.onClick,
|
|
77839
|
-
_ref8$unresolvedCount = _ref8.unresolvedCount,
|
|
77840
|
-
unresolvedCount = _ref8$unresolvedCount === void 0 ? 0 : _ref8$unresolvedCount;
|
|
77841
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
77842
|
-
className: "relative inline-flex",
|
|
77843
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
77844
|
-
icon: "sliders",
|
|
77845
|
-
onClick: onClick,
|
|
77846
|
-
hoverBackgroundColor: "hover:bg-neutral-700"
|
|
77847
|
-
}), unresolvedCount > 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
77848
|
-
className: "absolute top-1 right-1 h-2 w-2 rounded-full bg-amber-400 border border-black/40 pointer-events-none",
|
|
77849
|
-
title: "".concat(unresolvedCount, " unresolved provider").concat(unresolvedCount === 1 ? "" : "s")
|
|
77850
|
-
})]
|
|
77851
|
-
});
|
|
77852
|
-
}
|
|
77853
|
-
|
|
77854
78033
|
function ownKeys$8(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
77855
78034
|
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
77856
78035
|
var MAX_LOG_ENTRIES = 200;
|