@gem-sdk/core 1.58.0-dev.98 → 1.58.0-staging.104
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 +7 -7
- package/dist/cjs/components/ComponentWrapperPreview.js +2 -2
- package/dist/cjs/components/InteractionSuffix.js +6 -6
- package/dist/cjs/components/Render.liquid.js +13 -5
- package/dist/cjs/components/RenderCustomCode.js +7 -7
- package/dist/cjs/components/ai-generator/AIContentGenerator.js +4 -4
- package/dist/cjs/components/ai-generator/components/PickProduct.js +4 -4
- package/dist/cjs/components/resize/Spacing.js +7 -7
- package/dist/cjs/components/theme-section/CreateThemeSection.js +4 -4
- package/dist/cjs/contexts/ProductContext.js +12 -11
- package/dist/cjs/graphql/fragments/preview-theme-page.generated.js +4 -0
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +4 -0
- package/dist/cjs/graphql/queries/shop-shopify.generated.js +11 -0
- package/dist/cjs/helpers/background.js +2 -6
- package/dist/cjs/helpers/borders.js +0 -17
- package/dist/cjs/helpers/compose-advance-style.js +1 -39
- package/dist/cjs/helpers/interaction/index.js +6 -6
- package/dist/cjs/helpers/radius.js +1 -13
- package/dist/cjs/helpers/shadow.js +2 -28
- package/dist/cjs/helpers/size.js +0 -22
- package/dist/cjs/helpers/third-party/appConfig.js +35 -0
- package/dist/cjs/helpers/third-party/appSetting.js +247 -1
- package/dist/cjs/helpers/third-party/constant.js +6 -1
- package/dist/cjs/helpers/third-party/getAppBlockConfig.js +5 -1
- package/dist/cjs/helpers/typography.js +1 -2
- package/dist/cjs/hooks/shop.js +9 -0
- package/dist/cjs/hooks/useInitialSwatchesOptions.js +2 -3
- package/dist/cjs/index.js +3 -9
- package/dist/esm/components/ComponentToolbarPreview.js +7 -7
- package/dist/esm/components/ComponentWrapperPreview.js +2 -2
- package/dist/esm/components/InteractionSuffix.js +6 -6
- package/dist/esm/components/Render.liquid.js +13 -5
- package/dist/esm/components/RenderCustomCode.js +7 -7
- package/dist/esm/components/ai-generator/AIContentGenerator.js +4 -4
- package/dist/esm/components/ai-generator/components/PickProduct.js +4 -4
- package/dist/esm/components/resize/Spacing.js +7 -7
- package/dist/esm/components/theme-section/CreateThemeSection.js +4 -4
- package/dist/esm/contexts/ProductContext.js +12 -11
- package/dist/esm/graphql/fragments/preview-theme-page.generated.js +4 -0
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +4 -0
- package/dist/esm/graphql/queries/shop-shopify.generated.js +9 -0
- package/dist/esm/helpers/background.js +2 -6
- package/dist/esm/helpers/borders.js +1 -17
- package/dist/esm/helpers/compose-advance-style.js +1 -39
- package/dist/esm/helpers/interaction/index.js +6 -6
- package/dist/esm/helpers/radius.js +1 -13
- package/dist/esm/helpers/shadow.js +3 -28
- package/dist/esm/helpers/size.js +1 -21
- package/dist/esm/helpers/third-party/appConfig.js +31 -1
- package/dist/esm/helpers/third-party/appSetting.js +247 -1
- package/dist/esm/helpers/third-party/constant.js +7 -2
- package/dist/esm/helpers/third-party/getAppBlockConfig.js +5 -1
- package/dist/esm/helpers/typography.js +1 -2
- package/dist/esm/hooks/shop.js +9 -1
- package/dist/esm/hooks/useInitialSwatchesOptions.js +2 -3
- package/dist/esm/index.js +5 -5
- package/dist/types/index.d.ts +250 -670
- package/package.json +3 -3
- package/dist/cjs/helpers/backgroundImage.js +0 -184
- package/dist/esm/helpers/backgroundImage.js +0 -179
|
@@ -8,13 +8,6 @@ var react = require('react');
|
|
|
8
8
|
require('zustand');
|
|
9
9
|
var BuilderPreviewContext = require('../contexts/BuilderPreviewContext.js');
|
|
10
10
|
var PageContext = require('../contexts/PageContext.js');
|
|
11
|
-
var ShopContext = require('../contexts/ShopContext.js');
|
|
12
|
-
require('swr');
|
|
13
|
-
require('@gem-sdk/adapter-shopify');
|
|
14
|
-
require('swr/mutation');
|
|
15
|
-
require('swr/infinite');
|
|
16
|
-
require('vanilla-lazyload');
|
|
17
|
-
require('../hooks/useCartUI.js');
|
|
18
11
|
var CreateThemeSection = require('./theme-section/CreateThemeSection.js');
|
|
19
12
|
var Tooltip = require('./toolbar/Tooltip.js');
|
|
20
13
|
var ThemeSectionStatus = require('./theme-section/ThemeSectionStatus.js');
|
|
@@ -24,7 +17,14 @@ var constant = require('./constant.js');
|
|
|
24
17
|
var AIContentGenerator = require('./ai-generator/AIContentGenerator.js');
|
|
25
18
|
var AIGenContentLoading = require('./ai-generator/AIGenContentLoading.js');
|
|
26
19
|
var InteractionSuffix = require('./InteractionSuffix.js');
|
|
20
|
+
require('swr');
|
|
27
21
|
require('../helpers/convert.js');
|
|
22
|
+
var ShopContext = require('../contexts/ShopContext.js');
|
|
23
|
+
require('@gem-sdk/adapter-shopify');
|
|
24
|
+
require('swr/mutation');
|
|
25
|
+
require('swr/infinite');
|
|
26
|
+
require('vanilla-lazyload');
|
|
27
|
+
require('../hooks/useCartUI.js');
|
|
28
28
|
|
|
29
29
|
const SECTION_LIMIT = 25;
|
|
30
30
|
const notVisible = (el)=>{
|
|
@@ -11,15 +11,15 @@ var constant = require('./constant.js');
|
|
|
11
11
|
var RenderCustomCode = require('./RenderCustomCode.js');
|
|
12
12
|
var ComponentToolbarPreview = require('./ComponentToolbarPreview.js');
|
|
13
13
|
require('zustand');
|
|
14
|
+
var cls = require('../helpers/cls.js');
|
|
14
15
|
require('swr');
|
|
16
|
+
require('../helpers/convert.js');
|
|
15
17
|
require('@gem-sdk/adapter-shopify');
|
|
16
18
|
require('swr/mutation');
|
|
17
19
|
var shop = require('../hooks/shop.js');
|
|
18
20
|
require('swr/infinite');
|
|
19
21
|
require('vanilla-lazyload');
|
|
20
22
|
require('../hooks/useCartUI.js');
|
|
21
|
-
var cls = require('../helpers/cls.js');
|
|
22
|
-
require('../helpers/convert.js');
|
|
23
23
|
var ComponentAnimation = require('./ComponentAnimation.js');
|
|
24
24
|
|
|
25
25
|
const ComponentWrapperPreview = ({ children, ...props })=>{
|
|
@@ -5,18 +5,18 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
5
5
|
require('zustand');
|
|
6
6
|
require('react');
|
|
7
7
|
var PageContext = require('../contexts/PageContext.js');
|
|
8
|
-
require('swr');
|
|
9
|
-
require('@gem-sdk/adapter-shopify');
|
|
10
|
-
require('swr/mutation');
|
|
11
|
-
require('swr/infinite');
|
|
12
|
-
require('vanilla-lazyload');
|
|
13
|
-
require('../hooks/useCartUI.js');
|
|
14
8
|
require('react-transition-group');
|
|
15
9
|
require('@gem-sdk/core');
|
|
10
|
+
require('swr');
|
|
11
|
+
require('swr/infinite');
|
|
16
12
|
require('classnames');
|
|
17
13
|
require('dayjs');
|
|
18
14
|
var index = require('../helpers/interaction/index.js');
|
|
19
15
|
require('../helpers/convert.js');
|
|
16
|
+
require('@gem-sdk/adapter-shopify');
|
|
17
|
+
require('swr/mutation');
|
|
18
|
+
require('vanilla-lazyload');
|
|
19
|
+
require('../hooks/useCartUI.js');
|
|
20
20
|
|
|
21
21
|
const InteractionSuffix = ({ uid })=>{
|
|
22
22
|
const { closeSelectOnPage, selectInteractionElement } = index.useInteraction();
|
|
@@ -36,7 +36,7 @@ const componentIconList = [
|
|
|
36
36
|
const componentUsingAdvanced = [
|
|
37
37
|
'IconList'
|
|
38
38
|
];
|
|
39
|
-
const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageContext, ...passProps })=>{
|
|
39
|
+
const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageContext, enableLazyloadImage, ...passProps })=>{
|
|
40
40
|
const item = builder[uid];
|
|
41
41
|
const Component = components[item?.tag];
|
|
42
42
|
if (!Component) {
|
|
@@ -75,6 +75,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
75
75
|
advanced: item.advanced,
|
|
76
76
|
parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
|
|
77
77
|
pageContext,
|
|
78
|
+
enableLazyloadImage,
|
|
78
79
|
...passProps,
|
|
79
80
|
builderAttrs: {
|
|
80
81
|
...passProps.builderAttrs
|
|
@@ -86,7 +87,8 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
86
87
|
builder,
|
|
87
88
|
components,
|
|
88
89
|
customProps,
|
|
89
|
-
pageContext
|
|
90
|
+
pageContext,
|
|
91
|
+
enableLazyloadImage
|
|
90
92
|
};
|
|
91
93
|
}),
|
|
92
94
|
children: !constant.customRenderChildren.includes(item.tag) ? WrapRenderChildren({
|
|
@@ -98,7 +100,8 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
98
100
|
components,
|
|
99
101
|
customProps,
|
|
100
102
|
parentTag: item.tag,
|
|
101
|
-
pageContext
|
|
103
|
+
pageContext,
|
|
104
|
+
enableLazyloadImage
|
|
102
105
|
}))) : ''
|
|
103
106
|
});
|
|
104
107
|
}, ()=>{
|
|
@@ -114,6 +117,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
114
117
|
isText: componentTexts.includes(item.tag) ? true : null,
|
|
115
118
|
parentId: componentsRenderWithParentId.includes(item.tag) ? parentId : null,
|
|
116
119
|
pageContext,
|
|
120
|
+
enableLazyloadImage,
|
|
117
121
|
...passProps,
|
|
118
122
|
builderAttrs: {
|
|
119
123
|
...passProps.builderAttrs
|
|
@@ -135,6 +139,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
135
139
|
cssClass: item?.advanced?.cssClass
|
|
136
140
|
},
|
|
137
141
|
pageContext,
|
|
142
|
+
enableLazyloadImage,
|
|
138
143
|
...passProps,
|
|
139
144
|
builderAttrs: {
|
|
140
145
|
...passProps.builderAttrs
|
|
@@ -146,7 +151,8 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
146
151
|
builder,
|
|
147
152
|
components,
|
|
148
153
|
customProps,
|
|
149
|
-
pageContext
|
|
154
|
+
pageContext,
|
|
155
|
+
enableLazyloadImage
|
|
150
156
|
};
|
|
151
157
|
}),
|
|
152
158
|
children: !constant.customRenderChildren.includes(item.tag) ? WrapRenderChildren({
|
|
@@ -158,7 +164,8 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
158
164
|
components,
|
|
159
165
|
customProps,
|
|
160
166
|
parentTag: item.tag,
|
|
161
|
-
pageContext
|
|
167
|
+
pageContext,
|
|
168
|
+
enableLazyloadImage
|
|
162
169
|
}))) : ''
|
|
163
170
|
});
|
|
164
171
|
}, ()=>{
|
|
@@ -173,6 +180,7 @@ const Render = ({ uid, builder, components, parentId, extraFiles = {}, pageConte
|
|
|
173
180
|
cssClass: item?.advanced?.cssClass
|
|
174
181
|
},
|
|
175
182
|
pageContext,
|
|
183
|
+
enableLazyloadImage,
|
|
176
184
|
isText: componentTexts.includes(item.tag) ? true : null,
|
|
177
185
|
style: componentIconList.includes(item.tag) ? style : null,
|
|
178
186
|
...passProps,
|
|
@@ -8,18 +8,18 @@ var Head = require('next/head');
|
|
|
8
8
|
var Script = require('next/script');
|
|
9
9
|
var react = require('react');
|
|
10
10
|
require('zustand');
|
|
11
|
-
require('swr');
|
|
12
|
-
require('@gem-sdk/adapter-shopify');
|
|
13
|
-
require('swr/mutation');
|
|
14
|
-
var shop = require('../hooks/shop.js');
|
|
15
|
-
require('swr/infinite');
|
|
16
|
-
require('vanilla-lazyload');
|
|
17
|
-
require('../hooks/useCartUI.js');
|
|
18
11
|
require('react-transition-group');
|
|
19
12
|
require('@gem-sdk/core');
|
|
13
|
+
require('swr');
|
|
14
|
+
require('swr/infinite');
|
|
15
|
+
var shop = require('../hooks/shop.js');
|
|
20
16
|
require('classnames');
|
|
21
17
|
require('dayjs');
|
|
22
18
|
require('../helpers/convert.js');
|
|
19
|
+
require('@gem-sdk/adapter-shopify');
|
|
20
|
+
require('swr/mutation');
|
|
21
|
+
require('vanilla-lazyload');
|
|
22
|
+
require('../hooks/useCartUI.js');
|
|
23
23
|
|
|
24
24
|
const RenderCustomCode = ({ uid, advanced })=>{
|
|
25
25
|
const mode = shop.useEditorMode();
|
|
@@ -16,17 +16,17 @@ var useGettingGenerateRequest = require('./hooks/useGettingGenerateRequest.js');
|
|
|
16
16
|
var useFlipPopup = require('./hooks/useFlipPopup.js');
|
|
17
17
|
var useCheckingProductInside = require('./hooks/useCheckingProductInside.js');
|
|
18
18
|
require('zustand');
|
|
19
|
+
require('react-transition-group');
|
|
20
|
+
require('@gem-sdk/core');
|
|
19
21
|
var ShopContext = require('../../contexts/ShopContext.js');
|
|
22
|
+
var dayjs = require('dayjs');
|
|
20
23
|
require('swr');
|
|
24
|
+
require('../../helpers/convert.js');
|
|
21
25
|
require('@gem-sdk/adapter-shopify');
|
|
22
26
|
require('swr/mutation');
|
|
23
27
|
require('swr/infinite');
|
|
24
28
|
require('vanilla-lazyload');
|
|
25
29
|
require('../../hooks/useCartUI.js');
|
|
26
|
-
require('react-transition-group');
|
|
27
|
-
require('@gem-sdk/core');
|
|
28
|
-
var dayjs = require('dayjs');
|
|
29
|
-
require('../../helpers/convert.js');
|
|
30
30
|
|
|
31
31
|
const AIContentGenerator = ({ ...props })=>{
|
|
32
32
|
const [isShowPopup, setIsShowPopup] = react.useState(false);
|
|
@@ -7,16 +7,16 @@ var SearchIcon = require('../icons/SearchIcon.js');
|
|
|
7
7
|
var useProductsQuery = require('../../../hooks/shop/use-products-query.js');
|
|
8
8
|
var classNames = require('classnames');
|
|
9
9
|
require('zustand');
|
|
10
|
+
require('react-transition-group');
|
|
11
|
+
require('@gem-sdk/core');
|
|
10
12
|
require('swr');
|
|
13
|
+
require('dayjs');
|
|
14
|
+
require('../../../helpers/convert.js');
|
|
11
15
|
require('@gem-sdk/adapter-shopify');
|
|
12
16
|
require('swr/mutation');
|
|
13
17
|
var useProductQuery = require('../../../hooks/shop/use-product-query.js');
|
|
14
18
|
require('vanilla-lazyload');
|
|
15
19
|
require('../../../hooks/useCartUI.js');
|
|
16
|
-
require('react-transition-group');
|
|
17
|
-
require('@gem-sdk/core');
|
|
18
|
-
require('dayjs');
|
|
19
|
-
require('../../../helpers/convert.js');
|
|
20
20
|
|
|
21
21
|
const PickProduct = (props)=>{
|
|
22
22
|
const LIMIT_PRODUCTS = 8;
|
|
@@ -7,18 +7,18 @@ var jsxRuntime = require('react/jsx-runtime');
|
|
|
7
7
|
var react = require('react');
|
|
8
8
|
require('zustand');
|
|
9
9
|
var BuilderPreviewContext = require('../../contexts/BuilderPreviewContext.js');
|
|
10
|
-
require('swr');
|
|
11
|
-
require('@gem-sdk/adapter-shopify');
|
|
12
|
-
require('swr/mutation');
|
|
13
|
-
var shop = require('../../hooks/shop.js');
|
|
14
|
-
require('swr/infinite');
|
|
15
|
-
require('vanilla-lazyload');
|
|
16
|
-
require('../../hooks/useCartUI.js');
|
|
17
10
|
require('react-transition-group');
|
|
18
11
|
require('@gem-sdk/core');
|
|
12
|
+
require('swr');
|
|
13
|
+
require('swr/infinite');
|
|
14
|
+
var shop = require('../../hooks/shop.js');
|
|
19
15
|
require('classnames');
|
|
20
16
|
require('dayjs');
|
|
21
17
|
require('../../helpers/convert.js');
|
|
18
|
+
require('@gem-sdk/adapter-shopify');
|
|
19
|
+
require('swr/mutation');
|
|
20
|
+
require('vanilla-lazyload');
|
|
21
|
+
require('../../hooks/useCartUI.js');
|
|
22
22
|
|
|
23
23
|
function Spacing(props) {
|
|
24
24
|
const isThemeSectionEditor = BuilderPreviewContext.useBuilderPreviewStore((s)=>s.isThemeSectionEditor);
|
|
@@ -7,14 +7,14 @@ var ThemeSectionTooltip = require('./ThemeSectionTooltip.js');
|
|
|
7
7
|
require('zustand');
|
|
8
8
|
var ShopContext = require('../../contexts/ShopContext.js');
|
|
9
9
|
require('swr');
|
|
10
|
-
require('@gem-sdk/adapter-shopify');
|
|
11
|
-
require('swr/mutation');
|
|
12
10
|
require('swr/infinite');
|
|
13
|
-
require('vanilla-lazyload');
|
|
14
|
-
require('../../hooks/useCartUI.js');
|
|
15
11
|
require('classnames');
|
|
16
12
|
require('dayjs');
|
|
17
13
|
require('../../helpers/convert.js');
|
|
14
|
+
require('@gem-sdk/adapter-shopify');
|
|
15
|
+
require('swr/mutation');
|
|
16
|
+
require('vanilla-lazyload');
|
|
17
|
+
require('../../hooks/useCartUI.js');
|
|
18
18
|
|
|
19
19
|
const SHOW_TOOLTIP_TIMEOUT = 600;
|
|
20
20
|
const NUMBER_OF_THEME_SECTION_CREATED_TO_SHOW_TOOLTIP = 1;
|
|
@@ -4,8 +4,19 @@
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
var zustand = require('zustand');
|
|
7
|
-
|
|
7
|
+
require('swr');
|
|
8
|
+
require('@gem-sdk/adapter-shopify');
|
|
9
|
+
require('swr/mutation');
|
|
10
|
+
require('swr/infinite');
|
|
11
|
+
require('vanilla-lazyload');
|
|
12
|
+
require('../hooks/useCartUI.js');
|
|
8
13
|
var variant = require('../helpers/variant.js');
|
|
14
|
+
require('react-transition-group');
|
|
15
|
+
require('@gem-sdk/core');
|
|
16
|
+
require('classnames');
|
|
17
|
+
require('dayjs');
|
|
18
|
+
var flattenConnection = require('../helpers/flatten-connection.js');
|
|
19
|
+
require('../helpers/convert.js');
|
|
9
20
|
|
|
10
21
|
// const { Provider, useStore } = createContext<StoreApi<ProductContextProps>>();
|
|
11
22
|
const ProductContext = /*#__PURE__*/ react.createContext(null);
|
|
@@ -31,16 +42,6 @@ const createProductStoreProvider = (data)=>zustand.createStore((set, get)=>({
|
|
|
31
42
|
useProductCompareAtPrice: value
|
|
32
43
|
});
|
|
33
44
|
},
|
|
34
|
-
setShouldRequireUploadMessage: (value)=>{
|
|
35
|
-
set({
|
|
36
|
-
shouldRequireUploadMessage: value
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
setRequireUpload: (value)=>{
|
|
40
|
-
set({
|
|
41
|
-
requireUpload: value
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
45
|
addProperty: (data)=>{
|
|
45
46
|
const properties = get().properties;
|
|
46
47
|
if (!properties?.some((v)=>v.key === data.key)) {
|
|
@@ -73,12 +73,9 @@ 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') {
|
|
77
77
|
return `url(${imageByDevice})`;
|
|
78
78
|
}
|
|
79
|
-
if (imageByDevice !== undefined) {
|
|
80
|
-
return 'none';
|
|
81
|
-
}
|
|
82
79
|
};
|
|
83
80
|
const getStyleBgPosition = (background)=>{
|
|
84
81
|
const bgPosition = {
|
|
@@ -219,10 +216,9 @@ const getGradientBgrStyleByDevice = (backgroundStyle, ignoreBackgroundImage)=>{
|
|
|
219
216
|
'mobile'
|
|
220
217
|
].forEach((device)=>{
|
|
221
218
|
if (backgroundStyle[device]?.color?.includes(GRADIENT_BGR_KEY)) {
|
|
222
|
-
const bgImage = `${getBgImageByDevice(backgroundStyle, device) || 'url()'}, ${backgroundStyle[device]?.color}`;
|
|
223
219
|
Object.assign(bgrStyle, {
|
|
224
220
|
[`--bgc${device !== 'desktop' ? '-' + device : ''}`]: backgroundStyle[device]?.color,
|
|
225
|
-
[`--bgi${device !== 'desktop' ? '-' + device : ''}`]: !ignoreBackgroundImage?.[device] ? `${backgroundStyle[device]?.color}` :
|
|
221
|
+
[`--bgi${device !== 'desktop' ? '-' + device : ''}`]: !ignoreBackgroundImage?.[device] ? `${backgroundStyle[device]?.color}` : `${getBgImageByDevice(backgroundStyle, device) || 'url()'}, ${backgroundStyle[device]?.color}`
|
|
226
222
|
});
|
|
227
223
|
}
|
|
228
224
|
});
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var colors = require('./colors.js');
|
|
4
4
|
var makeStyle = require('./make-style.js');
|
|
5
|
-
var constant = require('./constant.js');
|
|
6
5
|
|
|
7
6
|
const getBorderStyle = (value)=>{
|
|
8
7
|
return makeStyle.makeStyle({
|
|
@@ -188,24 +187,8 @@ const composeBorderCss = (borderV)=>{
|
|
|
188
187
|
${color ? `border-color: ${colors.getSingleColorVariable(color)};` : ''}
|
|
189
188
|
`;
|
|
190
189
|
};
|
|
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
|
-
};
|
|
206
190
|
|
|
207
191
|
exports.composeBorderCss = composeBorderCss;
|
|
208
|
-
exports.composeBorderResponsive = composeBorderResponsive;
|
|
209
192
|
exports.getBorderRadiusStyle = getBorderRadiusStyle;
|
|
210
193
|
exports.getBorderStyle = getBorderStyle;
|
|
211
194
|
exports.handleConvertBorderColor = handleConvertBorderColor;
|
|
@@ -112,45 +112,7 @@ function composeAdvanceStyle(data, tag, pageType) {
|
|
|
112
112
|
Object.assign(styles, radius.composeRadius(value));
|
|
113
113
|
}
|
|
114
114
|
if (attr === 'boxShadow') {
|
|
115
|
-
|
|
116
|
-
'Section',
|
|
117
|
-
'Row',
|
|
118
|
-
'Text',
|
|
119
|
-
'Heading',
|
|
120
|
-
'Image',
|
|
121
|
-
'Button',
|
|
122
|
-
'HeroBanner',
|
|
123
|
-
'ImageComparison',
|
|
124
|
-
'Countdown',
|
|
125
|
-
'Video'
|
|
126
|
-
];
|
|
127
|
-
const productElements = [
|
|
128
|
-
'ProductTitle',
|
|
129
|
-
'ProductDescription',
|
|
130
|
-
'ProductPrice',
|
|
131
|
-
'ProductVendor',
|
|
132
|
-
'Product',
|
|
133
|
-
'ProductSku'
|
|
134
|
-
];
|
|
135
|
-
const boostElements = [
|
|
136
|
-
'Icon',
|
|
137
|
-
'IconListHoz',
|
|
138
|
-
'Line'
|
|
139
|
-
];
|
|
140
|
-
const listElementShadowV2 = [
|
|
141
|
-
...baseElements,
|
|
142
|
-
...productElements,
|
|
143
|
-
...boostElements
|
|
144
|
-
];
|
|
145
|
-
let hasBoxShadowV2 = hasBoxShadow;
|
|
146
|
-
if (listElementShadowV2.includes(tag || '')) {
|
|
147
|
-
hasBoxShadowV2 = {
|
|
148
|
-
desktop: value.desktop ?? {},
|
|
149
|
-
tablet: value.tablet ?? value.desktop ?? {},
|
|
150
|
-
mobile: value.mobile ?? value.tablet ?? value.desktop ?? {}
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
Object.assign(styles, shadow.getResponsiveStyleShadow(value, 'box-shadow', hasBoxShadowV2 ?? hasBoxShadow));
|
|
115
|
+
Object.assign(styles, shadow.getResponsiveStyleShadow(value, 'box-shadow', hasBoxShadow));
|
|
154
116
|
}
|
|
155
117
|
const styleValue = getAttrValue(attr, deviceValue, tag);
|
|
156
118
|
if (composeAttr === 'desktop') {
|
|
@@ -5,17 +5,17 @@ var react = require('react');
|
|
|
5
5
|
require('react/jsx-runtime');
|
|
6
6
|
require('zustand');
|
|
7
7
|
var PageContext = require('../../contexts/PageContext.js');
|
|
8
|
-
require('swr');
|
|
9
|
-
require('@gem-sdk/adapter-shopify');
|
|
10
|
-
require('swr/mutation');
|
|
11
|
-
require('swr/infinite');
|
|
12
|
-
require('vanilla-lazyload');
|
|
13
|
-
require('../../hooks/useCartUI.js');
|
|
14
8
|
require('react-transition-group');
|
|
15
9
|
require('@gem-sdk/core');
|
|
10
|
+
require('swr');
|
|
11
|
+
require('swr/infinite');
|
|
16
12
|
require('classnames');
|
|
17
13
|
require('dayjs');
|
|
18
14
|
require('../convert.js');
|
|
15
|
+
require('@gem-sdk/adapter-shopify');
|
|
16
|
+
require('swr/mutation');
|
|
17
|
+
require('vanilla-lazyload');
|
|
18
|
+
require('../../hooks/useCartUI.js');
|
|
19
19
|
|
|
20
20
|
const useInteraction = ()=>{
|
|
21
21
|
const ref = react.useRef();
|
|
@@ -27,15 +27,7 @@ const getRadiusCSSFromGlobal = (state, key, device)=>{
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
const getCustomRadius = (state, radius, device)=>{
|
|
30
|
-
|
|
31
|
-
'custom',
|
|
32
|
-
'pill',
|
|
33
|
-
'rounded',
|
|
34
|
-
'single',
|
|
35
|
-
'none',
|
|
36
|
-
'circle'
|
|
37
|
-
];
|
|
38
|
-
if (!radius || !state || !list.includes(radius?.radiusType ?? '')) return {};
|
|
30
|
+
if (!radius || !state || radius?.radiusType !== 'custom') return {};
|
|
39
31
|
const suffix = device && device !== 'desktop' ? constant.devicesMapping?.[device] : '';
|
|
40
32
|
const mState = constant.stateMapping?.[state];
|
|
41
33
|
return {
|
|
@@ -70,7 +62,6 @@ const composeRadiusState = (radiusValue, device)=>{
|
|
|
70
62
|
case 'circle':
|
|
71
63
|
case 'none':
|
|
72
64
|
case 'custom':
|
|
73
|
-
case 'rounded':
|
|
74
65
|
Object.assign(style, getCustomRadius('normal', radiusValue.normal, device));
|
|
75
66
|
break;
|
|
76
67
|
}
|
|
@@ -83,7 +74,6 @@ const composeRadiusState = (radiusValue, device)=>{
|
|
|
83
74
|
case 'circle':
|
|
84
75
|
case 'none':
|
|
85
76
|
case 'custom':
|
|
86
|
-
case 'rounded':
|
|
87
77
|
Object.assign(style, getCustomRadius('hover', radiusValue.hover, device));
|
|
88
78
|
break;
|
|
89
79
|
}
|
|
@@ -96,7 +86,6 @@ const composeRadiusState = (radiusValue, device)=>{
|
|
|
96
86
|
case 'circle':
|
|
97
87
|
case 'none':
|
|
98
88
|
case 'custom':
|
|
99
|
-
case 'rounded':
|
|
100
89
|
Object.assign(style, getCustomRadius('focus', radiusValue.focus, device));
|
|
101
90
|
break;
|
|
102
91
|
}
|
|
@@ -130,7 +119,6 @@ const composeCornerCss = (value, important = false)=>{
|
|
|
130
119
|
break;
|
|
131
120
|
case 'circle':
|
|
132
121
|
case 'none':
|
|
133
|
-
case 'rounded':
|
|
134
122
|
case 'custom':
|
|
135
123
|
radiusValue = `
|
|
136
124
|
${bblr ? `border-bottom-left-radius: ${bblr}${sub};` : ''}
|
|
@@ -24,11 +24,10 @@ const getStyleShadow = (shadowStyle, isActiveState = false)=>{
|
|
|
24
24
|
let { state } = shadowStyle || {};
|
|
25
25
|
if (!state) state = 'normal';
|
|
26
26
|
if (!styleAppliedFor || !value) return {};
|
|
27
|
-
|
|
28
|
-
if (typeof value.distance == 'undefined' && !isNoneValue) return {};
|
|
27
|
+
if (typeof value.distance == 'undefined') return {};
|
|
29
28
|
const { value: distance, unit: unitDistance } = parseValueWithUnit(`${value?.distance}`);
|
|
30
29
|
return {
|
|
31
|
-
[`-${!isActiveState ? constant.stateMapping?.[state] || '' : ''}-${getShortname.getShortName(styleAppliedFor)}${shadowStyle.screen ? `-${shadowStyle.screen}` : ''}`]: isEnableShadow
|
|
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'
|
|
32
31
|
};
|
|
33
32
|
};
|
|
34
33
|
const getStyleShadowState = (shadow, styleAppliedFor, isEnableShadow, screen)=>{
|
|
@@ -55,30 +54,6 @@ const getResponsiveStyleShadow = (value, styleAppliedFor, isEnableShadow)=>{
|
|
|
55
54
|
};
|
|
56
55
|
}
|
|
57
56
|
};
|
|
58
|
-
const getResponsiveStyleShadowWithoutState = (value, styleAppliedFor, isEnableShadow)=>{
|
|
59
|
-
if (!value) return undefined;
|
|
60
|
-
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
61
|
-
return {
|
|
62
|
-
...getStyleShadow({
|
|
63
|
-
value: value.desktop,
|
|
64
|
-
styleAppliedFor,
|
|
65
|
-
isEnableShadow: isEnableShadow.desktop
|
|
66
|
-
}),
|
|
67
|
-
...value.tablet && (isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadow({
|
|
68
|
-
value: value.tablet,
|
|
69
|
-
styleAppliedFor,
|
|
70
|
-
isEnableShadow: isEnableShadow.tablet ?? isEnableShadow.desktop,
|
|
71
|
-
screen: 'tablet'
|
|
72
|
-
}) : undefined,
|
|
73
|
-
...value.mobile && (isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop) ? getStyleShadow({
|
|
74
|
-
value: value.mobile,
|
|
75
|
-
styleAppliedFor,
|
|
76
|
-
isEnableShadow: isEnableShadow.mobile ?? isEnableShadow.tablet ?? isEnableShadow.desktop,
|
|
77
|
-
screen: 'mobile'
|
|
78
|
-
}) : undefined
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
57
|
const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
|
|
83
58
|
if (!hasBoxShadow) return undefined;
|
|
84
59
|
if (!boxShadowValue) return undefined;
|
|
@@ -89,7 +64,6 @@ const composeShadowCss = ({ hasBoxShadow, boxShadowValue, important })=>{
|
|
|
89
64
|
|
|
90
65
|
exports.composeShadowCss = composeShadowCss;
|
|
91
66
|
exports.getResponsiveStyleShadow = getResponsiveStyleShadow;
|
|
92
|
-
exports.getResponsiveStyleShadowWithoutState = getResponsiveStyleShadowWithoutState;
|
|
93
67
|
exports.getStyleShadow = getStyleShadow;
|
|
94
68
|
exports.getStyleShadowState = getStyleShadowState;
|
|
95
69
|
exports.parseValueWithUnit = parseValueWithUnit;
|
package/dist/cjs/helpers/size.js
CHANGED
|
@@ -190,26 +190,6 @@ const getPaddingGlobalSize = (globalSize)=>{
|
|
|
190
190
|
const getValueByDevice = (value, device)=>{
|
|
191
191
|
return value?.[device] === undefined ? value?.desktop === undefined ? value?.tablet : value?.desktop : value?.[device];
|
|
192
192
|
};
|
|
193
|
-
const getPaddingStyleByDevice = (value, device)=>{
|
|
194
|
-
if (!value) return {};
|
|
195
|
-
const suffix = constant.devicesMapping[device || ''] ?? '';
|
|
196
|
-
return {
|
|
197
|
-
[`--pl${suffix}`]: value?.left,
|
|
198
|
-
[`--pr${suffix}`]: value?.right,
|
|
199
|
-
[`--pt${suffix}`]: value?.top,
|
|
200
|
-
[`--pb${suffix}`]: value?.bottom
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
const getResponsiveStylePadding = (value)=>{
|
|
204
|
-
if (!value) return undefined;
|
|
205
|
-
if ('desktop' in value || 'tablet' in value || 'mobile' in value) {
|
|
206
|
-
return {
|
|
207
|
-
...getPaddingStyleByDevice(value?.desktop),
|
|
208
|
-
...getPaddingStyleByDevice(value?.tablet, 'tablet'),
|
|
209
|
-
...getPaddingStyleByDevice(value?.mobile, 'mobile')
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
193
|
|
|
214
194
|
exports.composeSize = composeSize;
|
|
215
195
|
exports.composeSizeCss = composeSizeCss;
|
|
@@ -218,8 +198,6 @@ exports.getAspectRatioGlobalSize = getAspectRatioGlobalSize;
|
|
|
218
198
|
exports.getGlobalSizeGap = getGlobalSizeGap;
|
|
219
199
|
exports.getHeightByShapeGlobalSize = getHeightByShapeGlobalSize;
|
|
220
200
|
exports.getPaddingGlobalSize = getPaddingGlobalSize;
|
|
221
|
-
exports.getPaddingStyleByDevice = getPaddingStyleByDevice;
|
|
222
|
-
exports.getResponsiveStylePadding = getResponsiveStylePadding;
|
|
223
201
|
exports.getValueByDevice = getValueByDevice;
|
|
224
202
|
exports.getWidthByShapeGlobalSize = getWidthByShapeGlobalSize;
|
|
225
203
|
exports.getWidthHeightGlobalSize = getWidthHeightGlobalSize;
|