analytica-frontend-lib 1.1.57 → 1.1.59

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.
Files changed (47) hide show
  1. package/dist/Accordation/index.js +20 -2
  2. package/dist/Accordation/index.js.map +1 -1
  3. package/dist/Accordation/index.mjs +22 -3
  4. package/dist/Accordation/index.mjs.map +1 -1
  5. package/dist/Card/index.js +20 -2
  6. package/dist/Card/index.js.map +1 -1
  7. package/dist/Card/index.mjs +22 -3
  8. package/dist/Card/index.mjs.map +1 -1
  9. package/dist/DropdownMenu/index.js +1 -1
  10. package/dist/DropdownMenu/index.js.map +1 -1
  11. package/dist/DropdownMenu/index.mjs +1 -1
  12. package/dist/DropdownMenu/index.mjs.map +1 -1
  13. package/dist/NotificationCard/index.js +1 -1
  14. package/dist/NotificationCard/index.js.map +1 -1
  15. package/dist/NotificationCard/index.mjs +1 -1
  16. package/dist/NotificationCard/index.mjs.map +1 -1
  17. package/dist/Quiz/index.js +20 -2
  18. package/dist/Quiz/index.js.map +1 -1
  19. package/dist/Quiz/index.mjs +32 -13
  20. package/dist/Quiz/index.mjs.map +1 -1
  21. package/dist/Search/index.js +1 -1
  22. package/dist/Search/index.js.map +1 -1
  23. package/dist/Search/index.mjs +1 -1
  24. package/dist/Search/index.mjs.map +1 -1
  25. package/dist/SubjectInfo/index.d.mts +2 -0
  26. package/dist/SubjectInfo/index.d.ts +2 -0
  27. package/dist/SubjectInfo/index.js +313 -0
  28. package/dist/SubjectInfo/index.js.map +1 -0
  29. package/dist/SubjectInfo/index.mjs +293 -0
  30. package/dist/SubjectInfo/index.mjs.map +1 -0
  31. package/dist/SubjectInfo-DZvZ5alE.d.mts +37 -0
  32. package/dist/SubjectInfo-DZvZ5alE.d.ts +37 -0
  33. package/dist/VideoPlayer/index.js +20 -1
  34. package/dist/VideoPlayer/index.js.map +1 -1
  35. package/dist/VideoPlayer/index.mjs +20 -1
  36. package/dist/VideoPlayer/index.mjs.map +1 -1
  37. package/dist/index.css +73 -12
  38. package/dist/index.css.map +1 -1
  39. package/dist/index.d.mts +1 -0
  40. package/dist/index.d.ts +1 -0
  41. package/dist/index.js +727 -382
  42. package/dist/index.js.map +1 -1
  43. package/dist/index.mjs +758 -407
  44. package/dist/index.mjs.map +1 -1
  45. package/dist/styles.css +73 -12
  46. package/dist/styles.css.map +1 -1
  47. package/package.json +2 -1
@@ -3,7 +3,8 @@ import {
3
3
  forwardRef,
4
4
  Fragment as Fragment2,
5
5
  useState,
6
- useRef
6
+ useRef,
7
+ useEffect
7
8
  } from "react";
8
9
 
9
10
  // src/utils/utils.ts
@@ -1542,6 +1543,8 @@ var CardAudio = forwardRef(
1542
1543
  const [showSpeedMenu, setShowSpeedMenu] = useState(false);
1543
1544
  const [playbackRate, setPlaybackRate] = useState(1);
1544
1545
  const audioRef = useRef(null);
1546
+ const volumeControlRef = useRef(null);
1547
+ const speedMenuRef = useRef(null);
1545
1548
  const formatTime = (time) => {
1546
1549
  const minutes = Math.floor(time / 60);
1547
1550
  const seconds = Math.floor(time % 60);
@@ -1593,9 +1596,11 @@ var CardAudio = forwardRef(
1593
1596
  };
1594
1597
  const toggleVolumeControl = () => {
1595
1598
  setShowVolumeControl(!showVolumeControl);
1599
+ setShowSpeedMenu(false);
1596
1600
  };
1597
1601
  const toggleSpeedMenu = () => {
1598
1602
  setShowSpeedMenu(!showSpeedMenu);
1603
+ setShowVolumeControl(false);
1599
1604
  };
1600
1605
  const handleSpeedChange = (speed) => {
1601
1606
  setPlaybackRate(speed);
@@ -1613,6 +1618,20 @@ var CardAudio = forwardRef(
1613
1618
  }
1614
1619
  return /* @__PURE__ */ jsx6(SpeakerHigh, { size: 24 });
1615
1620
  };
1621
+ useEffect(() => {
1622
+ const handleClickOutside = (event) => {
1623
+ if (volumeControlRef.current && !volumeControlRef.current.contains(event.target)) {
1624
+ setShowVolumeControl(false);
1625
+ }
1626
+ if (speedMenuRef.current && !speedMenuRef.current.contains(event.target)) {
1627
+ setShowSpeedMenu(false);
1628
+ }
1629
+ };
1630
+ document.addEventListener("mousedown", handleClickOutside);
1631
+ return () => {
1632
+ document.removeEventListener("mousedown", handleClickOutside);
1633
+ };
1634
+ }, []);
1616
1635
  return /* @__PURE__ */ jsxs5(
1617
1636
  CardBase,
1618
1637
  {
@@ -1701,7 +1720,7 @@ var CardAudio = forwardRef(
1701
1720
  }
1702
1721
  ) }),
1703
1722
  /* @__PURE__ */ jsx6("p", { className: "text-text-800 text-md font-medium min-w-[2.5rem]", children: formatTime(duration) }),
1704
- /* @__PURE__ */ jsxs5("div", { className: "relative h-6", children: [
1723
+ /* @__PURE__ */ jsxs5("div", { className: "relative h-6", ref: volumeControlRef, children: [
1705
1724
  /* @__PURE__ */ jsx6(
1706
1725
  "button",
1707
1726
  {
@@ -1763,7 +1782,7 @@ var CardAudio = forwardRef(
1763
1782
  }
1764
1783
  )
1765
1784
  ] }),
1766
- /* @__PURE__ */ jsxs5("div", { className: "relative h-6", children: [
1785
+ /* @__PURE__ */ jsxs5("div", { className: "relative h-6", ref: speedMenuRef, children: [
1767
1786
  /* @__PURE__ */ jsx6(
1768
1787
  "button",
1769
1788
  {