@gem-sdk/core 1.23.0-moon.75 → 1.23.0-staging.100
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.
- package/dist/cjs/components/ComponentToolbarPreview.js +12 -1
- package/dist/cjs/components/ComponentWrapperPreview.js +11 -2
- package/dist/cjs/components/Render.liquid.js +5 -1
- package/dist/cjs/components/constant.js +5 -0
- package/dist/cjs/helpers/icon-list.js +61 -0
- package/dist/cjs/helpers/make-style.js +1 -1
- package/dist/cjs/helpers/size.js +16 -5
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/web-components/src/helpers/styles/constant.js +9 -0
- package/dist/esm/components/ComponentToolbarPreview.js +12 -1
- package/dist/esm/components/ComponentWrapperPreview.js +12 -3
- package/dist/esm/components/Render.liquid.js +5 -1
- package/dist/esm/components/constant.js +5 -1
- package/dist/esm/helpers/icon-list.js +58 -0
- package/dist/esm/helpers/make-style.js +1 -1
- package/dist/esm/helpers/size.js +16 -6
- package/dist/esm/index.js +2 -1
- package/dist/esm/web-components/src/helpers/styles/constant.js +7 -0
- package/dist/types/index.d.ts +95 -32
- package/package.json +3 -3
|
@@ -160,6 +160,17 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
160
160
|
window.dispatchEvent(event);
|
|
161
161
|
return false;
|
|
162
162
|
};
|
|
163
|
+
const toolbarName = ()=>{
|
|
164
|
+
const tag = props.tag;
|
|
165
|
+
if (tag === 'IconListV2') {
|
|
166
|
+
return 'Item list';
|
|
167
|
+
}
|
|
168
|
+
if (tag === 'IconList') {
|
|
169
|
+
return 'Advanced list';
|
|
170
|
+
}
|
|
171
|
+
const name = props.customLabel || props.label;
|
|
172
|
+
return name;
|
|
173
|
+
};
|
|
163
174
|
const onZoomOut = (e)=>{
|
|
164
175
|
e.preventDefault();
|
|
165
176
|
e.stopPropagation();
|
|
@@ -252,7 +263,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
252
263
|
children: isThemeSection ? props.name : `Section ${getIndexSection() + 1}${getSectionNumber() >= SECTION_LIMIT - 5 ? `/${SECTION_LIMIT}` : ''}`
|
|
253
264
|
}) : /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
254
265
|
"data-toolbar-name": true,
|
|
255
|
-
children:
|
|
266
|
+
children: toolbarName()
|
|
256
267
|
}),
|
|
257
268
|
props.tag !== 'Section' && parents.length > 0 && /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
258
269
|
"data-toolbar-icon-parent": true,
|
|
@@ -106,11 +106,20 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
106
106
|
advanced: advanced
|
|
107
107
|
}),
|
|
108
108
|
/*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
109
|
-
style: style
|
|
109
|
+
style: !constant.excludeApplyStyle.includes(props.tag) ? style : {
|
|
110
|
+
'--mb': style?.['--mb'],
|
|
111
|
+
'--mb-tablet': style?.['--mb-tablet'],
|
|
112
|
+
'--mb-mobile': style?.['--mb-mobile']
|
|
113
|
+
},
|
|
110
114
|
className: `${props.uid} ${props.advanced?.cssClass ? props.advanced?.cssClass : ''}`,
|
|
111
115
|
...builderAttrs,
|
|
112
116
|
children: [
|
|
113
|
-
children,
|
|
117
|
+
!constant.excludeApplyStyle.includes(props.tag) && children,
|
|
118
|
+
/*#__PURE__*/ react.isValidElement(children) && constant.excludeApplyStyle.includes(props.tag) && /*#__PURE__*/ jsxRuntime.jsx(children.type, {
|
|
119
|
+
...children.props,
|
|
120
|
+
style,
|
|
121
|
+
advanced
|
|
122
|
+
}),
|
|
114
123
|
/*#__PURE__*/ jsxRuntime.jsx(ComponentToolbarPreview.ComponentToolbarPreview, {
|
|
115
124
|
...props
|
|
116
125
|
})
|
|
@@ -24,6 +24,9 @@ const componentTexts = [
|
|
|
24
24
|
'Text',
|
|
25
25
|
'Heading'
|
|
26
26
|
];
|
|
27
|
+
const componentIconList = [
|
|
28
|
+
'IconListV2'
|
|
29
|
+
];
|
|
27
30
|
const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageContext, ...passProps })=>{
|
|
28
31
|
const item = builder[uid];
|
|
29
32
|
const Component = components[item?.tag];
|
|
@@ -104,7 +107,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
104
107
|
});
|
|
105
108
|
});
|
|
106
109
|
} else {
|
|
107
|
-
liquid = render.template`<div style="${style}" class="${item.uid} ${!item?.childrens?.length && item.tag === 'IconListItemHoz' ? 'hidden' : ''}">
|
|
110
|
+
liquid = render.template`<div style="${!componentIconList.includes(item.tag) ? style : ''}" class="${item.uid} ${!item?.childrens?.length && item.tag === 'IconListItemHoz' ? 'hidden' : ''}">
|
|
108
111
|
${render.RenderIf(item?.childrens?.length, ()=>{
|
|
109
112
|
return Component({
|
|
110
113
|
builderProps: {
|
|
@@ -153,6 +156,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
153
156
|
},
|
|
154
157
|
pageContext,
|
|
155
158
|
isText: componentTexts.includes(item.tag) ? true : null,
|
|
159
|
+
style: componentIconList.includes(item.tag) ? style : null,
|
|
156
160
|
...passProps
|
|
157
161
|
});
|
|
158
162
|
})}
|
|
@@ -44,6 +44,11 @@ const customRenderChildren = [
|
|
|
44
44
|
'IconList',
|
|
45
45
|
'Tabs'
|
|
46
46
|
];
|
|
47
|
+
const excludeApplyStyle = [
|
|
48
|
+
'IconListV2',
|
|
49
|
+
'Accordion'
|
|
50
|
+
];
|
|
47
51
|
|
|
48
52
|
exports.customRenderChildren = customRenderChildren;
|
|
49
53
|
exports.disableWrap = disableWrap;
|
|
54
|
+
exports.excludeApplyStyle = excludeApplyStyle;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var constant = require('../web-components/src/helpers/styles/constant.js');
|
|
4
|
+
|
|
5
|
+
const TEXT_TOTAL_SPACING = 3; //Padding 2, margin 1
|
|
6
|
+
const composePostionIconList = (lineHeight, position, iconWidth)=>{
|
|
7
|
+
const compose = {};
|
|
8
|
+
composePositionLineHeight({
|
|
9
|
+
compose,
|
|
10
|
+
lineHeight,
|
|
11
|
+
device: 'desktop',
|
|
12
|
+
position,
|
|
13
|
+
iconWidth
|
|
14
|
+
});
|
|
15
|
+
composePositionLineHeight({
|
|
16
|
+
compose,
|
|
17
|
+
lineHeight,
|
|
18
|
+
device: 'tablet',
|
|
19
|
+
position,
|
|
20
|
+
iconWidth
|
|
21
|
+
});
|
|
22
|
+
composePositionLineHeight({
|
|
23
|
+
compose,
|
|
24
|
+
lineHeight,
|
|
25
|
+
device: 'mobile',
|
|
26
|
+
position,
|
|
27
|
+
iconWidth
|
|
28
|
+
});
|
|
29
|
+
return compose;
|
|
30
|
+
};
|
|
31
|
+
const composePositionLineHeight = ({ compose, lineHeight, device, position, iconWidth })=>{
|
|
32
|
+
const positionDevice = position?.[device];
|
|
33
|
+
const iconWidthDevice = iconWidth?.[device];
|
|
34
|
+
if (positionDevice) {
|
|
35
|
+
const suffix = constant.devicesMapping[device] ?? '';
|
|
36
|
+
if (positionDevice === 'center') {
|
|
37
|
+
compose.wrapper = {
|
|
38
|
+
...compose.wrapper,
|
|
39
|
+
[`--ai${suffix}`]: 'center'
|
|
40
|
+
};
|
|
41
|
+
compose.content = {
|
|
42
|
+
...compose.content,
|
|
43
|
+
[`--pos${suffix}`]: 'static'
|
|
44
|
+
};
|
|
45
|
+
} else if (iconWidthDevice) {
|
|
46
|
+
const computedTop = parseFloat(lineHeight.replaceAll(/[a-zA-Z]/g, '')) / 2 + TEXT_TOTAL_SPACING - iconWidthDevice / 2;
|
|
47
|
+
compose.wrapper = {
|
|
48
|
+
...compose.wrapper,
|
|
49
|
+
[`--ai${suffix}`]: 'flex-start'
|
|
50
|
+
};
|
|
51
|
+
compose.content = {
|
|
52
|
+
...compose.content,
|
|
53
|
+
[`--top${suffix}`]: `${Math.max(0, Math.ceil(computedTop))}px`,
|
|
54
|
+
[`--pos${suffix}`]: 'relative'
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
exports.composePositionLineHeight = composePositionLineHeight;
|
|
61
|
+
exports.composePostionIconList = composePostionIconList;
|
|
@@ -59,7 +59,7 @@ const makeStyleResponsive = (name, value)=>{
|
|
|
59
59
|
};
|
|
60
60
|
const makeWidth = (widthValue, fullWidthValue)=>{
|
|
61
61
|
const getVal = (deviceValue, widthValue, fullWidthValue)=>{
|
|
62
|
-
const widthVal = widthValue
|
|
62
|
+
const widthVal = getResonsiveValue.getResponsiveValueByScreen(widthValue, deviceValue);
|
|
63
63
|
const fullWidthVal = fullWidthValue?.[deviceValue] === undefined ? fullWidthValue?.['desktop'] : fullWidthValue?.[deviceValue];
|
|
64
64
|
if (fullWidthVal) {
|
|
65
65
|
return '100%';
|
package/dist/cjs/helpers/size.js
CHANGED
|
@@ -39,7 +39,15 @@ const makeGlobalSize = (globalSize)=>{
|
|
|
39
39
|
mobile: '--g-ct-w'
|
|
40
40
|
}),
|
|
41
41
|
height: makeStyle.makeStyleResponsive('h', getWidthHeightGlobalSize('height', globalSize)),
|
|
42
|
-
padding: getPaddingGlobalSize(globalSize)
|
|
42
|
+
padding: getPaddingGlobalSize(globalSize),
|
|
43
|
+
gap: getGlobalSizeGap(globalSize)
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const getGlobalSizeGap = (globalSize)=>{
|
|
47
|
+
return {
|
|
48
|
+
'--gg': globalSize?.desktop?.gap,
|
|
49
|
+
'--gg-tablet': globalSize?.tablet?.gap,
|
|
50
|
+
'--gg-mobile': globalSize?.mobile?.gap
|
|
43
51
|
};
|
|
44
52
|
};
|
|
45
53
|
const makeStyleWithDefault = (name, value, defaultVal)=>{
|
|
@@ -93,10 +101,12 @@ const getWidthByShapeGlobalSize = (shapeByLayout)=>{
|
|
|
93
101
|
DEVICES.forEach((device)=>{
|
|
94
102
|
const shapeByDevice = getResonsiveValue.getResponsiveValueByScreen(shapeByLayout, device);
|
|
95
103
|
const width = shapeByDevice?.width;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
104
|
+
if (width) {
|
|
105
|
+
result = {
|
|
106
|
+
...result,
|
|
107
|
+
[device]: width
|
|
108
|
+
};
|
|
109
|
+
}
|
|
100
110
|
});
|
|
101
111
|
return result;
|
|
102
112
|
};
|
|
@@ -164,6 +174,7 @@ exports.composeSize = composeSize;
|
|
|
164
174
|
exports.composeSizeCss = composeSizeCss;
|
|
165
175
|
exports.genSizeClass = genSizeClass;
|
|
166
176
|
exports.getAspectRatioGlobalSize = getAspectRatioGlobalSize;
|
|
177
|
+
exports.getGlobalSizeGap = getGlobalSizeGap;
|
|
167
178
|
exports.getHeightByShapeGlobalSize = getHeightByShapeGlobalSize;
|
|
168
179
|
exports.getPaddingGlobalSize = getPaddingGlobalSize;
|
|
169
180
|
exports.getWidthByShapeGlobalSize = getWidthByShapeGlobalSize;
|
package/dist/cjs/index.js
CHANGED
|
@@ -57,6 +57,7 @@ var shadow = require('./helpers/shadow.js');
|
|
|
57
57
|
var background = require('./helpers/background.js');
|
|
58
58
|
var query = require('./helpers/query.js');
|
|
59
59
|
var composeAdvanceStyle = require('./helpers/compose-advance-style.js');
|
|
60
|
+
var iconList = require('./helpers/icon-list.js');
|
|
60
61
|
var useAddToCart = require('./hooks/cart/use-add-to-cart.js');
|
|
61
62
|
var useCartData = require('./hooks/cart/use-cart-data.js');
|
|
62
63
|
var useCartDiscountCodesUpdate = require('./hooks/cart/use-cart-discount-codes-update.js');
|
|
@@ -222,6 +223,7 @@ exports.composeSize = size.composeSize;
|
|
|
222
223
|
exports.composeSizeCss = size.composeSizeCss;
|
|
223
224
|
exports.genSizeClass = size.genSizeClass;
|
|
224
225
|
exports.getAspectRatioGlobalSize = size.getAspectRatioGlobalSize;
|
|
226
|
+
exports.getGlobalSizeGap = size.getGlobalSizeGap;
|
|
225
227
|
exports.getHeightByShapeGlobalSize = size.getHeightByShapeGlobalSize;
|
|
226
228
|
exports.getPaddingGlobalSize = size.getPaddingGlobalSize;
|
|
227
229
|
exports.getWidthByShapeGlobalSize = size.getWidthByShapeGlobalSize;
|
|
@@ -240,6 +242,8 @@ exports.generateProductQueryKey = query.generateProductQueryKey;
|
|
|
240
242
|
exports.generateProductsQueryKey = query.generateProductsQueryKey;
|
|
241
243
|
exports.composeAdvanceStyle = composeAdvanceStyle.composeAdvanceStyle;
|
|
242
244
|
exports.splitStyle = composeAdvanceStyle.splitStyle;
|
|
245
|
+
exports.composePositionLineHeight = iconList.composePositionLineHeight;
|
|
246
|
+
exports.composePostionIconList = iconList.composePostionIconList;
|
|
243
247
|
exports.useAddToCart = useAddToCart.useAddToCart;
|
|
244
248
|
exports.useCartData = useCartData.useCartData;
|
|
245
249
|
exports.useCartDiscountCodesUpdate = useCartDiscountCodesUpdate.useCartDiscountCodesUpdate;
|
|
@@ -158,6 +158,17 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
158
158
|
window.dispatchEvent(event);
|
|
159
159
|
return false;
|
|
160
160
|
};
|
|
161
|
+
const toolbarName = ()=>{
|
|
162
|
+
const tag = props.tag;
|
|
163
|
+
if (tag === 'IconListV2') {
|
|
164
|
+
return 'Item list';
|
|
165
|
+
}
|
|
166
|
+
if (tag === 'IconList') {
|
|
167
|
+
return 'Advanced list';
|
|
168
|
+
}
|
|
169
|
+
const name = props.customLabel || props.label;
|
|
170
|
+
return name;
|
|
171
|
+
};
|
|
161
172
|
const onZoomOut = (e)=>{
|
|
162
173
|
e.preventDefault();
|
|
163
174
|
e.stopPropagation();
|
|
@@ -250,7 +261,7 @@ const ComponentToolbarPreview = ({ ...props })=>{
|
|
|
250
261
|
children: isThemeSection ? props.name : `Section ${getIndexSection() + 1}${getSectionNumber() >= SECTION_LIMIT - 5 ? `/${SECTION_LIMIT}` : ''}`
|
|
251
262
|
}) : /*#__PURE__*/ jsx("div", {
|
|
252
263
|
"data-toolbar-name": true,
|
|
253
|
-
children:
|
|
264
|
+
children: toolbarName()
|
|
254
265
|
}),
|
|
255
266
|
props.tag !== 'Section' && parents.length > 0 && /*#__PURE__*/ jsx("div", {
|
|
256
267
|
"data-toolbar-icon-parent": true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useEffect, isValidElement } from 'react';
|
|
3
3
|
import { composeAdvanceStyle } from '../helpers/compose-advance-style.js';
|
|
4
|
-
import { disableWrap } from './constant.js';
|
|
4
|
+
import { disableWrap, excludeApplyStyle } from './constant.js';
|
|
5
5
|
import RenderCustomCode from './RenderCustomCode.js';
|
|
6
6
|
import { ComponentToolbarPreview } from './ComponentToolbarPreview.js';
|
|
7
7
|
|
|
@@ -102,11 +102,20 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
102
102
|
advanced: advanced
|
|
103
103
|
}),
|
|
104
104
|
/*#__PURE__*/ jsxs("div", {
|
|
105
|
-
style: style
|
|
105
|
+
style: !excludeApplyStyle.includes(props.tag) ? style : {
|
|
106
|
+
'--mb': style?.['--mb'],
|
|
107
|
+
'--mb-tablet': style?.['--mb-tablet'],
|
|
108
|
+
'--mb-mobile': style?.['--mb-mobile']
|
|
109
|
+
},
|
|
106
110
|
className: `${props.uid} ${props.advanced?.cssClass ? props.advanced?.cssClass : ''}`,
|
|
107
111
|
...builderAttrs,
|
|
108
112
|
children: [
|
|
109
|
-
children,
|
|
113
|
+
!excludeApplyStyle.includes(props.tag) && children,
|
|
114
|
+
/*#__PURE__*/ isValidElement(children) && excludeApplyStyle.includes(props.tag) && /*#__PURE__*/ jsx(children.type, {
|
|
115
|
+
...children.props,
|
|
116
|
+
style,
|
|
117
|
+
advanced
|
|
118
|
+
}),
|
|
110
119
|
/*#__PURE__*/ jsx(ComponentToolbarPreview, {
|
|
111
120
|
...props
|
|
112
121
|
})
|
|
@@ -20,6 +20,9 @@ const componentTexts = [
|
|
|
20
20
|
'Text',
|
|
21
21
|
'Heading'
|
|
22
22
|
];
|
|
23
|
+
const componentIconList = [
|
|
24
|
+
'IconListV2'
|
|
25
|
+
];
|
|
23
26
|
const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageContext, ...passProps })=>{
|
|
24
27
|
const item = builder[uid];
|
|
25
28
|
const Component = components[item?.tag];
|
|
@@ -100,7 +103,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
100
103
|
});
|
|
101
104
|
});
|
|
102
105
|
} else {
|
|
103
|
-
liquid = template`<div style="${style}" class="${item.uid} ${!item?.childrens?.length && item.tag === 'IconListItemHoz' ? 'hidden' : ''}">
|
|
106
|
+
liquid = template`<div style="${!componentIconList.includes(item.tag) ? style : ''}" class="${item.uid} ${!item?.childrens?.length && item.tag === 'IconListItemHoz' ? 'hidden' : ''}">
|
|
104
107
|
${RenderIf(item?.childrens?.length, ()=>{
|
|
105
108
|
return Component({
|
|
106
109
|
builderProps: {
|
|
@@ -149,6 +152,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
149
152
|
},
|
|
150
153
|
pageContext,
|
|
151
154
|
isText: componentTexts.includes(item.tag) ? true : null,
|
|
155
|
+
style: componentIconList.includes(item.tag) ? style : null,
|
|
152
156
|
...passProps
|
|
153
157
|
});
|
|
154
158
|
})}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { devicesMapping } from '../web-components/src/helpers/styles/constant.js';
|
|
2
|
+
|
|
3
|
+
const TEXT_TOTAL_SPACING = 3; //Padding 2, margin 1
|
|
4
|
+
const composePostionIconList = (lineHeight, position, iconWidth)=>{
|
|
5
|
+
const compose = {};
|
|
6
|
+
composePositionLineHeight({
|
|
7
|
+
compose,
|
|
8
|
+
lineHeight,
|
|
9
|
+
device: 'desktop',
|
|
10
|
+
position,
|
|
11
|
+
iconWidth
|
|
12
|
+
});
|
|
13
|
+
composePositionLineHeight({
|
|
14
|
+
compose,
|
|
15
|
+
lineHeight,
|
|
16
|
+
device: 'tablet',
|
|
17
|
+
position,
|
|
18
|
+
iconWidth
|
|
19
|
+
});
|
|
20
|
+
composePositionLineHeight({
|
|
21
|
+
compose,
|
|
22
|
+
lineHeight,
|
|
23
|
+
device: 'mobile',
|
|
24
|
+
position,
|
|
25
|
+
iconWidth
|
|
26
|
+
});
|
|
27
|
+
return compose;
|
|
28
|
+
};
|
|
29
|
+
const composePositionLineHeight = ({ compose, lineHeight, device, position, iconWidth })=>{
|
|
30
|
+
const positionDevice = position?.[device];
|
|
31
|
+
const iconWidthDevice = iconWidth?.[device];
|
|
32
|
+
if (positionDevice) {
|
|
33
|
+
const suffix = devicesMapping[device] ?? '';
|
|
34
|
+
if (positionDevice === 'center') {
|
|
35
|
+
compose.wrapper = {
|
|
36
|
+
...compose.wrapper,
|
|
37
|
+
[`--ai${suffix}`]: 'center'
|
|
38
|
+
};
|
|
39
|
+
compose.content = {
|
|
40
|
+
...compose.content,
|
|
41
|
+
[`--pos${suffix}`]: 'static'
|
|
42
|
+
};
|
|
43
|
+
} else if (iconWidthDevice) {
|
|
44
|
+
const computedTop = parseFloat(lineHeight.replaceAll(/[a-zA-Z]/g, '')) / 2 + TEXT_TOTAL_SPACING - iconWidthDevice / 2;
|
|
45
|
+
compose.wrapper = {
|
|
46
|
+
...compose.wrapper,
|
|
47
|
+
[`--ai${suffix}`]: 'flex-start'
|
|
48
|
+
};
|
|
49
|
+
compose.content = {
|
|
50
|
+
...compose.content,
|
|
51
|
+
[`--top${suffix}`]: `${Math.max(0, Math.ceil(computedTop))}px`,
|
|
52
|
+
[`--pos${suffix}`]: 'relative'
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export { composePositionLineHeight, composePostionIconList };
|
|
@@ -57,7 +57,7 @@ const makeStyleResponsive = (name, value)=>{
|
|
|
57
57
|
};
|
|
58
58
|
const makeWidth = (widthValue, fullWidthValue)=>{
|
|
59
59
|
const getVal = (deviceValue, widthValue, fullWidthValue)=>{
|
|
60
|
-
const widthVal = widthValue
|
|
60
|
+
const widthVal = getResponsiveValueByScreen(widthValue, deviceValue);
|
|
61
61
|
const fullWidthVal = fullWidthValue?.[deviceValue] === undefined ? fullWidthValue?.['desktop'] : fullWidthValue?.[deviceValue];
|
|
62
62
|
if (fullWidthVal) {
|
|
63
63
|
return '100%';
|
package/dist/esm/helpers/size.js
CHANGED
|
@@ -37,7 +37,15 @@ const makeGlobalSize = (globalSize)=>{
|
|
|
37
37
|
mobile: '--g-ct-w'
|
|
38
38
|
}),
|
|
39
39
|
height: makeStyleResponsive('h', getWidthHeightGlobalSize('height', globalSize)),
|
|
40
|
-
padding: getPaddingGlobalSize(globalSize)
|
|
40
|
+
padding: getPaddingGlobalSize(globalSize),
|
|
41
|
+
gap: getGlobalSizeGap(globalSize)
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
const getGlobalSizeGap = (globalSize)=>{
|
|
45
|
+
return {
|
|
46
|
+
'--gg': globalSize?.desktop?.gap,
|
|
47
|
+
'--gg-tablet': globalSize?.tablet?.gap,
|
|
48
|
+
'--gg-mobile': globalSize?.mobile?.gap
|
|
41
49
|
};
|
|
42
50
|
};
|
|
43
51
|
const makeStyleWithDefault = (name, value, defaultVal)=>{
|
|
@@ -91,10 +99,12 @@ const getWidthByShapeGlobalSize = (shapeByLayout)=>{
|
|
|
91
99
|
DEVICES.forEach((device)=>{
|
|
92
100
|
const shapeByDevice = getResponsiveValueByScreen(shapeByLayout, device);
|
|
93
101
|
const width = shapeByDevice?.width;
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
if (width) {
|
|
103
|
+
result = {
|
|
104
|
+
...result,
|
|
105
|
+
[device]: width
|
|
106
|
+
};
|
|
107
|
+
}
|
|
98
108
|
});
|
|
99
109
|
return result;
|
|
100
110
|
};
|
|
@@ -158,4 +168,4 @@ const getPaddingGlobalSize = (globalSize)=>{
|
|
|
158
168
|
return Object.assign({}, getCustomPaddingSizeCSSByDevice(globalSize, 'desktop'), getCustomPaddingSizeCSSByDevice(globalSize, 'tablet'), getCustomPaddingSizeCSSByDevice(globalSize, 'mobile'));
|
|
159
169
|
};
|
|
160
170
|
|
|
161
|
-
export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getHeightByShapeGlobalSize, getPaddingGlobalSize, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeStyleWithDefault };
|
|
171
|
+
export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeStyleWithDefault };
|
package/dist/esm/index.js
CHANGED
|
@@ -53,11 +53,12 @@ import * as tiktokpixel from './helpers/tracking/tiktokpixel.js';
|
|
|
53
53
|
export { tiktokpixel };
|
|
54
54
|
export { RenderIf, composeMemo, dataStringify, props, styles, template } from './helpers/render.js';
|
|
55
55
|
export { baseAssetURL, isLocalEnv } from './helpers/convert.js';
|
|
56
|
-
export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getHeightByShapeGlobalSize, getPaddingGlobalSize, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeStyleWithDefault } from './helpers/size.js';
|
|
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
58
|
export { composeBackgroundCss, 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
|
+
export { composePositionLineHeight, composePostionIconList } from './helpers/icon-list.js';
|
|
61
62
|
export { useAddToCart } from './hooks/cart/use-add-to-cart.js';
|
|
62
63
|
export { useCartData } from './hooks/cart/use-cart-data.js';
|
|
63
64
|
export { useCartDiscountCodesUpdate } from './hooks/cart/use-cart-discount-codes-update.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ type SizeSettingGlobal = {
|
|
|
95
95
|
shape?: 'square' | 'vertical' | 'horizontal' | 'custom' | 'original';
|
|
96
96
|
shapeLinked?: boolean;
|
|
97
97
|
shapeValue?: string;
|
|
98
|
+
widthHeightLinked?: boolean;
|
|
98
99
|
padding?: {
|
|
99
100
|
type?: 'small' | 'medium' | 'large' | 'custom';
|
|
100
101
|
top?: string;
|
|
@@ -104,6 +105,7 @@ type SizeSettingGlobal = {
|
|
|
104
105
|
};
|
|
105
106
|
width?: string;
|
|
106
107
|
height?: string;
|
|
108
|
+
gap?: string;
|
|
107
109
|
};
|
|
108
110
|
type FlexDirectionProp = 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
109
111
|
type TransformProp = 'default' | 'capitalize' | 'uppercase' | 'lowercase' | 'none';
|
|
@@ -125,8 +127,8 @@ type Component = InitComponentType & {
|
|
|
125
127
|
uid: string;
|
|
126
128
|
childrens?: Component[];
|
|
127
129
|
};
|
|
128
|
-
type NameDevices = 'desktop' | 'tablet' | 'mobile';
|
|
129
|
-
type ObjectDevices<T> = Partial<Record<NameDevices, T>>;
|
|
130
|
+
type NameDevices$1 = 'desktop' | 'tablet' | 'mobile';
|
|
131
|
+
type ObjectDevices<T> = Partial<Record<NameDevices$1, T>>;
|
|
130
132
|
type StateType = 'normal' | 'hover' | 'focus' | 'active';
|
|
131
133
|
type StateProp<T> = Partial<Record<StateType, T>>;
|
|
132
134
|
type ResponsiveStateProp<T> = ObjectDevices<StateProp<T>>;
|
|
@@ -348,6 +350,8 @@ type GroupControlType<T> = {
|
|
|
348
350
|
type IconControlType<T> = SharedControlType<T> & {
|
|
349
351
|
type: 'icon';
|
|
350
352
|
placeholder?: string;
|
|
353
|
+
hideLabel?: boolean;
|
|
354
|
+
hideInput?: boolean;
|
|
351
355
|
};
|
|
352
356
|
|
|
353
357
|
type ImageControlType<T> = SharedControlType<T> & {
|
|
@@ -450,7 +454,7 @@ type Mapped$3<K, T> = NonNullable<T> extends ObjectDevices<infer U> ? {
|
|
|
450
454
|
active?: boolean;
|
|
451
455
|
};
|
|
452
456
|
placeholder?: string;
|
|
453
|
-
type: 'segment';
|
|
457
|
+
type: 'segment' | 'accordion:segment';
|
|
454
458
|
options: Option$2<T>[];
|
|
455
459
|
iconCustom?: boolean;
|
|
456
460
|
devices?: ResponsiveConfig<U>;
|
|
@@ -471,7 +475,7 @@ type Mapped$3<K, T> = NonNullable<T> extends ObjectDevices<infer U> ? {
|
|
|
471
475
|
active?: boolean;
|
|
472
476
|
};
|
|
473
477
|
placeholder?: string;
|
|
474
|
-
type: 'segment';
|
|
478
|
+
type: 'segment' | 'accordion:segment';
|
|
475
479
|
options: Option$2<T>[];
|
|
476
480
|
iconCustom?: boolean;
|
|
477
481
|
default?: T;
|
|
@@ -781,9 +785,10 @@ type Mapped$1<K, T> = NonNullable<T> extends ObjectDevices<infer U> ? {
|
|
|
781
785
|
};
|
|
782
786
|
placeholder?: string;
|
|
783
787
|
type: 'layout-segment';
|
|
784
|
-
options
|
|
788
|
+
options?: Option<T>[];
|
|
785
789
|
iconViewBox?: string;
|
|
786
790
|
enableItemBackground?: boolean;
|
|
791
|
+
enableTooltip?: boolean;
|
|
787
792
|
default?: T;
|
|
788
793
|
};
|
|
789
794
|
type LayoutSegmentControlType<T> = {
|
|
@@ -926,6 +931,8 @@ type SettingConfig = {
|
|
|
926
931
|
sizeConfig?: Partial<Record<'small' | 'medium' | 'large', string>>;
|
|
927
932
|
displayOptions?: OptionKeyword[];
|
|
928
933
|
paddingConfig?: PaddingConfig;
|
|
934
|
+
name?: string;
|
|
935
|
+
units?: string[];
|
|
929
936
|
};
|
|
930
937
|
type SizeSetting$1<T> = SharedControlType<T> & {
|
|
931
938
|
type: 'size-setting';
|
|
@@ -933,9 +940,37 @@ type SizeSetting$1<T> = SharedControlType<T> & {
|
|
|
933
940
|
readonly?: boolean;
|
|
934
941
|
hiddenSettings?: SettingID[];
|
|
935
942
|
settingConfig?: Partial<Record<SettingID, SettingConfig>>;
|
|
943
|
+
hiddenShowMore?: boolean;
|
|
936
944
|
};
|
|
937
945
|
|
|
938
|
-
type
|
|
946
|
+
type ChildIconType<T> = SharedControlType<T> & {
|
|
947
|
+
type: 'child-icon';
|
|
948
|
+
[key: string]: any;
|
|
949
|
+
};
|
|
950
|
+
|
|
951
|
+
type DropdownInput<T> = SharedControlType<T> & {
|
|
952
|
+
type: 'dropdown:input' | 'accordion:dropdown:input';
|
|
953
|
+
hideUnit?: boolean;
|
|
954
|
+
inputType?: 'text' | 'number';
|
|
955
|
+
displayOptions?: {
|
|
956
|
+
label: string;
|
|
957
|
+
value: string;
|
|
958
|
+
reversed?: boolean;
|
|
959
|
+
showValue?: boolean;
|
|
960
|
+
}[];
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
type Dropdown<T> = SharedControlType<T> & {
|
|
964
|
+
type: 'dropdown';
|
|
965
|
+
inputType?: 'text';
|
|
966
|
+
displayOptions?: {
|
|
967
|
+
label: string;
|
|
968
|
+
value: string;
|
|
969
|
+
icon?: string;
|
|
970
|
+
}[];
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
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>;
|
|
939
974
|
type Setting<P extends BaseProps> = {
|
|
940
975
|
id: 'setting';
|
|
941
976
|
note?: string;
|
|
@@ -963,6 +998,8 @@ type ComponentSetting<P extends BaseProps> = {
|
|
|
963
998
|
noWrap?: boolean;
|
|
964
999
|
editorConfigs?: {
|
|
965
1000
|
component?: {
|
|
1001
|
+
validate?: boolean;
|
|
1002
|
+
excludeApplyStyle?: boolean;
|
|
966
1003
|
noDelete?: boolean;
|
|
967
1004
|
noDuplicate?: boolean;
|
|
968
1005
|
noDragDrop?: boolean;
|
|
@@ -1018,6 +1055,7 @@ type ControlUI = {
|
|
|
1018
1055
|
info?: 'near' | 'far';
|
|
1019
1056
|
labelSpacing?: 'small' | 'medium' | 'large';
|
|
1020
1057
|
removeSpacing?: boolean;
|
|
1058
|
+
noGap?: boolean;
|
|
1021
1059
|
tooltip?: {
|
|
1022
1060
|
icon?: string;
|
|
1023
1061
|
content?: string;
|
|
@@ -7870,9 +7908,9 @@ declare function cls(...classes: ClassValue[]): string;
|
|
|
7870
7908
|
*/
|
|
7871
7909
|
declare const flattenConnection: <T>(connection?: Maybe<GraphQLConnection<T>>) => Maybe<T>[];
|
|
7872
7910
|
|
|
7873
|
-
declare const getResponsiveValue: <I, K extends keyof I>(input?: Partial<Record<NameDevices, I>> | undefined, k?: K | undefined) => Partial<Record<NameDevices, I[K]>>;
|
|
7874
|
-
declare const getResponsiveStateValue: <I>(k: StateType, input?: Partial<Record<NameDevices, Partial<Record<StateType, I>>>> | undefined) => Partial<Record<NameDevices, I>>;
|
|
7875
|
-
declare const getResponsiveValueByScreen: <T>(value?: Partial<Record<NameDevices, T>> | undefined, breakpoint?: NameDevices | undefined, defaultValue?: T | undefined) => T | undefined;
|
|
7911
|
+
declare const getResponsiveValue: <I, K extends keyof I>(input?: Partial<Record<NameDevices$1, I>> | undefined, k?: K | undefined) => Partial<Record<NameDevices$1, I[K]>>;
|
|
7912
|
+
declare const getResponsiveStateValue: <I>(k: StateType, input?: Partial<Record<NameDevices$1, Partial<Record<StateType, I>>>> | undefined) => Partial<Record<NameDevices$1, I>>;
|
|
7913
|
+
declare const getResponsiveValueByScreen: <T>(value?: Partial<Record<NameDevices$1, T>> | undefined, breakpoint?: NameDevices$1 | undefined, defaultValue?: T | undefined) => T | undefined;
|
|
7876
7914
|
declare const isColumnDirectionExist: (layout: ObjectDevices<ObjectLayoutValue>, breakpoint: keyof ObjectDevices<ObjectLayoutValue>) => boolean;
|
|
7877
7915
|
|
|
7878
7916
|
declare function getShortName(name: string): string;
|
|
@@ -7897,8 +7935,8 @@ declare const makeStyle: <T extends ShortHandProperty, K>(style: Record<T, K>) =
|
|
|
7897
7935
|
[k: string]: Record<`--${T}`, K>;
|
|
7898
7936
|
};
|
|
7899
7937
|
declare const makeStyleState: <T extends ShortHandProperty, K>(name: T, value?: Partial<Record<StateType, K>> | undefined) => {};
|
|
7900
|
-
declare const makeStyleResponsiveState: <T extends ShortHandProperty, K>(name: T, value?: Partial<Record<NameDevices, Partial<Record<StateType, K>>>> | undefined) => {};
|
|
7901
|
-
declare const makeStyleResponsive: <T extends ShortHandProperty, K>(name: T, value?: Partial<Record<NameDevices, K>> | undefined) => Record<ResponsiveKey<T>, K>;
|
|
7938
|
+
declare const makeStyleResponsiveState: <T extends ShortHandProperty, K>(name: T, value?: Partial<Record<NameDevices$1, Partial<Record<StateType, K>>>> | undefined) => {};
|
|
7939
|
+
declare const makeStyleResponsive: <T extends ShortHandProperty, K>(name: T, value?: Partial<Record<NameDevices$1, K>> | undefined) => Record<ResponsiveKey<T>, K>;
|
|
7902
7940
|
declare const makeWidth: (widthValue?: ObjectDevices<string | number>, fullWidthValue?: ObjectDevices<boolean>) => ObjectDevices<string | number | undefined>;
|
|
7903
7941
|
declare const makeGlobalSizeWidthResponsive: (globalSize?: ObjectDevices<SizeSettingGlobal>) => {
|
|
7904
7942
|
'--w': string | undefined;
|
|
@@ -9456,8 +9494,8 @@ declare const composeTypographyStyle: (typo?: TypographySettingV2, typography?:
|
|
|
9456
9494
|
};
|
|
9457
9495
|
|
|
9458
9496
|
declare const getCornerCSSFromGlobal: (corner?: CornerRadius) => React.CSSProperties;
|
|
9459
|
-
declare const getRadiusCSSFromGlobal: (state: StateType, key?: RoundedSize, device?: NameDevices) => React.CSSProperties;
|
|
9460
|
-
declare const getCustomRadius: (state: StateType, radius?: CornerRadius, device?: NameDevices) => React.CSSProperties;
|
|
9497
|
+
declare const getRadiusCSSFromGlobal: (state: StateType, key?: RoundedSize, device?: NameDevices$1) => React.CSSProperties;
|
|
9498
|
+
declare const getCustomRadius: (state: StateType, radius?: CornerRadius, device?: NameDevices$1) => React.CSSProperties;
|
|
9461
9499
|
declare const composeRadius: (value?: StateProp<CornerRadius> | ResponsiveStateProp<CornerRadius>) => React.CSSProperties;
|
|
9462
9500
|
declare const composeRadiusResponsive: (radiusValue?: ObjectDevices<CornerRadius>) => React.CSSProperties;
|
|
9463
9501
|
declare const getRadiusStyleActiveState: (radiusValue?: StateProp<CornerRadius>) => React.CSSProperties;
|
|
@@ -9539,11 +9577,21 @@ declare const makeGlobalSize: (globalSize?: ObjectDevices<SizeSettingGlobal>) =>
|
|
|
9539
9577
|
width: Record<ResponsiveKey<"w">, string | number>;
|
|
9540
9578
|
height: Record<ResponsiveKey<"h">, string | number>;
|
|
9541
9579
|
padding: React.CSSProperties;
|
|
9580
|
+
gap: {
|
|
9581
|
+
'--gg': string | undefined;
|
|
9582
|
+
'--gg-tablet': string | undefined;
|
|
9583
|
+
'--gg-mobile': string | undefined;
|
|
9584
|
+
};
|
|
9542
9585
|
};
|
|
9543
|
-
declare const
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9586
|
+
declare const getGlobalSizeGap: (globalSize?: ObjectDevices<SizeSettingGlobal>) => {
|
|
9587
|
+
'--gg': string | undefined;
|
|
9588
|
+
'--gg-tablet': string | undefined;
|
|
9589
|
+
'--gg-mobile': string | undefined;
|
|
9590
|
+
};
|
|
9591
|
+
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>;
|
|
9592
|
+
declare const getWidthHeightGlobalSize: (type: 'width' | 'height', globalSize?: ObjectDevices<SizeSettingGlobal>) => Partial<Record<NameDevices$1, string | number>>;
|
|
9593
|
+
declare const getHeightByShapeGlobalSize: (shapeByLayout?: ObjectDevices<SizeSettingGlobal>) => Partial<Record<NameDevices$1, string>>;
|
|
9594
|
+
declare const getWidthByShapeGlobalSize: (shapeByLayout?: ObjectDevices<SizeSettingGlobal>) => Partial<Record<NameDevices$1, string>>;
|
|
9547
9595
|
declare const getAspectRatioGlobalSize: (shape?: ObjectDevices<SizeSettingGlobal>) => ObjectDevices<string>;
|
|
9548
9596
|
declare const getPaddingGlobalSize: (globalSize?: ObjectDevices<SizeSettingGlobal>) => React.CSSProperties;
|
|
9549
9597
|
|
|
@@ -9614,6 +9662,21 @@ type AdvanceValue = Primitive | ObjectDevices<Primitive>;
|
|
|
9614
9662
|
declare function composeAdvanceStyle(data?: Record<string, AdvanceValue>, tag?: string): React.CSSProperties;
|
|
9615
9663
|
declare const splitStyle: (keys: ShortHandProperty[], style?: React.CSSProperties) => React.CSSProperties[];
|
|
9616
9664
|
|
|
9665
|
+
type NameDevices = 'desktop' | 'tablet' | 'mobile';
|
|
9666
|
+
|
|
9667
|
+
type PostionType = {
|
|
9668
|
+
wrapper?: Record<string, string | number>;
|
|
9669
|
+
content?: Record<string, string | number>;
|
|
9670
|
+
};
|
|
9671
|
+
declare const composePostionIconList: (lineHeight: string, position?: ObjectDevices<'center' | 'baseline'>, iconWidth?: ObjectDevices<number>) => PostionType;
|
|
9672
|
+
declare const composePositionLineHeight: ({ compose, lineHeight, device, position, iconWidth, }: {
|
|
9673
|
+
compose: PostionType;
|
|
9674
|
+
lineHeight: string;
|
|
9675
|
+
device: NameDevices;
|
|
9676
|
+
position?: Partial<Record<NameDevices$1, "center" | "baseline">> | undefined;
|
|
9677
|
+
iconWidth?: Partial<Record<NameDevices$1, number>> | undefined;
|
|
9678
|
+
}) => void;
|
|
9679
|
+
|
|
9617
9680
|
type Func$6 = ReturnType<typeof addToCartOperation>;
|
|
9618
9681
|
type Response$6 = Awaited<ReturnType<Func$6>>;
|
|
9619
9682
|
type Args$5 = Parameters<Func$6>[0];
|
|
@@ -9694,7 +9757,7 @@ declare const useProductQuery: (productId?: string, options?: SWRConfiguration<P
|
|
|
9694
9757
|
|
|
9695
9758
|
declare const useProductsQuery: (ids?: string[], options?: SWRConfiguration<ProductsQueryResponse>, defaultSelectedProductCount?: number) => swr__internal.SWRResponse<ProductsQueryResponse, any, Partial<swr__internal.PublicConfiguration<ProductsQueryResponse, any, (arg: ["query/products", FetchProductsParams]) => swr__internal.FetcherResponse<ProductsQueryResponse>>> | undefined>;
|
|
9696
9759
|
|
|
9697
|
-
declare const useCurrentDevice: () => NameDevices;
|
|
9760
|
+
declare const useCurrentDevice: () => NameDevices$1;
|
|
9698
9761
|
|
|
9699
9762
|
declare const useFormatMoney: (amount: number, withCurrency: boolean) => string;
|
|
9700
9763
|
|
|
@@ -9809,23 +9872,23 @@ declare const useCheckAvailableVariantInStock: (optionId: string, optionValue: s
|
|
|
9809
9872
|
declare const useProductList: () => CollectionProductSelectFragment | undefined;
|
|
9810
9873
|
declare const useProductListProducts: () => (ProductQuickSelectFragment | undefined)[] | undefined;
|
|
9811
9874
|
declare const useProductListSettings: () => {
|
|
9812
|
-
loop?: Partial<Record<NameDevices, boolean>> | undefined;
|
|
9813
|
-
scrollMode?: Partial<Record<NameDevices, "snap" | "free" | "free-snap">> | undefined;
|
|
9814
|
-
slidesToShow?: Partial<Record<NameDevices, number | "auto">> | undefined;
|
|
9815
|
-
spacing?: Partial<Record<NameDevices, number>> | undefined;
|
|
9875
|
+
loop?: Partial<Record<NameDevices$1, boolean>> | undefined;
|
|
9876
|
+
scrollMode?: Partial<Record<NameDevices$1, "snap" | "free" | "free-snap">> | undefined;
|
|
9877
|
+
slidesToShow?: Partial<Record<NameDevices$1, number | "auto">> | undefined;
|
|
9878
|
+
spacing?: Partial<Record<NameDevices$1, number>> | undefined;
|
|
9816
9879
|
layout?: "grid" | "slider" | undefined;
|
|
9817
|
-
dot?: Partial<Record<NameDevices, boolean>> | undefined;
|
|
9818
|
-
arrow?: Partial<Record<NameDevices, boolean>> | undefined;
|
|
9819
|
-
controlOverContent?: Partial<Record<NameDevices, boolean>> | undefined;
|
|
9880
|
+
dot?: Partial<Record<NameDevices$1, boolean>> | undefined;
|
|
9881
|
+
arrow?: Partial<Record<NameDevices$1, boolean>> | undefined;
|
|
9882
|
+
controlOverContent?: Partial<Record<NameDevices$1, boolean>> | undefined;
|
|
9820
9883
|
speed?: number | undefined;
|
|
9821
9884
|
} | undefined;
|
|
9822
9885
|
declare const useProductListStyles: () => {
|
|
9823
|
-
horizontalGutter?: Partial<Record<NameDevices, string>> | undefined;
|
|
9824
|
-
verticalGutter?: Partial<Record<NameDevices, string>> | undefined;
|
|
9825
|
-
fullWidth?: Partial<Record<NameDevices, boolean>> | undefined;
|
|
9826
|
-
spacing?: Partial<Record<NameDevices, number>> | undefined;
|
|
9827
|
-
width?: Partial<Record<NameDevices, string>> | undefined;
|
|
9828
|
-
height?: Partial<Record<NameDevices, string>> | undefined;
|
|
9886
|
+
horizontalGutter?: Partial<Record<NameDevices$1, string>> | undefined;
|
|
9887
|
+
verticalGutter?: Partial<Record<NameDevices$1, string>> | undefined;
|
|
9888
|
+
fullWidth?: Partial<Record<NameDevices$1, boolean>> | undefined;
|
|
9889
|
+
spacing?: Partial<Record<NameDevices$1, number>> | undefined;
|
|
9890
|
+
width?: Partial<Record<NameDevices$1, string>> | undefined;
|
|
9891
|
+
height?: Partial<Record<NameDevices$1, string>> | undefined;
|
|
9829
9892
|
} | undefined;
|
|
9830
9893
|
|
|
9831
9894
|
declare const useSuspenseFetch: <T>(key: string | any[], promise: () => Promise<T>) => {
|
|
@@ -9847,4 +9910,4 @@ type PublishedThemePageSelectFragment = Pick<PublishedThemePage, 'id' | 'name' |
|
|
|
9847
9910
|
|
|
9848
9911
|
declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
|
|
9849
9912
|
|
|
9850
|
-
export { AddOn, AddonProvider, AddonProviderProps, 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, FeraReviewsWidgetType, FetchCollectionArgs, FetchFunc, FetchProductParams, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, ImageShape$1 as ImageShape, InitComponentType, InstantJudgeMeReviewsWidgetType, InstantKlaviyoWidgetType, InstantLooxReviewsWidgetType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LaiProductReviewsWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OmnisendWidgetType, 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, 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, VariantSelectFragment, VitalsWidgetType, WiserWidgetType, WrapRenderChildren, baseAssetURL, calculateFirstProduct, checkAvailableVariantInStock, cls, composeAdvanceStyle, composeBackgroundCss, composeBorderCss, composeCornerCss, composeGridLayout, composeMemo, 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, 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, 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 };
|
|
9913
|
+
export { AddOn, AddonProvider, AddonProviderProps, 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, FeraReviewsWidgetType, FetchCollectionArgs, FetchFunc, FetchProductParams, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, ImageShape$1 as ImageShape, InitComponentType, InstantJudgeMeReviewsWidgetType, InstantKlaviyoWidgetType, InstantLooxReviewsWidgetType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LaiProductReviewsWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices$1 as NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OmnisendWidgetType, 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, 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, VariantSelectFragment, VitalsWidgetType, WiserWidgetType, WrapRenderChildren, 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, 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.23.0-
|
|
3
|
+
"version": "1.23.0-staging.100",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"type-check": "yarn tsc --noEmit"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@gem-sdk/adapter-shopify": "1.23.0-
|
|
28
|
-
"@gem-sdk/styles": "1.23.0-
|
|
27
|
+
"@gem-sdk/adapter-shopify": "1.23.0-staging.26",
|
|
28
|
+
"@gem-sdk/styles": "1.23.0-staging.78"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"react-error-boundary": "4.0.10",
|