@trops/dash-core 0.1.466 → 0.1.468

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
@@ -15776,6 +15776,32 @@ var PanelEditItemProviders = function PanelEditItemProviders(_ref) {
15776
15776
  updatedItem.selectedProviders = nextProviders;
15777
15777
  var updatedWorkspace = DashReact.deepCopy(workspaceSelected);
15778
15778
  updatedWorkspace.layout = replaceItemInLayout(updatedWorkspace.layout, updatedItem.id, updatedItem);
15779
+
15780
+ // Write through to layer 2 (workspace.selectedProviders[widgetId])
15781
+ // so the bulk-edit modal — which reads via resolveProviderName,
15782
+ // which falls back from layer 1 to layer 2 — sees the change. If
15783
+ // we only write layer 1, an unset here clears layer 1 but leaves
15784
+ // a stale layer-2 value, and the bulk modal renders the OLD
15785
+ // provider as still set (resolveProviderName falls through empty
15786
+ // layer 1 to find layer 2). Matches the canonical-key chain
15787
+ // `applyBulkProviderBindings` uses on the bulk path.
15788
+ var widgetId = updatedItem.uuidString || updatedItem.uuid || updatedItem.id;
15789
+ if (widgetId != null) {
15790
+ var wsKey = String(widgetId);
15791
+ var nextSelectedProviders = _objectSpread$P({}, updatedWorkspace.selectedProviders || {});
15792
+ var prevForWidget = nextSelectedProviders[wsKey] ? _objectSpread$P({}, nextSelectedProviders[wsKey]) : {};
15793
+ if (providerName) {
15794
+ prevForWidget[providerType] = providerName;
15795
+ } else {
15796
+ delete prevForWidget[providerType];
15797
+ }
15798
+ if (Object.keys(prevForWidget).length === 0) {
15799
+ delete nextSelectedProviders[wsKey];
15800
+ } else {
15801
+ nextSelectedProviders[wsKey] = prevForWidget;
15802
+ }
15803
+ updatedWorkspace.selectedProviders = nextSelectedProviders;
15804
+ }
15779
15805
  setItemSelected(function () {
15780
15806
  return updatedItem;
15781
15807
  });
@@ -22686,6 +22712,14 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
22686
22712
  newWorkspace.selectedProviders[uuid] = _objectSpread$J(_objectSpread$J({}, newWorkspace.selectedProviders[uuid] || {}), {}, _defineProperty({}, providerType, providerId));
22687
22713
  }
22688
22714
  setCurrentWorkspace(newWorkspace);
22715
+ // Propagate to the parent (DashboardStage) so workspaceSelected
22716
+ // — what the dashboard config bulk-edit modal reads from —
22717
+ // stays in sync with per-widget provider edits. Mirrors the
22718
+ // pattern in the AI placement / remix handlers above. Without
22719
+ // this, the bulk modal opens with stale provider bindings.
22720
+ if (typeof onWorkspaceChangeRef.current === "function") {
22721
+ onWorkspaceChangeRef.current(newWorkspace);
22722
+ }
22689
22723
  }
22690
22724
  }
22691
22725
  function handleCreateProvider(providerName, credentials) {