@trops/dash-core 0.1.436 → 0.1.438
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 +176 -120
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +176 -120
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14040,22 +14040,74 @@ var PanelCode = function PanelCode(_ref) {
|
|
|
14040
14040
|
});
|
|
14041
14041
|
};
|
|
14042
14042
|
|
|
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
14043
|
/**
|
|
14047
|
-
*
|
|
14044
|
+
* widgetIdentity.js
|
|
14045
|
+
*
|
|
14046
|
+
* Single source of truth for the widget-name + scoped-id-subtitle
|
|
14047
|
+
* pattern used across the renderer:
|
|
14048
14048
|
*
|
|
14049
|
-
*
|
|
14050
|
-
*
|
|
14051
|
-
*
|
|
14049
|
+
* PRIMARY Sales Pipeline
|
|
14050
|
+
* SUBTITLE trops.pipeline.SalesPipeline
|
|
14051
|
+
*
|
|
14052
|
+
* Surfaces that previously rolled their own derivation (WidgetsTab,
|
|
14053
|
+
* listenerResolution, providerResolution, WidgetCardHeader,
|
|
14054
|
+
* LayoutBuilderConfigModal) all route through these two helpers so a
|
|
14055
|
+
* given widget instance shows the same name in every panel.
|
|
14056
|
+
*/
|
|
14057
|
+
|
|
14058
|
+
/**
|
|
14059
|
+
* Pick the most user-friendly display name for a layout item.
|
|
14052
14060
|
*
|
|
14053
|
-
*
|
|
14054
|
-
* -
|
|
14061
|
+
* Priority:
|
|
14062
|
+
* 1. per-instance user title (`item.userPrefs.title`)
|
|
14063
|
+
* 2. widget's default per-instance title
|
|
14064
|
+
* (`item.userConfig.title.defaultValue`, or string-form
|
|
14065
|
+
* `item.userConfig.title`)
|
|
14066
|
+
* 3. developer-set friendly `cfg.displayName`
|
|
14067
|
+
* 4. widget config `cfg.name`
|
|
14068
|
+
* 5. bare component name (last segment of the scoped id)
|
|
14069
|
+
* 6. full component string (last resort, never preferred)
|
|
14070
|
+
*
|
|
14071
|
+
* @param {Object} item - layout item (must carry `component` to be useful)
|
|
14072
|
+
* @param {Object} [cfg] - the live registry config returned by ComponentManager
|
|
14073
|
+
* @returns {string} a non-empty display string
|
|
14074
|
+
*/
|
|
14075
|
+
function pickWidgetDisplayName(item, cfg) {
|
|
14076
|
+
var _item$userPrefs, _item$userConfig, _item$userConfig2;
|
|
14077
|
+
var prefsTitle = item === null || item === void 0 || (_item$userPrefs = item.userPrefs) === null || _item$userPrefs === void 0 ? void 0 : _item$userPrefs.title;
|
|
14078
|
+
if (typeof prefsTitle === "string" && prefsTitle.trim()) return prefsTitle;
|
|
14079
|
+
var userConfigTitle = (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) || (typeof (item === null || item === void 0 || (_item$userConfig2 = item.userConfig) === null || _item$userConfig2 === void 0 ? void 0 : _item$userConfig2.title) === "string" ? item.userConfig.title : null);
|
|
14080
|
+
if (typeof userConfigTitle === "string" && userConfigTitle.trim()) {
|
|
14081
|
+
return userConfigTitle;
|
|
14082
|
+
}
|
|
14083
|
+
if (cfg !== null && cfg !== void 0 && cfg.displayName) return cfg.displayName;
|
|
14084
|
+
if (cfg !== null && cfg !== void 0 && cfg.name) return cfg.name;
|
|
14085
|
+
if (typeof (item === null || item === void 0 ? void 0 : item.component) === "string") {
|
|
14086
|
+
var parts = item.component.split(".");
|
|
14087
|
+
if (parts.length === 3) return parts[2];
|
|
14088
|
+
return item.component;
|
|
14089
|
+
}
|
|
14090
|
+
return "Widget";
|
|
14091
|
+
}
|
|
14092
|
+
|
|
14093
|
+
/**
|
|
14094
|
+
* Build the full scoped registry id (`scope.package.Component`) for
|
|
14095
|
+
* use as a subtitle. Returns the layout item's canonical id when
|
|
14096
|
+
* present; otherwise null so callers can hide the subtitle.
|
|
14055
14097
|
*
|
|
14056
|
-
*
|
|
14057
|
-
*
|
|
14098
|
+
* @param {Object} item
|
|
14099
|
+
* @returns {string|null}
|
|
14058
14100
|
*/
|
|
14101
|
+
function pickWidgetRef(item) {
|
|
14102
|
+
var c = item === null || item === void 0 ? void 0 : item.component;
|
|
14103
|
+
if (typeof c !== "string") return null;
|
|
14104
|
+
var parts = c.split(".");
|
|
14105
|
+
return parts.length === 3 ? c : null;
|
|
14106
|
+
}
|
|
14107
|
+
|
|
14108
|
+
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; } } }; }
|
|
14109
|
+
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; } }
|
|
14110
|
+
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; }
|
|
14059
14111
|
|
|
14060
14112
|
/**
|
|
14061
14113
|
* Resolve which provider name a given widget instance would bind to for
|
|
@@ -14310,6 +14362,12 @@ function getAllProviderBindings(_ref3) {
|
|
|
14310
14362
|
bindings.push({
|
|
14311
14363
|
widgetId: widgetId,
|
|
14312
14364
|
component: item.component,
|
|
14365
|
+
// Friendly display name + canonical scoped id, derived once
|
|
14366
|
+
// here so every provider-tab consumer (Bulk pane, Per-widget
|
|
14367
|
+
// rows, override badges) shows the same label/subtitle as
|
|
14368
|
+
// the Listeners tab and the Widgets tab.
|
|
14369
|
+
label: pickWidgetDisplayName(item, null),
|
|
14370
|
+
widgetRef: pickWidgetRef(item),
|
|
14313
14371
|
providerType: req.type,
|
|
14314
14372
|
providerClass: req.providerClass || null,
|
|
14315
14373
|
required: req.required !== false,
|
|
@@ -14388,18 +14446,12 @@ function canonicalItemKey(item) {
|
|
|
14388
14446
|
return null;
|
|
14389
14447
|
}
|
|
14390
14448
|
|
|
14391
|
-
|
|
14392
|
-
|
|
14393
|
-
|
|
14394
|
-
|
|
14449
|
+
// Label/widgetRef derivation lives in `widgetIdentity.js` so every
|
|
14450
|
+
// surface (Listeners tab, Providers tab, Widgets tab, widget card
|
|
14451
|
+
// header, layout footer) shows the same widget name + scope.package
|
|
14452
|
+
// .Component subtitle. Local thin wrapper just attaches the cfg.
|
|
14395
14453
|
function labelFor(item, getWidgetConfig) {
|
|
14396
|
-
|
|
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), "]") : "");
|
|
14454
|
+
return pickWidgetDisplayName(item, getWidgetConfig === null || getWidgetConfig === void 0 ? void 0 : getWidgetConfig(item.component));
|
|
14403
14455
|
}
|
|
14404
14456
|
|
|
14405
14457
|
/**
|
|
@@ -14443,6 +14495,7 @@ function getEmitters(workspace, getWidgetConfig) {
|
|
|
14443
14495
|
itemId: itemIdOf(item),
|
|
14444
14496
|
component: item.component,
|
|
14445
14497
|
label: labelFor(item, getWidgetConfig),
|
|
14498
|
+
widgetRef: pickWidgetRef(item),
|
|
14446
14499
|
events: events
|
|
14447
14500
|
});
|
|
14448
14501
|
});
|
|
@@ -14453,7 +14506,7 @@ function getEmitters(workspace, getWidgetConfig) {
|
|
|
14453
14506
|
* Every widget instance in the workspace that accepts at least one
|
|
14454
14507
|
* handler. Used to populate the receiver dropdown. Deduplicated by
|
|
14455
14508
|
* `${component}|${itemId}` (see getEmitters).
|
|
14456
|
-
* @returns {Array<{ itemId, component, label, eventHandlers: string[], listeners: object, key: string }>}
|
|
14509
|
+
* @returns {Array<{ itemId, component, label, widgetRef, eventHandlers: string[], listeners: object, key: string }>}
|
|
14457
14510
|
*/
|
|
14458
14511
|
function getReceivers(workspace, getWidgetConfig) {
|
|
14459
14512
|
var byKey = new Map();
|
|
@@ -14468,6 +14521,7 @@ function getReceivers(workspace, getWidgetConfig) {
|
|
|
14468
14521
|
itemId: itemIdOf(item),
|
|
14469
14522
|
component: item.component,
|
|
14470
14523
|
label: labelFor(item, getWidgetConfig),
|
|
14524
|
+
widgetRef: pickWidgetRef(item),
|
|
14471
14525
|
eventHandlers: handlers,
|
|
14472
14526
|
listeners: item.listeners || {}
|
|
14473
14527
|
});
|
|
@@ -15123,11 +15177,19 @@ var PanelEditItemHandlers = function PanelEditItemHandlers(_ref) {
|
|
|
15123
15177
|
children: [connectedCount, " event", connectedCount !== 1 ? "s" : "", " connected"]
|
|
15124
15178
|
})]
|
|
15125
15179
|
}), sourceWidgets.map(function (layout) {
|
|
15180
|
+
var label = pickWidgetDisplayName(layout, null);
|
|
15181
|
+
var ref = pickWidgetRef(layout) || layout.component;
|
|
15126
15182
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
15127
15183
|
className: "flex flex-col space-y-2",
|
|
15128
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("
|
|
15129
|
-
className: "
|
|
15130
|
-
children: [
|
|
15184
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
15185
|
+
className: "flex flex-col gap-0.5 mb-1",
|
|
15186
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
15187
|
+
className: "text-sm font-semibold opacity-90",
|
|
15188
|
+
children: label
|
|
15189
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
15190
|
+
className: "text-[10px] opacity-50 font-mono truncate",
|
|
15191
|
+
children: [ref, "[", layout["id"], "]"]
|
|
15192
|
+
})]
|
|
15131
15193
|
}), layout.events.filter(function (value, index, array) {
|
|
15132
15194
|
return array.indexOf(value) === index;
|
|
15133
15195
|
}).map(function (event) {
|
|
@@ -15413,29 +15475,29 @@ var LayoutBuilderConfigModal = function LayoutBuilderConfigModal(_ref) {
|
|
|
15413
15475
|
return s.key === activeSection;
|
|
15414
15476
|
}) || sections[0];
|
|
15415
15477
|
|
|
15416
|
-
// Footer label:
|
|
15417
|
-
//
|
|
15478
|
+
// Footer label: full scoped id (`scope.package.Component`) so the
|
|
15479
|
+
// user always sees the underlying widget identity, even when the
|
|
15480
|
+
// primary title is a custom per-instance label. No workspace fallback.
|
|
15418
15481
|
var footerPackageLabel = function () {
|
|
15419
15482
|
var scopedId = (itemSelected === null || itemSelected === void 0 ? void 0 : itemSelected.component) || "";
|
|
15420
15483
|
if (typeof scopedId !== "string") return "";
|
|
15421
15484
|
var parts = scopedId.split(".");
|
|
15422
|
-
|
|
15423
|
-
var _parts = _slicedToArray(parts, 2),
|
|
15424
|
-
scope = _parts[0],
|
|
15425
|
-
pkg = _parts[1];
|
|
15426
|
-
if (!scope || !pkg) return "";
|
|
15427
|
-
return "@".concat(scope, "/").concat(pkg);
|
|
15485
|
+
return parts.length === 3 ? scopedId : "";
|
|
15428
15486
|
}();
|
|
15429
|
-
|
|
15487
|
+
// Friendly name on the top line, full scoped id on the subtitle.
|
|
15488
|
+
// Same priority chain the Listeners/Widgets tabs and WidgetCardHeader
|
|
15489
|
+
// use, via the shared `pickWidgetDisplayName` helper.
|
|
15490
|
+
var widgetCfg = itemSelected ? ComponentManager.config(itemSelected.component, itemSelected) : null;
|
|
15491
|
+
var friendlyName = itemSelected ? pickWidgetDisplayName(itemSelected, widgetCfg) : "";
|
|
15430
15492
|
var footerLeftContent = footerPackageLabel ? /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
15431
15493
|
className: "flex flex-col leading-tight",
|
|
15432
15494
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
15433
|
-
children:
|
|
15495
|
+
children: friendlyName
|
|
15434
15496
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
15435
|
-
className: "text-[10px] opacity-50",
|
|
15497
|
+
className: "text-[10px] opacity-50 font-mono",
|
|
15436
15498
|
children: footerPackageLabel
|
|
15437
15499
|
})]
|
|
15438
|
-
}) :
|
|
15500
|
+
}) : friendlyName;
|
|
15439
15501
|
return itemSelected !== null && /*#__PURE__*/jsxRuntime.jsxs(DashReact.SettingsModal, {
|
|
15440
15502
|
isOpen: open,
|
|
15441
15503
|
setIsOpen: setIsOpen,
|
|
@@ -19727,24 +19789,22 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
|
|
|
19727
19789
|
// Detect missing widgets (component key exists but not in ComponentManager)
|
|
19728
19790
|
var isWidgetMissing = (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component) && !widgetConfig;
|
|
19729
19791
|
|
|
19730
|
-
//
|
|
19731
|
-
|
|
19732
|
-
|
|
19733
|
-
//
|
|
19734
|
-
|
|
19735
|
-
|
|
19736
|
-
//
|
|
19737
|
-
//
|
|
19792
|
+
// Display name + scope.package.Component subtitle. Single source of
|
|
19793
|
+
// truth: `pickWidgetDisplayName` so the same widget shows the same
|
|
19794
|
+
// name in WidgetsTab, Listeners tab, Providers tab, and the layout
|
|
19795
|
+
// footer.
|
|
19796
|
+
var widgetName = pickWidgetDisplayName(widgetItem, widgetConfig);
|
|
19797
|
+
|
|
19798
|
+
// Show the full scoped registry id (`scope.package.Component`) as
|
|
19799
|
+
// the subtitle. The friendly title on line 1 may be a custom user
|
|
19800
|
+
// title that doesn't reveal which widget is mounted; the subtitle
|
|
19801
|
+
// pins down the underlying identity. Strict — the layout item is
|
|
19802
|
+
// the source of truth.
|
|
19738
19803
|
var packageLabel = function () {
|
|
19739
19804
|
var scopedId = (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component) || (widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.id) || "";
|
|
19740
19805
|
if (typeof scopedId !== "string") return "";
|
|
19741
19806
|
var parts = scopedId.split(".");
|
|
19742
|
-
|
|
19743
|
-
var _parts = _slicedToArray(parts, 2),
|
|
19744
|
-
scope = _parts[0],
|
|
19745
|
-
pkg = _parts[1];
|
|
19746
|
-
if (!scope || !pkg) return "";
|
|
19747
|
-
return "@".concat(scope, "/").concat(pkg);
|
|
19807
|
+
return parts.length === 3 ? scopedId : "";
|
|
19748
19808
|
}();
|
|
19749
19809
|
|
|
19750
19810
|
// Get provider requirements from widget config (not from item directly)
|
|
@@ -53881,7 +53941,7 @@ var DraggableWidgetItem = function DraggableWidgetItem(_ref) {
|
|
|
53881
53941
|
className: "h-3 w-3 opacity-40 flex-shrink-0"
|
|
53882
53942
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
53883
53943
|
className: "truncate font-medium opacity-90",
|
|
53884
|
-
children: widget.name || widgetKey
|
|
53944
|
+
children: widget.displayName || widget.name || bareComponentName(widgetKey) || widgetKey
|
|
53885
53945
|
})]
|
|
53886
53946
|
}), (providerTypes.length > 0 || hasEventInfo) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
53887
53947
|
className: "flex flex-wrap items-center gap-1 pl-5",
|
|
@@ -53894,9 +53954,10 @@ var DraggableWidgetItem = function DraggableWidgetItem(_ref) {
|
|
|
53894
53954
|
className: "text-[10px] px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-300",
|
|
53895
53955
|
children: [eventCount > 0 && "".concat(eventCount, " event").concat(eventCount > 1 ? "s" : ""), eventCount > 0 && handlerCount > 0 && ", ", handlerCount > 0 && "".concat(handlerCount, " handler").concat(handlerCount > 1 ? "s" : "")]
|
|
53896
53956
|
})]
|
|
53897
|
-
}),
|
|
53898
|
-
className: "text-[10px] pl-5 opacity-40 truncate",
|
|
53899
|
-
|
|
53957
|
+
}), widgetKey && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
53958
|
+
className: "text-[10px] pl-5 opacity-40 font-mono truncate",
|
|
53959
|
+
title: widgetKey,
|
|
53960
|
+
children: widgetKey
|
|
53900
53961
|
})]
|
|
53901
53962
|
});
|
|
53902
53963
|
};
|
|
@@ -54234,39 +54295,37 @@ var SidebarDiscoverContent = function SidebarDiscoverContent(_ref2) {
|
|
|
54234
54295
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54235
54296
|
className: "flex flex-col gap-1 px-3 py-1",
|
|
54236
54297
|
children: registry.packages.map(function (pkg) {
|
|
54237
|
-
var _pkg$widgets4
|
|
54298
|
+
var _pkg$widgets4;
|
|
54238
54299
|
var isInstalled = isPackageInstalled(pkg);
|
|
54300
|
+
var packageRef = pkg.scope && pkg.name ? "@".concat(String(pkg.scope).replace(/^@/, ""), "/").concat(pkg.name) : pkg.name;
|
|
54301
|
+
var widgetCount = ((_pkg$widgets4 = pkg.widgets) === null || _pkg$widgets4 === void 0 ? void 0 : _pkg$widgets4.length) || 0;
|
|
54239
54302
|
return /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
54240
54303
|
type: "button",
|
|
54241
54304
|
onClick: function onClick() {
|
|
54242
54305
|
return setSelectedPackageName(pkg.name);
|
|
54243
54306
|
},
|
|
54244
|
-
className: "flex items-
|
|
54307
|
+
className: "flex items-start gap-2 px-3 py-2 rounded-md text-left\n bg-white/5 hover:bg-white/10 transition-colors w-full".concat(isInstalled ? " opacity-60" : ""),
|
|
54245
54308
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
54246
54309
|
icon: "cube",
|
|
54247
|
-
className: "h-3 w-3 opacity-40 flex-shrink-0"
|
|
54310
|
+
className: "h-3 w-3 opacity-40 flex-shrink-0 mt-0.5"
|
|
54248
54311
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
54249
54312
|
className: "min-w-0 flex-1",
|
|
54250
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
54251
|
-
className: "
|
|
54252
|
-
children:
|
|
54253
|
-
|
|
54254
|
-
|
|
54255
|
-
|
|
54256
|
-
className: "
|
|
54257
|
-
children:
|
|
54258
|
-
}), pkg.author && ((_pkg$widgets4 = pkg.widgets) === null || _pkg$widgets4 === void 0 ? void 0 : _pkg$widgets4.length) > 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
54259
|
-
children: "\xB7"
|
|
54260
|
-
}), ((_pkg$widgets5 = pkg.widgets) === null || _pkg$widgets5 === void 0 ? void 0 : _pkg$widgets5.length) > 0 && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
54261
|
-
children: [pkg.widgets.length, " widget", pkg.widgets.length !== 1 ? "s" : ""]
|
|
54262
|
-
}), isInstalled && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
54263
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
54264
|
-
children: "\xB7"
|
|
54265
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
54266
|
-
className: "text-emerald-400",
|
|
54267
|
-
children: "Installed"
|
|
54268
|
-
})]
|
|
54313
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
54314
|
+
className: "flex items-center gap-2",
|
|
54315
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
54316
|
+
className: "text-sm font-medium opacity-90 truncate flex-1 min-w-0",
|
|
54317
|
+
children: pkg.displayName || pkg.name
|
|
54318
|
+
}), isInstalled && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
54319
|
+
className: "text-[10px] text-emerald-400 flex-shrink-0",
|
|
54320
|
+
children: "Installed"
|
|
54269
54321
|
})]
|
|
54322
|
+
}), packageRef && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54323
|
+
className: "text-[10px] opacity-50 font-mono truncate mt-0.5",
|
|
54324
|
+
title: packageRef,
|
|
54325
|
+
children: packageRef
|
|
54326
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
54327
|
+
className: "text-[10px] opacity-40 truncate mt-0.5",
|
|
54328
|
+
children: [pkg.author ? "".concat(pkg.author, " \xB7 ") : "", widgetCount, " widget", widgetCount !== 1 ? "s" : ""]
|
|
54270
54329
|
})]
|
|
54271
54330
|
})]
|
|
54272
54331
|
}, pkg.name);
|
|
@@ -55223,24 +55282,6 @@ function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r
|
|
|
55223
55282
|
function _arrayLikeToArray$5(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; }
|
|
55224
55283
|
var ALL_WIDGETS_ID = "__ALL__";
|
|
55225
55284
|
|
|
55226
|
-
/**
|
|
55227
|
-
* Build the scoped registry identifier for a widget. Surfaces the
|
|
55228
|
-
* `scope.packageName.component` triple in the settings UI so users
|
|
55229
|
-
* can verify what a widget's registry identity is — useful when
|
|
55230
|
-
* diagnosing dashboard-install warnings ("why didn't this widget
|
|
55231
|
-
* install?" → scoped id in the warning vs scoped id shown here).
|
|
55232
|
-
* Returns just the component name when scope/package metadata is
|
|
55233
|
-
* unavailable (e.g. bare built-ins).
|
|
55234
|
-
*/
|
|
55235
|
-
function buildScopedId(widget) {
|
|
55236
|
-
if (!(widget !== null && widget !== void 0 && widget.component)) return null;
|
|
55237
|
-
var scope = widget.scope ? String(widget.scope).replace(/^@/, "") : null;
|
|
55238
|
-
var pkg = widget.packageName ? scope ? String(widget.packageName).replace(new RegExp("^@?".concat(scope, "/")), "") : String(widget.packageName).replace(/^@/, "") : null;
|
|
55239
|
-
if (scope && pkg) return "".concat(scope, ".").concat(pkg, ".").concat(widget.component);
|
|
55240
|
-
if (pkg) return "".concat(pkg, ".").concat(widget.component);
|
|
55241
|
-
return widget.component;
|
|
55242
|
-
}
|
|
55243
|
-
|
|
55244
55285
|
/**
|
|
55245
55286
|
* WidgetsTab
|
|
55246
55287
|
*
|
|
@@ -55285,13 +55326,11 @@ var WidgetsTab = function WidgetsTab(_ref) {
|
|
|
55285
55326
|
result.push({
|
|
55286
55327
|
id: id,
|
|
55287
55328
|
component: item.component,
|
|
55288
|
-
displayName: item
|
|
55329
|
+
displayName: pickWidgetDisplayName(item, cfg),
|
|
55330
|
+
widgetRef: pickWidgetRef(item),
|
|
55289
55331
|
section: section,
|
|
55290
55332
|
userConfig: cfg.userConfig || {},
|
|
55291
55333
|
userPrefs: item.userPrefs || {},
|
|
55292
|
-
// Identity fields for the registry-identifier label. Prefer
|
|
55293
|
-
// values from the widget's component manager entry since the
|
|
55294
|
-
// layout item itself often doesn't carry scope/packageName.
|
|
55295
55334
|
scope: cfg.scope || item.scope || null,
|
|
55296
55335
|
packageName: cfg.packageName || cfg.name || item.packageName || null
|
|
55297
55336
|
});
|
|
@@ -55429,6 +55468,10 @@ var WidgetsTab = function WidgetsTab(_ref) {
|
|
|
55429
55468
|
className: "text-[10px] bg-amber-500/20 text-amber-300 px-1.5 rounded",
|
|
55430
55469
|
children: stagedForWidget
|
|
55431
55470
|
})]
|
|
55471
|
+
}), w.widgetRef && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
55472
|
+
className: "text-[10px] text-gray-500 font-mono truncate mt-0.5",
|
|
55473
|
+
title: w.widgetRef,
|
|
55474
|
+
children: w.widgetRef
|
|
55432
55475
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
55433
55476
|
className: "text-[10px] text-gray-600 mt-0.5",
|
|
55434
55477
|
children: fieldCount === 0 ? "No configurable fields" : "".concat(fieldCount, " field").concat(fieldCount === 1 ? "" : "s")
|
|
@@ -55461,20 +55504,19 @@ function SingleWidgetPane(_ref4) {
|
|
|
55461
55504
|
effectivePrefs = _ref4.effectivePrefs,
|
|
55462
55505
|
onFieldChange = _ref4.onFieldChange;
|
|
55463
55506
|
var hasFields = Object.keys(widget.userConfig).length > 0;
|
|
55464
|
-
var scopedId = buildScopedId(widget);
|
|
55465
55507
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
55466
55508
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
55467
55509
|
className: "mb-3",
|
|
55468
55510
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
55469
55511
|
className: "text-gray-200 font-semibold",
|
|
55470
55512
|
children: widget.displayName
|
|
55471
|
-
}), /*#__PURE__*/jsxRuntime.
|
|
55472
|
-
className: "text-xs text-gray-500",
|
|
55473
|
-
|
|
55474
|
-
|
|
55475
|
-
|
|
55476
|
-
|
|
55477
|
-
children:
|
|
55513
|
+
}), widget.widgetRef && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
55514
|
+
className: "text-xs text-gray-500 font-mono truncate mt-0.5",
|
|
55515
|
+
title: widget.widgetRef,
|
|
55516
|
+
children: widget.widgetRef
|
|
55517
|
+
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
55518
|
+
className: "text-xs text-gray-600 mt-0.5",
|
|
55519
|
+
children: widget.section
|
|
55478
55520
|
})]
|
|
55479
55521
|
}), hasFields ? /*#__PURE__*/jsxRuntime.jsx(PanelEditForm, {
|
|
55480
55522
|
userConfig: widget.userConfig,
|
|
@@ -55720,11 +55762,11 @@ var DashboardConfigModal = function DashboardConfigModal(_ref) {
|
|
|
55720
55762
|
var derivePackage = function derivePackage(item) {
|
|
55721
55763
|
var scopedId = typeof (item === null || item === void 0 ? void 0 : item.component) === "string" ? item.component : "";
|
|
55722
55764
|
var parts = scopedId.split(".");
|
|
55723
|
-
if (parts.length === 3) {
|
|
55724
|
-
|
|
55725
|
-
|
|
55726
|
-
|
|
55727
|
-
|
|
55765
|
+
if (parts.length === 3 && parts[0] && parts[1]) {
|
|
55766
|
+
// Group rows by `@scope/package` so two widgets from the same
|
|
55767
|
+
// package show up under one heading. The full scoped id is
|
|
55768
|
+
// surfaced per-row in the table (column-level identity).
|
|
55769
|
+
return "@".concat(parts[0], "/").concat(parts[1]);
|
|
55728
55770
|
}
|
|
55729
55771
|
// Defensive: an explicit packageId on the item still wins for
|
|
55730
55772
|
// legacy items the migration couldn't auto-resolve.
|
|
@@ -56343,13 +56385,17 @@ function ProvidersTab(_ref4) {
|
|
|
56343
56385
|
className: "text-sm truncate flex items-center gap-1.5 ".concat(needsAttention ? "font-semibold text-red-100" : "font-medium"),
|
|
56344
56386
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
56345
56387
|
className: "truncate",
|
|
56346
|
-
children: row.component || "widget"
|
|
56388
|
+
children: row.label || row.component || "widget"
|
|
56347
56389
|
}), isRequired && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
56348
56390
|
className: needsAttention ? "text-red-300" : "text-indigo-300",
|
|
56349
56391
|
title: "Required provider",
|
|
56350
56392
|
"aria-label": "required",
|
|
56351
56393
|
children: "*"
|
|
56352
56394
|
})]
|
|
56395
|
+
}), (row.widgetRef || row.component) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
56396
|
+
className: "text-[10px] opacity-50 font-mono truncate mt-0.5",
|
|
56397
|
+
title: row.widgetRef || row.component,
|
|
56398
|
+
children: row.widgetRef || row.component
|
|
56353
56399
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
56354
56400
|
className: "flex items-center gap-1.5 mt-1 text-[10px]",
|
|
56355
56401
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -56549,16 +56595,20 @@ function ListenersTab(_ref9) {
|
|
|
56549
56595
|
className: "overflow-y-auto flex-1",
|
|
56550
56596
|
children: receivers.map(function (r) {
|
|
56551
56597
|
var isActive = r.key === selectedReceiverKey;
|
|
56552
|
-
return /*#__PURE__*/jsxRuntime.
|
|
56598
|
+
return /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
56553
56599
|
type: "button",
|
|
56554
56600
|
onClick: function onClick() {
|
|
56555
56601
|
return setSelectedReceiverKey(r.key);
|
|
56556
56602
|
},
|
|
56557
56603
|
className: "w-full text-left px-3 py-2 border-l-2 ".concat(isActive ? "bg-indigo-900/30 border-indigo-400" : "border-transparent hover:bg-white/5"),
|
|
56558
|
-
children: /*#__PURE__*/jsxRuntime.jsx("
|
|
56604
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
56559
56605
|
className: "text-sm font-medium truncate",
|
|
56560
56606
|
children: r.label
|
|
56561
|
-
})
|
|
56607
|
+
}), r.widgetRef && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
56608
|
+
className: "text-[10px] opacity-50 font-mono truncate mt-0.5",
|
|
56609
|
+
title: r.widgetRef,
|
|
56610
|
+
children: r.widgetRef
|
|
56611
|
+
})]
|
|
56562
56612
|
}, r.key);
|
|
56563
56613
|
})
|
|
56564
56614
|
})]
|
|
@@ -56749,9 +56799,15 @@ function EventsColumn(_ref10) {
|
|
|
56749
56799
|
}) : emittersForList.map(function (e) {
|
|
56750
56800
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
56751
56801
|
className: "space-y-1",
|
|
56752
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
56753
|
-
className: "
|
|
56754
|
-
children:
|
|
56802
|
+
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
56803
|
+
className: "flex flex-col gap-0.5 mb-1",
|
|
56804
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
56805
|
+
className: "text-sm font-semibold",
|
|
56806
|
+
children: e.label
|
|
56807
|
+
}), (e.widgetRef || e.component) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
56808
|
+
className: "text-[10px] opacity-50 font-mono truncate",
|
|
56809
|
+
children: (e.widgetRef || e.component) + (e.itemId != null ? "[".concat(e.itemId, "]") : "")
|
|
56810
|
+
})]
|
|
56755
56811
|
}), e.events.map(function (eventName) {
|
|
56756
56812
|
var key = "".concat(e.component, "|").concat(e.itemId, "|").concat(eventName);
|
|
56757
56813
|
var selected = wiredKeys.has(key);
|