@gem-sdk/components 2.0.0-staging.122 → 2.0.0-staging.124
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/carousel/components/Arrow.js +1 -0
- package/dist/cjs/image-comparison/components/CompareImage.liquid.js +2 -1
- package/dist/cjs/product/components/ProductDescription.js +9 -4
- package/dist/cjs/product/components/ProductImagesV2/jsx/ProductImages.js +1 -0
- package/dist/cjs/product/next.js +0 -2
- package/dist/esm/carousel/components/Arrow.js +1 -0
- package/dist/esm/image-comparison/components/CompareImage.liquid.js +2 -1
- package/dist/esm/product/components/ProductDescription.js +10 -5
- package/dist/esm/product/components/ProductImagesV2/jsx/ProductImages.js +1 -0
- package/dist/esm/product/next.js +0 -2
- package/package.json +1 -1
|
@@ -19,6 +19,7 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
19
19
|
const lineClamp = core.getResponsiveValueByScreen(setting?.lineClamp, currentDevice);
|
|
20
20
|
const { redirectProductShopifyLink } = core.useProductShopifyEditLink();
|
|
21
21
|
const mode = core.useEditorMode();
|
|
22
|
+
const isSafari = core.isBrowser() ? navigator?.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 : false;
|
|
22
23
|
React.useEffect(()=>{
|
|
23
24
|
const dom = ref.current;
|
|
24
25
|
setOpen(false);
|
|
@@ -29,7 +30,7 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
29
30
|
const clientHeight = dom?.clientHeight ?? 0;
|
|
30
31
|
const lineHeight = window.getComputedStyle(dom).getPropertyValue('line-height');
|
|
31
32
|
const lineText = Math.round((scrollHeight ?? 0) / parseInt(lineHeight));
|
|
32
|
-
const conditionCheckLine =
|
|
33
|
+
const conditionCheckLine = isSafari ? value && value < lineText : clientHeight < scrollHeight;
|
|
33
34
|
if (value && conditionCheckLine) {
|
|
34
35
|
allowShowViewMore(()=>true);
|
|
35
36
|
} else {
|
|
@@ -40,7 +41,8 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
40
41
|
}, [
|
|
41
42
|
hasLineClamp,
|
|
42
43
|
lineClamp,
|
|
43
|
-
product?.description
|
|
44
|
+
product?.description,
|
|
45
|
+
isSafari
|
|
44
46
|
]);
|
|
45
47
|
const Tag = htmlTag === 'html' ? 'div' : 'p';
|
|
46
48
|
const appendTypoClass = core.composeTypographyClassName(setting?.typo, setting?.typography);
|
|
@@ -78,8 +80,11 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
78
80
|
children: !product?.descriptionHtml || !hasDescription ? null : /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
79
81
|
"data-id": builderProps?.uid,
|
|
80
82
|
children: [
|
|
81
|
-
!
|
|
82
|
-
|
|
83
|
+
!isSafari && /*#__PURE__*/ jsxRuntime.jsx("style", {
|
|
84
|
+
type: "text/css",
|
|
85
|
+
dangerouslySetInnerHTML: {
|
|
86
|
+
__html: css
|
|
87
|
+
}
|
|
83
88
|
}),
|
|
84
89
|
/*#__PURE__*/ jsxRuntime.jsx(Tag, {
|
|
85
90
|
ref: ref,
|
package/dist/cjs/product/next.js
CHANGED
|
@@ -18,14 +18,12 @@ const ProductQuantity = dynamic(()=>Promise.resolve().then(function () { return
|
|
|
18
18
|
loading: Loading.default
|
|
19
19
|
});
|
|
20
20
|
const ProductDescription = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductDescription.js'); }), {
|
|
21
|
-
ssr: false,
|
|
22
21
|
loading: Loading.default
|
|
23
22
|
});
|
|
24
23
|
const ProductPrice = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductPrice.js'); }), {
|
|
25
24
|
loading: Loading.default
|
|
26
25
|
});
|
|
27
26
|
const ProductButton = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductButton.js'); }), {
|
|
28
|
-
ssr: false,
|
|
29
27
|
loading: Loading.default
|
|
30
28
|
});
|
|
31
29
|
const ProductVariants = dynamic(()=>Promise.resolve().then(function () { return require('./components/ProductVariants/index.js'); }), {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
3
|
-
import { useProduct, useCurrentDevice, getResponsiveValueByScreen, useProductShopifyEditLink, useEditorMode,
|
|
3
|
+
import { useProduct, useCurrentDevice, getResponsiveValueByScreen, useProductShopifyEditLink, useEditorMode, isBrowser, composeTypographyClassName, composeTypographyStyle, cls, getGlobalColorClass, getStyleShadow, makeStyleResponsive, makeStyle, getGlobalColorStyle } from '@gem-sdk/core';
|
|
4
4
|
import { useState, useRef, useEffect } from 'react';
|
|
5
5
|
import NoDataState from '../../common/components/NoDataState.js';
|
|
6
6
|
|
|
@@ -15,6 +15,7 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
15
15
|
const lineClamp = getResponsiveValueByScreen(setting?.lineClamp, currentDevice);
|
|
16
16
|
const { redirectProductShopifyLink } = useProductShopifyEditLink();
|
|
17
17
|
const mode = useEditorMode();
|
|
18
|
+
const isSafari = isBrowser() ? navigator?.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1 : false;
|
|
18
19
|
useEffect(()=>{
|
|
19
20
|
const dom = ref.current;
|
|
20
21
|
setOpen(false);
|
|
@@ -25,7 +26,7 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
25
26
|
const clientHeight = dom?.clientHeight ?? 0;
|
|
26
27
|
const lineHeight = window.getComputedStyle(dom).getPropertyValue('line-height');
|
|
27
28
|
const lineText = Math.round((scrollHeight ?? 0) / parseInt(lineHeight));
|
|
28
|
-
const conditionCheckLine = isSafari
|
|
29
|
+
const conditionCheckLine = isSafari ? value && value < lineText : clientHeight < scrollHeight;
|
|
29
30
|
if (value && conditionCheckLine) {
|
|
30
31
|
allowShowViewMore(()=>true);
|
|
31
32
|
} else {
|
|
@@ -36,7 +37,8 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
36
37
|
}, [
|
|
37
38
|
hasLineClamp,
|
|
38
39
|
lineClamp,
|
|
39
|
-
product?.description
|
|
40
|
+
product?.description,
|
|
41
|
+
isSafari
|
|
40
42
|
]);
|
|
41
43
|
const Tag = htmlTag === 'html' ? 'div' : 'p';
|
|
42
44
|
const appendTypoClass = composeTypographyClassName(setting?.typo, setting?.typography);
|
|
@@ -74,8 +76,11 @@ const ProductDescription = ({ setting, builderProps })=>{
|
|
|
74
76
|
children: !product?.descriptionHtml || !hasDescription ? null : /*#__PURE__*/ jsxs("div", {
|
|
75
77
|
"data-id": builderProps?.uid,
|
|
76
78
|
children: [
|
|
77
|
-
!isSafari
|
|
78
|
-
|
|
79
|
+
!isSafari && /*#__PURE__*/ jsx("style", {
|
|
80
|
+
type: "text/css",
|
|
81
|
+
dangerouslySetInnerHTML: {
|
|
82
|
+
__html: css
|
|
83
|
+
}
|
|
79
84
|
}),
|
|
80
85
|
/*#__PURE__*/ jsx(Tag, {
|
|
81
86
|
ref: ref,
|
package/dist/esm/product/next.js
CHANGED
|
@@ -14,14 +14,12 @@ const ProductQuantity = dynamic(()=>import('./components/ProductQuantity.js'), {
|
|
|
14
14
|
loading: Loading
|
|
15
15
|
});
|
|
16
16
|
const ProductDescription = dynamic(()=>import('./components/ProductDescription.js'), {
|
|
17
|
-
ssr: false,
|
|
18
17
|
loading: Loading
|
|
19
18
|
});
|
|
20
19
|
const ProductPrice = dynamic(()=>import('./components/ProductPrice.js'), {
|
|
21
20
|
loading: Loading
|
|
22
21
|
});
|
|
23
22
|
const ProductButton = dynamic(()=>import('./components/ProductButton.js'), {
|
|
24
|
-
ssr: false,
|
|
25
23
|
loading: Loading
|
|
26
24
|
});
|
|
27
25
|
const ProductVariants = dynamic(()=>import('./components/ProductVariants/index.js'), {
|