@trops/dash-core 0.1.556 → 0.1.560
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 +46 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +46 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -14412,7 +14412,35 @@ var PanelEditItemProviders = function PanelEditItemProviders(_ref) {
|
|
|
14412
14412
|
}, p);
|
|
14413
14413
|
});
|
|
14414
14414
|
var isConfigured = !!current;
|
|
14415
|
-
|
|
14415
|
+
// Detect the global default for this type. If one exists,
|
|
14416
|
+
// the runtime resolution chain (widget → workspace → app
|
|
14417
|
+
// default → null, see useMcpProvider.js + providerResolution.js)
|
|
14418
|
+
// will use it even when no per-instance override is set —
|
|
14419
|
+
// so the user isn't actually missing anything.
|
|
14420
|
+
//
|
|
14421
|
+
// Without this fallback awareness the UI flagged every
|
|
14422
|
+
// widget with no per-instance pick as "REQUIRED" in red,
|
|
14423
|
+
// even though the widget worked fine at runtime via the
|
|
14424
|
+
// default. Three states now drive the styling instead of
|
|
14425
|
+
// two:
|
|
14426
|
+
// - overridden: user explicitly picked a per-instance
|
|
14427
|
+
// provider → neutral panel + "override" tag
|
|
14428
|
+
// - using-default: per-instance empty but a global
|
|
14429
|
+
// default exists → neutral panel + "using default
|
|
14430
|
+
// <name>" hint
|
|
14431
|
+
// - missing: per-instance empty AND no global default
|
|
14432
|
+
// for this type → red panel + "REQUIRED" tag
|
|
14433
|
+
var defaultOption = options.find(function (o) {
|
|
14434
|
+
return o.isDefaultForType;
|
|
14435
|
+
});
|
|
14436
|
+
var isUsingDefault = !isConfigured && !!defaultOption;
|
|
14437
|
+
var isMissing = req.required && !isConfigured && !defaultOption;
|
|
14438
|
+
// resolvedName is what runtime will actually use — either
|
|
14439
|
+
// the per-instance override, or the global default if one
|
|
14440
|
+
// exists. Surfaced in the "using default" hint so the user
|
|
14441
|
+
// can see which provider is actually wired in without
|
|
14442
|
+
// opening Settings → Providers.
|
|
14443
|
+
var resolvedName = isConfigured ? current : isUsingDefault ? defaultOption.name : null;
|
|
14416
14444
|
return /*#__PURE__*/jsxs("div", {
|
|
14417
14445
|
className: "rounded border px-3 py-2 ".concat(isMissing ? "bg-red-900 border-red-500" : "bg-gray-800 border-gray-700"),
|
|
14418
14446
|
children: [/*#__PURE__*/jsxs("div", {
|
|
@@ -14423,10 +14451,24 @@ var PanelEditItemProviders = function PanelEditItemProviders(_ref) {
|
|
|
14423
14451
|
}), /*#__PURE__*/jsx("span", {
|
|
14424
14452
|
className: "text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded font-semibold ".concat(isMissing ? "bg-red-600 text-white" : req.required ? "bg-indigo-800 text-indigo-100" : "bg-gray-700 text-gray-300"),
|
|
14425
14453
|
children: req.required ? "required" : "optional"
|
|
14454
|
+
}), isUsingDefault && /*#__PURE__*/jsx("span", {
|
|
14455
|
+
className: "text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded font-semibold bg-emerald-800 text-emerald-100",
|
|
14456
|
+
title: "No per-widget override set \u2014 runtime resolves to the global default \"".concat(resolvedName, "\" (Settings \u2192 Providers)."),
|
|
14457
|
+
children: "using default"
|
|
14458
|
+
}), isConfigured && /*#__PURE__*/jsx("span", {
|
|
14459
|
+
className: "text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded font-semibold bg-indigo-900 text-indigo-200",
|
|
14460
|
+
title: "A per-widget provider is set; overrides the global default.",
|
|
14461
|
+
children: "override"
|
|
14426
14462
|
})]
|
|
14427
14463
|
}), req.description && /*#__PURE__*/jsx("div", {
|
|
14428
14464
|
className: "text-xs opacity-60 mt-1",
|
|
14429
14465
|
children: req.description
|
|
14466
|
+
}), isUsingDefault && /*#__PURE__*/jsxs("div", {
|
|
14467
|
+
className: "mt-1 text-[11px] text-emerald-300",
|
|
14468
|
+
children: ["Using global default:", " ", /*#__PURE__*/jsx("span", {
|
|
14469
|
+
className: "font-mono",
|
|
14470
|
+
children: resolvedName
|
|
14471
|
+
}), ". Pick a specific provider below to override."]
|
|
14430
14472
|
}), /*#__PURE__*/jsxs("div", {
|
|
14431
14473
|
className: "mt-2",
|
|
14432
14474
|
children: [/*#__PURE__*/jsxs("select", {
|
|
@@ -14437,11 +14479,11 @@ var PanelEditItemProviders = function PanelEditItemProviders(_ref) {
|
|
|
14437
14479
|
className: "w-full bg-gray-900 border rounded px-2 py-1.5 text-sm ".concat(isMissing ? "border-red-500" : "border-gray-700"),
|
|
14438
14480
|
children: [/*#__PURE__*/jsx("option", {
|
|
14439
14481
|
value: "",
|
|
14440
|
-
children: req.required ? "— select a provider —" : "— none —"
|
|
14482
|
+
children: isUsingDefault ? "\u2014 use default (".concat(resolvedName, ") \u2014") : req.required ? "— select a provider —" : "— none —"
|
|
14441
14483
|
}), options.map(function (opt) {
|
|
14442
|
-
return /*#__PURE__*/
|
|
14484
|
+
return /*#__PURE__*/jsxs("option", {
|
|
14443
14485
|
value: opt.name,
|
|
14444
|
-
children: opt.name
|
|
14486
|
+
children: [opt.name, opt.isDefaultForType ? " (default)" : ""]
|
|
14445
14487
|
}, opt.name);
|
|
14446
14488
|
})]
|
|
14447
14489
|
}), options.length === 0 && /*#__PURE__*/jsxs("div", {
|