@trops/dash-core 0.1.457 → 0.1.458
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 +56 -43
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +24 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22126,13 +22126,26 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22126
22126
|
// Listen for AI widget builder placement — modifies layout state directly
|
|
22127
22127
|
React.useEffect(function () {
|
|
22128
22128
|
var handler = function handler(e) {
|
|
22129
|
+
var _wsRef$current;
|
|
22129
22130
|
var _ref4 = e.detail || {},
|
|
22130
22131
|
widgetComponentName = _ref4.widgetComponentName,
|
|
22131
22132
|
cellNumber = _ref4.cellNumber,
|
|
22132
|
-
gridItemId = _ref4.gridItemId
|
|
22133
|
+
gridItemId = _ref4.gridItemId,
|
|
22134
|
+
workspaceId = _ref4.workspaceId;
|
|
22133
22135
|
if (!widgetComponentName || !cellNumber || !gridItemId) return;
|
|
22134
22136
|
var ws = wsRef.current;
|
|
22135
22137
|
if (!(ws !== null && ws !== void 0 && ws.layout)) return;
|
|
22138
|
+
|
|
22139
|
+
// Workspace-id guard: multiple LayoutBuilders are mounted (one per
|
|
22140
|
+
// open dashboard tab) and all listen to this global event. If the
|
|
22141
|
+
// event carries a workspaceId, only the matching workspace acts —
|
|
22142
|
+
// otherwise gridItemId collisions across workspaces (small ints)
|
|
22143
|
+
// would let the wrong dashboard handle the placement and silently
|
|
22144
|
+
// overwrite a cell. Older dash-electron versions that don't yet
|
|
22145
|
+
// pass workspaceId fall through (opt-in guard, backward-compatible).
|
|
22146
|
+
if (workspaceId && ((_wsRef$current = wsRef.current) === null || _wsRef$current === void 0 ? void 0 : _wsRef$current.id) !== workspaceId) {
|
|
22147
|
+
return;
|
|
22148
|
+
}
|
|
22136
22149
|
var gridItem = ws.layout.find(function (item) {
|
|
22137
22150
|
return item.id === gridItemId;
|
|
22138
22151
|
});
|
|
@@ -22176,12 +22189,21 @@ var LayoutBuilder = function LayoutBuilder(_ref) {
|
|
|
22176
22189
|
// Listen for AI widget remix — swaps existing widget component in-place
|
|
22177
22190
|
React.useEffect(function () {
|
|
22178
22191
|
var handler = function handler(e) {
|
|
22192
|
+
var _wsRef$current3;
|
|
22179
22193
|
var _ref5 = e.detail || {},
|
|
22180
22194
|
widgetComponentName = _ref5.widgetComponentName,
|
|
22181
|
-
widgetId = _ref5.widgetId
|
|
22195
|
+
widgetId = _ref5.widgetId,
|
|
22196
|
+
workspaceId = _ref5.workspaceId;
|
|
22182
22197
|
if (!widgetComponentName || !widgetId) return;
|
|
22183
22198
|
var ws = wsRef.current;
|
|
22184
22199
|
if (!(ws !== null && ws !== void 0 && ws.layout)) return;
|
|
22200
|
+
|
|
22201
|
+
// Same workspace-id guard as the place-widget handler — keeps
|
|
22202
|
+
// the swap from acting on a different open dashboard's widget
|
|
22203
|
+
// when widgetIds collide across workspaces.
|
|
22204
|
+
if (workspaceId && ((_wsRef$current3 = wsRef.current) === null || _wsRef$current3 === void 0 ? void 0 : _wsRef$current3.id) !== workspaceId) {
|
|
22205
|
+
return;
|
|
22206
|
+
}
|
|
22185
22207
|
var config = ComponentManager.config(widgetComponentName);
|
|
22186
22208
|
if (!config) {
|
|
22187
22209
|
return;
|