@gem-sdk/components 2.0.0-dev.607 → 2.0.0-dev.609

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.
@@ -259,7 +259,7 @@ const ProductListPreset = [
259
259
  },
260
260
  styles: {
261
261
  typo: {
262
- type: 'subheading-2'
262
+ type: 'paragraph-1'
263
263
  },
264
264
  color: {
265
265
  normal: 'text-1'
@@ -308,7 +308,7 @@ const ProductListPreset = [
308
308
  },
309
309
  styles: {
310
310
  typo: {
311
- type: 'subheading-2'
311
+ type: 'paragraph-1'
312
312
  },
313
313
  color: {
314
314
  normal: 'text-1'
@@ -653,7 +653,7 @@ const ProductListPreset = [
653
653
  styles: {
654
654
  priceType: 'regular',
655
655
  typo: {
656
- type: 'subheading-2'
656
+ type: 'paragraph-1'
657
657
  },
658
658
  color: {
659
659
  normal: 'text-1'
@@ -702,7 +702,7 @@ const ProductListPreset = [
702
702
  },
703
703
  styles: {
704
704
  typo: {
705
- type: 'subheading-2'
705
+ type: 'paragraph-1'
706
706
  },
707
707
  color: {
708
708
  normal: 'text-1'
@@ -11,7 +11,7 @@ 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
- const { title, id, lazy, aspectRatio } = props;
14
+ const { title, id, lazy, aspectRatio, autoplay } = props;
15
15
  const { iframeSrc } = index.getVimeoParams(props);
16
16
  const iframe = !lazy;
17
17
  const posterUrl = props.thumbnail;
@@ -21,6 +21,7 @@ const LiteVimeoEmbed = (props)=>{
21
21
  lazy,
22
22
  iframeSrc,
23
23
  title,
24
+ autoplay,
24
25
  style: props?.vimeoStyleIframe || ''
25
26
  });
26
27
  const iframeVimeoStyle = system.createStyle({
@@ -25,7 +25,7 @@ const listSourceVideoSupport = [
25
25
  '.mov'
26
26
  ];
27
27
  const getYoutubeParams = (props)=>{
28
- const { id, poster, params, muted, webp, controls, adNetwork } = props;
28
+ const { id, poster, params, muted, webp, controls, adNetwork, autoplay } = props;
29
29
  const videoId = encodeURIComponent(id);
30
30
  const posterImp = poster || 'hqdefault';
31
31
  const paramsImp = `${params}` || '';
@@ -34,7 +34,7 @@ const getYoutubeParams = (props)=>{
34
34
  const vi = webp ? 'vi_webp' : 'vi';
35
35
  const posterUrl = props.thumbnail || `https://i.ytimg.com/${vi}/${videoId}/${posterImp}.${format}`;
36
36
  const ytUrl = props.noCookie ? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com';
37
- const iframeSrc = `${ytUrl}/embed/${videoId}?autoplay=1&state=1${mutedImp}${paramsImp}&controls=${controls ? 1 : 0}`;
37
+ const iframeSrc = `${ytUrl}/embed/${videoId}?autoplay=${autoplay}&state=1${mutedImp}${paramsImp}&controls=${controls ? 1 : 0}`;
38
38
  const adNetworkImp = adNetwork || false;
39
39
  return {
40
40
  videoId,
@@ -52,7 +52,7 @@ const getYoutubeParams = (props)=>{
52
52
  const getVimeoParams = (props)=>{
53
53
  const { id, autoplay, muted, controls, loop } = props;
54
54
  const videoId = encodeURIComponent(id);
55
- const params = `?&autoplay=${autoplay}` + `&muted=${muted}` + `&loop=${loop}` + `&controls=${controls}` + '&autopause=false';
55
+ const params = `?&autoplay=${autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + '&autopause=false';
56
56
  const iframeSrc = `https://player.vimeo.com/video/${videoId}${params}`;
57
57
  return {
58
58
  videoId,
@@ -121,10 +121,10 @@ const SettingUIV2 = [
121
121
  },
122
122
  {
123
123
  label: {
124
- en: 'Autoplay'
124
+ en: 'Lazy load'
125
125
  },
126
126
  setting: {
127
- id: 'autoplay'
127
+ id: 'lazy'
128
128
  }
129
129
  }
130
130
  ],
@@ -133,11 +133,17 @@ const SettingUIV2 = [
133
133
  controls: [
134
134
  {
135
135
  label: {
136
- en: 'Lazy load'
136
+ en: 'Autoplay'
137
137
  },
138
138
  setting: {
139
- id: 'lazy'
140
- }
139
+ id: 'autoplay'
140
+ },
141
+ options: {
142
+ labelVariant: 'primary',
143
+ fullWidth: true,
144
+ disableMessage: `YouTube videos will not autoplay when lazy load is enabled`
145
+ },
146
+ conditionEnable: "type === 'html5' || (type !== 'html5' && lazy != true)"
141
147
  },
142
148
  {
143
149
  label: {
@@ -257,7 +257,7 @@ const ProductListPreset = [
257
257
  },
258
258
  styles: {
259
259
  typo: {
260
- type: 'subheading-2'
260
+ type: 'paragraph-1'
261
261
  },
262
262
  color: {
263
263
  normal: 'text-1'
@@ -306,7 +306,7 @@ const ProductListPreset = [
306
306
  },
307
307
  styles: {
308
308
  typo: {
309
- type: 'subheading-2'
309
+ type: 'paragraph-1'
310
310
  },
311
311
  color: {
312
312
  normal: 'text-1'
@@ -651,7 +651,7 @@ const ProductListPreset = [
651
651
  styles: {
652
652
  priceType: 'regular',
653
653
  typo: {
654
- type: 'subheading-2'
654
+ type: 'paragraph-1'
655
655
  },
656
656
  color: {
657
657
  normal: 'text-1'
@@ -700,7 +700,7 @@ const ProductListPreset = [
700
700
  },
701
701
  styles: {
702
702
  typo: {
703
- type: 'subheading-2'
703
+ type: 'paragraph-1'
704
704
  },
705
705
  color: {
706
706
  normal: 'text-1'
@@ -7,7 +7,7 @@ import { getVimeoParams } from './common/index.js';
7
7
  import NextImage from '../../image/components/NextImage.liquid.js';
8
8
 
9
9
  const LiteVimeoEmbed = (props)=>{
10
- const { title, id, lazy, aspectRatio } = props;
10
+ const { title, id, lazy, aspectRatio, autoplay } = props;
11
11
  const { iframeSrc } = getVimeoParams(props);
12
12
  const iframe = !lazy;
13
13
  const posterUrl = props.thumbnail;
@@ -17,6 +17,7 @@ const LiteVimeoEmbed = (props)=>{
17
17
  lazy,
18
18
  iframeSrc,
19
19
  title,
20
+ autoplay,
20
21
  style: props?.vimeoStyleIframe || ''
21
22
  });
22
23
  const iframeVimeoStyle = createStyle({
@@ -23,7 +23,7 @@ const listSourceVideoSupport = [
23
23
  '.mov'
24
24
  ];
25
25
  const getYoutubeParams = (props)=>{
26
- const { id, poster, params, muted, webp, controls, adNetwork } = props;
26
+ const { id, poster, params, muted, webp, controls, adNetwork, autoplay } = props;
27
27
  const videoId = encodeURIComponent(id);
28
28
  const posterImp = poster || 'hqdefault';
29
29
  const paramsImp = `${params}` || '';
@@ -32,7 +32,7 @@ const getYoutubeParams = (props)=>{
32
32
  const vi = webp ? 'vi_webp' : 'vi';
33
33
  const posterUrl = props.thumbnail || `https://i.ytimg.com/${vi}/${videoId}/${posterImp}.${format}`;
34
34
  const ytUrl = props.noCookie ? 'https://www.youtube-nocookie.com' : 'https://www.youtube.com';
35
- const iframeSrc = `${ytUrl}/embed/${videoId}?autoplay=1&state=1${mutedImp}${paramsImp}&controls=${controls ? 1 : 0}`;
35
+ const iframeSrc = `${ytUrl}/embed/${videoId}?autoplay=${autoplay}&state=1${mutedImp}${paramsImp}&controls=${controls ? 1 : 0}`;
36
36
  const adNetworkImp = adNetwork || false;
37
37
  return {
38
38
  videoId,
@@ -50,7 +50,7 @@ const getYoutubeParams = (props)=>{
50
50
  const getVimeoParams = (props)=>{
51
51
  const { id, autoplay, muted, controls, loop } = props;
52
52
  const videoId = encodeURIComponent(id);
53
- const params = `?&autoplay=${autoplay}` + `&muted=${muted}` + `&loop=${loop}` + `&controls=${controls}` + '&autopause=false';
53
+ const params = `?&autoplay=${autoplay ? 1 : 0}` + `&muted=${muted ? 1 : 0}` + `&loop=${loop ? 1 : 0}` + `&controls=${controls}` + '&autopause=false';
54
54
  const iframeSrc = `https://player.vimeo.com/video/${videoId}${params}`;
55
55
  return {
56
56
  videoId,
@@ -119,10 +119,10 @@ const SettingUIV2 = [
119
119
  },
120
120
  {
121
121
  label: {
122
- en: 'Autoplay'
122
+ en: 'Lazy load'
123
123
  },
124
124
  setting: {
125
- id: 'autoplay'
125
+ id: 'lazy'
126
126
  }
127
127
  }
128
128
  ],
@@ -131,11 +131,17 @@ const SettingUIV2 = [
131
131
  controls: [
132
132
  {
133
133
  label: {
134
- en: 'Lazy load'
134
+ en: 'Autoplay'
135
135
  },
136
136
  setting: {
137
- id: 'lazy'
138
- }
137
+ id: 'autoplay'
138
+ },
139
+ options: {
140
+ labelVariant: 'primary',
141
+ fullWidth: true,
142
+ disableMessage: `YouTube videos will not autoplay when lazy load is enabled`
143
+ },
144
+ conditionEnable: "type === 'html5' || (type !== 'html5' && lazy != true)"
139
145
  },
140
146
  {
141
147
  label: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.607",
3
+ "version": "2.0.0-dev.609",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",