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