@trops/dash-core 0.1.465 → 0.1.467

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
@@ -22668,6 +22668,14 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
22668
22668
  newWorkspace.selectedProviders[uuid] = _objectSpread$J(_objectSpread$J({}, newWorkspace.selectedProviders[uuid] || {}), {}, _defineProperty({}, providerType, providerId));
22669
22669
  }
22670
22670
  setCurrentWorkspace(newWorkspace);
22671
+ // Propagate to the parent (DashboardStage) so workspaceSelected
22672
+ // — what the dashboard config bulk-edit modal reads from —
22673
+ // stays in sync with per-widget provider edits. Mirrors the
22674
+ // pattern in the AI placement / remix handlers above. Without
22675
+ // this, the bulk modal opens with stale provider bindings.
22676
+ if (typeof onWorkspaceChangeRef.current === "function") {
22677
+ onWorkspaceChangeRef.current(newWorkspace);
22678
+ }
22671
22679
  }
22672
22680
  }
22673
22681
  function handleCreateProvider(providerName, credentials) {
@@ -57172,10 +57180,25 @@ var DashboardConfigModal = function DashboardConfigModal(_ref) {
57172
57180
 
57173
57181
  // Bulk-apply: write this provider as the binding for every widget of
57174
57182
  // this type that doesn't already have an explicit widget-level override.
57183
+ //
57184
+ // Override-detection consults the staged state first so a freshly
57185
+ // staged unset is recognised as "no override" and gets bulked. A
57186
+ // non-empty staged value is treated as an explicit pick and is
57187
+ // preserved (bulk skips). Without this, the user could stage an
57188
+ // unset and then click Bulk and the widget they just unset would
57189
+ // be skipped because the *original* layer-1 value still lived on
57190
+ // `b.layoutItem.selectedProviders`.
57175
57191
  function stageBulk(providerType, providerName) {
57176
57192
  var affected = effectiveBindings.filter(function (b) {
57177
- var _b$layoutItem;
57178
- return b.providerType === providerType && !((_b$layoutItem = b.layoutItem) !== null && _b$layoutItem !== void 0 && (_b$layoutItem = _b$layoutItem.selectedProviders) !== null && _b$layoutItem !== void 0 && _b$layoutItem[providerType]);
57193
+ var _staged$b$widgetId2, _b$layoutItem;
57194
+ if (b.providerType !== providerType) return false;
57195
+ var stagedValue = (_staged$b$widgetId2 = staged[b.widgetId]) === null || _staged$b$widgetId2 === void 0 ? void 0 : _staged$b$widgetId2[providerType];
57196
+ if (stagedValue !== undefined) {
57197
+ // Empty/null staged value → user staged an unset → include
57198
+ // in bulk. Non-empty → explicit pick, preserve it.
57199
+ return !stagedValue;
57200
+ }
57201
+ return !((_b$layoutItem = b.layoutItem) !== null && _b$layoutItem !== void 0 && (_b$layoutItem = _b$layoutItem.selectedProviders) !== null && _b$layoutItem !== void 0 && _b$layoutItem[providerType]);
57179
57202
  });
57180
57203
  setStaged(function (prev) {
57181
57204
  var next = _objectSpread$a({}, prev);