@trops/dash-core 0.1.190 → 0.1.191
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 +647 -33
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +647 -32
- 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 ? {
|
|
@@ -4068,8 +4068,8 @@ var DiscoverDashboardsDetail = function DiscoverDashboardsDetail(_ref) {
|
|
|
4068
4068
|
});
|
|
4069
4069
|
};
|
|
4070
4070
|
|
|
4071
|
-
function ownKeys$
|
|
4072
|
-
function _objectSpread$
|
|
4071
|
+
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; }
|
|
4072
|
+
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
4073
|
var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
4074
4074
|
var open = _ref.open,
|
|
4075
4075
|
setIsOpen = _ref.setIsOpen,
|
|
@@ -4305,7 +4305,7 @@ var LayoutManagerModal = function LayoutManagerModal(_ref) {
|
|
|
4305
4305
|
}
|
|
4306
4306
|
return _context2.abrupt("return");
|
|
4307
4307
|
case 6:
|
|
4308
|
-
updatedWorkspace = _objectSpread$
|
|
4308
|
+
updatedWorkspace = _objectSpread$C(_objectSpread$C({}, importedWorkspace), {}, {
|
|
4309
4309
|
name: dashboardName.trim(),
|
|
4310
4310
|
menuId: menuId,
|
|
4311
4311
|
themeKey: selectedThemeKey
|
|
@@ -6091,8 +6091,8 @@ var WidgetList = function WidgetList(_ref4) {
|
|
|
6091
6091
|
});
|
|
6092
6092
|
};
|
|
6093
6093
|
|
|
6094
|
-
function ownKeys$
|
|
6095
|
-
function _objectSpread$
|
|
6094
|
+
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; }
|
|
6095
|
+
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
6096
|
var TOTAL_STEPS = 6; // Steps 0-5
|
|
6097
6097
|
|
|
6098
6098
|
var initialState = {
|
|
@@ -6115,11 +6115,11 @@ var initialState = {
|
|
|
6115
6115
|
function wizardReducer(state, action) {
|
|
6116
6116
|
switch (action.type) {
|
|
6117
6117
|
case "SET_STEP":
|
|
6118
|
-
return _objectSpread$
|
|
6118
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6119
6119
|
step: action.payload
|
|
6120
6120
|
});
|
|
6121
6121
|
case "SET_INTENT":
|
|
6122
|
-
return _objectSpread$
|
|
6122
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6123
6123
|
intent: action.payload
|
|
6124
6124
|
});
|
|
6125
6125
|
case "TOGGLE_INTENT":
|
|
@@ -6127,12 +6127,12 @@ function wizardReducer(state, action) {
|
|
|
6127
6127
|
var intent = state.intent.includes(action.payload) ? state.intent.filter(function (i) {
|
|
6128
6128
|
return i !== action.payload;
|
|
6129
6129
|
}) : [].concat(_toConsumableArray(state.intent), [action.payload]);
|
|
6130
|
-
return _objectSpread$
|
|
6130
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6131
6131
|
intent: intent
|
|
6132
6132
|
});
|
|
6133
6133
|
}
|
|
6134
6134
|
case "SET_PROVIDERS":
|
|
6135
|
-
return _objectSpread$
|
|
6135
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6136
6136
|
providers: action.payload
|
|
6137
6137
|
});
|
|
6138
6138
|
case "TOGGLE_PROVIDER":
|
|
@@ -6140,12 +6140,12 @@ function wizardReducer(state, action) {
|
|
|
6140
6140
|
var providers = state.providers.includes(action.payload) ? state.providers.filter(function (p) {
|
|
6141
6141
|
return p !== action.payload;
|
|
6142
6142
|
}) : [].concat(_toConsumableArray(state.providers), [action.payload]);
|
|
6143
|
-
return _objectSpread$
|
|
6143
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6144
6144
|
providers: providers
|
|
6145
6145
|
});
|
|
6146
6146
|
}
|
|
6147
6147
|
case "SET_SELECTED_WIDGETS":
|
|
6148
|
-
return _objectSpread$
|
|
6148
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6149
6149
|
selectedWidgets: action.payload
|
|
6150
6150
|
});
|
|
6151
6151
|
case "TOGGLE_WIDGET":
|
|
@@ -6156,34 +6156,34 @@ function wizardReducer(state, action) {
|
|
|
6156
6156
|
var selectedWidgets = exists ? state.selectedWidgets.filter(function (w) {
|
|
6157
6157
|
return w.name !== action.payload.name;
|
|
6158
6158
|
}) : [].concat(_toConsumableArray(state.selectedWidgets), [action.payload]);
|
|
6159
|
-
return _objectSpread$
|
|
6159
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6160
6160
|
selectedWidgets: selectedWidgets
|
|
6161
6161
|
});
|
|
6162
6162
|
}
|
|
6163
6163
|
case "SET_SELECTED_DASHBOARD":
|
|
6164
|
-
return _objectSpread$
|
|
6164
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6165
6165
|
selectedDashboard: action.payload
|
|
6166
6166
|
});
|
|
6167
6167
|
case "SET_PATH":
|
|
6168
|
-
return _objectSpread$
|
|
6168
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6169
6169
|
path: action.payload
|
|
6170
6170
|
});
|
|
6171
6171
|
case "SET_LAYOUT":
|
|
6172
|
-
return _objectSpread$
|
|
6172
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6173
6173
|
layout: action.payload
|
|
6174
6174
|
});
|
|
6175
6175
|
case "REORDER_WIDGETS":
|
|
6176
|
-
return _objectSpread$
|
|
6177
|
-
layout: _objectSpread$
|
|
6176
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6177
|
+
layout: _objectSpread$B(_objectSpread$B({}, state.layout), {}, {
|
|
6178
6178
|
widgetOrder: action.payload
|
|
6179
6179
|
})
|
|
6180
6180
|
});
|
|
6181
6181
|
case "SET_CUSTOMIZATION":
|
|
6182
|
-
return _objectSpread$
|
|
6183
|
-
customization: _objectSpread$
|
|
6182
|
+
return _objectSpread$B(_objectSpread$B({}, state), {}, {
|
|
6183
|
+
customization: _objectSpread$B(_objectSpread$B({}, state.customization), action.payload)
|
|
6184
6184
|
});
|
|
6185
6185
|
case "RESET":
|
|
6186
|
-
return _objectSpread$
|
|
6186
|
+
return _objectSpread$B({}, initialState);
|
|
6187
6187
|
default:
|
|
6188
6188
|
return state;
|
|
6189
6189
|
}
|
|
@@ -6525,6 +6525,620 @@ var LayoutGrid = function LayoutGrid(_ref3) {
|
|
|
6525
6525
|
});
|
|
6526
6526
|
};
|
|
6527
6527
|
|
|
6528
|
+
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; }
|
|
6529
|
+
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; }
|
|
6530
|
+
var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
6531
|
+
var _state$selectedDashbo, _state$selectedDashbo2;
|
|
6532
|
+
var state = _ref.state,
|
|
6533
|
+
dispatch = _ref.dispatch,
|
|
6534
|
+
_ref$menuItems = _ref.menuItems,
|
|
6535
|
+
menuItems = _ref$menuItems === void 0 ? [] : _ref$menuItems,
|
|
6536
|
+
_ref$onSaveMenuItem = _ref.onSaveMenuItem,
|
|
6537
|
+
onSaveMenuItem = _ref$onSaveMenuItem === void 0 ? null : _ref$onSaveMenuItem,
|
|
6538
|
+
_ref$onCreateWorkspac = _ref.onCreateWorkspace,
|
|
6539
|
+
onCreateWorkspace = _ref$onCreateWorkspac === void 0 ? null : _ref$onCreateWorkspac,
|
|
6540
|
+
_ref$onInstallDashboa = _ref.onInstallDashboard,
|
|
6541
|
+
onInstallDashboard = _ref$onInstallDashboa === void 0 ? null : _ref$onInstallDashboa,
|
|
6542
|
+
_ref$onOpenDashboard = _ref.onOpenDashboard,
|
|
6543
|
+
onOpenDashboard = _ref$onOpenDashboard === void 0 ? null : _ref$onOpenDashboard,
|
|
6544
|
+
appId = _ref.appId;
|
|
6545
|
+
var _useContext = React.useContext(DashReact.ThemeContext),
|
|
6546
|
+
themes = _useContext.themes,
|
|
6547
|
+
appThemeKey = _useContext.themeKey;
|
|
6548
|
+
var _useContext2 = React.useContext(AppContext),
|
|
6549
|
+
providersMap = _useContext2.providers;
|
|
6550
|
+
var _useState = React.useState(menuItems),
|
|
6551
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
6552
|
+
localMenuItems = _useState2[0],
|
|
6553
|
+
setLocalMenuItems = _useState2[1];
|
|
6554
|
+
var _useState3 = React.useState(false),
|
|
6555
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
6556
|
+
isCreatingFolder = _useState4[0],
|
|
6557
|
+
setIsCreatingFolder = _useState4[1];
|
|
6558
|
+
var _useState5 = React.useState(""),
|
|
6559
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
6560
|
+
newFolderName = _useState6[0],
|
|
6561
|
+
setNewFolderName = _useState6[1];
|
|
6562
|
+
var _useState7 = React.useState(null),
|
|
6563
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
6564
|
+
newFolderIcon = _useState8[0],
|
|
6565
|
+
setNewFolderIcon = _useState8[1];
|
|
6566
|
+
|
|
6567
|
+
// Creation state
|
|
6568
|
+
var _useState9 = React.useState(false),
|
|
6569
|
+
_useState0 = _slicedToArray(_useState9, 2);
|
|
6570
|
+
_useState0[0];
|
|
6571
|
+
var setCreating = _useState0[1];
|
|
6572
|
+
var _useState1 = React.useState(null),
|
|
6573
|
+
_useState10 = _slicedToArray(_useState1, 2),
|
|
6574
|
+
error = _useState10[0],
|
|
6575
|
+
setError = _useState10[1];
|
|
6576
|
+
var _useState11 = React.useState(null),
|
|
6577
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
6578
|
+
createdDashboard = _useState12[0],
|
|
6579
|
+
setCreatedDashboard = _useState12[1];
|
|
6580
|
+
var isPrebuilt = state.path === "prebuilt";
|
|
6581
|
+
|
|
6582
|
+
// Initialize customization defaults on mount
|
|
6583
|
+
React.useEffect(function () {
|
|
6584
|
+
setLocalMenuItems(menuItems);
|
|
6585
|
+
var updates = {};
|
|
6586
|
+
if (!state.customization.menuId && menuItems.length > 0) {
|
|
6587
|
+
updates.menuId = menuItems[0].id;
|
|
6588
|
+
}
|
|
6589
|
+
if (!state.customization.theme && themes) {
|
|
6590
|
+
var _Object$entries$sort$;
|
|
6591
|
+
var fallback = (_Object$entries$sort$ = Object.entries(themes).sort(function (_ref2, _ref3) {
|
|
6592
|
+
var _ref4 = _slicedToArray(_ref2, 2),
|
|
6593
|
+
a = _ref4[1];
|
|
6594
|
+
var _ref5 = _slicedToArray(_ref3, 2),
|
|
6595
|
+
b = _ref5[1];
|
|
6596
|
+
return (a.name || "").localeCompare(b.name || "");
|
|
6597
|
+
})[0]) === null || _Object$entries$sort$ === void 0 ? void 0 : _Object$entries$sort$[0];
|
|
6598
|
+
updates.theme = appThemeKey || fallback || null;
|
|
6599
|
+
}
|
|
6600
|
+
if (Object.keys(updates).length > 0) {
|
|
6601
|
+
dispatch({
|
|
6602
|
+
type: "SET_CUSTOMIZATION",
|
|
6603
|
+
payload: updates
|
|
6604
|
+
});
|
|
6605
|
+
}
|
|
6606
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
6607
|
+
}, []);
|
|
6608
|
+
var handleNameChange = React.useCallback(function (val) {
|
|
6609
|
+
dispatch({
|
|
6610
|
+
type: "SET_CUSTOMIZATION",
|
|
6611
|
+
payload: {
|
|
6612
|
+
name: val
|
|
6613
|
+
}
|
|
6614
|
+
});
|
|
6615
|
+
}, [dispatch]);
|
|
6616
|
+
var handleMenuSelect = React.useCallback(function (id) {
|
|
6617
|
+
dispatch({
|
|
6618
|
+
type: "SET_CUSTOMIZATION",
|
|
6619
|
+
payload: {
|
|
6620
|
+
menuId: id
|
|
6621
|
+
}
|
|
6622
|
+
});
|
|
6623
|
+
setIsCreatingFolder(false);
|
|
6624
|
+
setNewFolderName("");
|
|
6625
|
+
setNewFolderIcon(null);
|
|
6626
|
+
}, [dispatch]);
|
|
6627
|
+
var handleThemeSelect = React.useCallback(function (key) {
|
|
6628
|
+
dispatch({
|
|
6629
|
+
type: "SET_CUSTOMIZATION",
|
|
6630
|
+
payload: {
|
|
6631
|
+
theme: key
|
|
6632
|
+
}
|
|
6633
|
+
});
|
|
6634
|
+
}, [dispatch]);
|
|
6635
|
+
function handleCancelNewFolder() {
|
|
6636
|
+
setIsCreatingFolder(false);
|
|
6637
|
+
setNewFolderName("");
|
|
6638
|
+
setNewFolderIcon(null);
|
|
6639
|
+
}
|
|
6640
|
+
function handleSaveNewFolder() {
|
|
6641
|
+
if (!newFolderName.trim() || !newFolderIcon) return;
|
|
6642
|
+
var newItem = {
|
|
6643
|
+
id: Date.now(),
|
|
6644
|
+
name: newFolderName.trim(),
|
|
6645
|
+
icon: newFolderIcon
|
|
6646
|
+
};
|
|
6647
|
+
setLocalMenuItems(function (prev) {
|
|
6648
|
+
return [].concat(_toConsumableArray(prev), [newItem]);
|
|
6649
|
+
});
|
|
6650
|
+
dispatch({
|
|
6651
|
+
type: "SET_CUSTOMIZATION",
|
|
6652
|
+
payload: {
|
|
6653
|
+
menuId: newItem.id
|
|
6654
|
+
}
|
|
6655
|
+
});
|
|
6656
|
+
if (onSaveMenuItem) {
|
|
6657
|
+
onSaveMenuItem(newItem);
|
|
6658
|
+
}
|
|
6659
|
+
setIsCreatingFolder(false);
|
|
6660
|
+
setNewFolderName("");
|
|
6661
|
+
setNewFolderIcon(null);
|
|
6662
|
+
}
|
|
6663
|
+
|
|
6664
|
+
// --- Create logic ---
|
|
6665
|
+
React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
6666
|
+
var _state$customization, name, menuId, theme, result, _window$mainApi, installResult, updatedWorkspace, _window$mainApi2, template, layoutObj, widgetOrder, cells, _loop, i, workspace, _t;
|
|
6667
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
6668
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
6669
|
+
case 0:
|
|
6670
|
+
setCreating(true);
|
|
6671
|
+
setError(null);
|
|
6672
|
+
_context2.prev = 1;
|
|
6673
|
+
_state$customization = state.customization, name = _state$customization.name, menuId = _state$customization.menuId, theme = _state$customization.theme;
|
|
6674
|
+
if (!(isPrebuilt && state.selectedDashboard)) {
|
|
6675
|
+
_context2.next = 7;
|
|
6676
|
+
break;
|
|
6677
|
+
}
|
|
6678
|
+
if (!onInstallDashboard) {
|
|
6679
|
+
_context2.next = 3;
|
|
6680
|
+
break;
|
|
6681
|
+
}
|
|
6682
|
+
_context2.next = 2;
|
|
6683
|
+
return onInstallDashboard({
|
|
6684
|
+
dashboard: state.selectedDashboard,
|
|
6685
|
+
name: name.trim(),
|
|
6686
|
+
menuId: menuId || 1,
|
|
6687
|
+
themeKey: theme,
|
|
6688
|
+
appId: appId
|
|
6689
|
+
});
|
|
6690
|
+
case 2:
|
|
6691
|
+
result = _context2.sent;
|
|
6692
|
+
_context2.next = 6;
|
|
6693
|
+
break;
|
|
6694
|
+
case 3:
|
|
6695
|
+
if (!((_window$mainApi = window.mainApi) !== null && _window$mainApi !== void 0 && (_window$mainApi = _window$mainApi.registry) !== null && _window$mainApi !== void 0 && _window$mainApi.installDashboard)) {
|
|
6696
|
+
_context2.next = 6;
|
|
6697
|
+
break;
|
|
6698
|
+
}
|
|
6699
|
+
_context2.next = 4;
|
|
6700
|
+
return window.mainApi.registry.installDashboard(appId, state.selectedDashboard.name || state.selectedDashboard.key);
|
|
6701
|
+
case 4:
|
|
6702
|
+
installResult = _context2.sent;
|
|
6703
|
+
if (!(installResult !== null && installResult !== void 0 && installResult.workspace)) {
|
|
6704
|
+
_context2.next = 6;
|
|
6705
|
+
break;
|
|
6706
|
+
}
|
|
6707
|
+
updatedWorkspace = _objectSpread$A(_objectSpread$A({}, installResult.workspace), {}, {
|
|
6708
|
+
name: name.trim(),
|
|
6709
|
+
menuId: menuId || 1,
|
|
6710
|
+
themeKey: theme
|
|
6711
|
+
});
|
|
6712
|
+
_context2.next = 5;
|
|
6713
|
+
return window.mainApi.workspace.saveWorkspaceForApplication(appId, updatedWorkspace);
|
|
6714
|
+
case 5:
|
|
6715
|
+
result = {
|
|
6716
|
+
success: true,
|
|
6717
|
+
workspace: updatedWorkspace
|
|
6718
|
+
};
|
|
6719
|
+
case 6:
|
|
6720
|
+
_context2.next = 15;
|
|
6721
|
+
break;
|
|
6722
|
+
case 7:
|
|
6723
|
+
// Build-your-own path: create layout from template + place widgets
|
|
6724
|
+
template = layoutTemplates.find(function (t) {
|
|
6725
|
+
return t.id === state.layout.templateKey;
|
|
6726
|
+
});
|
|
6727
|
+
if (template) {
|
|
6728
|
+
_context2.next = 8;
|
|
6729
|
+
break;
|
|
6730
|
+
}
|
|
6731
|
+
throw new Error("No layout template selected.");
|
|
6732
|
+
case 8:
|
|
6733
|
+
layoutObj = createLayoutFromTemplate(template, menuId || 1); // Place widgets into grid cells
|
|
6734
|
+
widgetOrder = state.layout.widgetOrder || [];
|
|
6735
|
+
cells = template.cells.filter(function (c) {
|
|
6736
|
+
return !c.hide;
|
|
6737
|
+
});
|
|
6738
|
+
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop(i) {
|
|
6739
|
+
var widget;
|
|
6740
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
6741
|
+
while (1) switch (_context.prev = _context.next) {
|
|
6742
|
+
case 0:
|
|
6743
|
+
widget = state.selectedWidgets.find(function (w) {
|
|
6744
|
+
return (w.name || w.key) === widgetOrder[i];
|
|
6745
|
+
});
|
|
6746
|
+
if (widget && layoutObj.grid[cells[i].key]) {
|
|
6747
|
+
layoutObj.grid[cells[i].key].component = widget.component || widget.name || widget.key;
|
|
6748
|
+
}
|
|
6749
|
+
case 1:
|
|
6750
|
+
case "end":
|
|
6751
|
+
return _context.stop();
|
|
6752
|
+
}
|
|
6753
|
+
}, _loop);
|
|
6754
|
+
});
|
|
6755
|
+
i = 0;
|
|
6756
|
+
case 9:
|
|
6757
|
+
if (!(i < widgetOrder.length && i < cells.length)) {
|
|
6758
|
+
_context2.next = 11;
|
|
6759
|
+
break;
|
|
6760
|
+
}
|
|
6761
|
+
return _context2.delegateYield(_loop(i), "t0", 10);
|
|
6762
|
+
case 10:
|
|
6763
|
+
i++;
|
|
6764
|
+
_context2.next = 9;
|
|
6765
|
+
break;
|
|
6766
|
+
case 11:
|
|
6767
|
+
if (!onCreateWorkspace) {
|
|
6768
|
+
_context2.next = 13;
|
|
6769
|
+
break;
|
|
6770
|
+
}
|
|
6771
|
+
_context2.next = 12;
|
|
6772
|
+
return onCreateWorkspace(layoutObj, theme, name.trim());
|
|
6773
|
+
case 12:
|
|
6774
|
+
result = _context2.sent;
|
|
6775
|
+
_context2.next = 15;
|
|
6776
|
+
break;
|
|
6777
|
+
case 13:
|
|
6778
|
+
if (!((_window$mainApi2 = window.mainApi) !== null && _window$mainApi2 !== void 0 && (_window$mainApi2 = _window$mainApi2.workspace) !== null && _window$mainApi2 !== void 0 && _window$mainApi2.saveWorkspaceForApplication)) {
|
|
6779
|
+
_context2.next = 15;
|
|
6780
|
+
break;
|
|
6781
|
+
}
|
|
6782
|
+
workspace = {
|
|
6783
|
+
name: name.trim(),
|
|
6784
|
+
menuId: menuId || 1,
|
|
6785
|
+
themeKey: theme,
|
|
6786
|
+
layout: [layoutObj]
|
|
6787
|
+
};
|
|
6788
|
+
_context2.next = 14;
|
|
6789
|
+
return window.mainApi.workspace.saveWorkspaceForApplication(appId, workspace);
|
|
6790
|
+
case 14:
|
|
6791
|
+
result = {
|
|
6792
|
+
success: true,
|
|
6793
|
+
workspace: workspace
|
|
6794
|
+
};
|
|
6795
|
+
case 15:
|
|
6796
|
+
if (result) {
|
|
6797
|
+
setCreatedDashboard(result.workspace || result);
|
|
6798
|
+
}
|
|
6799
|
+
_context2.next = 17;
|
|
6800
|
+
break;
|
|
6801
|
+
case 16:
|
|
6802
|
+
_context2.prev = 16;
|
|
6803
|
+
_t = _context2["catch"](1);
|
|
6804
|
+
setError(_t.message || "Failed to create dashboard.");
|
|
6805
|
+
case 17:
|
|
6806
|
+
_context2.prev = 17;
|
|
6807
|
+
setCreating(false);
|
|
6808
|
+
return _context2.finish(17);
|
|
6809
|
+
case 18:
|
|
6810
|
+
case "end":
|
|
6811
|
+
return _context2.stop();
|
|
6812
|
+
}
|
|
6813
|
+
}, _callee, null, [[1, 16, 17, 18]]);
|
|
6814
|
+
})), [state, isPrebuilt, onInstallDashboard, onCreateWorkspace, appId]);
|
|
6815
|
+
|
|
6816
|
+
// --- Success state ---
|
|
6817
|
+
if (createdDashboard) {
|
|
6818
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6819
|
+
className: "wizard-customize-step",
|
|
6820
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6821
|
+
className: "wizard-success",
|
|
6822
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6823
|
+
icon: "circle-check",
|
|
6824
|
+
className: "wizard-success-icon"
|
|
6825
|
+
}), /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
6826
|
+
className: "wizard-step-header",
|
|
6827
|
+
children: "Dashboard created!"
|
|
6828
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("p", {
|
|
6829
|
+
className: "wizard-step-description",
|
|
6830
|
+
children: ["Your dashboard", " ", /*#__PURE__*/jsxRuntime.jsx("strong", {
|
|
6831
|
+
children: createdDashboard.name || state.customization.name.trim()
|
|
6832
|
+
}), " ", "is ready."]
|
|
6833
|
+
}), onOpenDashboard && /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
6834
|
+
onClick: function onClick() {
|
|
6835
|
+
return onOpenDashboard(createdDashboard);
|
|
6836
|
+
},
|
|
6837
|
+
title: "Open Dashboard",
|
|
6838
|
+
textSize: "text-base",
|
|
6839
|
+
padding: "py-2 px-6",
|
|
6840
|
+
backgroundColor: "bg-blue-600",
|
|
6841
|
+
textColor: "text-white",
|
|
6842
|
+
hoverTextColor: "hover:text-white",
|
|
6843
|
+
hoverBackgroundColor: "hover:bg-blue-500",
|
|
6844
|
+
icon: "arrow-right"
|
|
6845
|
+
})]
|
|
6846
|
+
})
|
|
6847
|
+
});
|
|
6848
|
+
}
|
|
6849
|
+
|
|
6850
|
+
// --- Provider setup summary ---
|
|
6851
|
+
var selectedProviders = (state.providers || []).map(function (provKey) {
|
|
6852
|
+
var prov = (providersMap === null || providersMap === void 0 ? void 0 : providersMap[provKey]) || {};
|
|
6853
|
+
return {
|
|
6854
|
+
key: provKey,
|
|
6855
|
+
name: prov.name || provKey,
|
|
6856
|
+
icon: prov.icon || "plug",
|
|
6857
|
+
configured: !!prov.configured
|
|
6858
|
+
};
|
|
6859
|
+
});
|
|
6860
|
+
var configuredProviders = selectedProviders.filter(function (p) {
|
|
6861
|
+
return p.configured;
|
|
6862
|
+
});
|
|
6863
|
+
var needsSetupProviders = selectedProviders.filter(function (p) {
|
|
6864
|
+
return !p.configured;
|
|
6865
|
+
});
|
|
6866
|
+
var selectedFolder = localMenuItems.find(function (item) {
|
|
6867
|
+
return item.id === state.customization.menuId;
|
|
6868
|
+
});
|
|
6869
|
+
var selectedTheme = themes && state.customization.theme ? themes[state.customization.theme] : null;
|
|
6870
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6871
|
+
className: "wizard-customize-step",
|
|
6872
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
6873
|
+
className: "wizard-step-header",
|
|
6874
|
+
children: "Customize your dashboard"
|
|
6875
|
+
}), /*#__PURE__*/jsxRuntime.jsx("p", {
|
|
6876
|
+
className: "wizard-step-description",
|
|
6877
|
+
children: "Name your dashboard, choose a folder, and pick a theme."
|
|
6878
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6879
|
+
className: "wizard-customize-sections",
|
|
6880
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6881
|
+
className: "wizard-customize-section",
|
|
6882
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
6883
|
+
className: "wizard-customize-label",
|
|
6884
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6885
|
+
icon: "input-text",
|
|
6886
|
+
fixedWidth: true,
|
|
6887
|
+
className: "wizard-customize-label-icon"
|
|
6888
|
+
}), "Dashboard Name"]
|
|
6889
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
6890
|
+
value: state.customization.name,
|
|
6891
|
+
onChange: handleNameChange,
|
|
6892
|
+
placeholder: "My Dashboard",
|
|
6893
|
+
autoFocus: true
|
|
6894
|
+
})]
|
|
6895
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6896
|
+
className: "wizard-customize-section",
|
|
6897
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
6898
|
+
className: "wizard-customize-label",
|
|
6899
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6900
|
+
icon: "folder",
|
|
6901
|
+
fixedWidth: true,
|
|
6902
|
+
className: "wizard-customize-label-icon"
|
|
6903
|
+
}), "Folder"]
|
|
6904
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6905
|
+
className: "wizard-customize-folder-list",
|
|
6906
|
+
children: [!isCreatingFolder ? /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
6907
|
+
type: "button",
|
|
6908
|
+
className: "wizard-customize-folder-create",
|
|
6909
|
+
onClick: function onClick() {
|
|
6910
|
+
return setIsCreatingFolder(true);
|
|
6911
|
+
},
|
|
6912
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6913
|
+
icon: "plus",
|
|
6914
|
+
fixedWidth: true
|
|
6915
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
6916
|
+
children: "New Folder"
|
|
6917
|
+
})]
|
|
6918
|
+
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6919
|
+
className: "wizard-customize-folder-form",
|
|
6920
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6921
|
+
className: "wizard-customize-folder-form-header",
|
|
6922
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
6923
|
+
className: "text-sm font-medium text-gray-300",
|
|
6924
|
+
children: "New Folder"
|
|
6925
|
+
}), /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
6926
|
+
type: "button",
|
|
6927
|
+
className: "text-gray-500 hover:text-gray-300 transition-colors",
|
|
6928
|
+
onClick: handleCancelNewFolder,
|
|
6929
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6930
|
+
icon: "xmark"
|
|
6931
|
+
})
|
|
6932
|
+
})]
|
|
6933
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.InputText, {
|
|
6934
|
+
value: newFolderName,
|
|
6935
|
+
onChange: function onChange(val) {
|
|
6936
|
+
return setNewFolderName(val);
|
|
6937
|
+
},
|
|
6938
|
+
placeholder: "Folder name"
|
|
6939
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6940
|
+
className: "grid grid-cols-10 gap-2",
|
|
6941
|
+
children: FOLDER_ICONS.map(function (icon) {
|
|
6942
|
+
var isIconSelected = icon === newFolderIcon;
|
|
6943
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6944
|
+
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"),
|
|
6945
|
+
onClick: function onClick() {
|
|
6946
|
+
return setNewFolderIcon(icon);
|
|
6947
|
+
},
|
|
6948
|
+
children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6949
|
+
icon: icon
|
|
6950
|
+
})
|
|
6951
|
+
}, icon);
|
|
6952
|
+
})
|
|
6953
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DashReact.Button, {
|
|
6954
|
+
onClick: handleSaveNewFolder,
|
|
6955
|
+
title: "Add Folder",
|
|
6956
|
+
textSize: "text-sm",
|
|
6957
|
+
padding: "py-1 px-3",
|
|
6958
|
+
backgroundColor: "bg-blue-600",
|
|
6959
|
+
textColor: "text-white",
|
|
6960
|
+
hoverTextColor: "hover:text-white",
|
|
6961
|
+
hoverBackgroundColor: "hover:bg-blue-500",
|
|
6962
|
+
disabled: !newFolderName.trim() || !newFolderIcon
|
|
6963
|
+
})]
|
|
6964
|
+
}), localMenuItems.map(function (item) {
|
|
6965
|
+
var isSelected = !isCreatingFolder && item.id === state.customization.menuId;
|
|
6966
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6967
|
+
className: "wizard-customize-folder-item ".concat(isSelected ? "wizard-customize-folder-item--selected" : ""),
|
|
6968
|
+
onClick: function onClick() {
|
|
6969
|
+
return handleMenuSelect(item.id);
|
|
6970
|
+
},
|
|
6971
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6972
|
+
icon: item.icon || item.folder || "folder",
|
|
6973
|
+
fixedWidth: true,
|
|
6974
|
+
className: "w-5 h-5 ".concat(isSelected ? "text-blue-400" : "text-gray-400")
|
|
6975
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
6976
|
+
className: "text-sm font-medium ".concat(isSelected ? "text-blue-300" : "text-gray-300"),
|
|
6977
|
+
children: item.name
|
|
6978
|
+
}), isSelected && /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6979
|
+
icon: "check",
|
|
6980
|
+
className: "ml-auto text-blue-400 text-sm"
|
|
6981
|
+
})]
|
|
6982
|
+
}, item.id);
|
|
6983
|
+
})]
|
|
6984
|
+
})]
|
|
6985
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
6986
|
+
className: "wizard-customize-section",
|
|
6987
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
6988
|
+
className: "wizard-customize-label",
|
|
6989
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
6990
|
+
icon: "palette",
|
|
6991
|
+
fixedWidth: true,
|
|
6992
|
+
className: "wizard-customize-label-icon"
|
|
6993
|
+
}), "Theme"]
|
|
6994
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
6995
|
+
className: "wizard-customize-theme-list",
|
|
6996
|
+
children: themes && Object.entries(themes).sort(function (_ref7, _ref8) {
|
|
6997
|
+
var _ref9 = _slicedToArray(_ref7, 2),
|
|
6998
|
+
a = _ref9[1];
|
|
6999
|
+
var _ref0 = _slicedToArray(_ref8, 2),
|
|
7000
|
+
b = _ref0[1];
|
|
7001
|
+
return (a.name || "").localeCompare(b.name || "");
|
|
7002
|
+
}).map(function (_ref1) {
|
|
7003
|
+
var _ref10 = _slicedToArray(_ref1, 2),
|
|
7004
|
+
key = _ref10[0],
|
|
7005
|
+
t = _ref10[1];
|
|
7006
|
+
var isThemeSelected = state.customization.theme === key;
|
|
7007
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7008
|
+
className: "wizard-customize-theme-item ".concat(isThemeSelected ? "wizard-customize-theme-item--selected" : ""),
|
|
7009
|
+
onClick: function onClick() {
|
|
7010
|
+
return handleThemeSelect(key);
|
|
7011
|
+
},
|
|
7012
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7013
|
+
icon: "palette",
|
|
7014
|
+
className: "w-5 h-5 mr-3 ".concat(isThemeSelected ? "text-blue-400" : "text-gray-400")
|
|
7015
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7016
|
+
className: "text-sm font-medium ".concat(isThemeSelected ? "text-blue-300" : "text-gray-300"),
|
|
7017
|
+
children: t.name || key
|
|
7018
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7019
|
+
className: "flex flex-row space-x-1 ml-auto",
|
|
7020
|
+
children: [t.primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7021
|
+
className: "w-4 h-4 rounded bg-".concat(t.primary, "-500")
|
|
7022
|
+
}), t.secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7023
|
+
className: "w-4 h-4 rounded bg-".concat(t.secondary, "-500")
|
|
7024
|
+
}), t.tertiary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7025
|
+
className: "w-4 h-4 rounded bg-".concat(t.tertiary, "-500")
|
|
7026
|
+
})]
|
|
7027
|
+
})]
|
|
7028
|
+
}, key);
|
|
7029
|
+
})
|
|
7030
|
+
})]
|
|
7031
|
+
}), selectedProviders.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7032
|
+
className: "wizard-customize-section",
|
|
7033
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("label", {
|
|
7034
|
+
className: "wizard-customize-label",
|
|
7035
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7036
|
+
icon: "plug",
|
|
7037
|
+
fixedWidth: true,
|
|
7038
|
+
className: "wizard-customize-label-icon"
|
|
7039
|
+
}), "Provider Status"]
|
|
7040
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7041
|
+
className: "wizard-customize-provider-summary",
|
|
7042
|
+
children: [configuredProviders.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7043
|
+
className: "wizard-provider-group",
|
|
7044
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7045
|
+
className: "wizard-provider-group-label wizard-provider-group-label--ready",
|
|
7046
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7047
|
+
icon: "circle-check",
|
|
7048
|
+
className: "text-green-400"
|
|
7049
|
+
}), " ", "Ready (", configuredProviders.length, ")"]
|
|
7050
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7051
|
+
className: "wizard-provider-list",
|
|
7052
|
+
children: configuredProviders.map(function (p) {
|
|
7053
|
+
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7054
|
+
className: "wizard-provider-badge wizard-provider-badge--ready",
|
|
7055
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7056
|
+
icon: resolveIcon(p.icon),
|
|
7057
|
+
fixedWidth: true
|
|
7058
|
+
}), p.name]
|
|
7059
|
+
}, p.key);
|
|
7060
|
+
})
|
|
7061
|
+
})]
|
|
7062
|
+
}), needsSetupProviders.length > 0 && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7063
|
+
className: "wizard-provider-group",
|
|
7064
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7065
|
+
className: "wizard-provider-group-label wizard-provider-group-label--setup",
|
|
7066
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7067
|
+
icon: "circle-exclamation",
|
|
7068
|
+
className: "text-amber-400"
|
|
7069
|
+
}), " ", "Needs setup (", needsSetupProviders.length, ")"]
|
|
7070
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7071
|
+
className: "wizard-provider-list",
|
|
7072
|
+
children: needsSetupProviders.map(function (p) {
|
|
7073
|
+
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
7074
|
+
className: "wizard-provider-badge wizard-provider-badge--setup",
|
|
7075
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7076
|
+
icon: resolveIcon(p.icon),
|
|
7077
|
+
fixedWidth: true
|
|
7078
|
+
}), p.name]
|
|
7079
|
+
}, p.key);
|
|
7080
|
+
})
|
|
7081
|
+
})]
|
|
7082
|
+
})]
|
|
7083
|
+
})]
|
|
7084
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7085
|
+
className: "wizard-customize-summary",
|
|
7086
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7087
|
+
className: "wizard-customize-summary-title",
|
|
7088
|
+
children: "Summary"
|
|
7089
|
+
}), state.customization.name.trim() && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7090
|
+
className: "wizard-customize-summary-row",
|
|
7091
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7092
|
+
icon: "clone",
|
|
7093
|
+
className: "text-blue-400"
|
|
7094
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7095
|
+
children: state.customization.name.trim()
|
|
7096
|
+
})]
|
|
7097
|
+
}), selectedFolder && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7098
|
+
className: "wizard-customize-summary-row",
|
|
7099
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7100
|
+
icon: selectedFolder.icon || selectedFolder.folder || "folder",
|
|
7101
|
+
className: "text-blue-400"
|
|
7102
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7103
|
+
children: selectedFolder.name
|
|
7104
|
+
})]
|
|
7105
|
+
}), selectedTheme && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7106
|
+
className: "wizard-customize-summary-row",
|
|
7107
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7108
|
+
icon: "palette",
|
|
7109
|
+
className: "text-blue-400"
|
|
7110
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7111
|
+
children: selectedTheme.name || state.customization.theme
|
|
7112
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7113
|
+
className: "flex flex-row space-x-1 ml-2",
|
|
7114
|
+
children: [selectedTheme.primary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7115
|
+
className: "w-3 h-3 rounded bg-".concat(selectedTheme.primary, "-500")
|
|
7116
|
+
}), selectedTheme.secondary && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
7117
|
+
className: "w-3 h-3 rounded bg-".concat(selectedTheme.secondary, "-500")
|
|
7118
|
+
})]
|
|
7119
|
+
})]
|
|
7120
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7121
|
+
className: "wizard-customize-summary-row",
|
|
7122
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7123
|
+
icon: isPrebuilt ? "box" : "grid-2",
|
|
7124
|
+
className: "text-blue-400"
|
|
7125
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7126
|
+
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" : "")
|
|
7127
|
+
})]
|
|
7128
|
+
})]
|
|
7129
|
+
}), error && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
7130
|
+
className: "wizard-customize-error",
|
|
7131
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
7132
|
+
icon: "triangle-exclamation",
|
|
7133
|
+
className: "text-red-400"
|
|
7134
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
7135
|
+
children: error
|
|
7136
|
+
})]
|
|
7137
|
+
})]
|
|
7138
|
+
})]
|
|
7139
|
+
});
|
|
7140
|
+
};
|
|
7141
|
+
|
|
6528
7142
|
var LayoutBuilderAddItemModal = function LayoutBuilderAddItemModal(_ref) {
|
|
6529
7143
|
var workspace = _ref.workspace,
|
|
6530
7144
|
open = _ref.open,
|
|
@@ -49335,6 +49949,7 @@ exports.WidgetFactory = WidgetFactory;
|
|
|
49335
49949
|
exports.WidgetPopoutStage = WidgetPopoutStage;
|
|
49336
49950
|
exports.WidgetProviderWrapper = WidgetProviderWrapper;
|
|
49337
49951
|
exports.WidgetSidebar = WidgetSidebar;
|
|
49952
|
+
exports.WizardCustomizeStep = WizardCustomizeStep;
|
|
49338
49953
|
exports.WizardIntentStep = WizardIntentStep;
|
|
49339
49954
|
exports.WizardLayoutPreviewStep = WizardLayoutPreviewStep;
|
|
49340
49955
|
exports.WizardProvidersStep = WizardProvidersStep;
|