@trops/dash-core 0.1.437 → 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 +149 -138
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +149 -138
- 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
|
+
*
|
|
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.
|
|
14048
14060
|
*
|
|
14049
|
-
*
|
|
14050
|
-
*
|
|
14051
|
-
*
|
|
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)
|
|
14052
14070
|
*
|
|
14053
|
-
*
|
|
14054
|
-
*
|
|
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) {
|
|
@@ -15422,16 +15484,20 @@ var LayoutBuilderConfigModal = function LayoutBuilderConfigModal(_ref) {
|
|
|
15422
15484
|
var parts = scopedId.split(".");
|
|
15423
15485
|
return parts.length === 3 ? scopedId : "";
|
|
15424
15486
|
}();
|
|
15425
|
-
|
|
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) : "";
|
|
15426
15492
|
var footerLeftContent = footerPackageLabel ? /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
15427
15493
|
className: "flex flex-col leading-tight",
|
|
15428
15494
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
15429
|
-
children:
|
|
15495
|
+
children: friendlyName
|
|
15430
15496
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
15431
|
-
className: "text-[10px] opacity-50",
|
|
15497
|
+
className: "text-[10px] opacity-50 font-mono",
|
|
15432
15498
|
children: footerPackageLabel
|
|
15433
15499
|
})]
|
|
15434
|
-
}) :
|
|
15500
|
+
}) : friendlyName;
|
|
15435
15501
|
return itemSelected !== null && /*#__PURE__*/jsxRuntime.jsxs(DashReact.SettingsModal, {
|
|
15436
15502
|
isOpen: open,
|
|
15437
15503
|
setIsOpen: setIsOpen,
|
|
@@ -19723,29 +19789,11 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
|
|
|
19723
19789
|
// Detect missing widgets (component key exists but not in ComponentManager)
|
|
19724
19790
|
var isWidgetMissing = (widgetItem === null || widgetItem === void 0 ? void 0 : widgetItem.component) && !widgetConfig;
|
|
19725
19791
|
|
|
19726
|
-
// Display name
|
|
19727
|
-
//
|
|
19728
|
-
//
|
|
19729
|
-
//
|
|
19730
|
-
|
|
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
|
-
}();
|
|
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);
|
|
19749
19797
|
|
|
19750
19798
|
// Show the full scoped registry id (`scope.package.Component`) as
|
|
19751
19799
|
// the subtitle. The friendly title on line 1 may be a custom user
|
|
@@ -53893,7 +53941,7 @@ var DraggableWidgetItem = function DraggableWidgetItem(_ref) {
|
|
|
53893
53941
|
className: "h-3 w-3 opacity-40 flex-shrink-0"
|
|
53894
53942
|
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
53895
53943
|
className: "truncate font-medium opacity-90",
|
|
53896
|
-
children: widget.name || widgetKey
|
|
53944
|
+
children: widget.displayName || widget.name || bareComponentName(widgetKey) || widgetKey
|
|
53897
53945
|
})]
|
|
53898
53946
|
}), (providerTypes.length > 0 || hasEventInfo) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
53899
53947
|
className: "flex flex-wrap items-center gap-1 pl-5",
|
|
@@ -53906,9 +53954,10 @@ var DraggableWidgetItem = function DraggableWidgetItem(_ref) {
|
|
|
53906
53954
|
className: "text-[10px] px-1.5 py-0.5 rounded bg-emerald-500/20 text-emerald-300",
|
|
53907
53955
|
children: [eventCount > 0 && "".concat(eventCount, " event").concat(eventCount > 1 ? "s" : ""), eventCount > 0 && handlerCount > 0 && ", ", handlerCount > 0 && "".concat(handlerCount, " handler").concat(handlerCount > 1 ? "s" : "")]
|
|
53908
53956
|
})]
|
|
53909
|
-
}),
|
|
53910
|
-
className: "text-[10px] pl-5 opacity-40 truncate",
|
|
53911
|
-
|
|
53957
|
+
}), widgetKey && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
53958
|
+
className: "text-[10px] pl-5 opacity-40 font-mono truncate",
|
|
53959
|
+
title: widgetKey,
|
|
53960
|
+
children: widgetKey
|
|
53912
53961
|
})]
|
|
53913
53962
|
});
|
|
53914
53963
|
};
|
|
@@ -54246,39 +54295,37 @@ var SidebarDiscoverContent = function SidebarDiscoverContent(_ref2) {
|
|
|
54246
54295
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
54247
54296
|
className: "flex flex-col gap-1 px-3 py-1",
|
|
54248
54297
|
children: registry.packages.map(function (pkg) {
|
|
54249
|
-
var _pkg$widgets4
|
|
54298
|
+
var _pkg$widgets4;
|
|
54250
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;
|
|
54251
54302
|
return /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
54252
54303
|
type: "button",
|
|
54253
54304
|
onClick: function onClick() {
|
|
54254
54305
|
return setSelectedPackageName(pkg.name);
|
|
54255
54306
|
},
|
|
54256
|
-
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" : ""),
|
|
54257
54308
|
children: [/*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
|
|
54258
54309
|
icon: "cube",
|
|
54259
|
-
className: "h-3 w-3 opacity-40 flex-shrink-0"
|
|
54310
|
+
className: "h-3 w-3 opacity-40 flex-shrink-0 mt-0.5"
|
|
54260
54311
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
54261
54312
|
className: "min-w-0 flex-1",
|
|
54262
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
54263
|
-
className: "
|
|
54264
|
-
children:
|
|
54265
|
-
|
|
54266
|
-
|
|
54267
|
-
|
|
54268
|
-
className: "
|
|
54269
|
-
children:
|
|
54270
|
-
}), pkg.author && ((_pkg$widgets4 = pkg.widgets) === null || _pkg$widgets4 === void 0 ? void 0 : _pkg$widgets4.length) > 0 && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
54271
|
-
children: "\xB7"
|
|
54272
|
-
}), ((_pkg$widgets5 = pkg.widgets) === null || _pkg$widgets5 === void 0 ? void 0 : _pkg$widgets5.length) > 0 && /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
54273
|
-
children: [pkg.widgets.length, " widget", pkg.widgets.length !== 1 ? "s" : ""]
|
|
54274
|
-
}), isInstalled && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
54275
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
54276
|
-
children: "\xB7"
|
|
54277
|
-
}), /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
54278
|
-
className: "text-emerald-400",
|
|
54279
|
-
children: "Installed"
|
|
54280
|
-
})]
|
|
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"
|
|
54281
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" : ""]
|
|
54282
54329
|
})]
|
|
54283
54330
|
})]
|
|
54284
54331
|
}, pkg.name);
|
|
@@ -55235,56 +55282,6 @@ function _unsupportedIterableToArray$5(r, a) { if (r) { if ("string" == typeof r
|
|
|
55235
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; }
|
|
55236
55283
|
var ALL_WIDGETS_ID = "__ALL__";
|
|
55237
55284
|
|
|
55238
|
-
/**
|
|
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.
|
|
55276
|
-
*/
|
|
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);
|
|
55286
|
-
}
|
|
55287
|
-
|
|
55288
55285
|
/**
|
|
55289
55286
|
* WidgetsTab
|
|
55290
55287
|
*
|
|
@@ -55329,8 +55326,8 @@ var WidgetsTab = function WidgetsTab(_ref) {
|
|
|
55329
55326
|
result.push({
|
|
55330
55327
|
id: id,
|
|
55331
55328
|
component: item.component,
|
|
55332
|
-
displayName:
|
|
55333
|
-
widgetRef: pickWidgetRef(item
|
|
55329
|
+
displayName: pickWidgetDisplayName(item, cfg),
|
|
55330
|
+
widgetRef: pickWidgetRef(item),
|
|
55334
55331
|
section: section,
|
|
55335
55332
|
userConfig: cfg.userConfig || {},
|
|
55336
55333
|
userPrefs: item.userPrefs || {},
|
|
@@ -56388,13 +56385,17 @@ function ProvidersTab(_ref4) {
|
|
|
56388
56385
|
className: "text-sm truncate flex items-center gap-1.5 ".concat(needsAttention ? "font-semibold text-red-100" : "font-medium"),
|
|
56389
56386
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
56390
56387
|
className: "truncate",
|
|
56391
|
-
children: row.component || "widget"
|
|
56388
|
+
children: row.label || row.component || "widget"
|
|
56392
56389
|
}), isRequired && /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
56393
56390
|
className: needsAttention ? "text-red-300" : "text-indigo-300",
|
|
56394
56391
|
title: "Required provider",
|
|
56395
56392
|
"aria-label": "required",
|
|
56396
56393
|
children: "*"
|
|
56397
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
|
|
56398
56399
|
}), /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
56399
56400
|
className: "flex items-center gap-1.5 mt-1 text-[10px]",
|
|
56400
56401
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
@@ -56594,16 +56595,20 @@ function ListenersTab(_ref9) {
|
|
|
56594
56595
|
className: "overflow-y-auto flex-1",
|
|
56595
56596
|
children: receivers.map(function (r) {
|
|
56596
56597
|
var isActive = r.key === selectedReceiverKey;
|
|
56597
|
-
return /*#__PURE__*/jsxRuntime.
|
|
56598
|
+
return /*#__PURE__*/jsxRuntime.jsxs("button", {
|
|
56598
56599
|
type: "button",
|
|
56599
56600
|
onClick: function onClick() {
|
|
56600
56601
|
return setSelectedReceiverKey(r.key);
|
|
56601
56602
|
},
|
|
56602
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"),
|
|
56603
|
-
children: /*#__PURE__*/jsxRuntime.jsx("
|
|
56604
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
56604
56605
|
className: "text-sm font-medium truncate",
|
|
56605
56606
|
children: r.label
|
|
56606
|
-
})
|
|
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
|
+
})]
|
|
56607
56612
|
}, r.key);
|
|
56608
56613
|
})
|
|
56609
56614
|
})]
|
|
@@ -56794,9 +56799,15 @@ function EventsColumn(_ref10) {
|
|
|
56794
56799
|
}) : emittersForList.map(function (e) {
|
|
56795
56800
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
56796
56801
|
className: "space-y-1",
|
|
56797
|
-
children: [/*#__PURE__*/jsxRuntime.
|
|
56798
|
-
className: "
|
|
56799
|
-
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
|
+
})]
|
|
56800
56811
|
}), e.events.map(function (eventName) {
|
|
56801
56812
|
var key = "".concat(e.component, "|").concat(e.itemId, "|").concat(eventName);
|
|
56802
56813
|
var selected = wiredKeys.has(key);
|