@gem-sdk/core 1.57.15-staging.3 → 1.58.0-dev.15
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 +2 -2
- package/dist/cjs/components/InteractionSuffix.js +1 -1
- package/dist/cjs/components/ai-generator/AIContentGenerator.js +1 -1
- package/dist/cjs/components/theme-section/CreateThemeSection.js +1 -1
- package/dist/cjs/contexts/ProductContext.js +16 -1
- package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +32 -0
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +0 -28
- package/dist/cjs/graphql/queries/preview-page.generated.js +6 -12
- package/dist/cjs/helpers/background.js +6 -2
- package/dist/cjs/helpers/borders.js +17 -0
- package/dist/cjs/helpers/compose-advance-style.js +16 -1
- package/dist/cjs/helpers/interaction/index.js +1 -1
- package/dist/cjs/helpers/prefetch-queries.js +3 -5
- package/dist/cjs/helpers/radius.js +11 -1
- package/dist/cjs/helpers/shadow.js +3 -2
- package/dist/cjs/helpers/third-party/appConfig.js +7 -0
- package/dist/cjs/helpers/third-party/appSetting.js +9 -1
- package/dist/cjs/helpers/third-party/constant.js +2 -1
- package/dist/cjs/helpers/third-party/getAppBlockConfig.js +8 -0
- package/dist/cjs/hooks/useProduct.js +10 -1
- package/dist/cjs/index.js +12 -10
- package/dist/esm/components/ComponentToolbarPreview.js +2 -2
- package/dist/esm/components/InteractionSuffix.js +1 -1
- package/dist/esm/components/ai-generator/AIContentGenerator.js +1 -1
- package/dist/esm/components/theme-section/CreateThemeSection.js +1 -1
- package/dist/esm/contexts/ProductContext.js +16 -1
- package/dist/esm/graphql/fragments/preview-theme-page.generated.js +30 -0
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +1 -28
- package/dist/esm/graphql/queries/preview-page.generated.js +5 -11
- package/dist/esm/helpers/background.js +6 -2
- package/dist/esm/helpers/borders.js +17 -1
- package/dist/esm/helpers/compose-advance-style.js +16 -1
- package/dist/esm/helpers/interaction/index.js +1 -1
- package/dist/esm/helpers/prefetch-queries.js +3 -5
- package/dist/esm/helpers/radius.js +11 -1
- package/dist/esm/helpers/shadow.js +3 -2
- package/dist/esm/helpers/third-party/appConfig.js +7 -1
- package/dist/esm/helpers/third-party/appSetting.js +9 -1
- package/dist/esm/helpers/third-party/constant.js +3 -2
- package/dist/esm/helpers/third-party/getAppBlockConfig.js +8 -0
- package/dist/esm/hooks/useProduct.js +10 -2
- package/dist/esm/index.js +6 -6
- package/dist/types/index.d.ts +826 -263
- package/package.json +3 -3
|
@@ -6,10 +6,10 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
6
6
|
var react = require('react');
|
|
7
7
|
require('zustand');
|
|
8
8
|
var BuilderPreviewContext = require('../contexts/BuilderPreviewContext.js');
|
|
9
|
-
var ShopContext = require('../contexts/ShopContext.js');
|
|
10
9
|
var PageContext = require('../contexts/PageContext.js');
|
|
11
|
-
require('
|
|
10
|
+
var ShopContext = require('../contexts/ShopContext.js');
|
|
12
11
|
require('swr');
|
|
12
|
+
require('@gem-sdk/adapter-shopify');
|
|
13
13
|
require('swr/mutation');
|
|
14
14
|
require('swr/infinite');
|
|
15
15
|
require('vanilla-lazyload');
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
require('zustand');
|
|
5
5
|
require('react');
|
|
6
|
-
require('swr');
|
|
7
6
|
var PageContext = require('../contexts/PageContext.js');
|
|
7
|
+
require('swr');
|
|
8
8
|
require('@gem-sdk/adapter-shopify');
|
|
9
9
|
require('swr/mutation');
|
|
10
10
|
require('swr/infinite');
|
|
@@ -16,8 +16,8 @@ var useFlipPopup = require('./hooks/useFlipPopup.js');
|
|
|
16
16
|
var useCheckingProductInside = require('./hooks/useCheckingProductInside.js');
|
|
17
17
|
require('zustand');
|
|
18
18
|
var ShopContext = require('../../contexts/ShopContext.js');
|
|
19
|
-
require('@gem-sdk/adapter-shopify');
|
|
20
19
|
require('swr');
|
|
20
|
+
require('@gem-sdk/adapter-shopify');
|
|
21
21
|
require('swr/mutation');
|
|
22
22
|
require('swr/infinite');
|
|
23
23
|
require('vanilla-lazyload');
|
|
@@ -5,8 +5,8 @@ var react = require('react');
|
|
|
5
5
|
var ThemeSectionTooltip = require('./ThemeSectionTooltip.js');
|
|
6
6
|
require('zustand');
|
|
7
7
|
var ShopContext = require('../../contexts/ShopContext.js');
|
|
8
|
-
require('@gem-sdk/adapter-shopify');
|
|
9
8
|
require('swr');
|
|
9
|
+
require('@gem-sdk/adapter-shopify');
|
|
10
10
|
require('swr/mutation');
|
|
11
11
|
require('swr/infinite');
|
|
12
12
|
require('vanilla-lazyload');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var zustand = require('zustand');
|
|
5
4
|
var react = require('react');
|
|
5
|
+
var zustand = require('zustand');
|
|
6
6
|
var flattenConnection = require('../helpers/flatten-connection.js');
|
|
7
7
|
var variant = require('../helpers/variant.js');
|
|
8
8
|
|
|
@@ -25,6 +25,21 @@ const createProductStoreProvider = (data)=>zustand.createStore((set, get)=>({
|
|
|
25
25
|
};
|
|
26
26
|
});
|
|
27
27
|
},
|
|
28
|
+
setUseProductCompareAtPrice: (value)=>{
|
|
29
|
+
set({
|
|
30
|
+
useProductCompareAtPrice: value
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
setShouldRequireUploadMessage: (value)=>{
|
|
34
|
+
set({
|
|
35
|
+
shouldRequireUploadMessage: value
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
setRequireUpload: (value)=>{
|
|
39
|
+
set({
|
|
40
|
+
requireUpload: value
|
|
41
|
+
});
|
|
42
|
+
},
|
|
28
43
|
addProperty: (data)=>{
|
|
29
44
|
const properties = get().properties;
|
|
30
45
|
if (!properties?.some((v)=>v.key === data.key)) {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable */ const PreviewThemePageSelect = `
|
|
4
|
+
fragment PreviewThemePageSelect on PreviewThemePage {
|
|
5
|
+
id
|
|
6
|
+
name
|
|
7
|
+
handle
|
|
8
|
+
isMobile
|
|
9
|
+
sectionPosition
|
|
10
|
+
pageSections {
|
|
11
|
+
cid
|
|
12
|
+
component
|
|
13
|
+
id
|
|
14
|
+
}
|
|
15
|
+
dataSEO {
|
|
16
|
+
...DataSEOSelect
|
|
17
|
+
}
|
|
18
|
+
themeStyle {
|
|
19
|
+
id
|
|
20
|
+
data
|
|
21
|
+
name
|
|
22
|
+
}
|
|
23
|
+
analytic {
|
|
24
|
+
...AnalyticSelect
|
|
25
|
+
}
|
|
26
|
+
customCode {
|
|
27
|
+
...CustomCodeSelect
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
|
|
32
|
+
exports.PreviewThemePageSelect = PreviewThemePageSelect;
|
|
@@ -34,33 +34,5 @@
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
`;
|
|
37
|
-
const PreviewThemePageSelect = `
|
|
38
|
-
fragment PreviewThemePageSelect on PublishedThemePage {
|
|
39
|
-
id
|
|
40
|
-
name
|
|
41
|
-
handle
|
|
42
|
-
isMobile
|
|
43
|
-
sectionPosition
|
|
44
|
-
pageSections {
|
|
45
|
-
...PublishedPageSectionSelect
|
|
46
|
-
}
|
|
47
|
-
themePageCustomSections {
|
|
48
|
-
...PublishedCustomSectionSelect
|
|
49
|
-
}
|
|
50
|
-
themePageDataSEO {
|
|
51
|
-
...DataSEOSelect
|
|
52
|
-
}
|
|
53
|
-
pageStyle {
|
|
54
|
-
...PublishedThemeStyleSelect
|
|
55
|
-
}
|
|
56
|
-
themePageAnalytic {
|
|
57
|
-
...AnalyticSelect
|
|
58
|
-
}
|
|
59
|
-
themePageCustomCode {
|
|
60
|
-
...CustomCodeSelect
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
`;
|
|
64
37
|
|
|
65
|
-
exports.PreviewThemePageSelect = PreviewThemePageSelect;
|
|
66
38
|
exports.PublishedThemePageSelect = PublishedThemePageSelect;
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var publishedPageSection_generated = require('../fragments/published-page-section.generated.js');
|
|
5
|
-
var publishedCustomSection_generated = require('../fragments/published-custom-section.generated.js');
|
|
3
|
+
var previewThemePage_generated = require('../fragments/preview-theme-page.generated.js');
|
|
6
4
|
var dataSeo_generated = require('../fragments/data-seo.generated.js');
|
|
7
|
-
var publishedThemeStyle_generated = require('../fragments/published-theme-style.generated.js');
|
|
8
5
|
var analytic_generated = require('../fragments/analytic.generated.js');
|
|
9
6
|
var customCode_generated = require('../fragments/custom-code.generated.js');
|
|
10
7
|
|
|
11
|
-
const
|
|
12
|
-
query
|
|
13
|
-
|
|
8
|
+
const PreviewThemePageDocument = `
|
|
9
|
+
query PreviewThemePage($pageType: PreviewThemePageType!, $handleURL: String) {
|
|
10
|
+
previewThemePage(pageType: $pageType, handleURL: $handleURL) {
|
|
14
11
|
...PreviewThemePageSelect
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
|
-
${
|
|
18
|
-
${publishedPageSection_generated.PublishedPageSectionSelect}
|
|
19
|
-
${publishedCustomSection_generated.PublishedCustomSectionSelect}
|
|
14
|
+
${previewThemePage_generated.PreviewThemePageSelect}
|
|
20
15
|
${dataSeo_generated.DataSeoSelect}
|
|
21
|
-
${publishedThemeStyle_generated.PublishedThemeStyleSelect}
|
|
22
16
|
${analytic_generated.AnalyticSelect}
|
|
23
17
|
${customCode_generated.CustomCodeSelect}`;
|
|
24
18
|
|
|
25
|
-
exports.
|
|
19
|
+
exports.PreviewThemePageDocument = PreviewThemePageDocument;
|
|
@@ -73,9 +73,12 @@ const getBgImageByDevice = (background, device, options)=>{
|
|
|
73
73
|
imageByDevice = `{{ "${newBackupFilekey}" | asset_url }}`;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
if (typeof imageByDevice === 'string') {
|
|
76
|
+
if (typeof imageByDevice === 'string' && imageByDevice) {
|
|
77
77
|
return `url(${imageByDevice})`;
|
|
78
78
|
}
|
|
79
|
+
if (imageByDevice !== undefined) {
|
|
80
|
+
return 'none';
|
|
81
|
+
}
|
|
79
82
|
};
|
|
80
83
|
const getStyleBgPosition = (background)=>{
|
|
81
84
|
const bgPosition = {
|
|
@@ -216,9 +219,10 @@ const getGradientBgrStyleByDevice = (backgroundStyle, ignoreBackgroundImage)=>{
|
|
|
216
219
|
'mobile'
|
|
217
220
|
].forEach((device)=>{
|
|
218
221
|
if (backgroundStyle[device]?.color?.includes(GRADIENT_BGR_KEY)) {
|
|
222
|
+
const bgImage = `${getBgImageByDevice(backgroundStyle, device) || 'url()'}, ${backgroundStyle[device]?.color}`;
|
|
219
223
|
Object.assign(bgrStyle, {
|
|
220
224
|
[`--bgc${device !== 'desktop' ? '-' + device : ''}`]: backgroundStyle[device]?.color,
|
|
221
|
-
[`--bgi${device !== 'desktop' ? '-' + device : ''}`]: !ignoreBackgroundImage?.[device] ? `${backgroundStyle[device]?.color}` :
|
|
225
|
+
[`--bgi${device !== 'desktop' ? '-' + device : ''}`]: !ignoreBackgroundImage?.[device] ? `${backgroundStyle[device]?.color}` : bgImage
|
|
222
226
|
});
|
|
223
227
|
}
|
|
224
228
|
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var colors = require('./colors.js');
|
|
4
4
|
var makeStyle = require('./make-style.js');
|
|
5
|
+
var constant = require('./constant.js');
|
|
5
6
|
|
|
6
7
|
const getBorderStyle = (value)=>{
|
|
7
8
|
return makeStyle.makeStyle({
|
|
@@ -187,8 +188,24 @@ const composeBorderCss = (borderV)=>{
|
|
|
187
188
|
${color ? `border-color: ${colors.getSingleColorVariable(color)};` : ''}
|
|
188
189
|
`;
|
|
189
190
|
};
|
|
191
|
+
const composeBorderResponsive = (borderValue)=>{
|
|
192
|
+
const style = {};
|
|
193
|
+
Object.assign(style, composeBorderDevice(borderValue?.desktop, 'desktop'));
|
|
194
|
+
Object.assign(style, composeBorderDevice(borderValue?.tablet, 'tablet'));
|
|
195
|
+
Object.assign(style, composeBorderDevice(borderValue?.mobile, 'mobile'));
|
|
196
|
+
return style;
|
|
197
|
+
};
|
|
198
|
+
const composeBorderDevice = (value, device)=>{
|
|
199
|
+
const suffix = device && device !== 'desktop' ? constant.devicesMapping?.[device] : '';
|
|
200
|
+
return {
|
|
201
|
+
[`--b${suffix}`]: value?.border,
|
|
202
|
+
[`--bc${suffix}`]: colors.getSingleColorVariable(value?.color),
|
|
203
|
+
[`--bw${suffix}`]: value?.width
|
|
204
|
+
};
|
|
205
|
+
};
|
|
190
206
|
|
|
191
207
|
exports.composeBorderCss = composeBorderCss;
|
|
208
|
+
exports.composeBorderResponsive = composeBorderResponsive;
|
|
192
209
|
exports.getBorderRadiusStyle = getBorderRadiusStyle;
|
|
193
210
|
exports.getBorderStyle = getBorderStyle;
|
|
194
211
|
exports.handleConvertBorderColor = handleConvertBorderColor;
|
|
@@ -112,7 +112,22 @@ function composeAdvanceStyle(data, tag, pageType) {
|
|
|
112
112
|
Object.assign(styles, radius.composeRadius(value));
|
|
113
113
|
}
|
|
114
114
|
if (attr === 'boxShadow') {
|
|
115
|
-
|
|
115
|
+
const listElementShadowV2 = [
|
|
116
|
+
'Row',
|
|
117
|
+
'Section',
|
|
118
|
+
'Text',
|
|
119
|
+
'Heading',
|
|
120
|
+
'Image'
|
|
121
|
+
];
|
|
122
|
+
let hasBoxShadowV2 = hasBoxShadow;
|
|
123
|
+
if (listElementShadowV2.includes(tag || '')) {
|
|
124
|
+
hasBoxShadowV2 = {
|
|
125
|
+
desktop: value.desktop ?? {},
|
|
126
|
+
tablet: value.tablet ?? value.desktop ?? {},
|
|
127
|
+
mobile: value.mobile ?? value.tablet ?? value.desktop ?? {}
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
Object.assign(styles, shadow.getResponsiveStyleShadow(value, 'box-shadow', hasBoxShadowV2 ?? hasBoxShadow));
|
|
116
131
|
}
|
|
117
132
|
const styleValue = getAttrValue(attr, deviceValue, tag);
|
|
118
133
|
if (composeAttr === 'desktop') {
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var react = require('react');
|
|
4
4
|
require('react/jsx-runtime');
|
|
5
5
|
require('zustand');
|
|
6
|
-
require('swr');
|
|
7
6
|
var PageContext = require('../../contexts/PageContext.js');
|
|
7
|
+
require('swr');
|
|
8
8
|
require('@gem-sdk/adapter-shopify');
|
|
9
9
|
require('swr/mutation');
|
|
10
10
|
require('swr/infinite');
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var useSWR = require('swr');
|
|
4
3
|
var getCollection = require('./queries/get-collection.js');
|
|
5
4
|
var getProduct = require('./queries/get-product.js');
|
|
6
5
|
var getProducts = require('./queries/get-products.js');
|
|
7
|
-
var query = require('./query.js');
|
|
8
6
|
|
|
9
7
|
const prefetchQueries = (input, options)=>{
|
|
10
8
|
const queries = [];
|
|
@@ -21,7 +19,7 @@ const prefetchQueries = (input, options)=>{
|
|
|
21
19
|
isStorefront: options?.isStorefront
|
|
22
20
|
};
|
|
23
21
|
data = {
|
|
24
|
-
key:
|
|
22
|
+
key: `query/product/${variables.id}`,
|
|
25
23
|
func: getProduct.getProduct,
|
|
26
24
|
variables
|
|
27
25
|
};
|
|
@@ -39,7 +37,7 @@ const prefetchQueries = (input, options)=>{
|
|
|
39
37
|
isStorefront: options?.isStorefront
|
|
40
38
|
};
|
|
41
39
|
data = {
|
|
42
|
-
key:
|
|
40
|
+
key: `query/collection/${variables.id}`,
|
|
43
41
|
func: getCollection.getCollection,
|
|
44
42
|
variables
|
|
45
43
|
};
|
|
@@ -52,7 +50,7 @@ const prefetchQueries = (input, options)=>{
|
|
|
52
50
|
isStorefront: options?.isStorefront
|
|
53
51
|
};
|
|
54
52
|
data = {
|
|
55
|
-
key:
|
|
53
|
+
key: `query/products/${variables.ids.join(',')}`,
|
|
56
54
|
func: getProducts.getProducts,
|
|
57
55
|
variables
|
|
58
56
|
};
|
|
@@ -27,7 +27,14 @@ const getRadiusCSSFromGlobal = (state, key, device)=>{
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
const getCustomRadius = (state, radius, device)=>{
|
|
30
|
-
|
|
30
|
+
const list = [
|
|
31
|
+
'custom',
|
|
32
|
+
'pill',
|
|
33
|
+
'rounded',
|
|
34
|
+
'single',
|
|
35
|
+
'none'
|
|
36
|
+
];
|
|
37
|
+
if (!radius || !state || !list.includes(radius?.radiusType ?? '')) return {};
|
|
31
38
|
const suffix = device && device !== 'desktop' ? constant.devicesMapping?.[device] : '';
|
|
32
39
|
const mState = constant.stateMapping?.[state];
|
|
33
40
|
return {
|
|
@@ -62,6 +69,7 @@ const composeRadiusState = (radiusValue, device)=>{
|
|
|
62
69
|
case 'circle':
|
|
63
70
|
case 'none':
|
|
64
71
|
case 'custom':
|
|
72
|
+
case 'rounded':
|
|
65
73
|
Object.assign(style, getCustomRadius('normal', radiusValue.normal, device));
|
|
66
74
|
break;
|
|
67
75
|
}
|
|
@@ -74,6 +82,7 @@ const composeRadiusState = (radiusValue, device)=>{
|
|
|
74
82
|
case 'circle':
|
|
75
83
|
case 'none':
|
|
76
84
|
case 'custom':
|
|
85
|
+
case 'rounded':
|
|
77
86
|
Object.assign(style, getCustomRadius('hover', radiusValue.hover, device));
|
|
78
87
|
break;
|
|
79
88
|
}
|
|
@@ -86,6 +95,7 @@ const composeRadiusState = (radiusValue, device)=>{
|
|
|
86
95
|
case 'circle':
|
|
87
96
|
case 'none':
|
|
88
97
|
case 'custom':
|
|
98
|
+
case 'rounded':
|
|
89
99
|
Object.assign(style, getCustomRadius('focus', radiusValue.focus, device));
|
|
90
100
|
break;
|
|
91
101
|
}
|
|
@@ -24,10 +24,11 @@ const getStyleShadow = (shadowStyle, isActiveState = false)=>{
|
|
|
24
24
|
let { state } = shadowStyle || {};
|
|
25
25
|
if (!state) state = 'normal';
|
|
26
26
|
if (!styleAppliedFor || !value) return {};
|
|
27
|
-
|
|
27
|
+
const isNoneValue = value.type === 'none';
|
|
28
|
+
if (typeof value.distance == 'undefined' && !isNoneValue) return {};
|
|
28
29
|
const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
|
|
29
30
|
return {
|
|
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
|
+
[`-${!isActiveState ? constant.stateMapping?.[state] || '' : ''}-${getShortname.getShortName(styleAppliedFor)}${shadowStyle.screen ? `-${shadowStyle.screen}` : ''}`]: isEnableShadow && !isNoneValue ? `${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
32
|
};
|
|
32
33
|
};
|
|
33
34
|
const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
|
|
@@ -180,6 +180,12 @@ const GloboProductOptionsVariantConfig = {
|
|
|
180
180
|
appId: 'fdc9fad5-1a0f-4bd4-9c8a-1af6a6eef6b8'
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
+
const KachingBundlesConfig = {
|
|
184
|
+
KachingBundles: {
|
|
185
|
+
appName: 'kaching-bundles',
|
|
186
|
+
appId: '6c637362-a106-4a32-94ac-94dcfd68cdb8'
|
|
187
|
+
}
|
|
188
|
+
};
|
|
183
189
|
|
|
184
190
|
exports.AppointmentBookingCowlendarConfig = AppointmentBookingCowlendarConfig;
|
|
185
191
|
exports.BoldSubscriptionsConfig = BoldSubscriptionsConfig;
|
|
@@ -191,6 +197,7 @@ exports.GloboProductOptionsVariantConfig = GloboProductOptionsVariantConfig;
|
|
|
191
197
|
exports.GrowaveConfig = GrowaveConfig;
|
|
192
198
|
exports.InstasellShoppableInstagramConfig = InstasellShoppableInstagramConfig;
|
|
193
199
|
exports.JunipProductReviewsUgcConfig = JunipProductReviewsUgcConfig;
|
|
200
|
+
exports.KachingBundlesConfig = KachingBundlesConfig;
|
|
194
201
|
exports.KiteFreeGiftDiscountConfig = KiteFreeGiftDiscountConfig;
|
|
195
202
|
exports.LoloyalLoyaltyReferralsConfig = LoloyalLoyaltyReferralsConfig;
|
|
196
203
|
exports.LoopSubscriptionsConfig = LoopSubscriptionsConfig;
|
|
@@ -426,6 +426,13 @@ const PowerfulContactFormBuilder = {
|
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
428
|
};
|
|
429
|
+
const KachingBundles = {
|
|
430
|
+
KachingBundles: {
|
|
431
|
+
'app-block': {
|
|
432
|
+
product: '{{product}}'
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
};
|
|
429
436
|
const WishlistKing = {
|
|
430
437
|
WishlistKing: {
|
|
431
438
|
'wishlist-button-block': null
|
|
@@ -466,7 +473,8 @@ const composeSettingsByWidgetType = {
|
|
|
466
473
|
...SelleasyWidget,
|
|
467
474
|
...YotpoReviews,
|
|
468
475
|
...BoldSubscriptions,
|
|
469
|
-
...Growave
|
|
476
|
+
...Growave,
|
|
477
|
+
...KachingBundles
|
|
470
478
|
};
|
|
471
479
|
|
|
472
480
|
exports.composeSettingsByWidgetType = composeSettingsByWidgetType;
|
|
@@ -32,7 +32,8 @@ const mapShopifyAppMeta = {
|
|
|
32
32
|
...appConfig.LoloyalLoyaltyReferralsConfig,
|
|
33
33
|
...appConfig.PowerfulContactFormBuilderConfig,
|
|
34
34
|
...appConfig.WishlistKingConfig,
|
|
35
|
-
...appConfig.GloboProductOptionsVariantConfig
|
|
35
|
+
...appConfig.GloboProductOptionsVariantConfig,
|
|
36
|
+
...appConfig.KachingBundlesConfig
|
|
36
37
|
};
|
|
37
38
|
const THIRD_PARTY_APP_BLOCK_ID_PREFIX = 'gp_app';
|
|
38
39
|
|
|
@@ -6,7 +6,15 @@ var getAppBlockType = require('./getAppBlockType.js');
|
|
|
6
6
|
const listAppUpdateNewVersion = [
|
|
7
7
|
'Growave'
|
|
8
8
|
];
|
|
9
|
+
const listThirdPartyRejectAppBlock = {
|
|
10
|
+
YotpoReviews: {
|
|
11
|
+
conditionToReject: 'settings?.version === "v1"'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
9
14
|
const getAppBlockConfig = (tag, appBlockId, settings)=>{
|
|
15
|
+
if (listThirdPartyRejectAppBlock[tag] && eval(listThirdPartyRejectAppBlock[tag].conditionToReject)) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
10
18
|
let widgetType = settings?.widgetType;
|
|
11
19
|
if (listAppUpdateNewVersion.includes(tag)) {
|
|
12
20
|
widgetType = settings?.widgetTypeV2;
|
|
@@ -4,8 +4,8 @@ var react = require('react');
|
|
|
4
4
|
var ProductContext = require('../contexts/ProductContext.js');
|
|
5
5
|
require('react/jsx-runtime');
|
|
6
6
|
require('zustand');
|
|
7
|
-
require('swr');
|
|
8
7
|
var PageContext = require('../contexts/PageContext.js');
|
|
8
|
+
require('swr');
|
|
9
9
|
require('@gem-sdk/adapter-shopify');
|
|
10
10
|
require('swr/mutation');
|
|
11
11
|
require('swr/infinite');
|
|
@@ -35,6 +35,14 @@ const useProductProperties = ()=>{
|
|
|
35
35
|
const useIsSyncProduct = ()=>{
|
|
36
36
|
return ProductContext.useProductStore((s)=>s.isSyncProduct);
|
|
37
37
|
};
|
|
38
|
+
const useProductBundleDiscount = ()=>{
|
|
39
|
+
const useProductCompareAtPrice = ProductContext.useProductStore((s)=>s.useProductCompareAtPrice);
|
|
40
|
+
const seUseProductCompareAtPrice = ProductContext.useProductStore((s)=>s.setUseProductCompareAtPrice);
|
|
41
|
+
return {
|
|
42
|
+
useProductCompareAtPrice,
|
|
43
|
+
seUseProductCompareAtPrice
|
|
44
|
+
};
|
|
45
|
+
};
|
|
38
46
|
const useQuantity = ()=>{
|
|
39
47
|
const quantity = ProductContext.useProductStore((s)=>s.quantity);
|
|
40
48
|
const hasUpdatePrice = ProductContext.useProductStore((s)=>s.updatePrice);
|
|
@@ -226,6 +234,7 @@ exports.useFeaturedImageGlobal = useFeaturedImageGlobal;
|
|
|
226
234
|
exports.useHasPreSelected = useHasPreSelected;
|
|
227
235
|
exports.useIsSyncProduct = useIsSyncProduct;
|
|
228
236
|
exports.useProduct = useProduct;
|
|
237
|
+
exports.useProductBundleDiscount = useProductBundleDiscount;
|
|
229
238
|
exports.useProductOfferDiscount = useProductOfferDiscount;
|
|
230
239
|
exports.useProductProperties = useProductProperties;
|
|
231
240
|
exports.useQuantity = useQuantity;
|
package/dist/cjs/index.js
CHANGED
|
@@ -71,6 +71,7 @@ var render = require('./helpers/render.js');
|
|
|
71
71
|
var shadow = require('./helpers/shadow.js');
|
|
72
72
|
var size = require('./helpers/size.js');
|
|
73
73
|
var typography = require('./helpers/typography.js');
|
|
74
|
+
var useArticlesQuery = require('./hooks/articles/useArticlesQuery.js');
|
|
74
75
|
var useAddToCart = require('./hooks/cart/use-add-to-cart.js');
|
|
75
76
|
var useCartData = require('./hooks/cart/use-cart-data.js');
|
|
76
77
|
var useCartDiscountCodesUpdate = require('./hooks/cart/use-cart-discount-codes-update.js');
|
|
@@ -84,23 +85,22 @@ var useCollectionsQuery = require('./hooks/shop/use-collections-query.js');
|
|
|
84
85
|
var useProductQuery = require('./hooks/shop/use-product-query.js');
|
|
85
86
|
var useProductsQuery = require('./hooks/shop/use-products-query.js');
|
|
86
87
|
var useCurrentDevice = require('./hooks/use-current-device.js');
|
|
87
|
-
var useFormatMoney = require('./hooks/useFormatMoney.js');
|
|
88
88
|
var useLazyVideo = require('./hooks/use-lazy-video.js');
|
|
89
89
|
var useCartId = require('./hooks/useCartId.js');
|
|
90
90
|
var useCartLine = require('./hooks/useCartLine.js');
|
|
91
91
|
var useCartUI = require('./hooks/useCartUI.js');
|
|
92
92
|
var useCollection = require('./hooks/useCollection.js');
|
|
93
|
+
var useFormatMoney = require('./hooks/useFormatMoney.js');
|
|
93
94
|
var react = require('react');
|
|
95
|
+
var useInitialSwatchesOptions = require('./hooks/useInitialSwatchesOptions.js');
|
|
94
96
|
var useIsomorphicLayoutEffect = require('./hooks/useIsomorphicLayoutEffect.js');
|
|
95
97
|
var useLoadScript = require('./hooks/useLoadScript.js');
|
|
96
98
|
var useMoney = require('./hooks/useMoney.js');
|
|
97
99
|
var usePrevious = require('./hooks/usePrevious.js');
|
|
98
|
-
var useArticlesQuery = require('./hooks/articles/useArticlesQuery.js');
|
|
99
100
|
var useProduct = require('./hooks/useProduct.js');
|
|
100
101
|
var useProductList = require('./hooks/useProductList.js');
|
|
101
102
|
var useSuspenseFetch = require('./hooks/useSuspenseFetch.js');
|
|
102
103
|
var useSwatchesOptions = require('./hooks/useSwatchesOptions.js');
|
|
103
|
-
var useInitialSwatchesOptions = require('./hooks/useInitialSwatchesOptions.js');
|
|
104
104
|
var custom = require('./types/custom.js');
|
|
105
105
|
var shop$1 = require('./types/shop.js');
|
|
106
106
|
var appAPI = require('./types/appAPI.js');
|
|
@@ -159,13 +159,14 @@ exports.CollectionsDocument = collections_generated.CollectionsDocument;
|
|
|
159
159
|
exports.PublishedThemePagesDocument = publishedThemePages_generated.PublishedThemePagesDocument;
|
|
160
160
|
exports.ProductsDocument = products_generated.ProductsDocument;
|
|
161
161
|
exports.StorePropertyDocument = storeProperty_generated.StorePropertyDocument;
|
|
162
|
-
exports.
|
|
162
|
+
exports.PreviewThemePageDocument = previewPage_generated.PreviewThemePageDocument;
|
|
163
163
|
exports.LibraryTemplateDocument = LibraryTemplate_generated.LibraryTemplateDocument;
|
|
164
164
|
exports.ThemePageDocument = ThemePage_generated.ThemePageDocument;
|
|
165
165
|
exports.SaleFunnelDiscountsDocument = SaleFunnelDiscounts_generated.SaleFunnelDiscountsDocument;
|
|
166
166
|
exports.LibrarySaleFunnelDocument = LibrarySaleFunnelDiscount_generated.LibrarySaleFunnelDocument;
|
|
167
167
|
exports.ShopLibraryPageDocument = ShopLibraryPage_generated.ShopLibraryPageDocument;
|
|
168
168
|
exports.composeBorderCss = borders.composeBorderCss;
|
|
169
|
+
exports.composeBorderResponsive = borders.composeBorderResponsive;
|
|
169
170
|
exports.getBorderRadiusStyle = borders.getBorderRadiusStyle;
|
|
170
171
|
exports.getBorderStyle = borders.getBorderStyle;
|
|
171
172
|
exports.handleConvertBorderColor = borders.handleConvertBorderColor;
|
|
@@ -301,6 +302,8 @@ exports.composeTypographyStyle = typography.composeTypographyStyle;
|
|
|
301
302
|
exports.composeTypographyV2 = typography.composeTypographyV2;
|
|
302
303
|
exports.composeTypographyV2Css = typography.composeTypographyV2Css;
|
|
303
304
|
exports.genTypoClass = typography.genTypoClass;
|
|
305
|
+
exports.useArticlesQuery = useArticlesQuery.useArticlesQuery;
|
|
306
|
+
exports.useBlogsQuery = useArticlesQuery.useBlogsQuery;
|
|
304
307
|
exports.useAddToCart = useAddToCart.useAddToCart;
|
|
305
308
|
exports.useCartData = useCartData.useCartData;
|
|
306
309
|
exports.useCartDiscountCodesUpdate = useCartDiscountCodesUpdate.useCartDiscountCodesUpdate;
|
|
@@ -328,24 +331,23 @@ exports.useProductQuery = useProductQuery.useProductQuery;
|
|
|
328
331
|
exports.useProductsQuery = useProductsQuery.useProductsQuery;
|
|
329
332
|
exports.useProductsQueryAll = useProductsQuery.useProductsQueryAll;
|
|
330
333
|
exports.useCurrentDevice = useCurrentDevice.useCurrentDevice;
|
|
331
|
-
exports.formatMoney = useFormatMoney.formatMoney;
|
|
332
|
-
exports.shopifyPriceRounding = useFormatMoney.shopifyPriceRounding;
|
|
333
|
-
exports.useFormatMoney = useFormatMoney.useFormatMoney;
|
|
334
334
|
exports.useLazyVideo = useLazyVideo.useLazyVideo;
|
|
335
335
|
exports.useCartId = useCartId.default;
|
|
336
336
|
exports.useCartLine = useCartLine.default;
|
|
337
337
|
exports.useCartUI = useCartUI.default;
|
|
338
338
|
exports.useCollection = useCollection.useCollection;
|
|
339
|
+
exports.formatMoney = useFormatMoney.formatMoney;
|
|
340
|
+
exports.shopifyPriceRounding = useFormatMoney.shopifyPriceRounding;
|
|
341
|
+
exports.useFormatMoney = useFormatMoney.useFormatMoney;
|
|
339
342
|
Object.defineProperty(exports, 'useId', {
|
|
340
343
|
enumerable: true,
|
|
341
344
|
get: function () { return react.useId; }
|
|
342
345
|
});
|
|
346
|
+
exports.useInitialSwatchesOptions = useInitialSwatchesOptions.default;
|
|
343
347
|
exports.useIsomorphicLayoutEffect = useIsomorphicLayoutEffect.default;
|
|
344
348
|
exports.useLoadScript = useLoadScript.default;
|
|
345
349
|
exports.useMoney = useMoney.default;
|
|
346
350
|
exports.usePrevious = usePrevious.usePrevious;
|
|
347
|
-
exports.useArticlesQuery = useArticlesQuery.useArticlesQuery;
|
|
348
|
-
exports.useBlogsQuery = useArticlesQuery.useBlogsQuery;
|
|
349
351
|
exports.useCheckAvailableVariantInStock = useProduct.useCheckAvailableVariantInStock;
|
|
350
352
|
exports.useCurrentVariant = useProduct.useCurrentVariant;
|
|
351
353
|
exports.useCurrentVariantInStock = useProduct.useCurrentVariantInStock;
|
|
@@ -353,6 +355,7 @@ exports.useFeaturedImageGlobal = useProduct.useFeaturedImageGlobal;
|
|
|
353
355
|
exports.useHasPreSelected = useProduct.useHasPreSelected;
|
|
354
356
|
exports.useIsSyncProduct = useProduct.useIsSyncProduct;
|
|
355
357
|
exports.useProduct = useProduct.useProduct;
|
|
358
|
+
exports.useProductBundleDiscount = useProduct.useProductBundleDiscount;
|
|
356
359
|
exports.useProductOfferDiscount = useProduct.useProductOfferDiscount;
|
|
357
360
|
exports.useProductProperties = useProduct.useProductProperties;
|
|
358
361
|
exports.useQuantity = useProduct.useQuantity;
|
|
@@ -367,7 +370,6 @@ exports.useProductListSettings = useProductList.useProductListSettings;
|
|
|
367
370
|
exports.useProductListStyles = useProductList.useProductListStyles;
|
|
368
371
|
exports.useSuspenseFetch = useSuspenseFetch.default;
|
|
369
372
|
exports.useSwatchesOptions = useSwatchesOptions.default;
|
|
370
|
-
exports.useInitialSwatchesOptions = useInitialSwatchesOptions.default;
|
|
371
373
|
Object.defineProperty(exports, 'InteractionTargetEvent', {
|
|
372
374
|
enumerable: true,
|
|
373
375
|
get: function () { return custom.InteractionTargetEvent; }
|
|
@@ -2,10 +2,10 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { memo, useState, useMemo, useCallback, useEffect } from 'react';
|
|
3
3
|
import 'zustand';
|
|
4
4
|
import { useBuilderPreviewStore } from '../contexts/BuilderPreviewContext.js';
|
|
5
|
-
import { useShopStore } from '../contexts/ShopContext.js';
|
|
6
5
|
import { usePageStore } from '../contexts/PageContext.js';
|
|
7
|
-
import '
|
|
6
|
+
import { useShopStore } from '../contexts/ShopContext.js';
|
|
8
7
|
import 'swr';
|
|
8
|
+
import '@gem-sdk/adapter-shopify';
|
|
9
9
|
import 'swr/mutation';
|
|
10
10
|
import 'swr/infinite';
|
|
11
11
|
import 'vanilla-lazyload';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import 'zustand';
|
|
3
3
|
import 'react';
|
|
4
|
-
import 'swr';
|
|
5
4
|
import { usePageStore } from '../contexts/PageContext.js';
|
|
5
|
+
import 'swr';
|
|
6
6
|
import '@gem-sdk/adapter-shopify';
|
|
7
7
|
import 'swr/mutation';
|
|
8
8
|
import 'swr/infinite';
|
|
@@ -14,8 +14,8 @@ import { useFlipPopup } from './hooks/useFlipPopup.js';
|
|
|
14
14
|
import { useCheckingProductInside } from './hooks/useCheckingProductInside.js';
|
|
15
15
|
import 'zustand';
|
|
16
16
|
import { useShopStore } from '../../contexts/ShopContext.js';
|
|
17
|
-
import '@gem-sdk/adapter-shopify';
|
|
18
17
|
import 'swr';
|
|
18
|
+
import '@gem-sdk/adapter-shopify';
|
|
19
19
|
import 'swr/mutation';
|
|
20
20
|
import 'swr/infinite';
|
|
21
21
|
import 'vanilla-lazyload';
|
|
@@ -3,8 +3,8 @@ import { useRef, useState } from 'react';
|
|
|
3
3
|
import { ThemeSectionTooltip } from './ThemeSectionTooltip.js';
|
|
4
4
|
import 'zustand';
|
|
5
5
|
import { useShopStore } from '../../contexts/ShopContext.js';
|
|
6
|
-
import '@gem-sdk/adapter-shopify';
|
|
7
6
|
import 'swr';
|
|
7
|
+
import '@gem-sdk/adapter-shopify';
|
|
8
8
|
import 'swr/mutation';
|
|
9
9
|
import 'swr/infinite';
|
|
10
10
|
import 'vanilla-lazyload';
|