@gem-sdk/core 1.53.0-dev.14 → 1.53.0-dev.145
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/ComponentToolbarPreview.js +58 -3
- package/dist/cjs/components/ComponentWrapper.js +1 -1
- package/dist/cjs/components/InteractionSuffix.js +10 -91
- package/dist/cjs/components/Render.liquid.js +34 -7
- package/dist/cjs/contexts/PageContext.js +9 -1
- package/dist/cjs/graphql/queries/published-shop-metas.js +15 -0
- package/dist/cjs/helpers/animations.js +11 -2
- package/dist/cjs/helpers/background.js +6 -1
- package/dist/cjs/helpers/convert.js +1 -1
- package/dist/cjs/helpers/interaction/index.js +24 -5
- package/dist/cjs/helpers/radius.js +11 -1
- package/dist/cjs/helpers/third-party/appConfig.js +42 -0
- package/dist/cjs/helpers/third-party/appSetting.js +144 -1
- package/dist/cjs/helpers/third-party/constant.js +7 -1
- package/dist/cjs/helpers/typography.js +5 -2
- package/dist/cjs/hooks/animation/useAnimationConfig.js +2 -1
- package/dist/cjs/hooks/animation/useApplyAnimation.js +5 -5
- package/dist/cjs/index.js +4 -0
- package/dist/esm/components/ComponentToolbarPreview.js +58 -3
- package/dist/esm/components/ComponentWrapper.js +1 -1
- package/dist/esm/components/InteractionSuffix.js +11 -92
- package/dist/esm/components/Render.liquid.js +34 -7
- package/dist/esm/contexts/PageContext.js +9 -1
- package/dist/esm/graphql/queries/published-shop-metas.js +13 -0
- package/dist/esm/helpers/animations.js +11 -2
- package/dist/esm/helpers/background.js +6 -1
- package/dist/esm/helpers/convert.js +1 -1
- package/dist/esm/helpers/interaction/index.js +24 -5
- package/dist/esm/helpers/radius.js +11 -1
- package/dist/esm/helpers/third-party/appConfig.js +37 -1
- package/dist/esm/helpers/third-party/appSetting.js +144 -1
- package/dist/esm/helpers/third-party/constant.js +8 -2
- package/dist/esm/helpers/typography.js +5 -2
- package/dist/esm/hooks/animation/useAnimationConfig.js +2 -1
- package/dist/esm/hooks/animation/useApplyAnimation.js +5 -5
- package/dist/esm/index.js +2 -0
- package/dist/types/index.d.ts +179 -22
- package/package.json +3 -3
|
@@ -51,10 +51,16 @@ const animations = ()=>{
|
|
|
51
51
|
'left',
|
|
52
52
|
'right'
|
|
53
53
|
].includes(direction ?? '') ? 'X' : 'Y';
|
|
54
|
-
|
|
54
|
+
let isNeg = [
|
|
55
55
|
'left',
|
|
56
56
|
'down'
|
|
57
57
|
].includes(direction ?? '') ? '-' : '';
|
|
58
|
+
if (reverse) {
|
|
59
|
+
isNeg = [
|
|
60
|
+
'left',
|
|
61
|
+
'down'
|
|
62
|
+
].includes(direction ?? '') ? '' : '-';
|
|
63
|
+
}
|
|
58
64
|
const preset = [
|
|
59
65
|
{
|
|
60
66
|
opacity: 0,
|
|
@@ -124,7 +130,10 @@ const animations = ()=>{
|
|
|
124
130
|
opacity: 1
|
|
125
131
|
}
|
|
126
132
|
];
|
|
127
|
-
|
|
133
|
+
let zoomPreset = zoomDirection === 'in' ? zoomInPreset : zoomOutPreset;
|
|
134
|
+
if (reverse) {
|
|
135
|
+
zoomPreset = zoomDirection === 'in' ? zoomOutPreset : zoomInPreset;
|
|
136
|
+
}
|
|
128
137
|
return generateAnimationInstance(target, reverse ? zoomPreset.reverse() : zoomPreset, {
|
|
129
138
|
...generateOptions(normalizedOptions, 700)
|
|
130
139
|
});
|
|
@@ -11,7 +11,9 @@ const getStyleBackgroundByDevice = (background, options)=>{
|
|
|
11
11
|
...getStyleBgColor(background)
|
|
12
12
|
} : {},
|
|
13
13
|
...!options?.ignoreBackgroundImage ? {
|
|
14
|
-
...getStyleBgImage(background, options)
|
|
14
|
+
...getStyleBgImage(background, options)
|
|
15
|
+
} : {},
|
|
16
|
+
...!options?.ignoreBackgroundImageProperties ? {
|
|
15
17
|
...getStyleBgPosition(background),
|
|
16
18
|
...getStyleBgSize(background),
|
|
17
19
|
...getStyleBgRepeat(background)
|
|
@@ -72,6 +74,9 @@ const getBgImageByDevice = (background, device, options)=>{
|
|
|
72
74
|
if (typeof imageByDevice === 'string') {
|
|
73
75
|
return `url(${imageByDevice})`;
|
|
74
76
|
}
|
|
77
|
+
if (imageByDevice !== undefined) {
|
|
78
|
+
return 'none';
|
|
79
|
+
}
|
|
75
80
|
};
|
|
76
81
|
const getStyleBgPosition = (background)=>{
|
|
77
82
|
const bgPosition = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
1
2
|
import 'react/jsx-runtime';
|
|
2
3
|
import 'zustand';
|
|
3
|
-
import 'react';
|
|
4
4
|
import 'swr';
|
|
5
5
|
import { usePageStore } from '../../contexts/PageContext.js';
|
|
6
6
|
import '@gem-sdk/adapter-shopify';
|
|
@@ -15,9 +15,17 @@ import 'dayjs';
|
|
|
15
15
|
import '../convert.js';
|
|
16
16
|
|
|
17
17
|
const useInteraction = ()=>{
|
|
18
|
+
const ref = useRef(null);
|
|
18
19
|
const setInteractionIsSelectOnPage = usePageStore((s)=>s.setInteractionIsSelectOnPage);
|
|
20
|
+
function findElementIncludingSelf(element, selector) {
|
|
21
|
+
if (!(element instanceof Document) && element?.matches(selector)) {
|
|
22
|
+
return element;
|
|
23
|
+
} else {
|
|
24
|
+
return element?.querySelector(selector);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
19
27
|
const onListener = ({ event, selector }, callback)=>{
|
|
20
|
-
const element = document
|
|
28
|
+
const element = findElementIncludingSelf(ref.current || document, selector);
|
|
21
29
|
if (!element) return;
|
|
22
30
|
element.addEventListener(event, (e)=>{
|
|
23
31
|
const event = e;
|
|
@@ -25,8 +33,8 @@ const useInteraction = ()=>{
|
|
|
25
33
|
if (callback) callback(params);
|
|
26
34
|
});
|
|
27
35
|
};
|
|
28
|
-
const trigger = ({ event, data, selector })=>{
|
|
29
|
-
const element = document.querySelector(selector);
|
|
36
|
+
const trigger = ({ event, data, selector, element: elementParam })=>{
|
|
37
|
+
const element = elementParam || document.querySelector(selector);
|
|
30
38
|
if (!element) return;
|
|
31
39
|
const eventDispatch = new CustomEvent(event, {
|
|
32
40
|
bubbles: false,
|
|
@@ -45,6 +53,14 @@ const useInteraction = ()=>{
|
|
|
45
53
|
[key]: value
|
|
46
54
|
}));
|
|
47
55
|
};
|
|
56
|
+
const getInteractionPreviousData = (element, key)=>{
|
|
57
|
+
const interactionData = element.getAttribute('gp-data-interaction');
|
|
58
|
+
const interactionDataJson = JSON.parse(interactionData || '{}');
|
|
59
|
+
return {
|
|
60
|
+
previousData: interactionDataJson[key],
|
|
61
|
+
interactionDataJson
|
|
62
|
+
};
|
|
63
|
+
};
|
|
48
64
|
const closeSelectOnPage = ()=>{
|
|
49
65
|
setInteractionIsSelectOnPage(false);
|
|
50
66
|
const event = new CustomEvent('editor:interaction:change-select-on-page', {
|
|
@@ -57,7 +73,10 @@ const useInteraction = ()=>{
|
|
|
57
73
|
onListener,
|
|
58
74
|
trigger,
|
|
59
75
|
saveToElementInteractionData,
|
|
60
|
-
closeSelectOnPage
|
|
76
|
+
closeSelectOnPage,
|
|
77
|
+
ref,
|
|
78
|
+
findElementIncludingSelf,
|
|
79
|
+
getInteractionPreviousData
|
|
61
80
|
};
|
|
62
81
|
};
|
|
63
82
|
|
|
@@ -25,7 +25,14 @@ const getRadiusCSSFromGlobal = (state, key, device)=>{
|
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
const getCustomRadius = (state, radius, device)=>{
|
|
28
|
-
|
|
28
|
+
const list = [
|
|
29
|
+
'custom',
|
|
30
|
+
'pill',
|
|
31
|
+
'rounded',
|
|
32
|
+
'single',
|
|
33
|
+
'none'
|
|
34
|
+
];
|
|
35
|
+
if (!radius || !state || !list.includes(radius?.radiusType ?? '')) return {};
|
|
29
36
|
const suffix = device && device !== 'desktop' ? devicesMapping?.[device] : '';
|
|
30
37
|
const mState = stateMapping?.[state];
|
|
31
38
|
return {
|
|
@@ -60,6 +67,7 @@ const composeRadiusState = (radiusValue, device)=>{
|
|
|
60
67
|
case 'circle':
|
|
61
68
|
case 'none':
|
|
62
69
|
case 'custom':
|
|
70
|
+
case 'rounded':
|
|
63
71
|
Object.assign(style, getCustomRadius('normal', radiusValue.normal, device));
|
|
64
72
|
break;
|
|
65
73
|
}
|
|
@@ -72,6 +80,7 @@ const composeRadiusState = (radiusValue, device)=>{
|
|
|
72
80
|
case 'circle':
|
|
73
81
|
case 'none':
|
|
74
82
|
case 'custom':
|
|
83
|
+
case 'rounded':
|
|
75
84
|
Object.assign(style, getCustomRadius('hover', radiusValue.hover, device));
|
|
76
85
|
break;
|
|
77
86
|
}
|
|
@@ -84,6 +93,7 @@ const composeRadiusState = (radiusValue, device)=>{
|
|
|
84
93
|
case 'circle':
|
|
85
94
|
case 'none':
|
|
86
95
|
case 'custom':
|
|
96
|
+
case 'rounded':
|
|
87
97
|
Object.assign(style, getCustomRadius('focus', radiusValue.focus, device));
|
|
88
98
|
break;
|
|
89
99
|
}
|
|
@@ -112,5 +112,41 @@ const YotpoReviewsV3UgcConfig = {
|
|
|
112
112
|
appId: 'eb7dfd7d-db44-4334-bc49-c893b51b36cf'
|
|
113
113
|
}
|
|
114
114
|
};
|
|
115
|
+
const WhatmoreShoppableVideosreelConfig = {
|
|
116
|
+
WhatmoreShoppableVideosreel: {
|
|
117
|
+
appName: 'whatmore-shoppable-videos',
|
|
118
|
+
appId: '20db8a72-315a-4364-8885-64219ee48303'
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const ProductOptionsCustomizerConfig = {
|
|
122
|
+
ProductOptionsCustomizer: {
|
|
123
|
+
appName: 'product-options-customizer',
|
|
124
|
+
appId: '6857ca6c-35eb-4b6f-9d58-a039f31d9406'
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
const AppointmentBookingCowlendarConfig = {
|
|
128
|
+
AppointmentBookingCowlendar: {
|
|
129
|
+
appName: 'cowlendar-booking',
|
|
130
|
+
appId: '6d8b8f6a-9b3c-42b8-b2e6-a758c38d45bf'
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
const SproutPlantTreesGrowSalesConfig = {
|
|
134
|
+
SproutPlantTreesGrowSales: {
|
|
135
|
+
appName: 'sprout-plant-trees',
|
|
136
|
+
appId: '7db5ee24-2195-4099-b98e-1547c600e4aa'
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
const InstasellShoppableInstagramConfig = {
|
|
140
|
+
InstasellShoppableInstagram: {
|
|
141
|
+
appName: 'instasell-instagram-gallery',
|
|
142
|
+
appId: '38d643ac-410a-4b2c-a727-6125ff08e444'
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const BoldSubscriptionsConfig = {
|
|
146
|
+
BoldSubscriptions: {
|
|
147
|
+
appName: 'bold-subscriptions',
|
|
148
|
+
appId: '9ceb49f0-5fe5-4b5e-943d-f8af8985167d'
|
|
149
|
+
}
|
|
150
|
+
};
|
|
115
151
|
|
|
116
|
-
export { BonLoyaltyRewardsReferralsConfig, EasyBundleBuilderSkailamaConfig, FastBundleBundlesDiscountsConfig, FlyBundlesUpsellsFbtConfig, JunipProductReviewsUgcConfig, KiteFreeGiftDiscountConfig, LoopSubscriptionsConfig, PreorderNowPreOrderPqConfig, PreorderNowWodPresaleConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SimpleBundlesKitsConfig, SkioSubscriptionsYcS20Config, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig, YotpoReviewsV3UgcConfig };
|
|
152
|
+
export { AppointmentBookingCowlendarConfig, BoldSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, EasyBundleBuilderSkailamaConfig, FastBundleBundlesDiscountsConfig, FlyBundlesUpsellsFbtConfig, InstasellShoppableInstagramConfig, JunipProductReviewsUgcConfig, KiteFreeGiftDiscountConfig, LoopSubscriptionsConfig, PreorderNowPreOrderPqConfig, PreorderNowWodPresaleConfig, ProductOptionsCustomizerConfig, PumperBundlesVolumeDiscountConfig, RechargeSubscriptionsConfig, ReviewxpoProductReviewsAppConfig, SelleasyConfig, ShopifyFormsConfig, SimpleBundlesKitsConfig, SkioSubscriptionsYcS20Config, SproutPlantTreesGrowSalesConfig, SubifySubscriptionsConfig, UnlimitedBundlesDiscountsConfig, WhatmoreShoppableVideosreelConfig, YotpoReviewsV3UgcConfig };
|
|
@@ -93,6 +93,13 @@ const overrideSettings = (tag, currentSetting, appSetting)=>{
|
|
|
93
93
|
selected_product: appSetting?.['productHandle'] || '{{ product }}'
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
+
case 'WhatmoreShoppableVideosreel':
|
|
97
|
+
{
|
|
98
|
+
return {
|
|
99
|
+
...currentSetting,
|
|
100
|
+
['show-views']: appSetting?.showViews
|
|
101
|
+
};
|
|
102
|
+
}
|
|
96
103
|
default:
|
|
97
104
|
return currentSetting;
|
|
98
105
|
}
|
|
@@ -212,7 +219,142 @@ const YotpoReviews = {
|
|
|
212
219
|
}
|
|
213
220
|
}
|
|
214
221
|
};
|
|
222
|
+
const WhatmoreShoppableVideosreel = {
|
|
223
|
+
WhatmoreShoppableVideosreel: {
|
|
224
|
+
'app-block': {
|
|
225
|
+
heading: 'Watch and Buy',
|
|
226
|
+
'template-type': 'template-f',
|
|
227
|
+
'show-views': 'show',
|
|
228
|
+
'ui-theme': 'round',
|
|
229
|
+
'color-primary': '#343434',
|
|
230
|
+
'color-secondary': '#343434',
|
|
231
|
+
'title-font': 'poppins_n4',
|
|
232
|
+
'primary-font': 'poppins_n4',
|
|
233
|
+
'title-font-size': 40,
|
|
234
|
+
'title-font-size-portrait': 24,
|
|
235
|
+
'landscape-padding': 40,
|
|
236
|
+
'top-bottom-padding': 20,
|
|
237
|
+
'scroll-video-tile-size': 80,
|
|
238
|
+
'scroll-video-tile-size-portrait': 80,
|
|
239
|
+
'min-height': 380
|
|
240
|
+
},
|
|
241
|
+
'app-block-banner': {
|
|
242
|
+
'template-type': 'template-banner-a',
|
|
243
|
+
'ui-theme': 'round',
|
|
244
|
+
'banner-video-tile-size': 80
|
|
245
|
+
},
|
|
246
|
+
'app-block-collections': {
|
|
247
|
+
collectionHeading: 'W',
|
|
248
|
+
'template-type': 'template-collections-b',
|
|
249
|
+
'ui-theme': 'round',
|
|
250
|
+
'color-secondary': '#343434',
|
|
251
|
+
'primary-font': 'poppins_n4',
|
|
252
|
+
'tile-size': 60,
|
|
253
|
+
'tile-size-portrait': 60,
|
|
254
|
+
'min-height': 250
|
|
255
|
+
},
|
|
256
|
+
'app-block-stories': {
|
|
257
|
+
'template-type': 'template-stories-a',
|
|
258
|
+
'ui-theme': 'round',
|
|
259
|
+
'color-primary': '#343434',
|
|
260
|
+
'color-secondary': '#343434',
|
|
261
|
+
'primary-font': 'poppins_n4',
|
|
262
|
+
'stories-top-bottom-padding': 0,
|
|
263
|
+
'story-tile-size': 40,
|
|
264
|
+
'story-tile-size-desktop': 40
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
const ProductOptionsCustomizer = {
|
|
269
|
+
ProductOptionsCustomizer: {
|
|
270
|
+
'product-page-customizer': {
|
|
271
|
+
pc_container_size: 100,
|
|
272
|
+
pc_show_options_total: 'initial',
|
|
273
|
+
pc_customizations_total_text: 'Customizations Total:',
|
|
274
|
+
pc_show_preloader: 'hide',
|
|
275
|
+
pc_preloader_color: '',
|
|
276
|
+
pc_ignore_redirect_command: true,
|
|
277
|
+
pc_basic_label_text_color: '#000000',
|
|
278
|
+
pc_basic_label_font_size: 14,
|
|
279
|
+
pc_basic_label_bolden: 'unset',
|
|
280
|
+
pc_basic_label_space_above: 0,
|
|
281
|
+
pc_basic_option_background_color: '#FFFFFF',
|
|
282
|
+
pc_basic_option_text_color: '#000000',
|
|
283
|
+
pc_basic_option_border_color: '#000000',
|
|
284
|
+
pc_basic_option_border_style: 'solid',
|
|
285
|
+
pc_basic_option_border_width: 1,
|
|
286
|
+
pc_basic_option_curve_the_corners: 'none',
|
|
287
|
+
pc_basic_option_font_size: 14,
|
|
288
|
+
pc_basic_option_bolden: 'none',
|
|
289
|
+
pc_basic_option_width: 100,
|
|
290
|
+
pc_basic_option_space_above: 0,
|
|
291
|
+
pc_basic_option_space_below: 0,
|
|
292
|
+
pc_basic_option_space_inside: 10,
|
|
293
|
+
pc_advanced_custom_css: '',
|
|
294
|
+
pc_advanced_custom_js: '',
|
|
295
|
+
pc_show_image_swatch_preview: false
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
};
|
|
299
|
+
const AppointmentBookingCowlendar = {
|
|
300
|
+
AppointmentBookingCowlendar: {
|
|
301
|
+
'app-section': {
|
|
302
|
+
section_title: 'Services list',
|
|
303
|
+
section_type: 'services-list'
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
const SproutPlantTreesGrowSales = {
|
|
308
|
+
SproutPlantTreesGrowSales: {
|
|
309
|
+
badge: null,
|
|
310
|
+
'impact-banner': null
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
const InstasellShoppableInstagram = {
|
|
314
|
+
InstasellShoppableInstagram: {
|
|
315
|
+
'app-block': {
|
|
316
|
+
heading: 'InstaSell: Instagram Gallery+',
|
|
317
|
+
description: 'Showcase your Instagram Feed on your Shopify Storefront'
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
const BoldSubscriptions = {
|
|
322
|
+
BoldSubscriptions: {
|
|
323
|
+
'bsub-widget-block': {
|
|
324
|
+
default_subscribe: true,
|
|
325
|
+
primary_color: '#3b63ff',
|
|
326
|
+
secondary_color: '#7dba63',
|
|
327
|
+
background_color: '#f8f9f9',
|
|
328
|
+
border_radius: 4,
|
|
329
|
+
header_text: 'Purchase Options',
|
|
330
|
+
one_time_text: 'One-time Purchase',
|
|
331
|
+
recurring_text: 'Subscribe and Save',
|
|
332
|
+
prepaid_recurring_text: 'Prepaid Subscribe and Save',
|
|
333
|
+
discount_summary_text: '(Save {discount})',
|
|
334
|
+
discount_summary_plural_text: '(Save up to {discount})',
|
|
335
|
+
frequency_header: 'Delivery Frequency',
|
|
336
|
+
frequency_text: 'delivery',
|
|
337
|
+
prepaid_checkbox_label_text: 'Prepay for subscription',
|
|
338
|
+
billing_frequency_header: 'Billing Frequency',
|
|
339
|
+
billing_frequency_text: '{count} Orders',
|
|
340
|
+
delivery_frequency_discount_text: '({discount} off)',
|
|
341
|
+
billing_frequency_discount_text: '({discount} off)',
|
|
342
|
+
prepaid_total_text: 'Billed {price} today',
|
|
343
|
+
prepaid_continue_as_prepaid_text: 'Prepaid order will auto-renew after {count} orders',
|
|
344
|
+
prepaid_continue_as_standard_text: 'Becomes a regular subscription after {count} orders',
|
|
345
|
+
convertible_header: 'Converts to',
|
|
346
|
+
eligible_for_subscription_header: 'Eligible for Subscription',
|
|
347
|
+
initial_dynamic_discount_text: 'Save {initial_percent_discount}% ({initial_fixed_discount})',
|
|
348
|
+
subsequent_dynamic_discounts_text: '{subsequent_percent_discount}% ({subsequent_fixed_discount}) after {order_count} order(s)'
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
};
|
|
215
352
|
const composeSettingsByWidgetType = {
|
|
353
|
+
...InstasellShoppableInstagram,
|
|
354
|
+
...SproutPlantTreesGrowSales,
|
|
355
|
+
...AppointmentBookingCowlendar,
|
|
356
|
+
...ProductOptionsCustomizer,
|
|
357
|
+
...WhatmoreShoppableVideosreel,
|
|
216
358
|
...JunipProductReviewsUgc,
|
|
217
359
|
...FlyBundlesUpsellsFbt,
|
|
218
360
|
...PreorderNowWodPresale,
|
|
@@ -231,7 +373,8 @@ const composeSettingsByWidgetType = {
|
|
|
231
373
|
...LoyaltyRewardsReferrals,
|
|
232
374
|
...SubifySubscriptions,
|
|
233
375
|
...SelleasyWidget,
|
|
234
|
-
...YotpoReviews
|
|
376
|
+
...YotpoReviews,
|
|
377
|
+
...BoldSubscriptions
|
|
235
378
|
};
|
|
236
379
|
|
|
237
380
|
export { composeSettingsByWidgetType, overrideSettings };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig, SimpleBundlesKitsConfig, EasyBundleBuilderSkailamaConfig, PreorderNowPreOrderPqConfig, FlyBundlesUpsellsFbtConfig, JunipProductReviewsUgcConfig, PreorderNowWodPresaleConfig, YotpoReviewsV3UgcConfig } from './appConfig.js';
|
|
1
|
+
import { RechargeSubscriptionsConfig, BonLoyaltyRewardsReferralsConfig, SubifySubscriptionsConfig, SelleasyConfig, LoopSubscriptionsConfig, SkioSubscriptionsYcS20Config, ShopifyFormsConfig, ReviewxpoProductReviewsAppConfig, PumperBundlesVolumeDiscountConfig, UnlimitedBundlesDiscountsConfig, KiteFreeGiftDiscountConfig, FastBundleBundlesDiscountsConfig, SimpleBundlesKitsConfig, EasyBundleBuilderSkailamaConfig, PreorderNowPreOrderPqConfig, FlyBundlesUpsellsFbtConfig, JunipProductReviewsUgcConfig, PreorderNowWodPresaleConfig, YotpoReviewsV3UgcConfig, WhatmoreShoppableVideosreelConfig, ProductOptionsCustomizerConfig, AppointmentBookingCowlendarConfig, SproutPlantTreesGrowSalesConfig, InstasellShoppableInstagramConfig, BoldSubscriptionsConfig } from './appConfig.js';
|
|
2
2
|
|
|
3
3
|
const mapShopifyAppMeta = {
|
|
4
4
|
...RechargeSubscriptionsConfig,
|
|
@@ -19,7 +19,13 @@ const mapShopifyAppMeta = {
|
|
|
19
19
|
...FlyBundlesUpsellsFbtConfig,
|
|
20
20
|
...JunipProductReviewsUgcConfig,
|
|
21
21
|
...PreorderNowWodPresaleConfig,
|
|
22
|
-
...YotpoReviewsV3UgcConfig
|
|
22
|
+
...YotpoReviewsV3UgcConfig,
|
|
23
|
+
...WhatmoreShoppableVideosreelConfig,
|
|
24
|
+
...ProductOptionsCustomizerConfig,
|
|
25
|
+
...AppointmentBookingCowlendarConfig,
|
|
26
|
+
...SproutPlantTreesGrowSalesConfig,
|
|
27
|
+
...InstasellShoppableInstagramConfig,
|
|
28
|
+
...BoldSubscriptionsConfig
|
|
23
29
|
};
|
|
24
30
|
const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
|
|
25
31
|
|
|
@@ -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:
|
|
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}`;
|
|
@@ -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,6 +64,7 @@ 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';
|