analytica-frontend-lib 1.1.50 → 1.1.52

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
@@ -7181,6 +7181,7 @@ var NotFound_default = NotFound;
7181
7181
 
7182
7182
  // src/components/VideoPlayer/VideoPlayer.tsx
7183
7183
  var import_react25 = require("react");
7184
+ var import_react_dom = require("react-dom");
7184
7185
  var import_phosphor_react18 = require("phosphor-react");
7185
7186
  var import_jsx_runtime37 = require("react/jsx-runtime");
7186
7187
  var CONTROLS_HIDE_TIMEOUT = 3e3;
@@ -7247,30 +7248,63 @@ var SpeedMenu = ({
7247
7248
  showSpeedMenu,
7248
7249
  playbackRate,
7249
7250
  onToggleMenu,
7250
- onSpeedChange
7251
- }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "relative", children: [
7252
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
7253
- IconButton_default,
7251
+ onSpeedChange,
7252
+ isFullscreen
7253
+ }) => {
7254
+ const buttonRef = (0, import_react25.useRef)(null);
7255
+ const getMenuPosition = () => {
7256
+ if (!buttonRef.current) return { top: 0, left: 0 };
7257
+ const rect = buttonRef.current.getBoundingClientRect();
7258
+ return {
7259
+ // Fixed coords are viewport-based — no scroll offsets.
7260
+ top: Math.max(8, rect.top - 180),
7261
+ left: Math.max(8, rect.right - 80)
7262
+ };
7263
+ };
7264
+ const position = getMenuPosition();
7265
+ const menuContent = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
7266
+ "div",
7254
7267
  {
7255
- icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.DotsThreeVertical, { size: 24 }),
7256
- onClick: onToggleMenu,
7268
+ role: "menu",
7257
7269
  "aria-label": "Playback speed",
7258
- className: "!bg-transparent !text-white hover:!bg-white/20"
7270
+ className: isFullscreen ? "absolute bottom-12 right-0 bg-black/90 rounded-lg p-2 min-w-20 z-[9999]" : "fixed bg-black/90 rounded-lg p-2 min-w-20 z-[9999]",
7271
+ style: !isFullscreen ? {
7272
+ top: `${position.top}px`,
7273
+ left: `${position.left}px`
7274
+ } : void 0,
7275
+ children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
7276
+ "button",
7277
+ {
7278
+ role: "menuitemradio",
7279
+ "aria-checked": playbackRate === speed,
7280
+ onClick: () => onSpeedChange(speed),
7281
+ className: `block w-full text-left px-3 py-1 text-sm rounded hover:bg-white/20 transition-colors ${playbackRate === speed ? "text-primary-400" : "text-white"}`,
7282
+ children: [
7283
+ speed,
7284
+ "x"
7285
+ ]
7286
+ },
7287
+ speed
7288
+ ))
7259
7289
  }
7260
- ),
7261
- showSpeedMenu && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "absolute bottom-12 right-0 bg-black/90 rounded-lg p-2 min-w-20", children: [0.5, 0.75, 1, 1.25, 1.5, 2].map((speed) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
7262
- "button",
7263
- {
7264
- onClick: () => onSpeedChange(speed),
7265
- className: `block w-full text-left px-3 py-1 text-sm rounded hover:bg-white/20 transition-colors ${playbackRate === speed ? "text-primary-400" : "text-white"}`,
7266
- children: [
7267
- speed,
7268
- "x"
7269
- ]
7270
- },
7271
- speed
7272
- )) })
7273
- ] });
7290
+ );
7291
+ const portalContent = typeof window !== "undefined" && typeof document !== "undefined" ? (0, import_react_dom.createPortal)(menuContent, document.body) : null;
7292
+ return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "relative", children: [
7293
+ /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
7294
+ IconButton_default,
7295
+ {
7296
+ ref: buttonRef,
7297
+ icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_phosphor_react18.DotsThreeVertical, { size: 24 }),
7298
+ onClick: onToggleMenu,
7299
+ "aria-label": "Playback speed",
7300
+ "aria-haspopup": "menu",
7301
+ "aria-expanded": showSpeedMenu,
7302
+ className: "!bg-transparent !text-white hover:!bg-white/20"
7303
+ }
7304
+ ),
7305
+ showSpeedMenu && (isFullscreen ? menuContent : portalContent)
7306
+ ] });
7307
+ };
7274
7308
  var VideoPlayer = ({
7275
7309
  src,
7276
7310
  poster,
@@ -7810,7 +7844,8 @@ var VideoPlayer = ({
7810
7844
  showSpeedMenu,
7811
7845
  playbackRate,
7812
7846
  onToggleMenu: toggleSpeedMenu,
7813
- onSpeedChange: handleSpeedChange
7847
+ onSpeedChange: handleSpeedChange,
7848
+ isFullscreen
7814
7849
  }
7815
7850
  ) })
7816
7851
  ] })
@@ -11044,7 +11079,7 @@ var NotificationCenter = ({
11044
11079
  onRetry,
11045
11080
  onMarkAsReadById,
11046
11081
  onDeleteById,
11047
- onNavigateById: (entityType, entityId) => handleNavigate(entityType, entityId, onToggleActive),
11082
+ onNavigateById: (entityType, entityId) => handleNavigate(entityType, entityId),
11048
11083
  getActionLabel,
11049
11084
  renderEmpty: renderEmptyState
11050
11085
  }