@gem-sdk/components 2.0.0-dev.353 → 2.0.0-dev.356
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/ArticleAuthor.liquid.js +27 -0
- package/dist/cjs/article/components/ArticleCategory.liquid.js +27 -0
- package/dist/cjs/article/components/ArticleContent.liquid.js +42 -0
- package/dist/cjs/article/components/ArticleDate.liquid.js +35 -0
- package/dist/cjs/article/components/ArticleExcerpt.liquid.js +26 -0
- package/dist/cjs/article/components/ArticleImage.liquid.js +67 -0
- package/dist/cjs/article/components/ArticlePagination.liquid.js +17 -0
- package/dist/cjs/article/components/ArticleReadMore.liquid.js +58 -0
- package/dist/cjs/article/components/ArticleTag.liquid.js +27 -0
- package/dist/cjs/article/components/ArticleTitle.liquid.js +46 -0
- package/dist/cjs/builder.js +1 -1
- package/dist/cjs/button/components/Button.js +5 -3
- package/dist/cjs/button/components/Button.liquid.js +7 -3
- package/dist/cjs/button/components/common/attributes.js +1 -2
- package/dist/cjs/button/components/common/helpers.js +2 -2
- package/dist/cjs/button/components/common/styles.js +29 -1
- package/dist/cjs/button/setting/configs/settings.js +24 -4
- package/dist/cjs/button/setting/configs/uiV2.js +46 -8
- package/dist/cjs/form/setting/newsletter/configs/settings.js +2 -2
- package/dist/cjs/form/setting/newsletter/configs/uiV2.js +0 -44
- package/dist/cjs/image/setting/configs/uiV2.js +5 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.liquid.js +20 -0
- package/dist/cjs/post-purchase/callout-banner/setting/config/callout-text/setting.js +4 -3
- package/dist/cjs/post-purchase/image/common/getClasses.js +1 -4
- package/dist/cjs/post-purchase/product/common/getClasses.js +4 -5
- package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselPostPurchase.js +3 -2
- package/dist/cjs/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +2 -1
- package/dist/cjs/post-purchase/product/components/product-offer/common/attrs.js +14 -0
- package/dist/cjs/post-purchase/product/components/product-offer/common/classes.js +29 -0
- package/dist/cjs/post-purchase/product/components/product-offer/common/styles.js +27 -0
- package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOffer.js +53 -0
- package/dist/cjs/post-purchase/product/components/product-offer/components/ProductOfferItem.js +45 -0
- package/dist/cjs/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +57 -0
- package/dist/cjs/post-purchase/product/hooks/product-image/useListCarousel.js +6 -2
- package/dist/cjs/post-purchase/product/index.js +2 -2
- package/dist/cjs/post-purchase/product/next.js +1 -1
- package/dist/cjs/post-purchase/product/settings/product-image/setting-v2.js +5 -5
- package/dist/cjs/post-purchase/product/settings/product-image/uiV2.js +2 -1
- package/dist/cjs/post-purchase/product/settings/{ProductOffer.js → product-offer/index.js} +23 -143
- package/dist/cjs/post-purchase/product/settings/product-offer/ui/uiV1.js +140 -0
- package/dist/cjs/post-purchase/product/settings/product-offer/ui/uiV2.js +141 -0
- package/dist/cjs/post-purchase/utils/constants.js +6 -0
- package/dist/cjs/product/components/ProductViewMore/ProductViewMore.js +17 -18
- package/dist/cjs/product/components/ProductViewMore/ProductViewMore.liquid.js +14 -21
- package/dist/cjs/product/components/ProductViewMore/common/data.js +26 -0
- package/dist/cjs/product/components/ProductViewMore/common/styles.js +12 -0
- package/dist/cjs/product/setting/dynamic-checkout/configs/settings.js +9 -5
- package/dist/cjs/product/setting/dynamic-checkout/configs/uiV2.js +10 -10
- package/dist/cjs/product/setting/product-button/configs/settings.js +1 -0
- package/dist/cjs/product/setting/product-button/configs/uiV2.js +1 -1
- package/dist/cjs/product/setting/product-view-more/configs/settings.js +17 -16
- package/dist/cjs/product/setting/product-view-more/configs/uiV2.js +45 -45
- package/dist/esm/article/components/ArticleAuthor.liquid.js +23 -0
- package/dist/esm/article/components/ArticleCategory.liquid.js +23 -0
- package/dist/esm/article/components/ArticleContent.liquid.js +38 -0
- package/dist/esm/article/components/ArticleDate.liquid.js +31 -0
- package/dist/esm/article/components/ArticleExcerpt.liquid.js +22 -0
- package/dist/esm/article/components/ArticleImage.liquid.js +63 -0
- package/dist/esm/article/components/ArticlePagination.liquid.js +13 -0
- package/dist/esm/article/components/ArticleReadMore.liquid.js +54 -0
- package/dist/esm/article/components/ArticleTag.liquid.js +23 -0
- package/dist/esm/article/components/ArticleTitle.liquid.js +42 -0
- package/dist/esm/builder.js +1 -1
- package/dist/esm/button/components/Button.js +5 -3
- package/dist/esm/button/components/Button.liquid.js +7 -3
- package/dist/esm/button/components/common/attributes.js +1 -2
- package/dist/esm/button/components/common/helpers.js +2 -2
- package/dist/esm/button/components/common/styles.js +29 -3
- package/dist/esm/button/setting/configs/settings.js +24 -4
- package/dist/esm/button/setting/configs/uiV2.js +46 -8
- package/dist/esm/form/setting/newsletter/configs/settings.js +2 -2
- package/dist/esm/form/setting/newsletter/configs/uiV2.js +0 -44
- package/dist/esm/image/setting/configs/uiV2.js +5 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.liquid.js +10 -0
- package/dist/esm/post-purchase/callout-banner/setting/config/callout-text/setting.js +4 -3
- package/dist/esm/post-purchase/image/common/getClasses.js +1 -4
- package/dist/esm/post-purchase/product/common/getClasses.js +4 -5
- package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselPostPurchase.js +3 -2
- package/dist/esm/post-purchase/product/components/product-image/carousel-post-purchase/CarouselWrapperPostPurchase.js +2 -1
- package/dist/esm/post-purchase/product/components/product-offer/common/attrs.js +12 -0
- package/dist/esm/post-purchase/product/components/product-offer/common/classes.js +25 -0
- package/dist/esm/post-purchase/product/components/product-offer/common/styles.js +24 -0
- package/dist/esm/post-purchase/product/components/product-offer/components/ProductOffer.js +49 -0
- package/dist/esm/post-purchase/product/components/product-offer/components/ProductOfferItem.js +43 -0
- package/dist/esm/post-purchase/product/components/product-offer/hooks/useProductOfferData.js +55 -0
- package/dist/esm/post-purchase/product/hooks/product-image/useListCarousel.js +6 -2
- package/dist/esm/post-purchase/product/index.js +1 -1
- package/dist/esm/post-purchase/product/next.js +1 -1
- package/dist/esm/post-purchase/product/settings/product-image/setting-v2.js +5 -5
- package/dist/esm/post-purchase/product/settings/product-image/uiV2.js +2 -1
- package/dist/esm/post-purchase/product/settings/{ProductOffer.js → product-offer/index.js} +23 -143
- package/dist/esm/post-purchase/product/settings/product-offer/ui/uiV1.js +138 -0
- package/dist/esm/post-purchase/product/settings/product-offer/ui/uiV2.js +139 -0
- package/dist/esm/post-purchase/utils/constants.js +6 -1
- package/dist/esm/product/components/ProductViewMore/ProductViewMore.js +17 -18
- package/dist/esm/product/components/ProductViewMore/ProductViewMore.liquid.js +14 -21
- package/dist/esm/product/components/ProductViewMore/common/data.js +23 -0
- package/dist/esm/product/components/ProductViewMore/common/styles.js +10 -0
- package/dist/esm/product/setting/dynamic-checkout/configs/settings.js +9 -5
- package/dist/esm/product/setting/dynamic-checkout/configs/uiV2.js +10 -10
- package/dist/esm/product/setting/product-button/configs/settings.js +1 -0
- package/dist/esm/product/setting/product-button/configs/uiV2.js +1 -1
- package/dist/esm/product/setting/product-view-more/configs/settings.js +17 -16
- package/dist/esm/product/setting/product-view-more/configs/uiV2.js +45 -45
- package/dist/types/index.d.ts +82 -18
- package/package.json +2 -2
- package/dist/cjs/post-purchase/product/components/ProductOffer.js +0 -138
- package/dist/esm/post-purchase/product/components/ProductOffer.js +0 -133
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var core = require('@gem-sdk/core');
|
|
7
|
+
var Text_liquid = require('../../text/components/Text.liquid.js');
|
|
8
|
+
|
|
9
|
+
const ArticleAuthor = ({ setting, styles, advanced, builderProps })=>{
|
|
10
|
+
const { prefix } = setting ?? {};
|
|
11
|
+
return core.template`
|
|
12
|
+
${Text_liquid.default({
|
|
13
|
+
styles: styles,
|
|
14
|
+
setting: {
|
|
15
|
+
...setting,
|
|
16
|
+
text: `${prefix} {{ article.author }}`,
|
|
17
|
+
excludeFlex: true
|
|
18
|
+
},
|
|
19
|
+
advanced: advanced,
|
|
20
|
+
builderAttrs: {
|
|
21
|
+
'data-id': builderProps?.uid
|
|
22
|
+
}
|
|
23
|
+
})}
|
|
24
|
+
`;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.default = ArticleAuthor;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var core = require('@gem-sdk/core');
|
|
7
|
+
var Text_liquid = require('../../text/components/Text.liquid.js');
|
|
8
|
+
|
|
9
|
+
const ArticleCategory = ({ setting, styles, advanced, builderProps })=>{
|
|
10
|
+
return core.template`
|
|
11
|
+
|
|
12
|
+
${Text_liquid.default({
|
|
13
|
+
styles: styles,
|
|
14
|
+
setting: {
|
|
15
|
+
...setting,
|
|
16
|
+
text: '{{blogTitle}}',
|
|
17
|
+
excludeFlex: true
|
|
18
|
+
},
|
|
19
|
+
advanced: advanced,
|
|
20
|
+
builderAttrs: {
|
|
21
|
+
'data-id': builderProps?.uid
|
|
22
|
+
}
|
|
23
|
+
})}
|
|
24
|
+
`;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.default = ArticleCategory;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var core = require('@gem-sdk/core');
|
|
7
|
+
var helpers = require('../../helpers.js');
|
|
8
|
+
|
|
9
|
+
const ArticleContent = ({ styles, builderProps })=>{
|
|
10
|
+
const appendTypoClass = core.composeTypographyClassName(styles?.typo, styles?.typography);
|
|
11
|
+
const appendTypoStyle = core.composeTypographyStyle(styles?.typo, styles?.typography);
|
|
12
|
+
const defaultStyle = {
|
|
13
|
+
...core.makeStyleResponsive('ta', styles?.textAlign),
|
|
14
|
+
...core.getGlobalColorStateStyle('c', styles?.color),
|
|
15
|
+
...core.makeStyle({
|
|
16
|
+
tt: styles?.transform
|
|
17
|
+
}),
|
|
18
|
+
...appendTypoStyle
|
|
19
|
+
};
|
|
20
|
+
const collapseStyle = {
|
|
21
|
+
...defaultStyle,
|
|
22
|
+
...core.makeStyleResponsive('line-clamp', core.makeLineClamp(styles?.lineClamp, styles?.hasLineClamp))
|
|
23
|
+
};
|
|
24
|
+
return core.template`
|
|
25
|
+
<gp-article-content data-id="${builderProps?.uid}" >
|
|
26
|
+
<div
|
|
27
|
+
class="${core.cls('gp-relative gp-p-description-text gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre', appendTypoClass, core.getGlobalColorStateClass('text', styles?.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")}"
|
|
28
|
+
style="${collapseStyle}"
|
|
29
|
+
>
|
|
30
|
+
{{article.content}}
|
|
31
|
+
</div>
|
|
32
|
+
{% style %}
|
|
33
|
+
.gp-p-description-text * {
|
|
34
|
+
color: inherit
|
|
35
|
+
}
|
|
36
|
+
{% endstyle %}
|
|
37
|
+
</gp-article-content>
|
|
38
|
+
${core.RenderIf(core.isLocalEnv, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-article-content.js' | asset_url }}" defer="defer"></script>`, `<script ${helpers.getSettingPreloadData('class="gps-link" delay', 'src')}="${core.baseAssetURL}/assets-v2/gp-article-content.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
39
|
+
`;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
exports.default = ArticleContent;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var core = require('@gem-sdk/core');
|
|
7
|
+
var Text_liquid = require('../../text/components/Text.liquid.js');
|
|
8
|
+
|
|
9
|
+
const FORMAT_MAP = {
|
|
10
|
+
'{"locales":"en-US","options":{"month":"short","day":"2-digit","year":"numeric"}}': '%b %d, %Y',
|
|
11
|
+
'{"locales":"en-US","options":{"month":"long","day":"2-digit","year":"numeric"}}': '%B %d, %Y',
|
|
12
|
+
'{"locales":"en-GB","options":{"month":"long","day":"2-digit","year":"numeric"}}': '%d %B %Y',
|
|
13
|
+
'{"locales":"en-GB","options":{"month":"2-digit","day":"2-digit","year":"numeric"}}': '%d/%m/%Y',
|
|
14
|
+
'{"locales":"en-US","options":{"month":"2-digit","day":"2-digit","year":"numeric"}}': '%m/%d/%Y',
|
|
15
|
+
'{"locales":"ja-JP","options":{"month":"2-digit","day":"2-digit","year":"numeric"}}': '%Y/%m/%d'
|
|
16
|
+
};
|
|
17
|
+
const ArticleDate = ({ setting, styles, advanced, builderProps })=>{
|
|
18
|
+
const { dateFormat } = setting ?? {};
|
|
19
|
+
return core.template`
|
|
20
|
+
${Text_liquid.default({
|
|
21
|
+
styles: styles,
|
|
22
|
+
setting: {
|
|
23
|
+
...setting,
|
|
24
|
+
text: `{{ article.published_at | date: '${FORMAT_MAP[dateFormat ?? '{"locales":"en-US","options":{"month":"short","day":"2-digit","year":"numeric"}}']}' }}`,
|
|
25
|
+
excludeFlex: true
|
|
26
|
+
},
|
|
27
|
+
advanced: advanced,
|
|
28
|
+
builderAttrs: {
|
|
29
|
+
'data-id': builderProps?.uid
|
|
30
|
+
}
|
|
31
|
+
})}
|
|
32
|
+
`;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
exports.default = ArticleDate;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var core = require('@gem-sdk/core');
|
|
7
|
+
var Text_liquid = require('../../text/components/Text.liquid.js');
|
|
8
|
+
|
|
9
|
+
const ArticleExcerpt = ({ setting, styles, advanced, builderProps })=>{
|
|
10
|
+
return core.template`
|
|
11
|
+
${Text_liquid.default({
|
|
12
|
+
styles: styles,
|
|
13
|
+
setting: {
|
|
14
|
+
...setting,
|
|
15
|
+
text: '{{article.excerpt}}',
|
|
16
|
+
excludeFlex: true
|
|
17
|
+
},
|
|
18
|
+
advanced: advanced,
|
|
19
|
+
builderAttrs: {
|
|
20
|
+
'data-id': builderProps?.uid
|
|
21
|
+
}
|
|
22
|
+
})}
|
|
23
|
+
`;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.default = ArticleExcerpt;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var core = require('@gem-sdk/core');
|
|
7
|
+
var Image_liquid = require('../../image/components/Image.liquid.js');
|
|
8
|
+
|
|
9
|
+
const ArticleImage = (props)=>{
|
|
10
|
+
const setting = props?.setting ?? {};
|
|
11
|
+
const { builderProps } = props;
|
|
12
|
+
return core.template`
|
|
13
|
+
<div class="${core.cls('gp-text-center gp-overflow-hidden', props?.className)}" style="border-radius: inherit">
|
|
14
|
+
${setting?.linkArticle ? `
|
|
15
|
+
<a href="{{article.url}}" title="{{article.title}}">
|
|
16
|
+
${Image_liquid.default({
|
|
17
|
+
...props,
|
|
18
|
+
styles: props.styles,
|
|
19
|
+
setting: {
|
|
20
|
+
...props.setting,
|
|
21
|
+
alt: '{{article.image.alt}}',
|
|
22
|
+
image: {
|
|
23
|
+
src: `{{article.image.src | img_url: '1024x1024'}}`,
|
|
24
|
+
alt: '{{article.image.alt}}'
|
|
25
|
+
},
|
|
26
|
+
srcSet: {
|
|
27
|
+
desktop: {
|
|
28
|
+
src: `{{article.image.src | img_url: '1024x1024'}}`
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
disableNoDataState: true
|
|
32
|
+
},
|
|
33
|
+
advanced: props.advanced,
|
|
34
|
+
builderAttrs: {
|
|
35
|
+
'data-id': builderProps?.uid
|
|
36
|
+
}
|
|
37
|
+
})}
|
|
38
|
+
</a>
|
|
39
|
+
` : `
|
|
40
|
+
${Image_liquid.default({
|
|
41
|
+
...props,
|
|
42
|
+
styles: props.styles,
|
|
43
|
+
setting: {
|
|
44
|
+
...props.setting,
|
|
45
|
+
alt: '{{article.image.alt}}',
|
|
46
|
+
image: {
|
|
47
|
+
src: `{{article.image.src | img_url: '1024x1024'}}`,
|
|
48
|
+
alt: '{{article.image.alt}}'
|
|
49
|
+
},
|
|
50
|
+
srcSet: {
|
|
51
|
+
desktop: {
|
|
52
|
+
src: `{{article.image.src | img_url: '1024x1024'}}`
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
disableNoDataState: true
|
|
56
|
+
},
|
|
57
|
+
advanced: props.advanced,
|
|
58
|
+
builderAttrs: {
|
|
59
|
+
'data-id': builderProps?.uid
|
|
60
|
+
}
|
|
61
|
+
})}
|
|
62
|
+
`}
|
|
63
|
+
</div>
|
|
64
|
+
`;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
exports.default = ArticleImage;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
require('@gem-sdk/core');
|
|
7
|
+
require('react/jsx-runtime');
|
|
8
|
+
require('react');
|
|
9
|
+
require('next/link');
|
|
10
|
+
require('@gem-sdk/system');
|
|
11
|
+
var CollectionPaginator_liquid = require('../../collection/components/collection-paginator/components/CollectionPaginator.liquid.js');
|
|
12
|
+
|
|
13
|
+
const ArticlePagination = (props)=>{
|
|
14
|
+
return CollectionPaginator_liquid.default(props);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
exports.default = ArticlePagination;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var core = require('@gem-sdk/core');
|
|
7
|
+
var Text_liquid = require('../../text/components/Text.liquid.js');
|
|
8
|
+
var Button_liquid = require('../../button/components/Button.liquid.js');
|
|
9
|
+
|
|
10
|
+
const ArticleReadMore = ({ setting, styles, builderAttrs, builderProps, advanced, style })=>{
|
|
11
|
+
const { readMoreType, label } = setting ?? {};
|
|
12
|
+
const { typoBtn, typoText, globalSizeText, globalSizeBtn, textColorTextState, textColorBtnState, alignBtn, alignText } = styles ?? {};
|
|
13
|
+
return core.template /* liquid */ `
|
|
14
|
+
<a href="{{article.url}}" target="_blank">
|
|
15
|
+
${core.RenderIf(readMoreType === 'text', Text_liquid.default({
|
|
16
|
+
builderAttrs,
|
|
17
|
+
builderProps,
|
|
18
|
+
advanced,
|
|
19
|
+
styles: {
|
|
20
|
+
...styles,
|
|
21
|
+
color: textColorTextState,
|
|
22
|
+
typo: typoText,
|
|
23
|
+
spacing: '0px',
|
|
24
|
+
align: alignText
|
|
25
|
+
},
|
|
26
|
+
style: style ?? {},
|
|
27
|
+
setting: {
|
|
28
|
+
...setting,
|
|
29
|
+
text: label,
|
|
30
|
+
globalSize: globalSizeText,
|
|
31
|
+
excludeFlex: true,
|
|
32
|
+
translate: undefined
|
|
33
|
+
}
|
|
34
|
+
}))}
|
|
35
|
+
${core.RenderIf(readMoreType === 'button', Button_liquid.default({
|
|
36
|
+
builderAttrs,
|
|
37
|
+
builderProps,
|
|
38
|
+
advanced,
|
|
39
|
+
styles: {
|
|
40
|
+
...styles,
|
|
41
|
+
typo: typoBtn,
|
|
42
|
+
globalSize: globalSizeBtn,
|
|
43
|
+
textColor: textColorBtnState,
|
|
44
|
+
align: alignBtn
|
|
45
|
+
},
|
|
46
|
+
style: style ?? {},
|
|
47
|
+
setting: {
|
|
48
|
+
...setting,
|
|
49
|
+
label: label,
|
|
50
|
+
htmlType: 'button',
|
|
51
|
+
translate: undefined
|
|
52
|
+
}
|
|
53
|
+
}))}
|
|
54
|
+
</a>
|
|
55
|
+
`;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
exports.default = ArticleReadMore;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var core = require('@gem-sdk/core');
|
|
7
|
+
var Text_liquid = require('../../text/components/Text.liquid.js');
|
|
8
|
+
|
|
9
|
+
const ArticleTag = ({ setting, styles, advanced, builderProps })=>{
|
|
10
|
+
return core.template`
|
|
11
|
+
{%- assign tagsString = article.tags | join: ', ' -%}
|
|
12
|
+
${Text_liquid.default({
|
|
13
|
+
styles: styles,
|
|
14
|
+
setting: {
|
|
15
|
+
...setting,
|
|
16
|
+
text: '{{tagsString}}',
|
|
17
|
+
excludeFlex: true
|
|
18
|
+
},
|
|
19
|
+
advanced,
|
|
20
|
+
builderAttrs: {
|
|
21
|
+
'data-id': builderProps?.uid
|
|
22
|
+
}
|
|
23
|
+
})}
|
|
24
|
+
`;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.default = ArticleTag;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5
|
+
|
|
6
|
+
var core = require('@gem-sdk/core');
|
|
7
|
+
var Text_liquid = require('../../text/components/Text.liquid.js');
|
|
8
|
+
|
|
9
|
+
const ArticleTitle = ({ setting, styles, advanced, builderProps })=>{
|
|
10
|
+
const target = setting?.openNewTab ? '_blank' : '_self';
|
|
11
|
+
return core.template`
|
|
12
|
+
${setting?.enableLink && setting?.linkArticle ? `
|
|
13
|
+
<a href="{{article.url}}" target="${{
|
|
14
|
+
target
|
|
15
|
+
}}" title="{{article.title}}">
|
|
16
|
+
${Text_liquid.default({
|
|
17
|
+
styles: styles,
|
|
18
|
+
setting: {
|
|
19
|
+
...setting,
|
|
20
|
+
text: '{{article.title}}',
|
|
21
|
+
excludeFlex: true
|
|
22
|
+
},
|
|
23
|
+
advanced: advanced,
|
|
24
|
+
builderAttrs: {
|
|
25
|
+
'data-id': builderProps?.uid
|
|
26
|
+
}
|
|
27
|
+
})}
|
|
28
|
+
</a>
|
|
29
|
+
` : `
|
|
30
|
+
${Text_liquid.default({
|
|
31
|
+
styles: styles,
|
|
32
|
+
setting: {
|
|
33
|
+
...setting,
|
|
34
|
+
text: '{{article.title}}',
|
|
35
|
+
excludeFlex: true
|
|
36
|
+
},
|
|
37
|
+
advanced: advanced,
|
|
38
|
+
builderAttrs: {
|
|
39
|
+
'data-id': builderProps?.uid
|
|
40
|
+
}
|
|
41
|
+
})}
|
|
42
|
+
`}
|
|
43
|
+
`;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
exports.default = ArticleTitle;
|
package/dist/cjs/builder.js
CHANGED
|
@@ -104,7 +104,7 @@ var ProductPrice = require('./post-purchase/product/components/ProductPrice.js')
|
|
|
104
104
|
var ProductVariant = require('./post-purchase/product/components/product-variant/components/ProductVariant.js');
|
|
105
105
|
var AcceptButton = require('./post-purchase/product/components/AcceptButton.js');
|
|
106
106
|
var ProductQuantity = require('./post-purchase/product/components/ProductQuantity.js');
|
|
107
|
-
var ProductOffer = require('./post-purchase/product/components/ProductOffer.js');
|
|
107
|
+
var ProductOffer = require('./post-purchase/product/components/product-offer/components/ProductOffer.js');
|
|
108
108
|
var ProductPriceBreakdown = require('./post-purchase/product/components/ProductPriceBreakdown.js');
|
|
109
109
|
var ProductDiscountTag = require('./post-purchase/product/components/ProductDiscountTag.js');
|
|
110
110
|
var index$3 = require('./post-purchase/product/components/product-image/index.js');
|
|
@@ -17,10 +17,12 @@ var helpers = require('./common/helpers.js');
|
|
|
17
17
|
|
|
18
18
|
const Button = (props)=>{
|
|
19
19
|
const { children, advanced, className, nodePrice, customAttrs, styles: styles$1 = {}, setting = {}, builderProps, builderAttrs, wrapClassName = '', onClick } = props;
|
|
20
|
-
const { iconSvg, btnLink, htmlType, loading, disabled, shouldClearSpace } = setting;
|
|
20
|
+
const { iconSvg, btnLink, htmlType, loading, disabled, shouldClearSpace, enableBtnLink } = setting;
|
|
21
|
+
const { enableTextStyle = true } = styles$1;
|
|
21
22
|
const mode = core.useEditorMode();
|
|
22
23
|
const { customCss, wrapStyle, restStyle, dataState, dataIdAttr, isShowIcon, isScrollToElement, getArialLabel, getLabelToDisplay, checkIsShowLabel, checkIsEditableLabel } = data.getData(props);
|
|
23
24
|
const { HTMLTag, urlData, shouldRenderLink } = helpers.getInsertLinkData({
|
|
25
|
+
enableBtnLink,
|
|
24
26
|
htmlType,
|
|
25
27
|
setting: btnLink,
|
|
26
28
|
defaultTag: 'button'
|
|
@@ -59,7 +61,6 @@ const Button = (props)=>{
|
|
|
59
61
|
});
|
|
60
62
|
const buttonWrapperAttrs = system.createAttr({
|
|
61
63
|
...attributes.getButtonAttributes({
|
|
62
|
-
urlData,
|
|
63
64
|
disabled,
|
|
64
65
|
dataState,
|
|
65
66
|
dataId: dataIdAttr,
|
|
@@ -93,6 +94,7 @@ const Button = (props)=>{
|
|
|
93
94
|
/*#__PURE__*/ jsxRuntime.jsxs(ButtonWrapper, {
|
|
94
95
|
...buttonWrapperAttrs,
|
|
95
96
|
...customAttrs,
|
|
97
|
+
setting: urlData,
|
|
96
98
|
style: buttonStyles,
|
|
97
99
|
className: buttonClasses,
|
|
98
100
|
onClick: handleClick,
|
|
@@ -106,7 +108,7 @@ const Button = (props)=>{
|
|
|
106
108
|
styles: buttonIconStyles,
|
|
107
109
|
classes: buttonIconClasses
|
|
108
110
|
})),
|
|
109
|
-
system.If(checkIsShowLabel(), /*#__PURE__*/ jsxRuntime.jsx(ButtonLabel.default, {
|
|
111
|
+
system.If(enableTextStyle && checkIsShowLabel(), /*#__PURE__*/ jsxRuntime.jsx(ButtonLabel.default, {
|
|
110
112
|
label: getLabelToDisplay(),
|
|
111
113
|
classes: buttonLabelClasses
|
|
112
114
|
}))
|
|
@@ -16,9 +16,11 @@ var helpers = require('./common/helpers.js');
|
|
|
16
16
|
|
|
17
17
|
const Button = (props)=>{
|
|
18
18
|
const { advanced, className, nodePrice, customAttrs, styles: styles$1 = {}, setting = {}, builderProps, wrapClassName = '' } = props;
|
|
19
|
-
const { iconSvg, loading, btnLink, htmlType, disabled, shouldClearSpace } = setting;
|
|
19
|
+
const { iconSvg, loading, btnLink, htmlType, disabled, shouldClearSpace, enableBtnLink } = setting;
|
|
20
|
+
const { enableTextStyle = true } = styles$1;
|
|
20
21
|
const { customCss, wrapStyle, restStyle, dataState, dataIdAttr, isShowIcon, isScrollToElement, getArialLabel, getLabelToDisplay, checkIsShowLabel, checkIsEditableLabel } = data.getData(props);
|
|
21
22
|
const { HTMLTag, urlData, shouldRenderLink } = helpers.getInsertLinkData({
|
|
23
|
+
enableBtnLink,
|
|
22
24
|
htmlType,
|
|
23
25
|
setting: btnLink,
|
|
24
26
|
defaultTag: 'button',
|
|
@@ -60,7 +62,6 @@ const Button = (props)=>{
|
|
|
60
62
|
});
|
|
61
63
|
const buttonWrapperAttrs = system.createAttr({
|
|
62
64
|
...attributes.getButtonAttributes({
|
|
63
|
-
urlData,
|
|
64
65
|
disabled,
|
|
65
66
|
dataState,
|
|
66
67
|
dataId: dataIdAttr,
|
|
@@ -92,6 +93,9 @@ const Button = (props)=>{
|
|
|
92
93
|
}}
|
|
93
94
|
${{
|
|
94
95
|
...customAttrs
|
|
96
|
+
}}
|
|
97
|
+
${{
|
|
98
|
+
...urlData
|
|
95
99
|
}}
|
|
96
100
|
style="${buttonStyles}"
|
|
97
101
|
class="${buttonClasses}"
|
|
@@ -103,7 +107,7 @@ const Button = (props)=>{
|
|
|
103
107
|
styles: buttonIconStyles,
|
|
104
108
|
classes: buttonIconClasses
|
|
105
109
|
}))}
|
|
106
|
-
${system.If(checkIsShowLabel({
|
|
110
|
+
${system.If(enableTextStyle && checkIsShowLabel({
|
|
107
111
|
isLiquid: true
|
|
108
112
|
}), ButtonLabel_liquid.default({
|
|
109
113
|
label: getLabelToDisplay({
|
|
@@ -70,7 +70,7 @@ const getDataId = (uidInteraction, dataId, uid)=>{
|
|
|
70
70
|
const handleGetArialLabel = ({ label, isLiquid = false })=>{
|
|
71
71
|
return isLiquid ? label?.toString().replaceAll("'", ''').replaceAll('"', "'") ?? '' : label?.toString() ?? '';
|
|
72
72
|
};
|
|
73
|
-
const getInsertLinkData = ({ setting, htmlType, defaultTag, isLiquid = false })=>{
|
|
73
|
+
const getInsertLinkData = ({ setting, htmlType, defaultTag, enableBtnLink, isLiquid = false })=>{
|
|
74
74
|
const URL_INCLUDES = [
|
|
75
75
|
'product.url'
|
|
76
76
|
];
|
|
@@ -91,7 +91,7 @@ const getInsertLinkData = ({ setting, htmlType, defaultTag, isLiquid = false })=
|
|
|
91
91
|
if (URL_START_WITH.find((el)=>urlHref.startsWith(el))) return true;
|
|
92
92
|
return false;
|
|
93
93
|
};
|
|
94
|
-
const shouldRenderLink = isDomain || isShopifyDomain || isLink() || isHomePageHref;
|
|
94
|
+
const shouldRenderLink = enableBtnLink ? isDomain || isShopifyDomain || isLink() || isHomePageHref : false;
|
|
95
95
|
let transformedUrl = urlHref;
|
|
96
96
|
if (isLiquid && (isShopifyDomain || isHomePageHref)) {
|
|
97
97
|
transformedUrl = setting?.isTranslate ? '$locationOrigin' + urlHref : "{{ request.origin }}{{ routes.root_url | split: '/' | join: '/' }}" + urlHref;
|
|
@@ -54,7 +54,7 @@ const getSizeStyles = (styles)=>{
|
|
|
54
54
|
};
|
|
55
55
|
const getTypoStyles = (styles)=>{
|
|
56
56
|
return {
|
|
57
|
-
...core.makeStyleResponsiveState('c', styles?.textColorHover),
|
|
57
|
+
...core.makeStyleResponsiveState('c', processResponsiveHoverColors(styles?.textColorHover)),
|
|
58
58
|
...core.composeTypographyStyle(styles?.typo, styles?.typography),
|
|
59
59
|
...core.getStyleShadow({
|
|
60
60
|
styleAppliedFor: 'text-shadow',
|
|
@@ -63,6 +63,32 @@ const getTypoStyles = (styles)=>{
|
|
|
63
63
|
})
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Process hover color for a single device
|
|
68
|
+
*/ const processDeviceHoverColor = (deviceStyle)=>{
|
|
69
|
+
if (!deviceStyle?.hover) return deviceStyle;
|
|
70
|
+
return {
|
|
71
|
+
...deviceStyle,
|
|
72
|
+
hover: core.getSingleColorVariable(deviceStyle.hover)
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Process hover colors for all responsive devices
|
|
77
|
+
*/ const processResponsiveHoverColors = (responsiveStyle)=>{
|
|
78
|
+
if (!responsiveStyle) return {};
|
|
79
|
+
const devices = [
|
|
80
|
+
'desktop',
|
|
81
|
+
'tablet',
|
|
82
|
+
'mobile'
|
|
83
|
+
];
|
|
84
|
+
return devices.reduce((acc, device)=>{
|
|
85
|
+
const processedStyle = processDeviceHoverColor(responsiveStyle[device]);
|
|
86
|
+
if (processedStyle) {
|
|
87
|
+
acc[device] = processedStyle;
|
|
88
|
+
}
|
|
89
|
+
return acc;
|
|
90
|
+
}, {});
|
|
91
|
+
};
|
|
66
92
|
const getBackgroundStyles = (styles)=>{
|
|
67
93
|
return {
|
|
68
94
|
...core.getStyleBackgroundImageByDevice(styles?.backgroundImage),
|
|
@@ -152,3 +178,5 @@ exports.getButtonWrapperStyles = getButtonWrapperStyles;
|
|
|
152
178
|
exports.getCustomCssStyles = getCustomCssStyles;
|
|
153
179
|
exports.getRadiusStyles = getRadiusStyles;
|
|
154
180
|
exports.getShadowStyles = getShadowStyles;
|
|
181
|
+
exports.processDeviceHoverColor = processDeviceHoverColor;
|
|
182
|
+
exports.processResponsiveHoverColors = processResponsiveHoverColors;
|
|
@@ -15,6 +15,11 @@ const ButtonSettings = [
|
|
|
15
15
|
type: 'input',
|
|
16
16
|
default: 'label'
|
|
17
17
|
},
|
|
18
|
+
{
|
|
19
|
+
id: 'enableBtnLink',
|
|
20
|
+
type: 'toggle',
|
|
21
|
+
default: false
|
|
22
|
+
},
|
|
18
23
|
{
|
|
19
24
|
id: 'btnLink',
|
|
20
25
|
type: 'pick-link',
|
|
@@ -385,11 +390,20 @@ const ButtonSettings = [
|
|
|
385
390
|
}
|
|
386
391
|
}
|
|
387
392
|
},
|
|
393
|
+
{
|
|
394
|
+
id: 'enableTextStyle',
|
|
395
|
+
label: '',
|
|
396
|
+
type: 'toggle',
|
|
397
|
+
default: true
|
|
398
|
+
},
|
|
388
399
|
{
|
|
389
400
|
id: 'typo',
|
|
390
401
|
type: 'typography-v2',
|
|
391
402
|
default: {
|
|
392
|
-
type: 'paragraph-1'
|
|
403
|
+
type: 'paragraph-1',
|
|
404
|
+
attrs: {
|
|
405
|
+
color: 'text-1'
|
|
406
|
+
}
|
|
393
407
|
},
|
|
394
408
|
ignoreReRender: true,
|
|
395
409
|
hiddenSetting: {
|
|
@@ -401,12 +415,16 @@ const ButtonSettings = [
|
|
|
401
415
|
type: 'color-picker-v2',
|
|
402
416
|
devices: {
|
|
403
417
|
desktop: {
|
|
404
|
-
default: {
|
|
418
|
+
default: {
|
|
419
|
+
hover: 'text-3'
|
|
420
|
+
}
|
|
405
421
|
}
|
|
406
422
|
},
|
|
407
423
|
compoDefaultValue: {
|
|
408
424
|
desktop: {
|
|
409
|
-
default: {
|
|
425
|
+
default: {
|
|
426
|
+
hover: 'text-3'
|
|
427
|
+
}
|
|
410
428
|
}
|
|
411
429
|
},
|
|
412
430
|
enableGradient: true
|
|
@@ -544,10 +562,12 @@ const ButtonSettings = [
|
|
|
544
562
|
},
|
|
545
563
|
{
|
|
546
564
|
id: 'iconSpacing',
|
|
547
|
-
type: 'input:
|
|
565
|
+
type: 'input:slider',
|
|
548
566
|
units: [
|
|
549
567
|
'px'
|
|
550
568
|
],
|
|
569
|
+
step: 1,
|
|
570
|
+
max: 40,
|
|
551
571
|
devices: {
|
|
552
572
|
desktop: {
|
|
553
573
|
default: '8px'
|