@gem-sdk/core 1.22.0-hotfix.2 → 1.22.0-hotfix.5
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/ComponentWrapperPreview.js +2 -1
- package/dist/cjs/components/Render.liquid.js +8 -2
- package/dist/cjs/helpers/compose-advance-style.js +1 -0
- package/dist/esm/components/ComponentWrapperPreview.js +2 -1
- package/dist/esm/components/Render.liquid.js +8 -2
- package/dist/esm/helpers/compose-advance-style.js +1 -0
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -61,6 +61,7 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
61
61
|
advanced: advanced
|
|
62
62
|
}),
|
|
63
63
|
/*#__PURE__*/ jsxRuntime.jsx(children.type, {
|
|
64
|
+
className: advanced?.cssClass,
|
|
64
65
|
...children.props,
|
|
65
66
|
style,
|
|
66
67
|
builderAttrs,
|
|
@@ -78,7 +79,7 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
78
79
|
}),
|
|
79
80
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
80
81
|
style: style,
|
|
81
|
-
className: `${props.uid}`,
|
|
82
|
+
className: `${props.uid} ${props.advanced?.cssClass ? props.advanced?.cssClass : ''}`,
|
|
82
83
|
...builderAttrs,
|
|
83
84
|
children: children
|
|
84
85
|
})
|
|
@@ -101,6 +101,9 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, ...passPr
|
|
|
101
101
|
},
|
|
102
102
|
styles: item.styles,
|
|
103
103
|
setting: item.settings,
|
|
104
|
+
advanced: {
|
|
105
|
+
cssClass: item?.advanced?.cssClass
|
|
106
|
+
},
|
|
104
107
|
...passProps,
|
|
105
108
|
rawChildren: item.childrens.map((id)=>{
|
|
106
109
|
return {
|
|
@@ -130,6 +133,9 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, ...passPr
|
|
|
130
133
|
},
|
|
131
134
|
styles: item.styles,
|
|
132
135
|
setting: item.settings,
|
|
136
|
+
advanced: {
|
|
137
|
+
cssClass: item?.advanced?.cssClass
|
|
138
|
+
},
|
|
133
139
|
isText: componentTexts.includes(item.tag) ? true : null,
|
|
134
140
|
...passProps
|
|
135
141
|
});
|
|
@@ -183,7 +189,7 @@ const RenderChildren = (props)=>{
|
|
|
183
189
|
if (Math.ceil(size / 1024) >= 180) {
|
|
184
190
|
const fileName = `gp-section-snippet-${props.uid}`;
|
|
185
191
|
props.customProps.extraFiles[fileName] = data.liquid;
|
|
186
|
-
return `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id %}`;
|
|
192
|
+
return `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id, productSelectedVariant: productSelectedVariant %}`;
|
|
187
193
|
}
|
|
188
194
|
return data.liquid;
|
|
189
195
|
};
|
|
@@ -200,7 +206,7 @@ const WrapRenderChildren = ({ uid, customProps }, codes)=>{
|
|
|
200
206
|
if (Math.ceil(size / 1024) >= 180) {
|
|
201
207
|
const fileName = `gp-section-snippet-${uid + i}`;
|
|
202
208
|
customProps.extraFiles[fileName] = code;
|
|
203
|
-
liquid += `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id %}`;
|
|
209
|
+
liquid += `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id, productSelectedVariant: productSelectedVariant %}`;
|
|
204
210
|
} else {
|
|
205
211
|
liquid += code;
|
|
206
212
|
}
|
|
@@ -58,6 +58,7 @@ function composeAdvanceStyle(data, tag) {
|
|
|
58
58
|
];
|
|
59
59
|
Object.keys(data).forEach((attr)=>{
|
|
60
60
|
const value = data[attr];
|
|
61
|
+
if (attr === 'cssClass') return;
|
|
61
62
|
if (value === undefined || value === null) return;
|
|
62
63
|
const hasBoxShadow = data.hasBoxShadow ? data.hasBoxShadow : {};
|
|
63
64
|
if (typeof value === 'object') {
|
|
@@ -57,6 +57,7 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
57
57
|
advanced: advanced
|
|
58
58
|
}),
|
|
59
59
|
/*#__PURE__*/ jsx(children.type, {
|
|
60
|
+
className: advanced?.cssClass,
|
|
60
61
|
...children.props,
|
|
61
62
|
style,
|
|
62
63
|
builderAttrs,
|
|
@@ -74,7 +75,7 @@ const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
|
74
75
|
}),
|
|
75
76
|
/*#__PURE__*/ jsx("div", {
|
|
76
77
|
style: style,
|
|
77
|
-
className: `${props.uid}`,
|
|
78
|
+
className: `${props.uid} ${props.advanced?.cssClass ? props.advanced?.cssClass : ''}`,
|
|
78
79
|
...builderAttrs,
|
|
79
80
|
children: children
|
|
80
81
|
})
|
|
@@ -97,6 +97,9 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, ...passPr
|
|
|
97
97
|
},
|
|
98
98
|
styles: item.styles,
|
|
99
99
|
setting: item.settings,
|
|
100
|
+
advanced: {
|
|
101
|
+
cssClass: item?.advanced?.cssClass
|
|
102
|
+
},
|
|
100
103
|
...passProps,
|
|
101
104
|
rawChildren: item.childrens.map((id)=>{
|
|
102
105
|
return {
|
|
@@ -126,6 +129,9 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, ...passPr
|
|
|
126
129
|
},
|
|
127
130
|
styles: item.styles,
|
|
128
131
|
setting: item.settings,
|
|
132
|
+
advanced: {
|
|
133
|
+
cssClass: item?.advanced?.cssClass
|
|
134
|
+
},
|
|
129
135
|
isText: componentTexts.includes(item.tag) ? true : null,
|
|
130
136
|
...passProps
|
|
131
137
|
});
|
|
@@ -179,7 +185,7 @@ const RenderChildren = (props)=>{
|
|
|
179
185
|
if (Math.ceil(size / 1024) >= 180) {
|
|
180
186
|
const fileName = `gp-section-snippet-${props.uid}`;
|
|
181
187
|
props.customProps.extraFiles[fileName] = data.liquid;
|
|
182
|
-
return `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id %}`;
|
|
188
|
+
return `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id, productSelectedVariant: productSelectedVariant %}`;
|
|
183
189
|
}
|
|
184
190
|
return data.liquid;
|
|
185
191
|
};
|
|
@@ -196,7 +202,7 @@ const WrapRenderChildren = ({ uid, customProps }, codes)=>{
|
|
|
196
202
|
if (Math.ceil(size / 1024) >= 180) {
|
|
197
203
|
const fileName = `gp-section-snippet-${uid + i}`;
|
|
198
204
|
customProps.extraFiles[fileName] = code;
|
|
199
|
-
liquid += `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id %}`;
|
|
205
|
+
liquid += `{% render '${fileName}', product: product, variant: variant, product_form_id: product_form_id, productSelectedVariant: productSelectedVariant %}`;
|
|
200
206
|
} else {
|
|
201
207
|
liquid += code;
|
|
202
208
|
}
|
|
@@ -56,6 +56,7 @@ function composeAdvanceStyle(data, tag) {
|
|
|
56
56
|
];
|
|
57
57
|
Object.keys(data).forEach((attr)=>{
|
|
58
58
|
const value = data[attr];
|
|
59
|
+
if (attr === 'cssClass') return;
|
|
59
60
|
if (value === undefined || value === null) return;
|
|
60
61
|
const hasBoxShadow = data.hasBoxShadow ? data.hasBoxShadow : {};
|
|
61
62
|
if (typeof value === 'object') {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -107,7 +107,7 @@ type Ratio$1 = {
|
|
|
107
107
|
};
|
|
108
108
|
type FlexDirectionProp = 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
109
109
|
type TransformProp = 'default' | 'capitalize' | 'uppercase' | 'lowercase' | 'none';
|
|
110
|
-
type BaseProps<Setting = unknown, Style = unknown, Advanced =
|
|
110
|
+
type BaseProps<Setting = unknown, Style = unknown, Advanced = Record<string, any>> = {
|
|
111
111
|
builderProps?: {
|
|
112
112
|
/** Unique id of component */
|
|
113
113
|
uid?: string;
|
|
@@ -117,7 +117,7 @@ type BaseProps<Setting = unknown, Style = unknown, Advanced = unknown> = {
|
|
|
117
117
|
setting?: Setting;
|
|
118
118
|
advanced?: Advanced;
|
|
119
119
|
};
|
|
120
|
-
type BasePropsWrap<S = unknown, Style = unknown, A =
|
|
120
|
+
type BasePropsWrap<S = unknown, Style = unknown, A = Record<string, any>> = BaseProps<S, Style, A> & {
|
|
121
121
|
builderAttrs?: Record<string, any>;
|
|
122
122
|
style?: React.CSSProperties;
|
|
123
123
|
};
|