@gem-sdk/components 2.0.0-staging.131 → 2.0.0-staging.133

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.
@@ -10,6 +10,7 @@ var React = require('react');
10
10
  var carousel = require('./common/carousel.js');
11
11
 
12
12
  const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, builderProps, parentStyle, parentSettings, background, contentType = 'normalItem', onClickItem, ...passProps })=>{
13
+ const itemPadding = core.makeGlobalSize(parentStyle?.itemPadding);
13
14
  const styleByContentType = React.useMemo(()=>{
14
15
  const delList = [
15
16
  '--radius'
@@ -28,11 +29,6 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
28
29
  bw: parentStyle?.borderContent?.width,
29
30
  bc: core.getSingleColorVariable(parentStyle?.borderContent?.color)
30
31
  }),
31
- ...core.getStyleShadow({
32
- value: parentStyle?.carouselShadow,
33
- styleAppliedFor: 'box-shadow',
34
- isEnableShadow: parentStyle?.hasActiveShadow
35
- }),
36
32
  ...core.getRadiusStyleActiveState({
37
33
  ...parentStyle?.roundedContent,
38
34
  active: {
@@ -65,11 +61,21 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
65
61
  ignoreBackgroundImage: true,
66
62
  ignoreBackgroundImageProperties: true,
67
63
  ignoreBgAttachment: true
68
- })
64
+ }),
65
+ ...itemPadding && itemPadding.padding
69
66
  },
70
67
  onClick: onClickItem,
71
68
  "aria-hidden": true,
72
- children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
69
+ children: /*#__PURE__*/ jsxRuntime.jsx("div", {
70
+ style: {
71
+ ...core.getStyleShadow({
72
+ value: parentStyle?.carouselShadow,
73
+ styleAppliedFor: 'box-shadow',
74
+ isEnableShadow: parentStyle?.hasActiveShadow
75
+ })
76
+ },
77
+ children: core.isEmptyChildren(children) ? /*#__PURE__*/ jsxRuntime.jsx(ChildrenDroppable.default, {}) : children
78
+ })
73
79
  });
74
80
  };
75
81
 
@@ -6,6 +6,7 @@ var core = require('@gem-sdk/core');
6
6
  var carousel = require('./common/carousel.js');
7
7
 
8
8
  const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, builderProps, style, className, parentId, parentStyle, parentSettings, background, index, customStyle, parentUid, contentType = 'normalItem', ...passProps })=>{
9
+ const itemPadding = core.makeGlobalSize(parentStyle?.itemPadding);
9
10
  const styleByContentType = ()=>{
10
11
  const delList = [
11
12
  '--radius'
@@ -21,11 +22,6 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
21
22
  bw: parentStyle?.borderContent?.width,
22
23
  bc: core.getSingleColorVariable(parentStyle?.borderContent?.color)
23
24
  }),
24
- ...core.getStyleShadow({
25
- value: parentStyle?.carouselShadow,
26
- styleAppliedFor: 'box-shadow',
27
- isEnableShadow: parentStyle?.hasActiveShadow
28
- }),
29
25
  ...core.getRadiusStyleActiveState({
30
26
  ...parentStyle?.roundedContent,
31
27
  active: {
@@ -74,12 +70,23 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
74
70
  sneakPeakType: parentSettings?.sneakPeakType,
75
71
  sneakPeakOffsetCenter: parentSettings?.sneakPeakOffsetCenter,
76
72
  sneakPeakOffsetForward: parentSettings?.sneakPeakOffsetForward
77
- }))
73
+ })),
74
+ ...itemPadding && itemPadding.padding
78
75
  }}"
79
76
  class="${core.cls(`gem-slider-item gp-w-full gem-slider-item-${parentId || ''} gp-child-item-${parentUid}`, builderProps?.uid, className)}"
80
77
  data-index="${index}"
81
78
  >
79
+ <div
80
+ style="${{
81
+ ...core.getStyleShadow({
82
+ value: parentStyle?.carouselShadow,
83
+ styleAppliedFor: 'box-shadow',
84
+ isEnableShadow: parentStyle?.hasActiveShadow
85
+ })
86
+ }}"
87
+ >
82
88
  ${children}
89
+ </div>
83
90
  </div>
84
91
  `;
85
92
  };
@@ -732,6 +732,30 @@ const config = {
732
732
  default: 16
733
733
  }
734
734
  }
735
+ },
736
+ {
737
+ id: 'itemPadding',
738
+ type: 'size-setting',
739
+ devices: {
740
+ desktop: {
741
+ default: {
742
+ padding: {
743
+ type: 'custom',
744
+ top: '0px',
745
+ left: '0px',
746
+ bottom: '0px',
747
+ right: '0px'
748
+ }
749
+ }
750
+ }
751
+ },
752
+ hiddenSettings: [
753
+ 'shape',
754
+ 'gap',
755
+ 'width',
756
+ 'height'
757
+ ],
758
+ hiddenShowMore: true
735
759
  }
736
760
  ]
737
761
  }
@@ -1078,6 +1102,16 @@ const config = {
1078
1102
  id: 'sizeSetting'
1079
1103
  },
1080
1104
  layout: 'vertical'
1105
+ },
1106
+ {
1107
+ type: 'control',
1108
+ setting: {
1109
+ id: 'itemPadding'
1110
+ },
1111
+ isMoreSetting: true,
1112
+ options: {
1113
+ noGap: true
1114
+ }
1081
1115
  }
1082
1116
  ]
1083
1117
  },
@@ -32,7 +32,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
32
32
  });
33
33
  //=== END lazyload section ====
34
34
  const childHasChildren = React.useMemo(()=>{
35
- return builderProps?.builderData?.rawChildrens?.find((child)=>child?.childrens?.length);
35
+ return builderProps?.builderData?.childrens?.length;
36
36
  }, [
37
37
  builderProps
38
38
  ]);
@@ -44,8 +44,9 @@ const IconListV2 = ({ builderProps, style, setting, styles, advanced, pageContex
44
44
  ...core.makeStyleResponsive('rg', verticalSpacing)
45
45
  }}">
46
46
  ${valueMap?.map((node, key)=>{
47
+ let value = helpers.replaceLinkData(childItem?.[key]);
47
48
  const textVal = helpers.getDynamicSourceLocales({
48
- val: childItem?.[key],
49
+ val: value,
49
50
  uid: builderProps?.uid,
50
51
  settingId: `childItem_${key}`,
51
52
  pageContext,
@@ -208,7 +208,7 @@ const ProductList = ({ children, className, setting, styles, builderProps })=>{
208
208
  if (isProductGridNotRender) return;
209
209
  setTimeout(()=>{
210
210
  const { builderData } = builderProps ?? {};
211
- const targetUid = mode === 'edit' ? builderData?.rawChildrens?.[0]?.childrens?.[0] : builderData?.childrens?.[0];
211
+ const targetUid = builderData?.childrens?.[0];
212
212
  if (!targetUid) return;
213
213
  const container = document.querySelector(mode === 'edit' ? `[data-uid=${targetUid}]` : `[data-id=${targetUid}] div`);
214
214
  if (!container) return;
@@ -10,6 +10,7 @@ var React = require('react');
10
10
  const Text = /*#__PURE__*/ React.forwardRef(({ styles, builderAttrs, style, setting, advanced, builderProps, className, children, ...props }, ref)=>{
11
11
  const { text, htmlTag: Element = 'div', options, tagWidth, excludeFlex } = setting ?? {};
12
12
  const composeGlobalSize = core.makeGlobalSize(setting?.globalSize);
13
+ console.log('Text: ', text);
13
14
  const mode = core.useEditorMode();
14
15
  const getPlaceHolderWhenContentNone = ()=>{
15
16
  let classList = '';
@@ -1,11 +1,12 @@
1
1
  'use client';
2
2
  import { jsx } from 'react/jsx-runtime';
3
- import { makeStyle, getSingleColorVariable, getStyleShadow, getRadiusStyleActiveState, cls, getStyleBackgroundByDevice, isEmptyChildren } from '@gem-sdk/core';
3
+ import { makeGlobalSize, makeStyle, getSingleColorVariable, getRadiusStyleActiveState, cls, getStyleBackgroundByDevice, getStyleShadow, isEmptyChildren } from '@gem-sdk/core';
4
4
  import ChildrenDroppable from '../../grid/components/ChildrenDroppable.js';
5
5
  import { useMemo } from 'react';
6
6
  import { getInitialWidthForCarouselItem } from './common/carousel.js';
7
7
 
8
8
  const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, builderProps, parentStyle, parentSettings, background, contentType = 'normalItem', onClickItem, ...passProps })=>{
9
+ const itemPadding = makeGlobalSize(parentStyle?.itemPadding);
9
10
  const styleByContentType = useMemo(()=>{
10
11
  const delList = [
11
12
  '--radius'
@@ -24,11 +25,6 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
24
25
  bw: parentStyle?.borderContent?.width,
25
26
  bc: getSingleColorVariable(parentStyle?.borderContent?.color)
26
27
  }),
27
- ...getStyleShadow({
28
- value: parentStyle?.carouselShadow,
29
- styleAppliedFor: 'box-shadow',
30
- isEnableShadow: parentStyle?.hasActiveShadow
31
- }),
32
28
  ...getRadiusStyleActiveState({
33
29
  ...parentStyle?.roundedContent,
34
30
  active: {
@@ -61,11 +57,21 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
61
57
  ignoreBackgroundImage: true,
62
58
  ignoreBackgroundImageProperties: true,
63
59
  ignoreBgAttachment: true
64
- })
60
+ }),
61
+ ...itemPadding && itemPadding.padding
65
62
  },
66
63
  onClick: onClickItem,
67
64
  "aria-hidden": true,
68
- children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
65
+ children: /*#__PURE__*/ jsx("div", {
66
+ style: {
67
+ ...getStyleShadow({
68
+ value: parentStyle?.carouselShadow,
69
+ styleAppliedFor: 'box-shadow',
70
+ isEnableShadow: parentStyle?.hasActiveShadow
71
+ })
72
+ },
73
+ children: isEmptyChildren(children) ? /*#__PURE__*/ jsx(ChildrenDroppable, {}) : children
74
+ })
69
75
  });
70
76
  };
71
77
 
@@ -1,7 +1,8 @@
1
- import { template, getStyleBackgroundByDevice, makeStyleResponsive, cls, makeStyle, getSingleColorVariable, getStyleShadow, getRadiusStyleActiveState } from '@gem-sdk/core';
1
+ import { makeGlobalSize, template, getStyleBackgroundByDevice, makeStyleResponsive, cls, getStyleShadow, makeStyle, getSingleColorVariable, getRadiusStyleActiveState } from '@gem-sdk/core';
2
2
  import { getInitialWidthForCarouselItem, getCarouselSneakPeakTranslate } from './common/carousel.js';
3
3
 
4
4
  const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, builderProps, style, className, parentId, parentStyle, parentSettings, background, index, customStyle, parentUid, contentType = 'normalItem', ...passProps })=>{
5
+ const itemPadding = makeGlobalSize(parentStyle?.itemPadding);
5
6
  const styleByContentType = ()=>{
6
7
  const delList = [
7
8
  '--radius'
@@ -17,11 +18,6 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
17
18
  bw: parentStyle?.borderContent?.width,
18
19
  bc: getSingleColorVariable(parentStyle?.borderContent?.color)
19
20
  }),
20
- ...getStyleShadow({
21
- value: parentStyle?.carouselShadow,
22
- styleAppliedFor: 'box-shadow',
23
- isEnableShadow: parentStyle?.hasActiveShadow
24
- }),
25
21
  ...getRadiusStyleActiveState({
26
22
  ...parentStyle?.roundedContent,
27
23
  active: {
@@ -70,12 +66,23 @@ const CarouselItem = ({ children, builderAttrs, styles, advanced, setting, build
70
66
  sneakPeakType: parentSettings?.sneakPeakType,
71
67
  sneakPeakOffsetCenter: parentSettings?.sneakPeakOffsetCenter,
72
68
  sneakPeakOffsetForward: parentSettings?.sneakPeakOffsetForward
73
- }))
69
+ })),
70
+ ...itemPadding && itemPadding.padding
74
71
  }}"
75
72
  class="${cls(`gem-slider-item gp-w-full gem-slider-item-${parentId || ''} gp-child-item-${parentUid}`, builderProps?.uid, className)}"
76
73
  data-index="${index}"
77
74
  >
75
+ <div
76
+ style="${{
77
+ ...getStyleShadow({
78
+ value: parentStyle?.carouselShadow,
79
+ styleAppliedFor: 'box-shadow',
80
+ isEnableShadow: parentStyle?.hasActiveShadow
81
+ })
82
+ }}"
83
+ >
78
84
  ${children}
85
+ </div>
79
86
  </div>
80
87
  `;
81
88
  };
@@ -728,6 +728,30 @@ const config = {
728
728
  default: 16
729
729
  }
730
730
  }
731
+ },
732
+ {
733
+ id: 'itemPadding',
734
+ type: 'size-setting',
735
+ devices: {
736
+ desktop: {
737
+ default: {
738
+ padding: {
739
+ type: 'custom',
740
+ top: '0px',
741
+ left: '0px',
742
+ bottom: '0px',
743
+ right: '0px'
744
+ }
745
+ }
746
+ }
747
+ },
748
+ hiddenSettings: [
749
+ 'shape',
750
+ 'gap',
751
+ 'width',
752
+ 'height'
753
+ ],
754
+ hiddenShowMore: true
731
755
  }
732
756
  ]
733
757
  }
@@ -1074,6 +1098,16 @@ const config = {
1074
1098
  id: 'sizeSetting'
1075
1099
  },
1076
1100
  layout: 'vertical'
1101
+ },
1102
+ {
1103
+ type: 'control',
1104
+ setting: {
1105
+ id: 'itemPadding'
1106
+ },
1107
+ isMoreSetting: true,
1108
+ options: {
1109
+ noGap: true
1110
+ }
1077
1111
  }
1078
1112
  ]
1079
1113
  },
@@ -28,7 +28,7 @@ const Row = ({ className, children, setting, builderAttrs, builderProps, styles,
28
28
  });
29
29
  //=== END lazyload section ====
30
30
  const childHasChildren = useMemo(()=>{
31
- return builderProps?.builderData?.rawChildrens?.find((child)=>child?.childrens?.length);
31
+ return builderProps?.builderData?.childrens?.length;
32
32
  }, [
33
33
  builderProps
34
34
  ]);
@@ -1,5 +1,5 @@
1
1
  import { makeGlobalSize, composeTypographyStyle, composeTypographyClassName, template, dataStringify, getStyleBackgroundByDevice, RenderIf, makeStyleResponsive, makeStyle, getSingleColorVariable, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
2
- import { getStaticLocale, getDynamicSourceLocales, getSettingPreloadData } from '../../helpers.js';
2
+ import { getStaticLocale, replaceLinkData, getDynamicSourceLocales, getSettingPreloadData } from '../../helpers.js';
3
3
 
4
4
  const IconListV2 = ({ builderProps, style, setting, styles, advanced, pageContext })=>{
5
5
  const { childItem, childConfig, iconType, iconSvg, iconWidth, globalSize, textTypo, translate } = setting ?? {};
@@ -40,8 +40,9 @@ const IconListV2 = ({ builderProps, style, setting, styles, advanced, pageContex
40
40
  ...makeStyleResponsive('rg', verticalSpacing)
41
41
  }}">
42
42
  ${valueMap?.map((node, key)=>{
43
+ let value = replaceLinkData(childItem?.[key]);
43
44
  const textVal = getDynamicSourceLocales({
44
- val: childItem?.[key],
45
+ val: value,
45
46
  uid: builderProps?.uid,
46
47
  settingId: `childItem_${key}`,
47
48
  pageContext,
@@ -204,7 +204,7 @@ const ProductList = ({ children, className, setting, styles, builderProps })=>{
204
204
  if (isProductGridNotRender) return;
205
205
  setTimeout(()=>{
206
206
  const { builderData } = builderProps ?? {};
207
- const targetUid = mode === 'edit' ? builderData?.rawChildrens?.[0]?.childrens?.[0] : builderData?.childrens?.[0];
207
+ const targetUid = builderData?.childrens?.[0];
208
208
  if (!targetUid) return;
209
209
  const container = document.querySelector(mode === 'edit' ? `[data-uid=${targetUid}]` : `[data-id=${targetUid}] div`);
210
210
  if (!container) return;
@@ -6,6 +6,7 @@ import { forwardRef, useMemo } from 'react';
6
6
  const Text = /*#__PURE__*/ forwardRef(({ styles, builderAttrs, style, setting, advanced, builderProps, className, children, ...props }, ref)=>{
7
7
  const { text, htmlTag: Element = 'div', options, tagWidth, excludeFlex } = setting ?? {};
8
8
  const composeGlobalSize = makeGlobalSize(setting?.globalSize);
9
+ console.log('Text: ', text);
9
10
  const mode = useEditorMode();
10
11
  const getPlaceHolderWhenContentNone = ()=>{
11
12
  let classList = '';
@@ -288,6 +288,7 @@ type CarouselStyles = {
288
288
  align?: ObjectDevices<AlignProp | Property.AlignItems>;
289
289
  sizeSetting?: ObjectDevices<SizeSettingGlobal>;
290
290
  playSpeed?: number;
291
+ itemPadding?: ObjectDevices<SizeSettingGlobal>;
291
292
  };
292
293
  type CarouselProps = BasePropsWrap<CarouselSettings, CarouselStyles> & {
293
294
  children?: React.ReactNode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-staging.131",
3
+ "version": "2.0.0-staging.133",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -22,7 +22,7 @@
22
22
  "relationship": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/get-control-relationship.js && node ./scripts/get-element-relationship.js"
23
23
  },
24
24
  "devDependencies": {
25
- "@gem-sdk/core": "2.0.0-staging.117",
25
+ "@gem-sdk/core": "2.0.0-staging.132",
26
26
  "@gem-sdk/styles": "2.0.0-staging.127",
27
27
  "@types/react-transition-group": "^4.4.5"
28
28
  },