@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 +29 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +29 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18977,18 +18977,38 @@ var WidgetCardHeader = function WidgetCardHeader(_ref) {
|
|
|
18977
18977
|
};
|
|
18978
18978
|
var providerRequirements = getProviderRequirements();
|
|
18979
18979
|
|
|
18980
|
-
//
|
|
18981
|
-
//
|
|
18982
|
-
//
|
|
18983
|
-
|
|
18984
|
-
|
|
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
|
|
18988
|
-
//
|
|
18989
|
-
//
|
|
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 && !
|
|
19011
|
+
return req.required && !isProviderResolved(req.type);
|
|
18992
19012
|
});
|
|
18993
19013
|
|
|
18994
19014
|
// Build overflow actions list — single source of truth for the
|