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