@gem-sdk/components 2.0.0-dev.484 → 2.0.0-dev.485

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.
@@ -15,11 +15,11 @@ var useHeroBanner = require('./hooks/useHeroBanner.js');
15
15
  const HeroBanner = (props)=>{
16
16
  const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
17
17
  const mode = core.useEditorMode();
18
- const { link } = setting ?? {};
18
+ const { link, enableLink } = setting ?? {};
19
19
  const { cssClass } = advanced ?? {};
20
20
  const currentDevice = core.useCurrentDevice();
21
21
  const { elementRef, transform, onMouseEnterParallax, onMouseLeaveParallax, dataVideo, bgRef, isShowVideoHtml5, openLinkBanner, layoutResponsive } = useHeroBanner.useHeroBanner(styles, setting, currentDevice);
22
- const hasLinkCover = !!link?.link && mode !== 'edit';
22
+ const hasLinkCover = !!link?.link && enableLink && mode !== 'edit';
23
23
  const attrs = system.createAttr({
24
24
  ...getAttr.getAttr({
25
25
  uid: builderProps?.uid || ''
@@ -13,7 +13,7 @@ var common = require('./common/common.js');
13
13
 
14
14
  const HeroBanner = (props)=>{
15
15
  const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
16
- const { link } = setting ?? {};
16
+ const { link, enableLink } = setting ?? {};
17
17
  const { cssClass } = advanced ?? {};
18
18
  const { urlData } = helpers.getInsertLinkData('', link);
19
19
  const stateDataHeroBanner = system.createStateOrContext({
@@ -31,7 +31,7 @@ const HeroBanner = (props)=>{
31
31
  href: urlData?.href ?? '',
32
32
  linkType: link?.type ?? ''
33
33
  });
34
- const hasLinkCover = !!link?.link;
34
+ const hasLinkCover = !!link?.link && enableLink;
35
35
  const attrs = system.createAttr({
36
36
  ...getAttr.getAttr({
37
37
  uid: builderProps?.uid || ''
@@ -50,11 +50,19 @@ const getContainerStyle = (styles, setting)=>{
50
50
  };
51
51
  const getOverlayStyle = (styles)=>{
52
52
  const { overlayColor, overlayOpacity } = styles ?? {};
53
- console.log('111', core.getGlobalColorStateStyle('bgc', overlayColor));
54
- console.log('22', core.makeStyleState('op', overlayOpacity));
53
+ const bgcColor = core.getGlobalColorStateStyle('bgc', overlayColor);
54
+ const opacityColor = core.makeStyleState('op', overlayOpacity);
55
+ if (!overlayColor?.normal || overlayOpacity?.normal == '0%') {
56
+ delete bgcColor?.['--bgc'];
57
+ delete opacityColor?.['--op'];
58
+ }
59
+ if (!overlayColor?.hover || overlayOpacity?.hover == '0%') {
60
+ delete bgcColor?.['--hvr-bgc'];
61
+ delete opacityColor?.['--hvr-op'];
62
+ }
55
63
  const composeStyles = {
56
- ...core.getGlobalColorStateStyle('bgc', overlayColor),
57
- ...core.makeStyleState('op', overlayOpacity),
64
+ ...bgcColor,
65
+ ...opacityColor,
58
66
  '--top': '0',
59
67
  '--left': '0'
60
68
  };
@@ -52,7 +52,8 @@ const heroBannerContentLeft = {
52
52
  desktop: {
53
53
  shape: 'original',
54
54
  widthHeightLinked: false,
55
- width: '100%'
55
+ width: '100%',
56
+ height: '600px'
56
57
  },
57
58
  mobile: {
58
59
  shape: 'custom',
@@ -61,7 +61,8 @@ const heroBannerContentRight = {
61
61
  desktop: {
62
62
  shape: 'original',
63
63
  widthHeightLinked: false,
64
- width: '100%'
64
+ width: '100%',
65
+ height: '600px'
65
66
  },
66
67
  mobile: {
67
68
  shape: 'original',
@@ -170,10 +170,11 @@ const SettingsV2 = [
170
170
  label: 'Speed',
171
171
  useOnlyUnitInit: true,
172
172
  hideUnit: true,
173
- isNumber: true,
174
173
  min: 0,
175
174
  max: 1,
176
- step: 0.1
175
+ step: 0.1,
176
+ compoDefaultValue: 0.6,
177
+ default: 0.6
177
178
  },
178
179
  {
179
180
  id: 'alignBanner',
@@ -118,7 +118,8 @@ const DialogSettings = [
118
118
  {
119
119
  id: 'overlayColor',
120
120
  type: 'color-picker-v2',
121
- default: '#121212'
121
+ default: '#121212',
122
+ compoDefaultValue: '#121212'
122
123
  },
123
124
  {
124
125
  id: 'overlayOpacity',
@@ -11,11 +11,11 @@ import { useHeroBanner } from './hooks/useHeroBanner.js';
11
11
  const HeroBanner = (props)=>{
12
12
  const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
13
13
  const mode = useEditorMode();
14
- const { link } = setting ?? {};
14
+ const { link, enableLink } = setting ?? {};
15
15
  const { cssClass } = advanced ?? {};
16
16
  const currentDevice = useCurrentDevice();
17
17
  const { elementRef, transform, onMouseEnterParallax, onMouseLeaveParallax, dataVideo, bgRef, isShowVideoHtml5, openLinkBanner, layoutResponsive } = useHeroBanner(styles, setting, currentDevice);
18
- const hasLinkCover = !!link?.link && mode !== 'edit';
18
+ const hasLinkCover = !!link?.link && enableLink && mode !== 'edit';
19
19
  const attrs = createAttr({
20
20
  ...getAttr({
21
21
  uid: builderProps?.uid || ''
@@ -9,7 +9,7 @@ import { getResponsiveSetting } from './common/common.js';
9
9
 
10
10
  const HeroBanner = (props)=>{
11
11
  const { builderAttrs, builderProps, setting, styles, style, children, advanced, enableLazyloadImage = true } = props;
12
- const { link } = setting ?? {};
12
+ const { link, enableLink } = setting ?? {};
13
13
  const { cssClass } = advanced ?? {};
14
14
  const { urlData } = getInsertLinkData('', link);
15
15
  const stateDataHeroBanner = createStateOrContext({
@@ -27,7 +27,7 @@ const HeroBanner = (props)=>{
27
27
  href: urlData?.href ?? '',
28
28
  linkType: link?.type ?? ''
29
29
  });
30
- const hasLinkCover = !!link?.link;
30
+ const hasLinkCover = !!link?.link && enableLink;
31
31
  const attrs = createAttr({
32
32
  ...getAttr({
33
33
  uid: builderProps?.uid || ''
@@ -48,11 +48,19 @@ const getContainerStyle = (styles, setting)=>{
48
48
  };
49
49
  const getOverlayStyle = (styles)=>{
50
50
  const { overlayColor, overlayOpacity } = styles ?? {};
51
- console.log('111', getGlobalColorStateStyle('bgc', overlayColor));
52
- console.log('22', makeStyleState('op', overlayOpacity));
51
+ const bgcColor = getGlobalColorStateStyle('bgc', overlayColor);
52
+ const opacityColor = makeStyleState('op', overlayOpacity);
53
+ if (!overlayColor?.normal || overlayOpacity?.normal == '0%') {
54
+ delete bgcColor?.['--bgc'];
55
+ delete opacityColor?.['--op'];
56
+ }
57
+ if (!overlayColor?.hover || overlayOpacity?.hover == '0%') {
58
+ delete bgcColor?.['--hvr-bgc'];
59
+ delete opacityColor?.['--hvr-op'];
60
+ }
53
61
  const composeStyles = {
54
- ...getGlobalColorStateStyle('bgc', overlayColor),
55
- ...makeStyleState('op', overlayOpacity),
62
+ ...bgcColor,
63
+ ...opacityColor,
56
64
  '--top': '0',
57
65
  '--left': '0'
58
66
  };
@@ -50,7 +50,8 @@ const heroBannerContentLeft = {
50
50
  desktop: {
51
51
  shape: 'original',
52
52
  widthHeightLinked: false,
53
- width: '100%'
53
+ width: '100%',
54
+ height: '600px'
54
55
  },
55
56
  mobile: {
56
57
  shape: 'custom',
@@ -59,7 +59,8 @@ const heroBannerContentRight = {
59
59
  desktop: {
60
60
  shape: 'original',
61
61
  widthHeightLinked: false,
62
- width: '100%'
62
+ width: '100%',
63
+ height: '600px'
63
64
  },
64
65
  mobile: {
65
66
  shape: 'original',
@@ -168,10 +168,11 @@ const SettingsV2 = [
168
168
  label: 'Speed',
169
169
  useOnlyUnitInit: true,
170
170
  hideUnit: true,
171
- isNumber: true,
172
171
  min: 0,
173
172
  max: 1,
174
- step: 0.1
173
+ step: 0.1,
174
+ compoDefaultValue: 0.6,
175
+ default: 0.6
175
176
  },
176
177
  {
177
178
  id: 'alignBanner',
@@ -116,7 +116,8 @@ const DialogSettings = [
116
116
  {
117
117
  id: 'overlayColor',
118
118
  type: 'color-picker-v2',
119
- default: '#121212'
119
+ default: '#121212',
120
+ compoDefaultValue: '#121212'
120
121
  },
121
122
  {
122
123
  id: 'overlayOpacity',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.484",
3
+ "version": "2.0.0-dev.485",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",