@comet/site-react 8.8.0-canary-20251127134721 → 8.8.0-canary-20251127144258

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.
@@ -1,5 +1,6 @@
1
- import { ReactElement, ReactNode } from 'react';
1
+ import { ComponentType, ReactElement, ReactNode } from 'react';
2
2
  import { DamVideoBlockData } from '../blocks.generated';
3
+ import { PlayPauseButtonProps } from './helpers/PlayPauseButton';
3
4
  import { VideoPreviewImageProps } from './helpers/VideoPreviewImage';
4
5
  import { PropsWithData } from './PropsWithData';
5
6
  interface DamVideoBlockProps extends PropsWithData<DamVideoBlockData> {
@@ -9,6 +10,8 @@ interface DamVideoBlockProps extends PropsWithData<DamVideoBlockData> {
9
10
  fill?: boolean;
10
11
  previewImageIcon?: ReactNode;
11
12
  playButtonAriaLabel?: string;
13
+ pauseButtonAriaLabel?: string;
14
+ playPauseButton?: ComponentType<PlayPauseButtonProps>;
12
15
  }
13
16
  export declare const DamVideoBlock: ({ ...componentProps }: import('../iframebridge/withPreview').WithPreviewProps & DamVideoBlockProps) => import("react/jsx-runtime").JSX.Element;
14
17
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"DamVideoBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/DamVideoBlock.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAoB,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAK7D,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,UAAU,kBAAmB,SAAQ,aAAa,CAAC,iBAAiB,CAAC;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,YAAY,CAAC;IACpE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,eAAO,MAAM,aAAa,iJA8DzB,CAAC"}
1
+ {"version":3,"file":"DamVideoBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/DamVideoBlock.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAyB,MAAM,OAAO,CAAC;AAErG,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAI7D,OAAO,EAAmB,KAAK,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEvF,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,UAAU,kBAAmB,SAAQ,aAAa,CAAC,iBAAiB,CAAC;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,YAAY,CAAC;IACpE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CACzD;AAED,eAAO,MAAM,aAAa,iJA+FzB,CAAC"}
@@ -1,10 +1,11 @@
1
1
  "use client";
2
2
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
3
  import clsx from "clsx";
4
- import { useState, useRef } from "react";
4
+ import { useState, useCallback } from "react";
5
5
  import { withPreview } from "../iframebridge/withPreview.js";
6
6
  import { PreviewSkeleton } from "../previewskeleton/PreviewSkeleton.js";
7
7
  import styles from "./DamVideoBlock.module.scss.js";
8
+ import { PlayPauseButton } from "./helpers/PlayPauseButton.js";
8
9
  import { useIsElementInViewport } from "./helpers/useIsElementInViewport.js";
9
10
  const DamVideoBlock = withPreview(
10
11
  ({
@@ -14,24 +15,42 @@ const DamVideoBlock = withPreview(
14
15
  renderPreviewImage,
15
16
  fill,
16
17
  previewImageIcon,
17
- playButtonAriaLabel
18
+ playButtonAriaLabel,
19
+ pauseButtonAriaLabel,
20
+ playPauseButton: PlayPauseButtonComponent
18
21
  }) => {
19
22
  var _a;
20
23
  if (damFile === void 0) {
21
24
  return /* @__PURE__ */ jsx(PreviewSkeleton, { type: "media", hasContent: false, aspectRatio });
22
25
  }
23
26
  const [showPreviewImage, setShowPreviewImage] = useState(true);
27
+ const [isHandledManually, setIsHandledManually] = useState(!autoplay);
24
28
  const hasPreviewImage = Boolean(previewImage && previewImage.damFile);
25
- const videoRef = useRef(null);
26
- useIsElementInViewport(videoRef, (inView) => {
27
- if (autoplay && videoRef.current) {
28
- if (inView) {
29
- videoRef.current.play();
29
+ const [videoElement, setVideoElement] = useState(null);
30
+ const videoRef = setVideoElement;
31
+ const handleInView = useCallback(
32
+ (inView) => {
33
+ if (autoplay && videoElement && !isHandledManually) {
34
+ if (inView) {
35
+ videoElement.play();
36
+ } else {
37
+ videoElement.pause();
38
+ }
39
+ }
40
+ },
41
+ [autoplay, isHandledManually, videoElement]
42
+ );
43
+ useIsElementInViewport({ current: videoElement }, handleInView);
44
+ const handlePlayPauseClick = () => {
45
+ setIsHandledManually(!isHandledManually);
46
+ if (videoElement) {
47
+ if (videoElement.paused) {
48
+ videoElement.play();
30
49
  } else {
31
- videoRef.current.pause();
50
+ videoElement.pause();
32
51
  }
33
52
  }
34
- });
53
+ };
35
54
  return /* @__PURE__ */ jsx(Fragment, { children: hasPreviewImage && showPreviewImage ? renderPreviewImage({
36
55
  onPlay: () => setShowPreviewImage(false),
37
56
  image: previewImage,
@@ -40,25 +59,36 @@ const DamVideoBlock = withPreview(
40
59
  fill,
41
60
  icon: previewImageIcon,
42
61
  playButtonAriaLabel
43
- }) : /* @__PURE__ */ jsxs(
44
- "video",
45
- {
46
- autoPlay: autoplay || hasPreviewImage && !showPreviewImage,
47
- controls: showControls,
48
- loop,
49
- playsInline: true,
50
- muted: autoplay,
51
- ref: videoRef,
52
- className: clsx(styles.video, fill && styles.fill),
53
- style: !fill ? { "--aspect-ratio": aspectRatio.replace("x", " / ") } : void 0,
54
- children: [
55
- (_a = damFile.captions) == null ? void 0 : _a.map((caption) => {
56
- return /* @__PURE__ */ jsx("track", { src: caption.fileUrl, kind: "captions", srcLang: caption.language }, caption.id);
57
- }),
58
- /* @__PURE__ */ jsx("source", { src: damFile.fileUrl, type: damFile.mimetype })
59
- ]
60
- }
61
- ) });
62
+ }) : /* @__PURE__ */ jsxs("div", { className: styles.root, children: [
63
+ /* @__PURE__ */ jsxs(
64
+ "video",
65
+ {
66
+ autoPlay: autoplay || hasPreviewImage && !showPreviewImage,
67
+ controls: showControls,
68
+ loop,
69
+ playsInline: true,
70
+ muted: autoplay,
71
+ ref: videoRef,
72
+ className: clsx(styles.video, fill && styles.fill),
73
+ style: !fill ? { "--aspect-ratio": aspectRatio.replace("x", " / ") } : void 0,
74
+ children: [
75
+ (_a = damFile.captions) == null ? void 0 : _a.map((caption) => {
76
+ return /* @__PURE__ */ jsx("track", { src: caption.fileUrl, kind: "captions", srcLang: caption.language }, caption.id);
77
+ }),
78
+ /* @__PURE__ */ jsx("source", { src: damFile.fileUrl, type: damFile.mimetype })
79
+ ]
80
+ }
81
+ ),
82
+ !showControls && (PlayPauseButtonComponent ? /* @__PURE__ */ jsx(PlayPauseButtonComponent, { isPlaying: isHandledManually, onClick: handlePlayPauseClick }) : /* @__PURE__ */ jsx(
83
+ PlayPauseButton,
84
+ {
85
+ isPlaying: isHandledManually,
86
+ onClick: handlePlayPauseClick,
87
+ ariaLabelPlay: playButtonAriaLabel,
88
+ ariaLabelPause: pauseButtonAriaLabel
89
+ }
90
+ ))
91
+ ] }) });
62
92
  },
63
93
  { label: "Video" }
64
94
  );
@@ -1,11 +1,14 @@
1
- const video = "_video_17b8y_1";
2
- const fill = "_fill_17b8y_7";
1
+ const root = "_root_8r6od_1";
2
+ const video = "_video_8r6od_5";
3
+ const fill = "_fill_8r6od_11";
3
4
  const styles = {
5
+ root,
4
6
  video,
5
7
  fill
6
8
  };
7
9
  export {
8
10
  styles as default,
9
11
  fill,
12
+ root,
10
13
  video
11
14
  };
@@ -1,5 +1,6 @@
1
- import { ReactElement, ReactNode } from 'react';
1
+ import { ComponentType, ReactElement, ReactNode } from 'react';
2
2
  import { VimeoVideoBlockData } from '../blocks.generated';
3
+ import { PlayPauseButtonProps } from './helpers/PlayPauseButton';
3
4
  import { VideoPreviewImageProps } from './helpers/VideoPreviewImage';
4
5
  import { PropsWithData } from './PropsWithData';
5
6
  interface VimeoVideoBlockProps extends PropsWithData<VimeoVideoBlockData> {
@@ -9,6 +10,8 @@ interface VimeoVideoBlockProps extends PropsWithData<VimeoVideoBlockData> {
9
10
  fill?: boolean;
10
11
  previewImageIcon?: ReactNode;
11
12
  playButtonAriaLabel?: string;
13
+ pauseButtonAriaLabel?: string;
14
+ playPauseButton?: ComponentType<PlayPauseButtonProps>;
12
15
  }
13
16
  export declare const VimeoVideoBlock: ({ ...componentProps }: import('../iframebridge/withPreview').WithPreviewProps & VimeoVideoBlockProps) => import("react/jsx-runtime").JSX.Element;
14
17
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"VimeoVideoBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/VimeoVideoBlock.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAoB,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAI/D,OAAO,EAAE,KAAK,sBAAs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CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CACzD;AAED,eAAO,MAAM,eAAe,mJAgH3B,CAAC"}
@@ -1,9 +1,10 @@
1
1
  "use client";
2
- import { jsx, Fragment } from "react/jsx-runtime";
2
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
3
  import clsx from "clsx";
4
- import { useState, useRef } from "react";
4
+ import { useState, useRef, useCallback } from "react";
5
5
  import { withPreview } from "../iframebridge/withPreview.js";
6
6
  import { PreviewSkeleton } from "../previewskeleton/PreviewSkeleton.js";
7
+ import { PlayPauseButton } from "./helpers/PlayPauseButton.js";
7
8
  import { useIsElementInViewport } from "./helpers/useIsElementInViewport.js";
8
9
  import styles from "./VimeoVideoBlock.module.scss.js";
9
10
  function parseVimeoIdentifier(vimeoIdentifier) {
@@ -26,20 +27,37 @@ const VimeoVideoBlock = withPreview(
26
27
  renderPreviewImage,
27
28
  fill,
28
29
  previewImageIcon,
29
- playButtonAriaLabel
30
+ playButtonAriaLabel,
31
+ pauseButtonAriaLabel,
32
+ playPauseButton: PlayPauseButtonComponent
30
33
  }) => {
31
34
  const [showPreviewImage, setShowPreviewImage] = useState(true);
32
35
  const hasPreviewImage = !!(previewImage && previewImage.damFile);
33
36
  const inViewRef = useRef(null);
34
- const iframeRef = useRef(null);
35
- const handleVisibilityChange = (isVisible) => {
36
- var _a, _b;
37
- (_b = (_a = iframeRef.current) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.postMessage(
38
- JSON.stringify({ method: isVisible && autoplay ? "play" : "pause" }),
39
- "https://player.vimeo.com"
40
- );
41
- };
42
- useIsElementInViewport(inViewRef, handleVisibilityChange);
37
+ const [iframeElement, setIframeElement] = useState(null);
38
+ const iframeRef = setIframeElement;
39
+ const [isHandledManually, setIsHandledManually] = useState(!autoplay);
40
+ const pauseVimeoVideo = useCallback(() => {
41
+ var _a;
42
+ (_a = iframeElement == null ? void 0 : iframeElement.contentWindow) == null ? void 0 : _a.postMessage(JSON.stringify({ method: "pause" }), "https://player.vimeo.com");
43
+ }, [iframeElement]);
44
+ const playVimeoVideo = useCallback(() => {
45
+ var _a;
46
+ (_a = iframeElement == null ? void 0 : iframeElement.contentWindow) == null ? void 0 : _a.postMessage(JSON.stringify({ method: "play" }), "https://player.vimeo.com");
47
+ }, [iframeElement]);
48
+ const handleInView = useCallback(
49
+ (isVisible) => {
50
+ if (!isHandledManually) {
51
+ if (isVisible && autoplay) {
52
+ playVimeoVideo();
53
+ } else {
54
+ pauseVimeoVideo();
55
+ }
56
+ }
57
+ },
58
+ [autoplay, isHandledManually, playVimeoVideo, pauseVimeoVideo]
59
+ );
60
+ useIsElementInViewport(inViewRef, handleInView);
43
61
  if (!vimeoIdentifier) {
44
62
  return /* @__PURE__ */ jsx(PreviewSkeleton, { type: "media", hasContent: false, aspectRatio });
45
63
  }
@@ -53,6 +71,19 @@ const VimeoVideoBlock = withPreview(
53
71
  const vimeoBaseUrl = "https://player.vimeo.com/video/";
54
72
  const vimeoUrl = new URL(`${vimeoBaseUrl}${identifier ?? ""}`);
55
73
  vimeoUrl.search = searchParams.toString();
74
+ const handlePlayPauseClick = () => {
75
+ setIsHandledManually((prev) => {
76
+ const next = !prev;
77
+ if (iframeElement) {
78
+ if (next) {
79
+ playVimeoVideo();
80
+ } else {
81
+ pauseVimeoVideo();
82
+ }
83
+ }
84
+ return next;
85
+ });
86
+ };
56
87
  return /* @__PURE__ */ jsx(Fragment, { children: hasPreviewImage && showPreviewImage ? renderPreviewImage({
57
88
  onPlay: () => setShowPreviewImage(false),
58
89
  image: previewImage,
@@ -61,13 +92,24 @@ const VimeoVideoBlock = withPreview(
61
92
  fill,
62
93
  icon: previewImageIcon,
63
94
  playButtonAriaLabel
64
- }) : /* @__PURE__ */ jsx(
95
+ }) : /* @__PURE__ */ jsxs(
65
96
  "div",
66
97
  {
67
98
  ref: inViewRef,
68
99
  className: clsx(styles.videoContainer, fill && styles.fill),
69
100
  style: !fill ? { "--aspect-ratio": aspectRatio.replace("x", "/") } : void 0,
70
- children: /* @__PURE__ */ jsx("iframe", { ref: iframeRef, className: styles.vimeoContainer, src: vimeoUrl.toString(), allow: "autoplay", allowFullScreen: true })
101
+ children: [
102
+ /* @__PURE__ */ jsx("iframe", { ref: iframeRef, className: styles.vimeoContainer, src: vimeoUrl.toString(), allow: "autoplay", allowFullScreen: true }),
103
+ !showControls && (PlayPauseButtonComponent ? /* @__PURE__ */ jsx(PlayPauseButtonComponent, { isPlaying: isHandledManually, onClick: handlePlayPauseClick }) : /* @__PURE__ */ jsx(
104
+ PlayPauseButton,
105
+ {
106
+ isPlaying: isHandledManually,
107
+ onClick: handlePlayPauseClick,
108
+ ariaLabelPlay: playButtonAriaLabel,
109
+ ariaLabelPause: pauseButtonAriaLabel
110
+ }
111
+ ))
112
+ ]
71
113
  }
72
114
  ) });
73
115
  },
@@ -1,5 +1,6 @@
1
- import { ReactElement, ReactNode } from 'react';
1
+ import { ComponentType, ReactElement, ReactNode } from 'react';
2
2
  import { YouTubeVideoBlockData } from '../blocks.generated';
3
+ import { PlayPauseButtonProps } from './helpers/PlayPauseButton';
3
4
  import { VideoPreviewImageProps } from './helpers/VideoPreviewImage';
4
5
  import { PropsWithData } from './PropsWithData';
5
6
  interface YouTubeVideoBlockProps extends PropsWithData<YouTubeVideoBlockData> {
@@ -9,6 +10,8 @@ interface YouTubeVideoBlockProps extends PropsWithData<YouTubeVideoBlockData> {
9
10
  fill?: boolean;
10
11
  previewImageIcon?: ReactNode;
11
12
  playButtonAriaLabel?: string;
13
+ pauseButtonAriaLabel?: string;
14
+ playPauseButton?: ComponentType<PlayPauseButtonProps>;
12
15
  }
13
16
  export declare const YouTubeVideoBlock: ({ ...componentProps }: import('../iframebridge/withPreview').WithPreviewProps & YouTubeVideoBlockProps) => import("react/jsx-runtime").JSX.Element;
14
17
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"YouTubeVideoBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/YouTubeVideoBlock.tsx"],"names":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AY,CAAC;IACpE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAC;CACzD;AAED,eAAO,MAAM,iBAAiB,qJAuH7B,CAAC"}
@@ -1,9 +1,10 @@
1
1
  "use client";
2
- import { jsx, Fragment } from "react/jsx-runtime";
2
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
3
  import clsx from "clsx";
4
- import { useState, useRef } from "react";
4
+ import { useState, useRef, useCallback } from "react";
5
5
  import { withPreview } from "../iframebridge/withPreview.js";
6
6
  import { PreviewSkeleton } from "../previewskeleton/PreviewSkeleton.js";
7
+ import { PlayPauseButton } from "./helpers/PlayPauseButton.js";
7
8
  import { useIsElementInViewport } from "./helpers/useIsElementInViewport.js";
8
9
  import styles from "./YouTubeVideoBlock.module.scss.js";
9
10
  const EXPECTED_YT_ID_LENGTH = 11;
@@ -21,29 +22,38 @@ const YouTubeVideoBlock = withPreview(
21
22
  renderPreviewImage,
22
23
  fill,
23
24
  previewImageIcon,
24
- playButtonAriaLabel
25
+ playButtonAriaLabel,
26
+ pauseButtonAriaLabel,
27
+ playPauseButton: PlayPauseButtonComponent
25
28
  }) => {
26
29
  const [showPreviewImage, setShowPreviewImage] = useState(true);
30
+ const [isHandledManually, setIsHandledManually] = useState(autoplay ?? false);
27
31
  const hasPreviewImage = !!(previewImage && previewImage.damFile);
28
- const iframeRef = useRef(null);
32
+ const [iframeElement, setIframeElement] = useState(null);
33
+ const iframeRef = setIframeElement;
29
34
  const inViewRef = useRef(null);
30
- const pauseYouTubeVideo = () => {
31
- var _a, _b;
32
- (_b = (_a = iframeRef.current) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.postMessage(`{"event":"command","func":"pauseVideo","args":""}`, "https://www.youtube-nocookie.com");
33
- };
34
- const playYouTubeVideo = () => {
35
- var _a, _b;
36
- (_b = (_a = iframeRef.current) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.postMessage(`{"event":"command","func":"playVideo","args":""}`, "https://www.youtube-nocookie.com");
37
- };
38
- useIsElementInViewport(inViewRef, (inView) => {
39
- if (autoplay) {
40
- if (inView) {
41
- playYouTubeVideo();
42
- } else {
43
- pauseYouTubeVideo();
35
+ const pauseYouTubeVideo = useCallback(() => {
36
+ var _a;
37
+ (_a = iframeElement == null ? void 0 : iframeElement.contentWindow) == null ? void 0 : _a.postMessage(`{"event":"command","func":"pauseVideo","args":""}`, "https://www.youtube-nocookie.com");
38
+ }, [iframeElement]);
39
+ const playYouTubeVideo = useCallback(() => {
40
+ var _a;
41
+ (_a = iframeElement == null ? void 0 : iframeElement.contentWindow) == null ? void 0 : _a.postMessage(`{"event":"command","func":"playVideo","args":""}`, "https://www.youtube-nocookie.com");
42
+ }, [iframeElement]);
43
+ const handleInView = useCallback(
44
+ (inView) => {
45
+ if (autoplay) {
46
+ if (inView && isHandledManually) {
47
+ playYouTubeVideo();
48
+ setIsHandledManually(true);
49
+ } else {
50
+ pauseYouTubeVideo();
51
+ }
44
52
  }
45
- }
46
- });
53
+ },
54
+ [autoplay, isHandledManually, playYouTubeVideo, pauseYouTubeVideo]
55
+ );
56
+ useIsElementInViewport(inViewRef, handleInView);
47
57
  if (!youtubeIdentifier) {
48
58
  return /* @__PURE__ */ jsx(PreviewSkeleton, { type: "media", hasContent: false, aspectRatio });
49
59
  }
@@ -52,7 +62,7 @@ const YouTubeVideoBlock = withPreview(
52
62
  searchParams.append("modestbranding", "1");
53
63
  searchParams.append("rel", "0");
54
64
  searchParams.append("enablejsapi", "1");
55
- if (hasPreviewImage && !showPreviewImage) searchParams.append("autoplay", "1");
65
+ if (hasPreviewImage && !showPreviewImage || !hasPreviewImage) searchParams.append("autoplay", "1");
56
66
  if (autoplay) searchParams.append("mute", "1");
57
67
  if (showControls !== void 0) searchParams.append("controls", Number(showControls).toString());
58
68
  if (loop !== void 0) searchParams.append("loop", Number(loop).toString());
@@ -60,6 +70,15 @@ const YouTubeVideoBlock = withPreview(
60
70
  const youtubeBaseUrl = "https://www.youtube-nocookie.com/embed/";
61
71
  const youtubeUrl = new URL(`${youtubeBaseUrl}${identifier ?? ""}`);
62
72
  youtubeUrl.search = searchParams.toString();
73
+ const handlePlayPauseClick = () => {
74
+ if (isHandledManually) {
75
+ pauseYouTubeVideo();
76
+ setIsHandledManually(false);
77
+ } else {
78
+ playYouTubeVideo();
79
+ setIsHandledManually(true);
80
+ }
81
+ };
63
82
  return /* @__PURE__ */ jsx(Fragment, { children: hasPreviewImage && showPreviewImage ? renderPreviewImage({
64
83
  onPlay: () => setShowPreviewImage(false),
65
84
  image: previewImage,
@@ -68,22 +87,33 @@ const YouTubeVideoBlock = withPreview(
68
87
  fill,
69
88
  icon: previewImageIcon,
70
89
  playButtonAriaLabel
71
- }) : /* @__PURE__ */ jsx(
90
+ }) : /* @__PURE__ */ jsxs(
72
91
  "div",
73
92
  {
74
93
  ref: inViewRef,
75
94
  className: clsx(styles.videoContainer, fill && styles.fill),
76
95
  style: !fill ? { "--aspect-ratio": aspectRatio.replace("x", "/") } : void 0,
77
- children: /* @__PURE__ */ jsx(
78
- "iframe",
79
- {
80
- ref: iframeRef,
81
- className: styles.youtubeContainer,
82
- allow: "autoplay",
83
- referrerPolicy: "strict-origin-when-cross-origin",
84
- src: youtubeUrl.toString()
85
- }
86
- )
96
+ children: [
97
+ !showControls && (PlayPauseButtonComponent ? /* @__PURE__ */ jsx(PlayPauseButtonComponent, { isPlaying: !isHandledManually, onClick: handlePlayPauseClick }) : /* @__PURE__ */ jsx(
98
+ PlayPauseButton,
99
+ {
100
+ isPlaying: !isHandledManually,
101
+ onClick: handlePlayPauseClick,
102
+ ariaLabelPlay: playButtonAriaLabel,
103
+ ariaLabelPause: pauseButtonAriaLabel
104
+ }
105
+ )),
106
+ /* @__PURE__ */ jsx(
107
+ "iframe",
108
+ {
109
+ ref: iframeRef,
110
+ className: styles.youtubeContainer,
111
+ allow: "autoplay",
112
+ referrerPolicy: "strict-origin-when-cross-origin",
113
+ src: youtubeUrl.toString()
114
+ }
115
+ )
116
+ ]
87
117
  }
88
118
  ) });
89
119
  },
@@ -0,0 +1,8 @@
1
+ export interface PlayPauseButtonProps {
2
+ isPlaying: boolean;
3
+ onClick: () => void;
4
+ ariaLabelPlay?: string;
5
+ ariaLabelPause?: string;
6
+ }
7
+ export declare const PlayPauseButton: ({ isPlaying, onClick, ariaLabelPlay, ariaLabelPause }: PlayPauseButtonProps) => import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=PlayPauseButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlayPauseButton.d.ts","sourceRoot":"","sources":["../../../src/blocks/helpers/PlayPauseButton.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,oBAAoB;IACjC,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,eAAe,GAAI,uDAAuD,oBAAoB,4CAM1G,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import styles from "./PlayPauseButton.module.scss.js";
4
+ const PlayPauseButton = ({ isPlaying, onClick, ariaLabelPlay, ariaLabelPause }) => {
5
+ return /* @__PURE__ */ jsx("button", { className: clsx(styles.button), onClick, "aria-label": isPlaying ? ariaLabelPause ?? "Pause" : ariaLabelPlay ?? "Play", children: /* @__PURE__ */ jsx("div", { className: clsx(styles.animatedPlayPause, !isPlaying && styles.animatedPlayPausePaused) }) });
6
+ };
7
+ export {
8
+ PlayPauseButton
9
+ };
@@ -0,0 +1,14 @@
1
+ const button = "_button_4r8gs_1";
2
+ const animatedPlayPause = "_animatedPlayPause_4r8gs_23";
3
+ const animatedPlayPausePaused = "_animatedPlayPausePaused_4r8gs_32";
4
+ const styles = {
5
+ button,
6
+ animatedPlayPause,
7
+ animatedPlayPausePaused
8
+ };
9
+ export {
10
+ animatedPlayPause,
11
+ animatedPlayPausePaused,
12
+ button,
13
+ styles as default
14
+ };
package/lib/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export { ListBlock } from './blocks/factories/ListBlock';
8
8
  export { OneOfBlock } from './blocks/factories/OneOfBlock';
9
9
  export { OptionalBlock } from './blocks/factories/OptionalBlock';
10
10
  export type { SupportedBlocks } from './blocks/factories/types';
11
+ export { type PlayPauseButtonProps } from './blocks/helpers/PlayPauseButton';
11
12
  export { hasRichTextBlockContent } from './blocks/helpers/RichTextBlockHelper';
12
13
  export { useIsElementInViewport } from './blocks/helpers/useIsElementInViewport';
13
14
  export type { VideoPreviewImageProps } from './blocks/helpers/VideoPreviewImage';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,uBAAuB,EAAE,KAAK,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC9I,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC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AC7E,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yDAAyD,CAAC;AACvG,OAAO,EAAE,KAAK,gCAAgC,EAAE,4BAA4B,EAAE,MAAM,qDAAqD,CAAC"}
package/lib/style.css CHANGED
@@ -1 +1 @@
1
- ._previewElementContainer_nwhl6_1{display:contents}._childrenWrapper_qguhx_1{position:relative;z-index:1}._root_v4248_1{position:absolute;z-index:2;top:0;left:0;right:0;min-height:100vh;height:var(--height)}._root_1ya0k_1{position:absolute;cursor:pointer;outline:1px solid transparent;outline-offset:-1px}._root_1ya0k_1:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;opacity:.25}._root_1ya0k_1:hover{outline-color:#29b6f6;outline-style:solid}._root_1ya0k_1:hover:after{background-color:#29b6f6}._isHoveredInBlockList_1ya0k_24{outline-color:#29b6f6;outline-style:solid}._isHoveredInBlockList_1ya0k_24:after{background-color:#29b6f6}._showBlockOutlines_1ya0k_32:not(:hover){outline-color:#d9d9d9;outline-style:dashed}._blockIsSelected_1ya0k_37{outline-color:#29b6f6}._blockIsSelected_1ya0k_37 ._label_1ya0k_40{display:inline-block}._label_1ya0k_40{position:absolute;padding:2px;background-color:#57b0eb;line-height:16px;color:#fff;top:1px;right:1px;font-size:12px;display:none}._barSkeleton_zomv4_1{min-height:20px;margin-bottom:5px;margin-right:5px;background-color:var(--background-color);color:var(--color)}._rowsContainer_zomv4_9{width:100%;min-width:300px}._rowSkeleton_zomv4_14{margin-bottom:10px;min-height:20px;width:var(--width);background-color:var(--background-color);color:var(--color)}._imageContainer_zomv4_22{width:100%;aspect-ratio:var(--aspect-ratio);height:var(--height);background-color:var(--background-color);color:var(--color)}._video_17b8y_1{width:100%;object-fit:cover;aspect-ratio:var(--aspect-ratio)}._fill_17b8y_7{height:100%}._root_1k5a5_1{position:relative;width:100%}._fill_1k5a5_6{height:100%}._iconWrapper_1k5a5_10{position:absolute;top:0;right:0;left:0;bottom:0;display:flex;align-items:center;justify-content:center;background-color:#000;opacity:.5;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;padding:0;cursor:pointer}._iconWrapper_1k5a5_10:focus ._playIcon_1k5a5_26{outline:4px solid white;outline-offset:10px;border-radius:2px}._playIcon_1k5a5_26{width:64px;height:64px;box-sizing:border-box;border-style:solid;border-width:32px 0 32px 64px;border-color:transparent transparent transparent white}._videoContainer_1flq1_1{overflow:hidden;position:relative;aspect-ratio:var(--aspect-ratio)}._fill_1flq1_7{width:100%;height:100%}._vimeoContainer_1flq1_12{position:absolute;border:0;top:0;left:0;width:100%;height:100%}._videoContainer_bhmhr_1{overflow:hidden;position:relative;aspect-ratio:var(--aspect-ratio)}._fill_bhmhr_7{width:100%;height:100%}._youtubeContainer_bhmhr_12{position:absolute;border:0;top:0;left:0;width:100%;height:100%}
1
+ ._previewElementContainer_nwhl6_1{display:contents}._childrenWrapper_qguhx_1{position:relative;z-index:1}._root_v4248_1{position:absolute;z-index:2;top:0;left:0;right:0;min-height:100vh;height:var(--height)}._root_1ya0k_1{position:absolute;cursor:pointer;outline:1px solid transparent;outline-offset:-1px}._root_1ya0k_1:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;opacity:.25}._root_1ya0k_1:hover{outline-color:#29b6f6;outline-style:solid}._root_1ya0k_1:hover:after{background-color:#29b6f6}._isHoveredInBlockList_1ya0k_24{outline-color:#29b6f6;outline-style:solid}._isHoveredInBlockList_1ya0k_24:after{background-color:#29b6f6}._showBlockOutlines_1ya0k_32:not(:hover){outline-color:#d9d9d9;outline-style:dashed}._blockIsSelected_1ya0k_37{outline-color:#29b6f6}._blockIsSelected_1ya0k_37 ._label_1ya0k_40{display:inline-block}._label_1ya0k_40{position:absolute;padding:2px;background-color:#57b0eb;line-height:16px;color:#fff;top:1px;right:1px;font-size:12px;display:none}._barSkeleton_zomv4_1{min-height:20px;margin-bottom:5px;margin-right:5px;background-color:var(--background-color);color:var(--color)}._rowsContainer_zomv4_9{width:100%;min-width:300px}._rowSkeleton_zomv4_14{margin-bottom:10px;min-height:20px;width:var(--width);background-color:var(--background-color);color:var(--color)}._imageContainer_zomv4_22{width:100%;aspect-ratio:var(--aspect-ratio);height:var(--height);background-color:var(--background-color);color:var(--color)}._root_8r6od_1{position:relative}._video_8r6od_5{width:100%;object-fit:cover;aspect-ratio:var(--aspect-ratio)}._fill_8r6od_11{height:100%}._button_4r8gs_1{position:absolute;left:8px;bottom:8px;width:24px;height:24px;display:flex;align-items:center;justify-content:center;background-color:#000000b3;z-index:10}._button_4r8gs_1:hover,._button_4r8gs_1:active{background-color:#9e9e9e}._button_4r8gs_1:focus{border-radius:6px}._animatedPlayPause_4r8gs_23{box-sizing:border-box;height:12px;border-color:transparent transparent transparent #fff;cursor:pointer;border-style:solid;border-width:6px 0 6px 9px;transition:border-width .1s ease,border-style .1s ease}._animatedPlayPausePaused_4r8gs_32{border-style:double;border-width:0 0 0 9px}._root_1k5a5_1{position:relative;width:100%}._fill_1k5a5_6{height:100%}._iconWrapper_1k5a5_10{position:absolute;top:0;right:0;left:0;bottom:0;display:flex;align-items:center;justify-content:center;background-color:#000;opacity:.5;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;padding:0;cursor:pointer}._iconWrapper_1k5a5_10:focus ._playIcon_1k5a5_26{outline:4px solid white;outline-offset:10px;border-radius:2px}._playIcon_1k5a5_26{width:64px;height:64px;box-sizing:border-box;border-style:solid;border-width:32px 0 32px 64px;border-color:transparent transparent transparent white}._videoContainer_1flq1_1{overflow:hidden;position:relative;aspect-ratio:var(--aspect-ratio)}._fill_1flq1_7{width:100%;height:100%}._vimeoContainer_1flq1_12{position:absolute;border:0;top:0;left:0;width:100%;height:100%}._videoContainer_bhmhr_1{overflow:hidden;position:relative;aspect-ratio:var(--aspect-ratio)}._fill_bhmhr_7{width:100%;height:100%}._youtubeContainer_bhmhr_12{position:absolute;border:0;top:0;left:0;width:100%;height:100%}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/site-react",
3
- "version": "8.8.0-canary-20251127134721",
3
+ "version": "8.8.0-canary-20251127144258",
4
4
  "description": "Comet Site React package",
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,8 +55,8 @@
55
55
  "vite": "^5.4.19",
56
56
  "vite-plugin-dts": "^4.5.4",
57
57
  "webpack": "^5.102.1",
58
- "@comet/cli": "8.8.0-canary-20251127134721",
59
- "@comet/eslint-config": "8.8.0-canary-20251127134721"
58
+ "@comet/cli": "8.8.0-canary-20251127144258",
59
+ "@comet/eslint-config": "8.8.0-canary-20251127144258"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "react": "^18.0.0"