@gem-sdk/core 1.28.1 → 1.28.7

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.
@@ -131,13 +131,58 @@ function Spacing(props) {
131
131
  }
132
132
  }
133
133
  }, []);
134
+ const isPopup = (el)=>{
135
+ const tag = el.getAttribute('data-component-tag');
136
+ return tag === 'Dialog';
137
+ };
138
+ const isSticky = (el)=>{
139
+ const tag = el.getAttribute('data-component-tag');
140
+ return tag === 'Sticky';
141
+ };
142
+ const setPositionSpacing = react.useCallback((paddingLeft)=>{
143
+ const $component = $bottomDrag.current?.closest('[data-toolbar-wrap]');
144
+ if ($component) {
145
+ if (isPopup($component) || isSticky($component)) return;
146
+ const toolbar = $component && getChildrenByAttrSelector($component, 'data-toolbar');
147
+ const isActive = toolbar && toolbar.getAttribute('data-toolbar-active');
148
+ if (isActive && paddingLeft) {
149
+ const currentValue = isNaN(parseInt(paddingLeft)) ? 0 : Math.max(parseInt(paddingLeft), 0);
150
+ const newValue = `-${currentValue}px`;
151
+ const translateCss = `translate(-${currentValue}px, -100%)`;
152
+ if ($bottomDrag.current && $bottomBg.current) {
153
+ $bottomBg.current.style.left = newValue;
154
+ $bottomDrag.current.style.transform = translateCss;
155
+ }
156
+ }
157
+ }
158
+ }, []);
159
+ const onUpdatePaddingLeft = react.useCallback((e)=>{
160
+ if (isDragging.current) return;
161
+ const detail = e.detail;
162
+ if (detail?.paddingLeft) {
163
+ setPositionSpacing(detail.paddingLeft);
164
+ }
165
+ }, [
166
+ setPositionSpacing
167
+ ]);
168
+ react.useEffect(()=>{
169
+ const $component = $bottomDrag.current?.closest('[data-toolbar-wrap]');
170
+ if ($component) {
171
+ const style = getComputedStyle($component);
172
+ const paddingLeft = style.paddingLeft;
173
+ setPositionSpacing(paddingLeft);
174
+ }
175
+ });
134
176
  react.useEffect(()=>{
135
177
  window.addEventListener('editor:toolbar:update-margin-bottom', onUpdateMarginBottom);
178
+ window.addEventListener('editor:toolbar:update-padding-left', onUpdatePaddingLeft);
136
179
  return ()=>{
137
180
  window.removeEventListener('editor:toolbar:update-margin-bottom', onUpdateMarginBottom);
181
+ window.removeEventListener('editor:toolbar:update-padding-left', onUpdatePaddingLeft);
138
182
  };
139
183
  }, [
140
- onUpdateMarginBottom
184
+ onUpdateMarginBottom,
185
+ onUpdatePaddingLeft
141
186
  ]);
142
187
  return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {
143
188
  children: props.tag !== 'Section' && /*#__PURE__*/ jsxRuntime.jsx("div", {
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var constant = require('./constant.js');
3
4
  var colors = require('./colors.js');
4
5
  var makeStyle = require('./make-style.js');
5
6
 
@@ -45,6 +46,8 @@ const getStyleBgImage = (background, options)=>{
45
46
  return makeStyle.makeStyleResponsive('bgi', bgImage);
46
47
  };
47
48
  const getBgImageByDevice = (background, device, options)=>{
49
+ const isBgVideo = background?.[device]?.type === 'video';
50
+ if (isBgVideo) return;
48
51
  const backupFileKey = background?.[device]?.image?.backupFileKey;
49
52
  const imageByDevice = options?.liquid && backupFileKey && `{{ "${backupFileKey}" | asset_url }}` || background?.[device]?.image?.src;
50
53
  if (typeof imageByDevice === 'string') {
@@ -134,37 +137,38 @@ const makeFixedBgAttachment = (background)=>{
134
137
  };
135
138
  };
136
139
  const makeFixedBgAttachmentByDevice = (device, bgAttachment)=>{
137
- const subfix = device === 'desktop' ? '' : `-${device}`;
140
+ const suffix = constant.devicesMapping[device] ?? '';
138
141
  if (bgAttachment === 'fixed') {
139
142
  return {
140
143
  wrapper: {
141
- [`--pos${subfix}`]: 'absolute',
142
- [`--top${subfix}`]: '0',
143
- [`--left${subfix}`]: '0',
144
- [`--w${subfix}`]: '100%',
145
- [`--h${subfix}`]: '100%'
144
+ [`--pos${suffix}`]: 'absolute',
145
+ [`--top${suffix}`]: '0',
146
+ [`--left${suffix}`]: '0',
147
+ [`--w${suffix}`]: '100%',
148
+ [`--h${suffix}`]: '100%'
146
149
  },
147
150
  content: {
148
- [`--pos${subfix}`]: 'fixed',
149
- [`--w${subfix}`]: '100vw',
150
- [`--h${subfix}`]: '100vh',
151
- [`--bga${subfix}`]: 'unset'
151
+ [`--pos${suffix}`]: 'fixed',
152
+ [`--w${suffix}`]: '100vw',
153
+ [`--h${suffix}`]: '100vh',
154
+ [`--bga${suffix}`]: 'unset'
152
155
  }
153
156
  };
154
157
  }
155
158
  return {
156
159
  wrapper: {
157
- [`--pos${subfix}`]: 'absolute'
160
+ [`--pos${suffix}`]: 'absolute'
158
161
  },
159
162
  content: {
160
- [`--w${subfix}`]: '100%',
161
- [`--h${subfix}`]: '100%',
162
- [`--pos${subfix}`]: 'absolute',
163
- [`--bga${subfix}`]: bgAttachment
163
+ [`--w${suffix}`]: 'inherit',
164
+ [`--h${suffix}`]: 'inherit',
165
+ [`--pos${suffix}`]: 'absolute',
166
+ [`--bga${suffix}`]: bgAttachment
164
167
  }
165
168
  };
166
169
  };
167
170
 
168
171
  exports.composeBackgroundCss = composeBackgroundCss;
172
+ exports.getBgImageByDevice = getBgImageByDevice;
169
173
  exports.getStyleBackgroundByDevice = getStyleBackgroundByDevice;
170
174
  exports.makeFixedBgAttachment = makeFixedBgAttachment;
@@ -91,7 +91,7 @@ const getHeightByShapeGlobalSize = (shapeByLayout)=>{
91
91
  });
92
92
  return result;
93
93
  };
94
- const getWidthByShapeGlobalSize = (shapeByLayout)=>{
94
+ const getWidthByShapeGlobalSize = (shapeByLayout, defaultAuto)=>{
95
95
  let result = {};
96
96
  const DEVICES = [
97
97
  'desktop',
@@ -100,7 +100,7 @@ const getWidthByShapeGlobalSize = (shapeByLayout)=>{
100
100
  ];
101
101
  DEVICES.forEach((device)=>{
102
102
  const shapeByDevice = getResonsiveValue.getResponsiveValueByScreen(shapeByLayout, device);
103
- const width = shapeByDevice?.width;
103
+ const width = defaultAuto ? shapeByDevice?.width || 'auto' : shapeByDevice?.width;
104
104
  if (width) {
105
105
  result = {
106
106
  ...result,
package/dist/cjs/index.js CHANGED
@@ -236,6 +236,7 @@ exports.getStyleShadow = shadow.getStyleShadow;
236
236
  exports.getStyleShadowState = shadow.getStyleShadowState;
237
237
  exports.parseValueWithUnit = shadow.parseValueWithUnit;
238
238
  exports.composeBackgroundCss = background.composeBackgroundCss;
239
+ exports.getBgImageByDevice = background.getBgImageByDevice;
239
240
  exports.getStyleBackgroundByDevice = background.getStyleBackgroundByDevice;
240
241
  exports.makeFixedBgAttachment = background.makeFixedBgAttachment;
241
242
  exports.generateCollectionQueryKey = query.generateCollectionQueryKey;
@@ -127,13 +127,58 @@ function Spacing(props) {
127
127
  }
128
128
  }
129
129
  }, []);
130
+ const isPopup = (el)=>{
131
+ const tag = el.getAttribute('data-component-tag');
132
+ return tag === 'Dialog';
133
+ };
134
+ const isSticky = (el)=>{
135
+ const tag = el.getAttribute('data-component-tag');
136
+ return tag === 'Sticky';
137
+ };
138
+ const setPositionSpacing = useCallback((paddingLeft)=>{
139
+ const $component = $bottomDrag.current?.closest('[data-toolbar-wrap]');
140
+ if ($component) {
141
+ if (isPopup($component) || isSticky($component)) return;
142
+ const toolbar = $component && getChildrenByAttrSelector($component, 'data-toolbar');
143
+ const isActive = toolbar && toolbar.getAttribute('data-toolbar-active');
144
+ if (isActive && paddingLeft) {
145
+ const currentValue = isNaN(parseInt(paddingLeft)) ? 0 : Math.max(parseInt(paddingLeft), 0);
146
+ const newValue = `-${currentValue}px`;
147
+ const translateCss = `translate(-${currentValue}px, -100%)`;
148
+ if ($bottomDrag.current && $bottomBg.current) {
149
+ $bottomBg.current.style.left = newValue;
150
+ $bottomDrag.current.style.transform = translateCss;
151
+ }
152
+ }
153
+ }
154
+ }, []);
155
+ const onUpdatePaddingLeft = useCallback((e)=>{
156
+ if (isDragging.current) return;
157
+ const detail = e.detail;
158
+ if (detail?.paddingLeft) {
159
+ setPositionSpacing(detail.paddingLeft);
160
+ }
161
+ }, [
162
+ setPositionSpacing
163
+ ]);
164
+ useEffect(()=>{
165
+ const $component = $bottomDrag.current?.closest('[data-toolbar-wrap]');
166
+ if ($component) {
167
+ const style = getComputedStyle($component);
168
+ const paddingLeft = style.paddingLeft;
169
+ setPositionSpacing(paddingLeft);
170
+ }
171
+ });
130
172
  useEffect(()=>{
131
173
  window.addEventListener('editor:toolbar:update-margin-bottom', onUpdateMarginBottom);
174
+ window.addEventListener('editor:toolbar:update-padding-left', onUpdatePaddingLeft);
132
175
  return ()=>{
133
176
  window.removeEventListener('editor:toolbar:update-margin-bottom', onUpdateMarginBottom);
177
+ window.removeEventListener('editor:toolbar:update-padding-left', onUpdatePaddingLeft);
134
178
  };
135
179
  }, [
136
- onUpdateMarginBottom
180
+ onUpdateMarginBottom,
181
+ onUpdatePaddingLeft
137
182
  ]);
138
183
  return /*#__PURE__*/ jsx(Fragment, {
139
184
  children: props.tag !== 'Section' && /*#__PURE__*/ jsx("div", {
@@ -1,3 +1,4 @@
1
+ import { devicesMapping } from './constant.js';
1
2
  import { isColor, getSingleColorVariable } from './colors.js';
2
3
  import { makeStyleResponsive } from './make-style.js';
3
4
 
@@ -43,6 +44,8 @@ const getStyleBgImage = (background, options)=>{
43
44
  return makeStyleResponsive('bgi', bgImage);
44
45
  };
45
46
  const getBgImageByDevice = (background, device, options)=>{
47
+ const isBgVideo = background?.[device]?.type === 'video';
48
+ if (isBgVideo) return;
46
49
  const backupFileKey = background?.[device]?.image?.backupFileKey;
47
50
  const imageByDevice = options?.liquid && backupFileKey && `{{ "${backupFileKey}" | asset_url }}` || background?.[device]?.image?.src;
48
51
  if (typeof imageByDevice === 'string') {
@@ -132,35 +135,35 @@ const makeFixedBgAttachment = (background)=>{
132
135
  };
133
136
  };
134
137
  const makeFixedBgAttachmentByDevice = (device, bgAttachment)=>{
135
- const subfix = device === 'desktop' ? '' : `-${device}`;
138
+ const suffix = devicesMapping[device] ?? '';
136
139
  if (bgAttachment === 'fixed') {
137
140
  return {
138
141
  wrapper: {
139
- [`--pos${subfix}`]: 'absolute',
140
- [`--top${subfix}`]: '0',
141
- [`--left${subfix}`]: '0',
142
- [`--w${subfix}`]: '100%',
143
- [`--h${subfix}`]: '100%'
142
+ [`--pos${suffix}`]: 'absolute',
143
+ [`--top${suffix}`]: '0',
144
+ [`--left${suffix}`]: '0',
145
+ [`--w${suffix}`]: '100%',
146
+ [`--h${suffix}`]: '100%'
144
147
  },
145
148
  content: {
146
- [`--pos${subfix}`]: 'fixed',
147
- [`--w${subfix}`]: '100vw',
148
- [`--h${subfix}`]: '100vh',
149
- [`--bga${subfix}`]: 'unset'
149
+ [`--pos${suffix}`]: 'fixed',
150
+ [`--w${suffix}`]: '100vw',
151
+ [`--h${suffix}`]: '100vh',
152
+ [`--bga${suffix}`]: 'unset'
150
153
  }
151
154
  };
152
155
  }
153
156
  return {
154
157
  wrapper: {
155
- [`--pos${subfix}`]: 'absolute'
158
+ [`--pos${suffix}`]: 'absolute'
156
159
  },
157
160
  content: {
158
- [`--w${subfix}`]: '100%',
159
- [`--h${subfix}`]: '100%',
160
- [`--pos${subfix}`]: 'absolute',
161
- [`--bga${subfix}`]: bgAttachment
161
+ [`--w${suffix}`]: 'inherit',
162
+ [`--h${suffix}`]: 'inherit',
163
+ [`--pos${suffix}`]: 'absolute',
164
+ [`--bga${suffix}`]: bgAttachment
162
165
  }
163
166
  };
164
167
  };
165
168
 
166
- export { composeBackgroundCss, getStyleBackgroundByDevice, makeFixedBgAttachment };
169
+ export { composeBackgroundCss, getBgImageByDevice, getStyleBackgroundByDevice, makeFixedBgAttachment };
@@ -89,7 +89,7 @@ const getHeightByShapeGlobalSize = (shapeByLayout)=>{
89
89
  });
90
90
  return result;
91
91
  };
92
- const getWidthByShapeGlobalSize = (shapeByLayout)=>{
92
+ const getWidthByShapeGlobalSize = (shapeByLayout, defaultAuto)=>{
93
93
  let result = {};
94
94
  const DEVICES = [
95
95
  'desktop',
@@ -98,7 +98,7 @@ const getWidthByShapeGlobalSize = (shapeByLayout)=>{
98
98
  ];
99
99
  DEVICES.forEach((device)=>{
100
100
  const shapeByDevice = getResponsiveValueByScreen(shapeByLayout, device);
101
- const width = shapeByDevice?.width;
101
+ const width = defaultAuto ? shapeByDevice?.width || 'auto' : shapeByDevice?.width;
102
102
  if (width) {
103
103
  result = {
104
104
  ...result,
package/dist/esm/index.js CHANGED
@@ -55,7 +55,7 @@ export { RenderIf, composeMemo, dataStringify, props, styles, template } from '.
55
55
  export { baseAssetURL, isLocalEnv } from './helpers/convert.js';
56
56
  export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeStyleWithDefault } from './helpers/size.js';
57
57
  export { composeShadowCss, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
58
- export { composeBackgroundCss, getStyleBackgroundByDevice, makeFixedBgAttachment } from './helpers/background.js';
58
+ export { composeBackgroundCss, getBgImageByDevice, getStyleBackgroundByDevice, makeFixedBgAttachment } from './helpers/background.js';
59
59
  export { generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey } from './helpers/query.js';
60
60
  export { composeAdvanceStyle, splitStyle } from './helpers/compose-advance-style.js';
61
61
  export { composePositionLineHeight, composePostionIconList } from './helpers/icon-list.js';
@@ -832,6 +832,12 @@ type LayoutControlType<T> = SharedControlType<T> & {
832
832
  isProductLayout?: boolean;
833
833
  };
834
834
 
835
+ type LayoutBannerControlType<T> = SharedControlType<T> & {
836
+ type: 'layout-banner';
837
+ maxCol?: number;
838
+ isProductLayout?: boolean;
839
+ };
840
+
835
841
  type CollectionBannerControlType<T> = SharedControlType<T> & {
836
842
  type: 'collectionBanner';
837
843
  value?: Background;
@@ -932,8 +938,12 @@ type GridArrange<T> = SharedControlType<T> & {
932
938
  };
933
939
 
934
940
  type SettingID = 'shape' | 'width' | 'height' | 'gap' | 'padding';
935
- type OptionKeyword = 'default' | 'auto' | 'full' | 'equal' | 'small' | 'medium' | 'large' | 'original';
941
+ type ShapeOptionKeyword = 'original' | 'square' | 'vertical' | 'horizontal' | 'custom';
942
+ type HeightOptionKeyword = 'fit-content' | 'fit-screen';
943
+ type OptionKeyword = 'default' | 'auto' | 'full' | 'equal' | 'small' | 'medium' | 'large' | HeightOptionKeyword | ShapeOptionKeyword;
936
944
  type PaddingOptions = 'small' | 'medium' | 'large' | 'custom';
945
+ type ShapeOptions = 'square' | 'vertical' | 'horizontal' | 'custom' | 'original';
946
+ type ShapeConfig = Partial<Record<ShapeOptions, string>>;
937
947
  type PaddingConfig = Partial<Record<PaddingOptions, {
938
948
  vertical: string;
939
949
  horizontal: string;
@@ -942,6 +952,8 @@ type SettingConfig = {
942
952
  sizeConfig?: Partial<Record<'small' | 'medium' | 'large', string>>;
943
953
  displayOptions?: OptionKeyword[];
944
954
  paddingConfig?: PaddingConfig;
955
+ shapeConfig?: ShapeConfig;
956
+ shapeTitleConfig?: ShapeConfig;
945
957
  name?: string;
946
958
  units?: string[];
947
959
  };
@@ -963,9 +975,10 @@ type DropdownInput<T> = SharedControlType<T> & {
963
975
  type: 'dropdown:input' | 'accordion:dropdown:input';
964
976
  hideUnit?: boolean;
965
977
  inputType?: 'text' | 'number';
978
+ units?: string[];
966
979
  displayOptions?: {
967
980
  label: string;
968
- value: string;
981
+ value?: string;
969
982
  reversed?: boolean;
970
983
  showValue?: boolean;
971
984
  }[];
@@ -985,7 +998,18 @@ type AliPickSectionControlType<T> = SharedControlType<T> & {
985
998
  pickSectionLabel?: string;
986
999
  };
987
1000
 
988
- type ControlProp<T> = AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | ProductListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting$1<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T>;
1001
+ type ParallaxScrollingType<T> = SharedControlType<T> & {
1002
+ type: 'parallax-scrolling';
1003
+ };
1004
+
1005
+ type ControlProp<T> = AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | LayoutBannerControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | ProductListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting$1<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T>;
1006
+ type ControlTriggerAction = {
1007
+ controlId: string;
1008
+ newValue?: any;
1009
+ controlType: string;
1010
+ groupType: string;
1011
+ valueIfNull?: any;
1012
+ };
989
1013
  type Setting<P extends BaseProps> = {
990
1014
  id: 'setting';
991
1015
  note?: string;
@@ -1083,6 +1107,16 @@ type ControlUI = {
1083
1107
  hideOnPages?: PageType[];
1084
1108
  };
1085
1109
  isMoreSetting?: boolean;
1110
+ controlChangeTrigger?: {
1111
+ settings?: {
1112
+ source: string[];
1113
+ condition: string;
1114
+ action: ControlTriggerAction;
1115
+ }[];
1116
+ options?: {
1117
+ noRecordHistory?: boolean;
1118
+ };
1119
+ };
1086
1120
  };
1087
1121
  type PageType = 'ARTICLE' | 'BLOG' | 'COLLECTION' | 'GP_ARTICLE' | 'GP_BLOG' | 'GP_COLLECTION' | 'GP_INDEX' | 'GP_PRODUCT' | 'GP_STATIC' | 'PRODUCT' | 'STATIC' | 'THEME_SECTION';
1088
1122
  type ComponentPreset = {
@@ -9607,7 +9641,7 @@ declare const getGlobalSizeGap: (globalSize?: ObjectDevices<SizeSettingGlobal>)
9607
9641
  declare const makeStyleWithDefault: <T extends ShortHandProperty, K>(name: T, value?: Partial<Record<NameDevices$1, K>> | undefined, defaultVal?: Partial<Record<NameDevices$1, K>> | undefined) => Record<ResponsiveKey<T>, K>;
9608
9642
  declare const getWidthHeightGlobalSize: (type: 'width' | 'height', globalSize?: ObjectDevices<SizeSettingGlobal>) => Partial<Record<NameDevices$1, string | number>>;
9609
9643
  declare const getHeightByShapeGlobalSize: (shapeByLayout?: ObjectDevices<SizeSettingGlobal>) => Partial<Record<NameDevices$1, string>>;
9610
- declare const getWidthByShapeGlobalSize: (shapeByLayout?: ObjectDevices<SizeSettingGlobal>) => Partial<Record<NameDevices$1, string>>;
9644
+ declare const getWidthByShapeGlobalSize: (shapeByLayout?: ObjectDevices<SizeSettingGlobal>, defaultAuto?: boolean) => Partial<Record<NameDevices$1, string>>;
9611
9645
  declare const getAspectRatioGlobalSize: (shape?: ObjectDevices<SizeSettingGlobal>) => ObjectDevices<string>;
9612
9646
  declare const getPaddingGlobalSize: (globalSize?: ObjectDevices<SizeSettingGlobal>) => React.CSSProperties;
9613
9647
 
@@ -9622,11 +9656,13 @@ declare const composeShadowCss: ({ hasBoxShadow, boxShadowValue, important, }: {
9622
9656
  important?: boolean | undefined;
9623
9657
  }) => string | undefined;
9624
9658
 
9659
+ type Devices = 'desktop' | 'tablet' | 'mobile';
9625
9660
  type Options = {
9626
9661
  liquid?: boolean;
9627
9662
  ignoreBgAttachment?: boolean;
9628
9663
  };
9629
9664
  declare const getStyleBackgroundByDevice: (background?: ObjectDevices<Background>, options?: Options) => {};
9665
+ declare const getBgImageByDevice: (background: ObjectDevices<Background>, device: Devices, options?: Options) => string | undefined;
9630
9666
  declare const composeBackgroundCss: (backgroundColor?: ColorValueType) => string;
9631
9667
  declare const makeFixedBgAttachment: (background?: ObjectDevices<Background>) => {
9632
9668
  wrapper: {
@@ -9929,4 +9965,4 @@ type PublishedThemePageSelectFragment = Pick<PublishedThemePage, 'id' | 'name' |
9929
9965
 
9930
9966
  declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
9931
9967
 
9932
- export { AddOn, AddonProvider, AddonProviderProps, AliReviewsWidgetType, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, BoldSubscriptionsWidgetType, Border, BorderStyle, BuilderComponentProvider, BuilderComponentProviderProps, BuilderEntity, BuilderEntityNested, BuilderPreviewProvider, BuilderPreviewProviderProps, BuilderProvider, BuilderProviderProps, BuilderState, Builtin, CartLineProvider, CartLineProviderProps, CollectionDetailFilterDocument, CollectionDetailFilterQueryResponse, CollectionDetailFilterQueryVariables, CollectionDocument, CollectionProvider, CollectionProviderProps, CollectionQueryResponse, CollectionQueryVariables, CollectionSelectFragment, CollectionsDocument, CollectionsQueryResponse, CollectionsQueryVariables, ColorKey, ColorType$1 as ColorType, ColorValueType, Component, ComponentPreset, ComponentSetting, ContainerProp, ControlProp, ControlUI, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, DynamicCollection, DynamicProduct, ExtractState, FeraReviewsV3WidgetType, FeraReviewsWidgetType, FetchCollectionArgs, FetchFunc, FetchProductParams, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, GrowaveWidgetType, HSLAColorType, HSLColorType, HexColorType, ImageShape$1 as ImageShape, InitComponentType, InstantJudgeMeReviewsWidgetType, InstantKlaviyoWidgetType, InstantLooxReviewsWidgetType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LaiProductReviewsAdvancedWidgetType, LaiProductReviewsWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices$1 as NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OmnisendWidgetType, OpinewDesignWidgetType, OpinewWidgetType, OptionNormalStyle, OptionSpecialStyle, PageContext, PageProvider, PageProviderProps, PageType, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PickyStoryWidgetType, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductReviewsWidgetType, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, Ratio$1 as Ratio, RenderMemo as Render, RenderChildren, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveKey, ResponsiveStateProp, RivyoWidgetType, RoundedSize, RyviuWidgetType, SectionData, SectionEntity, SectionProvider, SectionProviderProps, ShadowProps, ShadowStyle, ShadowStyleApplied, ShadowType, ShopProvider, ShopProviderProps, shop as ShopType, SizeProps, SizeSetting, SizeSettingGlobal, SizeType, SpacingType, StampedWidgetType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TransformProp, TrustooWidgetType, TypographyProps, TypographySetting, TypographySettingV2, TypographyType, TypographyV2Attrs, TypographyV2Props, UltimateSalesBoostWidgetType, VariantSelectFragment, VitalsWidgetType, WiserWidgetType, WrapRenderChildren, YotpoReviewsWidgetType, baseAssetURL, calculateFirstProduct, checkAvailableVariantInStock, cls, composeAdvanceStyle, composeBackgroundCss, composeBorderCss, composeCornerCss, composeGridLayout, composeMemo, composePositionLineHeight, composePostionIconList, composeRadius, composeRadiusResponsive, composeShadowCss, composeSize, composeSizeCss, composeSpacing, composeTextColorCss, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, convertOldLayout, dataStringify, fetchMedias, fetchVariants, filterToolbarPreview, flattenConnection, fpixel, genSizeClass, genTypoClass, genVariable, generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey, getAspectRatioGlobalSize, getBorderStyle, getCollection, getCornerCSSFromGlobal, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, globalEvent, gridToArrayRegex, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn, isBrowser, isColor, isColumnDirectionExist, isDefined, isEmptyChildren, isLocalEnv, isSafari, loadScript, makeAspectRatio, makeFixedBgAttachment, makeGlobalSize, makeGlobalSizeWidthResponsive, makeHeight, makeLineClamp, makeStyle, makeStyleKey, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeStyleWithDefault, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, parseValueWithUnit, prefetchQueries, props, removeNullUndefined, splitStyle, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCheckAvailableVariantInStock, useCheckoutUrl, useCollection, useCollectionQuery, useCollectionStore, useCollectionsQuery, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useInitialSwatchesOptions, useIsSampleProduct, useIsStorefrontProduct, useIsSyncProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, useMoneyFormat, usePageStore, usePageType, usePluginEnable, usePrevious, useProduct, useProductList, useProductListProducts, useProductListSettings, useProductListStore, useProductListStyles, useProductProperties, useProductQuery, useProductStore, useProductsQuery, useQuantity, useRemoveCartItem, useSection, useSectionStore, useSelectedOption, useShopStore, useStoreFront, useSuspenseFetch, useSwatches, useSwatchesOptions, useUniqProductID, useUpdateCartItem, useVariant, useVariantOutStock, useVariants, validateEmail };
9968
+ export { AddOn, AddonProvider, AddonProviderProps, AliReviewsWidgetType, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, BoldSubscriptionsWidgetType, Border, BorderStyle, BuilderComponentProvider, BuilderComponentProviderProps, BuilderEntity, BuilderEntityNested, BuilderPreviewProvider, BuilderPreviewProviderProps, BuilderProvider, BuilderProviderProps, BuilderState, Builtin, CartLineProvider, CartLineProviderProps, CollectionDetailFilterDocument, CollectionDetailFilterQueryResponse, CollectionDetailFilterQueryVariables, CollectionDocument, CollectionProvider, CollectionProviderProps, CollectionQueryResponse, CollectionQueryVariables, CollectionSelectFragment, CollectionsDocument, CollectionsQueryResponse, CollectionsQueryVariables, ColorKey, ColorType$1 as ColorType, ColorValueType, Component, ComponentPreset, ComponentSetting, ContainerProp, ControlProp, ControlTriggerAction, ControlUI, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, DynamicCollection, DynamicProduct, ExtractState, FeraReviewsV3WidgetType, FeraReviewsWidgetType, FetchCollectionArgs, FetchFunc, FetchProductParams, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, GrowaveWidgetType, HSLAColorType, HSLColorType, HexColorType, ImageShape$1 as ImageShape, InitComponentType, InstantJudgeMeReviewsWidgetType, InstantKlaviyoWidgetType, InstantLooxReviewsWidgetType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LaiProductReviewsAdvancedWidgetType, LaiProductReviewsWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices$1 as NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OmnisendWidgetType, OpinewDesignWidgetType, OpinewWidgetType, OptionNormalStyle, OptionSpecialStyle, Options, PageContext, PageProvider, PageProviderProps, PageType, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PickyStoryWidgetType, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductReviewsWidgetType, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, Ratio$1 as Ratio, RenderMemo as Render, RenderChildren, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveKey, ResponsiveStateProp, RivyoWidgetType, RoundedSize, RyviuWidgetType, SectionData, SectionEntity, SectionProvider, SectionProviderProps, ShadowProps, ShadowStyle, ShadowStyleApplied, ShadowType, ShopProvider, ShopProviderProps, shop as ShopType, SizeProps, SizeSetting, SizeSettingGlobal, SizeType, SpacingType, StampedWidgetType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TransformProp, TrustooWidgetType, TypographyProps, TypographySetting, TypographySettingV2, TypographyType, TypographyV2Attrs, TypographyV2Props, UltimateSalesBoostWidgetType, VariantSelectFragment, VitalsWidgetType, WiserWidgetType, WrapRenderChildren, YotpoReviewsWidgetType, baseAssetURL, calculateFirstProduct, checkAvailableVariantInStock, cls, composeAdvanceStyle, composeBackgroundCss, composeBorderCss, composeCornerCss, composeGridLayout, composeMemo, composePositionLineHeight, composePostionIconList, composeRadius, composeRadiusResponsive, composeShadowCss, composeSize, composeSizeCss, composeSpacing, composeTextColorCss, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, convertOldLayout, dataStringify, fetchMedias, fetchVariants, filterToolbarPreview, flattenConnection, fpixel, genSizeClass, genTypoClass, genVariable, generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey, getAspectRatioGlobalSize, getBgImageByDevice, getBorderStyle, getCollection, getCornerCSSFromGlobal, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, globalEvent, gridToArrayRegex, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn, isBrowser, isColor, isColumnDirectionExist, isDefined, isEmptyChildren, isLocalEnv, isSafari, loadScript, makeAspectRatio, makeFixedBgAttachment, makeGlobalSize, makeGlobalSizeWidthResponsive, makeHeight, makeLineClamp, makeStyle, makeStyleKey, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeStyleWithDefault, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, parseValueWithUnit, prefetchQueries, props, removeNullUndefined, splitStyle, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCheckAvailableVariantInStock, useCheckoutUrl, useCollection, useCollectionQuery, useCollectionStore, useCollectionsQuery, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useInitialSwatchesOptions, useIsSampleProduct, useIsStorefrontProduct, useIsSyncProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, useMoneyFormat, usePageStore, usePageType, usePluginEnable, usePrevious, useProduct, useProductList, useProductListProducts, useProductListSettings, useProductListStore, useProductListStyles, useProductProperties, useProductQuery, useProductStore, useProductsQuery, useQuantity, useRemoveCartItem, useSection, useSectionStore, useSelectedOption, useShopStore, useStoreFront, useSuspenseFetch, useSwatches, useSwatchesOptions, useUniqProductID, useUpdateCartItem, useVariant, useVariantOutStock, useVariants, validateEmail };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/core",
3
- "version": "1.28.1",
3
+ "version": "1.28.7",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@gem-sdk/adapter-shopify": "1.25.0",
28
- "@gem-sdk/styles": "1.27.14"
28
+ "@gem-sdk/styles": "1.28.2"
29
29
  },
30
30
  "dependencies": {
31
31
  "react-error-boundary": "4.0.10",