@trops/dash-core 0.1.435 → 0.1.437
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 +1497 -1347
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1497 -1347
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3075,9 +3075,9 @@ var LayoutContainer = function LayoutContainer(_ref) {
|
|
|
3075
3075
|
|
|
3076
3076
|
function ownKeys$X(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; }
|
|
3077
3077
|
function _objectSpread$X(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$X(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$X(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
3078
|
-
function _createForOfIteratorHelper$
|
|
3079
|
-
function _unsupportedIterableToArray$
|
|
3080
|
-
function _arrayLikeToArray$
|
|
3078
|
+
function _createForOfIteratorHelper$u(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$u(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; } } }; }
|
|
3079
|
+
function _unsupportedIterableToArray$u(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$u(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$u(r, a) : void 0; } }
|
|
3080
|
+
function _arrayLikeToArray$u(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; }
|
|
3081
3081
|
/**
|
|
3082
3082
|
* Layout template definitions for the dashboard template picker.
|
|
3083
3083
|
*
|
|
@@ -3351,7 +3351,7 @@ function createLayoutFromTemplate(template) {
|
|
|
3351
3351
|
cols: template.cols,
|
|
3352
3352
|
gap: "gap-2"
|
|
3353
3353
|
};
|
|
3354
|
-
var _iterator = _createForOfIteratorHelper$
|
|
3354
|
+
var _iterator = _createForOfIteratorHelper$u(template.cells),
|
|
3355
3355
|
_step;
|
|
3356
3356
|
try {
|
|
3357
3357
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -4282,9 +4282,9 @@ var RegistryAuthModal = function RegistryAuthModal(_ref) {
|
|
|
4282
4282
|
});
|
|
4283
4283
|
};
|
|
4284
4284
|
|
|
4285
|
-
function _createForOfIteratorHelper$
|
|
4286
|
-
function _unsupportedIterableToArray$
|
|
4287
|
-
function _arrayLikeToArray$
|
|
4285
|
+
function _createForOfIteratorHelper$t(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$t(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; } } }; }
|
|
4286
|
+
function _unsupportedIterableToArray$t(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$t(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$t(r, a) : void 0; } }
|
|
4287
|
+
function _arrayLikeToArray$t(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; }
|
|
4288
4288
|
function ownKeys$W(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; }
|
|
4289
4289
|
function _objectSpread$W(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$W(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$W(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4290
4290
|
var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
|
|
@@ -4525,7 +4525,7 @@ var RegistryDashboardDetail = function RegistryDashboardDetail(_ref) {
|
|
|
4525
4525
|
toInstall = 0,
|
|
4526
4526
|
unavailable = 0,
|
|
4527
4527
|
hasUnavailableRequired = false;
|
|
4528
|
-
var _iterator = _createForOfIteratorHelper$
|
|
4528
|
+
var _iterator = _createForOfIteratorHelper$t(widgetDeps),
|
|
4529
4529
|
_step;
|
|
4530
4530
|
try {
|
|
4531
4531
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -6300,9 +6300,9 @@ function cleanIpcError(message) {
|
|
|
6300
6300
|
return match ? match[1] : message;
|
|
6301
6301
|
}
|
|
6302
6302
|
|
|
6303
|
-
function _createForOfIteratorHelper$
|
|
6304
|
-
function _unsupportedIterableToArray$
|
|
6305
|
-
function _arrayLikeToArray$
|
|
6303
|
+
function _createForOfIteratorHelper$s(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$s(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; } } }; }
|
|
6304
|
+
function _unsupportedIterableToArray$s(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$s(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$s(r, a) : void 0; } }
|
|
6305
|
+
function _arrayLikeToArray$s(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; }
|
|
6306
6306
|
|
|
6307
6307
|
/**
|
|
6308
6308
|
* useRegistrySearch — shared hook for browsing and installing registry packages.
|
|
@@ -6416,13 +6416,13 @@ var useRegistrySearch = function useRegistrySearch() {
|
|
|
6416
6416
|
return c.toLowerCase();
|
|
6417
6417
|
}));
|
|
6418
6418
|
widgets = [];
|
|
6419
|
-
_iterator = _createForOfIteratorHelper$
|
|
6419
|
+
_iterator = _createForOfIteratorHelper$s(pkgs);
|
|
6420
6420
|
try {
|
|
6421
6421
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
6422
6422
|
pkg = _step.value;
|
|
6423
6423
|
// Compute missing APIs for the entire package
|
|
6424
6424
|
allApiProviders = [];
|
|
6425
|
-
_iterator2 = _createForOfIteratorHelper$
|
|
6425
|
+
_iterator2 = _createForOfIteratorHelper$s(pkg.providers || []);
|
|
6426
6426
|
try {
|
|
6427
6427
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
6428
6428
|
p = _step2.value;
|
|
@@ -6435,11 +6435,11 @@ var useRegistrySearch = function useRegistrySearch() {
|
|
|
6435
6435
|
} finally {
|
|
6436
6436
|
_iterator2.f();
|
|
6437
6437
|
}
|
|
6438
|
-
_iterator3 = _createForOfIteratorHelper$
|
|
6438
|
+
_iterator3 = _createForOfIteratorHelper$s(pkg.widgets || []);
|
|
6439
6439
|
try {
|
|
6440
6440
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
6441
6441
|
w = _step3.value;
|
|
6442
|
-
_iterator5 = _createForOfIteratorHelper$
|
|
6442
|
+
_iterator5 = _createForOfIteratorHelper$s(w.providers || []);
|
|
6443
6443
|
try {
|
|
6444
6444
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
6445
6445
|
_p = _step5.value;
|
|
@@ -6461,7 +6461,7 @@ var useRegistrySearch = function useRegistrySearch() {
|
|
|
6461
6461
|
missingApis = _toConsumableArray(new Set(allApiProviders)).filter(function (api) {
|
|
6462
6462
|
return !capSet.has(api.toLowerCase());
|
|
6463
6463
|
});
|
|
6464
|
-
_iterator4 = _createForOfIteratorHelper$
|
|
6464
|
+
_iterator4 = _createForOfIteratorHelper$s(pkg.widgets || []);
|
|
6465
6465
|
try {
|
|
6466
6466
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
6467
6467
|
widget = _step4.value;
|
|
@@ -7082,9 +7082,9 @@ function applyFilters(items, filters, mode) {
|
|
|
7082
7082
|
});
|
|
7083
7083
|
}
|
|
7084
7084
|
|
|
7085
|
-
function _createForOfIteratorHelper$
|
|
7086
|
-
function _unsupportedIterableToArray$
|
|
7087
|
-
function _arrayLikeToArray$
|
|
7085
|
+
function _createForOfIteratorHelper$r(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$r(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; } } }; }
|
|
7086
|
+
function _unsupportedIterableToArray$r(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$r(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$r(r, a) : void 0; } }
|
|
7087
|
+
function _arrayLikeToArray$r(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; }
|
|
7088
7088
|
function ownKeys$U(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; }
|
|
7089
7089
|
function _objectSpread$U(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$U(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$U(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7090
7090
|
var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
@@ -7308,7 +7308,7 @@ var WizardCustomizeStep = function WizardCustomizeStep(_ref) {
|
|
|
7308
7308
|
installedNames = new Set(installedList.map(function (w) {
|
|
7309
7309
|
return w.name;
|
|
7310
7310
|
}));
|
|
7311
|
-
_iterator = _createForOfIteratorHelper$
|
|
7311
|
+
_iterator = _createForOfIteratorHelper$r(state.selectedWidgets);
|
|
7312
7312
|
_context2.prev = 13;
|
|
7313
7313
|
_iterator.s();
|
|
7314
7314
|
case 14:
|
|
@@ -12937,9 +12937,9 @@ var PanelEditItem = function PanelEditItem(_ref) {
|
|
|
12937
12937
|
};
|
|
12938
12938
|
|
|
12939
12939
|
var _excluded$6 = ["rows", "cols"];
|
|
12940
|
-
function _createForOfIteratorHelper$
|
|
12941
|
-
function _unsupportedIterableToArray$
|
|
12942
|
-
function _arrayLikeToArray$
|
|
12940
|
+
function _createForOfIteratorHelper$q(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$q(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; } } }; }
|
|
12941
|
+
function _unsupportedIterableToArray$q(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$q(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$q(r, a) : void 0; } }
|
|
12942
|
+
function _arrayLikeToArray$q(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; }
|
|
12943
12943
|
function ownKeys$S(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; }
|
|
12944
12944
|
function _objectSpread$S(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$S(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$S(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12945
12945
|
var defaultGrid = {
|
|
@@ -13092,7 +13092,7 @@ function GridEditor(_ref) {
|
|
|
13092
13092
|
function sortObjectByKeys(obj) {
|
|
13093
13093
|
var sortedKeys = Object.keys(obj).sort();
|
|
13094
13094
|
var sortedObj = {};
|
|
13095
|
-
var _iterator = _createForOfIteratorHelper$
|
|
13095
|
+
var _iterator = _createForOfIteratorHelper$q(sortedKeys),
|
|
13096
13096
|
_step;
|
|
13097
13097
|
try {
|
|
13098
13098
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -13565,9 +13565,9 @@ var PanelEditItemNotifications = function PanelEditItemNotifications(_ref) {
|
|
|
13565
13565
|
});
|
|
13566
13566
|
};
|
|
13567
13567
|
|
|
13568
|
-
function _createForOfIteratorHelper$
|
|
13569
|
-
function _unsupportedIterableToArray$
|
|
13570
|
-
function _arrayLikeToArray$
|
|
13568
|
+
function _createForOfIteratorHelper$p(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$p(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; } } }; }
|
|
13569
|
+
function _unsupportedIterableToArray$p(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$p(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$p(r, a) : void 0; } }
|
|
13570
|
+
function _arrayLikeToArray$p(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; }
|
|
13571
13571
|
function ownKeys$Q(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; }
|
|
13572
13572
|
function _objectSpread$Q(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$Q(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$Q(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13573
13573
|
var DAYS = [{
|
|
@@ -13896,7 +13896,7 @@ var PanelEditItemSchedule = function PanelEditItemSchedule(_ref2) {
|
|
|
13896
13896
|
setIsLoading(true);
|
|
13897
13897
|
window.mainApi.scheduler.getTasks(widgetUuid).then(function (tasks) {
|
|
13898
13898
|
var stateMap = {};
|
|
13899
|
-
var _iterator = _createForOfIteratorHelper$
|
|
13899
|
+
var _iterator = _createForOfIteratorHelper$p(tasks || []),
|
|
13900
13900
|
_step;
|
|
13901
13901
|
try {
|
|
13902
13902
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -14040,296 +14040,1126 @@ var PanelCode = function PanelCode(_ref) {
|
|
|
14040
14040
|
});
|
|
14041
14041
|
};
|
|
14042
14042
|
|
|
14043
|
-
var
|
|
14044
|
-
|
|
14045
|
-
|
|
14046
|
-
|
|
14047
|
-
|
|
14048
|
-
|
|
14049
|
-
|
|
14050
|
-
|
|
14051
|
-
|
|
14052
|
-
|
|
14053
|
-
|
|
14054
|
-
|
|
14055
|
-
|
|
14056
|
-
|
|
14057
|
-
|
|
14058
|
-
|
|
14059
|
-
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14060
|
-
className: "flex flex-row flex-1 min-h-0 ".concat(panelStyles.textColor || "text-gray-200"),
|
|
14061
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14062
|
-
className: "flex flex-col flex-shrink-0 ".concat(listWidth, " border-r ").concat(headerStyles.borderColor || "", " overflow-y-auto"),
|
|
14063
|
-
children: listContent
|
|
14064
|
-
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14065
|
-
className: "flex flex-col flex-1 min-w-0 min-h-0",
|
|
14066
|
-
children: detailContent ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14067
|
-
className: "flex flex-col flex-1 min-h-0",
|
|
14068
|
-
children: detailContent
|
|
14069
|
-
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14070
|
-
className: "flex flex-1 items-center justify-center",
|
|
14071
|
-
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
14072
|
-
className: "text-sm opacity-40",
|
|
14073
|
-
children: emptyDetailMessage
|
|
14074
|
-
})
|
|
14075
|
-
})
|
|
14076
|
-
})]
|
|
14077
|
-
});
|
|
14078
|
-
};
|
|
14043
|
+
function _createForOfIteratorHelper$o(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$o(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; } } }; }
|
|
14044
|
+
function _unsupportedIterableToArray$o(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$o(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$o(r, a) : void 0; } }
|
|
14045
|
+
function _arrayLikeToArray$o(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; }
|
|
14046
|
+
/**
|
|
14047
|
+
* providerResolution.js
|
|
14048
|
+
*
|
|
14049
|
+
* Shared helpers for walking a workspace and figuring out which widgets
|
|
14050
|
+
* have required providers that are still unresolved after the 3-layer
|
|
14051
|
+
* resolution (widget → workspace → app-default → null). Used by:
|
|
14052
|
+
*
|
|
14053
|
+
* - DashboardConfigModal to render the Providers tab
|
|
14054
|
+
* - DashboardStage toolbar to show the unresolved-count badge
|
|
14055
|
+
*
|
|
14056
|
+
* Both places need the same answer, so keep the logic here to avoid drift
|
|
14057
|
+
* with the resolution inside `useMcpProvider` / `useWebSocketProvider`.
|
|
14058
|
+
*/
|
|
14079
14059
|
|
|
14080
|
-
|
|
14081
|
-
|
|
14082
|
-
|
|
14083
|
-
|
|
14084
|
-
|
|
14085
|
-
|
|
14086
|
-
|
|
14087
|
-
|
|
14088
|
-
|
|
14089
|
-
|
|
14090
|
-
|
|
14091
|
-
|
|
14092
|
-
|
|
14093
|
-
var
|
|
14094
|
-
|
|
14095
|
-
|
|
14096
|
-
|
|
14097
|
-
|
|
14098
|
-
|
|
14099
|
-
|
|
14100
|
-
|
|
14101
|
-
|
|
14102
|
-
|
|
14103
|
-
|
|
14104
|
-
|
|
14105
|
-
|
|
14106
|
-
|
|
14107
|
-
|
|
14108
|
-
|
|
14109
|
-
|
|
14110
|
-
|
|
14111
|
-
|
|
14112
|
-
|
|
14113
|
-
|
|
14114
|
-
|
|
14115
|
-
|
|
14116
|
-
|
|
14060
|
+
/**
|
|
14061
|
+
* Resolve which provider name a given widget instance would bind to for
|
|
14062
|
+
* the given provider type. Mirrors the 3-layer chain in useMcpProvider
|
|
14063
|
+
* and useWebSocketProvider exactly:
|
|
14064
|
+
*
|
|
14065
|
+
* 1. widget-level override (layoutItem.selectedProviders[type])
|
|
14066
|
+
* 2. workspace-level binding (workspace.selectedProviders[id][type])
|
|
14067
|
+
* 3. app default (any provider of matching type flagged
|
|
14068
|
+
* `isDefaultForType` in appProviders)
|
|
14069
|
+
* 4. null (truly unresolved)
|
|
14070
|
+
*/
|
|
14071
|
+
function resolveProviderName(_ref) {
|
|
14072
|
+
var _layoutItem$selectedP, _workspace$selectedPr;
|
|
14073
|
+
var providerType = _ref.providerType,
|
|
14074
|
+
layoutItem = _ref.layoutItem,
|
|
14075
|
+
widgetId = _ref.widgetId,
|
|
14076
|
+
workspace = _ref.workspace,
|
|
14077
|
+
appProviders = _ref.appProviders;
|
|
14078
|
+
// 1. Widget-level
|
|
14079
|
+
var widgetLevel = layoutItem === null || layoutItem === void 0 || (_layoutItem$selectedP = layoutItem.selectedProviders) === null || _layoutItem$selectedP === void 0 ? void 0 : _layoutItem$selectedP[providerType];
|
|
14080
|
+
if (widgetLevel) return widgetLevel;
|
|
14081
|
+
|
|
14082
|
+
// 2. Workspace-level
|
|
14083
|
+
var workspaceLevel = widgetId && (workspace === null || workspace === void 0 || (_workspace$selectedPr = workspace.selectedProviders) === null || _workspace$selectedPr === void 0 || (_workspace$selectedPr = _workspace$selectedPr[widgetId]) === null || _workspace$selectedPr === void 0 ? void 0 : _workspace$selectedPr[providerType]);
|
|
14084
|
+
if (workspaceLevel) return workspaceLevel;
|
|
14085
|
+
|
|
14086
|
+
// 3. App default — appProviders is either a map keyed by name or an
|
|
14087
|
+
// array. Support both because different callers shape it either way.
|
|
14088
|
+
if (appProviders) {
|
|
14089
|
+
if (Array.isArray(appProviders)) {
|
|
14090
|
+
var _iterator = _createForOfIteratorHelper$o(appProviders),
|
|
14091
|
+
_step;
|
|
14092
|
+
try {
|
|
14093
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
14094
|
+
var data = _step.value;
|
|
14095
|
+
if ((data === null || data === void 0 ? void 0 : data.type) === providerType && (data === null || data === void 0 ? void 0 : data.isDefaultForType) === true) {
|
|
14096
|
+
return data.name;
|
|
14097
|
+
}
|
|
14117
14098
|
}
|
|
14118
|
-
|
|
14119
|
-
|
|
14120
|
-
|
|
14121
|
-
|
|
14122
|
-
currentListeners[eventHandlerSelected] = uniqueEventsSelected;
|
|
14123
|
-
handleSaveChanges(currentListeners);
|
|
14099
|
+
} catch (err) {
|
|
14100
|
+
_iterator.e(err);
|
|
14101
|
+
} finally {
|
|
14102
|
+
_iterator.f();
|
|
14124
14103
|
}
|
|
14125
|
-
}
|
|
14126
|
-
|
|
14127
|
-
|
|
14128
|
-
|
|
14129
|
-
|
|
14130
|
-
|
|
14131
|
-
|
|
14132
|
-
var currentListeners = DashReact.deepCopy(itemSelected["listeners"] || {});
|
|
14133
|
-
var eventsSelectedTemp = eventHandlerSelected in currentListeners ? currentListeners[eventHandlerSelected].filter(function (event) {
|
|
14134
|
-
return event !== eventString;
|
|
14135
|
-
}) : [];
|
|
14136
|
-
if (eventsSelectedTemp.length > 0) {
|
|
14137
|
-
if (eventHandlerSelected in currentListeners) {
|
|
14138
|
-
currentListeners[eventHandlerSelected] = eventsSelectedTemp;
|
|
14139
|
-
}
|
|
14140
|
-
} else {
|
|
14141
|
-
delete currentListeners[eventHandlerSelected];
|
|
14104
|
+
} else if (_typeof(appProviders) === "object") {
|
|
14105
|
+
for (var _i = 0, _Object$entries = Object.entries(appProviders); _i < _Object$entries.length; _i++) {
|
|
14106
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
14107
|
+
name = _Object$entries$_i[0],
|
|
14108
|
+
_data = _Object$entries$_i[1];
|
|
14109
|
+
if ((_data === null || _data === void 0 ? void 0 : _data.type) === providerType && (_data === null || _data === void 0 ? void 0 : _data.isDefaultForType) === true) {
|
|
14110
|
+
return name;
|
|
14142
14111
|
}
|
|
14143
|
-
handleSaveChanges(currentListeners);
|
|
14144
14112
|
}
|
|
14145
|
-
} catch (e) {
|
|
14146
|
-
// remove event failed
|
|
14147
14113
|
}
|
|
14148
14114
|
}
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
14115
|
+
return null;
|
|
14116
|
+
}
|
|
14117
|
+
|
|
14118
|
+
/**
|
|
14119
|
+
* Walk every layout container in a workspace and yield each widget
|
|
14120
|
+
* instance with its concrete layout item. Handles the main layout,
|
|
14121
|
+
* per-page layouts, the sidebar, and nested LayoutGridContainers whose
|
|
14122
|
+
* children are stored on `items`/`layout`.
|
|
14123
|
+
*
|
|
14124
|
+
* Deduplicates by object identity AND by stable id so that shared
|
|
14125
|
+
* references across pages (or two structurally-distinct items that
|
|
14126
|
+
* carry the same uuidString / id, which is the wiring key) are
|
|
14127
|
+
* visited exactly once. Pipeline-style workspaces re-reference the
|
|
14128
|
+
* same widget objects across page layouts; without this dedupe the
|
|
14129
|
+
* Providers/Listeners tabs render one row per reference.
|
|
14130
|
+
*/
|
|
14131
|
+
function forEachWidget(workspace, visit) {
|
|
14132
|
+
if (!workspace) return;
|
|
14133
|
+
var visitedObjects = new WeakSet();
|
|
14134
|
+
var visitedIds = new Set();
|
|
14135
|
+
|
|
14136
|
+
// Canonical identity: `component|id-ish`. Including the component
|
|
14137
|
+
// prefix in every form aligns this with `canonicalItemKey` in
|
|
14138
|
+
// listenerResolution.js — they MUST agree or duplicates slip
|
|
14139
|
+
// between the visit loop and downstream dedupes. Prefer uuidString
|
|
14140
|
+
// (stable across sessions), then uuid, then numeric id.
|
|
14141
|
+
var stableId = function stableId(item) {
|
|
14142
|
+
if (!item || !item.component) return null;
|
|
14143
|
+
if (item.uuidString) return "".concat(item.component, "|").concat(item.uuidString);
|
|
14144
|
+
if (item.uuid) return "".concat(item.component, "|").concat(item.uuid);
|
|
14145
|
+
if (item.id != null) return "".concat(item.component, "|").concat(item.id);
|
|
14163
14146
|
return null;
|
|
14164
|
-
}
|
|
14165
|
-
function
|
|
14166
|
-
|
|
14147
|
+
};
|
|
14148
|
+
var _walk = function walk(items) {
|
|
14149
|
+
if (!Array.isArray(items)) return;
|
|
14150
|
+
var _iterator2 = _createForOfIteratorHelper$o(items),
|
|
14151
|
+
_step2;
|
|
14167
14152
|
try {
|
|
14168
|
-
|
|
14169
|
-
var
|
|
14170
|
-
|
|
14171
|
-
|
|
14172
|
-
|
|
14173
|
-
|
|
14153
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
14154
|
+
var item = _step2.value;
|
|
14155
|
+
if (!item || _typeof(item) !== "object") continue;
|
|
14156
|
+
// A "widget" is any layout item with a component name.
|
|
14157
|
+
// Containers can have both a component name AND nested items
|
|
14158
|
+
// (e.g. LayoutGridContainer), so still recurse.
|
|
14159
|
+
if (item.component) {
|
|
14160
|
+
var id = stableId(item);
|
|
14161
|
+
var alreadyByRef = visitedObjects.has(item);
|
|
14162
|
+
var alreadyById = id != null && visitedIds.has(id);
|
|
14163
|
+
if (!alreadyByRef && !alreadyById) {
|
|
14164
|
+
visitedObjects.add(item);
|
|
14165
|
+
if (id != null) visitedIds.add(id);
|
|
14166
|
+
visit(item);
|
|
14167
|
+
}
|
|
14168
|
+
}
|
|
14169
|
+
if (Array.isArray(item.items)) _walk(item.items);
|
|
14170
|
+
if (Array.isArray(item.layout)) _walk(item.layout);
|
|
14174
14171
|
}
|
|
14175
|
-
} catch (
|
|
14176
|
-
|
|
14172
|
+
} catch (err) {
|
|
14173
|
+
_iterator2.e(err);
|
|
14174
|
+
} finally {
|
|
14175
|
+
_iterator2.f();
|
|
14177
14176
|
}
|
|
14178
|
-
}
|
|
14179
|
-
|
|
14177
|
+
};
|
|
14178
|
+
_walk(workspace.layout);
|
|
14179
|
+
if (Array.isArray(workspace.pages)) {
|
|
14180
|
+
var _iterator3 = _createForOfIteratorHelper$o(workspace.pages),
|
|
14181
|
+
_step3;
|
|
14180
14182
|
try {
|
|
14181
|
-
|
|
14182
|
-
var
|
|
14183
|
-
|
|
14184
|
-
return itemListeners[eventHandlerSelected].includes(event);
|
|
14185
|
-
}
|
|
14186
|
-
return false;
|
|
14183
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
14184
|
+
var page = _step3.value;
|
|
14185
|
+
_walk(page === null || page === void 0 ? void 0 : page.layout);
|
|
14187
14186
|
}
|
|
14188
|
-
|
|
14189
|
-
|
|
14190
|
-
|
|
14187
|
+
} catch (err) {
|
|
14188
|
+
_iterator3.e(err);
|
|
14189
|
+
} finally {
|
|
14190
|
+
_iterator3.f();
|
|
14191
14191
|
}
|
|
14192
14192
|
}
|
|
14193
|
+
_walk(workspace.sidebarLayout);
|
|
14194
|
+
}
|
|
14193
14195
|
|
|
14194
|
-
|
|
14195
|
-
|
|
14196
|
-
|
|
14197
|
-
|
|
14196
|
+
/**
|
|
14197
|
+
* Compute the list of unresolved required providers across a workspace.
|
|
14198
|
+
*
|
|
14199
|
+
* @param {object} args
|
|
14200
|
+
* @param {object} args.workspace The workspace (with layout/pages/sidebarLayout/selectedProviders).
|
|
14201
|
+
* @param {object|Array} args.appProviders
|
|
14202
|
+
* Map keyed by provider name, or an array of provider objects. Each
|
|
14203
|
+
* entry has at least `{ type, isDefaultForType }`.
|
|
14204
|
+
* @param {(componentName: string) => Array<{type, required?, providerClass?}>} args.getWidgetRequirements
|
|
14205
|
+
* Returns the `providers: [...]` declaration from the component's
|
|
14206
|
+
* `.dash.js` (via `ComponentManager.componentMap()[name].providers`).
|
|
14207
|
+
*
|
|
14208
|
+
* @returns {Array<{ widgetId, component, providerType, providerClass, layoutItem }>}
|
|
14209
|
+
* One entry per (widget instance, required provider type) that lacks
|
|
14210
|
+
* a binding.
|
|
14211
|
+
*/
|
|
14212
|
+
function getUnresolvedProviders(_ref2) {
|
|
14213
|
+
var workspace = _ref2.workspace,
|
|
14214
|
+
appProviders = _ref2.appProviders,
|
|
14215
|
+
getWidgetRequirements = _ref2.getWidgetRequirements;
|
|
14216
|
+
if (!workspace || typeof getWidgetRequirements !== "function") return [];
|
|
14217
|
+
var unresolved = [];
|
|
14218
|
+
forEachWidget(workspace, function (item) {
|
|
14219
|
+
var requirements = getWidgetRequirements(item.component) || [];
|
|
14220
|
+
if (!Array.isArray(requirements) || requirements.length === 0) return;
|
|
14221
|
+
var widgetId = item.uuidString || item.uuid || item.id || null;
|
|
14222
|
+
var _iterator4 = _createForOfIteratorHelper$o(requirements),
|
|
14223
|
+
_step4;
|
|
14224
|
+
try {
|
|
14225
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
14226
|
+
var req = _step4.value;
|
|
14227
|
+
if (!req || !req.type) continue;
|
|
14228
|
+
if (req.required === false) continue; // optional, skip
|
|
14198
14229
|
|
|
14199
|
-
|
|
14200
|
-
|
|
14201
|
-
|
|
14202
|
-
|
|
14203
|
-
|
|
14204
|
-
|
|
14205
|
-
|
|
14206
|
-
if (
|
|
14207
|
-
|
|
14208
|
-
|
|
14209
|
-
|
|
14210
|
-
|
|
14230
|
+
var name = resolveProviderName({
|
|
14231
|
+
providerType: req.type,
|
|
14232
|
+
layoutItem: item,
|
|
14233
|
+
widgetId: widgetId,
|
|
14234
|
+
workspace: workspace,
|
|
14235
|
+
appProviders: appProviders
|
|
14236
|
+
});
|
|
14237
|
+
if (!name) {
|
|
14238
|
+
unresolved.push({
|
|
14239
|
+
widgetId: widgetId,
|
|
14240
|
+
component: item.component,
|
|
14241
|
+
providerType: req.type,
|
|
14242
|
+
providerClass: req.providerClass || null,
|
|
14243
|
+
layoutItem: item
|
|
14244
|
+
});
|
|
14245
|
+
}
|
|
14246
|
+
}
|
|
14247
|
+
} catch (err) {
|
|
14248
|
+
_iterator4.e(err);
|
|
14249
|
+
} finally {
|
|
14250
|
+
_iterator4.f();
|
|
14211
14251
|
}
|
|
14212
|
-
return all;
|
|
14213
|
-
}
|
|
14214
|
-
var layoutArray = getAllWidgetLayouts(workspaceSelected);
|
|
14215
|
-
var sourceWidgets = layoutArray.filter(function (l) {
|
|
14216
|
-
return l["component"] !== "Container" && l["component"] !== "LayoutContainer";
|
|
14217
|
-
}).filter(function (e) {
|
|
14218
|
-
return Array.isArray(e.events) && e.events.length > 0;
|
|
14219
|
-
}).filter(function (li) {
|
|
14220
|
-
return li["component"] !== (itemSelected === null || itemSelected === void 0 ? void 0 : itemSelected["component"]);
|
|
14221
14252
|
});
|
|
14253
|
+
return unresolved;
|
|
14254
|
+
}
|
|
14222
14255
|
|
|
14223
|
-
|
|
14224
|
-
|
|
14225
|
-
|
|
14226
|
-
|
|
14227
|
-
|
|
14228
|
-
|
|
14229
|
-
|
|
14256
|
+
/**
|
|
14257
|
+
* Group an unresolved-provider list (or any `{widget, providerType}` list)
|
|
14258
|
+
* by provider type, so the Providers tab can render one row per unique
|
|
14259
|
+
* type with N widgets beneath.
|
|
14260
|
+
*/
|
|
14261
|
+
function groupByProviderType(unresolved) {
|
|
14262
|
+
var byType = new Map();
|
|
14263
|
+
var _iterator5 = _createForOfIteratorHelper$o(unresolved || []),
|
|
14264
|
+
_step5;
|
|
14265
|
+
try {
|
|
14266
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
14267
|
+
var u = _step5.value;
|
|
14268
|
+
if (!(u !== null && u !== void 0 && u.providerType)) continue;
|
|
14269
|
+
if (!byType.has(u.providerType)) byType.set(u.providerType, []);
|
|
14270
|
+
byType.get(u.providerType).push(u);
|
|
14230
14271
|
}
|
|
14231
|
-
})
|
|
14272
|
+
} catch (err) {
|
|
14273
|
+
_iterator5.e(err);
|
|
14274
|
+
} finally {
|
|
14275
|
+
_iterator5.f();
|
|
14276
|
+
}
|
|
14277
|
+
return byType;
|
|
14278
|
+
}
|
|
14232
14279
|
|
|
14233
|
-
|
|
14234
|
-
|
|
14235
|
-
|
|
14236
|
-
|
|
14237
|
-
|
|
14238
|
-
|
|
14239
|
-
|
|
14240
|
-
|
|
14241
|
-
|
|
14242
|
-
|
|
14243
|
-
|
|
14280
|
+
/**
|
|
14281
|
+
* Summarize every widget in the workspace that requires ANY provider,
|
|
14282
|
+
* regardless of whether it's already resolved. Drives the Providers tab's
|
|
14283
|
+
* "show per-widget overrides" expansion — the modal lists all widgets so
|
|
14284
|
+
* the user can change an explicit override even for types that are
|
|
14285
|
+
* already resolved via the app default.
|
|
14286
|
+
*/
|
|
14287
|
+
function getAllProviderBindings(_ref3) {
|
|
14288
|
+
var workspace = _ref3.workspace,
|
|
14289
|
+
appProviders = _ref3.appProviders,
|
|
14290
|
+
getWidgetRequirements = _ref3.getWidgetRequirements;
|
|
14291
|
+
if (!workspace || typeof getWidgetRequirements !== "function") return [];
|
|
14292
|
+
var bindings = [];
|
|
14293
|
+
forEachWidget(workspace, function (item) {
|
|
14294
|
+
var requirements = getWidgetRequirements(item.component) || [];
|
|
14295
|
+
if (!Array.isArray(requirements) || requirements.length === 0) return;
|
|
14296
|
+
var widgetId = item.uuidString || item.uuid || item.id || null;
|
|
14297
|
+
var _iterator6 = _createForOfIteratorHelper$o(requirements),
|
|
14298
|
+
_step6;
|
|
14299
|
+
try {
|
|
14300
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
14301
|
+
var req = _step6.value;
|
|
14302
|
+
if (!req || !req.type) continue;
|
|
14303
|
+
var name = resolveProviderName({
|
|
14304
|
+
providerType: req.type,
|
|
14305
|
+
layoutItem: item,
|
|
14306
|
+
widgetId: widgetId,
|
|
14307
|
+
workspace: workspace,
|
|
14308
|
+
appProviders: appProviders
|
|
14309
|
+
});
|
|
14310
|
+
bindings.push({
|
|
14311
|
+
widgetId: widgetId,
|
|
14312
|
+
component: item.component,
|
|
14313
|
+
providerType: req.type,
|
|
14314
|
+
providerClass: req.providerClass || null,
|
|
14315
|
+
required: req.required !== false,
|
|
14316
|
+
resolvedProviderName: name,
|
|
14317
|
+
layoutItem: item
|
|
14318
|
+
});
|
|
14244
14319
|
}
|
|
14320
|
+
} catch (err) {
|
|
14321
|
+
_iterator6.e(err);
|
|
14322
|
+
} finally {
|
|
14323
|
+
_iterator6.f();
|
|
14245
14324
|
}
|
|
14246
14325
|
});
|
|
14326
|
+
return bindings;
|
|
14327
|
+
}
|
|
14247
14328
|
|
|
14248
|
-
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
|
|
14329
|
+
function ownKeys$O(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; }
|
|
14330
|
+
function _objectSpread$O(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$O(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$O(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14331
|
+
function _createForOfIteratorHelper$n(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$n(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; } } }; }
|
|
14332
|
+
function _unsupportedIterableToArray$n(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$n(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$n(r, a) : void 0; } }
|
|
14333
|
+
function _arrayLikeToArray$n(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; }
|
|
14334
|
+
var EVENT_STRING_RE = /^([^[]+)\[([^\]]+)\]\.(.+)$/;
|
|
14252
14335
|
|
|
14253
|
-
|
|
14254
|
-
|
|
14255
|
-
|
|
14256
|
-
|
|
14257
|
-
|
|
14258
|
-
|
|
14259
|
-
|
|
14260
|
-
|
|
14261
|
-
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
className: "h-3.5 w-3.5"
|
|
14265
|
-
}),
|
|
14266
|
-
active: isActive,
|
|
14267
|
-
onClick: function onClick() {
|
|
14268
|
-
return handleSelectEventHandler(handler);
|
|
14269
|
-
},
|
|
14270
|
-
badge: count > 0 ? String(count) : null,
|
|
14271
|
-
className: isActive ? "bg-white/10 opacity-100" : "",
|
|
14272
|
-
children: handler
|
|
14273
|
-
}, handler);
|
|
14274
|
-
}), eventHandlers.length === 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
14275
|
-
className: "text-sm opacity-40 py-8 text-center",
|
|
14276
|
-
children: "No handlers available"
|
|
14277
|
-
})]
|
|
14278
|
-
});
|
|
14336
|
+
/** Parse "Component[itemId].event" → { component, itemId, event }. */
|
|
14337
|
+
function parseEventString(eventString) {
|
|
14338
|
+
if (typeof eventString !== "string") return null;
|
|
14339
|
+
var m = eventString.match(EVENT_STRING_RE);
|
|
14340
|
+
if (!m) return null;
|
|
14341
|
+
return {
|
|
14342
|
+
component: m[1],
|
|
14343
|
+
itemId: m[2],
|
|
14344
|
+
event: m[3]
|
|
14345
|
+
};
|
|
14346
|
+
}
|
|
14279
14347
|
|
|
14280
|
-
|
|
14281
|
-
|
|
14282
|
-
|
|
14283
|
-
|
|
14284
|
-
|
|
14285
|
-
|
|
14286
|
-
|
|
14287
|
-
|
|
14288
|
-
|
|
14289
|
-
|
|
14290
|
-
|
|
14291
|
-
|
|
14292
|
-
|
|
14293
|
-
|
|
14294
|
-
|
|
14295
|
-
|
|
14296
|
-
|
|
14297
|
-
|
|
14298
|
-
|
|
14299
|
-
|
|
14300
|
-
|
|
14301
|
-
|
|
14302
|
-
|
|
14303
|
-
|
|
14304
|
-
|
|
14305
|
-
|
|
14306
|
-
|
|
14307
|
-
|
|
14308
|
-
|
|
14309
|
-
|
|
14310
|
-
|
|
14311
|
-
|
|
14312
|
-
|
|
14313
|
-
|
|
14314
|
-
|
|
14315
|
-
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14319
|
-
|
|
14320
|
-
|
|
14321
|
-
|
|
14322
|
-
|
|
14323
|
-
|
|
14324
|
-
|
|
14325
|
-
|
|
14326
|
-
|
|
14327
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
|
|
14332
|
-
|
|
14348
|
+
/** Build an event string in the canonical runtime format. */
|
|
14349
|
+
function formatEventString(component, itemId, event) {
|
|
14350
|
+
return "".concat(component, "[").concat(itemId, "].").concat(event);
|
|
14351
|
+
}
|
|
14352
|
+
|
|
14353
|
+
/**
|
|
14354
|
+
* Get a stable id for a layout item. Layout items historically used
|
|
14355
|
+
* numeric `id`; some newer flows also carry `uuidString`/`uuid`. The
|
|
14356
|
+
* runtime event-string format uses whichever is `item.id`, so we
|
|
14357
|
+
* default to that and fall back to the others for resilience.
|
|
14358
|
+
*/
|
|
14359
|
+
function itemIdOf(item) {
|
|
14360
|
+
if (item == null) return null;
|
|
14361
|
+
if (item.id !== undefined && item.id !== null) return String(item.id);
|
|
14362
|
+
if (item.uuidString) return item.uuidString;
|
|
14363
|
+
if (item.uuid) return item.uuid;
|
|
14364
|
+
return null;
|
|
14365
|
+
}
|
|
14366
|
+
|
|
14367
|
+
/**
|
|
14368
|
+
* Canonical identity key for a layout item: `component|id-ish`.
|
|
14369
|
+
* Single source of truth for dedupe in every query below and in
|
|
14370
|
+
* `forEachWidget` (providerResolution.js). Including the component
|
|
14371
|
+
* prefix prevents two structurally-different widgets from colliding
|
|
14372
|
+
* when they happen to share a uuid (rare, but possible when items
|
|
14373
|
+
* are pasted between workspaces).
|
|
14374
|
+
*
|
|
14375
|
+
* Priority matches forEachWidget's stableId so a widget that
|
|
14376
|
+
* forEachWidget visited once produces exactly one map entry across
|
|
14377
|
+
* every listener-side consumer — no more `STAGEGATECHECKLIST[4]`
|
|
14378
|
+
* appearing twice because one caller used `uuidString` and the
|
|
14379
|
+
* other used `id`.
|
|
14380
|
+
*/
|
|
14381
|
+
function canonicalItemKey(item) {
|
|
14382
|
+
if (!item || !item.component) return null;
|
|
14383
|
+
if (item.uuidString) return "".concat(item.component, "|").concat(item.uuidString);
|
|
14384
|
+
if (item.uuid) return "".concat(item.component, "|").concat(item.uuid);
|
|
14385
|
+
if (item.id !== undefined && item.id !== null) {
|
|
14386
|
+
return "".concat(item.component, "|").concat(item.id);
|
|
14387
|
+
}
|
|
14388
|
+
return null;
|
|
14389
|
+
}
|
|
14390
|
+
|
|
14391
|
+
/**
|
|
14392
|
+
* Best-effort human label for a layout item: explicit title, then
|
|
14393
|
+
* widget config display name, then component name + short id.
|
|
14394
|
+
*/
|
|
14395
|
+
function labelFor(item, getWidgetConfig) {
|
|
14396
|
+
var _item$userPrefs, _item$userConfig;
|
|
14397
|
+
var cfg = (getWidgetConfig === null || getWidgetConfig === void 0 ? void 0 : getWidgetConfig(item.component)) || null;
|
|
14398
|
+
var explicit = (item === null || item === void 0 || (_item$userPrefs = item.userPrefs) === null || _item$userPrefs === void 0 ? void 0 : _item$userPrefs.title) || (item === null || item === void 0 || (_item$userConfig = item.userConfig) === null || _item$userConfig === void 0 ? void 0 : _item$userConfig.title);
|
|
14399
|
+
if (explicit) return explicit;
|
|
14400
|
+
if (cfg !== null && cfg !== void 0 && cfg.displayName) return cfg.displayName;
|
|
14401
|
+
var id = itemIdOf(item);
|
|
14402
|
+
return "".concat(item.component || "widget").concat(id ? "[".concat(String(id).slice(0, 6), "]") : "");
|
|
14403
|
+
}
|
|
14404
|
+
|
|
14405
|
+
/**
|
|
14406
|
+
* Read the events/eventHandlers metadata for a widget. Items can carry
|
|
14407
|
+
* the arrays inline (older pattern where they got cached onto the
|
|
14408
|
+
* layout item); the current component config carries them via the
|
|
14409
|
+
* ComponentManager catalog. We UNION both so we don't flag a binding
|
|
14410
|
+
* as orphaned just because an inline cache is stale — if the current
|
|
14411
|
+
* widget code declares the event/handler, the binding is valid.
|
|
14412
|
+
*/
|
|
14413
|
+
function eventsOf(item, getWidgetConfig) {
|
|
14414
|
+
var inline = Array.isArray(item.events) ? item.events : [];
|
|
14415
|
+
var cfg = (getWidgetConfig === null || getWidgetConfig === void 0 ? void 0 : getWidgetConfig(item.component)) || {};
|
|
14416
|
+
var fromCfg = Array.isArray(cfg.events) ? cfg.events : [];
|
|
14417
|
+
return _toConsumableArray(new Set([].concat(_toConsumableArray(inline), _toConsumableArray(fromCfg))));
|
|
14418
|
+
}
|
|
14419
|
+
function eventHandlersOf(item, getWidgetConfig) {
|
|
14420
|
+
var inline = Array.isArray(item.eventHandlers) ? item.eventHandlers : [];
|
|
14421
|
+
var cfg = (getWidgetConfig === null || getWidgetConfig === void 0 ? void 0 : getWidgetConfig(item.component)) || {};
|
|
14422
|
+
var fromCfg = Array.isArray(cfg.eventHandlers) ? cfg.eventHandlers : [];
|
|
14423
|
+
return _toConsumableArray(new Set([].concat(_toConsumableArray(inline), _toConsumableArray(fromCfg))));
|
|
14424
|
+
}
|
|
14425
|
+
|
|
14426
|
+
/**
|
|
14427
|
+
* Every widget instance in the workspace that emits at least one event.
|
|
14428
|
+
* Deduplicated by `${component}|${itemId}` — the same compound key that
|
|
14429
|
+
* event strings use at runtime, so any "duplicate" in the tree (same
|
|
14430
|
+
* widget referenced across pages) resolves to the same wiring target.
|
|
14431
|
+
* @returns {Array<{ itemId, component, label, events: string[], key: string }>}
|
|
14432
|
+
*/
|
|
14433
|
+
function getEmitters(workspace, getWidgetConfig) {
|
|
14434
|
+
var byKey = new Map();
|
|
14435
|
+
forEachWidget(workspace, function (item) {
|
|
14436
|
+
var events = eventsOf(item, getWidgetConfig);
|
|
14437
|
+
if (events.length === 0) return;
|
|
14438
|
+
var key = canonicalItemKey(item);
|
|
14439
|
+
if (!key) return;
|
|
14440
|
+
if (byKey.has(key)) return;
|
|
14441
|
+
byKey.set(key, {
|
|
14442
|
+
key: key,
|
|
14443
|
+
itemId: itemIdOf(item),
|
|
14444
|
+
component: item.component,
|
|
14445
|
+
label: labelFor(item, getWidgetConfig),
|
|
14446
|
+
events: events
|
|
14447
|
+
});
|
|
14448
|
+
});
|
|
14449
|
+
return Array.from(byKey.values());
|
|
14450
|
+
}
|
|
14451
|
+
|
|
14452
|
+
/**
|
|
14453
|
+
* Every widget instance in the workspace that accepts at least one
|
|
14454
|
+
* handler. Used to populate the receiver dropdown. Deduplicated by
|
|
14455
|
+
* `${component}|${itemId}` (see getEmitters).
|
|
14456
|
+
* @returns {Array<{ itemId, component, label, eventHandlers: string[], listeners: object, key: string }>}
|
|
14457
|
+
*/
|
|
14458
|
+
function getReceivers(workspace, getWidgetConfig) {
|
|
14459
|
+
var byKey = new Map();
|
|
14460
|
+
forEachWidget(workspace, function (item) {
|
|
14461
|
+
var handlers = eventHandlersOf(item, getWidgetConfig);
|
|
14462
|
+
if (handlers.length === 0) return;
|
|
14463
|
+
var key = canonicalItemKey(item);
|
|
14464
|
+
if (!key) return;
|
|
14465
|
+
if (byKey.has(key)) return;
|
|
14466
|
+
byKey.set(key, {
|
|
14467
|
+
key: key,
|
|
14468
|
+
itemId: itemIdOf(item),
|
|
14469
|
+
component: item.component,
|
|
14470
|
+
label: labelFor(item, getWidgetConfig),
|
|
14471
|
+
eventHandlers: handlers,
|
|
14472
|
+
listeners: item.listeners || {}
|
|
14473
|
+
});
|
|
14474
|
+
});
|
|
14475
|
+
return Array.from(byKey.values());
|
|
14476
|
+
}
|
|
14477
|
+
|
|
14478
|
+
/**
|
|
14479
|
+
* Flatten every listener binding in the workspace into a list of
|
|
14480
|
+
* { receiverItemId, receiverComponent, handlerName, sourceComponent,
|
|
14481
|
+
* sourceItemId, eventName, raw } tuples. `raw` is the original
|
|
14482
|
+
* event string for round-trip fidelity on remove.
|
|
14483
|
+
*/
|
|
14484
|
+
function getCurrentWiring(workspace) {
|
|
14485
|
+
var wiring = [];
|
|
14486
|
+
forEachWidget(workspace, function (item) {
|
|
14487
|
+
var receiverItemId = itemIdOf(item);
|
|
14488
|
+
if (receiverItemId == null) return;
|
|
14489
|
+
var listeners = item.listeners;
|
|
14490
|
+
if (!listeners || _typeof(listeners) !== "object") return;
|
|
14491
|
+
for (var _i = 0, _Object$entries = Object.entries(listeners); _i < _Object$entries.length; _i++) {
|
|
14492
|
+
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
14493
|
+
handlerName = _Object$entries$_i[0],
|
|
14494
|
+
eventList = _Object$entries$_i[1];
|
|
14495
|
+
// Live format is array; defensive guard for legacy object
|
|
14496
|
+
// form (a single source widget keyed under the handler).
|
|
14497
|
+
var events = Array.isArray(eventList) ? eventList : typeof eventList === "string" ? [eventList] : [];
|
|
14498
|
+
var _iterator = _createForOfIteratorHelper$n(events),
|
|
14499
|
+
_step;
|
|
14500
|
+
try {
|
|
14501
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
14502
|
+
var raw = _step.value;
|
|
14503
|
+
var parsed = parseEventString(raw);
|
|
14504
|
+
if (!parsed) continue;
|
|
14505
|
+
wiring.push({
|
|
14506
|
+
receiverItemId: receiverItemId,
|
|
14507
|
+
receiverComponent: item.component,
|
|
14508
|
+
handlerName: handlerName,
|
|
14509
|
+
sourceComponent: parsed.component,
|
|
14510
|
+
sourceItemId: parsed.itemId,
|
|
14511
|
+
eventName: parsed.event,
|
|
14512
|
+
raw: raw
|
|
14513
|
+
});
|
|
14514
|
+
}
|
|
14515
|
+
} catch (err) {
|
|
14516
|
+
_iterator.e(err);
|
|
14517
|
+
} finally {
|
|
14518
|
+
_iterator.f();
|
|
14519
|
+
}
|
|
14520
|
+
}
|
|
14521
|
+
});
|
|
14522
|
+
return wiring;
|
|
14523
|
+
}
|
|
14524
|
+
|
|
14525
|
+
/**
|
|
14526
|
+
* Detect listener bindings that are no longer valid: the source widget
|
|
14527
|
+
* doesn't exist in the workspace anymore, or the source widget doesn't
|
|
14528
|
+
* declare the event, or the receiver doesn't declare the handler.
|
|
14529
|
+
* Each entry includes a `reason` so the modal can show a sensible
|
|
14530
|
+
* message.
|
|
14531
|
+
*/
|
|
14532
|
+
function getOrphanedListeners(workspace, getWidgetConfig) {
|
|
14533
|
+
var wiring = getCurrentWiring(workspace);
|
|
14534
|
+
if (wiring.length === 0) return [];
|
|
14535
|
+
|
|
14536
|
+
// Build two lookups:
|
|
14537
|
+
// byCompositeKey: `${component}|${itemId}` → widget meta (primary)
|
|
14538
|
+
// byItemId: `${itemId}` → widget meta (fallback,
|
|
14539
|
+
// used only for the "source-missing" check where
|
|
14540
|
+
// the wiring's component can't be trusted yet)
|
|
14541
|
+
// The composite key matches how the runtime event-string
|
|
14542
|
+
// (`Component[itemId].event`) identifies a widget, so orphan
|
|
14543
|
+
// decisions line up with what actually fires at runtime.
|
|
14544
|
+
var byCompositeKey = new Map();
|
|
14545
|
+
var byItemId = new Map();
|
|
14546
|
+
forEachWidget(workspace, function (item) {
|
|
14547
|
+
var id = itemIdOf(item);
|
|
14548
|
+
if (id == null) return;
|
|
14549
|
+
var meta = {
|
|
14550
|
+
component: item.component,
|
|
14551
|
+
events: eventsOf(item, getWidgetConfig),
|
|
14552
|
+
eventHandlers: eventHandlersOf(item, getWidgetConfig)
|
|
14553
|
+
};
|
|
14554
|
+
byCompositeKey.set("".concat(item.component, "|").concat(id), meta);
|
|
14555
|
+
// First-seen wins on numeric-id collisions; good enough for the
|
|
14556
|
+
// "does any widget with this id exist?" fallback.
|
|
14557
|
+
if (!byItemId.has(id)) byItemId.set(id, meta);
|
|
14558
|
+
});
|
|
14559
|
+
var orphans = [];
|
|
14560
|
+
var _iterator2 = _createForOfIteratorHelper$n(wiring),
|
|
14561
|
+
_step2;
|
|
14562
|
+
try {
|
|
14563
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
14564
|
+
var w = _step2.value;
|
|
14565
|
+
var srcKey = "".concat(w.sourceComponent, "|").concat(w.sourceItemId);
|
|
14566
|
+
var src = byCompositeKey.get(srcKey);
|
|
14567
|
+
if (!src) {
|
|
14568
|
+
// No (component, id) match. If some OTHER widget still owns
|
|
14569
|
+
// this id, the source component changed; otherwise it's truly
|
|
14570
|
+
// missing. Preserves the user's ability to see whether a
|
|
14571
|
+
// rename happened vs. a delete.
|
|
14572
|
+
var fallback = byItemId.get(String(w.sourceItemId));
|
|
14573
|
+
orphans.push(_objectSpread$O(_objectSpread$O({}, w), {}, {
|
|
14574
|
+
reason: fallback ? "source-component-mismatch" : "source-missing"
|
|
14575
|
+
}));
|
|
14576
|
+
continue;
|
|
14577
|
+
}
|
|
14578
|
+
if (!src.events.includes(w.eventName)) {
|
|
14579
|
+
orphans.push(_objectSpread$O(_objectSpread$O({}, w), {}, {
|
|
14580
|
+
reason: "event-not-emitted"
|
|
14581
|
+
}));
|
|
14582
|
+
continue;
|
|
14583
|
+
}
|
|
14584
|
+
var receiverKey = "".concat(w.receiverComponent, "|").concat(w.receiverItemId);
|
|
14585
|
+
var receiver = byCompositeKey.get(receiverKey);
|
|
14586
|
+
if (receiver && !receiver.eventHandlers.includes(w.handlerName)) {
|
|
14587
|
+
orphans.push(_objectSpread$O(_objectSpread$O({}, w), {}, {
|
|
14588
|
+
reason: "handler-not-declared"
|
|
14589
|
+
}));
|
|
14590
|
+
}
|
|
14591
|
+
}
|
|
14592
|
+
} catch (err) {
|
|
14593
|
+
_iterator2.e(err);
|
|
14594
|
+
} finally {
|
|
14595
|
+
_iterator2.f();
|
|
14596
|
+
}
|
|
14597
|
+
return orphans;
|
|
14598
|
+
}
|
|
14599
|
+
|
|
14600
|
+
/**
|
|
14601
|
+
* Mutate a workspace tree in place, removing listener bindings whose
|
|
14602
|
+
* source widget is not present in the workspace. Pure: doesn't need
|
|
14603
|
+
* ComponentManager, so it's safe to call from WorkspaceModel during
|
|
14604
|
+
* load — the workspace's own tree is the only source of truth.
|
|
14605
|
+
*
|
|
14606
|
+
* Handles the four cases producing a "source-missing" orphan:
|
|
14607
|
+
* - the emitter widget was deleted
|
|
14608
|
+
* - the emitter widget's id now belongs to a different component
|
|
14609
|
+
* (stored binding has stale component name)
|
|
14610
|
+
* - the source string failed to parse (legacy/garbage data)
|
|
14611
|
+
*
|
|
14612
|
+
* Leaves "event-not-emitted" / "handler-not-declared" cases untouched
|
|
14613
|
+
* because they require the current widget catalog to decide — those
|
|
14614
|
+
* are handled at runtime with full ComponentManager access.
|
|
14615
|
+
*
|
|
14616
|
+
* @returns {number} count of bindings removed (for logging/diagnostics)
|
|
14617
|
+
*/
|
|
14618
|
+
function pruneDeadListenerReferences(workspace) {
|
|
14619
|
+
if (!workspace) return 0;
|
|
14620
|
+
|
|
14621
|
+
// Build the set of live widgets in the tree, keyed by the same
|
|
14622
|
+
// `${component}|${itemId}` the runtime uses to resolve events.
|
|
14623
|
+
var liveKeys = new Set();
|
|
14624
|
+
var _walkForLive = function walkForLive(items) {
|
|
14625
|
+
if (!Array.isArray(items)) return;
|
|
14626
|
+
var _iterator3 = _createForOfIteratorHelper$n(items),
|
|
14627
|
+
_step3;
|
|
14628
|
+
try {
|
|
14629
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
14630
|
+
var item = _step3.value;
|
|
14631
|
+
if (!item || _typeof(item) !== "object") continue;
|
|
14632
|
+
if (item.component) {
|
|
14633
|
+
var id = itemIdOf(item);
|
|
14634
|
+
if (id != null) liveKeys.add("".concat(item.component, "|").concat(id));
|
|
14635
|
+
}
|
|
14636
|
+
if (Array.isArray(item.items)) _walkForLive(item.items);
|
|
14637
|
+
if (Array.isArray(item.layout)) _walkForLive(item.layout);
|
|
14638
|
+
}
|
|
14639
|
+
} catch (err) {
|
|
14640
|
+
_iterator3.e(err);
|
|
14641
|
+
} finally {
|
|
14642
|
+
_iterator3.f();
|
|
14643
|
+
}
|
|
14644
|
+
};
|
|
14645
|
+
_walkForLive(workspace.layout);
|
|
14646
|
+
if (Array.isArray(workspace.pages)) {
|
|
14647
|
+
var _iterator4 = _createForOfIteratorHelper$n(workspace.pages),
|
|
14648
|
+
_step4;
|
|
14649
|
+
try {
|
|
14650
|
+
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
14651
|
+
var page = _step4.value;
|
|
14652
|
+
_walkForLive(page === null || page === void 0 ? void 0 : page.layout);
|
|
14653
|
+
}
|
|
14654
|
+
} catch (err) {
|
|
14655
|
+
_iterator4.e(err);
|
|
14656
|
+
} finally {
|
|
14657
|
+
_iterator4.f();
|
|
14658
|
+
}
|
|
14659
|
+
}
|
|
14660
|
+
_walkForLive(workspace.sidebarLayout);
|
|
14661
|
+
var removed = 0;
|
|
14662
|
+
var _pruneListeners = function pruneListeners(items) {
|
|
14663
|
+
if (!Array.isArray(items)) return;
|
|
14664
|
+
var _iterator5 = _createForOfIteratorHelper$n(items),
|
|
14665
|
+
_step5;
|
|
14666
|
+
try {
|
|
14667
|
+
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
14668
|
+
var item = _step5.value;
|
|
14669
|
+
if (!item || _typeof(item) !== "object") continue;
|
|
14670
|
+
if (item.listeners && _typeof(item.listeners) === "object") {
|
|
14671
|
+
for (var _i2 = 0, _Object$keys = Object.keys(item.listeners); _i2 < _Object$keys.length; _i2++) {
|
|
14672
|
+
var handler = _Object$keys[_i2];
|
|
14673
|
+
var events = item.listeners[handler];
|
|
14674
|
+
if (!Array.isArray(events)) continue;
|
|
14675
|
+
var kept = [];
|
|
14676
|
+
var _iterator6 = _createForOfIteratorHelper$n(events),
|
|
14677
|
+
_step6;
|
|
14678
|
+
try {
|
|
14679
|
+
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
14680
|
+
var raw = _step6.value;
|
|
14681
|
+
var parsed = parseEventString(raw);
|
|
14682
|
+
if (parsed && liveKeys.has("".concat(parsed.component, "|").concat(parsed.itemId))) {
|
|
14683
|
+
kept.push(raw);
|
|
14684
|
+
} else {
|
|
14685
|
+
removed += 1;
|
|
14686
|
+
}
|
|
14687
|
+
}
|
|
14688
|
+
} catch (err) {
|
|
14689
|
+
_iterator6.e(err);
|
|
14690
|
+
} finally {
|
|
14691
|
+
_iterator6.f();
|
|
14692
|
+
}
|
|
14693
|
+
if (kept.length === 0) {
|
|
14694
|
+
delete item.listeners[handler];
|
|
14695
|
+
} else if (kept.length !== events.length) {
|
|
14696
|
+
item.listeners[handler] = kept;
|
|
14697
|
+
}
|
|
14698
|
+
}
|
|
14699
|
+
}
|
|
14700
|
+
if (Array.isArray(item.items)) _pruneListeners(item.items);
|
|
14701
|
+
if (Array.isArray(item.layout)) _pruneListeners(item.layout);
|
|
14702
|
+
}
|
|
14703
|
+
} catch (err) {
|
|
14704
|
+
_iterator5.e(err);
|
|
14705
|
+
} finally {
|
|
14706
|
+
_iterator5.f();
|
|
14707
|
+
}
|
|
14708
|
+
};
|
|
14709
|
+
_pruneListeners(workspace.layout);
|
|
14710
|
+
if (Array.isArray(workspace.pages)) {
|
|
14711
|
+
var _iterator7 = _createForOfIteratorHelper$n(workspace.pages),
|
|
14712
|
+
_step7;
|
|
14713
|
+
try {
|
|
14714
|
+
for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
|
|
14715
|
+
var _page = _step7.value;
|
|
14716
|
+
_pruneListeners(_page === null || _page === void 0 ? void 0 : _page.layout);
|
|
14717
|
+
}
|
|
14718
|
+
} catch (err) {
|
|
14719
|
+
_iterator7.e(err);
|
|
14720
|
+
} finally {
|
|
14721
|
+
_iterator7.f();
|
|
14722
|
+
}
|
|
14723
|
+
}
|
|
14724
|
+
_pruneListeners(workspace.sidebarLayout);
|
|
14725
|
+
return removed;
|
|
14726
|
+
}
|
|
14727
|
+
|
|
14728
|
+
/**
|
|
14729
|
+
* Apply a staged delta to a workspace's listener bindings and return a
|
|
14730
|
+
* NEW workspace object (deep-cloned along the modified path).
|
|
14731
|
+
*
|
|
14732
|
+
* `adds` / `removes` are arrays of
|
|
14733
|
+
* { receiverItemId, handlerName, sourceComponent, sourceItemId, eventName }
|
|
14734
|
+
*
|
|
14735
|
+
* Removes may also pass `raw` (the exact pre-existing event string) for
|
|
14736
|
+
* a precise match; otherwise we match on the canonical formatted form.
|
|
14737
|
+
*/
|
|
14738
|
+
function applyWiringChanges(workspace, _ref) {
|
|
14739
|
+
var _ref$adds = _ref.adds,
|
|
14740
|
+
adds = _ref$adds === void 0 ? [] : _ref$adds,
|
|
14741
|
+
_ref$removes = _ref.removes,
|
|
14742
|
+
removes = _ref$removes === void 0 ? [] : _ref$removes;
|
|
14743
|
+
if (!workspace) return workspace;
|
|
14744
|
+
if (adds.length === 0 && removes.length === 0) return workspace;
|
|
14745
|
+
|
|
14746
|
+
// Group changes by receiver for cheap per-item updates.
|
|
14747
|
+
var byReceiver = new Map();
|
|
14748
|
+
var ensure = function ensure(id) {
|
|
14749
|
+
if (!byReceiver.has(id)) byReceiver.set(id, {
|
|
14750
|
+
adds: [],
|
|
14751
|
+
removes: []
|
|
14752
|
+
});
|
|
14753
|
+
return byReceiver.get(id);
|
|
14754
|
+
};
|
|
14755
|
+
var _iterator8 = _createForOfIteratorHelper$n(adds),
|
|
14756
|
+
_step8;
|
|
14757
|
+
try {
|
|
14758
|
+
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
14759
|
+
var a = _step8.value;
|
|
14760
|
+
if (!a.receiverItemId) continue;
|
|
14761
|
+
ensure(String(a.receiverItemId)).adds.push(a);
|
|
14762
|
+
}
|
|
14763
|
+
} catch (err) {
|
|
14764
|
+
_iterator8.e(err);
|
|
14765
|
+
} finally {
|
|
14766
|
+
_iterator8.f();
|
|
14767
|
+
}
|
|
14768
|
+
var _iterator9 = _createForOfIteratorHelper$n(removes),
|
|
14769
|
+
_step9;
|
|
14770
|
+
try {
|
|
14771
|
+
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
14772
|
+
var r = _step9.value;
|
|
14773
|
+
if (!r.receiverItemId) continue;
|
|
14774
|
+
ensure(String(r.receiverItemId)).removes.push(r);
|
|
14775
|
+
}
|
|
14776
|
+
|
|
14777
|
+
// Walk the tree and rebuild listeners on every touched item. We do
|
|
14778
|
+
// shallow clones along the path so React change detection is
|
|
14779
|
+
// reliable — but the tree shape is preserved.
|
|
14780
|
+
} catch (err) {
|
|
14781
|
+
_iterator9.e(err);
|
|
14782
|
+
} finally {
|
|
14783
|
+
_iterator9.f();
|
|
14784
|
+
}
|
|
14785
|
+
var cloneList = function cloneList(items) {
|
|
14786
|
+
return Array.isArray(items) ? items.map(function (item) {
|
|
14787
|
+
return transform(item);
|
|
14788
|
+
}) : items;
|
|
14789
|
+
};
|
|
14790
|
+
var transform = function transform(item) {
|
|
14791
|
+
if (!item || _typeof(item) !== "object") return item;
|
|
14792
|
+
var next = item;
|
|
14793
|
+
var id = itemIdOf(item);
|
|
14794
|
+
var change = id != null ? byReceiver.get(String(id)) : null;
|
|
14795
|
+
if (change) {
|
|
14796
|
+
var newListeners = applyToItem(item.listeners || {}, change);
|
|
14797
|
+
next = _objectSpread$O(_objectSpread$O({}, next), {}, {
|
|
14798
|
+
listeners: newListeners
|
|
14799
|
+
});
|
|
14800
|
+
}
|
|
14801
|
+
if (Array.isArray(next.items)) {
|
|
14802
|
+
next = _objectSpread$O(_objectSpread$O({}, next), {}, {
|
|
14803
|
+
items: cloneList(next.items)
|
|
14804
|
+
});
|
|
14805
|
+
}
|
|
14806
|
+
if (Array.isArray(next.layout)) {
|
|
14807
|
+
next = _objectSpread$O(_objectSpread$O({}, next), {}, {
|
|
14808
|
+
layout: cloneList(next.layout)
|
|
14809
|
+
});
|
|
14810
|
+
}
|
|
14811
|
+
return next;
|
|
14812
|
+
};
|
|
14813
|
+
var updatedWs = _objectSpread$O({}, workspace);
|
|
14814
|
+
if (Array.isArray(workspace.layout)) {
|
|
14815
|
+
updatedWs.layout = cloneList(workspace.layout);
|
|
14816
|
+
}
|
|
14817
|
+
if (Array.isArray(workspace.pages)) {
|
|
14818
|
+
updatedWs.pages = workspace.pages.map(function (page) {
|
|
14819
|
+
return _objectSpread$O(_objectSpread$O({}, page), {}, {
|
|
14820
|
+
layout: cloneList(page.layout)
|
|
14821
|
+
});
|
|
14822
|
+
});
|
|
14823
|
+
}
|
|
14824
|
+
if (Array.isArray(workspace.sidebarLayout)) {
|
|
14825
|
+
updatedWs.sidebarLayout = cloneList(workspace.sidebarLayout);
|
|
14826
|
+
}
|
|
14827
|
+
return updatedWs;
|
|
14828
|
+
}
|
|
14829
|
+
function applyToItem(listeners, _ref2) {
|
|
14830
|
+
var adds = _ref2.adds,
|
|
14831
|
+
removes = _ref2.removes;
|
|
14832
|
+
// Deep enough clone for handler arrays.
|
|
14833
|
+
var next = {};
|
|
14834
|
+
for (var _i3 = 0, _Object$entries2 = Object.entries(listeners); _i3 < _Object$entries2.length; _i3++) {
|
|
14835
|
+
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i3], 2),
|
|
14836
|
+
k = _Object$entries2$_i[0],
|
|
14837
|
+
v = _Object$entries2$_i[1];
|
|
14838
|
+
next[k] = Array.isArray(v) ? _toConsumableArray(v) : v;
|
|
14839
|
+
}
|
|
14840
|
+
|
|
14841
|
+
// Removes first so a re-add (rare) lands.
|
|
14842
|
+
var _iterator0 = _createForOfIteratorHelper$n(removes),
|
|
14843
|
+
_step0;
|
|
14844
|
+
try {
|
|
14845
|
+
var _loop = function _loop() {
|
|
14846
|
+
var r = _step0.value;
|
|
14847
|
+
var target = r.handlerName;
|
|
14848
|
+
if (!target) return 0; // continue
|
|
14849
|
+
var events = next[target];
|
|
14850
|
+
if (!Array.isArray(events)) return 0; // continue
|
|
14851
|
+
var eventStr = r.raw || formatEventString(r.sourceComponent, r.sourceItemId, r.eventName);
|
|
14852
|
+
var filtered = events.filter(function (e) {
|
|
14853
|
+
return e !== eventStr;
|
|
14854
|
+
});
|
|
14855
|
+
if (filtered.length === 0) {
|
|
14856
|
+
delete next[target];
|
|
14857
|
+
} else {
|
|
14858
|
+
next[target] = filtered;
|
|
14859
|
+
}
|
|
14860
|
+
},
|
|
14861
|
+
_ret;
|
|
14862
|
+
for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
|
|
14863
|
+
_ret = _loop();
|
|
14864
|
+
if (_ret === 0) continue;
|
|
14865
|
+
}
|
|
14866
|
+
} catch (err) {
|
|
14867
|
+
_iterator0.e(err);
|
|
14868
|
+
} finally {
|
|
14869
|
+
_iterator0.f();
|
|
14870
|
+
}
|
|
14871
|
+
var _iterator1 = _createForOfIteratorHelper$n(adds),
|
|
14872
|
+
_step1;
|
|
14873
|
+
try {
|
|
14874
|
+
for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
|
|
14875
|
+
var a = _step1.value;
|
|
14876
|
+
var target = a.handlerName;
|
|
14877
|
+
if (!target) continue;
|
|
14878
|
+
var eventStr = formatEventString(a.sourceComponent, a.sourceItemId, a.eventName);
|
|
14879
|
+
var existing = Array.isArray(next[target]) ? next[target] : [];
|
|
14880
|
+
if (existing.includes(eventStr)) continue;
|
|
14881
|
+
next[target] = [].concat(_toConsumableArray(existing), [eventStr]);
|
|
14882
|
+
}
|
|
14883
|
+
} catch (err) {
|
|
14884
|
+
_iterator1.e(err);
|
|
14885
|
+
} finally {
|
|
14886
|
+
_iterator1.f();
|
|
14887
|
+
}
|
|
14888
|
+
return next;
|
|
14889
|
+
}
|
|
14890
|
+
|
|
14891
|
+
var SectionLayout = function SectionLayout(_ref) {
|
|
14892
|
+
var listContent = _ref.listContent,
|
|
14893
|
+
_ref$detailContent = _ref.detailContent,
|
|
14894
|
+
detailContent = _ref$detailContent === void 0 ? null : _ref$detailContent,
|
|
14895
|
+
_ref$listWidth = _ref.listWidth,
|
|
14896
|
+
listWidth = _ref$listWidth === void 0 ? "w-80" : _ref$listWidth,
|
|
14897
|
+
_ref$emptyDetailMessa = _ref.emptyDetailMessage,
|
|
14898
|
+
emptyDetailMessage = _ref$emptyDetailMessa === void 0 ? "Select an item to view details" : _ref$emptyDetailMessa;
|
|
14899
|
+
var _useContext = React.useContext(DashReact.ThemeContext),
|
|
14900
|
+
currentTheme = _useContext.currentTheme;
|
|
14901
|
+
var panelStyles = DashReact.getStylesForItem(DashReact.themeObjects.PANEL, currentTheme, {
|
|
14902
|
+
grow: false
|
|
14903
|
+
});
|
|
14904
|
+
var headerStyles = DashReact.getStylesForItem(DashReact.themeObjects.PANEL_HEADER, currentTheme, {
|
|
14905
|
+
grow: false
|
|
14906
|
+
});
|
|
14907
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14908
|
+
className: "flex flex-row flex-1 min-h-0 ".concat(panelStyles.textColor || "text-gray-200"),
|
|
14909
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14910
|
+
className: "flex flex-col flex-shrink-0 ".concat(listWidth, " border-r ").concat(headerStyles.borderColor || "", " overflow-y-auto"),
|
|
14911
|
+
children: listContent
|
|
14912
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14913
|
+
className: "flex flex-col flex-1 min-w-0 min-h-0",
|
|
14914
|
+
children: detailContent ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14915
|
+
className: "flex flex-col flex-1 min-h-0",
|
|
14916
|
+
children: detailContent
|
|
14917
|
+
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14918
|
+
className: "flex flex-1 items-center justify-center",
|
|
14919
|
+
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
14920
|
+
className: "text-sm opacity-40",
|
|
14921
|
+
children: emptyDetailMessage
|
|
14922
|
+
})
|
|
14923
|
+
})
|
|
14924
|
+
})]
|
|
14925
|
+
});
|
|
14926
|
+
};
|
|
14927
|
+
|
|
14928
|
+
var PanelEditItemHandlers = function PanelEditItemHandlers(_ref) {
|
|
14929
|
+
var workspace = _ref.workspace,
|
|
14930
|
+
onUpdate = _ref.onUpdate,
|
|
14931
|
+
_ref$item = _ref.item,
|
|
14932
|
+
item = _ref$item === void 0 ? null : _ref$item;
|
|
14933
|
+
var _useState = React.useState(item),
|
|
14934
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
14935
|
+
itemSelected = _useState2[0],
|
|
14936
|
+
setItemSelected = _useState2[1];
|
|
14937
|
+
var _useState3 = React.useState(workspace),
|
|
14938
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
14939
|
+
workspaceSelected = _useState4[0],
|
|
14940
|
+
setWorkspaceSelected = _useState4[1];
|
|
14941
|
+
var _useState5 = React.useState(null),
|
|
14942
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
14943
|
+
eventHandlerSelected = _useState6[0],
|
|
14944
|
+
setEventHandlerSelected = _useState6[1];
|
|
14945
|
+
React.useEffect(function () {
|
|
14946
|
+
if (deepEqual$1(item, itemSelected) === false) {
|
|
14947
|
+
setItemSelected(function () {
|
|
14948
|
+
return item;
|
|
14949
|
+
});
|
|
14950
|
+
}
|
|
14951
|
+
if (deepEqual$1(workspace, workspaceSelected) === false) {
|
|
14952
|
+
setWorkspaceSelected(function () {
|
|
14953
|
+
return workspace;
|
|
14954
|
+
});
|
|
14955
|
+
}
|
|
14956
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14957
|
+
}, [workspace, item]);
|
|
14958
|
+
|
|
14959
|
+
// Build the deduped list of source widgets — every widget in the
|
|
14960
|
+
// workspace that emits at least one event AND isn't the receiver
|
|
14961
|
+
// itself. forEachWidget dedupes by `${component}|${id}` so a widget
|
|
14962
|
+
// referenced from multiple locations (root layout AND pages) shows
|
|
14963
|
+
// up once.
|
|
14964
|
+
var sourceWidgets = function () {
|
|
14965
|
+
var list = [];
|
|
14966
|
+
var seen = new Set();
|
|
14967
|
+
forEachWidget(workspaceSelected, function (li) {
|
|
14968
|
+
if (!li || !li.component) return;
|
|
14969
|
+
if (li.component === "Container" || li.component === "LayoutContainer") {
|
|
14970
|
+
return;
|
|
14971
|
+
}
|
|
14972
|
+
if (li.id === (itemSelected === null || itemSelected === void 0 ? void 0 : itemSelected.id) && li.component === (itemSelected === null || itemSelected === void 0 ? void 0 : itemSelected.component)) {
|
|
14973
|
+
return;
|
|
14974
|
+
}
|
|
14975
|
+
if (!Array.isArray(li.events) || li.events.length === 0) return;
|
|
14976
|
+
var key = "".concat(li.component, "|").concat(li.id);
|
|
14977
|
+
if (seen.has(key)) return;
|
|
14978
|
+
seen.add(key);
|
|
14979
|
+
list.push(li);
|
|
14980
|
+
});
|
|
14981
|
+
return list;
|
|
14982
|
+
}();
|
|
14983
|
+
function handleSelectEventHandler(handler) {
|
|
14984
|
+
setEventHandlerSelected(function () {
|
|
14985
|
+
return handler;
|
|
14986
|
+
});
|
|
14987
|
+
}
|
|
14988
|
+
function commitChange(_ref2) {
|
|
14989
|
+
var _ref2$adds = _ref2.adds,
|
|
14990
|
+
adds = _ref2$adds === void 0 ? [] : _ref2$adds,
|
|
14991
|
+
_ref2$removes = _ref2.removes,
|
|
14992
|
+
removes = _ref2$removes === void 0 ? [] : _ref2$removes;
|
|
14993
|
+
if (!workspaceSelected || !itemSelected) return;
|
|
14994
|
+
if (adds.length === 0 && removes.length === 0) return;
|
|
14995
|
+
var nextWorkspace = applyWiringChanges(workspaceSelected, {
|
|
14996
|
+
adds: adds,
|
|
14997
|
+
removes: removes
|
|
14998
|
+
});
|
|
14999
|
+
// Find the post-change receiver item so the parent's onUpdate
|
|
15000
|
+
// gets the updated layout-item shape (some callers cache it).
|
|
15001
|
+
var nextItem = itemSelected;
|
|
15002
|
+
forEachWidget(nextWorkspace, function (li) {
|
|
15003
|
+
if ((li === null || li === void 0 ? void 0 : li.id) === itemSelected.id && li.component === itemSelected.component) {
|
|
15004
|
+
nextItem = li;
|
|
15005
|
+
}
|
|
15006
|
+
});
|
|
15007
|
+
setWorkspaceSelected(nextWorkspace);
|
|
15008
|
+
setItemSelected(nextItem);
|
|
15009
|
+
onUpdate(nextItem, nextWorkspace);
|
|
15010
|
+
}
|
|
15011
|
+
function handleSelectEvent(eventString) {
|
|
15012
|
+
if (!eventString || !eventHandlerSelected) return;
|
|
15013
|
+
var parsed = parseEventString(eventString);
|
|
15014
|
+
if (!parsed) return;
|
|
15015
|
+
commitChange({
|
|
15016
|
+
adds: [{
|
|
15017
|
+
receiverItemId: itemSelected.id,
|
|
15018
|
+
handlerName: eventHandlerSelected,
|
|
15019
|
+
sourceComponent: parsed.component,
|
|
15020
|
+
sourceItemId: parsed.itemId,
|
|
15021
|
+
eventName: parsed.event
|
|
15022
|
+
}]
|
|
15023
|
+
});
|
|
15024
|
+
}
|
|
15025
|
+
function handleRemoveEvent(eventString) {
|
|
15026
|
+
if (!eventString || !eventHandlerSelected) return;
|
|
15027
|
+
var parsed = parseEventString(eventString);
|
|
15028
|
+
if (!parsed) return;
|
|
15029
|
+
commitChange({
|
|
15030
|
+
removes: [{
|
|
15031
|
+
receiverItemId: itemSelected.id,
|
|
15032
|
+
handlerName: eventHandlerSelected,
|
|
15033
|
+
sourceComponent: parsed.component,
|
|
15034
|
+
sourceItemId: parsed.itemId,
|
|
15035
|
+
eventName: parsed.event,
|
|
15036
|
+
raw: eventString
|
|
15037
|
+
}]
|
|
15038
|
+
});
|
|
15039
|
+
}
|
|
15040
|
+
function isSelectedEvent(event) {
|
|
15041
|
+
if (!event || !eventHandlerSelected) return false;
|
|
15042
|
+
var itemListeners = (itemSelected === null || itemSelected === void 0 ? void 0 : itemSelected["listeners"]) || {};
|
|
15043
|
+
var list = itemListeners[eventHandlerSelected];
|
|
15044
|
+
return Array.isArray(list) && list.includes(event);
|
|
15045
|
+
}
|
|
15046
|
+
|
|
15047
|
+
// Get the event handlers for the current item
|
|
15048
|
+
var eventHandlers = Array.isArray(itemSelected === null || itemSelected === void 0 ? void 0 : itemSelected.eventHandlers) ? itemSelected.eventHandlers.filter(function (value, index, array) {
|
|
15049
|
+
return array.indexOf(value) === index;
|
|
15050
|
+
}) : [];
|
|
15051
|
+
|
|
15052
|
+
// Build a set of valid event strings so we only count "connected"
|
|
15053
|
+
// listeners that still point at a live emitter. Stale references
|
|
15054
|
+
// are dropped from the count even before pruneDeadListenerReferences
|
|
15055
|
+
// runs on the next save.
|
|
15056
|
+
var validEventStrings = new Set();
|
|
15057
|
+
sourceWidgets.forEach(function (li) {
|
|
15058
|
+
if (Array.isArray(li.events)) {
|
|
15059
|
+
li.events.forEach(function (event) {
|
|
15060
|
+
validEventStrings.add(formatEventString(li.component, li.id, event));
|
|
15061
|
+
});
|
|
15062
|
+
}
|
|
15063
|
+
});
|
|
15064
|
+
|
|
15065
|
+
// Get the listeners for the current item, filtering out orphaned references
|
|
15066
|
+
var rawListeners = itemSelected ? itemSelected["listeners"] || {} : {};
|
|
15067
|
+
var listeners = {};
|
|
15068
|
+
Object.keys(rawListeners).forEach(function (handler) {
|
|
15069
|
+
var events = rawListeners[handler];
|
|
15070
|
+
if (Array.isArray(events)) {
|
|
15071
|
+
var validEvents = events.filter(function (e) {
|
|
15072
|
+
return validEventStrings.has(e);
|
|
15073
|
+
});
|
|
15074
|
+
if (validEvents.length > 0) {
|
|
15075
|
+
listeners[handler] = validEvents;
|
|
15076
|
+
}
|
|
15077
|
+
}
|
|
15078
|
+
});
|
|
15079
|
+
function getConnectedCount(handler) {
|
|
15080
|
+
return (listeners[handler] || []).length;
|
|
15081
|
+
}
|
|
15082
|
+
|
|
15083
|
+
// Build the list content (left column)
|
|
15084
|
+
var listContent = /*#__PURE__*/jsxRuntime.jsxs(DashReact.Sidebar.Content, {
|
|
15085
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
15086
|
+
className: "px-3 py-2 text-xs font-semibold opacity-40 uppercase tracking-wider",
|
|
15087
|
+
children: "Event Handlers"
|
|
15088
|
+
}), eventHandlers.map(function (handler) {
|
|
15089
|
+
var count = getConnectedCount(handler);
|
|
15090
|
+
var isActive = eventHandlerSelected === handler;
|
|
15091
|
+
return /*#__PURE__*/jsxRuntime.jsx(DashReact.Sidebar.Item, {
|
|
15092
|
+
icon: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
15093
|
+
icon: "bolt",
|
|
15094
|
+
className: "h-3.5 w-3.5"
|
|
15095
|
+
}),
|
|
15096
|
+
active: isActive,
|
|
15097
|
+
onClick: function onClick() {
|
|
15098
|
+
return handleSelectEventHandler(handler);
|
|
15099
|
+
},
|
|
15100
|
+
badge: count > 0 ? String(count) : null,
|
|
15101
|
+
className: isActive ? "bg-white/10 opacity-100" : "",
|
|
15102
|
+
children: handler
|
|
15103
|
+
}, handler);
|
|
15104
|
+
}), eventHandlers.length === 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
15105
|
+
className: "text-sm opacity-40 py-8 text-center",
|
|
15106
|
+
children: "No handlers available"
|
|
15107
|
+
})]
|
|
15108
|
+
});
|
|
15109
|
+
|
|
15110
|
+
// Build the detail content (right column) — when a handler is selected
|
|
15111
|
+
var connectedCount = eventHandlerSelected ? getConnectedCount(eventHandlerSelected) : 0;
|
|
15112
|
+
var detailContent = eventHandlerSelected ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
15113
|
+
className: "flex flex-col flex-1 min-h-0",
|
|
15114
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
15115
|
+
className: "flex-1 min-h-0 overflow-y-auto p-6 space-y-6",
|
|
15116
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
15117
|
+
className: "flex flex-col space-y-1",
|
|
15118
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.SubHeading3, {
|
|
15119
|
+
title: eventHandlerSelected,
|
|
15120
|
+
padding: false
|
|
15121
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
15122
|
+
className: "text-sm opacity-70",
|
|
15123
|
+
children: [connectedCount, " event", connectedCount !== 1 ? "s" : "", " connected"]
|
|
15124
|
+
})]
|
|
15125
|
+
}), sourceWidgets.map(function (layout) {
|
|
15126
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
15127
|
+
className: "flex flex-col space-y-2",
|
|
15128
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
15129
|
+
className: "text-xs font-semibold opacity-40 uppercase tracking-wider",
|
|
15130
|
+
children: [layout["component"], " [", layout["id"], "]"]
|
|
15131
|
+
}), layout.events.filter(function (value, index, array) {
|
|
15132
|
+
return array.indexOf(value) === index;
|
|
15133
|
+
}).map(function (event) {
|
|
15134
|
+
var eventString = formatEventString(layout.component, layout.id, event);
|
|
15135
|
+
var selected = isSelectedEvent(eventString);
|
|
15136
|
+
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
15137
|
+
onClick: function onClick() {
|
|
15138
|
+
return selected ? handleRemoveEvent(eventString) : handleSelectEvent(eventString);
|
|
15139
|
+
},
|
|
15140
|
+
className: "flex flex-row items-center gap-3 px-3 py-2 rounded-md cursor-pointer ".concat(selected ? "opacity-100" : "opacity-60 hover:opacity-80"),
|
|
15141
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
15142
|
+
icon: selected ? "square-check" : "square",
|
|
15143
|
+
className: "h-4 w-4 flex-shrink-0"
|
|
15144
|
+
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
15145
|
+
className: "text-sm",
|
|
15146
|
+
children: event
|
|
15147
|
+
})]
|
|
15148
|
+
}, eventString);
|
|
15149
|
+
})]
|
|
15150
|
+
}, "".concat(layout.component, "|").concat(layout.id));
|
|
15151
|
+
}), sourceWidgets.length === 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
15152
|
+
className: "text-sm opacity-40",
|
|
15153
|
+
children: "No events available from other widgets"
|
|
15154
|
+
})]
|
|
15155
|
+
})
|
|
15156
|
+
}) : null;
|
|
15157
|
+
if (!itemSelected || !workspaceSelected) {
|
|
15158
|
+
return null;
|
|
15159
|
+
}
|
|
15160
|
+
return /*#__PURE__*/jsxRuntime.jsx(SectionLayout, {
|
|
15161
|
+
listContent: listContent,
|
|
15162
|
+
detailContent: detailContent,
|
|
14333
15163
|
listWidth: "w-72",
|
|
14334
15164
|
emptyDetailMessage: "Select a handler to view available events"
|
|
14335
15165
|
});
|
|
@@ -14354,8 +15184,8 @@ var getUserConfigurableProviders = function getUserConfigurableProviders(provide
|
|
|
14354
15184
|
});
|
|
14355
15185
|
};
|
|
14356
15186
|
|
|
14357
|
-
function ownKeys$
|
|
14358
|
-
function _objectSpread$
|
|
15187
|
+
function ownKeys$N(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; }
|
|
15188
|
+
function _objectSpread$N(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$N(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$N(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14359
15189
|
var PanelEditItemProviders = function PanelEditItemProviders(_ref) {
|
|
14360
15190
|
var workspace = _ref.workspace,
|
|
14361
15191
|
onUpdate = _ref.onUpdate,
|
|
@@ -14387,7 +15217,7 @@ var PanelEditItemProviders = function PanelEditItemProviders(_ref) {
|
|
|
14387
15217
|
var selectedProviders = itemSelected.selectedProviders || {};
|
|
14388
15218
|
function handleProviderChange(providerType, providerName) {
|
|
14389
15219
|
var updatedItem = DashReact.deepCopy(itemSelected);
|
|
14390
|
-
var nextProviders = _objectSpread$
|
|
15220
|
+
var nextProviders = _objectSpread$N({}, updatedItem.selectedProviders || {});
|
|
14391
15221
|
if (providerName) {
|
|
14392
15222
|
nextProviders[providerType] = providerName;
|
|
14393
15223
|
} else {
|
|
@@ -14428,7 +15258,7 @@ var PanelEditItemProviders = function PanelEditItemProviders(_ref) {
|
|
|
14428
15258
|
var _ref5 = _slicedToArray(_ref4, 2),
|
|
14429
15259
|
name = _ref5[0],
|
|
14430
15260
|
p = _ref5[1];
|
|
14431
|
-
return _objectSpread$
|
|
15261
|
+
return _objectSpread$N({
|
|
14432
15262
|
name: name
|
|
14433
15263
|
}, p);
|
|
14434
15264
|
});
|
|
@@ -14583,18 +15413,14 @@ var LayoutBuilderConfigModal = function LayoutBuilderConfigModal(_ref) {
|
|
|
14583
15413
|
return s.key === activeSection;
|
|
14584
15414
|
}) || sections[0];
|
|
14585
15415
|
|
|
14586
|
-
// Footer label:
|
|
14587
|
-
//
|
|
15416
|
+
// Footer label: full scoped id (`scope.package.Component`) so the
|
|
15417
|
+
// user always sees the underlying widget identity, even when the
|
|
15418
|
+
// primary title is a custom per-instance label. No workspace fallback.
|
|
14588
15419
|
var footerPackageLabel = function () {
|
|
14589
15420
|
var scopedId = (itemSelected === null || itemSelected === void 0 ? void 0 : itemSelected.component) || "";
|
|
14590
15421
|
if (typeof scopedId !== "string") return "";
|
|
14591
15422
|
var parts = scopedId.split(".");
|
|
14592
|
-
|
|
14593
|
-
var _parts = _slicedToArray(parts, 2),
|
|
14594
|
-
scope = _parts[0],
|
|
14595
|
-
pkg = _parts[1];
|
|
14596
|
-
if (!scope || !pkg) return "";
|
|
14597
|
-
return "@".concat(scope, "/").concat(pkg);
|
|
15423
|
+
return parts.length === 3 ? scopedId : "";
|
|
14598
15424
|
}();
|
|
14599
15425
|
var componentName = itemSelected ? itemSelected["component"] : "";
|
|
14600
15426
|
var footerLeftContent = footerPackageLabel ? /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
@@ -16179,8 +17005,8 @@ var WidgetIcon = function WidgetIcon(_ref) {
|
|
|
16179
17005
|
});
|
|
16180
17006
|
};
|
|
16181
17007
|
|
|
16182
|
-
function ownKeys$
|
|
16183
|
-
function _objectSpread$
|
|
17008
|
+
function ownKeys$M(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; }
|
|
17009
|
+
function _objectSpread$M(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$M(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$M(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16184
17010
|
var ProviderForm = function ProviderForm(_ref) {
|
|
16185
17011
|
var credentialSchema = _ref.credentialSchema,
|
|
16186
17012
|
_ref$initialValues = _ref.initialValues,
|
|
@@ -16225,14 +17051,14 @@ var ProviderForm = function ProviderForm(_ref) {
|
|
|
16225
17051
|
var oldKey = f.key;
|
|
16226
17052
|
if (oldKey && formData[oldKey] !== undefined) {
|
|
16227
17053
|
setFormData(function (fd) {
|
|
16228
|
-
var updated = _objectSpread$
|
|
17054
|
+
var updated = _objectSpread$M({}, fd);
|
|
16229
17055
|
var val = updated[oldKey];
|
|
16230
17056
|
delete updated[oldKey];
|
|
16231
17057
|
if (newKey.trim()) updated[newKey] = val;
|
|
16232
17058
|
return updated;
|
|
16233
17059
|
});
|
|
16234
17060
|
}
|
|
16235
|
-
return _objectSpread$
|
|
17061
|
+
return _objectSpread$M(_objectSpread$M({}, f), {}, {
|
|
16236
17062
|
key: newKey
|
|
16237
17063
|
});
|
|
16238
17064
|
});
|
|
@@ -16244,14 +17070,14 @@ var ProviderForm = function ProviderForm(_ref) {
|
|
|
16244
17070
|
});
|
|
16245
17071
|
if (field !== null && field !== void 0 && field.key) {
|
|
16246
17072
|
setFormData(function (prev) {
|
|
16247
|
-
return _objectSpread$
|
|
17073
|
+
return _objectSpread$M(_objectSpread$M({}, prev), {}, _defineProperty({}, field.key, value));
|
|
16248
17074
|
});
|
|
16249
17075
|
}
|
|
16250
17076
|
};
|
|
16251
17077
|
var handleDynamicSecretToggle = function handleDynamicSecretToggle(id) {
|
|
16252
17078
|
setDynamicFields(function (prev) {
|
|
16253
17079
|
return prev.map(function (f) {
|
|
16254
|
-
return f.id === id ? _objectSpread$
|
|
17080
|
+
return f.id === id ? _objectSpread$M(_objectSpread$M({}, f), {}, {
|
|
16255
17081
|
secret: !f.secret
|
|
16256
17082
|
}) : f;
|
|
16257
17083
|
});
|
|
@@ -16273,7 +17099,7 @@ var ProviderForm = function ProviderForm(_ref) {
|
|
|
16273
17099
|
});
|
|
16274
17100
|
if (field !== null && field !== void 0 && field.key) {
|
|
16275
17101
|
setFormData(function (prev) {
|
|
16276
|
-
var updated = _objectSpread$
|
|
17102
|
+
var updated = _objectSpread$M({}, prev);
|
|
16277
17103
|
delete updated[field.key];
|
|
16278
17104
|
return updated;
|
|
16279
17105
|
});
|
|
@@ -16315,13 +17141,13 @@ var ProviderForm = function ProviderForm(_ref) {
|
|
|
16315
17141
|
*/
|
|
16316
17142
|
var handleInputChange = function handleInputChange(fieldName, value) {
|
|
16317
17143
|
setFormData(function (prev) {
|
|
16318
|
-
return _objectSpread$
|
|
17144
|
+
return _objectSpread$M(_objectSpread$M({}, prev), {}, _defineProperty({}, fieldName, value));
|
|
16319
17145
|
});
|
|
16320
17146
|
|
|
16321
17147
|
// Clear error for this field if it was filled
|
|
16322
17148
|
if (errors[fieldName] && value !== null && value !== void 0 && value.trim()) {
|
|
16323
17149
|
setErrors(function (prev) {
|
|
16324
|
-
var newErrors = _objectSpread$
|
|
17150
|
+
var newErrors = _objectSpread$M({}, prev);
|
|
16325
17151
|
delete newErrors[fieldName];
|
|
16326
17152
|
return newErrors;
|
|
16327
17153
|
});
|
|
@@ -16359,7 +17185,7 @@ var ProviderForm = function ProviderForm(_ref) {
|
|
|
16359
17185
|
// Clear error if filled
|
|
16360
17186
|
if (errors.providerName && value !== null && value !== void 0 && value.trim()) {
|
|
16361
17187
|
setErrors(function (prev) {
|
|
16362
|
-
var newErrors = _objectSpread$
|
|
17188
|
+
var newErrors = _objectSpread$M({}, prev);
|
|
16363
17189
|
delete newErrors.providerName;
|
|
16364
17190
|
return newErrors;
|
|
16365
17191
|
});
|
|
@@ -16596,8 +17422,8 @@ var ToolSelector$1 = function ToolSelector(_ref) {
|
|
|
16596
17422
|
});
|
|
16597
17423
|
};
|
|
16598
17424
|
|
|
16599
|
-
function ownKeys$
|
|
16600
|
-
function _objectSpread$
|
|
17425
|
+
function ownKeys$L(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; }
|
|
17426
|
+
function _objectSpread$L(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$L(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$L(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16601
17427
|
/**
|
|
16602
17428
|
* Shared MCP utility functions.
|
|
16603
17429
|
*
|
|
@@ -16725,7 +17551,7 @@ function buildMcpConfigFromOverrides(baseMcpConfig, envMappingRows, headerRows)
|
|
|
16725
17551
|
headerTemplate[name] = value;
|
|
16726
17552
|
}
|
|
16727
17553
|
});
|
|
16728
|
-
var config = _objectSpread$
|
|
17554
|
+
var config = _objectSpread$L({}, baseMcpConfig);
|
|
16729
17555
|
if (Object.keys(headerTemplate).length > 0) {
|
|
16730
17556
|
config.headerTemplate = headerTemplate;
|
|
16731
17557
|
} else {
|
|
@@ -16743,7 +17569,7 @@ function buildMcpConfigFromOverrides(baseMcpConfig, envMappingRows, headerRows)
|
|
|
16743
17569
|
envMapping[env] = cred;
|
|
16744
17570
|
}
|
|
16745
17571
|
});
|
|
16746
|
-
return _objectSpread$
|
|
17572
|
+
return _objectSpread$L(_objectSpread$L({}, baseMcpConfig), {}, {
|
|
16747
17573
|
envMapping: envMapping
|
|
16748
17574
|
});
|
|
16749
17575
|
}
|
|
@@ -16977,11 +17803,11 @@ function mcpJsonToFormState(jsonString, nextRowId) {
|
|
|
16977
17803
|
return result;
|
|
16978
17804
|
}
|
|
16979
17805
|
|
|
16980
|
-
function _createForOfIteratorHelper$
|
|
16981
|
-
function _unsupportedIterableToArray$
|
|
16982
|
-
function _arrayLikeToArray$
|
|
16983
|
-
function ownKeys$
|
|
16984
|
-
function _objectSpread$
|
|
17806
|
+
function _createForOfIteratorHelper$m(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$m(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; } } }; }
|
|
17807
|
+
function _unsupportedIterableToArray$m(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$m(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$m(r, a) : void 0; } }
|
|
17808
|
+
function _arrayLikeToArray$m(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; }
|
|
17809
|
+
function ownKeys$K(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; }
|
|
17810
|
+
function _objectSpread$K(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$K(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$K(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
16985
17811
|
var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
16986
17812
|
var isOpen = _ref.isOpen,
|
|
16987
17813
|
onClose = _ref.onClose,
|
|
@@ -17176,7 +18002,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
17176
18002
|
.map(function (entry) {
|
|
17177
18003
|
var widget = allWidgets[entry.widgetKey];
|
|
17178
18004
|
if (!widget) return null; // Widget no longer exists
|
|
17179
|
-
return _objectSpread$
|
|
18005
|
+
return _objectSpread$K(_objectSpread$K({
|
|
17180
18006
|
key: entry.widgetKey
|
|
17181
18007
|
}, widget), {}, {
|
|
17182
18008
|
savedProviders: entry.providers || {},
|
|
@@ -17264,11 +18090,11 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
17264
18090
|
|
|
17265
18091
|
// Flatten all widgets from all packages for the widget list
|
|
17266
18092
|
flatWidgets = [];
|
|
17267
|
-
_iterator = _createForOfIteratorHelper$
|
|
18093
|
+
_iterator = _createForOfIteratorHelper$m(result.packages || []);
|
|
17268
18094
|
try {
|
|
17269
18095
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
17270
18096
|
pkg = _step.value;
|
|
17271
|
-
_iterator2 = _createForOfIteratorHelper$
|
|
18097
|
+
_iterator2 = _createForOfIteratorHelper$m(pkg.widgets || []);
|
|
17272
18098
|
try {
|
|
17273
18099
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
17274
18100
|
widget = _step2.value;
|
|
@@ -17327,7 +18153,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
17327
18153
|
// Get widgets from ComponentManager
|
|
17328
18154
|
var allWidgets = ComponentManager.map();
|
|
17329
18155
|
var widgetList = Object.keys(allWidgets).map(function (key) {
|
|
17330
|
-
return _objectSpread$
|
|
18156
|
+
return _objectSpread$K({
|
|
17331
18157
|
key: key
|
|
17332
18158
|
}, allWidgets[key]);
|
|
17333
18159
|
}).filter(function (widget) {
|
|
@@ -17558,7 +18384,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
17558
18384
|
setInlineCreateType(null);
|
|
17559
18385
|
setInlineCreateSchema({});
|
|
17560
18386
|
setInlineCreateError(null);
|
|
17561
|
-
setSelectedProviders(_objectSpread$
|
|
18387
|
+
setSelectedProviders(_objectSpread$K(_objectSpread$K({}, selectedProviders), {}, _defineProperty({}, providerType, providerName)));
|
|
17562
18388
|
}
|
|
17563
18389
|
};
|
|
17564
18390
|
var handleInlineProviderSubmit = function handleInlineProviderSubmit(formData) {
|
|
@@ -17579,7 +18405,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
17579
18405
|
|
|
17580
18406
|
// Auto-select the newly created provider
|
|
17581
18407
|
setSelectedProviders(function (prev) {
|
|
17582
|
-
return _objectSpread$
|
|
18408
|
+
return _objectSpread$K(_objectSpread$K({}, prev), {}, _defineProperty({}, providerType, providerName));
|
|
17583
18409
|
});
|
|
17584
18410
|
|
|
17585
18411
|
// Collapse the inline form
|
|
@@ -17633,11 +18459,11 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
17633
18459
|
};
|
|
17634
18460
|
var inlineHandleCredentialChange = function inlineHandleCredentialChange(fieldName, value) {
|
|
17635
18461
|
setInlineCredentialData(function (prev) {
|
|
17636
|
-
return _objectSpread$
|
|
18462
|
+
return _objectSpread$K(_objectSpread$K({}, prev), {}, _defineProperty({}, fieldName, value));
|
|
17637
18463
|
});
|
|
17638
18464
|
if (inlineFormErrors[fieldName] && value !== null && value !== void 0 && value.trim()) {
|
|
17639
18465
|
setInlineFormErrors(function (prev) {
|
|
17640
|
-
var next = _objectSpread$
|
|
18466
|
+
var next = _objectSpread$K({}, prev);
|
|
17641
18467
|
delete next[fieldName];
|
|
17642
18468
|
return next;
|
|
17643
18469
|
});
|
|
@@ -17730,7 +18556,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
17730
18556
|
refreshProviders();
|
|
17731
18557
|
}
|
|
17732
18558
|
setSelectedProviders(function (prev) {
|
|
17733
|
-
return _objectSpread$
|
|
18559
|
+
return _objectSpread$K(_objectSpread$K({}, prev), {}, _defineProperty({}, providerType, providerName));
|
|
17734
18560
|
});
|
|
17735
18561
|
|
|
17736
18562
|
// Reset stepper state
|
|
@@ -17751,7 +18577,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
17751
18577
|
});
|
|
17752
18578
|
};
|
|
17753
18579
|
var handleConfigChange = function handleConfigChange(key, value) {
|
|
17754
|
-
setUserConfigValues(_objectSpread$
|
|
18580
|
+
setUserConfigValues(_objectSpread$K(_objectSpread$K({}, userConfigValues), {}, _defineProperty({}, key, value)));
|
|
17755
18581
|
};
|
|
17756
18582
|
|
|
17757
18583
|
// Install a package from the registry
|
|
@@ -17817,7 +18643,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
17817
18643
|
// Mark items as installed
|
|
17818
18644
|
setProgressWidgets(function (prev) {
|
|
17819
18645
|
return prev.map(function (w) {
|
|
17820
|
-
return _objectSpread$
|
|
18646
|
+
return _objectSpread$K(_objectSpread$K({}, w), {}, {
|
|
17821
18647
|
status: "installed"
|
|
17822
18648
|
});
|
|
17823
18649
|
});
|
|
@@ -17836,7 +18662,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
17836
18662
|
setInstallError(msg);
|
|
17837
18663
|
setProgressWidgets(function (prev) {
|
|
17838
18664
|
return prev.map(function (w) {
|
|
17839
|
-
return _objectSpread$
|
|
18665
|
+
return _objectSpread$K(_objectSpread$K({}, w), {}, {
|
|
17840
18666
|
status: "failed",
|
|
17841
18667
|
error: msg
|
|
17842
18668
|
});
|
|
@@ -17910,7 +18736,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
17910
18736
|
|
|
17911
18737
|
// Phase 3: Save to recent widgets
|
|
17912
18738
|
saveToRecent(selectedWidget, selectedProviders, userConfigValues);
|
|
17913
|
-
onSelectWidget(_objectSpread$
|
|
18739
|
+
onSelectWidget(_objectSpread$K(_objectSpread$K({}, selectedWidget), {}, {
|
|
17914
18740
|
selectedProviders: selectedProviders,
|
|
17915
18741
|
// Pass to parent
|
|
17916
18742
|
userConfigValues: userConfigValues // Pass to parent
|
|
@@ -18553,7 +19379,7 @@ var EnhancedWidgetDropdown = function EnhancedWidgetDropdown(_ref) {
|
|
|
18553
19379
|
setInlineProviderName(value);
|
|
18554
19380
|
if (inlineFormErrors.providerName && value !== null && value !== void 0 && value.trim()) {
|
|
18555
19381
|
setInlineFormErrors(function (prev) {
|
|
18556
|
-
var next = _objectSpread$
|
|
19382
|
+
var next = _objectSpread$K({}, prev);
|
|
18557
19383
|
delete next.providerName;
|
|
18558
19384
|
return next;
|
|
18559
19385
|
});
|
|
@@ -18897,24 +19723,40 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
|
|
|
18897
19723
|
// Detect missing widgets (component key exists but not in ComponentManager)
|
|
18898
19724
|
var isWidgetMissing = (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component) && !widgetConfig;
|
|
18899
19725
|
|
|
18900
|
-
//
|
|
18901
|
-
|
|
19726
|
+
// Display name priority: per-instance user title → widget's default
|
|
19727
|
+
// title → developer's friendly displayName → widget config name →
|
|
19728
|
+
// bare component name (last segment) → full scoped id (last resort).
|
|
19729
|
+
// Mirrors WidgetsTab so the same widget shows the same name in both
|
|
19730
|
+
// surfaces.
|
|
19731
|
+
var widgetName = function (_widgetItem$userPrefs, _widgetConfig$userCon) {
|
|
19732
|
+
var prefsTitle = widgetItem === null || widgetItem === void 0 || (_widgetItem$userPrefs = widgetItem.userPrefs) === null || _widgetItem$userPrefs === void 0 ? void 0 : _widgetItem$userPrefs.title;
|
|
19733
|
+
if (typeof prefsTitle === "string" && prefsTitle.trim()) return prefsTitle;
|
|
19734
|
+
var configDefault = widgetConfig === null || widgetConfig === void 0 || (_widgetConfig$userCon = widgetConfig.userConfig) === null || _widgetConfig$userCon === void 0 || (_widgetConfig$userCon = _widgetConfig$userCon.title) === null || _widgetConfig$userCon === void 0 ? void 0 : _widgetConfig$userCon.defaultValue;
|
|
19735
|
+
if (typeof configDefault === "string" && configDefault.trim()) {
|
|
19736
|
+
return configDefault;
|
|
19737
|
+
}
|
|
19738
|
+
if (widgetConfig !== null && widgetConfig !== void 0 && widgetConfig.displayName) return widgetConfig.displayName;
|
|
19739
|
+
if (widgetConfig !== null && widgetConfig !== void 0 && widgetConfig.name) return widgetConfig.name;
|
|
19740
|
+
if (widgetItem !== null && widgetItem !== void 0 && widgetItem.name) return widgetItem.name;
|
|
19741
|
+
var comp = widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component;
|
|
19742
|
+
if (typeof comp === "string") {
|
|
19743
|
+
var parts = comp.split(".");
|
|
19744
|
+
if (parts.length === 3) return parts[2];
|
|
19745
|
+
return comp;
|
|
19746
|
+
}
|
|
19747
|
+
return "Widget";
|
|
19748
|
+
}();
|
|
18902
19749
|
|
|
18903
|
-
//
|
|
18904
|
-
//
|
|
18905
|
-
//
|
|
18906
|
-
//
|
|
18907
|
-
//
|
|
19750
|
+
// Show the full scoped registry id (`scope.package.Component`) as
|
|
19751
|
+
// the subtitle. The friendly title on line 1 may be a custom user
|
|
19752
|
+
// title that doesn't reveal which widget is mounted; the subtitle
|
|
19753
|
+
// pins down the underlying identity. Strict — the layout item is
|
|
19754
|
+
// the source of truth.
|
|
18908
19755
|
var packageLabel = function () {
|
|
18909
19756
|
var scopedId = (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component) || (widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.id) || "";
|
|
18910
19757
|
if (typeof scopedId !== "string") return "";
|
|
18911
19758
|
var parts = scopedId.split(".");
|
|
18912
|
-
|
|
18913
|
-
var _parts = _slicedToArray(parts, 2),
|
|
18914
|
-
scope = _parts[0],
|
|
18915
|
-
pkg = _parts[1];
|
|
18916
|
-
if (!scope || !pkg) return "";
|
|
18917
|
-
return "@".concat(scope, "/").concat(pkg);
|
|
19759
|
+
return parts.length === 3 ? scopedId : "";
|
|
18918
19760
|
}();
|
|
18919
19761
|
|
|
18920
19762
|
// Get provider requirements from widget config (not from item directly)
|
|
@@ -19169,9 +20011,9 @@ var useWidgetSchedulerStatus = function useWidgetSchedulerStatus(widgetId) {
|
|
|
19169
20011
|
};
|
|
19170
20012
|
};
|
|
19171
20013
|
|
|
19172
|
-
function _createForOfIteratorHelper$
|
|
19173
|
-
function _unsupportedIterableToArray$
|
|
19174
|
-
function _arrayLikeToArray$
|
|
20014
|
+
function _createForOfIteratorHelper$l(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$l(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; } } }; }
|
|
20015
|
+
function _unsupportedIterableToArray$l(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$l(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$l(r, a) : void 0; } }
|
|
20016
|
+
function _arrayLikeToArray$l(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; }
|
|
19175
20017
|
function formatCountdown(ms) {
|
|
19176
20018
|
if (ms == null || ms < 0) return "--";
|
|
19177
20019
|
if (ms < 1000) return "< 1s";
|
|
@@ -19288,7 +20130,7 @@ var WidgetCardStatusBar = function WidgetCardStatusBar(_ref) {
|
|
|
19288
20130
|
|
|
19289
20131
|
// Find soonest countdown among enabled tasks
|
|
19290
20132
|
var soonestMs = null;
|
|
19291
|
-
var _iterator = _createForOfIteratorHelper$
|
|
20133
|
+
var _iterator = _createForOfIteratorHelper$l(enabledTasks),
|
|
19292
20134
|
_step;
|
|
19293
20135
|
try {
|
|
19294
20136
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -19741,8 +20583,8 @@ var ProviderSelector = function ProviderSelector(_ref) {
|
|
|
19741
20583
|
});
|
|
19742
20584
|
};
|
|
19743
20585
|
|
|
19744
|
-
function ownKeys$
|
|
19745
|
-
function _objectSpread$
|
|
20586
|
+
function ownKeys$J(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; }
|
|
20587
|
+
function _objectSpread$J(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$J(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$J(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19746
20588
|
var AdvancedMcpConfig = function AdvancedMcpConfig(_ref) {
|
|
19747
20589
|
var transport = _ref.transport,
|
|
19748
20590
|
envMappingRows = _ref.envMappingRows,
|
|
@@ -19771,7 +20613,7 @@ var AdvancedMcpConfig = function AdvancedMcpConfig(_ref) {
|
|
|
19771
20613
|
var updateEnvRow = function updateEnvRow(id, field, value) {
|
|
19772
20614
|
onEnvMappingRowsChange(function (prev) {
|
|
19773
20615
|
return prev.map(function (row) {
|
|
19774
|
-
return row.id === id ? _objectSpread$
|
|
20616
|
+
return row.id === id ? _objectSpread$J(_objectSpread$J({}, row), {}, _defineProperty({}, field, value)) : row;
|
|
19775
20617
|
});
|
|
19776
20618
|
});
|
|
19777
20619
|
};
|
|
@@ -19796,7 +20638,7 @@ var AdvancedMcpConfig = function AdvancedMcpConfig(_ref) {
|
|
|
19796
20638
|
var updateHeaderRow = function updateHeaderRow(id, field, value) {
|
|
19797
20639
|
onHeaderRowsChange(function (prev) {
|
|
19798
20640
|
return prev.map(function (row) {
|
|
19799
|
-
return row.id === id ? _objectSpread$
|
|
20641
|
+
return row.id === id ? _objectSpread$J(_objectSpread$J({}, row), {}, _defineProperty({}, field, value)) : row;
|
|
19800
20642
|
});
|
|
19801
20643
|
});
|
|
19802
20644
|
};
|
|
@@ -19945,8 +20787,8 @@ var AdvancedMcpConfig = function AdvancedMcpConfig(_ref) {
|
|
|
19945
20787
|
});
|
|
19946
20788
|
};
|
|
19947
20789
|
|
|
19948
|
-
function ownKeys$
|
|
19949
|
-
function _objectSpread$
|
|
20790
|
+
function ownKeys$I(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; }
|
|
20791
|
+
function _objectSpread$I(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$I(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$I(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
19950
20792
|
var McpServerPicker = function McpServerPicker(_ref) {
|
|
19951
20793
|
var _testResult$tools;
|
|
19952
20794
|
var isOpen = _ref.isOpen,
|
|
@@ -20125,11 +20967,11 @@ var McpServerPicker = function McpServerPicker(_ref) {
|
|
|
20125
20967
|
// Handle credential field changes
|
|
20126
20968
|
var handleCredentialChange = function handleCredentialChange(fieldName, value) {
|
|
20127
20969
|
setCredentialData(function (prev) {
|
|
20128
|
-
return _objectSpread$
|
|
20970
|
+
return _objectSpread$I(_objectSpread$I({}, prev), {}, _defineProperty({}, fieldName, value));
|
|
20129
20971
|
});
|
|
20130
20972
|
if (formErrors[fieldName] && value !== null && value !== void 0 && value.trim()) {
|
|
20131
20973
|
setFormErrors(function (prev) {
|
|
20132
|
-
var next = _objectSpread$
|
|
20974
|
+
var next = _objectSpread$I({}, prev);
|
|
20133
20975
|
delete next[fieldName];
|
|
20134
20976
|
return next;
|
|
20135
20977
|
});
|
|
@@ -20467,7 +21309,7 @@ var McpServerPicker = function McpServerPicker(_ref) {
|
|
|
20467
21309
|
setProviderName(value);
|
|
20468
21310
|
if (formErrors.providerName && value !== null && value !== void 0 && value.trim()) {
|
|
20469
21311
|
setFormErrors(function (prev) {
|
|
20470
|
-
var next = _objectSpread$
|
|
21312
|
+
var next = _objectSpread$I({}, prev);
|
|
20471
21313
|
delete next.providerName;
|
|
20472
21314
|
return next;
|
|
20473
21315
|
});
|
|
@@ -20657,8 +21499,8 @@ var McpServerPicker = function McpServerPicker(_ref) {
|
|
|
20657
21499
|
});
|
|
20658
21500
|
};
|
|
20659
21501
|
|
|
20660
|
-
function ownKeys$
|
|
20661
|
-
function _objectSpread$
|
|
21502
|
+
function ownKeys$H(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; }
|
|
21503
|
+
function _objectSpread$H(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$H(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$H(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
20662
21504
|
var USE_ENHANCED_WIDGET_SELECTOR = true; // Set to false to use original modal
|
|
20663
21505
|
|
|
20664
21506
|
/**
|
|
@@ -20704,7 +21546,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
20704
21546
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
20705
21547
|
id = _ref3[0],
|
|
20706
21548
|
p = _ref3[1];
|
|
20707
|
-
return _objectSpread$
|
|
21549
|
+
return _objectSpread$H(_objectSpread$H({}, p), {}, {
|
|
20708
21550
|
id: id,
|
|
20709
21551
|
name: p.name || id
|
|
20710
21552
|
});
|
|
@@ -20791,7 +21633,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
20791
21633
|
// so we use its layout to replace any corrupted grid data.
|
|
20792
21634
|
if (workspace && workspace["layout"]) {
|
|
20793
21635
|
var model = new DashboardModel(workspace);
|
|
20794
|
-
setCurrentWorkspace(_objectSpread$
|
|
21636
|
+
setCurrentWorkspace(_objectSpread$H(_objectSpread$H({}, workspace), {}, {
|
|
20795
21637
|
layout: model.layout
|
|
20796
21638
|
}));
|
|
20797
21639
|
} else {
|
|
@@ -20851,7 +21693,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
20851
21693
|
}
|
|
20852
21694
|
try {
|
|
20853
21695
|
var hasChildren = config.type === "workspace";
|
|
20854
|
-
var newLayout = addItemToItemLayout(ws.layout, gridItem.id, _objectSpread$
|
|
21696
|
+
var newLayout = addItemToItemLayout(ws.layout, gridItem.id, _objectSpread$H(_objectSpread$H({}, config), {}, {
|
|
20855
21697
|
component: widgetComponentName,
|
|
20856
21698
|
packageId: config._sourcePackage || config.packageId || null
|
|
20857
21699
|
}), hasChildren);
|
|
@@ -21288,7 +22130,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
21288
22130
|
var uuid = widget.uuid || widget.uuidString;
|
|
21289
22131
|
if (uuid) {
|
|
21290
22132
|
newWorkspace.selectedProviders = newWorkspace.selectedProviders || {};
|
|
21291
|
-
newWorkspace.selectedProviders[uuid] = _objectSpread$
|
|
22133
|
+
newWorkspace.selectedProviders[uuid] = _objectSpread$H(_objectSpread$H({}, newWorkspace.selectedProviders[uuid] || {}), {}, _defineProperty({}, providerType, providerId));
|
|
21292
22134
|
}
|
|
21293
22135
|
setCurrentWorkspace(newWorkspace);
|
|
21294
22136
|
}
|
|
@@ -21424,7 +22266,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
21424
22266
|
var _gridContainer$grid;
|
|
21425
22267
|
var config = ComponentManager.config(widgetKey);
|
|
21426
22268
|
if (!config) return;
|
|
21427
|
-
var widgetItem = _objectSpread$
|
|
22269
|
+
var widgetItem = _objectSpread$H(_objectSpread$H({}, config), {}, {
|
|
21428
22270
|
component: widgetKey,
|
|
21429
22271
|
key: widgetKey,
|
|
21430
22272
|
packageId: config._sourcePackage || config.packageId || null
|
|
@@ -21685,7 +22527,7 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
21685
22527
|
onSelectWidget: function onSelectWidget(widget) {
|
|
21686
22528
|
|
|
21687
22529
|
// Add component property from widget.key
|
|
21688
|
-
var widgetWithComponent = _objectSpread$
|
|
22530
|
+
var widgetWithComponent = _objectSpread$H(_objectSpread$H({}, widget), {}, {
|
|
21689
22531
|
component: widget.key
|
|
21690
22532
|
});
|
|
21691
22533
|
handleClickConfirmAdd(widgetWithComponent, dropdownTarget);
|
|
@@ -23314,8 +24156,8 @@ var MissingProviderPrompt = function MissingProviderPrompt(_ref) {
|
|
|
23314
24156
|
});
|
|
23315
24157
|
};
|
|
23316
24158
|
|
|
23317
|
-
function ownKeys$
|
|
23318
|
-
function _objectSpread$
|
|
24159
|
+
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; }
|
|
24160
|
+
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; }
|
|
23319
24161
|
function _callSuper$4(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
23320
24162
|
function _isNativeReflectConstruct$4() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
23321
24163
|
var ProviderErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
@@ -23370,7 +24212,7 @@ var ProviderErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
23370
24212
|
_defineProperty(_this, "handleProviderSelect", function (providerType, providerName, credentials) {
|
|
23371
24213
|
|
|
23372
24214
|
// Update local selected providers state
|
|
23373
|
-
var updatedSelected = _objectSpread$
|
|
24215
|
+
var updatedSelected = _objectSpread$G(_objectSpread$G({}, _this.state.selectedProviders), {}, _defineProperty({}, providerType, providerName));
|
|
23374
24216
|
_this.setState({
|
|
23375
24217
|
selectedProviders: updatedSelected
|
|
23376
24218
|
}, function () {
|
|
@@ -23444,8 +24286,8 @@ var ProviderErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
|
23444
24286
|
}(React.Component);
|
|
23445
24287
|
_defineProperty(ProviderErrorBoundary, "contextType", ProviderContext);
|
|
23446
24288
|
|
|
23447
|
-
function ownKeys$
|
|
23448
|
-
function _objectSpread$
|
|
24289
|
+
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; }
|
|
24290
|
+
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; }
|
|
23449
24291
|
var withProviderDetection = function withProviderDetection(Component) {
|
|
23450
24292
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
23451
24293
|
_ref$requiredProvider = _ref.requiredProviders,
|
|
@@ -23470,7 +24312,7 @@ var withProviderDetection = function withProviderDetection(Component) {
|
|
|
23470
24312
|
onProviderSelect: onProviderSelect
|
|
23471
24313
|
});
|
|
23472
24314
|
}
|
|
23473
|
-
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread$
|
|
24315
|
+
return /*#__PURE__*/jsxRuntime.jsx(Component, _objectSpread$F({}, props));
|
|
23474
24316
|
};
|
|
23475
24317
|
};
|
|
23476
24318
|
|
|
@@ -24146,8 +24988,8 @@ var WidgetNotFound = function WidgetNotFound(_ref) {
|
|
|
24146
24988
|
});
|
|
24147
24989
|
};
|
|
24148
24990
|
|
|
24149
|
-
function ownKeys$
|
|
24150
|
-
function _objectSpread$
|
|
24991
|
+
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; }
|
|
24992
|
+
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; }
|
|
24151
24993
|
function _callSuper$2(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
24152
24994
|
function _isNativeReflectConstruct$2() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24153
24995
|
var WidgetErrorBoundary = /*#__PURE__*/function (_Component) {
|
|
@@ -24307,7 +25149,7 @@ var WidgetRenderer = function WidgetRenderer(_ref) {
|
|
|
24307
25149
|
|
|
24308
25150
|
// Build widgetData for WidgetContext — hooks read from this
|
|
24309
25151
|
var uuidString = DashReact.getUUID(params.uuid);
|
|
24310
|
-
var widgetData = _objectSpread$
|
|
25152
|
+
var widgetData = _objectSpread$E(_objectSpread$E({}, params), {}, {
|
|
24311
25153
|
uuidString: uuidString,
|
|
24312
25154
|
providers: (config === null || config === void 0 ? void 0 : config.providers) || [],
|
|
24313
25155
|
notifications: (config === null || config === void 0 ? void 0 : config.notifications) || []
|
|
@@ -24331,7 +25173,7 @@ var WidgetRenderer = function WidgetRenderer(_ref) {
|
|
|
24331
25173
|
widgetData: widgetData
|
|
24332
25174
|
};
|
|
24333
25175
|
var hasScheduledTasks = ((config === null || config === void 0 ? void 0 : config.scheduledTasks) || []).length > 0;
|
|
24334
|
-
var widgetElement = children === null ? /*#__PURE__*/jsxRuntime.jsx(WidgetComponent, _objectSpread$
|
|
25176
|
+
var widgetElement = children === null ? /*#__PURE__*/jsxRuntime.jsx(WidgetComponent, _objectSpread$E(_objectSpread$E(_objectSpread$E({
|
|
24335
25177
|
id: "widget-nokids-".concat(widgetKey),
|
|
24336
25178
|
listen: function listen(listeners, handlers) {
|
|
24337
25179
|
return helpers.listen(listeners, handlers);
|
|
@@ -24345,7 +25187,7 @@ var WidgetRenderer = function WidgetRenderer(_ref) {
|
|
|
24345
25187
|
backgroundColor: bgColor,
|
|
24346
25188
|
widgetConfig: helpers.config(),
|
|
24347
25189
|
widgetEventNames: helpers.events()
|
|
24348
|
-
}), "widget-nokids-".concat(widgetKey, "-v").concat(componentVersion)) : /*#__PURE__*/jsxRuntime.jsx(WidgetComponent, _objectSpread$
|
|
25190
|
+
}), "widget-nokids-".concat(widgetKey, "-v").concat(componentVersion)) : /*#__PURE__*/jsxRuntime.jsx(WidgetComponent, _objectSpread$E(_objectSpread$E(_objectSpread$E({
|
|
24349
25191
|
listen: function listen(listeners, handlers) {
|
|
24350
25192
|
return helpers.listen(listeners, handlers);
|
|
24351
25193
|
},
|
|
@@ -24545,11 +25387,11 @@ var ExternalWidget = function ExternalWidget(_ref) {
|
|
|
24545
25387
|
var GRID_CELL_WIDGET_TYPE = "grid-cell-widget";
|
|
24546
25388
|
var SIDEBAR_WIDGET_TYPE = "sidebar-widget";
|
|
24547
25389
|
|
|
24548
|
-
function _createForOfIteratorHelper$
|
|
24549
|
-
function _unsupportedIterableToArray$
|
|
24550
|
-
function _arrayLikeToArray$
|
|
24551
|
-
function ownKeys$
|
|
24552
|
-
function _objectSpread$
|
|
25390
|
+
function _createForOfIteratorHelper$k(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$k(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; } } }; }
|
|
25391
|
+
function _unsupportedIterableToArray$k(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$k(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$k(r, a) : void 0; } }
|
|
25392
|
+
function _arrayLikeToArray$k(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; }
|
|
25393
|
+
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; }
|
|
25394
|
+
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; }
|
|
24553
25395
|
|
|
24554
25396
|
// Identifies which "bucket" of the workspace a LayoutBuilder belongs
|
|
24555
25397
|
// to so drop handlers on grid cells can distinguish a same-container
|
|
@@ -24795,7 +25637,7 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
24795
25637
|
var _ref5 = _slicedToArray(_ref4, 2),
|
|
24796
25638
|
id = _ref5[0],
|
|
24797
25639
|
provider = _ref5[1];
|
|
24798
|
-
return _objectSpread$
|
|
25640
|
+
return _objectSpread$D({
|
|
24799
25641
|
id: id
|
|
24800
25642
|
}, provider);
|
|
24801
25643
|
}) : [];
|
|
@@ -25170,7 +26012,7 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
25170
26012
|
return selectable["delete"](cn);
|
|
25171
26013
|
});
|
|
25172
26014
|
var resolved = new Set();
|
|
25173
|
-
var _iterator = _createForOfIteratorHelper$
|
|
26015
|
+
var _iterator = _createForOfIteratorHelper$k(selectable),
|
|
25174
26016
|
_step;
|
|
25175
26017
|
try {
|
|
25176
26018
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -25844,7 +26686,7 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
25844
26686
|
var widgetSpecificSelections = (workspace === null || workspace === void 0 || (_workspace$selectedPr = workspace.selectedProviders) === null || _workspace$selectedPr === void 0 ? void 0 : _workspace$selectedPr[id]) || {};
|
|
25845
26687
|
|
|
25846
26688
|
// Add provider-related props from workspace
|
|
25847
|
-
var itemWithProviders = _objectSpread$
|
|
26689
|
+
var itemWithProviders = _objectSpread$D(_objectSpread$D({}, item), {}, {
|
|
25848
26690
|
selectedProviders: widgetSpecificSelections,
|
|
25849
26691
|
onProviderSelect: onProviderSelect
|
|
25850
26692
|
});
|
|
@@ -26062,8 +26904,8 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
|
|
|
26062
26904
|
}) : renderComponentContainer(children);
|
|
26063
26905
|
});
|
|
26064
26906
|
|
|
26065
|
-
function ownKeys$
|
|
26066
|
-
function _objectSpread$
|
|
26907
|
+
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; }
|
|
26908
|
+
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; }
|
|
26067
26909
|
function compareChildren(a, b) {
|
|
26068
26910
|
if (a.order < b.order) {
|
|
26069
26911
|
return -1;
|
|
@@ -27151,7 +27993,7 @@ function moveWidgetAcrossContainers(workspace, sourceGridId, sourceCell, targetG
|
|
|
27151
27993
|
|
|
27152
27994
|
// Rewire the grid pointers first (swap works for empty target too —
|
|
27153
27995
|
// targetWidgetId is null then and the source cell becomes empty).
|
|
27154
|
-
sourceGrid.grid[sourceCell] = _objectSpread$
|
|
27996
|
+
sourceGrid.grid[sourceCell] = _objectSpread$C(_objectSpread$C({}, sourceCellData), {}, {
|
|
27155
27997
|
component: targetWidgetId
|
|
27156
27998
|
});
|
|
27157
27999
|
if (!targetCellData) {
|
|
@@ -27160,7 +28002,7 @@ function moveWidgetAcrossContainers(workspace, sourceGridId, sourceCell, targetG
|
|
|
27160
28002
|
hide: false
|
|
27161
28003
|
};
|
|
27162
28004
|
} else {
|
|
27163
|
-
targetGrid.grid[targetCell] = _objectSpread$
|
|
28005
|
+
targetGrid.grid[targetCell] = _objectSpread$C(_objectSpread$C({}, targetCellData), {}, {
|
|
27164
28006
|
component: sourceWidgetId
|
|
27165
28007
|
});
|
|
27166
28008
|
}
|
|
@@ -27577,11 +28419,11 @@ function migrateBareComponentName(componentMap, component) {
|
|
|
27577
28419
|
return component;
|
|
27578
28420
|
}
|
|
27579
28421
|
|
|
27580
|
-
function ownKeys$
|
|
27581
|
-
function _objectSpread$
|
|
27582
|
-
function _createForOfIteratorHelper$
|
|
27583
|
-
function _unsupportedIterableToArray$
|
|
27584
|
-
function _arrayLikeToArray$
|
|
28422
|
+
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; }
|
|
28423
|
+
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; }
|
|
28424
|
+
function _createForOfIteratorHelper$j(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$j(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; } } }; }
|
|
28425
|
+
function _unsupportedIterableToArray$j(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$j(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$j(r, a) : void 0; } }
|
|
28426
|
+
function _arrayLikeToArray$j(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; }
|
|
27585
28427
|
/**
|
|
27586
28428
|
* The model for all layout components used primarily in the renderLayout method
|
|
27587
28429
|
* @param {Object} layoutItem an object containing various attributes of the layout item
|
|
@@ -27593,7 +28435,7 @@ function _arrayLikeToArray$k(r, a) { (null == a || a > r.length) && (a = r.lengt
|
|
|
27593
28435
|
function sortObjectByKeys(obj) {
|
|
27594
28436
|
var sortedKeys = Object.keys(obj).sort();
|
|
27595
28437
|
var sortedObj = {};
|
|
27596
|
-
var _iterator = _createForOfIteratorHelper$
|
|
28438
|
+
var _iterator = _createForOfIteratorHelper$j(sortedKeys),
|
|
27597
28439
|
_step;
|
|
27598
28440
|
try {
|
|
27599
28441
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -27745,7 +28587,7 @@ var LayoutModel = function LayoutModel(layoutItem, workspaceLayout, dashboardId)
|
|
|
27745
28587
|
|
|
27746
28588
|
// Merge user-entered config values (from EnhancedWidgetDropdown) into userPrefs
|
|
27747
28589
|
if ("userConfigValues" in obj && obj.userConfigValues) {
|
|
27748
|
-
layout.userPrefs = _objectSpread$
|
|
28590
|
+
layout.userPrefs = _objectSpread$B(_objectSpread$B({}, layout.userPrefs), obj.userConfigValues);
|
|
27749
28591
|
}
|
|
27750
28592
|
|
|
27751
28593
|
// Preserve provider selections for this widget
|
|
@@ -27783,956 +28625,224 @@ var LayoutModel = function LayoutModel(layoutItem, workspaceLayout, dashboardId)
|
|
|
27783
28625
|
if (!layout.grid.rows) layout.grid.rows = 1;
|
|
27784
28626
|
if (!layout.grid.cols) layout.grid.cols = 1;
|
|
27785
28627
|
|
|
27786
|
-
// Set default gap if not specified
|
|
27787
|
-
if (!layout.grid.gap) layout.grid.gap = "gap-2";
|
|
27788
|
-
|
|
27789
|
-
// Sort grid object keys for consistent ordering
|
|
27790
|
-
layout.grid = sortObjectByKeys(layout.grid);
|
|
27791
|
-
|
|
27792
|
-
// If type is not explicitly set and grid exists, set type to "grid"
|
|
27793
|
-
if (layout.type === "layout" && "grid" in obj) {
|
|
27794
|
-
layout.type = "grid";
|
|
27795
|
-
}
|
|
27796
|
-
}
|
|
27797
|
-
layout.parentWorkspaceName = "parentWorkspaceName" in obj ? obj["parentWorkspaceName"] : null;
|
|
27798
|
-
|
|
27799
|
-
// last check for this being a container...
|
|
27800
|
-
// we are forcing ALL containers to be w full and h full
|
|
27801
|
-
// not sure this is a good idea, but...
|
|
27802
|
-
if ("workspace" in layout || layout.type !== "widget") {
|
|
27803
|
-
// if (layout.workspace === "layout") {
|
|
27804
|
-
if (layout.width === "") {
|
|
27805
|
-
layout.width = "w-full";
|
|
27806
|
-
}
|
|
27807
|
-
// if (layout.height === "") {
|
|
27808
|
-
layout.height = "h-full";
|
|
27809
|
-
// }
|
|
27810
|
-
// if (layout.scrollable === "") {
|
|
27811
|
-
// layout.scrollable = true;
|
|
27812
|
-
// }
|
|
27813
|
-
if (layout.direction === "") {
|
|
27814
|
-
layout.direction = "col";
|
|
27815
|
-
}
|
|
27816
|
-
// }
|
|
27817
|
-
}
|
|
27818
|
-
|
|
27819
|
-
// lets check to see if we already have the parent workspace?
|
|
27820
|
-
if (layout.parentWorkspaceName === null) {
|
|
27821
|
-
// get the nearest workspace and assign this as the parent for rendering
|
|
27822
|
-
var tempLayout = DashReact.deepCopy(layout);
|
|
27823
|
-
var parentWS = getNearestParentWorkspace(workspaceLayout, tempLayout, tempLayout);
|
|
27824
|
-
var parentWorkspaceName = "layout";
|
|
27825
|
-
if (parentWS) {
|
|
27826
|
-
if ("workspace" in parentWS) {
|
|
27827
|
-
parentWorkspaceName = parentWS["workspace"];
|
|
27828
|
-
}
|
|
27829
|
-
}
|
|
27830
|
-
layout.parentWorkspaceName = parentWorkspaceName;
|
|
27831
|
-
}
|
|
27832
|
-
return layout;
|
|
27833
|
-
} catch (e) {
|
|
27834
|
-
return null;
|
|
27835
|
-
}
|
|
27836
|
-
};
|
|
27837
|
-
|
|
27838
|
-
/**
|
|
27839
|
-
* Handle all of the data for a color (theme)
|
|
27840
|
-
* @param {Object} obj the color object we would like to use to populate the model (optional)
|
|
27841
|
-
*/
|
|
27842
|
-
var ColorModel = function ColorModel() {
|
|
27843
|
-
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
27844
|
-
try {
|
|
27845
|
-
if (obj) {
|
|
27846
|
-
// console.log("cm: ", obj);
|
|
27847
|
-
var temp = DashReact.deepCopy(obj);
|
|
27848
|
-
var color = {};
|
|
27849
|
-
color.panelType = "panelType" in temp ? temp.panelType : "main";
|
|
27850
|
-
color.colorName = "colorName" in temp ? temp.colorName : "white";
|
|
27851
|
-
color.colorType = "colorType" in temp ? temp.colorType !== undefined && temp.colorType !== null ? temp.colorType : "primary" : "primary";
|
|
27852
|
-
color.shade = "shade" in temp ? temp.shade : 500;
|
|
27853
|
-
color.variant = "variant" in temp ? temp.variant : "dark";
|
|
27854
|
-
color.level = "level" in temp ? temp.level : "light";
|
|
27855
|
-
color.objectType = "objectType" in temp ? temp.objectType : "bg";
|
|
27856
|
-
color.styleName = DashReact.getStyleName(color.objectType); //'background';
|
|
27857
|
-
|
|
27858
|
-
/**
|
|
27859
|
-
* generate the display name
|
|
27860
|
-
*/
|
|
27861
|
-
color.displayName = "displayName" in temp ? temp.name : DashReact.capitalizeFirstLetter(color.colorName);
|
|
27862
|
-
|
|
27863
|
-
/**
|
|
27864
|
-
* Strings for the theme class name and the class to be used in className
|
|
27865
|
-
*/
|
|
27866
|
-
color.themeClass = "".concat(color.objectType, "-").concat(color.colorType, "-").concat(color.level);
|
|
27867
|
-
color["class"] = "".concat(color.objectType, "-").concat(color.colorName, "-").concat(color.shade);
|
|
27868
|
-
|
|
27869
|
-
/**
|
|
27870
|
-
* Grab the hex code via tailwind for the tailwind color
|
|
27871
|
-
* This may change as we move to hex codes for selection
|
|
27872
|
-
*/
|
|
27873
|
-
color.hex = colors[color.colorName];
|
|
27874
|
-
return color;
|
|
27875
|
-
}
|
|
27876
|
-
return null;
|
|
27877
|
-
} catch (e) {
|
|
27878
|
-
return obj;
|
|
27879
|
-
}
|
|
27880
|
-
};
|
|
27881
|
-
|
|
27882
|
-
var SettingsModel = function SettingsModel() {
|
|
27883
|
-
var settingsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
27884
|
-
var obj = DashReact.deepCopy(settingsObject);
|
|
27885
|
-
obj["debug"] = "debug" in obj ? obj["debug"] : false;
|
|
27886
|
-
obj["theme"] = "theme" in obj ? obj["theme"] : null;
|
|
27887
|
-
return obj;
|
|
27888
|
-
};
|
|
27889
|
-
|
|
27890
|
-
function _createForOfIteratorHelper$j(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$j(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; } } }; }
|
|
27891
|
-
function _unsupportedIterableToArray$j(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$j(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$j(r, a) : void 0; } }
|
|
27892
|
-
function _arrayLikeToArray$j(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; }
|
|
27893
|
-
/**
|
|
27894
|
-
* providerResolution.js
|
|
27895
|
-
*
|
|
27896
|
-
* Shared helpers for walking a workspace and figuring out which widgets
|
|
27897
|
-
* have required providers that are still unresolved after the 3-layer
|
|
27898
|
-
* resolution (widget → workspace → app-default → null). Used by:
|
|
27899
|
-
*
|
|
27900
|
-
* - DashboardConfigModal to render the Providers tab
|
|
27901
|
-
* - DashboardStage toolbar to show the unresolved-count badge
|
|
27902
|
-
*
|
|
27903
|
-
* Both places need the same answer, so keep the logic here to avoid drift
|
|
27904
|
-
* with the resolution inside `useMcpProvider` / `useWebSocketProvider`.
|
|
27905
|
-
*/
|
|
27906
|
-
|
|
27907
|
-
/**
|
|
27908
|
-
* Resolve which provider name a given widget instance would bind to for
|
|
27909
|
-
* the given provider type. Mirrors the 3-layer chain in useMcpProvider
|
|
27910
|
-
* and useWebSocketProvider exactly:
|
|
27911
|
-
*
|
|
27912
|
-
* 1. widget-level override (layoutItem.selectedProviders[type])
|
|
27913
|
-
* 2. workspace-level binding (workspace.selectedProviders[id][type])
|
|
27914
|
-
* 3. app default (any provider of matching type flagged
|
|
27915
|
-
* `isDefaultForType` in appProviders)
|
|
27916
|
-
* 4. null (truly unresolved)
|
|
27917
|
-
*/
|
|
27918
|
-
function resolveProviderName(_ref) {
|
|
27919
|
-
var _layoutItem$selectedP, _workspace$selectedPr;
|
|
27920
|
-
var providerType = _ref.providerType,
|
|
27921
|
-
layoutItem = _ref.layoutItem,
|
|
27922
|
-
widgetId = _ref.widgetId,
|
|
27923
|
-
workspace = _ref.workspace,
|
|
27924
|
-
appProviders = _ref.appProviders;
|
|
27925
|
-
// 1. Widget-level
|
|
27926
|
-
var widgetLevel = layoutItem === null || layoutItem === void 0 || (_layoutItem$selectedP = layoutItem.selectedProviders) === null || _layoutItem$selectedP === void 0 ? void 0 : _layoutItem$selectedP[providerType];
|
|
27927
|
-
if (widgetLevel) return widgetLevel;
|
|
27928
|
-
|
|
27929
|
-
// 2. Workspace-level
|
|
27930
|
-
var workspaceLevel = widgetId && (workspace === null || workspace === void 0 || (_workspace$selectedPr = workspace.selectedProviders) === null || _workspace$selectedPr === void 0 || (_workspace$selectedPr = _workspace$selectedPr[widgetId]) === null || _workspace$selectedPr === void 0 ? void 0 : _workspace$selectedPr[providerType]);
|
|
27931
|
-
if (workspaceLevel) return workspaceLevel;
|
|
27932
|
-
|
|
27933
|
-
// 3. App default — appProviders is either a map keyed by name or an
|
|
27934
|
-
// array. Support both because different callers shape it either way.
|
|
27935
|
-
if (appProviders) {
|
|
27936
|
-
if (Array.isArray(appProviders)) {
|
|
27937
|
-
var _iterator = _createForOfIteratorHelper$j(appProviders),
|
|
27938
|
-
_step;
|
|
27939
|
-
try {
|
|
27940
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
27941
|
-
var data = _step.value;
|
|
27942
|
-
if ((data === null || data === void 0 ? void 0 : data.type) === providerType && (data === null || data === void 0 ? void 0 : data.isDefaultForType) === true) {
|
|
27943
|
-
return data.name;
|
|
27944
|
-
}
|
|
27945
|
-
}
|
|
27946
|
-
} catch (err) {
|
|
27947
|
-
_iterator.e(err);
|
|
27948
|
-
} finally {
|
|
27949
|
-
_iterator.f();
|
|
27950
|
-
}
|
|
27951
|
-
} else if (_typeof(appProviders) === "object") {
|
|
27952
|
-
for (var _i = 0, _Object$entries = Object.entries(appProviders); _i < _Object$entries.length; _i++) {
|
|
27953
|
-
var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
|
|
27954
|
-
name = _Object$entries$_i[0],
|
|
27955
|
-
_data = _Object$entries$_i[1];
|
|
27956
|
-
if ((_data === null || _data === void 0 ? void 0 : _data.type) === providerType && (_data === null || _data === void 0 ? void 0 : _data.isDefaultForType) === true) {
|
|
27957
|
-
return name;
|
|
27958
|
-
}
|
|
27959
|
-
}
|
|
27960
|
-
}
|
|
27961
|
-
}
|
|
27962
|
-
return null;
|
|
27963
|
-
}
|
|
27964
|
-
|
|
27965
|
-
/**
|
|
27966
|
-
* Walk every layout container in a workspace and yield each widget
|
|
27967
|
-
* instance with its concrete layout item. Handles the main layout,
|
|
27968
|
-
* per-page layouts, the sidebar, and nested LayoutGridContainers whose
|
|
27969
|
-
* children are stored on `items`/`layout`.
|
|
27970
|
-
*
|
|
27971
|
-
* Deduplicates by object identity AND by stable id so that shared
|
|
27972
|
-
* references across pages (or two structurally-distinct items that
|
|
27973
|
-
* carry the same uuidString / id, which is the wiring key) are
|
|
27974
|
-
* visited exactly once. Pipeline-style workspaces re-reference the
|
|
27975
|
-
* same widget objects across page layouts; without this dedupe the
|
|
27976
|
-
* Providers/Listeners tabs render one row per reference.
|
|
27977
|
-
*/
|
|
27978
|
-
function forEachWidget(workspace, visit) {
|
|
27979
|
-
if (!workspace) return;
|
|
27980
|
-
var visitedObjects = new WeakSet();
|
|
27981
|
-
var visitedIds = new Set();
|
|
27982
|
-
|
|
27983
|
-
// Canonical identity: `component|id-ish`. Including the component
|
|
27984
|
-
// prefix in every form aligns this with `canonicalItemKey` in
|
|
27985
|
-
// listenerResolution.js — they MUST agree or duplicates slip
|
|
27986
|
-
// between the visit loop and downstream dedupes. Prefer uuidString
|
|
27987
|
-
// (stable across sessions), then uuid, then numeric id.
|
|
27988
|
-
var stableId = function stableId(item) {
|
|
27989
|
-
if (!item || !item.component) return null;
|
|
27990
|
-
if (item.uuidString) return "".concat(item.component, "|").concat(item.uuidString);
|
|
27991
|
-
if (item.uuid) return "".concat(item.component, "|").concat(item.uuid);
|
|
27992
|
-
if (item.id != null) return "".concat(item.component, "|").concat(item.id);
|
|
27993
|
-
return null;
|
|
27994
|
-
};
|
|
27995
|
-
var _walk = function walk(items) {
|
|
27996
|
-
if (!Array.isArray(items)) return;
|
|
27997
|
-
var _iterator2 = _createForOfIteratorHelper$j(items),
|
|
27998
|
-
_step2;
|
|
27999
|
-
try {
|
|
28000
|
-
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
28001
|
-
var item = _step2.value;
|
|
28002
|
-
if (!item || _typeof(item) !== "object") continue;
|
|
28003
|
-
// A "widget" is any layout item with a component name.
|
|
28004
|
-
// Containers can have both a component name AND nested items
|
|
28005
|
-
// (e.g. LayoutGridContainer), so still recurse.
|
|
28006
|
-
if (item.component) {
|
|
28007
|
-
var id = stableId(item);
|
|
28008
|
-
var alreadyByRef = visitedObjects.has(item);
|
|
28009
|
-
var alreadyById = id != null && visitedIds.has(id);
|
|
28010
|
-
if (!alreadyByRef && !alreadyById) {
|
|
28011
|
-
visitedObjects.add(item);
|
|
28012
|
-
if (id != null) visitedIds.add(id);
|
|
28013
|
-
visit(item);
|
|
28014
|
-
}
|
|
28015
|
-
}
|
|
28016
|
-
if (Array.isArray(item.items)) _walk(item.items);
|
|
28017
|
-
if (Array.isArray(item.layout)) _walk(item.layout);
|
|
28018
|
-
}
|
|
28019
|
-
} catch (err) {
|
|
28020
|
-
_iterator2.e(err);
|
|
28021
|
-
} finally {
|
|
28022
|
-
_iterator2.f();
|
|
28023
|
-
}
|
|
28024
|
-
};
|
|
28025
|
-
_walk(workspace.layout);
|
|
28026
|
-
if (Array.isArray(workspace.pages)) {
|
|
28027
|
-
var _iterator3 = _createForOfIteratorHelper$j(workspace.pages),
|
|
28028
|
-
_step3;
|
|
28029
|
-
try {
|
|
28030
|
-
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
28031
|
-
var page = _step3.value;
|
|
28032
|
-
_walk(page === null || page === void 0 ? void 0 : page.layout);
|
|
28033
|
-
}
|
|
28034
|
-
} catch (err) {
|
|
28035
|
-
_iterator3.e(err);
|
|
28036
|
-
} finally {
|
|
28037
|
-
_iterator3.f();
|
|
28038
|
-
}
|
|
28039
|
-
}
|
|
28040
|
-
_walk(workspace.sidebarLayout);
|
|
28041
|
-
}
|
|
28042
|
-
|
|
28043
|
-
/**
|
|
28044
|
-
* Compute the list of unresolved required providers across a workspace.
|
|
28045
|
-
*
|
|
28046
|
-
* @param {object} args
|
|
28047
|
-
* @param {object} args.workspace The workspace (with layout/pages/sidebarLayout/selectedProviders).
|
|
28048
|
-
* @param {object|Array} args.appProviders
|
|
28049
|
-
* Map keyed by provider name, or an array of provider objects. Each
|
|
28050
|
-
* entry has at least `{ type, isDefaultForType }`.
|
|
28051
|
-
* @param {(componentName: string) => Array<{type, required?, providerClass?}>} args.getWidgetRequirements
|
|
28052
|
-
* Returns the `providers: [...]` declaration from the component's
|
|
28053
|
-
* `.dash.js` (via `ComponentManager.componentMap()[name].providers`).
|
|
28054
|
-
*
|
|
28055
|
-
* @returns {Array<{ widgetId, component, providerType, providerClass, layoutItem }>}
|
|
28056
|
-
* One entry per (widget instance, required provider type) that lacks
|
|
28057
|
-
* a binding.
|
|
28058
|
-
*/
|
|
28059
|
-
function getUnresolvedProviders(_ref2) {
|
|
28060
|
-
var workspace = _ref2.workspace,
|
|
28061
|
-
appProviders = _ref2.appProviders,
|
|
28062
|
-
getWidgetRequirements = _ref2.getWidgetRequirements;
|
|
28063
|
-
if (!workspace || typeof getWidgetRequirements !== "function") return [];
|
|
28064
|
-
var unresolved = [];
|
|
28065
|
-
forEachWidget(workspace, function (item) {
|
|
28066
|
-
var requirements = getWidgetRequirements(item.component) || [];
|
|
28067
|
-
if (!Array.isArray(requirements) || requirements.length === 0) return;
|
|
28068
|
-
var widgetId = item.uuidString || item.uuid || item.id || null;
|
|
28069
|
-
var _iterator4 = _createForOfIteratorHelper$j(requirements),
|
|
28070
|
-
_step4;
|
|
28071
|
-
try {
|
|
28072
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
28073
|
-
var req = _step4.value;
|
|
28074
|
-
if (!req || !req.type) continue;
|
|
28075
|
-
if (req.required === false) continue; // optional, skip
|
|
28076
|
-
|
|
28077
|
-
var name = resolveProviderName({
|
|
28078
|
-
providerType: req.type,
|
|
28079
|
-
layoutItem: item,
|
|
28080
|
-
widgetId: widgetId,
|
|
28081
|
-
workspace: workspace,
|
|
28082
|
-
appProviders: appProviders
|
|
28083
|
-
});
|
|
28084
|
-
if (!name) {
|
|
28085
|
-
unresolved.push({
|
|
28086
|
-
widgetId: widgetId,
|
|
28087
|
-
component: item.component,
|
|
28088
|
-
providerType: req.type,
|
|
28089
|
-
providerClass: req.providerClass || null,
|
|
28090
|
-
layoutItem: item
|
|
28091
|
-
});
|
|
28092
|
-
}
|
|
28093
|
-
}
|
|
28094
|
-
} catch (err) {
|
|
28095
|
-
_iterator4.e(err);
|
|
28096
|
-
} finally {
|
|
28097
|
-
_iterator4.f();
|
|
28098
|
-
}
|
|
28099
|
-
});
|
|
28100
|
-
return unresolved;
|
|
28101
|
-
}
|
|
28102
|
-
|
|
28103
|
-
/**
|
|
28104
|
-
* Group an unresolved-provider list (or any `{widget, providerType}` list)
|
|
28105
|
-
* by provider type, so the Providers tab can render one row per unique
|
|
28106
|
-
* type with N widgets beneath.
|
|
28107
|
-
*/
|
|
28108
|
-
function groupByProviderType(unresolved) {
|
|
28109
|
-
var byType = new Map();
|
|
28110
|
-
var _iterator5 = _createForOfIteratorHelper$j(unresolved || []),
|
|
28111
|
-
_step5;
|
|
28112
|
-
try {
|
|
28113
|
-
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
28114
|
-
var u = _step5.value;
|
|
28115
|
-
if (!(u !== null && u !== void 0 && u.providerType)) continue;
|
|
28116
|
-
if (!byType.has(u.providerType)) byType.set(u.providerType, []);
|
|
28117
|
-
byType.get(u.providerType).push(u);
|
|
28118
|
-
}
|
|
28119
|
-
} catch (err) {
|
|
28120
|
-
_iterator5.e(err);
|
|
28121
|
-
} finally {
|
|
28122
|
-
_iterator5.f();
|
|
28123
|
-
}
|
|
28124
|
-
return byType;
|
|
28125
|
-
}
|
|
28126
|
-
|
|
28127
|
-
/**
|
|
28128
|
-
* Summarize every widget in the workspace that requires ANY provider,
|
|
28129
|
-
* regardless of whether it's already resolved. Drives the Providers tab's
|
|
28130
|
-
* "show per-widget overrides" expansion — the modal lists all widgets so
|
|
28131
|
-
* the user can change an explicit override even for types that are
|
|
28132
|
-
* already resolved via the app default.
|
|
28133
|
-
*/
|
|
28134
|
-
function getAllProviderBindings(_ref3) {
|
|
28135
|
-
var workspace = _ref3.workspace,
|
|
28136
|
-
appProviders = _ref3.appProviders,
|
|
28137
|
-
getWidgetRequirements = _ref3.getWidgetRequirements;
|
|
28138
|
-
if (!workspace || typeof getWidgetRequirements !== "function") return [];
|
|
28139
|
-
var bindings = [];
|
|
28140
|
-
forEachWidget(workspace, function (item) {
|
|
28141
|
-
var requirements = getWidgetRequirements(item.component) || [];
|
|
28142
|
-
if (!Array.isArray(requirements) || requirements.length === 0) return;
|
|
28143
|
-
var widgetId = item.uuidString || item.uuid || item.id || null;
|
|
28144
|
-
var _iterator6 = _createForOfIteratorHelper$j(requirements),
|
|
28145
|
-
_step6;
|
|
28146
|
-
try {
|
|
28147
|
-
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
28148
|
-
var req = _step6.value;
|
|
28149
|
-
if (!req || !req.type) continue;
|
|
28150
|
-
var name = resolveProviderName({
|
|
28151
|
-
providerType: req.type,
|
|
28152
|
-
layoutItem: item,
|
|
28153
|
-
widgetId: widgetId,
|
|
28154
|
-
workspace: workspace,
|
|
28155
|
-
appProviders: appProviders
|
|
28156
|
-
});
|
|
28157
|
-
bindings.push({
|
|
28158
|
-
widgetId: widgetId,
|
|
28159
|
-
component: item.component,
|
|
28160
|
-
providerType: req.type,
|
|
28161
|
-
providerClass: req.providerClass || null,
|
|
28162
|
-
required: req.required !== false,
|
|
28163
|
-
resolvedProviderName: name,
|
|
28164
|
-
layoutItem: item
|
|
28165
|
-
});
|
|
28166
|
-
}
|
|
28167
|
-
} catch (err) {
|
|
28168
|
-
_iterator6.e(err);
|
|
28169
|
-
} finally {
|
|
28170
|
-
_iterator6.f();
|
|
28171
|
-
}
|
|
28172
|
-
});
|
|
28173
|
-
return bindings;
|
|
28174
|
-
}
|
|
28175
|
-
|
|
28176
|
-
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; }
|
|
28177
|
-
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; }
|
|
28178
|
-
function _createForOfIteratorHelper$i(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$i(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; } } }; }
|
|
28179
|
-
function _unsupportedIterableToArray$i(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$i(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$i(r, a) : void 0; } }
|
|
28180
|
-
function _arrayLikeToArray$i(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; }
|
|
28181
|
-
var EVENT_STRING_RE = /^([^[]+)\[([^\]]+)\]\.(.+)$/;
|
|
28182
|
-
|
|
28183
|
-
/** Parse "Component[itemId].event" → { component, itemId, event }. */
|
|
28184
|
-
function parseEventString(eventString) {
|
|
28185
|
-
if (typeof eventString !== "string") return null;
|
|
28186
|
-
var m = eventString.match(EVENT_STRING_RE);
|
|
28187
|
-
if (!m) return null;
|
|
28188
|
-
return {
|
|
28189
|
-
component: m[1],
|
|
28190
|
-
itemId: m[2],
|
|
28191
|
-
event: m[3]
|
|
28192
|
-
};
|
|
28193
|
-
}
|
|
28194
|
-
|
|
28195
|
-
/** Build an event string in the canonical runtime format. */
|
|
28196
|
-
function formatEventString(component, itemId, event) {
|
|
28197
|
-
return "".concat(component, "[").concat(itemId, "].").concat(event);
|
|
28198
|
-
}
|
|
28199
|
-
|
|
28200
|
-
/**
|
|
28201
|
-
* Get a stable id for a layout item. Layout items historically used
|
|
28202
|
-
* numeric `id`; some newer flows also carry `uuidString`/`uuid`. The
|
|
28203
|
-
* runtime event-string format uses whichever is `item.id`, so we
|
|
28204
|
-
* default to that and fall back to the others for resilience.
|
|
28205
|
-
*/
|
|
28206
|
-
function itemIdOf(item) {
|
|
28207
|
-
if (item == null) return null;
|
|
28208
|
-
if (item.id !== undefined && item.id !== null) return String(item.id);
|
|
28209
|
-
if (item.uuidString) return item.uuidString;
|
|
28210
|
-
if (item.uuid) return item.uuid;
|
|
28211
|
-
return null;
|
|
28212
|
-
}
|
|
28213
|
-
|
|
28214
|
-
/**
|
|
28215
|
-
* Canonical identity key for a layout item: `component|id-ish`.
|
|
28216
|
-
* Single source of truth for dedupe in every query below and in
|
|
28217
|
-
* `forEachWidget` (providerResolution.js). Including the component
|
|
28218
|
-
* prefix prevents two structurally-different widgets from colliding
|
|
28219
|
-
* when they happen to share a uuid (rare, but possible when items
|
|
28220
|
-
* are pasted between workspaces).
|
|
28221
|
-
*
|
|
28222
|
-
* Priority matches forEachWidget's stableId so a widget that
|
|
28223
|
-
* forEachWidget visited once produces exactly one map entry across
|
|
28224
|
-
* every listener-side consumer — no more `STAGEGATECHECKLIST[4]`
|
|
28225
|
-
* appearing twice because one caller used `uuidString` and the
|
|
28226
|
-
* other used `id`.
|
|
28227
|
-
*/
|
|
28228
|
-
function canonicalItemKey(item) {
|
|
28229
|
-
if (!item || !item.component) return null;
|
|
28230
|
-
if (item.uuidString) return "".concat(item.component, "|").concat(item.uuidString);
|
|
28231
|
-
if (item.uuid) return "".concat(item.component, "|").concat(item.uuid);
|
|
28232
|
-
if (item.id !== undefined && item.id !== null) {
|
|
28233
|
-
return "".concat(item.component, "|").concat(item.id);
|
|
28234
|
-
}
|
|
28235
|
-
return null;
|
|
28236
|
-
}
|
|
28237
|
-
|
|
28238
|
-
/**
|
|
28239
|
-
* Best-effort human label for a layout item: explicit title, then
|
|
28240
|
-
* widget config display name, then component name + short id.
|
|
28241
|
-
*/
|
|
28242
|
-
function labelFor(item, getWidgetConfig) {
|
|
28243
|
-
var _item$userPrefs, _item$userConfig;
|
|
28244
|
-
var cfg = (getWidgetConfig === null || getWidgetConfig === void 0 ? void 0 : getWidgetConfig(item.component)) || null;
|
|
28245
|
-
var explicit = (item === null || item === void 0 || (_item$userPrefs = item.userPrefs) === null || _item$userPrefs === void 0 ? void 0 : _item$userPrefs.title) || (item === null || item === void 0 || (_item$userConfig = item.userConfig) === null || _item$userConfig === void 0 ? void 0 : _item$userConfig.title);
|
|
28246
|
-
if (explicit) return explicit;
|
|
28247
|
-
if (cfg !== null && cfg !== void 0 && cfg.displayName) return cfg.displayName;
|
|
28248
|
-
var id = itemIdOf(item);
|
|
28249
|
-
return "".concat(item.component || "widget").concat(id ? "[".concat(String(id).slice(0, 6), "]") : "");
|
|
28250
|
-
}
|
|
28251
|
-
|
|
28252
|
-
/**
|
|
28253
|
-
* Read the events/eventHandlers metadata for a widget. Items can carry
|
|
28254
|
-
* the arrays inline (older pattern where they got cached onto the
|
|
28255
|
-
* layout item); the current component config carries them via the
|
|
28256
|
-
* ComponentManager catalog. We UNION both so we don't flag a binding
|
|
28257
|
-
* as orphaned just because an inline cache is stale — if the current
|
|
28258
|
-
* widget code declares the event/handler, the binding is valid.
|
|
28259
|
-
*/
|
|
28260
|
-
function eventsOf(item, getWidgetConfig) {
|
|
28261
|
-
var inline = Array.isArray(item.events) ? item.events : [];
|
|
28262
|
-
var cfg = (getWidgetConfig === null || getWidgetConfig === void 0 ? void 0 : getWidgetConfig(item.component)) || {};
|
|
28263
|
-
var fromCfg = Array.isArray(cfg.events) ? cfg.events : [];
|
|
28264
|
-
return _toConsumableArray(new Set([].concat(_toConsumableArray(inline), _toConsumableArray(fromCfg))));
|
|
28265
|
-
}
|
|
28266
|
-
function eventHandlersOf(item, getWidgetConfig) {
|
|
28267
|
-
var inline = Array.isArray(item.eventHandlers) ? item.eventHandlers : [];
|
|
28268
|
-
var cfg = (getWidgetConfig === null || getWidgetConfig === void 0 ? void 0 : getWidgetConfig(item.component)) || {};
|
|
28269
|
-
var fromCfg = Array.isArray(cfg.eventHandlers) ? cfg.eventHandlers : [];
|
|
28270
|
-
return _toConsumableArray(new Set([].concat(_toConsumableArray(inline), _toConsumableArray(fromCfg))));
|
|
28271
|
-
}
|
|
28272
|
-
|
|
28273
|
-
/**
|
|
28274
|
-
* Every widget instance in the workspace that emits at least one event.
|
|
28275
|
-
* Deduplicated by `${component}|${itemId}` — the same compound key that
|
|
28276
|
-
* event strings use at runtime, so any "duplicate" in the tree (same
|
|
28277
|
-
* widget referenced across pages) resolves to the same wiring target.
|
|
28278
|
-
* @returns {Array<{ itemId, component, label, events: string[], key: string }>}
|
|
28279
|
-
*/
|
|
28280
|
-
function getEmitters(workspace, getWidgetConfig) {
|
|
28281
|
-
var byKey = new Map();
|
|
28282
|
-
forEachWidget(workspace, function (item) {
|
|
28283
|
-
var events = eventsOf(item, getWidgetConfig);
|
|
28284
|
-
if (events.length === 0) return;
|
|
28285
|
-
var key = canonicalItemKey(item);
|
|
28286
|
-
if (!key) return;
|
|
28287
|
-
if (byKey.has(key)) return;
|
|
28288
|
-
byKey.set(key, {
|
|
28289
|
-
key: key,
|
|
28290
|
-
itemId: itemIdOf(item),
|
|
28291
|
-
component: item.component,
|
|
28292
|
-
label: labelFor(item, getWidgetConfig),
|
|
28293
|
-
events: events
|
|
28294
|
-
});
|
|
28295
|
-
});
|
|
28296
|
-
return Array.from(byKey.values());
|
|
28297
|
-
}
|
|
28298
|
-
|
|
28299
|
-
/**
|
|
28300
|
-
* Every widget instance in the workspace that accepts at least one
|
|
28301
|
-
* handler. Used to populate the receiver dropdown. Deduplicated by
|
|
28302
|
-
* `${component}|${itemId}` (see getEmitters).
|
|
28303
|
-
* @returns {Array<{ itemId, component, label, eventHandlers: string[], listeners: object, key: string }>}
|
|
28304
|
-
*/
|
|
28305
|
-
function getReceivers(workspace, getWidgetConfig) {
|
|
28306
|
-
var byKey = new Map();
|
|
28307
|
-
forEachWidget(workspace, function (item) {
|
|
28308
|
-
var handlers = eventHandlersOf(item, getWidgetConfig);
|
|
28309
|
-
if (handlers.length === 0) return;
|
|
28310
|
-
var key = canonicalItemKey(item);
|
|
28311
|
-
if (!key) return;
|
|
28312
|
-
if (byKey.has(key)) return;
|
|
28313
|
-
byKey.set(key, {
|
|
28314
|
-
key: key,
|
|
28315
|
-
itemId: itemIdOf(item),
|
|
28316
|
-
component: item.component,
|
|
28317
|
-
label: labelFor(item, getWidgetConfig),
|
|
28318
|
-
eventHandlers: handlers,
|
|
28319
|
-
listeners: item.listeners || {}
|
|
28320
|
-
});
|
|
28321
|
-
});
|
|
28322
|
-
return Array.from(byKey.values());
|
|
28323
|
-
}
|
|
28628
|
+
// Set default gap if not specified
|
|
28629
|
+
if (!layout.grid.gap) layout.grid.gap = "gap-2";
|
|
28324
28630
|
|
|
28325
|
-
|
|
28326
|
-
|
|
28327
|
-
|
|
28328
|
-
|
|
28329
|
-
|
|
28330
|
-
|
|
28331
|
-
|
|
28332
|
-
|
|
28333
|
-
|
|
28334
|
-
|
|
28335
|
-
|
|
28336
|
-
|
|
28337
|
-
|
|
28338
|
-
|
|
28339
|
-
|
|
28340
|
-
|
|
28341
|
-
|
|
28342
|
-
|
|
28343
|
-
//
|
|
28344
|
-
|
|
28345
|
-
|
|
28346
|
-
|
|
28347
|
-
|
|
28348
|
-
|
|
28349
|
-
|
|
28350
|
-
|
|
28351
|
-
|
|
28352
|
-
|
|
28353
|
-
|
|
28354
|
-
|
|
28355
|
-
|
|
28356
|
-
|
|
28357
|
-
|
|
28358
|
-
|
|
28359
|
-
|
|
28360
|
-
|
|
28631
|
+
// Sort grid object keys for consistent ordering
|
|
28632
|
+
layout.grid = sortObjectByKeys(layout.grid);
|
|
28633
|
+
|
|
28634
|
+
// If type is not explicitly set and grid exists, set type to "grid"
|
|
28635
|
+
if (layout.type === "layout" && "grid" in obj) {
|
|
28636
|
+
layout.type = "grid";
|
|
28637
|
+
}
|
|
28638
|
+
}
|
|
28639
|
+
layout.parentWorkspaceName = "parentWorkspaceName" in obj ? obj["parentWorkspaceName"] : null;
|
|
28640
|
+
|
|
28641
|
+
// last check for this being a container...
|
|
28642
|
+
// we are forcing ALL containers to be w full and h full
|
|
28643
|
+
// not sure this is a good idea, but...
|
|
28644
|
+
if ("workspace" in layout || layout.type !== "widget") {
|
|
28645
|
+
// if (layout.workspace === "layout") {
|
|
28646
|
+
if (layout.width === "") {
|
|
28647
|
+
layout.width = "w-full";
|
|
28648
|
+
}
|
|
28649
|
+
// if (layout.height === "") {
|
|
28650
|
+
layout.height = "h-full";
|
|
28651
|
+
// }
|
|
28652
|
+
// if (layout.scrollable === "") {
|
|
28653
|
+
// layout.scrollable = true;
|
|
28654
|
+
// }
|
|
28655
|
+
if (layout.direction === "") {
|
|
28656
|
+
layout.direction = "col";
|
|
28657
|
+
}
|
|
28658
|
+
// }
|
|
28659
|
+
}
|
|
28660
|
+
|
|
28661
|
+
// lets check to see if we already have the parent workspace?
|
|
28662
|
+
if (layout.parentWorkspaceName === null) {
|
|
28663
|
+
// get the nearest workspace and assign this as the parent for rendering
|
|
28664
|
+
var tempLayout = DashReact.deepCopy(layout);
|
|
28665
|
+
var parentWS = getNearestParentWorkspace(workspaceLayout, tempLayout, tempLayout);
|
|
28666
|
+
var parentWorkspaceName = "layout";
|
|
28667
|
+
if (parentWS) {
|
|
28668
|
+
if ("workspace" in parentWS) {
|
|
28669
|
+
parentWorkspaceName = parentWS["workspace"];
|
|
28361
28670
|
}
|
|
28362
|
-
} catch (err) {
|
|
28363
|
-
_iterator.e(err);
|
|
28364
|
-
} finally {
|
|
28365
|
-
_iterator.f();
|
|
28366
28671
|
}
|
|
28672
|
+
layout.parentWorkspaceName = parentWorkspaceName;
|
|
28367
28673
|
}
|
|
28368
|
-
|
|
28369
|
-
|
|
28370
|
-
|
|
28674
|
+
return layout;
|
|
28675
|
+
} catch (e) {
|
|
28676
|
+
return null;
|
|
28677
|
+
}
|
|
28678
|
+
};
|
|
28371
28679
|
|
|
28372
28680
|
/**
|
|
28373
|
-
*
|
|
28374
|
-
*
|
|
28375
|
-
* declare the event, or the receiver doesn't declare the handler.
|
|
28376
|
-
* Each entry includes a `reason` so the modal can show a sensible
|
|
28377
|
-
* message.
|
|
28681
|
+
* Handle all of the data for a color (theme)
|
|
28682
|
+
* @param {Object} obj the color object we would like to use to populate the model (optional)
|
|
28378
28683
|
*/
|
|
28379
|
-
function
|
|
28380
|
-
var
|
|
28381
|
-
if (wiring.length === 0) return [];
|
|
28382
|
-
|
|
28383
|
-
// Build two lookups:
|
|
28384
|
-
// byCompositeKey: `${component}|${itemId}` → widget meta (primary)
|
|
28385
|
-
// byItemId: `${itemId}` → widget meta (fallback,
|
|
28386
|
-
// used only for the "source-missing" check where
|
|
28387
|
-
// the wiring's component can't be trusted yet)
|
|
28388
|
-
// The composite key matches how the runtime event-string
|
|
28389
|
-
// (`Component[itemId].event`) identifies a widget, so orphan
|
|
28390
|
-
// decisions line up with what actually fires at runtime.
|
|
28391
|
-
var byCompositeKey = new Map();
|
|
28392
|
-
var byItemId = new Map();
|
|
28393
|
-
forEachWidget(workspace, function (item) {
|
|
28394
|
-
var id = itemIdOf(item);
|
|
28395
|
-
if (id == null) return;
|
|
28396
|
-
var meta = {
|
|
28397
|
-
component: item.component,
|
|
28398
|
-
events: eventsOf(item, getWidgetConfig),
|
|
28399
|
-
eventHandlers: eventHandlersOf(item, getWidgetConfig)
|
|
28400
|
-
};
|
|
28401
|
-
byCompositeKey.set("".concat(item.component, "|").concat(id), meta);
|
|
28402
|
-
// First-seen wins on numeric-id collisions; good enough for the
|
|
28403
|
-
// "does any widget with this id exist?" fallback.
|
|
28404
|
-
if (!byItemId.has(id)) byItemId.set(id, meta);
|
|
28405
|
-
});
|
|
28406
|
-
var orphans = [];
|
|
28407
|
-
var _iterator2 = _createForOfIteratorHelper$i(wiring),
|
|
28408
|
-
_step2;
|
|
28684
|
+
var ColorModel = function ColorModel() {
|
|
28685
|
+
var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
28409
28686
|
try {
|
|
28410
|
-
|
|
28411
|
-
|
|
28412
|
-
var
|
|
28413
|
-
var
|
|
28414
|
-
|
|
28415
|
-
|
|
28416
|
-
|
|
28417
|
-
|
|
28418
|
-
|
|
28419
|
-
|
|
28420
|
-
|
|
28421
|
-
|
|
28422
|
-
|
|
28423
|
-
|
|
28424
|
-
|
|
28425
|
-
|
|
28426
|
-
|
|
28427
|
-
|
|
28428
|
-
|
|
28429
|
-
|
|
28430
|
-
|
|
28431
|
-
|
|
28432
|
-
|
|
28433
|
-
|
|
28434
|
-
|
|
28435
|
-
|
|
28436
|
-
|
|
28437
|
-
|
|
28687
|
+
if (obj) {
|
|
28688
|
+
// console.log("cm: ", obj);
|
|
28689
|
+
var temp = DashReact.deepCopy(obj);
|
|
28690
|
+
var color = {};
|
|
28691
|
+
color.panelType = "panelType" in temp ? temp.panelType : "main";
|
|
28692
|
+
color.colorName = "colorName" in temp ? temp.colorName : "white";
|
|
28693
|
+
color.colorType = "colorType" in temp ? temp.colorType !== undefined && temp.colorType !== null ? temp.colorType : "primary" : "primary";
|
|
28694
|
+
color.shade = "shade" in temp ? temp.shade : 500;
|
|
28695
|
+
color.variant = "variant" in temp ? temp.variant : "dark";
|
|
28696
|
+
color.level = "level" in temp ? temp.level : "light";
|
|
28697
|
+
color.objectType = "objectType" in temp ? temp.objectType : "bg";
|
|
28698
|
+
color.styleName = DashReact.getStyleName(color.objectType); //'background';
|
|
28699
|
+
|
|
28700
|
+
/**
|
|
28701
|
+
* generate the display name
|
|
28702
|
+
*/
|
|
28703
|
+
color.displayName = "displayName" in temp ? temp.name : DashReact.capitalizeFirstLetter(color.colorName);
|
|
28704
|
+
|
|
28705
|
+
/**
|
|
28706
|
+
* Strings for the theme class name and the class to be used in className
|
|
28707
|
+
*/
|
|
28708
|
+
color.themeClass = "".concat(color.objectType, "-").concat(color.colorType, "-").concat(color.level);
|
|
28709
|
+
color["class"] = "".concat(color.objectType, "-").concat(color.colorName, "-").concat(color.shade);
|
|
28710
|
+
|
|
28711
|
+
/**
|
|
28712
|
+
* Grab the hex code via tailwind for the tailwind color
|
|
28713
|
+
* This may change as we move to hex codes for selection
|
|
28714
|
+
*/
|
|
28715
|
+
color.hex = colors[color.colorName];
|
|
28716
|
+
return color;
|
|
28438
28717
|
}
|
|
28439
|
-
|
|
28440
|
-
|
|
28441
|
-
|
|
28442
|
-
_iterator2.f();
|
|
28718
|
+
return null;
|
|
28719
|
+
} catch (e) {
|
|
28720
|
+
return obj;
|
|
28443
28721
|
}
|
|
28444
|
-
|
|
28445
|
-
|
|
28722
|
+
};
|
|
28723
|
+
|
|
28724
|
+
var SettingsModel = function SettingsModel() {
|
|
28725
|
+
var settingsObject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
28726
|
+
var obj = DashReact.deepCopy(settingsObject);
|
|
28727
|
+
obj["debug"] = "debug" in obj ? obj["debug"] : false;
|
|
28728
|
+
obj["theme"] = "theme" in obj ? obj["theme"] : null;
|
|
28729
|
+
return obj;
|
|
28730
|
+
};
|
|
28731
|
+
|
|
28732
|
+
function _createForOfIteratorHelper$i(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$i(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; } } }; }
|
|
28733
|
+
function _unsupportedIterableToArray$i(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$i(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$i(r, a) : void 0; } }
|
|
28734
|
+
function _arrayLikeToArray$i(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; }
|
|
28446
28735
|
|
|
28447
28736
|
/**
|
|
28448
|
-
*
|
|
28449
|
-
*
|
|
28450
|
-
*
|
|
28451
|
-
*
|
|
28737
|
+
* Workspace-level pre-pass that migrates legacy bare component
|
|
28738
|
+
* references throughout an entire workspace. Runs ONCE on workspace
|
|
28739
|
+
* load (from `WorkspaceModel`); after this pass every layout item
|
|
28740
|
+
* carries a fully scoped `component` AND every listener event string
|
|
28741
|
+
* (`Comp[id].evt`) references the matching scoped component.
|
|
28452
28742
|
*
|
|
28453
|
-
*
|
|
28454
|
-
* - the emitter widget was deleted
|
|
28455
|
-
* - the emitter widget's id now belongs to a different component
|
|
28456
|
-
* (stored binding has stale component name)
|
|
28457
|
-
* - the source string failed to parse (legacy/garbage data)
|
|
28743
|
+
* Why workspace-level (and not per-LayoutModel item)?
|
|
28458
28744
|
*
|
|
28459
|
-
*
|
|
28460
|
-
*
|
|
28461
|
-
*
|
|
28745
|
+
* - Listeners can reference widgets across pages/sidebar/root, so
|
|
28746
|
+
* migrating one item's listeners requires knowing the scoped form
|
|
28747
|
+
* of widgets in OTHER items. Per-item migration can't see that.
|
|
28748
|
+
* - `pruneDeadListenerReferences` (called immediately after) walks
|
|
28749
|
+
* the whole workspace and needs every item's `component` AND
|
|
28750
|
+
* every listener string to use the same identity space. If
|
|
28751
|
+
* listeners still reference bare names but live items are scoped,
|
|
28752
|
+
* prune treats every legacy listener as an orphan and silently
|
|
28753
|
+
* deletes the user's wiring.
|
|
28462
28754
|
*
|
|
28463
|
-
*
|
|
28755
|
+
* Mutating in place is intentional — `WorkspaceModel` already deep-
|
|
28756
|
+
* copies the input, so the surface mutation is contained to that
|
|
28757
|
+
* working copy.
|
|
28758
|
+
*
|
|
28759
|
+
* @param {object} workspace
|
|
28760
|
+
* @param {object} componentMap - registry map keyed by scoped ids
|
|
28761
|
+
* @returns {{components: number, listeners: number}} migration counts
|
|
28464
28762
|
*/
|
|
28465
|
-
function
|
|
28466
|
-
|
|
28763
|
+
function migrateScopedIdsInWorkspace(workspace, componentMap) {
|
|
28764
|
+
var counts = {
|
|
28765
|
+
components: 0,
|
|
28766
|
+
listeners: 0
|
|
28767
|
+
};
|
|
28768
|
+
if (!workspace || !componentMap) return counts;
|
|
28769
|
+
var migrateComponent = function migrateComponent(item) {
|
|
28770
|
+
if (!item || _typeof(item) !== "object" || !item.component) return;
|
|
28771
|
+
var before = item.component;
|
|
28772
|
+
var after = migrateBareComponentName(componentMap, before);
|
|
28773
|
+
if (after !== before) {
|
|
28774
|
+
item.component = after;
|
|
28775
|
+
counts.components += 1;
|
|
28776
|
+
}
|
|
28777
|
+
};
|
|
28467
28778
|
|
|
28468
|
-
//
|
|
28469
|
-
//
|
|
28470
|
-
|
|
28471
|
-
var
|
|
28472
|
-
|
|
28473
|
-
|
|
28474
|
-
|
|
28475
|
-
|
|
28476
|
-
|
|
28477
|
-
|
|
28478
|
-
|
|
28479
|
-
|
|
28480
|
-
|
|
28481
|
-
|
|
28779
|
+
// Listener event strings parse as `Comp[id].evt`. Only the `Comp`
|
|
28780
|
+
// portion is migrated; the id is the receiver's stable layout id
|
|
28781
|
+
// (numeric or uuid) and the event name is widget-defined.
|
|
28782
|
+
var EVENT_RE = /^([^[]+)(\[[^\]]+\]\..+)$/;
|
|
28783
|
+
var migrateListenerStrings = function migrateListenerStrings(item) {
|
|
28784
|
+
if (!item || _typeof(item) !== "object") return;
|
|
28785
|
+
var listeners = item.listeners;
|
|
28786
|
+
if (!listeners || _typeof(listeners) !== "object") return;
|
|
28787
|
+
for (var _i = 0, _Object$keys = Object.keys(listeners); _i < _Object$keys.length; _i++) {
|
|
28788
|
+
var handler = _Object$keys[_i];
|
|
28789
|
+
var events = listeners[handler];
|
|
28790
|
+
if (!Array.isArray(events)) continue;
|
|
28791
|
+
for (var i = 0; i < events.length; i += 1) {
|
|
28792
|
+
var raw = events[i];
|
|
28793
|
+
if (typeof raw !== "string") continue;
|
|
28794
|
+
var m = raw.match(EVENT_RE);
|
|
28795
|
+
if (!m) continue;
|
|
28796
|
+
var _m = _slicedToArray(m, 3),
|
|
28797
|
+
comp = _m[1],
|
|
28798
|
+
rest = _m[2];
|
|
28799
|
+
var migrated = migrateBareComponentName(componentMap, comp);
|
|
28800
|
+
if (migrated !== comp) {
|
|
28801
|
+
events[i] = "".concat(migrated).concat(rest);
|
|
28802
|
+
counts.listeners += 1;
|
|
28482
28803
|
}
|
|
28483
|
-
if (Array.isArray(item.items)) _walkForLive(item.items);
|
|
28484
|
-
if (Array.isArray(item.layout)) _walkForLive(item.layout);
|
|
28485
28804
|
}
|
|
28486
|
-
} catch (err) {
|
|
28487
|
-
_iterator3.e(err);
|
|
28488
|
-
} finally {
|
|
28489
|
-
_iterator3.f();
|
|
28490
28805
|
}
|
|
28491
28806
|
};
|
|
28492
|
-
|
|
28493
|
-
if (Array.isArray(workspace.pages)) {
|
|
28494
|
-
var _iterator4 = _createForOfIteratorHelper$i(workspace.pages),
|
|
28495
|
-
_step4;
|
|
28496
|
-
try {
|
|
28497
|
-
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
28498
|
-
var page = _step4.value;
|
|
28499
|
-
_walkForLive(page === null || page === void 0 ? void 0 : page.layout);
|
|
28500
|
-
}
|
|
28501
|
-
} catch (err) {
|
|
28502
|
-
_iterator4.e(err);
|
|
28503
|
-
} finally {
|
|
28504
|
-
_iterator4.f();
|
|
28505
|
-
}
|
|
28506
|
-
}
|
|
28507
|
-
_walkForLive(workspace.sidebarLayout);
|
|
28508
|
-
var removed = 0;
|
|
28509
|
-
var _pruneListeners = function pruneListeners(items) {
|
|
28807
|
+
var _walk = function walk(items) {
|
|
28510
28808
|
if (!Array.isArray(items)) return;
|
|
28511
|
-
var
|
|
28512
|
-
|
|
28809
|
+
var _iterator = _createForOfIteratorHelper$i(items),
|
|
28810
|
+
_step;
|
|
28513
28811
|
try {
|
|
28514
|
-
for (
|
|
28515
|
-
var item =
|
|
28812
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
28813
|
+
var item = _step.value;
|
|
28516
28814
|
if (!item || _typeof(item) !== "object") continue;
|
|
28517
|
-
|
|
28518
|
-
|
|
28519
|
-
|
|
28520
|
-
|
|
28521
|
-
|
|
28522
|
-
|
|
28523
|
-
|
|
28524
|
-
_step6;
|
|
28525
|
-
try {
|
|
28526
|
-
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
28527
|
-
var raw = _step6.value;
|
|
28528
|
-
var parsed = parseEventString(raw);
|
|
28529
|
-
if (parsed && liveKeys.has("".concat(parsed.component, "|").concat(parsed.itemId))) {
|
|
28530
|
-
kept.push(raw);
|
|
28531
|
-
} else {
|
|
28532
|
-
removed += 1;
|
|
28533
|
-
}
|
|
28534
|
-
}
|
|
28535
|
-
} catch (err) {
|
|
28536
|
-
_iterator6.e(err);
|
|
28537
|
-
} finally {
|
|
28538
|
-
_iterator6.f();
|
|
28539
|
-
}
|
|
28540
|
-
if (kept.length === 0) {
|
|
28541
|
-
delete item.listeners[handler];
|
|
28542
|
-
} else if (kept.length !== events.length) {
|
|
28543
|
-
item.listeners[handler] = kept;
|
|
28544
|
-
}
|
|
28545
|
-
}
|
|
28546
|
-
}
|
|
28547
|
-
if (Array.isArray(item.items)) _pruneListeners(item.items);
|
|
28548
|
-
if (Array.isArray(item.layout)) _pruneListeners(item.layout);
|
|
28815
|
+
// Migrate this item, then recurse — order matters so that
|
|
28816
|
+
// pre-existing listeners on this item see the registry as it
|
|
28817
|
+
// was, not the (possibly newly-renamed) component name.
|
|
28818
|
+
migrateComponent(item);
|
|
28819
|
+
migrateListenerStrings(item);
|
|
28820
|
+
if (Array.isArray(item.items)) _walk(item.items);
|
|
28821
|
+
if (Array.isArray(item.layout)) _walk(item.layout);
|
|
28549
28822
|
}
|
|
28550
28823
|
} catch (err) {
|
|
28551
|
-
|
|
28824
|
+
_iterator.e(err);
|
|
28552
28825
|
} finally {
|
|
28553
|
-
|
|
28826
|
+
_iterator.f();
|
|
28554
28827
|
}
|
|
28555
28828
|
};
|
|
28556
|
-
|
|
28829
|
+
_walk(workspace.layout);
|
|
28557
28830
|
if (Array.isArray(workspace.pages)) {
|
|
28558
|
-
var
|
|
28559
|
-
|
|
28831
|
+
var _iterator2 = _createForOfIteratorHelper$i(workspace.pages),
|
|
28832
|
+
_step2;
|
|
28560
28833
|
try {
|
|
28561
|
-
for (
|
|
28562
|
-
var
|
|
28563
|
-
|
|
28834
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
28835
|
+
var page = _step2.value;
|
|
28836
|
+
_walk(page === null || page === void 0 ? void 0 : page.layout);
|
|
28564
28837
|
}
|
|
28565
28838
|
} catch (err) {
|
|
28566
|
-
|
|
28839
|
+
_iterator2.e(err);
|
|
28567
28840
|
} finally {
|
|
28568
|
-
|
|
28569
|
-
}
|
|
28570
|
-
}
|
|
28571
|
-
_pruneListeners(workspace.sidebarLayout);
|
|
28572
|
-
return removed;
|
|
28573
|
-
}
|
|
28574
|
-
|
|
28575
|
-
/**
|
|
28576
|
-
* Apply a staged delta to a workspace's listener bindings and return a
|
|
28577
|
-
* NEW workspace object (deep-cloned along the modified path).
|
|
28578
|
-
*
|
|
28579
|
-
* `adds` / `removes` are arrays of
|
|
28580
|
-
* { receiverItemId, handlerName, sourceComponent, sourceItemId, eventName }
|
|
28581
|
-
*
|
|
28582
|
-
* Removes may also pass `raw` (the exact pre-existing event string) for
|
|
28583
|
-
* a precise match; otherwise we match on the canonical formatted form.
|
|
28584
|
-
*/
|
|
28585
|
-
function applyWiringChanges(workspace, _ref) {
|
|
28586
|
-
var _ref$adds = _ref.adds,
|
|
28587
|
-
adds = _ref$adds === void 0 ? [] : _ref$adds,
|
|
28588
|
-
_ref$removes = _ref.removes,
|
|
28589
|
-
removes = _ref$removes === void 0 ? [] : _ref$removes;
|
|
28590
|
-
if (!workspace) return workspace;
|
|
28591
|
-
if (adds.length === 0 && removes.length === 0) return workspace;
|
|
28592
|
-
|
|
28593
|
-
// Group changes by receiver for cheap per-item updates.
|
|
28594
|
-
var byReceiver = new Map();
|
|
28595
|
-
var ensure = function ensure(id) {
|
|
28596
|
-
if (!byReceiver.has(id)) byReceiver.set(id, {
|
|
28597
|
-
adds: [],
|
|
28598
|
-
removes: []
|
|
28599
|
-
});
|
|
28600
|
-
return byReceiver.get(id);
|
|
28601
|
-
};
|
|
28602
|
-
var _iterator8 = _createForOfIteratorHelper$i(adds),
|
|
28603
|
-
_step8;
|
|
28604
|
-
try {
|
|
28605
|
-
for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
|
28606
|
-
var a = _step8.value;
|
|
28607
|
-
if (!a.receiverItemId) continue;
|
|
28608
|
-
ensure(String(a.receiverItemId)).adds.push(a);
|
|
28609
|
-
}
|
|
28610
|
-
} catch (err) {
|
|
28611
|
-
_iterator8.e(err);
|
|
28612
|
-
} finally {
|
|
28613
|
-
_iterator8.f();
|
|
28614
|
-
}
|
|
28615
|
-
var _iterator9 = _createForOfIteratorHelper$i(removes),
|
|
28616
|
-
_step9;
|
|
28617
|
-
try {
|
|
28618
|
-
for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
|
|
28619
|
-
var r = _step9.value;
|
|
28620
|
-
if (!r.receiverItemId) continue;
|
|
28621
|
-
ensure(String(r.receiverItemId)).removes.push(r);
|
|
28622
|
-
}
|
|
28623
|
-
|
|
28624
|
-
// Walk the tree and rebuild listeners on every touched item. We do
|
|
28625
|
-
// shallow clones along the path so React change detection is
|
|
28626
|
-
// reliable — but the tree shape is preserved.
|
|
28627
|
-
} catch (err) {
|
|
28628
|
-
_iterator9.e(err);
|
|
28629
|
-
} finally {
|
|
28630
|
-
_iterator9.f();
|
|
28631
|
-
}
|
|
28632
|
-
var cloneList = function cloneList(items) {
|
|
28633
|
-
return Array.isArray(items) ? items.map(function (item) {
|
|
28634
|
-
return transform(item);
|
|
28635
|
-
}) : items;
|
|
28636
|
-
};
|
|
28637
|
-
var transform = function transform(item) {
|
|
28638
|
-
if (!item || _typeof(item) !== "object") return item;
|
|
28639
|
-
var next = item;
|
|
28640
|
-
var id = itemIdOf(item);
|
|
28641
|
-
var change = id != null ? byReceiver.get(String(id)) : null;
|
|
28642
|
-
if (change) {
|
|
28643
|
-
var newListeners = applyToItem(item.listeners || {}, change);
|
|
28644
|
-
next = _objectSpread$B(_objectSpread$B({}, next), {}, {
|
|
28645
|
-
listeners: newListeners
|
|
28646
|
-
});
|
|
28647
|
-
}
|
|
28648
|
-
if (Array.isArray(next.items)) {
|
|
28649
|
-
next = _objectSpread$B(_objectSpread$B({}, next), {}, {
|
|
28650
|
-
items: cloneList(next.items)
|
|
28651
|
-
});
|
|
28652
|
-
}
|
|
28653
|
-
if (Array.isArray(next.layout)) {
|
|
28654
|
-
next = _objectSpread$B(_objectSpread$B({}, next), {}, {
|
|
28655
|
-
layout: cloneList(next.layout)
|
|
28656
|
-
});
|
|
28657
|
-
}
|
|
28658
|
-
return next;
|
|
28659
|
-
};
|
|
28660
|
-
var updatedWs = _objectSpread$B({}, workspace);
|
|
28661
|
-
if (Array.isArray(workspace.layout)) {
|
|
28662
|
-
updatedWs.layout = cloneList(workspace.layout);
|
|
28663
|
-
}
|
|
28664
|
-
if (Array.isArray(workspace.pages)) {
|
|
28665
|
-
updatedWs.pages = workspace.pages.map(function (page) {
|
|
28666
|
-
return _objectSpread$B(_objectSpread$B({}, page), {}, {
|
|
28667
|
-
layout: cloneList(page.layout)
|
|
28668
|
-
});
|
|
28669
|
-
});
|
|
28670
|
-
}
|
|
28671
|
-
if (Array.isArray(workspace.sidebarLayout)) {
|
|
28672
|
-
updatedWs.sidebarLayout = cloneList(workspace.sidebarLayout);
|
|
28673
|
-
}
|
|
28674
|
-
return updatedWs;
|
|
28675
|
-
}
|
|
28676
|
-
function applyToItem(listeners, _ref2) {
|
|
28677
|
-
var adds = _ref2.adds,
|
|
28678
|
-
removes = _ref2.removes;
|
|
28679
|
-
// Deep enough clone for handler arrays.
|
|
28680
|
-
var next = {};
|
|
28681
|
-
for (var _i3 = 0, _Object$entries2 = Object.entries(listeners); _i3 < _Object$entries2.length; _i3++) {
|
|
28682
|
-
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i3], 2),
|
|
28683
|
-
k = _Object$entries2$_i[0],
|
|
28684
|
-
v = _Object$entries2$_i[1];
|
|
28685
|
-
next[k] = Array.isArray(v) ? _toConsumableArray(v) : v;
|
|
28686
|
-
}
|
|
28687
|
-
|
|
28688
|
-
// Removes first so a re-add (rare) lands.
|
|
28689
|
-
var _iterator0 = _createForOfIteratorHelper$i(removes),
|
|
28690
|
-
_step0;
|
|
28691
|
-
try {
|
|
28692
|
-
var _loop = function _loop() {
|
|
28693
|
-
var r = _step0.value;
|
|
28694
|
-
var target = r.handlerName;
|
|
28695
|
-
if (!target) return 0; // continue
|
|
28696
|
-
var events = next[target];
|
|
28697
|
-
if (!Array.isArray(events)) return 0; // continue
|
|
28698
|
-
var eventStr = r.raw || formatEventString(r.sourceComponent, r.sourceItemId, r.eventName);
|
|
28699
|
-
var filtered = events.filter(function (e) {
|
|
28700
|
-
return e !== eventStr;
|
|
28701
|
-
});
|
|
28702
|
-
if (filtered.length === 0) {
|
|
28703
|
-
delete next[target];
|
|
28704
|
-
} else {
|
|
28705
|
-
next[target] = filtered;
|
|
28706
|
-
}
|
|
28707
|
-
},
|
|
28708
|
-
_ret;
|
|
28709
|
-
for (_iterator0.s(); !(_step0 = _iterator0.n()).done;) {
|
|
28710
|
-
_ret = _loop();
|
|
28711
|
-
if (_ret === 0) continue;
|
|
28712
|
-
}
|
|
28713
|
-
} catch (err) {
|
|
28714
|
-
_iterator0.e(err);
|
|
28715
|
-
} finally {
|
|
28716
|
-
_iterator0.f();
|
|
28717
|
-
}
|
|
28718
|
-
var _iterator1 = _createForOfIteratorHelper$i(adds),
|
|
28719
|
-
_step1;
|
|
28720
|
-
try {
|
|
28721
|
-
for (_iterator1.s(); !(_step1 = _iterator1.n()).done;) {
|
|
28722
|
-
var a = _step1.value;
|
|
28723
|
-
var target = a.handlerName;
|
|
28724
|
-
if (!target) continue;
|
|
28725
|
-
var eventStr = formatEventString(a.sourceComponent, a.sourceItemId, a.eventName);
|
|
28726
|
-
var existing = Array.isArray(next[target]) ? next[target] : [];
|
|
28727
|
-
if (existing.includes(eventStr)) continue;
|
|
28728
|
-
next[target] = [].concat(_toConsumableArray(existing), [eventStr]);
|
|
28841
|
+
_iterator2.f();
|
|
28729
28842
|
}
|
|
28730
|
-
} catch (err) {
|
|
28731
|
-
_iterator1.e(err);
|
|
28732
|
-
} finally {
|
|
28733
|
-
_iterator1.f();
|
|
28734
28843
|
}
|
|
28735
|
-
|
|
28844
|
+
_walk(workspace.sidebarLayout);
|
|
28845
|
+
return counts;
|
|
28736
28846
|
}
|
|
28737
28847
|
|
|
28738
28848
|
/**
|
|
@@ -28871,14 +28981,21 @@ var WorkspaceModel = function WorkspaceModel(workspaceItem) {
|
|
|
28871
28981
|
workspace.selectedProviders = "selectedProviders" in obj ? obj["selectedProviders"] : {};
|
|
28872
28982
|
workspace.themeKey = "themeKey" in obj ? obj["themeKey"] : null;
|
|
28873
28983
|
|
|
28984
|
+
// Migrate legacy bare component refs (`PipelineKanban`) and the
|
|
28985
|
+
// listener event strings that reference them (`PipelineKanban[5].evt`)
|
|
28986
|
+
// to the canonical scoped form (`trops.pipeline.PipelineKanban`).
|
|
28987
|
+
// Runs BEFORE pruneDeadListenerReferences — without this, prune
|
|
28988
|
+
// sees bare listener strings vs scoped layout items, treats every
|
|
28989
|
+
// legacy listener as an orphan, and silently deletes the user's
|
|
28990
|
+
// wiring on first load post-v0.1.435.
|
|
28991
|
+
migrateScopedIdsInWorkspace(workspace, ComponentManager.componentMap());
|
|
28992
|
+
|
|
28874
28993
|
// Strip any listener bindings whose source widget is no longer in
|
|
28875
28994
|
// the tree. These "orphan" bindings are dead — they don't match any
|
|
28876
28995
|
// live publisher and never fire — so they're safe to remove at load
|
|
28877
|
-
// time before the renderer wires up subscriptions.
|
|
28878
|
-
// workspaces self-consistent without the user having to do anything.
|
|
28996
|
+
// time before the renderer wires up subscriptions.
|
|
28879
28997
|
pruneDeadListenerReferences(workspace);
|
|
28880
28998
|
return sanitizeWorkspaceObject(workspace);
|
|
28881
|
-
// return workspace;
|
|
28882
28999
|
};
|
|
28883
29000
|
|
|
28884
29001
|
/**
|
|
@@ -55119,21 +55236,53 @@ function _arrayLikeToArray$5(r, a) { (null == a || a > r.length) && (a = r.lengt
|
|
|
55119
55236
|
var ALL_WIDGETS_ID = "__ALL__";
|
|
55120
55237
|
|
|
55121
55238
|
/**
|
|
55122
|
-
*
|
|
55123
|
-
*
|
|
55124
|
-
*
|
|
55125
|
-
*
|
|
55126
|
-
*
|
|
55127
|
-
*
|
|
55128
|
-
*
|
|
55239
|
+
* Pick the most user-friendly display name for a widget instance.
|
|
55240
|
+
* Priority: per-instance user title → widget's default title → widget
|
|
55241
|
+
* developer's friendly displayName → widget config name → the bare
|
|
55242
|
+
* component name (last segment of the scoped id) → the full scoped
|
|
55243
|
+
* id (last resort, never preferred — but always present).
|
|
55244
|
+
*
|
|
55245
|
+
* This is what shows on the primary line of the WidgetsTab list and
|
|
55246
|
+
* detail header. The full scoped registry id (`scope.package.X`) is
|
|
55247
|
+
* surfaced separately via `pickWidgetRef` below, so the user sees
|
|
55248
|
+
* BOTH a friendly name and an unambiguous reference.
|
|
55249
|
+
*/
|
|
55250
|
+
function pickDisplayName(item, cfg) {
|
|
55251
|
+
var _item$userPrefs, _item$userConfig;
|
|
55252
|
+
var prefsTitle = item === null || item === void 0 || (_item$userPrefs = item.userPrefs) === null || _item$userPrefs === void 0 ? void 0 : _item$userPrefs.title;
|
|
55253
|
+
if (typeof prefsTitle === "string" && prefsTitle.trim()) return prefsTitle;
|
|
55254
|
+
var configDefault = item === null || item === void 0 || (_item$userConfig = item.userConfig) === null || _item$userConfig === void 0 || (_item$userConfig = _item$userConfig.title) === null || _item$userConfig === void 0 ? void 0 : _item$userConfig.defaultValue;
|
|
55255
|
+
if (typeof configDefault === "string" && configDefault.trim()) {
|
|
55256
|
+
return configDefault;
|
|
55257
|
+
}
|
|
55258
|
+
if (cfg !== null && cfg !== void 0 && cfg.displayName) return cfg.displayName;
|
|
55259
|
+
if (cfg !== null && cfg !== void 0 && cfg.name) return cfg.name;
|
|
55260
|
+
var bare = bareComponentName(item === null || item === void 0 ? void 0 : item.component);
|
|
55261
|
+
if (bare) return bare;
|
|
55262
|
+
return (item === null || item === void 0 ? void 0 : item.component) || "Widget";
|
|
55263
|
+
}
|
|
55264
|
+
|
|
55265
|
+
/**
|
|
55266
|
+
* Format the full scoped registry id (`scope.package.Component`) for
|
|
55267
|
+
* the subtitle. The friendly display name on line 1 may be a custom
|
|
55268
|
+
* per-instance title that doesn't reveal which widget is actually
|
|
55269
|
+
* mounted — the subtitle pins down the underlying widget identity so
|
|
55270
|
+
* the user can always see "this 'Q4 Pipeline' is actually a
|
|
55271
|
+
* `trops.pipeline.SalesPipeline`".
|
|
55272
|
+
*
|
|
55273
|
+
* Falls back to the cfg fields when the layout item is non-canonical
|
|
55274
|
+
* (legacy bare names that LayoutModel couldn't migrate). Returns
|
|
55275
|
+
* null when even those are missing — caller hides the subtitle.
|
|
55129
55276
|
*/
|
|
55130
|
-
function
|
|
55131
|
-
if (
|
|
55132
|
-
var scope =
|
|
55133
|
-
var pkg =
|
|
55134
|
-
|
|
55135
|
-
if (pkg) return
|
|
55136
|
-
|
|
55277
|
+
function pickWidgetRef(item, cfg) {
|
|
55278
|
+
if (parseScopedComponentId(item === null || item === void 0 ? void 0 : item.component)) return item.component;
|
|
55279
|
+
var scope = (cfg === null || cfg === void 0 ? void 0 : cfg.scope) || (item === null || item === void 0 ? void 0 : item.scope);
|
|
55280
|
+
var pkg = (cfg === null || cfg === void 0 ? void 0 : cfg.packageName) || (item === null || item === void 0 ? void 0 : item.packageName);
|
|
55281
|
+
var comp = bareComponentName(item === null || item === void 0 ? void 0 : item.component) || (cfg === null || cfg === void 0 ? void 0 : cfg.name);
|
|
55282
|
+
if (!scope || !pkg || !comp) return (item === null || item === void 0 ? void 0 : item.component) || null;
|
|
55283
|
+
var bareScope = String(scope).replace(/^@/, "");
|
|
55284
|
+
var barePkg = String(pkg).replace(new RegExp("^@?".concat(bareScope, "/")), "");
|
|
55285
|
+
return "".concat(bareScope, ".").concat(barePkg, ".").concat(comp);
|
|
55137
55286
|
}
|
|
55138
55287
|
|
|
55139
55288
|
/**
|
|
@@ -55180,13 +55329,11 @@ var WidgetsTab = function WidgetsTab(_ref) {
|
|
|
55180
55329
|
result.push({
|
|
55181
55330
|
id: id,
|
|
55182
55331
|
component: item.component,
|
|
55183
|
-
displayName: item
|
|
55332
|
+
displayName: pickDisplayName(item, cfg),
|
|
55333
|
+
widgetRef: pickWidgetRef(item, cfg),
|
|
55184
55334
|
section: section,
|
|
55185
55335
|
userConfig: cfg.userConfig || {},
|
|
55186
55336
|
userPrefs: item.userPrefs || {},
|
|
55187
|
-
// Identity fields for the registry-identifier label. Prefer
|
|
55188
|
-
// values from the widget's component manager entry since the
|
|
55189
|
-
// layout item itself often doesn't carry scope/packageName.
|
|
55190
55337
|
scope: cfg.scope || item.scope || null,
|
|
55191
55338
|
packageName: cfg.packageName || cfg.name || item.packageName || null
|
|
55192
55339
|
});
|
|
@@ -55324,6 +55471,10 @@ var WidgetsTab = function WidgetsTab(_ref) {
|
|
|
55324
55471
|
className: "text-[10px] bg-amber-500/20 text-amber-300 px-1.5 rounded",
|
|
55325
55472
|
children: stagedForWidget
|
|
55326
55473
|
})]
|
|
55474
|
+
}), w.widgetRef && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
55475
|
+
className: "text-[10px] text-gray-500 font-mono truncate mt-0.5",
|
|
55476
|
+
title: w.widgetRef,
|
|
55477
|
+
children: w.widgetRef
|
|
55327
55478
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
55328
55479
|
className: "text-[10px] text-gray-600 mt-0.5",
|
|
55329
55480
|
children: fieldCount === 0 ? "No configurable fields" : "".concat(fieldCount, " field").concat(fieldCount === 1 ? "" : "s")
|
|
@@ -55356,20 +55507,19 @@ function SingleWidgetPane(_ref4) {
|
|
|
55356
55507
|
effectivePrefs = _ref4.effectivePrefs,
|
|
55357
55508
|
onFieldChange = _ref4.onFieldChange;
|
|
55358
55509
|
var hasFields = Object.keys(widget.userConfig).length > 0;
|
|
55359
|
-
var scopedId = buildScopedId(widget);
|
|
55360
55510
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
55361
55511
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
55362
55512
|
className: "mb-3",
|
|
55363
55513
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
55364
55514
|
className: "text-gray-200 font-semibold",
|
|
55365
55515
|
children: widget.displayName
|
|
55366
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
55367
|
-
className: "text-xs text-gray-500",
|
|
55368
|
-
|
|
55369
|
-
|
|
55370
|
-
|
|
55371
|
-
|
|
55372
|
-
children:
|
|
55516
|
+
}), widget.widgetRef && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
55517
|
+
className: "text-xs text-gray-500 font-mono truncate mt-0.5",
|
|
55518
|
+
title: widget.widgetRef,
|
|
55519
|
+
children: widget.widgetRef
|
|
55520
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
55521
|
+
className: "text-xs text-gray-600 mt-0.5",
|
|
55522
|
+
children: widget.section
|
|
55373
55523
|
})]
|
|
55374
55524
|
}), hasFields ? /*#__PURE__*/jsxRuntime.jsx(PanelEditForm, {
|
|
55375
55525
|
userConfig: widget.userConfig,
|
|
@@ -55615,11 +55765,11 @@ var DashboardConfigModal = function DashboardConfigModal(_ref) {
|
|
|
55615
55765
|
var derivePackage = function derivePackage(item) {
|
|
55616
55766
|
var scopedId = typeof (item === null || item === void 0 ? void 0 : item.component) === "string" ? item.component : "";
|
|
55617
55767
|
var parts = scopedId.split(".");
|
|
55618
|
-
if (parts.length === 3) {
|
|
55619
|
-
|
|
55620
|
-
|
|
55621
|
-
|
|
55622
|
-
|
|
55768
|
+
if (parts.length === 3 && parts[0] && parts[1]) {
|
|
55769
|
+
// Group rows by `@scope/package` so two widgets from the same
|
|
55770
|
+
// package show up under one heading. The full scoped id is
|
|
55771
|
+
// surfaced per-row in the table (column-level identity).
|
|
55772
|
+
return "@".concat(parts[0], "/").concat(parts[1]);
|
|
55623
55773
|
}
|
|
55624
55774
|
// Defensive: an explicit packageId on the item still wins for
|
|
55625
55775
|
// legacy items the migration couldn't auto-resolve.
|