@gem-sdk/core 1.13.42 → 1.14.0-dev.286
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/AddOn.js +1 -18
- package/dist/cjs/components/ComponentWrapper.js +1 -28
- package/dist/cjs/components/ComponentWrapperPreview.js +1 -72
- package/dist/cjs/components/Empty.js +1 -7
- package/dist/cjs/components/Render.js +1 -65
- package/dist/cjs/components/Render.liquid.js +15 -158
- package/dist/cjs/components/RenderBlock.js +1 -54
- package/dist/cjs/components/RenderCustomCode.js +5 -0
- package/dist/cjs/components/RenderPreview.js +1 -66
- package/dist/cjs/components/RenderSection.js +1 -23
- package/dist/cjs/components/constant.js +1 -39
- package/dist/cjs/components/src/product/helpers/variant-presets.js +1 -0
- package/dist/cjs/contexts/AddonContext.js +1 -36
- package/dist/cjs/contexts/BuilderComponent.js +1 -34
- package/dist/cjs/contexts/BuilderContext.js +1 -35
- package/dist/cjs/contexts/BuilderPreviewContext.js +1 -370
- package/dist/cjs/contexts/CartLineContext.js +1 -29
- package/dist/cjs/contexts/CollectionContext.js +1 -38
- package/dist/cjs/contexts/ModalContext.js +1 -47
- package/dist/cjs/contexts/ProductContext.js +1 -149
- package/dist/cjs/contexts/ProductListContext.js +1 -32
- package/dist/cjs/contexts/SectionContext.js +1 -53
- package/dist/cjs/contexts/ShopContext.js +1 -70
- package/dist/cjs/graphql/fragments/analytic.generated.js +2 -6
- package/dist/cjs/graphql/fragments/collection-detail.generated.js +2 -6
- package/dist/cjs/graphql/fragments/collection-product.generated.js +2 -6
- package/dist/cjs/graphql/fragments/collection.generated.js +2 -6
- package/dist/cjs/graphql/fragments/custom-code.generated.js +2 -6
- package/dist/cjs/graphql/fragments/data-seo.generated.js +2 -6
- package/dist/cjs/graphql/fragments/media.generated.js +3 -6
- package/dist/cjs/graphql/fragments/product-little.generated.js +2 -6
- package/dist/cjs/graphql/fragments/product-option-value.generated.js +2 -6
- package/dist/cjs/graphql/fragments/product-option.generated.js +2 -6
- package/dist/cjs/graphql/fragments/product.generated.js +2 -6
- package/dist/cjs/graphql/fragments/published-custom-section.generated.js +2 -6
- package/dist/cjs/graphql/fragments/published-page-section.generated.js +2 -6
- package/dist/cjs/graphql/fragments/published-theme-page.generated.js +2 -6
- package/dist/cjs/graphql/fragments/published-theme-style.generated.js +2 -6
- package/dist/cjs/graphql/fragments/selected-option.generated.js +2 -6
- package/dist/cjs/graphql/fragments/variant.generated.js +2 -6
- package/dist/cjs/graphql/mutations/page-view-up.generated.js +3 -7
- package/dist/cjs/graphql/queries/collection-detail-filter.generated.js +2 -16
- package/dist/cjs/graphql/queries/collection.generated.js +2 -14
- package/dist/cjs/graphql/queries/collections.generated.js +2 -9
- package/dist/cjs/graphql/queries/preview-page.generated.js +2 -14
- package/dist/cjs/graphql/queries/product-little-detail.generated.js +2 -11
- package/dist/cjs/graphql/queries/product-medias.generated.js +2 -8
- package/dist/cjs/graphql/queries/product-value-label.generated.js +7 -0
- package/dist/cjs/graphql/queries/product-variants.generated.js +2 -10
- package/dist/cjs/graphql/queries/products.generated.js +3 -17
- package/dist/cjs/graphql/queries/published-theme-pages.generated.js +2 -14
- package/dist/cjs/graphql/queries/store-property.generated.js +2 -6
- package/dist/cjs/helpers/GlobalEvent.js +1 -19
- package/dist/cjs/helpers/background.js +1 -109
- package/dist/cjs/helpers/borders.js +4 -183
- package/dist/cjs/helpers/clone-deep.js +1 -5
- package/dist/cjs/helpers/cls.js +1 -16
- package/dist/cjs/helpers/colors.js +1 -183
- package/dist/cjs/helpers/compose-advance-style.js +1 -188
- package/dist/cjs/helpers/constant.js +1 -23
- package/dist/cjs/helpers/convert.js +1 -7
- package/dist/cjs/helpers/css-variable.js +1 -7
- package/dist/cjs/helpers/email.js +1 -11
- package/dist/cjs/helpers/flatten-connection.js +1 -9
- package/dist/cjs/helpers/get-resonsive-value.js +1 -31
- package/dist/cjs/helpers/get-shortname.js +1 -92
- package/dist/cjs/helpers/is-browser.js +1 -9
- package/dist/cjs/helpers/is-defined.js +1 -7
- package/dist/cjs/helpers/is-empty-children.js +1 -12
- package/dist/cjs/helpers/is-safari.js +1 -9
- package/dist/cjs/helpers/layout.js +1 -59
- package/dist/cjs/helpers/load-script.js +1 -31
- package/dist/cjs/helpers/make-style.js +1 -128
- package/dist/cjs/helpers/normalize-builder-data.js +1 -23
- package/dist/cjs/helpers/prefetch-queries.js +1 -78
- package/dist/cjs/helpers/product.js +1 -45
- package/dist/cjs/helpers/queries/get-collection.js +1 -220
- package/dist/cjs/helpers/queries/get-collections.js +1 -21
- package/dist/cjs/helpers/queries/get-product-by-slug.js +1 -125
- package/dist/cjs/helpers/queries/get-product.js +1 -154
- package/dist/cjs/helpers/queries/get-products.js +1 -161
- package/dist/cjs/helpers/query.js +1 -29
- package/dist/cjs/helpers/radius.js +6 -134
- package/dist/cjs/helpers/render.js +1 -71
- package/dist/cjs/helpers/shadow.js +1 -56
- package/dist/cjs/helpers/size.js +4 -35
- package/dist/cjs/helpers/spacing.js +1 -43
- package/dist/cjs/helpers/tracking/fpixel.js +1 -28
- package/dist/cjs/helpers/tracking/gtag.js +1 -93
- package/dist/cjs/helpers/tracking/tiktokpixel.js +1 -17
- package/dist/cjs/helpers/typography.js +17 -105
- package/dist/cjs/helpers/variant.js +1 -8
- package/dist/cjs/hooks/cart/use-add-to-cart.js +1 -20
- package/dist/cjs/hooks/cart/use-cart-data.js +1 -28
- package/dist/cjs/hooks/cart/use-cart-discount-codes-update.js +1 -20
- package/dist/cjs/hooks/cart/use-cart-note-update.js +1 -20
- package/dist/cjs/hooks/cart/use-create-cart.js +1 -22
- package/dist/cjs/hooks/cart/use-remove-cart-item.js +1 -20
- package/dist/cjs/hooks/cart/use-update-cart-item.js +1 -20
- package/dist/cjs/hooks/shop/use-collection-query.js +1 -22
- package/dist/cjs/hooks/shop/use-collections-query.js +1 -17
- package/dist/cjs/hooks/shop/use-product-query.js +1 -22
- package/dist/cjs/hooks/shop/use-products-query.js +1 -22
- package/dist/cjs/hooks/shop.js +1 -126
- package/dist/cjs/hooks/use-current-device.js +1 -21
- package/dist/cjs/hooks/use-lazy-video.js +1 -15
- package/dist/cjs/hooks/useCartId.js +1 -44
- package/dist/cjs/hooks/useCartLine.js +1 -11
- package/dist/cjs/hooks/useCartUI.js +1 -48
- package/dist/cjs/hooks/useCollection.js +1 -9
- package/dist/cjs/hooks/useFetchHandle.js +1 -13
- package/dist/cjs/hooks/useFormatMoney.js +1 -58
- package/dist/cjs/hooks/useInitialSwatchesOptions.js +1 -0
- package/dist/cjs/hooks/useIsomorphicLayoutEffect.js +1 -10
- package/dist/cjs/hooks/useLoadScript.js +1 -32
- package/dist/cjs/hooks/useMoney.js +1 -84
- package/dist/cjs/hooks/usePrevious.js +1 -19
- package/dist/cjs/hooks/useProduct.js +1 -124
- package/dist/cjs/hooks/useProductList.js +1 -21
- package/dist/cjs/hooks/useSuspenseFetch.js +1 -27
- package/dist/cjs/hooks/useSwatchesOptions.js +1 -41
- package/dist/cjs/index.js +1 -291
- package/dist/cjs/types/global-style.js +1 -14
- package/dist/cjs/types/shop.js +1 -2
- package/dist/esm/components/AddOn.js +1 -14
- package/dist/esm/components/ComponentWrapper.js +1 -24
- package/dist/esm/components/ComponentWrapperPreview.js +1 -68
- package/dist/esm/components/Empty.js +1 -3
- package/dist/esm/components/Render.js +1 -61
- package/dist/esm/components/Render.liquid.js +15 -153
- package/dist/esm/components/RenderBlock.js +1 -50
- package/dist/esm/components/RenderCustomCode.js +5 -0
- package/dist/esm/components/RenderPreview.js +1 -62
- package/dist/esm/components/RenderSection.js +1 -19
- package/dist/esm/components/constant.js +1 -37
- package/dist/esm/components/src/product/helpers/variant-presets.js +1 -0
- package/dist/esm/contexts/AddonContext.js +1 -32
- package/dist/esm/contexts/BuilderComponent.js +1 -31
- package/dist/esm/contexts/BuilderContext.js +1 -32
- package/dist/esm/contexts/BuilderPreviewContext.js +1 -367
- package/dist/esm/contexts/CartLineContext.js +1 -26
- package/dist/esm/contexts/CollectionContext.js +1 -35
- package/dist/esm/contexts/ModalContext.js +1 -44
- package/dist/esm/contexts/ProductContext.js +1 -146
- package/dist/esm/contexts/ProductListContext.js +1 -28
- package/dist/esm/contexts/SectionContext.js +1 -49
- package/dist/esm/contexts/ShopContext.js +1 -67
- package/dist/esm/graphql/fragments/analytic.generated.js +2 -4
- package/dist/esm/graphql/fragments/collection-detail.generated.js +2 -4
- package/dist/esm/graphql/fragments/collection-product.generated.js +2 -4
- package/dist/esm/graphql/fragments/collection.generated.js +2 -4
- package/dist/esm/graphql/fragments/custom-code.generated.js +2 -4
- package/dist/esm/graphql/fragments/data-seo.generated.js +2 -4
- package/dist/esm/graphql/fragments/media.generated.js +3 -4
- package/dist/esm/graphql/fragments/product-little.generated.js +2 -4
- package/dist/esm/graphql/fragments/product-option-value.generated.js +2 -4
- package/dist/esm/graphql/fragments/product-option.generated.js +2 -4
- package/dist/esm/graphql/fragments/product.generated.js +2 -4
- package/dist/esm/graphql/fragments/published-custom-section.generated.js +2 -4
- package/dist/esm/graphql/fragments/published-page-section.generated.js +2 -4
- package/dist/esm/graphql/fragments/published-theme-page.generated.js +2 -4
- package/dist/esm/graphql/fragments/published-theme-style.generated.js +2 -4
- package/dist/esm/graphql/fragments/selected-option.generated.js +2 -4
- package/dist/esm/graphql/fragments/variant.generated.js +2 -4
- package/dist/esm/graphql/mutations/page-view-up.generated.js +3 -5
- package/dist/esm/graphql/queries/collection-detail-filter.generated.js +10 -22
- package/dist/esm/graphql/queries/collection.generated.js +8 -18
- package/dist/esm/graphql/queries/collections.generated.js +3 -8
- package/dist/esm/graphql/queries/preview-page.generated.js +8 -18
- package/dist/esm/graphql/queries/product-little-detail.generated.js +5 -12
- package/dist/esm/graphql/queries/product-medias.generated.js +2 -6
- package/dist/esm/graphql/queries/product-value-label.generated.js +7 -0
- package/dist/esm/graphql/queries/product-variants.generated.js +4 -10
- package/dist/esm/graphql/queries/products.generated.js +9 -20
- package/dist/esm/graphql/queries/published-theme-pages.generated.js +8 -18
- package/dist/esm/graphql/queries/store-property.generated.js +2 -4
- package/dist/esm/helpers/GlobalEvent.js +1 -15
- package/dist/esm/helpers/background.js +1 -106
- package/dist/esm/helpers/borders.js +4 -175
- package/dist/esm/helpers/clone-deep.js +1 -3
- package/dist/esm/helpers/cls.js +1 -14
- package/dist/esm/helpers/colors.js +1 -168
- package/dist/esm/helpers/compose-advance-style.js +1 -185
- package/dist/esm/helpers/constant.js +1 -19
- package/dist/esm/helpers/convert.js +1 -4
- package/dist/esm/helpers/css-variable.js +1 -5
- package/dist/esm/helpers/email.js +1 -6
- package/dist/esm/helpers/flatten-connection.js +1 -7
- package/dist/esm/helpers/get-resonsive-value.js +1 -27
- package/dist/esm/helpers/get-shortname.js +1 -90
- package/dist/esm/helpers/is-browser.js +1 -5
- package/dist/esm/helpers/is-defined.js +1 -5
- package/dist/esm/helpers/is-empty-children.js +1 -7
- package/dist/esm/helpers/is-safari.js +1 -5
- package/dist/esm/helpers/layout.js +1 -54
- package/dist/esm/helpers/load-script.js +1 -29
- package/dist/esm/helpers/make-style.js +1 -117
- package/dist/esm/helpers/normalize-builder-data.js +1 -21
- package/dist/esm/helpers/prefetch-queries.js +1 -76
- package/dist/esm/helpers/product.js +1 -41
- package/dist/esm/helpers/queries/get-collection.js +1 -217
- package/dist/esm/helpers/queries/get-collections.js +1 -19
- package/dist/esm/helpers/queries/get-product-by-slug.js +1 -123
- package/dist/esm/helpers/queries/get-product.js +1 -150
- package/dist/esm/helpers/queries/get-products.js +1 -159
- package/dist/esm/helpers/query.js +1 -25
- package/dist/esm/helpers/radius.js +6 -127
- package/dist/esm/helpers/render.js +1 -64
- package/dist/esm/helpers/shadow.js +1 -51
- package/dist/esm/helpers/size.js +4 -31
- package/dist/esm/helpers/spacing.js +1 -40
- package/dist/esm/helpers/tracking/fpixel.js +1 -24
- package/dist/esm/helpers/tracking/gtag.js +1 -87
- package/dist/esm/helpers/tracking/tiktokpixel.js +1 -15
- package/dist/esm/helpers/typography.js +17 -96
- package/dist/esm/helpers/variant.js +1 -6
- package/dist/esm/hooks/cart/use-add-to-cart.js +1 -18
- package/dist/esm/hooks/cart/use-cart-data.js +1 -26
- package/dist/esm/hooks/cart/use-cart-discount-codes-update.js +1 -18
- package/dist/esm/hooks/cart/use-cart-note-update.js +1 -18
- package/dist/esm/hooks/cart/use-create-cart.js +1 -20
- package/dist/esm/hooks/cart/use-remove-cart-item.js +1 -18
- package/dist/esm/hooks/cart/use-update-cart-item.js +1 -18
- package/dist/esm/hooks/shop/use-collection-query.js +1 -20
- package/dist/esm/hooks/shop/use-collections-query.js +1 -15
- package/dist/esm/hooks/shop/use-product-query.js +1 -20
- package/dist/esm/hooks/shop/use-products-query.js +1 -20
- package/dist/esm/hooks/shop.js +1 -111
- package/dist/esm/hooks/use-current-device.js +1 -19
- package/dist/esm/hooks/use-lazy-video.js +1 -13
- package/dist/esm/hooks/useCartId.js +1 -40
- package/dist/esm/hooks/useCartLine.js +1 -7
- package/dist/esm/hooks/useCartUI.js +1 -44
- package/dist/esm/hooks/useCollection.js +1 -7
- package/dist/esm/hooks/useFetchHandle.js +1 -11
- package/dist/esm/hooks/useFormatMoney.js +1 -56
- package/dist/esm/hooks/useInitialSwatchesOptions.js +1 -0
- package/dist/esm/hooks/useIsomorphicLayoutEffect.js +1 -6
- package/dist/esm/hooks/useLoadScript.js +1 -28
- package/dist/esm/hooks/useMoney.js +1 -80
- package/dist/esm/hooks/usePrevious.js +1 -17
- package/dist/esm/hooks/useProduct.js +1 -111
- package/dist/esm/hooks/useProductList.js +1 -16
- package/dist/esm/hooks/useSuspenseFetch.js +1 -23
- package/dist/esm/hooks/useSwatchesOptions.js +1 -37
- package/dist/esm/index.js +1 -92
- package/dist/esm/types/global-style.js +1 -11
- package/dist/types/index.d.ts +1228 -1031
- package/package.json +3 -3
|
@@ -1,183 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var isDefined = require('./is-defined.js');
|
|
4
|
-
var constant = require('./constant.js');
|
|
5
|
-
|
|
6
|
-
const getGlobalColorCSSProp = (color)=>{
|
|
7
|
-
return getSingleColorVariable(color);
|
|
8
|
-
};
|
|
9
|
-
const getGlobalColorClass = (type, color)=>{
|
|
10
|
-
if (typeof color !== 'string' || !color || color?.startsWith('#') || color?.startsWith('rgb') || color?.startsWith('hsl') || color?.startsWith('transparent')) return '';
|
|
11
|
-
return `${type}-g-${color}`;
|
|
12
|
-
};
|
|
13
|
-
const getGlobalColorResponsiveClass = (type, data)=>{
|
|
14
|
-
if (!data) return '';
|
|
15
|
-
return Object.entries(data).map(([device, value])=>{
|
|
16
|
-
const clName = getGlobalColorClass(type, value);
|
|
17
|
-
if (!clName) return undefined;
|
|
18
|
-
if (device === 'desktop') {
|
|
19
|
-
return clName;
|
|
20
|
-
} else {
|
|
21
|
-
return `${device}:${clName}`;
|
|
22
|
-
}
|
|
23
|
-
}).filter(isDefined.isDefined).join(' ');
|
|
24
|
-
};
|
|
25
|
-
const getGlobalColorStateClass = (type, data)=>{
|
|
26
|
-
if (!data) return '';
|
|
27
|
-
return Object.entries(data).map(([state, value])=>{
|
|
28
|
-
const clName = getGlobalColorClass(type, value);
|
|
29
|
-
if (!clName) return undefined;
|
|
30
|
-
if (state === 'normal') {
|
|
31
|
-
return clName;
|
|
32
|
-
} else {
|
|
33
|
-
return `${state}:${clName}`;
|
|
34
|
-
}
|
|
35
|
-
}).filter(isDefined.isDefined).join(' ');
|
|
36
|
-
};
|
|
37
|
-
const getGlobalColorStateClassDynamicBtn = (type, data)=>{
|
|
38
|
-
if (!data) return '';
|
|
39
|
-
return Object.entries(data).map(([state, value])=>{
|
|
40
|
-
const clName = getGlobalColorClass(type, value);
|
|
41
|
-
if (!clName) return undefined;
|
|
42
|
-
if (state === 'normal') {
|
|
43
|
-
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${clName}`;
|
|
44
|
-
} else {
|
|
45
|
-
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${state}:${clName}`;
|
|
46
|
-
}
|
|
47
|
-
}).filter(isDefined.isDefined).join(' ');
|
|
48
|
-
};
|
|
49
|
-
const getGlobalColorStateResponsiveClass = (type, data)=>{
|
|
50
|
-
if (!data) return '';
|
|
51
|
-
return Object.entries(data).map(([device, objectState])=>{
|
|
52
|
-
if (device === 'desktop') {
|
|
53
|
-
return Object.entries(objectState).map(([state, value])=>{
|
|
54
|
-
const clName = getGlobalColorClass(type, value);
|
|
55
|
-
if (!clName) return undefined;
|
|
56
|
-
if (state === 'normal') {
|
|
57
|
-
return clName;
|
|
58
|
-
} else {
|
|
59
|
-
return `${state}:${clName}`;
|
|
60
|
-
}
|
|
61
|
-
}).filter(isDefined.isDefined).join(' ');
|
|
62
|
-
} else {
|
|
63
|
-
return Object.entries(objectState).map(([state, value])=>{
|
|
64
|
-
const clName = getGlobalColorClass(type, value);
|
|
65
|
-
if (!clName) return undefined;
|
|
66
|
-
if (state === 'normal') {
|
|
67
|
-
return `${device}:${clName}`;
|
|
68
|
-
} else {
|
|
69
|
-
return `${device}:${state}:${clName}`;
|
|
70
|
-
}
|
|
71
|
-
}).filter(isDefined.isDefined).join(' ');
|
|
72
|
-
}
|
|
73
|
-
}).filter(Boolean).join(' ');
|
|
74
|
-
};
|
|
75
|
-
const getGlobalColorStateResponsiveClassDynamicBtn = (type, data)=>{
|
|
76
|
-
if (!data) return '';
|
|
77
|
-
return Object.entries(data).map(([device, objectState])=>{
|
|
78
|
-
if (device === 'desktop') {
|
|
79
|
-
return Object.entries(objectState).map(([state, value])=>{
|
|
80
|
-
const clName = getGlobalColorClass(type, value);
|
|
81
|
-
if (!clName) return undefined;
|
|
82
|
-
if (state === 'normal') {
|
|
83
|
-
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${clName}`;
|
|
84
|
-
} else {
|
|
85
|
-
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${state}:${clName}`;
|
|
86
|
-
}
|
|
87
|
-
}).filter(isDefined.isDefined).join(' ');
|
|
88
|
-
} else {
|
|
89
|
-
return Object.entries(objectState).map(([state, value])=>{
|
|
90
|
-
const clName = getGlobalColorClass(type, value);
|
|
91
|
-
if (!clName) return undefined;
|
|
92
|
-
if (state === 'normal') {
|
|
93
|
-
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${device}:${clName}`;
|
|
94
|
-
} else {
|
|
95
|
-
return String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${device}:${state}:${clName}`;
|
|
96
|
-
}
|
|
97
|
-
}).filter(isDefined.isDefined).join(' ');
|
|
98
|
-
}
|
|
99
|
-
}).filter(Boolean).join(' ');
|
|
100
|
-
};
|
|
101
|
-
const getGlobalColorResponsiveStyle = (type, data)=>{
|
|
102
|
-
if (!data) return {};
|
|
103
|
-
return Object.fromEntries(Object.entries(data).map(([device, value])=>{
|
|
104
|
-
if (device === 'desktop') {
|
|
105
|
-
return [
|
|
106
|
-
`--${type}`,
|
|
107
|
-
getSingleColorVariable(value)
|
|
108
|
-
];
|
|
109
|
-
} else {
|
|
110
|
-
return [
|
|
111
|
-
`--${type}-${device}`,
|
|
112
|
-
getSingleColorVariable(value)
|
|
113
|
-
];
|
|
114
|
-
}
|
|
115
|
-
}));
|
|
116
|
-
};
|
|
117
|
-
const getGlobalColorStateStyle = (type, data)=>{
|
|
118
|
-
if (!data) return {};
|
|
119
|
-
return Object.fromEntries(Object.entries(data).map(([state, value])=>{
|
|
120
|
-
if (state === 'active') return [];
|
|
121
|
-
return [
|
|
122
|
-
`-${constant.stateMapping?.[state]}-${type}`,
|
|
123
|
-
getSingleColorVariable(value)
|
|
124
|
-
];
|
|
125
|
-
}).filter(isDefined.isDefined));
|
|
126
|
-
};
|
|
127
|
-
const getGlobalColorStateResponsiveStyle = (type, data)=>{
|
|
128
|
-
if (!data) return {};
|
|
129
|
-
return Object.entries(data).map(([device, objectState])=>{
|
|
130
|
-
if (device === 'desktop') {
|
|
131
|
-
return Object.fromEntries(Object.entries(objectState).map(([state, value])=>{
|
|
132
|
-
if (state === 'active') return [];
|
|
133
|
-
return [
|
|
134
|
-
`-${constant.stateMapping[state]}-${type}`,
|
|
135
|
-
getSingleColorVariable(value)
|
|
136
|
-
];
|
|
137
|
-
}).filter(isDefined.isDefined));
|
|
138
|
-
} else {
|
|
139
|
-
return Object.fromEntries(Object.entries(objectState).map(([state, value])=>{
|
|
140
|
-
if (state === 'active') return [];
|
|
141
|
-
return [
|
|
142
|
-
`-${constant.stateMapping[state]}-${type}-${device}`,
|
|
143
|
-
getSingleColorVariable(value)
|
|
144
|
-
];
|
|
145
|
-
}).filter(isDefined.isDefined));
|
|
146
|
-
}
|
|
147
|
-
}).reduce((acc, curr)=>({
|
|
148
|
-
...acc,
|
|
149
|
-
...curr
|
|
150
|
-
}), {});
|
|
151
|
-
};
|
|
152
|
-
const getSingleColorVariable = (color)=>{
|
|
153
|
-
if (!color) return undefined;
|
|
154
|
-
if (isColor(color)) return color;
|
|
155
|
-
return `var(--g-c-${color}, ${color})`;
|
|
156
|
-
};
|
|
157
|
-
function isColor(color) {
|
|
158
|
-
return color?.startsWith('#') || color?.startsWith('rgb') || color?.startsWith('hsl') || color?.startsWith('transparent');
|
|
159
|
-
}
|
|
160
|
-
const getGlobalColorStyle = (data)=>{
|
|
161
|
-
if (!data) return {};
|
|
162
|
-
return {
|
|
163
|
-
'--c': getSingleColorVariable(data)
|
|
164
|
-
};
|
|
165
|
-
};
|
|
166
|
-
const composeTextColorCss = (color)=>{
|
|
167
|
-
return `${color ? `color: ${getSingleColorVariable(color)} !important;` : ''}`;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
exports.composeTextColorCss = composeTextColorCss;
|
|
171
|
-
exports.getGlobalColorCSSProp = getGlobalColorCSSProp;
|
|
172
|
-
exports.getGlobalColorClass = getGlobalColorClass;
|
|
173
|
-
exports.getGlobalColorResponsiveClass = getGlobalColorResponsiveClass;
|
|
174
|
-
exports.getGlobalColorResponsiveStyle = getGlobalColorResponsiveStyle;
|
|
175
|
-
exports.getGlobalColorStateClass = getGlobalColorStateClass;
|
|
176
|
-
exports.getGlobalColorStateClassDynamicBtn = getGlobalColorStateClassDynamicBtn;
|
|
177
|
-
exports.getGlobalColorStateResponsiveClass = getGlobalColorStateResponsiveClass;
|
|
178
|
-
exports.getGlobalColorStateResponsiveClassDynamicBtn = getGlobalColorStateResponsiveClassDynamicBtn;
|
|
179
|
-
exports.getGlobalColorStateResponsiveStyle = getGlobalColorStateResponsiveStyle;
|
|
180
|
-
exports.getGlobalColorStateStyle = getGlobalColorStateStyle;
|
|
181
|
-
exports.getGlobalColorStyle = getGlobalColorStyle;
|
|
182
|
-
exports.getSingleColorVariable = getSingleColorVariable;
|
|
183
|
-
exports.isColor = isColor;
|
|
1
|
+
"use strict";var isDefined=require("./is-defined.js"),constant=require("./constant.js");const getGlobalColorCSSProp=e=>getSingleColorVariable(e),getGlobalColorClass=(e,t)=>"string"!=typeof t||!t||t?.startsWith("#")||t?.startsWith("rgb")||t?.startsWith("hsl")||t?.startsWith("transparent")?"":`${e}-g-${t}`,getGlobalColorResponsiveClass=(e,t)=>t?Object.entries(t).map(([t,o])=>{let l=getGlobalColorClass(e,o);if(l)return"desktop"===t?l:`${t}:${l}`}).filter(isDefined.isDefined).join(" "):"",getGlobalColorStateClass=(e,t)=>t?Object.entries(t).map(([t,o])=>{let l=getGlobalColorClass(e,o);if(l)return"normal"===t?l:`${t}:${l}`}).filter(isDefined.isDefined).join(" "):"",getGlobalColorStateClassDynamicBtn=(e,t)=>t?Object.entries(t).map(([t,o])=>{let l=getGlobalColorClass(e,o);if(l)return"normal"===t?String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${l}`:String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${t}:${l}`}).filter(isDefined.isDefined).join(" "):"",getGlobalColorStateResponsiveClass=(e,t)=>t?Object.entries(t).map(([t,o])=>"desktop"===t?Object.entries(o).map(([t,o])=>{let l=getGlobalColorClass(e,o);if(l)return"normal"===t?l:`${t}:${l}`}).filter(isDefined.isDefined).join(" "):Object.entries(o).map(([o,l])=>{let s=getGlobalColorClass(e,l);if(s)return"normal"===o?`${t}:${s}`:`${t}:${o}:${s}`}).filter(isDefined.isDefined).join(" ")).filter(Boolean).join(" "):"",getGlobalColorStateResponsiveClassDynamicBtn=(e,t)=>t?Object.entries(t).map(([t,o])=>"desktop"===t?Object.entries(o).map(([t,o])=>{let l=getGlobalColorClass(e,o);if(l)return"normal"===t?String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${l}`:String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${t}:${l}`}).filter(isDefined.isDefined).join(" "):Object.entries(o).map(([o,l])=>{let s=getGlobalColorClass(e,l);if(s)return"normal"===o?String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${t}:${s}`:String.raw`[&_.shopify-payment-button\_\_button--unbranded]:${t}:${o}:${s}`}).filter(isDefined.isDefined).join(" ")).filter(Boolean).join(" "):"",getGlobalColorResponsiveStyle=(e,t)=>t?Object.fromEntries(Object.entries(t).map(([t,o])=>"desktop"===t?[`--${e}`,getSingleColorVariable(o)]:[`--${e}-${t}`,getSingleColorVariable(o)])):{},getGlobalColorStateStyle=(e,t)=>t?Object.fromEntries(Object.entries(t).map(([t,o])=>"active"===t?[]:[`-${constant.stateMapping?.[t]}-${e}`,getSingleColorVariable(o)]).filter(isDefined.isDefined)):{},getGlobalColorStateResponsiveStyle=(e,t)=>t?Object.entries(t).map(([t,o])=>"desktop"===t?Object.fromEntries(Object.entries(o).map(([t,o])=>"active"===t?[]:[`-${constant.stateMapping[t]}-${e}`,getSingleColorVariable(o)]).filter(isDefined.isDefined)):Object.fromEntries(Object.entries(o).map(([o,l])=>"active"===o?[]:[`-${constant.stateMapping[o]}-${e}-${t}`,getSingleColorVariable(l)]).filter(isDefined.isDefined))).reduce((e,t)=>({...e,...t}),{}):{},getSingleColorVariable=e=>{if(e)return isColor(e)?e:`var(--g-c-${e}, ${e})`};function isColor(e){return e?.startsWith("#")||e?.startsWith("rgb")||e?.startsWith("hsl")||e?.startsWith("transparent")}const getGlobalColorStyle=e=>e?{"--c":getSingleColorVariable(e)}:{},composeTextColorCss=e=>`${e?`color: ${getSingleColorVariable(e)} !important;`:""}`;exports.composeTextColorCss=composeTextColorCss,exports.getGlobalColorCSSProp=getGlobalColorCSSProp,exports.getGlobalColorClass=getGlobalColorClass,exports.getGlobalColorResponsiveClass=getGlobalColorResponsiveClass,exports.getGlobalColorResponsiveStyle=getGlobalColorResponsiveStyle,exports.getGlobalColorStateClass=getGlobalColorStateClass,exports.getGlobalColorStateClassDynamicBtn=getGlobalColorStateClassDynamicBtn,exports.getGlobalColorStateResponsiveClass=getGlobalColorStateResponsiveClass,exports.getGlobalColorStateResponsiveClassDynamicBtn=getGlobalColorStateResponsiveClassDynamicBtn,exports.getGlobalColorStateResponsiveStyle=getGlobalColorStateResponsiveStyle,exports.getGlobalColorStateStyle=getGlobalColorStateStyle,exports.getGlobalColorStyle=getGlobalColorStyle,exports.getSingleColorVariable=getSingleColorVariable,exports.isColor=isColor;
|
|
@@ -1,188 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var borders = require('./borders.js');
|
|
4
|
-
var colors = require('./colors.js');
|
|
5
|
-
var constant = require('./constant.js');
|
|
6
|
-
var makeStyle = require('./make-style.js');
|
|
7
|
-
var radius = require('./radius.js');
|
|
8
|
-
var shadow = require('./shadow.js');
|
|
9
|
-
|
|
10
|
-
const composeSpacing = ({ source, spacing, type, suffix = '' })=>{
|
|
11
|
-
const { top, left, bottom, right } = spacing;
|
|
12
|
-
if (top) source[`--${type}t${suffix}`] = top;
|
|
13
|
-
if (left) source[`--${type}l${suffix}`] = left;
|
|
14
|
-
if (bottom) source[`--${type}b${suffix}`] = bottom;
|
|
15
|
-
if (right) source[`--${type}r${suffix}`] = right;
|
|
16
|
-
};
|
|
17
|
-
const getAttrValue = (attr, value, tag)=>{
|
|
18
|
-
if (value === undefined || value === null) return undefined;
|
|
19
|
-
switch(attr){
|
|
20
|
-
case 'bgc':
|
|
21
|
-
case 'c':
|
|
22
|
-
return colors.isColor(value.toString()) ? value : `var(--g-c-${value})`;
|
|
23
|
-
case 'd':
|
|
24
|
-
if (!value) return 'none';
|
|
25
|
-
if (value && tag && constant.layoutComponent.includes(tag)) return 'grid';
|
|
26
|
-
return 'block';
|
|
27
|
-
default:
|
|
28
|
-
return value;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
function composeAdvanceStyle(data, tag) {
|
|
32
|
-
if (!data) return {};
|
|
33
|
-
const styles = {};
|
|
34
|
-
const devices = [
|
|
35
|
-
'desktop',
|
|
36
|
-
'tablet',
|
|
37
|
-
'mobile'
|
|
38
|
-
];
|
|
39
|
-
const states = [
|
|
40
|
-
'hover',
|
|
41
|
-
'normal'
|
|
42
|
-
];
|
|
43
|
-
Object.keys(data).forEach((attr)=>{
|
|
44
|
-
const value = data[attr];
|
|
45
|
-
if (value === undefined || value === null) return;
|
|
46
|
-
const hasBoxShadow = data.hasBoxShadow ? data.hasBoxShadow : {};
|
|
47
|
-
if (typeof value === 'object') {
|
|
48
|
-
if (Array.isArray(value)) return;
|
|
49
|
-
Object.keys(value).forEach((composeAttr)=>{
|
|
50
|
-
if (devices.includes(composeAttr)) {
|
|
51
|
-
const deviceValue = value[composeAttr];
|
|
52
|
-
if (deviceValue !== undefined) {
|
|
53
|
-
// Responsive border with state
|
|
54
|
-
if (attr === 'border') {
|
|
55
|
-
Object.assign(styles, borders.handleConvertBorderStyle(value), borders.handleConvertBorderWidth(value), borders.handleConvertBorderColor(value));
|
|
56
|
-
}
|
|
57
|
-
if (attr === 'rounded') {
|
|
58
|
-
Object.assign(styles, radius.composeRadius(value));
|
|
59
|
-
}
|
|
60
|
-
if (composeAttr === 'desktop') {
|
|
61
|
-
switch(attr){
|
|
62
|
-
case 'padding':
|
|
63
|
-
composeSpacing({
|
|
64
|
-
source: styles,
|
|
65
|
-
spacing: deviceValue,
|
|
66
|
-
type: 'p'
|
|
67
|
-
});
|
|
68
|
-
break;
|
|
69
|
-
case 'margin':
|
|
70
|
-
composeSpacing({
|
|
71
|
-
source: styles,
|
|
72
|
-
spacing: deviceValue,
|
|
73
|
-
type: 'm'
|
|
74
|
-
});
|
|
75
|
-
break;
|
|
76
|
-
case 'm':
|
|
77
|
-
case 'p':
|
|
78
|
-
break;
|
|
79
|
-
default:
|
|
80
|
-
styles[`--${attr}`] = getAttrValue(attr, deviceValue, tag);
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
} else {
|
|
84
|
-
switch(attr){
|
|
85
|
-
case 'padding':
|
|
86
|
-
composeSpacing({
|
|
87
|
-
source: styles,
|
|
88
|
-
spacing: deviceValue,
|
|
89
|
-
type: 'p',
|
|
90
|
-
suffix: `-${composeAttr}`
|
|
91
|
-
});
|
|
92
|
-
break;
|
|
93
|
-
case 'margin':
|
|
94
|
-
composeSpacing({
|
|
95
|
-
source: styles,
|
|
96
|
-
spacing: deviceValue,
|
|
97
|
-
type: 'm',
|
|
98
|
-
suffix: `-${composeAttr}`
|
|
99
|
-
});
|
|
100
|
-
break;
|
|
101
|
-
case 'm':
|
|
102
|
-
case 'p':
|
|
103
|
-
break;
|
|
104
|
-
default:
|
|
105
|
-
styles[`--${attr}-${composeAttr}`] = getAttrValue(attr, deviceValue, tag);
|
|
106
|
-
break;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
} else if (states.includes(composeAttr)) {
|
|
111
|
-
switch(attr){
|
|
112
|
-
case 'hasBoxShadow':
|
|
113
|
-
break;
|
|
114
|
-
case 'boxShadow':
|
|
115
|
-
Object.assign(styles, shadow.getStyleShadowState(value, 'box-shadow', hasBoxShadow));
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
} else {
|
|
119
|
-
if (attr === 'border') {
|
|
120
|
-
const borderStyle = value;
|
|
121
|
-
if (borderStyle.border === 'none') {
|
|
122
|
-
borderStyle.border = 'solid';
|
|
123
|
-
borderStyle.color = '#121212';
|
|
124
|
-
borderStyle.isCustom = true;
|
|
125
|
-
borderStyle.width = '0px';
|
|
126
|
-
borderStyle.position = 'all';
|
|
127
|
-
}
|
|
128
|
-
Object.assign(styles, borders.getBorderStyle(borderStyle));
|
|
129
|
-
}
|
|
130
|
-
if (attr === 'rounded') {
|
|
131
|
-
Object.assign(styles, radius.getCornerCSSFromGlobal(value));
|
|
132
|
-
}
|
|
133
|
-
if (attr === 'hasBoxShadow') {
|
|
134
|
-
Object.assign(styles, shadow.getStyleShadow({
|
|
135
|
-
value: data.boxShadow,
|
|
136
|
-
styleAppliedFor: 'box-shadow',
|
|
137
|
-
isEnableShadow: data.hasBoxShadow
|
|
138
|
-
}));
|
|
139
|
-
}
|
|
140
|
-
if (attr === 'boxShadow') {
|
|
141
|
-
Object.assign(styles, shadow.getStyleShadow({
|
|
142
|
-
value: value,
|
|
143
|
-
styleAppliedFor: 'box-shadow',
|
|
144
|
-
isEnableShadow: data.hasBoxShadow
|
|
145
|
-
}));
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
} else {
|
|
150
|
-
styles[`--${attr}`] = getAttrValue(attr, value, tag);
|
|
151
|
-
if (attr === 'hasBoxShadow' && data.boxShadow) {
|
|
152
|
-
Object.assign(styles, shadow.getStyleShadow({
|
|
153
|
-
value: data.boxShadow,
|
|
154
|
-
styleAppliedFor: 'box-shadow',
|
|
155
|
-
isEnableShadow: data.hasBoxShadow
|
|
156
|
-
}));
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
return styles;
|
|
161
|
-
}
|
|
162
|
-
const splitStyle = (keys, style = {})=>{
|
|
163
|
-
const fullKeys = keys.map((key)=>makeStyle.makeStyleKey(key)).flat();
|
|
164
|
-
const splitKeys = Object.keys(style).filter((key)=>{
|
|
165
|
-
return fullKeys.includes(key);
|
|
166
|
-
});
|
|
167
|
-
const splitStyle = splitKeys.reduce((curr, key)=>{
|
|
168
|
-
return {
|
|
169
|
-
...curr,
|
|
170
|
-
[key]: style[key]
|
|
171
|
-
};
|
|
172
|
-
}, {});
|
|
173
|
-
const restStyle = Object.keys(style).filter((key)=>{
|
|
174
|
-
return !splitKeys.includes(key);
|
|
175
|
-
}).reduce((curr, key)=>{
|
|
176
|
-
return {
|
|
177
|
-
...curr,
|
|
178
|
-
[key]: style[key]
|
|
179
|
-
};
|
|
180
|
-
}, {});
|
|
181
|
-
return [
|
|
182
|
-
splitStyle,
|
|
183
|
-
restStyle
|
|
184
|
-
];
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
exports.composeAdvanceStyle = composeAdvanceStyle;
|
|
188
|
-
exports.splitStyle = splitStyle;
|
|
1
|
+
"use strict";var borders=require("./borders.js"),colors=require("./colors.js"),constant=require("./constant.js"),makeStyle=require("./make-style.js"),radius=require("./radius.js"),shadow=require("./shadow.js");const composeSpacing=({source:e,spacing:s,type:o,suffix:a=""})=>{let{top:r,left:t,bottom:i,right:c}=s;r&&(e[`--${o}t${a}`]=r),t&&(e[`--${o}l${a}`]=t),i&&(e[`--${o}b${a}`]=i),c&&(e[`--${o}r${a}`]=c)},composeSpacingV2=({source:e,spacing:s,suffix:o=""})=>{if(s&&s.margin){let{top:a,left:r,bottom:t,right:i}=s.margin;a&&(e[`--mt${o}`]=a),r&&(e[`--ml${o}`]=r),t&&(e[`--mb${o}`]=t),i&&(e[`--mr${o}`]=i)}if(s&&s.padding){let{top:a,left:r,bottom:t,right:i}=s.padding;a&&(e[`--pt${o}`]=a),r&&(e[`--pl${o}`]=r),t&&(e[`--pb${o}`]=t),i&&(e[`--pr${o}`]=i)}},getAttrValue=(e,s,o)=>{if(null!=s)switch(e){case"bgc":case"c":return colors.isColor(s.toString())?s:`var(--g-c-${s})`;case"d":if(!s)return"none";if(s&&o&&constant.layoutComponent.includes(o))return"grid";return"block";default:return s}};function composeAdvanceStyle(e,s){if(!e)return{};let o={},a=["desktop","tablet","mobile"],r=["hover","normal"];return Object.keys(e).forEach(t=>{let i=e[t];if("cssClass"===t||null==i)return;let c=e.hasBoxShadow?e.hasBoxShadow:{};if("object"==typeof i){if(Array.isArray(i))return;Object.keys(i).forEach(d=>{if(a.includes(d)){let e=i[d];if(void 0!==e){if("border"===t&&Object.assign(o,borders.handleConvertBorderStyle(i),borders.handleConvertBorderWidth(i),borders.handleConvertBorderColor(i)),"rounded"===t&&Object.assign(o,radius.composeRadius(i)),"desktop"===d)switch(t){case"padding":composeSpacing({source:o,spacing:e,type:"p"});break;case"margin":composeSpacing({source:o,spacing:e,type:"m"});break;case"spacing-setting":composeSpacingV2({source:o,spacing:e});break;case"m":case"p":break;default:o[`--${t}`]=getAttrValue(t,e,s)}else switch(t){case"padding":composeSpacing({source:o,spacing:e,type:"p",suffix:`-${d}`});break;case"margin":composeSpacing({source:o,spacing:e,type:"m",suffix:`-${d}`});break;case"spacing-setting":composeSpacingV2({source:o,spacing:e,suffix:`-${d}`});break;case"m":case"p":break;default:o[`--${t}-${d}`]=getAttrValue(t,e,s)}}}else if(r.includes(d))switch(t){case"hasBoxShadow":break;case"boxShadow":Object.assign(o,shadow.getStyleShadowState(i,"box-shadow",c))}else"border"===t&&("none"===i.border&&(i.border="solid",i.color="#121212",i.isCustom=!0,i.width="0px",i.position="all"),Object.assign(o,borders.getBorderStyle(i))),"rounded"===t&&Object.assign(o,radius.getCornerCSSFromGlobal(i)),"hasBoxShadow"===t&&Object.assign(o,shadow.getStyleShadow({value:e.boxShadow,styleAppliedFor:"box-shadow",isEnableShadow:e.hasBoxShadow})),"boxShadow"===t&&Object.assign(o,shadow.getStyleShadow({value:i,styleAppliedFor:"box-shadow",isEnableShadow:e.hasBoxShadow}))})}else o[`--${t}`]=getAttrValue(t,i,s),"hasBoxShadow"===t&&e.boxShadow&&Object.assign(o,shadow.getStyleShadow({value:e.boxShadow,styleAppliedFor:"box-shadow",isEnableShadow:e.hasBoxShadow}))}),o}const splitStyle=(e,s={})=>{let o=e.map(e=>makeStyle.makeStyleKey(e)).flat(),a=Object.keys(s).filter(e=>o.includes(e)),r=a.reduce((e,o)=>({...e,[o]:s[o]}),{}),t=Object.keys(s).filter(e=>!a.includes(e)).reduce((e,o)=>({...e,[o]:s[o]}),{});return[r,t]};exports.composeAdvanceStyle=composeAdvanceStyle,exports.splitStyle=splitStyle;
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const stateMapping = {
|
|
4
|
-
normal: '',
|
|
5
|
-
hover: '-hvr',
|
|
6
|
-
focus: '-focus'
|
|
7
|
-
};
|
|
8
|
-
const devicesMapping = {
|
|
9
|
-
desktop: '',
|
|
10
|
-
tablet: '-tablet',
|
|
11
|
-
mobile: '-mobile'
|
|
12
|
-
};
|
|
13
|
-
const layoutComponent = [
|
|
14
|
-
'Row',
|
|
15
|
-
'Section',
|
|
16
|
-
'Product',
|
|
17
|
-
'HeroBanner',
|
|
18
|
-
'CollectionBanner'
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
exports.devicesMapping = devicesMapping;
|
|
22
|
-
exports.layoutComponent = layoutComponent;
|
|
23
|
-
exports.stateMapping = stateMapping;
|
|
1
|
+
"use strict";const stateMapping={normal:"",hover:"-hvr",focus:"-focus"},devicesMapping={desktop:"",tablet:"-tablet",mobile:"-mobile"},layoutComponent=["Row","Section","Product","HeroBanner","CollectionBanner"];exports.devicesMapping=devicesMapping,exports.layoutComponent=layoutComponent,exports.stateMapping=stateMapping;
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const isLocalEnv = process.env.NEXT_CONVERT_ENV === 'local';
|
|
4
|
-
const baseAssetURL = process.env.GP_BASE_ASSET_URL || 'https://d3kbi0je7pp4lw.cloudfront.net';
|
|
5
|
-
|
|
6
|
-
exports.baseAssetURL = baseAssetURL;
|
|
7
|
-
exports.isLocalEnv = isLocalEnv;
|
|
1
|
+
"use strict";const isLocalEnv="local"===process.env.NEXT_CONVERT_ENV,baseAssetURL=process.env.GP_BASE_ASSET_URL||"https://d3kbi0je7pp4lw.cloudfront.net";exports.baseAssetURL=baseAssetURL,exports.isLocalEnv=isLocalEnv;
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const validateEmail = (email)=>{
|
|
6
|
-
const emailRegex = new RegExp(/^(?:[^<>()[\]\\.,;:\s@"]+(?:\.[^<>()[\]\\.,;:\s@"]+)*|".+")@(?:\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]|(?:[a-zA-Z\-\d]+\.)+[a-zA-Z]{2,})$/);
|
|
7
|
-
return emailRegex.test(email);
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
exports.default = validateEmail;
|
|
11
|
-
exports.validateEmail = validateEmail;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const validateEmail=e=>{let t=new RegExp(/^(?:[^<>()[\]\\.,;:\s@"]+(?:\.[^<>()[\]\\.,;:\s@"]+)*|".+")@(?:\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]|(?:[a-zA-Z\-\d]+\.)+[a-zA-Z]{2,})$/);return t.test(e)};exports.default=validateEmail,exports.validateEmail=validateEmail;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The `flattenConnection` utility transforms a connection object from the Storefront API (for example, [Product-related connections](api/storefront/reference/products/product#connections)) into a flat array of nodes.
|
|
5
|
-
*/ const flattenConnection = (connection)=>{
|
|
6
|
-
return connection?.edges?.map((edge)=>edge.node) ?? [];
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
exports.flattenConnection = flattenConnection;
|
|
1
|
+
"use strict";const flattenConnection=n=>n?.edges?.map(n=>n.node)??[];exports.flattenConnection=flattenConnection;
|
|
@@ -1,31 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const getResponsiveValue = (input, k)=>{
|
|
4
|
-
if (!k) return {};
|
|
5
|
-
return {
|
|
6
|
-
desktop: input?.desktop?.[k],
|
|
7
|
-
tablet: input?.tablet?.[k],
|
|
8
|
-
mobile: input?.mobile?.[k]
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
const getResponsiveStateValue = (k, input)=>{
|
|
12
|
-
return {
|
|
13
|
-
desktop: input?.desktop?.[k],
|
|
14
|
-
tablet: input?.tablet?.[k],
|
|
15
|
-
mobile: input?.mobile?.[k]
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
const getResponsiveValueByScreen = (value, breakpoint, defaultValue)=>{
|
|
19
|
-
switch(breakpoint){
|
|
20
|
-
case 'tablet':
|
|
21
|
-
return value?.tablet ?? value?.desktop ?? defaultValue;
|
|
22
|
-
case 'mobile':
|
|
23
|
-
return value?.mobile ?? value?.tablet ?? value?.desktop ?? defaultValue;
|
|
24
|
-
default:
|
|
25
|
-
return value?.desktop ?? defaultValue;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
exports.getResponsiveStateValue = getResponsiveStateValue;
|
|
30
|
-
exports.getResponsiveValue = getResponsiveValue;
|
|
31
|
-
exports.getResponsiveValueByScreen = getResponsiveValueByScreen;
|
|
1
|
+
"use strict";const getResponsiveValue=(e,t)=>t?{desktop:e?.desktop?.[t],tablet:e?.tablet?.[t],mobile:e?.mobile?.[t]}:{},getResponsiveStateValue=(e,t)=>({desktop:t?.desktop?.[e],tablet:t?.tablet?.[e],mobile:t?.mobile?.[e]}),getResponsiveValueByScreen=(e,t,s)=>{switch(t){case"tablet":return e?.tablet??e?.desktop??s;case"mobile":return e?.mobile??e?.tablet??e?.desktop??s;default:return e?.desktop??s}},isColumnDirectionExist=(e,t)=>"desktop"!==t&&"tablet"!==t&&e?.[t]?.cols?.length!==e?.desktop?.cols?.length;exports.getResponsiveStateValue=getResponsiveStateValue,exports.getResponsiveValue=getResponsiveValue,exports.getResponsiveValueByScreen=getResponsiveValueByScreen,exports.isColumnDirectionExist=isColumnDirectionExist;
|
|
@@ -1,92 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const globalSortNameMapping = {
|
|
4
|
-
'typography-heading-1-fontFamily': 'h1-ff',
|
|
5
|
-
'typography-heading-1-fontSize': 'h1-size',
|
|
6
|
-
'typography-heading-1-fontWeight': 'h1-weight',
|
|
7
|
-
'typography-heading-1-lineHeight': 'h1-lh',
|
|
8
|
-
'typography-heading-1-letterSpacing': 'h1-ls',
|
|
9
|
-
'typography-heading-1-fontStyle': 'h1-fs',
|
|
10
|
-
'typography-heading-2-fontFamily': 'h2-ff',
|
|
11
|
-
'typography-heading-2-fontSize': 'h2-size',
|
|
12
|
-
'typography-heading-2-fontWeight': 'h2-weight',
|
|
13
|
-
'typography-heading-2-lineHeight': 'h2-lh',
|
|
14
|
-
'typography-heading-2-letterSpacing': 'h2-ls',
|
|
15
|
-
'typography-heading-2-fontStyle': 'h2-fs',
|
|
16
|
-
'typography-heading-3-fontFamily': 'h3-ff',
|
|
17
|
-
'typography-heading-3-fontSize': 'h3-size',
|
|
18
|
-
'typography-heading-3-fontWeight': 'h3-weight',
|
|
19
|
-
'typography-heading-3-lineHeight': 'h3-lh',
|
|
20
|
-
'typography-heading-3-letterSpacing': 'h3-ls',
|
|
21
|
-
'typography-heading-3-fontStyle': 'h3-fs',
|
|
22
|
-
'typography-subheading-1-fontFamily': 'sh1-ff',
|
|
23
|
-
'typography-subheading-1-fontSize': 'sh1-size',
|
|
24
|
-
'typography-subheading-1-fontWeight': 'sh1-weight',
|
|
25
|
-
'typography-subheading-1-lineHeight': 'sh1-lh',
|
|
26
|
-
'typography-subheading-1-letterSpacing': 'sh1-ls',
|
|
27
|
-
'typography-subheading-1-fontStyle': 'sh1-fs',
|
|
28
|
-
'typography-subheading-2-fontFamily': 'sh2-ff',
|
|
29
|
-
'typography-subheading-2-fontSize': 'sh2-size',
|
|
30
|
-
'typography-subheading-2-fontWeight': 'sh2-weight',
|
|
31
|
-
'typography-subheading-2-lineHeight': 'sh2-lh',
|
|
32
|
-
'typography-subheading-2-letterSpacing': 'sh2-ls',
|
|
33
|
-
'typography-subheading-2-fontStyle': 'sh2-fs',
|
|
34
|
-
'typography-subheading-3-fontFamily': 'sh3-ff',
|
|
35
|
-
'typography-subheading-3-fontSize': 'sh3-size',
|
|
36
|
-
'typography-subheading-3-fontWeight': 'sh3-weight',
|
|
37
|
-
'typography-subheading-3-lineHeight': 'sh3-lh',
|
|
38
|
-
'typography-subheading-3-letterSpacing': 'sh3-ls',
|
|
39
|
-
'typography-subheading-3-fontStyle': 'sh3-fs',
|
|
40
|
-
'typography-paragraph-1-fontFamily': 'p1-ff',
|
|
41
|
-
'typography-paragraph-1-fontSize': 'p1-size',
|
|
42
|
-
'typography-paragraph-1-fontWeight': 'p1-weight',
|
|
43
|
-
'typography-paragraph-1-lineHeight': 'p1-lh',
|
|
44
|
-
'typography-paragraph-1-letterSpacing': 'p1-ls',
|
|
45
|
-
'typography-paragraph-1-fontStyle': 'p1-fs',
|
|
46
|
-
'typography-paragraph-2-fontFamily': 'p2-ff',
|
|
47
|
-
'typography-paragraph-2-fontSize': 'p2-size',
|
|
48
|
-
'typography-paragraph-2-fontWeight': 'p2-weight',
|
|
49
|
-
'typography-paragraph-2-lineHeight': 'p2-lh',
|
|
50
|
-
'typography-paragraph-2-letterSpacing': 'p2-ls',
|
|
51
|
-
'typography-paragraph-2-fontStyle': 'p2-fs',
|
|
52
|
-
'typography-paragraph-3-fontFamily': 'p3-ff',
|
|
53
|
-
'typography-paragraph-3-fontSize': 'p3-size',
|
|
54
|
-
'typography-paragraph-3-fontWeight': 'p3-weight',
|
|
55
|
-
'typography-paragraph-3-lineHeight': 'p3-lh',
|
|
56
|
-
'typography-paragraph-3-letterSpacing': 'p3-ls',
|
|
57
|
-
'typography-paragraph-3-fontStyle': 'p3-fs',
|
|
58
|
-
'color-brand': 'c-brand',
|
|
59
|
-
'color-highlight': 'c-highlight',
|
|
60
|
-
'color-text-1': 'c-text-1',
|
|
61
|
-
'color-text-2': 'c-text-2',
|
|
62
|
-
'color-text-3': 'c-text-3',
|
|
63
|
-
'color-bg-1': 'c-bg-1',
|
|
64
|
-
'color-bg-2': 'c-bg-2',
|
|
65
|
-
'color-bg-3': 'c-bg-3',
|
|
66
|
-
'color-line-1': 'c-line-1',
|
|
67
|
-
'color-line-2': 'c-line-2',
|
|
68
|
-
'color-line-3': 'c-line-3',
|
|
69
|
-
'color-success': 'c-success',
|
|
70
|
-
'color-info': 'c-info',
|
|
71
|
-
'color-warning': 'c-warning',
|
|
72
|
-
'color-error': 'c-error',
|
|
73
|
-
'spacing-xxs': 's-xxs',
|
|
74
|
-
'spacing-xs': 's-xs',
|
|
75
|
-
'spacing-s': 's-s',
|
|
76
|
-
'spacing-m': 's-m',
|
|
77
|
-
'spacing-l': 's-l',
|
|
78
|
-
'spacing-xl': 's-xl',
|
|
79
|
-
'spacing-2xl': 's-2xl',
|
|
80
|
-
'spacing-3xl': 's-3xl',
|
|
81
|
-
'spacing-4xl': 's-4xl',
|
|
82
|
-
'spacing-5xl': 's-5xl',
|
|
83
|
-
'container-width': 'ct-w',
|
|
84
|
-
'container-padding': 'ct-p',
|
|
85
|
-
'text-shadow': 'ts',
|
|
86
|
-
'box-shadow': 'shadow'
|
|
87
|
-
};
|
|
88
|
-
function getShortName(name) {
|
|
89
|
-
return globalSortNameMapping[name] || name;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
exports.getShortName = getShortName;
|
|
1
|
+
"use strict";const globalSortNameMapping={"typography-heading-1-fontFamily":"h1-ff","typography-heading-1-fontSize":"h1-size","typography-heading-1-fontWeight":"h1-weight","typography-heading-1-lineHeight":"h1-lh","typography-heading-1-letterSpacing":"h1-ls","typography-heading-1-fontStyle":"h1-fs","typography-heading-2-fontFamily":"h2-ff","typography-heading-2-fontSize":"h2-size","typography-heading-2-fontWeight":"h2-weight","typography-heading-2-lineHeight":"h2-lh","typography-heading-2-letterSpacing":"h2-ls","typography-heading-2-fontStyle":"h2-fs","typography-heading-3-fontFamily":"h3-ff","typography-heading-3-fontSize":"h3-size","typography-heading-3-fontWeight":"h3-weight","typography-heading-3-lineHeight":"h3-lh","typography-heading-3-letterSpacing":"h3-ls","typography-heading-3-fontStyle":"h3-fs","typography-subheading-1-fontFamily":"sh1-ff","typography-subheading-1-fontSize":"sh1-size","typography-subheading-1-fontWeight":"sh1-weight","typography-subheading-1-lineHeight":"sh1-lh","typography-subheading-1-letterSpacing":"sh1-ls","typography-subheading-1-fontStyle":"sh1-fs","typography-subheading-2-fontFamily":"sh2-ff","typography-subheading-2-fontSize":"sh2-size","typography-subheading-2-fontWeight":"sh2-weight","typography-subheading-2-lineHeight":"sh2-lh","typography-subheading-2-letterSpacing":"sh2-ls","typography-subheading-2-fontStyle":"sh2-fs","typography-subheading-3-fontFamily":"sh3-ff","typography-subheading-3-fontSize":"sh3-size","typography-subheading-3-fontWeight":"sh3-weight","typography-subheading-3-lineHeight":"sh3-lh","typography-subheading-3-letterSpacing":"sh3-ls","typography-subheading-3-fontStyle":"sh3-fs","typography-paragraph-1-fontFamily":"p1-ff","typography-paragraph-1-fontSize":"p1-size","typography-paragraph-1-fontWeight":"p1-weight","typography-paragraph-1-lineHeight":"p1-lh","typography-paragraph-1-letterSpacing":"p1-ls","typography-paragraph-1-fontStyle":"p1-fs","typography-paragraph-2-fontFamily":"p2-ff","typography-paragraph-2-fontSize":"p2-size","typography-paragraph-2-fontWeight":"p2-weight","typography-paragraph-2-lineHeight":"p2-lh","typography-paragraph-2-letterSpacing":"p2-ls","typography-paragraph-2-fontStyle":"p2-fs","typography-paragraph-3-fontFamily":"p3-ff","typography-paragraph-3-fontSize":"p3-size","typography-paragraph-3-fontWeight":"p3-weight","typography-paragraph-3-lineHeight":"p3-lh","typography-paragraph-3-letterSpacing":"p3-ls","typography-paragraph-3-fontStyle":"p3-fs","color-brand":"c-brand","color-highlight":"c-highlight","color-text-1":"c-text-1","color-text-2":"c-text-2","color-text-3":"c-text-3","color-bg-1":"c-bg-1","color-bg-2":"c-bg-2","color-bg-3":"c-bg-3","color-line-1":"c-line-1","color-line-2":"c-line-2","color-line-3":"c-line-3","color-success":"c-success","color-info":"c-info","color-warning":"c-warning","color-error":"c-error","spacing-xxs":"s-xxs","spacing-xs":"s-xs","spacing-s":"s-s","spacing-m":"s-m","spacing-l":"s-l","spacing-xl":"s-xl","spacing-2xl":"s-2xl","spacing-3xl":"s-3xl","spacing-4xl":"s-4xl","spacing-5xl":"s-5xl","container-width":"ct-w","container-padding":"ct-p","text-shadow":"ts","box-shadow":"shadow"};function getShortName(h){return globalSortNameMapping[h]||h}exports.getShortName=getShortName;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
function isBrowser() {
|
|
6
|
-
return typeof window !== 'undefined';
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
exports.default = isBrowser;
|
|
1
|
+
"use strict";function isBrowser(){return"undefined"!=typeof window}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=isBrowser;
|
|
@@ -1,12 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var react = require('react');
|
|
6
|
-
|
|
7
|
-
const isEmptyChildren = (children)=>{
|
|
8
|
-
return react.Children.count(children) < 1 || !children;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
exports.default = isEmptyChildren;
|
|
12
|
-
exports.isEmptyChildren = isEmptyChildren;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var react=require("react");const isEmptyChildren=e=>1>react.Children.count(e)||!e;exports.default=isEmptyChildren,exports.isEmptyChildren=isEmptyChildren;
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
function isSafari() {
|
|
6
|
-
return navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
exports.default = isSafari;
|
|
1
|
+
"use strict";function isSafari(){return -1!=navigator.userAgent.indexOf("Safari")&&-1==navigator.userAgent.indexOf("Chrome")}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=isSafari;
|