@gem-sdk/core 1.9.15 → 1.9.20
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/helpers/background.js +4 -0
- package/dist/cjs/helpers/borders.js +44 -0
- package/dist/cjs/helpers/colors.js +44 -0
- package/dist/cjs/helpers/radius.js +29 -0
- package/dist/cjs/helpers/shadow.js +8 -0
- package/dist/cjs/helpers/size.js +16 -0
- package/dist/cjs/helpers/typography.js +13 -0
- package/dist/cjs/index.js +19 -7
- package/dist/esm/helpers/background.js +5 -2
- package/dist/esm/helpers/borders.js +44 -2
- package/dist/esm/helpers/colors.js +42 -1
- package/dist/esm/helpers/radius.js +29 -1
- package/dist/esm/helpers/shadow.js +7 -1
- package/dist/esm/helpers/size.js +15 -1
- package/dist/esm/helpers/typography.js +13 -1
- package/dist/esm/index.js +7 -7
- package/dist/types/index.d.ts +29 -13
- package/package.json +1 -1
|
@@ -101,5 +101,9 @@ const getStyleBgAttachment = (background)=>{
|
|
|
101
101
|
const getBgAttachmentByDevice = (background, device)=>{
|
|
102
102
|
return background?.[device]?.attachment;
|
|
103
103
|
};
|
|
104
|
+
const composeBackgroundCss = (backgroundColor)=>{
|
|
105
|
+
return `${backgroundColor ? `background-color: ${colors.getSingleColorVariable(backgroundColor)} !important;` : undefined}`;
|
|
106
|
+
};
|
|
104
107
|
|
|
108
|
+
exports.composeBackgroundCss = composeBackgroundCss;
|
|
105
109
|
exports.getStyleBackgroundByDevice = getStyleBackgroundByDevice;
|
|
@@ -134,9 +134,53 @@ const handleConvertClassColor = (value)=>{
|
|
|
134
134
|
};
|
|
135
135
|
return colors.getGlobalColorStateClass('border', newVal);
|
|
136
136
|
};
|
|
137
|
+
const handleConvertClassColorDynamicBtn = (value)=>{
|
|
138
|
+
if (!value) return undefined;
|
|
139
|
+
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
140
|
+
const data = value;
|
|
141
|
+
const newVal = {
|
|
142
|
+
desktop: {
|
|
143
|
+
normal: data.desktop?.normal?.color,
|
|
144
|
+
hover: data.desktop?.hover?.color,
|
|
145
|
+
focus: data.desktop?.focus?.color
|
|
146
|
+
},
|
|
147
|
+
tablet: {
|
|
148
|
+
normal: data.tablet?.normal?.color,
|
|
149
|
+
hover: data.tablet?.hover?.color,
|
|
150
|
+
focus: data.tablet?.focus?.color
|
|
151
|
+
},
|
|
152
|
+
mobile: {
|
|
153
|
+
normal: data.mobile?.normal?.color,
|
|
154
|
+
hover: data.mobile?.hover?.color,
|
|
155
|
+
focus: data.mobile?.focus?.color
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
return colors.getGlobalColorStateResponsiveClassDynamicBtn('border', newVal);
|
|
159
|
+
}
|
|
160
|
+
const data = value;
|
|
161
|
+
const newVal = {
|
|
162
|
+
normal: data?.normal?.color,
|
|
163
|
+
hover: data?.hover?.color,
|
|
164
|
+
focus: data?.focus?.color
|
|
165
|
+
};
|
|
166
|
+
return colors.getGlobalColorStateClassDynamicBtn('border', newVal);
|
|
167
|
+
};
|
|
168
|
+
const composeBorderCss = (borderV)=>{
|
|
169
|
+
if (!borderV) return '';
|
|
170
|
+
const { border , width , color , isCustom } = borderV;
|
|
171
|
+
if (isCustom) {
|
|
172
|
+
return '';
|
|
173
|
+
}
|
|
174
|
+
return `${border ? `border-style: ${border};` : ''}
|
|
175
|
+
${width ? `border-width: ${width};` : undefined}
|
|
176
|
+
${color ? `border-color: ${colors.getSingleColorVariable(color)};` : undefined}
|
|
177
|
+
`;
|
|
178
|
+
};
|
|
137
179
|
|
|
180
|
+
exports.composeBorderCss = composeBorderCss;
|
|
138
181
|
exports.getBorderStyle = getBorderStyle;
|
|
139
182
|
exports.handleConvertBorderColor = handleConvertBorderColor;
|
|
140
183
|
exports.handleConvertBorderStyle = handleConvertBorderStyle;
|
|
141
184
|
exports.handleConvertBorderWidth = handleConvertBorderWidth;
|
|
142
185
|
exports.handleConvertClassColor = handleConvertClassColor;
|
|
186
|
+
exports.handleConvertClassColorDynamicBtn = handleConvertClassColorDynamicBtn;
|
|
@@ -34,6 +34,18 @@ const getGlobalColorStateClass = (type, data)=>{
|
|
|
34
34
|
}
|
|
35
35
|
}).filter(isDefined.isDefined).join(' ');
|
|
36
36
|
};
|
|
37
|
+
const getGlobalColorStateClassDynamicBtn = (type, data)=>{
|
|
38
|
+
if (!data) return '';
|
|
39
|
+
return Object.entries(data).map(([state, value])=>{
|
|
40
|
+
const clName = getGlobalColorClass(type, value);
|
|
41
|
+
if (!clName) return undefined;
|
|
42
|
+
if (state === 'normal') {
|
|
43
|
+
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${clName}`;
|
|
44
|
+
} else {
|
|
45
|
+
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${state}:${clName}`;
|
|
46
|
+
}
|
|
47
|
+
}).filter(isDefined.isDefined).join(' ');
|
|
48
|
+
};
|
|
37
49
|
const getGlobalColorStateResponsiveClass = (type, data)=>{
|
|
38
50
|
if (!data) return '';
|
|
39
51
|
return Object.entries(data).map(([device, objectState])=>{
|
|
@@ -60,6 +72,32 @@ const getGlobalColorStateResponsiveClass = (type, data)=>{
|
|
|
60
72
|
}
|
|
61
73
|
}).filter(Boolean).join(' ');
|
|
62
74
|
};
|
|
75
|
+
const getGlobalColorStateResponsiveClassDynamicBtn = (type, data)=>{
|
|
76
|
+
if (!data) return '';
|
|
77
|
+
return Object.entries(data).map(([device, objectState])=>{
|
|
78
|
+
if (device === 'desktop') {
|
|
79
|
+
return Object.entries(objectState).map(([state, value])=>{
|
|
80
|
+
const clName = getGlobalColorClass(type, value);
|
|
81
|
+
if (!clName) return undefined;
|
|
82
|
+
if (state === 'normal') {
|
|
83
|
+
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${clName}`;
|
|
84
|
+
} else {
|
|
85
|
+
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${state}:${clName}`;
|
|
86
|
+
}
|
|
87
|
+
}).filter(isDefined.isDefined).join(' ');
|
|
88
|
+
} else {
|
|
89
|
+
return Object.entries(objectState).map(([state, value])=>{
|
|
90
|
+
const clName = getGlobalColorClass(type, value);
|
|
91
|
+
if (!clName) return undefined;
|
|
92
|
+
if (state === 'normal') {
|
|
93
|
+
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${device}:${clName}`;
|
|
94
|
+
} else {
|
|
95
|
+
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${device}:${state}:${clName}`;
|
|
96
|
+
}
|
|
97
|
+
}).filter(isDefined.isDefined).join(' ');
|
|
98
|
+
}
|
|
99
|
+
}).filter(Boolean).join(' ');
|
|
100
|
+
};
|
|
63
101
|
const getGlobalColorResponsiveStyle = (type, data)=>{
|
|
64
102
|
if (!data) return {};
|
|
65
103
|
return Object.fromEntries(Object.entries(data).map(([device, value])=>{
|
|
@@ -125,13 +163,19 @@ const getGlobalColorStyle = (data)=>{
|
|
|
125
163
|
'--c': getSingleColorVariable(data)
|
|
126
164
|
};
|
|
127
165
|
};
|
|
166
|
+
const composeTextColorCss = (color)=>{
|
|
167
|
+
return `${color ? `color: ${getSingleColorVariable(color)} !important;` : ''}`;
|
|
168
|
+
};
|
|
128
169
|
|
|
170
|
+
exports.composeTextColorCss = composeTextColorCss;
|
|
129
171
|
exports.getGlobalColorCSSProp = getGlobalColorCSSProp;
|
|
130
172
|
exports.getGlobalColorClass = getGlobalColorClass;
|
|
131
173
|
exports.getGlobalColorResponsiveClass = getGlobalColorResponsiveClass;
|
|
132
174
|
exports.getGlobalColorResponsiveStyle = getGlobalColorResponsiveStyle;
|
|
133
175
|
exports.getGlobalColorStateClass = getGlobalColorStateClass;
|
|
176
|
+
exports.getGlobalColorStateClassDynamicBtn = getGlobalColorStateClassDynamicBtn;
|
|
134
177
|
exports.getGlobalColorStateResponsiveClass = getGlobalColorStateResponsiveClass;
|
|
178
|
+
exports.getGlobalColorStateResponsiveClassDynamicBtn = getGlobalColorStateResponsiveClassDynamicBtn;
|
|
135
179
|
exports.getGlobalColorStateResponsiveStyle = getGlobalColorStateResponsiveStyle;
|
|
136
180
|
exports.getGlobalColorStateStyle = getGlobalColorStateStyle;
|
|
137
181
|
exports.getGlobalColorStyle = getGlobalColorStyle;
|
|
@@ -97,7 +97,36 @@ const getRadiusStyleActiveState = (radiusValue)=>{
|
|
|
97
97
|
}
|
|
98
98
|
return getRadiusCSSFromGlobal('normal', radiusValue?.active?.radiusType);
|
|
99
99
|
};
|
|
100
|
+
const composeCornerCss = (value)=>{
|
|
101
|
+
if (!value) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const { radiusType , bblr , bbrr , btlr , btrr } = value;
|
|
105
|
+
let radiusValue = undefined;
|
|
106
|
+
switch(radiusType){
|
|
107
|
+
case 'medium':
|
|
108
|
+
case 'large':
|
|
109
|
+
case 'small':
|
|
110
|
+
radiusValue = `border-radius: var(--g-radius-${radiusType});`;
|
|
111
|
+
break;
|
|
112
|
+
case 'circle':
|
|
113
|
+
case 'none':
|
|
114
|
+
case 'custom':
|
|
115
|
+
radiusValue = `
|
|
116
|
+
${bblr ? `border-bottom-left-radius: ${bblr};` : ''}
|
|
117
|
+
|
|
118
|
+
${bbrr ? `border-bottom-right-radius: ${bbrr};` : ''}
|
|
119
|
+
|
|
120
|
+
${btlr ? `border-top-left-radius: ${btlr};` : ''}
|
|
121
|
+
|
|
122
|
+
${btrr ? `border-top-right-radius: ${btrr};` : ''}
|
|
123
|
+
`;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
return radiusValue;
|
|
127
|
+
};
|
|
100
128
|
|
|
129
|
+
exports.composeCornerCss = composeCornerCss;
|
|
101
130
|
exports.composeRadius = composeRadius;
|
|
102
131
|
exports.getCornerCSSFromGlobal = getCornerCSSFromGlobal;
|
|
103
132
|
exports.getCustomRadius = getCustomRadius;
|
|
@@ -43,6 +43,14 @@ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
|
|
|
43
43
|
}
|
|
44
44
|
return style;
|
|
45
45
|
};
|
|
46
|
+
const composeShadowCss = ({ hasBoxShadow , boxShadowValue })=>{
|
|
47
|
+
if (!hasBoxShadow) return undefined;
|
|
48
|
+
if (!boxShadowValue) return undefined;
|
|
49
|
+
const { value: distance , unit: unitDistance } = parseValueWithUnit(`${boxShadowValue?.distance}`);
|
|
50
|
+
return `box-shadow: ${Math.cos(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${boxShadowValue?.blur} ${boxShadowValue?.spread + ' '}${colors.getSingleColorVariable(boxShadowValue?.color)};`;
|
|
51
|
+
};
|
|
46
52
|
|
|
53
|
+
exports.composeShadowCss = composeShadowCss;
|
|
47
54
|
exports.getStyleShadow = getStyleShadow;
|
|
48
55
|
exports.getStyleShadowState = getStyleShadowState;
|
|
56
|
+
exports.parseValueWithUnit = parseValueWithUnit;
|
package/dist/cjs/helpers/size.js
CHANGED
|
@@ -15,5 +15,21 @@ function getCustomSizeCSSByDevice(size, device) {
|
|
|
15
15
|
const composeSize = (size)=>{
|
|
16
16
|
return Object.assign({}, getCustomSizeCSSByDevice(size, 'desktop'), getCustomSizeCSSByDevice(size, 'tablet'), getCustomSizeCSSByDevice(size, 'mobile'));
|
|
17
17
|
};
|
|
18
|
+
function genSizeClass(name) {
|
|
19
|
+
return `g-s-${name}`;
|
|
20
|
+
}
|
|
21
|
+
const composeSizeCss = (spacing)=>{
|
|
22
|
+
if (spacing === undefined) return '';
|
|
23
|
+
const size = spacing;
|
|
24
|
+
const sizeHozi = spacing?.custom?.desktop?.horizontal;
|
|
25
|
+
const sizeVerti = spacing?.custom?.desktop?.vertical;
|
|
26
|
+
if (!size?.custom) return undefined;
|
|
27
|
+
return `
|
|
28
|
+
${sizeHozi ? `padding-left: ${sizeHozi}; padding-right: ${sizeHozi};` : undefined}
|
|
29
|
+
${sizeVerti ? `padding-top: ${sizeVerti}; padding-bottom: ${sizeVerti};` : undefined}
|
|
30
|
+
`;
|
|
31
|
+
};
|
|
18
32
|
|
|
19
33
|
exports.composeSize = composeSize;
|
|
34
|
+
exports.composeSizeCss = composeSizeCss;
|
|
35
|
+
exports.genSizeClass = genSizeClass;
|
|
@@ -3,5 +3,18 @@
|
|
|
3
3
|
const genTypoClass = (name)=>{
|
|
4
4
|
return `g-${name}`;
|
|
5
5
|
};
|
|
6
|
+
const composeTypographyCss = (typography)=>{
|
|
7
|
+
const typographyCustom = typography?.custom;
|
|
8
|
+
const { fontFamily , fontSize , fontStyle , fontWeight , lineHeight , letterSpacing } = typographyCustom?.desktop ?? {};
|
|
9
|
+
return `
|
|
10
|
+
${fontFamily ? `font-family: var(--g-font-${fontFamily}, ${fontFamily});` : ''}
|
|
11
|
+
${fontSize ? `font-size: ${fontSize};` : ''}
|
|
12
|
+
${fontStyle ? `font-style: ${fontStyle};` : ''}
|
|
13
|
+
${fontWeight ? `font-weight: ${fontWeight};` : ''}
|
|
14
|
+
${letterSpacing ? `letter-spacing: ${letterSpacing};` : ''}
|
|
15
|
+
${lineHeight ? `line-height: ${lineHeight};` : ''}
|
|
16
|
+
`;
|
|
17
|
+
};
|
|
6
18
|
|
|
19
|
+
exports.composeTypographyCss = composeTypographyCss;
|
|
7
20
|
exports.genTypoClass = genTypoClass;
|
package/dist/cjs/index.js
CHANGED
|
@@ -35,12 +35,9 @@ var isEmptyChildren = require('./helpers/is-empty-children.js');
|
|
|
35
35
|
var makeStyle = require('./helpers/make-style.js');
|
|
36
36
|
var normalizeBuilderData = require('./helpers/normalize-builder-data.js');
|
|
37
37
|
var prefetchQueries = require('./helpers/prefetch-queries.js');
|
|
38
|
-
var shadow = require('./helpers/shadow.js');
|
|
39
|
-
var size = require('./helpers/size.js');
|
|
40
38
|
var spacing = require('./helpers/spacing.js');
|
|
41
39
|
var loadScript = require('./helpers/load-script.js');
|
|
42
40
|
var email = require('./helpers/email.js');
|
|
43
|
-
var background = require('./helpers/background.js');
|
|
44
41
|
var cssVariable = require('./helpers/css-variable.js');
|
|
45
42
|
var layout = require('./helpers/layout.js');
|
|
46
43
|
var isDefined = require('./helpers/is-defined.js');
|
|
@@ -53,6 +50,9 @@ var gtag = require('./helpers/tracking/gtag.js');
|
|
|
53
50
|
var tiktokpixel = require('./helpers/tracking/tiktokpixel.js');
|
|
54
51
|
var render = require('./helpers/render.js');
|
|
55
52
|
var convert = require('./helpers/convert.js');
|
|
53
|
+
var size = require('./helpers/size.js');
|
|
54
|
+
var shadow = require('./helpers/shadow.js');
|
|
55
|
+
var background = require('./helpers/background.js');
|
|
56
56
|
var useAddToCart = require('./hooks/cart/use-add-to-cart.js');
|
|
57
57
|
var useCartData = require('./hooks/cart/use-cart-data.js');
|
|
58
58
|
var useCartDiscountCodesUpdate = require('./hooks/cart/use-cart-discount-codes-update.js');
|
|
@@ -125,11 +125,13 @@ exports.PublishedThemePagesDocument = publishedThemePages_generated.PublishedThe
|
|
|
125
125
|
exports.ProductsDocument = products_generated.ProductsDocument;
|
|
126
126
|
exports.StorePropertyDocument = storeProperty_generated.StorePropertyDocument;
|
|
127
127
|
exports.PreviewPageDocument = previewPage_generated.PreviewPageDocument;
|
|
128
|
+
exports.composeBorderCss = borders.composeBorderCss;
|
|
128
129
|
exports.getBorderStyle = borders.getBorderStyle;
|
|
129
130
|
exports.handleConvertBorderColor = borders.handleConvertBorderColor;
|
|
130
131
|
exports.handleConvertBorderStyle = borders.handleConvertBorderStyle;
|
|
131
132
|
exports.handleConvertBorderWidth = borders.handleConvertBorderWidth;
|
|
132
133
|
exports.handleConvertClassColor = borders.handleConvertClassColor;
|
|
134
|
+
exports.handleConvertClassColorDynamicBtn = borders.handleConvertClassColorDynamicBtn;
|
|
133
135
|
exports.cls = cls.cls;
|
|
134
136
|
exports.composeAdvanceStyle = composeAdvanceStyle.composeAdvanceStyle;
|
|
135
137
|
exports.flattenConnection = flattenConnection.flattenConnection;
|
|
@@ -149,32 +151,33 @@ exports.makeStyleState = makeStyle.makeStyleState;
|
|
|
149
151
|
exports.makeWidth = makeStyle.makeWidth;
|
|
150
152
|
exports.normalizeBuilderData = normalizeBuilderData.normalizeBuilderData;
|
|
151
153
|
exports.prefetchQueries = prefetchQueries.prefetchQueries;
|
|
152
|
-
exports.getStyleShadow = shadow.getStyleShadow;
|
|
153
|
-
exports.getStyleShadowState = shadow.getStyleShadowState;
|
|
154
|
-
exports.composeSize = size.composeSize;
|
|
155
154
|
exports.composeSpacing = spacing.composeSpacing;
|
|
156
155
|
exports.getSpacingVariable = spacing.getSpacingVariable;
|
|
157
156
|
exports.loadScript = loadScript.loadScript;
|
|
158
157
|
exports.validateEmail = email.validateEmail;
|
|
159
|
-
exports.getStyleBackgroundByDevice = background.getStyleBackgroundByDevice;
|
|
160
158
|
exports.genVariable = cssVariable.genVariable;
|
|
161
159
|
exports.composeGridLayout = layout.composeGridLayout;
|
|
162
160
|
exports.convertOldLayout = layout.convertOldLayout;
|
|
163
161
|
exports.gridToArrayRegex = layout.gridToArrayRegex;
|
|
164
162
|
exports.optionLayoutStyle = layout.optionLayoutStyle;
|
|
165
163
|
exports.isDefined = isDefined.isDefined;
|
|
164
|
+
exports.composeTextColorCss = colors.composeTextColorCss;
|
|
166
165
|
exports.getGlobalColorCSSProp = colors.getGlobalColorCSSProp;
|
|
167
166
|
exports.getGlobalColorClass = colors.getGlobalColorClass;
|
|
168
167
|
exports.getGlobalColorResponsiveClass = colors.getGlobalColorResponsiveClass;
|
|
169
168
|
exports.getGlobalColorResponsiveStyle = colors.getGlobalColorResponsiveStyle;
|
|
170
169
|
exports.getGlobalColorStateClass = colors.getGlobalColorStateClass;
|
|
170
|
+
exports.getGlobalColorStateClassDynamicBtn = colors.getGlobalColorStateClassDynamicBtn;
|
|
171
171
|
exports.getGlobalColorStateResponsiveClass = colors.getGlobalColorStateResponsiveClass;
|
|
172
|
+
exports.getGlobalColorStateResponsiveClassDynamicBtn = colors.getGlobalColorStateResponsiveClassDynamicBtn;
|
|
172
173
|
exports.getGlobalColorStateResponsiveStyle = colors.getGlobalColorStateResponsiveStyle;
|
|
173
174
|
exports.getGlobalColorStateStyle = colors.getGlobalColorStateStyle;
|
|
174
175
|
exports.getGlobalColorStyle = colors.getGlobalColorStyle;
|
|
175
176
|
exports.getSingleColorVariable = colors.getSingleColorVariable;
|
|
176
177
|
exports.isColor = colors.isColor;
|
|
178
|
+
exports.composeTypographyCss = typography.composeTypographyCss;
|
|
177
179
|
exports.genTypoClass = typography.genTypoClass;
|
|
180
|
+
exports.composeCornerCss = radius.composeCornerCss;
|
|
178
181
|
exports.composeRadius = radius.composeRadius;
|
|
179
182
|
exports.getCornerCSSFromGlobal = radius.getCornerCSSFromGlobal;
|
|
180
183
|
exports.getCustomRadius = radius.getCustomRadius;
|
|
@@ -190,6 +193,15 @@ exports.props = render.props;
|
|
|
190
193
|
exports.styles = render.styles;
|
|
191
194
|
exports.template = render.template;
|
|
192
195
|
exports.isLocalEnv = convert.isLocalEnv;
|
|
196
|
+
exports.composeSize = size.composeSize;
|
|
197
|
+
exports.composeSizeCss = size.composeSizeCss;
|
|
198
|
+
exports.genSizeClass = size.genSizeClass;
|
|
199
|
+
exports.composeShadowCss = shadow.composeShadowCss;
|
|
200
|
+
exports.getStyleShadow = shadow.getStyleShadow;
|
|
201
|
+
exports.getStyleShadowState = shadow.getStyleShadowState;
|
|
202
|
+
exports.parseValueWithUnit = shadow.parseValueWithUnit;
|
|
203
|
+
exports.composeBackgroundCss = background.composeBackgroundCss;
|
|
204
|
+
exports.getStyleBackgroundByDevice = background.getStyleBackgroundByDevice;
|
|
193
205
|
exports.useAddToCart = useAddToCart.useAddToCart;
|
|
194
206
|
exports.useCartData = useCartData.useCartData;
|
|
195
207
|
exports.useCartDiscountCodesUpdate = useCartDiscountCodesUpdate.useCartDiscountCodesUpdate;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isColor } from './colors.js';
|
|
1
|
+
import { isColor, getSingleColorVariable } from './colors.js';
|
|
2
2
|
import { makeStyleResponsive } from './make-style.js';
|
|
3
3
|
|
|
4
4
|
const getStyleBackgroundByDevice = (background, options)=>{
|
|
@@ -99,5 +99,8 @@ const getStyleBgAttachment = (background)=>{
|
|
|
99
99
|
const getBgAttachmentByDevice = (background, device)=>{
|
|
100
100
|
return background?.[device]?.attachment;
|
|
101
101
|
};
|
|
102
|
+
const composeBackgroundCss = (backgroundColor)=>{
|
|
103
|
+
return `${backgroundColor ? `background-color: ${getSingleColorVariable(backgroundColor)} !important;` : undefined}`;
|
|
104
|
+
};
|
|
102
105
|
|
|
103
|
-
export { getStyleBackgroundByDevice };
|
|
106
|
+
export { composeBackgroundCss, getStyleBackgroundByDevice };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getSingleColorVariable, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStateResponsiveClass, getGlobalColorStateClass } from './colors.js';
|
|
1
|
+
import { getSingleColorVariable, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStateResponsiveClass, getGlobalColorStateClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateClassDynamicBtn } from './colors.js';
|
|
2
2
|
import { makeStyle, makeStyleResponsiveState, makeStyleState } from './make-style.js';
|
|
3
3
|
|
|
4
4
|
const getBorderStyle = (value)=>{
|
|
@@ -132,5 +132,47 @@ const handleConvertClassColor = (value)=>{
|
|
|
132
132
|
};
|
|
133
133
|
return getGlobalColorStateClass('border', newVal);
|
|
134
134
|
};
|
|
135
|
+
const handleConvertClassColorDynamicBtn = (value)=>{
|
|
136
|
+
if (!value) return undefined;
|
|
137
|
+
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
138
|
+
const data = value;
|
|
139
|
+
const newVal = {
|
|
140
|
+
desktop: {
|
|
141
|
+
normal: data.desktop?.normal?.color,
|
|
142
|
+
hover: data.desktop?.hover?.color,
|
|
143
|
+
focus: data.desktop?.focus?.color
|
|
144
|
+
},
|
|
145
|
+
tablet: {
|
|
146
|
+
normal: data.tablet?.normal?.color,
|
|
147
|
+
hover: data.tablet?.hover?.color,
|
|
148
|
+
focus: data.tablet?.focus?.color
|
|
149
|
+
},
|
|
150
|
+
mobile: {
|
|
151
|
+
normal: data.mobile?.normal?.color,
|
|
152
|
+
hover: data.mobile?.hover?.color,
|
|
153
|
+
focus: data.mobile?.focus?.color
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
return getGlobalColorStateResponsiveClassDynamicBtn('border', newVal);
|
|
157
|
+
}
|
|
158
|
+
const data = value;
|
|
159
|
+
const newVal = {
|
|
160
|
+
normal: data?.normal?.color,
|
|
161
|
+
hover: data?.hover?.color,
|
|
162
|
+
focus: data?.focus?.color
|
|
163
|
+
};
|
|
164
|
+
return getGlobalColorStateClassDynamicBtn('border', newVal);
|
|
165
|
+
};
|
|
166
|
+
const composeBorderCss = (borderV)=>{
|
|
167
|
+
if (!borderV) return '';
|
|
168
|
+
const { border , width , color , isCustom } = borderV;
|
|
169
|
+
if (isCustom) {
|
|
170
|
+
return '';
|
|
171
|
+
}
|
|
172
|
+
return `${border ? `border-style: ${border};` : ''}
|
|
173
|
+
${width ? `border-width: ${width};` : undefined}
|
|
174
|
+
${color ? `border-color: ${getSingleColorVariable(color)};` : undefined}
|
|
175
|
+
`;
|
|
176
|
+
};
|
|
135
177
|
|
|
136
|
-
export { getBorderStyle, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor };
|
|
178
|
+
export { composeBorderCss, getBorderStyle, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn };
|
|
@@ -32,6 +32,18 @@ const getGlobalColorStateClass = (type, data)=>{
|
|
|
32
32
|
}
|
|
33
33
|
}).filter(isDefined).join(' ');
|
|
34
34
|
};
|
|
35
|
+
const getGlobalColorStateClassDynamicBtn = (type, data)=>{
|
|
36
|
+
if (!data) return '';
|
|
37
|
+
return Object.entries(data).map(([state, value])=>{
|
|
38
|
+
const clName = getGlobalColorClass(type, value);
|
|
39
|
+
if (!clName) return undefined;
|
|
40
|
+
if (state === 'normal') {
|
|
41
|
+
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${clName}`;
|
|
42
|
+
} else {
|
|
43
|
+
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${state}:${clName}`;
|
|
44
|
+
}
|
|
45
|
+
}).filter(isDefined).join(' ');
|
|
46
|
+
};
|
|
35
47
|
const getGlobalColorStateResponsiveClass = (type, data)=>{
|
|
36
48
|
if (!data) return '';
|
|
37
49
|
return Object.entries(data).map(([device, objectState])=>{
|
|
@@ -58,6 +70,32 @@ const getGlobalColorStateResponsiveClass = (type, data)=>{
|
|
|
58
70
|
}
|
|
59
71
|
}).filter(Boolean).join(' ');
|
|
60
72
|
};
|
|
73
|
+
const getGlobalColorStateResponsiveClassDynamicBtn = (type, data)=>{
|
|
74
|
+
if (!data) return '';
|
|
75
|
+
return Object.entries(data).map(([device, objectState])=>{
|
|
76
|
+
if (device === 'desktop') {
|
|
77
|
+
return Object.entries(objectState).map(([state, value])=>{
|
|
78
|
+
const clName = getGlobalColorClass(type, value);
|
|
79
|
+
if (!clName) return undefined;
|
|
80
|
+
if (state === 'normal') {
|
|
81
|
+
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${clName}`;
|
|
82
|
+
} else {
|
|
83
|
+
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${state}:${clName}`;
|
|
84
|
+
}
|
|
85
|
+
}).filter(isDefined).join(' ');
|
|
86
|
+
} else {
|
|
87
|
+
return Object.entries(objectState).map(([state, value])=>{
|
|
88
|
+
const clName = getGlobalColorClass(type, value);
|
|
89
|
+
if (!clName) return undefined;
|
|
90
|
+
if (state === 'normal') {
|
|
91
|
+
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${device}:${clName}`;
|
|
92
|
+
} else {
|
|
93
|
+
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${device}:${state}:${clName}`;
|
|
94
|
+
}
|
|
95
|
+
}).filter(isDefined).join(' ');
|
|
96
|
+
}
|
|
97
|
+
}).filter(Boolean).join(' ');
|
|
98
|
+
};
|
|
61
99
|
const getGlobalColorResponsiveStyle = (type, data)=>{
|
|
62
100
|
if (!data) return {};
|
|
63
101
|
return Object.fromEntries(Object.entries(data).map(([device, value])=>{
|
|
@@ -123,5 +161,8 @@ const getGlobalColorStyle = (data)=>{
|
|
|
123
161
|
'--c': getSingleColorVariable(data)
|
|
124
162
|
};
|
|
125
163
|
};
|
|
164
|
+
const composeTextColorCss = (color)=>{
|
|
165
|
+
return `${color ? `color: ${getSingleColorVariable(color)} !important;` : ''}`;
|
|
166
|
+
};
|
|
126
167
|
|
|
127
|
-
export { getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getSingleColorVariable, isColor };
|
|
168
|
+
export { composeTextColorCss, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getSingleColorVariable, isColor };
|
|
@@ -95,5 +95,33 @@ const getRadiusStyleActiveState = (radiusValue)=>{
|
|
|
95
95
|
}
|
|
96
96
|
return getRadiusCSSFromGlobal('normal', radiusValue?.active?.radiusType);
|
|
97
97
|
};
|
|
98
|
+
const composeCornerCss = (value)=>{
|
|
99
|
+
if (!value) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const { radiusType , bblr , bbrr , btlr , btrr } = value;
|
|
103
|
+
let radiusValue = undefined;
|
|
104
|
+
switch(radiusType){
|
|
105
|
+
case 'medium':
|
|
106
|
+
case 'large':
|
|
107
|
+
case 'small':
|
|
108
|
+
radiusValue = `border-radius: var(--g-radius-${radiusType});`;
|
|
109
|
+
break;
|
|
110
|
+
case 'circle':
|
|
111
|
+
case 'none':
|
|
112
|
+
case 'custom':
|
|
113
|
+
radiusValue = `
|
|
114
|
+
${bblr ? `border-bottom-left-radius: ${bblr};` : ''}
|
|
115
|
+
|
|
116
|
+
${bbrr ? `border-bottom-right-radius: ${bbrr};` : ''}
|
|
117
|
+
|
|
118
|
+
${btlr ? `border-top-left-radius: ${btlr};` : ''}
|
|
119
|
+
|
|
120
|
+
${btrr ? `border-top-right-radius: ${btrr};` : ''}
|
|
121
|
+
`;
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
return radiusValue;
|
|
125
|
+
};
|
|
98
126
|
|
|
99
|
-
export { composeRadius, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState };
|
|
127
|
+
export { composeCornerCss, composeRadius, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState };
|
|
@@ -41,5 +41,11 @@ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
|
|
|
41
41
|
}
|
|
42
42
|
return style;
|
|
43
43
|
};
|
|
44
|
+
const composeShadowCss = ({ hasBoxShadow , boxShadowValue })=>{
|
|
45
|
+
if (!hasBoxShadow) return undefined;
|
|
46
|
+
if (!boxShadowValue) return undefined;
|
|
47
|
+
const { value: distance , unit: unitDistance } = parseValueWithUnit(`${boxShadowValue?.distance}`);
|
|
48
|
+
return `box-shadow: ${Math.cos(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${boxShadowValue?.blur} ${boxShadowValue?.spread + ' '}${getSingleColorVariable(boxShadowValue?.color)};`;
|
|
49
|
+
};
|
|
44
50
|
|
|
45
|
-
export { getStyleShadow, getStyleShadowState };
|
|
51
|
+
export { composeShadowCss, getStyleShadow, getStyleShadowState, parseValueWithUnit };
|
package/dist/esm/helpers/size.js
CHANGED
|
@@ -13,5 +13,19 @@ function getCustomSizeCSSByDevice(size, device) {
|
|
|
13
13
|
const composeSize = (size)=>{
|
|
14
14
|
return Object.assign({}, getCustomSizeCSSByDevice(size, 'desktop'), getCustomSizeCSSByDevice(size, 'tablet'), getCustomSizeCSSByDevice(size, 'mobile'));
|
|
15
15
|
};
|
|
16
|
+
function genSizeClass(name) {
|
|
17
|
+
return `g-s-${name}`;
|
|
18
|
+
}
|
|
19
|
+
const composeSizeCss = (spacing)=>{
|
|
20
|
+
if (spacing === undefined) return '';
|
|
21
|
+
const size = spacing;
|
|
22
|
+
const sizeHozi = spacing?.custom?.desktop?.horizontal;
|
|
23
|
+
const sizeVerti = spacing?.custom?.desktop?.vertical;
|
|
24
|
+
if (!size?.custom) return undefined;
|
|
25
|
+
return `
|
|
26
|
+
${sizeHozi ? `padding-left: ${sizeHozi}; padding-right: ${sizeHozi};` : undefined}
|
|
27
|
+
${sizeVerti ? `padding-top: ${sizeVerti}; padding-bottom: ${sizeVerti};` : undefined}
|
|
28
|
+
`;
|
|
29
|
+
};
|
|
16
30
|
|
|
17
|
-
export { composeSize };
|
|
31
|
+
export { composeSize, composeSizeCss, genSizeClass };
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
const genTypoClass = (name)=>{
|
|
2
2
|
return `g-${name}`;
|
|
3
3
|
};
|
|
4
|
+
const composeTypographyCss = (typography)=>{
|
|
5
|
+
const typographyCustom = typography?.custom;
|
|
6
|
+
const { fontFamily , fontSize , fontStyle , fontWeight , lineHeight , letterSpacing } = typographyCustom?.desktop ?? {};
|
|
7
|
+
return `
|
|
8
|
+
${fontFamily ? `font-family: var(--g-font-${fontFamily}, ${fontFamily});` : ''}
|
|
9
|
+
${fontSize ? `font-size: ${fontSize};` : ''}
|
|
10
|
+
${fontStyle ? `font-style: ${fontStyle};` : ''}
|
|
11
|
+
${fontWeight ? `font-weight: ${fontWeight};` : ''}
|
|
12
|
+
${letterSpacing ? `letter-spacing: ${letterSpacing};` : ''}
|
|
13
|
+
${lineHeight ? `line-height: ${lineHeight};` : ''}
|
|
14
|
+
`;
|
|
15
|
+
};
|
|
4
16
|
|
|
5
|
-
export { genTypoClass };
|
|
17
|
+
export { composeTypographyCss, genTypoClass };
|
package/dist/esm/index.js
CHANGED
|
@@ -21,7 +21,7 @@ export { PublishedThemePagesDocument } from './graphql/queries/published-theme-p
|
|
|
21
21
|
export { ProductsDocument } from './graphql/queries/products.generated.js';
|
|
22
22
|
export { StorePropertyDocument } from './graphql/queries/store-property.generated.js';
|
|
23
23
|
export { PreviewPageDocument } from './graphql/queries/preview-page.generated.js';
|
|
24
|
-
export { getBorderStyle, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor } from './helpers/borders.js';
|
|
24
|
+
export { composeBorderCss, getBorderStyle, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn } from './helpers/borders.js';
|
|
25
25
|
export { cls } from './helpers/cls.js';
|
|
26
26
|
export { composeAdvanceStyle } from './helpers/compose-advance-style.js';
|
|
27
27
|
export { flattenConnection } from './helpers/flatten-connection.js';
|
|
@@ -33,18 +33,15 @@ export { isEmptyChildren } from './helpers/is-empty-children.js';
|
|
|
33
33
|
export { makeAspectRatio, makeHeight, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth } from './helpers/make-style.js';
|
|
34
34
|
export { normalizeBuilderData } from './helpers/normalize-builder-data.js';
|
|
35
35
|
export { prefetchQueries } from './helpers/prefetch-queries.js';
|
|
36
|
-
export { getStyleShadow, getStyleShadowState } from './helpers/shadow.js';
|
|
37
|
-
export { composeSize } from './helpers/size.js';
|
|
38
36
|
export { composeSpacing, getSpacingVariable } from './helpers/spacing.js';
|
|
39
37
|
export { loadScript } from './helpers/load-script.js';
|
|
40
38
|
export { validateEmail } from './helpers/email.js';
|
|
41
|
-
export { getStyleBackgroundByDevice } from './helpers/background.js';
|
|
42
39
|
export { genVariable } from './helpers/css-variable.js';
|
|
43
40
|
export { composeGridLayout, convertOldLayout, gridToArrayRegex, optionLayoutStyle } from './helpers/layout.js';
|
|
44
41
|
export { isDefined } from './helpers/is-defined.js';
|
|
45
|
-
export { getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getSingleColorVariable, isColor } from './helpers/colors.js';
|
|
46
|
-
export { genTypoClass } from './helpers/typography.js';
|
|
47
|
-
export { composeRadius, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState } from './helpers/radius.js';
|
|
42
|
+
export { composeTextColorCss, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getSingleColorVariable, isColor } from './helpers/colors.js';
|
|
43
|
+
export { composeTypographyCss, genTypoClass } from './helpers/typography.js';
|
|
44
|
+
export { composeCornerCss, composeRadius, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState } from './helpers/radius.js';
|
|
48
45
|
export { getSelectedVariant, parseSelectedOption } from './helpers/product.js';
|
|
49
46
|
import * as fpixel from './helpers/tracking/fpixel.js';
|
|
50
47
|
export { fpixel };
|
|
@@ -54,6 +51,9 @@ import * as tiktokpixel from './helpers/tracking/tiktokpixel.js';
|
|
|
54
51
|
export { tiktokpixel };
|
|
55
52
|
export { RenderIf, props, styles, template } from './helpers/render.js';
|
|
56
53
|
export { isLocalEnv } from './helpers/convert.js';
|
|
54
|
+
export { composeSize, composeSizeCss, genSizeClass } from './helpers/size.js';
|
|
55
|
+
export { composeShadowCss, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
|
|
56
|
+
export { composeBackgroundCss, getStyleBackgroundByDevice } from './helpers/background.js';
|
|
57
57
|
export { useAddToCart } from './hooks/cart/use-add-to-cart.js';
|
|
58
58
|
export { useCartData } from './hooks/cart/use-cart-data.js';
|
|
59
59
|
export { useCartDiscountCodesUpdate } from './hooks/cart/use-cart-discount-codes-update.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -126,6 +126,7 @@ type AlignItemProp = 'left' | 'center' | 'right';
|
|
|
126
126
|
type JudgeMeReviewsWidgetType = 'single_product_preview_badge' | 'review_widget' | 'reviews_carousel' | 'all_reviews_widget' | 'verified_reviews_count_badge' | 'all_reviews_text';
|
|
127
127
|
type LooxReviewsWidgetType = 'reviews_widget' | 'rating_widget' | 'carousel_widget';
|
|
128
128
|
type RyviuWidgetType = 'reviews' | 'badge' | 'badgeCollection' | 'carousel' | 'masonry';
|
|
129
|
+
type RivyoWidgetType = 'reviews' | 'badge' | 'testimonials' | 'allReviewsPage';
|
|
129
130
|
type KlaviyoWidgetType = 'popup_widget' | 'flyout_widget' | 'embed_widget' | 'full_page_widget';
|
|
130
131
|
type ObjectLayoutValue = {
|
|
131
132
|
display?: 'fill' | 'fit';
|
|
@@ -7294,6 +7295,8 @@ declare const handleConvertBorderStyle: (value?: BorderStyle) => {} | undefined;
|
|
|
7294
7295
|
declare const handleConvertBorderWidth: (value?: BorderStyle) => {} | undefined;
|
|
7295
7296
|
declare const handleConvertBorderColor: (value?: BorderStyle) => React.CSSProperties | undefined;
|
|
7296
7297
|
declare const handleConvertClassColor: (value?: BorderStyle) => string | undefined;
|
|
7298
|
+
declare const handleConvertClassColorDynamicBtn: (value?: BorderStyle) => string | undefined;
|
|
7299
|
+
declare const composeBorderCss: (borderV?: Border | undefined) => string;
|
|
7297
7300
|
|
|
7298
7301
|
type ClassValue = ClassDictionary | string | null | undefined;
|
|
7299
7302
|
interface ClassDictionary {
|
|
@@ -7348,13 +7351,6 @@ type Result = {
|
|
|
7348
7351
|
};
|
|
7349
7352
|
declare const prefetchQueries: (input: BuilderState, isSample?: boolean) => Result[];
|
|
7350
7353
|
|
|
7351
|
-
declare const getStyleShadow: (shadowStyle: ShadowStyle, isActiveState?: boolean) => {
|
|
7352
|
-
[x: string]: string;
|
|
7353
|
-
};
|
|
7354
|
-
declare const getStyleShadowState: (shadow?: StateProp<ShadowProps>, styleAppliedFor?: ShadowStyleApplied, isEnableShadow?: StateProp<boolean>) => React.CSSProperties;
|
|
7355
|
-
|
|
7356
|
-
declare const composeSize: (size?: ObjectDevices<SizeProps>) => React.CSSProperties;
|
|
7357
|
-
|
|
7358
7354
|
declare function getSpacingVariable(key?: SpacingType): string;
|
|
7359
7355
|
declare const composeSpacing: (spacingValue?: ObjectDevices<SpacingType>) => React.CSSProperties;
|
|
7360
7356
|
|
|
@@ -7365,11 +7361,6 @@ declare function loadScript(src: string, options?: {
|
|
|
7365
7361
|
|
|
7366
7362
|
declare const validateEmail: (email: string) => boolean;
|
|
7367
7363
|
|
|
7368
|
-
type Options = {
|
|
7369
|
-
liquid?: boolean;
|
|
7370
|
-
};
|
|
7371
|
-
declare const getStyleBackgroundByDevice: (background?: ObjectDevices<Background>, options?: Options) => {};
|
|
7372
|
-
|
|
7373
7364
|
declare const genVariable: (variableName: string) => string;
|
|
7374
7365
|
|
|
7375
7366
|
declare const gridToArrayRegex: RegExp;
|
|
@@ -7385,22 +7376,27 @@ declare const getGlobalColorCSSProp: (color?: ColorValueType) => string | undefi
|
|
|
7385
7376
|
declare const getGlobalColorClass: (type: ColorType, color?: ColorValueType) => string;
|
|
7386
7377
|
declare const getGlobalColorResponsiveClass: (type: ColorType, data?: ObjectDevices<ColorValueType>) => string;
|
|
7387
7378
|
declare const getGlobalColorStateClass: (type: ColorType, data?: StateProp<ColorValueType>) => string;
|
|
7379
|
+
declare const getGlobalColorStateClassDynamicBtn: (type: ColorType, data?: StateProp<ColorValueType>) => string;
|
|
7388
7380
|
declare const getGlobalColorStateResponsiveClass: (type: ColorType, data?: ResponsiveStateProp<ColorValueType>) => string;
|
|
7381
|
+
declare const getGlobalColorStateResponsiveClassDynamicBtn: (type: ColorType, data?: ResponsiveStateProp<ColorValueType>) => string;
|
|
7389
7382
|
declare const getGlobalColorResponsiveStyle: (type: ColorProp, data?: ObjectDevices<ColorValueType>) => React.CSSProperties;
|
|
7390
7383
|
declare const getGlobalColorStateStyle: (type: ColorProp, data?: StateProp<ColorValueType>) => React.CSSProperties;
|
|
7391
7384
|
declare const getGlobalColorStateResponsiveStyle: (type: ColorProp, data?: ResponsiveStateProp<ColorValueType>) => React.CSSProperties;
|
|
7392
7385
|
declare const getSingleColorVariable: (color?: ColorValueType) => string | undefined;
|
|
7393
7386
|
declare function isColor(color: string): boolean;
|
|
7394
7387
|
declare const getGlobalColorStyle: (data?: ColorValueType) => React.CSSProperties;
|
|
7388
|
+
declare const composeTextColorCss: (color?: ColorValueType) => string;
|
|
7395
7389
|
|
|
7396
7390
|
type TypographyClass = `g-${TypographyType}`;
|
|
7397
7391
|
declare const genTypoClass: (name: TypographyType) => TypographyClass;
|
|
7392
|
+
declare const composeTypographyCss: (typography: TypographySetting | undefined) => string;
|
|
7398
7393
|
|
|
7399
7394
|
declare const getCornerCSSFromGlobal: (corner: CornerRadius) => React.CSSProperties;
|
|
7400
7395
|
declare const getRadiusCSSFromGlobal: (state: StateType, key?: RoundedSize, device?: NameDevices) => React.CSSProperties;
|
|
7401
7396
|
declare const getCustomRadius: (state: StateType, radius?: CornerRadius, device?: NameDevices) => React.CSSProperties;
|
|
7402
7397
|
declare const composeRadius: (value?: StateProp<CornerRadius> | ResponsiveStateProp<CornerRadius>) => React.CSSProperties;
|
|
7403
7398
|
declare const getRadiusStyleActiveState: (radiusValue?: StateProp<CornerRadius>) => React.CSSProperties;
|
|
7399
|
+
declare const composeCornerCss: (value?: CornerRadius | undefined) => string | undefined;
|
|
7404
7400
|
|
|
7405
7401
|
declare function getSelectedVariant(variants?: Maybe<VariantSelectFragment>[], choices?: {
|
|
7406
7402
|
[key: string]: string;
|
|
@@ -7469,6 +7465,26 @@ declare const template: (strings: any, ...keys: any[]) => string;
|
|
|
7469
7465
|
|
|
7470
7466
|
declare const isLocalEnv: boolean;
|
|
7471
7467
|
|
|
7468
|
+
declare const composeSize: (size?: ObjectDevices<SizeProps>) => React.CSSProperties;
|
|
7469
|
+
declare function genSizeClass(name: string): string;
|
|
7470
|
+
declare const composeSizeCss: (spacing?: SizeSetting) => string | undefined;
|
|
7471
|
+
|
|
7472
|
+
declare const parseValueWithUnit: (valueWithUnit: string) => any;
|
|
7473
|
+
declare const getStyleShadow: (shadowStyle: ShadowStyle, isActiveState?: boolean) => {
|
|
7474
|
+
[x: string]: string;
|
|
7475
|
+
};
|
|
7476
|
+
declare const getStyleShadowState: (shadow?: StateProp<ShadowProps>, styleAppliedFor?: ShadowStyleApplied, isEnableShadow?: StateProp<boolean>) => React.CSSProperties;
|
|
7477
|
+
declare const composeShadowCss: ({ hasBoxShadow, boxShadowValue, }: {
|
|
7478
|
+
hasBoxShadow?: boolean | undefined;
|
|
7479
|
+
boxShadowValue?: ShadowProps | undefined;
|
|
7480
|
+
}) => string | undefined;
|
|
7481
|
+
|
|
7482
|
+
type Options = {
|
|
7483
|
+
liquid?: boolean;
|
|
7484
|
+
};
|
|
7485
|
+
declare const getStyleBackgroundByDevice: (background?: ObjectDevices<Background>, options?: Options) => {};
|
|
7486
|
+
declare const composeBackgroundCss: (backgroundColor?: ColorValueType) => string;
|
|
7487
|
+
|
|
7472
7488
|
type Func$6 = ReturnType<typeof addToCartOperation>;
|
|
7473
7489
|
type Response$6 = Awaited<ReturnType<Func$6>>;
|
|
7474
7490
|
type Args$7 = Parameters<Func$6>[0];
|
|
@@ -7704,4 +7720,4 @@ declare const fetchMedias: (fetcher: FetchFunc, { id, isSample, isStorefront }:
|
|
|
7704
7720
|
|
|
7705
7721
|
declare const getProductBySlug: (fetcher: FetchFunc, slug?: string) => Promise<ProductSelectFragment>;
|
|
7706
7722
|
|
|
7707
|
-
export { AddOn, AddonProvider, AddonProviderProps, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, Border, BorderStyle, BuilderComponentProvider, BuilderComponentProviderProps, BuilderEntity, BuilderEntityNested, BuilderPreviewProvider, BuilderPreviewProviderProps, BuilderProvider, BuilderProviderProps, BuilderState, Builtin, CartLineProvider, CartLineProviderProps, CollectionDetailFilterDocument, CollectionDetailFilterQueryResponse, CollectionDetailFilterQueryVariables, CollectionDocument, CollectionProvider, CollectionProviderProps, CollectionQueryResponse, CollectionQueryVariables, CollectionsDocument, CollectionsQueryResponse, CollectionsQueryVariables, ColorKey, ColorType$1 as ColorType, ColorValueType, Component, ComponentSetting, ContainerProp, ControlProp, ControlUI, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, ExtractState, FetchFunc, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, InitComponentType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OptionNormalStyle, OptionSpecialStyle, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductReviewsWidgetType, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, RenderMemo as Render, RenderIf, Render as RenderLiquid, RenderMode, RenderPreviewMemo as RenderPreview, RequiredCursorEdge, ResponsiveStateProp, RoundedSize, RyviuWidgetType, SectionData, SectionEntity, SectionProvider, SectionProviderProps, ShadowProps, ShadowStyle, ShadowStyleApplied, ShadowType, ShopProvider, ShopProviderProps, shop as ShopType, SizeProps, SizeSetting, SizeType, SpacingType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TransformProp, TypographyProps, TypographySetting, TypographyType, VariantSelectFragment, calculateFirstProduct, cls, composeAdvanceStyle, composeGridLayout, composeRadius, composeSize, composeSpacing, convertOldLayout, fetchMedias, fetchVariants, flattenConnection, fpixel, genTypoClass, genVariable, getBorderStyle, getCollection, getCornerCSSFromGlobal, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, globalEvent, gridToArrayRegex, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, isBrowser, isColor, isDefined, isEmptyChildren, isLocalEnv, loadScript, makeAspectRatio, makeHeight, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, prefetchQueries, props, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCheckoutUrl, useCollection, useCollectionQuery, useCollectionStore, useCollectionsQuery, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useIsSampleProduct, useIsStorefrontProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, 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 };
|
|
7723
|
+
export { AddOn, AddonProvider, AddonProviderProps, AlignItemProp, AlignProp, Background, BaseProps, BasePropsWrap, BlockEntity, 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, ComponentSetting, ContainerProp, ControlProp, ControlUI, CornerRadius, CornerRadiusType, CustomComponentConfig, DeepPartial, ExtractState, FetchFunc, FlexDirectionProp, FontName, GlobalStyleConfig, GlobalStyleResponsiveConfig, GlobalSwatchesData, GraphQLConnection, GroupPropType, HSLAColorType, HSLColorType, HexColorType, InitComponentType, JudgeMeReviewsWidgetType, KlaviyoWidgetType, LooxReviewsWidgetType, ModalProvider, ModalProviderProps, NameDevices, NestedKeys, ObjectDeviceGlobalType, ObjectDevices, ObjectLayoutValue, OptionNormalStyle, OptionSpecialStyle, PageViewUpDocument, PageViewUpMutationResponse, PageViewUpMutationVariables, PreviewPageDocument, PreviewPageQueryResponse, PreviewPageQueryVariables, Primitive, ProductInputAnalytic, ProductListProvider, ProductListProviderProps, ProductProvider, ProductProviderProps, ProductReviewsWidgetType, ProductSelectFragment, ProductsDocument, ProductsQueryResponse, ProductsQueryVariables, PublishedThemePageSelectFragment, PublishedThemePagesDocument, PublishedThemePagesQueryResponse, PublishedThemePagesQueryVariables, RGBAColorType, RGBColorType, RenderMemo as Render, 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, SizeType, SpacingType, StateProp, StateSelector, StateType, StoreConfig, StorePropertyDocument, StorePropertyQueryResponse, StorePropertyQueryVariables, SwatchesOptionType, SwatchesOptionValue, TransformProp, TypographyProps, TypographySetting, TypographyType, VariantSelectFragment, calculateFirstProduct, cls, composeAdvanceStyle, composeBackgroundCss, composeBorderCss, composeCornerCss, composeGridLayout, composeRadius, composeShadowCss, composeSize, composeSizeCss, composeSpacing, composeTextColorCss, composeTypographyCss, convertOldLayout, fetchMedias, fetchVariants, flattenConnection, fpixel, genSizeClass, genTypoClass, genVariable, getBorderStyle, getCollection, getCornerCSSFromGlobal, getCustomRadius, getGlobalColorCSSProp, getGlobalColorClass, getGlobalColorResponsiveClass, getGlobalColorResponsiveStyle, getGlobalColorStateClass, getGlobalColorStateClassDynamicBtn, getGlobalColorStateResponsiveClass, getGlobalColorStateResponsiveClassDynamicBtn, getGlobalColorStateResponsiveStyle, getGlobalColorStateStyle, getGlobalColorStyle, getProduct, getProductBySlug, getRadiusCSSFromGlobal, getRadiusStyleActiveState, getResponsiveStateValue, getResponsiveValue, getResponsiveValueByScreen, getSelectedVariant, getShortName, getSingleColorVariable, getSpacingVariable, getStyleBackgroundByDevice, getStyleShadow, getStyleShadowState, globalEvent, gridToArrayRegex, gtag, handleConvertBorderColor, handleConvertBorderStyle, handleConvertBorderWidth, handleConvertClassColor, handleConvertClassColorDynamicBtn, isBrowser, isColor, isDefined, isEmptyChildren, isLocalEnv, loadScript, makeAspectRatio, makeHeight, makeStyle, makeStyleResponsive, makeStyleResponsiveState, makeStyleState, makeWidth, normalizeBuilderData, optionLayoutStyle, parseSelectedOption, parseValueWithUnit, prefetchQueries, props, styles, template, tiktokpixel, useAddToCart, useAddon, useAddons, useBuilderComponent, useBuilderPreviewStore, useBuilderStore, useCartData, useCartDiscountCodesUpdate, useCartId, useCartLine, useCartLineStore, useCartNoteUpdate, useCartUI, useCheckoutUrl, useCollection, useCollectionQuery, useCollectionStore, useCollectionsQuery, useConnectedShopify, useCreateCart, useCurrency, useCurrentDevice, useCurrentVariant, useCurrentVariantInStock, useEditorMode, useFeaturedImageGlobal, useFormatMoney, useIsSampleProduct, useIsStorefrontProduct, useIsomorphicLayoutEffect, useLazyVideo, useLoadScript, useLocale, useMatchMutate, useMobileOnly, useModalStore, useMoney, 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 };
|