@gem-sdk/core 1.48.0-dev.3 → 1.48.0-dev.37
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.
- package/dist/cjs/components/InteractionSuffix.js +1 -1
- package/dist/cjs/components/Render.liquid.js +2 -2
- package/dist/cjs/graphql/fragments/product-little.generated.js +1 -0
- package/dist/cjs/helpers/background.js +1 -1
- package/dist/cjs/helpers/queries/get-product.js +1 -1
- package/dist/cjs/helpers/third-party/appConfig.js +35 -0
- package/dist/cjs/helpers/third-party/appSetting.js +36 -0
- package/dist/cjs/helpers/third-party/constant.js +6 -1
- package/dist/cjs/helpers/typography.js +7 -2
- package/dist/esm/components/InteractionSuffix.js +2 -2
- package/dist/esm/components/Render.liquid.js +2 -2
- package/dist/esm/graphql/fragments/product-little.generated.js +1 -0
- package/dist/esm/helpers/background.js +1 -1
- package/dist/esm/helpers/queries/get-product.js +1 -1
- package/dist/esm/helpers/third-party/appConfig.js +31 -1
- package/dist/esm/helpers/third-party/appSetting.js +36 -0
- package/dist/esm/helpers/third-party/constant.js +7 -2
- package/dist/esm/helpers/typography.js +7 -2
- package/dist/types/index.d.ts +135 -1
- package/package.json +3 -3
|
@@ -46,7 +46,7 @@ const InteractionSuffix = ({ tag, uid })=>{
|
|
|
46
46
|
isCurrentInteractionTarget
|
|
47
47
|
]);
|
|
48
48
|
if (!isDisplay) {
|
|
49
|
-
return
|
|
49
|
+
return /*#__PURE__*/ jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
50
50
|
}
|
|
51
51
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
52
52
|
children: [
|
|
@@ -234,6 +234,7 @@ const appendAnimation = (props, liquid)=>{
|
|
|
234
234
|
const appearTablet = getAnimationType(getSettingsByDevice('tablet'), 'appear');
|
|
235
235
|
const appearMobile = getAnimationType(getSettingsByDevice('mobile'), 'appear');
|
|
236
236
|
const enableAnimation = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none';
|
|
237
|
+
if (!enableAnimation) return liquid;
|
|
237
238
|
const getInitVisibility = (device)=>getSettingsByDevice(device)?.enabled && ![
|
|
238
239
|
'shake',
|
|
239
240
|
'none'
|
|
@@ -248,8 +249,7 @@ const appendAnimation = (props, liquid)=>{
|
|
|
248
249
|
gp-data='${JSON.stringify({
|
|
249
250
|
config: animation,
|
|
250
251
|
tag,
|
|
251
|
-
opacity
|
|
252
|
-
isEnableInit: enableAnimation
|
|
252
|
+
opacity
|
|
253
253
|
})}'
|
|
254
254
|
style="${{
|
|
255
255
|
display: 'contents'
|
|
@@ -121,7 +121,7 @@ const getBgAttachmentByDevice = (background, device)=>{
|
|
|
121
121
|
return background?.[device]?.attachment;
|
|
122
122
|
};
|
|
123
123
|
const composeBackgroundCss = (backgroundColor)=>{
|
|
124
|
-
return `${backgroundColor ? `background-color: ${colors.getSingleColorVariable(backgroundColor)}
|
|
124
|
+
return `${backgroundColor ? `background-color: ${colors.getSingleColorVariable(backgroundColor)};` : undefined}`;
|
|
125
125
|
};
|
|
126
126
|
const makeFixedBgAttachment = (background)=>{
|
|
127
127
|
if (!background) return;
|
|
@@ -36,7 +36,7 @@ const getProduct = async (fetcher, { id, isSample, isStorefront })=>{
|
|
|
36
36
|
};
|
|
37
37
|
};
|
|
38
38
|
const orderBy = {
|
|
39
|
-
field: '
|
|
39
|
+
field: 'PLATFORM_CREATED_AT',
|
|
40
40
|
direction: 'DESC'
|
|
41
41
|
};
|
|
42
42
|
const fetchProduct = async (fetcher, { id, isSample, isStorefront })=>{
|
|
@@ -60,14 +60,49 @@ const UnlimitedBundlesDiscountsConfig = {
|
|
|
60
60
|
appId: 'd33d0f48-dee0-42a0-b156-2a5dce91814a'
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
+
const KiteFreeGiftDiscountConfig = {
|
|
64
|
+
KiteFreeGiftDiscount: {
|
|
65
|
+
appName: 'kite-free-gift-discounts',
|
|
66
|
+
appId: '2c7302c4-455d-4078-a829-48563ba26089'
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const FastBundleBundlesDiscountsConfig = {
|
|
70
|
+
FastBundleBundlesDiscounts: {
|
|
71
|
+
appName: 'fast-bundle',
|
|
72
|
+
appId: '9e87fbe2-9041-4c23-acf5-322413994cef'
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const SimpleBundlesKitsConfig = {
|
|
76
|
+
SimpleBundlesKits: {
|
|
77
|
+
appName: 'simple-bundles-kits',
|
|
78
|
+
appId: 'e553276b-36b2-446d-b80a-aa47fe5f96ac'
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const EasyBundleBuilderSkailamaConfig = {
|
|
82
|
+
EasyBundleBuilderSkailama: {
|
|
83
|
+
appName: 'easy-bundles',
|
|
84
|
+
appId: '05b1325c-6303-4da5-8e2f-b13ab2a50e1a'
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
const AssortionUpsellBundlesConfig = {
|
|
88
|
+
AssortionUpsellBundles: {
|
|
89
|
+
appName: 'assortion',
|
|
90
|
+
appId: '5588d7f9-a5bc-4f4a-9c54-39b7e081dd23'
|
|
91
|
+
}
|
|
92
|
+
};
|
|
63
93
|
|
|
94
|
+
exports.AssortionUpsellBundlesConfig = AssortionUpsellBundlesConfig;
|
|
64
95
|
exports.BonLoyaltyRewardsReferralsConfig = BonLoyaltyRewardsReferralsConfig;
|
|
96
|
+
exports.EasyBundleBuilderSkailamaConfig = EasyBundleBuilderSkailamaConfig;
|
|
97
|
+
exports.FastBundleBundlesDiscountsConfig = FastBundleBundlesDiscountsConfig;
|
|
98
|
+
exports.KiteFreeGiftDiscountConfig = KiteFreeGiftDiscountConfig;
|
|
65
99
|
exports.LoopSubscriptionsConfig = LoopSubscriptionsConfig;
|
|
66
100
|
exports.PumperBundlesVolumeDiscountConfig = PumperBundlesVolumeDiscountConfig;
|
|
67
101
|
exports.RechargeSubscriptionsConfig = RechargeSubscriptionsConfig;
|
|
68
102
|
exports.ReviewxpoProductReviewsAppConfig = ReviewxpoProductReviewsAppConfig;
|
|
69
103
|
exports.SelleasyConfig = SelleasyConfig;
|
|
70
104
|
exports.ShopifyFormsConfig = ShopifyFormsConfig;
|
|
105
|
+
exports.SimpleBundlesKitsConfig = SimpleBundlesKitsConfig;
|
|
71
106
|
exports.SkioSubscriptionsYcS20Config = SkioSubscriptionsYcS20Config;
|
|
72
107
|
exports.SubifySubscriptionsConfig = SubifySubscriptionsConfig;
|
|
73
108
|
exports.UnlimitedBundlesDiscountsConfig = UnlimitedBundlesDiscountsConfig;
|
|
@@ -110,8 +110,44 @@ const UnlimitedBundlesDiscounts = {
|
|
|
110
110
|
'product-page-placeholder': null
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
|
+
const KiteFreeGiftDiscount = {
|
|
114
|
+
KiteFreeGiftDiscount: {
|
|
115
|
+
'app-block': null
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const FastBundleBundlesDiscounts = {
|
|
119
|
+
FastBundleBundlesDiscounts: {
|
|
120
|
+
all_bundles: null,
|
|
121
|
+
fbt_position: null,
|
|
122
|
+
product_bundles: null,
|
|
123
|
+
product_bundle_with_ids: null,
|
|
124
|
+
volume_position: null
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const SimpleBundlesKits = {
|
|
128
|
+
SimpleBundlesKits: {
|
|
129
|
+
'infinite-options-selector': null
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
const EasyBundleBuilderSkailama = {
|
|
133
|
+
EasyBundleBuilderSkailama: {
|
|
134
|
+
'app-block-bundlePage': null
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const AssortionUpsellBundles = {
|
|
138
|
+
AssortionUpsellBundles: {
|
|
139
|
+
volume: null,
|
|
140
|
+
bundle: null,
|
|
141
|
+
addon: null
|
|
142
|
+
}
|
|
143
|
+
};
|
|
113
144
|
const composeSettingsByWidgetType = {
|
|
145
|
+
...AssortionUpsellBundles,
|
|
146
|
+
...EasyBundleBuilderSkailama,
|
|
147
|
+
...FastBundleBundlesDiscounts,
|
|
148
|
+
...KiteFreeGiftDiscount,
|
|
114
149
|
...UnlimitedBundlesDiscounts,
|
|
150
|
+
...SimpleBundlesKits,
|
|
115
151
|
...PumperBundlesVolumeDiscount,
|
|
116
152
|
...ReviewxpoProductReviewsApp,
|
|
117
153
|
...ShopifyForms,
|
|
@@ -12,7 +12,12 @@ const mapShopifyAppMeta = {
|
|
|
12
12
|
...appConfig.ShopifyFormsConfig,
|
|
13
13
|
...appConfig.ReviewxpoProductReviewsAppConfig,
|
|
14
14
|
...appConfig.PumperBundlesVolumeDiscountConfig,
|
|
15
|
-
...appConfig.UnlimitedBundlesDiscountsConfig
|
|
15
|
+
...appConfig.UnlimitedBundlesDiscountsConfig,
|
|
16
|
+
...appConfig.KiteFreeGiftDiscountConfig,
|
|
17
|
+
...appConfig.FastBundleBundlesDiscountsConfig,
|
|
18
|
+
...appConfig.SimpleBundlesKitsConfig,
|
|
19
|
+
...appConfig.EasyBundleBuilderSkailamaConfig,
|
|
20
|
+
...appConfig.AssortionUpsellBundlesConfig
|
|
16
21
|
};
|
|
17
22
|
const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
|
|
18
23
|
|
|
@@ -77,7 +77,9 @@ const composeTypographyV2 = (value, attrs)=>{
|
|
|
77
77
|
};
|
|
78
78
|
const composeFontFamilyTypographyV2 = (value)=>{
|
|
79
79
|
const fontFamily = value?.fontFamily;
|
|
80
|
-
if (!fontFamily)
|
|
80
|
+
if (!fontFamily) {
|
|
81
|
+
return value?.fallbackFontFamily;
|
|
82
|
+
}
|
|
81
83
|
if (typeof fontFamily === 'string') {
|
|
82
84
|
return getFontUsedByTypographyV2({
|
|
83
85
|
fontFamily,
|
|
@@ -116,7 +118,7 @@ const composeTypographyAttr = (attrs)=>{
|
|
|
116
118
|
});
|
|
117
119
|
};
|
|
118
120
|
const composeTypographyClassName = (typo, typography)=>{
|
|
119
|
-
return typo ? typo?.type && !typo.custom ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
|
|
121
|
+
return typo ? typo?.type && !isCustomTypo(typo.custom) ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
|
|
120
122
|
};
|
|
121
123
|
const composeFallbackTypographyStyle = (tag)=>{
|
|
122
124
|
if ([
|
|
@@ -148,6 +150,9 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
|
|
|
148
150
|
...!typography?.type ? composeTypography(typography?.custom) : {}
|
|
149
151
|
};
|
|
150
152
|
};
|
|
153
|
+
const isCustomTypo = (typoProps)=>{
|
|
154
|
+
return typoProps && Object.keys(typoProps).length > 1 || typoProps && Object.keys(typoProps).length === 1 && !typoProps.fontSize;
|
|
155
|
+
};
|
|
151
156
|
|
|
152
157
|
exports.composeFallbackTypographyStyle = composeFallbackTypographyStyle;
|
|
153
158
|
exports.composeFontFamilyTypographyV2 = composeFontFamilyTypographyV2;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import 'zustand';
|
|
4
4
|
import 'swr';
|
|
@@ -44,7 +44,7 @@ const InteractionSuffix = ({ tag, uid })=>{
|
|
|
44
44
|
isCurrentInteractionTarget
|
|
45
45
|
]);
|
|
46
46
|
if (!isDisplay) {
|
|
47
|
-
return
|
|
47
|
+
return /*#__PURE__*/ jsx(Fragment, {});
|
|
48
48
|
}
|
|
49
49
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
50
50
|
children: [
|
|
@@ -230,6 +230,7 @@ const appendAnimation = (props, liquid)=>{
|
|
|
230
230
|
const appearTablet = getAnimationType(getSettingsByDevice('tablet'), 'appear');
|
|
231
231
|
const appearMobile = getAnimationType(getSettingsByDevice('mobile'), 'appear');
|
|
232
232
|
const enableAnimation = animation?.desktop?.enabled && (appearDesktop !== 'none' || hoverDesktop !== 'none') || animation?.tablet?.enabled && appearTablet !== 'none' || animation?.mobile?.enabled && appearMobile !== 'none';
|
|
233
|
+
if (!enableAnimation) return liquid;
|
|
233
234
|
const getInitVisibility = (device)=>getSettingsByDevice(device)?.enabled && ![
|
|
234
235
|
'shake',
|
|
235
236
|
'none'
|
|
@@ -244,8 +245,7 @@ const appendAnimation = (props, liquid)=>{
|
|
|
244
245
|
gp-data='${JSON.stringify({
|
|
245
246
|
config: animation,
|
|
246
247
|
tag,
|
|
247
|
-
opacity
|
|
248
|
-
isEnableInit: enableAnimation
|
|
248
|
+
opacity
|
|
249
249
|
})}'
|
|
250
250
|
style="${{
|
|
251
251
|
display: 'contents'
|
|
@@ -119,7 +119,7 @@ const getBgAttachmentByDevice = (background, device)=>{
|
|
|
119
119
|
return background?.[device]?.attachment;
|
|
120
120
|
};
|
|
121
121
|
const composeBackgroundCss = (backgroundColor)=>{
|
|
122
|
-
return `${backgroundColor ? `background-color: ${getSingleColorVariable(backgroundColor)}
|
|
122
|
+
return `${backgroundColor ? `background-color: ${getSingleColorVariable(backgroundColor)};` : undefined}`;
|
|
123
123
|
};
|
|
124
124
|
const makeFixedBgAttachment = (background)=>{
|
|
125
125
|
if (!background) return;
|
|
@@ -34,7 +34,7 @@ const getProduct = async (fetcher, { id, isSample, isStorefront })=>{
|
|
|
34
34
|
};
|
|
35
35
|
};
|
|
36
36
|
const orderBy = {
|
|
37
|
-
field: '
|
|
37
|
+
field: 'PLATFORM_CREATED_AT',
|
|
38
38
|
direction: 'DESC'
|
|
39
39
|
};
|
|
40
40
|
const fetchProduct = async (fetcher, { id, isSample, isStorefront })=>{
|
|
@@ -58,5 +58,35 @@ const UnlimitedBundlesDiscountsConfig = {
|
|
|
58
58
|
appId: 'd33d0f48-dee0-42a0-b156-2a5dce91814a'
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
+
const KiteFreeGiftDiscountConfig = {
|
|
62
|
+
KiteFreeGiftDiscount: {
|
|
63
|
+
appName: 'kite-free-gift-discounts',
|
|
64
|
+
appId: '2c7302c4-455d-4078-a829-48563ba26089'
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const FastBundleBundlesDiscountsConfig = {
|
|
68
|
+
FastBundleBundlesDiscounts: {
|
|
69
|
+
appName: 'fast-bundle',
|
|
70
|
+
appId: '9e87fbe2-9041-4c23-acf5-322413994cef'
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const SimpleBundlesKitsConfig = {
|
|
74
|
+
SimpleBundlesKits: {
|
|
75
|
+
appName: 'simple-bundles-kits',
|
|
76
|
+
appId: 'e553276b-36b2-446d-b80a-aa47fe5f96ac'
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
const EasyBundleBuilderSkailamaConfig = {
|
|
80
|
+
EasyBundleBuilderSkailama: {
|
|
81
|
+
appName: 'easy-bundles',
|
|
82
|
+
appId: '05b1325c-6303-4da5-8e2f-b13ab2a50e1a'
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const AssortionUpsellBundlesConfig = {
|
|
86
|
+
AssortionUpsellBundles: {
|
|
87
|
+
appName: 'assortion',
|
|
88
|
+
appId: '5588d7f9-a5bc-4f4a-9c54-39b7e081dd23'
|
|
89
|
+
}
|
|
90
|
+
};
|
|
61
91
|
|
|
62
|
-
export { BonLoyaltyRewardsReferralsConfig, LoopSubscriptionsConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SkioSubscriptionsYcS20Config, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig };
|
|
92
|
+
export { AssortionUpsellBundlesConfig, BonLoyaltyRewardsReferralsConfig, EasyBundleBuilderSkailamaConfig, FastBundleBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, LoopSubscriptionsConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SimpleBundlesKitsConfig, SkioSubscriptionsYcS20Config, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig };
|
|
@@ -108,8 +108,44 @@ const UnlimitedBundlesDiscounts = {
|
|
|
108
108
|
'product-page-placeholder': null
|
|
109
109
|
}
|
|
110
110
|
};
|
|
111
|
+
const KiteFreeGiftDiscount = {
|
|
112
|
+
KiteFreeGiftDiscount: {
|
|
113
|
+
'app-block': null
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
const FastBundleBundlesDiscounts = {
|
|
117
|
+
FastBundleBundlesDiscounts: {
|
|
118
|
+
all_bundles: null,
|
|
119
|
+
fbt_position: null,
|
|
120
|
+
product_bundles: null,
|
|
121
|
+
product_bundle_with_ids: null,
|
|
122
|
+
volume_position: null
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
const SimpleBundlesKits = {
|
|
126
|
+
SimpleBundlesKits: {
|
|
127
|
+
'infinite-options-selector': null
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const EasyBundleBuilderSkailama = {
|
|
131
|
+
EasyBundleBuilderSkailama: {
|
|
132
|
+
'app-block-bundlePage': null
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const AssortionUpsellBundles = {
|
|
136
|
+
AssortionUpsellBundles: {
|
|
137
|
+
volume: null,
|
|
138
|
+
bundle: null,
|
|
139
|
+
addon: null
|
|
140
|
+
}
|
|
141
|
+
};
|
|
111
142
|
const composeSettingsByWidgetType = {
|
|
143
|
+
...AssortionUpsellBundles,
|
|
144
|
+
...EasyBundleBuilderSkailama,
|
|
145
|
+
...FastBundleBundlesDiscounts,
|
|
146
|
+
...KiteFreeGiftDiscount,
|
|
112
147
|
...UnlimitedBundlesDiscounts,
|
|
148
|
+
...SimpleBundlesKits,
|
|
113
149
|
...PumperBundlesVolumeDiscount,
|
|
114
150
|
...ReviewxpoProductReviewsApp,
|
|
115
151
|
...ShopifyForms,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig } from './appConfig.js';
|
|
1
|
+
import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig, SimpleBundlesKitsConfig, EasyBundleBuilderSkailamaConfig, AssortionUpsellBundlesConfig } from './appConfig.js';
|
|
2
2
|
|
|
3
3
|
const mapShopifyAppMeta = {
|
|
4
4
|
...RechargeSubscriptionsConfig,
|
|
@@ -10,7 +10,12 @@ const mapShopifyAppMeta = {
|
|
|
10
10
|
...ShopifyFormsConfig,
|
|
11
11
|
...ReviewxpoProductReviewsAppConfig,
|
|
12
12
|
...PumperBundlesVolumeDiscountConfig,
|
|
13
|
-
...UnlimitedBundlesDiscountsConfig
|
|
13
|
+
...UnlimitedBundlesDiscountsConfig,
|
|
14
|
+
...KiteFreeGiftDiscountConfig,
|
|
15
|
+
...FastBundleBundlesDiscountsConfig,
|
|
16
|
+
...SimpleBundlesKitsConfig,
|
|
17
|
+
...EasyBundleBuilderSkailamaConfig,
|
|
18
|
+
...AssortionUpsellBundlesConfig
|
|
14
19
|
};
|
|
15
20
|
const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
|
|
16
21
|
|
|
@@ -75,7 +75,9 @@ const composeTypographyV2 = (value, attrs)=>{
|
|
|
75
75
|
};
|
|
76
76
|
const composeFontFamilyTypographyV2 = (value)=>{
|
|
77
77
|
const fontFamily = value?.fontFamily;
|
|
78
|
-
if (!fontFamily)
|
|
78
|
+
if (!fontFamily) {
|
|
79
|
+
return value?.fallbackFontFamily;
|
|
80
|
+
}
|
|
79
81
|
if (typeof fontFamily === 'string') {
|
|
80
82
|
return getFontUsedByTypographyV2({
|
|
81
83
|
fontFamily,
|
|
@@ -114,7 +116,7 @@ const composeTypographyAttr = (attrs)=>{
|
|
|
114
116
|
});
|
|
115
117
|
};
|
|
116
118
|
const composeTypographyClassName = (typo, typography)=>{
|
|
117
|
-
return typo ? typo?.type && !typo.custom ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
|
|
119
|
+
return typo ? typo?.type && !isCustomTypo(typo.custom) ? genTypoClass(typo.type) : '' : typography?.type && genTypoClass(typography?.type);
|
|
118
120
|
};
|
|
119
121
|
const composeFallbackTypographyStyle = (tag)=>{
|
|
120
122
|
if ([
|
|
@@ -146,5 +148,8 @@ const composeTypographyStyle = (typo, typography, disableAttr)=>{
|
|
|
146
148
|
...!typography?.type ? composeTypography(typography?.custom) : {}
|
|
147
149
|
};
|
|
148
150
|
};
|
|
151
|
+
const isCustomTypo = (typoProps)=>{
|
|
152
|
+
return typoProps && Object.keys(typoProps).length > 1 || typoProps && Object.keys(typoProps).length === 1 && !typoProps.fontSize;
|
|
153
|
+
};
|
|
149
154
|
|
|
150
155
|
export { composeFallbackTypographyStyle, composeFontFamilyTypographyV2, composeTypography, composeTypographyAttr, composeTypographyClassName, composeTypographyCss, composeTypographyStyle, composeTypographyV2, composeTypographyV2Css, genTypoClass };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -7187,6 +7187,11 @@ type InputControlType<T> = SharedControlType<T> & {
|
|
|
7187
7187
|
action?: {
|
|
7188
7188
|
clear?: boolean;
|
|
7189
7189
|
};
|
|
7190
|
+
actionChangeControls?: {
|
|
7191
|
+
controlID: string;
|
|
7192
|
+
condition?: string;
|
|
7193
|
+
newValue: any;
|
|
7194
|
+
}[];
|
|
7190
7195
|
};
|
|
7191
7196
|
|
|
7192
7197
|
type InputFixContentControlType<T> = SharedControlType<T> & {
|
|
@@ -7329,6 +7334,7 @@ type Option$2<T> = {
|
|
|
7329
7334
|
tooltip?: string;
|
|
7330
7335
|
type?: string;
|
|
7331
7336
|
note?: string;
|
|
7337
|
+
maxOption?: number;
|
|
7332
7338
|
};
|
|
7333
7339
|
type Mapped$3<K, T> = NonNullable<T> extends ObjectDevices<infer U> ? {
|
|
7334
7340
|
id: K;
|
|
@@ -7383,6 +7389,7 @@ type TextareaControlType<T> = SharedControlType<T> & {
|
|
|
7383
7389
|
readonly?: boolean;
|
|
7384
7390
|
minHeight?: number;
|
|
7385
7391
|
maxWidth?: number;
|
|
7392
|
+
inputClass?: string;
|
|
7386
7393
|
autoHeight?: boolean;
|
|
7387
7394
|
defaultRows?: number;
|
|
7388
7395
|
showPlusBtn?: boolean;
|
|
@@ -8054,6 +8061,87 @@ type SelectProductBundleControlType<T> = SharedControlType<T> & {
|
|
|
8054
8061
|
hide?: boolean;
|
|
8055
8062
|
};
|
|
8056
8063
|
|
|
8064
|
+
type SettingStateType = 'normal' | 'hover' | 'focus' | 'active' | 'price' | 'compareAtPrice';
|
|
8065
|
+
type LangKey = 'en' | 'vi';
|
|
8066
|
+
type LabelWithLang = {
|
|
8067
|
+
[P in keyof Record<LangKey, ''>]?: string;
|
|
8068
|
+
};
|
|
8069
|
+
type SettingMediaType = 'image' | 'youtubeVideoID';
|
|
8070
|
+
type SettingUIHelpType = {
|
|
8071
|
+
content: string;
|
|
8072
|
+
buttonLink?: string;
|
|
8073
|
+
media?: {
|
|
8074
|
+
value: string;
|
|
8075
|
+
type: SettingMediaType;
|
|
8076
|
+
};
|
|
8077
|
+
};
|
|
8078
|
+
type LinkWithSetting = {
|
|
8079
|
+
name: string;
|
|
8080
|
+
state?: string;
|
|
8081
|
+
field?: string;
|
|
8082
|
+
};
|
|
8083
|
+
type ControlConfig = ControlProp<any> & {
|
|
8084
|
+
linkWithSetting?: LinkWithSetting;
|
|
8085
|
+
};
|
|
8086
|
+
type SettingUIControl = {
|
|
8087
|
+
id?: string;
|
|
8088
|
+
controlConfig?: ControlConfig;
|
|
8089
|
+
isCompo?: boolean;
|
|
8090
|
+
layout?: 'vertical' | 'horizontal';
|
|
8091
|
+
toggleGroupId?: string;
|
|
8092
|
+
label?: LabelWithLang;
|
|
8093
|
+
conditionDisplay?: string;
|
|
8094
|
+
conditionEnable?: string;
|
|
8095
|
+
options?: {
|
|
8096
|
+
hideOnDevices?: Record<NameDevices$1, boolean>;
|
|
8097
|
+
fullWidth?: boolean;
|
|
8098
|
+
disableMessage?: string;
|
|
8099
|
+
};
|
|
8100
|
+
setting?: {
|
|
8101
|
+
id: string;
|
|
8102
|
+
state?: SettingStateType;
|
|
8103
|
+
};
|
|
8104
|
+
searchKeyword?: string;
|
|
8105
|
+
} & SettingUICompo;
|
|
8106
|
+
type SettingUICompo = {
|
|
8107
|
+
controls?: SettingUIControl[];
|
|
8108
|
+
iconName?: string;
|
|
8109
|
+
getValueFromSettingID?: string;
|
|
8110
|
+
fixedValue?: string;
|
|
8111
|
+
placeholder?: string;
|
|
8112
|
+
help?: SettingUIHelpType;
|
|
8113
|
+
};
|
|
8114
|
+
type SettingUIMoreSetting = {
|
|
8115
|
+
label?: LabelWithLang;
|
|
8116
|
+
labelAction?: LabelWithLang;
|
|
8117
|
+
controls?: SettingUIControl[];
|
|
8118
|
+
help?: SettingUIHelpType;
|
|
8119
|
+
};
|
|
8120
|
+
type SettingUIToggleGroup = {
|
|
8121
|
+
label?: LabelWithLang;
|
|
8122
|
+
id?: string;
|
|
8123
|
+
controls?: SettingUIControl[];
|
|
8124
|
+
};
|
|
8125
|
+
type SettingUIToggleSettings = {
|
|
8126
|
+
type: 'control' | 'toggleGroup';
|
|
8127
|
+
controls?: SettingUIControl[];
|
|
8128
|
+
isActiveDefault?: boolean;
|
|
8129
|
+
} & SettingUIControl & SettingUIToggleGroup;
|
|
8130
|
+
type SettingUIGroup = {
|
|
8131
|
+
label?: LabelWithLang;
|
|
8132
|
+
message?: string;
|
|
8133
|
+
disableToggle?: boolean;
|
|
8134
|
+
conditionDisplay?: string;
|
|
8135
|
+
conditionEnable?: string;
|
|
8136
|
+
controls?: SettingUIControl[];
|
|
8137
|
+
moreSettings?: SettingUIMoreSetting;
|
|
8138
|
+
toggleSettings?: SettingUIToggleSettings[];
|
|
8139
|
+
help?: SettingUIHelpType;
|
|
8140
|
+
options?: {
|
|
8141
|
+
disableMessage?: string;
|
|
8142
|
+
};
|
|
8143
|
+
};
|
|
8144
|
+
|
|
8057
8145
|
type ControlProp<T> = ProductBundleChildControlType<T> | SelectProductBundleControlType<T> | AngleControlType<T> | CheckboxControlType<T> | ColorPickerControlType<T> | GroupControlType<T> | IconControlType<T> | InputFixContentControlType<T> | InputNumberControlType<T> | InputUnitControlType<T> | InputUnitSpacingControlType<T> | InputUnitWidthControlType<T> | InputControlType<T> | MarginControlType<T> | PaddingControlType<T> | PositionControlType<T> | RadioGroupControlType | RangeControlType<T> | SegmentControlType<T> | OpenLinkControlType<T> | SelectControlType<T> | TextareaControlType<T> | ToggleControlType<T> | ImageControlType<T> | ChildrensControlType | GridControlType<T> | FlexControlType<T> | TextEditorControlType<T> | ProductControlType<T> | TypographyControlType<T> | TypographyV2ControlType<T> | MenuControlType<T> | BehaviorStateControlType<T> | PickLinkControlType<T> | BoxShadowControlType<T> | TextShadowControlType<T> | BorderControlType<T> | BorderRadiusControlType<T> | RadiusPresetControlType<T> | SizeControlType<T> | ChildItemType<T> | PickMultiProductControlType<T> | CollectionControlType<T> | BackgroundControlType<T> | VisibilityControlType<T> | SelectVariantControlType | CountdownEvergreenType | Timezone<T> | CustomContentControlType<T> | DateTimePickerControlType | CountdownDailyType | KlaviyoCodes | YotpoLoyaltyCodes | InputWidthControlType<T> | LayoutSegmentControlType<T> | InputSpacing<T> | UniqueIdControlType<T> | PositionSquareControlType<T> | CustomCodeEditor | LayoutControlType<T> | LayoutBannerControlType<T> | SwatchesLinkControlType<T> | VariantSwatchesPresetControlType<T> | VariantSwatchesOnlyDefaultVariantControlType<T> | ProductListControlType<T> | ArticleListControlType<T> | CollectionBannerControlType<T> | Ratio<T> | StickyDisplayControlType<T> | SyncProductPropertiesControlType<T> | StepsGuide<T> | ImageShape<T> | GridArrange<T> | SizeSetting$1<T> | ChildIconType<T> | DropdownInput<T> | Dropdown<T> | AliPickSectionControlType<T> | ParallaxScrollingType<T> | BackgroundColorPickerType<T> | PlayPauseControlType<T> | LayoutCustomSegmentControlType<T> | SneakPeakRange<T> | SneakPeakTypeControlType<T> | SneakPeakControlType<T> | ProductInputCurrencyUnitControlType<T> | TypographyPostPurchaseControlType<T> | ProductOffersControlType<T> | DiscountAndShippingFee<T> | PostPurchaseTextareaControlType<T> | NotesControlType<T> | ButtonLayoutType<T> | ShapeSelectorControlType<T> | CustomPositionControlType<T> | SneakPeakControlType<T> | PostPurchaseTextareaControlType<T> | DealControlType<T> | DisplayTriggerControlType<T>;
|
|
8058
8146
|
type ControlTriggerAction = {
|
|
8059
8147
|
controlId: string;
|
|
@@ -8125,6 +8213,7 @@ type ComponentSetting<P extends BaseProps> = {
|
|
|
8125
8213
|
};
|
|
8126
8214
|
};
|
|
8127
8215
|
ui?: ControlUI[];
|
|
8216
|
+
uiV2?: SettingUIGroup[];
|
|
8128
8217
|
presets?: ComponentPreset[];
|
|
8129
8218
|
locales?: Record<string, any>;
|
|
8130
8219
|
};
|
|
@@ -28817,7 +28906,7 @@ type ProductListProviderProps = ProductListContextProps & {
|
|
|
28817
28906
|
declare const ProductListProvider: React.FC<ProductListProviderProps>;
|
|
28818
28907
|
declare const useProductListStore: <U>(selector: (state: ExtractState<StoreApi<ProductListContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
|
|
28819
28908
|
|
|
28820
|
-
type ProductSelectFragment = Pick<Product$1, 'tags' | 'id' | 'title' | 'description' | 'descriptionHtml' | 'handle' | 'averageRating' | 'isStorefront' | 'isSample' | 'baseID' | 'sku' | 'vendor'> & {
|
|
28909
|
+
type ProductSelectFragment = Pick<Product$1, 'tags' | 'id' | 'title' | 'createdAt' | 'description' | 'descriptionHtml' | 'handle' | 'averageRating' | 'isStorefront' | 'isSample' | 'baseID' | 'sku' | 'vendor'> & {
|
|
28821
28910
|
collections?: Maybe$1<{
|
|
28822
28911
|
edges: Array<{
|
|
28823
28912
|
node?: Maybe$1<Pick<Collection$1, 'id' | 'title'>>;
|
|
@@ -29877,6 +29966,15 @@ declare const filterAttrInStyle: (style?: React.CSSProperties, filterKeys?: stri
|
|
|
29877
29966
|
'--gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
29878
29967
|
'--hvr-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
29879
29968
|
'--focus-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
29969
|
+
'--gr'?: csstype.Property.GridRow | undefined;
|
|
29970
|
+
'--hvr-gr'?: csstype.Property.GridRow | undefined;
|
|
29971
|
+
'--focus-gr'?: csstype.Property.GridRow | undefined;
|
|
29972
|
+
'--gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
29973
|
+
'--hvr-gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
29974
|
+
'--focus-gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
29975
|
+
'--gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
29976
|
+
'--hvr-gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
29977
|
+
'--focus-gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
29880
29978
|
'--gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
29881
29979
|
'--hvr-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
29882
29980
|
'--focus-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
@@ -31381,6 +31479,15 @@ declare const removeAttrInStyle: (style?: React.CSSProperties, filterKeys?: stri
|
|
|
31381
31479
|
'--gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
31382
31480
|
'--hvr-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
31383
31481
|
'--focus-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
31482
|
+
'--gr'?: csstype.Property.GridRow | undefined;
|
|
31483
|
+
'--hvr-gr'?: csstype.Property.GridRow | undefined;
|
|
31484
|
+
'--focus-gr'?: csstype.Property.GridRow | undefined;
|
|
31485
|
+
'--gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
31486
|
+
'--hvr-gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
31487
|
+
'--focus-gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
31488
|
+
'--gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
31489
|
+
'--hvr-gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
31490
|
+
'--focus-gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
31384
31491
|
'--gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
31385
31492
|
'--hvr-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
31386
31493
|
'--focus-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
@@ -32885,6 +32992,15 @@ declare const filterCornerInStyle: (style?: React.CSSProperties) => {
|
|
|
32885
32992
|
'--gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
32886
32993
|
'--hvr-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
32887
32994
|
'--focus-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
32995
|
+
'--gr'?: csstype.Property.GridRow | undefined;
|
|
32996
|
+
'--hvr-gr'?: csstype.Property.GridRow | undefined;
|
|
32997
|
+
'--focus-gr'?: csstype.Property.GridRow | undefined;
|
|
32998
|
+
'--gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
32999
|
+
'--hvr-gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
33000
|
+
'--focus-gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
33001
|
+
'--gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
33002
|
+
'--hvr-gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
33003
|
+
'--focus-gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
32888
33004
|
'--gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
32889
33005
|
'--hvr-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
32890
33006
|
'--focus-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
@@ -34389,6 +34505,15 @@ declare const removePaddingYInStyle: (style?: React.CSSProperties) => {
|
|
|
34389
34505
|
'--gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
34390
34506
|
'--hvr-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
34391
34507
|
'--focus-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
34508
|
+
'--gr'?: csstype.Property.GridRow | undefined;
|
|
34509
|
+
'--hvr-gr'?: csstype.Property.GridRow | undefined;
|
|
34510
|
+
'--focus-gr'?: csstype.Property.GridRow | undefined;
|
|
34511
|
+
'--gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
34512
|
+
'--hvr-gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
34513
|
+
'--focus-gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
34514
|
+
'--gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
34515
|
+
'--hvr-gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
34516
|
+
'--focus-gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
34392
34517
|
'--gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
34393
34518
|
'--hvr-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
34394
34519
|
'--focus-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
@@ -36033,6 +36158,15 @@ declare const composeTypographyStyle: (typo?: TypographySettingV2, typography?:
|
|
|
36033
36158
|
'--gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
36034
36159
|
'--hvr-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
36035
36160
|
'--focus-gg-mobile'?: csstype.Property.GridGap<string | number> | undefined;
|
|
36161
|
+
'--gr'?: csstype.Property.GridRow | undefined;
|
|
36162
|
+
'--hvr-gr'?: csstype.Property.GridRow | undefined;
|
|
36163
|
+
'--focus-gr'?: csstype.Property.GridRow | undefined;
|
|
36164
|
+
'--gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
36165
|
+
'--hvr-gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
36166
|
+
'--focus-gr-tablet'?: csstype.Property.GridRow | undefined;
|
|
36167
|
+
'--gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
36168
|
+
'--hvr-gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
36169
|
+
'--focus-gr-mobile'?: csstype.Property.GridRow | undefined;
|
|
36036
36170
|
'--gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
36037
36171
|
'--hvr-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
|
36038
36172
|
'--focus-gtc'?: csstype.Property.GridTemplateColumns<string | number> | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.48.0-dev.
|
|
3
|
+
"version": "1.48.0-dev.37",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"type-check": "yarn tsc --noEmit"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@gem-sdk/adapter-shopify": "1.48.0-dev.
|
|
31
|
-
"@gem-sdk/styles": "1.48.0-dev.
|
|
30
|
+
"@gem-sdk/adapter-shopify": "1.48.0-dev.3",
|
|
31
|
+
"@gem-sdk/styles": "1.48.0-dev.32",
|
|
32
32
|
"@types/classnames": "^2.3.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|