@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.esm.js
CHANGED
|
@@ -14022,22 +14022,74 @@ var PanelCode = function PanelCode(_ref) {
|
|
|
14022
14022
|
});
|
|
14023
14023
|
};
|
|
14024
14024
|
|
|
14025
|
-
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; } } }; }
|
|
14026
|
-
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; } }
|
|
14027
|
-
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; }
|
|
14028
14025
|
/**
|
|
14029
|
-
*
|
|
14026
|
+
* widgetIdentity.js
|
|
14027
|
+
*
|
|
14028
|
+
* Single source of truth for the widget-name + scoped-id-subtitle
|
|
14029
|
+
* pattern used across the renderer:
|
|
14030
14030
|
*
|
|
14031
|
-
*
|
|
14032
|
-
*
|
|
14033
|
-
*
|
|
14031
|
+
* PRIMARY Sales Pipeline
|
|
14032
|
+
* SUBTITLE trops.pipeline.SalesPipeline
|
|
14033
|
+
*
|
|
14034
|
+
* Surfaces that previously rolled their own derivation (WidgetsTab,
|
|
14035
|
+
* listenerResolution, providerResolution, WidgetCardHeader,
|
|
14036
|
+
* LayoutBuilderConfigModal) all route through these two helpers so a
|
|
14037
|
+
* given widget instance shows the same name in every panel.
|
|
14038
|
+
*/
|
|
14039
|
+
|
|
14040
|
+
/**
|
|
14041
|
+
* Pick the most user-friendly display name for a layout item.
|
|
14034
14042
|
*
|
|
14035
|
-
*
|
|
14036
|
-
* -
|
|
14043
|
+
* Priority:
|
|
14044
|
+
* 1. per-instance user title (`item.userPrefs.title`)
|
|
14045
|
+
* 2. widget's default per-instance title
|
|
14046
|
+
* (`item.userConfig.title.defaultValue`, or string-form
|
|
14047
|
+
* `item.userConfig.title`)
|
|
14048
|
+
* 3. developer-set friendly `cfg.displayName`
|
|
14049
|
+
* 4. widget config `cfg.name`
|
|
14050
|
+
* 5. bare component name (last segment of the scoped id)
|
|
14051
|
+
* 6. full component string (last resort, never preferred)
|
|
14052
|
+
*
|
|
14053
|
+
* @param {Object} item - layout item (must carry `component` to be useful)
|
|
14054
|
+
* @param {Object} [cfg] - the live registry config returned by ComponentManager
|
|
14055
|
+
* @returns {string} a non-empty display string
|
|
14056
|
+
*/
|
|
14057
|
+
function pickWidgetDisplayName(item, cfg) {
|
|
14058
|
+
var _item$userPrefs, _item$userConfig, _item$userConfig2;
|
|
14059
|
+
var prefsTitle = item === null || item === void 0 || (_item$userPrefs = item.userPrefs) === null || _item$userPrefs === void 0 ? void 0 : _item$userPrefs.title;
|
|
14060
|
+
if (typeof prefsTitle === "string" && prefsTitle.trim()) return prefsTitle;
|
|
14061
|
+
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);
|
|
14062
|
+
if (typeof userConfigTitle === "string" && userConfigTitle.trim()) {
|
|
14063
|
+
return userConfigTitle;
|
|
14064
|
+
}
|
|
14065
|
+
if (cfg !== null && cfg !== void 0 && cfg.displayName) return cfg.displayName;
|
|
14066
|
+
if (cfg !== null && cfg !== void 0 && cfg.name) return cfg.name;
|
|
14067
|
+
if (typeof (item === null || item === void 0 ? void 0 : item.component) === "string") {
|
|
14068
|
+
var parts = item.component.split(".");
|
|
14069
|
+
if (parts.length === 3) return parts[2];
|
|
14070
|
+
return item.component;
|
|
14071
|
+
}
|
|
14072
|
+
return "Widget";
|
|
14073
|
+
}
|
|
14074
|
+
|
|
14075
|
+
/**
|
|
14076
|
+
* Build the full scoped registry id (`scope.package.Component`) for
|
|
14077
|
+
* use as a subtitle. Returns the layout item's canonical id when
|
|
14078
|
+
* present; otherwise null so callers can hide the subtitle.
|
|
14037
14079
|
*
|
|
14038
|
-
*
|
|
14039
|
-
*
|
|
14080
|
+
* @param {Object} item
|
|
14081
|
+
* @returns {string|null}
|
|
14040
14082
|
*/
|
|
14083
|
+
function pickWidgetRef(item) {
|
|
14084
|
+
var c = item === null || item === void 0 ? void 0 : item.component;
|
|
14085
|
+
if (typeof c !== "string") return null;
|
|
14086
|
+
var parts = c.split(".");
|
|
14087
|
+
return parts.length === 3 ? c : null;
|
|
14088
|
+
}
|
|
14089
|
+
|
|
14090
|
+
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; } } }; }
|
|
14091
|
+
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; } }
|
|
14092
|
+
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; }
|
|
14041
14093
|
|
|
14042
14094
|
/**
|
|
14043
14095
|
* Resolve which provider name a given widget instance would bind to for
|
|
@@ -14292,6 +14344,12 @@ function getAllProviderBindings(_ref3) {
|
|
|
14292
14344
|
bindings.push({
|
|
14293
14345
|
widgetId: widgetId,
|
|
14294
14346
|
component: item.component,
|
|
14347
|
+
// Friendly display name + canonical scoped id, derived once
|
|
14348
|
+
// here so every provider-tab consumer (Bulk pane, Per-widget
|
|
14349
|
+
// rows, override badges) shows the same label/subtitle as
|
|
14350
|
+
// the Listeners tab and the Widgets tab.
|
|
14351
|
+
label: pickWidgetDisplayName(item, null),
|
|
14352
|
+
widgetRef: pickWidgetRef(item),
|
|
14295
14353
|
providerType: req.type,
|
|
14296
14354
|
providerClass: req.providerClass || null,
|
|
14297
14355
|
required: req.required !== false,
|
|
@@ -14370,18 +14428,12 @@ function canonicalItemKey(item) {
|
|
|
14370
14428
|
return null;
|
|
14371
14429
|
}
|
|
14372
14430
|
|
|
14373
|
-
|
|
14374
|
-
|
|
14375
|
-
|
|
14376
|
-
|
|
14431
|
+
// Label/widgetRef derivation lives in `widgetIdentity.js` so every
|
|
14432
|
+
// surface (Listeners tab, Providers tab, Widgets tab, widget card
|
|
14433
|
+
// header, layout footer) shows the same widget name + scope.package
|
|
14434
|
+
// .Component subtitle. Local thin wrapper just attaches the cfg.
|
|
14377
14435
|
function labelFor(item, getWidgetConfig) {
|
|
14378
|
-
|
|
14379
|
-
var cfg = (getWidgetConfig === null || getWidgetConfig === void 0 ? void 0 : getWidgetConfig(item.component)) || null;
|
|
14380
|
-
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);
|
|
14381
|
-
if (explicit) return explicit;
|
|
14382
|
-
if (cfg !== null && cfg !== void 0 && cfg.displayName) return cfg.displayName;
|
|
14383
|
-
var id = itemIdOf(item);
|
|
14384
|
-
return "".concat(item.component || "widget").concat(id ? "[".concat(String(id).slice(0, 6), "]") : "");
|
|
14436
|
+
return pickWidgetDisplayName(item, getWidgetConfig === null || getWidgetConfig === void 0 ? void 0 : getWidgetConfig(item.component));
|
|
14385
14437
|
}
|
|
14386
14438
|
|
|
14387
14439
|
/**
|
|
@@ -14425,6 +14477,7 @@ function getEmitters(workspace, getWidgetConfig) {
|
|
|
14425
14477
|
itemId: itemIdOf(item),
|
|
14426
14478
|
component: item.component,
|
|
14427
14479
|
label: labelFor(item, getWidgetConfig),
|
|
14480
|
+
widgetRef: pickWidgetRef(item),
|
|
14428
14481
|
events: events
|
|
14429
14482
|
});
|
|
14430
14483
|
});
|
|
@@ -14435,7 +14488,7 @@ function getEmitters(workspace, getWidgetConfig) {
|
|
|
14435
14488
|
* Every widget instance in the workspace that accepts at least one
|
|
14436
14489
|
* handler. Used to populate the receiver dropdown. Deduplicated by
|
|
14437
14490
|
* `${component}|${itemId}` (see getEmitters).
|
|
14438
|
-
* @returns {Array<{ itemId, component, label, eventHandlers: string[], listeners: object, key: string }>}
|
|
14491
|
+
* @returns {Array<{ itemId, component, label, widgetRef, eventHandlers: string[], listeners: object, key: string }>}
|
|
14439
14492
|
*/
|
|
14440
14493
|
function getReceivers(workspace, getWidgetConfig) {
|
|
14441
14494
|
var byKey = new Map();
|
|
@@ -14450,6 +14503,7 @@ function getReceivers(workspace, getWidgetConfig) {
|
|
|
14450
14503
|
itemId: itemIdOf(item),
|
|
14451
14504
|
component: item.component,
|
|
14452
14505
|
label: labelFor(item, getWidgetConfig),
|
|
14506
|
+
widgetRef: pickWidgetRef(item),
|
|
14453
14507
|
eventHandlers: handlers,
|
|
14454
14508
|
listeners: item.listeners || {}
|
|
14455
14509
|
});
|
|
@@ -15105,11 +15159,19 @@ var PanelEditItemHandlers = function PanelEditItemHandlers(_ref) {
|
|
|
15105
15159
|
children: [connectedCount, " event", connectedCount !== 1 ? "s" : "", " connected"]
|
|
15106
15160
|
})]
|
|
15107
15161
|
}), sourceWidgets.map(function (layout) {
|
|
15162
|
+
var label = pickWidgetDisplayName(layout, null);
|
|
15163
|
+
var ref = pickWidgetRef(layout) || layout.component;
|
|
15108
15164
|
return /*#__PURE__*/jsxs("div", {
|
|
15109
15165
|
className: "flex flex-col space-y-2",
|
|
15110
|
-
children: [/*#__PURE__*/jsxs("
|
|
15111
|
-
className: "
|
|
15112
|
-
children: [
|
|
15166
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
15167
|
+
className: "flex flex-col gap-0.5 mb-1",
|
|
15168
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
15169
|
+
className: "text-sm font-semibold opacity-90",
|
|
15170
|
+
children: label
|
|
15171
|
+
}), /*#__PURE__*/jsxs("span", {
|
|
15172
|
+
className: "text-[10px] opacity-50 font-mono truncate",
|
|
15173
|
+
children: [ref, "[", layout["id"], "]"]
|
|
15174
|
+
})]
|
|
15113
15175
|
}), layout.events.filter(function (value, index, array) {
|
|
15114
15176
|
return array.indexOf(value) === index;
|
|
15115
15177
|
}).map(function (event) {
|
|
@@ -15395,29 +15457,29 @@ var LayoutBuilderConfigModal = function LayoutBuilderConfigModal(_ref) {
|
|
|
15395
15457
|
return s.key === activeSection;
|
|
15396
15458
|
}) || sections[0];
|
|
15397
15459
|
|
|
15398
|
-
// Footer label:
|
|
15399
|
-
//
|
|
15460
|
+
// Footer label: full scoped id (`scope.package.Component`) so the
|
|
15461
|
+
// user always sees the underlying widget identity, even when the
|
|
15462
|
+
// primary title is a custom per-instance label. No workspace fallback.
|
|
15400
15463
|
var footerPackageLabel = function () {
|
|
15401
15464
|
var scopedId = (itemSelected === null || itemSelected === void 0 ? void 0 : itemSelected.component) || "";
|
|
15402
15465
|
if (typeof scopedId !== "string") return "";
|
|
15403
15466
|
var parts = scopedId.split(".");
|
|
15404
|
-
|
|
15405
|
-
var _parts = _slicedToArray(parts, 2),
|
|
15406
|
-
scope = _parts[0],
|
|
15407
|
-
pkg = _parts[1];
|
|
15408
|
-
if (!scope || !pkg) return "";
|
|
15409
|
-
return "@".concat(scope, "/").concat(pkg);
|
|
15467
|
+
return parts.length === 3 ? scopedId : "";
|
|
15410
15468
|
}();
|
|
15411
|
-
|
|
15469
|
+
// Friendly name on the top line, full scoped id on the subtitle.
|
|
15470
|
+
// Same priority chain the Listeners/Widgets tabs and WidgetCardHeader
|
|
15471
|
+
// use, via the shared `pickWidgetDisplayName` helper.
|
|
15472
|
+
var widgetCfg = itemSelected ? ComponentManager.config(itemSelected.component, itemSelected) : null;
|
|
15473
|
+
var friendlyName = itemSelected ? pickWidgetDisplayName(itemSelected, widgetCfg) : "";
|
|
15412
15474
|
var footerLeftContent = footerPackageLabel ? /*#__PURE__*/jsxs("span", {
|
|
15413
15475
|
className: "flex flex-col leading-tight",
|
|
15414
15476
|
children: [/*#__PURE__*/jsx("span", {
|
|
15415
|
-
children:
|
|
15477
|
+
children: friendlyName
|
|
15416
15478
|
}), /*#__PURE__*/jsx("span", {
|
|
15417
|
-
className: "text-[10px] opacity-50",
|
|
15479
|
+
className: "text-[10px] opacity-50 font-mono",
|
|
15418
15480
|
children: footerPackageLabel
|
|
15419
15481
|
})]
|
|
15420
|
-
}) :
|
|
15482
|
+
}) : friendlyName;
|
|
15421
15483
|
return itemSelected !== null && /*#__PURE__*/jsxs(SettingsModal, {
|
|
15422
15484
|
isOpen: open,
|
|
15423
15485
|
setIsOpen: setIsOpen,
|
|
@@ -19709,24 +19771,22 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
|
|
|
19709
19771
|
// Detect missing widgets (component key exists but not in ComponentManager)
|
|
19710
19772
|
var isWidgetMissing = (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component) && !widgetConfig;
|
|
19711
19773
|
|
|
19712
|
-
//
|
|
19713
|
-
|
|
19714
|
-
|
|
19715
|
-
//
|
|
19716
|
-
|
|
19717
|
-
|
|
19718
|
-
//
|
|
19719
|
-
//
|
|
19774
|
+
// Display name + scope.package.Component subtitle. Single source of
|
|
19775
|
+
// truth: `pickWidgetDisplayName` so the same widget shows the same
|
|
19776
|
+
// name in WidgetsTab, Listeners tab, Providers tab, and the layout
|
|
19777
|
+
// footer.
|
|
19778
|
+
var widgetName = pickWidgetDisplayName(widgetItem, widgetConfig);
|
|
19779
|
+
|
|
19780
|
+
// Show the full scoped registry id (`scope.package.Component`) as
|
|
19781
|
+
// the subtitle. The friendly title on line 1 may be a custom user
|
|
19782
|
+
// title that doesn't reveal which widget is mounted; the subtitle
|
|
19783
|
+
// pins down the underlying identity. Strict — the layout item is
|
|
19784
|
+
// the source of truth.
|
|
19720
19785
|
var packageLabel = function () {
|
|
19721
19786
|
var scopedId = (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component) || (widgetConfig === null || widgetConfig === void 0 ? void 0 : widgetConfig.id) || "";
|
|
19722
19787
|
if (typeof scopedId !== "string") return "";
|
|
19723
19788
|
var parts = scopedId.split(".");
|
|
19724
|
-
|
|
19725
|
-
var _parts = _slicedToArray(parts, 2),
|
|
19726
|
-
scope = _parts[0],
|
|
19727
|
-
pkg = _parts[1];
|
|
19728
|
-
if (!scope || !pkg) return "";
|
|
19729
|
-
return "@".concat(scope, "/").concat(pkg);
|
|
19789
|
+
return parts.length === 3 ? scopedId : "";
|
|
19730
19790
|
}();
|
|
19731
19791
|
|
|
19732
19792
|
// Get provider requirements from widget config (not from item directly)
|
|
@@ -53863,7 +53923,7 @@ var DraggableWidgetItem = function DraggableWidgetItem(_ref) {
|
|
|
53863
53923
|
className: "h-3 w-3 opacity-40 flex-shrink-0"
|
|
53864
53924
|
}), /*#__PURE__*/jsx("span", {
|
|
53865
53925
|
className: "truncate font-medium opacity-90",
|
|
53866
|
-
children: widget.name || widgetKey
|
|
53926
|
+
children: widget.displayName || widget.name || bareComponentName(widgetKey) || widgetKey
|
|
53867
53927
|
})]
|
|
53868
53928
|
}), (providerTypes.length > 0 || hasEventInfo) && /*#__PURE__*/jsxs("div", {
|
|
53869
53929
|
className: "flex flex-wrap items-center gap-1 pl-5",
|
|
@@ -53876,9 +53936,10 @@ var DraggableWidgetItem = function DraggableWidgetItem(_ref) {
|
|
|
53876
53936
|
className: "text-[10px] px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-300",
|
|
53877
53937
|
children: [eventCount > 0 && "".concat(eventCount, " event").concat(eventCount > 1 ? "s" : ""), eventCount > 0 && handlerCount > 0 && ", ", handlerCount > 0 && "".concat(handlerCount, " handler").concat(handlerCount > 1 ? "s" : "")]
|
|
53878
53938
|
})]
|
|
53879
|
-
}),
|
|
53880
|
-
className: "text-[10px] pl-5 opacity-40 truncate",
|
|
53881
|
-
|
|
53939
|
+
}), widgetKey && /*#__PURE__*/jsx("span", {
|
|
53940
|
+
className: "text-[10px] pl-5 opacity-40 font-mono truncate",
|
|
53941
|
+
title: widgetKey,
|
|
53942
|
+
children: widgetKey
|
|
53882
53943
|
})]
|
|
53883
53944
|
});
|
|
53884
53945
|
};
|
|
@@ -54216,39 +54277,37 @@ var SidebarDiscoverContent = function SidebarDiscoverContent(_ref2) {
|
|
|
54216
54277
|
children: /*#__PURE__*/jsx("div", {
|
|
54217
54278
|
className: "flex flex-col gap-1 px-3 py-1",
|
|
54218
54279
|
children: registry.packages.map(function (pkg) {
|
|
54219
|
-
var _pkg$widgets4
|
|
54280
|
+
var _pkg$widgets4;
|
|
54220
54281
|
var isInstalled = isPackageInstalled(pkg);
|
|
54282
|
+
var packageRef = pkg.scope && pkg.name ? "@".concat(String(pkg.scope).replace(/^@/, ""), "/").concat(pkg.name) : pkg.name;
|
|
54283
|
+
var widgetCount = ((_pkg$widgets4 = pkg.widgets) === null || _pkg$widgets4 === void 0 ? void 0 : _pkg$widgets4.length) || 0;
|
|
54221
54284
|
return /*#__PURE__*/jsxs("button", {
|
|
54222
54285
|
type: "button",
|
|
54223
54286
|
onClick: function onClick() {
|
|
54224
54287
|
return setSelectedPackageName(pkg.name);
|
|
54225
54288
|
},
|
|
54226
|
-
className: "flex items-
|
|
54289
|
+
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" : ""),
|
|
54227
54290
|
children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
54228
54291
|
icon: "cube",
|
|
54229
|
-
className: "h-3 w-3 opacity-40 flex-shrink-0"
|
|
54292
|
+
className: "h-3 w-3 opacity-40 flex-shrink-0 mt-0.5"
|
|
54230
54293
|
}), /*#__PURE__*/jsxs("div", {
|
|
54231
54294
|
className: "min-w-0 flex-1",
|
|
54232
|
-
children: [/*#__PURE__*/
|
|
54233
|
-
className: "
|
|
54234
|
-
children:
|
|
54235
|
-
|
|
54236
|
-
|
|
54237
|
-
|
|
54238
|
-
className: "
|
|
54239
|
-
children:
|
|
54240
|
-
}), pkg.author && ((_pkg$widgets4 = pkg.widgets) === null || _pkg$widgets4 === void 0 ? void 0 : _pkg$widgets4.length) > 0 && /*#__PURE__*/jsx("span", {
|
|
54241
|
-
children: "\xB7"
|
|
54242
|
-
}), ((_pkg$widgets5 = pkg.widgets) === null || _pkg$widgets5 === void 0 ? void 0 : _pkg$widgets5.length) > 0 && /*#__PURE__*/jsxs("span", {
|
|
54243
|
-
children: [pkg.widgets.length, " widget", pkg.widgets.length !== 1 ? "s" : ""]
|
|
54244
|
-
}), isInstalled && /*#__PURE__*/jsxs(Fragment, {
|
|
54245
|
-
children: [/*#__PURE__*/jsx("span", {
|
|
54246
|
-
children: "\xB7"
|
|
54247
|
-
}), /*#__PURE__*/jsx("span", {
|
|
54248
|
-
className: "text-emerald-400",
|
|
54249
|
-
children: "Installed"
|
|
54250
|
-
})]
|
|
54295
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
54296
|
+
className: "flex items-center gap-2",
|
|
54297
|
+
children: [/*#__PURE__*/jsx("span", {
|
|
54298
|
+
className: "text-sm font-medium opacity-90 truncate flex-1 min-w-0",
|
|
54299
|
+
children: pkg.displayName || pkg.name
|
|
54300
|
+
}), isInstalled && /*#__PURE__*/jsx("span", {
|
|
54301
|
+
className: "text-[10px] text-emerald-400 flex-shrink-0",
|
|
54302
|
+
children: "Installed"
|
|
54251
54303
|
})]
|
|
54304
|
+
}), packageRef && /*#__PURE__*/jsx("div", {
|
|
54305
|
+
className: "text-[10px] opacity-50 font-mono truncate mt-0.5",
|
|
54306
|
+
title: packageRef,
|
|
54307
|
+
children: packageRef
|
|
54308
|
+
}), /*#__PURE__*/jsxs("div", {
|
|
54309
|
+
className: "text-[10px] opacity-40 truncate mt-0.5",
|
|
54310
|
+
children: [pkg.author ? "".concat(pkg.author, " \xB7 ") : "", widgetCount, " widget", widgetCount !== 1 ? "s" : ""]
|
|
54252
54311
|
})]
|
|
54253
54312
|
})]
|
|
54254
54313
|
}, pkg.name);
|
|
@@ -55205,24 +55264,6 @@ function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r
|
|
|
55205
55264
|
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; }
|
|
55206
55265
|
var ALL_WIDGETS_ID = "__ALL__";
|
|
55207
55266
|
|
|
55208
|
-
/**
|
|
55209
|
-
* Build the scoped registry identifier for a widget. Surfaces the
|
|
55210
|
-
* `scope.packageName.component` triple in the settings UI so users
|
|
55211
|
-
* can verify what a widget's registry identity is — useful when
|
|
55212
|
-
* diagnosing dashboard-install warnings ("why didn't this widget
|
|
55213
|
-
* install?" → scoped id in the warning vs scoped id shown here).
|
|
55214
|
-
* Returns just the component name when scope/package metadata is
|
|
55215
|
-
* unavailable (e.g. bare built-ins).
|
|
55216
|
-
*/
|
|
55217
|
-
function buildScopedId(widget) {
|
|
55218
|
-
if (!(widget !== null && widget !== void 0 && widget.component)) return null;
|
|
55219
|
-
var scope = widget.scope ? String(widget.scope).replace(/^@/, "") : null;
|
|
55220
|
-
var pkg = widget.packageName ? scope ? String(widget.packageName).replace(new RegExp("^@?".concat(scope, "/")), "") : String(widget.packageName).replace(/^@/, "") : null;
|
|
55221
|
-
if (scope && pkg) return "".concat(scope, ".").concat(pkg, ".").concat(widget.component);
|
|
55222
|
-
if (pkg) return "".concat(pkg, ".").concat(widget.component);
|
|
55223
|
-
return widget.component;
|
|
55224
|
-
}
|
|
55225
|
-
|
|
55226
55267
|
/**
|
|
55227
55268
|
* WidgetsTab
|
|
55228
55269
|
*
|
|
@@ -55267,13 +55308,11 @@ var WidgetsTab = function WidgetsTab(_ref) {
|
|
|
55267
55308
|
result.push({
|
|
55268
55309
|
id: id,
|
|
55269
55310
|
component: item.component,
|
|
55270
|
-
displayName: item
|
|
55311
|
+
displayName: pickWidgetDisplayName(item, cfg),
|
|
55312
|
+
widgetRef: pickWidgetRef(item),
|
|
55271
55313
|
section: section,
|
|
55272
55314
|
userConfig: cfg.userConfig || {},
|
|
55273
55315
|
userPrefs: item.userPrefs || {},
|
|
55274
|
-
// Identity fields for the registry-identifier label. Prefer
|
|
55275
|
-
// values from the widget's component manager entry since the
|
|
55276
|
-
// layout item itself often doesn't carry scope/packageName.
|
|
55277
55316
|
scope: cfg.scope || item.scope || null,
|
|
55278
55317
|
packageName: cfg.packageName || cfg.name || item.packageName || null
|
|
55279
55318
|
});
|
|
@@ -55411,6 +55450,10 @@ var WidgetsTab = function WidgetsTab(_ref) {
|
|
|
55411
55450
|
className: "text-[10px] bg-amber-500/20 text-amber-300 px-1.5 rounded",
|
|
55412
55451
|
children: stagedForWidget
|
|
55413
55452
|
})]
|
|
55453
|
+
}), w.widgetRef && /*#__PURE__*/jsx("div", {
|
|
55454
|
+
className: "text-[10px] text-gray-500 font-mono truncate mt-0.5",
|
|
55455
|
+
title: w.widgetRef,
|
|
55456
|
+
children: w.widgetRef
|
|
55414
55457
|
}), /*#__PURE__*/jsx("div", {
|
|
55415
55458
|
className: "text-[10px] text-gray-600 mt-0.5",
|
|
55416
55459
|
children: fieldCount === 0 ? "No configurable fields" : "".concat(fieldCount, " field").concat(fieldCount === 1 ? "" : "s")
|
|
@@ -55443,20 +55486,19 @@ function SingleWidgetPane(_ref4) {
|
|
|
55443
55486
|
effectivePrefs = _ref4.effectivePrefs,
|
|
55444
55487
|
onFieldChange = _ref4.onFieldChange;
|
|
55445
55488
|
var hasFields = Object.keys(widget.userConfig).length > 0;
|
|
55446
|
-
var scopedId = buildScopedId(widget);
|
|
55447
55489
|
return /*#__PURE__*/jsxs("div", {
|
|
55448
55490
|
children: [/*#__PURE__*/jsxs("div", {
|
|
55449
55491
|
className: "mb-3",
|
|
55450
55492
|
children: [/*#__PURE__*/jsx("div", {
|
|
55451
55493
|
className: "text-gray-200 font-semibold",
|
|
55452
55494
|
children: widget.displayName
|
|
55453
|
-
}), /*#__PURE__*/
|
|
55454
|
-
className: "text-xs text-gray-500",
|
|
55455
|
-
|
|
55456
|
-
|
|
55457
|
-
|
|
55458
|
-
|
|
55459
|
-
children:
|
|
55495
|
+
}), widget.widgetRef && /*#__PURE__*/jsx("div", {
|
|
55496
|
+
className: "text-xs text-gray-500 font-mono truncate mt-0.5",
|
|
55497
|
+
title: widget.widgetRef,
|
|
55498
|
+
children: widget.widgetRef
|
|
55499
|
+
}), /*#__PURE__*/jsx("div", {
|
|
55500
|
+
className: "text-xs text-gray-600 mt-0.5",
|
|
55501
|
+
children: widget.section
|
|
55460
55502
|
})]
|
|
55461
55503
|
}), hasFields ? /*#__PURE__*/jsx(PanelEditForm, {
|
|
55462
55504
|
userConfig: widget.userConfig,
|
|
@@ -55702,11 +55744,11 @@ var DashboardConfigModal = function DashboardConfigModal(_ref) {
|
|
|
55702
55744
|
var derivePackage = function derivePackage(item) {
|
|
55703
55745
|
var scopedId = typeof (item === null || item === void 0 ? void 0 : item.component) === "string" ? item.component : "";
|
|
55704
55746
|
var parts = scopedId.split(".");
|
|
55705
|
-
if (parts.length === 3) {
|
|
55706
|
-
|
|
55707
|
-
|
|
55708
|
-
|
|
55709
|
-
|
|
55747
|
+
if (parts.length === 3 && parts[0] && parts[1]) {
|
|
55748
|
+
// Group rows by `@scope/package` so two widgets from the same
|
|
55749
|
+
// package show up under one heading. The full scoped id is
|
|
55750
|
+
// surfaced per-row in the table (column-level identity).
|
|
55751
|
+
return "@".concat(parts[0], "/").concat(parts[1]);
|
|
55710
55752
|
}
|
|
55711
55753
|
// Defensive: an explicit packageId on the item still wins for
|
|
55712
55754
|
// legacy items the migration couldn't auto-resolve.
|
|
@@ -56325,13 +56367,17 @@ function ProvidersTab(_ref4) {
|
|
|
56325
56367
|
className: "text-sm truncate flex items-center gap-1.5 ".concat(needsAttention ? "font-semibold text-red-100" : "font-medium"),
|
|
56326
56368
|
children: [/*#__PURE__*/jsx("span", {
|
|
56327
56369
|
className: "truncate",
|
|
56328
|
-
children: row.component || "widget"
|
|
56370
|
+
children: row.label || row.component || "widget"
|
|
56329
56371
|
}), isRequired && /*#__PURE__*/jsx("span", {
|
|
56330
56372
|
className: needsAttention ? "text-red-300" : "text-indigo-300",
|
|
56331
56373
|
title: "Required provider",
|
|
56332
56374
|
"aria-label": "required",
|
|
56333
56375
|
children: "*"
|
|
56334
56376
|
})]
|
|
56377
|
+
}), (row.widgetRef || row.component) && /*#__PURE__*/jsx("div", {
|
|
56378
|
+
className: "text-[10px] opacity-50 font-mono truncate mt-0.5",
|
|
56379
|
+
title: row.widgetRef || row.component,
|
|
56380
|
+
children: row.widgetRef || row.component
|
|
56335
56381
|
}), /*#__PURE__*/jsxs("div", {
|
|
56336
56382
|
className: "flex items-center gap-1.5 mt-1 text-[10px]",
|
|
56337
56383
|
children: [/*#__PURE__*/jsx("span", {
|
|
@@ -56531,16 +56577,20 @@ function ListenersTab(_ref9) {
|
|
|
56531
56577
|
className: "overflow-y-auto flex-1",
|
|
56532
56578
|
children: receivers.map(function (r) {
|
|
56533
56579
|
var isActive = r.key === selectedReceiverKey;
|
|
56534
|
-
return /*#__PURE__*/
|
|
56580
|
+
return /*#__PURE__*/jsxs("button", {
|
|
56535
56581
|
type: "button",
|
|
56536
56582
|
onClick: function onClick() {
|
|
56537
56583
|
return setSelectedReceiverKey(r.key);
|
|
56538
56584
|
},
|
|
56539
56585
|
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"),
|
|
56540
|
-
children: /*#__PURE__*/jsx("
|
|
56586
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
56541
56587
|
className: "text-sm font-medium truncate",
|
|
56542
56588
|
children: r.label
|
|
56543
|
-
})
|
|
56589
|
+
}), r.widgetRef && /*#__PURE__*/jsx("div", {
|
|
56590
|
+
className: "text-[10px] opacity-50 font-mono truncate mt-0.5",
|
|
56591
|
+
title: r.widgetRef,
|
|
56592
|
+
children: r.widgetRef
|
|
56593
|
+
})]
|
|
56544
56594
|
}, r.key);
|
|
56545
56595
|
})
|
|
56546
56596
|
})]
|
|
@@ -56731,9 +56781,15 @@ function EventsColumn(_ref10) {
|
|
|
56731
56781
|
}) : emittersForList.map(function (e) {
|
|
56732
56782
|
return /*#__PURE__*/jsxs("div", {
|
|
56733
56783
|
className: "space-y-1",
|
|
56734
|
-
children: [/*#__PURE__*/
|
|
56735
|
-
className: "
|
|
56736
|
-
children:
|
|
56784
|
+
children: [/*#__PURE__*/jsxs("div", {
|
|
56785
|
+
className: "flex flex-col gap-0.5 mb-1",
|
|
56786
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
56787
|
+
className: "text-sm font-semibold",
|
|
56788
|
+
children: e.label
|
|
56789
|
+
}), (e.widgetRef || e.component) && /*#__PURE__*/jsx("div", {
|
|
56790
|
+
className: "text-[10px] opacity-50 font-mono truncate",
|
|
56791
|
+
children: (e.widgetRef || e.component) + (e.itemId != null ? "[".concat(e.itemId, "]") : "")
|
|
56792
|
+
})]
|
|
56737
56793
|
}), e.events.map(function (eventName) {
|
|
56738
56794
|
var key = "".concat(e.component, "|").concat(e.itemId, "|").concat(eventName);
|
|
56739
56795
|
var selected = wiredKeys.has(key);
|