@gem-sdk/core 1.48.0-dev.47 → 1.48.0-dev.50

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.
@@ -101,6 +101,9 @@ function composeAdvanceStyle(data, tag, pageType) {
101
101
  if (attr === 'rounded') {
102
102
  Object.assign(styles, radius.composeRadius(value));
103
103
  }
104
+ if (attr === 'boxShadow') {
105
+ Object.assign(styles, shadow.getResonsiveStyleShadow(value, 'box-shadow', hasBoxShadow));
106
+ }
104
107
  if (composeAttr === 'desktop') {
105
108
  switch(attr){
106
109
  case 'padding':
@@ -215,20 +218,20 @@ function composeAdvanceStyle(data, tag, pageType) {
215
218
  }));
216
219
  }
217
220
  }
218
- if (attr === 'blockPadding' && pageType === "POST_PURCHASE") {
221
+ if (attr === 'blockPadding' && pageType === 'POST_PURCHASE') {
219
222
  const valueMapped = postPurchasePaddingMapping[value];
220
223
  styles[`--pb`] = getAttrValue(attr, valueMapped, tag);
221
224
  styles[`--pt`] = getAttrValue(attr, valueMapped, tag);
222
225
  styles[`--mb`] = '0px';
223
226
  styles[`--mt`] = '0px';
224
227
  }
225
- if (attr === 'inlinePadding' && pageType === "POST_PURCHASE") {
228
+ if (attr === 'inlinePadding' && pageType === 'POST_PURCHASE') {
226
229
  const valueMapped = postPurchasePaddingMapping[value];
227
230
  styles[`--pl`] = getAttrValue(attr, valueMapped, tag);
228
231
  styles[`--pr`] = getAttrValue(attr, valueMapped, tag);
229
232
  }
230
233
  });
231
- const advancedPostPurchaseStyles = pageType === "POST_PURCHASE" ? composeAdvanceStyleForPostPurchase(data, tag) : {};
234
+ const advancedPostPurchaseStyles = pageType === 'POST_PURCHASE' ? composeAdvanceStyleForPostPurchase(data, tag) : {};
232
235
  return {
233
236
  ...styles,
234
237
  ...advancedPostPurchaseStyles
@@ -27,10 +27,10 @@ const getStyleShadow = (shadowStyle, isActiveState = false)=>{
27
27
  if (typeof value.distance == 'undefined') return {};
28
28
  const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
29
29
  return {
30
- [`-${!isActiveState ? constant.stateMapping?.[state] || '' : ''}-${getShortname.getShortName(styleAppliedFor)}`]: isEnableShadow ? `${Math.cos(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${value?.blur} ${styleAppliedFor === 'box-shadow' ? value?.spread + ' ' : ''}${colors.getSingleColorVariable(value?.color)}` : 'none'
30
+ [`-${!isActiveState ? constant.stateMapping?.[state] || '' : ''}-${getShortname.getShortName(styleAppliedFor)}${shadowStyle.screen ? `-${shadowStyle.screen}` : ''}`]: isEnableShadow ? `${Math.cos(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${value?.blur} ${styleAppliedFor === 'box-shadow' ? value?.spread + ' ' : ''}${colors.getSingleColorVariable(value?.color)}` : 'none'
31
31
  };
32
32
  };
33
- const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
33
+ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
34
34
  if (!shadow || !styleAppliedFor) return {};
35
35
  const style = {};
36
36
  for (const [key, value] of Object.entries(shadow)){
@@ -38,11 +38,22 @@ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
38
38
  value: value,
39
39
  state: key,
40
40
  styleAppliedFor,
41
- isEnableShadow: isEnableShadow?.[key]
41
+ isEnableShadow: isEnableShadow?.[key],
42
+ screen: screen ?? ''
42
43
  }));
43
44
  }
44
45
  return style;
45
46
  };
47
+ const getResonsiveStyleShadow = (value, styleAppliedFor, isEnableShadow)=>{
48
+ if (!value) return undefined;
49
+ if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
50
+ return {
51
+ ...getStyleShadowState(value.desktop, styleAppliedFor, isEnableShadow.desktop),
52
+ ...value.tablet && (isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadowState(value.tablet, styleAppliedFor, isEnableShadow.tablet ?? isEnableShadow.desktop, 'tablet') : undefined,
53
+ ...value.mobile && (isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadowState(value.mobile, styleAppliedFor, isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop, 'mobile') : undefined
54
+ };
55
+ }
56
+ };
46
57
  const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
47
58
  if (!hasBoxShadow) return undefined;
48
59
  if (!boxShadowValue) return undefined;
@@ -52,6 +63,7 @@ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
52
63
  };
53
64
 
54
65
  exports.composeShadowCss = composeShadowCss;
66
+ exports.getResonsiveStyleShadow = getResonsiveStyleShadow;
55
67
  exports.getStyleShadow = getStyleShadow;
56
68
  exports.getStyleShadowState = getStyleShadowState;
57
69
  exports.parseValueWithUnit = parseValueWithUnit;
@@ -90,13 +90,27 @@ const AssortionUpsellBundlesConfig = {
90
90
  appId: '5588d7f9-a5bc-4f4a-9c54-39b7e081dd23'
91
91
  }
92
92
  };
93
+ const PreorderNowPreOrderPqConfig = {
94
+ PreorderNowPreOrderPq: {
95
+ appName: 'preorder-now-pre-order-pq',
96
+ appId: '551fab2c-3af6-4a8f-ba21-736a71cb4540'
97
+ }
98
+ };
99
+ const KPreorderNowPartialPaymentConfig = {
100
+ KPreorderNowPartialPayment: {
101
+ appName: 'k-preorder-now-partial-payment',
102
+ appId: '65705a60-a3b0-43ae-9dc8-15db78d76b3b'
103
+ }
104
+ };
93
105
 
94
106
  exports.AssortionUpsellBundlesConfig = AssortionUpsellBundlesConfig;
95
107
  exports.BonLoyaltyRewardsReferralsConfig = BonLoyaltyRewardsReferralsConfig;
96
108
  exports.EasyBundleBuilderSkailamaConfig = EasyBundleBuilderSkailamaConfig;
97
109
  exports.FastBundleBundlesDiscountsConfig = FastBundleBundlesDiscountsConfig;
110
+ exports.KPreorderNowPartialPaymentConfig = KPreorderNowPartialPaymentConfig;
98
111
  exports.KiteFreeGiftDiscountConfig = KiteFreeGiftDiscountConfig;
99
112
  exports.LoopSubscriptionsConfig = LoopSubscriptionsConfig;
113
+ exports.PreorderNowPreOrderPqConfig = PreorderNowPreOrderPqConfig;
100
114
  exports.PumperBundlesVolumeDiscountConfig = PumperBundlesVolumeDiscountConfig;
101
115
  exports.RechargeSubscriptionsConfig = RechargeSubscriptionsConfig;
102
116
  exports.ReviewxpoProductReviewsAppConfig = ReviewxpoProductReviewsAppConfig;
@@ -141,7 +141,22 @@ const AssortionUpsellBundles = {
141
141
  addon: null
142
142
  }
143
143
  };
144
+ const PreorderNowPreOrderPq = {
145
+ PreorderNowPreOrderPq: {
146
+ 'app-block-notifyapp-block-notify': null,
147
+ 'app-block-partial': null,
148
+ 'app-block-timer': null,
149
+ 'app-block': null
150
+ }
151
+ };
152
+ const KPreorderNowPartialPayment = {
153
+ KPreorderNowPartialPayment: {
154
+ 'kaktus-bundle': null
155
+ }
156
+ };
144
157
  const composeSettingsByWidgetType = {
158
+ ...KPreorderNowPartialPayment,
159
+ ...PreorderNowPreOrderPq,
145
160
  ...AssortionUpsellBundles,
146
161
  ...EasyBundleBuilderSkailama,
147
162
  ...FastBundleBundlesDiscounts,
@@ -17,7 +17,9 @@ const mapShopifyAppMeta = {
17
17
  ...appConfig.FastBundleBundlesDiscountsConfig,
18
18
  ...appConfig.SimpleBundlesKitsConfig,
19
19
  ...appConfig.EasyBundleBuilderSkailamaConfig,
20
- ...appConfig.AssortionUpsellBundlesConfig
20
+ ...appConfig.AssortionUpsellBundlesConfig,
21
+ ...appConfig.PreorderNowPreOrderPqConfig,
22
+ ...appConfig.KPreorderNowPartialPaymentConfig
21
23
  };
22
24
  const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
23
25
 
package/dist/cjs/index.js CHANGED
@@ -267,6 +267,7 @@ exports.removeUndefinedValuesFromObject = render.removeUndefinedValuesFromObject
267
267
  exports.styles = render.styles;
268
268
  exports.template = render.template;
269
269
  exports.composeShadowCss = shadow.composeShadowCss;
270
+ exports.getResonsiveStyleShadow = shadow.getResonsiveStyleShadow;
270
271
  exports.getStyleShadow = shadow.getStyleShadow;
271
272
  exports.getStyleShadowState = shadow.getStyleShadowState;
272
273
  exports.parseValueWithUnit = shadow.parseValueWithUnit;
@@ -3,7 +3,7 @@ import { isColor } from './colors.js';
3
3
  import { layoutComponent } from './constant.js';
4
4
  import { makeStyleKey } from './make-style.js';
5
5
  import { composeRadius, getCornerCSSFromGlobal } from './radius.js';
6
- import { getStyleShadowState, getStyleShadow } from './shadow.js';
6
+ import { getResonsiveStyleShadow, getStyleShadowState, getStyleShadow } from './shadow.js';
7
7
 
8
8
  const composeSpacing = ({ source, spacing, type, suffix = '' })=>{
9
9
  const { top, left, bottom, right } = spacing;
@@ -99,6 +99,9 @@ function composeAdvanceStyle(data, tag, pageType) {
99
99
  if (attr === 'rounded') {
100
100
  Object.assign(styles, composeRadius(value));
101
101
  }
102
+ if (attr === 'boxShadow') {
103
+ Object.assign(styles, getResonsiveStyleShadow(value, 'box-shadow', hasBoxShadow));
104
+ }
102
105
  if (composeAttr === 'desktop') {
103
106
  switch(attr){
104
107
  case 'padding':
@@ -213,20 +216,20 @@ function composeAdvanceStyle(data, tag, pageType) {
213
216
  }));
214
217
  }
215
218
  }
216
- if (attr === 'blockPadding' && pageType === "POST_PURCHASE") {
219
+ if (attr === 'blockPadding' && pageType === 'POST_PURCHASE') {
217
220
  const valueMapped = postPurchasePaddingMapping[value];
218
221
  styles[`--pb`] = getAttrValue(attr, valueMapped, tag);
219
222
  styles[`--pt`] = getAttrValue(attr, valueMapped, tag);
220
223
  styles[`--mb`] = '0px';
221
224
  styles[`--mt`] = '0px';
222
225
  }
223
- if (attr === 'inlinePadding' && pageType === "POST_PURCHASE") {
226
+ if (attr === 'inlinePadding' && pageType === 'POST_PURCHASE') {
224
227
  const valueMapped = postPurchasePaddingMapping[value];
225
228
  styles[`--pl`] = getAttrValue(attr, valueMapped, tag);
226
229
  styles[`--pr`] = getAttrValue(attr, valueMapped, tag);
227
230
  }
228
231
  });
229
- const advancedPostPurchaseStyles = pageType === "POST_PURCHASE" ? composeAdvanceStyleForPostPurchase(data, tag) : {};
232
+ const advancedPostPurchaseStyles = pageType === 'POST_PURCHASE' ? composeAdvanceStyleForPostPurchase(data, tag) : {};
230
233
  return {
231
234
  ...styles,
232
235
  ...advancedPostPurchaseStyles
@@ -25,10 +25,10 @@ const getStyleShadow = (shadowStyle, isActiveState = false)=>{
25
25
  if (typeof value.distance == 'undefined') return {};
26
26
  const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
27
27
  return {
28
- [`-${!isActiveState ? stateMapping?.[state] || '' : ''}-${getShortName(styleAppliedFor)}`]: isEnableShadow ? `${Math.cos(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${value?.blur} ${styleAppliedFor === 'box-shadow' ? value?.spread + ' ' : ''}${getSingleColorVariable(value?.color)}` : 'none'
28
+ [`-${!isActiveState ? stateMapping?.[state] || '' : ''}-${getShortName(styleAppliedFor)}${shadowStyle.screen ? `-${shadowStyle.screen}` : ''}`]: isEnableShadow ? `${Math.cos(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${value?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${value?.blur} ${styleAppliedFor === 'box-shadow' ? value?.spread + ' ' : ''}${getSingleColorVariable(value?.color)}` : 'none'
29
29
  };
30
30
  };
31
- const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
31
+ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
32
32
  if (!shadow || !styleAppliedFor) return {};
33
33
  const style = {};
34
34
  for (const [key, value] of Object.entries(shadow)){
@@ -36,11 +36,22 @@ const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow)=>{
36
36
  value: value,
37
37
  state: key,
38
38
  styleAppliedFor,
39
- isEnableShadow: isEnableShadow?.[key]
39
+ isEnableShadow: isEnableShadow?.[key],
40
+ screen: screen ?? ''
40
41
  }));
41
42
  }
42
43
  return style;
43
44
  };
45
+ const getResonsiveStyleShadow = (value, styleAppliedFor, isEnableShadow)=>{
46
+ if (!value) return undefined;
47
+ if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
48
+ return {
49
+ ...getStyleShadowState(value.desktop, styleAppliedFor, isEnableShadow.desktop),
50
+ ...value.tablet && (isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadowState(value.tablet, styleAppliedFor, isEnableShadow.tablet ?? isEnableShadow.desktop, 'tablet') : undefined,
51
+ ...value.mobile && (isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadowState(value.mobile, styleAppliedFor, isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop, 'mobile') : undefined
52
+ };
53
+ }
54
+ };
44
55
  const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
45
56
  if (!hasBoxShadow) return undefined;
46
57
  if (!boxShadowValue) return undefined;
@@ -49,4 +60,4 @@ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
49
60
  return `box-shadow: ${Math.cos(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${Math.sin(parseFloat(`${boxShadowValue?.angle}`) * Math.PI / 180) * parseFloat(`${distance}`)}${unitDistance} ${boxShadowValue?.blur} ${boxShadowValue?.spread + ' '}${getSingleColorVariable(boxShadowValue?.color)}${sub};`;
50
61
  };
51
62
 
52
- export { composeShadowCss, getStyleShadow, getStyleShadowState, parseValueWithUnit };
63
+ export { composeShadowCss, getResonsiveStyleShadow, getStyleShadow, getStyleShadowState, parseValueWithUnit };
@@ -88,5 +88,17 @@ const AssortionUpsellBundlesConfig = {
88
88
  appId: '5588d7f9-a5bc-4f4a-9c54-39b7e081dd23'
89
89
  }
90
90
  };
91
+ const PreorderNowPreOrderPqConfig = {
92
+ PreorderNowPreOrderPq: {
93
+ appName: 'preorder-now-pre-order-pq',
94
+ appId: '551fab2c-3af6-4a8f-ba21-736a71cb4540'
95
+ }
96
+ };
97
+ const KPreorderNowPartialPaymentConfig = {
98
+ KPreorderNowPartialPayment: {
99
+ appName: 'k-preorder-now-partial-payment',
100
+ appId: '65705a60-a3b0-43ae-9dc8-15db78d76b3b'
101
+ }
102
+ };
91
103
 
92
- export { AssortionUpsellBundlesConfig, BonLoyaltyRewardsReferralsConfig, EasyBundleBuilderSkailamaConfig, FastBundleBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, LoopSubscriptionsConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SimpleBundlesKitsConfig, SkioSubscriptionsYcS20Config, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig };
104
+ export { AssortionUpsellBundlesConfig, BonLoyaltyRewardsReferralsConfig, EasyBundleBuilderSkailamaConfig, FastBundleBundlesDiscountsConfig, KPreorderNowPartialPaymentConfig, KiteFreeGiftDiscountConfig, LoopSubscriptionsConfig, PreorderNowPreOrderPqConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SimpleBundlesKitsConfig, SkioSubscriptionsYcS20Config, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig };
@@ -139,7 +139,22 @@ const AssortionUpsellBundles = {
139
139
  addon: null
140
140
  }
141
141
  };
142
+ const PreorderNowPreOrderPq = {
143
+ PreorderNowPreOrderPq: {
144
+ 'app-block-notifyapp-block-notify': null,
145
+ 'app-block-partial': null,
146
+ 'app-block-timer': null,
147
+ 'app-block': null
148
+ }
149
+ };
150
+ const KPreorderNowPartialPayment = {
151
+ KPreorderNowPartialPayment: {
152
+ 'kaktus-bundle': null
153
+ }
154
+ };
142
155
  const composeSettingsByWidgetType = {
156
+ ...KPreorderNowPartialPayment,
157
+ ...PreorderNowPreOrderPq,
143
158
  ...AssortionUpsellBundles,
144
159
  ...EasyBundleBuilderSkailama,
145
160
  ...FastBundleBundlesDiscounts,
@@ -1,4 +1,4 @@
1
- import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig, SimpleBundlesKitsConfig, EasyBundleBuilderSkailamaConfig, AssortionUpsellBundlesConfig } from './appConfig.js';
1
+ import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig, SimpleBundlesKitsConfig, EasyBundleBuilderSkailamaConfig, AssortionUpsellBundlesConfig, PreorderNowPreOrderPqConfig, KPreorderNowPartialPaymentConfig } from './appConfig.js';
2
2
 
3
3
  const mapShopifyAppMeta = {
4
4
  ...RechargeSubscriptionsConfig,
@@ -15,7 +15,9 @@ const mapShopifyAppMeta = {
15
15
  ...FastBundleBundlesDiscountsConfig,
16
16
  ...SimpleBundlesKitsConfig,
17
17
  ...EasyBundleBuilderSkailamaConfig,
18
- ...AssortionUpsellBundlesConfig
18
+ ...AssortionUpsellBundlesConfig,
19
+ ...PreorderNowPreOrderPqConfig,
20
+ ...KPreorderNowPartialPaymentConfig
19
21
  };
20
22
  const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
21
23
 
package/dist/esm/index.js CHANGED
@@ -66,7 +66,7 @@ export { checkAvailableVariantInStock, getSelectedVariant, parseSelectedOption }
66
66
  export { generateCollectionQueryKey, generateProductQueryKey, generateProductsQueryKey } from './helpers/query.js';
67
67
  export { composeCornerCss, composeRadius, composeRadiusResponsive, getCornerCSSFromGlobal, getCustomRadius, getRadiusCSSFromGlobal, getRadiusStyleActiveState } from './helpers/radius.js';
68
68
  export { RenderIf, composeMemo, dataStringify, props, removeUndefinedValuesFromObject, styles, template } from './helpers/render.js';
69
- export { composeShadowCss, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
69
+ export { composeShadowCss, getResonsiveStyleShadow, getStyleShadow, getStyleShadowState, parseValueWithUnit } from './helpers/shadow.js';
70
70
  export { composeSize, composeSizeCss, genSizeClass, getAspectRatioGlobalSize, getGlobalSizeGap, getHeightByShapeGlobalSize, getPaddingGlobalSize, getValueByDevice, getWidthByShapeGlobalSize, getWidthHeightGlobalSize, makeGlobalSize, makeGlobalSizeIcon, makeStyleWithDefault } from './helpers/size.js';
71
71
  export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass } from './helpers/typography.js';
72
72
  export { useAddToCart } from './hooks/cart/use-add-to-cart.js';