analytica-frontend-lib 1.1.85 → 1.1.87

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
@@ -8707,6 +8707,8 @@ var VideoPlayer = ({
8707
8707
  }
8708
8708
  }, [isPlaying, isFullscreen, showControlsWithTimer, clearControlsTimeout]);
8709
8709
  (0, import_react27.useEffect)(() => {
8710
+ const video = videoRef.current;
8711
+ if (!video) return;
8710
8712
  const handleFullscreenChange = () => {
8711
8713
  const isCurrentlyFullscreen = !!document.fullscreenElement;
8712
8714
  setIsFullscreen(isCurrentlyFullscreen);
@@ -8714,9 +8716,29 @@ var VideoPlayer = ({
8714
8716
  showControlsWithTimer();
8715
8717
  }
8716
8718
  };
8719
+ const handleWebkitBeginFullscreen = () => {
8720
+ setIsFullscreen(true);
8721
+ showControlsWithTimer();
8722
+ };
8723
+ const handleWebkitEndFullscreen = () => {
8724
+ setIsFullscreen(false);
8725
+ };
8717
8726
  document.addEventListener("fullscreenchange", handleFullscreenChange);
8727
+ video.addEventListener(
8728
+ "webkitbeginfullscreen",
8729
+ handleWebkitBeginFullscreen
8730
+ );
8731
+ video.addEventListener("webkitendfullscreen", handleWebkitEndFullscreen);
8718
8732
  return () => {
8719
8733
  document.removeEventListener("fullscreenchange", handleFullscreenChange);
8734
+ video.removeEventListener(
8735
+ "webkitbeginfullscreen",
8736
+ handleWebkitBeginFullscreen
8737
+ );
8738
+ video.removeEventListener(
8739
+ "webkitendfullscreen",
8740
+ handleWebkitEndFullscreen
8741
+ );
8720
8742
  };
8721
8743
  }, [showControlsWithTimer]);
8722
8744
  (0, import_react27.useEffect)(() => {
@@ -8823,15 +8845,30 @@ var VideoPlayer = ({
8823
8845
  video.currentTime = newTime;
8824
8846
  }
8825
8847
  }, []);
8848
+ const isSafariIOS = (0, import_react27.useCallback)(() => {
8849
+ const ua = navigator.userAgent;
8850
+ const isIOS = /iPad|iPhone|iPod/.test(ua);
8851
+ const isWebKit = /WebKit/.test(ua);
8852
+ const isNotChrome = !/CriOS|Chrome/.test(ua);
8853
+ return isIOS && isWebKit && isNotChrome;
8854
+ }, []);
8826
8855
  const toggleFullscreen = (0, import_react27.useCallback)(() => {
8827
- const container = videoRef.current?.parentElement;
8828
- if (!container) return;
8829
- if (!isFullscreen && container.requestFullscreen) {
8856
+ const video = videoRef.current;
8857
+ const container = video?.parentElement;
8858
+ if (!video || !container) return;
8859
+ if (isSafariIOS()) {
8860
+ const videoElement = video;
8861
+ if (!isFullscreen && videoElement.webkitEnterFullscreen) {
8862
+ videoElement.webkitEnterFullscreen();
8863
+ } else if (isFullscreen && videoElement.webkitExitFullscreen) {
8864
+ videoElement.webkitExitFullscreen();
8865
+ }
8866
+ } else if (!isFullscreen && container.requestFullscreen) {
8830
8867
  container.requestFullscreen();
8831
8868
  } else if (isFullscreen && document.exitFullscreen) {
8832
8869
  document.exitFullscreen();
8833
8870
  }
8834
- }, [isFullscreen]);
8871
+ }, [isFullscreen, isSafariIOS]);
8835
8872
  const handleSpeedChange = (0, import_react27.useCallback)((speed) => {
8836
8873
  if (videoRef.current) {
8837
8874
  videoRef.current.playbackRate = speed;
@@ -9240,7 +9277,7 @@ var Whiteboard = ({
9240
9277
  "div",
9241
9278
  {
9242
9279
  className: cn(
9243
- "flex items-center justify-center p-8 bg-background border border-gray-100 rounded-xl",
9280
+ "flex items-center justify-center p-8 bg-background border border-border-50 rounded-xl",
9244
9281
  className
9245
9282
  ),
9246
9283
  ...rest,
@@ -9252,7 +9289,7 @@ var Whiteboard = ({
9252
9289
  "div",
9253
9290
  {
9254
9291
  className: cn(
9255
- "flex flex-col bg-background border border-gray-100 p-4 gap-2 rounded-xl w-fit mx-auto",
9292
+ "flex flex-col bg-background border border-border-50 p-4 gap-2 rounded-xl w-fit mx-auto",
9256
9293
  className
9257
9294
  ),
9258
9295
  ...rest,