@gem-sdk/components 2.1.15 → 2.1.17
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/builder.js +25 -1
- package/dist/cjs/collection/components/CollectionDescription.js +101 -7
- package/dist/cjs/collection/components/CollectionDescription.liquid.js +102 -9
- package/dist/cjs/collection/setting/CollectionDescription.js +128 -0
- package/dist/cjs/index.js +24 -0
- package/dist/cjs/index.liquid.js +24 -0
- package/dist/cjs/product/components/ProductDescription/common.js +28 -0
- package/dist/cjs/product/components/ProductDescription/const.js +5 -0
- package/dist/cjs/product/components/ProductDescription.js +38 -10
- package/dist/cjs/product/components/ProductDescription.liquid.js +3 -1
- package/dist/cjs/third-party/components/AlsoBoughtCbb.js +32 -0
- package/dist/cjs/third-party/components/AlsoBoughtCbb.liquid.js +21 -0
- package/dist/cjs/third-party/components/BfSizeChartSizeGuide.js +32 -0
- package/dist/cjs/third-party/components/BfSizeChartSizeGuide.liquid.js +12 -0
- package/dist/cjs/third-party/components/EssentialAnnouncementBar.js +32 -0
- package/dist/cjs/third-party/components/EssentialAnnouncementBar.liquid.js +12 -0
- package/dist/cjs/third-party/components/EssentialCountdownTimerBar.js +32 -0
- package/dist/cjs/third-party/components/EssentialCountdownTimerBar.liquid.js +12 -0
- package/dist/cjs/third-party/components/EstimatedDeliveryDatePlus.js +32 -0
- package/dist/cjs/third-party/components/EstimatedDeliveryDatePlus.liquid.js +12 -0
- package/dist/cjs/third-party/components/GloColorSwatchvariantImage.js +32 -0
- package/dist/cjs/third-party/components/GloColorSwatchvariantImage.liquid.js +12 -0
- package/dist/cjs/third-party/components/HextomCountdownTimerBar.js +32 -0
- package/dist/cjs/third-party/components/HextomCountdownTimerBar.liquid.js +12 -0
- package/dist/cjs/third-party/components/HextomFreeShippingBar.js +32 -0
- package/dist/cjs/third-party/components/HextomFreeShippingBar.liquid.js +12 -0
- package/dist/cjs/third-party/components/OkendoReviewsLoyalty.js +32 -0
- package/dist/cjs/third-party/components/OkendoReviewsLoyalty.liquid.js +12 -0
- package/dist/cjs/third-party/components/StellarDeliveryDatePickup.js +32 -0
- package/dist/cjs/third-party/components/StellarDeliveryDatePickup.liquid.js +21 -0
- package/dist/cjs/third-party/components/TrustBadgesBear.js +32 -0
- package/dist/cjs/third-party/components/TrustBadgesBear.liquid.js +12 -0
- package/dist/cjs/third-party/components/TrustedsiteTrustBadges.js +32 -0
- package/dist/cjs/third-party/components/TrustedsiteTrustBadges.liquid.js +12 -0
- package/dist/cjs/third-party/configs/AlsoBoughtCbb.js +12 -0
- package/dist/cjs/third-party/configs/BfSizeChartSizeGuide.js +12 -0
- package/dist/cjs/third-party/configs/EssentialAnnouncementBar.js +12 -0
- package/dist/cjs/third-party/configs/EssentialCountdownTimerBar.js +12 -0
- package/dist/cjs/third-party/configs/EstimatedDeliveryDatePlus.js +12 -0
- package/dist/cjs/third-party/configs/GloColorSwatchvariantImage.js +12 -0
- package/dist/cjs/third-party/configs/HextomCountdownTimerBar.js +12 -0
- package/dist/cjs/third-party/configs/HextomFreeShippingBar.js +12 -0
- package/dist/cjs/third-party/configs/OkendoReviewsLoyalty.js +12 -0
- package/dist/cjs/third-party/configs/StellarDeliveryDatePickup.js +12 -0
- package/dist/cjs/third-party/configs/TrustBadgesBear.js +12 -0
- package/dist/cjs/third-party/configs/TrustedsiteTrustBadges.js +12 -0
- package/dist/cjs/third-party/helpers/thirdParty.js +1 -1
- package/dist/cjs/third-party/next.js +61 -1
- package/dist/cjs/third-party/setting/AlsoBoughtCbb.js +127 -0
- package/dist/cjs/third-party/setting/BfSizeChartSizeGuide.js +131 -0
- package/dist/cjs/third-party/setting/EssentialAnnouncementBar.js +142 -0
- package/dist/cjs/third-party/setting/EssentialCountdownTimerBar.js +142 -0
- package/dist/cjs/third-party/setting/EstimatedDeliveryDatePlus.js +128 -0
- package/dist/cjs/third-party/setting/GloColorSwatchvariantImage.js +152 -0
- package/dist/cjs/third-party/setting/HextomCountdownTimerBar.js +128 -0
- package/dist/cjs/third-party/setting/HextomFreeShippingBar.js +128 -0
- package/dist/cjs/third-party/setting/OkendoReviewsLoyalty.js +171 -0
- package/dist/cjs/third-party/setting/StellarDeliveryDatePickup.js +127 -0
- package/dist/cjs/third-party/setting/TrustBadgesBear.js +128 -0
- package/dist/cjs/third-party/setting/TrustedsiteTrustBadges.js +177 -0
- package/dist/cjs/third-party/setting/index.js +25 -1
- package/dist/esm/builder.js +25 -1
- package/dist/esm/collection/components/CollectionDescription.js +103 -9
- package/dist/esm/collection/components/CollectionDescription.liquid.js +103 -10
- package/dist/esm/collection/setting/CollectionDescription.js +128 -0
- package/dist/esm/index.js +12 -0
- package/dist/esm/index.liquid.js +12 -0
- package/dist/esm/product/components/ProductDescription/common.js +26 -0
- package/dist/esm/product/components/ProductDescription/const.js +3 -0
- package/dist/esm/product/components/ProductDescription.js +38 -10
- package/dist/esm/product/components/ProductDescription.liquid.js +3 -1
- package/dist/esm/third-party/components/AlsoBoughtCbb.js +28 -0
- package/dist/esm/third-party/components/AlsoBoughtCbb.liquid.js +17 -0
- package/dist/esm/third-party/components/BfSizeChartSizeGuide.js +28 -0
- package/dist/esm/third-party/components/BfSizeChartSizeGuide.liquid.js +8 -0
- package/dist/esm/third-party/components/EssentialAnnouncementBar.js +28 -0
- package/dist/esm/third-party/components/EssentialAnnouncementBar.liquid.js +8 -0
- package/dist/esm/third-party/components/EssentialCountdownTimerBar.js +28 -0
- package/dist/esm/third-party/components/EssentialCountdownTimerBar.liquid.js +8 -0
- package/dist/esm/third-party/components/EstimatedDeliveryDatePlus.js +28 -0
- package/dist/esm/third-party/components/EstimatedDeliveryDatePlus.liquid.js +8 -0
- package/dist/esm/third-party/components/GloColorSwatchvariantImage.js +28 -0
- package/dist/esm/third-party/components/GloColorSwatchvariantImage.liquid.js +8 -0
- package/dist/esm/third-party/components/HextomCountdownTimerBar.js +28 -0
- package/dist/esm/third-party/components/HextomCountdownTimerBar.liquid.js +8 -0
- package/dist/esm/third-party/components/HextomFreeShippingBar.js +28 -0
- package/dist/esm/third-party/components/HextomFreeShippingBar.liquid.js +8 -0
- package/dist/esm/third-party/components/OkendoReviewsLoyalty.js +28 -0
- package/dist/esm/third-party/components/OkendoReviewsLoyalty.liquid.js +8 -0
- package/dist/esm/third-party/components/StellarDeliveryDatePickup.js +28 -0
- package/dist/esm/third-party/components/StellarDeliveryDatePickup.liquid.js +17 -0
- package/dist/esm/third-party/components/TrustBadgesBear.js +28 -0
- package/dist/esm/third-party/components/TrustBadgesBear.liquid.js +8 -0
- package/dist/esm/third-party/components/TrustedsiteTrustBadges.js +28 -0
- package/dist/esm/third-party/components/TrustedsiteTrustBadges.liquid.js +8 -0
- package/dist/esm/third-party/configs/AlsoBoughtCbb.js +8 -0
- package/dist/esm/third-party/configs/BfSizeChartSizeGuide.js +8 -0
- package/dist/esm/third-party/configs/EssentialAnnouncementBar.js +8 -0
- package/dist/esm/third-party/configs/EssentialCountdownTimerBar.js +8 -0
- package/dist/esm/third-party/configs/EstimatedDeliveryDatePlus.js +8 -0
- package/dist/esm/third-party/configs/GloColorSwatchvariantImage.js +8 -0
- package/dist/esm/third-party/configs/HextomCountdownTimerBar.js +8 -0
- package/dist/esm/third-party/configs/HextomFreeShippingBar.js +8 -0
- package/dist/esm/third-party/configs/OkendoReviewsLoyalty.js +8 -0
- package/dist/esm/third-party/configs/StellarDeliveryDatePickup.js +8 -0
- package/dist/esm/third-party/configs/TrustBadgesBear.js +8 -0
- package/dist/esm/third-party/configs/TrustedsiteTrustBadges.js +8 -0
- package/dist/esm/third-party/helpers/thirdParty.js +1 -1
- package/dist/esm/third-party/next.js +61 -1
- package/dist/esm/third-party/setting/AlsoBoughtCbb.js +123 -0
- package/dist/esm/third-party/setting/BfSizeChartSizeGuide.js +127 -0
- package/dist/esm/third-party/setting/EssentialAnnouncementBar.js +138 -0
- package/dist/esm/third-party/setting/EssentialCountdownTimerBar.js +138 -0
- package/dist/esm/third-party/setting/EstimatedDeliveryDatePlus.js +124 -0
- package/dist/esm/third-party/setting/GloColorSwatchvariantImage.js +148 -0
- package/dist/esm/third-party/setting/HextomCountdownTimerBar.js +124 -0
- package/dist/esm/third-party/setting/HextomFreeShippingBar.js +124 -0
- package/dist/esm/third-party/setting/OkendoReviewsLoyalty.js +167 -0
- package/dist/esm/third-party/setting/StellarDeliveryDatePickup.js +123 -0
- package/dist/esm/third-party/setting/TrustBadgesBear.js +124 -0
- package/dist/esm/third-party/setting/TrustedsiteTrustBadges.js +173 -0
- package/dist/esm/third-party/setting/index.js +226 -202
- package/dist/types/index.d.ts +204 -2
- package/package.json +2 -2
|
@@ -1,15 +1,109 @@
|
|
|
1
|
-
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useCollection } from '@gem-sdk/core';
|
|
3
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { useCurrentDevice, useCollection, getResponsiveValueByScreen, composeTypographyClassName, composeTypographyStyle, isSafari, cls, getGlobalColorClass, getStyleShadow, makeStyleResponsive, makeStyle, getGlobalColorStyle } from '@gem-sdk/core';
|
|
3
|
+
import { useState, useRef, useEffect } from 'react';
|
|
4
4
|
|
|
5
|
-
const CollectionDescription = ({ setting })=>{
|
|
5
|
+
const CollectionDescription = ({ setting, builderProps })=>{
|
|
6
|
+
const [open, setOpen] = useState(false);
|
|
7
|
+
const [isShowViewMore, allowShowViewMore] = useState(false);
|
|
8
|
+
const ref = useRef(null);
|
|
9
|
+
const currentDevice = useCurrentDevice();
|
|
6
10
|
const collection = useCollection();
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
const hasLineClamp = getResponsiveValueByScreen(setting?.hasLineClamp, currentDevice);
|
|
12
|
+
const lineClamp = getResponsiveValueByScreen(setting?.lineClamp, currentDevice);
|
|
13
|
+
const appendTypoClass = composeTypographyClassName(setting?.typo, setting?.typography);
|
|
14
|
+
const appendTypoStyle = composeTypographyStyle(setting?.typo, setting?.typography);
|
|
15
|
+
useEffect(()=>{
|
|
16
|
+
const dom = ref.current;
|
|
17
|
+
setOpen(false);
|
|
18
|
+
if (dom && hasLineClamp && collection?.description) {
|
|
19
|
+
const value = lineClamp;
|
|
20
|
+
setTimeout(()=>{
|
|
21
|
+
const scrollHeight = dom?.scrollHeight ?? 0;
|
|
22
|
+
const clientHeight = dom?.clientHeight ?? 0;
|
|
23
|
+
const lineHeight = window.getComputedStyle(dom).getPropertyValue('line-height');
|
|
24
|
+
const lineText = Math.round((scrollHeight ?? 0) / parseInt(lineHeight));
|
|
25
|
+
const conditionCheckLine = isSafari() ? value && value < lineText : clientHeight < scrollHeight;
|
|
26
|
+
if (value && conditionCheckLine) {
|
|
27
|
+
allowShowViewMore(()=>true);
|
|
28
|
+
} else {
|
|
29
|
+
allowShowViewMore(()=>false);
|
|
30
|
+
}
|
|
31
|
+
}, 100);
|
|
12
32
|
}
|
|
33
|
+
}, [
|
|
34
|
+
hasLineClamp,
|
|
35
|
+
lineClamp,
|
|
36
|
+
collection?.description
|
|
37
|
+
]);
|
|
38
|
+
const css = `
|
|
39
|
+
.gp-p-description-text > *:not(ol):not(ul):not(table):not(div) {
|
|
40
|
+
display: inline !important;
|
|
41
|
+
}
|
|
42
|
+
.gp-p-description-text > *:not(ol):not(ul):not(table):not(div)::after {
|
|
43
|
+
content: "\\A";
|
|
44
|
+
white-space: pre;
|
|
45
|
+
}
|
|
46
|
+
.gp-p-description-text > table {
|
|
47
|
+
box-shadow: none;
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
const hasDescription = collection?.description && collection.description?.trim() != '';
|
|
51
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
52
|
+
"data-id": builderProps?.uid,
|
|
53
|
+
children: [
|
|
54
|
+
!isSafari() && /*#__PURE__*/ jsx("style", {
|
|
55
|
+
children: css
|
|
56
|
+
}),
|
|
57
|
+
/*#__PURE__*/ jsx("div", {
|
|
58
|
+
ref: ref,
|
|
59
|
+
"data-gp-text": true,
|
|
60
|
+
className: cls('gp-p-description-text gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre', appendTypoClass, !hasDescription ? 'gp-p-2 gp-text-center gp-text-sm gp-font-semibold gp-text-gray-500 gp-py-2 !gp-text-center' : '', getGlobalColorClass('text', setting?.color)),
|
|
61
|
+
style: {
|
|
62
|
+
...getStyleShadow({
|
|
63
|
+
styleAppliedFor: 'text-shadow'
|
|
64
|
+
}),
|
|
65
|
+
...makeStyleResponsive('ta', setting?.textAlign),
|
|
66
|
+
...hasLineClamp && !open ? makeStyleResponsive('line-clamp', setting?.lineClamp) : {},
|
|
67
|
+
...makeStyle({
|
|
68
|
+
tt: setting?.transform
|
|
69
|
+
}),
|
|
70
|
+
...appendTypoStyle
|
|
71
|
+
},
|
|
72
|
+
dangerouslySetInnerHTML: {
|
|
73
|
+
__html: collection?.descriptionHtml && hasDescription ? collection.descriptionHtml : ``
|
|
74
|
+
}
|
|
75
|
+
}),
|
|
76
|
+
hasLineClamp && isShowViewMore && /*#__PURE__*/ jsxs("button", {
|
|
77
|
+
className: cls(appendTypoClass, getGlobalColorClass('text', setting?.showMoreColor), 'gp-mt-4 gp-w-full gp-transition-all hover:gp-opacity-80'),
|
|
78
|
+
style: {
|
|
79
|
+
...makeStyleResponsive('ta', setting?.textAlign),
|
|
80
|
+
...makeStyle({
|
|
81
|
+
tt: setting?.transform
|
|
82
|
+
}),
|
|
83
|
+
...appendTypoStyle,
|
|
84
|
+
...getGlobalColorStyle(setting?.showMoreColor)
|
|
85
|
+
},
|
|
86
|
+
onClick: ()=>setOpen((prev)=>!prev),
|
|
87
|
+
children: [
|
|
88
|
+
!open ? setting?.viewMoreText : setting?.viewLessText,
|
|
89
|
+
setting?.enableViewMoreIcon && /*#__PURE__*/ jsx("svg", {
|
|
90
|
+
className: "gp-ml-1 gp-inline-block",
|
|
91
|
+
height: "1em",
|
|
92
|
+
width: "1em",
|
|
93
|
+
viewBox: "0 0 22 12",
|
|
94
|
+
fill: "none",
|
|
95
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
96
|
+
children: !open ? /*#__PURE__*/ jsx("path", {
|
|
97
|
+
d: "M1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L1.70711 0.292893ZM11 11L10.2929 11.7071C10.6834 12.0976 11.3166 12.0976 11.7071 11.7071L11 11ZM21.7071 1.70711C22.0976 1.31658 22.0976 0.683417 21.7071 0.292893C21.3166 -0.0976311 20.6834 -0.0976311 20.2929 0.292893L21.7071 1.70711ZM0.292893 1.70711L10.2929 11.7071L11.7071 10.2929L1.70711 0.292893L0.292893 1.70711ZM11.7071 11.7071L21.7071 1.70711L20.2929 0.292893L10.2929 10.2929L11.7071 11.7071Z",
|
|
98
|
+
fill: "currentColor"
|
|
99
|
+
}) : /*#__PURE__*/ jsx("path", {
|
|
100
|
+
d: "M0.292893 10.2929C-0.0976311 10.6834 -0.0976311 11.3166 0.292893 11.7071C0.683417 12.0976 1.31658 12.0976 1.70711 11.7071L0.292893 10.2929ZM11 1L11.7071 0.292893C11.3166 -0.0976311 10.6834 -0.0976311 10.2929 0.292893L11 1ZM20.2929 11.7071C20.6834 12.0976 21.3166 12.0976 21.7071 11.7071C22.0976 11.3166 22.0976 10.6834 21.7071 10.2929L20.2929 11.7071ZM1.70711 11.7071L11.7071 1.70711L10.2929 0.292893L0.292893 10.2929L1.70711 11.7071ZM10.2929 1.70711L20.2929 11.7071L21.7071 10.2929L11.7071 0.292893L10.2929 1.70711Z",
|
|
101
|
+
fill: "currentColor"
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
})
|
|
106
|
+
]
|
|
13
107
|
});
|
|
14
108
|
};
|
|
15
109
|
|
|
@@ -1,16 +1,109 @@
|
|
|
1
|
-
import { template } from '@gem-sdk/core';
|
|
2
|
-
import
|
|
1
|
+
import { composeTypographyStyle, composeTypographyClassName, getStyleShadow, makeStyleResponsive, getGlobalColorStyle, makeStyle, makeLineClamp, template, cls, getGlobalColorClass, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
|
|
2
|
+
import { getDynamicSourceLocales, getSettingPreloadData } from '../../helpers.js';
|
|
3
|
+
import { getDisplayStyle } from '../../product/components/ProductImages/common/common.js';
|
|
3
4
|
|
|
4
|
-
const CollectionDescription = ({ setting })=>{
|
|
5
|
+
const CollectionDescription = ({ setting, advanced, builderProps, pageContext })=>{
|
|
6
|
+
const appendTypoStyle = composeTypographyStyle(setting?.typo, setting?.typography);
|
|
7
|
+
const appendTypoClass = composeTypographyClassName(setting?.typo, setting?.typography);
|
|
8
|
+
const defaultStyle = {
|
|
9
|
+
...getStyleShadow({
|
|
10
|
+
styleAppliedFor: 'text-shadow'
|
|
11
|
+
}),
|
|
12
|
+
...makeStyleResponsive('ta', setting?.textAlign),
|
|
13
|
+
...getGlobalColorStyle(setting?.color),
|
|
14
|
+
...makeStyle({
|
|
15
|
+
tt: setting?.transform
|
|
16
|
+
}),
|
|
17
|
+
...appendTypoStyle
|
|
18
|
+
};
|
|
19
|
+
const collapseStyle = {
|
|
20
|
+
...defaultStyle,
|
|
21
|
+
...makeStyleResponsive('line-clamp', makeLineClamp(setting?.lineClamp, setting?.hasLineClamp))
|
|
22
|
+
};
|
|
23
|
+
const getDisplayCollapse = ()=>{
|
|
24
|
+
return getDisplayStyle((device)=>!!setting?.hasLineClamp && setting.hasLineClamp[device] !== undefined && !setting.hasLineClamp[device], 'block');
|
|
25
|
+
};
|
|
26
|
+
const moreIcon = `<svg
|
|
27
|
+
class="gp-ml-1 gp-inline-block"
|
|
28
|
+
style="display: inline-block; margin-left: 1px;"
|
|
29
|
+
height="1em"
|
|
30
|
+
width="1em"
|
|
31
|
+
viewBox="0 0 22 12"
|
|
32
|
+
fill="none"
|
|
33
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
34
|
+
>
|
|
35
|
+
<path
|
|
36
|
+
d="M1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L1.70711 0.292893ZM11 11L10.2929 11.7071C10.6834 12.0976 11.3166 12.0976 11.7071 11.7071L11 11ZM21.7071 1.70711C22.0976 1.31658 22.0976 0.683417 21.7071 0.292893C21.3166 -0.0976311 20.6834 -0.0976311 20.2929 0.292893L21.7071 1.70711ZM0.292893 1.70711L10.2929 11.7071L11.7071 10.2929L1.70711 0.292893L0.292893 1.70711ZM11.7071 11.7071L21.7071 1.70711L20.2929 0.292893L10.2929 10.2929L11.7071 11.7071Z"
|
|
37
|
+
fill="currentColor"
|
|
38
|
+
/>
|
|
39
|
+
</svg>`;
|
|
40
|
+
const viewMoreTextTranslate = getDynamicSourceLocales({
|
|
41
|
+
val: setting?.viewMoreText,
|
|
42
|
+
uid: builderProps?.uid,
|
|
43
|
+
settingId: 'viewMoreText',
|
|
44
|
+
isLiquid: true,
|
|
45
|
+
pageContext,
|
|
46
|
+
translate: setting?.translate
|
|
47
|
+
});
|
|
48
|
+
const viewLessTextTranslate = getDynamicSourceLocales({
|
|
49
|
+
val: setting?.viewLessText,
|
|
50
|
+
uid: builderProps?.uid,
|
|
51
|
+
settingId: 'viewLessText',
|
|
52
|
+
isLiquid: true,
|
|
53
|
+
pageContext,
|
|
54
|
+
translate: setting?.translate
|
|
55
|
+
});
|
|
5
56
|
return template`
|
|
6
|
-
|
|
7
|
-
styles: setting,
|
|
57
|
+
<gp-collection-description data-id="${builderProps?.uid}" class="${advanced?.cssClass} gp-collection-description" gp-data='${JSON.stringify({
|
|
8
58
|
setting: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
59
|
+
lineClamp: setting?.lineClamp,
|
|
60
|
+
hasLineClamp: setting?.hasLineClamp,
|
|
61
|
+
viewMoreText: viewMoreTextTranslate,
|
|
62
|
+
viewLessText: viewLessTextTranslate,
|
|
63
|
+
enableViewMoreIcon: setting?.enableViewMoreIcon
|
|
64
|
+
},
|
|
65
|
+
defaultStyle,
|
|
66
|
+
collapseStyle
|
|
67
|
+
}).replaceAll("'", ''')}'
|
|
68
|
+
view-more-text="${pageContext?.isPreviewing ? viewMoreTextTranslate : `{{${viewMoreTextTranslate}}}`}"
|
|
69
|
+
view-less-text="${pageContext?.isPreviewing ? viewLessTextTranslate : `{{${viewLessTextTranslate}}}`}"
|
|
70
|
+
>
|
|
71
|
+
<div></div>
|
|
72
|
+
<div
|
|
73
|
+
data-gp-text
|
|
74
|
+
class="${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")}"
|
|
75
|
+
data-gp-text
|
|
76
|
+
style="${collapseStyle}"
|
|
77
|
+
>
|
|
78
|
+
{{collection.description}}
|
|
79
|
+
</div>
|
|
80
|
+
{% if collection.description != blank -%}
|
|
81
|
+
<button
|
|
82
|
+
type="button"
|
|
83
|
+
class="p-description-show-more ${cls(appendTypoClass, getGlobalColorClass('text', setting?.showMoreColor), 'gp-mt-4 hover:gp-opacity-80 gp-transition-all gp-w-full')}"
|
|
84
|
+
style="${{
|
|
85
|
+
...makeStyle({
|
|
86
|
+
tt: setting?.transform
|
|
87
|
+
}),
|
|
88
|
+
...makeStyleResponsive('ta', setting?.textAlign),
|
|
89
|
+
...appendTypoStyle,
|
|
90
|
+
...getGlobalColorStyle(setting?.showMoreColor),
|
|
91
|
+
...getDisplayCollapse(),
|
|
92
|
+
position: 'absolute',
|
|
93
|
+
visibility: 'hidden'
|
|
94
|
+
}}"
|
|
95
|
+
>
|
|
96
|
+
${pageContext?.isPreviewing ? viewMoreTextTranslate : `{{${viewMoreTextTranslate}}}`}
|
|
97
|
+
${setting?.enableViewMoreIcon ? moreIcon : ''}
|
|
98
|
+
</button>
|
|
99
|
+
{%- endif -%}
|
|
100
|
+
{% style %}
|
|
101
|
+
.p-description-wrapper.gp-p-description-text * {
|
|
102
|
+
color: inherit
|
|
103
|
+
}
|
|
104
|
+
{% endstyle %}
|
|
105
|
+
</gp-collection-description>
|
|
106
|
+
${RenderIf(isLocalEnv, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="{{ 'gp-collection-description.js' | asset_url }}" defer="defer"></script>`, `<script ${getSettingPreloadData('class="gps-link" delay', 'src')}="${baseAssetURL}/assets-v2/gp-collection-description.js?v={{ shop.metafields.GEMPAGES.ASSETS_VERSION }}" defer="defer"></script>`)}
|
|
14
107
|
`;
|
|
15
108
|
};
|
|
16
109
|
|
|
@@ -35,6 +35,59 @@ const config = {
|
|
|
35
35
|
}
|
|
36
36
|
]
|
|
37
37
|
},
|
|
38
|
+
{
|
|
39
|
+
id: 'hasLineClamp',
|
|
40
|
+
label: 'Enable View More',
|
|
41
|
+
type: 'toggle',
|
|
42
|
+
devices: {
|
|
43
|
+
desktop: {
|
|
44
|
+
default: true
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'lineClamp',
|
|
50
|
+
label: 'Maximum Row(s) To Show',
|
|
51
|
+
type: 'input:number',
|
|
52
|
+
min: 1,
|
|
53
|
+
hide: true,
|
|
54
|
+
devices: {
|
|
55
|
+
desktop: {
|
|
56
|
+
default: 12
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
id: 'viewMoreText',
|
|
62
|
+
label: 'View More Text',
|
|
63
|
+
type: 'input',
|
|
64
|
+
default: 'Show more',
|
|
65
|
+
hide: true
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 'showMoreColor',
|
|
69
|
+
type: 'colorpicker',
|
|
70
|
+
default: 'text-1'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'viewLessText',
|
|
74
|
+
label: 'View Less Text',
|
|
75
|
+
type: 'input',
|
|
76
|
+
default: 'Show less',
|
|
77
|
+
hide: true
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'enableViewMoreIcon',
|
|
81
|
+
label: 'Enable Icon',
|
|
82
|
+
type: 'toggle',
|
|
83
|
+
default: true,
|
|
84
|
+
hide: true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 'translate',
|
|
88
|
+
type: 'input',
|
|
89
|
+
default: 'viewLessText,viewMoreText'
|
|
90
|
+
},
|
|
38
91
|
{
|
|
39
92
|
id: 'textAlign',
|
|
40
93
|
label: 'Align',
|
|
@@ -70,11 +123,86 @@ const config = {
|
|
|
70
123
|
default: 'center'
|
|
71
124
|
}
|
|
72
125
|
}
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: 'color',
|
|
129
|
+
type: 'colorpicker',
|
|
130
|
+
default: 'text-1'
|
|
73
131
|
}
|
|
74
132
|
]
|
|
75
133
|
}
|
|
76
134
|
],
|
|
77
135
|
ui: [
|
|
136
|
+
{
|
|
137
|
+
type: 'group',
|
|
138
|
+
label: {
|
|
139
|
+
en: ''
|
|
140
|
+
},
|
|
141
|
+
controls: [
|
|
142
|
+
{
|
|
143
|
+
type: 'control',
|
|
144
|
+
label: {
|
|
145
|
+
en: 'Show more'
|
|
146
|
+
},
|
|
147
|
+
options: {
|
|
148
|
+
label: 'large'
|
|
149
|
+
},
|
|
150
|
+
setting: {
|
|
151
|
+
id: 'hasLineClamp'
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
type: 'control',
|
|
156
|
+
label: {
|
|
157
|
+
en: 'Text color'
|
|
158
|
+
},
|
|
159
|
+
setting: {
|
|
160
|
+
id: 'showMoreColor'
|
|
161
|
+
},
|
|
162
|
+
condition: 'hasLineClamp == true'
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
type: 'control',
|
|
166
|
+
label: {
|
|
167
|
+
en: 'Max lines'
|
|
168
|
+
},
|
|
169
|
+
setting: {
|
|
170
|
+
id: 'lineClamp'
|
|
171
|
+
},
|
|
172
|
+
condition: 'hasLineClamp == true'
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
type: 'control',
|
|
176
|
+
label: {
|
|
177
|
+
en: 'Show more label'
|
|
178
|
+
},
|
|
179
|
+
setting: {
|
|
180
|
+
id: 'viewMoreText'
|
|
181
|
+
},
|
|
182
|
+
condition: 'hasLineClamp == true'
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
type: 'control',
|
|
186
|
+
label: {
|
|
187
|
+
en: 'Show less label'
|
|
188
|
+
},
|
|
189
|
+
setting: {
|
|
190
|
+
id: 'viewLessText'
|
|
191
|
+
},
|
|
192
|
+
condition: 'hasLineClamp == true'
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
type: 'control',
|
|
196
|
+
label: {
|
|
197
|
+
en: 'Icon'
|
|
198
|
+
},
|
|
199
|
+
setting: {
|
|
200
|
+
id: 'enableViewMoreIcon'
|
|
201
|
+
},
|
|
202
|
+
condition: 'hasLineClamp == true'
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
},
|
|
78
206
|
{
|
|
79
207
|
label: {
|
|
80
208
|
en: 'Text'
|
package/dist/esm/index.js
CHANGED
|
@@ -205,6 +205,18 @@ export { default as TrustreviewsProductReviews } from './third-party/components/
|
|
|
205
205
|
export { default as MyappgurusProductReviews } from './third-party/components/MyappgurusProductReviews.js';
|
|
206
206
|
export { default as HulkProductOptions } from './third-party/components/HulkProductOptions.js';
|
|
207
207
|
export { default as TrustshopProductReviews } from './third-party/components/TrustshopProductReviews.js';
|
|
208
|
+
export { default as StellarDeliveryDatePickup } from './third-party/components/StellarDeliveryDatePickup.js';
|
|
209
|
+
export { default as EssentialCountdownTimerBar } from './third-party/components/EssentialCountdownTimerBar.js';
|
|
210
|
+
export { default as EssentialAnnouncementBar } from './third-party/components/EssentialAnnouncementBar.js';
|
|
211
|
+
export { default as OkendoReviewsLoyalty } from './third-party/components/OkendoReviewsLoyalty.js';
|
|
212
|
+
export { default as EstimatedDeliveryDatePlus } from './third-party/components/EstimatedDeliveryDatePlus.js';
|
|
213
|
+
export { default as HextomCountdownTimerBar } from './third-party/components/HextomCountdownTimerBar.js';
|
|
214
|
+
export { default as TrustBadgesBear } from './third-party/components/TrustBadgesBear.js';
|
|
215
|
+
export { default as TrustedsiteTrustBadges } from './third-party/components/TrustedsiteTrustBadges.js';
|
|
216
|
+
export { default as GloColorSwatchvariantImage } from './third-party/components/GloColorSwatchvariantImage.js';
|
|
217
|
+
export { default as BfSizeChartSizeGuide } from './third-party/components/BfSizeChartSizeGuide.js';
|
|
218
|
+
export { default as AlsoBoughtCbb } from './third-party/components/AlsoBoughtCbb.js';
|
|
219
|
+
export { default as HextomFreeShippingBar } from './third-party/components/HextomFreeShippingBar.js';
|
|
208
220
|
export { default as thirdPartyInstantSetting } from './third-party-instant/setting/index.js';
|
|
209
221
|
export { default as InstantJudgemeReviews } from './third-party-instant/components/InstantJudgemeReviews.js';
|
|
210
222
|
export { default as InstantLooxReviews } from './third-party-instant/components/InstantLooxReviews.js';
|
package/dist/esm/index.liquid.js
CHANGED
|
@@ -160,6 +160,18 @@ export { default as TrustreviewsProductReviews } from './third-party/components/
|
|
|
160
160
|
export { default as MyappgurusProductReviews } from './third-party/components/MyappgurusProductReviews.liquid.js';
|
|
161
161
|
export { default as HulkProductOptions } from './third-party/components/HulkProductOptions.liquid.js';
|
|
162
162
|
export { default as TrustshopProductReviews } from './third-party/components/TrustshopProductReviews.liquid.js';
|
|
163
|
+
export { default as StellarDeliveryDatePickup } from './third-party/components/StellarDeliveryDatePickup.liquid.js';
|
|
164
|
+
export { default as EssentialCountdownTimerBar } from './third-party/components/EssentialCountdownTimerBar.liquid.js';
|
|
165
|
+
export { default as EssentialAnnouncementBar } from './third-party/components/EssentialAnnouncementBar.liquid.js';
|
|
166
|
+
export { default as OkendoReviewsLoyalty } from './third-party/components/OkendoReviewsLoyalty.liquid.js';
|
|
167
|
+
export { default as EstimatedDeliveryDatePlus } from './third-party/components/EstimatedDeliveryDatePlus.liquid.js';
|
|
168
|
+
export { default as HextomCountdownTimerBar } from './third-party/components/HextomCountdownTimerBar.liquid.js';
|
|
169
|
+
export { default as TrustBadgesBear } from './third-party/components/TrustBadgesBear.liquid.js';
|
|
170
|
+
export { default as TrustedsiteTrustBadges } from './third-party/components/TrustedsiteTrustBadges.liquid.js';
|
|
171
|
+
export { default as GloColorSwatchvariantImage } from './third-party/components/GloColorSwatchvariantImage.liquid.js';
|
|
172
|
+
export { default as BfSizeChartSizeGuide } from './third-party/components/BfSizeChartSizeGuide.liquid.js';
|
|
173
|
+
export { default as AlsoBoughtCbb } from './third-party/components/AlsoBoughtCbb.liquid.js';
|
|
174
|
+
export { default as HextomFreeShippingBar } from './third-party/components/HextomFreeShippingBar.liquid.js';
|
|
163
175
|
export { default as ImageComparison } from './image-comparison/components/ImageComparison.liquid.js';
|
|
164
176
|
export { default as ThirdPartySlot } from './third-party-slot/components/ThirdPartySlot.liquid.js';
|
|
165
177
|
export { default as Sticky } from './sticky/components/Sticky.liquid.js';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { getResponsiveValueByScreen, makeStyleResponsive } from '@gem-sdk/core';
|
|
2
|
+
import { DESCRIPTION_LINE_HEIGHT_DEFAULT } from './const.js';
|
|
3
|
+
|
|
4
|
+
const getMaxHeightStyleDefault = (setting)=>{
|
|
5
|
+
let result = {
|
|
6
|
+
desktop: 'none'
|
|
7
|
+
};
|
|
8
|
+
const devices = [
|
|
9
|
+
'desktop',
|
|
10
|
+
'mobile',
|
|
11
|
+
'tablet'
|
|
12
|
+
];
|
|
13
|
+
devices.forEach((device)=>{
|
|
14
|
+
const lineClamp = getResponsiveValueByScreen(setting?.lineClamp, device);
|
|
15
|
+
const hasLineClamp = getResponsiveValueByScreen(setting?.hasLineClamp, device);
|
|
16
|
+
const maxHeight = hasLineClamp && lineClamp ? `${lineClamp * DESCRIPTION_LINE_HEIGHT_DEFAULT}px` : 'none';
|
|
17
|
+
result = {
|
|
18
|
+
...result,
|
|
19
|
+
[device]: maxHeight
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
const style = makeStyleResponsive('maxh', result);
|
|
23
|
+
return style;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export { getMaxHeightStyleDefault };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useProduct, useCurrentDevice, getResponsiveValueByScreen, isSafari, composeTypographyClassName, composeTypographyStyle, cls, getGlobalColorClass, getStyleShadow, makeStyleResponsive, makeStyle, getGlobalColorStyle } from '@gem-sdk/core';
|
|
3
3
|
import { useState, useRef, useEffect } from 'react';
|
|
4
|
+
import { getMaxHeightStyleDefault } from './ProductDescription/common.js';
|
|
5
|
+
import { DESCRIPTION_LINE_HEIGHT_DEFAULT } from './ProductDescription/const.js';
|
|
4
6
|
|
|
5
7
|
const ProductDescription = ({ setting, builderProps })=>{
|
|
6
8
|
const [open, setOpen] = useState(false);
|
|
@@ -14,14 +16,18 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
14
16
|
useEffect(()=>{
|
|
15
17
|
const dom = ref.current;
|
|
16
18
|
setOpen(false);
|
|
17
|
-
if (dom
|
|
19
|
+
if (!dom) return;
|
|
20
|
+
const enableShowMore = hasLineClamp && product?.descriptionHtml;
|
|
21
|
+
if (!enableShowMore) dom.style.maxHeight = 'none';
|
|
22
|
+
else {
|
|
18
23
|
const value = lineClamp;
|
|
19
24
|
setTimeout(()=>{
|
|
20
25
|
const scrollHeight = dom?.scrollHeight ?? 0;
|
|
21
26
|
const clientHeight = dom?.clientHeight ?? 0;
|
|
22
|
-
const lineHeight =
|
|
23
|
-
const lineText = Math.round((scrollHeight ?? 0) /
|
|
24
|
-
|
|
27
|
+
const lineHeight = getLineHeightFromDom();
|
|
28
|
+
const lineText = Math.round((scrollHeight ?? 0) / lineHeight);
|
|
29
|
+
dom.style.maxHeight = getMaxHeight(lineHeight);
|
|
30
|
+
const conditionCheckLine = value && value < lineText || clientHeight < scrollHeight;
|
|
25
31
|
if (value && conditionCheckLine) {
|
|
26
32
|
allowShowViewMore(()=>true);
|
|
27
33
|
} else {
|
|
@@ -32,8 +38,19 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
32
38
|
}, [
|
|
33
39
|
hasLineClamp,
|
|
34
40
|
lineClamp,
|
|
35
|
-
product?.description
|
|
41
|
+
product?.description,
|
|
42
|
+
isSafari
|
|
36
43
|
]);
|
|
44
|
+
const getLineHeightFromDom = ()=>{
|
|
45
|
+
if (!ref.current) return DESCRIPTION_LINE_HEIGHT_DEFAULT;
|
|
46
|
+
const lineHeight = window.getComputedStyle(ref.current).getPropertyValue('line-height');
|
|
47
|
+
return parseInt(lineHeight);
|
|
48
|
+
};
|
|
49
|
+
const getMaxHeight = (lineHeight)=>{
|
|
50
|
+
if (!hasLineClamp || !lineClamp) return 'auto';
|
|
51
|
+
if (lineHeight) return `${lineClamp * lineHeight}px`;
|
|
52
|
+
return 'auto';
|
|
53
|
+
};
|
|
37
54
|
const Tag = htmlTag === 'html' ? 'div' : 'p';
|
|
38
55
|
const appendTypoClass = composeTypographyClassName(setting?.typo, setting?.typography);
|
|
39
56
|
const appendTypoStyle = composeTypographyStyle(setting?.typo, setting?.typography);
|
|
@@ -50,7 +67,17 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
50
67
|
}
|
|
51
68
|
`;
|
|
52
69
|
const DescriptionNotFoundString = 'This product does not have a description';
|
|
53
|
-
const
|
|
70
|
+
const noDescriptionHtml = !product?.descriptionHtml;
|
|
71
|
+
const handleToggleShowMore = ()=>{
|
|
72
|
+
if (!ref.current) return;
|
|
73
|
+
const lineHeight = getLineHeightFromDom();
|
|
74
|
+
if (open) {
|
|
75
|
+
ref.current.style.maxHeight = getMaxHeight(lineHeight);
|
|
76
|
+
} else {
|
|
77
|
+
ref.current.style.maxHeight = 'none';
|
|
78
|
+
}
|
|
79
|
+
setOpen((prev)=>!prev);
|
|
80
|
+
};
|
|
54
81
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
55
82
|
children: !product ? null : /*#__PURE__*/ jsxs("div", {
|
|
56
83
|
"data-id": builderProps?.uid,
|
|
@@ -61,7 +88,7 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
61
88
|
/*#__PURE__*/ jsx(Tag, {
|
|
62
89
|
ref: ref,
|
|
63
90
|
"data-gp-text": true,
|
|
64
|
-
className: cls('gp-p-description-text gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre', appendTypoClass,
|
|
91
|
+
className: cls('gp-p-description-text gp-break-words safari:[&_p]:gp-inline safari:[&_p]:after:gp-whitespace-pre', appendTypoClass, noDescriptionHtml ? 'gp-p-2 gp-text-center gp-text-sm gp-font-semibold gp-text-gray-500 gp-py-2 !gp-text-center' : '', getGlobalColorClass('text', setting?.color)),
|
|
65
92
|
style: {
|
|
66
93
|
...getStyleShadow({
|
|
67
94
|
value: setting?.textShadow,
|
|
@@ -73,10 +100,11 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
73
100
|
...makeStyle({
|
|
74
101
|
tt: setting?.transform
|
|
75
102
|
}),
|
|
76
|
-
...appendTypoStyle
|
|
103
|
+
...appendTypoStyle,
|
|
104
|
+
...getMaxHeightStyleDefault(setting)
|
|
77
105
|
},
|
|
78
106
|
dangerouslySetInnerHTML: {
|
|
79
|
-
__html: product?.descriptionHtml
|
|
107
|
+
__html: product?.descriptionHtml || `${DescriptionNotFoundString}`
|
|
80
108
|
}
|
|
81
109
|
}),
|
|
82
110
|
hasLineClamp && isShowViewMore && /*#__PURE__*/ jsxs("button", {
|
|
@@ -89,7 +117,7 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
89
117
|
...appendTypoStyle,
|
|
90
118
|
...getGlobalColorStyle(setting?.showMoreColor)
|
|
91
119
|
},
|
|
92
|
-
onClick:
|
|
120
|
+
onClick: handleToggleShowMore,
|
|
93
121
|
children: [
|
|
94
122
|
!open ? setting?.viewMoreText : setting?.viewLessText,
|
|
95
123
|
setting?.enableViewMoreIcon && /*#__PURE__*/ jsx("svg", {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { composeTypographyClassName, composeTypographyStyle, getStyleShadow, makeStyleResponsive, getGlobalColorStyle, makeStyle, makeLineClamp, template, cls, getGlobalColorClass, RenderIf, isLocalEnv, baseAssetURL } from '@gem-sdk/core';
|
|
2
2
|
import { getSettingPreloadData } from '../../helpers.js';
|
|
3
|
+
import { getMaxHeightStyleDefault } from './ProductDescription/common.js';
|
|
3
4
|
|
|
4
5
|
const devices = [
|
|
5
6
|
'desktop',
|
|
@@ -31,7 +32,8 @@ const ProductDescription = ({ setting, advanced, builderProps })=>{
|
|
|
31
32
|
...makeStyle({
|
|
32
33
|
tt: setting?.transform
|
|
33
34
|
}),
|
|
34
|
-
...appendTypoStyle
|
|
35
|
+
...appendTypoStyle,
|
|
36
|
+
...getMaxHeightStyleDefault(setting)
|
|
35
37
|
};
|
|
36
38
|
const collapseStyle = {
|
|
37
39
|
...defaultStyle,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { makeStyleResponsive } from '@gem-sdk/core';
|
|
3
|
+
import ThirdPartyPreview from './ThirdPartyPreview.js';
|
|
4
|
+
import AppConfig from '../configs/AlsoBoughtCbb.js';
|
|
5
|
+
|
|
6
|
+
const AlsoBoughtCbbContent = ()=>{
|
|
7
|
+
return /*#__PURE__*/ jsx(Fragment, {
|
|
8
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
9
|
+
className: "gp-p-2",
|
|
10
|
+
children: /*#__PURE__*/ jsx(ThirdPartyPreview, {
|
|
11
|
+
setting: {
|
|
12
|
+
label: 'Also Bought • CBB',
|
|
13
|
+
iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${AppConfig.logoUrl}">`
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
const AlsoBoughtCbb = ({ setting })=>{
|
|
20
|
+
return /*#__PURE__*/ jsx("div", {
|
|
21
|
+
style: {
|
|
22
|
+
...makeStyleResponsive('ta', setting?.align)
|
|
23
|
+
},
|
|
24
|
+
children: /*#__PURE__*/ jsx(AlsoBoughtCbbContent, {})
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { AlsoBoughtCbb as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { template, makeStyleResponsive } from '@gem-sdk/core';
|
|
2
|
+
|
|
3
|
+
const AlsoBoughtCbb = ({ setting, advanced })=>{
|
|
4
|
+
const { align } = setting ?? {};
|
|
5
|
+
return template`
|
|
6
|
+
<div
|
|
7
|
+
class="${advanced?.cssClass}"
|
|
8
|
+
style="${{
|
|
9
|
+
...makeStyleResponsive('ta', align)
|
|
10
|
+
}}"
|
|
11
|
+
>
|
|
12
|
+
<div class="gp-integration-also-bought__position" />
|
|
13
|
+
</div>
|
|
14
|
+
`;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export { AlsoBoughtCbb as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { makeStyleResponsive } from '@gem-sdk/core';
|
|
3
|
+
import ThirdPartyPreview from './ThirdPartyPreview.js';
|
|
4
|
+
import AppConfig from '../configs/BfSizeChartSizeGuide.js';
|
|
5
|
+
|
|
6
|
+
const BfSizeChartSizeGuideContent = ()=>{
|
|
7
|
+
return /*#__PURE__*/ jsx(Fragment, {
|
|
8
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
9
|
+
className: "gp-p-2",
|
|
10
|
+
children: /*#__PURE__*/ jsx(ThirdPartyPreview, {
|
|
11
|
+
setting: {
|
|
12
|
+
label: 'BF Size Chart & Size Guide',
|
|
13
|
+
iconSvg: `<img class="gp-w-6 gp-border gp-border-[#494949] gp-rounded-[3px]" src="${AppConfig.logoUrl}">`
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
const BfSizeChartSizeGuide = ({ setting })=>{
|
|
20
|
+
return /*#__PURE__*/ jsx("div", {
|
|
21
|
+
style: {
|
|
22
|
+
...makeStyleResponsive('ta', setting?.align)
|
|
23
|
+
},
|
|
24
|
+
children: /*#__PURE__*/ jsx(BfSizeChartSizeGuideContent, {})
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { BfSizeChartSizeGuide as default };
|