@gem-sdk/components 2.2.0-staging.53 → 2.2.0-staging.54

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.
@@ -30,6 +30,7 @@ const PostPurchaseProductVariants = ({ builderProps, style, styles, setting })=>
30
30
  const { selectedOptions, setSelectedOption, forceSelectedOption } = core.useSelectedOption();
31
31
  const variantsWidth = core.makeStyleResponsive('w', core.makeWidth(width, fullWidth));
32
32
  const [variantId, setVariantId] = React.useState('');
33
+ const mode = core.useEditorMode();
33
34
  React.useEffect(()=>{
34
35
  const url = new URL(window.location.href);
35
36
  const variantParam = url.searchParams.get(VARIANT_PARAM_PATH);
@@ -231,10 +232,10 @@ const PostPurchaseProductVariants = ({ builderProps, style, styles, setting })=>
231
232
  })
232
233
  ]
233
234
  }) : /*#__PURE__*/ jsxRuntime.jsx("div", {
234
- children: /*#__PURE__*/ jsxRuntime.jsx("p", {
235
+ children: mode === 'edit' ? /*#__PURE__*/ jsxRuntime.jsx("p", {
235
236
  className: "gp-p-2 gp-text-center gp-text-sm gp-font-semibold gp-text-gray-500",
236
237
  children: "This product has only default variant"
237
- })
238
+ }) : null
238
239
  })
239
240
  });
240
241
  };
@@ -36,7 +36,7 @@ const HTML5Embed = (props)=>{
36
36
  style: props.style,
37
37
  controls: props.controls,
38
38
  loop: props.loop,
39
- muted: props.autoplay ? true : props.muted,
39
+ muted: props.muted ? true : undefined,
40
40
  autoPlay: props.autoplay,
41
41
  title: props.title,
42
42
  preload: props.autoplay ? 'metadata' : 'none',
@@ -60,7 +60,7 @@ const HTML5Embed = (props)=>{
60
60
  style="${props.style}"
61
61
  ${props.controls ? 'controls' : undefined}
62
62
  ${props.loop ? 'loop' : undefined}
63
- ${props.autoplay ? 'muted' : undefined}
63
+ ${props.muted ? 'muted' : undefined}
64
64
  ${props.autoplay && !preloadThumbnail ? 'autoplay' : undefined}
65
65
  title="${props.title}"
66
66
  preload="${props.autoplay && !preloadThumbnail || offLazyVideo ? 'metadata' : 'none'}"
@@ -1,5 +1,5 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
- import { useVariants, useProduct, useIsSyncProduct, useSelectedOption, makeStyleResponsive, makeWidth, useInitialSwatchesOptions, useSwatchesOptions, optionLayoutStyle, cls, OptionSpecialStyle, getSelectedVariant } from '@gem-sdk/core';
2
+ import { useVariants, useProduct, useIsSyncProduct, useSelectedOption, makeStyleResponsive, makeWidth, useEditorMode, useInitialSwatchesOptions, useSwatchesOptions, optionLayoutStyle, cls, OptionSpecialStyle, getSelectedVariant } from '@gem-sdk/core';
3
3
  import { useState, useEffect, useMemo, useCallback } from 'react';
4
4
  import { checkDefaultVariant } from '../../../product/helpers/product.js';
5
5
  import { useTransition } from '../../../product/components/ProductVariants/common.js';
@@ -26,6 +26,7 @@ const PostPurchaseProductVariants = ({ builderProps, style, styles, setting })=>
26
26
  const { selectedOptions, setSelectedOption, forceSelectedOption } = useSelectedOption();
27
27
  const variantsWidth = makeStyleResponsive('w', makeWidth(width, fullWidth));
28
28
  const [variantId, setVariantId] = useState('');
29
+ const mode = useEditorMode();
29
30
  useEffect(()=>{
30
31
  const url = new URL(window.location.href);
31
32
  const variantParam = url.searchParams.get(VARIANT_PARAM_PATH);
@@ -227,10 +228,10 @@ const PostPurchaseProductVariants = ({ builderProps, style, styles, setting })=>
227
228
  })
228
229
  ]
229
230
  }) : /*#__PURE__*/ jsx("div", {
230
- children: /*#__PURE__*/ jsx("p", {
231
+ children: mode === 'edit' ? /*#__PURE__*/ jsx("p", {
231
232
  className: "gp-p-2 gp-text-center gp-text-sm gp-font-semibold gp-text-gray-500",
232
233
  children: "This product has only default variant"
233
- })
234
+ }) : null
234
235
  })
235
236
  });
236
237
  };
@@ -32,7 +32,7 @@ const HTML5Embed = (props)=>{
32
32
  style: props.style,
33
33
  controls: props.controls,
34
34
  loop: props.loop,
35
- muted: props.autoplay ? true : props.muted,
35
+ muted: props.muted ? true : undefined,
36
36
  autoPlay: props.autoplay,
37
37
  title: props.title,
38
38
  preload: props.autoplay ? 'metadata' : 'none',
@@ -56,7 +56,7 @@ const HTML5Embed = (props)=>{
56
56
  style="${props.style}"
57
57
  ${props.controls ? 'controls' : undefined}
58
58
  ${props.loop ? 'loop' : undefined}
59
- ${props.autoplay ? 'muted' : undefined}
59
+ ${props.muted ? 'muted' : undefined}
60
60
  ${props.autoplay && !preloadThumbnail ? 'autoplay' : undefined}
61
61
  title="${props.title}"
62
62
  preload="${props.autoplay && !preloadThumbnail || offLazyVideo ? 'metadata' : 'none'}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.2.0-staging.53",
3
+ "version": "2.2.0-staging.54",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",