pb-sxp-ui 1.0.27 → 1.0.29

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/dist/index.css CHANGED
@@ -1409,6 +1409,10 @@ button.swiper-pagination-bullet {
1409
1409
  background: #000 !important;
1410
1410
  opacity: 1 !important;
1411
1411
  }
1412
+ .video-container {
1413
+ -webkit-transform: translate3d(0px, 0px, 0px);
1414
+ transform: translate3d(0px, 0px, 0px);
1415
+ }
1412
1416
  .video-container video {
1413
1417
  width: 100%;
1414
1418
  height: 100%;
package/dist/index.js CHANGED
@@ -12070,13 +12070,24 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12070
12070
  });
12071
12071
  }
12072
12072
  }, [data, index, bffEventReport]);
12073
+ const blur = useMemo(() => {
12074
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
12075
+ }, [videoPostConfig]);
12076
+ const translateY = useMemo(() => {
12077
+ var _a;
12078
+ return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
12079
+ ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
12080
+ : 'translateY(-50%)';
12081
+ }, [videoPostConfig]);
12082
+ const blurBgSrc = useMemo(() => {
12083
+ var _a;
12084
+ return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
12085
+ }, [firstFrameSrc, rec]);
12073
12086
  const handLoadeddata = useCallback(() => {
12074
- const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
12075
- if (!video)
12087
+ if (!canvasRef || !videoRef || !videoRef.current || !canvasRef.current)
12076
12088
  return;
12089
+ const video = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current;
12077
12090
  const canvas = canvasRef === null || canvasRef === void 0 ? void 0 : canvasRef.current;
12078
- if (!canvas)
12079
- return;
12080
12091
  const ctx = canvas.getContext('2d');
12081
12092
  const targetWidth = window === null || window === void 0 ? void 0 : window.innerWidth;
12082
12093
  const targetHeight = window === null || window === void 0 ? void 0 : window.innerHeight;
@@ -12084,10 +12095,9 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12084
12095
  canvas.width = targetWidth;
12085
12096
  ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height);
12086
12097
  setFirstFrameSrc(canvas.toDataURL());
12087
- canvas.remove();
12088
12098
  }, []);
12089
12099
  useEffect(() => {
12090
- var _a, _b, _c;
12100
+ var _a, _b, _c, _d;
12091
12101
  if (!videoRef.current)
12092
12102
  return;
12093
12103
  setIsPauseVideo(false);
@@ -12110,14 +12120,16 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12110
12120
  videoRef.current.setAttribute('x5-playsinline', 'true');
12111
12121
  videoRef.current.setAttribute('webkit-playsinline', 'true');
12112
12122
  }
12113
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('canplay', handleLoadedMetadata);
12114
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('playing', handlePlaying);
12115
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('loadeddata', handLoadeddata);
12123
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener('loadedmetadata', handleLoadedMetadata);
12124
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('canplay', handleLoadedMetadata);
12125
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.addEventListener('playing', handlePlaying);
12126
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.addEventListener('loadeddata', handLoadeddata);
12116
12127
  return () => {
12117
- var _a, _b, _c;
12118
- (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('canplay', handleLoadedMetadata);
12119
- (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('playing', handlePlaying);
12120
- (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('loadeddata', handLoadeddata);
12128
+ var _a, _b, _c, _d;
12129
+ (_a = videoRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('loadedmetadata', handleLoadedMetadata);
12130
+ (_b = videoRef.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('canplay', handleLoadedMetadata);
12131
+ (_c = videoRef.current) === null || _c === void 0 ? void 0 : _c.removeEventListener('playing', handlePlaying);
12132
+ (_d = videoRef.current) === null || _d === void 0 ? void 0 : _d.removeEventListener('loadeddata', handLoadeddata);
12121
12133
  };
12122
12134
  }, [handleLoadedMetadata, handlePlaying, rec.video, handLoadeddata]);
12123
12135
  useEffect(() => {
@@ -12176,19 +12188,14 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12176
12188
  window.removeEventListener('beforeunload', handleBeforeUnload);
12177
12189
  };
12178
12190
  }, [activeIndex, index, rec, videoRef, handleClickVideo, isPauseVideo]);
12179
- const blur = useMemo(() => {
12180
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2';
12181
- }, [videoPostConfig]);
12182
- const translateY = useMemo(() => {
12183
- var _a;
12184
- return (videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.mode) === '2'
12185
- ? `translateY(-${50 + ((_a = videoPostConfig === null || videoPostConfig === void 0 ? void 0 : videoPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%)`
12186
- : 'translateY(-50%)';
12187
- }, [videoPostConfig]);
12188
- const blurBgSrc = useMemo(() => {
12189
- var _a;
12190
- return ((_a = rec === null || rec === void 0 ? void 0 : rec.video) === null || _a === void 0 ? void 0 : _a.cover) || firstFrameSrc;
12191
- }, [firstFrameSrc, rec]);
12191
+ const blurStyle = useMemo(() => {
12192
+ return blur
12193
+ ? {
12194
+ filter: 'blur(10px)',
12195
+ transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
12196
+ }
12197
+ : {};
12198
+ }, [blur]);
12192
12199
  if (!rec.video) {
12193
12200
  return null;
12194
12201
  }
@@ -12198,13 +12205,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12198
12205
  height,
12199
12206
  overflow: 'hidden'
12200
12207
  } },
12201
- React.createElement(FormatImage$1, { src: blurBgSrc, style: {
12202
- height: '100%',
12203
- width: '100%',
12204
- objectFit: 'cover',
12205
- filter: blur ? 'blur(10px)' : 'none',
12206
- transform: blur ? 'scale(1.2)' : 'none'
12207
- } }),
12208
+ React.createElement(FormatImage$1, { src: blurBgSrc, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) }),
12208
12209
  React.createElement("canvas", { ref: canvasRef, style: { display: 'none' } }),
12209
12210
  React.createElement("div", { style: {
12210
12211
  position: 'absolute',
@@ -12216,7 +12217,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12216
12217
  right: 0
12217
12218
  } },
12218
12219
  React.createElement("div", { style: { position: 'relative' } },
12219
- React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', poster: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
12220
+ React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
12220
12221
  width: '100%',
12221
12222
  height: 'auto',
12222
12223
  objectFit: 'contain'
@@ -12228,7 +12229,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12228
12229
  height,
12229
12230
  overflow: 'hidden'
12230
12231
  } },
12231
- React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', poster: sxpParameter === null || sxpParameter === void 0 ? void 0 : sxpParameter.placeholder_image, muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
12232
+ React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart }),
12232
12233
  renderPoster,
12233
12234
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON })))));
12234
12235
  };
@@ -12283,7 +12284,7 @@ const FingerSwipeTip = ({ imageUrl }) => {
12283
12284
  * @Author: binruan@chatlabs.com
12284
12285
  * @Date: 2024-03-20 10:27:31
12285
12286
  * @LastEditors: binruan@chatlabs.com
12286
- * @LastEditTime: 2024-04-18 19:27:35
12287
+ * @LastEditTime: 2024-04-22 14:04:00
12287
12288
  * @FilePath: \pb-sxp-ui\src\core\components\SxpPageRender\PictureGroup\Picture.tsx
12288
12289
  *
12289
12290
  */
@@ -12295,22 +12296,24 @@ const Picture = (props) => {
12295
12296
  const translateY = useMemo(() => {
12296
12297
  var _a;
12297
12298
  return (imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.mode) === '2'
12298
- ? `translateY(-${50 + ((_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%)`
12299
+ ? `translateY(-${50 + ((_a = imgUrlsPostConfig === null || imgUrlsPostConfig === void 0 ? void 0 : imgUrlsPostConfig.offsetTop) !== null && _a !== void 0 ? _a : 0)}%) translate3d(0px, 0px, 0px)`
12299
12300
  : 'translateY(-50%)';
12300
12301
  }, [imgUrlsPostConfig]);
12302
+ const blurStyle = useMemo(() => {
12303
+ return blur
12304
+ ? {
12305
+ filter: 'blur(10px)',
12306
+ transform: 'translate3d(0px, 0px, 0px) scale(1.2)'
12307
+ }
12308
+ : {};
12309
+ }, [blur]);
12301
12310
  return (React.createElement("div", { style: {
12302
12311
  overflow: 'hidden',
12303
12312
  height,
12304
12313
  width: '100%',
12305
12314
  position: 'relative'
12306
12315
  } },
12307
- React.createElement(FormatImage$1, { src: src, style: {
12308
- height: '100%',
12309
- width: '100%',
12310
- objectFit: 'cover',
12311
- filter: blur ? 'blur(10px)' : 'none',
12312
- transform: blur ? 'scale(1.2)' : 'none'
12313
- } }),
12316
+ React.createElement(FormatImage$1, { src: src, style: Object.assign({ height: '100%', width: '100%', objectFit: 'cover' }, blurStyle) }),
12314
12317
  blur && (React.createElement(FormatImage$1, { src: src, style: {
12315
12318
  width: '100%',
12316
12319
  objectFit: 'contain',
@@ -13081,3 +13084,4 @@ function useEditorDataProvider() {
13081
13084
  */
13082
13085
 
13083
13086
  export { EditorDataProvider, Modal$1 as Modal, SxpDataSourceProvider$1 as SxpDataSourceProvider, index as SxpPageCore, SxpPageRender, index$1 as core, Pagebuilder as default, defaultSetting, _materials_ as materials, useEditorDataProvider };
13087
+ //# sourceMappingURL=index.js.map