@trops/dash-core 0.1.43 → 0.1.45
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/electron/index.js +6 -0
- package/dist/electron/index.js.map +1 -1
- package/dist/index.esm.js +66 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +66 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -103,14 +103,36 @@ var event = {
|
|
|
103
103
|
this.list = new Map();
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
|
+
var ipcBridgeListener = null;
|
|
106
107
|
var DashboardPublisher = {
|
|
107
108
|
sub: function sub(eventType, action, uuid) {
|
|
108
109
|
event.on(eventType, action, uuid);
|
|
109
110
|
},
|
|
110
111
|
pub: function pub(eventType, content) {
|
|
112
|
+
var _window$mainApi;
|
|
111
113
|
event.emit(eventType, content);
|
|
112
|
-
|
|
113
|
-
//
|
|
114
|
+
|
|
115
|
+
// Forward to other windows via IPC bridge
|
|
116
|
+
if ((_window$mainApi = window.mainApi) !== null && _window$mainApi !== void 0 && _window$mainApi.widgetEvent) {
|
|
117
|
+
window.mainApi.widgetEvent.publish(eventType, content);
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
enableIpcBridge: function enableIpcBridge() {
|
|
121
|
+
var _window$mainApi2;
|
|
122
|
+
if (ipcBridgeListener) return;
|
|
123
|
+
if (!((_window$mainApi2 = window.mainApi) !== null && _window$mainApi2 !== void 0 && _window$mainApi2.on)) return;
|
|
124
|
+
ipcBridgeListener = function ipcBridgeListener(_e, message) {
|
|
125
|
+
event.emit(message.eventType, message.content);
|
|
126
|
+
};
|
|
127
|
+
window.mainApi.on("widget-event:broadcast", ipcBridgeListener);
|
|
128
|
+
},
|
|
129
|
+
disableIpcBridge: function disableIpcBridge() {
|
|
130
|
+
var _window$mainApi3;
|
|
131
|
+
if (!ipcBridgeListener) return;
|
|
132
|
+
if ((_window$mainApi3 = window.mainApi) !== null && _window$mainApi3 !== void 0 && _window$mainApi3.removeListener) {
|
|
133
|
+
window.mainApi.removeListener("widget-event:broadcast", ipcBridgeListener);
|
|
134
|
+
}
|
|
135
|
+
ipcBridgeListener = null;
|
|
114
136
|
},
|
|
115
137
|
listeners: function listeners() {
|
|
116
138
|
return event.list;
|
|
@@ -2452,6 +2474,12 @@ var DashboardWrapper = function DashboardWrapper(_ref) {
|
|
|
2452
2474
|
w.setElectronApi(dashApi);
|
|
2453
2475
|
return w;
|
|
2454
2476
|
}, [dashApi]);
|
|
2477
|
+
useEffect(function () {
|
|
2478
|
+
DashboardPublisher.enableIpcBridge();
|
|
2479
|
+
return function () {
|
|
2480
|
+
return DashboardPublisher.disableIpcBridge();
|
|
2481
|
+
};
|
|
2482
|
+
}, []);
|
|
2455
2483
|
var providers = (appContext === null || appContext === void 0 ? void 0 : appContext.providers) || EMPTY_PROVIDERS;
|
|
2456
2484
|
var contextValue = useMemo(function () {
|
|
2457
2485
|
return {
|
|
@@ -14003,6 +14031,37 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
|
|
|
14003
14031
|
return cells;
|
|
14004
14032
|
}
|
|
14005
14033
|
|
|
14034
|
+
// Hover-based popout overlay — avoids Tailwind named groups (requires v3.4+)
|
|
14035
|
+
function PopoutOverlay(_ref6) {
|
|
14036
|
+
var children = _ref6.children,
|
|
14037
|
+
onPopout = _ref6.onPopout;
|
|
14038
|
+
var _React$useState = React__default.useState(false),
|
|
14039
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
14040
|
+
hovered = _React$useState2[0],
|
|
14041
|
+
setHovered = _React$useState2[1];
|
|
14042
|
+
return /*#__PURE__*/jsxs("div", {
|
|
14043
|
+
className: "relative w-full h-full",
|
|
14044
|
+
onMouseEnter: function onMouseEnter() {
|
|
14045
|
+
return setHovered(true);
|
|
14046
|
+
},
|
|
14047
|
+
onMouseLeave: function onMouseLeave() {
|
|
14048
|
+
return setHovered(false);
|
|
14049
|
+
},
|
|
14050
|
+
children: [children, /*#__PURE__*/jsx("button", {
|
|
14051
|
+
className: "absolute top-1 right-1 p-1 rounded transition-opacity bg-black/60 hover:bg-black/80 text-gray-300 hover:text-white z-10 ".concat(hovered ? "opacity-100" : "opacity-0 pointer-events-none"),
|
|
14052
|
+
onClick: function onClick(e) {
|
|
14053
|
+
e.stopPropagation();
|
|
14054
|
+
onPopout();
|
|
14055
|
+
},
|
|
14056
|
+
title: "Pop out widget",
|
|
14057
|
+
children: /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
14058
|
+
icon: "arrow-up-right-from-square",
|
|
14059
|
+
className: "h-3 w-3"
|
|
14060
|
+
})
|
|
14061
|
+
})]
|
|
14062
|
+
});
|
|
14063
|
+
}
|
|
14064
|
+
|
|
14006
14065
|
// Render component inside a grid cell (preview mode only)
|
|
14007
14066
|
function renderCellComponent(componentId, cellNumber, selectableSet) {
|
|
14008
14067
|
if (!layout || !workspace) {
|
|
@@ -14016,20 +14075,11 @@ var LayoutGridContainer = /*#__PURE__*/memo(function (_ref3) {
|
|
|
14016
14075
|
}
|
|
14017
14076
|
var rendered = renderComponent(cellComponent.component, cellComponent.id, cellComponent, null);
|
|
14018
14077
|
if (onWidgetPopout && cellComponent.component) {
|
|
14019
|
-
return /*#__PURE__*/
|
|
14020
|
-
|
|
14021
|
-
|
|
14022
|
-
|
|
14023
|
-
|
|
14024
|
-
e.stopPropagation();
|
|
14025
|
-
onWidgetPopout(cellComponent.id);
|
|
14026
|
-
},
|
|
14027
|
-
title: "Pop out widget",
|
|
14028
|
-
children: /*#__PURE__*/jsx(FontAwesomeIcon, {
|
|
14029
|
-
icon: "arrow-up-right-from-square",
|
|
14030
|
-
className: "h-3 w-3"
|
|
14031
|
-
})
|
|
14032
|
-
})]
|
|
14078
|
+
return /*#__PURE__*/jsx(PopoutOverlay, {
|
|
14079
|
+
onPopout: function onPopout() {
|
|
14080
|
+
return onWidgetPopout(cellComponent.id);
|
|
14081
|
+
},
|
|
14082
|
+
children: rendered
|
|
14033
14083
|
});
|
|
14034
14084
|
}
|
|
14035
14085
|
return rendered;
|