pds-dev-kit-web-test 0.3.9 → 0.3.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.
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.d.ts +1 -1
- package/dist/src/sub/DynamicLayout/pagesPreviewMock.js +2 -2
- package/dist/src/sub/DynamicLayout/sections/CustomSection/components/ComponentBlock/componentBlocks/Youtube/Youtube.js +16 -6
- package/package.json +1 -1
- package/release-note.md +1 -1
|
@@ -707,7 +707,7 @@ export declare const sampleCustomsection1: {
|
|
|
707
707
|
};
|
|
708
708
|
CB_EFFECT_PROP_ENTANIM: {
|
|
709
709
|
CB_EFFECT_PROP_ENTANIM_SPEC_TYPE: string;
|
|
710
|
-
'CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE':
|
|
710
|
+
'CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE': null;
|
|
711
711
|
CB_EFFECT_PROP_ENTANIM_SPEC_DURATION: number;
|
|
712
712
|
'CB_EFFECT_PROP_ENTANIM_SPEC_DURATION:MOBILE': null;
|
|
713
713
|
CB_EFFECT_PROP_ENTANIM_SPEC_REPEAT: number;
|
|
@@ -666,8 +666,8 @@ exports.sampleCustomsection1 = {
|
|
|
666
666
|
CB_CONTENT_PROP_YOUTUBE_SPEC_STARTTIME: 0
|
|
667
667
|
},
|
|
668
668
|
CB_EFFECT_PROP_ENTANIM: {
|
|
669
|
-
CB_EFFECT_PROP_ENTANIM_SPEC_TYPE: '
|
|
670
|
-
'CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE':
|
|
669
|
+
CB_EFFECT_PROP_ENTANIM_SPEC_TYPE: 'NONE',
|
|
670
|
+
'CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE': null,
|
|
671
671
|
CB_EFFECT_PROP_ENTANIM_SPEC_DURATION: 1,
|
|
672
672
|
'CB_EFFECT_PROP_ENTANIM_SPEC_DURATION:MOBILE': null,
|
|
673
673
|
CB_EFFECT_PROP_ENTANIM_SPEC_REPEAT: 1,
|
|
@@ -50,13 +50,23 @@ function Youtube(props) {
|
|
|
50
50
|
: CB_EFFECT_PROP_ENTANIM['CB_EFFECT_PROP_ENTANIM_SPEC_TYPE:MOBILE'] === 'NONE';
|
|
51
51
|
var hasEffect = !isNoneEffectType;
|
|
52
52
|
var effectVisibleStyle = hasEffect ? { opacity: isVisible ? 1 : 0 } : {};
|
|
53
|
-
var
|
|
54
|
-
|
|
53
|
+
var autoplayRef = (0, react_1.useRef)(null);
|
|
54
|
+
var autoplayEntry = (0, hooks_1.useIntersectionObserver)(autoplayRef, {
|
|
55
|
+
freezeOnceVisible: youtubeAutoplayMode === 'VIEWPORT-FREEZE' ? true : false
|
|
55
56
|
});
|
|
56
|
-
var shouldAutoPlay =
|
|
57
|
-
(youtubeAutoplayMode === '
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
var shouldAutoPlay = function () {
|
|
58
|
+
if (youtubeAutoplayMode === 'ALWAYS') {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
if (youtubeAutoplayMode === 'VIEWPORT' && (autoplayEntry === null || autoplayEntry === void 0 ? void 0 : autoplayEntry.isIntersecting)) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
if (youtubeAutoplayMode === 'VIEWPORT-FREEZE' && (autoplayEntry === null || autoplayEntry === void 0 ? void 0 : autoplayEntry.isIntersecting)) {
|
|
65
|
+
return true;
|
|
66
|
+
}
|
|
67
|
+
return false;
|
|
68
|
+
};
|
|
69
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isEditModeAndHidden && (0, jsx_runtime_1.jsx)(S_HiddenCover_1.S_HiddenCover, {}), (0, jsx_runtime_1.jsx)(S_CB_AnimationObserverBox_1.S_CB_AnimationObserverBox, __assign({ ref: hasEffect ? cbRef : null, effectVisibleStyle: effectVisibleStyle }, { children: (0, jsx_runtime_1.jsx)(S_CB_BoxWithShadow_1.S_CB_BoxWithShadow, __assign({ ref: autoplayRef, className: "cb-layout-box", normalStyle: __assign(__assign(__assign(__assign({}, propsStyle), layoutStyle), effectCssProperties), bgColorStyle), hoverStyle: __assign(__assign({}, propsHoverStyle), bgColorHoverStyle), cbStylePropsShadowSpecs: CB_STYLE_PROP_SHADOW, device: device }, { children: isEditMode ? ((0, jsx_runtime_1.jsxs)(S_ThumbnailBox, { children: [(0, jsx_runtime_1.jsx)(YoutubeButton, {}), (0, jsx_runtime_1.jsx)(S_Thumbnail, { src: thumbnailSrc })] })) : ((0, jsx_runtime_1.jsx)(S_Iframe, { title: id, src: shouldAutoPlay() ? getAutoplaySrc(youtubeSrc) : youtubeSrc, allow: "accelerometer; encrypted-media; gyroscope; picture-in-picture" })) })) }))] }));
|
|
60
70
|
}
|
|
61
71
|
function getBGColorStyles(props, device) {
|
|
62
72
|
var availableSpecCodes = [
|
package/package.json
CHANGED
package/release-note.md
CHANGED