@comet/site-nextjs 9.0.0-canary-20251013121422 → 9.0.0-canary-20251124092450
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 +5 -13
- package/lib/blocks/DamVideoBlock.d.ts.map +1 -1
- package/lib/blocks/DamVideoBlock.js +9 -80
- package/lib/blocks/PixelImageBlock.js +1 -9
- package/lib/blocks/VimeoVideoBlock.d.ts +5 -13
- package/lib/blocks/VimeoVideoBlock.d.ts.map +1 -1
- package/lib/blocks/VimeoVideoBlock.js +8 -91
- package/lib/blocks/YouTubeVideoBlock.d.ts +5 -13
- package/lib/blocks/YouTubeVideoBlock.d.ts.map +1 -1
- package/lib/blocks/YouTubeVideoBlock.js +9 -99
- package/lib/blocks/factories/SeoBlock.js +0 -9
- package/lib/blocks/helpers/VideoPreviewImage.d.ts +4 -13
- package/lib/blocks/helpers/VideoPreviewImage.d.ts.map +1 -1
- package/lib/blocks/helpers/VideoPreviewImage.js +5 -19
- package/lib/blocks.generated.d.ts +1 -1
- package/lib/blocks.generated.d.ts.map +1 -1
- package/lib/image/Image.js +0 -9
- package/lib/index.d.ts +2 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +30 -24
- package/lib/{blocks → site-react/lib/blocks}/DamFileDownloadLinkBlock.js +1 -8
- package/lib/site-react/lib/blocks/DamVideoBlock.js +67 -0
- package/lib/{blocks → site-react/lib/blocks}/ExternalLinkBlock.js +1 -9
- package/lib/site-react/lib/blocks/VimeoVideoBlock.js +78 -0
- package/lib/site-react/lib/blocks/YouTubeVideoBlock.js +94 -0
- package/lib/site-react/lib/blocks/helpers/VideoPreviewImage.js +23 -0
- package/lib/site-react/lib/graphQLFetch/fetchInMemoryCache.js +2 -2
- package/lib/site-react/lib/iframebridge/IFrameBridge.js +1 -1
- package/lib/site-react/lib/iframebridge/withPreview.js +1 -1
- package/lib/site-react/lib/persistedQueries/createPersistedQueryGraphQLFetch.js +68 -0
- package/lib/site-react/lib/persistedQueries/persistedQueryRoute.js +100 -0
- package/lib/site-react/lib/persistedQueries/webpackPersistedQueriesLoader.js +51 -0
- package/lib/sitePreview/SitePreviewProvider.d.ts.map +1 -1
- package/lib/sitePreview/SitePreviewProvider.js +3 -10
- package/lib/style.css +1 -1
- package/package.json +15 -12
- package/lib/blocks/DamFileDownloadLinkBlock.d.ts +0 -12
- package/lib/blocks/DamFileDownloadLinkBlock.d.ts.map +0 -1
- package/lib/blocks/EmailLinkBlock.d.ts +0 -12
- package/lib/blocks/EmailLinkBlock.d.ts.map +0 -1
- package/lib/blocks/ExternalLinkBlock.d.ts +0 -12
- package/lib/blocks/ExternalLinkBlock.d.ts.map +0 -1
- package/lib/blocks/PhoneLinkBlock.d.ts +0 -12
- package/lib/blocks/PhoneLinkBlock.d.ts.map +0 -1
- package/lib/sitePreview/iframebridge/SitePreviewIFrameMessage.d.ts +0 -18
- package/lib/sitePreview/iframebridge/SitePreviewIFrameMessage.d.ts.map +0 -1
- package/lib/sitePreview/iframebridge/sendSitePreviewIFrameMessage.d.ts +0 -3
- package/lib/sitePreview/iframebridge/sendSitePreviewIFrameMessage.d.ts.map +0 -1
- /package/lib/{blocks → site-react/lib/blocks}/DamVideoBlock.module.scss.js +0 -0
- /package/lib/{blocks → site-react/lib/blocks}/EmailLinkBlock.js +0 -0
- /package/lib/{blocks → site-react/lib/blocks}/PhoneLinkBlock.js +0 -0
- /package/lib/{blocks → site-react/lib/blocks}/VimeoVideoBlock.module.scss.js +0 -0
- /package/lib/{blocks → site-react/lib/blocks}/YouTubeVideoBlock.module.scss.js +0 -0
- /package/lib/{blocks → site-react/lib/blocks}/helpers/VideoPreviewImage.module.scss.js +0 -0
- /package/lib/{sitePreview → site-react/lib/sitePreview}/iframebridge/SitePreviewIFrameMessage.js +0 -0
- /package/lib/{sitePreview → site-react/lib/sitePreview}/iframebridge/sendSitePreviewIFrameMessage.js +0 -0
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
aspectRatio?: string;
|
|
7
|
-
previewImageSizes?: string;
|
|
8
|
-
renderPreviewImage?: (props: VideoPreviewImageProps) => ReactElement;
|
|
9
|
-
fill?: boolean;
|
|
10
|
-
previewImageIcon?: ReactNode;
|
|
11
|
-
playButtonAriaLabel?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const DamVideoBlock: ({ ...componentProps }: import('@comet/site-react').WithPreviewProps & DamVideoBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { DamVideoBlock as SiteReactDamVideoBlock } from '@comet/site-react';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
4
|
+
type Props = MakeOptional<ComponentProps<typeof SiteReactDamVideoBlock>, "renderPreviewImage">;
|
|
5
|
+
export declare function DamVideoBlock(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
6
|
export {};
|
|
15
7
|
//# sourceMappingURL=DamVideoBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DamVideoBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/DamVideoBlock.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DamVideoBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/DamVideoBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAA+B,MAAM,mBAAmB,CAAC;AACzG,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,KAAK,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC3E,KAAK,KAAK,GAAG,YAAY,CAAC,cAAc,CAAC,OAAO,sBAAsB,CAAC,EAAE,oBAAoB,CAAC,CAAC;AAE/F,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,2CAMzC"}
|
|
@@ -1,84 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { useState, useRef } from "react";
|
|
4
|
-
import "../site-react/lib/errorHandler/ErrorHandlerProvider.js";
|
|
5
|
-
import { PreviewSkeleton } from "../site-react/lib/previewskeleton/PreviewSkeleton.js";
|
|
6
|
-
import { useIsElementInViewport } from "../site-react/lib/blocks/helpers/useIsElementInViewport.js";
|
|
7
|
-
import { withPreview } from "../site-react/lib/iframebridge/withPreview.js";
|
|
8
|
-
import "../site-react/lib/cookies/CookieApiContext.js";
|
|
9
|
-
import "../site-react/lib/iframebridge/IFrameBridge.js";
|
|
10
|
-
import "../site-react/lib/preview/PreviewContext.js";
|
|
11
|
-
import "usehooks-ts";
|
|
12
|
-
import "scroll-into-view-if-needed";
|
|
13
|
-
import "../site-react/lib/preview/BlockPreviewProvider.js";
|
|
14
|
-
import clsx from "clsx";
|
|
15
|
-
import styles from "./DamVideoBlock.module.scss.js";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DamVideoBlock as DamVideoBlock$1 } from "../site-react/lib/blocks/DamVideoBlock.js";
|
|
16
3
|
import { VideoPreviewImage } from "./helpers/VideoPreviewImage.js";
|
|
17
|
-
|
|
18
|
-
({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
previewImageIcon,
|
|
25
|
-
playButtonAriaLabel
|
|
26
|
-
}) => {
|
|
27
|
-
if (damFile === void 0) {
|
|
28
|
-
return /* @__PURE__ */ jsx(PreviewSkeleton, { type: "media", hasContent: false, aspectRatio });
|
|
29
|
-
}
|
|
30
|
-
const [showPreviewImage, setShowPreviewImage] = useState(true);
|
|
31
|
-
const hasPreviewImage = Boolean(previewImage && previewImage.damFile);
|
|
32
|
-
const videoRef = useRef(null);
|
|
33
|
-
useIsElementInViewport(videoRef, (inView) => {
|
|
34
|
-
if (autoplay && videoRef.current) {
|
|
35
|
-
if (inView) {
|
|
36
|
-
videoRef.current.play();
|
|
37
|
-
} else {
|
|
38
|
-
videoRef.current.pause();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
return /* @__PURE__ */ jsx(Fragment, { children: hasPreviewImage && showPreviewImage ? renderPreviewImage ? renderPreviewImage({
|
|
43
|
-
onPlay: () => setShowPreviewImage(false),
|
|
44
|
-
image: previewImage,
|
|
45
|
-
aspectRatio,
|
|
46
|
-
sizes: previewImageSizes,
|
|
47
|
-
fill,
|
|
48
|
-
icon: previewImageIcon
|
|
49
|
-
}) : /* @__PURE__ */ jsx(
|
|
50
|
-
VideoPreviewImage,
|
|
51
|
-
{
|
|
52
|
-
onPlay: () => setShowPreviewImage(false),
|
|
53
|
-
image: previewImage,
|
|
54
|
-
aspectRatio,
|
|
55
|
-
sizes: previewImageSizes,
|
|
56
|
-
fill,
|
|
57
|
-
icon: previewImageIcon,
|
|
58
|
-
playButtonAriaLabel
|
|
59
|
-
}
|
|
60
|
-
) : /* @__PURE__ */ jsxs(
|
|
61
|
-
"video",
|
|
62
|
-
{
|
|
63
|
-
autoPlay: autoplay || hasPreviewImage && !showPreviewImage,
|
|
64
|
-
controls: showControls,
|
|
65
|
-
loop,
|
|
66
|
-
playsInline: true,
|
|
67
|
-
muted: autoplay,
|
|
68
|
-
ref: videoRef,
|
|
69
|
-
className: clsx(styles.video, fill && styles.fill),
|
|
70
|
-
style: !fill ? { "--aspect-ratio": aspectRatio.replace("x", " / ") } : void 0,
|
|
71
|
-
children: [
|
|
72
|
-
damFile.captions.map((caption) => {
|
|
73
|
-
return /* @__PURE__ */ jsx("track", { src: caption.fileUrl, kind: "captions", srcLang: caption.language }, caption.id);
|
|
74
|
-
}),
|
|
75
|
-
/* @__PURE__ */ jsx("source", { src: damFile.fileUrl, type: damFile.mimetype })
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
) });
|
|
79
|
-
},
|
|
80
|
-
{ label: "Video" }
|
|
81
|
-
);
|
|
4
|
+
function DamVideoBlock(props) {
|
|
5
|
+
const defaultRenderPreviewImage = (props2) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(VideoPreviewImage, { ...props2 });
|
|
7
|
+
};
|
|
8
|
+
const renderPreviewImage = props.renderPreviewImage ?? defaultRenderPreviewImage;
|
|
9
|
+
return /* @__PURE__ */ jsx(DamVideoBlock$1, { ...props, renderPreviewImage });
|
|
10
|
+
}
|
|
82
11
|
export {
|
|
83
12
|
DamVideoBlock
|
|
84
13
|
};
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import "react";
|
|
4
|
-
import "../site-react/lib/errorHandler/ErrorHandlerProvider.js";
|
|
5
|
-
import { PreviewSkeleton } from "../site-react/lib/previewskeleton/PreviewSkeleton.js";
|
|
6
3
|
import { withPreview } from "../site-react/lib/iframebridge/withPreview.js";
|
|
7
|
-
import "../site-react/lib/cookies/CookieApiContext.js";
|
|
8
|
-
import "../site-react/lib/iframebridge/IFrameBridge.js";
|
|
9
|
-
import "../site-react/lib/preview/PreviewContext.js";
|
|
10
|
-
import "usehooks-ts";
|
|
11
|
-
import "scroll-into-view-if-needed";
|
|
12
4
|
import { calculateInheritAspectRatio, parseAspectRatio, getMaxDimensionsFromArea, generateImageUrl } from "../site-react/lib/image/image.utils.js";
|
|
13
|
-
import "../site-react/lib/
|
|
5
|
+
import { PreviewSkeleton } from "../site-react/lib/previewskeleton/PreviewSkeleton.js";
|
|
14
6
|
import NextImage from "next/image";
|
|
15
7
|
import styles from "./PixelImageBlock.module.scss.js";
|
|
16
8
|
const PixelImageBlock = withPreview(
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
aspectRatio?: string;
|
|
7
|
-
previewImageSizes?: string;
|
|
8
|
-
renderPreviewImage?: (props: VideoPreviewImageProps) => ReactElement;
|
|
9
|
-
fill?: boolean;
|
|
10
|
-
previewImageIcon?: ReactNode;
|
|
11
|
-
playButtonAriaLabel?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const VimeoVideoBlock: ({ ...componentProps }: import('@comet/site-react').WithPreviewProps & VimeoVideoBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { VimeoVideoBlock as SiteReactVimeoVideoBlock } from '@comet/site-react';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
4
|
+
type Props = MakeOptional<ComponentProps<typeof SiteReactVimeoVideoBlock>, "renderPreviewImage">;
|
|
5
|
+
export declare function VimeoVideoBlock(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
6
|
export {};
|
|
15
7
|
//# sourceMappingURL=VimeoVideoBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VimeoVideoBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/VimeoVideoBlock.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VimeoVideoBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/VimeoVideoBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,eAAe,IAAI,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7G,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,KAAK,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC3E,KAAK,KAAK,GAAG,YAAY,CAAC,cAAc,CAAC,OAAO,wBAAwB,CAAC,EAAE,oBAAoB,CAAC,CAAC;AAEjG,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,2CAM3C"}
|
|
@@ -1,96 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { useState, useRef } from "react";
|
|
4
|
-
import "../site-react/lib/errorHandler/ErrorHandlerProvider.js";
|
|
5
|
-
import { PreviewSkeleton } from "../site-react/lib/previewskeleton/PreviewSkeleton.js";
|
|
6
|
-
import { useIsElementInViewport } from "../site-react/lib/blocks/helpers/useIsElementInViewport.js";
|
|
7
|
-
import { withPreview } from "../site-react/lib/iframebridge/withPreview.js";
|
|
8
|
-
import "../site-react/lib/cookies/CookieApiContext.js";
|
|
9
|
-
import "../site-react/lib/iframebridge/IFrameBridge.js";
|
|
10
|
-
import "../site-react/lib/preview/PreviewContext.js";
|
|
11
|
-
import "usehooks-ts";
|
|
12
|
-
import "scroll-into-view-if-needed";
|
|
13
|
-
import "../site-react/lib/preview/BlockPreviewProvider.js";
|
|
14
|
-
import clsx from "clsx";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { VimeoVideoBlock as VimeoVideoBlock$1 } from "../site-react/lib/blocks/VimeoVideoBlock.js";
|
|
15
3
|
import { VideoPreviewImage } from "./helpers/VideoPreviewImage.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
if (!urlRegExMatch && !idRegExMatch) return void 0;
|
|
23
|
-
if (urlRegExMatch) {
|
|
24
|
-
return urlRegExMatch[6];
|
|
25
|
-
} else if (idRegExMatch) {
|
|
26
|
-
return idRegExMatch[1];
|
|
27
|
-
}
|
|
4
|
+
function VimeoVideoBlock(props) {
|
|
5
|
+
const defaultRenderPreviewImage = (props2) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(VideoPreviewImage, { ...props2 });
|
|
7
|
+
};
|
|
8
|
+
const renderPreviewImage = props.renderPreviewImage ?? defaultRenderPreviewImage;
|
|
9
|
+
return /* @__PURE__ */ jsx(VimeoVideoBlock$1, { ...props, renderPreviewImage });
|
|
28
10
|
}
|
|
29
|
-
const VimeoVideoBlock = withPreview(
|
|
30
|
-
({
|
|
31
|
-
data: { vimeoIdentifier, autoplay, loop, showControls, previewImage },
|
|
32
|
-
aspectRatio = "16x9",
|
|
33
|
-
previewImageSizes,
|
|
34
|
-
renderPreviewImage,
|
|
35
|
-
fill,
|
|
36
|
-
previewImageIcon,
|
|
37
|
-
playButtonAriaLabel
|
|
38
|
-
}) => {
|
|
39
|
-
const [showPreviewImage, setShowPreviewImage] = useState(true);
|
|
40
|
-
const hasPreviewImage = !!(previewImage && previewImage.damFile);
|
|
41
|
-
const inViewRef = useRef(null);
|
|
42
|
-
const iframeRef = useRef(null);
|
|
43
|
-
const handleVisibilityChange = (isVisible) => {
|
|
44
|
-
var _a, _b;
|
|
45
|
-
(_b = (_a = iframeRef.current) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.postMessage(
|
|
46
|
-
JSON.stringify({ method: isVisible && autoplay ? "play" : "pause" }),
|
|
47
|
-
"https://player.vimeo.com"
|
|
48
|
-
);
|
|
49
|
-
};
|
|
50
|
-
useIsElementInViewport(inViewRef, handleVisibilityChange);
|
|
51
|
-
if (!vimeoIdentifier) {
|
|
52
|
-
return /* @__PURE__ */ jsx(PreviewSkeleton, { type: "media", hasContent: false, aspectRatio });
|
|
53
|
-
}
|
|
54
|
-
const identifier = parseVimeoIdentifier(vimeoIdentifier);
|
|
55
|
-
const searchParams = new URLSearchParams();
|
|
56
|
-
if (hasPreviewImage && !showPreviewImage) searchParams.append("autoplay", "1");
|
|
57
|
-
if (autoplay) searchParams.append("muted", "1");
|
|
58
|
-
if (loop !== void 0) searchParams.append("loop", Number(loop).toString());
|
|
59
|
-
if (showControls !== void 0) searchParams.append("controls", Number(showControls).toString());
|
|
60
|
-
searchParams.append("dnt", "1");
|
|
61
|
-
const vimeoBaseUrl = "https://player.vimeo.com/video/";
|
|
62
|
-
const vimeoUrl = new URL(`${vimeoBaseUrl}${identifier ?? ""}`);
|
|
63
|
-
vimeoUrl.search = searchParams.toString();
|
|
64
|
-
return /* @__PURE__ */ jsx(Fragment, { children: hasPreviewImage && showPreviewImage ? renderPreviewImage ? renderPreviewImage({
|
|
65
|
-
onPlay: () => setShowPreviewImage(false),
|
|
66
|
-
image: previewImage,
|
|
67
|
-
aspectRatio,
|
|
68
|
-
sizes: previewImageSizes,
|
|
69
|
-
fill,
|
|
70
|
-
icon: previewImageIcon
|
|
71
|
-
}) : /* @__PURE__ */ jsx(
|
|
72
|
-
VideoPreviewImage,
|
|
73
|
-
{
|
|
74
|
-
onPlay: () => setShowPreviewImage(false),
|
|
75
|
-
image: previewImage,
|
|
76
|
-
aspectRatio,
|
|
77
|
-
sizes: previewImageSizes,
|
|
78
|
-
fill,
|
|
79
|
-
icon: previewImageIcon,
|
|
80
|
-
playButtonAriaLabel
|
|
81
|
-
}
|
|
82
|
-
) : /* @__PURE__ */ jsx(
|
|
83
|
-
"div",
|
|
84
|
-
{
|
|
85
|
-
ref: inViewRef,
|
|
86
|
-
className: clsx(styles.videoContainer, fill && styles.fill),
|
|
87
|
-
style: !fill ? { "--aspect-ratio": aspectRatio.replace("x", "/") } : void 0,
|
|
88
|
-
children: /* @__PURE__ */ jsx("iframe", { ref: iframeRef, className: styles.vimeoContainer, src: vimeoUrl.toString(), allow: "autoplay", allowFullScreen: true })
|
|
89
|
-
}
|
|
90
|
-
) });
|
|
91
|
-
},
|
|
92
|
-
{ label: "Video" }
|
|
93
|
-
);
|
|
94
11
|
export {
|
|
95
12
|
VimeoVideoBlock
|
|
96
13
|
};
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
aspectRatio?: string;
|
|
7
|
-
previewImageSizes?: string;
|
|
8
|
-
renderPreviewImage?: (props: VideoPreviewImageProps) => ReactElement;
|
|
9
|
-
fill?: boolean;
|
|
10
|
-
previewImageIcon?: ReactNode;
|
|
11
|
-
playButtonAriaLabel?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const YouTubeVideoBlock: ({ ...componentProps }: import('@comet/site-react').WithPreviewProps & YouTubeVideoBlockProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { YouTubeVideoBlock as SiteReactYouTubeVideoBlock } from '@comet/site-react';
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
4
|
+
type Props = MakeOptional<ComponentProps<typeof SiteReactYouTubeVideoBlock>, "renderPreviewImage">;
|
|
5
|
+
export declare function YouTubeVideoBlock(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
6
|
export {};
|
|
15
7
|
//# sourceMappingURL=YouTubeVideoBlock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YouTubeVideoBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/YouTubeVideoBlock.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"YouTubeVideoBlock.d.ts","sourceRoot":"","sources":["../../src/blocks/YouTubeVideoBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,iBAAiB,IAAI,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AACjH,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C,KAAK,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC3E,KAAK,KAAK,GAAG,YAAY,CAAC,cAAc,CAAC,OAAO,0BAA0B,CAAC,EAAE,oBAAoB,CAAC,CAAC;AAEnG,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,2CAM7C"}
|
|
@@ -1,103 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import { useState, useRef } from "react";
|
|
4
|
-
import "../site-react/lib/errorHandler/ErrorHandlerProvider.js";
|
|
5
|
-
import { PreviewSkeleton } from "../site-react/lib/previewskeleton/PreviewSkeleton.js";
|
|
6
|
-
import { useIsElementInViewport } from "../site-react/lib/blocks/helpers/useIsElementInViewport.js";
|
|
7
|
-
import { withPreview } from "../site-react/lib/iframebridge/withPreview.js";
|
|
8
|
-
import "../site-react/lib/cookies/CookieApiContext.js";
|
|
9
|
-
import "../site-react/lib/iframebridge/IFrameBridge.js";
|
|
10
|
-
import "../site-react/lib/preview/PreviewContext.js";
|
|
11
|
-
import "usehooks-ts";
|
|
12
|
-
import "scroll-into-view-if-needed";
|
|
13
|
-
import "../site-react/lib/preview/BlockPreviewProvider.js";
|
|
14
|
-
import clsx from "clsx";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { YouTubeVideoBlock as YouTubeVideoBlock$1 } from "../site-react/lib/blocks/YouTubeVideoBlock.js";
|
|
15
3
|
import { VideoPreviewImage } from "./helpers/VideoPreviewImage.js";
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
};
|
|
24
|
-
const YouTubeVideoBlock = withPreview(
|
|
25
|
-
({
|
|
26
|
-
data: { youtubeIdentifier, autoplay, loop, showControls, previewImage },
|
|
27
|
-
aspectRatio = "16x9",
|
|
28
|
-
previewImageSizes,
|
|
29
|
-
renderPreviewImage,
|
|
30
|
-
fill,
|
|
31
|
-
previewImageIcon,
|
|
32
|
-
playButtonAriaLabel
|
|
33
|
-
}) => {
|
|
34
|
-
const [showPreviewImage, setShowPreviewImage] = useState(true);
|
|
35
|
-
const hasPreviewImage = !!(previewImage && previewImage.damFile);
|
|
36
|
-
const iframeRef = useRef(null);
|
|
37
|
-
const inViewRef = useRef(null);
|
|
38
|
-
const pauseYouTubeVideo = () => {
|
|
39
|
-
var _a, _b;
|
|
40
|
-
(_b = (_a = iframeRef.current) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.postMessage(`{"event":"command","func":"pauseVideo","args":""}`, "https://www.youtube-nocookie.com");
|
|
41
|
-
};
|
|
42
|
-
const playYouTubeVideo = () => {
|
|
43
|
-
var _a, _b;
|
|
44
|
-
(_b = (_a = iframeRef.current) == null ? void 0 : _a.contentWindow) == null ? void 0 : _b.postMessage(`{"event":"command","func":"playVideo","args":""}`, "https://www.youtube-nocookie.com");
|
|
45
|
-
};
|
|
46
|
-
useIsElementInViewport(inViewRef, (inView) => {
|
|
47
|
-
if (autoplay) {
|
|
48
|
-
if (inView) {
|
|
49
|
-
playYouTubeVideo();
|
|
50
|
-
} else {
|
|
51
|
-
pauseYouTubeVideo();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
if (!youtubeIdentifier) {
|
|
56
|
-
return /* @__PURE__ */ jsx(PreviewSkeleton, { type: "media", hasContent: false, aspectRatio });
|
|
57
|
-
}
|
|
58
|
-
const identifier = parseYoutubeIdentifier(youtubeIdentifier);
|
|
59
|
-
const searchParams = new URLSearchParams();
|
|
60
|
-
searchParams.append("modestbranding", "1");
|
|
61
|
-
searchParams.append("rel", "0");
|
|
62
|
-
searchParams.append("enablejsapi", "1");
|
|
63
|
-
if (hasPreviewImage && !showPreviewImage) searchParams.append("autoplay", "1");
|
|
64
|
-
if (autoplay) searchParams.append("mute", "1");
|
|
65
|
-
if (showControls !== void 0) searchParams.append("controls", Number(showControls).toString());
|
|
66
|
-
if (loop !== void 0) searchParams.append("loop", Number(loop).toString());
|
|
67
|
-
if (loop && identifier) searchParams.append("playlist", identifier);
|
|
68
|
-
const youtubeBaseUrl = "https://www.youtube-nocookie.com/embed/";
|
|
69
|
-
const youtubeUrl = new URL(`${youtubeBaseUrl}${identifier ?? ""}`);
|
|
70
|
-
youtubeUrl.search = searchParams.toString();
|
|
71
|
-
return /* @__PURE__ */ jsx(Fragment, { children: hasPreviewImage && showPreviewImage ? renderPreviewImage ? renderPreviewImage({
|
|
72
|
-
onPlay: () => setShowPreviewImage(false),
|
|
73
|
-
image: previewImage,
|
|
74
|
-
aspectRatio,
|
|
75
|
-
sizes: previewImageSizes,
|
|
76
|
-
fill,
|
|
77
|
-
icon: previewImageIcon
|
|
78
|
-
}) : /* @__PURE__ */ jsx(
|
|
79
|
-
VideoPreviewImage,
|
|
80
|
-
{
|
|
81
|
-
onPlay: () => setShowPreviewImage(false),
|
|
82
|
-
image: previewImage,
|
|
83
|
-
aspectRatio,
|
|
84
|
-
sizes: previewImageSizes,
|
|
85
|
-
fill,
|
|
86
|
-
icon: previewImageIcon,
|
|
87
|
-
playButtonAriaLabel
|
|
88
|
-
}
|
|
89
|
-
) : /* @__PURE__ */ jsx(
|
|
90
|
-
"div",
|
|
91
|
-
{
|
|
92
|
-
ref: inViewRef,
|
|
93
|
-
className: clsx(styles.videoContainer, fill && styles.fill),
|
|
94
|
-
style: !fill ? { "--aspect-ratio": aspectRatio.replace("x", "/") } : void 0,
|
|
95
|
-
children: /* @__PURE__ */ jsx("iframe", { ref: iframeRef, className: styles.youtubeContainer, allow: "autoplay", src: youtubeUrl.toString() })
|
|
96
|
-
}
|
|
97
|
-
) });
|
|
98
|
-
},
|
|
99
|
-
{ label: "Video" }
|
|
100
|
-
);
|
|
4
|
+
function YouTubeVideoBlock(props) {
|
|
5
|
+
const defaultRenderPreviewImage = (props2) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(VideoPreviewImage, { ...props2 });
|
|
7
|
+
};
|
|
8
|
+
const renderPreviewImage = props.renderPreviewImage ?? defaultRenderPreviewImage;
|
|
9
|
+
return /* @__PURE__ */ jsx(YouTubeVideoBlock$1, { ...props, renderPreviewImage });
|
|
10
|
+
}
|
|
101
11
|
export {
|
|
102
12
|
YouTubeVideoBlock
|
|
103
13
|
};
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "../../site-react/lib/errorHandler/ErrorHandlerProvider.js";
|
|
4
|
-
import "../../site-react/lib/iframebridge/IFrameBridge.js";
|
|
5
|
-
import "../../site-react/lib/preview/PreviewContext.js";
|
|
6
|
-
import "../../site-react/lib/iframebridge/withPreview.js";
|
|
7
|
-
import "../../site-react/lib/cookies/CookieApiContext.js";
|
|
8
|
-
import "usehooks-ts";
|
|
9
|
-
import "scroll-into-view-if-needed";
|
|
10
2
|
import { generateImageUrl } from "../../site-react/lib/image/image.utils.js";
|
|
11
|
-
import "../../site-react/lib/preview/BlockPreviewProvider.js";
|
|
12
3
|
import Head from "next/head";
|
|
13
4
|
const SeoBlock = ({
|
|
14
5
|
data: {
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
image: PixelImageBlockData;
|
|
6
|
-
aspectRatio: string;
|
|
7
|
-
sizes?: string;
|
|
8
|
-
fill?: boolean;
|
|
9
|
-
icon?: ReactNode;
|
|
10
|
-
className?: string;
|
|
11
|
-
playButtonAriaLabel?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const VideoPreviewImage: ({ onPlay, image, aspectRatio, sizes, fill, playButtonAriaLabel, icon, className, }: VideoPreviewImageProps) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import { VideoPreviewImageProps as SiteReactVideoPreviewImageProps } from '@comet/site-react';
|
|
2
|
+
type Props = SiteReactVideoPreviewImageProps;
|
|
3
|
+
export declare function VideoPreviewImage(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export {};
|
|
14
5
|
//# sourceMappingURL=VideoPreviewImage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoPreviewImage.d.ts","sourceRoot":"","sources":["../../../src/blocks/helpers/VideoPreviewImage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"VideoPreviewImage.d.ts","sourceRoot":"","sources":["../../../src/blocks/helpers/VideoPreviewImage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmD,KAAK,sBAAsB,IAAI,+BAA+B,EAAE,MAAM,mBAAmB,CAAC;AAIpJ,KAAK,KAAK,GAAG,+BAA+B,CAAC;AAC7C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,2CAE7C"}
|
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { VideoPreviewImage as VideoPreviewImage$1 } from "../../site-react/lib/blocks/helpers/VideoPreviewImage.js";
|
|
3
3
|
import { PixelImageBlock } from "../PixelImageBlock.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
image,
|
|
8
|
-
aspectRatio,
|
|
9
|
-
sizes = "100vw",
|
|
10
|
-
fill,
|
|
11
|
-
playButtonAriaLabel = "Play video",
|
|
12
|
-
icon = /* @__PURE__ */ jsx(PlayIcon, { playButtonAriaLabel }),
|
|
13
|
-
className
|
|
14
|
-
}) => {
|
|
15
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx(styles.root, fill && styles.fill, className), children: [
|
|
16
|
-
/* @__PURE__ */ jsx(PixelImageBlock, { data: image, aspectRatio, sizes, fill }),
|
|
17
|
-
/* @__PURE__ */ jsx("button", { className: styles.iconWrapper, onClick: onPlay, children: icon })
|
|
18
|
-
] });
|
|
19
|
-
};
|
|
20
|
-
const PlayIcon = ({ playButtonAriaLabel }) => /* @__PURE__ */ jsx("span", { className: styles.playIcon, "aria-label": playButtonAriaLabel });
|
|
4
|
+
function VideoPreviewImage(props) {
|
|
5
|
+
return /* @__PURE__ */ jsx(VideoPreviewImage$1, { ...props, renderImage: (props2) => /* @__PURE__ */ jsx(PixelImageBlock, { ...props2 }) });
|
|
6
|
+
}
|
|
21
7
|
export {
|
|
22
8
|
VideoPreviewImage
|
|
23
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blocks.generated.d.ts","sourceRoot":"","sources":["../src/blocks.generated.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AACD,MAAM,WAAW,4BAA4B;IACzC,IAAI,CAAC,EAAE;QACH,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,YAAY,EAAE,QAAQ,GAAG,UAAU,CAAC;CACvC;AACD,MAAM,WAAW,iBAAiB;IAC9B,cAAc,EAAE,KAAK,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,mBAAmB,GAAG,iBAAiB,CAAC;KAClD,CAAC,CAAC;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,mBAAmB,GAAG,iBAAiB,CAAC;KAClD,CAAC;CACL;AACD,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,mBAAmB,CAAC;IAClC,OAAO,CAAC,EAAE;QACN,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CA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AAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACnB,CAAC;CACL;AACD,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AACD,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;CACvB;AACD,MAAM,WAAW,mBAAmB;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,mBAAmB,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B;AACD,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,mBAAmB,CAAC;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AACD,MAAM,MAAM,aAAa,GACnB,QAAQ,GACR,qBAAqB,GACrB,UAAU,GACV,UAAU,GACV,WAAW,GACX,cAAc,GACd,cAAc,GACd,MAAM,GACN,oBAAoB,GACpB,WAAW,GACX,YAAY,GACZ,UAAU,GACV,KAAK,GACL,OAAO,GACP,UAAU,GACV,WAAW,GACX,UAAU,GACV,YAAY,GACZ,cAAc,CAAC"}
|
package/lib/image/Image.js
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "../site-react/lib/errorHandler/ErrorHandlerProvider.js";
|
|
4
|
-
import "../site-react/lib/iframebridge/IFrameBridge.js";
|
|
5
|
-
import "../site-react/lib/preview/PreviewContext.js";
|
|
6
|
-
import "../site-react/lib/iframebridge/withPreview.js";
|
|
7
|
-
import "../site-react/lib/cookies/CookieApiContext.js";
|
|
8
|
-
import "usehooks-ts";
|
|
9
|
-
import "scroll-into-view-if-needed";
|
|
10
2
|
import { parseAspectRatio, generateImageUrl } from "../site-react/lib/image/image.utils.js";
|
|
11
|
-
import "../site-react/lib/preview/BlockPreviewProvider.js";
|
|
12
3
|
import NextImage from "next/image";
|
|
13
4
|
function Image({ aspectRatio, ...nextImageProps }) {
|
|
14
5
|
const usedAspectRatio = parseAspectRatio(aspectRatio);
|
package/lib/index.d.ts
CHANGED
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
export { DamFileDownloadLinkBlock } from './blocks/DamFileDownloadLinkBlock';
|
|
2
1
|
export { DamVideoBlock } from './blocks/DamVideoBlock';
|
|
3
|
-
export { EmailLinkBlock } from './blocks/EmailLinkBlock';
|
|
4
|
-
export { ExternalLinkBlock } from './blocks/ExternalLinkBlock';
|
|
5
2
|
export { SeoBlock } from './blocks/factories/SeoBlock';
|
|
6
|
-
export type { VideoPreviewImageProps } from './blocks/helpers/VideoPreviewImage';
|
|
7
3
|
export { VideoPreviewImage } from './blocks/helpers/VideoPreviewImage';
|
|
8
4
|
export { InternalLinkBlock } from './blocks/InternalLinkBlock';
|
|
9
|
-
export { PhoneLinkBlock } from './blocks/PhoneLinkBlock';
|
|
10
5
|
export { PixelImageBlock } from './blocks/PixelImageBlock';
|
|
11
6
|
export { VimeoVideoBlock } from './blocks/VimeoVideoBlock';
|
|
12
7
|
export { YouTubeVideoBlock } from './blocks/YouTubeVideoBlock';
|
|
13
8
|
export { createFetchWithDefaultNextRevalidate, createFetchWithDefaults } from './graphQLFetch/graphQLFetch';
|
|
14
9
|
export { Image } from './image/Image';
|
|
15
10
|
export { sitePreviewRoute } from './sitePreview/appRouter/sitePreviewRoute';
|
|
16
|
-
export { sendSitePreviewIFrameMessage } from './sitePreview/iframebridge/sendSitePreviewIFrameMessage';
|
|
17
|
-
export { SitePreviewIFrameMessageType } from './sitePreview/iframebridge/SitePreviewIFrameMessage';
|
|
18
11
|
export { legacyPagesRouterSitePreviewApiHandler } from './sitePreview/pagesRouter/legacyPagesRouterSitePreviewApiHandler';
|
|
19
12
|
export { legacyPagesRouterPreviewParams, previewParams, type SitePreviewParams } from './sitePreview/previewUtils';
|
|
20
13
|
export { SitePreviewProvider } from './sitePreview/SitePreviewProvider';
|
|
21
|
-
export { AdminMessageType, type BlockLoader, type BlockLoaderDependencies, BlockPreviewProvider, BlocksBlock, calculateInheritAspectRatio, convertPreviewDataToHeaders, type CookieApi, CookieApiProvider, CookieSafe, createFetchWithPreviewHeaders, createGraphQLFetch, ErrorHandlerBoundary, ErrorHandlerProvider, generateImageUrl, getMaxDimensionsFromArea, gql, type GraphQLFetch, hasRichTextBlockContent, type IAdminContentScopeMessage, type IAdminGraphQLApiUrlMessage, type IAdminHoverComponentMessage, type IAdminShowOnlyVisibleMessage, IFrameBridgeProvider, type IFrameHoverComponentMessage, type IFrameLocationMessage, type IFrameMessage, IFrameMessageType, type IFrameOpenLinkMessage, type IFrameSelectComponentMessage, type ImageDimensions, type IReadyIFrameMessage, isWithPreviewPropsData, ListBlock, OneOfBlock, OptionalBlock, parseAspectRatio, Preview, type PreviewData, PreviewSkeleton, type PropsWithData, recursivelyLoadBlockData,
|
|
14
|
+
export { AdminMessageType, type BlockLoader, type BlockLoaderDependencies, type BlockLoaderOptions, BlockPreviewProvider, BlocksBlock, calculateInheritAspectRatio, convertPreviewDataToHeaders, type CookieApi, CookieApiProvider, CookieSafe, createFetchInMemoryCache, createFetchWithPreviewHeaders, createGraphQLFetch, createPersistedQueryGraphQLFetch, DamFileDownloadLinkBlock, EmailLinkBlock, ErrorHandlerBoundary, ErrorHandlerProvider, ExternalLinkBlock, generateImageUrl, getMaxDimensionsFromArea, gql, type GraphQLFetch, hasRichTextBlockContent, type IAdminContentScopeMessage, type IAdminGraphQLApiUrlMessage, type IAdminHoverComponentMessage, type IAdminShowOnlyVisibleMessage, IFrameBridgeProvider, type IFrameHoverComponentMessage, type IFrameLocationMessage, type IFrameMessage, IFrameMessageType, type IFrameOpenLinkMessage, type IFrameSelectComponentMessage, type ImageDimensions, type IReadyIFrameMessage, isWithPreviewPropsData, ListBlock, OneOfBlock, OptionalBlock, parseAspectRatio, persistedQueryRoute, PhoneLinkBlock, Preview, type PreviewData, PreviewSkeleton, type PropsWithData, recursivelyLoadBlockData, sendSitePreviewIFrameMessage,
|
|
22
15
|
/** @deprecated Use PreviewData instead. */
|
|
23
|
-
type PreviewData as SitePreviewData, type SupportedBlocks, SvgImageBlock, useBlockPreviewFetch, useCookieApi, useCookieBotCookieApi, useIFrameBridge, useIsElementInViewport, useLocalStorageCookieApi, useOneTrustCookieApi, usePreview, withPreview, type WithPreviewProps, } from '@comet/site-react';
|
|
16
|
+
type PreviewData as SitePreviewData, SitePreviewIFrameMessageType, type SupportedBlocks, SvgImageBlock, useBlockPreviewFetch, useCookieApi, useCookieBotCookieApi, useIFrameBridge, useIsElementInViewport, useLocalStorageCookieApi, useOneTrustCookieApi, usePreview, type VideoPreviewImageProps, webpackPersistedQueriesLoader, withPreview, type WithPreviewProps, } from '@comet/site-react';
|
|
24
17
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BA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