@comet/site-react 9.0.0-beta.3 → 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/blockLoader/blockLoader.js +1 -59
- package/lib/blocks/DamFileDownloadLinkBlock.js +1 -27
- package/lib/blocks/DamVideoBlock.js +5 -99
- package/lib/blocks/DamVideoBlock.module.scss.js +1 -14
- package/lib/blocks/EmailLinkBlock.js +1 -21
- package/lib/blocks/ExternalLinkBlock.js +1 -47
- package/lib/blocks/PhoneLinkBlock.js +1 -21
- package/lib/blocks/SvgImageBlock.js +1 -30
- package/lib/blocks/VimeoVideoBlock.js +4 -129
- package/lib/blocks/VimeoVideoBlock.module.scss.js +1 -14
- package/lib/blocks/YouTubeVideoBlock.js +4 -136
- package/lib/blocks/YouTubeVideoBlock.module.scss.js +1 -14
- package/lib/blocks/factories/BlocksBlock.js +1 -27
- package/lib/blocks/factories/ListBlock.js +1 -13
- package/lib/blocks/factories/OneOfBlock.js +1 -23
- package/lib/blocks/factories/OptionalBlock.js +1 -10
- package/lib/blocks/helpers/PlayPauseButton.js +1 -9
- package/lib/blocks/helpers/PlayPauseButton.module.scss.js +1 -14
- package/lib/blocks/helpers/RichTextBlockHelper.js +1 -7
- package/lib/blocks/helpers/TipTapRichTextRenderer.d.ts +35 -0
- package/lib/blocks/helpers/TipTapRichTextRenderer.d.ts.map +1 -0
- package/lib/blocks/helpers/TipTapRichTextRenderer.js +3 -0
- package/lib/blocks/helpers/VideoPreviewImage.js +2 -23
- package/lib/blocks/helpers/VideoPreviewImage.module.scss.js +1 -17
- package/lib/blocks/helpers/useIsElementInViewport.js +1 -21
- package/lib/cookies/CookieApiContext.js +2 -18
- package/lib/cookies/CookieSafe.js +2 -18
- package/lib/cookies/useCookieBotCookieApi.js +1 -33
- package/lib/cookies/useLocalStorageCookieApi.js +1 -40
- package/lib/cookies/useOneTrustCookieApi.js +1 -45
- package/lib/errorHandler/ErrorHandlerBoundary.js +2 -10
- package/lib/errorHandler/ErrorHandlerBoundaryInternal.js +1 -26
- package/lib/errorHandler/ErrorHandlerProvider.js +2 -20
- package/lib/graphQLFetch/fetchInMemoryCache.js +1 -37
- package/lib/graphQLFetch/graphQLFetch.js +1 -125
- package/lib/iframebridge/IFrameBridge.js +4 -253
- package/lib/iframebridge/IFrameBridge.module.scss.js +1 -8
- package/lib/iframebridge/IFrameMessage.js +1 -21
- package/lib/iframebridge/Preview.js +1 -56
- package/lib/iframebridge/Preview.module.scss.js +1 -8
- package/lib/iframebridge/PreviewOverlay.js +1 -28
- package/lib/iframebridge/PreviewOverlay.module.scss.js +1 -8
- package/lib/iframebridge/PreviewOverlayElement.js +2 -36
- package/lib/iframebridge/PreviewOverlayElement.module.scss.js +1 -20
- package/lib/iframebridge/useBlockPreviewFetch.js +1 -29
- package/lib/iframebridge/useIFrameBridge.js +1 -8
- package/lib/iframebridge/utils.js +1 -46
- package/lib/iframebridge/withPreview.js +1 -33
- package/lib/image/Image.js +2 -10
- package/lib/image/image.utils.js +1 -55
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -96
- package/lib/jsonLd/JsonLd.d.ts +7 -0
- package/lib/jsonLd/JsonLd.d.ts.map +1 -0
- package/lib/jsonLd/JsonLd.js +1 -0
- package/lib/persistedQueries/createPersistedQueryGraphQLFetch.js +1 -70
- package/lib/persistedQueries/persistedQueryRoute.js +1 -100
- package/lib/persistedQueries/webpackPersistedQueriesLoader.js +1 -51
- package/lib/preview/BlockPreviewProvider.js +1 -32
- package/lib/preview/PreviewContext.js +1 -9
- package/lib/preview/usePreview.js +1 -41
- package/lib/previewskeleton/PreviewSkeleton.js +8 -64
- package/lib/previewskeleton/PreviewSkeleton.module.scss.js +1 -17
- package/lib/server.d.ts +2 -0
- package/lib/server.d.ts.map +1 -0
- package/lib/server.js +1 -0
- package/lib/sitePreview/iframebridge/SitePreviewIFrameMessage.js +1 -8
- package/lib/sitePreview/iframebridge/sendSitePreviewIFrameMessage.js +1 -6
- package/lib/style.css +1 -1
- package/package.json +15 -8
|
@@ -1,65 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
aspectRatio,
|
|
11
|
-
height: passedHeight,
|
|
12
|
-
hasContent,
|
|
13
|
-
color = "#A8A7A8",
|
|
14
|
-
backgroundColor = type === "media" ? "#efefef" : "#E0DDE0",
|
|
15
|
-
fill = false
|
|
16
|
-
}) => {
|
|
17
|
-
const preview = usePreview();
|
|
18
|
-
const validAspectRatio = getValidAspectRatio(aspectRatio);
|
|
19
|
-
if (preview.showPreviewSkeletons && !hasContent) {
|
|
20
|
-
if (customContainer) {
|
|
21
|
-
return /* @__PURE__ */ jsx(Fragment, { children: customContainer });
|
|
22
|
-
} else if (type === "bar") {
|
|
23
|
-
return /* @__PURE__ */ jsx("div", { className: styles.barSkeleton, style: { "--background-color": backgroundColor, "--color": color }, children: title });
|
|
24
|
-
} else if (type === "rows") {
|
|
25
|
-
return /* @__PURE__ */ jsxs("div", { className: styles.rowsContainer, children: [
|
|
26
|
-
/* @__PURE__ */ jsx("div", { className: styles.rowSkeleton, style: { "--width": "75%", "--background-color": backgroundColor, "--color": color }, children: title }),
|
|
27
|
-
/* @__PURE__ */ jsx("div", { className: styles.rowSkeleton, style: { "--width": "100%", "--background-color": backgroundColor, "--color": color } }),
|
|
28
|
-
/* @__PURE__ */ jsx("div", { className: styles.rowSkeleton, style: { "--width": "50%", "--background-color": backgroundColor, "--color": color } })
|
|
29
|
-
] });
|
|
30
|
-
} else if (type === "media") {
|
|
31
|
-
const height = fill ? "100%" : passedHeight ?? 300;
|
|
32
|
-
return /* @__PURE__ */ jsx(
|
|
33
|
-
"div",
|
|
34
|
-
{
|
|
35
|
-
className: styles.imageContainer,
|
|
36
|
-
style: {
|
|
37
|
-
"--background-color": backgroundColor,
|
|
38
|
-
"--color": color,
|
|
39
|
-
...validAspectRatio === void 0 || fill ? { "--height": typeof height === "string" ? height : `${height}px` } : { "--aspect-ratio": validAspectRatio }
|
|
40
|
-
},
|
|
41
|
-
children: title
|
|
42
|
-
}
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
if (!hasContent) {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
50
|
-
};
|
|
51
|
-
const getValidAspectRatio = (aspectRatio) => {
|
|
52
|
-
if (aspectRatio === "inherit") {
|
|
53
|
-
return void 0;
|
|
54
|
-
}
|
|
55
|
-
if (aspectRatio === "auto") {
|
|
56
|
-
return void 0;
|
|
57
|
-
}
|
|
58
|
-
if (typeof aspectRatio === "string") {
|
|
59
|
-
return aspectRatio.replace("x", "/");
|
|
60
|
-
}
|
|
61
|
-
return aspectRatio;
|
|
62
|
-
};
|
|
63
|
-
export {
|
|
64
|
-
PreviewSkeleton
|
|
65
|
-
};
|
|
2
|
+
import{jsx as e,Fragment as r,jsxs as o}from"react/jsx-runtime";import{usePreview as t}from"../preview/usePreview.js";import i from"./PreviewSkeleton.module.scss.js";const l=({children:l,customContainer:c,title:s,type:a="bar",aspectRatio:d,height:m,hasContent:u,color:h="#A8A7A8",backgroundColor:f=("media"===a?"#efefef":"#E0DDE0"),fill:w=!1})=>{const k=t(),p=n(d);if(k.showPreviewSkeletons&&!u){if(c)/* @__PURE__ */
|
|
3
|
+
return e(r,{children:c});if("bar"===a)/* @__PURE__ */
|
|
4
|
+
return e("div",{className:i.barSkeleton,style:{"--background-color":f,"--color":h},children:s});if("rows"===a)/* @__PURE__ */
|
|
5
|
+
return o("div",{className:i.rowsContainer,children:[
|
|
6
|
+
/* @__PURE__ */e("div",{className:i.rowSkeleton,style:{"--width":"75%","--background-color":f,"--color":h},children:s}),
|
|
7
|
+
/* @__PURE__ */e("div",{className:i.rowSkeleton,style:{"--width":"100%","--background-color":f,"--color":h}}),
|
|
8
|
+
/* @__PURE__ */e("div",{className:i.rowSkeleton,style:{"--width":"50%","--background-color":f,"--color":h}})]});if("media"===a){const r=w?"100%":m??300;/* @__PURE__ */
|
|
9
|
+
return e("div",{className:i.imageContainer,style:{"--background-color":f,"--color":h,...void 0===p||w?{"--height":"string"==typeof r?r:`${r}px`}:{"--aspect-ratio":p}},children:s})}}return u?/* @__PURE__ */e(r,{children:l}):null},n=e=>{if("inherit"!==e&&"auto"!==e)return"string"==typeof e?e.replace("x","/"):e};export{l as PreviewSkeleton};
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
const rowsContainer = "_rowsContainer_zomv4_9";
|
|
3
|
-
const rowSkeleton = "_rowSkeleton_zomv4_14";
|
|
4
|
-
const imageContainer = "_imageContainer_zomv4_22";
|
|
5
|
-
const styles = {
|
|
6
|
-
barSkeleton,
|
|
7
|
-
rowsContainer,
|
|
8
|
-
rowSkeleton,
|
|
9
|
-
imageContainer
|
|
10
|
-
};
|
|
11
|
-
export {
|
|
12
|
-
barSkeleton,
|
|
13
|
-
styles as default,
|
|
14
|
-
imageContainer,
|
|
15
|
-
rowSkeleton,
|
|
16
|
-
rowsContainer
|
|
17
|
-
};
|
|
1
|
+
const o="_barSkeleton_zomv4_1",e="_rowsContainer_zomv4_9",n="_rowSkeleton_zomv4_14",_="_imageContainer_zomv4_22",r={barSkeleton:o,rowsContainer:e,rowSkeleton:n,imageContainer:_};export{o as barSkeleton,r as default,_ as imageContainer,n as rowSkeleton,e as rowsContainer};
|
package/lib/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC"}
|
package/lib/server.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{persistedQueryRoute as e}from"./persistedQueries/persistedQueryRoute.js";export{e as persistedQueryRoute};
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
var
|
|
2
|
-
SitePreviewIFrameMessageType2["OpenLink"] = "OpenLink";
|
|
3
|
-
SitePreviewIFrameMessageType2["SitePreviewLocation"] = "SitePreviewLocation";
|
|
4
|
-
return SitePreviewIFrameMessageType2;
|
|
5
|
-
})(SitePreviewIFrameMessageType || {});
|
|
6
|
-
export {
|
|
7
|
-
SitePreviewIFrameMessageType
|
|
8
|
-
};
|
|
1
|
+
var e=/* @__PURE__ */(e=>(e.OpenLink="OpenLink",e.SitePreviewLocation="SitePreviewLocation",e))(e||{});export{e as SitePreviewIFrameMessageType};
|
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;
|
|
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;inset: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_1jlho_1{position:relative;height:100%}._video_1jlho_6{width:100%;object-fit:cover;aspect-ratio:var(--aspect-ratio)}._fill_1jlho_12{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;inset:0;display:flex;align-items:center;justify-content:center;background-color:#000;opacity:.5;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": "9.0.0-beta.
|
|
3
|
+
"version": "9.0.0-beta.4",
|
|
4
4
|
"description": "Comet Site React package",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"import": "./lib/index.js"
|
|
19
19
|
},
|
|
20
20
|
"./css": "./lib/style.css",
|
|
21
|
+
"./server": {
|
|
22
|
+
"types": "./lib/server.d.ts",
|
|
23
|
+
"import": "./lib/server.js"
|
|
24
|
+
},
|
|
21
25
|
"./webpackPersistedQueriesLoader": "./lib/persistedQueries/webpackPersistedQueriesLoader.js"
|
|
22
26
|
},
|
|
23
27
|
"files": [
|
|
@@ -33,25 +37,28 @@
|
|
|
33
37
|
"devDependencies": {
|
|
34
38
|
"@types/draft-js": "^0.11.20",
|
|
35
39
|
"@types/lodash.isequal": "^4.5.8",
|
|
36
|
-
"@types/react": "^19.2.
|
|
40
|
+
"@types/react": "^19.2.14",
|
|
41
|
+
"@types/react-dom": "^19.2.3",
|
|
37
42
|
"@vitejs/plugin-react": "^4.7.0",
|
|
38
43
|
"chokidar-cli": "^3.0.0",
|
|
39
|
-
"eslint": "^9.39.
|
|
44
|
+
"eslint": "^9.39.4",
|
|
40
45
|
"jsdom": "^28.1.0",
|
|
41
46
|
"npm-run-all2": "^8.0.4",
|
|
42
47
|
"prettier": "^3.6.2",
|
|
43
|
-
"react": "^19.2.
|
|
48
|
+
"react": "^19.2.6",
|
|
49
|
+
"react-dom": "^19.2.6",
|
|
44
50
|
"rimraf": "^6.1.2",
|
|
45
51
|
"rollup": "^4.44.2",
|
|
46
52
|
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
47
53
|
"sass": "^1.89.2",
|
|
54
|
+
"schema-dts": "^2.0.0",
|
|
48
55
|
"typescript": "^5.9.3",
|
|
49
|
-
"vite": "^
|
|
56
|
+
"vite": "^7.2.4",
|
|
50
57
|
"vite-plugin-dts": "^4.5.4",
|
|
51
58
|
"vitest": "^4.0.16",
|
|
52
|
-
"webpack": "^5.
|
|
53
|
-
"@comet/cli": "9.0.0-beta.
|
|
54
|
-
"@comet/eslint-config": "9.0.0-beta.
|
|
59
|
+
"webpack": "^5.106.2",
|
|
60
|
+
"@comet/cli": "9.0.0-beta.4",
|
|
61
|
+
"@comet/eslint-config": "9.0.0-beta.4"
|
|
55
62
|
},
|
|
56
63
|
"peerDependencies": {
|
|
57
64
|
"react": "^18.0.0 || ^19.0.0"
|