@trops/dash-core 0.1.190 → 0.1.192
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 +950 -52
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +951 -51
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49,8 +49,8 @@ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
|
49
49
|
var jsxRuntime__namespace = /*#__PURE__*/_interopNamespaceDefault(jsxRuntime);
|
|
50
50
|
var ReactDOM__namespace = /*#__PURE__*/_interopNamespaceDefault(ReactDOM);
|
|
51
51
|
|
|
52
|
-
function ownKeys$
|
|
53
|
-
function _objectSpread$
|
|
52
|
+
function ownKeys$G(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; }
|
|
53
|
+
function _objectSpread$G(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$G(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$G(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
54
54
|
var event = {
|
|
55
55
|
list: new Map(),
|
|
56
56
|
// Map(1) { '<widget-UUID>' => { 'CustomSearchbar[10].searchQueryChanged': [] } }
|
|
@@ -112,7 +112,7 @@ var event = {
|
|
|
112
112
|
uuid: subscriber["uuid"]
|
|
113
113
|
};
|
|
114
114
|
if ("action" in subscriber && subscriber.action !== undefined) {
|
|
115
|
-
subscriber["action"](_objectSpread$
|
|
115
|
+
subscriber["action"](_objectSpread$G({}, objectToSend));
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
}
|
|
@@ -2619,8 +2619,8 @@ var DashboardWrapper = function DashboardWrapper(_ref) {
|
|
|
2619
2619
|
});
|
|
2620
2620
|
};
|
|
2621
2621
|
|
|
2622
|
-
function ownKeys$
|
|
2623
|
-
function _objectSpread$
|
|
2622
|
+
function ownKeys$F(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; }
|
|
2623
|
+
function _objectSpread$F(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$F(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$F(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2624
2624
|
var DashboardThemeProvider = function DashboardThemeProvider(_ref) {
|
|
2625
2625
|
var themeKey = _ref.themeKey,
|
|
2626
2626
|
children = _ref.children;
|
|
@@ -2632,7 +2632,7 @@ var DashboardThemeProvider = function DashboardThemeProvider(_ref) {
|
|
|
2632
2632
|
var dashboardTheme = themes[themeKey];
|
|
2633
2633
|
var themeValue = dashboardTheme ? dashboardTheme[themeVariant] || null : null;
|
|
2634
2634
|
if (!themeValue) return null;
|
|
2635
|
-
return _objectSpread$
|
|
2635
|
+
return _objectSpread$F(_objectSpread$F({}, parentContext), {}, {
|
|
2636
2636
|
currentTheme: themeValue,
|
|
2637
2637
|
currentThemeKey: themeKey,
|
|
2638
2638
|
theme: themeValue,
|
|
@@ -2650,8 +2650,8 @@ var DashboardThemeProvider = function DashboardThemeProvider(_ref) {
|
|
|
2650
2650
|
});
|
|
2651
2651
|
};
|
|
2652
2652
|
|
|
2653
|
-
function ownKeys$
|
|
2654
|
-
function _objectSpread$
|
|
2653
|
+
function ownKeys$E(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; }
|
|
2654
|
+
function _objectSpread$E(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$E(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$E(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2655
2655
|
var AppThemeScope = function AppThemeScope(_ref) {
|
|
2656
2656
|
var children = _ref.children;
|
|
2657
2657
|
var ctx = React.useContext(DashReact.ThemeContext);
|
|
@@ -2659,7 +2659,7 @@ var AppThemeScope = function AppThemeScope(_ref) {
|
|
|
2659
2659
|
children: children
|
|
2660
2660
|
});
|
|
2661
2661
|
return /*#__PURE__*/jsxRuntime.jsx(DashReact.ThemeContext.Provider, {
|
|
2662
|
-
value: _objectSpread$
|
|
2662
|
+
value: _objectSpread$E(_objectSpread$E({}, ctx), {}, {
|
|
2663
2663
|
currentTheme: ctx.appTheme,
|
|
2664
2664
|
currentThemeKey: ctx.appThemeKey,
|
|
2665
2665
|
theme: ctx.appTheme,
|
|
@@ -2771,8 +2771,8 @@ var LayoutContainer = function LayoutContainer(_ref) {
|
|
|
2771
2771
|
});
|
|
2772
2772
|
};
|
|
2773
2773
|
|
|
2774
|
-
function ownKeys$
|
|
2775
|
-
function _objectSpread$
|
|
2774
|
+
function ownKeys$D(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; }
|
|
2775
|
+
function _objectSpread$D(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$D(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$D(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
2776
2776
|
function _createForOfIteratorHelper$f(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$f(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; } } }; }
|
|
2777
2777
|
function _unsupportedIterableToArray$f(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$f(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$f(r, a) : void 0; } }
|
|
2778
2778
|
function _arrayLikeToArray$f(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; }
|
|
@@ -3054,7 +3054,7 @@ function createLayoutFromTemplate(template) {
|
|
|
3054
3054
|
try {
|
|
3055
3055
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
3056
3056
|
var cell = _step.value;
|
|
3057
|
-
grid[cell.key] = _objectSpread$
|
|
3057
|
+
grid[cell.key] = _objectSpread$D({
|
|
3058
3058
|
component: null,
|
|
3059
3059
|
hide: cell.hide || false
|
|
3060
3060
|
}, cell.span ? {
|
|
@@ -3466,6 +3466,13 @@ var CreationMethodPicker = function CreationMethodPicker(_ref2) {
|
|
|
3466
3466
|
onClick: function onClick() {
|
|
3467
3467
|
return onSelect("registry");
|
|
3468
3468
|
}
|
|
3469
|
+
}), /*#__PURE__*/jsxRuntime.jsx(OptionCard$1, {
|
|
3470
|
+
icon: "wand-magic-sparkles",
|
|
3471
|
+
title: "Dashboard Wizard",
|
|
3472
|
+
description: "Guided setup \u2014 pick categories, providers, and widgets step by step",
|
|
3473
|
+
onClick: function onClick() {
|
|
3474
|
+
return onSelect("wizard");
|
|
3475
|
+
}
|
|
3469
3476
|
})]
|
|
3470
3477
|
})]
|
|
3471
3478
|
});
|
|
@@ -4068,8 +4075,8 @@ var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
|
|
|
4068
4075
|
});
|
|
4069
4076
|
};
|
|
4070
4077
|
|
|
4071
|
-
function ownKeys$
|
|
4072
|
-
function _objectSpread$
|
|
4078
|
+
function ownKeys$C(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; }
|
|
4079
|
+
function _objectSpread$C(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$C(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$C(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4073
4080
|
var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
4074
4081
|
var open = _ref.open,
|
|
4075
4082
|
setIsOpen = _ref.setIsOpen,
|
|
@@ -4081,7 +4088,9 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4081
4088
|
appId = _ref.appId,
|
|
4082
4089
|
onReloadWorkspaces = _ref.onReloadWorkspaces,
|
|
4083
4090
|
_ref$onOpenWorkspace = _ref.onOpenWorkspace,
|
|
4084
|
-
onOpenWorkspace = _ref$onOpenWorkspace === void 0 ? null : _ref$onOpenWorkspace
|
|
4091
|
+
onOpenWorkspace = _ref$onOpenWorkspace === void 0 ? null : _ref$onOpenWorkspace,
|
|
4092
|
+
_ref$onOpenWizard = _ref.onOpenWizard,
|
|
4093
|
+
onOpenWizard = _ref$onOpenWizard === void 0 ? null : _ref$onOpenWizard;
|
|
4085
4094
|
var _useContext = React.useContext(DashReact.ThemeContext),
|
|
4086
4095
|
themes = _useContext.themes,
|
|
4087
4096
|
appThemeKey = _useContext.themeKey;
|
|
@@ -4202,6 +4211,11 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4202
4211
|
setActiveStep(2);
|
|
4203
4212
|
}
|
|
4204
4213
|
function handleMethodSelect(method) {
|
|
4214
|
+
if (method === "wizard" && onOpenWizard) {
|
|
4215
|
+
setIsOpen(false);
|
|
4216
|
+
onOpenWizard();
|
|
4217
|
+
return;
|
|
4218
|
+
}
|
|
4205
4219
|
setCreationMethod(method);
|
|
4206
4220
|
}
|
|
4207
4221
|
function handleImportFromFile() {
|
|
@@ -4305,7 +4319,7 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4305
4319
|
}
|
|
4306
4320
|
return _context2.abrupt("return");
|
|
4307
4321
|
case 6:
|
|
4308
|
-
updatedWorkspace = _objectSpread$
|
|
4322
|
+
updatedWorkspace = _objectSpread$C(_objectSpread$C({}, importedWorkspace), {}, {
|
|
4309
4323
|
name: dashboardName.trim(),
|
|
4310
4324
|
menuId: menuId,
|
|
4311
4325
|
themeKey: selectedThemeKey
|
|
@@ -6091,8 +6105,8 @@ var WidgetList = function WidgetList(_ref4) {
|
|
|
6091
6105
|
});
|
|
6092
6106
|
};
|
|
6093
6107
|
|
|
6094
|
-
function ownKeys$
|
|
6095
|
-
function _objectSpread$
|
|
6108
|
+
function ownKeys$B(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; }
|
|
6109
|
+
function _objectSpread$B(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$B(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$B(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6096
6110
|
var TOTAL_STEPS = 6; // Steps 0-5
|
|
6097
6111
|
|
|
6098
6112
|
var initialState = {
|
|
@@ -6115,11 +6129,11 @@ var initialState = {
|
|
|
6115
6129
|
function wizardReducer(state, action) {
|
|
6116
6130
|
switch (action.type) {
|
|
6117
6131
|
case "SET_STEP":
|
|
6118
|
-
return _objectSpread$
|
|
6132
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6119
6133
|
step: action.payload
|
|
6120
6134
|
});
|
|
6121
6135
|
case "SET_INTENT":
|
|
6122
|
-
return _objectSpread$
|
|
6136
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6123
6137
|
intent: action.payload
|
|
6124
6138
|
});
|
|
6125
6139
|
case "TOGGLE_INTENT":
|
|
@@ -6127,12 +6141,12 @@ function wizardReducer(state, action) {
|
|
|
6127
6141
|
var intent = state.intent.includes(action.payload) ? state.intent.filter(function (i) {
|
|
6128
6142
|
return i !== action.payload;
|
|
6129
6143
|
}) : [].concat(_toConsumableArray(state.intent), [action.payload]);
|
|
6130
|
-
return _objectSpread$
|
|
6144
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6131
6145
|
intent: intent
|
|
6132
6146
|
});
|
|
6133
6147
|
}
|
|
6134
6148
|
case "SET_PROVIDERS":
|
|
6135
|
-
return _objectSpread$
|
|
6149
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6136
6150
|
providers: action.payload
|
|
6137
6151
|
});
|
|
6138
6152
|
case "TOGGLE_PROVIDER":
|
|
@@ -6140,12 +6154,12 @@ function wizardReducer(state, action) {
|
|
|
6140
6154
|
var providers = state.providers.includes(action.payload) ? state.providers.filter(function (p) {
|
|
6141
6155
|
return p !== action.payload;
|
|
6142
6156
|
}) : [].concat(_toConsumableArray(state.providers), [action.payload]);
|
|
6143
|
-
return _objectSpread$
|
|
6157
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6144
6158
|
providers: providers
|
|
6145
6159
|
});
|
|
6146
6160
|
}
|
|
6147
6161
|
case "SET_SELECTED_WIDGETS":
|
|
6148
|
-
return _objectSpread$
|
|
6162
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6149
6163
|
selectedWidgets: action.payload
|
|
6150
6164
|
});
|
|
6151
6165
|
case "TOGGLE_WIDGET":
|
|
@@ -6156,34 +6170,34 @@ function wizardReducer(state, action) {
|
|
|
6156
6170
|
var selectedWidgets = exists ? state.selectedWidgets.filter(function (w) {
|
|
6157
6171
|
return w.name !== action.payload.name;
|
|
6158
6172
|
}) : [].concat(_toConsumableArray(state.selectedWidgets), [action.payload]);
|
|
6159
|
-
return _objectSpread$
|
|
6173
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6160
6174
|
selectedWidgets: selectedWidgets
|
|
6161
6175
|
});
|
|
6162
6176
|
}
|
|
6163
6177
|
case "SET_SELECTED_DASHBOARD":
|
|
6164
|
-
return _objectSpread$
|
|
6178
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6165
6179
|
selectedDashboard: action.payload
|
|
6166
6180
|
});
|
|
6167
6181
|
case "SET_PATH":
|
|
6168
|
-
return _objectSpread$
|
|
6182
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6169
6183
|
path: action.payload
|
|
6170
6184
|
});
|
|
6171
6185
|
case "SET_LAYOUT":
|
|
6172
|
-
return _objectSpread$
|
|
6186
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6173
6187
|
layout: action.payload
|
|
6174
6188
|
});
|
|
6175
6189
|
case "REORDER_WIDGETS":
|
|
6176
|
-
return _objectSpread$
|
|
6177
|
-
layout: _objectSpread$
|
|
6190
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6191
|
+
layout: _objectSpread$B(_objectSpread$B({}, state.layout), {}, {
|
|
6178
6192
|
widgetOrder: action.payload
|
|
6179
6193
|
})
|
|
6180
6194
|
});
|
|
6181
6195
|
case "SET_CUSTOMIZATION":
|
|
6182
|
-
return _objectSpread$
|
|
6183
|
-
customization: _objectSpread$
|
|
6196
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6197
|
+
customization: _objectSpread$B(_objectSpread$B({}, state.customization), action.payload)
|
|
6184
6198
|
});
|
|
6185
6199
|
case "RESET":
|
|
6186
|
-
return _objectSpread$
|
|
6200
|
+
return _objectSpread$B({}, initialState);
|
|
6187
6201
|
default:
|
|
6188
6202
|
return state;
|
|
6189
6203
|
}
|
|
@@ -6525,6 +6539,836 @@ var LayoutGrid = function LayoutGrid(_ref3) {
|
|
|
6525
6539
|
});
|
|
6526
6540
|
};
|
|
6527
6541
|
|
|
6542
|
+
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; }
|
|
6543
|
+
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; }
|
|
6544
|
+
var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
6545
|
+
var _state$selectedDashbo, _state$selectedDashbo2;
|
|
6546
|
+
var state = _ref.state,
|
|
6547
|
+
dispatch = _ref.dispatch,
|
|
6548
|
+
_ref$menuItems = _ref.menuItems,
|
|
6549
|
+
menuItems = _ref$menuItems === void 0 ? [] : _ref$menuItems,
|
|
6550
|
+
_ref$onSaveMenuItem = _ref.onSaveMenuItem,
|
|
6551
|
+
onSaveMenuItem = _ref$onSaveMenuItem === void 0 ? null : _ref$onSaveMenuItem,
|
|
6552
|
+
_ref$onCreateWorkspac = _ref.onCreateWorkspace,
|
|
6553
|
+
onCreateWorkspace = _ref$onCreateWorkspac === void 0 ? null : _ref$onCreateWorkspac,
|
|
6554
|
+
_ref$onInstallDashboa = _ref.onInstallDashboard,
|
|
6555
|
+
onInstallDashboard = _ref$onInstallDashboa === void 0 ? null : _ref$onInstallDashboa,
|
|
6556
|
+
_ref$onOpenDashboard = _ref.onOpenDashboard,
|
|
6557
|
+
onOpenDashboard = _ref$onOpenDashboard === void 0 ? null : _ref$onOpenDashboard,
|
|
6558
|
+
appId = _ref.appId;
|
|
6559
|
+
var _useContext = React.useContext(DashReact.ThemeContext),
|
|
6560
|
+
themes = _useContext.themes,
|
|
6561
|
+
appThemeKey = _useContext.themeKey;
|
|
6562
|
+
var _useContext2 = React.useContext(AppContext),
|
|
6563
|
+
providersMap = _useContext2.providers;
|
|
6564
|
+
var _useState = React.useState(menuItems),
|
|
6565
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
6566
|
+
localMenuItems = _useState2[0],
|
|
6567
|
+
setLocalMenuItems = _useState2[1];
|
|
6568
|
+
var _useState3 = React.useState(false),
|
|
6569
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
6570
|
+
isCreatingFolder = _useState4[0],
|
|
6571
|
+
setIsCreatingFolder = _useState4[1];
|
|
6572
|
+
var _useState5 = React.useState(""),
|
|
6573
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
6574
|
+
newFolderName = _useState6[0],
|
|
6575
|
+
setNewFolderName = _useState6[1];
|
|
6576
|
+
var _useState7 = React.useState(null),
|
|
6577
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
6578
|
+
newFolderIcon = _useState8[0],
|
|
6579
|
+
setNewFolderIcon = _useState8[1];
|
|
6580
|
+
|
|
6581
|
+
// Creation state
|
|
6582
|
+
var _useState9 = React.useState(false),
|
|
6583
|
+
_useState0 = _slicedToArray(_useState9, 2);
|
|
6584
|
+
_useState0[0];
|
|
6585
|
+
var setCreating = _useState0[1];
|
|
6586
|
+
var _useState1 = React.useState(null),
|
|
6587
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
6588
|
+
error = _useState10[0],
|
|
6589
|
+
setError = _useState10[1];
|
|
6590
|
+
var _useState11 = React.useState(null),
|
|
6591
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
6592
|
+
createdDashboard = _useState12[0],
|
|
6593
|
+
setCreatedDashboard = _useState12[1];
|
|
6594
|
+
var isPrebuilt = state.path === "prebuilt";
|
|
6595
|
+
|
|
6596
|
+
// Initialize customization defaults on mount
|
|
6597
|
+
React.useEffect(function () {
|
|
6598
|
+
setLocalMenuItems(menuItems);
|
|
6599
|
+
var updates = {};
|
|
6600
|
+
if (!state.customization.menuId && menuItems.length > 0) {
|
|
6601
|
+
updates.menuId = menuItems[0].id;
|
|
6602
|
+
}
|
|
6603
|
+
if (!state.customization.theme && themes) {
|
|
6604
|
+
var _Object$entries$sort$;
|
|
6605
|
+
var fallback = (_Object$entries$sort$ = Object.entries(themes).sort(function (_ref2, _ref3) {
|
|
6606
|
+
var _ref4 = _slicedToArray(_ref2, 2),
|
|
6607
|
+
a = _ref4[1];
|
|
6608
|
+
var _ref5 = _slicedToArray(_ref3, 2),
|
|
6609
|
+
b = _ref5[1];
|
|
6610
|
+
return (a.name || "").localeCompare(b.name || "");
|
|
6611
|
+
})[0]) === null || _Object$entries$sort$ === void 0 ? void 0 : _Object$entries$sort$[0];
|
|
6612
|
+
updates.theme = appThemeKey || fallback || null;
|
|
6613
|
+
}
|
|
6614
|
+
if (Object.keys(updates).length > 0) {
|
|
6615
|
+
dispatch({
|
|
6616
|
+
type: "SET_CUSTOMIZATION",
|
|
6617
|
+
payload: updates
|
|
6618
|
+
});
|
|
6619
|
+
}
|
|
6620
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6621
|
+
}, []);
|
|
6622
|
+
var handleNameChange = React.useCallback(function (val) {
|
|
6623
|
+
dispatch({
|
|
6624
|
+
type: "SET_CUSTOMIZATION",
|
|
6625
|
+
payload: {
|
|
6626
|
+
name: val
|
|
6627
|
+
}
|
|
6628
|
+
});
|
|
6629
|
+
}, [dispatch]);
|
|
6630
|
+
var handleMenuSelect = React.useCallback(function (id) {
|
|
6631
|
+
dispatch({
|
|
6632
|
+
type: "SET_CUSTOMIZATION",
|
|
6633
|
+
payload: {
|
|
6634
|
+
menuId: id
|
|
6635
|
+
}
|
|
6636
|
+
});
|
|
6637
|
+
setIsCreatingFolder(false);
|
|
6638
|
+
setNewFolderName("");
|
|
6639
|
+
setNewFolderIcon(null);
|
|
6640
|
+
}, [dispatch]);
|
|
6641
|
+
var handleThemeSelect = React.useCallback(function (key) {
|
|
6642
|
+
dispatch({
|
|
6643
|
+
type: "SET_CUSTOMIZATION",
|
|
6644
|
+
payload: {
|
|
6645
|
+
theme: key
|
|
6646
|
+
}
|
|
6647
|
+
});
|
|
6648
|
+
}, [dispatch]);
|
|
6649
|
+
function handleCancelNewFolder() {
|
|
6650
|
+
setIsCreatingFolder(false);
|
|
6651
|
+
setNewFolderName("");
|
|
6652
|
+
setNewFolderIcon(null);
|
|
6653
|
+
}
|
|
6654
|
+
function handleSaveNewFolder() {
|
|
6655
|
+
if (!newFolderName.trim() || !newFolderIcon) return;
|
|
6656
|
+
var newItem = {
|
|
6657
|
+
id: Date.now(),
|
|
6658
|
+
name: newFolderName.trim(),
|
|
6659
|
+
icon: newFolderIcon
|
|
6660
|
+
};
|
|
6661
|
+
setLocalMenuItems(function (prev) {
|
|
6662
|
+
return [].concat(_toConsumableArray(prev), [newItem]);
|
|
6663
|
+
});
|
|
6664
|
+
dispatch({
|
|
6665
|
+
type: "SET_CUSTOMIZATION",
|
|
6666
|
+
payload: {
|
|
6667
|
+
menuId: newItem.id
|
|
6668
|
+
}
|
|
6669
|
+
});
|
|
6670
|
+
if (onSaveMenuItem) {
|
|
6671
|
+
onSaveMenuItem(newItem);
|
|
6672
|
+
}
|
|
6673
|
+
setIsCreatingFolder(false);
|
|
6674
|
+
setNewFolderName("");
|
|
6675
|
+
setNewFolderIcon(null);
|
|
6676
|
+
}
|
|
6677
|
+
|
|
6678
|
+
// --- Create logic ---
|
|
6679
|
+
React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
6680
|
+
var _state$customization, name, menuId, theme, result, _window$mainApi, installResult, updatedWorkspace, _window$mainApi2, template, layoutObj, widgetOrder, cells, _loop, i, workspace, _t;
|
|
6681
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
6682
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
6683
|
+
case 0:
|
|
6684
|
+
setCreating(true);
|
|
6685
|
+
setError(null);
|
|
6686
|
+
_context2.prev = 1;
|
|
6687
|
+
_state$customization = state.customization, name = _state$customization.name, menuId = _state$customization.menuId, theme = _state$customization.theme;
|
|
6688
|
+
if (!(isPrebuilt && state.selectedDashboard)) {
|
|
6689
|
+
_context2.next = 7;
|
|
6690
|
+
break;
|
|
6691
|
+
}
|
|
6692
|
+
if (!onInstallDashboard) {
|
|
6693
|
+
_context2.next = 3;
|
|
6694
|
+
break;
|
|
6695
|
+
}
|
|
6696
|
+
_context2.next = 2;
|
|
6697
|
+
return onInstallDashboard({
|
|
6698
|
+
dashboard: state.selectedDashboard,
|
|
6699
|
+
name: name.trim(),
|
|
6700
|
+
menuId: menuId || 1,
|
|
6701
|
+
themeKey: theme,
|
|
6702
|
+
appId: appId
|
|
6703
|
+
});
|
|
6704
|
+
case 2:
|
|
6705
|
+
result = _context2.sent;
|
|
6706
|
+
_context2.next = 6;
|
|
6707
|
+
break;
|
|
6708
|
+
case 3:
|
|
6709
|
+
if (!((_window$mainApi = window.mainApi) !== null && _window$mainApi !== void 0 && (_window$mainApi = _window$mainApi.registry) !== null && _window$mainApi !== void 0 && _window$mainApi.installDashboard)) {
|
|
6710
|
+
_context2.next = 6;
|
|
6711
|
+
break;
|
|
6712
|
+
}
|
|
6713
|
+
_context2.next = 4;
|
|
6714
|
+
return window.mainApi.registry.installDashboard(appId, state.selectedDashboard.name || state.selectedDashboard.key);
|
|
6715
|
+
case 4:
|
|
6716
|
+
installResult = _context2.sent;
|
|
6717
|
+
if (!(installResult !== null && installResult !== void 0 && installResult.workspace)) {
|
|
6718
|
+
_context2.next = 6;
|
|
6719
|
+
break;
|
|
6720
|
+
}
|
|
6721
|
+
updatedWorkspace = _objectSpread$A(_objectSpread$A({}, installResult.workspace), {}, {
|
|
6722
|
+
name: name.trim(),
|
|
6723
|
+
menuId: menuId || 1,
|
|
6724
|
+
themeKey: theme
|
|
6725
|
+
});
|
|
6726
|
+
_context2.next = 5;
|
|
6727
|
+
return window.mainApi.workspace.saveWorkspaceForApplication(appId, updatedWorkspace);
|
|
6728
|
+
case 5:
|
|
6729
|
+
result = {
|
|
6730
|
+
success: true,
|
|
6731
|
+
workspace: updatedWorkspace
|
|
6732
|
+
};
|
|
6733
|
+
case 6:
|
|
6734
|
+
_context2.next = 15;
|
|
6735
|
+
break;
|
|
6736
|
+
case 7:
|
|
6737
|
+
// Build-your-own path: create layout from template + place widgets
|
|
6738
|
+
template = layoutTemplates.find(function (t) {
|
|
6739
|
+
return t.id === state.layout.templateKey;
|
|
6740
|
+
});
|
|
6741
|
+
if (template) {
|
|
6742
|
+
_context2.next = 8;
|
|
6743
|
+
break;
|
|
6744
|
+
}
|
|
6745
|
+
throw new Error("No layout template selected.");
|
|
6746
|
+
case 8:
|
|
6747
|
+
layoutObj = createLayoutFromTemplate(template, menuId || 1); // Place widgets into grid cells
|
|
6748
|
+
widgetOrder = state.layout.widgetOrder || [];
|
|
6749
|
+
cells = template.cells.filter(function (c) {
|
|
6750
|
+
return !c.hide;
|
|
6751
|
+
});
|
|
6752
|
+
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop(i) {
|
|
6753
|
+
var widget;
|
|
6754
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
6755
|
+
while (1) switch (_context.prev = _context.next) {
|
|
6756
|
+
case 0:
|
|
6757
|
+
widget = state.selectedWidgets.find(function (w) {
|
|
6758
|
+
return (w.name || w.key) === widgetOrder[i];
|
|
6759
|
+
});
|
|
6760
|
+
if (widget && layoutObj.grid[cells[i].key]) {
|
|
6761
|
+
layoutObj.grid[cells[i].key].component = widget.component || widget.name || widget.key;
|
|
6762
|
+
}
|
|
6763
|
+
case 1:
|
|
6764
|
+
case "end":
|
|
6765
|
+
return _context.stop();
|
|
6766
|
+
}
|
|
6767
|
+
}, _loop);
|
|
6768
|
+
});
|
|
6769
|
+
i = 0;
|
|
6770
|
+
case 9:
|
|
6771
|
+
if (!(i < widgetOrder.length && i < cells.length)) {
|
|
6772
|
+
_context2.next = 11;
|
|
6773
|
+
break;
|
|
6774
|
+
}
|
|
6775
|
+
return _context2.delegateYield(_loop(i), "t0", 10);
|
|
6776
|
+
case 10:
|
|
6777
|
+
i++;
|
|
6778
|
+
_context2.next = 9;
|
|
6779
|
+
break;
|
|
6780
|
+
case 11:
|
|
6781
|
+
if (!onCreateWorkspace) {
|
|
6782
|
+
_context2.next = 13;
|
|
6783
|
+
break;
|
|
6784
|
+
}
|
|
6785
|
+
_context2.next = 12;
|
|
6786
|
+
return onCreateWorkspace(layoutObj, theme, name.trim());
|
|
6787
|
+
case 12:
|
|
6788
|
+
result = _context2.sent;
|
|
6789
|
+
_context2.next = 15;
|
|
6790
|
+
break;
|
|
6791
|
+
case 13:
|
|
6792
|
+
if (!((_window$mainApi2 = window.mainApi) !== null && _window$mainApi2 !== void 0 && (_window$mainApi2 = _window$mainApi2.workspace) !== null && _window$mainApi2 !== void 0 && _window$mainApi2.saveWorkspaceForApplication)) {
|
|
6793
|
+
_context2.next = 15;
|
|
6794
|
+
break;
|
|
6795
|
+
}
|
|
6796
|
+
workspace = {
|
|
6797
|
+
name: name.trim(),
|
|
6798
|
+
menuId: menuId || 1,
|
|
6799
|
+
themeKey: theme,
|
|
6800
|
+
layout: [layoutObj]
|
|
6801
|
+
};
|
|
6802
|
+
_context2.next = 14;
|
|
6803
|
+
return window.mainApi.workspace.saveWorkspaceForApplication(appId, workspace);
|
|
6804
|
+
case 14:
|
|
6805
|
+
result = {
|
|
6806
|
+
success: true,
|
|
6807
|
+
workspace: workspace
|
|
6808
|
+
};
|
|
6809
|
+
case 15:
|
|
6810
|
+
if (result) {
|
|
6811
|
+
setCreatedDashboard(result.workspace || result);
|
|
6812
|
+
}
|
|
6813
|
+
_context2.next = 17;
|
|
6814
|
+
break;
|
|
6815
|
+
case 16:
|
|
6816
|
+
_context2.prev = 16;
|
|
6817
|
+
_t = _context2["catch"](1);
|
|
6818
|
+
setError(_t.message || "Failed to create dashboard.");
|
|
6819
|
+
case 17:
|
|
6820
|
+
_context2.prev = 17;
|
|
6821
|
+
setCreating(false);
|
|
6822
|
+
return _context2.finish(17);
|
|
6823
|
+
case 18:
|
|
6824
|
+
case "end":
|
|
6825
|
+
return _context2.stop();
|
|
6826
|
+
}
|
|
6827
|
+
}, _callee, null, [[1, 16, 17, 18]]);
|
|
6828
|
+
})), [state, isPrebuilt, onInstallDashboard, onCreateWorkspace, appId]);
|
|
6829
|
+
|
|
6830
|
+
// --- Success state ---
|
|
6831
|
+
if (createdDashboard) {
|
|
6832
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6833
|
+
className: "wizard-customize-step",
|
|
6834
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6835
|
+
className: "wizard-success",
|
|
6836
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6837
|
+
icon: "circle-check",
|
|
6838
|
+
className: "wizard-success-icon"
|
|
6839
|
+
}), /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
6840
|
+
className: "wizard-step-header",
|
|
6841
|
+
children: "Dashboard created!"
|
|
6842
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("p", {
|
|
6843
|
+
className: "wizard-step-description",
|
|
6844
|
+
children: ["Your dashboard", " ", /*#__PURE__*/jsxRuntime.jsx("strong", {
|
|
6845
|
+
children: createdDashboard.name || state.customization.name.trim()
|
|
6846
|
+
}), " ", "is ready."]
|
|
6847
|
+
}), onOpenDashboard && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
6848
|
+
onClick: function onClick() {
|
|
6849
|
+
return onOpenDashboard(createdDashboard);
|
|
6850
|
+
},
|
|
6851
|
+
title: "Open Dashboard",
|
|
6852
|
+
textSize: "text-base",
|
|
6853
|
+
padding: "py-2 px-6",
|
|
6854
|
+
backgroundColor: "bg-blue-600",
|
|
6855
|
+
textColor: "text-white",
|
|
6856
|
+
hoverTextColor: "hover:text-white",
|
|
6857
|
+
hoverBackgroundColor: "hover:bg-blue-500",
|
|
6858
|
+
icon: "arrow-right"
|
|
6859
|
+
})]
|
|
6860
|
+
})
|
|
6861
|
+
});
|
|
6862
|
+
}
|
|
6863
|
+
|
|
6864
|
+
// --- Provider setup summary ---
|
|
6865
|
+
var selectedProviders = (state.providers || []).map(function (provKey) {
|
|
6866
|
+
var prov = (providersMap === null || providersMap === void 0 ? void 0 : providersMap[provKey]) || {};
|
|
6867
|
+
return {
|
|
6868
|
+
key: provKey,
|
|
6869
|
+
name: prov.name || provKey,
|
|
6870
|
+
icon: prov.icon || "plug",
|
|
6871
|
+
configured: !!prov.configured
|
|
6872
|
+
};
|
|
6873
|
+
});
|
|
6874
|
+
var configuredProviders = selectedProviders.filter(function (p) {
|
|
6875
|
+
return p.configured;
|
|
6876
|
+
});
|
|
6877
|
+
var needsSetupProviders = selectedProviders.filter(function (p) {
|
|
6878
|
+
return !p.configured;
|
|
6879
|
+
});
|
|
6880
|
+
var selectedFolder = localMenuItems.find(function (item) {
|
|
6881
|
+
return item.id === state.customization.menuId;
|
|
6882
|
+
});
|
|
6883
|
+
var selectedTheme = themes && state.customization.theme ? themes[state.customization.theme] : null;
|
|
6884
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6885
|
+
className: "wizard-customize-step",
|
|
6886
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
6887
|
+
className: "wizard-step-header",
|
|
6888
|
+
children: "Customize your dashboard"
|
|
6889
|
+
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
6890
|
+
className: "wizard-step-description",
|
|
6891
|
+
children: "Name your dashboard, choose a folder, and pick a theme."
|
|
6892
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6893
|
+
className: "wizard-customize-sections",
|
|
6894
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6895
|
+
className: "wizard-customize-section",
|
|
6896
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
6897
|
+
className: "wizard-customize-label",
|
|
6898
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6899
|
+
icon: "input-text",
|
|
6900
|
+
fixedWidth: true,
|
|
6901
|
+
className: "wizard-customize-label-icon"
|
|
6902
|
+
}), "Dashboard Name"]
|
|
6903
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
6904
|
+
value: state.customization.name,
|
|
6905
|
+
onChange: handleNameChange,
|
|
6906
|
+
placeholder: "My Dashboard",
|
|
6907
|
+
autoFocus: true
|
|
6908
|
+
})]
|
|
6909
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6910
|
+
className: "wizard-customize-section",
|
|
6911
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
6912
|
+
className: "wizard-customize-label",
|
|
6913
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6914
|
+
icon: "folder",
|
|
6915
|
+
fixedWidth: true,
|
|
6916
|
+
className: "wizard-customize-label-icon"
|
|
6917
|
+
}), "Folder"]
|
|
6918
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6919
|
+
className: "wizard-customize-folder-list",
|
|
6920
|
+
children: [!isCreatingFolder ? /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
6921
|
+
type: "button",
|
|
6922
|
+
className: "wizard-customize-folder-create",
|
|
6923
|
+
onClick: function onClick() {
|
|
6924
|
+
return setIsCreatingFolder(true);
|
|
6925
|
+
},
|
|
6926
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6927
|
+
icon: "plus",
|
|
6928
|
+
fixedWidth: true
|
|
6929
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
6930
|
+
children: "New Folder"
|
|
6931
|
+
})]
|
|
6932
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6933
|
+
className: "wizard-customize-folder-form",
|
|
6934
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6935
|
+
className: "wizard-customize-folder-form-header",
|
|
6936
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
6937
|
+
className: "text-sm font-medium text-gray-300",
|
|
6938
|
+
children: "New Folder"
|
|
6939
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
6940
|
+
type: "button",
|
|
6941
|
+
className: "text-gray-500 hover:text-gray-300 transition-colors",
|
|
6942
|
+
onClick: handleCancelNewFolder,
|
|
6943
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6944
|
+
icon: "xmark"
|
|
6945
|
+
})
|
|
6946
|
+
})]
|
|
6947
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
6948
|
+
value: newFolderName,
|
|
6949
|
+
onChange: function onChange(val) {
|
|
6950
|
+
return setNewFolderName(val);
|
|
6951
|
+
},
|
|
6952
|
+
placeholder: "Folder name"
|
|
6953
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6954
|
+
className: "grid grid-cols-10 gap-2",
|
|
6955
|
+
children: FOLDER_ICONS.map(function (icon) {
|
|
6956
|
+
var isIconSelected = icon === newFolderIcon;
|
|
6957
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6958
|
+
className: "flex items-center justify-center p-2 rounded cursor-pointer transition-all ".concat(isIconSelected ? "bg-blue-600 ring-2 ring-blue-400 text-white" : "bg-gray-700 text-gray-400 hover:bg-gray-600 hover:text-gray-200"),
|
|
6959
|
+
onClick: function onClick() {
|
|
6960
|
+
return setNewFolderIcon(icon);
|
|
6961
|
+
},
|
|
6962
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6963
|
+
icon: icon
|
|
6964
|
+
})
|
|
6965
|
+
}, icon);
|
|
6966
|
+
})
|
|
6967
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
6968
|
+
onClick: handleSaveNewFolder,
|
|
6969
|
+
title: "Add Folder",
|
|
6970
|
+
textSize: "text-sm",
|
|
6971
|
+
padding: "py-1 px-3",
|
|
6972
|
+
backgroundColor: "bg-blue-600",
|
|
6973
|
+
textColor: "text-white",
|
|
6974
|
+
hoverTextColor: "hover:text-white",
|
|
6975
|
+
hoverBackgroundColor: "hover:bg-blue-500",
|
|
6976
|
+
disabled: !newFolderName.trim() || !newFolderIcon
|
|
6977
|
+
})]
|
|
6978
|
+
}), localMenuItems.map(function (item) {
|
|
6979
|
+
var isSelected = !isCreatingFolder && item.id === state.customization.menuId;
|
|
6980
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6981
|
+
className: "wizard-customize-folder-item ".concat(isSelected ? "wizard-customize-folder-item--selected" : ""),
|
|
6982
|
+
onClick: function onClick() {
|
|
6983
|
+
return handleMenuSelect(item.id);
|
|
6984
|
+
},
|
|
6985
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6986
|
+
icon: item.icon || item.folder || "folder",
|
|
6987
|
+
fixedWidth: true,
|
|
6988
|
+
className: "w-5 h-5 ".concat(isSelected ? "text-blue-400" : "text-gray-400")
|
|
6989
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
6990
|
+
className: "text-sm font-medium ".concat(isSelected ? "text-blue-300" : "text-gray-300"),
|
|
6991
|
+
children: item.name
|
|
6992
|
+
}), isSelected && /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6993
|
+
icon: "check",
|
|
6994
|
+
className: "ml-auto text-blue-400 text-sm"
|
|
6995
|
+
})]
|
|
6996
|
+
}, item.id);
|
|
6997
|
+
})]
|
|
6998
|
+
})]
|
|
6999
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7000
|
+
className: "wizard-customize-section",
|
|
7001
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
7002
|
+
className: "wizard-customize-label",
|
|
7003
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7004
|
+
icon: "palette",
|
|
7005
|
+
fixedWidth: true,
|
|
7006
|
+
className: "wizard-customize-label-icon"
|
|
7007
|
+
}), "Theme"]
|
|
7008
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7009
|
+
className: "wizard-customize-theme-list",
|
|
7010
|
+
children: themes && Object.entries(themes).sort(function (_ref7, _ref8) {
|
|
7011
|
+
var _ref9 = _slicedToArray(_ref7, 2),
|
|
7012
|
+
a = _ref9[1];
|
|
7013
|
+
var _ref0 = _slicedToArray(_ref8, 2),
|
|
7014
|
+
b = _ref0[1];
|
|
7015
|
+
return (a.name || "").localeCompare(b.name || "");
|
|
7016
|
+
}).map(function (_ref1) {
|
|
7017
|
+
var _ref10 = _slicedToArray(_ref1, 2),
|
|
7018
|
+
key = _ref10[0],
|
|
7019
|
+
t = _ref10[1];
|
|
7020
|
+
var isThemeSelected = state.customization.theme === key;
|
|
7021
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7022
|
+
className: "wizard-customize-theme-item ".concat(isThemeSelected ? "wizard-customize-theme-item--selected" : ""),
|
|
7023
|
+
onClick: function onClick() {
|
|
7024
|
+
return handleThemeSelect(key);
|
|
7025
|
+
},
|
|
7026
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7027
|
+
icon: "palette",
|
|
7028
|
+
className: "w-5 h-5 mr-3 ".concat(isThemeSelected ? "text-blue-400" : "text-gray-400")
|
|
7029
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7030
|
+
className: "text-sm font-medium ".concat(isThemeSelected ? "text-blue-300" : "text-gray-300"),
|
|
7031
|
+
children: t.name || key
|
|
7032
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7033
|
+
className: "flex flex-row space-x-1 ml-auto",
|
|
7034
|
+
children: [t.primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7035
|
+
className: "w-4 h-4 rounded bg-".concat(t.primary, "-500")
|
|
7036
|
+
}), t.secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7037
|
+
className: "w-4 h-4 rounded bg-".concat(t.secondary, "-500")
|
|
7038
|
+
}), t.tertiary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7039
|
+
className: "w-4 h-4 rounded bg-".concat(t.tertiary, "-500")
|
|
7040
|
+
})]
|
|
7041
|
+
})]
|
|
7042
|
+
}, key);
|
|
7043
|
+
})
|
|
7044
|
+
})]
|
|
7045
|
+
}), selectedProviders.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7046
|
+
className: "wizard-customize-section",
|
|
7047
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
7048
|
+
className: "wizard-customize-label",
|
|
7049
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7050
|
+
icon: "plug",
|
|
7051
|
+
fixedWidth: true,
|
|
7052
|
+
className: "wizard-customize-label-icon"
|
|
7053
|
+
}), "Provider Status"]
|
|
7054
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7055
|
+
className: "wizard-customize-provider-summary",
|
|
7056
|
+
children: [configuredProviders.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7057
|
+
className: "wizard-provider-group",
|
|
7058
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7059
|
+
className: "wizard-provider-group-label wizard-provider-group-label--ready",
|
|
7060
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7061
|
+
icon: "circle-check",
|
|
7062
|
+
className: "text-green-400"
|
|
7063
|
+
}), " ", "Ready (", configuredProviders.length, ")"]
|
|
7064
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7065
|
+
className: "wizard-provider-list",
|
|
7066
|
+
children: configuredProviders.map(function (p) {
|
|
7067
|
+
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7068
|
+
className: "wizard-provider-badge wizard-provider-badge--ready",
|
|
7069
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7070
|
+
icon: resolveIcon(p.icon),
|
|
7071
|
+
fixedWidth: true
|
|
7072
|
+
}), p.name]
|
|
7073
|
+
}, p.key);
|
|
7074
|
+
})
|
|
7075
|
+
})]
|
|
7076
|
+
}), needsSetupProviders.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7077
|
+
className: "wizard-provider-group",
|
|
7078
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7079
|
+
className: "wizard-provider-group-label wizard-provider-group-label--setup",
|
|
7080
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7081
|
+
icon: "circle-exclamation",
|
|
7082
|
+
className: "text-amber-400"
|
|
7083
|
+
}), " ", "Needs setup (", needsSetupProviders.length, ")"]
|
|
7084
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7085
|
+
className: "wizard-provider-list",
|
|
7086
|
+
children: needsSetupProviders.map(function (p) {
|
|
7087
|
+
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7088
|
+
className: "wizard-provider-badge wizard-provider-badge--setup",
|
|
7089
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7090
|
+
icon: resolveIcon(p.icon),
|
|
7091
|
+
fixedWidth: true
|
|
7092
|
+
}), p.name]
|
|
7093
|
+
}, p.key);
|
|
7094
|
+
})
|
|
7095
|
+
})]
|
|
7096
|
+
})]
|
|
7097
|
+
})]
|
|
7098
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7099
|
+
className: "wizard-customize-summary",
|
|
7100
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7101
|
+
className: "wizard-customize-summary-title",
|
|
7102
|
+
children: "Summary"
|
|
7103
|
+
}), state.customization.name.trim() && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7104
|
+
className: "wizard-customize-summary-row",
|
|
7105
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7106
|
+
icon: "clone",
|
|
7107
|
+
className: "text-blue-400"
|
|
7108
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7109
|
+
children: state.customization.name.trim()
|
|
7110
|
+
})]
|
|
7111
|
+
}), selectedFolder && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7112
|
+
className: "wizard-customize-summary-row",
|
|
7113
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7114
|
+
icon: selectedFolder.icon || selectedFolder.folder || "folder",
|
|
7115
|
+
className: "text-blue-400"
|
|
7116
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7117
|
+
children: selectedFolder.name
|
|
7118
|
+
})]
|
|
7119
|
+
}), selectedTheme && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7120
|
+
className: "wizard-customize-summary-row",
|
|
7121
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7122
|
+
icon: "palette",
|
|
7123
|
+
className: "text-blue-400"
|
|
7124
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7125
|
+
children: selectedTheme.name || state.customization.theme
|
|
7126
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7127
|
+
className: "flex flex-row space-x-1 ml-2",
|
|
7128
|
+
children: [selectedTheme.primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7129
|
+
className: "w-3 h-3 rounded bg-".concat(selectedTheme.primary, "-500")
|
|
7130
|
+
}), selectedTheme.secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7131
|
+
className: "w-3 h-3 rounded bg-".concat(selectedTheme.secondary, "-500")
|
|
7132
|
+
})]
|
|
7133
|
+
})]
|
|
7134
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7135
|
+
className: "wizard-customize-summary-row",
|
|
7136
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7137
|
+
icon: isPrebuilt ? "box" : "grid-2",
|
|
7138
|
+
className: "text-blue-400"
|
|
7139
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7140
|
+
children: isPrebuilt ? ((_state$selectedDashbo = state.selectedDashboard) === null || _state$selectedDashbo === void 0 ? void 0 : _state$selectedDashbo.displayName) || ((_state$selectedDashbo2 = state.selectedDashboard) === null || _state$selectedDashbo2 === void 0 ? void 0 : _state$selectedDashbo2.name) || "Pre-built dashboard" : "".concat(state.selectedWidgets.length, " widget").concat(state.selectedWidgets.length !== 1 ? "s" : "")
|
|
7141
|
+
})]
|
|
7142
|
+
})]
|
|
7143
|
+
}), error && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7144
|
+
className: "wizard-customize-error",
|
|
7145
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7146
|
+
icon: "triangle-exclamation",
|
|
7147
|
+
className: "text-red-400"
|
|
7148
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7149
|
+
children: error
|
|
7150
|
+
})]
|
|
7151
|
+
})]
|
|
7152
|
+
})]
|
|
7153
|
+
});
|
|
7154
|
+
};
|
|
7155
|
+
|
|
7156
|
+
var STEP_LABELS = [{
|
|
7157
|
+
label: "Intent",
|
|
7158
|
+
description: "Choose categories"
|
|
7159
|
+
}, {
|
|
7160
|
+
label: "Providers",
|
|
7161
|
+
description: "Select data sources"
|
|
7162
|
+
}, {
|
|
7163
|
+
label: "Browse",
|
|
7164
|
+
description: "Pick widgets or dashboards"
|
|
7165
|
+
}, {
|
|
7166
|
+
label: "Layout",
|
|
7167
|
+
description: "Arrange your widgets"
|
|
7168
|
+
}, {
|
|
7169
|
+
label: "Customize",
|
|
7170
|
+
description: "Name, folder & theme"
|
|
7171
|
+
}];
|
|
7172
|
+
|
|
7173
|
+
/**
|
|
7174
|
+
* DashboardWizardModal
|
|
7175
|
+
*
|
|
7176
|
+
* Top-level modal that hosts all wizard steps with a Stepper header.
|
|
7177
|
+
* Provides Back/Next/Create navigation with step-aware validation.
|
|
7178
|
+
* Resets wizard state cleanly on close.
|
|
7179
|
+
*/
|
|
7180
|
+
var DashboardWizardModal = function DashboardWizardModal(_ref) {
|
|
7181
|
+
var open = _ref.open,
|
|
7182
|
+
setIsOpen = _ref.setIsOpen,
|
|
7183
|
+
_ref$menuItems = _ref.menuItems,
|
|
7184
|
+
menuItems = _ref$menuItems === void 0 ? [] : _ref$menuItems,
|
|
7185
|
+
_ref$onSaveMenuItem = _ref.onSaveMenuItem,
|
|
7186
|
+
onSaveMenuItem = _ref$onSaveMenuItem === void 0 ? null : _ref$onSaveMenuItem,
|
|
7187
|
+
_ref$onCreateWorkspac = _ref.onCreateWorkspace,
|
|
7188
|
+
onCreateWorkspace = _ref$onCreateWorkspac === void 0 ? null : _ref$onCreateWorkspac,
|
|
7189
|
+
_ref$onInstallDashboa = _ref.onInstallDashboard,
|
|
7190
|
+
onInstallDashboard = _ref$onInstallDashboa === void 0 ? null : _ref$onInstallDashboa,
|
|
7191
|
+
_ref$onOpenDashboard = _ref.onOpenDashboard,
|
|
7192
|
+
_onOpenDashboard = _ref$onOpenDashboard === void 0 ? null : _ref$onOpenDashboard,
|
|
7193
|
+
_ref$onReloadWorkspac = _ref.onReloadWorkspaces,
|
|
7194
|
+
onReloadWorkspaces = _ref$onReloadWorkspac === void 0 ? null : _ref$onReloadWorkspac,
|
|
7195
|
+
appId = _ref.appId;
|
|
7196
|
+
var _useWizardState = useWizardState(),
|
|
7197
|
+
state = _useWizardState.state,
|
|
7198
|
+
dispatch = _useWizardState.dispatch,
|
|
7199
|
+
nextStep = _useWizardState.nextStep,
|
|
7200
|
+
prevStep = _useWizardState.prevStep,
|
|
7201
|
+
goToStep = _useWizardState.goToStep,
|
|
7202
|
+
canProceed = _useWizardState.canProceed,
|
|
7203
|
+
isPrebuiltPath = _useWizardState.isPrebuiltPath;
|
|
7204
|
+
|
|
7205
|
+
// Reset wizard state when modal opens
|
|
7206
|
+
React.useEffect(function () {
|
|
7207
|
+
if (open) {
|
|
7208
|
+
dispatch({
|
|
7209
|
+
type: "RESET"
|
|
7210
|
+
});
|
|
7211
|
+
}
|
|
7212
|
+
}, [open, dispatch]);
|
|
7213
|
+
function handleClose() {
|
|
7214
|
+
setIsOpen(false);
|
|
7215
|
+
}
|
|
7216
|
+
var handleStepChange = React.useCallback(function (newStep) {
|
|
7217
|
+
// Stepper only allows going backwards; forward is via Next button
|
|
7218
|
+
if (newStep < state.step) {
|
|
7219
|
+
goToStep(newStep);
|
|
7220
|
+
}
|
|
7221
|
+
}, [state.step, goToStep]);
|
|
7222
|
+
|
|
7223
|
+
// Skip layout step for prebuilt path
|
|
7224
|
+
var handleNext = React.useCallback(function () {
|
|
7225
|
+
if (!canProceed) return;
|
|
7226
|
+
if (state.step === 2 && isPrebuiltPath) {
|
|
7227
|
+
// Skip layout step (3), go straight to customize (4)
|
|
7228
|
+
goToStep(4);
|
|
7229
|
+
} else {
|
|
7230
|
+
nextStep();
|
|
7231
|
+
}
|
|
7232
|
+
}, [canProceed, state.step, isPrebuiltPath, goToStep, nextStep]);
|
|
7233
|
+
var handleBack = React.useCallback(function () {
|
|
7234
|
+
if (state.step === 4 && isPrebuiltPath) {
|
|
7235
|
+
// Skip back over layout step (3), go to browse (2)
|
|
7236
|
+
goToStep(2);
|
|
7237
|
+
} else {
|
|
7238
|
+
prevStep();
|
|
7239
|
+
}
|
|
7240
|
+
}, [state.step, isPrebuiltPath, goToStep, prevStep]);
|
|
7241
|
+
var isLastStep = state.step === 4;
|
|
7242
|
+
state.step === 4 && state._created;
|
|
7243
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Modal, {
|
|
7244
|
+
isOpen: open,
|
|
7245
|
+
setIsOpen: setIsOpen,
|
|
7246
|
+
width: "w-5/6",
|
|
7247
|
+
height: "h-5/6",
|
|
7248
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7249
|
+
className: "flex flex-col h-full bg-gray-900 rounded-lg overflow-hidden",
|
|
7250
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7251
|
+
className: "flex items-center justify-between px-6 pt-5 pb-0",
|
|
7252
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("h2", {
|
|
7253
|
+
className: "text-lg font-semibold text-gray-200",
|
|
7254
|
+
children: "Dashboard Wizard"
|
|
7255
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
7256
|
+
type: "button",
|
|
7257
|
+
onClick: handleClose,
|
|
7258
|
+
className: "text-gray-500 hover:text-gray-300 transition-colors",
|
|
7259
|
+
children: /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
7260
|
+
className: "h-5 w-5",
|
|
7261
|
+
fill: "none",
|
|
7262
|
+
viewBox: "0 0 24 24",
|
|
7263
|
+
stroke: "currentColor",
|
|
7264
|
+
strokeWidth: 2,
|
|
7265
|
+
children: /*#__PURE__*/jsxRuntime.jsx("path", {
|
|
7266
|
+
strokeLinecap: "round",
|
|
7267
|
+
strokeLinejoin: "round",
|
|
7268
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
7269
|
+
})
|
|
7270
|
+
})
|
|
7271
|
+
})]
|
|
7272
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7273
|
+
className: "flex flex-col flex-1 min-h-0 px-6 py-4",
|
|
7274
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs(DashReact.Stepper, {
|
|
7275
|
+
activeStep: state.step,
|
|
7276
|
+
onStepChange: handleStepChange,
|
|
7277
|
+
showNavigation: false,
|
|
7278
|
+
className: "flex-1 min-h-0",
|
|
7279
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
7280
|
+
label: STEP_LABELS[0].label,
|
|
7281
|
+
description: STEP_LABELS[0].description,
|
|
7282
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7283
|
+
className: "flex-1 min-h-0 overflow-y-auto",
|
|
7284
|
+
children: /*#__PURE__*/jsxRuntime.jsx(WizardIntentStep, {
|
|
7285
|
+
state: state,
|
|
7286
|
+
dispatch: dispatch
|
|
7287
|
+
})
|
|
7288
|
+
})
|
|
7289
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
7290
|
+
label: STEP_LABELS[1].label,
|
|
7291
|
+
description: STEP_LABELS[1].description,
|
|
7292
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7293
|
+
className: "flex-1 min-h-0 overflow-y-auto",
|
|
7294
|
+
children: /*#__PURE__*/jsxRuntime.jsx(WizardProvidersStep, {
|
|
7295
|
+
state: state,
|
|
7296
|
+
dispatch: dispatch
|
|
7297
|
+
})
|
|
7298
|
+
})
|
|
7299
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
7300
|
+
label: STEP_LABELS[2].label,
|
|
7301
|
+
description: STEP_LABELS[2].description,
|
|
7302
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7303
|
+
className: "flex-1 min-h-0 overflow-y-auto",
|
|
7304
|
+
children: /*#__PURE__*/jsxRuntime.jsx(WizardResultsStep, {
|
|
7305
|
+
state: state,
|
|
7306
|
+
dispatch: dispatch
|
|
7307
|
+
})
|
|
7308
|
+
})
|
|
7309
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
7310
|
+
label: STEP_LABELS[3].label,
|
|
7311
|
+
description: STEP_LABELS[3].description,
|
|
7312
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7313
|
+
className: "flex-1 min-h-0 overflow-y-auto",
|
|
7314
|
+
children: /*#__PURE__*/jsxRuntime.jsx(WizardLayoutPreviewStep, {
|
|
7315
|
+
state: state,
|
|
7316
|
+
dispatch: dispatch
|
|
7317
|
+
})
|
|
7318
|
+
})
|
|
7319
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
|
|
7320
|
+
label: STEP_LABELS[4].label,
|
|
7321
|
+
description: STEP_LABELS[4].description,
|
|
7322
|
+
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7323
|
+
className: "flex-1 min-h-0 overflow-y-auto",
|
|
7324
|
+
children: /*#__PURE__*/jsxRuntime.jsx(WizardCustomizeStep, {
|
|
7325
|
+
state: state,
|
|
7326
|
+
dispatch: dispatch,
|
|
7327
|
+
menuItems: menuItems,
|
|
7328
|
+
onSaveMenuItem: onSaveMenuItem,
|
|
7329
|
+
onCreateWorkspace: onCreateWorkspace,
|
|
7330
|
+
onInstallDashboard: onInstallDashboard,
|
|
7331
|
+
onOpenDashboard: function onOpenDashboard(ws) {
|
|
7332
|
+
handleClose();
|
|
7333
|
+
if (_onOpenDashboard) _onOpenDashboard(ws);
|
|
7334
|
+
if (onReloadWorkspaces) onReloadWorkspaces();
|
|
7335
|
+
},
|
|
7336
|
+
appId: appId
|
|
7337
|
+
})
|
|
7338
|
+
})
|
|
7339
|
+
})]
|
|
7340
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7341
|
+
className: "flex flex-row justify-between items-center pt-4 mt-4 border-t border-gray-700/50",
|
|
7342
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
7343
|
+
onClick: state.step === 0 ? handleClose : handleBack,
|
|
7344
|
+
title: state.step === 0 ? "Cancel" : "Back",
|
|
7345
|
+
textSize: "text-sm",
|
|
7346
|
+
padding: "py-2 px-4",
|
|
7347
|
+
backgroundColor: "bg-gray-700",
|
|
7348
|
+
textColor: "text-gray-300",
|
|
7349
|
+
hoverTextColor: "hover:text-white",
|
|
7350
|
+
hoverBackgroundColor: "hover:bg-gray-600"
|
|
7351
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7352
|
+
className: "text-xs text-gray-500",
|
|
7353
|
+
children: ["Step ", state.step + 1, " of ", STEP_LABELS.length]
|
|
7354
|
+
}), !isLastStep ? /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
7355
|
+
onClick: handleNext,
|
|
7356
|
+
title: "Next",
|
|
7357
|
+
textSize: "text-sm",
|
|
7358
|
+
padding: "py-2 px-4",
|
|
7359
|
+
backgroundColor: canProceed ? "bg-blue-600" : "bg-gray-700",
|
|
7360
|
+
textColor: canProceed ? "text-white" : "text-gray-500",
|
|
7361
|
+
hoverTextColor: canProceed ? "hover:text-white" : "hover:text-gray-500",
|
|
7362
|
+
hoverBackgroundColor: canProceed ? "hover:bg-blue-500" : "hover:bg-gray-700",
|
|
7363
|
+
disabled: !canProceed,
|
|
7364
|
+
icon: "arrow-right"
|
|
7365
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("div", {})]
|
|
7366
|
+
})]
|
|
7367
|
+
})]
|
|
7368
|
+
})
|
|
7369
|
+
});
|
|
7370
|
+
};
|
|
7371
|
+
|
|
6528
7372
|
var LayoutBuilderAddItemModal = function LayoutBuilderAddItemModal(_ref) {
|
|
6529
7373
|
var workspace = _ref.workspace,
|
|
6530
7374
|
open = _ref.open,
|
|
@@ -36850,7 +37694,9 @@ var DashboardsSection = function DashboardsSection(_ref) {
|
|
|
36850
37694
|
_ref$createRequested = _ref.createRequested,
|
|
36851
37695
|
createRequested = _ref$createRequested === void 0 ? false : _ref$createRequested,
|
|
36852
37696
|
_ref$onCreateAcknowle = _ref.onCreateAcknowledged,
|
|
36853
|
-
onCreateAcknowledged = _ref$onCreateAcknowle === void 0 ? null : _ref$onCreateAcknowle
|
|
37697
|
+
onCreateAcknowledged = _ref$onCreateAcknowle === void 0 ? null : _ref$onCreateAcknowle,
|
|
37698
|
+
_ref$onOpenWizard = _ref.onOpenWizard,
|
|
37699
|
+
onOpenWizard = _ref$onOpenWizard === void 0 ? null : _ref$onOpenWizard;
|
|
36854
37700
|
var _useState = React.useState(null),
|
|
36855
37701
|
_useState2 = _slicedToArray(_useState, 2),
|
|
36856
37702
|
selectedId = _useState2[0],
|
|
@@ -37062,6 +37908,14 @@ var DashboardsSection = function DashboardsSection(_ref) {
|
|
|
37062
37908
|
value: "marketplace",
|
|
37063
37909
|
className: "flex-1",
|
|
37064
37910
|
children: "Marketplace"
|
|
37911
|
+
}), onOpenWizard && /*#__PURE__*/jsxRuntime.jsx(DashReact.Tabs3.Trigger, {
|
|
37912
|
+
value: "wizard",
|
|
37913
|
+
className: "flex-1",
|
|
37914
|
+
onClick: function onClick(e) {
|
|
37915
|
+
e.preventDefault();
|
|
37916
|
+
onOpenWizard();
|
|
37917
|
+
},
|
|
37918
|
+
children: "Wizard"
|
|
37065
37919
|
})]
|
|
37066
37920
|
})
|
|
37067
37921
|
})]
|
|
@@ -44994,7 +45848,9 @@ var AppSettingsModal = function AppSettingsModal(_ref) {
|
|
|
44994
45848
|
_ref$onSignOut = _ref.onSignOut,
|
|
44995
45849
|
onSignOut = _ref$onSignOut === void 0 ? null : _ref$onSignOut,
|
|
44996
45850
|
_ref$onProfileUpdated = _ref.onProfileUpdated,
|
|
44997
|
-
onProfileUpdated = _ref$onProfileUpdated === void 0 ? null : _ref$onProfileUpdated
|
|
45851
|
+
onProfileUpdated = _ref$onProfileUpdated === void 0 ? null : _ref$onProfileUpdated,
|
|
45852
|
+
_ref$onOpenWizard = _ref.onOpenWizard,
|
|
45853
|
+
onOpenWizard = _ref$onOpenWizard === void 0 ? null : _ref$onOpenWizard;
|
|
44998
45854
|
var _useState = React.useState(initialSection),
|
|
44999
45855
|
_useState2 = _slicedToArray(_useState, 2),
|
|
45000
45856
|
activeSection = _useState2[0],
|
|
@@ -45079,7 +45935,11 @@ var AppSettingsModal = function AppSettingsModal(_ref) {
|
|
|
45079
45935
|
onCreateAcknowledged: function onCreateAcknowledged() {
|
|
45080
45936
|
return setCreateRequested(false);
|
|
45081
45937
|
},
|
|
45082
|
-
onOpenWorkspace: onOpenWorkspace
|
|
45938
|
+
onOpenWorkspace: onOpenWorkspace,
|
|
45939
|
+
onOpenWizard: onOpenWizard ? function () {
|
|
45940
|
+
setIsOpen(false);
|
|
45941
|
+
onOpenWizard();
|
|
45942
|
+
} : null
|
|
45083
45943
|
}), activeSection === "folders" && /*#__PURE__*/jsxRuntime.jsx(FoldersSection, {
|
|
45084
45944
|
menuItems: menuItems,
|
|
45085
45945
|
workspaces: workspaces,
|
|
@@ -45283,6 +46143,8 @@ var DashCommandPalette = function DashCommandPalette(_ref) {
|
|
|
45283
46143
|
onCreateNewFolder = _ref$onCreateNewFolde === void 0 ? null : _ref$onCreateNewFolde,
|
|
45284
46144
|
_ref$onLoadDashboard = _ref.onLoadDashboard,
|
|
45285
46145
|
onLoadDashboard = _ref$onLoadDashboard === void 0 ? null : _ref$onLoadDashboard,
|
|
46146
|
+
_ref$onOpenWizard = _ref.onOpenWizard,
|
|
46147
|
+
onOpenWizard = _ref$onOpenWizard === void 0 ? null : _ref$onOpenWizard,
|
|
45286
46148
|
_ref$onChangeTheme = _ref.onChangeTheme,
|
|
45287
46149
|
onChangeTheme = _ref$onChangeTheme === void 0 ? null : _ref$onChangeTheme,
|
|
45288
46150
|
_ref$onOpenThemeManag = _ref.onOpenThemeManager,
|
|
@@ -45353,6 +46215,13 @@ var DashCommandPalette = function DashCommandPalette(_ref) {
|
|
|
45353
46215
|
action: function action() {
|
|
45354
46216
|
return onCreateNewFolder && onCreateNewFolder();
|
|
45355
46217
|
}
|
|
46218
|
+
}, matchesQuery("Dashboard Wizard") && {
|
|
46219
|
+
key: "dashboard-wizard",
|
|
46220
|
+
label: "Dashboard Wizard",
|
|
46221
|
+
icon: "wand-magic-sparkles",
|
|
46222
|
+
action: function action() {
|
|
46223
|
+
return onOpenWizard && onOpenWizard();
|
|
46224
|
+
}
|
|
45356
46225
|
}].filter(Boolean);
|
|
45357
46226
|
var showDashboards = dashboardItems.length > 0 || dashboardActions.length > 0;
|
|
45358
46227
|
|
|
@@ -46859,24 +47728,28 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
46859
47728
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
46860
47729
|
isLayoutPickerOpen = _useState32[0],
|
|
46861
47730
|
setIsLayoutPickerOpen = _useState32[1];
|
|
46862
|
-
|
|
46863
|
-
// Unified App Settings Modal
|
|
46864
47731
|
var _useState33 = React.useState(false),
|
|
46865
47732
|
_useState34 = _slicedToArray(_useState33, 2),
|
|
46866
|
-
|
|
46867
|
-
|
|
46868
|
-
|
|
47733
|
+
isWizardOpen = _useState34[0],
|
|
47734
|
+
setIsWizardOpen = _useState34[1];
|
|
47735
|
+
|
|
47736
|
+
// Unified App Settings Modal
|
|
47737
|
+
var _useState35 = React.useState(false),
|
|
46869
47738
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
46870
|
-
|
|
46871
|
-
|
|
46872
|
-
var _useState37 = React.useState(
|
|
47739
|
+
isAppSettingsOpen = _useState36[0],
|
|
47740
|
+
setIsAppSettingsOpen = _useState36[1];
|
|
47741
|
+
var _useState37 = React.useState("dashboards"),
|
|
46873
47742
|
_useState38 = _slicedToArray(_useState37, 2),
|
|
46874
|
-
|
|
46875
|
-
|
|
46876
|
-
var _useState39 = React.useState(
|
|
47743
|
+
appSettingsInitialSection = _useState38[0],
|
|
47744
|
+
setAppSettingsInitialSection = _useState38[1];
|
|
47745
|
+
var _useState39 = React.useState(null),
|
|
46877
47746
|
_useState40 = _slicedToArray(_useState39, 2),
|
|
46878
|
-
|
|
46879
|
-
|
|
47747
|
+
appSettingsInitialProvider = _useState40[0],
|
|
47748
|
+
setAppSettingsInitialProvider = _useState40[1];
|
|
47749
|
+
var _useState41 = React.useState(false),
|
|
47750
|
+
_useState42 = _slicedToArray(_useState41, 2),
|
|
47751
|
+
appSettingsCreateProvider = _useState42[0],
|
|
47752
|
+
setAppSettingsCreateProvider = _useState42[1];
|
|
46880
47753
|
function openAppSettings() {
|
|
46881
47754
|
var section = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "general";
|
|
46882
47755
|
var providerName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
@@ -47653,6 +48526,13 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
47653
48526
|
text: "New Dashboard",
|
|
47654
48527
|
onClick: handleClickNewFromEmpty,
|
|
47655
48528
|
size: "sm"
|
|
48529
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.ButtonIcon, {
|
|
48530
|
+
icon: "wand-magic-sparkles",
|
|
48531
|
+
text: "Wizard",
|
|
48532
|
+
onClick: function onClick() {
|
|
48533
|
+
return setIsWizardOpen(true);
|
|
48534
|
+
},
|
|
48535
|
+
size: "sm"
|
|
47656
48536
|
})]
|
|
47657
48537
|
})
|
|
47658
48538
|
})
|
|
@@ -47692,7 +48572,10 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
47692
48572
|
authProfile: authProfile,
|
|
47693
48573
|
onSignIn: handleSidebarSignIn,
|
|
47694
48574
|
onSignOut: handleSidebarSignOut,
|
|
47695
|
-
onProfileUpdated: handleProfileUpdated
|
|
48575
|
+
onProfileUpdated: handleProfileUpdated,
|
|
48576
|
+
onOpenWizard: function onOpenWizard() {
|
|
48577
|
+
return setIsWizardOpen(true);
|
|
48578
|
+
}
|
|
47696
48579
|
}), /*#__PURE__*/jsxRuntime.jsx(ThemeManagerModal, {
|
|
47697
48580
|
open: isThemeManagerOpen,
|
|
47698
48581
|
setIsOpen: function setIsOpen() {
|
|
@@ -47720,7 +48603,19 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
47720
48603
|
onSaveMenuItem: handleSaveNewMenuItem,
|
|
47721
48604
|
appId: credentials === null || credentials === void 0 ? void 0 : credentials.appId,
|
|
47722
48605
|
onReloadWorkspaces: loadWorkspaces,
|
|
47723
|
-
onOpenWorkspace: handleOpenTab
|
|
48606
|
+
onOpenWorkspace: handleOpenTab,
|
|
48607
|
+
onOpenWizard: function onOpenWizard() {
|
|
48608
|
+
return setIsWizardOpen(true);
|
|
48609
|
+
}
|
|
48610
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashboardWizardModal, {
|
|
48611
|
+
open: isWizardOpen,
|
|
48612
|
+
setIsOpen: setIsWizardOpen,
|
|
48613
|
+
menuItems: menuItems,
|
|
48614
|
+
onSaveMenuItem: handleSaveNewMenuItem,
|
|
48615
|
+
onCreateWorkspace: handleCreateFromTemplate,
|
|
48616
|
+
onOpenDashboard: handleOpenTab,
|
|
48617
|
+
onReloadWorkspaces: loadWorkspaces,
|
|
48618
|
+
appId: credentials === null || credentials === void 0 ? void 0 : credentials.appId
|
|
47724
48619
|
})]
|
|
47725
48620
|
})]
|
|
47726
48621
|
}), !popout && /*#__PURE__*/jsxRuntime.jsx(DashCommandPalette, {
|
|
@@ -47759,6 +48654,9 @@ var DashboardStageInner = function DashboardStageInner(_ref2) {
|
|
|
47759
48654
|
},
|
|
47760
48655
|
onOpenDiscover: function onOpenDiscover() {
|
|
47761
48656
|
return openAppSettings("widgets");
|
|
48657
|
+
},
|
|
48658
|
+
onOpenWizard: function onOpenWizard() {
|
|
48659
|
+
return setIsWizardOpen(true);
|
|
47762
48660
|
}
|
|
47763
48661
|
})]
|
|
47764
48662
|
});
|
|
@@ -49195,6 +50093,7 @@ exports.DashboardMonitor = DashboardMonitor;
|
|
|
49195
50093
|
exports.DashboardPublisher = DashboardPublisher;
|
|
49196
50094
|
exports.DashboardStage = DashboardStage;
|
|
49197
50095
|
exports.DashboardThemeProvider = DashboardThemeProvider;
|
|
50096
|
+
exports.DashboardWizardModal = DashboardWizardModal;
|
|
49198
50097
|
exports.DashboardWrapper = DashboardWrapper;
|
|
49199
50098
|
exports.ElectronDashboardApi = ElectronDashboardApi;
|
|
49200
50099
|
exports.ErrorBoundary = ErrorBoundary;
|
|
@@ -49335,6 +50234,7 @@ exports.WidgetFactory = WidgetFactory;
|
|
|
49335
50234
|
exports.WidgetPopoutStage = WidgetPopoutStage;
|
|
49336
50235
|
exports.WidgetProviderWrapper = WidgetProviderWrapper;
|
|
49337
50236
|
exports.WidgetSidebar = WidgetSidebar;
|
|
50237
|
+
exports.WizardCustomizeStep = WizardCustomizeStep;
|
|
49338
50238
|
exports.WizardIntentStep = WizardIntentStep;
|
|
49339
50239
|
exports.WizardLayoutPreviewStep = WizardLayoutPreviewStep;
|
|
49340
50240
|
exports.WizardProvidersStep = WizardProvidersStep;
|