@gem-sdk/components 2.0.0-dev.714 → 2.0.0-dev.716

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.
@@ -88,7 +88,7 @@ const HeroBannerItem = (props)=>{
88
88
  if (!common.showVideoType(background)) return;
89
89
  if (dataVideo?.videoType === 'html5' && !dataVideo.videoHtml5) return null;
90
90
  if (dataVideo?.videoType === 'youtube' && !dataVideo.video) return null;
91
- if (dataVideo?.videoType === 'html5' && dataVideo?.videoHtml5) {
91
+ if (dataVideo?.type === 'video' && dataVideo?.videoType === 'html5' && dataVideo?.videoHtml5) {
92
92
  return /*#__PURE__*/ jsxRuntime.jsx(HTML5Embed.default, {
93
93
  muted: true,
94
94
  loop: dataVideo?.loop,
@@ -104,7 +104,7 @@ const HeroBannerItem = (props)=>{
104
104
  const videoId = common$1.getYoutubeVideoId(youtubeUrl);
105
105
  const isLoop = dataVideo?.loop ? 1 : 0;
106
106
  const params = `&loop=${isLoop}&playlist=${videoId}&showinfo=0&rel=0&fs=0&enablejsapi=1`;
107
- if (dataVideo?.videoType === 'youtube' && videoId && common$1.youtubeVideoRegex.test(youtubeUrl)) {
107
+ if (dataVideo?.type === 'video' && dataVideo?.videoType === 'youtube' && videoId && common$1.youtubeVideoRegex.test(youtubeUrl)) {
108
108
  return /*#__PURE__*/ jsxRuntime.jsx(LiteYouTubeEmbed.default, {
109
109
  id: videoId,
110
110
  isHeroBanner: true,
@@ -114,7 +114,7 @@ const HeroBannerItem = (props)=>{
114
114
  const videoId = common$2.getYoutubeVideoId(youtubeUrl);
115
115
  const isLoop = false;
116
116
  const params = `&loop=${isLoop}&playlist=${videoId}&showinfo=0&rel=0&fs=0&enablejsapi=1`;
117
- if (dataVideo?.videoType === 'youtube' && videoId && common$2.youtubeVideoRegex.test(youtubeUrl)) {
117
+ if (dataVideo?.type === 'video' && dataVideo?.videoType === 'youtube' && videoId && common$2.youtubeVideoRegex.test(youtubeUrl)) {
118
118
  return LiteYouTubeEmbed_liquid.default({
119
119
  uid: builderProps?.uid,
120
120
  id: videoId,
@@ -114,7 +114,7 @@ const Button = (props)=>{
114
114
  styles: buttonIconStyles,
115
115
  classes: buttonIconClasses
116
116
  })),
117
- system.If(enableTextStyle && checkIsShowLabel(), /*#__PURE__*/ jsxRuntime.jsx(ButtonLabel.default, {
117
+ system.If(enableTextStyle && checkIsShowLabel() && !!getLabelToDisplay(), /*#__PURE__*/ jsxRuntime.jsx(ButtonLabel.default, {
118
118
  label: getLabelToDisplay(),
119
119
  styles: buttonLabelStyles,
120
120
  classes: buttonLabelClasses
@@ -32,7 +32,7 @@ const getButtonWrapperClasses = (wrapClassName, className, advancedCssClass)=>{
32
32
  const getButtonContentWrapperClasses = (setting)=>{
33
33
  return {
34
34
  'gp-inline-flex': true,
35
- 'gp-flex-row-reverse': setting?.iconAlign === 'right'
35
+ 'gp-flex-row-reverse': setting?.iconAlign === 'right' && !!setting?.label
36
36
  };
37
37
  };
38
38
  const getButtonLabelClasses = (styles, isEditable)=>{
@@ -94,7 +94,8 @@ const getTypoStyles = (styles1)=>{
94
94
  const getBackgroundStyles = (styles1)=>{
95
95
  return {
96
96
  ...core.getStyleBackgroundImage(styles1?.backgroundImage),
97
- ...core.getGlobalColorStateStyle('bg', styles1?.backgroundColorV2)
97
+ ...core.getGlobalColorStateStyle('bg', styles1?.backgroundColorV2),
98
+ ...core.getGradientBgrStyleForButton(styles1?.backgroundColorV2)
98
99
  };
99
100
  };
100
101
  const getCustomCssStyles = ({ styles: styles1, uid: uid1, builderAttrs: builderAttrs1 })=>{
@@ -17,6 +17,9 @@ const SettingUIV2 = [
17
17
  controls: [
18
18
  {
19
19
  layout: 'vertical',
20
+ label: {
21
+ en: 'Content'
22
+ },
20
23
  setting: {
21
24
  id: 'placeholder'
22
25
  }
@@ -8,7 +8,7 @@ const ProductViewMoreSettings = [
8
8
  id: 'label',
9
9
  label: 'Text',
10
10
  type: 'input',
11
- default: 'View more'
11
+ default: '<p>View more</p>'
12
12
  },
13
13
  {
14
14
  id: 'translate',
@@ -256,6 +256,26 @@ const SettingUIV2 = [
256
256
  options: {
257
257
  labelVariant: 'primary',
258
258
  toggleStyle: 'switch'
259
+ },
260
+ controlChangeTrigger: {
261
+ settings: [
262
+ {
263
+ condition: `enableTextStyle === true && label === ""`,
264
+ source: [
265
+ 'enableTextStyle',
266
+ 'label'
267
+ ],
268
+ action: {
269
+ controlId: 'label',
270
+ groupType: 'setting',
271
+ controlType: 'setting',
272
+ newValue: '<p>View more</p>'
273
+ }
274
+ }
275
+ ],
276
+ options: {
277
+ noRecordHistory: true
278
+ }
259
279
  }
260
280
  },
261
281
  {
@@ -84,7 +84,7 @@ const HeroBannerItem = (props)=>{
84
84
  if (!showVideoType(background)) return;
85
85
  if (dataVideo?.videoType === 'html5' && !dataVideo.videoHtml5) return null;
86
86
  if (dataVideo?.videoType === 'youtube' && !dataVideo.video) return null;
87
- if (dataVideo?.videoType === 'html5' && dataVideo?.videoHtml5) {
87
+ if (dataVideo?.type === 'video' && dataVideo?.videoType === 'html5' && dataVideo?.videoHtml5) {
88
88
  return /*#__PURE__*/ jsx(HTML5Embed, {
89
89
  muted: true,
90
90
  loop: dataVideo?.loop,
@@ -100,7 +100,7 @@ const HeroBannerItem = (props)=>{
100
100
  const videoId = getYoutubeVideoId(youtubeUrl);
101
101
  const isLoop = dataVideo?.loop ? 1 : 0;
102
102
  const params = `&loop=${isLoop}&playlist=${videoId}&showinfo=0&rel=0&fs=0&enablejsapi=1`;
103
- if (dataVideo?.videoType === 'youtube' && videoId && youtubeVideoRegex.test(youtubeUrl)) {
103
+ if (dataVideo?.type === 'video' && dataVideo?.videoType === 'youtube' && videoId && youtubeVideoRegex.test(youtubeUrl)) {
104
104
  return /*#__PURE__*/ jsx(LiteYouTubeEmbed, {
105
105
  id: videoId,
106
106
  isHeroBanner: true,
@@ -110,7 +110,7 @@ const HeroBannerItem = (props)=>{
110
110
  const videoId = getYoutubeVideoId(youtubeUrl);
111
111
  const isLoop = false;
112
112
  const params = `&loop=${isLoop}&playlist=${videoId}&showinfo=0&rel=0&fs=0&enablejsapi=1`;
113
- if (dataVideo?.videoType === 'youtube' && videoId && youtubeVideoRegex.test(youtubeUrl)) {
113
+ if (dataVideo?.type === 'video' && dataVideo?.videoType === 'youtube' && videoId && youtubeVideoRegex.test(youtubeUrl)) {
114
114
  return LiteYouTubeEmbed({
115
115
  uid: builderProps?.uid,
116
116
  id: videoId,
@@ -110,7 +110,7 @@ const Button = (props)=>{
110
110
  styles: buttonIconStyles,
111
111
  classes: buttonIconClasses
112
112
  })),
113
- If(enableTextStyle && checkIsShowLabel(), /*#__PURE__*/ jsx(ButtonLabel, {
113
+ If(enableTextStyle && checkIsShowLabel() && !!getLabelToDisplay(), /*#__PURE__*/ jsx(ButtonLabel, {
114
114
  label: getLabelToDisplay(),
115
115
  styles: buttonLabelStyles,
116
116
  classes: buttonLabelClasses
@@ -30,7 +30,7 @@ const getButtonWrapperClasses = (wrapClassName, className, advancedCssClass)=>{
30
30
  const getButtonContentWrapperClasses = (setting)=>{
31
31
  return {
32
32
  'gp-inline-flex': true,
33
- 'gp-flex-row-reverse': setting?.iconAlign === 'right'
33
+ 'gp-flex-row-reverse': setting?.iconAlign === 'right' && !!setting?.label
34
34
  };
35
35
  };
36
36
  const getButtonLabelClasses = (styles, isEditable)=>{
@@ -1,4 +1,4 @@
1
- import { makeStyleResponsive, getStyleShadowState, composeRadius, makeGlobalSize, composeTypographyStyle, getColor, getStyleShadow, getStyleBackgroundImage, getGlobalColorStateStyle, composeBorderCss, composeCornerCss } from '@gem-sdk/core';
1
+ import { makeStyleResponsive, getStyleShadowState, composeRadius, makeGlobalSize, composeTypographyStyle, getColor, getStyleShadow, getStyleBackgroundImage, getGlobalColorStateStyle, getGradientBgrStyleForButton, composeBorderCss, composeCornerCss } from '@gem-sdk/core';
2
2
 
3
3
  const getButtonWrapperStyles = (style1, styles1)=>({
4
4
  ...style1,
@@ -92,7 +92,8 @@ const getTypoStyles = (styles1)=>{
92
92
  const getBackgroundStyles = (styles1)=>{
93
93
  return {
94
94
  ...getStyleBackgroundImage(styles1?.backgroundImage),
95
- ...getGlobalColorStateStyle('bg', styles1?.backgroundColorV2)
95
+ ...getGlobalColorStateStyle('bg', styles1?.backgroundColorV2),
96
+ ...getGradientBgrStyleForButton(styles1?.backgroundColorV2)
96
97
  };
97
98
  };
98
99
  const getCustomCssStyles = ({ styles: styles1, uid: uid1, builderAttrs: builderAttrs1 })=>{
@@ -15,6 +15,9 @@ const SettingUIV2 = [
15
15
  controls: [
16
16
  {
17
17
  layout: 'vertical',
18
+ label: {
19
+ en: 'Content'
20
+ },
18
21
  setting: {
19
22
  id: 'placeholder'
20
23
  }
@@ -6,7 +6,7 @@ const ProductViewMoreSettings = [
6
6
  id: 'label',
7
7
  label: 'Text',
8
8
  type: 'input',
9
- default: 'View more'
9
+ default: '<p>View more</p>'
10
10
  },
11
11
  {
12
12
  id: 'translate',
@@ -254,6 +254,26 @@ const SettingUIV2 = [
254
254
  options: {
255
255
  labelVariant: 'primary',
256
256
  toggleStyle: 'switch'
257
+ },
258
+ controlChangeTrigger: {
259
+ settings: [
260
+ {
261
+ condition: `enableTextStyle === true && label === ""`,
262
+ source: [
263
+ 'enableTextStyle',
264
+ 'label'
265
+ ],
266
+ action: {
267
+ controlId: 'label',
268
+ groupType: 'setting',
269
+ controlType: 'setting',
270
+ newValue: '<p>View more</p>'
271
+ }
272
+ }
273
+ ],
274
+ options: {
275
+ noRecordHistory: true
276
+ }
257
277
  }
258
278
  },
259
279
  {
@@ -6625,7 +6625,7 @@ declare const ProductViewMore: ({ style, styles, setting, advanced, builderProps
6625
6625
  options?: {
6626
6626
  isCannotEditing?: boolean | undefined;
6627
6627
  } | undefined;
6628
- }, "iconSvg" | "iconVisible" | "shouldClearSpace" | "iconAlign">, {
6628
+ }, "iconSvg" | "iconAlign" | "iconVisible" | "shouldClearSpace">, {
6629
6629
  size?: Partial<Record<_gem_sdk_core.NameDevices, string>> | undefined;
6630
6630
  type?: "primary" | "secondary" | undefined;
6631
6631
  align?: Partial<Record<_gem_sdk_core.NameDevices, _gem_sdk_core.AlignProp>> | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.714",
3
+ "version": "2.0.0-dev.716",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,7 +25,7 @@
25
25
  "scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
26
26
  },
27
27
  "devDependencies": {
28
- "@gem-sdk/core": "2.0.0-dev.713",
28
+ "@gem-sdk/core": "2.0.0-dev.716",
29
29
  "@gem-sdk/styles": "2.0.0-dev.703",
30
30
  "@gem-sdk/system": "2.0.0-dev.695",
31
31
  "@types/react-transition-group": "^4.4.5",