@gem-sdk/core 1.43.0-staging.9 → 1.43.2
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.
|
@@ -28,10 +28,11 @@ const root = {
|
|
|
28
28
|
label: 'Root',
|
|
29
29
|
childrens: []
|
|
30
30
|
};
|
|
31
|
-
const createBuilderPreviewProvider = (args, isThemeSectionEditor)=>zustand.createStore((set, get)=>({
|
|
31
|
+
const createBuilderPreviewProvider = (args, pageName, isThemeSectionEditor)=>zustand.createStore((set, get)=>({
|
|
32
32
|
state: args,
|
|
33
33
|
loaded: false,
|
|
34
34
|
isThemeSectionEditor: !!isThemeSectionEditor,
|
|
35
|
+
pageName: pageName,
|
|
35
36
|
dynamicProduct: null,
|
|
36
37
|
dynamicCollection: null,
|
|
37
38
|
addItem: (args)=>{
|
|
@@ -450,13 +451,14 @@ const createBuilderPreviewProvider = (args, isThemeSectionEditor)=>zustand.creat
|
|
|
450
451
|
}
|
|
451
452
|
}
|
|
452
453
|
}));
|
|
453
|
-
const BuilderPreviewProvider = ({ children, state, isThemeSectionEditor, lazy, ...passProps })=>{
|
|
454
|
+
const BuilderPreviewProvider = ({ children, state, isThemeSectionEditor, pageName, lazy, ...passProps })=>{
|
|
454
455
|
const Component = lazy ? react.Suspense : react.Fragment;
|
|
455
456
|
const value = react.useMemo(()=>{
|
|
456
|
-
return createBuilderPreviewProvider(state, isThemeSectionEditor);
|
|
457
|
+
return createBuilderPreviewProvider(state, pageName, isThemeSectionEditor);
|
|
457
458
|
}, [
|
|
458
459
|
state,
|
|
459
|
-
isThemeSectionEditor
|
|
460
|
+
isThemeSectionEditor,
|
|
461
|
+
pageName
|
|
460
462
|
]);
|
|
461
463
|
return /*#__PURE__*/ jsxRuntime.jsx(Component, {
|
|
462
464
|
children: /*#__PURE__*/ jsxRuntime.jsx(BuilderPreviewContext.Provider, {
|
|
@@ -2,24 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
var getResonsiveValue = require('./get-resonsive-value.js');
|
|
4
4
|
|
|
5
|
-
const getCarouselContainerHeight = (dotStyle
|
|
6
|
-
const getVal = (dotStyle
|
|
7
|
-
|
|
8
|
-
return `calc(100% - ${dotSize ?? '0'}px - ${!dotGapToCarousel || dotGapToCarousel === 'Auto' ? '0' : dotGapToCarousel}px)`;
|
|
9
|
-
}
|
|
10
|
-
return '100%';
|
|
5
|
+
const getCarouselContainerHeight = (dotStyle)=>{
|
|
6
|
+
const getVal = (dotStyle)=>{
|
|
7
|
+
return dotStyle === 'outside' ? 'auto' : '100%';
|
|
11
8
|
};
|
|
12
9
|
return {
|
|
13
|
-
desktop: getVal(getResonsiveValue.getResponsiveValueByScreen(dotStyle, 'desktop')
|
|
14
|
-
tablet: getVal(getResonsiveValue.getResponsiveValueByScreen(dotStyle, 'tablet')
|
|
15
|
-
mobile: getVal(getResonsiveValue.getResponsiveValueByScreen(dotStyle, 'mobile')
|
|
10
|
+
desktop: getVal(getResonsiveValue.getResponsiveValueByScreen(dotStyle, 'desktop')),
|
|
11
|
+
tablet: getVal(getResonsiveValue.getResponsiveValueByScreen(dotStyle, 'tablet')),
|
|
12
|
+
mobile: getVal(getResonsiveValue.getResponsiveValueByScreen(dotStyle, 'mobile'))
|
|
16
13
|
};
|
|
17
14
|
};
|
|
18
15
|
const makeContainerWidthOrHeight = (setting)=>{
|
|
19
16
|
const getStyleName = (vertical)=>{
|
|
20
17
|
return vertical ? 'w' : 'h';
|
|
21
18
|
};
|
|
22
|
-
const result = getCarouselContainerHeight(setting.dotStyle
|
|
19
|
+
const result = getCarouselContainerHeight(setting.dotStyle);
|
|
23
20
|
return {
|
|
24
21
|
[`--${getStyleName(getResonsiveValue.getResponsiveValueByScreen(setting?.vertical, 'desktop'))}`]: result.desktop,
|
|
25
22
|
[`--${getStyleName(getResonsiveValue.getResponsiveValueByScreen(setting?.vertical, 'tablet'))}-tablet`]: result.tablet,
|
|
@@ -26,10 +26,11 @@ const root = {
|
|
|
26
26
|
label: 'Root',
|
|
27
27
|
childrens: []
|
|
28
28
|
};
|
|
29
|
-
const createBuilderPreviewProvider = (args, isThemeSectionEditor)=>createStore((set, get)=>({
|
|
29
|
+
const createBuilderPreviewProvider = (args, pageName, isThemeSectionEditor)=>createStore((set, get)=>({
|
|
30
30
|
state: args,
|
|
31
31
|
loaded: false,
|
|
32
32
|
isThemeSectionEditor: !!isThemeSectionEditor,
|
|
33
|
+
pageName: pageName,
|
|
33
34
|
dynamicProduct: null,
|
|
34
35
|
dynamicCollection: null,
|
|
35
36
|
addItem: (args)=>{
|
|
@@ -448,13 +449,14 @@ const createBuilderPreviewProvider = (args, isThemeSectionEditor)=>createStore((
|
|
|
448
449
|
}
|
|
449
450
|
}
|
|
450
451
|
}));
|
|
451
|
-
const BuilderPreviewProvider = ({ children, state, isThemeSectionEditor, lazy, ...passProps })=>{
|
|
452
|
+
const BuilderPreviewProvider = ({ children, state, isThemeSectionEditor, pageName, lazy, ...passProps })=>{
|
|
452
453
|
const Component = lazy ? Suspense : Fragment;
|
|
453
454
|
const value = useMemo(()=>{
|
|
454
|
-
return createBuilderPreviewProvider(state, isThemeSectionEditor);
|
|
455
|
+
return createBuilderPreviewProvider(state, pageName, isThemeSectionEditor);
|
|
455
456
|
}, [
|
|
456
457
|
state,
|
|
457
|
-
isThemeSectionEditor
|
|
458
|
+
isThemeSectionEditor,
|
|
459
|
+
pageName
|
|
458
460
|
]);
|
|
459
461
|
return /*#__PURE__*/ jsx(Component, {
|
|
460
462
|
children: /*#__PURE__*/ jsx(BuilderPreviewContext.Provider, {
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
import { getResponsiveValueByScreen } from './get-resonsive-value.js';
|
|
2
2
|
|
|
3
|
-
const getCarouselContainerHeight = (dotStyle
|
|
4
|
-
const getVal = (dotStyle
|
|
5
|
-
|
|
6
|
-
return `calc(100% - ${dotSize ?? '0'}px - ${!dotGapToCarousel || dotGapToCarousel === 'Auto' ? '0' : dotGapToCarousel}px)`;
|
|
7
|
-
}
|
|
8
|
-
return '100%';
|
|
3
|
+
const getCarouselContainerHeight = (dotStyle)=>{
|
|
4
|
+
const getVal = (dotStyle)=>{
|
|
5
|
+
return dotStyle === 'outside' ? 'auto' : '100%';
|
|
9
6
|
};
|
|
10
7
|
return {
|
|
11
|
-
desktop: getVal(getResponsiveValueByScreen(dotStyle, 'desktop')
|
|
12
|
-
tablet: getVal(getResponsiveValueByScreen(dotStyle, 'tablet')
|
|
13
|
-
mobile: getVal(getResponsiveValueByScreen(dotStyle, 'mobile')
|
|
8
|
+
desktop: getVal(getResponsiveValueByScreen(dotStyle, 'desktop')),
|
|
9
|
+
tablet: getVal(getResponsiveValueByScreen(dotStyle, 'tablet')),
|
|
10
|
+
mobile: getVal(getResponsiveValueByScreen(dotStyle, 'mobile'))
|
|
14
11
|
};
|
|
15
12
|
};
|
|
16
13
|
const makeContainerWidthOrHeight = (setting)=>{
|
|
17
14
|
const getStyleName = (vertical)=>{
|
|
18
15
|
return vertical ? 'w' : 'h';
|
|
19
16
|
};
|
|
20
|
-
const result = getCarouselContainerHeight(setting.dotStyle
|
|
17
|
+
const result = getCarouselContainerHeight(setting.dotStyle);
|
|
21
18
|
return {
|
|
22
19
|
[`--${getStyleName(getResponsiveValueByScreen(setting?.vertical, 'desktop'))}`]: result.desktop,
|
|
23
20
|
[`--${getStyleName(getResponsiveValueByScreen(setting?.vertical, 'tablet'))}-tablet`]: result.tablet,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6590,6 +6590,7 @@ type BaseProps<Setting = unknown, Style = unknown, Advanced = AdvancedType> = {
|
|
|
6590
6590
|
uid?: string;
|
|
6591
6591
|
builderData?: BlockEntity;
|
|
6592
6592
|
isPreview?: boolean;
|
|
6593
|
+
uidTranslate?: string;
|
|
6593
6594
|
};
|
|
6594
6595
|
customAttrs?: Object;
|
|
6595
6596
|
styles?: Style;
|
|
@@ -7697,6 +7698,7 @@ type ProductOffersControlType<T> = SharedControlType<T> & {
|
|
|
7697
7698
|
|
|
7698
7699
|
type DiscountAndShippingFee<T> = SharedControlType<T> & {
|
|
7699
7700
|
type: 'discount-and-shipping-fee-product-offer';
|
|
7701
|
+
multiple: boolean;
|
|
7700
7702
|
};
|
|
7701
7703
|
|
|
7702
7704
|
type PostPurchaseTextareaControlType<T> = SharedControlType<T> & {
|
|
@@ -27307,6 +27309,7 @@ declare const useBuilderStore: <U>(selector: (state: ExtractState<StoreApi<Build
|
|
|
27307
27309
|
type BuilderPreviewContextProps = {
|
|
27308
27310
|
state: BuilderState;
|
|
27309
27311
|
loaded?: boolean;
|
|
27312
|
+
pageName?: string;
|
|
27310
27313
|
isThemeSectionEditor?: boolean;
|
|
27311
27314
|
addItem: (args: {
|
|
27312
27315
|
data: BuilderEntityNested | BuilderEntityNested[];
|
|
@@ -27337,6 +27340,7 @@ type BuilderPreviewProviderProps = Pick<BuilderPreviewContextProps, 'state'> & {
|
|
|
27337
27340
|
lazy?: boolean;
|
|
27338
27341
|
priority?: boolean;
|
|
27339
27342
|
isThemeSectionEditor?: boolean;
|
|
27343
|
+
pageName?: string;
|
|
27340
27344
|
};
|
|
27341
27345
|
declare const BuilderPreviewProvider: React.FC<BuilderPreviewProviderProps>;
|
|
27342
27346
|
declare const useBuilderPreviewStore: <U>(selector: (state: ExtractState<StoreApi<BuilderPreviewContextProps>>) => U, equalityFn?: ((a: U, b: U) => boolean) | undefined) => U;
|
|
@@ -27908,15 +27912,13 @@ declare const handleConvertClassColorDynamicBtn: (value?: BorderStyle) => string
|
|
|
27908
27912
|
declare const composeBorderCss: (borderV?: Border | undefined) => string;
|
|
27909
27913
|
|
|
27910
27914
|
type DotStyle = 'none' | 'inside' | 'outside';
|
|
27911
|
-
declare const getCarouselContainerHeight: <T>(dotStyle?: Partial<Record<NameDevices$1, T>> | undefined
|
|
27915
|
+
declare const getCarouselContainerHeight: <T>(dotStyle?: Partial<Record<NameDevices$1, T>> | undefined) => {
|
|
27912
27916
|
desktop: string | undefined;
|
|
27913
27917
|
tablet: string | undefined;
|
|
27914
27918
|
mobile: string | undefined;
|
|
27915
27919
|
};
|
|
27916
27920
|
declare const makeContainerWidthOrHeight: <T extends ShortHandProperty>(setting: {
|
|
27917
27921
|
dotStyle?: ObjectDevices<DotStyle>;
|
|
27918
|
-
dotSize?: ObjectDevices<number>;
|
|
27919
|
-
dotGapToCarousel?: ObjectDevices<number>;
|
|
27920
27922
|
vertical?: ObjectDevices<boolean>;
|
|
27921
27923
|
}) => {
|
|
27922
27924
|
[x: string]: string | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gem-sdk/core",
|
|
3
|
-
"version": "1.43.
|
|
3
|
+
"version": "1.43.2",
|
|
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.
|
|
31
|
-
"@gem-sdk/styles": "1.
|
|
30
|
+
"@gem-sdk/adapter-shopify": "1.40.0",
|
|
31
|
+
"@gem-sdk/styles": "1.41.8"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"react-error-boundary": "4.0.10",
|