@trops/dash-core 0.1.43 → 0.1.44

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
@@ -14022,6 +14022,37 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
14022
14022
  return cells;
14023
14023
  }
14024
14024
 
14025
+ // Hover-based popout overlay — avoids Tailwind named groups (requires v3.4+)
14026
+ function PopoutOverlay(_ref6) {
14027
+ var children = _ref6.children,
14028
+ onPopout = _ref6.onPopout;
14029
+ var _React$useState = React.useState(false),
14030
+ _React$useState2 = _slicedToArray(_React$useState, 2),
14031
+ hovered = _React$useState2[0],
14032
+ setHovered = _React$useState2[1];
14033
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
14034
+ className: "relative w-full h-full",
14035
+ onMouseEnter: function onMouseEnter() {
14036
+ return setHovered(true);
14037
+ },
14038
+ onMouseLeave: function onMouseLeave() {
14039
+ return setHovered(false);
14040
+ },
14041
+ children: [children, /*#__PURE__*/jsxRuntime.jsx("button", {
14042
+ 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"),
14043
+ onClick: function onClick(e) {
14044
+ e.stopPropagation();
14045
+ onPopout();
14046
+ },
14047
+ title: "Pop out widget",
14048
+ children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
14049
+ icon: "arrow-up-right-from-square",
14050
+ className: "h-3 w-3"
14051
+ })
14052
+ })]
14053
+ });
14054
+ }
14055
+
14025
14056
  // Render component inside a grid cell (preview mode only)
14026
14057
  function renderCellComponent(componentId, cellNumber, selectableSet) {
14027
14058
  if (!layout || !workspace) {
@@ -14035,20 +14066,11 @@ var LayoutGridContainer = /*#__PURE__*/React.memo(function (_ref3) {
14035
14066
  }
14036
14067
  var rendered = renderComponent(cellComponent.component, cellComponent.id, cellComponent, null);
14037
14068
  if (onWidgetPopout && cellComponent.component) {
14038
- return /*#__PURE__*/jsxRuntime.jsxs("div", {
14039
- className: "relative w-full h-full group/popout",
14040
- children: [rendered, /*#__PURE__*/jsxRuntime.jsx("button", {
14041
- className: "absolute top-1 right-1 p-1 rounded opacity-0 group-hover/popout:opacity-100 transition-opacity bg-black/60 hover:bg-black/80 text-gray-300 hover:text-white z-10",
14042
- onClick: function onClick(e) {
14043
- e.stopPropagation();
14044
- onWidgetPopout(cellComponent.id);
14045
- },
14046
- title: "Pop out widget",
14047
- children: /*#__PURE__*/jsxRuntime.jsx(DashReact.FontAwesomeIcon, {
14048
- icon: "arrow-up-right-from-square",
14049
- className: "h-3 w-3"
14050
- })
14051
- })]
14069
+ return /*#__PURE__*/jsxRuntime.jsx(PopoutOverlay, {
14070
+ onPopout: function onPopout() {
14071
+ return onWidgetPopout(cellComponent.id);
14072
+ },
14073
+ children: rendered
14052
14074
  });
14053
14075
  }
14054
14076
  return rendered;