@gem-sdk/components 2.0.0-dev.695 → 2.0.0-dev.697

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.
@@ -21,7 +21,7 @@ const HeroBannerItem = (props)=>{
21
21
  const { enableLazyloadImage, setting, styles, children, elementRef, transform, dataVideo, bgRef, isShowVideoHtml5, layoutResponsive } = props;
22
22
  const { layout, verticalAlign, enableParallax, alt, title } = setting ?? {};
23
23
  const { background, overlayColor, verticalGutter, sizeSetting, contentWidth, hoverEffect, contentPosition1Col, contentPosition2Col } = styles ?? {};
24
- const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyloadImage && mode !== 'edit';
24
+ const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyloadImage && mode !== 'edit' && mode !== 'preview-post-purchase';
25
25
  const isNotLiquid = true;
26
26
  const aspectRatio = common.getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
27
27
  const containerStyle = system.createStyle({
@@ -168,21 +168,6 @@ const SettingUIV2 = [
168
168
  en: 'Size'
169
169
  },
170
170
  controls: [
171
- {
172
- label: {
173
- en: 'Video Ratio'
174
- },
175
- setting: {
176
- id: 'aspectRatio'
177
- },
178
- conditionDisplay: 'background.type == "video"'
179
- },
180
- {
181
- conditionDisplay: "aspectRatio === 'custom'",
182
- setting: {
183
- id: 'ratioOptions'
184
- }
185
- },
186
171
  {
187
172
  setting: {
188
173
  id: 'sizeSetting'
@@ -18,6 +18,7 @@ const useGpPrice = (props)=>{
18
18
  const { trigger } = core.useInteraction();
19
19
  const currentProduct = core.useProduct();
20
20
  const currentProductId = currentProduct?.baseID?.replace('gid://shopify/Product/', '');
21
+ const isUseCurrency = core.useShopStore((s)=>s.isUseCurrency);
21
22
  const quantityProduct = React.useMemo(()=>{
22
23
  if (bundleItem?.quantity) {
23
24
  return bundleItem.quantity;
@@ -110,7 +111,7 @@ const useGpPrice = (props)=>{
110
111
  });
111
112
  window.dispatchEvent(event);
112
113
  };
113
- const moneyFormatted = core.useFormatMoney(displayPrice ?? 0, setting?.moneyWithCurrentFormat || false);
114
+ const moneyFormatted = core.useFormatMoney(displayPrice ?? 0, isUseCurrency || false);
114
115
  const isNoComparePrice = isComparePrice && !displayPrice;
115
116
  const isNoComparePriceILP = mode !== 'edit' && isNoComparePrice;
116
117
  return {
@@ -17,7 +17,7 @@ const HeroBannerItem = (props)=>{
17
17
  const { enableLazyloadImage, setting, styles, children, elementRef, transform, dataVideo, bgRef, isShowVideoHtml5, layoutResponsive } = props;
18
18
  const { layout, verticalAlign, enableParallax, alt, title } = setting ?? {};
19
19
  const { background, overlayColor, verticalGutter, sizeSetting, contentWidth, hoverEffect, contentPosition1Col, contentPosition2Col } = styles ?? {};
20
- const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyloadImage && mode !== 'edit';
20
+ const enableLazyImage = !(background?.desktop?.preload || background?.tablet?.preload || background?.mobile?.preload) && enableLazyloadImage && mode !== 'edit' && mode !== 'preview-post-purchase';
21
21
  const isNotLiquid = true;
22
22
  const aspectRatio = getAspectRatioSettings(setting?.ratioOptions, setting?.aspectRatio);
23
23
  const containerStyle = createStyle({
@@ -166,21 +166,6 @@ const SettingUIV2 = [
166
166
  en: 'Size'
167
167
  },
168
168
  controls: [
169
- {
170
- label: {
171
- en: 'Video Ratio'
172
- },
173
- setting: {
174
- id: 'aspectRatio'
175
- },
176
- conditionDisplay: 'background.type == "video"'
177
- },
178
- {
179
- conditionDisplay: "aspectRatio === 'custom'",
180
- setting: {
181
- id: 'ratioOptions'
182
- }
183
- },
184
169
  {
185
170
  setting: {
186
171
  id: 'sizeSetting'
@@ -1,6 +1,6 @@
1
1
  import { useRef, useMemo } from 'react';
2
2
  import { useTransition } from '../../ProductVariants/common/common.js';
3
- import { useEditorMode, useQuantity, useCurrentVariant, useProductBundleDiscount, useInteraction, useProduct, useFormatMoney } from '@gem-sdk/core';
3
+ import { useEditorMode, useQuantity, useCurrentVariant, useProductBundleDiscount, useInteraction, useProduct, useShopStore, useFormatMoney } from '@gem-sdk/core';
4
4
 
5
5
  const useGpPrice = (props)=>{
6
6
  const { setting, builderProps } = props;
@@ -16,6 +16,7 @@ const useGpPrice = (props)=>{
16
16
  const { trigger } = useInteraction();
17
17
  const currentProduct = useProduct();
18
18
  const currentProductId = currentProduct?.baseID?.replace('gid://shopify/Product/', '');
19
+ const isUseCurrency = useShopStore((s)=>s.isUseCurrency);
19
20
  const quantityProduct = useMemo(()=>{
20
21
  if (bundleItem?.quantity) {
21
22
  return bundleItem.quantity;
@@ -108,7 +109,7 @@ const useGpPrice = (props)=>{
108
109
  });
109
110
  window.dispatchEvent(event);
110
111
  };
111
- const moneyFormatted = useFormatMoney(displayPrice ?? 0, setting?.moneyWithCurrentFormat || false);
112
+ const moneyFormatted = useFormatMoney(displayPrice ?? 0, isUseCurrency || false);
112
113
  const isNoComparePrice = isComparePrice && !displayPrice;
113
114
  const isNoComparePriceILP = mode !== 'edit' && isNoComparePrice;
114
115
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.695",
3
+ "version": "2.0.0-dev.697",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",
@@ -25,7 +25,7 @@
25
25
  "scan-all-text": "rollup -c ./scripts/rollup.config.settings.mjs && node ./scripts/scan-all-text && node ./scripts/scan-all-text"
26
26
  },
27
27
  "devDependencies": {
28
- "@gem-sdk/core": "2.0.0-dev.695",
28
+ "@gem-sdk/core": "2.0.0-dev.697",
29
29
  "@gem-sdk/styles": "2.0.0-dev.695",
30
30
  "@gem-sdk/system": "2.0.0-dev.695",
31
31
  "@types/react-transition-group": "^4.4.5",