@trops/dash-core 0.1.560 → 0.1.561

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.js CHANGED
@@ -18977,18 +18977,38 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
18977
18977
  };
18978
18978
  var providerRequirements = getProviderRequirements();
18979
18979
 
18980
- // Check if provider is configured — used only for the amber-dot
18981
- // indicator now. Actual provider editing lives in the config
18982
- // modal's Providers section (opened via the "Providers" menu item).
18983
- var isProviderConfigured = function isProviderConfigured(providerType) {
18984
- return selectedProviders[providerType] != null;
18980
+ // App providers — needed to detect when a global default
18981
+ // (`isDefaultForType: true`) exists for a required provider type.
18982
+ // The runtime resolution chain in useMcpProvider / useWebSocketProvider
18983
+ // falls through to the default when no per-instance pick is set, so
18984
+ // the amber-dot indicator should respect that fallback: a widget
18985
+ // whose required type has a default ISN'T actually unresolved.
18986
+ // Without this, the dot fires on every widget the user hasn't
18987
+ // explicitly bound, even though the runtime is happy.
18988
+ var appCtx = React.useContext(AppContext);
18989
+ var appProviders = (appCtx === null || appCtx === void 0 ? void 0 : appCtx.providers) || {};
18990
+
18991
+ // Check if a required provider has a resolved provider for it —
18992
+ // either a per-instance pick OR a global `isDefaultForType: true`
18993
+ // provider of the matching type. Mirrors the resolution chain in
18994
+ // `utils/providerResolution.js` so the indicator agrees with what
18995
+ // the runtime hook actually does.
18996
+ var isProviderResolved = function isProviderResolved(providerType) {
18997
+ if (selectedProviders[providerType] != null) return true;
18998
+ // Walk appProviders looking for a default of this type.
18999
+ var entries = appProviders && _typeof(appProviders) === "object" ? Object.values(appProviders) : [];
19000
+ return entries.some(function (p) {
19001
+ return p && p.type === providerType && p.isDefaultForType === true;
19002
+ });
18985
19003
  };
18986
19004
 
18987
- // True when any required provider lacks a selection — drives the
18988
- // amber dot on the overflow button so the user can see unresolved
18989
- // state at a glance without opening the menu.
19005
+ // True when any required provider has neither a per-instance pick
19006
+ // nor a global default — drives the amber dot on the overflow
19007
+ // button + the "!" badge on the Providers menu item so the user
19008
+ // can see truly-unresolved state at a glance. Widgets relying on
19009
+ // a global default no longer trip this.
18990
19010
  var hasUnresolvedRequiredProvider = providerRequirements.some(function (req) {
18991
- return req.required && !isProviderConfigured(req.type);
19011
+ return req.required && !isProviderResolved(req.type);
18992
19012
  });
18993
19013
 
18994
19014
  // Build overflow actions list — single source of truth for the