@gem-sdk/core 1.53.0-dev.16 → 1.53.0-dev.161

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.
Files changed (40) hide show
  1. package/dist/cjs/components/ComponentToolbarPreview.js +58 -4
  2. package/dist/cjs/components/InteractionSuffix.js +19 -92
  3. package/dist/cjs/components/Render.liquid.js +40 -7
  4. package/dist/cjs/contexts/PageContext.js +9 -1
  5. package/dist/cjs/graphql/queries/published-shop-metas.js +15 -0
  6. package/dist/cjs/helpers/animations.js +11 -2
  7. package/dist/cjs/helpers/background.js +10 -5
  8. package/dist/cjs/helpers/compose-advance-style.js +6 -1
  9. package/dist/cjs/helpers/interaction/index.js +45 -6
  10. package/dist/cjs/helpers/radius.js +11 -1
  11. package/dist/cjs/helpers/shadow.js +4 -3
  12. package/dist/cjs/helpers/third-party/appConfig.js +49 -0
  13. package/dist/cjs/helpers/third-party/appSetting.js +155 -1
  14. package/dist/cjs/helpers/third-party/constant.js +8 -1
  15. package/dist/cjs/helpers/third-party/getAppBlockConfig.js +8 -1
  16. package/dist/cjs/helpers/typography.js +5 -2
  17. package/dist/cjs/hooks/animation/useAnimationConfig.js +2 -1
  18. package/dist/cjs/hooks/animation/useApplyAnimation.js +5 -5
  19. package/dist/cjs/index.js +5 -1
  20. package/dist/esm/components/ComponentToolbarPreview.js +58 -4
  21. package/dist/esm/components/InteractionSuffix.js +20 -93
  22. package/dist/esm/components/Render.liquid.js +40 -7
  23. package/dist/esm/contexts/PageContext.js +9 -1
  24. package/dist/esm/graphql/queries/published-shop-metas.js +13 -0
  25. package/dist/esm/helpers/animations.js +11 -2
  26. package/dist/esm/helpers/background.js +10 -5
  27. package/dist/esm/helpers/compose-advance-style.js +7 -2
  28. package/dist/esm/helpers/interaction/index.js +45 -6
  29. package/dist/esm/helpers/radius.js +11 -1
  30. package/dist/esm/helpers/shadow.js +4 -3
  31. package/dist/esm/helpers/third-party/appConfig.js +43 -1
  32. package/dist/esm/helpers/third-party/appSetting.js +155 -1
  33. package/dist/esm/helpers/third-party/constant.js +9 -2
  34. package/dist/esm/helpers/third-party/getAppBlockConfig.js +8 -1
  35. package/dist/esm/helpers/typography.js +5 -2
  36. package/dist/esm/hooks/animation/useAnimationConfig.js +2 -1
  37. package/dist/esm/hooks/animation/useApplyAnimation.js +5 -5
  38. package/dist/esm/index.js +3 -1
  39. package/dist/types/index.d.ts +358 -188
  40. package/package.json +3 -3
@@ -1,10 +1,17 @@
1
1
  import { composeSettingsByWidgetType, overrideSettings } from './appSetting.js';
2
2
  import { getAppBlockType } from './getAppBlockType.js';
3
3
 
4
+ const listAppUpdateNewVersion = [
5
+ 'Growave'
6
+ ];
4
7
  const getAppBlockConfig = (tag, appBlockId, settings)=>{
8
+ let widgetType = settings?.widgetType;
9
+ if (listAppUpdateNewVersion.includes(tag)) {
10
+ widgetType = settings?.widgetTypeV2;
11
+ }
5
12
  const appBlockType = getAppBlockType({
6
13
  tag,
7
- widgetType: settings?.widgetType
14
+ widgetType
8
15
  });
9
16
  const settingByWidget = composeSettingsByWidgetType[tag][settings?.widgetType];
10
17
  const appSettings = overrideSettings(tag, settingByWidget, settings);
@@ -82,7 +82,7 @@ const composeFontFamilyTypographyV2 = (value)=>{
82
82
  if (typeof fontFamily === 'string') {
83
83
  return getFontUsedByTypographyV2({
84
84
  fontFamily,
85
- fallbackFontFamily: value?.fallbackFontFamily
85
+ fallbackFontFamily: getFallbackFontFamily(value?.fallbackFontFamily, type)
86
86
  });
87
87
  }
88
88
  if (typeof fontFamily === 'object' && typeof fontFamily?.value === 'string') {
@@ -92,12 +92,15 @@ const composeFontFamilyTypographyV2 = (value)=>{
92
92
  default:
93
93
  return getFontUsedByTypographyV2({
94
94
  fontFamily: fontFamily.value,
95
- fallbackFontFamily: composeFallbackTypographyStyle(type ?? 'heading')
95
+ fallbackFontFamily: getFallbackFontFamily(value?.fallbackFontFamily, type)
96
96
  });
97
97
  }
98
98
  }
99
99
  return;
100
100
  };
101
+ const getFallbackFontFamily = (fallbackFontFamilyDefault, type)=>{
102
+ return fallbackFontFamilyDefault || composeFallbackTypographyStyle(type ?? 'heading');
103
+ };
101
104
  const getFontUsedByTypographyV2 = ({ fontFamily, fallbackFontFamily })=>{
102
105
  if (fontFamily) {
103
106
  return `var(--g-font-${fontFamily?.replace(/ /g, '-')}, '${fontFamily}'), ${fallbackFontFamily}`;
@@ -12,7 +12,8 @@ const useAnimationConfig = (props)=>{
12
12
  const { animation, setting } = triggerConfig[trigger];
13
13
  return {
14
14
  type: animation,
15
- setting: setting[animation]
15
+ setting: setting[animation],
16
+ reverse: trigger === "hidden"
16
17
  };
17
18
  }, [
18
19
  configByDevices
@@ -21,13 +21,13 @@ const useApplyAnimation = ({ props })=>{
21
21
  setAnimationOnFinish,
22
22
  setToolbarActive
23
23
  });
24
- const generateAnimation = useCallback(({ target, setting, type })=>{
25
- return animation[type](target, setting);
24
+ const generateAnimation = useCallback(({ target, setting, type, reverse })=>{
25
+ return animation[type](target, setting, reverse);
26
26
  }, [
27
27
  animation
28
28
  ]);
29
29
  const initListAnimations = useCallback(()=>{
30
- const { type, setting } = getAnimationConfig();
30
+ const { type, setting, reverse } = getAnimationConfig();
31
31
  if (!type || type === AnimationType.None || !targetObjects.current.length) {
32
32
  cancelAnimation();
33
33
  return;
@@ -35,9 +35,9 @@ const useApplyAnimation = ({ props })=>{
35
35
  const listAnimations = targetObjects.current.map((item)=>generateAnimation({
36
36
  type,
37
37
  setting,
38
- target: item.target
38
+ target: item.target,
39
+ reverse
39
40
  }));
40
- console.log('listAnimations', listAnimations);
41
41
  cancelAnimation();
42
42
  setAnimation(listAnimations);
43
43
  }, [
package/dist/esm/index.js CHANGED
@@ -17,6 +17,7 @@ export { ModalProvider, useModalStore } from './contexts/ModalContext.js';
17
17
  export { ArticleListProvider, useArticleListStore } from './contexts/ArticleListContext.js';
18
18
  export { ArticleProvider, useArticleStore } from './contexts/ArticleContext.js';
19
19
  export { PageViewUpDocument } from './graphql/mutations/page-view-up.generated.js';
20
+ export { PublishedShopMetasDocument } from './graphql/queries/published-shop-metas.js';
20
21
  export { CollectionDetailFilterDocument } from './graphql/queries/collection-detail-filter.generated.js';
21
22
  export { CollectionDocument } from './graphql/queries/collection.generated.js';
22
23
  export { CollectionsDocument } from './graphql/queries/collections.generated.js';
@@ -63,11 +64,12 @@ export { isDefined } from './helpers/is-defined.js';
63
64
  export { composeGridLayout, convertOldLayout, gridToArrayRegex, optionLayoutStyle } from './helpers/layout.js';
64
65
  export { makeAspectRatio, makeGlobalSizeHeightResponsive, makeGlobalSizeWidthResponsive, makeHeight, makeLineClamp, makeStyle, makeStyleKey, makeStyleResponsive, makeStyleResponsiveByScreen, makeStyleResponsiveState, makeStyleState, makeWidth, removeNullUndefined } from './helpers/make-style.js';
65
66
  export { convertTextAlignToJustify } from './helpers/align.js';
67
+ export { checkInStock } from './helpers/variant.js';
66
68
  export { checkAvailableVariantInStock, getSelectedVariant, parseSelectedOption } from './helpers/product.js';
67
69
  export { generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey } from './helpers/query.js';
68
70
  export { composeCornerCss, composeRadius, composeRadiusResponsive, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState } from './helpers/radius.js';
69
71
  export { RenderIf, composeMemo, dataStringify, props, removeUndefinedValuesFromObject, styles, template } from './helpers/render.js';
70
- export { composeShadowCss, getResonsiveStyleShadow, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
72
+ export { composeShadowCss, getResponsiveStyleShadow, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
71
73
  export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getValueByDevice, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeGlobalSizeIcon, makeStyleWithDefault } from './helpers/size.js';
72
74
  export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass } from './helpers/typography.js';
73
75
  export { useAddToCart } from './hooks/cart/use-add-to-cart.js';