@gem-sdk/components 2.0.0-dev.537 → 2.0.0-dev.539
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/cjs/carousel/setting/configs/settingV2.js +16 -2
- package/dist/cjs/carousel/setting/configs/uiV2.js +1 -1
- package/dist/cjs/product/components/ProductBundle/setting/ProductBundleDiscount.js +7 -2
- package/dist/cjs/product/components/ProductBundle/setting/uiV2.js +1 -0
- package/dist/cjs/video/components/HTML5Embed.js +2 -2
- package/dist/cjs/video/components/LiteVimeoEmbed.js +2 -2
- package/dist/cjs/video/components/LiteVimeoEmbed.liquid.js +2 -2
- package/dist/cjs/video/components/LiteYouTubeEmbed.js +5 -5
- package/dist/cjs/video/components/LiteYouTubeEmbed.liquid.js +2 -2
- package/dist/cjs/video/components/Video.js +8 -8
- package/dist/cjs/video/components/Video.liquid.js +10 -9
- package/dist/cjs/video/setting/configs/settings.js +186 -200
- package/dist/cjs/video/setting/configs/uiV2.js +13 -13
- package/dist/esm/carousel/setting/configs/settingV2.js +16 -2
- package/dist/esm/carousel/setting/configs/uiV2.js +1 -1
- package/dist/esm/product/components/ProductBundle/setting/ProductBundleDiscount.js +7 -2
- package/dist/esm/product/components/ProductBundle/setting/uiV2.js +1 -0
- package/dist/esm/video/components/HTML5Embed.js +1 -1
- package/dist/esm/video/components/LiteVimeoEmbed.js +1 -1
- package/dist/esm/video/components/LiteVimeoEmbed.liquid.js +1 -1
- package/dist/esm/video/components/LiteYouTubeEmbed.js +1 -1
- package/dist/esm/video/components/LiteYouTubeEmbed.liquid.js +1 -1
- package/dist/esm/video/components/Video.js +1 -1
- package/dist/esm/video/components/Video.liquid.js +2 -1
- package/dist/esm/video/setting/configs/settings.js +186 -200
- package/dist/esm/video/setting/configs/uiV2.js +13 -13
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -2
- /package/dist/cjs/video/components/common/{common.js → index.js} +0 -0
- /package/dist/esm/video/components/common/{common.js → index.js} +0 -0
|
@@ -381,12 +381,26 @@ const CarouselSettingsV2Setting = [
|
|
|
381
381
|
devices: {
|
|
382
382
|
desktop: {
|
|
383
383
|
default: {
|
|
384
|
-
type: '
|
|
384
|
+
type: 'shadow-1',
|
|
385
385
|
distance: '4px',
|
|
386
386
|
blur: '12px',
|
|
387
387
|
spread: '0px',
|
|
388
388
|
color: 'rgba(0, 0, 0, 0.20)',
|
|
389
|
-
angle: 90
|
|
389
|
+
angle: 90,
|
|
390
|
+
enable: false
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
},
|
|
394
|
+
compoDefaultValue: {
|
|
395
|
+
desktop: {
|
|
396
|
+
default: {
|
|
397
|
+
type: 'shadow-1',
|
|
398
|
+
distance: '4px',
|
|
399
|
+
blur: '4px',
|
|
400
|
+
spread: '0px',
|
|
401
|
+
color: '#121212',
|
|
402
|
+
angle: 45,
|
|
403
|
+
enable: true
|
|
390
404
|
}
|
|
391
405
|
}
|
|
392
406
|
}
|
|
@@ -328,7 +328,7 @@ const SettingUIV2 = [
|
|
|
328
328
|
id: 'sneakPeak'
|
|
329
329
|
},
|
|
330
330
|
fixedValue: 'Styled',
|
|
331
|
-
iconName: '
|
|
331
|
+
iconName: 'gp-sneak-peek-left',
|
|
332
332
|
conditionEnable: 'itemNumber > 1',
|
|
333
333
|
options: {
|
|
334
334
|
disableMessage: `Sneak peek doesn't work <br> with 1-column layout`
|
|
@@ -27,6 +27,11 @@ const config = {
|
|
|
27
27
|
{
|
|
28
28
|
id: 'setting',
|
|
29
29
|
controls: [
|
|
30
|
+
{
|
|
31
|
+
id: 'enableDisplayCondition',
|
|
32
|
+
type: 'toggle',
|
|
33
|
+
default: true
|
|
34
|
+
},
|
|
30
35
|
{
|
|
31
36
|
id: 'childItem',
|
|
32
37
|
label: 'Item management',
|
|
@@ -301,14 +306,14 @@ const config = {
|
|
|
301
306
|
border: 'solid',
|
|
302
307
|
borderWidth: '1px',
|
|
303
308
|
width: '1px 1px 1px 1px',
|
|
304
|
-
color: '
|
|
309
|
+
color: 'line-2',
|
|
305
310
|
isCustom: false
|
|
306
311
|
},
|
|
307
312
|
hover: {
|
|
308
313
|
border: 'solid',
|
|
309
314
|
borderWidth: '1px',
|
|
310
315
|
width: '1px 1px 1px 1px',
|
|
311
|
-
color: '
|
|
316
|
+
color: 'line-1',
|
|
312
317
|
isCustom: false
|
|
313
318
|
},
|
|
314
319
|
active: {
|
|
@@ -7,7 +7,7 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
var core = require('@gem-sdk/core');
|
|
8
8
|
var NextImage = require('../../image/components/NextImage.js');
|
|
9
9
|
var useLiteHtml5Embed = require('../hooks/useLiteHtml5Embed.js');
|
|
10
|
-
var
|
|
10
|
+
var index = require('./common/index.js');
|
|
11
11
|
var system = require('@gem-sdk/system');
|
|
12
12
|
var getClasses = require('./common/getClasses.js');
|
|
13
13
|
var getStyle = require('./common/getStyle.js');
|
|
@@ -21,7 +21,7 @@ const HTML5Embed = (props)=>{
|
|
|
21
21
|
const { playVideoAndTurnOffThumbnail, videoRef, showThumbnail } = useLiteHtml5Embed.useLiteHtml5Embed(autoplay, src);
|
|
22
22
|
const preloadThumbnail = !isInstantLP && autoplay && thumbnail;
|
|
23
23
|
const offLazyLoad = !lazy && props.isVideoComponent && isInstantLP;
|
|
24
|
-
const isMp4Video =
|
|
24
|
+
const isMp4Video = index.listSourceVideoSupport.some((ext)=>src.endsWith(ext));
|
|
25
25
|
const hiddenRenderThumbnail = !thumbnail || !showThumbnail;
|
|
26
26
|
const srcUnLazyVideo = offLazyLoad && !isInstantLP ? src : undefined;
|
|
27
27
|
const attrs = system.createAttr({
|
|
@@ -8,12 +8,12 @@ var useLiteVimeoEmbed = require('../hooks/useLiteVimeoEmbed.js');
|
|
|
8
8
|
var system = require('@gem-sdk/system');
|
|
9
9
|
var getClasses = require('./common/getClasses.js');
|
|
10
10
|
var getStyle = require('./common/getStyle.js');
|
|
11
|
-
var
|
|
11
|
+
var index = require('./common/index.js');
|
|
12
12
|
var NextImage = require('../../image/components/NextImage.js');
|
|
13
13
|
|
|
14
14
|
const LiteVimeoEmbed = (props)=>{
|
|
15
15
|
const { title, lazy, aspectRatio } = props;
|
|
16
|
-
const { iframeSrc, videoId } =
|
|
16
|
+
const { iframeSrc, videoId } = index.getVimeoParams(props);
|
|
17
17
|
const { addIframe, thumbnail, iframe } = useLiteVimeoEmbed.useLiteVimeoEmbed(lazy, videoId);
|
|
18
18
|
const posterUrl = props.thumbnail || thumbnail;
|
|
19
19
|
const iframeVimeoStyle = system.createStyle({
|
|
@@ -7,12 +7,12 @@ var helpers = require('../../helpers.js');
|
|
|
7
7
|
var system = require('@gem-sdk/system');
|
|
8
8
|
var getClasses = require('./common/getClasses.js');
|
|
9
9
|
var getStyle = require('./common/getStyle.js');
|
|
10
|
-
var
|
|
10
|
+
var index = require('./common/index.js');
|
|
11
11
|
var NextImage_liquid = require('../../image/components/NextImage.liquid.js');
|
|
12
12
|
|
|
13
13
|
const LiteVimeoEmbed = (props)=>{
|
|
14
14
|
const { title, id, lazy, aspectRatio } = props;
|
|
15
|
-
const { iframeSrc } =
|
|
15
|
+
const { iframeSrc } = index.getVimeoParams(props);
|
|
16
16
|
const iframe = !lazy;
|
|
17
17
|
const posterUrl = props.thumbnail;
|
|
18
18
|
const stateVimeo = system.createStateOrContext({
|
|
@@ -6,19 +6,19 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var core = require('@gem-sdk/core');
|
|
8
8
|
var YouTube = require('react-youtube');
|
|
9
|
-
var common
|
|
9
|
+
var common = require('../helpers/common.js');
|
|
10
10
|
var NextImage = require('../../image/components/NextImage.js');
|
|
11
11
|
var system = require('@gem-sdk/system');
|
|
12
12
|
var getClasses = require('./common/getClasses.js');
|
|
13
13
|
var getStyle = require('./common/getStyle.js');
|
|
14
14
|
var useLiteYoutubeEmbed = require('../hooks/useLiteYoutubeEmbed.js');
|
|
15
|
-
var
|
|
15
|
+
var index = require('./common/index.js');
|
|
16
16
|
|
|
17
17
|
const LiteYouTubeEmbed = (props)=>{
|
|
18
18
|
const mode = core.useEditorMode();
|
|
19
19
|
const isInstantLP = mode !== 'edit';
|
|
20
20
|
const { style, preload, iframeClass, wrapperClass, title } = props;
|
|
21
|
-
const { videoId, paramsImp, posterUrl, iframeSrc } =
|
|
21
|
+
const { videoId, paramsImp, posterUrl, iframeSrc } = index.getYoutubeParams(props);
|
|
22
22
|
const { iframe, intervalPlay, warmConnections, isVideoStarted, videoDuration, addIframe } = useLiteYoutubeEmbed.useLiteYoutubeEmbed(props, paramsImp, videoId);
|
|
23
23
|
const enablePreload = preload && isInstantLP;
|
|
24
24
|
const buttonYoutubeClasses = system.createClass({
|
|
@@ -43,7 +43,7 @@ const LiteYouTubeEmbed = (props)=>{
|
|
|
43
43
|
...getClasses.getYoutubeContentClasses()
|
|
44
44
|
});
|
|
45
45
|
const renderVideo = ()=>{
|
|
46
|
-
if (props.isHeroBanner && common
|
|
46
|
+
if (props.isHeroBanner && common.isSettingLoop(paramsImp)) {
|
|
47
47
|
return /*#__PURE__*/ jsxRuntime.jsx(YouTube, {
|
|
48
48
|
videoId: videoId,
|
|
49
49
|
title: title,
|
|
@@ -57,7 +57,7 @@ const LiteYouTubeEmbed = (props)=>{
|
|
|
57
57
|
state: 1,
|
|
58
58
|
controls: 0,
|
|
59
59
|
mute: 1,
|
|
60
|
-
...common
|
|
60
|
+
...common.covertStrParamsToObj(paramsImp)
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
onReady: (e)=>{
|
|
@@ -8,12 +8,12 @@ var helpers = require('../../helpers.js');
|
|
|
8
8
|
var system = require('@gem-sdk/system');
|
|
9
9
|
var getClasses = require('./common/getClasses.js');
|
|
10
10
|
var getStyle = require('./common/getStyle.js');
|
|
11
|
-
var
|
|
11
|
+
var index = require('./common/index.js');
|
|
12
12
|
|
|
13
13
|
const LiteYouTubeEmbed = (props)=>{
|
|
14
14
|
const { style, preload, iframeClass, wrapperClass, title } = props;
|
|
15
15
|
const videoUid = `gp-video-${props.uid}`;
|
|
16
|
-
const { posterUrl, iframeSrc } =
|
|
16
|
+
const { posterUrl, iframeSrc } = index.getYoutubeParams(props);
|
|
17
17
|
const enablePreload = preload;
|
|
18
18
|
const stateYoutube = system.createStateOrContext({
|
|
19
19
|
lazy: props.lazy,
|
|
@@ -7,8 +7,8 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
var core = require('@gem-sdk/core');
|
|
8
8
|
var dynamic = require('next/dynamic');
|
|
9
9
|
var React = require('react');
|
|
10
|
-
var common
|
|
11
|
-
var
|
|
10
|
+
var common = require('../helpers/common.js');
|
|
11
|
+
var index = require('./common/index.js');
|
|
12
12
|
var system = require('@gem-sdk/system');
|
|
13
13
|
var getAttr = require('./common/getAttr.js');
|
|
14
14
|
var getStyle = require('./common/getStyle.js');
|
|
@@ -23,7 +23,7 @@ const Video = ({ className, setting, style, builderAttrs, builderProps, advanced
|
|
|
23
23
|
const { cssClass: advancedCssClass } = advanced ?? {};
|
|
24
24
|
const posterSrc = poster?.src;
|
|
25
25
|
const isInstantLP = mode !== 'edit';
|
|
26
|
-
const aspectRatio =
|
|
26
|
+
const aspectRatio = index.getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
|
|
27
27
|
const attrs = system.createAttr({
|
|
28
28
|
...getAttr.getAttr({
|
|
29
29
|
uid: builderProps?.uid || ''
|
|
@@ -53,17 +53,17 @@ const Video = ({ className, setting, style, builderAttrs, builderProps, advanced
|
|
|
53
53
|
switch(setting?.type){
|
|
54
54
|
case 'youtube':
|
|
55
55
|
{
|
|
56
|
-
const videoId = common
|
|
57
|
-
if (!common
|
|
56
|
+
const videoId = common.getYoutubeVideoId(youtubeUrl);
|
|
57
|
+
if (!common.youtubeVideoRegex.test(youtubeUrl) || !videoId) return undefined;
|
|
58
58
|
let params = '';
|
|
59
59
|
if (loopVideo) {
|
|
60
60
|
params += `&loop=1&playlist=${videoId}`;
|
|
61
61
|
}
|
|
62
62
|
if (startTime) {
|
|
63
|
-
params += `&start=${common
|
|
63
|
+
params += `&start=${common.parseTimeVideo(startTime)}`;
|
|
64
64
|
}
|
|
65
65
|
if (endTime) {
|
|
66
|
-
params += `&end=${common
|
|
66
|
+
params += `&end=${common.parseTimeVideo(endTime)}`;
|
|
67
67
|
}
|
|
68
68
|
return /*#__PURE__*/ jsxRuntime.jsx(LiteYouTubeEmbed, {
|
|
69
69
|
id: videoId,
|
|
@@ -82,7 +82,7 @@ const Video = ({ className, setting, style, builderAttrs, builderProps, advanced
|
|
|
82
82
|
}
|
|
83
83
|
case 'vimeo':
|
|
84
84
|
{
|
|
85
|
-
const videoId = common
|
|
85
|
+
const videoId = common.getVimeoVideoId(vimeoUrl);
|
|
86
86
|
if (!videoId) return undefined;
|
|
87
87
|
return /*#__PURE__*/ jsxRuntime.jsx(LiteVimeoEmbed, {
|
|
88
88
|
muted: !mute,
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var core = require('@gem-sdk/core');
|
|
6
|
-
var common
|
|
7
|
-
var
|
|
6
|
+
var common = require('../helpers/common.js');
|
|
7
|
+
var index = require('./common/index.js');
|
|
8
8
|
var system = require('@gem-sdk/system');
|
|
9
9
|
var getAttr = require('./common/getAttr.js');
|
|
10
10
|
var getStyle = require('./common/getStyle.js');
|
|
@@ -19,7 +19,7 @@ const Video = ({ className, setting, style, builderAttrs, builderProps, advanced
|
|
|
19
19
|
const posterSrc = getSrcSet.getImageSrc(poster);
|
|
20
20
|
const { cssClass: advancedCssClass } = advanced ?? {};
|
|
21
21
|
const isInstantLP = false;
|
|
22
|
-
const aspectRatio =
|
|
22
|
+
const aspectRatio = index.getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
|
|
23
23
|
const attrs = system.createAttr({
|
|
24
24
|
...getAttr.getAttr({
|
|
25
25
|
uid: builderProps?.uid || ''
|
|
@@ -49,18 +49,19 @@ const Video = ({ className, setting, style, builderAttrs, builderProps, advanced
|
|
|
49
49
|
switch(setting?.type){
|
|
50
50
|
case 'youtube':
|
|
51
51
|
{
|
|
52
|
-
const videoId = common
|
|
53
|
-
if (!common
|
|
52
|
+
const videoId = common.getYoutubeVideoId(youtubeUrl);
|
|
53
|
+
if (!common.youtubeVideoRegex.test(youtubeUrl) || !videoId) return undefined;
|
|
54
54
|
let params = '';
|
|
55
55
|
if (loopVideo) {
|
|
56
56
|
params += `&loop=1&playlist=${videoId}`;
|
|
57
57
|
}
|
|
58
58
|
if (startTime) {
|
|
59
|
-
params += `&start=${common
|
|
59
|
+
params += `&start=${common.parseTimeVideo(startTime)}`;
|
|
60
60
|
}
|
|
61
61
|
if (endTime) {
|
|
62
|
-
params += `&end=${common
|
|
62
|
+
params += `&end=${common.parseTimeVideo(endTime)}`;
|
|
63
63
|
}
|
|
64
|
+
console.log('autoplay', autoplay);
|
|
64
65
|
return LiteYouTubeEmbed_liquid.default({
|
|
65
66
|
uid: builderProps?.uid,
|
|
66
67
|
id: videoId,
|
|
@@ -79,8 +80,8 @@ const Video = ({ className, setting, style, builderAttrs, builderProps, advanced
|
|
|
79
80
|
}
|
|
80
81
|
case 'vimeo':
|
|
81
82
|
{
|
|
82
|
-
const videoId = common
|
|
83
|
-
if (!common
|
|
83
|
+
const videoId = common.getVimeoVideoId(vimeoUrl);
|
|
84
|
+
if (!common.vimeoVideoRegex.test(vimeoUrl) || !videoId) return undefined;
|
|
84
85
|
return LiteVimeoEmbed_liquid.default({
|
|
85
86
|
muted: !mute,
|
|
86
87
|
loop: loopVideo,
|