@trops/dash-core 0.1.467 → 0.1.469

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
  });
@@ -59943,7 +59969,41 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
59943
59969
  pageRefsMap.current[pageId] = {
59944
59970
  current: updatedWorkspace
59945
59971
  };
59946
- }, []);
59972
+
59973
+ // Also update the React state so workspaceSelected (which the
59974
+ // dashboard config bulk-edit modal reads) stays in sync. Before
59975
+ // this, page-level edits only flowed into pageRefsMap and the
59976
+ // bulk modal kept rendering pre-edit data — even when the
59977
+ // PanelEditItemProviders fix correctly wrote both layers and
59978
+ // the LayoutBuilder fix correctly propagated up. The data
59979
+ // arrived; it just never reached the React state the bulk
59980
+ // modal subscribes to.
59981
+ //
59982
+ // Mirror the new page's `layout` into the active tab's matching
59983
+ // page, AND bring forward the workspace-level
59984
+ // `selectedProviders` map so layer-2 writes from per-widget
59985
+ // edits land in state the bulk modal can see.
59986
+ if (!activeTabId || !updatedWorkspace) return;
59987
+ setOpenTabs(function (prev) {
59988
+ return prev.map(function (tab) {
59989
+ var _updatedWorkspace$sel;
59990
+ if (tab.id !== activeTabId) return tab;
59991
+ var tabWs = tab.workspace;
59992
+ if (!tabWs) return tab;
59993
+ var nextPages = Array.isArray(tabWs.pages) ? tabWs.pages.map(function (p) {
59994
+ return p && p.id === pageId ? _objectSpread$6(_objectSpread$6({}, p), {}, {
59995
+ layout: updatedWorkspace.layout
59996
+ }) : p;
59997
+ }) : tabWs.pages;
59998
+ return _objectSpread$6(_objectSpread$6({}, tab), {}, {
59999
+ workspace: _objectSpread$6(_objectSpread$6({}, tabWs), {}, {
60000
+ pages: nextPages,
60001
+ selectedProviders: (_updatedWorkspace$sel = updatedWorkspace.selectedProviders) !== null && _updatedWorkspace$sel !== void 0 ? _updatedWorkspace$sel : tabWs.selectedProviders
60002
+ })
60003
+ });
60004
+ });
60005
+ });
60006
+ }, [activeTabId]);
59947
60007
 
59948
60008
  // Keep stable callback refs current
59949
60009
  stableProviderSelectRef.current = handleProviderSelect;