@cntrl-site/sdk-nextjs 1.0.9 → 1.0.10

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.
@@ -66,7 +66,7 @@ const VimeoEmbedItem = ({ item, sectionId, onResize }) => {
66
66
  if (!vimeoPlayer || play !== 'on-hover')
67
67
  return;
68
68
  vimeoPlayer.pause();
69
- }, children: [(0, jsx_runtime_1.jsx)("img", { ref: setImgRef, onClick: () => onCoverClick(), src: (_c = item.commonParams.coverUrl) !== null && _c !== void 0 ? _c : '', style: {
69
+ }, children: [item.commonParams.coverUrl && ((0, jsx_runtime_1.jsx)("img", { ref: setImgRef, onClick: () => onCoverClick(), src: (_c = item.commonParams.coverUrl) !== null && _c !== void 0 ? _c : '', style: {
70
70
  display: isCoverVisible ? 'block' : 'none',
71
71
  cursor: 'pointer',
72
72
  position: 'absolute',
@@ -75,7 +75,7 @@ const VimeoEmbedItem = ({ item, sectionId, onResize }) => {
75
75
  width: '100%',
76
76
  top: '0',
77
77
  left: '0'
78
- }, alt: "Cover img" }), (0, jsx_runtime_1.jsx)("iframe", { ref: setIframeRef, className: "embedVideo", src: validUrl || '', allow: "autoplay; fullscreen; picture-in-picture;", allowFullScreen: true, style: Object.assign({}, (radius !== undefined ? { borderRadius: `${radius * 100}vw` } : {})) })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
78
+ }, alt: "Cover img" })), (0, jsx_runtime_1.jsx)("iframe", { ref: setIframeRef, className: "embedVideo", src: validUrl || '', allow: "autoplay; fullscreen; picture-in-picture;", allowFullScreen: true, style: Object.assign({}, (radius !== undefined ? { borderRadius: `${radius * 100}vw` } : {})) })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
79
79
  .embed-video-wrapper-${item.id} {
80
80
  position: absolute;
81
81
  width: 100%;
@@ -83,7 +83,7 @@ const YoutubeEmbedItem = ({ item, sectionId, onResize }) => {
83
83
  if (!player || play !== 'on-hover')
84
84
  return;
85
85
  player.pauseVideo();
86
- }, style: Object.assign(Object.assign(Object.assign({}, (opacity !== undefined ? { opacity } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), (blur !== undefined ? { filter: `blur(${blur * 100}vw)` } : {})), children: [(0, jsx_runtime_1.jsx)("img", { ref: setImgRef, onClick: () => onCoverClick(), src: (_c = item.commonParams.coverUrl) !== null && _c !== void 0 ? _c : '', style: {
86
+ }, style: Object.assign(Object.assign(Object.assign({}, (opacity !== undefined ? { opacity } : {})), (angle !== undefined ? { transform: `rotate(${angle}deg)` } : {})), (blur !== undefined ? { filter: `blur(${blur * 100}vw)` } : {})), children: [item.commonParams.coverUrl && ((0, jsx_runtime_1.jsx)("img", { ref: setImgRef, onClick: () => onCoverClick(), src: (_c = item.commonParams.coverUrl) !== null && _c !== void 0 ? _c : '', style: {
87
87
  display: isCoverVisible ? 'block' : 'none',
88
88
  cursor: 'pointer',
89
89
  position: 'absolute',
@@ -93,7 +93,7 @@ const YoutubeEmbedItem = ({ item, sectionId, onResize }) => {
93
93
  top: '0',
94
94
  left: '0',
95
95
  zIndex: 1
96
- }, alt: "Cover img" }), (0, jsx_runtime_1.jsx)("div", { className: `embed-${item.id}`, ref: setDiv, style: Object.assign({}, (radius !== undefined ? { borderRadius: `${radius * 100}vw` } : {})) })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
96
+ }, alt: "Cover img" })), (0, jsx_runtime_1.jsx)("div", { className: `embed-${item.id}`, ref: setDiv, style: Object.assign({}, (radius !== undefined ? { borderRadius: `${radius * 100}vw` } : {})) })] }), (0, jsx_runtime_1.jsx)(style_1.default, { id: id, children: `
97
97
  .embed-youtube-video-wrapper-${item.id},
98
98
  .embed-${item.id} {
99
99
  position: absolute;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk-nextjs",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "SDK for Next.js",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/index.ts",
@@ -73,22 +73,24 @@ export const VimeoEmbedItem: FC<ItemProps<TVimeoEmbedItem>> = ({ item, sectionId
73
73
  vimeoPlayer.pause();
74
74
  }}
75
75
  >
76
- <img
77
- ref={setImgRef}
78
- onClick={() => onCoverClick()}
79
- src={item.commonParams.coverUrl ?? ''}
80
- style={{
81
- display: isCoverVisible ? 'block' : 'none',
82
- cursor: 'pointer',
83
- position: 'absolute',
84
- objectFit: 'cover',
85
- height: '100%',
86
- width: '100%',
87
- top: '0',
88
- left: '0'
89
- }}
90
- alt="Cover img"
91
- />
76
+ {item.commonParams.coverUrl && (
77
+ <img
78
+ ref={setImgRef}
79
+ onClick={() => onCoverClick()}
80
+ src={item.commonParams.coverUrl ?? ''}
81
+ style={{
82
+ display: isCoverVisible ? 'block' : 'none',
83
+ cursor: 'pointer',
84
+ position: 'absolute',
85
+ objectFit: 'cover',
86
+ height: '100%',
87
+ width: '100%',
88
+ top: '0',
89
+ left: '0'
90
+ }}
91
+ alt="Cover img"
92
+ />
93
+ )}
92
94
  <iframe
93
95
  ref={setIframeRef}
94
96
  className="embedVideo"
@@ -87,23 +87,25 @@ export const YoutubeEmbedItem: FC<ItemProps<TYoutubeEmbedItem>> = ({ item, secti
87
87
  ...(blur !== undefined ? { filter: `blur(${blur * 100}vw)` } : {}),
88
88
  }}
89
89
  >
90
- <img
91
- ref={setImgRef}
92
- onClick={() => onCoverClick()}
93
- src={item.commonParams.coverUrl ?? ''}
94
- style={{
95
- display: isCoverVisible ? 'block' : 'none',
96
- cursor: 'pointer',
97
- position: 'absolute',
98
- objectFit: 'cover',
99
- height: '100%',
100
- width: '100%',
101
- top: '0',
102
- left: '0',
103
- zIndex: 1
104
- }}
105
- alt="Cover img"
106
- />
90
+ {item.commonParams.coverUrl && (
91
+ <img
92
+ ref={setImgRef}
93
+ onClick={() => onCoverClick()}
94
+ src={item.commonParams.coverUrl ?? ''}
95
+ style={{
96
+ display: isCoverVisible ? 'block' : 'none',
97
+ cursor: 'pointer',
98
+ position: 'absolute',
99
+ objectFit: 'cover',
100
+ height: '100%',
101
+ width: '100%',
102
+ top: '0',
103
+ left: '0',
104
+ zIndex: 1
105
+ }}
106
+ alt="Cover img"
107
+ />
108
+ )}
107
109
  <div
108
110
  className={`embed-${item.id}`}
109
111
  ref={setDiv}