@gem-sdk/components 2.0.0-dev.559 → 2.0.0-dev.561
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/article/components/ArticleList.js +1 -1
- package/dist/cjs/article/setting/ArticleList.js +1 -1
- package/dist/cjs/article/setting/configs/ArticleImage/uiV2.js +32 -10
- package/dist/cjs/article/setting/configs/ArticleList/uiV2.js +9 -0
- package/dist/cjs/collection/components/collection-description/common/classes.js +5 -1
- package/dist/cjs/collection/components/collection-description/common/styles.js +0 -4
- package/dist/cjs/collection/components/collection-description/components/CollectionDescription.js +10 -1
- package/dist/cjs/collection/components/collection-description/components/CollectionDescription.liquid.js +3 -4
- package/dist/cjs/collection/components/collection-paginator/common/index.js +2 -2
- package/dist/cjs/collection/components/collection-paginator/common/styles.js +2 -1
- package/dist/cjs/collection/components/collection-paginator/components/CollectionPaginator.js +6 -4
- package/dist/cjs/collection/components/collection-paginator/components/CollectionPaginator.liquid.js +4 -2
- package/dist/cjs/collection/setting/collection-toolbar/configs/uiV2.js +2 -0
- package/dist/cjs/product/components/ProductDescription/common/getClasses.js +4 -0
- package/dist/cjs/product/components/ProductDescription/index.js +4 -0
- package/dist/cjs/product/components/ProductDescription/index.liquid.js +2 -0
- package/dist/cjs/stock-counter/components/StockCounter.js +3 -3
- package/dist/cjs/stock-counter/components/common/getClasses.js +2 -1
- package/dist/cjs/stock-counter/components/common/getStyles.js +1 -1
- package/dist/cjs/stock-counter/components/hook/useStockCounter.js +6 -1
- package/dist/esm/article/components/ArticleList.js +1 -1
- package/dist/esm/article/setting/ArticleList.js +1 -1
- package/dist/esm/article/setting/configs/ArticleImage/uiV2.js +32 -10
- package/dist/esm/article/setting/configs/ArticleList/uiV2.js +9 -0
- package/dist/esm/collection/components/collection-description/common/classes.js +5 -2
- package/dist/esm/collection/components/collection-description/common/styles.js +1 -4
- package/dist/esm/collection/components/collection-description/components/CollectionDescription.js +11 -2
- package/dist/esm/collection/components/collection-description/components/CollectionDescription.liquid.js +5 -6
- package/dist/esm/collection/components/collection-paginator/common/index.js +2 -2
- package/dist/esm/collection/components/collection-paginator/common/styles.js +2 -1
- package/dist/esm/collection/components/collection-paginator/components/CollectionPaginator.js +6 -4
- package/dist/esm/collection/components/collection-paginator/components/CollectionPaginator.liquid.js +4 -2
- package/dist/esm/collection/setting/collection-toolbar/configs/uiV2.js +2 -0
- package/dist/esm/product/components/ProductDescription/common/getClasses.js +5 -2
- package/dist/esm/product/components/ProductDescription/index.js +5 -1
- package/dist/esm/product/components/ProductDescription/index.liquid.js +3 -1
- package/dist/esm/stock-counter/components/StockCounter.js +3 -3
- package/dist/esm/stock-counter/components/common/getClasses.js +2 -1
- package/dist/esm/stock-counter/components/common/getStyles.js +1 -1
- package/dist/esm/stock-counter/components/hook/useStockCounter.js +6 -1
- package/package.json +2 -2
|
@@ -159,22 +159,44 @@ const uiV2 = [
|
|
|
159
159
|
},
|
|
160
160
|
controls: [
|
|
161
161
|
{
|
|
162
|
-
type: '
|
|
163
|
-
setting: {
|
|
164
|
-
id: 'alt'
|
|
165
|
-
},
|
|
162
|
+
type: 'combo',
|
|
166
163
|
label: {
|
|
167
164
|
en: 'Alt text'
|
|
168
|
-
}
|
|
165
|
+
},
|
|
166
|
+
iconName: 'polaris-text-block',
|
|
167
|
+
getValueFromSettingID: 'alt',
|
|
168
|
+
isHideClear: true,
|
|
169
|
+
controls: [
|
|
170
|
+
{
|
|
171
|
+
label: {
|
|
172
|
+
en: 'Content'
|
|
173
|
+
},
|
|
174
|
+
setting: {
|
|
175
|
+
id: 'alt'
|
|
176
|
+
},
|
|
177
|
+
layout: 'vertical'
|
|
178
|
+
}
|
|
179
|
+
]
|
|
169
180
|
},
|
|
170
181
|
{
|
|
171
|
-
type: '
|
|
172
|
-
setting: {
|
|
173
|
-
id: 'title'
|
|
174
|
-
},
|
|
182
|
+
type: 'combo',
|
|
175
183
|
label: {
|
|
176
184
|
en: 'Image title'
|
|
177
|
-
}
|
|
185
|
+
},
|
|
186
|
+
iconName: 'polaris-text-block',
|
|
187
|
+
getValueFromSettingID: 'title',
|
|
188
|
+
isHideClear: true,
|
|
189
|
+
controls: [
|
|
190
|
+
{
|
|
191
|
+
label: {
|
|
192
|
+
en: 'Content'
|
|
193
|
+
},
|
|
194
|
+
setting: {
|
|
195
|
+
id: 'title'
|
|
196
|
+
},
|
|
197
|
+
layout: 'vertical'
|
|
198
|
+
}
|
|
199
|
+
]
|
|
178
200
|
}
|
|
179
201
|
]
|
|
180
202
|
},
|
|
@@ -26,6 +26,15 @@ const uiV2 = [
|
|
|
26
26
|
setting: {
|
|
27
27
|
id: 'slideToShow'
|
|
28
28
|
}
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: {
|
|
32
|
+
en: 'Sort by'
|
|
33
|
+
},
|
|
34
|
+
conditionDisplay: 'articleSetting && articleSetting.articlePickType !== "manually"',
|
|
35
|
+
setting: {
|
|
36
|
+
id: 'articleOrderBy'
|
|
37
|
+
}
|
|
29
38
|
}
|
|
30
39
|
]
|
|
31
40
|
},
|
|
@@ -4,7 +4,7 @@ var core = require('@gem-sdk/core');
|
|
|
4
4
|
|
|
5
5
|
const getClassContainerCollectionDes = ({ setting })=>{
|
|
6
6
|
const appendTypoClass = core.composeTypographyClassName(setting?.typo, setting?.typography);
|
|
7
|
-
return composeClasses(core.cls('gp-p-description-text gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre', appendTypoClass, core.getGlobalColorClass('text', setting?.color), "data-[browser=safari]:after:gp-content-[' '] data-[browser=safari]:after:gp-absolute data-[browser=safari]:after:gp-left-0 data-[browser=safari]:after:gp-right-0 data-[browser=safari]:after:gp-bottom-0 data-[browser=safari]:after:gp-w-full data-[browser=safari]:after:gp-h-1/2 data-[browser=safari]:after:gp-bg-gradient-to-t data-[browser=safari]:after:gp-from-white"));
|
|
7
|
+
return composeClasses(core.cls('gp-relative p-description-wrapper gp-p-description-text gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre', appendTypoClass, core.getGlobalColorClass('text', setting?.color), "data-[browser=safari]:after:gp-content-[' '] data-[browser=safari]:after:gp-absolute data-[browser=safari]:after:gp-left-0 data-[browser=safari]:after:gp-right-0 data-[browser=safari]:after:gp-bottom-0 data-[browser=safari]:after:gp-w-full data-[browser=safari]:after:gp-h-1/2 data-[browser=safari]:after:gp-bg-gradient-to-t data-[browser=safari]:after:gp-from-white"));
|
|
8
8
|
};
|
|
9
9
|
const getClassButtonViewMore = ({ setting })=>{
|
|
10
10
|
const appendTypoClass = core.composeTypographyClassName(setting?.typo, setting?.typography);
|
|
@@ -19,6 +19,9 @@ const getShowMoreIconClasses = ()=>{
|
|
|
19
19
|
const getShowMoreTextClasses = ()=>{
|
|
20
20
|
return composeClasses(core.cls('gp-show-more-text'));
|
|
21
21
|
};
|
|
22
|
+
const getClassPreBuilt = ()=>{
|
|
23
|
+
return composeClasses(core.cls('gp-rotate-180 gp-hidden'));
|
|
24
|
+
};
|
|
22
25
|
const composeClasses = (classes)=>{
|
|
23
26
|
return classes.trim().split(/\s+/).reduce((acc, className)=>{
|
|
24
27
|
acc[className] = true;
|
|
@@ -28,6 +31,7 @@ const composeClasses = (classes)=>{
|
|
|
28
31
|
|
|
29
32
|
exports.getClassButtonViewMore = getClassButtonViewMore;
|
|
30
33
|
exports.getClassContainerCollectionDes = getClassContainerCollectionDes;
|
|
34
|
+
exports.getClassPreBuilt = getClassPreBuilt;
|
|
31
35
|
exports.getDescriptionClasses = getDescriptionClasses;
|
|
32
36
|
exports.getShowMoreIconClasses = getShowMoreIconClasses;
|
|
33
37
|
exports.getShowMoreTextClasses = getShowMoreTextClasses;
|
|
@@ -59,9 +59,6 @@ const getStyleDefaultViewMore = (setting)=>{
|
|
|
59
59
|
...getDisplayCollapse()
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
const getDisplayCollapse = (setting)=>{
|
|
63
|
-
return helpers.getDisplayStyle((device)=>!!setting?.hasLineClamp && setting.hasLineClamp[device] !== undefined && !setting.hasLineClamp[device], 'block');
|
|
64
|
-
};
|
|
65
62
|
const getStaticCss = ()=>{
|
|
66
63
|
const gpDescriptionCss = `
|
|
67
64
|
.gp-p-description-text > *:not(ol):not(ul):not(table):not(div):not(style):not(script) {
|
|
@@ -87,7 +84,6 @@ const getStaticCss = ()=>{
|
|
|
87
84
|
};
|
|
88
85
|
|
|
89
86
|
exports.getDefaultStyleCollectionDes = getDefaultStyleCollectionDes;
|
|
90
|
-
exports.getDisplayCollapse = getDisplayCollapse;
|
|
91
87
|
exports.getMaxHeightStyleDefault = getMaxHeightStyleDefault;
|
|
92
88
|
exports.getStaticCss = getStaticCss;
|
|
93
89
|
exports.getStyleDefaultViewMore = getStyleDefaultViewMore;
|
package/dist/cjs/collection/components/collection-description/components/CollectionDescription.js
CHANGED
|
@@ -25,8 +25,14 @@ const CollectionDescription = ({ setting, builderProps, pageContext, advanced })
|
|
|
25
25
|
const gpDescriptionClasses = system.createClass(classes.getDescriptionClasses({
|
|
26
26
|
advanced
|
|
27
27
|
}));
|
|
28
|
-
const showMoreIconClasses = system.createClass(
|
|
28
|
+
const showMoreIconClasses = system.createClass({
|
|
29
|
+
...classes.getShowMoreIconClasses(),
|
|
30
|
+
...open ? {
|
|
31
|
+
'gp-rotate-180': true
|
|
32
|
+
} : {}
|
|
33
|
+
});
|
|
29
34
|
const showMoreTextClasses = system.createClass(classes.getShowMoreTextClasses());
|
|
35
|
+
const classPreBuilt = system.createClass(classes.getClassPreBuilt());
|
|
30
36
|
const textStyle = system.createStyle({
|
|
31
37
|
...styles.getDefaultStyleCollectionDes({
|
|
32
38
|
setting
|
|
@@ -66,6 +72,9 @@ const CollectionDescription = ({ setting, builderProps, pageContext, advanced })
|
|
|
66
72
|
system.If(!core.isSafari(), /*#__PURE__*/ jsxRuntime.jsx("style", {
|
|
67
73
|
children: gpDescriptionCss
|
|
68
74
|
}), ''),
|
|
75
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
76
|
+
className: classPreBuilt
|
|
77
|
+
}),
|
|
69
78
|
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
70
79
|
ref: ref,
|
|
71
80
|
className: classContainerCollectionDes,
|
|
@@ -23,6 +23,7 @@ const CollectionDescription = ({ setting, advanced, builderProps, pageContext })
|
|
|
23
23
|
}));
|
|
24
24
|
const showMoreIconClasses = system.createClass(classes.getShowMoreIconClasses());
|
|
25
25
|
const showMoreTextClasses = system.createClass(classes.getShowMoreTextClasses());
|
|
26
|
+
const classPreBuilt = system.createClass(classes.getClassPreBuilt());
|
|
26
27
|
const textStyle = system.createStyle({
|
|
27
28
|
...styles.getDefaultStyleCollectionDes({
|
|
28
29
|
setting,
|
|
@@ -31,10 +32,7 @@ const CollectionDescription = ({ setting, advanced, builderProps, pageContext })
|
|
|
31
32
|
...core.makeStyleResponsive('line-clamp', core.makeLineClamp(setting?.lineClamp, setting?.hasLineClamp))
|
|
32
33
|
});
|
|
33
34
|
const styleViewMore = system.createStyle({
|
|
34
|
-
...styles.getStyleDefaultViewMore(setting)
|
|
35
|
-
...styles.getDisplayCollapse(setting),
|
|
36
|
-
position: 'absolute',
|
|
37
|
-
visibility: 'hidden'
|
|
35
|
+
...styles.getStyleDefaultViewMore(setting)
|
|
38
36
|
});
|
|
39
37
|
const viewLessText = index.getViewLessText({
|
|
40
38
|
setting,
|
|
@@ -79,6 +77,7 @@ const CollectionDescription = ({ setting, advanced, builderProps, pageContext })
|
|
|
79
77
|
>
|
|
80
78
|
<style>${textDescriptionCss}</style>
|
|
81
79
|
${system.If(!core.isSafari(), `<style>${gpDescriptionCss}</style>`, ' ')}
|
|
80
|
+
<div class="${classPreBuilt}" ></div>
|
|
82
81
|
${system.LiquidUnless('collection', `<p>Collection not found</p>`, core.template`<div ${textAttr} class="${classContainerCollectionDes}" style="${textStyle}">
|
|
83
82
|
{{collection.description}}
|
|
84
83
|
</div>
|
|
@@ -36,8 +36,8 @@ const renderPaginatorLive = ({ setting, builderProps, pageContext })=>{
|
|
|
36
36
|
const limit = numberOfProductOfProductList > 0 ? numberOfProductOfProductList : 4;
|
|
37
37
|
return `
|
|
38
38
|
{% paginate collection.products by ${limit} %}
|
|
39
|
-
{% assign previousText = ${pageContext?.isPreviewing ? `${previousTextVal}` : previousTextVal} %}
|
|
40
|
-
{% assign nextText = ${pageContext?.isPreviewing ? `${nextTextVal}` : nextTextVal} %}
|
|
39
|
+
{% assign previousText = ${pageContext?.isPreviewing ? `${previousTextVal}` : previousTextVal || `""`} %}
|
|
40
|
+
{% assign nextText = ${pageContext?.isPreviewing ? `${nextTextVal}` : nextTextVal || `""`} %}
|
|
41
41
|
{{ paginate | default_pagination: previous: previousText, next: nextText }}
|
|
42
42
|
{% endpaginate %}
|
|
43
43
|
`;
|
|
@@ -12,8 +12,9 @@ const getPaginatorStyle = (isActive, customStyle, activeColor)=>({
|
|
|
12
12
|
} : {}
|
|
13
13
|
});
|
|
14
14
|
const getCustomStyle = (setting)=>{
|
|
15
|
-
const { typo,
|
|
15
|
+
const { typo, layout, typographyPaginator, itemSpacing, buttonSizeNumber, buttonShape } = setting ?? {};
|
|
16
16
|
const appendTypoStyle = core.composeTypographyStyle(typo, typographyPaginator);
|
|
17
|
+
const normalColor = typo?.attrs?.color;
|
|
17
18
|
let customStyle = core.composeMemo(()=>{
|
|
18
19
|
return core.removeNullUndefined({
|
|
19
20
|
...appendTypoStyle,
|
package/dist/cjs/collection/components/collection-paginator/components/CollectionPaginator.js
CHANGED
|
@@ -30,11 +30,13 @@ const CollectionPaginator = ({ setting, builderProps })=>{
|
|
|
30
30
|
});
|
|
31
31
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
32
32
|
id: builderProps?.uid,
|
|
33
|
-
className: classPaginator,
|
|
34
|
-
style: stylePaginator,
|
|
35
33
|
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
36
|
-
className:
|
|
37
|
-
|
|
34
|
+
className: classPaginator,
|
|
35
|
+
style: stylePaginator,
|
|
36
|
+
children: /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
37
|
+
className: classPaginatorWrapper,
|
|
38
|
+
children: paginatorItems
|
|
39
|
+
})
|
|
38
40
|
})
|
|
39
41
|
});
|
|
40
42
|
};
|
package/dist/cjs/collection/components/collection-paginator/components/CollectionPaginator.liquid.js
CHANGED
|
@@ -47,8 +47,10 @@ const CollectionPaginator = ({ setting, builderProps, pageContext })=>{
|
|
|
47
47
|
uid: builderProps?.uid
|
|
48
48
|
});
|
|
49
49
|
return core.template`
|
|
50
|
-
<gp-collection-paginator gp-data='${JSON.stringify(stateData).replaceAll("'", ''')}' id="${builderProps?.uid}"
|
|
51
|
-
<div class="${
|
|
50
|
+
<gp-collection-paginator gp-data='${JSON.stringify(stateData).replaceAll("'", ''')}' id="${builderProps?.uid}" >
|
|
51
|
+
<div class="${classPaginator}" style="${stylePaginator}">
|
|
52
|
+
<div class="${classPaginatorWrapper}">${paginatorItem}</div>
|
|
53
|
+
</div>
|
|
52
54
|
</gp-collection-paginator>
|
|
53
55
|
${core.RenderIf(core.isLocalEnv, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-collection-paginator.js' | asset_url }}" defer="defer"></script>`, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${core.baseAssetURL}/assets-v2/gp-collection-paginator.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
54
56
|
`;
|
|
@@ -13,6 +13,7 @@ const SettingUIV2 = [
|
|
|
13
13
|
},
|
|
14
14
|
iconName: 'polaris-text-block',
|
|
15
15
|
getValueFromSettingID: 'sortingTextDisplay',
|
|
16
|
+
isHideClear: true,
|
|
16
17
|
controls: [
|
|
17
18
|
{
|
|
18
19
|
label: {
|
|
@@ -53,6 +54,7 @@ const SettingUIV2 = [
|
|
|
53
54
|
},
|
|
54
55
|
iconName: 'polaris-text-block',
|
|
55
56
|
getValueFromSettingID: 'quantityTextDisplay',
|
|
57
|
+
isHideClear: true,
|
|
56
58
|
controls: [
|
|
57
59
|
{
|
|
58
60
|
label: {
|
|
@@ -25,6 +25,10 @@ const getButtonClasses = ({ setting })=>{
|
|
|
25
25
|
[globalColorClass]: true
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
+
const getClassPreBuilt = ()=>{
|
|
29
|
+
return core.composeClasses(core.cls('gp-rotate-180 gp-hidden'));
|
|
30
|
+
};
|
|
28
31
|
|
|
29
32
|
exports.getButtonClasses = getButtonClasses;
|
|
33
|
+
exports.getClassPreBuilt = getClassPreBuilt;
|
|
30
34
|
exports.getClasses = getClasses;
|
|
@@ -39,6 +39,7 @@ const ProductDescription = (props)=>{
|
|
|
39
39
|
'gp-rotate-180': true
|
|
40
40
|
} : {}
|
|
41
41
|
});
|
|
42
|
+
const classPreBuilt = system.createClass(getClasses.getClassPreBuilt());
|
|
42
43
|
const textStyle = system.createStyle({
|
|
43
44
|
...getStyle.getTextStyle({
|
|
44
45
|
setting
|
|
@@ -83,6 +84,9 @@ const ProductDescription = (props)=>{
|
|
|
83
84
|
system.If(!core.isSafari(), /*#__PURE__*/ jsxRuntime.jsx("style", {
|
|
84
85
|
children: gpDescriptionCss
|
|
85
86
|
}), ' '),
|
|
87
|
+
/*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
88
|
+
className: classPreBuilt
|
|
89
|
+
}),
|
|
86
90
|
/*#__PURE__*/ jsxRuntime.jsx(Tag, {
|
|
87
91
|
ref: ref,
|
|
88
92
|
...textAttr,
|
|
@@ -36,6 +36,7 @@ const ProductDescription = (props)=>{
|
|
|
36
36
|
}),
|
|
37
37
|
...core.makeStyleResponsive('line-clamp', core.makeLineClamp(setting?.lineClamp, setting?.hasLineClamp))
|
|
38
38
|
});
|
|
39
|
+
const classPreBuilt = system.createClass(getClasses.getClassPreBuilt());
|
|
39
40
|
const buttonStyle = system.createStyle(getStyle.getButtonStyle({
|
|
40
41
|
setting
|
|
41
42
|
}));
|
|
@@ -67,6 +68,7 @@ const ProductDescription = (props)=>{
|
|
|
67
68
|
class="${gpDescriptionClasses}"
|
|
68
69
|
gp-data='${core.dataStringify(stateData).replaceAll("'", ''')}'>
|
|
69
70
|
<style>${textDescriptionCss}</style>
|
|
71
|
+
<div class="${classPreBuilt}" ></div>
|
|
70
72
|
${system.LiquidUnless('product', `<p>Product not found</p>`, core.template`<${Tag} ${textAttr} class="${textClasses}" style="${textStyle}">
|
|
71
73
|
{{product.description}}
|
|
72
74
|
</${Tag}>
|
|
@@ -18,7 +18,7 @@ var useStockCounter = require('./hook/useStockCounter.js');
|
|
|
18
18
|
const StockCounter = ({ setting, styles, builderProps })=>{
|
|
19
19
|
const { displayProgressBar, borderRadius } = styles ?? {};
|
|
20
20
|
const { showIcon, icon, layout = 'full', oosIcon } = setting ?? {};
|
|
21
|
-
const {
|
|
21
|
+
const { outputMessage, isOutOfStock, inventoryQuantity } = useStockCounter.useStockCounter(setting, styles);
|
|
22
22
|
const elementRef = React.useRef(null);
|
|
23
23
|
const { dispatchStockCounterInteraction } = useStockCounterInteraction.useStockCounterInteraction({
|
|
24
24
|
element: elementRef,
|
|
@@ -117,13 +117,13 @@ const StockCounter = ({ setting, styles, builderProps })=>{
|
|
|
117
117
|
})),
|
|
118
118
|
showText && (isOutOfStock ? /*#__PURE__*/ jsxRuntime.jsx("p", {
|
|
119
119
|
dangerouslySetInnerHTML: {
|
|
120
|
-
__html:
|
|
120
|
+
__html: outputMessage()
|
|
121
121
|
},
|
|
122
122
|
className: textClasses,
|
|
123
123
|
style: textStyles(true)
|
|
124
124
|
}) : /*#__PURE__*/ jsxRuntime.jsx("p", {
|
|
125
125
|
dangerouslySetInnerHTML: {
|
|
126
|
-
__html:
|
|
126
|
+
__html: outputMessage()
|
|
127
127
|
},
|
|
128
128
|
className: textClasses,
|
|
129
129
|
style: textStyles(false)
|
|
@@ -14,7 +14,7 @@ const getContainerClasses = (setting)=>{
|
|
|
14
14
|
const { progressBarPosition = 'bottom' } = setting ?? {};
|
|
15
15
|
const isProgressBarBottom = progressBarPosition === 'bottom';
|
|
16
16
|
return {
|
|
17
|
-
...core.composeClasses('gp-inline-block gp-flex gp-
|
|
17
|
+
...core.composeClasses('gp-inline-block gp-flex gp-gap-y-1.5'),
|
|
18
18
|
'gp-flex-col': isProgressBarBottom,
|
|
19
19
|
'gp-flex-col-reverse': !isProgressBarBottom
|
|
20
20
|
};
|
|
@@ -48,6 +48,7 @@ const getTextClasses = (styles)=>{
|
|
|
48
48
|
const getWrapperClasses = (setting, isOutOfStock)=>{
|
|
49
49
|
const { hiddenCounterWhenOutOfStock } = setting ?? {};
|
|
50
50
|
return {
|
|
51
|
+
...core.composeClasses('gp-flex'),
|
|
51
52
|
'gp-opacity-50': isOutOfStock && hiddenCounterWhenOutOfStock
|
|
52
53
|
};
|
|
53
54
|
};
|
|
@@ -33,7 +33,7 @@ const getContainerStyles = (styles)=>{
|
|
|
33
33
|
const getWrapperStyles = (styles)=>{
|
|
34
34
|
const { alignment } = styles ?? {};
|
|
35
35
|
return {
|
|
36
|
-
...core.makeStyleResponsive('
|
|
36
|
+
...core.makeStyleResponsive('jc', alignment)
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
const getIconStyles = (styles, setting, isOutOfStock)=>{
|
|
@@ -26,8 +26,13 @@ const useStockCounter = (setting, styles)=>{
|
|
|
26
26
|
if (isContinueShopping) return helpers.transformHighlighTag(continueSelling || '', mainColor);
|
|
27
27
|
return helpers.transformHighlighTag(helpers.transformNumberTag(template || '', mainColor, inventoryQuantity), mainColor);
|
|
28
28
|
}
|
|
29
|
+
const outputMessage = ()=>{
|
|
30
|
+
const isCapitalize = styles?.typo?.attrs?.transform === 'capitalize';
|
|
31
|
+
if (isCapitalize) return getMessage()?.toLocaleLowerCase();
|
|
32
|
+
return getMessage();
|
|
33
|
+
};
|
|
29
34
|
return {
|
|
30
|
-
|
|
35
|
+
outputMessage,
|
|
31
36
|
isOutOfStock,
|
|
32
37
|
inventoryQuantity
|
|
33
38
|
};
|
|
@@ -157,22 +157,44 @@ const uiV2 = [
|
|
|
157
157
|
},
|
|
158
158
|
controls: [
|
|
159
159
|
{
|
|
160
|
-
type: '
|
|
161
|
-
setting: {
|
|
162
|
-
id: 'alt'
|
|
163
|
-
},
|
|
160
|
+
type: 'combo',
|
|
164
161
|
label: {
|
|
165
162
|
en: 'Alt text'
|
|
166
|
-
}
|
|
163
|
+
},
|
|
164
|
+
iconName: 'polaris-text-block',
|
|
165
|
+
getValueFromSettingID: 'alt',
|
|
166
|
+
isHideClear: true,
|
|
167
|
+
controls: [
|
|
168
|
+
{
|
|
169
|
+
label: {
|
|
170
|
+
en: 'Content'
|
|
171
|
+
},
|
|
172
|
+
setting: {
|
|
173
|
+
id: 'alt'
|
|
174
|
+
},
|
|
175
|
+
layout: 'vertical'
|
|
176
|
+
}
|
|
177
|
+
]
|
|
167
178
|
},
|
|
168
179
|
{
|
|
169
|
-
type: '
|
|
170
|
-
setting: {
|
|
171
|
-
id: 'title'
|
|
172
|
-
},
|
|
180
|
+
type: 'combo',
|
|
173
181
|
label: {
|
|
174
182
|
en: 'Image title'
|
|
175
|
-
}
|
|
183
|
+
},
|
|
184
|
+
iconName: 'polaris-text-block',
|
|
185
|
+
getValueFromSettingID: 'title',
|
|
186
|
+
isHideClear: true,
|
|
187
|
+
controls: [
|
|
188
|
+
{
|
|
189
|
+
label: {
|
|
190
|
+
en: 'Content'
|
|
191
|
+
},
|
|
192
|
+
setting: {
|
|
193
|
+
id: 'title'
|
|
194
|
+
},
|
|
195
|
+
layout: 'vertical'
|
|
196
|
+
}
|
|
197
|
+
]
|
|
176
198
|
}
|
|
177
199
|
]
|
|
178
200
|
},
|
|
@@ -24,6 +24,15 @@ const uiV2 = [
|
|
|
24
24
|
setting: {
|
|
25
25
|
id: 'slideToShow'
|
|
26
26
|
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: {
|
|
30
|
+
en: 'Sort by'
|
|
31
|
+
},
|
|
32
|
+
conditionDisplay: 'articleSetting && articleSetting.articlePickType !== "manually"',
|
|
33
|
+
setting: {
|
|
34
|
+
id: 'articleOrderBy'
|
|
35
|
+
}
|
|
27
36
|
}
|
|
28
37
|
]
|
|
29
38
|
},
|
|
@@ -2,7 +2,7 @@ import { composeTypographyClassName, cls, getGlobalColorClass } from '@gem-sdk/c
|
|
|
2
2
|
|
|
3
3
|
const getClassContainerCollectionDes = ({ setting })=>{
|
|
4
4
|
const appendTypoClass = composeTypographyClassName(setting?.typo, setting?.typography);
|
|
5
|
-
return composeClasses(cls('gp-p-description-text gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre', appendTypoClass, getGlobalColorClass('text', setting?.color), "data-[browser=safari]:after:gp-content-[' '] data-[browser=safari]:after:gp-absolute data-[browser=safari]:after:gp-left-0 data-[browser=safari]:after:gp-right-0 data-[browser=safari]:after:gp-bottom-0 data-[browser=safari]:after:gp-w-full data-[browser=safari]:after:gp-h-1/2 data-[browser=safari]:after:gp-bg-gradient-to-t data-[browser=safari]:after:gp-from-white"));
|
|
5
|
+
return composeClasses(cls('gp-relative p-description-wrapper gp-p-description-text gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre', appendTypoClass, getGlobalColorClass('text', setting?.color), "data-[browser=safari]:after:gp-content-[' '] data-[browser=safari]:after:gp-absolute data-[browser=safari]:after:gp-left-0 data-[browser=safari]:after:gp-right-0 data-[browser=safari]:after:gp-bottom-0 data-[browser=safari]:after:gp-w-full data-[browser=safari]:after:gp-h-1/2 data-[browser=safari]:after:gp-bg-gradient-to-t data-[browser=safari]:after:gp-from-white"));
|
|
6
6
|
};
|
|
7
7
|
const getClassButtonViewMore = ({ setting })=>{
|
|
8
8
|
const appendTypoClass = composeTypographyClassName(setting?.typo, setting?.typography);
|
|
@@ -17,6 +17,9 @@ const getShowMoreIconClasses = ()=>{
|
|
|
17
17
|
const getShowMoreTextClasses = ()=>{
|
|
18
18
|
return composeClasses(cls('gp-show-more-text'));
|
|
19
19
|
};
|
|
20
|
+
const getClassPreBuilt = ()=>{
|
|
21
|
+
return composeClasses(cls('gp-rotate-180 gp-hidden'));
|
|
22
|
+
};
|
|
20
23
|
const composeClasses = (classes)=>{
|
|
21
24
|
return classes.trim().split(/\s+/).reduce((acc, className)=>{
|
|
22
25
|
acc[className] = true;
|
|
@@ -24,4 +27,4 @@ const composeClasses = (classes)=>{
|
|
|
24
27
|
}, {});
|
|
25
28
|
};
|
|
26
29
|
|
|
27
|
-
export { getClassButtonViewMore, getClassContainerCollectionDes, getDescriptionClasses, getShowMoreIconClasses, getShowMoreTextClasses };
|
|
30
|
+
export { getClassButtonViewMore, getClassContainerCollectionDes, getClassPreBuilt, getDescriptionClasses, getShowMoreIconClasses, getShowMoreTextClasses };
|
|
@@ -57,9 +57,6 @@ const getStyleDefaultViewMore = (setting)=>{
|
|
|
57
57
|
...getDisplayCollapse()
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
|
-
const getDisplayCollapse = (setting)=>{
|
|
61
|
-
return getDisplayStyle((device)=>!!setting?.hasLineClamp && setting.hasLineClamp[device] !== undefined && !setting.hasLineClamp[device], 'block');
|
|
62
|
-
};
|
|
63
60
|
const getStaticCss = ()=>{
|
|
64
61
|
const gpDescriptionCss = `
|
|
65
62
|
.gp-p-description-text > *:not(ol):not(ul):not(table):not(div):not(style):not(script) {
|
|
@@ -84,4 +81,4 @@ const getStaticCss = ()=>{
|
|
|
84
81
|
};
|
|
85
82
|
};
|
|
86
83
|
|
|
87
|
-
export { getDefaultStyleCollectionDes,
|
|
84
|
+
export { getDefaultStyleCollectionDes, getMaxHeightStyleDefault, getStaticCss, getStyleDefaultViewMore };
|
package/dist/esm/collection/components/collection-description/components/CollectionDescription.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
3
|
import { useCollection, makeStyleResponsive, makeLineClamp, isSafari } from '@gem-sdk/core';
|
|
4
4
|
import { getDefaultStyleCollectionDes, getStyleDefaultViewMore, getStaticCss } from '../common/styles.js';
|
|
5
|
-
import { getClassContainerCollectionDes, getClassButtonViewMore, getDescriptionClasses, getShowMoreIconClasses, getShowMoreTextClasses } from '../common/classes.js';
|
|
5
|
+
import { getClassContainerCollectionDes, getClassButtonViewMore, getDescriptionClasses, getShowMoreIconClasses, getShowMoreTextClasses, getClassPreBuilt } from '../common/classes.js';
|
|
6
6
|
import { createClass, createStyle, createAttr, If } from '@gem-sdk/system';
|
|
7
7
|
import { getViewLessText, getViewMoreText } from '../common/index.js';
|
|
8
8
|
import { useGpDescription } from '../hook/useDescription.js';
|
|
@@ -21,8 +21,14 @@ const CollectionDescription = ({ setting, builderProps, pageContext, advanced })
|
|
|
21
21
|
const gpDescriptionClasses = createClass(getDescriptionClasses({
|
|
22
22
|
advanced
|
|
23
23
|
}));
|
|
24
|
-
const showMoreIconClasses = createClass(
|
|
24
|
+
const showMoreIconClasses = createClass({
|
|
25
|
+
...getShowMoreIconClasses(),
|
|
26
|
+
...open ? {
|
|
27
|
+
'gp-rotate-180': true
|
|
28
|
+
} : {}
|
|
29
|
+
});
|
|
25
30
|
const showMoreTextClasses = createClass(getShowMoreTextClasses());
|
|
31
|
+
const classPreBuilt = createClass(getClassPreBuilt());
|
|
26
32
|
const textStyle = createStyle({
|
|
27
33
|
...getDefaultStyleCollectionDes({
|
|
28
34
|
setting
|
|
@@ -62,6 +68,9 @@ const CollectionDescription = ({ setting, builderProps, pageContext, advanced })
|
|
|
62
68
|
If(!isSafari(), /*#__PURE__*/ jsx("style", {
|
|
63
69
|
children: gpDescriptionCss
|
|
64
70
|
}), ''),
|
|
71
|
+
/*#__PURE__*/ jsx("div", {
|
|
72
|
+
className: classPreBuilt
|
|
73
|
+
}),
|
|
65
74
|
/*#__PURE__*/ jsx("div", {
|
|
66
75
|
ref: ref,
|
|
67
76
|
className: classContainerCollectionDes,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { makeStyleResponsive, makeLineClamp, template, isSafari, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
|
|
2
2
|
import { getSettingPreloadData } from '../../../../helpers.js';
|
|
3
|
-
import { getDefaultStyleCollectionDes, getStyleDefaultViewMore,
|
|
3
|
+
import { getDefaultStyleCollectionDes, getStyleDefaultViewMore, getStaticCss } from '../common/styles.js';
|
|
4
4
|
import { createClass, createStyle, createAttr, createStateOrContext, If, Liquid, LiquidUnless, LiquidIf } from '@gem-sdk/system';
|
|
5
|
-
import { getClassContainerCollectionDes, getClassButtonViewMore, getDescriptionClasses, getShowMoreIconClasses, getShowMoreTextClasses } from '../common/classes.js';
|
|
5
|
+
import { getClassContainerCollectionDes, getClassButtonViewMore, getDescriptionClasses, getShowMoreIconClasses, getShowMoreTextClasses, getClassPreBuilt } from '../common/classes.js';
|
|
6
6
|
import { getViewLessText, getViewMoreText } from '../common/index.js';
|
|
7
7
|
import { ICON_SVG } from '../common/constant.js';
|
|
8
8
|
|
|
@@ -19,6 +19,7 @@ const CollectionDescription = ({ setting, advanced, builderProps, pageContext })
|
|
|
19
19
|
}));
|
|
20
20
|
const showMoreIconClasses = createClass(getShowMoreIconClasses());
|
|
21
21
|
const showMoreTextClasses = createClass(getShowMoreTextClasses());
|
|
22
|
+
const classPreBuilt = createClass(getClassPreBuilt());
|
|
22
23
|
const textStyle = createStyle({
|
|
23
24
|
...getDefaultStyleCollectionDes({
|
|
24
25
|
setting,
|
|
@@ -27,10 +28,7 @@ const CollectionDescription = ({ setting, advanced, builderProps, pageContext })
|
|
|
27
28
|
...makeStyleResponsive('line-clamp', makeLineClamp(setting?.lineClamp, setting?.hasLineClamp))
|
|
28
29
|
});
|
|
29
30
|
const styleViewMore = createStyle({
|
|
30
|
-
...getStyleDefaultViewMore(setting)
|
|
31
|
-
...getDisplayCollapse(setting),
|
|
32
|
-
position: 'absolute',
|
|
33
|
-
visibility: 'hidden'
|
|
31
|
+
...getStyleDefaultViewMore(setting)
|
|
34
32
|
});
|
|
35
33
|
const viewLessText = getViewLessText({
|
|
36
34
|
setting,
|
|
@@ -75,6 +73,7 @@ const CollectionDescription = ({ setting, advanced, builderProps, pageContext })
|
|
|
75
73
|
>
|
|
76
74
|
<style>${textDescriptionCss}</style>
|
|
77
75
|
${If(!isSafari(), `<style>${gpDescriptionCss}</style>`, ' ')}
|
|
76
|
+
<div class="${classPreBuilt}" ></div>
|
|
78
77
|
${LiquidUnless('collection', `<p>Collection not found</p>`, template`<div ${textAttr} class="${classContainerCollectionDes}" style="${textStyle}">
|
|
79
78
|
{{collection.description}}
|
|
80
79
|
</div>
|
|
@@ -34,8 +34,8 @@ const renderPaginatorLive = ({ setting, builderProps, pageContext })=>{
|
|
|
34
34
|
const limit = numberOfProductOfProductList > 0 ? numberOfProductOfProductList : 4;
|
|
35
35
|
return `
|
|
36
36
|
{% paginate collection.products by ${limit} %}
|
|
37
|
-
{% assign previousText = ${pageContext?.isPreviewing ? `${previousTextVal}` : previousTextVal} %}
|
|
38
|
-
{% assign nextText = ${pageContext?.isPreviewing ? `${nextTextVal}` : nextTextVal} %}
|
|
37
|
+
{% assign previousText = ${pageContext?.isPreviewing ? `${previousTextVal}` : previousTextVal || `""`} %}
|
|
38
|
+
{% assign nextText = ${pageContext?.isPreviewing ? `${nextTextVal}` : nextTextVal || `""`} %}
|
|
39
39
|
{{ paginate | default_pagination: previous: previousText, next: nextText }}
|
|
40
40
|
{% endpaginate %}
|
|
41
41
|
`;
|
|
@@ -10,8 +10,9 @@ const getPaginatorStyle = (isActive, customStyle, activeColor)=>({
|
|
|
10
10
|
} : {}
|
|
11
11
|
});
|
|
12
12
|
const getCustomStyle = (setting)=>{
|
|
13
|
-
const { typo,
|
|
13
|
+
const { typo, layout, typographyPaginator, itemSpacing, buttonSizeNumber, buttonShape } = setting ?? {};
|
|
14
14
|
const appendTypoStyle = composeTypographyStyle(typo, typographyPaginator);
|
|
15
|
+
const normalColor = typo?.attrs?.color;
|
|
15
16
|
let customStyle = composeMemo(()=>{
|
|
16
17
|
return removeNullUndefined({
|
|
17
18
|
...appendTypoStyle,
|
package/dist/esm/collection/components/collection-paginator/components/CollectionPaginator.js
CHANGED
|
@@ -26,11 +26,13 @@ const CollectionPaginator = ({ setting, builderProps })=>{
|
|
|
26
26
|
});
|
|
27
27
|
return /*#__PURE__*/ jsx("div", {
|
|
28
28
|
id: builderProps?.uid,
|
|
29
|
-
className: classPaginator,
|
|
30
|
-
style: stylePaginator,
|
|
31
29
|
children: /*#__PURE__*/ jsx("div", {
|
|
32
|
-
className:
|
|
33
|
-
|
|
30
|
+
className: classPaginator,
|
|
31
|
+
style: stylePaginator,
|
|
32
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
33
|
+
className: classPaginatorWrapper,
|
|
34
|
+
children: paginatorItems
|
|
35
|
+
})
|
|
34
36
|
})
|
|
35
37
|
});
|
|
36
38
|
};
|
package/dist/esm/collection/components/collection-paginator/components/CollectionPaginator.liquid.js
CHANGED
|
@@ -43,8 +43,10 @@ const CollectionPaginator = ({ setting, builderProps, pageContext })=>{
|
|
|
43
43
|
uid: builderProps?.uid
|
|
44
44
|
});
|
|
45
45
|
return template`
|
|
46
|
-
<gp-collection-paginator gp-data='${JSON.stringify(stateData).replaceAll("'", ''')}' id="${builderProps?.uid}"
|
|
47
|
-
<div class="${
|
|
46
|
+
<gp-collection-paginator gp-data='${JSON.stringify(stateData).replaceAll("'", ''')}' id="${builderProps?.uid}" >
|
|
47
|
+
<div class="${classPaginator}" style="${stylePaginator}">
|
|
48
|
+
<div class="${classPaginatorWrapper}">${paginatorItem}</div>
|
|
49
|
+
</div>
|
|
48
50
|
</gp-collection-paginator>
|
|
49
51
|
${RenderIf(isLocalEnv, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-collection-paginator.js' | asset_url }}" defer="defer"></script>`, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="${baseAssetURL}/assets-v2/gp-collection-paginator.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
50
52
|
`;
|
|
@@ -11,6 +11,7 @@ const SettingUIV2 = [
|
|
|
11
11
|
},
|
|
12
12
|
iconName: 'polaris-text-block',
|
|
13
13
|
getValueFromSettingID: 'sortingTextDisplay',
|
|
14
|
+
isHideClear: true,
|
|
14
15
|
controls: [
|
|
15
16
|
{
|
|
16
17
|
label: {
|
|
@@ -51,6 +52,7 @@ const SettingUIV2 = [
|
|
|
51
52
|
},
|
|
52
53
|
iconName: 'polaris-text-block',
|
|
53
54
|
getValueFromSettingID: 'quantityTextDisplay',
|
|
55
|
+
isHideClear: true,
|
|
54
56
|
controls: [
|
|
55
57
|
{
|
|
56
58
|
label: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { composeTypographyClassName, getGlobalColorClass } from '@gem-sdk/core';
|
|
1
|
+
import { composeTypographyClassName, getGlobalColorClass, composeClasses, cls } from '@gem-sdk/core';
|
|
2
2
|
|
|
3
3
|
const getClasses = ({ setting })=>{
|
|
4
4
|
const appendTypoClass = composeTypographyClassName(setting?.typo, setting?.typography);
|
|
@@ -23,5 +23,8 @@ const getButtonClasses = ({ setting })=>{
|
|
|
23
23
|
[globalColorClass]: true
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
|
+
const getClassPreBuilt = ()=>{
|
|
27
|
+
return composeClasses(cls('gp-rotate-180 gp-hidden'));
|
|
28
|
+
};
|
|
26
29
|
|
|
27
|
-
export { getButtonClasses, getClasses };
|
|
30
|
+
export { getButtonClasses, getClassPreBuilt, getClasses };
|
|
@@ -4,7 +4,7 @@ import { useProduct, useCurrentDevice, getResponsiveValueByScreen, makeStyleResp
|
|
|
4
4
|
import NoDataState from '../../../common/components/NoDataState.js';
|
|
5
5
|
import { ICON_SVG } from './common/const.js';
|
|
6
6
|
import { createClass, createStyle, createAttr, If } from '@gem-sdk/system';
|
|
7
|
-
import { getClasses, getButtonClasses } from './common/getClasses.js';
|
|
7
|
+
import { getClasses, getButtonClasses, getClassPreBuilt } from './common/getClasses.js';
|
|
8
8
|
import { getTextStyle, getButtonStyle, getStaticCss } from './common/getStyle.js';
|
|
9
9
|
import { useGpDescription } from './hooks/useGpDescription.js';
|
|
10
10
|
|
|
@@ -35,6 +35,7 @@ const ProductDescription = (props)=>{
|
|
|
35
35
|
'gp-rotate-180': true
|
|
36
36
|
} : {}
|
|
37
37
|
});
|
|
38
|
+
const classPreBuilt = createClass(getClassPreBuilt());
|
|
38
39
|
const textStyle = createStyle({
|
|
39
40
|
...getTextStyle({
|
|
40
41
|
setting
|
|
@@ -79,6 +80,9 @@ const ProductDescription = (props)=>{
|
|
|
79
80
|
If(!isSafari(), /*#__PURE__*/ jsx("style", {
|
|
80
81
|
children: gpDescriptionCss
|
|
81
82
|
}), ' '),
|
|
83
|
+
/*#__PURE__*/ jsx("div", {
|
|
84
|
+
className: classPreBuilt
|
|
85
|
+
}),
|
|
82
86
|
/*#__PURE__*/ jsx(Tag, {
|
|
83
87
|
ref: ref,
|
|
84
88
|
...textAttr,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { makeStyleResponsive, makeLineClamp, template, dataStringify, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
|
|
2
2
|
import { getSettingPreloadData } from '../../../helpers.js';
|
|
3
3
|
import { createClass, createStyle, createAttr, createStateOrContext, LiquidIf, Liquid, LiquidUnless, If } from '@gem-sdk/system';
|
|
4
|
-
import { getClasses, getButtonClasses } from './common/getClasses.js';
|
|
4
|
+
import { getClasses, getButtonClasses, getClassPreBuilt } from './common/getClasses.js';
|
|
5
5
|
import { getTextStyle, getButtonStyle, getStaticCss } from './common/getStyle.js';
|
|
6
6
|
import { ICON_SVG } from './common/const.js';
|
|
7
7
|
|
|
@@ -32,6 +32,7 @@ const ProductDescription = (props)=>{
|
|
|
32
32
|
}),
|
|
33
33
|
...makeStyleResponsive('line-clamp', makeLineClamp(setting?.lineClamp, setting?.hasLineClamp))
|
|
34
34
|
});
|
|
35
|
+
const classPreBuilt = createClass(getClassPreBuilt());
|
|
35
36
|
const buttonStyle = createStyle(getButtonStyle({
|
|
36
37
|
setting
|
|
37
38
|
}));
|
|
@@ -63,6 +64,7 @@ const ProductDescription = (props)=>{
|
|
|
63
64
|
class="${gpDescriptionClasses}"
|
|
64
65
|
gp-data='${dataStringify(stateData).replaceAll("'", ''')}'>
|
|
65
66
|
<style>${textDescriptionCss}</style>
|
|
67
|
+
<div class="${classPreBuilt}" ></div>
|
|
66
68
|
${LiquidUnless('product', `<p>Product not found</p>`, template`<${Tag} ${textAttr} class="${textClasses}" style="${textStyle}">
|
|
67
69
|
{{product.description}}
|
|
68
70
|
</${Tag}>
|
|
@@ -14,7 +14,7 @@ import { useStockCounter } from './hook/useStockCounter.js';
|
|
|
14
14
|
const StockCounter = ({ setting, styles, builderProps })=>{
|
|
15
15
|
const { displayProgressBar, borderRadius } = styles ?? {};
|
|
16
16
|
const { showIcon, icon, layout = 'full', oosIcon } = setting ?? {};
|
|
17
|
-
const {
|
|
17
|
+
const { outputMessage, isOutOfStock, inventoryQuantity } = useStockCounter(setting, styles);
|
|
18
18
|
const elementRef = useRef(null);
|
|
19
19
|
const { dispatchStockCounterInteraction } = useStockCounterInteraction({
|
|
20
20
|
element: elementRef,
|
|
@@ -113,13 +113,13 @@ const StockCounter = ({ setting, styles, builderProps })=>{
|
|
|
113
113
|
})),
|
|
114
114
|
showText && (isOutOfStock ? /*#__PURE__*/ jsx("p", {
|
|
115
115
|
dangerouslySetInnerHTML: {
|
|
116
|
-
__html:
|
|
116
|
+
__html: outputMessage()
|
|
117
117
|
},
|
|
118
118
|
className: textClasses,
|
|
119
119
|
style: textStyles(true)
|
|
120
120
|
}) : /*#__PURE__*/ jsx("p", {
|
|
121
121
|
dangerouslySetInnerHTML: {
|
|
122
|
-
__html:
|
|
122
|
+
__html: outputMessage()
|
|
123
123
|
},
|
|
124
124
|
className: textClasses,
|
|
125
125
|
style: textStyles(false)
|
|
@@ -12,7 +12,7 @@ const getContainerClasses = (setting)=>{
|
|
|
12
12
|
const { progressBarPosition = 'bottom' } = setting ?? {};
|
|
13
13
|
const isProgressBarBottom = progressBarPosition === 'bottom';
|
|
14
14
|
return {
|
|
15
|
-
...composeClasses('gp-inline-block gp-flex gp-
|
|
15
|
+
...composeClasses('gp-inline-block gp-flex gp-gap-y-1.5'),
|
|
16
16
|
'gp-flex-col': isProgressBarBottom,
|
|
17
17
|
'gp-flex-col-reverse': !isProgressBarBottom
|
|
18
18
|
};
|
|
@@ -46,6 +46,7 @@ const getTextClasses = (styles)=>{
|
|
|
46
46
|
const getWrapperClasses = (setting, isOutOfStock)=>{
|
|
47
47
|
const { hiddenCounterWhenOutOfStock } = setting ?? {};
|
|
48
48
|
return {
|
|
49
|
+
...composeClasses('gp-flex'),
|
|
49
50
|
'gp-opacity-50': isOutOfStock && hiddenCounterWhenOutOfStock
|
|
50
51
|
};
|
|
51
52
|
};
|
|
@@ -31,7 +31,7 @@ const getContainerStyles = (styles)=>{
|
|
|
31
31
|
const getWrapperStyles = (styles)=>{
|
|
32
32
|
const { alignment } = styles ?? {};
|
|
33
33
|
return {
|
|
34
|
-
...makeStyleResponsive('
|
|
34
|
+
...makeStyleResponsive('jc', alignment)
|
|
35
35
|
};
|
|
36
36
|
};
|
|
37
37
|
const getIconStyles = (styles, setting, isOutOfStock)=>{
|
|
@@ -24,8 +24,13 @@ const useStockCounter = (setting, styles)=>{
|
|
|
24
24
|
if (isContinueShopping) return transformHighlighTag(continueSelling || '', mainColor);
|
|
25
25
|
return transformHighlighTag(transformNumberTag(template || '', mainColor, inventoryQuantity), mainColor);
|
|
26
26
|
}
|
|
27
|
+
const outputMessage = ()=>{
|
|
28
|
+
const isCapitalize = styles?.typo?.attrs?.transform === 'capitalize';
|
|
29
|
+
if (isCapitalize) return getMessage()?.toLocaleLowerCase();
|
|
30
|
+
return getMessage();
|
|
31
|
+
};
|
|
27
32
|
return {
|
|
28
|
-
|
|
33
|
+
outputMessage,
|
|
29
34
|
isOutOfStock,
|
|
30
35
|
inventoryQuantity
|
|
31
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/components",
|
|
3
|
-
"version": "2.0.0-dev.
|
|
3
|
+
"version": "2.0.0-dev.561",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"update-img-src-3rd": "node ./scripts/update-img-src-3rd.js"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@gem-sdk/core": "2.0.0-dev.
|
|
26
|
+
"@gem-sdk/core": "2.0.0-dev.561",
|
|
27
27
|
"@gem-sdk/styles": "2.0.0-dev.535",
|
|
28
28
|
"@gem-sdk/system": "2.0.0-dev.504",
|
|
29
29
|
"@types/react-transition-group": "^4.4.5"
|