@comet/site-nextjs 9.0.0-beta.2 → 9.0.0-beta.4
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/lib/blocks/DamVideoBlock.d.ts.map +1 -1
- package/lib/blocks/DamVideoBlock.js +2 -13
- package/lib/blocks/InternalLinkBlock.d.ts.map +1 -1
- package/lib/blocks/InternalLinkBlock.js +2 -18
- package/lib/blocks/PixelImageBlock.d.ts.map +1 -1
- package/lib/blocks/PixelImageBlock.js +2 -67
- package/lib/blocks/PixelImageBlock.module.scss.js +1 -8
- package/lib/blocks/VimeoVideoBlock.d.ts.map +1 -1
- package/lib/blocks/VimeoVideoBlock.js +2 -13
- package/lib/blocks/YouTubeVideoBlock.d.ts.map +1 -1
- package/lib/blocks/YouTubeVideoBlock.js +2 -13
- package/lib/blocks/factories/SeoBlock.d.ts.map +1 -1
- package/lib/blocks/factories/SeoBlock.js +5 -39
- package/lib/blocks/helpers/VideoPreviewImage.js +2 -9
- package/lib/graphQLFetch/graphQLFetch.js +1 -36
- package/lib/image/Image.d.ts.map +1 -1
- package/lib/image/Image.js +2 -10
- package/lib/index.d.ts +2 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -112
- package/lib/persistedQueries/webpackPersistedQueriesLoader.d.ts +2 -0
- package/lib/persistedQueries/webpackPersistedQueriesLoader.d.ts.map +1 -0
- package/lib/persistedQueries/webpackPersistedQueriesLoader.js +1 -0
- package/lib/server.d.ts +5 -0
- package/lib/server.d.ts.map +1 -0
- package/lib/server.js +1 -0
- package/lib/site-react/lib/blockLoader/blockLoader.js +1 -55
- package/lib/site-react/lib/blocks/DamFileDownloadLinkBlock.js +1 -27
- package/lib/site-react/lib/blocks/DamVideoBlock.js +3 -99
- package/lib/site-react/lib/blocks/DamVideoBlock.module.scss.js +1 -14
- package/lib/site-react/lib/blocks/EmailLinkBlock.js +1 -21
- package/lib/site-react/lib/blocks/ExternalLinkBlock.js +1 -47
- package/lib/site-react/lib/blocks/PhoneLinkBlock.js +1 -21
- package/lib/site-react/lib/blocks/SvgImageBlock.js +1 -28
- package/lib/site-react/lib/blocks/VimeoVideoBlock.js +2 -119
- package/lib/site-react/lib/blocks/VimeoVideoBlock.module.scss.js +1 -14
- package/lib/site-react/lib/blocks/YouTubeVideoBlock.js +2 -126
- package/lib/site-react/lib/blocks/YouTubeVideoBlock.module.scss.js +1 -14
- package/lib/site-react/lib/blocks/factories/BlocksBlock.js +1 -27
- package/lib/site-react/lib/blocks/factories/ListBlock.js +1 -13
- package/lib/site-react/lib/blocks/factories/OneOfBlock.js +1 -23
- package/lib/site-react/lib/blocks/factories/OptionalBlock.js +1 -10
- package/lib/site-react/lib/blocks/helpers/PlayPauseButton.js +1 -9
- package/lib/site-react/lib/blocks/helpers/PlayPauseButton.module.scss.js +1 -14
- package/lib/site-react/lib/blocks/helpers/RichTextBlockHelper.js +1 -7
- package/lib/site-react/lib/blocks/helpers/TipTapRichTextRenderer.js +1 -0
- package/lib/site-react/lib/blocks/helpers/VideoPreviewImage.js +2 -23
- package/lib/site-react/lib/blocks/helpers/VideoPreviewImage.module.scss.js +1 -17
- package/lib/site-react/lib/blocks/helpers/useIsElementInViewport.js +1 -19
- package/lib/site-react/lib/cookies/CookieApiContext.js +1 -18
- package/lib/site-react/lib/cookies/CookieSafe.js +1 -18
- package/lib/site-react/lib/cookies/useCookieBotCookieApi.js +1 -33
- package/lib/site-react/lib/cookies/useLocalStorageCookieApi.js +1 -40
- package/lib/site-react/lib/cookies/useOneTrustCookieApi.js +1 -48
- package/lib/site-react/lib/errorHandler/ErrorHandlerBoundary.js +1 -10
- package/lib/site-react/lib/errorHandler/ErrorHandlerBoundaryInternal.js +1 -26
- package/lib/site-react/lib/errorHandler/ErrorHandlerProvider.js +1 -20
- package/lib/site-react/lib/graphQLFetch/fetchInMemoryCache.js +1 -37
- package/lib/site-react/lib/graphQLFetch/graphQLFetch.js +1 -125
- package/lib/site-react/lib/iframebridge/IFrameBridge.js +3 -253
- package/lib/site-react/lib/iframebridge/IFrameBridge.module.scss.js +1 -8
- package/lib/site-react/lib/iframebridge/IFrameMessage.js +1 -21
- package/lib/site-react/lib/iframebridge/Preview.js +1 -56
- package/lib/site-react/lib/iframebridge/Preview.module.scss.js +1 -8
- package/lib/site-react/lib/iframebridge/PreviewOverlay.js +1 -26
- package/lib/site-react/lib/iframebridge/PreviewOverlay.module.scss.js +1 -8
- package/lib/site-react/lib/iframebridge/PreviewOverlayElement.js +1 -36
- package/lib/site-react/lib/iframebridge/PreviewOverlayElement.module.scss.js +1 -20
- package/lib/site-react/lib/iframebridge/useBlockPreviewFetch.js +1 -29
- package/lib/site-react/lib/iframebridge/useIFrameBridge.js +1 -8
- package/lib/site-react/lib/iframebridge/utils.js +1 -44
- package/lib/site-react/lib/iframebridge/withPreview.js +1 -33
- package/lib/site-react/lib/image/image.utils.js +1 -51
- package/lib/site-react/lib/jsonLd/JsonLd.js +1 -0
- package/lib/site-react/lib/persistedQueries/createPersistedQueryGraphQLFetch.js +1 -68
- package/lib/site-react/lib/persistedQueries/persistedQueryRoute.js +1 -100
- package/lib/site-react/lib/persistedQueries/webpackPersistedQueriesLoader.js +1 -51
- package/lib/site-react/lib/preview/BlockPreviewProvider.js +1 -32
- package/lib/site-react/lib/preview/PreviewContext.js +1 -9
- package/lib/site-react/lib/preview/usePreview.js +1 -41
- package/lib/site-react/lib/previewskeleton/PreviewSkeleton.js +4 -64
- package/lib/site-react/lib/previewskeleton/PreviewSkeleton.module.scss.js +1 -17
- package/lib/site-react/lib/sitePreview/iframebridge/SitePreviewIFrameMessage.js +1 -8
- package/lib/site-react/lib/sitePreview/iframebridge/sendSitePreviewIFrameMessage.js +1 -6
- package/lib/sitePreview/SitePreviewProvider.js +1 -40
- package/lib/sitePreview/appRouter/sitePreviewRoute.js +1 -27
- package/lib/sitePreview/pagesRouter/legacyPagesRouterSitePreviewApiHandler.d.ts.map +1 -1
- package/lib/sitePreview/pagesRouter/legacyPagesRouterSitePreviewApiHandler.js +1 -20
- package/lib/sitePreview/previewUtils.d.ts.map +1 -1
- package/lib/sitePreview/previewUtils.js +1 -50
- package/lib/style.css +1 -1
- package/package.json +16 -12
|
@@ -1,100 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { withPreview } from "../iframebridge/withPreview.js";
|
|
6
|
-
import { PreviewSkeleton } from "../previewskeleton/PreviewSkeleton.js";
|
|
7
|
-
import styles from "./DamVideoBlock.module.scss.js";
|
|
8
|
-
import { PlayPauseButton } from "./helpers/PlayPauseButton.js";
|
|
9
|
-
import { useIsElementInViewport } from "./helpers/useIsElementInViewport.js";
|
|
10
|
-
const DamVideoBlock = withPreview(
|
|
11
|
-
({
|
|
12
|
-
data: { damFile, autoplay, loop, showControls, previewImage },
|
|
13
|
-
aspectRatio = "16x9",
|
|
14
|
-
previewImageSizes,
|
|
15
|
-
renderPreviewImage,
|
|
16
|
-
fill,
|
|
17
|
-
previewImageIcon,
|
|
18
|
-
playButtonAriaLabel,
|
|
19
|
-
pauseButtonAriaLabel,
|
|
20
|
-
playPauseButton: PlayPauseButtonComponent
|
|
21
|
-
}) => {
|
|
22
|
-
var _a;
|
|
23
|
-
if (damFile === void 0) {
|
|
24
|
-
return /* @__PURE__ */ jsx(PreviewSkeleton, { type: "media", hasContent: false, aspectRatio });
|
|
25
|
-
}
|
|
26
|
-
const [showPreviewImage, setShowPreviewImage] = useState(true);
|
|
27
|
-
const [isPlaying, setIsPlaying] = useState(autoplay ?? false);
|
|
28
|
-
const [isHandledManually, setIsHandledManually] = useState(false);
|
|
29
|
-
const hasPreviewImage = Boolean(previewImage && previewImage.damFile);
|
|
30
|
-
const [videoElement, setVideoElement] = useState(null);
|
|
31
|
-
const videoRef = setVideoElement;
|
|
32
|
-
const handleInView = useCallback(
|
|
33
|
-
(inView) => {
|
|
34
|
-
if (!isHandledManually && videoElement) {
|
|
35
|
-
if (inView && autoplay) {
|
|
36
|
-
videoElement.play();
|
|
37
|
-
setIsPlaying(true);
|
|
38
|
-
} else {
|
|
39
|
-
videoElement.pause();
|
|
40
|
-
setIsPlaying(false);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
[autoplay, isHandledManually, videoElement]
|
|
45
|
-
);
|
|
46
|
-
useIsElementInViewport({ current: videoElement }, handleInView);
|
|
47
|
-
const handlePlayPauseClick = () => {
|
|
48
|
-
if (isPlaying) {
|
|
49
|
-
setIsPlaying(false);
|
|
50
|
-
setIsHandledManually(true);
|
|
51
|
-
videoElement == null ? void 0 : videoElement.pause();
|
|
52
|
-
} else {
|
|
53
|
-
setIsPlaying(true);
|
|
54
|
-
videoElement == null ? void 0 : videoElement.play();
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
return /* @__PURE__ */ jsx(Fragment, { children: hasPreviewImage && showPreviewImage ? renderPreviewImage({
|
|
58
|
-
onPlay: () => setShowPreviewImage(false),
|
|
59
|
-
image: previewImage,
|
|
60
|
-
aspectRatio,
|
|
61
|
-
sizes: previewImageSizes,
|
|
62
|
-
fill,
|
|
63
|
-
icon: previewImageIcon,
|
|
64
|
-
playButtonAriaLabel
|
|
65
|
-
}) : /* @__PURE__ */ jsxs("div", { className: styles.root, children: [
|
|
66
|
-
/* @__PURE__ */ jsxs(
|
|
67
|
-
"video",
|
|
68
|
-
{
|
|
69
|
-
autoPlay: autoplay || hasPreviewImage && !showPreviewImage,
|
|
70
|
-
controls: showControls,
|
|
71
|
-
loop,
|
|
72
|
-
playsInline: true,
|
|
73
|
-
muted: autoplay,
|
|
74
|
-
ref: videoRef,
|
|
75
|
-
className: clsx(styles.video, fill && styles.fill),
|
|
76
|
-
style: !fill ? { "--aspect-ratio": aspectRatio.replace("x", " / ") } : void 0,
|
|
77
|
-
children: [
|
|
78
|
-
(_a = damFile.captions) == null ? void 0 : _a.map((caption) => {
|
|
79
|
-
return /* @__PURE__ */ jsx("track", { src: caption.fileUrl, kind: "captions", srcLang: caption.language }, caption.id);
|
|
80
|
-
}),
|
|
81
|
-
/* @__PURE__ */ jsx("source", { src: damFile.fileUrl, type: damFile.mimetype })
|
|
82
|
-
]
|
|
83
|
-
}
|
|
84
|
-
),
|
|
85
|
-
!showControls && (PlayPauseButtonComponent ? /* @__PURE__ */ jsx(PlayPauseButtonComponent, { isPlaying, onClick: handlePlayPauseClick }) : /* @__PURE__ */ jsx(
|
|
86
|
-
PlayPauseButton,
|
|
87
|
-
{
|
|
88
|
-
isPlaying,
|
|
89
|
-
onClick: handlePlayPauseClick,
|
|
90
|
-
ariaLabelPlay: playButtonAriaLabel,
|
|
91
|
-
ariaLabelPause: pauseButtonAriaLabel
|
|
92
|
-
}
|
|
93
|
-
))
|
|
94
|
-
] }) });
|
|
95
|
-
},
|
|
96
|
-
{ label: "Video" }
|
|
97
|
-
);
|
|
98
|
-
export {
|
|
99
|
-
DamVideoBlock
|
|
100
|
-
};
|
|
2
|
+
import{jsx as e,Fragment as a,jsxs as i}from"react/jsx-runtime";import o from"clsx";import{useState as r,useCallback as t}from"react";import{withPreview as l}from"../iframebridge/withPreview.js";import{PreviewSkeleton as s}from"../previewskeleton/PreviewSkeleton.js";import n from"./DamVideoBlock.module.scss.js";import{PlayPauseButton as p}from"./helpers/PlayPauseButton.js";import{useIsElementInViewport as m}from"./helpers/useIsElementInViewport.js";const c=l(({data:{damFile:l,autoplay:c,loop:u,showControls:d,previewImage:y},aspectRatio:f="16x9",previewImageSizes:P,renderPreviewImage:v,fill:w,previewImageIcon:g,playButtonAriaLabel:I,pauseButtonAriaLabel:h,playPauseButton:k})=>{if(void 0===l)return e(s,{type:"media",hasContent:!1,aspectRatio:f});const[B,b]=r(!0),[j,L]=r(c??!1),[x,V]=r(!1),C=Boolean(y&&y.damFile),[A,R]=r(null),S=R,z=t(e=>{!x&&A&&(e&&c?(A.play(),L(!0)):(A.pause(),L(!1)))},[c,x,A]);m({current:A},z);const D=()=>{j?(L(!1),V(!0),A?.pause()):(L(!0),A?.play())};return e(a,{children:C&&B?v({onPlay:()=>b(!1),image:y,aspectRatio:f,sizes:P,fill:w,icon:g,playButtonAriaLabel:I}):/* @__PURE__ */i("div",{className:n.root,children:[
|
|
3
|
+
/* @__PURE__ */i("video",{autoPlay:c||C&&!B,controls:d,loop:u,playsInline:!0,muted:c,ref:S,className:o(n.video,w&&n.fill),style:w?void 0:{"--aspect-ratio":f.replace("x"," / ")},children:[l.captions?.map(a=>/* @__PURE__ */e("track",{src:a.fileUrl,kind:"captions",srcLang:a.language},a.id)),
|
|
4
|
+
/* @__PURE__ */e("source",{src:l.fileUrl,type:l.mimetype})]}),!d&&(k?/* @__PURE__ */e(k,{isPlaying:j,onClick:D}):/* @__PURE__ */e(p,{isPlaying:j,onClick:D,ariaLabelPlay:I,ariaLabelPause:h}))]})})},{label:"Video"});export{c as DamVideoBlock};
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
const video = "_video_1jlho_6";
|
|
3
|
-
const fill = "_fill_1jlho_12";
|
|
4
|
-
const styles = {
|
|
5
|
-
root,
|
|
6
|
-
video,
|
|
7
|
-
fill
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
styles as default,
|
|
11
|
-
fill,
|
|
12
|
-
root,
|
|
13
|
-
video
|
|
14
|
-
};
|
|
1
|
+
const o="_root_1jlho_1",l="_video_1jlho_6",_="_fill_1jlho_12",i={root:o,video:l,fill:_};export{i as default,_ as fill,o as root,l as video};
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { cloneElement } from "react";
|
|
3
|
-
const EmailLinkBlock = ({ data: { email }, children, legacyBehavior, ...anchorProps }) => {
|
|
4
|
-
if (!email) {
|
|
5
|
-
if (legacyBehavior) {
|
|
6
|
-
return children;
|
|
7
|
-
}
|
|
8
|
-
return /* @__PURE__ */ jsx("span", { className: anchorProps.className, children });
|
|
9
|
-
}
|
|
10
|
-
const href = `mailto:${email}`;
|
|
11
|
-
if (legacyBehavior) {
|
|
12
|
-
return cloneElement(children, {
|
|
13
|
-
...anchorProps,
|
|
14
|
-
href
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return /* @__PURE__ */ jsx("a", { ...anchorProps, href, children });
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
EmailLinkBlock
|
|
21
|
-
};
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{cloneElement as a}from"react";const e=({data:{email:e},children:i,legacyBehavior:t,...c})=>{if(!e)return t?i:/* @__PURE__ */r("span",{className:c.className,children:i});const l=`mailto:${e}`;return t?a(i,{...c,href:l}):/* @__PURE__ */r("a",{...c,href:l,children:i})};export{e as EmailLinkBlock};
|
|
@@ -1,48 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import { cloneElement } from "react";
|
|
4
|
-
import { usePreview } from "../preview/usePreview.js";
|
|
5
|
-
import { sendSitePreviewIFrameMessage } from "../sitePreview/iframebridge/sendSitePreviewIFrameMessage.js";
|
|
6
|
-
import { SitePreviewIFrameMessageType } from "../sitePreview/iframebridge/SitePreviewIFrameMessage.js";
|
|
7
|
-
function ExternalLinkBlock({ data: { targetUrl, openInNewWindow }, children, legacyBehavior, ...anchorProps }) {
|
|
8
|
-
const preview = usePreview();
|
|
9
|
-
if (preview.previewType === "SitePreview" || preview.previewType === "BlockPreview") {
|
|
10
|
-
const onClick = (event) => {
|
|
11
|
-
event.preventDefault();
|
|
12
|
-
if (preview.previewType === "SitePreview") {
|
|
13
|
-
sendSitePreviewIFrameMessage({
|
|
14
|
-
cometType: SitePreviewIFrameMessageType.OpenLink,
|
|
15
|
-
data: { link: { openInNewWindow, targetUrl } }
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
if (legacyBehavior) {
|
|
20
|
-
return cloneElement(children, {
|
|
21
|
-
...anchorProps,
|
|
22
|
-
href: "#",
|
|
23
|
-
onClick
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return /* @__PURE__ */ jsx("a", { ...anchorProps, href: "#", onClick, children });
|
|
27
|
-
} else {
|
|
28
|
-
if (!targetUrl) {
|
|
29
|
-
if (legacyBehavior) {
|
|
30
|
-
return children;
|
|
31
|
-
}
|
|
32
|
-
return /* @__PURE__ */ jsx("span", { className: anchorProps.className, children });
|
|
33
|
-
}
|
|
34
|
-
const href = targetUrl;
|
|
35
|
-
const target = openInNewWindow ? "_blank" : anchorProps.target;
|
|
36
|
-
if (legacyBehavior) {
|
|
37
|
-
return cloneElement(children, {
|
|
38
|
-
...anchorProps,
|
|
39
|
-
href,
|
|
40
|
-
target
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
return /* @__PURE__ */ jsx("a", { ...anchorProps, href, target, children });
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
ExternalLinkBlock
|
|
48
|
-
};
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{cloneElement as r}from"react";import{usePreview as i}from"../preview/usePreview.js";import{sendSitePreviewIFrameMessage as t}from"../sitePreview/iframebridge/sendSitePreviewIFrameMessage.js";import{SitePreviewIFrameMessageType as a}from"../sitePreview/iframebridge/SitePreviewIFrameMessage.js";function n({data:{targetUrl:n,openInNewWindow:s},children:o,legacyBehavior:m,...p}){const w=i();if("SitePreview"===w.previewType||"BlockPreview"===w.previewType){const i=e=>{e.preventDefault(),"SitePreview"===w.previewType&&t({cometType:a.OpenLink,data:{link:{openInNewWindow:s,targetUrl:n}}})};return m?r(o,{...p,href:"#",onClick:i}):/* @__PURE__ */e("a",{...p,href:"#",onClick:i,children:o})}{if(!n)return m?o:/* @__PURE__ */e("span",{className:p.className,children:o});const i=n,t=s?"_blank":p.target;return m?r(o,{...p,href:i,target:t}):/* @__PURE__ */e("a",{...p,href:i,target:t,children:o})}}export{n as ExternalLinkBlock};
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { cloneElement } from "react";
|
|
3
|
-
const PhoneLinkBlock = ({ data: { phone }, children, legacyBehavior, ...anchorProps }) => {
|
|
4
|
-
if (!phone) {
|
|
5
|
-
if (legacyBehavior) {
|
|
6
|
-
return children;
|
|
7
|
-
}
|
|
8
|
-
return /* @__PURE__ */ jsx("span", { className: anchorProps.className, children });
|
|
9
|
-
}
|
|
10
|
-
const href = `tel:${phone}`;
|
|
11
|
-
if (legacyBehavior) {
|
|
12
|
-
return cloneElement(children, {
|
|
13
|
-
...anchorProps,
|
|
14
|
-
href
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
return /* @__PURE__ */ jsx("a", { ...anchorProps, href, children });
|
|
18
|
-
};
|
|
19
|
-
export {
|
|
20
|
-
PhoneLinkBlock
|
|
21
|
-
};
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{cloneElement as r}from"react";const a=({data:{phone:a},children:n,legacyBehavior:t,...c})=>{if(!a)return t?n:/* @__PURE__ */e("span",{className:c.className,children:n});const o=`tel:${a}`;return t?r(n,{...c,href:o}):/* @__PURE__ */e("a",{...c,href:o,children:n})};export{a as PhoneLinkBlock};
|
|
@@ -1,29 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import { withPreview } from "../iframebridge/withPreview.js";
|
|
4
|
-
import { PreviewSkeleton } from "../previewskeleton/PreviewSkeleton.js";
|
|
5
|
-
const SvgImageBlock = withPreview(
|
|
6
|
-
({
|
|
7
|
-
data: { damFile },
|
|
8
|
-
width = "100%",
|
|
9
|
-
height = "auto",
|
|
10
|
-
...restProps
|
|
11
|
-
}) => {
|
|
12
|
-
if (!damFile) return /* @__PURE__ */ jsx(PreviewSkeleton, { type: "media", hasContent: false, height: height === "auto" ? void 0 : height });
|
|
13
|
-
return /* @__PURE__ */ jsx(
|
|
14
|
-
"img",
|
|
15
|
-
{
|
|
16
|
-
src: damFile.fileUrl,
|
|
17
|
-
width: width === "auto" ? void 0 : width,
|
|
18
|
-
height: height === "auto" ? void 0 : height,
|
|
19
|
-
alt: damFile.altText ?? "",
|
|
20
|
-
title: damFile.title ?? "",
|
|
21
|
-
...restProps
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
},
|
|
25
|
-
{ label: "SvgImage" }
|
|
26
|
-
);
|
|
27
|
-
export {
|
|
28
|
-
SvgImageBlock
|
|
29
|
-
};
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{withPreview as t}from"../iframebridge/withPreview.js";import{PreviewSkeleton as i}from"../previewskeleton/PreviewSkeleton.js";const o=t(({data:{damFile:t},width:o="100%",height:a="auto",...r})=>t?/* @__PURE__ */e("img",{src:t.fileUrl,width:"auto"===o?void 0:o,height:"auto"===a?void 0:a,alt:t.altText??"",title:t.title??"",...r}):/* @__PURE__ */e(i,{type:"media",hasContent:!1,height:"auto"===a?void 0:a}),{label:"SvgImage"});export{o as SvgImageBlock};
|
|
@@ -1,120 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { useState, useRef, useCallback } from "react";
|
|
5
|
-
import { withPreview } from "../iframebridge/withPreview.js";
|
|
6
|
-
import { PreviewSkeleton } from "../previewskeleton/PreviewSkeleton.js";
|
|
7
|
-
import { PlayPauseButton } from "./helpers/PlayPauseButton.js";
|
|
8
|
-
import { useIsElementInViewport } from "./helpers/useIsElementInViewport.js";
|
|
9
|
-
import styles from "./VimeoVideoBlock.module.scss.js";
|
|
10
|
-
function parseVimeoIdentifier(vimeoIdentifier) {
|
|
11
|
-
const urlRegEx = /^(https?:\/\/)?((www\.|player\.)?vimeo\.com\/?(showcase\/)*([0-9a-z]*\/)*([0-9]{6,11})[?]?.*)$/;
|
|
12
|
-
const idRegEx = /^([0-9]{6,11})$/;
|
|
13
|
-
const urlRegExMatch = vimeoIdentifier.match(urlRegEx);
|
|
14
|
-
const idRegExMatch = vimeoIdentifier.match(idRegEx);
|
|
15
|
-
if (!urlRegExMatch && !idRegExMatch) return void 0;
|
|
16
|
-
if (urlRegExMatch) {
|
|
17
|
-
return urlRegExMatch[6];
|
|
18
|
-
} else if (idRegExMatch) {
|
|
19
|
-
return idRegExMatch[1];
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
const VimeoVideoBlock = withPreview(
|
|
23
|
-
({
|
|
24
|
-
data: { vimeoIdentifier, autoplay, loop, showControls, previewImage },
|
|
25
|
-
aspectRatio = "16x9",
|
|
26
|
-
previewImageSizes,
|
|
27
|
-
renderPreviewImage,
|
|
28
|
-
fill,
|
|
29
|
-
previewImageIcon,
|
|
30
|
-
playButtonAriaLabel,
|
|
31
|
-
pauseButtonAriaLabel,
|
|
32
|
-
playPauseButton: PlayPauseButtonComponent
|
|
33
|
-
}) => {
|
|
34
|
-
const [showPreviewImage, setShowPreviewImage] = useState(true);
|
|
35
|
-
const hasPreviewImage = !!(previewImage && previewImage.damFile);
|
|
36
|
-
const inViewRef = useRef(null);
|
|
37
|
-
const [iframeElement, setIframeElement] = useState(null);
|
|
38
|
-
const iframeRef = setIframeElement;
|
|
39
|
-
const [isPlaying, setIsPlaying] = useState(autoplay ?? false);
|
|
40
|
-
const [isHandledManually, setIsHandledManually] = useState(false);
|
|
41
|
-
const pauseVimeoVideo = useCallback(() => {
|
|
42
|
-
var _a;
|
|
43
|
-
(_a = iframeElement == null ? void 0 : iframeElement.contentWindow) == null ? void 0 : _a.postMessage(JSON.stringify({ method: "pause" }), "https://player.vimeo.com");
|
|
44
|
-
}, [iframeElement]);
|
|
45
|
-
const playVimeoVideo = useCallback(() => {
|
|
46
|
-
var _a;
|
|
47
|
-
(_a = iframeElement == null ? void 0 : iframeElement.contentWindow) == null ? void 0 : _a.postMessage(JSON.stringify({ method: "play" }), "https://player.vimeo.com");
|
|
48
|
-
}, [iframeElement]);
|
|
49
|
-
const handleInView = useCallback(
|
|
50
|
-
(isVisible) => {
|
|
51
|
-
if (!isHandledManually) {
|
|
52
|
-
if (isVisible && autoplay) {
|
|
53
|
-
playVimeoVideo();
|
|
54
|
-
setIsPlaying(true);
|
|
55
|
-
} else {
|
|
56
|
-
pauseVimeoVideo();
|
|
57
|
-
setIsPlaying(false);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
[autoplay, isHandledManually, playVimeoVideo, pauseVimeoVideo]
|
|
62
|
-
);
|
|
63
|
-
useIsElementInViewport(inViewRef, handleInView);
|
|
64
|
-
if (!vimeoIdentifier) {
|
|
65
|
-
return /* @__PURE__ */ jsx(PreviewSkeleton, { type: "media", hasContent: false, aspectRatio });
|
|
66
|
-
}
|
|
67
|
-
const identifier = parseVimeoIdentifier(vimeoIdentifier);
|
|
68
|
-
const searchParams = new URLSearchParams();
|
|
69
|
-
if (hasPreviewImage && !showPreviewImage) searchParams.append("autoplay", "1");
|
|
70
|
-
if (autoplay) searchParams.append("muted", "1");
|
|
71
|
-
if (loop !== void 0) searchParams.append("loop", Number(loop).toString());
|
|
72
|
-
if (showControls !== void 0) searchParams.append("controls", Number(showControls).toString());
|
|
73
|
-
searchParams.append("dnt", "1");
|
|
74
|
-
const vimeoBaseUrl = "https://player.vimeo.com/video/";
|
|
75
|
-
const vimeoUrl = new URL(`${vimeoBaseUrl}${identifier ?? ""}`);
|
|
76
|
-
vimeoUrl.search = searchParams.toString();
|
|
77
|
-
const handlePlayPauseClick = () => {
|
|
78
|
-
if (isPlaying) {
|
|
79
|
-
setIsPlaying(false);
|
|
80
|
-
setIsHandledManually(true);
|
|
81
|
-
pauseVimeoVideo();
|
|
82
|
-
} else {
|
|
83
|
-
setIsPlaying(true);
|
|
84
|
-
playVimeoVideo();
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
return /* @__PURE__ */ jsx(Fragment, { children: hasPreviewImage && showPreviewImage ? renderPreviewImage({
|
|
88
|
-
onPlay: () => setShowPreviewImage(false),
|
|
89
|
-
image: previewImage,
|
|
90
|
-
aspectRatio,
|
|
91
|
-
sizes: previewImageSizes,
|
|
92
|
-
fill,
|
|
93
|
-
icon: previewImageIcon,
|
|
94
|
-
playButtonAriaLabel
|
|
95
|
-
}) : /* @__PURE__ */ jsxs(
|
|
96
|
-
"div",
|
|
97
|
-
{
|
|
98
|
-
ref: inViewRef,
|
|
99
|
-
className: clsx(styles.videoContainer, fill && styles.fill),
|
|
100
|
-
style: !fill ? { "--aspect-ratio": aspectRatio.replace("x", "/") } : void 0,
|
|
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, onClick: handlePlayPauseClick }) : /* @__PURE__ */ jsx(
|
|
104
|
-
PlayPauseButton,
|
|
105
|
-
{
|
|
106
|
-
isPlaying,
|
|
107
|
-
onClick: handlePlayPauseClick,
|
|
108
|
-
ariaLabelPlay: playButtonAriaLabel,
|
|
109
|
-
ariaLabelPause: pauseButtonAriaLabel
|
|
110
|
-
}
|
|
111
|
-
))
|
|
112
|
-
]
|
|
113
|
-
}
|
|
114
|
-
) });
|
|
115
|
-
},
|
|
116
|
-
{ label: "Video" }
|
|
117
|
-
);
|
|
118
|
-
export {
|
|
119
|
-
VimeoVideoBlock
|
|
120
|
-
};
|
|
2
|
+
import{jsx as e,Fragment as o,jsxs as t}from"react/jsx-runtime";import a from"clsx";import{useState as i,useRef as r,useCallback as s}from"react";import{withPreview as n}from"../iframebridge/withPreview.js";import{PreviewSkeleton as l}from"../previewskeleton/PreviewSkeleton.js";import{PlayPauseButton as p}from"./helpers/PlayPauseButton.js";import{useIsElementInViewport as m}from"./helpers/useIsElementInViewport.js";import c from"./VimeoVideoBlock.module.scss.js";const d=n(({data:{vimeoIdentifier:n,autoplay:d,loop:u,showControls:w,previewImage:v},aspectRatio:f="16x9",previewImageSizes:y,renderPreviewImage:h,fill:g,previewImageIcon:P,playButtonAriaLabel:S,pauseButtonAriaLabel:I,playPauseButton:b})=>{const[B,k]=i(!0),L=!(!v||!v.damFile),V=r(null),[j,C]=i(null),N=C,[x,R]=i(d??!1),[z,A]=i(!1),$=s(()=>{j?.contentWindow?.postMessage(JSON.stringify({method:"pause"}),"https://player.vimeo.com")},[j]),E=s(()=>{j?.contentWindow?.postMessage(JSON.stringify({method:"play"}),"https://player.vimeo.com")},[j]),F=s(e=>{z||(e&&d?(E(),R(!0)):($(),R(!1)))},[d,z,E,$]);if(m(V,F),!n)return e(l,{type:"media",hasContent:!1,aspectRatio:f});const J=function(e){const o=e.match(/^(https?:\/\/)?((www\.|player\.)?vimeo\.com\/?(showcase\/)*([0-9a-z]*\/)*([0-9]{6,11})[?]?.*)$/),t=e.match(/^([0-9]{6,11})$/);if(o||t)return o?o[6]:t?t[1]:void 0}(n),M=new URLSearchParams;L&&!B&&M.append("autoplay","1"),d&&M.append("muted","1"),void 0!==u&&M.append("loop",Number(u).toString()),void 0!==w&&M.append("controls",Number(w).toString()),M.append("dnt","1");const O=new URL(`https://player.vimeo.com/video/${J??""}`);O.search=M.toString();const U=()=>{x?(R(!1),A(!0),$()):(R(!0),E())};return e(o,{children:L&&B?h({onPlay:()=>k(!1),image:v,aspectRatio:f,sizes:y,fill:g,icon:P,playButtonAriaLabel:S}):/* @__PURE__ */t("div",{ref:V,className:a(c.videoContainer,g&&c.fill),style:g?void 0:{"--aspect-ratio":f.replace("x","/")},children:[
|
|
3
|
+
/* @__PURE__ */e("iframe",{ref:N,className:c.vimeoContainer,src:O.toString(),allow:"autoplay",allowFullScreen:!0}),!w&&(b?/* @__PURE__ */e(b,{isPlaying:x,onClick:U}):/* @__PURE__ */e(p,{isPlaying:x,onClick:U,ariaLabelPlay:S,ariaLabelPause:I}))]})})},{label:"Video"});export{d as VimeoVideoBlock};
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
const fill = "_fill_1flq1_7";
|
|
3
|
-
const vimeoContainer = "_vimeoContainer_1flq1_12";
|
|
4
|
-
const styles = {
|
|
5
|
-
videoContainer,
|
|
6
|
-
fill,
|
|
7
|
-
vimeoContainer
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
styles as default,
|
|
11
|
-
fill,
|
|
12
|
-
videoContainer,
|
|
13
|
-
vimeoContainer
|
|
14
|
-
};
|
|
1
|
+
const i="_videoContainer_1flq1_1",e="_fill_1flq1_7",o="_vimeoContainer_1flq1_12",n={videoContainer:i,fill:e,vimeoContainer:o};export{n as default,e as fill,i as videoContainer,o as vimeoContainer};
|
|
@@ -1,127 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import { useState, useRef, useCallback } from "react";
|
|
5
|
-
import { withPreview } from "../iframebridge/withPreview.js";
|
|
6
|
-
import { PreviewSkeleton } from "../previewskeleton/PreviewSkeleton.js";
|
|
7
|
-
import { PlayPauseButton } from "./helpers/PlayPauseButton.js";
|
|
8
|
-
import { useIsElementInViewport } from "./helpers/useIsElementInViewport.js";
|
|
9
|
-
import styles from "./YouTubeVideoBlock.module.scss.js";
|
|
10
|
-
const EXPECTED_YT_ID_LENGTH = 11;
|
|
11
|
-
const parseYoutubeIdentifier = (value) => {
|
|
12
|
-
const regExp = /(https?:\/\/)?(((m|www)\.)?(youtube(-nocookie)?|youtube.googleapis)\.com.*(v\/|v=|vi=|vi\/|e\/|embed\/|user\/.*\/u\/\d+\/)|youtu\.be\/)([_0-9a-zA-Z-]+)/;
|
|
13
|
-
const match = value.match(regExp);
|
|
14
|
-
const youtubeId = value.length === EXPECTED_YT_ID_LENGTH ? value : match && match[8].length === EXPECTED_YT_ID_LENGTH ? match[8] : null;
|
|
15
|
-
return youtubeId ?? void 0;
|
|
16
|
-
};
|
|
17
|
-
const YouTubeVideoBlock = withPreview(
|
|
18
|
-
({
|
|
19
|
-
data: { youtubeIdentifier, autoplay, loop, showControls, previewImage },
|
|
20
|
-
aspectRatio = "16x9",
|
|
21
|
-
previewImageSizes,
|
|
22
|
-
renderPreviewImage,
|
|
23
|
-
fill,
|
|
24
|
-
previewImageIcon,
|
|
25
|
-
playButtonAriaLabel,
|
|
26
|
-
pauseButtonAriaLabel,
|
|
27
|
-
playPauseButton: PlayPauseButtonComponent
|
|
28
|
-
}) => {
|
|
29
|
-
const [showPreviewImage, setShowPreviewImage] = useState(true);
|
|
30
|
-
const [isPlaying, setIsPlaying] = useState(autoplay ?? false);
|
|
31
|
-
const [isHandledManually, setIsHandledManually] = useState(false);
|
|
32
|
-
const hasPreviewImage = !!(previewImage && previewImage.damFile);
|
|
33
|
-
const [iframeElement, setIframeElement] = useState(null);
|
|
34
|
-
const iframeRef = setIframeElement;
|
|
35
|
-
const inViewRef = useRef(null);
|
|
36
|
-
const pauseYouTubeVideo = useCallback(() => {
|
|
37
|
-
var _a;
|
|
38
|
-
(_a = iframeElement == null ? void 0 : iframeElement.contentWindow) == null ? void 0 : _a.postMessage(`{"event":"command","func":"pauseVideo","args":""}`, "https://www.youtube-nocookie.com");
|
|
39
|
-
}, [iframeElement]);
|
|
40
|
-
const playYouTubeVideo = useCallback(() => {
|
|
41
|
-
var _a;
|
|
42
|
-
(_a = iframeElement == null ? void 0 : iframeElement.contentWindow) == null ? void 0 : _a.postMessage(`{"event":"command","func":"playVideo","args":""}`, "https://www.youtube-nocookie.com");
|
|
43
|
-
}, [iframeElement]);
|
|
44
|
-
const handleInView = useCallback(
|
|
45
|
-
(inView) => {
|
|
46
|
-
if (!isHandledManually) {
|
|
47
|
-
if (inView && autoplay) {
|
|
48
|
-
playYouTubeVideo();
|
|
49
|
-
setIsPlaying(true);
|
|
50
|
-
} else {
|
|
51
|
-
pauseYouTubeVideo();
|
|
52
|
-
setIsPlaying(false);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
[autoplay, isHandledManually, playYouTubeVideo, pauseYouTubeVideo]
|
|
57
|
-
);
|
|
58
|
-
useIsElementInViewport(inViewRef, handleInView);
|
|
59
|
-
if (!youtubeIdentifier) {
|
|
60
|
-
return /* @__PURE__ */ jsx(PreviewSkeleton, { type: "media", hasContent: false, aspectRatio });
|
|
61
|
-
}
|
|
62
|
-
const identifier = parseYoutubeIdentifier(youtubeIdentifier);
|
|
63
|
-
const searchParams = new URLSearchParams();
|
|
64
|
-
searchParams.append("modestbranding", "1");
|
|
65
|
-
searchParams.append("rel", "0");
|
|
66
|
-
searchParams.append("enablejsapi", "1");
|
|
67
|
-
if (hasPreviewImage && !showPreviewImage) searchParams.append("autoplay", "1");
|
|
68
|
-
if (autoplay) searchParams.append("mute", "1");
|
|
69
|
-
if (showControls !== void 0) searchParams.append("controls", Number(showControls).toString());
|
|
70
|
-
if (loop !== void 0) searchParams.append("loop", Number(loop).toString());
|
|
71
|
-
if (loop && identifier) searchParams.append("playlist", identifier);
|
|
72
|
-
const youtubeBaseUrl = "https://www.youtube-nocookie.com/embed/";
|
|
73
|
-
const youtubeUrl = new URL(`${youtubeBaseUrl}${identifier ?? ""}`);
|
|
74
|
-
youtubeUrl.search = searchParams.toString();
|
|
75
|
-
const handlePlayPauseClick = () => {
|
|
76
|
-
if (isPlaying) {
|
|
77
|
-
setIsPlaying(false);
|
|
78
|
-
setIsHandledManually(true);
|
|
79
|
-
pauseYouTubeVideo();
|
|
80
|
-
} else {
|
|
81
|
-
setIsPlaying(true);
|
|
82
|
-
playYouTubeVideo();
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
return /* @__PURE__ */ jsx(Fragment, { children: hasPreviewImage && showPreviewImage ? renderPreviewImage({
|
|
86
|
-
onPlay: () => setShowPreviewImage(false),
|
|
87
|
-
image: previewImage,
|
|
88
|
-
aspectRatio,
|
|
89
|
-
sizes: previewImageSizes,
|
|
90
|
-
fill,
|
|
91
|
-
icon: previewImageIcon,
|
|
92
|
-
playButtonAriaLabel
|
|
93
|
-
}) : /* @__PURE__ */ jsxs(
|
|
94
|
-
"div",
|
|
95
|
-
{
|
|
96
|
-
ref: inViewRef,
|
|
97
|
-
className: clsx(styles.videoContainer, fill && styles.fill),
|
|
98
|
-
style: !fill ? { "--aspect-ratio": aspectRatio.replace("x", "/") } : void 0,
|
|
99
|
-
children: [
|
|
100
|
-
!showControls && (PlayPauseButtonComponent ? /* @__PURE__ */ jsx(PlayPauseButtonComponent, { isPlaying, onClick: handlePlayPauseClick }) : /* @__PURE__ */ jsx(
|
|
101
|
-
PlayPauseButton,
|
|
102
|
-
{
|
|
103
|
-
isPlaying,
|
|
104
|
-
onClick: handlePlayPauseClick,
|
|
105
|
-
ariaLabelPlay: playButtonAriaLabel,
|
|
106
|
-
ariaLabelPause: pauseButtonAriaLabel
|
|
107
|
-
}
|
|
108
|
-
)),
|
|
109
|
-
/* @__PURE__ */ jsx(
|
|
110
|
-
"iframe",
|
|
111
|
-
{
|
|
112
|
-
ref: iframeRef,
|
|
113
|
-
className: styles.youtubeContainer,
|
|
114
|
-
allow: "autoplay",
|
|
115
|
-
referrerPolicy: "strict-origin-when-cross-origin",
|
|
116
|
-
src: youtubeUrl.toString()
|
|
117
|
-
}
|
|
118
|
-
)
|
|
119
|
-
]
|
|
120
|
-
}
|
|
121
|
-
) });
|
|
122
|
-
},
|
|
123
|
-
{ label: "Video" }
|
|
124
|
-
);
|
|
125
|
-
export {
|
|
126
|
-
YouTubeVideoBlock
|
|
127
|
-
};
|
|
2
|
+
import{jsx as e,Fragment as o,jsxs as t}from"react/jsx-runtime";import a from"clsx";import{useState as i,useRef as n,useCallback as r}from"react";import{withPreview as s}from"../iframebridge/withPreview.js";import{PreviewSkeleton as l}from"../previewskeleton/PreviewSkeleton.js";import{PlayPauseButton as p}from"./helpers/PlayPauseButton.js";import{useIsElementInViewport as u}from"./helpers/useIsElementInViewport.js";import m from"./YouTubeVideoBlock.module.scss.js";const c=s(({data:{youtubeIdentifier:s,autoplay:c,loop:d,showControls:w,previewImage:y},aspectRatio:b="16x9",previewImageSizes:g,renderPreviewImage:v,fill:f,previewImageIcon:h,playButtonAriaLabel:P,pauseButtonAriaLabel:k,playPauseButton:I})=>{const[B,S]=i(!0),[j,L]=i(c??!1),[V,C]=i(!1),x=!(!y||!y.damFile),[R,A]=i(null),N=A,z=n(null),E=r(()=>{R?.contentWindow?.postMessage('{"event":"command","func":"pauseVideo","args":""}',"https://www.youtube-nocookie.com")},[R]),M=r(()=>{R?.contentWindow?.postMessage('{"event":"command","func":"playVideo","args":""}',"https://www.youtube-nocookie.com")},[R]),T=r(e=>{V||(e&&c?(M(),L(!0)):(E(),L(!1)))},[c,V,M,E]);if(u(z,T),!s)return e(l,{type:"media",hasContent:!1,aspectRatio:b});const U=(e=>{const o=e.match(/(https?:\/\/)?(((m|www)\.)?(youtube(-nocookie)?|youtube.googleapis)\.com.*(v\/|v=|vi=|vi\/|e\/|embed\/|user\/.*\/u\/\d+\/)|youtu\.be\/)([_0-9a-zA-Z-]+)/);return(11===e.length?e:o&&11===o[8].length?o[8]:null)??void 0})(s),W=new URLSearchParams;W.append("modestbranding","1"),W.append("rel","0"),W.append("enablejsapi","1"),x&&!B&&W.append("autoplay","1"),c&&W.append("mute","1"),void 0!==w&&W.append("controls",Number(w).toString()),void 0!==d&&W.append("loop",Number(d).toString()),d&&U&&W.append("playlist",U);const Y=new URL(`https://www.youtube-nocookie.com/embed/${U??""}`);Y.search=W.toString();const F=()=>{j?(L(!1),C(!0),E()):(L(!0),M())};return e(o,{children:x&&B?v({onPlay:()=>S(!1),image:y,aspectRatio:b,sizes:g,fill:f,icon:h,playButtonAriaLabel:P}):/* @__PURE__ */t("div",{ref:z,className:a(m.videoContainer,f&&m.fill),style:f?void 0:{"--aspect-ratio":b.replace("x","/")},children:[!w&&(I?/* @__PURE__ */e(I,{isPlaying:j,onClick:F}):/* @__PURE__ */e(p,{isPlaying:j,onClick:F,ariaLabelPlay:P,ariaLabelPause:k})),
|
|
3
|
+
/* @__PURE__ */e("iframe",{ref:N,className:m.youtubeContainer,allow:"autoplay",referrerPolicy:"strict-origin-when-cross-origin",src:Y.toString()})]})})},{label:"Video"});export{c as YouTubeVideoBlock};
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
const fill = "_fill_bhmhr_7";
|
|
3
|
-
const youtubeContainer = "_youtubeContainer_bhmhr_12";
|
|
4
|
-
const styles = {
|
|
5
|
-
videoContainer,
|
|
6
|
-
fill,
|
|
7
|
-
youtubeContainer
|
|
8
|
-
};
|
|
9
|
-
export {
|
|
10
|
-
styles as default,
|
|
11
|
-
fill,
|
|
12
|
-
videoContainer,
|
|
13
|
-
youtubeContainer
|
|
14
|
-
};
|
|
1
|
+
const e="_videoContainer_bhmhr_1",o="_fill_bhmhr_7",n="_youtubeContainer_bhmhr_12",i={videoContainer:e,fill:o,youtubeContainer:n};export{i as default,o as fill,e as videoContainer,n as youtubeContainer};
|
|
@@ -1,27 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Fragment as Fragment$1 } from "react";
|
|
3
|
-
import { ErrorHandlerBoundary } from "../../errorHandler/ErrorHandlerBoundary.js";
|
|
4
|
-
import { PreviewSkeleton } from "../../previewskeleton/PreviewSkeleton.js";
|
|
5
|
-
const BlocksBlock = ({ supportedBlocks, data: { blocks } }) => {
|
|
6
|
-
if (blocks.length === 0) {
|
|
7
|
-
return /* @__PURE__ */ jsx(PreviewSkeleton, { hasContent: false });
|
|
8
|
-
}
|
|
9
|
-
return /* @__PURE__ */ jsx(Fragment, { children: blocks.map((block) => {
|
|
10
|
-
const blockFunction = supportedBlocks[block.type];
|
|
11
|
-
if (!blockFunction) {
|
|
12
|
-
if (process.env.NODE_ENV === "development") {
|
|
13
|
-
return /* @__PURE__ */ jsxs("pre", { children: [
|
|
14
|
-
"Unknown type (",
|
|
15
|
-
block.type,
|
|
16
|
-
"): ",
|
|
17
|
-
JSON.stringify(block.props)
|
|
18
|
-
] }, block.key);
|
|
19
|
-
}
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(ErrorHandlerBoundary, { children: blockFunction(block.props) }) }, block.key);
|
|
23
|
-
}) });
|
|
24
|
-
};
|
|
25
|
-
export {
|
|
26
|
-
BlocksBlock
|
|
27
|
-
};
|
|
1
|
+
import{jsx as r,Fragment as e,jsxs as o}from"react/jsx-runtime";import{Fragment as n}from"react";import{ErrorHandlerBoundary as t}from"../../errorHandler/ErrorHandlerBoundary.js";import{PreviewSkeleton as s}from"../../previewskeleton/PreviewSkeleton.js";const p=({supportedBlocks:p,data:{blocks:l}})=>0===l.length?/* @__PURE__ */r(s,{hasContent:!1}):/* @__PURE__ */r(e,{children:l.map(e=>{const s=p[e.type];return s?/* @__PURE__ */r(n,{children:/* @__PURE__ */r(t,{children:s(e.props)})},e.key):"development"===process.env.NODE_ENV?/* @__PURE__ */o("pre",{children:["Unknown type (",e.type,"): ",JSON.stringify(e.props)]},e.key):null})});export{p as BlocksBlock};
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Fragment as Fragment$1 } from "react";
|
|
3
|
-
import { ErrorHandlerBoundary } from "../../errorHandler/ErrorHandlerBoundary.js";
|
|
4
|
-
import { PreviewSkeleton } from "../../previewskeleton/PreviewSkeleton.js";
|
|
5
|
-
const ListBlock = ({ block: blockFunction, data: { blocks } }) => {
|
|
6
|
-
if (blocks.length === 0) {
|
|
7
|
-
return /* @__PURE__ */ jsx(PreviewSkeleton, { hasContent: false });
|
|
8
|
-
}
|
|
9
|
-
return /* @__PURE__ */ jsx(Fragment, { children: blocks.map((block) => /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(ErrorHandlerBoundary, { children: blockFunction(block.props) }) }, block.key)) });
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
ListBlock
|
|
13
|
-
};
|
|
1
|
+
import{jsx as r,Fragment as e}from"react/jsx-runtime";import{Fragment as o}from"react";import{ErrorHandlerBoundary as t}from"../../errorHandler/ErrorHandlerBoundary.js";import{PreviewSkeleton as n}from"../../previewskeleton/PreviewSkeleton.js";const a=({block:a,data:{blocks:l}})=>0===l.length?/* @__PURE__ */r(n,{hasContent:!1}):/* @__PURE__ */r(e,{children:l.map(e=>/* @__PURE__ */r(o,{children:/* @__PURE__ */r(t,{children:a(e.props)})},e.key))});export{a as ListBlock};
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ErrorHandlerBoundary } from "../../errorHandler/ErrorHandlerBoundary.js";
|
|
3
|
-
const OneOfBlock = ({ data: { block, ...additionalProps }, supportedBlocks, children, className }) => {
|
|
4
|
-
if (!block) {
|
|
5
|
-
return null;
|
|
6
|
-
}
|
|
7
|
-
const blockFunction = supportedBlocks[block.type];
|
|
8
|
-
if (!blockFunction) {
|
|
9
|
-
if (process.env.NODE_ENV === "development") {
|
|
10
|
-
return /* @__PURE__ */ jsxs("pre", { children: [
|
|
11
|
-
"Unknown type (",
|
|
12
|
-
block.type,
|
|
13
|
-
"): ",
|
|
14
|
-
JSON.stringify(block.props)
|
|
15
|
-
] });
|
|
16
|
-
}
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
19
|
-
return /* @__PURE__ */ jsx(ErrorHandlerBoundary, { children: blockFunction({ ...block.props, ...additionalProps, children, className }) });
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
OneOfBlock
|
|
23
|
-
};
|
|
1
|
+
import{jsx as r,jsxs as e}from"react/jsx-runtime";import{ErrorHandlerBoundary as n}from"../../errorHandler/ErrorHandlerBoundary.js";const o=({data:{block:o,...l},supportedBlocks:s,children:t,className:p})=>{if(!o)return null;const a=s[o.type];return a?/* @__PURE__ */r(n,{children:a({...o.props,...l,children:t,className:p})}):"development"===process.env.NODE_ENV?/* @__PURE__ */e("pre",{children:["Unknown type (",o.type,"): ",JSON.stringify(o.props)]}):null};export{o as OneOfBlock};
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
const OptionalBlock = ({ block: blockFunction, data: { visible, block }, children }) => {
|
|
3
|
-
if (!visible || !block) {
|
|
4
|
-
return null;
|
|
5
|
-
}
|
|
6
|
-
return /* @__PURE__ */ jsx(Fragment, { children: blockFunction({ ...block, children }) });
|
|
7
|
-
};
|
|
8
|
-
export {
|
|
9
|
-
OptionalBlock
|
|
10
|
-
};
|
|
1
|
+
import{jsx as l,Fragment as c}from"react/jsx-runtime";const i=({block:i,data:{visible:o,block:r},children:e})=>o&&r?/* @__PURE__ */l(c,{children:i({...r,children:e})}):null;export{i as OptionalBlock};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import
|
|
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
|
-
};
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import s from"clsx";import e from"./PlayPauseButton.module.scss.js";const l=({isPlaying:l,onClick:t,ariaLabelPlay:i,ariaLabelPause:o})=>/* @__PURE__ */a("button",{className:s(e.button),onClick:t,"aria-label":l?o??"Pause":i??"Play",children:/* @__PURE__ */a("div",{className:s(e.animatedPlayPause,l&&e.animatedPlayPausePaused)})});export{l as PlayPauseButton};
|