@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.esm.js CHANGED
@@ -15758,6 +15758,32 @@ var PanelEditItemProviders = function PanelEditItemProviders(_ref) {
15758
15758
  updatedItem.selectedProviders = nextProviders;
15759
15759
  var updatedWorkspace = deepCopy(workspaceSelected);
15760
15760
  updatedWorkspace.layout = replaceItemInLayout(updatedWorkspace.layout, updatedItem.id, updatedItem);
15761
+
15762
+ // Write through to layer 2 (workspace.selectedProviders[widgetId])
15763
+ // so the bulk-edit modal — which reads via resolveProviderName,
15764
+ // which falls back from layer 1 to layer 2 — sees the change. If
15765
+ // we only write layer 1, an unset here clears layer 1 but leaves
15766
+ // a stale layer-2 value, and the bulk modal renders the OLD
15767
+ // provider as still set (resolveProviderName falls through empty
15768
+ // layer 1 to find layer 2). Matches the canonical-key chain
15769
+ // `applyBulkProviderBindings` uses on the bulk path.
15770
+ var widgetId = updatedItem.uuidString || updatedItem.uuid || updatedItem.id;
15771
+ if (widgetId != null) {
15772
+ var wsKey = String(widgetId);
15773
+ var nextSelectedProviders = _objectSpread$P({}, updatedWorkspace.selectedProviders || {});
15774
+ var prevForWidget = nextSelectedProviders[wsKey] ? _objectSpread$P({}, nextSelectedProviders[wsKey]) : {};
15775
+ if (providerName) {
15776
+ prevForWidget[providerType] = providerName;
15777
+ } else {
15778
+ delete prevForWidget[providerType];
15779
+ }
15780
+ if (Object.keys(prevForWidget).length === 0) {
15781
+ delete nextSelectedProviders[wsKey];
15782
+ } else {
15783
+ nextSelectedProviders[wsKey] = prevForWidget;
15784
+ }
15785
+ updatedWorkspace.selectedProviders = nextSelectedProviders;
15786
+ }
15761
15787
  setItemSelected(function () {
15762
15788
  return updatedItem;
15763
15789
  });
@@ -59925,7 +59951,41 @@ var DashboardStageInner = function DashboardStageInner(_ref3) {
59925
59951
  pageRefsMap.current[pageId] = {
59926
59952
  current: updatedWorkspace
59927
59953
  };
59928
- }, []);
59954
+
59955
+ // Also update the React state so workspaceSelected (which the
59956
+ // dashboard config bulk-edit modal reads) stays in sync. Before
59957
+ // this, page-level edits only flowed into pageRefsMap and the
59958
+ // bulk modal kept rendering pre-edit data — even when the
59959
+ // PanelEditItemProviders fix correctly wrote both layers and
59960
+ // the LayoutBuilder fix correctly propagated up. The data
59961
+ // arrived; it just never reached the React state the bulk
59962
+ // modal subscribes to.
59963
+ //
59964
+ // Mirror the new page's `layout` into the active tab's matching
59965
+ // page, AND bring forward the workspace-level
59966
+ // `selectedProviders` map so layer-2 writes from per-widget
59967
+ // edits land in state the bulk modal can see.
59968
+ if (!activeTabId || !updatedWorkspace) return;
59969
+ setOpenTabs(function (prev) {
59970
+ return prev.map(function (tab) {
59971
+ var _updatedWorkspace$sel;
59972
+ if (tab.id !== activeTabId) return tab;
59973
+ var tabWs = tab.workspace;
59974
+ if (!tabWs) return tab;
59975
+ var nextPages = Array.isArray(tabWs.pages) ? tabWs.pages.map(function (p) {
59976
+ return p && p.id === pageId ? _objectSpread$6(_objectSpread$6({}, p), {}, {
59977
+ layout: updatedWorkspace.layout
59978
+ }) : p;
59979
+ }) : tabWs.pages;
59980
+ return _objectSpread$6(_objectSpread$6({}, tab), {}, {
59981
+ workspace: _objectSpread$6(_objectSpread$6({}, tabWs), {}, {
59982
+ pages: nextPages,
59983
+ selectedProviders: (_updatedWorkspace$sel = updatedWorkspace.selectedProviders) !== null && _updatedWorkspace$sel !== void 0 ? _updatedWorkspace$sel : tabWs.selectedProviders
59984
+ })
59985
+ });
59986
+ });
59987
+ });
59988
+ }, [activeTabId]);
59929
59989
 
59930
59990
  // Keep stable callback refs current
59931
59991
  stableProviderSelectRef.current = handleProviderSelect;