@gem-sdk/components 2.0.0-staging.122 → 2.0.0-staging.123

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.
@@ -67,6 +67,7 @@ const Arrow = ({ showArrow, left, vertical, disabled, controlOverContent, custom
67
67
  ...passProps,
68
68
  children: [
69
69
  /*#__PURE__*/ jsxRuntime.jsx("style", {
70
+ type: "text/css",
70
71
  dangerouslySetInnerHTML: {
71
72
  __html: innerBorderCss
72
73
  }
@@ -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 = core.isSafari() ? value && value < lineText : clientHeight < scrollHeight;
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
- !core.isSafari() && /*#__PURE__*/ jsxRuntime.jsx("style", {
82
- children: css
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,
@@ -261,6 +261,7 @@ const ProductImagesV2 = (productImageProps)=>{
261
261
  },
262
262
  children: [
263
263
  /*#__PURE__*/ jsxRuntime.jsx("style", {
264
+ type: "text/css",
264
265
  dangerouslySetInnerHTML: {
265
266
  __html: carouselItemCss
266
267
  }
@@ -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'); }), {
@@ -63,6 +63,7 @@ const Arrow = ({ showArrow, left, vertical, disabled, controlOverContent, custom
63
63
  ...passProps,
64
64
  children: [
65
65
  /*#__PURE__*/ jsx("style", {
66
+ type: "text/css",
66
67
  dangerouslySetInnerHTML: {
67
68
  __html: innerBorderCss
68
69
  }
@@ -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, isSafari, composeTypographyClassName, composeTypographyStyle, cls, getGlobalColorClass, getStyleShadow, makeStyleResponsive, makeStyle, getGlobalColorStyle } from '@gem-sdk/core';
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() ? value && value < lineText : clientHeight < scrollHeight;
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() && /*#__PURE__*/ jsx("style", {
78
- children: css
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,
@@ -257,6 +257,7 @@ const ProductImagesV2 = (productImageProps)=>{
257
257
  },
258
258
  children: [
259
259
  /*#__PURE__*/ jsx("style", {
260
+ type: "text/css",
260
261
  dangerouslySetInnerHTML: {
261
262
  __html: carouselItemCss
262
263
  }
@@ -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'), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-staging.122",
3
+ "version": "2.0.0-staging.123",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",